@superblocksteam/library 2.0.6-next.77 → 2.0.6-next.78

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 (26) hide show
  1. package/dist/{allPaths-DpSNY-0N.js → allPaths-B_vs0o-m.js} +2 -2
  2. package/dist/{allPaths-DpSNY-0N.js.map → allPaths-B_vs0o-m.js.map} +1 -1
  3. package/dist/{allPaths-CWcHm67Z.js → allPaths-BfJ-bKGt.js} +2 -2
  4. package/dist/{allPaths-CWcHm67Z.js.map → allPaths-BfJ-bKGt.js.map} +1 -1
  5. package/dist/{allPathsLoader-JnfELLa1.js → allPathsLoader-DX9JilCw.js} +3 -3
  6. package/dist/{allPathsLoader-Wyunhtdo.js.map → allPathsLoader-DX9JilCw.js.map} +1 -1
  7. package/dist/{allPathsLoader-Wyunhtdo.js → allPathsLoader-DmTEeMSZ.js} +3 -3
  8. package/dist/{allPathsLoader-JnfELLa1.js.map → allPathsLoader-DmTEeMSZ.js.map} +1 -1
  9. package/dist/{devtools-consolidated-DLUPZPVk.js → devtools-consolidated-CWXIC81a.js} +2 -2
  10. package/dist/{devtools-consolidated-DLUPZPVk.js.map → devtools-consolidated-CWXIC81a.js.map} +1 -1
  11. package/dist/{index-COENR0Wl.js → index-CFUi7uyC.js} +95 -53
  12. package/dist/{index-COENR0Wl.js.map → index-CFUi7uyC.js.map} +1 -1
  13. package/dist/index.js +2 -2
  14. package/dist/{splitPathsBySizeLoader-PMGtD99k.js → splitPathsBySizeLoader-Bu33O-BR.js} +2 -2
  15. package/dist/{splitPathsBySizeLoader-PMGtD99k.js.map → splitPathsBySizeLoader-Bu33O-BR.js.map} +1 -1
  16. package/dist/{splitPathsBySizeLoader-GKgHRKX5.js → splitPathsBySizeLoader-DYETI6Yi.js} +2 -2
  17. package/dist/{splitPathsBySizeLoader-GKgHRKX5.js.map → splitPathsBySizeLoader-DYETI6Yi.js.map} +1 -1
  18. package/dist-types/lib/internal-details/lib/evaluator/base-entity-manager.d.ts +2 -1
  19. package/dist-types/lib/internal-details/lib/evaluator/entity-manager.d.ts +2 -1
  20. package/dist-types/lib/triggers/implementations/show-alert.d.ts +1 -1
  21. package/dist-types/lib/triggers/registry.d.ts +1 -1
  22. package/dist-types/lib/user-facing/components/table/index.d.ts +3 -3
  23. package/dist-types/lib/user-facing/components/table/props.d.ts +3 -3
  24. package/dist-types/lib/user-facing/components/table/table-widget.d.ts +0 -3
  25. package/dist-types/lib/user-facing/components/table/types.d.ts +2 -3
  26. package/package.json +2 -2
@@ -43466,7 +43466,8 @@ const SetComponentPropertyTrigger = {
43466
43466
  const value = context2.rootStore.entityManager.computeValue({
43467
43467
  scopeId: context2.scopeId,
43468
43468
  name: context2.name,
43469
- value: propertyValue
43469
+ value: propertyValue,
43470
+ args: [context2.additionalContext]
43470
43471
  });
43471
43472
  context2.rootStore.entityManager.runCode({
43472
43473
  scopeId: context2.scopeId,
@@ -43508,12 +43509,14 @@ const NavigateToRouteTrigger = {
43508
43509
  const queryParams = step.queryParams ? context2.rootStore.entityManager.computeValue({
43509
43510
  scopeId: context2.scopeId,
43510
43511
  name: context2.name,
43511
- value: step.queryParams
43512
+ value: step.queryParams,
43513
+ args: [context2.additionalContext]
43512
43514
  }) : {};
43513
43515
  const routeParams = step.routeParams ? context2.rootStore.entityManager.computeValue({
43514
43516
  scopeId: context2.scopeId,
43515
43517
  name: context2.name,
43516
- value: step.routeParams
43518
+ value: step.routeParams,
43519
+ args: [context2.additionalContext]
43517
43520
  }) : {};
43518
43521
  console.log("Navigate to route", {
43519
43522
  routeId: step.routeId,
@@ -78612,11 +78615,12 @@ function sendNotification({
78612
78615
  }
78613
78616
  const ShowAlertTrigger = {
78614
78617
  type: TriggerStepType.SHOW_ALERT,
78615
- async execute(_context, step) {
78616
- const computedMessage = _context.rootStore.entityManager.computeValue({
78617
- scopeId: _context.scopeId,
78618
- name: _context.name,
78619
- value: step.message
78618
+ async execute(context2, step) {
78619
+ const computedMessage = context2.rootStore.entityManager.computeValue({
78620
+ scopeId: context2.scopeId,
78621
+ name: context2.name,
78622
+ value: step.message,
78623
+ args: [context2.additionalContext]
78620
78624
  });
78621
78625
  sendNotification({
78622
78626
  message: computedMessage,
@@ -78668,7 +78672,8 @@ const SetStateVarTrigger = {
78668
78672
  const value = context2.rootStore.entityManager.computeValue({
78669
78673
  scopeId: context2.scopeId,
78670
78674
  name: context2.name,
78671
- value: step.value
78675
+ value: step.value,
78676
+ args: [context2.additionalContext]
78672
78677
  });
78673
78678
  context2.rootStore.entityManager.runCode({
78674
78679
  scopeId: context2.scopeId,
@@ -83779,7 +83784,7 @@ function registerStores(stores) {
83779
83784
  internalStores = { ...internalStores, ...stores };
83780
83785
  if (SUPPORTED_MODES.includes("production")) {
83781
83786
  if (Object.keys(internalStores).length === Object.keys(stores).length) {
83782
- import("./devtools-consolidated-DLUPZPVk.js").then(({ initializeCustomDevTools, setRegisteredStores }) => {
83787
+ import("./devtools-consolidated-CWXIC81a.js").then(({ initializeCustomDevTools, setRegisteredStores }) => {
83783
83788
  setRegisteredStores(internalStores);
83784
83789
  initializeCustomDevTools();
83785
83790
  }).catch((error) => {
@@ -83792,7 +83797,7 @@ function registerStores(stores) {
83792
83797
  }
83793
83798
  }
83794
83799
  const DevToolsInternal = React__default.lazy(() => {
83795
- return import("./devtools-consolidated-DLUPZPVk.js").then((module2) => ({
83800
+ return import("./devtools-consolidated-CWXIC81a.js").then((module2) => ({
83796
83801
  default: module2.CustomDevTools
83797
83802
  }));
83798
83803
  });
@@ -84965,7 +84970,7 @@ class EntityManager {
84965
84970
  });
84966
84971
  }
84967
84972
  computeValue(params) {
84968
- const { scopeId, name, value, validator } = params;
84973
+ const { scopeId, name, value, validator, args } = params;
84969
84974
  const { value: transformedValue, type: type5 } = toExecutableOrValue(
84970
84975
  name.value,
84971
84976
  value
@@ -84975,7 +84980,9 @@ class EntityManager {
84975
84980
  const result = isComputed ? computeEngine.compute({
84976
84981
  snapshot: this.getState(scopeId),
84977
84982
  entityName: name,
84978
- func: transformedValue
84983
+ func: transformedValue,
84984
+ args,
84985
+ excludeState: true
84979
84986
  }) : transformedValue;
84980
84987
  if (validator) {
84981
84988
  const vResult = validator(result, this.getEntity(scopeId, name));
@@ -91318,14 +91325,14 @@ function getLoaderFn$1(options) {
91318
91325
  if (!(loader === "all")) return [3, 3];
91319
91326
  return [4, import(
91320
91327
  /* webpackChunkName: "blueprint-icons-all-paths-loader" */
91321
- "./allPathsLoader-Wyunhtdo.js"
91328
+ "./allPathsLoader-DX9JilCw.js"
91322
91329
  )];
91323
91330
  case 2:
91324
91331
  return [2, _b2.sent().allPathsLoader];
91325
91332
  case 3:
91326
91333
  return [4, import(
91327
91334
  /* webpackChunkName: "blueprint-icons-split-paths-by-size-loader" */
91328
- "./splitPathsBySizeLoader-PMGtD99k.js"
91335
+ "./splitPathsBySizeLoader-Bu33O-BR.js"
91329
91336
  )];
91330
91337
  case 4:
91331
91338
  return [2, _b2.sent().splitPathsBySizeLoader];
@@ -148401,14 +148408,14 @@ function getLoaderFn(options) {
148401
148408
  if (!(loader === "all")) return [3, 3];
148402
148409
  return [4, import(
148403
148410
  /* webpackChunkName: "blueprint-icons-all-paths-loader" */
148404
- "./allPathsLoader-JnfELLa1.js"
148411
+ "./allPathsLoader-DmTEeMSZ.js"
148405
148412
  )];
148406
148413
  case 2:
148407
148414
  return [2, _b2.sent().allPathsLoader];
148408
148415
  case 3:
148409
148416
  return [4, import(
148410
148417
  /* webpackChunkName: "blueprint-icons-split-paths-by-size-loader" */
148411
- "./splitPathsBySizeLoader-GKgHRKX5.js"
148418
+ "./splitPathsBySizeLoader-DYETI6Yi.js"
148412
148419
  )];
148413
148420
  case 4:
148414
148421
  return [2, _b2.sent().splitPathsBySizeLoader];
@@ -164476,6 +164483,23 @@ function getFilteredTableData(props2) {
164476
164483
  finalTableData.map(({ $originalIndex }) => $originalIndex)
164477
164484
  ];
164478
164485
  }
164486
+ const rowEventArgs = (entity) => {
164487
+ return [
164488
+ [
164489
+ {
164490
+ name: "row",
164491
+ description: "Value of the clicked or selected row.",
164492
+ type: "object",
164493
+ schema: entity.tableData && Array.isArray(entity.tableData) && entity.tableData.length > 0 ? entity.tableData[0] : {}
164494
+ },
164495
+ {
164496
+ name: "rowIndex",
164497
+ description: "Index of the clicked or selected row.",
164498
+ type: "number"
164499
+ }
164500
+ ]
164501
+ ];
164502
+ };
164479
164503
  const propertiesDefinition$9 = {
164480
164504
  general: Section.category(PropsPanelCategory.Content).children({
164481
164505
  header: Prop.string().readAndWrite().default("").propertiesPanel({
@@ -164782,7 +164806,8 @@ const propertiesDefinition$9 = {
164782
164806
  }),
164783
164807
  events: Section.category(PropsPanelCategory.EventHandlers).children({
164784
164808
  onRowClick: Prop.event().propertiesPanel({
164785
- label: "onRowClicked"
164809
+ label: "onRowClick",
164810
+ computedArgs: rowEventArgs
164786
164811
  }),
164787
164812
  // onSaveChanges: Prop.event().propertiesPanel({
164788
164813
  // label: "onSaveChanges",
@@ -164790,8 +164815,9 @@ const propertiesDefinition$9 = {
164790
164815
  // onCancelChanges: Prop.event().propertiesPanel({
164791
164816
  // label: "onCancelChanges",
164792
164817
  // }),
164793
- onRowSelected: Prop.event().propertiesPanel({
164794
- label: "onRowSelected"
164818
+ onRowSelect: Prop.event().propertiesPanel({
164819
+ label: "onRowSelect",
164820
+ computedArgs: rowEventArgs
164795
164821
  }),
164796
164822
  // onRowInserted: Prop.event().propertiesPanel({
164797
164823
  // label: "onRowInserted",
@@ -164800,13 +164826,31 @@ const propertiesDefinition$9 = {
164800
164826
  // label: "onRowsDeleted",
164801
164827
  // }),
164802
164828
  onPageChange: Prop.event().propertiesPanel({
164803
- label: "onPageChange"
164829
+ label: "onPageChange",
164830
+ computedArgs: [
164831
+ [
164832
+ {
164833
+ name: "nextPage",
164834
+ type: "number",
164835
+ description: "The page number of the page being navigated to"
164836
+ }
164837
+ ]
164838
+ ]
164804
164839
  }),
164805
- onFiltersChanged: Prop.event().propertiesPanel({
164806
- label: "onFiltersChanged"
164840
+ onFiltersChange: Prop.event().propertiesPanel({
164841
+ label: "onFiltersChange"
164807
164842
  }),
164808
- onSearchTextChanged: Prop.event().propertiesPanel({
164809
- label: "onSearchTextChanged"
164843
+ onSearchTextChange: Prop.event().propertiesPanel({
164844
+ label: "onSearchTextChange",
164845
+ computedArgs: [
164846
+ [
164847
+ {
164848
+ name: "searchText",
164849
+ type: "string",
164850
+ description: "The current search text of the table"
164851
+ }
164852
+ ]
164853
+ ]
164810
164854
  })
164811
164855
  }),
164812
164856
  derived: Section.category(PropsPanelCategory.Derived).children({
@@ -178747,8 +178791,8 @@ const _TableWidget = class _TableWidget extends React__default.Component {
178747
178791
  });
178748
178792
  __publicField(this, "handleSearchTable", (searchKey) => {
178749
178793
  this.resetSelectedRowIndex();
178750
- this.props.setSearchText(searchKey, this.getRowContext());
178751
- this.props.setPageNo(1, this.getRowContext());
178794
+ this.props.setSearchText(searchKey);
178795
+ this.props.setPageNo(1);
178752
178796
  });
178753
178797
  __publicField(this, "selectRows", (rows = "ALL") => {
178754
178798
  var _a2;
@@ -178824,29 +178868,27 @@ const _TableWidget = class _TableWidget extends React__default.Component {
178824
178868
  const row = this.getSelectedRow(this.props.filteredTableData, index2);
178825
178869
  return {
178826
178870
  row,
178827
- rowIndex: index2 != null ? this.getCurrentRowIndex(index2) : void 0,
178828
- // legacy property
178829
- currentRow: row
178871
+ rowIndex: index2 != null ? this.getCurrentRowIndex(index2) : void 0
178830
178872
  };
178831
178873
  });
178832
178874
  __publicField(this, "handleRowClick", (_rowData, index2) => {
178833
178875
  this.props.onRowClicked(this.getRowContext(index2));
178834
178876
  });
178835
178877
  __publicField(this, "updatePageNumber", (pageNo) => {
178836
- this.props.setPageNo(pageNo, this.getRowContext(), true);
178878
+ this.props.setPageNo(pageNo, true);
178837
178879
  this.resetSelectedRowIndex();
178838
178880
  });
178839
178881
  __publicField(this, "handleNextPageClick", () => {
178840
178882
  let pageNo = this.props.pageNo || 1;
178841
178883
  pageNo = pageNo + 1;
178842
- this.props.setPageNo(pageNo, this.getRowContext(), true);
178884
+ this.props.setPageNo(pageNo, true);
178843
178885
  this.resetSelectedRowIndex();
178844
178886
  });
178845
178887
  __publicField(this, "handlePrevPageClick", () => {
178846
178888
  let pageNo = this.props.pageNo || 1;
178847
178889
  pageNo = pageNo - 1;
178848
178890
  if (pageNo >= 1) {
178849
- this.props.setPageNo(pageNo, this.getRowContext(), true);
178891
+ this.props.setPageNo(pageNo, true);
178850
178892
  }
178851
178893
  });
178852
178894
  __publicField(this, "resetSelectedRowIndex", () => {
@@ -179380,8 +179422,7 @@ const _TableWidget = class _TableWidget extends React__default.Component {
179380
179422
  const rowIndex = this.insertRow({}, validationErrors, options);
179381
179423
  this.props.onRowInserted({
179382
179424
  rowIndex,
179383
- row: {},
179384
- currentRow: {}
179425
+ row: {}
179385
179426
  });
179386
179427
  });
179387
179428
  __publicField(this, "getTableScroller", () => {
@@ -179649,7 +179690,7 @@ const _TableWidget = class _TableWidget extends React__default.Component {
179649
179690
  let pageNo = this.props.pageNo;
179650
179691
  if (pageNo === void 0) {
179651
179692
  pageNo = 1;
179652
- this.props.setPageNo(pageNo, this.getRowContext());
179693
+ this.props.setPageNo(pageNo);
179653
179694
  }
179654
179695
  const numEdits = Object.values(editOverrides).reduce((count2, edits) => {
179655
179696
  return count2 + Object.keys(edits).length;
@@ -179829,15 +179870,15 @@ const SbTable = registerSbComponent(
179829
179870
  const { features } = useEditor();
179830
179871
  const { theme } = useTheme$1();
179831
179872
  const {
179832
- onRowSelected,
179873
+ onRowSelect,
179833
179874
  onPageChange,
179834
- onSearchTextChanged,
179875
+ onSearchTextChange,
179835
179876
  onRowClick: propsOnRowClick,
179836
179877
  // onCancelChanges: propsOnCancelChanges,
179837
179878
  // onSaveChanges: propsOnSaveChanges,
179838
179879
  // onRowDeleted: propsOnRowDeleted,
179839
179880
  // onRowInserted: propsOnRowInserted,
179840
- onFiltersChanged
179881
+ onFiltersChange
179841
179882
  } = props2;
179842
179883
  const setSelectedRowData = useCallback(
179843
179884
  (data2, rowContext, triggerEventHandlers = false) => {
@@ -179854,18 +179895,17 @@ const SbTable = registerSbComponent(
179854
179895
  }
179855
179896
  });
179856
179897
  if (triggerEventHandlers) {
179857
- onRowSelected == null ? void 0 : onRowSelected(rowContext);
179898
+ onRowSelect == null ? void 0 : onRowSelect(rowContext);
179858
179899
  }
179859
179900
  },
179860
- [update, onRowSelected]
179901
+ [update, onRowSelect]
179861
179902
  );
179862
179903
  const setPageNo = useCallback(
179863
- (value, rowContext, triggerEventHandlers = false) => {
179904
+ (value, triggerEventHandlers = false) => {
179864
179905
  const newPageNo = Math.max(value - 1, 0);
179865
179906
  update((e3) => e3.pageNo = newPageNo);
179866
179907
  if (triggerEventHandlers) {
179867
179908
  onPageChange == null ? void 0 : onPageChange({
179868
- ...rowContext,
179869
179909
  nextPage: newPageNo
179870
179910
  });
179871
179911
  }
@@ -179873,11 +179913,13 @@ const SbTable = registerSbComponent(
179873
179913
  [update, onPageChange]
179874
179914
  );
179875
179915
  const setSearchText = useCallback(
179876
- (value, rowContext) => {
179916
+ (value) => {
179877
179917
  update((e3) => e3.searchText = value);
179878
- onSearchTextChanged == null ? void 0 : onSearchTextChanged(rowContext);
179918
+ onSearchTextChange == null ? void 0 : onSearchTextChange({
179919
+ searchText: value
179920
+ });
179879
179921
  },
179880
- [update, onSearchTextChanged]
179922
+ [update, onSearchTextChange]
179881
179923
  );
179882
179924
  const handleRowClick = useCallback(
179883
179925
  async (rowContext, onCompletion) => {
@@ -179892,9 +179934,9 @@ const SbTable = registerSbComponent(
179892
179934
  e3.selectedRowIndices = rowIndices;
179893
179935
  e3.selectedRows = rows;
179894
179936
  });
179895
- onRowSelected == null ? void 0 : onRowSelected(rowContext);
179937
+ onRowSelect == null ? void 0 : onRowSelect(rowContext);
179896
179938
  },
179897
- [update, onRowSelected]
179939
+ [update, onRowSelect]
179898
179940
  );
179899
179941
  const deselectAllRows = useCallback(
179900
179942
  (rowContext) => {
@@ -179902,9 +179944,9 @@ const SbTable = registerSbComponent(
179902
179944
  e3.selectedRowIndices = [];
179903
179945
  e3.selectedRows = [];
179904
179946
  });
179905
- onRowSelected == null ? void 0 : onRowSelected(rowContext);
179947
+ onRowSelect == null ? void 0 : onRowSelect(rowContext);
179906
179948
  },
179907
- [update, onRowSelected]
179949
+ [update, onRowSelect]
179908
179950
  );
179909
179951
  const setColumnOrder = useCallback(
179910
179952
  (value) => {
@@ -179936,9 +179978,9 @@ const SbTable = registerSbComponent(
179936
179978
  }
179937
179979
  };
179938
179980
  });
179939
- onFiltersChanged == null ? void 0 : onFiltersChanged();
179981
+ onFiltersChange == null ? void 0 : onFiltersChange();
179940
179982
  },
179941
- [update, onFiltersChanged]
179983
+ [update, onFiltersChange]
179942
179984
  );
179943
179985
  const setCurrentCellFocus = useCallback(
179944
179986
  (focus2) => {
@@ -200217,4 +200259,4 @@ export {
200217
200259
  SbVariable as y,
200218
200260
  SbTimer as z
200219
200261
  };
200220
- //# sourceMappingURL=index-COENR0Wl.js.map
200262
+ //# sourceMappingURL=index-CFUi7uyC.js.map