@linker-design-plus/tiny-peony 1.2.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/LICENSE +21 -0
  2. package/dist/foundation/commandExecutor/commandExecutor.d.ts +9 -0
  3. package/dist/foundation/contentManager/contentManager.d.ts +21 -0
  4. package/dist/foundation/cursorManager/cursorManager.d.ts +14 -0
  5. package/dist/foundation/editorManager/editor.d.ts +39 -0
  6. package/dist/foundation/editorManager/maxLength.d.ts +4 -0
  7. package/dist/foundation/editorManager/paste.d.ts +3 -0
  8. package/dist/foundation/undoManager/undoManager.d.ts +18 -0
  9. package/dist/index.d.ts +367 -0
  10. package/dist/index.js +63 -0
  11. package/dist/index.mjs +4494 -0
  12. package/dist/intersection/components/CommonModal/CommonModal.d.ts +40 -0
  13. package/dist/intersection/components/CommonModal/composables/useModalWrapper.d.ts +47 -0
  14. package/dist/intersection/components/CommonModal/index.d.ts +86 -0
  15. package/dist/intersection/components/CommonModal/syncConfirm.d.ts +2 -0
  16. package/dist/intersection/components/editor/context.d.ts +45 -0
  17. package/dist/intersection/components/editor/editor.d.ts +172 -0
  18. package/dist/intersection/components/editor/iconfont.d.ts +20 -0
  19. package/dist/intersection/components/editor/index.d.ts +365 -0
  20. package/dist/intersection/components/modals/contextMenu.vue.d.ts +22 -0
  21. package/dist/intersection/hooks/use-editor.d.ts +54 -0
  22. package/dist/intersection/hooks/use-highlight.d.ts +7 -0
  23. package/dist/intersection/stores/use-editor-store.d.ts +0 -0
  24. package/dist/plugins/AnchorTagPlugin/constant.d.ts +1 -0
  25. package/dist/plugins/AnchorTagPlugin/index.d.ts +2 -0
  26. package/dist/plugins/AnchorTagPlugin/plugin.d.ts +37 -0
  27. package/dist/plugins/HomophonesTagPlugin/homophoner.vue.d.ts +13 -0
  28. package/dist/plugins/HomophonesTagPlugin/index.d.ts +2 -0
  29. package/dist/plugins/HomophonesTagPlugin/plugin.d.ts +17 -0
  30. package/dist/plugins/PausationTagPlugin/index.d.ts +2 -0
  31. package/dist/plugins/PausationTagPlugin/pausationor.vue.d.ts +9 -0
  32. package/dist/plugins/PausationTagPlugin/plugin.d.ts +28 -0
  33. package/dist/plugins/PronunciationTagPlugin/index.d.ts +2 -0
  34. package/dist/plugins/PronunciationTagPlugin/plugin.d.ts +19 -0
  35. package/dist/plugins/PronunciationTagPlugin/pronunciationor.vue.d.ts +13 -0
  36. package/dist/tiny-peony.css +1 -0
  37. package/dist/typings/actions/i-anchor.d.ts +22 -0
  38. package/dist/typings/actions/i-homophone.d.ts +9 -0
  39. package/dist/typings/actions/i-modal.d.ts +7 -0
  40. package/dist/typings/actions/i-plugin.d.ts +9 -0
  41. package/dist/typings/index.d.ts +9 -0
  42. package/dist/typings/intersection/editor.d.ts +35 -0
  43. package/dist/typings/shared.d.ts +16 -0
  44. package/dist/typings/status/i-command-executor.d.ts +8 -0
  45. package/dist/typings/status/i-content-manager.d.ts +14 -0
  46. package/dist/typings/status/i-cursor-manager.d.ts +10 -0
  47. package/dist/typings/status/i-editor-manager.d.ts +20 -0
  48. package/dist/typings/status/i-undo-manager.d.ts +26 -0
  49. package/dist/utils/dom.d.ts +18 -0
  50. package/dist/utils/index.d.ts +3 -0
  51. package/dist/utils/shared.d.ts +2 -0
  52. package/dist/utils/value-type.d.ts +12 -0
  53. package/package.json +43 -0
@@ -0,0 +1,40 @@
1
+ import type { PropType } from 'vue';
2
+ import { JSX } from 'vue/jsx-runtime';
3
+ export type FooterAlign = 'left' | 'center' | 'right';
4
+ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
5
+ footerAlign: {
6
+ type: PropType<FooterAlign>;
7
+ default: string;
8
+ };
9
+ hideHeaderBorder: {
10
+ type: BooleanConstructor;
11
+ };
12
+ hideFooterBorder: {
13
+ type: BooleanConstructor;
14
+ };
15
+ renderIcon: {
16
+ type: BooleanConstructor;
17
+ default: boolean;
18
+ };
19
+ }>, () => JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
20
+ footerAlign: {
21
+ type: PropType<FooterAlign>;
22
+ default: string;
23
+ };
24
+ hideHeaderBorder: {
25
+ type: BooleanConstructor;
26
+ };
27
+ hideFooterBorder: {
28
+ type: BooleanConstructor;
29
+ };
30
+ renderIcon: {
31
+ type: BooleanConstructor;
32
+ default: boolean;
33
+ };
34
+ }>> & Readonly<{}>, {
35
+ hideHeaderBorder: boolean;
36
+ footerAlign: FooterAlign;
37
+ hideFooterBorder: boolean;
38
+ renderIcon: boolean;
39
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
40
+ export default _default;
@@ -0,0 +1,47 @@
1
+ import type { AppContext, CSSProperties } from 'vue';
2
+ import type { ModalConfig as _ModalConfig, ModalReturn } from '@arco-design/web-vue';
3
+ export interface ModalConfig extends _ModalConfig {
4
+ hideHeaderBorder?: boolean;
5
+ style?: CSSProperties;
6
+ }
7
+ export interface ModalMethod {
8
+ /**
9
+ * @zh 打开对话框
10
+ * @en Open modal
11
+ */
12
+ open: (config: ModalConfig, appContext?: AppContext) => ModalReturn;
13
+ /**
14
+ * @zh 打开对话框(简单模式)
15
+ * @en Open modal (simple mode)
16
+ */
17
+ confirm: (config: ModalConfig, appContext?: AppContext) => ModalReturn;
18
+ /**
19
+ * @zh 打开信息对话框
20
+ * @en Open info modal
21
+ */
22
+ info: (config: ModalConfig, appContext?: AppContext) => ModalReturn;
23
+ /**
24
+ * @zh 打开成功对话框
25
+ * @en Open success modal
26
+ */
27
+ success: (config: ModalConfig, appContext?: AppContext) => ModalReturn;
28
+ /**
29
+ * @zh 打开警告对话框
30
+ * @en Open warning modal
31
+ */
32
+ warning: (config: ModalConfig, appContext?: AppContext) => ModalReturn;
33
+ /**
34
+ * @zh 打开错误对话框
35
+ * @en Open error modal
36
+ */
37
+ error: (config: ModalConfig, appContext?: AppContext) => ModalReturn;
38
+ /**
39
+ * @zh 打开对话框(同步模式)
40
+ * @en Open modal (sync mode)
41
+ */
42
+ syncConfirm: (config: ModalConfig, appContext?: AppContext) => Promise<boolean>;
43
+ }
44
+ declare const _default: () => {
45
+ Modal: ModalMethod;
46
+ };
47
+ export default _default;
@@ -0,0 +1,86 @@
1
+ import type { App } from 'vue';
2
+ import './CommonModal.less';
3
+ declare const Modal: {
4
+ new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
5
+ footerAlign: {
6
+ type: import("vue").PropType<import("./CommonModal").FooterAlign>;
7
+ default: string;
8
+ };
9
+ hideHeaderBorder: {
10
+ type: BooleanConstructor;
11
+ };
12
+ hideFooterBorder: {
13
+ type: BooleanConstructor;
14
+ };
15
+ renderIcon: {
16
+ type: BooleanConstructor;
17
+ default: boolean;
18
+ };
19
+ }>> & Readonly<{}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {
20
+ hideHeaderBorder: boolean;
21
+ footerAlign: import("./CommonModal").FooterAlign;
22
+ hideFooterBorder: boolean;
23
+ renderIcon: boolean;
24
+ }, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
25
+ P: {};
26
+ B: {};
27
+ D: {};
28
+ C: {};
29
+ M: {};
30
+ Defaults: {};
31
+ }, Readonly<import("vue").ExtractPropTypes<{
32
+ footerAlign: {
33
+ type: import("vue").PropType<import("./CommonModal").FooterAlign>;
34
+ default: string;
35
+ };
36
+ hideHeaderBorder: {
37
+ type: BooleanConstructor;
38
+ };
39
+ hideFooterBorder: {
40
+ type: BooleanConstructor;
41
+ };
42
+ renderIcon: {
43
+ type: BooleanConstructor;
44
+ default: boolean;
45
+ };
46
+ }>> & Readonly<{}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, {
47
+ hideHeaderBorder: boolean;
48
+ footerAlign: import("./CommonModal").FooterAlign;
49
+ hideFooterBorder: boolean;
50
+ renderIcon: boolean;
51
+ }>;
52
+ __isFragment?: never;
53
+ __isTeleport?: never;
54
+ __isSuspense?: never;
55
+ } & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
56
+ footerAlign: {
57
+ type: import("vue").PropType<import("./CommonModal").FooterAlign>;
58
+ default: string;
59
+ };
60
+ hideHeaderBorder: {
61
+ type: BooleanConstructor;
62
+ };
63
+ hideFooterBorder: {
64
+ type: BooleanConstructor;
65
+ };
66
+ renderIcon: {
67
+ type: BooleanConstructor;
68
+ default: boolean;
69
+ };
70
+ }>> & Readonly<{}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
71
+ hideHeaderBorder: boolean;
72
+ footerAlign: import("./CommonModal").FooterAlign;
73
+ hideFooterBorder: boolean;
74
+ renderIcon: boolean;
75
+ }, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & {
76
+ install: (app: App) => void;
77
+ open: (config: import("./composables/useModalWrapper").ModalConfig, appContext?: import("vue").AppContext) => import("@arco-design/web-vue").ModalReturn;
78
+ confirm: (config: import("./composables/useModalWrapper").ModalConfig, appContext?: import("vue").AppContext) => import("@arco-design/web-vue").ModalReturn;
79
+ info: (config: import("./composables/useModalWrapper").ModalConfig, appContext?: import("vue").AppContext) => import("@arco-design/web-vue").ModalReturn;
80
+ success: (config: import("./composables/useModalWrapper").ModalConfig, appContext?: import("vue").AppContext) => import("@arco-design/web-vue").ModalReturn;
81
+ warning: (config: import("./composables/useModalWrapper").ModalConfig, appContext?: import("vue").AppContext) => import("@arco-design/web-vue").ModalReturn;
82
+ error: (config: import("./composables/useModalWrapper").ModalConfig, appContext?: import("vue").AppContext) => import("@arco-design/web-vue").ModalReturn;
83
+ syncConfirm: (config: import("./composables/useModalWrapper").ModalConfig, appContext?: import("vue").AppContext) => Promise<boolean>;
84
+ };
85
+ export type CommonModalInstance = InstanceType<typeof Modal>;
86
+ export default Modal;
@@ -0,0 +1,2 @@
1
+ import type { ModalConfig } from '@arco-design/web-vue';
2
+ export declare const syncConfirm: (cfg: ModalConfig) => Promise<boolean>;
@@ -0,0 +1,45 @@
1
+ import { InjectionKey, Ref } from 'vue';
2
+ import { EditorCore } from '../../../foundation/editorManager/editor';
3
+ import { EditorAction } from '../../hooks/use-editor';
4
+ import { IAnchor, PluginFlag } from '../../../typings';
5
+ /**
6
+ * * 获取编辑器内容时,是否对内容进行指定格式化
7
+ */
8
+ export interface ContentOptions {
9
+ /**
10
+ * * 是否返回带有主播文本高亮样式标记
11
+ */
12
+ withHighlight?: boolean;
13
+ /**
14
+ * * 是否返回带有文本审核高亮样式标记
15
+ */
16
+ withAuditHighlight?: boolean;
17
+ }
18
+ export declare const defaultContentOptions: ContentOptions;
19
+ export interface EditorContext {
20
+ name: 'Editor';
21
+ editorCore: Ref<EditorCore | undefined>;
22
+ editorAction: Ref<EditorAction | undefined>;
23
+ getContent: (options?: ContentOptions) => string;
24
+ setContent: (content: string) => void;
25
+ appendContent: (content: string | string[]) => void;
26
+ getTextContent: () => string[];
27
+ insertContent: (content: string | Node) => void;
28
+ deleteContent: () => void;
29
+ updateContent: (content: string | Node) => void;
30
+ isCaret: () => boolean;
31
+ isRange: () => boolean;
32
+ isSelectionContainsTag: (type: PluginFlag) => boolean;
33
+ getAnchorTtsMark: (id: number, startFromCursor?: boolean) => string;
34
+ getAnchorTtsEmotionAndRole: (id: number) => [string, string | undefined];
35
+ isAllMarkedByAnchor: () => boolean;
36
+ addExtraAnchors: (data: IAnchor[]) => void;
37
+ clearContent: () => void;
38
+ renderHighlight: (matchingContent: string) => void;
39
+ unrenderHighlight: () => void;
40
+ }
41
+ export declare const EditorInjectionKey: InjectionKey<EditorContext>;
42
+ declare const HIGHLIGHT_CLS = "highlight";
43
+ declare const auditHighlightBem: import("@linker-design/utils").Bem;
44
+ declare const AUDIT_HIGHLIGHT_CLS: string;
45
+ export { HIGHLIGHT_CLS, auditHighlightBem, AUDIT_HIGHLIGHT_CLS };
@@ -0,0 +1,172 @@
1
+ import { CSSProperties, PropType } from 'vue';
2
+ import { JSX } from 'vue/jsx-runtime';
3
+ import { ContentOptions } from './context';
4
+ import { IAnchor, ListenModeEnum, PluginFlag } from '../../../typings';
5
+ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
6
+ preTime: {
7
+ type: StringConstructor;
8
+ default: string;
9
+ };
10
+ realTime: {
11
+ type: StringConstructor;
12
+ default: string;
13
+ };
14
+ textCount: {
15
+ type: NumberConstructor;
16
+ default: number;
17
+ };
18
+ listenAnchorId: {
19
+ type: NumberConstructor;
20
+ default: number;
21
+ };
22
+ listenMode: {
23
+ type: PropType<ListenModeEnum>;
24
+ default: string;
25
+ };
26
+ placeholder: {
27
+ type: StringConstructor;
28
+ default: string;
29
+ };
30
+ simple: {
31
+ type: BooleanConstructor;
32
+ default: boolean;
33
+ };
34
+ maxLength: {
35
+ type: NumberConstructor;
36
+ default: number;
37
+ };
38
+ showWordLimit: {
39
+ type: BooleanConstructor;
40
+ default: boolean;
41
+ };
42
+ disabled: {
43
+ type: BooleanConstructor;
44
+ default: boolean;
45
+ };
46
+ class: {
47
+ type: (ArrayConstructor | StringConstructor)[];
48
+ default: () => never[];
49
+ };
50
+ contentStyle: {
51
+ type: PropType<CSSProperties>;
52
+ default: () => {};
53
+ };
54
+ }>, {
55
+ action: import("vue").Ref<import("../../hooks/use-editor").EditorAction | undefined, import("../../hooks/use-editor").EditorAction | undefined>;
56
+ innerRender: () => JSX.Element;
57
+ innerGetContent: (_options?: ContentOptions) => string;
58
+ innerSetContent: (content: string) => Promise<void>;
59
+ innerAppendContent: (content: string | string[]) => Promise<void>;
60
+ innerGetTextContent: () => string[];
61
+ innerInsertContent: (content: string | Node) => void;
62
+ innerDeleteContent: () => void;
63
+ innerUpdateContent: (content: string | Node) => void;
64
+ innerIsCaret: () => boolean;
65
+ innerIsRange: () => boolean;
66
+ innerIsSelectionInDifferentParas: () => boolean;
67
+ innerIsSelectionContainsTag: (type: PluginFlag) => boolean;
68
+ innerGetAnchorTtsMark: (id: number, startFromCursor?: boolean) => string;
69
+ innerGetAnchorTtsEmotionAndRole: (id: number) => [string, string | undefined];
70
+ innerIsAllMarkedByAnchor: () => boolean;
71
+ innerAddExtraAnchors: (data: IAnchor[]) => void;
72
+ innerClearContent: () => void;
73
+ innerRenderHightlight: (matchingContent: string) => void;
74
+ innerUnrenderHightlight: () => void;
75
+ }, {}, {}, {
76
+ getContent(options?: ContentOptions): string;
77
+ getHtml(options: ContentOptions): string;
78
+ setContent(content: string): Promise<void>;
79
+ setHtml(content: string): Promise<void>;
80
+ appendContent(content: string | string[]): Promise<void>;
81
+ getTextContent(): string[];
82
+ insertContent(content: string | Node): void;
83
+ deleteContent(): void;
84
+ updateContent(content: string | Node): void;
85
+ isCaret(): boolean;
86
+ isRange(): boolean;
87
+ isSelectionInDifferentParas(): boolean;
88
+ isSelectionContainsTag(type: PluginFlag): boolean;
89
+ getAnchorTtsMark(id: number, startFromCursor?: boolean): string;
90
+ getAnchorTtsEmotionAndRole(id: number): [string, string | undefined];
91
+ isAllMarkedByAnchor(): boolean;
92
+ addExtraAnchors(data: IAnchor[]): void;
93
+ clearContent(): void;
94
+ clear(): Promise<void>;
95
+ renderHighlight(matchingContent: string): void;
96
+ unrenderHighlight(): void;
97
+ }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
98
+ change: (contentLength: number) => true;
99
+ 'update:textCount': (value: number) => true;
100
+ anchorListen: (value: IAnchor, text: string) => true;
101
+ anchorListenStop: (value: IAnchor) => true;
102
+ anchorRemove: (value: IAnchor) => true;
103
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
104
+ preTime: {
105
+ type: StringConstructor;
106
+ default: string;
107
+ };
108
+ realTime: {
109
+ type: StringConstructor;
110
+ default: string;
111
+ };
112
+ textCount: {
113
+ type: NumberConstructor;
114
+ default: number;
115
+ };
116
+ listenAnchorId: {
117
+ type: NumberConstructor;
118
+ default: number;
119
+ };
120
+ listenMode: {
121
+ type: PropType<ListenModeEnum>;
122
+ default: string;
123
+ };
124
+ placeholder: {
125
+ type: StringConstructor;
126
+ default: string;
127
+ };
128
+ simple: {
129
+ type: BooleanConstructor;
130
+ default: boolean;
131
+ };
132
+ maxLength: {
133
+ type: NumberConstructor;
134
+ default: number;
135
+ };
136
+ showWordLimit: {
137
+ type: BooleanConstructor;
138
+ default: boolean;
139
+ };
140
+ disabled: {
141
+ type: BooleanConstructor;
142
+ default: boolean;
143
+ };
144
+ class: {
145
+ type: (ArrayConstructor | StringConstructor)[];
146
+ default: () => never[];
147
+ };
148
+ contentStyle: {
149
+ type: PropType<CSSProperties>;
150
+ default: () => {};
151
+ };
152
+ }>> & Readonly<{
153
+ onChange?: ((contentLength: number) => any) | undefined;
154
+ "onUpdate:textCount"?: ((value: number) => any) | undefined;
155
+ onAnchorListen?: ((value: IAnchor, text: string) => any) | undefined;
156
+ onAnchorRemove?: ((value: IAnchor) => any) | undefined;
157
+ onAnchorListenStop?: ((value: IAnchor) => any) | undefined;
158
+ }>, {
159
+ class: string | unknown[];
160
+ disabled: boolean;
161
+ placeholder: string;
162
+ maxLength: number;
163
+ showWordLimit: boolean;
164
+ simple: boolean;
165
+ preTime: string;
166
+ realTime: string;
167
+ textCount: number;
168
+ listenAnchorId: number;
169
+ listenMode: ListenModeEnum;
170
+ contentStyle: CSSProperties;
171
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
172
+ export default _default;
@@ -0,0 +1,20 @@
1
+ declare const IconFont: import("vue").DefineComponent<{
2
+ type: StringConstructor;
3
+ size: (StringConstructor | NumberConstructor)[];
4
+ rotate: NumberConstructor;
5
+ spin: BooleanConstructor;
6
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{
7
+ type?: unknown;
8
+ size?: unknown;
9
+ rotate?: unknown;
10
+ spin?: unknown;
11
+ } & {
12
+ spin: boolean;
13
+ } & {
14
+ size?: string | number | undefined;
15
+ type?: string | undefined;
16
+ rotate?: number | undefined;
17
+ }>, {
18
+ spin: boolean;
19
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
20
+ export { IconFont };