ritext 1.0.23 → 1.0.27

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 (132) hide show
  1. package/README.md +1 -30
  2. package/dist/chunk-EN4BPI7N.mjs +1213 -0
  3. package/dist/chunk-FJQ4FZRS.mjs +98 -0
  4. package/dist/chunk-M4ORWR74.mjs +31 -0
  5. package/dist/chunk-SJFT7WNM.mjs +38 -0
  6. package/dist/chunk-W367UGID.mjs +55 -0
  7. package/dist/{chunk-FWCSY2DS.mjs → chunk-WNQUEZJF.mjs} +22 -1
  8. package/dist/{chunk-D47XME55.mjs → chunk-WXCHG3NQ.mjs} +8 -2
  9. package/dist/chunk-WZKGD3DD.mjs +231 -0
  10. package/dist/extension/backgroundcolor.d.mts +16 -0
  11. package/dist/extension/backgroundcolor.d.ts +16 -0
  12. package/dist/extension/backgroundcolor.js +668 -0
  13. package/dist/extension/backgroundcolor.mjs +107 -0
  14. package/dist/extension/base.d.mts +6 -0
  15. package/dist/extension/base.d.ts +6 -0
  16. package/dist/extension/base.js +65 -0
  17. package/dist/extension/base.mjs +22 -0
  18. package/dist/extension/blockquote.d.mts +10 -0
  19. package/dist/extension/blockquote.d.ts +10 -0
  20. package/dist/extension/blockquote.js +239 -0
  21. package/dist/extension/blockquote.mjs +46 -0
  22. package/dist/extension/bold.d.mts +7 -2
  23. package/dist/extension/bold.d.ts +7 -2
  24. package/dist/extension/bold.js +22 -45
  25. package/dist/extension/bold.mjs +13 -35
  26. package/dist/extension/bulletlist.d.mts +10 -0
  27. package/dist/extension/bulletlist.d.ts +10 -0
  28. package/dist/extension/bulletlist.js +241 -0
  29. package/dist/extension/bulletlist.mjs +46 -0
  30. package/dist/extension/clearformat.d.mts +1 -1
  31. package/dist/extension/clearformat.d.ts +1 -1
  32. package/dist/extension/clearformat.js +11 -6
  33. package/dist/extension/clearformat.mjs +8 -35
  34. package/dist/extension/color.d.mts +17 -0
  35. package/dist/extension/color.d.ts +17 -0
  36. package/dist/extension/color.js +580 -0
  37. package/dist/extension/color.mjs +12 -0
  38. package/dist/extension/emoji.d.mts +15 -0
  39. package/dist/extension/emoji.d.ts +15 -0
  40. package/dist/extension/emoji.js +421 -0
  41. package/dist/extension/emoji.mjs +158 -0
  42. package/dist/extension/font-family.d.mts +8 -11
  43. package/dist/extension/font-family.d.ts +8 -11
  44. package/dist/extension/font-family.js +11 -12
  45. package/dist/extension/font-family.mjs +10 -11
  46. package/dist/extension/font-size.d.mts +8 -11
  47. package/dist/extension/font-size.d.ts +8 -11
  48. package/dist/extension/font-size.js +10 -12
  49. package/dist/extension/font-size.mjs +9 -11
  50. package/dist/extension/heading.d.mts +10 -10
  51. package/dist/extension/heading.d.ts +10 -10
  52. package/dist/extension/heading.js +68 -80
  53. package/dist/extension/heading.mjs +40 -206
  54. package/dist/extension/history.d.mts +4 -2
  55. package/dist/extension/history.d.ts +4 -2
  56. package/dist/extension/history.js +16 -9
  57. package/dist/extension/history.mjs +16 -64
  58. package/dist/extension/horizontalrule.d.mts +10 -0
  59. package/dist/extension/horizontalrule.d.ts +10 -0
  60. package/dist/extension/horizontalrule.js +242 -0
  61. package/dist/extension/horizontalrule.mjs +42 -0
  62. package/dist/extension/image.d.mts +26 -0
  63. package/dist/extension/image.d.ts +26 -0
  64. package/dist/extension/image.js +1611 -0
  65. package/dist/extension/image.mjs +1153 -0
  66. package/dist/extension/indentoutdent.d.mts +21 -0
  67. package/dist/extension/indentoutdent.d.ts +21 -0
  68. package/dist/extension/indentoutdent.js +380 -0
  69. package/dist/extension/indentoutdent.mjs +164 -0
  70. package/dist/extension/italic.d.mts +7 -2
  71. package/dist/extension/italic.d.ts +7 -2
  72. package/dist/extension/italic.js +22 -45
  73. package/dist/extension/italic.mjs +14 -40
  74. package/dist/extension/lineheight.d.mts +15 -0
  75. package/dist/extension/lineheight.d.ts +15 -0
  76. package/dist/extension/lineheight.js +342 -0
  77. package/dist/extension/lineheight.mjs +87 -0
  78. package/dist/extension/link.d.mts +15 -0
  79. package/dist/extension/link.d.ts +15 -0
  80. package/dist/extension/link.js +588 -0
  81. package/dist/extension/link.mjs +278 -0
  82. package/dist/extension/orderedlist.d.mts +10 -0
  83. package/dist/extension/orderedlist.d.ts +10 -0
  84. package/dist/extension/orderedlist.js +241 -0
  85. package/dist/extension/orderedlist.mjs +46 -0
  86. package/dist/extension/strike.d.mts +8 -3
  87. package/dist/extension/strike.d.ts +8 -3
  88. package/dist/extension/strike.js +22 -45
  89. package/dist/extension/strike.mjs +14 -40
  90. package/dist/extension/subandsuperscript.d.mts +7 -10
  91. package/dist/extension/subandsuperscript.d.ts +7 -10
  92. package/dist/extension/subandsuperscript.js +66 -77
  93. package/dist/extension/subandsuperscript.mjs +18 -48
  94. package/dist/extension/subscript.d.mts +4 -2
  95. package/dist/extension/subscript.d.ts +4 -2
  96. package/dist/extension/subscript.js +20 -45
  97. package/dist/extension/subscript.mjs +10 -10
  98. package/dist/extension/superscript.d.mts +4 -2
  99. package/dist/extension/superscript.d.ts +4 -2
  100. package/dist/extension/superscript.js +20 -45
  101. package/dist/extension/superscript.mjs +10 -10
  102. package/dist/extension/table.d.mts +12 -0
  103. package/dist/extension/table.d.ts +12 -0
  104. package/dist/extension/table.js +585 -0
  105. package/dist/extension/table.mjs +324 -0
  106. package/dist/extension/tasklist.d.mts +10 -0
  107. package/dist/extension/tasklist.d.ts +10 -0
  108. package/dist/extension/tasklist.js +246 -0
  109. package/dist/extension/tasklist.mjs +52 -0
  110. package/dist/extension/textalign.d.mts +15 -0
  111. package/dist/extension/textalign.d.ts +15 -0
  112. package/dist/extension/textalign.js +404 -0
  113. package/dist/extension/textalign.mjs +79 -0
  114. package/dist/extension/underline.d.mts +7 -2
  115. package/dist/extension/underline.d.ts +7 -2
  116. package/dist/extension/underline.js +22 -45
  117. package/dist/extension/underline.mjs +14 -39
  118. package/dist/index.css +683 -31
  119. package/dist/index.d.mts +3 -1
  120. package/dist/index.d.ts +3 -1
  121. package/dist/index.js +295 -24
  122. package/dist/index.mjs +130 -13
  123. package/dist/tiptap-ext.type-B3TtT7-J.d.mts +43 -0
  124. package/dist/tiptap-ext.type-B3TtT7-J.d.ts +43 -0
  125. package/package.json +25 -13
  126. package/dist/chunk-2YUUKIIT.mjs +0 -149
  127. package/dist/chunk-7QOFJIQ3.mjs +0 -90
  128. package/dist/chunk-GSHINFPO.mjs +0 -53
  129. package/dist/chunk-LMOTHRGQ.mjs +0 -37
  130. package/dist/chunk-MBF77NHS.mjs +0 -37
  131. package/dist/tiptap-ext.type-DrneAC5G.d.mts +0 -39
  132. 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/Heading.tsx
@@ -62,11 +52,31 @@ __export(Heading_exports, {
62
52
  Heading: () => Heading
63
53
  });
64
54
  module.exports = __toCommonJS(Heading_exports);
65
- var import_extension_heading = __toESM(require("@tiptap/extension-heading"));
66
- var import_extension_paragraph = __toESM(require("@tiptap/extension-paragraph"));
55
+ var import_extension_heading = require("@tiptap/extension-heading");
56
+ var import_react9 = require("@tiptap/react");
67
57
 
68
- // src/lib/icon/HeadingIcon.tsx
58
+ // src/lib/icons/index.tsx
69
59
  var import_jsx_runtime = require("react/jsx-runtime");
60
+ var ArrowIcon = (_a) => {
61
+ var _b = _a, { size = 17, className } = _b, props = __objRest(_b, ["size", "className"]);
62
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
63
+ "svg",
64
+ __spreadProps(__spreadValues({
65
+ xmlns: "http://www.w3.org/2000/svg",
66
+ viewBox: "0 0 48 48",
67
+ fill: "none",
68
+ stroke: "currentColor",
69
+ strokeWidth: 2,
70
+ strokeLinecap: "round",
71
+ strokeLinejoin: "round",
72
+ width: size,
73
+ height: size,
74
+ className
75
+ }, props), {
76
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { fill: "currentColor", stroke: "currentColor", strokeLinejoin: "round", strokeWidth: "4", d: "M36 19L24 31L12 19z" })
77
+ })
78
+ );
79
+ };
70
80
  var H1Icon = (_a) => {
71
81
  var _b = _a, { size = 17, className } = _b, props = __objRest(_b, ["size", "className"]);
72
82
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
@@ -327,34 +337,8 @@ var Tooltip_default = Tooltip;
327
337
 
328
338
  // src/lib/components/DropdownComponent.tsx
329
339
  var import_react5 = require("@floating-ui/react");
330
-
331
- // src/lib/icon/ArrowIcon.tsx
332
- var import_jsx_runtime3 = require("react/jsx-runtime");
333
- var ArrowIcon = (_a) => {
334
- var _b = _a, { size = 17, className } = _b, props = __objRest(_b, ["size", "className"]);
335
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
336
- "svg",
337
- __spreadProps(__spreadValues({
338
- xmlns: "http://www.w3.org/2000/svg",
339
- viewBox: "0 0 48 48",
340
- fill: "none",
341
- stroke: "currentColor",
342
- strokeWidth: 2,
343
- strokeLinecap: "round",
344
- strokeLinejoin: "round",
345
- width: size,
346
- height: size,
347
- className
348
- }, props), {
349
- children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { fill: "currentColor", stroke: "currentColor", strokeLinejoin: "round", strokeWidth: "4", d: "M36 19L24 31L12 19z" })
350
- })
351
- );
352
- };
353
- var ArrowIcon_default = ArrowIcon;
354
-
355
- // src/lib/components/DropdownComponent.tsx
356
340
  var import_react6 = require("motion/react");
357
- var import_jsx_runtime4 = require("react/jsx-runtime");
341
+ var import_jsx_runtime3 = require("react/jsx-runtime");
358
342
  var DropdownComponent = ({ children, className, showArrow = true, content, dropdownClassName, style, tooltip, tooltipClassName, tooltipPlacement, _tooltipContent, _internalContent, _dropdownClassName }) => {
359
343
  const [open, setOpen] = (0, import_react4.useState)(false);
360
344
  const { x, y, refs, strategy, context } = (0, import_react5.useFloating)({
@@ -368,20 +352,23 @@ var DropdownComponent = ({ children, className, showArrow = true, content, dropd
368
352
  const dismiss = (0, import_react5.useDismiss)(context);
369
353
  const { getReferenceProps, getFloatingProps } = (0, import_react5.useInteractions)([click, dismiss]);
370
354
  const listId = (0, import_react4.useId)();
371
- const tooltipContent = /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { children: typeof tooltip === "string" ? tooltip : _tooltipContent });
355
+ const tooltipContent = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { children: typeof tooltip === "string" ? tooltip : _tooltipContent });
372
356
  const initialMotion = { opacity: 0, scale: 0.95 };
373
357
  const animateMotion = { opacity: 1, scale: 1 };
374
358
  const enhancedChildren = import_react4.Children.map(children, (child) => {
375
359
  if (!(0, import_react4.isValidElement)(child)) return child;
376
- if (!("onSelect" in child.props)) return child;
377
360
  const prevOnSelect = child.props.onSelect;
378
361
  const combinedOnSelect = () => {
379
362
  prevOnSelect == null ? void 0 : prevOnSelect();
380
363
  setOpen(false);
381
364
  };
382
- return (0, import_react4.cloneElement)(child, { onSelect: combinedOnSelect });
365
+ return (0, import_react4.cloneElement)(child, {
366
+ onSelect: prevOnSelect ? combinedOnSelect : void 0,
367
+ open,
368
+ onClose: () => setOpen(false)
369
+ });
383
370
  });
384
- const btn = /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
371
+ const btn = /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
385
372
  "button",
386
373
  __spreadProps(__spreadValues({}, getReferenceProps({
387
374
  ref: refs.setReference,
@@ -394,13 +381,13 @@ var DropdownComponent = ({ children, className, showArrow = true, content, dropd
394
381
  ),
395
382
  style,
396
383
  children: [
397
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: content != null ? content : _internalContent }),
398
- showArrow && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ArrowIcon_default, { size: 14, className: "text-gray-500 block" })
384
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: content != null ? content : _internalContent }),
385
+ showArrow && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ArrowIcon, { size: 14, className: "text-gray-500 block" })
399
386
  ]
400
387
  })
401
388
  );
402
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react4.Fragment, { children: [
403
- tooltip === false ? btn : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
389
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_react4.Fragment, { children: [
390
+ tooltip === false ? btn : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
404
391
  Tooltip_default,
405
392
  {
406
393
  content: tooltipContent,
@@ -409,7 +396,7 @@ var DropdownComponent = ({ children, className, showArrow = true, content, dropd
409
396
  children: btn
410
397
  }
411
398
  ),
412
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react5.FloatingPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react6.AnimatePresence, { children: open && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
399
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react5.FloatingPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react6.AnimatePresence, { children: open && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
413
400
  import_react6.motion.div,
414
401
  __spreadProps(__spreadValues({}, getFloatingProps({
415
402
  ref: refs.setFloating,
@@ -424,7 +411,7 @@ var DropdownComponent = ({ children, className, showArrow = true, content, dropd
424
411
  initial: initialMotion,
425
412
  animate: animateMotion,
426
413
  exit: initialMotion,
427
- className: (0, import_tailwind_merge2.twMerge)("bg-white border border-solid border-gray-200 p-2 space-y-1 rounded-lg shadow-sm shadow-gray-200/40 max-h-125 overflow-auto", _dropdownClassName, dropdownClassName),
414
+ className: (0, import_tailwind_merge2.twMerge)("bg-white border border-solid border-gray-200 p-2 space-y-1 rounded-lg shadow-sm shadow-gray-200/40 z-99999999 max-h-125 overflow-auto", _dropdownClassName, dropdownClassName),
428
415
  children: enhancedChildren
429
416
  })
430
417
  ) }) })
@@ -437,7 +424,7 @@ var import_tailwind_merge3 = require("tailwind-merge");
437
424
 
438
425
  // src/lib/context/editor.context.tsx
439
426
  var import_react7 = require("react");
440
- var import_jsx_runtime5 = require("react/jsx-runtime");
427
+ var import_jsx_runtime4 = require("react/jsx-runtime");
441
428
  var EditorContext = (0, import_react7.createContext)({ editor: null });
442
429
  var useEditor = () => {
443
430
  const ctx = (0, import_react7.useContext)(EditorContext);
@@ -447,14 +434,14 @@ var useEditor = () => {
447
434
 
448
435
  // src/lib/components/DropdownItemComponent.tsx
449
436
  var import_react8 = require("@tiptap/react");
450
- var import_jsx_runtime6 = require("react/jsx-runtime");
437
+ var import_jsx_runtime5 = require("react/jsx-runtime");
451
438
  var DropdownItemComponent = ({ item, onSelect, activeClassName, itemClassName, _itemClassName, showKeyShortcutText = true, spClass }) => {
452
439
  const { editor } = useEditor();
453
440
  const editorState = (0, import_react8.useEditorState)({
454
441
  editor,
455
442
  selector: ({ editor: editor2 }) => ({ isActive: (editor2 == null ? void 0 : editor2.isActive(item.name, item.ext ? { level: item.ext } : void 0)) || false })
456
443
  });
457
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: (0, import_tailwind_merge3.twMerge)(
444
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: (0, import_tailwind_merge3.twMerge)(
458
445
  "flex items-center gap-x-2.5 transition-all duration-100 cursor-pointer select-none px-2 py-1.5 rounded-md",
459
446
  _itemClassName,
460
447
  (editorState == null ? void 0 : editorState.isActive) ? "bg-gray-200/60" : "hover:bg-gray-100",
@@ -462,26 +449,30 @@ var DropdownItemComponent = ({ item, onSelect, activeClassName, itemClassName, _
462
449
  (editorState == null ? void 0 : editorState.isActive) ? activeClassName : "hover:bg-gray-100"
463
450
  ), onClick: onSelect, children: [
464
451
  item.icon,
465
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: (0, import_tailwind_merge3.twMerge)("flex-1 text-base", spClass), style: item.style, children: item.text }),
466
- showKeyShortcutText && item.keyBind && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "ml-6 text-gray-400", children: item.keyBind })
452
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: (0, import_tailwind_merge3.twMerge)("flex-1 text-base", spClass), style: item.style, children: item.text }),
453
+ showKeyShortcutText && item.keyBind && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "ml-6 text-gray-400", children: item.keyBind })
467
454
  ] });
468
455
  };
469
456
  var DropdownItemComponent_default = DropdownItemComponent;
470
457
 
471
458
  // src/extension/Heading.tsx
472
- var import_jsx_runtime7 = require("react/jsx-runtime");
473
- var Heading = import_extension_heading.default.extend({
459
+ var import_jsx_runtime6 = require("react/jsx-runtime");
460
+ var Heading = import_extension_heading.Heading.extend({
474
461
  addOptions() {
475
462
  var _a;
476
- return __spreadProps(__spreadValues({}, (_a = this.parent) == null ? void 0 : _a.call(this)), {
463
+ const parent = (_a = this.parent) == null ? void 0 : _a.call(this);
464
+ return __spreadProps(__spreadValues({}, parent != null ? parent : {}), {
465
+ showInBubbleMenu: true,
466
+ bubbleMenuPosition: 1,
477
467
  component: ({ options, editor, dropdownContainerClassName, dropdownItemClassName }) => {
468
+ const macKey = (0, import_react9.isMacOS)() ? "\u2318 \u2325 " : "Ctrl \u2325 ";
478
469
  const defaultIcons = {
479
- 1: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(H1Icon, {}),
480
- 2: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(H2Icon, {}),
481
- 3: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(H3Icon, {}),
482
- 4: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(H4Icon, {}),
483
- 5: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(H5Icon, {}),
484
- 6: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(H6Icon, {})
470
+ 1: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(H1Icon, {}),
471
+ 2: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(H2Icon, {}),
472
+ 3: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(H3Icon, {}),
473
+ 4: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(H4Icon, {}),
474
+ 5: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(H5Icon, {}),
475
+ 6: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(H6Icon, {})
485
476
  };
486
477
  const defaultTexts = {
487
478
  1: "Heading 1",
@@ -492,12 +483,12 @@ var Heading = import_extension_heading.default.extend({
492
483
  6: "Heading 6"
493
484
  };
494
485
  const defaultKeys = {
495
- 1: "\u2318\u2325 1",
496
- 2: "\u2318\u2325 2",
497
- 3: "\u2318\u2325 3",
498
- 4: "\u2318\u2325 4",
499
- 5: "\u2318\u2325 5",
500
- 6: "\u2318\u2325 6"
486
+ 1: `${macKey} 1`,
487
+ 2: `${macKey} 2`,
488
+ 3: `${macKey} 3`,
489
+ 4: `${macKey} 4`,
490
+ 5: `${macKey} 5`,
491
+ 6: `${macKey} 6`
501
492
  };
502
493
  const list = [];
503
494
  const levels = options.level;
@@ -530,7 +521,7 @@ var Heading = import_extension_heading.default.extend({
530
521
  });
531
522
  });
532
523
  }
533
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
524
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
534
525
  DropdownComponent_default,
535
526
  {
536
527
  className: options.className,
@@ -541,19 +532,19 @@ var Heading = import_extension_heading.default.extend({
541
532
  tooltip: options.tooltip,
542
533
  tooltipClassName: options.tooltipClassName,
543
534
  tooltipPlacement: options.tooltipPlacement,
544
- _tooltipContent: "Sub & Superscript",
535
+ _tooltipContent: "Headings",
545
536
  _internalContent: "Heading",
546
537
  _dropdownClassName: dropdownContainerClassName,
547
538
  children: [
548
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
539
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
549
540
  DropdownItemComponent_default,
550
541
  {
551
542
  onSelect: () => editor.chain().setParagraph().run(),
552
543
  item: {
553
544
  id: crypto.randomUUID(),
554
- icon: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Pilcrow, {}),
545
+ icon: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Pilcrow, {}),
555
546
  text: "Paragraph",
556
- keyBind: "\u2318\u2325 P",
547
+ keyBind: `${macKey} P`,
557
548
  onClick: () => editor.chain().setParagraph().run(),
558
549
  name: "paragraph"
559
550
  },
@@ -563,8 +554,8 @@ var Heading = import_extension_heading.default.extend({
563
554
  _itemClassName: dropdownItemClassName
564
555
  }
565
556
  ),
566
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("hr", { className: "border-gray-200" }),
567
- list.map((item) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
557
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("hr", { className: "border-gray-200" }),
558
+ list.map((item) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
568
559
  DropdownItemComponent_default,
569
560
  {
570
561
  onSelect: item.onClick,
@@ -582,9 +573,6 @@ var Heading = import_extension_heading.default.extend({
582
573
  );
583
574
  }
584
575
  });
585
- },
586
- addExtensions() {
587
- return [import_extension_paragraph.default];
588
576
  }
589
577
  });
590
578
  // Annotate the CommonJS export names for ESM import in node:
@@ -1,207 +1,44 @@
1
1
  import {
2
- DropdownComponent_default,
3
2
  DropdownItemComponent_default
4
- } from "../chunk-2YUUKIIT.mjs";
5
- import "../chunk-7QOFJIQ3.mjs";
3
+ } from "../chunk-M4ORWR74.mjs";
4
+ import {
5
+ DropdownComponent_default
6
+ } from "../chunk-FJQ4FZRS.mjs";
6
7
  import "../chunk-VYDH6BZE.mjs";
7
8
  import {
8
- __objRest,
9
+ H1Icon,
10
+ H2Icon,
11
+ H3Icon,
12
+ H4Icon,
13
+ H5Icon,
14
+ H6Icon,
15
+ Pilcrow
16
+ } from "../chunk-EN4BPI7N.mjs";
17
+ import {
9
18
  __spreadProps,
10
19
  __spreadValues
11
- } from "../chunk-FWCSY2DS.mjs";
20
+ } from "../chunk-WNQUEZJF.mjs";
12
21
 
13
22
  // src/extension/Heading.tsx
14
- import TiptapHeading from "@tiptap/extension-heading";
15
- import TiptapParagraph from "@tiptap/extension-paragraph";
16
-
17
- // src/lib/icon/HeadingIcon.tsx
23
+ import { Heading as TiptapHeading } from "@tiptap/extension-heading";
24
+ import { isMacOS } from "@tiptap/react";
18
25
  import { jsx, jsxs } from "react/jsx-runtime";
19
- var H1Icon = (_a) => {
20
- var _b = _a, { size = 17, className } = _b, props = __objRest(_b, ["size", "className"]);
21
- return /* @__PURE__ */ jsxs(
22
- "svg",
23
- __spreadProps(__spreadValues({
24
- xmlns: "http://www.w3.org/2000/svg",
25
- width: size,
26
- height: size,
27
- viewBox: "0 0 24 24",
28
- fill: "none",
29
- stroke: "currentColor",
30
- strokeWidth: 2,
31
- strokeLinecap: "round",
32
- strokeLinejoin: "round"
33
- }, props), {
34
- children: [
35
- /* @__PURE__ */ jsx("path", { d: "M4 12h8" }),
36
- /* @__PURE__ */ jsx("path", { d: "M4 18V6" }),
37
- /* @__PURE__ */ jsx("path", { d: "M12 18V6" }),
38
- /* @__PURE__ */ jsx("path", { d: "m17 12 3-2v8" })
39
- ]
40
- })
41
- );
42
- };
43
- var H2Icon = (_a) => {
44
- var _b = _a, { size = 17, className } = _b, props = __objRest(_b, ["size", "className"]);
45
- return /* @__PURE__ */ jsxs(
46
- "svg",
47
- __spreadProps(__spreadValues({
48
- xmlns: "http://www.w3.org/2000/svg",
49
- width: size,
50
- height: size,
51
- viewBox: "0 0 24 24",
52
- fill: "none",
53
- stroke: "currentColor",
54
- strokeWidth: 2,
55
- strokeLinecap: "round",
56
- strokeLinejoin: "round"
57
- }, props), {
58
- children: [
59
- /* @__PURE__ */ jsx("path", { d: "M4 12h8" }),
60
- /* @__PURE__ */ jsx("path", { d: "M4 18V6" }),
61
- /* @__PURE__ */ jsx("path", { d: "M12 18V6" }),
62
- /* @__PURE__ */ jsx("path", { d: "M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1" })
63
- ]
64
- })
65
- );
66
- };
67
- var H3Icon = (_a) => {
68
- var _b = _a, { size = 17, className } = _b, props = __objRest(_b, ["size", "className"]);
69
- return /* @__PURE__ */ jsxs(
70
- "svg",
71
- __spreadProps(__spreadValues({
72
- xmlns: "http://www.w3.org/2000/svg",
73
- width: size,
74
- height: size,
75
- viewBox: "0 0 24 24",
76
- fill: "none",
77
- stroke: "currentColor",
78
- strokeWidth: 2,
79
- strokeLinecap: "round",
80
- strokeLinejoin: "round"
81
- }, props), {
82
- children: [
83
- /* @__PURE__ */ jsx("path", { d: "M4 12h8" }),
84
- /* @__PURE__ */ jsx("path", { d: "M4 18V6" }),
85
- /* @__PURE__ */ jsx("path", { d: "M12 18V6" }),
86
- /* @__PURE__ */ jsx("path", { d: "M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2" }),
87
- /* @__PURE__ */ jsx("path", { d: "M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2" })
88
- ]
89
- })
90
- );
91
- };
92
- var H4Icon = (_a) => {
93
- var _b = _a, { size = 17, className } = _b, props = __objRest(_b, ["size", "className"]);
94
- return /* @__PURE__ */ jsxs(
95
- "svg",
96
- __spreadProps(__spreadValues({
97
- xmlns: "http://www.w3.org/2000/svg",
98
- width: size,
99
- height: size,
100
- viewBox: "0 0 24 24",
101
- fill: "none",
102
- stroke: "currentColor",
103
- strokeWidth: 2,
104
- strokeLinecap: "round",
105
- strokeLinejoin: "round"
106
- }, props), {
107
- children: [
108
- /* @__PURE__ */ jsx("path", { d: "M12 18V6" }),
109
- /* @__PURE__ */ jsx("path", { d: "M17 10v3a1 1 0 0 0 1 1h3" }),
110
- /* @__PURE__ */ jsx("path", { d: "M21 10v8" }),
111
- /* @__PURE__ */ jsx("path", { d: "M4 12h8" }),
112
- /* @__PURE__ */ jsx("path", { d: "M4 18V6" })
113
- ]
114
- })
115
- );
116
- };
117
- var H5Icon = (_a) => {
118
- var _b = _a, { size = 17, className } = _b, props = __objRest(_b, ["size", "className"]);
119
- return /* @__PURE__ */ jsxs(
120
- "svg",
121
- __spreadProps(__spreadValues({
122
- xmlns: "http://www.w3.org/2000/svg",
123
- width: size,
124
- height: size,
125
- viewBox: "0 0 24 24",
126
- fill: "none",
127
- stroke: "currentColor",
128
- strokeWidth: 2,
129
- strokeLinecap: "round",
130
- strokeLinejoin: "round"
131
- }, props), {
132
- children: [
133
- /* @__PURE__ */ jsx("path", { d: "M4 12h8" }),
134
- /* @__PURE__ */ jsx("path", { d: "M4 18V6" }),
135
- /* @__PURE__ */ jsx("path", { d: "M12 18V6" }),
136
- /* @__PURE__ */ jsx("path", { d: "M17 13v-3h4" }),
137
- /* @__PURE__ */ jsx("path", { d: "M17 17.7c.4.2.8.3 1.3.3 1.5 0 2.7-1.1 2.7-2.5S19.8 13 18.3 13H17" })
138
- ]
139
- })
140
- );
141
- };
142
- var H6Icon = (_a) => {
143
- var _b = _a, { size = 17, className } = _b, props = __objRest(_b, ["size", "className"]);
144
- return /* @__PURE__ */ jsxs(
145
- "svg",
146
- __spreadProps(__spreadValues({
147
- xmlns: "http://www.w3.org/2000/svg",
148
- width: size,
149
- height: size,
150
- viewBox: "0 0 24 24",
151
- fill: "none",
152
- stroke: "currentColor",
153
- strokeWidth: 2,
154
- strokeLinecap: "round",
155
- strokeLinejoin: "round"
156
- }, props), {
157
- children: [
158
- /* @__PURE__ */ jsx("path", { d: "M4 12h8" }),
159
- /* @__PURE__ */ jsx("path", { d: "M4 18V6" }),
160
- /* @__PURE__ */ jsx("path", { d: "M12 18V6" }),
161
- /* @__PURE__ */ jsx("circle", { cx: "19", cy: "16", r: "2" }),
162
- /* @__PURE__ */ jsx("path", { d: "M20 10c-2 2-3 3.5-3 6" })
163
- ]
164
- })
165
- );
166
- };
167
- var Pilcrow = (_a) => {
168
- var _b = _a, { size = 17, className } = _b, props = __objRest(_b, ["size", "className"]);
169
- return /* @__PURE__ */ jsxs(
170
- "svg",
171
- __spreadProps(__spreadValues({
172
- xmlns: "http://www.w3.org/2000/svg",
173
- width: size,
174
- height: size,
175
- viewBox: "0 0 24 24",
176
- fill: "none",
177
- stroke: "currentColor",
178
- strokeWidth: 2,
179
- strokeLinecap: "round",
180
- strokeLinejoin: "round"
181
- }, props), {
182
- children: [
183
- /* @__PURE__ */ jsx("path", { d: "M13 4v16" }),
184
- /* @__PURE__ */ jsx("path", { d: "M17 4v16" }),
185
- /* @__PURE__ */ jsx("path", { d: "M19 4H9.5a4.5 4.5 0 0 0 0 9H13" })
186
- ]
187
- })
188
- );
189
- };
190
-
191
- // src/extension/Heading.tsx
192
- import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
193
26
  var Heading = TiptapHeading.extend({
194
27
  addOptions() {
195
28
  var _a;
196
- return __spreadProps(__spreadValues({}, (_a = this.parent) == null ? void 0 : _a.call(this)), {
29
+ const parent = (_a = this.parent) == null ? void 0 : _a.call(this);
30
+ return __spreadProps(__spreadValues({}, parent != null ? parent : {}), {
31
+ showInBubbleMenu: true,
32
+ bubbleMenuPosition: 1,
197
33
  component: ({ options, editor, dropdownContainerClassName, dropdownItemClassName }) => {
34
+ const macKey = isMacOS() ? "\u2318 \u2325 " : "Ctrl \u2325 ";
198
35
  const defaultIcons = {
199
- 1: /* @__PURE__ */ jsx2(H1Icon, {}),
200
- 2: /* @__PURE__ */ jsx2(H2Icon, {}),
201
- 3: /* @__PURE__ */ jsx2(H3Icon, {}),
202
- 4: /* @__PURE__ */ jsx2(H4Icon, {}),
203
- 5: /* @__PURE__ */ jsx2(H5Icon, {}),
204
- 6: /* @__PURE__ */ jsx2(H6Icon, {})
36
+ 1: /* @__PURE__ */ jsx(H1Icon, {}),
37
+ 2: /* @__PURE__ */ jsx(H2Icon, {}),
38
+ 3: /* @__PURE__ */ jsx(H3Icon, {}),
39
+ 4: /* @__PURE__ */ jsx(H4Icon, {}),
40
+ 5: /* @__PURE__ */ jsx(H5Icon, {}),
41
+ 6: /* @__PURE__ */ jsx(H6Icon, {})
205
42
  };
206
43
  const defaultTexts = {
207
44
  1: "Heading 1",
@@ -212,12 +49,12 @@ var Heading = TiptapHeading.extend({
212
49
  6: "Heading 6"
213
50
  };
214
51
  const defaultKeys = {
215
- 1: "\u2318\u2325 1",
216
- 2: "\u2318\u2325 2",
217
- 3: "\u2318\u2325 3",
218
- 4: "\u2318\u2325 4",
219
- 5: "\u2318\u2325 5",
220
- 6: "\u2318\u2325 6"
52
+ 1: `${macKey} 1`,
53
+ 2: `${macKey} 2`,
54
+ 3: `${macKey} 3`,
55
+ 4: `${macKey} 4`,
56
+ 5: `${macKey} 5`,
57
+ 6: `${macKey} 6`
221
58
  };
222
59
  const list = [];
223
60
  const levels = options.level;
@@ -250,7 +87,7 @@ var Heading = TiptapHeading.extend({
250
87
  });
251
88
  });
252
89
  }
253
- return /* @__PURE__ */ jsxs2(
90
+ return /* @__PURE__ */ jsxs(
254
91
  DropdownComponent_default,
255
92
  {
256
93
  className: options.className,
@@ -261,19 +98,19 @@ var Heading = TiptapHeading.extend({
261
98
  tooltip: options.tooltip,
262
99
  tooltipClassName: options.tooltipClassName,
263
100
  tooltipPlacement: options.tooltipPlacement,
264
- _tooltipContent: "Sub & Superscript",
101
+ _tooltipContent: "Headings",
265
102
  _internalContent: "Heading",
266
103
  _dropdownClassName: dropdownContainerClassName,
267
104
  children: [
268
- /* @__PURE__ */ jsx2(
105
+ /* @__PURE__ */ jsx(
269
106
  DropdownItemComponent_default,
270
107
  {
271
108
  onSelect: () => editor.chain().setParagraph().run(),
272
109
  item: {
273
110
  id: crypto.randomUUID(),
274
- icon: /* @__PURE__ */ jsx2(Pilcrow, {}),
111
+ icon: /* @__PURE__ */ jsx(Pilcrow, {}),
275
112
  text: "Paragraph",
276
- keyBind: "\u2318\u2325 P",
113
+ keyBind: `${macKey} P`,
277
114
  onClick: () => editor.chain().setParagraph().run(),
278
115
  name: "paragraph"
279
116
  },
@@ -283,8 +120,8 @@ var Heading = TiptapHeading.extend({
283
120
  _itemClassName: dropdownItemClassName
284
121
  }
285
122
  ),
286
- /* @__PURE__ */ jsx2("hr", { className: "border-gray-200" }),
287
- list.map((item) => /* @__PURE__ */ jsx2(
123
+ /* @__PURE__ */ jsx("hr", { className: "border-gray-200" }),
124
+ list.map((item) => /* @__PURE__ */ jsx(
288
125
  DropdownItemComponent_default,
289
126
  {
290
127
  onSelect: item.onClick,
@@ -302,9 +139,6 @@ var Heading = TiptapHeading.extend({
302
139
  );
303
140
  }
304
141
  });
305
- },
306
- addExtensions() {
307
- return [TiptapParagraph];
308
142
  }
309
143
  });
310
144
  export {
@@ -1,8 +1,10 @@
1
+ import { UndoRedoOptions } from '@tiptap/extensions';
1
2
  import { Extension } from '@tiptap/react';
2
- import { b as ExtWithoutActiveOptions } from '../tiptap-ext.type-DrneAC5G.mjs';
3
+ import { b as ExtWithoutActiveOptions } from '../tiptap-ext.type-B3TtT7-J.mjs';
3
4
  import 'react';
4
5
  import '@floating-ui/react';
5
6
 
6
- declare const History: Extension<ExtWithoutActiveOptions>;
7
+ type ExtHistoryOptions = ExtWithoutActiveOptions<UndoRedoOptions>;
8
+ declare const History: Extension<ExtHistoryOptions>;
7
9
 
8
10
  export { History };
@@ -1,8 +1,10 @@
1
+ import { UndoRedoOptions } from '@tiptap/extensions';
1
2
  import { Extension } from '@tiptap/react';
2
- import { b as ExtWithoutActiveOptions } from '../tiptap-ext.type-DrneAC5G.js';
3
+ import { b as ExtWithoutActiveOptions } from '../tiptap-ext.type-B3TtT7-J.js';
3
4
  import 'react';
4
5
  import '@floating-ui/react';
5
6
 
6
- declare const History: Extension<ExtWithoutActiveOptions>;
7
+ type ExtHistoryOptions = ExtWithoutActiveOptions<UndoRedoOptions>;
8
+ declare const History: Extension<ExtHistoryOptions>;
7
9
 
8
10
  export { History };