@reacteditor/core 0.0.6 → 0.0.8

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 (40) hide show
  1. package/dist/{Editor-YNFB7B6Z.mjs → Editor-KXEVJBNG.mjs} +9 -9
  2. package/dist/{actions-CQmL3wwa.d.mts → actions-2L-1hQ7r.d.mts} +7 -2
  3. package/dist/{actions-CQmL3wwa.d.ts → actions-2L-1hQ7r.d.ts} +7 -2
  4. package/dist/{chunk-6LG4Q4HO.mjs → chunk-AD7BMXAA.mjs} +1 -1
  5. package/dist/{chunk-DB4R5IWG.mjs → chunk-AJWRDM22.mjs} +3 -3
  6. package/dist/{chunk-WGPCLAZR.mjs → chunk-FT6UFK7G.mjs} +1 -1
  7. package/dist/{chunk-VOLQMQPK.mjs → chunk-IIRJMJFU.mjs} +1 -1
  8. package/dist/{chunk-CRF2GWQA.mjs → chunk-LRFRIIKG.mjs} +6 -4
  9. package/dist/{chunk-UB2DES2O.mjs → chunk-M4JDRFYB.mjs} +8 -6
  10. package/dist/{chunk-Z6IIVDFY.mjs → chunk-OIFPBVSF.mjs} +1 -1
  11. package/dist/{chunk-HCFEY5Y7.mjs → chunk-R5DQGUQS.mjs} +949 -610
  12. package/dist/{chunk-275EJPEB.mjs → chunk-TI3KC54Y.mjs} +18 -18
  13. package/dist/{chunk-BRDUM7MJ.mjs → chunk-U7VW3V3W.mjs} +7 -7
  14. package/dist/{full-24FOTNTB.mjs → full-ZFZZ626B.mjs} +8 -8
  15. package/dist/{index-BOP2qNVA.d.mts → index-BNsSzMCj.d.ts} +2 -1
  16. package/dist/{index-_G46lHpL.d.ts → index-BXuSeNez.d.mts} +2 -1
  17. package/dist/index.css +99 -26
  18. package/dist/index.d.mts +36 -8
  19. package/dist/index.d.ts +36 -8
  20. package/dist/index.js +1448 -1097
  21. package/dist/index.mjs +14 -14
  22. package/dist/internal.d.mts +2 -2
  23. package/dist/internal.d.ts +2 -2
  24. package/dist/internal.js +7 -5
  25. package/dist/internal.mjs +2 -2
  26. package/dist/{loaded-BQVZGQG2.mjs → loaded-GLBLMTBL.mjs} +5 -5
  27. package/dist/{loaded-6IBSSOXD.mjs → loaded-O4QHGE26.mjs} +5 -5
  28. package/dist/{loaded-6NPDD7SF.mjs → loaded-R34BR6I5.mjs} +5 -5
  29. package/dist/no-external.css +99 -26
  30. package/dist/no-external.d.mts +4 -4
  31. package/dist/no-external.d.ts +4 -4
  32. package/dist/no-external.js +1448 -1097
  33. package/dist/no-external.mjs +14 -14
  34. package/dist/rsc.d.mts +2 -2
  35. package/dist/rsc.d.ts +2 -2
  36. package/dist/rsc.mjs +3 -3
  37. package/dist/{walk-tree-Dwv3c_9M.d.mts → walk-tree-4C3ODO3X.d.mts} +1 -1
  38. package/dist/{walk-tree-DxSkPLnl.d.ts → walk-tree-C9GrSWsR.d.ts} +1 -1
  39. package/package.json +1 -1
  40. 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-AJWRDM22.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-U7VW3V3W.mjs";
10
+ import "./chunk-OIFPBVSF.mjs";
11
+ import "./chunk-AD7BMXAA.mjs";
12
+ import "./chunk-FT6UFK7G.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-LRFRIIKG.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,
@@ -212,6 +212,10 @@ interface SelectField extends BaseField {
212
212
  type: "select";
213
213
  options: FieldOptions;
214
214
  }
215
+ interface ColorField extends BaseField {
216
+ type: "color";
217
+ placeholder?: string;
218
+ }
215
219
  interface RadioField extends BaseField {
216
220
  type: "radio";
217
221
  options: FieldOptions;
@@ -322,7 +326,7 @@ interface SlotField extends BaseField {
322
326
  allow?: string[];
323
327
  disallow?: string[];
324
328
  }
325
- type Field<ValueType = any, UserField extends {} = {}> = TextField | RichtextField | NumberField | TextareaField | SelectField | RadioField | ArrayField<ValueType extends {
329
+ type Field<ValueType = any, UserField extends {} = {}> = TextField | RichtextField | NumberField | TextareaField | SelectField | RadioField | ColorField | ArrayField<ValueType extends {
326
330
  [key: string]: any;
327
331
  }[] ? ValueType : never, UserField> | ObjectField<ValueType, UserField> | ExternalField<ValueType> | ExternalFieldWithAdaptor<ValueType> | CustomField<ValueType> | SlotField;
328
332
  type Fields<ComponentProps extends DefaultComponentProps = DefaultComponentProps, UserField extends {} = {}> = {
@@ -791,6 +795,7 @@ type InsertAction = {
791
795
  destinationIndex: number;
792
796
  destinationZone: string;
793
797
  id?: string;
798
+ data?: ComponentData;
794
799
  };
795
800
  type DuplicateAction = {
796
801
  type: "duplicate";
@@ -851,4 +856,4 @@ type EditorAction = {
851
856
  recordHistory?: boolean;
852
857
  } & (ReorderAction | InsertAction | MoveAction | ReplaceAction | ReplaceRootAction | RemoveAction | DuplicateAction | SetAction | SetDataAction | SetUiAction | RegisterZoneAction | UnregisterZoneAction);
853
858
 
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 };
859
+ 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 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 ColorField as z };
@@ -212,6 +212,10 @@ interface SelectField extends BaseField {
212
212
  type: "select";
213
213
  options: FieldOptions;
214
214
  }
215
+ interface ColorField extends BaseField {
216
+ type: "color";
217
+ placeholder?: string;
218
+ }
215
219
  interface RadioField extends BaseField {
216
220
  type: "radio";
217
221
  options: FieldOptions;
@@ -322,7 +326,7 @@ interface SlotField extends BaseField {
322
326
  allow?: string[];
323
327
  disallow?: string[];
324
328
  }
325
- type Field<ValueType = any, UserField extends {} = {}> = TextField | RichtextField | NumberField | TextareaField | SelectField | RadioField | ArrayField<ValueType extends {
329
+ type Field<ValueType = any, UserField extends {} = {}> = TextField | RichtextField | NumberField | TextareaField | SelectField | RadioField | ColorField | ArrayField<ValueType extends {
326
330
  [key: string]: any;
327
331
  }[] ? ValueType : never, UserField> | ObjectField<ValueType, UserField> | ExternalField<ValueType> | ExternalFieldWithAdaptor<ValueType> | CustomField<ValueType> | SlotField;
328
332
  type Fields<ComponentProps extends DefaultComponentProps = DefaultComponentProps, UserField extends {} = {}> = {
@@ -791,6 +795,7 @@ type InsertAction = {
791
795
  destinationIndex: number;
792
796
  destinationZone: string;
793
797
  id?: string;
798
+ data?: ComponentData;
794
799
  };
795
800
  type DuplicateAction = {
796
801
  type: "duplicate";
@@ -851,4 +856,4 @@ type EditorAction = {
851
856
  recordHistory?: boolean;
852
857
  } & (ReorderAction | InsertAction | MoveAction | ReplaceAction | ReplaceRootAction | RemoveAction | DuplicateAction | SetAction | SetDataAction | SetUiAction | RegisterZoneAction | UnregisterZoneAction);
853
858
 
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 };
859
+ 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 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 ColorField as z };
@@ -5,7 +5,7 @@ import {
5
5
  Heading4,
6
6
  Heading5,
7
7
  Heading6
8
- } from "./chunk-CRF2GWQA.mjs";
8
+ } from "./chunk-LRFRIIKG.mjs";
9
9
  import {
10
10
  init_react_import
11
11
  } from "./chunk-M6W7YEVX.mjs";
@@ -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-U7VW3V3W.mjs";
7
7
  import {
8
8
  useAppStore,
9
9
  useAppStoreApi
10
- } from "./chunk-CRF2GWQA.mjs";
10
+ } from "./chunk-LRFRIIKG.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-ZFZZ626B.mjs").then((m) => ({
104
104
  default: m.LoadedRichTextMenuFull
105
105
  }))
106
106
  );
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  List,
3
3
  ListOrdered
4
- } from "./chunk-CRF2GWQA.mjs";
4
+ } from "./chunk-LRFRIIKG.mjs";
5
5
  import {
6
6
  init_react_import
7
7
  } 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,
@@ -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,
@@ -1141,7 +1141,9 @@ var createAppStore = (initialAppStore) => create2()(
1141
1141
  fullScreenCanvas: false,
1142
1142
  _experimentalVirtualization: false,
1143
1143
  metadata: {},
1144
- fieldTransforms: {}
1144
+ fieldTransforms: {},
1145
+ scrollToComponent: () => {
1146
+ }
1145
1147
  }, initialAppStore), {
1146
1148
  fields: createFieldsSlice(set, get),
1147
1149
  history: createHistorySlice(set, get),
@@ -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,7 +3,7 @@ import {
3
3
  AlignJustify,
4
4
  AlignLeft,
5
5
  AlignRight
6
- } from "./chunk-CRF2GWQA.mjs";
6
+ } from "./chunk-LRFRIIKG.mjs";
7
7
  import {
8
8
  init_react_import
9
9
  } from "./chunk-M6W7YEVX.mjs";