@reacteditor/core 0.0.4 → 0.0.6

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 (51) hide show
  1. package/dist/Editor-4LPVLYSU.css +415 -0
  2. package/dist/{Editor-2TYODRQT.mjs → Editor-YNFB7B6Z.mjs} +8 -8
  3. package/dist/{Render-VDC7AEQK.mjs → Render-STFB5CNO.mjs} +1 -1
  4. package/dist/Render-ZTUTUUAH.css +103 -0
  5. package/dist/{actions-BCDhqbeL.d.mts → actions-CQmL3wwa.d.mts} +11 -6
  6. package/dist/{actions-BCDhqbeL.d.ts → actions-CQmL3wwa.d.ts} +11 -6
  7. package/dist/{chunk-VD3EVRUF.mjs → chunk-275EJPEB.mjs} +2 -2
  8. package/dist/{chunk-ZHNRSSMW.mjs → chunk-6LG4Q4HO.mjs} +1 -1
  9. package/dist/chunk-6QJ2HF4O.mjs +11 -0
  10. package/dist/{chunk-6Q6A3BQH.mjs → chunk-BRDUM7MJ.mjs} +15 -15
  11. package/dist/{chunk-2LVYDXZS.mjs → chunk-CRF2GWQA.mjs} +3 -3
  12. package/dist/{chunk-TCVU3WEN.mjs → chunk-DB4R5IWG.mjs} +4 -4
  13. package/dist/{chunk-D2RG73WI.mjs → chunk-HCFEY5Y7.mjs} +475 -288
  14. package/dist/{chunk-VUEM62JF.mjs → chunk-UB2DES2O.mjs} +17 -6
  15. package/dist/{chunk-M2RKJTNY.mjs → chunk-WGPCLAZR.mjs} +1 -1
  16. package/dist/{chunk-HMTHZBH6.mjs → chunk-Z6IIVDFY.mjs} +1 -1
  17. package/dist/{full-7KJICNR5.mjs → full-24FOTNTB.mjs} +6 -6
  18. package/dist/full-7ABPY2WA.css +311 -0
  19. package/dist/{index-DVwiIwYU.d.mts → index-BOP2qNVA.d.mts} +1 -1
  20. package/dist/{index-ComBHfdn.d.ts → index-_G46lHpL.d.ts} +1 -1
  21. package/dist/index.css +1307 -1203
  22. package/dist/index.d.mts +11 -20
  23. package/dist/index.d.ts +11 -20
  24. package/dist/index.js +572 -372
  25. package/dist/index.mjs +10 -10
  26. package/dist/internal.d.mts +2 -2
  27. package/dist/internal.d.ts +2 -2
  28. package/dist/internal.js +17 -6
  29. package/dist/internal.mjs +1 -1
  30. package/dist/{loaded-DGSPK47E.mjs → loaded-6IBSSOXD.mjs} +3 -3
  31. package/dist/{loaded-IJNA4SY5.mjs → loaded-6NPDD7SF.mjs} +3 -3
  32. package/dist/{loaded-CBJRWD4Z.mjs → loaded-BQVZGQG2.mjs} +3 -3
  33. package/dist/loaded-N4KWL7FV.css +90 -0
  34. package/dist/no-external.css +1307 -1203
  35. package/dist/no-external.d.mts +4 -4
  36. package/dist/no-external.d.ts +4 -4
  37. package/dist/no-external.js +572 -372
  38. package/dist/no-external.mjs +10 -10
  39. package/dist/rsc.css +41 -41
  40. package/dist/rsc.d.mts +2 -2
  41. package/dist/rsc.d.ts +2 -2
  42. package/dist/rsc.js +5 -5
  43. package/dist/rsc.mjs +2 -2
  44. package/dist/{walk-tree-BPIigVTF.d.mts → walk-tree-Dwv3c_9M.d.mts} +1 -1
  45. package/dist/{walk-tree-BZq1CPCH.d.ts → walk-tree-DxSkPLnl.d.ts} +1 -1
  46. package/package.json +2 -1
  47. package/dist/Editor-GBV2O5RD.css +0 -415
  48. package/dist/Render-EFT7YD2C.css +0 -103
  49. package/dist/chunk-MFI3RDA4.mjs +0 -11
  50. package/dist/full-ELX6RALJ.css +0 -311
  51. package/dist/loaded-TBSVRJPY.css +0 -90
package/dist/index.d.mts CHANGED
@@ -1,10 +1,10 @@
1
- import { o as Field, p as FieldProps, q as DropZoneProps, C as Config, U as UserGenerics, D as Data, k as UiState, O as OnAction, f as Permissions, i as Plugin, j as Overrides, m as FieldTransforms, E as EditorAction, V as Viewports, I as IframeConfig, r as InitialHistory, M as Metadata, h as ResolveDataTrigger, s as ItemSelector, b as ComponentData, t as PluginInternal } from './actions-BCDhqbeL.mjs';
2
- export { u as Adaptor, A as AppState, v as ArrayField, w as ArrayState, x as AsFieldProps, B as BaseData, y as BaseField, z as CacheOpts, l as ComponentConfig, G as ComponentConfigExtensions, J as ComponentConfigParams, K as ComponentDataMap, L as ComponentDataOptionalId, N as ComponentMetadata, Q as ConfigParams, a as Content, S as CustomField, T as CustomFieldRender, d as DefaultComponentProps, c as DefaultComponents, e as DefaultRootFieldProps, X as DefaultRootProps, Y as DefaultRootRenderProps, Z as Direction, _ as DragAxis, $ as EditorComponent, a0 as EditorContext, a1 as EditorMetadata, a2 as ExternalField, a3 as ExternalFieldWithAdaptor, a4 as ExtractConfigParams, a5 as ExtractField, a6 as FieldMetadata, a7 as FieldRenderFunctions, a8 as FieldTransformFn, a9 as FieldTransformFnParams, F as Fields, H as History, aa as ItemWithId, ab as MappedItem, ac as NumberField, ad as ObjectField, ae as OverrideKey, af as RadioField, ag as RichText, n as RichtextField, ah as RootConfig, R as RootData, g 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 Viewport, aq as WithChildren, ar as WithEditorProps, W as WithId, as as WithSlotProps, at as overrideKeys } from './actions-BCDhqbeL.mjs';
3
- export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-BPIigVTF.mjs';
1
+ import { D as Data, o as Field, p as FieldProps, q as DropZoneProps, C as Config, U as UserGenerics, k as UiState, O as OnAction, f as Permissions, i as Plugin, j as Overrides, m as FieldTransforms, E as EditorAction, V as Viewports, I as IframeConfig, r as InitialHistory, M as Metadata, h as ResolveDataTrigger, s as ItemSelector, b as ComponentData, t as PluginInternal } from './actions-CQmL3wwa.mjs';
2
+ export { u as Adaptor, A as AppState, v as ArrayField, w as ArrayState, x as AsFieldProps, B as BaseData, y as BaseField, z as CacheOpts, l as ComponentConfig, G as ComponentConfigExtensions, J as ComponentConfigParams, K as ComponentDataMap, L as ComponentDataOptionalId, N as ComponentMetadata, Q as ConfigParams, a as Content, S as CustomField, T as CustomFieldRender, d as DefaultComponentProps, c as DefaultComponents, e as DefaultRootFieldProps, X as DefaultRootProps, Y as DefaultRootRenderProps, Z as Direction, _ as DragAxis, $ as EditorComponent, a0 as EditorContext, a1 as EditorMetadata, a2 as ExternalField, a3 as ExternalFieldWithAdaptor, a4 as ExtractConfigParams, a5 as ExtractField, a6 as FieldMetadata, a7 as FieldRenderFunctions, a8 as FieldTransformFn, a9 as FieldTransformFnParams, F as Fields, H as History, aa as ItemWithId, ab as MappedItem, ac as NumberField, ad as ObjectField, ae as OverrideKey, af as RadioField, ag as RichText, n as RichtextField, ah as RootConfig, R as RootData, g 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 Viewport, aq as WithChildren, ar as WithEditorProps, W as WithId, as as WithSlotProps, at as overrideKeys } from './actions-CQmL3wwa.mjs';
3
+ export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-Dwv3c_9M.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-DVwiIwYU.mjs';
7
+ import { A as AppStore, G as GetPermissions, R as RefreshPermissions, H as HistorySlice } from './index-BOP2qNVA.mjs';
8
8
  import '@tiptap/react';
9
9
  import '@tiptap/extension-blockquote';
10
10
  import '@tiptap/extension-bold';
@@ -22,18 +22,12 @@ import '@tiptap/extension-text-align';
22
22
  import '@tiptap/extension-underline';
23
23
 
24
24
  /**
25
- * Shared state for components whose config has `global: true`. Keyed by
26
- * component type. Every instance of a global-marked component renders from
27
- * its entry in this map instead of its own props (except `children`, which
28
- * is always extrinsic).
29
- *
30
- * There is exactly one entry per component type. Multiple named variants of
31
- * the same component type are not supported in this shape — deliberately, to
32
- * avoid introducing references / IDs.
25
+ * Shared state for components whose config has `global: true`. Lives inside
26
+ * `data.globals` and is keyed by component type. Instances opt in per-node
27
+ * via `synced: true`; synced instances render from this map (children + id
28
+ * stay extrinsic).
33
29
  */
34
- type GlobalData = Record<string, {
35
- props: Record<string, any>;
36
- }>;
30
+ type GlobalsMap = NonNullable<Data["globals"]>;
37
31
 
38
32
  /**
39
33
  * A concrete page destination surfaced in the editor's page switcher.
@@ -167,10 +161,8 @@ type EditorProps<UserConfig extends Config = Config, G extends UserGenerics<User
167
161
  children?: ReactNode;
168
162
  config: UserConfig;
169
163
  data: Partial<G["UserData"] | Data>;
170
- globalData?: GlobalData;
171
164
  ui?: Partial<UiState>;
172
165
  onChange?: (data: G["UserData"]) => void;
173
- onGlobalsChange?: (globalData: GlobalData) => void;
174
166
  onPublish?: (data: G["UserData"]) => void;
175
167
  onAction?: OnAction<G["UserData"]>;
176
168
  permissions?: Partial<Permissions>;
@@ -224,10 +216,9 @@ declare const renderContext: react__default.Context<{
224
216
  data: Data;
225
217
  metadata: Metadata;
226
218
  }>;
227
- declare function Render<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>>({ config, data, globalData, metadata, }: {
219
+ declare function Render<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>>({ config, data, metadata, }: {
228
220
  config: UserConfig;
229
221
  data: Partial<G["UserData"] | Data>;
230
- globalData?: GlobalData;
231
222
  metadata?: Metadata;
232
223
  }): react_jsx_runtime.JSX.Element;
233
224
 
@@ -394,4 +385,4 @@ declare const outlinePlugin: () => Plugin;
394
385
 
395
386
  declare const legacySideBarPlugin: () => Plugin;
396
387
 
397
- export { Action, ActionBar, AutoField, Button, ComponentData, ComponentList, Config, Data, Drawer, DropZone, Editor, EditorAction, type EditorApi, Field, FieldLabel, FieldProps, FieldTransforms, type GlobalData, Group, IconButton, IframeConfig, InitialHistory, Label, Metadata, OnAction, Overrides, type PageMetadata, Permissions, Plugin, Render, ResolveDataTrigger, RichTextMenu, type Route, Separator, UiState, type UseEditorData, UserGenerics, Viewports, blocksPlugin, createUseEditor, fieldsPlugin, legacySideBarPlugin, outlinePlugin, pageMetadata, registerOverlayPortal, renderContext, setDeep, useEditor, useGetEditor };
388
+ export { Action, ActionBar, AutoField, Button, ComponentData, ComponentList, Config, Data, Drawer, DropZone, Editor, EditorAction, type EditorApi, Field, FieldLabel, FieldProps, FieldTransforms, type GlobalsMap, Group, IconButton, IframeConfig, InitialHistory, Label, Metadata, OnAction, Overrides, type PageMetadata, Permissions, Plugin, Render, ResolveDataTrigger, RichTextMenu, type Route, Separator, UiState, type UseEditorData, UserGenerics, Viewports, blocksPlugin, createUseEditor, fieldsPlugin, legacySideBarPlugin, outlinePlugin, pageMetadata, registerOverlayPortal, renderContext, setDeep, useEditor, useGetEditor };
package/dist/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- import { o as Field, p as FieldProps, q as DropZoneProps, C as Config, U as UserGenerics, D as Data, k as UiState, O as OnAction, f as Permissions, i as Plugin, j as Overrides, m as FieldTransforms, E as EditorAction, V as Viewports, I as IframeConfig, r as InitialHistory, M as Metadata, h as ResolveDataTrigger, s as ItemSelector, b as ComponentData, t as PluginInternal } from './actions-BCDhqbeL.js';
2
- export { u as Adaptor, A as AppState, v as ArrayField, w as ArrayState, x as AsFieldProps, B as BaseData, y as BaseField, z as CacheOpts, l as ComponentConfig, G as ComponentConfigExtensions, J as ComponentConfigParams, K as ComponentDataMap, L as ComponentDataOptionalId, N as ComponentMetadata, Q as ConfigParams, a as Content, S as CustomField, T as CustomFieldRender, d as DefaultComponentProps, c as DefaultComponents, e as DefaultRootFieldProps, X as DefaultRootProps, Y as DefaultRootRenderProps, Z as Direction, _ as DragAxis, $ as EditorComponent, a0 as EditorContext, a1 as EditorMetadata, a2 as ExternalField, a3 as ExternalFieldWithAdaptor, a4 as ExtractConfigParams, a5 as ExtractField, a6 as FieldMetadata, a7 as FieldRenderFunctions, a8 as FieldTransformFn, a9 as FieldTransformFnParams, F as Fields, H as History, aa as ItemWithId, ab as MappedItem, ac as NumberField, ad as ObjectField, ae as OverrideKey, af as RadioField, ag as RichText, n as RichtextField, ah as RootConfig, R as RootData, g 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 Viewport, aq as WithChildren, ar as WithEditorProps, W as WithId, as as WithSlotProps, at as overrideKeys } from './actions-BCDhqbeL.js';
3
- export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-BZq1CPCH.js';
1
+ import { D as Data, o as Field, p as FieldProps, q as DropZoneProps, C as Config, U as UserGenerics, k as UiState, O as OnAction, f as Permissions, i as Plugin, j as Overrides, m as FieldTransforms, E as EditorAction, V as Viewports, I as IframeConfig, r as InitialHistory, M as Metadata, h as ResolveDataTrigger, s as ItemSelector, b as ComponentData, t as PluginInternal } from './actions-CQmL3wwa.js';
2
+ export { u as Adaptor, A as AppState, v as ArrayField, w as ArrayState, x as AsFieldProps, B as BaseData, y as BaseField, z as CacheOpts, l as ComponentConfig, G as ComponentConfigExtensions, J as ComponentConfigParams, K as ComponentDataMap, L as ComponentDataOptionalId, N as ComponentMetadata, Q as ConfigParams, a as Content, S as CustomField, T as CustomFieldRender, d as DefaultComponentProps, c as DefaultComponents, e as DefaultRootFieldProps, X as DefaultRootProps, Y as DefaultRootRenderProps, Z as Direction, _ as DragAxis, $ as EditorComponent, a0 as EditorContext, a1 as EditorMetadata, a2 as ExternalField, a3 as ExternalFieldWithAdaptor, a4 as ExtractConfigParams, a5 as ExtractField, a6 as FieldMetadata, a7 as FieldRenderFunctions, a8 as FieldTransformFn, a9 as FieldTransformFnParams, F as Fields, H as History, aa as ItemWithId, ab as MappedItem, ac as NumberField, ad as ObjectField, ae as OverrideKey, af as RadioField, ag as RichText, n as RichtextField, ah as RootConfig, R as RootData, g 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 Viewport, aq as WithChildren, ar as WithEditorProps, W as WithId, as as WithSlotProps, at as overrideKeys } from './actions-CQmL3wwa.js';
3
+ export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-DxSkPLnl.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-ComBHfdn.js';
7
+ import { A as AppStore, G as GetPermissions, R as RefreshPermissions, H as HistorySlice } from './index-_G46lHpL.js';
8
8
  import '@tiptap/react';
9
9
  import '@tiptap/extension-blockquote';
10
10
  import '@tiptap/extension-bold';
@@ -22,18 +22,12 @@ import '@tiptap/extension-text-align';
22
22
  import '@tiptap/extension-underline';
23
23
 
24
24
  /**
25
- * Shared state for components whose config has `global: true`. Keyed by
26
- * component type. Every instance of a global-marked component renders from
27
- * its entry in this map instead of its own props (except `children`, which
28
- * is always extrinsic).
29
- *
30
- * There is exactly one entry per component type. Multiple named variants of
31
- * the same component type are not supported in this shape — deliberately, to
32
- * avoid introducing references / IDs.
25
+ * Shared state for components whose config has `global: true`. Lives inside
26
+ * `data.globals` and is keyed by component type. Instances opt in per-node
27
+ * via `synced: true`; synced instances render from this map (children + id
28
+ * stay extrinsic).
33
29
  */
34
- type GlobalData = Record<string, {
35
- props: Record<string, any>;
36
- }>;
30
+ type GlobalsMap = NonNullable<Data["globals"]>;
37
31
 
38
32
  /**
39
33
  * A concrete page destination surfaced in the editor's page switcher.
@@ -167,10 +161,8 @@ type EditorProps<UserConfig extends Config = Config, G extends UserGenerics<User
167
161
  children?: ReactNode;
168
162
  config: UserConfig;
169
163
  data: Partial<G["UserData"] | Data>;
170
- globalData?: GlobalData;
171
164
  ui?: Partial<UiState>;
172
165
  onChange?: (data: G["UserData"]) => void;
173
- onGlobalsChange?: (globalData: GlobalData) => void;
174
166
  onPublish?: (data: G["UserData"]) => void;
175
167
  onAction?: OnAction<G["UserData"]>;
176
168
  permissions?: Partial<Permissions>;
@@ -224,10 +216,9 @@ declare const renderContext: react__default.Context<{
224
216
  data: Data;
225
217
  metadata: Metadata;
226
218
  }>;
227
- declare function Render<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>>({ config, data, globalData, metadata, }: {
219
+ declare function Render<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>>({ config, data, metadata, }: {
228
220
  config: UserConfig;
229
221
  data: Partial<G["UserData"] | Data>;
230
- globalData?: GlobalData;
231
222
  metadata?: Metadata;
232
223
  }): react_jsx_runtime.JSX.Element;
233
224
 
@@ -394,4 +385,4 @@ declare const outlinePlugin: () => Plugin;
394
385
 
395
386
  declare const legacySideBarPlugin: () => Plugin;
396
387
 
397
- export { Action, ActionBar, AutoField, Button, ComponentData, ComponentList, Config, Data, Drawer, DropZone, Editor, EditorAction, type EditorApi, Field, FieldLabel, FieldProps, FieldTransforms, type GlobalData, Group, IconButton, IframeConfig, InitialHistory, Label, Metadata, OnAction, Overrides, type PageMetadata, Permissions, Plugin, Render, ResolveDataTrigger, RichTextMenu, type Route, Separator, UiState, type UseEditorData, UserGenerics, Viewports, blocksPlugin, createUseEditor, fieldsPlugin, legacySideBarPlugin, outlinePlugin, pageMetadata, registerOverlayPortal, renderContext, setDeep, useEditor, useGetEditor };
388
+ export { Action, ActionBar, AutoField, Button, ComponentData, ComponentList, Config, Data, Drawer, DropZone, Editor, EditorAction, type EditorApi, Field, FieldLabel, FieldProps, FieldTransforms, type GlobalsMap, Group, IconButton, IframeConfig, InitialHistory, Label, Metadata, OnAction, Overrides, type PageMetadata, Permissions, Plugin, Render, ResolveDataTrigger, RichTextMenu, type Route, Separator, UiState, type UseEditorData, UserGenerics, Viewports, blocksPlugin, createUseEditor, fieldsPlugin, legacySideBarPlugin, outlinePlugin, pageMetadata, registerOverlayPortal, renderContext, setDeep, useEditor, useGetEditor };