ritext 1.0.19 → 1.0.25

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 (133) hide show
  1. package/LICENSE +57 -0
  2. package/README.md +15 -41
  3. package/dist/chunk-EN4BPI7N.mjs +1213 -0
  4. package/dist/chunk-FJQ4FZRS.mjs +98 -0
  5. package/dist/chunk-M4ORWR74.mjs +31 -0
  6. package/dist/chunk-SJFT7WNM.mjs +38 -0
  7. package/dist/chunk-W367UGID.mjs +55 -0
  8. package/dist/{chunk-FWCSY2DS.mjs → chunk-WNQUEZJF.mjs} +22 -1
  9. package/dist/{chunk-D47XME55.mjs → chunk-WXCHG3NQ.mjs} +8 -2
  10. package/dist/chunk-WZKGD3DD.mjs +231 -0
  11. package/dist/extension/backgroundcolor.d.mts +16 -0
  12. package/dist/extension/backgroundcolor.d.ts +16 -0
  13. package/dist/extension/backgroundcolor.js +668 -0
  14. package/dist/extension/backgroundcolor.mjs +107 -0
  15. package/dist/extension/base.d.mts +6 -0
  16. package/dist/extension/base.d.ts +6 -0
  17. package/dist/extension/base.js +65 -0
  18. package/dist/extension/base.mjs +22 -0
  19. package/dist/extension/blockquote.d.mts +10 -0
  20. package/dist/extension/blockquote.d.ts +10 -0
  21. package/dist/extension/blockquote.js +239 -0
  22. package/dist/extension/blockquote.mjs +46 -0
  23. package/dist/extension/bold.d.mts +7 -2
  24. package/dist/extension/bold.d.ts +7 -2
  25. package/dist/extension/bold.js +22 -45
  26. package/dist/extension/bold.mjs +13 -35
  27. package/dist/extension/bulletlist.d.mts +10 -0
  28. package/dist/extension/bulletlist.d.ts +10 -0
  29. package/dist/extension/bulletlist.js +241 -0
  30. package/dist/extension/bulletlist.mjs +46 -0
  31. package/dist/extension/clearformat.d.mts +1 -1
  32. package/dist/extension/clearformat.d.ts +1 -1
  33. package/dist/extension/clearformat.js +11 -6
  34. package/dist/extension/clearformat.mjs +8 -35
  35. package/dist/extension/color.d.mts +17 -0
  36. package/dist/extension/color.d.ts +17 -0
  37. package/dist/extension/color.js +580 -0
  38. package/dist/extension/color.mjs +12 -0
  39. package/dist/extension/emoji.d.mts +15 -0
  40. package/dist/extension/emoji.d.ts +15 -0
  41. package/dist/extension/emoji.js +421 -0
  42. package/dist/extension/emoji.mjs +158 -0
  43. package/dist/extension/font-family.d.mts +8 -11
  44. package/dist/extension/font-family.d.ts +8 -11
  45. package/dist/extension/font-family.js +11 -12
  46. package/dist/extension/font-family.mjs +10 -11
  47. package/dist/extension/font-size.d.mts +8 -11
  48. package/dist/extension/font-size.d.ts +8 -11
  49. package/dist/extension/font-size.js +10 -12
  50. package/dist/extension/font-size.mjs +9 -11
  51. package/dist/extension/heading.d.mts +10 -10
  52. package/dist/extension/heading.d.ts +10 -10
  53. package/dist/extension/heading.js +68 -80
  54. package/dist/extension/heading.mjs +40 -206
  55. package/dist/extension/history.d.mts +4 -2
  56. package/dist/extension/history.d.ts +4 -2
  57. package/dist/extension/history.js +16 -9
  58. package/dist/extension/history.mjs +16 -64
  59. package/dist/extension/horizontalrule.d.mts +10 -0
  60. package/dist/extension/horizontalrule.d.ts +10 -0
  61. package/dist/extension/horizontalrule.js +242 -0
  62. package/dist/extension/horizontalrule.mjs +42 -0
  63. package/dist/extension/image.d.mts +26 -0
  64. package/dist/extension/image.d.ts +26 -0
  65. package/dist/extension/image.js +1611 -0
  66. package/dist/extension/image.mjs +1153 -0
  67. package/dist/extension/indentoutdent.d.mts +21 -0
  68. package/dist/extension/indentoutdent.d.ts +21 -0
  69. package/dist/extension/indentoutdent.js +380 -0
  70. package/dist/extension/indentoutdent.mjs +164 -0
  71. package/dist/extension/italic.d.mts +7 -2
  72. package/dist/extension/italic.d.ts +7 -2
  73. package/dist/extension/italic.js +22 -45
  74. package/dist/extension/italic.mjs +14 -40
  75. package/dist/extension/lineheight.d.mts +15 -0
  76. package/dist/extension/lineheight.d.ts +15 -0
  77. package/dist/extension/lineheight.js +342 -0
  78. package/dist/extension/lineheight.mjs +87 -0
  79. package/dist/extension/link.d.mts +15 -0
  80. package/dist/extension/link.d.ts +15 -0
  81. package/dist/extension/link.js +588 -0
  82. package/dist/extension/link.mjs +278 -0
  83. package/dist/extension/orderedlist.d.mts +10 -0
  84. package/dist/extension/orderedlist.d.ts +10 -0
  85. package/dist/extension/orderedlist.js +241 -0
  86. package/dist/extension/orderedlist.mjs +46 -0
  87. package/dist/extension/strike.d.mts +8 -3
  88. package/dist/extension/strike.d.ts +8 -3
  89. package/dist/extension/strike.js +22 -45
  90. package/dist/extension/strike.mjs +14 -40
  91. package/dist/extension/subandsuperscript.d.mts +7 -10
  92. package/dist/extension/subandsuperscript.d.ts +7 -10
  93. package/dist/extension/subandsuperscript.js +66 -77
  94. package/dist/extension/subandsuperscript.mjs +18 -48
  95. package/dist/extension/subscript.d.mts +4 -2
  96. package/dist/extension/subscript.d.ts +4 -2
  97. package/dist/extension/subscript.js +20 -45
  98. package/dist/extension/subscript.mjs +10 -10
  99. package/dist/extension/superscript.d.mts +4 -2
  100. package/dist/extension/superscript.d.ts +4 -2
  101. package/dist/extension/superscript.js +20 -45
  102. package/dist/extension/superscript.mjs +10 -10
  103. package/dist/extension/table.d.mts +12 -0
  104. package/dist/extension/table.d.ts +12 -0
  105. package/dist/extension/table.js +585 -0
  106. package/dist/extension/table.mjs +324 -0
  107. package/dist/extension/tasklist.d.mts +10 -0
  108. package/dist/extension/tasklist.d.ts +10 -0
  109. package/dist/extension/tasklist.js +246 -0
  110. package/dist/extension/tasklist.mjs +52 -0
  111. package/dist/extension/textalign.d.mts +15 -0
  112. package/dist/extension/textalign.d.ts +15 -0
  113. package/dist/extension/textalign.js +404 -0
  114. package/dist/extension/textalign.mjs +79 -0
  115. package/dist/extension/underline.d.mts +7 -2
  116. package/dist/extension/underline.d.ts +7 -2
  117. package/dist/extension/underline.js +22 -45
  118. package/dist/extension/underline.mjs +14 -39
  119. package/dist/index.css +683 -31
  120. package/dist/index.d.mts +3 -1
  121. package/dist/index.d.ts +3 -1
  122. package/dist/index.js +306 -24
  123. package/dist/index.mjs +141 -13
  124. package/dist/tiptap-ext.type-B3TtT7-J.d.mts +43 -0
  125. package/dist/tiptap-ext.type-B3TtT7-J.d.ts +43 -0
  126. package/package.json +41 -28
  127. package/dist/chunk-2YUUKIIT.mjs +0 -149
  128. package/dist/chunk-7QOFJIQ3.mjs +0 -90
  129. package/dist/chunk-GSHINFPO.mjs +0 -53
  130. package/dist/chunk-LMOTHRGQ.mjs +0 -37
  131. package/dist/chunk-MBF77NHS.mjs +0 -37
  132. package/dist/tiptap-ext.type-DrneAC5G.d.mts +0 -39
  133. package/dist/tiptap-ext.type-DrneAC5G.d.ts +0 -39
@@ -1,12 +1,10 @@
1
1
  "use strict";
2
- var __create = Object.create;
3
2
  var __defProp = Object.defineProperty;
4
3
  var __defProps = Object.defineProperties;
5
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
5
  var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
7
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
8
7
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
9
- var __getProtoOf = Object.getPrototypeOf;
10
8
  var __hasOwnProp = Object.prototype.hasOwnProperty;
11
9
  var __propIsEnum = Object.prototype.propertyIsEnumerable;
12
10
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
@@ -46,14 +44,6 @@ var __copyProps = (to, from, except, desc) => {
46
44
  }
47
45
  return to;
48
46
  };
49
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
50
- // If the importer is in node compatibility mode or this is not an ESM
51
- // file that has been converted to a CommonJS file using a Babel-
52
- // compatible transform (i.e. "__esModule" has not been set), then set
53
- // "default" to the CommonJS "module.exports" for node compatibility.
54
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
55
- mod
56
- ));
57
47
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
58
48
 
59
49
  // src/extension/Bold.tsx
@@ -62,9 +52,9 @@ __export(Bold_exports, {
62
52
  Bold: () => Bold
63
53
  });
64
54
  module.exports = __toCommonJS(Bold_exports);
65
- var import_extension_bold = __toESM(require("@tiptap/extension-bold"));
55
+ var import_extension_bold = require("@tiptap/extension-bold");
66
56
 
67
- // src/lib/icon/BoldIcon.tsx
57
+ // src/lib/icons/index.tsx
68
58
  var import_jsx_runtime = require("react/jsx-runtime");
69
59
  var BoldIcon = (_a) => {
70
60
  var _b = _a, { size = 17, className } = _b, props = __objRest(_b, ["size", "className"]);
@@ -86,9 +76,9 @@ var BoldIcon = (_a) => {
86
76
  })
87
77
  );
88
78
  };
89
- var BoldIcon_default = BoldIcon;
90
79
 
91
80
  // src/lib/components/ButtonComponent.tsx
81
+ var import_react5 = require("react");
92
82
  var import_tailwind_merge2 = require("tailwind-merge");
93
83
 
94
84
  // src/lib/components/_com/Tooltip.tsx
@@ -184,53 +174,40 @@ var useEditor = () => {
184
174
  };
185
175
 
186
176
  // src/lib/components/ButtonComponent.tsx
187
- var import_react5 = require("@tiptap/react");
177
+ var import_react6 = require("@tiptap/react");
188
178
  var import_jsx_runtime4 = require("react/jsx-runtime");
189
179
  var ButtonComponent = ({ className, activeClassName, icon, style, tooltip = true, tooltipClassName, tooltipPlacement, _extName, _internalIcon, _tooltipContent, _onToggle, _interShortcut, _buttonClassName }) => {
190
180
  const { editor } = useEditor();
191
- const editorState = (0, import_react5.useEditorState)({
181
+ const editorState = (0, import_react6.useEditorState)({
192
182
  editor,
193
183
  selector: ({ editor: editor2 }) => ({ isActive: (editor2 == null ? void 0 : editor2.isActive(_extName)) || false })
194
184
  });
185
+ const shortcutText = (0, import_react5.useMemo)(() => {
186
+ if (!_interShortcut) return "";
187
+ return (0, import_react6.isMacOS)() ? _interShortcut.mac : _interShortcut.win;
188
+ }, [_interShortcut]);
195
189
  const tooltipContent = /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("p", { children: [
196
190
  typeof tooltip === "string" ? tooltip : _tooltipContent,
197
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("br", {}),
198
- _interShortcut
191
+ shortcutText ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
192
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("br", {}),
193
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "opacity-70", children: shortcutText })
194
+ ] }) : null
199
195
  ] });
200
- const btn = /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
201
- "button",
202
- {
203
- onClick: _onToggle,
204
- className: (0, import_tailwind_merge2.twMerge)(
205
- "py-1.5 px-2.5 rounded-md",
206
- _buttonClassName,
207
- (editorState == null ? void 0 : editorState.isActive) ? "bg-gray-200/60" : "hover:bg-gray-100",
208
- className,
209
- (editorState == null ? void 0 : editorState.isActive) ? activeClassName : "hover:bg-gray-100"
210
- ),
211
- style,
212
- children: icon != null ? icon : _internalIcon
213
- }
214
- );
196
+ const btn = /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { onClick: _onToggle, className: (0, import_tailwind_merge2.twMerge)("py-1.5 px-2.5 rounded-md", _buttonClassName, (editorState == null ? void 0 : editorState.isActive) ? "bg-gray-200/60" : "hover:bg-gray-100", className, (editorState == null ? void 0 : editorState.isActive) ? activeClassName : "hover:bg-gray-100"), style, children: icon != null ? icon : _internalIcon });
215
197
  if (tooltip === false) return btn;
216
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
217
- Tooltip_default,
218
- {
219
- content: tooltipContent,
220
- className: tooltipClassName,
221
- placement: tooltipPlacement,
222
- children: btn
223
- }
224
- );
198
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Tooltip_default, { content: tooltipContent, className: tooltipClassName, placement: tooltipPlacement, children: btn });
225
199
  };
226
200
  var ButtonComponent_default = ButtonComponent;
227
201
 
228
202
  // src/extension/Bold.tsx
229
203
  var import_jsx_runtime5 = require("react/jsx-runtime");
230
- var Bold = import_extension_bold.default.extend({
204
+ var Bold = import_extension_bold.Bold.extend({
231
205
  addOptions() {
232
206
  var _a;
233
- return __spreadProps(__spreadValues({}, (_a = this.parent) == null ? void 0 : _a.call(this)), {
207
+ const parent = (_a = this.parent) == null ? void 0 : _a.call(this);
208
+ return __spreadProps(__spreadValues({}, parent != null ? parent : {}), {
209
+ showInBubbleMenu: true,
210
+ bubbleMenuPosition: 2,
234
211
  component: ({ editor, options, buttonClassName }) => {
235
212
  return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
236
213
  ButtonComponent_default,
@@ -242,10 +219,10 @@ var Bold = import_extension_bold.default.extend({
242
219
  tooltip: options.tooltip,
243
220
  tooltipClassName: options.tooltipClassName,
244
221
  tooltipPlacement: options.tooltipPlacement,
245
- _internalIcon: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(BoldIcon_default, {}),
222
+ _internalIcon: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(BoldIcon, {}),
246
223
  _extName: "bold",
247
224
  _onToggle: () => editor.chain().focus().toggleBold().run(),
248
- _interShortcut: "\u2318 + B",
225
+ _interShortcut: { win: "Ctrl + B", mac: "\u2318 + B" },
249
226
  _tooltipContent: "Bold",
250
227
  _buttonClassName: buttonClassName
251
228
  }
@@ -1,49 +1,27 @@
1
1
  import {
2
2
  ButtonComponent_default
3
- } from "../chunk-GSHINFPO.mjs";
4
- import "../chunk-7QOFJIQ3.mjs";
3
+ } from "../chunk-SJFT7WNM.mjs";
5
4
  import "../chunk-VYDH6BZE.mjs";
6
5
  import {
7
- __objRest,
6
+ BoldIcon
7
+ } from "../chunk-EN4BPI7N.mjs";
8
+ import {
8
9
  __spreadProps,
9
10
  __spreadValues
10
- } from "../chunk-FWCSY2DS.mjs";
11
+ } from "../chunk-WNQUEZJF.mjs";
11
12
 
12
13
  // src/extension/Bold.tsx
13
- import TiptapBold from "@tiptap/extension-bold";
14
-
15
- // src/lib/icon/BoldIcon.tsx
14
+ import { Bold as TiptapBold } from "@tiptap/extension-bold";
16
15
  import { jsx } from "react/jsx-runtime";
17
- var BoldIcon = (_a) => {
18
- var _b = _a, { size = 17, className } = _b, props = __objRest(_b, ["size", "className"]);
19
- return /* @__PURE__ */ jsx(
20
- "svg",
21
- __spreadProps(__spreadValues({
22
- xmlns: "http://www.w3.org/2000/svg",
23
- viewBox: "0 0 24 24",
24
- fill: "none",
25
- stroke: "currentColor",
26
- strokeWidth: 2,
27
- strokeLinecap: "round",
28
- strokeLinejoin: "round",
29
- width: size,
30
- height: size,
31
- className
32
- }, props), {
33
- children: /* @__PURE__ */ 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" })
34
- })
35
- );
36
- };
37
- var BoldIcon_default = BoldIcon;
38
-
39
- // src/extension/Bold.tsx
40
- import { jsx as jsx2 } from "react/jsx-runtime";
41
16
  var Bold = TiptapBold.extend({
42
17
  addOptions() {
43
18
  var _a;
44
- return __spreadProps(__spreadValues({}, (_a = this.parent) == null ? void 0 : _a.call(this)), {
19
+ const parent = (_a = this.parent) == null ? void 0 : _a.call(this);
20
+ return __spreadProps(__spreadValues({}, parent != null ? parent : {}), {
21
+ showInBubbleMenu: true,
22
+ bubbleMenuPosition: 2,
45
23
  component: ({ editor, options, buttonClassName }) => {
46
- return /* @__PURE__ */ jsx2(
24
+ return /* @__PURE__ */ jsx(
47
25
  ButtonComponent_default,
48
26
  {
49
27
  className: options.className,
@@ -53,10 +31,10 @@ var Bold = TiptapBold.extend({
53
31
  tooltip: options.tooltip,
54
32
  tooltipClassName: options.tooltipClassName,
55
33
  tooltipPlacement: options.tooltipPlacement,
56
- _internalIcon: /* @__PURE__ */ jsx2(BoldIcon_default, {}),
34
+ _internalIcon: /* @__PURE__ */ jsx(BoldIcon, {}),
57
35
  _extName: "bold",
58
36
  _onToggle: () => editor.chain().focus().toggleBold().run(),
59
- _interShortcut: "\u2318 + B",
37
+ _interShortcut: { win: "Ctrl + B", mac: "\u2318 + B" },
60
38
  _tooltipContent: "Bold",
61
39
  _buttonClassName: buttonClassName
62
40
  }
@@ -0,0 +1,10 @@
1
+ import { BulletListOptions } from '@tiptap/extension-list';
2
+ import { Node } from '@tiptap/react';
3
+ import { E as ExtButtonOptions } from '../tiptap-ext.type-B3TtT7-J.mjs';
4
+ import 'react';
5
+ import '@floating-ui/react';
6
+
7
+ type ExtBulletListOptions = ExtButtonOptions<BulletListOptions>;
8
+ declare const BulletList: Node<ExtBulletListOptions>;
9
+
10
+ export { BulletList };
@@ -0,0 +1,10 @@
1
+ import { BulletListOptions } from '@tiptap/extension-list';
2
+ import { Node } from '@tiptap/react';
3
+ import { E as ExtButtonOptions } from '../tiptap-ext.type-B3TtT7-J.js';
4
+ import 'react';
5
+ import '@floating-ui/react';
6
+
7
+ type ExtBulletListOptions = ExtButtonOptions<BulletListOptions>;
8
+ declare const BulletList: Node<ExtBulletListOptions>;
9
+
10
+ export { BulletList };
@@ -0,0 +1,241 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __defProps = Object.defineProperties;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
10
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
11
+ var __spreadValues = (a, b) => {
12
+ for (var prop in b || (b = {}))
13
+ if (__hasOwnProp.call(b, prop))
14
+ __defNormalProp(a, prop, b[prop]);
15
+ if (__getOwnPropSymbols)
16
+ for (var prop of __getOwnPropSymbols(b)) {
17
+ if (__propIsEnum.call(b, prop))
18
+ __defNormalProp(a, prop, b[prop]);
19
+ }
20
+ return a;
21
+ };
22
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
23
+ var __objRest = (source, exclude) => {
24
+ var target = {};
25
+ for (var prop in source)
26
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
27
+ target[prop] = source[prop];
28
+ if (source != null && __getOwnPropSymbols)
29
+ for (var prop of __getOwnPropSymbols(source)) {
30
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
31
+ target[prop] = source[prop];
32
+ }
33
+ return target;
34
+ };
35
+ var __export = (target, all) => {
36
+ for (var name in all)
37
+ __defProp(target, name, { get: all[name], enumerable: true });
38
+ };
39
+ var __copyProps = (to, from, except, desc) => {
40
+ if (from && typeof from === "object" || typeof from === "function") {
41
+ for (let key of __getOwnPropNames(from))
42
+ if (!__hasOwnProp.call(to, key) && key !== except)
43
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
44
+ }
45
+ return to;
46
+ };
47
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
48
+
49
+ // src/extension/Bulletlist.tsx
50
+ var Bulletlist_exports = {};
51
+ __export(Bulletlist_exports, {
52
+ BulletList: () => BulletList
53
+ });
54
+ module.exports = __toCommonJS(Bulletlist_exports);
55
+ var import_extension_list = require("@tiptap/extension-list");
56
+
57
+ // src/lib/icons/index.tsx
58
+ var import_jsx_runtime = require("react/jsx-runtime");
59
+ var BulletListIcon = (_a) => {
60
+ var _b = _a, { size = 17, className } = _b, props = __objRest(_b, ["size", "className"]);
61
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
62
+ "svg",
63
+ __spreadProps(__spreadValues({
64
+ xmlns: "http://www.w3.org/2000/svg",
65
+ width: size,
66
+ height: size,
67
+ viewBox: "0 0 24 24",
68
+ fill: "none",
69
+ stroke: "currentColor",
70
+ strokeWidth: "2",
71
+ strokeLinecap: "round",
72
+ strokeLinejoin: "round"
73
+ }, props), {
74
+ children: [
75
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M3 5h.01" }),
76
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M3 12h.01" }),
77
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M3 19h.01" }),
78
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M8 5h13" }),
79
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M8 12h13" }),
80
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M8 19h13" })
81
+ ]
82
+ })
83
+ );
84
+ };
85
+
86
+ // src/lib/components/ButtonComponent.tsx
87
+ var import_react5 = require("react");
88
+ var import_tailwind_merge2 = require("tailwind-merge");
89
+
90
+ // src/lib/components/_com/Tooltip.tsx
91
+ var import_react = require("react");
92
+ var import_react2 = require("@floating-ui/react");
93
+ var import_react3 = require("motion/react");
94
+ var import_tailwind_merge = require("tailwind-merge");
95
+ var import_jsx_runtime2 = require("react/jsx-runtime");
96
+ var Tooltip = ({ placement = "top", children, content, className }) => {
97
+ const [open, setOpen] = (0, import_react.useState)(false);
98
+ const { x, y, refs, strategy, context, placement: resolvedPlacement } = (0, import_react2.useFloating)({
99
+ open,
100
+ onOpenChange: setOpen,
101
+ placement,
102
+ middleware: [(0, import_react2.offset)(8), (0, import_react2.flip)(), (0, import_react2.shift)({ padding: 8 })],
103
+ whileElementsMounted: import_react2.autoUpdate
104
+ });
105
+ const hover = (0, import_react2.useHover)(context);
106
+ const dismiss = (0, import_react2.useDismiss)(context);
107
+ const { getReferenceProps, getFloatingProps } = (0, import_react2.useInteractions)([hover, dismiss]);
108
+ const id = (0, import_react.useId)();
109
+ function mergeRefs(...refsToMerge) {
110
+ return (node) => {
111
+ for (const r of refsToMerge) {
112
+ if (!r) continue;
113
+ if (typeof r === "function") r(node);
114
+ else r.current = node;
115
+ }
116
+ };
117
+ }
118
+ const side = resolvedPlacement.split("-")[0];
119
+ const enterOffset = 6;
120
+ const getInitial = () => {
121
+ switch (side) {
122
+ case "top":
123
+ return { opacity: 0, y: enterOffset };
124
+ case "bottom":
125
+ return { opacity: 0, y: -enterOffset };
126
+ case "left":
127
+ return { opacity: 0, x: enterOffset };
128
+ case "right":
129
+ return { opacity: 0, x: -enterOffset };
130
+ default:
131
+ return { opacity: 0 };
132
+ }
133
+ };
134
+ const getExit = () => __spreadProps(__spreadValues({}, getInitial()), { opacity: 0 });
135
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_react.Fragment, { children: [
136
+ (0, import_react.isValidElement)(children) ? (0, import_react.cloneElement)(children, __spreadProps(__spreadValues({}, getReferenceProps({
137
+ onFocus: () => setOpen(true),
138
+ onBlur: () => setOpen(false),
139
+ "aria-describedby": open ? id : void 0
140
+ /* eslint-disable @typescript-eslint/no-explicit-any */
141
+ })), {
142
+ /* eslint-disable @typescript-eslint/no-explicit-any */
143
+ ref: mergeRefs(children.props.ref, refs.setReference)
144
+ })) : children,
145
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react2.FloatingPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react3.AnimatePresence, { children: open && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
146
+ import_react3.motion.div,
147
+ __spreadProps(__spreadValues({
148
+ ref: refs.setFloating
149
+ }, getFloatingProps({
150
+ role: "tooltip",
151
+ id,
152
+ style: {
153
+ position: strategy,
154
+ top: y != null ? y : 0,
155
+ left: x != null ? x : 0,
156
+ pointerEvents: "none"
157
+ }
158
+ })), {
159
+ initial: getInitial(),
160
+ animate: { opacity: 1, x: 0, y: 0, scale: 1 },
161
+ exit: getExit(),
162
+ transition: { type: "spring", stiffness: 420, damping: 30, mass: 0.6 },
163
+ className: (0, import_tailwind_merge.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),
164
+ children: content
165
+ }),
166
+ "tooltip"
167
+ ) }) })
168
+ ] });
169
+ };
170
+ var Tooltip_default = Tooltip;
171
+
172
+ // src/lib/context/editor.context.tsx
173
+ var import_react4 = require("react");
174
+ var import_jsx_runtime3 = require("react/jsx-runtime");
175
+ var EditorContext = (0, import_react4.createContext)({ editor: null });
176
+ var useEditor = () => {
177
+ const ctx = (0, import_react4.useContext)(EditorContext);
178
+ if (!ctx) throw new Error("<Toolbar/> & <Content/> component must be used inside <Editor>...</Editor/>");
179
+ return ctx;
180
+ };
181
+
182
+ // src/lib/components/ButtonComponent.tsx
183
+ var import_react6 = require("@tiptap/react");
184
+ var import_jsx_runtime4 = require("react/jsx-runtime");
185
+ var ButtonComponent = ({ className, activeClassName, icon, style, tooltip = true, tooltipClassName, tooltipPlacement, _extName, _internalIcon, _tooltipContent, _onToggle, _interShortcut, _buttonClassName }) => {
186
+ const { editor } = useEditor();
187
+ const editorState = (0, import_react6.useEditorState)({
188
+ editor,
189
+ selector: ({ editor: editor2 }) => ({ isActive: (editor2 == null ? void 0 : editor2.isActive(_extName)) || false })
190
+ });
191
+ const shortcutText = (0, import_react5.useMemo)(() => {
192
+ if (!_interShortcut) return "";
193
+ return (0, import_react6.isMacOS)() ? _interShortcut.mac : _interShortcut.win;
194
+ }, [_interShortcut]);
195
+ const tooltipContent = /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("p", { children: [
196
+ typeof tooltip === "string" ? tooltip : _tooltipContent,
197
+ shortcutText ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
198
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("br", {}),
199
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "opacity-70", children: shortcutText })
200
+ ] }) : null
201
+ ] });
202
+ const btn = /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { onClick: _onToggle, className: (0, import_tailwind_merge2.twMerge)("py-1.5 px-2.5 rounded-md", _buttonClassName, (editorState == null ? void 0 : editorState.isActive) ? "bg-gray-200/60" : "hover:bg-gray-100", className, (editorState == null ? void 0 : editorState.isActive) ? activeClassName : "hover:bg-gray-100"), style, children: icon != null ? icon : _internalIcon });
203
+ if (tooltip === false) return btn;
204
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Tooltip_default, { content: tooltipContent, className: tooltipClassName, placement: tooltipPlacement, children: btn });
205
+ };
206
+ var ButtonComponent_default = ButtonComponent;
207
+
208
+ // src/extension/Bulletlist.tsx
209
+ var import_jsx_runtime5 = require("react/jsx-runtime");
210
+ var BulletList = import_extension_list.BulletList.extend({
211
+ addOptions() {
212
+ var _a;
213
+ const parent = (_a = this.parent) == null ? void 0 : _a.call(this);
214
+ return __spreadProps(__spreadValues({}, parent != null ? parent : {}), {
215
+ component: ({ editor, options, buttonClassName }) => {
216
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
217
+ ButtonComponent_default,
218
+ {
219
+ className: options.className,
220
+ icon: options.icon,
221
+ style: options.style,
222
+ activeClassName: options.activeClassName,
223
+ tooltip: options.tooltip,
224
+ tooltipClassName: options.tooltipClassName,
225
+ tooltipPlacement: options.tooltipPlacement,
226
+ _internalIcon: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(BulletListIcon, {}),
227
+ _extName: "bulletList",
228
+ _onToggle: () => editor.chain().focus().toggleBulletList().run(),
229
+ _interShortcut: { win: "Ctrl + \u21E7 + 8", mac: "\u2318 + \u21E7 + 8" },
230
+ _tooltipContent: "Bullet List",
231
+ _buttonClassName: buttonClassName
232
+ }
233
+ );
234
+ }
235
+ });
236
+ }
237
+ });
238
+ // Annotate the CommonJS export names for ESM import in node:
239
+ 0 && (module.exports = {
240
+ BulletList
241
+ });
@@ -0,0 +1,46 @@
1
+ import {
2
+ ButtonComponent_default
3
+ } from "../chunk-SJFT7WNM.mjs";
4
+ import "../chunk-VYDH6BZE.mjs";
5
+ import {
6
+ BulletListIcon
7
+ } from "../chunk-EN4BPI7N.mjs";
8
+ import {
9
+ __spreadProps,
10
+ __spreadValues
11
+ } from "../chunk-WNQUEZJF.mjs";
12
+
13
+ // src/extension/Bulletlist.tsx
14
+ import { BulletList as TiptapBulletList } from "@tiptap/extension-list";
15
+ import { jsx } from "react/jsx-runtime";
16
+ var BulletList = TiptapBulletList.extend({
17
+ addOptions() {
18
+ var _a;
19
+ const parent = (_a = this.parent) == null ? void 0 : _a.call(this);
20
+ return __spreadProps(__spreadValues({}, parent != null ? parent : {}), {
21
+ component: ({ editor, options, buttonClassName }) => {
22
+ return /* @__PURE__ */ jsx(
23
+ ButtonComponent_default,
24
+ {
25
+ className: options.className,
26
+ icon: options.icon,
27
+ style: options.style,
28
+ activeClassName: options.activeClassName,
29
+ tooltip: options.tooltip,
30
+ tooltipClassName: options.tooltipClassName,
31
+ tooltipPlacement: options.tooltipPlacement,
32
+ _internalIcon: /* @__PURE__ */ jsx(BulletListIcon, {}),
33
+ _extName: "bulletList",
34
+ _onToggle: () => editor.chain().focus().toggleBulletList().run(),
35
+ _interShortcut: { win: "Ctrl + \u21E7 + 8", mac: "\u2318 + \u21E7 + 8" },
36
+ _tooltipContent: "Bullet List",
37
+ _buttonClassName: buttonClassName
38
+ }
39
+ );
40
+ }
41
+ });
42
+ }
43
+ });
44
+ export {
45
+ BulletList
46
+ };
@@ -1,5 +1,5 @@
1
1
  import { Extension } from '@tiptap/react';
2
- import { b as ExtWithoutActiveOptions } from '../tiptap-ext.type-DrneAC5G.mjs';
2
+ import { b as ExtWithoutActiveOptions } from '../tiptap-ext.type-B3TtT7-J.mjs';
3
3
  import 'react';
4
4
  import '@floating-ui/react';
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { Extension } from '@tiptap/react';
2
- import { b as ExtWithoutActiveOptions } from '../tiptap-ext.type-DrneAC5G.js';
2
+ import { b as ExtWithoutActiveOptions } from '../tiptap-ext.type-B3TtT7-J.js';
3
3
  import 'react';
4
4
  import '@floating-ui/react';
5
5
 
@@ -52,9 +52,9 @@ __export(ClearFormat_exports, {
52
52
  ClearFormat: () => ClearFormat
53
53
  });
54
54
  module.exports = __toCommonJS(ClearFormat_exports);
55
- var import_react4 = require("@tiptap/react");
55
+ var import_react6 = require("@tiptap/react");
56
56
 
57
- // src/lib/icon/ClearIcon.tsx
57
+ // src/lib/icons/index.tsx
58
58
  var import_jsx_runtime = require("react/jsx-runtime");
59
59
  var ClearIcon = (_a) => {
60
60
  var _b = _a, { size = 17, className } = _b, props = __objRest(_b, ["size", "className"]);
@@ -78,9 +78,9 @@ var ClearIcon = (_a) => {
78
78
  })
79
79
  );
80
80
  };
81
- var ClearIcon_default = ClearIcon;
82
81
 
83
82
  // src/lib/components/ButtonWithoutActive.tsx
83
+ var import_react4 = require("react");
84
84
  var import_tailwind_merge2 = require("tailwind-merge");
85
85
 
86
86
  // src/lib/components/_com/Tooltip.tsx
@@ -166,15 +166,20 @@ var Tooltip = ({ placement = "top", children, content, className }) => {
166
166
  var Tooltip_default = Tooltip;
167
167
 
168
168
  // src/lib/components/ButtonWithoutActive.tsx
169
+ var import_react5 = require("@tiptap/react");
169
170
  var import_jsx_runtime3 = require("react/jsx-runtime");
170
171
  var ButtonWithoutActive = ({ className, icon, style, tooltip = true, tooltipClassName, tooltipPlacement, _internalIcon, _tooltipContent, _interShortcut, _onToggle, _buttonClassName, _disabled = false }) => {
172
+ const shortcutText = (0, import_react4.useMemo)(() => {
173
+ if (!_interShortcut) return "";
174
+ return (0, import_react5.isMacOS)() ? _interShortcut.mac : _interShortcut.win;
175
+ }, [_interShortcut]);
171
176
  const tooltipContent = /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("p", { children: [
172
177
  typeof tooltip === "string" ? tooltip : _tooltipContent,
173
178
  _interShortcut && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
174
179
  " ",
175
180
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("br", {}),
176
181
  " ",
177
- _interShortcut,
182
+ shortcutText,
178
183
  " "
179
184
  ] })
180
185
  ] });
@@ -208,7 +213,7 @@ var ButtonWithoutActive_default = ButtonWithoutActive;
208
213
 
209
214
  // src/extension/ClearFormat.tsx
210
215
  var import_jsx_runtime4 = require("react/jsx-runtime");
211
- var ClearFormat = import_react4.Extension.create({
216
+ var ClearFormat = import_react6.Extension.create({
212
217
  name: "ClearFormat",
213
218
  addOptions() {
214
219
  var _a;
@@ -223,7 +228,7 @@ var ClearFormat = import_react4.Extension.create({
223
228
  tooltip: options.tooltip,
224
229
  tooltipClassName: options.tooltipClassName,
225
230
  tooltipPlacement: options.tooltipPlacement,
226
- _internalIcon: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ClearIcon_default, {}),
231
+ _internalIcon: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ClearIcon, {}),
227
232
  _onToggle: () => editor.chain().focus().clearNodes().unsetAllMarks().run(),
228
233
  _tooltipContent: "Clear Format",
229
234
  _buttonClassName: buttonClassName
@@ -1,51 +1,24 @@
1
1
  import {
2
2
  ButtonWithoutActive_default
3
- } from "../chunk-D47XME55.mjs";
4
- import "../chunk-7QOFJIQ3.mjs";
3
+ } from "../chunk-WXCHG3NQ.mjs";
4
+ import {
5
+ ClearIcon
6
+ } from "../chunk-EN4BPI7N.mjs";
5
7
  import {
6
- __objRest,
7
8
  __spreadProps,
8
9
  __spreadValues
9
- } from "../chunk-FWCSY2DS.mjs";
10
+ } from "../chunk-WNQUEZJF.mjs";
10
11
 
11
12
  // src/extension/ClearFormat.tsx
12
13
  import { Extension } from "@tiptap/react";
13
-
14
- // src/lib/icon/ClearIcon.tsx
15
- import { jsx, jsxs } from "react/jsx-runtime";
16
- var ClearIcon = (_a) => {
17
- var _b = _a, { size = 17, className } = _b, props = __objRest(_b, ["size", "className"]);
18
- return /* @__PURE__ */ jsxs(
19
- "svg",
20
- __spreadProps(__spreadValues({
21
- xmlns: "http://www.w3.org/2000/svg",
22
- width: size,
23
- height: size,
24
- viewBox: "0 0 24 24",
25
- fill: "none",
26
- stroke: "currentColor",
27
- strokeWidth: 2,
28
- strokeLinecap: "round",
29
- strokeLinejoin: "round"
30
- }, props), {
31
- children: [
32
- /* @__PURE__ */ jsx("path", { d: "M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21" }),
33
- /* @__PURE__ */ jsx("path", { d: "m5.082 11.09 8.828 8.828" })
34
- ]
35
- })
36
- );
37
- };
38
- var ClearIcon_default = ClearIcon;
39
-
40
- // src/extension/ClearFormat.tsx
41
- import { jsx as jsx2 } from "react/jsx-runtime";
14
+ import { jsx } from "react/jsx-runtime";
42
15
  var ClearFormat = Extension.create({
43
16
  name: "ClearFormat",
44
17
  addOptions() {
45
18
  var _a;
46
19
  return __spreadProps(__spreadValues({}, (_a = this.parent) == null ? void 0 : _a.call(this)), {
47
20
  component: ({ editor, options, buttonClassName }) => {
48
- return /* @__PURE__ */ jsx2(
21
+ return /* @__PURE__ */ jsx(
49
22
  ButtonWithoutActive_default,
50
23
  {
51
24
  className: options.className,
@@ -54,7 +27,7 @@ var ClearFormat = Extension.create({
54
27
  tooltip: options.tooltip,
55
28
  tooltipClassName: options.tooltipClassName,
56
29
  tooltipPlacement: options.tooltipPlacement,
57
- _internalIcon: /* @__PURE__ */ jsx2(ClearIcon_default, {}),
30
+ _internalIcon: /* @__PURE__ */ jsx(ClearIcon, {}),
58
31
  _onToggle: () => editor.chain().focus().clearNodes().unsetAllMarks().run(),
59
32
  _tooltipContent: "Clear Format",
60
33
  _buttonClassName: buttonClassName