@superblocksteam/library 2.0.7 → 2.0.8-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (23) hide show
  1. package/dist/{allPaths-Boby_CDT.js → allPaths-B1MsvDDf.js} +2 -2
  2. package/dist/{allPaths-Boby_CDT.js.map → allPaths-B1MsvDDf.js.map} +1 -1
  3. package/dist/{allPaths-d63_pjlB.js → allPaths-WRYxU7UZ.js} +2 -2
  4. package/dist/{allPaths-d63_pjlB.js.map → allPaths-WRYxU7UZ.js.map} +1 -1
  5. package/dist/{allPathsLoader-CmUnKzK9.js → allPathsLoader-BHVTIYt4.js} +3 -3
  6. package/dist/{allPathsLoader-DyTMsYjm.js.map → allPathsLoader-BHVTIYt4.js.map} +1 -1
  7. package/dist/{allPathsLoader-DyTMsYjm.js → allPathsLoader-jAElVH-z.js} +3 -3
  8. package/dist/{allPathsLoader-CmUnKzK9.js.map → allPathsLoader-jAElVH-z.js.map} +1 -1
  9. package/dist/{devtools-consolidated-B3U5EpYG.js → devtools-consolidated-CKofLggZ.js} +2 -2
  10. package/dist/{devtools-consolidated-B3U5EpYG.js.map → devtools-consolidated-CKofLggZ.js.map} +1 -1
  11. package/dist/{index-NrZGBHks.js → index-bTBSm8qa.js} +109 -61
  12. package/dist/{index-NrZGBHks.js.map → index-bTBSm8qa.js.map} +1 -1
  13. package/dist/index.js +2 -2
  14. package/dist/{splitPathsBySizeLoader-mTPqVWRR.js → splitPathsBySizeLoader-CyYanZaN.js} +2 -2
  15. package/dist/{splitPathsBySizeLoader-mTPqVWRR.js.map → splitPathsBySizeLoader-CyYanZaN.js.map} +1 -1
  16. package/dist/{splitPathsBySizeLoader-B6CeEPjz.js → splitPathsBySizeLoader-Dn3N8sjZ.js} +2 -2
  17. package/dist/{splitPathsBySizeLoader-B6CeEPjz.js.map → splitPathsBySizeLoader-Dn3N8sjZ.js.map} +1 -1
  18. package/dist-types/lib/internal-details/lib/evaluator/base-entity-manager.d.ts +1 -0
  19. package/dist-types/lib/internal-details/lib/evaluator/entity-manager.d.ts +1 -0
  20. package/dist-types/lib/triggers/implementations/components/reset-component.d.ts +8 -5
  21. package/dist-types/lib/triggers/implementations/components/set-component-property.d.ts +8 -3
  22. package/dist-types/lib/user-facing/sb-event-flow.d.ts +15 -6
  23. package/package.json +2 -2
@@ -43505,17 +43505,26 @@ const isNameEqual = (a3, b3) => {
43505
43505
  const ResetComponentTrigger = {
43506
43506
  type: TriggerStepType.RESET_COMPONENT,
43507
43507
  async execute(context2, step) {
43508
+ var _a2, _b2;
43509
+ if (!((_a2 = step.widget) == null ? void 0 : _a2.name)) {
43510
+ return;
43511
+ }
43508
43512
  context2.rootStore.entityManager.resetEntity({
43509
- name: getName(step.widget.name),
43510
- scopeId: context2.scopeId
43513
+ name: getName((_b2 = step.widget) == null ? void 0 : _b2.name),
43514
+ scopeId: context2.scopeId,
43515
+ key: step.propertyName,
43516
+ onlyMetaProps: true
43511
43517
  });
43512
43518
  },
43513
- create(widget, propertyName, resetChildren) {
43519
+ create(component, opts) {
43520
+ const meta = getBindingIdentifier(component);
43514
43521
  return {
43515
43522
  type: TriggerStepType.RESET_COMPONENT,
43516
- widget,
43517
- propertyName,
43518
- resetChildren
43523
+ widget: meta ? {
43524
+ name: meta.entityName
43525
+ } : void 0,
43526
+ propertyName: opts == null ? void 0 : opts.property
43527
+ // resetChildren,
43519
43528
  };
43520
43529
  }
43521
43530
  };
@@ -43540,12 +43549,15 @@ const SetComponentPropertyTrigger = {
43540
43549
  args: [value, step]
43541
43550
  });
43542
43551
  },
43543
- create(widget, propertyName, propertyValue) {
43552
+ create(component, opts) {
43553
+ const meta = getBindingIdentifier(component);
43544
43554
  return {
43545
43555
  type: TriggerStepType.SET_COMPONENT_PROPERTY,
43546
- widget,
43547
- propertyName,
43548
- propertyValue
43556
+ widget: meta ? {
43557
+ name: meta.entityName
43558
+ } : void 0,
43559
+ propertyName: opts.property,
43560
+ propertyValue: opts.value
43549
43561
  };
43550
43562
  }
43551
43563
  };
@@ -83574,7 +83586,12 @@ function buildPropLeafDefault(prop, name, parentDefault) {
83574
83586
  return propDefault;
83575
83587
  }
83576
83588
  function traverseProps(sections, onProp, parentPath = "") {
83577
- const processProps = (props2, parentPath2, parentDefault) => {
83589
+ const processProps = ({
83590
+ sectionName,
83591
+ props: props2,
83592
+ parentPath: parentPath2,
83593
+ parentDefault
83594
+ }) => {
83578
83595
  for (const [name, prop] of Object.entries(props2)) {
83579
83596
  const fullPath = parentPath2 ? `${parentPath2}.${name}` : name;
83580
83597
  if (prop instanceof CompositeProp) {
@@ -83583,32 +83600,59 @@ function traverseProps(sections, onProp, parentPath = "") {
83583
83600
  name,
83584
83601
  parentDefault
83585
83602
  );
83586
- processProps(prop.nestedProps, fullPath, compositeDefault);
83603
+ processProps({
83604
+ sectionName,
83605
+ props: prop.nestedProps,
83606
+ parentPath: fullPath,
83607
+ parentDefault: compositeDefault
83608
+ });
83587
83609
  } else if (prop instanceof RecordProp) {
83588
83610
  const recordPath = `${fullPath}.${RECORD_PATH_IDENTIFIER}`;
83589
- processProps(prop.nestedProps, recordPath, prop.build().default);
83611
+ processProps({
83612
+ sectionName,
83613
+ props: prop.nestedProps,
83614
+ parentPath: recordPath,
83615
+ parentDefault: prop.build().default
83616
+ });
83590
83617
  } else if (prop instanceof Section) {
83591
- processProps(prop.props, parentPath2);
83618
+ processProps({
83619
+ sectionName,
83620
+ props: prop.props,
83621
+ parentPath: parentPath2
83622
+ });
83592
83623
  } else if (prop instanceof UnionProp) {
83593
83624
  const sharedKeys = Object.keys(prop.shared);
83594
- processProps(prop.shared, fullPath);
83625
+ processProps({
83626
+ sectionName,
83627
+ props: prop.shared,
83628
+ parentPath: fullPath
83629
+ });
83595
83630
  for (const variant of prop.variants) {
83596
83631
  const variantWithoutSharedKeys = Object.fromEntries(
83597
83632
  Object.entries(variant).filter(
83598
83633
  ([key2]) => !sharedKeys.includes(key2)
83599
83634
  )
83600
83635
  );
83601
- processProps(variantWithoutSharedKeys, fullPath);
83636
+ processProps({
83637
+ sectionName,
83638
+ props: variantWithoutSharedKeys,
83639
+ parentPath: fullPath
83640
+ });
83602
83641
  }
83603
83642
  } else if (prop instanceof Prop) {
83604
- onProp(prop, fullPath, name, parentDefault);
83643
+ onProp(prop, fullPath, name, parentDefault, sectionName);
83605
83644
  } else {
83606
83645
  console.warn("Invalid prop type", { name, prop });
83607
83646
  }
83608
83647
  }
83609
83648
  };
83610
- for (const [, section] of Object.entries(sections)) {
83611
- processProps(section.props, parentPath);
83649
+ for (const [sectionName, section] of Object.entries(sections)) {
83650
+ processProps({
83651
+ sectionName,
83652
+ props: section.props,
83653
+ parentPath,
83654
+ parentDefault: void 0
83655
+ });
83612
83656
  }
83613
83657
  }
83614
83658
  function createInternalPropsList(sections, parentPath = "") {
@@ -83632,7 +83676,7 @@ function createManagedPropsList(sections, parentPath = "") {
83632
83676
  const managedPropsList = [];
83633
83677
  traverseProps(
83634
83678
  sections,
83635
- (prop, fullPath, name, parentDefault) => {
83679
+ (prop, fullPath, name, parentDefault, sectionName) => {
83636
83680
  let configuredProp = prop.setName(fullPath);
83637
83681
  const propDefault = buildPropLeafDefault(prop, name, parentDefault);
83638
83682
  if (propDefault !== void 0) {
@@ -83640,7 +83684,10 @@ function createManagedPropsList(sections, parentPath = "") {
83640
83684
  }
83641
83685
  const builtProp = configuredProp.build();
83642
83686
  if (builtProp.dataType !== "internal") {
83643
- managedPropsList.push({ ...builtProp });
83687
+ managedPropsList.push({
83688
+ ...builtProp,
83689
+ ...sectionName === "meta" ? { isMetaProp: true } : {}
83690
+ });
83644
83691
  }
83645
83692
  },
83646
83693
  parentPath
@@ -83845,7 +83892,7 @@ function registerStores(stores) {
83845
83892
  internalStores = { ...internalStores, ...stores };
83846
83893
  if (SUPPORTED_MODES.includes("production")) {
83847
83894
  if (Object.keys(internalStores).length === Object.keys(stores).length) {
83848
- import("./devtools-consolidated-B3U5EpYG.js").then(({ initializeCustomDevTools, setRegisteredStores }) => {
83895
+ import("./devtools-consolidated-CKofLggZ.js").then(({ initializeCustomDevTools, setRegisteredStores }) => {
83849
83896
  setRegisteredStores(internalStores);
83850
83897
  initializeCustomDevTools();
83851
83898
  }).catch((error) => {
@@ -83858,7 +83905,7 @@ function registerStores(stores) {
83858
83905
  }
83859
83906
  }
83860
83907
  const DevToolsInternal = React__default.lazy(() => {
83861
- return import("./devtools-consolidated-B3U5EpYG.js").then((module2) => ({
83908
+ return import("./devtools-consolidated-CKofLggZ.js").then((module2) => ({
83862
83909
  default: module2.CustomDevTools
83863
83910
  }));
83864
83911
  });
@@ -84219,17 +84266,11 @@ class SbEventFlow {
84219
84266
  EventRegistry.cancelApi.create(apis, onCancel)
84220
84267
  );
84221
84268
  }
84222
- static resetComponent(widget, propertyName, resetChildren) {
84223
- return SbEventFlow.start().resetComponent(
84224
- widget,
84225
- propertyName,
84226
- resetChildren
84227
- );
84269
+ static resetComponent(component, opts) {
84270
+ return SbEventFlow.start().resetComponent(component, opts);
84228
84271
  }
84229
- resetComponent(widget, propertyName, resetChildren) {
84230
- return this.addStep(
84231
- EventRegistry.resetComponent.create(widget, propertyName, resetChildren)
84232
- );
84272
+ resetComponent(component, opts) {
84273
+ return this.addStep(EventRegistry.resetComponent.create(component, opts));
84233
84274
  }
84234
84275
  static resetStateVar(state) {
84235
84276
  return SbEventFlow.start().resetStateVar(state);
@@ -84243,16 +84284,12 @@ class SbEventFlow {
84243
84284
  setStateVar(stateVar, value) {
84244
84285
  return this.addStep(EventRegistry.setStateVar.create(stateVar, value));
84245
84286
  }
84246
- static setComponentProperty(widget, propertyName, value) {
84247
- return SbEventFlow.start().setComponentProperty(
84248
- widget,
84249
- propertyName,
84250
- value
84251
- );
84287
+ static setComponentProperty(component, opts) {
84288
+ return SbEventFlow.start().setComponentProperty(component, opts);
84252
84289
  }
84253
- setComponentProperty(widget, propertyName, value) {
84290
+ setComponentProperty(component, opts) {
84254
84291
  return this.addStep(
84255
- EventRegistry.setComponentProperty.create(widget, propertyName, value)
84292
+ EventRegistry.setComponentProperty.create(component, opts)
84256
84293
  );
84257
84294
  }
84258
84295
  static showAlert(message2, alertType, alertDuration, alertPosition) {
@@ -84943,15 +84980,24 @@ class EntityManager {
84943
84980
  }
84944
84981
  }
84945
84982
  resetEntity(params) {
84946
- const { name, key: key2 } = params;
84983
+ const { name, key: key2, onlyMetaProps } = params;
84947
84984
  const entityMeta = this.getScope(params.scopeId).getEntityMeta(name);
84948
84985
  if (key2) {
84949
84986
  if (key2 in entityMeta) {
84950
84987
  delete entityMeta[key2];
84951
84988
  }
84952
84989
  } else {
84990
+ let metaPropsNames = [];
84991
+ if (onlyMetaProps) {
84992
+ const managedPropsForType = this.componentRegistry.getManagedProps(
84993
+ entityMeta.type
84994
+ );
84995
+ metaPropsNames = managedPropsForType.filter((p) => p.isMetaProp).map((p) => p.path);
84996
+ }
84953
84997
  for (const prop of Object.keys(entityMeta)) {
84954
- delete entityMeta[prop];
84998
+ if (!onlyMetaProps || onlyMetaProps && metaPropsNames.includes(prop)) {
84999
+ delete entityMeta[prop];
85000
+ }
84955
85001
  }
84956
85002
  }
84957
85003
  }
@@ -87505,22 +87551,22 @@ function getSbEventFlow(step, scopeId) {
87505
87551
  return SbEventFlow.resetStateVar(resetStateEntity);
87506
87552
  }
87507
87553
  case "resetComponent": {
87508
- const resetWidgetEntity = getEntity((_e2 = step.widget) == null ? void 0 : _e2.name);
87509
- if (!resetWidgetEntity) return void 0;
87554
+ const component = getEntity(((_e2 = step.widget) == null ? void 0 : _e2.name) ?? "");
87555
+ if (!component) return void 0;
87510
87556
  return SbEventFlow.resetComponent(
87511
- step.widget,
87512
- step.propertyName,
87513
- step.resetChildren
87557
+ component,
87558
+ step.propertyName ? {
87559
+ property: step.propertyName
87560
+ } : void 0
87514
87561
  );
87515
87562
  }
87516
87563
  case "setComponentProperty": {
87517
- const setWidgetEntity = getEntity((_f2 = step.widget) == null ? void 0 : _f2.name);
87518
- if (!setWidgetEntity) return void 0;
87519
- return SbEventFlow.setComponentProperty(
87520
- step.widget,
87521
- step.propertyName,
87522
- step.propertyValue
87523
- );
87564
+ const component = getEntity(((_f2 = step.widget) == null ? void 0 : _f2.name) ?? "");
87565
+ if (!component) return void 0;
87566
+ return SbEventFlow.setComponentProperty(component, {
87567
+ property: step.propertyName,
87568
+ value: step.propertyValue
87569
+ });
87524
87570
  }
87525
87571
  case "showAlert":
87526
87572
  return SbEventFlow.showAlert(
@@ -91386,14 +91432,14 @@ function getLoaderFn$1(options) {
91386
91432
  if (!(loader === "all")) return [3, 3];
91387
91433
  return [4, import(
91388
91434
  /* webpackChunkName: "blueprint-icons-all-paths-loader" */
91389
- "./allPathsLoader-DyTMsYjm.js"
91435
+ "./allPathsLoader-BHVTIYt4.js"
91390
91436
  )];
91391
91437
  case 2:
91392
91438
  return [2, _b2.sent().allPathsLoader];
91393
91439
  case 3:
91394
91440
  return [4, import(
91395
91441
  /* webpackChunkName: "blueprint-icons-split-paths-by-size-loader" */
91396
- "./splitPathsBySizeLoader-B6CeEPjz.js"
91442
+ "./splitPathsBySizeLoader-Dn3N8sjZ.js"
91397
91443
  )];
91398
91444
  case 4:
91399
91445
  return [2, _b2.sent().splitPathsBySizeLoader];
@@ -120356,6 +120402,7 @@ const getStackChildStyle = ({
120356
120402
  (childProps == null ? void 0 : childProps.type) ?? ""
120357
120403
  ) ? Dim.fit() : Dim.fill());
120358
120404
  let widthCss = childCount === 1 && (width == null ? void 0 : width.mode) === "fill" && (parentWidth == null ? void 0 : parentWidth.mode) !== "fit" ? { width: "100%" } : dimToCSS(width, "width", primary === "width");
120405
+ const canShrinkBelowContentWidth = (childProps == null ? void 0 : childProps.minWidth) === void 0 && (childProps == null ? void 0 : childProps.type) === "SbColumn";
120359
120406
  if ((childProps == null ? void 0 : childProps.type) === "SbIcon") {
120360
120407
  heightCss = dimToCSS(Dim.fit(), "height", false);
120361
120408
  widthCss = dimToCSS(Dim.fit(), "width", false);
@@ -120363,7 +120410,7 @@ const getStackChildStyle = ({
120363
120410
  const widthInPx = (width == null ? void 0 : width.mode) === "px";
120364
120411
  const heightInPx = (height == null ? void 0 : height.mode) === "px";
120365
120412
  const shouldNotShrink = widthInPx && primary === "width" || heightInPx && primary === "height";
120366
- const minWidthCss = widthInPx ? {} : getMinMaxCss(childProps == null ? void 0 : childProps.minWidth, "minWidth");
120413
+ const minWidthCss = widthInPx ? {} : canShrinkBelowContentWidth ? { minWidth: "0px" } : getMinMaxCss(childProps == null ? void 0 : childProps.minWidth, "minWidth");
120367
120414
  const maxWidthCss = widthInPx ? {} : getMinMaxCss(childProps == null ? void 0 : childProps.maxWidth, "maxWidth");
120368
120415
  const minHeightCss = heightInPx ? {} : getMinMaxCss(childProps == null ? void 0 : childProps.minHeight, "minHeight");
120369
120416
  const maxHeightCss = heightInPx ? {} : getMinMaxCss(childProps == null ? void 0 : childProps.maxHeight, "maxHeight");
@@ -120578,6 +120625,7 @@ const SbSection = registerSbComponent(
120578
120625
  padding: props2.padding,
120579
120626
  border: props2.border,
120580
120627
  backgroundColor: props2.backgroundColor,
120628
+ shouldScrollContents: true,
120581
120629
  children: props2.children
120582
120630
  }
120583
120631
  );
@@ -148482,14 +148530,14 @@ function getLoaderFn(options) {
148482
148530
  if (!(loader === "all")) return [3, 3];
148483
148531
  return [4, import(
148484
148532
  /* webpackChunkName: "blueprint-icons-all-paths-loader" */
148485
- "./allPathsLoader-CmUnKzK9.js"
148533
+ "./allPathsLoader-jAElVH-z.js"
148486
148534
  )];
148487
148535
  case 2:
148488
148536
  return [2, _b2.sent().allPathsLoader];
148489
148537
  case 3:
148490
148538
  return [4, import(
148491
148539
  /* webpackChunkName: "blueprint-icons-split-paths-by-size-loader" */
148492
- "./splitPathsBySizeLoader-mTPqVWRR.js"
148540
+ "./splitPathsBySizeLoader-CyYanZaN.js"
148493
148541
  )];
148494
148542
  case 4:
148495
148543
  return [2, _b2.sent().splitPathsBySizeLoader];
@@ -200333,4 +200381,4 @@ export {
200333
200381
  SbVariable as y,
200334
200382
  SbTimer as z
200335
200383
  };
200336
- //# sourceMappingURL=index-NrZGBHks.js.map
200384
+ //# sourceMappingURL=index-bTBSm8qa.js.map