@jx-health/rich-editor 0.0.6 → 0.0.8
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/dist/index.d.ts +56 -36
- package/dist/index.js +130 -51
- package/dist/style.css +3 -3
- package/package.json +29 -28
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HTMLAttributes, Plugin } from "vue";
|
|
1
|
+
import { HTMLAttributes, Plugin, Ref } from "vue";
|
|
2
2
|
import { AnyExtension, Editor, Editor as Editor$1, Editor as EditorInstance, Extension, JSONContent, JSONContent as JSONContent$1, Node, Range } from "@tiptap/core";
|
|
3
3
|
import { Editor as Editor$2, Node as Node$1, useEditor } from "@tiptap/vue-3";
|
|
4
4
|
import { PluginKey } from "@tiptap/pm/state";
|
|
@@ -154,7 +154,7 @@ type RichEditorOnChange = {
|
|
|
154
154
|
/**
|
|
155
155
|
* Represents the keys for different extensions.
|
|
156
156
|
*/
|
|
157
|
-
type ExtensionNameKeys =
|
|
157
|
+
type ExtensionNameKeys = "bold" | "italic" | "underline" | "strike" | "color" | "highlight" | "heading" | "textAlign" | "bulletList" | "orderedList" | "taskList" | "indent" | "link" | "image" | "video" | "table" | "blockquote" | "horizontalRule" | "code" | "codeBlock" | "clear" | "history" | "fullscreen";
|
|
158
158
|
/**
|
|
159
159
|
* Represents the general options for Tiptap extensions.
|
|
160
160
|
*/
|
|
@@ -231,7 +231,7 @@ interface RichEditorProps {
|
|
|
231
231
|
* - text: outputs plain text
|
|
232
232
|
* @default 'html'
|
|
233
233
|
*/
|
|
234
|
-
output?:
|
|
234
|
+
output?: "html" | "json" | "text";
|
|
235
235
|
/**
|
|
236
236
|
* Dark mode
|
|
237
237
|
* @default undefined - follows system
|
|
@@ -294,9 +294,9 @@ interface RichEditorProps {
|
|
|
294
294
|
contentClass?: string | string[] | Record<string, any>;
|
|
295
295
|
}
|
|
296
296
|
interface RichEditorEmits {
|
|
297
|
-
(event:
|
|
298
|
-
(event:
|
|
299
|
-
(event:
|
|
297
|
+
(event: "enter"): void;
|
|
298
|
+
(event: "change", value: RichEditorOnChange): void;
|
|
299
|
+
(event: "update:modelValue", value: string | JSONContent$1): void;
|
|
300
300
|
}
|
|
301
301
|
//#endregion
|
|
302
302
|
//#region src/components/RichEditor.vue.d.ts
|
|
@@ -317,10 +317,10 @@ declare const __VLS_component$1: import("vue").DefineComponent<RichEditorProps,
|
|
|
317
317
|
onChange?: ((value: RichEditorOnChange) => any) | undefined;
|
|
318
318
|
"onUpdate:modelValue"?: ((value: string | JSONContent$1) => any) | undefined;
|
|
319
319
|
}>, {
|
|
320
|
-
disabled: boolean;
|
|
321
320
|
modelValue: string | JSONContent$1;
|
|
322
321
|
output: "html" | "json" | "text";
|
|
323
322
|
dark: boolean;
|
|
323
|
+
disabled: boolean;
|
|
324
324
|
hideToolbar: boolean;
|
|
325
325
|
hideMenubar: boolean;
|
|
326
326
|
hideBubble: boolean;
|
|
@@ -350,10 +350,10 @@ interface Props {
|
|
|
350
350
|
loading?: boolean;
|
|
351
351
|
tooltipOptions?: TooltipContentProps;
|
|
352
352
|
color?: string;
|
|
353
|
-
action?: ButtonViewReturnComponentProps[
|
|
354
|
-
isActive?: ButtonViewReturnComponentProps[
|
|
353
|
+
action?: ButtonViewReturnComponentProps["action"];
|
|
354
|
+
isActive?: ButtonViewReturnComponentProps["isActive"];
|
|
355
355
|
editor?: Editor$1;
|
|
356
|
-
class?: HTMLAttributes[
|
|
356
|
+
class?: HTMLAttributes["class"];
|
|
357
357
|
}
|
|
358
358
|
declare var __VLS_30: {}, __VLS_32: {};
|
|
359
359
|
type __VLS_Slots = {} & {
|
|
@@ -362,10 +362,10 @@ type __VLS_Slots = {} & {
|
|
|
362
362
|
default?: (props: typeof __VLS_32) => any;
|
|
363
363
|
};
|
|
364
364
|
declare const __VLS_component: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
365
|
+
disabled: boolean;
|
|
365
366
|
icon: keyof typeof icons;
|
|
366
367
|
title: string;
|
|
367
368
|
tooltip: string;
|
|
368
|
-
disabled: boolean;
|
|
369
369
|
shortcutKeys: string[];
|
|
370
370
|
customClass: string;
|
|
371
371
|
loading: boolean;
|
|
@@ -403,7 +403,7 @@ declare const Code: import("@tiptap/core").Mark<CodeOptions, any>;
|
|
|
403
403
|
//#endregion
|
|
404
404
|
//#region src/extensions/CodeBlock/CodeBlock.d.ts
|
|
405
405
|
interface CodeBlockOptions extends GeneralOptions<CodeBlockOptions> {}
|
|
406
|
-
declare module
|
|
406
|
+
declare module "@tiptap/core" {
|
|
407
407
|
interface Commands<ReturnType> {
|
|
408
408
|
setCodeBlock: {
|
|
409
409
|
setCodeBlock: (options?: any) => ReturnType;
|
|
@@ -420,7 +420,7 @@ interface HeadingOptions extends HeadingOptions$1, GeneralOptions<HeadingOptions
|
|
|
420
420
|
declare const Heading: import("@tiptap/core").Node<HeadingOptions, any>;
|
|
421
421
|
//#endregion
|
|
422
422
|
//#region src/extensions/TextAlign/TextAlign.d.ts
|
|
423
|
-
type Alignments =
|
|
423
|
+
type Alignments = "left" | "center" | "right" | "justify";
|
|
424
424
|
/**
|
|
425
425
|
* Represents the interface for text align options, extending TiptapTextAlignOptions and GeneralOptions.
|
|
426
426
|
*/
|
|
@@ -447,7 +447,7 @@ interface FontSizeOptions extends GeneralOptions<FontSizeOptions> {
|
|
|
447
447
|
*/
|
|
448
448
|
fontSizes: string[];
|
|
449
449
|
}
|
|
450
|
-
declare module
|
|
450
|
+
declare module "@tiptap/core" {
|
|
451
451
|
interface Commands<ReturnType> {
|
|
452
452
|
fontSize: {
|
|
453
453
|
/**
|
|
@@ -513,14 +513,20 @@ declare const History: import("@tiptap/core").Extension<HistoryOptions, any>;
|
|
|
513
513
|
//#endregion
|
|
514
514
|
//#region src/extensions/Fullscreen/Fullscreen.d.ts
|
|
515
515
|
interface FullscreenOptions extends GeneralOptions<FullscreenOptions> {}
|
|
516
|
-
|
|
516
|
+
interface FullscreenStorage {
|
|
517
|
+
isFullscreen: Ref<boolean>;
|
|
518
|
+
}
|
|
519
|
+
declare module "@tiptap/core" {
|
|
517
520
|
interface Commands<ReturnType> {
|
|
518
521
|
fullscreen: {
|
|
519
522
|
setFullscreen: () => ReturnType;
|
|
520
523
|
};
|
|
521
524
|
}
|
|
525
|
+
interface Storage {
|
|
526
|
+
fullscreen: FullscreenStorage;
|
|
527
|
+
}
|
|
522
528
|
}
|
|
523
|
-
declare const Fullscreen: Extension<FullscreenOptions,
|
|
529
|
+
declare const Fullscreen: Extension<FullscreenOptions, FullscreenStorage>;
|
|
524
530
|
//#endregion
|
|
525
531
|
//#region src/extensions/TrailingNode/TrailingNode.d.ts
|
|
526
532
|
/**
|
|
@@ -535,15 +541,15 @@ interface TrailingNodeOptions {
|
|
|
535
541
|
//#endregion
|
|
536
542
|
//#region src/components/menus/BasicBubble.d.ts
|
|
537
543
|
/** Represents the size types for bubble images or videos */
|
|
538
|
-
type BubbleImageOrVideoSizeType =
|
|
544
|
+
type BubbleImageOrVideoSizeType = "size-small" | "size-medium" | "size-large";
|
|
539
545
|
/** Represents the various types for bubble images */
|
|
540
|
-
type BubbleImageType = `video-${BubbleImageOrVideoSizeType}` |
|
|
546
|
+
type BubbleImageType = `video-${BubbleImageOrVideoSizeType}` | "image" | "image-aspect-ratio" | "remove";
|
|
541
547
|
/** Represents the types for bubble videos */
|
|
542
|
-
type BubbleVideoType =
|
|
548
|
+
type BubbleVideoType = "video" | "remove";
|
|
543
549
|
/** Represents the overall types for bubbles */
|
|
544
|
-
type BubbleAllType = BubbleImageType | BubbleVideoType | ExtensionNameKeys |
|
|
550
|
+
type BubbleAllType = BubbleImageType | BubbleVideoType | ExtensionNameKeys | "divider" | (string & {});
|
|
545
551
|
/** Represents the key types for node types */
|
|
546
|
-
type NodeTypeKey =
|
|
552
|
+
type NodeTypeKey = "image" | "text" | "video";
|
|
547
553
|
/** Represents the menu of bubble types for each node type */
|
|
548
554
|
type BubbleTypeMenu = Partial<Record<NodeTypeKey, BubbleMenuItem[]>>;
|
|
549
555
|
/** Represents the menu of overall bubble types for each node type */
|
|
@@ -729,7 +735,7 @@ interface IndentOptions extends GeneralOptions<IndentOptions> {
|
|
|
729
735
|
minIndent: number;
|
|
730
736
|
maxIndent: number;
|
|
731
737
|
}
|
|
732
|
-
declare module
|
|
738
|
+
declare module "@tiptap/core" {
|
|
733
739
|
interface Commands<ReturnType> {
|
|
734
740
|
indent: {
|
|
735
741
|
/**
|
|
@@ -751,7 +757,7 @@ interface LineHeightOptions extends GeneralOptions<LineHeightOptions> {
|
|
|
751
757
|
lineHeights: string[];
|
|
752
758
|
defaultHeight: string;
|
|
753
759
|
}
|
|
754
|
-
declare module
|
|
760
|
+
declare module "@tiptap/core" {
|
|
755
761
|
interface Commands<ReturnType> {
|
|
756
762
|
lineHeight: {
|
|
757
763
|
setLineHeight: (lineHeight: string) => ReturnType;
|
|
@@ -778,7 +784,7 @@ interface SetImageAttrsOptions {
|
|
|
778
784
|
/** image FlipY */
|
|
779
785
|
flipY?: boolean;
|
|
780
786
|
}
|
|
781
|
-
declare module
|
|
787
|
+
declare module "@tiptap/core" {
|
|
782
788
|
interface Commands<ReturnType> {
|
|
783
789
|
imageResize: {
|
|
784
790
|
/**
|
|
@@ -830,7 +836,7 @@ type SetVideoOptions = {
|
|
|
830
836
|
/** The source URL of the video */src: string; /** The width of the video */
|
|
831
837
|
width: string | number;
|
|
832
838
|
};
|
|
833
|
-
declare module
|
|
839
|
+
declare module "@tiptap/core" {
|
|
834
840
|
interface Commands<ReturnType> {
|
|
835
841
|
video: {
|
|
836
842
|
/**
|
|
@@ -851,7 +857,7 @@ type TableCellBackgroundOptions = {
|
|
|
851
857
|
HTMLAttributes: Record<string, any>;
|
|
852
858
|
types?: any;
|
|
853
859
|
};
|
|
854
|
-
declare module
|
|
860
|
+
declare module "@tiptap/core" {
|
|
855
861
|
interface Commands<ReturnType> {
|
|
856
862
|
tableCellBackground: {
|
|
857
863
|
setTableCellBackground: (color: string) => ReturnType;
|
|
@@ -879,6 +885,20 @@ interface TableOptions extends GeneralOptions<TableOptions> {
|
|
|
879
885
|
}
|
|
880
886
|
declare const Table: import("@tiptap/core").Node<TableOptions, any>;
|
|
881
887
|
//#endregion
|
|
888
|
+
//#region src/extensions/StylePassthrough/StylePassthrough.d.ts
|
|
889
|
+
interface StylePassthroughGroup {
|
|
890
|
+
types: string[];
|
|
891
|
+
/** Declarations another extension owns, so a toolbar change isn't overridden by the parsed template. */
|
|
892
|
+
stripped?: string[];
|
|
893
|
+
}
|
|
894
|
+
interface StylePassthroughOptions {
|
|
895
|
+
styles: StylePassthroughGroup[];
|
|
896
|
+
widthTypes: string[];
|
|
897
|
+
spacingTypes: string[];
|
|
898
|
+
alignTypes: string[];
|
|
899
|
+
}
|
|
900
|
+
declare const StylePassthrough: Extension<StylePassthroughOptions, any>;
|
|
901
|
+
//#endregion
|
|
882
902
|
//#region src/extensions/AI/AI.d.ts
|
|
883
903
|
interface MenuItem {
|
|
884
904
|
label: string;
|
|
@@ -902,7 +922,7 @@ declare const AI: Node<AIOptions, any>;
|
|
|
902
922
|
* Represents the interface for font size options, extending GeneralOptions.
|
|
903
923
|
*/
|
|
904
924
|
interface FormatPainterOptions extends GeneralOptions<FormatPainterOptions> {}
|
|
905
|
-
declare module
|
|
925
|
+
declare module "@tiptap/core" {
|
|
906
926
|
interface Commands<ReturnType> {
|
|
907
927
|
painter: {
|
|
908
928
|
setPainter: (marks: Mark[]) => ReturnType;
|
|
@@ -929,7 +949,7 @@ interface ImportWordOptions extends GeneralOptions<ImportWordOptions> {
|
|
|
929
949
|
*/
|
|
930
950
|
limit: number;
|
|
931
951
|
}
|
|
932
|
-
declare module
|
|
952
|
+
declare module "@tiptap/core" {
|
|
933
953
|
interface Commands<ReturnType> {
|
|
934
954
|
importWord: {
|
|
935
955
|
/**
|
|
@@ -949,7 +969,7 @@ declare enum ColumnLayout {
|
|
|
949
969
|
ThreeColumn = "three-column",
|
|
950
970
|
FourColumn = "four-column"
|
|
951
971
|
}
|
|
952
|
-
declare module
|
|
972
|
+
declare module "@tiptap/core" {
|
|
953
973
|
interface Commands<ReturnType> {
|
|
954
974
|
columns: {
|
|
955
975
|
setColumns: () => ReturnType;
|
|
@@ -971,7 +991,7 @@ interface ImageUploadOptions {
|
|
|
971
991
|
acceptMimes: string[];
|
|
972
992
|
maxSize: number;
|
|
973
993
|
}
|
|
974
|
-
declare module
|
|
994
|
+
declare module "@tiptap/core" {
|
|
975
995
|
interface Commands<ReturnType> {
|
|
976
996
|
imageUpload: {
|
|
977
997
|
setImageUpload: () => ReturnType;
|
|
@@ -984,7 +1004,7 @@ declare const ImageUpload: Node$1<ImageUploadOptions, any>;
|
|
|
984
1004
|
interface VideoOptions$1 {
|
|
985
1005
|
upload?: (files: File[]) => void;
|
|
986
1006
|
}
|
|
987
|
-
declare module
|
|
1007
|
+
declare module "@tiptap/core" {
|
|
988
1008
|
interface Commands<ReturnType> {
|
|
989
1009
|
videoUpload: {
|
|
990
1010
|
setVideoUpload: () => ReturnType;
|
|
@@ -999,7 +1019,7 @@ interface FontFamilyOptions extends FontFamilyOptions$1, GeneralOptions<FontFami
|
|
|
999
1019
|
[key: string]: string;
|
|
1000
1020
|
};
|
|
1001
1021
|
}
|
|
1002
|
-
declare module
|
|
1022
|
+
declare module "@tiptap/core" {
|
|
1003
1023
|
interface Commands<ReturnType> {
|
|
1004
1024
|
fontFamily: {
|
|
1005
1025
|
/**
|
|
@@ -1018,7 +1038,7 @@ declare module '@tiptap/core' {
|
|
|
1018
1038
|
declare const FontFamily: import("@tiptap/core").Extension<FontFamilyOptions, any>;
|
|
1019
1039
|
//#endregion
|
|
1020
1040
|
//#region src/extensions/Preview/Preview.d.ts
|
|
1021
|
-
declare module
|
|
1041
|
+
declare module "@tiptap/core" {
|
|
1022
1042
|
interface Commands<ReturnType> {
|
|
1023
1043
|
preview: {
|
|
1024
1044
|
togglePreview: () => ReturnType;
|
|
@@ -1029,7 +1049,7 @@ interface PreviewOptions extends GeneralOptions<PreviewOptions> {}
|
|
|
1029
1049
|
declare const Preview: Extension<PreviewOptions, any>;
|
|
1030
1050
|
//#endregion
|
|
1031
1051
|
//#region src/extensions/FindAndReplace/FindAndReplace.d.ts
|
|
1032
|
-
declare module
|
|
1052
|
+
declare module "@tiptap/core" {
|
|
1033
1053
|
interface Commands<ReturnType> {
|
|
1034
1054
|
search: {
|
|
1035
1055
|
/**
|
|
@@ -1094,7 +1114,7 @@ interface IframeOptions extends GeneralOptions<IframeOptions> {
|
|
|
1094
1114
|
[key: string]: any;
|
|
1095
1115
|
};
|
|
1096
1116
|
}
|
|
1097
|
-
declare module
|
|
1117
|
+
declare module "@tiptap/core" {
|
|
1098
1118
|
interface Commands<ReturnType> {
|
|
1099
1119
|
iframe: {
|
|
1100
1120
|
/**
|
|
@@ -1112,4 +1132,4 @@ declare const Iframe: Node<IframeOptions, any>;
|
|
|
1112
1132
|
//#region src/index.d.ts
|
|
1113
1133
|
declare const RichEditorPlugin: Plugin;
|
|
1114
1134
|
//#endregion
|
|
1115
|
-
export { AI, _default as ActionButton, BaseKit, type BaseKitOptions, Blockquote, type BlockquoteOptions, Bold, type BoldOptions, BulletList, type BulletListOptions, type ButtonView, type ButtonViewParams, type ButtonViewReturn, type ButtonViewReturnComponentProps, type ButtonViewReturnComponentSlots, Clear, type ClearOptions, Code, CodeBlock, type CodeBlockOptions, type CodeOptions, Color, type ColorOptions, Columns, type ColumnsOptions, type Editor, type EditorInstance, type ExtensionNameKeys, FindAndReplace, FontFamily, type FontFamilyOptions, FontSize, type FontSizeOptions, FormatPainter, type FormatPainterOptions, Fullscreen, type FullscreenOptions, type GeneralOptions, Heading, type HeadingOptions, Highlight, type HighlightOptions, History, type HistoryOptions, HorizontalRule, type HorizontalRuleOptions, Iframe, type IframeOptions, Image, ImageUpload, type ImageUploadOptions, ImportWord, type ImportWordOptions, Indent, type IndentOptions, Italic, type ItalicOptions, type JSONContent, LineHeight, type LineHeightOptions, Link, type LinkOptions, MoreMark, type MoreMarkOptions, OrderedList, type OrderedListOptions, Preview, type PreviewOptions, Printer, type PrinterOptions, _default$1 as RichEditor, type RichEditorEmits, type RichEditorOnChange, RichEditorPlugin, RichEditorPlugin as default, type RichEditorProps, type SetImageAttrsOptions, SlashCommand, Strike, type StrikeOptions, SubAndSuperScript, type SubAndSuperScriptOptions, Table, type TableOptions, TaskList, type TaskListOptions, TextAlign, type TextAlignOptions, Underline, type UnderlineOptions, Video, type VideoOptions, VideoUpload, useEditor };
|
|
1135
|
+
export { AI, _default as ActionButton, BaseKit, type BaseKitOptions, Blockquote, type BlockquoteOptions, Bold, type BoldOptions, BulletList, type BulletListOptions, type ButtonView, type ButtonViewParams, type ButtonViewReturn, type ButtonViewReturnComponentProps, type ButtonViewReturnComponentSlots, Clear, type ClearOptions, Code, CodeBlock, type CodeBlockOptions, type CodeOptions, Color, type ColorOptions, Columns, type ColumnsOptions, type Editor, type EditorInstance, type ExtensionNameKeys, FindAndReplace, FontFamily, type FontFamilyOptions, FontSize, type FontSizeOptions, FormatPainter, type FormatPainterOptions, Fullscreen, type FullscreenOptions, type GeneralOptions, Heading, type HeadingOptions, Highlight, type HighlightOptions, History, type HistoryOptions, HorizontalRule, type HorizontalRuleOptions, Iframe, type IframeOptions, Image, ImageUpload, type ImageUploadOptions, ImportWord, type ImportWordOptions, Indent, type IndentOptions, Italic, type ItalicOptions, type JSONContent, LineHeight, type LineHeightOptions, Link, type LinkOptions, MoreMark, type MoreMarkOptions, OrderedList, type OrderedListOptions, Preview, type PreviewOptions, Printer, type PrinterOptions, _default$1 as RichEditor, type RichEditorEmits, type RichEditorOnChange, RichEditorPlugin, RichEditorPlugin as default, type RichEditorProps, type SetImageAttrsOptions, SlashCommand, Strike, type StrikeOptions, StylePassthrough, type StylePassthroughGroup, type StylePassthroughOptions, SubAndSuperScript, type SubAndSuperScriptOptions, Table, type TableOptions, TaskList, type TaskListOptions, TextAlign, type TextAlignOptions, Underline, type UnderlineOptions, Video, type VideoOptions, VideoUpload, useEditor };
|
package/dist/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, guardReactiveProps, h, inject, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onBeforeUnmount, onMounted, onUnmounted, openBlock, provide, reactive, ref, renderList, renderSlot, resolveDynamicComponent, shallowRef, toDisplayString, unref, useAttrs, vModelText, vShow, watch, watchEffect, withCtx, withDirectives, withKeys, withModifiers } from "vue";
|
|
2
|
-
import { Editor, Extension, Node, getMarkRange, isList, mergeAttributes, textblockTypeInputRule } from "@tiptap/core";
|
|
3
|
-
import { Editor as Editor$1, EditorContent, Node as Node$1, NodeViewWrapper, VueNodeViewRenderer, VueRenderer, getMarkAttributes, isActive, nodeViewProps, useEditor } from "@tiptap/vue-3";
|
|
4
|
-
import differenceBy from "lodash/differenceBy.js";
|
|
5
|
-
import isEqual from "lodash/isEqual.js";
|
|
6
|
-
import throttle from "lodash/throttle.js";
|
|
7
|
-
import truncate from "lodash/truncate.js";
|
|
2
|
+
import { Editor, Extension, Node, getMarkRange, isActive, isList, mergeAttributes, textblockTypeInputRule } from "@tiptap/core";
|
|
3
|
+
import { Editor as Editor$1, EditorContent, Node as Node$1, NodeViewWrapper, VueNodeViewRenderer, VueRenderer, getMarkAttributes, isActive as isActive$1, nodeViewProps, useEditor } from "@tiptap/vue-3";
|
|
4
|
+
import differenceBy from "lodash-es/differenceBy.js";
|
|
5
|
+
import isEqual from "lodash-es/isEqual.js";
|
|
6
|
+
import throttle from "lodash-es/throttle.js";
|
|
7
|
+
import truncate from "lodash-es/truncate.js";
|
|
8
8
|
import { createGlobalState, reactiveOmit, useDark, useFileDialog, useFocus as useFocus$1, useLocalStorage, useVModel } from "@vueuse/core";
|
|
9
9
|
import hotkeys from "hotkeys-js";
|
|
10
|
-
import debounce from "lodash/debounce.js";
|
|
11
|
-
import { AllSelection, Plugin as Plugin$1, PluginKey, Selection, SelectionRange, TextSelection } from "@tiptap/pm/state";
|
|
10
|
+
import debounce from "lodash-es/debounce.js";
|
|
11
|
+
import { AllSelection, NodeSelection, Plugin as Plugin$1, PluginKey, Selection, SelectionRange, TextSelection } from "@tiptap/pm/state";
|
|
12
12
|
import { clsx } from "clsx";
|
|
13
13
|
import { twMerge } from "tailwind-merge";
|
|
14
14
|
import { CheckboxIndicator, CheckboxRoot, DialogClose, DialogContent, DialogOverlay, DialogPortal, DialogRoot, DialogTitle, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuItem, DropdownMenuItemIndicator, DropdownMenuPortal, DropdownMenuPortal as DropdownMenuPortal$1, DropdownMenuRoot, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Label, MenubarCheckboxItem, MenubarContent, MenubarItem, MenubarItemIndicator, MenubarMenu, MenubarPortal, MenubarRoot, MenubarSeparator, MenubarTrigger, PopoverContent, PopoverPortal, PopoverRoot, PopoverTrigger, Primitive, ScrollAreaCorner, ScrollAreaRoot, ScrollAreaScrollbar, ScrollAreaThumb, ScrollAreaViewport, SelectContent, SelectIcon, SelectItem, SelectItemIndicator, SelectItemText, SelectPortal, SelectRoot, SelectScrollDownButton, SelectScrollUpButton, SelectTrigger, SelectValue, SelectViewport, Separator, SplitterGroup, SplitterPanel as ResizablePanel, SplitterResizeHandle, TabsContent, TabsList, TabsRoot, TabsTrigger, Toggle, ToggleGroupItem, ToggleGroupRoot, TooltipContent, TooltipPortal, TooltipProvider, TooltipRoot, TooltipTrigger, useForwardProps, useForwardPropsEmits } from "reka-ui";
|
|
@@ -806,7 +806,6 @@ const useTiptapStore = createGlobalState(() => {
|
|
|
806
806
|
const state = reactive({
|
|
807
807
|
extensions: _state.extensions ?? [],
|
|
808
808
|
defaultLang: "en",
|
|
809
|
-
isFullscreen: false,
|
|
810
809
|
color: void 0,
|
|
811
810
|
highlight: void 0,
|
|
812
811
|
AIMenu: false,
|
|
@@ -815,10 +814,6 @@ const useTiptapStore = createGlobalState(() => {
|
|
|
815
814
|
findAndReplace: false,
|
|
816
815
|
printer: false
|
|
817
816
|
});
|
|
818
|
-
const isFullscreen = computed(() => state.isFullscreen);
|
|
819
|
-
function toggleFullscreen() {
|
|
820
|
-
state.isFullscreen = !state.isFullscreen;
|
|
821
|
-
}
|
|
822
817
|
function togglePreview() {
|
|
823
818
|
state.showPreview = !state.showPreview;
|
|
824
819
|
}
|
|
@@ -837,8 +832,6 @@ const useTiptapStore = createGlobalState(() => {
|
|
|
837
832
|
});
|
|
838
833
|
return {
|
|
839
834
|
state,
|
|
840
|
-
isFullscreen,
|
|
841
|
-
toggleFullscreen,
|
|
842
835
|
togglePreview,
|
|
843
836
|
toggleSpellCheck,
|
|
844
837
|
toggleFindAndReplace,
|
|
@@ -3160,11 +3153,11 @@ const buttonVariants = cva("inline-flex items-center justify-center gap-2 whites
|
|
|
3160
3153
|
link: "text-primary underline-offset-4 hover:underline"
|
|
3161
3154
|
},
|
|
3162
3155
|
size: {
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3156
|
+
default: "h-9 px-4 py-2",
|
|
3157
|
+
xs: "h-7 rounded px-2",
|
|
3158
|
+
sm: "h-8 rounded-md px-3 text-xs",
|
|
3159
|
+
lg: "h-10 rounded-md px-8",
|
|
3160
|
+
icon: "h-9 w-9",
|
|
3168
3161
|
"icon-sm": "size-8",
|
|
3169
3162
|
"icon-lg": "size-10"
|
|
3170
3163
|
}
|
|
@@ -4083,6 +4076,15 @@ function _sfc_render$85(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4083
4076
|
}
|
|
4084
4077
|
var LinkBubbleMenu_default = /*#__PURE__*/ export_helper_default(_sfc_main$85, [["render", _sfc_render$85], ["__file", "/home/hosanna/work/font_workspace/packages/rich-editor/src/components/menus/LinkBubbleMenu.vue"]]);
|
|
4085
4078
|
//#endregion
|
|
4079
|
+
//#region src/utils/bubbleMenuScope.ts
|
|
4080
|
+
const isContainerMenuVisible = (editor, container) => {
|
|
4081
|
+
const { state } = editor;
|
|
4082
|
+
const { selection } = state;
|
|
4083
|
+
if (selection instanceof TextSelection && !selection.empty) return false;
|
|
4084
|
+
if (selection instanceof NodeSelection && selection.node.type.name !== container) return false;
|
|
4085
|
+
return isActive(state, container);
|
|
4086
|
+
};
|
|
4087
|
+
//#endregion
|
|
4086
4088
|
//#region src/components/ui/popover/Popover.vue
|
|
4087
4089
|
const _sfc_main$84 = /*@__PURE__*/ defineComponent({
|
|
4088
4090
|
__name: "Popover",
|
|
@@ -4697,9 +4699,7 @@ const _sfc_main$79 = /*@__PURE__*/ defineComponent({
|
|
|
4697
4699
|
setup(__props, { expose: __expose }) {
|
|
4698
4700
|
__expose();
|
|
4699
4701
|
const props = __props;
|
|
4700
|
-
const shouldShow = ({ editor }) =>
|
|
4701
|
-
return isActive(editor.view.state, "table");
|
|
4702
|
-
};
|
|
4702
|
+
const shouldShow = ({ editor }) => isContainerMenuVisible(editor, "table");
|
|
4703
4703
|
const { t } = useLocale();
|
|
4704
4704
|
function onAddColumnBefore() {
|
|
4705
4705
|
props.editor.chain().focus().addColumnBefore().run();
|
|
@@ -6572,9 +6572,7 @@ const _sfc_main$68 = /*@__PURE__*/ defineComponent({
|
|
|
6572
6572
|
__expose();
|
|
6573
6573
|
const props = __props;
|
|
6574
6574
|
const { t } = useLocale();
|
|
6575
|
-
const shouldShow = ({ editor }) =>
|
|
6576
|
-
return isActive(editor.view.state, "columns");
|
|
6577
|
-
};
|
|
6575
|
+
const shouldShow = ({ editor }) => isContainerMenuVisible(editor, "columns");
|
|
6578
6576
|
const getReferenceClientRect = () => {
|
|
6579
6577
|
return getRenderContainer(props.editor, "columns")?.getBoundingClientRect() || new DOMRect(-1e3, -1e3, 0, 0);
|
|
6580
6578
|
};
|
|
@@ -6867,7 +6865,7 @@ const _sfc_main$64 = /*@__PURE__*/ defineComponent({
|
|
|
6867
6865
|
const percent = Math.max(0, Math.min(100, parseInt(imagePercent.value)));
|
|
6868
6866
|
props.editor.chain().focus(void 0, { scrollIntoView: false }).updateImage({ width: `${percent}%` }).run();
|
|
6869
6867
|
}
|
|
6870
|
-
const shouldShow = ({ editor }) => isActive(editor.view.state, "image");
|
|
6868
|
+
const shouldShow = ({ editor }) => isActive$1(editor.view.state, "image");
|
|
6871
6869
|
const getReferenceClientRect = computed(() => {
|
|
6872
6870
|
return getRenderContainer(props.editor, "node-image")?.getBoundingClientRect() || new DOMRect(-1e3, -1e3, 0, 0);
|
|
6873
6871
|
});
|
|
@@ -12806,7 +12804,7 @@ const _sfc_main$31 = /*@__PURE__*/ defineComponent({
|
|
|
12806
12804
|
const props = __props;
|
|
12807
12805
|
const emit = __emit;
|
|
12808
12806
|
const attrs = useAttrs();
|
|
12809
|
-
const { state
|
|
12807
|
+
const { state } = useTiptapStore();
|
|
12810
12808
|
const { t } = useLocale();
|
|
12811
12809
|
const isDark = useDark();
|
|
12812
12810
|
const contentRef = ref(null);
|
|
@@ -12836,6 +12834,7 @@ const _sfc_main$31 = /*@__PURE__*/ defineComponent({
|
|
|
12836
12834
|
}));
|
|
12837
12835
|
const editor = new Editor$1(unref(editorConfig));
|
|
12838
12836
|
const { isFocused } = useEditorFocus({ editor });
|
|
12837
|
+
const isFullscreen = computed(() => editor.storage.fullscreen?.isFullscreen.value ?? false);
|
|
12839
12838
|
watch(() => props.dark, (val) => {
|
|
12840
12839
|
if (val !== void 0) isDark.value = val;
|
|
12841
12840
|
});
|
|
@@ -12886,7 +12885,6 @@ const _sfc_main$31 = /*@__PURE__*/ defineComponent({
|
|
|
12886
12885
|
emit,
|
|
12887
12886
|
attrs,
|
|
12888
12887
|
state,
|
|
12889
|
-
isFullscreen,
|
|
12890
12888
|
t,
|
|
12891
12889
|
isDark,
|
|
12892
12890
|
contentRef,
|
|
@@ -12894,6 +12892,7 @@ const _sfc_main$31 = /*@__PURE__*/ defineComponent({
|
|
|
12894
12892
|
editorConfig,
|
|
12895
12893
|
editor,
|
|
12896
12894
|
isFocused,
|
|
12895
|
+
isFullscreen,
|
|
12897
12896
|
contentDynamicStyles,
|
|
12898
12897
|
getOutput,
|
|
12899
12898
|
get EditorContent() {
|
|
@@ -12946,7 +12945,7 @@ function _sfc_render$31(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
12946
12945
|
key: 1,
|
|
12947
12946
|
editor: $setup.editor
|
|
12948
12947
|
}, null, 8, ["editor"])) : createCommentVNode("v-if", true),
|
|
12949
|
-
createElementVNode("div", { class: normalizeClass(["relative flex flex-col overflow-hidden", { "fullscreen !fixed bg-background inset-0 z-[
|
|
12948
|
+
createElementVNode("div", { class: normalizeClass(["relative flex flex-col overflow-hidden", { "fullscreen !fixed bg-background inset-0 z-[3000] w-full h-full m-0 rounded-[0.5rem]": $setup.isFullscreen }]) }, [
|
|
12950
12949
|
!$props.hideMenubar ? (openBlock(), createBlock($setup["Menubars"], {
|
|
12951
12950
|
key: 0,
|
|
12952
12951
|
editor: $setup.editor,
|
|
@@ -19404,39 +19403,39 @@ const History = History$1.extend({ addOptions() {
|
|
|
19404
19403
|
} });
|
|
19405
19404
|
//#endregion
|
|
19406
19405
|
//#region src/extensions/Fullscreen/Fullscreen.ts
|
|
19407
|
-
const { isFullscreen, toggleFullscreen } = useTiptapStore();
|
|
19408
19406
|
const Fullscreen = Extension.create({
|
|
19409
19407
|
name: "fullscreen",
|
|
19410
19408
|
addOptions() {
|
|
19411
19409
|
return {
|
|
19412
19410
|
...this.parent?.(),
|
|
19413
|
-
button: ({ editor,
|
|
19414
|
-
|
|
19415
|
-
|
|
19416
|
-
|
|
19417
|
-
|
|
19418
|
-
|
|
19419
|
-
|
|
19420
|
-
|
|
19421
|
-
|
|
19411
|
+
button: ({ editor, t }) => {
|
|
19412
|
+
const isFullscreen = editor?.storage.fullscreen.isFullscreen.value ?? false;
|
|
19413
|
+
return {
|
|
19414
|
+
component: ActionButton_default,
|
|
19415
|
+
componentProps: {
|
|
19416
|
+
tooltip: isFullscreen ? t("editor.fullscreen.tooltip.exit") : t("editor.fullscreen.tooltip.fullscreen"),
|
|
19417
|
+
action: () => editor?.chain().setFullscreen().focus().run(),
|
|
19418
|
+
icon: isFullscreen ? "Minimize" : "Maximize",
|
|
19419
|
+
isActive: () => isFullscreen
|
|
19420
|
+
}
|
|
19421
|
+
};
|
|
19422
|
+
}
|
|
19422
19423
|
};
|
|
19423
19424
|
},
|
|
19425
|
+
addStorage() {
|
|
19426
|
+
return { isFullscreen: ref(false) };
|
|
19427
|
+
},
|
|
19424
19428
|
addCommands() {
|
|
19425
|
-
return { setFullscreen: () => () => {
|
|
19426
|
-
|
|
19429
|
+
return { setFullscreen: () => ({ editor }) => {
|
|
19430
|
+
const { isFullscreen } = editor.storage.fullscreen;
|
|
19431
|
+
isFullscreen.value = !isFullscreen.value;
|
|
19427
19432
|
return true;
|
|
19428
19433
|
} };
|
|
19429
19434
|
},
|
|
19430
19435
|
addKeyboardShortcuts() {
|
|
19431
19436
|
return {
|
|
19432
|
-
F11: () =>
|
|
19433
|
-
|
|
19434
|
-
return true;
|
|
19435
|
-
},
|
|
19436
|
-
"Mod-F11": () => {
|
|
19437
|
-
toggleFullscreen();
|
|
19438
|
-
return true;
|
|
19439
|
-
}
|
|
19437
|
+
F11: () => this.editor.commands.setFullscreen(),
|
|
19438
|
+
"Mod-F11": () => this.editor.commands.setFullscreen()
|
|
19440
19439
|
};
|
|
19441
19440
|
}
|
|
19442
19441
|
});
|
|
@@ -19446,6 +19445,85 @@ const Document$1 = Document.extend({ content() {
|
|
|
19446
19445
|
return !!this.editor?.options.extensions.find((e) => e.name === "columns") ? "(block|columns)+" : "block+";
|
|
19447
19446
|
} });
|
|
19448
19447
|
//#endregion
|
|
19448
|
+
//#region src/extensions/StylePassthrough/StylePassthrough.ts
|
|
19449
|
+
function stripDeclarations(style, stripped) {
|
|
19450
|
+
return style.split(";").map((declaration) => declaration.trim()).filter((declaration) => {
|
|
19451
|
+
const property = declaration.split(":")[0]?.trim().toLowerCase();
|
|
19452
|
+
return property && !stripped.includes(property);
|
|
19453
|
+
}).join("; ");
|
|
19454
|
+
}
|
|
19455
|
+
function passthroughAttribute(name) {
|
|
19456
|
+
return { [name]: {
|
|
19457
|
+
default: "",
|
|
19458
|
+
parseHTML: (element) => element.getAttribute(name) || "",
|
|
19459
|
+
renderHTML: (attributes) => attributes[name] ? { [name]: attributes[name] } : {}
|
|
19460
|
+
} };
|
|
19461
|
+
}
|
|
19462
|
+
const StylePassthrough = Extension.create({
|
|
19463
|
+
name: "stylePassthrough",
|
|
19464
|
+
addOptions() {
|
|
19465
|
+
return {
|
|
19466
|
+
styles: [
|
|
19467
|
+
{
|
|
19468
|
+
types: ["paragraph", "heading"],
|
|
19469
|
+
stripped: ["text-align", "line-height"]
|
|
19470
|
+
},
|
|
19471
|
+
{
|
|
19472
|
+
types: ["image"],
|
|
19473
|
+
stripped: ["text-align", "width"]
|
|
19474
|
+
},
|
|
19475
|
+
{
|
|
19476
|
+
types: ["tableCell"],
|
|
19477
|
+
stripped: ["background", "background-color"]
|
|
19478
|
+
},
|
|
19479
|
+
{ types: [
|
|
19480
|
+
"table",
|
|
19481
|
+
"tableRow",
|
|
19482
|
+
"tableHeader",
|
|
19483
|
+
"listItem",
|
|
19484
|
+
"bulletList",
|
|
19485
|
+
"orderedList",
|
|
19486
|
+
"blockquote"
|
|
19487
|
+
] }
|
|
19488
|
+
],
|
|
19489
|
+
widthTypes: [
|
|
19490
|
+
"table",
|
|
19491
|
+
"tableCell",
|
|
19492
|
+
"tableHeader"
|
|
19493
|
+
],
|
|
19494
|
+
spacingTypes: ["table"],
|
|
19495
|
+
alignTypes: ["tableRow"]
|
|
19496
|
+
};
|
|
19497
|
+
},
|
|
19498
|
+
addGlobalAttributes() {
|
|
19499
|
+
return [
|
|
19500
|
+
...this.options.styles.map((group) => ({
|
|
19501
|
+
types: group.types,
|
|
19502
|
+
attributes: { rawStyle: {
|
|
19503
|
+
default: "",
|
|
19504
|
+
parseHTML: (element) => stripDeclarations(element.getAttribute("style") ?? "", group.stripped ?? []),
|
|
19505
|
+
renderHTML: (attributes) => attributes.rawStyle ? { style: attributes.rawStyle } : {}
|
|
19506
|
+
} }
|
|
19507
|
+
})),
|
|
19508
|
+
{
|
|
19509
|
+
types: this.options.widthTypes,
|
|
19510
|
+
attributes: passthroughAttribute("width")
|
|
19511
|
+
},
|
|
19512
|
+
{
|
|
19513
|
+
types: this.options.spacingTypes,
|
|
19514
|
+
attributes: {
|
|
19515
|
+
...passthroughAttribute("cellpadding"),
|
|
19516
|
+
...passthroughAttribute("cellspacing")
|
|
19517
|
+
}
|
|
19518
|
+
},
|
|
19519
|
+
{
|
|
19520
|
+
types: this.options.alignTypes,
|
|
19521
|
+
attributes: passthroughAttribute("align")
|
|
19522
|
+
}
|
|
19523
|
+
];
|
|
19524
|
+
}
|
|
19525
|
+
});
|
|
19526
|
+
//#endregion
|
|
19449
19527
|
//#region src/extensions/TrailingNode/TrailingNode.ts
|
|
19450
19528
|
function nodeEqualsType({ types, node }) {
|
|
19451
19529
|
return Array.isArray(types) && types.includes(node.type) || node.type === types;
|
|
@@ -19861,6 +19939,7 @@ const BaseKit = Extension.create({
|
|
|
19861
19939
|
}));
|
|
19862
19940
|
if (this.options.characterCount !== false) extensions.push(CharacterCount.configure(this.options.characterCount));
|
|
19863
19941
|
if (this.options.paragraph !== false) extensions.push(Paragraph.configure(this.options.paragraph));
|
|
19942
|
+
extensions.push(StylePassthrough);
|
|
19864
19943
|
if (this.options.hardBreak !== false) extensions.push(HardBreak.configure(this.options.hardBreak));
|
|
19865
19944
|
if (this.options.listItem !== false) extensions.push(ListItem.configure(this.options.listItem));
|
|
19866
19945
|
if (this.options.textStyle !== false) extensions.push(TextStyle.configure(this.options.textStyle));
|
|
@@ -23509,4 +23588,4 @@ const RichEditorPlugin = { install(app) {
|
|
|
23509
23588
|
app.component("rich-editor", RichEditor_default);
|
|
23510
23589
|
} };
|
|
23511
23590
|
//#endregion
|
|
23512
|
-
export { AI, ActionButton_default as ActionButton, BaseKit, Blockquote, Bold, BulletList, Clear, Code, CodeBlock, Color, Columns, FindAndReplace, FontFamily, FontSize, FormatPainter, Fullscreen, Heading, Highlight, History, HorizontalRule, Iframe, Image, ImageUpload, ImportWord, Indent, Italic, LineHeight, Link, MoreMark, OrderedList, Preview, Printer, RichEditor_default as RichEditor, RichEditorPlugin, RichEditorPlugin as default, SlashCommand, Strike, SubAndSuperScript, Table, TaskList, TextAlign, Underline, Video, VideoUpload, useEditor };
|
|
23591
|
+
export { AI, ActionButton_default as ActionButton, BaseKit, Blockquote, Bold, BulletList, Clear, Code, CodeBlock, Color, Columns, FindAndReplace, FontFamily, FontSize, FormatPainter, Fullscreen, Heading, Highlight, History, HorizontalRule, Iframe, Image, ImageUpload, ImportWord, Indent, Italic, LineHeight, Link, MoreMark, OrderedList, Preview, Printer, RichEditor_default as RichEditor, RichEditorPlugin, RichEditorPlugin as default, SlashCommand, Strike, StylePassthrough, SubAndSuperScript, Table, TaskList, TextAlign, Underline, Video, VideoUpload, useEditor };
|
package/dist/style.css
CHANGED
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
@property --un-sepia{syntax:"*";inherits:false;}
|
|
41
41
|
@property --un-space-x-reverse{syntax:"*";inherits:false;initial-value:0;}
|
|
42
42
|
/* layer: theme */
|
|
43
|
-
:root, :host { --spacing: 0.25rem; --text-sm-fontSize: 0.875rem; --text-sm-lineHeight: 1.25rem; --font-sans: ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"; --font-mono: ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace; --default-font-family: var(--font-sans); --default-monoFont-family: var(--font-mono); --fontWeight-normal: 400; --colors-black: #000; --colors-white: #fff; --radius-DEFAULT: 0.25rem; --default-transition-timingFunction: cubic-bezier(0.4, 0, 0.2, 1); --default-transition-duration: 150ms; --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1); --container-2xl: 42rem; --leading-relaxed: 1.625; --fontWeight-bold: 700; --fontWeight-extrabold: 800; --radius-sm: 0.25rem; --radius-lg: 0.5rem; --radius-none: 0; --colors-gray-50: oklch(98.5% 0.002 247.839); --colors-neutral-100: oklch(97% 0 0); --colors-yellow-300: oklch(90.5% 0.182 98.111); --colors-red-400: oklch(70.4% 0.191 22.216); --colors-blue-500: oklch(62.3% 0.214 259.815); --colors-red-500: oklch(63.7% 0.237 25.331); --colors-neutral-900: oklch(20.5% 0 0); --colors-neutral-700: oklch(37.1% 0 0); --colors-neutral-400: oklch(70.8% 0 0); --colors-red-300: oklch(80.8% 0.114 19.571); --colors-orange-300: oklch(83.7% 0.128 66.29); --colors-lime-300: oklch(89.7% 0.196 126.665); --colors-teal-300: oklch(85.5% 0.138 181.071); --text-3xl-fontSize: 1.875rem; --text-3xl-lineHeight: 2.25rem; --text-2xl-fontSize: 1.5rem; --text-2xl-lineHeight: 2rem; --text-xl-fontSize: 1.25rem; --text-xl-lineHeight: 1.75rem; --text-lg-fontSize: 1.125rem; --text-lg-lineHeight: 1.75rem; --text-base-fontSize: 1rem; --text-base-lineHeight: 1.5rem; --colors-gray-900: oklch(21% 0.034 264.665); --colors-blue-400: oklch(70.7% 0.165 254.624); --colors-neutral-800: oklch(26.9% 0 0); --colors-neutral-300: oklch(87% 0 0); --
|
|
43
|
+
:root, :host { --spacing: 0.25rem; --text-sm-fontSize: 0.875rem; --text-sm-lineHeight: 1.25rem; --font-sans: ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"; --font-mono: ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace; --default-font-family: var(--font-sans); --default-monoFont-family: var(--font-mono); --fontWeight-normal: 400; --colors-black: #000; --colors-white: #fff; --radius-DEFAULT: 0.25rem; --default-transition-timingFunction: cubic-bezier(0.4, 0, 0.2, 1); --default-transition-duration: 150ms; --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1); --container-2xl: 42rem; --leading-relaxed: 1.625; --fontWeight-bold: 700; --fontWeight-extrabold: 800; --radius-sm: 0.25rem; --radius-lg: 0.5rem; --radius-none: 0; --colors-gray-50: oklch(98.5% 0.002 247.839); --colors-neutral-100: oklch(97% 0 0); --colors-yellow-300: oklch(90.5% 0.182 98.111); --colors-red-400: oklch(70.4% 0.191 22.216); --colors-blue-500: oklch(62.3% 0.214 259.815); --colors-red-500: oklch(63.7% 0.237 25.331); --colors-neutral-900: oklch(20.5% 0 0); --colors-neutral-700: oklch(37.1% 0 0); --colors-neutral-400: oklch(70.8% 0 0); --colors-red-300: oklch(80.8% 0.114 19.571); --colors-orange-300: oklch(83.7% 0.128 66.29); --colors-lime-300: oklch(89.7% 0.196 126.665); --colors-teal-300: oklch(85.5% 0.138 181.071); --text-3xl-fontSize: 1.875rem; --text-3xl-lineHeight: 2.25rem; --text-2xl-fontSize: 1.5rem; --text-2xl-lineHeight: 2rem; --text-xl-fontSize: 1.25rem; --text-xl-lineHeight: 1.75rem; --text-lg-fontSize: 1.125rem; --text-lg-lineHeight: 1.75rem; --text-base-fontSize: 1rem; --text-base-lineHeight: 1.5rem; --colors-gray-900: oklch(21% 0.034 264.665); --colors-blue-400: oklch(70.7% 0.165 254.624); --colors-neutral-800: oklch(26.9% 0 0); --colors-neutral-300: oklch(87% 0 0); --ease-out: cubic-bezier(0, 0, 0.2, 1); --colors-neutral-600: oklch(43.9% 0 0); --text-xs-fontSize: 0.75rem; --text-xs-lineHeight: 1rem; --colors-neutral-200: oklch(92.2% 0 0); --leading-none: 1; --container-sm: 24rem; --fontWeight-medium: 500; --radius-md: 0.375rem; --colors-zinc-500: oklch(55.2% 0.016 285.938); --colors-gray-200: oklch(92.8% 0.006 264.531); --container-lg: 32rem; --fontWeight-semibold: 600; --tracking-tight: -0.025em; --tracking-widest: 0.1em; --tracking-wider: 0.05em; --colors-neutral-500: oklch(55.6% 0 0); --colors-gray-800: oklch(27.8% 0.033 256.848); --colors-gray-100: oklch(96.7% 0.003 264.542); --ease-in: cubic-bezier(0.4, 0, 1, 1); --colors-zinc-600: oklch(44.2% 0.017 285.786); }
|
|
44
44
|
/* layer: base */
|
|
45
45
|
*, ::after, ::before, ::backdrop, ::file-selector-button { box-sizing: border-box; margin: 0; padding: 0; border: 0 solid; } html, :host { line-height: 1.5; -webkit-text-size-adjust: 100%; tab-size: 4; font-family: var( --default-font-family, ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji' ); font-feature-settings: var(--default-font-featureSettings, normal); font-variation-settings: var(--default-font-variationSettings, normal); -webkit-tap-highlight-color: transparent; } hr { height: 0; color: inherit; border-top-width: 1px; } abbr:where([title]) { -webkit-text-decoration: underline dotted; text-decoration: underline dotted; } h1, h2, h3, h4, h5, h6 { font-size: inherit; font-weight: inherit; } a { color: inherit; -webkit-text-decoration: inherit; text-decoration: inherit; } b, strong { font-weight: bolder; } code, kbd, samp, pre { font-family: var( --default-monoFont-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace ); font-feature-settings: var(--default-monoFont-featureSettings, normal); font-variation-settings: var(--default-monoFont-variationSettings, normal); font-size: 1em; } small { font-size: 80%; } sub, sup { font-size: 75%; line-height: 0; position: relative; vertical-align: baseline; } sub { bottom: -0.25em; } sup { top: -0.5em; } table { text-indent: 0; border-color: inherit; border-collapse: collapse; } :-moz-focusring { outline: auto; } progress { vertical-align: baseline; } summary { display: list-item; } ol, ul, menu { list-style: none; } img, svg, video, canvas, audio, iframe, embed, object { display: block; vertical-align: middle; } img, video { max-width: 100%; height: auto; } button, input, select, optgroup, textarea, ::file-selector-button { font: inherit; font-feature-settings: inherit; font-variation-settings: inherit; letter-spacing: inherit; color: inherit; border-radius: 0; background-color: transparent; opacity: 1; } :where(select:is([multiple], [size])) optgroup { font-weight: bolder; } :where(select:is([multiple], [size])) optgroup option { padding-inline-start: 20px; } ::file-selector-button { margin-inline-end: 4px; } ::placeholder { opacity: 1; } @supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px) { ::placeholder { color: color-mix(in oklab, currentcolor 50%, transparent); } } textarea { resize: vertical; } ::-webkit-search-decoration { -webkit-appearance: none; } ::-webkit-date-and-time-value { min-height: 1lh; text-align: inherit; } ::-webkit-datetime-edit { display: inline-flex; } ::-webkit-datetime-edit-fields-wrapper { padding: 0; } ::-webkit-datetime-edit, ::-webkit-datetime-edit-year-field, ::-webkit-datetime-edit-month-field, ::-webkit-datetime-edit-day-field, ::-webkit-datetime-edit-hour-field, ::-webkit-datetime-edit-minute-field, ::-webkit-datetime-edit-second-field, ::-webkit-datetime-edit-millisecond-field, ::-webkit-datetime-edit-meridiem-field { padding-block: 0; } ::-webkit-calendar-picker-indicator { line-height: 1; } :-moz-ui-invalid { box-shadow: none; } button, input:where([type='button'], [type='reset'], [type='submit']), ::file-selector-button { appearance: button; } ::-webkit-inner-spin-button, ::-webkit-outer-spin-button { height: auto; } [hidden]:where(:not([hidden~='until-found'])) { display: none !important; }
|
|
46
46
|
/* layer: preflights */
|
|
@@ -607,10 +607,10 @@ body {
|
|
|
607
607
|
.relative{position:relative;}
|
|
608
608
|
.sticky{position:sticky;}
|
|
609
609
|
.after\:absolute::after{position:absolute;}
|
|
610
|
-
.z-\[10\],
|
|
611
|
-
.z-10{z-index:10;}
|
|
612
610
|
.z-\[11\]{z-index:11;}
|
|
611
|
+
.z-\[3000\]{z-index:3000;}
|
|
613
612
|
.z-\[99\]{z-index:99;}
|
|
613
|
+
.z-10{z-index:10;}
|
|
614
614
|
.z-50{z-index:50;}
|
|
615
615
|
.after\:z-0::after{z-index:0;}
|
|
616
616
|
.overflow-auto,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jx-health/rich-editor",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"description": "Vue3 Rich editor",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Hosanna <ohosanna@gmail.com>",
|
|
@@ -24,32 +24,6 @@
|
|
|
24
24
|
"publishConfig": {
|
|
25
25
|
"access": "public"
|
|
26
26
|
},
|
|
27
|
-
"devDependencies": {
|
|
28
|
-
"@iconify-json/carbon": "^1.2.24",
|
|
29
|
-
"@iconify/vue": "^5.0.1",
|
|
30
|
-
"@tsdown/css": "0.21.7",
|
|
31
|
-
"@types/lodash": "^4.17.24",
|
|
32
|
-
"@types/node": "^25.9.5",
|
|
33
|
-
"@typescript/native-preview": "7.0.0-dev.20260328.1",
|
|
34
|
-
"@unocss/config": "^66.7.5",
|
|
35
|
-
"@unocss/core": "^66.7.5",
|
|
36
|
-
"@unocss/preset-icons": "66.5.4",
|
|
37
|
-
"bumpp": "^11.1.0",
|
|
38
|
-
"magic-string": "^0.30.21",
|
|
39
|
-
"prism-code-editor": "^5.2.0",
|
|
40
|
-
"prosemirror-model": "^1.25.11",
|
|
41
|
-
"rolldown-plugin-unocss": "^0.1.0",
|
|
42
|
-
"sass-embedded": "^1.100.0",
|
|
43
|
-
"typescript": "^5.9.3",
|
|
44
|
-
"unocss": "^66.7.5",
|
|
45
|
-
"unocss-preset-animations": "^1.3.0",
|
|
46
|
-
"unocss-preset-shadcn": "^1.0.1",
|
|
47
|
-
"unplugin-auto-import": "^21.0.0",
|
|
48
|
-
"unplugin-vue": "^7.2.0",
|
|
49
|
-
"unplugin-vue-components": "^32.1.0",
|
|
50
|
-
"vite-plus": "^0.1.24",
|
|
51
|
-
"vue-tsc": "^3.3.8"
|
|
52
|
-
},
|
|
53
27
|
"dependencies": {
|
|
54
28
|
"@lucide/vue": "^1.27.0",
|
|
55
29
|
"@tiptap/core": "3.28.0",
|
|
@@ -98,7 +72,7 @@
|
|
|
98
72
|
"class-variance-authority": "^0.7.1",
|
|
99
73
|
"clsx": "^2.1.1",
|
|
100
74
|
"hotkeys-js": "^4.0.4",
|
|
101
|
-
"lodash": "^4.18.1",
|
|
75
|
+
"lodash-es": "^4.18.1",
|
|
102
76
|
"reka-ui": "^2.10.1",
|
|
103
77
|
"tailwind-merge": "^3.6.0",
|
|
104
78
|
"tippy.js": "^6.3.7",
|
|
@@ -106,6 +80,33 @@
|
|
|
106
80
|
"vue-sonner": "^2.0.9",
|
|
107
81
|
"y-prosemirror": "^1.3.7"
|
|
108
82
|
},
|
|
83
|
+
"devDependencies": {
|
|
84
|
+
"@iconify-json/carbon": "^1.2.24",
|
|
85
|
+
"@iconify/vue": "^5.0.1",
|
|
86
|
+
"@tsdown/css": "0.21.7",
|
|
87
|
+
"@types/lodash-es": "^4.17.12",
|
|
88
|
+
"@types/node": "^25.9.5",
|
|
89
|
+
"@typescript/native-preview": "7.0.0-dev.20260328.1",
|
|
90
|
+
"@unocss/config": "^66.7.5",
|
|
91
|
+
"@unocss/core": "^66.7.5",
|
|
92
|
+
"@unocss/preset-icons": "66.5.4",
|
|
93
|
+
"bumpp": "^11.1.0",
|
|
94
|
+
"happy-dom": "^15.11.7",
|
|
95
|
+
"magic-string": "^0.30.21",
|
|
96
|
+
"prism-code-editor": "^5.2.0",
|
|
97
|
+
"prosemirror-model": "^1.25.11",
|
|
98
|
+
"rolldown-plugin-unocss": "^0.1.0",
|
|
99
|
+
"sass-embedded": "^1.100.0",
|
|
100
|
+
"typescript": "^5.9.3",
|
|
101
|
+
"unocss": "^66.7.5",
|
|
102
|
+
"unocss-preset-animations": "^1.3.0",
|
|
103
|
+
"unocss-preset-shadcn": "^1.0.1",
|
|
104
|
+
"unplugin-auto-import": "^21.0.0",
|
|
105
|
+
"unplugin-vue": "^7.2.0",
|
|
106
|
+
"unplugin-vue-components": "^32.1.0",
|
|
107
|
+
"vite-plus": "^0.1.24",
|
|
108
|
+
"vue-tsc": "^3.3.8"
|
|
109
|
+
},
|
|
109
110
|
"inlinedDependencies": {
|
|
110
111
|
"@iconify/vue": "5.0.1",
|
|
111
112
|
"prism-code-editor": "5.1.0",
|