@puckeditor/core 0.21.1 → 0.21.2-canary.0bbe7fec
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.
- package/README.md +1 -1
- package/dist/{Editor-NK3TZSR6.mjs → Editor-G7Y32A5X.mjs} +9 -9
- package/dist/{actions-BkBoKAc5.d.mts → actions-C3e2nJ9v.d.mts} +2 -2
- package/dist/{actions-BkBoKAc5.d.ts → actions-C3e2nJ9v.d.ts} +2 -2
- package/dist/{chunk-PMXRXC2B.mjs → chunk-754HNMU2.mjs} +18 -11
- package/dist/{chunk-MSZPUXZP.mjs → chunk-7TULKVSG.mjs} +1 -1
- package/dist/{chunk-MDUBGHWF.mjs → chunk-BOKX3EBR.mjs} +3 -12
- package/dist/{chunk-EBISZQTK.mjs → chunk-DVS6IJRQ.mjs} +3794 -3733
- package/dist/{chunk-TNORMHZU.mjs → chunk-FOGDNETJ.mjs} +4 -4
- package/dist/{chunk-5V242HXR.mjs → chunk-MFEVRMA4.mjs} +7 -7
- package/dist/{chunk-SKJTJUWU.mjs → chunk-NBH4DF6Y.mjs} +1 -1
- package/dist/{chunk-RHVK562Z.mjs → chunk-OLGXKSQT.mjs} +3 -3
- package/dist/{chunk-KOUWDQ4Q.mjs → chunk-OYCFPEDG.mjs} +1 -1
- package/dist/{chunk-UMTU6EA7.mjs → chunk-RSOD4APZ.mjs} +20 -10
- package/dist/{chunk-37HTE4KO.mjs → chunk-YLLE6KXH.mjs} +1 -1
- package/dist/{full-KLPRWVS4.mjs → full-AG4GMB6M.mjs} +8 -8
- package/dist/{index-lt1zf5WR.d.ts → index-DAXMlG_V.d.mts} +2 -1
- package/dist/{index-bqD1SEOb.d.mts → index-s4HBwSMe.d.ts} +2 -1
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +228 -156
- package/dist/index.mjs +17 -12
- package/dist/internal.d.mts +2 -2
- package/dist/internal.d.ts +2 -2
- package/dist/internal.js +16 -11
- package/dist/internal.mjs +2 -2
- package/dist/{loaded-SJJ63OY2.mjs → loaded-JCBZ5OYD.mjs} +5 -5
- package/dist/{loaded-DIHUQBWF.mjs → loaded-VT5I2E7C.mjs} +5 -5
- package/dist/{loaded-362ACKSQ.mjs → loaded-YDSVEZZY.mjs} +5 -5
- package/dist/no-external.css +143 -147
- package/dist/no-external.d.mts +3 -3
- package/dist/no-external.d.ts +3 -3
- package/dist/no-external.js +226 -157
- package/dist/no-external.mjs +11 -11
- package/dist/rsc.d.mts +2 -2
- package/dist/rsc.d.ts +2 -2
- package/dist/rsc.js +50 -35
- package/dist/rsc.mjs +45 -27
- package/dist/{walk-tree-CRRDqx6_.d.mts → walk-tree-BJoNgZ0l.d.mts} +1 -1
- package/dist/{walk-tree-CS7sEpfG.d.ts → walk-tree-f8Yzs5o3.d.ts} +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
</picture>
|
|
10
10
|
</a>
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
_Create your own AI page builder_
|
|
13
13
|
|
|
14
14
|
[Documentation](https://puckeditor.com/docs?utm_source=readme&utm_medium=code&utm_campaign=repo&utm_contents=docs_link) • [Demo](https://demo.puckeditor.com/edit?utm_source=readme&utm_medium=code&utm_campaign=repo&utm_contents=demo_link) • [Discord](https://discord.gg/V9mDAhuxyZ) • [Contributing](https://github.com/puckeditor/puck/blob/main/CONTRIBUTING.md)
|
|
15
15
|
|
|
@@ -4,20 +4,20 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
EditorInner,
|
|
6
6
|
LoadedRichTextMenu
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-OLGXKSQT.mjs";
|
|
8
8
|
import "./chunk-AOEDIUVK.mjs";
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-MFEVRMA4.mjs";
|
|
10
|
+
import "./chunk-7TULKVSG.mjs";
|
|
11
|
+
import "./chunk-OYCFPEDG.mjs";
|
|
12
|
+
import "./chunk-NBH4DF6Y.mjs";
|
|
13
13
|
import {
|
|
14
14
|
useAppStore,
|
|
15
15
|
useAppStoreApi
|
|
16
|
-
} from "./chunk-
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
16
|
+
} from "./chunk-RSOD4APZ.mjs";
|
|
17
|
+
import "./chunk-YLLE6KXH.mjs";
|
|
18
|
+
import "./chunk-BOKX3EBR.mjs";
|
|
19
19
|
import "./chunk-Y2EFNT5P.mjs";
|
|
20
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-754HNMU2.mjs";
|
|
21
21
|
import {
|
|
22
22
|
__spreadProps,
|
|
23
23
|
__spreadValues,
|
|
@@ -308,7 +308,7 @@ type CustomFieldRender<Value extends any> = (props: {
|
|
|
308
308
|
name: string;
|
|
309
309
|
id: string;
|
|
310
310
|
value: Value;
|
|
311
|
-
onChange: (value: Value) => void;
|
|
311
|
+
onChange: (value: Value, uiState?: Partial<UiState>) => void;
|
|
312
312
|
readOnly?: boolean;
|
|
313
313
|
}) => ReactElement;
|
|
314
314
|
interface CustomField<Value extends any> extends BaseField {
|
|
@@ -835,4 +835,4 @@ type PuckAction = {
|
|
|
835
835
|
recordHistory?: boolean;
|
|
836
836
|
} & (ReorderAction | InsertAction | MoveAction | ReplaceAction | ReplaceRootAction | RemoveAction | DuplicateAction | SetAction | SetDataAction | SetUiAction | RegisterZoneAction | UnregisterZoneAction);
|
|
837
837
|
|
|
838
|
-
export { type
|
|
838
|
+
export { type ExternalField as $, type AppState as A, type BaseData as B, type Config as C, type Data as D, type CacheOpts 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 PuckAction as a, type ExternalFieldWithAdaptor as a0, type ExtractConfigParams as a1, type ExtractField as a2, type FieldMetadata as a3, type FieldRenderFunctions as a4, type FieldTransformFn as a5, type FieldTransformFnParams as a6, type ItemWithId as a7, type MappedItem as a8, type NumberField as a9, type ObjectField as aa, type OverrideKey as ab, type PuckComponent as ac, type PuckContext as ad, type PuckMetadata 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 WithPuckProps as ar, type WithSlotProps as as, overrideKeys as at, type Content as b, type ComponentData as c, type DefaultComponents as d, type DefaultComponentProps as e, type DefaultRootFieldProps as f, type Permissions as g, type RootDataWithProps as h, type ResolveDataTrigger as i, type Plugin as j, type Overrides as k, type UiState as l, type ComponentConfig as m, type FieldTransforms as n, type RichtextField as o, type Field as p, type FieldProps as q, type DropZoneProps as r, type InitialHistory as s, type ItemSelector as t, type PluginInternal as u, type Adaptor as v, type ArrayField as w, type ArrayState as x, type AsFieldProps as y, type BaseField as z };
|
|
@@ -308,7 +308,7 @@ type CustomFieldRender<Value extends any> = (props: {
|
|
|
308
308
|
name: string;
|
|
309
309
|
id: string;
|
|
310
310
|
value: Value;
|
|
311
|
-
onChange: (value: Value) => void;
|
|
311
|
+
onChange: (value: Value, uiState?: Partial<UiState>) => void;
|
|
312
312
|
readOnly?: boolean;
|
|
313
313
|
}) => ReactElement;
|
|
314
314
|
interface CustomField<Value extends any> extends BaseField {
|
|
@@ -835,4 +835,4 @@ type PuckAction = {
|
|
|
835
835
|
recordHistory?: boolean;
|
|
836
836
|
} & (ReorderAction | InsertAction | MoveAction | ReplaceAction | ReplaceRootAction | RemoveAction | DuplicateAction | SetAction | SetDataAction | SetUiAction | RegisterZoneAction | UnregisterZoneAction);
|
|
837
837
|
|
|
838
|
-
export { type
|
|
838
|
+
export { type ExternalField as $, type AppState as A, type BaseData as B, type Config as C, type Data as D, type CacheOpts 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 PuckAction as a, type ExternalFieldWithAdaptor as a0, type ExtractConfigParams as a1, type ExtractField as a2, type FieldMetadata as a3, type FieldRenderFunctions as a4, type FieldTransformFn as a5, type FieldTransformFnParams as a6, type ItemWithId as a7, type MappedItem as a8, type NumberField as a9, type ObjectField as aa, type OverrideKey as ab, type PuckComponent as ac, type PuckContext as ad, type PuckMetadata 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 WithPuckProps as ar, type WithSlotProps as as, overrideKeys as at, type Content as b, type ComponentData as c, type DefaultComponents as d, type DefaultComponentProps as e, type DefaultRootFieldProps as f, type Permissions as g, type RootDataWithProps as h, type ResolveDataTrigger as i, type Plugin as j, type Overrides as k, type UiState as l, type ComponentConfig as m, type FieldTransforms as n, type RichtextField as o, type Field as p, type FieldProps as q, type DropZoneProps as r, type InitialHistory as s, type ItemSelector as t, type PluginInternal as u, type Adaptor as v, type ArrayField as w, type ArrayState as x, type AsFieldProps as y, type BaseField as z };
|
|
@@ -267,6 +267,15 @@ var expandNode = (node) => {
|
|
|
267
267
|
});
|
|
268
268
|
};
|
|
269
269
|
|
|
270
|
+
// lib/data/to-component.ts
|
|
271
|
+
init_react_import();
|
|
272
|
+
var toComponent = (item) => {
|
|
273
|
+
return "type" in item ? item : __spreadProps(__spreadValues({}, item), {
|
|
274
|
+
props: __spreadProps(__spreadValues({}, item.props), { id: "root" }),
|
|
275
|
+
type: "root"
|
|
276
|
+
});
|
|
277
|
+
};
|
|
278
|
+
|
|
270
279
|
// lib/data/walk-app-state.ts
|
|
271
280
|
init_react_import();
|
|
272
281
|
|
|
@@ -358,7 +367,7 @@ function walkAppState(state, config, mapContent = (content) => content, mapNodeO
|
|
|
358
367
|
id
|
|
359
368
|
});
|
|
360
369
|
processRelatedZones(item, id, path);
|
|
361
|
-
const newItem = __spreadProps(__spreadValues({},
|
|
370
|
+
const newItem = __spreadProps(__spreadValues({}, mappedItem), { props: newProps });
|
|
362
371
|
const thisZoneCompound = path[path.length - 1];
|
|
363
372
|
const [parentId, zone] = thisZoneCompound ? thisZoneCompound.split(":") : [null, ""];
|
|
364
373
|
newNodeIndex[id] = {
|
|
@@ -398,17 +407,14 @@ function walkAppState(state, config, mapContent = (content) => content, mapNodeO
|
|
|
398
407
|
);
|
|
399
408
|
newZones[zoneCompound] = newContent2;
|
|
400
409
|
}, newZones);
|
|
401
|
-
|
|
402
|
-
{
|
|
403
|
-
type: "root",
|
|
404
|
-
props: __spreadProps(__spreadValues({}, (_a = state.data.root.props) != null ? _a : state.data.root), { id: "root" })
|
|
405
|
-
},
|
|
406
|
-
[],
|
|
407
|
-
-1
|
|
408
|
-
);
|
|
409
|
-
const root = __spreadProps(__spreadValues({}, state.data.root), {
|
|
410
|
-
props: processedRoot.props
|
|
410
|
+
let rootAsComponent = toComponent({
|
|
411
|
+
props: __spreadValues({}, (_a = state.data.root.props) != null ? _a : state.data.root)
|
|
411
412
|
});
|
|
413
|
+
if (state.data.root.readOnly) {
|
|
414
|
+
rootAsComponent.readOnly = state.data.root.readOnly;
|
|
415
|
+
}
|
|
416
|
+
const processedRoot = processItem(rootAsComponent, [], -1);
|
|
417
|
+
const root = __spreadValues(__spreadValues({}, state.data.root), processedRoot);
|
|
412
418
|
return __spreadProps(__spreadValues({}, state), {
|
|
413
419
|
data: {
|
|
414
420
|
root,
|
|
@@ -449,6 +455,7 @@ export {
|
|
|
449
455
|
walkField,
|
|
450
456
|
mapFields,
|
|
451
457
|
expandNode,
|
|
458
|
+
toComponent,
|
|
452
459
|
walkAppState,
|
|
453
460
|
generateId,
|
|
454
461
|
walkTree,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
|
-
mapFields
|
|
3
|
-
|
|
2
|
+
mapFields,
|
|
3
|
+
toComponent
|
|
4
|
+
} from "./chunk-754HNMU2.mjs";
|
|
4
5
|
import {
|
|
5
6
|
__async,
|
|
6
7
|
__spreadProps,
|
|
@@ -17,15 +18,6 @@ var defaultViewports = [
|
|
|
17
18
|
{ width: "100%", height: "auto", icon: "FullWidth", label: "Full-width" }
|
|
18
19
|
];
|
|
19
20
|
|
|
20
|
-
// lib/data/to-component.ts
|
|
21
|
-
init_react_import();
|
|
22
|
-
var toComponent = (item) => {
|
|
23
|
-
return "type" in item ? item : __spreadProps(__spreadValues({}, item), {
|
|
24
|
-
props: __spreadProps(__spreadValues({}, item.props), { id: "root" }),
|
|
25
|
-
type: "root"
|
|
26
|
-
});
|
|
27
|
-
};
|
|
28
|
-
|
|
29
21
|
// lib/resolve-component-data.ts
|
|
30
22
|
init_react_import();
|
|
31
23
|
|
|
@@ -150,7 +142,6 @@ var defaultAppState = {
|
|
|
150
142
|
export {
|
|
151
143
|
defaultViewports,
|
|
152
144
|
getChanged,
|
|
153
|
-
toComponent,
|
|
154
145
|
resolveComponentData,
|
|
155
146
|
defaultAppState
|
|
156
147
|
};
|