@next-core/runtime 1.22.11 → 1.22.12
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/dist/cjs/getV2RuntimeFromDll.js.map +1 -1
- package/dist/cjs/internal/compute/WidgetFunctions.js +3 -1
- package/dist/cjs/internal/compute/WidgetFunctions.js.map +1 -1
- package/dist/cjs/internal/compute/WidgetI18n.js +3 -1
- package/dist/cjs/internal/compute/WidgetI18n.js.map +1 -1
- package/dist/esm/getV2RuntimeFromDll.js.map +1 -1
- package/dist/esm/internal/compute/WidgetFunctions.js +3 -1
- package/dist/esm/internal/compute/WidgetFunctions.js.map +1 -1
- package/dist/esm/internal/compute/WidgetI18n.js +3 -1
- package/dist/esm/internal/compute/WidgetI18n.js.map +1 -1
- package/dist/types/getV2RuntimeFromDll.d.ts +2 -2
- package/dist/types/internal/compute/WidgetFunctions.d.ts +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getV2RuntimeFromDll.js","names":["getV2RuntimeFromDll","_window$BRICK_NEXT_VE","dll","window","BRICK_NEXT_VERSIONS","startsWith"],"sources":["../../src/getV2RuntimeFromDll.ts"],"sourcesContent":["import type {\n CustomTemplateConstructor,\n MetaI18n,\n StoryboardFunction,\n} from \"@next-core/types\";\nimport type { NextHistory } from \"./history.js\";\nimport type { IfContainer } from \"./internal/compute/checkIf.js\";\n\ninterface DLL {\n (moduleId: \"tYg3\"): Kit;\n}\n\ninterface Kit {\n getRuntime(): {\n registerCustomTemplate(\n tagName: string,\n constructor: CustomTemplateConstructor\n ): void;\n registerCustomProcessor(\n processorFullName: string,\n processorFunc: Function\n ): void;\n
|
|
1
|
+
{"version":3,"file":"getV2RuntimeFromDll.js","names":["getV2RuntimeFromDll","_window$BRICK_NEXT_VE","dll","window","BRICK_NEXT_VERSIONS","startsWith"],"sources":["../../src/getV2RuntimeFromDll.ts"],"sourcesContent":["import type {\n CustomTemplateConstructor,\n MetaI18n,\n StoryboardFunction,\n} from \"@next-core/types\";\nimport type { NextHistory } from \"./history.js\";\nimport type { IfContainer } from \"./internal/compute/checkIf.js\";\n\ninterface DLL {\n (moduleId: \"tYg3\"): Kit;\n}\n\ninterface Kit {\n getRuntime(): {\n registerCustomTemplate(\n tagName: string,\n constructor: CustomTemplateConstructor\n ): void;\n registerCustomProcessor(\n processorFullName: string,\n processorFunc: Function\n ): void;\n registerWidgetFunctions(\n widgetId: string,\n functions: StoryboardFunction[],\n widgetVersion?: string\n ): void;\n registerWidgetI18n(widgetId: string, i18nData: MetaI18n): void;\n };\n getHistory(): NextHistory;\n looseCheckIfByTransform(ifContainer: IfContainer, data: unknown): boolean;\n SingleBrickAsComponentFactory: any;\n BrickAsComponentFactory: any;\n authenticate: any;\n getAuth: any;\n isLoggedIn: any;\n logout: any;\n}\n\nexport function getV2RuntimeFromDll() {\n const { dll } = window as { dll?: DLL };\n if (\n dll &&\n window.BRICK_NEXT_VERSIONS?.[\"brick-container\"]?.startsWith(\"2.\")\n ) {\n return dll(\"tYg3\");\n }\n}\n"],"mappings":";;;;;;AAuCO,SAASA,mBAAmBA,CAAA,EAAG;EAAA,IAAAC,qBAAA;EACpC,MAAM;IAAEC;EAAI,CAAC,GAAGC,MAAuB;EACvC,IACED,GAAG,KAAAD,qBAAA,GACHE,MAAM,CAACC,mBAAmB,cAAAH,qBAAA,gBAAAA,qBAAA,GAA1BA,qBAAA,CAA6B,iBAAiB,CAAC,cAAAA,qBAAA,eAA/CA,qBAAA,CAAiDI,UAAU,CAAC,IAAI,CAAC,EACjE;IACA,OAAOH,GAAG,CAAC,MAAM,CAAC;EACpB;AACF"}
|
|
@@ -33,7 +33,9 @@ function registerWidgetFunctionsV3(widgetId, functions, widgetVersion) {
|
|
|
33
33
|
function registerWidgetFunctionsV2Factory() {
|
|
34
34
|
const v2Kit = (0, _getV2RuntimeFromDll.getV2RuntimeFromDll)();
|
|
35
35
|
if (v2Kit) {
|
|
36
|
-
return
|
|
36
|
+
return function (widgetId, functions, widgetVersion) {
|
|
37
|
+
return v2Kit.getRuntime().registerWidgetFunctions(widgetId, functions, widgetVersion);
|
|
38
|
+
};
|
|
37
39
|
}
|
|
38
40
|
}
|
|
39
41
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WidgetFunctions.js","names":["_StoryboardFunctionRegistry","require","_getV2RuntimeFromDll","widgetFunctionRegistry","Map","widgetFunctions","Proxy","Object","freeze","get","target","key","exports","registerWidgetFunctionsV3","widgetId","functions","widgetVersion","has","Error","storyboardFunctions","registerStoryboardFunctions","StoryboardFunctionRegistryFactory","set","registerWidgetFunctionsV2Factory","v2Kit","getV2RuntimeFromDll","registerWidgetFunctions"],"sources":["../../../../src/internal/compute/WidgetFunctions.ts"],"sourcesContent":["import { StoryboardFunction } from \"@next-core/types\";\nimport {\n ReadonlyStoryboardFunctions,\n StoryboardFunctionRegistryFactory,\n} from \"../../StoryboardFunctionRegistry.js\";\nimport { getV2RuntimeFromDll } from \"../../getV2RuntimeFromDll.js\";\n\nconst widgetFunctionRegistry = new Map<string, ReadonlyStoryboardFunctions>();\n\nexport const widgetFunctions = new Proxy(Object.freeze({}), {\n get(target, key: string) {\n return widgetFunctionRegistry.get(key);\n },\n}) as Readonly<Record<string, ReadonlyStoryboardFunctions>>;\n\nfunction registerWidgetFunctionsV3(\n widgetId: string,\n functions: StoryboardFunction[],\n widgetVersion?: string\n): void {\n if (widgetFunctionRegistry.has(widgetId)) {\n // eslint-disable-next-line no-console\n throw new Error(`Widget functions of \"${widgetId}\" already registered`);\n }\n const { storyboardFunctions, registerStoryboardFunctions } =\n StoryboardFunctionRegistryFactory({ widgetId, widgetVersion });\n widgetFunctionRegistry.set(widgetId, storyboardFunctions);\n registerStoryboardFunctions(functions);\n}\n\n// istanbul ignore next\nfunction registerWidgetFunctionsV2Factory() {\n const v2Kit = getV2RuntimeFromDll();\n if (v2Kit) {\n return v2Kit.registerWidgetFunctions;\n }\n}\n\n// istanbul ignore next\nexport const registerWidgetFunctions =\n registerWidgetFunctionsV2Factory() || registerWidgetFunctionsV3;\n"],"mappings":";;;;;;AACA,IAAAA,2BAAA,GAAAC,OAAA;AAIA,IAAAC,oBAAA,GAAAD,OAAA;AAEA,MAAME,sBAAsB,GAAG,IAAIC,GAAG,CAAsC,CAAC;AAEtE,MAAMC,eAAe,GAAG,IAAIC,KAAK,CAACC,MAAM,CAACC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE;EAC1DC,GAAGA,CAACC,MAAM,EAAEC,GAAW,EAAE;IACvB,OAAOR,sBAAsB,CAACM,GAAG,CAACE,GAAG,CAAC;EACxC;AACF,CAAC,CAA0D;AAACC,OAAA,CAAAP,eAAA,GAAAA,eAAA;AAE5D,SAASQ,yBAAyBA,CAChCC,QAAgB,EAChBC,SAA+B,EAC/BC,aAAsB,EAChB;EACN,IAAIb,sBAAsB,CAACc,GAAG,CAACH,QAAQ,CAAC,EAAE;IACxC;IACA,MAAM,IAAII,KAAK,CAAE,wBAAuBJ,QAAS,sBAAqB,CAAC;EACzE;EACA,MAAM;IAAEK,mBAAmB;IAAEC;EAA4B,CAAC,GACxD,IAAAC,6DAAiC,EAAC;IAAEP,QAAQ;IAAEE;EAAc,CAAC,CAAC;EAChEb,sBAAsB,CAACmB,GAAG,CAACR,QAAQ,EAAEK,mBAAmB,CAAC;EACzDC,2BAA2B,CAACL,SAAS,CAAC;AACxC;;AAEA;AACA,SAASQ,gCAAgCA,CAAA,EAAG;EAC1C,MAAMC,KAAK,GAAG,IAAAC,wCAAmB,EAAC,CAAC;EACnC,IAAID,KAAK,EAAE;IACT,
|
|
1
|
+
{"version":3,"file":"WidgetFunctions.js","names":["_StoryboardFunctionRegistry","require","_getV2RuntimeFromDll","widgetFunctionRegistry","Map","widgetFunctions","Proxy","Object","freeze","get","target","key","exports","registerWidgetFunctionsV3","widgetId","functions","widgetVersion","has","Error","storyboardFunctions","registerStoryboardFunctions","StoryboardFunctionRegistryFactory","set","registerWidgetFunctionsV2Factory","v2Kit","getV2RuntimeFromDll","getRuntime","registerWidgetFunctions"],"sources":["../../../../src/internal/compute/WidgetFunctions.ts"],"sourcesContent":["import { StoryboardFunction } from \"@next-core/types\";\nimport {\n ReadonlyStoryboardFunctions,\n StoryboardFunctionRegistryFactory,\n} from \"../../StoryboardFunctionRegistry.js\";\nimport { getV2RuntimeFromDll } from \"../../getV2RuntimeFromDll.js\";\n\nconst widgetFunctionRegistry = new Map<string, ReadonlyStoryboardFunctions>();\n\nexport const widgetFunctions = new Proxy(Object.freeze({}), {\n get(target, key: string) {\n return widgetFunctionRegistry.get(key);\n },\n}) as Readonly<Record<string, ReadonlyStoryboardFunctions>>;\n\nfunction registerWidgetFunctionsV3(\n widgetId: string,\n functions: StoryboardFunction[],\n widgetVersion?: string\n): void {\n if (widgetFunctionRegistry.has(widgetId)) {\n // eslint-disable-next-line no-console\n throw new Error(`Widget functions of \"${widgetId}\" already registered`);\n }\n const { storyboardFunctions, registerStoryboardFunctions } =\n StoryboardFunctionRegistryFactory({ widgetId, widgetVersion });\n widgetFunctionRegistry.set(widgetId, storyboardFunctions);\n registerStoryboardFunctions(functions);\n}\n\n// istanbul ignore next\nfunction registerWidgetFunctionsV2Factory() {\n const v2Kit = getV2RuntimeFromDll();\n if (v2Kit) {\n return function (\n widgetId: string,\n functions: StoryboardFunction[],\n widgetVersion?: string\n ) {\n return v2Kit\n .getRuntime()\n .registerWidgetFunctions(widgetId, functions, widgetVersion);\n };\n }\n}\n\n// istanbul ignore next\nexport const registerWidgetFunctions =\n registerWidgetFunctionsV2Factory() || registerWidgetFunctionsV3;\n"],"mappings":";;;;;;AACA,IAAAA,2BAAA,GAAAC,OAAA;AAIA,IAAAC,oBAAA,GAAAD,OAAA;AAEA,MAAME,sBAAsB,GAAG,IAAIC,GAAG,CAAsC,CAAC;AAEtE,MAAMC,eAAe,GAAG,IAAIC,KAAK,CAACC,MAAM,CAACC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE;EAC1DC,GAAGA,CAACC,MAAM,EAAEC,GAAW,EAAE;IACvB,OAAOR,sBAAsB,CAACM,GAAG,CAACE,GAAG,CAAC;EACxC;AACF,CAAC,CAA0D;AAACC,OAAA,CAAAP,eAAA,GAAAA,eAAA;AAE5D,SAASQ,yBAAyBA,CAChCC,QAAgB,EAChBC,SAA+B,EAC/BC,aAAsB,EAChB;EACN,IAAIb,sBAAsB,CAACc,GAAG,CAACH,QAAQ,CAAC,EAAE;IACxC;IACA,MAAM,IAAII,KAAK,CAAE,wBAAuBJ,QAAS,sBAAqB,CAAC;EACzE;EACA,MAAM;IAAEK,mBAAmB;IAAEC;EAA4B,CAAC,GACxD,IAAAC,6DAAiC,EAAC;IAAEP,QAAQ;IAAEE;EAAc,CAAC,CAAC;EAChEb,sBAAsB,CAACmB,GAAG,CAACR,QAAQ,EAAEK,mBAAmB,CAAC;EACzDC,2BAA2B,CAACL,SAAS,CAAC;AACxC;;AAEA;AACA,SAASQ,gCAAgCA,CAAA,EAAG;EAC1C,MAAMC,KAAK,GAAG,IAAAC,wCAAmB,EAAC,CAAC;EACnC,IAAID,KAAK,EAAE;IACT,OAAO,UACLV,QAAgB,EAChBC,SAA+B,EAC/BC,aAAsB,EACtB;MACA,OAAOQ,KAAK,CACTE,UAAU,CAAC,CAAC,CACZC,uBAAuB,CAACb,QAAQ,EAAEC,SAAS,EAAEC,aAAa,CAAC;IAChE,CAAC;EACH;AACF;;AAEA;AACO,MAAMW,uBAAuB,GAClCJ,gCAAgC,CAAC,CAAC,IAAIV,yBAAyB;AAACD,OAAA,CAAAe,uBAAA,GAAAA,uBAAA"}
|
|
@@ -22,7 +22,9 @@ function widgetI18nFactory(widgetId) {
|
|
|
22
22
|
function registerWidgetI18nV2Factory() {
|
|
23
23
|
const v2Kit = (0, _getV2RuntimeFromDll.getV2RuntimeFromDll)();
|
|
24
24
|
if (v2Kit) {
|
|
25
|
-
return
|
|
25
|
+
return function (widgetId, i18nData) {
|
|
26
|
+
return v2Kit.getRuntime().registerWidgetI18n(widgetId, i18nData);
|
|
27
|
+
};
|
|
26
28
|
}
|
|
27
29
|
}
|
|
28
30
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WidgetI18n.js","names":["_i18n","require","_registerAppI18n","_getV2RuntimeFromDll","registerWidgetI18nV3","widgetId","i18nData","ns","getI18nNamespace","Object","entries","forEach","lang","resources","i18n","addResourceBundle","widgetI18nFactory","getFixedT","registerWidgetI18nV2Factory","v2Kit","getV2RuntimeFromDll","registerWidgetI18n","exports"],"sources":["../../../../src/internal/compute/WidgetI18n.ts"],"sourcesContent":["import { i18n } from \"@next-core/i18n\";\nimport type { MetaI18n } from \"@next-core/types\";\nimport { getI18nNamespace } from \"../registerAppI18n.js\";\nimport { getV2RuntimeFromDll } from \"../../getV2RuntimeFromDll.js\";\n\nfunction registerWidgetI18nV3(widgetId: string, i18nData: MetaI18n): void {\n const ns = getI18nNamespace(\"widget\", widgetId);\n Object.entries(i18nData).forEach(([lang, resources]) => {\n i18n.addResourceBundle(lang, ns, resources);\n });\n}\n\nexport function widgetI18nFactory(widgetId: string) {\n return i18n.getFixedT(null, getI18nNamespace(\"widget\", widgetId));\n}\n\n// istanbul ignore next\nfunction registerWidgetI18nV2Factory() {\n const v2Kit = getV2RuntimeFromDll();\n if (v2Kit) {\n return v2Kit.registerWidgetI18n;\n }\n}\n\n// istanbul ignore next\nexport const registerWidgetI18n =\n registerWidgetI18nV2Factory() || registerWidgetI18nV3;\n"],"mappings":";;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAEA,IAAAC,gBAAA,GAAAD,OAAA;AACA,IAAAE,oBAAA,GAAAF,OAAA;AAEA,SAASG,oBAAoBA,CAACC,QAAgB,EAAEC,QAAkB,EAAQ;EACxE,MAAMC,EAAE,GAAG,IAAAC,iCAAgB,EAAC,QAAQ,EAAEH,QAAQ,CAAC;EAC/CI,MAAM,CAACC,OAAO,CAACJ,QAAQ,CAAC,CAACK,OAAO,CAAC,CAAC,CAACC,IAAI,EAAEC,SAAS,CAAC,KAAK;IACtDC,UAAI,CAACC,iBAAiB,CAACH,IAAI,EAAEL,EAAE,EAAEM,SAAS,CAAC;EAC7C,CAAC,CAAC;AACJ;AAEO,SAASG,iBAAiBA,CAACX,QAAgB,EAAE;EAClD,OAAOS,UAAI,CAACG,SAAS,CAAC,IAAI,EAAE,IAAAT,iCAAgB,EAAC,QAAQ,EAAEH,QAAQ,CAAC,CAAC;AACnE;;AAEA;AACA,SAASa,2BAA2BA,CAAA,EAAG;EACrC,MAAMC,KAAK,GAAG,IAAAC,wCAAmB,EAAC,CAAC;EACnC,IAAID,KAAK,EAAE;IACT,
|
|
1
|
+
{"version":3,"file":"WidgetI18n.js","names":["_i18n","require","_registerAppI18n","_getV2RuntimeFromDll","registerWidgetI18nV3","widgetId","i18nData","ns","getI18nNamespace","Object","entries","forEach","lang","resources","i18n","addResourceBundle","widgetI18nFactory","getFixedT","registerWidgetI18nV2Factory","v2Kit","getV2RuntimeFromDll","getRuntime","registerWidgetI18n","exports"],"sources":["../../../../src/internal/compute/WidgetI18n.ts"],"sourcesContent":["import { i18n } from \"@next-core/i18n\";\nimport type { MetaI18n } from \"@next-core/types\";\nimport { getI18nNamespace } from \"../registerAppI18n.js\";\nimport { getV2RuntimeFromDll } from \"../../getV2RuntimeFromDll.js\";\n\nfunction registerWidgetI18nV3(widgetId: string, i18nData: MetaI18n): void {\n const ns = getI18nNamespace(\"widget\", widgetId);\n Object.entries(i18nData).forEach(([lang, resources]) => {\n i18n.addResourceBundle(lang, ns, resources);\n });\n}\n\nexport function widgetI18nFactory(widgetId: string) {\n return i18n.getFixedT(null, getI18nNamespace(\"widget\", widgetId));\n}\n\n// istanbul ignore next\nfunction registerWidgetI18nV2Factory() {\n const v2Kit = getV2RuntimeFromDll();\n if (v2Kit) {\n return function (widgetId: string, i18nData: MetaI18n) {\n return v2Kit.getRuntime().registerWidgetI18n(widgetId, i18nData);\n };\n }\n}\n\n// istanbul ignore next\nexport const registerWidgetI18n =\n registerWidgetI18nV2Factory() || registerWidgetI18nV3;\n"],"mappings":";;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAEA,IAAAC,gBAAA,GAAAD,OAAA;AACA,IAAAE,oBAAA,GAAAF,OAAA;AAEA,SAASG,oBAAoBA,CAACC,QAAgB,EAAEC,QAAkB,EAAQ;EACxE,MAAMC,EAAE,GAAG,IAAAC,iCAAgB,EAAC,QAAQ,EAAEH,QAAQ,CAAC;EAC/CI,MAAM,CAACC,OAAO,CAACJ,QAAQ,CAAC,CAACK,OAAO,CAAC,CAAC,CAACC,IAAI,EAAEC,SAAS,CAAC,KAAK;IACtDC,UAAI,CAACC,iBAAiB,CAACH,IAAI,EAAEL,EAAE,EAAEM,SAAS,CAAC;EAC7C,CAAC,CAAC;AACJ;AAEO,SAASG,iBAAiBA,CAACX,QAAgB,EAAE;EAClD,OAAOS,UAAI,CAACG,SAAS,CAAC,IAAI,EAAE,IAAAT,iCAAgB,EAAC,QAAQ,EAAEH,QAAQ,CAAC,CAAC;AACnE;;AAEA;AACA,SAASa,2BAA2BA,CAAA,EAAG;EACrC,MAAMC,KAAK,GAAG,IAAAC,wCAAmB,EAAC,CAAC;EACnC,IAAID,KAAK,EAAE;IACT,OAAO,UAAUd,QAAgB,EAAEC,QAAkB,EAAE;MACrD,OAAOa,KAAK,CAACE,UAAU,CAAC,CAAC,CAACC,kBAAkB,CAACjB,QAAQ,EAAEC,QAAQ,CAAC;IAClE,CAAC;EACH;AACF;;AAEA;AACO,MAAMgB,kBAAkB,GAC7BJ,2BAA2B,CAAC,CAAC,IAAId,oBAAoB;AAACmB,OAAA,CAAAD,kBAAA,GAAAA,kBAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getV2RuntimeFromDll.js","names":["getV2RuntimeFromDll","_window$BRICK_NEXT_VE","dll","window","BRICK_NEXT_VERSIONS","startsWith"],"sources":["../../src/getV2RuntimeFromDll.ts"],"sourcesContent":["import type {\n CustomTemplateConstructor,\n MetaI18n,\n StoryboardFunction,\n} from \"@next-core/types\";\nimport type { NextHistory } from \"./history.js\";\nimport type { IfContainer } from \"./internal/compute/checkIf.js\";\n\ninterface DLL {\n (moduleId: \"tYg3\"): Kit;\n}\n\ninterface Kit {\n getRuntime(): {\n registerCustomTemplate(\n tagName: string,\n constructor: CustomTemplateConstructor\n ): void;\n registerCustomProcessor(\n processorFullName: string,\n processorFunc: Function\n ): void;\n
|
|
1
|
+
{"version":3,"file":"getV2RuntimeFromDll.js","names":["getV2RuntimeFromDll","_window$BRICK_NEXT_VE","dll","window","BRICK_NEXT_VERSIONS","startsWith"],"sources":["../../src/getV2RuntimeFromDll.ts"],"sourcesContent":["import type {\n CustomTemplateConstructor,\n MetaI18n,\n StoryboardFunction,\n} from \"@next-core/types\";\nimport type { NextHistory } from \"./history.js\";\nimport type { IfContainer } from \"./internal/compute/checkIf.js\";\n\ninterface DLL {\n (moduleId: \"tYg3\"): Kit;\n}\n\ninterface Kit {\n getRuntime(): {\n registerCustomTemplate(\n tagName: string,\n constructor: CustomTemplateConstructor\n ): void;\n registerCustomProcessor(\n processorFullName: string,\n processorFunc: Function\n ): void;\n registerWidgetFunctions(\n widgetId: string,\n functions: StoryboardFunction[],\n widgetVersion?: string\n ): void;\n registerWidgetI18n(widgetId: string, i18nData: MetaI18n): void;\n };\n getHistory(): NextHistory;\n looseCheckIfByTransform(ifContainer: IfContainer, data: unknown): boolean;\n SingleBrickAsComponentFactory: any;\n BrickAsComponentFactory: any;\n authenticate: any;\n getAuth: any;\n isLoggedIn: any;\n logout: any;\n}\n\nexport function getV2RuntimeFromDll() {\n const { dll } = window as { dll?: DLL };\n if (\n dll &&\n window.BRICK_NEXT_VERSIONS?.[\"brick-container\"]?.startsWith(\"2.\")\n ) {\n return dll(\"tYg3\");\n }\n}\n"],"mappings":"AAuCA,OAAO,SAASA,mBAAmBA,CAAA,EAAG;EAAA,IAAAC,qBAAA;EACpC,IAAM;IAAEC;EAAI,CAAC,GAAGC,MAAuB;EACvC,IACED,GAAG,KAAAD,qBAAA,GACHE,MAAM,CAACC,mBAAmB,cAAAH,qBAAA,gBAAAA,qBAAA,GAA1BA,qBAAA,CAA6B,iBAAiB,CAAC,cAAAA,qBAAA,eAA/CA,qBAAA,CAAiDI,UAAU,CAAC,IAAI,CAAC,EACjE;IACA,OAAOH,GAAG,CAAC,MAAM,CAAC;EACpB;AACF"}
|
|
@@ -26,7 +26,9 @@ function registerWidgetFunctionsV3(widgetId, functions, widgetVersion) {
|
|
|
26
26
|
function registerWidgetFunctionsV2Factory() {
|
|
27
27
|
var v2Kit = getV2RuntimeFromDll();
|
|
28
28
|
if (v2Kit) {
|
|
29
|
-
return
|
|
29
|
+
return function (widgetId, functions, widgetVersion) {
|
|
30
|
+
return v2Kit.getRuntime().registerWidgetFunctions(widgetId, functions, widgetVersion);
|
|
31
|
+
};
|
|
30
32
|
}
|
|
31
33
|
}
|
|
32
34
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WidgetFunctions.js","names":["StoryboardFunctionRegistryFactory","getV2RuntimeFromDll","widgetFunctionRegistry","Map","widgetFunctions","Proxy","Object","freeze","get","target","key","registerWidgetFunctionsV3","widgetId","functions","widgetVersion","has","Error","concat","storyboardFunctions","registerStoryboardFunctions","set","registerWidgetFunctionsV2Factory","v2Kit","registerWidgetFunctions"],"sources":["../../../../src/internal/compute/WidgetFunctions.ts"],"sourcesContent":["import { StoryboardFunction } from \"@next-core/types\";\nimport {\n ReadonlyStoryboardFunctions,\n StoryboardFunctionRegistryFactory,\n} from \"../../StoryboardFunctionRegistry.js\";\nimport { getV2RuntimeFromDll } from \"../../getV2RuntimeFromDll.js\";\n\nconst widgetFunctionRegistry = new Map<string, ReadonlyStoryboardFunctions>();\n\nexport const widgetFunctions = new Proxy(Object.freeze({}), {\n get(target, key: string) {\n return widgetFunctionRegistry.get(key);\n },\n}) as Readonly<Record<string, ReadonlyStoryboardFunctions>>;\n\nfunction registerWidgetFunctionsV3(\n widgetId: string,\n functions: StoryboardFunction[],\n widgetVersion?: string\n): void {\n if (widgetFunctionRegistry.has(widgetId)) {\n // eslint-disable-next-line no-console\n throw new Error(`Widget functions of \"${widgetId}\" already registered`);\n }\n const { storyboardFunctions, registerStoryboardFunctions } =\n StoryboardFunctionRegistryFactory({ widgetId, widgetVersion });\n widgetFunctionRegistry.set(widgetId, storyboardFunctions);\n registerStoryboardFunctions(functions);\n}\n\n// istanbul ignore next\nfunction registerWidgetFunctionsV2Factory() {\n const v2Kit = getV2RuntimeFromDll();\n if (v2Kit) {\n return v2Kit.registerWidgetFunctions;\n }\n}\n\n// istanbul ignore next\nexport const registerWidgetFunctions =\n registerWidgetFunctionsV2Factory() || registerWidgetFunctionsV3;\n"],"mappings":"AACA,SAEEA,iCAAiC,QAC5B,qCAAqC;AAC5C,SAASC,mBAAmB,QAAQ,8BAA8B;AAElE,IAAMC,sBAAsB,GAAG,IAAIC,GAAG,CAAsC,CAAC;AAE7E,OAAO,IAAMC,eAAe,GAAG,IAAIC,KAAK,CAACC,MAAM,CAACC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE;EAC1DC,GAAGA,CAACC,MAAM,EAAEC,GAAW,EAAE;IACvB,OAAOR,sBAAsB,CAACM,GAAG,CAACE,GAAG,CAAC;EACxC;AACF,CAAC,CAA0D;AAE3D,SAASC,yBAAyBA,CAChCC,QAAgB,EAChBC,SAA+B,EAC/BC,aAAsB,EAChB;EACN,IAAIZ,sBAAsB,CAACa,GAAG,CAACH,QAAQ,CAAC,EAAE;IACxC;IACA,MAAM,IAAII,KAAK,0BAAAC,MAAA,CAAyBL,QAAQ,0BAAsB,CAAC;EACzE;EACA,IAAM;IAAEM,mBAAmB;IAAEC;EAA4B,CAAC,GACxDnB,iCAAiC,CAAC;IAAEY,QAAQ;IAAEE;EAAc,CAAC,CAAC;EAChEZ,sBAAsB,CAACkB,GAAG,CAACR,QAAQ,EAAEM,mBAAmB,CAAC;EACzDC,2BAA2B,CAACN,SAAS,CAAC;AACxC;;AAEA;AACA,SAASQ,gCAAgCA,CAAA,EAAG;EAC1C,IAAMC,KAAK,GAAGrB,mBAAmB,CAAC,CAAC;EACnC,IAAIqB,KAAK,EAAE;IACT,
|
|
1
|
+
{"version":3,"file":"WidgetFunctions.js","names":["StoryboardFunctionRegistryFactory","getV2RuntimeFromDll","widgetFunctionRegistry","Map","widgetFunctions","Proxy","Object","freeze","get","target","key","registerWidgetFunctionsV3","widgetId","functions","widgetVersion","has","Error","concat","storyboardFunctions","registerStoryboardFunctions","set","registerWidgetFunctionsV2Factory","v2Kit","getRuntime","registerWidgetFunctions"],"sources":["../../../../src/internal/compute/WidgetFunctions.ts"],"sourcesContent":["import { StoryboardFunction } from \"@next-core/types\";\nimport {\n ReadonlyStoryboardFunctions,\n StoryboardFunctionRegistryFactory,\n} from \"../../StoryboardFunctionRegistry.js\";\nimport { getV2RuntimeFromDll } from \"../../getV2RuntimeFromDll.js\";\n\nconst widgetFunctionRegistry = new Map<string, ReadonlyStoryboardFunctions>();\n\nexport const widgetFunctions = new Proxy(Object.freeze({}), {\n get(target, key: string) {\n return widgetFunctionRegistry.get(key);\n },\n}) as Readonly<Record<string, ReadonlyStoryboardFunctions>>;\n\nfunction registerWidgetFunctionsV3(\n widgetId: string,\n functions: StoryboardFunction[],\n widgetVersion?: string\n): void {\n if (widgetFunctionRegistry.has(widgetId)) {\n // eslint-disable-next-line no-console\n throw new Error(`Widget functions of \"${widgetId}\" already registered`);\n }\n const { storyboardFunctions, registerStoryboardFunctions } =\n StoryboardFunctionRegistryFactory({ widgetId, widgetVersion });\n widgetFunctionRegistry.set(widgetId, storyboardFunctions);\n registerStoryboardFunctions(functions);\n}\n\n// istanbul ignore next\nfunction registerWidgetFunctionsV2Factory() {\n const v2Kit = getV2RuntimeFromDll();\n if (v2Kit) {\n return function (\n widgetId: string,\n functions: StoryboardFunction[],\n widgetVersion?: string\n ) {\n return v2Kit\n .getRuntime()\n .registerWidgetFunctions(widgetId, functions, widgetVersion);\n };\n }\n}\n\n// istanbul ignore next\nexport const registerWidgetFunctions =\n registerWidgetFunctionsV2Factory() || registerWidgetFunctionsV3;\n"],"mappings":"AACA,SAEEA,iCAAiC,QAC5B,qCAAqC;AAC5C,SAASC,mBAAmB,QAAQ,8BAA8B;AAElE,IAAMC,sBAAsB,GAAG,IAAIC,GAAG,CAAsC,CAAC;AAE7E,OAAO,IAAMC,eAAe,GAAG,IAAIC,KAAK,CAACC,MAAM,CAACC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE;EAC1DC,GAAGA,CAACC,MAAM,EAAEC,GAAW,EAAE;IACvB,OAAOR,sBAAsB,CAACM,GAAG,CAACE,GAAG,CAAC;EACxC;AACF,CAAC,CAA0D;AAE3D,SAASC,yBAAyBA,CAChCC,QAAgB,EAChBC,SAA+B,EAC/BC,aAAsB,EAChB;EACN,IAAIZ,sBAAsB,CAACa,GAAG,CAACH,QAAQ,CAAC,EAAE;IACxC;IACA,MAAM,IAAII,KAAK,0BAAAC,MAAA,CAAyBL,QAAQ,0BAAsB,CAAC;EACzE;EACA,IAAM;IAAEM,mBAAmB;IAAEC;EAA4B,CAAC,GACxDnB,iCAAiC,CAAC;IAAEY,QAAQ;IAAEE;EAAc,CAAC,CAAC;EAChEZ,sBAAsB,CAACkB,GAAG,CAACR,QAAQ,EAAEM,mBAAmB,CAAC;EACzDC,2BAA2B,CAACN,SAAS,CAAC;AACxC;;AAEA;AACA,SAASQ,gCAAgCA,CAAA,EAAG;EAC1C,IAAMC,KAAK,GAAGrB,mBAAmB,CAAC,CAAC;EACnC,IAAIqB,KAAK,EAAE;IACT,OAAO,UACLV,QAAgB,EAChBC,SAA+B,EAC/BC,aAAsB,EACtB;MACA,OAAOQ,KAAK,CACTC,UAAU,CAAC,CAAC,CACZC,uBAAuB,CAACZ,QAAQ,EAAEC,SAAS,EAAEC,aAAa,CAAC;IAChE,CAAC;EACH;AACF;;AAEA;AACA,OAAO,IAAMU,uBAAuB,GAClCH,gCAAgC,CAAC,CAAC,IAAIV,yBAAyB"}
|
|
@@ -16,7 +16,9 @@ export function widgetI18nFactory(widgetId) {
|
|
|
16
16
|
function registerWidgetI18nV2Factory() {
|
|
17
17
|
var v2Kit = getV2RuntimeFromDll();
|
|
18
18
|
if (v2Kit) {
|
|
19
|
-
return
|
|
19
|
+
return function (widgetId, i18nData) {
|
|
20
|
+
return v2Kit.getRuntime().registerWidgetI18n(widgetId, i18nData);
|
|
21
|
+
};
|
|
20
22
|
}
|
|
21
23
|
}
|
|
22
24
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WidgetI18n.js","names":["i18n","getI18nNamespace","getV2RuntimeFromDll","registerWidgetI18nV3","widgetId","i18nData","ns","Object","entries","forEach","_ref","lang","resources","addResourceBundle","widgetI18nFactory","getFixedT","registerWidgetI18nV2Factory","v2Kit","registerWidgetI18n"],"sources":["../../../../src/internal/compute/WidgetI18n.ts"],"sourcesContent":["import { i18n } from \"@next-core/i18n\";\nimport type { MetaI18n } from \"@next-core/types\";\nimport { getI18nNamespace } from \"../registerAppI18n.js\";\nimport { getV2RuntimeFromDll } from \"../../getV2RuntimeFromDll.js\";\n\nfunction registerWidgetI18nV3(widgetId: string, i18nData: MetaI18n): void {\n const ns = getI18nNamespace(\"widget\", widgetId);\n Object.entries(i18nData).forEach(([lang, resources]) => {\n i18n.addResourceBundle(lang, ns, resources);\n });\n}\n\nexport function widgetI18nFactory(widgetId: string) {\n return i18n.getFixedT(null, getI18nNamespace(\"widget\", widgetId));\n}\n\n// istanbul ignore next\nfunction registerWidgetI18nV2Factory() {\n const v2Kit = getV2RuntimeFromDll();\n if (v2Kit) {\n return v2Kit.registerWidgetI18n;\n }\n}\n\n// istanbul ignore next\nexport const registerWidgetI18n =\n registerWidgetI18nV2Factory() || registerWidgetI18nV3;\n"],"mappings":"AAAA,SAASA,IAAI,QAAQ,iBAAiB;AAEtC,SAASC,gBAAgB,QAAQ,uBAAuB;AACxD,SAASC,mBAAmB,QAAQ,8BAA8B;AAElE,SAASC,oBAAoBA,CAACC,QAAgB,EAAEC,QAAkB,EAAQ;EACxE,IAAMC,EAAE,GAAGL,gBAAgB,CAAC,QAAQ,EAAEG,QAAQ,CAAC;EAC/CG,MAAM,CAACC,OAAO,CAACH,QAAQ,CAAC,CAACI,OAAO,CAACC,IAAA,IAAuB;IAAA,IAAtB,CAACC,IAAI,EAAEC,SAAS,CAAC,GAAAF,IAAA;IACjDV,IAAI,CAACa,iBAAiB,CAACF,IAAI,EAAEL,EAAE,EAAEM,SAAS,CAAC;EAC7C,CAAC,CAAC;AACJ;AAEA,OAAO,SAASE,iBAAiBA,CAACV,QAAgB,EAAE;EAClD,OAAOJ,IAAI,CAACe,SAAS,CAAC,IAAI,EAAEd,gBAAgB,CAAC,QAAQ,EAAEG,QAAQ,CAAC,CAAC;AACnE;;AAEA;AACA,SAASY,2BAA2BA,CAAA,EAAG;EACrC,IAAMC,KAAK,GAAGf,mBAAmB,CAAC,CAAC;EACnC,IAAIe,KAAK,EAAE;IACT,
|
|
1
|
+
{"version":3,"file":"WidgetI18n.js","names":["i18n","getI18nNamespace","getV2RuntimeFromDll","registerWidgetI18nV3","widgetId","i18nData","ns","Object","entries","forEach","_ref","lang","resources","addResourceBundle","widgetI18nFactory","getFixedT","registerWidgetI18nV2Factory","v2Kit","getRuntime","registerWidgetI18n"],"sources":["../../../../src/internal/compute/WidgetI18n.ts"],"sourcesContent":["import { i18n } from \"@next-core/i18n\";\nimport type { MetaI18n } from \"@next-core/types\";\nimport { getI18nNamespace } from \"../registerAppI18n.js\";\nimport { getV2RuntimeFromDll } from \"../../getV2RuntimeFromDll.js\";\n\nfunction registerWidgetI18nV3(widgetId: string, i18nData: MetaI18n): void {\n const ns = getI18nNamespace(\"widget\", widgetId);\n Object.entries(i18nData).forEach(([lang, resources]) => {\n i18n.addResourceBundle(lang, ns, resources);\n });\n}\n\nexport function widgetI18nFactory(widgetId: string) {\n return i18n.getFixedT(null, getI18nNamespace(\"widget\", widgetId));\n}\n\n// istanbul ignore next\nfunction registerWidgetI18nV2Factory() {\n const v2Kit = getV2RuntimeFromDll();\n if (v2Kit) {\n return function (widgetId: string, i18nData: MetaI18n) {\n return v2Kit.getRuntime().registerWidgetI18n(widgetId, i18nData);\n };\n }\n}\n\n// istanbul ignore next\nexport const registerWidgetI18n =\n registerWidgetI18nV2Factory() || registerWidgetI18nV3;\n"],"mappings":"AAAA,SAASA,IAAI,QAAQ,iBAAiB;AAEtC,SAASC,gBAAgB,QAAQ,uBAAuB;AACxD,SAASC,mBAAmB,QAAQ,8BAA8B;AAElE,SAASC,oBAAoBA,CAACC,QAAgB,EAAEC,QAAkB,EAAQ;EACxE,IAAMC,EAAE,GAAGL,gBAAgB,CAAC,QAAQ,EAAEG,QAAQ,CAAC;EAC/CG,MAAM,CAACC,OAAO,CAACH,QAAQ,CAAC,CAACI,OAAO,CAACC,IAAA,IAAuB;IAAA,IAAtB,CAACC,IAAI,EAAEC,SAAS,CAAC,GAAAF,IAAA;IACjDV,IAAI,CAACa,iBAAiB,CAACF,IAAI,EAAEL,EAAE,EAAEM,SAAS,CAAC;EAC7C,CAAC,CAAC;AACJ;AAEA,OAAO,SAASE,iBAAiBA,CAACV,QAAgB,EAAE;EAClD,OAAOJ,IAAI,CAACe,SAAS,CAAC,IAAI,EAAEd,gBAAgB,CAAC,QAAQ,EAAEG,QAAQ,CAAC,CAAC;AACnE;;AAEA;AACA,SAASY,2BAA2BA,CAAA,EAAG;EACrC,IAAMC,KAAK,GAAGf,mBAAmB,CAAC,CAAC;EACnC,IAAIe,KAAK,EAAE;IACT,OAAO,UAAUb,QAAgB,EAAEC,QAAkB,EAAE;MACrD,OAAOY,KAAK,CAACC,UAAU,CAAC,CAAC,CAACC,kBAAkB,CAACf,QAAQ,EAAEC,QAAQ,CAAC;IAClE,CAAC;EACH;AACF;;AAEA;AACA,OAAO,IAAMc,kBAAkB,GAC7BH,2BAA2B,CAAC,CAAC,IAAIb,oBAAoB"}
|
|
@@ -5,10 +5,10 @@ interface Kit {
|
|
|
5
5
|
getRuntime(): {
|
|
6
6
|
registerCustomTemplate(tagName: string, constructor: CustomTemplateConstructor): void;
|
|
7
7
|
registerCustomProcessor(processorFullName: string, processorFunc: Function): void;
|
|
8
|
+
registerWidgetFunctions(widgetId: string, functions: StoryboardFunction[], widgetVersion?: string): void;
|
|
9
|
+
registerWidgetI18n(widgetId: string, i18nData: MetaI18n): void;
|
|
8
10
|
};
|
|
9
11
|
getHistory(): NextHistory;
|
|
10
|
-
registerWidgetFunctions(widgetId: string, functions: StoryboardFunction[], widgetVersion?: string): void;
|
|
11
|
-
registerWidgetI18n(widgetId: string, i18nData: MetaI18n): void;
|
|
12
12
|
looseCheckIfByTransform(ifContainer: IfContainer, data: unknown): boolean;
|
|
13
13
|
SingleBrickAsComponentFactory: any;
|
|
14
14
|
BrickAsComponentFactory: any;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { StoryboardFunction } from "@next-core/types";
|
|
2
2
|
export declare const widgetFunctions: Readonly<Record<string, Readonly<Record<string, Function>>>>;
|
|
3
|
-
export declare const registerWidgetFunctions: (widgetId: string, functions: StoryboardFunction[], widgetVersion?: string
|
|
3
|
+
export declare const registerWidgetFunctions: (widgetId: string, functions: StoryboardFunction[], widgetVersion?: string) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@next-core/runtime",
|
|
3
|
-
"version": "1.22.
|
|
3
|
+
"version": "1.22.12",
|
|
4
4
|
"homepage": "https://github.com/easyops-cn/next-core/tree/v3/packages/runtime",
|
|
5
5
|
"license": "GPL-3.0",
|
|
6
6
|
"repository": {
|
|
@@ -65,5 +65,5 @@
|
|
|
65
65
|
"@next-core/build-next-libs": "^1.0.7",
|
|
66
66
|
"@next-core/test-next": "^1.0.10"
|
|
67
67
|
},
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "c5318d26a1be4d4b5e6285897c38f063706cb98e"
|
|
69
69
|
}
|