ritext 1.0.25 → 1.0.28

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 (49) hide show
  1. package/dist/{chunk-WXCHG3NQ.mjs → chunk-3IVNW3UJ.mjs} +1 -1
  2. package/dist/{chunk-FJQ4FZRS.mjs → chunk-3TQQTC2W.mjs} +3 -3
  3. package/dist/{chunk-EN4BPI7N.mjs → chunk-LLHBVRQR.mjs} +26 -0
  4. package/dist/{chunk-SJFT7WNM.mjs → chunk-M4KZGB5K.mjs} +1 -1
  5. package/dist/{chunk-WZKGD3DD.mjs → chunk-TLG5Z2FX.mjs} +2 -2
  6. package/dist/extension/backgroundcolor.js +2 -2
  7. package/dist/extension/backgroundcolor.mjs +3 -3
  8. package/dist/extension/blockquote.mjs +2 -2
  9. package/dist/extension/bold.mjs +2 -2
  10. package/dist/extension/bulletlist.mjs +2 -2
  11. package/dist/extension/clearformat.mjs +2 -2
  12. package/dist/extension/color.js +2 -2
  13. package/dist/extension/color.mjs +3 -3
  14. package/dist/extension/emoji.js +3 -3
  15. package/dist/extension/emoji.mjs +3 -3
  16. package/dist/extension/font-family.js +2 -2
  17. package/dist/extension/font-family.mjs +2 -2
  18. package/dist/extension/font-size.js +2 -2
  19. package/dist/extension/font-size.mjs +2 -2
  20. package/dist/extension/hardbreak.d.mts +13 -0
  21. package/dist/extension/hardbreak.d.ts +13 -0
  22. package/dist/extension/hardbreak.js +250 -0
  23. package/dist/extension/hardbreak.mjs +45 -0
  24. package/dist/extension/heading.js +2 -2
  25. package/dist/extension/heading.mjs +2 -2
  26. package/dist/extension/history.mjs +2 -2
  27. package/dist/extension/horizontalrule.mjs +2 -2
  28. package/dist/extension/image.mjs +2 -2
  29. package/dist/extension/indentoutdent.mjs +2 -2
  30. package/dist/extension/italic.mjs +2 -2
  31. package/dist/extension/lineheight.js +2 -2
  32. package/dist/extension/lineheight.mjs +2 -2
  33. package/dist/extension/link.js +2 -2
  34. package/dist/extension/link.mjs +2 -2
  35. package/dist/extension/orderedlist.mjs +2 -2
  36. package/dist/extension/strike.mjs +2 -2
  37. package/dist/extension/subandsuperscript.js +2 -2
  38. package/dist/extension/subandsuperscript.mjs +2 -2
  39. package/dist/extension/subscript.mjs +2 -2
  40. package/dist/extension/superscript.mjs +2 -2
  41. package/dist/extension/table.js +2 -2
  42. package/dist/extension/table.mjs +2 -2
  43. package/dist/extension/tasklist.mjs +2 -2
  44. package/dist/extension/textalign.js +2 -2
  45. package/dist/extension/textalign.mjs +2 -2
  46. package/dist/extension/underline.mjs +2 -2
  47. package/dist/index.js +15 -25
  48. package/dist/index.mjs +5 -15
  49. package/package.json +27 -27
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Tooltip_default
3
- } from "./chunk-EN4BPI7N.mjs";
3
+ } from "./chunk-LLHBVRQR.mjs";
4
4
 
5
5
  // src/lib/components/ButtonWithoutActive.tsx
6
6
  import { useMemo } from "react";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  ArrowIcon,
3
3
  Tooltip_default
4
- } from "./chunk-EN4BPI7N.mjs";
4
+ } from "./chunk-LLHBVRQR.mjs";
5
5
  import {
6
6
  __spreadProps,
7
7
  __spreadValues
@@ -27,8 +27,8 @@ var DropdownComponent = ({ children, className, showArrow = true, content, dropd
27
27
  const { getReferenceProps, getFloatingProps } = useInteractions([click, dismiss]);
28
28
  const listId = useId();
29
29
  const tooltipContent = /* @__PURE__ */ jsx("p", { children: typeof tooltip === "string" ? tooltip : _tooltipContent });
30
- const initialMotion = { opacity: 0, scale: 0.95 };
31
- const animateMotion = { opacity: 1, scale: 1 };
30
+ const initialMotion = { opacity: 0, y: -5 };
31
+ const animateMotion = { opacity: 1, y: 0 };
32
32
  const enhancedChildren = Children.map(children, (child) => {
33
33
  if (!isValidElement(child)) return child;
34
34
  const prevOnSelect = child.props.onSelect;
@@ -1081,6 +1081,31 @@ var EmojiIcon = (_a) => {
1081
1081
  })
1082
1082
  );
1083
1083
  };
1084
+ var HardBreakIcon = (_a) => {
1085
+ var _b = _a, { size = 17, className } = _b, props = __objRest(_b, ["size", "className"]);
1086
+ return /* @__PURE__ */ jsxs(
1087
+ "svg",
1088
+ __spreadProps(__spreadValues({
1089
+ xmlns: "http://www.w3.org/2000/svg",
1090
+ viewBox: "0 0 24 24",
1091
+ fill: "none",
1092
+ stroke: "currentColor",
1093
+ strokeWidth: 2,
1094
+ strokeLinecap: "round",
1095
+ strokeLinejoin: "round",
1096
+ width: size,
1097
+ height: size,
1098
+ className
1099
+ }, props), {
1100
+ children: [
1101
+ /* @__PURE__ */ jsx("path", { d: "m16 16-3 3 3 3" }),
1102
+ /* @__PURE__ */ jsx("path", { d: "M3 12h14.5a1 1 0 0 1 0 7H13" }),
1103
+ /* @__PURE__ */ jsx("path", { d: "M3 19h6" }),
1104
+ /* @__PURE__ */ jsx("path", { d: "M3 5h18" })
1105
+ ]
1106
+ })
1107
+ );
1108
+ };
1084
1109
 
1085
1110
  // src/lib/components/_com/Tooltip.tsx
1086
1111
  import { useState, Fragment, cloneElement, isValidElement, useId } from "react";
@@ -1209,5 +1234,6 @@ export {
1209
1234
  DragVerticalIcon,
1210
1235
  PlusIcon,
1211
1236
  EmojiIcon,
1237
+ HardBreakIcon,
1212
1238
  Tooltip_default
1213
1239
  };
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-VYDH6BZE.mjs";
4
4
  import {
5
5
  Tooltip_default
6
- } from "./chunk-EN4BPI7N.mjs";
6
+ } from "./chunk-LLHBVRQR.mjs";
7
7
 
8
8
  // src/lib/components/ButtonComponent.tsx
9
9
  import { useMemo } from "react";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  DropdownComponent_default
3
- } from "./chunk-FJQ4FZRS.mjs";
3
+ } from "./chunk-3TQQTC2W.mjs";
4
4
  import {
5
5
  useEditor
6
6
  } from "./chunk-VYDH6BZE.mjs";
@@ -8,7 +8,7 @@ import {
8
8
  BackgroundIcon,
9
9
  ColorIcon,
10
10
  Palette
11
- } from "./chunk-EN4BPI7N.mjs";
11
+ } from "./chunk-LLHBVRQR.mjs";
12
12
  import {
13
13
  __spreadProps,
14
14
  __spreadValues
@@ -292,8 +292,8 @@ var DropdownComponent = ({ children, className, showArrow = true, content, dropd
292
292
  const { getReferenceProps, getFloatingProps } = (0, import_react5.useInteractions)([click, dismiss]);
293
293
  const listId = (0, import_react4.useId)();
294
294
  const tooltipContent = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { children: typeof tooltip === "string" ? tooltip : _tooltipContent });
295
- const initialMotion = { opacity: 0, scale: 0.95 };
296
- const animateMotion = { opacity: 1, scale: 1 };
295
+ const initialMotion = { opacity: 0, y: -5 };
296
+ const animateMotion = { opacity: 1, y: 0 };
297
297
  const enhancedChildren = import_react4.Children.map(children, (child) => {
298
298
  if (!(0, import_react4.isValidElement)(child)) return child;
299
299
  const prevOnSelect = child.props.onSelect;
@@ -2,12 +2,12 @@ import {
2
2
  ColorComponent_default,
3
3
  ColorIconComponent_default,
4
4
  DEFAULT_COLOR_LIST
5
- } from "../chunk-WZKGD3DD.mjs";
5
+ } from "../chunk-TLG5Z2FX.mjs";
6
6
  import {
7
7
  DropdownComponent_default
8
- } from "../chunk-FJQ4FZRS.mjs";
8
+ } from "../chunk-3TQQTC2W.mjs";
9
9
  import "../chunk-VYDH6BZE.mjs";
10
- import "../chunk-EN4BPI7N.mjs";
10
+ import "../chunk-LLHBVRQR.mjs";
11
11
  import {
12
12
  __spreadProps,
13
13
  __spreadValues
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  ButtonComponent_default
3
- } from "../chunk-SJFT7WNM.mjs";
3
+ } from "../chunk-M4KZGB5K.mjs";
4
4
  import "../chunk-VYDH6BZE.mjs";
5
5
  import {
6
6
  BlockquoteLeft
7
- } from "../chunk-EN4BPI7N.mjs";
7
+ } from "../chunk-LLHBVRQR.mjs";
8
8
  import {
9
9
  __spreadProps,
10
10
  __spreadValues
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  ButtonComponent_default
3
- } from "../chunk-SJFT7WNM.mjs";
3
+ } from "../chunk-M4KZGB5K.mjs";
4
4
  import "../chunk-VYDH6BZE.mjs";
5
5
  import {
6
6
  BoldIcon
7
- } from "../chunk-EN4BPI7N.mjs";
7
+ } from "../chunk-LLHBVRQR.mjs";
8
8
  import {
9
9
  __spreadProps,
10
10
  __spreadValues
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  ButtonComponent_default
3
- } from "../chunk-SJFT7WNM.mjs";
3
+ } from "../chunk-M4KZGB5K.mjs";
4
4
  import "../chunk-VYDH6BZE.mjs";
5
5
  import {
6
6
  BulletListIcon
7
- } from "../chunk-EN4BPI7N.mjs";
7
+ } from "../chunk-LLHBVRQR.mjs";
8
8
  import {
9
9
  __spreadProps,
10
10
  __spreadValues
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  ButtonWithoutActive_default
3
- } from "../chunk-WXCHG3NQ.mjs";
3
+ } from "../chunk-3IVNW3UJ.mjs";
4
4
  import {
5
5
  ClearIcon
6
- } from "../chunk-EN4BPI7N.mjs";
6
+ } from "../chunk-LLHBVRQR.mjs";
7
7
  import {
8
8
  __spreadProps,
9
9
  __spreadValues
@@ -293,8 +293,8 @@ var DropdownComponent = ({ children, className, showArrow = true, content, dropd
293
293
  const { getReferenceProps, getFloatingProps } = (0, import_react5.useInteractions)([click, dismiss]);
294
294
  const listId = (0, import_react4.useId)();
295
295
  const tooltipContent = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { children: typeof tooltip === "string" ? tooltip : _tooltipContent });
296
- const initialMotion = { opacity: 0, scale: 0.95 };
297
- const animateMotion = { opacity: 1, scale: 1 };
296
+ const initialMotion = { opacity: 0, y: -5 };
297
+ const animateMotion = { opacity: 1, y: 0 };
298
298
  const enhancedChildren = import_react4.Children.map(children, (child) => {
299
299
  if (!(0, import_react4.isValidElement)(child)) return child;
300
300
  const prevOnSelect = child.props.onSelect;
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  Color,
3
3
  DEFAULT_COLOR_LIST
4
- } from "../chunk-WZKGD3DD.mjs";
5
- import "../chunk-FJQ4FZRS.mjs";
4
+ } from "../chunk-TLG5Z2FX.mjs";
5
+ import "../chunk-3TQQTC2W.mjs";
6
6
  import "../chunk-VYDH6BZE.mjs";
7
- import "../chunk-EN4BPI7N.mjs";
7
+ import "../chunk-LLHBVRQR.mjs";
8
8
  import "../chunk-WNQUEZJF.mjs";
9
9
  export {
10
10
  Color,
@@ -209,8 +209,8 @@ var DropdownComponent = ({ children, className, showArrow = true, content, dropd
209
209
  const { getReferenceProps, getFloatingProps } = (0, import_react5.useInteractions)([click, dismiss]);
210
210
  const listId = (0, import_react4.useId)();
211
211
  const tooltipContent = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { children: typeof tooltip === "string" ? tooltip : _tooltipContent });
212
- const initialMotion = { opacity: 0, scale: 0.95 };
213
- const animateMotion = { opacity: 1, scale: 1 };
212
+ const initialMotion = { opacity: 0, y: -5 };
213
+ const animateMotion = { opacity: 1, y: 0 };
214
214
  const enhancedChildren = import_react4.Children.map(children, (child) => {
215
215
  if (!(0, import_react4.isValidElement)(child)) return child;
216
216
  const prevOnSelect = child.props.onSelect;
@@ -387,7 +387,7 @@ var Emoji = import_extension_emoji2.Emoji.extend({
387
387
  return __spreadProps(__spreadValues({}, parent != null ? parent : {}), {
388
388
  openOnClick: false,
389
389
  showInBubbleMenu: false,
390
- bubbleMenuPosition: 10,
390
+ bubbleMenuPosition: 11,
391
391
  component: ({ options, editor, dropdownContainerClassName }) => {
392
392
  return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react8.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
393
393
  DropdownComponent_default,
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  DropdownComponent_default
3
- } from "../chunk-FJQ4FZRS.mjs";
3
+ } from "../chunk-3TQQTC2W.mjs";
4
4
  import {
5
5
  EmojiIcon
6
- } from "../chunk-EN4BPI7N.mjs";
6
+ } from "../chunk-LLHBVRQR.mjs";
7
7
  import {
8
8
  __spreadProps,
9
9
  __spreadValues
@@ -125,7 +125,7 @@ var Emoji = TiptapEmoji.extend({
125
125
  return __spreadProps(__spreadValues({}, parent != null ? parent : {}), {
126
126
  openOnClick: false,
127
127
  showInBubbleMenu: false,
128
- bubbleMenuPosition: 10,
128
+ bubbleMenuPosition: 11,
129
129
  component: ({ options, editor, dropdownContainerClassName }) => {
130
130
  return /* @__PURE__ */ jsx2(Fragment, { children: /* @__PURE__ */ jsx2(
131
131
  DropdownComponent_default,
@@ -184,8 +184,8 @@ var DropdownComponent = ({ children, className, showArrow = true, content, dropd
184
184
  const { getReferenceProps, getFloatingProps } = (0, import_react5.useInteractions)([click, dismiss]);
185
185
  const listId = (0, import_react4.useId)();
186
186
  const tooltipContent = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { children: typeof tooltip === "string" ? tooltip : _tooltipContent });
187
- const initialMotion = { opacity: 0, scale: 0.95 };
188
- const animateMotion = { opacity: 1, scale: 1 };
187
+ const initialMotion = { opacity: 0, y: -5 };
188
+ const animateMotion = { opacity: 1, y: 0 };
189
189
  const enhancedChildren = import_react4.Children.map(children, (child) => {
190
190
  if (!(0, import_react4.isValidElement)(child)) return child;
191
191
  const prevOnSelect = child.props.onSelect;
@@ -3,9 +3,9 @@ import {
3
3
  } from "../chunk-M4ORWR74.mjs";
4
4
  import {
5
5
  DropdownComponent_default
6
- } from "../chunk-FJQ4FZRS.mjs";
6
+ } from "../chunk-3TQQTC2W.mjs";
7
7
  import "../chunk-VYDH6BZE.mjs";
8
- import "../chunk-EN4BPI7N.mjs";
8
+ import "../chunk-LLHBVRQR.mjs";
9
9
  import {
10
10
  __spreadProps,
11
11
  __spreadValues
@@ -184,8 +184,8 @@ var DropdownComponent = ({ children, className, showArrow = true, content, dropd
184
184
  const { getReferenceProps, getFloatingProps } = (0, import_react5.useInteractions)([click, dismiss]);
185
185
  const listId = (0, import_react4.useId)();
186
186
  const tooltipContent = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { children: typeof tooltip === "string" ? tooltip : _tooltipContent });
187
- const initialMotion = { opacity: 0, scale: 0.95 };
188
- const animateMotion = { opacity: 1, scale: 1 };
187
+ const initialMotion = { opacity: 0, y: -5 };
188
+ const animateMotion = { opacity: 1, y: 0 };
189
189
  const enhancedChildren = import_react4.Children.map(children, (child) => {
190
190
  if (!(0, import_react4.isValidElement)(child)) return child;
191
191
  const prevOnSelect = child.props.onSelect;
@@ -3,9 +3,9 @@ import {
3
3
  } from "../chunk-M4ORWR74.mjs";
4
4
  import {
5
5
  DropdownComponent_default
6
- } from "../chunk-FJQ4FZRS.mjs";
6
+ } from "../chunk-3TQQTC2W.mjs";
7
7
  import "../chunk-VYDH6BZE.mjs";
8
- import "../chunk-EN4BPI7N.mjs";
8
+ import "../chunk-LLHBVRQR.mjs";
9
9
  import {
10
10
  __spreadProps,
11
11
  __spreadValues
@@ -0,0 +1,13 @@
1
+ import { HardBreakOptions } from '@tiptap/extension-hard-break';
2
+ import { Node } from '@tiptap/react';
3
+ import { b as ExtWithoutActiveOptions } from '../tiptap-ext.type-B3TtT7-J.mjs';
4
+ import 'react';
5
+ import '@floating-ui/react';
6
+
7
+ type ExtBoldOptions = ExtWithoutActiveOptions<HardBreakOptions & {
8
+ showInBubbleMenu?: boolean;
9
+ bubbleMenuPosition?: number;
10
+ }>;
11
+ declare const HardBreak: Node<ExtBoldOptions>;
12
+
13
+ export { HardBreak };
@@ -0,0 +1,13 @@
1
+ import { HardBreakOptions } from '@tiptap/extension-hard-break';
2
+ import { Node } from '@tiptap/react';
3
+ import { b as ExtWithoutActiveOptions } from '../tiptap-ext.type-B3TtT7-J.js';
4
+ import 'react';
5
+ import '@floating-ui/react';
6
+
7
+ type ExtBoldOptions = ExtWithoutActiveOptions<HardBreakOptions & {
8
+ showInBubbleMenu?: boolean;
9
+ bubbleMenuPosition?: number;
10
+ }>;
11
+ declare const HardBreak: Node<ExtBoldOptions>;
12
+
13
+ export { HardBreak };
@@ -0,0 +1,250 @@
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/HardBreak.tsx
50
+ var HardBreak_exports = {};
51
+ __export(HardBreak_exports, {
52
+ HardBreak: () => HardBreak
53
+ });
54
+ module.exports = __toCommonJS(HardBreak_exports);
55
+ var import_extension_hard_break = require("@tiptap/extension-hard-break");
56
+
57
+ // src/lib/icons/index.tsx
58
+ var import_jsx_runtime = require("react/jsx-runtime");
59
+ var HardBreakIcon = (_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
+ viewBox: "0 0 24 24",
66
+ fill: "none",
67
+ stroke: "currentColor",
68
+ strokeWidth: 2,
69
+ strokeLinecap: "round",
70
+ strokeLinejoin: "round",
71
+ width: size,
72
+ height: size,
73
+ className
74
+ }, props), {
75
+ children: [
76
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "m16 16-3 3 3 3" }),
77
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M3 12h14.5a1 1 0 0 1 0 7H13" }),
78
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M3 19h6" }),
79
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M3 5h18" })
80
+ ]
81
+ })
82
+ );
83
+ };
84
+
85
+ // src/lib/components/ButtonWithoutActive.tsx
86
+ var import_react4 = require("react");
87
+ var import_tailwind_merge2 = require("tailwind-merge");
88
+
89
+ // src/lib/components/_com/Tooltip.tsx
90
+ var import_react = require("react");
91
+ var import_react2 = require("@floating-ui/react");
92
+ var import_react3 = require("motion/react");
93
+ var import_tailwind_merge = require("tailwind-merge");
94
+ var import_jsx_runtime2 = require("react/jsx-runtime");
95
+ var Tooltip = ({ placement = "top", children, content, className }) => {
96
+ const [open, setOpen] = (0, import_react.useState)(false);
97
+ const { x, y, refs, strategy, context, placement: resolvedPlacement } = (0, import_react2.useFloating)({
98
+ open,
99
+ onOpenChange: setOpen,
100
+ placement,
101
+ middleware: [(0, import_react2.offset)(8), (0, import_react2.flip)(), (0, import_react2.shift)({ padding: 8 })],
102
+ whileElementsMounted: import_react2.autoUpdate
103
+ });
104
+ const hover = (0, import_react2.useHover)(context);
105
+ const dismiss = (0, import_react2.useDismiss)(context);
106
+ const { getReferenceProps, getFloatingProps } = (0, import_react2.useInteractions)([hover, dismiss]);
107
+ const id = (0, import_react.useId)();
108
+ function mergeRefs(...refsToMerge) {
109
+ return (node) => {
110
+ for (const r of refsToMerge) {
111
+ if (!r) continue;
112
+ if (typeof r === "function") r(node);
113
+ else r.current = node;
114
+ }
115
+ };
116
+ }
117
+ const side = resolvedPlacement.split("-")[0];
118
+ const enterOffset = 6;
119
+ const getInitial = () => {
120
+ switch (side) {
121
+ case "top":
122
+ return { opacity: 0, y: enterOffset };
123
+ case "bottom":
124
+ return { opacity: 0, y: -enterOffset };
125
+ case "left":
126
+ return { opacity: 0, x: enterOffset };
127
+ case "right":
128
+ return { opacity: 0, x: -enterOffset };
129
+ default:
130
+ return { opacity: 0 };
131
+ }
132
+ };
133
+ const getExit = () => __spreadProps(__spreadValues({}, getInitial()), { opacity: 0 });
134
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_react.Fragment, { children: [
135
+ (0, import_react.isValidElement)(children) ? (0, import_react.cloneElement)(children, __spreadProps(__spreadValues({}, getReferenceProps({
136
+ onFocus: () => setOpen(true),
137
+ onBlur: () => setOpen(false),
138
+ "aria-describedby": open ? id : void 0
139
+ /* eslint-disable @typescript-eslint/no-explicit-any */
140
+ })), {
141
+ /* eslint-disable @typescript-eslint/no-explicit-any */
142
+ ref: mergeRefs(children.props.ref, refs.setReference)
143
+ })) : children,
144
+ /* @__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)(
145
+ import_react3.motion.div,
146
+ __spreadProps(__spreadValues({
147
+ ref: refs.setFloating
148
+ }, getFloatingProps({
149
+ role: "tooltip",
150
+ id,
151
+ style: {
152
+ position: strategy,
153
+ top: y != null ? y : 0,
154
+ left: x != null ? x : 0,
155
+ pointerEvents: "none"
156
+ }
157
+ })), {
158
+ initial: getInitial(),
159
+ animate: { opacity: 1, x: 0, y: 0, scale: 1 },
160
+ exit: getExit(),
161
+ transition: { type: "spring", stiffness: 420, damping: 30, mass: 0.6 },
162
+ 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),
163
+ children: content
164
+ }),
165
+ "tooltip"
166
+ ) }) })
167
+ ] });
168
+ };
169
+ var Tooltip_default = Tooltip;
170
+
171
+ // src/lib/components/ButtonWithoutActive.tsx
172
+ var import_react5 = require("@tiptap/react");
173
+ var import_jsx_runtime3 = require("react/jsx-runtime");
174
+ var ButtonWithoutActive = ({ className, icon, style, tooltip = true, tooltipClassName, tooltipPlacement, _internalIcon, _tooltipContent, _interShortcut, _onToggle, _buttonClassName, _disabled = false }) => {
175
+ const shortcutText = (0, import_react4.useMemo)(() => {
176
+ if (!_interShortcut) return "";
177
+ return (0, import_react5.isMacOS)() ? _interShortcut.mac : _interShortcut.win;
178
+ }, [_interShortcut]);
179
+ const tooltipContent = /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("p", { children: [
180
+ typeof tooltip === "string" ? tooltip : _tooltipContent,
181
+ _interShortcut && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
182
+ " ",
183
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("br", {}),
184
+ " ",
185
+ shortcutText,
186
+ " "
187
+ ] })
188
+ ] });
189
+ const btn = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
190
+ "button",
191
+ {
192
+ onClick: _onToggle,
193
+ disabled: _disabled,
194
+ className: (0, import_tailwind_merge2.twMerge)(
195
+ "py-1.5 px-2.5 rounded-md hover:bg-gray-100",
196
+ _disabled ? "opacity-20" : "",
197
+ _buttonClassName,
198
+ className
199
+ ),
200
+ style,
201
+ children: icon != null ? icon : _internalIcon
202
+ }
203
+ );
204
+ if (tooltip === false) return btn;
205
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
206
+ Tooltip_default,
207
+ {
208
+ content: tooltipContent,
209
+ className: tooltipClassName,
210
+ placement: tooltipPlacement,
211
+ children: btn
212
+ }
213
+ );
214
+ };
215
+ var ButtonWithoutActive_default = ButtonWithoutActive;
216
+
217
+ // src/extension/HardBreak.tsx
218
+ var import_jsx_runtime4 = require("react/jsx-runtime");
219
+ var HardBreak = import_extension_hard_break.HardBreak.extend({
220
+ addOptions() {
221
+ var _a;
222
+ const parent = (_a = this.parent) == null ? void 0 : _a.call(this);
223
+ return __spreadProps(__spreadValues({}, parent != null ? parent : {}), {
224
+ showInBubbleMenu: true,
225
+ bubbleMenuPosition: 10,
226
+ component: ({ editor, options, buttonClassName }) => {
227
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
228
+ ButtonWithoutActive_default,
229
+ {
230
+ className: options.className,
231
+ icon: options.icon,
232
+ style: options.style,
233
+ tooltip: options.tooltip,
234
+ tooltipClassName: options.tooltipClassName,
235
+ tooltipPlacement: options.tooltipPlacement,
236
+ _internalIcon: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(HardBreakIcon, {}),
237
+ _onToggle: () => editor.chain().focus().setHardBreak().run(),
238
+ _interShortcut: { win: "\u21E7 + \u23CE + Ctrl + \u23CE", mac: "\u21E7 + \u23CE + \u2318 + \u23CE" },
239
+ _tooltipContent: "Hard Break",
240
+ _buttonClassName: buttonClassName
241
+ }
242
+ );
243
+ }
244
+ });
245
+ }
246
+ });
247
+ // Annotate the CommonJS export names for ESM import in node:
248
+ 0 && (module.exports = {
249
+ HardBreak
250
+ });
@@ -0,0 +1,45 @@
1
+ import {
2
+ ButtonWithoutActive_default
3
+ } from "../chunk-3IVNW3UJ.mjs";
4
+ import {
5
+ HardBreakIcon
6
+ } from "../chunk-LLHBVRQR.mjs";
7
+ import {
8
+ __spreadProps,
9
+ __spreadValues
10
+ } from "../chunk-WNQUEZJF.mjs";
11
+
12
+ // src/extension/HardBreak.tsx
13
+ import { HardBreak as TiptapHardBreak } from "@tiptap/extension-hard-break";
14
+ import { jsx } from "react/jsx-runtime";
15
+ var HardBreak = TiptapHardBreak.extend({
16
+ addOptions() {
17
+ var _a;
18
+ const parent = (_a = this.parent) == null ? void 0 : _a.call(this);
19
+ return __spreadProps(__spreadValues({}, parent != null ? parent : {}), {
20
+ showInBubbleMenu: true,
21
+ bubbleMenuPosition: 10,
22
+ component: ({ editor, options, buttonClassName }) => {
23
+ return /* @__PURE__ */ jsx(
24
+ ButtonWithoutActive_default,
25
+ {
26
+ className: options.className,
27
+ icon: options.icon,
28
+ style: options.style,
29
+ tooltip: options.tooltip,
30
+ tooltipClassName: options.tooltipClassName,
31
+ tooltipPlacement: options.tooltipPlacement,
32
+ _internalIcon: /* @__PURE__ */ jsx(HardBreakIcon, {}),
33
+ _onToggle: () => editor.chain().focus().setHardBreak().run(),
34
+ _interShortcut: { win: "\u21E7 + \u23CE + Ctrl + \u23CE", mac: "\u21E7 + \u23CE + \u2318 + \u23CE" },
35
+ _tooltipContent: "Hard Break",
36
+ _buttonClassName: buttonClassName
37
+ }
38
+ );
39
+ }
40
+ });
41
+ }
42
+ });
43
+ export {
44
+ HardBreak
45
+ };
@@ -353,8 +353,8 @@ var DropdownComponent = ({ children, className, showArrow = true, content, dropd
353
353
  const { getReferenceProps, getFloatingProps } = (0, import_react5.useInteractions)([click, dismiss]);
354
354
  const listId = (0, import_react4.useId)();
355
355
  const tooltipContent = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { children: typeof tooltip === "string" ? tooltip : _tooltipContent });
356
- const initialMotion = { opacity: 0, scale: 0.95 };
357
- const animateMotion = { opacity: 1, scale: 1 };
356
+ const initialMotion = { opacity: 0, y: -5 };
357
+ const animateMotion = { opacity: 1, y: 0 };
358
358
  const enhancedChildren = import_react4.Children.map(children, (child) => {
359
359
  if (!(0, import_react4.isValidElement)(child)) return child;
360
360
  const prevOnSelect = child.props.onSelect;
@@ -3,7 +3,7 @@ import {
3
3
  } from "../chunk-M4ORWR74.mjs";
4
4
  import {
5
5
  DropdownComponent_default
6
- } from "../chunk-FJQ4FZRS.mjs";
6
+ } from "../chunk-3TQQTC2W.mjs";
7
7
  import "../chunk-VYDH6BZE.mjs";
8
8
  import {
9
9
  H1Icon,
@@ -13,7 +13,7 @@ import {
13
13
  H5Icon,
14
14
  H6Icon,
15
15
  Pilcrow
16
- } from "../chunk-EN4BPI7N.mjs";
16
+ } from "../chunk-LLHBVRQR.mjs";
17
17
  import {
18
18
  __spreadProps,
19
19
  __spreadValues
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  ButtonWithoutActive_default
3
- } from "../chunk-WXCHG3NQ.mjs";
3
+ } from "../chunk-3IVNW3UJ.mjs";
4
4
  import {
5
5
  Redo2,
6
6
  Undo2
7
- } from "../chunk-EN4BPI7N.mjs";
7
+ } from "../chunk-LLHBVRQR.mjs";
8
8
  import {
9
9
  __spreadProps,
10
10
  __spreadValues
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  ButtonWithoutActive_default
3
- } from "../chunk-WXCHG3NQ.mjs";
3
+ } from "../chunk-3IVNW3UJ.mjs";
4
4
  import {
5
5
  MinusIcon
6
- } from "../chunk-EN4BPI7N.mjs";
6
+ } from "../chunk-LLHBVRQR.mjs";
7
7
  import {
8
8
  __spreadProps,
9
9
  __spreadValues
@@ -4,7 +4,7 @@ import {
4
4
  } from "../chunk-W367UGID.mjs";
5
5
  import {
6
6
  ButtonWithoutActive_default
7
- } from "../chunk-WXCHG3NQ.mjs";
7
+ } from "../chunk-3IVNW3UJ.mjs";
8
8
  import {
9
9
  AlignCenter,
10
10
  AlignLeft,
@@ -16,7 +16,7 @@ import {
16
16
  ImageUpIcon,
17
17
  Tooltip_default,
18
18
  TrashIcon
19
- } from "../chunk-EN4BPI7N.mjs";
19
+ } from "../chunk-LLHBVRQR.mjs";
20
20
  import {
21
21
  __async,
22
22
  __objRest,
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  ButtonComponent_default
3
- } from "../chunk-SJFT7WNM.mjs";
3
+ } from "../chunk-M4KZGB5K.mjs";
4
4
  import "../chunk-VYDH6BZE.mjs";
5
5
  import {
6
6
  IndentIcon,
7
7
  OutdentIcon
8
- } from "../chunk-EN4BPI7N.mjs";
8
+ } from "../chunk-LLHBVRQR.mjs";
9
9
  import {
10
10
  __spreadProps,
11
11
  __spreadValues
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  ButtonComponent_default
3
- } from "../chunk-SJFT7WNM.mjs";
3
+ } from "../chunk-M4KZGB5K.mjs";
4
4
  import "../chunk-VYDH6BZE.mjs";
5
5
  import {
6
6
  ItalicIcon
7
- } from "../chunk-EN4BPI7N.mjs";
7
+ } from "../chunk-LLHBVRQR.mjs";
8
8
  import {
9
9
  __spreadProps,
10
10
  __spreadValues
@@ -191,8 +191,8 @@ var DropdownComponent = ({ children, className, showArrow = true, content, dropd
191
191
  const { getReferenceProps, getFloatingProps } = (0, import_react5.useInteractions)([click, dismiss]);
192
192
  const listId = (0, import_react4.useId)();
193
193
  const tooltipContent = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { children: typeof tooltip === "string" ? tooltip : _tooltipContent });
194
- const initialMotion = { opacity: 0, scale: 0.95 };
195
- const animateMotion = { opacity: 1, scale: 1 };
194
+ const initialMotion = { opacity: 0, y: -5 };
195
+ const animateMotion = { opacity: 1, y: 0 };
196
196
  const enhancedChildren = import_react4.Children.map(children, (child) => {
197
197
  if (!(0, import_react4.isValidElement)(child)) return child;
198
198
  const prevOnSelect = child.props.onSelect;
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  DropdownComponent_default
3
- } from "../chunk-FJQ4FZRS.mjs";
3
+ } from "../chunk-3TQQTC2W.mjs";
4
4
  import {
5
5
  useEditor
6
6
  } from "../chunk-VYDH6BZE.mjs";
7
7
  import {
8
8
  FormatLineHeight
9
- } from "../chunk-EN4BPI7N.mjs";
9
+ } from "../chunk-LLHBVRQR.mjs";
10
10
  import {
11
11
  __spreadProps,
12
12
  __spreadValues
@@ -205,8 +205,8 @@ var DropdownComponent = ({ children, className, showArrow = true, content, dropd
205
205
  const { getReferenceProps, getFloatingProps } = (0, import_react5.useInteractions)([click, dismiss]);
206
206
  const listId = (0, import_react4.useId)();
207
207
  const tooltipContent = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { children: typeof tooltip === "string" ? tooltip : _tooltipContent });
208
- const initialMotion = { opacity: 0, scale: 0.95 };
209
- const animateMotion = { opacity: 1, scale: 1 };
208
+ const initialMotion = { opacity: 0, y: -5 };
209
+ const animateMotion = { opacity: 1, y: 0 };
210
210
  const enhancedChildren = import_react4.Children.map(children, (child) => {
211
211
  if (!(0, import_react4.isValidElement)(child)) return child;
212
212
  const prevOnSelect = child.props.onSelect;
@@ -4,13 +4,13 @@ import {
4
4
  } from "../chunk-W367UGID.mjs";
5
5
  import {
6
6
  DropdownComponent_default
7
- } from "../chunk-FJQ4FZRS.mjs";
7
+ } from "../chunk-3TQQTC2W.mjs";
8
8
  import {
9
9
  useEditor
10
10
  } from "../chunk-VYDH6BZE.mjs";
11
11
  import {
12
12
  LinkIcon
13
- } from "../chunk-EN4BPI7N.mjs";
13
+ } from "../chunk-LLHBVRQR.mjs";
14
14
  import {
15
15
  __spreadProps,
16
16
  __spreadValues
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  ButtonComponent_default
3
- } from "../chunk-SJFT7WNM.mjs";
3
+ } from "../chunk-M4KZGB5K.mjs";
4
4
  import "../chunk-VYDH6BZE.mjs";
5
5
  import {
6
6
  OrderListIcon
7
- } from "../chunk-EN4BPI7N.mjs";
7
+ } from "../chunk-LLHBVRQR.mjs";
8
8
  import {
9
9
  __spreadProps,
10
10
  __spreadValues
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  ButtonComponent_default
3
- } from "../chunk-SJFT7WNM.mjs";
3
+ } from "../chunk-M4KZGB5K.mjs";
4
4
  import "../chunk-VYDH6BZE.mjs";
5
5
  import {
6
6
  StrikeIcon
7
- } from "../chunk-EN4BPI7N.mjs";
7
+ } from "../chunk-LLHBVRQR.mjs";
8
8
  import {
9
9
  __spreadProps,
10
10
  __spreadValues
@@ -266,8 +266,8 @@ var DropdownComponent = ({ children, className, showArrow = true, content, dropd
266
266
  const { getReferenceProps, getFloatingProps } = (0, import_react5.useInteractions)([click, dismiss]);
267
267
  const listId = (0, import_react4.useId)();
268
268
  const tooltipContent = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { children: typeof tooltip === "string" ? tooltip : _tooltipContent });
269
- const initialMotion = { opacity: 0, scale: 0.95 };
270
- const animateMotion = { opacity: 1, scale: 1 };
269
+ const initialMotion = { opacity: 0, y: -5 };
270
+ const animateMotion = { opacity: 1, y: 0 };
271
271
  const enhancedChildren = import_react4.Children.map(children, (child) => {
272
272
  if (!(0, import_react4.isValidElement)(child)) return child;
273
273
  const prevOnSelect = child.props.onSelect;
@@ -3,13 +3,13 @@ import {
3
3
  } from "../chunk-M4ORWR74.mjs";
4
4
  import {
5
5
  DropdownComponent_default
6
- } from "../chunk-FJQ4FZRS.mjs";
6
+ } from "../chunk-3TQQTC2W.mjs";
7
7
  import "../chunk-VYDH6BZE.mjs";
8
8
  import {
9
9
  SubAndSupIcon,
10
10
  SubIcon,
11
11
  SupIcon
12
- } from "../chunk-EN4BPI7N.mjs";
12
+ } from "../chunk-LLHBVRQR.mjs";
13
13
  import {
14
14
  __spreadProps,
15
15
  __spreadValues
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  ButtonComponent_default
3
- } from "../chunk-SJFT7WNM.mjs";
3
+ } from "../chunk-M4KZGB5K.mjs";
4
4
  import "../chunk-VYDH6BZE.mjs";
5
5
  import {
6
6
  SubIcon
7
- } from "../chunk-EN4BPI7N.mjs";
7
+ } from "../chunk-LLHBVRQR.mjs";
8
8
  import {
9
9
  __spreadProps,
10
10
  __spreadValues
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  ButtonComponent_default
3
- } from "../chunk-SJFT7WNM.mjs";
3
+ } from "../chunk-M4KZGB5K.mjs";
4
4
  import "../chunk-VYDH6BZE.mjs";
5
5
  import {
6
6
  SupIcon
7
- } from "../chunk-EN4BPI7N.mjs";
7
+ } from "../chunk-LLHBVRQR.mjs";
8
8
  import {
9
9
  __spreadProps,
10
10
  __spreadValues
@@ -207,8 +207,8 @@ var DropdownComponent = ({ children, className, showArrow = true, content, dropd
207
207
  const { getReferenceProps, getFloatingProps } = (0, import_react5.useInteractions)([click, dismiss]);
208
208
  const listId = (0, import_react4.useId)();
209
209
  const tooltipContent = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { children: typeof tooltip === "string" ? tooltip : _tooltipContent });
210
- const initialMotion = { opacity: 0, scale: 0.95 };
211
- const animateMotion = { opacity: 1, scale: 1 };
210
+ const initialMotion = { opacity: 0, y: -5 };
211
+ const animateMotion = { opacity: 1, y: 0 };
212
212
  const enhancedChildren = import_react4.Children.map(children, (child) => {
213
213
  if (!(0, import_react4.isValidElement)(child)) return child;
214
214
  const prevOnSelect = child.props.onSelect;
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  DropdownComponent_default
3
- } from "../chunk-FJQ4FZRS.mjs";
3
+ } from "../chunk-3TQQTC2W.mjs";
4
4
  import {
5
5
  TabelIcon
6
- } from "../chunk-EN4BPI7N.mjs";
6
+ } from "../chunk-LLHBVRQR.mjs";
7
7
  import {
8
8
  __spreadProps,
9
9
  __spreadValues
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  ButtonComponent_default
3
- } from "../chunk-SJFT7WNM.mjs";
3
+ } from "../chunk-M4KZGB5K.mjs";
4
4
  import "../chunk-VYDH6BZE.mjs";
5
5
  import {
6
6
  TaskListIcon
7
- } from "../chunk-EN4BPI7N.mjs";
7
+ } from "../chunk-LLHBVRQR.mjs";
8
8
  import {
9
9
  __spreadProps,
10
10
  __spreadValues
@@ -273,8 +273,8 @@ var DropdownComponent = ({ children, className, showArrow = true, content, dropd
273
273
  const { getReferenceProps, getFloatingProps } = (0, import_react5.useInteractions)([click, dismiss]);
274
274
  const listId = (0, import_react4.useId)();
275
275
  const tooltipContent = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { children: typeof tooltip === "string" ? tooltip : _tooltipContent });
276
- const initialMotion = { opacity: 0, scale: 0.95 };
277
- const animateMotion = { opacity: 1, scale: 1 };
276
+ const initialMotion = { opacity: 0, y: -5 };
277
+ const animateMotion = { opacity: 1, y: 0 };
278
278
  const enhancedChildren = import_react4.Children.map(children, (child) => {
279
279
  if (!(0, import_react4.isValidElement)(child)) return child;
280
280
  const prevOnSelect = child.props.onSelect;
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  DropdownComponent_default
3
- } from "../chunk-FJQ4FZRS.mjs";
3
+ } from "../chunk-3TQQTC2W.mjs";
4
4
  import {
5
5
  AlignCenter,
6
6
  AlignJustify,
7
7
  AlignLeft,
8
8
  AlignRight
9
- } from "../chunk-EN4BPI7N.mjs";
9
+ } from "../chunk-LLHBVRQR.mjs";
10
10
  import {
11
11
  __spreadProps,
12
12
  __spreadValues
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  ButtonComponent_default
3
- } from "../chunk-SJFT7WNM.mjs";
3
+ } from "../chunk-M4KZGB5K.mjs";
4
4
  import "../chunk-VYDH6BZE.mjs";
5
5
  import {
6
6
  UnderIcon
7
- } from "../chunk-EN4BPI7N.mjs";
7
+ } from "../chunk-LLHBVRQR.mjs";
8
8
  import {
9
9
  __spreadProps,
10
10
  __spreadValues
package/dist/index.js CHANGED
@@ -67,12 +67,11 @@ module.exports = __toCommonJS(src_exports);
67
67
  var import_dist = require("@siamf/react-color-pick/dist/index.css");
68
68
 
69
69
  // src/lib/Editor.tsx
70
- var import_react7 = require("react");
71
- var import_react8 = require("@tiptap/react");
70
+ var import_react6 = require("react");
71
+ var import_react7 = require("@tiptap/react");
72
72
 
73
73
  // src/lib/internal_com/RiDragHandler.tsx
74
74
  var import_extension_drag_handle_react = __toESM(require("@tiptap/extension-drag-handle-react"));
75
- var import_react4 = require("@tiptap/react");
76
75
  var import_state = require("@tiptap/pm/state");
77
76
 
78
77
  // src/lib/icons/index.tsx
@@ -212,16 +211,7 @@ var Tooltip_default = Tooltip;
212
211
 
213
212
  // src/lib/internal_com/RiDragHandler.tsx
214
213
  var import_jsx_runtime3 = require("react/jsx-runtime");
215
- var isDocEmpty = (editor) => {
216
- var _a;
217
- const doc = editor.state.doc;
218
- return doc.childCount === 1 && ((_a = doc.firstChild) == null ? void 0 : _a.isTextblock) === true && doc.firstChild.content.size === 0;
219
- };
220
214
  var RiDragHandler = ({ editor }) => {
221
- const empty = (0, import_react4.useEditorState)({
222
- editor,
223
- selector: ({ editor: editor2 }) => isDocEmpty(editor2)
224
- });
225
215
  const insertSlash = () => {
226
216
  editor.chain().focus().command(({ tr, state }) => {
227
217
  const { $from } = state.selection;
@@ -243,8 +233,7 @@ var RiDragHandler = ({ editor }) => {
243
233
  return true;
244
234
  }).run();
245
235
  };
246
- if (empty) return null;
247
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_extension_drag_handle_react.default, { editor, nested: empty, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex gap-x-1.5 mt-1.5 -translate-x-1.5", children: [
236
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_extension_drag_handle_react.default, { editor, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex gap-x-1.5 mt-1.5 -translate-x-1.5", children: [
248
237
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Tooltip_default, { content: "Insert Content", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
249
238
  "button",
250
239
  {
@@ -269,7 +258,7 @@ var RiDragHandler = ({ editor }) => {
269
258
  var RiDragHandler_default = RiDragHandler;
270
259
 
271
260
  // src/lib/internal_com/BubbleMenu.tsx
272
- var import_react5 = require("react");
261
+ var import_react4 = require("react");
273
262
  var import_menus = require("@tiptap/react/menus");
274
263
  var import_jsx_runtime4 = require("react/jsx-runtime");
275
264
  var BubbleMenu = ({ editor }) => {
@@ -302,7 +291,7 @@ var BubbleMenu = ({ editor }) => {
302
291
  return a.name.localeCompare(b.name);
303
292
  });
304
293
  if (!entries.length) return null;
305
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_menus.BubbleMenu, { editor, options: { placement: "top", offset: 10, flip: true }, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "bg-white flex gap-x-1 py-2 px-2 rounded-md border border-gray-200", children: entries.map(({ name, renderButton, options }) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react5.Fragment, { children: renderButton({
294
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_menus.BubbleMenu, { editor, options: { placement: "top", offset: 10, flip: true }, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "bg-white flex gap-x-1 py-2 px-2 rounded-md border border-gray-200", children: entries.map(({ name, renderButton, options }) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react4.Fragment, { children: renderButton({
306
295
  editor,
307
296
  options,
308
297
  buttonClassName: "",
@@ -313,11 +302,11 @@ var BubbleMenu = ({ editor }) => {
313
302
  var BubbleMenu_default = BubbleMenu;
314
303
 
315
304
  // src/lib/context/editor.context.tsx
316
- var import_react6 = require("react");
305
+ var import_react5 = require("react");
317
306
  var import_jsx_runtime5 = require("react/jsx-runtime");
318
- var EditorContext = (0, import_react6.createContext)({ editor: null });
307
+ var EditorContext = (0, import_react5.createContext)({ editor: null });
319
308
  var useEditor = () => {
320
- const ctx = (0, import_react6.useContext)(EditorContext);
309
+ const ctx = (0, import_react5.useContext)(EditorContext);
321
310
  if (!ctx) throw new Error("<Toolbar/> & <Content/> component must be used inside <Editor>...</Editor/>");
322
311
  return ctx;
323
312
  };
@@ -328,11 +317,12 @@ var EditorProvider = ({ children, value }) => {
328
317
  // src/lib/Editor.tsx
329
318
  var import_jsx_runtime6 = require("react/jsx-runtime");
330
319
  var Editor = ({ children, extensions = [], className, dragHandler = true, showBubbleMenu = true }) => {
331
- const editor = (0, import_react8.useEditor)({
332
- extensions: [...extensions],
320
+ const stableExtensions = (0, import_react6.useMemo)(() => extensions, [extensions]);
321
+ const editor = (0, import_react7.useEditor)({
322
+ extensions: stableExtensions,
333
323
  immediatelyRender: false
334
- });
335
- const value = (0, import_react7.useMemo)(() => ({ editor }), [editor]);
324
+ }, [stableExtensions]);
325
+ const value = (0, import_react6.useMemo)(() => ({ editor }), [editor]);
336
326
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(EditorProvider, { value: __spreadProps(__spreadValues({}, value), { dragHandler }), children: [
337
327
  /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className, children }),
338
328
  value.editor && dragHandler && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(RiDragHandler_default, { editor: value.editor }),
@@ -384,12 +374,12 @@ var Toolbar = ({ className, buttonClassName, dropdownContainerClassName, dropdow
384
374
  var Toolbar_default = Toolbar;
385
375
 
386
376
  // src/lib/Content.tsx
387
- var import_react9 = require("@tiptap/react");
377
+ var import_react8 = require("@tiptap/react");
388
378
  var import_tailwind_merge3 = require("tailwind-merge");
389
379
  var import_jsx_runtime8 = require("react/jsx-runtime");
390
380
  var Content = ({ className }) => {
391
381
  const { editor, dragHandler } = useEditor();
392
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react9.EditorContent, { editor, className: (0, import_tailwind_merge3.twMerge)(`focus:outline-none [&_.tiptap]:focus:outline-none [&_.tiptap]:min-h-50 ${dragHandler ? "[&_.tiptap]:p-[10px_20px_10px_50px]" : "[&_.tiptap]:p-[10px_20px]"}`, className) });
382
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react8.EditorContent, { editor, className: (0, import_tailwind_merge3.twMerge)(`focus:outline-none [&_.tiptap]:focus:outline-none [&_.tiptap]:min-h-50 ${dragHandler ? "[&_.tiptap]:p-[10px_20px_10px_50px]" : "[&_.tiptap]:p-[10px_20px]"}`, className) });
393
383
  };
394
384
  var Content_default = Content;
395
385
  // Annotate the CommonJS export names for ESM import in node:
package/dist/index.mjs CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  DragVerticalIcon,
7
7
  PlusIcon,
8
8
  Tooltip_default
9
- } from "./chunk-EN4BPI7N.mjs";
9
+ } from "./chunk-LLHBVRQR.mjs";
10
10
  import {
11
11
  __spreadProps,
12
12
  __spreadValues
@@ -21,19 +21,9 @@ import { useEditor as useEditor2 } from "@tiptap/react";
21
21
 
22
22
  // src/lib/internal_com/RiDragHandler.tsx
23
23
  import DragHandle from "@tiptap/extension-drag-handle-react";
24
- import { useEditorState } from "@tiptap/react";
25
24
  import { TextSelection } from "@tiptap/pm/state";
26
25
  import { jsx, jsxs } from "react/jsx-runtime";
27
- var isDocEmpty = (editor) => {
28
- var _a;
29
- const doc = editor.state.doc;
30
- return doc.childCount === 1 && ((_a = doc.firstChild) == null ? void 0 : _a.isTextblock) === true && doc.firstChild.content.size === 0;
31
- };
32
26
  var RiDragHandler = ({ editor }) => {
33
- const empty = useEditorState({
34
- editor,
35
- selector: ({ editor: editor2 }) => isDocEmpty(editor2)
36
- });
37
27
  const insertSlash = () => {
38
28
  editor.chain().focus().command(({ tr, state }) => {
39
29
  const { $from } = state.selection;
@@ -55,8 +45,7 @@ var RiDragHandler = ({ editor }) => {
55
45
  return true;
56
46
  }).run();
57
47
  };
58
- if (empty) return null;
59
- return /* @__PURE__ */ jsx(DragHandle, { editor, nested: empty, children: /* @__PURE__ */ jsxs("div", { className: "flex gap-x-1.5 mt-1.5 -translate-x-1.5", children: [
48
+ return /* @__PURE__ */ jsx(DragHandle, { editor, children: /* @__PURE__ */ jsxs("div", { className: "flex gap-x-1.5 mt-1.5 -translate-x-1.5", children: [
60
49
  /* @__PURE__ */ jsx(Tooltip_default, { content: "Insert Content", children: /* @__PURE__ */ jsx(
61
50
  "button",
62
51
  {
@@ -127,10 +116,11 @@ var BubbleMenu_default = BubbleMenu;
127
116
  // src/lib/Editor.tsx
128
117
  import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
129
118
  var Editor = ({ children, extensions = [], className, dragHandler = true, showBubbleMenu = true }) => {
119
+ const stableExtensions = useMemo(() => extensions, [extensions]);
130
120
  const editor = useEditor2({
131
- extensions: [...extensions],
121
+ extensions: stableExtensions,
132
122
  immediatelyRender: false
133
- });
123
+ }, [stableExtensions]);
134
124
  const value = useMemo(() => ({ editor }), [editor]);
135
125
  return /* @__PURE__ */ jsxs2(EditorProvider, { value: __spreadProps(__spreadValues({}, value), { dragHandler }), children: [
136
126
  /* @__PURE__ */ jsx3("div", { className, children }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ritext",
3
- "version": "1.0.25",
3
+ "version": "1.0.28",
4
4
  "description": "Ritext is a modern WYSIWYG rich text editor built with Tailwind CSS, powered by Tiptap. It offers a customizable UI and functional layer that lets you design your own editor controls and toolbars with clean, composable React components—no heavy UI, no extra dependencies beyond Tiptap.",
5
5
  "homepage": "https://ritext.vercel.app/",
6
6
  "main": "dist/index.js",
@@ -87,33 +87,33 @@
87
87
  "dependencies": {
88
88
  "@floating-ui/react": "^0.27.17",
89
89
  "@siamf/react-color-pick": "^1.5.4",
90
- "@tiptap/extension-blockquote": "^3.18.0",
91
- "@tiptap/extension-bold": "^3.18.0",
92
- "@tiptap/extension-document": "^3.18.0",
93
- "@tiptap/extension-drag-handle": "^3.18.0",
94
- "@tiptap/extension-drag-handle-react": "^3.18.0",
95
- "@tiptap/extension-emoji": "^3.18.0",
96
- "@tiptap/extension-heading": "^3.18.0",
97
- "@tiptap/extension-horizontal-rule": "^3.18.0",
98
- "@tiptap/extension-image": "^3.18.0",
99
- "@tiptap/extension-italic": "^3.18.0",
100
- "@tiptap/extension-link": "^3.18.0",
101
- "@tiptap/extension-list": "^3.18.0",
102
- "@tiptap/extension-paragraph": "^3.18.0",
103
- "@tiptap/extension-strike": "^3.18.0",
104
- "@tiptap/extension-subscript": "^3.18.0",
105
- "@tiptap/extension-superscript": "^3.18.0",
106
- "@tiptap/extension-table": "^3.18.0",
107
- "@tiptap/extension-text": "^3.18.0",
108
- "@tiptap/extension-text-align": "^3.18.0",
109
- "@tiptap/extension-text-style": "^3.18.0",
110
- "@tiptap/extension-underline": "^3.18.0",
111
- "@tiptap/extensions": "^3.18.0",
112
- "@tiptap/pm": "^3.18.0",
113
- "@tiptap/react": "^3.18.0",
114
- "@tiptap/starter-kit": "^3.18.0",
90
+ "@tiptap/extension-blockquote": "^3.14.0",
91
+ "@tiptap/extension-bold": "^3.14.0",
92
+ "@tiptap/extension-document": "^3.14.0",
93
+ "@tiptap/extension-drag-handle": "3.14.0",
94
+ "@tiptap/extension-drag-handle-react": "3.14.0",
95
+ "@tiptap/extension-emoji": "^3.14.0",
96
+ "@tiptap/extension-hard-break": "3.14.0",
97
+ "@tiptap/extension-heading": "^3.14.0",
98
+ "@tiptap/extension-horizontal-rule": "^3.14.0",
99
+ "@tiptap/extension-image": "^3.14.0",
100
+ "@tiptap/extension-italic": "^3.14.0",
101
+ "@tiptap/extension-link": "^3.14.0",
102
+ "@tiptap/extension-list": "^3.14.0",
103
+ "@tiptap/extension-paragraph": "^3.14.0",
104
+ "@tiptap/extension-strike": "^3.14.0",
105
+ "@tiptap/extension-subscript": "^3.14.0",
106
+ "@tiptap/extension-superscript": "^3.14.0",
107
+ "@tiptap/extension-table": "^3.14.0",
108
+ "@tiptap/extension-text": "^3.14.0",
109
+ "@tiptap/extension-text-align": "^3.14.0",
110
+ "@tiptap/extension-text-style": "^3.14.0",
111
+ "@tiptap/extension-underline": "^3.14.0",
112
+ "@tiptap/extensions": "^3.14.0",
113
+ "@tiptap/pm": "^3.14.0",
114
+ "@tiptap/react": "^3.14.0",
115
+ "@tiptap/starter-kit": "^3.14.0",
115
116
  "motion": "^12.29.2",
116
- "prosemirror-view": "1.41.5",
117
117
  "react-easy-crop": "^5.5.6",
118
118
  "tailwind-merge": "^3.4.0"
119
119
  },