@orion-studios/payload-studio 0.6.0-beta.52 → 0.6.0-beta.53

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.
@@ -627,6 +627,25 @@ var propsFromAttributes = (attributes = {}) => {
627
627
  return props;
628
628
  };
629
629
  var previewForDefinition = (definition, props) => definition.editorPreview?.(props) || `<div class="orion-builder-v2-dynamic-placeholder"><strong>${definition.label}</strong></div>`;
630
+ var lockPreviewChildren = (component) => {
631
+ const children = typeof component.components === "function" ? component.components() : null;
632
+ const childList = children && typeof children === "object" && "forEach" in children ? children : null;
633
+ childList?.forEach((child) => {
634
+ if (typeof child.set === "function") {
635
+ child.set({
636
+ copyable: false,
637
+ draggable: false,
638
+ droppable: false,
639
+ editable: false,
640
+ highlightable: false,
641
+ hoverable: false,
642
+ removable: false,
643
+ selectable: false
644
+ });
645
+ }
646
+ lockPreviewChildren(child);
647
+ });
648
+ };
630
649
  var registerProjectDynamicComponents = (editor, adapter) => {
631
650
  const components = adapter?.components || {};
632
651
  Object.keys(components).forEach((type) => {
@@ -669,6 +688,7 @@ var registerProjectDynamicComponents = (editor, adapter) => {
669
688
  const attributes = this.model.getAttributes?.() || {};
670
689
  const props = propsFromAttributes(attributes);
671
690
  this.model.components(previewForDefinition(definition, props));
691
+ lockPreviewChildren(this.model);
672
692
  }
673
693
  }
674
694
  });
@@ -503,6 +503,25 @@ var propsFromAttributes = (attributes = {}) => {
503
503
  return props;
504
504
  };
505
505
  var previewForDefinition = (definition, props) => definition.editorPreview?.(props) || `<div class="orion-builder-v2-dynamic-placeholder"><strong>${definition.label}</strong></div>`;
506
+ var lockPreviewChildren = (component) => {
507
+ const children = typeof component.components === "function" ? component.components() : null;
508
+ const childList = children && typeof children === "object" && "forEach" in children ? children : null;
509
+ childList?.forEach((child) => {
510
+ if (typeof child.set === "function") {
511
+ child.set({
512
+ copyable: false,
513
+ draggable: false,
514
+ droppable: false,
515
+ editable: false,
516
+ highlightable: false,
517
+ hoverable: false,
518
+ removable: false,
519
+ selectable: false
520
+ });
521
+ }
522
+ lockPreviewChildren(child);
523
+ });
524
+ };
506
525
  var registerProjectDynamicComponents = (editor, adapter) => {
507
526
  const components = adapter?.components || {};
508
527
  Object.keys(components).forEach((type) => {
@@ -545,6 +564,7 @@ var registerProjectDynamicComponents = (editor, adapter) => {
545
564
  const attributes = this.model.getAttributes?.() || {};
546
565
  const props = propsFromAttributes(attributes);
547
566
  this.model.components(previewForDefinition(definition, props));
567
+ lockPreviewChildren(this.model);
548
568
  }
549
569
  }
550
570
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orion-studios/payload-studio",
3
- "version": "0.6.0-beta.52",
3
+ "version": "0.6.0-beta.53",
4
4
  "description": "Base CMS, builder, and custom admin toolkit for Orion Studios websites",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.js",