@linker-design-plus/tiny-peony 1.4.16 → 1.4.18

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 +77 -21
  3. package/dist/index.js +42 -34
  4. package/dist/index.js.map +1 -0
  5. package/dist/index.mjs +4577 -3063
  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 +52 -10
  9. package/dist/intersection/components/editor/index.d.ts +77 -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 +4 -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 +1 -1
@@ -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,13 @@ 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
+ innerGetAnchorTtsMark: (anchor: import("./typings/index").IAnchor, startFromCursor?: boolean) => string;
91
+ innerGetAnchorTtsEmotionAndRole: (anchor: import("./typings/index").IAnchor) => [string, string | undefined];
80
92
  innerIsAllMarkedByAnchor: () => boolean;
81
93
  innerAddExtraAnchors: (data: import("./typings/index").IAnchor[]) => void;
94
+ innerUpdateAnchor: (newAnchor: import("./typings/index").IAnchor) => void;
82
95
  innerClearContent: () => void;
96
+ innerInsertContentAtCursor: (_content: string | string[]) => void;
83
97
  innerRenderHightlight: (matchingContent: string) => void;
84
98
  innerUnrenderHightlight: () => void;
85
99
  }, {}, {}, {
@@ -96,11 +110,13 @@ declare const TinyPeony: {
96
110
  isRange(): boolean;
97
111
  isSelectionInDifferentParas(): boolean;
98
112
  isSelectionContainsTag(type: import("./typings/shared").PluginFlag): boolean;
99
- getAnchorTtsMark(id: number, startFromCursor?: boolean): string;
100
- getAnchorTtsEmotionAndRole(id: number): [string, string | undefined];
113
+ getAnchorTtsMark(anchor: import("./typings/index").IAnchor, startFromCursor?: boolean): string;
114
+ getAnchorTtsEmotionAndRole(anchor: import("./typings/index").IAnchor): [string, string | undefined];
101
115
  isAllMarkedByAnchor(): boolean;
102
116
  addExtraAnchors(data: import("./typings/index").IAnchor[]): void;
117
+ updateAnchor(anchor: import("./typings/index").IAnchor): void;
103
118
  clearContent(): void;
119
+ insertContentAtCursor(_content: string | string[]): void;
104
120
  clear(): Promise<void>;
105
121
  renderHighlight(matchingContent: string): void;
106
122
  unrenderHighlight(): void;
@@ -110,6 +126,7 @@ declare const TinyPeony: {
110
126
  anchorListen: (value: import("./typings/index").IAnchor, text: string) => true;
111
127
  anchorListenStop: (value: import("./typings/index").IAnchor) => true;
112
128
  anchorRemove: (value: import("./typings/index").IAnchor) => true;
129
+ clear: () => true;
113
130
  }, import("vue").PublicProps, {
114
131
  highlight: boolean;
115
132
  class: string | unknown[];
@@ -120,9 +137,11 @@ declare const TinyPeony: {
120
137
  simple: boolean;
121
138
  preTime: string;
122
139
  textCount: number;
123
- listenAnchorId: number;
140
+ listenAnchorId: string;
124
141
  listenMode: import("./typings/shared").ListenModeEnum;
125
142
  contentStyle: import("vue").CSSProperties;
143
+ refinable: boolean;
144
+ editorHeight: string | number;
126
145
  showPreTime: boolean;
127
146
  }, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
128
147
  P: {};
@@ -145,8 +164,8 @@ declare const TinyPeony: {
145
164
  default: undefined;
146
165
  };
147
166
  listenAnchorId: {
148
- type: NumberConstructor;
149
- default: number;
167
+ type: StringConstructor;
168
+ default: string;
150
169
  };
151
170
  listenMode: {
152
171
  type: import("vue").PropType<import("./typings/shared").ListenModeEnum>;
@@ -180,12 +199,24 @@ declare const TinyPeony: {
180
199
  type: import("vue").PropType<import("vue").CSSProperties>;
181
200
  default: () => {};
182
201
  };
202
+ refinable: {
203
+ type: BooleanConstructor;
204
+ default: boolean;
205
+ };
206
+ refineContext: {
207
+ type: import("vue").PropType<import("./intersection/components/editor/context").RefineContext>;
208
+ };
209
+ editorHeight: {
210
+ type: (StringConstructor | NumberConstructor)[];
211
+ default: string;
212
+ };
183
213
  showPreTime: {
184
214
  type: BooleanConstructor;
185
215
  default: boolean;
186
216
  };
187
217
  }>> & Readonly<{
188
218
  onChange?: ((contentLength: number) => any) | undefined;
219
+ onClear?: (() => any) | undefined;
189
220
  "onUpdate:textCount"?: ((value: number) => any) | undefined;
190
221
  onAnchorListen?: ((value: import("./typings/index").IAnchor, text: string) => any) | undefined;
191
222
  onAnchorRemove?: ((value: import("./typings/index").IAnchor) => any) | undefined;
@@ -204,11 +235,13 @@ declare const TinyPeony: {
204
235
  innerIsRange: () => boolean;
205
236
  innerIsSelectionInDifferentParas: () => boolean;
206
237
  innerIsSelectionContainsTag: (type: import("./typings/shared").PluginFlag) => boolean;
207
- innerGetAnchorTtsMark: (id: number, startFromCursor?: boolean) => string;
208
- innerGetAnchorTtsEmotionAndRole: (id: number) => [string, string | undefined];
238
+ innerGetAnchorTtsMark: (anchor: import("./typings/index").IAnchor, startFromCursor?: boolean) => string;
239
+ innerGetAnchorTtsEmotionAndRole: (anchor: import("./typings/index").IAnchor) => [string, string | undefined];
209
240
  innerIsAllMarkedByAnchor: () => boolean;
210
241
  innerAddExtraAnchors: (data: import("./typings/index").IAnchor[]) => void;
242
+ innerUpdateAnchor: (newAnchor: import("./typings/index").IAnchor) => void;
211
243
  innerClearContent: () => void;
244
+ innerInsertContentAtCursor: (_content: string | string[]) => void;
212
245
  innerRenderHightlight: (matchingContent: string) => void;
213
246
  innerUnrenderHightlight: () => void;
214
247
  }, {}, {}, {
@@ -225,11 +258,13 @@ declare const TinyPeony: {
225
258
  isRange(): boolean;
226
259
  isSelectionInDifferentParas(): boolean;
227
260
  isSelectionContainsTag(type: import("./typings/shared").PluginFlag): boolean;
228
- getAnchorTtsMark(id: number, startFromCursor?: boolean): string;
229
- getAnchorTtsEmotionAndRole(id: number): [string, string | undefined];
261
+ getAnchorTtsMark(anchor: import("./typings/index").IAnchor, startFromCursor?: boolean): string;
262
+ getAnchorTtsEmotionAndRole(anchor: import("./typings/index").IAnchor): [string, string | undefined];
230
263
  isAllMarkedByAnchor(): boolean;
231
264
  addExtraAnchors(data: import("./typings/index").IAnchor[]): void;
265
+ updateAnchor(anchor: import("./typings/index").IAnchor): void;
232
266
  clearContent(): void;
267
+ insertContentAtCursor(_content: string | string[]): void;
233
268
  clear(): Promise<void>;
234
269
  renderHighlight(matchingContent: string): void;
235
270
  unrenderHighlight(): void;
@@ -243,9 +278,11 @@ declare const TinyPeony: {
243
278
  simple: boolean;
244
279
  preTime: string;
245
280
  textCount: number;
246
- listenAnchorId: number;
281
+ listenAnchorId: string;
247
282
  listenMode: import("./typings/shared").ListenModeEnum;
248
283
  contentStyle: import("vue").CSSProperties;
284
+ refinable: boolean;
285
+ editorHeight: string | number;
249
286
  showPreTime: boolean;
250
287
  }>;
251
288
  __isFragment?: never;
@@ -265,8 +302,8 @@ declare const TinyPeony: {
265
302
  default: undefined;
266
303
  };
267
304
  listenAnchorId: {
268
- type: NumberConstructor;
269
- default: number;
305
+ type: StringConstructor;
306
+ default: string;
270
307
  };
271
308
  listenMode: {
272
309
  type: import("vue").PropType<import("./typings/shared").ListenModeEnum>;
@@ -300,12 +337,24 @@ declare const TinyPeony: {
300
337
  type: import("vue").PropType<import("vue").CSSProperties>;
301
338
  default: () => {};
302
339
  };
340
+ refinable: {
341
+ type: BooleanConstructor;
342
+ default: boolean;
343
+ };
344
+ refineContext: {
345
+ type: import("vue").PropType<import("./intersection/components/editor/context").RefineContext>;
346
+ };
347
+ editorHeight: {
348
+ type: (StringConstructor | NumberConstructor)[];
349
+ default: string;
350
+ };
303
351
  showPreTime: {
304
352
  type: BooleanConstructor;
305
353
  default: boolean;
306
354
  };
307
355
  }>> & Readonly<{
308
356
  onChange?: ((contentLength: number) => any) | undefined;
357
+ onClear?: (() => any) | undefined;
309
358
  "onUpdate:textCount"?: ((value: number) => any) | undefined;
310
359
  onAnchorListen?: ((value: import("./typings/index").IAnchor, text: string) => any) | undefined;
311
360
  onAnchorRemove?: ((value: import("./typings/index").IAnchor) => any) | undefined;
@@ -324,11 +373,13 @@ declare const TinyPeony: {
324
373
  innerIsRange: () => boolean;
325
374
  innerIsSelectionInDifferentParas: () => boolean;
326
375
  innerIsSelectionContainsTag: (type: import("./typings/shared").PluginFlag) => boolean;
327
- innerGetAnchorTtsMark: (id: number, startFromCursor?: boolean) => string;
328
- innerGetAnchorTtsEmotionAndRole: (id: number) => [string, string | undefined];
376
+ innerGetAnchorTtsMark: (anchor: import("./typings/index").IAnchor, startFromCursor?: boolean) => string;
377
+ innerGetAnchorTtsEmotionAndRole: (anchor: import("./typings/index").IAnchor) => [string, string | undefined];
329
378
  innerIsAllMarkedByAnchor: () => boolean;
330
379
  innerAddExtraAnchors: (data: import("./typings/index").IAnchor[]) => void;
380
+ innerUpdateAnchor: (newAnchor: import("./typings/index").IAnchor) => void;
331
381
  innerClearContent: () => void;
382
+ innerInsertContentAtCursor: (_content: string | string[]) => void;
332
383
  innerRenderHightlight: (matchingContent: string) => void;
333
384
  innerUnrenderHightlight: () => void;
334
385
  }, {}, {}, {
@@ -345,11 +396,13 @@ declare const TinyPeony: {
345
396
  isRange(): boolean;
346
397
  isSelectionInDifferentParas(): boolean;
347
398
  isSelectionContainsTag(type: import("./typings/shared").PluginFlag): boolean;
348
- getAnchorTtsMark(id: number, startFromCursor?: boolean): string;
349
- getAnchorTtsEmotionAndRole(id: number): [string, string | undefined];
399
+ getAnchorTtsMark(anchor: import("./typings/index").IAnchor, startFromCursor?: boolean): string;
400
+ getAnchorTtsEmotionAndRole(anchor: import("./typings/index").IAnchor): [string, string | undefined];
350
401
  isAllMarkedByAnchor(): boolean;
351
402
  addExtraAnchors(data: import("./typings/index").IAnchor[]): void;
403
+ updateAnchor(anchor: import("./typings/index").IAnchor): void;
352
404
  clearContent(): void;
405
+ insertContentAtCursor(_content: string | string[]): void;
353
406
  clear(): Promise<void>;
354
407
  renderHighlight(matchingContent: string): void;
355
408
  unrenderHighlight(): void;
@@ -359,6 +412,7 @@ declare const TinyPeony: {
359
412
  anchorListen: (value: import("./typings/index").IAnchor, text: string) => true;
360
413
  anchorListenStop: (value: import("./typings/index").IAnchor) => true;
361
414
  anchorRemove: (value: import("./typings/index").IAnchor) => true;
415
+ clear: () => true;
362
416
  }, string, {
363
417
  highlight: boolean;
364
418
  class: string | unknown[];
@@ -369,9 +423,11 @@ declare const TinyPeony: {
369
423
  simple: boolean;
370
424
  preTime: string;
371
425
  textCount: number;
372
- listenAnchorId: number;
426
+ listenAnchorId: string;
373
427
  listenMode: import("./typings/shared").ListenModeEnum;
374
428
  contentStyle: import("vue").CSSProperties;
429
+ refinable: boolean;
430
+ editorHeight: string | number;
375
431
  showPreTime: boolean;
376
432
  }, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & {
377
433
  install: (app: App, options?: Record<string, any>) => void;