@superblocksteam/library 2.0.6-next.39 → 2.0.6-next.4

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 (88) hide show
  1. package/dist/{allPaths-DrkZM5UN.js → allPaths-BtYOw5Ru.js} +2 -2
  2. package/dist/{allPaths-DrkZM5UN.js.map → allPaths-BtYOw5Ru.js.map} +1 -1
  3. package/dist/{allPaths-DtYnQ-yV.js → allPaths-CO-aWzss.js} +2 -2
  4. package/dist/{allPaths-DtYnQ-yV.js.map → allPaths-CO-aWzss.js.map} +1 -1
  5. package/dist/{allPathsLoader-Bt-mJXJw.js → allPathsLoader-B3Ii4JGL.js} +3 -3
  6. package/dist/{allPathsLoader-rDsLNp7q.js.map → allPathsLoader-B3Ii4JGL.js.map} +1 -1
  7. package/dist/{allPathsLoader-rDsLNp7q.js → allPathsLoader-KDCEbuYo.js} +3 -3
  8. package/dist/{allPathsLoader-Bt-mJXJw.js.map → allPathsLoader-KDCEbuYo.js.map} +1 -1
  9. package/dist/{devtools-consolidated-DaYe-zkb.js → devtools-consolidated-B1B3uBW_.js} +2 -2
  10. package/dist/{devtools-consolidated-DaYe-zkb.js.map → devtools-consolidated-B1B3uBW_.js.map} +1 -1
  11. package/dist/{icons-lSlfQ50w.js → icons-NrNO8p_u.js} +14 -10
  12. package/dist/icons-NrNO8p_u.js.map +1 -0
  13. package/dist/{index-D9O95zsr.js → index-kjgG33Rg.js} +1648 -799
  14. package/dist/{index-D9O95zsr.js.map → index-kjgG33Rg.js.map} +1 -1
  15. package/dist/index.js +2 -2
  16. package/dist/{splitPathsBySizeLoader-DCl0XfAP.js → splitPathsBySizeLoader-Btq5cpt-.js} +2 -2
  17. package/dist/{splitPathsBySizeLoader-DCl0XfAP.js.map → splitPathsBySizeLoader-Btq5cpt-.js.map} +1 -1
  18. package/dist/{splitPathsBySizeLoader-HDsWhSbE.js → splitPathsBySizeLoader-VThmaq3t.js} +2 -2
  19. package/dist/{splitPathsBySizeLoader-HDsWhSbE.js.map → splitPathsBySizeLoader-VThmaq3t.js.map} +1 -1
  20. package/dist-types/edit-mode/dnd/utils.d.ts +0 -4
  21. package/dist-types/edit-mode/iframe-wrappers.d.ts +0 -1
  22. package/dist-types/edit-mode/source-update-api.d.ts +0 -5
  23. package/dist-types/edit-mode/superblocks-editor-bridge.d.ts +0 -1
  24. package/dist-types/lib/internal-details/is-sb-component.d.ts +1 -5
  25. package/dist-types/lib/internal-details/lib/evaluator/base-entity-manager.d.ts +6 -6
  26. package/dist-types/lib/internal-details/lib/evaluator/compute-engines.d.ts +1 -2
  27. package/dist-types/lib/internal-details/lib/evaluator/lazy-function.d.ts +1 -2
  28. package/dist-types/lib/internal-details/lib/features/component-registry.d.ts +0 -5
  29. package/dist-types/lib/internal-details/lib/types.d.ts +0 -3
  30. package/dist-types/lib/triggers/implementations/state/reset-state-var.d.ts +3 -3
  31. package/dist-types/lib/triggers/implementations/state/set-state-var.d.ts +3 -3
  32. package/dist-types/lib/triggers/implementations/timers/control-timer.d.ts +3 -4
  33. package/dist-types/lib/triggers/registry.d.ts +6 -6
  34. package/dist-types/lib/user-facing/components/button/index.d.ts +26 -26
  35. package/dist-types/lib/user-facing/components/button/props.d.ts +26 -26
  36. package/dist-types/lib/user-facing/components/checkbox/index.d.ts +31 -31
  37. package/dist-types/lib/user-facing/components/checkbox/props.d.ts +31 -31
  38. package/dist-types/lib/user-facing/components/column/index.d.ts +19 -19
  39. package/dist-types/lib/user-facing/components/column/props.d.ts +19 -19
  40. package/dist-types/lib/user-facing/components/container/index.d.ts +21 -21
  41. package/dist-types/lib/user-facing/components/container/props.d.ts +21 -21
  42. package/dist-types/lib/user-facing/components/custom/register-custom-component.d.ts +9 -9
  43. package/dist-types/lib/user-facing/components/date-picker/index.d.ts +48 -48
  44. package/dist-types/lib/user-facing/components/date-picker/props.d.ts +48 -48
  45. package/dist-types/lib/user-facing/components/dropdown/index.d.ts +54 -54
  46. package/dist-types/lib/user-facing/components/dropdown/props.d.ts +54 -54
  47. package/dist-types/lib/user-facing/components/grid/index.d.ts +18 -20
  48. package/dist-types/lib/user-facing/components/grid/utils.d.ts +1 -0
  49. package/dist-types/lib/user-facing/components/icon/index.d.ts +13 -11
  50. package/dist-types/lib/user-facing/components/icon/props.d.ts +13 -11
  51. package/dist-types/lib/user-facing/components/image/index.d.ts +20 -20
  52. package/dist-types/lib/user-facing/components/image/props.d.ts +23 -23
  53. package/dist-types/lib/user-facing/components/input/index.d.ts +63 -63
  54. package/dist-types/lib/user-facing/components/input/props.d.ts +63 -63
  55. package/dist-types/lib/user-facing/components/key-value/properties-props.d.ts +21 -21
  56. package/dist-types/lib/user-facing/components/key-value/props.d.ts +27 -27
  57. package/dist-types/lib/user-facing/components/modal/index.d.ts +27 -27
  58. package/dist-types/lib/user-facing/components/modal/props.d.ts +27 -27
  59. package/dist-types/lib/user-facing/components/page/index.d.ts +13 -13
  60. package/dist-types/lib/user-facing/components/page/props.d.ts +13 -13
  61. package/dist-types/lib/user-facing/components/section/index.d.ts +16 -16
  62. package/dist-types/lib/user-facing/components/section/props.d.ts +16 -16
  63. package/dist-types/lib/user-facing/components/slideout/props.d.ts +11 -11
  64. package/dist-types/lib/user-facing/components/stack/index.d.ts +38 -38
  65. package/dist-types/lib/user-facing/components/switch/index.d.ts +32 -32
  66. package/dist-types/lib/user-facing/components/switch/props.d.ts +32 -32
  67. package/dist-types/lib/user-facing/components/table/column-properties-panel.d.ts +161 -262
  68. package/dist-types/lib/user-facing/components/table/index.d.ts +205 -306
  69. package/dist-types/lib/user-facing/components/table/props.d.ts +205 -306
  70. package/dist-types/lib/user-facing/components/table/table-utilities.d.ts +4 -4
  71. package/dist-types/lib/user-facing/components/table/table-widget.d.ts +1 -5
  72. package/dist-types/lib/user-facing/components/table/types.d.ts +28 -31
  73. package/dist-types/lib/user-facing/components/text/index.d.ts +35 -35
  74. package/dist-types/lib/user-facing/components/text/props.d.ts +35 -35
  75. package/dist-types/lib/user-facing/entities/api/props.d.ts +10 -10
  76. package/dist-types/lib/user-facing/entities/timer/props.d.ts +12 -12
  77. package/dist-types/lib/user-facing/entities/variable/props.d.ts +7 -7
  78. package/dist-types/lib/user-facing/properties-panel/mixins/appearance-properties.d.ts +12 -12
  79. package/dist-types/lib/user-facing/properties-panel/mixins/appearance.d.ts +2 -2
  80. package/dist-types/lib/user-facing/properties-panel/mixins/form-inputs-properties.d.ts +10 -10
  81. package/dist-types/lib/user-facing/properties-panel/mixins/layout-section.d.ts +45 -45
  82. package/dist-types/lib/user-facing/properties-panel/mixins/loading.d.ts +1 -1
  83. package/dist-types/lib/user-facing/properties-panel/props-builder.d.ts +9 -20
  84. package/dist-types/lib/user-facing/sb-event-flow.d.ts +2 -2
  85. package/dist-types/lib/user-facing/sb-provider.d.ts +2 -1
  86. package/package.json +3 -3
  87. package/dist/icons-lSlfQ50w.js.map +0 -1
  88. package/dist-types/lib/user-facing/build-manifest.d.ts +0 -2
@@ -49,7 +49,7 @@ var __privateMethod = (obj, member, method4) => (__accessCheck(obj, member, "acc
49
49
  var _removeSourceIdElement_dec, _setSourceIdElement_dec, _setActiveRootInstanceId_dec, _init, _cancelApi_dec, _runApi_dec, _init2, _renameWidget_dec, _setWidgetProperty_dec, _setWidgetProperties_dec, _writeRuntimeProperties_dec, _deleteComponents_dec, _dropComponent_dec, _createComponent_dec, _batchUpdate_dec, _clearPendingTransactions_dec, _addPendingTransaction_dec, _executeOrAddToBatch_dec, _init3, _addOptimisticCreateWidget_dec, _processRootWidget_dec, _init4, _refreshPositionsAndGetDropConstraints_dec, _init5, _updateChildPositions_dec, _setWidgetPosition_dec, _setActiveTargetRect_dec, _setActiveDragRect_dec, _setDropTargetId_dec, _setInvalidDropTarget_dec, _setValidRootIds_dec, _cancelNewComponentDrag_dec, _startNewComponentDrag_dec, _setIsDragging_dec, _setWidgetFeatures_dec, _init6;
50
50
  import * as React from "react";
51
51
  import React__default, { isValidElement as isValidElement$1, version as version$2, createContext, useContext, useEffect, useRef, useLayoutEffect as useLayoutEffect$2, Component, useState, useMemo as useMemo$2, useCallback, forwardRef, useImperativeHandle, cloneElement as cloneElement$1, createElement, Suspense, Children, memo, useReducer, useSyncExternalStore, PureComponent, createRef } from "react";
52
- import { S as SvgClose, a as SvgSystemDanger, b as SvgSystemInfo, c as SvgSystemError, d as SvgSystemSuccess, e as SvgPlus, f as SvgHide, g as SvgChevronDown, h as SvgEmptyCheckbox, i as SvgMinus, j as SvgCheckmark, k as SvgPlay, l as SvgDownload, m as SvgTrash, n as SvgFilter, o as SvgFreeze, p as SvgSort, q as SvgEllipsis, r as SvgCrossXs, s as SvgClark } from "./icons-lSlfQ50w.js";
52
+ import { S as SvgClose, a as SvgSystemDanger, b as SvgSystemInfo, c as SvgSystemError, d as SvgSystemSuccess, e as SvgPlus, f as SvgHide, g as SvgChevronDown, h as SvgEmptyCheckbox, i as SvgMinus, j as SvgCheckmark, k as SvgCopy, l as SvgExternalLink, m as SvgPlay, n as SvgDownload, o as SvgTrash, p as SvgFilter, q as SvgFreeze, r as SvgSort, s as SvgEllipsis, t as SvgCrossXs, u as SvgClark } from "./icons-NrNO8p_u.js";
53
53
  import * as ReactDOM from "react-dom";
54
54
  import ReactDOM__default, { unstable_batchedUpdates, flushSync, createPortal } from "react-dom";
55
55
  var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
@@ -6001,11 +6001,11 @@ function PropertyInfo(value, type5 = "STATIC", extra) {
6001
6001
  const Property = {
6002
6002
  Static: (value) => PropertyInfo(value, "STATIC"),
6003
6003
  Binding: (value) => PropertyInfo(value, "BINDING"),
6004
- Template: (value, args) => PropertyInfo(value, "TEMPLATE", { args }),
6004
+ Template: (value) => PropertyInfo(value, "TEMPLATE"),
6005
6005
  Expression: (value) => PropertyInfo(value, "EXPRESSION"),
6006
6006
  Event: (value) => PropertyInfo(value, "EVENT"),
6007
6007
  Dimension: (value) => PropertyInfo(value, "DIMENSION"),
6008
- Computed: (value, args) => PropertyInfo(value, "COMPUTED", { args }),
6008
+ Computed: (value, args) => PropertyInfo(value, "COMPUTED", Array.isArray(args) && args.length > 0 ? { args } : {}),
6009
6009
  Any: (value, type5 = "STATIC") => PropertyInfo(value, type5)
6010
6010
  };
6011
6011
  function isPropertyInfo(value) {
@@ -6025,18 +6025,6 @@ function withBindingIdentifier(params, identifier2) {
6025
6025
  [BindingMetaSymbol]: identifier2
6026
6026
  };
6027
6027
  }
6028
- function getSingleArgString(arg) {
6029
- if (Array.isArray(arg)) {
6030
- return `{ ${arg.map(getSingleArgString).join(", ")} }`;
6031
- }
6032
- return arg.name;
6033
- }
6034
- function getComputedArgsString(args) {
6035
- if (!args || args.length === 0) {
6036
- return "";
6037
- }
6038
- return args.map(getSingleArgString).join(", ");
6039
- }
6040
6028
  const isDimension = (value) => {
6041
6029
  return typeof value === "object" && value !== null && "mode" in value && ["px", "fit", "fill", "%", "columns", "rows"].includes(value.mode) && (value.mode === "fit" || "value" in value);
6042
6030
  };
@@ -78430,7 +78418,7 @@ const ShowAlertTrigger = {
78430
78418
  const ResetStateVarTrigger = {
78431
78419
  type: TriggerStepType.RESET_STATE_VAR,
78432
78420
  async execute(context2, step) {
78433
- if (step.variable === void 0) {
78421
+ if (step.state === void 0) {
78434
78422
  return;
78435
78423
  }
78436
78424
  context2.rootStore.entityManager.runCode({
@@ -78438,22 +78426,22 @@ const ResetStateVarTrigger = {
78438
78426
  name: context2.name,
78439
78427
  func: () => {
78440
78428
  var _a2;
78441
- return (_a2 = step.variable) == null ? void 0 : _a2.set(step.variable.defaultValue);
78429
+ return (_a2 = step.state) == null ? void 0 : _a2.set(step.state.defaultValue);
78442
78430
  },
78443
78431
  args: []
78444
78432
  });
78445
78433
  },
78446
- create(variable) {
78434
+ create(stateVar) {
78447
78435
  return {
78448
78436
  type: TriggerStepType.RESET_STATE_VAR,
78449
- variable
78437
+ state: stateVar
78450
78438
  };
78451
78439
  }
78452
78440
  };
78453
78441
  const SetStateVarTrigger = {
78454
78442
  type: TriggerStepType.SET_STATE_VAR,
78455
78443
  async execute(context2, step) {
78456
- if (step.variable === void 0) {
78444
+ if (step.state === void 0) {
78457
78445
  return;
78458
78446
  }
78459
78447
  const value = context2.rootStore.entityManager.computeValue({
@@ -78467,15 +78455,15 @@ const SetStateVarTrigger = {
78467
78455
  func: (state, value2) => {
78468
78456
  var _a2;
78469
78457
  if (!state) return;
78470
- (_a2 = step.variable) == null ? void 0 : _a2.set(value2);
78458
+ (_a2 = step.state) == null ? void 0 : _a2.set(value2);
78471
78459
  },
78472
78460
  args: [value]
78473
78461
  });
78474
78462
  },
78475
- create(variable, value) {
78463
+ create(stateVar, value) {
78476
78464
  return {
78477
78465
  type: TriggerStepType.SET_STATE_VAR,
78478
- variable,
78466
+ state: stateVar,
78479
78467
  value
78480
78468
  };
78481
78469
  }
@@ -78483,14 +78471,12 @@ const SetStateVarTrigger = {
78483
78471
  const ControlTimerTrigger = {
78484
78472
  type: TriggerStepType.CONTROL_TIMER,
78485
78473
  async execute(_context, step) {
78486
- if (step.timer) {
78487
- step.timer[step.action]();
78488
- }
78474
+ console.log("ControlTimerTrigger", step);
78489
78475
  },
78490
- create(timer, action2) {
78476
+ create(timerId, action2) {
78491
78477
  return {
78492
78478
  type: TriggerStepType.CONTROL_TIMER,
78493
- timer,
78479
+ timerId,
78494
78480
  action: action2
78495
78481
  };
78496
78482
  }
@@ -82987,11 +82973,6 @@ class Prop {
82987
82973
  this.prop.nestedBindings = true;
82988
82974
  throw new Error("Nested bindings are not supported yet");
82989
82975
  }
82990
- contextual(computedArgs) {
82991
- this.prop.contextual = true;
82992
- this.prop.computedArgs = computedArgs;
82993
- return this;
82994
- }
82995
82976
  validate(validateFn) {
82996
82977
  this.prop.validate = validateFn;
82997
82978
  return this;
@@ -83113,9 +83094,6 @@ class Prop {
83113
83094
  ...rest
83114
83095
  };
83115
83096
  }
83116
- if (this.prop.computedArgs) {
83117
- propertiesPanelDisplay.computedArgs = typeof this.prop.computedArgs === "function" ? this.prop.computedArgs(entity) : this.prop.computedArgs;
83118
- }
83119
83097
  const propertiesPanelDisplayWithPanelConfig = {
83120
83098
  ...propertiesPanelDisplay,
83121
83099
  ...panelConfig && { panelConfig }
@@ -83526,7 +83504,7 @@ function registerStores(stores) {
83526
83504
  internalStores = { ...internalStores, ...stores };
83527
83505
  if (SUPPORTED_MODES.includes("production")) {
83528
83506
  if (Object.keys(internalStores).length === Object.keys(stores).length) {
83529
- import("./devtools-consolidated-DaYe-zkb.js").then(({ initializeCustomDevTools, setRegisteredStores }) => {
83507
+ import("./devtools-consolidated-B1B3uBW_.js").then(({ initializeCustomDevTools, setRegisteredStores }) => {
83530
83508
  setRegisteredStores(internalStores);
83531
83509
  initializeCustomDevTools();
83532
83510
  }).catch((error) => {
@@ -83539,7 +83517,7 @@ function registerStores(stores) {
83539
83517
  }
83540
83518
  }
83541
83519
  const DevToolsInternal = React__default.lazy(() => {
83542
- return import("./devtools-consolidated-DaYe-zkb.js").then((module2) => ({
83520
+ return import("./devtools-consolidated-B1B3uBW_.js").then((module2) => ({
83543
83521
  default: module2.CustomDevTools
83544
83522
  }));
83545
83523
  });
@@ -83632,32 +83610,9 @@ class EvalComputeEngine {
83632
83610
  })()
83633
83611
  }`
83634
83612
  ));
83635
- __publicField(this, "statementFunctionNoSnapshot", new Function(
83636
- ARGS_VAR_NAME,
83637
- USER_JS_CODE_VAR_NAME,
83638
- /*js*/
83639
- `return (() => {
83640
- "use strict";
83641
- return eval("(" + ${USER_JS_CODE_VAR_NAME} + ")").call(this, ...${ARGS_VAR_NAME});
83642
- })()`
83643
- ));
83644
83613
  }
83645
- compute({
83646
- snapshot,
83647
- entityName,
83648
- func,
83649
- args,
83650
- path: path2,
83651
- excludeState
83652
- }) {
83614
+ compute({ snapshot, entityName, func, args, path: path2 }) {
83653
83615
  try {
83654
- if (excludeState) {
83655
- return this.statementFunctionNoSnapshot.call(
83656
- snapshot[entityName.value],
83657
- args || [],
83658
- func.toString()
83659
- );
83660
- }
83661
83616
  const globalScope = createGlobalObject({ snapshot });
83662
83617
  return this.statementFunction.call(
83663
83618
  snapshot[entityName.value],
@@ -83919,11 +83874,11 @@ class SbEventFlow {
83919
83874
  controlModal(modal, action2) {
83920
83875
  return this.addStep(EventRegistry.controlModal.create(modal, action2));
83921
83876
  }
83922
- static controlTimer(stateTimer, action2) {
83923
- return SbEventFlow.start().controlTimer(stateTimer, action2);
83877
+ static controlTimer(timerId, action2) {
83878
+ return SbEventFlow.start().controlTimer(timerId, action2);
83924
83879
  }
83925
- controlTimer(stateTimer, action2) {
83926
- return this.addStep(EventRegistry.controlTimer.create(stateTimer, action2));
83880
+ controlTimer(timerId, action2) {
83881
+ return this.addStep(EventRegistry.controlTimer.create(timerId, action2));
83927
83882
  }
83928
83883
  static runApis(apis, onSuccess, onError2) {
83929
83884
  return SbEventFlow.start().runApis(apis, onSuccess, onError2);
@@ -84061,7 +84016,7 @@ const isLazyFunction = (value) => {
84061
84016
  return typeof value === "function" && value[lazyFunctionSymbol];
84062
84017
  };
84063
84018
  const LazyFunction = (source2, args = []) => {
84064
- const argsObj = getComputedArgsString(args);
84019
+ const argsObj = `{ ${args.join(", ")} }`;
84065
84020
  const func = new Function(argsObj, source2);
84066
84021
  func[lazyFunctionSymbol] = true;
84067
84022
  return func;
@@ -84396,6 +84351,7 @@ class EntityManager {
84396
84351
  }
84397
84352
  addProperty(scopeId, name, prop, eov) {
84398
84353
  if (prop.split(".").includes(RECORD_PATH_IDENTIFIER)) {
84354
+ console.log(`ALERT: Cannot add a property with a record path (${prop})`);
84399
84355
  return;
84400
84356
  }
84401
84357
  const entity = this.getScope(scopeId).getEntity(name);
@@ -84451,14 +84407,6 @@ class EntityManager {
84451
84407
  }
84452
84408
  return;
84453
84409
  }
84454
- let finalProp = prop;
84455
- if (isNested) {
84456
- finalProp = this.componentRegistry.getPropertyWithRecordIdentifier(
84457
- entityType,
84458
- prop
84459
- );
84460
- }
84461
- const managedProp = this.componentRegistry.getManagedProps(entityType).find((p) => p.path === finalProp);
84462
84410
  const getValue2 = computed(() => {
84463
84411
  let ret = null;
84464
84412
  try {
@@ -84467,30 +84415,18 @@ class EntityManager {
84467
84415
  ret = metaParent[finalSegment];
84468
84416
  } else {
84469
84417
  if (isComputed) {
84470
- if (managedProp == null ? void 0 : managedProp.contextual) {
84471
- ret = function(context2) {
84472
- return computeEngine.compute({
84473
- snapshot: snapshot(scopeId),
84474
- entityName: name,
84475
- func: eov.value,
84476
- path: prop,
84477
- args: [context2],
84478
- excludeState: true
84479
- });
84480
- };
84481
- } else {
84482
- ret = computeEngine.compute({
84483
- snapshot: snapshot(scopeId),
84484
- entityName: name,
84485
- func: eov.value,
84486
- path: prop
84487
- });
84488
- }
84418
+ ret = computeEngine.compute({
84419
+ snapshot: snapshot(scopeId),
84420
+ entityName: name,
84421
+ func: eov.value,
84422
+ path: prop
84423
+ });
84489
84424
  } else {
84490
84425
  ret = eov.value;
84491
84426
  }
84492
84427
  }
84493
- if ((managedProp == null ? void 0 : managedProp.validate) && typeof ret !== "function") {
84428
+ const managedProp = this.componentRegistry.getManagedProps(entityType).find((p) => p.path === prop);
84429
+ if (managedProp == null ? void 0 : managedProp.validate) {
84494
84430
  const currentState = snapshot(scopeId);
84495
84431
  const entity2 = currentState[name.value];
84496
84432
  const validationResult = managedProp.validate(ret, entity2);
@@ -84508,13 +84444,13 @@ class EntityManager {
84508
84444
  if (!validationResult.valid) {
84509
84445
  return void 0;
84510
84446
  }
84511
- ret = validationResult.result;
84447
+ return validationResult.result;
84512
84448
  }
84513
- return ret;
84514
84449
  } catch (_e2) {
84515
84450
  console.log("Could not compute property value");
84516
84451
  return void 0;
84517
84452
  }
84453
+ return ret;
84518
84454
  });
84519
84455
  const setValue = (value) => {
84520
84456
  const metaParent = getMetaParent();
@@ -85034,12 +84970,6 @@ const _SuperblocksEditorBridge = class _SuperblocksEditorBridge {
85034
84970
  }
85035
84971
  });
85036
84972
  }
85037
- socketError(message2) {
85038
- this.sendImmediate({
85039
- type: "socket/error",
85040
- payload: { message: message2 }
85041
- });
85042
- }
85043
84973
  // Private implementation details
85044
84974
  queueMessage(message2) {
85045
84975
  if (!this.connectedToParent) {
@@ -85518,7 +85448,7 @@ class ApiManager {
85518
85448
  scopeId,
85519
85449
  this.apiNameToDepCandidates[apiName] ?? []
85520
85450
  );
85521
- const orchestratorUrl = new URL("v2/execute", this.baseUrl).href;
85451
+ const orchestratorUrl = `${this.baseUrl}v2/execute`;
85522
85452
  const events2 = [];
85523
85453
  await ((_a2 = this.rootStore.editStore) == null ? void 0 : _a2.operationManager.ensureFilesSynced());
85524
85454
  const abortController = new AbortController();
@@ -85981,24 +85911,6 @@ class ComponentRegistry {
85981
85911
  getComponent(type5) {
85982
85912
  return this._typeRegistry.get(type5) ?? this._customComponentRegistry.get(type5);
85983
85913
  }
85984
- /**
85985
- * Get the property path with the record identifier if it exists. For example,
85986
- * `columns.columnName.label` becomes `columns.*.label`, for record properties.
85987
- */
85988
- getPropertyWithRecordIdentifier(type5, path2) {
85989
- const managedProps = this.getManagedProps(type5);
85990
- const splitPath = path2.split(".");
85991
- if (splitPath.length === 1) {
85992
- return path2;
85993
- }
85994
- const [parentKey, _maybeTheRecordKey, ...rest] = splitPath;
85995
- for (const prop of managedProps) {
85996
- if (prop.path.startsWith(parentKey) && prop.path.includes(RECORD_PATH_IDENTIFIER) && rest.length > 0 && prop.path.endsWith(rest.join("."))) {
85997
- return [parentKey, RECORD_PATH_IDENTIFIER, rest.join(".")].join(".");
85998
- }
85999
- }
86000
- return path2;
86001
- }
86002
85914
  }
86003
85915
  const DEFAULT_ANONYMOUS_SOURCE_ID = "SB--anon-src";
86004
85916
  const DEFAULT_ROOT_KEY = Symbol("DEFAULT_KEY");
@@ -86238,50 +86150,24 @@ class OperationAPI {
86238
86150
  });
86239
86151
  this.serverUrl = serverUrl;
86240
86152
  }
86241
- /**
86242
- * @throws {Error} if the websocket connection can't be initiated after 3 attempts
86243
- */
86244
86153
  async connect(peerId, userId) {
86245
- try {
86246
- const socket = await connectSocket(this.serverUrl, {
86247
- peerId,
86248
- userId,
86249
- onClose: this.handleSocketClose(peerId, userId)
86250
- });
86251
- this.retryAttempts = 0;
86252
- this.socket = socket;
86253
- } catch {
86254
- this.retryAttempts++;
86255
- console.info(
86256
- `App<>Dev box initial connection failed, retrying attempt ${this.retryAttempts}...`
86257
- );
86258
- await this.retryConnection(peerId, userId);
86259
- }
86260
- }
86261
- // Happens after initial connection
86262
- handleSocketClose(peerId, userId) {
86263
- return async () => {
86264
- var _a2;
86265
- console.info(
86266
- `App<>Dev box Socket closed, retrying attempt ${this.retryAttempts + 1}...`
86267
- );
86268
- (_a2 = rootStore.editStore) == null ? void 0 : _a2.connectionManager.disconnect();
86269
- await this.retryConnection(peerId, userId);
86270
- if (this.retryAttempts >= 3) {
86271
- this.socket = void 0;
86154
+ const socket = await connectSocket(this.serverUrl, {
86155
+ peerId,
86156
+ userId,
86157
+ onClose: () => {
86158
+ var _a2;
86159
+ console.log("App<>Dev box Socket closed, retrying...");
86160
+ (_a2 = rootStore.editStore) == null ? void 0 : _a2.connectionManager.disconnect();
86161
+ if (this.retryAttempts < 3) {
86162
+ this.connect(peerId, userId);
86163
+ } else {
86164
+ this.socket = void 0;
86165
+ }
86166
+ this.retryAttempts++;
86272
86167
  }
86273
- this.retryAttempts++;
86274
- };
86275
- }
86276
- async retryConnection(peerId, userId) {
86277
- if (this.retryAttempts < 3) {
86278
- await this.connect(peerId, userId);
86279
- } else {
86280
- console.info(
86281
- `App<>Dev box Socket closed, failed to reconnect after 3 attempts. Throwing error.`
86282
- );
86283
- throw new Error("Failed to reconnect after 3 attempts");
86284
- }
86168
+ });
86169
+ this.retryAttempts = 0;
86170
+ this.socket = socket;
86285
86171
  }
86286
86172
  }
86287
86173
  const sourceUpdateApi = new OperationAPI(
@@ -86419,13 +86305,12 @@ async function connectSocket(serverUrl, {
86419
86305
  }
86420
86306
  );
86421
86307
  const socket = createISocketClient(isocket);
86422
- console.log("connected to socket");
86423
86308
  (_b2 = rootStore.editStore) == null ? void 0 : _b2.connectionManager.connect();
86424
86309
  return socket;
86425
86310
  } catch (error) {
86426
86311
  console.error("Error connecting to socket", error);
86427
86312
  (_c2 = rootStore.editStore) == null ? void 0 : _c2.connectionManager.disconnect();
86428
- throw error;
86313
+ return void 0;
86429
86314
  }
86430
86315
  }
86431
86316
  _executeOrAddToBatch_dec = [action], _addPendingTransaction_dec = [action], _clearPendingTransactions_dec = [action], _batchUpdate_dec = [action], _createComponent_dec = [action], _dropComponent_dec = [action], _deleteComponents_dec = [action], _writeRuntimeProperties_dec = [action], _setWidgetProperties_dec = [action], _setWidgetProperty_dec = [action], _renameWidget_dec = [action];
@@ -87020,10 +86905,7 @@ function getPropertyValue$1({
87020
86905
  }
87021
86906
  if (property.type === "COMPUTED" && typeof property.value === "string" && scopeId && name) {
87022
86907
  try {
87023
- return LazyFunction(
87024
- getRuntimeComputedExpression(property.value),
87025
- property.args
87026
- );
86908
+ return LazyFunction(getRuntimeComputedExpression(property.value));
87027
86909
  } catch (e3) {
87028
86910
  console.error("Error generating computed value", e3);
87029
86911
  const entity = rootStore.entityManager.getEntity(scopeId, name);
@@ -87070,7 +86952,7 @@ function getPropertyValue$1({
87070
86952
  return property.value;
87071
86953
  }
87072
86954
  function getSbEventFlow(step, scopeId) {
87073
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
86955
+ var _a2, _b2, _c2, _d2, _e2, _f2;
87074
86956
  if (!isValidStepDef(step)) {
87075
86957
  return void 0;
87076
86958
  }
@@ -87143,33 +87025,27 @@ function getSbEventFlow(step, scopeId) {
87143
87025
  return SbEventFlow.controlModal(modalEntity, step.direction);
87144
87026
  }
87145
87027
  case "controlTimer": {
87146
- const timerStep = step;
87147
- if (!((_a2 = timerStep.timer) == null ? void 0 : _a2.name)) {
87148
- return void 0;
87149
- }
87150
- const timerEntity = getEntity(timerStep.timer.name);
87028
+ const timerEntity = getEntity(step.name);
87151
87029
  if (!timerEntity) return void 0;
87152
- return SbEventFlow.controlTimer(timerEntity, step.command ?? "start");
87030
+ return SbEventFlow.controlTimer(step.name, step.command);
87153
87031
  }
87154
87032
  case "setStateVar": {
87155
- const variableStep = step;
87156
- const stateEntity = getEntity((_b2 = variableStep.variable) == null ? void 0 : _b2.name);
87033
+ const stateEntity = getEntity((_a2 = step.state) == null ? void 0 : _a2.name);
87157
87034
  if (!stateEntity) return void 0;
87158
- const value = isPropertyInfo(variableStep.value) ? getPropertyValue$1({
87159
- property: variableStep.value,
87035
+ const value = isPropertyInfo(step.value) ? getPropertyValue$1({
87036
+ property: step.value,
87160
87037
  scopeId,
87161
- name: getName((_c2 = variableStep.variable) == null ? void 0 : _c2.name)
87038
+ name: getName((_b2 = step.state) == null ? void 0 : _b2.name)
87162
87039
  }) : step.value;
87163
87040
  return SbEventFlow.setStateVar(stateEntity, value);
87164
87041
  }
87165
87042
  case "resetStateVar": {
87166
- const variableStep = step;
87167
- const resetStateEntity = getEntity((_d2 = variableStep.variable) == null ? void 0 : _d2.name);
87043
+ const resetStateEntity = getEntity((_c2 = step.state) == null ? void 0 : _c2.name);
87168
87044
  if (!resetStateEntity) return void 0;
87169
87045
  return SbEventFlow.resetStateVar(resetStateEntity);
87170
87046
  }
87171
87047
  case "resetComponent": {
87172
- const resetWidgetEntity = getEntity((_e2 = step.widget) == null ? void 0 : _e2.name);
87048
+ const resetWidgetEntity = getEntity((_d2 = step.widget) == null ? void 0 : _d2.name);
87173
87049
  if (!resetWidgetEntity) return void 0;
87174
87050
  return SbEventFlow.resetComponent(
87175
87051
  step.widget,
@@ -87178,7 +87054,7 @@ function getSbEventFlow(step, scopeId) {
87178
87054
  );
87179
87055
  }
87180
87056
  case "setComponentProperty": {
87181
- const setWidgetEntity = getEntity((_f2 = step.widget) == null ? void 0 : _f2.name);
87057
+ const setWidgetEntity = getEntity((_e2 = step.widget) == null ? void 0 : _e2.name);
87182
87058
  if (!setWidgetEntity) return void 0;
87183
87059
  return SbEventFlow.setComponentProperty(
87184
87060
  step.widget,
@@ -87196,7 +87072,7 @@ function getSbEventFlow(step, scopeId) {
87196
87072
  case "setProfile":
87197
87073
  return SbEventFlow.setProfile(step.profileId, step.profileAction);
87198
87074
  case "triggerEvent":
87199
- return SbEventFlow.triggerEvent((_g2 = step.event) == null ? void 0 : _g2.name, step.eventPayload);
87075
+ return SbEventFlow.triggerEvent((_f2 = step.event) == null ? void 0 : _f2.name, step.eventPayload);
87200
87076
  default:
87201
87077
  console.warn("Unhandled runtime step type", step.type);
87202
87078
  return void 0;
@@ -87518,9 +87394,8 @@ class RuntimeEntitiesManager {
87518
87394
  const { width, height, marginLeft, marginTop } = pendingResize;
87519
87395
  merged.props = {
87520
87396
  ...merged.props || {},
87521
- ...width && merged.type !== "SbIcon" && { width },
87522
- ...height && merged.type !== "SbIcon" && { height },
87523
- ...width && merged.type === "SbIcon" && { size: width },
87397
+ ...width && { width },
87398
+ ...height && { height },
87524
87399
  ...marginLeft && { marginLeft },
87525
87400
  ...marginTop && { marginTop }
87526
87401
  };
@@ -87898,27 +87773,22 @@ function shouldWrapInSectionAndColumn(type5, parentType) {
87898
87773
  return parentType === "SbPage" && type5 !== "SbSection" || parentType === "SbSection" && type5 !== "SbColumn";
87899
87774
  }
87900
87775
  const filterSafeStackDimensionProperties = (existingProps) => {
87901
- const { width, height, size: size2 } = existingProps;
87776
+ const { width, height } = existingProps;
87902
87777
  let safeHeight;
87903
87778
  let safeWidth;
87904
- let safeSize;
87905
87779
  if ((height == null ? void 0 : height.mode) === "px" || (height == null ? void 0 : height.mode) === "fit" || (height == null ? void 0 : height.mode) === "fill") {
87906
87780
  safeHeight = Property.Dimension(height);
87907
87781
  }
87908
87782
  if ((width == null ? void 0 : width.mode) === "px" || (width == null ? void 0 : width.mode) === "fit" || (width == null ? void 0 : width.mode) === "fill") {
87909
87783
  safeWidth = Property.Dimension(width);
87910
87784
  }
87911
- if ((size2 == null ? void 0 : size2.mode) === "px") {
87912
- safeSize = Property.Dimension(size2);
87913
- }
87914
87785
  return {
87915
87786
  width: safeWidth,
87916
- height: safeHeight,
87917
- size: safeSize
87787
+ height: safeHeight
87918
87788
  };
87919
87789
  };
87920
87790
  const filterSafeGridDimensionProperties = (existingProps) => {
87921
- const { width, height, size: size2 } = existingProps;
87791
+ const { width, height } = existingProps;
87922
87792
  const safeDimensions = {};
87923
87793
  if ((height == null ? void 0 : height.mode) === "rows" || (height == null ? void 0 : height.mode) === "fit") {
87924
87794
  safeDimensions.height = Property.Dimension(height);
@@ -87926,9 +87796,6 @@ const filterSafeGridDimensionProperties = (existingProps) => {
87926
87796
  if ((width == null ? void 0 : width.mode) === "columns") {
87927
87797
  safeDimensions.width = Property.Dimension(width);
87928
87798
  }
87929
- if ((size2 == null ? void 0 : size2.mode) === "columns") {
87930
- safeDimensions.size = Property.Dimension(size2);
87931
- }
87932
87799
  return safeDimensions;
87933
87800
  };
87934
87801
  const defaultSizeForComponent = (componentType, isFreeform, draggedDimensions) => {
@@ -88888,7 +88755,7 @@ class ResizingManager {
88888
88755
  return this._activeResizes.get(selectedSourceId);
88889
88756
  }
88890
88757
  startResizing(dragStartX, dragStartY, instanceId, position2) {
88891
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i, _j, _k, _l2, _m2, _n2, _o2, _p2, _q;
88758
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i, _j, _k, _l2, _m2, _n2, _o2;
88892
88759
  const widget = (_a2 = this.root.editStore) == null ? void 0 : _a2.runtimeEntitiesManager.getEditorWidgetMeta(
88893
88760
  instanceId
88894
88761
  );
@@ -88927,10 +88794,10 @@ class ResizingManager {
88927
88794
  dragStartX,
88928
88795
  dragStartY,
88929
88796
  start: {
88930
- width: ((_i = (_h2 = widget == null ? void 0 : widget.props) == null ? void 0 : _h2.width) == null ? void 0 : _i.value) ?? ((_k = (_j = widget == null ? void 0 : widget.props) == null ? void 0 : _j.size) == null ? void 0 : _k.value) ?? 0,
88931
- height: ((_m2 = (_l2 = widget == null ? void 0 : widget.props) == null ? void 0 : _l2.height) == null ? void 0 : _m2.value) ?? 0,
88932
- marginLeft: ((_o2 = (_n2 = widget == null ? void 0 : widget.props) == null ? void 0 : _n2.marginLeft) == null ? void 0 : _o2.value) ?? 0,
88933
- marginTop: ((_q = (_p2 = widget == null ? void 0 : widget.props) == null ? void 0 : _p2.marginTop) == null ? void 0 : _q.value) ?? 0
88797
+ width: ((_i = (_h2 = widget == null ? void 0 : widget.props) == null ? void 0 : _h2.width) == null ? void 0 : _i.value) ?? 0,
88798
+ height: ((_k = (_j = widget == null ? void 0 : widget.props) == null ? void 0 : _j.height) == null ? void 0 : _k.value) ?? 0,
88799
+ marginLeft: ((_m2 = (_l2 = widget == null ? void 0 : widget.props) == null ? void 0 : _l2.marginLeft) == null ? void 0 : _m2.value) ?? 0,
88800
+ marginTop: ((_o2 = (_n2 = widget == null ? void 0 : widget.props) == null ? void 0 : _n2.marginTop) == null ? void 0 : _o2.value) ?? 0
88934
88801
  },
88935
88802
  resizedPosition: position2,
88936
88803
  widthToUpdate: null,
@@ -89068,34 +88935,21 @@ class ResizingManager {
89068
88935
  });
89069
88936
  }
89070
88937
  resizeWidget(currentX, currentY, instanceId, canResizeWidth2, canResizeHeight2) {
89071
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i, _j, _k;
88938
+ var _a2, _b2, _c2, _d2, _e2, _f2;
89072
88939
  const sourceId = (_a2 = this.root.editStore) == null ? void 0 : _a2.runtimeEntitiesManager.getEditorWidgetSourceId(
89073
88940
  instanceId
89074
88941
  );
89075
- const type5 = (_b2 = this.root.editStore) == null ? void 0 : _b2.runtimeEntitiesManager.getEditorWidgetType(
89076
- instanceId
89077
- );
89078
88942
  const resizeState = sourceId && this._activeResizes.get(sourceId);
89079
88943
  if (!resizeState) {
89080
88944
  return;
89081
88945
  }
89082
- const widget = (_c2 = this.root.editStore) == null ? void 0 : _c2.runtimeEntitiesManager.getEditorWidgetMeta(
88946
+ const widget = (_b2 = this.root.editStore) == null ? void 0 : _b2.runtimeEntitiesManager.getEditorWidgetMeta(
89083
88947
  instanceId
89084
88948
  );
89085
- let widthMode = (_e2 = (_d2 = widget == null ? void 0 : widget.props) == null ? void 0 : _d2.width) == null ? void 0 : _e2.mode;
89086
- const heightMode = (_g2 = (_f2 = widget == null ? void 0 : widget.props) == null ? void 0 : _f2.height) == null ? void 0 : _g2.mode;
88949
+ const widthMode = (_d2 = (_c2 = widget == null ? void 0 : widget.props) == null ? void 0 : _c2.width) == null ? void 0 : _d2.mode;
88950
+ const heightMode = (_f2 = (_e2 = widget == null ? void 0 : widget.props) == null ? void 0 : _e2.height) == null ? void 0 : _f2.mode;
89087
88951
  const deltaX = currentX - resizeState.dragStartX;
89088
88952
  const deltaY = currentY - resizeState.dragStartY;
89089
- if (type5 === "SbIcon") {
89090
- widthMode = (_i = (_h2 = widget == null ? void 0 : widget.props) == null ? void 0 : _h2.size) == null ? void 0 : _i.mode;
89091
- if (!widthMode) {
89092
- const parentInstanceId = widget == null ? void 0 : widget.parentInstanceId;
89093
- const parentWidget = parentInstanceId && ((_j = this.root.editStore) == null ? void 0 : _j.runtimeEntitiesManager.getEditorWidgetMeta(
89094
- parentInstanceId
89095
- ));
89096
- widthMode = ((_k = parentWidget == null ? void 0 : parentWidget.props) == null ? void 0 : _k.layout) === "freeform" ? "columns" : "px";
89097
- }
89098
- }
89099
88953
  const updateWidth = this.handleResizeDimension({
89100
88954
  resizeState,
89101
88955
  dimension: "width",
@@ -89150,28 +89004,22 @@ class ResizingManager {
89150
89004
  );
89151
89005
  }
89152
89006
  applyResize(instanceId) {
89153
- var _a2, _b2, _c2;
89007
+ var _a2, _b2;
89154
89008
  const sourceId = (_a2 = this.root.editStore) == null ? void 0 : _a2.runtimeEntitiesManager.getEditorWidgetSourceId(
89155
89009
  instanceId
89156
89010
  );
89157
- const type5 = (_b2 = this.root.editStore) == null ? void 0 : _b2.runtimeEntitiesManager.getEditorWidgetType(
89158
- instanceId
89159
- );
89160
89011
  const resizeState = sourceId && this._activeResizes.get(sourceId);
89161
89012
  if (!resizeState) {
89162
89013
  return;
89163
89014
  }
89164
89015
  resizeState.isApplyingResize = true;
89165
89016
  const properties2 = {
89166
- ...resizeState.heightToUpdate && type5 !== "SbIcon" && {
89017
+ ...resizeState.heightToUpdate && {
89167
89018
  height: Property.Dimension(resizeState.heightToUpdate)
89168
89019
  },
89169
- ...resizeState.widthToUpdate && type5 !== "SbIcon" && {
89020
+ ...resizeState.widthToUpdate && {
89170
89021
  width: Property.Dimension(resizeState.widthToUpdate)
89171
89022
  },
89172
- ...resizeState.widthToUpdate && type5 === "SbIcon" && {
89173
- size: Property.Dimension(resizeState.widthToUpdate)
89174
- },
89175
89023
  ...resizeState.marginLeftToUpdate && {
89176
89024
  marginLeft: Property.Dimension(resizeState.marginLeftToUpdate)
89177
89025
  },
@@ -89180,7 +89028,7 @@ class ResizingManager {
89180
89028
  }
89181
89029
  };
89182
89030
  if (Object.keys(properties2).length > 0) {
89183
- (_c2 = this.root.editStore) == null ? void 0 : _c2.operationManager.setWidgetProperties({
89031
+ (_b2 = this.root.editStore) == null ? void 0 : _b2.operationManager.setWidgetProperties({
89184
89032
  sourceId: resizeState.sourceId,
89185
89033
  properties: properties2,
89186
89034
  callback: () => {
@@ -91191,14 +91039,14 @@ function getLoaderFn$1(options) {
91191
91039
  if (!(loader === "all")) return [3, 3];
91192
91040
  return [4, import(
91193
91041
  /* webpackChunkName: "blueprint-icons-all-paths-loader" */
91194
- "./allPathsLoader-Bt-mJXJw.js"
91042
+ "./allPathsLoader-KDCEbuYo.js"
91195
91043
  )];
91196
91044
  case 2:
91197
91045
  return [2, _b2.sent().allPathsLoader];
91198
91046
  case 3:
91199
91047
  return [4, import(
91200
91048
  /* webpackChunkName: "blueprint-icons-split-paths-by-size-loader" */
91201
- "./splitPathsBySizeLoader-HDsWhSbE.js"
91049
+ "./splitPathsBySizeLoader-VThmaq3t.js"
91202
91050
  )];
91203
91051
  case 4:
91204
91052
  return [2, _b2.sent().splitPathsBySizeLoader];
@@ -111833,18 +111681,14 @@ const ReactiveComponent = observer(function Component2({
111833
111681
  const reactiveProps = useShallowMobxObserver(safeProps);
111834
111682
  const stylePropWithSize = useStyleWithSize(reactiveProps);
111835
111683
  const styleProp = useMemo$2(() => {
111836
- const styleWithOverflow = {
111837
- overflow: "auto",
111838
- ...stylePropWithSize
111839
- };
111840
111684
  if (reactiveProps.isVisible === false) {
111841
111685
  const existingOpacity = lodashExports.isNumber(stylePropWithSize.opacity) ? stylePropWithSize.opacity : 1;
111842
111686
  return {
111843
- ...styleWithOverflow,
111687
+ ...stylePropWithSize,
111844
111688
  opacity: existingOpacity * INVISIBLE_OPACITY
111845
111689
  };
111846
111690
  }
111847
- return styleWithOverflow;
111691
+ return stylePropWithSize;
111848
111692
  }, [reactiveProps.isVisible, stylePropWithSize]);
111849
111693
  const { setStyle, getFallbackStyle } = useComponentSuspenseStyle();
111850
111694
  useEffect(() => {
@@ -112004,52 +111848,28 @@ const size$2 = ({
112004
111848
  controlType: "WIDTH_DROPDOWN",
112005
111849
  defaultValue: defaults2 == null ? void 0 : defaults2.minWidth,
112006
111850
  defaultOnAdd: defaultsOnAdd == null ? void 0 : defaultsOnAdd.minWidth,
112007
- isVisible: function(s3) {
112008
- var _a2;
112009
- const hideWidth = ((_a2 = this == null ? void 0 : this.width) == null ? void 0 : _a2.mode) === "px";
112010
- return Boolean(
112011
- (showMinWidth ? showMinWidth == null ? void 0 : showMinWidth.call(this, s3) : true) && !hideWidth
112012
- );
112013
- }
111851
+ isVisible: showMinWidth
112014
111852
  });
112015
111853
  const maxWidthProperty = getSizeProp({
112016
111854
  label: "Max width",
112017
111855
  controlType: "WIDTH_DROPDOWN",
112018
111856
  defaultValue: defaults2 == null ? void 0 : defaults2.maxWidth,
112019
111857
  defaultOnAdd: defaultsOnAdd == null ? void 0 : defaultsOnAdd.maxWidth,
112020
- isVisible: function(s3) {
112021
- var _a2;
112022
- const hideWidth = ((_a2 = this == null ? void 0 : this.width) == null ? void 0 : _a2.mode) === "px";
112023
- return Boolean(
112024
- (showMaxWidth ? showMaxWidth == null ? void 0 : showMaxWidth.call(this, s3) : true) && !hideWidth
112025
- );
112026
- }
111858
+ isVisible: showMaxWidth
112027
111859
  });
112028
111860
  const minHeightProperty = getSizeProp({
112029
111861
  label: "Min height",
112030
111862
  controlType: "HEIGHT_DROPDOWN",
112031
111863
  defaultValue: defaults2 == null ? void 0 : defaults2.minHeight,
112032
111864
  defaultOnAdd: defaultsOnAdd == null ? void 0 : defaultsOnAdd.minHeight,
112033
- isVisible: function(s3) {
112034
- var _a2;
112035
- const hideHeight = ((_a2 = this == null ? void 0 : this.height) == null ? void 0 : _a2.mode) === "px";
112036
- return Boolean(
112037
- (showMinHeight ? showMinHeight == null ? void 0 : showMinHeight.call(this, s3) : true) && !hideHeight
112038
- );
112039
- }
111865
+ isVisible: showMinHeight
112040
111866
  });
112041
111867
  const maxHeightProperty = getSizeProp({
112042
111868
  label: "Max height",
112043
111869
  controlType: "HEIGHT_DROPDOWN",
112044
111870
  defaultValue: defaults2 == null ? void 0 : defaults2.maxHeight,
112045
111871
  defaultOnAdd: defaultsOnAdd == null ? void 0 : defaultsOnAdd.maxHeight,
112046
- isVisible: function(s3) {
112047
- var _a2;
112048
- const hideHeight = ((_a2 = this == null ? void 0 : this.height) == null ? void 0 : _a2.mode) === "px";
112049
- return Boolean(
112050
- (showMaxHeight ? showMaxHeight == null ? void 0 : showMaxHeight.call(this, s3) : true) && !hideHeight
112051
- );
112052
- }
111872
+ isVisible: showMaxHeight
112053
111873
  });
112054
111874
  let heightProperty = Prop.dimension().readAndWrite().propertiesPanel({
112055
111875
  label: "Height",
@@ -112291,8 +112111,7 @@ const containerLayout = (sizeProps) => Prop.union({
112291
112111
  sourceId: child.sourceId,
112292
112112
  element: (_b3 = (_a3 = editStore2.interactionLayerManager.getSourceIdElements(
112293
112113
  child.sourceId
112294
- )) == null ? void 0 : _a3[0]) == null ? void 0 : _b3.element,
112295
- type: child.type
112114
+ )) == null ? void 0 : _a3[0]) == null ? void 0 : _b3.element
112296
112115
  };
112297
112116
  }).filter(({ element }) => !!element)) ?? [];
112298
112117
  if ("layout" in updates && updates.layout.value === "freeform") {
@@ -112304,7 +112123,7 @@ const containerLayout = (sizeProps) => Prop.union({
112304
112123
  return baseUpdate;
112305
112124
  }
112306
112125
  const updatesBySourceId = {};
112307
- elements.forEach(({ sourceId: sourceId2, element, currentProps, type: type5 }) => {
112126
+ elements.forEach(({ sourceId: sourceId2, element, currentProps }) => {
112308
112127
  const elementRect = element.getBoundingClientRect();
112309
112128
  const gridPosition = editStore2.ui.dnd.grid.getGridPositionInfo({
112310
112129
  positionRect: elementRect,
@@ -112317,14 +112136,8 @@ const containerLayout = (sizeProps) => Prop.union({
112317
112136
  props: {
112318
112137
  marginTop: Property.Dimension(Dim.row(gridPosition.yGU)),
112319
112138
  marginLeft: Property.Dimension(Dim.col(gridPosition.xGU)),
112320
- ...type5 === "SbIcon" ? {
112321
- size: Property.Dimension(Dim.col(gridPosition.widthGU))
112322
- } : {
112323
- width: Property.Dimension(
112324
- Dim.col(gridPosition.widthGU)
112325
- ),
112326
- height: isHeightFit ? Property.Dimension(Dim.fit()) : Property.Dimension(Dim.row(gridPosition.heightGU))
112327
- }
112139
+ width: Property.Dimension(Dim.col(gridPosition.widthGU)),
112140
+ height: isHeightFit ? Property.Dimension(Dim.fit()) : Property.Dimension(Dim.row(gridPosition.heightGU))
112328
112141
  },
112329
112142
  meta: {}
112330
112143
  };
@@ -112341,7 +112154,7 @@ const containerLayout = (sizeProps) => Prop.union({
112341
112154
  };
112342
112155
  } else if (previousProps.layout === "freeform" && (newProps.layout === "vertical" || newProps.layout === "horizontal")) {
112343
112156
  const updatesBySourceId = {};
112344
- elements.forEach(({ sourceId: sourceId2, element, currentProps, type: type5 }) => {
112157
+ elements.forEach(({ sourceId: sourceId2, element, currentProps }) => {
112345
112158
  const elementRect = element.getBoundingClientRect();
112346
112159
  const isHeightFit = isDimension(currentProps == null ? void 0 : currentProps.height) && currentProps.height.mode === "fit";
112347
112160
  updatesBySourceId[sourceId2] = {
@@ -112349,12 +112162,8 @@ const containerLayout = (sizeProps) => Prop.union({
112349
112162
  marginTop: Property.Static(""),
112350
112163
  marginLeft: Property.Static(""),
112351
112164
  constraintTop: Property.Static(""),
112352
- ...type5 === "SbIcon" ? {
112353
- size: Property.Dimension(Dim.px(elementRect.width))
112354
- } : {
112355
- width: Property.Dimension(Dim.px(elementRect.width)),
112356
- height: isHeightFit ? Property.Dimension(Dim.fit()) : Property.Dimension(Dim.px(elementRect.height))
112357
- }
112165
+ width: Property.Dimension(Dim.px(elementRect.width)),
112166
+ height: isHeightFit ? Property.Dimension(Dim.fit()) : Property.Dimension(Dim.px(elementRect.height))
112358
112167
  },
112359
112168
  meta: {}
112360
112169
  };
@@ -117085,7 +116894,6 @@ const handleGridDropWithinCanvas = (params) => {
117085
116894
  const editStore2 = getEditStore();
117086
116895
  const dropSourceId = editStore2.runtimeEntitiesManager.getEditorWidgetSourceId(dropTargetId);
117087
116896
  const draggedSourceId = editStore2.runtimeEntitiesManager.getEditorWidgetSourceId(draggedId);
117088
- const draggedType = editStore2.runtimeEntitiesManager.getEditorWidgetType(draggedId);
117089
116897
  if (!dropSourceId || !draggedSourceId) {
117090
116898
  throw new Error(`Missing IDs: dragging ${draggedId} to ${dropTargetId}`);
117091
116899
  }
@@ -117105,16 +116913,15 @@ const handleGridDropWithinCanvas = (params) => {
117105
116913
  const droppedWidgetProps = (_a2 = editStore2.runtimeEntitiesManager.getEditorWidgetMeta(draggedId)) == null ? void 0 : _a2.props;
117106
116914
  const safeExistingDimensions = filterSafeGridDimensionProperties({
117107
116915
  width: droppedWidgetProps == null ? void 0 : droppedWidgetProps.width,
117108
- height: droppedWidgetProps == null ? void 0 : droppedWidgetProps.height,
117109
- size: droppedWidgetProps == null ? void 0 : droppedWidgetProps.size
116916
+ height: droppedWidgetProps == null ? void 0 : droppedWidgetProps.height
117110
116917
  });
117111
116918
  const width = safeExistingDimensions.width ?? Property.Dimension(Dim.col(droppedWidgetConstraints.width));
117112
116919
  const height = safeExistingDimensions.height ?? Property.Dimension(Dim.rows(droppedWidgetConstraints.height));
117113
- const size2 = safeExistingDimensions.size ?? Property.Dimension(Dim.col(droppedWidgetConstraints.width));
117114
116920
  const propsToChange = droppedWidgetConstraints ? {
117115
116921
  marginTop: Property.Dimension(Dim.row(droppedWidgetConstraints.top)),
117116
116922
  marginLeft: Property.Dimension(Dim.col(droppedWidgetConstraints.left)),
117117
- ...draggedType === "SbIcon" ? { size: size2 } : { width, height },
116923
+ width,
116924
+ height,
117118
116925
  constraintTop: Property.Expression(
117119
116926
  JSON.stringify(droppedWidgetConstraints.constraintTop)
117120
116927
  )
@@ -117180,18 +116987,13 @@ const handleGridDrop = async ({
117180
116987
  });
117181
116988
  }
117182
116989
  };
117183
- const mergeDroppedDimensions = (draggedType, draggedProps, activeDragRect) => {
116990
+ const mergeDroppedDimensions = (draggedProps, activeDragRect) => {
117184
116991
  const safeExistingDimensions = filterSafeStackDimensionProperties({
117185
116992
  width: draggedProps == null ? void 0 : draggedProps.width,
117186
- height: draggedProps == null ? void 0 : draggedProps.height,
117187
- size: draggedProps == null ? void 0 : draggedProps.size
116993
+ height: draggedProps == null ? void 0 : draggedProps.height
117188
116994
  });
117189
116995
  const width = safeExistingDimensions.width ?? ((activeDragRect == null ? void 0 : activeDragRect.width) ? Property.Dimension(Dim.px(activeDragRect.width)) : Property.Static(""));
117190
116996
  const height = safeExistingDimensions.height ?? ((activeDragRect == null ? void 0 : activeDragRect.height) ? Property.Dimension(Dim.px(activeDragRect.height)) : Property.Static(""));
117191
- if (draggedType === "SbIcon") {
117192
- const size2 = safeExistingDimensions.size ?? ((activeDragRect == null ? void 0 : activeDragRect.height) ? Property.Dimension(Dim.px(activeDragRect.height)) : Property.Static(""));
117193
- return { size: size2 };
117194
- }
117195
116997
  return {
117196
116998
  width,
117197
116999
  height
@@ -117244,7 +117046,7 @@ const handleStackDropWithinCanvas = (params) => {
117244
117046
  marginTop: Property.Static(""),
117245
117047
  marginLeft: Property.Static(""),
117246
117048
  constraintTop: Property.Static(""),
117247
- ...mergeDroppedDimensions(draggedType, draggedProps, activeDragRect)
117049
+ ...mergeDroppedDimensions(draggedProps, activeDragRect)
117248
117050
  }
117249
117051
  });
117250
117052
  }
@@ -117287,7 +117089,7 @@ const dropComponentInWrappingSectionOrColumn = async (params) => {
117287
117089
  marginTop: Property.Static(""),
117288
117090
  marginLeft: Property.Static(""),
117289
117091
  constraintTop: Property.Static(""),
117290
- ...mergeDroppedDimensions(dropTargetType, draggedProps, activeDragRect)
117092
+ ...mergeDroppedDimensions(draggedProps, activeDragRect)
117291
117093
  }
117292
117094
  });
117293
117095
  };
@@ -117728,18 +117530,12 @@ const AddSectionButton = ({
117728
117530
  sectionInstanceId
117729
117531
  }) => {
117730
117532
  const indexForNewSection = placement === "above" ? indexForBaseSection : indexForBaseSection + 1;
117731
- const createSection = useCallback(async () => {
117732
- const newSectionSourceId = await createComponent({
117533
+ const createSection = useCallback(() => {
117534
+ createComponent({
117733
117535
  componentType: "SbSection",
117734
117536
  parent: { id: sectionParentSourceId, index: indexForNewSection },
117735
117537
  scopeName: sectionParentScopeName
117736
117538
  });
117737
- if (newSectionSourceId) {
117738
- const newSectionInstanceId = getEditStore().runtimeEntitiesManager.widgets.getAnyInstanceIdForSourceId(
117739
- newSectionSourceId
117740
- );
117741
- getEditStore().ui.selectWidget(newSectionInstanceId);
117742
- }
117743
117539
  }, [sectionParentSourceId, indexForNewSection, sectionParentScopeName]);
117744
117540
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
117745
117541
  Wrapper$2,
@@ -117830,17 +117626,10 @@ const canResizeHeight = (heightMode) => {
117830
117626
  return heightMode === "px" || heightMode === "rows" || heightMode === "gridUnit";
117831
117627
  };
117832
117628
  const useResizeCapabilities = (instanceId) => {
117833
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
117629
+ var _a2, _b2, _c2, _d2, _e2;
117834
117630
  const widget = (_a2 = rootStore.editStore) == null ? void 0 : _a2.runtimeEntitiesManager.getEditorWidgetMeta(instanceId);
117835
- if ((widget == null ? void 0 : widget.type) === "SbIcon") {
117836
- const sizeMode = (_c2 = (_b2 = widget.props) == null ? void 0 : _b2.size) == null ? void 0 : _c2.mode;
117837
- return {
117838
- canResizeWidth: sizeMode != null && sizeMode !== "fit",
117839
- canResizeHeight: false
117840
- };
117841
- }
117842
- const widthMode = (_e2 = (_d2 = widget == null ? void 0 : widget.props) == null ? void 0 : _d2.width) == null ? void 0 : _e2.mode;
117843
- const heightMode = (_g2 = (_f2 = widget == null ? void 0 : widget.props) == null ? void 0 : _f2.height) == null ? void 0 : _g2.mode;
117631
+ const widthMode = (_c2 = (_b2 = widget == null ? void 0 : widget.props) == null ? void 0 : _b2.width) == null ? void 0 : _c2.mode;
117632
+ const heightMode = (_e2 = (_d2 = widget == null ? void 0 : widget.props) == null ? void 0 : _d2.height) == null ? void 0 : _e2.mode;
117844
117633
  return {
117845
117634
  canResizeWidth: canResizeWidth(widthMode),
117846
117635
  canResizeHeight: canResizeHeight(heightMode)
@@ -117865,9 +117654,7 @@ const HandlesWrapper = qe$1.div`
117865
117654
  pointer-events: none;
117866
117655
  `;
117867
117656
  const InteractionRectHandles = (props2) => {
117868
- var _a2;
117869
117657
  const { instanceId, isDragging, selectionType } = props2;
117870
- const type5 = (_a2 = rootStore.editStore) == null ? void 0 : _a2.runtimeEntitiesManager.getEditorWidgetType(instanceId);
117871
117658
  const [showPopover, setShowPopover] = useState(null);
117872
117659
  const { canResizeWidth: canResizeWidth2, canResizeHeight: canResizeHeight2 } = useResizeCapabilities(instanceId);
117873
117660
  const timeoutRef = useRef(null);
@@ -117880,8 +117667,8 @@ const InteractionRectHandles = (props2) => {
117880
117667
  }, []);
117881
117668
  const throttledResizeWidget = useMemo$2(
117882
117669
  () => lodashExports.throttle((e3) => {
117883
- var _a3;
117884
- (_a3 = rootStore.editStore) == null ? void 0 : _a3.ui.resizing.resizeWidget(
117670
+ var _a2;
117671
+ (_a2 = rootStore.editStore) == null ? void 0 : _a2.ui.resizing.resizeWidget(
117885
117672
  e3.clientX,
117886
117673
  e3.clientY,
117887
117674
  instanceId,
@@ -117898,14 +117685,14 @@ const InteractionRectHandles = (props2) => {
117898
117685
  [throttledResizeWidget]
117899
117686
  );
117900
117687
  const handlePointerUp = useCallback(() => {
117901
- var _a3;
117902
- (_a3 = rootStore.editStore) == null ? void 0 : _a3.ui.resizing.applyResize(instanceId);
117688
+ var _a2;
117689
+ (_a2 = rootStore.editStore) == null ? void 0 : _a2.ui.resizing.applyResize(instanceId);
117903
117690
  window.removeEventListener("pointermove", handlePointerMove);
117904
117691
  window.removeEventListener("pointerup", handlePointerUp);
117905
117692
  }, [handlePointerMove, instanceId]);
117906
117693
  const handlePointerDown = useCallback(
117907
117694
  (e3, position2) => {
117908
- var _a3;
117695
+ var _a2;
117909
117696
  e3.stopPropagation();
117910
117697
  e3.preventDefault();
117911
117698
  if (timeoutRef.current) {
@@ -117923,7 +117710,7 @@ const InteractionRectHandles = (props2) => {
117923
117710
  return;
117924
117711
  }
117925
117712
  setShowPopover(null);
117926
- (_a3 = rootStore.editStore) == null ? void 0 : _a3.ui.resizing.startResizing(
117713
+ (_a2 = rootStore.editStore) == null ? void 0 : _a2.ui.resizing.startResizing(
117927
117714
  e3.clientX,
117928
117715
  e3.clientY,
117929
117716
  instanceId,
@@ -118011,7 +117798,7 @@ const InteractionRectHandles = (props2) => {
118011
117798
  }
118012
117799
  }
118013
117800
  },
118014
- content: /* @__PURE__ */ jsxRuntimeExports.jsx(NotifierTooltipBody, { children: pos2 === "left" || pos2 === "right" ? "Width cannot be resized. Change width to pixel to enable manual resizing." : pos2 === "top" || pos2 === "bottom" ? type5 === "SbIcon" ? "Icons can be resized by changing its width." : "Height cannot be resized. Change height to pixel to enable manual resizing." : "" }),
117801
+ content: /* @__PURE__ */ jsxRuntimeExports.jsx(NotifierTooltipBody, { children: pos2 === "left" || pos2 === "right" ? "Width cannot be resized. Change width to pixel to enable manual resizing." : pos2 === "top" || pos2 === "bottom" ? "Height cannot be resized. Change height to pixel to enable manual resizing." : "" }),
118015
117802
  children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { width: "100%", height: "100%" } })
118016
117803
  }
118017
117804
  )
@@ -119236,7 +119023,7 @@ function useTypographyStyling({
119236
119023
  };
119237
119024
  }
119238
119025
  const DEFAULT_ICON_SPACING = 8;
119239
- const DEFAULT_ICON_SIZE = 16;
119026
+ const DEFAULT_ICON_SIZE$1 = 16;
119240
119027
  const ICON_POSITION_OPTIONS = [
119241
119028
  {
119242
119029
  icon: "ICON_LEFT_ALIGN",
@@ -120027,7 +119814,7 @@ const getStackChildStyle = ({
120027
119814
  parentWidth
120028
119815
  }) => {
120029
119816
  const height = (childProps == null ? void 0 : childProps.height) ?? Dim.fit();
120030
- let heightCss = (
119817
+ const heightCss = (
120031
119818
  // using 100% height when there is only one child and user's intention to set the child height as exact 100%, e.g. an image with large original height
120032
119819
  // if parent height is fit-content, child height 100% will cause unexpected height if child is empty container
120033
119820
  childCount === 1 && (height == null ? void 0 : height.mode) === "fill" && (parentHeight == null ? void 0 : parentHeight.mode) !== "fit" ? { height: "100%" } : dimToCSS(height, "height", primary === "height")
@@ -120035,18 +119822,23 @@ const getStackChildStyle = ({
120035
119822
  const width = (childProps == null ? void 0 : childProps.width) ?? (["SbText", "SbButton", "SbCheckbox", "SbSwitch"].includes(
120036
119823
  (childProps == null ? void 0 : childProps.type) ?? ""
120037
119824
  ) ? Dim.fit() : Dim.fill());
120038
- let widthCss = childCount === 1 && (width == null ? void 0 : width.mode) === "fill" && (parentWidth == null ? void 0 : parentWidth.mode) !== "fit" ? { width: "100%" } : dimToCSS(width, "width", primary === "width");
120039
- if ((childProps == null ? void 0 : childProps.type) === "SbIcon") {
120040
- heightCss = dimToCSS(Dim.fit(), "height", false);
120041
- widthCss = dimToCSS(Dim.fit(), "width", false);
120042
- }
120043
- const widthInPx = (width == null ? void 0 : width.mode) === "px";
120044
- const heightInPx = (height == null ? void 0 : height.mode) === "px";
120045
- const shouldNotShrink = widthInPx && primary === "width" || heightInPx && primary === "height";
120046
- const minWidthCss = widthInPx ? {} : getMinMaxCss(childProps == null ? void 0 : childProps.minWidth, "minWidth");
120047
- const maxWidthCss = widthInPx ? {} : getMinMaxCss(childProps == null ? void 0 : childProps.maxWidth, "maxWidth");
120048
- const minHeightCss = heightInPx ? {} : getMinMaxCss(childProps == null ? void 0 : childProps.minHeight, "minHeight");
120049
- const maxHeightCss = heightInPx ? {} : getMinMaxCss(childProps == null ? void 0 : childProps.maxHeight, "maxHeight");
119825
+ const widthCss = childCount === 1 && (width == null ? void 0 : width.mode) === "fill" && (parentWidth == null ? void 0 : parentWidth.mode) !== "fit" ? { width: "100%" } : dimToCSS(width, "width", primary === "width");
119826
+ const minWidthCss = getMinMaxCss(
119827
+ childProps == null ? void 0 : childProps.minWidth,
119828
+ "minWidth"
119829
+ );
119830
+ const maxWidthCss = getMinMaxCss(
119831
+ childProps == null ? void 0 : childProps.maxWidth,
119832
+ "maxWidth"
119833
+ );
119834
+ const minHeightCss = getMinMaxCss(
119835
+ childProps == null ? void 0 : childProps.minHeight,
119836
+ "minHeight"
119837
+ );
119838
+ const maxHeightCss = getMinMaxCss(
119839
+ childProps == null ? void 0 : childProps.maxHeight,
119840
+ "maxHeight"
119841
+ );
120050
119842
  const margin2 = (childProps == null ? void 0 : childProps.margin) ?? {
120051
119843
  top: Dim.px(0),
120052
119844
  bottom: Dim.px(0),
@@ -120056,7 +119848,6 @@ const getStackChildStyle = ({
120056
119848
  const marginCss = { margin: generatePaddingStyle(margin2) };
120057
119849
  const stickyCss = (childProps == null ? void 0 : childProps.sticky) ? { position: "sticky", top: "0px", zIndex: Layers$1.stickySections } : {};
120058
119850
  const style2 = {
120059
- ...shouldNotShrink ? { flexShrink: 0 } : {},
120060
119851
  ...heightCss,
120061
119852
  ...widthCss,
120062
119853
  ...minHeightCss,
@@ -120267,16 +120058,20 @@ const generateClassName = (seed2) => {
120267
120058
  return `superblocks_widget_${seed2}`;
120268
120059
  };
120269
120060
  const getCanvasClassName = () => "canvas";
120061
+ const getChildName = (child) => {
120062
+ var _a2;
120063
+ return ((_a2 = getBindingIdentifier(child.props.bind)) == null ? void 0 : _a2.entityName) ?? child.props[WIDGET_SOURCE_ID_ATTRIBUTE];
120064
+ };
120270
120065
  const calculateRowPositions = (orderedNames, childrenArray, rowHeight, pxHeights) => {
120271
120066
  return orderedNames.reduce(
120272
120067
  (acc, name) => {
120273
120068
  var _a2;
120274
- const child = childrenArray.find((child2) => child2.name === name);
120069
+ const child = childrenArray.find((child2) => getChildName(child2) === name);
120275
120070
  if (!child) {
120276
120071
  return acc;
120277
120072
  }
120278
- const marginTopPx = (((_a2 = child.marginTop) == null ? void 0 : _a2.value) ?? 0) * rowHeight;
120279
- const constraintTop = child.constraintTop;
120073
+ const marginTopPx = (((_a2 = child.props.marginTop) == null ? void 0 : _a2.value) ?? 0) * rowHeight;
120074
+ const constraintTop = child.props.constraintTop;
120280
120075
  const bottomFunc = (name2) => {
120281
120076
  const topRow = acc[name2];
120282
120077
  const pxHeight = pxHeights[name2];
@@ -120301,16 +120096,16 @@ const calculateRowPositions = (orderedNames, childrenArray, rowHeight, pxHeights
120301
120096
  const orderConstraints = (children) => {
120302
120097
  const childrenMap = children.reduce(
120303
120098
  (acc, child) => {
120304
- acc[child.name] = child;
120099
+ acc[getChildName(child)] = child;
120305
120100
  return acc;
120306
120101
  },
120307
120102
  {}
120308
120103
  );
120309
120104
  const constraintsMap = children.reduce(
120310
120105
  (acc, child) => {
120311
- if (child.constraintTop) {
120312
- const constraints = Array.isArray(child.constraintTop) ? child.constraintTop : [child.constraintTop];
120313
- acc[child.name] = constraints.filter(
120106
+ if (child.props.constraintTop) {
120107
+ const constraints = Array.isArray(child.props.constraintTop) ? child.props.constraintTop : [child.props.constraintTop];
120108
+ acc[getChildName(child)] = constraints.filter(
120314
120109
  (constraint) => !!childrenMap[constraint]
120315
120110
  );
120316
120111
  }
@@ -120322,24 +120117,24 @@ const orderConstraints = (children) => {
120322
120117
  const foundItems = /* @__PURE__ */ new Set();
120323
120118
  const itemsLeft = /* @__PURE__ */ new Set();
120324
120119
  children.forEach((child) => {
120325
- const constraints = constraintsMap[child.name] ?? [];
120120
+ const constraints = constraintsMap[getChildName(child)] ?? [];
120326
120121
  const hasNoConstraints = constraints.length === 0;
120327
120122
  if (hasNoConstraints) {
120328
- foundItems.add(child.name);
120329
- orderedNames.push(child.name);
120123
+ foundItems.add(getChildName(child));
120124
+ orderedNames.push(getChildName(child));
120330
120125
  } else {
120331
120126
  itemsLeft.add(child);
120332
120127
  }
120333
120128
  });
120334
120129
  while (itemsLeft.size > 0) {
120335
120130
  itemsLeft.forEach((child) => {
120336
- const constraints = constraintsMap[child.name] ?? [];
120131
+ const constraints = constraintsMap[getChildName(child)] ?? [];
120337
120132
  const constraintsLeft = constraints.filter(
120338
120133
  (constraint) => !foundItems.has(constraint)
120339
120134
  );
120340
120135
  if (constraintsLeft.length === 0) {
120341
- foundItems.add(child.name);
120342
- orderedNames.push(child.name);
120136
+ foundItems.add(getChildName(child));
120137
+ orderedNames.push(getChildName(child));
120343
120138
  itemsLeft.delete(child);
120344
120139
  }
120345
120140
  });
@@ -120390,148 +120185,99 @@ const heightReducer = (state, action2) => {
120390
120185
  }
120391
120186
  };
120392
120187
  const EMPTY_ARRAY$1 = [];
120393
- const GridChild = observer(
120394
- ({
120395
- childProps,
120396
- gridPositions,
120397
- rowHeight,
120398
- dispatchHeight,
120399
- childElement
120400
- }) => {
120401
- var _a2, _b2;
120402
- const heightMode = ((_a2 = childProps.height) == null ? void 0 : _a2.mode) ?? "fit";
120403
- const top2 = gridPositions[childProps.name].top;
120404
- const left2 = gridPositions[childProps.name].left;
120405
- const rows = gridPositions[childProps.name].height;
120406
- const columns = gridPositions[childProps.name].width;
120407
- const Component3 = heightMode === "fit" || childProps.sbType === "SbIcon" ? MeasuredComponent : StaticComponent;
120188
+ const InternalGrid = ({
120189
+ children = EMPTY_ARRAY$1,
120190
+ ...props2
120191
+ }) => {
120192
+ var _a2, _b2;
120193
+ const isEditing = Boolean((_a2 = rootStore.editStore) == null ? void 0 : _a2.isInitialized);
120194
+ const { style: style2, ...passThroughProps } = usePassthroughProps(props2);
120195
+ const rowHeight = ((_b2 = props2.rowHeight) == null ? void 0 : _b2.value) ?? 12;
120196
+ const childrenArray = useMemo$2(() => {
120197
+ let childrenArray2 = Array.isArray(children) ? children : [children];
120198
+ if (!isEditing) {
120199
+ childrenArray2 = childrenArray2.filter(
120200
+ (child) => child.props.isVisible !== false
120201
+ );
120202
+ }
120203
+ return childrenArray2;
120204
+ }, [children, isEditing]);
120205
+ const columns = props2.columns ?? 12;
120206
+ const [pxHeights, dispatchHeight] = React__default.useReducer(heightReducer, {});
120207
+ const gridPositions = useMemo$2(() => {
120208
+ const orderedNames = orderConstraints(childrenArray);
120209
+ const rowPos = calculateRowPositions(
120210
+ orderedNames,
120211
+ childrenArray,
120212
+ rowHeight,
120213
+ pxHeights
120214
+ );
120215
+ const positions = childrenArray.reduce(
120216
+ (acc, child) => {
120217
+ var _a3, _b3, _c2;
120218
+ let width = ((_a3 = child.props.width) == null ? void 0 : _a3.value) ?? (child.type.sbType === "SbTable" || child.type.sbType === "SbContainer" ? 6 : 2);
120219
+ if (((_b3 = child.props.width) == null ? void 0 : _b3.mode) === "fill") {
120220
+ width = columns;
120221
+ }
120222
+ acc[getChildName(child)] = {
120223
+ top: rowPos[getChildName(child)],
120224
+ left: ((_c2 = child.props.marginLeft) == null ? void 0 : _c2.value) ?? 0,
120225
+ width,
120226
+ height: Math.ceil(pxHeights[getChildName(child)] / rowHeight)
120227
+ };
120228
+ return acc;
120229
+ },
120230
+ {}
120231
+ );
120232
+ return positions;
120233
+ }, [columns, childrenArray, rowHeight, pxHeights]);
120234
+ const gridStyle = React__default.useMemo(() => {
120235
+ const spacingValue = 0;
120236
+ const columnsSize = `calc(${100 / columns}% - ${(columns - 1) * spacingValue / columns}px)`;
120237
+ return {
120238
+ display: "grid",
120239
+ gridAutoRows: `${rowHeight}px`,
120240
+ gap: `${spacingValue}px`,
120241
+ gridTemplateColumns: `repeat(${columns}, ${columnsSize})`,
120242
+ ...style2
120243
+ };
120244
+ }, [columns, rowHeight, style2]);
120245
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(DragDisplay, { passThroughProps, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: gridStyle, className: props2.className, children: childrenArray.map((child) => {
120246
+ var _a3, _b3;
120247
+ const heightMode = ((_a3 = child.props.height) == null ? void 0 : _a3.mode) ?? "fit";
120248
+ const top2 = gridPositions[getChildName(child)].top;
120249
+ const left2 = gridPositions[getChildName(child)].left;
120250
+ const rows = gridPositions[getChildName(child)].height;
120251
+ const columns2 = gridPositions[getChildName(child)].width;
120252
+ const Component3 = heightMode === "fit" ? MeasuredComponent : StaticComponent;
120408
120253
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
120409
120254
  "div",
120410
120255
  {
120411
120256
  style: {
120412
120257
  gridRow: `${top2 + 1} / span ${Math.max(1, rows)}`,
120413
- gridColumn: `${left2 + 1} / span ${Math.max(1, columns)}`,
120258
+ gridColumn: `${left2 + 1} / span ${Math.max(1, columns2)}`,
120414
120259
  width: "100%",
120415
120260
  maxWidth: "100%"
120416
120261
  },
120417
120262
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(
120418
120263
  Component3,
120419
120264
  {
120420
- staticHeight: (((_b2 = childProps.height) == null ? void 0 : _b2.value) ?? 0) * rowHeight,
120421
- style: childProps.sbType === "SbIcon" ? {
120422
- aspectRatio: "1"
120423
- } : void 0,
120265
+ staticHeight: (((_b3 = child.props.height) == null ? void 0 : _b3.value) ?? 0) * rowHeight,
120424
120266
  onHeightChanged: (height) => {
120425
120267
  dispatchHeight({
120426
120268
  type: "SET_HEIGHT",
120427
- name: childProps.name,
120269
+ name: getChildName(child),
120428
120270
  height
120429
120271
  });
120430
120272
  },
120431
- children: childElement
120273
+ children: child
120432
120274
  }
120433
120275
  )
120434
120276
  },
120435
- childProps.name
120277
+ getChildName(child)
120436
120278
  );
120437
- }
120438
- );
120439
- const InternalGrid = observer(
120440
- ({ children = EMPTY_ARRAY$1, ...props2 }) => {
120441
- var _a2;
120442
- const { style: style2, ...passThroughProps } = usePassthroughProps(props2);
120443
- const rowHeight = ((_a2 = props2.rowHeight) == null ? void 0 : _a2.value) ?? 12;
120444
- const childrenArray = useObserverMemo(() => {
120445
- var _a3;
120446
- const childrenArray2 = Array.isArray(children) ? children : [children];
120447
- const isEditing = Boolean((_a3 = rootStore.editStore) == null ? void 0 : _a3.isInitialized);
120448
- const withEvaluatedProps = childrenArray2.reduce((acc, child) => {
120449
- const bindingIdentifier = getBindingIdentifier(child.props.bind);
120450
- const entity = bindingIdentifier ? rootStore.entityManager.getEntity(bindingIdentifier.scopeId, {
120451
- value: bindingIdentifier.entityName,
120452
- isAnonymous: false
120453
- }) : null;
120454
- const sbType = isSbComponent(child) ? child.type.sbType : void 0;
120455
- const marginTop = (entity == null ? void 0 : entity.marginTop) ?? (isDimension(child.props.marginTop) ? child.props.marginTop : void 0);
120456
- const marginLeft = (entity == null ? void 0 : entity.marginLeft) ?? (isDimension(child.props.marginLeft) ? child.props.marginLeft : void 0);
120457
- let width = (entity == null ? void 0 : entity.width) ?? (isDimension(child.props.width) ? child.props.width : void 0);
120458
- if (sbType === "SbIcon") {
120459
- width = (entity == null ? void 0 : entity.size) ?? (isDimension(child.props.size) ? child.props.size : void 0);
120460
- }
120461
- const height = (entity == null ? void 0 : entity.height) ?? (isDimension(child.props.height) ? child.props.height : void 0);
120462
- const constraintTop = (entity == null ? void 0 : entity.constraintTop) ?? child.props.constraintTop;
120463
- const isVisible2 = (entity == null ? void 0 : entity.isVisible) ?? child.props.isVisible;
120464
- const gridChild = {
120465
- marginTop,
120466
- marginLeft,
120467
- width,
120468
- height,
120469
- constraintTop,
120470
- name: (bindingIdentifier == null ? void 0 : bindingIdentifier.entityName) ?? child.props[WIDGET_SOURCE_ID_ATTRIBUTE],
120471
- // source ID as a fallback
120472
- sbType,
120473
- element: child
120474
- };
120475
- if (isVisible2 !== false || isEditing) {
120476
- acc.push(gridChild);
120477
- }
120478
- return acc;
120479
- }, []);
120480
- return withEvaluatedProps;
120481
- }, [children]);
120482
- const columns = props2.columns ?? 12;
120483
- const [pxHeights, dispatchHeight] = React__default.useReducer(heightReducer, {});
120484
- const gridPositions = useMemo$2(() => {
120485
- const orderedNames = orderConstraints(childrenArray);
120486
- const rowPos = calculateRowPositions(
120487
- orderedNames,
120488
- childrenArray,
120489
- rowHeight,
120490
- pxHeights
120491
- );
120492
- const positions = childrenArray.reduce(
120493
- (acc, child) => {
120494
- var _a3, _b2, _c2;
120495
- let width = ((_a3 = child.width) == null ? void 0 : _a3.value) ?? (child.sbType === "SbTable" || child.sbType === "SbContainer" ? 6 : 2);
120496
- if (((_b2 = child.width) == null ? void 0 : _b2.mode) === "fill") {
120497
- width = columns;
120498
- }
120499
- acc[child.name] = {
120500
- top: rowPos[child.name],
120501
- left: ((_c2 = child.marginLeft) == null ? void 0 : _c2.value) ?? 0,
120502
- width,
120503
- height: Math.ceil(pxHeights[child.name] / rowHeight)
120504
- };
120505
- return acc;
120506
- },
120507
- {}
120508
- );
120509
- return positions;
120510
- }, [columns, childrenArray, rowHeight, pxHeights]);
120511
- const gridStyle = React__default.useMemo(() => {
120512
- const spacingValue = 0;
120513
- const columnsSize = `calc(${100 / columns}% - ${(columns - 1) * spacingValue / columns}px)`;
120514
- return {
120515
- display: "grid",
120516
- gridAutoRows: `${rowHeight}px`,
120517
- gap: `${spacingValue}px`,
120518
- gridTemplateColumns: `repeat(${columns}, ${columnsSize})`,
120519
- ...style2
120520
- };
120521
- }, [columns, rowHeight, style2]);
120522
- return /* @__PURE__ */ jsxRuntimeExports.jsx(DragDisplay, { passThroughProps, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: gridStyle, className: props2.className, children: childrenArray.map((child) => /* @__PURE__ */ jsxRuntimeExports.jsx(
120523
- GridChild,
120524
- {
120525
- childProps: child,
120526
- childElement: child.element,
120527
- gridPositions,
120528
- rowHeight,
120529
- dispatchHeight
120530
- },
120531
- child.name
120532
- )) }) });
120533
- }
120534
- );
120279
+ }) }) });
120280
+ };
120535
120281
  const DragDisplay = (props2) => {
120536
120282
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
120537
120283
  "div",
@@ -126455,9 +126201,9 @@ const getIconPositionStyle = ({
126455
126201
  right: offsetRight === "auto" ? offsetRight : `${offsetRight}px`
126456
126202
  };
126457
126203
  };
126458
- const getIconPadding = (paddingValue = INPUT_PADDING.right, iconSize = DEFAULT_ICON_SIZE, withSpacing = true) => {
126204
+ const getIconPadding = (paddingValue = INPUT_PADDING.right, iconSize = DEFAULT_ICON_SIZE$1, withSpacing = true) => {
126459
126205
  const spacing2 = withSpacing ? DEFAULT_ICON_SPACING : 0;
126460
- const baseValue = iconSize ? iconSize + spacing2 : DEFAULT_ICON_SIZE;
126206
+ const baseValue = iconSize ? iconSize + spacing2 : DEFAULT_ICON_SIZE$1;
126461
126207
  return Dim.px(baseValue + (paddingValue.value ?? 0));
126462
126208
  };
126463
126209
  const DEFAULT_LABEL_WIDTH_IN_PERCENT = 30;
@@ -127211,7 +126957,7 @@ const useInputIconSize = ({
127211
126957
  textStyleVariant: textStyle2.variant,
127212
126958
  defaultTextStyleVariant: DEFAULT_INPUT_TEXT_STYLE_VARIANT
127213
126959
  })
127214
- ) : DEFAULT_ICON_SIZE;
126960
+ ) : DEFAULT_ICON_SIZE$1;
127215
126961
  };
127216
126962
  const useInputGroupStylingProps = (props2) => {
127217
126963
  const { theme } = useTheme$1();
@@ -127428,7 +127174,7 @@ const _InputComponent = class _InputComponent extends React__default.Component {
127428
127174
  (padding2, iconPosition, iconSize) => {
127429
127175
  var _a2, _b2;
127430
127176
  let adjustedForIcon = {};
127431
- const horizontalPadding = iconSize ? iconSize + DEFAULT_ICON_SPACING : DEFAULT_ICON_SIZE;
127177
+ const horizontalPadding = iconSize ? iconSize + DEFAULT_ICON_SPACING : DEFAULT_ICON_SIZE$1;
127432
127178
  if (iconPosition === "left") {
127433
127179
  adjustedForIcon = {
127434
127180
  left: Dim.px(horizontalPadding + (((_a2 = padding2.left) == null ? void 0 : _a2.value) ?? 0))
@@ -127514,7 +127260,7 @@ const _InputComponent = class _InputComponent extends React__default.Component {
127514
127260
  );
127515
127261
  });
127516
127262
  __publicField(this, "passwordIconComponent", () => {
127517
- const iconSize = this.props.iconSize ?? DEFAULT_ICON_SIZE;
127263
+ const iconSize = this.props.iconSize ?? DEFAULT_ICON_SIZE$1;
127518
127264
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
127519
127265
  Button$4,
127520
127266
  {
@@ -127571,7 +127317,7 @@ const _InputComponent = class _InputComponent extends React__default.Component {
127571
127317
  });
127572
127318
  __publicField(this, "renderInputComponent", (inputType) => isNumericInput(inputType) ? this.numericInputComponent() : this.textInputComponent());
127573
127319
  __publicField(this, "renderIcon", () => {
127574
- const iconSize = this.props.iconSize ?? DEFAULT_ICON_SIZE;
127320
+ const iconSize = this.props.iconSize ?? DEFAULT_ICON_SIZE$1;
127575
127321
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
127576
127322
  "div",
127577
127323
  {
@@ -135138,7 +134884,7 @@ function requireButton() {
135138
134884
  }
135139
134885
  var buttonExports = /* @__PURE__ */ requireButton();
135140
134886
  const AntdButton = /* @__PURE__ */ getDefaultExportFromCjs(buttonExports);
135141
- const StyledButton = qe$1(AntdButton)`
134887
+ const StyledButton$1 = qe$1(AntdButton)`
135142
134888
  color: ${(props2) => props2.color};
135143
134889
  ${({ $width }) => $width ? `width: ${$width}` : ""};
135144
134890
  ${({ $bordered }) => !$bordered ? "border: 0px;" : ""};
@@ -135153,7 +134899,7 @@ const Button$2 = memo(
135153
134899
  forwardRef(
135154
134900
  ({ bordered = true, width, children, ...buttonProps }, ref2) => {
135155
134901
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
135156
- StyledButton,
134902
+ StyledButton$1,
135157
134903
  {
135158
134904
  $bordered: bordered,
135159
134905
  $width: width,
@@ -135934,7 +135680,8 @@ const RowDensity = {
135934
135680
  };
135935
135681
  const HorizontalAlignment = {
135936
135682
  left: "left",
135937
- right: "right"
135683
+ right: "right",
135684
+ center: "center"
135938
135685
  };
135939
135686
  const VerticalAlignment = {
135940
135687
  center: "center"
@@ -136051,7 +135798,7 @@ const PARSED_INPUT_TYPES = [
136051
135798
  EditInputType.Number,
136052
135799
  EditInputType.Checkbox
136053
135800
  ];
136054
- [
135801
+ const TextBoxEditTypes = [
136055
135802
  EditInputType.Text,
136056
135803
  EditInputType.Number,
136057
135804
  EditInputType.Email
@@ -136153,26 +135900,15 @@ const tableColumnTypes = [
136153
135900
  value: ColumnType.EMAIL
136154
135901
  }
136155
135902
  ];
136156
- const currentRowArg = (entity) => {
136157
- return {
136158
- name: "currentRow",
136159
- description: "Current row of the table. Use this to access the current row's data.",
136160
- type: "object",
136161
- schema: entity.tableData && Array.isArray(entity.tableData) && entity.tableData.length > 0 ? entity.tableData[0] : {}
136162
- };
136163
- };
136164
- const tableContextualArgs = function(entity) {
136165
- return [[currentRowArg(entity)]];
136166
- };
136167
135903
  const cellIconProps = {
136168
- cellIcon: Prop.string().readAndWrite().contextual(tableContextualArgs).propertiesPanel({
135904
+ cellIcon: Prop.string().readAndWrite().propertiesPanel({
136169
135905
  label: "Cell icon",
136170
135906
  controlType: "ICON_SELECTOR",
136171
135907
  isRemovable: true,
136172
135908
  visibility: "SHOW_NAME",
136173
135909
  defaultOnAdd: "info"
136174
135910
  }),
136175
- cellIconPosition: Prop.string().default("left").contextual(tableContextualArgs).readAndWrite().propertiesPanel({
135911
+ cellIconPosition: Prop.string().default("left").readAndWrite().propertiesPanel({
136176
135912
  label: "Cell icon position",
136177
135913
  controlType: "RADIO_BUTTON_GROUP",
136178
135914
  options: [
@@ -136189,7 +135925,7 @@ const cellIconProps = {
136189
135925
  ]
136190
135926
  })
136191
135927
  };
136192
- const horizontalAlignProp = () => Prop.string().readAndWrite().contextual(tableContextualArgs).propertiesPanel({
135928
+ const horizontalAlignProp = () => Prop.string().readAndWrite().propertiesPanel({
136193
135929
  label: "Horizontal alignment",
136194
135930
  controlType: "RADIO_BUTTON_GROUP",
136195
135931
  options: [
@@ -136198,7 +135934,7 @@ const horizontalAlignProp = () => Prop.string().readAndWrite().contextual(tableC
136198
135934
  { value: "right", icon: "RIGHT_ALIGN" }
136199
135935
  ]
136200
135936
  }).default("left");
136201
- const verticalAlignProp = () => Prop.string().readAndWrite().contextual(tableContextualArgs).propertiesPanel({
135937
+ const verticalAlignProp = () => Prop.string().readAndWrite().propertiesPanel({
136202
135938
  label: "Vertical alignment",
136203
135939
  controlType: "RADIO_BUTTON_GROUP",
136204
135940
  options: [
@@ -136209,7 +135945,7 @@ const verticalAlignProp = () => Prop.string().readAndWrite().contextual(tableCon
136209
135945
  }).default("center");
136210
135946
  const cellBackgroundProp = colorProp({
136211
135947
  label: "Background color"
136212
- }).contextual(tableContextualArgs).default(() => Theme.colors.neutral).readAndWrite();
135948
+ }).default(() => Theme.colors.neutral).readAndWrite();
136213
135949
  const textStyleProps = {
136214
135950
  horizontalAlign: horizontalAlignProp(),
136215
135951
  verticalAlign: verticalAlignProp(),
@@ -136217,7 +135953,7 @@ const textStyleProps = {
136217
135953
  propertiesPanel: {
136218
135954
  label: "Cell text style"
136219
135955
  }
136220
- }).contextual(tableContextualArgs).default(() => ({
135956
+ }).default(() => ({
136221
135957
  variant: DEFAULT_CELL_TEXT_STYLE_VARIANT
136222
135958
  })),
136223
135959
  cellBackground: cellBackgroundProp
@@ -136232,22 +135968,22 @@ const computedValueUnion = Prop.union({
136232
135968
  },
136233
135969
  {
136234
135970
  isDerived: Prop.literal(true),
136235
- computedValue: Prop.string().contextual(tableContextualArgs).readAndWrite().propertiesPanel({
135971
+ computedValue: Prop.string().readAndWrite().propertiesPanel({
136236
135972
  label: "Computed value"
135973
+ // todo: add special control that can use currentRow
136237
135974
  })
136238
135975
  }
136239
135976
  ]
136240
135977
  }).getProps();
136241
135978
  const textColumnProperties = {
136242
135979
  general: {
136243
- displayedValue: Prop.string().contextual(tableContextualArgs).readAndWrite().propertiesPanel({
135980
+ displayedValue: Prop.string().readAndWrite().propertiesPanel({
136244
135981
  label: "Displayed value",
136245
135982
  controlType: "COMPUTE_TABLE_VALUE"
136246
135983
  })
136247
135984
  },
136248
135985
  presentation: {
136249
- ...cellIconProps,
136250
- textWrap: Prop.boolean().contextual(tableContextualArgs).readAndWrite().propertiesPanel({
135986
+ textWrap: Prop.boolean().readAndWrite().propertiesPanel({
136251
135987
  label: "Wrap text",
136252
135988
  controlType: "SWITCH"
136253
135989
  }),
@@ -136257,25 +135993,23 @@ const textColumnProperties = {
136257
135993
  const emailColumnProperties = { ...textColumnProperties };
136258
135994
  const buttonColumnProperties = {
136259
135995
  general: {
136260
- buttonLabel: Prop.string().default("Action").contextual(tableContextualArgs).readAndWrite().propertiesPanel({
135996
+ buttonLabel: Prop.string().default("Action").readAndWrite().propertiesPanel({
136261
135997
  label: "Button label",
136262
135998
  controlType: "COMPUTE_TABLE_VALUE"
136263
135999
  }),
136264
- isDisabled: Prop.boolean().readAndWrite().contextual(tableContextualArgs).propertiesPanel({
136000
+ isDisabled: Prop.boolean().readAndWrite().propertiesPanel({
136265
136001
  label: "Disabled",
136266
136002
  controlType: "SWITCH"
136267
136003
  })
136268
136004
  },
136269
136005
  presentation: {
136270
- buttonIcon: Prop.string().readAndWrite().contextual(tableContextualArgs).propertiesPanel({
136006
+ buttonIcon: Prop.string().readAndWrite().propertiesPanel({
136271
136007
  label: "Button icon",
136272
136008
  controlType: "ICON_SELECTOR",
136273
136009
  isRemovable: true,
136274
136010
  visibility: "SHOW_NAME"
136275
136011
  }),
136276
- buttonIconPosition: Prop.string().readAndWrite().contextual(
136277
- tableContextualArgs
136278
- ).default("left").propertiesPanel({
136012
+ buttonIconPosition: Prop.string().readAndWrite().default("left").propertiesPanel({
136279
136013
  label: "Cell icon position",
136280
136014
  controlType: "RADIO_BUTTON_GROUP",
136281
136015
  options: [
@@ -136291,9 +136025,7 @@ const buttonColumnProperties = {
136291
136025
  }
136292
136026
  ]
136293
136027
  }),
136294
- buttonVariant: Prop.string().default("primary").contextual(
136295
- tableContextualArgs
136296
- ).readAndWrite().propertiesPanel({
136028
+ buttonVariant: Prop.string().default("primary").readAndWrite().propertiesPanel({
136297
136029
  label: "Button variant",
136298
136030
  controlType: "DROP_DOWN",
136299
136031
  options: [
@@ -136311,9 +136043,7 @@ const buttonColumnProperties = {
136311
136043
  }
136312
136044
  ]
136313
136045
  }),
136314
- buttonTextStyle: textStyleProp().contextual(
136315
- tableContextualArgs
136316
- ).default(function() {
136046
+ buttonTextStyle: textStyleProp().default(function() {
136317
136047
  return {
136318
136048
  variant: "buttonLabel",
136319
136049
  textColor: {
@@ -136331,32 +136061,28 @@ const buttonColumnProperties = {
136331
136061
  defaultOnAdd: function() {
136332
136062
  return getButtonThemeDefaultBackgroundColor(Theme, "primary");
136333
136063
  }
136334
- }).contextual(
136335
- tableContextualArgs
136336
- ).readAndWrite(),
136064
+ }).readAndWrite(),
136337
136065
  buttonBorder: border({
136338
136066
  defaultOnAdd: SECONDARY_BUTTON_BORDER_OBJECT,
136339
136067
  treatDefaultAsNull: function() {
136340
136068
  return true;
136341
136069
  }
136342
- }).readAndWrite().contextual(
136343
- tableContextualArgs
136344
- ).default(getDefaultBorderObject)
136070
+ }).default(getDefaultBorderObject)
136345
136071
  }
136346
136072
  };
136347
136073
  const numberColumnProperties = {
136348
136074
  general: {
136349
- notation: Prop.string().readAndWrite().contextual(tableContextualArgs).propertiesPanel({
136075
+ notation: Prop.string().readAndWrite().propertiesPanel({
136350
136076
  label: "Number format",
136351
136077
  controlType: "DROP_DOWN",
136352
136078
  options: NUMBER_FORMATTING_OPTIONS
136353
136079
  }),
136354
- minimumFractionDigits: Prop.number().contextual(tableContextualArgs).readAndWrite().propertiesPanel({
136080
+ minimumFractionDigits: Prop.number().readAndWrite().propertiesPanel({
136355
136081
  label: "Minimum fraction digits",
136356
136082
  isRemovable: true,
136357
136083
  visibility: "SHOW_NAME"
136358
136084
  }),
136359
- maximumFractionDigits: Prop.number().contextual(tableContextualArgs).readAndWrite().propertiesPanel({
136085
+ maximumFractionDigits: Prop.number().readAndWrite().propertiesPanel({
136360
136086
  label: "Maximum fraction digits",
136361
136087
  isRemovable: true,
136362
136088
  visibility: "SHOW_NAME"
@@ -136364,7 +136090,7 @@ const numberColumnProperties = {
136364
136090
  },
136365
136091
  presentation: {
136366
136092
  ...cellIconProps,
136367
- textWrap: Prop.boolean().contextual(tableContextualArgs).readAndWrite().propertiesPanel({
136093
+ textWrap: Prop.boolean().readAndWrite().propertiesPanel({
136368
136094
  label: "Wrap text",
136369
136095
  controlType: "SWITCH"
136370
136096
  }),
@@ -136377,9 +136103,7 @@ const percentageColumnProperties = {
136377
136103
  };
136378
136104
  const currencyColumnProperties = {
136379
136105
  general: {
136380
- currency: Prop.string().default("USD").contextual(
136381
- tableContextualArgs
136382
- ).readAndWrite().propertiesPanel({
136106
+ currency: Prop.string().default("USD").readAndWrite().propertiesPanel({
136383
136107
  label: "Currency",
136384
136108
  controlType: "DROP_DOWN",
136385
136109
  options: CurrencyList.map((currency) => ({
@@ -136393,11 +136117,12 @@ const currencyColumnProperties = {
136393
136117
  };
136394
136118
  const linkColumnProperties = {
136395
136119
  general: {
136396
- linkUrl: Prop.string().readAndWrite().contextual(tableContextualArgs).propertiesPanel({
136397
- label: "Link URL",
136398
- controlType: "COMPUTE_TABLE_VALUE"
136399
- }),
136400
- linkLabel: Prop.string().contextual(tableContextualArgs).readAndWrite().propertiesPanel({
136120
+ // todo: re-add when we have a way to access currentRow
136121
+ // linkUrl: Prop.string().readAndWrite().propertiesPanel({
136122
+ // label: "Link URL",
136123
+ // controlType: "COMPUTE_TABLE_VALUE",
136124
+ // }),
136125
+ linkLabel: Prop.string().readAndWrite().propertiesPanel({
136401
136126
  label: "Link label",
136402
136127
  controlType: "COMPUTE_TABLE_VALUE"
136403
136128
  })
@@ -136413,15 +136138,13 @@ const linkColumnProperties = {
136413
136138
  };
136414
136139
  const imageColumnProperties = {
136415
136140
  general: {
136416
- openImageUrl: Prop.boolean().contextual(tableContextualArgs).default(false).readAndWrite().propertiesPanel({
136141
+ openImageUrl: Prop.boolean().default(false).readAndWrite().propertiesPanel({
136417
136142
  label: "Open URL on click",
136418
136143
  controlType: "SWITCH"
136419
136144
  })
136420
136145
  },
136421
136146
  presentation: {
136422
- imageSize: Prop.string().readAndWrite().contextual(
136423
- tableContextualArgs
136424
- ).propertiesPanel({
136147
+ imageSize: Prop.string().readAndWrite().propertiesPanel({
136425
136148
  label: "Image sizing",
136426
136149
  controlType: "DROP_DOWN",
136427
136150
  options: [
@@ -136447,14 +136170,14 @@ const imageColumnProperties = {
136447
136170
  }
136448
136171
  ]
136449
136172
  }),
136450
- imageBorderRadius: borderRadius().contextual(tableContextualArgs),
136451
- horizontalAlign: horizontalAlignProp().contextual(tableContextualArgs),
136173
+ imageBorderRadius: borderRadius(),
136174
+ horizontalAlign: horizontalAlignProp(),
136452
136175
  cellBackground: cellBackgroundProp
136453
136176
  }
136454
136177
  };
136455
136178
  const manageTimezoneUnion = Prop.union({
136456
136179
  shared: {
136457
- manageTimezone: Prop.boolean().default(false).contextual(tableContextualArgs).readAndWrite().propertiesPanel({
136180
+ manageTimezone: Prop.boolean().default(false).readAndWrite().propertiesPanel({
136458
136181
  label: "Manage timezone",
136459
136182
  controlType: "SWITCH"
136460
136183
  })
@@ -136465,12 +136188,12 @@ const manageTimezoneUnion = Prop.union({
136465
136188
  },
136466
136189
  {
136467
136190
  manageTimezone: Prop.literal(true),
136468
- valueTimezone: Prop.string().contextual(tableContextualArgs).readAndWrite().propertiesPanel({
136191
+ valueTimezone: Prop.string().readAndWrite().propertiesPanel({
136469
136192
  label: "Value timezone",
136470
136193
  controlType: "DROP_DOWN",
136471
136194
  options: TIMEZONE_OPTIONS
136472
136195
  }),
136473
- displayTimezone: Prop.string().contextual(tableContextualArgs).readAndWrite().propertiesPanel({
136196
+ displayTimezone: Prop.string().readAndWrite().propertiesPanel({
136474
136197
  label: "Display timezone",
136475
136198
  controlType: "DROP_DOWN",
136476
136199
  options: TIMEZONE_OPTIONS
@@ -136480,12 +136203,12 @@ const manageTimezoneUnion = Prop.union({
136480
136203
  }).getProps();
136481
136204
  const dateColumnProperties = {
136482
136205
  general: {
136483
- inputFormat: Prop.string().contextual(tableContextualArgs).readAndWrite().propertiesPanel({
136206
+ inputFormat: Prop.string().readAndWrite().propertiesPanel({
136484
136207
  label: "Value format",
136485
136208
  controlType: "DROP_DOWN",
136486
136209
  options: DATE_INPUT_FORMATS
136487
136210
  }),
136488
- outputFormat: Prop.string().contextual(tableContextualArgs).readAndWrite().propertiesPanel({
136211
+ outputFormat: Prop.string().readAndWrite().propertiesPanel({
136489
136212
  label: "Display format",
136490
136213
  controlType: "DROP_DOWN",
136491
136214
  options: DATE_OUTPUT_FORMATS
@@ -136494,7 +136217,7 @@ const dateColumnProperties = {
136494
136217
  },
136495
136218
  presentation: {
136496
136219
  ...cellIconProps,
136497
- textWrap: Prop.boolean().readAndWrite().contextual(tableContextualArgs).propertiesPanel({
136220
+ textWrap: Prop.boolean().readAndWrite().propertiesPanel({
136498
136221
  label: "Wrap text",
136499
136222
  controlType: "SWITCH"
136500
136223
  }),
@@ -136550,7 +136273,7 @@ const tagsColumnProperties = {
136550
136273
  horizontalAlign: horizontalAlignProp(),
136551
136274
  verticalAlign: verticalAlignProp(),
136552
136275
  cellBackground: cellBackgroundProp,
136553
- tagsWrap: Prop.boolean().readAndWrite().contextual(tableContextualArgs).propertiesPanel({
136276
+ tagsWrap: Prop.boolean().readAndWrite().propertiesPanel({
136554
136277
  label: "Wrap tags",
136555
136278
  controlType: "SWITCH"
136556
136279
  }),
@@ -138600,9 +138323,7 @@ const ColumnHeaderWrapper = qe$1.div`
138600
138323
  gap: 4px;
138601
138324
  justify-content: ${(props2) => {
138602
138325
  var _a2, _b2;
138603
- return ((_a2 = props2 == null ? void 0 : props2.columnProperties) == null ? void 0 : _a2.horizontalAlign) && JUSTIFY_CONTENT[getFirstPropertyValue(
138604
- (_b2 = props2 == null ? void 0 : props2.columnProperties) == null ? void 0 : _b2.horizontalAlign
138605
- ) ?? HorizontalAlignment.left];
138326
+ return ((_a2 = props2 == null ? void 0 : props2.columnProperties) == null ? void 0 : _a2.horizontalAlign) && JUSTIFY_CONTENT[(_b2 = props2 == null ? void 0 : props2.columnProperties) == null ? void 0 : _b2.horizontalAlign];
138606
138327
  }};
138607
138328
  align-items: center;
138608
138329
  overflow: hidden;
@@ -138617,9 +138338,7 @@ const HeaderCellContentWrapper = qe$1.div`
138617
138338
  flex: 1;
138618
138339
  justify-content: ${(props2) => {
138619
138340
  var _a2, _b2;
138620
- return ((_a2 = props2 == null ? void 0 : props2.columnProperties) == null ? void 0 : _a2.horizontalAlign) && JUSTIFY_CONTENT[getFirstPropertyValue(
138621
- (_b2 = props2 == null ? void 0 : props2.columnProperties) == null ? void 0 : _b2.horizontalAlign
138622
- ) ?? HorizontalAlignment.left];
138341
+ return ((_a2 = props2 == null ? void 0 : props2.columnProperties) == null ? void 0 : _a2.horizontalAlign) && JUSTIFY_CONTENT[(_b2 = props2 == null ? void 0 : props2.columnProperties) == null ? void 0 : _b2.horizontalAlign];
138623
138342
  }};
138624
138343
  `;
138625
138344
  const TableIconWrapper = qe$1.div`
@@ -145793,14 +145512,14 @@ function getLoaderFn(options) {
145793
145512
  if (!(loader === "all")) return [3, 3];
145794
145513
  return [4, import(
145795
145514
  /* webpackChunkName: "blueprint-icons-all-paths-loader" */
145796
- "./allPathsLoader-rDsLNp7q.js"
145515
+ "./allPathsLoader-B3Ii4JGL.js"
145797
145516
  )];
145798
145517
  case 2:
145799
145518
  return [2, _b2.sent().allPathsLoader];
145800
145519
  case 3:
145801
145520
  return [4, import(
145802
145521
  /* webpackChunkName: "blueprint-icons-split-paths-by-size-loader" */
145803
- "./splitPathsBySizeLoader-DCl0XfAP.js"
145522
+ "./splitPathsBySizeLoader-Btq5cpt-.js"
145804
145523
  )];
145805
145524
  case 4:
145806
145525
  return [2, _b2.sent().splitPathsBySizeLoader];
@@ -153633,7 +153352,7 @@ const getClearableIconRight = memoizeOne$1(
153633
153352
  }
153634
153353
  const iconPadding = getIconPadding(
153635
153354
  inputPadding == null ? void 0 : inputPadding.right,
153636
- iconSize ?? DEFAULT_ICON_SIZE,
153355
+ iconSize ?? DEFAULT_ICON_SIZE$1,
153637
153356
  false
153638
153357
  );
153639
153358
  return iconPadding.value;
@@ -154147,7 +153866,7 @@ class DatePickerComponent extends React__default.Component {
154147
153866
  DynamicSVG,
154148
153867
  {
154149
153868
  iconName: this.props.icon,
154150
- size: this.props.iconSize ?? DEFAULT_ICON_SIZE
153869
+ size: this.props.iconSize ?? DEFAULT_ICON_SIZE$1
154151
153870
  }
154152
153871
  )
154153
153872
  }
@@ -154180,6 +153899,258 @@ class DatePickerComponent extends React__default.Component {
154180
153899
  );
154181
153900
  }
154182
153901
  }
153902
+ const DEFAULT_ICON_SIZE = 18;
153903
+ const DropdownEntireObjectOption$1 = "$$ENTIRE_OBJECT";
153904
+ const INVALID_LABEL_MSG = "Invalid label, should be a string";
153905
+ const extractDropdownOptions = (options, transformation) => {
153906
+ let opts = options;
153907
+ if (!Array.isArray(options)) {
153908
+ opts = [options];
153909
+ }
153910
+ let defaultLabelKey;
153911
+ const useEntireObjectAsValue = (transformation == null ? void 0 : transformation.value) === DropdownEntireObjectOption$1;
153912
+ const optionWithDefaultKey = (option) => {
153913
+ var _a2;
153914
+ if (defaultLabelKey) {
153915
+ return {
153916
+ label: typeof option[defaultLabelKey] === "object" ? INVALID_LABEL_MSG : option[defaultLabelKey],
153917
+ value: option
153918
+ };
153919
+ } else {
153920
+ defaultLabelKey = (_a2 = Object.keys(option).sort()) == null ? void 0 : _a2[0];
153921
+ return {
153922
+ label: typeof option[defaultLabelKey] === "object" ? INVALID_LABEL_MSG : option[defaultLabelKey],
153923
+ value: option
153924
+ };
153925
+ }
153926
+ };
153927
+ return opts.map((option) => {
153928
+ if (!option) {
153929
+ return null;
153930
+ }
153931
+ if (typeof option !== "object") {
153932
+ return { label: option, value: option };
153933
+ }
153934
+ if (transformation) {
153935
+ if (option[transformation.label] == null || !useEntireObjectAsValue && option[transformation.value] == null) {
153936
+ return optionWithDefaultKey(option);
153937
+ }
153938
+ return {
153939
+ label: typeof option[transformation.label] === "object" ? INVALID_LABEL_MSG : option[transformation.label],
153940
+ value: useEntireObjectAsValue ? option : option[transformation.value]
153941
+ };
153942
+ }
153943
+ if (option.label == null || option.value == null) {
153944
+ return optionWithDefaultKey(option);
153945
+ }
153946
+ return option;
153947
+ }).filter((opt) => opt && opt.value != null && opt.label != null);
153948
+ };
153949
+ const CellStyle = Ae$1`
153950
+ border-radius: 4px;
153951
+ z-index: 3;
153952
+ ${({ $position }) => {
153953
+ return Ae$1`
153954
+ width: ${($position == null ? void 0 : $position.width) ? ($position == null ? void 0 : $position.width) - 2 : ""}px;
153955
+ `;
153956
+ }};
153957
+ box-shadow:
153958
+ 0px 0px 1px rgba(27, 30, 34, 0.24),
153959
+ 0px 1px 3px rgba(27, 30, 34, 0.12),
153960
+ 0px 12px 24px rgba(27, 30, 34, 0.12);
153961
+ .bp5-control-group:not(.bp5-vertical) > *:not(.bp5-divider) {
153962
+ margin-right: 0px;
153963
+ }
153964
+ .bp5-control-group {
153965
+ // TODO(wylie): Follow the instructions here for removing .bp5-popover-wrapper
153966
+ // https://github.com/palantir/blueprint/wiki/Popover2-migration
153967
+ .bp5-input-group::before {
153968
+ top: 2px;
153969
+ height: 100%;
153970
+ }
153971
+ }
153972
+ &&& {
153973
+ .bp5-input,
153974
+ .bp5-multi-select {
153975
+ border: none !important; // blueprint border style is important, need to override
153976
+ .bp5-tag-input-values {
153977
+ margin-top: 0px;
153978
+ }
153979
+ }
153980
+ }
153981
+
153982
+ &&&&& {
153983
+ .bp5-tag {
153984
+ margin-top: 1px;
153985
+ }
153986
+ }
153987
+
153988
+ position: absolute;
153989
+ top: 0px;
153990
+ left: 0px;
153991
+ `;
153992
+ const InputCellWrapper = qe$1.div`
153993
+ ${CellStyle}
153994
+ position: absolute;
153995
+ top: 0;
153996
+ left: 0;
153997
+ &&&&& {
153998
+ textarea {
153999
+ padding-top: 0px;
154000
+ padding-bottom: 0px;
154001
+ }
154002
+ input {
154003
+ ${(props2) => {
154004
+ var _a2, _b2;
154005
+ const height = ((_a2 = props2.$position) == null ? void 0 : _a2.height) != null ? (_b2 = props2.$position) == null ? void 0 : _b2.height : 0;
154006
+ if (height) {
154007
+ return `height: ${height}px;`;
154008
+ }
154009
+ }}
154010
+ }
154011
+ textarea,
154012
+ input {
154013
+ padding-left: 10px;
154014
+ min-height: ${({ $position, $rowDensity }) => {
154015
+ const minHeight = ($position == null ? void 0 : $position.height) != null ? ($position == null ? void 0 : $position.height) - TABLE_SIZES[$rowDensity].ROW_PADDING * 2 : 0;
154016
+ return `${minHeight}px`;
154017
+ }};
154018
+ text-align: ${(props2) => {
154019
+ var _a2;
154020
+ if ((_a2 = props2 == null ? void 0 : props2.cellProperties) == null ? void 0 : _a2.horizontalAlign) {
154021
+ return TEXT_ALIGN[props2.cellProperties.horizontalAlign];
154022
+ }
154023
+ }};
154024
+ font-size: ${(props2) => {
154025
+ return `${TABLE_SIZES[props2.$rowDensity].ROW_FONT_SIZE}px`;
154026
+ }};
154027
+ line-height: 1.5;
154028
+ border: none;
154029
+ &:focus {
154030
+ border: none;
154031
+ box-shadow: none;
154032
+ }
154033
+ }
154034
+ }
154035
+ `;
154036
+ const DropdownCellWrapper = qe$1.div`
154037
+ ${CellStyle};
154038
+ height: 100%;
154039
+ .${CONTROL_GROUP} {
154040
+ height: 100%;
154041
+ }
154042
+
154043
+ &&&&& .${POPOVER_OPEN$1} input {
154044
+ ${({ clearable }) => clearable && "padding-right: 50px"}
154045
+ }
154046
+
154047
+ .dropdown-wrapper {
154048
+ height: 100%;
154049
+ *:not(.${CLASS_NAMES.DROPDOWN_CLEAR_ICON}) {
154050
+ height: 100%;
154051
+ }
154052
+ .${CLASS_NAMES.INPUT}::before {
154053
+ top: calc(50% + 1px);
154054
+ transform: translateY(-50%);
154055
+ height: ${DEFAULT_ICON_SIZE}px;
154056
+ }
154057
+
154058
+ input {
154059
+ height: 100%;
154060
+ }
154061
+ }
154062
+ `;
154063
+ const DateCellWrapper = qe$1(DropdownCellWrapper)`
154064
+ ${CellStyle}
154065
+ height: 100%;
154066
+ .${CONTROL_GROUP} {
154067
+ height: 100%;
154068
+ }
154069
+ .${POPOVER_TARGET$1} {
154070
+ height: 100%;
154071
+ * {
154072
+ height: 100%;
154073
+ }
154074
+ }
154075
+ &&&&& {
154076
+ input {
154077
+ height: 100%;
154078
+ min-height: 100%;
154079
+ top: 0px;
154080
+ padding-top: 0px;
154081
+ padding-bottom: 0px;
154082
+ }
154083
+ }
154084
+ `;
154085
+ const EditDateCell = (props2) => {
154086
+ const { value, editProps, inputPosition } = props2;
154087
+ const { handleEditStop, editMinDate, editMaxDate, editTwentyFourHourTime } = editProps;
154088
+ const {
154089
+ inputFormat,
154090
+ outputFormat,
154091
+ timezone,
154092
+ manageTimezone,
154093
+ displayTimezone
154094
+ } = props2.cellProps;
154095
+ const [date4, setDate2] = useState(value);
154096
+ const [closed, setClosed] = useState(false);
154097
+ const handleDateChange = useCallback(
154098
+ (date22) => {
154099
+ setDate2(date22);
154100
+ },
154101
+ [setDate2]
154102
+ );
154103
+ const handleDatepickerClose = useCallback(() => {
154104
+ if (closed) return;
154105
+ setClosed(true);
154106
+ handleEditStop({ shouldSave: true, value: date4, validationErrors: [] });
154107
+ }, [handleEditStop, closed, date4]);
154108
+ useEffect(() => {
154109
+ return () => {
154110
+ handleEditStop({ shouldSave: false });
154111
+ };
154112
+ }, []);
154113
+ const formattedMinDate = useMemo$2(() => {
154114
+ if (editMinDate) {
154115
+ return hooks(editMinDate, ISO_DATE_FORMAT).format(ISO_DATE_FORMAT);
154116
+ }
154117
+ }, [editMinDate]);
154118
+ const formattedMaxDate = useMemo$2(() => {
154119
+ if (editMaxDate) {
154120
+ return hooks(editMaxDate, ISO_DATE_FORMAT).format(ISO_DATE_FORMAT);
154121
+ }
154122
+ }, [editMaxDate]);
154123
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
154124
+ DateCellWrapper,
154125
+ {
154126
+ $position: inputPosition,
154127
+ $rowDensity: props2.rowDensity,
154128
+ cellProperties: props2.cellProps.cellProperties,
154129
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
154130
+ DatePickerComponent,
154131
+ {
154132
+ label: "",
154133
+ dateFormat: inputFormat,
154134
+ displayDateFormat: outputFormat,
154135
+ datePickerType: DatePickerType.DATE_PICKER,
154136
+ onDateSelected: handleDateChange,
154137
+ isLoading: false,
154138
+ isDisabled: false,
154139
+ selectedDate: date4,
154140
+ forceOpen: true,
154141
+ onDatePickerClosed: handleDatepickerClose,
154142
+ use24HourTime: editTwentyFourHourTime ?? true,
154143
+ minDate: formattedMinDate,
154144
+ maxDate: formattedMaxDate,
154145
+ timezone: manageTimezone ? timezone : void 0,
154146
+ displayTimezone: manageTimezone ? displayTimezone : void 0,
154147
+ showTimezone: false,
154148
+ errorMessagePlacement: "tooltip"
154149
+ }
154150
+ )
154151
+ }
154152
+ );
154153
+ };
154183
154154
  function usePointerDownOutside({
154184
154155
  wrapperRefs,
154185
154156
  wrapperIds,
@@ -154226,6 +154197,385 @@ function usePointerDownOutside({
154226
154197
  };
154227
154198
  }, [wrapperRefs, wrapperIds, wrapperSelectors, onClickOutside]);
154228
154199
  }
154200
+ const EditInputCell = (props2) => {
154201
+ var _a2, _b2, _c2;
154202
+ const { value, editProps, targetCellRef, inputPosition } = props2;
154203
+ const {
154204
+ handleEditStop,
154205
+ editInputType,
154206
+ editCustomValidationRule,
154207
+ editCustomErrorMessage,
154208
+ editMaxLength,
154209
+ editMinLength,
154210
+ editIsRequired,
154211
+ handleEditChange
154212
+ } = editProps;
154213
+ const [inputValue, setInputValue] = useState(
154214
+ typeof value === "object" && value ? JSON.stringify(value, null, 2) : value
154215
+ );
154216
+ const inputMemo = useRef(inputValue);
154217
+ const [validationErrors, setValidationErrors] = useState([]);
154218
+ const inputWrapperRef = useRef(null);
154219
+ const validateValue = useCallback(
154220
+ (toValidate) => {
154221
+ const errors2 = getInputValidationErrors({
154222
+ inputType: editInputType ?? "TEXT",
154223
+ text: String(toValidate ?? ""),
154224
+ emailRegex: new RegExp(`^${EmailRegexString}$`),
154225
+ customValidationRule: String(editCustomValidationRule),
154226
+ customErrorMessage: editCustomErrorMessage,
154227
+ maxLength: editMaxLength,
154228
+ minLength: editMinLength,
154229
+ isRequired: editIsRequired ?? false
154230
+ });
154231
+ const validationErrors2 = getErrorMessages(errors2);
154232
+ setValidationErrors(validationErrors2);
154233
+ return validationErrors2;
154234
+ },
154235
+ [
154236
+ editInputType,
154237
+ editCustomValidationRule,
154238
+ editCustomErrorMessage,
154239
+ editMaxLength,
154240
+ editMinLength,
154241
+ editIsRequired
154242
+ ]
154243
+ );
154244
+ useEffect(() => {
154245
+ validateValue(inputMemo.current);
154246
+ }, [validateValue]);
154247
+ const debouncedValidation = c(validateValue, 50);
154248
+ const handleValueChange = useCallback(
154249
+ (val) => {
154250
+ setInputValue(val);
154251
+ inputMemo.current = val;
154252
+ handleEditChange(val);
154253
+ debouncedValidation(val);
154254
+ },
154255
+ [debouncedValidation, handleEditChange]
154256
+ );
154257
+ const handleKeyDown = useCallback(
154258
+ (e3) => {
154259
+ if (e3.key === "Enter") {
154260
+ e3.preventDefault();
154261
+ const errors2 = validateValue(inputMemo.current);
154262
+ handleEditStop({
154263
+ shouldSave: true,
154264
+ value: inputMemo.current,
154265
+ validationErrors: errors2
154266
+ });
154267
+ }
154268
+ if (e3.key !== "Tab" && e3.key !== "Escape" && e3.key !== "Enter") {
154269
+ e3.stopPropagation();
154270
+ }
154271
+ },
154272
+ [handleEditStop, validateValue]
154273
+ );
154274
+ const saveChange = useCallback(() => {
154275
+ handleEditStop({
154276
+ shouldSave: true,
154277
+ value: inputValue,
154278
+ validationErrors
154279
+ });
154280
+ }, [handleEditStop, inputValue, validationErrors]);
154281
+ usePointerDownOutside({
154282
+ wrapperRefs: [inputWrapperRef],
154283
+ wrapperSelectors: ["[data-test=table-edit-input]"],
154284
+ onClickOutside: saveChange
154285
+ });
154286
+ useEffect(() => {
154287
+ return () => {
154288
+ handleEditStop({ shouldSave: false });
154289
+ };
154290
+ }, []);
154291
+ if (!targetCellRef.current || typeof (inputPosition == null ? void 0 : inputPosition.top) === "undefined" || // Validate that the intended element exists
154292
+ !((_c2 = (_b2 = (_a2 = targetCellRef.current.childNodes) == null ? void 0 : _a2[0]) == null ? void 0 : _b2.getAttribute) == null ? void 0 : _c2.call(
154293
+ _b2,
154294
+ "data-superblocks"
154295
+ ))) {
154296
+ return null;
154297
+ }
154298
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
154299
+ Popper,
154300
+ {
154301
+ targetNode: targetCellRef.current.childNodes[0],
154302
+ isOpen: true,
154303
+ placement: "auto",
154304
+ useDefaultModifiers: false,
154305
+ zIndex: 1,
154306
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
154307
+ InputCellWrapper,
154308
+ {
154309
+ "data-test": `table-edit-input`,
154310
+ $position: inputPosition,
154311
+ $rowDensity: props2.rowDensity,
154312
+ cellProperties: props2.cellProps.cellProperties,
154313
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
154314
+ "input",
154315
+ {
154316
+ value: inputValue,
154317
+ onChange: handleValueChange,
154318
+ onKeyDown: handleKeyDown
154319
+ }
154320
+ )
154321
+ }
154322
+ )
154323
+ }
154324
+ );
154325
+ };
154326
+ const EditMultiSelectCell = (props2) => {
154327
+ const dropdownRef = useRef(null);
154328
+ const { editProps, inputPosition, cellProps } = props2;
154329
+ const {
154330
+ currentEditValue,
154331
+ handleEditStop,
154332
+ handleEditChange,
154333
+ editIsRequired,
154334
+ editOptions = [],
154335
+ transformation,
154336
+ onDropdownSearchTextChanged
154337
+ // editDropdownClientSideFiltering,
154338
+ // currentEditDropdownSearchText,
154339
+ // dropdownOptionsLoading,
154340
+ } = editProps;
154341
+ const selectedOptions = useMemo$2(() => {
154342
+ return Array.isArray(currentEditValue) ? currentEditValue : currentEditValue != null ? [currentEditValue] : [];
154343
+ }, [currentEditValue]);
154344
+ const transformedEditOptions = useMemo$2(() => {
154345
+ return extractDropdownOptions(editOptions, transformation);
154346
+ }, [editOptions, transformation]);
154347
+ useMemo$2(() => {
154348
+ return selectedOptions ? selectedOptions.map((o) => lodashExports.findIndex(transformedEditOptions, { value: o })).filter((ind) => ind !== -1) : [];
154349
+ }, [selectedOptions, transformedEditOptions]);
154350
+ useCallback(
154351
+ (selectedOption) => {
154352
+ if (selectedOption) {
154353
+ const isAlreadySelected = selectedOptions.includes(
154354
+ selectedOption.value
154355
+ );
154356
+ if (!isAlreadySelected) {
154357
+ handleEditChange(
154358
+ [...selectedOptions, selectedOption.value],
154359
+ [
154360
+ {
154361
+ label: selectedOption.label,
154362
+ value: JSON.stringify(selectedOption.value)
154363
+ }
154364
+ ]
154365
+ );
154366
+ } else {
154367
+ handleEditChange(
154368
+ selectedOptions.filter(
154369
+ (opt) => opt !== selectedOption.value,
154370
+ [selectedOption]
154371
+ )
154372
+ );
154373
+ }
154374
+ }
154375
+ },
154376
+ [handleEditChange, selectedOptions]
154377
+ );
154378
+ useCallback(
154379
+ (removedIndex) => {
154380
+ const newSelectedValues = selectedOptions.filter(
154381
+ (value) => lodashExports.findIndex(transformedEditOptions, { value }) !== removedIndex
154382
+ );
154383
+ handleEditChange(newSelectedValues);
154384
+ },
154385
+ [handleEditChange, selectedOptions, transformedEditOptions]
154386
+ );
154387
+ useCallback(
154388
+ (options) => {
154389
+ handleEditChange(
154390
+ options.map(({ value }) => value),
154391
+ options.map((val) => ({ ...val, value: JSON.stringify(val.value) }))
154392
+ );
154393
+ },
154394
+ [handleEditChange]
154395
+ );
154396
+ useCallback(
154397
+ (query) => {
154398
+ onDropdownSearchTextChanged == null ? void 0 : onDropdownSearchTextChanged(query);
154399
+ },
154400
+ [onDropdownSearchTextChanged]
154401
+ );
154402
+ const handleDropdownClose = useCallback(() => {
154403
+ const validationErrors = selectedOptions.length === 0 && editIsRequired ? ["This field is required"] : [];
154404
+ handleEditStop({
154405
+ shouldSave: true,
154406
+ value: selectedOptions,
154407
+ validationErrors
154408
+ });
154409
+ }, [handleEditStop, selectedOptions, editIsRequired]);
154410
+ usePointerDownOutside({
154411
+ onClickOutside: handleDropdownClose,
154412
+ wrapperRefs: [dropdownRef],
154413
+ wrapperSelectors: [".bp5-multi-select-popover"]
154414
+ });
154415
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
154416
+ DropdownCellWrapper,
154417
+ {
154418
+ $position: inputPosition,
154419
+ $rowDensity: props2.rowDensity,
154420
+ ref: dropdownRef,
154421
+ cellProperties: cellProps.cellProperties
154422
+ }
154423
+ );
154424
+ };
154425
+ const EditSingleSelectCell = (props2) => {
154426
+ const { value, editProps, inputPosition } = props2;
154427
+ const {
154428
+ handleEditStop,
154429
+ // editIsRequired,
154430
+ editOptions = [],
154431
+ transformation,
154432
+ onDropdownSearchTextChanged,
154433
+ editDropdownClientSideFiltering,
154434
+ // currentEditDropdownSearchText,
154435
+ // dropdownOptionsLoading,
154436
+ allowClearing
154437
+ } = editProps;
154438
+ const transformedEditOptions = useMemo$2(() => {
154439
+ return extractDropdownOptions(editOptions, transformation);
154440
+ }, [editOptions, transformation]);
154441
+ useMemo$2(() => {
154442
+ return transformedEditOptions.findIndex((opt) => opt.value === value);
154443
+ }, [value, transformedEditOptions]);
154444
+ useCallback(
154445
+ (val) => {
154446
+ handleEditStop({
154447
+ shouldSave: true,
154448
+ value: val == null ? void 0 : val.value,
154449
+ validationErrors: [],
154450
+ dropdownOption: {
154451
+ ...val,
154452
+ value: (val == null ? void 0 : val.value) ? JSON.stringify(val == null ? void 0 : val.value) : ""
154453
+ }
154454
+ });
154455
+ },
154456
+ [handleEditStop]
154457
+ );
154458
+ useCallback(
154459
+ (query) => {
154460
+ onDropdownSearchTextChanged == null ? void 0 : onDropdownSearchTextChanged(query);
154461
+ },
154462
+ [onDropdownSearchTextChanged]
154463
+ );
154464
+ useEffect(() => {
154465
+ return () => {
154466
+ if (editDropdownClientSideFiltering) {
154467
+ handleEditStop({ shouldSave: false });
154468
+ }
154469
+ };
154470
+ }, [editDropdownClientSideFiltering]);
154471
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
154472
+ DropdownCellWrapper,
154473
+ {
154474
+ $rowDensity: props2.rowDensity,
154475
+ cellProperties: props2.cellProps.cellProperties,
154476
+ $position: inputPosition,
154477
+ clearable: allowClearing
154478
+ }
154479
+ );
154480
+ };
154481
+ const useGetInputPosition = (tableEl, cellEl) => {
154482
+ const firstRender = useRef(true);
154483
+ const [tableRect, setTableRect] = useState();
154484
+ const [cellRect, setCellRect] = useState();
154485
+ const measureTable = useCallback(() => {
154486
+ if (tableEl) {
154487
+ setTableRect(tableEl.getBoundingClientRect());
154488
+ }
154489
+ }, [tableEl]);
154490
+ const measureCell = useCallback(() => {
154491
+ if (cellEl) {
154492
+ setCellRect(cellEl.getBoundingClientRect());
154493
+ }
154494
+ }, [cellEl]);
154495
+ const measureCellAndTable = useCallback(() => {
154496
+ measureCell();
154497
+ measureTable();
154498
+ }, [measureCell, measureTable]);
154499
+ const debouncedMeasureCellAndTable = c(
154500
+ measureCellAndTable,
154501
+ 10
154502
+ );
154503
+ const debouncedMeasureCell = c(measureCell, 10);
154504
+ useLayoutEffect$2(measureTable, [measureTable]);
154505
+ useLayoutEffect$2(measureCell, [measureCell]);
154506
+ if (firstRender.current) {
154507
+ firstRender.current = false;
154508
+ measureTable();
154509
+ measureCell();
154510
+ }
154511
+ useEffect(() => {
154512
+ if (debouncedMeasureCell) {
154513
+ tableEl == null ? void 0 : tableEl.addEventListener("scroll", debouncedMeasureCell);
154514
+ }
154515
+ return () => {
154516
+ if (debouncedMeasureCell) {
154517
+ tableEl == null ? void 0 : tableEl.removeEventListener("scroll", debouncedMeasureCell);
154518
+ }
154519
+ };
154520
+ }, [tableEl, debouncedMeasureCell]);
154521
+ useResizeObserver(
154522
+ tableEl,
154523
+ debouncedMeasureCellAndTable ?? measureCellAndTable
154524
+ );
154525
+ useResizeObserver(cellEl, debouncedMeasureCell ?? measureCell);
154526
+ const top2 = cellRect && tableRect && tableEl ? cellRect.top - tableRect.top + tableEl.scrollTop : void 0;
154527
+ const left2 = cellRect && tableRect && tableEl ? cellRect.left - tableRect.left + tableEl.scrollLeft : void 0;
154528
+ return {
154529
+ width: (cellRect == null ? void 0 : cellRect.width) && left2 === 0 ? (cellRect == null ? void 0 : cellRect.width) - 10 : cellRect == null ? void 0 : cellRect.width,
154530
+ height: cellRect == null ? void 0 : cellRect.height,
154531
+ top: top2,
154532
+ left: left2 === 0 ? 10 : left2,
154533
+ maxHeight: tableRect && top2 ? (tableRect == null ? void 0 : tableRect.height) - top2 : void 0
154534
+ };
154535
+ };
154536
+ const EditCell = (props2) => {
154537
+ var _a2;
154538
+ const tableRef = useRef(
154539
+ document == null ? void 0 : document.querySelector(
154540
+ `[data-test=table-component-${props2.tableName}] tbody`
154541
+ )
154542
+ );
154543
+ const inputPosition = useGetInputPosition(
154544
+ tableRef == null ? void 0 : tableRef.current,
154545
+ (_a2 = props2.targetCellRef) == null ? void 0 : _a2.current
154546
+ );
154547
+ const propsToPass = useMemo$2(() => {
154548
+ return {
154549
+ editProps: props2.editProps,
154550
+ value: props2.value,
154551
+ rowDensity: props2.rowDensity,
154552
+ cellProps: props2.cellProps,
154553
+ inputPosition,
154554
+ theme: props2.theme
154555
+ };
154556
+ }, [
154557
+ inputPosition,
154558
+ props2.cellProps,
154559
+ props2.rowDensity,
154560
+ props2.editProps,
154561
+ props2.value,
154562
+ props2.theme
154563
+ ]);
154564
+ switch (props2.editProps.editInputType) {
154565
+ case EditInputType.Dropdown:
154566
+ if (props2.editProps.editMultiSelect) {
154567
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(EditMultiSelectCell, { ...propsToPass });
154568
+ }
154569
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(EditSingleSelectCell, { ...propsToPass });
154570
+ case EditInputType.Date:
154571
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(EditDateCell, { ...propsToPass });
154572
+ case EditInputType.Email:
154573
+ case EditInputType.Number:
154574
+ case EditInputType.Text:
154575
+ default:
154576
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(EditInputCell, { ...propsToPass, targetCellRef: props2.targetCellRef });
154577
+ }
154578
+ };
154229
154579
  const CheckboxInput = ({
154230
154580
  isChecked,
154231
154581
  isDisabled,
@@ -154276,6 +154626,279 @@ const CheckboxInput = ({
154276
154626
  }
154277
154627
  );
154278
154628
  };
154629
+ const StyledCellWrapper = qe$1(CellWrapper)`
154630
+ ${(props2) => {
154631
+ var _a2, _b2;
154632
+ return ((_a2 = props2 == null ? void 0 : props2.cellProperties) == null ? void 0 : _a2.horizontalAlign) === HorizontalAlignment.right ? "padding-right: 10px;" : ((_b2 = props2 == null ? void 0 : props2.cellProperties) == null ? void 0 : _b2.horizontalAlign) === HorizontalAlignment.center ? "padding-left: 19px;" : "";
154633
+ }};
154634
+
154635
+ > div {
154636
+ width: unset !important;
154637
+ }
154638
+
154639
+ .checkbox-container {
154640
+ display: none;
154641
+ }
154642
+
154643
+ .read-mode-component {
154644
+ display: flex;
154645
+ }
154646
+
154647
+ &[data-is-focused="true"] {
154648
+ .read-mode-component {
154649
+ display: none;
154650
+ }
154651
+
154652
+ .checkbox-container {
154653
+ display: flex;
154654
+ }
154655
+ }
154656
+
154657
+ &:hover:not([data-is-focused="true"]) {
154658
+ .read-mode-component {
154659
+ display: none;
154660
+ }
154661
+
154662
+ .checkbox-container {
154663
+ display: flex;
154664
+ }
154665
+ }
154666
+ `;
154667
+ const EditCheckboxCell = (props2) => {
154668
+ var _a2;
154669
+ const {
154670
+ value,
154671
+ editProps,
154672
+ readModeComponent,
154673
+ isFocused: propsIsFocused
154674
+ } = props2;
154675
+ const { handleOneClickEdit } = editProps;
154676
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(
154677
+ StyledCellWrapper,
154678
+ {
154679
+ rowDensity: props2.rowDensity,
154680
+ cellProperties: props2.cellProperties,
154681
+ "data-is-focused": propsIsFocused,
154682
+ "data-test": `edit-checkbox-active-${value}`,
154683
+ style: {
154684
+ height: ((_a2 = TABLE_SIZES == null ? void 0 : TABLE_SIZES[props2.rowDensity]) == null ? void 0 : _a2.ROW_HEIGHT) - 8
154685
+ },
154686
+ children: [
154687
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
154688
+ "div",
154689
+ {
154690
+ className: "read-mode-component",
154691
+ "data-test": `edit-checkbox-${value}`,
154692
+ style: {
154693
+ height: "100%",
154694
+ alignItems: "center"
154695
+ },
154696
+ children: readModeComponent
154697
+ }
154698
+ ),
154699
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
154700
+ CheckboxInput,
154701
+ {
154702
+ isChecked: value,
154703
+ isValid: true,
154704
+ isDisabled: false,
154705
+ onClick: handleOneClickEdit
154706
+ }
154707
+ )
154708
+ ]
154709
+ }
154710
+ );
154711
+ };
154712
+ const LinkLike = qe$1.div`
154713
+ cursor: pointer;
154714
+ `;
154715
+ const IconStyles = Ae$1`
154716
+ height: ${({ rowDensity }) => {
154717
+ var _a2;
154718
+ return ((_a2 = TABLE_SIZES[rowDensity]) == null ? void 0 : _a2.LINK_MENU_HEIGHT) ?? 32;
154719
+ }}px;
154720
+ padding: ${({ rowDensity }) => rowDensity === RowDensity["extra-small"] ? "7px" : rowDensity === RowDensity.small ? "9px" : "10px"};
154721
+ `;
154722
+ const StyledButton = qe$1(Button$5)`
154723
+ border: none;
154724
+ ${IconStyles}
154725
+ `;
154726
+ const LinkMenu = qe$1.div`
154727
+ display: flex;
154728
+ align-items: center;
154729
+ a {
154730
+ ${IconStyles}
154731
+ }
154732
+
154733
+ svg > path {
154734
+ fill: none !important;
154735
+ }
154736
+ `;
154737
+ const OpenLinkButton = ({
154738
+ url: url2,
154739
+ openInNewTab,
154740
+ rowDensity
154741
+ }) => {
154742
+ var _a2, _b2, _c2, _d2;
154743
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip$2, { title: "Open", children: openInNewTab === void 0 || openInNewTab === true ? (
154744
+ // todo laura: ask omar about how linking should work
154745
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
154746
+ "a",
154747
+ {
154748
+ href: url2,
154749
+ target: "_blank",
154750
+ "aria-disabled": true,
154751
+ "data-test": "table-cell-link-open",
154752
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
154753
+ SvgExternalLink,
154754
+ {
154755
+ style: {
154756
+ height: ((_a2 = TABLE_SIZES[rowDensity]) == null ? void 0 : _a2.LINK_MENU_ICON_SIZE) ?? 16,
154757
+ width: ((_b2 = TABLE_SIZES[rowDensity]) == null ? void 0 : _b2.LINK_MENU_ICON_SIZE) ?? 16
154758
+ }
154759
+ }
154760
+ )
154761
+ }
154762
+ )
154763
+ ) : /* @__PURE__ */ jsxRuntimeExports.jsx(
154764
+ PlainLink,
154765
+ {
154766
+ href: url2,
154767
+ rel: "noreferrer nofollow",
154768
+ target: "_parent",
154769
+ "data-test": "table-cell-link-open",
154770
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
154771
+ SvgExternalLink,
154772
+ {
154773
+ style: {
154774
+ height: ((_c2 = TABLE_SIZES[rowDensity]) == null ? void 0 : _c2.LINK_MENU_ICON_SIZE) ?? 16,
154775
+ width: ((_d2 = TABLE_SIZES[rowDensity]) == null ? void 0 : _d2.LINK_MENU_ICON_SIZE) ?? 16
154776
+ }
154777
+ }
154778
+ )
154779
+ }
154780
+ ) });
154781
+ };
154782
+ const EditableLinkCell = (props2) => {
154783
+ const {
154784
+ isHidden: isHidden2,
154785
+ url: url2,
154786
+ label,
154787
+ openInNewTab,
154788
+ isEdited,
154789
+ value,
154790
+ cellProperties,
154791
+ rowDensity,
154792
+ isFocused,
154793
+ defaultValue: defaultValue2,
154794
+ maxLinesPerRow,
154795
+ isMultiselecting
154796
+ } = props2;
154797
+ const [isMenuOpen, setIsMenuOpen] = useState(false);
154798
+ const cellRef = useRef(null);
154799
+ const popperRef = useRef(null);
154800
+ useEffect(() => {
154801
+ if (isMenuOpen && !isFocused) {
154802
+ setIsMenuOpen(false);
154803
+ } else if (!isMenuOpen && isFocused) {
154804
+ setIsMenuOpen(true);
154805
+ }
154806
+ }, [isFocused, isMenuOpen]);
154807
+ const { cellTextStyle, horizontalAlign, verticalAlign, textWrap } = cellProperties;
154808
+ const [className, styles] = useMemo$2(() => {
154809
+ const options = {
154810
+ canWrap: textWrap,
154811
+ maxLines: maxLinesPerRow
154812
+ };
154813
+ return [
154814
+ getCellClass(options),
154815
+ {
154816
+ ...getCellWrapStyles(options),
154817
+ ...buildCellStyles({
154818
+ cellTextStyle,
154819
+ horizontalAlign,
154820
+ verticalAlign
154821
+ })
154822
+ }
154823
+ ];
154824
+ }, [textWrap, maxLinesPerRow, cellTextStyle, horizontalAlign, verticalAlign]);
154825
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(
154826
+ CellWrapper,
154827
+ {
154828
+ ref: cellRef,
154829
+ isHidden: isHidden2,
154830
+ cellProperties,
154831
+ rowDensity,
154832
+ className,
154833
+ style: styles,
154834
+ children: [
154835
+ !value && defaultValue2 ? /* @__PURE__ */ jsxRuntimeExports.jsx(DefaultValueWrapper, { children: defaultValue2 }) : /* @__PURE__ */ jsxRuntimeExports.jsx(
154836
+ LinkLike,
154837
+ {
154838
+ style: {
154839
+ height: "100%",
154840
+ display: "flex",
154841
+ alignItems: "center"
154842
+ },
154843
+ className: CLASS_NAMES.LINK,
154844
+ children: isEdited ? value : label
154845
+ }
154846
+ ),
154847
+ isMenuOpen && /* @__PURE__ */ jsxRuntimeExports.jsx(
154848
+ Popper,
154849
+ {
154850
+ zIndex: 3,
154851
+ isOpen: isMenuOpen,
154852
+ targetNode: cellRef.current || void 0,
154853
+ placement: "bottom-start",
154854
+ ref: popperRef,
154855
+ children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
154856
+ LinkMenu,
154857
+ {
154858
+ "data-test": "table-cell-link-menu",
154859
+ rowDensity,
154860
+ className: CLASS_NAMES.POPOVER_WRAPPER,
154861
+ style: isMultiselecting ? {
154862
+ display: "none"
154863
+ } : void 0,
154864
+ children: [
154865
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip$2, { title: "Copy", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
154866
+ StyledButton,
154867
+ {
154868
+ rowDensity,
154869
+ onClick: () => {
154870
+ copy$1(url2);
154871
+ },
154872
+ "data-test": "table-cell-link-copy",
154873
+ type: "link",
154874
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
154875
+ SvgCopy,
154876
+ {
154877
+ style: {
154878
+ height: 16,
154879
+ width: 16
154880
+ }
154881
+ }
154882
+ )
154883
+ }
154884
+ ) }),
154885
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
154886
+ OpenLinkButton,
154887
+ {
154888
+ url: url2,
154889
+ openInNewTab,
154890
+ rowDensity
154891
+ }
154892
+ )
154893
+ ]
154894
+ }
154895
+ )
154896
+ }
154897
+ )
154898
+ ]
154899
+ }
154900
+ );
154901
+ };
154279
154902
  var lib = {};
154280
154903
  var players = {};
154281
154904
  var utils = {};
@@ -160560,7 +161183,7 @@ const formatByType = (value, type5, options) => {
160560
161183
  return text;
160561
161184
  }
160562
161185
  };
160563
- qe$1.div`
161186
+ const StyledEditableDiv = qe$1.div`
160564
161187
  position: relative;
160565
161188
  height: 100%;
160566
161189
  width: 100%;
@@ -160584,20 +161207,20 @@ qe$1.div`
160584
161207
  }
160585
161208
  }
160586
161209
  `;
160587
- qe$1.div`
161210
+ const EditableCellWrapper = qe$1.div`
160588
161211
  position: relative;
160589
161212
  height: 100%;
160590
161213
  width: 100%;
160591
161214
  padding: 0px;
160592
161215
  `;
160593
- qe$1.div`
161216
+ const StyledCheckmarkWrapper = qe$1.div`
160594
161217
  position: relative;
160595
161218
  height: 100%;
160596
161219
  width: 100%;
160597
161220
  border-radius: 4px;
160598
161221
  overflow: hidden;
160599
161222
  `;
160600
- qe$1.div`
161223
+ const EditMarker = qe$1.div`
160601
161224
  position: absolute;
160602
161225
  top: 0px;
160603
161226
  left: 0px;
@@ -160606,17 +161229,180 @@ qe$1.div`
160606
161229
  border-style: solid;
160607
161230
  border-width: 10px 10px 0 0;
160608
161231
  `;
160609
- qe$1(SvgChevronDown)`
161232
+ const StyledChevronDown = qe$1(SvgChevronDown)`
160610
161233
  width: 16px;
160611
161234
  height: 16px;
160612
161235
  flex-shrink: 0;
160613
161236
  visibility: hidden;
160614
161237
  `;
160615
- qe$1.div`
161238
+ const EditingCellWrapper = qe$1.div`
160616
161239
  width: 100%;
160617
161240
  height: 100%;
160618
161241
  position: relative;
160619
161242
  `;
161243
+ const EditableCell = (props2) => {
161244
+ const cellRef = useRef(null);
161245
+ const { theme } = props2;
161246
+ const {
161247
+ validationErrors,
161248
+ isEdited,
161249
+ isEditFocused,
161250
+ handleEditStart,
161251
+ editInputType
161252
+ } = props2.editProps;
161253
+ const isDropdownType = editInputType === EditInputType.Dropdown || editInputType === EditInputType.Date;
161254
+ const onEditableCellClick = useCallback(() => {
161255
+ if (!isEditFocused && isDropdownType) {
161256
+ handleEditStart();
161257
+ }
161258
+ }, [isEditFocused, isDropdownType, handleEditStart]);
161259
+ const onEditableCellDoubleClick = useCallback(
161260
+ (e3) => {
161261
+ if (!isEditFocused && !isDropdownType) {
161262
+ e3.stopPropagation();
161263
+ handleEditStart();
161264
+ }
161265
+ },
161266
+ [handleEditStart, isDropdownType, isEditFocused]
161267
+ );
161268
+ if (editInputType === EditInputType.Checkbox) {
161269
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(EditableCellWrapper, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(StyledCheckmarkWrapper, { className: "editable-cell", children: [
161270
+ isEdited && /* @__PURE__ */ jsxRuntimeExports.jsx(
161271
+ EditMarker,
161272
+ {
161273
+ style: {
161274
+ borderColor: `${theme.colors.primary500} transparent transparent transparent`,
161275
+ top: (theme.defaultBorder.borderRadius.value ?? 0) > 8 ? 2 : 0,
161276
+ left: (theme.defaultBorder.borderRadius.value ?? 0) > 8 ? 2 : 0
161277
+ }
161278
+ }
161279
+ ),
161280
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
161281
+ EditCheckboxCell,
161282
+ {
161283
+ editProps: props2.editProps,
161284
+ value: props2.rawValue,
161285
+ rowDensity: props2.rowDensity,
161286
+ cellProperties: props2.cellProps.cellProperties,
161287
+ isFocused: props2.cellProps.isFocused,
161288
+ readModeComponent: renderCell({
161289
+ value: props2.value,
161290
+ columnType: props2.columnType,
161291
+ cellProps: props2.cellProps,
161292
+ position: props2.position,
161293
+ theme
161294
+ })
161295
+ }
161296
+ )
161297
+ ] }) });
161298
+ }
161299
+ if (isEditFocused) {
161300
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(EditingCellWrapper, { ref: cellRef, className: "editing-cell-wrapper", children: [
161301
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
161302
+ "div",
161303
+ {
161304
+ "data-superblocks": "table-editor",
161305
+ style: { position: "absolute", top: 0, left: 0 }
161306
+ }
161307
+ ),
161308
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { visibility: "hidden" }, children: renderCell({
161309
+ value: props2.value,
161310
+ columnType: props2.columnType,
161311
+ cellProps: props2.cellProps,
161312
+ position: props2.position,
161313
+ maxLinesPerRow: props2.maxLinesPerRow,
161314
+ theme
161315
+ }) }),
161316
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
161317
+ EditCell,
161318
+ {
161319
+ targetCellRef: cellRef,
161320
+ editProps: props2.editProps,
161321
+ value: props2.editProps.editInputType && TextBoxEditTypes.includes(
161322
+ props2.editProps.editInputType
161323
+ ) ? props2.editProps.currentEditValue : props2.rawValue,
161324
+ tableName: props2.tableName,
161325
+ rowDensity: props2.rowDensity,
161326
+ cellProps: props2.cellProps,
161327
+ theme
161328
+ }
161329
+ )
161330
+ ] });
161331
+ }
161332
+ const { linkUrl, linkLabel, openInNewTab } = props2.cellProps.cellProperties;
161333
+ const defaultValue2 = props2.isInserted ? `Set ${props2.columnName}...` : "";
161334
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
161335
+ EditableCellWrapper,
161336
+ {
161337
+ onClick: onEditableCellClick,
161338
+ onDoubleClick: onEditableCellDoubleClick,
161339
+ children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
161340
+ StyledEditableDiv,
161341
+ {
161342
+ $isValid: validationErrors.length === 0,
161343
+ "data-test": props2.columnType === "link" ? `editable-link-${props2.tableName}-${props2.value}` : `editable-cell-${props2.tableName}-${props2.value}`,
161344
+ className: `editable-cell ${isDropdownType ? "dropdown-preview" : ""}`,
161345
+ "data-align": props2.cellProps.cellProperties.verticalAlign,
161346
+ hoverColor: theme.colors.neutral,
161347
+ style: {
161348
+ borderRadius: styleFromDimension(theme.defaultBorder.borderRadius),
161349
+ ...validationErrors.length === 0 ? {} : {
161350
+ border: generateBorderStyle(theme.defaultBorder),
161351
+ borderColor: theme.colors.danger
161352
+ }
161353
+ },
161354
+ children: [
161355
+ isEdited && /* @__PURE__ */ jsxRuntimeExports.jsx(
161356
+ EditMarker,
161357
+ {
161358
+ style: {
161359
+ borderColor: `${theme.colors.primary500} transparent transparent transparent`,
161360
+ top: (theme.defaultBorder.borderRadius.value ?? 0) > 8 ? 2 : 0,
161361
+ left: (theme.defaultBorder.borderRadius.value ?? 0) > 8 ? 2 : 0
161362
+ }
161363
+ }
161364
+ ),
161365
+ props2.columnType === "link" ? /* @__PURE__ */ jsxRuntimeExports.jsx(
161366
+ EditableLinkCell,
161367
+ {
161368
+ url: linkUrl ?? "",
161369
+ label: linkLabel ?? linkUrl ?? "",
161370
+ openInNewTab,
161371
+ isHidden: props2.cellProps.isHidden,
161372
+ isEdited,
161373
+ value: props2.rawValue,
161374
+ cellProperties: props2.cellProps.cellProperties,
161375
+ rowDensity: props2.rowDensity,
161376
+ isFocused: props2.cellProps.isFocused,
161377
+ position: props2.position,
161378
+ defaultValue: defaultValue2,
161379
+ maxLinesPerRow: props2.maxLinesPerRow,
161380
+ isMultiselecting: props2.cellProps.isMultiselecting
161381
+ }
161382
+ ) : renderCell({
161383
+ value: props2.value,
161384
+ columnType: props2.columnType,
161385
+ editInputType: props2.editProps.editInputType,
161386
+ cellProps: props2.cellProps,
161387
+ position: props2.position,
161388
+ defaultValue: defaultValue2,
161389
+ maxLinesPerRow: props2.maxLinesPerRow,
161390
+ theme
161391
+ }),
161392
+ (editInputType === EditInputType.Dropdown || editInputType === EditInputType.Date) && /* @__PURE__ */ jsxRuntimeExports.jsx(
161393
+ StyledChevronDown,
161394
+ {
161395
+ style: {
161396
+ color: theme.colors.neutral300
161397
+ }
161398
+ }
161399
+ )
161400
+ ]
161401
+ }
161402
+ )
161403
+ }
161404
+ );
161405
+ };
160620
161406
  const getCellClassAndStyleMemo = lodashExports.memoize(
160621
161407
  (canWrap, maxLines, cellTextStyle, horizontalAlign, verticalAlign) => {
160622
161408
  const options = {
@@ -160638,13 +161424,18 @@ const getCellClassAndStyleMemo = lodashExports.memoize(
160638
161424
  // Custom resolver to create a unique key based on nested properties
160639
161425
  (...args) => JSON.stringify(args)
160640
161426
  );
160641
- function getCellProperties(tableCellTextStyle, columnProperties, currentRow = {}) {
160642
- var _a2, _b2, _c2;
160643
- const cellProps = getPropertyValue(columnProperties.cellProps, currentRow);
160644
- const cellTextStyleColor = (_b2 = (_a2 = cellProps == null ? void 0 : cellProps.textStyle) == null ? void 0 : _a2.textColor) == null ? void 0 : _b2.default;
160645
- const cellTextStyleVariant = (_c2 = cellProps == null ? void 0 : cellProps.textStyle) == null ? void 0 : _c2.variant;
161427
+ function getCellProperties(tableCellTextStyle, columnProperties, rowIndex) {
161428
+ var _a2, _b2, _c2, _d2, _e2, _f2;
161429
+ const cellTextStyleVariant = getPropertyValue(
161430
+ (_b2 = (_a2 = columnProperties.cellProps) == null ? void 0 : _a2.textStyle) == null ? void 0 : _b2.variant,
161431
+ rowIndex
161432
+ );
161433
+ const cellTextStyleColor = getPropertyValue(
161434
+ (_e2 = (_d2 = (_c2 = columnProperties.cellProps) == null ? void 0 : _c2.textStyle) == null ? void 0 : _d2.textColor) == null ? void 0 : _e2.default,
161435
+ rowIndex
161436
+ );
160646
161437
  const cellTextStyleForRow = {
160647
- ...cellProps == null ? void 0 : cellProps.textStyle,
161438
+ ...(_f2 = columnProperties == null ? void 0 : columnProperties.cellProps) == null ? void 0 : _f2.textStyle,
160648
161439
  variant: cellTextStyleVariant,
160649
161440
  textColor: cellTextStyleColor ? {
160650
161441
  default: cellTextStyleColor
@@ -160652,92 +161443,95 @@ function getCellProperties(tableCellTextStyle, columnProperties, currentRow = {}
160652
161443
  };
160653
161444
  const cellTextStyle = cellTextStyleForRow ?? tableCellTextStyle;
160654
161445
  const cellProperties = {
160655
- isDisabled: getPropertyValue(columnProperties.isDisabled, currentRow),
161446
+ isDisabled: getPropertyValue(columnProperties.isDisabled, rowIndex),
160656
161447
  horizontalAlign: getPropertyValue(
160657
161448
  columnProperties.horizontalAlign,
160658
- currentRow
160659
- ),
160660
- verticalAlign: getPropertyValue(columnProperties.verticalAlign, currentRow),
160661
- cellBackground: getPropertyValue(
160662
- columnProperties.cellBackground,
160663
- currentRow
161449
+ rowIndex
160664
161450
  ),
161451
+ verticalAlign: getPropertyValue(columnProperties.verticalAlign, rowIndex),
161452
+ cellBackground: getPropertyValue(columnProperties.cellBackground, rowIndex),
160665
161453
  buttonBackgroundColor: getPropertyValue(
160666
161454
  columnProperties.buttonBackgroundColor,
160667
- currentRow
161455
+ rowIndex
161456
+ ),
161457
+ buttonBorder: getPropertyValue(
161458
+ columnProperties.buttonBorder,
161459
+ rowIndex,
161460
+ true
160668
161461
  ),
160669
- buttonBorder: getPropertyValue(columnProperties.buttonBorder, currentRow),
160670
- buttonVariant: getPropertyValue(columnProperties.buttonVariant, currentRow),
161462
+ buttonVariant: getPropertyValue(columnProperties.buttonVariant, rowIndex),
160671
161463
  buttonTextStyle: getPropertyValue(
160672
161464
  columnProperties.buttonTextStyle,
160673
- currentRow
161465
+ rowIndex,
161466
+ true
160674
161467
  ),
160675
161468
  cellIcon: getPropertyValue(
160676
161469
  columnProperties.columnType === "button" ? columnProperties.buttonIcon : columnProperties.cellIcon,
160677
- currentRow
161470
+ rowIndex
160678
161471
  ),
160679
161472
  cellIconPosition: getPropertyValue(
160680
161473
  columnProperties.columnType === "button" ? columnProperties.buttonIconPosition : columnProperties.cellIconPosition,
160681
- currentRow
161474
+ rowIndex
160682
161475
  ) ?? "left",
160683
- buttonLabel: getPropertyValue(columnProperties.buttonLabel, currentRow),
160684
- linkUrl: getPropertyValue(columnProperties.linkUrl, currentRow),
160685
- linkLabel: getPropertyValue(columnProperties.linkLabel, currentRow),
160686
- openInNewTab: getPropertyValue(columnProperties.openInNewTab, currentRow),
161476
+ buttonLabel: getPropertyValue(columnProperties.buttonLabel, rowIndex, true),
161477
+ linkUrl: getPropertyValue(columnProperties.linkUrl, rowIndex, true),
161478
+ linkLabel: getPropertyValue(columnProperties.linkLabel, rowIndex, true),
161479
+ openInNewTab: getPropertyValue(
161480
+ columnProperties.openInNewTab,
161481
+ rowIndex,
161482
+ true
161483
+ ),
160687
161484
  cellTextStyle,
160688
161485
  displayedValue: getPropertyValue(
160689
161486
  columnProperties.displayedValue,
160690
- currentRow
161487
+ rowIndex,
161488
+ true
160691
161489
  ),
160692
- tagsWrap: getPropertyValue(columnProperties.tagsWrap, currentRow),
160693
- textWrap: getPropertyValue(columnProperties.textWrap, currentRow),
160694
- imageSize: getPropertyValue(columnProperties.imageSize, currentRow),
161490
+ tagsWrap: getPropertyValue(columnProperties.tagsWrap, rowIndex, true),
161491
+ textWrap: getPropertyValue(columnProperties.textWrap, rowIndex, true),
161492
+ imageSize: getPropertyValue(columnProperties.imageSize, rowIndex),
160695
161493
  imageBorderRadius: getPropertyValue(
160696
161494
  columnProperties.imageBorderRadius,
160697
- currentRow
161495
+ rowIndex,
161496
+ true
161497
+ ),
161498
+ openImageUrl: getPropertyValue(
161499
+ columnProperties.openImageUrl,
161500
+ rowIndex,
161501
+ true
160698
161502
  ),
160699
- openImageUrl: getPropertyValue(columnProperties.openImageUrl, currentRow),
160700
161503
  minimumFractionDigits: getPropertyValue(
160701
161504
  columnProperties.minimumFractionDigits,
160702
- currentRow
161505
+ rowIndex
160703
161506
  ),
160704
161507
  maximumFractionDigits: getPropertyValue(
160705
161508
  columnProperties.maximumFractionDigits,
160706
- currentRow
161509
+ rowIndex
160707
161510
  ),
160708
- currency: getPropertyValue(columnProperties.currency, currentRow),
160709
- inputFormat: getPropertyValue(columnProperties.inputFormat, currentRow),
160710
- outputFormat: getPropertyValue(columnProperties.outputFormat, currentRow),
161511
+ currency: getPropertyValue(columnProperties.currency, rowIndex, true),
161512
+ inputFormat: getPropertyValue(columnProperties.inputFormat, rowIndex, true),
161513
+ outputFormat: getPropertyValue(columnProperties.outputFormat, rowIndex),
160711
161514
  manageTimezone: columnProperties.manageTimezone,
160712
- timezone: getPropertyValue(columnProperties.timezone, currentRow),
161515
+ timezone: getPropertyValue(columnProperties.timezone, rowIndex, true),
160713
161516
  displayTimezone: getPropertyValue(
160714
161517
  columnProperties.displayTimezone,
160715
- currentRow
161518
+ rowIndex
160716
161519
  )
160717
161520
  };
160718
161521
  return cellProperties;
160719
161522
  }
160720
- function isContextualFunction(value) {
160721
- return typeof value === "function";
160722
- }
160723
- function getPropertyValue(value, currentRow) {
160724
- if (isContextualFunction(value) && currentRow) {
160725
- try {
160726
- return value({ currentRow });
160727
- } catch (error) {
160728
- console.error("Error evaluating context-aware property:", error);
160729
- return void 0;
160730
- }
160731
- } else if (isContextualFunction(value)) {
160732
- return value({ currentRow: {} });
161523
+ function getPropertyValue(value, index2, preserveDataType = false) {
161524
+ if (value && Array.isArray(value)) {
161525
+ if (value[index2]) return value[index2].toString();
161526
+ return value[index2];
161527
+ } else if (value && !preserveDataType) {
161528
+ return value.toString();
161529
+ } else {
161530
+ return value;
160733
161531
  }
160734
- return value;
160735
161532
  }
160736
161533
  function getFirstPropertyValue(value) {
160737
- if (isContextualFunction(value)) {
160738
- return value({ currentRow: {} });
160739
- }
160740
- return value;
161534
+ return Array.isArray(value) ? value.find(Boolean) : value;
160741
161535
  }
160742
161536
  const renderCell = ({
160743
161537
  value,
@@ -161921,7 +162715,7 @@ const propertiesDefinition$9 = {
161921
162715
  placeholder: '[{ "col1": "val1" }]',
161922
162716
  isJSConvertible: false,
161923
162717
  helpText: "Takes in an array of objects to display rows in the table. Bind data from an API using {{}}",
161924
- controlType: "FUNCTION_CODE_EDITOR"
162718
+ controlType: "COMPUTED_CODE_EDITOR"
161925
162719
  }),
161926
162720
  // do not let users set the id property
161927
162721
  // id is managed internally by the table (it's always the key of the column)
@@ -161958,12 +162752,11 @@ const propertiesDefinition$9 = {
161958
162752
  helpText: "Enable per column filtering"
161959
162753
  }),
161960
162754
  defaultFilters: Prop.any().readAndWrite().propertiesPanel({
161961
- controlType: "FUNCTION_CODE_EDITOR",
162755
+ controlType: "COMPUTED_CODE_EDITOR",
161962
162756
  label: "Default filters",
161963
162757
  visibility: "SHOW_NAME",
161964
162758
  isJSConvertible: false,
161965
162759
  isRemovable: true,
161966
- defaultOnAdd: () => Property.Computed(""),
161967
162760
  helpText: "Allows specifying the filters that will be used on page load",
161968
162761
  isVisible: function() {
161969
162762
  return this.isFilterable && this.pageType !== "server-side";
@@ -162040,8 +162833,6 @@ const propertiesDefinition$9 = {
162040
162833
  label: "Default sort",
162041
162834
  helpText: "Allows specifying the sort options that will be used on page load",
162042
162835
  controlType: "DEFAULT_TABLE_SORT",
162043
- isRemovable: true,
162044
- visibility: "SHOW_NAME",
162045
162836
  childrenDisplayMode: {
162046
162837
  type: "popover",
162047
162838
  title: "Default sort"
@@ -162050,8 +162841,6 @@ const propertiesDefinition$9 = {
162050
162841
  defaultSearchText: Prop.string().readAndWrite().propertiesPanel({
162051
162842
  label: "Default search",
162052
162843
  helpText: "Sets the default search text",
162053
- isRemovable: true,
162054
- visibility: "SHOW_NAME",
162055
162844
  isVisible: function() {
162056
162845
  return this.enableClientSideSearch !== false;
162057
162846
  }
@@ -171924,13 +172713,11 @@ const downloadTableData = ({
171924
172713
  );
171925
172714
  const headerData = visibleColumns.map((column2) => column2.Header).map((v2) => sanitizeItem(v2));
171926
172715
  const rowData = data2.map(
171927
- (_15, index2) => visibleColumns.map((column2) => {
171928
- const itemIndex = (filteredOrderMap == null ? void 0 : filteredOrderMap[index2]) ?? index2;
171929
- const item = data2[itemIndex];
172716
+ (item, index2) => visibleColumns.map((column2) => {
171930
172717
  const cellProperties = getCellProperties(
171931
172718
  tableCellTextStyle,
171932
172719
  column2.columnProperties,
171933
- item
172720
+ (filteredOrderMap == null ? void 0 : filteredOrderMap[index2]) ?? index2
171934
172721
  );
171935
172722
  const value = item[column2.columnProperties.id];
171936
172723
  return formatByType(value, column2.columnProperties.columnType, {
@@ -173243,7 +174030,7 @@ function getUniqueValues({
173243
174030
  formattedValue: formatByType(
173244
174031
  value,
173245
174032
  columnProperties.columnType,
173246
- getCellProperties(tableCellTextStyle, columnProperties, row)
174033
+ getCellProperties(tableCellTextStyle, columnProperties, i3)
173247
174034
  ),
173248
174035
  rawValue: value,
173249
174036
  index: 0
@@ -173259,7 +174046,7 @@ function getUniqueValues({
173259
174046
  formattedValue: formatByType(
173260
174047
  rawValue,
173261
174048
  columnProperties.columnType,
173262
- getCellProperties(tableCellTextStyle, columnProperties, row)
174049
+ getCellProperties(tableCellTextStyle, columnProperties, i3)
173263
174050
  ),
173264
174051
  rawValue,
173265
174052
  index: 0
@@ -175990,23 +176777,6 @@ const _TableWidget = class _TableWidget extends React__default.Component {
175990
176777
  onComplete();
175991
176778
  }
175992
176779
  });
175993
- __publicField(this, "columnPropertyFunctionMap", /* @__PURE__ */ new WeakMap());
175994
- __publicField(this, "functionCounter", 0);
175995
- __publicField(this, "getColumnPropertiesString", (columnProperties) => {
175996
- return Object.keys(columnProperties).reduce((acc, key2) => {
175997
- const val = columnProperties[key2];
175998
- if (typeof val === "function") {
175999
- if (!this.columnPropertyFunctionMap.has(val)) {
176000
- this.columnPropertyFunctionMap.set(
176001
- val,
176002
- `__func_${this.functionCounter++}`
176003
- );
176004
- }
176005
- return acc + `${key2} ${this.columnPropertyFunctionMap.get(val)}`;
176006
- }
176007
- return acc + `${key2}: ${JSON.stringify(val)}`;
176008
- });
176009
- });
176010
176780
  __publicField(this, "getEmptyRow", () => {
176011
176781
  const columnKeys = getAllTableColumnKeys(this.props.tableData);
176012
176782
  const selectedRow = {};
@@ -176076,7 +176846,7 @@ const _TableWidget = class _TableWidget extends React__default.Component {
176076
176846
  }
176077
176847
  return getPropertyValue(
176078
176848
  this.props.columns[columnId].cellBackground,
176079
- this.props.tableData[originalRowIndex]
176849
+ originalRowIndex
176080
176850
  );
176081
176851
  });
176082
176852
  __publicField(this, "getIsLoading", () => {
@@ -176816,6 +177586,7 @@ const _TableWidget = class _TableWidget extends React__default.Component {
176816
177586
  const columnsArray = [];
176817
177587
  const { sortedColumn, columnOrder, columnSizeMap, columns, columnFreezes } = this.props;
176818
177588
  let allColumns = columns;
177589
+ const tableProps = this.props;
176819
177590
  const sortColumn = sortedColumn == null ? void 0 : sortedColumn.column;
176820
177591
  const sortOrder = sortedColumn == null ? void 0 : sortedColumn.asc;
176821
177592
  allColumns = reorderColumns(allColumns, columnOrder ?? [], columnFreezes);
@@ -176919,16 +177690,212 @@ const _TableWidget = class _TableWidget extends React__default.Component {
176919
177690
  index: this.props.multiRowSelection ? columnProperties.index + 1 : columnProperties.index,
176920
177691
  notation: columnNotation
176921
177692
  },
176922
- Cell: this.createTableCell(columnProperties, isHidden2)
177693
+ Cell: (props2) => {
177694
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i, _j, _k, _l2, _m2, _n2, _o2, _p2, _q, _r2, _s2, _t2, _u2, _v, _w, _x, _y;
177695
+ const currentRowIndex = props2.cell.row.index;
177696
+ const originalRowIndex = ((_a2 = this.props.filteredOrderMap) == null ? void 0 : _a2[currentRowIndex]) ?? currentRowIndex;
177697
+ const isEdited = ((_b2 = this.props.editOverrides) == null ? void 0 : _b2[originalRowIndex]) != null && columnProperties.id in this.props.editOverrides[originalRowIndex];
177698
+ const isInserted = this.getIsRowInserted(originalRowIndex);
177699
+ const isDeleted = this.getIsRowDeleted(originalRowIndex);
177700
+ const indexInTableDataWithInserts = ((_c2 = this.props.tableDataWithInsertsOrderMap) == null ? void 0 : _c2[originalRowIndex]) ?? originalRowIndex;
177701
+ const cellProperties = getCellProperties(
177702
+ (_e2 = (_d2 = this.props) == null ? void 0 : _d2.cellProps) == null ? void 0 : _e2.textStyle,
177703
+ columnProperties,
177704
+ indexInTableDataWithInserts
177705
+ );
177706
+ const isEditable = !isDeleted && (isInserted ? columnProperties.isEditableOnInsertion : columnProperties.isEditable);
177707
+ if (isEditable) {
177708
+ let rawValue;
177709
+ if (isInserted) {
177710
+ rawValue = (_h2 = (_g2 = (_f2 = this.props.inserts) == null ? void 0 : _f2.insertedRowsById) == null ? void 0 : _g2[originalRowIndex]) == null ? void 0 : _h2[columnProperties.id];
177711
+ } else if (isEdited) {
177712
+ rawValue = (_j = (_i = this.props.editOverrides) == null ? void 0 : _i[originalRowIndex]) == null ? void 0 : _j[columnProperties.id].value;
177713
+ } else if (columnProperties.isDerived) {
177714
+ rawValue = props2.cell.value;
177715
+ } else {
177716
+ rawValue = (_l2 = (_k = this.props.tableData) == null ? void 0 : _k[originalRowIndex]) == null ? void 0 : _l2[columnProperties.id];
177717
+ }
177718
+ const value = isInserted ? rawValue ?? "" : props2.cell.value;
177719
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
177720
+ EditableCell,
177721
+ {
177722
+ theme: this.props.theme,
177723
+ value,
177724
+ rawValue,
177725
+ columnType: columnProperties.columnType,
177726
+ isInserted,
177727
+ columnName: columnProperties.label,
177728
+ cellProps: {
177729
+ isHidden: isHidden2,
177730
+ cellProperties,
177731
+ tagsColorAssignment: (_m2 = this.cachedTagColorAssignment) == null ? void 0 : _m2[columnProperties.id],
177732
+ notation: columnNotation,
177733
+ currency: columnProperties.currency,
177734
+ minimumFractionDigits: columnProperties.minimumFractionDigits,
177735
+ maximumFractionDigits: columnProperties.maximumFractionDigits,
177736
+ booleanStyleFalse: columnProperties.booleanStyleFalse,
177737
+ rowDensity: this.props.rowDensity,
177738
+ isFocused: props2.isFocused,
177739
+ displayedValue: this.getDisplayedValueForEditCell({
177740
+ columnId: columnProperties.id,
177741
+ rawValue,
177742
+ displayedValue: cellProperties.displayedValue,
177743
+ useLabelAsDisplayValue: columnProperties.useLabelAsDisplayValue
177744
+ }),
177745
+ cellIcon: getPropertyValue(
177746
+ columnProperties.cellIcon,
177747
+ indexInTableDataWithInserts,
177748
+ true
177749
+ ),
177750
+ cellIconPosition: columnProperties.cellIconPosition ?? "left",
177751
+ inputFormat: getPropertyValue(
177752
+ columnProperties.inputFormat,
177753
+ indexInTableDataWithInserts,
177754
+ true
177755
+ ),
177756
+ outputFormat: getPropertyValue(
177757
+ columnProperties.outputFormat,
177758
+ indexInTableDataWithInserts,
177759
+ true
177760
+ ),
177761
+ manageTimezone: columnProperties.manageTimezone,
177762
+ timezone: getPropertyValue(
177763
+ columnProperties.timezone,
177764
+ indexInTableDataWithInserts,
177765
+ true
177766
+ ),
177767
+ displayTimezone: getPropertyValue(
177768
+ columnProperties.displayTimezone,
177769
+ indexInTableDataWithInserts,
177770
+ true
177771
+ ),
177772
+ isMultiselecting: this.currentCellFocus.length > 1
177773
+ },
177774
+ editProps: {
177775
+ handleEditStart: this.handleEditStart.bind(
177776
+ this,
177777
+ originalRowIndex,
177778
+ columnProperties.id,
177779
+ this.getCellValue(
177780
+ originalRowIndex,
177781
+ columnProperties.id
177782
+ )
177783
+ ),
177784
+ handleEditChange: this.debouncedEditChange,
177785
+ handleEditStop: this.onEditStop.bind(
177786
+ this,
177787
+ columnProperties,
177788
+ currentRowIndex
177789
+ ),
177790
+ onDropdownSearchTextChanged: () => props2.onDropdownSearchTextChanged(),
177791
+ currentEditDropdownSearchText: this.props.currentEditDropdownSearchText,
177792
+ handleOneClickEdit: this.handleOneClickEdit.bind(
177793
+ this,
177794
+ columnProperties,
177795
+ originalRowIndex
177796
+ ),
177797
+ isEditFocused: ((_n2 = this.props.currentEditFocus) == null ? void 0 : _n2.row) === originalRowIndex && ((_o2 = this.props.currentEditFocus) == null ? void 0 : _o2.columnId) === columnProperties.id,
177798
+ isEdited,
177799
+ currentEditValue: this.props.currentEditValue,
177800
+ editInputType: columnProperties.editInputType,
177801
+ editCustomValidationRule: this.customEditValidation[columnProperties.id],
177802
+ editCustomErrorMessage: this.customEditMessage[columnProperties.id],
177803
+ editMaxLength: columnProperties.editMaxLength,
177804
+ editMinLength: columnProperties.editMinLength,
177805
+ editIsRequired: isInserted ? columnProperties.isRequiredOnInsertion : columnProperties.editIsRequired,
177806
+ editMultiSelect: columnProperties.editMultiSelect,
177807
+ allowClearing: columnProperties.allowClearing,
177808
+ dropdownOptionsLoading: this.getDropdownOptionsLoading(),
177809
+ editDropdownClientSideFiltering: columnProperties.editDropdownClientSideFiltering,
177810
+ editOptions: this.editOptions[columnProperties.id],
177811
+ transformation: columnProperties.transformation,
177812
+ validationErrors: isInserted ? ((_r2 = (_q = (_p2 = this.props.inserts) == null ? void 0 : _p2.insertedRowValidations) == null ? void 0 : _q[originalRowIndex]) == null ? void 0 : _r2[columnProperties.id]) ?? [] : ((_u2 = (_t2 = (_s2 = this.props.editOverrides) == null ? void 0 : _s2[originalRowIndex]) == null ? void 0 : _t2[columnProperties.id]) == null ? void 0 : _u2.validationErrors) ?? [],
177813
+ editMinDate: columnProperties.editMinDate,
177814
+ editMaxDate: columnProperties.editMaxDate,
177815
+ editTwentyFourHourTime: columnProperties.editTwentyFourHourTime
177816
+ },
177817
+ tableName: this.props.widgetName,
177818
+ rowDensity: getRowDensity(this.props.rowDensity),
177819
+ maxLinesPerRow: this.props.maxLinesPerRow,
177820
+ position: {
177821
+ currentRowIndex,
177822
+ columnId: columnProperties.id,
177823
+ originalRowIndex
177824
+ }
177825
+ }
177826
+ );
177827
+ } else if (columnProperties.columnType === ColumnType.BUTTON) {
177828
+ const buttonProps = {
177829
+ rowIndex: currentRowIndex,
177830
+ isSelected: !!props2.row.isSelected,
177831
+ isDisabled: cellProperties.isDisabled,
177832
+ onClick: (onComplete) => {
177833
+ this.handleTableButtonClick(columnProperties.id, onComplete);
177834
+ },
177835
+ handleRowSelect: this.handleRowSelect,
177836
+ backgroundColor: cellProperties.buttonBackgroundColor,
177837
+ buttonBorder: cellProperties.buttonBorder,
177838
+ buttonVariant: cellProperties.buttonVariant ?? "primary",
177839
+ buttonTextStyle: cellProperties.buttonTextStyle,
177840
+ cellIcon: getPropertyValue(
177841
+ columnProperties.buttonIcon,
177842
+ indexInTableDataWithInserts
177843
+ ),
177844
+ cellIconPosition: cellProperties.cellIconPosition ?? "left",
177845
+ rowDensity: this.props.rowDensity,
177846
+ id: columnProperties.id,
177847
+ buttonLabel: cellProperties.buttonLabel ?? "Action",
177848
+ isHidden: isHidden2,
177849
+ theme: this.props.theme
177850
+ };
177851
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(TableButton, { ...buttonProps });
177852
+ } else if (columnProperties.columnType === "link") {
177853
+ return renderLink({
177854
+ cellProperties,
177855
+ isHidden: isHidden2,
177856
+ rowDensity: this.props.rowDensity,
177857
+ position: {
177858
+ columnId: columnProperties.id
177859
+ },
177860
+ maxLinesPerRow: this.props.maxLinesPerRow,
177861
+ tableCellTextStyle: (_v = this.props.cellProps) == null ? void 0 : _v.textStyle,
177862
+ value: props2.cell.value
177863
+ });
177864
+ } else {
177865
+ return renderCell({
177866
+ theme: this.props.theme,
177867
+ value: props2.cell.value,
177868
+ columnType: columnProperties.columnType,
177869
+ editInputType: columnProperties.editInputType,
177870
+ maxLinesPerRow: this.props.maxLinesPerRow,
177871
+ tableCellTextStyle: (_w = this.props.cellProps) == null ? void 0 : _w.textStyle,
177872
+ typographies: this.props.theme.typographies,
177873
+ cellProps: {
177874
+ // since these are overridden by the cellProperties
177875
+ ...columnProperties,
177876
+ ...getCellProperties(
177877
+ (_x = tableProps == null ? void 0 : tableProps.cellProps) == null ? void 0 : _x.textStyle,
177878
+ columnProperties,
177879
+ indexInTableDataWithInserts
177880
+ ),
177881
+ isHidden: isHidden2,
177882
+ cellProperties,
177883
+ tagsColorAssignment: (_y = this.cachedTagColorAssignment) == null ? void 0 : _y[columnProperties.id],
177884
+ booleanStyleFalse: columnProperties.booleanStyleFalse,
177885
+ rowDensity: this.props.rowDensity,
177886
+ isFocused: props2.isFocused,
177887
+ isMultiselecting: this.currentCellFocus.length > 1
177888
+ },
177889
+ position: {
177890
+ columnId: columnProperties.id
177891
+ }
177892
+ });
177893
+ }
177894
+ }
176923
177895
  };
176924
177896
  columnsArray.push(columnData);
176925
177897
  }
176926
- const columnString = JSON.stringify(columnsArray, (key2, value) => {
176927
- if (key2 === "columnProperties") {
176928
- return this.getColumnPropertiesString(value);
176929
- }
176930
- return value;
176931
- });
177898
+ const columnString = JSON.stringify(columnsArray);
176932
177899
  if (columnString === this.previousColumnsString) {
176933
177900
  return this.previousColumns;
176934
177901
  }
@@ -176936,85 +177903,6 @@ const _TableWidget = class _TableWidget extends React__default.Component {
176936
177903
  this.previousColumns = columnsArray;
176937
177904
  return columnsArray;
176938
177905
  }
176939
- createTableCell(columnProperties, isHidden2) {
176940
- return (props2) => {
176941
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2;
176942
- const currentRowIndex = props2.cell.row.index;
176943
- ((_a2 = this.props.filteredOrderMap) == null ? void 0 : _a2[currentRowIndex]) ?? currentRowIndex;
176944
- const cellProperties = getCellProperties(
176945
- (_c2 = (_b2 = this.props) == null ? void 0 : _b2.cellProps) == null ? void 0 : _c2.textStyle,
176946
- columnProperties,
176947
- props2.cell.row.original
176948
- );
176949
- if (columnProperties.columnType === ColumnType.BUTTON) {
176950
- const buttonProps = {
176951
- rowIndex: currentRowIndex,
176952
- isSelected: !!props2.row.isSelected,
176953
- isDisabled: cellProperties.isDisabled,
176954
- onClick: (onComplete) => {
176955
- this.handleTableButtonClick(columnProperties.id, onComplete);
176956
- },
176957
- handleRowSelect: this.handleRowSelect,
176958
- backgroundColor: cellProperties.buttonBackgroundColor,
176959
- buttonBorder: cellProperties.buttonBorder,
176960
- buttonVariant: cellProperties.buttonVariant ?? "primary",
176961
- buttonTextStyle: cellProperties.buttonTextStyle,
176962
- cellIcon: getPropertyValue(
176963
- columnProperties.buttonIcon,
176964
- props2.cell.row.original
176965
- ),
176966
- cellIconPosition: cellProperties.cellIconPosition ?? "left",
176967
- rowDensity: this.props.rowDensity,
176968
- id: columnProperties.id,
176969
- buttonLabel: cellProperties.buttonLabel ?? "Action",
176970
- isHidden: isHidden2,
176971
- theme: this.props.theme
176972
- };
176973
- return /* @__PURE__ */ jsxRuntimeExports.jsx(TableButton, { ...buttonProps });
176974
- } else if (columnProperties.columnType === "link") {
176975
- return renderLink({
176976
- cellProperties,
176977
- isHidden: isHidden2,
176978
- rowDensity: this.props.rowDensity,
176979
- position: {
176980
- columnId: columnProperties.id
176981
- },
176982
- maxLinesPerRow: this.props.maxLinesPerRow,
176983
- tableCellTextStyle: (_d2 = this.props.cellProps) == null ? void 0 : _d2.textStyle,
176984
- value: props2.cell.value
176985
- });
176986
- } else {
176987
- return renderCell({
176988
- theme: this.props.theme,
176989
- value: props2.cell.value,
176990
- columnType: columnProperties.columnType,
176991
- editInputType: columnProperties.editInputType,
176992
- maxLinesPerRow: this.props.maxLinesPerRow,
176993
- tableCellTextStyle: (_e2 = this.props.cellProps) == null ? void 0 : _e2.textStyle,
176994
- typographies: this.props.theme.typographies,
176995
- cellProps: {
176996
- // since these are overridden by the cellProperties
176997
- ...columnProperties,
176998
- ...getCellProperties(
176999
- (_g2 = (_f2 = this.props) == null ? void 0 : _f2.cellProps) == null ? void 0 : _g2.textStyle,
177000
- columnProperties,
177001
- props2.cell.row.original
177002
- ),
177003
- isHidden: isHidden2,
177004
- cellProperties,
177005
- tagsColorAssignment: (_h2 = this.cachedTagColorAssignment) == null ? void 0 : _h2[columnProperties.id],
177006
- booleanStyleFalse: columnProperties.booleanStyleFalse,
177007
- rowDensity: this.props.rowDensity,
177008
- isFocused: props2.isFocused,
177009
- isMultiselecting: this.currentCellFocus.length > 1
177010
- },
177011
- position: {
177012
- columnId: columnProperties.id
177013
- }
177014
- });
177015
- }
177016
- };
177017
- }
177018
177906
  static getParsedComputedValues(value) {
177019
177907
  let computedValues = [];
177020
177908
  if (lodashExports.isString(value)) {
@@ -180356,8 +181244,8 @@ const StyledCrossIcon = qe$1(SvgCrossXs)`
180356
181244
  right: ${({ right: right2 }) => `${right2}px`};
180357
181245
  top: 50%;
180358
181246
  transform: translateY(-50%);
180359
- height: ${({ iconSize }) => `${iconSize ?? DEFAULT_ICON_SIZE}px`};
180360
- width: ${({ iconSize }) => `${iconSize ?? DEFAULT_ICON_SIZE}px`};
181247
+ height: ${({ iconSize }) => `${iconSize ?? DEFAULT_ICON_SIZE$1}px`};
181248
+ width: ${({ iconSize }) => `${iconSize ?? DEFAULT_ICON_SIZE$1}px`};
180361
181249
  z-index: 4; // TODO: do we need to use Layers?
180362
181250
  cursor: pointer;
180363
181251
  `;
@@ -181113,7 +182001,7 @@ const propertiesDefinition$8 = {
181113
182001
  isJSConvertible: false,
181114
182002
  helpText: "Allows users to select either a single option or multiple options. Values must be unique.",
181115
182003
  placeholder: "[{label: 'Option 1', value: 'option1'}]",
181116
- controlType: "FUNCTION_CODE_EDITOR"
182004
+ controlType: "COMPUTED_CODE_EDITOR"
181117
182005
  }),
181118
182006
  defaultOptionValue: Prop.string().propertiesPanel({
181119
182007
  label: "Default selected value",
@@ -182593,7 +183481,13 @@ const propertiesDefinition$4 = {
182593
183481
  size: Prop.dimension().readAndWrite().propertiesPanel({
182594
183482
  label: "Size",
182595
183483
  controlType: "WIDTH_DROPDOWN"
182596
- }).default(Dim.fit())
183484
+ }).default(Dim.px(24)),
183485
+ width: Prop.dimension().readAndWrite().default(function() {
183486
+ return this.size;
183487
+ }),
183488
+ height: Prop.dimension().readAndWrite().default(function() {
183489
+ return this.size;
183490
+ })
182597
183491
  }).add(margin()).add(visible()),
182598
183492
  appearance: Section.category(PropsPanelCategory.Appearance).children({
182599
183493
  color: colorProp({
@@ -182619,7 +183513,7 @@ const SbIcon = registerSbComponent(
182619
183513
  },
182620
183514
  (props2) => {
182621
183515
  const [isLoading, setIsLoading] = useState(false);
182622
- const { icon, style: style2, color, size: size2, onClick } = props2;
183516
+ const { icon, style: style2, color, onClick } = props2;
182623
183517
  const { style: passthroughStyle, ...passThroughProps } = usePassthroughProps(props2);
182624
183518
  const inlineStyles = useMemo$2(() => {
182625
183519
  const minWidthStyle = !icon ? {
@@ -182631,8 +183525,7 @@ const SbIcon = registerSbComponent(
182631
183525
  ...passthroughStyle,
182632
183526
  color,
182633
183527
  cursor: onClick ? "pointer" : "inherit",
182634
- ...style2,
182635
- height: "100%"
183528
+ ...style2
182636
183529
  };
182637
183530
  }, [style2, color, onClick, passthroughStyle, icon]);
182638
183531
  const handleClick = useCallback(async () => {
@@ -182658,8 +183551,7 @@ const SbIcon = registerSbComponent(
182658
183551
  disablePointerEvents: true,
182659
183552
  iconName: icon,
182660
183553
  color,
182661
- fill: (size2 == null ? void 0 : size2.mode) !== "px",
182662
- size: (size2 == null ? void 0 : size2.mode) === "px" ? size2.value : void 0
183554
+ fill: true
182663
183555
  }
182664
183556
  )
182665
183557
  }
@@ -182953,8 +183845,8 @@ const SbVariable = registerSbEntity(
182953
183845
  );
182954
183846
  const propertiesDefinition$1 = {
182955
183847
  general: Section.category(PropsPanelCategory.Uncategorized).propertiesPanel({ showHeader: false }).children({
182956
- intervalMs: Prop.number().default(300).readAndWrite().propertiesPanel({
182957
- label: "Interval",
183848
+ intervalMs: Prop.number().default(3e5).readAndWrite().propertiesPanel({
183849
+ label: "Interval (ms)",
182958
183850
  helpText: "Sets the interval of the timer",
182959
183851
  placeholder: "1000",
182960
183852
  isJSConvertible: false,
@@ -183746,7 +184638,6 @@ function listenForUrlChange() {
183746
184638
  return observer2;
183747
184639
  }
183748
184640
  const IframeConnected = observer(function IframeConnected2(props2) {
183749
- var _a2;
183750
184641
  useEffect(() => {
183751
184642
  if (!isEmbeddedBySuperblocksFirstParty()) {
183752
184643
  return;
@@ -183756,18 +184647,7 @@ const IframeConnected = observer(function IframeConnected2(props2) {
183756
184647
  editStore.setIsInitialized(true);
183757
184648
  editorBridge.connected();
183758
184649
  rootStore.setEditStore(editStore);
183759
- try {
183760
- await sourceUpdateApi.connect(data2.payload.peerId, data2.payload.userId);
183761
- } catch (error) {
183762
- console.error(
183763
- "Error connecting to internal socket from library",
183764
- error
183765
- );
183766
- editorBridge.socketError(
183767
- "Error connecting to the remote dev server, please refresh the page"
183768
- );
183769
- return;
183770
- }
184650
+ await sourceUpdateApi.connect(data2.payload.peerId, data2.payload.userId);
183771
184651
  editorBridge.updatePropertiesPanels(
183772
184652
  editStore.propertiesPanelManager.getNonDynamicPropertiesPanels()
183773
184653
  );
@@ -183796,10 +184676,6 @@ const IframeConnected = observer(function IframeConnected2(props2) {
183796
184676
  };
183797
184677
  }, []);
183798
184678
  const isPossiblyEditor = useMemo$2(isEmbeddedBySuperblocksFirstParty, []);
183799
- const connectionStatus = (_a2 = rootStore.editStore) == null ? void 0 : _a2.connectionManager.connectionStatus;
183800
- if (connectionStatus === "pre-init" || connectionStatus === "connecting") {
183801
- return /* @__PURE__ */ jsxRuntimeExports.jsx(FullPageSpinner, {});
183802
- }
183803
184679
  if (isPossiblyEditor && editStore.isInitialized && typeof window !== "undefined") {
183804
184680
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(DnDProvider, { children: [
183805
184681
  /* @__PURE__ */ jsxRuntimeExports.jsx(NewComponentsDragLayer, {}),
@@ -185235,9 +186111,9 @@ const generateDropdownStyles = (theme) => {
185235
186111
  transform: translateY(-50%);
185236
186112
  z-index: 99;
185237
186113
  background-repeat: no-repeat;
185238
- background-size: ${DEFAULT_ICON_SIZE}px;
185239
- width: ${DEFAULT_ICON_SIZE}px;
185240
- height: ${DEFAULT_ICON_SIZE}px;
186114
+ background-size: ${DEFAULT_ICON_SIZE$1}px;
186115
+ width: ${DEFAULT_ICON_SIZE$1}px;
186116
+ height: ${DEFAULT_ICON_SIZE$1}px;
185241
186117
  display: block;
185242
186118
  position: absolute;
185243
186119
  cursor: pointer;
@@ -185829,38 +186705,14 @@ console.log = (...args) => {
185829
186705
  } catch {
185830
186706
  }
185831
186707
  };
185832
- const loadApisIntoLibrary = async function loadApisIntoLibrary2() {
185833
- var _a2, _b2;
185834
- {
185835
- try {
185836
- const mod2 = await import("./user-facing/build-manifest.js");
185837
- const apis = ((_a2 = mod2.default) == null ? void 0 : _a2.apis) ?? {};
185838
- const apiDependencies = ((_b2 = mod2.default) == null ? void 0 : _b2.apiDependencies) ?? [];
185839
- rootStore.apis.setAllApis(apis);
185840
- apiDependencies.forEach((dep) => {
185841
- rootStore.apis.setApiDepCandidates(dep.apiName, dep.params);
185842
- rootStore.apis.setApiReferences(dep.apiName, dep.dependencies);
185843
- });
185844
- } catch (error) {
185845
- console.error("Error loading apis into library", error);
185846
- }
185847
- }
185848
- };
185849
186708
  const SbProvider = function SbProvider2({
185850
186709
  name = "codemode",
185851
186710
  settings,
186711
+ preloadedData,
185852
186712
  children
185853
186713
  }) {
185854
186714
  var _a2, _b2;
185855
186715
  const isEmbedded = typeof window !== "undefined" && window.parent !== window.self;
185856
- const [isApisInitialized, setIsApisInitialized] = useState(false);
185857
- const runApiInitialization = useCallback(async () => {
185858
- await loadApisIntoLibrary();
185859
- setIsApisInitialized(true);
185860
- }, []);
185861
- useEffect(() => {
185862
- runApiInitialization();
185863
- }, [runApiInitialization]);
185864
186716
  const [userAccessibleTheme, setUserAccessibleTheme] = useState(DEFAULT_THEME);
185865
186717
  useEffect(() => {
185866
186718
  const mergedTheme = lodashExports.merge(BASE_THEME_V5, settings == null ? void 0 : settings.theme);
@@ -185872,10 +186724,7 @@ const SbProvider = function SbProvider2({
185872
186724
  }, [settings == null ? void 0 : settings.theme, settings == null ? void 0 : settings.themeOverrides]);
185873
186725
  useEffect(() => {
185874
186726
  initializeStyles(name);
185875
- }, [name]);
185876
- if (!isApisInitialized) {
185877
- return /* @__PURE__ */ jsxRuntimeExports.jsx(FullPageSpinner, {});
185878
- }
186727
+ }, [preloadedData, name]);
185879
186728
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(
185880
186729
  "div",
185881
186730
  {
@@ -197484,4 +198333,4 @@ export {
197484
198333
  SbTimer as y,
197485
198334
  SbApi as z
197486
198335
  };
197487
- //# sourceMappingURL=index-D9O95zsr.js.map
198336
+ //# sourceMappingURL=index-kjgG33Rg.js.map