@kopexa/tiptap 17.0.17 → 17.2.0

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 (147) hide show
  1. package/dist/chunk-2U5CQUZH.mjs +91 -0
  2. package/dist/chunk-2V6VOAPI.mjs +139 -0
  3. package/dist/chunk-32SUXCAQ.mjs +115 -0
  4. package/dist/chunk-3VRQUYYW.mjs +169 -0
  5. package/dist/chunk-4CDZ547I.mjs +185 -0
  6. package/dist/chunk-5GFFTVMZ.mjs +62 -0
  7. package/dist/{chunk-FJAGUXEO.mjs → chunk-7SRL3P4B.mjs} +32 -19
  8. package/dist/{chunk-WHJ4B43N.mjs → chunk-7VGROP26.mjs} +69 -25
  9. package/dist/chunk-7VW67NVL.mjs +80 -0
  10. package/dist/chunk-BXHPO3T7.mjs +152 -0
  11. package/dist/{chunk-QF3YHPWM.mjs → chunk-E5NW3MJZ.mjs} +4 -4
  12. package/dist/chunk-FRJX2F4T.mjs +55 -0
  13. package/dist/chunk-IFXRPGIJ.mjs +98 -0
  14. package/dist/chunk-JCV5SEKN.mjs +65 -0
  15. package/dist/chunk-LMCQMSW2.mjs +345 -0
  16. package/dist/chunk-N4CT5RNC.mjs +123 -0
  17. package/dist/{chunk-B2DHYFSH.mjs → chunk-NEHW62L7.mjs} +56 -3
  18. package/dist/chunk-NSYSECKW.mjs +53 -0
  19. package/dist/{chunk-3IKIIRV3.mjs → chunk-QAE2D4KV.mjs} +39 -16
  20. package/dist/chunk-TAM3VMJT.mjs +80 -0
  21. package/dist/chunk-UU6JK5HX.mjs +257 -0
  22. package/dist/chunk-UVHVCION.mjs +168 -0
  23. package/dist/chunk-VF3G2URZ.mjs +83 -0
  24. package/dist/chunk-VRQ6OSAZ.mjs +76 -0
  25. package/dist/chunk-WAAH3NLG.mjs +77 -0
  26. package/dist/chunk-XNDXYI2N.mjs +158 -0
  27. package/dist/context/editor-file-context.d.mts +70 -0
  28. package/dist/context/editor-file-context.d.ts +70 -0
  29. package/dist/context/editor-file-context.js +96 -0
  30. package/dist/context/editor-file-context.mjs +12 -0
  31. package/dist/extensions/callout/callout-settings.d.mts +13 -0
  32. package/dist/extensions/callout/callout-settings.d.ts +13 -0
  33. package/dist/extensions/callout/callout-settings.js +206 -0
  34. package/dist/extensions/callout/callout-settings.mjs +9 -0
  35. package/dist/extensions/callout/callout-view.d.mts +12 -0
  36. package/dist/extensions/callout/callout-view.d.ts +12 -0
  37. package/dist/extensions/callout/callout-view.js +273 -0
  38. package/dist/extensions/callout/callout-view.mjs +12 -0
  39. package/dist/extensions/callout/index.d.mts +44 -0
  40. package/dist/extensions/callout/index.d.ts +44 -0
  41. package/dist/extensions/callout/index.js +380 -0
  42. package/dist/extensions/callout/index.mjs +13 -0
  43. package/dist/extensions/callout/messages.d.mts +59 -0
  44. package/dist/extensions/callout/messages.d.ts +59 -0
  45. package/dist/extensions/callout/messages.js +88 -0
  46. package/dist/extensions/callout/messages.mjs +7 -0
  47. package/dist/extensions/image/image-view.d.mts +15 -0
  48. package/dist/extensions/image/image-view.d.ts +15 -0
  49. package/dist/extensions/image/image-view.js +423 -0
  50. package/dist/extensions/image/image-view.mjs +12 -0
  51. package/dist/extensions/image/index.d.mts +66 -0
  52. package/dist/extensions/image/index.d.ts +66 -0
  53. package/dist/extensions/image/index.js +495 -0
  54. package/dist/extensions/image/index.mjs +16 -0
  55. package/dist/extensions/image/messages.d.mts +56 -0
  56. package/dist/extensions/image/messages.d.ts +56 -0
  57. package/dist/extensions/image/messages.js +85 -0
  58. package/dist/extensions/image/messages.mjs +7 -0
  59. package/dist/extensions/math/index.d.mts +38 -0
  60. package/dist/extensions/math/index.d.ts +38 -0
  61. package/dist/extensions/math/index.js +544 -0
  62. package/dist/extensions/math/index.mjs +17 -0
  63. package/dist/extensions/math/inline-math-view.d.mts +12 -0
  64. package/dist/extensions/math/inline-math-view.d.ts +12 -0
  65. package/dist/extensions/math/inline-math-view.js +232 -0
  66. package/dist/extensions/math/inline-math-view.mjs +11 -0
  67. package/dist/extensions/math/inline-math.d.mts +32 -0
  68. package/dist/extensions/math/inline-math.d.ts +32 -0
  69. package/dist/extensions/math/inline-math.js +304 -0
  70. package/dist/extensions/math/inline-math.mjs +12 -0
  71. package/dist/extensions/math/math-block-view.d.mts +11 -0
  72. package/dist/extensions/math/math-block-view.d.ts +11 -0
  73. package/dist/extensions/math/math-block-view.js +248 -0
  74. package/dist/extensions/math/math-block-view.mjs +11 -0
  75. package/dist/extensions/math/messages.d.mts +49 -0
  76. package/dist/extensions/math/messages.d.ts +49 -0
  77. package/dist/extensions/math/messages.js +78 -0
  78. package/dist/extensions/math/messages.mjs +7 -0
  79. package/dist/extensions/toc/index.d.mts +53 -0
  80. package/dist/extensions/toc/index.d.ts +53 -0
  81. package/dist/extensions/toc/index.js +501 -0
  82. package/dist/extensions/toc/index.mjs +13 -0
  83. package/dist/extensions/toc/messages.d.mts +74 -0
  84. package/dist/extensions/toc/messages.d.ts +74 -0
  85. package/dist/extensions/toc/messages.js +103 -0
  86. package/dist/extensions/toc/messages.mjs +7 -0
  87. package/dist/extensions/toc/toc-settings.d.mts +13 -0
  88. package/dist/extensions/toc/toc-settings.d.ts +13 -0
  89. package/dist/extensions/toc/toc-settings.js +283 -0
  90. package/dist/extensions/toc/toc-settings.mjs +9 -0
  91. package/dist/extensions/toc/toc-view.d.mts +12 -0
  92. package/dist/extensions/toc/toc-view.d.ts +12 -0
  93. package/dist/extensions/toc/toc-view.js +411 -0
  94. package/dist/extensions/toc/toc-view.mjs +12 -0
  95. package/dist/hooks/use-create-editor.d.mts +20 -2
  96. package/dist/hooks/use-create-editor.d.ts +20 -2
  97. package/dist/hooks/use-create-editor.js +2020 -20
  98. package/dist/hooks/use-create-editor.mjs +20 -3
  99. package/dist/index.d.mts +11 -2
  100. package/dist/index.d.ts +11 -2
  101. package/dist/index.js +3948 -1563
  102. package/dist/index.mjs +64 -23
  103. package/dist/presets/basic/editor-header.d.mts +3 -2
  104. package/dist/presets/basic/editor-header.d.ts +3 -2
  105. package/dist/presets/basic/editor-header.js +91 -25
  106. package/dist/presets/basic/editor-header.mjs +14 -14
  107. package/dist/presets/basic/index.d.mts +3 -1
  108. package/dist/presets/basic/index.d.ts +3 -1
  109. package/dist/presets/basic/index.js +3833 -1517
  110. package/dist/presets/basic/index.mjs +41 -22
  111. package/dist/ui/bubble-menu/index.d.mts +13 -0
  112. package/dist/ui/bubble-menu/index.d.ts +13 -0
  113. package/dist/ui/bubble-menu/index.js +671 -0
  114. package/dist/ui/bubble-menu/index.mjs +16 -0
  115. package/dist/ui/color-highlight-popover/color-highlight-popover.mjs +2 -2
  116. package/dist/ui/color-highlight-popover/index.mjs +2 -2
  117. package/dist/ui/copy-anchor-link-button/use-scroll-to-hash.mjs +2 -2
  118. package/dist/ui/link-bubble/index.d.mts +13 -0
  119. package/dist/ui/link-bubble/index.d.ts +13 -0
  120. package/dist/ui/link-bubble/index.js +182 -0
  121. package/dist/ui/link-bubble/index.mjs +10 -0
  122. package/dist/ui/link-popover/index.js +66 -23
  123. package/dist/ui/link-popover/index.mjs +3 -3
  124. package/dist/ui/link-popover/link-popover.d.mts +7 -2
  125. package/dist/ui/link-popover/link-popover.d.ts +7 -2
  126. package/dist/ui/link-popover/link-popover.js +66 -23
  127. package/dist/ui/link-popover/link-popover.mjs +3 -3
  128. package/dist/ui/link-popover/use-link-popover.mjs +2 -2
  129. package/dist/ui/slash-dropdown-menu/index.js +53 -3
  130. package/dist/ui/slash-dropdown-menu/index.mjs +6 -6
  131. package/dist/ui/slash-dropdown-menu/slash-dropdown-menu.js +53 -3
  132. package/dist/ui/slash-dropdown-menu/slash-dropdown-menu.mjs +4 -4
  133. package/dist/ui/slash-dropdown-menu/use-slash-dropdown-menu.d.mts +28 -0
  134. package/dist/ui/slash-dropdown-menu/use-slash-dropdown-menu.d.ts +28 -0
  135. package/dist/ui/slash-dropdown-menu/use-slash-dropdown-menu.js +53 -3
  136. package/dist/ui/slash-dropdown-menu/use-slash-dropdown-menu.mjs +1 -1
  137. package/dist/ui/suggestion-menu/index.mjs +2 -2
  138. package/dist/ui/suggestion-menu/suggestion-menu.mjs +2 -2
  139. package/dist/utils/safe-parse.js +113 -4
  140. package/dist/utils/safe-parse.mjs +1 -1
  141. package/package.json +48 -39
  142. package/dist/chunk-7LHOYNVF.mjs +0 -60
  143. package/dist/chunk-LXOLVGLW.mjs +0 -131
  144. package/dist/{chunk-XL5FS7LN.mjs → chunk-C5RQWJKE.mjs} +3 -3
  145. package/dist/{chunk-JNL4KY45.mjs → chunk-DZLGLP7R.mjs} +3 -3
  146. package/dist/{chunk-LHXRE26G.mjs → chunk-VTKJPVNM.mjs} +3 -3
  147. package/dist/{chunk-XLSZK3WJ.mjs → chunk-ZYFCSR3E.mjs} +3 -3
@@ -0,0 +1,248 @@
1
+ "use client";
2
+ "use strict";
3
+ "use client";
4
+ var __create = Object.create;
5
+ var __defProp = Object.defineProperty;
6
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
+ var __getOwnPropNames = Object.getOwnPropertyNames;
8
+ var __getProtoOf = Object.getPrototypeOf;
9
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
10
+ var __export = (target, all) => {
11
+ for (var name in all)
12
+ __defProp(target, name, { get: all[name], enumerable: true });
13
+ };
14
+ var __copyProps = (to, from, except, desc) => {
15
+ if (from && typeof from === "object" || typeof from === "function") {
16
+ for (let key of __getOwnPropNames(from))
17
+ if (!__hasOwnProp.call(to, key) && key !== except)
18
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
19
+ }
20
+ return to;
21
+ };
22
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
23
+ // If the importer is in node compatibility mode or this is not an ESM
24
+ // file that has been converted to a CommonJS file using a Babel-
25
+ // compatible transform (i.e. "__esModule" has not been set), then set
26
+ // "default" to the CommonJS "module.exports" for node compatibility.
27
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
28
+ mod
29
+ ));
30
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
31
+
32
+ // src/extensions/math/math-block-view.tsx
33
+ var math_block_view_exports = {};
34
+ __export(math_block_view_exports, {
35
+ MathBlockView: () => MathBlockView,
36
+ default: () => math_block_view_default
37
+ });
38
+ module.exports = __toCommonJS(math_block_view_exports);
39
+ var import_button = require("@kopexa/button");
40
+ var import_dialog = require("@kopexa/dialog");
41
+ var import_icons = require("@kopexa/icons");
42
+ var import_label = require("@kopexa/label");
43
+ var import_react = require("@tiptap/react");
44
+ var import_katex = __toESM(require("katex"));
45
+ var import_katex_min = require("katex/dist/katex.min.css");
46
+ var import_react2 = require("react");
47
+ var import_react_intl2 = require("react-intl");
48
+
49
+ // src/extensions/math/messages.ts
50
+ var import_react_intl = require("react-intl");
51
+ var messages = (0, import_react_intl.defineMessages)({
52
+ title: {
53
+ id: "editor.math.title",
54
+ defaultMessage: "Formula",
55
+ description: "Math block title"
56
+ },
57
+ edit: {
58
+ id: "editor.math.edit",
59
+ defaultMessage: "Edit",
60
+ description: "Edit button label"
61
+ },
62
+ preview: {
63
+ id: "editor.math.preview",
64
+ defaultMessage: "Preview",
65
+ description: "Preview section label"
66
+ },
67
+ latex_input: {
68
+ id: "editor.math.latex_input",
69
+ defaultMessage: "LaTeX",
70
+ description: "LaTeX input label"
71
+ },
72
+ latex_placeholder: {
73
+ id: "editor.math.latex_placeholder",
74
+ defaultMessage: "Enter LaTeX formula...",
75
+ description: "LaTeX input placeholder"
76
+ },
77
+ invalid_latex: {
78
+ id: "editor.math.invalid_latex",
79
+ defaultMessage: "Invalid LaTeX syntax",
80
+ description: "Error message for invalid LaTeX"
81
+ },
82
+ empty_formula: {
83
+ id: "editor.math.empty_formula",
84
+ defaultMessage: "Click to add formula",
85
+ description: "Placeholder for empty formula"
86
+ },
87
+ save: {
88
+ id: "editor.math.save",
89
+ defaultMessage: "Save",
90
+ description: "Save button label"
91
+ },
92
+ cancel: {
93
+ id: "editor.math.cancel",
94
+ defaultMessage: "Cancel",
95
+ description: "Cancel button label"
96
+ }
97
+ });
98
+
99
+ // src/extensions/math/math-block-view.tsx
100
+ var import_jsx_runtime = require("react/jsx-runtime");
101
+ function MathBlockView({ editor, node, getPos }) {
102
+ const intl = (0, import_react_intl2.useIntl)();
103
+ const attrs = node.attrs;
104
+ const { latex = "" } = attrs;
105
+ const isEditable = (0, import_react.useEditorState)({
106
+ editor,
107
+ selector: ({ editor: e }) => {
108
+ var _a;
109
+ return (_a = e == null ? void 0 : e.isEditable) != null ? _a : false;
110
+ }
111
+ });
112
+ const [isOpen, setIsOpen] = (0, import_react2.useState)(false);
113
+ const [localLatex, setLocalLatex] = (0, import_react2.useState)(latex);
114
+ const [error, setError] = (0, import_react2.useState)(null);
115
+ (0, import_react2.useEffect)(() => {
116
+ if (isOpen) {
117
+ setLocalLatex(latex);
118
+ setError(null);
119
+ }
120
+ }, [isOpen, latex]);
121
+ const renderedHtml = (0, import_react2.useMemo)(() => {
122
+ if (!latex) return null;
123
+ try {
124
+ return import_katex.default.renderToString(latex, {
125
+ throwOnError: false,
126
+ displayMode: true,
127
+ output: "html"
128
+ });
129
+ } catch {
130
+ return null;
131
+ }
132
+ }, [latex]);
133
+ const previewHtml = (0, import_react2.useMemo)(() => {
134
+ if (!localLatex) return null;
135
+ try {
136
+ setError(null);
137
+ return import_katex.default.renderToString(localLatex, {
138
+ throwOnError: true,
139
+ displayMode: true,
140
+ output: "html"
141
+ });
142
+ } catch (_e) {
143
+ setError(intl.formatMessage(messages.invalid_latex));
144
+ return null;
145
+ }
146
+ }, [localLatex, intl]);
147
+ const handleSave = (0, import_react2.useCallback)(() => {
148
+ const pos = getPos();
149
+ if (pos === void 0) return;
150
+ editor.view.dispatch(
151
+ editor.state.tr.setNodeMarkup(pos, void 0, { latex: localLatex })
152
+ );
153
+ setIsOpen(false);
154
+ }, [editor, localLatex, getPos]);
155
+ const handleCancel = (0, import_react2.useCallback)(() => {
156
+ setLocalLatex(latex);
157
+ setError(null);
158
+ setIsOpen(false);
159
+ }, [latex]);
160
+ const handleOpenEditor = (0, import_react2.useCallback)(
161
+ (e) => {
162
+ e.stopPropagation();
163
+ e.preventDefault();
164
+ if (isEditable) {
165
+ setIsOpen(true);
166
+ }
167
+ },
168
+ [isEditable]
169
+ );
170
+ const isEmpty = !latex;
171
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
172
+ import_react.NodeViewWrapper,
173
+ {
174
+ className: "my-4 relative group",
175
+ "data-type": "math-block",
176
+ "data-latex": latex,
177
+ children: [
178
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
179
+ "button",
180
+ {
181
+ type: "button",
182
+ className: "w-full flex items-center justify-center min-h-16 p-4 rounded-md border border-border bg-muted/30 cursor-pointer hover:bg-muted/50 transition-colors",
183
+ onClick: handleOpenEditor,
184
+ children: isEmpty ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-2 text-muted-foreground", children: [
185
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-lg font-serif", children: "\u2211" }),
186
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-sm", children: intl.formatMessage(messages.empty_formula) })
187
+ ] }) : renderedHtml ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
188
+ "div",
189
+ {
190
+ className: "katex-display",
191
+ dangerouslySetInnerHTML: { __html: renderedHtml }
192
+ }
193
+ ) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-destructive text-sm", children: intl.formatMessage(messages.invalid_latex) })
194
+ }
195
+ ),
196
+ isEditable && !isEmpty && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
197
+ import_button.IconButton,
198
+ {
199
+ size: "sm",
200
+ variant: "ghost",
201
+ className: "absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity",
202
+ "aria-label": intl.formatMessage(messages.edit),
203
+ onClick: handleOpenEditor,
204
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.EditIcon, { className: "size-3.5" })
205
+ }
206
+ ),
207
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.Dialog.Root, { open: isOpen, onOpenChange: setIsOpen, size: "md", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_dialog.Dialog.Content, { children: [
208
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.Dialog.Header, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.Dialog.Title, { children: intl.formatMessage(messages.title) }) }),
209
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.Dialog.Body, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-4", children: [
210
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-1.5", children: [
211
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_label.Label, { className: "text-sm", children: intl.formatMessage(messages.latex_input) }),
212
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
213
+ "textarea",
214
+ {
215
+ className: "w-full min-h-24 p-3 rounded-md border border-input bg-background font-mono text-sm resize-y focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
216
+ value: localLatex,
217
+ onChange: (e) => setLocalLatex(e.target.value),
218
+ placeholder: intl.formatMessage(messages.latex_placeholder),
219
+ spellCheck: false
220
+ }
221
+ ),
222
+ error && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs text-destructive", children: error })
223
+ ] }),
224
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-1.5", children: [
225
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_label.Label, { className: "text-sm", children: intl.formatMessage(messages.preview) }),
226
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "min-h-16 p-4 rounded-md border border-border bg-muted/30 flex items-center justify-center", children: previewHtml ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
227
+ "div",
228
+ {
229
+ className: "katex-display",
230
+ dangerouslySetInnerHTML: { __html: previewHtml }
231
+ }
232
+ ) : localLatex ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-muted-foreground text-sm", children: intl.formatMessage(messages.invalid_latex) }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-muted-foreground text-sm", children: intl.formatMessage(messages.latex_placeholder) }) })
233
+ ] })
234
+ ] }) }),
235
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_dialog.Dialog.Footer, { children: [
236
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.Button, { variant: "ghost", onClick: handleCancel, children: intl.formatMessage(messages.cancel) }),
237
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.Button, { onClick: handleSave, disabled: !!error && !!localLatex, children: intl.formatMessage(messages.save) })
238
+ ] })
239
+ ] }) })
240
+ ]
241
+ }
242
+ );
243
+ }
244
+ var math_block_view_default = MathBlockView;
245
+ // Annotate the CommonJS export names for ESM import in node:
246
+ 0 && (module.exports = {
247
+ MathBlockView
248
+ });
@@ -0,0 +1,11 @@
1
+ "use client";
2
+ "use client";
3
+ import {
4
+ MathBlockView,
5
+ math_block_view_default
6
+ } from "../../chunk-UVHVCION.mjs";
7
+ import "../../chunk-FRJX2F4T.mjs";
8
+ export {
9
+ MathBlockView,
10
+ math_block_view_default as default
11
+ };
@@ -0,0 +1,49 @@
1
+ declare const messages: {
2
+ title: {
3
+ id: string;
4
+ defaultMessage: string;
5
+ description: string;
6
+ };
7
+ edit: {
8
+ id: string;
9
+ defaultMessage: string;
10
+ description: string;
11
+ };
12
+ preview: {
13
+ id: string;
14
+ defaultMessage: string;
15
+ description: string;
16
+ };
17
+ latex_input: {
18
+ id: string;
19
+ defaultMessage: string;
20
+ description: string;
21
+ };
22
+ latex_placeholder: {
23
+ id: string;
24
+ defaultMessage: string;
25
+ description: string;
26
+ };
27
+ invalid_latex: {
28
+ id: string;
29
+ defaultMessage: string;
30
+ description: string;
31
+ };
32
+ empty_formula: {
33
+ id: string;
34
+ defaultMessage: string;
35
+ description: string;
36
+ };
37
+ save: {
38
+ id: string;
39
+ defaultMessage: string;
40
+ description: string;
41
+ };
42
+ cancel: {
43
+ id: string;
44
+ defaultMessage: string;
45
+ description: string;
46
+ };
47
+ };
48
+
49
+ export { messages };
@@ -0,0 +1,49 @@
1
+ declare const messages: {
2
+ title: {
3
+ id: string;
4
+ defaultMessage: string;
5
+ description: string;
6
+ };
7
+ edit: {
8
+ id: string;
9
+ defaultMessage: string;
10
+ description: string;
11
+ };
12
+ preview: {
13
+ id: string;
14
+ defaultMessage: string;
15
+ description: string;
16
+ };
17
+ latex_input: {
18
+ id: string;
19
+ defaultMessage: string;
20
+ description: string;
21
+ };
22
+ latex_placeholder: {
23
+ id: string;
24
+ defaultMessage: string;
25
+ description: string;
26
+ };
27
+ invalid_latex: {
28
+ id: string;
29
+ defaultMessage: string;
30
+ description: string;
31
+ };
32
+ empty_formula: {
33
+ id: string;
34
+ defaultMessage: string;
35
+ description: string;
36
+ };
37
+ save: {
38
+ id: string;
39
+ defaultMessage: string;
40
+ description: string;
41
+ };
42
+ cancel: {
43
+ id: string;
44
+ defaultMessage: string;
45
+ description: string;
46
+ };
47
+ };
48
+
49
+ export { messages };
@@ -0,0 +1,78 @@
1
+ "use client";
2
+ "use strict";
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // src/extensions/math/messages.ts
22
+ var messages_exports = {};
23
+ __export(messages_exports, {
24
+ messages: () => messages
25
+ });
26
+ module.exports = __toCommonJS(messages_exports);
27
+ var import_react_intl = require("react-intl");
28
+ var messages = (0, import_react_intl.defineMessages)({
29
+ title: {
30
+ id: "editor.math.title",
31
+ defaultMessage: "Formula",
32
+ description: "Math block title"
33
+ },
34
+ edit: {
35
+ id: "editor.math.edit",
36
+ defaultMessage: "Edit",
37
+ description: "Edit button label"
38
+ },
39
+ preview: {
40
+ id: "editor.math.preview",
41
+ defaultMessage: "Preview",
42
+ description: "Preview section label"
43
+ },
44
+ latex_input: {
45
+ id: "editor.math.latex_input",
46
+ defaultMessage: "LaTeX",
47
+ description: "LaTeX input label"
48
+ },
49
+ latex_placeholder: {
50
+ id: "editor.math.latex_placeholder",
51
+ defaultMessage: "Enter LaTeX formula...",
52
+ description: "LaTeX input placeholder"
53
+ },
54
+ invalid_latex: {
55
+ id: "editor.math.invalid_latex",
56
+ defaultMessage: "Invalid LaTeX syntax",
57
+ description: "Error message for invalid LaTeX"
58
+ },
59
+ empty_formula: {
60
+ id: "editor.math.empty_formula",
61
+ defaultMessage: "Click to add formula",
62
+ description: "Placeholder for empty formula"
63
+ },
64
+ save: {
65
+ id: "editor.math.save",
66
+ defaultMessage: "Save",
67
+ description: "Save button label"
68
+ },
69
+ cancel: {
70
+ id: "editor.math.cancel",
71
+ defaultMessage: "Cancel",
72
+ description: "Cancel button label"
73
+ }
74
+ });
75
+ // Annotate the CommonJS export names for ESM import in node:
76
+ 0 && (module.exports = {
77
+ messages
78
+ });
@@ -0,0 +1,7 @@
1
+ "use client";
2
+ import {
3
+ messages
4
+ } from "../../chunk-FRJX2F4T.mjs";
5
+ export {
6
+ messages
7
+ };
@@ -0,0 +1,53 @@
1
+ import { Node } from '@tiptap/core';
2
+
3
+ interface TocNodeAttrs {
4
+ /**
5
+ * Minimum heading level to include (1-6)
6
+ * @default 1
7
+ */
8
+ minLevel: number;
9
+ /**
10
+ * Maximum heading level to include (1-6)
11
+ * @default 6
12
+ */
13
+ maxLevel: number;
14
+ /**
15
+ * Show hierarchical numbering (1, 1.1, 1.1.1)
16
+ * @default false
17
+ */
18
+ numbered: boolean;
19
+ /**
20
+ * Visual style variant
21
+ * @default "default"
22
+ */
23
+ style: "default" | "flat" | "compact";
24
+ }
25
+ interface TocOptions {
26
+ /**
27
+ * Custom HTML attributes for the ToC wrapper element.
28
+ */
29
+ HTMLAttributes: Record<string, unknown>;
30
+ }
31
+ declare module "@tiptap/core" {
32
+ interface Commands<ReturnType> {
33
+ tableOfContentsNode: {
34
+ /**
35
+ * Insert a table of contents node
36
+ */
37
+ insertTableOfContents: () => ReturnType;
38
+ /**
39
+ * Update table of contents settings
40
+ */
41
+ updateTocSettings: (attrs: Partial<TocNodeAttrs>) => ReturnType;
42
+ };
43
+ }
44
+ }
45
+ /**
46
+ * Table of Contents Node Extension
47
+ *
48
+ * Inserts an inline table of contents that automatically updates
49
+ * based on headings in the document.
50
+ */
51
+ declare const TocNode: Node<TocOptions, any>;
52
+
53
+ export { type TocNodeAttrs as TocAttrs, TocNode, type TocNodeAttrs, type TocOptions, TocNode as default };
@@ -0,0 +1,53 @@
1
+ import { Node } from '@tiptap/core';
2
+
3
+ interface TocNodeAttrs {
4
+ /**
5
+ * Minimum heading level to include (1-6)
6
+ * @default 1
7
+ */
8
+ minLevel: number;
9
+ /**
10
+ * Maximum heading level to include (1-6)
11
+ * @default 6
12
+ */
13
+ maxLevel: number;
14
+ /**
15
+ * Show hierarchical numbering (1, 1.1, 1.1.1)
16
+ * @default false
17
+ */
18
+ numbered: boolean;
19
+ /**
20
+ * Visual style variant
21
+ * @default "default"
22
+ */
23
+ style: "default" | "flat" | "compact";
24
+ }
25
+ interface TocOptions {
26
+ /**
27
+ * Custom HTML attributes for the ToC wrapper element.
28
+ */
29
+ HTMLAttributes: Record<string, unknown>;
30
+ }
31
+ declare module "@tiptap/core" {
32
+ interface Commands<ReturnType> {
33
+ tableOfContentsNode: {
34
+ /**
35
+ * Insert a table of contents node
36
+ */
37
+ insertTableOfContents: () => ReturnType;
38
+ /**
39
+ * Update table of contents settings
40
+ */
41
+ updateTocSettings: (attrs: Partial<TocNodeAttrs>) => ReturnType;
42
+ };
43
+ }
44
+ }
45
+ /**
46
+ * Table of Contents Node Extension
47
+ *
48
+ * Inserts an inline table of contents that automatically updates
49
+ * based on headings in the document.
50
+ */
51
+ declare const TocNode: Node<TocOptions, any>;
52
+
53
+ export { type TocNodeAttrs as TocAttrs, TocNode, type TocNodeAttrs, type TocOptions, TocNode as default };