payload-richtext-tiptap 0.0.70 → 0.0.72

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 (137) hide show
  1. package/dist/src/fields/TiptapEditor/Components.d.ts.map +1 -1
  2. package/dist/src/fields/TiptapEditor/Components.js +3 -4
  3. package/dist/src/fields/TiptapEditor/Components.js.map +1 -1
  4. package/dist/src/fields/TiptapEditor/extensions/AICommand/AICommand.d.ts.map +1 -1
  5. package/dist/src/fields/TiptapEditor/extensions/AICommand/AICommand.js +2 -2
  6. package/dist/src/fields/TiptapEditor/extensions/AICommand/AICommand.js.map +1 -1
  7. package/dist/src/fields/TiptapEditor/extensions/AICommand/groups.d.ts.map +1 -1
  8. package/dist/src/fields/TiptapEditor/extensions/AICommand/groups.js +16 -15
  9. package/dist/src/fields/TiptapEditor/extensions/AICommand/groups.js.map +1 -1
  10. package/dist/src/fields/TiptapEditor/extensions/AudioBlock/AudioBlock.d.ts.map +1 -1
  11. package/dist/src/fields/TiptapEditor/extensions/AudioBlock/AudioBlock.js +1 -0
  12. package/dist/src/fields/TiptapEditor/extensions/AudioBlock/AudioBlock.js.map +1 -1
  13. package/dist/src/fields/TiptapEditor/extensions/AudioBlock/components/AudioBlockMenu.d.ts.map +1 -1
  14. package/dist/src/fields/TiptapEditor/extensions/AudioBlock/components/AudioBlockMenu.js +5 -4
  15. package/dist/src/fields/TiptapEditor/extensions/AudioBlock/components/AudioBlockMenu.js.map +1 -1
  16. package/dist/src/fields/TiptapEditor/extensions/FontSize/FontSize.js.map +1 -1
  17. package/dist/src/fields/TiptapEditor/extensions/Heading/Heading.js.map +1 -1
  18. package/dist/src/fields/TiptapEditor/extensions/Iframe/menus/IframeMenu.d.ts.map +1 -1
  19. package/dist/src/fields/TiptapEditor/extensions/Iframe/menus/IframeMenu.js +2 -1
  20. package/dist/src/fields/TiptapEditor/extensions/Iframe/menus/IframeMenu.js.map +1 -1
  21. package/dist/src/fields/TiptapEditor/extensions/ImageBlock/ImageBlock.d.ts.map +1 -1
  22. package/dist/src/fields/TiptapEditor/extensions/ImageBlock/ImageBlock.js +1 -0
  23. package/dist/src/fields/TiptapEditor/extensions/ImageBlock/ImageBlock.js.map +1 -1
  24. package/dist/src/fields/TiptapEditor/extensions/ImageBlock/components/ImageBlockMenu.d.ts.map +1 -1
  25. package/dist/src/fields/TiptapEditor/extensions/ImageBlock/components/ImageBlockMenu.js +4 -3
  26. package/dist/src/fields/TiptapEditor/extensions/ImageBlock/components/ImageBlockMenu.js.map +1 -1
  27. package/dist/src/fields/TiptapEditor/extensions/InsideLinks/InsideLink.client.js.map +1 -1
  28. package/dist/src/fields/TiptapEditor/extensions/InsideLinks/InsideLinksComponent.d.ts.map +1 -1
  29. package/dist/src/fields/TiptapEditor/extensions/InsideLinks/InsideLinksComponent.js +1 -0
  30. package/dist/src/fields/TiptapEditor/extensions/InsideLinks/InsideLinksComponent.js.map +1 -1
  31. package/dist/src/fields/TiptapEditor/extensions/MultiColumn/Columns.js +3 -3
  32. package/dist/src/fields/TiptapEditor/extensions/MultiColumn/Columns.js.map +1 -1
  33. package/dist/src/fields/TiptapEditor/extensions/MultiColumn/menus/ColumnsMenu.d.ts.map +1 -1
  34. package/dist/src/fields/TiptapEditor/extensions/MultiColumn/menus/ColumnsMenu.js +4 -3
  35. package/dist/src/fields/TiptapEditor/extensions/MultiColumn/menus/ColumnsMenu.js.map +1 -1
  36. package/dist/src/fields/TiptapEditor/extensions/SlashCommand/MenuList.js.map +1 -1
  37. package/dist/src/fields/TiptapEditor/extensions/SlashCommand/SlashCommand.d.ts.map +1 -1
  38. package/dist/src/fields/TiptapEditor/extensions/SlashCommand/SlashCommand.js +2 -2
  39. package/dist/src/fields/TiptapEditor/extensions/SlashCommand/SlashCommand.js.map +1 -1
  40. package/dist/src/fields/TiptapEditor/extensions/SlashCommand/groups.d.ts.map +1 -1
  41. package/dist/src/fields/TiptapEditor/extensions/SlashCommand/groups.js +30 -29
  42. package/dist/src/fields/TiptapEditor/extensions/SlashCommand/groups.js.map +1 -1
  43. package/dist/src/fields/TiptapEditor/extensions/VideoBlock/VideoBlock.d.ts.map +1 -1
  44. package/dist/src/fields/TiptapEditor/extensions/VideoBlock/VideoBlock.js +1 -0
  45. package/dist/src/fields/TiptapEditor/extensions/VideoBlock/VideoBlock.js.map +1 -1
  46. package/dist/src/fields/TiptapEditor/extensions/VideoBlock/components/VideoBlockMenu.d.ts.map +1 -1
  47. package/dist/src/fields/TiptapEditor/extensions/VideoBlock/components/VideoBlockMenu.js +5 -4
  48. package/dist/src/fields/TiptapEditor/extensions/VideoBlock/components/VideoBlockMenu.js.map +1 -1
  49. package/dist/src/fields/TiptapEditor/extensions/extension-kit.d.ts +1 -1
  50. package/dist/src/fields/TiptapEditor/features/BlockEditor/BlockEditor.d.ts +2 -2
  51. package/dist/src/fields/TiptapEditor/features/BlockEditor/BlockEditor.d.ts.map +1 -1
  52. package/dist/src/fields/TiptapEditor/features/BlockEditor/BlockEditor.js +16 -1
  53. package/dist/src/fields/TiptapEditor/features/BlockEditor/BlockEditor.js.map +1 -1
  54. package/dist/src/fields/TiptapEditor/features/BlockEditor/components/EditorHeader.d.ts.map +1 -1
  55. package/dist/src/fields/TiptapEditor/features/BlockEditor/components/EditorHeader.js +2 -1
  56. package/dist/src/fields/TiptapEditor/features/BlockEditor/components/EditorHeader.js.map +1 -1
  57. package/dist/src/fields/TiptapEditor/features/BlockEditor/types.d.ts +7 -0
  58. package/dist/src/fields/TiptapEditor/features/BlockEditor/types.d.ts.map +1 -1
  59. package/dist/src/fields/TiptapEditor/features/BlockEditor/types.js.map +1 -1
  60. package/dist/src/fields/TiptapEditor/features/menus/ContentItemMenu/ContentItemMenu.js +5 -4
  61. package/dist/src/fields/TiptapEditor/features/menus/ContentItemMenu/ContentItemMenu.js.map +1 -1
  62. package/dist/src/fields/TiptapEditor/features/menus/TextMenu/TextMenu.d.ts.map +1 -1
  63. package/dist/src/fields/TiptapEditor/features/menus/TextMenu/TextMenu.js +16 -15
  64. package/dist/src/fields/TiptapEditor/features/menus/TextMenu/TextMenu.js.map +1 -1
  65. package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/EditIframeLinkPopover.d.ts.map +1 -1
  66. package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/EditIframeLinkPopover.js +2 -1
  67. package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/EditIframeLinkPopover.js.map +1 -1
  68. package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/EditLinkPopover.d.ts.map +1 -1
  69. package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/EditLinkPopover.js +2 -1
  70. package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/EditLinkPopover.js.map +1 -1
  71. package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/FontFamilyPicker.js.map +1 -1
  72. package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/FontSizePicker.d.ts.map +1 -1
  73. package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/FontSizePicker.js +24 -23
  74. package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/FontSizePicker.js.map +1 -1
  75. package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/SocialMediaPopover.d.ts.map +1 -1
  76. package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/SocialMediaPopover.js +2 -1
  77. package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/SocialMediaPopover.js.map +1 -1
  78. package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/ai-selector-commands.d.ts.map +1 -1
  79. package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/ai-selector-commands.js +2 -1
  80. package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/ai-selector-commands.js.map +1 -1
  81. package/dist/src/fields/TiptapEditor/features/menus/TextMenu/hooks/useTextmenuContentTypes.d.ts.map +1 -1
  82. package/dist/src/fields/TiptapEditor/features/menus/TextMenu/hooks/useTextmenuContentTypes.js +9 -8
  83. package/dist/src/fields/TiptapEditor/features/menus/TextMenu/hooks/useTextmenuContentTypes.js.map +1 -1
  84. package/dist/src/fields/TiptapEditor/features/panels/AICommandPanel/AICommandPanel.d.ts.map +1 -1
  85. package/dist/src/fields/TiptapEditor/features/panels/AICommandPanel/AICommandPanel.js +2 -1
  86. package/dist/src/fields/TiptapEditor/features/panels/AICommandPanel/AICommandPanel.js.map +1 -1
  87. package/dist/src/fields/TiptapEditor/features/panels/AIEditorPanel/AIEditorPanel.d.ts.map +1 -1
  88. package/dist/src/fields/TiptapEditor/features/panels/AIEditorPanel/AIEditorPanel.js +2 -1
  89. package/dist/src/fields/TiptapEditor/features/panels/AIEditorPanel/AIEditorPanel.js.map +1 -1
  90. package/dist/src/fields/TiptapEditor/features/panels/Colorpicker/Colorpicker.d.ts.map +1 -1
  91. package/dist/src/fields/TiptapEditor/features/panels/Colorpicker/Colorpicker.js +2 -1
  92. package/dist/src/fields/TiptapEditor/features/panels/Colorpicker/Colorpicker.js.map +1 -1
  93. package/dist/src/fields/TiptapEditor/features/panels/IframeLinkEditorPanel/IframeLinkEditorPanel.d.ts.map +1 -1
  94. package/dist/src/fields/TiptapEditor/features/panels/IframeLinkEditorPanel/IframeLinkEditorPanel.js +2 -1
  95. package/dist/src/fields/TiptapEditor/features/panels/IframeLinkEditorPanel/IframeLinkEditorPanel.js.map +1 -1
  96. package/dist/src/fields/TiptapEditor/features/panels/LinkEditorPanel/LinkEditorPanel.d.ts.map +1 -1
  97. package/dist/src/fields/TiptapEditor/features/panels/LinkEditorPanel/LinkEditorPanel.js +2 -1
  98. package/dist/src/fields/TiptapEditor/features/panels/LinkEditorPanel/LinkEditorPanel.js.map +1 -1
  99. package/dist/src/fields/TiptapEditor/hooks/useBlockEditor.d.ts.map +1 -1
  100. package/dist/src/fields/TiptapEditor/hooks/useBlockEditor.js +4 -10
  101. package/dist/src/fields/TiptapEditor/hooks/useBlockEditor.js.map +1 -1
  102. package/dist/src/fields/TiptapEditor/lib/extract.d.ts +3 -1
  103. package/dist/src/fields/TiptapEditor/lib/extract.d.ts.map +1 -1
  104. package/dist/src/fields/TiptapEditor/lib/extract.js +12 -0
  105. package/dist/src/fields/TiptapEditor/lib/extract.js.map +1 -1
  106. package/dist/src/fields/TiptapEditor/lib/utils/cssVar.js.map +1 -1
  107. package/dist/src/index.d.ts +1 -1
  108. package/dist/src/index.d.ts.map +1 -1
  109. package/dist/src/index.js +1 -1
  110. package/dist/src/index.js.map +1 -1
  111. package/dist/src/styles.css +2 -2
  112. package/dist/tsconfig.tsbuildinfo +1 -1
  113. package/package.json +39 -38
  114. package/dist/src/fields/TiptapEditor/extensions/TableOfContentsNode/TableOfContentsNode.d.ts +0 -10
  115. package/dist/src/fields/TiptapEditor/extensions/TableOfContentsNode/TableOfContentsNode.d.ts.map +0 -1
  116. package/dist/src/fields/TiptapEditor/extensions/TableOfContentsNode/TableOfContentsNode.js +0 -55
  117. package/dist/src/fields/TiptapEditor/extensions/TableOfContentsNode/TableOfContentsNode.js.map +0 -1
  118. package/dist/src/fields/TiptapEditor/extensions/TableOfContentsNode/index.d.ts +0 -2
  119. package/dist/src/fields/TiptapEditor/extensions/TableOfContentsNode/index.d.ts.map +0 -1
  120. package/dist/src/fields/TiptapEditor/extensions/TableOfContentsNode/index.js +0 -3
  121. package/dist/src/fields/TiptapEditor/extensions/TableOfContentsNode/index.js.map +0 -1
  122. package/dist/src/fields/TiptapEditor/features/Sidebar/Sidebar.d.ts +0 -8
  123. package/dist/src/fields/TiptapEditor/features/Sidebar/Sidebar.d.ts.map +0 -1
  124. package/dist/src/fields/TiptapEditor/features/Sidebar/Sidebar.js +0 -32
  125. package/dist/src/fields/TiptapEditor/features/Sidebar/Sidebar.js.map +0 -1
  126. package/dist/src/fields/TiptapEditor/features/Sidebar/index.d.ts +0 -2
  127. package/dist/src/fields/TiptapEditor/features/Sidebar/index.d.ts.map +0 -1
  128. package/dist/src/fields/TiptapEditor/features/Sidebar/index.js +0 -3
  129. package/dist/src/fields/TiptapEditor/features/Sidebar/index.js.map +0 -1
  130. package/dist/src/fields/TiptapEditor/features/TableOfContents/TableOfContents.d.ts +0 -8
  131. package/dist/src/fields/TiptapEditor/features/TableOfContents/TableOfContents.d.ts.map +0 -1
  132. package/dist/src/fields/TiptapEditor/features/TableOfContents/TableOfContents.js +0 -57
  133. package/dist/src/fields/TiptapEditor/features/TableOfContents/TableOfContents.js.map +0 -1
  134. package/dist/src/fields/TiptapEditor/features/TableOfContents/index.d.ts +0 -2
  135. package/dist/src/fields/TiptapEditor/features/TableOfContents/index.d.ts.map +0 -1
  136. package/dist/src/fields/TiptapEditor/features/TableOfContents/index.js +0 -3
  137. package/dist/src/fields/TiptapEditor/features/TableOfContents/index.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "payload-richtext-tiptap",
3
- "version": "0.0.70",
3
+ "version": "0.0.72",
4
4
  "description": "Rich text tiptap for Payload CMS",
5
5
  "keywords": [
6
6
  "payload",
@@ -72,42 +72,42 @@
72
72
  "@tiptap-pro/extension-node-range": "^2.10.11",
73
73
  "@tiptap-pro/extension-table-of-contents": "^2.10.11",
74
74
  "@tiptap-pro/extension-unique-id": "^2.10.11",
75
- "@tiptap/core": "^2.5.9",
76
- "@tiptap/extension-bullet-list": "^2.5.9",
77
- "@tiptap/extension-character-count": "^2.5.9",
78
- "@tiptap/extension-code-block": "^2.5.9",
79
- "@tiptap/extension-code-block-lowlight": "^2.5.9",
80
- "@tiptap/extension-collaboration": "^2.5.9",
81
- "@tiptap/extension-collaboration-cursor": "^2.5.9",
82
- "@tiptap/extension-color": "^2.5.9",
83
- "@tiptap/extension-document": "^2.5.9",
84
- "@tiptap/extension-dropcursor": "^2.5.9",
85
- "@tiptap/extension-focus": "^2.5.9",
86
- "@tiptap/extension-font-family": "^2.5.9",
87
- "@tiptap/extension-heading": "^2.5.9",
88
- "@tiptap/extension-highlight": "^2.5.9",
89
- "@tiptap/extension-history": "^2.5.9",
90
- "@tiptap/extension-horizontal-rule": "^2.5.9",
91
- "@tiptap/extension-image": "^2.5.9",
92
- "@tiptap/extension-link": "^2.5.9",
93
- "@tiptap/extension-ordered-list": "^2.5.9",
94
- "@tiptap/extension-paragraph": "^2.5.9",
95
- "@tiptap/extension-placeholder": "^2.5.9",
96
- "@tiptap/extension-subscript": "^2.5.9",
97
- "@tiptap/extension-superscript": "^2.5.9",
98
- "@tiptap/extension-table": "^2.5.9",
99
- "@tiptap/extension-table-header": "^2.5.9",
100
- "@tiptap/extension-table-row": "^2.5.9",
101
- "@tiptap/extension-task-item": "^2.5.9",
102
- "@tiptap/extension-task-list": "^2.5.9",
103
- "@tiptap/extension-text-align": "^2.5.9",
104
- "@tiptap/extension-text-style": "^2.5.9",
105
- "@tiptap/extension-typography": "^2.5.9",
106
- "@tiptap/extension-underline": "^2.5.9",
107
- "@tiptap/pm": "^2.5.9",
108
- "@tiptap/react": "^2.5.9",
109
- "@tiptap/starter-kit": "^2.5.9",
110
- "@tiptap/suggestion": "^2.5.9",
75
+ "@tiptap/core": "2.9.1",
76
+ "@tiptap/extension-bullet-list": "2.9.1",
77
+ "@tiptap/extension-character-count": "2.9.1",
78
+ "@tiptap/extension-code-block": "2.9.1",
79
+ "@tiptap/extension-code-block-lowlight": "2.9.1",
80
+ "@tiptap/extension-collaboration": "2.9.1",
81
+ "@tiptap/extension-collaboration-cursor": "2.9.1",
82
+ "@tiptap/extension-color": "2.9.1",
83
+ "@tiptap/extension-document": "2.9.1",
84
+ "@tiptap/extension-dropcursor": "2.9.1",
85
+ "@tiptap/extension-focus": "2.9.1",
86
+ "@tiptap/extension-font-family": "2.9.1",
87
+ "@tiptap/extension-heading": "2.9.1",
88
+ "@tiptap/extension-highlight": "2.9.1",
89
+ "@tiptap/extension-history": "2.9.1",
90
+ "@tiptap/extension-horizontal-rule": "2.9.1",
91
+ "@tiptap/extension-image": "2.9.1",
92
+ "@tiptap/extension-link": "2.9.1",
93
+ "@tiptap/extension-ordered-list": "2.9.1",
94
+ "@tiptap/extension-paragraph": "2.9.1",
95
+ "@tiptap/extension-placeholder": "2.9.1",
96
+ "@tiptap/extension-subscript": "2.9.1",
97
+ "@tiptap/extension-superscript": "2.9.1",
98
+ "@tiptap/extension-table": "2.9.1",
99
+ "@tiptap/extension-table-header": "2.9.1",
100
+ "@tiptap/extension-table-row": "2.9.1",
101
+ "@tiptap/extension-task-item": "2.9.1",
102
+ "@tiptap/extension-task-list": "2.9.1",
103
+ "@tiptap/extension-text-align": "2.9.1",
104
+ "@tiptap/extension-text-style": "2.9.1",
105
+ "@tiptap/extension-typography": "2.9.1",
106
+ "@tiptap/extension-underline": "2.9.1",
107
+ "@tiptap/pm": "2.9.1",
108
+ "@tiptap/react": "2.9.1",
109
+ "@tiptap/starter-kit": "2.9.1",
110
+ "@tiptap/suggestion": "2.9.1",
111
111
  "@types/video.js": "7.3.26",
112
112
  "@types/videojs-contrib-quality-levels": "2.0.1",
113
113
  "@videojs/http-streaming": "^3.10.0",
@@ -117,6 +117,7 @@
117
117
  "clsx": "^2.1.1",
118
118
  "deepmerge": "^4.3.1",
119
119
  "escape-html": "^1.0.3",
120
+ "i18next": "^23.16.5",
120
121
  "jsonwebtoken": "^9.0.2",
121
122
  "lowlight": "^1.20.0",
122
123
  "lucide-react": "^0.417.0",
@@ -198,4 +199,4 @@
198
199
  "url": "https://github.com/payloadcms/payload/issues"
199
200
  },
200
201
  "homepage": "https://github.com/payloadcms/payload#readme"
201
- }
202
+ }
@@ -1,10 +0,0 @@
1
- import { Node } from "@tiptap/core";
2
- declare module "@tiptap/core" {
3
- interface Commands<ReturnType> {
4
- tableOfContentsNode: {
5
- insertTableOfContents: () => ReturnType;
6
- };
7
- }
8
- }
9
- export declare const TableOfContentsNode: Node<any, any>;
10
- //# sourceMappingURL=TableOfContentsNode.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TableOfContentsNode.d.ts","sourceRoot":"","sources":["../../../../../../src/fields/TiptapEditor/extensions/TableOfContentsNode/TableOfContentsNode.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAyB,MAAM,cAAc,CAAC;AAgB3D,OAAO,QAAQ,cAAc,CAAC;IAC5B,UAAU,QAAQ,CAAC,UAAU;QAC3B,mBAAmB,EAAE;YACnB,qBAAqB,EAAE,MAAM,UAAU,CAAC;SACzC,CAAC;KACH;CACF;AAED,eAAO,MAAM,mBAAmB,gBAmC9B,CAAC"}
@@ -1,55 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import React from "react";
3
- import { Node } from "@tiptap/core";
4
- import { NodeViewWrapper, ReactNodeViewRenderer } from "@tiptap/react";
5
- import { TableOfContents } from "../../features/TableOfContents/index.js";
6
- const TableOfNodeContent = (props)=>{
7
- const { editor } = props;
8
- return /*#__PURE__*/ _jsx(NodeViewWrapper, {
9
- children: /*#__PURE__*/ _jsx("div", {
10
- className: "p-2 -m-2 rounded-lg",
11
- contentEditable: false,
12
- children: /*#__PURE__*/ _jsx(TableOfContents, {
13
- editor: editor
14
- })
15
- })
16
- });
17
- };
18
- export const TableOfContentsNode = Node.create({
19
- name: "tableOfContentsNode",
20
- group: "block",
21
- atom: true,
22
- selectable: true,
23
- draggable: true,
24
- inline: false,
25
- parseHTML () {
26
- return [
27
- {
28
- tag: 'div[data-type="table-of-content"]'
29
- }
30
- ];
31
- },
32
- renderHTML ({ HTMLAttributes }) {
33
- return [
34
- "div",
35
- {
36
- ...HTMLAttributes,
37
- "data-type": "table-of-content"
38
- }
39
- ];
40
- },
41
- addNodeView () {
42
- return ReactNodeViewRenderer(TableOfNodeContent);
43
- },
44
- addCommands () {
45
- return {
46
- insertTableOfContents: ()=>({ commands })=>{
47
- return commands.insertContent({
48
- type: this.name
49
- });
50
- }
51
- };
52
- }
53
- });
54
-
55
- //# sourceMappingURL=TableOfContentsNode.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../src/fields/TiptapEditor/extensions/TableOfContentsNode/TableOfContentsNode.tsx"],"sourcesContent":["import React from \"react\";\nimport { Node, NodeViewRendererProps } from \"@tiptap/core\";\nimport { NodeViewWrapper, ReactNodeViewRenderer } from \"@tiptap/react\";\nimport { TableOfContents } from \"../../features/TableOfContents/index.js\";\n\nconst TableOfNodeContent = (props: NodeViewRendererProps) => {\n const { editor } = props;\n\n return (\n <NodeViewWrapper>\n <div className=\"p-2 -m-2 rounded-lg\" contentEditable={false}>\n <TableOfContents editor={editor} />\n </div>\n </NodeViewWrapper>\n );\n};\n\ndeclare module \"@tiptap/core\" {\n interface Commands<ReturnType> {\n tableOfContentsNode: {\n insertTableOfContents: () => ReturnType;\n };\n }\n}\n\nexport const TableOfContentsNode = Node.create({\n name: \"tableOfContentsNode\",\n group: \"block\",\n atom: true,\n selectable: true,\n draggable: true,\n inline: false,\n\n parseHTML() {\n return [\n {\n tag: 'div[data-type=\"table-of-content\"]',\n },\n ];\n },\n\n renderHTML({ HTMLAttributes }) {\n return [\"div\", { ...HTMLAttributes, \"data-type\": \"table-of-content\" }];\n },\n\n addNodeView() {\n return ReactNodeViewRenderer(TableOfNodeContent);\n },\n\n addCommands() {\n return {\n insertTableOfContents:\n () =>\n ({ commands }) => {\n return commands.insertContent({\n type: this.name,\n });\n },\n };\n },\n});\n"],"names":["React","Node","NodeViewWrapper","ReactNodeViewRenderer","TableOfContents","TableOfNodeContent","props","editor","div","className","contentEditable","TableOfContentsNode","create","name","group","atom","selectable","draggable","inline","parseHTML","tag","renderHTML","HTMLAttributes","addNodeView","addCommands","insertTableOfContents","commands","insertContent","type"],"mappings":";AAAA,OAAOA,WAAW,QAAQ;AAC1B,SAASC,IAAI,QAA+B,eAAe;AAC3D,SAASC,eAAe,EAAEC,qBAAqB,QAAQ,gBAAgB;AACvE,SAASC,eAAe,QAAQ,0CAA0C;AAE1E,MAAMC,qBAAqB,CAACC;IAC1B,MAAM,EAAEC,MAAM,EAAE,GAAGD;IAEnB,qBACE,KAACJ;kBACC,cAAA,KAACM;YAAIC,WAAU;YAAsBC,iBAAiB;sBACpD,cAAA,KAACN;gBAAgBG,QAAQA;;;;AAIjC;AAUA,OAAO,MAAMI,sBAAsBV,KAAKW,MAAM,CAAC;IAC7CC,MAAM;IACNC,OAAO;IACPC,MAAM;IACNC,YAAY;IACZC,WAAW;IACXC,QAAQ;IAERC;QACE,OAAO;YACL;gBACEC,KAAK;YACP;SACD;IACH;IAEAC,YAAW,EAAEC,cAAc,EAAE;QAC3B,OAAO;YAAC;YAAO;gBAAE,GAAGA,cAAc;gBAAE,aAAa;YAAmB;SAAE;IACxE;IAEAC;QACE,OAAOpB,sBAAsBE;IAC/B;IAEAmB;QACE,OAAO;YACLC,uBACE,IACA,CAAC,EAAEC,QAAQ,EAAE;oBACX,OAAOA,SAASC,aAAa,CAAC;wBAC5BC,MAAM,IAAI,CAACf,IAAI;oBACjB;gBACF;QACJ;IACF;AACF,GAAG"}
@@ -1,2 +0,0 @@
1
- export * from "./TableOfContentsNode.js";
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/fields/TiptapEditor/extensions/TableOfContentsNode/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC"}
@@ -1,3 +0,0 @@
1
- export * from "./TableOfContentsNode.js";
2
-
3
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../src/fields/TiptapEditor/extensions/TableOfContentsNode/index.ts"],"sourcesContent":["export * from \"./TableOfContentsNode.js\";\n"],"names":[],"mappings":"AAAA,cAAc,2BAA2B"}
@@ -1,8 +0,0 @@
1
- import React from "react";
2
- import { Editor } from "@tiptap/react";
3
- export declare const Sidebar: React.MemoExoticComponent<({ editor, isOpen, onClose, }: {
4
- editor: Editor;
5
- isOpen?: boolean;
6
- onClose: () => void;
7
- }) => React.JSX.Element>;
8
- //# sourceMappingURL=Sidebar.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Sidebar.d.ts","sourceRoot":"","sources":["../../../../../../src/fields/TiptapEditor/features/Sidebar/Sidebar.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAIvC,eAAO,MAAM,OAAO,2DAKf;IACD,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,uBA2BF,CAAC"}
@@ -1,32 +0,0 @@
1
- "use client";
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import React from "react";
4
- import { memo, useCallback } from "react";
5
- import { TableOfContents } from "../TableOfContents/index.js";
6
- import { cn } from "../../lib/utils/index.js";
7
- export const Sidebar = /*#__PURE__*/ memo(({ editor, isOpen, onClose })=>{
8
- const handlePotentialClose = useCallback(()=>{
9
- if (window.innerWidth < 1024) {
10
- onClose();
11
- }
12
- }, [
13
- onClose
14
- ]);
15
- const windowClassName = cn("absolute top-0 left-0 bg-white lg:bg-white/30 lg:backdrop-blur-xl h-full lg:h-auto lg:relative z-[999] w-0 duration-300 transition-all", "dark:bg-black lg:dark:bg-black/30", !isOpen && "border-r-transparent", isOpen && "w-80 border-r border-r-neutral-200 dark:border-r-neutral-800");
16
- return /*#__PURE__*/ _jsx("div", {
17
- className: windowClassName,
18
- children: /*#__PURE__*/ _jsx("div", {
19
- className: "w-full h-full overflow-hidden",
20
- children: /*#__PURE__*/ _jsx("div", {
21
- className: "w-full h-full p-2 overflow-auto",
22
- children: /*#__PURE__*/ _jsx(TableOfContents, {
23
- onItemClick: handlePotentialClose,
24
- editor: editor
25
- })
26
- })
27
- })
28
- });
29
- });
30
- Sidebar.displayName = "TableOfContentSidepanel";
31
-
32
- //# sourceMappingURL=Sidebar.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../src/fields/TiptapEditor/features/Sidebar/Sidebar.tsx"],"sourcesContent":["\"use client\";\nimport React from \"react\";\nimport { memo, useCallback } from \"react\";\nimport { Editor } from \"@tiptap/react\";\nimport { TableOfContents } from \"../TableOfContents/index.js\";\nimport { cn } from \"../../lib/utils/index.js\";\n\nexport const Sidebar = memo(\n ({\n editor,\n isOpen,\n onClose,\n }: {\n editor: Editor;\n isOpen?: boolean;\n onClose: () => void;\n }) => {\n const handlePotentialClose = useCallback(() => {\n if (window.innerWidth < 1024) {\n onClose();\n }\n }, [onClose]);\n\n const windowClassName = cn(\n \"absolute top-0 left-0 bg-white lg:bg-white/30 lg:backdrop-blur-xl h-full lg:h-auto lg:relative z-[999] w-0 duration-300 transition-all\",\n \"dark:bg-black lg:dark:bg-black/30\",\n !isOpen && \"border-r-transparent\",\n isOpen && \"w-80 border-r border-r-neutral-200 dark:border-r-neutral-800\"\n );\n\n return (\n <div className={windowClassName}>\n <div className=\"w-full h-full overflow-hidden\">\n <div className=\"w-full h-full p-2 overflow-auto\">\n <TableOfContents\n onItemClick={handlePotentialClose}\n editor={editor}\n />\n </div>\n </div>\n </div>\n );\n }\n);\n\nSidebar.displayName = \"TableOfContentSidepanel\";\n"],"names":["React","memo","useCallback","TableOfContents","cn","Sidebar","editor","isOpen","onClose","handlePotentialClose","window","innerWidth","windowClassName","div","className","onItemClick","displayName"],"mappings":"AAAA;;AACA,OAAOA,WAAW,QAAQ;AAC1B,SAASC,IAAI,EAAEC,WAAW,QAAQ,QAAQ;AAE1C,SAASC,eAAe,QAAQ,8BAA8B;AAC9D,SAASC,EAAE,QAAQ,2BAA2B;AAE9C,OAAO,MAAMC,wBAAUJ,KACrB,CAAC,EACCK,MAAM,EACNC,MAAM,EACNC,OAAO,EAKR;IACC,MAAMC,uBAAuBP,YAAY;QACvC,IAAIQ,OAAOC,UAAU,GAAG,MAAM;YAC5BH;QACF;IACF,GAAG;QAACA;KAAQ;IAEZ,MAAMI,kBAAkBR,GACtB,0IACA,qCACA,CAACG,UAAU,wBACXA,UAAU;IAGZ,qBACE,KAACM;QAAIC,WAAWF;kBACd,cAAA,KAACC;YAAIC,WAAU;sBACb,cAAA,KAACD;gBAAIC,WAAU;0BACb,cAAA,KAACX;oBACCY,aAAaN;oBACbH,QAAQA;;;;;AAMpB,GACA;AAEFD,QAAQW,WAAW,GAAG"}
@@ -1,2 +0,0 @@
1
- export * from "./Sidebar.js";
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/fields/TiptapEditor/features/Sidebar/index.tsx"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
@@ -1,3 +0,0 @@
1
- export * from "./Sidebar.js";
2
-
3
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../src/fields/TiptapEditor/features/Sidebar/index.tsx"],"sourcesContent":["export * from \"./Sidebar.js\";\n"],"names":[],"mappings":"AAAA,cAAc,eAAe"}
@@ -1,8 +0,0 @@
1
- import React from "react";
2
- import { Editor as CoreEditor } from "@tiptap/core";
3
- export type TableOfContentsProps = {
4
- editor: CoreEditor;
5
- onItemClick?: () => void;
6
- };
7
- export declare const TableOfContents: React.MemoExoticComponent<({ editor, onItemClick }: TableOfContentsProps) => React.JSX.Element>;
8
- //# sourceMappingURL=TableOfContents.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TableOfContents.d.ts","sourceRoot":"","sources":["../../../../../../src/fields/TiptapEditor/features/TableOfContents/TableOfContents.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AAOpD,MAAM,MAAM,oBAAoB,GAAG;IACjC,MAAM,EAAE,UAAU,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,eAAe,sDACA,oBAAoB,uBAoD/C,CAAC"}
@@ -1,57 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import React from "react";
3
- import { memo, useEffect, useState } from "react";
4
- import { cn } from "../../lib/utils/index.js";
5
- // import { toTranslationKey } from '@/languages'
6
- import { useTranslation } from "@payloadcms/ui/providers/Translation";
7
- export const TableOfContents = /*#__PURE__*/ memo(({ editor, onItemClick })=>{
8
- const [data, setData] = useState(null);
9
- useEffect(()=>{
10
- const handler = ({ editor: currentEditor })=>{
11
- setData({
12
- ...currentEditor.extensionStorage.tableOfContents
13
- });
14
- };
15
- handler({
16
- editor
17
- });
18
- editor.on("update", handler);
19
- editor.on("selectionUpdate", handler);
20
- return ()=>{
21
- editor.off("update", handler);
22
- editor.off("selectionUpdate", handler);
23
- };
24
- }, [
25
- editor
26
- ]);
27
- const { i18n } = useTranslation();
28
- return /*#__PURE__*/ _jsxs("div", {
29
- lang: i18n.language,
30
- children: [
31
- /*#__PURE__*/ _jsx("div", {
32
- className: "mb-2 text-xs font-semibold uppercase text-neutral-500 dark:text-neutral-400"
33
- }),
34
- data && data.content.length > 0 ? /*#__PURE__*/ _jsx("div", {
35
- className: "flex flex-col gap-1",
36
- children: data.content.map((item)=>/*#__PURE__*/ _jsxs("a", {
37
- href: `#${item.id}`,
38
- style: {
39
- marginLeft: `${1 * item.level - 1}rem`
40
- },
41
- onClick: onItemClick,
42
- className: cn("block font-medium text-neutral-500 dark:text-neutral-300 p-1 rounded bg-opacity-10 text-sm hover:text-neutral-800 transition-all hover:bg-black hover:bg-opacity-5 truncate w-full", item.isActive && "text-neutral-800 bg-neutral-100 dark:text-neutral-100 dark:bg-neutral-900"),
43
- children: [
44
- item.itemIndex,
45
- ". ",
46
- item.textContent
47
- ]
48
- }, item.id))
49
- }) : /*#__PURE__*/ _jsx("div", {
50
- className: "text-sm text-neutral-500"
51
- })
52
- ]
53
- });
54
- });
55
- TableOfContents.displayName = "TableOfContents";
56
-
57
- //# sourceMappingURL=TableOfContents.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../src/fields/TiptapEditor/features/TableOfContents/TableOfContents.tsx"],"sourcesContent":["import React from \"react\";\nimport { Editor as CoreEditor } from \"@tiptap/core\";\nimport { memo, useEffect, useState } from \"react\";\nimport { TableOfContentsStorage } from \"@tiptap-pro/extension-table-of-contents\";\nimport { cn } from \"../../lib/utils/index.js\";\n// import { toTranslationKey } from '@/languages'\nimport { useTranslation } from \"@payloadcms/ui/providers/Translation\";\n\nexport type TableOfContentsProps = {\n editor: CoreEditor;\n onItemClick?: () => void;\n};\n\nexport const TableOfContents = memo(\n ({ editor, onItemClick }: TableOfContentsProps) => {\n const [data, setData] = useState<TableOfContentsStorage | null>(null);\n\n useEffect(() => {\n const handler = ({ editor: currentEditor }: { editor: CoreEditor }) => {\n setData({ ...currentEditor.extensionStorage.tableOfContents });\n };\n\n handler({ editor });\n\n editor.on(\"update\", handler);\n editor.on(\"selectionUpdate\", handler);\n\n return () => {\n editor.off(\"update\", handler);\n editor.off(\"selectionUpdate\", handler);\n };\n }, [editor]);\n const { i18n } = useTranslation();\n\n return (\n <div lang={i18n.language}>\n <div className=\"mb-2 text-xs font-semibold uppercase text-neutral-500 dark:text-neutral-400\">\n {/* {toTranslationKey('table_of_contents')}Table of Contents */}\n </div>\n {data && data.content.length > 0 ? (\n <div className=\"flex flex-col gap-1\">\n {data.content.map((item) => (\n <a\n key={item.id}\n href={`#${item.id}`}\n style={{ marginLeft: `${1 * item.level - 1}rem` }}\n onClick={onItemClick}\n className={cn(\n \"block font-medium text-neutral-500 dark:text-neutral-300 p-1 rounded bg-opacity-10 text-sm hover:text-neutral-800 transition-all hover:bg-black hover:bg-opacity-5 truncate w-full\",\n item.isActive &&\n \"text-neutral-800 bg-neutral-100 dark:text-neutral-100 dark:bg-neutral-900\"\n )}\n >\n {item.itemIndex}. {item.textContent}\n </a>\n ))}\n </div>\n ) : (\n <div className=\"text-sm text-neutral-500\">\n {/* Start adding headlines to your document */}\n {/* {toTranslationKey(\"start_adding_headlines_to_your_document\")} */}\n </div>\n )}\n </div>\n );\n }\n);\n\nTableOfContents.displayName = \"TableOfContents\";\n"],"names":["React","memo","useEffect","useState","cn","useTranslation","TableOfContents","editor","onItemClick","data","setData","handler","currentEditor","extensionStorage","tableOfContents","on","off","i18n","div","lang","language","className","content","length","map","item","a","href","id","style","marginLeft","level","onClick","isActive","itemIndex","textContent","displayName"],"mappings":";AAAA,OAAOA,WAAW,QAAQ;AAE1B,SAASC,IAAI,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,QAAQ;AAElD,SAASC,EAAE,QAAQ,2BAA2B;AAC9C,iDAAiD;AACjD,SAASC,cAAc,QAAQ,uCAAuC;AAOtE,OAAO,MAAMC,gCAAkBL,KAC7B,CAAC,EAAEM,MAAM,EAAEC,WAAW,EAAwB;IAC5C,MAAM,CAACC,MAAMC,QAAQ,GAAGP,SAAwC;IAEhED,UAAU;QACR,MAAMS,UAAU,CAAC,EAAEJ,QAAQK,aAAa,EAA0B;YAChEF,QAAQ;gBAAE,GAAGE,cAAcC,gBAAgB,CAACC,eAAe;YAAC;QAC9D;QAEAH,QAAQ;YAAEJ;QAAO;QAEjBA,OAAOQ,EAAE,CAAC,UAAUJ;QACpBJ,OAAOQ,EAAE,CAAC,mBAAmBJ;QAE7B,OAAO;YACLJ,OAAOS,GAAG,CAAC,UAAUL;YACrBJ,OAAOS,GAAG,CAAC,mBAAmBL;QAChC;IACF,GAAG;QAACJ;KAAO;IACX,MAAM,EAAEU,IAAI,EAAE,GAAGZ;IAEjB,qBACE,MAACa;QAAIC,MAAMF,KAAKG,QAAQ;;0BACtB,KAACF;gBAAIG,WAAU;;YAGdZ,QAAQA,KAAKa,OAAO,CAACC,MAAM,GAAG,kBAC7B,KAACL;gBAAIG,WAAU;0BACZZ,KAAKa,OAAO,CAACE,GAAG,CAAC,CAACC,qBACjB,MAACC;wBAECC,MAAM,CAAC,CAAC,EAAEF,KAAKG,EAAE,CAAC,CAAC;wBACnBC,OAAO;4BAAEC,YAAY,CAAC,EAAE,IAAIL,KAAKM,KAAK,GAAG,EAAE,GAAG,CAAC;wBAAC;wBAChDC,SAASxB;wBACTa,WAAWjB,GACT,sLACAqB,KAAKQ,QAAQ,IACX;;4BAGHR,KAAKS,SAAS;4BAAC;4BAAGT,KAAKU,WAAW;;uBAV9BV,KAAKG,EAAE;+BAelB,KAACV;gBAAIG,WAAU;;;;AAOvB,GACA;AAEFf,gBAAgB8B,WAAW,GAAG"}
@@ -1,2 +0,0 @@
1
- export * from "./TableOfContents.js";
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/fields/TiptapEditor/features/TableOfContents/index.tsx"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC"}
@@ -1,3 +0,0 @@
1
- export * from "./TableOfContents.js";
2
-
3
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../src/fields/TiptapEditor/features/TableOfContents/index.tsx"],"sourcesContent":["export * from \"./TableOfContents.js\";\n"],"names":[],"mappings":"AAAA,cAAc,uBAAuB"}