@puckeditor/core 0.21.0-canary.08cd0aca

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 (52) hide show
  1. package/README.md +114 -0
  2. package/dist/Editor-IQP25PUX.css +404 -0
  3. package/dist/Editor-L7XD2QW3.mjs +204 -0
  4. package/dist/Render-3OV4N4MT.css +102 -0
  5. package/dist/Render-FXZX6NFH.mjs +55 -0
  6. package/dist/actions-BkBoKAc5.d.mts +838 -0
  7. package/dist/actions-BkBoKAc5.d.ts +838 -0
  8. package/dist/chunk-7TZD3NRP.mjs +450 -0
  9. package/dist/chunk-AHX7X7NZ.mjs +156 -0
  10. package/dist/chunk-AOEDIUVK.mjs +11 -0
  11. package/dist/chunk-GLWC4QRX.mjs +8074 -0
  12. package/dist/chunk-HLB66X4S.mjs +1813 -0
  13. package/dist/chunk-M6W7YEVX.mjs +95 -0
  14. package/dist/chunk-MNNPATDB.mjs +63 -0
  15. package/dist/chunk-QIJR53IK.mjs +528 -0
  16. package/dist/chunk-RYILZVCB.mjs +708 -0
  17. package/dist/chunk-UFXHMVJE.mjs +53 -0
  18. package/dist/chunk-V5I7CVLT.mjs +103 -0
  19. package/dist/chunk-WB2EIKOA.mjs +445 -0
  20. package/dist/chunk-Y2EFNT5P.mjs +108 -0
  21. package/dist/chunk-YBJ32VYI.mjs +33 -0
  22. package/dist/chunk-ZPR7EC3T.mjs +111 -0
  23. package/dist/full-2GJTAAZE.css +301 -0
  24. package/dist/full-4UGAOTTB.mjs +93 -0
  25. package/dist/index-bqD1SEOb.d.mts +118 -0
  26. package/dist/index-lt1zf5WR.d.ts +118 -0
  27. package/dist/index.css +2629 -0
  28. package/dist/index.d.mts +309 -0
  29. package/dist/index.d.ts +309 -0
  30. package/dist/index.js +14191 -0
  31. package/dist/index.mjs +78 -0
  32. package/dist/internal.d.mts +27 -0
  33. package/dist/internal.d.ts +27 -0
  34. package/dist/internal.js +926 -0
  35. package/dist/internal.mjs +13 -0
  36. package/dist/loaded-5AM4V5PV.mjs +57 -0
  37. package/dist/loaded-G2WSQZO7.mjs +57 -0
  38. package/dist/loaded-MYALJBRK.mjs +60 -0
  39. package/dist/loaded-RVWBFK7L.css +87 -0
  40. package/dist/no-external.css +2631 -0
  41. package/dist/no-external.d.mts +21 -0
  42. package/dist/no-external.d.ts +21 -0
  43. package/dist/no-external.js +14194 -0
  44. package/dist/no-external.mjs +83 -0
  45. package/dist/rsc.css +102 -0
  46. package/dist/rsc.d.mts +27 -0
  47. package/dist/rsc.d.ts +27 -0
  48. package/dist/rsc.js +1444 -0
  49. package/dist/rsc.mjs +130 -0
  50. package/dist/walk-tree-CRRDqx6_.d.mts +29 -0
  51. package/dist/walk-tree-CS7sEpfG.d.ts +29 -0
  52. package/package.json +137 -0
@@ -0,0 +1,102 @@
1
+ /* css-module:/home/runner/work/puck/puck/packages/core/components/RichTextEditor/styles.module.css/#css-module-data */
2
+ ._RichTextEditor_z25h4_1 .ProseMirror {
3
+ white-space: pre-wrap;
4
+ word-wrap: break-word;
5
+ cursor: text;
6
+ outline: none;
7
+ position: relative;
8
+ }
9
+ ._RichTextEditor_z25h4_1 .rich-text * {
10
+ white-space: pre-wrap;
11
+ user-select: auto;
12
+ -webkit-user-select: auto;
13
+ }
14
+ ._RichTextEditor_z25h4_1 .rich-text blockquote {
15
+ margin: 1em 0;
16
+ padding: 0 1em;
17
+ border-left: 4px solid var(--puck-color-grey-09);
18
+ }
19
+ ._RichTextEditor_z25h4_1 .rich-text code {
20
+ background-color: var(--puck-color-grey-11);
21
+ padding: 4px 8px;
22
+ border-radius: 4px;
23
+ }
24
+ ._RichTextEditor_z25h4_1 .rich-text p:empty::before {
25
+ content: "\a0";
26
+ }
27
+ ._RichTextEditor_z25h4_1 .rich-text pre code {
28
+ display: block;
29
+ padding: 8px 12px;
30
+ }
31
+ ._RichTextEditor_z25h4_1 .rich-text > *:first-child,
32
+ ._RichTextEditor_z25h4_1 .ProseMirror > *:first-child,
33
+ ._RichTextEditor_z25h4_1 .rich-text * p:first-of-type {
34
+ margin-top: 0;
35
+ }
36
+ ._RichTextEditor_z25h4_1 .rich-text > *:last-child,
37
+ ._RichTextEditor_z25h4_1 .ProseMirror > *:last-child,
38
+ ._RichTextEditor_z25h4_1 .rich-text * p:last-of-type {
39
+ margin-bottom: 0;
40
+ }
41
+ ._RichTextEditor--editor_z25h4_50 {
42
+ background: var(--puck-color-white);
43
+ border-width: 1px;
44
+ border-style: solid;
45
+ border-color: var(--puck-color-grey-09);
46
+ border-radius: 4px;
47
+ box-sizing: border-box;
48
+ display: flex;
49
+ flex-direction: column;
50
+ font-family: inherit;
51
+ font-size: var(--puck-font-size-xxs);
52
+ resize: vertical;
53
+ text-align: initial;
54
+ transition: border-color 50ms ease-in;
55
+ width: 100%;
56
+ max-width: 100%;
57
+ min-height: 128px;
58
+ }
59
+ ._RichTextEditor--editor_z25h4_50 .rich-text {
60
+ flex-grow: 1;
61
+ }
62
+ ._RichTextEditor--editor_z25h4_50 .rich-text:not(:has(.ProseMirror)),
63
+ ._RichTextEditor--editor_z25h4_50 .rich-text .ProseMirror {
64
+ height: 100%;
65
+ padding: 12px 15px;
66
+ }
67
+ ._RichTextEditor--editor_z25h4_50 .rich-text ul,
68
+ ._RichTextEditor--editor_z25h4_50 .rich-text ol {
69
+ padding-left: 24px;
70
+ }
71
+ ._RichTextEditor--editor_z25h4_50 .rich-text li {
72
+ line-height: 1.5;
73
+ }
74
+ ._RichTextEditor--editor_z25h4_50 .rich-text p {
75
+ margin-block: 12px;
76
+ }
77
+ ._RichTextEditor--editor_z25h4_50 .rich-text ul {
78
+ list-style: disc;
79
+ }
80
+ ._RichTextEditor--editor_z25h4_50 .rich-text ol {
81
+ list-style: decimal;
82
+ }
83
+ ._RichTextEditor--editor_z25h4_50:focus-within {
84
+ border-color: var(--puck-color-grey-05);
85
+ outline: 2px solid var(--puck-color-azure-05);
86
+ transition: none;
87
+ }
88
+ ._RichTextEditor--editor_z25h4_50._RichTextEditor--disabled_z25h4_107 {
89
+ background: var(--puck-color-grey-11);
90
+ }
91
+ ._RichTextEditor_z25h4_1:not(:focus-within):not(._RichTextEditor--isActive_z25h4_111) .ProseMirror ::selection {
92
+ background-color: transparent;
93
+ }
94
+ ._RichTextEditor-menu_z25h4_117 {
95
+ border-bottom: 1px solid var(--puck-color-grey-10);
96
+ position: sticky;
97
+ top: 0;
98
+ z-index: 1;
99
+ }
100
+ ._RichTextEditor--disabled_z25h4_107 ._RichTextEditor-menu_z25h4_117 {
101
+ border-bottom: 1px solid var(--puck-color-grey-09);
102
+ }
@@ -0,0 +1,55 @@
1
+ import {
2
+ PuckRichText
3
+ } from "./chunk-V5I7CVLT.mjs";
4
+ import {
5
+ styles_module_default
6
+ } from "./chunk-AOEDIUVK.mjs";
7
+ import {
8
+ get_class_name_factory_default
9
+ } from "./chunk-Y2EFNT5P.mjs";
10
+ import {
11
+ init_react_import
12
+ } from "./chunk-M6W7YEVX.mjs";
13
+
14
+ // components/RichTextEditor/components/Render.tsx
15
+ init_react_import();
16
+ import { generateHTML, generateJSON } from "@tiptap/html";
17
+ import { useMemo } from "react";
18
+ import { jsx } from "react/jsx-runtime";
19
+ var getClassName = get_class_name_factory_default("RichTextEditor", styles_module_default);
20
+ function RichTextRender({
21
+ content,
22
+ field
23
+ }) {
24
+ const { tiptap = {}, options } = field;
25
+ const { extensions = [] } = tiptap;
26
+ const loadedExtensions = useMemo(
27
+ () => [PuckRichText.configure(options), ...extensions],
28
+ [field, extensions]
29
+ );
30
+ const normalized = useMemo(() => {
31
+ if (typeof content === "object" && (content == null ? void 0 : content.type) === "doc") {
32
+ return content;
33
+ }
34
+ if (typeof content === "string") {
35
+ const isHtml = /<\/?[a-z][\s\S]*>/i.test(content);
36
+ if (isHtml) {
37
+ return generateJSON(content, loadedExtensions);
38
+ }
39
+ return {
40
+ type: "doc",
41
+ content: [
42
+ { type: "paragraph", content: [{ type: "text", text: content }] }
43
+ ]
44
+ };
45
+ }
46
+ return { type: "doc", content: [] };
47
+ }, [content, loadedExtensions]);
48
+ const html = useMemo(() => {
49
+ return generateHTML(normalized, loadedExtensions);
50
+ }, [normalized, loadedExtensions]);
51
+ return /* @__PURE__ */ jsx("div", { className: getClassName(), children: /* @__PURE__ */ jsx("div", { className: "rich-text", dangerouslySetInnerHTML: { __html: html } }) });
52
+ }
53
+ export {
54
+ RichTextRender
55
+ };