@superblocksteam/library 2.0.12-next.9 → 2.0.13-next.0

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 (51) hide show
  1. package/dist/{allPaths-QDngtDgF.js → allPaths-BjzQkMjc.js} +2 -2
  2. package/dist/{allPaths-QDngtDgF.js.map → allPaths-BjzQkMjc.js.map} +1 -1
  3. package/dist/{allPaths-DSGBbmkM.js → allPaths-CQOhjpXk.js} +2 -2
  4. package/dist/{allPaths-DSGBbmkM.js.map → allPaths-CQOhjpXk.js.map} +1 -1
  5. package/dist/{allPathsLoader-C0am3WW9.js → allPathsLoader-BYewEWVh.js} +3 -3
  6. package/dist/{allPathsLoader-C0am3WW9.js.map → allPathsLoader-BYewEWVh.js.map} +1 -1
  7. package/dist/{allPathsLoader-Cuc9rPiP.js → allPathsLoader-BYj7sg41.js} +3 -3
  8. package/dist/{allPathsLoader-Cuc9rPiP.js.map → allPathsLoader-BYj7sg41.js.map} +1 -1
  9. package/dist/{devtools-consolidated-DcgLGCxF.js → devtools-consolidated-CHfJX3eH.js} +2 -2
  10. package/dist/{devtools-consolidated-DcgLGCxF.js.map → devtools-consolidated-CHfJX3eH.js.map} +1 -1
  11. package/dist/{index-CGJkVHjX.js → index-CH4jAtWn.js} +786 -723
  12. package/dist/{index-CGJkVHjX.js.map → index-CH4jAtWn.js.map} +1 -1
  13. package/dist/index.js +2 -2
  14. package/dist/{splitPathsBySizeLoader-Co86rhhm.js → splitPathsBySizeLoader-2oYHBTYy.js} +2 -2
  15. package/dist/{splitPathsBySizeLoader-Co86rhhm.js.map → splitPathsBySizeLoader-2oYHBTYy.js.map} +1 -1
  16. package/dist/{splitPathsBySizeLoader-BhAoSPKn.js → splitPathsBySizeLoader-go6FZrRw.js} +2 -2
  17. package/dist/{splitPathsBySizeLoader-BhAoSPKn.js.map → splitPathsBySizeLoader-go6FZrRw.js.map} +1 -1
  18. package/dist-types/edit-mode/create-component.d.ts +5 -4
  19. package/dist-types/lib/internal-details/lib/evaluator/to-executables-or-values.d.ts +5 -2
  20. package/dist-types/lib/internal-details/lib/types.d.ts +1 -1
  21. package/dist-types/lib/internal-details/sb-wrapper.d.ts +37 -2
  22. package/dist-types/lib/triggers/implementations/components/control-modal.d.ts +3 -1
  23. package/dist-types/lib/triggers/implementations/components/control-slideout.d.ts +3 -1
  24. package/dist-types/lib/triggers/implementations/navigate/navigate-to.d.ts +1 -2
  25. package/dist-types/lib/triggers/implementations/navigate/set-query-params.d.ts +4 -2
  26. package/dist-types/lib/triggers/implementations/navigate/utils.d.ts +1 -0
  27. package/dist-types/lib/triggers/implementations/set-profile.d.ts +3 -1
  28. package/dist-types/lib/triggers/implementations/show-alert.d.ts +5 -1
  29. package/dist-types/lib/triggers/implementations/state/set-state-var.d.ts +4 -2
  30. package/dist-types/lib/triggers/implementations/timers/control-timer.d.ts +3 -1
  31. package/dist-types/lib/triggers/implementations/trigger-event.d.ts +4 -2
  32. package/dist-types/lib/user-facing/components/button/editor-template.d.ts +3 -0
  33. package/dist-types/lib/user-facing/components/checkbox/editor-template.d.ts +3 -0
  34. package/dist-types/lib/user-facing/components/column/editor-template.d.ts +3 -0
  35. package/dist-types/lib/user-facing/components/container/editor-template.d.ts +3 -0
  36. package/dist-types/lib/user-facing/components/date-picker/editor-template.d.ts +3 -0
  37. package/dist-types/lib/user-facing/components/dropdown/editor-template.d.ts +3 -0
  38. package/dist-types/lib/user-facing/components/icon/editor-template.d.ts +3 -0
  39. package/dist-types/lib/user-facing/components/icon/index.d.ts +2 -2
  40. package/dist-types/lib/user-facing/components/icon/props.d.ts +1 -1
  41. package/dist-types/lib/user-facing/components/image/editor-template.d.ts +3 -0
  42. package/dist-types/lib/user-facing/components/key-value/editor-template.d.ts +3 -0
  43. package/dist-types/lib/user-facing/components/modal/editor-template.d.ts +3 -0
  44. package/dist-types/lib/user-facing/components/section/editor-template.d.ts +3 -0
  45. package/dist-types/lib/user-facing/components/slideout/editor-template.d.ts +3 -0
  46. package/dist-types/lib/user-facing/components/switch/editor-template.d.ts +3 -0
  47. package/dist-types/lib/user-facing/components/table/editor-template.d.ts +3 -0
  48. package/dist-types/lib/user-facing/components/text/editor-template.d.ts +3 -0
  49. package/dist-types/lib/user-facing/event-flow.d.ts +66 -22
  50. package/package.json +2 -2
  51. /package/dist-types/{edit-mode → lib/user-facing/components/table}/default-table-data.d.ts +0 -0
@@ -54595,12 +54595,12 @@ const RunApisTrigger = {
54595
54595
  onFinish == null ? void 0 : onFinish(responses);
54596
54596
  });
54597
54597
  },
54598
- create(apis, onSuccess, onError2) {
54598
+ create(apis, opts) {
54599
54599
  return {
54600
54600
  type: TriggerStepType.RUN_APIS,
54601
54601
  apis,
54602
- onSuccess,
54603
- onError: onError2
54602
+ onSuccess: opts == null ? void 0 : opts.onSuccess,
54603
+ onError: opts == null ? void 0 : opts.onError
54604
54604
  };
54605
54605
  }
54606
54606
  };
@@ -54624,12 +54624,12 @@ const ControlModalTrigger = {
54624
54624
  args: [step]
54625
54625
  });
54626
54626
  },
54627
- create(modal, action2) {
54627
+ create(modal, opts) {
54628
54628
  const meta = getBindingIdentifier(modal);
54629
54629
  return {
54630
54630
  type: TriggerStepType.CONTROL_MODAL,
54631
54631
  name: meta == null ? void 0 : meta.entityName,
54632
- action: action2
54632
+ action: opts.action
54633
54633
  };
54634
54634
  }
54635
54635
  };
@@ -54648,12 +54648,12 @@ const ControlSlideoutTrigger = {
54648
54648
  args: [step]
54649
54649
  });
54650
54650
  },
54651
- create(slideout, action2) {
54651
+ create(slideout, opts) {
54652
54652
  const meta = getBindingIdentifier(slideout);
54653
54653
  return {
54654
54654
  type: TriggerStepType.CONTROL_SLIDEOUT,
54655
54655
  name: meta == null ? void 0 : meta.entityName,
54656
- action: action2
54656
+ action: opts.action
54657
54657
  };
54658
54658
  }
54659
54659
  };
@@ -54775,18 +54775,37 @@ const NavigateToRouteTrigger = {
54775
54775
  };
54776
54776
  }
54777
54777
  };
54778
+ const isValidUrlScheme = (url2) => {
54779
+ return (
54780
+ // Standard http call
54781
+ url2.startsWith("http://") || // Secure http call
54782
+ url2.startsWith("https://") || // Mail url to directly open email app prefilled
54783
+ url2.startsWith("mailto:") || // Tel url to directly open phone app prefilled
54784
+ url2.startsWith("tel:")
54785
+ );
54786
+ };
54778
54787
  const NavigateToTrigger = {
54779
54788
  type: TriggerStepType.NAVIGATE_TO,
54780
54789
  async execute(_context, step) {
54781
- window.location.href = step.url;
54790
+ let url2 = step.url;
54791
+ if (!isValidUrlScheme(url2)) {
54792
+ url2 = "https://" + url2;
54793
+ }
54794
+ if (step.newWindow) {
54795
+ window.open(url2, "_blank");
54796
+ } else if (window.top) {
54797
+ window.top.location.href = url2;
54798
+ } else {
54799
+ window.location.href = url2;
54800
+ }
54782
54801
  },
54783
- create(props2) {
54802
+ create(url2, opts) {
54784
54803
  return {
54785
54804
  type: TriggerStepType.NAVIGATE_TO,
54786
- url: props2.url,
54787
- newWindow: props2.newWindow ?? false,
54788
- replaceHistory: props2.replaceHistory,
54789
- arguments: props2.arguments
54805
+ url: url2,
54806
+ newWindow: (opts == null ? void 0 : opts.newWindow) ?? false,
54807
+ replaceHistory: opts == null ? void 0 : opts.replaceHistory,
54808
+ arguments: opts == null ? void 0 : opts.arguments
54790
54809
  };
54791
54810
  }
54792
54811
  };
@@ -54795,16 +54814,17 @@ const SetQueryParamsTrigger = {
54795
54814
  async execute(_context, step) {
54796
54815
  console.log("SetQueryParamsTrigger", step);
54797
54816
  },
54798
- create(queryParams, keepQueryParams = false) {
54817
+ create(queryParams, opts) {
54799
54818
  return {
54800
54819
  type: TriggerStepType.SET_QUERY_PARAMS,
54801
54820
  queryParams,
54802
- keepQueryParams
54821
+ keepQueryParams: (opts == null ? void 0 : opts.keep) ?? false
54803
54822
  };
54804
54823
  }
54805
54824
  };
54806
54825
  const RunJsTrigger = {
54807
54826
  type: TriggerStepType.RUN_JS,
54827
+ // TODO: implement opts?: { defer?: number }
54808
54828
  create(handler) {
54809
54829
  return {
54810
54830
  type: TriggerStepType.RUN_JS,
@@ -54829,11 +54849,11 @@ const SetProfileTrigger = {
54829
54849
  async execute(_context, step) {
54830
54850
  console.log("SetProfileTrigger", step);
54831
54851
  },
54832
- create(profileId, action2) {
54852
+ create(profileId, opts) {
54833
54853
  return {
54834
54854
  type: TriggerStepType.SET_PROFILE,
54835
54855
  profileId,
54836
- action: action2
54856
+ action: opts.action ?? "set"
54837
54857
  };
54838
54858
  }
54839
54859
  };
@@ -89864,19 +89884,19 @@ const ShowAlertTrigger = {
89864
89884
  });
89865
89885
  sendNotification({
89866
89886
  message: computedMessage,
89867
- type: step.style,
89887
+ type: step.style ?? "success",
89868
89888
  duration: step.alertDuration ?? 4,
89869
89889
  placement: step.alertPosition ?? NotificationPosition.bottomRight,
89870
89890
  dataTest: "alert-notification"
89871
89891
  });
89872
89892
  },
89873
- create(message2, alertType, alertDuration, alertPosition) {
89893
+ create(message2, opts) {
89874
89894
  return {
89875
89895
  type: TriggerStepType.SHOW_ALERT,
89876
89896
  message: message2,
89877
- style: alertType,
89878
- alertDuration,
89879
- alertPosition
89897
+ style: (opts == null ? void 0 : opts.type) ?? "success",
89898
+ alertDuration: opts == null ? void 0 : opts.durationMs,
89899
+ alertPosition: opts == null ? void 0 : opts.position
89880
89900
  };
89881
89901
  }
89882
89902
  };
@@ -89926,11 +89946,11 @@ const SetStateVarTrigger = {
89926
89946
  args: [value]
89927
89947
  });
89928
89948
  },
89929
- create(variable, value) {
89949
+ create(variable, opts) {
89930
89950
  return {
89931
89951
  type: TriggerStepType.SET_STATE_VAR,
89932
89952
  variable,
89933
- value
89953
+ value: opts.value
89934
89954
  };
89935
89955
  }
89936
89956
  };
@@ -89941,11 +89961,11 @@ const ControlTimerTrigger = {
89941
89961
  step.timer[step.action]();
89942
89962
  }
89943
89963
  },
89944
- create(timer, action2) {
89964
+ create(timer, opts) {
89945
89965
  return {
89946
89966
  type: TriggerStepType.CONTROL_TIMER,
89947
89967
  timer,
89948
- action: action2
89968
+ action: opts.action
89949
89969
  };
89950
89970
  }
89951
89971
  };
@@ -89954,12 +89974,12 @@ const TriggerEventTrigger = {
89954
89974
  async execute(_context, step) {
89955
89975
  console.log("TriggerEventTrigger", step);
89956
89976
  },
89957
- create(eventName, eventPayload) {
89977
+ create(eventName, opts) {
89958
89978
  return {
89959
89979
  type: TriggerStepType.TRIGGER_EVENT,
89960
89980
  event: { name: eventName },
89961
89981
  //TODO(code-mode): this is a hack to get the name
89962
- eventPayload
89982
+ eventPayload: opts == null ? void 0 : opts.data
89963
89983
  };
89964
89984
  }
89965
89985
  };
@@ -94242,7 +94262,7 @@ function mergeRelations(existingRelations, relations) {
94242
94262
  ) : relations;
94243
94263
  return mergedRelations;
94244
94264
  }
94245
- function getChildren(input, path2, entity, scopedState) {
94265
+ function getChildren$2(input, path2, entity, scopedState) {
94246
94266
  function getChildrenFromSection(section) {
94247
94267
  return Object.keys(section.props).reduce(
94248
94268
  (acc, key2) => {
@@ -94653,7 +94673,7 @@ class CompositeProp extends Prop {
94653
94673
  }
94654
94674
  return {
94655
94675
  ...definition,
94656
- children: getChildren(
94676
+ children: getChildren$2(
94657
94677
  this.nestedProps,
94658
94678
  this.prop.path,
94659
94679
  entity,
@@ -94683,7 +94703,7 @@ class RecordProp extends Prop {
94683
94703
  }
94684
94704
  return {
94685
94705
  ...definition,
94686
- children: getChildren(
94706
+ children: getChildren$2(
94687
94707
  this.nestedProps,
94688
94708
  this.prop.path,
94689
94709
  entity,
@@ -95080,7 +95100,7 @@ function registerStores(stores) {
95080
95100
  internalStores = { ...internalStores, ...stores };
95081
95101
  if (SUPPORTED_MODES.includes("production")) {
95082
95102
  if (Object.keys(internalStores).length === Object.keys(stores).length) {
95083
- import("./devtools-consolidated-DcgLGCxF.js").then(({ initializeCustomDevTools, setRegisteredStores }) => {
95103
+ import("./devtools-consolidated-CHfJX3eH.js").then(({ initializeCustomDevTools, setRegisteredStores }) => {
95084
95104
  setRegisteredStores(internalStores);
95085
95105
  initializeCustomDevTools();
95086
95106
  }).catch((error) => {
@@ -95093,7 +95113,7 @@ function registerStores(stores) {
95093
95113
  }
95094
95114
  }
95095
95115
  const DevToolsInternal = React__default.lazy(() => {
95096
- return import("./devtools-consolidated-DcgLGCxF.js").then((module2) => ({
95116
+ return import("./devtools-consolidated-CHfJX3eH.js").then((module2) => ({
95097
95117
  default: module2.CustomDevTools
95098
95118
  }));
95099
95119
  });
@@ -95390,11 +95410,11 @@ class EventFlow {
95390
95410
  runJS(handler) {
95391
95411
  return this.addStep(EventRegistry.runJs.create(handler));
95392
95412
  }
95393
- static navigateTo(props2) {
95394
- return EventFlow.start().navigateTo(props2);
95413
+ static navigateTo(url2, opts) {
95414
+ return EventFlow.start().navigateTo(url2, opts);
95395
95415
  }
95396
- navigateTo(props2) {
95397
- return this.addStep(EventRegistry.navigateTo.create(props2));
95416
+ navigateTo(url2, opts) {
95417
+ return this.addStep(EventRegistry.navigateTo.create(url2, opts));
95398
95418
  }
95399
95419
  static navigateToApp(appId) {
95400
95420
  return EventFlow.start().navigateToApp(appId);
@@ -95408,42 +95428,36 @@ class EventFlow {
95408
95428
  navigateToRoute(route) {
95409
95429
  return this.addStep(EventRegistry.navigateToRoute.create(route));
95410
95430
  }
95411
- static setQueryParams(params, keepQueryParams = false) {
95412
- return EventFlow.start().setQueryParams(params, keepQueryParams);
95431
+ static setQueryParams(params, opts) {
95432
+ return EventFlow.start().setQueryParams(params, opts);
95413
95433
  }
95414
- setQueryParams(params, keepQueryParams = false) {
95415
- return this.addStep(
95416
- EventRegistry.setQueryParams.create(params, keepQueryParams)
95417
- );
95434
+ setQueryParams(params, opts) {
95435
+ return this.addStep(EventRegistry.setQueryParams.create(params, opts));
95418
95436
  }
95419
- static controlSlideout(slideout, action2) {
95420
- return EventFlow.start().controlSlideout(slideout, action2);
95437
+ static controlSlideout(slideout, opts) {
95438
+ return EventFlow.start().controlSlideout(slideout, opts);
95421
95439
  }
95422
- controlSlideout(slideout, action2) {
95423
- return this.addStep(EventRegistry.controlSlideout.create(slideout, action2));
95440
+ controlSlideout(slideout, opts) {
95441
+ return this.addStep(EventRegistry.controlSlideout.create(slideout, opts));
95424
95442
  }
95425
- static controlModal(modal, action2) {
95426
- return EventFlow.start().controlModal(modal, action2);
95443
+ static controlModal(modal, opts) {
95444
+ return EventFlow.start().controlModal(modal, opts);
95427
95445
  }
95428
- controlModal(modal, action2) {
95429
- return this.addStep(EventRegistry.controlModal.create(modal, action2));
95446
+ controlModal(modal, opts) {
95447
+ return this.addStep(EventRegistry.controlModal.create(modal, opts));
95430
95448
  }
95431
- static controlTimer(stateTimer, action2) {
95432
- return EventFlow.start().controlTimer(stateTimer, action2);
95449
+ static controlTimer(stateTimer, opts) {
95450
+ return EventFlow.start().controlTimer(stateTimer, opts);
95433
95451
  }
95434
- controlTimer(stateTimer, action2) {
95435
- return this.addStep(EventRegistry.controlTimer.create(stateTimer, action2));
95452
+ controlTimer(stateTimer, opts) {
95453
+ return this.addStep(EventRegistry.controlTimer.create(stateTimer, opts));
95436
95454
  }
95437
- static runApis(apis, onSuccess, onError2) {
95438
- return EventFlow.start().runApis(apis, onSuccess, onError2);
95455
+ static runApis(apis, opts) {
95456
+ return EventFlow.start().runApis(apis, opts);
95439
95457
  }
95440
- runApis(apis, onSuccess, onError2) {
95458
+ runApis(apis, opts) {
95441
95459
  return this.addStep(
95442
- EventRegistry.executeApi.create(
95443
- apis,
95444
- onSuccess,
95445
- onError2
95446
- )
95460
+ EventRegistry.executeApi.create(apis, opts)
95447
95461
  );
95448
95462
  }
95449
95463
  static cancelApis(apis, onCancel) {
@@ -95466,11 +95480,11 @@ class EventFlow {
95466
95480
  resetStateVar(state) {
95467
95481
  return this.addStep(EventRegistry.resetStateVar.create(state));
95468
95482
  }
95469
- static setStateVar(stateVarName, value) {
95470
- return EventFlow.start().setStateVar(stateVarName, value);
95483
+ static setStateVar(stateVarName, opts) {
95484
+ return EventFlow.start().setStateVar(stateVarName, opts);
95471
95485
  }
95472
- setStateVar(stateVar, value) {
95473
- return this.addStep(EventRegistry.setStateVar.create(stateVar, value));
95486
+ setStateVar(stateVar, opts) {
95487
+ return this.addStep(EventRegistry.setStateVar.create(stateVar, opts));
95474
95488
  }
95475
95489
  static setComponentProperty(component, opts) {
95476
95490
  return EventFlow.start().setComponentProperty(component, opts);
@@ -95480,37 +95494,23 @@ class EventFlow {
95480
95494
  EventRegistry.setComponentProperty.create(component, opts)
95481
95495
  );
95482
95496
  }
95483
- static showAlert(message2, alertType, alertDuration, alertPosition) {
95484
- return EventFlow.start().showAlert(
95485
- message2,
95486
- alertType,
95487
- alertDuration,
95488
- alertPosition
95489
- );
95497
+ static showAlert(message2, opts) {
95498
+ return EventFlow.start().showAlert(message2, opts);
95490
95499
  }
95491
- showAlert(message2, alertType, alertDuration, alertPosition) {
95492
- return this.addStep(
95493
- EventRegistry.showAlert.create(
95494
- message2,
95495
- alertType,
95496
- alertDuration,
95497
- alertPosition
95498
- )
95499
- );
95500
+ showAlert(message2, opts) {
95501
+ return this.addStep(EventRegistry.showAlert.create(message2, opts));
95500
95502
  }
95501
- static setProfile(profileId, action2) {
95502
- return EventFlow.start().setProfile(profileId, action2);
95503
+ static setProfile(profileId, opts) {
95504
+ return EventFlow.start().setProfile(profileId, opts);
95503
95505
  }
95504
- setProfile(profileId, action2) {
95505
- return this.addStep(EventRegistry.setProfile.create(profileId, action2));
95506
+ setProfile(profileId, opts) {
95507
+ return this.addStep(EventRegistry.setProfile.create(profileId, opts));
95506
95508
  }
95507
- static triggerEvent(eventName, eventData) {
95508
- return EventFlow.start().triggerEvent(eventName, eventData);
95509
+ static triggerEvent(eventName, opts) {
95510
+ return EventFlow.start().triggerEvent(eventName, opts);
95509
95511
  }
95510
- triggerEvent(eventName, eventData) {
95511
- return this.addStep(
95512
- EventRegistry.triggerEvent.create(eventName, eventData)
95513
- );
95512
+ triggerEvent(eventName, opts) {
95513
+ return this.addStep(EventRegistry.triggerEvent.create(eventName, opts));
95514
95514
  }
95515
95515
  static sequence(eventFlows) {
95516
95516
  return EventFlow.start().sequence(eventFlows);
@@ -95634,7 +95634,7 @@ const toExecutableOrValue = (path2, value, isAnExternalFunction = false) => {
95634
95634
  };
95635
95635
  }
95636
95636
  } else if (isFunctionProp(value)) {
95637
- return { value, type: "normal" };
95637
+ return { value, type: "function" };
95638
95638
  } else if (isDerivedProp(value)) {
95639
95639
  return {
95640
95640
  value: toEvalFunc([path2, value])[1],
@@ -95951,7 +95951,7 @@ class EntityManager {
95951
95951
  }
95952
95952
  const getMetaParent = () => isNested ? lodashExports.get(entityMeta, parentSegments) : entityMeta;
95953
95953
  const snapshot = this.getState.bind(this);
95954
- const isComputed = typeof eov.value === "function";
95954
+ const isComputed = typeof eov.value === "function" && eov.type !== "function";
95955
95955
  const computeEngine = eov.type === "mustache-bindings" || eov.type === "lazy-function" ? this.evalComputeEngine : this.dirComputeEngine;
95956
95956
  const entityType = entity.type;
95957
95957
  if (eov.type === "external-function") {
@@ -96233,19 +96233,28 @@ class EntityManager {
96233
96233
  addMissingProps(managedProps, addedProperties, scopeId, name) {
96234
96234
  const entity = this.getScope(scopeId).getEntity(name);
96235
96235
  for (const prop of managedProps) {
96236
+ const isComputed = typeof prop.default === "function" && prop.dataType !== "function";
96236
96237
  if (lodashExports.get(entity, prop.path) == null && !addedProperties.has(prop.path) && // for nested properties, only set if the default is defined
96237
96238
  // for top-level properties, we should always add the property
96238
96239
  (!isNestedPath(prop.path) || prop.default !== void 0)) {
96239
- this.addProperty(
96240
- scopeId,
96241
- name,
96242
- prop.path,
96243
- toExecutableOrValue(
96240
+ if (isComputed) {
96241
+ this.addProperty(scopeId, name, prop.path, {
96242
+ value: prop.default,
96243
+ type: "normal"
96244
+ // This will be treated as a computed function
96245
+ });
96246
+ } else {
96247
+ this.addProperty(
96248
+ scopeId,
96249
+ name,
96244
96250
  prop.path,
96245
- prop.default !== void 0 ? fastClone$1(prop.default) : void 0,
96246
- prop.dataType === "function" || prop.dataType === "event"
96247
- )
96248
- );
96251
+ toExecutableOrValue(
96252
+ prop.path,
96253
+ prop.default !== void 0 ? fastClone$1(prop.default) : void 0,
96254
+ prop.dataType === "function" || prop.dataType === "event"
96255
+ )
96256
+ );
96257
+ }
96249
96258
  }
96250
96259
  }
96251
96260
  }
@@ -96277,7 +96286,7 @@ class EntityManager {
96277
96286
  name.value,
96278
96287
  value
96279
96288
  );
96280
- const isComputed = typeof transformedValue === "function";
96289
+ const isComputed = typeof transformedValue === "function" && type5 !== "function";
96281
96290
  const computeEngine = type5 === "mustache-bindings" || type5 === "lazy-function" ? this.evalComputeEngine : this.dirComputeEngine;
96282
96291
  const result = isComputed ? computeEngine.compute({
96283
96292
  snapshot: this.getState(scopeId),
@@ -98705,11 +98714,10 @@ function getEventFlow(step, scopeId) {
98705
98714
  };
98706
98715
  switch (step.type) {
98707
98716
  case "executeApi":
98708
- return EventFlow.runApis(
98709
- getEntities(step.apis.map((api2) => api2.name)),
98710
- createNestedEventFlow(step.onSuccess ?? []),
98711
- createNestedEventFlow(step.onError ?? [])
98712
- );
98717
+ return EventFlow.runApis(step.apis.map((api2) => api2.name), {
98718
+ onSuccess: createNestedEventFlow(step.onSuccess ?? []),
98719
+ onError: createNestedEventFlow(step.onError ?? [])
98720
+ });
98713
98721
  case "cancelApi":
98714
98722
  return EventFlow.cancelApis(
98715
98723
  getEntities(step.apis.map((api2) => api2.name)),
@@ -98727,9 +98735,10 @@ function getEventFlow(step, scopeId) {
98727
98735
  }
98728
98736
  });
98729
98737
  case "navigateTo":
98730
- return EventFlow.navigateTo({
98731
- url: step.url,
98732
- newWindow: step.newWindow
98738
+ return EventFlow.navigateTo(step.url, {
98739
+ newWindow: step.newWindow,
98740
+ replaceHistory: step.replaceHistory,
98741
+ arguments: step.arguments
98733
98742
  });
98734
98743
  case "navigateToApp":
98735
98744
  return EventFlow.navigateToApp(step.targetApp.id);
@@ -98738,17 +98747,23 @@ function getEventFlow(step, scopeId) {
98738
98747
  case "setQueryParams":
98739
98748
  return EventFlow.setQueryParams(
98740
98749
  step.queryParams ? JSON.parse(step.queryParams) : {},
98741
- step.keepQueryParams
98750
+ {
98751
+ keep: step.keepQueryParams
98752
+ }
98742
98753
  );
98743
98754
  case "controlSlideout": {
98744
98755
  const slideoutEntity = getEntity(step.name);
98745
98756
  if (!slideoutEntity) return void 0;
98746
- return EventFlow.controlSlideout(slideoutEntity, step.action);
98757
+ return EventFlow.controlSlideout(slideoutEntity, {
98758
+ action: step.action
98759
+ });
98747
98760
  }
98748
98761
  case "controlModal": {
98749
98762
  const modalEntity = getEntity(step.name);
98750
98763
  if (!modalEntity) return void 0;
98751
- return EventFlow.controlModal(modalEntity, step.action);
98764
+ return EventFlow.controlModal(modalEntity, {
98765
+ action: step.action
98766
+ });
98752
98767
  }
98753
98768
  case "controlTimer": {
98754
98769
  const timerStep = step;
@@ -98757,7 +98772,9 @@ function getEventFlow(step, scopeId) {
98757
98772
  }
98758
98773
  const timerEntity = getEntity(timerStep.timer.name);
98759
98774
  if (!timerEntity) return void 0;
98760
- return EventFlow.controlTimer(timerEntity, step.action ?? "start");
98775
+ return EventFlow.controlTimer(timerEntity, {
98776
+ action: step.action ?? "start"
98777
+ });
98761
98778
  }
98762
98779
  case "setStateVar": {
98763
98780
  const variableStep = step;
@@ -98768,7 +98785,7 @@ function getEventFlow(step, scopeId) {
98768
98785
  scopeId,
98769
98786
  name: getName((_c2 = variableStep.variable) == null ? void 0 : _c2.name)
98770
98787
  }) : step.value;
98771
- return EventFlow.setStateVar(stateEntity, value);
98788
+ return EventFlow.setStateVar(stateEntity, { value });
98772
98789
  }
98773
98790
  case "resetStateVar": {
98774
98791
  const variableStep = step;
@@ -98795,16 +98812,22 @@ function getEventFlow(step, scopeId) {
98795
98812
  });
98796
98813
  }
98797
98814
  case "showAlert":
98798
- return EventFlow.showAlert(
98799
- step.message,
98800
- step.style,
98801
- step.alertDuration,
98802
- step.alertPosition
98803
- );
98815
+ return EventFlow.showAlert(step.message, {
98816
+ type: step.style,
98817
+ durationMs: step.alertDuration,
98818
+ position: step.alertPosition
98819
+ });
98804
98820
  case "setProfile":
98805
- return EventFlow.setProfile(step.profileId, step.action);
98821
+ return EventFlow.setProfile(step.profileId, {
98822
+ action: step.action
98823
+ });
98806
98824
  case "triggerEvent":
98807
- return EventFlow.triggerEvent((_g2 = step.event) == null ? void 0 : _g2.name, step.eventPayload);
98825
+ return EventFlow.triggerEvent(
98826
+ (_g2 = step.event) == null ? void 0 : _g2.name,
98827
+ step.eventPayload ? {
98828
+ data: step.eventPayload
98829
+ } : void 0
98830
+ );
98808
98831
  default:
98809
98832
  console.warn("Unhandled runtime step type", step.type);
98810
98833
  return void 0;
@@ -102658,14 +102681,14 @@ function getLoaderFn$1(options) {
102658
102681
  if (!(loader === "all")) return [3, 3];
102659
102682
  return [4, import(
102660
102683
  /* webpackChunkName: "blueprint-icons-all-paths-loader" */
102661
- "./allPathsLoader-Cuc9rPiP.js"
102684
+ "./allPathsLoader-BYj7sg41.js"
102662
102685
  )];
102663
102686
  case 2:
102664
102687
  return [2, _b2.sent().allPathsLoader];
102665
102688
  case 3:
102666
102689
  return [4, import(
102667
102690
  /* webpackChunkName: "blueprint-icons-split-paths-by-size-loader" */
102668
- "./splitPathsBySizeLoader-BhAoSPKn.js"
102691
+ "./splitPathsBySizeLoader-go6FZrRw.js"
102669
102692
  )];
102670
102693
  case 4:
102671
102694
  return [2, _b2.sent().splitPathsBySizeLoader];
@@ -111777,7 +111800,7 @@ function createScope(getInitialEntities, options) {
111777
111800
  scopeId: stableScopeId
111778
111801
  });
111779
111802
  const bindingIds = {};
111780
- const getBinding = (key2) => {
111803
+ const getBinding2 = (key2) => {
111781
111804
  if (bindingIds[key2]) {
111782
111805
  return bindingIds[key2];
111783
111806
  }
@@ -111805,7 +111828,7 @@ function createScope(getInitialEntities, options) {
111805
111828
  useSuspense: true
111806
111829
  }
111807
111830
  ),
111808
- getBinding(key2)
111831
+ getBinding2(key2)
111809
111832
  );
111810
111833
  }
111811
111834
  }
@@ -127981,199 +128004,6 @@ const GridDropPreview = observer(() => {
127981
128004
  }
127982
128005
  );
127983
128006
  });
127984
- var KeyValuePropertyType = /* @__PURE__ */ ((KeyValuePropertyType2) => {
127985
- KeyValuePropertyType2["TEXT"] = "text";
127986
- KeyValuePropertyType2["NUMBER"] = "number";
127987
- KeyValuePropertyType2["CURRENCY"] = "currency";
127988
- KeyValuePropertyType2["PERCENTAGE"] = "percentage";
127989
- KeyValuePropertyType2["IMAGE"] = "image";
127990
- KeyValuePropertyType2["VIDEO"] = "video";
127991
- KeyValuePropertyType2["DATE"] = "date";
127992
- KeyValuePropertyType2["BUTTON"] = "button";
127993
- KeyValuePropertyType2["LINK"] = "link";
127994
- KeyValuePropertyType2["BOOLEAN"] = "boolean";
127995
- KeyValuePropertyType2["TAGS"] = "tags";
127996
- KeyValuePropertyType2["EMAIL"] = "email";
127997
- return KeyValuePropertyType2;
127998
- })(KeyValuePropertyType || {});
127999
- const DEFAULT_TABLE_DATA = [
128000
- {
128001
- photo: "https://cdn.superblocks.com/sample-data/rachel_kim.jpg",
128002
- name: "Rachel Kim",
128003
- email: "rachel.kim89@gmail.com",
128004
- role: "Vendor Partner",
128005
- company: "Urban Threads Co.",
128006
- status: "Active",
128007
- date_joined: "2023-04-12",
128008
- last_activity: "2025-06-07T16:20:00Z"
128009
- },
128010
- {
128011
- photo: "https://cdn.superblocks.com/sample-data/daniel_vargas.jpg",
128012
- name: "Daniel Vargas",
128013
- email: "dvargas1984@yahoo.com",
128014
- role: "Logistics Contact",
128015
- company: "Vargas Freight Ltd.",
128016
- status: "Pending",
128017
- date_joined: "2024-01-23",
128018
- last_activity: "2025-05-30T13:45:00Z"
128019
- },
128020
- {
128021
- photo: "https://cdn.superblocks.com/sample-data/sophie_liu.jpg",
128022
- name: "Sophie Liu",
128023
- email: "sophie.liu.personal@gmail.com",
128024
- role: "Retail Manager",
128025
- company: "Modern Goods",
128026
- status: "Active",
128027
- date_joined: "2022-09-10",
128028
- last_activity: "2025-06-08T09:03:00Z"
128029
- },
128030
- {
128031
- photo: "https://cdn.superblocks.com/sample-data/omar_el-sayed.jpg",
128032
- name: "Omar El-Sayed",
128033
- email: "omarsayed78@hotmail.com",
128034
- role: "Accounts Payable",
128035
- company: "Sayed Textiles",
128036
- status: "Inactive",
128037
- date_joined: "2021-06-05",
128038
- last_activity: "2024-12-18T11:40:00Z"
128039
- },
128040
- {
128041
- photo: "https://cdn.superblocks.com/sample-data/grace_nguyen.jpg",
128042
- name: "Grace Nguyen",
128043
- email: "gracenguyen23@icloud.com",
128044
- role: "Product Supplier",
128045
- company: "Green Earth Supplies",
128046
- status: "Active",
128047
- date_joined: "2023-11-03",
128048
- last_activity: "2025-06-08T17:28:00Z"
128049
- },
128050
- {
128051
- photo: "https://cdn.superblocks.com/sample-data/alex_romero.jpg",
128052
- name: "Alex Romero",
128053
- email: "alex.romero@gmail.com",
128054
- role: "Client Account Owner",
128055
- company: "Romero & Co.",
128056
- status: "Suspended",
128057
- date_joined: "2022-02-28",
128058
- last_activity: "2025-03-11T08:20:00Z"
128059
- },
128060
- {
128061
- photo: "https://cdn.superblocks.com/sample-data/lena_schmidt.jpg",
128062
- name: "Lena Schmidt",
128063
- email: "lena_schmidt92@gmx.de",
128064
- role: "Wholesale Contact",
128065
- company: "Schmidt Imports",
128066
- status: "Active",
128067
- date_joined: "2021-12-01",
128068
- last_activity: "2025-06-06T21:10:00Z"
128069
- },
128070
- {
128071
- photo: "https://cdn.superblocks.com/sample-data/devon_price.jpg",
128072
- name: "Devon Price",
128073
- email: "devon.price22@aol.com",
128074
- role: "Fulfillment Liaison",
128075
- company: "DepotLink",
128076
- status: "Active",
128077
- date_joined: "2024-05-17",
128078
- last_activity: "2025-06-08T10:42:00Z"
128079
- },
128080
- {
128081
- photo: "https://cdn.superblocks.com/sample-data/isabella_rossi.jpg",
128082
- name: "Isabella Rossi",
128083
- email: "bella.rossi@gmail.com",
128084
- role: "Procurement Agent",
128085
- company: "Rossi Global Sourcing",
128086
- status: "Pending",
128087
- date_joined: "2023-07-19",
128088
- last_activity: "2025-05-29T14:05:00Z"
128089
- },
128090
- {
128091
- photo: "https://cdn.superblocks.com/sample-data/tariq_khan.jpg",
128092
- name: "Tariq Khan",
128093
- email: "tariq.khan92@protonmail.com",
128094
- role: "International Ops Lead",
128095
- company: "CrossPort Trade Inc.",
128096
- status: "Active",
128097
- date_joined: "2022-11-08",
128098
- last_activity: "2025-06-08T16:11:00Z"
128099
- },
128100
- {
128101
- photo: "https://cdn.superblocks.com/sample-data/emily_zhang.jpg",
128102
- name: "Emily Zhang",
128103
- email: "emilyzhang.home@gmail.com",
128104
- role: "Logistics Coordinator",
128105
- company: "Zhang Export Ltd.",
128106
- status: "Active",
128107
- date_joined: "2023-03-12",
128108
- last_activity: "2025-06-08T19:02:00Z"
128109
- }
128110
- ];
128111
- const DEFAULT_TABLE_COLUMNS = {
128112
- name: {
128113
- columnType: "text",
128114
- label: "Name"
128115
- },
128116
- email: {
128117
- columnType: "email",
128118
- label: "Email"
128119
- },
128120
- role: {
128121
- columnType: "text",
128122
- label: "Role"
128123
- },
128124
- company: {
128125
- columnType: "text",
128126
- label: "Company"
128127
- },
128128
- status: {
128129
- columnType: "tags",
128130
- tagDisplayConfig: {
128131
- Active: {
128132
- color: "#14CDB733"
128133
- },
128134
- Pending: {
128135
- color: "#FF9F3533"
128136
- },
128137
- Inactive: {
128138
- color: "#a6a0a033"
128139
- },
128140
- Suspended: {
128141
- color: "#FF62A433"
128142
- }
128143
- },
128144
- label: "Status"
128145
- },
128146
- date_joined: {
128147
- columnType: "date",
128148
- inputFormat: "YYYY-MM-DD",
128149
- outputFormat: "MM-DD-YYYY",
128150
- label: "Date joined"
128151
- },
128152
- last_activity: {
128153
- columnType: "date",
128154
- inputFormat: "YYYY-MM-DDTHH:mm:ssZ",
128155
- outputFormat: "MM-DD-YYYY",
128156
- label: "Last activity"
128157
- },
128158
- photo: {
128159
- columnType: "image",
128160
- label: "Photo",
128161
- imageBorderRadius: {
128162
- topLeft: Dim.px(16),
128163
- topRight: Dim.px(16),
128164
- bottomLeft: Dim.px(16),
128165
- bottomRight: Dim.px(16)
128166
- }
128167
- }
128168
- };
128169
- const DEFAULT_TABLE_KEYS = Object.keys(DEFAULT_TABLE_COLUMNS);
128170
- const CLEARED_TABLE_COLUMNS = DEFAULT_TABLE_KEYS.reduce(
128171
- (acc, key2) => {
128172
- acc[key2] = void 0;
128173
- return acc;
128174
- },
128175
- {}
128176
- );
128177
128007
  function getParentInfo(parent) {
128178
128008
  const parentComponentMeta = getEditStore().runtimeEntitiesManager.getAnyEditorWidgetMeta(parent.id);
128179
128009
  const isParentGridLike = isWidgetGrid(parentComponentMeta);
@@ -128182,316 +128012,60 @@ function getParentInfo(parent) {
128182
128012
  type: parentComponentMeta == null ? void 0 : parentComponentMeta.type
128183
128013
  };
128184
128014
  }
128185
- function getModalChildren(modalName) {
128186
- return [
128187
- {
128188
- tagName: "Container",
128189
- properties: {
128190
- variant: Property.Static("none"),
128191
- width: Property.Dimension(Dim.fill()),
128192
- layout: Property.Static("horizontal"),
128193
- horizontalAlign: Property.Static("left")
128194
- },
128195
- children: [
128196
- {
128197
- tagName: "Text",
128198
- properties: {
128199
- text: Property.Static("Modal Title"),
128200
- textStyle: Property.Static({
128201
- variant: "heading3"
128202
- })
128203
- },
128204
- children: []
128205
- }
128206
- ]
128207
- },
128208
- {
128209
- tagName: "Container",
128210
- properties: {
128211
- variant: Property.Static("none"),
128212
- width: Property.Dimension(Dim.fill()),
128213
- horizontalAlign: Property.Static("left")
128214
- },
128215
- children: []
128216
- },
128217
- {
128218
- tagName: "Container",
128219
- properties: {
128220
- spacing: Property.Dimension(Dim.px(8)),
128221
- width: Property.Dimension(Dim.fill()),
128222
- variant: Property.Static("none"),
128223
- layout: Property.Static("horizontal"),
128224
- horizontalAlign: Property.Static("right")
128225
- },
128226
- children: [
128227
- {
128228
- tagName: "Button",
128229
- properties: {
128230
- label: Property.Static("Cancel"),
128231
- variant: Property.Static("secondary"),
128232
- onClick: Property.Event([
128233
- {
128234
- id: "closeModal",
128235
- type: TriggerStepType.CONTROL_MODAL,
128236
- name: modalName,
128237
- action: "close"
128238
- }
128239
- ])
128240
- },
128241
- children: []
128242
- },
128243
- {
128244
- tagName: "Button",
128245
- properties: {
128246
- label: Property.Static("Confirm")
128247
- },
128248
- children: []
128249
- }
128250
- ]
128251
- }
128252
- ];
128253
- }
128254
- function getSlideoutChildren() {
128255
- return [
128256
- {
128257
- tagName: "Container",
128258
- properties: {
128259
- variant: Property.Static("none"),
128260
- width: Property.Dimension(Dim.fill()),
128261
- layout: Property.Static("horizontal"),
128262
- horizontalAlign: Property.Static("left")
128263
- },
128264
- children: [
128265
- {
128266
- tagName: "Text",
128267
- properties: {
128268
- text: Property.Static("Slideout Title"),
128269
- textStyle: Property.Static({
128270
- variant: "heading3"
128271
- })
128272
- },
128273
- children: []
128274
- }
128275
- ]
128276
- },
128277
- {
128278
- tagName: "Container",
128279
- properties: {
128280
- variant: Property.Static("none"),
128281
- width: Property.Dimension(Dim.fill()),
128282
- height: Property.Dimension(Dim.fill()),
128283
- horizontalAlign: Property.Static("left"),
128284
- layout: Property.Static("vertical")
128285
- },
128286
- children: []
128287
- }
128288
- ];
128289
- }
128290
- function getSectionChildren() {
128291
- return [
128292
- {
128293
- tagName: "Column",
128294
- properties: {
128295
- width: Property.Dimension(Dim.fill()),
128296
- height: Property.Dimension(Dim.fill())
128297
- },
128298
- children: []
128299
- }
128300
- ];
128301
- }
128302
- function getTriggerComponent({
128015
+ const generateUniqueName = (componentType) => {
128016
+ const baseName = componentType;
128017
+ let counter2 = 1;
128018
+ let name = `${baseName}${counter2}`;
128019
+ while (rootStore.nameManager.hasEntityWithName(name)) {
128020
+ counter2++;
128021
+ name = `${baseName}${counter2}`;
128022
+ }
128023
+ return name;
128024
+ };
128025
+ function getBinding({
128303
128026
  componentType,
128304
- parentElement,
128305
- primaryComponentName,
128306
- triggerComponentId
128027
+ editorTemplateCreateRequest,
128028
+ parentInfo
128307
128029
  }) {
128308
- if (componentType === "Modal") {
128309
- return {
128310
- parentElement,
128311
- tagName: "Button",
128312
- id: triggerComponentId,
128313
- properties: {
128314
- label: Property.Static("Open Modal"),
128315
- onClick: Property.Event([
128316
- {
128317
- id: "openModal",
128318
- type: TriggerStepType.CONTROL_MODAL,
128319
- name: primaryComponentName,
128320
- action: "open"
128321
- }
128322
- ])
128323
- },
128324
- children: []
128325
- };
128326
- } else if (componentType === "Slideout") {
128327
- return {
128328
- parentElement,
128329
- tagName: "Button",
128330
- id: triggerComponentId,
128331
- properties: {
128332
- label: Property.Static("Open Slideout"),
128333
- onClick: Property.Event([
128334
- {
128335
- id: "openSlideout",
128336
- type: TriggerStepType.CONTROL_SLIDEOUT,
128337
- name: primaryComponentName,
128338
- action: "open"
128339
- }
128340
- ])
128341
- },
128342
- children: []
128343
- };
128344
- }
128345
- throw new Error("Unhandled component type: " + componentType);
128346
- }
128347
- function getComponentBaseProperties(componentType, parentInfo) {
128348
- var _a2, _b2, _c2, _d2;
128349
128030
  const customComponents = rootStore.componentRegistry.customComponentList;
128350
- let properties2 = {};
128351
- let children = [];
128352
- const editorTemplates = rootStore.componentRegistry.getEditorTemplates(componentType);
128353
- if (editorTemplates && editorTemplates.length > 1) {
128354
- throw new Error(
128355
- `Multiple editor templates are not supported yet. Found ${editorTemplates.length} for component type: ${componentType}.`
128356
- );
128357
- }
128358
- const context2 = {
128359
- generateUniqueName: getUniqueName
128360
- };
128361
- const editorTemplateOnCreate = (_b2 = (_a2 = editorTemplates == null ? void 0 : editorTemplates[0]) == null ? void 0 : _a2.create) == null ? void 0 : _b2.call(_a2, context2);
128362
- if (editorTemplateOnCreate && Array.isArray(editorTemplateOnCreate)) {
128363
- throw new Error(
128364
- `Multiple creates for on editor template are not supported yet. Found ${editorTemplateOnCreate.length} for component type: ${componentType}.`
128365
- );
128366
- }
128367
- if (editorTemplateOnCreate && editorTemplateOnCreate.bind) {
128368
- properties2.name = Property.Static(editorTemplateOnCreate.bind);
128031
+ if ((editorTemplateCreateRequest == null ? void 0 : editorTemplateCreateRequest.generateBinding) === true) {
128032
+ return Property.Static(generateUniqueName(componentType));
128033
+ } else if (typeof (editorTemplateCreateRequest == null ? void 0 : editorTemplateCreateRequest.generateBinding) === "string") {
128034
+ return Property.Static(editorTemplateCreateRequest.generateBinding);
128369
128035
  } else {
128370
128036
  const shouldProvideAName = (
128371
- // TODO: migrate these components
128372
- componentType === "Dropdown" || componentType === "DatePicker" || componentType === "Checkbox" || componentType === "Switch" || componentType === "Modal" || componentType === "Slideout" || componentType === "Table" || // All components dropped in a grid
128037
+ // All components dropped in a grid
128373
128038
  parentInfo.isGridLike || // All custom components
128374
128039
  customComponents.includes(componentType)
128375
128040
  );
128376
128041
  if (shouldProvideAName) {
128377
- properties2.name = Property.Static(getUniqueName(componentType));
128042
+ return Property.Static(generateUniqueName(componentType));
128378
128043
  }
128044
+ return void 0;
128379
128045
  }
128380
- const isContainer = componentType === "Section" || componentType === "Column" || componentType === "Container" || componentType === "Modal" || componentType === "Slideout";
128381
- if (isContainer && componentType !== "Modal" && componentType !== "Slideout") {
128382
- properties2.width = Property.Dimension(Dim.fill());
128383
- }
128384
- switch (componentType) {
128385
- case "Text":
128386
- properties2.text = Property.Static("Hello, world!");
128387
- break;
128388
- case "Button":
128389
- properties2.label = Property.Static("Submit");
128390
- properties2.onClick = Property.Event([
128391
- {
128392
- type: TriggerStepType.RUN_JS,
128393
- code: "() => console.log('Button clicked')",
128394
- id: "buttonClick"
128395
- }
128396
- ]);
128397
- break;
128398
- case "Image":
128399
- properties2.src = Property.Static(
128400
- "https://lowcode.s3.us-west-2.amazonaws.com/eilish-billie.jpeg"
128401
- );
128402
- properties2.fillContainer = Property.Static(true);
128403
- properties2.width = parentInfo.isGridLike ? Property.Dimension(Dim.col(4)) : Property.Dimension(Dim.px(300));
128404
- properties2.height = Property.Dimension(Dim.fit());
128405
- break;
128406
- case "KeyValue":
128407
- properties2.sourceData = Property.Static({
128408
- id: 123,
128409
- name: "John Smith",
128410
- description: "John has been cardholder for 3 years",
128411
- createdDate: "10-23-2012"
128412
- });
128413
- properties2.propertiesOrder = Property.Static([
128414
- "id",
128415
- "name",
128416
- "description",
128417
- "createdDate"
128418
- ]);
128419
- properties2.properties = Property.Static({
128420
- id: {
128421
- id: "id",
128422
- key: "id",
128423
- type: KeyValuePropertyType.NUMBER,
128424
- isVisible: true,
128425
- isDerived: false
128426
- },
128427
- name: {
128428
- id: "name",
128429
- key: "name",
128430
- type: KeyValuePropertyType.TEXT,
128431
- isVisible: true,
128432
- isDerived: false
128433
- },
128434
- description: {
128435
- id: "description",
128436
- key: "description",
128437
- type: KeyValuePropertyType.TEXT,
128438
- isVisible: true,
128439
- isDerived: false
128440
- },
128441
- createdDate: {
128442
- id: "createdDate",
128443
- key: "createdDate",
128444
- type: KeyValuePropertyType.DATE,
128445
- isVisible: true,
128446
- isDerived: false
128447
- }
128448
- });
128449
- break;
128450
- case "Dropdown":
128451
- properties2.label = Property.Static("Label");
128452
- properties2.options = Property.Computed([
128453
- { label: "All statuses", value: "all" },
128454
- { label: "Pending", value: "pending" },
128455
- { label: "Processing", value: "processing" },
128456
- { label: "Completed", value: "completed" },
128457
- { label: "Failed", value: "failed" },
128458
- { label: "Cancelled", value: "cancelled" },
128459
- { label: "Rejected", value: "rejected" },
128460
- { label: "On hold", value: "on_hold" }
128461
- ]);
128462
- break;
128463
- case "Modal":
128464
- children = getModalChildren((_c2 = properties2.name) == null ? void 0 : _c2.value);
128465
- break;
128466
- case "Slideout":
128467
- children = getSlideoutChildren();
128468
- break;
128469
- case "Checkbox":
128470
- properties2.label = Property.Static("Label");
128471
- break;
128472
- case "DatePicker":
128473
- properties2.label = Property.Static("Label");
128474
- properties2.defaultDate = Property.Static((/* @__PURE__ */ new Date()).toISOString());
128475
- break;
128476
- case "Switch":
128477
- properties2.label = Property.Static("Label");
128478
- break;
128479
- case "Section":
128480
- children = getSectionChildren();
128481
- break;
128482
- case "Table":
128483
- properties2.tableData = Property.Static(DEFAULT_TABLE_DATA);
128484
- properties2.columns = Property.Static(DEFAULT_TABLE_COLUMNS);
128485
- properties2.header = Property.Static("Customers");
128486
- properties2.searchPlaceholder = Property.Static("Search...");
128487
- break;
128046
+ }
128047
+ function getComponentBaseProperties(componentType, parentInfo, editorTemplateCreateRequest) {
128048
+ let properties2 = {};
128049
+ const editorTemplates = rootStore.componentRegistry.getEditorTemplates(componentType);
128050
+ if (editorTemplates && editorTemplates.length > 1) {
128051
+ throw new Error(
128052
+ `Multiple editor templates are not supported yet. Found ${editorTemplates.length} for component type: ${componentType}.`
128053
+ );
128488
128054
  }
128489
- if (editorTemplateOnCreate == null ? void 0 : editorTemplateOnCreate.properties) {
128055
+ if (editorTemplateCreateRequest == null ? void 0 : editorTemplateCreateRequest.properties) {
128490
128056
  properties2 = {
128491
128057
  ...properties2,
128492
- ...editorTemplateOnCreate.properties
128058
+ ...editorTemplateCreateRequest.properties
128493
128059
  };
128494
128060
  }
128061
+ const binding = getBinding({
128062
+ componentType,
128063
+ editorTemplateCreateRequest,
128064
+ parentInfo
128065
+ });
128066
+ if (binding) {
128067
+ properties2.name = binding;
128068
+ }
128495
128069
  const { width, height, ...restProperties } = properties2;
128496
128070
  const safeDimensions = parentInfo.isGridLike ? filterSafeGridDimensionProperties({
128497
128071
  width: width == null ? void 0 : width.value,
@@ -128505,20 +128079,9 @@ function getComponentBaseProperties(componentType, parentInfo) {
128505
128079
  ...restProperties,
128506
128080
  ...safeDimensions
128507
128081
  },
128508
- children,
128509
- name: (_d2 = properties2.name) == null ? void 0 : _d2.value
128082
+ children: (editorTemplateCreateRequest == null ? void 0 : editorTemplateCreateRequest.children) ?? []
128510
128083
  };
128511
128084
  }
128512
- const getUniqueName = (componentType) => {
128513
- const baseName = componentType;
128514
- let counter2 = 1;
128515
- let name = `${baseName}${counter2}`;
128516
- while (rootStore.nameManager.hasEntityWithName(name)) {
128517
- counter2++;
128518
- name = `${baseName}${counter2}`;
128519
- }
128520
- return name;
128521
- };
128522
128085
  function checkComponentForParentTypeBeforeCreating(componentType, parentType) {
128523
128086
  if (componentType === "Section" && parentType !== "Page") {
128524
128087
  return false;
@@ -128528,14 +128091,35 @@ function checkComponentForParentTypeBeforeCreating(componentType, parentType) {
128528
128091
  }
128529
128092
  return true;
128530
128093
  }
128094
+ function getCreateAtParentElement(relativeParent, createAt) {
128095
+ if (createAt === "root") {
128096
+ const parentInstanceId = getEditStore().runtimeEntitiesManager.widgets.getAnyInstanceIdForSourceId(
128097
+ relativeParent.id
128098
+ );
128099
+ const pageComponent = getEditStore().runtimeEntitiesManager.getClosestAncestorByType(
128100
+ parentInstanceId,
128101
+ "Page"
128102
+ );
128103
+ if (!pageComponent) {
128104
+ throw new Error(
128105
+ `Page component not found for parent: ${relativeParent.id}`
128106
+ );
128107
+ }
128108
+ return { source: { id: pageComponent.sourceId } };
128109
+ } else {
128110
+ return { source: relativeParent };
128111
+ }
128112
+ }
128531
128113
  async function createComponent({
128532
128114
  componentType,
128533
128115
  parent,
128534
128116
  scopeName,
128535
128117
  baseProperties = {},
128536
- skipTriggerCreation,
128118
+ skipSecondaryComponentsCreation,
128119
+ // will only create the primary component. Secondary components are usually trigger components (e.g: Button that triggers the modal)
128537
128120
  otherComponentsUpdates
128538
128121
  }) {
128122
+ var _a2, _b2;
128539
128123
  const parentInfo = getParentInfo(parent);
128540
128124
  if (!checkComponentForParentTypeBeforeCreating(componentType, parentInfo.type)) {
128541
128125
  console.error(
@@ -128543,88 +128127,106 @@ async function createComponent({
128543
128127
  );
128544
128128
  return;
128545
128129
  }
128546
- const willWrapInSectionAndColumn = shouldWrapInSectionAndColumn(
128547
- componentType,
128548
- parentInfo.type
128549
- );
128550
- const isGridLike = willWrapInSectionAndColumn && componentType !== "Column" ? true : parentInfo.isGridLike;
128551
- const tagName = componentType;
128552
- const {
128553
- properties: propertiesFromType,
128554
- children,
128555
- name
128556
- } = getComponentBaseProperties(componentType, {
128557
- // will wrap in a column with grid layout if dropping on a page or section directly
128558
- isGridLike
128559
- });
128560
- const properties2 = {
128561
- ...propertiesFromType,
128562
- ...baseProperties
128563
- };
128564
- const parentElement = { source: parent };
128565
- const isDetachedComponent = DetachedComponentTypes.has(componentType);
128566
- const needTriggerComponent = isDetachedComponent && !skipTriggerCreation;
128130
+ const editorTemplates = rootStore.componentRegistry.getEditorTemplates(componentType);
128131
+ if (editorTemplates && editorTemplates.length > 1) {
128132
+ throw new Error(
128133
+ `Multiple editor templates are not supported yet. Found ${editorTemplates.length} for component type: ${componentType}.`
128134
+ );
128135
+ }
128136
+ const context2 = {
128137
+ generateUniqueName,
128138
+ parentInfo
128139
+ };
128140
+ const editorTemplateCreateRequest = (_b2 = (_a2 = editorTemplates == null ? void 0 : editorTemplates[0]) == null ? void 0 : _a2.create) == null ? void 0 : _b2.call(_a2, context2);
128141
+ const primaryEditorTemplateCreateRequest = Array.isArray(
128142
+ editorTemplateCreateRequest
128143
+ ) ? editorTemplateCreateRequest[0] : editorTemplateCreateRequest;
128144
+ if (editorTemplateCreateRequest && (primaryEditorTemplateCreateRequest == null ? void 0 : primaryEditorTemplateCreateRequest.type) !== componentType) {
128145
+ throw new Error(
128146
+ `When defining a ${Array.isArray(editorTemplateCreateRequest) ? "multiple" : "single"} component to be created on an EditorTemplate, the type must match with the component being created. got: ${primaryEditorTemplateCreateRequest == null ? void 0 : primaryEditorTemplateCreateRequest.type} when it should have been ${componentType}`
128147
+ );
128148
+ }
128149
+ const editorTemplateCreateRequests = Array.isArray(
128150
+ editorTemplateCreateRequest
128151
+ ) ? editorTemplateCreateRequest : [editorTemplateCreateRequest];
128567
128152
  const editStore2 = getEditStore();
128568
- const parentInstanceId = editStore2.runtimeEntitiesManager.widgets.getAnyInstanceIdForSourceId(
128569
- parent.id
128570
- );
128571
- const pageComponent = editStore2.runtimeEntitiesManager.getClosestAncestorByType(
128572
- parentInstanceId,
128573
- "Page"
128574
- );
128575
- const pageSource = {
128576
- source: {
128577
- id: pageComponent == null ? void 0 : pageComponent.sourceId
128578
- }
128579
- };
128580
- let primaryComponent = {
128581
- parentElement: isDetachedComponent ? pageSource : parentElement,
128582
- tagName,
128583
- properties: properties2,
128584
- children,
128585
- scopeName,
128586
- id: editStore2.operationManager.generateSourceId()
128587
- };
128588
- if (willWrapInSectionAndColumn) {
128589
- primaryComponent = wrapInSectionColumnIfDroppingOnPage(
128590
- primaryComponent,
128153
+ function editorTemplateCreateRequestToInternalCreateRequest({
128154
+ editorTemplateCreateRequest: editorTemplateCreateRequest2,
128155
+ baseProperties: baseProperties2
128156
+ }) {
128157
+ const type5 = (editorTemplateCreateRequest2 == null ? void 0 : editorTemplateCreateRequest2.type) ?? componentType;
128158
+ const willWrapInSectionAndColumn = shouldWrapInSectionAndColumn(
128159
+ type5,
128591
128160
  parentInfo.type
128592
128161
  );
128162
+ const isGridLike = willWrapInSectionAndColumn && type5 !== "Column" ? true : parentInfo.isGridLike;
128163
+ const { properties: propertiesFromType, children } = getComponentBaseProperties(
128164
+ type5,
128165
+ {
128166
+ // will wrap in a column with grid layout if dropping on a page or section directly
128167
+ isGridLike
128168
+ },
128169
+ editorTemplateCreateRequest2
128170
+ );
128171
+ const properties2 = {
128172
+ ...propertiesFromType,
128173
+ ...baseProperties2
128174
+ };
128175
+ const createAtParentElement = getCreateAtParentElement(
128176
+ parent,
128177
+ editorTemplateCreateRequest2 == null ? void 0 : editorTemplateCreateRequest2.createAt
128178
+ );
128179
+ let primaryComponent = {
128180
+ parentElement: createAtParentElement,
128181
+ tagName: type5,
128182
+ properties: properties2,
128183
+ children,
128184
+ scopeName,
128185
+ id: editStore2.operationManager.generateSourceId()
128186
+ };
128187
+ if (willWrapInSectionAndColumn) {
128188
+ primaryComponent = wrapInSectionColumnIfDroppingOnPage(
128189
+ primaryComponent,
128190
+ parentInfo.type
128191
+ );
128192
+ }
128193
+ return primaryComponent;
128593
128194
  }
128594
- const performOtherComponentsUpdates = (otherComponentsUpdates2) => {
128595
- Object.entries(otherComponentsUpdates2).forEach(([sourceId, updates]) => {
128596
- editStore2.operationManager.setWidgetProperties({
128597
- sourceId,
128598
- properties: updates
128195
+ const createRequests = editorTemplateCreateRequests.map(
128196
+ (editorTemplateCreateRequest2, index2) => editorTemplateCreateRequestToInternalCreateRequest({
128197
+ editorTemplateCreateRequest: editorTemplateCreateRequest2,
128198
+ baseProperties: index2 === 0 ? baseProperties : {}
128199
+ // baseProperties are only applied to the primary component
128200
+ })
128201
+ );
128202
+ const hasOtherComponentsUpdates = otherComponentsUpdates && Object.keys(otherComponentsUpdates).length > 0;
128203
+ const hasMultipleCreateComponents = editorTemplateCreateRequests.length > 1 && !skipSecondaryComponentsCreation;
128204
+ const isBatchOperation = hasOtherComponentsUpdates || hasMultipleCreateComponents;
128205
+ if (isBatchOperation) {
128206
+ const performOtherComponentsUpdates = (otherComponentsUpdates2) => {
128207
+ Object.entries(otherComponentsUpdates2).forEach(([sourceId, updates]) => {
128208
+ editStore2.operationManager.setWidgetProperties({
128209
+ sourceId,
128210
+ properties: updates
128211
+ });
128599
128212
  });
128600
- });
128601
- };
128602
- if (needTriggerComponent) {
128603
- const triggerComponent = getTriggerComponent({
128604
- componentType,
128605
- parentElement,
128606
- primaryComponentName: name,
128607
- triggerComponentId: editStore2.operationManager.generateSourceId()
128608
- });
128213
+ };
128609
128214
  editStore2.operationManager.batchUpdate(() => {
128610
- editStore2.operationManager.createComponent(triggerComponent);
128611
- editStore2.operationManager.createComponent(primaryComponent);
128612
- if (otherComponentsUpdates) {
128215
+ if (skipSecondaryComponentsCreation) {
128216
+ editStore2.operationManager.createComponent(createRequests[0]);
128217
+ } else {
128218
+ createRequests.forEach((createRequest) => {
128219
+ editStore2.operationManager.createComponent(createRequest);
128220
+ });
128221
+ }
128222
+ if (hasOtherComponentsUpdates) {
128613
128223
  performOtherComponentsUpdates(otherComponentsUpdates);
128614
128224
  }
128615
128225
  });
128616
- return triggerComponent.id;
128617
128226
  } else {
128618
- if (otherComponentsUpdates) {
128619
- editStore2.operationManager.batchUpdate(() => {
128620
- editStore2.operationManager.createComponent(primaryComponent);
128621
- performOtherComponentsUpdates(otherComponentsUpdates);
128622
- });
128623
- } else {
128624
- editStore2.operationManager.createComponent(primaryComponent);
128625
- }
128626
- return primaryComponent.id;
128227
+ editStore2.operationManager.createComponent(createRequests[0]);
128627
128228
  }
128229
+ return createRequests.at(-1).id;
128628
128230
  }
128629
128231
  function wrapInSectionColumnIfDroppingOnPage(primaryComponent, parentType) {
128630
128232
  const { properties: sectionProperties } = getComponentBaseProperties(
@@ -130850,6 +130452,21 @@ function useTypographyStyling({
130850
130452
  style: style2
130851
130453
  };
130852
130454
  }
130455
+ const editorTemplate$c = {
130456
+ create: () => ({
130457
+ type: "Button",
130458
+ properties: {
130459
+ label: Property.Static("Button"),
130460
+ onClick: Property.Event([
130461
+ {
130462
+ type: TriggerStepType.RUN_JS,
130463
+ code: "() => console.log('Button clicked')",
130464
+ id: "buttonClick"
130465
+ }
130466
+ ])
130467
+ }
130468
+ })
130469
+ };
130853
130470
  const DEFAULT_ICON_SPACING = 8;
130854
130471
  const DEFAULT_ICON_SIZE = 16;
130855
130472
  const ICON_POSITION_OPTIONS = [
@@ -131400,7 +131017,7 @@ const Button$3 = registerComponent$1(
131400
131017
  }
131401
131018
  ) });
131402
131019
  }
131403
- );
131020
+ ).addEditorTemplate(editorTemplate$c);
131404
131021
  const useAlignmentStyles = ({
131405
131022
  layout,
131406
131023
  verticalAlign,
@@ -131802,6 +131419,29 @@ const InternalVStack = (props2) => {
131802
131419
  const InternalHStack = (props2) => {
131803
131420
  return /* @__PURE__ */ jsxRuntimeExports.jsx(InternalStack, { direction: "row", ...props2 });
131804
131421
  };
131422
+ function getSectionChildren() {
131423
+ return [
131424
+ {
131425
+ tagName: "Column",
131426
+ properties: {
131427
+ width: Property.Dimension(Dim.fill()),
131428
+ height: Property.Dimension(Dim.fill())
131429
+ },
131430
+ children: []
131431
+ }
131432
+ ];
131433
+ }
131434
+ const editorTemplate$b = {
131435
+ create: () => {
131436
+ return {
131437
+ type: "Section",
131438
+ children: getSectionChildren(),
131439
+ properties: {
131440
+ width: Property.Dimension(Dim.fill())
131441
+ }
131442
+ };
131443
+ }
131444
+ };
131805
131445
  const DEFAULT_SECTION_PADDING = {
131806
131446
  left: Dim.px(0),
131807
131447
  right: Dim.px(0),
@@ -131878,7 +131518,7 @@ const Section2 = registerComponent$1(
131878
131518
  }
131879
131519
  );
131880
131520
  }
131881
- );
131521
+ ).addEditorTemplate(editorTemplate$b);
131882
131522
  const generateClassName = (seed2) => {
131883
131523
  return `superblocks_widget_${seed2}`;
131884
131524
  };
@@ -132188,6 +131828,14 @@ const StaticComponent = ({
132188
131828
  }, [staticHeight]);
132189
131829
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { ...style2, width: "100%", height: "100%" }, children });
132190
131830
  };
131831
+ const editorTemplate$a = {
131832
+ create: () => ({
131833
+ type: "Container",
131834
+ properties: {
131835
+ width: Property.Dimension(Dim.fill())
131836
+ }
131837
+ })
131838
+ };
132191
131839
  const propertiesDefinition$g = {
132192
131840
  layout: Section$1.category(PropsPanelCategory.Layout).add(
132193
131841
  containerLayout({
@@ -132350,7 +131998,15 @@ const Container = registerComponent$1(
132350
131998
  propertiesDefinition: propertiesDefinition$g
132351
131999
  },
132352
132000
  InternalContainer
132353
- );
132001
+ ).addEditorTemplate(editorTemplate$a);
132002
+ const editorTemplate$9 = {
132003
+ create: () => ({
132004
+ type: "Container",
132005
+ properties: {
132006
+ width: Property.Dimension(Dim.fill())
132007
+ }
132008
+ })
132009
+ };
132354
132010
  const propertiesDefinition$f = {
132355
132011
  layout: Section$1.category(PropsPanelCategory.Layout).add(
132356
132012
  containerLayout({
@@ -132416,11 +132072,11 @@ const Column = registerComponent$1(
132416
132072
  }
132417
132073
  );
132418
132074
  }
132419
- );
132420
- const editorTemplate = {
132421
- create: (context2) => ({
132075
+ ).addEditorTemplate(editorTemplate$9);
132076
+ const editorTemplate$8 = {
132077
+ create: () => ({
132422
132078
  type: "Input",
132423
- bind: context2.generateUniqueName("Input"),
132079
+ generateBinding: true,
132424
132080
  properties: {
132425
132081
  label: Property.Static("Label")
132426
132082
  }
@@ -140090,7 +139746,7 @@ const Input2 = registerComponent$1(
140090
139746
  }
140091
139747
  ) });
140092
139748
  }
140093
- ).addEditorTemplate(editorTemplate);
139749
+ ).addEditorTemplate(editorTemplate$8);
140094
139750
  const propertiesDefinition$d = {
140095
139751
  contents: Section$1.category(PropsPanelCategory.Content).children({
140096
139752
  columns: Prop.array().readAndWrite().propertiesPanel({
@@ -141959,6 +141615,14 @@ const AutolinkedText = (props2) => {
141959
141615
  }
141960
141616
  );
141961
141617
  };
141618
+ const editorTemplate$7 = {
141619
+ create: () => ({
141620
+ type: "Text",
141621
+ properties: {
141622
+ text: Property.Static("Hello, world!")
141623
+ }
141624
+ })
141625
+ };
141962
141626
  var button$1 = {};
141963
141627
  var interopRequireDefault = { exports: {} };
141964
141628
  var hasRequiredInteropRequireDefault;
@@ -147156,7 +146820,7 @@ const Text$1 = registerComponent$1(
147156
146820
  }
147157
146821
  ) });
147158
146822
  }
147159
- );
146823
+ ).addEditorTemplate(editorTemplate$7);
147160
146824
  function useDialogEditing(props2) {
147161
146825
  const { isOpen, instanceId } = props2;
147162
146826
  const { features, isEditing } = useEditor();
@@ -147220,6 +146884,102 @@ function useDialogEditing(props2) {
147220
146884
  prevIsOpenRef.current = isOpen;
147221
146885
  }, [isOpen]);
147222
146886
  }
146887
+ function getChildren$1(modalName) {
146888
+ return [
146889
+ {
146890
+ tagName: "Container",
146891
+ properties: {
146892
+ variant: Property.Static("none"),
146893
+ width: Property.Dimension(Dim.fill()),
146894
+ layout: Property.Static("horizontal"),
146895
+ horizontalAlign: Property.Static("left")
146896
+ },
146897
+ children: [
146898
+ {
146899
+ tagName: "Text",
146900
+ properties: {
146901
+ text: Property.Static("Modal Title"),
146902
+ textStyle: Property.Static({
146903
+ variant: "heading3"
146904
+ })
146905
+ },
146906
+ children: []
146907
+ }
146908
+ ]
146909
+ },
146910
+ {
146911
+ tagName: "Container",
146912
+ properties: {
146913
+ variant: Property.Static("none"),
146914
+ width: Property.Dimension(Dim.fill()),
146915
+ horizontalAlign: Property.Static("left")
146916
+ },
146917
+ children: []
146918
+ },
146919
+ {
146920
+ tagName: "Container",
146921
+ properties: {
146922
+ spacing: Property.Dimension(Dim.px(8)),
146923
+ width: Property.Dimension(Dim.fill()),
146924
+ variant: Property.Static("none"),
146925
+ layout: Property.Static("horizontal"),
146926
+ horizontalAlign: Property.Static("right")
146927
+ },
146928
+ children: [
146929
+ {
146930
+ tagName: "Button",
146931
+ properties: {
146932
+ label: Property.Static("Cancel"),
146933
+ variant: Property.Static("secondary"),
146934
+ onClick: Property.Event([
146935
+ {
146936
+ id: "closeModal",
146937
+ type: TriggerStepType.CONTROL_MODAL,
146938
+ name: modalName,
146939
+ action: "close"
146940
+ }
146941
+ ])
146942
+ },
146943
+ children: []
146944
+ },
146945
+ {
146946
+ tagName: "Button",
146947
+ properties: {
146948
+ label: Property.Static("Confirm")
146949
+ },
146950
+ children: []
146951
+ }
146952
+ ]
146953
+ }
146954
+ ];
146955
+ }
146956
+ const editorTemplate$6 = {
146957
+ create: (context2) => {
146958
+ const modalName = context2.generateUniqueName("Modal");
146959
+ return [
146960
+ {
146961
+ type: "Modal",
146962
+ generateBinding: modalName,
146963
+ children: getChildren$1(modalName),
146964
+ createAt: "root"
146965
+ },
146966
+ {
146967
+ type: "Button",
146968
+ properties: {
146969
+ label: Property.Static("Open Modal"),
146970
+ onClick: Property.Event([
146971
+ {
146972
+ id: "openModal",
146973
+ type: TriggerStepType.CONTROL_MODAL,
146974
+ name: modalName,
146975
+ action: "open"
146976
+ }
146977
+ ])
146978
+ }
146979
+ }
146980
+ ];
146981
+ }
146982
+ };
147223
146983
  const MODAL_BORDER_RADIUS = 4;
147224
146984
  const MODAL_WIDTH_PRESETS = {
147225
146985
  // in percentages
@@ -147565,7 +147325,70 @@ const Modal = registerComponent$1(
147565
147325
  }
147566
147326
  );
147567
147327
  }
147568
- );
147328
+ ).addEditorTemplate(editorTemplate$6);
147329
+ function getChildren() {
147330
+ return [
147331
+ {
147332
+ tagName: "Container",
147333
+ properties: {
147334
+ variant: Property.Static("none"),
147335
+ width: Property.Dimension(Dim.fill()),
147336
+ layout: Property.Static("horizontal"),
147337
+ horizontalAlign: Property.Static("left")
147338
+ },
147339
+ children: [
147340
+ {
147341
+ tagName: "Text",
147342
+ properties: {
147343
+ text: Property.Static("Slideout Title"),
147344
+ textStyle: Property.Static({
147345
+ variant: "heading3"
147346
+ })
147347
+ },
147348
+ children: []
147349
+ }
147350
+ ]
147351
+ },
147352
+ {
147353
+ tagName: "Container",
147354
+ properties: {
147355
+ variant: Property.Static("none"),
147356
+ width: Property.Dimension(Dim.fill()),
147357
+ height: Property.Dimension(Dim.fill()),
147358
+ horizontalAlign: Property.Static("left"),
147359
+ layout: Property.Static("vertical")
147360
+ },
147361
+ children: []
147362
+ }
147363
+ ];
147364
+ }
147365
+ const editorTemplate$5 = {
147366
+ create: (context2) => {
147367
+ const slideoutName = context2.generateUniqueName("Slideout");
147368
+ return [
147369
+ {
147370
+ type: "Slideout",
147371
+ generateBinding: slideoutName,
147372
+ children: getChildren(),
147373
+ createAt: "root"
147374
+ },
147375
+ {
147376
+ type: "Button",
147377
+ properties: {
147378
+ label: Property.Static("Open Slideout"),
147379
+ onClick: Property.Event([
147380
+ {
147381
+ id: "openSlideout",
147382
+ type: TriggerStepType.CONTROL_SLIDEOUT,
147383
+ name: slideoutName,
147384
+ action: "open"
147385
+ }
147386
+ ])
147387
+ }
147388
+ }
147389
+ ];
147390
+ }
147391
+ };
147569
147392
  const SlideoutSize = {
147570
147393
  xsmall: "xsmall",
147571
147394
  small: "small",
@@ -149919,7 +149742,7 @@ const Slideout = registerComponent$1(
149919
149742
  }
149920
149743
  );
149921
149744
  }
149922
- );
149745
+ ).addEditorTemplate(editorTemplate$5);
149923
149746
  const RowDensity = {
149924
149747
  "extra-small": "extra-small",
149925
149748
  small: "small",
@@ -150096,6 +149919,196 @@ const tagColorPalette = [
150096
149919
  "#9D585833",
150097
149920
  "#FF484833"
150098
149921
  ];
149922
+ const DEFAULT_TABLE_DATA = [
149923
+ {
149924
+ photo: "https://cdn.superblocks.com/sample-data/rachel_kim.jpg",
149925
+ name: "Rachel Kim",
149926
+ email: "rachel.kim89@gmail.com",
149927
+ role: "Vendor Partner",
149928
+ company: "Urban Threads Co.",
149929
+ status: "Active",
149930
+ date_joined: "2023-04-12",
149931
+ last_activity: "2025-06-07T16:20:00Z"
149932
+ },
149933
+ {
149934
+ photo: "https://cdn.superblocks.com/sample-data/daniel_vargas.jpg",
149935
+ name: "Daniel Vargas",
149936
+ email: "dvargas1984@yahoo.com",
149937
+ role: "Logistics Contact",
149938
+ company: "Vargas Freight Ltd.",
149939
+ status: "Pending",
149940
+ date_joined: "2024-01-23",
149941
+ last_activity: "2025-05-30T13:45:00Z"
149942
+ },
149943
+ {
149944
+ photo: "https://cdn.superblocks.com/sample-data/sophie_liu.jpg",
149945
+ name: "Sophie Liu",
149946
+ email: "sophie.liu.personal@gmail.com",
149947
+ role: "Retail Manager",
149948
+ company: "Modern Goods",
149949
+ status: "Active",
149950
+ date_joined: "2022-09-10",
149951
+ last_activity: "2025-06-08T09:03:00Z"
149952
+ },
149953
+ {
149954
+ photo: "https://cdn.superblocks.com/sample-data/omar_el-sayed.jpg",
149955
+ name: "Omar El-Sayed",
149956
+ email: "omarsayed78@hotmail.com",
149957
+ role: "Accounts Payable",
149958
+ company: "Sayed Textiles",
149959
+ status: "Inactive",
149960
+ date_joined: "2021-06-05",
149961
+ last_activity: "2024-12-18T11:40:00Z"
149962
+ },
149963
+ {
149964
+ photo: "https://cdn.superblocks.com/sample-data/grace_nguyen.jpg",
149965
+ name: "Grace Nguyen",
149966
+ email: "gracenguyen23@icloud.com",
149967
+ role: "Product Supplier",
149968
+ company: "Green Earth Supplies",
149969
+ status: "Active",
149970
+ date_joined: "2023-11-03",
149971
+ last_activity: "2025-06-08T17:28:00Z"
149972
+ },
149973
+ {
149974
+ photo: "https://cdn.superblocks.com/sample-data/alex_romero.jpg",
149975
+ name: "Alex Romero",
149976
+ email: "alex.romero@gmail.com",
149977
+ role: "Client Account Owner",
149978
+ company: "Romero & Co.",
149979
+ status: "Suspended",
149980
+ date_joined: "2022-02-28",
149981
+ last_activity: "2025-03-11T08:20:00Z"
149982
+ },
149983
+ {
149984
+ photo: "https://cdn.superblocks.com/sample-data/lena_schmidt.jpg",
149985
+ name: "Lena Schmidt",
149986
+ email: "lena_schmidt92@gmx.de",
149987
+ role: "Wholesale Contact",
149988
+ company: "Schmidt Imports",
149989
+ status: "Active",
149990
+ date_joined: "2021-12-01",
149991
+ last_activity: "2025-06-06T21:10:00Z"
149992
+ },
149993
+ {
149994
+ photo: "https://cdn.superblocks.com/sample-data/devon_price.jpg",
149995
+ name: "Devon Price",
149996
+ email: "devon.price22@aol.com",
149997
+ role: "Fulfillment Liaison",
149998
+ company: "DepotLink",
149999
+ status: "Active",
150000
+ date_joined: "2024-05-17",
150001
+ last_activity: "2025-06-08T10:42:00Z"
150002
+ },
150003
+ {
150004
+ photo: "https://cdn.superblocks.com/sample-data/isabella_rossi.jpg",
150005
+ name: "Isabella Rossi",
150006
+ email: "bella.rossi@gmail.com",
150007
+ role: "Procurement Agent",
150008
+ company: "Rossi Global Sourcing",
150009
+ status: "Pending",
150010
+ date_joined: "2023-07-19",
150011
+ last_activity: "2025-05-29T14:05:00Z"
150012
+ },
150013
+ {
150014
+ photo: "https://cdn.superblocks.com/sample-data/tariq_khan.jpg",
150015
+ name: "Tariq Khan",
150016
+ email: "tariq.khan92@protonmail.com",
150017
+ role: "International Ops Lead",
150018
+ company: "CrossPort Trade Inc.",
150019
+ status: "Active",
150020
+ date_joined: "2022-11-08",
150021
+ last_activity: "2025-06-08T16:11:00Z"
150022
+ },
150023
+ {
150024
+ photo: "https://cdn.superblocks.com/sample-data/emily_zhang.jpg",
150025
+ name: "Emily Zhang",
150026
+ email: "emilyzhang.home@gmail.com",
150027
+ role: "Logistics Coordinator",
150028
+ company: "Zhang Export Ltd.",
150029
+ status: "Active",
150030
+ date_joined: "2023-03-12",
150031
+ last_activity: "2025-06-08T19:02:00Z"
150032
+ }
150033
+ ];
150034
+ const DEFAULT_TABLE_COLUMNS = {
150035
+ name: {
150036
+ columnType: "text",
150037
+ label: "Name"
150038
+ },
150039
+ email: {
150040
+ columnType: "email",
150041
+ label: "Email"
150042
+ },
150043
+ role: {
150044
+ columnType: "text",
150045
+ label: "Role"
150046
+ },
150047
+ company: {
150048
+ columnType: "text",
150049
+ label: "Company"
150050
+ },
150051
+ status: {
150052
+ columnType: "tags",
150053
+ tagDisplayConfig: {
150054
+ Active: {
150055
+ color: "#14CDB733"
150056
+ },
150057
+ Pending: {
150058
+ color: "#FF9F3533"
150059
+ },
150060
+ Inactive: {
150061
+ color: "#a6a0a033"
150062
+ },
150063
+ Suspended: {
150064
+ color: "#FF62A433"
150065
+ }
150066
+ },
150067
+ label: "Status"
150068
+ },
150069
+ date_joined: {
150070
+ columnType: "date",
150071
+ inputFormat: "YYYY-MM-DD",
150072
+ outputFormat: "MM-DD-YYYY",
150073
+ label: "Date joined"
150074
+ },
150075
+ last_activity: {
150076
+ columnType: "date",
150077
+ inputFormat: "YYYY-MM-DDTHH:mm:ssZ",
150078
+ outputFormat: "MM-DD-YYYY",
150079
+ label: "Last activity"
150080
+ },
150081
+ photo: {
150082
+ columnType: "image",
150083
+ label: "Photo",
150084
+ imageBorderRadius: {
150085
+ topLeft: Dim.px(16),
150086
+ topRight: Dim.px(16),
150087
+ bottomLeft: Dim.px(16),
150088
+ bottomRight: Dim.px(16)
150089
+ }
150090
+ }
150091
+ };
150092
+ const DEFAULT_TABLE_KEYS = Object.keys(DEFAULT_TABLE_COLUMNS);
150093
+ const CLEARED_TABLE_COLUMNS = DEFAULT_TABLE_KEYS.reduce(
150094
+ (acc, key2) => {
150095
+ acc[key2] = void 0;
150096
+ return acc;
150097
+ },
150098
+ {}
150099
+ );
150100
+ const editorTemplate$4 = {
150101
+ create: () => ({
150102
+ type: "Table",
150103
+ generateBinding: true,
150104
+ properties: {
150105
+ tableData: Property.Static(DEFAULT_TABLE_DATA),
150106
+ columns: Property.Static(DEFAULT_TABLE_COLUMNS),
150107
+ header: Property.Static("Customers"),
150108
+ searchPlaceholder: Property.Static("Search...")
150109
+ }
150110
+ })
150111
+ };
150099
150112
  const CurrencyList = CC.getCodes();
150100
150113
  const tableColumnTypes = [
150101
150114
  {
@@ -159787,14 +159800,14 @@ function getLoaderFn(options) {
159787
159800
  if (!(loader === "all")) return [3, 3];
159788
159801
  return [4, import(
159789
159802
  /* webpackChunkName: "blueprint-icons-all-paths-loader" */
159790
- "./allPathsLoader-C0am3WW9.js"
159803
+ "./allPathsLoader-BYewEWVh.js"
159791
159804
  )];
159792
159805
  case 2:
159793
159806
  return [2, _b2.sent().allPathsLoader];
159794
159807
  case 3:
159795
159808
  return [4, import(
159796
159809
  /* webpackChunkName: "blueprint-icons-split-paths-by-size-loader" */
159797
- "./splitPathsBySizeLoader-Co86rhhm.js"
159810
+ "./splitPathsBySizeLoader-2oYHBTYy.js"
159798
159811
  )];
159799
159812
  case 4:
159800
159813
  return [2, _b2.sent().splitPathsBySizeLoader];
@@ -191486,7 +191499,7 @@ const Table = registerComponent$1(
191486
191499
  }
191487
191500
  ) });
191488
191501
  }
191489
- );
191502
+ ).addEditorTemplate(editorTemplate$4);
191490
191503
  var NS = getClassNamespace$1();
191491
191504
  var MULTISELECT = "".concat(NS, "-multi-select");
191492
191505
  var MULTISELECT_POPOVER = "".concat(MULTISELECT, "-popover");
@@ -195108,6 +195121,25 @@ const ListItemRenderer = (itemProps) => {
195108
195121
  ) }, itemProps.index);
195109
195122
  };
195110
195123
  ListItemRenderer.displayName = "SelectListItemRenderer";
195124
+ const editorTemplate$3 = {
195125
+ create: () => ({
195126
+ type: "Dropdown",
195127
+ generateBinding: true,
195128
+ properties: {
195129
+ label: Property.Static("Label"),
195130
+ options: Property.Computed([
195131
+ { label: "All statuses", value: "all" },
195132
+ { label: "Pending", value: "pending" },
195133
+ { label: "Processing", value: "processing" },
195134
+ { label: "Completed", value: "completed" },
195135
+ { label: "Failed", value: "failed" },
195136
+ { label: "Cancelled", value: "cancelled" },
195137
+ { label: "Rejected", value: "rejected" },
195138
+ { label: "On hold", value: "on_hold" }
195139
+ ])
195140
+ }
195141
+ })
195142
+ };
195111
195143
  const DropdownEntireObjectOption = "$$ENTIRE_OBJECT";
195112
195144
  const normalizeFunction$1 = (val, transformationValue) => {
195113
195145
  if (transformationValue === DropdownEntireObjectOption) {
@@ -195669,7 +195701,7 @@ const Dropdown = registerComponent$1(
195669
195701
  }
195670
195702
  ) }) });
195671
195703
  }
195672
- );
195704
+ ).addEditorTemplate(editorTemplate$3);
195673
195705
  const CustomComponent = registerComponent$1(
195674
195706
  "CustomComponent",
195675
195707
  {
@@ -195843,6 +195875,15 @@ class CheckboxComponent extends React__default.PureComponent {
195843
195875
  );
195844
195876
  }
195845
195877
  }
195878
+ const editorTemplate$2 = {
195879
+ create: () => ({
195880
+ type: "Checkbox",
195881
+ generateBinding: true,
195882
+ properties: {
195883
+ label: Property.Static("Label")
195884
+ }
195885
+ })
195886
+ };
195846
195887
  const propertiesDefinition$7 = {
195847
195888
  general: Section$1.category(PropsPanelCategory.Content).children({
195848
195889
  label: Prop.string().readAndWrite().default("").propertiesPanel({
@@ -195970,7 +196011,7 @@ const Checkbox = registerComponent$1(
195970
196011
  }
195971
196012
  ) });
195972
196013
  }
195973
- );
196014
+ ).addEditorTemplate(editorTemplate$2);
195974
196015
  const adjustDateFormatSideEffect = (params) => {
195975
196016
  const widgetMeta = params.widgetMeta;
195976
196017
  const widgetState = params.widgetState;
@@ -196344,6 +196385,15 @@ const DatePicker = registerComponent$1(
196344
196385
  ) });
196345
196386
  }
196346
196387
  );
196388
+ const editorTemplate$1 = {
196389
+ create: () => ({
196390
+ type: "Switch",
196391
+ generateBinding: true,
196392
+ properties: {
196393
+ label: Property.Static("Label")
196394
+ }
196395
+ })
196396
+ };
196347
196397
  const propertiesDefinition$5 = {
196348
196398
  general: Section$1.category(PropsPanelCategory.Content).children({
196349
196399
  label: Prop.string().readAndWrite().default("").propertiesPanel({
@@ -196629,10 +196679,10 @@ const Switch = registerComponent$1(
196629
196679
  props2.sourceId
196630
196680
  ) });
196631
196681
  }
196632
- );
196682
+ ).addEditorTemplate(editorTemplate$1);
196633
196683
  const propertiesDefinition$4 = {
196634
196684
  general: Section$1.category(PropsPanelCategory.Content).children({
196635
- icon: Prop.string().readAndWrite().default("info").propertiesPanel({
196685
+ icon: Prop.string().readAndWrite().propertiesPanel({
196636
196686
  label: "Icon",
196637
196687
  helpText: "Select an icon",
196638
196688
  controlType: "ICON_SELECTOR"
@@ -196720,6 +196770,19 @@ const Icon = registerComponent$1(
196720
196770
  );
196721
196771
  }
196722
196772
  );
196773
+ const editorTemplate = {
196774
+ create: (context2) => ({
196775
+ type: "Image",
196776
+ properties: {
196777
+ src: Property.Static(
196778
+ "https://lowcode.s3.us-west-2.amazonaws.com/eilish-billie.jpeg"
196779
+ ),
196780
+ fillContainer: Property.Static(true),
196781
+ width: context2.parentInfo.isGridLike ? Property.Dimension(Dim.col(4)) : Property.Dimension(Dim.px(300)),
196782
+ height: Property.Dimension(Dim.fit())
196783
+ }
196784
+ })
196785
+ };
196723
196786
  const StyledImage = qe$1.img`
196724
196787
  opacity: 0;
196725
196788
  pointer-events: none;
@@ -196951,7 +197014,7 @@ const Image = registerComponent$1(
196951
197014
  }
196952
197015
  ) });
196953
197016
  }
196954
- );
197017
+ ).addEditorTemplate(editorTemplate);
196955
197018
  const propertiesDefinition$2 = {
196956
197019
  general: Section$1.category(PropsPanelCategory.Uncategorized).propertiesPanel({ showHeader: false }).children({
196957
197020
  defaultValue: Prop.any().readAndWrite().propertiesPanel({
@@ -198073,7 +198136,7 @@ const EmbedWrapper$2 = (props2) => {
198073
198136
  parent,
198074
198137
  scopeName,
198075
198138
  baseProperties,
198076
- skipTriggerCreation,
198139
+ skipSecondaryComponentsCreation,
198077
198140
  otherComponentsUpdates
198078
198141
  } = event.data.payload;
198079
198142
  try {
@@ -198082,7 +198145,7 @@ const EmbedWrapper$2 = (props2) => {
198082
198145
  parent,
198083
198146
  scopeName,
198084
198147
  baseProperties,
198085
- skipTriggerCreation,
198148
+ skipSecondaryComponentsCreation,
198086
198149
  otherComponentsUpdates
198087
198150
  });
198088
198151
  } catch (error2) {
@@ -200707,4 +200770,4 @@ export {
200707
200770
  setQueryParams as y,
200708
200771
  download as z
200709
200772
  };
200710
- //# sourceMappingURL=index-CGJkVHjX.js.map
200773
+ //# sourceMappingURL=index-CH4jAtWn.js.map