@puckeditor/core 0.24.1-canary.d9f7158f → 0.24.1-canary.eef68a2e

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 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) • [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)
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
 
16
16
  ⭐️ Enjoying Puck? Please [leave a star](https://github.com/puckeditor/puck)!
17
17
 
@@ -23,28 +23,18 @@ _The visual editor for React_
23
23
 
24
24
  ## What is Puck?
25
25
 
26
- Puck is an open-source visual editor for React. Embed it in your application to build interfaces with drag-and-drop, powered by your own React components.
26
+ Puck is a modular, open-source visual editor for React.js. You can use Puck to build custom drag-and-drop experiences with your own application and React components.
27
27
 
28
- Because Puck is just a React component, it fits into existing React applications. You own your components and data, with no vendor lock-in.
28
+ Because Puck is just a React component, it plays well with all React.js environments, including Next.js. You own your data and there’s no vendor lock-in.
29
29
 
30
30
  Puck is also [licensed under MIT](https://github.com/puckeditor/puck?tab=MIT-1-ov-file#readme), making it suitable for both internal systems and commercial applications.
31
31
 
32
32
  ## Quick start
33
33
 
34
- Run the [Puck CLI](https://puckeditor.com/docs/cli):
35
-
36
- ```sh
37
- npx @puckeditor/cli init
38
- ```
39
-
40
- <details>
41
- <summary><strong>Manual setup</strong></summary>
42
- <br />
43
-
44
34
  Install the package:
45
35
 
46
36
  ```sh
47
- npm i @puckeditor/core --save
37
+ npm i @puckeditor/core --save # or npx create-puck-app my-app
48
38
  ```
49
39
 
50
40
  Render the editor:
@@ -72,8 +62,7 @@ const config = {
72
62
  // Describe the initial data
73
63
  const initialData = {};
74
64
 
75
- // Store pages in your own database, or run `npx @puckeditor/cli add pages`
76
- // to store, version and publish them with Puck Pages
65
+ // Save the data to your database
77
66
  const save = (data) => {};
78
67
 
79
68
  // Render Puck editor
@@ -93,48 +82,18 @@ export function Page() {
93
82
  }
94
83
  ```
95
84
 
96
- </details>
85
+ ## Recipes
97
86
 
98
- ## Puck Cloud
99
-
100
- Puck Cloud is a modular backend for your Puck editor:
101
-
102
- - **Pages**: store, version and publish pages
103
- - **Auth**: sign editors in
104
- - **Assets**: store images and files
105
- - **AI**: generate pages with an AI copilot
106
-
107
- Puck Cloud is free to start with, and scales with usage.
108
-
109
- ### Pages
110
-
111
- [Puck Pages](#) is a hosted page store built for Puck, providing version history and data migrations.
87
+ 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):
112
88
 
113
89
  ```sh
114
- npx @puckeditor/cli add pages
90
+ npx create-puck-app my-app
115
91
  ```
116
92
 
117
- Or [set it up manually](https://puckeditor.com/docs/…).
118
-
119
- ### Auth
93
+ Available recipes include:
120
94
 
121
- [Puck Auth](#) provides managed authentication for Puck, allowing users to sign-in with a Puck Cloud account.
122
-
123
- ```sh
124
- npx @puckeditor/cli add auth
125
- ```
126
-
127
- Or [set it up manually](https://puckeditor.com/docs/…).
128
-
129
- ### AI
130
-
131
- [Puck AI](https://puckeditor.com/docs/ai/overview) is an AI agent for Puck for generating interfaces directly from the editor.
132
-
133
- ```sh
134
- npx @puckeditor/cli add ai
135
- ```
136
-
137
- Or [set it up manually](https://puckeditor.com/docs/…).
95
+ - [**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 v7 app example, using dynamic routes to create pages at any level
138
97
 
139
98
  ## Community
140
99
 
@@ -145,6 +104,8 @@ Or [set it up manually](https://puckeditor.com/docs/…).
145
104
 
146
105
  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).
147
106
 
107
+ Or [book a discovery call](https://app.cal.com/chrisvxd/puck-enquiry/) for hands-on support and consultancy.
108
+
148
109
  ## License
149
110
 
150
111
  MIT © [The Puck Contributors](https://github.com/puckeditor/puck/graphs/contributors)
@@ -14507,21 +14507,6 @@ var Layout = ({ children }) => {
14507
14507
  );
14508
14508
  };
14509
14509
 
14510
- // lib/log-agent-message.ts
14511
- init_react_import();
14512
- var hasLogged = false;
14513
- var logAgentMessage = () => {
14514
- if (hasLogged || typeof window !== "undefined") return;
14515
- hasLogged = true;
14516
- import("@vercel/detect-agent").then(({ determineAgent }) => determineAgent()).then(({ isAgent }) => {
14517
- if (!isAgent) return;
14518
- console.log(
14519
- "[Puck] AI agent detected. Read the Puck README before working with Puck: node_modules/@puckeditor/core/README.md (https://github.com/puckeditor/puck#readme)"
14520
- );
14521
- }).catch(() => {
14522
- });
14523
- };
14524
-
14525
14510
  // components/Puck/index.tsx
14526
14511
  import { jsx as jsx73 } from "react/jsx-runtime";
14527
14512
  var propsContext = createContext10({});
@@ -14704,7 +14689,6 @@ function PuckProvider({ children }) {
14704
14689
  return /* @__PURE__ */ jsx73(appStoreContext.Provider, { value: appStore, children: /* @__PURE__ */ jsx73(UsePuckStoreContext.Provider, { value: uPuckStore, children }) });
14705
14690
  }
14706
14691
  function Puck(props) {
14707
- logAgentMessage();
14708
14692
  return /* @__PURE__ */ jsx73(PropsProvider, __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ jsx73(PuckProvider, __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ jsx73(Layout, { children: props.children }) })) }));
14709
14693
  }
14710
14694
  Puck.Components = Components;
package/dist/index.d.mts CHANGED
@@ -192,20 +192,6 @@ type PuckProps<UserConfig extends Config = Config, G extends UserGenerics<UserCo
192
192
  data: Partial<G["UserData"] | Data>;
193
193
  ui?: Partial<UiState>;
194
194
  onChange?: (data: G["UserData"]) => void;
195
- /**
196
- * Trigger a callback when the "Publish" button is pressed. Use it to store
197
- * the page, then render it with `<Render>`.
198
- *
199
- * You can store data to your own database, or use Puck Pages, a hosted
200
- * solution from Puck Cloud that provides built-in version history and
201
- * data migration:
202
- *
203
- * ```sh
204
- * npx @puckeditor/cli add pages
205
- * ```
206
- *
207
- * @see https://puckeditor.com/docs/api-reference/components/puck#onpublishdata
208
- */
209
195
  onPublish?: (data: G["UserData"]) => void;
210
196
  onAction?: OnAction<G["UserData"]>;
211
197
  permissions?: Partial<Permissions>;
package/dist/index.d.ts CHANGED
@@ -192,20 +192,6 @@ type PuckProps<UserConfig extends Config = Config, G extends UserGenerics<UserCo
192
192
  data: Partial<G["UserData"] | Data>;
193
193
  ui?: Partial<UiState>;
194
194
  onChange?: (data: G["UserData"]) => void;
195
- /**
196
- * Trigger a callback when the "Publish" button is pressed. Use it to store
197
- * the page, then render it with `<Render>`.
198
- *
199
- * You can store data to your own database, or use Puck Pages, a hosted
200
- * solution from Puck Cloud that provides built-in version history and
201
- * data migration:
202
- *
203
- * ```sh
204
- * npx @puckeditor/cli add pages
205
- * ```
206
- *
207
- * @see https://puckeditor.com/docs/api-reference/components/puck#onpublishdata
208
- */
209
195
  onPublish?: (data: G["UserData"]) => void;
210
196
  onAction?: OnAction<G["UserData"]>;
211
197
  permissions?: Partial<Permissions>;
package/dist/index.js CHANGED
@@ -20896,21 +20896,6 @@ var Layout = ({ children }) => {
20896
20896
  );
20897
20897
  };
20898
20898
 
20899
- // lib/log-agent-message.ts
20900
- init_react_import();
20901
- var hasLogged = false;
20902
- var logAgentMessage = () => {
20903
- if (hasLogged || typeof window !== "undefined") return;
20904
- hasLogged = true;
20905
- import("@vercel/detect-agent").then(({ determineAgent }) => determineAgent()).then(({ isAgent }) => {
20906
- if (!isAgent) return;
20907
- console.log(
20908
- "[Puck] AI agent detected. Read the Puck README before working with Puck: node_modules/@puckeditor/core/README.md (https://github.com/puckeditor/puck#readme)"
20909
- );
20910
- }).catch(() => {
20911
- });
20912
- };
20913
-
20914
20899
  // components/Puck/index.tsx
20915
20900
  var import_jsx_runtime111 = require("react/jsx-runtime");
20916
20901
  var propsContext = (0, import_react113.createContext)({});
@@ -21093,7 +21078,6 @@ function PuckProvider({ children }) {
21093
21078
  return /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(appStoreContext.Provider, { value: appStore, children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(UsePuckStoreContext.Provider, { value: uPuckStore, children }) });
21094
21079
  }
21095
21080
  function Puck(props) {
21096
- logAgentMessage();
21097
21081
  return /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(PropsProvider, __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(PuckProvider, __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(Layout, { children: props.children }) })) }));
21098
21082
  }
21099
21083
  Puck.Components = Components;
package/dist/index.mjs CHANGED
@@ -20,7 +20,7 @@ import {
20
20
  setDeep,
21
21
  useGetPuck,
22
22
  usePuck
23
- } from "./chunk-EYBEK5FH.mjs";
23
+ } from "./chunk-7CQJTM2E.mjs";
24
24
  import "./chunk-UIJZMSVU.mjs";
25
25
  import {
26
26
  migrate,
@@ -20896,21 +20896,6 @@ var Layout = ({ children }) => {
20896
20896
  );
20897
20897
  };
20898
20898
 
20899
- // lib/log-agent-message.ts
20900
- init_react_import();
20901
- var hasLogged = false;
20902
- var logAgentMessage = () => {
20903
- if (hasLogged || typeof window !== "undefined") return;
20904
- hasLogged = true;
20905
- import("@vercel/detect-agent").then(({ determineAgent }) => determineAgent()).then(({ isAgent }) => {
20906
- if (!isAgent) return;
20907
- console.log(
20908
- "[Puck] AI agent detected. Read the Puck README before working with Puck: node_modules/@puckeditor/core/README.md (https://github.com/puckeditor/puck#readme)"
20909
- );
20910
- }).catch(() => {
20911
- });
20912
- };
20913
-
20914
20899
  // components/Puck/index.tsx
20915
20900
  var import_jsx_runtime111 = require("react/jsx-runtime");
20916
20901
  var propsContext = (0, import_react113.createContext)({});
@@ -21093,7 +21078,6 @@ function PuckProvider({ children }) {
21093
21078
  return /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(appStoreContext.Provider, { value: appStore, children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(UsePuckStoreContext.Provider, { value: uPuckStore, children }) });
21094
21079
  }
21095
21080
  function Puck(props) {
21096
- logAgentMessage();
21097
21081
  return /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(PropsProvider, __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(PuckProvider, __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(Layout, { children: props.children }) })) }));
21098
21082
  }
21099
21083
  Puck.Components = Components;
@@ -20,7 +20,7 @@ import {
20
20
  setDeep,
21
21
  useGetPuck,
22
22
  usePuck
23
- } from "./chunk-EYBEK5FH.mjs";
23
+ } from "./chunk-7CQJTM2E.mjs";
24
24
  import "./chunk-UIJZMSVU.mjs";
25
25
  import {
26
26
  migrate,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@puckeditor/core",
3
- "version": "0.24.1-canary.d9f7158f",
3
+ "version": "0.24.1-canary.eef68a2e",
4
4
  "description": "The open-source visual editor for React",
5
5
  "author": "Chris Villa <chris@puckeditor.com>",
6
6
  "repository": {
@@ -30,9 +30,6 @@
30
30
  "private": false,
31
31
  "main": "./dist/index.js",
32
32
  "types": "./dist/index.d.ts",
33
- "browser": {
34
- "@vercel/detect-agent": false
35
- },
36
33
  "exports": {
37
34
  ".": {
38
35
  "react-server": {
@@ -134,7 +131,6 @@
134
131
  "@tiptap/html": "^3.30.4",
135
132
  "@tiptap/pm": "^3.30.4",
136
133
  "@tiptap/react": "^3.30.4",
137
- "@vercel/detect-agent": "^1.2.7",
138
134
  "deep-diff": "^1.0.2",
139
135
  "fast-equals": "5.2.2",
140
136
  "flat": "^5.0.2",