@kizenapps/engine 0.1.0-5951933 → 0.1.0-d6c4e0e

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.
Files changed (32) hide show
  1. package/dist/{chunk-PKPMGXY6.js → chunk-4CJLA5IA.js} +4 -4
  2. package/dist/{chunk-PKPMGXY6.js.map → chunk-4CJLA5IA.js.map} +1 -1
  3. package/dist/{chunk-3GESZEDY.js → chunk-5LKQPDL3.js} +3 -3
  4. package/dist/{chunk-3GESZEDY.js.map → chunk-5LKQPDL3.js.map} +1 -1
  5. package/dist/{chunk-B6F7AP7L.js → chunk-DUUQZSFR.js} +3 -3
  6. package/dist/{chunk-B6F7AP7L.js.map → chunk-DUUQZSFR.js.map} +1 -1
  7. package/dist/{chunk-7CFLCBUW.js → chunk-GFWYCITI.js} +3 -3
  8. package/dist/{chunk-7CFLCBUW.js.map → chunk-GFWYCITI.js.map} +1 -1
  9. package/dist/{chunk-THPHVCIB.js → chunk-GJ7W4HNT.js} +3 -3
  10. package/dist/{chunk-THPHVCIB.js.map → chunk-GJ7W4HNT.js.map} +1 -1
  11. package/dist/{chunk-7J2F2Y36.js → chunk-HIL4FWPO.js} +3 -3
  12. package/dist/{chunk-7J2F2Y36.js.map → chunk-HIL4FWPO.js.map} +1 -1
  13. package/dist/{chunk-YUHUDR72.js → chunk-MVOZBS7N.js} +5 -5
  14. package/dist/{chunk-YUHUDR72.js.map → chunk-MVOZBS7N.js.map} +1 -1
  15. package/dist/{chunk-JOH235MV.js → chunk-U35XGI24.js} +3 -3
  16. package/dist/{chunk-JOH235MV.js.map → chunk-U35XGI24.js.map} +1 -1
  17. package/dist/{chunk-3BM3ADCB.js → chunk-WYOBLTZE.js} +5 -5
  18. package/dist/{chunk-3BM3ADCB.js.map → chunk-WYOBLTZE.js.map} +1 -1
  19. package/dist/communication.js +2 -2
  20. package/dist/contexts/base.js +4 -4
  21. package/dist/contexts/floatingFrame.js +5 -5
  22. package/dist/contexts/recordDetail.js +5 -5
  23. package/dist/index.js +3 -3
  24. package/dist/react.js +5 -5
  25. package/dist/scripts/index.js +4 -0
  26. package/dist/util.js +6 -6
  27. package/dist/workers/calendarSource.worker.js +6 -6
  28. package/dist/workers/floatingFrame.worker.js +7 -7
  29. package/dist/workers/generic.worker.js +6 -6
  30. package/dist/workers/recordDetail.worker.js +7 -7
  31. package/package.json +6 -4
  32. /package/dist/{merge-translations.js → scripts/merge-translations.js} +0 -0
@@ -1,4 +1,4 @@
1
- import { ROUTE_CHANGE_INTERNAL_EVENT } from './chunk-7J2F2Y36.js';
1
+ import { ROUTE_CHANGE_INTERNAL_EVENT } from './chunk-HIL4FWPO.js';
2
2
 
3
3
  // src/util/run.ts
4
4
  var getPartialLocation = () => {
@@ -117,5 +117,5 @@ var findMatchingAction = (availableActions, apiName) => {
117
117
  };
118
118
 
119
119
  export { emitRouteChange, findMatchingAction, generateExecutionKey, generateUUIDV4, getFn, getFnWithReturn, getPartialLocation };
120
- //# sourceMappingURL=chunk-JOH235MV.js.map
121
- //# sourceMappingURL=chunk-JOH235MV.js.map
120
+ //# sourceMappingURL=chunk-U35XGI24.js.map
121
+ //# sourceMappingURL=chunk-U35XGI24.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/util/run.ts"],"names":["action"],"mappings":";;;AAKO,IAAM,qBAAqB,MAAuB;AACvD,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,OAAO,QAAA,CAAS,IAAA;AAAA,IACtB,IAAA,EAAM,OAAO,QAAA,CAAS,IAAA;AAAA,IACtB,IAAA,EAAM,OAAO,QAAA,CAAS,IAAA;AAAA,IACtB,MAAA,EAAQ,OAAO,QAAA,CAAS,MAAA;AAAA,IACxB,QAAA,EAAU,OAAO,QAAA,CAAS,QAAA;AAAA,IAC1B,MAAA,EAAQ,OAAO,QAAA,CAAS,MAAA;AAAA,IACxB,IAAA,EAAM,OAAO,QAAA,CAAS,IAAA;AAAA,IACtB,QAAA,EAAU,OAAO,QAA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,GACF;AACF,CAAA;AAEO,IAAM,kBAAA,GAAqB,CAChC,gBAAA,EAMA,OAAA,KACY;AACZ,EAAA,IAAI,CAAC,OAAA,EAAS;AACZ,IAAA,OAAO,IAAA;AAAA,EACT;AAEA,EAAA,MAAM,EAAE,aAAA,EAAe,aAAA,EAAc,GAAI,mBAAmB,OAAO,CAAA;AAEnE,EAAA,IAAI,CAAC,aAAA,EAAe;AAClB,IAAA,MAAMA,OAAAA,GAAS,gBAAA,CAAiB,IAAA,CAAK,CAAC,GAAA,KAAQ,CAAC,GAAA,CAAI,SAAA,IAAa,GAAA,CAAI,OAAA,KAAY,aAAa,CAAA;AAE7F,IAAA,OAAOA,OAAAA;AAAA,EACT;AAEA,EAAA,MAAM,SAAS,gBAAA,CAAiB,IAAA;AAAA,IAC9B,CAAC,GAAA,KAAQ,GAAA,CAAI,YAAY,aAAA,IAAiB,GAAA,CAAI,WAAW,OAAA,KAAY;AAAA,GACvE;AAEA,EAAA,OAAO,MAAA;AACT","file":"chunk-JOH235MV.js","sourcesContent":["import { ROUTE_CHANGE_INTERNAL_EVENT } from '../communication/constants.js';\nimport type { PartialLocation } from '../types/common.js';\nimport type { CommonExecutionPlugin, CommonPluginDefinition } from '../types/run.js';\nimport type { AsyncFunctionConstructor, BuiltAsyncFn } from '../types/workers.js';\n\nexport const getPartialLocation = (): PartialLocation => {\n return {\n host: window.location.host,\n hash: window.location.hash,\n href: window.location.href,\n origin: window.location.origin,\n pathname: window.location.pathname,\n search: window.location.search,\n port: window.location.port,\n protocol: window.location.protocol,\n };\n};\n\nexport const generateUUIDV4 = (): string => {\n let d = new Date().getTime();\n\n if (typeof performance !== 'undefined' && typeof performance.now === 'function') {\n d += performance.now();\n }\n\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {\n const r = ((d + Math.random() * 16) % 16) | 0;\n d = Math.floor(d / 16);\n return (c === 'x' ? r : (r & 0x3) | 0x8).toString(16);\n });\n};\n\nconst AsyncFunction = (\n Object.getPrototypeOf(async function () {\n /* empty */\n }) as { constructor: AsyncFunctionConstructor }\n).constructor;\n\nexport const getFnWithReturn = (script: string): BuiltAsyncFn => {\n const functionBody = `\n const __cleanup = this.__cleanup.bind(this);\n const __error = this.onError.bind(this);\n let __kizen_internal_result;\n {\n this.__setup();\n }\n try {\n __kizen_internal_result = await (async () => { ${script} })();\n } catch (ex) {\n __error(ex);\n } finally {\n __cleanup(__kizen_internal_result);\n }\n `;\n\n try {\n const fn = new AsyncFunction(functionBody);\n\n return { fn, functionBody };\n } catch {\n const errorFnBody = `\n this.__setup();\n this.onError({ message: \"The script has a syntax error and could not be parsed\" });\n this.__cleanup();\n `;\n\n const fn = new AsyncFunction(errorFnBody);\n\n return { fn, functionBody: errorFnBody };\n }\n};\n\nexport const getFn = (script: string): BuiltAsyncFn => {\n const functionBody = `\n const __cleanup = this.__cleanup.bind(this);\n const __error = this.onError.bind(this);\n {\n this.__setup();\n }\n try {\n ${script}\n } catch (ex) {\n __error(ex);\n } finally {\n __cleanup();\n }\n `;\n\n try {\n const fn = new AsyncFunction(functionBody);\n\n return { fn, functionBody };\n } catch {\n const errorFnBody = `\n this.__setup();\n this.onError({ message: \"The script has a syntax error and could not be parsed\" });\n this.__cleanup();\n `;\n\n const fn = new AsyncFunction(errorFnBody);\n\n return { fn, functionBody: errorFnBody };\n }\n};\n\nexport const generateExecutionKey = (\n pluginConfig?: CommonPluginDefinition | CommonExecutionPlugin,\n): string => {\n return `${pluginConfig?.plugin_api_name ?? ''}-${pluginConfig?.id ?? ''}-${pluginConfig?.api_name ?? ''}-${pluginConfig?.script_id ?? ''}`;\n};\n\nexport const emitRouteChange = (): void => {\n const event = new CustomEvent(ROUTE_CHANGE_INTERNAL_EVENT, {\n detail: {\n location: getPartialLocation(),\n },\n });\n\n window.dispatchEvent(event);\n};\n\nconst splitScriptApiName = (\n scriptApiName: string,\n): { pluginApiName: string | undefined; actionApiName: string | undefined } => {\n const [pluginApiName, actionApiName] = scriptApiName.split('.');\n\n return {\n pluginApiName,\n actionApiName,\n };\n};\n\nexport const findMatchingAction = (\n availableActions: {\n pluginApp?: {\n apiName: string;\n };\n apiName: string;\n }[],\n apiName?: string,\n): unknown => {\n if (!apiName) {\n return null;\n }\n\n const { pluginApiName, actionApiName } = splitScriptApiName(apiName);\n\n if (!pluginApiName) {\n const action = availableActions.find((act) => !act.pluginApp && act.apiName === actionApiName);\n\n return action;\n }\n\n const action = availableActions.find(\n (act) => act.apiName === actionApiName && act.pluginApp?.apiName === pluginApiName,\n );\n\n return action;\n};\n"]}
1
+ {"version":3,"sources":["../src/util/run.ts"],"names":["action"],"mappings":";;;AAKO,IAAM,qBAAqB,MAAuB;AACvD,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,OAAO,QAAA,CAAS,IAAA;AAAA,IACtB,IAAA,EAAM,OAAO,QAAA,CAAS,IAAA;AAAA,IACtB,IAAA,EAAM,OAAO,QAAA,CAAS,IAAA;AAAA,IACtB,MAAA,EAAQ,OAAO,QAAA,CAAS,MAAA;AAAA,IACxB,QAAA,EAAU,OAAO,QAAA,CAAS,QAAA;AAAA,IAC1B,MAAA,EAAQ,OAAO,QAAA,CAAS,MAAA;AAAA,IACxB,IAAA,EAAM,OAAO,QAAA,CAAS,IAAA;AAAA,IACtB,QAAA,EAAU,OAAO,QAAA,CAAS;AAAA,GAC5B;AACF;AAEO,IAAM,iBAAiB,MAAc;AAC1C,EAAA,IAAI,CAAA,GAAA,iBAAI,IAAI,IAAA,EAAK,EAAE,OAAA,EAAQ;AAE3B,EAAA,IAAI,OAAO,WAAA,KAAgB,WAAA,IAAe,OAAO,WAAA,CAAY,QAAQ,UAAA,EAAY;AAC/E,IAAA,CAAA,IAAK,YAAY,GAAA,EAAI;AAAA,EACvB;AAEA,EAAA,OAAO,sCAAA,CAAuC,OAAA,CAAQ,OAAA,EAAS,CAAC,CAAA,KAAM;AACpE,IAAA,MAAM,KAAM,CAAA,GAAI,IAAA,CAAK,M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AA;AAE7F,IAAA,OAAOA,OAAAA;AAAA,EACT;AAEA,EAAA,MAAM,SAAS,gBAAA,CAAiB,IAAA;AAAA,IAC9B,CAAC,GAAA,KAAQ,GAAA,CAAI,YAAY,aAAA,IAAiB,GAAA,CAAI,WAAW,OAAA,KAAY;AAAA,GACvE;AAEA,EAAA,OAAO,MAAA;AACT","file":"chunk-U35XGI24.js","sourcesContent":["import { ROUTE_CHANGE_INTERNAL_EVENT } from '../communication/constants.js';\nimport type { PartialLocation } from '../types/common.js';\nimport type { CommonExecutionPlugin, CommonPluginDefinition } from '../types/run.js';\nimport type { AsyncFunctionConstructor, BuiltAsyncFn } from '../types/workers.js';\n\nexport const getPartialLocation = (): PartialLocation => {\n return {\n host: window.location.host,\n hash: window.location.hash,\n href: window.location.href,\n origin: window.location.origin,\n pathname: window.location.pathname,\n search: window.location.search,\n port: window.location.port,\n protocol: window.location.protocol,\n };\n};\n\nexport const generateUUIDV4 = (): string => {\n let d = new Date().getTime();\n\n if (typeof performance !== 'undefined' && typeof performance.now === 'function') {\n d += performance.now();\n }\n\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {\n const r = ((d + Math.random() * 16) % 16) | 0;\n d = Math.floor(d / 16);\n return (c === 'x' ? r : (r & 0x3) | 0x8).toString(16);\n });\n};\n\nconst AsyncFunction = (\n Object.getPrototypeOf(async function () {\n /* empty */\n }) as { constructor: AsyncFunctionConstructor }\n).constructor;\n\nexport const getFnWithReturn = (script: string): BuiltAsyncFn => {\n const functionBody = `\n const __cleanup = this.__cleanup.bind(this);\n const __error = this.onError.bind(this);\n let __kizen_internal_result;\n {\n this.__setup();\n }\n try {\n __kizen_internal_result = await (async () => { ${script} })();\n } catch (ex) {\n __error(ex);\n } finally {\n __cleanup(__kizen_internal_result);\n }\n `;\n\n try {\n const fn = new AsyncFunction(functionBody);\n\n return { fn, functionBody };\n } catch {\n const errorFnBody = `\n this.__setup();\n this.onError({ message: \"The script has a syntax error and could not be parsed\" });\n this.__cleanup();\n `;\n\n const fn = new AsyncFunction(errorFnBody);\n\n return { fn, functionBody: errorFnBody };\n }\n};\n\nexport const getFn = (script: string): BuiltAsyncFn => {\n const functionBody = `\n const __cleanup = this.__cleanup.bind(this);\n const __error = this.onError.bind(this);\n {\n this.__setup();\n }\n try {\n ${script}\n } catch (ex) {\n __error(ex);\n } finally {\n __cleanup();\n }\n `;\n\n try {\n const fn = new AsyncFunction(functionBody);\n\n return { fn, functionBody };\n } catch {\n const errorFnBody = `\n this.__setup();\n this.onError({ message: \"The script has a syntax error and could not be parsed\" });\n this.__cleanup();\n `;\n\n const fn = new AsyncFunction(errorFnBody);\n\n return { fn, functionBody: errorFnBody };\n }\n};\n\nexport const generateExecutionKey = (\n pluginConfig?: CommonPluginDefinition | CommonExecutionPlugin,\n): string => {\n return `${pluginConfig?.plugin_api_name ?? ''}-${pluginConfig?.id ?? ''}-${pluginConfig?.api_name ?? ''}-${pluginConfig?.script_id ?? ''}`;\n};\n\nexport const emitRouteChange = (): void => {\n const event = new CustomEvent(ROUTE_CHANGE_INTERNAL_EVENT, {\n detail: {\n location: getPartialLocation(),\n },\n });\n\n window.dispatchEvent(event);\n};\n\nconst splitScriptApiName = (\n scriptApiName: string,\n): { pluginApiName: string | undefined; actionApiName: string | undefined } => {\n const [pluginApiName, actionApiName] = scriptApiName.split('.');\n\n return {\n pluginApiName,\n actionApiName,\n };\n};\n\nexport const findMatchingAction = (\n availableActions: {\n pluginApp?: {\n apiName: string;\n };\n apiName: string;\n }[],\n apiName?: string,\n): unknown => {\n if (!apiName) {\n return null;\n }\n\n const { pluginApiName, actionApiName } = splitScriptApiName(apiName);\n\n if (!pluginApiName) {\n const action = availableActions.find((act) => !act.pluginApp && act.apiName === actionApiName);\n\n return action;\n }\n\n const action = availableActions.find(\n (act) => act.apiName === actionApiName && act.pluginApp?.apiName === pluginApiName,\n );\n\n return action;\n};\n"]}
@@ -1,5 +1,5 @@
1
- import { generateUUIDV4, getPartialLocation } from './chunk-JOH235MV.js';
2
- import { IFRAME_PREFIX, ACTIONS, RESPONSES, COMMUNICATIONS, thirdPartyGlobalNames, getScriptIntegrationType, thirdPartySetupScripts, thirdPartyReadyPredicates } from './chunk-7J2F2Y36.js';
1
+ import { generateUUIDV4, getPartialLocation } from './chunk-U35XGI24.js';
2
+ import { IFRAME_PREFIX, ACTIONS, RESPONSES, COMMUNICATIONS, thirdPartyGlobalNames, getScriptIntegrationType, thirdPartySetupScripts, thirdPartyReadyPredicates } from './chunk-HIL4FWPO.js';
3
3
  import { __commonJS, __toESM } from './chunk-5WRI5ZAA.js';
4
4
  import DOMPurify from 'dompurify';
5
5
 
@@ -2408,8 +2408,8 @@ var runObjectExpression = async (expression, values) => {
2408
2408
  };
2409
2409
 
2410
2410
  // src/index.ts
2411
- var version = "0.1.0-5951933";
2411
+ var version = "0.1.0-d6c4e0e";
2412
2412
 
2413
2413
  export { getHash, getStableHash, isFlagEnabled, runExpression, runObjectExpression, runOptionExpression, runScript, runStringExpression, version };
2414
- //# sourceMappingURL=chunk-3BM3ADCB.js.map
2415
- //# sourceMappingURL=chunk-3BM3ADCB.js.map
2414
+ //# sourceMappingURL=chunk-WYOBLTZE.js.map
2415
+ //# sourceMappingURL=chunk-WYOBLTZE.js.map