@kosdev-code/kos-ui-plugin 2.0.0 → 2.0.18
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 +54 -51
- 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 +346 -103
- 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
package/lib/utils/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/sdk/kos-ui-plugin/src/lib/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,eAAe,CAAC;AAC9B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iCAAiC,CAAC;AAChD,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/sdk/kos-ui-plugin/src/lib/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,eAAe,CAAC;AAC9B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iCAAiC,CAAC;AAChD,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gBAAgB,CAAC"}
|
|
@@ -30,7 +30,46 @@ interface KosPluginsProps {
|
|
|
30
30
|
pluginApiPath?: string;
|
|
31
31
|
overrides?: Record<string, string>;
|
|
32
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* Parses the query string from the URL or a provided string and returns an object
|
|
35
|
+
* representing the key-value pairs in the query string.
|
|
36
|
+
*
|
|
37
|
+
* @param query - An optional query string to parse. If not provided, the function
|
|
38
|
+
* will use the current window's `location.search` string.
|
|
39
|
+
* The query string should not include the leading "?" character.
|
|
40
|
+
*
|
|
41
|
+
* @returns An object where each key is a parameter name from the query string,
|
|
42
|
+
* and each value is the corresponding decoded parameter value.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* // Assuming the URL is: https://example.com/?name=John&age=30
|
|
46
|
+
* getQueryParams();
|
|
47
|
+
* // Returns: { name: "John", age: "30" }
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* getQueryParams("foo=bar&baz=qux");
|
|
51
|
+
* // Returns: { foo: "bar", baz: "qux" }
|
|
52
|
+
*/
|
|
33
53
|
export declare const getQueryParams: (query?: null) => {};
|
|
54
|
+
/**
|
|
55
|
+
* Initializes KOS plugins by fetching plugin metadata and configuring dynamic remotes.
|
|
56
|
+
*
|
|
57
|
+
* @param props - Optional properties to configure the plugin initialization.
|
|
58
|
+
* @param props.pluginBaseUrl - The base URL for the plugins. Defaults to the result of `getDefaultHost()`.
|
|
59
|
+
* @param props.pluginApiPath - The API path to fetch plugin metadata. Defaults to `"/api/app/kosdev.ddk/ncui/plugins"`.
|
|
60
|
+
* @param props.overrides - An object containing overrides for plugin base URLs, keyed by plugin ID.
|
|
61
|
+
*
|
|
62
|
+
* @returns A promise that resolves to a record of remote definitions, where the keys are remote IDs
|
|
63
|
+
* and the values are the corresponding base paths for the remote entries.
|
|
64
|
+
*
|
|
65
|
+
* @remarks
|
|
66
|
+
* - This function fetches plugin metadata from the specified API endpoint and processes the data
|
|
67
|
+
* to configure dynamic remotes for the KOS plugin system.
|
|
68
|
+
* - If a plugin does not have a descriptor, an error is logged to the console.
|
|
69
|
+
* - The remote definitions are also set using the `setRemoteDefinitions` function.
|
|
70
|
+
*
|
|
71
|
+
* @throws Will throw an error if the fetch request fails or if the response cannot be parsed as JSON.
|
|
72
|
+
*/
|
|
34
73
|
export declare const initializeKosPlugins: (props?: KosPluginsProps) => Promise<Record<string, string>>;
|
|
35
74
|
export {};
|
|
36
75
|
//# sourceMappingURL=initialize-plugins.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initialize-plugins.d.ts","sourceRoot":"","sources":["../../../../../../packages/sdk/kos-ui-plugin/src/lib/utils/initialize-plugins.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,KAAK,EACV,eAAe,EACf,oBAAoB,EACrB,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"initialize-plugins.d.ts","sourceRoot":"","sources":["../../../../../../packages/sdk/kos-ui-plugin/src/lib/utils/initialize-plugins.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,KAAK,EACV,eAAe,EACf,oBAAoB,EACrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,kCAAkC,CAAC;AAE1C,OAAO,WAAW,cAAc;IAC9B,gBAAgB,EAAE,cAAc,CAAC;IACjC,YAAY,CAAC,EAAE,oBAAoB,CAAC;IACpC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,EAAE,CAAC,CAAC;CAChD;AACD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,UAAU,EAAE,cAAc,CAAC;KAC5B;CACF;AAED,MAAM,WAAW,UAAU;IACzB,gBAAgB,EAAE,MAAM,CAAC;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE;QACV,EAAE,EAAE,MAAM,CAAC;QACX,UAAU,EAAE,UAAU,EAAE,CAAC;QACzB,WAAW,EAAE,aAAa,CAAC;KAC5B,CAAC;CACH;AAED,UAAU,eAAe;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACpC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,cAAc,sBAiBjB,CAAC;AAWX;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,oBAAoB,WAAkB,eAAe,oCAoCjE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-extension-manager.d.ts","sourceRoot":"","sources":["../../../../../../packages/sdk/kos-ui-plugin/src/lib/utils/plugin-extension-manager.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin-extension-manager.d.ts","sourceRoot":"","sources":["../../../../../../packages/sdk/kos-ui-plugin/src/lib/utils/plugin-extension-manager.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EACV,eAAe,EACf,oBAAoB,EACpB,sBAAsB,EACvB,MAAM,qBAAqB,CAAC;AAK7B,UAAU,WAAW;IACnB,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,UAAU,CAAC,EAAE,oBAAoB,CAAC;IAClC,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,EAAE,CAAC,CAAC;IACpD,aAAa,EAAE,CAAC,gBAAgB,EAAE,MAAM,KAAK,eAAe,EAAE,CAAC;CAChE;AAED,wBAAsB,iBAAiB,CACrC,eAAe,CAAC,EAAE,cAAc,GAC/B,OAAO,CAAC,WAAW,CAAC,CAgCtB;AAkBD,wBAAgB,gBAAgB,CAC9B,OAAO,CAAC,EAAE,cAAc,GACvB,sBAAsB,CAOxB;AAED,wBAAsB,cAAc,CAAC,OAAO,CAAC,EAAE,cAAc,iCA8D5D;AAED,wBAAsB,aAAa,CAAC,gBAAgB,EAAE,MAAM;;MAG3D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-extension-registry-init.d.ts","sourceRoot":"","sources":["../../../../../../packages/sdk/kos-ui-plugin/src/lib/utils/plugin-extension-registry-init.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { PluginExtensionsType, ProcessedContributions } from '../../types/plugins';
|
|
2
|
+
|
|
3
|
+
export type ExtensionReducer = (extensions: PluginExtensionsType, contributions: ProcessedContributions, experiences: any) => PluginExtensionsType;
|
|
4
|
+
export declare function registerExtensionReducer(reducer: ExtensionReducer): void;
|
|
5
|
+
export declare function applyExtensionReducers(base: PluginExtensionsType, contributions: ProcessedContributions, experiences: any): PluginExtensionsType;
|
|
6
|
+
//# sourceMappingURL=plugin-extension-registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-extension-registry.d.ts","sourceRoot":"","sources":["../../../../../../packages/sdk/kos-ui-plugin/src/lib/utils/plugin-extension-registry.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,oBAAoB,EACpB,sBAAsB,EACvB,MAAM,qBAAqB,CAAC;AAE7B,MAAM,MAAM,gBAAgB,GAAG,CAC7B,UAAU,EAAE,oBAAoB,EAChC,aAAa,EAAE,sBAAsB,EACrC,WAAW,EAAE,GAAG,KACb,oBAAoB,CAAC;AAI1B,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,gBAAgB,QAEjE;AAED,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,oBAAoB,EAC1B,aAAa,EAAE,sBAAsB,EACrC,WAAW,EAAE,GAAG,GACf,oBAAoB,CAKtB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { PluginExtension } from '../../types/plugins';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Resolves the best plugin extension for a given extension point.
|
|
5
|
+
*
|
|
6
|
+
* @param extensions A map of plugin extensions keyed by module/plugin ID
|
|
7
|
+
* @param module Optional module ID to resolve
|
|
8
|
+
* @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.
|
|
9
|
+
* @returns The resolved PluginExtension or null
|
|
10
|
+
*/
|
|
11
|
+
export declare function resolveBestExtension<T extends PluginExtension>(extensions: Record<string, T> | undefined, module?: string, exact?: boolean): T | null;
|
|
12
|
+
//# sourceMappingURL=resolve-best-extension.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-best-extension.d.ts","sourceRoot":"","sources":["../../../../../../packages/sdk/kos-ui-plugin/src/lib/utils/resolve-best-extension.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,eAAe,EAC5D,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,SAAS,EACzC,MAAM,CAAC,EAAE,MAAM,EACf,KAAK,UAAQ,GACZ,CAAC,GAAG,IAAI,CAgCV"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kosdev-code/kos-ui-plugin",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.18",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
},
|
|
27
27
|
"kos": {
|
|
28
28
|
"build": {
|
|
29
|
-
"gitHash": "
|
|
29
|
+
"gitHash": "99f2379baed72492383b33a63119018c2484bca1"
|
|
30
30
|
}
|
|
31
31
|
},
|
|
32
32
|
"publishConfig": {
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var R={},f={};Object.defineProperty(f,"__esModule",{value:!0});f.loadRemoteModule=f.setRemoteDefinitions=f.setRemoteUrlResolver=void 0;let h,w;const D=new Map,g=new Map;let S=!1;function W(n){w=n}f.setRemoteUrlResolver=W;function z(n){h=n}f.setRemoteDefinitions=z;async function L(n,t){const o=`${n}:${t}`;if(D.has(o))return D.get(o);const d=(await(g.has(n)?g.get(n):await H(n)).get(t))();return D.set(o,d),d}f.loadRemoteModule=L;const q=(n,t)=>new Promise((o,s)=>{const i=document.createElement("script");i.src=n,i.type="text/javascript",i.async=!0,i.onload=()=>{o({get:r=>window[t].get(r),init:r=>{try{window[t].init(r)}catch(a){console.error(`Failed to initialize remote ${t}`,a),s(a)}}})},i.onerror=()=>s(new Error(`Remote ${t} not found`)),document.head.appendChild(i)});async function H(n){if(!w&&!h)throw new Error("Call setRemoteDefinitions or setRemoteUrlResolver to allow Dynamic Federation to find the remote apps correctly.");S||(S=!0,await __webpack_init_sharing__("default"));const t=h?h[n]:await w(n);let o=t;!t.endsWith(".mjs")&&!t.endsWith(".js")&&(o=`${t}${t.endsWith("/")?"":"/"}remoteEntry.js`);const s=await q(o,n);return await s.init(__webpack_share_scopes__.default),g.set(n,s),s}(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.setRemoteUrlResolver=n.setRemoteDefinitions=n.loadRemoteModule=void 0;var t=f;Object.defineProperty(n,"loadRemoteModule",{enumerable:!0,get:function(){return t.loadRemoteModule}}),Object.defineProperty(n,"setRemoteDefinitions",{enumerable:!0,get:function(){return t.setRemoteDefinitions}}),Object.defineProperty(n,"setRemoteUrlResolver",{enumerable:!0,get:function(){return t.setRemoteUrlResolver}})})(R);const V=n=>(t,o)=>{var m,x,E,v,C,_,K,M,j,O,I,U;t.cuiDefinitions=t.cuiDefinitions||{};const s=n[o].remote,i=o;(((m=n[o].contributes)==null?void 0:m.cui)||[]).forEach(e=>{t.cuiDefinitions[e.id]={...e,cuiDescriptor:i,remote:s,sectionId:i}}),(((x=n[o].contributes)==null?void 0:x.navViews)||[]).forEach(e=>{t.navViewDefinitions[e.id]={...e,remote:s,sectionId:i}}),(((E=n[o].contributes)==null?void 0:E.utilities)||[]).forEach(e=>{t.utilDefinitions[e.id]={...e,remote:s,sectionId:i}}),(((v=n[o].contributes)==null?void 0:v.setupStep)||[]).forEach(e=>{t.setupDefinitions[e.id]={...e,remote:s,sectionId:i}}),(((C=n[o].contributes)==null?void 0:C.troubleActions)||[]).forEach(e=>{t.troubleActionDefinitions[e.id]={...e,remote:s,sectionId:i}}),(((_=n[o].contributes)==null?void 0:_.controlPour)||[]).forEach(e=>{t.controlPourDefinitions[e.id]={...e,remote:s,sectionId:i}}),(((K=n[o].contributes)==null?void 0:K.settingsGroup)||[]).forEach(e=>{t.settingsGroupDefinitions[e.id]={...e,settings:[],remote:s,sectionId:i}}),(((M=n[o].contributes)==null?void 0:M.settings)||[]).forEach(e=>{t.settingsDefinitions[e.id]={...e,remote:s,sectionId:i}}),(((j=n[o].contributes)==null?void 0:j.dashboardSummary)||[]).forEach(e=>{t.dashboardDefinitions[e.dashboardKey]=t.dashboardDefinitions[e.dashboardKey]||{},t.dashboardDefinitions[e.dashboardKey].summary={...e,remote:s,sectionId:i},t.dashboardSummaryDefinitions[e.id]={...e,remote:s,sectionId:i}}),(((O=n[o].contributes)==null?void 0:O.dashboardDetail)||[]).forEach(e=>{t.dashboardDefinitions[e.dashboardKey]=t.dashboardDefinitions[e.dashboardKey]||{},t.dashboardDefinitions[e.dashboardKey].detail={...e,remote:s,sectionId:i},t.dashboardDetailDefinitions[e.id]={...e,remote:s,sectionId:i}}),(((I=n[o].contributes)==null?void 0:I.dashboardPumpDetail)||[]).forEach(e=>{t.dashboardDefinitions[e.dashboardKey]=t.dashboardDefinitions[e.dashboardKey]||{},t.dashboardDefinitions[e.dashboardKey].pumpDetail={...e,remote:s,sectionId:i},t.dashboardPumpDetailDefinitions[e.id]={...e,remote:s,sectionId:i}});const y=(U=n[o].contributes)==null?void 0:U.experiences;return Object.keys(y).forEach(e=>{const T=y[e];t.experiences[e]={...T,remote:s,sectionId:i}}),t},$=[];function J(n){$.push(n)}function Q(n,t,o){return $.reduce((s,i)=>i(s,t,o),n)}async function G(n){const t=n??window.KosPlugins.__dynamicRemotes;if(window.KosPlugins.extensions){const d=window.KosPlugins.extensions;return{extensionPoints:d,getExtensions:r=>d[r]||[],remotes:t,extensions:window.KosPlugins.__extensions}}const o=window.KosPlugins.__extensions??await F(t),s={};if(o)for(const d of Object.keys(o))s[d]=Object.values(o[d]||{});return window.KosPlugins.extensions=s,{extensionPoints:s,getExtensions:d=>s[d]||[],remotes:t,extensions:o}}const A={cuiDefinitions:{},controlPourDefinitions:{},utilDefinitions:{},setupDefinitions:{},settingsGroupDefinitions:{},settingsDefinitions:{},dashboardSummaryDefinitions:{},dashboardDetailDefinitions:{},dashboardPumpDetailDefinitions:{},dashboardDefinitions:{},navViewDefinitions:{},troubleActionDefinitions:{},experiences:{}};function B(n){return n?Object.keys(n).reduce(V(n),{...A}):A}async function F(n){if(!n)return window.KosPlugins=window.KosPlugins||{},{};const t=B(n),o=t.experiences,i=Q({},t,o);for(const r of Object.values(n))if(r.init){const a=await R.loadRemoteModule(r.remote,"./InitPlugin");if(a.default){const l=new a.default;l==null||l.register()}}const d=Object.keys(n).reduce((r,a)=>{var p;const l=((p=n[a].contributes)==null?void 0:p.views)??{};for(const u of Object.keys(l)){const P=l[u];r[u]=r[u]||{};for(const c of P)r[u][c.id]={id:c.id,type:"view",component:c.component,remote:n[a].remote,sectionId:a,data:c}}const b=n[a].extensions??[];for(const u of b)r[u.extensionPointId]=r[u.extensionPointId]||{},r[u.extensionPointId][u.id]={id:u.id,type:u.type,component:u.component,remote:n[a].remote,sectionId:a,data:u};return r},i);return window.KosPlugins=window.KosPlugins||{},window.KosPlugins.__extensions=d,d}async function X(n){const{getExtensions:t}=await G();return t(n)}function Y(n,t,o=!1){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,d)=>{const r=typeof i.rank=="number"?i.rank:1/0,a=typeof d.rank=="number"?d.rank:1/0;if(r===a){const l=i.id??"",b=d.id??"";return l.localeCompare(b)}return r-a})[0]??null}exports.contributionReducer=V;exports.getContributions=B;exports.getExtensions=X;exports.initPluginManager=G;exports.loadExtensions=F;exports.mf=R;exports.registerExtensionReducer=J;exports.resolveBestExtension=Y;
|
|
2
|
+
//# sourceMappingURL=resolve-best-extension-D5Ord7XK.cjs.map
|
|
@@ -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,C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GACdK,EAAMJ,EAAE,IAAM,GACb,OAAAG,EAAI,cAAcC,CAAG,CAC9B,CAEA,OAAOH,EAAQC,CAAA,CAChB,EAEW,CAAC,GAAK,IACtB","x_google_ignoreList":[0,1]}
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
var A = {}, l = {};
|
|
2
|
+
Object.defineProperty(l, "__esModule", { value: !0 });
|
|
3
|
+
l.loadRemoteModule = l.setRemoteDefinitions = 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"],"mappings":";AACA,OAAO,eAAeA,GAAS,cAAc,EAAE,OAAO,GAAI,CAAE;AAC5DA,EAAA,mBAAuDA,EAAA,gDAAkC;AACzF,IAAIC,GACAC;AACJ,MAAMC,IAAkB,oBAAI,OACtBC,IAAqB,oBAAI;AAC/B,IAAIC,IAA6B;AACjC,SAASC,EAAqBC,GAAmB;AAC7C,EAAAL,IAAmBK;AACvB;AAC4BP,EAAA,uBAAGM;AAC/B,SAASE,EAAqBC,GAAa;AACvC,EAAAR,IAAuBQ;AAC3B;AAC4BT,EAAA,uBAAGQ;AAC/B,eAAeE,EAAiBC,GAAYC,GAAY;AACpD,QAAMC,IAAkB,GAAGF,CAAU,IAAIC,CAAU;AACnD,MAAIT,EAAgB,IAAIU,CAAe;AACnC,WAAOV,EAAgB,IAAIU,CAAe;AAM9C,QAAMC,KADU,OAHEV,EAAmB,IAAIO,CAAU,IAC7CP,EAAmB,IAAIO,CAAU,IACjC,MAAMI,EAAoBJ,CAAU,GACV,IAAIC,CAAU;AAE9C,SAAAT,EAAgB,IAAIU,GAAiBC,CAAM,GACpCA;AACX;AACwBd,EAAA,mBAAGU;AAC3B,MAAMM,IAAoB,CAACC,GAAKN,MACrB,IAAI,QAAQ,CAACO,GAASC,MAAW;AACpC,QAAMC,IAAS,SAAS,cAAc,QAAQ;AAC9C,EAAAA,EAAO,MAAMH,GACbG,EAAO,OAAO,mBACdA,EAAO,QAAQ,IACfA,EAAO,SAAS,MAAM;AAalB,IAAAF,EAZc;AAAA,MACV,KAAK,CAACG,MAAY,OAAOV,C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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
|
};
|