@kosdev-code/kos-ui-plugin 2.0.1 → 2.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dev.cjs +7 -7
- package/dev.cjs.map +1 -1
- package/dev.js +37 -34
- package/dev.js.map +1 -1
- package/index.cjs +6 -6
- package/index.cjs.map +1 -1
- package/index.js +49 -57
- package/index.js.map +1 -1
- package/lib/dev/components/storybook/control-pour-story-container/control-pour-story-container.d.ts +8 -0
- package/lib/dev/components/storybook/control-pour-story-container/control-pour-story-container.d.ts.map +1 -0
- package/lib/dev/components/storybook/control-pour-story-container/index.d.ts +2 -0
- package/lib/dev/components/storybook/control-pour-story-container/index.d.ts.map +1 -0
- package/lib/dev/components/storybook/index.d.ts +1 -0
- package/lib/dev/components/storybook/index.d.ts.map +1 -1
- package/lib/hooks/use-dynamic-component.d.ts +20 -0
- package/lib/hooks/use-dynamic-component.d.ts.map +1 -1
- package/lib/utils/contribution-reducer.d.ts.map +1 -1
- package/lib/utils/control-pour-reducer.d.ts +5 -0
- package/lib/utils/control-pour-reducer.d.ts.map +1 -0
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.d.ts.map +1 -1
- package/lib/utils/initialize-plugins.d.ts +39 -0
- package/lib/utils/initialize-plugins.d.ts.map +1 -1
- package/lib/utils/plugin-extension-manager.d.ts.map +1 -1
- package/lib/utils/plugin-extension-registry-init.d.ts +2 -0
- package/lib/utils/plugin-extension-registry-init.d.ts.map +1 -0
- package/lib/utils/plugin-extension-registry.d.ts +6 -0
- package/lib/utils/plugin-extension-registry.d.ts.map +1 -0
- package/lib/utils/resolve-best-extension.d.ts +12 -0
- package/lib/utils/resolve-best-extension.d.ts.map +1 -0
- package/package.json +2 -2
- package/resolve-best-extension-D5Ord7XK.cjs +2 -0
- package/resolve-best-extension-D5Ord7XK.cjs.map +1 -0
- package/resolve-best-extension-DAJIkfJh.js +272 -0
- package/resolve-best-extension-DAJIkfJh.js.map +1 -0
- package/types/global.d.ts +5 -0
- package/types/plugins.d.ts +6 -1
- package/utils.cjs +1 -1
- package/utils.cjs.map +1 -1
- package/utils.js +344 -101
- package/utils.js.map +1 -1
- package/plugin-extension-manager-7xDx0VSt.js +0 -524
- package/plugin-extension-manager-7xDx0VSt.js.map +0 -1
- package/plugin-extension-manager-D9aw-mUM.cjs +0 -2
- package/plugin-extension-manager-D9aw-mUM.cjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-best-extension-D5Ord7XK.cjs","sources":["../../../../node_modules/@nx/react/mf/dynamic-federation.js","../../../../node_modules/@nx/react/mf/index.js","../../../../packages/sdk/kos-ui-plugin/src/lib/utils/contribution-reducer.ts","../../../../packages/sdk/kos-ui-plugin/src/lib/utils/plugin-extension-registry.ts","../../../../packages/sdk/kos-ui-plugin/src/lib/utils/plugin-extension-manager.ts","../../../../packages/sdk/kos-ui-plugin/src/lib/utils/resolve-best-extension.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.loadRemoteModule = exports.setRemoteDefinitions = exports.setRemoteUrlResolver = void 0;\nlet remoteUrlDefinitions;\nlet resolveRemoteUrl;\nconst remoteModuleMap = new Map();\nconst remoteContainerMap = new Map();\nlet initialSharingScopeCreated = false;\nfunction setRemoteUrlResolver(_resolveRemoteUrl) {\n resolveRemoteUrl = _resolveRemoteUrl;\n}\nexports.setRemoteUrlResolver = setRemoteUrlResolver;\nfunction setRemoteDefinitions(definitions) {\n remoteUrlDefinitions = definitions;\n}\nexports.setRemoteDefinitions = setRemoteDefinitions;\nasync function loadRemoteModule(remoteName, moduleName) {\n const remoteModuleKey = `${remoteName}:${moduleName}`;\n if (remoteModuleMap.has(remoteModuleKey)) {\n return remoteModuleMap.get(remoteModuleKey);\n }\n const container = remoteContainerMap.has(remoteName)\n ? remoteContainerMap.get(remoteName)\n : await loadRemoteContainer(remoteName);\n const factory = await container.get(moduleName);\n const Module = factory();\n remoteModuleMap.set(remoteModuleKey, Module);\n return Module;\n}\nexports.loadRemoteModule = loadRemoteModule;\nconst fetchRemoteModule = (url, remoteName) => {\n return new Promise((resolve, reject) => {\n const script = document.createElement('script');\n script.src = url;\n script.type = 'text/javascript';\n script.async = true;\n script.onload = () => {\n const proxy = {\n get: (request) => window[remoteName].get(request),\n init: (arg) => {\n try {\n window[remoteName].init(arg);\n }\n catch (e) {\n console.error(`Failed to initialize remote ${remoteName}`, e);\n reject(e);\n }\n },\n };\n resolve(proxy);\n };\n script.onerror = () => reject(new Error(`Remote ${remoteName} not found`));\n document.head.appendChild(script);\n });\n};\nasync function loadRemoteContainer(remoteName) {\n if (!resolveRemoteUrl && !remoteUrlDefinitions) {\n throw new Error('Call setRemoteDefinitions or setRemoteUrlResolver to allow Dynamic Federation to find the remote apps correctly.');\n }\n if (!initialSharingScopeCreated) {\n initialSharingScopeCreated = true;\n await __webpack_init_sharing__('default');\n }\n const remoteUrl = remoteUrlDefinitions\n ? remoteUrlDefinitions[remoteName]\n : await resolveRemoteUrl(remoteName);\n let containerUrl = remoteUrl;\n if (!remoteUrl.endsWith('.mjs') && !remoteUrl.endsWith('.js')) {\n containerUrl = `${remoteUrl}${remoteUrl.endsWith('/') ? '' : '/'}remoteEntry.js`;\n }\n const container = await fetchRemoteModule(containerUrl, remoteName);\n await container.init(__webpack_share_scopes__.default);\n remoteContainerMap.set(remoteName, container);\n return container;\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.setRemoteUrlResolver = exports.setRemoteDefinitions = exports.loadRemoteModule = void 0;\nvar dynamic_federation_1 = require(\"./dynamic-federation\");\nObject.defineProperty(exports, \"loadRemoteModule\", { enumerable: true, get: function () { return dynamic_federation_1.loadRemoteModule; } });\nObject.defineProperty(exports, \"setRemoteDefinitions\", { enumerable: true, get: function () { return dynamic_federation_1.setRemoteDefinitions; } });\nObject.defineProperty(exports, \"setRemoteUrlResolver\", { enumerable: true, get: function () { return dynamic_federation_1.setRemoteUrlResolver; } });\n","import type { DynamicRemotes } from \"../../types/global\";\nimport type { ProcessedContributions } from \"../../types/plugins\";\n\nexport const contributionReducer =\n (remotes: DynamicRemotes) => (acc: ProcessedContributions, key: string) => {\n acc.cuiDefinitions = acc.cuiDefinitions || {};\n\n const remote = remotes[key].remote;\n const sectionId = key;\n const cuiConfigurations = remotes[key].contributes?.cui || [];\n cuiConfigurations.forEach((cuiConfiguration) => {\n acc.cuiDefinitions[cuiConfiguration.id] = {\n ...cuiConfiguration,\n cuiDescriptor: sectionId,\n remote,\n sectionId,\n };\n });\n\n const navViewConfigurations = remotes[key].contributes?.navViews || [];\n navViewConfigurations.forEach((configuration) => {\n acc.navViewDefinitions[configuration.id] = {\n ...configuration,\n remote,\n sectionId,\n };\n });\n const utilConfigurations = remotes[key].contributes?.utilities || [];\n utilConfigurations.forEach((configuration) => {\n acc.utilDefinitions[configuration.id] = {\n ...configuration,\n remote,\n sectionId,\n };\n });\n\n const setupConfigurations = remotes[key].contributes?.setupStep || [];\n setupConfigurations.forEach((configuration) => {\n acc.setupDefinitions[configuration.id] = {\n ...configuration,\n remote,\n sectionId,\n };\n });\n\n const troubleActionConfigurations =\n remotes[key].contributes?.troubleActions || [];\n troubleActionConfigurations.forEach((configuration) => {\n acc.troubleActionDefinitions[configuration.id] = {\n ...configuration,\n remote,\n sectionId,\n };\n });\n\n const controlPourConfigurations =\n remotes[key].contributes?.controlPour || [];\n controlPourConfigurations.forEach((configuration) => {\n acc.controlPourDefinitions[configuration.id] = {\n ...configuration,\n remote,\n sectionId,\n };\n });\n\n const settingsGroupConfigurations =\n remotes[key].contributes?.settingsGroup || [];\n settingsGroupConfigurations.forEach((configuration) => {\n acc.settingsGroupDefinitions[configuration.id] = {\n ...configuration,\n settings: [],\n remote,\n sectionId,\n };\n });\n\n const settingsConfigurations = remotes[key].contributes?.settings || [];\n settingsConfigurations.forEach((configuration) => {\n acc.settingsDefinitions[configuration.id] = {\n ...configuration,\n remote,\n sectionId,\n };\n });\n\n const dashboardSummaryConfigurations =\n remotes[key].contributes?.dashboardSummary || [];\n dashboardSummaryConfigurations.forEach((configuration) => {\n acc.dashboardDefinitions[configuration.dashboardKey] =\n acc.dashboardDefinitions[configuration.dashboardKey] || {};\n acc.dashboardDefinitions[configuration.dashboardKey].summary = {\n ...configuration,\n remote,\n sectionId,\n };\n acc.dashboardSummaryDefinitions[configuration.id] = {\n ...configuration,\n remote,\n sectionId,\n };\n });\n\n const dashboardDetailConfigurations =\n remotes[key].contributes?.dashboardDetail || [];\n dashboardDetailConfigurations.forEach((configuration) => {\n acc.dashboardDefinitions[configuration.dashboardKey] =\n acc.dashboardDefinitions[configuration.dashboardKey] || {};\n acc.dashboardDefinitions[configuration.dashboardKey].detail = {\n ...configuration,\n remote,\n sectionId,\n };\n acc.dashboardDetailDefinitions[configuration.id] = {\n ...configuration,\n remote,\n sectionId,\n };\n });\n\n const dashboardDetailPumpConfigurations =\n remotes[key].contributes?.dashboardPumpDetail || [];\n dashboardDetailPumpConfigurations.forEach((configuration) => {\n acc.dashboardDefinitions[configuration.dashboardKey] =\n acc.dashboardDefinitions[configuration.dashboardKey] || {};\n acc.dashboardDefinitions[configuration.dashboardKey].pumpDetail = {\n ...configuration,\n remote,\n sectionId,\n };\n acc.dashboardPumpDetailDefinitions[configuration.id] = {\n ...configuration,\n remote,\n sectionId,\n };\n });\n\n const experiences = remotes[key].contributes?.experiences;\n Object.keys(experiences).forEach((key) => {\n const experience = experiences[key];\n acc.experiences[key] = {\n ...experience,\n remote,\n sectionId,\n };\n });\n\n return acc;\n };\n","// plugin-extension-registry.ts\n\nimport type {\n PluginExtensionsType,\n ProcessedContributions,\n} from \"../../types/plugins\";\n\nexport type ExtensionReducer = (\n extensions: PluginExtensionsType,\n contributions: ProcessedContributions,\n experiences: any\n) => PluginExtensionsType;\n\nconst extensionPointRegistry: ExtensionReducer[] = [];\n\nexport function registerExtensionReducer(reducer: ExtensionReducer) {\n extensionPointRegistry.push(reducer);\n}\n\nexport function applyExtensionReducers(\n base: PluginExtensionsType,\n contributions: ProcessedContributions,\n experiences: any\n): PluginExtensionsType {\n return extensionPointRegistry.reduce(\n (acc, reducer) => reducer(acc, contributions, experiences),\n base\n );\n}\n","// plugin-extension-manager.ts\n\nimport { loadRemoteModule } from \"@nx/react/mf\";\nimport type { DynamicRemotes } from \"../../types/global\";\nimport type {\n PluginExtension,\n PluginExtensionsType,\n ProcessedContributions,\n} from \"../../types/plugins\";\n\nimport { contributionReducer } from \"./contribution-reducer\";\nimport { applyExtensionReducers } from \"./plugin-extension-registry\";\n\ninterface PluginsType {\n remotes?: DynamicRemotes;\n extensions?: PluginExtensionsType;\n extensionPoints?: Record<string, PluginExtension[]>;\n getExtensions: (extensionPointId: string) => PluginExtension[];\n}\n\nexport async function initPluginManager(\n remotesOverride?: DynamicRemotes\n): Promise<PluginsType> {\n const remotes = remotesOverride ?? window.KosPlugins.__dynamicRemotes;\n\n if (window.KosPlugins.extensions) {\n const extensionPoints = window.KosPlugins.extensions;\n return {\n extensionPoints,\n getExtensions: (extensionPointId: string) =>\n extensionPoints[extensionPointId] || [],\n remotes,\n extensions: window.KosPlugins.__extensions,\n };\n }\n\n const extensions =\n window.KosPlugins.__extensions ?? (await loadExtensions(remotes));\n\n const extensionPoints: Record<string, PluginExtension[]> = {};\n if (extensions) {\n for (const extensionPointId of Object.keys(extensions)) {\n extensionPoints[extensionPointId] = Object.values(\n extensions[extensionPointId] || {}\n );\n }\n }\n\n window.KosPlugins.extensions = extensionPoints;\n\n const getExtensions = (extensionPointId: string) =>\n extensionPoints[extensionPointId] || [];\n\n return { extensionPoints, getExtensions, remotes, extensions };\n}\n\nconst DEFAULT_CONTRIBUTIONS: ProcessedContributions = {\n cuiDefinitions: {},\n controlPourDefinitions: {},\n utilDefinitions: {},\n setupDefinitions: {},\n settingsGroupDefinitions: {},\n settingsDefinitions: {},\n dashboardSummaryDefinitions: {},\n dashboardDetailDefinitions: {},\n dashboardPumpDetailDefinitions: {},\n dashboardDefinitions: {},\n navViewDefinitions: {},\n troubleActionDefinitions: {},\n experiences: {},\n};\n\nexport function getContributions(\n remotes?: DynamicRemotes\n): ProcessedContributions {\n if (!remotes) {\n return DEFAULT_CONTRIBUTIONS;\n }\n return Object.keys(remotes).reduce(contributionReducer(remotes), {\n ...DEFAULT_CONTRIBUTIONS,\n });\n}\n\nexport async function loadExtensions(remotes?: DynamicRemotes) {\n if (!remotes) {\n window.KosPlugins = window.KosPlugins || {};\n return {};\n }\n\n const contributions = getContributions(remotes);\n const experiences = contributions.experiences;\n\n const baseExtensions: PluginExtensionsType = {};\n const reducedExtensions = applyExtensionReducers(\n baseExtensions,\n contributions,\n experiences\n );\n\n for (const remote of Object.values(remotes)) {\n if (remote.init) {\n const InitPlugin = await loadRemoteModule(remote.remote, \"./InitPlugin\");\n if (InitPlugin.default) {\n const initPlugin = new InitPlugin.default();\n initPlugin?.register();\n }\n }\n }\n\n const descriptorBasedExtensions = Object.keys(remotes).reduce((acc, key) => {\n const descriptorViews = remotes[key].contributes?.views ?? {};\n for (const viewKey of Object.keys(descriptorViews)) {\n const viewDefs = descriptorViews[viewKey];\n acc[viewKey] = acc[viewKey] || {};\n for (const viewDef of viewDefs) {\n acc[viewKey][viewDef.id] = {\n id: viewDef.id,\n type: \"view\",\n component: viewDef.component,\n remote: remotes[key].remote,\n sectionId: key,\n data: viewDef,\n };\n }\n }\n\n const extensions = remotes[key].extensions ?? [];\n for (const ext of extensions) {\n acc[ext.extensionPointId] = acc[ext.extensionPointId] || {};\n acc[ext.extensionPointId][ext.id] = {\n id: ext.id,\n type: ext.type,\n component: ext.component,\n remote: remotes[key].remote,\n sectionId: key,\n data: ext,\n };\n }\n\n return acc;\n }, reducedExtensions);\n\n window.KosPlugins = window.KosPlugins || {};\n window.KosPlugins.__extensions = descriptorBasedExtensions;\n return descriptorBasedExtensions;\n}\n\nexport async function getExtensions(extensionPointId: string) {\n const { getExtensions } = await initPluginManager();\n return getExtensions(extensionPointId);\n}\n","import type { PluginExtension } from \"../../types/plugins\";\n\n/**\n * Resolves the best plugin extension for a given extension point.\n *\n * @param extensions A map of plugin extensions keyed by module/plugin ID\n * @param module Optional module ID to resolve\n * @param exact If true, only returns a plugin if the given `module` matches exactly. If false (default), falls back to the best-ranked plugin if no match is found.\n * @returns The resolved PluginExtension or null\n */\nexport function resolveBestExtension<T extends PluginExtension>(\n extensions: Record<string, T> | undefined,\n module?: string,\n exact = false\n): T | null {\n if (!extensions || Object.keys(extensions).length === 0) {\n return null;\n }\n\n // Exact mode: must match the module ID\n if (exact) {\n return module && extensions[module] ? extensions[module] : null;\n }\n\n // Prefer exact match if available\n if (module && extensions[module]) {\n return extensions[module];\n }\n\n // Fallback: pick the best-ranked plugin\n const sorted = Object.values(extensions)\n .filter((ext) => typeof ext.id === \"string\")\n .sort((a, b) => {\n const aRank = typeof a.rank === \"number\" ? a.rank : Infinity;\n const bRank = typeof b.rank === \"number\" ? b.rank : Infinity;\n\n if (aRank === bRank) {\n const aId = a.id ?? \"\";\n const bId = b.id ?? \"\";\n return aId.localeCompare(bId);\n }\n\n return aRank - bRank;\n });\n\n return sorted[0] ?? null;\n}\n"],"names":["dynamicFederation","remoteUrlDefinitions","resolveRemoteUrl","remoteModuleMap","remoteContainerMap","initialSharingScopeCreated","setRemoteUrlResolver","_resolveRemoteUrl","setRemoteDefinitions","definitions","loadRemoteModule","remoteName","moduleName","remoteModuleKey","Module","loadRemoteContainer","fetchRemoteModule","url","resolve","reject","script","request","arg","e","remoteUrl","containerUrl","container","exports","dynamic_federation_1","require$$0","contributionReducer","remotes","acc","key","remote","sectionId","_a","cuiConfiguration","_b","configuration","_c","_d","_e","_f","_g","_h","_i","_j","_k","experiences","_l","experience","extensionPointRegistry","registerExtensionReducer","reducer","applyExtensionReducers","base","contributions","initPluginManager","remotesOverride","extensionPoints","extensionPointId","extensions","loadExtensions","DEFAULT_CONTRIBUTIONS","getContributions","reducedExtensions","InitPlugin","initPlugin","descriptorBasedExtensions","descriptorViews","viewKey","viewDefs","viewDef","ext","getExtensions","resolveBestExtension","module","exact","a","b","aRank","bRank","aId","bId"],"mappings":"2BACA,OAAO,eAAeA,EAAS,aAAc,CAAE,MAAO,EAAI,CAAE,EAC5DA,EAAA,iBAAuDA,EAAA,4CAAkC,OACzF,IAAIC,EACAC,EACJ,MAAMC,EAAkB,IAAI,IACtBC,EAAqB,IAAI,IAC/B,IAAIC,EAA6B,GACjC,SAASC,EAAqBC,EAAmB,CAC7CL,EAAmBK,CACvB,CAC4BP,EAAA,qBAAGM,EAC/B,SAASE,EAAqBC,EAAa,CACvCR,EAAuBQ,CAC3B,CAC4BT,EAAA,qBAAGQ,EAC/B,eAAeE,EAAiBC,EAAYC,EAAY,CACpD,MAAMC,EAAkB,GAAGF,CAAU,IAAIC,CAAU,GACnD,GAAIT,EAAgB,IAAIU,CAAe,EACnC,OAAOV,EAAgB,IAAIU,CAAe,EAM9C,MAAMC,GADU,MAHEV,EAAmB,IAAIO,CAAU,EAC7CP,EAAmB,IAAIO,CAAU,EACjC,MAAMI,EAAoBJ,CAAU,GACV,IAAIC,CAAU,KAE9C,OAAAT,EAAgB,IAAIU,EAAiBC,CAAM,EACpCA,CACX,CACwBd,EAAA,iBAAGU,EAC3B,MAAMM,EAAoB,CAACC,EAAKN,IACrB,IAAI,QAAQ,CAACO,EAASC,IAAW,CACpC,MAAMC,EAAS,SAAS,cAAc,QAAQ,EAC9CA,EAAO,IAAMH,EACbG,EAAO,KAAO,kBACdA,EAAO,MAAQ,GACfA,EAAO,OAAS,IAAM,CAalBF,EAZc,CACV,IAAMG,GAAY,OAAOV,CAAU,EAAE,IAAIU,CAAO,EAChD,KAAOC,GAAQ,CACX,GAAI,CACA,OAAOX,CAAU,EAAE,KAAKW,CAAG,CAC9B,OACMC,EAAG,CACN,QAAQ,MAAM,+BAA+BZ,CAAU,GAAIY,CAAC,EAC5DJ,EAAOI,CAAC,CACX,CACJ,CACjB,CACyB,CACzB,EACQH,EAAO,QAAU,IAAMD,E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l.setRemoteUrlResolver = void 0;
|
|
4
|
+
let h, w;
|
|
5
|
+
const D = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map();
|
|
6
|
+
let U = !1;
|
|
7
|
+
function G(n) {
|
|
8
|
+
w = n;
|
|
9
|
+
}
|
|
10
|
+
l.setRemoteUrlResolver = G;
|
|
11
|
+
function F(n) {
|
|
12
|
+
h = n;
|
|
13
|
+
}
|
|
14
|
+
l.setRemoteDefinitions = F;
|
|
15
|
+
async function B(n, t) {
|
|
16
|
+
const o = `${n}:${t}`;
|
|
17
|
+
if (D.has(o))
|
|
18
|
+
return D.get(o);
|
|
19
|
+
const a = (await (g.has(n) ? g.get(n) : await W(n)).get(t))();
|
|
20
|
+
return D.set(o, a), a;
|
|
21
|
+
}
|
|
22
|
+
l.loadRemoteModule = B;
|
|
23
|
+
const T = (n, t) => new Promise((o, s) => {
|
|
24
|
+
const i = document.createElement("script");
|
|
25
|
+
i.src = n, i.type = "text/javascript", i.async = !0, i.onload = () => {
|
|
26
|
+
o({
|
|
27
|
+
get: (r) => window[t].get(r),
|
|
28
|
+
init: (r) => {
|
|
29
|
+
try {
|
|
30
|
+
window[t].init(r);
|
|
31
|
+
} catch (d) {
|
|
32
|
+
console.error(`Failed to initialize remote ${t}`, d), s(d);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}, i.onerror = () => s(new Error(`Remote ${t} not found`)), document.head.appendChild(i);
|
|
37
|
+
});
|
|
38
|
+
async function W(n) {
|
|
39
|
+
if (!w && !h)
|
|
40
|
+
throw new Error("Call setRemoteDefinitions or setRemoteUrlResolver to allow Dynamic Federation to find the remote apps correctly.");
|
|
41
|
+
U || (U = !0, await __webpack_init_sharing__("default"));
|
|
42
|
+
const t = h ? h[n] : await w(n);
|
|
43
|
+
let o = t;
|
|
44
|
+
!t.endsWith(".mjs") && !t.endsWith(".js") && (o = `${t}${t.endsWith("/") ? "" : "/"}remoteEntry.js`);
|
|
45
|
+
const s = await T(o, n);
|
|
46
|
+
return await s.init(__webpack_share_scopes__.default), g.set(n, s), s;
|
|
47
|
+
}
|
|
48
|
+
(function(n) {
|
|
49
|
+
Object.defineProperty(n, "__esModule", { value: !0 }), n.setRemoteUrlResolver = n.setRemoteDefinitions = n.loadRemoteModule = void 0;
|
|
50
|
+
var t = l;
|
|
51
|
+
Object.defineProperty(n, "loadRemoteModule", { enumerable: !0, get: function() {
|
|
52
|
+
return t.loadRemoteModule;
|
|
53
|
+
} }), Object.defineProperty(n, "setRemoteDefinitions", { enumerable: !0, get: function() {
|
|
54
|
+
return t.setRemoteDefinitions;
|
|
55
|
+
} }), Object.defineProperty(n, "setRemoteUrlResolver", { enumerable: !0, get: function() {
|
|
56
|
+
return t.setRemoteUrlResolver;
|
|
57
|
+
} });
|
|
58
|
+
})(A);
|
|
59
|
+
const z = (n) => (t, o) => {
|
|
60
|
+
var P, m, x, E, v, C, _, K, M, j, O, I;
|
|
61
|
+
t.cuiDefinitions = t.cuiDefinitions || {};
|
|
62
|
+
const s = n[o].remote, i = o;
|
|
63
|
+
(((P = n[o].contributes) == null ? void 0 : P.cui) || []).forEach((e) => {
|
|
64
|
+
t.cuiDefinitions[e.id] = {
|
|
65
|
+
...e,
|
|
66
|
+
cuiDescriptor: i,
|
|
67
|
+
remote: s,
|
|
68
|
+
sectionId: i
|
|
69
|
+
};
|
|
70
|
+
}), (((m = n[o].contributes) == null ? void 0 : m.navViews) || []).forEach((e) => {
|
|
71
|
+
t.navViewDefinitions[e.id] = {
|
|
72
|
+
...e,
|
|
73
|
+
remote: s,
|
|
74
|
+
sectionId: i
|
|
75
|
+
};
|
|
76
|
+
}), (((x = n[o].contributes) == null ? void 0 : x.utilities) || []).forEach((e) => {
|
|
77
|
+
t.utilDefinitions[e.id] = {
|
|
78
|
+
...e,
|
|
79
|
+
remote: s,
|
|
80
|
+
sectionId: i
|
|
81
|
+
};
|
|
82
|
+
}), (((E = n[o].contributes) == null ? void 0 : E.setupStep) || []).forEach((e) => {
|
|
83
|
+
t.setupDefinitions[e.id] = {
|
|
84
|
+
...e,
|
|
85
|
+
remote: s,
|
|
86
|
+
sectionId: i
|
|
87
|
+
};
|
|
88
|
+
}), (((v = n[o].contributes) == null ? void 0 : v.troubleActions) || []).forEach((e) => {
|
|
89
|
+
t.troubleActionDefinitions[e.id] = {
|
|
90
|
+
...e,
|
|
91
|
+
remote: s,
|
|
92
|
+
sectionId: i
|
|
93
|
+
};
|
|
94
|
+
}), (((C = n[o].contributes) == null ? void 0 : C.controlPour) || []).forEach((e) => {
|
|
95
|
+
t.controlPourDefinitions[e.id] = {
|
|
96
|
+
...e,
|
|
97
|
+
remote: s,
|
|
98
|
+
sectionId: i
|
|
99
|
+
};
|
|
100
|
+
}), (((_ = n[o].contributes) == null ? void 0 : _.settingsGroup) || []).forEach((e) => {
|
|
101
|
+
t.settingsGroupDefinitions[e.id] = {
|
|
102
|
+
...e,
|
|
103
|
+
settings: [],
|
|
104
|
+
remote: s,
|
|
105
|
+
sectionId: i
|
|
106
|
+
};
|
|
107
|
+
}), (((K = n[o].contributes) == null ? void 0 : K.settings) || []).forEach((e) => {
|
|
108
|
+
t.settingsDefinitions[e.id] = {
|
|
109
|
+
...e,
|
|
110
|
+
remote: s,
|
|
111
|
+
sectionId: i
|
|
112
|
+
};
|
|
113
|
+
}), (((M = n[o].contributes) == null ? void 0 : M.dashboardSummary) || []).forEach((e) => {
|
|
114
|
+
t.dashboardDefinitions[e.dashboardKey] = t.dashboardDefinitions[e.dashboardKey] || {}, t.dashboardDefinitions[e.dashboardKey].summary = {
|
|
115
|
+
...e,
|
|
116
|
+
remote: s,
|
|
117
|
+
sectionId: i
|
|
118
|
+
}, t.dashboardSummaryDefinitions[e.id] = {
|
|
119
|
+
...e,
|
|
120
|
+
remote: s,
|
|
121
|
+
sectionId: i
|
|
122
|
+
};
|
|
123
|
+
}), (((j = n[o].contributes) == null ? void 0 : j.dashboardDetail) || []).forEach((e) => {
|
|
124
|
+
t.dashboardDefinitions[e.dashboardKey] = t.dashboardDefinitions[e.dashboardKey] || {}, t.dashboardDefinitions[e.dashboardKey].detail = {
|
|
125
|
+
...e,
|
|
126
|
+
remote: s,
|
|
127
|
+
sectionId: i
|
|
128
|
+
}, t.dashboardDetailDefinitions[e.id] = {
|
|
129
|
+
...e,
|
|
130
|
+
remote: s,
|
|
131
|
+
sectionId: i
|
|
132
|
+
};
|
|
133
|
+
}), (((O = n[o].contributes) == null ? void 0 : O.dashboardPumpDetail) || []).forEach((e) => {
|
|
134
|
+
t.dashboardDefinitions[e.dashboardKey] = t.dashboardDefinitions[e.dashboardKey] || {}, t.dashboardDefinitions[e.dashboardKey].pumpDetail = {
|
|
135
|
+
...e,
|
|
136
|
+
remote: s,
|
|
137
|
+
sectionId: i
|
|
138
|
+
}, t.dashboardPumpDetailDefinitions[e.id] = {
|
|
139
|
+
...e,
|
|
140
|
+
remote: s,
|
|
141
|
+
sectionId: i
|
|
142
|
+
};
|
|
143
|
+
});
|
|
144
|
+
const y = (I = n[o].contributes) == null ? void 0 : I.experiences;
|
|
145
|
+
return Object.keys(y).forEach((e) => {
|
|
146
|
+
const $ = y[e];
|
|
147
|
+
t.experiences[e] = {
|
|
148
|
+
...$,
|
|
149
|
+
remote: s,
|
|
150
|
+
sectionId: i
|
|
151
|
+
};
|
|
152
|
+
}), t;
|
|
153
|
+
}, V = [];
|
|
154
|
+
function Y(n) {
|
|
155
|
+
V.push(n);
|
|
156
|
+
}
|
|
157
|
+
function L(n, t, o) {
|
|
158
|
+
return V.reduce(
|
|
159
|
+
(s, i) => i(s, t, o),
|
|
160
|
+
n
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
async function q(n) {
|
|
164
|
+
const t = n ?? window.KosPlugins.__dynamicRemotes;
|
|
165
|
+
if (window.KosPlugins.extensions) {
|
|
166
|
+
const a = window.KosPlugins.extensions;
|
|
167
|
+
return {
|
|
168
|
+
extensionPoints: a,
|
|
169
|
+
getExtensions: (r) => a[r] || [],
|
|
170
|
+
remotes: t,
|
|
171
|
+
extensions: window.KosPlugins.__extensions
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
const o = window.KosPlugins.__extensions ?? await J(t), s = {};
|
|
175
|
+
if (o)
|
|
176
|
+
for (const a of Object.keys(o))
|
|
177
|
+
s[a] = Object.values(
|
|
178
|
+
o[a] || {}
|
|
179
|
+
);
|
|
180
|
+
return window.KosPlugins.extensions = s, { extensionPoints: s, getExtensions: (a) => s[a] || [], remotes: t, extensions: o };
|
|
181
|
+
}
|
|
182
|
+
const S = {
|
|
183
|
+
cuiDefinitions: {},
|
|
184
|
+
controlPourDefinitions: {},
|
|
185
|
+
utilDefinitions: {},
|
|
186
|
+
setupDefinitions: {},
|
|
187
|
+
settingsGroupDefinitions: {},
|
|
188
|
+
settingsDefinitions: {},
|
|
189
|
+
dashboardSummaryDefinitions: {},
|
|
190
|
+
dashboardDetailDefinitions: {},
|
|
191
|
+
dashboardPumpDetailDefinitions: {},
|
|
192
|
+
dashboardDefinitions: {},
|
|
193
|
+
navViewDefinitions: {},
|
|
194
|
+
troubleActionDefinitions: {},
|
|
195
|
+
experiences: {}
|
|
196
|
+
};
|
|
197
|
+
function H(n) {
|
|
198
|
+
return n ? Object.keys(n).reduce(z(n), {
|
|
199
|
+
...S
|
|
200
|
+
}) : S;
|
|
201
|
+
}
|
|
202
|
+
async function J(n) {
|
|
203
|
+
if (!n)
|
|
204
|
+
return window.KosPlugins = window.KosPlugins || {}, {};
|
|
205
|
+
const t = H(n), o = t.experiences, i = L(
|
|
206
|
+
{},
|
|
207
|
+
t,
|
|
208
|
+
o
|
|
209
|
+
);
|
|
210
|
+
for (const r of Object.values(n))
|
|
211
|
+
if (r.init) {
|
|
212
|
+
const d = await A.loadRemoteModule(r.remote, "./InitPlugin");
|
|
213
|
+
if (d.default) {
|
|
214
|
+
const f = new d.default();
|
|
215
|
+
f == null || f.register();
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
const a = Object.keys(n).reduce((r, d) => {
|
|
219
|
+
var p;
|
|
220
|
+
const f = ((p = n[d].contributes) == null ? void 0 : p.views) ?? {};
|
|
221
|
+
for (const u of Object.keys(f)) {
|
|
222
|
+
const R = f[u];
|
|
223
|
+
r[u] = r[u] || {};
|
|
224
|
+
for (const c of R)
|
|
225
|
+
r[u][c.id] = {
|
|
226
|
+
id: c.id,
|
|
227
|
+
type: "view",
|
|
228
|
+
component: c.component,
|
|
229
|
+
remote: n[d].remote,
|
|
230
|
+
sectionId: d,
|
|
231
|
+
data: c
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
const b = n[d].extensions ?? [];
|
|
235
|
+
for (const u of b)
|
|
236
|
+
r[u.extensionPointId] = r[u.extensionPointId] || {}, r[u.extensionPointId][u.id] = {
|
|
237
|
+
id: u.id,
|
|
238
|
+
type: u.type,
|
|
239
|
+
component: u.component,
|
|
240
|
+
remote: n[d].remote,
|
|
241
|
+
sectionId: d,
|
|
242
|
+
data: u
|
|
243
|
+
};
|
|
244
|
+
return r;
|
|
245
|
+
}, i);
|
|
246
|
+
return window.KosPlugins = window.KosPlugins || {}, window.KosPlugins.__extensions = a, a;
|
|
247
|
+
}
|
|
248
|
+
async function Z(n) {
|
|
249
|
+
const { getExtensions: t } = await q();
|
|
250
|
+
return t(n);
|
|
251
|
+
}
|
|
252
|
+
function k(n, t, o = !1) {
|
|
253
|
+
return !n || Object.keys(n).length === 0 ? null : o ? t && n[t] ? n[t] : null : t && n[t] ? n[t] : Object.values(n).filter((i) => typeof i.id == "string").sort((i, a) => {
|
|
254
|
+
const r = typeof i.rank == "number" ? i.rank : 1 / 0, d = typeof a.rank == "number" ? a.rank : 1 / 0;
|
|
255
|
+
if (r === d) {
|
|
256
|
+
const f = i.id ?? "", b = a.id ?? "";
|
|
257
|
+
return f.localeCompare(b);
|
|
258
|
+
}
|
|
259
|
+
return r - d;
|
|
260
|
+
})[0] ?? null;
|
|
261
|
+
}
|
|
262
|
+
export {
|
|
263
|
+
Y as a,
|
|
264
|
+
Z as b,
|
|
265
|
+
z as c,
|
|
266
|
+
H as g,
|
|
267
|
+
q as i,
|
|
268
|
+
J as l,
|
|
269
|
+
A as m,
|
|
270
|
+
k as r
|
|
271
|
+
};
|
|
272
|
+
//# sourceMappingURL=resolve-best-extension-DAJIkfJh.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-best-extension-DAJIkfJh.js","sources":["../../../../node_modules/@nx/react/mf/dynamic-federation.js","../../../../node_modules/@nx/react/mf/index.js","../../../../packages/sdk/kos-ui-plugin/src/lib/utils/contribution-reducer.ts","../../../../packages/sdk/kos-ui-plugin/src/lib/utils/plugin-extension-registry.ts","../../../../packages/sdk/kos-ui-plugin/src/lib/utils/plugin-extension-manager.ts","../../../../packages/sdk/kos-ui-plugin/src/lib/utils/resolve-best-extension.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.loadRemoteModule = exports.setRemoteDefinitions = exports.setRemoteUrlResolver = void 0;\nlet remoteUrlDefinitions;\nlet resolveRemoteUrl;\nconst remoteModuleMap = new Map();\nconst remoteContainerMap = new Map();\nlet initialSharingScopeCreated = false;\nfunction setRemoteUrlResolver(_resolveRemoteUrl) {\n resolveRemoteUrl = _resolveRemoteUrl;\n}\nexports.setRemoteUrlResolver = setRemoteUrlResolver;\nfunction setRemoteDefinitions(definitions) {\n remoteUrlDefinitions = definitions;\n}\nexports.setRemoteDefinitions = setRemoteDefinitions;\nasync function loadRemoteModule(remoteName, moduleName) {\n const remoteModuleKey = `${remoteName}:${moduleName}`;\n if (remoteModuleMap.has(remoteModuleKey)) {\n return remoteModuleMap.get(remoteModuleKey);\n }\n const container = remoteContainerMap.has(remoteName)\n ? remoteContainerMap.get(remoteName)\n : await loadRemoteContainer(remoteName);\n const factory = await container.get(moduleName);\n const Module = factory();\n remoteModuleMap.set(remoteModuleKey, Module);\n return Module;\n}\nexports.loadRemoteModule = loadRemoteModule;\nconst fetchRemoteModule = (url, remoteName) => {\n return new Promise((resolve, reject) => {\n const script = document.createElement('script');\n script.src = url;\n script.type = 'text/javascript';\n script.async = true;\n script.onload = () => {\n const proxy = {\n get: (request) => window[remoteName].get(request),\n init: (arg) => {\n try {\n window[remoteName].init(arg);\n }\n catch (e) {\n console.error(`Failed to initialize remote ${remoteName}`, e);\n reject(e);\n }\n },\n };\n resolve(proxy);\n };\n script.onerror = () => reject(new Error(`Remote ${remoteName} not found`));\n document.head.appendChild(script);\n });\n};\nasync function loadRemoteContainer(remoteName) {\n if (!resolveRemoteUrl && !remoteUrlDefinitions) {\n throw new Error('Call setRemoteDefinitions or setRemoteUrlResolver to allow Dynamic Federation to find the remote apps correctly.');\n }\n if (!initialSharingScopeCreated) {\n initialSharingScopeCreated = true;\n await __webpack_init_sharing__('default');\n }\n const remoteUrl = remoteUrlDefinitions\n ? remoteUrlDefinitions[remoteName]\n : await resolveRemoteUrl(remoteName);\n let containerUrl = remoteUrl;\n if (!remoteUrl.endsWith('.mjs') && !remoteUrl.endsWith('.js')) {\n containerUrl = `${remoteUrl}${remoteUrl.endsWith('/') ? '' : '/'}remoteEntry.js`;\n }\n const container = await fetchRemoteModule(containerUrl, remoteName);\n await container.init(__webpack_share_scopes__.default);\n remoteContainerMap.set(remoteName, container);\n return container;\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.setRemoteUrlResolver = exports.setRemoteDefinitions = exports.loadRemoteModule = void 0;\nvar dynamic_federation_1 = require(\"./dynamic-federation\");\nObject.defineProperty(exports, \"loadRemoteModule\", { enumerable: true, get: function () { return dynamic_federation_1.loadRemoteModule; } });\nObject.defineProperty(exports, \"setRemoteDefinitions\", { enumerable: true, get: function () { return dynamic_federation_1.setRemoteDefinitions; } });\nObject.defineProperty(exports, \"setRemoteUrlResolver\", { enumerable: true, get: function () { return dynamic_federation_1.setRemoteUrlResolver; } });\n","import type { DynamicRemotes } from \"../../types/global\";\nimport type { ProcessedContributions } from \"../../types/plugins\";\n\nexport const contributionReducer =\n (remotes: DynamicRemotes) => (acc: ProcessedContributions, key: string) => {\n acc.cuiDefinitions = acc.cuiDefinitions || {};\n\n const remote = remotes[key].remote;\n const sectionId = key;\n const cuiConfigurations = remotes[key].contributes?.cui || [];\n cuiConfigurations.forEach((cuiConfiguration) => {\n acc.cuiDefinitions[cuiConfiguration.id] = {\n ...cuiConfiguration,\n cuiDescriptor: sectionId,\n remote,\n sectionId,\n };\n });\n\n const navViewConfigurations = remotes[key].contributes?.navViews || [];\n navViewConfigurations.forEach((configuration) => {\n acc.navViewDefinitions[configuration.id] = {\n ...configuration,\n remote,\n sectionId,\n };\n });\n const utilConfigurations = remotes[key].contributes?.utilities || [];\n utilConfigurations.forEach((configuration) => {\n acc.utilDefinitions[configuration.id] = {\n ...configuration,\n remote,\n sectionId,\n };\n });\n\n const setupConfigurations = remotes[key].contributes?.setupStep || [];\n setupConfigurations.forEach((configuration) => {\n acc.setupDefinitions[configuration.id] = {\n ...configuration,\n remote,\n sectionId,\n };\n });\n\n const troubleActionConfigurations =\n remotes[key].contributes?.troubleActions || [];\n troubleActionConfigurations.forEach((configuration) => {\n acc.troubleActionDefinitions[configuration.id] = {\n ...configuration,\n remote,\n sectionId,\n };\n });\n\n const controlPourConfigurations =\n remotes[key].contributes?.controlPour || [];\n controlPourConfigurations.forEach((configuration) => {\n acc.controlPourDefinitions[configuration.id] = {\n ...configuration,\n remote,\n sectionId,\n };\n });\n\n const settingsGroupConfigurations =\n remotes[key].contributes?.settingsGroup || [];\n settingsGroupConfigurations.forEach((configuration) => {\n acc.settingsGroupDefinitions[configuration.id] = {\n ...configuration,\n settings: [],\n remote,\n sectionId,\n };\n });\n\n const settingsConfigurations = remotes[key].contributes?.settings || [];\n settingsConfigurations.forEach((configuration) => {\n acc.settingsDefinitions[configuration.id] = {\n ...configuration,\n remote,\n sectionId,\n };\n });\n\n const dashboardSummaryConfigurations =\n remotes[key].contributes?.dashboardSummary || [];\n dashboardSummaryConfigurations.forEach((configuration) => {\n acc.dashboardDefinitions[configuration.dashboardKey] =\n acc.dashboardDefinitions[configuration.dashboardKey] || {};\n acc.dashboardDefinitions[configuration.dashboardKey].summary = {\n ...configuration,\n remote,\n sectionId,\n };\n acc.dashboardSummaryDefinitions[configuration.id] = {\n ...configuration,\n remote,\n sectionId,\n };\n });\n\n const dashboardDetailConfigurations =\n remotes[key].contributes?.dashboardDetail || [];\n dashboardDetailConfigurations.forEach((configuration) => {\n acc.dashboardDefinitions[configuration.dashboardKey] =\n acc.dashboardDefinitions[configuration.dashboardKey] || {};\n acc.dashboardDefinitions[configuration.dashboardKey].detail = {\n ...configuration,\n remote,\n sectionId,\n };\n acc.dashboardDetailDefinitions[configuration.id] = {\n ...configuration,\n remote,\n sectionId,\n };\n });\n\n const dashboardDetailPumpConfigurations =\n remotes[key].contributes?.dashboardPumpDetail || [];\n dashboardDetailPumpConfigurations.forEach((configuration) => {\n acc.dashboardDefinitions[configuration.dashboardKey] =\n acc.dashboardDefinitions[configuration.dashboardKey] || {};\n acc.dashboardDefinitions[configuration.dashboardKey].pumpDetail = {\n ...configuration,\n remote,\n sectionId,\n };\n acc.dashboardPumpDetailDefinitions[configuration.id] = {\n ...configuration,\n remote,\n sectionId,\n };\n });\n\n const experiences = remotes[key].contributes?.experiences;\n Object.keys(experiences).forEach((key) => {\n const experience = experiences[key];\n acc.experiences[key] = {\n ...experience,\n remote,\n sectionId,\n };\n });\n\n return acc;\n };\n","// plugin-extension-registry.ts\n\nimport type {\n PluginExtensionsType,\n ProcessedContributions,\n} from \"../../types/plugins\";\n\nexport type ExtensionReducer = (\n extensions: PluginExtensionsType,\n contributions: ProcessedContributions,\n experiences: any\n) => PluginExtensionsType;\n\nconst extensionPointRegistry: ExtensionReducer[] = [];\n\nexport function registerExtensionReducer(reducer: ExtensionReducer) {\n extensionPointRegistry.push(reducer);\n}\n\nexport function applyExtensionReducers(\n base: PluginExtensionsType,\n contributions: ProcessedContributions,\n experiences: any\n): PluginExtensionsType {\n return extensionPointRegistry.reduce(\n (acc, reducer) => reducer(acc, contributions, experiences),\n base\n );\n}\n","// plugin-extension-manager.ts\n\nimport { loadRemoteModule } from \"@nx/react/mf\";\nimport type { DynamicRemotes } from \"../../types/global\";\nimport type {\n PluginExtension,\n PluginExtensionsType,\n ProcessedContributions,\n} from \"../../types/plugins\";\n\nimport { contributionReducer } from \"./contribution-reducer\";\nimport { applyExtensionReducers } from \"./plugin-extension-registry\";\n\ninterface PluginsType {\n remotes?: DynamicRemotes;\n extensions?: PluginExtensionsType;\n extensionPoints?: Record<string, PluginExtension[]>;\n getExtensions: (extensionPointId: string) => PluginExtension[];\n}\n\nexport async function initPluginManager(\n remotesOverride?: DynamicRemotes\n): Promise<PluginsType> {\n const remotes = remotesOverride ?? window.KosPlugins.__dynamicRemotes;\n\n if (window.KosPlugins.extensions) {\n const extensionPoints = window.KosPlugins.extensions;\n return {\n extensionPoints,\n getExtensions: (extensionPointId: string) =>\n extensionPoints[extensionPointId] || [],\n remotes,\n extensions: window.KosPlugins.__extensions,\n };\n }\n\n const extensions =\n window.KosPlugins.__extensions ?? (await loadExtensions(remotes));\n\n const extensionPoints: Record<string, PluginExtension[]> = {};\n if (extensions) {\n for (const extensionPointId of Object.keys(extensions)) {\n extensionPoints[extensionPointId] = Object.values(\n extensions[extensionPointId] || {}\n );\n }\n }\n\n window.KosPlugins.extensions = extensionPoints;\n\n const getExtensions = (extensionPointId: string) =>\n extensionPoints[extensionPointId] || [];\n\n return { extensionPoints, getExtensions, remotes, extensions };\n}\n\nconst DEFAULT_CONTRIBUTIONS: ProcessedContributions = {\n cuiDefinitions: {},\n controlPourDefinitions: {},\n utilDefinitions: {},\n setupDefinitions: {},\n settingsGroupDefinitions: {},\n settingsDefinitions: {},\n dashboardSummaryDefinitions: {},\n dashboardDetailDefinitions: {},\n dashboardPumpDetailDefinitions: {},\n dashboardDefinitions: {},\n navViewDefinitions: {},\n troubleActionDefinitions: {},\n experiences: {},\n};\n\nexport function getContributions(\n remotes?: DynamicRemotes\n): ProcessedContributions {\n if (!remotes) {\n return DEFAULT_CONTRIBUTIONS;\n }\n return Object.keys(remotes).reduce(contributionReducer(remotes), {\n ...DEFAULT_CONTRIBUTIONS,\n });\n}\n\nexport async function loadExtensions(remotes?: DynamicRemotes) {\n if (!remotes) {\n window.KosPlugins = window.KosPlugins || {};\n return {};\n }\n\n const contributions = getContributions(remotes);\n const experiences = contributions.experiences;\n\n const baseExtensions: PluginExtensionsType = {};\n const reducedExtensions = applyExtensionReducers(\n baseExtensions,\n contributions,\n experiences\n );\n\n for (const remote of Object.values(remotes)) {\n if (remote.init) {\n const InitPlugin = await loadRemoteModule(remote.remote, \"./InitPlugin\");\n if (InitPlugin.default) {\n const initPlugin = new InitPlugin.default();\n initPlugin?.register();\n }\n }\n }\n\n const descriptorBasedExtensions = Object.keys(remotes).reduce((acc, key) => {\n const descriptorViews = remotes[key].contributes?.views ?? {};\n for (const viewKey of Object.keys(descriptorViews)) {\n const viewDefs = descriptorViews[viewKey];\n acc[viewKey] = acc[viewKey] || {};\n for (const viewDef of viewDefs) {\n acc[viewKey][viewDef.id] = {\n id: viewDef.id,\n type: \"view\",\n component: viewDef.component,\n remote: remotes[key].remote,\n sectionId: key,\n data: viewDef,\n };\n }\n }\n\n const extensions = remotes[key].extensions ?? [];\n for (const ext of extensions) {\n acc[ext.extensionPointId] = acc[ext.extensionPointId] || {};\n acc[ext.extensionPointId][ext.id] = {\n id: ext.id,\n type: ext.type,\n component: ext.component,\n remote: remotes[key].remote,\n sectionId: key,\n data: ext,\n };\n }\n\n return acc;\n }, reducedExtensions);\n\n window.KosPlugins = window.KosPlugins || {};\n window.KosPlugins.__extensions = descriptorBasedExtensions;\n return descriptorBasedExtensions;\n}\n\nexport async function getExtensions(extensionPointId: string) {\n const { getExtensions } = await initPluginManager();\n return getExtensions(extensionPointId);\n}\n","import type { PluginExtension } from \"../../types/plugins\";\n\n/**\n * Resolves the best plugin extension for a given extension point.\n *\n * @param extensions A map of plugin extensions keyed by module/plugin ID\n * @param module Optional module ID to resolve\n * @param exact If true, only returns a plugin if the given `module` matches exactly. If false (default), falls back to the best-ranked plugin if no match is found.\n * @returns The resolved PluginExtension or null\n */\nexport function resolveBestExtension<T extends PluginExtension>(\n extensions: Record<string, T> | undefined,\n module?: string,\n exact = false\n): T | null {\n if (!extensions || Object.keys(extensions).length === 0) {\n return null;\n }\n\n // Exact mode: must match the module ID\n if (exact) {\n return module && extensions[module] ? extensions[module] : null;\n }\n\n // Prefer exact match if available\n if (module && extensions[module]) {\n return extensions[module];\n }\n\n // Fallback: pick the best-ranked plugin\n const sorted = Object.values(extensions)\n .filter((ext) => typeof ext.id === \"string\")\n .sort((a, b) => {\n const aRank = typeof a.rank === \"number\" ? a.rank : Infinity;\n const bRank = typeof b.rank === \"number\" ? b.rank : Infinity;\n\n if (aRank === bRank) {\n const aId = a.id ?? \"\";\n const bId = b.id ?? \"\";\n return aId.localeCompare(bId);\n }\n\n return aRank - bRank;\n });\n\n return sorted[0] ?? null;\n}\n"],"names":["dynamicFederation","remoteUrlDefinitions","resolveRemoteUrl","remoteModuleMap","remoteContainerMap","initialSharingScopeCreated","setRemoteUrlResolver","_resolveRemoteUrl","setRemoteDefinitions","definitions","loadRemoteModule","remoteName","moduleName","remoteModuleKey","Module","loadRemoteContainer","fetchRemoteModule","url","resolve","reject","script","request","arg","e","remoteUrl","containerUrl","container","exports","dynamic_federation_1","require$$0","contributionReducer","remotes","acc","key","remote","sectionId","_a","cuiConfiguration","_b","configuration","_c","_d","_e","_f","_g","_h","_i","_j","_k","experiences","_l","experience","extensionPointRegistry","registerExtensionReducer","reducer","applyExtensionReducers","base","contributions","initPluginManager","remotesOverride","extensionPoints","extensionPointId","extensions","loadExtensions","DEFAULT_CONTRIBUTIONS","getContributions","reducedExtensions","InitPlugin","initPlugin","descriptorBasedExtensions","descriptorViews","viewKey","viewDefs","viewDef","ext","getExtensions","resolveBestExtension","module","exact","a","b","aRank","bRank","aId","bId"],"mapp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A,QACrB,WAAWA;AAAA,QACX,MAAMyC;AAAA,MAAA;AAIH,WAAA1C;AAAA,KACNkC,CAAiB;AAEb,gBAAA,aAAa,OAAO,cAAc,CAAA,GACzC,OAAO,WAAW,eAAeG,GAC1BA;AACT;AAEA,eAAsBM,EAAcd,GAA0B;AAC5D,QAAM,EAAE,eAAAc,MAAkB,MAAMjB,EAAkB;AAClD,SAAOiB,EAAcd,CAAgB;AACvC;AC5IO,SAASe,EACdd,GACAe,GACAC,IAAQ,IACE;AACV,SAAI,CAAChB,KAAc,OAAO,KAAKA,CAAU,EAAE,WAAW,IAC7C,OAILgB,IACKD,KAAUf,EAAWe,CAAM,IAAIf,EAAWe,CAAM,IAAI,OAIzDA,KAAUf,EAAWe,CAAM,IACtBf,EAAWe,CAAM,IAIX,OAAO,OAAOf,CAAU,EACpC,OAAO,CAACY,MAAQ,OAAOA,EAAI,MAAO,QAAQ,EAC1C,KAAK,CAACK,GAAGC,MAAM;AACd,UAAMC,IAAQ,OAAOF,EAAE,QAAS,WAAWA,EAAE,OAAO,OAC9CG,IAAQ,OAAOF,EAAE,QAAS,WAAWA,EAAE,OAAO;AAEpD,QAAIC,MAAUC,GAAO;AACb,YAAAC,IAAMJ,EAAE,MAAM,IACdK,IAAMJ,EAAE,MAAM;AACb,aAAAG,EAAI,cAAcC,CAAG;AAAA,IAC9B;AAEA,WAAOH,IAAQC;AAAA,EAAA,CAChB,EAEW,CAAC,KAAK;AACtB;","x_google_ignoreList":[0,1]}
|
package/types/global.d.ts
CHANGED
|
@@ -61,6 +61,10 @@ export interface DashboardPumpDetailDefinition
|
|
|
61
61
|
type: "dashboard.detail.pump";
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
+
export interface ControlPourDefinition extends BaseViewDefinition {
|
|
65
|
+
type: "control.pour";
|
|
66
|
+
}
|
|
67
|
+
|
|
64
68
|
export interface Contributions {
|
|
65
69
|
views: {
|
|
66
70
|
[key: string]: ViewContribution[];
|
|
@@ -81,6 +85,7 @@ export interface Contributions {
|
|
|
81
85
|
settingsGroup?: TabGroup[];
|
|
82
86
|
settings?: SettingsDefinition[];
|
|
83
87
|
navViews?: NavViewDefinition[];
|
|
88
|
+
controlPour?: ControlPourDefinition[];
|
|
84
89
|
}
|
|
85
90
|
|
|
86
91
|
interface DynamicRemote {
|
package/types/plugins.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CuiDefinition, DashboardDetailDefinition, DashboardPumpDetailDefinition, DashboardSummaryDefinition, NavViewDefinition, SettingsDefinition, SettingsGroup, SetupDefinition, TroubleActionDefinition, UtilityDefinition } from './global';
|
|
1
|
+
import { ControlPourDefinition, CuiDefinition, DashboardDetailDefinition, DashboardPumpDetailDefinition, DashboardSummaryDefinition, NavViewDefinition, SettingsDefinition, SettingsGroup, SetupDefinition, TroubleActionDefinition, UtilityDefinition } from './global';
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
export interface BasePluginExtension {
|
|
@@ -139,6 +139,9 @@ export type ProcessedDashboardDefinition = Record<
|
|
|
139
139
|
pumpDetail?: ProcessDashboardPumpDetailDefinition;
|
|
140
140
|
}
|
|
141
141
|
>;
|
|
142
|
+
|
|
143
|
+
export type ProcessedControlPourDefinition = ControlPourDefinition &
|
|
144
|
+
BaseContribution;
|
|
142
145
|
export type ProcessedContributions = {
|
|
143
146
|
cuiDefinitions: Record<string, ProcessedCuiDefinition>;
|
|
144
147
|
utilDefinitions: Record<string, ProcessedUtilDefinition>;
|
|
@@ -147,6 +150,7 @@ export type ProcessedContributions = {
|
|
|
147
150
|
settingsDefinitions: Record<string, ProcessedSettingsDefinition>;
|
|
148
151
|
troubleActionDefinitions: Record<string, ProcessedTroubleActionDefinition>;
|
|
149
152
|
navViewDefinitions: Record<string, ProcessedNavViewDefinition>;
|
|
153
|
+
controlPourDefinitions: Record<string, ProcessedControlPourDefinition>;
|
|
150
154
|
dashboardDefinitions: ProcessedDashboardDefinition;
|
|
151
155
|
dashboardSummaryDefinitions: Record<
|
|
152
156
|
string,
|
|
@@ -157,5 +161,6 @@ export type ProcessedContributions = {
|
|
|
157
161
|
string,
|
|
158
162
|
ProcessDashboardPumpDetailDefinition
|
|
159
163
|
>;
|
|
164
|
+
controlPourDefinitions;
|
|
160
165
|
experiences: Record<string, ProcessedExperience>;
|
|
161
166
|
};
|
package/utils.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./plugin-extension-manager-D9aw-mUM.cjs"),k=(s=null)=>(s||window.location.search.replace("?","")).split("&").map(r=>{const[t,i]=r.split("=");return[t,decodeURIComponent(i||"")]}).reduce((r,[t,i])=>(r[t]=i,r),{}),U=()=>{const s=window.location.origin,r=k();return(r==null?void 0:r.host)||s},C=async s=>{const r=U(),t=s??{},{pluginBaseUrl:i=r,pluginApiPath:N="/api/app/kosdev.ddk/ncui/plugins",overrides:d={}}=t,a=(await(await fetch(`${i}${N}`)).json()).data.reduce((o,n)=>{const E=(d==null?void 0:d[n.id])??`${i}${n.baseUrl}`;return n.descriptor?o[n.id]={basePath:`${E}remoteEntry.js`,extensions:n.descriptor.extensions,contributes:n.descriptor.contributes,remote:n.descriptor.id,init:!!n.descriptor.init}:console.error(`initialize-plugins: Plugin ${n.id} does not have a descriptor`),o},{});window.KosPlugins=window.KosPlugins||{},window.KosPlugins.__dynamicRemotes=a;const _=Object.keys(a).reduce((o,n)=>{const E=a[n].remote;return o[E]=a[n].basePath,o},{});return e.mf.setRemoteDefinitions(_),_};function X(s){const r=s.match(/^(\d+)\.(\d+)\.\d+(?:-\S+)?$/);if(!r)throw new Error(`Invalid version format: ${s}`);const[t,i,N]=r;return`${i}.${N}.0`}function y(s,r){var T,a,_,o,n,E,u,O,c,S,g,P,V,D,f,A,m,R;r!=null&&r.sdkVersion&&console.log("sdkVersion",r.sdkVersion),r!=null&&r.ddkVersion&&console.log("ddkVersion",r.ddkVersion);const t=X((r==null?void 0:r.sdkVersion)||"0.2.0"),i=X((r==null?void 0:r.ddkVersion)||"0.2.0");console.log(`Using DDK version: ${i}`),console.log(`Using SDK version: ${t}`);const N=s==null?void 0:s.name;if(!N)throw new Error("KOS Configuration should be added. Project name not found in config");const d=(o=(_=(a=(T=s==null?void 0:s.kosdev)==null?void 0:T.ddk)==null?void 0:a.ncui)==null?void 0:_.plugin)==null?void 0:o.id;if(!d)throw new Error("KOS Configuration should be added. Plugin ID not found in config");const l=Object.keys(((c=(O=(u=(E=(n=s==null?void 0:s.kosdev)==null?void 0:n.ddk)==null?void 0:E.ncui)==null?void 0:u.plugin)==null?void 0:O.contributes)==null?void 0:c.views)||{}).reduce((I,h)=>(s.kosdev.ddk.ncui.plugin.contributes.views[h].forEach(b=>{I[`./${b.component}`]=b.location}),I),{});return Object.values(((D=(V=(P=(g=(S=s==null?void 0:s.kosdev)==null?void 0:S.ddk)==null?void 0:g.ncui)==null?void 0:P.plugin)==null?void 0:V.contributes)==null?void 0:D.experiences)||{}).forEach(I=>{l[`./${I.component}`]=I.location}),(R=(m=(A=(f=s==null?void 0:s.kosdev)==null?void 0:f.ddk)==null?void 0:A.ncui)==null?void 0:m.plugin)!=null&&R.init&&(l["./InitPlugin"]="./src/app/init.ts"),{name:N,exposes:l,library:{type:"var",name:d},additionalShared:[{libraryName:"@kosdev-code/kos-ui-plugin",sharedConfig:{singleton:!0,eager:!1,requiredVersion:`~${i}`}},{libraryName:"react",sharedConfig:{singleton:!0,eager:!1,strictVersion:!0,requiredVersion:"18.2.0"}},{libraryName:"react-dom",sharedConfig:{singleton:!0,eager:!1,strictVersion:!0,requiredVersion:"18.2.0"}},{libraryName:"@kosdev-code/kos-ui-sdk",sharedConfig:{singleton:!0,eager:!1,strictVersion:!1,requiredVersion:`~${t}`}},{libraryName:"@kosdev-code/kos-dispense-sdk",sharedConfig:{singleton:!0,eager:!1,strictVersion:!1,requiredVersion:`~${t}`}},{libraryName:"@kosdev-code/kos-freestyle-sdk",sharedConfig:{singleton:!0,eager:!1,strictVersion:!1,requiredVersion:`~${t}`}},{libraryName:"@kosdev-code/kos-ddk-components",sharedConfig:{singleton:!0,eager:!1,strictVersion:!1,requiredVersion:`~${i}`}},{libraryName:"@kosdev-code/kos-ddk-model-components",sharedConfig:{singleton:!0,eager:!1,strictVersion:!1,requiredVersion:`~${i}`}},{libraryName:"@kosdev-code/kos-ddk-models",sharedConfig:{singleton:!0,eager:!1,strictVersion:!1,requiredVersion:`~${i}`}},{libraryName:"@kosdev-code/kos-ddk",sharedConfig:{singleton:!0,eager:!1,strictVersion:!1,requiredVersion:`~${i}`}},{libraryName:"@kosdev-code/kos-ddk-styles",sharedConfig:{singleton:!0,eager:!1,strictVersion:!1,requiredVersion:`~${i}`}},{libraryName:"@emotion/styled",sharedConfig:{singleton:!0,eager:!1,strictVersion:!1,requiredVersion:"~11.11.0"}},{libraryName:"@emotion/react",sharedConfig:{singleton:!0,eager:!1,strictVersion:!1,requiredVersion:"~11.11.0"}},{libraryName:"reflect-metadata",sharedConfig:{singleton:!0,eager:!1,strictVersion:!1,requiredVersion:"^0.2.2"}},{libraryName:"mobx",sharedConfig:{singleton:!0,eager:!1,strictVersion:!1,requiredVersion:"^6.9.0"}},{libraryName:"loglevel",sharedConfig:{singleton:!0,eager:!1,strictVersion:!1,requiredVersion:"^1.8.1"}},{libraryName:"robot3",sharedConfig:{singleton:!0,eager:!1,strictVersion:!1,requiredVersion:"^0.4.0"}},{libraryName:"mobx-react-lite",sharedConfig:{singleton:!0,eager:!1,strictVersion:!1,requiredVersion:"^3.4.3"}},{libraryName:"react-router-dom",sharedConfig:{singleton:!0,eager:!1,strictVersion:!1,requiredVersion:"^6.11.2"}},{libraryName:"date-fns",sharedConfig:{singleton:!0,eager:!1,strictVersion:!1,requiredVersion:"^2.30.0"}},{libraryName:"@use-gesture/react",sharedConfig:{singleton:!0,eager:!1,strictVersion:!1,requiredVersion:"^10.3.0"}},{libraryName:"@react-spring/web",sharedConfig:{singleton:!0,eager:!1,strictVersion:!1,requiredVersion:"^9.7.3"}},{libraryName:"react-simple-keyboard",sharedConfig:{singleton:!0,eager:!1,strictVersion:!1,requiredVersion:"^3.6.13"}}]}}exports.EXTENSION_POINT_CUI=e.EXTENSION_POINT_CUI;exports.EXTENSION_POINT_CUI_DEF=e.EXTENSION_POINT_CUI_DEF;exports.EXTENSION_POINT_CUI_VIEW=e.EXTENSION_POINT_CUI_VIEW;exports.EXTENSION_POINT_DASHBOARD=e.EXTENSION_POINT_DASHBOARD;exports.EXTENSION_POINT_DASHBOARD_DETAIL=e.EXTENSION_POINT_DASHBOARD_DETAIL;exports.EXTENSION_POINT_DASHBOARD_DETAIL_DEF=e.EXTENSION_POINT_DASHBOARD_DETAIL_DEF;exports.EXTENSION_POINT_DASHBOARD_DETAIL_VIEW=e.EXTENSION_POINT_DASHBOARD_DETAIL_VIEW;exports.EXTENSION_POINT_DASHBOARD_PUMP_DETAIL=e.EXTENSION_POINT_DASHBOARD_PUMP_DETAIL;exports.EXTENSION_POINT_DASHBOARD_PUMP_DETAIL_DEF=e.EXTENSION_POINT_DASHBOARD_PUMP_DETAIL_DEF;exports.EXTENSION_POINT_DASHBOARD_PUMP_DETAIL_VIEW=e.EXTENSION_POINT_DASHBOARD_PUMP_DETAIL_VIEW;exports.EXTENSION_POINT_DASHBOARD_SUMMARY=e.EXTENSION_POINT_DASHBOARD_SUMMARY;exports.EXTENSION_POINT_DASHBOARD_SUMMARY_DEF=e.EXTENSION_POINT_DASHBOARD_SUMMARY_DEF;exports.EXTENSION_POINT_DASHBOARD_SUMMARY_VIEW=e.EXTENSION_POINT_DASHBOARD_SUMMARY_VIEW;exports.EXTENSION_POINT_NAV_VIEW=e.EXTENSION_POINT_NAV_VIEW;exports.EXTENSION_POINT_NAV_VIEW_DEF=e.EXTENSION_POINT_NAV_VIEW_DEF;exports.EXTENSION_POINT_NAV_VIEW_VIEW=e.EXTENSION_POINT_NAV_VIEW_VIEW;exports.EXTENSION_POINT_SETTINGS=e.EXTENSION_POINT_SETTINGS;exports.EXTENSION_POINT_SETTINGS_DEF=e.EXTENSION_POINT_SETTINGS_DEF;exports.EXTENSION_POINT_SETTINGS_GROUP_DEF=e.EXTENSION_POINT_SETTINGS_GROUP_DEF;exports.EXTENSION_POINT_SETTINGS_VIEW=e.EXTENSION_POINT_SETTINGS_VIEW;exports.EXTENSION_POINT_SETUP=e.EXTENSION_POINT_SETUP;exports.EXTENSION_POINT_SETUP_DEF=e.EXTENSION_POINT_SETUP_DEF;exports.EXTENSION_POINT_SETUP_VIEW=e.EXTENSION_POINT_SETUP_VIEW;exports.EXTENSION_POINT_TROUBLE_ACTION=e.EXTENSION_POINT_TROUBLE_ACTION;exports.EXTENSION_POINT_TROUBLE_ACTION_DEF=e.EXTENSION_POINT_TROUBLE_ACTION_DEF;exports.EXTENSION_POINT_TROUBLE_ACTION_VIEW=e.EXTENSION_POINT_TROUBLE_ACTION_VIEW;exports.EXTENSION_POINT_UTIL=e.EXTENSION_POINT_UTIL;exports.EXTENSION_POINT_UTIL_DEF=e.EXTENSION_POINT_UTIL_DEF;exports.EXTENSION_POINT_UTIL_VIEW=e.EXTENSION_POINT_UTIL_VIEW;exports.contributionReducer=e.contributionReducer;exports.cuiReducer=e.cuiReducer;exports.dashboardDetailReducer=e.dashboardDetailReducer;exports.dashboardPumpDetailReducer=e.dashboardPumpDetailReducer;exports.dashboardReducer=e.dashboardReducer;exports.dashboardSummaryReducer=e.dashboardSummaryReducer;exports.getContributions=e.getContributions;exports.getExtensions=e.getExtensions;exports.initPluginManager=e.initPluginManager;exports.loadExtensions=e.loadExtensions;exports.navViewReducer=e.navViewReducer;exports.settingsReducer=e.settingsReducer;exports.setupReducer=e.setupReducer;exports.troubleActionReducer=e.troubleActionReducer;exports.utilReducer=e.utilReducer;exports.generatePluginConfiguration=y;exports.getQueryParams=k;exports.initializeKosPlugins=C;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const N=require("./resolve-best-extension-D5Ord7XK.cjs"),g="ddk.cui",S="ddk.cui.view",f="ddk.cui.settings.config",F=(i,e)=>(t,s)=>{const n=s,r=e[s],I=i[r.experienceId]||{};t[g]=t[g]||{},t[g][n]={id:n,type:"cui.definition",data:r,remote:r.remote,sectionId:r.sectionId},I.id&&(t[S]=t[S]||{},t[S][n]={id:n,type:"cui.view",data:I,remote:r.remote,sectionId:r.sectionId}),t[f]=t[f]||{};const a={id:n,type:"cui",data:r,view:I,remote:r.remote,sectionId:r.sectionId};return t[f][n]=a,t},_=({contributionKey:i,basePluginType:e,keys:{EXTENSION_POINT:t,EXTENSION_POINT_DEF:s,EXTENSION_POINT_VIEW:n}})=>(r,I)=>(d,a)=>{const u=a,o=I[i][a],l=r[o.experienceId]||{};s&&(d[s]=d[s]||{},d[s][u]={id:u,type:`${e}.definition`,data:o,remote:o.remote,sectionId:o.sectionId}),l.id&&n&&(d[n]=d[n]||{},d[n][u]={id:u,type:`${e}.view`,data:l,remote:o.remote,sectionId:o.sectionId}),d[t]=d[t]||{};const T={id:u,type:`${e}`,data:o,view:l,remote:o.remote,sectionId:o.sectionId};return d[t][u]=T,d},H="ddk.dashboard.detail",j="ddk.dashboard.detail.view",M="ddk.ncui.dashboard.detail.config",K=_({basePluginType:"dashboard.detail",contributionKey:"dashboardDetailDefinitions",keys:{EXTENSION_POINT:M,EXTENSION_POINT_DEF:H,EXTENSION_POINT_VIEW:j}}),G="ddk.dashboard.pump.detail",Y="ddk.dashboard.pump.detail.view",z="ddk.dashboard.pump.detail.config",Q=_({basePluginType:"dashboard.pump.detail",contributionKey:"dashboardPumpDetailDefinitions",keys:{EXTENSION_POINT:z,EXTENSION_POINT_DEF:G,EXTENSION_POINT_VIEW:Y}}),J="ddk.ncui.dashboard.config",Z=_({basePluginType:"dashboard",contributionKey:"dashboardDefinitions",keys:{EXTENSION_POINT:J}}),ee="ddk.dashboard.summary",te="ddk.dashboard.summary.view",ie="ddk.ncui.dashboard.summary.config",se=_({basePluginType:"dashboard.summary",contributionKey:"dashboardSummaryDefinitions",keys:{EXTENSION_POINT:ie,EXTENSION_POINT_DEF:ee,EXTENSION_POINT_VIEW:te}}),Te="cui.control.pour",ge="cui.control.pour.view",Se="cui.control.pour.config",fe=_({basePluginType:"control.pour",contributionKey:"controlPourDefinitions",keys:{EXTENSION_POINT:Se,EXTENSION_POINT_DEF:Te,EXTENSION_POINT_VIEW:ge}}),re="ddk.nav.view",ne="ddk.nav.view.view",oe="ddk.ncui.nav.view.config",de=_({basePluginType:"nav.view",contributionKey:"navViewDefinitions",keys:{EXTENSION_POINT:oe,EXTENSION_POINT_DEF:re,EXTENSION_POINT_VIEW:ne}}),P="ddk.settings",b="ddk.settings.view",c="ddk.settings.group",D="ddk.ncui.settings.config",ae=(i,e,t)=>(s,n)=>{const r=t[n];return s[c]=s[c]||{},s[c][n]={id:n,type:"settings.group",data:t[n],remote:r.remote,sectionId:r.sectionId},Object.entries(e).filter(([,d])=>d.settingsGroup===n).map(([d])=>d).forEach(d=>{const a=d,u=e[d],E=i[u.experienceId]||{};s[c][n].data.settings=[...s[c][n].data.settings,a],s[P]=s[P]||{},s[P][a]={id:a,type:"settings.definition",data:u,remote:u.remote,sectionId:u.sectionId},E.id&&(s[b]=s[b]||{},s[b][a]={id:a,type:"settings.view",data:E,remote:u.remote,sectionId:u.sectionId}),s[D]=s[D]||{};const l={id:a,type:"settings",data:u,view:E,remote:u.remote,sectionId:u.sectionId};s[D][a]=l}),s},m="ddk.setup",k="ddk.setup.view",V="ddk.ncui.setup.config",ue=(i,e)=>(t,s)=>{const n=s,r=e[s],I=i[r.experienceId]||{};t[m]=t[m]||{},t[m][n]={id:n,type:"setup.definition",data:r,remote:r.remote,sectionId:r.sectionId},I.id&&(t[k]=t[k]||{},t[k][n]={id:n,type:"setup.view",data:I,remote:r.remote,sectionId:r.sectionId}),t[V]=t[V]||{};const a={id:n,type:"setup",data:r,view:I,remote:r.remote,sectionId:r.sectionId};return t[V][n]=a,t},Ie="ddk.trouble.action",Ne="ddk.trouble.action.view",Ee="ddk.ncui.trouble.action.config",le=_({basePluginType:"trouble.action",contributionKey:"troubleActionDefinitions",keys:{EXTENSION_POINT:Ee,EXTENSION_POINT_DEF:Ie,EXTENSION_POINT_VIEW:Ne}}),y="ddk.utilities",R="ddk.utilities.view",A="ddk.ncui.utils.config",_e=(i,e)=>(t,s)=>{const n=s,r=e[s],I=i[r.experienceId]||{};t[y]=t[y]||{},t[y][n]={id:n,type:"utility.definition",data:r,remote:r.remote,sectionId:r.sectionId},I.id&&(t[R]=t[R]||{},t[R][n]={id:n,type:"utilities.view",data:I,remote:r.remote,sectionId:r.sectionId}),t[A]=t[A]||{};const a={id:n,type:"utility",data:r,view:I,remote:r.remote,sectionId:r.sectionId};return t[A][n]=a,t};N.registerExtensionReducer((i,e,t)=>Object.keys(e.cuiDefinitions).reduce(F(t,e.cuiDefinitions),i));N.registerExtensionReducer((i,e,t)=>Object.keys(e.utilDefinitions).reduce(_e(t,e.utilDefinitions),i));N.registerExtensionReducer((i,e,t)=>Object.keys(e.setupDefinitions).reduce(ue(t,e.setupDefinitions),i));N.registerExtensionReducer((i,e,t)=>Object.keys(e.troubleActionDefinitions).reduce(le(t,e),i));N.registerExtensionReducer((i,e,t)=>Object.keys(e.navViewDefinitions).reduce(de(t,e),i));N.registerExtensionReducer((i,e,t)=>Object.keys(e.dashboardSummaryDefinitions).reduce(se(t,e),i));N.registerExtensionReducer((i,e,t)=>Object.keys(e.dashboardDetailDefinitions).reduce(K(t,e),i));N.registerExtensionReducer((i,e,t)=>Object.keys(e.dashboardPumpDetailDefinitions).reduce(Q(t,e),i));N.registerExtensionReducer((i,e,t)=>Object.keys(e.dashboardDefinitions).reduce(Z(t,e),i));N.registerExtensionReducer((i,e,t)=>Object.keys(e.settingsGroupDefinitions).reduce(ae(t,e.settingsDefinitions,e.settingsGroupDefinitions),i));N.registerExtensionReducer((i,e,t)=>Object.keys(e.controlPourDefinitions).reduce(fe(t,e),i));const ce=(i=null)=>(i||window.location.search.replace("?","")).split("&").map(e=>{const[t,s]=e.split("=");return[t,decodeURIComponent(s||"")]}).reduce((e,[t,s])=>(e[t]=s,e),{}),Pe=()=>{const i=window.location.origin,e=ce();return(e==null?void 0:e.host)||i},be=async i=>{const e=Pe(),t=i??{},{pluginBaseUrl:s=e,pluginApiPath:n="/api/app/kosdev.ddk/ncui/plugins",overrides:r={}}=t,a=(await(await fetch(`${s}${n}`)).json()).data.reduce((E,o)=>{const l=(r==null?void 0:r[o.id])??`${s}${o.baseUrl}`;return o.descriptor?E[o.id]={basePath:`${l}remoteEntry.js`,extensions:o.descriptor.extensions,contributes:o.descriptor.contributes,remote:o.descriptor.id,init:!!o.descriptor.init}:console.error(`initialize-plugins: Plugin ${o.id} does not have a descriptor`),E},{});window.KosPlugins=window.KosPlugins||{},window.KosPlugins.__dynamicRemotes=a;const u=Object.keys(a).reduce((E,o)=>{const l=a[o].remote;return E[l]=a[o].basePath,E},{});return N.mf.setRemoteDefinitions(u),u};function q(i){const e=i.match(/^(\d+)\.(\d+)\.\d+(?:-\S+)?$/);if(!e)throw new Error(`Invalid version format: ${i}`);const[t,s,n]=e;return`${s}.${n}.0`}function De(i,e){var d,a,u,E,o,l,h,T,p,X,v,w,C,U,B,x,W,L;e!=null&&e.sdkVersion&&console.log("sdkVersion",e.sdkVersion),e!=null&&e.ddkVersion&&console.log("ddkVersion",e.ddkVersion);const t=q((e==null?void 0:e.sdkVersion)||"0.2.0"),s=q((e==null?void 0:e.ddkVersion)||"0.2.0");console.log(`Using DDK version: ${s}`),console.log(`Using SDK version: ${t}`);const n=i==null?void 0:i.name;if(!n)throw new Error("KOS Configuration should be added. Project name not found in config");const r=(E=(u=(a=(d=i==null?void 0:i.kosdev)==null?void 0:d.ddk)==null?void 0:a.ncui)==null?void 0:u.plugin)==null?void 0:E.id;if(!r)throw new Error("KOS Configuration should be added. Plugin ID not found in config");const I=Object.keys(((p=(T=(h=(l=(o=i==null?void 0:i.kosdev)==null?void 0:o.ddk)==null?void 0:l.ncui)==null?void 0:h.plugin)==null?void 0:T.contributes)==null?void 0:p.views)||{}).reduce((O,Oe)=>(i.kosdev.ddk.ncui.plugin.contributes.views[Oe].forEach($=>{O[`./${$.component}`]=$.location}),O),{});return Object.values(((U=(C=(w=(v=(X=i==null?void 0:i.kosdev)==null?void 0:X.ddk)==null?void 0:v.ncui)==null?void 0:w.plugin)==null?void 0:C.contributes)==null?void 0:U.experiences)||{}).forEach(O=>{I[`./${O.component}`]=O.location}),(L=(W=(x=(B=i==null?void 0:i.kosdev)==null?void 0:B.ddk)==null?void 0:x.ncui)==null?void 0:W.plugin)!=null&&L.init&&(I["./InitPlugin"]="./src/app/init.ts"),{name:n,exposes:I,library:{type:"var",name:r},additionalShared:[{libraryName:"@kosdev-code/kos-ui-plugin",sharedConfig:{singleton:!0,eager:!1,requiredVersion:`~${s}`}},{libraryName:"react",sharedConfig:{singleton:!0,eager:!1,strictVersion:!0,requiredVersion:"18.2.0"}},{libraryName:"react-dom",sharedConfig:{singleton:!0,eager:!1,strictVersion:!0,requiredVersion:"18.2.0"}},{libraryName:"@kosdev-code/kos-ui-sdk",sharedConfig:{singleton:!0,eager:!1,strictVersion:!1,requiredVersion:`~${t}`}},{libraryName:"@kosdev-code/kos-dispense-sdk",sharedConfig:{singleton:!0,eager:!1,strictVersion:!1,requiredVersion:`~${t}`}},{libraryName:"@kosdev-code/kos-freestyle-sdk",sharedConfig:{singleton:!0,eager:!1,strictVersion:!1,requiredVersion:`~${t}`}},{libraryName:"@kosdev-code/kos-ddk-components",sharedConfig:{singleton:!0,eager:!1,strictVersion:!1,requiredVersion:`~${s}`}},{libraryName:"@kosdev-code/kos-ddk-model-components",sharedConfig:{singleton:!0,eager:!1,strictVersion:!1,requiredVersion:`~${s}`}},{libraryName:"@kosdev-code/kos-ddk-models",sharedConfig:{singleton:!0,eager:!1,strictVersion:!1,requiredVersion:`~${s}`}},{libraryName:"@kosdev-code/kos-ddk",sharedConfig:{singleton:!0,eager:!1,strictVersion:!1,requiredVersion:`~${s}`}},{libraryName:"@kosdev-code/kos-ddk-styles",sharedConfig:{singleton:!0,eager:!1,strictVersion:!1,requiredVersion:`~${s}`}},{libraryName:"@emotion/styled",sharedConfig:{singleton:!0,eager:!1,strictVersion:!1,requiredVersion:"~11.11.0"}},{libraryName:"@emotion/react",sharedConfig:{singleton:!0,eager:!1,strictVersion:!1,requiredVersion:"~11.11.0"}},{libraryName:"reflect-metadata",sharedConfig:{singleton:!0,eager:!1,strictVersion:!1,requiredVersion:"^0.2.2"}},{libraryName:"mobx",sharedConfig:{singleton:!0,eager:!1,strictVersion:!1,requiredVersion:"^6.9.0"}},{libraryName:"loglevel",sharedConfig:{singleton:!0,eager:!1,strictVersion:!1,requiredVersion:"^1.8.1"}},{libraryName:"robot3",sharedConfig:{singleton:!0,eager:!1,strictVersion:!1,requiredVersion:"^0.4.0"}},{libraryName:"mobx-react-lite",sharedConfig:{singleton:!0,eager:!1,strictVersion:!1,requiredVersion:"^3.4.3"}},{libraryName:"react-router-dom",sharedConfig:{singleton:!0,eager:!1,strictVersion:!1,requiredVersion:"^6.11.2"}},{libraryName:"date-fns",sharedConfig:{singleton:!0,eager:!1,strictVersion:!1,requiredVersion:"^2.30.0"}},{libraryName:"@use-gesture/react",sharedConfig:{singleton:!0,eager:!1,strictVersion:!1,requiredVersion:"^10.3.0"}},{libraryName:"@react-spring/web",sharedConfig:{singleton:!0,eager:!1,strictVersion:!1,requiredVersion:"^9.7.3"}},{libraryName:"react-simple-keyboard",sharedConfig:{singleton:!0,eager:!1,strictVersion:!1,requiredVersion:"^3.6.13"}}]}}exports.contributionReducer=N.contributionReducer;exports.getContributions=N.getContributions;exports.getExtensions=N.getExtensions;exports.initPluginManager=N.initPluginManager;exports.loadExtensions=N.loadExtensions;exports.resolveBestExtension=N.resolveBestExtension;exports.EXTENSION_POINT_CUI=f;exports.EXTENSION_POINT_CUI_DEF=g;exports.EXTENSION_POINT_CUI_VIEW=S;exports.EXTENSION_POINT_DASHBOARD=J;exports.EXTENSION_POINT_DASHBOARD_DETAIL=M;exports.EXTENSION_POINT_DASHBOARD_DETAIL_DEF=H;exports.EXTENSION_POINT_DASHBOARD_DETAIL_VIEW=j;exports.EXTENSION_POINT_DASHBOARD_PUMP_DETAIL=z;exports.EXTENSION_POINT_DASHBOARD_PUMP_DETAIL_DEF=G;exports.EXTENSION_POINT_DASHBOARD_PUMP_DETAIL_VIEW=Y;exports.EXTENSION_POINT_DASHBOARD_SUMMARY=ie;exports.EXTENSION_POINT_DASHBOARD_SUMMARY_DEF=ee;exports.EXTENSION_POINT_DASHBOARD_SUMMARY_VIEW=te;exports.EXTENSION_POINT_NAV_VIEW=oe;exports.EXTENSION_POINT_NAV_VIEW_DEF=re;exports.EXTENSION_POINT_NAV_VIEW_VIEW=ne;exports.EXTENSION_POINT_SETTINGS=D;exports.EXTENSION_POINT_SETTINGS_DEF=P;exports.EXTENSION_POINT_SETTINGS_GROUP_DEF=c;exports.EXTENSION_POINT_SETTINGS_VIEW=b;exports.EXTENSION_POINT_SETUP=V;exports.EXTENSION_POINT_SETUP_DEF=m;exports.EXTENSION_POINT_SETUP_VIEW=k;exports.EXTENSION_POINT_TROUBLE_ACTION=Ee;exports.EXTENSION_POINT_TROUBLE_ACTION_DEF=Ie;exports.EXTENSION_POINT_TROUBLE_ACTION_VIEW=Ne;exports.EXTENSION_POINT_UTIL=A;exports.EXTENSION_POINT_UTIL_DEF=y;exports.EXTENSION_POINT_UTIL_VIEW=R;exports.cuiReducer=F;exports.dashboardDetailReducer=K;exports.dashboardPumpDetailReducer=Q;exports.dashboardReducer=Z;exports.dashboardSummaryReducer=se;exports.generatePluginConfiguration=De;exports.getQueryParams=ce;exports.initializeKosPlugins=be;exports.navViewReducer=de;exports.settingsReducer=ae;exports.setupReducer=ue;exports.troubleActionReducer=le;exports.utilReducer=_e;
|
|
2
2
|
//# sourceMappingURL=utils.cjs.map
|