@hankchen/canvas-editor-vue 0.0.0-stage → 0.1.1

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 (104) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +22 -2
  3. package/dist/canvas/AlignFloatBar.d.ts +6 -0
  4. package/dist/canvas/CanvasSurface.d.ts +131 -0
  5. package/dist/canvas/ContentTypePill.d.ts +14 -0
  6. package/dist/canvas/ContextMenu.d.ts +14 -0
  7. package/dist/canvas/FindBar.d.ts +13 -0
  8. package/dist/canvas/GuidesOverlay.d.ts +18 -0
  9. package/dist/canvas/Ruler.d.ts +24 -0
  10. package/dist/canvas/TextEditingOverlay.d.ts +70 -0
  11. package/dist/canvas/createBand.d.ts +6 -0
  12. package/dist/canvas/findHighlight.d.ts +12 -0
  13. package/dist/canvas/gizmo.d.ts +24 -0
  14. package/dist/canvas/guideSnap.d.ts +3 -0
  15. package/dist/canvas/index.d.ts +20 -0
  16. package/dist/canvas/resizeHandles.d.ts +3 -0
  17. package/dist/canvas/scheduler.d.ts +2 -0
  18. package/dist/canvas/useDpr.d.ts +10 -0
  19. package/dist/canvas/useFindSession.d.ts +13 -0
  20. package/dist/canvas/useTextEditing.d.ts +53 -0
  21. package/dist/canvas-CS4SmrIO.js +1649 -0
  22. package/dist/canvas.js +2 -0
  23. package/dist/completionAnchor-4lhR2kJz.js +273 -0
  24. package/dist/createLucideIcon-CMq8ZKo2.js +96 -0
  25. package/dist/dist-DuXLYZZ9.js +341 -0
  26. package/dist/index.d.ts +19 -0
  27. package/dist/index.js +16 -0
  28. package/dist/layer-panel/LayerPanel.d.ts +32 -0
  29. package/dist/layer-panel/addMenu.d.ts +18 -0
  30. package/dist/layer-panel/index.d.ts +7 -0
  31. package/dist/layer-panel/useLayerPanel.d.ts +12 -0
  32. package/dist/layer-panel-ArP66_vZ.js +652 -0
  33. package/dist/layer-panel.js +2 -0
  34. package/dist/layerPath-BRZK9ka1.js +2160 -0
  35. package/dist/panel-theme.css +254 -0
  36. package/dist/property-panel/PropertyField.d.ts +65 -0
  37. package/dist/property-panel/PropertyPanel.d.ts +6 -0
  38. package/dist/property-panel/controlStyles.d.ts +17 -0
  39. package/dist/property-panel/controls.d.ts +3 -0
  40. package/dist/property-panel/fieldSchema.d.ts +116 -0
  41. package/dist/property-panel/fields/AlignField.d.ts +11 -0
  42. package/dist/property-panel/fields/AnchorDisclosureField.d.ts +16 -0
  43. package/dist/property-panel/fields/BooleanField.d.ts +13 -0
  44. package/dist/property-panel/fields/BorderField.d.ts +14 -0
  45. package/dist/property-panel/fields/BorderWidthInput.d.ts +14 -0
  46. package/dist/property-panel/fields/ColorField.d.ts +13 -0
  47. package/dist/property-panel/fields/FontField.d.ts +15 -0
  48. package/dist/property-panel/fields/ImageSrcField.d.ts +20 -0
  49. package/dist/property-panel/fields/NumberField.d.ts +13 -0
  50. package/dist/property-panel/fields/PaddingField.d.ts +14 -0
  51. package/dist/property-panel/fields/PairField.d.ts +19 -0
  52. package/dist/property-panel/fields/SelectField.d.ts +11 -0
  53. package/dist/property-panel/fields/ShorthandModeButton.d.ts +13 -0
  54. package/dist/property-panel/fields/TextField.d.ts +13 -0
  55. package/dist/property-panel/fields/TextareaField.d.ts +13 -0
  56. package/dist/property-panel/fields/ValueTypeSegmented.d.ts +10 -0
  57. package/dist/property-panel/fields/index.d.ts +16 -0
  58. package/dist/property-panel/fontPicker.d.ts +13 -0
  59. package/dist/property-panel/imageUpload.d.ts +11 -0
  60. package/dist/property-panel/index.d.ts +13 -0
  61. package/dist/property-panel/shorthand.d.ts +28 -0
  62. package/dist/property-panel/usePropertyPanel.d.ts +51 -0
  63. package/dist/property-panel/useShorthandMode.d.ts +18 -0
  64. package/dist/property-panel-jt_rsTVW.js +1719 -0
  65. package/dist/property-panel.js +2 -0
  66. package/dist/shared/DropdownMenu.d.ts +47 -0
  67. package/dist/shared/ExpressionCompletionPopup.d.ts +14 -0
  68. package/dist/shared/HelpDialog.d.ts +12 -0
  69. package/dist/shared/PanelIcon.d.ts +14 -0
  70. package/dist/shared/completion.d.ts +49 -0
  71. package/dist/shared/completionAnchor.d.ts +28 -0
  72. package/dist/shared/editableTarget.d.ts +5 -0
  73. package/dist/shared/expressionContext.d.ts +22 -0
  74. package/dist/shared/index.d.ts +37 -0
  75. package/dist/shared/rowsPathCompletionSource.d.ts +3 -0
  76. package/dist/shared/shortcutsHelp.d.ts +30 -0
  77. package/dist/shared/uploadFile.d.ts +2 -0
  78. package/dist/shared/useDataSourceSchema.d.ts +3 -0
  79. package/dist/shared/useDropdownMenu.d.ts +51 -0
  80. package/dist/shared/useExpressionCompletion.d.ts +45 -0
  81. package/dist/shared/useHistory.d.ts +7 -0
  82. package/dist/shared/usePathCompletion.d.ts +18 -0
  83. package/dist/shared/useSelection.d.ts +3 -0
  84. package/dist/shared/useShortcuts.d.ts +2 -0
  85. package/dist/shared/useShortcutsHelp.d.ts +9 -0
  86. package/dist/shared/useTransientFeedback.d.ts +10 -0
  87. package/dist/shared/useViewport.d.ts +3 -0
  88. package/dist/shared-D9zYUQaw.js +123 -0
  89. package/dist/shared.js +9 -0
  90. package/dist/status-bar/StatusBar.d.ts +17 -0
  91. package/dist/status-bar/index.d.ts +9 -0
  92. package/dist/status-bar/layerGeometryLabel.d.ts +13 -0
  93. package/dist/status-bar/layerPathLabel.d.ts +2 -0
  94. package/dist/status-bar/useDoc.d.ts +3 -0
  95. package/dist/status-bar-BhhrVoBZ.js +194 -0
  96. package/dist/status-bar.js +2 -0
  97. package/dist/style.css +2 -0
  98. package/dist/uploadFile-CutE_xI-.js +330 -0
  99. package/dist/useDataSourceSchema-C924m8fc.js +237 -0
  100. package/dist/usePathCompletion-DkHoGla4.js +228 -0
  101. package/dist/useShortcutsHelp-DTC3yRil.js +19 -0
  102. package/dist/useTransientFeedback-gS9Xa9GY.js +477 -0
  103. package/dist/useViewport-BLe2ise1.js +18 -0
  104. package/package.json +77 -3
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 HankChen
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,23 @@
1
- # Temporary Holding Version
1
+ # @hankchen/canvas-editor-vue
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ [@hankchen/canvas-editor](https://www.npmjs.com/package/@hankchen/canvas-editor) 的 Vue 3 薄绑定:画布表面组件(CanvasSurface)、composables 切片桥、schema 驱动属性面板、图层面板与状态栏。
4
+
5
+ ## 安装
6
+
7
+ ```sh
8
+ npm install @hankchen/canvas @hankchen/canvas-editor @hankchen/canvas-editor-vue
9
+ ```
10
+
11
+ peerDependencies 要求 `vue ^3.5`。
12
+
13
+ ## 使用
14
+
15
+ 子路径出口:`.`、`./canvas`、`./property-panel`、`./layer-panel`、`./status-bar`、`./shared`、`./panel-theme.css`(面板主题令牌)、`./style.css`(组件样式,需在应用入口以副作用方式引入)。
16
+
17
+ ```ts
18
+ import '@hankchen/canvas-editor-vue/panel-theme.css'
19
+ import '@hankchen/canvas-editor-vue/style.css'
20
+ import { CanvasSurface } from '@hankchen/canvas-editor-vue/canvas'
21
+ ```
22
+
23
+ 完整目验见 [canvas-web playground](https://github.com/HankChenCH/canvas-web)。
@@ -0,0 +1,6 @@
1
+ import { EditorSession } from '@hankchen/canvas-editor';
2
+ type __VLS_Props = {
3
+ editor: EditorSession;
4
+ };
5
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
6
+ export default _default;
@@ -0,0 +1,131 @@
1
+ import { EditorSession } from '@hankchen/canvas-editor';
2
+ export interface CanvasSurfaceReady {
3
+ contentCanvas: HTMLCanvasElement;
4
+ overlayCanvas: HTMLCanvasElement;
5
+ }
6
+ type __VLS_Props = {
7
+ editor: EditorSession;
8
+ };
9
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
10
+ ready: (surface: CanvasSurfaceReady) => any;
11
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
12
+ onReady?: ((surface: CanvasSurfaceReady) => any) | undefined;
13
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
14
+ hostRef: HTMLDivElement;
15
+ contentRef: HTMLCanvasElement;
16
+ overlayRef: HTMLCanvasElement;
17
+ textEditRef: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{
18
+ editor: EditorSession;
19
+ }> & Readonly<{}>, {
20
+ beginAt: (sceneX: number, sceneY: number) => boolean;
21
+ beginTextEdit: (path: import('@hankchen/canvas-editor').LayerPath) => boolean;
22
+ commitEditing: () => void;
23
+ isEditing: () => boolean;
24
+ ownsEventTarget: (target: EventTarget | null) => boolean;
25
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
26
+ rootRef: HTMLDivElement;
27
+ textareaRef: HTMLTextAreaElement;
28
+ pillRef: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{
29
+ mode: "static" | "expression";
30
+ }> & Readonly<{
31
+ onChange?: ((value: "expression" | "static") => any) | undefined;
32
+ }>, {
33
+ rootEl: import('vue').Ref<HTMLElement | null, HTMLElement | null>;
34
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
35
+ change: (value: "expression" | "static") => any;
36
+ }, import('vue').PublicProps, {}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
37
+ rootRef: HTMLDivElement;
38
+ }, HTMLDivElement, import('vue').ComponentProvideOptions, {
39
+ P: {};
40
+ B: {};
41
+ D: {};
42
+ C: {};
43
+ M: {};
44
+ Defaults: {};
45
+ }, Readonly<{
46
+ mode: "static" | "expression";
47
+ }> & Readonly<{
48
+ onChange?: ((value: "expression" | "static") => any) | undefined;
49
+ }>, {
50
+ rootEl: import('vue').Ref<HTMLElement | null, HTMLElement | null>;
51
+ }, {}, {}, {}, {}> | null;
52
+ popupRef: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{
53
+ state: import('..').ExpressionCompletionState;
54
+ }> & Readonly<{
55
+ onSelect?: ((index: number) => any) | undefined;
56
+ }>, {
57
+ rootEl: import('vue').Ref<HTMLElement | null, HTMLElement | null>;
58
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
59
+ select: (index: number) => any;
60
+ }, import('vue').PublicProps, {}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
61
+ rootRef: HTMLDivElement;
62
+ }, any, import('vue').ComponentProvideOptions, {
63
+ P: {};
64
+ B: {};
65
+ D: {};
66
+ C: {};
67
+ M: {};
68
+ Defaults: {};
69
+ }, Readonly<{
70
+ state: import('..').ExpressionCompletionState;
71
+ }> & Readonly<{
72
+ onSelect?: ((index: number) => any) | undefined;
73
+ }>, {
74
+ rootEl: import('vue').Ref<HTMLElement | null, HTMLElement | null>;
75
+ }, {}, {}, {}, {}> | null;
76
+ }, HTMLDivElement, import('vue').ComponentProvideOptions, {
77
+ P: {};
78
+ B: {};
79
+ D: {};
80
+ C: {};
81
+ M: {};
82
+ Defaults: {};
83
+ }, Readonly<{
84
+ editor: EditorSession;
85
+ }> & Readonly<{}>, {
86
+ beginAt: (sceneX: number, sceneY: number) => boolean;
87
+ beginTextEdit: (path: import('@hankchen/canvas-editor').LayerPath) => boolean;
88
+ commitEditing: () => void;
89
+ isEditing: () => boolean;
90
+ ownsEventTarget: (target: EventTarget | null) => boolean;
91
+ }, {}, {}, {}, {}> | null;
92
+ contextMenuRef: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{
93
+ editor: EditorSession;
94
+ }> & Readonly<{}>, {
95
+ openAt: (x: number, y: number) => Promise<void>;
96
+ close: () => void;
97
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
98
+ rootRef: HTMLDivElement;
99
+ }, any, import('vue').ComponentProvideOptions, {
100
+ P: {};
101
+ B: {};
102
+ D: {};
103
+ C: {};
104
+ M: {};
105
+ Defaults: {};
106
+ }, Readonly<{
107
+ editor: EditorSession;
108
+ }> & Readonly<{}>, {
109
+ openAt: (x: number, y: number) => Promise<void>;
110
+ close: () => void;
111
+ }, {}, {}, {}, {}> | null;
112
+ findBarRef: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{
113
+ editor: EditorSession;
114
+ }> & Readonly<{}>, {
115
+ close: () => void;
116
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
117
+ queryInput: HTMLInputElement;
118
+ }, any, import('vue').ComponentProvideOptions, {
119
+ P: {};
120
+ B: {};
121
+ D: {};
122
+ C: {};
123
+ M: {};
124
+ Defaults: {};
125
+ }, Readonly<{
126
+ editor: EditorSession;
127
+ }> & Readonly<{}>, {
128
+ close: () => void;
129
+ }, {}, {}, {}, {}> | null;
130
+ }, HTMLDivElement>;
131
+ export default _default;
@@ -0,0 +1,14 @@
1
+ type __VLS_Props = {
2
+ /** 当前会话模式(ui.editing.expression 投影):激活项高亮随之 */
3
+ mode: 'static' | 'expression';
4
+ };
5
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {
6
+ rootEl: import('vue').Ref<HTMLElement | null, HTMLElement | null>;
7
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
8
+ change: (value: "expression" | "static") => any;
9
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
10
+ onChange?: ((value: "expression" | "static") => any) | undefined;
11
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
12
+ rootRef: HTMLDivElement;
13
+ }, HTMLDivElement>;
14
+ export default _default;
@@ -0,0 +1,14 @@
1
+ import { EditorSession } from '@hankchen/canvas-editor';
2
+ type __VLS_Props = {
3
+ editor: EditorSession;
4
+ };
5
+ /** 打开菜单(视口坐标,表面本地 css 像素);打开后按实际尺寸钳位进宿主边界 */
6
+ declare function openAt(x: number, y: number): Promise<void>;
7
+ declare function close(): void;
8
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {
9
+ openAt: typeof openAt;
10
+ close: typeof close;
11
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
12
+ rootRef: HTMLDivElement;
13
+ }, any>;
14
+ export default _default;
@@ -0,0 +1,13 @@
1
+ import { EditorSession } from '@hankchen/canvas-editor';
2
+ type __VLS_Props = {
3
+ editor: EditorSession;
4
+ };
5
+ declare function close(): void;
6
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {
7
+ /** 表面组件转发关闭路径(CanvasSurface 窗口级 Escape 协议,ContextMenu 同款:
8
+ * 焦点已漂出输入框时 Esc 经窗口监听到达这里) */
9
+ close: typeof close;
10
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
11
+ queryInput: HTMLInputElement;
12
+ }, any>;
13
+ export default _default;
@@ -0,0 +1,18 @@
1
+ import { EditorSession } from '@hankchen/canvas-editor';
2
+ import { RulerGuideGesture } from './Ruler';
3
+ type __VLS_Props = {
4
+ editor: EditorSession;
5
+ };
6
+ declare function beginGuideDrag(gesture: RulerGuideGesture): void;
7
+ declare function moveGuideDrag(gesture: RulerGuideGesture): void;
8
+ declare function endGuideDrag(gesture: RulerGuideGesture): void;
9
+ declare function cancelGuideDrag(): void;
10
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {
11
+ beginGuideDrag: typeof beginGuideDrag;
12
+ moveGuideDrag: typeof moveGuideDrag;
13
+ endGuideDrag: typeof endGuideDrag;
14
+ cancelGuideDrag: typeof cancelGuideDrag;
15
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
16
+ rootRef: HTMLDivElement;
17
+ }, HTMLDivElement>;
18
+ export default _default;
@@ -0,0 +1,24 @@
1
+ import { EditorSession, GuideOrientation } from '@hankchen/canvas-editor';
2
+ /** 标尺拖出参考线的手势载荷(工单 03 参考线层消费):轴向 + 场景坐标 */
3
+ export interface RulerGuideGesture {
4
+ readonly orientation: GuideOrientation;
5
+ readonly position: number;
6
+ }
7
+ type __VLS_Props = {
8
+ editor: EditorSession;
9
+ };
10
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
11
+ "guide-drag-start": (gesture: RulerGuideGesture) => any;
12
+ "guide-drag-move": (gesture: RulerGuideGesture) => any;
13
+ "guide-drag-end": (gesture: RulerGuideGesture) => any;
14
+ "guide-drag-cancel": (gesture: RulerGuideGesture) => any;
15
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
16
+ "onGuide-drag-start"?: ((gesture: RulerGuideGesture) => any) | undefined;
17
+ "onGuide-drag-move"?: ((gesture: RulerGuideGesture) => any) | undefined;
18
+ "onGuide-drag-end"?: ((gesture: RulerGuideGesture) => any) | undefined;
19
+ "onGuide-drag-cancel"?: ((gesture: RulerGuideGesture) => any) | undefined;
20
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
21
+ topRef: HTMLDivElement;
22
+ leftRef: HTMLDivElement;
23
+ }, HTMLDivElement>;
24
+ export default _default;
@@ -0,0 +1,70 @@
1
+ import { EditorSession } from '@hankchen/canvas-editor';
2
+ type __VLS_Props = {
3
+ editor: EditorSession;
4
+ };
5
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {
6
+ /** 双击入口(表面组件转发):命中 TextLayer 才进入 */
7
+ beginAt: (sceneX: number, sceneY: number) => boolean;
8
+ /** 路径入口(表面组件转发):已知路径直接进入编辑——画拉建层的文本层
9
+ * 自动进编辑(drag-create 工单 02),内核校验类型 */
10
+ beginTextEdit: (path: import('@hankchen/canvas-editor').LayerPath) => boolean;
11
+ /** 画布点按的显式提交路径(表面组件 pointerdown 调用) */
12
+ commitEditing: () => void;
13
+ /** 编辑态查询 */
14
+ isEditing: () => boolean;
15
+ /** 指针目标是否属于编辑中的 textarea 或内容类型 pill(表面组件分流:
16
+ * 两者的指针都归编辑面——textarea 编辑光标、pill 切换,不点选/拖动/提交) */
17
+ ownsEventTarget: (target: EventTarget | null) => boolean;
18
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
19
+ rootRef: HTMLDivElement;
20
+ textareaRef: HTMLTextAreaElement;
21
+ pillRef: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{
22
+ mode: "static" | "expression";
23
+ }> & Readonly<{
24
+ onChange?: ((value: "expression" | "static") => any) | undefined;
25
+ }>, {
26
+ rootEl: import('vue').Ref<HTMLElement | null, HTMLElement | null>;
27
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
28
+ change: (value: "expression" | "static") => any;
29
+ }, import('vue').PublicProps, {}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
30
+ rootRef: HTMLDivElement;
31
+ }, HTMLDivElement, import('vue').ComponentProvideOptions, {
32
+ P: {};
33
+ B: {};
34
+ D: {};
35
+ C: {};
36
+ M: {};
37
+ Defaults: {};
38
+ }, Readonly<{
39
+ mode: "static" | "expression";
40
+ }> & Readonly<{
41
+ onChange?: ((value: "expression" | "static") => any) | undefined;
42
+ }>, {
43
+ rootEl: import('vue').Ref<HTMLElement | null, HTMLElement | null>;
44
+ }, {}, {}, {}, {}> | null;
45
+ popupRef: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{
46
+ state: import('..').ExpressionCompletionState;
47
+ }> & Readonly<{
48
+ onSelect?: ((index: number) => any) | undefined;
49
+ }>, {
50
+ rootEl: import('vue').Ref<HTMLElement | null, HTMLElement | null>;
51
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
52
+ select: (index: number) => any;
53
+ }, import('vue').PublicProps, {}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
54
+ rootRef: HTMLDivElement;
55
+ }, any, import('vue').ComponentProvideOptions, {
56
+ P: {};
57
+ B: {};
58
+ D: {};
59
+ C: {};
60
+ M: {};
61
+ Defaults: {};
62
+ }, Readonly<{
63
+ state: import('..').ExpressionCompletionState;
64
+ }> & Readonly<{
65
+ onSelect?: ((index: number) => any) | undefined;
66
+ }>, {
67
+ rootEl: import('vue').Ref<HTMLElement | null, HTMLElement | null>;
68
+ }, {}, {}, {}, {}> | null;
69
+ }, HTMLDivElement>;
70
+ export default _default;
@@ -0,0 +1,6 @@
1
+ import { EditorSession, OverlayPaintArgs } from '@hankchen/canvas-editor';
2
+ /**
3
+ * 绘制画拉橡皮筋(供组合画笔复用:调用的前提是 ctx 已施加呈现变换)。
4
+ * 无会话或零尺寸矩形(按下未动)零笔画。
5
+ */
6
+ export declare function drawCreateRubberBand(ctx: CanvasRenderingContext2D, editor: EditorSession, args: OverlayPaintArgs): void;
@@ -0,0 +1,12 @@
1
+ import { EditorSession, OverlayPaintArgs } from '@hankchen/canvas-editor';
2
+ export interface FindHighlightOptions {
3
+ /** 非当前命中轮廓色(缺省琥珀 #f59e0b——与选择框蓝分色) */
4
+ matchColor?: string;
5
+ /** 当前命中轮廓色(缺省 accent 天蓝 #38bdf8,浮层令牌 --cn-accent 同值) */
6
+ currentColor?: string;
7
+ /** 当前命中淡填充(缺省 rgba(56, 189, 248, 0.12);空串关闭填充) */
8
+ currentFill?: string;
9
+ /** 轮廓线宽(css 像素,屏幕观感恒定;当前命中取其 1.5 倍) */
10
+ lineWidth?: number;
11
+ }
12
+ export declare function drawFindMatches(ctx: CanvasRenderingContext2D, editor: EditorSession, args: OverlayPaintArgs, options?: FindHighlightOptions): void;
@@ -0,0 +1,24 @@
1
+ import { EditorSession, OverlayPaintArgs, OverlayPainter } from '@hankchen/canvas-editor';
2
+ export interface GizmoOptions {
3
+ /** 选中框颜色(缺省蓝 #2563eb) */
4
+ selectionColor?: string;
5
+ /** hover 高亮颜色(缺省半透明蓝) */
6
+ hoverColor?: string;
7
+ /** 选中框线宽(css 像素,屏幕观感恒定;hover 恒取其一半) */
8
+ selectionWidth?: number;
9
+ /** 缩放柄边长(css 像素,屏幕观感恒定;命中面另计 resizeHandles.RESIZE_HANDLE_HIT_PX) */
10
+ handleSize?: number;
11
+ /** 缩放柄填充色(缺省白,与选中框色描边形成对照) */
12
+ handleFill?: string;
13
+ }
14
+ /**
15
+ * 场景空间绘制选区 gizmo(供组合画笔复用:调用的前提是 ctx 已施加呈现变换)。
16
+ * 先 hover 后选中,选中框压在 hover 之上;hover 与选中同层不重复画。
17
+ */
18
+ export declare function drawSelectionGizmo(ctx: CanvasRenderingContext2D, editor: EditorSession, args: OverlayPaintArgs, options?: GizmoOptions): void;
19
+ /**
20
+ * 独立 gizmo 画笔工厂:清屏(设备空间)→ 施加呈现变换(与内容层同一呈现视口)
21
+ * → 绘制选区 gizmo。ctx 由宿主在 surface ready 后传入并闭包持有;不需要资源
22
+ * 标识等其它覆盖内容的宿主可直接用这一支。
23
+ */
24
+ export declare function createGizmoOverlayPainter(editor: EditorSession, ctx: CanvasRenderingContext2D | null, options?: GizmoOptions): OverlayPainter;
@@ -0,0 +1,3 @@
1
+ import { EditorSession, GuideOrientation } from '@hankchen/canvas-editor';
2
+ /** 参考线拖出/预览位置的吸附求位:返回吸附修正后的场景坐标(无命中即原位) */
3
+ export declare function snapGuideAxis(editor: EditorSession, orientation: GuideOrientation, position: number): number;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * 画布表面域出口:双层 canvas 表面(CanvasSurface)与其内挂 overlay
3
+ * (文本编辑、右键菜单、查找条)、浮于画布的呈现件(对齐浮条、标尺、参考线
4
+ * 层)、gizmo/查找命中覆盖层画笔、rAF 帧调度、DPR 桥、文本编辑/查找会话切片桥。
5
+ */
6
+ export { default as AlignFloatBar } from './AlignFloatBar';
7
+ export { default as CanvasSurface, type CanvasSurfaceReady } from './CanvasSurface';
8
+ export { default as ContextMenu } from './ContextMenu';
9
+ export { default as ContentTypePill } from './ContentTypePill';
10
+ export { default as FindBar } from './FindBar';
11
+ export { default as GuidesOverlay } from './GuidesOverlay';
12
+ export { default as Ruler, type RulerGuideGesture } from './Ruler';
13
+ export { default as TextEditingOverlay } from './TextEditingOverlay';
14
+ export { drawCreateRubberBand } from './createBand';
15
+ export { drawFindMatches, type FindHighlightOptions } from './findHighlight';
16
+ export { createGizmoOverlayPainter, drawSelectionGizmo, type GizmoOptions } from './gizmo';
17
+ export { createRafScheduler } from './scheduler';
18
+ export { useDpr, watchDprChanges } from './useDpr';
19
+ export { useFindSession, type FindSessionSlice } from './useFindSession';
20
+ export { useTextEditing, type TextEditingBinding, type TextEditingHosts } from './useTextEditing';
@@ -0,0 +1,3 @@
1
+ import { ResizeHandle } from '@hankchen/canvas-editor';
2
+ /** 柄 → 指针光标(对角同轴同向) */
3
+ export declare const RESIZE_HANDLE_CURSORS: Record<ResizeHandle, string>;
@@ -0,0 +1,2 @@
1
+ import { FrameScheduler } from '@hankchen/canvas-editor';
2
+ export declare function createRafScheduler(): FrameScheduler;
@@ -0,0 +1,10 @@
1
+ import { Ref } from 'vue';
2
+ /** dpr 变更回调(callback 版:CanvasSurface 在 onMounted 手动管理 teardown) */
3
+ export type DprChangeHandler = (dpr: number) => void;
4
+ /**
5
+ * 监听 dpr 变更(含首次注册),返回取消函数。经分辨率媒体查询自再注册:
6
+ * 旧查询在 dpr 变化瞬间失配,必须换新查询继续监听。
7
+ */
8
+ export declare function watchDprChanges(handler: DprChangeHandler): () => void;
9
+ /** dpr 的响应式桥(composable 版:订阅随 effect scope 自动注销) */
10
+ export declare function useDpr(): Ref<number>;
@@ -0,0 +1,13 @@
1
+ import { Ref } from 'vue';
2
+ import { EditorSession, FindTextHit } from '@hankchen/canvas-editor';
3
+ export interface FindSessionSlice {
4
+ /** 会话开合(⌘F 分派开 / Esc 关) */
5
+ open: Ref<boolean>;
6
+ query: Ref<string>;
7
+ replacement: Ref<string>;
8
+ /** 派生命中列表(视觉序,命中 = path + 偏移对) */
9
+ matches: Ref<readonly FindTextHit[]>;
10
+ /** 当前游标(内核读侧钳位后的快照:越界落末处/首处,空命中为 0) */
11
+ cursor: Ref<number>;
12
+ }
13
+ export declare function useFindSession(editor: EditorSession): FindSessionSlice;
@@ -0,0 +1,53 @@
1
+ import { CSSProperties, ComputedRef } from 'vue';
2
+ import { EditorSession, LayerPath, TextEditLayout } from '@hankchen/canvas-editor';
3
+ export interface TextEditingHosts {
4
+ /** 编辑中的 textarea(提交漏斗从这里取 live 文本;内核无 DOM) */
5
+ getTextarea: () => HTMLTextAreaElement | null;
6
+ /** 画布表面宿主元素(区分「画布内点按」与「面板/工具栏等外部交互」) */
7
+ getHost: () => HTMLElement | null;
8
+ /**
9
+ * 内容类型 pill 根元素(可选,工单 03):与 textarea 同入豁免集——pill 点击
10
+ * 不得触发表面组件 pointerdown 的 commitNow/点选/拖动路径
11
+ */
12
+ getPill?: () => HTMLElement | null;
13
+ }
14
+ export interface TextEditingBinding {
15
+ /** 编辑中的图层路径;null = 非编辑态 */
16
+ editing: ComputedRef<LayerPath | null>;
17
+ /** 编辑层的布局描述(内核查询,路径失效为 null) */
18
+ layout: ComputedRef<TextEditLayout | null>;
19
+ /** textarea 内联样式(随相机/dpr 实时跟随;字号视觉恒定) */
20
+ style: ComputedRef<CSSProperties | null>;
21
+ /**
22
+ * 内容类型 pill 内联样式(工单 03):图层框上边框居中的锚点换算——与 textarea
23
+ * 同一换算系(场景定位 + CSS transform scale,相机/dpr 跟随复用),尾部
24
+ * translate(-50%, -100%) 把 pill 自身底边中点对到锚点;null = 非编辑态
25
+ */
26
+ pillStyle: ComputedRef<CSSProperties | null>;
27
+ /**
28
+ * 呈现缩放(snapViewportToPhysicalPixels 后的 zoom):补全锚点测量的 scale
29
+ * 消费面——画布 textarea 整体在 transform: scale(zoom) 系(工单 03 补全绑定)
30
+ */
31
+ scale: ComputedRef<number>;
32
+ /** 输入法合成中(compositionstart→end);绑定层经 setComposing 汇报 */
33
+ composing: ComputedRef<boolean>;
34
+ /** 合成状态汇报(textarea 的 compositionstart/end 转发进来) */
35
+ setComposing(value: boolean): void;
36
+ /** 双击入口:场景点命中 TextLayer 才进入编辑(内核校验类型) */
37
+ beginAt(sceneX: number, sceneY: number): boolean;
38
+ /** 路径入口:已知路径直接进入编辑(画拉建层自动进编辑,drag-create 工单 02;
39
+ * 内核校验 TextLayer 与会话幂等) */
40
+ beginTextEdit(path: LayerPath): boolean;
41
+ /** 立即提交(Esc / Ctrl+Enter / 画布点按路径);合成中暂存到 compositionend */
42
+ commitNow(): void;
43
+ /**
44
+ * 内容类型切换(工单 03):仅翻会话标志(ui.editing.expression 原位翻转,
45
+ * 零文档变更零历史步);非编辑态或目标即现态零操作
46
+ */
47
+ setExpressionMode(expression: boolean): void;
48
+ /** blur 延迟提交:外部指针交互豁免、焦点落回取消(语义见模块头注释) */
49
+ armBlurCommit(): void;
50
+ /** 编辑态查询:目标是否属于编辑中的 textarea 或内容类型 pill(表面组件的指针分流用) */
51
+ ownsEventTarget(target: EventTarget | null): boolean;
52
+ }
53
+ export declare function useTextEditing(editor: EditorSession, hosts: TextEditingHosts): TextEditingBinding;