@cgboiler/biz-basic 1.0.69 → 1.0.70
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/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/rich-text-editor/RichTextEditor.js +3 -0
- package/es/rich-text-editor/index.css +1 -1
- package/es/rich-text-editor/menu-system/components/_atomic.css +2 -0
- package/es/rich-text-editor/menu-system/components/text-color-button.d.ts +70 -0
- package/es/rich-text-editor/menu-system/components/text-color-button.js +128 -0
- package/es/rich-text-editor/menu-system/components/text-color-popover.d.ts +32 -0
- package/es/rich-text-editor/menu-system/components/text-color-popover.js +127 -0
- package/es/rich-text-editor/menu-system/hooks/use-text-color.d.ts +45 -0
- package/es/rich-text-editor/menu-system/hooks/use-text-color.js +152 -0
- package/es/rich-text-editor/menu-system/icons/index.d.ts +13 -0
- package/es/rich-text-editor/menu-system/icons/index.js +22 -0
- package/es/rich-text-editor/menu-system/styles/button-group.css +1 -1
- package/es/rich-text-editor/menu-system/styles/button.css +1 -1
- package/es/rich-text-editor/menu-system/styles/card.css +1 -1
- package/es/rich-text-editor/menu-system/styles/color-highlight-button.css +1 -1
- package/es/rich-text-editor/menu-system/styles/color-highlight-popover.css +1 -1
- package/es/rich-text-editor/menu-system/styles/dropdown-menu.css +1 -1
- package/es/rich-text-editor/menu-system/styles/image-upload-node.css +1 -1
- package/es/rich-text-editor/menu-system/styles/input.css +1 -1
- package/es/rich-text-editor/menu-system/styles/link-popover.css +1 -1
- package/es/rich-text-editor/menu-system/styles/separator.css +1 -1
- package/es/rich-text-editor/menu-system/styles/simple-editor.css +1 -1
- package/es/rich-text-editor/menu-system/styles/text-color-button.css +1 -0
- package/es/rich-text-editor/menu-system/styles/text-color-button.less +63 -0
- package/es/rich-text-editor/menu-system/styles/text-color-popover.css +1 -0
- package/es/rich-text-editor/menu-system/styles/text-color-popover.less +125 -0
- package/es/rich-text-editor/menu-system/styles/toolbar.css +1 -1
- package/es/rich-text-editor/menu-system/styles/variables.css +1 -1
- package/es/rich-text-editor/menu-system/styles/variables.less +4 -2
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/rich-text-editor/RichTextEditor.js +3 -0
- package/lib/rich-text-editor/index.css +1 -1
- package/lib/rich-text-editor/menu-system/components/_atomic.css +2 -0
- package/lib/rich-text-editor/menu-system/components/text-color-button.d.ts +70 -0
- package/lib/rich-text-editor/menu-system/components/text-color-button.js +145 -0
- package/lib/rich-text-editor/menu-system/components/text-color-popover.d.ts +32 -0
- package/lib/rich-text-editor/menu-system/components/text-color-popover.js +146 -0
- package/lib/rich-text-editor/menu-system/hooks/use-text-color.d.ts +45 -0
- package/lib/rich-text-editor/menu-system/hooks/use-text-color.js +171 -0
- package/lib/rich-text-editor/menu-system/icons/index.d.ts +13 -0
- package/lib/rich-text-editor/menu-system/icons/index.js +22 -0
- package/lib/rich-text-editor/menu-system/styles/button-group.css +1 -1
- package/lib/rich-text-editor/menu-system/styles/button.css +1 -1
- package/lib/rich-text-editor/menu-system/styles/card.css +1 -1
- package/lib/rich-text-editor/menu-system/styles/color-highlight-button.css +1 -1
- package/lib/rich-text-editor/menu-system/styles/color-highlight-popover.css +1 -1
- package/lib/rich-text-editor/menu-system/styles/dropdown-menu.css +1 -1
- package/lib/rich-text-editor/menu-system/styles/image-upload-node.css +1 -1
- package/lib/rich-text-editor/menu-system/styles/input.css +1 -1
- package/lib/rich-text-editor/menu-system/styles/link-popover.css +1 -1
- package/lib/rich-text-editor/menu-system/styles/separator.css +1 -1
- package/lib/rich-text-editor/menu-system/styles/simple-editor.css +1 -1
- package/lib/rich-text-editor/menu-system/styles/text-color-button.css +1 -0
- package/lib/rich-text-editor/menu-system/styles/text-color-button.less +63 -0
- package/lib/rich-text-editor/menu-system/styles/text-color-popover.css +1 -0
- package/lib/rich-text-editor/menu-system/styles/text-color-popover.less +125 -0
- package/lib/rich-text-editor/menu-system/styles/toolbar.css +1 -1
- package/lib/rich-text-editor/menu-system/styles/variables.css +1 -1
- package/lib/rich-text-editor/menu-system/styles/variables.less +4 -2
- package/package.json +1 -1
package/es/index.d.ts
CHANGED
package/es/index.js
CHANGED
|
@@ -15,6 +15,7 @@ import { BlockquoteButton } from "./menu-system/components/blockquote-button";
|
|
|
15
15
|
import { CodeBlockButton } from "./menu-system/components/code-block-button";
|
|
16
16
|
import { MarkButton } from "./menu-system/components/mark-button";
|
|
17
17
|
import { ColorHighlightPopover } from "./menu-system/components/color-highlight-popover";
|
|
18
|
+
import { TextColorPopover } from "./menu-system/components/text-color-popover";
|
|
18
19
|
import { LinkPopover } from "./menu-system/components/link-popover";
|
|
19
20
|
import { HorizontalRuleButton } from "./menu-system/components/horizontal-rule-button";
|
|
20
21
|
import { TableDropdownMenu } from "./menu-system/components/table-dropdown-menu";
|
|
@@ -202,6 +203,8 @@ var stdin_default = defineComponent({
|
|
|
202
203
|
"type": "underline"
|
|
203
204
|
}, null), _createVNode(ColorHighlightPopover, {
|
|
204
205
|
"editor": editor.value
|
|
206
|
+
}, null), _createVNode(TextColorPopover, {
|
|
207
|
+
"editor": editor.value
|
|
205
208
|
}, null), _createVNode(LinkPopover, {
|
|
206
209
|
"editor": editor.value
|
|
207
210
|
}, null)]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{overflow-wrap:break-word;-webkit-text-size-adjust:none;text-size-adjust:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;--tt-gray-light-a-50: rgba(56, 56, 56, .04);--tt-gray-light-a-100: rgba(15, 22, 36, .05);--tt-gray-light-a-200: rgba(37, 39, 45, .1);--tt-gray-light-a-300: rgba(47, 50, 55, .2);--tt-gray-light-a-400: rgba(40, 44, 51, .42);--tt-gray-light-a-500: rgba(52, 55, 60, .64);--tt-gray-light-a-600: rgba(36, 39, 46, .78);--tt-gray-light-a-700: rgba(35, 37, 42, .87);--tt-gray-light-a-800: rgba(30, 32, 36, .95);--tt-gray-light-a-900: rgba(29, 30, 32, .98);--tt-gray-light-50: #fafafa;--tt-gray-light-100: #f4f4f5;--tt-gray-light-200: #eaeaeb;--tt-gray-light-300: #d5d6d7;--tt-gray-light-400: #a6a7ab;--tt-gray-light-500: #7d7f82;--tt-gray-light-600: #53565a;--tt-gray-light-700: #404145;--tt-gray-light-800: #2c2d30;--tt-gray-light-900: #222325;--tt-gray-dark-a-50: rgba(232, 232, 253, .05);--tt-gray-dark-a-100: rgba(231, 231, 243, .07);--tt-gray-dark-a-200: rgba(238, 238, 246, .11);--tt-gray-dark-a-300: rgba(239, 239, 245, .22);--tt-gray-dark-a-400: rgba(244, 244, 255, .37);--tt-gray-dark-a-500: rgba(236, 238, 253, .5);--tt-gray-dark-a-600: rgba(247, 247, 253, .64);--tt-gray-dark-a-700: rgba(251, 251, 254, .75);--tt-gray-dark-a-800: rgba(253, 253, 253, .88);--tt-gray-dark-a-900: rgba(255, 255, 255, .96);--tt-gray-dark-50: #19191a;--tt-gray-dark-100: #202022;--tt-gray-dark-200: #2d2d2f;--tt-gray-dark-300: #464649;--tt-gray-dark-400: #636369;--tt-gray-dark-500: #7c7c83;--tt-gray-dark-600: #a3a3a8;--tt-gray-dark-700: #c0c0c3;--tt-gray-dark-800: #e0e0e1;--tt-gray-dark-900: #f5f5f5;--tt-brand-color-50: #fef2f3;--tt-brand-color-100: #fce8e9;--tt-brand-color-200: #f9d4d5;--tt-brand-color-300: #f4b4b6;--tt-brand-color-400: #eb747e;--tt-brand-color-500: #c02537;--tt-brand-color-600: #a51c2d;--tt-brand-color-700: #8b1826;--tt-brand-color-800: #71131f;--tt-brand-color-900: #570f18;--tt-brand-color-950: #3a0a10;--tt-color-green-inc-5: hsl(129, 100%, 97%);--tt-color-green-inc-4: hsl(129, 100%, 92%);--tt-color-green-inc-3: hsl(131, 100%, 86%);--tt-color-green-inc-2: hsl(133, 98%, 78%);--tt-color-green-inc-1: hsl(137, 99%, 70%);--tt-color-green-base: hsl(147, 99%, 50%);--tt-color-green-dec-1: hsl(147, 97%, 41%);--tt-color-green-dec-2: hsl(146, 98%, 32%);--tt-color-green-dec-3: hsl(146, 100%, 24%);--tt-color-green-dec-4: hsl(144, 100%, 16%);--tt-color-green-dec-5: hsl(140, 100%, 9%);--tt-color-yellow-inc-5: hsl(50, 100%, 97%);--tt-color-yellow-inc-4: hsl(50, 100%, 91%);--tt-color-yellow-inc-3: hsl(50, 100%, 84%);--tt-color-yellow-inc-2: hsl(50, 100%, 77%);--tt-color-yellow-inc-1: hsl(50, 100%, 68%);--tt-color-yellow-base: hsl(52, 100%, 50%);--tt-color-yellow-dec-1: hsl(52, 100%, 41%);--tt-color-yellow-dec-2: hsl(52, 100%, 32%);--tt-color-yellow-dec-3: hsl(52, 100%, 24%);--tt-color-yellow-dec-4: hsl(51, 100%, 16%);--tt-color-yellow-dec-5: hsl(50, 100%, 9%);--tt-color-red-inc-5: hsl(11, 100%, 96%);--tt-color-red-inc-4: hsl(11, 100%, 88%);--tt-color-red-inc-3: hsl(10, 100%, 80%);--tt-color-red-inc-2: hsl(9, 100%, 73%);--tt-color-red-inc-1: hsl(7, 100%, 64%);--tt-color-red-base: hsl(7, 100%, 54%);--tt-color-red-dec-1: hsl(7, 100%, 41%);--tt-color-red-dec-2: hsl(5, 100%, 32%);--tt-color-red-dec-3: hsl(4, 100%, 24%);--tt-color-red-dec-4: hsl(3, 100%, 16%);--tt-color-red-dec-5: hsl(1, 100%, 9%);--white: #ffffff;--black: #0e0e11;--transparent: rgba(255, 255, 255, 0);--tt-shadow-elevated-md: 0px 16px 48px 0px rgba(17, 24, 39, .04), 0px 12px 24px 0px rgba(17, 24, 39, .04), 0px 6px 8px 0px rgba(17, 24, 39, .02), 0px 2px 3px 0px rgba(17, 24, 39, .02);--tt-radius-xxs: .125rem;--tt-radius-xs: .25rem;--tt-radius-sm: .375rem;--tt-radius-md: .5rem;--tt-radius-lg: .75rem;--tt-radius-xl: 1rem;--tt-transition-duration-short: .1s;--tt-transition-duration-default: .2s;--tt-transition-duration-long: .64s;--tt-transition-easing-default: cubic-bezier(.46, .03, .52, .96);--tt-transition-easing-cubic: cubic-bezier(.65, .05, .36, 1);--tt-transition-easing-quart: cubic-bezier(.77, 0, .18, 1);--tt-transition-easing-circ: cubic-bezier(.79, .14, .15, .86);--tt-transition-easing-back: cubic-bezier(.68, -.55, .27, 1.55);--tt-accent-contrast: 8%;--tt-destructive-contrast: 8%;--tt-foreground-contrast: 8%}:root,:root *,:root :before,:root :after{box-sizing:border-box}:root{--tt-bg-color: var(--white);--tt-border-color: var(--tt-gray-light-a-200);--tt-border-color-tint: var(--tt-gray-light-a-100);--tt-sidebar-bg-color: var(--tt-gray-light-100);--tt-scrollbar-color: var(--tt-gray-light-a-200);--tt-cursor-color: var(--tt-brand-color-500);--tt-selection-color: rgba(244, 180, 182, .2);--tt-card-bg-color: var(--white);--tt-card-border-color: var(--tt-gray-light-a-100)}.dark{--tt-bg-color: var(--black);--tt-border-color: var(--tt-gray-dark-a-200);--tt-border-color-tint: var(--tt-gray-dark-a-100);--tt-sidebar-bg-color: var(--tt-gray-dark-100);--tt-scrollbar-color: var(--tt-gray-dark-a-200);--tt-cursor-color: var(--tt-brand-color-400);--tt-selection-color: rgba(235, 116, 126, .2);--tt-card-bg-color: var(--tt-gray-dark-50);--tt-card-border-color: var(--tt-gray-dark-a-50);--tt-shadow-elevated-md: 0px 16px 48px 0px rgba(0, 0, 0, .5), 0px 12px 24px 0px rgba(0, 0, 0, .24), 0px 6px 8px 0px rgba(0, 0, 0, .22), 0px 2px 3px 0px rgba(0, 0, 0, .12)}:root{--tt-color-text-gray: hsl(45, 2%, 46%);--tt-color-text-brown: hsl(19, 31%, 47%);--tt-color-text-orange: hsl(30, 89%, 45%);--tt-color-text-yellow: hsl(38, 62%, 49%);--tt-color-text-green: hsl(148, 32%, 39%);--tt-color-text-blue: hsl(202, 54%, 43%);--tt-color-text-purple: hsl(274, 32%, 54%);--tt-color-text-pink: hsl(328, 49%, 53%);--tt-color-text-red: hsl(2, 62%, 55%);--tt-color-text-gray-contrast: hsla(39, 26%, 26%, .15);--tt-color-text-brown-contrast: hsla(18, 43%, 69%, .35);--tt-color-text-orange-contrast: hsla(24, 73%, 55%, .27);--tt-color-text-yellow-contrast: hsla(44, 82%, 59%, .39);--tt-color-text-green-contrast: hsla(126, 29%, 60%, .27);--tt-color-text-blue-contrast: hsla(202, 54%, 59%, .27);--tt-color-text-purple-contrast: hsla(274, 37%, 64%, .27);--tt-color-text-pink-contrast: hsla(331, 60%, 71%, .27);--tt-color-text-red-contrast: hsla(8, 79%, 79%, .4)}.dark{--tt-color-text-gray: hsl(0, 0%, 61%);--tt-color-text-brown: hsl(18, 35%, 58%);--tt-color-text-orange: hsl(25, 53%, 53%);--tt-color-text-yellow: hsl(36, 54%, 55%);--tt-color-text-green: hsl(145, 32%, 47%);--tt-color-text-blue: hsl(202, 64%, 52%);--tt-color-text-purple: hsl(270, 55%, 62%);--tt-color-text-pink: hsl(329, 57%, 58%);--tt-color-text-red: hsl(1, 69%, 60%);--tt-color-text-gray-contrast: hsla(0, 0%, 100%, .09);--tt-color-text-brown-contrast: hsla(17, 45%, 50%, .25);--tt-color-text-orange-contrast: hsla(27, 82%, 53%, .2);--tt-color-text-yellow-contrast: hsla(35, 49%, 47%, .2);--tt-color-text-green-contrast: hsla(151, 55%, 39%, .2);--tt-color-text-blue-contrast: hsla(202, 54%, 43%, .2);--tt-color-text-purple-contrast: hsla(271, 56%, 60%, .18);--tt-color-text-pink-contrast: hsla(331, 67%, 58%, .22);--tt-color-text-red-contrast: hsla(0, 67%, 60%, .25)}:root{--tt-color-highlight-yellow: #fef9c3;--tt-color-highlight-green: #dcfce7;--tt-color-highlight-blue: #e0f2fe;--tt-color-highlight-purple: #f3e8ff;--tt-color-highlight-red: #ffe4e6;--tt-color-highlight-gray: #f8f8f7;--tt-color-highlight-brown: #f4eeee;--tt-color-highlight-orange: #fbecdd;--tt-color-highlight-pink: #fcf1f6;--tt-color-highlight-yellow-contrast: #fbe604;--tt-color-highlight-green-contrast: #c7fad8;--tt-color-highlight-blue-contrast: #ceeafd;--tt-color-highlight-purple-contrast: #e4ccff;--tt-color-highlight-red-contrast: #ffccd0;--tt-color-highlight-gray-contrast: rgba(84, 72, 49, .15);--tt-color-highlight-brown-contrast: rgba(210, 162, 141, .35);--tt-color-highlight-orange-contrast: rgba(224, 124, 57, .27);--tt-color-highlight-pink-contrast: rgba(225, 136, 179, .27)}.dark{--tt-color-highlight-yellow: #6b6524;--tt-color-highlight-green: #509568;--tt-color-highlight-blue: #6e92aa;--tt-color-highlight-purple: #583e74;--tt-color-highlight-red: #743e42;--tt-color-highlight-gray: #2f2f2f;--tt-color-highlight-brown: #4a3228;--tt-color-highlight-orange: #5c3b23;--tt-color-highlight-pink: #4e2c3c;--tt-color-highlight-yellow-contrast: #58531e;--tt-color-highlight-green-contrast: #47855d;--tt-color-highlight-blue-contrast: #5e86a1;--tt-color-highlight-purple-contrast: #4c3564;--tt-color-highlight-red-contrast: #643539;--tt-color-highlight-gray-contrast: rgba(255, 255, 255, .094);--tt-color-highlight-brown-contrast: rgba(184, 101, 69, .25);--tt-color-highlight-orange-contrast: rgba(233, 126, 37, .2);--tt-color-highlight-pink-contrast: rgba(220, 76, 145, .22)}body .ProseMirror{flex:1;outline:none;word-break:break-all;line-height:1.6;font-size:var(--font-base);--white: #fff;--black: #2e2b29;--gray-1: rgba(61, 37, 20, .05);--gray-2: rgba(61, 37, 20, .08);--gray-3: rgba(61, 37, 20, .12);--gray-4: rgba(53, 38, 28, .3);--gray-5: rgba(28, 25, 23, .6);--green: #22c55e;--purple: #6a00f5;--purple-contrast: #5800cc;--purple-light: rgba(88, 5, 255, .05);--yellow-contrast: #facc15;--yellow: rgba(250, 204, 21, .4);--yellow-light: #fffae5;--red: #ff5c33;--red-light: #ffebe5;--shadow: 0px 12px 33px 0px rgba(0, 0, 0, .06), 0px 3.618px 9.949px 0px rgba(0, 0, 0, .04);--tt-collaboration-carets-label: var(--tt-gray-light-900);--link-text-color: var(--tt-brand-color-500);--thread-text: var(--tt-gray-light-900);--placeholder-color: var(--tt-gray-light-a-400);--thread-bg-color: var(--tt-color-yellow-inc-2);--horizontal-rule-color: var(--tt-gray-light-a-200);--blockquote-bg-color: var(--tt-gray-light-900);--tiptap-ai-insertion-color: var(--tt-brand-color-600);--tt-inline-code-bg-color: var(--tt-gray-light-a-100);--tt-inline-code-text-color: var(--tt-gray-light-a-700);--tt-inline-code-border-color: var(--tt-gray-light-a-200);--tt-codeblock-bg: var(--tt-gray-light-a-50);--tt-codeblock-text: var(--tt-gray-light-a-800);--tt-codeblock-border: var(--tt-gray-light-a-200);--tt-checklist-bg-color: var(--tt-gray-light-a-100);--tt-checklist-bg-active-color: var(--tt-gray-light-a-900);--tt-checklist-border-color: var(--tt-gray-light-a-200);--tt-checklist-border-active-color: var(--tt-gray-light-a-900);--tt-checklist-check-icon-color: var(--white);--tt-checklist-text-active: var(--tt-gray-light-a-500);white-space:pre-wrap;caret-color:var(--tt-cursor-color)}body .ProseMirror :first-child{margin-top:0}body .ProseMirror:not(.readonly):not(.ProseMirror-hideselection) ::selection{background-color:var(--tt-selection-color)}body .ProseMirror .selection{display:inline;background-color:var(--tt-selection-color)}body .ProseMirror p{font-size:1rem;line-height:1.6}body .ProseMirror video{width:100%}body .ProseMirror ol{list-style:auto}body .ProseMirror ol ol,body .ProseMirror ul{list-style:disc}body .ProseMirror ol,body .ProseMirror ul{padding-left:1.5em;margin:0!important}body .ProseMirror ol li p,body .ProseMirror ul li p{margin-top:0!important;margin-bottom:0!important}body .ProseMirror li::marker{text-align:start!important}body .ProseMirror h1,body .ProseMirror h2,body .ProseMirror h3,body .ProseMirror h4,body .ProseMirror h5,body .ProseMirror h6{line-height:1.1;margin-top:1rem;margin-bottom:1rem;text-wrap:pretty}body .ProseMirror h1{font-size:1.4rem}body .ProseMirror h2{font-size:1.2rem}body .ProseMirror h3{font-size:1.1rem}body .ProseMirror h4,body .ProseMirror h5,body .ProseMirror h6{font-size:1rem}body .ProseMirror a,body .ProseMirror .editor-link{color:var(--purple);text-decoration:underline;cursor:pointer;transition:color .2s ease}body .ProseMirror a:hover,body .ProseMirror .editor-link:hover{color:var(--purple-contrast);text-decoration:underline}body .ProseMirror code{background-color:#ffe5e8;border-radius:.4rem;color:#c02537;padding:2px 4px;display:inline-block}body .ProseMirror .ProseMirror-selectednode:not(img):not(pre):not(.react-renderer){border-radius:var(--tt-radius-md);background-color:var(--tt-selection-color)}body .ProseMirror pre{background-color:var(--tt-codeblock-bg);color:var(--tt-codeblock-text);border:1px solid var(--tt-codeblock-border);margin-top:1.5em;margin-bottom:1.5em;padding:1em;font-size:1rem;border-radius:.375rem}body .ProseMirror pre code{background-color:transparent;border:none;border-radius:0;color:inherit;padding:0;display:block}body .ProseMirror pre.is-empty:before{left:1.15em!important;top:.8em!important}body .ProseMirror blockquote{border-left:3px solid var(--gray-3);margin:1.5rem 0;padding-left:1rem}body .ProseMirror hr{border:none;border-top:1px solid var(--gray-2);margin:2rem 0}body .ProseMirror p.is-editor-empty:first-child:before{color:var(--gray-4);content:attr(data-placeholder);float:left;height:0;pointer-events:none;margin-left:2px}body .ProseMirror p.is-empty:before,body .ProseMirror h1.is-empty:before,body .ProseMirror h2.is-empty:before,body .ProseMirror h3.is-empty:before,body .ProseMirror h4.is-empty:before,body .ProseMirror h5.is-empty:before,body .ProseMirror h6.is-empty:before{color:var(--gray-4);content:attr(data-placeholder);float:left;height:0;pointer-events:none}body .ProseMirror table{border-collapse:collapse;margin:0;overflow:hidden;table-layout:fixed;width:100%}body .ProseMirror table td,body .ProseMirror table th{border:1px solid var(--gray-3);box-sizing:border-box;min-width:1em;padding:6px 8px;position:relative;vertical-align:top}body .ProseMirror table td>*,body .ProseMirror table th>*{margin-bottom:0}body .ProseMirror table th{background-color:var(--gray-1);font-weight:700;text-align:left}body .ProseMirror table .selectedCell:after{background:var(--gray-2);content:"";left:0;right:0;top:0;bottom:0;pointer-events:none;position:absolute;z-index:2}body .ProseMirror table .column-resize-handle{background-color:var(--purple);bottom:-2px;pointer-events:none;position:absolute;right:-2px;top:0;width:4px}body .ProseMirror .tableWrapper{margin:1.5rem 0;overflow-x:auto}body .ProseMirror.resize-cursor{cursor:ew-resize;cursor:col-resize}body .ProseMirror img{max-width:100%}body .ProseMirror .mention,body .ProseMirror .hash-tag{color:#c02537;padding:0 .3em}body .ProseMirror .custom-content{color:var(--custom-content-color, #000);padding:0 .3em;cursor:pointer;transition:color .2s ease}body .ProseMirror .custom-content:hover{color:var(--custom-content-hover-color, #c02537)}.animation-indent--right{animation:indent-right .5s cubic-bezier(.68,-.55,.27,1.55) 1 alternate-reverse}@keyframes indent-right{0%{transform:translate(0)}to{transform:translate(12px)}}.tiptap-editor-container{display:flex;flex-direction:column;border:1px solid var(--gray-3);border-radius:8px;overflow:hidden;height:100%;background-color:var(--white)}.dark .tiptap-editor-container{background-color:var(--black);border-color:var(--gray-4)}.tiptap-editor-container.list{height:auto;border:none;background:transparent}.tiptap-editor-container.list .tiptap-editor-content-wrapper{display:block;height:auto;overflow:visible;padding:0}.tiptap-editor-container.list .tiptap-editor-content-wrapper .ProseMirror{height:auto;overflow:visible}.tiptap-editor-container .tiptap-editor-toolbar{flex:0 0 auto;border-bottom:1px solid var(--gray-3);padding:4px;background-color:var(--gray-1);display:flex;flex-wrap:wrap;gap:4px}.dark .tiptap-editor-container .tiptap-editor-toolbar{border-bottom-color:var(--gray-4);background-color:var(--gray-2)}.tiptap-editor-container .tiptap-editor-content-wrapper{flex:1 1 auto;overflow-y:auto;position:relative;padding:16px 8px;background-color:var(--white);display:flex;justify-content:center}.dark .tiptap-editor-container .tiptap-editor-content-wrapper{background-color:var(--black)}.tiptap-editor-container .tiptap-editor-content-wrapper .ProseMirror{width:100%}.tiptap-dropdown-menu .el-dropdown-menu__item.is-active,.tiptap-dropdown-menu .el-dropdown-menu__item:hover,.tiptap-dropdown-menu .el-dropdown-menu__item:focus{color:var(--tt-brand-color-500)!important;background-color:var(--tt-brand-color-50)!important}.dark .tiptap-dropdown-menu .el-dropdown-menu__item.is-active,.dark .tiptap-dropdown-menu .el-dropdown-menu__item:hover,.dark .tiptap-dropdown-menu .el-dropdown-menu__item:focus{color:var(--tt-brand-color-400)!important;background-color:var(--tt-brand-color-900)!important}.tiptap-dropdown-menu-item-content{display:flex;align-items:center;gap:8px;width:100%}.tiptap-dropdown-menu-item-label{font-size:10px;font-weight:700;color:var(--tt-text-muted);padding:1px 4px;border-radius:4px;min-width:20px;text-align:center}.dark .tiptap-dropdown-menu-item-label{background-color:var(--tt-gray-dark-200)}.tiptap-heading-trigger .tiptap-button-icon-chevron,.tiptap-list-dropdown-trigger .tiptap-button-icon-chevron,.tiptap-table-dropdown-trigger .tiptap-button-icon-chevron{width:12px;height:12px;margin-left:2px;color:var(--tt-text-muted)}.tiptap-dropdown-menu-item-icon{width:16px;height:16px;color:var(--tt-text-muted)}
|
|
1
|
+
:root{overflow-wrap:break-word;-webkit-text-size-adjust:none;text-size-adjust:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;--tt-gray-light-a-50: rgba(56, 56, 56, .04);--tt-gray-light-a-100: rgba(15, 22, 36, .05);--tt-gray-light-a-200: rgba(37, 39, 45, .1);--tt-gray-light-a-300: rgba(47, 50, 55, .2);--tt-gray-light-a-400: rgba(40, 44, 51, .42);--tt-gray-light-a-500: rgba(52, 55, 60, .64);--tt-gray-light-a-600: rgba(36, 39, 46, .78);--tt-gray-light-a-700: rgba(35, 37, 42, .87);--tt-gray-light-a-800: rgba(30, 32, 36, .95);--tt-gray-light-a-900: rgba(29, 30, 32, .98);--tt-gray-light-50: #fafafa;--tt-gray-light-100: #f4f4f5;--tt-gray-light-200: #eaeaeb;--tt-gray-light-300: #d5d6d7;--tt-gray-light-400: #a6a7ab;--tt-gray-light-500: #7d7f82;--tt-gray-light-600: #53565a;--tt-gray-light-700: #404145;--tt-gray-light-800: #2c2d30;--tt-gray-light-900: #222325;--tt-gray-dark-a-50: rgba(232, 232, 253, .05);--tt-gray-dark-a-100: rgba(231, 231, 243, .07);--tt-gray-dark-a-200: rgba(238, 238, 246, .11);--tt-gray-dark-a-300: rgba(239, 239, 245, .22);--tt-gray-dark-a-400: rgba(244, 244, 255, .37);--tt-gray-dark-a-500: rgba(236, 238, 253, .5);--tt-gray-dark-a-600: rgba(247, 247, 253, .64);--tt-gray-dark-a-700: rgba(251, 251, 254, .75);--tt-gray-dark-a-800: rgba(253, 253, 253, .88);--tt-gray-dark-a-900: rgba(255, 255, 255, .96);--tt-gray-dark-50: #19191a;--tt-gray-dark-100: #202022;--tt-gray-dark-200: #2d2d2f;--tt-gray-dark-300: #464649;--tt-gray-dark-400: #636369;--tt-gray-dark-500: #7c7c83;--tt-gray-dark-600: #a3a3a8;--tt-gray-dark-700: #c0c0c3;--tt-gray-dark-800: #e0e0e1;--tt-gray-dark-900: #f5f5f5;--tt-brand-color-50: #fef2f3;--tt-brand-color-100: #fce8e9;--tt-brand-color-200: #f9d4d5;--tt-brand-color-300: #f4b4b6;--tt-brand-color-400: #eb747e;--tt-brand-color-500: #c02537;--tt-brand-color-600: #a51c2d;--tt-brand-color-700: #8b1826;--tt-brand-color-800: #71131f;--tt-brand-color-900: #570f18;--tt-brand-color-950: #3a0a10;--tt-color-green-inc-5: hsl(129, 100%, 97%);--tt-color-green-inc-4: hsl(129, 100%, 92%);--tt-color-green-inc-3: hsl(131, 100%, 86%);--tt-color-green-inc-2: hsl(133, 98%, 78%);--tt-color-green-inc-1: hsl(137, 99%, 70%);--tt-color-green-base: hsl(147, 99%, 50%);--tt-color-green-dec-1: hsl(147, 97%, 41%);--tt-color-green-dec-2: hsl(146, 98%, 32%);--tt-color-green-dec-3: hsl(146, 100%, 24%);--tt-color-green-dec-4: hsl(144, 100%, 16%);--tt-color-green-dec-5: hsl(140, 100%, 9%);--tt-color-yellow-inc-5: hsl(50, 100%, 97%);--tt-color-yellow-inc-4: hsl(50, 100%, 91%);--tt-color-yellow-inc-3: hsl(50, 100%, 84%);--tt-color-yellow-inc-2: hsl(50, 100%, 77%);--tt-color-yellow-inc-1: hsl(50, 100%, 68%);--tt-color-yellow-base: hsl(52, 100%, 50%);--tt-color-yellow-dec-1: hsl(52, 100%, 41%);--tt-color-yellow-dec-2: hsl(52, 100%, 32%);--tt-color-yellow-dec-3: hsl(52, 100%, 24%);--tt-color-yellow-dec-4: hsl(51, 100%, 16%);--tt-color-yellow-dec-5: hsl(50, 100%, 9%);--tt-color-red-inc-5: hsl(11, 100%, 96%);--tt-color-red-inc-4: hsl(11, 100%, 88%);--tt-color-red-inc-3: hsl(10, 100%, 80%);--tt-color-red-inc-2: hsl(9, 100%, 73%);--tt-color-red-inc-1: hsl(7, 100%, 64%);--tt-color-red-base: hsl(7, 100%, 54%);--tt-color-red-dec-1: hsl(7, 100%, 41%);--tt-color-red-dec-2: hsl(5, 100%, 32%);--tt-color-red-dec-3: hsl(4, 100%, 24%);--tt-color-red-dec-4: hsl(3, 100%, 16%);--tt-color-red-dec-5: hsl(1, 100%, 9%);--white: #ffffff;--black: #0e0e11;--transparent: rgba(255, 255, 255, 0);--tt-shadow-elevated-md: 0px 16px 48px 0px rgba(17, 24, 39, .04), 0px 12px 24px 0px rgba(17, 24, 39, .04), 0px 6px 8px 0px rgba(17, 24, 39, .02), 0px 2px 3px 0px rgba(17, 24, 39, .02);--tt-radius-xxs: .125rem;--tt-radius-xs: .25rem;--tt-radius-sm: .375rem;--tt-radius-md: .5rem;--tt-radius-lg: .75rem;--tt-radius-xl: 1rem;--tt-transition-duration-short: .1s;--tt-transition-duration-default: .2s;--tt-transition-duration-long: .64s;--tt-transition-easing-default: cubic-bezier(.46, .03, .52, .96);--tt-transition-easing-cubic: cubic-bezier(.65, .05, .36, 1);--tt-transition-easing-quart: cubic-bezier(.77, 0, .18, 1);--tt-transition-easing-circ: cubic-bezier(.79, .14, .15, .86);--tt-transition-easing-back: cubic-bezier(.68, -.55, .27, 1.55);--tt-accent-contrast: 8%;--tt-destructive-contrast: 8%;--tt-foreground-contrast: 8%}:root,:root *,:root :before,:root :after{box-sizing:border-box}:root{--tt-bg-color: var(--white);--tt-text-default: var(--tt-gray-light-900);--tt-border-color: var(--tt-gray-light-a-200);--tt-border-color-tint: var(--tt-gray-light-a-100);--tt-sidebar-bg-color: var(--tt-gray-light-100);--tt-scrollbar-color: var(--tt-gray-light-a-200);--tt-cursor-color: var(--tt-brand-color-500);--tt-selection-color: rgba(244, 180, 182, .2);--tt-card-bg-color: var(--white);--tt-card-border-color: var(--tt-gray-light-a-100)}.dark{--tt-bg-color: var(--black);--tt-text-default: var(--tt-gray-dark-900);--tt-border-color: var(--tt-gray-dark-a-200);--tt-border-color-tint: var(--tt-gray-dark-a-100);--tt-sidebar-bg-color: var(--tt-gray-dark-100);--tt-scrollbar-color: var(--tt-gray-dark-a-200);--tt-cursor-color: var(--tt-brand-color-400);--tt-selection-color: rgba(235, 116, 126, .2);--tt-card-bg-color: var(--tt-gray-dark-50);--tt-card-border-color: var(--tt-gray-dark-a-50);--tt-shadow-elevated-md: 0px 16px 48px 0px rgba(0, 0, 0, .5), 0px 12px 24px 0px rgba(0, 0, 0, .24), 0px 6px 8px 0px rgba(0, 0, 0, .22), 0px 2px 3px 0px rgba(0, 0, 0, .12)}:root{--tt-color-text-gray: hsl(45, 2%, 46%);--tt-color-text-brown: hsl(19, 31%, 47%);--tt-color-text-orange: hsl(30, 89%, 45%);--tt-color-text-yellow: hsl(38, 62%, 49%);--tt-color-text-green: hsl(148, 32%, 39%);--tt-color-text-blue: hsl(202, 54%, 43%);--tt-color-text-purple: hsl(274, 32%, 54%);--tt-color-text-pink: hsl(328, 49%, 53%);--tt-color-text-red: var(--tt-brand-color-500);--tt-color-text-gray-contrast: hsla(39, 26%, 26%, .15);--tt-color-text-brown-contrast: hsla(18, 43%, 69%, .35);--tt-color-text-orange-contrast: hsla(24, 73%, 55%, .27);--tt-color-text-yellow-contrast: hsla(44, 82%, 59%, .39);--tt-color-text-green-contrast: hsla(126, 29%, 60%, .27);--tt-color-text-blue-contrast: hsla(202, 54%, 59%, .27);--tt-color-text-purple-contrast: hsla(274, 37%, 64%, .27);--tt-color-text-pink-contrast: hsla(331, 60%, 71%, .27);--tt-color-text-red-contrast: hsla(8, 79%, 79%, .4)}.dark{--tt-color-text-gray: hsl(0, 0%, 61%);--tt-color-text-brown: hsl(18, 35%, 58%);--tt-color-text-orange: hsl(25, 53%, 53%);--tt-color-text-yellow: hsl(36, 54%, 55%);--tt-color-text-green: hsl(145, 32%, 47%);--tt-color-text-blue: hsl(202, 64%, 52%);--tt-color-text-purple: hsl(270, 55%, 62%);--tt-color-text-pink: hsl(329, 57%, 58%);--tt-color-text-red: var(--tt-brand-color-400);--tt-color-text-gray-contrast: hsla(0, 0%, 100%, .09);--tt-color-text-brown-contrast: hsla(17, 45%, 50%, .25);--tt-color-text-orange-contrast: hsla(27, 82%, 53%, .2);--tt-color-text-yellow-contrast: hsla(35, 49%, 47%, .2);--tt-color-text-green-contrast: hsla(151, 55%, 39%, .2);--tt-color-text-blue-contrast: hsla(202, 54%, 43%, .2);--tt-color-text-purple-contrast: hsla(271, 56%, 60%, .18);--tt-color-text-pink-contrast: hsla(331, 67%, 58%, .22);--tt-color-text-red-contrast: hsla(0, 67%, 60%, .25)}:root{--tt-color-highlight-yellow: #fef9c3;--tt-color-highlight-green: #dcfce7;--tt-color-highlight-blue: #e0f2fe;--tt-color-highlight-purple: #f3e8ff;--tt-color-highlight-red: #ffe4e6;--tt-color-highlight-gray: #f8f8f7;--tt-color-highlight-brown: #f4eeee;--tt-color-highlight-orange: #fbecdd;--tt-color-highlight-pink: #fcf1f6;--tt-color-highlight-yellow-contrast: #fbe604;--tt-color-highlight-green-contrast: #c7fad8;--tt-color-highlight-blue-contrast: #ceeafd;--tt-color-highlight-purple-contrast: #e4ccff;--tt-color-highlight-red-contrast: #ffccd0;--tt-color-highlight-gray-contrast: rgba(84, 72, 49, .15);--tt-color-highlight-brown-contrast: rgba(210, 162, 141, .35);--tt-color-highlight-orange-contrast: rgba(224, 124, 57, .27);--tt-color-highlight-pink-contrast: rgba(225, 136, 179, .27)}.dark{--tt-color-highlight-yellow: #6b6524;--tt-color-highlight-green: #509568;--tt-color-highlight-blue: #6e92aa;--tt-color-highlight-purple: #583e74;--tt-color-highlight-red: #743e42;--tt-color-highlight-gray: #2f2f2f;--tt-color-highlight-brown: #4a3228;--tt-color-highlight-orange: #5c3b23;--tt-color-highlight-pink: #4e2c3c;--tt-color-highlight-yellow-contrast: #58531e;--tt-color-highlight-green-contrast: #47855d;--tt-color-highlight-blue-contrast: #5e86a1;--tt-color-highlight-purple-contrast: #4c3564;--tt-color-highlight-red-contrast: #643539;--tt-color-highlight-gray-contrast: rgba(255, 255, 255, .094);--tt-color-highlight-brown-contrast: rgba(184, 101, 69, .25);--tt-color-highlight-orange-contrast: rgba(233, 126, 37, .2);--tt-color-highlight-pink-contrast: rgba(220, 76, 145, .22)}body .ProseMirror{flex:1;outline:none;word-break:break-all;line-height:1.6;font-size:var(--font-base);--white: #fff;--black: #2e2b29;--gray-1: rgba(61, 37, 20, .05);--gray-2: rgba(61, 37, 20, .08);--gray-3: rgba(61, 37, 20, .12);--gray-4: rgba(53, 38, 28, .3);--gray-5: rgba(28, 25, 23, .6);--green: #22c55e;--purple: #6a00f5;--purple-contrast: #5800cc;--purple-light: rgba(88, 5, 255, .05);--yellow-contrast: #facc15;--yellow: rgba(250, 204, 21, .4);--yellow-light: #fffae5;--red: #ff5c33;--red-light: #ffebe5;--shadow: 0px 12px 33px 0px rgba(0, 0, 0, .06), 0px 3.618px 9.949px 0px rgba(0, 0, 0, .04);--tt-collaboration-carets-label: var(--tt-gray-light-900);--link-text-color: var(--tt-brand-color-500);--thread-text: var(--tt-gray-light-900);--placeholder-color: var(--tt-gray-light-a-400);--thread-bg-color: var(--tt-color-yellow-inc-2);--horizontal-rule-color: var(--tt-gray-light-a-200);--blockquote-bg-color: var(--tt-gray-light-900);--tiptap-ai-insertion-color: var(--tt-brand-color-600);--tt-inline-code-bg-color: var(--tt-gray-light-a-100);--tt-inline-code-text-color: var(--tt-gray-light-a-700);--tt-inline-code-border-color: var(--tt-gray-light-a-200);--tt-codeblock-bg: var(--tt-gray-light-a-50);--tt-codeblock-text: var(--tt-gray-light-a-800);--tt-codeblock-border: var(--tt-gray-light-a-200);--tt-checklist-bg-color: var(--tt-gray-light-a-100);--tt-checklist-bg-active-color: var(--tt-gray-light-a-900);--tt-checklist-border-color: var(--tt-gray-light-a-200);--tt-checklist-border-active-color: var(--tt-gray-light-a-900);--tt-checklist-check-icon-color: var(--white);--tt-checklist-text-active: var(--tt-gray-light-a-500);white-space:pre-wrap;caret-color:var(--tt-cursor-color)}body .ProseMirror :first-child{margin-top:0}body .ProseMirror:not(.readonly):not(.ProseMirror-hideselection) ::selection{background-color:var(--tt-selection-color)}body .ProseMirror .selection{display:inline;background-color:var(--tt-selection-color)}body .ProseMirror p{font-size:1rem;line-height:1.6}body .ProseMirror video{width:100%}body .ProseMirror ol{list-style:auto}body .ProseMirror ol ol,body .ProseMirror ul{list-style:disc}body .ProseMirror ol,body .ProseMirror ul{padding-left:1.5em;margin:0!important}body .ProseMirror ol li p,body .ProseMirror ul li p{margin-top:0!important;margin-bottom:0!important}body .ProseMirror li::marker{text-align:start!important}body .ProseMirror h1,body .ProseMirror h2,body .ProseMirror h3,body .ProseMirror h4,body .ProseMirror h5,body .ProseMirror h6{line-height:1.1;margin-top:1rem;margin-bottom:1rem;text-wrap:pretty}body .ProseMirror h1{font-size:1.4rem}body .ProseMirror h2{font-size:1.2rem}body .ProseMirror h3{font-size:1.1rem}body .ProseMirror h4,body .ProseMirror h5,body .ProseMirror h6{font-size:1rem}body .ProseMirror a,body .ProseMirror .editor-link{color:var(--purple);text-decoration:underline;cursor:pointer;transition:color .2s ease}body .ProseMirror a:hover,body .ProseMirror .editor-link:hover{color:var(--purple-contrast);text-decoration:underline}body .ProseMirror code{background-color:#ffe5e8;border-radius:.4rem;color:#c02537;padding:2px 4px;display:inline-block}body .ProseMirror .ProseMirror-selectednode:not(img):not(pre):not(.react-renderer){border-radius:var(--tt-radius-md);background-color:var(--tt-selection-color)}body .ProseMirror pre{background-color:var(--tt-codeblock-bg);color:var(--tt-codeblock-text);border:1px solid var(--tt-codeblock-border);margin-top:1.5em;margin-bottom:1.5em;padding:1em;font-size:1rem;border-radius:.375rem}body .ProseMirror pre code{background-color:transparent;border:none;border-radius:0;color:inherit;padding:0;display:block}body .ProseMirror pre.is-empty:before{left:1.15em!important;top:.8em!important}body .ProseMirror blockquote{border-left:3px solid var(--gray-3);margin:1.5rem 0;padding-left:1rem}body .ProseMirror hr{border:none;border-top:1px solid var(--gray-2);margin:2rem 0}body .ProseMirror p.is-editor-empty:first-child:before{color:var(--gray-4);content:attr(data-placeholder);float:left;height:0;pointer-events:none;margin-left:2px}body .ProseMirror p.is-empty:before,body .ProseMirror h1.is-empty:before,body .ProseMirror h2.is-empty:before,body .ProseMirror h3.is-empty:before,body .ProseMirror h4.is-empty:before,body .ProseMirror h5.is-empty:before,body .ProseMirror h6.is-empty:before{color:var(--gray-4);content:attr(data-placeholder);float:left;height:0;pointer-events:none}body .ProseMirror table{border-collapse:collapse;margin:0;overflow:hidden;table-layout:fixed;width:100%}body .ProseMirror table td,body .ProseMirror table th{border:1px solid var(--gray-3);box-sizing:border-box;min-width:1em;padding:6px 8px;position:relative;vertical-align:top}body .ProseMirror table td>*,body .ProseMirror table th>*{margin-bottom:0}body .ProseMirror table th{background-color:var(--gray-1);font-weight:700;text-align:left}body .ProseMirror table .selectedCell:after{background:var(--gray-2);content:"";left:0;right:0;top:0;bottom:0;pointer-events:none;position:absolute;z-index:2}body .ProseMirror table .column-resize-handle{background-color:var(--purple);bottom:-2px;pointer-events:none;position:absolute;right:-2px;top:0;width:4px}body .ProseMirror .tableWrapper{margin:1.5rem 0;overflow-x:auto}body .ProseMirror.resize-cursor{cursor:ew-resize;cursor:col-resize}body .ProseMirror img{max-width:100%}body .ProseMirror .mention,body .ProseMirror .hash-tag{color:#c02537;padding:0 .3em}body .ProseMirror .custom-content{color:var(--custom-content-color, #000);padding:0 .3em;cursor:pointer;transition:color .2s ease}body .ProseMirror .custom-content:hover{color:var(--custom-content-hover-color, #c02537)}.animation-indent--right{animation:indent-right .5s cubic-bezier(.68,-.55,.27,1.55) 1 alternate-reverse}@keyframes indent-right{0%{transform:translate(0)}to{transform:translate(12px)}}.tiptap-editor-container{display:flex;flex-direction:column;border:1px solid var(--gray-3);border-radius:8px;overflow:hidden;height:100%;background-color:var(--white)}.dark .tiptap-editor-container{background-color:var(--black);border-color:var(--gray-4)}.tiptap-editor-container.list{height:auto;border:none;background:transparent}.tiptap-editor-container.list .tiptap-editor-content-wrapper{display:block;height:auto;overflow:visible;padding:0}.tiptap-editor-container.list .tiptap-editor-content-wrapper .ProseMirror{height:auto;overflow:visible}.tiptap-editor-container .tiptap-editor-toolbar{flex:0 0 auto;border-bottom:1px solid var(--gray-3);padding:4px;background-color:var(--gray-1);display:flex;flex-wrap:wrap;gap:4px}.dark .tiptap-editor-container .tiptap-editor-toolbar{border-bottom-color:var(--gray-4);background-color:var(--gray-2)}.tiptap-editor-container .tiptap-editor-content-wrapper{flex:1 1 auto;overflow-y:auto;position:relative;padding:16px 8px;background-color:var(--white);display:flex;justify-content:center}.dark .tiptap-editor-container .tiptap-editor-content-wrapper{background-color:var(--black)}.tiptap-editor-container .tiptap-editor-content-wrapper .ProseMirror{width:100%}.tiptap-dropdown-menu .el-dropdown-menu__item.is-active,.tiptap-dropdown-menu .el-dropdown-menu__item:hover,.tiptap-dropdown-menu .el-dropdown-menu__item:focus{color:var(--tt-brand-color-500)!important;background-color:var(--tt-brand-color-50)!important}.dark .tiptap-dropdown-menu .el-dropdown-menu__item.is-active,.dark .tiptap-dropdown-menu .el-dropdown-menu__item:hover,.dark .tiptap-dropdown-menu .el-dropdown-menu__item:focus{color:var(--tt-brand-color-400)!important;background-color:var(--tt-brand-color-900)!important}.tiptap-dropdown-menu-item-content{display:flex;align-items:center;gap:8px;width:100%}.tiptap-dropdown-menu-item-label{font-size:10px;font-weight:700;color:var(--tt-text-muted);padding:1px 4px;border-radius:4px;min-width:20px;text-align:center}.dark .tiptap-dropdown-menu-item-label{background-color:var(--tt-gray-dark-200)}.tiptap-heading-trigger .tiptap-button-icon-chevron,.tiptap-list-dropdown-trigger .tiptap-button-icon-chevron,.tiptap-table-dropdown-trigger .tiptap-button-icon-chevron{width:12px;height:12px;margin-left:2px;color:var(--tt-text-muted)}.tiptap-dropdown-menu-item-icon{width:16px;height:16px;color:var(--tt-text-muted)}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { type PropType } from 'vue';
|
|
2
|
+
import '../styles/text-color-button.less';
|
|
3
|
+
export declare const TextColorButton: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
4
|
+
editor: {
|
|
5
|
+
type: PropType<any>;
|
|
6
|
+
required: true;
|
|
7
|
+
};
|
|
8
|
+
textColor: {
|
|
9
|
+
type: StringConstructor;
|
|
10
|
+
required: true;
|
|
11
|
+
};
|
|
12
|
+
label: {
|
|
13
|
+
type: StringConstructor;
|
|
14
|
+
default: string;
|
|
15
|
+
};
|
|
16
|
+
hideWhenUnavailable: {
|
|
17
|
+
type: BooleanConstructor;
|
|
18
|
+
default: boolean;
|
|
19
|
+
};
|
|
20
|
+
className: {
|
|
21
|
+
type: StringConstructor;
|
|
22
|
+
default: string;
|
|
23
|
+
};
|
|
24
|
+
onApplied: {
|
|
25
|
+
type: PropType<(params: {
|
|
26
|
+
color: string;
|
|
27
|
+
label: string;
|
|
28
|
+
}) => void>;
|
|
29
|
+
};
|
|
30
|
+
isDefault: {
|
|
31
|
+
type: BooleanConstructor;
|
|
32
|
+
default: boolean;
|
|
33
|
+
};
|
|
34
|
+
}>, () => import("vue/jsx-runtime").JSX.Element | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
35
|
+
editor: {
|
|
36
|
+
type: PropType<any>;
|
|
37
|
+
required: true;
|
|
38
|
+
};
|
|
39
|
+
textColor: {
|
|
40
|
+
type: StringConstructor;
|
|
41
|
+
required: true;
|
|
42
|
+
};
|
|
43
|
+
label: {
|
|
44
|
+
type: StringConstructor;
|
|
45
|
+
default: string;
|
|
46
|
+
};
|
|
47
|
+
hideWhenUnavailable: {
|
|
48
|
+
type: BooleanConstructor;
|
|
49
|
+
default: boolean;
|
|
50
|
+
};
|
|
51
|
+
className: {
|
|
52
|
+
type: StringConstructor;
|
|
53
|
+
default: string;
|
|
54
|
+
};
|
|
55
|
+
onApplied: {
|
|
56
|
+
type: PropType<(params: {
|
|
57
|
+
color: string;
|
|
58
|
+
label: string;
|
|
59
|
+
}) => void>;
|
|
60
|
+
};
|
|
61
|
+
isDefault: {
|
|
62
|
+
type: BooleanConstructor;
|
|
63
|
+
default: boolean;
|
|
64
|
+
};
|
|
65
|
+
}>> & Readonly<{}>, {
|
|
66
|
+
label: string;
|
|
67
|
+
className: string;
|
|
68
|
+
hideWhenUnavailable: boolean;
|
|
69
|
+
isDefault: boolean;
|
|
70
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
import { createVNode as _createVNode, mergeProps as _mergeProps } from "vue";
|
|
21
|
+
import "./_atomic.css";
|
|
22
|
+
import { defineComponent } from "vue";
|
|
23
|
+
import { useTextColor } from "../hooks/use-text-color";
|
|
24
|
+
import { Button } from "../primitives/button";
|
|
25
|
+
import { cn } from "../utils/tiptap-utils";
|
|
26
|
+
import "../styles/text-color-button.css";
|
|
27
|
+
const TextColorButton = defineComponent({
|
|
28
|
+
name: "TextColorButton",
|
|
29
|
+
props: {
|
|
30
|
+
editor: {
|
|
31
|
+
type: Object,
|
|
32
|
+
required: true
|
|
33
|
+
},
|
|
34
|
+
textColor: {
|
|
35
|
+
type: String,
|
|
36
|
+
required: true
|
|
37
|
+
},
|
|
38
|
+
label: {
|
|
39
|
+
type: String,
|
|
40
|
+
default: ""
|
|
41
|
+
},
|
|
42
|
+
hideWhenUnavailable: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
default: false
|
|
45
|
+
},
|
|
46
|
+
className: {
|
|
47
|
+
type: String,
|
|
48
|
+
default: ""
|
|
49
|
+
},
|
|
50
|
+
onApplied: {
|
|
51
|
+
type: Function
|
|
52
|
+
},
|
|
53
|
+
isDefault: {
|
|
54
|
+
type: Boolean,
|
|
55
|
+
default: false
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
setup(props, {
|
|
59
|
+
attrs
|
|
60
|
+
}) {
|
|
61
|
+
const {
|
|
62
|
+
isVisible,
|
|
63
|
+
canColor,
|
|
64
|
+
isActive
|
|
65
|
+
} = useTextColor({
|
|
66
|
+
editor: props.editor,
|
|
67
|
+
textColor: props.textColor,
|
|
68
|
+
label: props.label,
|
|
69
|
+
hideWhenUnavailable: props.hideWhenUnavailable
|
|
70
|
+
});
|
|
71
|
+
const handleClick = () => {
|
|
72
|
+
const editor = props.editor && "value" in props.editor ? props.editor.value : props.editor;
|
|
73
|
+
if (!editor || !canColor.value)
|
|
74
|
+
return;
|
|
75
|
+
if (props.isDefault) {
|
|
76
|
+
setTimeout(() => {
|
|
77
|
+
var _a;
|
|
78
|
+
editor.chain().focus().unsetColor().run();
|
|
79
|
+
(_a = props.onApplied) == null ? void 0 : _a.call(props, {
|
|
80
|
+
color: "",
|
|
81
|
+
label: props.label || "\u9ED8\u8BA4\u989C\u8272"
|
|
82
|
+
});
|
|
83
|
+
}, 0);
|
|
84
|
+
} else {
|
|
85
|
+
setTimeout(() => {
|
|
86
|
+
var _a;
|
|
87
|
+
const success = editor.chain().focus().setColor(props.textColor).run();
|
|
88
|
+
if (success) {
|
|
89
|
+
(_a = props.onApplied) == null ? void 0 : _a.call(props, {
|
|
90
|
+
color: props.textColor,
|
|
91
|
+
label: props.label
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
}, 0);
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
return () => {
|
|
98
|
+
if (!isVisible.value)
|
|
99
|
+
return null;
|
|
100
|
+
return _createVNode(Button, _mergeProps({
|
|
101
|
+
"type": "button",
|
|
102
|
+
"disabled": !canColor.value,
|
|
103
|
+
"data-style": "ghost",
|
|
104
|
+
"data-active-state": isActive.value ? "on" : "off",
|
|
105
|
+
"role": "button",
|
|
106
|
+
"tabindex": -1,
|
|
107
|
+
"aria-label": props.label,
|
|
108
|
+
"aria-pressed": isActive.value,
|
|
109
|
+
"tooltip": props.label,
|
|
110
|
+
"onClick": handleClick,
|
|
111
|
+
"class": cn("tiptap-text-color-button", props.className),
|
|
112
|
+
"style": __spreadProps(__spreadValues({}, attrs.style || {}), {
|
|
113
|
+
"--text-color": props.textColor
|
|
114
|
+
})
|
|
115
|
+
}, attrs), {
|
|
116
|
+
default: () => [_createVNode("div", {
|
|
117
|
+
"class": cn("tiptap-button-text-color", props.isDefault ? "tiptap-button-text-color--default" : ""),
|
|
118
|
+
"style": {
|
|
119
|
+
"--text-color": props.textColor
|
|
120
|
+
}
|
|
121
|
+
}, null)]
|
|
122
|
+
});
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
export {
|
|
127
|
+
TextColorButton
|
|
128
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type PropType } from 'vue';
|
|
2
|
+
import '../styles/text-color-popover.less';
|
|
3
|
+
export declare const TextColorPopover: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
4
|
+
editor: {
|
|
5
|
+
type: PropType<any>;
|
|
6
|
+
required: true;
|
|
7
|
+
};
|
|
8
|
+
hideWhenUnavailable: {
|
|
9
|
+
type: BooleanConstructor;
|
|
10
|
+
default: boolean;
|
|
11
|
+
};
|
|
12
|
+
className: {
|
|
13
|
+
type: StringConstructor;
|
|
14
|
+
default: string;
|
|
15
|
+
};
|
|
16
|
+
}>, () => import("vue/jsx-runtime").JSX.Element | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
17
|
+
editor: {
|
|
18
|
+
type: PropType<any>;
|
|
19
|
+
required: true;
|
|
20
|
+
};
|
|
21
|
+
hideWhenUnavailable: {
|
|
22
|
+
type: BooleanConstructor;
|
|
23
|
+
default: boolean;
|
|
24
|
+
};
|
|
25
|
+
className: {
|
|
26
|
+
type: StringConstructor;
|
|
27
|
+
default: string;
|
|
28
|
+
};
|
|
29
|
+
}>> & Readonly<{}>, {
|
|
30
|
+
className: string;
|
|
31
|
+
hideWhenUnavailable: boolean;
|
|
32
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { createVNode as _createVNode, mergeProps as _mergeProps } from "vue";
|
|
2
|
+
import "./_atomic.css";
|
|
3
|
+
import { defineComponent, ref } from "vue";
|
|
4
|
+
import { useTextColor, TEXT_COLORS } from "../hooks/use-text-color";
|
|
5
|
+
import { TextColorButton } from "./text-color-button";
|
|
6
|
+
import { Button } from "../primitives/button";
|
|
7
|
+
import { ElPopover } from "element-plus";
|
|
8
|
+
import { TypeIcon, BanIcon } from "../icons";
|
|
9
|
+
import { cn } from "../utils/tiptap-utils";
|
|
10
|
+
import "../styles/text-color-popover.css";
|
|
11
|
+
const TextColorPopover = defineComponent({
|
|
12
|
+
name: "TextColorPopover",
|
|
13
|
+
props: {
|
|
14
|
+
editor: {
|
|
15
|
+
type: Object,
|
|
16
|
+
required: true
|
|
17
|
+
},
|
|
18
|
+
hideWhenUnavailable: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: false
|
|
21
|
+
},
|
|
22
|
+
className: {
|
|
23
|
+
type: String,
|
|
24
|
+
default: ""
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
setup(props, {
|
|
28
|
+
attrs
|
|
29
|
+
}) {
|
|
30
|
+
const {
|
|
31
|
+
isVisible,
|
|
32
|
+
canColor,
|
|
33
|
+
isActive,
|
|
34
|
+
label,
|
|
35
|
+
currentColor,
|
|
36
|
+
handleRemoveColor
|
|
37
|
+
} = useTextColor({
|
|
38
|
+
editor: props.editor,
|
|
39
|
+
hideWhenUnavailable: props.hideWhenUnavailable
|
|
40
|
+
});
|
|
41
|
+
const isOpen = ref(false);
|
|
42
|
+
const customColor = ref("#000000");
|
|
43
|
+
const showCustomPicker = ref(false);
|
|
44
|
+
const getEditor = () => {
|
|
45
|
+
const editor = props.editor;
|
|
46
|
+
return editor && "value" in editor ? editor.value : editor;
|
|
47
|
+
};
|
|
48
|
+
const handleCustomColorChange = (color) => {
|
|
49
|
+
if (!color)
|
|
50
|
+
return;
|
|
51
|
+
customColor.value = color;
|
|
52
|
+
const editor = getEditor();
|
|
53
|
+
if (editor && canColor.value) {
|
|
54
|
+
editor.chain().focus().setColor(color).run();
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
const handleCustomColorConfirm = () => {
|
|
58
|
+
isOpen.value = false;
|
|
59
|
+
showCustomPicker.value = false;
|
|
60
|
+
};
|
|
61
|
+
return () => {
|
|
62
|
+
if (!isVisible.value)
|
|
63
|
+
return null;
|
|
64
|
+
const activeColor = currentColor.value || "var(--tt-text-default)";
|
|
65
|
+
const trigger = _createVNode(Button, _mergeProps({
|
|
66
|
+
"type": "button",
|
|
67
|
+
"disabled": !canColor.value,
|
|
68
|
+
"data-style": "ghost",
|
|
69
|
+
"data-active-state": isActive.value ? "on" : "off",
|
|
70
|
+
"role": "button",
|
|
71
|
+
"tooltip": label,
|
|
72
|
+
"class": cn("tiptap-text-color-trigger", props.className)
|
|
73
|
+
}, attrs), {
|
|
74
|
+
default: () => [_createVNode(TypeIcon, {
|
|
75
|
+
"class": "tiptap-button-icon"
|
|
76
|
+
}, null), _createVNode("span", {
|
|
77
|
+
"class": "tiptap-text-color-trigger-bar",
|
|
78
|
+
"style": {
|
|
79
|
+
backgroundColor: activeColor
|
|
80
|
+
}
|
|
81
|
+
}, null)]
|
|
82
|
+
});
|
|
83
|
+
return _createVNode(ElPopover, {
|
|
84
|
+
"trigger": "click",
|
|
85
|
+
"width": "auto",
|
|
86
|
+
"popper-class": "tiptap-text-color-popover",
|
|
87
|
+
"visible": isOpen.value,
|
|
88
|
+
"onUpdate:visible": ($event) => isOpen.value = $event
|
|
89
|
+
}, {
|
|
90
|
+
reference: () => trigger,
|
|
91
|
+
default: () => _createVNode("div", {
|
|
92
|
+
"class": "tiptap-text-color-popover-content"
|
|
93
|
+
}, [_createVNode("div", {
|
|
94
|
+
"class": "tiptap-text-color-grid"
|
|
95
|
+
}, [TEXT_COLORS.filter((c) => !c.isDefault).map((color) => _createVNode(TextColorButton, {
|
|
96
|
+
"key": color.value,
|
|
97
|
+
"editor": props.editor,
|
|
98
|
+
"textColor": color.value,
|
|
99
|
+
"label": color.label,
|
|
100
|
+
"onApplied": () => {
|
|
101
|
+
isOpen.value = false;
|
|
102
|
+
}
|
|
103
|
+
}, null))]), _createVNode("div", {
|
|
104
|
+
"class": "tiptap-text-color-vertical-separator"
|
|
105
|
+
}, null), _createVNode("div", {
|
|
106
|
+
"class": "tiptap-text-color-actions"
|
|
107
|
+
}, [_createVNode(Button, {
|
|
108
|
+
"type": "button",
|
|
109
|
+
"data-style": "ghost",
|
|
110
|
+
"onClick": () => {
|
|
111
|
+
handleRemoveColor();
|
|
112
|
+
isOpen.value = false;
|
|
113
|
+
},
|
|
114
|
+
"tooltip": "\u79FB\u9664\u6587\u5B57\u989C\u8272",
|
|
115
|
+
"class": "tiptap-text-color-remove-button"
|
|
116
|
+
}, {
|
|
117
|
+
default: () => [_createVNode(BanIcon, {
|
|
118
|
+
"class": "tiptap-button-icon"
|
|
119
|
+
}, null)]
|
|
120
|
+
})])])
|
|
121
|
+
});
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
export {
|
|
126
|
+
TextColorPopover
|
|
127
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { Editor } from '@tiptap/vue-3';
|
|
2
|
+
export declare const TEXT_COLORS: ({
|
|
3
|
+
label: string;
|
|
4
|
+
value: string;
|
|
5
|
+
isDefault: boolean;
|
|
6
|
+
} | {
|
|
7
|
+
label: string;
|
|
8
|
+
value: string;
|
|
9
|
+
isDefault?: undefined;
|
|
10
|
+
})[];
|
|
11
|
+
export type TextColor = (typeof TEXT_COLORS)[number];
|
|
12
|
+
export declare function canSetTextColor(editor: Editor | null): boolean;
|
|
13
|
+
export declare function isTextColorActive(editor: Editor | null, color?: string): boolean;
|
|
14
|
+
export declare function removeTextColor(editor: Editor | null): boolean;
|
|
15
|
+
export declare function useTextColor(config: {
|
|
16
|
+
editor: any;
|
|
17
|
+
textColor?: string;
|
|
18
|
+
label?: string;
|
|
19
|
+
hideWhenUnavailable?: boolean;
|
|
20
|
+
onApplied?: (params: {
|
|
21
|
+
color: string;
|
|
22
|
+
label: string;
|
|
23
|
+
}) => void;
|
|
24
|
+
}): {
|
|
25
|
+
isVisible: import("vue").Ref<boolean, boolean>;
|
|
26
|
+
isActive: import("vue").Ref<boolean, boolean>;
|
|
27
|
+
canColor: import("vue").Ref<boolean, boolean>;
|
|
28
|
+
currentColor: import("vue").Ref<string, string>;
|
|
29
|
+
handleSetColor: (color: string, colorLabel: string) => void;
|
|
30
|
+
handleRemoveColor: () => void;
|
|
31
|
+
label: string;
|
|
32
|
+
Icon: import("vue").Raw<import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
33
|
+
className: {
|
|
34
|
+
type: StringConstructor;
|
|
35
|
+
default: string;
|
|
36
|
+
};
|
|
37
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
38
|
+
className: {
|
|
39
|
+
type: StringConstructor;
|
|
40
|
+
default: string;
|
|
41
|
+
};
|
|
42
|
+
}>> & Readonly<{}>, {
|
|
43
|
+
className: string;
|
|
44
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>>;
|
|
45
|
+
};
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { ref, watch, onBeforeUnmount, markRaw } from "vue";
|
|
2
|
+
import { isMarkInSchema, isNodeTypeSelected } from "../utils/tiptap-utils";
|
|
3
|
+
import { TypeIcon } from "../icons";
|
|
4
|
+
const TEXT_COLORS = [
|
|
5
|
+
{
|
|
6
|
+
label: "\u9ED8\u8BA4\u989C\u8272",
|
|
7
|
+
value: "var(--tt-text-default)",
|
|
8
|
+
isDefault: true
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
label: "\u7EA2\u8272",
|
|
12
|
+
value: "var(--tt-color-text-red)"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
label: "\u9ED8\u8BA4\u989C\u8272",
|
|
16
|
+
value: "var(--tt-text-default)"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
label: "\u7070\u8272",
|
|
20
|
+
value: "var(--tt-color-text-gray)"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
label: "\u68D5\u8272",
|
|
24
|
+
value: "var(--tt-color-text-brown)"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
label: "\u6A59\u8272",
|
|
28
|
+
value: "var(--tt-color-text-orange)"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
label: "\u9EC4\u8272",
|
|
32
|
+
value: "var(--tt-color-text-yellow)"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
label: "\u7EFF\u8272",
|
|
36
|
+
value: "var(--tt-color-text-green)"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
label: "\u84DD\u8272",
|
|
40
|
+
value: "var(--tt-color-text-blue)"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
label: "\u7D2B\u8272",
|
|
44
|
+
value: "var(--tt-color-text-purple)"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
label: "\u7C89\u8272",
|
|
48
|
+
value: "var(--tt-color-text-pink)"
|
|
49
|
+
}
|
|
50
|
+
];
|
|
51
|
+
function canSetTextColor(editor) {
|
|
52
|
+
if (!editor || !editor.isEditable)
|
|
53
|
+
return false;
|
|
54
|
+
if (isNodeTypeSelected(editor, ["image"]))
|
|
55
|
+
return false;
|
|
56
|
+
return editor.can().setMark("textStyle");
|
|
57
|
+
}
|
|
58
|
+
function isTextColorActive(editor, color) {
|
|
59
|
+
if (!editor || !editor.isEditable)
|
|
60
|
+
return false;
|
|
61
|
+
if (color) {
|
|
62
|
+
return editor.isActive("textStyle", { color });
|
|
63
|
+
}
|
|
64
|
+
return editor.isActive("textStyle");
|
|
65
|
+
}
|
|
66
|
+
function removeTextColor(editor) {
|
|
67
|
+
if (!editor || !editor.isEditable)
|
|
68
|
+
return false;
|
|
69
|
+
return editor.chain().focus().unsetColor().run();
|
|
70
|
+
}
|
|
71
|
+
function useTextColor(config) {
|
|
72
|
+
const { textColor, label, hideWhenUnavailable = false, onApplied } = config;
|
|
73
|
+
const isVisible = ref(true);
|
|
74
|
+
const isActive = ref(false);
|
|
75
|
+
const canColor = ref(false);
|
|
76
|
+
const currentColor = ref("");
|
|
77
|
+
const getEditor = () => {
|
|
78
|
+
const editor = config.editor;
|
|
79
|
+
return editor && "value" in editor ? editor.value : editor;
|
|
80
|
+
};
|
|
81
|
+
const updateState = () => {
|
|
82
|
+
const editor = getEditor();
|
|
83
|
+
if (!editor || !editor.isEditable) {
|
|
84
|
+
isVisible.value = false;
|
|
85
|
+
isActive.value = false;
|
|
86
|
+
canColor.value = false;
|
|
87
|
+
currentColor.value = "";
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
isActive.value = isTextColorActive(editor, textColor);
|
|
91
|
+
canColor.value = canSetTextColor(editor);
|
|
92
|
+
if (!isMarkInSchema("textStyle", editor)) {
|
|
93
|
+
isVisible.value = false;
|
|
94
|
+
} else if (hideWhenUnavailable) {
|
|
95
|
+
isVisible.value = canColor.value;
|
|
96
|
+
} else {
|
|
97
|
+
isVisible.value = true;
|
|
98
|
+
}
|
|
99
|
+
const attrs = editor.getAttributes("textStyle");
|
|
100
|
+
currentColor.value = (attrs == null ? void 0 : attrs.color) || "";
|
|
101
|
+
};
|
|
102
|
+
watch(
|
|
103
|
+
() => getEditor(),
|
|
104
|
+
(editor) => {
|
|
105
|
+
if (!editor)
|
|
106
|
+
return;
|
|
107
|
+
updateState();
|
|
108
|
+
editor.on("selectionUpdate", updateState);
|
|
109
|
+
editor.on("transaction", updateState);
|
|
110
|
+
onBeforeUnmount(() => {
|
|
111
|
+
editor.off("selectionUpdate", updateState);
|
|
112
|
+
editor.off("transaction", updateState);
|
|
113
|
+
});
|
|
114
|
+
},
|
|
115
|
+
{ immediate: true }
|
|
116
|
+
);
|
|
117
|
+
const handleSetColor = (color, colorLabel) => {
|
|
118
|
+
const editor = getEditor();
|
|
119
|
+
if (!editor || !canColor.value)
|
|
120
|
+
return;
|
|
121
|
+
setTimeout(() => {
|
|
122
|
+
const success = editor.chain().focus().setColor(color).run();
|
|
123
|
+
if (success) {
|
|
124
|
+
onApplied == null ? void 0 : onApplied({ color, label: colorLabel });
|
|
125
|
+
}
|
|
126
|
+
}, 0);
|
|
127
|
+
};
|
|
128
|
+
const handleRemoveColor = () => {
|
|
129
|
+
const editor = getEditor();
|
|
130
|
+
const success = removeTextColor(editor);
|
|
131
|
+
if (success) {
|
|
132
|
+
onApplied == null ? void 0 : onApplied({ color: "", label: "\u79FB\u9664\u6587\u5B57\u989C\u8272" });
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
return {
|
|
136
|
+
isVisible,
|
|
137
|
+
isActive,
|
|
138
|
+
canColor,
|
|
139
|
+
currentColor,
|
|
140
|
+
handleSetColor,
|
|
141
|
+
handleRemoveColor,
|
|
142
|
+
label: label || "\u6587\u5B57\u989C\u8272",
|
|
143
|
+
Icon: markRaw(TypeIcon)
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
export {
|
|
147
|
+
TEXT_COLORS,
|
|
148
|
+
canSetTextColor,
|
|
149
|
+
isTextColorActive,
|
|
150
|
+
removeTextColor,
|
|
151
|
+
useTextColor
|
|
152
|
+
};
|