@measured/puck 0.21.0-canary.af48a401 → 0.21.0-canary.b353d921

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.
Files changed (40) hide show
  1. package/dist/Editor-F2LSS6SE.css +403 -0
  2. package/dist/Editor-N46HUQEC.mjs +201 -0
  3. package/dist/Render-QEMDIDQC.css +101 -0
  4. package/dist/Render-Y567PGZ7.mjs +53 -0
  5. package/dist/chunk-3QHWXJEI.mjs +33 -0
  6. package/dist/chunk-7KY6RHEY.mjs +2230 -0
  7. package/dist/chunk-C2TVYIYC.mjs +415 -0
  8. package/dist/chunk-DCSQEDMK.mjs +194 -0
  9. package/dist/{chunk-JA7SEUEH.mjs → chunk-DJSH5REF.mjs} +70 -499
  10. package/dist/chunk-DNF2EMM4.mjs +63 -0
  11. package/dist/chunk-FNWOH4R6.mjs +109 -0
  12. package/dist/chunk-GQKMOYLG.mjs +53 -0
  13. package/dist/chunk-K3V4LVUL.mjs +704 -0
  14. package/dist/chunk-R6CVX2IY.mjs +103 -0
  15. package/dist/{chunk-UABEUL66.mjs → chunk-TB3SSIAY.mjs} +958 -2722
  16. package/dist/chunk-WUWXFMEM.mjs +11 -0
  17. package/dist/full-2GJTAAZE.css +301 -0
  18. package/dist/full-NLUNPJWS.mjs +90 -0
  19. package/dist/index.css +278 -22
  20. package/dist/index.d.mts +98 -7
  21. package/dist/index.d.ts +98 -7
  22. package/dist/index.js +5737 -2502
  23. package/dist/index.mjs +25 -9
  24. package/dist/loaded-EV34KGYJ.mjs +57 -0
  25. package/dist/loaded-HMSPJUZM.mjs +54 -0
  26. package/dist/loaded-RVWBFK7L.css +87 -0
  27. package/dist/loaded-ZXOU6S6R.mjs +54 -0
  28. package/dist/no-external.css +278 -22
  29. package/dist/no-external.d.mts +17 -2
  30. package/dist/no-external.d.ts +17 -2
  31. package/dist/no-external.js +5737 -2502
  32. package/dist/no-external.mjs +25 -9
  33. package/dist/rsc.css +101 -0
  34. package/dist/rsc.d.mts +17 -2
  35. package/dist/rsc.d.ts +17 -2
  36. package/dist/rsc.js +407 -21
  37. package/dist/rsc.mjs +16 -9
  38. package/dist/{walk-tree-CgWnYC1X.d.mts → walk-tree-Ja9bNCM9.d.mts} +202 -3
  39. package/dist/{walk-tree-CgWnYC1X.d.ts → walk-tree-Ja9bNCM9.d.ts} +202 -3
  40. package/package.json +23 -1
@@ -0,0 +1,109 @@
1
+ import {
2
+ styles_module_default
3
+ } from "./chunk-WUWXFMEM.mjs";
4
+ import {
5
+ LoadedRichTextMenuInner
6
+ } from "./chunk-K3V4LVUL.mjs";
7
+ import {
8
+ useAppStore,
9
+ useAppStoreApi
10
+ } from "./chunk-7KY6RHEY.mjs";
11
+ import {
12
+ __spreadValues,
13
+ get_class_name_factory_default,
14
+ init_react_import
15
+ } from "./chunk-DCSQEDMK.mjs";
16
+
17
+ // components/RichTextEditor/components/EditorInner.tsx
18
+ init_react_import();
19
+ import {
20
+ memo,
21
+ useCallback
22
+ } from "react";
23
+ import { jsx, jsxs } from "react/jsx-runtime";
24
+ var getClassName = get_class_name_factory_default("RichTextEditor", styles_module_default);
25
+ var EditorInner = memo(
26
+ ({
27
+ children,
28
+ menu,
29
+ readOnly = false,
30
+ field,
31
+ inline = false,
32
+ editor,
33
+ id
34
+ }) => {
35
+ const { initialHeight } = field;
36
+ const isActive = useAppStore(
37
+ (s) => {
38
+ var _a;
39
+ return ((_a = s.currentRichText) == null ? void 0 : _a.id) === id && inline === s.currentRichText.inline;
40
+ }
41
+ );
42
+ const appStoreApi = useAppStoreApi();
43
+ const handleHotkeyCapture = useCallback(
44
+ (event) => {
45
+ var _a, _b;
46
+ if ((event.metaKey || event.ctrlKey) && event.key.toLowerCase() === "i") {
47
+ event.stopPropagation();
48
+ event.preventDefault();
49
+ (_b = editor == null ? void 0 : (_a = editor.commands).toggleItalic) == null ? void 0 : _b.call(_a);
50
+ }
51
+ },
52
+ [editor]
53
+ );
54
+ const handleBlur = useCallback(
55
+ (e) => {
56
+ var _a, _b;
57
+ const targetInMenu = !!((_b = (_a = e.relatedTarget) == null ? void 0 : _a.closest) == null ? void 0 : _b.call(
58
+ _a,
59
+ "[data-puck-rte-menu]"
60
+ ));
61
+ if (e.relatedTarget && !targetInMenu) {
62
+ appStoreApi.setState({
63
+ currentRichText: null
64
+ });
65
+ } else {
66
+ e.stopPropagation();
67
+ }
68
+ },
69
+ [appStoreApi]
70
+ );
71
+ return /* @__PURE__ */ jsxs(
72
+ "div",
73
+ {
74
+ className: getClassName({
75
+ editor: !inline,
76
+ inline,
77
+ isActive,
78
+ disabled: readOnly
79
+ }),
80
+ style: inline ? {} : { height: initialHeight != null ? initialHeight : 192, overflowY: "auto" },
81
+ onKeyDownCapture: handleHotkeyCapture,
82
+ onBlur: handleBlur,
83
+ children: [
84
+ !inline && /* @__PURE__ */ jsx("div", { className: getClassName("menu"), children: menu }),
85
+ children
86
+ ]
87
+ }
88
+ );
89
+ }
90
+ );
91
+ EditorInner.displayName = "EditorInner";
92
+
93
+ // components/RichTextMenu/index.tsx
94
+ init_react_import();
95
+ import { lazy, Suspense } from "react";
96
+ import { jsx as jsx2 } from "react/jsx-runtime";
97
+ var LoadedRichTextMenuFull = lazy(
98
+ () => import("./full-NLUNPJWS.mjs").then((m) => ({
99
+ default: m.LoadedRichTextMenuFull
100
+ }))
101
+ );
102
+ var LoadedRichTextMenu = (props) => {
103
+ return /* @__PURE__ */ jsx2(Suspense, { fallback: /* @__PURE__ */ jsx2(LoadedRichTextMenuInner, __spreadValues({}, props)), children: /* @__PURE__ */ jsx2(LoadedRichTextMenuFull, __spreadValues({}, props)) });
104
+ };
105
+
106
+ export {
107
+ EditorInner,
108
+ LoadedRichTextMenu
109
+ };
@@ -0,0 +1,53 @@
1
+ import {
2
+ AlignCenter,
3
+ AlignJustify,
4
+ AlignLeft,
5
+ AlignRight
6
+ } from "./chunk-7KY6RHEY.mjs";
7
+ import {
8
+ init_react_import
9
+ } from "./chunk-DCSQEDMK.mjs";
10
+
11
+ // components/RichTextMenu/controls/AlignSelect/use-options.ts
12
+ init_react_import();
13
+ import { useMemo } from "react";
14
+ var optionNodes = {
15
+ left: { label: "Left", icon: AlignLeft },
16
+ center: { label: "Center", icon: AlignCenter },
17
+ right: { label: "Right", icon: AlignRight },
18
+ justify: { label: "Justify", icon: AlignJustify }
19
+ };
20
+ var useAlignOptions = (fieldOptions) => {
21
+ var _a;
22
+ let blockOptions = [];
23
+ if ((fieldOptions == null ? void 0 : fieldOptions.textAlign) !== false) {
24
+ if (!((_a = fieldOptions == null ? void 0 : fieldOptions.textAlign) == null ? void 0 : _a.alignments)) {
25
+ blockOptions = ["left", "center", "right", "justify"];
26
+ } else {
27
+ if (fieldOptions == null ? void 0 : fieldOptions.textAlign.alignments.includes("left")) {
28
+ blockOptions.push("left");
29
+ }
30
+ if (fieldOptions == null ? void 0 : fieldOptions.textAlign.alignments.includes("center")) {
31
+ blockOptions.push("center");
32
+ }
33
+ if (fieldOptions == null ? void 0 : fieldOptions.textAlign.alignments.includes("right")) {
34
+ blockOptions.push("right");
35
+ }
36
+ if (fieldOptions == null ? void 0 : fieldOptions.textAlign.alignments.includes("justify")) {
37
+ blockOptions.push("justify");
38
+ }
39
+ }
40
+ }
41
+ return useMemo(
42
+ () => blockOptions.map((item) => ({
43
+ value: item,
44
+ label: optionNodes[item].label,
45
+ icon: optionNodes[item].icon
46
+ })),
47
+ [blockOptions]
48
+ );
49
+ };
50
+
51
+ export {
52
+ useAlignOptions
53
+ };