ritext 1.0.12 → 1.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -19,8 +19,9 @@ Ritext is a modern WYSIWYG rich text editor built with Tailwind CSS, powered by
19
19
  - [x] Italic
20
20
  - [x] Underline
21
21
  - [x] Strike
22
- - [ ] Subscript
23
- - [ ] Superscript
22
+ - [x] Subscript
23
+ - [x] Superscript
24
+ - [ ] SubAndSuperScript
24
25
  - [ ] Format Painter
25
26
  - [ ] Clear Format
26
27
  - [ ] Font Family
package/dist/index.d.mts CHANGED
@@ -44,4 +44,8 @@ declare const Underline: Mark<ExtButtonOptions, any>;
44
44
 
45
45
  declare const Strike: Mark<ExtButtonOptions, any>;
46
46
 
47
- export { Bold, Content, Editor, Italic, Strike, Toolbar, Underline };
47
+ declare const Subscript: Mark<ExtButtonOptions, any>;
48
+
49
+ declare const Superscript: Mark<ExtButtonOptions, any>;
50
+
51
+ export { Bold, Content, Editor, Italic, Strike, Subscript, Superscript, Toolbar, Underline };
package/dist/index.d.ts CHANGED
@@ -44,4 +44,8 @@ declare const Underline: Mark<ExtButtonOptions, any>;
44
44
 
45
45
  declare const Strike: Mark<ExtButtonOptions, any>;
46
46
 
47
- export { Bold, Content, Editor, Italic, Strike, Toolbar, Underline };
47
+ declare const Subscript: Mark<ExtButtonOptions, any>;
48
+
49
+ declare const Superscript: Mark<ExtButtonOptions, any>;
50
+
51
+ export { Bold, Content, Editor, Italic, Strike, Subscript, Superscript, Toolbar, Underline };
package/dist/index.js CHANGED
@@ -64,6 +64,8 @@ __export(index_exports, {
64
64
  Editor: () => Editor_default,
65
65
  Italic: () => Italic,
66
66
  Strike: () => Strike,
67
+ Subscript: () => Subscript,
68
+ Superscript: () => Superscript,
67
69
  Toolbar: () => Toolbar_default,
68
70
  Underline: () => Underline
69
71
  });
@@ -492,6 +494,128 @@ var Strike = import_extension_strike.default.extend({
492
494
  });
493
495
  }
494
496
  });
497
+
498
+ // src/lib/extensions/Subscript.tsx
499
+ var import_extension_subscript = __toESM(require("@tiptap/extension-subscript"));
500
+
501
+ // src/lib/icon/SubIcon.tsx
502
+ var import_jsx_runtime15 = require("react/jsx-runtime");
503
+ var SubIcon = (_a) => {
504
+ var _b = _a, { size = 17, className } = _b, props = __objRest(_b, ["size", "className"]);
505
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
506
+ "svg",
507
+ __spreadProps(__spreadValues({
508
+ xmlns: "http://www.w3.org/2000/svg",
509
+ viewBox: "0 0 24 24",
510
+ fill: "none",
511
+ stroke: "currentColor",
512
+ strokeWidth: 2,
513
+ strokeLinecap: "round",
514
+ strokeLinejoin: "round",
515
+ width: size,
516
+ height: size,
517
+ className
518
+ }, props), {
519
+ children: [
520
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("path", { d: "m4 5 8 8" }),
521
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("path", { d: "m12 5-8 8" }),
522
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("path", { d: "M20 19h-4c0-1.5.44-2 1.5-2.5S20 15.33 20 14c0-.47-.17-.93-.48-1.29a2.11 2.11 0 0 0-2.62-.44c-.42.24-.74.62-.9 1.07" })
523
+ ]
524
+ })
525
+ );
526
+ };
527
+ var SubIcon_default = SubIcon;
528
+
529
+ // src/lib/extensions/Subscript.tsx
530
+ var import_jsx_runtime16 = require("react/jsx-runtime");
531
+ var Subscript = import_extension_subscript.default.extend({
532
+ addOptions() {
533
+ var _a;
534
+ return __spreadProps(__spreadValues({}, (_a = this.parent) == null ? void 0 : _a.call(this)), {
535
+ button: ({ options, editor, buttonClassName }) => {
536
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
537
+ ButtonComponent_default,
538
+ {
539
+ className: options.className,
540
+ icon: options.icon,
541
+ style: options.style,
542
+ activeClassName: options.activeClassName,
543
+ tooltip: options.tooltip,
544
+ tooltipClassName: options.tooltipClassName,
545
+ tooltipPlacement: options.tooltipPlacement,
546
+ _internalIcon: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SubIcon_default, {}),
547
+ _extName: "subscript",
548
+ _onToggle: () => editor.chain().focus().toggleSubscript().run(),
549
+ _interShortcut: "\u2318 + ,",
550
+ _tooltipContent: "Subscript",
551
+ _buttonClassName: buttonClassName
552
+ }
553
+ );
554
+ }
555
+ });
556
+ }
557
+ });
558
+
559
+ // src/lib/extensions/Superscript.tsx
560
+ var import_extension_superscript = __toESM(require("@tiptap/extension-superscript"));
561
+
562
+ // src/lib/icon/SupIcon.tsx
563
+ var import_jsx_runtime17 = require("react/jsx-runtime");
564
+ var SupIcon = (_a) => {
565
+ var _b = _a, { size = 17, className } = _b, props = __objRest(_b, ["size", "className"]);
566
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
567
+ "svg",
568
+ __spreadProps(__spreadValues({
569
+ xmlns: "http://www.w3.org/2000/svg",
570
+ viewBox: "0 0 24 24",
571
+ fill: "none",
572
+ stroke: "currentColor",
573
+ strokeWidth: 2,
574
+ strokeLinecap: "round",
575
+ strokeLinejoin: "round",
576
+ width: size,
577
+ height: size,
578
+ className
579
+ }, props), {
580
+ children: [
581
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("path", { d: "m4 19 8-8" }),
582
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("path", { d: "m12 19-8-8" }),
583
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("path", { d: "M20 12h-4c0-1.5.442-2 1.5-2.5S20 8.334 20 7.002c0-.472-.17-.93-.484-1.29a2.105 2.105 0 0 0-2.617-.436c-.42.239-.738.614-.899 1.06" })
584
+ ]
585
+ })
586
+ );
587
+ };
588
+ var SupIcon_default = SupIcon;
589
+
590
+ // src/lib/extensions/Superscript.tsx
591
+ var import_jsx_runtime18 = require("react/jsx-runtime");
592
+ var Superscript = import_extension_superscript.default.extend({
593
+ addOptions() {
594
+ var _a;
595
+ return __spreadProps(__spreadValues({}, (_a = this.parent) == null ? void 0 : _a.call(this)), {
596
+ button: ({ options, editor, buttonClassName }) => {
597
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
598
+ ButtonComponent_default,
599
+ {
600
+ className: options.className,
601
+ icon: options.icon,
602
+ style: options.style,
603
+ activeClassName: options.activeClassName,
604
+ tooltip: options.tooltip,
605
+ tooltipClassName: options.tooltipClassName,
606
+ tooltipPlacement: options.tooltipPlacement,
607
+ _internalIcon: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(SupIcon_default, {}),
608
+ _extName: "superscript",
609
+ _onToggle: () => editor.chain().focus().toggleSuperscript().run(),
610
+ _interShortcut: "\u2318 + ,",
611
+ _tooltipContent: "Superscript",
612
+ _buttonClassName: buttonClassName
613
+ }
614
+ );
615
+ }
616
+ });
617
+ }
618
+ });
495
619
  // Annotate the CommonJS export names for ESM import in node:
496
620
  0 && (module.exports = {
497
621
  Bold,
@@ -499,6 +623,8 @@ var Strike = import_extension_strike.default.extend({
499
623
  Editor,
500
624
  Italic,
501
625
  Strike,
626
+ Subscript,
627
+ Superscript,
502
628
  Toolbar,
503
629
  Underline
504
630
  });
package/dist/index.mjs CHANGED
@@ -453,12 +453,136 @@ var Strike = TiptapStrike.extend({
453
453
  });
454
454
  }
455
455
  });
456
+
457
+ // src/lib/extensions/Subscript.tsx
458
+ import TiptapSubscript from "@tiptap/extension-subscript";
459
+
460
+ // src/lib/icon/SubIcon.tsx
461
+ import { jsx as jsx15, jsxs as jsxs6 } from "react/jsx-runtime";
462
+ var SubIcon = (_a) => {
463
+ var _b = _a, { size = 17, className } = _b, props = __objRest(_b, ["size", "className"]);
464
+ return /* @__PURE__ */ jsxs6(
465
+ "svg",
466
+ __spreadProps(__spreadValues({
467
+ xmlns: "http://www.w3.org/2000/svg",
468
+ viewBox: "0 0 24 24",
469
+ fill: "none",
470
+ stroke: "currentColor",
471
+ strokeWidth: 2,
472
+ strokeLinecap: "round",
473
+ strokeLinejoin: "round",
474
+ width: size,
475
+ height: size,
476
+ className
477
+ }, props), {
478
+ children: [
479
+ /* @__PURE__ */ jsx15("path", { d: "m4 5 8 8" }),
480
+ /* @__PURE__ */ jsx15("path", { d: "m12 5-8 8" }),
481
+ /* @__PURE__ */ jsx15("path", { d: "M20 19h-4c0-1.5.44-2 1.5-2.5S20 15.33 20 14c0-.47-.17-.93-.48-1.29a2.11 2.11 0 0 0-2.62-.44c-.42.24-.74.62-.9 1.07" })
482
+ ]
483
+ })
484
+ );
485
+ };
486
+ var SubIcon_default = SubIcon;
487
+
488
+ // src/lib/extensions/Subscript.tsx
489
+ import { jsx as jsx16 } from "react/jsx-runtime";
490
+ var Subscript = TiptapSubscript.extend({
491
+ addOptions() {
492
+ var _a;
493
+ return __spreadProps(__spreadValues({}, (_a = this.parent) == null ? void 0 : _a.call(this)), {
494
+ button: ({ options, editor, buttonClassName }) => {
495
+ return /* @__PURE__ */ jsx16(
496
+ ButtonComponent_default,
497
+ {
498
+ className: options.className,
499
+ icon: options.icon,
500
+ style: options.style,
501
+ activeClassName: options.activeClassName,
502
+ tooltip: options.tooltip,
503
+ tooltipClassName: options.tooltipClassName,
504
+ tooltipPlacement: options.tooltipPlacement,
505
+ _internalIcon: /* @__PURE__ */ jsx16(SubIcon_default, {}),
506
+ _extName: "subscript",
507
+ _onToggle: () => editor.chain().focus().toggleSubscript().run(),
508
+ _interShortcut: "\u2318 + ,",
509
+ _tooltipContent: "Subscript",
510
+ _buttonClassName: buttonClassName
511
+ }
512
+ );
513
+ }
514
+ });
515
+ }
516
+ });
517
+
518
+ // src/lib/extensions/Superscript.tsx
519
+ import TiptapSuperscript from "@tiptap/extension-superscript";
520
+
521
+ // src/lib/icon/SupIcon.tsx
522
+ import { jsx as jsx17, jsxs as jsxs7 } from "react/jsx-runtime";
523
+ var SupIcon = (_a) => {
524
+ var _b = _a, { size = 17, className } = _b, props = __objRest(_b, ["size", "className"]);
525
+ return /* @__PURE__ */ jsxs7(
526
+ "svg",
527
+ __spreadProps(__spreadValues({
528
+ xmlns: "http://www.w3.org/2000/svg",
529
+ viewBox: "0 0 24 24",
530
+ fill: "none",
531
+ stroke: "currentColor",
532
+ strokeWidth: 2,
533
+ strokeLinecap: "round",
534
+ strokeLinejoin: "round",
535
+ width: size,
536
+ height: size,
537
+ className
538
+ }, props), {
539
+ children: [
540
+ /* @__PURE__ */ jsx17("path", { d: "m4 19 8-8" }),
541
+ /* @__PURE__ */ jsx17("path", { d: "m12 19-8-8" }),
542
+ /* @__PURE__ */ jsx17("path", { d: "M20 12h-4c0-1.5.442-2 1.5-2.5S20 8.334 20 7.002c0-.472-.17-.93-.484-1.29a2.105 2.105 0 0 0-2.617-.436c-.42.239-.738.614-.899 1.06" })
543
+ ]
544
+ })
545
+ );
546
+ };
547
+ var SupIcon_default = SupIcon;
548
+
549
+ // src/lib/extensions/Superscript.tsx
550
+ import { jsx as jsx18 } from "react/jsx-runtime";
551
+ var Superscript = TiptapSuperscript.extend({
552
+ addOptions() {
553
+ var _a;
554
+ return __spreadProps(__spreadValues({}, (_a = this.parent) == null ? void 0 : _a.call(this)), {
555
+ button: ({ options, editor, buttonClassName }) => {
556
+ return /* @__PURE__ */ jsx18(
557
+ ButtonComponent_default,
558
+ {
559
+ className: options.className,
560
+ icon: options.icon,
561
+ style: options.style,
562
+ activeClassName: options.activeClassName,
563
+ tooltip: options.tooltip,
564
+ tooltipClassName: options.tooltipClassName,
565
+ tooltipPlacement: options.tooltipPlacement,
566
+ _internalIcon: /* @__PURE__ */ jsx18(SupIcon_default, {}),
567
+ _extName: "superscript",
568
+ _onToggle: () => editor.chain().focus().toggleSuperscript().run(),
569
+ _interShortcut: "\u2318 + ,",
570
+ _tooltipContent: "Superscript",
571
+ _buttonClassName: buttonClassName
572
+ }
573
+ );
574
+ }
575
+ });
576
+ }
577
+ });
456
578
  export {
457
579
  Bold,
458
580
  Content_default as Content,
459
581
  Editor_default as Editor,
460
582
  Italic,
461
583
  Strike,
584
+ Subscript,
585
+ Superscript,
462
586
  Toolbar_default as Toolbar,
463
587
  Underline
464
588
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ritext",
3
- "version": "1.0.12",
3
+ "version": "1.0.14",
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",
@@ -54,21 +54,23 @@
54
54
  "react-dom": "^19.2.0",
55
55
  "tailwindcss": "^4.1.16",
56
56
  "tsup": "^8.5.0",
57
- "turbo": "^2.5.8",
57
+ "turbo": "^2.6.0",
58
58
  "typescript": "^5.9.3"
59
59
  },
60
60
  "dependencies": {
61
61
  "@floating-ui/react": "^0.27.16",
62
- "@tiptap/extension-bold": "^3.7.2",
63
- "@tiptap/extension-document": "^3.7.2",
64
- "@tiptap/extension-italic": "^3.7.2",
65
- "@tiptap/extension-paragraph": "^3.7.2",
62
+ "@tiptap/extension-bold": "^3.10.1",
63
+ "@tiptap/extension-document": "^3.10.1",
64
+ "@tiptap/extension-italic": "^3.10.1",
65
+ "@tiptap/extension-paragraph": "^3.10.1",
66
66
  "@tiptap/extension-strike": "^3.10.1",
67
- "@tiptap/extension-text": "^3.7.2",
67
+ "@tiptap/extension-subscript": "^3.10.1",
68
+ "@tiptap/extension-superscript": "^3.10.1",
69
+ "@tiptap/extension-text": "^3.10.1",
68
70
  "@tiptap/extension-underline": "^3.10.1",
69
- "@tiptap/pm": "^3.7.2",
70
- "@tiptap/react": "^3.7.2",
71
- "@tiptap/starter-kit": "^3.7.2",
71
+ "@tiptap/pm": "^3.10.1",
72
+ "@tiptap/react": "^3.10.1",
73
+ "@tiptap/starter-kit": "^3.10.1",
72
74
  "motion": "^12.23.24",
73
75
  "tailwind-merge": "^3.3.1"
74
76
  },