@reacteditor/core 0.0.5 → 0.0.7

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 (52) hide show
  1. package/dist/Editor-4LPVLYSU.css +415 -0
  2. package/dist/{Editor-POJT3RA2.mjs → Editor-OSAG52QF.mjs} +10 -10
  3. package/dist/{Render-JNABKPAF.mjs → Render-STFB5CNO.mjs} +1 -1
  4. package/dist/Render-ZTUTUUAH.css +103 -0
  5. package/dist/{actions-CQmL3wwa.d.mts → actions-BDMhAtxP.d.mts} +2 -1
  6. package/dist/{actions-CQmL3wwa.d.ts → actions-BDMhAtxP.d.ts} +2 -1
  7. package/dist/{chunk-KC727YFW.mjs → chunk-6QJ2HF4O.mjs} +1 -1
  8. package/dist/{chunk-IUOWXGYR.mjs → chunk-AAK2555H.mjs} +4 -4
  9. package/dist/{chunk-DCL4UC2H.mjs → chunk-EEQGJ6FH.mjs} +1 -1
  10. package/dist/{chunk-VOLQMQPK.mjs → chunk-IIRJMJFU.mjs} +1 -1
  11. package/dist/{chunk-43G2QHSV.mjs → chunk-JUC25FB7.mjs} +10 -10
  12. package/dist/{chunk-UB2DES2O.mjs → chunk-M4JDRFYB.mjs} +8 -6
  13. package/dist/{chunk-X7IRHSQN.mjs → chunk-RNRHREWH.mjs} +4 -4
  14. package/dist/{chunk-YFRH22NT.mjs → chunk-TI3KC54Y.mjs} +20 -20
  15. package/dist/{chunk-QB3US7UE.mjs → chunk-W5I2Z7QS.mjs} +580 -195
  16. package/dist/{chunk-5N6RK26Z.mjs → chunk-XI7YTBCP.mjs} +1 -1
  17. package/dist/{chunk-JEDWXGVP.mjs → chunk-ZLSPSBV3.mjs} +1 -1
  18. package/dist/full-7ABPY2WA.css +311 -0
  19. package/dist/{full-HZMEMWCN.mjs → full-IHV5BO2L.mjs} +8 -8
  20. package/dist/{index-BOP2qNVA.d.mts → index-BwLKseT7.d.mts} +1 -1
  21. package/dist/{index-_G46lHpL.d.ts → index-DkYXZRPz.d.ts} +1 -1
  22. package/dist/index.css +1268 -1165
  23. package/dist/index.d.mts +35 -8
  24. package/dist/index.d.ts +35 -8
  25. package/dist/index.js +640 -246
  26. package/dist/index.mjs +15 -15
  27. package/dist/internal.d.mts +2 -2
  28. package/dist/internal.d.ts +2 -2
  29. package/dist/internal.js +7 -5
  30. package/dist/internal.mjs +2 -2
  31. package/dist/{loaded-35JQLXSA.mjs → loaded-3NPQWYKN.mjs} +5 -5
  32. package/dist/{loaded-QJMKRN35.mjs → loaded-FTSXIONQ.mjs} +5 -5
  33. package/dist/loaded-N4KWL7FV.css +90 -0
  34. package/dist/{loaded-U6ZILQXM.mjs → loaded-YTQOQIUU.mjs} +5 -5
  35. package/dist/no-external.css +1268 -1165
  36. package/dist/no-external.d.mts +4 -4
  37. package/dist/no-external.d.ts +4 -4
  38. package/dist/no-external.js +640 -246
  39. package/dist/no-external.mjs +15 -15
  40. package/dist/rsc.css +40 -40
  41. package/dist/rsc.d.mts +2 -2
  42. package/dist/rsc.d.ts +2 -2
  43. package/dist/rsc.js +1 -1
  44. package/dist/rsc.mjs +4 -4
  45. package/dist/{walk-tree-DxSkPLnl.d.ts → walk-tree-BweEZ37Y.d.ts} +1 -1
  46. package/dist/{walk-tree-Dwv3c_9M.d.mts → walk-tree-LcQXXDqe.d.mts} +1 -1
  47. package/package.json +2 -1
  48. package/dist/Editor-WYZZDKT3.css +0 -415
  49. package/dist/Render-WBTAN6PO.css +0 -103
  50. package/dist/full-5442HPZH.css +0 -311
  51. package/dist/loaded-KZZU4RNL.css +0 -90
  52. package/dist/{chunk-GAUBBDIR.mjs → chunk-JIXMPJZA.mjs} +37 -37
package/dist/index.d.mts CHANGED
@@ -1,10 +1,10 @@
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';
1
+ import { D as Data, o as Field, p as FieldProps, 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, q as InitialHistory, M as Metadata, b as ComponentData, d as DefaultComponentProps, e as DefaultRootFieldProps, h as ResolveDataTrigger, r as ItemSelector, s as PluginInternal } from './actions-BDMhAtxP.mjs';
2
+ export { t as Adaptor, A as AppState, u as ArrayField, v as ArrayState, w as AsFieldProps, B as BaseData, x as BaseField, y as CacheOpts, l as ComponentConfig, z as ComponentConfigExtensions, G as ComponentConfigParams, J as ComponentDataMap, K as ComponentDataOptionalId, L as ComponentMetadata, N as ConfigParams, a as Content, Q as CustomField, S as CustomFieldRender, c as DefaultComponents, T as DefaultRootProps, X as DefaultRootRenderProps, Y as Direction, Z as DragAxis, _ as EditorComponent, $ as EditorContext, a0 as EditorMetadata, a1 as ExternalField, a2 as ExternalFieldWithAdaptor, a3 as ExtractConfigParams, a4 as ExtractField, a5 as FieldMetadata, a6 as FieldRenderFunctions, a7 as FieldTransformFn, a8 as FieldTransformFnParams, F as Fields, H as History, a9 as ItemWithId, aa as MappedItem, ab as NumberField, ac as ObjectField, ad as OverrideKey, ae as RadioField, af as RichText, n as RichtextField, ag as RootConfig, R as RootData, g as RootDataWithProps, ah as RootDataWithoutProps, ai as SelectField, aj as Slot, ak as SlotComponent, al as SlotField, am as TextField, an as TextareaField, ao as Viewport, ap as WithChildren, aq as WithEditorProps, W as WithId, ar as WithSlotProps, as as overrideKeys } from './actions-BDMhAtxP.mjs';
3
+ export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-LcQXXDqe.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-BOP2qNVA.mjs';
7
+ import { A as AppStore, G as GetPermissions, R as RefreshPermissions, H as HistorySlice } from './index-BwLKseT7.mjs';
8
8
  import '@tiptap/react';
9
9
  import '@tiptap/extension-blockquote';
10
10
  import '@tiptap/extension-bold';
@@ -141,8 +141,6 @@ declare const Drawer: {
141
141
  }) => react_jsx_runtime.JSX.Element;
142
142
  };
143
143
 
144
- declare const DropZone: react.ForwardRefExoticComponent<Omit<DropZoneProps, "ref"> & react.RefAttributes<HTMLDivElement>>;
145
-
146
144
  declare const IconButton: ({ active, children, href, onClick, type, disabled, tabIndex, newTab, fullWidth, title, suppressHydrationWarning, }: {
147
145
  active?: boolean;
148
146
  children: ReactNode;
@@ -196,6 +194,7 @@ type EditorProps<UserConfig extends Config = Config, G extends UserGenerics<User
196
194
  disableZoomControls?: boolean;
197
195
  _experimentalVirtualization?: boolean;
198
196
  };
197
+ declare const usePropsContext: () => EditorProps<Config, UserGenerics<Config>>;
199
198
  declare function Editor<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>>(props: EditorProps<UserConfig>): react_jsx_runtime.JSX.Element;
200
199
  declare namespace Editor {
201
200
  var Components: () => react_jsx_runtime.JSX.Element;
@@ -331,7 +330,35 @@ declare const registerOverlayPortal: (el: HTMLElement | null | undefined, opts?:
331
330
  */
332
331
  declare function setDeep<T extends Record<string, any>>(node: T, path: string, newVal: any): T;
333
332
 
334
- type UseEditorData<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>> = {
333
+ type Parent = {
334
+ id: string;
335
+ slot: string;
336
+ };
337
+ type InsertComponentArgs = {
338
+ type: string;
339
+ parent?: Parent;
340
+ index?: number;
341
+ data?: ComponentData;
342
+ select?: boolean;
343
+ };
344
+ type MoveDestination = {
345
+ parent?: Parent;
346
+ index: number;
347
+ };
348
+ type EditorCommands = {
349
+ insertComponent: (args: InsertComponentArgs) => {
350
+ id: string;
351
+ };
352
+ removeComponent: (id: string) => void;
353
+ duplicateComponent: (id: string) => void;
354
+ moveComponent: (id: string, to: MoveDestination) => void;
355
+ replaceComponent: (id: string, data: ComponentData) => void;
356
+ updateProps: (id: string, updater: Partial<DefaultComponentProps> | ((prev: DefaultComponentProps) => Partial<DefaultComponentProps>)) => void;
357
+ updateRoot: (updater: Partial<DefaultRootFieldProps> | ((prev: DefaultRootFieldProps) => Partial<DefaultRootFieldProps>)) => void;
358
+ selectComponent: (id: string | null) => void;
359
+ };
360
+
361
+ type UseEditorData<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>> = EditorCommands & {
335
362
  appState: G["UserPublicAppState"];
336
363
  config: UserConfig;
337
364
  dispatch: AppStore["dispatch"];
@@ -385,4 +412,4 @@ declare const outlinePlugin: () => Plugin;
385
412
 
386
413
  declare const legacySideBarPlugin: () => Plugin;
387
414
 
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 };
415
+ export { Action, ActionBar, AutoField, Button, ComponentData, ComponentList, Config, Data, DefaultComponentProps, DefaultRootFieldProps, Drawer, Editor, EditorAction, type EditorApi, type EditorCommands, Field, FieldLabel, FieldProps, FieldTransforms, type GlobalsMap, Group, IconButton, IframeConfig, InitialHistory, type InsertComponentArgs, Label, Metadata, type MoveDestination, OnAction, Overrides, type PageMetadata, type Parent, Permissions, Plugin, Render, ResolveDataTrigger, RichTextMenu, type Route, Separator, UiState, type UseEditorData, UserGenerics, Viewports, blocksPlugin, createUseEditor, fieldsPlugin, legacySideBarPlugin, outlinePlugin, pageMetadata, registerOverlayPortal, renderContext, setDeep, useEditor, useGetEditor, usePropsContext };
package/dist/index.d.ts CHANGED
@@ -1,10 +1,10 @@
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';
1
+ import { D as Data, o as Field, p as FieldProps, 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, q as InitialHistory, M as Metadata, b as ComponentData, d as DefaultComponentProps, e as DefaultRootFieldProps, h as ResolveDataTrigger, r as ItemSelector, s as PluginInternal } from './actions-BDMhAtxP.js';
2
+ export { t as Adaptor, A as AppState, u as ArrayField, v as ArrayState, w as AsFieldProps, B as BaseData, x as BaseField, y as CacheOpts, l as ComponentConfig, z as ComponentConfigExtensions, G as ComponentConfigParams, J as ComponentDataMap, K as ComponentDataOptionalId, L as ComponentMetadata, N as ConfigParams, a as Content, Q as CustomField, S as CustomFieldRender, c as DefaultComponents, T as DefaultRootProps, X as DefaultRootRenderProps, Y as Direction, Z as DragAxis, _ as EditorComponent, $ as EditorContext, a0 as EditorMetadata, a1 as ExternalField, a2 as ExternalFieldWithAdaptor, a3 as ExtractConfigParams, a4 as ExtractField, a5 as FieldMetadata, a6 as FieldRenderFunctions, a7 as FieldTransformFn, a8 as FieldTransformFnParams, F as Fields, H as History, a9 as ItemWithId, aa as MappedItem, ab as NumberField, ac as ObjectField, ad as OverrideKey, ae as RadioField, af as RichText, n as RichtextField, ag as RootConfig, R as RootData, g as RootDataWithProps, ah as RootDataWithoutProps, ai as SelectField, aj as Slot, ak as SlotComponent, al as SlotField, am as TextField, an as TextareaField, ao as Viewport, ap as WithChildren, aq as WithEditorProps, W as WithId, ar as WithSlotProps, as as overrideKeys } from './actions-BDMhAtxP.js';
3
+ export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-BweEZ37Y.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-_G46lHpL.js';
7
+ import { A as AppStore, G as GetPermissions, R as RefreshPermissions, H as HistorySlice } from './index-DkYXZRPz.js';
8
8
  import '@tiptap/react';
9
9
  import '@tiptap/extension-blockquote';
10
10
  import '@tiptap/extension-bold';
@@ -141,8 +141,6 @@ declare const Drawer: {
141
141
  }) => react_jsx_runtime.JSX.Element;
142
142
  };
143
143
 
144
- declare const DropZone: react.ForwardRefExoticComponent<Omit<DropZoneProps, "ref"> & react.RefAttributes<HTMLDivElement>>;
145
-
146
144
  declare const IconButton: ({ active, children, href, onClick, type, disabled, tabIndex, newTab, fullWidth, title, suppressHydrationWarning, }: {
147
145
  active?: boolean;
148
146
  children: ReactNode;
@@ -196,6 +194,7 @@ type EditorProps<UserConfig extends Config = Config, G extends UserGenerics<User
196
194
  disableZoomControls?: boolean;
197
195
  _experimentalVirtualization?: boolean;
198
196
  };
197
+ declare const usePropsContext: () => EditorProps<Config, UserGenerics<Config>>;
199
198
  declare function Editor<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>>(props: EditorProps<UserConfig>): react_jsx_runtime.JSX.Element;
200
199
  declare namespace Editor {
201
200
  var Components: () => react_jsx_runtime.JSX.Element;
@@ -331,7 +330,35 @@ declare const registerOverlayPortal: (el: HTMLElement | null | undefined, opts?:
331
330
  */
332
331
  declare function setDeep<T extends Record<string, any>>(node: T, path: string, newVal: any): T;
333
332
 
334
- type UseEditorData<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>> = {
333
+ type Parent = {
334
+ id: string;
335
+ slot: string;
336
+ };
337
+ type InsertComponentArgs = {
338
+ type: string;
339
+ parent?: Parent;
340
+ index?: number;
341
+ data?: ComponentData;
342
+ select?: boolean;
343
+ };
344
+ type MoveDestination = {
345
+ parent?: Parent;
346
+ index: number;
347
+ };
348
+ type EditorCommands = {
349
+ insertComponent: (args: InsertComponentArgs) => {
350
+ id: string;
351
+ };
352
+ removeComponent: (id: string) => void;
353
+ duplicateComponent: (id: string) => void;
354
+ moveComponent: (id: string, to: MoveDestination) => void;
355
+ replaceComponent: (id: string, data: ComponentData) => void;
356
+ updateProps: (id: string, updater: Partial<DefaultComponentProps> | ((prev: DefaultComponentProps) => Partial<DefaultComponentProps>)) => void;
357
+ updateRoot: (updater: Partial<DefaultRootFieldProps> | ((prev: DefaultRootFieldProps) => Partial<DefaultRootFieldProps>)) => void;
358
+ selectComponent: (id: string | null) => void;
359
+ };
360
+
361
+ type UseEditorData<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>> = EditorCommands & {
335
362
  appState: G["UserPublicAppState"];
336
363
  config: UserConfig;
337
364
  dispatch: AppStore["dispatch"];
@@ -385,4 +412,4 @@ declare const outlinePlugin: () => Plugin;
385
412
 
386
413
  declare const legacySideBarPlugin: () => Plugin;
387
414
 
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 };
415
+ export { Action, ActionBar, AutoField, Button, ComponentData, ComponentList, Config, Data, DefaultComponentProps, DefaultRootFieldProps, Drawer, Editor, EditorAction, type EditorApi, type EditorCommands, Field, FieldLabel, FieldProps, FieldTransforms, type GlobalsMap, Group, IconButton, IframeConfig, InitialHistory, type InsertComponentArgs, Label, Metadata, type MoveDestination, OnAction, Overrides, type PageMetadata, type Parent, Permissions, Plugin, Render, ResolveDataTrigger, RichTextMenu, type Route, Separator, UiState, type UseEditorData, UserGenerics, Viewports, blocksPlugin, createUseEditor, fieldsPlugin, legacySideBarPlugin, outlinePlugin, pageMetadata, registerOverlayPortal, renderContext, setDeep, useEditor, useGetEditor, usePropsContext };