@linker-design-plus/tiny-peony 1.4.20 → 1.4.22
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/foundation/contentManager/contentManager.d.ts +5 -0
- package/dist/index.d.ts +83 -21
- package/dist/index.js +34 -35
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +4579 -3046
- package/dist/index.mjs.map +1 -0
- package/dist/intersection/components/editor/context.d.ts +128 -2
- package/dist/intersection/components/editor/editor.d.ts +54 -10
- package/dist/intersection/components/editor/index.d.ts +83 -21
- package/dist/intersection/components/modals/Refine/RefineContent.d.ts +20 -0
- package/dist/intersection/components/modals/Refine/RefineGenerator.d.ts +19 -0
- package/dist/intersection/components/modals/Refine/RefineInput.d.ts +18 -0
- package/dist/intersection/components/modals/Refine/RefineShortcut.d.ts +2 -0
- package/dist/intersection/components/modals/Refine/RefineToolbar.d.ts +2 -0
- package/dist/intersection/components/modals/Refine/context.d.ts +128 -0
- package/dist/intersection/components/modals/Refine/icons/abort.vue.d.ts +2 -0
- package/dist/intersection/components/modals/Refine/icons/copy.vue.d.ts +2 -0
- package/dist/intersection/components/modals/Refine/icons/delete.vue.d.ts +2 -0
- package/dist/intersection/components/modals/Refine/icons/expand.vue.d.ts +2 -0
- package/dist/intersection/components/modals/Refine/icons/inexpand.vue.d.ts +2 -0
- package/dist/intersection/components/modals/Refine/icons/insert.vue.d.ts +2 -0
- package/dist/intersection/components/modals/Refine/icons/moreShortcut.vue.d.ts +2 -0
- package/dist/intersection/components/modals/Refine/icons/optimism.vue.d.ts +2 -0
- package/dist/intersection/components/modals/Refine/icons/prefix.vue.d.ts +2 -0
- package/dist/intersection/components/modals/Refine/icons/refresh.vue.d.ts +2 -0
- package/dist/intersection/components/modals/Refine/icons/replace.vue.d.ts +2 -0
- package/dist/intersection/components/modals/Refine/icons/send.vue.d.ts +2 -0
- package/dist/intersection/components/modals/Refine/index.d.ts +3 -0
- package/dist/intersection/components/modals/Refine/use-modal-pos.d.ts +10 -0
- package/dist/intersection/components/modals/Refine/use-range-highlight.d.ts +6 -0
- package/dist/intersection/hooks/use-copy.d.ts +4 -0
- package/dist/intersection/hooks/use-editor.d.ts +5 -3
- package/dist/intersection/hooks/use-state.d.ts +4 -0
- package/dist/plugins/AnchorTagPlugin/plugin.d.ts +4 -0
- package/dist/plugins/HomophonesTagPlugin/homophoner.vue.d.ts +2 -2
- package/dist/plugins/PronunciationTagPlugin/pronunciationor.vue.d.ts +2 -2
- package/dist/tiny-peony.css +1 -1
- package/dist/typings/actions/i-anchor.d.ts +8 -0
- package/dist/typings/intersection/editor.d.ts +10 -1
- package/dist/utils/dom.d.ts +19 -1
- package/dist/utils/shared.d.ts +11 -0
- package/package.json +6 -6
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import type { InjectionKey, Ref } from 'vue';
|
|
2
|
+
import type { Action, Func, Predicate } from '@om-design/util';
|
|
3
|
+
export interface RefineGeneratorContext {
|
|
4
|
+
name: 'RefineGenerator';
|
|
5
|
+
refineGeneratorRef: Ref<HTMLDivElement | undefined>;
|
|
6
|
+
visible: Ref<boolean>;
|
|
7
|
+
width: string;
|
|
8
|
+
generating: Ref<boolean>;
|
|
9
|
+
prompt: Ref<string | undefined>;
|
|
10
|
+
shortcutVisible: Ref<boolean>;
|
|
11
|
+
content: Ref<RefineSingleContentContext[]>;
|
|
12
|
+
activedContent: Ref<RefineSingleContentContext | undefined>;
|
|
13
|
+
contentVisible: Ref<boolean>;
|
|
14
|
+
contentPage: Ref<number>;
|
|
15
|
+
contentState: Ref<RefineContentState>;
|
|
16
|
+
setVisible: Action<boolean>;
|
|
17
|
+
setRefineGenerating: Predicate<boolean | undefined>;
|
|
18
|
+
setRefinePrompt: Action<string | undefined>;
|
|
19
|
+
setShortVisible: Func<boolean | undefined, boolean>;
|
|
20
|
+
setRefineContent: Action<RefineSingleContentContext[]>;
|
|
21
|
+
setActivedRefineContent: Action<RefineSingleContentContext>;
|
|
22
|
+
genRefineContent: (data?: GenContentParams) => void;
|
|
23
|
+
setContentVisible: Func<boolean | undefined, boolean>;
|
|
24
|
+
setContentPage: Action<number>;
|
|
25
|
+
setContentState: Action<RefineContentState>;
|
|
26
|
+
showRefineGenerator: Action<void>;
|
|
27
|
+
abortSession: () => Promise<any>;
|
|
28
|
+
/** highlight */
|
|
29
|
+
scrollElm: Ref<HTMLElement | undefined>;
|
|
30
|
+
highlightRange: Action<void>;
|
|
31
|
+
unhighlightRange: Action<void>;
|
|
32
|
+
revertRange: Action<void>;
|
|
33
|
+
/** modal position */
|
|
34
|
+
generatorPosition: Ref<GeneratorPosEnum>;
|
|
35
|
+
shortcutPosition: Ref<ShortcutPosEnum>;
|
|
36
|
+
subShortcutPosition: Ref<SubShortcutPosEnum>;
|
|
37
|
+
setGeneratorPosition: Action<GeneratorPosEnum>;
|
|
38
|
+
setShortcutPosition: Action<ShortcutPosEnum>;
|
|
39
|
+
setSubShortcutPosition: Action<SubShortcutPosEnum>;
|
|
40
|
+
calcModalPosition: Action<void>;
|
|
41
|
+
}
|
|
42
|
+
export declare const refineGeneratorKey: InjectionKey<RefineGeneratorContext>;
|
|
43
|
+
export declare enum RefineContentState {
|
|
44
|
+
未生成 = -1,
|
|
45
|
+
等待生成 = 0,
|
|
46
|
+
正在生成 = 1,
|
|
47
|
+
生成结束 = 2
|
|
48
|
+
}
|
|
49
|
+
export declare enum RefineGenerateType {
|
|
50
|
+
重置 = 0,
|
|
51
|
+
刷新 = 1
|
|
52
|
+
}
|
|
53
|
+
export declare enum RefineShortcutEunm {
|
|
54
|
+
润色 = "\u6DA6\u8272",
|
|
55
|
+
扩写 = "\u6269\u5199",
|
|
56
|
+
缩写 = "\u7F29\u5199",
|
|
57
|
+
更改语气 = "\u66F4\u6539\u8BED\u6C14",
|
|
58
|
+
更专业 = "\u66F4\u4E13\u4E1A",
|
|
59
|
+
更口语化 = "\u66F4\u53E3\u8BED\u5316",
|
|
60
|
+
更易读 = "\u66F4\u6613\u8BFB",
|
|
61
|
+
更含蓄 = "\u66F4\u542B\u84C4",
|
|
62
|
+
更学术 = "\u66F4\u5B66\u672F",
|
|
63
|
+
更有文采 = "\u66F4\u6709\u6587\u91C7",
|
|
64
|
+
更有网感 = "\u66F4\u6709\u7F51\u611F"
|
|
65
|
+
}
|
|
66
|
+
export declare const refineShortcutOptions: ({
|
|
67
|
+
label: string;
|
|
68
|
+
value: RefineShortcutEunm;
|
|
69
|
+
icon: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, SVGSVGElement>;
|
|
70
|
+
children?: undefined;
|
|
71
|
+
} | {
|
|
72
|
+
label: string;
|
|
73
|
+
value: RefineShortcutEunm;
|
|
74
|
+
icon: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, SVGSVGElement>;
|
|
75
|
+
children: {
|
|
76
|
+
label: string;
|
|
77
|
+
icon: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, SVGSVGElement>;
|
|
78
|
+
value: RefineShortcutEunm;
|
|
79
|
+
}[];
|
|
80
|
+
})[];
|
|
81
|
+
export interface GenContentParams {
|
|
82
|
+
/**
|
|
83
|
+
* 调优提示词
|
|
84
|
+
*/
|
|
85
|
+
prompt?: string;
|
|
86
|
+
/**
|
|
87
|
+
* 调优快捷指令
|
|
88
|
+
*/
|
|
89
|
+
shortcutType?: RefineShortcutEunm;
|
|
90
|
+
/**
|
|
91
|
+
* 调优类型
|
|
92
|
+
*/
|
|
93
|
+
generateType?: RefineGenerateType;
|
|
94
|
+
}
|
|
95
|
+
export interface RefineSingleContentContext {
|
|
96
|
+
/**
|
|
97
|
+
* 是否是手动调优
|
|
98
|
+
*/
|
|
99
|
+
isManualPrompt?: boolean;
|
|
100
|
+
/**
|
|
101
|
+
* 调优关键词
|
|
102
|
+
*/
|
|
103
|
+
prompt?: string;
|
|
104
|
+
/**
|
|
105
|
+
* 调优快捷指令
|
|
106
|
+
*/
|
|
107
|
+
shortcutType?: RefineShortcutEunm;
|
|
108
|
+
/**
|
|
109
|
+
* 调优生成内容
|
|
110
|
+
*/
|
|
111
|
+
content?: string;
|
|
112
|
+
}
|
|
113
|
+
export declare enum ShortcutPosEnum {
|
|
114
|
+
底部 = 0,
|
|
115
|
+
顶部 = 1
|
|
116
|
+
}
|
|
117
|
+
export declare enum GeneratorPosEnum {
|
|
118
|
+
底部 = 0,
|
|
119
|
+
顶部 = 1
|
|
120
|
+
}
|
|
121
|
+
export declare enum SubShortcutPosEnum {
|
|
122
|
+
顶部对齐 = 0,
|
|
123
|
+
底部对齐 = 1
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* 段落分隔符
|
|
127
|
+
*/
|
|
128
|
+
export declare const SEPARATOR = "<br><br>";
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, SVGSVGElement>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, SVGSVGElement>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, SVGSVGElement>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, SVGSVGElement>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, SVGSVGElement>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, SVGSVGElement>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, SVGSVGElement>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, SVGSVGElement>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, SVGSVGElement>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, SVGSVGElement>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, SVGSVGElement>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, SVGSVGElement>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { GeneratorPosEnum, RefineGeneratorContext, ShortcutPosEnum, SubShortcutPosEnum } from './context';
|
|
2
|
+
export declare const useModalPos: (ctx: Omit<RefineGeneratorContext, "generatorPosition" | "shortcutPosition" | "subShortcutPosition" | "setGeneratorPosition" | "setShortcutPosition" | "setSubShortcutPosition" | "calcModalPosition">) => {
|
|
3
|
+
generatorPosition: import("vue").Ref<GeneratorPosEnum, GeneratorPosEnum>;
|
|
4
|
+
shortcutPosition: import("vue").Ref<ShortcutPosEnum, ShortcutPosEnum>;
|
|
5
|
+
subShortcutPosition: import("vue").Ref<SubShortcutPosEnum, SubShortcutPosEnum>;
|
|
6
|
+
setGeneratorPosition: import("../../../hooks/use-state").SetStateAction<GeneratorPosEnum>;
|
|
7
|
+
setShortcutPosition: import("../../../hooks/use-state").SetStateAction<ShortcutPosEnum>;
|
|
8
|
+
setSubShortcutPosition: import("../../../hooks/use-state").SetStateAction<SubShortcutPosEnum>;
|
|
9
|
+
calcModalPosition: () => void;
|
|
10
|
+
};
|
|
@@ -28,7 +28,7 @@ export interface AnchorData {
|
|
|
28
28
|
id: number;
|
|
29
29
|
}
|
|
30
30
|
export type AnchorMap = Record<string, AnchorData[]>;
|
|
31
|
-
export declare const useEditor: (editor: Ref<HTMLDivElement | undefined>, props: EditorComponentProps, emit: ((event: "change", contentLength: number) => void) & ((event: "update:textCount", value: number) => void) & ((event: "anchorListen", value: IAnchor, text: string) => void) & ((event: "anchorRemove", value: IAnchor) => void)) => {
|
|
31
|
+
export declare const useEditor: (editor: Ref<HTMLDivElement | undefined>, props: EditorComponentProps, emit: ((event: "change", contentLength: number) => void) & ((event: "update:textCount", value: number) => void) & ((event: "anchorListen", value: IAnchor, text: string) => void) & ((event: "anchorRemove", value: IAnchor) => void) & ((event: "clear") => void)) => {
|
|
32
32
|
editorCore: Ref<EditorCore<[]> | undefined, EditorCore<[]> | undefined>;
|
|
33
33
|
editorAction: Ref<EditorAction | undefined, EditorAction | undefined>;
|
|
34
34
|
count: Ref<number, number>;
|
|
@@ -44,11 +44,13 @@ export declare const useEditor: (editor: Ref<HTMLDivElement | undefined>, props:
|
|
|
44
44
|
isRange: () => boolean;
|
|
45
45
|
isSelectionInDifferentParas: () => boolean;
|
|
46
46
|
isSelectionContainsTag: (type: PluginFlag) => boolean;
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
convertToContent: (node: HTMLElement | Text) => string | undefined;
|
|
48
|
+
getAnchorTtsMark: (anchor: IAnchor, startFromCursor?: boolean) => string;
|
|
49
|
+
getAnchorTtsEmotionAndRole: (anchor: IAnchor) => [string, string | undefined];
|
|
49
50
|
isAllMarkedByAnchor: () => boolean;
|
|
50
51
|
addExtraAnchors: (data: IAnchor[]) => void;
|
|
51
52
|
clearContent: () => void;
|
|
53
|
+
insertContentAtCursor: (_content: string | string[]) => void;
|
|
52
54
|
renderHighlight: (matchingContent: string) => void;
|
|
53
55
|
unrenderHighlight: () => void;
|
|
54
56
|
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Ref, UnwrapRef } from 'vue';
|
|
2
|
+
export type SetStateAction<T> = (newValue: T) => void;
|
|
3
|
+
export type SetStateCallback<T, K = void> = (_newValue: T) => K;
|
|
4
|
+
export declare const useState: <T>(initialValue: T, callback?: SetStateCallback<T>, formatter?: SetStateCallback<T, T>) => [Ref<UnwrapRef<T>>, SetStateAction<T>];
|
|
@@ -15,11 +15,15 @@ export declare class AnchorTagPlugin<T extends Record<string, any> = {
|
|
|
15
15
|
constructor(editor: IEditorCore);
|
|
16
16
|
add(options: T): void;
|
|
17
17
|
remove(target: HTMLSpanElement): void;
|
|
18
|
+
private _insertOverlapAnchor;
|
|
18
19
|
private _recordAnchor;
|
|
19
20
|
private get _newAnchorId();
|
|
20
21
|
private _insertAnchorTag;
|
|
21
22
|
private _isIntersectOtherAnchors;
|
|
22
23
|
private _calcTopValue;
|
|
24
|
+
private _fixedAnchorSelection;
|
|
25
|
+
private _fixedAnchorOrder;
|
|
26
|
+
private _fixedAnchorHighlightContent;
|
|
23
27
|
/**
|
|
24
28
|
* MutationObserver 监听编辑器内容变化,当内容变化时重新计算 anchor 的 top 值。
|
|
25
29
|
*
|
|
@@ -4,10 +4,10 @@ type __VLS_Props = {
|
|
|
4
4
|
data: string[];
|
|
5
5
|
};
|
|
6
6
|
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
7
|
-
cancel: (e: Event) => any;
|
|
8
7
|
ok: (e: Event, text: string) => any;
|
|
8
|
+
cancel: (e: Event) => any;
|
|
9
9
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
10
|
-
onCancel?: ((e: Event) => any) | undefined;
|
|
11
10
|
onOk?: ((e: Event, text: string) => any) | undefined;
|
|
11
|
+
onCancel?: ((e: Event) => any) | undefined;
|
|
12
12
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, HTMLUListElement>;
|
|
13
13
|
export default _default;
|
|
@@ -4,10 +4,10 @@ type __VLS_Props = {
|
|
|
4
4
|
modelValue: string;
|
|
5
5
|
};
|
|
6
6
|
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
7
|
-
cancel: (e: Event) => any;
|
|
8
7
|
ok: (e: Event, text: string, oldText: string) => any;
|
|
8
|
+
cancel: (e: Event) => any;
|
|
9
9
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
10
|
-
onCancel?: ((e: Event) => any) | undefined;
|
|
11
10
|
onOk?: ((e: Event, text: string, oldText: string) => any) | undefined;
|
|
11
|
+
onCancel?: ((e: Event) => any) | undefined;
|
|
12
12
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
13
|
export default _default;
|
package/dist/tiny-peony.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.editor-pausation-tag-modal{position:absolute;width:80px}.tag-pausation{display:inline-flex;align-items:center;gap:4px;height:20px;padding:0 2px 0 9px;border-radius:16px;color:#c3772b;background-color:#fceee0;font-size:14px;font-weight:500;-webkit-user-select:none;user-select:none;cursor:pointer}.tag-pausation__close{font-size:20px;color:#0003;cursor:pointer}.tag-pausation__close:hover{color:#0000004d}.c-pausation-tag-selector[data-v-a957cba2]{background:#fff;box-shadow:0 4px 8px #0000001a;border-radius:8px;border:1px solid #f6f6f6;color:var(--color-text-2)}.c-pausation-tag-selector__item[data-v-a957cba2]{line-height:40px;text-indent:12px;font-size:14px;color:var(--color-text-2);cursor:pointer}.c-pausation-tag-selector__item[data-v-a957cba2]:hover{background-color:rgba(var(--primary-6),.1);color:rgba(var(--primary-6))}.editor-pronunciation-tag-modal{position:absolute;width:264px}.tag-pronunciation{display:inline-flex;align-items:center;gap:2px;margin:0 2px;-webkit-user-select:none;user-select:none;cursor:pointer}.tag-pronunciation__raw{color:rgba(var(--primary-6))}.tag-pronunciation__replace{display:inline-flex;align-items:center;gap:4px;height:20px;padding:0 2px 0 9px;background-color:rgba(var(--primary-6),.1);border-radius:16px;color:rgba(var(--primary-6))}.tag-pronunciation__replace-text{font-size:14px;font-weight:500}.tag-pronunciation__close{color:#0003}.tag-pronunciation__close:hover{color:#0000004d}.c-pronunciationor[data-v-e430f236]{padding:8px;background:#fff;box-shadow:0 4px 8px #0000001a;border-radius:4px;border:1px solid #f6f6f6}.c-pronunciationor__title[data-v-e430f236]{margin-bottom:8px;line-height:20px;color:#000000d9}.c-pronunciationor__content[data-v-e430f236]{margin-bottom:4px}.c-pronunciationor__footer[data-v-e430f236]{margin-top:8px}.tag-anchor{padding:5.5px 0}.editor-homophones-tag-modal{position:absolute;width:88px}.tag-homophones{display:inline-flex;align-items:center;gap:4px;margin:0 2px;line-height:1;-webkit-user-select:none;user-select:none;cursor:pointer}.tag-homophones__raw{color:rgba(var(--primary-6))}.tag-homophones__close{color:#0003}.tag-homophones__close:hover{color:#0000004d}.c-homophones[data-v-8471a3e1]{padding:8px;background:#fff;box-shadow:0 4px 8px #0000001a;border-radius:4px;border:1px solid #f6f6f6}.c-homophones__word[data-v-8471a3e1]{color:rgba(var(--primary-6));line-height:20px;text-align:center}.c-homophones__item[data-v-8471a3e1]{margin-top:8px;border-radius:4px;line-height:28px;border:1px solid rgba(0,0,0,.15);text-align:center;color:var(--color-text-2);transition:all .1s cubic-bezier(0,0,1,1);cursor:pointer}.c-homophones__item[data-v-8471a3e1]:hover{color:#fff;background-color:rgba(var(--primary-6))}.arco-modal-simple{padding:16px 24px!important}.arco-modal-simple .arco-modal-footer{text-align:right!important}.common-modal .arco-modal{border-radius:var(--border-radius-medium)}.common-modal .arco-modal-header{height:auto;padding:17px 24px 13px;border-top-left-radius:var(--border-radius-medium);border-top-right-radius:var(--border-radius-medium);line-height:22px}.common-modal .arco-modal-footer{border-top:none;padding:0 24px 24px}.common-modal .arco-modal-footer .arco-btn{border-radius:8px}.common-modal .arco-modal-body{padding:0 24px 20px}.common-modal .arco-modal-title{position:relative;font-weight:600}.common-modal .shim-icon{position:absolute;top:1px;left:2px;width:20px;height:20px;border-radius:50%;background:#fff}.common-modal .normal-icon{position:absolute;font-size:24px}.common-modal .normal-title{margin-left:32px}.common-modal .extra-opt{position:absolute;top:50%;right:30px;transform:translateY(-50%)}.common-modal .modal-title-icon{display:inline-block;width:20px;height:20px;border-radius:50%;margin-right:11px;font-weight:600;line-height:20px;text-align:center}.common-modal .modal-title-icon svg{color:#fff}.common-modal.no-header-border .arco-modal-header{border:none}.common-modal.hide-header-border .arco-modal-header{border-bottom:none}.common-modal.hide-header-border .arco-modal-body{padding-top:0}.common-modal__info .arco-modal-title-icon,.common-modal__success .arco-modal-title-icon,.common-modal__warning .arco-modal-title-icon,.common-modal__error .arco-modal-title-icon,.common-modal__confirm .arco-modal-title-icon,.common-modal__syncConfirm .arco-modal-title-icon{display:none}.common-modal-footer__left .arco-modal-footer{border-top:none;text-align:left}.common-modal-footer__right .arco-modal-footer{border-top:none;text-align:right}.common-modal-footer__center .arco-modal-footer{border-top:none;text-align:center}.common-modal.arco-modal-simple{padding:0}.common-modal.arco-modal-simple .arco-modal-header{margin:0}.common-modal.arco-modal-simple .arco-modal-body{padding-top:0}.common-modal.arco-modal-simple .arco-modal-footer{margin:0;text-align:right}.c-quick-context-menu[data-v-70332ebc]{position:fixed;z-index:100;width:80px;background:#fff;box-shadow:0 4px 8px #0000001a;border-radius:8px;border:1px solid #f6f6f6}.c-quick-context-menu__action-item[data-v-70332ebc]{line-height:40px;text-align:center;color:var(--color-text-2);font-size:14px;cursor:pointer}.c-quick-context-menu__action-item[data-v-70332ebc]:hover{color:rgba(var(--primary-6));background-color:rgba(var(--primary-6),.1)}.c-quick-context-menu .pausation[data-v-70332ebc]{display:flex;position:absolute;top:0;left:78px}.c-quick-context-menu .pausation .fill[data-v-70332ebc]{display:inline-block;width:2px;height:202px;background:transparent}.c-quick-context-menu .pausation .pausationor[data-v-70332ebc]{width:80px;flex-shrink:0}.c-editor-container{position:relative;width:100%;height:100%;padding-bottom:62px;overflow-y:auto}.c-editor-container__core{display:flex;flex-direction:row;width:100%;height:100%;overflow-y:auto}.c-editor-container__core-content{padding-top:16px;padding-right:16px;flex:1;outline:none}.c-editor-container__core-content-editor{position:relative;height:100%;line-height:28px}.c-editor-container__core-content-editor-placeholder{position:absolute;left:0;right:0;top:0;text-indent:20px;font-size:16px;color:gray;line-height:34px;pointer-events:none}.c-editor-container__core-content-editor-content{position:relative;height:100%;outline:none}.c-editor-container__core-anchor{position:relative;flex-shrink:0;width:344px}.c-editor-container__core-anchor-empty{position:fixed;top:50%;right:45px;width:340px;height:auto;transform:translateY(-50%)}.c-editor-container__status{display:flex;justify-content:space-between;align-items:center;position:absolute;left:0;bottom:0;width:calc(100% - 344px);padding:15px}.c-editor-container__status-clear{transform:translate(-15px)}.c-editor-container__status-info{display:flex;flex-direction:row;align-items:center;justify-content:flex-end;column-gap:16px;width:100%}.c-editor-container__status-info-label,.c-editor-container__status-info-length{font-weight:400;font-size:14px;color:var(--color-text-3)}.c-editor-container__status-info-length:first-child{margin-right:2px;color:rgb(var(--arcoblue-6))}.c-editor-container__status--simple{width:100%}.c-editor-container__status--simple .c-editor-container__status-info-length:first-child{margin-right:0;color:var(--color-text-3)}.c-editor-container__status--disabled{cursor:not-allowed}.c-editor-container__splitor{position:absolute;right:344px;top:0;bottom:0;border-left:1px solid var(--color-neutral-3)}.c-editor-container__anchor-placeholder{position:absolute;top:0;right:0;bottom:0;display:flex;justify-content:center;align-items:center}.c-editor-container__anchor-placeholder>img{display:block;width:340px;height:auto;transform:translateY(-20%)}.c-editor-container .highlight{color:rgba(var(--success-6))}.c-editor-container .tag-audit-highlight{background-color:rgba(var(--danger-6))!important;color:#fff!important}.c-editor-container--disabled{cursor:not-allowed}.c-anchor-item{position:relative;padding-left:2px;padding-right:6px;width:304px;height:32px;display:inline-flex;flex-direction:row;align-items:center;border-radius:16px}.c-anchor-item__avatar{width:28px;height:28px;border-radius:14px}.c-anchor-item__info{padding-left:8px;display:flex;flex:1;flex-direction:row;align-items:center}.c-anchor-item__info-name,.c-anchor-item__info-speed-volume{flex-shrink:0;font-weight:500;font-size:16px;color:#00000073;line-height:24px}.c-anchor-item__info-name{flex:1;max-width:85px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.c-anchor-item__info-speed-volume{margin-right:9px}.c-anchor-item__info-rem,.c-anchor-item__info-play{font-size:18px;cursor:pointer}.c-anchor-item__info-rem{margin-right:4px;color:#1e1e1e33!important}.c-anchor-item__info-play{color:#00000040!important}.c-anchor-item__rem{display:none;position:absolute;top:5px;right:2px;font-size:14px;color:#1e1e1e33;transform:translate3d(10px,-12px,0);cursor:pointer}.c-anchor-item__btn-layer{display:none;position:absolute;top:0;bottom:0;right:0;left:0;background:#0000004d;border-radius:50%;cursor:pointer}.c-anchor-item__btn-layer .c-anchor-item__info-play{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);color:#fff!important}.c-anchor-item:not(:last-child){margin-right:8px}.c-anchor-item:hover .c-anchor-item__btn-layer{background:#0000004d;display:block}.c-anchor-item:hover .c-anchor-item__rem{display:block}.multi-anchor .c-anchor-item{padding-right:2px;width:unset}.c-paragraph{text-indent:20px;font-size:16px;color:var(--color-text-1);line-height:34px;word-break:break-all}.c-paragraph:not(:last-child){margin-bottom:16px}.c-paragraph *{text-indent:0}
|
|
1
|
+
.editor-pausation-tag-modal{position:absolute;width:80px}.tag-pausation{display:inline-flex;align-items:center;gap:4px;height:20px;padding:0 2px 0 9px;border-radius:16px;color:#c3772b;background-color:#fceee0;font-size:14px;font-weight:500;-webkit-user-select:none;user-select:none;cursor:pointer}.tag-pausation__close{font-size:20px;color:#0003;cursor:pointer}.tag-pausation__close:hover{color:#0000004d}.c-pausation-tag-selector[data-v-a957cba2]{background:#fff;box-shadow:0 4px 8px #0000001a;border-radius:8px;border:1px solid #f6f6f6;color:var(--color-text-2)}.c-pausation-tag-selector__item[data-v-a957cba2]{line-height:40px;text-indent:12px;font-size:14px;color:var(--color-text-2);cursor:pointer}.c-pausation-tag-selector__item[data-v-a957cba2]:hover{background-color:rgba(var(--primary-6),.1);color:rgba(var(--primary-6))}.editor-pronunciation-tag-modal{position:absolute;width:264px}.tag-pronunciation{display:inline-flex;align-items:center;gap:2px;margin:0 2px;-webkit-user-select:none;user-select:none;cursor:pointer}.tag-pronunciation__raw{color:rgba(var(--primary-6))}.tag-pronunciation__replace{display:inline-flex;align-items:center;gap:4px;height:20px;padding:0 2px 0 9px;background-color:rgba(var(--primary-6),.1);border-radius:16px;color:rgba(var(--primary-6))}.tag-pronunciation__replace-text{font-size:14px;font-weight:500}.tag-pronunciation__close{color:#0003}.tag-pronunciation__close:hover{color:#0000004d}.c-pronunciationor[data-v-e430f236]{padding:8px;background:#fff;box-shadow:0 4px 8px #0000001a;border-radius:4px;border:1px solid #f6f6f6}.c-pronunciationor__title[data-v-e430f236]{margin-bottom:8px;line-height:20px;color:#000000d9}.c-pronunciationor__content[data-v-e430f236]{margin-bottom:4px}.c-pronunciationor__footer[data-v-e430f236]{margin-top:8px}.tag-anchor{padding:5.5px 0}.editor-homophones-tag-modal{position:absolute;width:88px}.tag-homophones{display:inline-flex;align-items:center;gap:4px;margin:0 2px;line-height:1;-webkit-user-select:none;user-select:none;cursor:pointer}.tag-homophones__raw{color:rgba(var(--primary-6))}.tag-homophones__close{color:#0003}.tag-homophones__close:hover{color:#0000004d}.c-homophones[data-v-8471a3e1]{padding:8px;background:#fff;box-shadow:0 4px 8px #0000001a;border-radius:4px;border:1px solid #f6f6f6}.c-homophones__word[data-v-8471a3e1]{color:rgba(var(--primary-6));line-height:20px;text-align:center}.c-homophones__item[data-v-8471a3e1]{margin-top:8px;border-radius:4px;line-height:28px;border:1px solid rgba(0,0,0,.15);text-align:center;color:var(--color-text-2);transition:all .1s cubic-bezier(0,0,1,1);cursor:pointer}.c-homophones__item[data-v-8471a3e1]:hover{color:#fff;background-color:rgba(var(--primary-6))}.arco-modal-simple{padding:16px 24px!important}.arco-modal-simple .arco-modal-footer{text-align:right!important}.common-modal .arco-modal{border-radius:var(--border-radius-medium)}.common-modal .arco-modal-header{height:auto;padding:17px 24px 13px;border-top-left-radius:var(--border-radius-medium);border-top-right-radius:var(--border-radius-medium);line-height:22px}.common-modal .arco-modal-footer{border-top:none;padding:0 24px 24px}.common-modal .arco-modal-footer .arco-btn{border-radius:8px}.common-modal .arco-modal-body{padding:0 24px 20px}.common-modal .arco-modal-title{position:relative;font-weight:600}.common-modal .shim-icon{position:absolute;top:1px;left:2px;width:20px;height:20px;border-radius:50%;background:#fff}.common-modal .normal-icon{position:absolute;font-size:24px}.common-modal .normal-title{margin-left:32px}.common-modal .extra-opt{position:absolute;top:50%;right:30px;transform:translateY(-50%)}.common-modal .modal-title-icon{display:inline-block;width:20px;height:20px;border-radius:50%;margin-right:11px;font-weight:600;line-height:20px;text-align:center}.common-modal .modal-title-icon svg{color:#fff}.common-modal.no-header-border .arco-modal-header{border:none}.common-modal.hide-header-border .arco-modal-header{border-bottom:none}.common-modal.hide-header-border .arco-modal-body{padding-top:0}.common-modal__info .arco-modal-title-icon,.common-modal__success .arco-modal-title-icon,.common-modal__warning .arco-modal-title-icon,.common-modal__error .arco-modal-title-icon,.common-modal__confirm .arco-modal-title-icon,.common-modal__syncConfirm .arco-modal-title-icon{display:none}.common-modal-footer__left .arco-modal-footer{border-top:none;text-align:left}.common-modal-footer__right .arco-modal-footer{border-top:none;text-align:right}.common-modal-footer__center .arco-modal-footer{border-top:none;text-align:center}.common-modal.arco-modal-simple{padding:0}.common-modal.arco-modal-simple .arco-modal-header{margin:0}.common-modal.arco-modal-simple .arco-modal-body{padding-top:0}.common-modal.arco-modal-simple .arco-modal-footer{margin:0;text-align:right}.c-quick-context-menu[data-v-2c4a9bcb]{position:fixed;z-index:100;width:80px;background:#fff;box-shadow:0 4px 8px #0000001a;border-radius:8px;border:1px solid #f6f6f6}.c-quick-context-menu__action-item[data-v-2c4a9bcb]{line-height:40px;text-align:center;color:var(--color-text-2);font-size:14px;cursor:pointer}.c-quick-context-menu__action-item[data-v-2c4a9bcb]:hover{color:rgba(var(--primary-6));background-color:rgba(var(--primary-6),.1)}.c-quick-context-menu .pausation[data-v-2c4a9bcb]{display:flex;position:absolute;top:0;left:78px}.c-quick-context-menu .pausation .fill[data-v-2c4a9bcb]{display:inline-block;width:2px;height:202px;background:transparent}.c-quick-context-menu .pausation .pausationor[data-v-2c4a9bcb]{width:80px;flex-shrink:0}.c-refine-generator-wrapper{position:absolute}.c-refine-generator-wrapper__inner{position:relative;float:left;width:100%}.c-refine-generator{width:100%!important;border:1px solid rgba(var(--primary-6));border-radius:20px;overflow:hidden;box-shadow:0 8px 20px #0000001a}.c-refine-content{padding:20px 20px 12px;border-bottom:1px solid var(--color-border-2);background-color:#fff}.c-refine-content__content{font-size:16px;line-height:24px;text-align:justify;letter-spacing:0;max-height:144px;overflow-y:auto}.c-refine-content__operation{margin-top:24px;justify-content:space-between}.c-refine-input{height:60px;background-color:#fff;overflow:hidden}.c-refine-input .arco-input-wrapper{height:100%;border:none;border-radius:20px;background-color:#fff!important}.c-refine-input .arco-input-wrapper .arco-input{font-size:16px!important}.c-refine-input .arco-input-wrapper .arco-input::placeholder{font-size:16px!important}.c-refine-input__send{display:inline-block;width:36px;height:36px;border-radius:50%;line-height:36px;text-align:center;background-color:rgba(var(--primary-6));color:#fff;cursor:pointer}.c-refine-input__send--disabled{background-color:rgba(var(--primary-3))!important;cursor:not-allowed}.c-refine-input__send:active{background-color:rgba(var(--primary-7))}.c-refine-input--generating input[placeholder]{color:rgba(var(--primary-6))!important;opacity:.6!important;-webkit-text-fill-color:rgba(var(--primary-6))!important}.c-refine-input--contentable{background-color:#fff}.c-refine-shortcut{display:block;position:absolute;width:162px;margin-left:5px;color:var(--color-text-1)}.c-refine-shortcut__shortcut{border-radius:var(--border-radius-medium);overflow:hidden;background-color:#fff;box-shadow:0 0 7px #0000001a}.c-refine-shortcut__shortcut-item{width:100%;height:32px;padding:4px 10px 4px 20px;line-height:24px;cursor:pointer}.c-refine-shortcut__shortcut-item:hover{background-color:var(--color-fill-2)}.c-refine-shortcut__shortcut .sub-wrapper{position:absolute;left:162px;width:178px;padding:8px}.c-refine-toolbar{position:absolute;height:40px;border-radius:8px;opacity:1;background:#fff;box-sizing:border-box;box-shadow:0 8px 16px #0000001a;display:flex;justify-content:center;align-items:center;padding:0 4px;line-height:34px;border:1px solid var(--color-border-2)}.c-refine-toolbar__item{flex-shrink:0;display:flex;align-items:center;gap:8px;padding:8px;cursor:pointer;border-radius:8px;line-height:1}.c-refine-toolbar__item:hover{background-color:var(--color-fill-2)}.c-editor-container__wrapper{position:relative;height:100%;overflow:hidden}.c-editor-container{position:relative;width:100%;overflow-y:auto}.c-editor-container__core{display:flex;flex-direction:row;width:100%}.c-editor-container__core-content{padding-top:16px;padding-right:16px;flex:1;outline:none}.c-editor-container__core-content-editor{position:relative;height:100%;line-height:28px}.c-editor-container__core-content-editor-placeholder{position:absolute;left:0;right:0;top:0;text-indent:20px;font-size:16px;color:gray;line-height:34px;pointer-events:none}.c-editor-container__core-content-editor-content{position:relative;height:100%;outline:none}.c-editor-container__core-anchor{position:relative;flex-shrink:0;width:344px}.c-editor-container__core-anchor-empty{position:fixed;top:50%;right:45px;width:340px;height:auto;transform:translateY(-50%)}.c-editor-container__status{display:flex;justify-content:space-between;align-items:center;position:absolute;left:0;bottom:0;width:calc(100% - 344px);padding:15px}.c-editor-container__status-clear{transform:translate(-15px)}.c-editor-container__status-info{display:flex;flex-direction:row;align-items:center;justify-content:flex-end;column-gap:16px;width:100%}.c-editor-container__status-info-label,.c-editor-container__status-info-length{font-weight:400;font-size:14px;color:var(--color-text-3)}.c-editor-container__status-info-length:first-child{margin-right:2px;color:rgb(var(--arcoblue-6))}.c-editor-container__status--simple{width:100%}.c-editor-container__status--simple .c-editor-container__status-info-length:first-child{margin-right:0;color:var(--color-text-3)}.c-editor-container__status--disabled{cursor:not-allowed}.c-editor-container__splitor{position:absolute;right:344px;top:0;bottom:0;border-left:1px solid var(--color-neutral-3)}.c-editor-container__anchor-placeholder{position:absolute;top:0;right:0;bottom:0;display:flex;justify-content:center;align-items:center}.c-editor-container__anchor-placeholder>img{display:block;width:340px;height:auto;transform:translateY(-20%)}.c-editor-container .highlight{color:rgba(var(--success-6))}.c-editor-container .tag-audit-highlight{background-color:rgba(var(--danger-6))!important;color:#fff!important}.c-editor-container--disabled{cursor:not-allowed}.c-anchor-item{position:relative;padding-left:2px;padding-right:6px;width:304px;height:32px;display:inline-flex;flex-direction:row;align-items:center;border-radius:16px}.c-anchor-item__avatar{width:28px;height:28px;border-radius:14px}.c-anchor-item__info{padding-left:8px;display:flex;flex:1;flex-direction:row;align-items:center}.c-anchor-item__info-name,.c-anchor-item__info-speed-volume{flex-shrink:0;font-weight:500;font-size:16px;color:#00000073;line-height:24px}.c-anchor-item__info-name{flex:1;max-width:85px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.c-anchor-item__info-speed-volume{margin-right:9px}.c-anchor-item__info-rem,.c-anchor-item__info-play{font-size:18px;cursor:pointer}.c-anchor-item__info-rem{margin-right:4px;color:#1e1e1e33!important}.c-anchor-item__info-play{color:#00000040!important}.c-anchor-item__rem{display:none;position:absolute;top:5px;right:2px;font-size:14px;color:#1e1e1e33;transform:translate3d(10px,-12px,0);cursor:pointer}.c-anchor-item__btn-layer{display:none;position:absolute;top:0;bottom:0;right:0;left:0;background:#0000004d;border-radius:50%;cursor:pointer}.c-anchor-item__btn-layer .c-anchor-item__info-play{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);color:#fff!important}.c-anchor-item:hover .c-anchor-item__btn-layer{background:#0000004d;display:block}.c-anchor-item:hover .c-anchor-item__rem{display:block}.c-anchor-item+.c-anchor-item{margin-left:8px}.multi-anchor .c-anchor-item{padding-right:2px;width:unset}.c-paragraph{text-indent:20px;font-size:16px;color:var(--color-text-1);line-height:34px;word-break:break-all}.c-paragraph:not(:last-child){margin-bottom:16px}.c-paragraph *{text-indent:0}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { RefineContext } from '../../intersection/components/editor/context';
|
|
1
2
|
import { ListenModeEnum } from '../shared';
|
|
2
3
|
export interface EditorComponentProps {
|
|
3
4
|
/**
|
|
@@ -15,7 +16,7 @@ export interface EditorComponentProps {
|
|
|
15
16
|
/**
|
|
16
17
|
* 试听虚拟主播ID
|
|
17
18
|
*/
|
|
18
|
-
listenAnchorId:
|
|
19
|
+
listenAnchorId: string;
|
|
19
20
|
/**
|
|
20
21
|
* 试听模式:单主播试听 | 整体试听
|
|
21
22
|
*/
|
|
@@ -32,6 +33,14 @@ export interface EditorComponentProps {
|
|
|
32
33
|
* 最大字数
|
|
33
34
|
*/
|
|
34
35
|
maxLength: number;
|
|
36
|
+
/**
|
|
37
|
+
* 是否开启调优
|
|
38
|
+
*/
|
|
39
|
+
refinable: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* 调优上下文
|
|
42
|
+
*/
|
|
43
|
+
refineContext?: RefineContext;
|
|
35
44
|
/**
|
|
36
45
|
* 是否显示预计时长
|
|
37
46
|
*/
|
package/dist/utils/dom.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PluginFlag } from '../typings';
|
|
1
|
+
import { IAnchor, PluginFlag } from '../typings';
|
|
2
2
|
export declare const setAttributesAndData: (element: HTMLElement, attributes: Record<string, string | number | boolean>, dataAttributes: Record<string, string | number>, child?: string | Node) => void;
|
|
3
3
|
export declare const findParent: (element: HTMLElement, _conditions: ((element: HTMLElement) => boolean) | Array<(element: HTMLElement) => boolean>) => (HTMLElement | null)[];
|
|
4
4
|
export declare const findClosestPara: (startElm: HTMLElement) => HTMLElement | null;
|
|
@@ -35,3 +35,21 @@ export declare const longestConsecutiveSubsequence: (text1: string, text2: strin
|
|
|
35
35
|
export declare const isCursorAtParagraphEnd: () => boolean;
|
|
36
36
|
export declare const ensureCaretInParagraph: (editor: HTMLElement) => void;
|
|
37
37
|
export declare const clearParagraphKeep: (pElm: HTMLElement, selection: Selection) => void;
|
|
38
|
+
/**
|
|
39
|
+
* 将弹窗元素定位到目标元素下方(relative to parentEl)
|
|
40
|
+
* @param {DOMRect} parentDOMRect - 父元素DOMRect
|
|
41
|
+
* @param {DOMRect} targetDOMRect - 目标元素DOMRect
|
|
42
|
+
* @param {number} offset - 距离 span 底部的间距,默认 6px
|
|
43
|
+
*/
|
|
44
|
+
export declare const positionPopupUnderSpan: (parentDomRect?: DOMRect, spanDomRect?: DOMRect, offset?: number) => {
|
|
45
|
+
top: number;
|
|
46
|
+
left: number;
|
|
47
|
+
width: number;
|
|
48
|
+
height: number;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* 获取指定ID的锚点标签
|
|
52
|
+
* @param {IAnchor} anchor - 锚点信息
|
|
53
|
+
* @return {HTMLElement[]} - 锚点标签数组
|
|
54
|
+
*/
|
|
55
|
+
export declare const getAnchorTagsByUidAndId: (anchor: IAnchor) => HTMLElement[];
|
package/dist/utils/shared.d.ts
CHANGED
|
@@ -1,2 +1,13 @@
|
|
|
1
1
|
export declare const createTagSpace: (name: string) => [import("@linker-design/utils").Bem, string];
|
|
2
2
|
export declare const createComponentSpace: (name: string) => [import("@linker-design/utils").Bem, string];
|
|
3
|
+
/**
|
|
4
|
+
* 创建一个带 requestAnimationFrame 的事件回调包装器
|
|
5
|
+
* @param callback - 需要在动画帧中执行的函数
|
|
6
|
+
* @returns 可直接作为事件监听器使用的包装函数
|
|
7
|
+
*/
|
|
8
|
+
export declare const withRaf: <T extends (...args: any[]) => void>(callback: T) => (...args: Parameters<T>) => void;
|
|
9
|
+
/**
|
|
10
|
+
* 当前页面是否是 HTTPS
|
|
11
|
+
* @returns {boolean}
|
|
12
|
+
*/
|
|
13
|
+
export declare const isHttps: () => boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@linker-design-plus/tiny-peony",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.22",
|
|
4
4
|
"description": "a simple editor",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -8,11 +8,6 @@
|
|
|
8
8
|
"registry": "https://registry.npmjs.org/",
|
|
9
9
|
"access": "public"
|
|
10
10
|
},
|
|
11
|
-
"scripts": {
|
|
12
|
-
"startup": "pnpm build",
|
|
13
|
-
"build": "pnpm clean && vue-tsc --noEmit && vite build && vue-tsc --declaration --emitDeclarationOnly --outDir dist",
|
|
14
|
-
"clean": "rm -rf dist"
|
|
15
|
-
},
|
|
16
11
|
"files": [
|
|
17
12
|
"dist"
|
|
18
13
|
],
|
|
@@ -39,5 +34,10 @@
|
|
|
39
34
|
"typescript": "^5.7.2",
|
|
40
35
|
"vite": "^6.0.7",
|
|
41
36
|
"vue-tsc": "^2.2.0"
|
|
37
|
+
},
|
|
38
|
+
"scripts": {
|
|
39
|
+
"startup": "pnpm build",
|
|
40
|
+
"build": "pnpm clean && vue-tsc --noEmit && vite build && vue-tsc --declaration --emitDeclarationOnly --outDir dist",
|
|
41
|
+
"clean": "rm -rf dist"
|
|
42
42
|
}
|
|
43
43
|
}
|