@puckeditor/core 0.24.0-canary.dc29b7d9 → 0.24.0-canary.ea4778fb
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 +34 -1
- package/dist/{Editor-QCCE35VT.mjs → Editor-QKVNUOPH.mjs} +7 -7
- package/dist/{Render-H3USS5FU.mjs → Render-KIF7JWS4.mjs} +1 -1
- package/dist/{actions-D2lY1CZb.d.mts → actions-DzP_zhsF.d.mts} +3 -7
- package/dist/{actions-D2lY1CZb.d.ts → actions-DzP_zhsF.d.ts} +3 -7
- package/dist/{chunk-ZOLLDKZQ.mjs → chunk-2CNEFIQP.mjs} +1 -4
- package/dist/{chunk-GVMWPICP.mjs → chunk-CKY5CKSU.mjs} +7 -7
- package/dist/{chunk-AVZ47Q6I.mjs → chunk-EHTFXUBU.mjs} +1 -1
- package/dist/{chunk-QK4R4YO5.mjs → chunk-ELZ5SBY3.mjs} +678 -902
- package/dist/{chunk-EAAIN3F7.mjs → chunk-NBTE2AWP.mjs} +1 -1
- package/dist/{chunk-IVDY77GH.mjs → chunk-PFNS3HDM.mjs} +3 -3
- package/dist/{chunk-WEHOKKUT.mjs → chunk-PJDBGMYG.mjs} +1 -1
- package/dist/{chunk-CZYQIEKS.mjs → chunk-XAJK3MOG.mjs} +39 -77
- package/dist/{chunk-CAEACQ3G.mjs → chunk-XTIXX7I3.mjs} +65 -77
- package/dist/{full-WPLMFLUO.mjs → full-3BPAMA2C.mjs} +5 -5
- package/dist/{index-B5D647N_.d.ts → index-Cv-eVWCd.d.ts} +1 -1
- package/dist/{index-D8gs5tgA.d.mts → index-poi3aTIz.d.mts} +1 -1
- package/dist/index.css +38 -116
- package/dist/index.d.mts +6 -9
- package/dist/index.d.ts +6 -9
- package/dist/index.js +1175 -1457
- package/dist/index.mjs +8 -8
- package/dist/internal.d.mts +2 -2
- package/dist/internal.d.ts +2 -2
- package/dist/{loaded-MGQ2LS57.mjs → loaded-IRK2RWX3.mjs} +2 -2
- package/dist/{loaded-II5A5RFH.mjs → loaded-OZ2F7R6I.mjs} +2 -2
- package/dist/{loaded-BIKODANT.mjs → loaded-TUHXN2Y2.mjs} +2 -2
- package/dist/no-external.css +38 -116
- package/dist/no-external.d.mts +3 -3
- package/dist/no-external.d.ts +3 -3
- package/dist/no-external.js +1175 -1457
- package/dist/no-external.mjs +8 -8
- package/dist/rsc.d.mts +3 -4
- package/dist/rsc.d.ts +3 -4
- package/dist/rsc.js +55 -128
- package/dist/rsc.mjs +19 -49
- package/dist/{walk-tree-CmOcI1Cn.d.ts → walk-tree-Bu3IHwm_.d.ts} +1 -1
- package/dist/{walk-tree-B2S_ycOm.d.mts → walk-tree-iWDqHBcM.d.mts} +1 -1
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -82,6 +82,34 @@ export function Page() {
|
|
|
82
82
|
}
|
|
83
83
|
```
|
|
84
84
|
|
|
85
|
+
## CLI
|
|
86
|
+
|
|
87
|
+
Set up Puck and Puck Cloud in a new or existing Next.js, React Router, TanStack Start, vinext, Vite or Astro app, or a Hono or Express server. Built for coding agents, friendly for humans:
|
|
88
|
+
|
|
89
|
+
```sh
|
|
90
|
+
npx @puckeditor/cli init
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
See the [CLI docs](https://puckeditor.com/docs/cli) for agent usage.
|
|
94
|
+
|
|
95
|
+
## For agents
|
|
96
|
+
|
|
97
|
+
Puck is built to be set up and used by coding agents as well as people. The CLI sets up Puck without prompting, and ships with the docs for its release, so agents can read the docs for the version a project uses:
|
|
98
|
+
|
|
99
|
+
```sh
|
|
100
|
+
npx @puckeditor/cli init --yes --json
|
|
101
|
+
npx @puckeditor/cli docs find "dynamic fields"
|
|
102
|
+
npx @puckeditor/cli docs cat api-reference/fields/text
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Agents with skill support can install the [Puck skill](https://github.com/puckeditor/skills):
|
|
106
|
+
|
|
107
|
+
```sh
|
|
108
|
+
npx skills add puckeditor/skills --skill puck
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
The latest docs are indexed at [llms.txt](https://puckeditor.com/llms.txt), and any page is available as markdown by adding `.md` to its URL.
|
|
112
|
+
|
|
85
113
|
## Recipes
|
|
86
114
|
|
|
87
115
|
Use `create-puck-app` to quickly spin up a a pre-configured app based on our provided [recipes](https://github.com/puckeditor/puck/tree/main/recipes):
|
|
@@ -93,7 +121,12 @@ npx create-puck-app my-app
|
|
|
93
121
|
Available recipes include:
|
|
94
122
|
|
|
95
123
|
- [**next**](https://github.com/puckeditor/puck/tree/main/recipes/next): Next.js example, using App Router and static page generation
|
|
96
|
-
- [**react-router**](https://github.com/puckeditor/puck/tree/main/recipes/react-router): React Router
|
|
124
|
+
- [**react-router**](https://github.com/puckeditor/puck/tree/main/recipes/react-router): React Router v8 app example, using dynamic routes to create pages at any level
|
|
125
|
+
- [**tanstack-start**](https://github.com/puckeditor/puck/tree/main/recipes/tanstack-start): [TanStack Start](https://tanstack.com/start) example, using a splat route and server functions to create pages at any level
|
|
126
|
+
- [**hono**](https://github.com/puckeditor/puck/tree/main/recipes/hono) and [**express**](https://github.com/puckeditor/puck/tree/main/recipes/express): Hono and Express servers exposing a pages API, and Puck AI in the `-ai` variants, for an editor in another app
|
|
127
|
+
- [**astro**](https://github.com/puckeditor/puck/tree/main/recipes/astro): Astro example, rendering Puck pages on the server with the Node adapter
|
|
128
|
+
- [**vite**](https://github.com/puckeditor/puck/tree/main/recipes/vite): Vite React app example, with a small Hono server for pages
|
|
129
|
+
- [**vinext**](https://github.com/puckeditor/puck/tree/main/recipes/vinext): [vinext](https://github.com/cloudflare/vinext) example, running the Next.js App Router on Vite
|
|
97
130
|
|
|
98
131
|
## Community
|
|
99
132
|
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PuckRichText
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-2CNEFIQP.mjs";
|
|
4
4
|
import {
|
|
5
5
|
EditorInner,
|
|
6
6
|
LoadedRichTextMenu
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-PFNS3HDM.mjs";
|
|
8
8
|
import "./chunk-H635BA2V.mjs";
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-CKY5CKSU.mjs";
|
|
10
|
+
import "./chunk-EHTFXUBU.mjs";
|
|
11
|
+
import "./chunk-NBTE2AWP.mjs";
|
|
12
|
+
import "./chunk-PJDBGMYG.mjs";
|
|
13
13
|
import {
|
|
14
14
|
useAppStore,
|
|
15
15
|
useAppStoreApi
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-XTIXX7I3.mjs";
|
|
17
17
|
import "./chunk-Z2MS6UIF.mjs";
|
|
18
18
|
import "./chunk-ZRAERXB4.mjs";
|
|
19
19
|
import "./chunk-OT7NKYY4.mjs";
|
|
@@ -53,7 +53,7 @@ type NonForwardableProps = {
|
|
|
53
53
|
/**
|
|
54
54
|
* Keys internally consumed by Puck and never forwarded to `as`.
|
|
55
55
|
*/
|
|
56
|
-
type ConsumedPropKey = keyof DropZoneOwnProps | "as" | "content" | "config" | "metadata"
|
|
56
|
+
type ConsumedPropKey = keyof DropZoneOwnProps | "as" | "content" | "config" | "metadata";
|
|
57
57
|
/**
|
|
58
58
|
* Additional props forwarded to the element or component provided via `as`,
|
|
59
59
|
* typed against it.
|
|
@@ -272,10 +272,6 @@ interface RadioField extends BaseField {
|
|
|
272
272
|
type: "radio";
|
|
273
273
|
options: FieldOptions;
|
|
274
274
|
}
|
|
275
|
-
interface CheckboxField extends BaseField {
|
|
276
|
-
type: "checkbox";
|
|
277
|
-
options: FieldOptions;
|
|
278
|
-
}
|
|
279
275
|
interface RichtextField<UserSelector extends RichTextSelector = RichTextSelector> extends BaseField {
|
|
280
276
|
type: "richtext";
|
|
281
277
|
contentEditable?: boolean;
|
|
@@ -382,7 +378,7 @@ interface SlotField extends BaseField {
|
|
|
382
378
|
allow?: string[];
|
|
383
379
|
disallow?: string[];
|
|
384
380
|
}
|
|
385
|
-
type Field<ValueType = any, UserField extends {} = {}> = TextField | RichtextField | NumberField | TextareaField | SelectField | RadioField |
|
|
381
|
+
type Field<ValueType = any, UserField extends {} = {}> = TextField | RichtextField | NumberField | TextareaField | SelectField | RadioField | ArrayField<ValueType extends {
|
|
386
382
|
[key: string]: any;
|
|
387
383
|
}[] ? ValueType : never, UserField> | ObjectField<ValueType, UserField> | ExternalField<ValueType> | ExternalFieldWithAdaptor<ValueType> | CustomField<ValueType> | SlotField;
|
|
388
384
|
type Fields<ComponentProps extends DefaultComponentProps = DefaultComponentProps, UserField extends {} = {}> = {
|
|
@@ -909,4 +905,4 @@ type PuckAction = {
|
|
|
909
905
|
recordHistory?: boolean;
|
|
910
906
|
} & (ReorderAction | InsertAction | MoveAction | ReplaceAction | ReplaceRootAction | RemoveAction | DuplicateAction | SetAction | SetDataAction | SetUiAction | RegisterZoneAction | UnregisterZoneAction);
|
|
911
907
|
|
|
912
|
-
export { type
|
|
908
|
+
export { type OverrideKey as $, type Adaptor as A, type BaseData as B, type CacheOpts as C, type Data as D, type DropZoneProps as E, type ExternalField as F, type ExternalFieldWithAdaptor as G, type ExtractConfigParams as H, type ExtractField as I, type Field as J, type FieldMetadata as K, type FieldProps as L, type FieldRenderFunctions as M, type FieldTransformFn as N, type FieldTransformFnParams as O, type FieldTransforms as P, type Fields as Q, type History as R, type IframeConfig as S, type InitialHistory as T, type ItemSelector as U, type ItemWithId as V, type MappedItem as W, type Metadata as X, type NumberField as Y, type ObjectField as Z, type OnAction as _, type AppState as a, type Overrides as a0, type Permissions as a1, type Plugin as a2, type PluginInternal as a3, type PrivateAppState as a4, type PuckAction as a5, type PuckComponent as a6, type PuckContext as a7, type PuckMetadata as a8, type RadioField as a9, type ResolveDataTrigger as aa, type RichText as ab, type RichtextField as ac, type RootConfig as ad, type RootData as ae, type RootDataWithProps as af, type RootDataWithoutProps as ag, type SelectField as ah, type Slot as ai, type SlotComponent as aj, type SlotField as ak, type TextField as al, type TextareaField as am, type UiState as an, type UserGenerics as ao, type Viewport as ap, type Viewports as aq, type WithChildren as ar, type WithDefaultRootFieldProps as as, type WithId as at, type WithPuckProps as au, type WithSlotProps as av, overrideKeys as aw, type ArrayField as b, type ArrayState as c, type AsFieldProps as d, type BaseField as e, type ComponentConfig as f, type ComponentConfigExtensions as g, type ComponentConfigParams as h, type ComponentData as i, type ComponentDataMap as j, type ComponentDataOptionalId as k, type ComponentMetadata as l, type Config as m, type ConfigParams as n, type Content as o, type CustomField as p, type CustomFieldRender as q, type DefaultComponentProps as r, type DefaultComponents as s, type DefaultRootFieldProps as t, type DefaultRootProps as u, type DefaultRootRenderProps as v, type Direction as w, type DndBehavior as x, type DndConfig as y, type DragAxis as z };
|
|
@@ -53,7 +53,7 @@ type NonForwardableProps = {
|
|
|
53
53
|
/**
|
|
54
54
|
* Keys internally consumed by Puck and never forwarded to `as`.
|
|
55
55
|
*/
|
|
56
|
-
type ConsumedPropKey = keyof DropZoneOwnProps | "as" | "content" | "config" | "metadata"
|
|
56
|
+
type ConsumedPropKey = keyof DropZoneOwnProps | "as" | "content" | "config" | "metadata";
|
|
57
57
|
/**
|
|
58
58
|
* Additional props forwarded to the element or component provided via `as`,
|
|
59
59
|
* typed against it.
|
|
@@ -272,10 +272,6 @@ interface RadioField extends BaseField {
|
|
|
272
272
|
type: "radio";
|
|
273
273
|
options: FieldOptions;
|
|
274
274
|
}
|
|
275
|
-
interface CheckboxField extends BaseField {
|
|
276
|
-
type: "checkbox";
|
|
277
|
-
options: FieldOptions;
|
|
278
|
-
}
|
|
279
275
|
interface RichtextField<UserSelector extends RichTextSelector = RichTextSelector> extends BaseField {
|
|
280
276
|
type: "richtext";
|
|
281
277
|
contentEditable?: boolean;
|
|
@@ -382,7 +378,7 @@ interface SlotField extends BaseField {
|
|
|
382
378
|
allow?: string[];
|
|
383
379
|
disallow?: string[];
|
|
384
380
|
}
|
|
385
|
-
type Field<ValueType = any, UserField extends {} = {}> = TextField | RichtextField | NumberField | TextareaField | SelectField | RadioField |
|
|
381
|
+
type Field<ValueType = any, UserField extends {} = {}> = TextField | RichtextField | NumberField | TextareaField | SelectField | RadioField | ArrayField<ValueType extends {
|
|
386
382
|
[key: string]: any;
|
|
387
383
|
}[] ? ValueType : never, UserField> | ObjectField<ValueType, UserField> | ExternalField<ValueType> | ExternalFieldWithAdaptor<ValueType> | CustomField<ValueType> | SlotField;
|
|
388
384
|
type Fields<ComponentProps extends DefaultComponentProps = DefaultComponentProps, UserField extends {} = {}> = {
|
|
@@ -909,4 +905,4 @@ type PuckAction = {
|
|
|
909
905
|
recordHistory?: boolean;
|
|
910
906
|
} & (ReorderAction | InsertAction | MoveAction | ReplaceAction | ReplaceRootAction | RemoveAction | DuplicateAction | SetAction | SetDataAction | SetUiAction | RegisterZoneAction | UnregisterZoneAction);
|
|
911
907
|
|
|
912
|
-
export { type
|
|
908
|
+
export { type OverrideKey as $, type Adaptor as A, type BaseData as B, type CacheOpts as C, type Data as D, type DropZoneProps as E, type ExternalField as F, type ExternalFieldWithAdaptor as G, type ExtractConfigParams as H, type ExtractField as I, type Field as J, type FieldMetadata as K, type FieldProps as L, type FieldRenderFunctions as M, type FieldTransformFn as N, type FieldTransformFnParams as O, type FieldTransforms as P, type Fields as Q, type History as R, type IframeConfig as S, type InitialHistory as T, type ItemSelector as U, type ItemWithId as V, type MappedItem as W, type Metadata as X, type NumberField as Y, type ObjectField as Z, type OnAction as _, type AppState as a, type Overrides as a0, type Permissions as a1, type Plugin as a2, type PluginInternal as a3, type PrivateAppState as a4, type PuckAction as a5, type PuckComponent as a6, type PuckContext as a7, type PuckMetadata as a8, type RadioField as a9, type ResolveDataTrigger as aa, type RichText as ab, type RichtextField as ac, type RootConfig as ad, type RootData as ae, type RootDataWithProps as af, type RootDataWithoutProps as ag, type SelectField as ah, type Slot as ai, type SlotComponent as aj, type SlotField as ak, type TextField as al, type TextareaField as am, type UiState as an, type UserGenerics as ao, type Viewport as ap, type Viewports as aq, type WithChildren as ar, type WithDefaultRootFieldProps as as, type WithId as at, type WithPuckProps as au, type WithSlotProps as av, overrideKeys as aw, type ArrayField as b, type ArrayState as c, type AsFieldProps as d, type BaseField as e, type ComponentConfig as f, type ComponentConfigExtensions as g, type ComponentConfigParams as h, type ComponentData as i, type ComponentDataMap as j, type ComponentDataOptionalId as k, type ComponentMetadata as l, type Config as m, type ConfigParams as n, type Content as o, type CustomField as p, type CustomFieldRender as q, type DefaultComponentProps as r, type DefaultComponents as s, type DefaultRootFieldProps as t, type DefaultRootProps as u, type DefaultRootRenderProps as v, type Direction as w, type DndBehavior as x, type DndConfig as y, type DragAxis as z };
|
|
@@ -36,10 +36,7 @@ var PuckRichText = Extension.create({
|
|
|
36
36
|
name: "puckRichText",
|
|
37
37
|
addExtensions() {
|
|
38
38
|
const extensions = [];
|
|
39
|
-
const options = __spreadValues({}, this.options);
|
|
40
|
-
if (options.textAlign !== false) {
|
|
41
|
-
options.textAlign = __spreadValues(__spreadValues({}, defaultPuckRichTextOptions.textAlign), options.textAlign);
|
|
42
|
-
}
|
|
39
|
+
const options = __spreadValues(__spreadValues({}, this.options), defaultPuckRichTextOptions);
|
|
43
40
|
if (options.bold !== false) {
|
|
44
41
|
extensions.push(Bold.configure(options.bold));
|
|
45
42
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useAlignOptions
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-EHTFXUBU.mjs";
|
|
4
4
|
import {
|
|
5
5
|
useHeadingOptions
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-NBTE2AWP.mjs";
|
|
7
7
|
import {
|
|
8
8
|
useListOptions
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-PJDBGMYG.mjs";
|
|
10
10
|
import {
|
|
11
11
|
Action,
|
|
12
12
|
AlignCenter,
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
Underline,
|
|
30
30
|
useControlContext,
|
|
31
31
|
useMessage
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-XTIXX7I3.mjs";
|
|
33
33
|
import {
|
|
34
34
|
get_class_name_factory_default
|
|
35
35
|
} from "./chunk-OT7NKYY4.mjs";
|
|
@@ -204,7 +204,7 @@ function AlignSelectFallback() {
|
|
|
204
204
|
// components/RichTextMenu/controls/AlignSelect/index.tsx
|
|
205
205
|
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
206
206
|
var AlignSelectLoaded = lazy(
|
|
207
|
-
() => import("./loaded-
|
|
207
|
+
() => import("./loaded-IRK2RWX3.mjs").then((m) => ({
|
|
208
208
|
default: m.AlignSelectLoaded
|
|
209
209
|
}))
|
|
210
210
|
);
|
|
@@ -445,7 +445,7 @@ function HeadingSelectFallback() {
|
|
|
445
445
|
// components/RichTextMenu/controls/HeadingSelect/index.tsx
|
|
446
446
|
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
447
447
|
var HeadingSelectLoaded = lazy2(
|
|
448
|
-
() => import("./loaded-
|
|
448
|
+
() => import("./loaded-OZ2F7R6I.mjs").then((m) => ({
|
|
449
449
|
default: m.HeadingSelectLoaded
|
|
450
450
|
}))
|
|
451
451
|
);
|
|
@@ -477,7 +477,7 @@ function ListSelectFallback() {
|
|
|
477
477
|
// components/RichTextMenu/controls/ListSelect/index.tsx
|
|
478
478
|
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
479
479
|
var ListSelectLoaded = lazy3(
|
|
480
|
-
() => import("./loaded-
|
|
480
|
+
() => import("./loaded-TUHXN2Y2.mjs").then((m) => ({
|
|
481
481
|
default: m.ListSelectLoaded
|
|
482
482
|
}))
|
|
483
483
|
);
|