ritext 1.0.14 → 1.0.18
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/README.md +27 -28
- package/dist/chunk-2YUUKIIT.mjs +149 -0
- package/dist/chunk-7QOFJIQ3.mjs +90 -0
- package/dist/chunk-D47XME55.mjs +49 -0
- package/dist/chunk-FWCSY2DS.mjs +37 -0
- package/dist/chunk-GSHINFPO.mjs +53 -0
- package/dist/chunk-LMOTHRGQ.mjs +37 -0
- package/dist/chunk-MBF77NHS.mjs +37 -0
- package/dist/chunk-VYDH6BZE.mjs +17 -0
- package/dist/extension/bold.d.mts +8 -0
- package/dist/extension/bold.d.ts +8 -0
- package/dist/extension/bold.js +260 -0
- package/dist/extension/bold.mjs +70 -0
- package/dist/extension/clearformat.d.mts +8 -0
- package/dist/extension/clearformat.d.ts +8 -0
- package/dist/extension/clearformat.js +239 -0
- package/dist/extension/clearformat.mjs +69 -0
- package/dist/extension/font-family.d.mts +23 -0
- package/dist/extension/font-family.d.ts +23 -0
- package/dist/extension/font-family.js +388 -0
- package/dist/extension/font-family.mjs +113 -0
- package/dist/extension/font-size.d.mts +23 -0
- package/dist/extension/font-size.d.ts +23 -0
- package/dist/extension/font-size.js +386 -0
- package/dist/extension/font-size.mjs +111 -0
- package/dist/extension/heading.d.mts +23 -0
- package/dist/extension/heading.d.ts +23 -0
- package/dist/extension/heading.js +593 -0
- package/dist/extension/heading.mjs +312 -0
- package/dist/extension/history.d.mts +8 -0
- package/dist/extension/history.d.ts +8 -0
- package/dist/extension/history.js +296 -0
- package/dist/extension/history.mjs +126 -0
- package/dist/extension/italic.d.mts +8 -0
- package/dist/extension/italic.d.ts +8 -0
- package/dist/extension/italic.js +264 -0
- package/dist/extension/italic.mjs +74 -0
- package/dist/extension/strike.d.mts +8 -0
- package/dist/extension/strike.d.ts +8 -0
- package/dist/extension/strike.js +264 -0
- package/dist/extension/strike.mjs +74 -0
- package/dist/extension/subandsuperscript.d.mts +21 -0
- package/dist/extension/subandsuperscript.d.ts +21 -0
- package/dist/extension/subandsuperscript.js +452 -0
- package/dist/extension/subandsuperscript.mjs +121 -0
- package/dist/extension/subscript.d.mts +8 -0
- package/dist/extension/subscript.d.ts +8 -0
- package/dist/extension/subscript.js +264 -0
- package/dist/extension/subscript.mjs +46 -0
- package/dist/extension/superscript.d.mts +8 -0
- package/dist/extension/superscript.d.ts +8 -0
- package/dist/extension/superscript.js +264 -0
- package/dist/extension/superscript.mjs +46 -0
- package/dist/extension/underline.d.mts +8 -0
- package/dist/extension/underline.d.ts +8 -0
- package/dist/extension/underline.js +263 -0
- package/dist/extension/underline.mjs +73 -0
- package/dist/index.css +471 -5
- package/dist/index.d.mts +6 -32
- package/dist/index.d.ts +6 -32
- package/dist/index.js +26 -538
- package/dist/index.mjs +31 -549
- package/dist/tiptap-ext.type-DrneAC5G.d.mts +39 -0
- package/dist/tiptap-ext.type-DrneAC5G.d.ts +39 -0
- package/package.json +52 -26
package/dist/index.js
CHANGED
|
@@ -1,39 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __create = Object.create;
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
|
-
var __defProps = Object.defineProperties;
|
|
5
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
7
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
9
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
10
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
11
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
12
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
13
|
-
var __spreadValues = (a, b) => {
|
|
14
|
-
for (var prop in b || (b = {}))
|
|
15
|
-
if (__hasOwnProp.call(b, prop))
|
|
16
|
-
__defNormalProp(a, prop, b[prop]);
|
|
17
|
-
if (__getOwnPropSymbols)
|
|
18
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
19
|
-
if (__propIsEnum.call(b, prop))
|
|
20
|
-
__defNormalProp(a, prop, b[prop]);
|
|
21
|
-
}
|
|
22
|
-
return a;
|
|
23
|
-
};
|
|
24
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
25
|
-
var __objRest = (source, exclude) => {
|
|
26
|
-
var target = {};
|
|
27
|
-
for (var prop in source)
|
|
28
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
29
|
-
target[prop] = source[prop];
|
|
30
|
-
if (source != null && __getOwnPropSymbols)
|
|
31
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
32
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
33
|
-
target[prop] = source[prop];
|
|
34
|
-
}
|
|
35
|
-
return target;
|
|
36
|
-
};
|
|
37
8
|
var __export = (target, all) => {
|
|
38
9
|
for (var name in all)
|
|
39
10
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -57,19 +28,13 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
57
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
58
29
|
|
|
59
30
|
// src/index.ts
|
|
60
|
-
var
|
|
61
|
-
__export(
|
|
62
|
-
Bold: () => Bold,
|
|
31
|
+
var src_exports = {};
|
|
32
|
+
__export(src_exports, {
|
|
63
33
|
Content: () => Content_default,
|
|
64
34
|
Editor: () => Editor_default,
|
|
65
|
-
|
|
66
|
-
Strike: () => Strike,
|
|
67
|
-
Subscript: () => Subscript,
|
|
68
|
-
Superscript: () => Superscript,
|
|
69
|
-
Toolbar: () => Toolbar_default,
|
|
70
|
-
Underline: () => Underline
|
|
35
|
+
Toolbar: () => Toolbar_default
|
|
71
36
|
});
|
|
72
|
-
module.exports = __toCommonJS(
|
|
37
|
+
module.exports = __toCommonJS(src_exports);
|
|
73
38
|
|
|
74
39
|
// src/lib/Editor.tsx
|
|
75
40
|
var import_react2 = require("react");
|
|
@@ -107,17 +72,32 @@ var Editor_default = Editor;
|
|
|
107
72
|
var React = __toESM(require("react"));
|
|
108
73
|
var import_tailwind_merge = require("tailwind-merge");
|
|
109
74
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
110
|
-
var Toolbar = ({ className, buttonClassName }) => {
|
|
75
|
+
var Toolbar = ({ className, buttonClassName, dropdownContainerClassName, dropdownItemClassName }) => {
|
|
111
76
|
const { editor } = useEditor();
|
|
112
77
|
if (!editor) return null;
|
|
113
78
|
const entries = editor.extensionManager.extensions.map((ext) => {
|
|
114
|
-
var _a
|
|
79
|
+
var _a;
|
|
115
80
|
const anyExt = ext;
|
|
116
|
-
const renderButton = (
|
|
117
|
-
|
|
81
|
+
const renderButton = (
|
|
82
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
83
|
+
(_a = anyExt.options) == null ? void 0 : _a.component
|
|
84
|
+
);
|
|
85
|
+
return renderButton ? {
|
|
86
|
+
name: anyExt.name,
|
|
87
|
+
renderButton,
|
|
88
|
+
options: anyExt.options,
|
|
89
|
+
buttonClassName: anyExt.buttonClassName,
|
|
90
|
+
dropdownContainerClassName: anyExt.dropdownContainerClassName,
|
|
91
|
+
dropdownItemClassName: anyExt.dropdownItemClassName
|
|
92
|
+
} : null;
|
|
118
93
|
}).filter(Boolean);
|
|
119
|
-
|
|
120
|
-
|
|
94
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: (0, import_tailwind_merge.twMerge)("flex gap-x-1", className), children: entries.map(({ name, renderButton, options }) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(React.Fragment, { children: renderButton({
|
|
95
|
+
editor,
|
|
96
|
+
options,
|
|
97
|
+
buttonClassName: buttonClassName || "",
|
|
98
|
+
dropdownContainerClassName: dropdownContainerClassName || "",
|
|
99
|
+
dropdownItemClassName: dropdownItemClassName || ""
|
|
100
|
+
}) }, name)) });
|
|
121
101
|
};
|
|
122
102
|
var Toolbar_default = Toolbar;
|
|
123
103
|
|
|
@@ -130,501 +110,9 @@ var Content = ({ className }) => {
|
|
|
130
110
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react4.EditorContent, { editor, className: (0, import_tailwind_merge2.twMerge)("focus:outline-none [&_.tiptap]:focus:outline-none [&_.tiptap]:min-h-[200px] [&_.tiptap]:p-[10px_20px]", className) });
|
|
131
111
|
};
|
|
132
112
|
var Content_default = Content;
|
|
133
|
-
|
|
134
|
-
// src/lib/extensions/Bold.tsx
|
|
135
|
-
var import_extension_bold = __toESM(require("@tiptap/extension-bold"));
|
|
136
|
-
|
|
137
|
-
// src/lib/icon/BoldIcon.tsx
|
|
138
|
-
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
139
|
-
var BoldIcon = (_a) => {
|
|
140
|
-
var _b = _a, { size = 17, className } = _b, props = __objRest(_b, ["size", "className"]);
|
|
141
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
142
|
-
"svg",
|
|
143
|
-
__spreadProps(__spreadValues({
|
|
144
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
145
|
-
viewBox: "0 0 24 24",
|
|
146
|
-
fill: "none",
|
|
147
|
-
stroke: "currentColor",
|
|
148
|
-
strokeWidth: 2,
|
|
149
|
-
strokeLinecap: "round",
|
|
150
|
-
strokeLinejoin: "round",
|
|
151
|
-
width: size,
|
|
152
|
-
height: size,
|
|
153
|
-
className
|
|
154
|
-
}, props), {
|
|
155
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8" })
|
|
156
|
-
})
|
|
157
|
-
);
|
|
158
|
-
};
|
|
159
|
-
var BoldIcon_default = BoldIcon;
|
|
160
|
-
|
|
161
|
-
// src/lib/components/ButtonComponent.tsx
|
|
162
|
-
var import_tailwind_merge4 = require("tailwind-merge");
|
|
163
|
-
|
|
164
|
-
// src/lib/components/_com/Tooltip.tsx
|
|
165
|
-
var import_react5 = require("react");
|
|
166
|
-
var import_react6 = require("@floating-ui/react");
|
|
167
|
-
var import_react7 = require("motion/react");
|
|
168
|
-
var import_tailwind_merge3 = require("tailwind-merge");
|
|
169
|
-
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
170
|
-
var Tooltip = ({ placement = "top", children, content, className }) => {
|
|
171
|
-
const [open, setOpen] = (0, import_react5.useState)(false);
|
|
172
|
-
const { x, y, refs, strategy, context, placement: resolvedPlacement } = (0, import_react6.useFloating)({
|
|
173
|
-
open,
|
|
174
|
-
onOpenChange: setOpen,
|
|
175
|
-
placement,
|
|
176
|
-
middleware: [(0, import_react6.offset)(8), (0, import_react6.flip)(), (0, import_react6.shift)({ padding: 8 })],
|
|
177
|
-
whileElementsMounted: import_react6.autoUpdate
|
|
178
|
-
});
|
|
179
|
-
const hover = (0, import_react6.useHover)(context);
|
|
180
|
-
const dismiss = (0, import_react6.useDismiss)(context);
|
|
181
|
-
const { getReferenceProps, getFloatingProps } = (0, import_react6.useInteractions)([hover, dismiss]);
|
|
182
|
-
const id = (0, import_react5.useId)();
|
|
183
|
-
function mergeRefs(...refsToMerge) {
|
|
184
|
-
return (node) => {
|
|
185
|
-
for (const r of refsToMerge) {
|
|
186
|
-
if (!r) continue;
|
|
187
|
-
if (typeof r === "function") r(node);
|
|
188
|
-
else r.current = node;
|
|
189
|
-
}
|
|
190
|
-
};
|
|
191
|
-
}
|
|
192
|
-
const side = resolvedPlacement.split("-")[0];
|
|
193
|
-
const enterOffset = 6;
|
|
194
|
-
const getInitial = () => {
|
|
195
|
-
switch (side) {
|
|
196
|
-
case "top":
|
|
197
|
-
return { opacity: 0, y: enterOffset };
|
|
198
|
-
case "bottom":
|
|
199
|
-
return { opacity: 0, y: -enterOffset };
|
|
200
|
-
case "left":
|
|
201
|
-
return { opacity: 0, x: enterOffset };
|
|
202
|
-
case "right":
|
|
203
|
-
return { opacity: 0, x: -enterOffset };
|
|
204
|
-
default:
|
|
205
|
-
return { opacity: 0 };
|
|
206
|
-
}
|
|
207
|
-
};
|
|
208
|
-
const getExit = () => __spreadProps(__spreadValues({}, getInitial()), { opacity: 0 });
|
|
209
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_react5.Fragment, { children: [
|
|
210
|
-
(0, import_react5.isValidElement)(children) ? (0, import_react5.cloneElement)(children, __spreadProps(__spreadValues({}, getReferenceProps({
|
|
211
|
-
onFocus: () => setOpen(true),
|
|
212
|
-
onBlur: () => setOpen(false),
|
|
213
|
-
"aria-describedby": open ? id : void 0
|
|
214
|
-
})), {
|
|
215
|
-
ref: mergeRefs(children.ref, refs.setReference)
|
|
216
|
-
})) : children,
|
|
217
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react6.FloatingPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react7.AnimatePresence, { children: open && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
218
|
-
import_react7.motion.div,
|
|
219
|
-
__spreadProps(__spreadValues({
|
|
220
|
-
ref: refs.setFloating
|
|
221
|
-
}, getFloatingProps({
|
|
222
|
-
role: "tooltip",
|
|
223
|
-
id,
|
|
224
|
-
style: {
|
|
225
|
-
position: strategy,
|
|
226
|
-
top: y != null ? y : 0,
|
|
227
|
-
left: x != null ? x : 0,
|
|
228
|
-
pointerEvents: "none"
|
|
229
|
-
}
|
|
230
|
-
})), {
|
|
231
|
-
initial: getInitial(),
|
|
232
|
-
animate: { opacity: 1, x: 0, y: 0, scale: 1 },
|
|
233
|
-
exit: getExit(),
|
|
234
|
-
transition: { type: "spring", stiffness: 420, damping: 30, mass: 0.6 },
|
|
235
|
-
className: (0, import_tailwind_merge3.twMerge)("bg-white border border-solid border-gray-200/50 py-1 px-3 rounded-lg text-sm shadow-lg shadow-gray-50 text-center", className),
|
|
236
|
-
children: content
|
|
237
|
-
}),
|
|
238
|
-
"tooltip"
|
|
239
|
-
) }) })
|
|
240
|
-
] });
|
|
241
|
-
};
|
|
242
|
-
var Tooltip_default = Tooltip;
|
|
243
|
-
|
|
244
|
-
// src/lib/components/ButtonComponent.tsx
|
|
245
|
-
var import_react8 = require("@tiptap/react");
|
|
246
|
-
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
247
|
-
var ButtonComponent = ({ className, activeClassName, icon, style, tooltip = true, tooltipClassName, tooltipPlacement, _extName, _internalIcon, _tooltipContent, _onToggle, _interShortcut, _buttonClassName }) => {
|
|
248
|
-
const { editor } = useEditor();
|
|
249
|
-
const editorState = (0, import_react8.useEditorState)({
|
|
250
|
-
editor,
|
|
251
|
-
selector: ({ editor: editor2 }) => ({ isActive: (editor2 == null ? void 0 : editor2.isActive(_extName)) || false })
|
|
252
|
-
});
|
|
253
|
-
const tooltipContent = /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("p", { children: [
|
|
254
|
-
typeof tooltip === "string" ? tooltip : _tooltipContent,
|
|
255
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("br", {}),
|
|
256
|
-
_interShortcut
|
|
257
|
-
] });
|
|
258
|
-
const btn = /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
259
|
-
"button",
|
|
260
|
-
{
|
|
261
|
-
onClick: _onToggle,
|
|
262
|
-
className: (0, import_tailwind_merge4.twMerge)(
|
|
263
|
-
"p-1.5 rounded-md",
|
|
264
|
-
_buttonClassName,
|
|
265
|
-
(editorState == null ? void 0 : editorState.isActive) ? "bg-gray-200" : "hover:bg-gray-100",
|
|
266
|
-
className,
|
|
267
|
-
(editorState == null ? void 0 : editorState.isActive) ? activeClassName : "hover:bg-gray-100"
|
|
268
|
-
),
|
|
269
|
-
style,
|
|
270
|
-
children: icon != null ? icon : _internalIcon
|
|
271
|
-
}
|
|
272
|
-
);
|
|
273
|
-
if (tooltip === false) return btn;
|
|
274
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
275
|
-
Tooltip_default,
|
|
276
|
-
{
|
|
277
|
-
content: tooltipContent,
|
|
278
|
-
className: tooltipClassName,
|
|
279
|
-
placement: tooltipPlacement,
|
|
280
|
-
children: btn
|
|
281
|
-
}
|
|
282
|
-
);
|
|
283
|
-
};
|
|
284
|
-
var ButtonComponent_default = ButtonComponent;
|
|
285
|
-
|
|
286
|
-
// src/lib/extensions/Bold.tsx
|
|
287
|
-
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
288
|
-
var Bold = import_extension_bold.default.extend({
|
|
289
|
-
addOptions() {
|
|
290
|
-
var _a;
|
|
291
|
-
return __spreadProps(__spreadValues({}, (_a = this.parent) == null ? void 0 : _a.call(this)), {
|
|
292
|
-
button: ({ editor, options, buttonClassName }) => {
|
|
293
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
294
|
-
ButtonComponent_default,
|
|
295
|
-
{
|
|
296
|
-
className: options.className,
|
|
297
|
-
icon: options.icon,
|
|
298
|
-
style: options.style,
|
|
299
|
-
activeClassName: options.activeClassName,
|
|
300
|
-
tooltip: options.tooltip,
|
|
301
|
-
tooltipClassName: options.tooltipClassName,
|
|
302
|
-
tooltipPlacement: options.tooltipPlacement,
|
|
303
|
-
_internalIcon: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(BoldIcon_default, {}),
|
|
304
|
-
_extName: "bold",
|
|
305
|
-
_onToggle: () => editor.chain().focus().toggleBold().run(),
|
|
306
|
-
_interShortcut: "\u2318 + B",
|
|
307
|
-
_tooltipContent: "Bold",
|
|
308
|
-
_buttonClassName: buttonClassName
|
|
309
|
-
}
|
|
310
|
-
);
|
|
311
|
-
}
|
|
312
|
-
});
|
|
313
|
-
}
|
|
314
|
-
});
|
|
315
|
-
|
|
316
|
-
// src/lib/extensions/Italic.tsx
|
|
317
|
-
var import_extension_italic = __toESM(require("@tiptap/extension-italic"));
|
|
318
|
-
|
|
319
|
-
// src/lib/icon/ItalicIcon.tsx
|
|
320
|
-
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
321
|
-
var ItalicIcon = (_a) => {
|
|
322
|
-
var _b = _a, { size = 17, className } = _b, props = __objRest(_b, ["size", "className"]);
|
|
323
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
324
|
-
"svg",
|
|
325
|
-
__spreadProps(__spreadValues({
|
|
326
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
327
|
-
viewBox: "0 0 24 24",
|
|
328
|
-
fill: "none",
|
|
329
|
-
stroke: "currentColor",
|
|
330
|
-
strokeWidth: 2,
|
|
331
|
-
strokeLinecap: "round",
|
|
332
|
-
strokeLinejoin: "round",
|
|
333
|
-
width: size,
|
|
334
|
-
height: size,
|
|
335
|
-
className
|
|
336
|
-
}, props), {
|
|
337
|
-
children: [
|
|
338
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("line", { x1: "19", x2: "10", y1: "4", y2: "4" }),
|
|
339
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("line", { x1: "14", x2: "5", y1: "20", y2: "20" }),
|
|
340
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("line", { x1: "15", x2: "9", y1: "4", y2: "20" })
|
|
341
|
-
]
|
|
342
|
-
})
|
|
343
|
-
);
|
|
344
|
-
};
|
|
345
|
-
var ItalicIcon_default = ItalicIcon;
|
|
346
|
-
|
|
347
|
-
// src/lib/extensions/Italic.tsx
|
|
348
|
-
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
349
|
-
var Italic = import_extension_italic.default.extend({
|
|
350
|
-
addOptions() {
|
|
351
|
-
var _a;
|
|
352
|
-
return __spreadProps(__spreadValues({}, (_a = this.parent) == null ? void 0 : _a.call(this)), {
|
|
353
|
-
button: ({ options, editor, buttonClassName }) => {
|
|
354
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
355
|
-
ButtonComponent_default,
|
|
356
|
-
{
|
|
357
|
-
className: options.className,
|
|
358
|
-
icon: options.icon,
|
|
359
|
-
style: options.style,
|
|
360
|
-
activeClassName: options.activeClassName,
|
|
361
|
-
tooltip: options.tooltip,
|
|
362
|
-
tooltipClassName: options.tooltipClassName,
|
|
363
|
-
tooltipPlacement: options.tooltipPlacement,
|
|
364
|
-
_internalIcon: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ItalicIcon_default, {}),
|
|
365
|
-
_extName: "italic",
|
|
366
|
-
_onToggle: () => editor.chain().focus().toggleItalic().run(),
|
|
367
|
-
_interShortcut: "\u2318 + I",
|
|
368
|
-
_tooltipContent: "Italic",
|
|
369
|
-
_buttonClassName: buttonClassName
|
|
370
|
-
}
|
|
371
|
-
);
|
|
372
|
-
}
|
|
373
|
-
});
|
|
374
|
-
}
|
|
375
|
-
});
|
|
376
|
-
|
|
377
|
-
// src/lib/extensions/Underline.tsx
|
|
378
|
-
var import_extension_underline = __toESM(require("@tiptap/extension-underline"));
|
|
379
|
-
|
|
380
|
-
// src/lib/icon/UnderIcon.tsx
|
|
381
|
-
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
382
|
-
var UnderIcon = (_a) => {
|
|
383
|
-
var _b = _a, { size = 17, className } = _b, props = __objRest(_b, ["size", "className"]);
|
|
384
|
-
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
385
|
-
"svg",
|
|
386
|
-
__spreadProps(__spreadValues({
|
|
387
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
388
|
-
viewBox: "0 0 24 24",
|
|
389
|
-
fill: "none",
|
|
390
|
-
stroke: "currentColor",
|
|
391
|
-
strokeWidth: 2,
|
|
392
|
-
strokeLinecap: "round",
|
|
393
|
-
strokeLinejoin: "round",
|
|
394
|
-
width: size,
|
|
395
|
-
height: size,
|
|
396
|
-
className
|
|
397
|
-
}, props), {
|
|
398
|
-
children: [
|
|
399
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("path", { d: "M6 4v6a6 6 0 0 0 12 0V4" }),
|
|
400
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("line", { x1: "4", x2: "20", y1: "20", y2: "20" })
|
|
401
|
-
]
|
|
402
|
-
})
|
|
403
|
-
);
|
|
404
|
-
};
|
|
405
|
-
var UnderIcon_default = UnderIcon;
|
|
406
|
-
|
|
407
|
-
// src/lib/extensions/Underline.tsx
|
|
408
|
-
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
409
|
-
var Underline = import_extension_underline.default.extend({
|
|
410
|
-
addOptions() {
|
|
411
|
-
var _a;
|
|
412
|
-
return __spreadProps(__spreadValues({}, (_a = this.parent) == null ? void 0 : _a.call(this)), {
|
|
413
|
-
button: ({ options, editor, buttonClassName }) => {
|
|
414
|
-
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
415
|
-
ButtonComponent_default,
|
|
416
|
-
{
|
|
417
|
-
className: options.className,
|
|
418
|
-
icon: options.icon,
|
|
419
|
-
style: options.style,
|
|
420
|
-
activeClassName: options.activeClassName,
|
|
421
|
-
tooltip: options.tooltip,
|
|
422
|
-
tooltipClassName: options.tooltipClassName,
|
|
423
|
-
tooltipPlacement: options.tooltipPlacement,
|
|
424
|
-
_internalIcon: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(UnderIcon_default, {}),
|
|
425
|
-
_extName: "underline",
|
|
426
|
-
_onToggle: () => editor.chain().focus().toggleUnderline().run(),
|
|
427
|
-
_interShortcut: "\u2318 + U",
|
|
428
|
-
_tooltipContent: "Underline",
|
|
429
|
-
_buttonClassName: buttonClassName
|
|
430
|
-
}
|
|
431
|
-
);
|
|
432
|
-
}
|
|
433
|
-
});
|
|
434
|
-
}
|
|
435
|
-
});
|
|
436
|
-
|
|
437
|
-
// src/lib/extensions/Strike.tsx
|
|
438
|
-
var import_extension_strike = __toESM(require("@tiptap/extension-strike"));
|
|
439
|
-
|
|
440
|
-
// src/lib/icon/StrikeIcon.tsx
|
|
441
|
-
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
442
|
-
var StrikeIcon = (_a) => {
|
|
443
|
-
var _b = _a, { size = 17, className } = _b, props = __objRest(_b, ["size", "className"]);
|
|
444
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
445
|
-
"svg",
|
|
446
|
-
__spreadProps(__spreadValues({
|
|
447
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
448
|
-
viewBox: "0 0 24 24",
|
|
449
|
-
fill: "none",
|
|
450
|
-
stroke: "currentColor",
|
|
451
|
-
strokeWidth: 2,
|
|
452
|
-
strokeLinecap: "round",
|
|
453
|
-
strokeLinejoin: "round",
|
|
454
|
-
width: size,
|
|
455
|
-
height: size,
|
|
456
|
-
className
|
|
457
|
-
}, props), {
|
|
458
|
-
children: [
|
|
459
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("path", { d: "M16 4H9a3 3 0 0 0-2.83 4" }),
|
|
460
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("path", { d: "M14 12a4 4 0 0 1 0 8H6" }),
|
|
461
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("line", { x1: "4", x2: "20", y1: "12", y2: "12" })
|
|
462
|
-
]
|
|
463
|
-
})
|
|
464
|
-
);
|
|
465
|
-
};
|
|
466
|
-
var StrikeIcon_default = StrikeIcon;
|
|
467
|
-
|
|
468
|
-
// src/lib/extensions/Strike.tsx
|
|
469
|
-
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
470
|
-
var Strike = import_extension_strike.default.extend({
|
|
471
|
-
addOptions() {
|
|
472
|
-
var _a;
|
|
473
|
-
return __spreadProps(__spreadValues({}, (_a = this.parent) == null ? void 0 : _a.call(this)), {
|
|
474
|
-
button: ({ options, editor, buttonClassName }) => {
|
|
475
|
-
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
476
|
-
ButtonComponent_default,
|
|
477
|
-
{
|
|
478
|
-
className: options.className,
|
|
479
|
-
icon: options.icon,
|
|
480
|
-
style: options.style,
|
|
481
|
-
activeClassName: options.activeClassName,
|
|
482
|
-
tooltip: options.tooltip,
|
|
483
|
-
tooltipClassName: options.tooltipClassName,
|
|
484
|
-
tooltipPlacement: options.tooltipPlacement,
|
|
485
|
-
_internalIcon: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(StrikeIcon_default, {}),
|
|
486
|
-
_extName: "strike",
|
|
487
|
-
_onToggle: () => editor.chain().focus().toggleStrike().run(),
|
|
488
|
-
_interShortcut: "\u2318 \u21E7 S",
|
|
489
|
-
_tooltipContent: "Strike",
|
|
490
|
-
_buttonClassName: buttonClassName
|
|
491
|
-
}
|
|
492
|
-
);
|
|
493
|
-
}
|
|
494
|
-
});
|
|
495
|
-
}
|
|
496
|
-
});
|
|
497
|
-
|
|
498
|
-
// src/lib/extensions/Subscript.tsx
|
|
499
|
-
var import_extension_subscript = __toESM(require("@tiptap/extension-subscript"));
|
|
500
|
-
|
|
501
|
-
// src/lib/icon/SubIcon.tsx
|
|
502
|
-
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
503
|
-
var SubIcon = (_a) => {
|
|
504
|
-
var _b = _a, { size = 17, className } = _b, props = __objRest(_b, ["size", "className"]);
|
|
505
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
506
|
-
"svg",
|
|
507
|
-
__spreadProps(__spreadValues({
|
|
508
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
509
|
-
viewBox: "0 0 24 24",
|
|
510
|
-
fill: "none",
|
|
511
|
-
stroke: "currentColor",
|
|
512
|
-
strokeWidth: 2,
|
|
513
|
-
strokeLinecap: "round",
|
|
514
|
-
strokeLinejoin: "round",
|
|
515
|
-
width: size,
|
|
516
|
-
height: size,
|
|
517
|
-
className
|
|
518
|
-
}, props), {
|
|
519
|
-
children: [
|
|
520
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("path", { d: "m4 5 8 8" }),
|
|
521
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("path", { d: "m12 5-8 8" }),
|
|
522
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("path", { d: "M20 19h-4c0-1.5.44-2 1.5-2.5S20 15.33 20 14c0-.47-.17-.93-.48-1.29a2.11 2.11 0 0 0-2.62-.44c-.42.24-.74.62-.9 1.07" })
|
|
523
|
-
]
|
|
524
|
-
})
|
|
525
|
-
);
|
|
526
|
-
};
|
|
527
|
-
var SubIcon_default = SubIcon;
|
|
528
|
-
|
|
529
|
-
// src/lib/extensions/Subscript.tsx
|
|
530
|
-
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
531
|
-
var Subscript = import_extension_subscript.default.extend({
|
|
532
|
-
addOptions() {
|
|
533
|
-
var _a;
|
|
534
|
-
return __spreadProps(__spreadValues({}, (_a = this.parent) == null ? void 0 : _a.call(this)), {
|
|
535
|
-
button: ({ options, editor, buttonClassName }) => {
|
|
536
|
-
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
537
|
-
ButtonComponent_default,
|
|
538
|
-
{
|
|
539
|
-
className: options.className,
|
|
540
|
-
icon: options.icon,
|
|
541
|
-
style: options.style,
|
|
542
|
-
activeClassName: options.activeClassName,
|
|
543
|
-
tooltip: options.tooltip,
|
|
544
|
-
tooltipClassName: options.tooltipClassName,
|
|
545
|
-
tooltipPlacement: options.tooltipPlacement,
|
|
546
|
-
_internalIcon: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SubIcon_default, {}),
|
|
547
|
-
_extName: "subscript",
|
|
548
|
-
_onToggle: () => editor.chain().focus().toggleSubscript().run(),
|
|
549
|
-
_interShortcut: "\u2318 + ,",
|
|
550
|
-
_tooltipContent: "Subscript",
|
|
551
|
-
_buttonClassName: buttonClassName
|
|
552
|
-
}
|
|
553
|
-
);
|
|
554
|
-
}
|
|
555
|
-
});
|
|
556
|
-
}
|
|
557
|
-
});
|
|
558
|
-
|
|
559
|
-
// src/lib/extensions/Superscript.tsx
|
|
560
|
-
var import_extension_superscript = __toESM(require("@tiptap/extension-superscript"));
|
|
561
|
-
|
|
562
|
-
// src/lib/icon/SupIcon.tsx
|
|
563
|
-
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
564
|
-
var SupIcon = (_a) => {
|
|
565
|
-
var _b = _a, { size = 17, className } = _b, props = __objRest(_b, ["size", "className"]);
|
|
566
|
-
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
567
|
-
"svg",
|
|
568
|
-
__spreadProps(__spreadValues({
|
|
569
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
570
|
-
viewBox: "0 0 24 24",
|
|
571
|
-
fill: "none",
|
|
572
|
-
stroke: "currentColor",
|
|
573
|
-
strokeWidth: 2,
|
|
574
|
-
strokeLinecap: "round",
|
|
575
|
-
strokeLinejoin: "round",
|
|
576
|
-
width: size,
|
|
577
|
-
height: size,
|
|
578
|
-
className
|
|
579
|
-
}, props), {
|
|
580
|
-
children: [
|
|
581
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("path", { d: "m4 19 8-8" }),
|
|
582
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("path", { d: "m12 19-8-8" }),
|
|
583
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("path", { d: "M20 12h-4c0-1.5.442-2 1.5-2.5S20 8.334 20 7.002c0-.472-.17-.93-.484-1.29a2.105 2.105 0 0 0-2.617-.436c-.42.239-.738.614-.899 1.06" })
|
|
584
|
-
]
|
|
585
|
-
})
|
|
586
|
-
);
|
|
587
|
-
};
|
|
588
|
-
var SupIcon_default = SupIcon;
|
|
589
|
-
|
|
590
|
-
// src/lib/extensions/Superscript.tsx
|
|
591
|
-
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
592
|
-
var Superscript = import_extension_superscript.default.extend({
|
|
593
|
-
addOptions() {
|
|
594
|
-
var _a;
|
|
595
|
-
return __spreadProps(__spreadValues({}, (_a = this.parent) == null ? void 0 : _a.call(this)), {
|
|
596
|
-
button: ({ options, editor, buttonClassName }) => {
|
|
597
|
-
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
598
|
-
ButtonComponent_default,
|
|
599
|
-
{
|
|
600
|
-
className: options.className,
|
|
601
|
-
icon: options.icon,
|
|
602
|
-
style: options.style,
|
|
603
|
-
activeClassName: options.activeClassName,
|
|
604
|
-
tooltip: options.tooltip,
|
|
605
|
-
tooltipClassName: options.tooltipClassName,
|
|
606
|
-
tooltipPlacement: options.tooltipPlacement,
|
|
607
|
-
_internalIcon: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(SupIcon_default, {}),
|
|
608
|
-
_extName: "superscript",
|
|
609
|
-
_onToggle: () => editor.chain().focus().toggleSuperscript().run(),
|
|
610
|
-
_interShortcut: "\u2318 + ,",
|
|
611
|
-
_tooltipContent: "Superscript",
|
|
612
|
-
_buttonClassName: buttonClassName
|
|
613
|
-
}
|
|
614
|
-
);
|
|
615
|
-
}
|
|
616
|
-
});
|
|
617
|
-
}
|
|
618
|
-
});
|
|
619
113
|
// Annotate the CommonJS export names for ESM import in node:
|
|
620
114
|
0 && (module.exports = {
|
|
621
|
-
Bold,
|
|
622
115
|
Content,
|
|
623
116
|
Editor,
|
|
624
|
-
|
|
625
|
-
Strike,
|
|
626
|
-
Subscript,
|
|
627
|
-
Superscript,
|
|
628
|
-
Toolbar,
|
|
629
|
-
Underline
|
|
117
|
+
Toolbar
|
|
630
118
|
});
|