@measured/puck 0.16.0-canary.9e7d06f → 0.16.0-canary.a3518ca

Sign up to get free protection for your applications and to get access to all the features.
@@ -349,6 +349,7 @@ type Permissions = {
349
349
  } & Record<string, boolean>;
350
350
  type IframeConfig = {
351
351
  enabled?: boolean;
352
+ waitForStyles?: boolean;
352
353
  };
353
354
  type OnAction<UserData extends Data = Data> = (action: PuckAction, appState: AppState<UserData>, prevAppState: AppState<UserData>) => void;
354
355
  type Plugin = {
@@ -349,6 +349,7 @@ type Permissions = {
349
349
  } & Record<string, boolean>;
350
350
  type IframeConfig = {
351
351
  enabled?: boolean;
352
+ waitForStyles?: boolean;
352
353
  };
353
354
  type OnAction<UserData extends Data = Data> = (action: PuckAction, appState: AppState<UserData>, prevAppState: AppState<UserData>) => void;
354
355
  type Plugin = {
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { F as Field, a as FieldProps, C as Config, D as Data, I as ItemSelector, P as PuckAction, b as DropZoneProps, E as ExtractPropsFromConfig, c as ExtractRootPropsFromConfig, U as UiState, O as OnAction, d as Permissions, e as Plugin, f as Overrides, A as AppState, V as Viewports, g as IframeConfig, h as InitialHistory, i as DefaultComponentProps, j as DefaultRootFieldProps, k as ComponentData, H as History } from './actions-Dyg9ei4T.mjs';
2
- export { K as Adaptor, G as ArrayField, q as ArrayState, a1 as AsFieldProps, B as BaseData, x as BaseField, s as ComponentConfig, v as ComponentDataMap, w as Content, W as CustomField, _ as DefaultRootProps, Z as DefaultRootRenderProps, Q as ExternalField, L as ExternalFieldWithAdaptor, n as FieldRenderFunctions, X as Fields, p as ItemWithId, M as MappedItem, N as NumberField, J as ObjectField, m as OverrideKey, r as PuckComponent, Y as PuckContext, z as RadioField, u as RootData, R as RootDataWithProps, t as RootDataWithoutProps, S as SelectField, T as TextField, y as TextareaField, l as Viewport, a2 as WithChildren, $ as WithId, a0 as WithPuckProps, o as overrideKeys } from './actions-Dyg9ei4T.mjs';
1
+ import { F as Field, a as FieldProps, C as Config, D as Data, I as ItemSelector, P as PuckAction, b as DropZoneProps, E as ExtractPropsFromConfig, c as ExtractRootPropsFromConfig, U as UiState, O as OnAction, d as Permissions, e as Plugin, f as Overrides, A as AppState, V as Viewports, g as IframeConfig, h as InitialHistory, i as DefaultComponentProps, j as DefaultRootFieldProps, k as ComponentData, H as History } from './actions-BaAekM3E.mjs';
2
+ export { K as Adaptor, G as ArrayField, q as ArrayState, a1 as AsFieldProps, B as BaseData, x as BaseField, s as ComponentConfig, v as ComponentDataMap, w as Content, W as CustomField, _ as DefaultRootProps, Z as DefaultRootRenderProps, Q as ExternalField, L as ExternalFieldWithAdaptor, n as FieldRenderFunctions, X as Fields, p as ItemWithId, M as MappedItem, N as NumberField, J as ObjectField, m as OverrideKey, r as PuckComponent, Y as PuckContext, z as RadioField, u as RootData, R as RootDataWithProps, t as RootDataWithoutProps, S as SelectField, T as TextField, y as TextareaField, l as Viewport, a2 as WithChildren, $ as WithId, a0 as WithPuckProps, o as overrideKeys } from './actions-BaAekM3E.mjs';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import * as react from 'react';
5
5
  import { ReactNode, SyntheticEvent, ReactElement, CSSProperties } from 'react';
@@ -140,7 +140,7 @@ declare const IconButton: ({ children, href, onClick, variant, type, disabled, t
140
140
  title: string;
141
141
  }) => react_jsx_runtime.JSX.Element;
142
142
 
143
- declare function Puck<UserConfig extends Config = Config, UserProps extends ExtractPropsFromConfig<UserConfig> = ExtractPropsFromConfig<UserConfig>, UserRootProps extends ExtractRootPropsFromConfig<UserConfig> = ExtractRootPropsFromConfig<UserConfig>, UserData extends Data<UserProps, UserRootProps> | Data = Data<UserProps, UserRootProps>>({ children, config, data: initialData, ui: initialUi, onChange, onPublish, onAction, permissions, plugins, overrides, renderHeader, renderHeaderActions, headerTitle, headerPath, viewports, iframe, dnd, initialHistory: _initialHistory, }: {
143
+ declare function Puck<UserConfig extends Config = Config, UserProps extends ExtractPropsFromConfig<UserConfig> = ExtractPropsFromConfig<UserConfig>, UserRootProps extends ExtractRootPropsFromConfig<UserConfig> = ExtractRootPropsFromConfig<UserConfig>, UserData extends Data<UserProps, UserRootProps> | Data = Data<UserProps, UserRootProps>>({ children, config, data: initialData, ui: initialUi, onChange, onPublish, onAction, permissions, plugins, overrides, renderHeader, renderHeaderActions, headerTitle, headerPath, viewports, iframe: _iframe, dnd, initialHistory: _initialHistory, }: {
144
144
  children?: ReactNode;
145
145
  config: UserConfig;
146
146
  data: Partial<UserData>;
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { F as Field, a as FieldProps, C as Config, D as Data, I as ItemSelector, P as PuckAction, b as DropZoneProps, E as ExtractPropsFromConfig, c as ExtractRootPropsFromConfig, U as UiState, O as OnAction, d as Permissions, e as Plugin, f as Overrides, A as AppState, V as Viewports, g as IframeConfig, h as InitialHistory, i as DefaultComponentProps, j as DefaultRootFieldProps, k as ComponentData, H as History } from './actions-Dyg9ei4T.js';
2
- export { K as Adaptor, G as ArrayField, q as ArrayState, a1 as AsFieldProps, B as BaseData, x as BaseField, s as ComponentConfig, v as ComponentDataMap, w as Content, W as CustomField, _ as DefaultRootProps, Z as DefaultRootRenderProps, Q as ExternalField, L as ExternalFieldWithAdaptor, n as FieldRenderFunctions, X as Fields, p as ItemWithId, M as MappedItem, N as NumberField, J as ObjectField, m as OverrideKey, r as PuckComponent, Y as PuckContext, z as RadioField, u as RootData, R as RootDataWithProps, t as RootDataWithoutProps, S as SelectField, T as TextField, y as TextareaField, l as Viewport, a2 as WithChildren, $ as WithId, a0 as WithPuckProps, o as overrideKeys } from './actions-Dyg9ei4T.js';
1
+ import { F as Field, a as FieldProps, C as Config, D as Data, I as ItemSelector, P as PuckAction, b as DropZoneProps, E as ExtractPropsFromConfig, c as ExtractRootPropsFromConfig, U as UiState, O as OnAction, d as Permissions, e as Plugin, f as Overrides, A as AppState, V as Viewports, g as IframeConfig, h as InitialHistory, i as DefaultComponentProps, j as DefaultRootFieldProps, k as ComponentData, H as History } from './actions-BaAekM3E.js';
2
+ export { K as Adaptor, G as ArrayField, q as ArrayState, a1 as AsFieldProps, B as BaseData, x as BaseField, s as ComponentConfig, v as ComponentDataMap, w as Content, W as CustomField, _ as DefaultRootProps, Z as DefaultRootRenderProps, Q as ExternalField, L as ExternalFieldWithAdaptor, n as FieldRenderFunctions, X as Fields, p as ItemWithId, M as MappedItem, N as NumberField, J as ObjectField, m as OverrideKey, r as PuckComponent, Y as PuckContext, z as RadioField, u as RootData, R as RootDataWithProps, t as RootDataWithoutProps, S as SelectField, T as TextField, y as TextareaField, l as Viewport, a2 as WithChildren, $ as WithId, a0 as WithPuckProps, o as overrideKeys } from './actions-BaAekM3E.js';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import * as react from 'react';
5
5
  import { ReactNode, SyntheticEvent, ReactElement, CSSProperties } from 'react';
@@ -140,7 +140,7 @@ declare const IconButton: ({ children, href, onClick, variant, type, disabled, t
140
140
  title: string;
141
141
  }) => react_jsx_runtime.JSX.Element;
142
142
 
143
- declare function Puck<UserConfig extends Config = Config, UserProps extends ExtractPropsFromConfig<UserConfig> = ExtractPropsFromConfig<UserConfig>, UserRootProps extends ExtractRootPropsFromConfig<UserConfig> = ExtractRootPropsFromConfig<UserConfig>, UserData extends Data<UserProps, UserRootProps> | Data = Data<UserProps, UserRootProps>>({ children, config, data: initialData, ui: initialUi, onChange, onPublish, onAction, permissions, plugins, overrides, renderHeader, renderHeaderActions, headerTitle, headerPath, viewports, iframe, dnd, initialHistory: _initialHistory, }: {
143
+ declare function Puck<UserConfig extends Config = Config, UserProps extends ExtractPropsFromConfig<UserConfig> = ExtractPropsFromConfig<UserConfig>, UserRootProps extends ExtractRootPropsFromConfig<UserConfig> = ExtractRootPropsFromConfig<UserConfig>, UserData extends Data<UserProps, UserRootProps> | Data = Data<UserProps, UserRootProps>>({ children, config, data: initialData, ui: initialUi, onChange, onPublish, onAction, permissions, plugins, overrides, renderHeader, renderHeaderActions, headerTitle, headerPath, viewports, iframe: _iframe, dnd, initialHistory: _initialHistory, }: {
144
144
  children?: ReactNode;
145
145
  config: UserConfig;
146
146
  data: Partial<UserData>;
package/dist/index.js CHANGED
@@ -3639,7 +3639,7 @@ var useResolvedFields = () => {
3639
3639
  setResolvedFields(fields || {});
3640
3640
  setFieldsLoading(false);
3641
3641
  });
3642
- }, [data, defaultFields]);
3642
+ }, [data, defaultFields, state.ui.itemSelector]);
3643
3643
  return [resolvedFields, fieldsLoading];
3644
3644
  };
3645
3645
  var Fields = () => {
@@ -4970,7 +4970,7 @@ var Canvas = () => {
4970
4970
  "div",
4971
4971
  {
4972
4972
  className: getClassName26({
4973
- ready: status === "READY" || !iframe.enabled,
4973
+ ready: status === "READY" || !iframe.enabled || !iframe.waitForStyles,
4974
4974
  showLoader
4975
4975
  }),
4976
4976
  onClick: () => dispatch({
@@ -5128,13 +5128,15 @@ function Puck({
5128
5128
  headerTitle,
5129
5129
  headerPath,
5130
5130
  viewports = defaultViewports,
5131
- iframe = {
5132
- enabled: true
5133
- },
5131
+ iframe: _iframe,
5134
5132
  dnd,
5135
5133
  initialHistory: _initialHistory
5136
5134
  }) {
5137
5135
  var _a;
5136
+ const iframe = __spreadValues({
5137
+ enabled: true,
5138
+ waitForStyles: true
5139
+ }, _iframe);
5138
5140
  const [generatedAppState] = (0, import_react31.useState)(() => {
5139
5141
  var _a2, _b, _c, _d, _e, _f, _g, _h, _i;
5140
5142
  const initial = __spreadValues(__spreadValues({}, defaultAppState.ui), initialUi);
package/dist/index.mjs CHANGED
@@ -3550,7 +3550,7 @@ var useResolvedFields = () => {
3550
3550
  setResolvedFields(fields || {});
3551
3551
  setFieldsLoading(false);
3552
3552
  });
3553
- }, [data, defaultFields]);
3553
+ }, [data, defaultFields, state.ui.itemSelector]);
3554
3554
  return [resolvedFields, fieldsLoading];
3555
3555
  };
3556
3556
  var Fields = () => {
@@ -4893,7 +4893,7 @@ var Canvas = () => {
4893
4893
  "div",
4894
4894
  {
4895
4895
  className: getClassName26({
4896
- ready: status === "READY" || !iframe.enabled,
4896
+ ready: status === "READY" || !iframe.enabled || !iframe.waitForStyles,
4897
4897
  showLoader
4898
4898
  }),
4899
4899
  onClick: () => dispatch({
@@ -5051,13 +5051,15 @@ function Puck({
5051
5051
  headerTitle,
5052
5052
  headerPath,
5053
5053
  viewports = defaultViewports,
5054
- iframe = {
5055
- enabled: true
5056
- },
5054
+ iframe: _iframe,
5057
5055
  dnd,
5058
5056
  initialHistory: _initialHistory
5059
5057
  }) {
5060
5058
  var _a;
5059
+ const iframe = __spreadValues({
5060
+ enabled: true,
5061
+ waitForStyles: true
5062
+ }, _iframe);
5061
5063
  const [generatedAppState] = useState20(() => {
5062
5064
  var _a2, _b, _c, _d, _e, _f, _g, _h, _i;
5063
5065
  const initial = __spreadValues(__spreadValues({}, defaultAppState.ui), initialUi);
package/dist/rsc.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { C as Config, D as Data } from './actions-Dyg9ei4T.mjs';
2
+ import { C as Config, D as Data } from './actions-BaAekM3E.mjs';
3
3
  import 'react';
4
4
 
5
5
  declare function Render<UserConfig extends Config = Config>({ config, data, }: {
package/dist/rsc.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { C as Config, D as Data } from './actions-Dyg9ei4T.js';
2
+ import { C as Config, D as Data } from './actions-BaAekM3E.js';
3
3
  import 'react';
4
4
 
5
5
  declare function Render<UserConfig extends Config = Config>({ config, data, }: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@measured/puck",
3
- "version": "0.16.0-canary.9e7d06f",
3
+ "version": "0.16.0-canary.a3518ca",
4
4
  "author": "Measured Corporation Ltd <hello@measured.co>",
5
5
  "repository": "measuredco/puck",
6
6
  "bugs": "https://github.com/measuredco/puck/issues",