@linker-design-plus/tiny-peony 1.4.2 → 1.4.4
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 +18 -12
- package/dist/index.js +37 -37
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3238 -3078
- package/dist/index.mjs.map +1 -1
- package/dist/intersection/components/editor/context.d.ts +2 -2
- package/dist/intersection/components/editor/editor.d.ts +6 -4
- package/dist/intersection/components/editor/index.d.ts +18 -12
- package/dist/intersection/hooks/use-editor.d.ts +2 -2
- package/dist/plugins/AnchorTagPlugin/plugin.d.ts +2 -0
- package/dist/typings/actions/i-anchor.d.ts +8 -0
- package/dist/utils/dom.d.ts +7 -1
- package/package.json +1 -1
|
@@ -34,8 +34,8 @@ export interface EditorContext {
|
|
|
34
34
|
isCaret: () => boolean;
|
|
35
35
|
isRange: () => boolean;
|
|
36
36
|
isSelectionContainsTag: (type: PluginFlag) => boolean;
|
|
37
|
-
getAnchorTtsMark: (
|
|
38
|
-
getAnchorTtsEmotionAndRole: (
|
|
37
|
+
getAnchorTtsMark: (anchor: IAnchor, startFromCursor?: boolean) => string;
|
|
38
|
+
getAnchorTtsEmotionAndRole: (anchor: IAnchor) => [string, string | undefined];
|
|
39
39
|
isAllMarkedByAnchor: () => boolean;
|
|
40
40
|
addExtraAnchors: (data: IAnchor[]) => void;
|
|
41
41
|
clearContent: () => void;
|
|
@@ -86,10 +86,11 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
86
86
|
innerIsRange: () => boolean;
|
|
87
87
|
innerIsSelectionInDifferentParas: () => boolean;
|
|
88
88
|
innerIsSelectionContainsTag: (type: PluginFlag) => boolean;
|
|
89
|
-
innerGetAnchorTtsMark: (
|
|
90
|
-
innerGetAnchorTtsEmotionAndRole: (
|
|
89
|
+
innerGetAnchorTtsMark: (anchor: IAnchor, startFromCursor?: boolean) => string;
|
|
90
|
+
innerGetAnchorTtsEmotionAndRole: (anchor: IAnchor) => [string, string | undefined];
|
|
91
91
|
innerIsAllMarkedByAnchor: () => boolean;
|
|
92
92
|
innerAddExtraAnchors: (data: IAnchor[]) => void;
|
|
93
|
+
innerUpdateAnchor: (newAnchor: IAnchor) => void;
|
|
93
94
|
innerClearContent: () => void;
|
|
94
95
|
innerInsertContentAtCursor: (_content: string | string[]) => void;
|
|
95
96
|
innerRenderHightlight: (matchingContent: string) => void;
|
|
@@ -108,10 +109,11 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
108
109
|
isRange(): boolean;
|
|
109
110
|
isSelectionInDifferentParas(): boolean;
|
|
110
111
|
isSelectionContainsTag(type: PluginFlag): boolean;
|
|
111
|
-
getAnchorTtsMark(
|
|
112
|
-
getAnchorTtsEmotionAndRole(
|
|
112
|
+
getAnchorTtsMark(anchor: IAnchor, startFromCursor?: boolean): string;
|
|
113
|
+
getAnchorTtsEmotionAndRole(anchor: IAnchor): [string, string | undefined];
|
|
113
114
|
isAllMarkedByAnchor(): boolean;
|
|
114
115
|
addExtraAnchors(data: IAnchor[]): void;
|
|
116
|
+
updateAnchor(anchor: IAnchor): void;
|
|
115
117
|
clearContent(): void;
|
|
116
118
|
insertContentAtCursor(_content: string | string[]): void;
|
|
117
119
|
clear(): Promise<void>;
|
|
@@ -86,10 +86,11 @@ declare const EditorContainer: {
|
|
|
86
86
|
innerIsRange: () => boolean;
|
|
87
87
|
innerIsSelectionInDifferentParas: () => boolean;
|
|
88
88
|
innerIsSelectionContainsTag: (type: import("../../..").PluginFlag) => boolean;
|
|
89
|
-
innerGetAnchorTtsMark: (
|
|
90
|
-
innerGetAnchorTtsEmotionAndRole: (
|
|
89
|
+
innerGetAnchorTtsMark: (anchor: import("../../..").IAnchor, startFromCursor?: boolean) => string;
|
|
90
|
+
innerGetAnchorTtsEmotionAndRole: (anchor: import("../../..").IAnchor) => [string, string | undefined];
|
|
91
91
|
innerIsAllMarkedByAnchor: () => boolean;
|
|
92
92
|
innerAddExtraAnchors: (data: import("../../..").IAnchor[]) => void;
|
|
93
|
+
innerUpdateAnchor: (newAnchor: import("../../..").IAnchor) => void;
|
|
93
94
|
innerClearContent: () => void;
|
|
94
95
|
innerInsertContentAtCursor: (_content: string | string[]) => void;
|
|
95
96
|
innerRenderHightlight: (matchingContent: string) => void;
|
|
@@ -108,10 +109,11 @@ declare const EditorContainer: {
|
|
|
108
109
|
isRange(): boolean;
|
|
109
110
|
isSelectionInDifferentParas(): boolean;
|
|
110
111
|
isSelectionContainsTag(type: import("../../..").PluginFlag): boolean;
|
|
111
|
-
getAnchorTtsMark(
|
|
112
|
-
getAnchorTtsEmotionAndRole(
|
|
112
|
+
getAnchorTtsMark(anchor: import("../../..").IAnchor, startFromCursor?: boolean): string;
|
|
113
|
+
getAnchorTtsEmotionAndRole(anchor: import("../../..").IAnchor): [string, string | undefined];
|
|
113
114
|
isAllMarkedByAnchor(): boolean;
|
|
114
115
|
addExtraAnchors(data: import("../../..").IAnchor[]): void;
|
|
116
|
+
updateAnchor(anchor: import("../../..").IAnchor): void;
|
|
115
117
|
clearContent(): void;
|
|
116
118
|
insertContentAtCursor(_content: string | string[]): void;
|
|
117
119
|
clear(): Promise<void>;
|
|
@@ -230,10 +232,11 @@ declare const EditorContainer: {
|
|
|
230
232
|
innerIsRange: () => boolean;
|
|
231
233
|
innerIsSelectionInDifferentParas: () => boolean;
|
|
232
234
|
innerIsSelectionContainsTag: (type: import("../../..").PluginFlag) => boolean;
|
|
233
|
-
innerGetAnchorTtsMark: (
|
|
234
|
-
innerGetAnchorTtsEmotionAndRole: (
|
|
235
|
+
innerGetAnchorTtsMark: (anchor: import("../../..").IAnchor, startFromCursor?: boolean) => string;
|
|
236
|
+
innerGetAnchorTtsEmotionAndRole: (anchor: import("../../..").IAnchor) => [string, string | undefined];
|
|
235
237
|
innerIsAllMarkedByAnchor: () => boolean;
|
|
236
238
|
innerAddExtraAnchors: (data: import("../../..").IAnchor[]) => void;
|
|
239
|
+
innerUpdateAnchor: (newAnchor: import("../../..").IAnchor) => void;
|
|
237
240
|
innerClearContent: () => void;
|
|
238
241
|
innerInsertContentAtCursor: (_content: string | string[]) => void;
|
|
239
242
|
innerRenderHightlight: (matchingContent: string) => void;
|
|
@@ -252,10 +255,11 @@ declare const EditorContainer: {
|
|
|
252
255
|
isRange(): boolean;
|
|
253
256
|
isSelectionInDifferentParas(): boolean;
|
|
254
257
|
isSelectionContainsTag(type: import("../../..").PluginFlag): boolean;
|
|
255
|
-
getAnchorTtsMark(
|
|
256
|
-
getAnchorTtsEmotionAndRole(
|
|
258
|
+
getAnchorTtsMark(anchor: import("../../..").IAnchor, startFromCursor?: boolean): string;
|
|
259
|
+
getAnchorTtsEmotionAndRole(anchor: import("../../..").IAnchor): [string, string | undefined];
|
|
257
260
|
isAllMarkedByAnchor(): boolean;
|
|
258
261
|
addExtraAnchors(data: import("../../..").IAnchor[]): void;
|
|
262
|
+
updateAnchor(anchor: import("../../..").IAnchor): void;
|
|
259
263
|
clearContent(): void;
|
|
260
264
|
insertContentAtCursor(_content: string | string[]): void;
|
|
261
265
|
clear(): Promise<void>;
|
|
@@ -365,10 +369,11 @@ declare const EditorContainer: {
|
|
|
365
369
|
innerIsRange: () => boolean;
|
|
366
370
|
innerIsSelectionInDifferentParas: () => boolean;
|
|
367
371
|
innerIsSelectionContainsTag: (type: import("../../..").PluginFlag) => boolean;
|
|
368
|
-
innerGetAnchorTtsMark: (
|
|
369
|
-
innerGetAnchorTtsEmotionAndRole: (
|
|
372
|
+
innerGetAnchorTtsMark: (anchor: import("../../..").IAnchor, startFromCursor?: boolean) => string;
|
|
373
|
+
innerGetAnchorTtsEmotionAndRole: (anchor: import("../../..").IAnchor) => [string, string | undefined];
|
|
370
374
|
innerIsAllMarkedByAnchor: () => boolean;
|
|
371
375
|
innerAddExtraAnchors: (data: import("../../..").IAnchor[]) => void;
|
|
376
|
+
innerUpdateAnchor: (newAnchor: import("../../..").IAnchor) => void;
|
|
372
377
|
innerClearContent: () => void;
|
|
373
378
|
innerInsertContentAtCursor: (_content: string | string[]) => void;
|
|
374
379
|
innerRenderHightlight: (matchingContent: string) => void;
|
|
@@ -387,10 +392,11 @@ declare const EditorContainer: {
|
|
|
387
392
|
isRange(): boolean;
|
|
388
393
|
isSelectionInDifferentParas(): boolean;
|
|
389
394
|
isSelectionContainsTag(type: import("../../..").PluginFlag): boolean;
|
|
390
|
-
getAnchorTtsMark(
|
|
391
|
-
getAnchorTtsEmotionAndRole(
|
|
395
|
+
getAnchorTtsMark(anchor: import("../../..").IAnchor, startFromCursor?: boolean): string;
|
|
396
|
+
getAnchorTtsEmotionAndRole(anchor: import("../../..").IAnchor): [string, string | undefined];
|
|
392
397
|
isAllMarkedByAnchor(): boolean;
|
|
393
398
|
addExtraAnchors(data: import("../../..").IAnchor[]): void;
|
|
399
|
+
updateAnchor(anchor: import("../../..").IAnchor): void;
|
|
394
400
|
clearContent(): void;
|
|
395
401
|
insertContentAtCursor(_content: string | string[]): void;
|
|
396
402
|
clear(): Promise<void>;
|
|
@@ -44,8 +44,8 @@ export declare const useEditor: (editor: Ref<HTMLDivElement | undefined>, props:
|
|
|
44
44
|
isRange: () => boolean;
|
|
45
45
|
isSelectionInDifferentParas: () => boolean;
|
|
46
46
|
isSelectionContainsTag: (type: PluginFlag) => boolean;
|
|
47
|
-
getAnchorTtsMark: (
|
|
48
|
-
getAnchorTtsEmotionAndRole: (
|
|
47
|
+
getAnchorTtsMark: (anchor: IAnchor, startFromCursor?: boolean) => string;
|
|
48
|
+
getAnchorTtsEmotionAndRole: (anchor: IAnchor) => [string, string | undefined];
|
|
49
49
|
isAllMarkedByAnchor: () => boolean;
|
|
50
50
|
addExtraAnchors: (data: IAnchor[]) => void;
|
|
51
51
|
clearContent: () => void;
|
|
@@ -15,11 +15,13 @@ 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;
|
|
23
25
|
/**
|
|
24
26
|
* MutationObserver 监听编辑器内容变化,当内容变化时重新计算 anchor 的 top 值。
|
|
25
27
|
*
|
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;
|
|
@@ -47,3 +47,9 @@ export declare const positionPopupUnderSpan: (parentDomRect?: DOMRect, spanDomRe
|
|
|
47
47
|
width: number;
|
|
48
48
|
height: number;
|
|
49
49
|
};
|
|
50
|
+
/**
|
|
51
|
+
* 获取指定ID的锚点标签
|
|
52
|
+
* @param {IAnchor} anchor - 锚点信息
|
|
53
|
+
* @return {HTMLElement[]} - 锚点标签数组
|
|
54
|
+
*/
|
|
55
|
+
export declare const getAnchorTagsByUidAndId: (anchor: IAnchor) => HTMLElement[];
|