@superblocksteam/library 2.0.6-next.38 → 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 (87) hide show
  1. package/dist/{allPaths-BhIhuhyr.js → allPaths-BtYOw5Ru.js} +2 -2
  2. package/dist/{allPaths-BhIhuhyr.js.map → allPaths-BtYOw5Ru.js.map} +1 -1
  3. package/dist/{allPaths-C-GS61ep.js → allPaths-CO-aWzss.js} +2 -2
  4. package/dist/{allPaths-C-GS61ep.js.map → allPaths-CO-aWzss.js.map} +1 -1
  5. package/dist/{allPathsLoader-okzKZ8ZK.js → allPathsLoader-B3Ii4JGL.js} +3 -3
  6. package/dist/{allPathsLoader-okzKZ8ZK.js.map → allPathsLoader-B3Ii4JGL.js.map} +1 -1
  7. package/dist/{allPathsLoader-yqClhllT.js → allPathsLoader-KDCEbuYo.js} +3 -3
  8. package/dist/{allPathsLoader-yqClhllT.js.map → allPathsLoader-KDCEbuYo.js.map} +1 -1
  9. package/dist/{devtools-consolidated-BQ5Eme4s.js → devtools-consolidated-B1B3uBW_.js} +2 -2
  10. package/dist/{devtools-consolidated-BQ5Eme4s.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-CQOHJMew.js → index-kjgG33Rg.js} +1593 -682
  14. package/dist/{index-CQOHJMew.js.map → index-kjgG33Rg.js.map} +1 -1
  15. package/dist/index.js +2 -2
  16. package/dist/{splitPathsBySizeLoader-DOjF2YSu.js → splitPathsBySizeLoader-Btq5cpt-.js} +2 -2
  17. package/dist/{splitPathsBySizeLoader-DOjF2YSu.js.map → splitPathsBySizeLoader-Btq5cpt-.js.map} +1 -1
  18. package/dist/{splitPathsBySizeLoader-BV47-5ws.js → splitPathsBySizeLoader-VThmaq3t.js} +2 -2
  19. package/dist/{splitPathsBySizeLoader-BV47-5ws.js.map → splitPathsBySizeLoader-VThmaq3t.js.map} +1 -1
  20. package/dist-types/edit-mode/iframe-wrappers.d.ts +0 -1
  21. package/dist-types/edit-mode/source-update-api.d.ts +0 -5
  22. package/dist-types/edit-mode/superblocks-editor-bridge.d.ts +0 -1
  23. package/dist-types/lib/internal-details/is-sb-component.d.ts +1 -5
  24. package/dist-types/lib/internal-details/lib/evaluator/base-entity-manager.d.ts +6 -6
  25. package/dist-types/lib/internal-details/lib/evaluator/compute-engines.d.ts +1 -2
  26. package/dist-types/lib/internal-details/lib/evaluator/lazy-function.d.ts +1 -2
  27. package/dist-types/lib/internal-details/lib/features/component-registry.d.ts +0 -5
  28. package/dist-types/lib/internal-details/lib/types.d.ts +0 -3
  29. package/dist-types/lib/triggers/implementations/state/reset-state-var.d.ts +3 -3
  30. package/dist-types/lib/triggers/implementations/state/set-state-var.d.ts +3 -3
  31. package/dist-types/lib/triggers/implementations/timers/control-timer.d.ts +3 -4
  32. package/dist-types/lib/triggers/registry.d.ts +6 -6
  33. package/dist-types/lib/user-facing/components/button/index.d.ts +26 -26
  34. package/dist-types/lib/user-facing/components/button/props.d.ts +26 -26
  35. package/dist-types/lib/user-facing/components/checkbox/index.d.ts +31 -31
  36. package/dist-types/lib/user-facing/components/checkbox/props.d.ts +31 -31
  37. package/dist-types/lib/user-facing/components/column/index.d.ts +19 -19
  38. package/dist-types/lib/user-facing/components/column/props.d.ts +19 -19
  39. package/dist-types/lib/user-facing/components/container/index.d.ts +21 -21
  40. package/dist-types/lib/user-facing/components/container/props.d.ts +21 -21
  41. package/dist-types/lib/user-facing/components/custom/register-custom-component.d.ts +9 -9
  42. package/dist-types/lib/user-facing/components/date-picker/index.d.ts +48 -48
  43. package/dist-types/lib/user-facing/components/date-picker/props.d.ts +48 -48
  44. package/dist-types/lib/user-facing/components/dropdown/index.d.ts +54 -54
  45. package/dist-types/lib/user-facing/components/dropdown/props.d.ts +54 -54
  46. package/dist-types/lib/user-facing/components/grid/index.d.ts +18 -20
  47. package/dist-types/lib/user-facing/components/grid/utils.d.ts +1 -0
  48. package/dist-types/lib/user-facing/components/icon/index.d.ts +13 -13
  49. package/dist-types/lib/user-facing/components/icon/props.d.ts +13 -13
  50. package/dist-types/lib/user-facing/components/image/index.d.ts +20 -20
  51. package/dist-types/lib/user-facing/components/image/props.d.ts +23 -23
  52. package/dist-types/lib/user-facing/components/input/index.d.ts +63 -63
  53. package/dist-types/lib/user-facing/components/input/props.d.ts +63 -63
  54. package/dist-types/lib/user-facing/components/key-value/properties-props.d.ts +21 -21
  55. package/dist-types/lib/user-facing/components/key-value/props.d.ts +27 -27
  56. package/dist-types/lib/user-facing/components/modal/index.d.ts +27 -27
  57. package/dist-types/lib/user-facing/components/modal/props.d.ts +27 -27
  58. package/dist-types/lib/user-facing/components/page/index.d.ts +13 -13
  59. package/dist-types/lib/user-facing/components/page/props.d.ts +13 -13
  60. package/dist-types/lib/user-facing/components/section/index.d.ts +16 -16
  61. package/dist-types/lib/user-facing/components/section/props.d.ts +16 -16
  62. package/dist-types/lib/user-facing/components/slideout/props.d.ts +11 -11
  63. package/dist-types/lib/user-facing/components/stack/index.d.ts +38 -38
  64. package/dist-types/lib/user-facing/components/switch/index.d.ts +32 -32
  65. package/dist-types/lib/user-facing/components/switch/props.d.ts +32 -32
  66. package/dist-types/lib/user-facing/components/table/column-properties-panel.d.ts +161 -262
  67. package/dist-types/lib/user-facing/components/table/index.d.ts +205 -306
  68. package/dist-types/lib/user-facing/components/table/props.d.ts +205 -306
  69. package/dist-types/lib/user-facing/components/table/table-utilities.d.ts +4 -4
  70. package/dist-types/lib/user-facing/components/table/table-widget.d.ts +1 -5
  71. package/dist-types/lib/user-facing/components/table/types.d.ts +28 -31
  72. package/dist-types/lib/user-facing/components/text/index.d.ts +35 -35
  73. package/dist-types/lib/user-facing/components/text/props.d.ts +35 -35
  74. package/dist-types/lib/user-facing/entities/api/props.d.ts +10 -10
  75. package/dist-types/lib/user-facing/entities/timer/props.d.ts +12 -12
  76. package/dist-types/lib/user-facing/entities/variable/props.d.ts +7 -7
  77. package/dist-types/lib/user-facing/properties-panel/mixins/appearance-properties.d.ts +12 -12
  78. package/dist-types/lib/user-facing/properties-panel/mixins/appearance.d.ts +2 -2
  79. package/dist-types/lib/user-facing/properties-panel/mixins/form-inputs-properties.d.ts +10 -10
  80. package/dist-types/lib/user-facing/properties-panel/mixins/layout-section.d.ts +45 -45
  81. package/dist-types/lib/user-facing/properties-panel/mixins/loading.d.ts +1 -1
  82. package/dist-types/lib/user-facing/properties-panel/props-builder.d.ts +9 -20
  83. package/dist-types/lib/user-facing/sb-event-flow.d.ts +2 -2
  84. package/dist-types/lib/user-facing/sb-provider.d.ts +2 -1
  85. package/package.json +3 -3
  86. package/dist/icons-lSlfQ50w.js.map +0 -1
  87. 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-BQ5Eme4s.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-BQ5Eme4s.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;
@@ -91163,14 +91039,14 @@ function getLoaderFn$1(options) {
91163
91039
  if (!(loader === "all")) return [3, 3];
91164
91040
  return [4, import(
91165
91041
  /* webpackChunkName: "blueprint-icons-all-paths-loader" */
91166
- "./allPathsLoader-yqClhllT.js"
91042
+ "./allPathsLoader-KDCEbuYo.js"
91167
91043
  )];
91168
91044
  case 2:
91169
91045
  return [2, _b2.sent().allPathsLoader];
91170
91046
  case 3:
91171
91047
  return [4, import(
91172
91048
  /* webpackChunkName: "blueprint-icons-split-paths-by-size-loader" */
91173
- "./splitPathsBySizeLoader-BV47-5ws.js"
91049
+ "./splitPathsBySizeLoader-VThmaq3t.js"
91174
91050
  )];
91175
91051
  case 4:
91176
91052
  return [2, _b2.sent().splitPathsBySizeLoader];
@@ -111805,18 +111681,14 @@ const ReactiveComponent = observer(function Component2({
111805
111681
  const reactiveProps = useShallowMobxObserver(safeProps);
111806
111682
  const stylePropWithSize = useStyleWithSize(reactiveProps);
111807
111683
  const styleProp = useMemo$2(() => {
111808
- const styleWithOverflow = {
111809
- overflow: "auto",
111810
- ...stylePropWithSize
111811
- };
111812
111684
  if (reactiveProps.isVisible === false) {
111813
111685
  const existingOpacity = lodashExports.isNumber(stylePropWithSize.opacity) ? stylePropWithSize.opacity : 1;
111814
111686
  return {
111815
- ...styleWithOverflow,
111687
+ ...stylePropWithSize,
111816
111688
  opacity: existingOpacity * INVISIBLE_OPACITY
111817
111689
  };
111818
111690
  }
111819
- return styleWithOverflow;
111691
+ return stylePropWithSize;
111820
111692
  }, [reactiveProps.isVisible, stylePropWithSize]);
111821
111693
  const { setStyle, getFallbackStyle } = useComponentSuspenseStyle();
111822
111694
  useEffect(() => {
@@ -111976,52 +111848,28 @@ const size$2 = ({
111976
111848
  controlType: "WIDTH_DROPDOWN",
111977
111849
  defaultValue: defaults2 == null ? void 0 : defaults2.minWidth,
111978
111850
  defaultOnAdd: defaultsOnAdd == null ? void 0 : defaultsOnAdd.minWidth,
111979
- isVisible: function(s3) {
111980
- var _a2;
111981
- const hideWidth = ((_a2 = this == null ? void 0 : this.width) == null ? void 0 : _a2.mode) === "px";
111982
- return Boolean(
111983
- (showMinWidth ? showMinWidth == null ? void 0 : showMinWidth.call(this, s3) : true) && !hideWidth
111984
- );
111985
- }
111851
+ isVisible: showMinWidth
111986
111852
  });
111987
111853
  const maxWidthProperty = getSizeProp({
111988
111854
  label: "Max width",
111989
111855
  controlType: "WIDTH_DROPDOWN",
111990
111856
  defaultValue: defaults2 == null ? void 0 : defaults2.maxWidth,
111991
111857
  defaultOnAdd: defaultsOnAdd == null ? void 0 : defaultsOnAdd.maxWidth,
111992
- isVisible: function(s3) {
111993
- var _a2;
111994
- const hideWidth = ((_a2 = this == null ? void 0 : this.width) == null ? void 0 : _a2.mode) === "px";
111995
- return Boolean(
111996
- (showMaxWidth ? showMaxWidth == null ? void 0 : showMaxWidth.call(this, s3) : true) && !hideWidth
111997
- );
111998
- }
111858
+ isVisible: showMaxWidth
111999
111859
  });
112000
111860
  const minHeightProperty = getSizeProp({
112001
111861
  label: "Min height",
112002
111862
  controlType: "HEIGHT_DROPDOWN",
112003
111863
  defaultValue: defaults2 == null ? void 0 : defaults2.minHeight,
112004
111864
  defaultOnAdd: defaultsOnAdd == null ? void 0 : defaultsOnAdd.minHeight,
112005
- isVisible: function(s3) {
112006
- var _a2;
112007
- const hideHeight = ((_a2 = this == null ? void 0 : this.height) == null ? void 0 : _a2.mode) === "px";
112008
- return Boolean(
112009
- (showMinHeight ? showMinHeight == null ? void 0 : showMinHeight.call(this, s3) : true) && !hideHeight
112010
- );
112011
- }
111865
+ isVisible: showMinHeight
112012
111866
  });
112013
111867
  const maxHeightProperty = getSizeProp({
112014
111868
  label: "Max height",
112015
111869
  controlType: "HEIGHT_DROPDOWN",
112016
111870
  defaultValue: defaults2 == null ? void 0 : defaults2.maxHeight,
112017
111871
  defaultOnAdd: defaultsOnAdd == null ? void 0 : defaultsOnAdd.maxHeight,
112018
- isVisible: function(s3) {
112019
- var _a2;
112020
- const hideHeight = ((_a2 = this == null ? void 0 : this.height) == null ? void 0 : _a2.mode) === "px";
112021
- return Boolean(
112022
- (showMaxHeight ? showMaxHeight == null ? void 0 : showMaxHeight.call(this, s3) : true) && !hideHeight
112023
- );
112024
- }
111872
+ isVisible: showMaxHeight
112025
111873
  });
112026
111874
  let heightProperty = Prop.dimension().readAndWrite().propertiesPanel({
112027
111875
  label: "Height",
@@ -117682,18 +117530,12 @@ const AddSectionButton = ({
117682
117530
  sectionInstanceId
117683
117531
  }) => {
117684
117532
  const indexForNewSection = placement === "above" ? indexForBaseSection : indexForBaseSection + 1;
117685
- const createSection = useCallback(async () => {
117686
- const newSectionSourceId = await createComponent({
117533
+ const createSection = useCallback(() => {
117534
+ createComponent({
117687
117535
  componentType: "SbSection",
117688
117536
  parent: { id: sectionParentSourceId, index: indexForNewSection },
117689
117537
  scopeName: sectionParentScopeName
117690
117538
  });
117691
- if (newSectionSourceId) {
117692
- const newSectionInstanceId = getEditStore().runtimeEntitiesManager.widgets.getAnyInstanceIdForSourceId(
117693
- newSectionSourceId
117694
- );
117695
- getEditStore().ui.selectWidget(newSectionInstanceId);
117696
- }
117697
117539
  }, [sectionParentSourceId, indexForNewSection, sectionParentScopeName]);
117698
117540
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
117699
117541
  Wrapper$2,
@@ -119181,7 +119023,7 @@ function useTypographyStyling({
119181
119023
  };
119182
119024
  }
119183
119025
  const DEFAULT_ICON_SPACING = 8;
119184
- const DEFAULT_ICON_SIZE = 16;
119026
+ const DEFAULT_ICON_SIZE$1 = 16;
119185
119027
  const ICON_POSITION_OPTIONS = [
119186
119028
  {
119187
119029
  icon: "ICON_LEFT_ALIGN",
@@ -119981,13 +119823,22 @@ const getStackChildStyle = ({
119981
119823
  (childProps == null ? void 0 : childProps.type) ?? ""
119982
119824
  ) ? Dim.fit() : Dim.fill());
119983
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");
119984
- const widthInPx = (width == null ? void 0 : width.mode) === "px";
119985
- const heightInPx = (height == null ? void 0 : height.mode) === "px";
119986
- const shouldNotShrink = widthInPx && primary === "width" || heightInPx && primary === "height";
119987
- const minWidthCss = widthInPx ? {} : getMinMaxCss(childProps == null ? void 0 : childProps.minWidth, "minWidth");
119988
- const maxWidthCss = widthInPx ? {} : getMinMaxCss(childProps == null ? void 0 : childProps.maxWidth, "maxWidth");
119989
- const minHeightCss = heightInPx ? {} : getMinMaxCss(childProps == null ? void 0 : childProps.minHeight, "minHeight");
119990
- const maxHeightCss = heightInPx ? {} : getMinMaxCss(childProps == null ? void 0 : childProps.maxHeight, "maxHeight");
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
+ );
119991
119842
  const margin2 = (childProps == null ? void 0 : childProps.margin) ?? {
119992
119843
  top: Dim.px(0),
119993
119844
  bottom: Dim.px(0),
@@ -119997,7 +119848,6 @@ const getStackChildStyle = ({
119997
119848
  const marginCss = { margin: generatePaddingStyle(margin2) };
119998
119849
  const stickyCss = (childProps == null ? void 0 : childProps.sticky) ? { position: "sticky", top: "0px", zIndex: Layers$1.stickySections } : {};
119999
119850
  const style2 = {
120000
- ...shouldNotShrink ? { flexShrink: 0 } : {},
120001
119851
  ...heightCss,
120002
119852
  ...widthCss,
120003
119853
  ...minHeightCss,
@@ -120208,16 +120058,20 @@ const generateClassName = (seed2) => {
120208
120058
  return `superblocks_widget_${seed2}`;
120209
120059
  };
120210
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
+ };
120211
120065
  const calculateRowPositions = (orderedNames, childrenArray, rowHeight, pxHeights) => {
120212
120066
  return orderedNames.reduce(
120213
120067
  (acc, name) => {
120214
120068
  var _a2;
120215
- const child = childrenArray.find((child2) => child2.name === name);
120069
+ const child = childrenArray.find((child2) => getChildName(child2) === name);
120216
120070
  if (!child) {
120217
120071
  return acc;
120218
120072
  }
120219
- const marginTopPx = (((_a2 = child.marginTop) == null ? void 0 : _a2.value) ?? 0) * rowHeight;
120220
- const constraintTop = child.constraintTop;
120073
+ const marginTopPx = (((_a2 = child.props.marginTop) == null ? void 0 : _a2.value) ?? 0) * rowHeight;
120074
+ const constraintTop = child.props.constraintTop;
120221
120075
  const bottomFunc = (name2) => {
120222
120076
  const topRow = acc[name2];
120223
120077
  const pxHeight = pxHeights[name2];
@@ -120242,16 +120096,16 @@ const calculateRowPositions = (orderedNames, childrenArray, rowHeight, pxHeights
120242
120096
  const orderConstraints = (children) => {
120243
120097
  const childrenMap = children.reduce(
120244
120098
  (acc, child) => {
120245
- acc[child.name] = child;
120099
+ acc[getChildName(child)] = child;
120246
120100
  return acc;
120247
120101
  },
120248
120102
  {}
120249
120103
  );
120250
120104
  const constraintsMap = children.reduce(
120251
120105
  (acc, child) => {
120252
- if (child.constraintTop) {
120253
- const constraints = Array.isArray(child.constraintTop) ? child.constraintTop : [child.constraintTop];
120254
- 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(
120255
120109
  (constraint) => !!childrenMap[constraint]
120256
120110
  );
120257
120111
  }
@@ -120263,24 +120117,24 @@ const orderConstraints = (children) => {
120263
120117
  const foundItems = /* @__PURE__ */ new Set();
120264
120118
  const itemsLeft = /* @__PURE__ */ new Set();
120265
120119
  children.forEach((child) => {
120266
- const constraints = constraintsMap[child.name] ?? [];
120120
+ const constraints = constraintsMap[getChildName(child)] ?? [];
120267
120121
  const hasNoConstraints = constraints.length === 0;
120268
120122
  if (hasNoConstraints) {
120269
- foundItems.add(child.name);
120270
- orderedNames.push(child.name);
120123
+ foundItems.add(getChildName(child));
120124
+ orderedNames.push(getChildName(child));
120271
120125
  } else {
120272
120126
  itemsLeft.add(child);
120273
120127
  }
120274
120128
  });
120275
120129
  while (itemsLeft.size > 0) {
120276
120130
  itemsLeft.forEach((child) => {
120277
- const constraints = constraintsMap[child.name] ?? [];
120131
+ const constraints = constraintsMap[getChildName(child)] ?? [];
120278
120132
  const constraintsLeft = constraints.filter(
120279
120133
  (constraint) => !foundItems.has(constraint)
120280
120134
  );
120281
120135
  if (constraintsLeft.length === 0) {
120282
- foundItems.add(child.name);
120283
- orderedNames.push(child.name);
120136
+ foundItems.add(getChildName(child));
120137
+ orderedNames.push(getChildName(child));
120284
120138
  itemsLeft.delete(child);
120285
120139
  }
120286
120140
  });
@@ -120331,141 +120185,99 @@ const heightReducer = (state, action2) => {
120331
120185
  }
120332
120186
  };
120333
120187
  const EMPTY_ARRAY$1 = [];
120334
- const GridChild = observer(
120335
- ({
120336
- childProps,
120337
- gridPositions,
120338
- rowHeight,
120339
- dispatchHeight,
120340
- childElement
120341
- }) => {
120342
- var _a2, _b2;
120343
- const heightMode = ((_a2 = childProps.height) == null ? void 0 : _a2.mode) ?? "fit";
120344
- const top2 = gridPositions[childProps.name].top;
120345
- const left2 = gridPositions[childProps.name].left;
120346
- const rows = gridPositions[childProps.name].height;
120347
- const columns = gridPositions[childProps.name].width;
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;
120348
120252
  const Component3 = heightMode === "fit" ? MeasuredComponent : StaticComponent;
120349
120253
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
120350
120254
  "div",
120351
120255
  {
120352
120256
  style: {
120353
120257
  gridRow: `${top2 + 1} / span ${Math.max(1, rows)}`,
120354
- gridColumn: `${left2 + 1} / span ${Math.max(1, columns)}`,
120258
+ gridColumn: `${left2 + 1} / span ${Math.max(1, columns2)}`,
120355
120259
  width: "100%",
120356
120260
  maxWidth: "100%"
120357
120261
  },
120358
120262
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(
120359
120263
  Component3,
120360
120264
  {
120361
- staticHeight: (((_b2 = childProps.height) == null ? void 0 : _b2.value) ?? 0) * rowHeight,
120265
+ staticHeight: (((_b3 = child.props.height) == null ? void 0 : _b3.value) ?? 0) * rowHeight,
120362
120266
  onHeightChanged: (height) => {
120363
120267
  dispatchHeight({
120364
120268
  type: "SET_HEIGHT",
120365
- name: childProps.name,
120269
+ name: getChildName(child),
120366
120270
  height
120367
120271
  });
120368
120272
  },
120369
- children: childElement
120273
+ children: child
120370
120274
  }
120371
120275
  )
120372
120276
  },
120373
- childProps.name
120277
+ getChildName(child)
120374
120278
  );
120375
- }
120376
- );
120377
- const InternalGrid = observer(
120378
- ({ children = EMPTY_ARRAY$1, ...props2 }) => {
120379
- var _a2;
120380
- const { style: style2, ...passThroughProps } = usePassthroughProps(props2);
120381
- const rowHeight = ((_a2 = props2.rowHeight) == null ? void 0 : _a2.value) ?? 12;
120382
- const childrenArray = useObserverMemo(() => {
120383
- var _a3;
120384
- const childrenArray2 = Array.isArray(children) ? children : [children];
120385
- const isEditing = Boolean((_a3 = rootStore.editStore) == null ? void 0 : _a3.isInitialized);
120386
- const withEvaluatedProps = childrenArray2.reduce((acc, child) => {
120387
- const bindingIdentifier = getBindingIdentifier(child.props.bind);
120388
- const entity = bindingIdentifier ? rootStore.entityManager.getEntity(bindingIdentifier.scopeId, {
120389
- value: bindingIdentifier.entityName,
120390
- isAnonymous: false
120391
- }) : null;
120392
- const marginTop = (entity == null ? void 0 : entity.marginTop) ?? (isDimension(child.props.marginTop) ? child.props.marginTop : void 0);
120393
- const marginLeft = (entity == null ? void 0 : entity.marginLeft) ?? (isDimension(child.props.marginLeft) ? child.props.marginLeft : void 0);
120394
- const width = (entity == null ? void 0 : entity.width) ?? (isDimension(child.props.width) ? child.props.width : void 0);
120395
- const height = (entity == null ? void 0 : entity.height) ?? (isDimension(child.props.height) ? child.props.height : void 0);
120396
- const constraintTop = (entity == null ? void 0 : entity.constraintTop) ?? child.props.constraintTop;
120397
- const isVisible2 = (entity == null ? void 0 : entity.isVisible) ?? child.props.isVisible;
120398
- const gridChild = {
120399
- marginTop,
120400
- marginLeft,
120401
- width,
120402
- height,
120403
- constraintTop,
120404
- name: (bindingIdentifier == null ? void 0 : bindingIdentifier.entityName) ?? child.props[WIDGET_SOURCE_ID_ATTRIBUTE],
120405
- // source ID as a fallback
120406
- sbType: isSbComponent(child) ? child.type.sbType : void 0,
120407
- element: child
120408
- };
120409
- if (isVisible2 !== false || isEditing) {
120410
- acc.push(gridChild);
120411
- }
120412
- return acc;
120413
- }, []);
120414
- return withEvaluatedProps;
120415
- }, [children]);
120416
- const columns = props2.columns ?? 12;
120417
- const [pxHeights, dispatchHeight] = React__default.useReducer(heightReducer, {});
120418
- const gridPositions = useMemo$2(() => {
120419
- const orderedNames = orderConstraints(childrenArray);
120420
- const rowPos = calculateRowPositions(
120421
- orderedNames,
120422
- childrenArray,
120423
- rowHeight,
120424
- pxHeights
120425
- );
120426
- const positions = childrenArray.reduce(
120427
- (acc, child) => {
120428
- var _a3, _b2, _c2;
120429
- let width = ((_a3 = child.width) == null ? void 0 : _a3.value) ?? (child.sbType === "SbTable" || child.sbType === "SbContainer" ? 6 : 2);
120430
- if (((_b2 = child.width) == null ? void 0 : _b2.mode) === "fill") {
120431
- width = columns;
120432
- }
120433
- acc[child.name] = {
120434
- top: rowPos[child.name],
120435
- left: ((_c2 = child.marginLeft) == null ? void 0 : _c2.value) ?? 0,
120436
- width,
120437
- height: Math.ceil(pxHeights[child.name] / rowHeight)
120438
- };
120439
- return acc;
120440
- },
120441
- {}
120442
- );
120443
- return positions;
120444
- }, [columns, childrenArray, rowHeight, pxHeights]);
120445
- const gridStyle = React__default.useMemo(() => {
120446
- const spacingValue = 0;
120447
- const columnsSize = `calc(${100 / columns}% - ${(columns - 1) * spacingValue / columns}px)`;
120448
- return {
120449
- display: "grid",
120450
- gridAutoRows: `${rowHeight}px`,
120451
- gap: `${spacingValue}px`,
120452
- gridTemplateColumns: `repeat(${columns}, ${columnsSize})`,
120453
- ...style2
120454
- };
120455
- }, [columns, rowHeight, style2]);
120456
- return /* @__PURE__ */ jsxRuntimeExports.jsx(DragDisplay, { passThroughProps, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: gridStyle, className: props2.className, children: childrenArray.map((child) => /* @__PURE__ */ jsxRuntimeExports.jsx(
120457
- GridChild,
120458
- {
120459
- childProps: child,
120460
- childElement: child.element,
120461
- gridPositions,
120462
- rowHeight,
120463
- dispatchHeight
120464
- },
120465
- child.name
120466
- )) }) });
120467
- }
120468
- );
120279
+ }) }) });
120280
+ };
120469
120281
  const DragDisplay = (props2) => {
120470
120282
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
120471
120283
  "div",
@@ -126389,9 +126201,9 @@ const getIconPositionStyle = ({
126389
126201
  right: offsetRight === "auto" ? offsetRight : `${offsetRight}px`
126390
126202
  };
126391
126203
  };
126392
- 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) => {
126393
126205
  const spacing2 = withSpacing ? DEFAULT_ICON_SPACING : 0;
126394
- const baseValue = iconSize ? iconSize + spacing2 : DEFAULT_ICON_SIZE;
126206
+ const baseValue = iconSize ? iconSize + spacing2 : DEFAULT_ICON_SIZE$1;
126395
126207
  return Dim.px(baseValue + (paddingValue.value ?? 0));
126396
126208
  };
126397
126209
  const DEFAULT_LABEL_WIDTH_IN_PERCENT = 30;
@@ -127145,7 +126957,7 @@ const useInputIconSize = ({
127145
126957
  textStyleVariant: textStyle2.variant,
127146
126958
  defaultTextStyleVariant: DEFAULT_INPUT_TEXT_STYLE_VARIANT
127147
126959
  })
127148
- ) : DEFAULT_ICON_SIZE;
126960
+ ) : DEFAULT_ICON_SIZE$1;
127149
126961
  };
127150
126962
  const useInputGroupStylingProps = (props2) => {
127151
126963
  const { theme } = useTheme$1();
@@ -127362,7 +127174,7 @@ const _InputComponent = class _InputComponent extends React__default.Component {
127362
127174
  (padding2, iconPosition, iconSize) => {
127363
127175
  var _a2, _b2;
127364
127176
  let adjustedForIcon = {};
127365
- const horizontalPadding = iconSize ? iconSize + DEFAULT_ICON_SPACING : DEFAULT_ICON_SIZE;
127177
+ const horizontalPadding = iconSize ? iconSize + DEFAULT_ICON_SPACING : DEFAULT_ICON_SIZE$1;
127366
127178
  if (iconPosition === "left") {
127367
127179
  adjustedForIcon = {
127368
127180
  left: Dim.px(horizontalPadding + (((_a2 = padding2.left) == null ? void 0 : _a2.value) ?? 0))
@@ -127448,7 +127260,7 @@ const _InputComponent = class _InputComponent extends React__default.Component {
127448
127260
  );
127449
127261
  });
127450
127262
  __publicField(this, "passwordIconComponent", () => {
127451
- const iconSize = this.props.iconSize ?? DEFAULT_ICON_SIZE;
127263
+ const iconSize = this.props.iconSize ?? DEFAULT_ICON_SIZE$1;
127452
127264
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
127453
127265
  Button$4,
127454
127266
  {
@@ -127505,7 +127317,7 @@ const _InputComponent = class _InputComponent extends React__default.Component {
127505
127317
  });
127506
127318
  __publicField(this, "renderInputComponent", (inputType) => isNumericInput(inputType) ? this.numericInputComponent() : this.textInputComponent());
127507
127319
  __publicField(this, "renderIcon", () => {
127508
- const iconSize = this.props.iconSize ?? DEFAULT_ICON_SIZE;
127320
+ const iconSize = this.props.iconSize ?? DEFAULT_ICON_SIZE$1;
127509
127321
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
127510
127322
  "div",
127511
127323
  {
@@ -135072,7 +134884,7 @@ function requireButton() {
135072
134884
  }
135073
134885
  var buttonExports = /* @__PURE__ */ requireButton();
135074
134886
  const AntdButton = /* @__PURE__ */ getDefaultExportFromCjs(buttonExports);
135075
- const StyledButton = qe$1(AntdButton)`
134887
+ const StyledButton$1 = qe$1(AntdButton)`
135076
134888
  color: ${(props2) => props2.color};
135077
134889
  ${({ $width }) => $width ? `width: ${$width}` : ""};
135078
134890
  ${({ $bordered }) => !$bordered ? "border: 0px;" : ""};
@@ -135087,7 +134899,7 @@ const Button$2 = memo(
135087
134899
  forwardRef(
135088
134900
  ({ bordered = true, width, children, ...buttonProps }, ref2) => {
135089
134901
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
135090
- StyledButton,
134902
+ StyledButton$1,
135091
134903
  {
135092
134904
  $bordered: bordered,
135093
134905
  $width: width,
@@ -135868,7 +135680,8 @@ const RowDensity = {
135868
135680
  };
135869
135681
  const HorizontalAlignment = {
135870
135682
  left: "left",
135871
- right: "right"
135683
+ right: "right",
135684
+ center: "center"
135872
135685
  };
135873
135686
  const VerticalAlignment = {
135874
135687
  center: "center"
@@ -135985,7 +135798,7 @@ const PARSED_INPUT_TYPES = [
135985
135798
  EditInputType.Number,
135986
135799
  EditInputType.Checkbox
135987
135800
  ];
135988
- [
135801
+ const TextBoxEditTypes = [
135989
135802
  EditInputType.Text,
135990
135803
  EditInputType.Number,
135991
135804
  EditInputType.Email
@@ -136087,26 +135900,15 @@ const tableColumnTypes = [
136087
135900
  value: ColumnType.EMAIL
136088
135901
  }
136089
135902
  ];
136090
- const currentRowArg = (entity) => {
136091
- return {
136092
- name: "currentRow",
136093
- description: "Current row of the table. Use this to access the current row's data.",
136094
- type: "object",
136095
- schema: entity.tableData && Array.isArray(entity.tableData) && entity.tableData.length > 0 ? entity.tableData[0] : {}
136096
- };
136097
- };
136098
- const tableContextualArgs = function(entity) {
136099
- return [[currentRowArg(entity)]];
136100
- };
136101
135903
  const cellIconProps = {
136102
- cellIcon: Prop.string().readAndWrite().contextual(tableContextualArgs).propertiesPanel({
135904
+ cellIcon: Prop.string().readAndWrite().propertiesPanel({
136103
135905
  label: "Cell icon",
136104
135906
  controlType: "ICON_SELECTOR",
136105
135907
  isRemovable: true,
136106
135908
  visibility: "SHOW_NAME",
136107
135909
  defaultOnAdd: "info"
136108
135910
  }),
136109
- cellIconPosition: Prop.string().default("left").contextual(tableContextualArgs).readAndWrite().propertiesPanel({
135911
+ cellIconPosition: Prop.string().default("left").readAndWrite().propertiesPanel({
136110
135912
  label: "Cell icon position",
136111
135913
  controlType: "RADIO_BUTTON_GROUP",
136112
135914
  options: [
@@ -136123,7 +135925,7 @@ const cellIconProps = {
136123
135925
  ]
136124
135926
  })
136125
135927
  };
136126
- const horizontalAlignProp = () => Prop.string().readAndWrite().contextual(tableContextualArgs).propertiesPanel({
135928
+ const horizontalAlignProp = () => Prop.string().readAndWrite().propertiesPanel({
136127
135929
  label: "Horizontal alignment",
136128
135930
  controlType: "RADIO_BUTTON_GROUP",
136129
135931
  options: [
@@ -136132,7 +135934,7 @@ const horizontalAlignProp = () => Prop.string().readAndWrite().contextual(tableC
136132
135934
  { value: "right", icon: "RIGHT_ALIGN" }
136133
135935
  ]
136134
135936
  }).default("left");
136135
- const verticalAlignProp = () => Prop.string().readAndWrite().contextual(tableContextualArgs).propertiesPanel({
135937
+ const verticalAlignProp = () => Prop.string().readAndWrite().propertiesPanel({
136136
135938
  label: "Vertical alignment",
136137
135939
  controlType: "RADIO_BUTTON_GROUP",
136138
135940
  options: [
@@ -136143,7 +135945,7 @@ const verticalAlignProp = () => Prop.string().readAndWrite().contextual(tableCon
136143
135945
  }).default("center");
136144
135946
  const cellBackgroundProp = colorProp({
136145
135947
  label: "Background color"
136146
- }).contextual(tableContextualArgs).default(() => Theme.colors.neutral).readAndWrite();
135948
+ }).default(() => Theme.colors.neutral).readAndWrite();
136147
135949
  const textStyleProps = {
136148
135950
  horizontalAlign: horizontalAlignProp(),
136149
135951
  verticalAlign: verticalAlignProp(),
@@ -136151,7 +135953,7 @@ const textStyleProps = {
136151
135953
  propertiesPanel: {
136152
135954
  label: "Cell text style"
136153
135955
  }
136154
- }).contextual(tableContextualArgs).default(() => ({
135956
+ }).default(() => ({
136155
135957
  variant: DEFAULT_CELL_TEXT_STYLE_VARIANT
136156
135958
  })),
136157
135959
  cellBackground: cellBackgroundProp
@@ -136166,22 +135968,22 @@ const computedValueUnion = Prop.union({
136166
135968
  },
136167
135969
  {
136168
135970
  isDerived: Prop.literal(true),
136169
- computedValue: Prop.string().contextual(tableContextualArgs).readAndWrite().propertiesPanel({
135971
+ computedValue: Prop.string().readAndWrite().propertiesPanel({
136170
135972
  label: "Computed value"
135973
+ // todo: add special control that can use currentRow
136171
135974
  })
136172
135975
  }
136173
135976
  ]
136174
135977
  }).getProps();
136175
135978
  const textColumnProperties = {
136176
135979
  general: {
136177
- displayedValue: Prop.string().contextual(tableContextualArgs).readAndWrite().propertiesPanel({
135980
+ displayedValue: Prop.string().readAndWrite().propertiesPanel({
136178
135981
  label: "Displayed value",
136179
135982
  controlType: "COMPUTE_TABLE_VALUE"
136180
135983
  })
136181
135984
  },
136182
135985
  presentation: {
136183
- ...cellIconProps,
136184
- textWrap: Prop.boolean().contextual(tableContextualArgs).readAndWrite().propertiesPanel({
135986
+ textWrap: Prop.boolean().readAndWrite().propertiesPanel({
136185
135987
  label: "Wrap text",
136186
135988
  controlType: "SWITCH"
136187
135989
  }),
@@ -136191,25 +135993,23 @@ const textColumnProperties = {
136191
135993
  const emailColumnProperties = { ...textColumnProperties };
136192
135994
  const buttonColumnProperties = {
136193
135995
  general: {
136194
- buttonLabel: Prop.string().default("Action").contextual(tableContextualArgs).readAndWrite().propertiesPanel({
135996
+ buttonLabel: Prop.string().default("Action").readAndWrite().propertiesPanel({
136195
135997
  label: "Button label",
136196
135998
  controlType: "COMPUTE_TABLE_VALUE"
136197
135999
  }),
136198
- isDisabled: Prop.boolean().readAndWrite().contextual(tableContextualArgs).propertiesPanel({
136000
+ isDisabled: Prop.boolean().readAndWrite().propertiesPanel({
136199
136001
  label: "Disabled",
136200
136002
  controlType: "SWITCH"
136201
136003
  })
136202
136004
  },
136203
136005
  presentation: {
136204
- buttonIcon: Prop.string().readAndWrite().contextual(tableContextualArgs).propertiesPanel({
136006
+ buttonIcon: Prop.string().readAndWrite().propertiesPanel({
136205
136007
  label: "Button icon",
136206
136008
  controlType: "ICON_SELECTOR",
136207
136009
  isRemovable: true,
136208
136010
  visibility: "SHOW_NAME"
136209
136011
  }),
136210
- buttonIconPosition: Prop.string().readAndWrite().contextual(
136211
- tableContextualArgs
136212
- ).default("left").propertiesPanel({
136012
+ buttonIconPosition: Prop.string().readAndWrite().default("left").propertiesPanel({
136213
136013
  label: "Cell icon position",
136214
136014
  controlType: "RADIO_BUTTON_GROUP",
136215
136015
  options: [
@@ -136225,9 +136025,7 @@ const buttonColumnProperties = {
136225
136025
  }
136226
136026
  ]
136227
136027
  }),
136228
- buttonVariant: Prop.string().default("primary").contextual(
136229
- tableContextualArgs
136230
- ).readAndWrite().propertiesPanel({
136028
+ buttonVariant: Prop.string().default("primary").readAndWrite().propertiesPanel({
136231
136029
  label: "Button variant",
136232
136030
  controlType: "DROP_DOWN",
136233
136031
  options: [
@@ -136245,9 +136043,7 @@ const buttonColumnProperties = {
136245
136043
  }
136246
136044
  ]
136247
136045
  }),
136248
- buttonTextStyle: textStyleProp().contextual(
136249
- tableContextualArgs
136250
- ).default(function() {
136046
+ buttonTextStyle: textStyleProp().default(function() {
136251
136047
  return {
136252
136048
  variant: "buttonLabel",
136253
136049
  textColor: {
@@ -136265,32 +136061,28 @@ const buttonColumnProperties = {
136265
136061
  defaultOnAdd: function() {
136266
136062
  return getButtonThemeDefaultBackgroundColor(Theme, "primary");
136267
136063
  }
136268
- }).contextual(
136269
- tableContextualArgs
136270
- ).readAndWrite(),
136064
+ }).readAndWrite(),
136271
136065
  buttonBorder: border({
136272
136066
  defaultOnAdd: SECONDARY_BUTTON_BORDER_OBJECT,
136273
136067
  treatDefaultAsNull: function() {
136274
136068
  return true;
136275
136069
  }
136276
- }).readAndWrite().contextual(
136277
- tableContextualArgs
136278
- ).default(getDefaultBorderObject)
136070
+ }).default(getDefaultBorderObject)
136279
136071
  }
136280
136072
  };
136281
136073
  const numberColumnProperties = {
136282
136074
  general: {
136283
- notation: Prop.string().readAndWrite().contextual(tableContextualArgs).propertiesPanel({
136075
+ notation: Prop.string().readAndWrite().propertiesPanel({
136284
136076
  label: "Number format",
136285
136077
  controlType: "DROP_DOWN",
136286
136078
  options: NUMBER_FORMATTING_OPTIONS
136287
136079
  }),
136288
- minimumFractionDigits: Prop.number().contextual(tableContextualArgs).readAndWrite().propertiesPanel({
136080
+ minimumFractionDigits: Prop.number().readAndWrite().propertiesPanel({
136289
136081
  label: "Minimum fraction digits",
136290
136082
  isRemovable: true,
136291
136083
  visibility: "SHOW_NAME"
136292
136084
  }),
136293
- maximumFractionDigits: Prop.number().contextual(tableContextualArgs).readAndWrite().propertiesPanel({
136085
+ maximumFractionDigits: Prop.number().readAndWrite().propertiesPanel({
136294
136086
  label: "Maximum fraction digits",
136295
136087
  isRemovable: true,
136296
136088
  visibility: "SHOW_NAME"
@@ -136298,7 +136090,7 @@ const numberColumnProperties = {
136298
136090
  },
136299
136091
  presentation: {
136300
136092
  ...cellIconProps,
136301
- textWrap: Prop.boolean().contextual(tableContextualArgs).readAndWrite().propertiesPanel({
136093
+ textWrap: Prop.boolean().readAndWrite().propertiesPanel({
136302
136094
  label: "Wrap text",
136303
136095
  controlType: "SWITCH"
136304
136096
  }),
@@ -136311,9 +136103,7 @@ const percentageColumnProperties = {
136311
136103
  };
136312
136104
  const currencyColumnProperties = {
136313
136105
  general: {
136314
- currency: Prop.string().default("USD").contextual(
136315
- tableContextualArgs
136316
- ).readAndWrite().propertiesPanel({
136106
+ currency: Prop.string().default("USD").readAndWrite().propertiesPanel({
136317
136107
  label: "Currency",
136318
136108
  controlType: "DROP_DOWN",
136319
136109
  options: CurrencyList.map((currency) => ({
@@ -136327,11 +136117,12 @@ const currencyColumnProperties = {
136327
136117
  };
136328
136118
  const linkColumnProperties = {
136329
136119
  general: {
136330
- linkUrl: Prop.string().readAndWrite().contextual(tableContextualArgs).propertiesPanel({
136331
- label: "Link URL",
136332
- controlType: "COMPUTE_TABLE_VALUE"
136333
- }),
136334
- 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({
136335
136126
  label: "Link label",
136336
136127
  controlType: "COMPUTE_TABLE_VALUE"
136337
136128
  })
@@ -136347,15 +136138,13 @@ const linkColumnProperties = {
136347
136138
  };
136348
136139
  const imageColumnProperties = {
136349
136140
  general: {
136350
- openImageUrl: Prop.boolean().contextual(tableContextualArgs).default(false).readAndWrite().propertiesPanel({
136141
+ openImageUrl: Prop.boolean().default(false).readAndWrite().propertiesPanel({
136351
136142
  label: "Open URL on click",
136352
136143
  controlType: "SWITCH"
136353
136144
  })
136354
136145
  },
136355
136146
  presentation: {
136356
- imageSize: Prop.string().readAndWrite().contextual(
136357
- tableContextualArgs
136358
- ).propertiesPanel({
136147
+ imageSize: Prop.string().readAndWrite().propertiesPanel({
136359
136148
  label: "Image sizing",
136360
136149
  controlType: "DROP_DOWN",
136361
136150
  options: [
@@ -136381,14 +136170,14 @@ const imageColumnProperties = {
136381
136170
  }
136382
136171
  ]
136383
136172
  }),
136384
- imageBorderRadius: borderRadius().contextual(tableContextualArgs),
136385
- horizontalAlign: horizontalAlignProp().contextual(tableContextualArgs),
136173
+ imageBorderRadius: borderRadius(),
136174
+ horizontalAlign: horizontalAlignProp(),
136386
136175
  cellBackground: cellBackgroundProp
136387
136176
  }
136388
136177
  };
136389
136178
  const manageTimezoneUnion = Prop.union({
136390
136179
  shared: {
136391
- manageTimezone: Prop.boolean().default(false).contextual(tableContextualArgs).readAndWrite().propertiesPanel({
136180
+ manageTimezone: Prop.boolean().default(false).readAndWrite().propertiesPanel({
136392
136181
  label: "Manage timezone",
136393
136182
  controlType: "SWITCH"
136394
136183
  })
@@ -136399,12 +136188,12 @@ const manageTimezoneUnion = Prop.union({
136399
136188
  },
136400
136189
  {
136401
136190
  manageTimezone: Prop.literal(true),
136402
- valueTimezone: Prop.string().contextual(tableContextualArgs).readAndWrite().propertiesPanel({
136191
+ valueTimezone: Prop.string().readAndWrite().propertiesPanel({
136403
136192
  label: "Value timezone",
136404
136193
  controlType: "DROP_DOWN",
136405
136194
  options: TIMEZONE_OPTIONS
136406
136195
  }),
136407
- displayTimezone: Prop.string().contextual(tableContextualArgs).readAndWrite().propertiesPanel({
136196
+ displayTimezone: Prop.string().readAndWrite().propertiesPanel({
136408
136197
  label: "Display timezone",
136409
136198
  controlType: "DROP_DOWN",
136410
136199
  options: TIMEZONE_OPTIONS
@@ -136414,12 +136203,12 @@ const manageTimezoneUnion = Prop.union({
136414
136203
  }).getProps();
136415
136204
  const dateColumnProperties = {
136416
136205
  general: {
136417
- inputFormat: Prop.string().contextual(tableContextualArgs).readAndWrite().propertiesPanel({
136206
+ inputFormat: Prop.string().readAndWrite().propertiesPanel({
136418
136207
  label: "Value format",
136419
136208
  controlType: "DROP_DOWN",
136420
136209
  options: DATE_INPUT_FORMATS
136421
136210
  }),
136422
- outputFormat: Prop.string().contextual(tableContextualArgs).readAndWrite().propertiesPanel({
136211
+ outputFormat: Prop.string().readAndWrite().propertiesPanel({
136423
136212
  label: "Display format",
136424
136213
  controlType: "DROP_DOWN",
136425
136214
  options: DATE_OUTPUT_FORMATS
@@ -136428,7 +136217,7 @@ const dateColumnProperties = {
136428
136217
  },
136429
136218
  presentation: {
136430
136219
  ...cellIconProps,
136431
- textWrap: Prop.boolean().readAndWrite().contextual(tableContextualArgs).propertiesPanel({
136220
+ textWrap: Prop.boolean().readAndWrite().propertiesPanel({
136432
136221
  label: "Wrap text",
136433
136222
  controlType: "SWITCH"
136434
136223
  }),
@@ -136484,7 +136273,7 @@ const tagsColumnProperties = {
136484
136273
  horizontalAlign: horizontalAlignProp(),
136485
136274
  verticalAlign: verticalAlignProp(),
136486
136275
  cellBackground: cellBackgroundProp,
136487
- tagsWrap: Prop.boolean().readAndWrite().contextual(tableContextualArgs).propertiesPanel({
136276
+ tagsWrap: Prop.boolean().readAndWrite().propertiesPanel({
136488
136277
  label: "Wrap tags",
136489
136278
  controlType: "SWITCH"
136490
136279
  }),
@@ -138534,9 +138323,7 @@ const ColumnHeaderWrapper = qe$1.div`
138534
138323
  gap: 4px;
138535
138324
  justify-content: ${(props2) => {
138536
138325
  var _a2, _b2;
138537
- return ((_a2 = props2 == null ? void 0 : props2.columnProperties) == null ? void 0 : _a2.horizontalAlign) && JUSTIFY_CONTENT[getFirstPropertyValue(
138538
- (_b2 = props2 == null ? void 0 : props2.columnProperties) == null ? void 0 : _b2.horizontalAlign
138539
- ) ?? 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];
138540
138327
  }};
138541
138328
  align-items: center;
138542
138329
  overflow: hidden;
@@ -138551,9 +138338,7 @@ const HeaderCellContentWrapper = qe$1.div`
138551
138338
  flex: 1;
138552
138339
  justify-content: ${(props2) => {
138553
138340
  var _a2, _b2;
138554
- return ((_a2 = props2 == null ? void 0 : props2.columnProperties) == null ? void 0 : _a2.horizontalAlign) && JUSTIFY_CONTENT[getFirstPropertyValue(
138555
- (_b2 = props2 == null ? void 0 : props2.columnProperties) == null ? void 0 : _b2.horizontalAlign
138556
- ) ?? 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];
138557
138342
  }};
138558
138343
  `;
138559
138344
  const TableIconWrapper = qe$1.div`
@@ -145727,14 +145512,14 @@ function getLoaderFn(options) {
145727
145512
  if (!(loader === "all")) return [3, 3];
145728
145513
  return [4, import(
145729
145514
  /* webpackChunkName: "blueprint-icons-all-paths-loader" */
145730
- "./allPathsLoader-okzKZ8ZK.js"
145515
+ "./allPathsLoader-B3Ii4JGL.js"
145731
145516
  )];
145732
145517
  case 2:
145733
145518
  return [2, _b2.sent().allPathsLoader];
145734
145519
  case 3:
145735
145520
  return [4, import(
145736
145521
  /* webpackChunkName: "blueprint-icons-split-paths-by-size-loader" */
145737
- "./splitPathsBySizeLoader-DOjF2YSu.js"
145522
+ "./splitPathsBySizeLoader-Btq5cpt-.js"
145738
145523
  )];
145739
145524
  case 4:
145740
145525
  return [2, _b2.sent().splitPathsBySizeLoader];
@@ -153567,7 +153352,7 @@ const getClearableIconRight = memoizeOne$1(
153567
153352
  }
153568
153353
  const iconPadding = getIconPadding(
153569
153354
  inputPadding == null ? void 0 : inputPadding.right,
153570
- iconSize ?? DEFAULT_ICON_SIZE,
153355
+ iconSize ?? DEFAULT_ICON_SIZE$1,
153571
153356
  false
153572
153357
  );
153573
153358
  return iconPadding.value;
@@ -154081,7 +153866,7 @@ class DatePickerComponent extends React__default.Component {
154081
153866
  DynamicSVG,
154082
153867
  {
154083
153868
  iconName: this.props.icon,
154084
- size: this.props.iconSize ?? DEFAULT_ICON_SIZE
153869
+ size: this.props.iconSize ?? DEFAULT_ICON_SIZE$1
154085
153870
  }
154086
153871
  )
154087
153872
  }
@@ -154114,6 +153899,258 @@ class DatePickerComponent extends React__default.Component {
154114
153899
  );
154115
153900
  }
154116
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
+ };
154117
154154
  function usePointerDownOutside({
154118
154155
  wrapperRefs,
154119
154156
  wrapperIds,
@@ -154160,6 +154197,385 @@ function usePointerDownOutside({
154160
154197
  };
154161
154198
  }, [wrapperRefs, wrapperIds, wrapperSelectors, onClickOutside]);
154162
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
+ };
154163
154579
  const CheckboxInput = ({
154164
154580
  isChecked,
154165
154581
  isDisabled,
@@ -154210,6 +154626,279 @@ const CheckboxInput = ({
154210
154626
  }
154211
154627
  );
154212
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
+ };
154213
154902
  var lib = {};
154214
154903
  var players = {};
154215
154904
  var utils = {};
@@ -160494,7 +161183,7 @@ const formatByType = (value, type5, options) => {
160494
161183
  return text;
160495
161184
  }
160496
161185
  };
160497
- qe$1.div`
161186
+ const StyledEditableDiv = qe$1.div`
160498
161187
  position: relative;
160499
161188
  height: 100%;
160500
161189
  width: 100%;
@@ -160518,20 +161207,20 @@ qe$1.div`
160518
161207
  }
160519
161208
  }
160520
161209
  `;
160521
- qe$1.div`
161210
+ const EditableCellWrapper = qe$1.div`
160522
161211
  position: relative;
160523
161212
  height: 100%;
160524
161213
  width: 100%;
160525
161214
  padding: 0px;
160526
161215
  `;
160527
- qe$1.div`
161216
+ const StyledCheckmarkWrapper = qe$1.div`
160528
161217
  position: relative;
160529
161218
  height: 100%;
160530
161219
  width: 100%;
160531
161220
  border-radius: 4px;
160532
161221
  overflow: hidden;
160533
161222
  `;
160534
- qe$1.div`
161223
+ const EditMarker = qe$1.div`
160535
161224
  position: absolute;
160536
161225
  top: 0px;
160537
161226
  left: 0px;
@@ -160540,17 +161229,180 @@ qe$1.div`
160540
161229
  border-style: solid;
160541
161230
  border-width: 10px 10px 0 0;
160542
161231
  `;
160543
- qe$1(SvgChevronDown)`
161232
+ const StyledChevronDown = qe$1(SvgChevronDown)`
160544
161233
  width: 16px;
160545
161234
  height: 16px;
160546
161235
  flex-shrink: 0;
160547
161236
  visibility: hidden;
160548
161237
  `;
160549
- qe$1.div`
161238
+ const EditingCellWrapper = qe$1.div`
160550
161239
  width: 100%;
160551
161240
  height: 100%;
160552
161241
  position: relative;
160553
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
+ };
160554
161406
  const getCellClassAndStyleMemo = lodashExports.memoize(
160555
161407
  (canWrap, maxLines, cellTextStyle, horizontalAlign, verticalAlign) => {
160556
161408
  const options = {
@@ -160572,13 +161424,18 @@ const getCellClassAndStyleMemo = lodashExports.memoize(
160572
161424
  // Custom resolver to create a unique key based on nested properties
160573
161425
  (...args) => JSON.stringify(args)
160574
161426
  );
160575
- function getCellProperties(tableCellTextStyle, columnProperties, currentRow = {}) {
160576
- var _a2, _b2, _c2;
160577
- const cellProps = getPropertyValue(columnProperties.cellProps, currentRow);
160578
- const cellTextStyleColor = (_b2 = (_a2 = cellProps == null ? void 0 : cellProps.textStyle) == null ? void 0 : _a2.textColor) == null ? void 0 : _b2.default;
160579
- 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
+ );
160580
161437
  const cellTextStyleForRow = {
160581
- ...cellProps == null ? void 0 : cellProps.textStyle,
161438
+ ...(_f2 = columnProperties == null ? void 0 : columnProperties.cellProps) == null ? void 0 : _f2.textStyle,
160582
161439
  variant: cellTextStyleVariant,
160583
161440
  textColor: cellTextStyleColor ? {
160584
161441
  default: cellTextStyleColor
@@ -160586,92 +161443,95 @@ function getCellProperties(tableCellTextStyle, columnProperties, currentRow = {}
160586
161443
  };
160587
161444
  const cellTextStyle = cellTextStyleForRow ?? tableCellTextStyle;
160588
161445
  const cellProperties = {
160589
- isDisabled: getPropertyValue(columnProperties.isDisabled, currentRow),
161446
+ isDisabled: getPropertyValue(columnProperties.isDisabled, rowIndex),
160590
161447
  horizontalAlign: getPropertyValue(
160591
161448
  columnProperties.horizontalAlign,
160592
- currentRow
160593
- ),
160594
- verticalAlign: getPropertyValue(columnProperties.verticalAlign, currentRow),
160595
- cellBackground: getPropertyValue(
160596
- columnProperties.cellBackground,
160597
- currentRow
161449
+ rowIndex
160598
161450
  ),
161451
+ verticalAlign: getPropertyValue(columnProperties.verticalAlign, rowIndex),
161452
+ cellBackground: getPropertyValue(columnProperties.cellBackground, rowIndex),
160599
161453
  buttonBackgroundColor: getPropertyValue(
160600
161454
  columnProperties.buttonBackgroundColor,
160601
- currentRow
161455
+ rowIndex
160602
161456
  ),
160603
- buttonBorder: getPropertyValue(columnProperties.buttonBorder, currentRow),
160604
- buttonVariant: getPropertyValue(columnProperties.buttonVariant, currentRow),
161457
+ buttonBorder: getPropertyValue(
161458
+ columnProperties.buttonBorder,
161459
+ rowIndex,
161460
+ true
161461
+ ),
161462
+ buttonVariant: getPropertyValue(columnProperties.buttonVariant, rowIndex),
160605
161463
  buttonTextStyle: getPropertyValue(
160606
161464
  columnProperties.buttonTextStyle,
160607
- currentRow
161465
+ rowIndex,
161466
+ true
160608
161467
  ),
160609
161468
  cellIcon: getPropertyValue(
160610
161469
  columnProperties.columnType === "button" ? columnProperties.buttonIcon : columnProperties.cellIcon,
160611
- currentRow
161470
+ rowIndex
160612
161471
  ),
160613
161472
  cellIconPosition: getPropertyValue(
160614
161473
  columnProperties.columnType === "button" ? columnProperties.buttonIconPosition : columnProperties.cellIconPosition,
160615
- currentRow
161474
+ rowIndex
160616
161475
  ) ?? "left",
160617
- buttonLabel: getPropertyValue(columnProperties.buttonLabel, currentRow),
160618
- linkUrl: getPropertyValue(columnProperties.linkUrl, currentRow),
160619
- linkLabel: getPropertyValue(columnProperties.linkLabel, currentRow),
160620
- 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
+ ),
160621
161484
  cellTextStyle,
160622
161485
  displayedValue: getPropertyValue(
160623
161486
  columnProperties.displayedValue,
160624
- currentRow
161487
+ rowIndex,
161488
+ true
160625
161489
  ),
160626
- tagsWrap: getPropertyValue(columnProperties.tagsWrap, currentRow),
160627
- textWrap: getPropertyValue(columnProperties.textWrap, currentRow),
160628
- 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),
160629
161493
  imageBorderRadius: getPropertyValue(
160630
161494
  columnProperties.imageBorderRadius,
160631
- currentRow
161495
+ rowIndex,
161496
+ true
161497
+ ),
161498
+ openImageUrl: getPropertyValue(
161499
+ columnProperties.openImageUrl,
161500
+ rowIndex,
161501
+ true
160632
161502
  ),
160633
- openImageUrl: getPropertyValue(columnProperties.openImageUrl, currentRow),
160634
161503
  minimumFractionDigits: getPropertyValue(
160635
161504
  columnProperties.minimumFractionDigits,
160636
- currentRow
161505
+ rowIndex
160637
161506
  ),
160638
161507
  maximumFractionDigits: getPropertyValue(
160639
161508
  columnProperties.maximumFractionDigits,
160640
- currentRow
161509
+ rowIndex
160641
161510
  ),
160642
- currency: getPropertyValue(columnProperties.currency, currentRow),
160643
- inputFormat: getPropertyValue(columnProperties.inputFormat, currentRow),
160644
- 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),
160645
161514
  manageTimezone: columnProperties.manageTimezone,
160646
- timezone: getPropertyValue(columnProperties.timezone, currentRow),
161515
+ timezone: getPropertyValue(columnProperties.timezone, rowIndex, true),
160647
161516
  displayTimezone: getPropertyValue(
160648
161517
  columnProperties.displayTimezone,
160649
- currentRow
161518
+ rowIndex
160650
161519
  )
160651
161520
  };
160652
161521
  return cellProperties;
160653
161522
  }
160654
- function isContextualFunction(value) {
160655
- return typeof value === "function";
160656
- }
160657
- function getPropertyValue(value, currentRow) {
160658
- if (isContextualFunction(value) && currentRow) {
160659
- try {
160660
- return value({ currentRow });
160661
- } catch (error) {
160662
- console.error("Error evaluating context-aware property:", error);
160663
- return void 0;
160664
- }
160665
- } else if (isContextualFunction(value)) {
160666
- 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;
160667
161531
  }
160668
- return value;
160669
161532
  }
160670
161533
  function getFirstPropertyValue(value) {
160671
- if (isContextualFunction(value)) {
160672
- return value({ currentRow: {} });
160673
- }
160674
- return value;
161534
+ return Array.isArray(value) ? value.find(Boolean) : value;
160675
161535
  }
160676
161536
  const renderCell = ({
160677
161537
  value,
@@ -161855,7 +162715,7 @@ const propertiesDefinition$9 = {
161855
162715
  placeholder: '[{ "col1": "val1" }]',
161856
162716
  isJSConvertible: false,
161857
162717
  helpText: "Takes in an array of objects to display rows in the table. Bind data from an API using {{}}",
161858
- controlType: "FUNCTION_CODE_EDITOR"
162718
+ controlType: "COMPUTED_CODE_EDITOR"
161859
162719
  }),
161860
162720
  // do not let users set the id property
161861
162721
  // id is managed internally by the table (it's always the key of the column)
@@ -161892,12 +162752,11 @@ const propertiesDefinition$9 = {
161892
162752
  helpText: "Enable per column filtering"
161893
162753
  }),
161894
162754
  defaultFilters: Prop.any().readAndWrite().propertiesPanel({
161895
- controlType: "FUNCTION_CODE_EDITOR",
162755
+ controlType: "COMPUTED_CODE_EDITOR",
161896
162756
  label: "Default filters",
161897
162757
  visibility: "SHOW_NAME",
161898
162758
  isJSConvertible: false,
161899
162759
  isRemovable: true,
161900
- defaultOnAdd: () => Property.Computed(""),
161901
162760
  helpText: "Allows specifying the filters that will be used on page load",
161902
162761
  isVisible: function() {
161903
162762
  return this.isFilterable && this.pageType !== "server-side";
@@ -161974,8 +162833,6 @@ const propertiesDefinition$9 = {
161974
162833
  label: "Default sort",
161975
162834
  helpText: "Allows specifying the sort options that will be used on page load",
161976
162835
  controlType: "DEFAULT_TABLE_SORT",
161977
- isRemovable: true,
161978
- visibility: "SHOW_NAME",
161979
162836
  childrenDisplayMode: {
161980
162837
  type: "popover",
161981
162838
  title: "Default sort"
@@ -161984,8 +162841,6 @@ const propertiesDefinition$9 = {
161984
162841
  defaultSearchText: Prop.string().readAndWrite().propertiesPanel({
161985
162842
  label: "Default search",
161986
162843
  helpText: "Sets the default search text",
161987
- isRemovable: true,
161988
- visibility: "SHOW_NAME",
161989
162844
  isVisible: function() {
161990
162845
  return this.enableClientSideSearch !== false;
161991
162846
  }
@@ -171858,13 +172713,11 @@ const downloadTableData = ({
171858
172713
  );
171859
172714
  const headerData = visibleColumns.map((column2) => column2.Header).map((v2) => sanitizeItem(v2));
171860
172715
  const rowData = data2.map(
171861
- (_15, index2) => visibleColumns.map((column2) => {
171862
- const itemIndex = (filteredOrderMap == null ? void 0 : filteredOrderMap[index2]) ?? index2;
171863
- const item = data2[itemIndex];
172716
+ (item, index2) => visibleColumns.map((column2) => {
171864
172717
  const cellProperties = getCellProperties(
171865
172718
  tableCellTextStyle,
171866
172719
  column2.columnProperties,
171867
- item
172720
+ (filteredOrderMap == null ? void 0 : filteredOrderMap[index2]) ?? index2
171868
172721
  );
171869
172722
  const value = item[column2.columnProperties.id];
171870
172723
  return formatByType(value, column2.columnProperties.columnType, {
@@ -173177,7 +174030,7 @@ function getUniqueValues({
173177
174030
  formattedValue: formatByType(
173178
174031
  value,
173179
174032
  columnProperties.columnType,
173180
- getCellProperties(tableCellTextStyle, columnProperties, row)
174033
+ getCellProperties(tableCellTextStyle, columnProperties, i3)
173181
174034
  ),
173182
174035
  rawValue: value,
173183
174036
  index: 0
@@ -173193,7 +174046,7 @@ function getUniqueValues({
173193
174046
  formattedValue: formatByType(
173194
174047
  rawValue,
173195
174048
  columnProperties.columnType,
173196
- getCellProperties(tableCellTextStyle, columnProperties, row)
174049
+ getCellProperties(tableCellTextStyle, columnProperties, i3)
173197
174050
  ),
173198
174051
  rawValue,
173199
174052
  index: 0
@@ -175924,23 +176777,6 @@ const _TableWidget = class _TableWidget extends React__default.Component {
175924
176777
  onComplete();
175925
176778
  }
175926
176779
  });
175927
- __publicField(this, "columnPropertyFunctionMap", /* @__PURE__ */ new WeakMap());
175928
- __publicField(this, "functionCounter", 0);
175929
- __publicField(this, "getColumnPropertiesString", (columnProperties) => {
175930
- return Object.keys(columnProperties).reduce((acc, key2) => {
175931
- const val = columnProperties[key2];
175932
- if (typeof val === "function") {
175933
- if (!this.columnPropertyFunctionMap.has(val)) {
175934
- this.columnPropertyFunctionMap.set(
175935
- val,
175936
- `__func_${this.functionCounter++}`
175937
- );
175938
- }
175939
- return acc + `${key2} ${this.columnPropertyFunctionMap.get(val)}`;
175940
- }
175941
- return acc + `${key2}: ${JSON.stringify(val)}`;
175942
- });
175943
- });
175944
176780
  __publicField(this, "getEmptyRow", () => {
175945
176781
  const columnKeys = getAllTableColumnKeys(this.props.tableData);
175946
176782
  const selectedRow = {};
@@ -176010,7 +176846,7 @@ const _TableWidget = class _TableWidget extends React__default.Component {
176010
176846
  }
176011
176847
  return getPropertyValue(
176012
176848
  this.props.columns[columnId].cellBackground,
176013
- this.props.tableData[originalRowIndex]
176849
+ originalRowIndex
176014
176850
  );
176015
176851
  });
176016
176852
  __publicField(this, "getIsLoading", () => {
@@ -176750,6 +177586,7 @@ const _TableWidget = class _TableWidget extends React__default.Component {
176750
177586
  const columnsArray = [];
176751
177587
  const { sortedColumn, columnOrder, columnSizeMap, columns, columnFreezes } = this.props;
176752
177588
  let allColumns = columns;
177589
+ const tableProps = this.props;
176753
177590
  const sortColumn = sortedColumn == null ? void 0 : sortedColumn.column;
176754
177591
  const sortOrder = sortedColumn == null ? void 0 : sortedColumn.asc;
176755
177592
  allColumns = reorderColumns(allColumns, columnOrder ?? [], columnFreezes);
@@ -176853,16 +177690,212 @@ const _TableWidget = class _TableWidget extends React__default.Component {
176853
177690
  index: this.props.multiRowSelection ? columnProperties.index + 1 : columnProperties.index,
176854
177691
  notation: columnNotation
176855
177692
  },
176856
- 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
+ }
176857
177895
  };
176858
177896
  columnsArray.push(columnData);
176859
177897
  }
176860
- const columnString = JSON.stringify(columnsArray, (key2, value) => {
176861
- if (key2 === "columnProperties") {
176862
- return this.getColumnPropertiesString(value);
176863
- }
176864
- return value;
176865
- });
177898
+ const columnString = JSON.stringify(columnsArray);
176866
177899
  if (columnString === this.previousColumnsString) {
176867
177900
  return this.previousColumns;
176868
177901
  }
@@ -176870,85 +177903,6 @@ const _TableWidget = class _TableWidget extends React__default.Component {
176870
177903
  this.previousColumns = columnsArray;
176871
177904
  return columnsArray;
176872
177905
  }
176873
- createTableCell(columnProperties, isHidden2) {
176874
- return (props2) => {
176875
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2;
176876
- const currentRowIndex = props2.cell.row.index;
176877
- ((_a2 = this.props.filteredOrderMap) == null ? void 0 : _a2[currentRowIndex]) ?? currentRowIndex;
176878
- const cellProperties = getCellProperties(
176879
- (_c2 = (_b2 = this.props) == null ? void 0 : _b2.cellProps) == null ? void 0 : _c2.textStyle,
176880
- columnProperties,
176881
- props2.cell.row.original
176882
- );
176883
- if (columnProperties.columnType === ColumnType.BUTTON) {
176884
- const buttonProps = {
176885
- rowIndex: currentRowIndex,
176886
- isSelected: !!props2.row.isSelected,
176887
- isDisabled: cellProperties.isDisabled,
176888
- onClick: (onComplete) => {
176889
- this.handleTableButtonClick(columnProperties.id, onComplete);
176890
- },
176891
- handleRowSelect: this.handleRowSelect,
176892
- backgroundColor: cellProperties.buttonBackgroundColor,
176893
- buttonBorder: cellProperties.buttonBorder,
176894
- buttonVariant: cellProperties.buttonVariant ?? "primary",
176895
- buttonTextStyle: cellProperties.buttonTextStyle,
176896
- cellIcon: getPropertyValue(
176897
- columnProperties.buttonIcon,
176898
- props2.cell.row.original
176899
- ),
176900
- cellIconPosition: cellProperties.cellIconPosition ?? "left",
176901
- rowDensity: this.props.rowDensity,
176902
- id: columnProperties.id,
176903
- buttonLabel: cellProperties.buttonLabel ?? "Action",
176904
- isHidden: isHidden2,
176905
- theme: this.props.theme
176906
- };
176907
- return /* @__PURE__ */ jsxRuntimeExports.jsx(TableButton, { ...buttonProps });
176908
- } else if (columnProperties.columnType === "link") {
176909
- return renderLink({
176910
- cellProperties,
176911
- isHidden: isHidden2,
176912
- rowDensity: this.props.rowDensity,
176913
- position: {
176914
- columnId: columnProperties.id
176915
- },
176916
- maxLinesPerRow: this.props.maxLinesPerRow,
176917
- tableCellTextStyle: (_d2 = this.props.cellProps) == null ? void 0 : _d2.textStyle,
176918
- value: props2.cell.value
176919
- });
176920
- } else {
176921
- return renderCell({
176922
- theme: this.props.theme,
176923
- value: props2.cell.value,
176924
- columnType: columnProperties.columnType,
176925
- editInputType: columnProperties.editInputType,
176926
- maxLinesPerRow: this.props.maxLinesPerRow,
176927
- tableCellTextStyle: (_e2 = this.props.cellProps) == null ? void 0 : _e2.textStyle,
176928
- typographies: this.props.theme.typographies,
176929
- cellProps: {
176930
- // since these are overridden by the cellProperties
176931
- ...columnProperties,
176932
- ...getCellProperties(
176933
- (_g2 = (_f2 = this.props) == null ? void 0 : _f2.cellProps) == null ? void 0 : _g2.textStyle,
176934
- columnProperties,
176935
- props2.cell.row.original
176936
- ),
176937
- isHidden: isHidden2,
176938
- cellProperties,
176939
- tagsColorAssignment: (_h2 = this.cachedTagColorAssignment) == null ? void 0 : _h2[columnProperties.id],
176940
- booleanStyleFalse: columnProperties.booleanStyleFalse,
176941
- rowDensity: this.props.rowDensity,
176942
- isFocused: props2.isFocused,
176943
- isMultiselecting: this.currentCellFocus.length > 1
176944
- },
176945
- position: {
176946
- columnId: columnProperties.id
176947
- }
176948
- });
176949
- }
176950
- };
176951
- }
176952
177906
  static getParsedComputedValues(value) {
176953
177907
  let computedValues = [];
176954
177908
  if (lodashExports.isString(value)) {
@@ -180290,8 +181244,8 @@ const StyledCrossIcon = qe$1(SvgCrossXs)`
180290
181244
  right: ${({ right: right2 }) => `${right2}px`};
180291
181245
  top: 50%;
180292
181246
  transform: translateY(-50%);
180293
- height: ${({ iconSize }) => `${iconSize ?? DEFAULT_ICON_SIZE}px`};
180294
- 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`};
180295
181249
  z-index: 4; // TODO: do we need to use Layers?
180296
181250
  cursor: pointer;
180297
181251
  `;
@@ -181047,7 +182001,7 @@ const propertiesDefinition$8 = {
181047
182001
  isJSConvertible: false,
181048
182002
  helpText: "Allows users to select either a single option or multiple options. Values must be unique.",
181049
182003
  placeholder: "[{label: 'Option 1', value: 'option1'}]",
181050
- controlType: "FUNCTION_CODE_EDITOR"
182004
+ controlType: "COMPUTED_CODE_EDITOR"
181051
182005
  }),
181052
182006
  defaultOptionValue: Prop.string().propertiesPanel({
181053
182007
  label: "Default selected value",
@@ -182891,8 +183845,8 @@ const SbVariable = registerSbEntity(
182891
183845
  );
182892
183846
  const propertiesDefinition$1 = {
182893
183847
  general: Section.category(PropsPanelCategory.Uncategorized).propertiesPanel({ showHeader: false }).children({
182894
- intervalMs: Prop.number().default(300).readAndWrite().propertiesPanel({
182895
- label: "Interval",
183848
+ intervalMs: Prop.number().default(3e5).readAndWrite().propertiesPanel({
183849
+ label: "Interval (ms)",
182896
183850
  helpText: "Sets the interval of the timer",
182897
183851
  placeholder: "1000",
182898
183852
  isJSConvertible: false,
@@ -183684,7 +184638,6 @@ function listenForUrlChange() {
183684
184638
  return observer2;
183685
184639
  }
183686
184640
  const IframeConnected = observer(function IframeConnected2(props2) {
183687
- var _a2;
183688
184641
  useEffect(() => {
183689
184642
  if (!isEmbeddedBySuperblocksFirstParty()) {
183690
184643
  return;
@@ -183694,18 +184647,7 @@ const IframeConnected = observer(function IframeConnected2(props2) {
183694
184647
  editStore.setIsInitialized(true);
183695
184648
  editorBridge.connected();
183696
184649
  rootStore.setEditStore(editStore);
183697
- try {
183698
- await sourceUpdateApi.connect(data2.payload.peerId, data2.payload.userId);
183699
- } catch (error) {
183700
- console.error(
183701
- "Error connecting to internal socket from library",
183702
- error
183703
- );
183704
- editorBridge.socketError(
183705
- "Error connecting to the remote dev server, please refresh the page"
183706
- );
183707
- return;
183708
- }
184650
+ await sourceUpdateApi.connect(data2.payload.peerId, data2.payload.userId);
183709
184651
  editorBridge.updatePropertiesPanels(
183710
184652
  editStore.propertiesPanelManager.getNonDynamicPropertiesPanels()
183711
184653
  );
@@ -183734,10 +184676,6 @@ const IframeConnected = observer(function IframeConnected2(props2) {
183734
184676
  };
183735
184677
  }, []);
183736
184678
  const isPossiblyEditor = useMemo$2(isEmbeddedBySuperblocksFirstParty, []);
183737
- const connectionStatus = (_a2 = rootStore.editStore) == null ? void 0 : _a2.connectionManager.connectionStatus;
183738
- if (connectionStatus === "pre-init" || connectionStatus === "connecting") {
183739
- return /* @__PURE__ */ jsxRuntimeExports.jsx(FullPageSpinner, {});
183740
- }
183741
184679
  if (isPossiblyEditor && editStore.isInitialized && typeof window !== "undefined") {
183742
184680
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(DnDProvider, { children: [
183743
184681
  /* @__PURE__ */ jsxRuntimeExports.jsx(NewComponentsDragLayer, {}),
@@ -185173,9 +186111,9 @@ const generateDropdownStyles = (theme) => {
185173
186111
  transform: translateY(-50%);
185174
186112
  z-index: 99;
185175
186113
  background-repeat: no-repeat;
185176
- background-size: ${DEFAULT_ICON_SIZE}px;
185177
- width: ${DEFAULT_ICON_SIZE}px;
185178
- 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;
185179
186117
  display: block;
185180
186118
  position: absolute;
185181
186119
  cursor: pointer;
@@ -185767,38 +186705,14 @@ console.log = (...args) => {
185767
186705
  } catch {
185768
186706
  }
185769
186707
  };
185770
- const loadApisIntoLibrary = async function loadApisIntoLibrary2() {
185771
- var _a2, _b2;
185772
- {
185773
- try {
185774
- const mod2 = await import("./user-facing/build-manifest.js");
185775
- const apis = ((_a2 = mod2.default) == null ? void 0 : _a2.apis) ?? {};
185776
- const apiDependencies = ((_b2 = mod2.default) == null ? void 0 : _b2.apiDependencies) ?? [];
185777
- rootStore.apis.setAllApis(apis);
185778
- apiDependencies.forEach((dep) => {
185779
- rootStore.apis.setApiDepCandidates(dep.apiName, dep.params);
185780
- rootStore.apis.setApiReferences(dep.apiName, dep.dependencies);
185781
- });
185782
- } catch (error) {
185783
- console.error("Error loading apis into library", error);
185784
- }
185785
- }
185786
- };
185787
186708
  const SbProvider = function SbProvider2({
185788
186709
  name = "codemode",
185789
186710
  settings,
186711
+ preloadedData,
185790
186712
  children
185791
186713
  }) {
185792
186714
  var _a2, _b2;
185793
186715
  const isEmbedded = typeof window !== "undefined" && window.parent !== window.self;
185794
- const [isApisInitialized, setIsApisInitialized] = useState(false);
185795
- const runApiInitialization = useCallback(async () => {
185796
- await loadApisIntoLibrary();
185797
- setIsApisInitialized(true);
185798
- }, []);
185799
- useEffect(() => {
185800
- runApiInitialization();
185801
- }, [runApiInitialization]);
185802
186716
  const [userAccessibleTheme, setUserAccessibleTheme] = useState(DEFAULT_THEME);
185803
186717
  useEffect(() => {
185804
186718
  const mergedTheme = lodashExports.merge(BASE_THEME_V5, settings == null ? void 0 : settings.theme);
@@ -185810,10 +186724,7 @@ const SbProvider = function SbProvider2({
185810
186724
  }, [settings == null ? void 0 : settings.theme, settings == null ? void 0 : settings.themeOverrides]);
185811
186725
  useEffect(() => {
185812
186726
  initializeStyles(name);
185813
- }, [name]);
185814
- if (!isApisInitialized) {
185815
- return /* @__PURE__ */ jsxRuntimeExports.jsx(FullPageSpinner, {});
185816
- }
186727
+ }, [preloadedData, name]);
185817
186728
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(
185818
186729
  "div",
185819
186730
  {
@@ -197422,4 +198333,4 @@ export {
197422
198333
  SbTimer as y,
197423
198334
  SbApi as z
197424
198335
  };
197425
- //# sourceMappingURL=index-CQOHJMew.js.map
198336
+ //# sourceMappingURL=index-kjgG33Rg.js.map