@hankchen/canvas-editor-vue 0.3.0 → 0.4.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/dist/canvas/CanvasSurface.d.ts +28 -1
- package/dist/canvas/{ContentTypePill.d.ts → EditOverlayToolbar.d.ts} +19 -0
- package/dist/canvas/TextEditingOverlay.d.ts +31 -3
- package/dist/canvas/index.d.ts +1 -1
- package/dist/canvas/useTextEditing.d.ts +30 -8
- package/dist/{canvas-ZMyaouKe.js → canvas-DqQislJ_.js} +813 -434
- package/dist/canvas.js +2 -2
- package/dist/index.js +15 -14
- package/dist/{layer-panel-CEyB57XM.js → layer-panel-DskyCgF5.js} +7 -7
- package/dist/layer-panel.js +1 -1
- package/dist/panel-theme.css +24 -0
- package/dist/{completionAnchor-Da8VhzMQ.js → popupPosition-Ck5Gsvjy.js} +163 -107
- package/dist/property-panel/PropertyField.d.ts +6 -0
- package/dist/property-panel/fieldSchema.d.ts +7 -1
- package/dist/property-panel/fields/ImageSrcField.d.ts +5 -1
- package/dist/property-panel/fields/ResourceValueField.d.ts +19 -0
- package/dist/property-panel/fields/TextareaField.d.ts +1 -0
- package/dist/property-panel/fields/ValueTypeSegmented.d.ts +3 -1
- package/dist/property-panel/index.d.ts +5 -3
- package/dist/property-panel/usePropertyPanel.d.ts +16 -4
- package/dist/{property-panel-DmSf_GPu.js → property-panel-B32ZBQdf.js} +472 -376
- package/dist/property-panel.js +3 -2
- package/dist/resourceTemplate-cdcQtp9a.js +246 -0
- package/dist/shared/ExpressionPathPicker.d.ts +25 -0
- package/dist/shared/completion.d.ts +14 -10
- package/dist/shared/expressionContext.d.ts +2 -2
- package/dist/shared/index.d.ts +14 -1
- package/dist/shared/mergeKey.d.ts +2 -0
- package/dist/shared/pathPickerModel.d.ts +11 -0
- package/dist/shared/popupPosition.d.ts +41 -0
- package/dist/shared/resourceTemplate.d.ts +7 -0
- package/dist/shared/useExpressionCompletion.d.ts +0 -7
- package/dist/shared/useExpressionDiagnostics.d.ts +15 -0
- package/dist/shared.js +10 -9
- package/dist/style.css +1 -1
- package/dist/uploadFile-D1RY-ji0.js +516 -0
- package/dist/usePathCompletion-Do17CQ6l.js +220 -0
- package/package.json +2 -2
- package/dist/uploadFile-DXAEX9kG.js +0 -455
- package/dist/usePathCompletion-C52F4phW.js +0 -229
- /package/dist/{property-panel → shared}/fontPicker.d.ts +0 -0
|
@@ -25,14 +25,30 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
25
25
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
|
|
26
26
|
rootRef: HTMLDivElement;
|
|
27
27
|
textareaRef: HTMLTextAreaElement;
|
|
28
|
-
|
|
28
|
+
toolbarRef: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{
|
|
29
29
|
mode: "static" | "expression";
|
|
30
|
+
font: string;
|
|
31
|
+
fontSize: number;
|
|
32
|
+
fontColor: string;
|
|
33
|
+
horizontalAlign: import('@hankchen/canvas').HorizontalAlign;
|
|
34
|
+
verticalAlign: import('@hankchen/canvas').VerticalAlign;
|
|
35
|
+
autowrap: boolean;
|
|
30
36
|
}> & Readonly<{
|
|
31
37
|
onChange?: ((value: "expression" | "static") => any) | undefined;
|
|
38
|
+
onStyleWrite?: ((write: {
|
|
39
|
+
key: readonly string[];
|
|
40
|
+
value: unknown;
|
|
41
|
+
final: boolean;
|
|
42
|
+
}) => any) | undefined;
|
|
32
43
|
}>, {
|
|
33
44
|
rootEl: import('vue').Ref<HTMLElement | null, HTMLElement | null>;
|
|
34
45
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
35
46
|
change: (value: "expression" | "static") => any;
|
|
47
|
+
styleWrite: (write: {
|
|
48
|
+
key: readonly string[];
|
|
49
|
+
value: unknown;
|
|
50
|
+
final: boolean;
|
|
51
|
+
}) => any;
|
|
36
52
|
}, import('vue').PublicProps, {}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
|
|
37
53
|
rootRef: HTMLDivElement;
|
|
38
54
|
}, HTMLDivElement, import('vue').ComponentProvideOptions, {
|
|
@@ -44,8 +60,19 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
44
60
|
Defaults: {};
|
|
45
61
|
}, Readonly<{
|
|
46
62
|
mode: "static" | "expression";
|
|
63
|
+
font: string;
|
|
64
|
+
fontSize: number;
|
|
65
|
+
fontColor: string;
|
|
66
|
+
horizontalAlign: import('@hankchen/canvas').HorizontalAlign;
|
|
67
|
+
verticalAlign: import('@hankchen/canvas').VerticalAlign;
|
|
68
|
+
autowrap: boolean;
|
|
47
69
|
}> & Readonly<{
|
|
48
70
|
onChange?: ((value: "expression" | "static") => any) | undefined;
|
|
71
|
+
onStyleWrite?: ((write: {
|
|
72
|
+
key: readonly string[];
|
|
73
|
+
value: unknown;
|
|
74
|
+
final: boolean;
|
|
75
|
+
}) => any) | undefined;
|
|
49
76
|
}>, {
|
|
50
77
|
rootEl: import('vue').Ref<HTMLElement | null, HTMLElement | null>;
|
|
51
78
|
}, {}, {}, {}, {}> | null;
|
|
@@ -1,13 +1,32 @@
|
|
|
1
|
+
import { HorizontalAlign, VerticalAlign } from '@hankchen/canvas-editor';
|
|
1
2
|
type __VLS_Props = {
|
|
2
3
|
/** 当前会话模式(ui.editing.expression 投影):激活项高亮随之 */
|
|
3
4
|
mode: 'static' | 'expression';
|
|
5
|
+
/** 字体引用(textEditLayout.font 原串;空串 = 内置默认字体) */
|
|
6
|
+
font: string;
|
|
7
|
+
/** 场景字号(读数恒场景像素,不随 zoom 折算——工单 04 验收项) */
|
|
8
|
+
fontSize: number;
|
|
9
|
+
fontColor: string;
|
|
10
|
+
horizontalAlign: HorizontalAlign;
|
|
11
|
+
verticalAlign: VerticalAlign;
|
|
12
|
+
autowrap: boolean;
|
|
4
13
|
};
|
|
5
14
|
declare const _default: import('vue').DefineComponent<__VLS_Props, {
|
|
6
15
|
rootEl: import('vue').Ref<HTMLElement | null, HTMLElement | null>;
|
|
7
16
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
8
17
|
change: (value: "expression" | "static") => any;
|
|
18
|
+
styleWrite: (write: {
|
|
19
|
+
key: readonly string[];
|
|
20
|
+
value: unknown;
|
|
21
|
+
final: boolean;
|
|
22
|
+
}) => any;
|
|
9
23
|
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
10
24
|
onChange?: ((value: "expression" | "static") => any) | undefined;
|
|
25
|
+
onStyleWrite?: ((write: {
|
|
26
|
+
key: readonly string[];
|
|
27
|
+
value: unknown;
|
|
28
|
+
final: boolean;
|
|
29
|
+
}) => any) | undefined;
|
|
11
30
|
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
12
31
|
rootRef: HTMLDivElement;
|
|
13
32
|
}, HTMLDivElement>;
|
|
@@ -12,20 +12,37 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {
|
|
|
12
12
|
commitEditing: () => void;
|
|
13
13
|
/** 编辑态查询 */
|
|
14
14
|
isEditing: () => boolean;
|
|
15
|
-
/** 指针目标是否属于编辑中的 textarea
|
|
16
|
-
* 两者的指针都归编辑面——textarea
|
|
15
|
+
/** 指针目标是否属于编辑中的 textarea 或整条工具条(表面组件分流:
|
|
16
|
+
* 两者的指针都归编辑面——textarea 编辑光标、工具条样式段点按,
|
|
17
|
+
* 不点选/拖动/提交) */
|
|
17
18
|
ownsEventTarget: (target: EventTarget | null) => boolean;
|
|
18
19
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
19
20
|
rootRef: HTMLDivElement;
|
|
20
21
|
textareaRef: HTMLTextAreaElement;
|
|
21
|
-
|
|
22
|
+
toolbarRef: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{
|
|
22
23
|
mode: "static" | "expression";
|
|
24
|
+
font: string;
|
|
25
|
+
fontSize: number;
|
|
26
|
+
fontColor: string;
|
|
27
|
+
horizontalAlign: import('@hankchen/canvas').HorizontalAlign;
|
|
28
|
+
verticalAlign: import('@hankchen/canvas').VerticalAlign;
|
|
29
|
+
autowrap: boolean;
|
|
23
30
|
}> & Readonly<{
|
|
24
31
|
onChange?: ((value: "expression" | "static") => any) | undefined;
|
|
32
|
+
onStyleWrite?: ((write: {
|
|
33
|
+
key: readonly string[];
|
|
34
|
+
value: unknown;
|
|
35
|
+
final: boolean;
|
|
36
|
+
}) => any) | undefined;
|
|
25
37
|
}>, {
|
|
26
38
|
rootEl: import('vue').Ref<HTMLElement | null, HTMLElement | null>;
|
|
27
39
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
28
40
|
change: (value: "expression" | "static") => any;
|
|
41
|
+
styleWrite: (write: {
|
|
42
|
+
key: readonly string[];
|
|
43
|
+
value: unknown;
|
|
44
|
+
final: boolean;
|
|
45
|
+
}) => any;
|
|
29
46
|
}, import('vue').PublicProps, {}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
|
|
30
47
|
rootRef: HTMLDivElement;
|
|
31
48
|
}, HTMLDivElement, import('vue').ComponentProvideOptions, {
|
|
@@ -37,8 +54,19 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {
|
|
|
37
54
|
Defaults: {};
|
|
38
55
|
}, Readonly<{
|
|
39
56
|
mode: "static" | "expression";
|
|
57
|
+
font: string;
|
|
58
|
+
fontSize: number;
|
|
59
|
+
fontColor: string;
|
|
60
|
+
horizontalAlign: import('@hankchen/canvas').HorizontalAlign;
|
|
61
|
+
verticalAlign: import('@hankchen/canvas').VerticalAlign;
|
|
62
|
+
autowrap: boolean;
|
|
40
63
|
}> & Readonly<{
|
|
41
64
|
onChange?: ((value: "expression" | "static") => any) | undefined;
|
|
65
|
+
onStyleWrite?: ((write: {
|
|
66
|
+
key: readonly string[];
|
|
67
|
+
value: unknown;
|
|
68
|
+
final: boolean;
|
|
69
|
+
}) => any) | undefined;
|
|
42
70
|
}>, {
|
|
43
71
|
rootEl: import('vue').Ref<HTMLElement | null, HTMLElement | null>;
|
|
44
72
|
}, {}, {}, {}, {}> | null;
|
package/dist/canvas/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
export { default as AlignFloatBar } from './AlignFloatBar';
|
|
7
7
|
export { default as CanvasSurface, type CanvasSurfaceReady } from './CanvasSurface';
|
|
8
8
|
export { default as ContextMenu } from './ContextMenu';
|
|
9
|
-
export { default as
|
|
9
|
+
export { default as EditOverlayToolbar } from './EditOverlayToolbar';
|
|
10
10
|
export { default as FindBar } from './FindBar';
|
|
11
11
|
export { default as GuidesOverlay } from './GuidesOverlay';
|
|
12
12
|
export { default as Ruler, type RulerGuideGesture } from './Ruler';
|
|
@@ -6,24 +6,39 @@ export interface TextEditingHosts {
|
|
|
6
6
|
/** 画布表面宿主元素(区分「画布内点按」与「面板/工具栏等外部交互」) */
|
|
7
7
|
getHost: () => HTMLElement | null;
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
9
|
+
* 编辑浮层工具条根元素(可选,工单 03):与 textarea 同入豁免集——工具条
|
|
10
|
+
* 点击不得触发表面组件 pointerdown 的 commitNow/点选/拖动路径;也是屏幕
|
|
11
|
+
* 恒定尺寸的实测面(offsetWidth/Height + RO 跟随,翻转/钳制/居中都吃它)
|
|
11
12
|
*/
|
|
12
|
-
|
|
13
|
+
getToolbar?: () => HTMLElement | null;
|
|
13
14
|
}
|
|
14
15
|
export interface TextEditingBinding {
|
|
15
16
|
/** 编辑中的图层路径;null = 非编辑态 */
|
|
16
17
|
editing: ComputedRef<LayerPath | null>;
|
|
17
18
|
/** 编辑层的布局描述(内核查询,路径失效为 null) */
|
|
18
19
|
layout: ComputedRef<TextEditLayout | null>;
|
|
20
|
+
/**
|
|
21
|
+
* 草稿接管序号(edit-overlay-toolbar 工单 02,会话内容独占的内核底线面):
|
|
22
|
+
* 会话对象 draftSeq 的投影——旁门内容写(查找替换等程序化写)命中编辑层时
|
|
23
|
+
* 内核递增,绑定层据此全量替换 textarea 草稿为文档新值并刷新表达式诊断
|
|
24
|
+
* (pill 翻标志不递增,草稿不动)。未接管过为 undefined。
|
|
25
|
+
*/
|
|
26
|
+
draftSeq: ComputedRef<number | undefined>;
|
|
19
27
|
/** textarea 内联样式(随相机/dpr 实时跟随;字号视觉恒定) */
|
|
20
28
|
style: ComputedRef<CSSProperties | null>;
|
|
21
29
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
30
|
+
* 编辑浮层工具条内联样式(edit-overlay-toolbar 工单 03,ADR 0019):屏幕恒定
|
|
31
|
+
* 尺寸系——屏幕坐标 left/top 直接定位、无 scale 变换,锚点 = 图层框上缘中点
|
|
32
|
+
* 的屏幕折算点(与 textarea 的场景像素换算系分叉,浮层定位两套并存);上缘
|
|
33
|
+
* 放不下整条翻框下缘、水平钳制画布视口;null = 非编辑态
|
|
34
|
+
*/
|
|
35
|
+
toolbarStyle: ComputedRef<CSSProperties | null>;
|
|
36
|
+
/**
|
|
37
|
+
* 工具条标签类浮示锚点内联样式(工单 03):挂工具条左端外侧、背离图层盒一侧
|
|
38
|
+
* (工具条在上挂其上方,翻下随翻下方;表达式语法诊断条消费面),与工具条同
|
|
39
|
+
* 屏幕恒定系;null = 非编辑态
|
|
25
40
|
*/
|
|
26
|
-
|
|
41
|
+
toolbarTagStyle: ComputedRef<CSSProperties | null>;
|
|
27
42
|
/**
|
|
28
43
|
* 呈现缩放(snapViewportToPhysicalPixels 后的 zoom):补全锚点测量的 scale
|
|
29
44
|
* 消费面——画布 textarea 整体在 transform: scale(zoom) 系(工单 03 补全绑定)
|
|
@@ -45,9 +60,16 @@ export interface TextEditingBinding {
|
|
|
45
60
|
* 零文档变更零历史步);非编辑态或目标即现态零操作
|
|
46
61
|
*/
|
|
47
62
|
setExpressionMode(expression: boolean): void;
|
|
63
|
+
/**
|
|
64
|
+
* 工具条样式段权威写(edit-overlay-toolbar 工单 04):与属性面板同门——
|
|
65
|
+
* updateSpec + `sel:path:key` mergeKey(usePropertyPanel.commit 的 spec 分支
|
|
66
|
+
* 同一约定),连续操作合并一步历史;final = 收口(closeMerge)。新层样式槽
|
|
67
|
+
* 随权威写在内核 updateSpec 漏斗自动捕获(与面板写不分叉)。非编辑态零操作。
|
|
68
|
+
*/
|
|
69
|
+
updateStyleField(key: readonly string[], value: unknown, final: boolean): void;
|
|
48
70
|
/** blur 延迟提交:外部指针交互豁免、焦点落回取消(语义见模块头注释) */
|
|
49
71
|
armBlurCommit(): void;
|
|
50
|
-
/** 编辑态查询:目标是否属于编辑中的 textarea
|
|
72
|
+
/** 编辑态查询:目标是否属于编辑中的 textarea 或整条工具条(表面组件的指针分流用) */
|
|
51
73
|
ownsEventTarget(target: EventTarget | null): boolean;
|
|
52
74
|
}
|
|
53
75
|
export declare function useTextEditing(editor: EditorSession, hosts: TextEditingHosts): TextEditingBinding;
|