@puckeditor/core 0.24.0 → 0.24.1-canary.1bbb39de

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.
@@ -79,7 +79,7 @@ function useSyncedEditor({
79
79
  }
80
80
  });
81
81
  useEffect(() => {
82
- if (!editor) return;
82
+ if (!editor || editor.isDestroyed) return;
83
83
  const handleFocus = () => {
84
84
  onFocusChange == null ? void 0 : onFocusChange(editor);
85
85
  };
@@ -99,11 +99,12 @@ function useSyncedEditor({
99
99
  }
100
100
  }, [editor, debouncedState, onChange, appStoreApi, name]);
101
101
  useEffect(() => {
102
- editor == null ? void 0 : editor.setEditable(editable);
102
+ if (!editor || editor.isDestroyed) return;
103
+ editor.setEditable(editable);
103
104
  }, [editor, editable]);
104
105
  useEffect(() => {
105
106
  var _a;
106
- if (!editor) return;
107
+ if (!editor || editor.isDestroyed) return;
107
108
  if (isPending) {
108
109
  return;
109
110
  }
@@ -2370,7 +2370,7 @@ EditorFallback.displayName = "EditorFallback";
2370
2370
  // components/AutoField/fields/RichtextField/index.tsx
2371
2371
  import { Fragment as Fragment5, jsx as jsx20 } from "react/jsx-runtime";
2372
2372
  var Editor = lazy(
2373
- () => import("./Editor-LJSLIQQP.mjs").then((m) => ({
2373
+ () => import("./Editor-CSDCBYXY.mjs").then((m) => ({
2374
2374
  default: m.Editor
2375
2375
  }))
2376
2376
  );
@@ -6052,7 +6052,7 @@ import {
6052
6052
  } from "react";
6053
6053
  import { jsx as jsx31 } from "react/jsx-runtime";
6054
6054
  var Editor2 = lazy2(
6055
- () => import("./Editor-LJSLIQQP.mjs").then((m) => ({
6055
+ () => import("./Editor-CSDCBYXY.mjs").then((m) => ({
6056
6056
  default: m.Editor
6057
6057
  }))
6058
6058
  );
@@ -143,10 +143,12 @@ declare const defaultDictionary: {
143
143
  readonly "loader-loading": "loading";
144
144
  };
145
145
  type DictionaryKey = keyof typeof defaultDictionary;
146
+ type BaseDictionary = Partial<Record<DictionaryKey, string> & Record<string, string>>;
146
147
  /**
147
148
  * Override any of Puck's built-in UI strings, or provide your own custom strings.
148
149
  */
149
- type Dictionary = Partial<Record<DictionaryKey, string> & Record<string, string>>;
150
+ interface Dictionary extends BaseDictionary {
151
+ }
150
152
 
151
153
  type Status = "LOADING" | "MOUNTED" | "READY";
152
154
  type ZoomConfig = {
@@ -143,10 +143,12 @@ declare const defaultDictionary: {
143
143
  readonly "loader-loading": "loading";
144
144
  };
145
145
  type DictionaryKey = keyof typeof defaultDictionary;
146
+ type BaseDictionary = Partial<Record<DictionaryKey, string> & Record<string, string>>;
146
147
  /**
147
148
  * Override any of Puck's built-in UI strings, or provide your own custom strings.
148
149
  */
149
- type Dictionary = Partial<Record<DictionaryKey, string> & Record<string, string>>;
150
+ interface Dictionary extends BaseDictionary {
151
+ }
150
152
 
151
153
  type Status = "LOADING" | "MOUNTED" | "READY";
152
154
  type ZoomConfig = {
package/dist/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { K as Field, N as FieldProps, L as FieldGroupVariant, F as DropZoneProps, n as Config, aq as UserGenerics, D as Data, ap as UiState, a0 as OnAction, a3 as Permissions, a4 as Plugin, a2 as Overrides, R as FieldTransforms, a7 as PuckAction, as as Viewports, U as IframeConfig, z as DndConfig, V as InitialHistory, Z as Metadata, ac as ResolveDataTrigger, W as ItemSelector, j as ComponentData, a5 as PluginInternal } from './actions-Dgllwd-W.mjs';
2
2
  export { A as Adaptor, a as AppState, b as ArrayField, c as ArrayState, d as AsFieldProps, B as BaseData, e as BaseField, C as CacheOpts, f as CheckboxField, g as ComponentConfig, h as ComponentConfigExtensions, i as ComponentConfigParams, k as ComponentDataMap, l as ComponentDataOptionalId, m as ComponentMetadata, o as ConfigParams, p as Content, q as CustomField, r as CustomFieldRender, s as DefaultComponentProps, t as DefaultComponents, u as DefaultRootFieldProps, v as DefaultRootProps, w as DefaultRootRenderProps, x as Direction, y as DndBehavior, E as DragAxis, G as ExternalField, H as ExternalFieldWithAdaptor, I as ExtractConfigParams, J as ExtractField, M as FieldMetadata, O as FieldRenderFunctions, P as FieldTransformFn, Q as FieldTransformFnParams, S as Fields, T as History, X as ItemWithId, Y as MappedItem, _ as NumberField, $ as ObjectField, a1 as OverrideKey, a8 as PuckComponent, a9 as PuckContext, aa as PuckMetadata, ab as RadioField, ad as RichText, ae as RichtextField, af as RootConfig, ag as RootData, ah as RootDataWithProps, ai as RootDataWithoutProps, aj as SelectField, ak as Slot, al as SlotComponent, am as SlotField, an as TextField, ao as TextareaField, ar as Viewport, at as WithChildren, au as WithDefaultRootFieldProps, av as WithId, aw as WithPuckProps, ax as WithSlotProps, ay as overrideKeys } from './actions-Dgllwd-W.mjs';
3
- import { D as Dictionary, A as AppStore, G as GetPermissions, R as RefreshPermissions, H as HistorySlice } from './index-D0qqZNSQ.mjs';
3
+ import { D as Dictionary, A as AppStore, G as GetPermissions, R as RefreshPermissions, H as HistorySlice } from './index-DDjbEIfs.mjs';
4
4
  export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-BA4pi921.mjs';
5
5
  import * as react from 'react';
6
6
  import react__default, { ReactNode, SyntheticEvent, ReactElement, ElementType, Ref, CSSProperties } from 'react';
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { K as Field, N as FieldProps, L as FieldGroupVariant, F as DropZoneProps, n as Config, aq as UserGenerics, D as Data, ap as UiState, a0 as OnAction, a3 as Permissions, a4 as Plugin, a2 as Overrides, R as FieldTransforms, a7 as PuckAction, as as Viewports, U as IframeConfig, z as DndConfig, V as InitialHistory, Z as Metadata, ac as ResolveDataTrigger, W as ItemSelector, j as ComponentData, a5 as PluginInternal } from './actions-Dgllwd-W.js';
2
2
  export { A as Adaptor, a as AppState, b as ArrayField, c as ArrayState, d as AsFieldProps, B as BaseData, e as BaseField, C as CacheOpts, f as CheckboxField, g as ComponentConfig, h as ComponentConfigExtensions, i as ComponentConfigParams, k as ComponentDataMap, l as ComponentDataOptionalId, m as ComponentMetadata, o as ConfigParams, p as Content, q as CustomField, r as CustomFieldRender, s as DefaultComponentProps, t as DefaultComponents, u as DefaultRootFieldProps, v as DefaultRootProps, w as DefaultRootRenderProps, x as Direction, y as DndBehavior, E as DragAxis, G as ExternalField, H as ExternalFieldWithAdaptor, I as ExtractConfigParams, J as ExtractField, M as FieldMetadata, O as FieldRenderFunctions, P as FieldTransformFn, Q as FieldTransformFnParams, S as Fields, T as History, X as ItemWithId, Y as MappedItem, _ as NumberField, $ as ObjectField, a1 as OverrideKey, a8 as PuckComponent, a9 as PuckContext, aa as PuckMetadata, ab as RadioField, ad as RichText, ae as RichtextField, af as RootConfig, ag as RootData, ah as RootDataWithProps, ai as RootDataWithoutProps, aj as SelectField, ak as Slot, al as SlotComponent, am as SlotField, an as TextField, ao as TextareaField, ar as Viewport, at as WithChildren, au as WithDefaultRootFieldProps, av as WithId, aw as WithPuckProps, ax as WithSlotProps, ay as overrideKeys } from './actions-Dgllwd-W.js';
3
- import { D as Dictionary, A as AppStore, G as GetPermissions, R as RefreshPermissions, H as HistorySlice } from './index-dKPCNzR1.js';
3
+ import { D as Dictionary, A as AppStore, G as GetPermissions, R as RefreshPermissions, H as HistorySlice } from './index-CT0X7S4r.js';
4
4
  export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-zKkZGcaE.js';
5
5
  import * as react from 'react';
6
6
  import react__default, { ReactNode, SyntheticEvent, ReactElement, ElementType, Ref, CSSProperties } from 'react';
package/dist/index.js CHANGED
@@ -5584,7 +5584,7 @@ function useSyncedEditor({
5584
5584
  }
5585
5585
  });
5586
5586
  (0, import_react40.useEffect)(() => {
5587
- if (!editor) return;
5587
+ if (!editor || editor.isDestroyed) return;
5588
5588
  const handleFocus = () => {
5589
5589
  onFocusChange == null ? void 0 : onFocusChange(editor);
5590
5590
  };
@@ -5604,11 +5604,12 @@ function useSyncedEditor({
5604
5604
  }
5605
5605
  }, [editor, debouncedState, onChange, appStoreApi, name]);
5606
5606
  (0, import_react40.useEffect)(() => {
5607
- editor == null ? void 0 : editor.setEditable(editable);
5607
+ if (!editor || editor.isDestroyed) return;
5608
+ editor.setEditable(editable);
5608
5609
  }, [editor, editable]);
5609
5610
  (0, import_react40.useEffect)(() => {
5610
5611
  var _a;
5611
- if (!editor) return;
5612
+ if (!editor || editor.isDestroyed) return;
5612
5613
  if (isPending) {
5613
5614
  return;
5614
5615
  }
package/dist/index.mjs CHANGED
@@ -20,7 +20,7 @@ import {
20
20
  setDeep,
21
21
  useGetPuck,
22
22
  usePuck
23
- } from "./chunk-DQXMVPVM.mjs";
23
+ } from "./chunk-7CQJTM2E.mjs";
24
24
  import "./chunk-UIJZMSVU.mjs";
25
25
  import {
26
26
  migrate,
@@ -1,6 +1,6 @@
1
1
  import { Reducer } from 'react';
2
2
  import { D as Data, a as AppState, a0 as OnAction, a6 as PrivateAppState, a7 as PuckAction } from './actions-Dgllwd-W.mjs';
3
- import { A as AppStore } from './index-D0qqZNSQ.mjs';
3
+ import { A as AppStore } from './index-DDjbEIfs.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
2
  import { D as Data, a as AppState, a0 as OnAction, a6 as PrivateAppState, a7 as PuckAction } from './actions-Dgllwd-W.js';
3
- import { A as AppStore } from './index-dKPCNzR1.js';
3
+ import { A as AppStore } from './index-CT0X7S4r.js';
4
4
  import '@tiptap/react';
5
5
  import '@tiptap/extension-blockquote';
6
6
  import '@tiptap/extension-bold';
@@ -1,5 +1,5 @@
1
1
  export { A as Adaptor, a as AppState, b as ArrayField, c as ArrayState, d as AsFieldProps, B as BaseData, e as BaseField, C as CacheOpts, f as CheckboxField, g as ComponentConfig, h as ComponentConfigExtensions, i as ComponentConfigParams, j as ComponentData, k as ComponentDataMap, l as ComponentDataOptionalId, m as ComponentMetadata, n as Config, o as ConfigParams, p as Content, q as CustomField, r as CustomFieldRender, D as Data, s as DefaultComponentProps, t as DefaultComponents, u as DefaultRootFieldProps, v as DefaultRootProps, w as DefaultRootRenderProps, x as Direction, y as DndBehavior, z as DndConfig, E as DragAxis, G as ExternalField, H as ExternalFieldWithAdaptor, I as ExtractConfigParams, J as ExtractField, K as Field, L as FieldGroupVariant, M as FieldMetadata, N as FieldProps, O as FieldRenderFunctions, P as FieldTransformFn, Q as FieldTransformFnParams, R as FieldTransforms, S as Fields, T as History, U as IframeConfig, V as InitialHistory, X as ItemWithId, Y as MappedItem, Z as Metadata, _ as NumberField, $ as ObjectField, a0 as OnAction, a1 as OverrideKey, a2 as Overrides, a3 as Permissions, a4 as Plugin, a7 as PuckAction, a8 as PuckComponent, a9 as PuckContext, aa as PuckMetadata, ab as RadioField, ac as ResolveDataTrigger, ad as RichText, ae as RichtextField, af as RootConfig, ag as RootData, ah as RootDataWithProps, ai as RootDataWithoutProps, aj as SelectField, ak as Slot, al as SlotComponent, am as SlotField, an as TextField, ao as TextareaField, ap as UiState, aq as UserGenerics, ar as Viewport, as as Viewports, at as WithChildren, au as WithDefaultRootFieldProps, av as WithId, aw as WithPuckProps, ax as WithSlotProps, ay as overrideKeys } from './actions-Dgllwd-W.mjs';
2
- export { D as Dictionary } from './index-D0qqZNSQ.mjs';
2
+ export { D as Dictionary } from './index-DDjbEIfs.mjs';
3
3
  export { Action, ActionBar, AutoField, BlocksPluginProps, Button, DragHandle, Drawer, DropZone, FieldGroup, FieldLabel, FieldTab, Group, IconButton, InlineTextField, Label, OutlinePluginProps, Puck, PuckApi, Render, RichTextMenu, Separator, UsePuckData, blocksPlugin, createUsePuck, fieldsPlugin, legacySideBarPlugin, outlinePlugin, registerOverlayPortal, renderContext, setDeep, useGetPuck, usePuck } from './index.mjs';
4
4
  export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-BA4pi921.mjs';
5
5
  import 'react';
@@ -1,5 +1,5 @@
1
1
  export { A as Adaptor, a as AppState, b as ArrayField, c as ArrayState, d as AsFieldProps, B as BaseData, e as BaseField, C as CacheOpts, f as CheckboxField, g as ComponentConfig, h as ComponentConfigExtensions, i as ComponentConfigParams, j as ComponentData, k as ComponentDataMap, l as ComponentDataOptionalId, m as ComponentMetadata, n as Config, o as ConfigParams, p as Content, q as CustomField, r as CustomFieldRender, D as Data, s as DefaultComponentProps, t as DefaultComponents, u as DefaultRootFieldProps, v as DefaultRootProps, w as DefaultRootRenderProps, x as Direction, y as DndBehavior, z as DndConfig, E as DragAxis, G as ExternalField, H as ExternalFieldWithAdaptor, I as ExtractConfigParams, J as ExtractField, K as Field, L as FieldGroupVariant, M as FieldMetadata, N as FieldProps, O as FieldRenderFunctions, P as FieldTransformFn, Q as FieldTransformFnParams, R as FieldTransforms, S as Fields, T as History, U as IframeConfig, V as InitialHistory, X as ItemWithId, Y as MappedItem, Z as Metadata, _ as NumberField, $ as ObjectField, a0 as OnAction, a1 as OverrideKey, a2 as Overrides, a3 as Permissions, a4 as Plugin, a7 as PuckAction, a8 as PuckComponent, a9 as PuckContext, aa as PuckMetadata, ab as RadioField, ac as ResolveDataTrigger, ad as RichText, ae as RichtextField, af as RootConfig, ag as RootData, ah as RootDataWithProps, ai as RootDataWithoutProps, aj as SelectField, ak as Slot, al as SlotComponent, am as SlotField, an as TextField, ao as TextareaField, ap as UiState, aq as UserGenerics, ar as Viewport, as as Viewports, at as WithChildren, au as WithDefaultRootFieldProps, av as WithId, aw as WithPuckProps, ax as WithSlotProps, ay as overrideKeys } from './actions-Dgllwd-W.js';
2
- export { D as Dictionary } from './index-dKPCNzR1.js';
2
+ export { D as Dictionary } from './index-CT0X7S4r.js';
3
3
  export { Action, ActionBar, AutoField, BlocksPluginProps, Button, DragHandle, Drawer, DropZone, FieldGroup, FieldLabel, FieldTab, Group, IconButton, InlineTextField, Label, OutlinePluginProps, Puck, PuckApi, Render, RichTextMenu, Separator, UsePuckData, blocksPlugin, createUsePuck, fieldsPlugin, legacySideBarPlugin, outlinePlugin, registerOverlayPortal, renderContext, setDeep, useGetPuck, usePuck } from './index.js';
4
4
  export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-zKkZGcaE.js';
5
5
  import 'react';
@@ -5584,7 +5584,7 @@ function useSyncedEditor({
5584
5584
  }
5585
5585
  });
5586
5586
  (0, import_react40.useEffect)(() => {
5587
- if (!editor) return;
5587
+ if (!editor || editor.isDestroyed) return;
5588
5588
  const handleFocus = () => {
5589
5589
  onFocusChange == null ? void 0 : onFocusChange(editor);
5590
5590
  };
@@ -5604,11 +5604,12 @@ function useSyncedEditor({
5604
5604
  }
5605
5605
  }, [editor, debouncedState, onChange, appStoreApi, name]);
5606
5606
  (0, import_react40.useEffect)(() => {
5607
- editor == null ? void 0 : editor.setEditable(editable);
5607
+ if (!editor || editor.isDestroyed) return;
5608
+ editor.setEditable(editable);
5608
5609
  }, [editor, editable]);
5609
5610
  (0, import_react40.useEffect)(() => {
5610
5611
  var _a;
5611
- if (!editor) return;
5612
+ if (!editor || editor.isDestroyed) return;
5612
5613
  if (isPending) {
5613
5614
  return;
5614
5615
  }
@@ -20,7 +20,7 @@ import {
20
20
  setDeep,
21
21
  useGetPuck,
22
22
  usePuck
23
- } from "./chunk-DQXMVPVM.mjs";
23
+ } from "./chunk-7CQJTM2E.mjs";
24
24
  import "./chunk-UIJZMSVU.mjs";
25
25
  import {
26
26
  migrate,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@puckeditor/core",
3
- "version": "0.24.0",
3
+ "version": "0.24.1-canary.1bbb39de",
4
4
  "description": "The open-source visual editor for React",
5
5
  "author": "Chris Villa <chris@puckeditor.com>",
6
6
  "repository": {