@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.
- package/LICENSE +21 -0
- package/README.md +22 -2
- package/dist/canvas/AlignFloatBar.d.ts +6 -0
- package/dist/canvas/CanvasSurface.d.ts +131 -0
- package/dist/canvas/ContentTypePill.d.ts +14 -0
- package/dist/canvas/ContextMenu.d.ts +14 -0
- package/dist/canvas/FindBar.d.ts +13 -0
- package/dist/canvas/GuidesOverlay.d.ts +18 -0
- package/dist/canvas/Ruler.d.ts +24 -0
- package/dist/canvas/TextEditingOverlay.d.ts +70 -0
- package/dist/canvas/createBand.d.ts +6 -0
- package/dist/canvas/findHighlight.d.ts +12 -0
- package/dist/canvas/gizmo.d.ts +24 -0
- package/dist/canvas/guideSnap.d.ts +3 -0
- package/dist/canvas/index.d.ts +20 -0
- package/dist/canvas/resizeHandles.d.ts +3 -0
- package/dist/canvas/scheduler.d.ts +2 -0
- package/dist/canvas/useDpr.d.ts +10 -0
- package/dist/canvas/useFindSession.d.ts +13 -0
- package/dist/canvas/useTextEditing.d.ts +53 -0
- package/dist/canvas-CS4SmrIO.js +1649 -0
- package/dist/canvas.js +2 -0
- package/dist/completionAnchor-4lhR2kJz.js +273 -0
- package/dist/createLucideIcon-CMq8ZKo2.js +96 -0
- package/dist/dist-DuXLYZZ9.js +341 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +16 -0
- package/dist/layer-panel/LayerPanel.d.ts +32 -0
- package/dist/layer-panel/addMenu.d.ts +18 -0
- package/dist/layer-panel/index.d.ts +7 -0
- package/dist/layer-panel/useLayerPanel.d.ts +12 -0
- package/dist/layer-panel-ArP66_vZ.js +652 -0
- package/dist/layer-panel.js +2 -0
- package/dist/layerPath-BRZK9ka1.js +2160 -0
- package/dist/panel-theme.css +254 -0
- package/dist/property-panel/PropertyField.d.ts +65 -0
- package/dist/property-panel/PropertyPanel.d.ts +6 -0
- package/dist/property-panel/controlStyles.d.ts +17 -0
- package/dist/property-panel/controls.d.ts +3 -0
- package/dist/property-panel/fieldSchema.d.ts +116 -0
- package/dist/property-panel/fields/AlignField.d.ts +11 -0
- package/dist/property-panel/fields/AnchorDisclosureField.d.ts +16 -0
- package/dist/property-panel/fields/BooleanField.d.ts +13 -0
- package/dist/property-panel/fields/BorderField.d.ts +14 -0
- package/dist/property-panel/fields/BorderWidthInput.d.ts +14 -0
- package/dist/property-panel/fields/ColorField.d.ts +13 -0
- package/dist/property-panel/fields/FontField.d.ts +15 -0
- package/dist/property-panel/fields/ImageSrcField.d.ts +20 -0
- package/dist/property-panel/fields/NumberField.d.ts +13 -0
- package/dist/property-panel/fields/PaddingField.d.ts +14 -0
- package/dist/property-panel/fields/PairField.d.ts +19 -0
- package/dist/property-panel/fields/SelectField.d.ts +11 -0
- package/dist/property-panel/fields/ShorthandModeButton.d.ts +13 -0
- package/dist/property-panel/fields/TextField.d.ts +13 -0
- package/dist/property-panel/fields/TextareaField.d.ts +13 -0
- package/dist/property-panel/fields/ValueTypeSegmented.d.ts +10 -0
- package/dist/property-panel/fields/index.d.ts +16 -0
- package/dist/property-panel/fontPicker.d.ts +13 -0
- package/dist/property-panel/imageUpload.d.ts +11 -0
- package/dist/property-panel/index.d.ts +13 -0
- package/dist/property-panel/shorthand.d.ts +28 -0
- package/dist/property-panel/usePropertyPanel.d.ts +51 -0
- package/dist/property-panel/useShorthandMode.d.ts +18 -0
- package/dist/property-panel-jt_rsTVW.js +1719 -0
- package/dist/property-panel.js +2 -0
- package/dist/shared/DropdownMenu.d.ts +47 -0
- package/dist/shared/ExpressionCompletionPopup.d.ts +14 -0
- package/dist/shared/HelpDialog.d.ts +12 -0
- package/dist/shared/PanelIcon.d.ts +14 -0
- package/dist/shared/completion.d.ts +49 -0
- package/dist/shared/completionAnchor.d.ts +28 -0
- package/dist/shared/editableTarget.d.ts +5 -0
- package/dist/shared/expressionContext.d.ts +22 -0
- package/dist/shared/index.d.ts +37 -0
- package/dist/shared/rowsPathCompletionSource.d.ts +3 -0
- package/dist/shared/shortcutsHelp.d.ts +30 -0
- package/dist/shared/uploadFile.d.ts +2 -0
- package/dist/shared/useDataSourceSchema.d.ts +3 -0
- package/dist/shared/useDropdownMenu.d.ts +51 -0
- package/dist/shared/useExpressionCompletion.d.ts +45 -0
- package/dist/shared/useHistory.d.ts +7 -0
- package/dist/shared/usePathCompletion.d.ts +18 -0
- package/dist/shared/useSelection.d.ts +3 -0
- package/dist/shared/useShortcuts.d.ts +2 -0
- package/dist/shared/useShortcutsHelp.d.ts +9 -0
- package/dist/shared/useTransientFeedback.d.ts +10 -0
- package/dist/shared/useViewport.d.ts +3 -0
- package/dist/shared-D9zYUQaw.js +123 -0
- package/dist/shared.js +9 -0
- package/dist/status-bar/StatusBar.d.ts +17 -0
- package/dist/status-bar/index.d.ts +9 -0
- package/dist/status-bar/layerGeometryLabel.d.ts +13 -0
- package/dist/status-bar/layerPathLabel.d.ts +2 -0
- package/dist/status-bar/useDoc.d.ts +3 -0
- package/dist/status-bar-BhhrVoBZ.js +194 -0
- package/dist/status-bar.js +2 -0
- package/dist/style.css +2 -0
- package/dist/uploadFile-CutE_xI-.js +330 -0
- package/dist/useDataSourceSchema-C924m8fc.js +237 -0
- package/dist/usePathCompletion-DkHoGla4.js +228 -0
- package/dist/useShortcutsHelp-DTC3yRil.js +19 -0
- package/dist/useTransientFeedback-gS9Xa9GY.js +477 -0
- package/dist/useViewport-BLe2ise1.js +18 -0
- package/package.json +77 -3
|
@@ -0,0 +1,477 @@
|
|
|
1
|
+
import { z as e } from "./layerPath-BRZK9ka1.js";
|
|
2
|
+
//#region ../canvas-editor/src/session/shortcuts.ts
|
|
3
|
+
var t = {
|
|
4
|
+
armCreateText: "TextLayer",
|
|
5
|
+
armCreateTable: "TableLayer",
|
|
6
|
+
armCreateQrCode: "QrCodeLayer",
|
|
7
|
+
armCreateImage: "ImageLayer"
|
|
8
|
+
}, n = [
|
|
9
|
+
{
|
|
10
|
+
combo: {
|
|
11
|
+
key: "z",
|
|
12
|
+
mod: !0,
|
|
13
|
+
shift: !1
|
|
14
|
+
},
|
|
15
|
+
action: "undo",
|
|
16
|
+
label: "撤销",
|
|
17
|
+
group: "history"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
combo: {
|
|
21
|
+
key: "z",
|
|
22
|
+
mod: !0,
|
|
23
|
+
shift: !0
|
|
24
|
+
},
|
|
25
|
+
action: "redo",
|
|
26
|
+
label: "重做",
|
|
27
|
+
group: "history"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
combo: {
|
|
31
|
+
key: "y",
|
|
32
|
+
mod: !0,
|
|
33
|
+
shift: !1
|
|
34
|
+
},
|
|
35
|
+
action: "redo",
|
|
36
|
+
label: "重做",
|
|
37
|
+
group: "history"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
combo: {
|
|
41
|
+
key: "c",
|
|
42
|
+
mod: !0,
|
|
43
|
+
shift: !1
|
|
44
|
+
},
|
|
45
|
+
action: "copy",
|
|
46
|
+
label: "复制",
|
|
47
|
+
group: "clipboard"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
combo: {
|
|
51
|
+
key: "v",
|
|
52
|
+
mod: !0,
|
|
53
|
+
shift: !1
|
|
54
|
+
},
|
|
55
|
+
action: "paste",
|
|
56
|
+
label: "粘贴",
|
|
57
|
+
group: "clipboard"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
combo: {
|
|
61
|
+
key: "d",
|
|
62
|
+
mod: !0,
|
|
63
|
+
shift: !1
|
|
64
|
+
},
|
|
65
|
+
action: "duplicate",
|
|
66
|
+
label: "创建副本",
|
|
67
|
+
group: "clipboard"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
combo: {
|
|
71
|
+
key: "c",
|
|
72
|
+
mod: !0,
|
|
73
|
+
shift: !1,
|
|
74
|
+
alt: !0,
|
|
75
|
+
code: "KeyC"
|
|
76
|
+
},
|
|
77
|
+
action: "copyStyle",
|
|
78
|
+
label: "复制样式",
|
|
79
|
+
group: "clipboard"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
combo: {
|
|
83
|
+
key: "v",
|
|
84
|
+
mod: !0,
|
|
85
|
+
shift: !1,
|
|
86
|
+
alt: !0,
|
|
87
|
+
code: "KeyV"
|
|
88
|
+
},
|
|
89
|
+
action: "pasteStyle",
|
|
90
|
+
label: "粘贴样式",
|
|
91
|
+
group: "clipboard"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
combo: {
|
|
95
|
+
key: "delete",
|
|
96
|
+
mod: !1,
|
|
97
|
+
shift: !1
|
|
98
|
+
},
|
|
99
|
+
action: "delete",
|
|
100
|
+
label: "删除图层",
|
|
101
|
+
group: "layer"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
combo: {
|
|
105
|
+
key: "backspace",
|
|
106
|
+
mod: !1,
|
|
107
|
+
shift: !1
|
|
108
|
+
},
|
|
109
|
+
action: "delete",
|
|
110
|
+
label: "删除图层",
|
|
111
|
+
group: "layer"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
combo: {
|
|
115
|
+
key: "f2",
|
|
116
|
+
mod: !1,
|
|
117
|
+
shift: !1
|
|
118
|
+
},
|
|
119
|
+
action: "rename",
|
|
120
|
+
label: "重命名图层",
|
|
121
|
+
group: "layer"
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
combo: {
|
|
125
|
+
key: "f",
|
|
126
|
+
mod: !0,
|
|
127
|
+
shift: !1
|
|
128
|
+
},
|
|
129
|
+
action: "findReplace",
|
|
130
|
+
label: "查找替换",
|
|
131
|
+
group: "text"
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
combo: {
|
|
135
|
+
key: "r",
|
|
136
|
+
mod: !1,
|
|
137
|
+
shift: !0
|
|
138
|
+
},
|
|
139
|
+
action: "toggleRulers",
|
|
140
|
+
label: "标尺显隐",
|
|
141
|
+
group: "view"
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
combo: {
|
|
145
|
+
key: "l",
|
|
146
|
+
mod: !0,
|
|
147
|
+
shift: !0
|
|
148
|
+
},
|
|
149
|
+
action: "toggleLayerLock",
|
|
150
|
+
label: "锁定/解锁图层",
|
|
151
|
+
group: "layer"
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
combo: {
|
|
155
|
+
key: "h",
|
|
156
|
+
mod: !0,
|
|
157
|
+
shift: !0
|
|
158
|
+
},
|
|
159
|
+
action: "toggleLayerVisibility",
|
|
160
|
+
label: "显示/隐藏图层",
|
|
161
|
+
group: "layer"
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
combo: {
|
|
165
|
+
key: "]",
|
|
166
|
+
mod: !0,
|
|
167
|
+
shift: !1
|
|
168
|
+
},
|
|
169
|
+
action: "bringForward",
|
|
170
|
+
label: "前移一层",
|
|
171
|
+
group: "layer"
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
combo: {
|
|
175
|
+
key: "[",
|
|
176
|
+
mod: !0,
|
|
177
|
+
shift: !1
|
|
178
|
+
},
|
|
179
|
+
action: "sendBackward",
|
|
180
|
+
label: "后移一层",
|
|
181
|
+
group: "layer"
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
combo: {
|
|
185
|
+
key: "]",
|
|
186
|
+
mod: !0,
|
|
187
|
+
shift: !1,
|
|
188
|
+
alt: !0,
|
|
189
|
+
code: "BracketRight"
|
|
190
|
+
},
|
|
191
|
+
action: "bringToFront",
|
|
192
|
+
label: "置顶",
|
|
193
|
+
group: "layer"
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
combo: {
|
|
197
|
+
key: "[",
|
|
198
|
+
mod: !0,
|
|
199
|
+
shift: !1,
|
|
200
|
+
alt: !0,
|
|
201
|
+
code: "BracketLeft"
|
|
202
|
+
},
|
|
203
|
+
action: "sendToBack",
|
|
204
|
+
label: "置底",
|
|
205
|
+
group: "layer"
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
combo: {
|
|
209
|
+
key: "arrowup",
|
|
210
|
+
mod: !1,
|
|
211
|
+
shift: !1
|
|
212
|
+
},
|
|
213
|
+
action: "nudgeUp",
|
|
214
|
+
label: "微调上移",
|
|
215
|
+
group: "layer"
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
combo: {
|
|
219
|
+
key: "arrowdown",
|
|
220
|
+
mod: !1,
|
|
221
|
+
shift: !1
|
|
222
|
+
},
|
|
223
|
+
action: "nudgeDown",
|
|
224
|
+
label: "微调下移",
|
|
225
|
+
group: "layer"
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
combo: {
|
|
229
|
+
key: "arrowleft",
|
|
230
|
+
mod: !1,
|
|
231
|
+
shift: !1
|
|
232
|
+
},
|
|
233
|
+
action: "nudgeLeft",
|
|
234
|
+
label: "微调左移",
|
|
235
|
+
group: "layer"
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
combo: {
|
|
239
|
+
key: "arrowright",
|
|
240
|
+
mod: !1,
|
|
241
|
+
shift: !1
|
|
242
|
+
},
|
|
243
|
+
action: "nudgeRight",
|
|
244
|
+
label: "微调右移",
|
|
245
|
+
group: "layer"
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
combo: {
|
|
249
|
+
key: "arrowup",
|
|
250
|
+
mod: !1,
|
|
251
|
+
shift: !0
|
|
252
|
+
},
|
|
253
|
+
action: "nudgeUpCoarse",
|
|
254
|
+
label: "大步上移",
|
|
255
|
+
group: "layer"
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
combo: {
|
|
259
|
+
key: "arrowdown",
|
|
260
|
+
mod: !1,
|
|
261
|
+
shift: !0
|
|
262
|
+
},
|
|
263
|
+
action: "nudgeDownCoarse",
|
|
264
|
+
label: "大步下移",
|
|
265
|
+
group: "layer"
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
combo: {
|
|
269
|
+
key: "arrowleft",
|
|
270
|
+
mod: !1,
|
|
271
|
+
shift: !0
|
|
272
|
+
},
|
|
273
|
+
action: "nudgeLeftCoarse",
|
|
274
|
+
label: "大步左移",
|
|
275
|
+
group: "layer"
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
combo: {
|
|
279
|
+
key: "arrowright",
|
|
280
|
+
mod: !1,
|
|
281
|
+
shift: !0
|
|
282
|
+
},
|
|
283
|
+
action: "nudgeRightCoarse",
|
|
284
|
+
label: "大步右移",
|
|
285
|
+
group: "layer"
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
combo: {
|
|
289
|
+
key: "tab",
|
|
290
|
+
mod: !1,
|
|
291
|
+
shift: !1
|
|
292
|
+
},
|
|
293
|
+
action: "selectNextLayer",
|
|
294
|
+
label: "循环选下一层",
|
|
295
|
+
group: "layer"
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
combo: {
|
|
299
|
+
key: "tab",
|
|
300
|
+
mod: !1,
|
|
301
|
+
shift: !0
|
|
302
|
+
},
|
|
303
|
+
action: "selectPrevLayer",
|
|
304
|
+
label: "循环选上一层",
|
|
305
|
+
group: "layer"
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
combo: {
|
|
309
|
+
key: "t",
|
|
310
|
+
mod: !1,
|
|
311
|
+
shift: !1,
|
|
312
|
+
code: "KeyT"
|
|
313
|
+
},
|
|
314
|
+
action: "armCreateText",
|
|
315
|
+
label: "画拉建文本层",
|
|
316
|
+
group: "layer"
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
combo: {
|
|
320
|
+
key: "g",
|
|
321
|
+
mod: !1,
|
|
322
|
+
shift: !1,
|
|
323
|
+
code: "KeyG"
|
|
324
|
+
},
|
|
325
|
+
action: "armCreateTable",
|
|
326
|
+
label: "画拉建表格",
|
|
327
|
+
group: "layer"
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
combo: {
|
|
331
|
+
key: "q",
|
|
332
|
+
mod: !1,
|
|
333
|
+
shift: !1,
|
|
334
|
+
code: "KeyQ"
|
|
335
|
+
},
|
|
336
|
+
action: "armCreateQrCode",
|
|
337
|
+
label: "画拉建二维码",
|
|
338
|
+
group: "layer"
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
combo: {
|
|
342
|
+
key: "i",
|
|
343
|
+
mod: !1,
|
|
344
|
+
shift: !1,
|
|
345
|
+
code: "KeyI"
|
|
346
|
+
},
|
|
347
|
+
action: "armCreateImage",
|
|
348
|
+
label: "画拉建图片",
|
|
349
|
+
group: "layer"
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
combo: {
|
|
353
|
+
key: "0",
|
|
354
|
+
mod: !0,
|
|
355
|
+
shift: !1
|
|
356
|
+
},
|
|
357
|
+
action: "zoomReset",
|
|
358
|
+
label: "缩放复位 100%",
|
|
359
|
+
group: "view"
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
combo: {
|
|
363
|
+
key: "1",
|
|
364
|
+
mod: !1,
|
|
365
|
+
shift: !0,
|
|
366
|
+
code: "Digit1"
|
|
367
|
+
},
|
|
368
|
+
action: "fitToSurface",
|
|
369
|
+
label: "适应画布",
|
|
370
|
+
group: "view"
|
|
371
|
+
},
|
|
372
|
+
{
|
|
373
|
+
combo: {
|
|
374
|
+
key: "2",
|
|
375
|
+
mod: !1,
|
|
376
|
+
shift: !0,
|
|
377
|
+
code: "Digit2"
|
|
378
|
+
},
|
|
379
|
+
action: "fitToSelection",
|
|
380
|
+
label: "适应选区",
|
|
381
|
+
group: "view"
|
|
382
|
+
},
|
|
383
|
+
{
|
|
384
|
+
combo: {
|
|
385
|
+
key: "/",
|
|
386
|
+
mod: !0,
|
|
387
|
+
shift: !1
|
|
388
|
+
},
|
|
389
|
+
action: "helpShortcuts",
|
|
390
|
+
label: "快捷键帮助",
|
|
391
|
+
group: "help"
|
|
392
|
+
}
|
|
393
|
+
];
|
|
394
|
+
function r(e, t = n) {
|
|
395
|
+
if (e.composing || e.editing || e.editableTarget) return null;
|
|
396
|
+
let r = e.key.toLowerCase(), i = e.alt ?? !1;
|
|
397
|
+
for (let n of t) if ((n.combo.code === void 0 ? n.combo.key === r : n.combo.code === e.code) && n.combo.mod === e.mod && n.combo.shift === e.shift && (n.combo.alt ?? !1) === i) return n.action;
|
|
398
|
+
return null;
|
|
399
|
+
}
|
|
400
|
+
//#endregion
|
|
401
|
+
//#region \0plugin-vue:export-helper
|
|
402
|
+
var i = (e, t) => {
|
|
403
|
+
let n = e.__vccOpts || e;
|
|
404
|
+
for (let [e, r] of t) n[e] = r;
|
|
405
|
+
return n;
|
|
406
|
+
}, a = [
|
|
407
|
+
"history",
|
|
408
|
+
"clipboard",
|
|
409
|
+
"layer",
|
|
410
|
+
"text",
|
|
411
|
+
"view",
|
|
412
|
+
"help"
|
|
413
|
+
], o = {
|
|
414
|
+
history: "历史",
|
|
415
|
+
clipboard: "剪贴板",
|
|
416
|
+
layer: "图层",
|
|
417
|
+
text: "文本",
|
|
418
|
+
view: "视图",
|
|
419
|
+
help: "帮助"
|
|
420
|
+
}, s = {
|
|
421
|
+
arrowup: "↑",
|
|
422
|
+
arrowdown: "↓",
|
|
423
|
+
arrowleft: "←",
|
|
424
|
+
arrowright: "→",
|
|
425
|
+
backspace: "⌫",
|
|
426
|
+
delete: "Del",
|
|
427
|
+
escape: "Esc",
|
|
428
|
+
tab: "Tab",
|
|
429
|
+
f2: "F2"
|
|
430
|
+
};
|
|
431
|
+
function c(e, t) {
|
|
432
|
+
let n = e.key, r = /^[a-z]$/.test(n) ? n.toUpperCase() : s[n] ?? n;
|
|
433
|
+
if (t === "mac") {
|
|
434
|
+
let t = "";
|
|
435
|
+
return e.alt && (t += "⌥"), e.shift && (t += "⇧"), e.mod && (t += "⌘"), t + r;
|
|
436
|
+
}
|
|
437
|
+
let i = [];
|
|
438
|
+
return e.mod && i.push("Ctrl"), e.shift && i.push("Shift"), e.alt && i.push("Alt"), i.push(r), i.join("+");
|
|
439
|
+
}
|
|
440
|
+
function l(e, t) {
|
|
441
|
+
let r = n.find((t) => t.action === e);
|
|
442
|
+
return r ? c(r.combo, t) : "";
|
|
443
|
+
}
|
|
444
|
+
var u = "画拉或点击落层,Esc 取消";
|
|
445
|
+
function d() {
|
|
446
|
+
let e = globalThis.navigator;
|
|
447
|
+
return /mac/i.test(`${e?.userAgentData?.platform ?? ""} ${e?.platform ?? ""} ${e?.userAgent ?? ""}`) ? "mac" : "win";
|
|
448
|
+
}
|
|
449
|
+
//#endregion
|
|
450
|
+
//#region src/shared/editableTarget.ts
|
|
451
|
+
function f(e) {
|
|
452
|
+
if (!(e instanceof HTMLElement)) return !1;
|
|
453
|
+
if (e.isContentEditable) return !0;
|
|
454
|
+
let t = e.tagName;
|
|
455
|
+
return t === "INPUT" || t === "TEXTAREA" || t === "SELECT" || t === "BUTTON";
|
|
456
|
+
}
|
|
457
|
+
//#endregion
|
|
458
|
+
//#region src/shared/useTransientFeedback.ts
|
|
459
|
+
var p = 4e3, m = e(""), h = null;
|
|
460
|
+
function g() {
|
|
461
|
+
let e = () => {
|
|
462
|
+
h !== null && (clearTimeout(h), h = null);
|
|
463
|
+
};
|
|
464
|
+
return {
|
|
465
|
+
message: m,
|
|
466
|
+
show: (t) => {
|
|
467
|
+
e(), m.value = t, h = setTimeout(() => {
|
|
468
|
+
m.value = "", h = null;
|
|
469
|
+
}, p);
|
|
470
|
+
},
|
|
471
|
+
clear: () => {
|
|
472
|
+
e(), m.value = "";
|
|
473
|
+
}
|
|
474
|
+
};
|
|
475
|
+
}
|
|
476
|
+
//#endregion
|
|
477
|
+
export { a, c, n as d, r as f, o as i, i as l, f as n, d as o, u as r, l as s, g as t, t as u };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { B as e, L as t, p as n } from "./layerPath-BRZK9ka1.js";
|
|
2
|
+
//#region src/shared/useSelection.ts
|
|
3
|
+
function r(r) {
|
|
4
|
+
let i = e(r.store.ui.selection), a = r.subscribe((e) => {
|
|
5
|
+
(e.scope === "doc" || e.scope === "ui" && e.branch === "selection") && (i.value = r.store.ui.selection);
|
|
6
|
+
});
|
|
7
|
+
return t(a, !0), n(() => i.value);
|
|
8
|
+
}
|
|
9
|
+
//#endregion
|
|
10
|
+
//#region src/shared/useViewport.ts
|
|
11
|
+
function i(r) {
|
|
12
|
+
let i = e(r.store.ui.viewport), a = r.subscribe((e) => {
|
|
13
|
+
e.scope === "ui" && e.branch === "viewport" && (i.value = r.store.ui.viewport);
|
|
14
|
+
});
|
|
15
|
+
return t(a, !0), n(() => i.value);
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { r as n, i as t };
|
package/package.json
CHANGED
|
@@ -1,6 +1,80 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hankchen/canvas-editor-vue",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"description": "
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"description": "Vue 3 薄绑定:响应式桥、composables、画布表面组件、textarea 文本编辑 overlay、schema 驱动属性面板注册表",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"import": "./dist/index.js",
|
|
11
|
+
"default": "./dist/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./canvas": {
|
|
14
|
+
"types": "./dist/canvas/index.d.ts",
|
|
15
|
+
"import": "./dist/canvas.js",
|
|
16
|
+
"default": "./dist/canvas.js"
|
|
17
|
+
},
|
|
18
|
+
"./property-panel": {
|
|
19
|
+
"types": "./dist/property-panel/index.d.ts",
|
|
20
|
+
"import": "./dist/property-panel.js",
|
|
21
|
+
"default": "./dist/property-panel.js"
|
|
22
|
+
},
|
|
23
|
+
"./layer-panel": {
|
|
24
|
+
"types": "./dist/layer-panel/index.d.ts",
|
|
25
|
+
"import": "./dist/layer-panel.js",
|
|
26
|
+
"default": "./dist/layer-panel.js"
|
|
27
|
+
},
|
|
28
|
+
"./status-bar": {
|
|
29
|
+
"types": "./dist/status-bar/index.d.ts",
|
|
30
|
+
"import": "./dist/status-bar.js",
|
|
31
|
+
"default": "./dist/status-bar.js"
|
|
32
|
+
},
|
|
33
|
+
"./shared": {
|
|
34
|
+
"types": "./dist/shared/index.d.ts",
|
|
35
|
+
"import": "./dist/shared.js",
|
|
36
|
+
"default": "./dist/shared.js"
|
|
37
|
+
},
|
|
38
|
+
"./panel-theme.css": "./dist/panel-theme.css",
|
|
39
|
+
"./style.css": "./dist/style.css",
|
|
40
|
+
"./package.json": "./package.json"
|
|
41
|
+
},
|
|
42
|
+
"files": [
|
|
43
|
+
"dist",
|
|
44
|
+
"README.md",
|
|
45
|
+
"LICENSE"
|
|
46
|
+
],
|
|
47
|
+
"sideEffects": [
|
|
48
|
+
"**/*.css"
|
|
49
|
+
],
|
|
50
|
+
"publishConfig": {
|
|
51
|
+
"access": "public",
|
|
52
|
+
"registry": "https://registry.npmjs.org/"
|
|
53
|
+
},
|
|
54
|
+
"repository": {
|
|
55
|
+
"type": "git",
|
|
56
|
+
"url": "git+https://github.com/HankChenCH/canvas-web.git",
|
|
57
|
+
"directory": "packages/canvas-editor-vue"
|
|
58
|
+
},
|
|
59
|
+
"dependencies": {
|
|
60
|
+
"@lucide/vue": "^1.48.0",
|
|
61
|
+
"@hankchen/canvas-editor": "0.1.0"
|
|
62
|
+
},
|
|
63
|
+
"peerDependencies": {
|
|
64
|
+
"vue": "^3.5.0"
|
|
65
|
+
},
|
|
66
|
+
"devDependencies": {
|
|
67
|
+
"@vitejs/plugin-vue": "^6.0.9",
|
|
68
|
+
"@vue/test-utils": "^2.5.1",
|
|
69
|
+
"jsdom": "^30.1.1",
|
|
70
|
+
"vite": "^8.3.1",
|
|
71
|
+
"vite-plugin-dts": "^4.5.0",
|
|
72
|
+
"vitest": "^5.0.1",
|
|
73
|
+
"vue-tsc": "^3.3.11"
|
|
74
|
+
},
|
|
75
|
+
"scripts": {
|
|
76
|
+
"build": "vite build && cp src/panel-theme.css dist/panel-theme.css",
|
|
77
|
+
"test": "vitest run",
|
|
78
|
+
"typecheck": "vue-tsc --noEmit -p tsconfig.json"
|
|
79
|
+
}
|
|
6
80
|
}
|