@kizenapps/engine 1.4.0-01344a3 → 1.5.0-b163380

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 (52) hide show
  1. package/LICENSE.md +1 -1
  2. package/dist/{ThirdPartyScript-CoMDaLsq.d.ts → ThirdPartyScript-CU4bWTIP.d.ts} +28 -3
  3. package/dist/{automation-CWET9vfs.d.ts → automation-WhjC7Twa.d.ts} +14 -3
  4. package/dist/{chunk-ZMIF22NR.js → chunk-4AEFC6CZ.js} +54 -6
  5. package/dist/chunk-4AEFC6CZ.js.map +1 -0
  6. package/dist/{chunk-AY5OQ5KM.js → chunk-4UEAFMIO.js} +27 -4
  7. package/dist/chunk-4UEAFMIO.js.map +1 -0
  8. package/dist/{chunk-YBCIIIAP.js → chunk-4X6FGEFW.js} +4 -4
  9. package/dist/{chunk-YBCIIIAP.js.map → chunk-4X6FGEFW.js.map} +1 -1
  10. package/dist/{chunk-PPRZFBZZ.js → chunk-DKJMM5F5.js} +3 -3
  11. package/dist/{chunk-PPRZFBZZ.js.map → chunk-DKJMM5F5.js.map} +1 -1
  12. package/dist/{chunk-MRN746YD.js → chunk-OZLB7RIG.js} +17 -5
  13. package/dist/chunk-OZLB7RIG.js.map +1 -0
  14. package/dist/{chunk-V6JXKTHL.js → chunk-QMZCMENA.js} +3 -3
  15. package/dist/{chunk-V6JXKTHL.js.map → chunk-QMZCMENA.js.map} +1 -1
  16. package/dist/{chunk-IGHBWLIS.js → chunk-V6MAREX7.js} +6 -4
  17. package/dist/chunk-V6MAREX7.js.map +1 -0
  18. package/dist/{chunk-GVATLHW3.js → chunk-YZMFXGYU.js} +3 -3
  19. package/dist/{chunk-GVATLHW3.js.map → chunk-YZMFXGYU.js.map} +1 -1
  20. package/dist/{chunk-5ZVIHUN4.js → chunk-ZPFIPRXQ.js} +3 -3
  21. package/dist/{chunk-5ZVIHUN4.js.map → chunk-ZPFIPRXQ.js.map} +1 -1
  22. package/dist/communication.d.ts +2 -2
  23. package/dist/communication.js +2 -2
  24. package/dist/contexts/base.d.ts +9 -2
  25. package/dist/contexts/base.js +4 -4
  26. package/dist/contexts/floatingFrame.d.ts +1 -1
  27. package/dist/contexts/floatingFrame.js +5 -5
  28. package/dist/contexts/recordDetail.d.ts +1 -1
  29. package/dist/contexts/recordDetail.js +5 -5
  30. package/dist/{generic-CQyBACwP.d.ts → generic-DNjpHkcc.d.ts} +1 -1
  31. package/dist/index.d.ts +6 -6
  32. package/dist/index.js +4 -4
  33. package/dist/react.d.ts +19 -6
  34. package/dist/react.js +118 -74
  35. package/dist/react.js.map +1 -1
  36. package/dist/types.d.ts +5 -5
  37. package/dist/util.d.ts +3 -3
  38. package/dist/util.js +5 -5
  39. package/dist/{values-BwAd85Ee.d.ts → values-DRLCW9ke.d.ts} +2 -2
  40. package/dist/workers/calendarSource.worker.js +11 -6
  41. package/dist/workers/calendarSource.worker.js.map +1 -1
  42. package/dist/workers/floatingFrame.worker.js +9 -7
  43. package/dist/workers/floatingFrame.worker.js.map +1 -1
  44. package/dist/workers/generic.worker.js +8 -6
  45. package/dist/workers/generic.worker.js.map +1 -1
  46. package/dist/workers/recordDetail.worker.js +9 -7
  47. package/dist/workers/recordDetail.worker.js.map +1 -1
  48. package/package.json +1 -1
  49. package/dist/chunk-AY5OQ5KM.js.map +0 -1
  50. package/dist/chunk-IGHBWLIS.js.map +0 -1
  51. package/dist/chunk-MRN746YD.js.map +0 -1
  52. package/dist/chunk-ZMIF22NR.js.map +0 -1
package/LICENSE.md CHANGED
@@ -671,4 +671,4 @@ into proprietary programs. If your program is a subroutine library, you
671
671
  may consider it more useful to permit linking proprietary applications with
672
672
  the library. If this is what you want to do, use the GNU Lesser General
673
673
  Public License instead of this License. But first, please read
674
- <https://www.gnu.org/licenses/why-not-lgpl.html>.
674
+ <https://www.gnu.org/licenses/why-not-lgpl.html>.
@@ -153,11 +153,20 @@ interface ModalContainer {
153
153
  type ModalBlock = ModalDescription | ModalTextInput | ModalSpacer | ModalDropdown | ModalContainer;
154
154
  interface ModalConfig {
155
155
  title?: string;
156
+ viewId?: string;
157
+ args?: UnknownJSON;
156
158
  confirmButton?: ButtonConfig;
157
159
  cancelButton?: ButtonConfig;
158
160
  content?: ModalBlock[];
159
161
  dynamic?: boolean;
160
162
  pluginApiName?: string;
163
+ frameless?: boolean;
164
+ }
165
+ interface ShowViewInModalOptions {
166
+ title?: string;
167
+ confirmButton?: ButtonConfig;
168
+ cancelButton?: ButtonConfig;
169
+ frameless?: boolean;
161
170
  }
162
171
  interface DynamicPromptConfig {
163
172
  title?: string;
@@ -167,6 +176,17 @@ interface DynamicPromptConfig {
167
176
  registerUtils?: Record<string, (...args: unknown[]) => unknown>;
168
177
  }
169
178
  type PromptState = Record<string, unknown>;
179
+ type ShowViewInModalFn = (id: string, config?: {
180
+ args?: UnknownJSON;
181
+ options?: ShowViewInModalOptions;
182
+ }) => Promise<{
183
+ canceled: boolean;
184
+ result?: unknown;
185
+ error?: unknown;
186
+ }>;
187
+ type CurriedShowViewInModalFn = (instance: Instance, promises: WorkerPromise) => ShowViewInModalFn;
188
+ type CloseModalFn = (values?: UnknownJSON, canceled?: boolean) => void;
189
+ type CurriedCloseModalFn = (instance: Instance) => CloseModalFn;
170
190
  type DynamicPromptFn = (config: DynamicPromptConfig) => Promise<{
171
191
  values: Record<string, ValueStore>;
172
192
  }>;
@@ -271,7 +291,8 @@ interface TextValueStore {
271
291
  type ValueStore = BooleanValueStore | CustomObjectValueStore | FieldValueStore | NumberValueStore | SelectValueStore | TextValueStore;
272
292
  type CleanValueStoreType = BooleanCleanValue | CustomObjectCleanValue | FieldCleanValue | NumberCleanValue | SelectCleanValue | TextCleanValue;
273
293
  type CleanValueStore = Record<string, CleanValueStoreType>;
274
- type OnShowModalFn = (config: ModalConfig, cb: () => void) => void;
294
+ type OnShowModalFn = (config: ModalConfig, cb: (result?: UnknownJSON) => void) => void;
295
+ type OnCloseModalFn = (values?: UnknownJSON, canceled?: boolean) => void;
275
296
  type OnShowCreateRecordModalFn = (objectId: string, cb: (result: UnknownJSON) => void) => void;
276
297
  type OnShowCreateRelatedRecordModalFn = (objectId: string, relatedEntityId: string, cb: (result: UnknownJSON) => void) => void;
277
298
  type ModalQueue = {
@@ -287,7 +308,7 @@ type CreateRelatedRecordModalQueue = {
287
308
  relatedEntityId: string;
288
309
  cb: (result: UnknownJSON) => void;
289
310
  }[];
290
- type ModalCancelEventSource = 'button' | 'close';
311
+ type ModalCancelEventSource = 'button' | 'close' | 'script';
291
312
  interface ConfigService {
292
313
  api_name: string;
293
314
  prerequisite: boolean;
@@ -368,6 +389,8 @@ declare const ACTIONS: {
368
389
  RELEASE_BLOCKING_SCRIPT: string;
369
390
  AUTHORIZE: string;
370
391
  COPY_TO_CLIPBOARD: string;
392
+ SHOW_VIEW_IN_MODAL_REQUEST: string;
393
+ CLOSE_MODAL_REQUEST: string;
371
394
  };
372
395
  declare enum INDICATOR_TYPE {
373
396
  NONE = "none",
@@ -455,6 +478,8 @@ interface WorkerContextArgs {
455
478
  openCreateRelatedRecord: OpenCreateRelatedRecordFn;
456
479
  pluginApiName: string;
457
480
  location: PartialLocation;
481
+ showViewInModal: ShowViewInModalFn;
482
+ closeModal: CloseModalFn;
458
483
  }
459
484
  type KizenConfig = Record<string, unknown>;
460
485
  interface KnownArgs {
@@ -486,4 +511,4 @@ declare class ThirdPartyScript {
486
511
  call(...params: unknown[]): void;
487
512
  }
488
513
 
489
- export { type DeleteReturnValue as $, type Args as A, type BaseAPI as B, type CurrentUser as C, type DataCache as D, type CreateRecordModalQueue as E, type CreateRelatedRecordModalQueue as F, type GetOptions as G, type CurriedDynamicPromptFn as H, type Instance as I, type CurriedInstallThirdPartyScriptFn as J, type CurriedKizenRequestFn as K, type CurriedOpenCreateRecordFn as L, type ModalConfig as M, type CurriedOpenCreateRelatedRecordFn as N, type CurriedPostFormDataFn as O, type PartialEntity as P, type CurriedPromptFn as Q, type RequestWithErrorsResponse as R, type StateChangePayload as S, ThirdPartyScript as T, type UnknownJSON as U, type CurriedRefreshEntityFn as V, type WorkerContextArgs as W, type CurriedUploadFileFn as X, type CustomObjectCleanValue as Y, type CustomObjectValueStore as Z, type DataCacheEntry as _, type PartialCustomObject as a, type DynamicPromptFn as a0, type EmployeeConfig as a1, type ErrorHandler as a2, type ErrorResponse as a3, type FieldCleanValue as a4, type FieldValueStore as a5, type GetReturnValue as a6, type InstallThirdPartyScriptFn as a7, type JSONArray as a8, type JSONObject as a9, type Profile as aA, type PromiseMap as aB, type PromiseReject as aC, type PromiseResolve as aD, type PromiseState as aE, type PromptFn as aF, type PutReturnValue as aG, type RefreshEntityFn as aH, type ReleaseBlockingScriptHandler as aI, type SelectCleanValue as aJ, type SelectValueStore as aK, type SetInternalSessionDataFn as aL, type SetupAssistantConfig as aM, type TextValueStore as aN, type UnknownFunction as aO, type UploadFileData as aP, type UploadFileFn as aQ, type UserConfig as aR, type ValueStore as aS, KizenRequestError as aT, ACTIONS as aU, ALLOWED_INTEGRATIONS as aV, IFRAME_PREFIX as aW, INDICATOR_TYPE as aX, type JSONPrimitive as aa, type JSONValue as ab, type KizenConfig as ac, type KizenNetworkResponse as ad, type KizenProxySuccessResponse as ae, type KizenRequestFn as af, type KizenRequestFnHandler as ag, type KnownArgs as ah, type MatchSetupAssistantField as ai, type MaybeMessageError as aj, type ModalBlock as ak, type ModalCancelEventSource as al, type ModalContainer as am, type ModalQueue as an, type NumberCleanValue as ao, type NumberValueStore as ap, type OnNetworkErrorFn as aq, type OnShowCreateRecordModalFn as ar, type OnShowCreateRelatedRecordModalFn as as, type OnShowModalFn as at, type OpenCreateRecordFn as au, type OpenCreateRelatedRecordFn as av, type PartialRelatedObject as aw, type PatchReturnValue as ax, type PostFormDataPayload as ay, type PostReturnValue as az, type PartialUser as b, type PartialTeamMember as c, type PartialBusiness as d, type PartialClientObject as e, type PostFormDataFn as f, type PromptState as g, type InternalSessionData as h, type PartialLocation as i, type RequestOptions as j, type ShowToastOptions as k, type DynamicPromptConfig as l, type IncludeOption as m, type SetupAssistantField as n, type AppPlugin as o, type SelectOption as p, type AppPlugins as q, type AssistantConfigAction as r, type AssistantField as s, type AssistantLink as t, type BooleanCleanValue as u, type BooleanValueStore as v, type ButtonConfig as w, type CleanValueStore as x, type CleanValueStoreType as y, type ConfigService as z };
514
+ export { type CurriedUploadFileFn as $, type Args as A, type BaseAPI as B, type CurrentUser as C, type DataCache as D, type CloseModalFn as E, type ConfigService as F, type GetOptions as G, type CreateRecordModalQueue as H, type Instance as I, type CreateRelatedRecordModalQueue as J, type CurriedCloseModalFn as K, type CurriedDynamicPromptFn as L, type ModalConfig as M, type CurriedInstallThirdPartyScriptFn as N, type CurriedKizenRequestFn as O, type PartialEntity as P, type CurriedOpenCreateRecordFn as Q, type RequestWithErrorsResponse as R, type StateChangePayload as S, ThirdPartyScript as T, type UnknownJSON as U, type CurriedOpenCreateRelatedRecordFn as V, type WorkerContextArgs as W, type CurriedPostFormDataFn as X, type CurriedPromptFn as Y, type CurriedRefreshEntityFn as Z, type CurriedShowViewInModalFn as _, type PartialCustomObject as a, ALLOWED_INTEGRATIONS as a$, type CustomObjectCleanValue as a0, type CustomObjectValueStore as a1, type DataCacheEntry as a2, type DeleteReturnValue as a3, type DynamicPromptFn as a4, type EmployeeConfig as a5, type ErrorHandler as a6, type ErrorResponse as a7, type FieldCleanValue as a8, type FieldValueStore as a9, type OpenCreateRelatedRecordFn as aA, type PartialRelatedObject as aB, type PatchReturnValue as aC, type PostFormDataPayload as aD, type PostReturnValue as aE, type Profile as aF, type PromiseMap as aG, type PromiseReject as aH, type PromiseResolve as aI, type PromiseState as aJ, type PromptFn as aK, type PutReturnValue as aL, type RefreshEntityFn as aM, type ReleaseBlockingScriptHandler as aN, type SelectCleanValue as aO, type SelectValueStore as aP, type SetInternalSessionDataFn as aQ, type SetupAssistantConfig as aR, type ShowViewInModalFn as aS, type TextValueStore as aT, type UnknownFunction as aU, type UploadFileData as aV, type UploadFileFn as aW, type UserConfig as aX, type ValueStore as aY, KizenRequestError as aZ, ACTIONS as a_, type GetReturnValue as aa, type InstallThirdPartyScriptFn as ab, type JSONArray as ac, type JSONObject as ad, type JSONPrimitive as ae, type JSONValue as af, type KizenConfig as ag, type KizenNetworkResponse as ah, type KizenProxySuccessResponse as ai, type KizenRequestFn as aj, type KizenRequestFnHandler as ak, type KnownArgs as al, type MatchSetupAssistantField as am, type MaybeMessageError as an, type ModalBlock as ao, type ModalCancelEventSource as ap, type ModalContainer as aq, type ModalQueue as ar, type NumberCleanValue as as, type NumberValueStore as at, type OnCloseModalFn as au, type OnNetworkErrorFn as av, type OnShowCreateRecordModalFn as aw, type OnShowCreateRelatedRecordModalFn as ax, type OnShowModalFn as ay, type OpenCreateRecordFn as az, type PartialUser as b, IFRAME_PREFIX as b0, INDICATOR_TYPE as b1, type PartialTeamMember as c, type PartialBusiness as d, type PartialClientObject as e, type PostFormDataFn as f, type PromptState as g, type InternalSessionData as h, type PartialLocation as i, type RequestOptions as j, type ShowToastOptions as k, type ShowViewInModalOptions as l, type DynamicPromptConfig as m, type IncludeOption as n, type SetupAssistantField as o, type AppPlugin as p, type SelectOption as q, type AppPlugins as r, type AssistantConfigAction as s, type AssistantField as t, type AssistantLink as u, type BooleanCleanValue as v, type BooleanValueStore as w, type ButtonConfig as x, type CleanValueStore as y, type CleanValueStoreType as z };
@@ -1,4 +1,4 @@
1
- import { aU as ACTIONS, aV as ALLOWED_INTEGRATIONS, M as ModalConfig, U as UnknownJSON, S as StateChangePayload, k as ShowToastOptions, h as InternalSessionData, aL as SetInternalSessionDataFn, at as OnShowModalFn, ar as OnShowCreateRecordModalFn, as as OnShowCreateRelatedRecordModalFn, aq as OnNetworkErrorFn, W as WorkerContextArgs, a1 as EmployeeConfig } from './ThirdPartyScript-CoMDaLsq.js';
1
+ import { a_ as ACTIONS, U as UnknownJSON, a$ as ALLOWED_INTEGRATIONS, M as ModalConfig, S as StateChangePayload, k as ShowToastOptions, h as InternalSessionData, l as ShowViewInModalOptions, aQ as SetInternalSessionDataFn, ay as OnShowModalFn, aw as OnShowCreateRecordModalFn, ax as OnShowCreateRelatedRecordModalFn, au as OnCloseModalFn, av as OnNetworkErrorFn, W as WorkerContextArgs, a5 as EmployeeConfig } from './ThirdPartyScript-CU4bWTIP.js';
2
2
  import { H as HideConfig, S as ShowConfig } from './floatingFrames-BzaoL7cq.js';
3
3
 
4
4
  interface CommonPluginDefinition {
@@ -37,6 +37,7 @@ interface RunScriptOptions {
37
37
  onShowModal: OnShowModalFn;
38
38
  onShowCreateRecordModal: OnShowCreateRecordModalFn;
39
39
  onShowCreateRelatedRecordModal: OnShowCreateRelatedRecordModalFn;
40
+ onCloseModal?: OnCloseModalFn;
40
41
  onNetworkError?: OnNetworkErrorFn;
41
42
  scriptBody: WorkerContextArgs['scriptBody'];
42
43
  user: WorkerContextArgs['user'];
@@ -172,7 +173,17 @@ interface AuthorizeEvent extends BaseEvent {
172
173
  errorRedirectPath?: string;
173
174
  };
174
175
  }
175
- type MessageEventData = QueryRequestEvent | UIOutputEvent | IframeOutputEvent | PostFormDataRequestEvent | UploadFileRequestEvent | SetStateEvent | DoneEvent | ErrorEvent | OpenWindowEvent | CommunicateEvent | HideEvent | ShowEvent | CopyToClipboardEvent | OpenCreateRecordModalRequestEvent | OpenCreateRelatedRecordModalRequestEvent | ShowToastEvent | RefreshTimelineEvent | RefreshEntityEvent | UpdateSessionDataEvent | InstallThirdPartyScriptRequestEvent | PromptRequestEvent | DynamicPromptRequestEvent | AuthorizeEvent;
176
+ interface ShowViewInModalRequestEvent extends BaseEvent {
177
+ id: string;
178
+ viewId: string;
179
+ args?: UnknownJSON;
180
+ options?: ShowViewInModalOptions;
181
+ }
182
+ interface CloseModalRequestEvent extends BaseEvent {
183
+ values?: UnknownJSON;
184
+ canceled?: boolean;
185
+ }
186
+ type MessageEventData = QueryRequestEvent | UIOutputEvent | IframeOutputEvent | PostFormDataRequestEvent | UploadFileRequestEvent | SetStateEvent | DoneEvent | ErrorEvent | OpenWindowEvent | CommunicateEvent | HideEvent | ShowEvent | CopyToClipboardEvent | OpenCreateRecordModalRequestEvent | OpenCreateRelatedRecordModalRequestEvent | ShowToastEvent | RefreshTimelineEvent | RefreshEntityEvent | UpdateSessionDataEvent | InstallThirdPartyScriptRequestEvent | PromptRequestEvent | DynamicPromptRequestEvent | ShowViewInModalRequestEvent | CloseModalRequestEvent | AuthorizeEvent;
176
187
  type InvalidateCacheFn = (category: 'timeline' | 'entity', entityId: string) => void;
177
188
  type GetPendingCacheCountFn = (search: string) => number;
178
189
  interface KizenFile extends File {
@@ -333,4 +344,4 @@ interface AutomationStepConfig<T = unknown> {
333
344
  plugin_api_name?: string;
334
345
  }
335
346
 
336
- export type { Terminators as $, AutomationStepConfig as A, BaseEvent as B, CommonExecutionPlugin as C, DataAdornmentConfig as D, ErrorEvent as E, FloatingFrameConfig as F, GetPendingCacheCountFn as G, HideEvent as H, IframeOutputEvent as I, PostFormDataRequestEvent as J, KizenFile as K, PromptRequestEvent as L, MessageEventData as M, RecipientConfig as N, OnClearToastsFn as O, PerformKizenFileUploadFn as P, QueryRequestEvent as Q, RoutablePageConfig as R, RefreshEntityEvent as S, ToolbarItemConfig as T, RefreshTimelineEvent as U, RequestableQueryMethods as V, SchemaValidation as W, SetStateEvent as X, ShowEvent as Y, ShowToastEvent as Z, TerminatorContent as _, CommonPluginDefinition as a, UIOutputEvent as a0, UpdateSessionDataEvent as a1, UploadFilePayload as a2, UploadFileRequestEvent as a3, WindowPosition as a4, RouteScriptConfig as b, CalendarSourceConfig as c, RunScriptOptions as d, AuthorizeEvent as e, CalendarDefinition as f, CalendarScriptReturnData as g, CalendarSourceMap as h, CalendarSources as i, CommunicateEvent as j, CopyToClipboardEvent as k, CreateFileIdFn as l, DoneEvent as m, DynamicPromptRequestEvent as n, ExecuteCalendarSourceScript as o, ExecuteFloatingFrameScript as p, FloatingFrameEmployeeConfig as q, FrameQuadrant as r, InstallThirdPartyScriptRequestEvent as s, InvalidateCacheFn as t, MinimizedConfig as u, OnNetworkRequestFn as v, OnShowToastFn as w, OpenCreateRecordModalRequestEvent as x, OpenCreateRelatedRecordModalRequestEvent as y, OpenWindowEvent as z };
347
+ export type { ShowViewInModalRequestEvent as $, AutomationStepConfig as A, BaseEvent as B, CommonExecutionPlugin as C, DataAdornmentConfig as D, ErrorEvent as E, FloatingFrameConfig as F, GetPendingCacheCountFn as G, HideEvent as H, IframeOutputEvent as I, OpenWindowEvent as J, KizenFile as K, PostFormDataRequestEvent as L, MessageEventData as M, PromptRequestEvent as N, OnClearToastsFn as O, PerformKizenFileUploadFn as P, QueryRequestEvent as Q, RoutablePageConfig as R, RecipientConfig as S, ToolbarItemConfig as T, RefreshEntityEvent as U, RefreshTimelineEvent as V, RequestableQueryMethods as W, SchemaValidation as X, SetStateEvent as Y, ShowEvent as Z, ShowToastEvent as _, CommonPluginDefinition as a, TerminatorContent as a0, Terminators as a1, UIOutputEvent as a2, UpdateSessionDataEvent as a3, UploadFilePayload as a4, UploadFileRequestEvent as a5, WindowPosition as a6, RouteScriptConfig as b, CalendarSourceConfig as c, RunScriptOptions as d, AuthorizeEvent as e, CalendarDefinition as f, CalendarScriptReturnData as g, CalendarSourceMap as h, CalendarSources as i, CloseModalRequestEvent as j, CommunicateEvent as k, CopyToClipboardEvent as l, CreateFileIdFn as m, DoneEvent as n, DynamicPromptRequestEvent as o, ExecuteCalendarSourceScript as p, ExecuteFloatingFrameScript as q, FloatingFrameEmployeeConfig as r, FrameQuadrant as s, InstallThirdPartyScriptRequestEvent as t, InvalidateCacheFn as u, MinimizedConfig as v, OnNetworkRequestFn as w, OnShowToastFn as x, OpenCreateRecordModalRequestEvent as y, OpenCreateRelatedRecordModalRequestEvent as z };
@@ -1,6 +1,6 @@
1
- import { getPartialLocation, generateUUIDV4 } from './chunk-PPRZFBZZ.js';
2
- import { getAllNestedInputsFromConfig, KizenRequestError } from './chunk-AY5OQ5KM.js';
3
- import { IFRAME_PREFIX, ACTIONS, RESPONSES, COMMUNICATIONS, thirdPartyGlobalNames, getScriptIntegrationType, thirdPartySetupScripts, thirdPartyReadyPredicates } from './chunk-IGHBWLIS.js';
1
+ import { getPartialLocation, generateUUIDV4 } from './chunk-DKJMM5F5.js';
2
+ import { getAllNestedInputsFromConfig, KizenRequestError } from './chunk-4UEAFMIO.js';
3
+ import { IFRAME_PREFIX, ACTIONS, RESPONSES, COMMUNICATIONS, thirdPartyGlobalNames, getScriptIntegrationType, thirdPartySetupScripts, thirdPartyReadyPredicates } from './chunk-V6MAREX7.js';
4
4
  import { __commonJS, __toESM } from './chunk-5WRI5ZAA.js';
5
5
  import DOMPurify from 'dompurify';
6
6
 
@@ -1813,6 +1813,7 @@ var WorkerManager = class {
1813
1813
  setSessionData;
1814
1814
  pluginComponentId;
1815
1815
  onShowModal;
1816
+ onCloseModal;
1816
1817
  onShowCreateRecordModal;
1817
1818
  onShowCreateRelatedRecordModal;
1818
1819
  onReleaseBlockingScript;
@@ -1841,6 +1842,7 @@ var WorkerManager = class {
1841
1842
  this.onClearToasts = args.onClearToasts;
1842
1843
  this.pluginComponentId = args.pluginComponentId;
1843
1844
  this.onShowModal = args.onShowModal;
1845
+ this.onCloseModal = args.onCloseModal;
1844
1846
  this.onShowCreateRecordModal = args.onShowCreateRecordModal;
1845
1847
  this.onShowCreateRelatedRecordModal = args.onShowCreateRelatedRecordModal;
1846
1848
  this.onNetworkError = args.onNetworkError;
@@ -2045,6 +2047,21 @@ var WorkerManager = class {
2045
2047
  this.handlePromptRequest(consideredEvent.id, consideredEvent.config, true);
2046
2048
  return;
2047
2049
  }
2050
+ case ACTIONS.SHOW_VIEW_IN_MODAL_REQUEST: {
2051
+ const consideredEvent = event;
2052
+ this.handleShowViewInModalRequest(
2053
+ consideredEvent.id,
2054
+ consideredEvent.viewId,
2055
+ consideredEvent.args,
2056
+ consideredEvent.options
2057
+ );
2058
+ return;
2059
+ }
2060
+ case ACTIONS.CLOSE_MODAL_REQUEST: {
2061
+ const consideredEvent = event;
2062
+ this.onCloseModal?.(consideredEvent.values, consideredEvent.canceled);
2063
+ return;
2064
+ }
2048
2065
  case ACTIONS.RELEASE_BLOCKING_SCRIPT: {
2049
2066
  this.handleReleaseBlockingScript();
2050
2067
  return;
@@ -2329,6 +2346,35 @@ var WorkerManager = class {
2329
2346
  });
2330
2347
  }
2331
2348
  };
2349
+ handleShowViewInModalRequest = (id, viewId, args, options) => {
2350
+ if (this.onShowModal) {
2351
+ this.onShowModal(
2352
+ {
2353
+ viewId,
2354
+ ...args !== void 0 && { args },
2355
+ pluginApiName: this.pluginApiName ?? "",
2356
+ ...options?.frameless ? { frameless: true } : {
2357
+ ...options?.title !== void 0 && { title: options.title },
2358
+ ...options?.confirmButton !== void 0 && {
2359
+ confirmButton: options.confirmButton
2360
+ },
2361
+ ...options?.cancelButton !== void 0 && { cancelButton: options.cancelButton }
2362
+ }
2363
+ },
2364
+ (result = {}) => {
2365
+ this.postMessage(RESPONSES.PROMPT_RESPONSE, {
2366
+ id,
2367
+ data: result
2368
+ });
2369
+ }
2370
+ );
2371
+ } else {
2372
+ this.postMessage(RESPONSES.PROMPT_RESPONSE, {
2373
+ id,
2374
+ data: { canceled: true }
2375
+ });
2376
+ }
2377
+ };
2332
2378
  handleInstallThirdPartyScriptRequest = (id, url, args = {}) => {
2333
2379
  const type = getScriptIntegrationType(url);
2334
2380
  if (!type) {
@@ -2442,6 +2488,7 @@ var runScript = async ({
2442
2488
  sessionData,
2443
2489
  setSessionData,
2444
2490
  onShowModal,
2491
+ onCloseModal,
2445
2492
  onShowCreateRecordModal,
2446
2493
  onShowCreateRelatedRecordModal,
2447
2494
  onNetworkError,
@@ -2518,6 +2565,7 @@ var runScript = async ({
2518
2565
  setSessionData,
2519
2566
  pluginComponentId: componentId,
2520
2567
  onShowModal,
2568
+ onCloseModal,
2521
2569
  onShowCreateRecordModal,
2522
2570
  onShowCreateRelatedRecordModal,
2523
2571
  onNetworkError,
@@ -2577,8 +2625,8 @@ var runObjectExpression = async (expression, values) => {
2577
2625
  };
2578
2626
 
2579
2627
  // src/index.ts
2580
- var version = "1.4.0-01344a3";
2628
+ var version = "1.5.0-b163380";
2581
2629
 
2582
2630
  export { forceQualifiedUrl, getDisabledValue, getEnabledState, getHash, getLinkValue, getPluginSafeHTML, getQrCodeValue, getStableHash, isFlagEnabled, mergeConfig, pluginMapper, reduceEnabledResults, replaceConfigValues, runExpression, runObjectExpression, runOptionExpression, runScript, runStringExpression, version };
2583
- //# sourceMappingURL=chunk-ZMIF22NR.js.map
2584
- //# sourceMappingURL=chunk-ZMIF22NR.js.map
2631
+ //# sourceMappingURL=chunk-4AEFC6CZ.js.map
2632
+ //# sourceMappingURL=chunk-4AEFC6CZ.js.map