@superblocksteam/library 2.0.20 → 2.0.21-next.1

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 (29) hide show
  1. package/dist/{allPaths-B3CsE-4d.js → allPaths-CZ5HW-6o.js} +2 -2
  2. package/dist/{allPaths-B3CsE-4d.js.map → allPaths-CZ5HW-6o.js.map} +1 -1
  3. package/dist/{allPaths-CrcRC_Hg.js → allPaths-D7Zj1GsG.js} +2 -2
  4. package/dist/{allPaths-CrcRC_Hg.js.map → allPaths-D7Zj1GsG.js.map} +1 -1
  5. package/dist/{allPathsLoader-CM3qFtpk.js → allPathsLoader-CUezeXdO.js} +3 -3
  6. package/dist/{allPathsLoader-CbhZCOLq.js.map → allPathsLoader-CUezeXdO.js.map} +1 -1
  7. package/dist/{allPathsLoader-CbhZCOLq.js → allPathsLoader-DzIN8FMY.js} +3 -3
  8. package/dist/{allPathsLoader-CM3qFtpk.js.map → allPathsLoader-DzIN8FMY.js.map} +1 -1
  9. package/dist/{devtools-consolidated-3ekbDKtc.js → devtools-consolidated-D6jwOSvF.js} +2 -2
  10. package/dist/{devtools-consolidated-3ekbDKtc.js.map → devtools-consolidated-D6jwOSvF.js.map} +1 -1
  11. package/dist/{index-DoQuZXxx.js → index-DG9yo3A6.js} +265 -277
  12. package/dist/{index-DoQuZXxx.js.map → index-DG9yo3A6.js.map} +1 -1
  13. package/dist/index.js +2 -2
  14. package/dist/{splitPathsBySizeLoader-BbneuAAM.js → splitPathsBySizeLoader-D3yKiTLq.js} +2 -2
  15. package/dist/{splitPathsBySizeLoader-BbneuAAM.js.map → splitPathsBySizeLoader-D3yKiTLq.js.map} +1 -1
  16. package/dist/{splitPathsBySizeLoader-CJaleIID.js → splitPathsBySizeLoader-N6g9hlGC.js} +2 -2
  17. package/dist/{splitPathsBySizeLoader-CJaleIID.js.map → splitPathsBySizeLoader-N6g9hlGC.js.map} +1 -1
  18. package/dist-types/docs-utils/generate-docs-utils.d.ts +13 -0
  19. package/dist-types/edit-mode/dnd/get-allowed-children.d.ts +2 -0
  20. package/dist-types/edit-mode/dnd/utils.d.ts +9 -1
  21. package/dist-types/edit-mode/features/properties-panel-manager.d.ts +2 -2
  22. package/dist-types/lib/internal-details/sb-wrapper.d.ts +1 -1
  23. package/dist-types/lib/user-facing/components/dropdown/index.d.ts +2 -2
  24. package/dist-types/lib/user-facing/components/dropdown/props.d.ts +1 -1
  25. package/dist-types/lib/user-facing/internal-index.d.ts +1 -1
  26. package/dist-types/lib/user-facing/properties-panel/props-builder.d.ts +6 -5
  27. package/dist-types/lib/utils/is-component-type-detached.d.ts +1 -0
  28. package/package.json +2 -2
  29. package/dist-types/lib/internal-details/sb-wrapper-notes.d.ts +0 -1
@@ -96123,8 +96123,8 @@ class Prop {
96123
96123
  static event() {
96124
96124
  return new Prop("event");
96125
96125
  }
96126
- static children(config2) {
96127
- return new ChildrenProp(config2);
96126
+ static children() {
96127
+ return new ChildrenProp();
96128
96128
  }
96129
96129
  static function(implementation) {
96130
96130
  const prop = new Prop("function");
@@ -96193,10 +96193,6 @@ class Prop {
96193
96193
  this.prop.isExternallyReadable = true;
96194
96194
  return this;
96195
96195
  }
96196
- writable() {
96197
- this.prop.isExternallySettable = true;
96198
- return this;
96199
- }
96200
96196
  readAndWrite() {
96201
96197
  this.prop.isExternallyReadable = true;
96202
96198
  this.prop.isExternallySettable = true;
@@ -96441,16 +96437,9 @@ class RecordProp extends Prop {
96441
96437
  }
96442
96438
  }
96443
96439
  class ChildrenProp extends Prop {
96444
- constructor(config2) {
96440
+ constructor() {
96445
96441
  super("children");
96446
96442
  __publicField(this, "typeString", "children");
96447
- __publicField(this, "allowedChildren");
96448
- this.allowedChildren = config2 == null ? void 0 : config2.allowedChildren;
96449
- }
96450
- getConfig() {
96451
- return {
96452
- allowedChildren: this.allowedChildren
96453
- };
96454
96443
  }
96455
96444
  }
96456
96445
  class UnionProp extends Prop {
@@ -96857,7 +96846,7 @@ function registerStores(stores) {
96857
96846
  internalStores = { ...internalStores, ...stores };
96858
96847
  if (SUPPORTED_MODES.includes("production")) {
96859
96848
  if (Object.keys(internalStores).length === Object.keys(stores).length) {
96860
- import("./devtools-consolidated-3ekbDKtc.js").then(({ initializeCustomDevTools, setRegisteredStores }) => {
96849
+ import("./devtools-consolidated-D6jwOSvF.js").then(({ initializeCustomDevTools, setRegisteredStores }) => {
96861
96850
  setRegisteredStores(internalStores);
96862
96851
  initializeCustomDevTools();
96863
96852
  }).catch((error) => {
@@ -96870,7 +96859,7 @@ function registerStores(stores) {
96870
96859
  }
96871
96860
  }
96872
96861
  const DevToolsInternal = React__default.lazy(() => {
96873
- return import("./devtools-consolidated-3ekbDKtc.js").then((module2) => ({
96862
+ return import("./devtools-consolidated-D6jwOSvF.js").then((module2) => ({
96874
96863
  default: module2.CustomDevTools
96875
96864
  }));
96876
96865
  });
@@ -97741,6 +97730,9 @@ class EntityManager {
97741
97730
  }
97742
97731
  const managedProp = this.componentRegistry.getManagedProps(entityType).find((p) => p.path === finalProp);
97743
97732
  const getValue2 = computed$1(() => {
97733
+ if ((managedProp == null ? void 0 : managedProp.isExternallyReadable) === false) {
97734
+ return;
97735
+ }
97744
97736
  let ret = null;
97745
97737
  try {
97746
97738
  const metaParent = getMetaParent();
@@ -97801,6 +97793,12 @@ class EntityManager {
97801
97793
  return ret;
97802
97794
  });
97803
97795
  const setValue = (value) => {
97796
+ if ((managedProp == null ? void 0 : managedProp.isExternallySettable) === false) {
97797
+ console.warn(
97798
+ `The property "${finalSegment}" on entity "${name.value}" is not settable, it will be ignored.`
97799
+ );
97800
+ return;
97801
+ }
97804
97802
  const metaParent = getMetaParent();
97805
97803
  metaParent[finalSegment] = value;
97806
97804
  };
@@ -99517,150 +99515,13 @@ const rootStore$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
99517
99515
  __proto__: null,
99518
99516
  default: rootStore
99519
99517
  }, Symbol.toStringTag, { value: "Module" }));
99520
- const detachedComponentTypeList = ["Modal", "Slideout"];
99521
- const DetachedComponentTypes = new Set(
99522
- detachedComponentTypeList
99523
- );
99524
- function rule(description, restriction) {
99525
- return {
99526
- description,
99527
- restriction
99528
- };
99529
- }
99530
- const restrictions = [
99531
- rule(
99532
- "Draggable type must be draggable",
99533
- ({ draggedType }) => !isTypeDraggable(draggedType)
99534
- ),
99535
- rule(
99536
- "Drop target type must be droppable",
99537
- ({ dropTargetType }) => !isTypeDroppable(dropTargetType)
99538
- ),
99539
- rule(
99540
- "Columns can only be dropped on sections",
99541
- ({ draggedType, dropTargetType }) => {
99542
- return draggedType === "Column" && dropTargetType !== "Section";
99543
- }
99544
- ),
99545
- rule(
99546
- "Sections can only be dropped on pages",
99547
- ({ draggedType, dropTargetType }) => {
99548
- return draggedType === "Section" && dropTargetType !== "Page";
99549
- }
99550
- ),
99551
- rule(
99552
- "Only sections can be dropped on non-empty pages",
99553
- ({ draggedType, dropTargetType, dropTargetEmpty }) => {
99554
- return draggedType !== "Section" && dropTargetType === "Page" && !dropTargetEmpty;
99555
- }
99556
- ),
99557
- rule(
99558
- "Only columns can be dropped on non-empty sections",
99559
- ({ draggedType, dropTargetType, dropTargetEmpty }) => {
99560
- return draggedType !== "Column" && dropTargetType === "Section" && !dropTargetEmpty;
99561
- }
99562
- )
99563
- ];
99564
- const isDragAndDropTypeValid = ({
99565
- draggedType,
99566
- dropTargetType,
99567
- dropTargetEmpty,
99568
- isDraggingNewComponent
99569
- }) => {
99570
- const actualDraggedType = isDraggingNewComponent && (draggedType === "Modal" || draggedType === "Slideout") ? "Button" : draggedType;
99571
- const triggeredRestriction = restrictions.find(
99572
- (restriction) => restriction.restriction({
99573
- draggedType: actualDraggedType,
99574
- dropTargetType,
99575
- dropTargetEmpty,
99576
- isDraggingNewComponent
99577
- })
99578
- );
99579
- return triggeredRestriction == null;
99580
- };
99581
- const isTypeDroppable = (type5) => {
99582
- const editorConfig2 = rootStore.componentRegistry.getEditorConfig(type5);
99583
- return (editorConfig2 == null ? void 0 : editorConfig2.isDroppable) === true;
99584
- };
99585
- const isTypeDraggable = (type5) => {
99586
- const editorConfig2 = rootStore.componentRegistry.getEditorConfig(type5);
99587
- return (editorConfig2 == null ? void 0 : editorConfig2.isDraggable) !== false;
99588
- };
99589
- const isContentDraggable = (type5) => {
99590
- if (!isTypeDraggable(type5)) {
99591
- return false;
99592
- }
99593
- const editorConfig2 = rootStore.componentRegistry.getEditorConfig(type5);
99594
- return (editorConfig2 == null ? void 0 : editorConfig2.isContentDraggable) !== false;
99595
- };
99596
- function shouldWrapInSectionAndColumn(type5, parentType) {
99597
- if (DetachedComponentTypes.has(type5)) {
99518
+ function isComponentTypeDetached(componentType) {
99519
+ if (!componentType) {
99598
99520
  return false;
99599
99521
  }
99600
- return parentType === "Page" && type5 !== "Section" || parentType === "Section" && type5 !== "Column";
99522
+ const editorConfig2 = rootStore.componentRegistry.getEditorConfig(componentType);
99523
+ return (editorConfig2 == null ? void 0 : editorConfig2.isDetached) ?? false;
99601
99524
  }
99602
- const filterSafeStackDimensionProperties = (existingProps) => {
99603
- const { width, height, size: size2 } = existingProps;
99604
- let safeHeight;
99605
- let safeWidth;
99606
- let safeSize;
99607
- if ((height == null ? void 0 : height.mode) === "px" || (height == null ? void 0 : height.mode) === "fit" || (height == null ? void 0 : height.mode) === "fill") {
99608
- safeHeight = Property.Dimension(height);
99609
- }
99610
- if ((width == null ? void 0 : width.mode) === "px" || (width == null ? void 0 : width.mode) === "fit" || (width == null ? void 0 : width.mode) === "fill") {
99611
- safeWidth = Property.Dimension(width);
99612
- }
99613
- if ((size2 == null ? void 0 : size2.mode) === "px") {
99614
- safeSize = Property.Dimension(size2);
99615
- }
99616
- return {
99617
- width: safeWidth,
99618
- height: safeHeight,
99619
- size: safeSize
99620
- };
99621
- };
99622
- const filterSafeGridDimensionProperties = (existingProps) => {
99623
- const { width, height, size: size2 } = existingProps;
99624
- const safeDimensions = {};
99625
- if ((height == null ? void 0 : height.mode) === "rows" || (height == null ? void 0 : height.mode) === "fit") {
99626
- safeDimensions.height = Property.Dimension(height);
99627
- }
99628
- if ((width == null ? void 0 : width.mode) === "columns") {
99629
- safeDimensions.width = Property.Dimension(width);
99630
- }
99631
- if ((size2 == null ? void 0 : size2.mode) === "columns") {
99632
- safeDimensions.size = Property.Dimension(size2);
99633
- }
99634
- return safeDimensions;
99635
- };
99636
- const defaultSizeForComponent = (componentType, isFreeform, draggedDimensions) => {
99637
- if (componentType === "Icon") {
99638
- return {};
99639
- }
99640
- const height = Property.Dimension(Dim.fit());
99641
- if (isFreeform) {
99642
- const guWidth = (draggedDimensions == null ? void 0 : draggedDimensions.widthGU) ?? 4;
99643
- return {
99644
- height,
99645
- width: Property.Dimension(Dim.col(guWidth))
99646
- };
99647
- }
99648
- switch (componentType) {
99649
- case "Text":
99650
- case "Button":
99651
- case "Checkbox":
99652
- case "Switch":
99653
- return { height, width: Property.Dimension(Dim.fit()) };
99654
- case "Image":
99655
- return {
99656
- height,
99657
- width: Property.Dimension(Dim.px((draggedDimensions == null ? void 0 : draggedDimensions.widthPx) ?? 288))
99658
- // Matches widget config response. This should never be undefined though.
99659
- };
99660
- default:
99661
- return { height, width: Property.Dimension(Dim.fill()) };
99662
- }
99663
- };
99664
99525
  const getWidgetAnchorName = (instanceId) => {
99665
99526
  return `--widget-${instanceId}`;
99666
99527
  };
@@ -99668,7 +99529,7 @@ const getWidgetRectAnchorName = (instanceId) => {
99668
99529
  return `--widget-rect-${instanceId}`;
99669
99530
  };
99670
99531
  const getWidgetDropAreaAnchorName = (instanceId, widgetType) => {
99671
- if (widgetType && DetachedComponentTypes.has(widgetType)) {
99532
+ if (widgetType && isComponentTypeDetached(widgetType)) {
99672
99533
  return `--widget-drop-area-${instanceId}`;
99673
99534
  }
99674
99535
  return `--widget-${instanceId}`;
@@ -99677,7 +99538,7 @@ const getEditWrapperId = (instanceId) => {
99677
99538
  return `sb-edit-wrapper-${instanceId}`;
99678
99539
  };
99679
99540
  const getEditWrapperIdWithType = (instanceId, widgetType) => {
99680
- if (widgetType && DetachedComponentTypes.has(widgetType)) {
99541
+ if (widgetType && isComponentTypeDetached(widgetType)) {
99681
99542
  return `sb-edit-wrapper-for-${widgetType}-${instanceId}`;
99682
99543
  }
99683
99544
  return `sb-edit-wrapper-${instanceId}`;
@@ -104636,14 +104497,14 @@ function getLoaderFn$1(options) {
104636
104497
  if (!(loader === "all")) return [3, 3];
104637
104498
  return [4, import(
104638
104499
  /* webpackChunkName: "blueprint-icons-all-paths-loader" */
104639
- "./allPathsLoader-CM3qFtpk.js"
104500
+ "./allPathsLoader-DzIN8FMY.js"
104640
104501
  )];
104641
104502
  case 2:
104642
104503
  return [2, _b2.sent().allPathsLoader];
104643
104504
  case 3:
104644
104505
  return [4, import(
104645
104506
  /* webpackChunkName: "blueprint-icons-split-paths-by-size-loader" */
104646
- "./splitPathsBySizeLoader-CJaleIID.js"
104507
+ "./splitPathsBySizeLoader-N6g9hlGC.js"
104647
104508
  )];
104648
104509
  case 4:
104649
104510
  return [2, _b2.sent().splitPathsBySizeLoader];
@@ -129675,6 +129536,177 @@ function useComponentDroppable({
129675
129536
  }
129676
129537
  });
129677
129538
  }
129539
+ const ALLOWED_CHILDREN_COMPONENT_TYPES = {
129540
+ Page: ["Section"],
129541
+ Section: ["Column"]
129542
+ };
129543
+ const RESTRICT_PARENT_TYPES = {
129544
+ Page: [],
129545
+ Section: ["Page"],
129546
+ Column: ["Section", "Page"]
129547
+ };
129548
+ const getAllowedChildrenComponentTypes = (componentType) => {
129549
+ return ALLOWED_CHILDREN_COMPONENT_TYPES[componentType];
129550
+ };
129551
+ function isNestable(componentType, parentType) {
129552
+ var _a2;
129553
+ if (parentType && RESTRICT_PARENT_TYPES[componentType] && !((_a2 = RESTRICT_PARENT_TYPES[componentType]) == null ? void 0 : _a2.includes(parentType))) {
129554
+ return false;
129555
+ }
129556
+ return true;
129557
+ }
129558
+ const detachedComponentTypeList = ["Modal", "Slideout"];
129559
+ new Set(
129560
+ detachedComponentTypeList
129561
+ );
129562
+ function rule(description, restriction) {
129563
+ return {
129564
+ description,
129565
+ restriction
129566
+ };
129567
+ }
129568
+ const restrictions = [
129569
+ rule(
129570
+ "Draggable type must be draggable",
129571
+ ({ draggedType }) => !isTypeDraggable(draggedType)
129572
+ ),
129573
+ rule(
129574
+ "Drop target type must be droppable",
129575
+ ({ dropTargetType }) => !isTypeDroppable(dropTargetType)
129576
+ ),
129577
+ rule(
129578
+ "Columns can only be dropped on sections",
129579
+ ({ draggedType, dropTargetType }) => {
129580
+ return draggedType === "Column" && dropTargetType !== "Section";
129581
+ }
129582
+ ),
129583
+ rule(
129584
+ "Sections can only be dropped on pages",
129585
+ ({ draggedType, dropTargetType }) => {
129586
+ return draggedType === "Section" && dropTargetType !== "Page";
129587
+ }
129588
+ ),
129589
+ rule(
129590
+ "Only sections can be dropped on non-empty pages",
129591
+ ({ draggedType, dropTargetType, dropTargetEmpty }) => {
129592
+ return draggedType !== "Section" && dropTargetType === "Page" && !dropTargetEmpty;
129593
+ }
129594
+ ),
129595
+ rule(
129596
+ "Only columns can be dropped on non-empty sections",
129597
+ ({ draggedType, dropTargetType, dropTargetEmpty }) => {
129598
+ return draggedType !== "Column" && dropTargetType === "Section" && !dropTargetEmpty;
129599
+ }
129600
+ )
129601
+ ];
129602
+ const isDragAndDropTypeValid = ({
129603
+ draggedType,
129604
+ dropTargetType,
129605
+ dropTargetEmpty,
129606
+ isDraggingNewComponent
129607
+ }) => {
129608
+ const actualDraggedType = isDraggingNewComponent && (draggedType === "Modal" || draggedType === "Slideout") ? "Button" : draggedType;
129609
+ const triggeredRestriction = restrictions.find(
129610
+ (restriction) => restriction.restriction({
129611
+ draggedType: actualDraggedType,
129612
+ dropTargetType,
129613
+ dropTargetEmpty,
129614
+ isDraggingNewComponent
129615
+ })
129616
+ );
129617
+ return triggeredRestriction == null;
129618
+ };
129619
+ const isTypeDroppable = (type5) => {
129620
+ const editorConfig2 = rootStore.componentRegistry.getEditorConfig(type5);
129621
+ return (editorConfig2 == null ? void 0 : editorConfig2.isDroppable) === true;
129622
+ };
129623
+ const isTypeDraggable = (type5) => {
129624
+ const editorConfig2 = rootStore.componentRegistry.getEditorConfig(type5);
129625
+ return (editorConfig2 == null ? void 0 : editorConfig2.isDraggable) !== false;
129626
+ };
129627
+ const isContentDraggable = (type5) => {
129628
+ if (!isTypeDraggable(type5)) {
129629
+ return false;
129630
+ }
129631
+ const editorConfig2 = rootStore.componentRegistry.getEditorConfig(type5);
129632
+ return (editorConfig2 == null ? void 0 : editorConfig2.isContentDraggable) !== false;
129633
+ };
129634
+ function shouldWrapComponent(type5, parentType) {
129635
+ if (isComponentTypeDetached(type5)) {
129636
+ return [false];
129637
+ }
129638
+ if (!parentType) {
129639
+ return [false];
129640
+ }
129641
+ const allowedChildren = getAllowedChildrenComponentTypes(parentType);
129642
+ if (allowedChildren === void 0 || allowedChildren.includes(type5)) {
129643
+ return [false];
129644
+ } else {
129645
+ return [true, allowedChildren == null ? void 0 : allowedChildren[0]];
129646
+ }
129647
+ }
129648
+ const filterSafeStackDimensionProperties = (existingProps) => {
129649
+ const { width, height, size: size2 } = existingProps;
129650
+ let safeHeight;
129651
+ let safeWidth;
129652
+ let safeSize;
129653
+ if ((height == null ? void 0 : height.mode) === "px" || (height == null ? void 0 : height.mode) === "fit" || (height == null ? void 0 : height.mode) === "fill") {
129654
+ safeHeight = Property.Dimension(height);
129655
+ }
129656
+ if ((width == null ? void 0 : width.mode) === "px" || (width == null ? void 0 : width.mode) === "fit" || (width == null ? void 0 : width.mode) === "fill") {
129657
+ safeWidth = Property.Dimension(width);
129658
+ }
129659
+ if ((size2 == null ? void 0 : size2.mode) === "px") {
129660
+ safeSize = Property.Dimension(size2);
129661
+ }
129662
+ return {
129663
+ width: safeWidth,
129664
+ height: safeHeight,
129665
+ size: safeSize
129666
+ };
129667
+ };
129668
+ const filterSafeGridDimensionProperties = (existingProps) => {
129669
+ const { width, height, size: size2 } = existingProps;
129670
+ const safeDimensions = {};
129671
+ if ((height == null ? void 0 : height.mode) === "rows" || (height == null ? void 0 : height.mode) === "fit") {
129672
+ safeDimensions.height = Property.Dimension(height);
129673
+ }
129674
+ if ((width == null ? void 0 : width.mode) === "columns") {
129675
+ safeDimensions.width = Property.Dimension(width);
129676
+ }
129677
+ if ((size2 == null ? void 0 : size2.mode) === "columns") {
129678
+ safeDimensions.size = Property.Dimension(size2);
129679
+ }
129680
+ return safeDimensions;
129681
+ };
129682
+ const defaultSizeForComponent = (componentType, isFreeform, draggedDimensions) => {
129683
+ if (componentType === "Icon") {
129684
+ return {};
129685
+ }
129686
+ const height = Property.Dimension(Dim.fit());
129687
+ if (isFreeform) {
129688
+ const guWidth = (draggedDimensions == null ? void 0 : draggedDimensions.widthGU) ?? 4;
129689
+ return {
129690
+ height,
129691
+ width: Property.Dimension(Dim.col(guWidth))
129692
+ };
129693
+ }
129694
+ switch (componentType) {
129695
+ case "Text":
129696
+ case "Button":
129697
+ case "Checkbox":
129698
+ case "Switch":
129699
+ return { height, width: Property.Dimension(Dim.fit()) };
129700
+ case "Image":
129701
+ return {
129702
+ height,
129703
+ width: Property.Dimension(Dim.px((draggedDimensions == null ? void 0 : draggedDimensions.widthPx) ?? 288))
129704
+ // Matches widget config response. This should never be undefined though.
129705
+ };
129706
+ default:
129707
+ return { height, width: Property.Dimension(Dim.fill()) };
129708
+ }
129709
+ };
129678
129710
  const DroppableWidget = observer(
129679
129711
  (props2) => {
129680
129712
  var _a2;
@@ -130067,15 +130099,6 @@ function getComponentBaseProperties(componentType, parentInfo, editorTemplateCre
130067
130099
  children: (editorTemplateCreateRequest == null ? void 0 : editorTemplateCreateRequest.children) ?? []
130068
130100
  };
130069
130101
  }
130070
- function checkComponentForParentTypeBeforeCreating(componentType, parentType) {
130071
- if (componentType === "Section" && parentType !== "Page") {
130072
- return false;
130073
- }
130074
- if (componentType === "Column" && parentType !== "Section" && parentType !== "Page") {
130075
- return false;
130076
- }
130077
- return true;
130078
- }
130079
130102
  function getCreateAtParentElement(relativeParent, createAt) {
130080
130103
  if (createAt === "root") {
130081
130104
  const parentInstanceId = getEditStore().runtimeEntitiesManager.widgets.getAnyInstanceIdForSourceId(
@@ -130106,10 +130129,8 @@ async function createComponent({
130106
130129
  }) {
130107
130130
  var _a2, _b2;
130108
130131
  const parentInfo = getParentInfo(parent);
130109
- if (!checkComponentForParentTypeBeforeCreating(componentType, parentInfo.type)) {
130110
- console.error(
130111
- `${componentType} cannot be added to ${parentInfo.type} directly`
130112
- );
130132
+ if (!isNestable(componentType, parentInfo.type)) {
130133
+ console.error(`${componentType} cannot be nested under ${parentInfo.type}`);
130113
130134
  return;
130114
130135
  }
130115
130136
  const editorTemplates = rootStore.componentRegistry.getEditorTemplates(componentType);
@@ -130140,11 +130161,8 @@ async function createComponent({
130140
130161
  baseProperties: baseProperties2
130141
130162
  }) {
130142
130163
  const type5 = (editorTemplateCreateRequest2 == null ? void 0 : editorTemplateCreateRequest2.type) ?? componentType;
130143
- const willWrapInSectionAndColumn = shouldWrapInSectionAndColumn(
130144
- type5,
130145
- parentInfo.type
130146
- );
130147
- const isGridLike = willWrapInSectionAndColumn && type5 !== "Column" ? true : parentInfo.isGridLike;
130164
+ const [shouldWrap, wrapInType] = shouldWrapComponent(type5, parentInfo.type);
130165
+ const isGridLike = shouldWrap && type5 !== "Column" ? true : parentInfo.isGridLike;
130148
130166
  const { properties: propertiesFromType, children } = getComponentBaseProperties(
130149
130167
  type5,
130150
130168
  {
@@ -130169,11 +130187,8 @@ async function createComponent({
130169
130187
  scopeName,
130170
130188
  id: editStore2.operationManager.generateSourceId()
130171
130189
  };
130172
- if (willWrapInSectionAndColumn) {
130173
- primaryComponent = wrapInSectionColumnIfDroppingOnPage(
130174
- primaryComponent,
130175
- parentInfo.type
130176
- );
130190
+ if (shouldWrap) {
130191
+ primaryComponent = wrapComponentIfNecessary(primaryComponent, wrapInType);
130177
130192
  }
130178
130193
  return primaryComponent;
130179
130194
  }
@@ -130213,54 +130228,25 @@ async function createComponent({
130213
130228
  }
130214
130229
  return createRequests.at(-1).id;
130215
130230
  }
130216
- function wrapInSectionColumnIfDroppingOnPage(primaryComponent, parentType) {
130217
- const { properties: sectionProperties } = getComponentBaseProperties(
130218
- "Section",
130219
- {
130220
- isGridLike: false
130221
- // parent is a page
130222
- }
130223
- );
130224
- if (primaryComponent.tagName === "Column") {
130225
- return {
130226
- parentElement: primaryComponent.parentElement,
130227
- tagName: "Section",
130228
- id: getEditStore().operationManager.generateSourceId(),
130229
- properties: sectionProperties,
130230
- children: [primaryComponent]
130231
- };
130231
+ function wrapComponentIfNecessary(primaryComponent, wrapInType) {
130232
+ if (!wrapInType) {
130233
+ return primaryComponent;
130232
130234
  }
130233
- const { properties: columnProperties } = getComponentBaseProperties(
130234
- "Column",
130235
- {
130236
- isGridLike: false
130237
- // parent is section
130238
- }
130235
+ const { properties: properties2 } = getComponentBaseProperties(wrapInType, {
130236
+ isGridLike: false
130237
+ // parent is a page (TODO: it was hardcoded, make it dynamic?)
130238
+ });
130239
+ const [_15, continueWrappingInType] = shouldWrapComponent(
130240
+ primaryComponent.tagName,
130241
+ wrapInType
130239
130242
  );
130240
- if (parentType === "Section") {
130241
- return {
130242
- parentElement: primaryComponent.parentElement,
130243
- tagName: "Column",
130244
- id: getEditStore().operationManager.generateSourceId(),
130245
- properties: columnProperties,
130246
- children: [primaryComponent]
130247
- };
130248
- }
130249
130243
  return {
130250
130244
  parentElement: primaryComponent.parentElement,
130251
- tagName: "Section",
130245
+ tagName: wrapInType,
130252
130246
  id: getEditStore().operationManager.generateSourceId(),
130253
- properties: sectionProperties,
130247
+ properties: properties2,
130254
130248
  children: [
130255
- {
130256
- tagName: "Column",
130257
- id: getEditStore().operationManager.generateSourceId(),
130258
- properties: {
130259
- ...columnProperties,
130260
- layout: Property.Static("vertical")
130261
- },
130262
- children: [primaryComponent]
130263
- }
130249
+ wrapComponentIfNecessary(primaryComponent, continueWrappingInType)
130264
130250
  ]
130265
130251
  };
130266
130252
  }
@@ -130403,7 +130389,7 @@ const handleStackDropWithinCanvas = (params) => {
130403
130389
  if (!draggedType) {
130404
130390
  throw new Error(`Missing dragged type: ${draggedId}`);
130405
130391
  }
130406
- const shouldWrap = shouldWrapInSectionAndColumn(draggedType, dropTargetType);
130392
+ const [shouldWrap] = shouldWrapComponent(draggedType, dropTargetType);
130407
130393
  const activeDragRect = editStore2.ui.dnd.activeDragRect;
130408
130394
  if (shouldWrap) {
130409
130395
  dropComponentInWrappingSectionOrColumn({
@@ -131644,10 +131630,6 @@ function useWidgetHover(rootType) {
131644
131630
  };
131645
131631
  }, [rootType]);
131646
131632
  }
131647
- const DETACHED_COMPONENT_TYPES = [
131648
- "Modal",
131649
- "Slideout"
131650
- ];
131651
131633
  const InteractionLayer = observer(
131652
131634
  (props2) => {
131653
131635
  useWidgetHover(props2.rootType);
@@ -131680,9 +131662,7 @@ const InteractionLayer = observer(
131680
131662
  if (!isActive2) {
131681
131663
  return null;
131682
131664
  }
131683
- const interactionRectsForSelectedElements = selectedElements.filter(
131684
- (info) => !DETACHED_COMPONENT_TYPES.includes(info.type)
131685
- ).map((info) => {
131665
+ const interactionRectsForSelectedElements = selectedElements.filter((info) => !isComponentTypeDetached(info.type)).map((info) => {
131686
131666
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
131687
131667
  InteractionRect,
131688
131668
  {
@@ -131692,7 +131672,9 @@ const InteractionLayer = observer(
131692
131672
  info.sourceId
131693
131673
  );
131694
131674
  });
131695
- const interactionRectIfDetachedComponent = DETACHED_COMPONENT_TYPES.includes(props2.rootType) && /* @__PURE__ */ jsxRuntimeExports.jsx(
131675
+ const interactionRectIfDetachedComponent = isComponentTypeDetached(
131676
+ props2.rootType
131677
+ ) && /* @__PURE__ */ jsxRuntimeExports.jsx(
131696
131678
  InteractionRect,
131697
131679
  {
131698
131680
  isDragging: false,
@@ -132192,9 +132174,11 @@ function useTrackRuntimeWidget(instanceId, params) {
132192
132174
  stableEffectOptions
132193
132175
  );
132194
132176
  }
132195
- const registerComponent$1 = (type5, config2, Component3) => {
132177
+ const registerComponentInternal = (type5, config2, Component3) => {
132196
132178
  const managedProps = createManagedPropsList(config2.propertiesDefinition);
132197
- const isDroppable = !!managedProps.find((p) => p.dataType === "children");
132179
+ const isDroppable = !!managedProps.find(
132180
+ (p) => p.dataType === "children"
132181
+ );
132198
132182
  rootStore.onEditorRegistered(() => {
132199
132183
  getEditStore().propertiesPanelManager.setPropertiesDefinition(
132200
132184
  type5,
@@ -132988,7 +132972,7 @@ const propertiesDefinition$i = {
132988
132972
  })
132989
132973
  })
132990
132974
  };
132991
- const Button$3 = registerComponent$1(
132975
+ const Button$3 = registerComponentInternal(
132992
132976
  "Button",
132993
132977
  {
132994
132978
  propertiesDefinition: propertiesDefinition$i,
@@ -133540,7 +133524,7 @@ const propertiesDefinition$h = {
133540
133524
  loading: loading()
133541
133525
  })
133542
133526
  };
133543
- const Section2 = registerComponent$1(
133527
+ const Section2 = registerComponentInternal(
133544
133528
  "Section",
133545
133529
  {
133546
133530
  propertiesDefinition: propertiesDefinition$h
@@ -134057,7 +134041,7 @@ const InternalContainer = (props2) => {
134057
134041
  }
134058
134042
  );
134059
134043
  };
134060
- const Container = registerComponent$1(
134044
+ const Container = registerComponentInternal(
134061
134045
  "Container",
134062
134046
  {
134063
134047
  propertiesDefinition: propertiesDefinition$g
@@ -134109,7 +134093,7 @@ const propertiesDefinition$f = {
134109
134093
  };
134110
134094
  const CONTAINER_MIN_WIDTH = Dim.px(0);
134111
134095
  const CONTAINER_FILL_DIM = Dim.fill();
134112
- const Column = registerComponent$1(
134096
+ const Column = registerComponentInternal(
134113
134097
  "Column",
134114
134098
  {
134115
134099
  propertiesDefinition: propertiesDefinition$f
@@ -141688,8 +141672,8 @@ const propertiesDefinition$e = {
141688
141672
  }).docs({ description: "Triggers an action on input blur" })
141689
141673
  }),
141690
141674
  meta: Section$1.category(PropsPanelCategory.Meta).children({
141691
- text: Prop.any().readable().validate(VALIDATORS.TEXT_ALLOW_UNDEFINED).docs({ description: "The current text content of the input field" }),
141692
- isTouched: Prop.boolean().readable().default(false).docs({
141675
+ text: Prop.any().readAndWrite().validate(VALIDATORS.TEXT_ALLOW_UNDEFINED).docs({ description: "The current text content of the input field" }),
141676
+ isTouched: Prop.boolean().readAndWrite().default(false).docs({
141693
141677
  description: "Whether the input has been interacted with by the user"
141694
141678
  })
141695
141679
  }),
@@ -141711,7 +141695,7 @@ const propertiesDefinition$e = {
141711
141695
  })
141712
141696
  })
141713
141697
  };
141714
- const Input2 = registerComponent$1(
141698
+ const Input2 = registerComponentInternal(
141715
141699
  "Input",
141716
141700
  {
141717
141701
  propertiesDefinition: propertiesDefinition$e
@@ -141878,9 +141862,7 @@ const editorConfig$a = {
141878
141862
  };
141879
141863
  const propertiesDefinition$d = {
141880
141864
  contents: Section$1.category(PropsPanelCategory.Content).children({
141881
- children: Prop.children({
141882
- allowedChildren: ["Section"]
141883
- }),
141865
+ children: Prop.children(),
141884
141866
  columns: Prop.array().readAndWrite().propertiesPanel({
141885
141867
  label: "Sections",
141886
141868
  controlType: "SECTION_LIST",
@@ -141911,7 +141893,7 @@ const propertiesDefinition$d = {
141911
141893
  })
141912
141894
  })
141913
141895
  };
141914
- const Page = registerComponent$1(
141896
+ const Page = registerComponentInternal(
141915
141897
  "Page",
141916
141898
  {
141917
141899
  propertiesDefinition: propertiesDefinition$d
@@ -148898,7 +148880,7 @@ const useIconContainerStyles = ({
148898
148880
  };
148899
148881
  }, [iconGap, horizontalAlign]);
148900
148882
  };
148901
- const Text$1 = registerComponent$1(
148883
+ const Text$1 = registerComponentInternal(
148902
148884
  "Text",
148903
148885
  {
148904
148886
  propertiesDefinition: propertiesDefinition$c
@@ -149419,10 +149401,10 @@ const propertiesDefinition$b = {
149419
149401
  }),
149420
149402
  // non-configurable properties
149421
149403
  meta: Section$1.category(PropsPanelCategory.Meta).children({
149422
- isOpen: Prop.boolean().readable().default(false).docs({ description: "Whether the modal is currently open and visible" })
149404
+ isOpen: Prop.boolean().readAndWrite().default(false).docs({ description: "Whether the modal is currently open and visible" })
149423
149405
  })
149424
149406
  };
149425
- const Modal = registerComponent$1(
149407
+ const Modal = registerComponentInternal(
149426
149408
  "Modal",
149427
149409
  {
149428
149410
  propertiesDefinition: propertiesDefinition$b
@@ -149680,7 +149662,7 @@ const propertiesDefinition$a = {
149680
149662
  }),
149681
149663
  // non-configurable properties
149682
149664
  meta: Section$1.category(PropsPanelCategory.Meta).children({
149683
- isOpen: Prop.boolean().readable().default(false).docs({
149665
+ isOpen: Prop.boolean().readAndWrite().default(false).docs({
149684
149666
  description: "Whether the slideout is currently open and visible"
149685
149667
  })
149686
149668
  })
@@ -151865,7 +151847,7 @@ const SlideoutComponent = (props2) => {
151865
151847
  }
151866
151848
  );
151867
151849
  };
151868
- const Slideout = registerComponent$1(
151850
+ const Slideout = registerComponentInternal(
151869
151851
  "Slideout",
151870
151852
  {
151871
151853
  propertiesDefinition: propertiesDefinition$a
@@ -162009,14 +161991,14 @@ function getLoaderFn(options) {
162009
161991
  if (!(loader === "all")) return [3, 3];
162010
161992
  return [4, import(
162011
161993
  /* webpackChunkName: "blueprint-icons-all-paths-loader" */
162012
- "./allPathsLoader-CbhZCOLq.js"
161994
+ "./allPathsLoader-CUezeXdO.js"
162013
161995
  )];
162014
161996
  case 2:
162015
161997
  return [2, _b2.sent().allPathsLoader];
162016
161998
  case 3:
162017
161999
  return [4, import(
162018
162000
  /* webpackChunkName: "blueprint-icons-split-paths-by-size-loader" */
162019
- "./splitPathsBySizeLoader-BbneuAAM.js"
162001
+ "./splitPathsBySizeLoader-D3yKiTLq.js"
162020
162002
  )];
162021
162003
  case 4:
162022
162004
  return [2, _b2.sent().splitPathsBySizeLoader];
@@ -178119,7 +178101,7 @@ const propertiesDefinition$9 = {
178119
178101
  }
178120
178102
  };
178121
178103
  }
178122
- }).readable().propertiesPanel({
178104
+ }).readAndWrite().propertiesPanel({
178123
178105
  label: "Data",
178124
178106
  placeholder: '[{ "col1": "val1" }]',
178125
178107
  isJSConvertible: false,
@@ -178492,7 +178474,7 @@ const propertiesDefinition$9 = {
178492
178474
  searchText: Prop.string().readable().default(function() {
178493
178475
  return this.defaultSearchText ?? "";
178494
178476
  }).docs({ description: "The current search text applied to the table" }),
178495
- filters: Prop.any().readable().default(function() {
178477
+ filters: Prop.any().readAndWrite().default(function() {
178496
178478
  return this.defaultFilters;
178497
178479
  }).docs({ description: "The current filters applied to the table" }),
178498
178480
  hiddenColumns: Prop.any().readable().docs({
@@ -193451,7 +193433,7 @@ const EMPTY_ARRAY = [];
193451
193433
  const EMPTY_OBJ = {};
193452
193434
  const noop = () => {
193453
193435
  };
193454
- const Table = registerComponent$1(
193436
+ const Table = registerComponentInternal(
193455
193437
  "Table",
193456
193438
  {
193457
193439
  propertiesDefinition: propertiesDefinition$9
@@ -197376,7 +197358,7 @@ const propertiesDefinition$8 = {
197376
197358
  }).docs({
197377
197359
  description: "The array of options available for selection in the dropdown"
197378
197360
  }),
197379
- defaultValue: Prop.string().propertiesPanel({
197361
+ defaultValue: Prop.string().readAndWrite().propertiesPanel({
197380
197362
  label: "Default selected value",
197381
197363
  helpText: `Default selected value(s). Matches the "value" field from options. Can be an array when using multi-select`,
197382
197364
  placeholder: "Enter options",
@@ -197476,14 +197458,14 @@ const propertiesDefinition$8 = {
197476
197458
  })
197477
197459
  }),
197478
197460
  meta: Section$1.category(PropsPanelCategory.Meta).children({
197479
- metaSelectedOptionValue: Prop.any().default(function() {
197461
+ metaSelectedOptionValue: Prop.any().readAndWrite().default(function() {
197480
197462
  return this.defaultValue;
197481
197463
  }),
197482
- metaSelectedOptionValueArr: Prop.any().default(function() {
197464
+ metaSelectedOptionValueArr: Prop.any().readAndWrite().default(function() {
197483
197465
  return Array.isArray(this.defaultValue) ? this.defaultValue : [this.defaultValue];
197484
197466
  }),
197485
- isTouched: Prop.boolean().default(false),
197486
- searchText: Prop.string()
197467
+ isTouched: Prop.boolean().readAndWrite().default(false),
197468
+ searchText: Prop.string().readAndWrite()
197487
197469
  }),
197488
197470
  derived: Section$1.category(PropsPanelCategory.Derived).children({
197489
197471
  value: Prop.any().readable().default(function() {
@@ -197696,7 +197678,7 @@ const DropdownStyleOverrides = qe$1.div`
197696
197678
  ${(props2) => props2.$vertical ? labelStyle.vertical : labelStyle.horizontal}
197697
197679
  }
197698
197680
  `;
197699
- const Dropdown = registerComponent$1(
197681
+ const Dropdown = registerComponentInternal(
197700
197682
  "Dropdown",
197701
197683
  {
197702
197684
  propertiesDefinition: propertiesDefinition$8
@@ -197937,7 +197919,7 @@ const Dropdown = registerComponent$1(
197937
197919
  ) }) });
197938
197920
  }
197939
197921
  ).editorConfig(editorConfig$5).addEditorTemplate(editorTemplate$5);
197940
- const CustomComponent = registerComponent$1(
197922
+ const CustomComponent = registerComponentInternal(
197941
197923
  "CustomComponent",
197942
197924
  {
197943
197925
  propertiesDefinition: {}
@@ -198015,7 +197997,7 @@ function registerComponent(name, propertiesDefinition2, component) {
198015
197997
  } else {
198016
197998
  allSections = propertiesDefinition2;
198017
197999
  }
198018
- return registerComponent$1(
198000
+ return registerComponentInternal(
198019
198001
  name,
198020
198002
  {
198021
198003
  propertiesDefinition: allSections,
@@ -198187,8 +198169,8 @@ const propertiesDefinition$7 = {
198187
198169
  }),
198188
198170
  // non-configurable properties
198189
198171
  meta: Section$1.category(PropsPanelCategory.Meta).children({
198190
- isTouched: Prop.boolean().default(false),
198191
- isChecked: Prop.boolean().readable().default(function() {
198172
+ isTouched: Prop.boolean().readAndWrite().default(false),
198173
+ isChecked: Prop.boolean().readAndWrite().default(function() {
198192
198174
  return this.defaultChecked;
198193
198175
  }).docs({ description: "The current checked state of the checkbox" })
198194
198176
  }),
@@ -198228,7 +198210,7 @@ const CheckboxContainer = qe$1.div`
198228
198210
  flex-direction: column;
198229
198211
  align-items: flex-start;
198230
198212
  `;
198231
- const Checkbox = registerComponent$1(
198213
+ const Checkbox = registerComponentInternal(
198232
198214
  "Checkbox",
198233
198215
  {
198234
198216
  propertiesDefinition: propertiesDefinition$7
@@ -198551,7 +198533,7 @@ const propertiesDefinition$6 = {
198551
198533
  * Also handles meta properties like isTouched & selectedDate
198552
198534
  */
198553
198535
  meta: Section$1.category(PropsPanelCategory.Meta).children({
198554
- selectedDate: Prop.string().readable().default(function() {
198536
+ selectedDate: Prop.string().readAndWrite().default(function() {
198555
198537
  return this.defaultDate;
198556
198538
  }).docs({ description: "The currently selected date in the date picker" }),
198557
198539
  isTouched: Prop.boolean().default(false)
@@ -198620,7 +198602,7 @@ const DatePickerContainer = qe$1.div`
198620
198602
  align-items: flex-start;
198621
198603
  width: 100%;
198622
198604
  `;
198623
- const DatePicker = registerComponent$1(
198605
+ const DatePicker = registerComponentInternal(
198624
198606
  "DatePicker",
198625
198607
  {
198626
198608
  propertiesDefinition: propertiesDefinition$6
@@ -198783,8 +198765,8 @@ const propertiesDefinition$5 = {
198783
198765
  }),
198784
198766
  // non-configurable properties
198785
198767
  meta: Section$1.category(PropsPanelCategory.Meta).children({
198786
- isTouched: Prop.boolean().default(false),
198787
- isChecked: Prop.boolean().readable().default(function() {
198768
+ isTouched: Prop.boolean().readAndWrite().default(false),
198769
+ isChecked: Prop.boolean().readAndWrite().default(function() {
198788
198770
  return this.defaultChecked;
198789
198771
  }).docs({ description: "The current checked state of the switch" })
198790
198772
  }),
@@ -198960,7 +198942,7 @@ const SwitchContainer = qe$1.div`
198960
198942
  flex-direction: column;
198961
198943
  align-items: flex-start;
198962
198944
  `;
198963
- const Switch = registerComponent$1(
198945
+ const Switch = registerComponentInternal(
198964
198946
  "Switch",
198965
198947
  {
198966
198948
  propertiesDefinition: propertiesDefinition$5
@@ -199070,7 +199052,7 @@ const propertiesDefinition$4 = {
199070
199052
  const StyledContainer = qe$1.div`
199071
199053
  overflow: hidden;
199072
199054
  `;
199073
- const Icon = registerComponent$1(
199055
+ const Icon = registerComponentInternal(
199074
199056
  "Icon",
199075
199057
  {
199076
199058
  propertiesDefinition: propertiesDefinition$4
@@ -199347,7 +199329,7 @@ const ImageContainer = qe$1.div`
199347
199329
  align-items: flex-start;
199348
199330
  overflow-y: hidden;
199349
199331
  `;
199350
- const Image = registerComponent$1(
199332
+ const Image = registerComponentInternal(
199351
199333
  "Image",
199352
199334
  {
199353
199335
  propertiesDefinition: propertiesDefinition$3
@@ -200589,6 +200571,12 @@ const EmbedWrapper$2 = (props2) => {
200589
200571
  case "operations/editor:selectWidgets": {
200590
200572
  const sourceIds = action2.payload.sourceIds;
200591
200573
  getEditStore().ui.setSelectedSourceIds(sourceIds);
200574
+ const instanceIds = sourceIds.map((sourceId) => {
200575
+ return getEditStore().runtimeEntitiesManager.widgets.getAnyInstanceIdForSourceId(
200576
+ sourceId
200577
+ );
200578
+ });
200579
+ getEditStore().ui.setSelectedInstanceIds(instanceIds);
200592
200580
  break;
200593
200581
  }
200594
200582
  case "RUN_API": {
@@ -203158,4 +203146,4 @@ export {
203158
203146
  setQueryParams as y,
203159
203147
  download as z
203160
203148
  };
203161
- //# sourceMappingURL=index-DoQuZXxx.js.map
203149
+ //# sourceMappingURL=index-DG9yo3A6.js.map