@superblocksteam/library 2.0.0-next.6 → 2.0.0-next.61

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 (69) hide show
  1. package/dist/{allPaths-JTh0AvL-.js → allPaths-BBGvblR2.js} +2 -2
  2. package/dist/{allPaths-JTh0AvL-.js.map → allPaths-BBGvblR2.js.map} +1 -1
  3. package/dist/{allPaths-CQicmj05.js → allPaths-BLs3_1JE.js} +2 -2
  4. package/dist/{allPaths-CQicmj05.js.map → allPaths-BLs3_1JE.js.map} +1 -1
  5. package/dist/{allPathsLoader-BzKYsLDE.js → allPathsLoader-D3ybY8Wk.js} +3 -3
  6. package/dist/{allPathsLoader-BzKYsLDE.js.map → allPathsLoader-D3ybY8Wk.js.map} +1 -1
  7. package/dist/{allPathsLoader-DUkr4f2u.js → allPathsLoader-Dggiono4.js} +3 -3
  8. package/dist/{allPathsLoader-DUkr4f2u.js.map → allPathsLoader-Dggiono4.js.map} +1 -1
  9. package/dist/{index-U8MX-8Hu.js → index-DWMz_Ohy.js} +1890 -941
  10. package/dist/{index-U8MX-8Hu.js.map → index-DWMz_Ohy.js.map} +1 -1
  11. package/dist/index.js +2 -2
  12. package/dist/{splitPathsBySizeLoader-D1iVVUla.js → splitPathsBySizeLoader-B-TUNLgR.js} +2 -2
  13. package/dist/{splitPathsBySizeLoader-D1iVVUla.js.map → splitPathsBySizeLoader-B-TUNLgR.js.map} +1 -1
  14. package/dist/{splitPathsBySizeLoader-4uQi8FeZ.js → splitPathsBySizeLoader-DHzX-8rX.js} +2 -2
  15. package/dist/{splitPathsBySizeLoader-4uQi8FeZ.js.map → splitPathsBySizeLoader-DHzX-8rX.js.map} +1 -1
  16. package/dist-types/edit-mode/default-table-data.d.ts +64 -0
  17. package/dist-types/edit-mode/dnd/utils.d.ts +19 -1
  18. package/dist-types/edit-mode/features/operation-store.d.ts +4 -0
  19. package/dist-types/edit-mode/source-update-api.d.ts +2 -1
  20. package/dist-types/lib/internal-details/identifier-normalizer.d.ts +0 -1
  21. package/dist-types/lib/internal-details/lib/evaluator/base-entity-manager.d.ts +3 -2
  22. package/dist-types/lib/internal-details/lib/evaluator/compute-engines.d.ts +2 -1
  23. package/dist-types/lib/internal-details/lib/evaluator/entity-manager.d.ts +8 -0
  24. package/dist-types/lib/internal-details/lib/evaluator/lazy-function.d.ts +1 -1
  25. package/dist-types/lib/internal-details/lib/types.d.ts +3 -0
  26. package/dist-types/lib/internal-details/scope/global.d.ts +1 -0
  27. package/dist-types/lib/user-facing/components/button/props.d.ts +0 -5
  28. package/dist-types/lib/user-facing/components/column/index.d.ts +8 -21
  29. package/dist-types/lib/user-facing/components/column/props.d.ts +20 -33
  30. package/dist-types/lib/user-facing/components/container/index.d.ts +8 -22
  31. package/dist-types/lib/user-facing/components/container/props.d.ts +7 -22
  32. package/dist-types/lib/user-facing/components/date-picker/date-picker-component.d.ts +3 -3
  33. package/dist-types/lib/user-facing/components/date-picker/utils.d.ts +1 -1
  34. package/dist-types/lib/user-facing/components/dropdown/index.d.ts +1 -1
  35. package/dist-types/lib/user-facing/components/dropdown/props.d.ts +1 -1
  36. package/dist-types/lib/user-facing/components/dropdown/types.d.ts +1 -1
  37. package/dist-types/lib/user-facing/components/grid/index.d.ts +8 -8
  38. package/dist-types/lib/user-facing/components/image/index.d.ts +1 -1
  39. package/dist-types/lib/user-facing/components/image/props.d.ts +1 -1
  40. package/dist-types/lib/user-facing/components/input/index.d.ts +5 -11
  41. package/dist-types/lib/user-facing/components/input/props.d.ts +5 -11
  42. package/dist-types/lib/user-facing/components/modal/index.d.ts +8 -13
  43. package/dist-types/lib/user-facing/components/modal/modal-component.d.ts +1 -1
  44. package/dist-types/lib/user-facing/components/modal/props.d.ts +8 -13
  45. package/dist-types/lib/user-facing/components/pixel-input/index.d.ts +7 -0
  46. package/dist-types/lib/user-facing/components/section/index.d.ts +2 -2
  47. package/dist-types/lib/user-facing/components/section/props.d.ts +2 -2
  48. package/dist-types/lib/user-facing/components/stack/index.d.ts +2 -2
  49. package/dist-types/lib/user-facing/components/switch/index.d.ts +1 -1
  50. package/dist-types/lib/user-facing/components/switch/props.d.ts +1 -1
  51. package/dist-types/lib/user-facing/components/table/column-properties-panel.d.ts +45 -40
  52. package/dist-types/lib/user-facing/components/table/components/boolean-value-icons.d.ts +5 -5
  53. package/dist-types/lib/user-facing/components/table/components/table-data-download.d.ts +2 -2
  54. package/dist-types/lib/user-facing/components/table/components/table-footer.d.ts +4 -4
  55. package/dist-types/lib/user-facing/components/table/components/table-pagination.d.ts +3 -3
  56. package/dist-types/lib/user-facing/components/table/derived-properties.d.ts +0 -1
  57. package/dist-types/lib/user-facing/components/table/index.d.ts +55 -51
  58. package/dist-types/lib/user-facing/components/table/props.d.ts +56 -53
  59. package/dist-types/lib/user-facing/components/table/table-component.d.ts +3 -3
  60. package/dist-types/lib/user-facing/components/table/table-styles.d.ts +0 -1
  61. package/dist-types/lib/user-facing/components/table/table-utilities.d.ts +1 -3
  62. package/dist-types/lib/user-facing/components/table/types.d.ts +8 -19
  63. package/dist-types/lib/user-facing/properties-panel/mixins/appearance-properties.d.ts +1 -0
  64. package/dist-types/lib/user-facing/properties-panel/mixins/appearance.d.ts +4 -8
  65. package/dist-types/lib/user-facing/properties-panel/mixins/form-inputs-properties.d.ts +1 -1
  66. package/dist-types/lib/user-facing/properties-panel/mixins/layout-section.d.ts +12 -14
  67. package/dist-types/lib/user-facing/properties-panel/props-builder.d.ts +1 -0
  68. package/dist-types/lib/user-facing/themes/constants.d.ts +2 -0
  69. package/package.json +4 -3
@@ -46,7 +46,7 @@ var __privateIn = (member, obj) => Object(obj) !== obj ? __typeError('Cannot use
46
46
  var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
47
47
  var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
48
48
  var __privateMethod = (obj, member, method4) => (__accessCheck(obj, member, "access private method"), method4);
49
- var _removeSourceIdElement_dec, _setSourceIdElement_dec, _setActiveRootInstanceId_dec, _init, _cancelApi_dec, _runApi_dec, _init2, _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;
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, { useMemo as useMemo$2, createContext, useContext, isValidElement as isValidElement$1, cloneElement as cloneElement$1, Children, useState, createElement, useRef, useLayoutEffect as useLayoutEffect$2, forwardRef, memo, version as version$2, useEffect, Component, useCallback, useImperativeHandle, useReducer, PureComponent, useSyncExternalStore, Suspense, createRef } from "react";
52
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 } from "./icons-D_yAT9A6.js";
@@ -2690,14 +2690,14 @@ function getLoaderFn$1(options) {
2690
2690
  if (!(loader === "all")) return [3, 3];
2691
2691
  return [4, import(
2692
2692
  /* webpackChunkName: "blueprint-icons-all-paths-loader" */
2693
- "./allPathsLoader-DUkr4f2u.js"
2693
+ "./allPathsLoader-Dggiono4.js"
2694
2694
  )];
2695
2695
  case 2:
2696
2696
  return [2, _b2.sent().allPathsLoader];
2697
2697
  case 3:
2698
2698
  return [4, import(
2699
2699
  /* webpackChunkName: "blueprint-icons-split-paths-by-size-loader" */
2700
- "./splitPathsBySizeLoader-4uQi8FeZ.js"
2700
+ "./splitPathsBySizeLoader-DHzX-8rX.js"
2701
2701
  )];
2702
2702
  case 4:
2703
2703
  return [2, _b2.sent().splitPathsBySizeLoader];
@@ -10229,11 +10229,12 @@ const cyrb53$1 = (str, seed2 = 0) => {
10229
10229
  h22 ^= Math.imul(h1 ^ h1 >>> 13, 3266489909);
10230
10230
  return 4294967296 * (2097151 & h22) + (h1 >>> 0);
10231
10231
  };
10232
- function PropertyInfo(value, type5 = "STATIC") {
10232
+ function PropertyInfo(value, type5 = "STATIC", extra) {
10233
10233
  return {
10234
10234
  __info: true,
10235
10235
  value,
10236
- type: type5
10236
+ type: type5,
10237
+ ...extra
10237
10238
  };
10238
10239
  }
10239
10240
  const Property = {
@@ -10243,7 +10244,7 @@ const Property = {
10243
10244
  Expression: (value) => PropertyInfo(value, "EXPRESSION"),
10244
10245
  Event: (value) => PropertyInfo(value, "EVENT"),
10245
10246
  Dimension: (value) => PropertyInfo(value, "DIMENSION"),
10246
- Computed: (value) => PropertyInfo(value, "COMPUTED"),
10247
+ Computed: (value, args) => PropertyInfo(value, "COMPUTED", args ? { args } : {}),
10247
10248
  Any: (value, type5 = "STATIC") => PropertyInfo(value, type5)
10248
10249
  };
10249
10250
  function isPropertyInfo(value) {
@@ -45784,6 +45785,240 @@ const SUPERBLOCKS_AUTHORIZATION_HEADER = "x-superblocks-authorization";
45784
45785
  akeylesssecretsmanager: srcExports.SecretsV1.Store,
45785
45786
  couchbase: srcExports.CouchbasePluginV1.Plugin
45786
45787
  });
45788
+ var TMP_HTTP_STATUS_CODE = "http.status_code";
45789
+ var TMP_HTTP_ROUTE = "http.route";
45790
+ var TMP_MESSAGING_SYSTEM = "messaging.system";
45791
+ var TMP_MESSAGING_DESTINATION_KIND = "messaging.destination_kind";
45792
+ var SEMATTRS_HTTP_STATUS_CODE = TMP_HTTP_STATUS_CODE;
45793
+ var SEMATTRS_HTTP_ROUTE = TMP_HTTP_ROUTE;
45794
+ var SEMATTRS_MESSAGING_SYSTEM = TMP_MESSAGING_SYSTEM;
45795
+ var SEMATTRS_MESSAGING_DESTINATION_KIND = TMP_MESSAGING_DESTINATION_KIND;
45796
+ const OBS_TAG_API_ID = "api-id";
45797
+ const OBS_TAG_HTTP_ROUTE = SEMATTRS_HTTP_ROUTE;
45798
+ const OBS_TAG_HTTP_STATUS_CODE = SEMATTRS_HTTP_STATUS_CODE;
45799
+ const OBS_TAG_APPLICATION_ID = "application-id";
45800
+ const OBS_TAG_BRANCH = "branch";
45801
+ const OBS_TAG_COMMIT_ID = "commit-id";
45802
+ const OBS_SOCKET_STATUS_CODE = "socket.status-code";
45803
+ class SocketErrorException extends Error {
45804
+ constructor(code3, message2) {
45805
+ super(message2);
45806
+ this.code = code3;
45807
+ this.message = message2;
45808
+ }
45809
+ }
45810
+ class ISocket {
45811
+ constructor(ws2, requestHandlers, globalMiddlewares, timeouts, logger) {
45812
+ this.responseHandler = /* @__PURE__ */ new Map();
45813
+ this.ws = ws2;
45814
+ this.requestHandlers = requestHandlers;
45815
+ this.globalMiddlewares = globalMiddlewares;
45816
+ this.nxtRequestId = 0;
45817
+ this.logger = logger ?? { error: console.error };
45818
+ this.timeouts = timeouts;
45819
+ this.resetConnectionTimeout();
45820
+ this.ws.addEventListener("message", async (event) => {
45821
+ const eventData = JSON.parse(event.data.toString());
45822
+ return this.handleMessage(eventData);
45823
+ });
45824
+ }
45825
+ async handleMessage(message2) {
45826
+ this.resetConnectionTimeout();
45827
+ if (message2.request) {
45828
+ const parts = message2.request.method.split(".");
45829
+ let handlers = this.requestHandlers;
45830
+ for (const part of parts) {
45831
+ handlers = handlers[part];
45832
+ if (!handlers) {
45833
+ return this.respondError(message2.request.id, {
45834
+ code: 2,
45835
+ message: `unknown method ${message2.request.method}`
45836
+ });
45837
+ }
45838
+ }
45839
+ if (!Array.isArray(handlers)) {
45840
+ return this.respondError(message2.request.id, {
45841
+ code: 2,
45842
+ message: "unknown method"
45843
+ });
45844
+ }
45845
+ handlers = [...this.globalMiddlewares, ...handlers];
45846
+ if (message2.request.setAuthorization) {
45847
+ this.peerAuthorization = message2.request.setAuthorization;
45848
+ }
45849
+ const reqCtx = {
45850
+ peerAuthorization: this.peerAuthorization,
45851
+ method: message2.request.method,
45852
+ requestId: message2.request.id
45853
+ };
45854
+ const client2 = createISocketClient(this);
45855
+ const payload = message2.request.payload;
45856
+ let alreadyResponded = false;
45857
+ const generateNextFn = (idx) => {
45858
+ let wasCalled = false;
45859
+ return async () => {
45860
+ if (alreadyResponded) {
45861
+ throw new SocketErrorException(4, "next() was called after the response was sent");
45862
+ }
45863
+ const handler = handlers[idx];
45864
+ if (!handler) {
45865
+ throw new SocketErrorException(5, "cannot call past the last handler in the chain");
45866
+ }
45867
+ if (wasCalled) {
45868
+ throw new SocketErrorException(6, "next() was called multiple times");
45869
+ }
45870
+ wasCalled = true;
45871
+ return this.callHandler(handler, payload, reqCtx, client2, generateNextFn(idx + 1));
45872
+ };
45873
+ };
45874
+ let response;
45875
+ try {
45876
+ response = await generateNextFn(0)();
45877
+ } catch (error) {
45878
+ const socketError = error instanceof SocketErrorException ? { code: error.code, message: error.message } : { code: 3, message: error.toString() };
45879
+ return this.respondError(message2.request.id, socketError, error);
45880
+ }
45881
+ this.respond(message2.request.id, response);
45882
+ alreadyResponded = true;
45883
+ } else if (message2.response && message2.response.id) {
45884
+ const responseHandler = this.responseHandler.get(message2.response.id);
45885
+ if (!responseHandler) {
45886
+ return;
45887
+ }
45888
+ if (message2.response.error) {
45889
+ responseHandler.reject(message2.response.error);
45890
+ }
45891
+ responseHandler.resolve(message2.response.payload);
45892
+ clearTimeout(responseHandler.timeout);
45893
+ this.responseHandler.delete(message2.response.id);
45894
+ } else {
45895
+ return this.respondError(-1, {
45896
+ code: 3,
45897
+ message: "unknown request id"
45898
+ });
45899
+ }
45900
+ }
45901
+ async callHandler(handler, params, ctx, client2, next2) {
45902
+ return handler(params, ctx, client2, next2);
45903
+ }
45904
+ request(method4, params, authorization) {
45905
+ return new Promise((resolve, reject) => {
45906
+ const requestId = ++this.nxtRequestId;
45907
+ this.responseHandler.set(requestId, {
45908
+ resolve: (result) => resolve(result),
45909
+ reject: (error) => reject(error)
45910
+ });
45911
+ let toSend = { request: { method: method4, payload: params, id: requestId, setAuthorization: authorization } };
45912
+ toSend = this.decorateToSend(toSend);
45913
+ this.ws.send(JSON.stringify(toSend));
45914
+ this.resetConnectionTimeout();
45915
+ this.resetNoResponseTimeout(requestId);
45916
+ });
45917
+ }
45918
+ decorateToSend(message2) {
45919
+ return message2;
45920
+ }
45921
+ respond(requestId, result) {
45922
+ const toSend = {
45923
+ response: {
45924
+ payload: result,
45925
+ id: requestId,
45926
+ error: null
45927
+ }
45928
+ };
45929
+ return this.ws.send(JSON.stringify(toSend));
45930
+ }
45931
+ respondError(requestId, error, exception) {
45932
+ const toSend = {
45933
+ response: {
45934
+ payload: null,
45935
+ id: requestId,
45936
+ error
45937
+ }
45938
+ };
45939
+ return this.ws.send(JSON.stringify(toSend));
45940
+ }
45941
+ resetConnectionTimeout() {
45942
+ var _a2, _b2;
45943
+ if (!((_a2 = this.timeouts) == null ? void 0 : _a2.connectionTimeoutInSeconds)) {
45944
+ return;
45945
+ }
45946
+ if (this.connectionTimeout) {
45947
+ clearTimeout(this.connectionTimeout);
45948
+ }
45949
+ this.connectionTimeout = setTimeout(this.handleConnectionTimeout(), ((_b2 = this.timeouts) == null ? void 0 : _b2.connectionTimeoutInSeconds) * 1e3);
45950
+ }
45951
+ handleConnectionTimeout() {
45952
+ return () => {
45953
+ var _a2;
45954
+ this.logger.error(`Connection timed out after ${(_a2 = this.timeouts) == null ? void 0 : _a2.connectionTimeoutInSeconds} seconds`);
45955
+ this.close();
45956
+ };
45957
+ }
45958
+ resetNoResponseTimeout(requestId) {
45959
+ var _a2, _b2;
45960
+ if (!((_a2 = this.timeouts) == null ? void 0 : _a2.noResponseTimeoutInSeconds)) {
45961
+ return;
45962
+ }
45963
+ const responseHandler = this.responseHandler.get(requestId);
45964
+ if (!responseHandler) {
45965
+ return;
45966
+ }
45967
+ const noResponseTimeout = responseHandler.timeout;
45968
+ const reject = responseHandler.reject;
45969
+ if (responseHandler.timeout) {
45970
+ clearTimeout(noResponseTimeout);
45971
+ }
45972
+ responseHandler.timeout = setTimeout(this.handleNoResponseTimeout(reject), ((_b2 = this.timeouts) == null ? void 0 : _b2.noResponseTimeoutInSeconds) * 1e3);
45973
+ }
45974
+ handleNoResponseTimeout(reject) {
45975
+ return () => {
45976
+ var _a2;
45977
+ const message2 = `Request timed out after ${(_a2 = this.timeouts) == null ? void 0 : _a2.noResponseTimeoutInSeconds} seconds`;
45978
+ this.logger.error(message2);
45979
+ reject({ code: 7, message: message2 });
45980
+ };
45981
+ }
45982
+ close() {
45983
+ clearTimeout(this.connectionTimeout);
45984
+ this.responseHandler.forEach((handler, key2) => {
45985
+ clearTimeout(handler.timeout);
45986
+ this.logger.error(`Rejecting pending requestId ${key2} due to connection close`);
45987
+ handler.reject({ code: 8, message: "Connection closed" });
45988
+ });
45989
+ this.ws.close();
45990
+ }
45991
+ }
45992
+ const proxyTarget = Object.freeze(() => {
45993
+ });
45994
+ function createIsocketProxy(socket, path2) {
45995
+ return new Proxy(proxyTarget, {
45996
+ get(_target, prop) {
45997
+ const childPath = path2 ? `${path2}.${prop}` : prop;
45998
+ if (childPath === "then") {
45999
+ return void 0;
46000
+ }
46001
+ return createIsocketProxy(socket, childPath);
46002
+ },
46003
+ apply(_target, _thisArg, args) {
46004
+ if (path2 === void 0) {
46005
+ throw new Error("The root object is not callable");
46006
+ }
46007
+ if (path2.endsWith(".apply") && args.length === 2 && Array.isArray(args[1])) {
46008
+ path2 = path2.slice(0, -".apply".length);
46009
+ args = args[1];
46010
+ }
46011
+ return socket.request(path2, args[0]);
46012
+ }
46013
+ });
46014
+ }
46015
+ function createISocketClient(socket) {
46016
+ return {
46017
+ close: () => socket.close(),
46018
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
46019
+ call: createIsocketProxy(socket, void 0)
46020
+ };
46021
+ }
45787
46022
  var _globalThis = typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : typeof window === "object" ? window : typeof global === "object" ? global : {};
45788
46023
  var VERSION = "1.9.0";
45789
46024
  var re$2 = /^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;
@@ -46028,7 +46263,7 @@ var __spreadArray$3 = function(to2, from2, pack) {
46028
46263
  }
46029
46264
  return to2.concat(ar2 || Array.prototype.slice.call(from2));
46030
46265
  };
46031
- var API_NAME$2 = "diag";
46266
+ var API_NAME$3 = "diag";
46032
46267
  var DiagAPI = (
46033
46268
  /** @class */
46034
46269
  function() {
@@ -46072,7 +46307,7 @@ var DiagAPI = (
46072
46307
  };
46073
46308
  self2.setLogger = setLogger;
46074
46309
  self2.disable = function() {
46075
- unregisterGlobal(API_NAME$2, self2);
46310
+ unregisterGlobal(API_NAME$3, self2);
46076
46311
  };
46077
46312
  self2.createComponentLogger = function(options) {
46078
46313
  return new DiagComponentLogger(options);
@@ -46313,7 +46548,7 @@ var __spreadArray$1 = function(to2, from2, pack) {
46313
46548
  }
46314
46549
  return to2.concat(ar2 || Array.prototype.slice.call(from2));
46315
46550
  };
46316
- var API_NAME$1 = "context";
46551
+ var API_NAME$2 = "context";
46317
46552
  var NOOP_CONTEXT_MANAGER = new NoopContextManager();
46318
46553
  var ContextAPI = (
46319
46554
  /** @class */
@@ -46327,7 +46562,7 @@ var ContextAPI = (
46327
46562
  return this._instance;
46328
46563
  };
46329
46564
  ContextAPI2.prototype.setGlobalContextManager = function(contextManager) {
46330
- return registerGlobal(API_NAME$1, contextManager, DiagAPI.instance());
46565
+ return registerGlobal(API_NAME$2, contextManager, DiagAPI.instance());
46331
46566
  };
46332
46567
  ContextAPI2.prototype.active = function() {
46333
46568
  return this._getContextManager().active();
@@ -46344,15 +46579,232 @@ var ContextAPI = (
46344
46579
  return this._getContextManager().bind(context2, target);
46345
46580
  };
46346
46581
  ContextAPI2.prototype._getContextManager = function() {
46347
- return getGlobal$1(API_NAME$1) || NOOP_CONTEXT_MANAGER;
46582
+ return getGlobal$1(API_NAME$2) || NOOP_CONTEXT_MANAGER;
46348
46583
  };
46349
46584
  ContextAPI2.prototype.disable = function() {
46350
46585
  this._getContextManager().disable();
46351
- unregisterGlobal(API_NAME$1, DiagAPI.instance());
46586
+ unregisterGlobal(API_NAME$2, DiagAPI.instance());
46352
46587
  };
46353
46588
  return ContextAPI2;
46354
46589
  }()
46355
46590
  );
46591
+ var TraceFlags;
46592
+ (function(TraceFlags2) {
46593
+ TraceFlags2[TraceFlags2["NONE"] = 0] = "NONE";
46594
+ TraceFlags2[TraceFlags2["SAMPLED"] = 1] = "SAMPLED";
46595
+ })(TraceFlags || (TraceFlags = {}));
46596
+ var INVALID_SPANID = "0000000000000000";
46597
+ var INVALID_TRACEID = "00000000000000000000000000000000";
46598
+ var INVALID_SPAN_CONTEXT = {
46599
+ traceId: INVALID_TRACEID,
46600
+ spanId: INVALID_SPANID,
46601
+ traceFlags: TraceFlags.NONE
46602
+ };
46603
+ var NonRecordingSpan = (
46604
+ /** @class */
46605
+ function() {
46606
+ function NonRecordingSpan2(_spanContext) {
46607
+ if (_spanContext === void 0) {
46608
+ _spanContext = INVALID_SPAN_CONTEXT;
46609
+ }
46610
+ this._spanContext = _spanContext;
46611
+ }
46612
+ NonRecordingSpan2.prototype.spanContext = function() {
46613
+ return this._spanContext;
46614
+ };
46615
+ NonRecordingSpan2.prototype.setAttribute = function(_key, _value) {
46616
+ return this;
46617
+ };
46618
+ NonRecordingSpan2.prototype.setAttributes = function(_attributes) {
46619
+ return this;
46620
+ };
46621
+ NonRecordingSpan2.prototype.addEvent = function(_name, _attributes) {
46622
+ return this;
46623
+ };
46624
+ NonRecordingSpan2.prototype.addLink = function(_link) {
46625
+ return this;
46626
+ };
46627
+ NonRecordingSpan2.prototype.addLinks = function(_links) {
46628
+ return this;
46629
+ };
46630
+ NonRecordingSpan2.prototype.setStatus = function(_status) {
46631
+ return this;
46632
+ };
46633
+ NonRecordingSpan2.prototype.updateName = function(_name) {
46634
+ return this;
46635
+ };
46636
+ NonRecordingSpan2.prototype.end = function(_endTime) {
46637
+ };
46638
+ NonRecordingSpan2.prototype.isRecording = function() {
46639
+ return false;
46640
+ };
46641
+ NonRecordingSpan2.prototype.recordException = function(_exception, _time) {
46642
+ };
46643
+ return NonRecordingSpan2;
46644
+ }()
46645
+ );
46646
+ var SPAN_KEY = createContextKey("OpenTelemetry Context Key SPAN");
46647
+ function getSpan(context2) {
46648
+ return context2.getValue(SPAN_KEY) || void 0;
46649
+ }
46650
+ function getActiveSpan() {
46651
+ return getSpan(ContextAPI.getInstance().active());
46652
+ }
46653
+ function setSpan(context2, span) {
46654
+ return context2.setValue(SPAN_KEY, span);
46655
+ }
46656
+ function deleteSpan(context2) {
46657
+ return context2.deleteValue(SPAN_KEY);
46658
+ }
46659
+ function setSpanContext(context2, spanContext) {
46660
+ return setSpan(context2, new NonRecordingSpan(spanContext));
46661
+ }
46662
+ function getSpanContext(context2) {
46663
+ var _a2;
46664
+ return (_a2 = getSpan(context2)) === null || _a2 === void 0 ? void 0 : _a2.spanContext();
46665
+ }
46666
+ var VALID_TRACEID_REGEX = /^([0-9a-f]{32})$/i;
46667
+ var VALID_SPANID_REGEX = /^[0-9a-f]{16}$/i;
46668
+ function isValidTraceId(traceId) {
46669
+ return VALID_TRACEID_REGEX.test(traceId) && traceId !== INVALID_TRACEID;
46670
+ }
46671
+ function isValidSpanId(spanId) {
46672
+ return VALID_SPANID_REGEX.test(spanId) && spanId !== INVALID_SPANID;
46673
+ }
46674
+ function isSpanContextValid(spanContext) {
46675
+ return isValidTraceId(spanContext.traceId) && isValidSpanId(spanContext.spanId);
46676
+ }
46677
+ function wrapSpanContext(spanContext) {
46678
+ return new NonRecordingSpan(spanContext);
46679
+ }
46680
+ var contextApi = ContextAPI.getInstance();
46681
+ var NoopTracer = (
46682
+ /** @class */
46683
+ function() {
46684
+ function NoopTracer2() {
46685
+ }
46686
+ NoopTracer2.prototype.startSpan = function(name, options, context2) {
46687
+ if (context2 === void 0) {
46688
+ context2 = contextApi.active();
46689
+ }
46690
+ var root2 = Boolean(options === null || options === void 0 ? void 0 : options.root);
46691
+ if (root2) {
46692
+ return new NonRecordingSpan();
46693
+ }
46694
+ var parentFromContext = context2 && getSpanContext(context2);
46695
+ if (isSpanContext(parentFromContext) && isSpanContextValid(parentFromContext)) {
46696
+ return new NonRecordingSpan(parentFromContext);
46697
+ } else {
46698
+ return new NonRecordingSpan();
46699
+ }
46700
+ };
46701
+ NoopTracer2.prototype.startActiveSpan = function(name, arg2, arg3, arg4) {
46702
+ var opts;
46703
+ var ctx;
46704
+ var fn3;
46705
+ if (arguments.length < 2) {
46706
+ return;
46707
+ } else if (arguments.length === 2) {
46708
+ fn3 = arg2;
46709
+ } else if (arguments.length === 3) {
46710
+ opts = arg2;
46711
+ fn3 = arg3;
46712
+ } else {
46713
+ opts = arg2;
46714
+ ctx = arg3;
46715
+ fn3 = arg4;
46716
+ }
46717
+ var parentContext = ctx !== null && ctx !== void 0 ? ctx : contextApi.active();
46718
+ var span = this.startSpan(name, opts, parentContext);
46719
+ var contextWithSpanSet = setSpan(parentContext, span);
46720
+ return contextApi.with(contextWithSpanSet, fn3, void 0, span);
46721
+ };
46722
+ return NoopTracer2;
46723
+ }()
46724
+ );
46725
+ function isSpanContext(spanContext) {
46726
+ return typeof spanContext === "object" && typeof spanContext["spanId"] === "string" && typeof spanContext["traceId"] === "string" && typeof spanContext["traceFlags"] === "number";
46727
+ }
46728
+ var NOOP_TRACER = new NoopTracer();
46729
+ var ProxyTracer = (
46730
+ /** @class */
46731
+ function() {
46732
+ function ProxyTracer2(_provider, name, version2, options) {
46733
+ this._provider = _provider;
46734
+ this.name = name;
46735
+ this.version = version2;
46736
+ this.options = options;
46737
+ }
46738
+ ProxyTracer2.prototype.startSpan = function(name, options, context2) {
46739
+ return this._getTracer().startSpan(name, options, context2);
46740
+ };
46741
+ ProxyTracer2.prototype.startActiveSpan = function(_name, _options, _context, _fn) {
46742
+ var tracer = this._getTracer();
46743
+ return Reflect.apply(tracer.startActiveSpan, tracer, arguments);
46744
+ };
46745
+ ProxyTracer2.prototype._getTracer = function() {
46746
+ if (this._delegate) {
46747
+ return this._delegate;
46748
+ }
46749
+ var tracer = this._provider.getDelegateTracer(this.name, this.version, this.options);
46750
+ if (!tracer) {
46751
+ return NOOP_TRACER;
46752
+ }
46753
+ this._delegate = tracer;
46754
+ return this._delegate;
46755
+ };
46756
+ return ProxyTracer2;
46757
+ }()
46758
+ );
46759
+ var NoopTracerProvider = (
46760
+ /** @class */
46761
+ function() {
46762
+ function NoopTracerProvider2() {
46763
+ }
46764
+ NoopTracerProvider2.prototype.getTracer = function(_name, _version, _options) {
46765
+ return new NoopTracer();
46766
+ };
46767
+ return NoopTracerProvider2;
46768
+ }()
46769
+ );
46770
+ var NOOP_TRACER_PROVIDER = new NoopTracerProvider();
46771
+ var ProxyTracerProvider = (
46772
+ /** @class */
46773
+ function() {
46774
+ function ProxyTracerProvider2() {
46775
+ }
46776
+ ProxyTracerProvider2.prototype.getTracer = function(name, version2, options) {
46777
+ var _a2;
46778
+ return (_a2 = this.getDelegateTracer(name, version2, options)) !== null && _a2 !== void 0 ? _a2 : new ProxyTracer(this, name, version2, options);
46779
+ };
46780
+ ProxyTracerProvider2.prototype.getDelegate = function() {
46781
+ var _a2;
46782
+ return (_a2 = this._delegate) !== null && _a2 !== void 0 ? _a2 : NOOP_TRACER_PROVIDER;
46783
+ };
46784
+ ProxyTracerProvider2.prototype.setDelegate = function(delegate) {
46785
+ this._delegate = delegate;
46786
+ };
46787
+ ProxyTracerProvider2.prototype.getDelegateTracer = function(name, version2, options) {
46788
+ var _a2;
46789
+ return (_a2 = this._delegate) === null || _a2 === void 0 ? void 0 : _a2.getTracer(name, version2, options);
46790
+ };
46791
+ return ProxyTracerProvider2;
46792
+ }()
46793
+ );
46794
+ var SpanKind;
46795
+ (function(SpanKind2) {
46796
+ SpanKind2[SpanKind2["INTERNAL"] = 0] = "INTERNAL";
46797
+ SpanKind2[SpanKind2["SERVER"] = 1] = "SERVER";
46798
+ SpanKind2[SpanKind2["CLIENT"] = 2] = "CLIENT";
46799
+ SpanKind2[SpanKind2["PRODUCER"] = 3] = "PRODUCER";
46800
+ SpanKind2[SpanKind2["CONSUMER"] = 4] = "CONSUMER";
46801
+ })(SpanKind || (SpanKind = {}));
46802
+ var SpanStatusCode;
46803
+ (function(SpanStatusCode2) {
46804
+ SpanStatusCode2[SpanStatusCode2["UNSET"] = 0] = "UNSET";
46805
+ SpanStatusCode2[SpanStatusCode2["OK"] = 1] = "OK";
46806
+ SpanStatusCode2[SpanStatusCode2["ERROR"] = 2] = "ERROR";
46807
+ })(SpanStatusCode || (SpanStatusCode = {}));
46356
46808
  var context$2 = ContextAPI.getInstance();
46357
46809
  var NoopTextMapPropagator = (
46358
46810
  /** @class */
@@ -46383,7 +46835,7 @@ function setBaggage(context2, baggage) {
46383
46835
  function deleteBaggage(context2) {
46384
46836
  return context2.deleteValue(BAGGAGE_KEY);
46385
46837
  }
46386
- var API_NAME = "propagation";
46838
+ var API_NAME$1 = "propagation";
46387
46839
  var NOOP_TEXT_MAP_PROPAGATOR = new NoopTextMapPropagator();
46388
46840
  var PropagationAPI = (
46389
46841
  /** @class */
@@ -46402,7 +46854,7 @@ var PropagationAPI = (
46402
46854
  return this._instance;
46403
46855
  };
46404
46856
  PropagationAPI2.prototype.setGlobalPropagator = function(propagator) {
46405
- return registerGlobal(API_NAME, propagator, DiagAPI.instance());
46857
+ return registerGlobal(API_NAME$1, propagator, DiagAPI.instance());
46406
46858
  };
46407
46859
  PropagationAPI2.prototype.inject = function(context2, carrier, setter) {
46408
46860
  if (setter === void 0) {
@@ -46420,230 +46872,181 @@ var PropagationAPI = (
46420
46872
  return this._getGlobalPropagator().fields();
46421
46873
  };
46422
46874
  PropagationAPI2.prototype.disable = function() {
46423
- unregisterGlobal(API_NAME, DiagAPI.instance());
46875
+ unregisterGlobal(API_NAME$1, DiagAPI.instance());
46424
46876
  };
46425
46877
  PropagationAPI2.prototype._getGlobalPropagator = function() {
46426
- return getGlobal$1(API_NAME) || NOOP_TEXT_MAP_PROPAGATOR;
46878
+ return getGlobal$1(API_NAME$1) || NOOP_TEXT_MAP_PROPAGATOR;
46427
46879
  };
46428
46880
  return PropagationAPI2;
46429
46881
  }()
46430
46882
  );
46431
46883
  var propagation = PropagationAPI.getInstance();
46432
- class SocketErrorException extends Error {
46433
- constructor(code3, message2) {
46434
- super(message2);
46435
- this.code = code3;
46436
- this.message = message2;
46884
+ var API_NAME = "trace";
46885
+ var TraceAPI = (
46886
+ /** @class */
46887
+ function() {
46888
+ function TraceAPI2() {
46889
+ this._proxyTracerProvider = new ProxyTracerProvider();
46890
+ this.wrapSpanContext = wrapSpanContext;
46891
+ this.isSpanContextValid = isSpanContextValid;
46892
+ this.deleteSpan = deleteSpan;
46893
+ this.getSpan = getSpan;
46894
+ this.getActiveSpan = getActiveSpan;
46895
+ this.getSpanContext = getSpanContext;
46896
+ this.setSpan = setSpan;
46897
+ this.setSpanContext = setSpanContext;
46898
+ }
46899
+ TraceAPI2.getInstance = function() {
46900
+ if (!this._instance) {
46901
+ this._instance = new TraceAPI2();
46902
+ }
46903
+ return this._instance;
46904
+ };
46905
+ TraceAPI2.prototype.setGlobalTracerProvider = function(provider) {
46906
+ var success = registerGlobal(API_NAME, this._proxyTracerProvider, DiagAPI.instance());
46907
+ if (success) {
46908
+ this._proxyTracerProvider.setDelegate(provider);
46909
+ }
46910
+ return success;
46911
+ };
46912
+ TraceAPI2.prototype.getTracerProvider = function() {
46913
+ return getGlobal$1(API_NAME) || this._proxyTracerProvider;
46914
+ };
46915
+ TraceAPI2.prototype.getTracer = function(name, version2) {
46916
+ return this.getTracerProvider().getTracer(name, version2);
46917
+ };
46918
+ TraceAPI2.prototype.disable = function() {
46919
+ unregisterGlobal(API_NAME, DiagAPI.instance());
46920
+ this._proxyTracerProvider = new ProxyTracerProvider();
46921
+ };
46922
+ return TraceAPI2;
46923
+ }()
46924
+ );
46925
+ var trace$1 = TraceAPI.getInstance();
46926
+ function isPromise(obj) {
46927
+ return obj !== null && typeof obj === "object" && typeof obj.then === "function";
46928
+ }
46929
+ const endSpan = (traced, span) => {
46930
+ try {
46931
+ const result = traced();
46932
+ if (isPromise(result)) {
46933
+ return Promise.resolve(result).catch((err) => {
46934
+ setHttpStatusFromError(span, typeof err === "string" ? new Error(err) : err);
46935
+ throw err;
46936
+ }).finally(() => span.end());
46937
+ } else {
46938
+ span.end();
46939
+ return result;
46940
+ }
46941
+ } catch (error) {
46942
+ setHttpStatusFromError(span, error);
46943
+ span.end();
46944
+ throw error;
46437
46945
  }
46946
+ };
46947
+ function setHttpStatusFromError(span, error) {
46948
+ span.setAttribute(OBS_TAG_HTTP_STATUS_CODE, 500);
46949
+ span.recordException(error);
46950
+ span.setStatus({ code: SpanStatusCode.ERROR, message: error.message });
46438
46951
  }
46439
- class ISocket {
46440
- constructor(ws2, requestHandlers, globalMiddlewares, timeouts, logger) {
46441
- this.responseHandler = /* @__PURE__ */ new Map();
46442
- this.ws = ws2;
46443
- this.requestHandlers = requestHandlers;
46444
- this.globalMiddlewares = globalMiddlewares;
46445
- this.nxtRequestId = 0;
46446
- this.logger = logger ?? { error: console.error };
46447
- this.timeouts = timeouts;
46448
- this.resetConnectionTimeout();
46449
- this.ws.addEventListener("message", async (event) => {
46450
- const eventData = JSON.parse(event.data.toString());
46451
- return this.handleMessage(eventData);
46952
+ class TracedSocket extends ISocket {
46953
+ constructor(ws2, requestHandlers, globalMiddlewares, tracer, timeouts, logger) {
46954
+ super(ws2, requestHandlers, globalMiddlewares, timeouts, logger);
46955
+ this.activeSpanByRequestId = /* @__PURE__ */ new Map();
46956
+ this.middlewareSpanByReqId = /* @__PURE__ */ new Map();
46957
+ this.tracer = tracer;
46958
+ }
46959
+ async callHandler(handler, params, ctx, client2, next2) {
46960
+ let currentContext = context$2.active();
46961
+ const middleWareSpan = this.middlewareSpanByReqId.get(ctx.requestId);
46962
+ const activeSpan = this.activeSpanByRequestId.get(ctx.requestId);
46963
+ if (middleWareSpan) {
46964
+ middleWareSpan.end();
46965
+ if (activeSpan) {
46966
+ currentContext = trace$1.setSpan(context$2.active(), activeSpan);
46967
+ }
46968
+ }
46969
+ let result;
46970
+ await context$2.with(currentContext, async () => {
46971
+ await this.tracer.startActiveSpan(`WS HANDLER ${handler.name === "" ? ctx.method : handler.name}`, {
46972
+ attributes: {
46973
+ [SEMATTRS_MESSAGING_SYSTEM]: "ws",
46974
+ [SEMATTRS_MESSAGING_DESTINATION_KIND]: "websocket"
46975
+ },
46976
+ kind: SpanKind.SERVER
46977
+ }, async (span) => {
46978
+ this.middlewareSpanByReqId.set(ctx.requestId, span);
46979
+ result = await endSpan(() => super.callHandler(handler, params, ctx, client2, next2), span);
46980
+ this.middlewareSpanByReqId.delete(ctx.requestId);
46981
+ });
46452
46982
  });
46983
+ return result;
46453
46984
  }
46454
46985
  async handleMessage(message2) {
46455
- this.resetConnectionTimeout();
46456
46986
  if (message2.request) {
46457
- const parts = message2.request.method.split(".");
46458
- let handlers = this.requestHandlers;
46459
- for (const part of parts) {
46460
- handlers = handlers[part];
46461
- if (!handlers) {
46462
- return this.respondError(message2.request.id, {
46463
- code: 2,
46464
- message: `unknown method ${message2.request.method}`
46465
- });
46466
- }
46467
- }
46468
- if (!Array.isArray(handlers)) {
46469
- return this.respondError(message2.request.id, {
46470
- code: 2,
46471
- message: "unknown method"
46472
- });
46473
- }
46474
- handlers = [...this.globalMiddlewares, ...handlers];
46475
- if (message2.request.setAuthorization) {
46476
- this.peerAuthorization = message2.request.setAuthorization;
46477
- }
46478
- const reqCtx = {
46479
- peerAuthorization: this.peerAuthorization,
46480
- method: message2.request.method,
46481
- requestId: message2.request.id
46482
- };
46483
- const client2 = createISocketClient(this);
46987
+ const spanName = message2.request.method;
46988
+ const requestId = message2.request.id;
46484
46989
  const payload = message2.request.payload;
46485
- let alreadyResponded = false;
46486
- const generateNextFn = (idx) => {
46487
- let wasCalled = false;
46488
- return async () => {
46489
- if (alreadyResponded) {
46490
- throw new SocketErrorException(4, "next() was called after the response was sent");
46491
- }
46492
- const handler = handlers[idx];
46493
- if (!handler) {
46494
- throw new SocketErrorException(5, "cannot call past the last handler in the chain");
46495
- }
46496
- if (wasCalled) {
46497
- throw new SocketErrorException(6, "next() was called multiple times");
46498
- }
46499
- wasCalled = true;
46500
- return this.callHandler(handler, payload, reqCtx, client2, generateNextFn(idx + 1));
46501
- };
46502
- };
46503
- let response;
46504
- try {
46505
- response = await generateNextFn(0)();
46506
- } catch (error) {
46507
- const socketError = error instanceof SocketErrorException ? { code: error.code, message: error.message } : { code: 3, message: error.toString() };
46508
- return this.respondError(message2.request.id, socketError, error);
46509
- }
46510
- this.respond(message2.request.id, response);
46511
- alreadyResponded = true;
46512
- } else if (message2.response && message2.response.id) {
46513
- const responseHandler = this.responseHandler.get(message2.response.id);
46514
- if (!responseHandler) {
46515
- return;
46516
- }
46517
- if (message2.response.error) {
46518
- responseHandler.reject(message2.response.error);
46519
- }
46520
- responseHandler.resolve(message2.response.payload);
46521
- clearTimeout(responseHandler.timeout);
46522
- this.responseHandler.delete(message2.response.id);
46523
- } else {
46524
- return this.respondError(-1, {
46525
- code: 3,
46526
- message: "unknown request id"
46527
- });
46990
+ await context$2.with(propagation.extract(ROOT_CONTEXT, message2.request), async () => await this.tracer.startActiveSpan(`WS SERVER ${spanName}`, {
46991
+ attributes: {
46992
+ [SEMATTRS_MESSAGING_SYSTEM]: "ws",
46993
+ [SEMATTRS_MESSAGING_DESTINATION_KIND]: "websocket",
46994
+ [OBS_TAG_HTTP_ROUTE]: spanName,
46995
+ [OBS_TAG_APPLICATION_ID]: payload == null ? void 0 : payload["applicationId"],
46996
+ [OBS_TAG_API_ID]: payload == null ? void 0 : payload["apiId"],
46997
+ [OBS_TAG_BRANCH]: (payload == null ? void 0 : payload["branch"]) ?? (payload == null ? void 0 : payload["branchName"]),
46998
+ [OBS_TAG_COMMIT_ID]: payload == null ? void 0 : payload["commitId"]
46999
+ },
47000
+ kind: SpanKind.SERVER
47001
+ }, async (span) => {
47002
+ this.lastActiveSpan = span;
47003
+ this.activeSpanByRequestId.set(requestId, span);
47004
+ const result = await endSpan(() => super.handleMessage(message2), span);
47005
+ this.activeSpanByRequestId.delete(requestId);
47006
+ return result;
47007
+ }));
47008
+ } else if (message2.response) {
47009
+ this.addEvent("ws.received-response", { ["ws.response.id"]: message2.response.id });
47010
+ return await super.handleMessage(message2);
46528
47011
  }
46529
47012
  }
46530
- async callHandler(handler, params, ctx, client2, next2) {
46531
- return handler(params, ctx, client2, next2);
46532
- }
46533
47013
  request(method4, params, authorization) {
46534
- return new Promise((resolve, reject) => {
46535
- const requestId = ++this.nxtRequestId;
46536
- this.responseHandler.set(requestId, {
46537
- resolve: (result) => resolve(result),
46538
- reject: (error) => reject(error)
46539
- });
46540
- const toSend = { request: { method: method4, payload: params, id: requestId, setAuthorization: authorization } };
46541
- propagation.inject(context$2.active(), toSend.request);
46542
- this.ws.send(JSON.stringify(toSend));
46543
- this.resetConnectionTimeout();
46544
- this.resetNoResponseTimeout(requestId);
47014
+ return this.tracer.startActiveSpan(`WS CLIENT ${method4}`, (span) => {
47015
+ this.addEvent("ws.send-request", { ["ws.request.method"]: method4, ["ws.request.id"]: this.nxtRequestId });
47016
+ const result = super.request(method4, params, authorization);
47017
+ span.end();
47018
+ return result;
46545
47019
  });
46546
47020
  }
47021
+ decorateToSend(message2) {
47022
+ propagation.inject(context$2.active(), message2.request);
47023
+ return message2;
47024
+ }
46547
47025
  respond(requestId, result) {
46548
- const toSend = {
46549
- response: {
46550
- payload: result,
46551
- id: requestId,
46552
- error: null
46553
- }
46554
- };
46555
- return this.ws.send(JSON.stringify(toSend));
47026
+ this.addEvent("ws.send-response", { ["ws.response.id"]: requestId });
47027
+ return super.respond(requestId, result);
46556
47028
  }
46557
47029
  respondError(requestId, error, exception) {
46558
- const toSend = {
46559
- response: {
46560
- payload: null,
46561
- id: requestId,
46562
- error
46563
- }
46564
- };
46565
- return this.ws.send(JSON.stringify(toSend));
46566
- }
46567
- resetConnectionTimeout() {
46568
- var _a2, _b2;
46569
- if (!((_a2 = this.timeouts) == null ? void 0 : _a2.connectionTimeoutInSeconds)) {
46570
- return;
46571
- }
46572
- if (this.connectionTimeout) {
46573
- clearTimeout(this.connectionTimeout);
47030
+ this.addEvent("ws.send-error", { ["ws.response.id"]: requestId });
47031
+ if (this.lastActiveSpan) {
47032
+ setHttpStatusFromError(this.lastActiveSpan, exception ?? new Error(error.message));
47033
+ this.lastActiveSpan.setAttribute(OBS_SOCKET_STATUS_CODE, error.code);
46574
47034
  }
46575
- this.connectionTimeout = setTimeout(this.handleConnectionTimeout(), ((_b2 = this.timeouts) == null ? void 0 : _b2.connectionTimeoutInSeconds) * 1e3);
47035
+ return super.respondError(requestId, error, exception);
46576
47036
  }
46577
- handleConnectionTimeout() {
46578
- return () => {
46579
- var _a2;
46580
- this.logger.error(`Connection timed out after ${(_a2 = this.timeouts) == null ? void 0 : _a2.connectionTimeoutInSeconds} seconds`);
46581
- this.close();
46582
- };
46583
- }
46584
- resetNoResponseTimeout(requestId) {
46585
- var _a2, _b2;
46586
- if (!((_a2 = this.timeouts) == null ? void 0 : _a2.noResponseTimeoutInSeconds)) {
46587
- return;
46588
- }
46589
- const responseHandler = this.responseHandler.get(requestId);
46590
- if (!responseHandler) {
46591
- return;
47037
+ addEvent(eventName, attributes2) {
47038
+ if (this.lastActiveSpan) {
47039
+ this.lastActiveSpan.addEvent(eventName, attributes2, /* @__PURE__ */ new Date());
46592
47040
  }
46593
- const noResponseTimeout = responseHandler.timeout;
46594
- const reject = responseHandler.reject;
46595
- if (responseHandler.timeout) {
46596
- clearTimeout(noResponseTimeout);
46597
- }
46598
- responseHandler.timeout = setTimeout(this.handleNoResponseTimeout(reject), ((_b2 = this.timeouts) == null ? void 0 : _b2.noResponseTimeoutInSeconds) * 1e3);
46599
- }
46600
- handleNoResponseTimeout(reject) {
46601
- return () => {
46602
- var _a2;
46603
- const message2 = `Request timed out after ${(_a2 = this.timeouts) == null ? void 0 : _a2.noResponseTimeoutInSeconds} seconds`;
46604
- this.logger.error(message2);
46605
- reject({ code: 7, message: message2 });
46606
- };
46607
47041
  }
46608
47042
  close() {
46609
- clearTimeout(this.connectionTimeout);
46610
- this.responseHandler.forEach((handler, key2) => {
46611
- clearTimeout(handler.timeout);
46612
- this.logger.error(`Rejecting pending requestId ${key2} due to connection close`);
46613
- handler.reject({ code: 8, message: "Connection closed" });
46614
- });
46615
- this.ws.close();
46616
- }
46617
- }
46618
- const proxyTarget = Object.freeze(() => {
46619
- });
46620
- function createIsocketProxy(socket, path2) {
46621
- return new Proxy(proxyTarget, {
46622
- get(_target, prop) {
46623
- const childPath = path2 ? `${path2}.${prop}` : prop;
46624
- if (childPath === "then") {
46625
- return void 0;
46626
- }
46627
- return createIsocketProxy(socket, childPath);
46628
- },
46629
- apply(_target, _thisArg, args) {
46630
- if (path2 === void 0) {
46631
- throw new Error("The root object is not callable");
46632
- }
46633
- if (path2.endsWith(".apply") && args.length === 2 && Array.isArray(args[1])) {
46634
- path2 = path2.slice(0, -".apply".length);
46635
- args = args[1];
46636
- }
46637
- return socket.request(path2, args[0]);
47043
+ for (const span of this.activeSpanByRequestId.values()) {
47044
+ span.end();
46638
47045
  }
46639
- });
46640
- }
46641
- function createISocketClient(socket) {
46642
- return {
46643
- close: () => socket.close(),
46644
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
46645
- call: createIsocketProxy(socket, void 0)
46646
- };
47046
+ this.activeSpanByRequestId = /* @__PURE__ */ new Map();
47047
+ this.lastActiveSpan = void 0;
47048
+ super.close();
47049
+ }
46647
47050
  }
46648
47051
  var ws$1 = null;
46649
47052
  if (typeof WebSocket !== "undefined") {
@@ -46668,9 +47071,9 @@ function connectWebSocket(wsUrl, protocol) {
46668
47071
  });
46669
47072
  });
46670
47073
  }
46671
- class ISocketWithClientAuth extends ISocket {
46672
- constructor(ws2, authorization, requestHandlers, globalMiddlewares, timeouts) {
46673
- super(ws2, requestHandlers, globalMiddlewares, timeouts);
47074
+ class ISocketWithClientAuth extends TracedSocket {
47075
+ constructor(ws2, authorization, requestHandlers, globalMiddlewares, tracer, timeouts) {
47076
+ super(ws2, requestHandlers, globalMiddlewares, tracer, timeouts);
46674
47077
  this.hasSentAuth = false;
46675
47078
  this.authorization = authorization;
46676
47079
  }
@@ -47933,12 +48336,11 @@ const TriggerStepType = {
47933
48336
  SET_PROFILE: "setProfile",
47934
48337
  TRIGGER_EVENT: "triggerEvent"
47935
48338
  };
47936
- var ThemeMode;
47937
- (function(ThemeMode2) {
47938
- ThemeMode2["LIGHT"] = "LIGHT";
47939
- ThemeMode2["DARK"] = "DARK";
47940
- ThemeMode2["AUTO"] = "AUTO";
47941
- })(ThemeMode || (ThemeMode = {}));
48339
+ const ThemeMode = {
48340
+ LIGHT: "LIGHT",
48341
+ DARK: "DARK",
48342
+ AUTO: "AUTO"
48343
+ };
47942
48344
  const CUSTOM_THEME_TYPOGRAPHY_KEY = "custom";
47943
48345
  ({
47944
48346
  top: Dim.px(11),
@@ -48339,12 +48741,23 @@ const noBorder = (theme) => ({
48339
48741
  style: "solid",
48340
48742
  color: theme.colors.neutral100
48341
48743
  });
48744
+ const onePixelTransparentBorder = () => ({
48745
+ width: Dim.px(1),
48746
+ style: "solid",
48747
+ color: "transparent"
48748
+ });
48342
48749
  const noBorderOject = (theme) => ({
48343
48750
  left: noBorder(theme),
48344
48751
  right: noBorder(theme),
48345
48752
  top: noBorder(theme),
48346
48753
  bottom: noBorder(theme)
48347
48754
  });
48755
+ const onePixelTransparentBorderObject = () => ({
48756
+ left: onePixelTransparentBorder(),
48757
+ right: onePixelTransparentBorder(),
48758
+ top: onePixelTransparentBorder(),
48759
+ bottom: onePixelTransparentBorder()
48760
+ });
48348
48761
  ({
48349
48762
  topLeft: Dim.px(0),
48350
48763
  topRight: Dim.px(0),
@@ -48363,7 +48776,7 @@ const BASE_THEME_V5 = {
48363
48776
  mode: ThemeMode.LIGHT,
48364
48777
  primaryColor: colors.ACCENT_BLUE_500,
48365
48778
  padding: PADDING_PRESETS_BY_THEME_VERSION[5].medium.value,
48366
- spacing: Dim.px(6),
48779
+ spacing: Dim.px(12),
48367
48780
  palette: {
48368
48781
  dark: DEFAULT_DARK_PALETTE,
48369
48782
  light: DEFAULT_LIGHT_PALETTE
@@ -48486,6 +48899,7 @@ const KEY_VALUE_PADDING = {
48486
48899
  bottom: Dim.px(12)
48487
48900
  };
48488
48901
  const KEY_VALUE_SPACING = Dim.px(24);
48902
+ const DEFAULT_GRID_ROW_SIZE = 12;
48489
48903
  const READABILITY_THRESHOLD = 20;
48490
48904
  const CONTRAST_TEXT_THRESHOLD = 25;
48491
48905
  const MAX_ITERATIONS = 10;
@@ -53574,7 +53988,7 @@ var Reaction = /* @__PURE__ */ function() {
53574
53988
  _proto.toString = function toString22() {
53575
53989
  return "Reaction[" + this.name_ + "]";
53576
53990
  };
53577
- _proto.trace = function trace$1(enterBreakPoint) {
53991
+ _proto.trace = function trace$12(enterBreakPoint) {
53578
53992
  if (enterBreakPoint === void 0) {
53579
53993
  enterBreakPoint = false;
53580
53994
  }
@@ -56881,9 +57295,6 @@ __decorateElement(_init, 1, "setActiveRootInstanceId", _setActiveRootInstanceId_
56881
57295
  __decorateElement(_init, 1, "setSourceIdElement", _setSourceIdElement_dec, InteractionLayerManager);
56882
57296
  __decorateElement(_init, 1, "removeSourceIdElement", _removeSourceIdElement_dec, InteractionLayerManager);
56883
57297
  __decoratorMetadata(_init, InteractionLayerManager);
56884
- const generateId$1 = () => {
56885
- return Math.random().toString(36).substring(2, 15);
56886
- };
56887
57298
  const CancelApisTrigger = {
56888
57299
  type: TriggerStepType.CANCEL_APIS,
56889
57300
  async execute(_context, step) {
@@ -57022,7 +57433,8 @@ const SetComponentPropertyTrigger = {
57022
57433
  name: context2.name,
57023
57434
  func: (state, value2, step2) => {
57024
57435
  var _a2;
57025
- return state[(_a2 = step2.widget) == null ? void 0 : _a2.name][step2.propertyName] = value2;
57436
+ if (!state) return;
57437
+ state[(_a2 = step2.widget) == null ? void 0 : _a2.name][step2.propertyName] = value2;
57026
57438
  },
57027
57439
  args: [value, step]
57028
57440
  });
@@ -57123,7 +57535,8 @@ const RunJsTrigger = {
57123
57535
  scopeId: context2.scopeId,
57124
57536
  name: context2.name,
57125
57537
  func: step.handler,
57126
- args: [context2.additionalContext]
57538
+ args: [context2.additionalContext],
57539
+ excludeState: true
57127
57540
  });
57128
57541
  }
57129
57542
  }
@@ -75055,7 +75468,7 @@ var dimensionMaxMap = {
75055
75468
  xxl: "1599.98px"
75056
75469
  };
75057
75470
  var SiderContext = /* @__PURE__ */ React.createContext({});
75058
- var generateId = /* @__PURE__ */ function() {
75471
+ var generateId$1 = /* @__PURE__ */ function() {
75059
75472
  var i3 = 0;
75060
75473
  return function() {
75061
75474
  var prefix2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
@@ -75113,7 +75526,7 @@ var Sider = /* @__PURE__ */ React.forwardRef(function(_a2, ref2) {
75113
75526
  };
75114
75527
  }, [breakpoint]);
75115
75528
  useEffect(function() {
75116
- var uniqueId3 = generateId("ant-sider-");
75529
+ var uniqueId3 = generateId$1("ant-sider-");
75117
75530
  siderHook.addSider(uniqueId3);
75118
75531
  return function() {
75119
75532
  return siderHook.removeSider(uniqueId3);
@@ -89953,7 +90366,10 @@ const SetStateVarTrigger = {
89953
90366
  context2.rootStore.entityManager.runCode({
89954
90367
  scopeId: context2.scopeId,
89955
90368
  name: context2.name,
89956
- func: (state, value2, step2) => state[step2.state.name].value = value2,
90369
+ func: (state, value2, step2) => {
90370
+ if (!state) return;
90371
+ state[step2.state.name].value = value2;
90372
+ },
89957
90373
  args: [value, step]
89958
90374
  });
89959
90375
  },
@@ -94346,6 +94762,9 @@ class Prop {
94346
94762
  validate: defaultValidator
94347
94763
  };
94348
94764
  }
94765
+ static unset() {
94766
+ return new Prop("any");
94767
+ }
94349
94768
  static string() {
94350
94769
  return new Prop("string", VALIDATORS.TEXT);
94351
94770
  }
@@ -95007,6 +95426,7 @@ function createGlobalObject({
95007
95426
  );
95008
95427
  }
95009
95428
  const prettyPrintFunction = (func, args) => {
95429
+ if (!func) return "";
95010
95430
  const funcStr = func.toString().replace(/\s+/g, " ").trim();
95011
95431
  const argsStr = args.map((arg) => {
95012
95432
  try {
@@ -95051,13 +95471,22 @@ class EvalComputeEngine {
95051
95471
  }
95052
95472
  }
95053
95473
  class DirectComputeEngine {
95054
- compute({ snapshot, entityName, func, args, path: path2 }) {
95474
+ compute({
95475
+ snapshot,
95476
+ entityName,
95477
+ func,
95478
+ args,
95479
+ path: path2,
95480
+ excludeState
95481
+ }) {
95482
+ if (!func) return void 0;
95055
95483
  try {
95056
- return func.call(
95057
- snapshot[entityName.value],
95058
- snapshot,
95059
- ...args || []
95060
- );
95484
+ const entity = snapshot[entityName.value];
95485
+ const funcArgs = args || [];
95486
+ if (excludeState) {
95487
+ return func.call(entity, ...funcArgs);
95488
+ }
95489
+ return func.call(entity, snapshot, ...funcArgs);
95061
95490
  } catch (error) {
95062
95491
  console.log(`Error in direct(${entityName.value}.${path2})`, {
95063
95492
  error,
@@ -95416,8 +95845,9 @@ const lazyFunctionSymbol = Symbol("lazy-function");
95416
95845
  const isLazyFunction = (value) => {
95417
95846
  return typeof value === "function" && value[lazyFunctionSymbol];
95418
95847
  };
95419
- const LazyFunction = (source2) => {
95420
- const func = new Function(source2);
95848
+ const LazyFunction = (source2, args = []) => {
95849
+ const argsObj = `{ ${args.join(", ")} }`;
95850
+ const func = new Function(argsObj, source2);
95421
95851
  func[lazyFunctionSymbol] = true;
95422
95852
  return func;
95423
95853
  };
@@ -95852,6 +96282,93 @@ class EntityManager {
95852
96282
  delete scope.entityMeta[params.name.value];
95853
96283
  (_b2 = (_a2 = this.atoms) == null ? void 0 : _a2[params.scopeId]) == null ? true : delete _b2[params.name.value];
95854
96284
  }
96285
+ deleteProperty(params) {
96286
+ var _a2, _b2;
96287
+ const { scopeId, name, prop } = params;
96288
+ if (prop.split(".").includes(RECORD_PATH_IDENTIFIER)) {
96289
+ return;
96290
+ }
96291
+ const scope = this.getScope(scopeId);
96292
+ const entity = scope.getEntity(name);
96293
+ const entityMeta = scope.getEntityMeta(name);
96294
+ if (!entity || !entityMeta) {
96295
+ console.warn(`Entity ${name.value} not found in scope ${scopeId}`);
96296
+ return;
96297
+ }
96298
+ const pathSegments = prop.split(".");
96299
+ const isNested = pathSegments.length > 1;
96300
+ const finalSegment = pathSegments.pop() || "";
96301
+ const parentSegments = isNested ? pathSegments : [];
96302
+ let propParent = entity;
96303
+ let metaParent = entityMeta;
96304
+ if (isNested) {
96305
+ for (const segment of parentSegments) {
96306
+ if (!(segment in propParent) || !(segment in metaParent)) {
96307
+ return;
96308
+ }
96309
+ propParent = propParent[segment];
96310
+ metaParent = metaParent[segment];
96311
+ }
96312
+ }
96313
+ if (finalSegment in propParent) {
96314
+ delete propParent[finalSegment];
96315
+ }
96316
+ if (finalSegment in metaParent) {
96317
+ delete metaParent[finalSegment];
96318
+ }
96319
+ if ((_b2 = (_a2 = this.atoms[scopeId]) == null ? void 0 : _a2[name.value]) == null ? void 0 : _b2[prop]) {
96320
+ delete this.atoms[scopeId][name.value][prop];
96321
+ }
96322
+ }
96323
+ /*
96324
+ This is a helper method to delete obsolete nested properties
96325
+ It handles cases like deleting custom columns on the table
96326
+ */
96327
+ deleteObsoleteNestedProperties(scopeId, name, currentProps, entity) {
96328
+ for (const [propKey, propValue] of Object.entries(currentProps)) {
96329
+ if (propValue && typeof propValue === "object" && !Array.isArray(propValue)) {
96330
+ const entityPropValue = entity[propKey];
96331
+ if (!entityPropValue || typeof entityPropValue !== "object" || Array.isArray(entityPropValue)) {
96332
+ continue;
96333
+ }
96334
+ const currentKeys = new Set(Object.keys(propValue));
96335
+ const existingKeys = Object.keys(entityPropValue);
96336
+ const keysToDelete = existingKeys.filter(
96337
+ (key2) => !currentKeys.has(key2)
96338
+ );
96339
+ for (const keyToDelete of keysToDelete) {
96340
+ const obsoleteObj = entityPropValue[keyToDelete];
96341
+ if (obsoleteObj && typeof obsoleteObj === "object") {
96342
+ const nestedProps = this.getNestedPropertyPaths(
96343
+ `${propKey}.${keyToDelete}`,
96344
+ obsoleteObj
96345
+ );
96346
+ for (const nestedProp of nestedProps) {
96347
+ this.deleteProperty({ scopeId, name, prop: nestedProp });
96348
+ }
96349
+ }
96350
+ this.deleteProperty({
96351
+ scopeId,
96352
+ name,
96353
+ prop: `${propKey}.${keyToDelete}`
96354
+ });
96355
+ }
96356
+ }
96357
+ }
96358
+ }
96359
+ getNestedPropertyPaths(basePath, obj) {
96360
+ const paths = [];
96361
+ if (obj && typeof obj === "object" && !Array.isArray(obj)) {
96362
+ for (const [key2, value] of Object.entries(obj)) {
96363
+ const currentPath = `${basePath}.${key2}`;
96364
+ paths.push(currentPath);
96365
+ if (value && typeof value === "object" && !Array.isArray(value)) {
96366
+ paths.push(...this.getNestedPropertyPaths(currentPath, value));
96367
+ }
96368
+ }
96369
+ }
96370
+ return paths;
96371
+ }
95855
96372
  deleteEntityById(params) {
95856
96373
  const scope = this.getScope(params.scopeId);
95857
96374
  const name = scope.getEntityName(params.entityId);
@@ -95886,6 +96403,7 @@ class EntityManager {
95886
96403
  if (instanceId) {
95887
96404
  scope.idToName[instanceId] = name;
95888
96405
  }
96406
+ this.deleteObsoleteNestedProperties(scopeId, name, props, entity);
95889
96407
  const managedPropsForType = this.componentRegistry.getManagedProps(type5);
95890
96408
  const functionalProps = toExecutablesOrValues(props, managedPropsForType);
95891
96409
  const addedProperties = /* @__PURE__ */ new Set();
@@ -95932,14 +96450,15 @@ class EntityManager {
95932
96450
  scope.setEntityName(instanceId, newName, existingName);
95933
96451
  }
95934
96452
  runCode(params) {
95935
- const { scopeId, name, func, args } = params;
96453
+ const { scopeId, name, func, args, excludeState } = params;
95936
96454
  const state = this.getState(scopeId);
95937
96455
  const computeEngine = this.dirComputeEngine;
95938
96456
  computeEngine.compute({
95939
96457
  snapshot: state,
95940
96458
  entityName: name,
95941
96459
  func,
95942
- args
96460
+ args,
96461
+ excludeState
95943
96462
  });
95944
96463
  }
95945
96464
  computeValue(params) {
@@ -96866,10 +97385,25 @@ const microPatches = (oldValue, newValue, baseStr) => {
96866
97385
  }
96867
97386
  ];
96868
97387
  }
97388
+ if (isPrimitive(oldValue) || isPrimitive(newValue)) {
97389
+ if (oldValue !== newValue) {
97390
+ return [
97391
+ {
97392
+ op: "update",
97393
+ path: pathStringToArray(baseStr),
97394
+ value: newValue
97395
+ }
97396
+ ];
97397
+ }
97398
+ return [];
97399
+ }
96869
97400
  const diffs = diff(oldValue, newValue);
96870
97401
  const basePath = pathStringToArray(baseStr);
96871
97402
  return diffs.map((diff2) => toMobXPatchFromMicroDiff(diff2, basePath));
96872
97403
  };
97404
+ function isPrimitive(value) {
97405
+ return value === null || typeof value === "string" || typeof value === "number" || typeof value === "boolean" || typeof value === "undefined";
97406
+ }
96873
97407
  function toMobXPatchFromMicroDiff(diff2, basePath) {
96874
97408
  const type5 = diff2.type;
96875
97409
  const fullPath = [...basePath, ...diff2.path];
@@ -97391,6 +97925,9 @@ const rootStore$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
97391
97925
  __proto__: null,
97392
97926
  default: rootStore
97393
97927
  }, Symbol.toStringTag, { value: "Module" }));
97928
+ const generateId = () => {
97929
+ return Math.random().toString(36).substring(2, 15);
97930
+ };
97394
97931
  class OperationAPI {
97395
97932
  constructor(serverUrl) {
97396
97933
  __publicField(this, "socket");
@@ -97438,6 +97975,10 @@ class OperationAPI {
97438
97975
  var _a2;
97439
97976
  return (_a2 = this.socket) == null ? void 0 : _a2.call.editor.deleteEntity(payload);
97440
97977
  });
97978
+ __publicField(this, "editorRenameElement", async (payload) => {
97979
+ var _a2;
97980
+ return (_a2 = this.socket) == null ? void 0 : _a2.call.editor.renameElement(payload);
97981
+ });
97441
97982
  __publicField(this, "editorUpdateTheme", async (payload) => {
97442
97983
  var _a2;
97443
97984
  return (_a2 = this.socket) == null ? void 0 : _a2.call.editor.updateTheme(payload);
@@ -97570,6 +98111,7 @@ async function connectSocket(serverUrl, peerId, userId) {
97570
98111
  ]
97571
98112
  },
97572
98113
  [],
98114
+ trace$1.getTracer("superblocks-ui-framework"),
97573
98115
  {
97574
98116
  connectionTimeoutInSeconds: 6 * 60,
97575
98117
  noResponseTimeoutInSeconds: 5 * 60
@@ -97584,7 +98126,7 @@ async function connectSocket(serverUrl, peerId, userId) {
97584
98126
  return void 0;
97585
98127
  }
97586
98128
  }
97587
- _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];
98129
+ _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];
97588
98130
  class OperationManager {
97589
98131
  constructor() {
97590
98132
  __runInitializers(_init3, 5, this);
@@ -97623,7 +98165,7 @@ class OperationManager {
97623
98165
  return [];
97624
98166
  }
97625
98167
  executeOrAddToBatch(operation) {
97626
- const transactionId = this.batchOperationTransactionId ?? generateId$1();
98168
+ const transactionId = this.batchOperationTransactionId ?? generateId();
97627
98169
  const payload = this.waitingForBatch ? operation.payload : {
97628
98170
  ...operation.payload,
97629
98171
  transaction: {
@@ -97697,7 +98239,7 @@ class OperationManager {
97697
98239
  }
97698
98240
  batchUpdate(performOperations) {
97699
98241
  this.waitingForBatch = true;
97700
- this.batchOperationTransactionId = generateId$1();
98242
+ this.batchOperationTransactionId = generateId();
97701
98243
  performOperations();
97702
98244
  editorBridge.editOpRequest("editor:batchUpdate", {
97703
98245
  updates: this.batchOperations.map(
@@ -97856,6 +98398,27 @@ class OperationManager {
97856
98398
  setWidgetProperty(sourceId, property, value, callback) {
97857
98399
  this.setWidgetProperties(sourceId, { [property]: value }, callback);
97858
98400
  }
98401
+ renameWidget(params) {
98402
+ var _a2;
98403
+ const widgetMeta = getEditStore().runtimeEntitiesManager.getAnyEditorWidgetMeta(
98404
+ params.sourceId
98405
+ );
98406
+ const oldName = ((_a2 = widgetMeta == null ? void 0 : widgetMeta.name) == null ? void 0 : _a2.value) ?? "";
98407
+ const kind = (widgetMeta == null ? void 0 : widgetMeta.type) === "SbPage" ? "page" : "component";
98408
+ const scopeName = (widgetMeta == null ? void 0 : widgetMeta.scopeId) ? rootStore.entityManager.getScopeName(widgetMeta.scopeId) : void 0;
98409
+ if (!scopeName) {
98410
+ console.error("No scope name found for widget", params.sourceId);
98411
+ return;
98412
+ }
98413
+ const renameRequest = {
98414
+ elementId: params.sourceId,
98415
+ newName: params.newName,
98416
+ oldName,
98417
+ kind,
98418
+ scopeName
98419
+ };
98420
+ editorBridge.editOpRequest("editor:renameElement", renameRequest);
98421
+ }
97859
98422
  async ensureFilesSynced() {
97860
98423
  await sourceUpdateApi.ensureFilesSynced();
97861
98424
  }
@@ -97874,6 +98437,7 @@ __decorateElement(_init3, 1, "deleteComponents", _deleteComponents_dec, Operatio
97874
98437
  __decorateElement(_init3, 1, "writeRuntimeProperties", _writeRuntimeProperties_dec, OperationManager);
97875
98438
  __decorateElement(_init3, 1, "setWidgetProperties", _setWidgetProperties_dec, OperationManager);
97876
98439
  __decorateElement(_init3, 1, "setWidgetProperty", _setWidgetProperty_dec, OperationManager);
98440
+ __decorateElement(_init3, 1, "renameWidget", _renameWidget_dec, OperationManager);
97877
98441
  __decoratorMetadata(_init3, OperationManager);
97878
98442
  class PropertiesPanelManager {
97879
98443
  constructor(runtimeEntitiesManager, entityManager) {
@@ -98082,7 +98646,7 @@ function getPropertyValue$1({
98082
98646
  }
98083
98647
  const getNormalizedIdInfo = (params) => {
98084
98648
  var _a2, _b2;
98085
- const name = ((_a2 = params.bind) == null ? void 0 : _a2.entityName) ?? params.propsName;
98649
+ const name = (_a2 = params.bind) == null ? void 0 : _a2.entityName;
98086
98650
  const scopeId = ((_b2 = params.bind) == null ? void 0 : _b2.scopeId) ?? params.fallbackScopeId;
98087
98651
  return {
98088
98652
  name,
@@ -98145,7 +98709,6 @@ class RuntimeWidgetsManager {
98145
98709
  const childSourceId = child.props[WIDGET_SOURCE_ID_ATTRIBUTE];
98146
98710
  const { name: childName, scopeId: childScopeId } = getNormalizedIdInfo({
98147
98711
  bind: getBindingIdentifier(child.props.bind),
98148
- propsName: child.props.name,
98149
98712
  fallbackScopeId
98150
98713
  });
98151
98714
  const childIdentifier = this.nameManager.registerAndGetIdentifiers({
@@ -98733,18 +99296,39 @@ const filterSafeStackDimensionProperties = (existingProps) => {
98733
99296
  };
98734
99297
  const filterSafeGridDimensionProperties = (existingProps) => {
98735
99298
  const { width, height } = existingProps;
98736
- let safeHeight;
98737
- let safeWidth;
99299
+ const safeDimensions = {};
98738
99300
  if ((height == null ? void 0 : height.mode) === "rows" || (height == null ? void 0 : height.mode) === "fit") {
98739
- safeHeight = Property.Dimension(height);
99301
+ safeDimensions.height = Property.Dimension(height);
98740
99302
  }
98741
99303
  if ((width == null ? void 0 : width.mode) === "columns") {
98742
- safeWidth = Property.Dimension(width);
99304
+ safeDimensions.width = Property.Dimension(width);
99305
+ }
99306
+ return safeDimensions;
99307
+ };
99308
+ const defaultSizeForComponent = (componentType, isFreeform, draggedDimensions) => {
99309
+ const height = Property.Dimension(Dim.fit());
99310
+ if (isFreeform) {
99311
+ const guWidth = (draggedDimensions == null ? void 0 : draggedDimensions.widthGU) ?? 4;
99312
+ return {
99313
+ height,
99314
+ width: Property.Dimension(Dim.col(guWidth))
99315
+ };
99316
+ }
99317
+ switch (componentType) {
99318
+ case "SbText":
99319
+ case "SbButton":
99320
+ case "SbCheckbox":
99321
+ case "SbSwitch":
99322
+ return { height, width: Property.Dimension(Dim.fit()) };
99323
+ case "SbImage":
99324
+ return {
99325
+ height,
99326
+ width: Property.Dimension(Dim.px((draggedDimensions == null ? void 0 : draggedDimensions.widthPx) ?? 288))
99327
+ // Matches widget config response. This should never be undefined though.
99328
+ };
99329
+ default:
99330
+ return { height, width: Property.Dimension(Dim.fill()) };
98743
99331
  }
98744
- return {
98745
- width: safeWidth,
98746
- height: safeHeight
98747
- };
98748
99332
  };
98749
99333
  const isWidgetGrid = (widget) => {
98750
99334
  var _a2;
@@ -98892,7 +99476,7 @@ class GridManager {
98892
99476
  };
98893
99477
  }
98894
99478
  get lazyTargetGridInfo() {
98895
- var _a2, _b2;
99479
+ var _a2, _b2, _c2;
98896
99480
  const targetRect = this.dnd.activeTargetRect;
98897
99481
  const dropTargetId = this.dnd.dropTargetId;
98898
99482
  if (!targetRect || !dropTargetId) {
@@ -98913,7 +99497,7 @@ class GridManager {
98913
99497
  const targetPadding = entityValues == null ? void 0 : entityValues.padding;
98914
99498
  const xPadding = (((_a2 = targetPadding == null ? void 0 : targetPadding.left) == null ? void 0 : _a2.value) ?? 0) + (((_b2 = targetPadding == null ? void 0 : targetPadding.right) == null ? void 0 : _b2.value) ?? 0);
98915
99499
  const tileWidth = (targetRect.width - xPadding) / targetColumns;
98916
- const tileHeight = (entityValues == null ? void 0 : entityValues.rowSize) ?? 12;
99500
+ const tileHeight = ((_c2 = entityValues == null ? void 0 : entityValues.rowHeight) == null ? void 0 : _c2.value) ?? 12;
98917
99501
  const targetHeightGU = Math.ceil(targetRect.height / tileHeight);
98918
99502
  return {
98919
99503
  targetColumns,
@@ -99443,6 +100027,16 @@ class DragAndDropManager {
99443
100027
  registerStores({
99444
100028
  DragAndDropManager: this
99445
100029
  });
100030
+ startEditorSync({
100031
+ store: this,
100032
+ storeId: "dnd",
100033
+ projection(store) {
100034
+ return {
100035
+ isDragging: store._isDragging,
100036
+ isDraggingNewComponent: store._isDraggingNewComponent
100037
+ };
100038
+ }
100039
+ });
99446
100040
  }
99447
100041
  get isDragging() {
99448
100042
  return this._isDragging;
@@ -109560,11 +110154,10 @@ const DuplicatedNamePopover = observer(({ name, children, showWarning, sourceId
109560
110154
  (evt) => {
109561
110155
  evt.preventDefault();
109562
110156
  evt.stopPropagation();
109563
- getEditStore().operationManager.setWidgetProperty(
110157
+ getEditStore().operationManager.renameWidget({
109564
110158
  sourceId,
109565
- "name",
109566
- Property.Static(newName)
109567
- );
110159
+ newName
110160
+ });
109568
110161
  },
109569
110162
  [newName, sourceId]
109570
110163
  );
@@ -110208,9 +110801,24 @@ const InternalGlobalScope = internalCreateScope(() => ({}), {
110208
110801
  name: GLOBAL_SCOPE_ID,
110209
110802
  scopeId: GLOBAL_SCOPE_ID
110210
110803
  });
110804
+ const globalName = getName("Global");
110211
110805
  const GlobalScope = registerScope(
110212
110806
  ({ children }) => {
110213
110807
  const { theme } = useTheme();
110808
+ useEffect(() => {
110809
+ const global2 = rootStore.entityManager.getEntity(
110810
+ GLOBAL_SCOPE_ID,
110811
+ globalName
110812
+ );
110813
+ if (!global2) {
110814
+ rootStore.entityManager.createEntity({
110815
+ name: globalName,
110816
+ type: "global",
110817
+ props: {},
110818
+ scopeId: GLOBAL_SCOPE_ID
110819
+ });
110820
+ }
110821
+ }, []);
110214
110822
  useEffect(() => {
110215
110823
  const name = getName("Theme");
110216
110824
  const existingTheme = rootStore.entityManager.getEntity(
@@ -110236,6 +110844,13 @@ const GlobalScope = registerScope(
110236
110844
  },
110237
110845
  InternalGlobalScope
110238
110846
  );
110847
+ const updateGlobalScope = (global2) => {
110848
+ rootStore.entityManager.updateEntity({
110849
+ name: globalName,
110850
+ props: global2,
110851
+ scopeId: GLOBAL_SCOPE_ID
110852
+ });
110853
+ };
110239
110854
  function createEntityProxy(entityName) {
110240
110855
  return new Proxy(
110241
110856
  {},
@@ -110251,6 +110866,17 @@ const Theme = createEntityProxy("Theme");
110251
110866
  const Global = createEntityProxy("Global");
110252
110867
  const Embed = createEntityProxy("Embed");
110253
110868
  const Env = createEntityProxy("Env");
110869
+ const getPreviousAndCurrentWidgetProps = (updates, widgetMeta) => {
110870
+ const previousProps = widgetMeta.props;
110871
+ const newProps = Object.entries(updates).reduce(
110872
+ (acc, [key2, value]) => {
110873
+ acc[key2] = value.value;
110874
+ return acc;
110875
+ },
110876
+ { ...previousProps }
110877
+ );
110878
+ return [previousProps, newProps];
110879
+ };
110254
110880
  const getSizeProp = ({
110255
110881
  label,
110256
110882
  controlType,
@@ -110377,6 +111003,9 @@ const spacing = (options) => {
110377
111003
  }
110378
111004
  return themeValue ?? Theme.spacing;
110379
111005
  },
111006
+ isVisible: function() {
111007
+ return this.layout !== "freeform";
111008
+ },
110380
111009
  ...rest
110381
111010
  });
110382
111011
  if (defaultSpacing || themeValue) {
@@ -110519,7 +111148,7 @@ const getAlignmentProps = () => {
110519
111148
  })
110520
111149
  };
110521
111150
  };
110522
- const containerLayout = () => Prop.union({
111151
+ const containerLayout = (sizeProps) => Prop.union({
110523
111152
  shared: {
110524
111153
  layout: Prop.string().readAndWrite().default("vertical").propertiesPanel({
110525
111154
  label: "Layout",
@@ -110544,35 +111173,58 @@ const containerLayout = () => Prop.union({
110544
111173
  tooltip: "Horizontal"
110545
111174
  }
110546
111175
  ]
111176
+ }).onEdit(({ sourceId, updates, widgetMeta }) => {
111177
+ var _a2, _b2, _c2, _d2;
111178
+ const [previousProps, newProps] = getPreviousAndCurrentWidgetProps(updates, widgetMeta);
111179
+ const baseUpdate = {
111180
+ [sourceId]: {
111181
+ props: updates,
111182
+ meta: {}
111183
+ }
111184
+ };
111185
+ if (previousProps.layout !== "freeform" && newProps.layout === "freeform" && ((_a2 = newProps.width) == null ? void 0 : _a2.mode) === "fit") {
111186
+ const editStore2 = rootStore.editStore;
111187
+ if (!editStore2) {
111188
+ return baseUpdate;
111189
+ }
111190
+ const runtimeWidgetRect = (_d2 = (_c2 = (_b2 = editStore2.interactionLayerManager.getSourceIdElements(sourceId)) == null ? void 0 : _b2[0]) == null ? void 0 : _c2.firstElementChild) == null ? void 0 : _d2.getBoundingClientRect();
111191
+ const pixelWidth = runtimeWidgetRect == null ? void 0 : runtimeWidgetRect.width;
111192
+ baseUpdate[sourceId].props = {
111193
+ ...updates,
111194
+ // fit-contenet width does not make sense grid component
111195
+ width: pixelWidth ? Property.Dimension(Dim.px(pixelWidth)) : Property.Static(Dim.fill())
111196
+ };
111197
+ }
111198
+ return baseUpdate;
110547
111199
  })
110548
111200
  },
110549
111201
  variants: [
110550
- {
110551
- layout: Prop.literal("freeform"),
110552
- columns: Prop.number().readAndWrite().propertiesPanel({
110553
- label: "Columns",
110554
- placeholder: "Enter columns"
110555
- }).default(48),
110556
- rows: Prop.number().readAndWrite().propertiesPanel({
110557
- label: "Rows",
110558
- placeholder: "Enter rows",
110559
- visibility: "SHOW_NAME",
110560
- defaultOnAdd: 12
110561
- }),
110562
- rowSize: Prop.number().readAndWrite().propertiesPanel({
110563
- label: "Row size",
110564
- placeholder: "Enter row size",
110565
- visibility: "SHOW_NAME",
110566
- defaultOnAdd: 12
110567
- })
110568
- },
110569
111202
  {
110570
111203
  layout: Prop.literal("vertical"),
110571
- ...getAlignmentProps()
111204
+ ...getAlignmentProps(),
111205
+ ...sizeProps
110572
111206
  },
110573
111207
  {
110574
111208
  layout: Prop.literal("horizontal"),
110575
- ...getAlignmentProps()
111209
+ ...getAlignmentProps(),
111210
+ ...sizeProps
111211
+ },
111212
+ {
111213
+ layout: Prop.literal("freeform"),
111214
+ // put sizing props before the columns and rowHeight. Due to limit of Union, we need to put freefrom variant last because sizing props are merged with other variants, the last one will decide sizing props position
111215
+ ...sizeProps,
111216
+ columns: Prop.number().readAndWrite().propertiesPanel({
111217
+ label: "Columns",
111218
+ placeholder: "Enter columns",
111219
+ helpText: "The total number of columns used to subdivide the grid horizontally. Each child component’s width will be defined relative to this total"
111220
+ }).default(12),
111221
+ rowHeight: Prop.dimension().readAndWrite().propertiesPanel({
111222
+ label: "Row height",
111223
+ placeholder: "row height in pixels",
111224
+ controlType: "DIMENSION_VALUE_CONTROL",
111225
+ dimensionUnit: "px",
111226
+ helpText: "The pixel height of each row in the grid. Child components can span multiple rows to maintain consistent vertical alignment"
111227
+ }).default(DEFAULT_GRID_ROW_SIZE)
110576
111228
  }
110577
111229
  ]
110578
111230
  });
@@ -114231,6 +114883,8 @@ const useWidgetNodeRef = (instanceId) => {
114231
114883
  return nodeRef;
114232
114884
  };
114233
114885
  const DraggableWidget = observer(function DraggableWidget2(props) {
114886
+ const editStore2 = getEditStore();
114887
+ const disableDrag = !editStore2.ui.dnd.canDragWidget(props.instanceId) || editStore2.ui.dnd.isDraggingNewComponent;
114234
114888
  const {
114235
114889
  setNodeRef: setDraggableNodeRef,
114236
114890
  isDragging,
@@ -114238,7 +114892,7 @@ const DraggableWidget = observer(function DraggableWidget2(props) {
114238
114892
  attributes: attributes2
114239
114893
  } = useComponentDraggable({
114240
114894
  instanceId: props.instanceId,
114241
- disableDrag: props.disableDrag ?? false
114895
+ disableDrag: disableDrag ?? false
114242
114896
  });
114243
114897
  const widgetNode = useWidgetNodeRef(props.instanceId);
114244
114898
  useEffect(() => {
@@ -114253,6 +114907,20 @@ const DraggableWidget = observer(function DraggableWidget2(props) {
114253
114907
  ...attributes2,
114254
114908
  className: "sb-draggable-wrapper",
114255
114909
  "data-is-dragged": isDragging,
114910
+ onPointerDown: (e3) => {
114911
+ if (!disableDrag) {
114912
+ listeners == null ? void 0 : listeners.onPointerDown(e3);
114913
+ } else {
114914
+ e3.stopPropagation();
114915
+ }
114916
+ },
114917
+ onPointerMove: (e3) => {
114918
+ if (!disableDrag) {
114919
+ listeners == null ? void 0 : listeners.onPointerMove(e3);
114920
+ } else {
114921
+ e3.stopPropagation();
114922
+ }
114923
+ },
114256
114924
  children: props.children
114257
114925
  }
114258
114926
  );
@@ -114608,6 +115276,178 @@ var KeyValuePropertyType = /* @__PURE__ */ ((KeyValuePropertyType2) => {
114608
115276
  KeyValuePropertyType2["EMAIL"] = "email";
114609
115277
  return KeyValuePropertyType2;
114610
115278
  })(KeyValuePropertyType || {});
115279
+ const DEFAULT_TABLE_DATA = [
115280
+ {
115281
+ photo: "https://cdn.superblocks.com/sample-data/rachel_kim",
115282
+ name: "Rachel Kim",
115283
+ email: "rachel.kim89@gmail.com",
115284
+ role: "Vendor Partner",
115285
+ company: "Urban Threads Co.",
115286
+ status: "Active",
115287
+ date_joined: "2023-04-12",
115288
+ last_activity: "2025-06-07T16:20:00Z"
115289
+ },
115290
+ {
115291
+ photo: "https://cdn.superblocks.com/sample-data/daniel_vargas",
115292
+ name: "Daniel Vargas",
115293
+ email: "dvargas1984@yahoo.com",
115294
+ role: "Logistics Contact",
115295
+ company: "Vargas Freight Ltd.",
115296
+ status: "Pending",
115297
+ date_joined: "2024-01-23",
115298
+ last_activity: "2025-05-30T13:45:00Z"
115299
+ },
115300
+ {
115301
+ photo: "https://cdn.superblocks.com/sample-data/sophie_liu",
115302
+ name: "Sophie Liu",
115303
+ email: "sophie.liu.personal@gmail.com",
115304
+ role: "Retail Manager",
115305
+ company: "Modern Goods",
115306
+ status: "Active",
115307
+ date_joined: "2022-09-10",
115308
+ last_activity: "2025-06-08T09:03:00Z"
115309
+ },
115310
+ {
115311
+ photo: "https://cdn.superblocks.com/sample-data/omar_el-sayed",
115312
+ name: "Omar El-Sayed",
115313
+ email: "omarsayed78@hotmail.com",
115314
+ role: "Accounts Payable",
115315
+ company: "Sayed Textiles",
115316
+ status: "Inactive",
115317
+ date_joined: "2021-06-05",
115318
+ last_activity: "2024-12-18T11:40:00Z"
115319
+ },
115320
+ {
115321
+ photo: "https://cdn.superblocks.com/sample-data/grace_nguyen",
115322
+ name: "Grace Nguyen",
115323
+ email: "gracenguyen23@icloud.com",
115324
+ role: "Product Supplier",
115325
+ company: "Green Earth Supplies",
115326
+ status: "Active",
115327
+ date_joined: "2023-11-03",
115328
+ last_activity: "2025-06-08T17:28:00Z"
115329
+ },
115330
+ {
115331
+ photo: "https://cdn.superblocks.com/sample-data/alex_romero",
115332
+ name: "Alex Romero",
115333
+ email: "alex.romero@gmail.com",
115334
+ role: "Client Account Owner",
115335
+ company: "Romero & Co.",
115336
+ status: "Suspended",
115337
+ date_joined: "2022-02-28",
115338
+ last_activity: "2025-03-11T08:20:00Z"
115339
+ },
115340
+ {
115341
+ photo: "https://cdn.superblocks.com/sample-data/lena_schmidt",
115342
+ name: "Lena Schmidt",
115343
+ email: "lena_schmidt92@gmx.de",
115344
+ role: "Wholesale Contact",
115345
+ company: "Schmidt Imports",
115346
+ status: "Active",
115347
+ date_joined: "2021-12-01",
115348
+ last_activity: "2025-06-06T21:10:00Z"
115349
+ },
115350
+ {
115351
+ photo: "https://cdn.superblocks.com/sample-data/devon_price",
115352
+ name: "Devon Price",
115353
+ email: "devon.price22@aol.com",
115354
+ role: "Fulfillment Liaison",
115355
+ company: "DepotLink",
115356
+ status: "Active",
115357
+ date_joined: "2024-05-17",
115358
+ last_activity: "2025-06-08T10:42:00Z"
115359
+ },
115360
+ {
115361
+ photo: "https://cdn.superblocks.com/sample-data/isabella_rossi",
115362
+ name: "Isabella Rossi",
115363
+ email: "bella.rossi@gmail.com",
115364
+ role: "Procurement Agent",
115365
+ company: "Rossi Global Sourcing",
115366
+ status: "Pending",
115367
+ date_joined: "2023-07-19",
115368
+ last_activity: "2025-05-29T14:05:00Z"
115369
+ },
115370
+ {
115371
+ photo: "https://cdn.superblocks.com/sample-data/tariq_khan",
115372
+ name: "Tariq Khan",
115373
+ email: "tariq.khan92@protonmail.com",
115374
+ role: "International Ops Lead",
115375
+ company: "CrossPort Trade Inc.",
115376
+ status: "Active",
115377
+ date_joined: "2022-11-08",
115378
+ last_activity: "2025-06-08T16:11:00Z"
115379
+ },
115380
+ {
115381
+ photo: "https://cdn.superblocks.com/sample-data/emily_zhang",
115382
+ name: "Emily Zhang",
115383
+ email: "emilyzhang.home@gmail.com",
115384
+ role: "Logistics Coordinator",
115385
+ company: "Zhang Export Ltd.",
115386
+ status: "Active",
115387
+ date_joined: "2023-03-12",
115388
+ last_activity: "2025-06-08T19:02:00Z"
115389
+ }
115390
+ ];
115391
+ const DEFAULT_TABLE_COLUMNS = {
115392
+ name: {
115393
+ columnType: "text",
115394
+ label: "Name"
115395
+ },
115396
+ email: {
115397
+ columnType: "email",
115398
+ label: "Email"
115399
+ },
115400
+ role: {
115401
+ columnType: "text",
115402
+ label: "Role"
115403
+ },
115404
+ company: {
115405
+ columnType: "text",
115406
+ label: "Company"
115407
+ },
115408
+ status: {
115409
+ columnType: "tags",
115410
+ tagDisplayConfig: {
115411
+ Active: {
115412
+ color: "#14CDB733"
115413
+ },
115414
+ Pending: {
115415
+ color: "#FF9F3533"
115416
+ },
115417
+ Inactive: {
115418
+ color: "#a6a0a033"
115419
+ },
115420
+ Suspended: {
115421
+ color: "#FF62A433"
115422
+ }
115423
+ },
115424
+ label: "Status"
115425
+ },
115426
+ date_joined: {
115427
+ columnType: "date",
115428
+ inputFormat: "YYYY-MM-DD",
115429
+ outputFormat: "MM-DD-YYYY",
115430
+ label: "Date joined"
115431
+ },
115432
+ last_activity: {
115433
+ columnType: "date",
115434
+ inputFormat: "YYYY-MM-DDTHH:mm:ssZ",
115435
+ outputFormat: "MM-DD-YYYY",
115436
+ label: "Last activity"
115437
+ },
115438
+ photo: {
115439
+ columnType: "image",
115440
+ label: "Photo"
115441
+ }
115442
+ };
115443
+ const DEFAULT_TABLE_KEYS = Object.keys(DEFAULT_TABLE_COLUMNS);
115444
+ const CLEARED_TABLE_COLUMNS = DEFAULT_TABLE_KEYS.reduce(
115445
+ (acc, key2) => {
115446
+ acc[key2] = void 0;
115447
+ return acc;
115448
+ },
115449
+ {}
115450
+ );
114611
115451
  function getParentInfo(parent) {
114612
115452
  const parentComponentMeta = getEditStore().runtimeEntitiesManager.getAnyEditorWidgetMeta(parent.id);
114613
115453
  const isParentGridLike = isWidgetGrid(parentComponentMeta);
@@ -114777,8 +115617,8 @@ function getComponentBaseProperties(componentType, parentInfo) {
114777
115617
  "https://lowcode.s3.us-west-2.amazonaws.com/eilish-billie.jpeg"
114778
115618
  );
114779
115619
  properties2.fillContainer = Property.Static(true);
114780
- properties2.width = Property.Dimension(Dim.px(300));
114781
- properties2.height = Property.Dimension(Dim.px(300));
115620
+ properties2.width = parentInfo.isGridLike ? Property.Dimension(Dim.col(4)) : Property.Dimension(Dim.px(300));
115621
+ properties2.height = Property.Dimension(Dim.fit());
114782
115622
  break;
114783
115623
  case "SbKeyValue":
114784
115624
  properties2.sourceData = Property.Static({
@@ -114853,9 +115693,26 @@ function getComponentBaseProperties(componentType, parentInfo) {
114853
115693
  case "SbSection":
114854
115694
  children = getSectionChildren();
114855
115695
  break;
115696
+ case "SbTable":
115697
+ properties2.tableData = Property.Static(DEFAULT_TABLE_DATA);
115698
+ properties2.columns = Property.Static(DEFAULT_TABLE_COLUMNS);
115699
+ properties2.header = Property.Static("Customers");
115700
+ properties2.searchPlaceholder = Property.Static("Search...");
115701
+ break;
114856
115702
  }
115703
+ const { width, height, ...restProperties } = properties2;
115704
+ const safeDimensions = parentInfo.isGridLike ? filterSafeGridDimensionProperties({
115705
+ width: width == null ? void 0 : width.value,
115706
+ height: height == null ? void 0 : height.value
115707
+ }) : filterSafeStackDimensionProperties({
115708
+ width: width == null ? void 0 : width.value,
115709
+ height: height == null ? void 0 : height.value
115710
+ });
114857
115711
  return {
114858
- properties: properties2,
115712
+ properties: {
115713
+ ...restProperties,
115714
+ ...safeDimensions
115715
+ },
114859
115716
  children,
114860
115717
  name: (_b2 = properties2.name) == null ? void 0 : _b2.value
114861
115718
  };
@@ -114896,6 +115753,7 @@ async function createComponent({
114896
115753
  componentType,
114897
115754
  parentInfo.type
114898
115755
  );
115756
+ const isGridLike = willWrapInSectionAndColumn && componentType !== "SbColumn" ? true : parentInfo.isGridLike;
114899
115757
  const tagName = componentType;
114900
115758
  const {
114901
115759
  properties: propertiesFromType,
@@ -114903,11 +115761,11 @@ async function createComponent({
114903
115761
  name
114904
115762
  } = getComponentBaseProperties(componentType, {
114905
115763
  // will wrap in a column with grid layout if dropping on a page or section directly
114906
- isGridLike: willWrapInSectionAndColumn && componentType !== "SbColumn" ? true : parentInfo.isGridLike
115764
+ isGridLike
114907
115765
  });
114908
115766
  const properties2 = {
114909
- ...baseProperties,
114910
- ...propertiesFromType
115767
+ ...propertiesFromType,
115768
+ ...baseProperties
114911
115769
  };
114912
115770
  console.log("creating component", { tagName, properties: properties2 });
114913
115771
  const parentElement = { source: parent };
@@ -115057,12 +115915,10 @@ const handleGridDropForNewComponent = ({
115057
115915
  baseProperties: {
115058
115916
  marginTop: Property.Dimension(Dim.row((activeRectGU == null ? void 0 : activeRectGU.yGU) ?? 0)),
115059
115917
  marginLeft: Property.Dimension(Dim.col((activeRectGU == null ? void 0 : activeRectGU.xGU) ?? 0)),
115060
- width: Property.Dimension(
115061
- (activeRectGU == null ? void 0 : activeRectGU.widthGU) ? Dim.col(activeRectGU == null ? void 0 : activeRectGU.widthGU) : Dim.col(4)
115062
- ),
115063
- height: Property.Dimension(
115064
- (activeRectGU == null ? void 0 : activeRectGU.heightGU) ? Dim.rows(activeRectGU == null ? void 0 : activeRectGU.heightGU) : Dim.fit()
115065
- )
115918
+ ...defaultSizeForComponent(componentType, true, {
115919
+ widthGU: activeRectGU == null ? void 0 : activeRectGU.widthGU,
115920
+ heightGU: activeRectGU == null ? void 0 : activeRectGU.heightGU
115921
+ })
115066
115922
  },
115067
115923
  scopeName
115068
115924
  });
@@ -115214,10 +116070,17 @@ const handleStackDropForNewComponent = ({
115214
116070
  throw new Error("Missing drop source id");
115215
116071
  }
115216
116072
  const scopeName = rootStore.entityManager.getScopeName(dropScopeId);
116073
+ const dragRect = editStore2.ui.dnd.activeDragRect;
115217
116074
  return createComponent({
115218
116075
  componentType,
115219
116076
  parent: { index: dropInfo.insertionIndex, id: dropSourceId },
115220
- scopeName
116077
+ scopeName,
116078
+ baseProperties: {
116079
+ ...defaultSizeForComponent(componentType, false, {
116080
+ widthPx: dragRect == null ? void 0 : dragRect.width,
116081
+ heightPx: dragRect == null ? void 0 : dragRect.height
116082
+ })
116083
+ }
115221
116084
  });
115222
116085
  };
115223
116086
  const handleStackDrop = async ({
@@ -115747,6 +116610,14 @@ const InteractionRectHandles = (props) => {
115747
116610
  const { instanceId, isDragging, selectionType } = props;
115748
116611
  const [showPopover, setShowPopover] = useState(null);
115749
116612
  const { canResizeWidth: canResizeWidth2, canResizeHeight: canResizeHeight2 } = useResizeCapabilities(instanceId);
116613
+ const timeoutRef = useRef(null);
116614
+ useEffect(() => {
116615
+ return () => {
116616
+ if (timeoutRef.current) {
116617
+ clearTimeout(timeoutRef.current);
116618
+ }
116619
+ };
116620
+ }, []);
115750
116621
  const throttledResizeWidget = useMemo$2(
115751
116622
  () => lodashExports.throttle((e3) => {
115752
116623
  var _a2;
@@ -115777,14 +116648,18 @@ const InteractionRectHandles = (props) => {
115777
116648
  var _a2;
115778
116649
  e3.stopPropagation();
115779
116650
  e3.preventDefault();
116651
+ if (timeoutRef.current) {
116652
+ clearTimeout(timeoutRef.current);
116653
+ timeoutRef.current = null;
116654
+ }
115780
116655
  if ((position2 === "left" || position2 === "right") && !canResizeWidth2) {
115781
116656
  setShowPopover(position2);
115782
- setTimeout(() => setShowPopover(null), 3e3);
116657
+ timeoutRef.current = setTimeout(() => setShowPopover(null), 3e3);
115783
116658
  return;
115784
116659
  }
115785
116660
  if ((position2 === "top" || position2 === "bottom") && !canResizeHeight2) {
115786
116661
  setShowPopover(position2);
115787
- setTimeout(() => setShowPopover(null), 3e3);
116662
+ timeoutRef.current = setTimeout(() => setShowPopover(null), 3e3);
115788
116663
  return;
115789
116664
  }
115790
116665
  setShowPopover(null);
@@ -115858,6 +116733,15 @@ const InteractionRectHandles = (props) => {
115858
116733
  popoverClassName: "bp5-unstyled-popover",
115859
116734
  isOpen: showPopover === pos2,
115860
116735
  placement: pos2,
116736
+ onInteraction: (nextOpenState, e3) => {
116737
+ if ((e3 == null ? void 0 : e3.type) === "mousedown" && nextOpenState === false && showPopover === pos2) {
116738
+ if (timeoutRef.current) {
116739
+ clearTimeout(timeoutRef.current);
116740
+ timeoutRef.current = null;
116741
+ }
116742
+ setShowPopover(null);
116743
+ }
116744
+ },
115861
116745
  modifiers: {
115862
116746
  flip: {
115863
116747
  enabled: true,
@@ -116494,6 +117378,7 @@ const EditWrapper = observer(function EditWrapper2(props) {
116494
117378
  Component: props.component,
116495
117379
  identifier: identifier2,
116496
117380
  widgetProps: props.widgetProps,
117381
+ showErrors: true,
116497
117382
  children
116498
117383
  }
116499
117384
  )
@@ -116773,7 +117658,6 @@ const registerSbComponent = (type5, config2, Component3) => {
116773
117658
  const identifier2 = useRef();
116774
117659
  const { name: passedName, scopeId } = getNormalizedIdInfo({
116775
117660
  bind: getBindingIdentifier(props.bind),
116776
- propsName: props.name,
116777
117661
  fallbackScopeId
116778
117662
  });
116779
117663
  if (!identifier2.current) {
@@ -117253,8 +118137,16 @@ const textStyleProp = ({
117253
118137
  propertiesPanel
117254
118138
  } = {}) => Prop.composite(baseProp).readAndWrite().propertiesPanel({
117255
118139
  ...basePropertiesPaneDisplay,
117256
- ...propertiesPanel
118140
+ ...propertiesPanel,
118141
+ isJSConvertible: false
117257
118142
  });
118143
+ const colorProp = (schema) => {
118144
+ return Prop.string().readAndWrite().propertiesPanel({
118145
+ ...schema,
118146
+ controlType: "COLOR_PICKER",
118147
+ isJSConvertible: true
118148
+ });
118149
+ };
117258
118150
  const labelTextStyle = () => textStyleProp({
117259
118151
  propertiesPanel: {
117260
118152
  label: "Label style",
@@ -117268,23 +118160,41 @@ const labelTextStyle = () => textStyleProp({
117268
118160
  default: Theme.colors.neutral900
117269
118161
  }
117270
118162
  }));
117271
- const perSideBorderDef = () => Prop.composite({
117272
- color: Prop.string().readAndWrite(),
117273
- width: Prop.dimension().readAndWrite(),
117274
- style: Prop.string().readAndWrite()
117275
- }).readAndWrite();
118163
+ const createPerSideBorder = (border2) => {
118164
+ return {
118165
+ left: {
118166
+ color: border2.borderColor.default,
118167
+ width: border2.borderWidth,
118168
+ style: border2.borderStyle
118169
+ },
118170
+ right: {
118171
+ color: border2.borderColor.default,
118172
+ width: border2.borderWidth,
118173
+ style: border2.borderStyle
118174
+ },
118175
+ top: {
118176
+ color: border2.borderColor.default,
118177
+ width: border2.borderWidth,
118178
+ style: border2.borderStyle
118179
+ },
118180
+ bottom: {
118181
+ color: border2.borderColor.default,
118182
+ width: border2.borderWidth,
118183
+ style: border2.borderStyle
118184
+ }
118185
+ };
118186
+ };
117276
118187
  const border = (propertiesPanelConfig = {}) => {
117277
- return Prop.composite({
117278
- top: perSideBorderDef(),
117279
- right: perSideBorderDef(),
117280
- bottom: perSideBorderDef(),
117281
- left: perSideBorderDef()
117282
- }).propertiesPanel({
118188
+ return Prop.any().readAndWrite().propertiesPanel({
117283
118189
  label: "Border",
117284
118190
  controlType: "BORDER_CONTROL",
117285
118191
  helpText: "Controls the border of the component",
118192
+ visibility: "SHOW_NAME",
118193
+ isRemovable: true,
118194
+ defaultOnAdd: () => createPerSideBorder(Theme.defaultBorder),
118195
+ isJSConvertible: false,
117286
118196
  ...propertiesPanelConfig
117287
- }).readAndWrite();
118197
+ });
117288
118198
  };
117289
118199
  const createBorderRadiusObject = (borderRadius2) => {
117290
118200
  return {
@@ -117295,18 +118205,17 @@ const createBorderRadiusObject = (borderRadius2) => {
117295
118205
  };
117296
118206
  };
117297
118207
  const borderRadius = (propertiesPanelConfig = {}) => {
117298
- return Prop.composite({
117299
- topLeft: Prop.dimension().readAndWrite(),
117300
- topRight: Prop.dimension().readAndWrite(),
117301
- bottomRight: Prop.dimension().readAndWrite(),
117302
- bottomLeft: Prop.dimension().readAndWrite()
117303
- }).default(function() {
117304
- const borderRadius2 = Theme.defaultBorder.borderRadius ?? Dim.px(0);
117305
- return createBorderRadiusObject(borderRadius2);
118208
+ return Prop.any().default(() => {
118209
+ const borderRadius2 = Theme.defaultBorder.borderRadius;
118210
+ return borderRadius2.value !== 0 ? createBorderRadiusObject(borderRadius2) : void 0;
117306
118211
  }).readAndWrite().propertiesPanel({
117307
118212
  label: "Border radius",
117308
118213
  controlType: "BORDER_RADIUS_CONTROL",
117309
118214
  helpText: "Controls the border radius of the component",
118215
+ visibility: "SHOW_NAME",
118216
+ isRemovable: true,
118217
+ defaultOnAdd: () => createBorderRadiusObject(Theme.defaultBorder.borderRadius),
118218
+ isJSConvertible: false,
117310
118219
  ...propertiesPanelConfig
117311
118220
  });
117312
118221
  };
@@ -117318,35 +118227,49 @@ const buildPerSideBorder = (border2) => {
117318
118227
  left: border2()
117319
118228
  };
117320
118229
  };
117321
- const PRIMARY_BUTTON_BORDER_OBJECT = buildPerSideBorder(() => ({
117322
- color: function() {
117323
- return this.backgroundColor;
117324
- },
117325
- width: Dim.px(1),
117326
- style: "solid"
117327
- }));
117328
- const SECONDARY_BUTTON_BORDER_OBJECT = buildPerSideBorder(() => ({
117329
- color: () => Theme.colors.primary500,
117330
- width: Dim.px(1),
117331
- style: "solid"
117332
- }));
118230
+ const PRIMARY_BUTTON_BORDER_OBJECT = function() {
118231
+ return buildPerSideBorder(() => ({
118232
+ color: this.backgroundColor,
118233
+ width: Dim.px(1),
118234
+ style: "solid"
118235
+ }));
118236
+ };
118237
+ const SECONDARY_BUTTON_BORDER_OBJECT = function() {
118238
+ return buildPerSideBorder(() => ({
118239
+ color: Theme.colors.primary500,
118240
+ width: Dim.px(1),
118241
+ style: "solid"
118242
+ }));
118243
+ };
117333
118244
  const getDefaultBorderObject = function() {
117334
118245
  switch (this.variant) {
117335
118246
  case "primary":
117336
- return PRIMARY_BUTTON_BORDER_OBJECT;
118247
+ return PRIMARY_BUTTON_BORDER_OBJECT.bind(this)();
117337
118248
  case "secondary":
117338
- return SECONDARY_BUTTON_BORDER_OBJECT;
118249
+ return SECONDARY_BUTTON_BORDER_OBJECT.bind(this)();
117339
118250
  default:
117340
- return noBorderOject(Theme);
118251
+ return onePixelTransparentBorderObject();
117341
118252
  }
117342
118253
  };
117343
- const PerSideBorderDef = function() {
117344
- return Prop.composite({
117345
- color: Prop.string().readAndWrite(),
117346
- width: Prop.dimension().readAndWrite(),
117347
- style: Prop.string().readAndWrite()
117348
- });
117349
- };
118254
+ function getDefaultBorderRadius() {
118255
+ return function() {
118256
+ let borderRadius2;
118257
+ switch (this.variant) {
118258
+ case "PRIMARY_BUTTON":
118259
+ borderRadius2 = Theme.buttons.primary.borderRadius;
118260
+ break;
118261
+ case "SECONDARY_BUTTON":
118262
+ borderRadius2 = Theme.buttons.secondary.borderRadius;
118263
+ break;
118264
+ case "TERTIARY_BUTTON":
118265
+ borderRadius2 = Theme.buttons.tertiary.borderRadius;
118266
+ break;
118267
+ default:
118268
+ borderRadius2 = Theme.buttons.primary.borderRadius;
118269
+ }
118270
+ return createBorderRadiusObject(borderRadius2);
118271
+ };
118272
+ }
117350
118273
  const textStyle$3 = textStyleProp().default(function() {
117351
118274
  return {
117352
118275
  variant: "buttonLabel",
@@ -117402,47 +118325,24 @@ const propertiesDefinition$h = {
117402
118325
  }
117403
118326
  }),
117404
118327
  textStyle: textStyle$3,
117405
- backgroundColor: Prop.string().readAndWrite().default(function() {
117406
- const defaultThemeBackground = getButtonThemeDefaultBackgroundColor(
117407
- Theme,
117408
- this.variant
117409
- );
117410
- return defaultThemeBackground === "transparent" ? void 0 : defaultThemeBackground;
117411
- }).propertiesPanel({
118328
+ backgroundColor: colorProp({
117412
118329
  label: "Background color",
117413
- controlType: "COLOR_PICKER",
117414
118330
  visibility: "SHOW_NAME",
117415
118331
  isRemovable: true,
117416
118332
  defaultOnAdd: function() {
117417
118333
  return getButtonThemeDefaultBackgroundColor(Theme, this.variant);
117418
118334
  }
118335
+ }).default(function() {
118336
+ const defaultThemeBackground = getButtonThemeDefaultBackgroundColor(
118337
+ Theme,
118338
+ this.variant
118339
+ );
118340
+ return defaultThemeBackground === "transparent" ? void 0 : defaultThemeBackground;
117419
118341
  }),
117420
- border: Prop.composite(buildPerSideBorder(() => PerSideBorderDef())).default(getDefaultBorderObject).propertiesPanel({
117421
- label: "Border",
117422
- controlType: "BORDER_CONTROL",
117423
- helpText: "Controls the border of the component",
117424
- isRemovable: true,
117425
- defaultOnAdd: SECONDARY_BUTTON_BORDER_OBJECT,
117426
- visibility: "SHOW_NAME"
117427
- }).readAndWrite(),
117428
- borderRadius: borderRadius().default(function() {
117429
- let borderRadius2;
117430
- switch (this.variant) {
117431
- case "PRIMARY_BUTTON":
117432
- borderRadius2 = Theme.buttons.primary.borderRadius;
117433
- break;
117434
- case "SECONDARY_BUTTON":
117435
- borderRadius2 = Theme.buttons.secondary.borderRadius;
117436
- break;
117437
- case "TERTIARY_BUTTON":
117438
- borderRadius2 = Theme.buttons.tertiary.borderRadius;
117439
- break;
117440
- default:
117441
- borderRadius2 = Theme.buttons.primary.borderRadius;
117442
- }
117443
- return createBorderRadiusObject(borderRadius2);
117444
- }),
117445
- // Horizontal label alignment
118342
+ border: border({
118343
+ defaultOnAdd: SECONDARY_BUTTON_BORDER_OBJECT
118344
+ }).default(getDefaultBorderObject),
118345
+ borderRadius: borderRadius().default(getDefaultBorderRadius),
117446
118346
  labelAlignment: Prop.string().readAndWrite().default("center").propertiesPanel({
117447
118347
  label: "Label alignment",
117448
118348
  controlType: "RADIO_BUTTON_GROUP",
@@ -117639,9 +118539,8 @@ const commonLayoutProps = {
117639
118539
  ...visible()
117640
118540
  };
117641
118541
  Section.category(PropsPanelCategory.Appearance).children({
117642
- backgroundColor: Prop.string().readAndWrite().propertiesPanel({
118542
+ backgroundColor: colorProp({
117643
118543
  label: "Background",
117644
- controlType: "COLOR_PICKER",
117645
118544
  helpText: "Changes the color of the background"
117646
118545
  }),
117647
118546
  border: border(),
@@ -117785,11 +118684,11 @@ const getStackChildStyle = ({
117785
118684
  parentWidth
117786
118685
  }) => {
117787
118686
  const height = (childProps == null ? void 0 : childProps.height) ?? Dim.fit();
117788
- const heightCss = childCount === 1 && (height == null ? void 0 : height.mode) === "fill" && (parentHeight == null ? void 0 : parentHeight.mode) !== "fit" ? (
118687
+ const heightCss = (
117789
118688
  // using 100% height when there is only one child and user's intention to set the child height as exact 100%, e.g. an image with large original height
117790
118689
  // if parent height is fit-content, child height 100% will cause unexpected height if child is empty container
117791
- { height: "100%" }
117792
- ) : dimToCSS(height, "height", primary === "height");
118690
+ childCount === 1 && (height == null ? void 0 : height.mode) === "fill" && (parentHeight == null ? void 0 : parentHeight.mode) !== "fit" ? { height: "100%" } : dimToCSS(height, "height", primary === "height")
118691
+ );
117793
118692
  const width = (childProps == null ? void 0 : childProps.width) ?? Dim.fit();
117794
118693
  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");
117795
118694
  const minWidthCss = getMinMaxCss(
@@ -117983,11 +118882,13 @@ const propertiesDefinition$g = {
117983
118882
  }).default(false)
117984
118883
  }).add(visible()),
117985
118884
  appearance: Section.category(PropsPanelCategory.Appearance).children({
117986
- backgroundColor: Prop.string().readAndWrite().propertiesPanel({
118885
+ backgroundColor: colorProp({
117987
118886
  label: "Background",
117988
- controlType: "COLOR_PICKER",
117989
- helpText: "Changes the color of the background"
117990
- }),
118887
+ helpText: "Changes the color of the background",
118888
+ visibility: "SHOW_NAME",
118889
+ isRemovable: true,
118890
+ defaultOnAdd: () => Theme.colors.appBackground ?? "#ffffff"
118891
+ }).default(void 0).validate(VALIDATORS.TEXT_ALLOW_UNDEFINED),
117991
118892
  border: border()
117992
118893
  })
117993
118894
  };
@@ -118197,13 +119098,11 @@ const useHeightObserver = () => {
118197
119098
  label: "Columns",
118198
119099
  placeholder: "Enter columns"
118199
119100
  }),
118200
- rows: Prop.number().readAndWrite().propertiesPanel({
118201
- label: "Rows",
118202
- placeholder: "Enter rows"
118203
- }),
118204
- rowSize: Prop.number().readAndWrite().propertiesPanel({
118205
- label: "Row size",
118206
- placeholder: "Enter row size"
119101
+ rowHeight: Prop.dimension().readAndWrite().propertiesPanel({
119102
+ label: "Row height",
119103
+ placeholder: "Enter row height",
119104
+ controlType: "DIMENSION_VALUE_CONTROL",
119105
+ dimensionUnit: "px"
118207
119106
  }),
118208
119107
  ...spacing({ themeValue: Dim.px(0) })
118209
119108
  }),
@@ -118222,10 +119121,10 @@ const InternalGrid = ({
118222
119121
  children = EMPTY_ARRAY$1,
118223
119122
  ...props
118224
119123
  }) => {
118225
- var _a2;
119124
+ var _a2, _b2;
118226
119125
  const isEditing = Boolean((_a2 = rootStore.editStore) == null ? void 0 : _a2.isInitialized);
118227
119126
  const { style: style2, ...passThroughProps } = usePassthroughProps(props);
118228
- const rowHeight = props.rowSize ?? 12;
119127
+ const rowHeight = ((_b2 = props.rowHeight) == null ? void 0 : _b2.value) ?? 12;
118229
119128
  const childrenArray = useMemo$2(() => {
118230
119129
  let childrenArray2 = Array.isArray(children) ? children : [children];
118231
119130
  if (!isEditing) {
@@ -118247,9 +119146,9 @@ const InternalGrid = ({
118247
119146
  );
118248
119147
  const positions = childrenArray.reduce(
118249
119148
  (acc, child) => {
118250
- var _a3, _b2, _c2;
119149
+ var _a3, _b3, _c2;
118251
119150
  let width = ((_a3 = child.props.width) == null ? void 0 : _a3.value) ?? 1;
118252
- if (((_b2 = child.props.width) == null ? void 0 : _b2.mode) === "fill") {
119151
+ if (((_b3 = child.props.width) == null ? void 0 : _b3.mode) === "fill") {
118253
119152
  width = columns;
118254
119153
  }
118255
119154
  acc[getChildName(child)] = {
@@ -118277,8 +119176,8 @@ const InternalGrid = ({
118277
119176
  };
118278
119177
  }, [columns, props.spacing, rowHeight, style2]);
118279
119178
  return /* @__PURE__ */ jsxRuntimeExports.jsx(DragDisplay, { passThroughProps, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: gridStyle, className: props.className, children: childrenArray.map((child) => {
118280
- var _a3;
118281
- const heightMode = child.props.height ?? "fit";
119179
+ var _a3, _b3;
119180
+ const heightMode = ((_a3 = child.props.height) == null ? void 0 : _a3.mode) ?? "fit";
118282
119181
  const top2 = gridPositions[getChildName(child)].top;
118283
119182
  const left2 = gridPositions[getChildName(child)].left;
118284
119183
  const rows = gridPositions[getChildName(child)].height;
@@ -118296,7 +119195,7 @@ const InternalGrid = ({
118296
119195
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(
118297
119196
  Component3,
118298
119197
  {
118299
- staticHeight: (((_a3 = child.props.height) == null ? void 0 : _a3.value) ?? 0) * rowHeight,
119198
+ staticHeight: (((_b3 = child.props.height) == null ? void 0 : _b3.value) ?? 0) * rowHeight,
118300
119199
  onHeightChanged: (height) => {
118301
119200
  dispatchHeight({
118302
119201
  type: "SET_HEIGHT",
@@ -118353,60 +119252,30 @@ const StaticComponent = ({
118353
119252
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { ...style2, width: "100%", height: "100%" }, children });
118354
119253
  };
118355
119254
  const propertiesDefinition$f = {
118356
- layout: Section.category(PropsPanelCategory.Layout).add(containerLayout()).add(spacing()).add({
118357
- padding: Prop.any().default(function() {
118358
- return this.variant === "card" ? BASE_THEME_NEW_APPS.padding : {
118359
- top: Dim.px(0),
118360
- bottom: Dim.px(0),
118361
- left: Dim.px(0),
118362
- right: Dim.px(0)
118363
- };
118364
- }).readAndWrite().propertiesPanel({
118365
- label: "Padding",
118366
- helpText: "The padding for the component",
118367
- controlType: "PADDING_CONTROL",
118368
- // TODO: replace the default once we have a way to get the padding from current theme
118369
- themeValue: BASE_THEME_NEW_APPS.padding
118370
- })
118371
- }).add({
118372
- width: Prop.dimension().readAndWrite().propertiesPanel({
118373
- label: "Width",
118374
- controlType: "WIDTH_DROPDOWN"
118375
- }),
118376
- height: Prop.dimension().readAndWrite().propertiesPanel({
118377
- label: "Height",
118378
- controlType: "HEIGHT_DROPDOWN"
118379
- }),
118380
- // the default min/max width/height should be undefined, but currently if no default is set, the add button is not working
118381
- minWidth: Prop.dimension().readAndWrite().propertiesPanel({
118382
- label: "Min width",
118383
- controlType: "WIDTH_DROPDOWN",
118384
- isRemovable: true,
118385
- visibility: "SHOW_NAME",
118386
- defaultOnAdd: Dim.px(0)
118387
- }),
118388
- maxWidth: Prop.dimension().readAndWrite().propertiesPanel({
118389
- label: "Max width",
118390
- controlType: "WIDTH_DROPDOWN",
118391
- isRemovable: true,
118392
- visibility: "SHOW_NAME",
118393
- defaultOnAdd: Dim.px(200)
118394
- }),
118395
- minHeight: Prop.dimension().readAndWrite().propertiesPanel({
118396
- label: "Min height",
118397
- controlType: "HEIGHT_DROPDOWN",
118398
- isRemovable: true,
118399
- visibility: "SHOW_NAME",
118400
- defaultOnAdd: Dim.px(0)
118401
- }),
118402
- maxHeight: Prop.dimension().readAndWrite().propertiesPanel({
118403
- label: "Max height",
118404
- controlType: "HEIGHT_DROPDOWN",
118405
- isRemovable: true,
118406
- visibility: "SHOW_NAME",
118407
- defaultOnAdd: Dim.px(120)
119255
+ layout: Section.category(PropsPanelCategory.Layout).add(
119256
+ containerLayout({
119257
+ ...spacing(),
119258
+ ...padding({
119259
+ default: function() {
119260
+ return this.variant === "card" ? BASE_THEME_NEW_APPS.padding : {
119261
+ top: Dim.px(0),
119262
+ bottom: Dim.px(0),
119263
+ left: Dim.px(0),
119264
+ right: Dim.px(0)
119265
+ };
119266
+ }
119267
+ }),
119268
+ ...margin(),
119269
+ ...size$2({
119270
+ defaultsOnAdd: {
119271
+ minWidth: Dim.px(0),
119272
+ minHeight: Dim.px(0),
119273
+ maxWidth: Dim.px(200),
119274
+ maxHeight: Dim.px(120)
119275
+ }
119276
+ })
118408
119277
  })
118409
- }).add(margin()).add(shouldScrollContents(true)).add(visible()),
119278
+ ).add(shouldScrollContents(true)).add(visible()),
118410
119279
  appearance: Section.category(PropsPanelCategory.Appearance).children({
118411
119280
  variant: Prop.string().readAndWrite().default("none").propertiesPanel({
118412
119281
  label: "Variant",
@@ -118424,18 +119293,13 @@ const propertiesDefinition$f = {
118424
119293
  helpText: "Changes the color of the background",
118425
119294
  visibility: "SHOW_NAME",
118426
119295
  isRemovable: true,
118427
- defaultOnAdd: function() {
118428
- return Theme.colors.appBackground ?? "#ffffff";
118429
- }
119296
+ defaultOnAdd: () => Theme.colors.appBackground ?? "#ffffff"
118430
119297
  }),
118431
- border: border(),
118432
- borderRadius: borderRadius({
118433
- isRemovable: true,
118434
- visibility: "SHOW_NAME",
118435
- defaultOnAdd: createBorderRadiusObject(Dim.px(0))
118436
- }).default(function() {
118437
- const borderRadius2 = this.variant === "card" ? Theme.defaultBorder.borderRadius : Dim.px(0);
118438
- return createBorderRadiusObject(borderRadius2);
119298
+ border: border().default(function() {
119299
+ return this.variant === "card" ? createPerSideBorder(Theme.defaultBorder) : void 0;
119300
+ }),
119301
+ borderRadius: borderRadius().default(function() {
119302
+ return this.variant === "card" ? createBorderRadiusObject(Theme.defaultBorder.borderRadius) : void 0;
118439
119303
  })
118440
119304
  })
118441
119305
  };
@@ -118512,12 +119376,11 @@ const InternalContainer = (props) => {
118512
119376
  InternalGrid,
118513
119377
  {
118514
119378
  margin: void 0,
118515
- spacing: props.spacing ?? Dim.px(0),
119379
+ spacing: Dim.px(0),
118516
119380
  isVisible: props.isVisible ?? true,
118517
119381
  "data-container-layer": "container-inner-grid",
118518
119382
  columns: props.columns,
118519
- rows: props.rows,
118520
- rowSize: props.rowSize,
119383
+ rowHeight: props.rowHeight,
118521
119384
  children: props.children
118522
119385
  }
118523
119386
  ) : props.layout === "horizontal" ? /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -118551,22 +119414,28 @@ const SbContainer = registerSbComponent(
118551
119414
  InternalContainer
118552
119415
  );
118553
119416
  const propertiesDefinition$e = {
118554
- layout: Section.category(PropsPanelCategory.Layout).add(containerLayout()).add(spacing()).add(padding()).add(
118555
- size$2({
118556
- defaults: {
118557
- width: Dim.fill(),
118558
- height: Dim.fill()
118559
- },
118560
- hasMinHeight: false,
118561
- hasMaxHeight: false,
118562
- showHeight: () => false
119417
+ layout: Section.category(PropsPanelCategory.Layout).add(
119418
+ containerLayout({
119419
+ ...spacing(),
119420
+ ...padding(),
119421
+ ...size$2({
119422
+ defaults: {
119423
+ width: Dim.fill(),
119424
+ height: Dim.fill()
119425
+ },
119426
+ hasMinHeight: false,
119427
+ hasMaxHeight: false,
119428
+ showHeight: () => false
119429
+ })
118563
119430
  })
118564
119431
  ).add(shouldScrollContents(true)).add(visible()),
118565
119432
  appearance: Section.category(PropsPanelCategory.Appearance).children({
118566
- backgroundColor: Prop.string().readAndWrite().propertiesPanel({
119433
+ backgroundColor: colorProp({
118567
119434
  label: "Background",
118568
- controlType: "COLOR_PICKER",
118569
- helpText: "Changes the color of the background"
119435
+ helpText: "Changes the color of the background",
119436
+ visibility: "SHOW_NAME",
119437
+ isRemovable: true,
119438
+ defaultOnAdd: () => Theme.colors.appBackground ?? "#ffffff"
118570
119439
  }),
118571
119440
  border: border()
118572
119441
  })
@@ -118596,7 +119465,6 @@ const SbColumn = registerSbComponent(
118596
119465
  verticalAlign: props.verticalAlign,
118597
119466
  horizontalAlign: props.horizontalAlign,
118598
119467
  columns: props.columns,
118599
- rows: props.rows,
118600
119468
  padding: props.padding,
118601
119469
  variant: "none",
118602
119470
  backgroundColor: props.backgroundColor,
@@ -125707,6 +126575,9 @@ const labelWidth = Prop.any().readAndWrite().default(Dim.percent(30)).properties
125707
126575
  label: "Label width",
125708
126576
  controlType: "SIMPLE_SIZE_CONTROL",
125709
126577
  helpText: "Control the width of the label subcomponent in the input",
126578
+ isVisible: function() {
126579
+ return !!this.label && this.labelPosition === "left";
126580
+ },
125710
126581
  options: [
125711
126582
  {
125712
126583
  label: "Fluid",
@@ -125733,7 +126604,8 @@ const customValidationProperties = {
125733
126604
  helpText: "Sets a custom validation rule",
125734
126605
  controlType: "INPUT_TEXT",
125735
126606
  placeholder: "{{/./.test(Input1.value)}}",
125736
- isRemovable: true
126607
+ isRemovable: true,
126608
+ visibility: "SHOW_NAME"
125737
126609
  }),
125738
126610
  customErrorMessage: Prop.string().readAndWrite().default("").propertiesPanel({
125739
126611
  label: "Error",
@@ -125741,15 +126613,18 @@ const customValidationProperties = {
125741
126613
  controlType: "INPUT_TEXT",
125742
126614
  placeholder: "Enter error message",
125743
126615
  isRemovable: true,
126616
+ visibility: "SHOW_NAME",
125744
126617
  isVisible: function() {
125745
126618
  return this.customValidationRule !== void 0;
125746
126619
  }
125747
126620
  })
125748
126621
  };
125749
- const labelPosition = Prop.string().readAndWrite().default("top").propertiesPanel({
126622
+ const labelPosition = () => Prop.string().readAndWrite().default("top").propertiesPanel({
125750
126623
  label: "Label position",
125751
126624
  controlType: "RADIO_BUTTON_GROUP",
125752
- isVisible: (props) => !!props.label,
126625
+ isVisible: function() {
126626
+ return !!this.label;
126627
+ },
125753
126628
  options: [
125754
126629
  {
125755
126630
  label: "Above",
@@ -125963,7 +126838,7 @@ const propertiesDefinition$d = {
125963
126838
  })
125964
126839
  }),
125965
126840
  appearance: Section.category(PropsPanelCategory.Appearance).add({
125966
- labelPosition,
126841
+ labelPosition: labelPosition(),
125967
126842
  labelStyle: labelTextStyle(),
125968
126843
  placeholderText: Prop.string().readAndWrite().default("Enter text").propertiesPanel({
125969
126844
  helpText: "Sets a placeholder text for the input",
@@ -125972,11 +126847,10 @@ const propertiesDefinition$d = {
125972
126847
  placeholder: "Input text"
125973
126848
  }),
125974
126849
  textStyle: textStyle$2,
125975
- backgroundColor: Prop.string().readAndWrite().default("{{ theme.colors.neutral }}").propertiesPanel({
126850
+ backgroundColor: colorProp({
125976
126851
  label: "Background",
125977
- controlType: "COLOR_PICKER",
125978
126852
  helpText: "Changes the color of the background"
125979
- }),
126853
+ }).default(() => Theme.colors.neutral),
125980
126854
  border: border().default(void 0),
125981
126855
  borderRadius: borderRadius(),
125982
126856
  icon: Prop.string().readAndWrite().propertiesPanel({
@@ -126010,23 +126884,7 @@ const propertiesDefinition$d = {
126010
126884
  controlType: "SWITCH"
126011
126885
  })
126012
126886
  }),
126013
- layout: Section.category(PropsPanelCategory.Layout).add(padding({ themeValue: INPUT_PADDING, default: INPUT_PADDING })).add(size$2()).add(margin()).add(
126014
- // TODO: Should be before visibility props, but there's no way to do that with the layout helper
126015
- Prop.union({
126016
- shared: {
126017
- labelPosition: Prop.string()
126018
- },
126019
- variants: [
126020
- {
126021
- labelPosition: Prop.literal("left"),
126022
- labelWidth
126023
- },
126024
- {
126025
- labelPosition: Prop.literal("top")
126026
- }
126027
- ]
126028
- })
126029
- ).add(visible()),
126887
+ layout: Section.category(PropsPanelCategory.Layout).add(padding({ themeValue: INPUT_PADDING, default: INPUT_PADDING })).add(size$2()).add(margin()).add({ labelWidth }).add(visible()),
126030
126888
  interaction: Section.category(PropsPanelCategory.Interaction).add(
126031
126889
  Prop.union({
126032
126890
  shared: {
@@ -133210,6 +134068,7 @@ const useStyle = (props) => {
133210
134068
  return {
133211
134069
  overflow: props.shouldScroll ? "auto" : "hidden",
133212
134070
  textAlign: (_a2 = props.textAlign) == null ? void 0 : _a2.toLowerCase(),
134071
+ alignItems: getVerticalAlignment(props.verticalAlign),
133213
134072
  color: (_c2 = (_b2 = props.textStyle) == null ? void 0 : _b2.textColor) == null ? void 0 : _c2.default,
133214
134073
  ...props.style
133215
134074
  };
@@ -133231,6 +134090,17 @@ const getTextAlignClass = (textAlign) => {
133231
134090
  };
133232
134091
  }
133233
134092
  };
134093
+ const getVerticalAlignment = (verticalAlign) => {
134094
+ switch (verticalAlign) {
134095
+ case "top":
134096
+ return "flex-start";
134097
+ case "bottom":
134098
+ return "flex-end";
134099
+ case "center":
134100
+ default:
134101
+ return "center";
134102
+ }
134103
+ };
133234
134104
  const useIconContainerStyles = ({
133235
134105
  iconGap,
133236
134106
  textAlign
@@ -133412,8 +134282,7 @@ const ModalComponent = (props) => {
133412
134282
  padding: props.styleProps.padding ?? ZERO_PADDING,
133413
134283
  spacing: props.spacing ?? Dim.px(0),
133414
134284
  columns: props.columns ?? 48,
133415
- rows: props.rows,
133416
- rowSize: props.rowSize,
134285
+ rowHeight: props.rowHeight,
133417
134286
  shouldScrollContents: true,
133418
134287
  variant: "none",
133419
134288
  children: props.children
@@ -133428,8 +134297,7 @@ const ModalComponent = (props) => {
133428
134297
  props.styleProps.padding,
133429
134298
  props.spacing,
133430
134299
  props.columns,
133431
- props.rows,
133432
- props.rowSize,
134300
+ props.rowHeight,
133433
134301
  props.children
133434
134302
  ]
133435
134303
  );
@@ -133507,12 +134375,16 @@ const ModalComponent = (props) => {
133507
134375
  ] });
133508
134376
  };
133509
134377
  const propertiesDefinition$a = {
133510
- layout: Section.category(PropsPanelCategory.Layout).add(containerLayout()).add(spacing()).add(padding()),
134378
+ layout: Section.category(PropsPanelCategory.Layout).add(
134379
+ containerLayout({
134380
+ ...spacing(),
134381
+ ...padding()
134382
+ })
134383
+ ),
133511
134384
  appearance: Section.category(PropsPanelCategory.Appearance).children({
133512
- backgroundColor: Prop.string().readAndWrite().propertiesPanel({
134385
+ backgroundColor: colorProp({
133513
134386
  label: "Background color",
133514
- helpText: "The background color of the component",
133515
- controlType: "COLOR_PICKER"
134387
+ helpText: "The background color of the component"
133516
134388
  }),
133517
134389
  border: Prop.any().readAndWrite().propertiesPanel({
133518
134390
  label: "Border",
@@ -133697,20 +134569,13 @@ const SbModal = registerSbComponent(
133697
134569
  verticalAlign: props.verticalAlign,
133698
134570
  spacing: props.spacing ?? Dim.px(0),
133699
134571
  columns: props.columns,
133700
- rows: props.rows,
133701
- rowSize: props.rowSize,
134572
+ rowHeight: props.rowHeight,
133702
134573
  dropTargetRef,
133703
134574
  children: props.children
133704
134575
  }
133705
134576
  );
133706
134577
  }
133707
134578
  );
133708
- var PaginationTypes = /* @__PURE__ */ ((PaginationTypes2) => {
133709
- PaginationTypes2["NONE"] = "NONE";
133710
- PaginationTypes2["CLIENT_SIDE"] = "CLIENT_SIDE";
133711
- PaginationTypes2["SERVER_SIDE"] = "SERVER_SIDE";
133712
- return PaginationTypes2;
133713
- })(PaginationTypes || {});
133714
134579
  const CompactMode = {
133715
134580
  SHORT: "SHORT",
133716
134581
  DEFAULT: "DEFAULT",
@@ -133746,13 +134611,6 @@ var EditInputType = /* @__PURE__ */ ((EditInputType2) => {
133746
134611
  EditInputType2["Date"] = "DATE";
133747
134612
  return EditInputType2;
133748
134613
  })(EditInputType || {});
133749
- var BooleanStyleFalse = /* @__PURE__ */ ((BooleanStyleFalse2) => {
133750
- BooleanStyleFalse2["EMPTY"] = "EMPTY";
133751
- BooleanStyleFalse2["CLOSE"] = "CLOSE";
133752
- BooleanStyleFalse2["MINUS"] = "MINUS";
133753
- BooleanStyleFalse2["EMPTY_CHECKBOX"] = "EMPTY_CHECKBOX";
133754
- return BooleanStyleFalse2;
133755
- })(BooleanStyleFalse || {});
133756
134614
  var ImageSize = /* @__PURE__ */ ((ImageSize2) => {
133757
134615
  ImageSize2["Fixed"] = "FIXED";
133758
134616
  ImageSize2["Fit"] = "FIT";
@@ -133785,6 +134643,142 @@ const ColumnType = {
133785
134643
  EMAIL: "email",
133786
134644
  LINK: "link"
133787
134645
  };
134646
+ const JUSTIFY_CONTENT = {
134647
+ LEFT: "flex-start",
134648
+ CENTER: "center",
134649
+ RIGHT: "flex-end"
134650
+ };
134651
+ const ALIGN_ITEMS = {
134652
+ TOP: "flex-start",
134653
+ CENTER: "center",
134654
+ BOTTOM: "flex-end"
134655
+ };
134656
+ const TEXT_ALIGN = {
134657
+ LEFT: "left",
134658
+ CENTER: "center",
134659
+ RIGHT: "right"
134660
+ };
134661
+ const TEXT_SIZES = {
134662
+ HEADING1: "24px",
134663
+ HEADING2: "18px",
134664
+ HEADING3: "16px",
134665
+ PARAGRAPH: "14px",
134666
+ PARAGRAPH2: "12px"
134667
+ };
134668
+ var FontStyleTypes = /* @__PURE__ */ ((FontStyleTypes2) => {
134669
+ FontStyleTypes2["BOLD"] = "BOLD";
134670
+ FontStyleTypes2["ITALIC"] = "ITALIC";
134671
+ FontStyleTypes2["REGULAR"] = "REGULAR";
134672
+ FontStyleTypes2["UNDERLINE"] = "UNDERLINE";
134673
+ return FontStyleTypes2;
134674
+ })(FontStyleTypes || {});
134675
+ const TABLE_SIZES = {
134676
+ [CompactMode.VERY_SHORT]: {
134677
+ COLUMN_HEADER_HEIGHT: 48,
134678
+ TABLE_HEADER_HEIGHT: 60,
134679
+ TABLE_FOOTER_HEIGHT: 48,
134680
+ ROW_HEIGHT: 28,
134681
+ ROW_FONT_SIZE: 14,
134682
+ PAGINATION_CONTROLS_HEIGHT: 24,
134683
+ IMAGE_SIZE: 22,
134684
+ LINK_MENU_HEIGHT: 28,
134685
+ LINK_MENU_ICON_SIZE: IconSize$1.LARGE,
134686
+ ROW_PADDING: 0
134687
+ },
134688
+ [CompactMode.SHORT]: {
134689
+ COLUMN_HEADER_HEIGHT: 48,
134690
+ TABLE_HEADER_HEIGHT: 60,
134691
+ TABLE_FOOTER_HEIGHT: 48,
134692
+ ROW_HEIGHT: 36,
134693
+ ROW_FONT_SIZE: 14,
134694
+ PAGINATION_CONTROLS_HEIGHT: 24,
134695
+ IMAGE_SIZE: 28,
134696
+ LINK_MENU_HEIGHT: 32,
134697
+ LINK_MENU_ICON_SIZE: IconSize$1.LARGE,
134698
+ ROW_PADDING: 2
134699
+ },
134700
+ [CompactMode.DEFAULT]: {
134701
+ COLUMN_HEADER_HEIGHT: 48,
134702
+ TABLE_HEADER_HEIGHT: 60,
134703
+ TABLE_FOOTER_HEIGHT: 48,
134704
+ ROW_HEIGHT: 48,
134705
+ ROW_FONT_SIZE: 14,
134706
+ PAGINATION_CONTROLS_HEIGHT: 32,
134707
+ IMAGE_SIZE: 32,
134708
+ LINK_MENU_HEIGHT: 36,
134709
+ LINK_MENU_ICON_SIZE: IconSize$1.XL,
134710
+ ROW_PADDING: 5
134711
+ },
134712
+ [CompactMode.TALL]: {
134713
+ COLUMN_HEADER_HEIGHT: 36,
134714
+ TABLE_HEADER_HEIGHT: 60,
134715
+ TABLE_FOOTER_HEIGHT: 60,
134716
+ ROW_HEIGHT: 58,
134717
+ ROW_FONT_SIZE: 14,
134718
+ PAGINATION_CONTROLS_HEIGHT: 36,
134719
+ IMAGE_SIZE: 36,
134720
+ LINK_MENU_HEIGHT: 36,
134721
+ LINK_MENU_ICON_SIZE: IconSize$1.XL,
134722
+ ROW_PADDING: 10
134723
+ }
134724
+ };
134725
+ const DEFAULT_TABLE_COLUMN_WIDTH = 150;
134726
+ const TABLE_COLUMN_MIN_WIDTH = 20;
134727
+ const PARSED_INPUT_TYPES = [
134728
+ EditInputType.Number,
134729
+ EditInputType.Checkbox
134730
+ ];
134731
+ const TextBoxEditTypes = [
134732
+ EditInputType.Text,
134733
+ EditInputType.Number,
134734
+ EditInputType.Email
134735
+ ];
134736
+ const DEFAULT_CELL_TEXT_STYLE_VARIANT = "body2";
134737
+ const DEFAULT_CELL_CLASS_NAME = getTextCssClassFromVariant(
134738
+ DEFAULT_CELL_TEXT_STYLE_VARIANT
134739
+ );
134740
+ const DEFAULT_HEADING_TEXT_STYLE_VARIANT = "heading3";
134741
+ const TABLE_COLUMN_HEADER_DEFAULT_TYPOGRAPHY = "heading6";
134742
+ var Condition0Type = /* @__PURE__ */ ((Condition0Type2) => {
134743
+ Condition0Type2["all"] = "all";
134744
+ Condition0Type2["isEmpty"] = "isEmpty";
134745
+ Condition0Type2["isNotEmpty"] = "isNotEmpty";
134746
+ Condition0Type2["isTrue"] = "isTrue";
134747
+ Condition0Type2["isFalse"] = "isFalse";
134748
+ return Condition0Type2;
134749
+ })(Condition0Type || {});
134750
+ var Condition1Type = /* @__PURE__ */ ((Condition1Type2) => {
134751
+ Condition1Type2["textIs"] = "textIs";
134752
+ Condition1Type2["textContains"] = "textContains";
134753
+ Condition1Type2["textDoesNotContain"] = "textDoesNotContain";
134754
+ Condition1Type2["textStartsWith"] = "textStartsWith";
134755
+ Condition1Type2["textEndsWith"] = "textEndsWith";
134756
+ Condition1Type2["isEqualTo"] = "isEqualTo";
134757
+ Condition1Type2["isNotEqualTo"] = "isNotEqualTo";
134758
+ Condition1Type2["isLessThan"] = "isLessThan";
134759
+ Condition1Type2["isLessThanOrEqualTo"] = "isLessThanOrEqualTo";
134760
+ Condition1Type2["isGreaterThan"] = "isGreaterThan";
134761
+ Condition1Type2["isGreaterThanOrEqualTo"] = "isGreaterThanOrEqualTo";
134762
+ Condition1Type2["dateIs"] = "dateIs";
134763
+ Condition1Type2["dateIsBefore"] = "dateIsBefore";
134764
+ Condition1Type2["dateIsAfter"] = "dateIsAfter";
134765
+ return Condition1Type2;
134766
+ })(Condition1Type || {});
134767
+ var Condition2Type = /* @__PURE__ */ ((Condition2Type2) => {
134768
+ Condition2Type2["isBetween"] = "isBetween";
134769
+ Condition2Type2["dateIsBetween"] = "dateIsBetween";
134770
+ return Condition2Type2;
134771
+ })(Condition2Type || {});
134772
+ const TABLE_MULTISELECT_COLID$1 = "SB_$$_MULTISELECT";
134773
+ const tagColorPalette = [
134774
+ "#27BBFF33",
134775
+ "#FF9F3533",
134776
+ "#14CDB733",
134777
+ "#7C4FF833",
134778
+ "#FF62A433",
134779
+ "#9D585833",
134780
+ "#FF484833"
134781
+ ];
133788
134782
  const CurrencyList = CC.getCodes();
133789
134783
  const tableColumnTypes = [
133790
134784
  {
@@ -133841,7 +134835,7 @@ const cellIconProps = {
133841
134835
  label: "Cell icon",
133842
134836
  controlType: "ICON_SELECTOR"
133843
134837
  }),
133844
- cellIconPosition: Prop.string().readAndWrite().propertiesPanel({
134838
+ cellIconPosition: Prop.string().readAndWrite().default("left").propertiesPanel({
133845
134839
  label: "Cell icon position",
133846
134840
  controlType: "RADIO_BUTTON_GROUP",
133847
134841
  options: [
@@ -133859,7 +134853,7 @@ const cellIconProps = {
133859
134853
  })
133860
134854
  };
133861
134855
  const textStyleProps = {
133862
- horizontalAlign: Prop.string().readAndWrite().propertiesPanel({
134856
+ horizontalAlign: Prop.string().readAndWrite().default("left").propertiesPanel({
133863
134857
  label: "Horizontal alignment",
133864
134858
  controlType: "RADIO_BUTTON_GROUP",
133865
134859
  options: [
@@ -133868,7 +134862,7 @@ const textStyleProps = {
133868
134862
  { value: "right", icon: "RIGHT_ALIGN" }
133869
134863
  ]
133870
134864
  }),
133871
- verticalAlign: Prop.string().readAndWrite().propertiesPanel({
134865
+ verticalAlign: Prop.string().readAndWrite().default("top").propertiesPanel({
133872
134866
  label: "Vertical alignment",
133873
134867
  controlType: "RADIO_BUTTON_GROUP",
133874
134868
  options: [
@@ -133881,17 +134875,17 @@ const textStyleProps = {
133881
134875
  label: "Cell style",
133882
134876
  controlType: "TEXT_STYLE"
133883
134877
  }),
133884
- cellBackground: Prop.string().readAndWrite().propertiesPanel({
133885
- label: "Background color",
133886
- controlType: "COLOR_PICKER"
133887
- })
134878
+ cellBackground: colorProp({
134879
+ label: "Background color"
134880
+ }).readAndWrite()
133888
134881
  };
133889
134882
  const textColumnProperties = {
133890
134883
  general: {
133891
- computedValue: Prop.string().readAndWrite().propertiesPanel({
133892
- label: "Computed value",
133893
- controlType: "COMPUTE_TABLE_VALUE"
133894
- }),
134884
+ // TODO: bring this back when we are ready
134885
+ // computedValue: Prop.string().readAndWrite().propertiesPanel({
134886
+ // label: "Computed value",
134887
+ // controlType: "COMPUTE_TABLE_VALUE",
134888
+ // }),
133895
134889
  displayedValue: Prop.string().readAndWrite().propertiesPanel({
133896
134890
  label: "Displayed value",
133897
134891
  controlType: "COMPUTE_TABLE_VALUE"
@@ -133938,26 +134932,24 @@ const buttonColumnProperties = {
133938
134932
  }
133939
134933
  ]
133940
134934
  }),
133941
- buttonBackgroundColor: Prop.string().readAndWrite().propertiesPanel({
133942
- label: "Background color",
133943
- controlType: "COLOR_PICKER"
133944
- }),
133945
- buttonLabelColor: Prop.string().readAndWrite().propertiesPanel({
133946
- label: "Label color",
133947
- controlType: "COLOR_PICKER"
133948
- }),
133949
- backgroundColor: Prop.string().readAndWrite().propertiesPanel({
133950
- label: "Background color",
133951
- controlType: "COLOR_PICKER"
133952
- })
134935
+ buttonBackgroundColor: colorProp({
134936
+ label: "Background color"
134937
+ }).readAndWrite(),
134938
+ buttonLabelColor: colorProp({
134939
+ label: "Label color"
134940
+ }).readAndWrite(),
134941
+ backgroundColor: colorProp({
134942
+ label: "Background color"
134943
+ }).readAndWrite()
133953
134944
  }
133954
134945
  };
133955
134946
  const numberColumnProperties = {
133956
134947
  general: {
133957
- computedValue: Prop.string().readAndWrite().propertiesPanel({
133958
- label: "Computed value",
133959
- controlType: "COMPUTE_TABLE_VALUE"
133960
- }),
134948
+ // TODO: bring this back when we are ready
134949
+ // computedValue: Prop.string().readAndWrite().propertiesPanel({
134950
+ // label: "Computed value",
134951
+ // controlType: "COMPUTE_TABLE_VALUE",
134952
+ // }),
133961
134953
  notation: Prop.string().readAndWrite().propertiesPanel({
133962
134954
  label: "Number format",
133963
134955
  controlType: "DROP_DOWN",
@@ -134064,12 +135056,12 @@ const imageColumnProperties = {
134064
135056
  };
134065
135057
  const dateColumnProperties = {
134066
135058
  general: {
134067
- valueFormat: Prop.string().readAndWrite().propertiesPanel({
135059
+ inputFormat: Prop.string().readAndWrite().propertiesPanel({
134068
135060
  label: "Value format",
134069
135061
  controlType: "DROP_DOWN",
134070
135062
  options: DATE_INPUT_FORMATS
134071
135063
  }),
134072
- displayFormat: Prop.string().readAndWrite().propertiesPanel({
135064
+ outputFormat: Prop.string().readAndWrite().propertiesPanel({
134073
135065
  label: "Display format",
134074
135066
  controlType: "DROP_DOWN",
134075
135067
  options: DATE_OUTPUT_FORMATS
@@ -134101,38 +135093,39 @@ const dateColumnProperties = {
134101
135093
  };
134102
135094
  const booleanColumnProperties = {
134103
135095
  general: {
134104
- computedValue: Prop.string().readAndWrite().propertiesPanel({
134105
- label: "Computed value",
134106
- controlType: "COMPUTE_TABLE_VALUE"
134107
- })
135096
+ // TODO: bring this back when we are ready
135097
+ // computedValue: Prop.string().readAndWrite().propertiesPanel({
135098
+ // label: "Computed value",
135099
+ // controlType: "COMPUTE_TABLE_VALUE",
135100
+ // }),
134108
135101
  },
134109
135102
  presentation: {
134110
135103
  ...textStyleProps,
134111
- booleanStyleFalse: Prop.string().readAndWrite().propertiesPanel({
135104
+ booleanStyleFalse: Prop.string().readAndWrite().default("empty").propertiesPanel({
134112
135105
  label: "False value",
134113
- controlType: "RADIO_BUTTON_GROUP",
135106
+ controlType: "RADIO_BUTTON",
134114
135107
  options: [
134115
135108
  {
134116
- label: "Empty",
134117
- value: BooleanStyleFalse.EMPTY
135109
+ name: "",
135110
+ value: "empty"
134118
135111
  },
134119
135112
  {
134120
- label: "Close",
135113
+ name: "Close",
134121
135114
  isIcon: true,
134122
135115
  icon: "CLOSE",
134123
- value: BooleanStyleFalse.CLOSE
135116
+ value: "close"
134124
135117
  },
134125
135118
  {
134126
- label: "Minus",
135119
+ name: "Minus",
134127
135120
  isIcon: true,
134128
135121
  icon: "MINUS",
134129
- value: BooleanStyleFalse.MINUS
135122
+ value: "minus"
134130
135123
  },
134131
135124
  {
134132
- label: "Empty checkbox",
135125
+ name: "Empty checkbox",
134133
135126
  isIcon: true,
134134
135127
  icon: "EMPTY_CHECKBOX",
134135
- value: BooleanStyleFalse.EMPTY_CHECKBOX
135128
+ value: "empty_checkbox"
134136
135129
  }
134137
135130
  ]
134138
135131
  })
@@ -134140,10 +135133,11 @@ const booleanColumnProperties = {
134140
135133
  };
134141
135134
  const videoColumnProperties = {
134142
135135
  general: {
134143
- computedValue: Prop.string().readAndWrite().propertiesPanel({
134144
- label: "Computed value",
134145
- controlType: "COMPUTE_TABLE_VALUE"
134146
- })
135136
+ // TODO: bring this back when we are ready
135137
+ // computedValue: Prop.string().readAndWrite().propertiesPanel({
135138
+ // label: "Computed value",
135139
+ // controlType: "COMPUTE_TABLE_VALUE",
135140
+ // }),
134147
135141
  },
134148
135142
  presentation: {
134149
135143
  ...textStyleProps
@@ -134184,6 +135178,10 @@ const columnPanelConfig = {
134184
135178
  })
134185
135179
  },
134186
135180
  variants: [
135181
+ {
135182
+ columnType: Prop.unset(),
135183
+ ...textColumnProperties.general
135184
+ },
134187
135185
  {
134188
135186
  columnType: Prop.literal(ColumnType.TEXT),
134189
135187
  ...textColumnProperties.general
@@ -134268,6 +135266,10 @@ const columnPanelConfig = {
134268
135266
  columnType: Prop.string()
134269
135267
  },
134270
135268
  variants: [
135269
+ {
135270
+ columnType: Prop.unset(),
135271
+ ...textColumnProperties.presentation
135272
+ },
134271
135273
  {
134272
135274
  columnType: Prop.literal(ColumnType.TEXT),
134273
135275
  ...textColumnProperties.presentation
@@ -134387,142 +135389,6 @@ const columnPanelConfig = {
134387
135389
  // }),
134388
135390
  // ),
134389
135391
  };
134390
- const JUSTIFY_CONTENT = {
134391
- LEFT: "flex-start",
134392
- CENTER: "center",
134393
- RIGHT: "flex-end"
134394
- };
134395
- const ALIGN_ITEMS = {
134396
- TOP: "flex-start",
134397
- CENTER: "center",
134398
- BOTTOM: "flex-end"
134399
- };
134400
- const TEXT_ALIGN = {
134401
- LEFT: "left",
134402
- CENTER: "center",
134403
- RIGHT: "right"
134404
- };
134405
- const TEXT_SIZES = {
134406
- HEADING1: "24px",
134407
- HEADING2: "18px",
134408
- HEADING3: "16px",
134409
- PARAGRAPH: "14px",
134410
- PARAGRAPH2: "12px"
134411
- };
134412
- var FontStyleTypes = /* @__PURE__ */ ((FontStyleTypes2) => {
134413
- FontStyleTypes2["BOLD"] = "BOLD";
134414
- FontStyleTypes2["ITALIC"] = "ITALIC";
134415
- FontStyleTypes2["REGULAR"] = "REGULAR";
134416
- FontStyleTypes2["UNDERLINE"] = "UNDERLINE";
134417
- return FontStyleTypes2;
134418
- })(FontStyleTypes || {});
134419
- const TABLE_SIZES = {
134420
- [CompactMode.VERY_SHORT]: {
134421
- COLUMN_HEADER_HEIGHT: 48,
134422
- TABLE_HEADER_HEIGHT: 60,
134423
- TABLE_FOOTER_HEIGHT: 48,
134424
- ROW_HEIGHT: 28,
134425
- ROW_FONT_SIZE: 14,
134426
- PAGINATION_CONTROLS_HEIGHT: 24,
134427
- IMAGE_SIZE: 22,
134428
- LINK_MENU_HEIGHT: 28,
134429
- LINK_MENU_ICON_SIZE: IconSize$1.LARGE,
134430
- ROW_PADDING: 0
134431
- },
134432
- [CompactMode.SHORT]: {
134433
- COLUMN_HEADER_HEIGHT: 48,
134434
- TABLE_HEADER_HEIGHT: 60,
134435
- TABLE_FOOTER_HEIGHT: 48,
134436
- ROW_HEIGHT: 36,
134437
- ROW_FONT_SIZE: 14,
134438
- PAGINATION_CONTROLS_HEIGHT: 24,
134439
- IMAGE_SIZE: 28,
134440
- LINK_MENU_HEIGHT: 32,
134441
- LINK_MENU_ICON_SIZE: IconSize$1.LARGE,
134442
- ROW_PADDING: 2
134443
- },
134444
- [CompactMode.DEFAULT]: {
134445
- COLUMN_HEADER_HEIGHT: 48,
134446
- TABLE_HEADER_HEIGHT: 60,
134447
- TABLE_FOOTER_HEIGHT: 48,
134448
- ROW_HEIGHT: 48,
134449
- ROW_FONT_SIZE: 14,
134450
- PAGINATION_CONTROLS_HEIGHT: 32,
134451
- IMAGE_SIZE: 32,
134452
- LINK_MENU_HEIGHT: 36,
134453
- LINK_MENU_ICON_SIZE: IconSize$1.XL,
134454
- ROW_PADDING: 5
134455
- },
134456
- [CompactMode.TALL]: {
134457
- COLUMN_HEADER_HEIGHT: 36,
134458
- TABLE_HEADER_HEIGHT: 60,
134459
- TABLE_FOOTER_HEIGHT: 60,
134460
- ROW_HEIGHT: 58,
134461
- ROW_FONT_SIZE: 14,
134462
- PAGINATION_CONTROLS_HEIGHT: 36,
134463
- IMAGE_SIZE: 36,
134464
- LINK_MENU_HEIGHT: 36,
134465
- LINK_MENU_ICON_SIZE: IconSize$1.XL,
134466
- ROW_PADDING: 10
134467
- }
134468
- };
134469
- const DEFAULT_TABLE_COLUMN_WIDTH = 150;
134470
- const TABLE_COLUMN_MIN_WIDTH = 20;
134471
- const PARSED_INPUT_TYPES = [
134472
- EditInputType.Number,
134473
- EditInputType.Checkbox
134474
- ];
134475
- const TextBoxEditTypes = [
134476
- EditInputType.Text,
134477
- EditInputType.Number,
134478
- EditInputType.Email
134479
- ];
134480
- const DEFAULT_CELL_TEXT_STYLE_VARIANT = "body2";
134481
- const DEFAULT_CELL_CLASS_NAME = getTextCssClassFromVariant(
134482
- DEFAULT_CELL_TEXT_STYLE_VARIANT
134483
- );
134484
- const DEFAULT_HEADING_TEXT_STYLE_VARIANT = "heading3";
134485
- const TABLE_COLUMN_HEADER_DEFAULT_TYPOGRAPHY = "heading6";
134486
- var Condition0Type = /* @__PURE__ */ ((Condition0Type2) => {
134487
- Condition0Type2["all"] = "all";
134488
- Condition0Type2["isEmpty"] = "isEmpty";
134489
- Condition0Type2["isNotEmpty"] = "isNotEmpty";
134490
- Condition0Type2["isTrue"] = "isTrue";
134491
- Condition0Type2["isFalse"] = "isFalse";
134492
- return Condition0Type2;
134493
- })(Condition0Type || {});
134494
- var Condition1Type = /* @__PURE__ */ ((Condition1Type2) => {
134495
- Condition1Type2["textIs"] = "textIs";
134496
- Condition1Type2["textContains"] = "textContains";
134497
- Condition1Type2["textDoesNotContain"] = "textDoesNotContain";
134498
- Condition1Type2["textStartsWith"] = "textStartsWith";
134499
- Condition1Type2["textEndsWith"] = "textEndsWith";
134500
- Condition1Type2["isEqualTo"] = "isEqualTo";
134501
- Condition1Type2["isNotEqualTo"] = "isNotEqualTo";
134502
- Condition1Type2["isLessThan"] = "isLessThan";
134503
- Condition1Type2["isLessThanOrEqualTo"] = "isLessThanOrEqualTo";
134504
- Condition1Type2["isGreaterThan"] = "isGreaterThan";
134505
- Condition1Type2["isGreaterThanOrEqualTo"] = "isGreaterThanOrEqualTo";
134506
- Condition1Type2["dateIs"] = "dateIs";
134507
- Condition1Type2["dateIsBefore"] = "dateIsBefore";
134508
- Condition1Type2["dateIsAfter"] = "dateIsAfter";
134509
- return Condition1Type2;
134510
- })(Condition1Type || {});
134511
- var Condition2Type = /* @__PURE__ */ ((Condition2Type2) => {
134512
- Condition2Type2["isBetween"] = "isBetween";
134513
- Condition2Type2["dateIsBetween"] = "dateIsBetween";
134514
- return Condition2Type2;
134515
- })(Condition2Type || {});
134516
- const TABLE_MULTISELECT_COLID$1 = "SB_$$_MULTISELECT";
134517
- const tagColorPalette = [
134518
- "#27BBFF33",
134519
- "#FF9F3533",
134520
- "#14CDB733",
134521
- "#7C4FF833",
134522
- "#FF62A433",
134523
- "#9D585833",
134524
- "#FF484833"
134525
- ];
134526
135392
  function useCachedValue(value, isEqualFn = lodashExports.isEqual) {
134527
135393
  const cached = useRef(value);
134528
135394
  if (cached.current !== value && !isEqualFn(cached.current, value)) {
@@ -136383,10 +137249,6 @@ const HeaderCellContentWrapper = qe$1.div`
136383
137249
  var _a2, _b2;
136384
137250
  return ((_a2 = props == null ? void 0 : props.columnProperties) == null ? void 0 : _a2.horizontalAlign) && JUSTIFY_CONTENT[(_b2 = props == null ? void 0 : props.columnProperties) == null ? void 0 : _b2.horizontalAlign];
136385
137251
  }};
136386
-
136387
- span {
136388
- ${({ shouldCapitalize }) => shouldCapitalize && `text-transform: capitalize;`}
136389
- }
136390
137252
  `;
136391
137253
  const TableIconWrapper = qe$1.div`
136392
137254
  width: ${(props) => props.tableSizes.TABLE_FOOTER_HEIGHT}px;
@@ -136557,11 +137419,11 @@ const StyledEmptyCheckbox = qe$1(SvgEmptyCheckbox)`
136557
137419
  }
136558
137420
  `;
136559
137421
  const RadioButtonControlIcons = {
136560
- EMPTY: (_props) => null,
136561
- CHECK: (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(StyledCheckOutlined, { ...props }),
136562
- CLOSE: (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(StyledCloseOutlined, { ...props }),
136563
- MINUS: (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(StyledMinusOutlined, { ...props }),
136564
- EMPTY_CHECKBOX: (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(
137422
+ empty: (_props) => null,
137423
+ check: (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(StyledCheckOutlined, { ...props }),
137424
+ close: (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(StyledCloseOutlined, { ...props }),
137425
+ minus: (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(StyledMinusOutlined, { ...props }),
137426
+ empty_checkbox: (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(
136565
137427
  "span",
136566
137428
  {
136567
137429
  style: {
@@ -143581,14 +144443,14 @@ function getLoaderFn(options) {
143581
144443
  if (!(loader === "all")) return [3, 3];
143582
144444
  return [4, import(
143583
144445
  /* webpackChunkName: "blueprint-icons-all-paths-loader" */
143584
- "./allPathsLoader-BzKYsLDE.js"
144446
+ "./allPathsLoader-D3ybY8Wk.js"
143585
144447
  )];
143586
144448
  case 2:
143587
144449
  return [2, _b2.sent().allPathsLoader];
143588
144450
  case 3:
143589
144451
  return [4, import(
143590
144452
  /* webpackChunkName: "blueprint-icons-split-paths-by-size-loader" */
143591
- "./splitPathsBySizeLoader-D1iVVUla.js"
144453
+ "./splitPathsBySizeLoader-B-TUNLgR.js"
143592
144454
  )];
143593
144455
  case 4:
143594
144456
  return [2, _b2.sent().splitPathsBySizeLoader];
@@ -151606,14 +152468,8 @@ class DatePickerComponent extends React__default.Component {
151606
152468
  const _date = moment(date4, format3);
151607
152469
  return _date.isValid() ? _date.toDate() : void 0;
151608
152470
  });
151609
- __publicField(this, "getNormalizedDateFormat", () => {
151610
- return normalizeDateFormat(this.props.dateFormat || ISO_DATE_FORMAT);
151611
- });
151612
- __publicField(this, "getNormalizedDisplayDateFormat", () => {
151613
- return this.props.displayDateFormat ? normalizeDateFormat(this.props.displayDateFormat) : void 0;
151614
- });
151615
152471
  __publicField(this, "shouldWrapTime", () => {
151616
- const dateFormat = this.getNormalizedDateFormat();
152472
+ const dateFormat = this.normalizedDateFormat;
151617
152473
  const showTime = formatIncludesTime(dateFormat);
151618
152474
  const timePrecision = getTimePrecision(dateFormat);
151619
152475
  return showTime && this.props.twentyFourHourTime && timePrecision === TimePrecision.MINUTE;
@@ -151636,25 +152492,8 @@ class DatePickerComponent extends React__default.Component {
151636
152492
  }
151637
152493
  return today.toDate();
151638
152494
  });
151639
- __publicField(this, "getCurrentValue", () => {
151640
- if (this.props.selectedDate && typeof this.props.selectedDate === "string") {
151641
- const dateFormat = this.getNormalizedDateFormat();
151642
- const withoutTz = stripTimezoneFromString(
151643
- this.props.selectedDate,
151644
- dateFormat
151645
- );
151646
- const converted = convertDateStringTimezone(
151647
- withoutTz,
151648
- NO_TZ_FORMAT,
151649
- this.valueTimezone,
151650
- this.displayTimezone
151651
- );
151652
- return converted;
151653
- }
151654
- return null;
151655
- });
151656
152495
  __publicField(this, "getPopoverFooter", () => {
151657
- const dateFormat = this.getNormalizedDateFormat();
152496
+ const dateFormat = this.normalizedDateFormat;
151658
152497
  const showTime = formatIncludesTime(dateFormat);
151659
152498
  const shouldWrapTime = this.shouldWrapTime();
151660
152499
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(
@@ -151668,7 +152507,7 @@ class DatePickerComponent extends React__default.Component {
151668
152507
  {
151669
152508
  text: "Today",
151670
152509
  onClick: () => {
151671
- const dateFormat2 = this.getNormalizedDateFormat();
152510
+ const dateFormat2 = this.normalizedDateFormat;
151672
152511
  const today = moment().tz(this.valueTimezone).format(dateFormat2);
151673
152512
  this.props.onDateSelected(today);
151674
152513
  },
@@ -151690,7 +152529,7 @@ class DatePickerComponent extends React__default.Component {
151690
152529
  );
151691
152530
  });
151692
152531
  __publicField(this, "formatDisplayDate", (date4) => {
151693
- const displayDateFormat = this.getNormalizedDisplayDateFormat() ?? this.getNormalizedDateFormat();
152532
+ const displayDateFormat = this.normalizedDisplayDateFormat ?? this.normalizedDateFormat;
151694
152533
  const withoutTz = stripTimezoneFromDate(
151695
152534
  date4,
151696
152535
  displayDateFormat,
@@ -151699,7 +152538,7 @@ class DatePickerComponent extends React__default.Component {
151699
152538
  return withoutTz;
151700
152539
  });
151701
152540
  __publicField(this, "formatSelectedDate", (date4) => {
151702
- const dateFormat = this.getNormalizedDateFormat();
152541
+ const dateFormat = this.normalizedDateFormat;
151703
152542
  const dateStr = stripTimezoneFromDate(date4, dateFormat, moment.tz.guess());
151704
152543
  const converted = convertDateStringTimezone(
151705
152544
  dateStr,
@@ -151710,7 +152549,7 @@ class DatePickerComponent extends React__default.Component {
151710
152549
  return converted;
151711
152550
  });
151712
152551
  __publicField(this, "parseSelectedDate", (dateStr) => {
151713
- const dateFormat = this.getNormalizedDateFormat();
152552
+ const dateFormat = this.normalizedDateFormat;
151714
152553
  const converted = stripTimezoneFromString(dateStr, dateFormat);
151715
152554
  return new Date(converted);
151716
152555
  });
@@ -151718,8 +152557,8 @@ class DatePickerComponent extends React__default.Component {
151718
152557
  __publicField(this, "onInputChanged", (event) => {
151719
152558
  const displayFormattedDateStr = event.target.value;
151720
152559
  if (displayFormattedDateStr) {
151721
- const dateFormat = this.getNormalizedDateFormat();
151722
- const displayFormat = this.getNormalizedDisplayDateFormat() || dateFormat;
152560
+ const dateFormat = this.normalizedDateFormat;
152561
+ const displayFormat = this.normalizedDisplayDateFormat || dateFormat;
151723
152562
  if (!isValidDate(displayFormattedDateStr)) {
151724
152563
  this.props.onDateSelected(displayFormattedDateStr);
151725
152564
  return;
@@ -151739,7 +152578,7 @@ class DatePickerComponent extends React__default.Component {
151739
152578
  * @param selectedDayOnly date in the local timezone
151740
152579
  */
151741
152580
  __publicField(this, "onDayChanged", (selectedDayOnly) => {
151742
- const dateFormat = this.getNormalizedDateFormat();
152581
+ const dateFormat = this.normalizedDateFormat;
151743
152582
  if (selectedDayOnly && (!this.props.selectedDate || !moment(this.props.selectedDate, dateFormat).isSame(
151744
152583
  selectedDayOnly,
151745
152584
  "days"
@@ -151784,25 +152623,48 @@ class DatePickerComponent extends React__default.Component {
151784
152623
  if (!this.props.selectedDate) return;
151785
152624
  if (prevProps.timezone !== this.props.timezone) {
151786
152625
  const localTimezone = moment.tz.guess();
151787
- const nextDate = moment.tz(this.props.selectedDate, prevProps.timezone ?? localTimezone).tz(this.props.timezone ?? localTimezone).format(this.getNormalizedDateFormat());
152626
+ const nextDate = moment.tz(this.props.selectedDate, prevProps.timezone ?? localTimezone).tz(this.props.timezone ?? localTimezone).format(this.normalizedDateFormat);
151788
152627
  this.props.onDateSelected(nextDate);
151789
152628
  }
151790
152629
  }
152630
+ get normalizedDateFormat() {
152631
+ return normalizeDateFormat(this.props.dateFormat || ISO_DATE_FORMAT);
152632
+ }
152633
+ get normalizedDisplayDateFormat() {
152634
+ return this.props.displayDateFormat ? normalizeDateFormat(this.props.displayDateFormat) : void 0;
152635
+ }
151791
152636
  get valueTimezone() {
151792
152637
  return this.props.timezone || moment.tz.guess();
151793
152638
  }
151794
152639
  get displayTimezone() {
151795
152640
  return this.props.displayTimezone || moment.tz.guess();
151796
152641
  }
152642
+ get currentValue() {
152643
+ if (this.props.selectedDate && typeof this.props.selectedDate === "string") {
152644
+ const dateFormat = this.normalizedDateFormat;
152645
+ const withoutTz = stripTimezoneFromString(
152646
+ this.props.selectedDate,
152647
+ dateFormat
152648
+ );
152649
+ const converted = convertDateStringTimezone(
152650
+ withoutTz,
152651
+ NO_TZ_FORMAT,
152652
+ this.valueTimezone,
152653
+ this.displayTimezone
152654
+ );
152655
+ return converted;
152656
+ }
152657
+ return null;
152658
+ }
151797
152659
  render() {
151798
- const dateFormat = this.getNormalizedDateFormat();
151799
- const displayFormat = this.getNormalizedDisplayDateFormat() || dateFormat;
152660
+ const dateFormat = this.normalizedDateFormat;
152661
+ const displayFormat = this.normalizedDisplayDateFormat || dateFormat;
151800
152662
  const anchor = this.props.selectedDate && moment(this.props.selectedDate, dateFormat).isValid() ? moment(this.props.selectedDate, dateFormat) : moment();
151801
152663
  const year = anchor.get("year");
151802
152664
  const minDate = this.props.minDate ? this.getValidDate(this.props.minDate, dateFormat) : anchor.clone().set({ month: 0, date: 1, year: year - 10 }).toDate();
151803
152665
  const maxDate = this.props.maxDate ? this.getValidDate(this.props.maxDate, dateFormat) : anchor.clone().set({ month: 11, date: 31, year: year + 10 }).toDate();
151804
152666
  const showTime = formatIncludesTime(dateFormat);
151805
- const currentValue = this.getCurrentValue();
152667
+ const currentValue = this.currentValue;
151806
152668
  const timePrecision = getTimePrecision(dateFormat);
151807
152669
  const initialMonth = this.getInitialMonth(currentValue, minDate, maxDate);
151808
152670
  const styleVars = {
@@ -152041,8 +152903,10 @@ const InputCellWrapper = qe$1.div`
152041
152903
  return `${minHeight}px`;
152042
152904
  }};
152043
152905
  text-align: ${(props) => {
152044
- var _a2, _b2;
152045
- return ((_a2 = props == null ? void 0 : props.cellProperties) == null ? void 0 : _a2.horizontalAlign) && TEXT_ALIGN[(_b2 = props == null ? void 0 : props.cellProperties) == null ? void 0 : _b2.horizontalAlign];
152906
+ var _a2;
152907
+ if ((_a2 = props == null ? void 0 : props.cellProperties) == null ? void 0 : _a2.horizontalAlign) {
152908
+ return TEXT_ALIGN[props.cellProperties.horizontalAlign];
152909
+ }
152046
152910
  }};
152047
152911
  font-size: ${(props) => {
152048
152912
  return `${TABLE_SIZES[props.$compactMode].ROW_FONT_SIZE}px`;
@@ -153899,7 +154763,7 @@ const renderCell = ({
153899
154763
  );
153900
154764
  }
153901
154765
  if (typeof value === "boolean") {
153902
- const ButtonIcon = value ? RadioButtonControlIcons["CHECK"] : RadioButtonControlIcons[cellProps.booleanStyleFalse || BooleanStyleFalse.EMPTY];
154766
+ const ButtonIcon = value ? RadioButtonControlIcons["check"] : RadioButtonControlIcons[cellProps.booleanStyleFalse || "empty"];
153903
154767
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
153904
154768
  CellWrapper,
153905
154769
  {
@@ -153914,7 +154778,7 @@ const renderCell = ({
153914
154778
  }
153915
154779
  if (lodashExports.isString(value) && ["true", "false"].includes(value.toLocaleLowerCase())) {
153916
154780
  const booleanValue = value.toLocaleLowerCase() === "true";
153917
- const ButtonIcon = booleanValue ? RadioButtonControlIcons["CHECK"] : RadioButtonControlIcons[cellProps.booleanStyleFalse || BooleanStyleFalse.EMPTY];
154781
+ const ButtonIcon = booleanValue ? RadioButtonControlIcons["check"] : RadioButtonControlIcons[cellProps.booleanStyleFalse || "empty"];
153918
154782
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
153919
154783
  CellWrapper,
153920
154784
  {
@@ -154297,11 +155161,12 @@ function getDefaultColumnProperties(accessor, index2, widgetName, isDerived) {
154297
155161
  enableFilter: true,
154298
155162
  enableSort: true,
154299
155163
  isVisible: true,
154300
- isDerived: false,
155164
+ isDerived: !!isDerived,
154301
155165
  label: accessor,
154302
155166
  computedValue: getDefaultComputedValue(
154303
155167
  accessor,
154304
- widgetName
155168
+ widgetName,
155169
+ isDerived ?? false
154305
155170
  ),
154306
155171
  linkUrl: "",
154307
155172
  linkLabel: "",
@@ -154318,6 +155183,9 @@ function getDefaultColumnProperties(accessor, index2, widgetName, isDerived) {
154318
155183
  };
154319
155184
  }
154320
155185
  function getDefaultComputedValue(accessor, widgetName, isDerived) {
155186
+ if (isDerived) {
155187
+ return "";
155188
+ }
154321
155189
  return `{{${widgetName}.tableDataWithInserts.map((currentRow) => { return currentRow${getDottedPathTo(
154322
155190
  accessor
154323
155191
  )} })}}`;
@@ -154445,7 +155313,8 @@ function createTableColumns(props) {
154445
155313
  const defaultProperties = getDefaultColumnProperties(
154446
155314
  derivedColumnKey,
154447
155315
  index2,
154448
- props.widgetName
155316
+ props.widgetName,
155317
+ true
154449
155318
  );
154450
155319
  tableColumns[derivedColumnKey] = {
154451
155320
  ...defaultProperties,
@@ -154548,20 +155417,6 @@ function getSelectedRows(props) {
154548
155417
  const selectedRows = selectedRowIndices.map((ind) => filteredTableData[ind]).filter(Boolean);
154549
155418
  return selectedRows;
154550
155419
  }
154551
- function getPageSize(props) {
154552
- var _a2, _b2, _c2, _d2;
154553
- if (props.configuredPageSize && typeof props.configuredPageSize === "number" && props.configuredPageSize > 0) {
154554
- return props.configuredPageSize;
154555
- }
154556
- const compactMode = getCompactMode(props.compactMode);
154557
- const componentHeight = ((_a2 = props == null ? void 0 : props.height) == null ? void 0 : _a2.mode) === "px" ? (_b2 = props == null ? void 0 : props.height) == null ? void 0 : _b2.value : (((_c2 = props == null ? void 0 : props.height) == null ? void 0 : _c2.value) ?? 0) * 12;
154558
- const tableSizes = TABLE_SIZES[compactMode];
154559
- const headerHeight = props.isSearchable || props.tableHeader || ((_d2 = props.hiddenColumns) == null ? void 0 : _d2.length) > 0 ? tableSizes.TABLE_HEADER_HEIGHT : 0;
154560
- const scrollbarSize = 8;
154561
- const mainHeight = (componentHeight ?? 100) - headerHeight - scrollbarSize - tableSizes.TABLE_FOOTER_HEIGHT - tableSizes.COLUMN_HEADER_HEIGHT;
154562
- const pageSize = Math.floor(mainHeight / (tableSizes.ROW_HEIGHT + 1));
154563
- return Math.max(pageSize, 1);
154564
- }
154565
155420
  function getFilteredTableData(props) {
154566
155421
  var _a2;
154567
155422
  if (!props.tableData) {
@@ -154758,20 +155613,22 @@ function getFilteredTableData(props) {
154758
155613
  });
154759
155614
  }
154760
155615
  };
155616
+ const searchText = props.searchText ?? "";
154761
155617
  const getSearchKey = () => {
154762
- if (props.searchText && (!props.onSearchTextChanged || props.enableClientSideSearch)) {
154763
- return props.searchText.toLowerCase();
155618
+ if (searchText && props.enableClientSideSearch !== false) {
155619
+ return searchText.toLowerCase();
154764
155620
  }
154765
155621
  return "";
154766
155622
  };
155623
+ const filters = props.filters;
154767
155624
  const finalTableData = sortedTableData.filter((item) => {
154768
155625
  var _a3;
154769
155626
  const searchFound = getSearchKey() ? Object.values(item).join(", ").toLowerCase().includes(getSearchKey()) : true;
154770
155627
  if (!searchFound) return false;
154771
155628
  for (const [columnName, { byValue, condition }] of Object.entries(
154772
- ((_a3 = props.filters) == null ? void 0 : _a3.byColumn) ?? {}
155629
+ (filters == null ? void 0 : filters.byColumn) ?? {}
154773
155630
  )) {
154774
- const column2 = props.columns[columnName];
155631
+ const column2 = ((_a3 = props.columns) == null ? void 0 : _a3[columnName]) ?? {};
154775
155632
  const value = item[columnName];
154776
155633
  if (byValue) {
154777
155634
  const columnType = column2 && column2.columnType ? column2.columnType : "text";
@@ -154879,12 +155736,53 @@ function getFilteredTableData(props) {
154879
155736
  }
154880
155737
  const propertiesDefinition$9 = {
154881
155738
  general: Section.category(PropsPanelCategory.Content).children({
154882
- tableHeader: Prop.string().readAndWrite().default("").propertiesPanel({
155739
+ header: Prop.string().readAndWrite().default("").propertiesPanel({
154883
155740
  label: "Header",
154884
155741
  placeholder: "Table name",
154885
155742
  helpText: "A header displayed at the top of the table"
154886
155743
  }),
154887
- tableData: Prop.array().readable().propertiesPanel({
155744
+ tableData: Prop.array().onEdit(({ sourceId, updates, widgetMeta }) => {
155745
+ try {
155746
+ const [previousWidget, newWidget] = getPreviousAndCurrentWidgetProps(updates, widgetMeta);
155747
+ if (lodashExports.isEqual(previousWidget == null ? void 0 : previousWidget.tableData, DEFAULT_TABLE_DATA)) {
155748
+ let updatedTableData = newWidget == null ? void 0 : newWidget.tableData;
155749
+ if (typeof updatedTableData === "string") {
155750
+ updatedTableData = JSON.parse(updatedTableData);
155751
+ }
155752
+ if (!Array.isArray(updatedTableData) || typeof updatedTableData[0] !== "object") {
155753
+ return {
155754
+ [sourceId]: {
155755
+ props: {
155756
+ columns: Property.Static({})
155757
+ },
155758
+ meta: {}
155759
+ }
155760
+ };
155761
+ }
155762
+ const colKeys = Object.keys(updatedTableData[0] ?? {});
155763
+ if (!lodashExports.isEqual(colKeys, DEFAULT_TABLE_KEYS)) {
155764
+ return {
155765
+ [sourceId]: {
155766
+ props: {
155767
+ columns: Property.Static(CLEARED_TABLE_COLUMNS)
155768
+ },
155769
+ meta: {}
155770
+ }
155771
+ };
155772
+ }
155773
+ }
155774
+ return {};
155775
+ } catch (_e2) {
155776
+ return {
155777
+ [sourceId]: {
155778
+ props: {
155779
+ columns: Property.Static(CLEARED_TABLE_COLUMNS)
155780
+ },
155781
+ meta: {}
155782
+ }
155783
+ };
155784
+ }
155785
+ }).readable().propertiesPanel({
154888
155786
  label: "Data",
154889
155787
  placeholder: '[{ "col1": "val1" }]',
154890
155788
  isJSConvertible: false,
@@ -154917,8 +155815,15 @@ const propertiesDefinition$9 = {
154917
155815
  helpText: "Enable per column filtering"
154918
155816
  }),
154919
155817
  defaultFilters: Prop.any().readAndWrite().propertiesPanel({
154920
- label: "Filters",
154921
- helpText: "Allows specifying the filters that will be used on page load"
155818
+ controlType: "COMPUTED_CODE_EDITOR",
155819
+ label: "Default filters",
155820
+ visibility: "SHOW_NAME",
155821
+ isJSConvertible: false,
155822
+ isRemovable: true,
155823
+ helpText: "Allows specifying the filters that will be used on page load",
155824
+ isVisible: function() {
155825
+ return this.isFilterable && this.pageType !== "server_side";
155826
+ }
154922
155827
  }),
154923
155828
  // enableRowInsertion: Prop.boolean()
154924
155829
  // .readAndWrite()
@@ -154946,37 +155851,46 @@ const propertiesDefinition$9 = {
154946
155851
  label: "CSV download",
154947
155852
  helpText: "Enable CSV download"
154948
155853
  }),
154949
- pageType: Prop.string().default(PaginationTypes.NONE).readAndWrite().propertiesPanel({
155854
+ paginationType: Prop.string().default("none").readAndWrite().propertiesPanel({
154950
155855
  label: "Pagination type",
154951
155856
  controlType: "DROP_DOWN",
154952
155857
  helpText: "For server side pagination bind the Table.pageNo property in your API and call it onPageChange",
154953
155858
  options: [
154954
- { label: "None", value: PaginationTypes.NONE },
154955
- { label: "Client side", value: PaginationTypes.CLIENT_SIDE },
154956
- { label: "Server side", value: PaginationTypes.SERVER_SIDE }
155859
+ { label: "None", value: "none" },
155860
+ { label: "Client side", value: "client_side" },
155861
+ { label: "Server side", value: "server_side" }
154957
155862
  ]
154958
155863
  }),
154959
- configuredPageSize: Prop.number().readAndWrite().propertiesPanel({
155864
+ configuredPageSize: Prop.any().readAndWrite().propertiesPanel({
154960
155865
  label: "Page size",
154961
155866
  helpText: "Sets the number of items per page. If set to 'Auto', this value will be calculated based on the height of the table.",
154962
155867
  controlType: "DROP_DOWN",
154963
155868
  options: [
154964
- { label: "Auto", value: -1 },
155869
+ {
155870
+ label: "Auto",
155871
+ value: "auto"
155872
+ },
154965
155873
  { label: "5", value: 5 },
154966
155874
  { label: "10", value: 10 },
154967
155875
  { label: "20", value: 20 },
154968
155876
  { label: "50", value: 50 }
154969
- ]
155877
+ ],
155878
+ isVisible: function() {
155879
+ return this.paginationType === "client_side";
155880
+ }
154970
155881
  }),
154971
155882
  defaultSort: Prop.composite({
154972
- // TODO: default should be dynamic based on the columns
154973
- column: Prop.string().default("name").propertiesPanel({
155883
+ column: Prop.string().propertiesPanel({
154974
155884
  label: "Column",
154975
155885
  controlType: "SELECT_TABLE_COLUMN"
154976
155886
  }),
154977
155887
  asc: Prop.boolean().default(true).propertiesPanel({
154978
155888
  label: "Order",
154979
- controlType: "RADIO_BUTTON_GROUP"
155889
+ controlType: "RADIO_BUTTON_GROUP",
155890
+ options: [
155891
+ { label: "Ascending", value: true },
155892
+ { label: "Descending", value: false }
155893
+ ]
154980
155894
  })
154981
155895
  }).propertiesPanel({
154982
155896
  label: "Default sort",
@@ -154989,7 +155903,10 @@ const propertiesDefinition$9 = {
154989
155903
  }),
154990
155904
  defaultSearchText: Prop.string().readAndWrite().propertiesPanel({
154991
155905
  label: "Default search",
154992
- helpText: "Sets the default search text"
155906
+ helpText: "Sets the default search text",
155907
+ isVisible: function() {
155908
+ return this.enableClientSideSearch !== false;
155909
+ }
154993
155910
  }),
154994
155911
  searchPlaceholder: Prop.string().readAndWrite().propertiesPanel({
154995
155912
  label: "Search placeholder",
@@ -155017,17 +155934,13 @@ const propertiesDefinition$9 = {
155017
155934
  label: "Cell style",
155018
155935
  controlType: "TEXT_STYLE"
155019
155936
  }),
155020
- backgroundColor: Prop.string().propertiesPanel({
155937
+ backgroundColor: colorProp({
155021
155938
  label: "Background color",
155022
- helpText: "Sets the background color of the table",
155023
- controlType: "COLOR_PICKER"
155024
- // themeValue: "{{ theme.colors.neutral }}",
155939
+ helpText: "Sets the background color of the table"
155025
155940
  }),
155026
- selectedRowBackgroundColor: Prop.string().propertiesPanel({
155941
+ selectedRowBackgroundColor: colorProp({
155027
155942
  label: "Selected row background color",
155028
- helpText: "Sets the background color of the selected row",
155029
- controlType: "COLOR_PICKER"
155030
- // themeValue: "{{ theme.colors.neutral50 }}",
155943
+ helpText: "Sets the background color of the selected row"
155031
155944
  }),
155032
155945
  border: border({ helpText: "Sets the border of the table" }),
155033
155946
  borderRadius: borderRadius({
@@ -155079,11 +155992,9 @@ const propertiesDefinition$9 = {
155079
155992
  label: "Search",
155080
155993
  controlType: "TEXT_STYLE"
155081
155994
  }),
155082
- "searchProps.backgroundColor": Prop.string().propertiesPanel({
155995
+ "searchProps.backgroundColor": colorProp({
155083
155996
  label: "Search background color",
155084
- helpText: "Sets the background color of the search",
155085
- controlType: "COLOR_PICKER"
155086
- // themeValue:"{{ theme.colors.neutral }}",
155997
+ helpText: "Sets the background color of the search"
155087
155998
  }),
155088
155999
  "searchProps.border": border({
155089
156000
  label: "Search border",
@@ -155135,7 +156046,6 @@ const propertiesDefinition$9 = {
155135
156046
  selectedRow: Prop.any().readable().default(getSelectedRow),
155136
156047
  selectedRowSchema: Prop.any().readable().default(getSelectedRowSchema),
155137
156048
  selectedRows: Prop.any().readable().default(getSelectedRows),
155138
- pageSize: Prop.number().readable().default(getPageSize),
155139
156049
  filteredTableData: Prop.any().readable().default(function() {
155140
156050
  if (!this) return [];
155141
156051
  return getFilteredTableData(this)[0];
@@ -155150,15 +156060,23 @@ const propertiesDefinition$9 = {
155150
156060
  // editedRowIndices: Prop.any().readable().default(getEditedRowIndices),
155151
156061
  }),
155152
156062
  meta: Section.category(PropsPanelCategory.Meta).children({
155153
- selectedRowIndex: Prop.number().readable(),
156063
+ selectedRowIndex: Prop.number().readable().default(function() {
156064
+ return this.defaultSelectedRow;
156065
+ }),
155154
156066
  selectedRowIndices: Prop.any().readable(),
155155
- pageNo: Prop.number().readable().default(() => 1),
155156
- sortedColumn: Prop.any().readable(),
155157
- searchText: Prop.string().readable(),
155158
- filters: Prop.any().readable(),
156067
+ sortedColumn: Prop.any().readable().default(function() {
156068
+ return this.defaultSort;
156069
+ }),
156070
+ searchText: Prop.string().readable().default(function() {
156071
+ return this.defaultSearchText ?? "";
156072
+ }),
156073
+ filters: Prop.any().readable().default(function() {
156074
+ return this.defaultFilters;
156075
+ }),
155159
156076
  hiddenColumns: Prop.any().readable(),
155160
156077
  columnFreezes: Prop.any().readable(),
155161
- tagsColorAssignment: Prop.any().readable()
156078
+ tagsColorAssignment: Prop.any().readable(),
156079
+ pageNo: Prop.number().readable().default(() => 0)
155162
156080
  // editOverrides: Prop.any().readable(),
155163
156081
  // currentEditFocus: Prop.any().readable(),
155164
156082
  // currentEditDropdownSearchText: Prop.string().default("").readable(),
@@ -164627,11 +165545,11 @@ const TableDataDownload = ({
164627
165545
  columns,
164628
165546
  tableSizes,
164629
165547
  widgetName,
164630
- tableHeader,
165548
+ header,
164631
165549
  tableCellTextStyle
164632
165550
  }) => {
164633
165551
  const [selected, setSelected] = React__default.useState(false);
164634
- const tableName = tableHeader ? tableHeader : widgetName;
165552
+ const tableName = header ? header : widgetName;
164635
165553
  const fileName = tableName;
164636
165554
  const handleSelectMenu = useCallback(() => {
164637
165555
  setSelected(true);
@@ -164863,13 +165781,13 @@ const TablePagination = ({
164863
165781
  prevPageClick,
164864
165782
  pageCount,
164865
165783
  pageNo,
164866
- pageType,
165784
+ paginationType,
164867
165785
  updatePageNo,
164868
165786
  tableSizes,
164869
165787
  theme
164870
165788
  }) => {
164871
- switch (pageType) {
164872
- case PaginationTypes.SERVER_SIDE:
165789
+ switch (paginationType) {
165790
+ case "server_side":
164873
165791
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
164874
165792
  TableServerPagination,
164875
165793
  {
@@ -164880,7 +165798,7 @@ const TablePagination = ({
164880
165798
  themeColors: theme.colors
164881
165799
  }
164882
165800
  );
164883
- case PaginationTypes.CLIENT_SIDE:
165801
+ case "client_side":
164884
165802
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
164885
165803
  TableClientPagination,
164886
165804
  {
@@ -164964,11 +165882,11 @@ const TableFooter = ({
164964
165882
  prevPageClick,
164965
165883
  pageNo,
164966
165884
  pageCount,
164967
- pageType,
165885
+ paginationType,
164968
165886
  tableColumns,
164969
165887
  tableData,
164970
165888
  filteredOrderMap,
164971
- tableHeader,
165889
+ header,
164972
165890
  tableSizes,
164973
165891
  borderColor,
164974
165892
  updatePageNo,
@@ -165132,11 +166050,11 @@ const TableFooter = ({
165132
166050
  columns: tableColumns,
165133
166051
  widgetName,
165134
166052
  tableSizes,
165135
- tableHeader,
166053
+ header,
165136
166054
  tableCellTextStyle
165137
166055
  }
165138
166056
  ),
165139
- pageType !== PaginationTypes.SERVER_SIDE && /* @__PURE__ */ jsxRuntimeExports.jsxs(
166057
+ paginationType !== "server_side" && /* @__PURE__ */ jsxRuntimeExports.jsxs(
165140
166058
  RowWrapper,
165141
166059
  {
165142
166060
  className: `${CLASS_NAMES.BUILTIN_BODY} show-page-items`,
@@ -165158,7 +166076,7 @@ const TableFooter = ({
165158
166076
  prevPageClick,
165159
166077
  pageNo,
165160
166078
  pageCount,
165161
- pageType,
166079
+ paginationType,
165162
166080
  currentPageIndex,
165163
166081
  tableSizes,
165164
166082
  theme
@@ -167233,8 +168151,9 @@ const DescendingIcon = qe$1(SvgSort)`
167233
168151
  }
167234
168152
  `;
167235
168153
  const TableHeaderCell = (props) => {
167236
- var _a2, _b2, _c2;
168154
+ var _a2;
167237
168155
  const { column: column2, selectRows } = props;
168156
+ const resizerProps = column2.getResizerProps();
167238
168157
  const resizingColumnId = useRef("");
167239
168158
  const handleSortColumn = () => {
167240
168159
  if (!props.isSortable || props.isResizingColumn) return;
@@ -167250,7 +168169,6 @@ const TableHeaderCell = (props) => {
167250
168169
  defaultTextStyleVariant: TABLE_COLUMN_HEADER_DEFAULT_TYPOGRAPHY,
167251
168170
  textStyle: props.columnHeaderProps
167252
168171
  });
167253
- const columnHeaderTextStyleHasTextTransform = ((_a2 = columnHeaderStyleProps == null ? void 0 : columnHeaderStyleProps.style) == null ? void 0 : _a2.textTransform) !== void 0 && ((_b2 = columnHeaderStyleProps == null ? void 0 : columnHeaderStyleProps.style) == null ? void 0 : _b2.textTransform) !== "none";
167254
168172
  const { setColumnFilter } = props;
167255
168173
  const setFilter = useCallback(
167256
168174
  (filter2) => {
@@ -167312,7 +168230,6 @@ const TableHeaderCell = (props) => {
167312
168230
  HeaderCellContentWrapper,
167313
168231
  {
167314
168232
  columnProperties: props.columnProperties,
167315
- shouldCapitalize: !columnHeaderTextStyleHasTextTransform && props.columnName === column2.id,
167316
168233
  style: columnHeaderStyleProps.style,
167317
168234
  className: `${getTextCssClassFromVariant(
167318
168235
  columnHeaderStyleProps.textStyleVariant
@@ -167338,23 +168255,23 @@ const TableHeaderCell = (props) => {
167338
168255
  e3.stopPropagation();
167339
168256
  },
167340
168257
  onDragOver: (e3) => {
167341
- var _a3, _b3;
168258
+ var _a3, _b2;
167342
168259
  if (props.columnIndex !== props.mutableHeaderDragRef.current && props.mutableHeaderDragRef.current !== -1) {
167343
168260
  if (props.mutableHeaderDragRef.current > props.columnIndex) {
167344
168261
  (_a3 = parentRef.current) == null ? void 0 : _a3.classList.add("highlight-left");
167345
168262
  } else if (props.mutableHeaderDragRef.current < props.columnIndex) {
167346
- (_b3 = parentRef.current) == null ? void 0 : _b3.classList.add("highlight-right");
168263
+ (_b2 = parentRef.current) == null ? void 0 : _b2.classList.add("highlight-right");
167347
168264
  }
167348
168265
  }
167349
168266
  e3.preventDefault();
167350
168267
  },
167351
168268
  onDragEnter: (e3) => {
167352
- var _a3, _b3;
168269
+ var _a3, _b2;
167353
168270
  if (props.columnIndex !== props.mutableHeaderDragRef.current && props.mutableHeaderDragRef.current !== -1) {
167354
168271
  if (props.mutableHeaderDragRef.current > props.columnIndex) {
167355
168272
  (_a3 = parentRef.current) == null ? void 0 : _a3.classList.add("highlight-left");
167356
168273
  } else if (props.mutableHeaderDragRef.current < props.columnIndex) {
167357
- (_b3 = parentRef.current) == null ? void 0 : _b3.classList.add("highlight-right");
168274
+ (_b2 = parentRef.current) == null ? void 0 : _b2.classList.add("highlight-right");
167358
168275
  }
167359
168276
  }
167360
168277
  e3.preventDefault();
@@ -167406,7 +168323,7 @@ const TableHeaderCell = (props) => {
167406
168323
  isFrozen: getIsColumnFrozen(
167407
168324
  props.column.id,
167408
168325
  props.columnFreezes,
167409
- (_c2 = props.columnProperties) == null ? void 0 : _c2.isFrozen
168326
+ (_a2 = props.columnProperties) == null ? void 0 : _a2.isFrozen
167410
168327
  ),
167411
168328
  theme: props.theme,
167412
168329
  updateProperty: props.updateProperty
@@ -167415,11 +168332,21 @@ const TableHeaderCell = (props) => {
167415
168332
  props.showResizer && /* @__PURE__ */ jsxRuntimeExports.jsx(
167416
168333
  "div",
167417
168334
  {
167418
- ...column2.getResizerProps(),
168335
+ ...resizerProps,
167419
168336
  className: `resizer ${column2.isResizing ? "isResizing" : ""}`,
167420
168337
  onClick: (e3) => {
167421
168338
  e3.preventDefault();
167422
168339
  e3.stopPropagation();
168340
+ },
168341
+ onMouseDown: (e3) => {
168342
+ resizerProps.onMouseDown(e3);
168343
+ e3.stopPropagation();
168344
+ e3.preventDefault();
168345
+ },
168346
+ onTouchStart: (e3) => {
168347
+ resizerProps.onTouchStart(e3);
168348
+ e3.stopPropagation();
168349
+ e3.preventDefault();
167423
168350
  }
167424
168351
  }
167425
168352
  )
@@ -168020,10 +168947,10 @@ const Table = (props) => {
168020
168947
  const selectedRowIndex = props.selectedRowIndex;
168021
168948
  const selectedRowIndices = props.selectedRowIndices || [];
168022
168949
  const canDelete = props.isDeletionEnabled && (selectedRowIndices.length > 0 || selectedRowIndex != null && selectedRowIndex >= 0);
168023
- const hasFooter = props.pageType !== PaginationTypes.NONE || props.isDownloadable || props.numEdits != null && props.numEdits > 0 || props.isInsertionEnabled || canDelete;
168024
- const hasHeader = props.isSearchable || !lodashExports.isEmpty(props.tableHeader) || props.hiddenColumns && ((_a2 = props.hiddenColumns) == null ? void 0 : _a2.length) > 0;
168025
- const pageSize = props.pageType === PaginationTypes.NONE ? props.tableData.length : props.pageSize;
168026
- const pageCount = Math.ceil(props.tableData.length / pageSize);
168950
+ const hasFooter = props.paginationType !== "none" || props.isDownloadable || props.numEdits != null && props.numEdits > 0 || props.isInsertionEnabled || canDelete;
168951
+ const hasHeader = props.isSearchable || !lodashExports.isEmpty(props.header) || props.hiddenColumns && ((_a2 = props.hiddenColumns) == null ? void 0 : _a2.length) > 0;
168952
+ const pageSize = props.paginationType === "none" ? props.tableData.length : props.pageSize;
168953
+ const pageCount = Math.ceil(props.tableData.length / pageSize) || 1;
168027
168954
  const currentPageIndex = props.pageNo < pageCount ? props.pageNo : 0;
168028
168955
  const {
168029
168956
  getTableProps,
@@ -168053,7 +168980,7 @@ const Table = (props) => {
168053
168980
  );
168054
168981
  let startIndex = currentPageIndex * pageSize;
168055
168982
  let endIndex = startIndex + pageSize;
168056
- if (props.pageType === PaginationTypes.SERVER_SIDE) {
168983
+ if (props.paginationType === "server_side") {
168057
168984
  startIndex = 0;
168058
168985
  endIndex = props.tableData.length;
168059
168986
  }
@@ -168604,7 +169531,7 @@ const Table = (props) => {
168604
169531
  showFrozenColShadow,
168605
169532
  tabIndex: 0,
168606
169533
  className: CLASS_NAMES.DEFAULT_CONTAINER,
168607
- showColumnBorders: props.showColumnBorders && (props.pageType !== PaginationTypes.NONE || subPage.length > 0),
169534
+ showColumnBorders: props.showColumnBorders && (props.paginationType !== "none" || subPage.length > 0),
168608
169535
  colors: theme.colors,
168609
169536
  onKeyDown: handleKeyDown,
168610
169537
  "data-selecting-cells": tableManager.focusedCellIndices.length > 0,
@@ -168619,7 +169546,7 @@ const Table = (props) => {
168619
169546
  searchKey: props.searchKey,
168620
169547
  tableSizes,
168621
169548
  compactMode: getCompactMode(props.compactMode),
168622
- title: props.tableHeader,
169549
+ title: props.header,
168623
169550
  columns: props.columns,
168624
169551
  hiddenColumns: props.hiddenColumns,
168625
169552
  searchPlaceholder: props.searchPlaceholder,
@@ -168692,7 +169619,7 @@ const Table = (props) => {
168692
169619
  columnProperties: column2.columnProperties,
168693
169620
  rawTableData: props.rawTableData,
168694
169621
  transformedTableData: props.tableData,
168695
- isFilterable: props.isFilterable && props.pageType !== PaginationTypes.SERVER_SIDE,
169622
+ isFilterable: props.isFilterable && props.paginationType !== "server_side",
168696
169623
  filter: (_b3 = (_a3 = props.filters) == null ? void 0 : _a3.byColumn) == null ? void 0 : _b3[column2.id],
168697
169624
  setColumnFilter: props.setColumnFilter,
168698
169625
  isHidden: column2.isHidden,
@@ -168768,11 +169695,11 @@ const Table = (props) => {
168768
169695
  prevPageClick: props.prevPageClick,
168769
169696
  pageNo: props.pageNo,
168770
169697
  pageCount,
168771
- pageType: props.pageType,
169698
+ paginationType: props.paginationType,
168772
169699
  tableColumns: props.columns,
168773
169700
  tableData: props.tableData,
168774
169701
  filteredOrderMap: props.filteredOrderMap,
168775
- tableHeader: props.tableHeader,
169702
+ header: props.header,
168776
169703
  tableSizes,
168777
169704
  updatePageNo: props.updatePageNo,
168778
169705
  widgetName: props.widgetName,
@@ -169397,14 +170324,14 @@ const _TableWidget = class _TableWidget extends React__default.Component {
169397
170324
  __publicField(this, "getTopVisibleIndex", () => {
169398
170325
  const page = this.props.pageNo || 1;
169399
170326
  const pageSize = this.props.pageSize || 1;
169400
- const isPaginated = this.props.pageType !== PaginationTypes.NONE;
170327
+ const isPaginated = this.props.paginationType !== "none";
169401
170328
  return isPaginated ? (page - 1) * pageSize : 0;
169402
170329
  });
169403
170330
  __publicField(this, "getBottomVisibleIndex", () => {
169404
170331
  const allEdits = this.props.allEdits ?? [];
169405
170332
  const page = this.props.pageNo || 1;
169406
170333
  const pageSize = this.props.pageSize || 1;
169407
- const isPaginated = this.props.pageType !== PaginationTypes.NONE;
170334
+ const isPaginated = this.props.paginationType !== "none";
169408
170335
  return isPaginated ? Math.min(allEdits.length - 1, page * pageSize - 1) : allEdits.length - 1;
169409
170336
  });
169410
170337
  __publicField(this, "handlePaste", (event) => {
@@ -169464,7 +170391,7 @@ const _TableWidget = class _TableWidget extends React__default.Component {
169464
170391
  );
169465
170392
  const data2 = [];
169466
170393
  let largestRow = 0;
169467
- const isMultiPage = this.props.pageType === PaginationTypes.SERVER_SIDE || this.props.pageType === PaginationTypes.CLIENT_SIDE;
170394
+ const isMultiPage = this.props.paginationType === "server_side" || this.props.paginationType === "client_side";
169468
170395
  const page = this.props.pageNo || 1;
169469
170396
  const pageSize = this.props.pageSize || 1;
169470
170397
  for (const cell of this.currentCellFocus ?? []) {
@@ -169582,6 +170509,7 @@ const _TableWidget = class _TableWidget extends React__default.Component {
169582
170509
  }
169583
170510
  });
169584
170511
  __publicField(this, "handleEditStart", (rowIndex, columnId, startingValue) => {
170512
+ this.props.disableDrag(true);
169585
170513
  this.props.disableNudge(true);
169586
170514
  this.props.setCurrentEditFocus({ row: rowIndex, columnId }, startingValue);
169587
170515
  });
@@ -169898,7 +170826,7 @@ const _TableWidget = class _TableWidget extends React__default.Component {
169898
170826
  }
169899
170827
  if (relativePosition === tableData.length) {
169900
170828
  setTimeout(() => {
169901
- if (this.props.pageType === PaginationTypes.NONE) {
170829
+ if (this.props.paginationType === "none") {
169902
170830
  const tableScroller = this.getTableScroller();
169903
170831
  tableScroller == null ? void 0 : tableScroller.scrollTo({
169904
170832
  top: (tableScroller == null ? void 0 : tableScroller.scrollHeight) + 40,
@@ -170373,7 +171301,7 @@ const _TableWidget = class _TableWidget extends React__default.Component {
170373
171301
  columnSizeMap: this.props.columnSizeMap,
170374
171302
  pageNo,
170375
171303
  pageSize: Math.max(1, pageSize),
170376
- pageType: this.props.pageType || PaginationTypes.CLIENT_SIDE,
171304
+ paginationType: this.props.paginationType || "none",
170377
171305
  selectedRowIndex: this.props.multiRowSelection ? -1 : this.props.selectedRowIndex ?? -1,
170378
171306
  multiRowSelection: this.props.multiRowSelection,
170379
171307
  selectedRowIndices: this.getComputedSelectedRowIndices(),
@@ -170385,19 +171313,18 @@ const _TableWidget = class _TableWidget extends React__default.Component {
170385
171313
  handleResizeColumn: this.handleResizeColumn,
170386
171314
  updatePageNo: this.updatePageNumber,
170387
171315
  handleReorderColumn: this.handleReorderColumn,
170388
- disableDrag: () => {
170389
- },
171316
+ disableDrag: this.props.disableDrag,
170390
171317
  searchTableData: this.handleSearchTable,
170391
171318
  filters: this.props.filters,
170392
171319
  setColumnFilter: this.handleSetColumnFilter,
170393
171320
  compactMode: getCompactMode(this.props.compactMode),
170394
171321
  showColumnBorders: this.props.showColumnBorders,
170395
171322
  sortTableColumn: this.handleColumnSorting,
170396
- isSortable: this.props.pageType !== PaginationTypes.SERVER_SIDE,
171323
+ isSortable: this.props.paginationType !== "server_side",
170397
171324
  isSearchable: this.props.isSearchable,
170398
171325
  isDownloadable: this.props.isDownloadable,
170399
171326
  isFilterable: this.props.isFilterable,
170400
- tableHeader: this.props.tableHeader,
171327
+ header: this.props.header,
170401
171328
  hiddenColumns: this.props.hiddenColumns ?? [],
170402
171329
  columnFreezes: this.props.columnFreezes ?? {},
170403
171330
  numEdits,
@@ -170513,6 +171440,7 @@ const SbTable = registerSbComponent(
170513
171440
  propertiesDefinition: propertiesDefinition$9
170514
171441
  },
170515
171442
  (props) => {
171443
+ var _a2;
170516
171444
  const { update } = useActions();
170517
171445
  const { features } = useEditor();
170518
171446
  const { theme } = useTheme();
@@ -170549,7 +171477,8 @@ const SbTable = registerSbComponent(
170549
171477
  );
170550
171478
  const setPageNo = useCallback(
170551
171479
  (value, rowContext, triggerEventHandlers = false) => {
170552
- update((e3) => e3.pageNo = value);
171480
+ const newPageNo = Math.max(value - 1, 0);
171481
+ update((e3) => e3.pageNo = newPageNo);
170553
171482
  if (triggerEventHandlers) {
170554
171483
  onPageChange == null ? void 0 : onPageChange(rowContext);
170555
171484
  }
@@ -170665,9 +171594,9 @@ const SbTable = registerSbComponent(
170665
171594
  return [
170666
171595
  key22,
170667
171596
  async (args) => {
170668
- var _a2;
171597
+ var _a3;
170669
171598
  await (value == null ? void 0 : value(args.context));
170670
- (_a2 = args.onComplete) == null ? void 0 : _a2.call(args);
171599
+ (_a3 = args.onComplete) == null ? void 0 : _a3.call(args);
170671
171600
  }
170672
171601
  ];
170673
171602
  }
@@ -170685,27 +171614,59 @@ const SbTable = registerSbComponent(
170685
171614
  },
170686
171615
  [features.nudging]
170687
171616
  );
171617
+ const [pageSize, setPageSize] = useState(props.configuredPageSize);
171618
+ useEffect(() => {
171619
+ setPageSize(props.configuredPageSize);
171620
+ }, [props.configuredPageSize]);
171621
+ const autoPageSize = useMemo$2(() => {
171622
+ var _a3, _b2;
171623
+ if (typeof pageSize === "number" && pageSize > 0) return pageSize;
171624
+ if (((_a3 = props.height) == null ? void 0 : _a3.mode) === "px" && typeof props.height.value === "number") {
171625
+ const compactMode = getCompactMode(props.compactMode);
171626
+ const tableSizes = TABLE_SIZES[compactMode];
171627
+ const componentHeight = props.height.value;
171628
+ const headerHeight = props.isSearchable || props.tableHeader || ((_b2 = props.hiddenColumns) == null ? void 0 : _b2.length) > 0 ? tableSizes.TABLE_HEADER_HEIGHT : 0;
171629
+ const scrollbarSize = 8;
171630
+ const mainHeight = componentHeight - headerHeight - scrollbarSize - tableSizes.TABLE_FOOTER_HEIGHT - tableSizes.COLUMN_HEADER_HEIGHT;
171631
+ return Math.floor(mainHeight / (tableSizes.ROW_HEIGHT + 1));
171632
+ }
171633
+ return 10;
171634
+ }, [
171635
+ pageSize,
171636
+ props.height,
171637
+ props.compactMode,
171638
+ (_a2 = props.hiddenColumns) == null ? void 0 : _a2.length,
171639
+ props.isSearchable,
171640
+ props.tableHeader
171641
+ ]);
171642
+ const disableDrag = useCallback(
171643
+ (disable) => {
171644
+ features.dragAndDrop.set(!disable);
171645
+ },
171646
+ [features.dragAndDrop]
171647
+ );
170688
171648
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ...passthroughProps, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
170689
171649
  TableWidget,
170690
171650
  {
170691
171651
  ...props,
171652
+ pageSize: autoPageSize,
170692
171653
  enableRowInsertion: false,
170693
171654
  enableRowDeletion: false,
170694
- defaultSearchText: props.defaultSearchText ?? "",
170695
171655
  searchPlaceholder: props.searchPlaceholder ?? "",
170696
171656
  searchText: props.searchText ?? "",
170697
- pageType: props.pageType,
171657
+ paginationType: props.paginationType,
170698
171658
  columns: transformedColumns,
170699
- defaultFilters: props.defaultFilters ?? EMPTY_OBJ,
170700
- tableHeader: props.tableHeader ?? "",
171659
+ filters: props.filters ?? EMPTY_OBJ,
171660
+ header: props.header ?? "",
170701
171661
  tableData: props.tableData ?? EMPTY_ARRAY,
170702
171662
  currentEditDropdownSearchText: props.currentEditDropdownSearchText,
170703
171663
  selectedRowIndices: props.selectedRowIndices ?? EMPTY_ARRAY,
170704
171664
  showColumnBorders: props.showColumnBorders ?? false,
170705
171665
  compactMode: getCompactMode(props.compactMode),
170706
- border: props.border ?? theme.defaultBorder,
171666
+ border: props.border ?? createPerSideBorder(theme.defaultBorder),
170707
171667
  borderRadius: props.borderRadius ?? theme.defaultBorder.borderRadius,
170708
171668
  disableNudge,
171669
+ disableDrag,
170709
171670
  setSelectedRowData,
170710
171671
  setPageNo,
170711
171672
  setColumnOrder,
@@ -173149,6 +174110,10 @@ const StyledSingleDropDown = qe$1(SingleDropDown)`
173149
174110
  display: -webkit-box;
173150
174111
  -webkit-line-clamp: 1;
173151
174112
  -webkit-box-orient: vertical;
174113
+
174114
+ &:disabled {
174115
+ cursor: not-allowed;
174116
+ }
173152
174117
  }
173153
174118
  `;
173154
174119
  const StyledCrossIcon = qe$1(SvgCrossXs)`
@@ -173630,7 +174595,8 @@ class DropDownComponent extends React__default.PureComponent {
173630
174595
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(DynamicSVG, { iconName: this.props.icon, size: this.props.iconSize })
173631
174596
  }
173632
174597
  ) : null;
173633
- const singleSelectDropdownIconElement = selectedIndex > -1 && ((_c2 = this.props.options[selectedIndex]) == null ? void 0 : _c2.icon) ? /* @__PURE__ */ jsxRuntimeExports.jsx(
174598
+ const selectedItemHasIcon = !!(selectedIndex > -1 && ((_c2 = this.props.options[selectedIndex]) == null ? void 0 : _c2.icon));
174599
+ const singleSelectDropdownIconElement = selectedItemHasIcon ? /* @__PURE__ */ jsxRuntimeExports.jsx(
173634
174600
  StyledIconSpan,
173635
174601
  {
173636
174602
  className: this.getIconClassNames(
@@ -173639,7 +174605,13 @@ class DropDownComponent extends React__default.PureComponent {
173639
174605
  style: {
173640
174606
  left: ((_e2 = (_d2 = this.props.inputPadding) == null ? void 0 : _d2.left) == null ? void 0 : _e2.value) ?? 0
173641
174607
  },
173642
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(DynamicSVG, { iconName: this.props.options[selectedIndex].icon })
174608
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
174609
+ DynamicSVG,
174610
+ {
174611
+ iconName: this.props.options[selectedIndex].icon,
174612
+ size: this.props.iconSize
174613
+ }
174614
+ )
173643
174615
  }
173644
174616
  ) : defaultIconElement;
173645
174617
  const tagOptionIconElement = (tagIndex) => {
@@ -173650,7 +174622,7 @@ class DropDownComponent extends React__default.PureComponent {
173650
174622
  return null;
173651
174623
  };
173652
174624
  const paddingVarDeclarations = createCssVariablesForPadding(
173653
- !!this.props.icon,
174625
+ !!this.props.icon || selectedItemHasIcon,
173654
174626
  this.props.inputPadding,
173655
174627
  this.props.iconSize
173656
174628
  );
@@ -173769,6 +174741,7 @@ class DropDownComponent extends React__default.PureComponent {
173769
174741
  /* @__PURE__ */ jsxRuntimeExports.jsx(
173770
174742
  MultiDropDown,
173771
174743
  {
174744
+ disabled: this.props.disabled,
173772
174745
  overflowTags: this.props.overflowTags,
173773
174746
  items: this.props.options,
173774
174747
  labelHeight: this.props.vertical ? 26 : 0,
@@ -173941,22 +174914,7 @@ const propertiesDefinition$8 = {
173941
174914
  })
173942
174915
  }),
173943
174916
  appearance: Section.category(PropsPanelCategory.Appearance).children({
173944
- labelPosition: Prop.string().readAndWrite().default("top").propertiesPanel({
173945
- label: "Label position",
173946
- controlType: "RADIO_BUTTON_GROUP",
173947
- options: [
173948
- {
173949
- icon: "ICON_LEFT_ALIGN",
173950
- value: "left",
173951
- label: "Beside"
173952
- },
173953
- {
173954
- icon: "VERTICAL_TOP",
173955
- value: "top",
173956
- label: "Above"
173957
- }
173958
- ]
173959
- }),
174917
+ labelPosition: labelPosition(),
173960
174918
  labelStyle: labelTextStyle(),
173961
174919
  icon: Prop.string().propertiesPanel({
173962
174920
  label: "Icon",
@@ -173978,13 +174936,16 @@ const propertiesDefinition$8 = {
173978
174936
  }),
173979
174937
  layout: Section.category(PropsPanelCategory.Layout).add(padding({ themeValue: DROPDOWN_PADDING, default: DROPDOWN_PADDING })).add(size$2()).add(margin()).add(visible()),
173980
174938
  interaction: Section.category(PropsPanelCategory.Interaction).children({
173981
- isMultiple: Prop.boolean().readAndWrite().default(false).propertiesPanel({
174939
+ multiselect: Prop.boolean().readAndWrite().default(false).propertiesPanel({
173982
174940
  label: "Multi-select",
173983
174941
  helpText: "Allows users to select either a single option or multiple options"
173984
174942
  }),
173985
174943
  allowSelectAll: Prop.boolean().readAndWrite().default(false).propertiesPanel({
173986
174944
  label: "Select/Deselect all",
173987
- helpText: "Enable a button to select/deselect all options"
174945
+ helpText: "Enable a button to select/deselect all options",
174946
+ isVisible: function() {
174947
+ return this.multiselect;
174948
+ }
173988
174949
  }),
173989
174950
  allowClearing: Prop.boolean().readAndWrite().default(false).propertiesPanel({
173990
174951
  label: "Clearable",
@@ -174029,7 +174990,7 @@ const propertiesDefinition$8 = {
174029
174990
  }),
174030
174991
  derived: Section.category(PropsPanelCategory.Derived).children({
174031
174992
  value: Prop.any().readable().default(function() {
174032
- return this.isMultiple ? this.selectedOptionArr : this.selectedOptionValue;
174993
+ return this.multiselect ? this.selectedOptionArr : this.selectedOptionValue;
174033
174994
  }),
174034
174995
  defaultTransformation: Prop.any().readable().default(function() {
174035
174996
  if (!Array.isArray(this.options)) return;
@@ -174085,9 +175046,9 @@ const propertiesDefinition$8 = {
174085
175046
  validationErrors: Prop.any().readable().default(function() {
174086
175047
  const errors2 = {};
174087
175048
  if (this.isRequired) {
174088
- if (this.isMultiple && this.selectedIndexArr && this.selectedIndexArr.length === 0) {
175049
+ if (this.multiselect && this.selectedIndexArr && this.selectedIndexArr.length === 0) {
174089
175050
  errors2.isRequired = "Required";
174090
- } else if (!this.isMultiple && !this.selectedOption) {
175051
+ } else if (!this.multiselect && !this.selectedOption) {
174091
175052
  errors2.isRequired = "Required";
174092
175053
  }
174093
175054
  }
@@ -174098,7 +175059,7 @@ const propertiesDefinition$8 = {
174098
175059
  }),
174099
175060
  selectedOptionValue: Prop.any().readable().default(function() {
174100
175061
  var _a2;
174101
- if (this.isMultiple) return;
175062
+ if (this.multiselect) return;
174102
175063
  const normalizedValue = normalizeFunction(
174103
175064
  this.metaSelectedOptionValue,
174104
175065
  (_a2 = this.transformation) == null ? void 0 : _a2.value
@@ -174113,7 +175074,7 @@ const propertiesDefinition$8 = {
174113
175074
  }
174114
175075
  }),
174115
175076
  selectedOptionValues: Prop.any().readable().default(function() {
174116
- if (!this.isMultiple) return;
175077
+ if (!this.multiselect) return;
174117
175078
  const normalize2 = (val) => {
174118
175079
  var _a2;
174119
175080
  return normalizeFunction(val, (_a2 = this.transformation) == null ? void 0 : _a2.value);
@@ -174134,7 +175095,7 @@ const propertiesDefinition$8 = {
174134
175095
  }),
174135
175096
  selectedOption: Prop.any().readable().default(function() {
174136
175097
  var _a2;
174137
- if (this.isMultiple) return;
175098
+ if (this.multiselect) return;
174138
175099
  const normalizedValue = normalizeFunction(
174139
175100
  this.metaSelectedOptionValue,
174140
175101
  (_a2 = this.transformation) == null ? void 0 : _a2.value
@@ -174144,7 +175105,7 @@ const propertiesDefinition$8 = {
174144
175105
  );
174145
175106
  }),
174146
175107
  selectedOptionArr: Prop.any().readable().default(function() {
174147
- if (!this.isMultiple) return;
175108
+ if (!this.multiselect) return;
174148
175109
  const normalize2 = (val) => {
174149
175110
  var _a2;
174150
175111
  return normalizeFunction(val, (_a2 = this.transformation) == null ? void 0 : _a2.value);
@@ -174160,7 +175121,7 @@ const propertiesDefinition$8 = {
174160
175121
  }),
174161
175122
  selectedIndex: Prop.number().readable().default(function() {
174162
175123
  var _a2;
174163
- if (this.isMultiple) return;
175124
+ if (this.multiselect) return;
174164
175125
  const normalizedValue = normalizeFunction(
174165
175126
  this.metaSelectedOptionValue,
174166
175127
  (_a2 = this.transformation) == null ? void 0 : _a2.value
@@ -174270,20 +175231,20 @@ const SbDropdown = registerSbComponent(
174270
175231
  },
174271
175232
  [props.isTouched, update]
174272
175233
  );
174273
- const { isMultiple: isMultiple2, onOptionChange: propOnOptionChange } = props;
175234
+ const { multiselect, onOptionChange: propOnOptionChange } = props;
174274
175235
  const onOptionSelected = useCallback(
174275
175236
  (selectedOption) => {
174276
175237
  if (selectedOption === null) {
174277
175238
  if (props.selectedOption) {
174278
175239
  update((e3) => e3.metaSelectedOptionValue = -1);
174279
- if (!isMultiple2) {
175240
+ if (!multiselect) {
174280
175241
  onClear();
174281
175242
  }
174282
175243
  }
174283
175244
  return;
174284
175245
  }
174285
175246
  let isChanged = true;
174286
- if (!isMultiple2) {
175247
+ if (!multiselect) {
174287
175248
  if (props.selectedOption) {
174288
175249
  isChanged = !lodashExports.isEqual(
174289
175250
  normalize2(props.selectedOption.value),
@@ -174315,7 +175276,7 @@ const SbDropdown = registerSbComponent(
174315
175276
  }
174316
175277
  },
174317
175278
  [
174318
- isMultiple2,
175279
+ multiselect,
174319
175280
  props.isTouched,
174320
175281
  props.selectedOption,
174321
175282
  propOnOptionChange,
@@ -174424,7 +175385,7 @@ const SbDropdown = registerSbComponent(
174424
175385
  onFocusChange: handleFocusChange,
174425
175386
  onSearchTextChange: onDebouncedSearchTextChange
174426
175387
  };
174427
- return /* @__PURE__ */ jsxRuntimeExports.jsx(DropdownContainer, { ...passthroughProps, children: /* @__PURE__ */ jsxRuntimeExports.jsx(DropdownStyleOverrides, { vertical: props.labelPosition === "top", children: props.isMultiple ? /* @__PURE__ */ jsxRuntimeExports.jsx(
175388
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(DropdownContainer, { ...passthroughProps, children: /* @__PURE__ */ jsxRuntimeExports.jsx(DropdownStyleOverrides, { vertical: props.labelPosition === "top", children: props.multiselect ? /* @__PURE__ */ jsxRuntimeExports.jsx(
174428
175389
  DropDownComponent,
174429
175390
  {
174430
175391
  ...commonProps,
@@ -174729,17 +175690,6 @@ const SbCheckbox = registerSbComponent(
174729
175690
  ) });
174730
175691
  }
174731
175692
  );
174732
- const getPreviousAndCurrentWidgetProps = (updates, widgetMeta) => {
174733
- const previousProps = widgetMeta.props;
174734
- const newProps = Object.entries(updates).reduce(
174735
- (acc, [key2, value]) => {
174736
- acc[key2] = value.value;
174737
- return acc;
174738
- },
174739
- { ...previousProps }
174740
- );
174741
- return [previousProps, newProps];
174742
- };
174743
175693
  const adjustDateFormatSideEffect = (params) => {
174744
175694
  const widgetMeta = params.widgetMeta;
174745
175695
  const widgetState = params.widgetState;
@@ -174824,13 +175774,20 @@ const propertiesDefinition$6 = {
174824
175774
  visibility: "SHOW_NAME"
174825
175775
  }),
174826
175776
  defaultDate: Prop.string().propertiesPanel({
174827
- label: "Default date",
175777
+ controlType: "DATE_PICKER",
175778
+ defaultOnAdd: function() {
175779
+ if (this.manageTimezone) {
175780
+ return moment().tz(this.valueTimezone || moment.tz.guess()).format(this.dateFormat);
175781
+ }
175782
+ return moment().format(this.dateFormat);
175783
+ },
174828
175784
  helpText: "Sets the default date of the component. The date is updated if the default date changes",
175785
+ isRemovable: true,
175786
+ label: "Default date",
174829
175787
  placeholder: "Enter default date",
174830
- controlType: "DATE_PICKER",
174831
- isRemovable: true
175788
+ visibility: "SHOW_NAME"
174832
175789
  }).onEdit(adjustDateFormatSideEffect),
174833
- dateFormat: Prop.string().readAndWrite().default("YYYY-MM-DDTHH:mm:ss.sssZ").propertiesPanel({
175790
+ dateFormat: Prop.string().readAndWrite().default(ISO_DATE_FORMAT).propertiesPanel({
174834
175791
  label: "Value format",
174835
175792
  helpText: "Sets the format of the selected date",
174836
175793
  controlType: "DROP_DOWN",
@@ -174880,22 +175837,7 @@ const propertiesDefinition$6 = {
174880
175837
  }),
174881
175838
  layout: basicLayout(),
174882
175839
  appearance: Section.category(PropsPanelCategory.Appearance).children({
174883
- labelPosition: Prop.string().readAndWrite().default("top").propertiesPanel({
174884
- label: "Label position",
174885
- controlType: "RADIO_BUTTON_GROUP",
174886
- options: [
174887
- {
174888
- icon: "ICON_LEFT_ALIGN",
174889
- value: "left",
174890
- label: "Beside"
174891
- },
174892
- {
174893
- icon: "VERTICAL_TOP",
174894
- value: "top",
174895
- label: "Above"
174896
- }
174897
- ]
174898
- }),
175840
+ labelPosition: labelPosition(),
174899
175841
  labelStyle: labelTextStyle(),
174900
175842
  // TODO(code-mode): Add color pickers, border controls, etc.
174901
175843
  icon: Prop.string().readAndWrite().default("calendar_today").propertiesPanel({
@@ -174958,16 +175900,16 @@ const propertiesDefinition$6 = {
174958
175900
  if (this.isRequired && !this.selectedDate) {
174959
175901
  errors2.isRequired = "Required";
174960
175902
  }
174961
- if (this.selectedDate && this.dateFormat && !hooks(this.selectedDate, this.dateFormat, true).isValid()) {
175903
+ if (this.selectedDate && this.dateFormat && !moment(this.selectedDate, this.dateFormat, true).isValid()) {
174962
175904
  errors2.dateInvalid = "Invalid date";
174963
175905
  }
174964
- if (this.minDate && this.selectedDate && hooks(this.selectedDate, this.dateFormat).isBefore(
174965
- hooks(this.minDate, this.dateFormat)
175906
+ if (this.minDate && this.selectedDate && moment(this.selectedDate, this.dateFormat).isBefore(
175907
+ moment(this.minDate, this.dateFormat)
174966
175908
  )) {
174967
175909
  errors2.minDate = "Date must be greater than or equal to " + this.minDate;
174968
175910
  }
174969
- if (this.maxDate && this.selectedDate && hooks(this.selectedDate, this.dateFormat).isAfter(
174970
- hooks(this.maxDate, this.dateFormat)
175911
+ if (this.maxDate && this.selectedDate && moment(this.selectedDate, this.dateFormat).isAfter(
175912
+ moment(this.maxDate, this.dateFormat)
174971
175913
  )) {
174972
175914
  errors2.maxDate = "Date must be less than or equal to " + this.maxDate;
174973
175915
  }
@@ -174980,12 +175922,12 @@ const propertiesDefinition$6 = {
174980
175922
  return Object.keys(this.validationErrors ?? {}).length === 0;
174981
175923
  }),
174982
175924
  outputDateLocal: Prop.string().readable().default(function() {
174983
- return hooks(this.selectedDate, this.dateFormat).format(
175925
+ return moment(this.selectedDate, this.dateFormat).format(
174984
175926
  "YYYY-MM-DDTHH:mm:ss.SSSZ"
174985
175927
  );
174986
175928
  }),
174987
175929
  outputDateUtc: Prop.string().readable().default(function() {
174988
- return hooks(this.selectedDate, this.dateFormat).toISOString();
175930
+ return moment(this.selectedDate, this.dateFormat).toISOString();
174989
175931
  }),
174990
175932
  showError: Prop.boolean().readable().default(function() {
174991
175933
  const hasValue2 = !!this.value;
@@ -175135,7 +176077,7 @@ const propertiesDefinition$5 = {
175135
176077
  })
175136
176078
  }),
175137
176079
  derived: Section.category(PropsPanelCategory.Derived).children({
175138
- value: Prop.boolean().readable().default(function() {
176080
+ isToggledOn: Prop.boolean().readable().default(function() {
175139
176081
  return this.isChecked;
175140
176082
  }),
175141
176083
  validationErrors: Prop.any().readable().default(function() {
@@ -175181,6 +176123,7 @@ const SwitchComponentGroup = styleAsClass`
175181
176123
  flex-direction: column;
175182
176124
  gap: 2px;
175183
176125
  justify-content: space-between;
176126
+ max-width: 100%;
175184
176127
  `;
175185
176128
  const SwitchContainerClassName = styleAsClass`
175186
176129
  display: flex;
@@ -175371,11 +176314,9 @@ const propertiesDefinition$4 = {
175371
176314
  })
175372
176315
  }).add(margin()).add(visible()),
175373
176316
  appearance: Section.category(PropsPanelCategory.Appearance).children({
175374
- color: Prop.string().readAndWrite().propertiesPanel({
176317
+ color: colorProp({
175375
176318
  label: "Color",
175376
- controlType: "COLOR_PICKER",
175377
176319
  helpText: "Changes the color of the icon"
175378
- // themeValue:"{{ theme.colors.neutral700 }}",
175379
176320
  }),
175380
176321
  animateLoading: Prop.boolean().readAndWrite().default(true).propertiesPanel({
175381
176322
  label: "Loading animation",
@@ -175592,9 +176533,8 @@ const propertiesDefinition$3 = {
175592
176533
  })
175593
176534
  }),
175594
176535
  appearance: Section.category(PropsPanelCategory.Appearance).children({
175595
- backgroundColor: Prop.string().readAndWrite().propertiesPanel({
176536
+ backgroundColor: colorProp({
175596
176537
  label: "Background",
175597
- controlType: "COLOR_PICKER",
175598
176538
  helpText: "Changes the color of the background"
175599
176539
  }),
175600
176540
  border: border(),
@@ -176766,6 +177706,11 @@ const EmbedWrapper = (props) => {
176766
177706
  "sb-create-component",
176767
177707
  createComponentListener
176768
177708
  );
177709
+ const globalSyncListener = (event) => {
177710
+ const { global: global2 } = event.data.payload;
177711
+ updateGlobalScope(global2);
177712
+ };
177713
+ iframeMessageHandler.addEventListener("sb-global-sync", globalSyncListener);
176769
177714
  return () => {
176770
177715
  iframeMessageHandler.removeEventListener(
176771
177716
  "sb-bootstrap-response",
@@ -176787,6 +177732,10 @@ const EmbedWrapper = (props) => {
176787
177732
  "sb-create-component",
176788
177733
  createComponentListener
176789
177734
  );
177735
+ iframeMessageHandler.removeEventListener(
177736
+ "sb-global-sync",
177737
+ globalSyncListener
177738
+ );
176790
177739
  };
176791
177740
  }, []);
176792
177741
  useEffect(() => {
@@ -178277,7 +179226,7 @@ const generateTextStyles = (textStyles, builtinTypographies, fallbackFont) => {
178277
179226
 
178278
179227
  .${CLASS_NAMES.INPUT} {
178279
179228
  input::placeholder,
178280
- textarea::placeholder {
179229
+ .${INPUT$1}::placeholder, textarea::placeholder {
178281
179230
  ${styleFromTextBlockWithColors(textStyles.inputPlaceholder)}
178282
179231
  }
178283
179232
  }
@@ -178405,7 +179354,7 @@ function applyThemeToIframe(generatedTheme) {
178405
179354
  const originalLog = console.log;
178406
179355
  console.log = (...args) => {
178407
179356
  const processedArgs = args.map((arg) => {
178408
- if (arg && typeof arg === "object" && getBindingIdentifier(arg)) {
179357
+ if (arg && typeof arg === "object" && (getBindingIdentifier(arg) || getBindingIdentifier(arg.bind ?? {}))) {
178409
179358
  return JSON.parse(JSON.stringify(arg));
178410
179359
  }
178411
179360
  return arg;
@@ -190031,4 +190980,4 @@ export {
190031
190980
  copyToClipboard as y,
190032
190981
  navigateTo as z
190033
190982
  };
190034
- //# sourceMappingURL=index-U8MX-8Hu.js.map
190983
+ //# sourceMappingURL=index-DWMz_Ohy.js.map