@kizenapps/engine 1.6.0-1df8ac6 → 1.7.0-8f49177

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 (45) hide show
  1. package/dist/{automation-ez9zQ2sv.d.ts → automation-CT00roz_.d.ts} +3 -0
  2. package/dist/{chunk-55WEHADC.js → chunk-75QZJ7JX.js} +3 -3
  3. package/dist/{chunk-55WEHADC.js.map → chunk-75QZJ7JX.js.map} +1 -1
  4. package/dist/{chunk-TT5TGYMP.js → chunk-AFUZ4QSH.js} +29 -18
  5. package/dist/chunk-AFUZ4QSH.js.map +1 -0
  6. package/dist/{chunk-636EINDW.js → chunk-B3P7HFRV.js} +3 -3
  7. package/dist/{chunk-636EINDW.js.map → chunk-B3P7HFRV.js.map} +1 -1
  8. package/dist/{chunk-GFWJKPXQ.js → chunk-BU6CSXSC.js} +3 -3
  9. package/dist/{chunk-GFWJKPXQ.js.map → chunk-BU6CSXSC.js.map} +1 -1
  10. package/dist/{chunk-2FZ3RJUN.js → chunk-CV4PC3KZ.js} +32 -4
  11. package/dist/chunk-CV4PC3KZ.js.map +1 -0
  12. package/dist/{chunk-SHO7EUNR.js → chunk-F37NPWKF.js} +3 -3
  13. package/dist/{chunk-SHO7EUNR.js.map → chunk-F37NPWKF.js.map} +1 -1
  14. package/dist/{chunk-AYP77I6D.js → chunk-IT6UUTZ3.js} +3 -3
  15. package/dist/{chunk-AYP77I6D.js.map → chunk-IT6UUTZ3.js.map} +1 -1
  16. package/dist/{chunk-C43YHQ4U.js → chunk-JF2SWP4D.js} +12 -9
  17. package/dist/chunk-JF2SWP4D.js.map +1 -0
  18. package/dist/{chunk-W46DPM2L.js → chunk-QE5GKZEO.js} +4 -4
  19. package/dist/{chunk-W46DPM2L.js.map → chunk-QE5GKZEO.js.map} +1 -1
  20. package/dist/communication.js +2 -2
  21. package/dist/contexts/base.d.ts +3 -2
  22. package/dist/contexts/base.js +4 -4
  23. package/dist/contexts/floatingFrame.d.ts +1 -0
  24. package/dist/contexts/floatingFrame.js +5 -5
  25. package/dist/contexts/recordDetail.d.ts +1 -0
  26. package/dist/contexts/recordDetail.js +5 -5
  27. package/dist/frames-AOHUyPDP.d.ts +7 -0
  28. package/dist/{generic-CyEFBI-k.d.ts → generic-ByO9VEyd.d.ts} +1 -1
  29. package/dist/index.d.ts +4 -3
  30. package/dist/index.js +4 -4
  31. package/dist/react.d.ts +8 -7
  32. package/dist/react.js +22 -14
  33. package/dist/react.js.map +1 -1
  34. package/dist/types.d.ts +4 -3
  35. package/dist/util.d.ts +3 -2
  36. package/dist/util.js +6 -6
  37. package/dist/{values-BbMHmBFn.d.ts → values-CiQIqKu7.d.ts} +3 -2
  38. package/dist/workers/calendarSource.worker.js +6 -6
  39. package/dist/workers/floatingFrame.worker.js +7 -7
  40. package/dist/workers/generic.worker.js +6 -6
  41. package/dist/workers/recordDetail.worker.js +7 -7
  42. package/package.json +1 -1
  43. package/dist/chunk-2FZ3RJUN.js.map +0 -1
  44. package/dist/chunk-C43YHQ4U.js.map +0 -1
  45. package/dist/chunk-TT5TGYMP.js.map +0 -1
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
- export { modalSize, runExpression, runObjectExpression, runOptionExpression, runScript, runStringExpression, version } from './chunk-TT5TGYMP.js';
2
- import './chunk-55WEHADC.js';
3
- import './chunk-2FZ3RJUN.js';
4
- import './chunk-636EINDW.js';
1
+ export { modalSize, runExpression, runObjectExpression, runOptionExpression, runScript, runStringExpression, version } from './chunk-AFUZ4QSH.js';
2
+ import './chunk-75QZJ7JX.js';
3
+ import './chunk-CV4PC3KZ.js';
4
+ import './chunk-B3P7HFRV.js';
5
5
  import './chunk-5WRI5ZAA.js';
6
6
  //# sourceMappingURL=index.js.map
7
7
  //# sourceMappingURL=index.js.map
package/dist/react.d.ts CHANGED
@@ -1,8 +1,9 @@
1
- import { f as CalendarDefinition, c as CalendarSourceConfig, h as CalendarSourceMap, i as CalendarSources, J as OnShowToastFn, q as ExecuteCalendarSourceScript, F as FloatingFrameConfig, r as ExecuteFloatingFrameScript, R as RoutablePageConfig, aa as WindowPosition, s as FloatingFrameEmployeeConfig, y as OnNetworkRequestFn, n as CreateFileIdFn, Q as PerformKizenFileUploadFn, G as GetPendingCacheCountFn, v as InvalidateCacheFn, b as RouteScriptConfig } from './automation-ez9zQ2sv.js';
1
+ import { f as CalendarDefinition, c as CalendarSourceConfig, h as CalendarSourceMap, i as CalendarSources, J as OnShowToastFn, q as ExecuteCalendarSourceScript, F as FloatingFrameConfig, r as ExecuteFloatingFrameScript, R as RoutablePageConfig, aa as WindowPosition, s as FloatingFrameEmployeeConfig, y as OnNetworkRequestFn, n as CreateFileIdFn, Q as PerformKizenFileUploadFn, G as GetPendingCacheCountFn, v as InvalidateCacheFn, b as RouteScriptConfig } from './automation-CT00roz_.js';
2
2
  import { s as AppPlugins, W as WorkerContextArgs, U as UnknownJSON, b as PartialUser, c as PartialTeamMember, d as PartialBusiness, e as PartialClientObject, ar as ModalCancelEventSource, M as ModalConfig, ax as OnCloseModalFn, aU as SetupAssistantConfig, t as AssistantConfigAction, u as AssistantField } from './ThirdPartyScript-CvOXQBiO.js';
3
- import { G as GenericPluginConfig, E as ExecuteGenericScript } from './generic-CyEFBI-k.js';
3
+ import { G as GenericPluginConfig, E as ExecuteGenericScript } from './generic-ByO9VEyd.js';
4
4
  import { RefObject, JSX, ForwardedRef, ReactNode, FC, SetStateAction } from 'react';
5
- import { R as RemovedHTML } from './values-BbMHmBFn.js';
5
+ import { B as BuildIframeURLWithProxyOptions } from './frames-AOHUyPDP.js';
6
+ import { R as RemovedHTML } from './values-CiQIqKu7.js';
6
7
  import './floatingFrames-BzaoL7cq.js';
7
8
  import 'dompurify';
8
9
 
@@ -75,7 +76,7 @@ interface PluginCustomHTML {
75
76
  outputUIRef: RefObject<HTMLDivElement>;
76
77
  interactableScriptRef: RefObject<HTMLDivElement>;
77
78
  }
78
- declare const useAppCustomHTML: (currentPage?: FloatingFrameConfig | RoutablePageConfig, args?: UnknownJSON) => PluginCustomHTML;
79
+ declare const useAppCustomHTML: (currentPage?: FloatingFrameConfig | RoutablePageConfig, args?: UnknownJSON, frameOptions?: BuildIframeURLWithProxyOptions) => PluginCustomHTML;
79
80
 
80
81
  type ResetFn = (pluginApiName: string, sourceApiName: string) => void;
81
82
  declare const useCalendarSourceReset: () => ResetFn;
@@ -98,7 +99,7 @@ interface UsePluginEngineReturn {
98
99
  pending: boolean;
99
100
  collectFormData: () => CollectedFormDataResponse;
100
101
  }
101
- declare const useAppPage: (currentPage?: RoutablePageConfig, search?: string, isLoading?: boolean) => UsePluginEngineReturn;
102
+ declare const useAppPage: (currentPage?: RoutablePageConfig, search?: string, isLoading?: boolean, frameOptions?: BuildIframeURLWithProxyOptions) => UsePluginEngineReturn;
102
103
 
103
104
  interface UseFloatingFrameArgs {
104
105
  currentWindow: FloatingFrameConfig;
@@ -177,9 +178,9 @@ interface UseFloatingFrameResult {
177
178
  frameOffset: number;
178
179
  scriptUIRef: RefObject<HTMLDivElement> | undefined;
179
180
  }
180
- declare const useFloatingFrame: (params: UseFloatingFrameArgs) => UseFloatingFrameResult;
181
+ declare const useFloatingFrame: (params: UseFloatingFrameArgs, options?: BuildIframeURLWithProxyOptions) => UseFloatingFrameResult;
181
182
 
182
- declare const usePluginSafeHTML: (html?: string) => {
183
+ declare const usePluginSafeHTML: (html?: string, pluginApiName?: string, options?: BuildIframeURLWithProxyOptions) => {
183
184
  html: string;
184
185
  error: Error | null;
185
186
  removed: RemovedHTML[];
package/dist/react.js CHANGED
@@ -1,9 +1,9 @@
1
- import { runScript, getPluginSafeHTML, runExpression, getStableHash, isFlagEnabled } from './chunk-TT5TGYMP.js';
1
+ import { runScript, getPluginSafeHTML, runExpression, getStableHash, isFlagEnabled } from './chunk-AFUZ4QSH.js';
2
2
  import './chunk-LGJYUPYZ.js';
3
- import { generateExecutionKey } from './chunk-55WEHADC.js';
4
- import { getAllNestedInputsFromConfig, getActionFieldKey, getFieldFromAction, getActionMenuFieldKey } from './chunk-2FZ3RJUN.js';
5
- import { runFrameScriptEventName } from './chunk-AYP77I6D.js';
6
- import { QUERY_KEYS, ROUTE_CHANGE_INTERNAL_EVENT, IFRAME_PREFIX, ROUTE_CHANGE_IFRAME_EVENT } from './chunk-636EINDW.js';
3
+ import { generateExecutionKey } from './chunk-75QZJ7JX.js';
4
+ import { buildIframeURLWithProxy, getAllNestedInputsFromConfig, getActionFieldKey, getFieldFromAction, getActionMenuFieldKey } from './chunk-CV4PC3KZ.js';
5
+ import { runFrameScriptEventName } from './chunk-IT6UUTZ3.js';
6
+ import { QUERY_KEYS, ROUTE_CHANGE_INTERNAL_EVENT, IFRAME_PREFIX, ROUTE_CHANGE_IFRAME_EVENT } from './chunk-B3P7HFRV.js';
7
7
  import './chunk-5WRI5ZAA.js';
8
8
  import { QueryClient, useQueries, useQueryClient, QueryClientContext, QueryClientProvider } from '@tanstack/react-query';
9
9
  import { createContext, useContext, useState, useCallback, useMemo, useRef, useEffect, useImperativeHandle } from 'react';
@@ -1312,18 +1312,21 @@ var useManualInteraction = (execute, currentPage, elementRef, pending, args = {}
1312
1312
  };
1313
1313
  }, [handleClick, handleSubmit, currentPage, elementRef]);
1314
1314
  };
1315
- var usePluginSafeHTML = (html) => {
1316
- return useMemo(() => getPluginSafeHTML(html), [html]);
1315
+ var usePluginSafeHTML = (html, pluginApiName, options) => {
1316
+ return useMemo(
1317
+ () => getPluginSafeHTML(html, pluginApiName, options),
1318
+ [html, pluginApiName, options]
1319
+ );
1317
1320
  };
1318
1321
 
1319
1322
  // src/react/hooks/useAppCustomHTML.ts
1320
- var useAppCustomHTML = (currentPage, args) => {
1323
+ var useAppCustomHTML = (currentPage, args, frameOptions) => {
1321
1324
  const { showToast } = useToast();
1322
1325
  const { t } = useTranslation();
1323
1326
  const outputUIRef = useRef(null);
1324
1327
  const interactableScriptRef = useRef(null);
1325
1328
  const css = currentPage?.css;
1326
- const { html } = usePluginSafeHTML(currentPage?.html);
1329
+ const { html } = usePluginSafeHTML(currentPage?.html, currentPage?.plugin_api_name, frameOptions);
1327
1330
  const [executeInline, { pending: inlinePending }] = useGenericAppCustomScript({
1328
1331
  onError: (e) => {
1329
1332
  showToast({
@@ -1372,8 +1375,11 @@ var useAppCallback = (search) => {
1372
1375
  window.parent.postMessage({ type: "kizen:plugin_callback", query }, "*");
1373
1376
  }, [search]);
1374
1377
  };
1375
- var useAppPage = (currentPage, search, isLoading) => {
1376
- const iframeURL = currentPage?.iframe_url;
1378
+ var useAppPage = (currentPage, search, isLoading, frameOptions) => {
1379
+ const iframeURL = useMemo(
1380
+ () => currentPage?.iframe_url ? buildIframeURLWithProxy(currentPage.iframe_url, frameOptions) : currentPage?.iframe_url,
1381
+ [currentPage?.iframe_url, frameOptions]
1382
+ );
1377
1383
  const script = currentPage?.script;
1378
1384
  const callback = currentPage?.callback;
1379
1385
  const pluginArgs = currentPage?.args;
@@ -1400,7 +1406,8 @@ var useAppPage = (currentPage, search, isLoading) => {
1400
1406
  }, [search, pluginArgs]);
1401
1407
  const { outputUIRef, scopedCss, sanitizedHtml, interactableScriptRef } = useAppCustomHTML(
1402
1408
  currentPage,
1403
- args
1409
+ args,
1410
+ frameOptions
1404
1411
  );
1405
1412
  useManualInteraction(execute, currentPage, scriptUIRef, pending);
1406
1413
  const hasRunScript = useRef(false);
@@ -1543,7 +1550,7 @@ var getQuadrant = (topDelta, leftDelta, bottomDelta, rightDelta) => {
1543
1550
  }
1544
1551
  }
1545
1552
  };
1546
- var useFloatingFrame = (params) => {
1553
+ var useFloatingFrame = (params, options) => {
1547
1554
  const {
1548
1555
  currentWindow,
1549
1556
  pathname,
@@ -1936,7 +1943,8 @@ var useFloatingFrame = (params) => {
1936
1943
  }, [execute, args, messageHandlerScript]);
1937
1944
  const { outputUIRef, scopedCss, sanitizedHtml, interactableScriptRef } = useAppCustomHTML(
1938
1945
  currentWindow,
1939
- {}
1946
+ {},
1947
+ options
1940
1948
  );
1941
1949
  const hidden = !delayedModalHide ? hiddenByScript || isHiddenByPattern : hiddenByScript || isHiddenByPattern || hiddenByModal;
1942
1950
  const parentClassName = `floating-window-parent--${id}`;