All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.dist.CustomElementsRegistry.js.map Maven / Gradle / Ivy

{"version":3,"file":"CustomElementsRegistry.js","sourceRoot":"","sources":["../src/CustomElementsRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAGxF,MAAM,IAAI,GAAG,iBAAiB,CAAsB,MAAM,EAAE,IAAI,GAAG,EAAE,CAAC,CAAC;AACvE,MAAM,WAAW,GAAG,IAAI,GAAG,EAAU,CAAC;AAEtC,IAAI,QAAQ,GAAG,IAAI,GAAG,EAAuB,CAAC;AAC9C,IAAI,cAAmC,CAAC;AAExC,MAAM,eAAe,GAAG,CAAC,CAAC,CAAC;AAE3B,MAAM,WAAW,GAAG,CAAC,GAAW,EAAE,EAAE;IACnC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACrB,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,sBAAsB,EAAE,CAAC,CAAC;AACzC,CAAC,CAAC;AAEF,MAAM,eAAe,GAAG,CAAC,GAAW,EAAE,EAAE;IACvC,OAAO,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAC7B,CAAC,CAAC;AAEF,MAAM,oBAAoB,GAAG,GAAG,EAAE;IACjC,OAAO,CAAC,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC;AAClC,CAAC,CAAC;AAEF,MAAM,4BAA4B,GAAG,CAAC,GAAW,EAAE,EAAE;IACpD,IAAI,kBAAkB,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACvC,IAAI,kBAAkB,KAAK,SAAS,EAAE;QACrC,kBAAkB,GAAG,eAAe,CAAC,CAAC,mHAAmH;KACzJ;IAED,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,kBAAkB,CAAC,EAAE;QACtC,QAAQ,CA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,CAAC,CAAC;SAC9C;QAED,IAAI,WAAW,CAAC;QAChB,IAAI,UAAU,GAAG,CAAC,EAAE;YACnB,WAAW,GAAG,UAAU,CAAC;SACzB;aAAM,IAAI,UAAU,GAAG,CAAC,EAAE;YAC1B,WAAW,GAAG,SAAS,CAAC;SACxB;aAAM;YACN,WAAW,GAAG,UAAU,CAAC;SACzB;QACD,OAAO,GAAG,GAAG,OAAO,QAAQ,cAAc,CAAC,WAAW,sBAAsB,QAAQ,CAAC,GAAG,CAAC,iBAAiB,CAAE,CAAC,IAAI,gDAAgD,WAAW,aAAa,YAAY,CAAC,WAAW,MAAM,CAAC,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,iBAAiB,CAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;QAEpR,IAAI,UAAU,GAAG,CAAC,EAAE;YACnB,OAAO,GAAG,GAAG,OAAO,qFAAqF,YAAY,CAAC,WAAW,kCAAkC,CAAC;SACpK;aAAM;YACN,OAAO,GAAG,GAAG,OAAO,+HAA+H,CAAC;SACpJ;IACF,CAAC,CAAC,CAAC;IAEH,OAAO,GAAG,GAAG,OAAO,oNAAoN,CAAC;IAEzO,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,sBAAsB;AAC9C,CAAC,CAAC;AAEF,OAAO,EACN,WAAW,EACX,eAAe,EACf,oBAAoB,EACpB,4BAA4B,GAC5B,CAAC","sourcesContent":["import getSharedResource from \"./getSharedResource.js\";\nimport { getCurrentRuntimeIndex, compareRuntimes, getAllRuntimes } from \"./Runtimes.js\";\nimport type { Timeout } from \"./types.js\";\n\nconst Tags = getSharedResource>(\"Tags\", new Map());\nconst Definitions = new Set();\n\nlet Failures = new Map>();\nlet failureTimeout: Timeout | undefined;\n\nconst UNKNOWN_RUNTIME = -1;\n\nconst registerTag = (tag: string) => {\n\tDefinitions.add(tag);\n\tTags.set(tag, getCurrentRuntimeIndex());\n};\n\nconst isTagRegistered = (tag: string) => {\n\treturn Definitions.has(tag);\n};\n\nconst getAllRegisteredTags = () => {\n\treturn [...Definitions.values()];\n};\n\nconst recordTagRegistrationFailure = (tag: string) => {\n\tlet tagRegRuntimeIndex = Tags.get(tag);\n\tif (tagRegRuntimeIndex === undefined) {\n\t\ttagRegRuntimeIndex = UNKNOWN_RUNTIME; // If the tag is taken, but not registered in Tags, then a version before 1.1.0 defined it => use the \"unknown\" key\n\t}\n\n\tif (!Failures.has(tagRegRuntimeIndex)) {\n\t\tFailures.set(tagRegRuntimeIndex, new Set());\n\t}\n\tFailures.get(tagRegRuntimeIndex)!.add(tag);\n\n\tif (!failureTimeout) {\n\t\tfailureTimeout = setTimeout(() => {\n\t\t\tdisplayFailedRegistrations();\n\t\t\tFailures = new Map();\n\t\t\tfailureTimeout = undefined;\n\t\t}, 1000);\n\t}\n};\n\nconst displayFailedRegistrations = () => {\n\tconst allRuntimes = getAllRuntimes();\n\tconst currentRuntimeIndex = getCurrentRuntimeIndex();\n\tconst currentRuntime = allRuntimes[currentRuntimeIndex];\n\n\tlet message = `Multiple UI5 Web Components instances detected.`;\n\n\tif (allRuntimes.length > 1) {\n\t\tmessage = `${message}\\nLoading order (versions before 1.1.0 not listed): ${allRuntimes.map(runtime => `\\n${runtime.description}`).join(\"\")}`;\n\t}\n\n\t[...Failures.keys()].forEach(otherRuntimeIndex => {\n\t\tlet comparison: number;\n\t\tlet otherRuntime;\n\n\t\tif (otherRuntimeIndex === UNKNOWN_RUNTIME) { // version < 1.1.0 defined the tag\n\t\t\tcomparison = 1; // the current runtime is considered newer\n\t\t\totherRuntime = {\n\t\t\t\tdescription: `Older unknown runtime`,\n\t\t\t};\n\t\t} else {\n\t\t\tcomparison = compareRuntimes(currentRuntimeIndex, otherRuntimeIndex);\n\t\t\totherRuntime = allRuntimes[otherRuntimeIndex];\n\t\t}\n\n\t\tlet compareWord;\n\t\tif (comparison > 0) {\n\t\t\tcompareWord = \"an older\";\n\t\t} else if (comparison < 0) {\n\t\t\tcompareWord = \"a newer\";\n\t\t} else {\n\t\t\tcompareWord = \"the same\";\n\t\t}\n\t\tmessage = `${message}\\n\\n\"${currentRuntime.description}\" failed to define ${Failures.get(otherRuntimeIndex)!.size} tag(s) as they were defined by a runtime of ${compareWord} version \"${otherRuntime.description}\": ${([...Failures.get(otherRuntimeIndex)!]).sort().join(\", \")}.`;\n\n\t\tif (comparison > 0) {\n\t\t\tmessage = `${message}\\nWARNING! If your code uses features of the above web components, unavailable in ${otherRuntime.description}, it might not work as expected!`;\n\t\t} else {\n\t\t\tmessage = `${message}\\nSince the above web components were defined by the same or newer version runtime, they should be compatible with your code.`;\n\t\t}\n\t});\n\n\tmessage = `${message}\\n\\nTo prevent other runtimes from defining tags that you use, consider using scoping or have third-party libraries use scoping: https://github.com/SAP/ui5-webcomponents/blob/main/docs/2-advanced/03-scoping.md.`;\n\n\tconsole.warn(message); // eslint-disable-line\n};\n\nexport {\n\tregisterTag,\n\tisTagRegistered,\n\tgetAllRegisteredTags,\n\trecordTagRegistrationFailure,\n};\n"]}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy