@puckeditor/core 0.21.1 → 0.22.0-canary.d4985bc0

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.
@@ -733,6 +733,7 @@ type Permissions = {
733
733
  type IframeConfig = {
734
734
  enabled?: boolean;
735
735
  waitForStyles?: boolean;
736
+ srcDoc?: string;
736
737
  };
737
738
  type OnAction<UserData extends Data = Data> = (action: PuckAction, appState: AppState<UserData>, prevAppState: AppState<UserData>) => void;
738
739
  type Plugin<UserConfig extends Config = Config> = {
@@ -733,6 +733,7 @@ type Permissions = {
733
733
  type IframeConfig = {
734
734
  enabled?: boolean;
735
735
  waitForStyles?: boolean;
736
+ srcDoc?: string;
736
737
  };
737
738
  type OnAction<UserData extends Data = Data> = (action: PuckAction, appState: AppState<UserData>, prevAppState: AppState<UserData>) => void;
738
739
  type Plugin<UserConfig extends Config = Config> = {
@@ -2774,7 +2774,6 @@ var DraggableComponent = ({
2774
2774
  };
2775
2775
  el.setAttribute("data-puck-component", id);
2776
2776
  el.setAttribute("data-puck-dnd", id);
2777
- el.style.position = "relative";
2778
2777
  el.addEventListener("click", onClick);
2779
2778
  el.addEventListener("mouseover", _onMouseOver);
2780
2779
  el.addEventListener("mouseout", _onMouseOut);
@@ -5670,7 +5669,6 @@ var CopyHostStyles = ({
5670
5669
  }
5671
5670
  };
5672
5671
  });
5673
- doc.head.innerHTML = "";
5674
5672
  doc.head.append(...filtered);
5675
5673
  observer.observe(parentDocument.head, { childList: true, subtree: true });
5676
5674
  filtered.forEach((el) => {
@@ -5706,12 +5704,16 @@ function AutoFrame(_a) {
5706
5704
  "onNotReady",
5707
5705
  "frameRef"
5708
5706
  ]);
5707
+ var _a2;
5709
5708
  const [loaded, setLoaded] = useState18(false);
5710
5709
  const [ctx, setCtx] = useState18({});
5711
5710
  const [mountTarget, setMountTarget] = useState18();
5712
5711
  const [stylesLoaded, setStylesLoaded] = useState18(false);
5712
+ const {
5713
+ srcDoc = '<!DOCTYPE html><html><head></head><body><div id="frame-root" data-puck-entry></div></body></html>'
5714
+ } = (_a2 = usePropsContext().iframe) != null ? _a2 : {};
5713
5715
  useEffect20(() => {
5714
- var _a2;
5716
+ var _a3;
5715
5717
  if (frameRef.current) {
5716
5718
  const doc = frameRef.current.contentDocument;
5717
5719
  const win = frameRef.current.contentWindow;
@@ -5720,7 +5722,7 @@ function AutoFrame(_a) {
5720
5722
  window: win || void 0
5721
5723
  });
5722
5724
  setMountTarget(
5723
- (_a2 = frameRef.current.contentDocument) == null ? void 0 : _a2.getElementById("frame-root")
5725
+ (_a3 = frameRef.current.contentDocument) == null ? void 0 : _a3.getElementById("frame-root")
5724
5726
  );
5725
5727
  if (doc && win && stylesLoaded) {
5726
5728
  onReady();
@@ -5734,7 +5736,7 @@ function AutoFrame(_a) {
5734
5736
  __spreadProps(__spreadValues({}, props), {
5735
5737
  className,
5736
5738
  id,
5737
- srcDoc: '<!DOCTYPE html><html><head></head><body><div id="frame-root" data-puck-entry></div></body></html>',
5739
+ srcDoc,
5738
5740
  ref: frameRef,
5739
5741
  onLoad: () => {
5740
5742
  setLoaded(true);
@@ -1,4 +1,4 @@
1
- import { H as History, g as Permissions, c as ComponentData, C as Config, U as UserGenerics, F as Fields, a as PuckAction, h as RootDataWithProps, i as ResolveDataTrigger, j as Plugin, k as Overrides, V as Viewports, I as IframeConfig, l as UiState, m as ComponentConfig, A as AppState, M as Metadata, n as FieldTransforms, o as RichtextField } from './actions-BkBoKAc5.js';
1
+ import { H as History, g as Permissions, c as ComponentData, C as Config, U as UserGenerics, F as Fields, a as PuckAction, h as RootDataWithProps, i as ResolveDataTrigger, j as Plugin, k as Overrides, V as Viewports, I as IframeConfig, l as UiState, m as ComponentConfig, A as AppState, M as Metadata, n as FieldTransforms, o as RichtextField } from './actions-BrxBrqKj.js';
2
2
  import { Editor } from '@tiptap/react';
3
3
 
4
4
  type HistorySlice<D = any> = {
@@ -1,4 +1,4 @@
1
- import { H as History, g as Permissions, c as ComponentData, C as Config, U as UserGenerics, F as Fields, a as PuckAction, h as RootDataWithProps, i as ResolveDataTrigger, j as Plugin, k as Overrides, V as Viewports, I as IframeConfig, l as UiState, m as ComponentConfig, A as AppState, M as Metadata, n as FieldTransforms, o as RichtextField } from './actions-BkBoKAc5.mjs';
1
+ import { H as History, g as Permissions, c as ComponentData, C as Config, U as UserGenerics, F as Fields, a as PuckAction, h as RootDataWithProps, i as ResolveDataTrigger, j as Plugin, k as Overrides, V as Viewports, I as IframeConfig, l as UiState, m as ComponentConfig, A as AppState, M as Metadata, n as FieldTransforms, o as RichtextField } from './actions-BrxBrqKj.mjs';
2
2
  import { Editor } from '@tiptap/react';
3
3
 
4
4
  type HistorySlice<D = any> = {
package/dist/index.d.mts CHANGED
@@ -1,10 +1,10 @@
1
- import { p as Field, q as FieldProps, r as DropZoneProps, C as Config, U as UserGenerics, D as Data, l as UiState, O as OnAction, g as Permissions, j as Plugin, k as Overrides, n as FieldTransforms, a as PuckAction, V as Viewports, I as IframeConfig, s as InitialHistory, M as Metadata, i as ResolveDataTrigger, t as ItemSelector, c as ComponentData, u as PluginInternal } from './actions-BkBoKAc5.mjs';
2
- export { ag as Adaptor, A as AppState, ae as ArrayField, N as ArrayState, ar as AsFieldProps, a0 as BaseData, a8 as BaseField, ai as CacheOpts, m as ComponentConfig, X as ComponentConfigExtensions, $ as ComponentConfigParams, a4 as ComponentDataMap, a2 as ComponentDataOptionalId, a6 as ComponentMetadata, _ as ConfigParams, b as Content, al as CustomField, ak as CustomFieldRender, e as DefaultComponentProps, d as DefaultComponents, f as DefaultRootFieldProps, ap as DefaultRootProps, ao as DefaultRootRenderProps, x as Direction, y as DragAxis, aj as ExternalField, ah as ExternalFieldWithAdaptor, Z as ExtractConfigParams, at as ExtractField, a7 as FieldMetadata, K as FieldRenderFunctions, E as FieldTransformFn, B as FieldTransformFnParams, F as Fields, H as History, L as ItemWithId, a3 as MappedItem, aa as NumberField, af as ObjectField, J as OverrideKey, T as PuckComponent, an as PuckContext, a5 as PuckMetadata, ad as RadioField, w as RichText, o as RichtextField, Y as RootConfig, R as RootData, h as RootDataWithProps, a1 as RootDataWithoutProps, ac as SelectField, S as Slot, Q as SlotComponent, am as SlotField, a9 as TextField, ab as TextareaField, z as Viewport, as as WithChildren, W as WithId, aq as WithPuckProps, v as WithSlotProps, G as overrideKeys } from './actions-BkBoKAc5.mjs';
3
- export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-CRRDqx6_.mjs';
1
+ import { p as Field, q as FieldProps, r as DropZoneProps, C as Config, U as UserGenerics, D as Data, l as UiState, O as OnAction, g as Permissions, j as Plugin, k as Overrides, n as FieldTransforms, a as PuckAction, V as Viewports, I as IframeConfig, s as InitialHistory, M as Metadata, i as ResolveDataTrigger, t as ItemSelector, c as ComponentData, u as PluginInternal } from './actions-BrxBrqKj.mjs';
2
+ export { ag as Adaptor, A as AppState, ae as ArrayField, N as ArrayState, ar as AsFieldProps, a0 as BaseData, a8 as BaseField, ai as CacheOpts, m as ComponentConfig, X as ComponentConfigExtensions, $ as ComponentConfigParams, a4 as ComponentDataMap, a2 as ComponentDataOptionalId, a6 as ComponentMetadata, _ as ConfigParams, b as Content, al as CustomField, ak as CustomFieldRender, e as DefaultComponentProps, d as DefaultComponents, f as DefaultRootFieldProps, ap as DefaultRootProps, ao as DefaultRootRenderProps, x as Direction, y as DragAxis, aj as ExternalField, ah as ExternalFieldWithAdaptor, Z as ExtractConfigParams, at as ExtractField, a7 as FieldMetadata, K as FieldRenderFunctions, E as FieldTransformFn, B as FieldTransformFnParams, F as Fields, H as History, L as ItemWithId, a3 as MappedItem, aa as NumberField, af as ObjectField, J as OverrideKey, T as PuckComponent, an as PuckContext, a5 as PuckMetadata, ad as RadioField, w as RichText, o as RichtextField, Y as RootConfig, R as RootData, h as RootDataWithProps, a1 as RootDataWithoutProps, ac as SelectField, S as Slot, Q as SlotComponent, am as SlotField, a9 as TextField, ab as TextareaField, z as Viewport, as as WithChildren, W as WithId, aq as WithPuckProps, v as WithSlotProps, G as overrideKeys } from './actions-BrxBrqKj.mjs';
3
+ export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-CQfHfM9_.mjs';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
5
5
  import * as react from 'react';
6
6
  import react__default, { ReactNode, SyntheticEvent, ReactElement, CSSProperties } from 'react';
7
- import { A as AppStore, G as GetPermissions, R as RefreshPermissions, H as HistorySlice } from './index-bqD1SEOb.mjs';
7
+ import { A as AppStore, G as GetPermissions, R as RefreshPermissions, H as HistorySlice } from './index-sczExwEC.mjs';
8
8
  import '@tiptap/react';
9
9
  import '@tiptap/extension-blockquote';
10
10
  import '@tiptap/extension-bold';
package/dist/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- import { p as Field, q as FieldProps, r as DropZoneProps, C as Config, U as UserGenerics, D as Data, l as UiState, O as OnAction, g as Permissions, j as Plugin, k as Overrides, n as FieldTransforms, a as PuckAction, V as Viewports, I as IframeConfig, s as InitialHistory, M as Metadata, i as ResolveDataTrigger, t as ItemSelector, c as ComponentData, u as PluginInternal } from './actions-BkBoKAc5.js';
2
- export { ag as Adaptor, A as AppState, ae as ArrayField, N as ArrayState, ar as AsFieldProps, a0 as BaseData, a8 as BaseField, ai as CacheOpts, m as ComponentConfig, X as ComponentConfigExtensions, $ as ComponentConfigParams, a4 as ComponentDataMap, a2 as ComponentDataOptionalId, a6 as ComponentMetadata, _ as ConfigParams, b as Content, al as CustomField, ak as CustomFieldRender, e as DefaultComponentProps, d as DefaultComponents, f as DefaultRootFieldProps, ap as DefaultRootProps, ao as DefaultRootRenderProps, x as Direction, y as DragAxis, aj as ExternalField, ah as ExternalFieldWithAdaptor, Z as ExtractConfigParams, at as ExtractField, a7 as FieldMetadata, K as FieldRenderFunctions, E as FieldTransformFn, B as FieldTransformFnParams, F as Fields, H as History, L as ItemWithId, a3 as MappedItem, aa as NumberField, af as ObjectField, J as OverrideKey, T as PuckComponent, an as PuckContext, a5 as PuckMetadata, ad as RadioField, w as RichText, o as RichtextField, Y as RootConfig, R as RootData, h as RootDataWithProps, a1 as RootDataWithoutProps, ac as SelectField, S as Slot, Q as SlotComponent, am as SlotField, a9 as TextField, ab as TextareaField, z as Viewport, as as WithChildren, W as WithId, aq as WithPuckProps, v as WithSlotProps, G as overrideKeys } from './actions-BkBoKAc5.js';
3
- export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-CS7sEpfG.js';
1
+ import { p as Field, q as FieldProps, r as DropZoneProps, C as Config, U as UserGenerics, D as Data, l as UiState, O as OnAction, g as Permissions, j as Plugin, k as Overrides, n as FieldTransforms, a as PuckAction, V as Viewports, I as IframeConfig, s as InitialHistory, M as Metadata, i as ResolveDataTrigger, t as ItemSelector, c as ComponentData, u as PluginInternal } from './actions-BrxBrqKj.js';
2
+ export { ag as Adaptor, A as AppState, ae as ArrayField, N as ArrayState, ar as AsFieldProps, a0 as BaseData, a8 as BaseField, ai as CacheOpts, m as ComponentConfig, X as ComponentConfigExtensions, $ as ComponentConfigParams, a4 as ComponentDataMap, a2 as ComponentDataOptionalId, a6 as ComponentMetadata, _ as ConfigParams, b as Content, al as CustomField, ak as CustomFieldRender, e as DefaultComponentProps, d as DefaultComponents, f as DefaultRootFieldProps, ap as DefaultRootProps, ao as DefaultRootRenderProps, x as Direction, y as DragAxis, aj as ExternalField, ah as ExternalFieldWithAdaptor, Z as ExtractConfigParams, at as ExtractField, a7 as FieldMetadata, K as FieldRenderFunctions, E as FieldTransformFn, B as FieldTransformFnParams, F as Fields, H as History, L as ItemWithId, a3 as MappedItem, aa as NumberField, af as ObjectField, J as OverrideKey, T as PuckComponent, an as PuckContext, a5 as PuckMetadata, ad as RadioField, w as RichText, o as RichtextField, Y as RootConfig, R as RootData, h as RootDataWithProps, a1 as RootDataWithoutProps, ac as SelectField, S as Slot, Q as SlotComponent, am as SlotField, a9 as TextField, ab as TextareaField, z as Viewport, as as WithChildren, W as WithId, aq as WithPuckProps, v as WithSlotProps, G as overrideKeys } from './actions-BrxBrqKj.js';
3
+ export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-B8hGlO4f.js';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
5
5
  import * as react from 'react';
6
6
  import react__default, { ReactNode, SyntheticEvent, ReactElement, CSSProperties } from 'react';
7
- import { A as AppStore, G as GetPermissions, R as RefreshPermissions, H as HistorySlice } from './index-lt1zf5WR.js';
7
+ import { A as AppStore, G as GetPermissions, R as RefreshPermissions, H as HistorySlice } from './index-GB3Q5h0c.js';
8
8
  import '@tiptap/react';
9
9
  import '@tiptap/extension-blockquote';
10
10
  import '@tiptap/extension-bold';
package/dist/index.js CHANGED
@@ -8286,7 +8286,6 @@ var DraggableComponent = ({
8286
8286
  };
8287
8287
  el.setAttribute("data-puck-component", id);
8288
8288
  el.setAttribute("data-puck-dnd", id);
8289
- el.style.position = "relative";
8290
8289
  el.addEventListener("click", onClick);
8291
8290
  el.addEventListener("mouseover", _onMouseOver);
8292
8291
  el.addEventListener("mouseout", _onMouseOut);
@@ -11415,7 +11414,6 @@ var CopyHostStyles = ({
11415
11414
  }
11416
11415
  };
11417
11416
  });
11418
- doc.head.innerHTML = "";
11419
11417
  doc.head.append(...filtered);
11420
11418
  observer.observe(parentDocument.head, { childList: true, subtree: true });
11421
11419
  filtered.forEach((el) => {
@@ -11451,12 +11449,16 @@ function AutoFrame(_a) {
11451
11449
  "onNotReady",
11452
11450
  "frameRef"
11453
11451
  ]);
11452
+ var _a2;
11454
11453
  const [loaded, setLoaded] = (0, import_react76.useState)(false);
11455
11454
  const [ctx, setCtx] = (0, import_react76.useState)({});
11456
11455
  const [mountTarget, setMountTarget] = (0, import_react76.useState)();
11457
11456
  const [stylesLoaded, setStylesLoaded] = (0, import_react76.useState)(false);
11457
+ const {
11458
+ srcDoc = '<!DOCTYPE html><html><head></head><body><div id="frame-root" data-puck-entry></div></body></html>'
11459
+ } = (_a2 = usePropsContext().iframe) != null ? _a2 : {};
11458
11460
  (0, import_react76.useEffect)(() => {
11459
- var _a2;
11461
+ var _a3;
11460
11462
  if (frameRef.current) {
11461
11463
  const doc = frameRef.current.contentDocument;
11462
11464
  const win = frameRef.current.contentWindow;
@@ -11465,7 +11467,7 @@ function AutoFrame(_a) {
11465
11467
  window: win || void 0
11466
11468
  });
11467
11469
  setMountTarget(
11468
- (_a2 = frameRef.current.contentDocument) == null ? void 0 : _a2.getElementById("frame-root")
11470
+ (_a3 = frameRef.current.contentDocument) == null ? void 0 : _a3.getElementById("frame-root")
11469
11471
  );
11470
11472
  if (doc && win && stylesLoaded) {
11471
11473
  onReady();
@@ -11479,7 +11481,7 @@ function AutoFrame(_a) {
11479
11481
  __spreadProps(__spreadValues({}, props), {
11480
11482
  className,
11481
11483
  id,
11482
- srcDoc: '<!DOCTYPE html><html><head></head><body><div id="frame-root" data-puck-entry></div></body></html>',
11484
+ srcDoc,
11483
11485
  ref: frameRef,
11484
11486
  onLoad: () => {
11485
11487
  setLoaded(true);
package/dist/index.mjs CHANGED
@@ -17,7 +17,7 @@ import {
17
17
  setDeep,
18
18
  useGetPuck,
19
19
  usePuck
20
- } from "./chunk-EBISZQTK.mjs";
20
+ } from "./chunk-ZUKMN2UE.mjs";
21
21
  import "./chunk-RHVK562Z.mjs";
22
22
  import {
23
23
  migrate,
@@ -1,6 +1,6 @@
1
1
  import { Reducer } from 'react';
2
- import { D as Data, A as AppState, O as OnAction, P as PrivateAppState, a as PuckAction } from './actions-BkBoKAc5.mjs';
3
- import { A as AppStore } from './index-bqD1SEOb.mjs';
2
+ import { D as Data, A as AppState, O as OnAction, P as PrivateAppState, a as PuckAction } from './actions-BrxBrqKj.mjs';
3
+ import { A as AppStore } from './index-sczExwEC.mjs';
4
4
  import '@tiptap/react';
5
5
  import '@tiptap/extension-blockquote';
6
6
  import '@tiptap/extension-bold';
@@ -1,6 +1,6 @@
1
1
  import { Reducer } from 'react';
2
- import { D as Data, A as AppState, O as OnAction, P as PrivateAppState, a as PuckAction } from './actions-BkBoKAc5.js';
3
- import { A as AppStore } from './index-lt1zf5WR.js';
2
+ import { D as Data, A as AppState, O as OnAction, P as PrivateAppState, a as PuckAction } from './actions-BrxBrqKj.js';
3
+ import { A as AppStore } from './index-GB3Q5h0c.js';
4
4
  import '@tiptap/react';
5
5
  import '@tiptap/extension-blockquote';
6
6
  import '@tiptap/extension-bold';
@@ -1,6 +1,6 @@
1
- export { ag as Adaptor, A as AppState, ae as ArrayField, N as ArrayState, ar as AsFieldProps, a0 as BaseData, a8 as BaseField, ai as CacheOpts, m as ComponentConfig, X as ComponentConfigExtensions, $ as ComponentConfigParams, c as ComponentData, a4 as ComponentDataMap, a2 as ComponentDataOptionalId, a6 as ComponentMetadata, C as Config, _ as ConfigParams, b as Content, al as CustomField, ak as CustomFieldRender, D as Data, e as DefaultComponentProps, d as DefaultComponents, f as DefaultRootFieldProps, ap as DefaultRootProps, ao as DefaultRootRenderProps, x as Direction, y as DragAxis, aj as ExternalField, ah as ExternalFieldWithAdaptor, Z as ExtractConfigParams, at as ExtractField, p as Field, a7 as FieldMetadata, q as FieldProps, K as FieldRenderFunctions, E as FieldTransformFn, B as FieldTransformFnParams, n as FieldTransforms, F as Fields, H as History, I as IframeConfig, s as InitialHistory, L as ItemWithId, a3 as MappedItem, M as Metadata, aa as NumberField, af as ObjectField, O as OnAction, J as OverrideKey, k as Overrides, g as Permissions, j as Plugin, a as PuckAction, T as PuckComponent, an as PuckContext, a5 as PuckMetadata, ad as RadioField, i as ResolveDataTrigger, w as RichText, o as RichtextField, Y as RootConfig, R as RootData, h as RootDataWithProps, a1 as RootDataWithoutProps, ac as SelectField, S as Slot, Q as SlotComponent, am as SlotField, a9 as TextField, ab as TextareaField, l as UiState, U as UserGenerics, z as Viewport, V as Viewports, as as WithChildren, W as WithId, aq as WithPuckProps, v as WithSlotProps, G as overrideKeys } from './actions-BkBoKAc5.mjs';
1
+ export { ag as Adaptor, A as AppState, ae as ArrayField, N as ArrayState, ar as AsFieldProps, a0 as BaseData, a8 as BaseField, ai as CacheOpts, m as ComponentConfig, X as ComponentConfigExtensions, $ as ComponentConfigParams, c as ComponentData, a4 as ComponentDataMap, a2 as ComponentDataOptionalId, a6 as ComponentMetadata, C as Config, _ as ConfigParams, b as Content, al as CustomField, ak as CustomFieldRender, D as Data, e as DefaultComponentProps, d as DefaultComponents, f as DefaultRootFieldProps, ap as DefaultRootProps, ao as DefaultRootRenderProps, x as Direction, y as DragAxis, aj as ExternalField, ah as ExternalFieldWithAdaptor, Z as ExtractConfigParams, at as ExtractField, p as Field, a7 as FieldMetadata, q as FieldProps, K as FieldRenderFunctions, E as FieldTransformFn, B as FieldTransformFnParams, n as FieldTransforms, F as Fields, H as History, I as IframeConfig, s as InitialHistory, L as ItemWithId, a3 as MappedItem, M as Metadata, aa as NumberField, af as ObjectField, O as OnAction, J as OverrideKey, k as Overrides, g as Permissions, j as Plugin, a as PuckAction, T as PuckComponent, an as PuckContext, a5 as PuckMetadata, ad as RadioField, i as ResolveDataTrigger, w as RichText, o as RichtextField, Y as RootConfig, R as RootData, h as RootDataWithProps, a1 as RootDataWithoutProps, ac as SelectField, S as Slot, Q as SlotComponent, am as SlotField, a9 as TextField, ab as TextareaField, l as UiState, U as UserGenerics, z as Viewport, V as Viewports, as as WithChildren, W as WithId, aq as WithPuckProps, v as WithSlotProps, G as overrideKeys } from './actions-BrxBrqKj.mjs';
2
2
  export { Action, ActionBar, AutoField, Button, Drawer, DropZone, FieldLabel, Group, IconButton, Label, Puck, PuckApi, Render, RichTextMenu, Separator, UsePuckData, blocksPlugin, createUsePuck, fieldsPlugin, legacySideBarPlugin, outlinePlugin, registerOverlayPortal, renderContext, setDeep, useGetPuck, usePuck } from './index.mjs';
3
- export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-CRRDqx6_.mjs';
3
+ export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-CQfHfM9_.mjs';
4
4
  import 'react';
5
5
  import '@tiptap/react';
6
6
  import '@tiptap/extension-blockquote';
@@ -18,4 +18,4 @@ import '@tiptap/extension-strike';
18
18
  import '@tiptap/extension-text-align';
19
19
  import '@tiptap/extension-underline';
20
20
  import 'react/jsx-runtime';
21
- import './index-bqD1SEOb.mjs';
21
+ import './index-sczExwEC.mjs';
@@ -1,6 +1,6 @@
1
- export { ag as Adaptor, A as AppState, ae as ArrayField, N as ArrayState, ar as AsFieldProps, a0 as BaseData, a8 as BaseField, ai as CacheOpts, m as ComponentConfig, X as ComponentConfigExtensions, $ as ComponentConfigParams, c as ComponentData, a4 as ComponentDataMap, a2 as ComponentDataOptionalId, a6 as ComponentMetadata, C as Config, _ as ConfigParams, b as Content, al as CustomField, ak as CustomFieldRender, D as Data, e as DefaultComponentProps, d as DefaultComponents, f as DefaultRootFieldProps, ap as DefaultRootProps, ao as DefaultRootRenderProps, x as Direction, y as DragAxis, aj as ExternalField, ah as ExternalFieldWithAdaptor, Z as ExtractConfigParams, at as ExtractField, p as Field, a7 as FieldMetadata, q as FieldProps, K as FieldRenderFunctions, E as FieldTransformFn, B as FieldTransformFnParams, n as FieldTransforms, F as Fields, H as History, I as IframeConfig, s as InitialHistory, L as ItemWithId, a3 as MappedItem, M as Metadata, aa as NumberField, af as ObjectField, O as OnAction, J as OverrideKey, k as Overrides, g as Permissions, j as Plugin, a as PuckAction, T as PuckComponent, an as PuckContext, a5 as PuckMetadata, ad as RadioField, i as ResolveDataTrigger, w as RichText, o as RichtextField, Y as RootConfig, R as RootData, h as RootDataWithProps, a1 as RootDataWithoutProps, ac as SelectField, S as Slot, Q as SlotComponent, am as SlotField, a9 as TextField, ab as TextareaField, l as UiState, U as UserGenerics, z as Viewport, V as Viewports, as as WithChildren, W as WithId, aq as WithPuckProps, v as WithSlotProps, G as overrideKeys } from './actions-BkBoKAc5.js';
1
+ export { ag as Adaptor, A as AppState, ae as ArrayField, N as ArrayState, ar as AsFieldProps, a0 as BaseData, a8 as BaseField, ai as CacheOpts, m as ComponentConfig, X as ComponentConfigExtensions, $ as ComponentConfigParams, c as ComponentData, a4 as ComponentDataMap, a2 as ComponentDataOptionalId, a6 as ComponentMetadata, C as Config, _ as ConfigParams, b as Content, al as CustomField, ak as CustomFieldRender, D as Data, e as DefaultComponentProps, d as DefaultComponents, f as DefaultRootFieldProps, ap as DefaultRootProps, ao as DefaultRootRenderProps, x as Direction, y as DragAxis, aj as ExternalField, ah as ExternalFieldWithAdaptor, Z as ExtractConfigParams, at as ExtractField, p as Field, a7 as FieldMetadata, q as FieldProps, K as FieldRenderFunctions, E as FieldTransformFn, B as FieldTransformFnParams, n as FieldTransforms, F as Fields, H as History, I as IframeConfig, s as InitialHistory, L as ItemWithId, a3 as MappedItem, M as Metadata, aa as NumberField, af as ObjectField, O as OnAction, J as OverrideKey, k as Overrides, g as Permissions, j as Plugin, a as PuckAction, T as PuckComponent, an as PuckContext, a5 as PuckMetadata, ad as RadioField, i as ResolveDataTrigger, w as RichText, o as RichtextField, Y as RootConfig, R as RootData, h as RootDataWithProps, a1 as RootDataWithoutProps, ac as SelectField, S as Slot, Q as SlotComponent, am as SlotField, a9 as TextField, ab as TextareaField, l as UiState, U as UserGenerics, z as Viewport, V as Viewports, as as WithChildren, W as WithId, aq as WithPuckProps, v as WithSlotProps, G as overrideKeys } from './actions-BrxBrqKj.js';
2
2
  export { Action, ActionBar, AutoField, Button, Drawer, DropZone, FieldLabel, Group, IconButton, Label, Puck, PuckApi, Render, RichTextMenu, Separator, UsePuckData, blocksPlugin, createUsePuck, fieldsPlugin, legacySideBarPlugin, outlinePlugin, registerOverlayPortal, renderContext, setDeep, useGetPuck, usePuck } from './index.js';
3
- export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-CS7sEpfG.js';
3
+ export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-B8hGlO4f.js';
4
4
  import 'react';
5
5
  import '@tiptap/react';
6
6
  import '@tiptap/extension-blockquote';
@@ -18,4 +18,4 @@ import '@tiptap/extension-strike';
18
18
  import '@tiptap/extension-text-align';
19
19
  import '@tiptap/extension-underline';
20
20
  import 'react/jsx-runtime';
21
- import './index-lt1zf5WR.js';
21
+ import './index-GB3Q5h0c.js';
@@ -8289,7 +8289,6 @@ var DraggableComponent = ({
8289
8289
  };
8290
8290
  el.setAttribute("data-puck-component", id);
8291
8291
  el.setAttribute("data-puck-dnd", id);
8292
- el.style.position = "relative";
8293
8292
  el.addEventListener("click", onClick);
8294
8293
  el.addEventListener("mouseover", _onMouseOver);
8295
8294
  el.addEventListener("mouseout", _onMouseOut);
@@ -11418,7 +11417,6 @@ var CopyHostStyles = ({
11418
11417
  }
11419
11418
  };
11420
11419
  });
11421
- doc.head.innerHTML = "";
11422
11420
  doc.head.append(...filtered);
11423
11421
  observer.observe(parentDocument.head, { childList: true, subtree: true });
11424
11422
  filtered.forEach((el) => {
@@ -11454,12 +11452,16 @@ function AutoFrame(_a) {
11454
11452
  "onNotReady",
11455
11453
  "frameRef"
11456
11454
  ]);
11455
+ var _a2;
11457
11456
  const [loaded, setLoaded] = (0, import_react76.useState)(false);
11458
11457
  const [ctx, setCtx] = (0, import_react76.useState)({});
11459
11458
  const [mountTarget, setMountTarget] = (0, import_react76.useState)();
11460
11459
  const [stylesLoaded, setStylesLoaded] = (0, import_react76.useState)(false);
11460
+ const {
11461
+ srcDoc = '<!DOCTYPE html><html><head></head><body><div id="frame-root" data-puck-entry></div></body></html>'
11462
+ } = (_a2 = usePropsContext().iframe) != null ? _a2 : {};
11461
11463
  (0, import_react76.useEffect)(() => {
11462
- var _a2;
11464
+ var _a3;
11463
11465
  if (frameRef.current) {
11464
11466
  const doc = frameRef.current.contentDocument;
11465
11467
  const win = frameRef.current.contentWindow;
@@ -11468,7 +11470,7 @@ function AutoFrame(_a) {
11468
11470
  window: win || void 0
11469
11471
  });
11470
11472
  setMountTarget(
11471
- (_a2 = frameRef.current.contentDocument) == null ? void 0 : _a2.getElementById("frame-root")
11473
+ (_a3 = frameRef.current.contentDocument) == null ? void 0 : _a3.getElementById("frame-root")
11472
11474
  );
11473
11475
  if (doc && win && stylesLoaded) {
11474
11476
  onReady();
@@ -11482,7 +11484,7 @@ function AutoFrame(_a) {
11482
11484
  __spreadProps(__spreadValues({}, props), {
11483
11485
  className,
11484
11486
  id,
11485
- srcDoc: '<!DOCTYPE html><html><head></head><body><div id="frame-root" data-puck-entry></div></body></html>',
11487
+ srcDoc,
11486
11488
  ref: frameRef,
11487
11489
  onLoad: () => {
11488
11490
  setLoaded(true);
@@ -17,7 +17,7 @@ import {
17
17
  setDeep,
18
18
  useGetPuck,
19
19
  usePuck
20
- } from "./chunk-EBISZQTK.mjs";
20
+ } from "./chunk-ZUKMN2UE.mjs";
21
21
  import "./chunk-RHVK562Z.mjs";
22
22
  import {
23
23
  migrate,
package/dist/rsc.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { C as Config, U as UserGenerics, M as Metadata } from './actions-BkBoKAc5.mjs';
3
- export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-CRRDqx6_.mjs';
2
+ import { C as Config, U as UserGenerics, M as Metadata } from './actions-BrxBrqKj.mjs';
3
+ export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-CQfHfM9_.mjs';
4
4
  import 'react';
5
5
  import '@tiptap/react';
6
6
  import '@tiptap/extension-blockquote';
package/dist/rsc.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { C as Config, U as UserGenerics, M as Metadata } from './actions-BkBoKAc5.js';
3
- export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-CS7sEpfG.js';
2
+ import { C as Config, U as UserGenerics, M as Metadata } from './actions-BrxBrqKj.js';
3
+ export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-B8hGlO4f.js';
4
4
  import 'react';
5
5
  import '@tiptap/react';
6
6
  import '@tiptap/extension-blockquote';
@@ -1,4 +1,4 @@
1
- import { C as Config, D as Data, W as WithId, U as UserGenerics, b as Content, c as ComponentData, d as DefaultComponents, e as DefaultComponentProps, f as DefaultRootFieldProps, M as Metadata, R as RootData } from './actions-BkBoKAc5.js';
1
+ import { C as Config, D as Data, W as WithId, U as UserGenerics, b as Content, c as ComponentData, d as DefaultComponents, e as DefaultComponentProps, f as DefaultRootFieldProps, M as Metadata, R as RootData } from './actions-BrxBrqKj.js';
2
2
 
3
3
  type MigrationOptions<UserConfig extends Config> = {
4
4
  migrateDynamicZonesForComponent?: {
@@ -1,4 +1,4 @@
1
- import { C as Config, D as Data, W as WithId, U as UserGenerics, b as Content, c as ComponentData, d as DefaultComponents, e as DefaultComponentProps, f as DefaultRootFieldProps, M as Metadata, R as RootData } from './actions-BkBoKAc5.mjs';
1
+ import { C as Config, D as Data, W as WithId, U as UserGenerics, b as Content, c as ComponentData, d as DefaultComponents, e as DefaultComponentProps, f as DefaultRootFieldProps, M as Metadata, R as RootData } from './actions-BrxBrqKj.mjs';
2
2
 
3
3
  type MigrationOptions<UserConfig extends Config> = {
4
4
  migrateDynamicZonesForComponent?: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@puckeditor/core",
3
- "version": "0.21.1",
3
+ "version": "0.22.0-canary.d4985bc0",
4
4
  "description": "The open-source visual editor for React",
5
5
  "author": "Chris Villa <chris@puckeditor.com>",
6
6
  "repository": "puckeditor/puck",