@hankchen/canvas-editor-vue 0.1.1 → 0.1.3
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-DP-pVLyA.js +1650 -0
- package/dist/canvas.js +1 -1
- package/dist/{completionAnchor-4lhR2kJz.js → completionAnchor-CDR5YZhu.js} +28 -28
- package/dist/{createLucideIcon-CMq8ZKo2.js → createLucideIcon-SCvtEGVf.js} +11 -11
- package/dist/{dist-DuXLYZZ9.js → dist-DGtNmLwo.js} +1 -1
- package/dist/index.js +12 -12
- package/dist/{layer-panel-ArP66_vZ.js → layer-panel-CXIkRodC.js} +240 -239
- package/dist/layer-panel.js +1 -1
- package/dist/layerPath-uy2ywyld.js +76 -0
- package/dist/{property-panel-jt_rsTVW.js → property-panel-CigAECN_.js} +652 -651
- package/dist/property-panel.js +1 -1
- package/dist/shared-BTyB4vbT.js +123 -0
- package/dist/shared.js +8 -8
- package/dist/{status-bar-BhhrVoBZ.js → status-bar-DO8akYAw.js} +50 -49
- package/dist/status-bar.js +1 -1
- package/dist/{uploadFile-CutE_xI-.js → uploadFile-BOfv8aLG.js} +106 -105
- package/dist/{useDataSourceSchema-C924m8fc.js → useDataSourceSchema-DStVoY8Z.js} +47 -47
- package/dist/{usePathCompletion-DkHoGla4.js → usePathCompletion-uJ5c_gQ0.js} +60 -59
- package/dist/{useShortcutsHelp-DTC3yRil.js → useShortcutsHelp-CsyarO2P.js} +1 -1
- package/dist/{useTransientFeedback-gS9Xa9GY.js → useTransientFeedback-Cnp6aNB7.js} +1 -1
- package/dist/{useViewport-BLe2ise1.js → useViewport-D9Ipevzs.js} +5 -5
- package/package.json +1 -1
- package/dist/canvas-CS4SmrIO.js +0 -1649
- package/dist/layerPath-BRZK9ka1.js +0 -2160
- package/dist/shared-D9zYUQaw.js +0 -123
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as
|
|
1
|
+
import { a as e } from "./layerPath-uy2ywyld.js";
|
|
2
|
+
import { c as t, n, t as r, u as i } from "./completionAnchor-CDR5YZhu.js";
|
|
3
|
+
import { nextTick as a, onMounted as o, onScopeDispose as s, reactive as c, toValue as l, watch as u } from "vue";
|
|
3
4
|
//#region ../canvas-editor/src/shared/rowsPathCandidates.ts
|
|
4
5
|
function d(e) {
|
|
5
6
|
return e.type === "array" || e.items !== void 0;
|
|
@@ -24,31 +25,31 @@ function m(e, t) {
|
|
|
24
25
|
}
|
|
25
26
|
function h(e, t) {
|
|
26
27
|
if (e === null) return null;
|
|
27
|
-
let n = t.split("."), r = t.endsWith(".") ? "" : n[n.length - 1],
|
|
28
|
-
for (let e of
|
|
29
|
-
if (d(
|
|
30
|
-
let t =
|
|
28
|
+
let n = t.split("."), r = t.endsWith(".") ? "" : n[n.length - 1], a = n.slice(0, -1), o = e;
|
|
29
|
+
for (let e of a) {
|
|
30
|
+
if (d(o)) return null;
|
|
31
|
+
let t = i(o, [e]);
|
|
31
32
|
if (t === null) return null;
|
|
32
|
-
|
|
33
|
+
o = t;
|
|
33
34
|
}
|
|
34
|
-
if (d(
|
|
35
|
-
let
|
|
35
|
+
if (d(o) || f(o)) return null;
|
|
36
|
+
let s = m(o, a.join("."));
|
|
36
37
|
return {
|
|
37
38
|
partial: r,
|
|
38
|
-
candidates:
|
|
39
|
-
...
|
|
39
|
+
candidates: s.candidates,
|
|
40
|
+
...s.open === !0 ? { open: !0 } : {}
|
|
40
41
|
};
|
|
41
42
|
}
|
|
42
|
-
function g(
|
|
43
|
-
if (
|
|
44
|
-
if (
|
|
45
|
-
let
|
|
46
|
-
for (let
|
|
47
|
-
if (
|
|
48
|
-
let
|
|
49
|
-
if (
|
|
50
|
-
}
|
|
51
|
-
return
|
|
43
|
+
function g(n, r, i) {
|
|
44
|
+
if (i === null) return null;
|
|
45
|
+
if (n === null || r === null) return i;
|
|
46
|
+
let a = null;
|
|
47
|
+
for (let o = 0; o < r.length; o += 1) {
|
|
48
|
+
if (r[o] !== "template") continue;
|
|
49
|
+
let s = e(n, r.slice(0, o));
|
|
50
|
+
if (s === null || s.type !== "TableLayer" || (a = t(a ?? i, s.rowsPath), a === null)) return null;
|
|
51
|
+
}
|
|
52
|
+
return a ?? i;
|
|
52
53
|
}
|
|
53
54
|
//#endregion
|
|
54
55
|
//#region src/shared/rowsPathCompletionSource.ts
|
|
@@ -85,65 +86,65 @@ function x(e) {
|
|
|
85
86
|
error: null
|
|
86
87
|
};
|
|
87
88
|
}
|
|
88
|
-
function S(
|
|
89
|
-
let
|
|
89
|
+
function S(e) {
|
|
90
|
+
let t = c({
|
|
90
91
|
open: !1,
|
|
91
92
|
items: [],
|
|
92
93
|
activeIndex: 0,
|
|
93
94
|
top: 0,
|
|
94
95
|
left: 0,
|
|
95
96
|
openMapping: !1
|
|
96
|
-
}),
|
|
97
|
+
}), i = null, d = !1, f = "";
|
|
97
98
|
function p() {
|
|
98
|
-
|
|
99
|
+
t.open = !1, t.items = [], t.activeIndex = 0, t.openMapping = !1, f = "";
|
|
99
100
|
}
|
|
100
101
|
function m() {
|
|
101
|
-
if (!
|
|
102
|
-
let e =
|
|
103
|
-
|
|
102
|
+
if (!t.open || !i) return;
|
|
103
|
+
let e = r(i);
|
|
104
|
+
t.top = e.bottom + v, t.left = h(e.left);
|
|
104
105
|
}
|
|
105
|
-
function h(
|
|
106
|
-
let
|
|
107
|
-
return
|
|
106
|
+
function h(t) {
|
|
107
|
+
let n = (e.popupEl ? l(e.popupEl) : null)?.offsetWidth ?? 0;
|
|
108
|
+
return n <= 0 ? t : Math.max(0, Math.min(t, window.innerWidth - y - n));
|
|
108
109
|
}
|
|
109
|
-
function g(
|
|
110
|
-
if (!
|
|
110
|
+
function g(n, r = !1) {
|
|
111
|
+
if (!l(e.enabled)) {
|
|
111
112
|
p();
|
|
112
113
|
return;
|
|
113
114
|
}
|
|
114
|
-
let
|
|
115
|
-
if (!
|
|
115
|
+
let o = i;
|
|
116
|
+
if (!o) {
|
|
116
117
|
p();
|
|
117
118
|
return;
|
|
118
119
|
}
|
|
119
|
-
let
|
|
120
|
-
if (
|
|
120
|
+
let s = o.value.slice(0, o.selectionStart ?? o.value.length);
|
|
121
|
+
if (s === "" && !r) {
|
|
121
122
|
p();
|
|
122
123
|
return;
|
|
123
124
|
}
|
|
124
|
-
let c =
|
|
125
|
+
let c = e.resolve(s);
|
|
125
126
|
if (!c) {
|
|
126
127
|
p();
|
|
127
128
|
return;
|
|
128
129
|
}
|
|
129
|
-
let
|
|
130
|
-
if (
|
|
130
|
+
let u = r ? c.candidates : c.candidates.filter((e) => e.segment.startsWith(c.partial));
|
|
131
|
+
if (u.length === 0 && c.open !== !0) {
|
|
131
132
|
p();
|
|
132
133
|
return;
|
|
133
134
|
}
|
|
134
|
-
f = c.partial, (
|
|
135
|
+
f = c.partial, (t.open || n) && (t.items = u, t.activeIndex = 0, t.openMapping = c.open === !0, t.open = !0, m(), a(m));
|
|
135
136
|
}
|
|
136
137
|
function _(e) {
|
|
137
|
-
let
|
|
138
|
-
if (!
|
|
139
|
-
let
|
|
140
|
-
if (!
|
|
141
|
-
let
|
|
142
|
-
if (!
|
|
138
|
+
let r = i;
|
|
139
|
+
if (!t.open || d || !r) return;
|
|
140
|
+
let a = t.items[e ?? t.activeIndex];
|
|
141
|
+
if (!a) return;
|
|
142
|
+
let o = r.value.slice(0, r.selectionStart ?? r.value.length), s = n(r.value, x(o), f, a.segment);
|
|
143
|
+
if (!s) {
|
|
143
144
|
p();
|
|
144
145
|
return;
|
|
145
146
|
}
|
|
146
|
-
|
|
147
|
+
r.value = s.value, r.setSelectionRange(s.cursor, s.cursor), r.dispatchEvent(new Event("input", { bubbles: !0 })), r.dispatchEvent(new Event("change", { bubbles: !0 })), p();
|
|
147
148
|
}
|
|
148
149
|
function S(e) {
|
|
149
150
|
d || e.isComposing || g(!0);
|
|
@@ -163,15 +164,15 @@ function S(a) {
|
|
|
163
164
|
e.preventDefault(), g(!0, !0);
|
|
164
165
|
return;
|
|
165
166
|
}
|
|
166
|
-
if (
|
|
167
|
-
if (
|
|
167
|
+
if (t.open) {
|
|
168
|
+
if (t.items.length === 0) {
|
|
168
169
|
e.key === "Escape" && (e.preventDefault(), p());
|
|
169
170
|
return;
|
|
170
171
|
}
|
|
171
172
|
if (e.key === "ArrowDown" || e.key === "ArrowUp") {
|
|
172
173
|
e.preventDefault();
|
|
173
|
-
let
|
|
174
|
-
|
|
174
|
+
let n = t.items.length;
|
|
175
|
+
n > 0 && (t.activeIndex = (t.activeIndex + (e.key === "ArrowDown" ? 1 : n - 1)) % n);
|
|
175
176
|
return;
|
|
176
177
|
}
|
|
177
178
|
if (e.key === "Enter" || e.key === "Tab") {
|
|
@@ -183,7 +184,7 @@ function S(a) {
|
|
|
183
184
|
}
|
|
184
185
|
}
|
|
185
186
|
function D(e) {
|
|
186
|
-
|
|
187
|
+
t.open && !T(e) && b.includes(e.key) && g(!1);
|
|
187
188
|
}
|
|
188
189
|
function O() {
|
|
189
190
|
d || g(!1);
|
|
@@ -192,7 +193,7 @@ function S(a) {
|
|
|
192
193
|
p();
|
|
193
194
|
}
|
|
194
195
|
function A(e) {
|
|
195
|
-
|
|
196
|
+
t.open && e.target !== i && p();
|
|
196
197
|
}
|
|
197
198
|
function j() {
|
|
198
199
|
m();
|
|
@@ -213,14 +214,14 @@ function S(a) {
|
|
|
213
214
|
for (let [t, n] of M) e.removeEventListener(t, n);
|
|
214
215
|
}
|
|
215
216
|
function F(e) {
|
|
216
|
-
|
|
217
|
+
i !== e && (i && P(i), i = e, e && N(e));
|
|
217
218
|
}
|
|
218
|
-
return
|
|
219
|
+
return o(() => F(e.target.value)), u(e.target, (e) => F(e)), u(() => l(e.enabled), (e) => {
|
|
219
220
|
e || p();
|
|
220
|
-
}), document.addEventListener("mousedown", A), window.addEventListener("scroll", j, !0), window.addEventListener("resize", j),
|
|
221
|
-
|
|
221
|
+
}), document.addEventListener("mousedown", A), window.addEventListener("scroll", j, !0), window.addEventListener("resize", j), s(() => {
|
|
222
|
+
i && P(i), document.removeEventListener("mousedown", A), window.removeEventListener("scroll", j, !0), window.removeEventListener("resize", j);
|
|
222
223
|
}), {
|
|
223
|
-
popup:
|
|
224
|
+
popup: t,
|
|
224
225
|
accept: _
|
|
225
226
|
};
|
|
226
227
|
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { computed as e, onScopeDispose as t, shallowRef as n } from "vue";
|
|
2
2
|
//#region src/shared/useSelection.ts
|
|
3
3
|
function r(r) {
|
|
4
|
-
let i =
|
|
4
|
+
let i = n(r.store.ui.selection), a = r.subscribe((e) => {
|
|
5
5
|
(e.scope === "doc" || e.scope === "ui" && e.branch === "selection") && (i.value = r.store.ui.selection);
|
|
6
6
|
});
|
|
7
|
-
return t(a, !0),
|
|
7
|
+
return t(a, !0), e(() => i.value);
|
|
8
8
|
}
|
|
9
9
|
//#endregion
|
|
10
10
|
//#region src/shared/useViewport.ts
|
|
11
11
|
function i(r) {
|
|
12
|
-
let i =
|
|
12
|
+
let i = n(r.store.ui.viewport), a = r.subscribe((e) => {
|
|
13
13
|
e.scope === "ui" && e.branch === "viewport" && (i.value = r.store.ui.viewport);
|
|
14
14
|
});
|
|
15
|
-
return t(a, !0),
|
|
15
|
+
return t(a, !0), e(() => i.value);
|
|
16
16
|
}
|
|
17
17
|
//#endregion
|
|
18
18
|
export { r as n, i as t };
|