@reacteditor/core 0.0.6 → 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 (38) hide show
  1. package/dist/{Editor-YNFB7B6Z.mjs → Editor-OSAG52QF.mjs} +9 -9
  2. package/dist/{actions-CQmL3wwa.d.mts → actions-BDMhAtxP.d.mts} +2 -1
  3. package/dist/{actions-CQmL3wwa.d.ts → actions-BDMhAtxP.d.ts} +2 -1
  4. package/dist/{chunk-CRF2GWQA.mjs → chunk-AAK2555H.mjs} +3 -3
  5. package/dist/{chunk-6LG4Q4HO.mjs → chunk-EEQGJ6FH.mjs} +1 -1
  6. package/dist/{chunk-VOLQMQPK.mjs → chunk-IIRJMJFU.mjs} +1 -1
  7. package/dist/{chunk-BRDUM7MJ.mjs → chunk-JUC25FB7.mjs} +7 -7
  8. package/dist/{chunk-UB2DES2O.mjs → chunk-M4JDRFYB.mjs} +8 -6
  9. package/dist/{chunk-DB4R5IWG.mjs → chunk-RNRHREWH.mjs} +3 -3
  10. package/dist/{chunk-275EJPEB.mjs → chunk-TI3KC54Y.mjs} +18 -18
  11. package/dist/{chunk-HCFEY5Y7.mjs → chunk-W5I2Z7QS.mjs} +249 -24
  12. package/dist/{chunk-Z6IIVDFY.mjs → chunk-XI7YTBCP.mjs} +1 -1
  13. package/dist/{chunk-WGPCLAZR.mjs → chunk-ZLSPSBV3.mjs} +1 -1
  14. package/dist/{full-24FOTNTB.mjs → full-IHV5BO2L.mjs} +8 -8
  15. package/dist/{index-BOP2qNVA.d.mts → index-BwLKseT7.d.mts} +1 -1
  16. package/dist/{index-_G46lHpL.d.ts → index-DkYXZRPz.d.ts} +1 -1
  17. package/dist/index.d.mts +35 -8
  18. package/dist/index.d.ts +35 -8
  19. package/dist/index.js +284 -52
  20. package/dist/index.mjs +14 -14
  21. package/dist/internal.d.mts +2 -2
  22. package/dist/internal.d.ts +2 -2
  23. package/dist/internal.js +7 -5
  24. package/dist/internal.mjs +2 -2
  25. package/dist/{loaded-6NPDD7SF.mjs → loaded-3NPQWYKN.mjs} +5 -5
  26. package/dist/{loaded-BQVZGQG2.mjs → loaded-FTSXIONQ.mjs} +5 -5
  27. package/dist/{loaded-6IBSSOXD.mjs → loaded-YTQOQIUU.mjs} +5 -5
  28. package/dist/no-external.d.mts +4 -4
  29. package/dist/no-external.d.ts +4 -4
  30. package/dist/no-external.js +284 -52
  31. package/dist/no-external.mjs +14 -14
  32. package/dist/rsc.d.mts +2 -2
  33. package/dist/rsc.d.ts +2 -2
  34. package/dist/rsc.mjs +3 -3
  35. package/dist/{walk-tree-DxSkPLnl.d.ts → walk-tree-BweEZ37Y.d.ts} +1 -1
  36. package/dist/{walk-tree-Dwv3c_9M.d.mts → walk-tree-LcQXXDqe.d.mts} +1 -1
  37. package/package.json +1 -1
  38. package/dist/{chunk-GAUBBDIR.mjs → chunk-JIXMPJZA.mjs} +37 -37
@@ -4,20 +4,20 @@ import {
4
4
  import {
5
5
  EditorInner,
6
6
  LoadedRichTextMenu
7
- } from "./chunk-DB4R5IWG.mjs";
7
+ } from "./chunk-RNRHREWH.mjs";
8
8
  import "./chunk-6QJ2HF4O.mjs";
9
- import "./chunk-BRDUM7MJ.mjs";
10
- import "./chunk-Z6IIVDFY.mjs";
11
- import "./chunk-6LG4Q4HO.mjs";
12
- import "./chunk-WGPCLAZR.mjs";
9
+ import "./chunk-JUC25FB7.mjs";
10
+ import "./chunk-XI7YTBCP.mjs";
11
+ import "./chunk-EEQGJ6FH.mjs";
12
+ import "./chunk-ZLSPSBV3.mjs";
13
13
  import {
14
14
  useAppStore,
15
15
  useAppStoreApi
16
- } from "./chunk-CRF2GWQA.mjs";
17
- import "./chunk-UB2DES2O.mjs";
18
- import "./chunk-VOLQMQPK.mjs";
16
+ } from "./chunk-AAK2555H.mjs";
17
+ import "./chunk-M4JDRFYB.mjs";
18
+ import "./chunk-IIRJMJFU.mjs";
19
19
  import "./chunk-Y2EFNT5P.mjs";
20
- import "./chunk-GAUBBDIR.mjs";
20
+ import "./chunk-JIXMPJZA.mjs";
21
21
  import {
22
22
  __spreadProps,
23
23
  __spreadValues,
@@ -791,6 +791,7 @@ type InsertAction = {
791
791
  destinationIndex: number;
792
792
  destinationZone: string;
793
793
  id?: string;
794
+ data?: ComponentData;
794
795
  };
795
796
  type DuplicateAction = {
796
797
  type: "duplicate";
@@ -851,4 +852,4 @@ type EditorAction = {
851
852
  recordHistory?: boolean;
852
853
  } & (ReorderAction | InsertAction | MoveAction | ReplaceAction | ReplaceRootAction | RemoveAction | DuplicateAction | SetAction | SetDataAction | SetUiAction | RegisterZoneAction | UnregisterZoneAction);
853
854
 
854
- export { type EditorComponent as $, type AppState as A, type BaseData as B, type Config as C, type Data as D, type EditorAction as E, type Fields as F, type ComponentConfigExtensions as G, type History as H, type IframeConfig as I, type ComponentConfigParams as J, type ComponentDataMap as K, type ComponentDataOptionalId as L, type Metadata as M, type ComponentMetadata as N, type OnAction as O, type PrivateAppState as P, type ConfigParams as Q, type RootData as R, type CustomField as S, type CustomFieldRender as T, type UserGenerics as U, type Viewports as V, type WithId as W, type DefaultRootProps as X, type DefaultRootRenderProps as Y, type Direction as Z, type DragAxis as _, type Content as a, type EditorContext as a0, type EditorMetadata as a1, type ExternalField as a2, type ExternalFieldWithAdaptor as a3, type ExtractConfigParams as a4, type ExtractField as a5, type FieldMetadata as a6, type FieldRenderFunctions as a7, type FieldTransformFn as a8, type FieldTransformFnParams as a9, type ItemWithId as aa, type MappedItem as ab, type NumberField as ac, type ObjectField as ad, type OverrideKey as ae, type RadioField as af, type RichText as ag, type RootConfig as ah, type RootDataWithoutProps as ai, type SelectField as aj, type Slot as ak, type SlotComponent as al, type SlotField as am, type TextField as an, type TextareaField as ao, type Viewport as ap, type WithChildren as aq, type WithEditorProps as ar, type WithSlotProps as as, overrideKeys as at, type ComponentData as b, type DefaultComponents as c, type DefaultComponentProps as d, type DefaultRootFieldProps as e, type Permissions as f, type RootDataWithProps as g, type ResolveDataTrigger as h, type Plugin as i, type Overrides as j, type UiState as k, type ComponentConfig as l, type FieldTransforms as m, type RichtextField as n, type Field as o, type FieldProps as p, type DropZoneProps as q, type InitialHistory as r, type ItemSelector as s, type PluginInternal as t, type Adaptor as u, type ArrayField as v, type ArrayState as w, type AsFieldProps as x, type BaseField as y, type CacheOpts as z };
855
+ export { type EditorContext as $, type AppState as A, type BaseData as B, type Config as C, type Data as D, type EditorAction as E, type Fields as F, type ComponentConfigParams as G, type History as H, type IframeConfig as I, type ComponentDataMap as J, type ComponentDataOptionalId as K, type ComponentMetadata as L, type Metadata as M, type ConfigParams as N, type OnAction as O, type PrivateAppState as P, type CustomField as Q, type RootData as R, type CustomFieldRender as S, type DefaultRootProps as T, type UserGenerics as U, type Viewports as V, type WithId as W, type DefaultRootRenderProps as X, type Direction as Y, type DragAxis as Z, type EditorComponent as _, type Content as a, type EditorMetadata as a0, type ExternalField as a1, type ExternalFieldWithAdaptor as a2, type ExtractConfigParams as a3, type ExtractField as a4, type FieldMetadata as a5, type FieldRenderFunctions as a6, type FieldTransformFn as a7, type FieldTransformFnParams as a8, type ItemWithId as a9, type MappedItem as aa, type NumberField as ab, type ObjectField as ac, type OverrideKey as ad, type RadioField as ae, type RichText as af, type RootConfig as ag, type RootDataWithoutProps as ah, type SelectField as ai, type Slot as aj, type SlotComponent as ak, type SlotField as al, type TextField as am, type TextareaField as an, type Viewport as ao, type WithChildren as ap, type WithEditorProps as aq, type WithSlotProps as ar, overrideKeys as as, type ComponentData as b, type DefaultComponents as c, type DefaultComponentProps as d, type DefaultRootFieldProps as e, type Permissions as f, type RootDataWithProps as g, type ResolveDataTrigger as h, type Plugin as i, type Overrides as j, type UiState as k, type ComponentConfig as l, type FieldTransforms as m, type RichtextField as n, type Field as o, type FieldProps as p, type InitialHistory as q, type ItemSelector as r, type PluginInternal as s, type Adaptor as t, type ArrayField as u, type ArrayState as v, type AsFieldProps as w, type BaseField as x, type CacheOpts as y, type ComponentConfigExtensions as z };
@@ -791,6 +791,7 @@ type InsertAction = {
791
791
  destinationIndex: number;
792
792
  destinationZone: string;
793
793
  id?: string;
794
+ data?: ComponentData;
794
795
  };
795
796
  type DuplicateAction = {
796
797
  type: "duplicate";
@@ -851,4 +852,4 @@ type EditorAction = {
851
852
  recordHistory?: boolean;
852
853
  } & (ReorderAction | InsertAction | MoveAction | ReplaceAction | ReplaceRootAction | RemoveAction | DuplicateAction | SetAction | SetDataAction | SetUiAction | RegisterZoneAction | UnregisterZoneAction);
853
854
 
854
- export { type EditorComponent as $, type AppState as A, type BaseData as B, type Config as C, type Data as D, type EditorAction as E, type Fields as F, type ComponentConfigExtensions as G, type History as H, type IframeConfig as I, type ComponentConfigParams as J, type ComponentDataMap as K, type ComponentDataOptionalId as L, type Metadata as M, type ComponentMetadata as N, type OnAction as O, type PrivateAppState as P, type ConfigParams as Q, type RootData as R, type CustomField as S, type CustomFieldRender as T, type UserGenerics as U, type Viewports as V, type WithId as W, type DefaultRootProps as X, type DefaultRootRenderProps as Y, type Direction as Z, type DragAxis as _, type Content as a, type EditorContext as a0, type EditorMetadata as a1, type ExternalField as a2, type ExternalFieldWithAdaptor as a3, type ExtractConfigParams as a4, type ExtractField as a5, type FieldMetadata as a6, type FieldRenderFunctions as a7, type FieldTransformFn as a8, type FieldTransformFnParams as a9, type ItemWithId as aa, type MappedItem as ab, type NumberField as ac, type ObjectField as ad, type OverrideKey as ae, type RadioField as af, type RichText as ag, type RootConfig as ah, type RootDataWithoutProps as ai, type SelectField as aj, type Slot as ak, type SlotComponent as al, type SlotField as am, type TextField as an, type TextareaField as ao, type Viewport as ap, type WithChildren as aq, type WithEditorProps as ar, type WithSlotProps as as, overrideKeys as at, type ComponentData as b, type DefaultComponents as c, type DefaultComponentProps as d, type DefaultRootFieldProps as e, type Permissions as f, type RootDataWithProps as g, type ResolveDataTrigger as h, type Plugin as i, type Overrides as j, type UiState as k, type ComponentConfig as l, type FieldTransforms as m, type RichtextField as n, type Field as o, type FieldProps as p, type DropZoneProps as q, type InitialHistory as r, type ItemSelector as s, type PluginInternal as t, type Adaptor as u, type ArrayField as v, type ArrayState as w, type AsFieldProps as x, type BaseField as y, type CacheOpts as z };
855
+ export { type EditorContext as $, type AppState as A, type BaseData as B, type Config as C, type Data as D, type EditorAction as E, type Fields as F, type ComponentConfigParams as G, type History as H, type IframeConfig as I, type ComponentDataMap as J, type ComponentDataOptionalId as K, type ComponentMetadata as L, type Metadata as M, type ConfigParams as N, type OnAction as O, type PrivateAppState as P, type CustomField as Q, type RootData as R, type CustomFieldRender as S, type DefaultRootProps as T, type UserGenerics as U, type Viewports as V, type WithId as W, type DefaultRootRenderProps as X, type Direction as Y, type DragAxis as Z, type EditorComponent as _, type Content as a, type EditorMetadata as a0, type ExternalField as a1, type ExternalFieldWithAdaptor as a2, type ExtractConfigParams as a3, type ExtractField as a4, type FieldMetadata as a5, type FieldRenderFunctions as a6, type FieldTransformFn as a7, type FieldTransformFnParams as a8, type ItemWithId as a9, type MappedItem as aa, type NumberField as ab, type ObjectField as ac, type OverrideKey as ad, type RadioField as ae, type RichText as af, type RootConfig as ag, type RootDataWithoutProps as ah, type SelectField as ai, type Slot as aj, type SlotComponent as ak, type SlotField as al, type TextField as am, type TextareaField as an, type Viewport as ao, type WithChildren as ap, type WithEditorProps as aq, type WithSlotProps as ar, overrideKeys as as, type ComponentData as b, type DefaultComponents as c, type DefaultComponentProps as d, type DefaultRootFieldProps as e, type Permissions as f, type RootDataWithProps as g, type ResolveDataTrigger as h, type Plugin as i, type Overrides as j, type UiState as k, type ComponentConfig as l, type FieldTransforms as m, type RichtextField as n, type Field as o, type FieldProps as p, type InitialHistory as q, type ItemSelector as r, type PluginInternal as s, type Adaptor as t, type ArrayField as u, type ArrayState as v, type AsFieldProps as w, type BaseField as x, type CacheOpts as y, type ComponentConfigExtensions as z };
@@ -2,20 +2,20 @@ import {
2
2
  createReducer,
3
3
  getItem,
4
4
  makeStatePublic
5
- } from "./chunk-UB2DES2O.mjs";
5
+ } from "./chunk-M4JDRFYB.mjs";
6
6
  import {
7
7
  defaultAppState,
8
8
  defaultViewports,
9
9
  getChanged,
10
10
  resolveComponentData
11
- } from "./chunk-VOLQMQPK.mjs";
11
+ } from "./chunk-IIRJMJFU.mjs";
12
12
  import {
13
13
  get_class_name_factory_default
14
14
  } from "./chunk-Y2EFNT5P.mjs";
15
15
  import {
16
16
  generateId,
17
17
  walkAppState
18
- } from "./chunk-GAUBBDIR.mjs";
18
+ } from "./chunk-JIXMPJZA.mjs";
19
19
  import {
20
20
  __async,
21
21
  __objRest,
@@ -5,7 +5,7 @@ import {
5
5
  Heading4,
6
6
  Heading5,
7
7
  Heading6
8
- } from "./chunk-CRF2GWQA.mjs";
8
+ } from "./chunk-AAK2555H.mjs";
9
9
  import {
10
10
  init_react_import
11
11
  } from "./chunk-M6W7YEVX.mjs";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  mapFields,
3
3
  toComponent
4
- } from "./chunk-GAUBBDIR.mjs";
4
+ } from "./chunk-JIXMPJZA.mjs";
5
5
  import {
6
6
  __async,
7
7
  __spreadProps,
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  useAlignOptions
3
- } from "./chunk-Z6IIVDFY.mjs";
3
+ } from "./chunk-XI7YTBCP.mjs";
4
4
  import {
5
5
  useHeadingOptions
6
- } from "./chunk-6LG4Q4HO.mjs";
6
+ } from "./chunk-EEQGJ6FH.mjs";
7
7
  import {
8
8
  useListOptions
9
- } from "./chunk-WGPCLAZR.mjs";
9
+ } from "./chunk-ZLSPSBV3.mjs";
10
10
  import {
11
11
  AlignCenter,
12
12
  AlignJustify,
@@ -26,7 +26,7 @@ import {
26
26
  Strikethrough,
27
27
  Underline,
28
28
  useControlContext
29
- } from "./chunk-CRF2GWQA.mjs";
29
+ } from "./chunk-AAK2555H.mjs";
30
30
  import {
31
31
  get_class_name_factory_default
32
32
  } from "./chunk-Y2EFNT5P.mjs";
@@ -349,7 +349,7 @@ function AlignSelectFallback() {
349
349
  // components/RichTextMenu/controls/AlignSelect/index.tsx
350
350
  import { jsx as jsx10 } from "react/jsx-runtime";
351
351
  var AlignSelectLoaded = lazy(
352
- () => import("./loaded-BQVZGQG2.mjs").then((m) => ({
352
+ () => import("./loaded-FTSXIONQ.mjs").then((m) => ({
353
353
  default: m.AlignSelectLoaded
354
354
  }))
355
355
  );
@@ -580,7 +580,7 @@ function HeadingSelectFallback() {
580
580
  // components/RichTextMenu/controls/HeadingSelect/index.tsx
581
581
  import { jsx as jsx22 } from "react/jsx-runtime";
582
582
  var HeadingSelectLoaded = lazy2(
583
- () => import("./loaded-6NPDD7SF.mjs").then((m) => ({
583
+ () => import("./loaded-3NPQWYKN.mjs").then((m) => ({
584
584
  default: m.HeadingSelectLoaded
585
585
  }))
586
586
  );
@@ -612,7 +612,7 @@ function ListSelectFallback() {
612
612
  // components/RichTextMenu/controls/ListSelect/index.tsx
613
613
  import { jsx as jsx24 } from "react/jsx-runtime";
614
614
  var ListSelectLoaded = lazy3(
615
- () => import("./loaded-6IBSSOXD.mjs").then((m) => ({
615
+ () => import("./loaded-YTQOQIUU.mjs").then((m) => ({
616
616
  default: m.ListSelectLoaded
617
617
  }))
618
618
  );
@@ -4,7 +4,7 @@ import {
4
4
  setupZone,
5
5
  walkAppState,
6
6
  walkTree
7
- } from "./chunk-GAUBBDIR.mjs";
7
+ } from "./chunk-JIXMPJZA.mjs";
8
8
  import {
9
9
  __spreadProps,
10
10
  __spreadValues,
@@ -74,12 +74,14 @@ function insertAction(state, action, appStore) {
74
74
  const componentConfig = appStore.config.components[action.componentType];
75
75
  const isGlobalType = (componentConfig == null ? void 0 : componentConfig.global) === true;
76
76
  const defaultProps = (componentConfig == null ? void 0 : componentConfig.defaultProps) || {};
77
+ const sourceData = action.data ? __spreadProps(__spreadValues({}, action.data), { props: __spreadProps(__spreadValues({}, action.data.props), { id }) }) : __spreadValues({
78
+ type: action.componentType,
79
+ props: __spreadProps(__spreadValues({}, defaultProps), { id })
80
+ }, isGlobalType ? { synced: true } : {});
77
81
  const emptyComponentData = populateIds(
78
- __spreadValues({
79
- type: action.componentType,
80
- props: __spreadProps(__spreadValues({}, defaultProps), { id })
81
- }, isGlobalType ? { synced: true } : {}),
82
- appStore.config
82
+ sourceData,
83
+ appStore.config,
84
+ !!action.data
83
85
  );
84
86
  const [parentId] = action.destinationZone.split(":");
85
87
  const idsInPath = getIdsForParent(action.destinationZone, state);
@@ -3,11 +3,11 @@ import {
3
3
  } from "./chunk-6QJ2HF4O.mjs";
4
4
  import {
5
5
  LoadedRichTextMenuInner
6
- } from "./chunk-BRDUM7MJ.mjs";
6
+ } from "./chunk-JUC25FB7.mjs";
7
7
  import {
8
8
  useAppStore,
9
9
  useAppStoreApi
10
- } from "./chunk-CRF2GWQA.mjs";
10
+ } from "./chunk-AAK2555H.mjs";
11
11
  import {
12
12
  get_class_name_factory_default
13
13
  } from "./chunk-Y2EFNT5P.mjs";
@@ -100,7 +100,7 @@ init_react_import();
100
100
  import { lazy, Suspense } from "react";
101
101
  import { jsx as jsx2 } from "react/jsx-runtime";
102
102
  var LoadedRichTextMenuFull = lazy(
103
- () => import("./full-24FOTNTB.mjs").then((m) => ({
103
+ () => import("./full-IHV5BO2L.mjs").then((m) => ({
104
104
  default: m.LoadedRichTextMenuFull
105
105
  }))
106
106
  );
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  defaultAppState,
6
6
  resolveComponentData
7
- } from "./chunk-VOLQMQPK.mjs";
7
+ } from "./chunk-IIRJMJFU.mjs";
8
8
  import {
9
9
  get_class_name_factory_default
10
10
  } from "./chunk-Y2EFNT5P.mjs";
@@ -15,7 +15,7 @@ import {
15
15
  toComponent,
16
16
  walkAppState,
17
17
  walkTree
18
- } from "./chunk-GAUBBDIR.mjs";
18
+ } from "./chunk-JIXMPJZA.mjs";
19
19
  import {
20
20
  __async,
21
21
  __objRest,
@@ -263,22 +263,6 @@ function resolveAllData(_0, _1) {
263
263
  });
264
264
  }
265
265
 
266
- // lib/field-transforms/default-transforms/slot-transform.tsx
267
- init_react_import();
268
- var getSlotTransform = (renderSlotEdit, renderSlotRender = renderSlotEdit) => ({
269
- slot: ({ value: content, propName, field, isReadOnly }) => {
270
- const render = isReadOnly ? renderSlotRender : renderSlotEdit;
271
- const Slot = (dzProps) => render(__spreadProps(__spreadValues({
272
- allow: (field == null ? void 0 : field.type) === "slot" ? field.allow : [],
273
- disallow: (field == null ? void 0 : field.type) === "slot" ? field.disallow : []
274
- }, dzProps), {
275
- zone: propName,
276
- content
277
- }));
278
- return Slot;
279
- }
280
- });
281
-
282
266
  // lib/use-slots.tsx
283
267
  init_react_import();
284
268
 
@@ -326,6 +310,22 @@ function useFieldTransforms(config, item, transforms, readOnly, forceReadOnly) {
326
310
  return mergedProps;
327
311
  }
328
312
 
313
+ // lib/field-transforms/default-transforms/slot-transform.tsx
314
+ init_react_import();
315
+ var getSlotTransform = (renderSlotEdit, renderSlotRender = renderSlotEdit) => ({
316
+ slot: ({ value: content, propName, field, isReadOnly }) => {
317
+ const render = isReadOnly ? renderSlotRender : renderSlotEdit;
318
+ const Slot = (dzProps) => render(__spreadProps(__spreadValues({
319
+ allow: (field == null ? void 0 : field.type) === "slot" ? field.allow : [],
320
+ disallow: (field == null ? void 0 : field.type) === "slot" ? field.disallow : []
321
+ }, dzProps), {
322
+ zone: propName,
323
+ content
324
+ }));
325
+ return Slot;
326
+ }
327
+ });
328
+
329
329
  // lib/use-slots.tsx
330
330
  function useSlots(config, item, renderSlotEdit, renderSlotRender = renderSlotEdit, readOnly, forceReadOnly) {
331
331
  return useFieldTransforms(