@agilehub/agile-editor 1.5.0 → 1.7.0
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/README.md +142 -0
- package/dist/agile-editor.css +1 -1
- package/dist/agile-editor.js +7300 -5262
- package/dist/types/components/editor/index.vue.d.ts +2 -2
- package/dist/types/components/index.d.ts +4 -2
- package/dist/types/components/index.vue.d.ts +151 -5
- package/dist/types/components/menus/toolbar/insert/bookmark.vue.d.ts +24 -0
- package/dist/types/components/preview-toolbar/annotation-shape.vue.d.ts +58 -0
- package/dist/types/components/preview-toolbar/drawing-layer.vue.d.ts +91 -0
- package/dist/types/components/preview-toolbar/geometry.d.ts +56 -0
- package/dist/types/components/preview-toolbar/index.vue.d.ts +200 -0
- package/dist/types/components/preview-toolbar/types.d.ts +48 -0
- package/dist/types/components/statusbar/countdown.vue.d.ts +19 -7
- package/dist/types/components/toolbar/classic.vue.d.ts +16 -8
- package/dist/types/components/toolbar/ribbon.vue.d.ts +16 -8
- package/dist/types/composables/i18n.d.ts +144 -3
- package/dist/types/extensions/bookmark.d.ts +8 -5
- package/dist/types/extensions/bubble-note.d.ts +2 -0
- package/dist/types/extensions/element-style.d.ts +0 -1
- package/dist/types/i18n.d.ts +144 -3
- package/dist/types/options/config/index.d.ts +2 -0
- package/dist/types/utils/html-element-id.d.ts +9 -0
- package/dist/types/utils/html-id.d.ts +1 -0
- package/dist/types/utils/iframe.d.ts +5 -0
- package/dist/types/utils/style-target.d.ts +49 -0
- package/docs/SECONDARY_DEVELOPMENT.md +1 -1
- package/docs/api.md +43 -0
- package/docs/configuration.md +57 -0
- package/docs/custom-components.md +150 -0
- package/docs/development.md +6 -2
- package/docs/menu-extension.md +26 -1
- package/package.json +25 -15
- package/dist/types/components/menus/toolbar/view/preview.vue.d.ts +0 -3
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
declare var
|
|
1
|
+
declare var __VLS_28: {
|
|
2
2
|
nodeType: any;
|
|
3
3
|
nodeAttrs: any;
|
|
4
4
|
};
|
|
5
5
|
type __VLS_Slots = {} & {
|
|
6
|
-
bubble_menu?: (props: typeof
|
|
6
|
+
bubble_menu?: (props: typeof __VLS_28) => any;
|
|
7
7
|
};
|
|
8
8
|
declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
9
9
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -4,10 +4,12 @@ import type defaultOptions from '../options/config';
|
|
|
4
4
|
import AgileEditor from './index.vue';
|
|
5
5
|
import AgileMenuButton from './menus/button.vue';
|
|
6
6
|
import AgileDialog from './modal.vue';
|
|
7
|
+
import AgilePreviewToolbar from './preview-toolbar/index.vue';
|
|
7
8
|
import AgileTooltip from './tooltip.vue';
|
|
8
9
|
/** 安装插件时可覆盖的默认编辑器配置;组件 props 优先于此处配置。 */
|
|
9
10
|
export type AgileEditorOptions = Partial<typeof defaultOptions>;
|
|
10
|
-
export type { FormattingOptions, FormattingTemplate, FormattingStyle, FormattingTableRule, FormattingImageRule, FormattingNodeRule, FormattingNodeAdapter, FormattingAdapterResult, FormattingJSONValue } from '../utils/document-formatting';
|
|
11
|
+
export type { FormattingOptions, FormattingTemplate, FormattingStyle, FormattingTableRule, FormattingImageRule, FormattingNodeRule, FormattingNodeAdapter, FormattingAdapterResult, FormattingJSONValue, } from '../utils/document-formatting';
|
|
12
|
+
export type { PreviewAnnotation, PreviewAnnotationSnapshot, PreviewAnnotationTool, PreviewAnnotationsSaveHandler, PreviewDrawingState, PreviewDrawTool, PreviewPageSettings, PreviewPoint, PreviewStrokeStyle, } from './preview-toolbar/types';
|
|
11
13
|
declare const useAgileEditor: {
|
|
12
14
|
/**
|
|
13
15
|
* 注册编辑器组件并向组件树提供全局默认配置。
|
|
@@ -18,4 +20,4 @@ declare const useAgileEditor: {
|
|
|
18
20
|
*/
|
|
19
21
|
install: (app: App, options?: AgileEditorOptions) => void;
|
|
20
22
|
};
|
|
21
|
-
export { AgileEditor as default, AgileDialog, AgileEditor, AgileMenuButton, AgileTooltip, useAgileEditor, };
|
|
23
|
+
export { AgileEditor as default, AgileDialog, AgileEditor, AgileMenuButton, AgilePreviewToolbar, AgileTooltip, useAgileEditor, };
|
|
@@ -149,7 +149,8 @@ declare const __VLS_base: import("vue").DefineComponent<{}, {
|
|
|
149
149
|
page: string;
|
|
150
150
|
view: string;
|
|
151
151
|
export: string;
|
|
152
|
-
|
|
152
|
+
extension: string;
|
|
153
|
+
enhancement: string;
|
|
153
154
|
};
|
|
154
155
|
base: {
|
|
155
156
|
align: {
|
|
@@ -412,12 +413,18 @@ declare const __VLS_base: import("vue").DefineComponent<{}, {
|
|
|
412
413
|
mention: string;
|
|
413
414
|
bookmark: {
|
|
414
415
|
text: string;
|
|
416
|
+
title: string;
|
|
417
|
+
"edit-title": string;
|
|
418
|
+
note: string;
|
|
415
419
|
set: string;
|
|
416
420
|
ok: string;
|
|
421
|
+
confirm: string;
|
|
422
|
+
cancel: string;
|
|
417
423
|
textName: string;
|
|
418
424
|
placeholder: string;
|
|
419
425
|
show: string;
|
|
420
426
|
actions: string;
|
|
427
|
+
edit: string;
|
|
421
428
|
delete: string;
|
|
422
429
|
emptyError: string;
|
|
423
430
|
};
|
|
@@ -1151,6 +1158,45 @@ declare const __VLS_base: import("vue").DefineComponent<{}, {
|
|
|
1151
1158
|
preview: {
|
|
1152
1159
|
title: string;
|
|
1153
1160
|
disable: string;
|
|
1161
|
+
drawing: {
|
|
1162
|
+
title: string;
|
|
1163
|
+
hiddenTitle: string;
|
|
1164
|
+
tools: {
|
|
1165
|
+
title: string;
|
|
1166
|
+
rectangle: string;
|
|
1167
|
+
line: string;
|
|
1168
|
+
path: string;
|
|
1169
|
+
};
|
|
1170
|
+
color: {
|
|
1171
|
+
title: string;
|
|
1172
|
+
custom: string;
|
|
1173
|
+
};
|
|
1174
|
+
width: {
|
|
1175
|
+
title: string;
|
|
1176
|
+
thin: string;
|
|
1177
|
+
default: string;
|
|
1178
|
+
thick: string;
|
|
1179
|
+
extraThick: string;
|
|
1180
|
+
};
|
|
1181
|
+
strokeStyles: {
|
|
1182
|
+
title: string;
|
|
1183
|
+
solid: string;
|
|
1184
|
+
dashed: string;
|
|
1185
|
+
wavy: string;
|
|
1186
|
+
};
|
|
1187
|
+
select: string;
|
|
1188
|
+
deleteSelected: string;
|
|
1189
|
+
undo: string;
|
|
1190
|
+
save: string;
|
|
1191
|
+
saving: string;
|
|
1192
|
+
saved: string;
|
|
1193
|
+
hideAnnotations: string;
|
|
1194
|
+
showAnnotations: string;
|
|
1195
|
+
restorePage: string;
|
|
1196
|
+
clearAll: string;
|
|
1197
|
+
confirmClear: string;
|
|
1198
|
+
count: string;
|
|
1199
|
+
};
|
|
1154
1200
|
countdown: {
|
|
1155
1201
|
title: string;
|
|
1156
1202
|
select: string;
|
|
@@ -1175,6 +1221,7 @@ declare const __VLS_base: import("vue").DefineComponent<{}, {
|
|
|
1175
1221
|
remaining: string;
|
|
1176
1222
|
};
|
|
1177
1223
|
laserPointer: string;
|
|
1224
|
+
hideToolbar: string;
|
|
1178
1225
|
};
|
|
1179
1226
|
fullscreen: {
|
|
1180
1227
|
title: string;
|
|
@@ -1369,7 +1416,8 @@ declare const __VLS_base: import("vue").DefineComponent<{}, {
|
|
|
1369
1416
|
page: string;
|
|
1370
1417
|
view: string;
|
|
1371
1418
|
export: string;
|
|
1372
|
-
|
|
1419
|
+
extension: string;
|
|
1420
|
+
enhancement: string;
|
|
1373
1421
|
};
|
|
1374
1422
|
base: {
|
|
1375
1423
|
align: {
|
|
@@ -1632,12 +1680,18 @@ declare const __VLS_base: import("vue").DefineComponent<{}, {
|
|
|
1632
1680
|
mention: string;
|
|
1633
1681
|
bookmark: {
|
|
1634
1682
|
text: string;
|
|
1683
|
+
title: string;
|
|
1684
|
+
"edit-title": string;
|
|
1685
|
+
note: string;
|
|
1635
1686
|
set: string;
|
|
1636
1687
|
ok: string;
|
|
1688
|
+
confirm: string;
|
|
1689
|
+
cancel: string;
|
|
1637
1690
|
textName: string;
|
|
1638
1691
|
placeholder: string;
|
|
1639
1692
|
show: string;
|
|
1640
1693
|
actions: string;
|
|
1694
|
+
edit: string;
|
|
1641
1695
|
delete: string;
|
|
1642
1696
|
emptyError: string;
|
|
1643
1697
|
};
|
|
@@ -2376,6 +2430,45 @@ declare const __VLS_base: import("vue").DefineComponent<{}, {
|
|
|
2376
2430
|
preview: {
|
|
2377
2431
|
title: string;
|
|
2378
2432
|
disable: string;
|
|
2433
|
+
drawing: {
|
|
2434
|
+
title: string;
|
|
2435
|
+
hiddenTitle: string;
|
|
2436
|
+
tools: {
|
|
2437
|
+
title: string;
|
|
2438
|
+
rectangle: string;
|
|
2439
|
+
line: string;
|
|
2440
|
+
path: string;
|
|
2441
|
+
};
|
|
2442
|
+
color: {
|
|
2443
|
+
title: string;
|
|
2444
|
+
custom: string;
|
|
2445
|
+
};
|
|
2446
|
+
width: {
|
|
2447
|
+
title: string;
|
|
2448
|
+
thin: string;
|
|
2449
|
+
default: string;
|
|
2450
|
+
thick: string;
|
|
2451
|
+
extraThick: string;
|
|
2452
|
+
};
|
|
2453
|
+
strokeStyles: {
|
|
2454
|
+
title: string;
|
|
2455
|
+
solid: string;
|
|
2456
|
+
dashed: string;
|
|
2457
|
+
wavy: string;
|
|
2458
|
+
};
|
|
2459
|
+
select: string;
|
|
2460
|
+
deleteSelected: string;
|
|
2461
|
+
undo: string;
|
|
2462
|
+
save: string;
|
|
2463
|
+
saving: string;
|
|
2464
|
+
saved: string;
|
|
2465
|
+
hideAnnotations: string;
|
|
2466
|
+
showAnnotations: string;
|
|
2467
|
+
restorePage: string;
|
|
2468
|
+
clearAll: string;
|
|
2469
|
+
confirmClear: string;
|
|
2470
|
+
count: string;
|
|
2471
|
+
};
|
|
2379
2472
|
countdown: {
|
|
2380
2473
|
title: string;
|
|
2381
2474
|
select: string;
|
|
@@ -2400,6 +2493,7 @@ declare const __VLS_base: import("vue").DefineComponent<{}, {
|
|
|
2400
2493
|
remaining: string;
|
|
2401
2494
|
};
|
|
2402
2495
|
laserPointer: string;
|
|
2496
|
+
hideToolbar: string;
|
|
2403
2497
|
};
|
|
2404
2498
|
fullscreen: {
|
|
2405
2499
|
title: string;
|
|
@@ -2581,7 +2675,8 @@ declare const __VLS_base: import("vue").DefineComponent<{}, {
|
|
|
2581
2675
|
page: string;
|
|
2582
2676
|
view: string;
|
|
2583
2677
|
export: string;
|
|
2584
|
-
|
|
2678
|
+
extension: string;
|
|
2679
|
+
enhancement: string;
|
|
2585
2680
|
};
|
|
2586
2681
|
base: {
|
|
2587
2682
|
align: {
|
|
@@ -2844,12 +2939,18 @@ declare const __VLS_base: import("vue").DefineComponent<{}, {
|
|
|
2844
2939
|
mention: string;
|
|
2845
2940
|
bookmark: {
|
|
2846
2941
|
text: string;
|
|
2942
|
+
title: string;
|
|
2943
|
+
"edit-title": string;
|
|
2944
|
+
note: string;
|
|
2847
2945
|
set: string;
|
|
2848
2946
|
ok: string;
|
|
2947
|
+
confirm: string;
|
|
2948
|
+
cancel: string;
|
|
2849
2949
|
textName: string;
|
|
2850
2950
|
placeholder: string;
|
|
2851
2951
|
show: string;
|
|
2852
2952
|
actions: string;
|
|
2953
|
+
edit: string;
|
|
2853
2954
|
delete: string;
|
|
2854
2955
|
emptyError: string;
|
|
2855
2956
|
};
|
|
@@ -3588,6 +3689,45 @@ declare const __VLS_base: import("vue").DefineComponent<{}, {
|
|
|
3588
3689
|
preview: {
|
|
3589
3690
|
title: string;
|
|
3590
3691
|
disable: string;
|
|
3692
|
+
drawing: {
|
|
3693
|
+
title: string;
|
|
3694
|
+
hiddenTitle: string;
|
|
3695
|
+
tools: {
|
|
3696
|
+
title: string;
|
|
3697
|
+
rectangle: string;
|
|
3698
|
+
line: string;
|
|
3699
|
+
path: string;
|
|
3700
|
+
};
|
|
3701
|
+
color: {
|
|
3702
|
+
title: string;
|
|
3703
|
+
custom: string;
|
|
3704
|
+
};
|
|
3705
|
+
width: {
|
|
3706
|
+
title: string;
|
|
3707
|
+
thin: string;
|
|
3708
|
+
default: string;
|
|
3709
|
+
thick: string;
|
|
3710
|
+
extraThick: string;
|
|
3711
|
+
};
|
|
3712
|
+
strokeStyles: {
|
|
3713
|
+
title: string;
|
|
3714
|
+
solid: string;
|
|
3715
|
+
dashed: string;
|
|
3716
|
+
wavy: string;
|
|
3717
|
+
};
|
|
3718
|
+
select: string;
|
|
3719
|
+
deleteSelected: string;
|
|
3720
|
+
undo: string;
|
|
3721
|
+
save: string;
|
|
3722
|
+
saving: string;
|
|
3723
|
+
saved: string;
|
|
3724
|
+
hideAnnotations: string;
|
|
3725
|
+
showAnnotations: string;
|
|
3726
|
+
restorePage: string;
|
|
3727
|
+
clearAll: string;
|
|
3728
|
+
confirmClear: string;
|
|
3729
|
+
count: string;
|
|
3730
|
+
};
|
|
3591
3731
|
countdown: {
|
|
3592
3732
|
title: string;
|
|
3593
3733
|
select: string;
|
|
@@ -3612,6 +3752,7 @@ declare const __VLS_base: import("vue").DefineComponent<{}, {
|
|
|
3612
3752
|
remaining: string;
|
|
3613
3753
|
};
|
|
3614
3754
|
laserPointer: string;
|
|
3755
|
+
hideToolbar: string;
|
|
3615
3756
|
};
|
|
3616
3757
|
fullscreen: {
|
|
3617
3758
|
title: string;
|
|
@@ -3706,6 +3847,11 @@ declare const __VLS_base: import("vue").DefineComponent<{}, {
|
|
|
3706
3847
|
* @returns 无返回值。
|
|
3707
3848
|
*/
|
|
3708
3849
|
setReadOnly(readOnly?: boolean): void;
|
|
3850
|
+
/**
|
|
3851
|
+
* 切换内容预览模式;预览时自动只读并隐藏编辑工具栏。
|
|
3852
|
+
* @param preview - true 进入预览,false 返回编辑状态。
|
|
3853
|
+
*/
|
|
3854
|
+
setPreview(preview?: boolean): void;
|
|
3709
3855
|
print: () => void;
|
|
3710
3856
|
focus: (position?: string, options?: {
|
|
3711
3857
|
scrollIntoView: boolean;
|
|
@@ -3744,6 +3890,7 @@ declare const __VLS_base: import("vue").DefineComponent<{}, {
|
|
|
3744
3890
|
saved: (...args: any[]) => void;
|
|
3745
3891
|
blur: (...args: any[]) => void;
|
|
3746
3892
|
focus: (...args: any[]) => void;
|
|
3893
|
+
drop: (...args: any[]) => void;
|
|
3747
3894
|
beforeCreate: (...args: any[]) => void;
|
|
3748
3895
|
created: (...args: any[]) => void;
|
|
3749
3896
|
changed: (...args: any[]) => void;
|
|
@@ -3763,7 +3910,6 @@ declare const __VLS_base: import("vue").DefineComponent<{}, {
|
|
|
3763
3910
|
"changed:locale": (...args: any[]) => void;
|
|
3764
3911
|
"changed:theme": (...args: any[]) => void;
|
|
3765
3912
|
"changed:skin": (...args: any[]) => void;
|
|
3766
|
-
drop: (...args: any[]) => void;
|
|
3767
3913
|
destroy: (...args: any[]) => void;
|
|
3768
3914
|
}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{
|
|
3769
3915
|
onPrint?: (...args: any[]) => any;
|
|
@@ -3772,6 +3918,7 @@ declare const __VLS_base: import("vue").DefineComponent<{}, {
|
|
|
3772
3918
|
onSaved?: (...args: any[]) => any;
|
|
3773
3919
|
onBlur?: (...args: any[]) => any;
|
|
3774
3920
|
onFocus?: (...args: any[]) => any;
|
|
3921
|
+
onDrop?: (...args: any[]) => any;
|
|
3775
3922
|
onBeforeCreate?: (...args: any[]) => any;
|
|
3776
3923
|
onCreated?: (...args: any[]) => any;
|
|
3777
3924
|
onChanged?: (...args: any[]) => any;
|
|
@@ -3791,7 +3938,6 @@ declare const __VLS_base: import("vue").DefineComponent<{}, {
|
|
|
3791
3938
|
"onChanged:locale"?: (...args: any[]) => any;
|
|
3792
3939
|
"onChanged:theme"?: (...args: any[]) => any;
|
|
3793
3940
|
"onChanged:skin"?: (...args: any[]) => any;
|
|
3794
|
-
onDrop?: (...args: any[]) => any;
|
|
3795
3941
|
onDestroy?: (...args: any[]) => any;
|
|
3796
3942
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
3797
3943
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<globalThis.ExtractPropTypes<{
|
|
2
|
+
dialogOnly: {
|
|
3
|
+
type: BooleanConstructor;
|
|
4
|
+
default: boolean;
|
|
5
|
+
};
|
|
6
|
+
triggerOnly: {
|
|
7
|
+
type: BooleanConstructor;
|
|
8
|
+
default: boolean;
|
|
9
|
+
};
|
|
10
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<globalThis.ExtractPropTypes<{
|
|
11
|
+
dialogOnly: {
|
|
12
|
+
type: BooleanConstructor;
|
|
13
|
+
default: boolean;
|
|
14
|
+
};
|
|
15
|
+
triggerOnly: {
|
|
16
|
+
type: BooleanConstructor;
|
|
17
|
+
default: boolean;
|
|
18
|
+
};
|
|
19
|
+
}>> & Readonly<{}>, {
|
|
20
|
+
dialogOnly: boolean;
|
|
21
|
+
triggerOnly: boolean;
|
|
22
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
23
|
+
declare const _default: typeof __VLS_export;
|
|
24
|
+
export default _default;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { PreviewAnnotation } from './types';
|
|
2
|
+
declare const __VLS_export: import("vue").DefineComponent<globalThis.ExtractPropTypes<{
|
|
3
|
+
annotation: {
|
|
4
|
+
type: () => PreviewAnnotation;
|
|
5
|
+
required: true;
|
|
6
|
+
};
|
|
7
|
+
canvasWidth: {
|
|
8
|
+
type: NumberConstructor;
|
|
9
|
+
required: true;
|
|
10
|
+
};
|
|
11
|
+
canvasHeight: {
|
|
12
|
+
type: NumberConstructor;
|
|
13
|
+
required: true;
|
|
14
|
+
};
|
|
15
|
+
hit: {
|
|
16
|
+
type: BooleanConstructor;
|
|
17
|
+
default: boolean;
|
|
18
|
+
};
|
|
19
|
+
selected: {
|
|
20
|
+
type: BooleanConstructor;
|
|
21
|
+
default: boolean;
|
|
22
|
+
};
|
|
23
|
+
hitStrokeWidth: {
|
|
24
|
+
type: NumberConstructor;
|
|
25
|
+
default: number;
|
|
26
|
+
};
|
|
27
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<globalThis.ExtractPropTypes<{
|
|
28
|
+
annotation: {
|
|
29
|
+
type: () => PreviewAnnotation;
|
|
30
|
+
required: true;
|
|
31
|
+
};
|
|
32
|
+
canvasWidth: {
|
|
33
|
+
type: NumberConstructor;
|
|
34
|
+
required: true;
|
|
35
|
+
};
|
|
36
|
+
canvasHeight: {
|
|
37
|
+
type: NumberConstructor;
|
|
38
|
+
required: true;
|
|
39
|
+
};
|
|
40
|
+
hit: {
|
|
41
|
+
type: BooleanConstructor;
|
|
42
|
+
default: boolean;
|
|
43
|
+
};
|
|
44
|
+
selected: {
|
|
45
|
+
type: BooleanConstructor;
|
|
46
|
+
default: boolean;
|
|
47
|
+
};
|
|
48
|
+
hitStrokeWidth: {
|
|
49
|
+
type: NumberConstructor;
|
|
50
|
+
default: number;
|
|
51
|
+
};
|
|
52
|
+
}>> & Readonly<{}>, {
|
|
53
|
+
hit: boolean;
|
|
54
|
+
selected: boolean;
|
|
55
|
+
hitStrokeWidth: number;
|
|
56
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
57
|
+
declare const _default: typeof __VLS_export;
|
|
58
|
+
export default _default;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import type { PreviewAnnotation, PreviewDrawingState, PreviewDrawTool, PreviewStrokeStyle } from './types';
|
|
2
|
+
declare const __VLS_export: import("vue").DefineComponent<globalThis.ExtractPropTypes<{
|
|
3
|
+
target: {
|
|
4
|
+
type: () => HTMLElement;
|
|
5
|
+
required: true;
|
|
6
|
+
};
|
|
7
|
+
tool: {
|
|
8
|
+
type: () => PreviewDrawTool | null;
|
|
9
|
+
default: any;
|
|
10
|
+
};
|
|
11
|
+
strokeStyle: {
|
|
12
|
+
type: () => PreviewStrokeStyle;
|
|
13
|
+
default: string;
|
|
14
|
+
};
|
|
15
|
+
zoomLevel: {
|
|
16
|
+
type: NumberConstructor;
|
|
17
|
+
default: number;
|
|
18
|
+
};
|
|
19
|
+
color: {
|
|
20
|
+
type: StringConstructor;
|
|
21
|
+
default: string;
|
|
22
|
+
};
|
|
23
|
+
strokeWidth: {
|
|
24
|
+
type: NumberConstructor;
|
|
25
|
+
default: number;
|
|
26
|
+
};
|
|
27
|
+
showAnnotations: {
|
|
28
|
+
type: BooleanConstructor;
|
|
29
|
+
default: boolean;
|
|
30
|
+
};
|
|
31
|
+
}>, {
|
|
32
|
+
getAnnotations: () => PreviewAnnotation[];
|
|
33
|
+
setAnnotations: (items: PreviewAnnotation[]) => void;
|
|
34
|
+
undo: () => boolean;
|
|
35
|
+
deleteSelected: () => boolean;
|
|
36
|
+
clearAll: () => boolean;
|
|
37
|
+
cancelInteraction: () => boolean;
|
|
38
|
+
clearSelection: () => void;
|
|
39
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
40
|
+
"selection-change": (annotationId: string) => any;
|
|
41
|
+
"state-change": (state: PreviewDrawingState) => any;
|
|
42
|
+
"annotation-add": (annotation: PreviewAnnotation) => any;
|
|
43
|
+
"annotation-delete": (annotationId: string) => any;
|
|
44
|
+
"annotations-clear": () => any;
|
|
45
|
+
"annotations-change": (annotations: PreviewAnnotation[]) => any;
|
|
46
|
+
}, string, import("vue").PublicProps, Readonly<globalThis.ExtractPropTypes<{
|
|
47
|
+
target: {
|
|
48
|
+
type: () => HTMLElement;
|
|
49
|
+
required: true;
|
|
50
|
+
};
|
|
51
|
+
tool: {
|
|
52
|
+
type: () => PreviewDrawTool | null;
|
|
53
|
+
default: any;
|
|
54
|
+
};
|
|
55
|
+
strokeStyle: {
|
|
56
|
+
type: () => PreviewStrokeStyle;
|
|
57
|
+
default: string;
|
|
58
|
+
};
|
|
59
|
+
zoomLevel: {
|
|
60
|
+
type: NumberConstructor;
|
|
61
|
+
default: number;
|
|
62
|
+
};
|
|
63
|
+
color: {
|
|
64
|
+
type: StringConstructor;
|
|
65
|
+
default: string;
|
|
66
|
+
};
|
|
67
|
+
strokeWidth: {
|
|
68
|
+
type: NumberConstructor;
|
|
69
|
+
default: number;
|
|
70
|
+
};
|
|
71
|
+
showAnnotations: {
|
|
72
|
+
type: BooleanConstructor;
|
|
73
|
+
default: boolean;
|
|
74
|
+
};
|
|
75
|
+
}>> & Readonly<{
|
|
76
|
+
"onSelection-change"?: (annotationId: string) => any;
|
|
77
|
+
"onState-change"?: (state: PreviewDrawingState) => any;
|
|
78
|
+
"onAnnotation-add"?: (annotation: PreviewAnnotation) => any;
|
|
79
|
+
"onAnnotation-delete"?: (annotationId: string) => any;
|
|
80
|
+
"onAnnotations-clear"?: () => any;
|
|
81
|
+
"onAnnotations-change"?: (annotations: PreviewAnnotation[]) => any;
|
|
82
|
+
}>, {
|
|
83
|
+
color: string;
|
|
84
|
+
showAnnotations: boolean;
|
|
85
|
+
zoomLevel: number;
|
|
86
|
+
tool: PreviewDrawTool;
|
|
87
|
+
strokeStyle: PreviewStrokeStyle;
|
|
88
|
+
strokeWidth: number;
|
|
89
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
90
|
+
declare const _default: typeof __VLS_export;
|
|
91
|
+
export default _default;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { PreviewAnnotation, PreviewPoint } from './types';
|
|
2
|
+
/** 将数值限制在指定范围内,用于约束归一化坐标和线宽。 */
|
|
3
|
+
export declare const clamp: (value: number, min: number, max: number) => number;
|
|
4
|
+
/** 计算两个二维点之间的欧氏距离。 */
|
|
5
|
+
export declare const distance: (a: PreviewPoint, b: PreviewPoint) => number;
|
|
6
|
+
/**
|
|
7
|
+
* 根据一次拖拽开始时的面板位置和指针位移计算新位置。
|
|
8
|
+
* 每次按下都传入新的起始位置,避免连续拖拽复用上一次的坐标状态。
|
|
9
|
+
*/
|
|
10
|
+
export declare function getBoundedPanelPosition(panelStart: PreviewPoint, pointerDelta: PreviewPoint, panelSize: PreviewPoint, viewportSize: PreviewPoint, viewportPadding?: number): {
|
|
11
|
+
x: number;
|
|
12
|
+
y: number;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* 检测最新轨迹片段是否回到起始轨迹附近。
|
|
16
|
+
* 同时支持“端点靠近起点”和“末端与起始线段重合”两种闭合方式。
|
|
17
|
+
*/
|
|
18
|
+
export declare function isPathClosing(points: PreviewPoint[], closeRadius: number, minimumDistance: number): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* 使用 Ramer-Douglas-Peucker 算法压缩自由轨迹点。
|
|
21
|
+
* 降低点数可以显著减少 SVG 更新和后续持久化成本。
|
|
22
|
+
*/
|
|
23
|
+
export declare function simplifyPath(points: PreviewPoint[], tolerance: number): PreviewPoint[];
|
|
24
|
+
export declare const toCanvasPoints: (points: PreviewPoint[], width: number, height: number) => {
|
|
25
|
+
x: number;
|
|
26
|
+
y: number;
|
|
27
|
+
}[];
|
|
28
|
+
/** 将点集合转换为 SVG 折线路径,闭合轨迹末尾追加 Z 指令。 */
|
|
29
|
+
export declare function toPolylinePath(points: PreviewPoint[], closed?: boolean): string;
|
|
30
|
+
/**
|
|
31
|
+
* 将直线转换为围绕原线段上下偏移的正弦波路径。
|
|
32
|
+
* 首尾振幅固定为零,便于矩形四条边在转角处准确衔接。
|
|
33
|
+
*/
|
|
34
|
+
export declare function toWavySegment(start: PreviewPoint, end: PreviewPoint, amplitude?: number, wavelength?: number): PreviewPoint[];
|
|
35
|
+
export declare function getRectangle(start: PreviewPoint, end: PreviewPoint): {
|
|
36
|
+
x: number;
|
|
37
|
+
y: number;
|
|
38
|
+
width: number;
|
|
39
|
+
height: number;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* 将四条边分别转换为波浪线并拼成闭合矩形。
|
|
43
|
+
* 每条边首尾振幅为零,因此转角处不会出现超出矩形范围的重叠。
|
|
44
|
+
*/
|
|
45
|
+
export declare function toWavyRectanglePath(start: PreviewPoint, end: PreviewPoint, amplitude?: number, wavelength?: number): string;
|
|
46
|
+
export declare function toWavyLinePath(start: PreviewPoint, end: PreviewPoint, amplitude?: number, wavelength?: number): string;
|
|
47
|
+
/**
|
|
48
|
+
* 计算标注的外接矩形,用于选择态边框。
|
|
49
|
+
* 矩形标注只需要首尾两个点,自由轨迹需要遍历全部采样点。
|
|
50
|
+
*/
|
|
51
|
+
export declare function getAnnotationBounds(annotation: PreviewAnnotation): {
|
|
52
|
+
x: number;
|
|
53
|
+
y: number;
|
|
54
|
+
width: number;
|
|
55
|
+
height: number;
|
|
56
|
+
};
|