@puckeditor/core 0.24.1-canary.f0a3f91c → 0.24.1

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/CHANGELOG.md CHANGED
@@ -2,6 +2,24 @@
2
2
 
3
3
  <!--__CHANGELOG_ENTRY__-->
4
4
 
5
+ ## [0.24.1](https://github.com/puckeditor/puck/compare/v0.24.0...v0.24.1) (2026-11-18)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * allow developers to add new field types via modules ([81566a7](https://github.com/puckeditor/puck/commit/81566a77c87e307ce7d015b0d9089ba928360edc))
11
+ * clean up resize handle listeners on unmount ([caa28d2](https://github.com/puckeditor/puck/commit/caa28d2bafe0b028348d041efe552fa92be972dc))
12
+ * don't crash richtext editor when revealed inside <Activity> ([2978ed6](https://github.com/puckeditor/puck/commit/2978ed6a1e1eeffd379f3e491835aa33184e47ef))
13
+ * hide sidebar resize handle when sidebar is not visible ([7fabe52](https://github.com/puckeditor/puck/commit/7fabe52bc8e07892fa234182b08ce1452cb8687a))
14
+ * respect user-defined Dictionary type extensions ([609983d](https://github.com/puckeditor/puck/commit/609983dba9293aa63bef2921a9b20759ff1a758e))
15
+ * show headings in heading-analyzer on first load ([d05542f](https://github.com/puckeditor/puck/commit/d05542f4ddc3ade0275860cb91756dadd7ea791a))
16
+
17
+ ### Experimental
18
+
19
+ * add agent-friendly Puck CLI to @puckeditor/core bin
20
+
21
+
22
+
5
23
  ## [0.24.0](https://github.com/measuredco/puck/compare/v0.23.0...v0.24.0) (2026-10-29)
6
24
 
7
25
 
package/CLAUDE.md ADDED
@@ -0,0 +1,5 @@
1
+ # @puckeditor/core
2
+
3
+ This is NOT the Puck you know. You MUST read the Puck README before working with Puck: node_modules/@puckeditor/core/README.md
4
+
5
+ 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) • [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)
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 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.
26
+ Puck is an open-source visual editor for React. Build drag-and-drop interfaces with your own components.
27
27
 
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.
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 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.
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 start
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 # or npx create-puck-app my-app
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 the data to your database
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
- ## Recipes
85
+ ### 4. Choose a backend (optional)
86
86
 
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):
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 create-puck-app my-app
96
+ npx @puckeditor/core init
91
97
  ```
92
98
 
93
- Available recipes include:
99
+ ### Pages
94
100
 
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
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,5 @@
1
+ # @puckeditor/core
2
+
3
+ This is NOT the Puck you know. You MUST read the Puck README before working with Puck: node_modules/@puckeditor/core/README.md
4
+
5
+ Read the Puck CHANGELOG for updates: node_modules/@puckeditor/core/CHANGELOG.md
package/dist/CLAUDE.md ADDED
@@ -0,0 +1,5 @@
1
+ # @puckeditor/core
2
+
3
+ This is NOT the Puck you know. You MUST read the Puck README before working with Puck: node_modules/@puckeditor/core/README.md
4
+
5
+ Read the Puck CHANGELOG for updates: node_modules/@puckeditor/core/CHANGELOG.md
@@ -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-3GJJSXCL.mjs";
14
+ } from "./chunk-6J54T4F5.mjs";
14
15
  import {
15
16
  LoadedRichTextMenuInner
16
17
  } from "./chunk-5L3MP6BU.mjs";
@@ -13984,7 +13985,7 @@ init_react_import();
13984
13985
 
13985
13986
  // components/Puck/components/ResizeHandle/index.tsx
13986
13987
  init_react_import();
13987
- import { useCallback as useCallback29, useRef as useRef19 } from "react";
13988
+ import { useCallback as useCallback29, useEffect as useEffect32, useRef as useRef19 } from "react";
13988
13989
 
13989
13990
  // css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/ResizeHandle/styles.module.css#css-module
13990
13991
  init_react_import();
@@ -14005,6 +14006,7 @@ var ResizeHandle = ({
14005
14006
  const isDragging = useRef19(false);
14006
14007
  const startX = useRef19(0);
14007
14008
  const startWidth = useRef19(0);
14009
+ const endDrag = useRef19(null);
14008
14010
  const handleMouseMove = useCallback29(
14009
14011
  (e) => {
14010
14012
  if (!isDragging.current) return;
@@ -14017,18 +14019,10 @@ var ResizeHandle = ({
14017
14019
  [onResize, position]
14018
14020
  );
14019
14021
  const handleMouseUp = useCallback29(() => {
14020
- var _a;
14022
+ var _a, _b;
14021
14023
  if (!isDragging.current) return;
14022
- isDragging.current = false;
14023
- document.body.style.cursor = "";
14024
- document.body.style.userSelect = "";
14025
- const overlay = document.getElementById("resize-overlay");
14026
- if (overlay) {
14027
- document.body.removeChild(overlay);
14028
- }
14029
- document.removeEventListener("mousemove", handleMouseMove);
14030
- document.removeEventListener("mouseup", handleMouseUp);
14031
- const finalWidth = ((_a = sidebarRef.current) == null ? void 0 : _a.getBoundingClientRect().width) || 0;
14024
+ (_a = endDrag.current) == null ? void 0 : _a.call(endDrag);
14025
+ const finalWidth = ((_b = sidebarRef.current) == null ? void 0 : _b.getBoundingClientRect().width) || 0;
14032
14026
  onResizeEnd(finalWidth);
14033
14027
  resetAutoZoom();
14034
14028
  }, [onResizeEnd]);
@@ -14046,10 +14040,23 @@ var ResizeHandle = ({
14046
14040
  document.body.appendChild(overlay);
14047
14041
  document.addEventListener("mousemove", handleMouseMove);
14048
14042
  document.addEventListener("mouseup", handleMouseUp);
14043
+ endDrag.current = () => {
14044
+ isDragging.current = false;
14045
+ document.body.style.cursor = "";
14046
+ document.body.style.userSelect = "";
14047
+ overlay.remove();
14048
+ document.removeEventListener("mousemove", handleMouseMove);
14049
+ document.removeEventListener("mouseup", handleMouseUp);
14050
+ endDrag.current = null;
14051
+ };
14049
14052
  e.preventDefault();
14050
14053
  },
14051
14054
  [position, handleMouseMove, handleMouseUp]
14052
14055
  );
14056
+ useEffect32(() => () => {
14057
+ var _a;
14058
+ return (_a = endDrag.current) == null ? void 0 : _a.call(endDrag);
14059
+ }, []);
14053
14060
  return /* @__PURE__ */ jsx69(
14054
14061
  "div",
14055
14062
  {
@@ -14084,7 +14091,7 @@ var Sidebar = ({
14084
14091
  children
14085
14092
  }
14086
14093
  ),
14087
- /* @__PURE__ */ jsx70("div", { className: `${getClassName44("resizeHandle")}`, children: /* @__PURE__ */ jsx70(
14094
+ isVisible && /* @__PURE__ */ jsx70("div", { className: `${getClassName44("resizeHandle")}`, children: /* @__PURE__ */ jsx70(
14088
14095
  ResizeHandle,
14089
14096
  {
14090
14097
  position,
@@ -14760,6 +14767,9 @@ init_react_import();
14760
14767
  // types/Utils.tsx
14761
14768
  init_react_import();
14762
14769
 
14770
+ // bundle/core.ts
14771
+ logAgentMessage();
14772
+
14763
14773
  export {
14764
14774
  overrideKeys,
14765
14775
  setDeep,
package/dist/index.js CHANGED
@@ -6042,6 +6042,21 @@ init_react_import();
6042
6042
  // bundle/core.ts
6043
6043
  init_react_import();
6044
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
+
6045
6060
  // types/API/index.ts
6046
6061
  init_react_import();
6047
6062
 
@@ -20306,6 +20321,7 @@ var ResizeHandle = ({
20306
20321
  const isDragging = (0, import_react110.useRef)(false);
20307
20322
  const startX = (0, import_react110.useRef)(0);
20308
20323
  const startWidth = (0, import_react110.useRef)(0);
20324
+ const endDrag = (0, import_react110.useRef)(null);
20309
20325
  const handleMouseMove = (0, import_react110.useCallback)(
20310
20326
  (e) => {
20311
20327
  if (!isDragging.current) return;
@@ -20318,18 +20334,10 @@ var ResizeHandle = ({
20318
20334
  [onResize, position]
20319
20335
  );
20320
20336
  const handleMouseUp = (0, import_react110.useCallback)(() => {
20321
- var _a;
20337
+ var _a, _b;
20322
20338
  if (!isDragging.current) return;
20323
- isDragging.current = false;
20324
- document.body.style.cursor = "";
20325
- document.body.style.userSelect = "";
20326
- const overlay = document.getElementById("resize-overlay");
20327
- if (overlay) {
20328
- document.body.removeChild(overlay);
20329
- }
20330
- document.removeEventListener("mousemove", handleMouseMove);
20331
- document.removeEventListener("mouseup", handleMouseUp);
20332
- const finalWidth = ((_a = sidebarRef.current) == null ? void 0 : _a.getBoundingClientRect().width) || 0;
20339
+ (_a = endDrag.current) == null ? void 0 : _a.call(endDrag);
20340
+ const finalWidth = ((_b = sidebarRef.current) == null ? void 0 : _b.getBoundingClientRect().width) || 0;
20333
20341
  onResizeEnd(finalWidth);
20334
20342
  resetAutoZoom();
20335
20343
  }, [onResizeEnd]);
@@ -20347,10 +20355,23 @@ var ResizeHandle = ({
20347
20355
  document.body.appendChild(overlay);
20348
20356
  document.addEventListener("mousemove", handleMouseMove);
20349
20357
  document.addEventListener("mouseup", handleMouseUp);
20358
+ endDrag.current = () => {
20359
+ isDragging.current = false;
20360
+ document.body.style.cursor = "";
20361
+ document.body.style.userSelect = "";
20362
+ overlay.remove();
20363
+ document.removeEventListener("mousemove", handleMouseMove);
20364
+ document.removeEventListener("mouseup", handleMouseUp);
20365
+ endDrag.current = null;
20366
+ };
20350
20367
  e.preventDefault();
20351
20368
  },
20352
20369
  [position, handleMouseMove, handleMouseUp]
20353
20370
  );
20371
+ (0, import_react110.useEffect)(() => () => {
20372
+ var _a;
20373
+ return (_a = endDrag.current) == null ? void 0 : _a.call(endDrag);
20374
+ }, []);
20354
20375
  return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
20355
20376
  "div",
20356
20377
  {
@@ -20388,7 +20409,7 @@ var Sidebar = ({
20388
20409
  children
20389
20410
  }
20390
20411
  ),
20391
- /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { className: `${getClassName50("resizeHandle")}`, children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
20412
+ isVisible && /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { className: `${getClassName50("resizeHandle")}`, children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
20392
20413
  ResizeHandle,
20393
20414
  {
20394
20415
  position,
@@ -21365,6 +21386,9 @@ var legacySideBarPlugin = (props = {}) => ({
21365
21386
  }
21366
21387
  )
21367
21388
  });
21389
+
21390
+ // bundle/core.ts
21391
+ logAgentMessage();
21368
21392
  // Annotate the CommonJS export names for ESM import in node:
21369
21393
  0 && (module.exports = {
21370
21394
  Action,
package/dist/index.mjs CHANGED
@@ -20,13 +20,13 @@ import {
20
20
  setDeep,
21
21
  useGetPuck,
22
22
  usePuck
23
- } from "./chunk-7CQJTM2E.mjs";
23
+ } from "./chunk-T2XFCN6B.mjs";
24
24
  import "./chunk-UIJZMSVU.mjs";
25
25
  import {
26
26
  migrate,
27
27
  resolveAllData,
28
28
  transformProps
29
- } from "./chunk-3GJJSXCL.mjs";
29
+ } from "./chunk-6J54T4F5.mjs";
30
30
  import "./chunk-H635BA2V.mjs";
31
31
  import {
32
32
  RichTextMenu
@@ -6042,6 +6042,21 @@ init_react_import();
6042
6042
  // bundle/core.ts
6043
6043
  init_react_import();
6044
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
+
6045
6060
  // types/API/index.ts
6046
6061
  init_react_import();
6047
6062
 
@@ -20306,6 +20321,7 @@ var ResizeHandle = ({
20306
20321
  const isDragging = (0, import_react110.useRef)(false);
20307
20322
  const startX = (0, import_react110.useRef)(0);
20308
20323
  const startWidth = (0, import_react110.useRef)(0);
20324
+ const endDrag = (0, import_react110.useRef)(null);
20309
20325
  const handleMouseMove = (0, import_react110.useCallback)(
20310
20326
  (e) => {
20311
20327
  if (!isDragging.current) return;
@@ -20318,18 +20334,10 @@ var ResizeHandle = ({
20318
20334
  [onResize, position]
20319
20335
  );
20320
20336
  const handleMouseUp = (0, import_react110.useCallback)(() => {
20321
- var _a;
20337
+ var _a, _b;
20322
20338
  if (!isDragging.current) return;
20323
- isDragging.current = false;
20324
- document.body.style.cursor = "";
20325
- document.body.style.userSelect = "";
20326
- const overlay = document.getElementById("resize-overlay");
20327
- if (overlay) {
20328
- document.body.removeChild(overlay);
20329
- }
20330
- document.removeEventListener("mousemove", handleMouseMove);
20331
- document.removeEventListener("mouseup", handleMouseUp);
20332
- const finalWidth = ((_a = sidebarRef.current) == null ? void 0 : _a.getBoundingClientRect().width) || 0;
20339
+ (_a = endDrag.current) == null ? void 0 : _a.call(endDrag);
20340
+ const finalWidth = ((_b = sidebarRef.current) == null ? void 0 : _b.getBoundingClientRect().width) || 0;
20333
20341
  onResizeEnd(finalWidth);
20334
20342
  resetAutoZoom();
20335
20343
  }, [onResizeEnd]);
@@ -20347,10 +20355,23 @@ var ResizeHandle = ({
20347
20355
  document.body.appendChild(overlay);
20348
20356
  document.addEventListener("mousemove", handleMouseMove);
20349
20357
  document.addEventListener("mouseup", handleMouseUp);
20358
+ endDrag.current = () => {
20359
+ isDragging.current = false;
20360
+ document.body.style.cursor = "";
20361
+ document.body.style.userSelect = "";
20362
+ overlay.remove();
20363
+ document.removeEventListener("mousemove", handleMouseMove);
20364
+ document.removeEventListener("mouseup", handleMouseUp);
20365
+ endDrag.current = null;
20366
+ };
20350
20367
  e.preventDefault();
20351
20368
  },
20352
20369
  [position, handleMouseMove, handleMouseUp]
20353
20370
  );
20371
+ (0, import_react110.useEffect)(() => () => {
20372
+ var _a;
20373
+ return (_a = endDrag.current) == null ? void 0 : _a.call(endDrag);
20374
+ }, []);
20354
20375
  return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
20355
20376
  "div",
20356
20377
  {
@@ -20388,7 +20409,7 @@ var Sidebar = ({
20388
20409
  children
20389
20410
  }
20390
20411
  ),
20391
- /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { className: `${getClassName50("resizeHandle")}`, children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
20412
+ isVisible && /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { className: `${getClassName50("resizeHandle")}`, children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
20392
20413
  ResizeHandle,
20393
20414
  {
20394
20415
  position,
@@ -21365,6 +21386,9 @@ var legacySideBarPlugin = (props = {}) => ({
21365
21386
  }
21366
21387
  )
21367
21388
  });
21389
+
21390
+ // bundle/core.ts
21391
+ logAgentMessage();
21368
21392
  // Annotate the CommonJS export names for ESM import in node:
21369
21393
  0 && (module.exports = {
21370
21394
  Action,
@@ -20,13 +20,13 @@ import {
20
20
  setDeep,
21
21
  useGetPuck,
22
22
  usePuck
23
- } from "./chunk-7CQJTM2E.mjs";
23
+ } from "./chunk-T2XFCN6B.mjs";
24
24
  import "./chunk-UIJZMSVU.mjs";
25
25
  import {
26
26
  migrate,
27
27
  resolveAllData,
28
28
  transformProps
29
- } from "./chunk-3GJJSXCL.mjs";
29
+ } from "./chunk-6J54T4F5.mjs";
30
30
  import "./chunk-H635BA2V.mjs";
31
31
  import {
32
32
  RichTextMenu
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-3GJJSXCL.mjs";
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,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@puckeditor/core",
3
- "version": "0.24.1-canary.f0a3f91c",
3
+ "version": "0.24.1",
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,8 +76,10 @@
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",
@@ -108,6 +116,7 @@
108
116
  "@dnd-kit/helpers": "0.4.0",
109
117
  "@dnd-kit/react": "0.4.0",
110
118
  "@dnd-kit/state": "0.4.0",
119
+ "@puckeditor/cli": "latest",
111
120
  "@radix-ui/react-popover": "^1.1.15",
112
121
  "@tanstack/react-virtual": "^3.13.9",
113
122
  "@tiptap/core": "^3.30.4",
@@ -130,6 +139,7 @@
130
139
  "@tiptap/html": "^3.30.4",
131
140
  "@tiptap/pm": "^3.30.4",
132
141
  "@tiptap/react": "^3.30.4",
142
+ "@vercel/detect-agent": "^1.2.7",
133
143
  "fast-equals": "5.2.2",
134
144
  "flat": "^5.0.2",
135
145
  "happy-dom": "^21.0.4",
@@ -143,7 +153,7 @@
143
153
  },
144
154
  "scripts": {
145
155
  "lint": "eslint \"**/*.ts*\"",
146
- "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",
147
157
  "test": "jest"
148
158
  }
149
159
  }