@puckeditor/core 0.24.0 → 0.24.1-canary.0418cede
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/CLAUDE.md +10 -0
- package/README.md +41 -18
- package/bin/cli.mjs +25 -0
- package/dist/AGENTS.md +10 -0
- package/dist/CLAUDE.md +10 -0
- package/dist/{Editor-LJSLIQQP.mjs → Editor-CSDCBYXY.mjs} +4 -3
- package/dist/{actions-Dgllwd-W.d.mts → actions-0EHeGita.d.mts} +14 -2
- package/dist/{actions-Dgllwd-W.d.ts → actions-0EHeGita.d.ts} +14 -2
- package/dist/{chunk-3GJJSXCL.mjs → chunk-6J54T4F5.mjs} +16 -0
- package/dist/{chunk-DQXMVPVM.mjs → chunk-OA56LRDR.mjs} +7 -3
- package/dist/{index-dKPCNzR1.d.ts → index-BPkpm4Az.d.mts} +4 -2
- package/dist/{index-D0qqZNSQ.d.mts → index-UEGrr-Tp.d.ts} +4 -2
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +22 -3
- package/dist/index.mjs +2 -2
- package/dist/internal.d.mts +2 -2
- package/dist/internal.d.ts +2 -2
- package/dist/no-external.d.mts +3 -3
- package/dist/no-external.d.ts +3 -3
- package/dist/no-external.js +22 -3
- package/dist/no-external.mjs +2 -2
- package/dist/rsc.d.mts +2 -2
- package/dist/rsc.d.ts +2 -2
- package/dist/rsc.js +18 -0
- package/dist/rsc.mjs +5 -1
- package/dist/{walk-tree-BA4pi921.d.mts → walk-tree-BFTZdvq8.d.mts} +1 -1
- package/dist/{walk-tree-zKkZGcaE.d.ts → walk-tree-vgdtHk4C.d.ts} +1 -1
- package/package.json +13 -5
package/CLAUDE.md
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Published as CLAUDE.md, dist/CLAUDE.md and dist/AGENTS.md (see the prepack and
|
|
3
|
+
build scripts).
|
|
4
|
+
-->
|
|
5
|
+
|
|
6
|
+
# @puckeditor/core
|
|
7
|
+
|
|
8
|
+
This is NOT the Puck you know. You MUST read the Puck README before working with Puck: node_modules/@puckeditor/core/README.md
|
|
9
|
+
|
|
10
|
+
Read the Puck CHANGELOG for updates: node_modules/@puckeditor/core/CHANGELOG.md
|
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
_The visual editor for React_
|
|
13
13
|
|
|
14
|
-
[Documentation](https://puckeditor.com/docs?utm_source=readme&utm_medium=code&utm_campaign=repo&utm_contents=docs_link) • [
|
|
14
|
+
[Documentation](https://puckeditor.com/docs?utm_source=readme&utm_medium=code&utm_campaign=repo&utm_contents=docs_link) • [Puck AI](https://puckeditor.com/docs/ai/overview?utm_source=readme&utm_medium=code&utm_campaign=repo&utm_contents=ai_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)
|
|
15
15
|
|
|
16
16
|
⭐️ Enjoying Puck? Please [leave a star](https://github.com/puckeditor/puck)!
|
|
17
17
|
|
|
@@ -23,21 +23,21 @@ _The visual editor for React_
|
|
|
23
23
|
|
|
24
24
|
## What is Puck?
|
|
25
25
|
|
|
26
|
-
Puck is
|
|
26
|
+
Puck is an open-source visual editor for React. Build drag-and-drop interfaces with your own components.
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
Embed Puck as a React component in your existing application. You own your components and data, with no vendor lock-in.
|
|
29
29
|
|
|
30
|
-
Puck
|
|
30
|
+
Puck's [MIT license](https://github.com/puckeditor/puck?tab=MIT-1-ov-file#readme) permits internal and commercial use.
|
|
31
31
|
|
|
32
|
-
## Quick
|
|
32
|
+
## Quick Start
|
|
33
33
|
|
|
34
|
-
Install the package
|
|
34
|
+
### 1. Install the package
|
|
35
35
|
|
|
36
36
|
```sh
|
|
37
|
-
npm i @puckeditor/core --save
|
|
37
|
+
npm i @puckeditor/core --save
|
|
38
38
|
```
|
|
39
39
|
|
|
40
|
-
Render the editor
|
|
40
|
+
### 2. Render the editor
|
|
41
41
|
|
|
42
42
|
```jsx
|
|
43
43
|
// Editor.jsx
|
|
@@ -62,7 +62,7 @@ const config = {
|
|
|
62
62
|
// Describe the initial data
|
|
63
63
|
const initialData = {};
|
|
64
64
|
|
|
65
|
-
// Save
|
|
65
|
+
// Save pages to your backend (see step 4)
|
|
66
66
|
const save = (data) => {};
|
|
67
67
|
|
|
68
68
|
// Render Puck editor
|
|
@@ -71,7 +71,7 @@ export function Editor() {
|
|
|
71
71
|
}
|
|
72
72
|
```
|
|
73
73
|
|
|
74
|
-
Render the page
|
|
74
|
+
### 3. Render the page
|
|
75
75
|
|
|
76
76
|
```jsx
|
|
77
77
|
// Page.jsx
|
|
@@ -82,18 +82,43 @@ export function Page() {
|
|
|
82
82
|
}
|
|
83
83
|
```
|
|
84
84
|
|
|
85
|
-
|
|
85
|
+
### 4. Choose a backend (optional)
|
|
86
86
|
|
|
87
|
-
|
|
87
|
+
Puck is designed to integrate into your existing backend. If you don't already have one or are building a new app, consider Puck Cloud.
|
|
88
|
+
|
|
89
|
+
## Puck Cloud
|
|
90
|
+
|
|
91
|
+
[Puck Cloud](https://puckeditor.com/docs/cloud/overview) is our modular, hosted backend for Puck with a versioned page database, managed authentication, and much more. It's best for when you have no existing backend or database, and is free to start.
|
|
92
|
+
|
|
93
|
+
To configure it, run the Puck CLI, and select the modules you require:
|
|
88
94
|
|
|
89
95
|
```sh
|
|
90
|
-
npx
|
|
96
|
+
npx @puckeditor/core init
|
|
91
97
|
```
|
|
92
98
|
|
|
93
|
-
|
|
99
|
+
### Pages
|
|
94
100
|
|
|
95
|
-
|
|
96
|
-
|
|
101
|
+
[Puck Pages](https://puckeditor.com/docs/cloud/pages/overview) is a hosted page store built for Puck, providing version history and data migrations.
|
|
102
|
+
|
|
103
|
+
```sh
|
|
104
|
+
npx @puckeditor/core add pages
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Auth
|
|
108
|
+
|
|
109
|
+
[Puck Auth](https://puckeditor.com/docs/cloud/auth/overview) provides managed authentication for Puck, allowing users to sign-in with a Puck Cloud account.
|
|
110
|
+
|
|
111
|
+
```sh
|
|
112
|
+
npx @puckeditor/core add auth
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### AI
|
|
116
|
+
|
|
117
|
+
[Puck AI](https://puckeditor.com/docs/cloud/ai/overview) is an AI agent for Puck for generating interfaces directly from the editor.
|
|
118
|
+
|
|
119
|
+
```sh
|
|
120
|
+
npx @puckeditor/core add ai
|
|
121
|
+
```
|
|
97
122
|
|
|
98
123
|
## Community
|
|
99
124
|
|
|
@@ -104,8 +129,6 @@ Available recipes include:
|
|
|
104
129
|
|
|
105
130
|
If you have any questions about Puck, please open a [GitHub issue](https://github.com/puckeditor/puck/issues) or join us on [Discord](https://discord.gg/D9e4E3MQVZ).
|
|
106
131
|
|
|
107
|
-
Or [book a discovery call](https://app.cal.com/chrisvxd/puck-enquiry/) for hands-on support and consultancy.
|
|
108
|
-
|
|
109
132
|
## License
|
|
110
133
|
|
|
111
134
|
MIT © [The Puck Contributors](https://github.com/puckeditor/puck/graphs/contributors)
|
package/bin/cli.mjs
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Runs the Puck CLI (@puckeditor/cli), which is installed as a dependency of
|
|
3
|
+
// @puckeditor/core, so `npx @puckeditor/core <command>` uses the version that
|
|
4
|
+
// ships with the installed package instead of fetching one.
|
|
5
|
+
import { spawnSync } from "node:child_process";
|
|
6
|
+
import { createRequire } from "node:module";
|
|
7
|
+
import path from "node:path";
|
|
8
|
+
|
|
9
|
+
const require = createRequire(import.meta.url);
|
|
10
|
+
const pkgPath = require.resolve("@puckeditor/cli/package.json");
|
|
11
|
+
const { bin } = require(pkgPath);
|
|
12
|
+
const binPath = path.join(
|
|
13
|
+
path.dirname(pkgPath),
|
|
14
|
+
typeof bin === "string" ? bin : bin.puck
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
const { status, signal } = spawnSync(
|
|
18
|
+
process.execPath,
|
|
19
|
+
[binPath, ...process.argv.slice(2)],
|
|
20
|
+
{ stdio: "inherit" }
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
if (signal) process.kill(process.pid, signal);
|
|
24
|
+
|
|
25
|
+
process.exit(status ?? 1);
|
package/dist/AGENTS.md
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Published as CLAUDE.md, dist/CLAUDE.md and dist/AGENTS.md (see the prepack and
|
|
3
|
+
build scripts).
|
|
4
|
+
-->
|
|
5
|
+
|
|
6
|
+
# @puckeditor/core
|
|
7
|
+
|
|
8
|
+
This is NOT the Puck you know. You MUST read the Puck README before working with Puck: node_modules/@puckeditor/core/README.md
|
|
9
|
+
|
|
10
|
+
Read the Puck CHANGELOG for updates: node_modules/@puckeditor/core/CHANGELOG.md
|
package/dist/CLAUDE.md
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Published as CLAUDE.md, dist/CLAUDE.md and dist/AGENTS.md (see the prepack and
|
|
3
|
+
build scripts).
|
|
4
|
+
-->
|
|
5
|
+
|
|
6
|
+
# @puckeditor/core
|
|
7
|
+
|
|
8
|
+
This is NOT the Puck you know. You MUST read the Puck README before working with Puck: node_modules/@puckeditor/core/README.md
|
|
9
|
+
|
|
10
|
+
Read the Puck CHANGELOG for updates: node_modules/@puckeditor/core/CHANGELOG.md
|
|
@@ -79,7 +79,7 @@ function useSyncedEditor({
|
|
|
79
79
|
}
|
|
80
80
|
});
|
|
81
81
|
useEffect(() => {
|
|
82
|
-
if (!editor) return;
|
|
82
|
+
if (!editor || editor.isDestroyed) return;
|
|
83
83
|
const handleFocus = () => {
|
|
84
84
|
onFocusChange == null ? void 0 : onFocusChange(editor);
|
|
85
85
|
};
|
|
@@ -99,11 +99,12 @@ function useSyncedEditor({
|
|
|
99
99
|
}
|
|
100
100
|
}, [editor, debouncedState, onChange, appStoreApi, name]);
|
|
101
101
|
useEffect(() => {
|
|
102
|
-
editor
|
|
102
|
+
if (!editor || editor.isDestroyed) return;
|
|
103
|
+
editor.setEditable(editable);
|
|
103
104
|
}, [editor, editable]);
|
|
104
105
|
useEffect(() => {
|
|
105
106
|
var _a;
|
|
106
|
-
if (!editor) return;
|
|
107
|
+
if (!editor || editor.isDestroyed) return;
|
|
107
108
|
if (isPending) {
|
|
108
109
|
return;
|
|
109
110
|
}
|
|
@@ -386,9 +386,21 @@ interface SlotField extends BaseField {
|
|
|
386
386
|
allow?: string[];
|
|
387
387
|
disallow?: string[];
|
|
388
388
|
}
|
|
389
|
+
/**
|
|
390
|
+
* Register your own field types by augmenting this interface.
|
|
391
|
+
*
|
|
392
|
+
* @example
|
|
393
|
+
* declare module "@puckeditor/core" {
|
|
394
|
+
* interface FieldTypes {
|
|
395
|
+
* switch: { type: "switch"; options: string[] };
|
|
396
|
+
* }
|
|
397
|
+
* }
|
|
398
|
+
*/
|
|
399
|
+
interface FieldTypes {
|
|
400
|
+
}
|
|
389
401
|
type Field<ValueType = any, UserField extends {} = {}> = TextField | RichtextField | NumberField | TextareaField | SelectField | RadioField | CheckboxField | ArrayField<ValueType extends {
|
|
390
402
|
[key: string]: any;
|
|
391
|
-
}[] ? ValueType : never, UserField> | ObjectField<ValueType, UserField> | ExternalField<ValueType> | ExternalFieldWithAdaptor<ValueType> | CustomField<ValueType> | SlotField;
|
|
403
|
+
}[] ? ValueType : never, UserField> | ObjectField<ValueType, UserField> | ExternalField<ValueType> | ExternalFieldWithAdaptor<ValueType> | CustomField<ValueType> | SlotField | (FieldTypes[keyof FieldTypes] & BaseField);
|
|
392
404
|
type Fields<ComponentProps extends DefaultComponentProps = DefaultComponentProps, UserField extends {} = {}> = {
|
|
393
405
|
[PropName in keyof Omit<ComponentProps, "editMode">]: UserField extends {
|
|
394
406
|
type: PropertyKey;
|
|
@@ -925,4 +937,4 @@ type PuckAction = {
|
|
|
925
937
|
recordHistory?: boolean;
|
|
926
938
|
} & (ReorderAction | InsertAction | MoveAction | ReplaceAction | ReplaceRootAction | RemoveAction | DuplicateAction | SetAction | SetDataAction | SetUiAction | RegisterZoneAction | UnregisterZoneAction);
|
|
927
939
|
|
|
928
|
-
export { type
|
|
940
|
+
export { type NumberField as $, type Adaptor as A, type BaseData as B, type CacheOpts as C, type Data as D, type DragAxis as E, type DropZoneProps as F, type ExternalField as G, type ExternalFieldWithAdaptor as H, type ExtractConfigParams as I, type ExtractField as J, type Field as K, type FieldGroupVariant as L, type FieldMetadata as M, type FieldProps as N, type FieldRenderFunctions as O, type FieldTransformFn as P, type FieldTransformFnParams as Q, type FieldTransforms as R, type FieldTypes as S, type Fields as T, type History as U, type IframeConfig as V, type InitialHistory as W, type ItemSelector as X, type ItemWithId as Y, type MappedItem as Z, type Metadata as _, type AppState as a, type ObjectField as a0, type OnAction as a1, type OverrideKey as a2, type Overrides as a3, type Permissions as a4, type Plugin as a5, type PluginInternal as a6, type PrivateAppState as a7, type PuckAction as a8, type PuckComponent as a9, type PuckContext as aa, type PuckMetadata as ab, type RadioField as ac, type ResolveDataTrigger as ad, type RichText as ae, type RichtextField as af, type RootConfig as ag, type RootData as ah, type RootDataWithProps as ai, type RootDataWithoutProps as aj, type SelectField as ak, type Slot as al, type SlotComponent as am, type SlotField as an, type TextField as ao, type TextareaField as ap, type UiState as aq, type UserGenerics as ar, type Viewport as as, type Viewports as at, type WithChildren as au, type WithDefaultRootFieldProps as av, type WithId as aw, type WithPuckProps as ax, type WithSlotProps as ay, overrideKeys as az, type ArrayField as b, type ArrayState as c, type AsFieldProps as d, type BaseField as e, type CheckboxField as f, type ComponentConfig as g, type ComponentConfigExtensions as h, type ComponentConfigParams as i, type ComponentData as j, type ComponentDataMap as k, type ComponentDataOptionalId as l, type ComponentMetadata as m, type Config as n, type ConfigParams as o, type Content as p, type CustomField as q, type CustomFieldRender as r, type DefaultComponentProps as s, type DefaultComponents as t, type DefaultRootFieldProps as u, type DefaultRootProps as v, type DefaultRootRenderProps as w, type Direction as x, type DndBehavior as y, type DndConfig as z };
|
|
@@ -386,9 +386,21 @@ interface SlotField extends BaseField {
|
|
|
386
386
|
allow?: string[];
|
|
387
387
|
disallow?: string[];
|
|
388
388
|
}
|
|
389
|
+
/**
|
|
390
|
+
* Register your own field types by augmenting this interface.
|
|
391
|
+
*
|
|
392
|
+
* @example
|
|
393
|
+
* declare module "@puckeditor/core" {
|
|
394
|
+
* interface FieldTypes {
|
|
395
|
+
* switch: { type: "switch"; options: string[] };
|
|
396
|
+
* }
|
|
397
|
+
* }
|
|
398
|
+
*/
|
|
399
|
+
interface FieldTypes {
|
|
400
|
+
}
|
|
389
401
|
type Field<ValueType = any, UserField extends {} = {}> = TextField | RichtextField | NumberField | TextareaField | SelectField | RadioField | CheckboxField | ArrayField<ValueType extends {
|
|
390
402
|
[key: string]: any;
|
|
391
|
-
}[] ? ValueType : never, UserField> | ObjectField<ValueType, UserField> | ExternalField<ValueType> | ExternalFieldWithAdaptor<ValueType> | CustomField<ValueType> | SlotField;
|
|
403
|
+
}[] ? ValueType : never, UserField> | ObjectField<ValueType, UserField> | ExternalField<ValueType> | ExternalFieldWithAdaptor<ValueType> | CustomField<ValueType> | SlotField | (FieldTypes[keyof FieldTypes] & BaseField);
|
|
392
404
|
type Fields<ComponentProps extends DefaultComponentProps = DefaultComponentProps, UserField extends {} = {}> = {
|
|
393
405
|
[PropName in keyof Omit<ComponentProps, "editMode">]: UserField extends {
|
|
394
406
|
type: PropertyKey;
|
|
@@ -925,4 +937,4 @@ type PuckAction = {
|
|
|
925
937
|
recordHistory?: boolean;
|
|
926
938
|
} & (ReorderAction | InsertAction | MoveAction | ReplaceAction | ReplaceRootAction | RemoveAction | DuplicateAction | SetAction | SetDataAction | SetUiAction | RegisterZoneAction | UnregisterZoneAction);
|
|
927
939
|
|
|
928
|
-
export { type
|
|
940
|
+
export { type NumberField as $, type Adaptor as A, type BaseData as B, type CacheOpts as C, type Data as D, type DragAxis as E, type DropZoneProps as F, type ExternalField as G, type ExternalFieldWithAdaptor as H, type ExtractConfigParams as I, type ExtractField as J, type Field as K, type FieldGroupVariant as L, type FieldMetadata as M, type FieldProps as N, type FieldRenderFunctions as O, type FieldTransformFn as P, type FieldTransformFnParams as Q, type FieldTransforms as R, type FieldTypes as S, type Fields as T, type History as U, type IframeConfig as V, type InitialHistory as W, type ItemSelector as X, type ItemWithId as Y, type MappedItem as Z, type Metadata as _, type AppState as a, type ObjectField as a0, type OnAction as a1, type OverrideKey as a2, type Overrides as a3, type Permissions as a4, type Plugin as a5, type PluginInternal as a6, type PrivateAppState as a7, type PuckAction as a8, type PuckComponent as a9, type PuckContext as aa, type PuckMetadata as ab, type RadioField as ac, type ResolveDataTrigger as ad, type RichText as ae, type RichtextField as af, type RootConfig as ag, type RootData as ah, type RootDataWithProps as ai, type RootDataWithoutProps as aj, type SelectField as ak, type Slot as al, type SlotComponent as am, type SlotField as an, type TextField as ao, type TextareaField as ap, type UiState as aq, type UserGenerics as ar, type Viewport as as, type Viewports as at, type WithChildren as au, type WithDefaultRootFieldProps as av, type WithId as aw, type WithPuckProps as ax, type WithSlotProps as ay, overrideKeys as az, type ArrayField as b, type ArrayState as c, type AsFieldProps as d, type BaseField as e, type CheckboxField as f, type ComponentConfig as g, type ComponentConfigExtensions as h, type ComponentConfigParams as i, type ComponentData as j, type ComponentDataMap as k, type ComponentDataOptionalId as l, type ComponentMetadata as m, type Config as n, type ConfigParams as o, type Content as p, type CustomField as q, type CustomFieldRender as r, type DefaultComponentProps as s, type DefaultComponents as t, type DefaultRootFieldProps as u, type DefaultRootProps as v, type DefaultRootRenderProps as w, type Direction as x, type DndBehavior as y, type DndConfig as z };
|
|
@@ -23,6 +23,21 @@ import {
|
|
|
23
23
|
init_react_import
|
|
24
24
|
} from "./chunk-M6W7YEVX.mjs";
|
|
25
25
|
|
|
26
|
+
// lib/log-agent-message.ts
|
|
27
|
+
init_react_import();
|
|
28
|
+
var hasLogged = false;
|
|
29
|
+
var logAgentMessage = () => {
|
|
30
|
+
if (hasLogged || typeof window !== "undefined") return;
|
|
31
|
+
hasLogged = true;
|
|
32
|
+
import("@vercel/detect-agent").then(({ determineAgent }) => determineAgent()).then(({ isAgent }) => {
|
|
33
|
+
if (!isAgent) return;
|
|
34
|
+
console.warn(
|
|
35
|
+
"[Puck] AI agent detected. This is NOT the Puck you know. You MUST read the Puck README before working with Puck: node_modules/@puckeditor/core/README.md"
|
|
36
|
+
);
|
|
37
|
+
}).catch(() => {
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
|
|
26
41
|
// lib/migrate.ts
|
|
27
42
|
init_react_import();
|
|
28
43
|
var migrations = [
|
|
@@ -552,6 +567,7 @@ var SlotRender = forwardRef(
|
|
|
552
567
|
);
|
|
553
568
|
|
|
554
569
|
export {
|
|
570
|
+
logAgentMessage,
|
|
555
571
|
getDropZoneProps,
|
|
556
572
|
buildMappers,
|
|
557
573
|
getSlotTransform,
|
|
@@ -9,8 +9,9 @@ import {
|
|
|
9
9
|
buildMappers,
|
|
10
10
|
getDropZoneProps,
|
|
11
11
|
getSlotTransform,
|
|
12
|
+
logAgentMessage,
|
|
12
13
|
use_render_props_default
|
|
13
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-6J54T4F5.mjs";
|
|
14
15
|
import {
|
|
15
16
|
LoadedRichTextMenuInner
|
|
16
17
|
} from "./chunk-5L3MP6BU.mjs";
|
|
@@ -2370,7 +2371,7 @@ EditorFallback.displayName = "EditorFallback";
|
|
|
2370
2371
|
// components/AutoField/fields/RichtextField/index.tsx
|
|
2371
2372
|
import { Fragment as Fragment5, jsx as jsx20 } from "react/jsx-runtime";
|
|
2372
2373
|
var Editor = lazy(
|
|
2373
|
-
() => import("./Editor-
|
|
2374
|
+
() => import("./Editor-CSDCBYXY.mjs").then((m) => ({
|
|
2374
2375
|
default: m.Editor
|
|
2375
2376
|
}))
|
|
2376
2377
|
);
|
|
@@ -6052,7 +6053,7 @@ import {
|
|
|
6052
6053
|
} from "react";
|
|
6053
6054
|
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
6054
6055
|
var Editor2 = lazy2(
|
|
6055
|
-
() => import("./Editor-
|
|
6056
|
+
() => import("./Editor-CSDCBYXY.mjs").then((m) => ({
|
|
6056
6057
|
default: m.Editor
|
|
6057
6058
|
}))
|
|
6058
6059
|
);
|
|
@@ -14760,6 +14761,9 @@ init_react_import();
|
|
|
14760
14761
|
// types/Utils.tsx
|
|
14761
14762
|
init_react_import();
|
|
14762
14763
|
|
|
14764
|
+
// bundle/core.ts
|
|
14765
|
+
logAgentMessage();
|
|
14766
|
+
|
|
14763
14767
|
export {
|
|
14764
14768
|
overrideKeys,
|
|
14765
14769
|
setDeep,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { U as History, a4 as Permissions, j as ComponentData, n as Config, ar as UserGenerics, T as Fields, a8 as PuckAction, ai as RootDataWithProps, ad as ResolveDataTrigger, a5 as Plugin, a3 as Overrides, at as Viewports, V as IframeConfig, aq as UiState, g as ComponentConfig, a as AppState, _ as Metadata, z as DndConfig, R as FieldTransforms, af as RichtextField } from './actions-0EHeGita.mjs';
|
|
2
2
|
import { Editor } from '@tiptap/react';
|
|
3
3
|
|
|
4
4
|
type HistorySlice<D = any> = {
|
|
@@ -143,10 +143,12 @@ declare const defaultDictionary: {
|
|
|
143
143
|
readonly "loader-loading": "loading";
|
|
144
144
|
};
|
|
145
145
|
type DictionaryKey = keyof typeof defaultDictionary;
|
|
146
|
+
type BaseDictionary = Partial<Record<DictionaryKey, string> & Record<string, string>>;
|
|
146
147
|
/**
|
|
147
148
|
* Override any of Puck's built-in UI strings, or provide your own custom strings.
|
|
148
149
|
*/
|
|
149
|
-
|
|
150
|
+
interface Dictionary extends BaseDictionary {
|
|
151
|
+
}
|
|
150
152
|
|
|
151
153
|
type Status = "LOADING" | "MOUNTED" | "READY";
|
|
152
154
|
type ZoomConfig = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { U as History, a4 as Permissions, j as ComponentData, n as Config, ar as UserGenerics, T as Fields, a8 as PuckAction, ai as RootDataWithProps, ad as ResolveDataTrigger, a5 as Plugin, a3 as Overrides, at as Viewports, V as IframeConfig, aq as UiState, g as ComponentConfig, a as AppState, _ as Metadata, z as DndConfig, R as FieldTransforms, af as RichtextField } from './actions-0EHeGita.js';
|
|
2
2
|
import { Editor } from '@tiptap/react';
|
|
3
3
|
|
|
4
4
|
type HistorySlice<D = any> = {
|
|
@@ -143,10 +143,12 @@ declare const defaultDictionary: {
|
|
|
143
143
|
readonly "loader-loading": "loading";
|
|
144
144
|
};
|
|
145
145
|
type DictionaryKey = keyof typeof defaultDictionary;
|
|
146
|
+
type BaseDictionary = Partial<Record<DictionaryKey, string> & Record<string, string>>;
|
|
146
147
|
/**
|
|
147
148
|
* Override any of Puck's built-in UI strings, or provide your own custom strings.
|
|
148
149
|
*/
|
|
149
|
-
|
|
150
|
+
interface Dictionary extends BaseDictionary {
|
|
151
|
+
}
|
|
150
152
|
|
|
151
153
|
type Status = "LOADING" | "MOUNTED" | "READY";
|
|
152
154
|
type ZoomConfig = {
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { K as Field, N as FieldProps, L as FieldGroupVariant, F as DropZoneProps, n as Config,
|
|
2
|
-
export { A as Adaptor, a as AppState, b as ArrayField, c as ArrayState, d as AsFieldProps, B as BaseData, e as BaseField, C as CacheOpts, f as CheckboxField, g as ComponentConfig, h as ComponentConfigExtensions, i as ComponentConfigParams, k as ComponentDataMap, l as ComponentDataOptionalId, m as ComponentMetadata, o as ConfigParams, p as Content, q as CustomField, r as CustomFieldRender, s as DefaultComponentProps, t as DefaultComponents, u as DefaultRootFieldProps, v as DefaultRootProps, w as DefaultRootRenderProps, x as Direction, y as DndBehavior, E as DragAxis, G as ExternalField, H as ExternalFieldWithAdaptor, I as ExtractConfigParams, J as ExtractField, M as FieldMetadata, O as FieldRenderFunctions, P as FieldTransformFn, Q as FieldTransformFnParams, S as
|
|
3
|
-
import { D as Dictionary, A as AppStore, G as GetPermissions, R as RefreshPermissions, H as HistorySlice } from './index-
|
|
4
|
-
export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-
|
|
1
|
+
import { K as Field, N as FieldProps, L as FieldGroupVariant, F as DropZoneProps, n as Config, ar as UserGenerics, D as Data, aq as UiState, a1 as OnAction, a4 as Permissions, a5 as Plugin, a3 as Overrides, R as FieldTransforms, a8 as PuckAction, at as Viewports, V as IframeConfig, z as DndConfig, W as InitialHistory, _ as Metadata, ad as ResolveDataTrigger, X as ItemSelector, j as ComponentData, a6 as PluginInternal } from './actions-0EHeGita.mjs';
|
|
2
|
+
export { A as Adaptor, a as AppState, b as ArrayField, c as ArrayState, d as AsFieldProps, B as BaseData, e as BaseField, C as CacheOpts, f as CheckboxField, g as ComponentConfig, h as ComponentConfigExtensions, i as ComponentConfigParams, k as ComponentDataMap, l as ComponentDataOptionalId, m as ComponentMetadata, o as ConfigParams, p as Content, q as CustomField, r as CustomFieldRender, s as DefaultComponentProps, t as DefaultComponents, u as DefaultRootFieldProps, v as DefaultRootProps, w as DefaultRootRenderProps, x as Direction, y as DndBehavior, E as DragAxis, G as ExternalField, H as ExternalFieldWithAdaptor, I as ExtractConfigParams, J as ExtractField, M as FieldMetadata, O as FieldRenderFunctions, P as FieldTransformFn, Q as FieldTransformFnParams, S as FieldTypes, T as Fields, U as History, Y as ItemWithId, Z as MappedItem, $ as NumberField, a0 as ObjectField, a2 as OverrideKey, a9 as PuckComponent, aa as PuckContext, ab as PuckMetadata, ac as RadioField, ae as RichText, af as RichtextField, ag as RootConfig, ah as RootData, ai as RootDataWithProps, aj as RootDataWithoutProps, ak as SelectField, al as Slot, am as SlotComponent, an as SlotField, ao as TextField, ap as TextareaField, as as Viewport, au as WithChildren, av as WithDefaultRootFieldProps, aw as WithId, ax as WithPuckProps, ay as WithSlotProps, az as overrideKeys } from './actions-0EHeGita.mjs';
|
|
3
|
+
import { D as Dictionary, A as AppStore, G as GetPermissions, R as RefreshPermissions, H as HistorySlice } from './index-BPkpm4Az.mjs';
|
|
4
|
+
export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-BFTZdvq8.mjs';
|
|
5
5
|
import * as react from 'react';
|
|
6
6
|
import react__default, { ReactNode, SyntheticEvent, ReactElement, ElementType, Ref, CSSProperties } from 'react';
|
|
7
7
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { K as Field, N as FieldProps, L as FieldGroupVariant, F as DropZoneProps, n as Config,
|
|
2
|
-
export { A as Adaptor, a as AppState, b as ArrayField, c as ArrayState, d as AsFieldProps, B as BaseData, e as BaseField, C as CacheOpts, f as CheckboxField, g as ComponentConfig, h as ComponentConfigExtensions, i as ComponentConfigParams, k as ComponentDataMap, l as ComponentDataOptionalId, m as ComponentMetadata, o as ConfigParams, p as Content, q as CustomField, r as CustomFieldRender, s as DefaultComponentProps, t as DefaultComponents, u as DefaultRootFieldProps, v as DefaultRootProps, w as DefaultRootRenderProps, x as Direction, y as DndBehavior, E as DragAxis, G as ExternalField, H as ExternalFieldWithAdaptor, I as ExtractConfigParams, J as ExtractField, M as FieldMetadata, O as FieldRenderFunctions, P as FieldTransformFn, Q as FieldTransformFnParams, S as
|
|
3
|
-
import { D as Dictionary, A as AppStore, G as GetPermissions, R as RefreshPermissions, H as HistorySlice } from './index-
|
|
4
|
-
export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-
|
|
1
|
+
import { K as Field, N as FieldProps, L as FieldGroupVariant, F as DropZoneProps, n as Config, ar as UserGenerics, D as Data, aq as UiState, a1 as OnAction, a4 as Permissions, a5 as Plugin, a3 as Overrides, R as FieldTransforms, a8 as PuckAction, at as Viewports, V as IframeConfig, z as DndConfig, W as InitialHistory, _ as Metadata, ad as ResolveDataTrigger, X as ItemSelector, j as ComponentData, a6 as PluginInternal } from './actions-0EHeGita.js';
|
|
2
|
+
export { A as Adaptor, a as AppState, b as ArrayField, c as ArrayState, d as AsFieldProps, B as BaseData, e as BaseField, C as CacheOpts, f as CheckboxField, g as ComponentConfig, h as ComponentConfigExtensions, i as ComponentConfigParams, k as ComponentDataMap, l as ComponentDataOptionalId, m as ComponentMetadata, o as ConfigParams, p as Content, q as CustomField, r as CustomFieldRender, s as DefaultComponentProps, t as DefaultComponents, u as DefaultRootFieldProps, v as DefaultRootProps, w as DefaultRootRenderProps, x as Direction, y as DndBehavior, E as DragAxis, G as ExternalField, H as ExternalFieldWithAdaptor, I as ExtractConfigParams, J as ExtractField, M as FieldMetadata, O as FieldRenderFunctions, P as FieldTransformFn, Q as FieldTransformFnParams, S as FieldTypes, T as Fields, U as History, Y as ItemWithId, Z as MappedItem, $ as NumberField, a0 as ObjectField, a2 as OverrideKey, a9 as PuckComponent, aa as PuckContext, ab as PuckMetadata, ac as RadioField, ae as RichText, af as RichtextField, ag as RootConfig, ah as RootData, ai as RootDataWithProps, aj as RootDataWithoutProps, ak as SelectField, al as Slot, am as SlotComponent, an as SlotField, ao as TextField, ap as TextareaField, as as Viewport, au as WithChildren, av as WithDefaultRootFieldProps, aw as WithId, ax as WithPuckProps, ay as WithSlotProps, az as overrideKeys } from './actions-0EHeGita.js';
|
|
3
|
+
import { D as Dictionary, A as AppStore, G as GetPermissions, R as RefreshPermissions, H as HistorySlice } from './index-UEGrr-Tp.js';
|
|
4
|
+
export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-vgdtHk4C.js';
|
|
5
5
|
import * as react from 'react';
|
|
6
6
|
import react__default, { ReactNode, SyntheticEvent, ReactElement, ElementType, Ref, CSSProperties } from 'react';
|
|
7
7
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
package/dist/index.js
CHANGED
|
@@ -5584,7 +5584,7 @@ function useSyncedEditor({
|
|
|
5584
5584
|
}
|
|
5585
5585
|
});
|
|
5586
5586
|
(0, import_react40.useEffect)(() => {
|
|
5587
|
-
if (!editor) return;
|
|
5587
|
+
if (!editor || editor.isDestroyed) return;
|
|
5588
5588
|
const handleFocus = () => {
|
|
5589
5589
|
onFocusChange == null ? void 0 : onFocusChange(editor);
|
|
5590
5590
|
};
|
|
@@ -5604,11 +5604,12 @@ function useSyncedEditor({
|
|
|
5604
5604
|
}
|
|
5605
5605
|
}, [editor, debouncedState, onChange, appStoreApi, name]);
|
|
5606
5606
|
(0, import_react40.useEffect)(() => {
|
|
5607
|
-
editor
|
|
5607
|
+
if (!editor || editor.isDestroyed) return;
|
|
5608
|
+
editor.setEditable(editable);
|
|
5608
5609
|
}, [editor, editable]);
|
|
5609
5610
|
(0, import_react40.useEffect)(() => {
|
|
5610
5611
|
var _a;
|
|
5611
|
-
if (!editor) return;
|
|
5612
|
+
if (!editor || editor.isDestroyed) return;
|
|
5612
5613
|
if (isPending) {
|
|
5613
5614
|
return;
|
|
5614
5615
|
}
|
|
@@ -6041,6 +6042,21 @@ init_react_import();
|
|
|
6041
6042
|
// bundle/core.ts
|
|
6042
6043
|
init_react_import();
|
|
6043
6044
|
|
|
6045
|
+
// lib/log-agent-message.ts
|
|
6046
|
+
init_react_import();
|
|
6047
|
+
var hasLogged = false;
|
|
6048
|
+
var logAgentMessage = () => {
|
|
6049
|
+
if (hasLogged || typeof window !== "undefined") return;
|
|
6050
|
+
hasLogged = true;
|
|
6051
|
+
import("@vercel/detect-agent").then(({ determineAgent }) => determineAgent()).then(({ isAgent }) => {
|
|
6052
|
+
if (!isAgent) return;
|
|
6053
|
+
console.warn(
|
|
6054
|
+
"[Puck] AI agent detected. This is NOT the Puck you know. You MUST read the Puck README before working with Puck: node_modules/@puckeditor/core/README.md"
|
|
6055
|
+
);
|
|
6056
|
+
}).catch(() => {
|
|
6057
|
+
});
|
|
6058
|
+
};
|
|
6059
|
+
|
|
6044
6060
|
// types/API/index.ts
|
|
6045
6061
|
init_react_import();
|
|
6046
6062
|
|
|
@@ -21364,6 +21380,9 @@ var legacySideBarPlugin = (props = {}) => ({
|
|
|
21364
21380
|
}
|
|
21365
21381
|
)
|
|
21366
21382
|
});
|
|
21383
|
+
|
|
21384
|
+
// bundle/core.ts
|
|
21385
|
+
logAgentMessage();
|
|
21367
21386
|
// Annotate the CommonJS export names for ESM import in node:
|
|
21368
21387
|
0 && (module.exports = {
|
|
21369
21388
|
Action,
|
package/dist/index.mjs
CHANGED
|
@@ -20,13 +20,13 @@ import {
|
|
|
20
20
|
setDeep,
|
|
21
21
|
useGetPuck,
|
|
22
22
|
usePuck
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-OA56LRDR.mjs";
|
|
24
24
|
import "./chunk-UIJZMSVU.mjs";
|
|
25
25
|
import {
|
|
26
26
|
migrate,
|
|
27
27
|
resolveAllData,
|
|
28
28
|
transformProps
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-6J54T4F5.mjs";
|
|
30
30
|
import "./chunk-H635BA2V.mjs";
|
|
31
31
|
import {
|
|
32
32
|
RichTextMenu
|
package/dist/internal.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Reducer } from 'react';
|
|
2
|
-
import { D as Data, a as AppState,
|
|
3
|
-
import { A as AppStore } from './index-
|
|
2
|
+
import { D as Data, a as AppState, a1 as OnAction, a7 as PrivateAppState, a8 as PuckAction } from './actions-0EHeGita.mjs';
|
|
3
|
+
import { A as AppStore } from './index-BPkpm4Az.mjs';
|
|
4
4
|
import '@tiptap/react';
|
|
5
5
|
import '@tiptap/extension-blockquote';
|
|
6
6
|
import '@tiptap/extension-bold';
|
package/dist/internal.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Reducer } from 'react';
|
|
2
|
-
import { D as Data, a as AppState,
|
|
3
|
-
import { A as AppStore } from './index-
|
|
2
|
+
import { D as Data, a as AppState, a1 as OnAction, a7 as PrivateAppState, a8 as PuckAction } from './actions-0EHeGita.js';
|
|
3
|
+
import { A as AppStore } from './index-UEGrr-Tp.js';
|
|
4
4
|
import '@tiptap/react';
|
|
5
5
|
import '@tiptap/extension-blockquote';
|
|
6
6
|
import '@tiptap/extension-bold';
|
package/dist/no-external.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { A as Adaptor, a as AppState, b as ArrayField, c as ArrayState, d as AsFieldProps, B as BaseData, e as BaseField, C as CacheOpts, f as CheckboxField, g as ComponentConfig, h as ComponentConfigExtensions, i as ComponentConfigParams, j as ComponentData, k as ComponentDataMap, l as ComponentDataOptionalId, m as ComponentMetadata, n as Config, o as ConfigParams, p as Content, q as CustomField, r as CustomFieldRender, D as Data, s as DefaultComponentProps, t as DefaultComponents, u as DefaultRootFieldProps, v as DefaultRootProps, w as DefaultRootRenderProps, x as Direction, y as DndBehavior, z as DndConfig, E as DragAxis, G as ExternalField, H as ExternalFieldWithAdaptor, I as ExtractConfigParams, J as ExtractField, K as Field, L as FieldGroupVariant, M as FieldMetadata, N as FieldProps, O as FieldRenderFunctions, P as FieldTransformFn, Q as FieldTransformFnParams, R as FieldTransforms, S as
|
|
2
|
-
export { D as Dictionary } from './index-
|
|
1
|
+
export { A as Adaptor, a as AppState, b as ArrayField, c as ArrayState, d as AsFieldProps, B as BaseData, e as BaseField, C as CacheOpts, f as CheckboxField, g as ComponentConfig, h as ComponentConfigExtensions, i as ComponentConfigParams, j as ComponentData, k as ComponentDataMap, l as ComponentDataOptionalId, m as ComponentMetadata, n as Config, o as ConfigParams, p as Content, q as CustomField, r as CustomFieldRender, D as Data, s as DefaultComponentProps, t as DefaultComponents, u as DefaultRootFieldProps, v as DefaultRootProps, w as DefaultRootRenderProps, x as Direction, y as DndBehavior, z as DndConfig, E as DragAxis, G as ExternalField, H as ExternalFieldWithAdaptor, I as ExtractConfigParams, J as ExtractField, K as Field, L as FieldGroupVariant, M as FieldMetadata, N as FieldProps, O as FieldRenderFunctions, P as FieldTransformFn, Q as FieldTransformFnParams, R as FieldTransforms, S as FieldTypes, T as Fields, U as History, V as IframeConfig, W as InitialHistory, Y as ItemWithId, Z as MappedItem, _ as Metadata, $ as NumberField, a0 as ObjectField, a1 as OnAction, a2 as OverrideKey, a3 as Overrides, a4 as Permissions, a5 as Plugin, a8 as PuckAction, a9 as PuckComponent, aa as PuckContext, ab as PuckMetadata, ac as RadioField, ad as ResolveDataTrigger, ae as RichText, af as RichtextField, ag as RootConfig, ah as RootData, ai as RootDataWithProps, aj as RootDataWithoutProps, ak as SelectField, al as Slot, am as SlotComponent, an as SlotField, ao as TextField, ap as TextareaField, aq as UiState, ar as UserGenerics, as as Viewport, at as Viewports, au as WithChildren, av as WithDefaultRootFieldProps, aw as WithId, ax as WithPuckProps, ay as WithSlotProps, az as overrideKeys } from './actions-0EHeGita.mjs';
|
|
2
|
+
export { D as Dictionary } from './index-BPkpm4Az.mjs';
|
|
3
3
|
export { Action, ActionBar, AutoField, BlocksPluginProps, Button, DragHandle, Drawer, DropZone, FieldGroup, FieldLabel, FieldTab, Group, IconButton, InlineTextField, Label, OutlinePluginProps, Puck, PuckApi, Render, RichTextMenu, Separator, UsePuckData, blocksPlugin, createUsePuck, fieldsPlugin, legacySideBarPlugin, outlinePlugin, registerOverlayPortal, renderContext, setDeep, useGetPuck, usePuck } from './index.mjs';
|
|
4
|
-
export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-
|
|
4
|
+
export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-BFTZdvq8.mjs';
|
|
5
5
|
import 'react';
|
|
6
6
|
import '@tiptap/react';
|
|
7
7
|
import '@tiptap/extension-blockquote';
|
package/dist/no-external.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { A as Adaptor, a as AppState, b as ArrayField, c as ArrayState, d as AsFieldProps, B as BaseData, e as BaseField, C as CacheOpts, f as CheckboxField, g as ComponentConfig, h as ComponentConfigExtensions, i as ComponentConfigParams, j as ComponentData, k as ComponentDataMap, l as ComponentDataOptionalId, m as ComponentMetadata, n as Config, o as ConfigParams, p as Content, q as CustomField, r as CustomFieldRender, D as Data, s as DefaultComponentProps, t as DefaultComponents, u as DefaultRootFieldProps, v as DefaultRootProps, w as DefaultRootRenderProps, x as Direction, y as DndBehavior, z as DndConfig, E as DragAxis, G as ExternalField, H as ExternalFieldWithAdaptor, I as ExtractConfigParams, J as ExtractField, K as Field, L as FieldGroupVariant, M as FieldMetadata, N as FieldProps, O as FieldRenderFunctions, P as FieldTransformFn, Q as FieldTransformFnParams, R as FieldTransforms, S as
|
|
2
|
-
export { D as Dictionary } from './index-
|
|
1
|
+
export { A as Adaptor, a as AppState, b as ArrayField, c as ArrayState, d as AsFieldProps, B as BaseData, e as BaseField, C as CacheOpts, f as CheckboxField, g as ComponentConfig, h as ComponentConfigExtensions, i as ComponentConfigParams, j as ComponentData, k as ComponentDataMap, l as ComponentDataOptionalId, m as ComponentMetadata, n as Config, o as ConfigParams, p as Content, q as CustomField, r as CustomFieldRender, D as Data, s as DefaultComponentProps, t as DefaultComponents, u as DefaultRootFieldProps, v as DefaultRootProps, w as DefaultRootRenderProps, x as Direction, y as DndBehavior, z as DndConfig, E as DragAxis, G as ExternalField, H as ExternalFieldWithAdaptor, I as ExtractConfigParams, J as ExtractField, K as Field, L as FieldGroupVariant, M as FieldMetadata, N as FieldProps, O as FieldRenderFunctions, P as FieldTransformFn, Q as FieldTransformFnParams, R as FieldTransforms, S as FieldTypes, T as Fields, U as History, V as IframeConfig, W as InitialHistory, Y as ItemWithId, Z as MappedItem, _ as Metadata, $ as NumberField, a0 as ObjectField, a1 as OnAction, a2 as OverrideKey, a3 as Overrides, a4 as Permissions, a5 as Plugin, a8 as PuckAction, a9 as PuckComponent, aa as PuckContext, ab as PuckMetadata, ac as RadioField, ad as ResolveDataTrigger, ae as RichText, af as RichtextField, ag as RootConfig, ah as RootData, ai as RootDataWithProps, aj as RootDataWithoutProps, ak as SelectField, al as Slot, am as SlotComponent, an as SlotField, ao as TextField, ap as TextareaField, aq as UiState, ar as UserGenerics, as as Viewport, at as Viewports, au as WithChildren, av as WithDefaultRootFieldProps, aw as WithId, ax as WithPuckProps, ay as WithSlotProps, az as overrideKeys } from './actions-0EHeGita.js';
|
|
2
|
+
export { D as Dictionary } from './index-UEGrr-Tp.js';
|
|
3
3
|
export { Action, ActionBar, AutoField, BlocksPluginProps, Button, DragHandle, Drawer, DropZone, FieldGroup, FieldLabel, FieldTab, Group, IconButton, InlineTextField, Label, OutlinePluginProps, Puck, PuckApi, Render, RichTextMenu, Separator, UsePuckData, blocksPlugin, createUsePuck, fieldsPlugin, legacySideBarPlugin, outlinePlugin, registerOverlayPortal, renderContext, setDeep, useGetPuck, usePuck } from './index.js';
|
|
4
|
-
export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-
|
|
4
|
+
export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-vgdtHk4C.js';
|
|
5
5
|
import 'react';
|
|
6
6
|
import '@tiptap/react';
|
|
7
7
|
import '@tiptap/extension-blockquote';
|
package/dist/no-external.js
CHANGED
|
@@ -5584,7 +5584,7 @@ function useSyncedEditor({
|
|
|
5584
5584
|
}
|
|
5585
5585
|
});
|
|
5586
5586
|
(0, import_react40.useEffect)(() => {
|
|
5587
|
-
if (!editor) return;
|
|
5587
|
+
if (!editor || editor.isDestroyed) return;
|
|
5588
5588
|
const handleFocus = () => {
|
|
5589
5589
|
onFocusChange == null ? void 0 : onFocusChange(editor);
|
|
5590
5590
|
};
|
|
@@ -5604,11 +5604,12 @@ function useSyncedEditor({
|
|
|
5604
5604
|
}
|
|
5605
5605
|
}, [editor, debouncedState, onChange, appStoreApi, name]);
|
|
5606
5606
|
(0, import_react40.useEffect)(() => {
|
|
5607
|
-
editor
|
|
5607
|
+
if (!editor || editor.isDestroyed) return;
|
|
5608
|
+
editor.setEditable(editable);
|
|
5608
5609
|
}, [editor, editable]);
|
|
5609
5610
|
(0, import_react40.useEffect)(() => {
|
|
5610
5611
|
var _a;
|
|
5611
|
-
if (!editor) return;
|
|
5612
|
+
if (!editor || editor.isDestroyed) return;
|
|
5612
5613
|
if (isPending) {
|
|
5613
5614
|
return;
|
|
5614
5615
|
}
|
|
@@ -6041,6 +6042,21 @@ init_react_import();
|
|
|
6041
6042
|
// bundle/core.ts
|
|
6042
6043
|
init_react_import();
|
|
6043
6044
|
|
|
6045
|
+
// lib/log-agent-message.ts
|
|
6046
|
+
init_react_import();
|
|
6047
|
+
var hasLogged = false;
|
|
6048
|
+
var logAgentMessage = () => {
|
|
6049
|
+
if (hasLogged || typeof window !== "undefined") return;
|
|
6050
|
+
hasLogged = true;
|
|
6051
|
+
import("@vercel/detect-agent").then(({ determineAgent }) => determineAgent()).then(({ isAgent }) => {
|
|
6052
|
+
if (!isAgent) return;
|
|
6053
|
+
console.warn(
|
|
6054
|
+
"[Puck] AI agent detected. This is NOT the Puck you know. You MUST read the Puck README before working with Puck: node_modules/@puckeditor/core/README.md"
|
|
6055
|
+
);
|
|
6056
|
+
}).catch(() => {
|
|
6057
|
+
});
|
|
6058
|
+
};
|
|
6059
|
+
|
|
6044
6060
|
// types/API/index.ts
|
|
6045
6061
|
init_react_import();
|
|
6046
6062
|
|
|
@@ -21364,6 +21380,9 @@ var legacySideBarPlugin = (props = {}) => ({
|
|
|
21364
21380
|
}
|
|
21365
21381
|
)
|
|
21366
21382
|
});
|
|
21383
|
+
|
|
21384
|
+
// bundle/core.ts
|
|
21385
|
+
logAgentMessage();
|
|
21367
21386
|
// Annotate the CommonJS export names for ESM import in node:
|
|
21368
21387
|
0 && (module.exports = {
|
|
21369
21388
|
Action,
|
package/dist/no-external.mjs
CHANGED
|
@@ -20,13 +20,13 @@ import {
|
|
|
20
20
|
setDeep,
|
|
21
21
|
useGetPuck,
|
|
22
22
|
usePuck
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-OA56LRDR.mjs";
|
|
24
24
|
import "./chunk-UIJZMSVU.mjs";
|
|
25
25
|
import {
|
|
26
26
|
migrate,
|
|
27
27
|
resolveAllData,
|
|
28
28
|
transformProps
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-6J54T4F5.mjs";
|
|
30
30
|
import "./chunk-H635BA2V.mjs";
|
|
31
31
|
import {
|
|
32
32
|
RichTextMenu
|
package/dist/rsc.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { n as Config,
|
|
3
|
-
export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-
|
|
2
|
+
import { n as Config, ar as UserGenerics, _ as Metadata, R as FieldTransforms } from './actions-0EHeGita.mjs';
|
|
3
|
+
export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-BFTZdvq8.mjs';
|
|
4
4
|
import 'react';
|
|
5
5
|
import '@tiptap/react';
|
|
6
6
|
import '@tiptap/extension-blockquote';
|
package/dist/rsc.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { n as Config,
|
|
3
|
-
export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-
|
|
2
|
+
import { n as Config, ar as UserGenerics, _ as Metadata, R as FieldTransforms } from './actions-0EHeGita.js';
|
|
3
|
+
export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-vgdtHk4C.js';
|
|
4
4
|
import 'react';
|
|
5
5
|
import '@tiptap/react';
|
|
6
6
|
import '@tiptap/extension-blockquote';
|
package/dist/rsc.js
CHANGED
|
@@ -370,6 +370,21 @@ __export(rsc_exports, {
|
|
|
370
370
|
module.exports = __toCommonJS(rsc_exports);
|
|
371
371
|
init_react_import();
|
|
372
372
|
|
|
373
|
+
// lib/log-agent-message.ts
|
|
374
|
+
init_react_import();
|
|
375
|
+
var hasLogged = false;
|
|
376
|
+
var logAgentMessage = () => {
|
|
377
|
+
if (hasLogged || typeof window !== "undefined") return;
|
|
378
|
+
hasLogged = true;
|
|
379
|
+
import("@vercel/detect-agent").then(({ determineAgent }) => determineAgent()).then(({ isAgent }) => {
|
|
380
|
+
if (!isAgent) return;
|
|
381
|
+
console.warn(
|
|
382
|
+
"[Puck] AI agent detected. This is NOT the Puck you know. You MUST read the Puck README before working with Puck: node_modules/@puckeditor/core/README.md"
|
|
383
|
+
);
|
|
384
|
+
}).catch(() => {
|
|
385
|
+
});
|
|
386
|
+
};
|
|
387
|
+
|
|
373
388
|
// components/ServerRender/index.tsx
|
|
374
389
|
init_react_import();
|
|
375
390
|
|
|
@@ -1608,6 +1623,9 @@ function migrate(data, config, migrationOptions) {
|
|
|
1608
1623
|
data
|
|
1609
1624
|
);
|
|
1610
1625
|
}
|
|
1626
|
+
|
|
1627
|
+
// bundle/rsc.tsx
|
|
1628
|
+
logAgentMessage();
|
|
1611
1629
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1612
1630
|
0 && (module.exports = {
|
|
1613
1631
|
Render,
|
package/dist/rsc.mjs
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SlotRenderPure,
|
|
3
|
+
logAgentMessage,
|
|
3
4
|
migrate,
|
|
4
5
|
resolveAllData,
|
|
5
6
|
transformProps,
|
|
6
7
|
use_render_props_default
|
|
7
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-6J54T4F5.mjs";
|
|
8
9
|
import "./chunk-H635BA2V.mjs";
|
|
9
10
|
import "./chunk-XMN55NON.mjs";
|
|
10
11
|
import "./chunk-OT7NKYY4.mjs";
|
|
@@ -169,6 +170,9 @@ function Render({
|
|
|
169
170
|
}
|
|
170
171
|
);
|
|
171
172
|
}
|
|
173
|
+
|
|
174
|
+
// bundle/rsc.tsx
|
|
175
|
+
logAgentMessage();
|
|
172
176
|
export {
|
|
173
177
|
Render,
|
|
174
178
|
migrate,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as Config, D as Data,
|
|
1
|
+
import { n as Config, D as Data, aw as WithId, ar as UserGenerics, p as Content, j as ComponentData, t as DefaultComponents, s as DefaultComponentProps, u as DefaultRootFieldProps, _ as Metadata, ah as RootData } from './actions-0EHeGita.mjs';
|
|
2
2
|
|
|
3
3
|
type MigrationOptions<UserConfig extends Config> = {
|
|
4
4
|
migrateDynamicZonesForComponent?: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as Config, D as Data,
|
|
1
|
+
import { n as Config, D as Data, aw as WithId, ar as UserGenerics, p as Content, j as ComponentData, t as DefaultComponents, s as DefaultComponentProps, u as DefaultRootFieldProps, _ as Metadata, ah as RootData } from './actions-0EHeGita.js';
|
|
2
2
|
|
|
3
3
|
type MigrationOptions<UserConfig extends Config> = {
|
|
4
4
|
migrateDynamicZonesForComponent?: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@puckeditor/core",
|
|
3
|
-
"version": "0.24.
|
|
3
|
+
"version": "0.24.1-canary.0418cede",
|
|
4
4
|
"description": "The open-source visual editor for React",
|
|
5
5
|
"author": "Chris Villa <chris@puckeditor.com>",
|
|
6
6
|
"repository": {
|
|
@@ -30,6 +30,12 @@
|
|
|
30
30
|
"private": false,
|
|
31
31
|
"main": "./dist/index.js",
|
|
32
32
|
"types": "./dist/index.d.ts",
|
|
33
|
+
"bin": {
|
|
34
|
+
"@puckeditor/core": "./bin/cli.mjs"
|
|
35
|
+
},
|
|
36
|
+
"browser": {
|
|
37
|
+
"@vercel/detect-agent": false
|
|
38
|
+
},
|
|
33
39
|
"exports": {
|
|
34
40
|
".": {
|
|
35
41
|
"react-server": {
|
|
@@ -70,15 +76,16 @@
|
|
|
70
76
|
"node": ">=20.0.0"
|
|
71
77
|
},
|
|
72
78
|
"files": [
|
|
79
|
+
"bin",
|
|
73
80
|
"dist",
|
|
74
|
-
"CHANGELOG.md"
|
|
81
|
+
"CHANGELOG.md",
|
|
82
|
+
"CLAUDE.md"
|
|
75
83
|
],
|
|
76
84
|
"devDependencies": {
|
|
77
85
|
"@juggle/resize-observer": "^3.4.0",
|
|
78
86
|
"@testing-library/dom": "^10.4.0",
|
|
79
87
|
"@testing-library/jest-dom": "^6.6.3",
|
|
80
88
|
"@testing-library/react": "^16.1.0",
|
|
81
|
-
"@types/deep-diff": "^1.0.3",
|
|
82
89
|
"@types/flat": "^5.0.5",
|
|
83
90
|
"@types/jest": "^29.5.14",
|
|
84
91
|
"@types/object-hash": "^3.0.6",
|
|
@@ -109,6 +116,7 @@
|
|
|
109
116
|
"@dnd-kit/helpers": "0.4.0",
|
|
110
117
|
"@dnd-kit/react": "0.4.0",
|
|
111
118
|
"@dnd-kit/state": "0.4.0",
|
|
119
|
+
"@puckeditor/cli": "latest",
|
|
112
120
|
"@radix-ui/react-popover": "^1.1.15",
|
|
113
121
|
"@tanstack/react-virtual": "^3.13.9",
|
|
114
122
|
"@tiptap/core": "^3.30.4",
|
|
@@ -131,7 +139,7 @@
|
|
|
131
139
|
"@tiptap/html": "^3.30.4",
|
|
132
140
|
"@tiptap/pm": "^3.30.4",
|
|
133
141
|
"@tiptap/react": "^3.30.4",
|
|
134
|
-
"
|
|
142
|
+
"@vercel/detect-agent": "^1.2.7",
|
|
135
143
|
"fast-equals": "5.2.2",
|
|
136
144
|
"flat": "^5.0.2",
|
|
137
145
|
"happy-dom": "^21.0.4",
|
|
@@ -145,7 +153,7 @@
|
|
|
145
153
|
},
|
|
146
154
|
"scripts": {
|
|
147
155
|
"lint": "eslint \"**/*.ts*\"",
|
|
148
|
-
"build": "rm -rf dist && tsup bundle/index.ts bundle/rsc.tsx bundle/no-external.ts bundle/internal.ts",
|
|
156
|
+
"build": "rm -rf dist && tsup bundle/index.ts bundle/rsc.tsx bundle/no-external.ts bundle/internal.ts && cp AGENTS.package.md dist/CLAUDE.md && cp AGENTS.package.md dist/AGENTS.md",
|
|
149
157
|
"test": "jest"
|
|
150
158
|
}
|
|
151
159
|
}
|