@mekari/pixel3-rich-text-editor 0.1.2 → 0.1.3-dev.1
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/{chunk-7BEXEMOE.mjs → chunk-6O4HSL2C.mjs} +4 -0
- package/dist/chunk-76GEEOAG.mjs +189 -0
- package/dist/{chunk-MKTM47RO.mjs → chunk-AIWY3FHJ.mjs} +1 -1
- package/dist/chunk-BWRU2WZN.mjs +202 -0
- package/dist/{chunk-ZO6THAT6.mjs → chunk-COZ45QUD.mjs} +1 -1
- package/dist/chunk-ENKUUZPM.mjs +124 -0
- package/dist/{chunk-25RKPG44.mjs → chunk-FCLBNBXD.mjs} +25 -16
- package/dist/{chunk-Q7QLZISF.mjs → chunk-IFRJVX2K.mjs} +29 -1
- package/dist/{chunk-YE6FEVD4.mjs → chunk-RX7ZEE2M.mjs} +104 -58
- package/dist/{chunk-XNM3YX37.mjs → chunk-T7RFFPSJ.mjs} +13 -3
- package/dist/{chunk-YIEQVTEO.mjs → chunk-X2CB42A3.mjs} +1 -1
- package/dist/{chunk-5S2LSGJV.mjs → chunk-Y6UPQ6EU.mjs} +1 -1
- package/dist/{chunk-UBJOZ2IA.mjs → chunk-YWVVMJGP.mjs} +1 -1
- package/dist/editor-toolbar.d.mts +2 -1
- package/dist/editor-toolbar.d.ts +2 -1
- package/dist/editor-toolbar.js +469 -75
- package/dist/editor-toolbar.mjs +10 -8
- package/dist/extensions/align-extension.js +27 -0
- package/dist/extensions/align-extension.mjs +2 -2
- package/dist/extensions/color-extension.js +27 -0
- package/dist/extensions/color-extension.mjs +2 -2
- package/dist/extensions/heading-extension.js +27 -0
- package/dist/extensions/heading-extension.mjs +2 -2
- package/dist/extensions/icons.d.mts +2 -1
- package/dist/extensions/icons.d.ts +2 -1
- package/dist/extensions/icons.js +31 -2
- package/dist/extensions/icons.mjs +5 -3
- package/dist/extensions/index.d.mts +6 -0
- package/dist/extensions/index.d.ts +6 -0
- package/dist/extensions/index.js +368 -16
- package/dist/extensions/index.mjs +18 -10
- package/dist/extensions/link-extension.js +27 -0
- package/dist/extensions/link-extension.mjs +2 -2
- package/dist/extensions/single-extension.d.mts +12 -2
- package/dist/extensions/single-extension.d.ts +12 -2
- package/dist/extensions/single-extension.js +49 -14
- package/dist/extensions/single-extension.mjs +2 -2
- package/dist/extensions/variable-extension.d.mts +19 -0
- package/dist/extensions/variable-extension.d.ts +19 -0
- package/dist/extensions/variable-extension.js +158 -0
- package/dist/extensions/variable-extension.mjs +7 -0
- package/dist/extensions/variable-list-extension.d.mts +33 -0
- package/dist/extensions/variable-list-extension.d.ts +33 -0
- package/dist/extensions/variable-list-extension.js +210 -0
- package/dist/extensions/variable-list-extension.mjs +7 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +699 -116
- package/dist/index.mjs +14 -11
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/modules/rich-text-editor.props.d.mts +5 -1
- package/dist/modules/rich-text-editor.props.d.ts +5 -1
- package/dist/modules/rich-text-editor.props.js +4 -0
- package/dist/modules/rich-text-editor.props.mjs +1 -1
- package/dist/modules/rich-text-editor.types.d.mts +11 -3
- package/dist/modules/rich-text-editor.types.d.ts +11 -3
- package/dist/rich-text-editor.d.mts +10 -1
- package/dist/rich-text-editor.d.ts +10 -1
- package/dist/rich-text-editor.js +699 -116
- package/dist/rich-text-editor.mjs +14 -11
- package/dist/rte-style-provider.mjs +2 -2
- package/dist/rte-variable-suggestion.d.mts +11 -0
- package/dist/rte-variable-suggestion.d.ts +11 -0
- package/dist/rte-variable-suggestion.js +405 -0
- package/dist/rte-variable-suggestion.mjs +10 -0
- package/package.json +12 -12
- /package/dist/{chunk-VYCDVS5I.mjs → chunk-HIHIKPNN.mjs} +0 -0
|
@@ -10,6 +10,11 @@ interface MentionSuggestionItem {
|
|
|
10
10
|
description?: string;
|
|
11
11
|
avatar?: string;
|
|
12
12
|
}
|
|
13
|
+
interface VariableSuggestionItem {
|
|
14
|
+
id: string;
|
|
15
|
+
name: string;
|
|
16
|
+
category?: string;
|
|
17
|
+
}
|
|
13
18
|
interface RichTextEditorProps {
|
|
14
19
|
id?: string;
|
|
15
20
|
value?: string;
|
|
@@ -17,6 +22,7 @@ interface RichTextEditorProps {
|
|
|
17
22
|
maxlength?: number;
|
|
18
23
|
options?: ToolbarOption[][];
|
|
19
24
|
suggestions?: MentionSuggestionItem[];
|
|
25
|
+
variables?: VariableSuggestionItem[];
|
|
20
26
|
isInvalid: boolean;
|
|
21
27
|
isDisabled: boolean;
|
|
22
28
|
hasBorder?: boolean;
|
|
@@ -40,6 +46,7 @@ interface RichTextEditorApiMachine<T extends PropTypes = PropTypes> {
|
|
|
40
46
|
maxlength?: number;
|
|
41
47
|
options?: ToolbarOption[][];
|
|
42
48
|
suggestions?: MentionSuggestionItem[];
|
|
49
|
+
variables?: VariableSuggestionItem[];
|
|
43
50
|
isInvalid?: boolean;
|
|
44
51
|
isDisabled?: boolean;
|
|
45
52
|
rootProps?: T['element'];
|
|
@@ -59,10 +66,11 @@ interface RTEStyleProviderApiMachine<T extends PropTypes = PropTypes> {
|
|
|
59
66
|
interface RTEStyleProviderState extends RteStyleProviderProps {
|
|
60
67
|
}
|
|
61
68
|
type RTEStyleProviderClasses = string;
|
|
62
|
-
type Items = 'heading' | 'bold' | 'italic' | 'underline' | 'strike' | 'blockquote' | 'bulletList' | 'orderedList' | 'textColor' | 'fillColor' | 'textLink' | 'align' | 'undo' | 'redo' | 'clear' | 'image' | 'file' | 'audio' | 'mention' | 'location';
|
|
69
|
+
type Items = 'heading' | 'bold' | 'italic' | 'underline' | 'strike' | 'blockquote' | 'bulletList' | 'orderedList' | 'textColor' | 'fillColor' | 'textLink' | 'align' | 'undo' | 'redo' | 'clear' | 'image' | 'file' | 'audio' | 'mention' | 'variable' | 'location';
|
|
63
70
|
interface ToolbarOptionObject {
|
|
64
71
|
value: string;
|
|
65
72
|
tooltip?: string;
|
|
73
|
+
disabled?: boolean;
|
|
66
74
|
}
|
|
67
75
|
type ToolbarOption = Items | ToolbarOptionObject;
|
|
68
76
|
interface ItemOptions {
|
|
@@ -72,6 +80,6 @@ interface ItemOptions {
|
|
|
72
80
|
type?: 'text' | 'fill';
|
|
73
81
|
editor?: unknown;
|
|
74
82
|
}
|
|
75
|
-
type ActionTypes = 'image' | 'file' | 'audio' | 'mention' | 'location';
|
|
83
|
+
type ActionTypes = 'image' | 'file' | 'audio' | 'mention' | 'variable' | 'location';
|
|
76
84
|
|
|
77
|
-
export { ActionTypes, ItemOptions, Items, MentionSuggestionItem, RTEStyleProviderApiMachine, RTEStyleProviderClasses, RTEStyleProviderDefinedContext, RTEStyleProviderState, RichTextEditorApiMachine, RichTextEditorClasses, RichTextEditorDefinedContext, RichTextEditorProps, RichTextEditorState, RteStyleProviderProps, ToolbarOption, ToolbarOptionObject };
|
|
85
|
+
export { ActionTypes, ItemOptions, Items, MentionSuggestionItem, RTEStyleProviderApiMachine, RTEStyleProviderClasses, RTEStyleProviderDefinedContext, RTEStyleProviderState, RichTextEditorApiMachine, RichTextEditorClasses, RichTextEditorDefinedContext, RichTextEditorProps, RichTextEditorState, RteStyleProviderProps, ToolbarOption, ToolbarOptionObject, VariableSuggestionItem };
|
|
@@ -10,6 +10,11 @@ interface MentionSuggestionItem {
|
|
|
10
10
|
description?: string;
|
|
11
11
|
avatar?: string;
|
|
12
12
|
}
|
|
13
|
+
interface VariableSuggestionItem {
|
|
14
|
+
id: string;
|
|
15
|
+
name: string;
|
|
16
|
+
category?: string;
|
|
17
|
+
}
|
|
13
18
|
interface RichTextEditorProps {
|
|
14
19
|
id?: string;
|
|
15
20
|
value?: string;
|
|
@@ -17,6 +22,7 @@ interface RichTextEditorProps {
|
|
|
17
22
|
maxlength?: number;
|
|
18
23
|
options?: ToolbarOption[][];
|
|
19
24
|
suggestions?: MentionSuggestionItem[];
|
|
25
|
+
variables?: VariableSuggestionItem[];
|
|
20
26
|
isInvalid: boolean;
|
|
21
27
|
isDisabled: boolean;
|
|
22
28
|
hasBorder?: boolean;
|
|
@@ -40,6 +46,7 @@ interface RichTextEditorApiMachine<T extends PropTypes = PropTypes> {
|
|
|
40
46
|
maxlength?: number;
|
|
41
47
|
options?: ToolbarOption[][];
|
|
42
48
|
suggestions?: MentionSuggestionItem[];
|
|
49
|
+
variables?: VariableSuggestionItem[];
|
|
43
50
|
isInvalid?: boolean;
|
|
44
51
|
isDisabled?: boolean;
|
|
45
52
|
rootProps?: T['element'];
|
|
@@ -59,10 +66,11 @@ interface RTEStyleProviderApiMachine<T extends PropTypes = PropTypes> {
|
|
|
59
66
|
interface RTEStyleProviderState extends RteStyleProviderProps {
|
|
60
67
|
}
|
|
61
68
|
type RTEStyleProviderClasses = string;
|
|
62
|
-
type Items = 'heading' | 'bold' | 'italic' | 'underline' | 'strike' | 'blockquote' | 'bulletList' | 'orderedList' | 'textColor' | 'fillColor' | 'textLink' | 'align' | 'undo' | 'redo' | 'clear' | 'image' | 'file' | 'audio' | 'mention' | 'location';
|
|
69
|
+
type Items = 'heading' | 'bold' | 'italic' | 'underline' | 'strike' | 'blockquote' | 'bulletList' | 'orderedList' | 'textColor' | 'fillColor' | 'textLink' | 'align' | 'undo' | 'redo' | 'clear' | 'image' | 'file' | 'audio' | 'mention' | 'variable' | 'location';
|
|
63
70
|
interface ToolbarOptionObject {
|
|
64
71
|
value: string;
|
|
65
72
|
tooltip?: string;
|
|
73
|
+
disabled?: boolean;
|
|
66
74
|
}
|
|
67
75
|
type ToolbarOption = Items | ToolbarOptionObject;
|
|
68
76
|
interface ItemOptions {
|
|
@@ -72,6 +80,6 @@ interface ItemOptions {
|
|
|
72
80
|
type?: 'text' | 'fill';
|
|
73
81
|
editor?: unknown;
|
|
74
82
|
}
|
|
75
|
-
type ActionTypes = 'image' | 'file' | 'audio' | 'mention' | 'location';
|
|
83
|
+
type ActionTypes = 'image' | 'file' | 'audio' | 'mention' | 'variable' | 'location';
|
|
76
84
|
|
|
77
|
-
export { ActionTypes, ItemOptions, Items, MentionSuggestionItem, RTEStyleProviderApiMachine, RTEStyleProviderClasses, RTEStyleProviderDefinedContext, RTEStyleProviderState, RichTextEditorApiMachine, RichTextEditorClasses, RichTextEditorDefinedContext, RichTextEditorProps, RichTextEditorState, RteStyleProviderProps, ToolbarOption, ToolbarOptionObject };
|
|
85
|
+
export { ActionTypes, ItemOptions, Items, MentionSuggestionItem, RTEStyleProviderApiMachine, RTEStyleProviderClasses, RTEStyleProviderDefinedContext, RTEStyleProviderState, RichTextEditorApiMachine, RichTextEditorClasses, RichTextEditorDefinedContext, RichTextEditorProps, RichTextEditorState, RteStyleProviderProps, ToolbarOption, ToolbarOptionObject, VariableSuggestionItem };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as vue_jsx_runtime from 'vue/jsx-runtime';
|
|
2
|
-
import { ToolbarOption, MentionSuggestionItem } from './modules/rich-text-editor.types.mjs';
|
|
2
|
+
import { ToolbarOption, MentionSuggestionItem, VariableSuggestionItem } from './modules/rich-text-editor.types.mjs';
|
|
3
3
|
import * as vue from 'vue';
|
|
4
4
|
import '@mekari/pixel3-utils';
|
|
5
5
|
|
|
@@ -35,6 +35,10 @@ declare const MpRichTextEditor: vue.DefineComponent<{
|
|
|
35
35
|
type: vue.PropType<MentionSuggestionItem[] | undefined>;
|
|
36
36
|
default: () => never[];
|
|
37
37
|
};
|
|
38
|
+
variables: {
|
|
39
|
+
type: vue.PropType<VariableSuggestionItem[] | undefined>;
|
|
40
|
+
default: () => never[];
|
|
41
|
+
};
|
|
38
42
|
validateLink: {
|
|
39
43
|
type: vue.PropType<((url: string, ctx: {
|
|
40
44
|
defaultValidate: (url: string) => boolean;
|
|
@@ -76,6 +80,10 @@ declare const MpRichTextEditor: vue.DefineComponent<{
|
|
|
76
80
|
type: vue.PropType<MentionSuggestionItem[] | undefined>;
|
|
77
81
|
default: () => never[];
|
|
78
82
|
};
|
|
83
|
+
variables: {
|
|
84
|
+
type: vue.PropType<VariableSuggestionItem[] | undefined>;
|
|
85
|
+
default: () => never[];
|
|
86
|
+
};
|
|
79
87
|
validateLink: {
|
|
80
88
|
type: vue.PropType<((url: string, ctx: {
|
|
81
89
|
defaultValidate: (url: string) => boolean;
|
|
@@ -93,6 +101,7 @@ declare const MpRichTextEditor: vue.DefineComponent<{
|
|
|
93
101
|
onAction?: ((...args: any[]) => any) | undefined;
|
|
94
102
|
}, {
|
|
95
103
|
suggestions: MentionSuggestionItem[] | undefined;
|
|
104
|
+
variables: VariableSuggestionItem[] | undefined;
|
|
96
105
|
isInvalid: boolean;
|
|
97
106
|
isDisabled: boolean;
|
|
98
107
|
hasBorder: boolean | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as vue_jsx_runtime from 'vue/jsx-runtime';
|
|
2
|
-
import { ToolbarOption, MentionSuggestionItem } from './modules/rich-text-editor.types.js';
|
|
2
|
+
import { ToolbarOption, MentionSuggestionItem, VariableSuggestionItem } from './modules/rich-text-editor.types.js';
|
|
3
3
|
import * as vue from 'vue';
|
|
4
4
|
import '@mekari/pixel3-utils';
|
|
5
5
|
|
|
@@ -35,6 +35,10 @@ declare const MpRichTextEditor: vue.DefineComponent<{
|
|
|
35
35
|
type: vue.PropType<MentionSuggestionItem[] | undefined>;
|
|
36
36
|
default: () => never[];
|
|
37
37
|
};
|
|
38
|
+
variables: {
|
|
39
|
+
type: vue.PropType<VariableSuggestionItem[] | undefined>;
|
|
40
|
+
default: () => never[];
|
|
41
|
+
};
|
|
38
42
|
validateLink: {
|
|
39
43
|
type: vue.PropType<((url: string, ctx: {
|
|
40
44
|
defaultValidate: (url: string) => boolean;
|
|
@@ -76,6 +80,10 @@ declare const MpRichTextEditor: vue.DefineComponent<{
|
|
|
76
80
|
type: vue.PropType<MentionSuggestionItem[] | undefined>;
|
|
77
81
|
default: () => never[];
|
|
78
82
|
};
|
|
83
|
+
variables: {
|
|
84
|
+
type: vue.PropType<VariableSuggestionItem[] | undefined>;
|
|
85
|
+
default: () => never[];
|
|
86
|
+
};
|
|
79
87
|
validateLink: {
|
|
80
88
|
type: vue.PropType<((url: string, ctx: {
|
|
81
89
|
defaultValidate: (url: string) => boolean;
|
|
@@ -93,6 +101,7 @@ declare const MpRichTextEditor: vue.DefineComponent<{
|
|
|
93
101
|
onAction?: ((...args: any[]) => any) | undefined;
|
|
94
102
|
}, {
|
|
95
103
|
suggestions: MentionSuggestionItem[] | undefined;
|
|
104
|
+
variables: VariableSuggestionItem[] | undefined;
|
|
96
105
|
isInvalid: boolean;
|
|
97
106
|
isDisabled: boolean;
|
|
98
107
|
hasBorder: boolean | undefined;
|