@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.
Files changed (42) hide show
  1. package/dist/foundation/contentManager/contentManager.d.ts +5 -0
  2. package/dist/index.d.ts +83 -21
  3. package/dist/index.js +34 -35
  4. package/dist/index.js.map +1 -0
  5. package/dist/index.mjs +4579 -3046
  6. package/dist/index.mjs.map +1 -0
  7. package/dist/intersection/components/editor/context.d.ts +128 -2
  8. package/dist/intersection/components/editor/editor.d.ts +54 -10
  9. package/dist/intersection/components/editor/index.d.ts +83 -21
  10. package/dist/intersection/components/modals/Refine/RefineContent.d.ts +20 -0
  11. package/dist/intersection/components/modals/Refine/RefineGenerator.d.ts +19 -0
  12. package/dist/intersection/components/modals/Refine/RefineInput.d.ts +18 -0
  13. package/dist/intersection/components/modals/Refine/RefineShortcut.d.ts +2 -0
  14. package/dist/intersection/components/modals/Refine/RefineToolbar.d.ts +2 -0
  15. package/dist/intersection/components/modals/Refine/context.d.ts +128 -0
  16. package/dist/intersection/components/modals/Refine/icons/abort.vue.d.ts +2 -0
  17. package/dist/intersection/components/modals/Refine/icons/copy.vue.d.ts +2 -0
  18. package/dist/intersection/components/modals/Refine/icons/delete.vue.d.ts +2 -0
  19. package/dist/intersection/components/modals/Refine/icons/expand.vue.d.ts +2 -0
  20. package/dist/intersection/components/modals/Refine/icons/inexpand.vue.d.ts +2 -0
  21. package/dist/intersection/components/modals/Refine/icons/insert.vue.d.ts +2 -0
  22. package/dist/intersection/components/modals/Refine/icons/moreShortcut.vue.d.ts +2 -0
  23. package/dist/intersection/components/modals/Refine/icons/optimism.vue.d.ts +2 -0
  24. package/dist/intersection/components/modals/Refine/icons/prefix.vue.d.ts +2 -0
  25. package/dist/intersection/components/modals/Refine/icons/refresh.vue.d.ts +2 -0
  26. package/dist/intersection/components/modals/Refine/icons/replace.vue.d.ts +2 -0
  27. package/dist/intersection/components/modals/Refine/icons/send.vue.d.ts +2 -0
  28. package/dist/intersection/components/modals/Refine/index.d.ts +3 -0
  29. package/dist/intersection/components/modals/Refine/use-modal-pos.d.ts +10 -0
  30. package/dist/intersection/components/modals/Refine/use-range-highlight.d.ts +6 -0
  31. package/dist/intersection/hooks/use-copy.d.ts +4 -0
  32. package/dist/intersection/hooks/use-editor.d.ts +5 -3
  33. package/dist/intersection/hooks/use-state.d.ts +4 -0
  34. package/dist/plugins/AnchorTagPlugin/plugin.d.ts +4 -0
  35. package/dist/plugins/HomophonesTagPlugin/homophoner.vue.d.ts +2 -2
  36. package/dist/plugins/PronunciationTagPlugin/pronunciationor.vue.d.ts +2 -2
  37. package/dist/tiny-peony.css +1 -1
  38. package/dist/typings/actions/i-anchor.d.ts +8 -0
  39. package/dist/typings/intersection/editor.d.ts +10 -1
  40. package/dist/utils/dom.d.ts +19 -1
  41. package/dist/utils/shared.d.ts +11 -0
  42. package/package.json +6 -6
@@ -18,4 +18,9 @@ export declare class ContentManager extends IContentManager {
18
18
  private _insert;
19
19
  private _delete;
20
20
  private _update;
21
+ /**
22
+ * 将 fragment 插入到 range 所在 contenteditable 的上一个 <p> 元素末尾
23
+ * @param {Range} range - 当前的 Range 对象
24
+ */
25
+ private _calcRange;
21
26
  }
package/dist/index.d.ts CHANGED
@@ -16,8 +16,8 @@ declare const TinyPeony: {
16
16
  default: undefined;
17
17
  };
18
18
  listenAnchorId: {
19
- type: NumberConstructor;
20
- default: number;
19
+ type: StringConstructor;
20
+ default: string;
21
21
  };
22
22
  listenMode: {
23
23
  type: import("vue").PropType<import("./typings/shared").ListenModeEnum>;
@@ -51,12 +51,24 @@ declare const TinyPeony: {
51
51
  type: import("vue").PropType<import("vue").CSSProperties>;
52
52
  default: () => {};
53
53
  };
54
+ refinable: {
55
+ type: BooleanConstructor;
56
+ default: boolean;
57
+ };
58
+ refineContext: {
59
+ type: import("vue").PropType<import("./intersection/components/editor/context").RefineContext>;
60
+ };
61
+ editorHeight: {
62
+ type: (StringConstructor | NumberConstructor)[];
63
+ default: string;
64
+ };
54
65
  showPreTime: {
55
66
  type: BooleanConstructor;
56
67
  default: boolean;
57
68
  };
58
69
  }>> & Readonly<{
59
70
  onChange?: ((contentLength: number) => any) | undefined;
71
+ onClear?: (() => any) | undefined;
60
72
  "onUpdate:textCount"?: ((value: number) => any) | undefined;
61
73
  onAnchorListen?: ((value: import("./typings/index").IAnchor, text: string) => any) | undefined;
62
74
  onAnchorRemove?: ((value: import("./typings/index").IAnchor) => any) | undefined;
@@ -75,11 +87,14 @@ declare const TinyPeony: {
75
87
  innerIsRange: () => boolean;
76
88
  innerIsSelectionInDifferentParas: () => boolean;
77
89
  innerIsSelectionContainsTag: (type: import("./typings/shared").PluginFlag) => boolean;
78
- innerGetAnchorTtsMark: (id: number, startFromCursor?: boolean) => string;
79
- innerGetAnchorTtsEmotionAndRole: (id: number) => [string, string | undefined];
90
+ innerConvertToContent: (node: HTMLElement | Text) => string | undefined;
91
+ innerGetAnchorTtsMark: (anchor: import("./typings/index").IAnchor, startFromCursor?: boolean) => string;
92
+ innerGetAnchorTtsEmotionAndRole: (anchor: import("./typings/index").IAnchor) => [string, string | undefined];
80
93
  innerIsAllMarkedByAnchor: () => boolean;
81
94
  innerAddExtraAnchors: (data: import("./typings/index").IAnchor[]) => void;
95
+ innerUpdateAnchor: (newAnchor: import("./typings/index").IAnchor) => void;
82
96
  innerClearContent: () => void;
97
+ innerInsertContentAtCursor: (_content: string | string[]) => void;
83
98
  innerRenderHightlight: (matchingContent: string) => void;
84
99
  innerUnrenderHightlight: () => void;
85
100
  }, {}, {}, {
@@ -96,11 +111,14 @@ declare const TinyPeony: {
96
111
  isRange(): boolean;
97
112
  isSelectionInDifferentParas(): boolean;
98
113
  isSelectionContainsTag(type: import("./typings/shared").PluginFlag): boolean;
99
- getAnchorTtsMark(id: number, startFromCursor?: boolean): string;
100
- getAnchorTtsEmotionAndRole(id: number): [string, string | undefined];
114
+ convertToContent(node: HTMLElement | Text): string | undefined;
115
+ getAnchorTtsMark(anchor: import("./typings/index").IAnchor, startFromCursor?: boolean): string;
116
+ getAnchorTtsEmotionAndRole(anchor: import("./typings/index").IAnchor): [string, string | undefined];
101
117
  isAllMarkedByAnchor(): boolean;
102
118
  addExtraAnchors(data: import("./typings/index").IAnchor[]): void;
119
+ updateAnchor(anchor: import("./typings/index").IAnchor): void;
103
120
  clearContent(): void;
121
+ insertContentAtCursor(_content: string | string[]): void;
104
122
  clear(): Promise<void>;
105
123
  renderHighlight(matchingContent: string): void;
106
124
  unrenderHighlight(): void;
@@ -110,6 +128,7 @@ declare const TinyPeony: {
110
128
  anchorListen: (value: import("./typings/index").IAnchor, text: string) => true;
111
129
  anchorListenStop: (value: import("./typings/index").IAnchor) => true;
112
130
  anchorRemove: (value: import("./typings/index").IAnchor) => true;
131
+ clear: () => true;
113
132
  }, import("vue").PublicProps, {
114
133
  highlight: boolean;
115
134
  class: string | unknown[];
@@ -120,9 +139,11 @@ declare const TinyPeony: {
120
139
  simple: boolean;
121
140
  preTime: string;
122
141
  textCount: number;
123
- listenAnchorId: number;
142
+ listenAnchorId: string;
124
143
  listenMode: import("./typings/shared").ListenModeEnum;
125
144
  contentStyle: import("vue").CSSProperties;
145
+ refinable: boolean;
146
+ editorHeight: string | number;
126
147
  showPreTime: boolean;
127
148
  }, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
128
149
  P: {};
@@ -145,8 +166,8 @@ declare const TinyPeony: {
145
166
  default: undefined;
146
167
  };
147
168
  listenAnchorId: {
148
- type: NumberConstructor;
149
- default: number;
169
+ type: StringConstructor;
170
+ default: string;
150
171
  };
151
172
  listenMode: {
152
173
  type: import("vue").PropType<import("./typings/shared").ListenModeEnum>;
@@ -180,12 +201,24 @@ declare const TinyPeony: {
180
201
  type: import("vue").PropType<import("vue").CSSProperties>;
181
202
  default: () => {};
182
203
  };
204
+ refinable: {
205
+ type: BooleanConstructor;
206
+ default: boolean;
207
+ };
208
+ refineContext: {
209
+ type: import("vue").PropType<import("./intersection/components/editor/context").RefineContext>;
210
+ };
211
+ editorHeight: {
212
+ type: (StringConstructor | NumberConstructor)[];
213
+ default: string;
214
+ };
183
215
  showPreTime: {
184
216
  type: BooleanConstructor;
185
217
  default: boolean;
186
218
  };
187
219
  }>> & Readonly<{
188
220
  onChange?: ((contentLength: number) => any) | undefined;
221
+ onClear?: (() => any) | undefined;
189
222
  "onUpdate:textCount"?: ((value: number) => any) | undefined;
190
223
  onAnchorListen?: ((value: import("./typings/index").IAnchor, text: string) => any) | undefined;
191
224
  onAnchorRemove?: ((value: import("./typings/index").IAnchor) => any) | undefined;
@@ -204,11 +237,14 @@ declare const TinyPeony: {
204
237
  innerIsRange: () => boolean;
205
238
  innerIsSelectionInDifferentParas: () => boolean;
206
239
  innerIsSelectionContainsTag: (type: import("./typings/shared").PluginFlag) => boolean;
207
- innerGetAnchorTtsMark: (id: number, startFromCursor?: boolean) => string;
208
- innerGetAnchorTtsEmotionAndRole: (id: number) => [string, string | undefined];
240
+ innerConvertToContent: (node: HTMLElement | Text) => string | undefined;
241
+ innerGetAnchorTtsMark: (anchor: import("./typings/index").IAnchor, startFromCursor?: boolean) => string;
242
+ innerGetAnchorTtsEmotionAndRole: (anchor: import("./typings/index").IAnchor) => [string, string | undefined];
209
243
  innerIsAllMarkedByAnchor: () => boolean;
210
244
  innerAddExtraAnchors: (data: import("./typings/index").IAnchor[]) => void;
245
+ innerUpdateAnchor: (newAnchor: import("./typings/index").IAnchor) => void;
211
246
  innerClearContent: () => void;
247
+ innerInsertContentAtCursor: (_content: string | string[]) => void;
212
248
  innerRenderHightlight: (matchingContent: string) => void;
213
249
  innerUnrenderHightlight: () => void;
214
250
  }, {}, {}, {
@@ -225,11 +261,14 @@ declare const TinyPeony: {
225
261
  isRange(): boolean;
226
262
  isSelectionInDifferentParas(): boolean;
227
263
  isSelectionContainsTag(type: import("./typings/shared").PluginFlag): boolean;
228
- getAnchorTtsMark(id: number, startFromCursor?: boolean): string;
229
- getAnchorTtsEmotionAndRole(id: number): [string, string | undefined];
264
+ convertToContent(node: HTMLElement | Text): string | undefined;
265
+ getAnchorTtsMark(anchor: import("./typings/index").IAnchor, startFromCursor?: boolean): string;
266
+ getAnchorTtsEmotionAndRole(anchor: import("./typings/index").IAnchor): [string, string | undefined];
230
267
  isAllMarkedByAnchor(): boolean;
231
268
  addExtraAnchors(data: import("./typings/index").IAnchor[]): void;
269
+ updateAnchor(anchor: import("./typings/index").IAnchor): void;
232
270
  clearContent(): void;
271
+ insertContentAtCursor(_content: string | string[]): void;
233
272
  clear(): Promise<void>;
234
273
  renderHighlight(matchingContent: string): void;
235
274
  unrenderHighlight(): void;
@@ -243,9 +282,11 @@ declare const TinyPeony: {
243
282
  simple: boolean;
244
283
  preTime: string;
245
284
  textCount: number;
246
- listenAnchorId: number;
285
+ listenAnchorId: string;
247
286
  listenMode: import("./typings/shared").ListenModeEnum;
248
287
  contentStyle: import("vue").CSSProperties;
288
+ refinable: boolean;
289
+ editorHeight: string | number;
249
290
  showPreTime: boolean;
250
291
  }>;
251
292
  __isFragment?: never;
@@ -265,8 +306,8 @@ declare const TinyPeony: {
265
306
  default: undefined;
266
307
  };
267
308
  listenAnchorId: {
268
- type: NumberConstructor;
269
- default: number;
309
+ type: StringConstructor;
310
+ default: string;
270
311
  };
271
312
  listenMode: {
272
313
  type: import("vue").PropType<import("./typings/shared").ListenModeEnum>;
@@ -300,12 +341,24 @@ declare const TinyPeony: {
300
341
  type: import("vue").PropType<import("vue").CSSProperties>;
301
342
  default: () => {};
302
343
  };
344
+ refinable: {
345
+ type: BooleanConstructor;
346
+ default: boolean;
347
+ };
348
+ refineContext: {
349
+ type: import("vue").PropType<import("./intersection/components/editor/context").RefineContext>;
350
+ };
351
+ editorHeight: {
352
+ type: (StringConstructor | NumberConstructor)[];
353
+ default: string;
354
+ };
303
355
  showPreTime: {
304
356
  type: BooleanConstructor;
305
357
  default: boolean;
306
358
  };
307
359
  }>> & Readonly<{
308
360
  onChange?: ((contentLength: number) => any) | undefined;
361
+ onClear?: (() => any) | undefined;
309
362
  "onUpdate:textCount"?: ((value: number) => any) | undefined;
310
363
  onAnchorListen?: ((value: import("./typings/index").IAnchor, text: string) => any) | undefined;
311
364
  onAnchorRemove?: ((value: import("./typings/index").IAnchor) => any) | undefined;
@@ -324,11 +377,14 @@ declare const TinyPeony: {
324
377
  innerIsRange: () => boolean;
325
378
  innerIsSelectionInDifferentParas: () => boolean;
326
379
  innerIsSelectionContainsTag: (type: import("./typings/shared").PluginFlag) => boolean;
327
- innerGetAnchorTtsMark: (id: number, startFromCursor?: boolean) => string;
328
- innerGetAnchorTtsEmotionAndRole: (id: number) => [string, string | undefined];
380
+ innerConvertToContent: (node: HTMLElement | Text) => string | undefined;
381
+ innerGetAnchorTtsMark: (anchor: import("./typings/index").IAnchor, startFromCursor?: boolean) => string;
382
+ innerGetAnchorTtsEmotionAndRole: (anchor: import("./typings/index").IAnchor) => [string, string | undefined];
329
383
  innerIsAllMarkedByAnchor: () => boolean;
330
384
  innerAddExtraAnchors: (data: import("./typings/index").IAnchor[]) => void;
385
+ innerUpdateAnchor: (newAnchor: import("./typings/index").IAnchor) => void;
331
386
  innerClearContent: () => void;
387
+ innerInsertContentAtCursor: (_content: string | string[]) => void;
332
388
  innerRenderHightlight: (matchingContent: string) => void;
333
389
  innerUnrenderHightlight: () => void;
334
390
  }, {}, {}, {
@@ -345,11 +401,14 @@ declare const TinyPeony: {
345
401
  isRange(): boolean;
346
402
  isSelectionInDifferentParas(): boolean;
347
403
  isSelectionContainsTag(type: import("./typings/shared").PluginFlag): boolean;
348
- getAnchorTtsMark(id: number, startFromCursor?: boolean): string;
349
- getAnchorTtsEmotionAndRole(id: number): [string, string | undefined];
404
+ convertToContent(node: HTMLElement | Text): string | undefined;
405
+ getAnchorTtsMark(anchor: import("./typings/index").IAnchor, startFromCursor?: boolean): string;
406
+ getAnchorTtsEmotionAndRole(anchor: import("./typings/index").IAnchor): [string, string | undefined];
350
407
  isAllMarkedByAnchor(): boolean;
351
408
  addExtraAnchors(data: import("./typings/index").IAnchor[]): void;
409
+ updateAnchor(anchor: import("./typings/index").IAnchor): void;
352
410
  clearContent(): void;
411
+ insertContentAtCursor(_content: string | string[]): void;
353
412
  clear(): Promise<void>;
354
413
  renderHighlight(matchingContent: string): void;
355
414
  unrenderHighlight(): void;
@@ -359,6 +418,7 @@ declare const TinyPeony: {
359
418
  anchorListen: (value: import("./typings/index").IAnchor, text: string) => true;
360
419
  anchorListenStop: (value: import("./typings/index").IAnchor) => true;
361
420
  anchorRemove: (value: import("./typings/index").IAnchor) => true;
421
+ clear: () => true;
362
422
  }, string, {
363
423
  highlight: boolean;
364
424
  class: string | unknown[];
@@ -369,9 +429,11 @@ declare const TinyPeony: {
369
429
  simple: boolean;
370
430
  preTime: string;
371
431
  textCount: number;
372
- listenAnchorId: number;
432
+ listenAnchorId: string;
373
433
  listenMode: import("./typings/shared").ListenModeEnum;
374
434
  contentStyle: import("vue").CSSProperties;
435
+ refinable: boolean;
436
+ editorHeight: string | number;
375
437
  showPreTime: boolean;
376
438
  }, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & {
377
439
  install: (app: App, options?: Record<string, any>) => void;