@pooder/vue 2.0.0 → 3.0.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/index.es.js +78 -314
- package/dist/index.umd.js +1 -1
- package/dist/vue/src/PooderEditor.vue.d.ts +6 -128
- package/dist/vue/src/components/CanvasArea.vue.d.ts +10 -23
- package/dist/vue/src/components/ConfigurationPanel.vue.d.ts +2 -0
- package/dist/vue/src/components/ToolPanel.vue.d.ts +1 -80
- package/dist/vue/src/index.d.ts +2 -0
- package/dist/vue.css +1 -1
- package/package.json +3 -3
- package/dist/vue/src/components/ColorPicker.vue.d.ts +0 -22
package/dist/index.es.js
CHANGED
|
@@ -1,321 +1,85 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
d.value && (d.value.width = t.width, d.value.height = t.height, s = new j(d.value, {
|
|
22
|
-
width: t.width,
|
|
23
|
-
height: t.height
|
|
24
|
-
}), o("init", s));
|
|
25
|
-
}), M(() => {
|
|
26
|
-
s && s.destroy();
|
|
27
|
-
}), {
|
|
28
|
-
canvasRef: d
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
}), I = (t, o) => {
|
|
32
|
-
const d = t.__vccOpts || t;
|
|
33
|
-
for (const [s, f] of o)
|
|
34
|
-
d[s] = f;
|
|
35
|
-
return d;
|
|
36
|
-
}, D = { class: "canvas-area" }, z = { class: "canvas-wrapper" }, G = { ref: "canvasRef" };
|
|
37
|
-
function J(t, o, d, s, f, _) {
|
|
38
|
-
return h(), p("div", D, [
|
|
39
|
-
l("div", z, [
|
|
40
|
-
l("canvas", G, null, 512)
|
|
41
|
-
])
|
|
42
|
-
]);
|
|
43
|
-
}
|
|
44
|
-
const K = /* @__PURE__ */ I(q, [["render", J], ["__scopeId", "data-v-c0e5ef40"]]), Q = v({
|
|
45
|
-
name: "ColorPicker",
|
|
46
|
-
props: {
|
|
47
|
-
modelValue: {
|
|
48
|
-
type: String,
|
|
49
|
-
default: "#000000"
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
emits: ["update:modelValue", "change"],
|
|
53
|
-
setup(t, { emit: o }) {
|
|
54
|
-
const d = (r) => {
|
|
55
|
-
if (!r) return "#000000";
|
|
56
|
-
const n = String(r);
|
|
57
|
-
if (n.startsWith("#")) {
|
|
58
|
-
if (n.length === 9) return n.slice(0, 7);
|
|
59
|
-
if (n.length === 7) return n;
|
|
60
|
-
if (n.length === 4)
|
|
61
|
-
return "#" + n[1] + n[1] + n[2] + n[2] + n[3] + n[3];
|
|
62
|
-
}
|
|
63
|
-
if (n.startsWith("rgb")) {
|
|
64
|
-
const e = n.match(/\d+(\.\d+)?/g);
|
|
65
|
-
if (e && e.length >= 3) {
|
|
66
|
-
const u = parseInt(e[0]), i = parseInt(e[1]), c = parseInt(e[2]), g = ($) => {
|
|
67
|
-
const w = $.toString(16);
|
|
68
|
-
return w.length === 1 ? "0" + w : w;
|
|
69
|
-
};
|
|
70
|
-
return `#${g(u)}${g(i)}${g(c)}`;
|
|
71
|
-
}
|
|
1
|
+
import { defineComponent as g, ref as u, onMounted as w, onUnmounted as f, createElementBlock as _, openBlock as C, createElementVNode as h, provide as y, createVNode as I } from "vue";
|
|
2
|
+
import { Pooder as k } from "@pooder/core";
|
|
3
|
+
export * from "@pooder/core";
|
|
4
|
+
import { CanvasService as T, BackgroundTool as z, RulerTool as E, MirrorTool as R, DielineTool as M, ImageTool as U, HoleTool as b } from "@pooder/kit";
|
|
5
|
+
export * from "@pooder/kit";
|
|
6
|
+
const B = /* @__PURE__ */ g({
|
|
7
|
+
__name: "CanvasArea",
|
|
8
|
+
emits: ["canvas-ready", "resize"],
|
|
9
|
+
setup(c, { emit: r }) {
|
|
10
|
+
const e = r, t = u(null), n = u(null);
|
|
11
|
+
let a = null;
|
|
12
|
+
return w(() => {
|
|
13
|
+
if (t.value && n.value) {
|
|
14
|
+
const { clientWidth: i, clientHeight: v } = t.value;
|
|
15
|
+
n.value.width = i, n.value.height = v, e("canvas-ready", n.value), a = new ResizeObserver((p) => {
|
|
16
|
+
for (const d of p) {
|
|
17
|
+
const { width: m, height: o } = d.contentRect;
|
|
18
|
+
e("resize", m, o);
|
|
19
|
+
}
|
|
20
|
+
}), a.observe(t.value);
|
|
72
21
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
() => Math.round(s(t.modelValue) * 100)
|
|
86
|
-
);
|
|
87
|
-
return {
|
|
88
|
-
hexValue: f,
|
|
89
|
-
alphaValue: _,
|
|
90
|
-
updateColor: (r) => {
|
|
91
|
-
const n = r.target.value, e = s(t.modelValue), u = parseInt(n.slice(1, 3), 16), i = parseInt(n.slice(3, 5), 16), c = parseInt(n.slice(5, 7), 16), g = `rgba(${u}, ${i}, ${c}, ${e})`;
|
|
92
|
-
o("update:modelValue", g), o("change", g);
|
|
93
|
-
},
|
|
94
|
-
updateAlpha: (r) => {
|
|
95
|
-
const n = r.target.value, e = parseInt(n) / 100, u = d(t.modelValue), i = parseInt(u.slice(1, 3), 16), c = parseInt(u.slice(3, 5), 16), g = parseInt(u.slice(5, 7), 16), $ = `rgba(${i}, ${c}, ${g}, ${e})`;
|
|
96
|
-
o("update:modelValue", $), o("change", $);
|
|
97
|
-
}
|
|
98
|
-
};
|
|
22
|
+
}), f(() => {
|
|
23
|
+
a && a.disconnect();
|
|
24
|
+
}), (i, v) => (C(), _("div", {
|
|
25
|
+
ref_key: "container",
|
|
26
|
+
ref: t,
|
|
27
|
+
class: "pooder-canvas-area"
|
|
28
|
+
}, [
|
|
29
|
+
h("canvas", {
|
|
30
|
+
ref_key: "canvas",
|
|
31
|
+
ref: n
|
|
32
|
+
}, null, 512)
|
|
33
|
+
], 512));
|
|
99
34
|
}
|
|
100
|
-
}),
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
step: "1",
|
|
115
|
-
value: t.alphaValue,
|
|
116
|
-
onInput: o[1] || (o[1] = (...m) => t.updateAlpha && t.updateAlpha(...m))
|
|
117
|
-
}, null, 40, x),
|
|
118
|
-
l("span", ee, b(t.alphaValue) + "%", 1)
|
|
119
|
-
])
|
|
120
|
-
]);
|
|
121
|
-
}
|
|
122
|
-
const ne = /* @__PURE__ */ I(Q, [["render", te], ["__scopeId", "data-v-21507ccd"]]), oe = v({
|
|
123
|
-
name: "ToolPanel",
|
|
124
|
-
components: { ColorPicker: ne },
|
|
125
|
-
props: {
|
|
126
|
-
editor: {
|
|
127
|
-
type: Object,
|
|
128
|
-
default: null
|
|
129
|
-
}
|
|
130
|
-
},
|
|
131
|
-
setup(t) {
|
|
132
|
-
const o = k([]), d = () => {
|
|
133
|
-
t.editor ? o.value = Array.from(
|
|
134
|
-
t.editor.getExtensions().map((e) => (e.options && !P(e.options) && (e.options = E(e.options)), e))
|
|
135
|
-
) : o.value = [];
|
|
136
|
-
};
|
|
137
|
-
N(
|
|
138
|
-
() => t.editor,
|
|
139
|
-
(e) => {
|
|
140
|
-
d();
|
|
35
|
+
}), S = (c, r) => {
|
|
36
|
+
const e = c.__vccOpts || c;
|
|
37
|
+
for (const [t, n] of r)
|
|
38
|
+
e[t] = n;
|
|
39
|
+
return e;
|
|
40
|
+
}, O = /* @__PURE__ */ S(B, [["__scopeId", "data-v-dc60e8d6"]]), P = { class: "pooder-editor" }, A = /* @__PURE__ */ g({
|
|
41
|
+
__name: "PooderEditor",
|
|
42
|
+
setup(c, { expose: r }) {
|
|
43
|
+
const e = new k();
|
|
44
|
+
y("pooder", e), e.getService("CanvasService");
|
|
45
|
+
const t = e.getService("CommandService"), n = e.getService("ConfigurationService");
|
|
46
|
+
r({
|
|
47
|
+
importConfig: (o) => {
|
|
48
|
+
n.import(o);
|
|
141
49
|
},
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
return c ? {
|
|
164
|
-
min: c.min ?? 0,
|
|
165
|
-
max: c.max ?? 100,
|
|
166
|
-
step: c.step ?? 1
|
|
167
|
-
} : i <= 1 && i >= 0 ? { min: 0, max: 1, step: 0.01 } : { min: 0, max: Math.max(1e3, i * 2), step: 1 };
|
|
168
|
-
},
|
|
169
|
-
formatNumber: (e) => typeof e == "number" ? Number.isInteger(e) ? e : e.toFixed(2) : e,
|
|
170
|
-
getLabel: (e, u) => {
|
|
171
|
-
const i = s(e, u);
|
|
172
|
-
return i && i.label ? i.label : u.charAt(0).toUpperCase() + u.slice(1);
|
|
173
|
-
},
|
|
174
|
-
getSelectOptions: (e, u) => {
|
|
175
|
-
const i = s(e, u);
|
|
176
|
-
return !i || !i.options ? [] : i.options.map((c) => typeof c == "string" ? { label: c, value: c } : c);
|
|
177
|
-
}
|
|
178
|
-
};
|
|
179
|
-
}
|
|
180
|
-
}), se = {
|
|
181
|
-
key: 0,
|
|
182
|
-
class: "tool-panel"
|
|
183
|
-
}, re = { key: 0 }, ae = { key: 0 }, ie = ["value", "onChange"], le = ["value"], ue = { key: 1 }, ce = { key: 2 }, de = ["value", "onInput"], pe = { class: "slider-container" }, he = ["min", "max", "step", "value", "onInput"], ge = { class: "slider-value" }, me = { key: 3 }, fe = { class: "switch-wrapper" }, _e = { class: "switch" }, be = ["checked", "onChange"], $e = { key: 4 }, ve = { class: "checkbox-wrapper" }, Ie = ["checked", "onChange"], we = { key: 5 }, Ce = ["value", "onInput"];
|
|
184
|
-
function Se(t, o, d, s, f, _) {
|
|
185
|
-
const m = V("ColorPicker");
|
|
186
|
-
return t.editor ? (h(), p("div", se, [
|
|
187
|
-
(h(!0), p(C, null, S(t.extensionList, (a) => (h(), p("div", {
|
|
188
|
-
class: "plugin-section",
|
|
189
|
-
key: a.name
|
|
190
|
-
}, [
|
|
191
|
-
l("h3", null, b(a.name), 1),
|
|
192
|
-
a.options ? (h(), p("div", re, [
|
|
193
|
-
(h(!0), p(C, null, S(a.options, (r, n) => (h(), p("div", {
|
|
194
|
-
key: n,
|
|
195
|
-
class: "config-item"
|
|
196
|
-
}, [
|
|
197
|
-
l("label", null, b(t.getLabel(a, String(n))), 1),
|
|
198
|
-
t.getInputType(a, String(n), r) === "select" ? (h(), p("div", ae, [
|
|
199
|
-
l("select", {
|
|
200
|
-
value: r,
|
|
201
|
-
onChange: (e) => t.updateOption(a, n, e.target.value)
|
|
202
|
-
}, [
|
|
203
|
-
(h(!0), p(C, null, S(t.getSelectOptions(a, String(n)), (e) => (h(), p("option", {
|
|
204
|
-
key: e.value,
|
|
205
|
-
value: e.value
|
|
206
|
-
}, b(e.label), 9, le))), 128))
|
|
207
|
-
], 40, ie)
|
|
208
|
-
])) : t.getInputType(a, String(n), r) === "color" ? (h(), p("div", ue, [
|
|
209
|
-
y(m, {
|
|
210
|
-
modelValue: String(r),
|
|
211
|
-
"onUpdate:modelValue": (e) => t.updateOption(a, n, e)
|
|
212
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
|
213
|
-
])) : t.getInputType(a, String(n), r) === "number" ? (h(), p("div", ce, [
|
|
214
|
-
l("input", {
|
|
215
|
-
type: "number",
|
|
216
|
-
value: r,
|
|
217
|
-
onInput: (e) => t.updateOption(
|
|
218
|
-
a,
|
|
219
|
-
n,
|
|
220
|
-
Number(e.target.value)
|
|
221
|
-
)
|
|
222
|
-
}, null, 40, de),
|
|
223
|
-
l("div", pe, [
|
|
224
|
-
l("input", {
|
|
225
|
-
type: "range",
|
|
226
|
-
min: t.getMinMax(a, String(n), r).min,
|
|
227
|
-
max: t.getMinMax(a, String(n), r).max,
|
|
228
|
-
step: t.getMinMax(a, String(n), r).step,
|
|
229
|
-
value: r,
|
|
230
|
-
onInput: (e) => t.updateOption(
|
|
231
|
-
a,
|
|
232
|
-
n,
|
|
233
|
-
Number(e.target.value)
|
|
234
|
-
)
|
|
235
|
-
}, null, 40, he),
|
|
236
|
-
l("span", ge, b(t.formatNumber(r)), 1)
|
|
237
|
-
])
|
|
238
|
-
])) : t.getInputType(a, String(n), r) === "boolean" ? (h(), p("div", me, [
|
|
239
|
-
l("div", fe, [
|
|
240
|
-
l("label", _e, [
|
|
241
|
-
l("input", {
|
|
242
|
-
type: "checkbox",
|
|
243
|
-
checked: !!r,
|
|
244
|
-
onChange: (e) => t.updateOption(
|
|
245
|
-
a,
|
|
246
|
-
n,
|
|
247
|
-
e.target.checked
|
|
248
|
-
)
|
|
249
|
-
}, null, 40, be),
|
|
250
|
-
o[0] || (o[0] = l("span", { class: "slider" }, null, -1))
|
|
251
|
-
])
|
|
252
|
-
])
|
|
253
|
-
])) : t.getInputType(a, String(n), r) === "checkbox" ? (h(), p("div", $e, [
|
|
254
|
-
l("div", ve, [
|
|
255
|
-
l("input", {
|
|
256
|
-
type: "checkbox",
|
|
257
|
-
checked: !!r,
|
|
258
|
-
onChange: (e) => t.updateOption(
|
|
259
|
-
a,
|
|
260
|
-
n,
|
|
261
|
-
e.target.checked
|
|
262
|
-
)
|
|
263
|
-
}, null, 40, Ie)
|
|
264
|
-
])
|
|
265
|
-
])) : (h(), p("div", we, [
|
|
266
|
-
l("input", {
|
|
267
|
-
type: "text",
|
|
268
|
-
value: r,
|
|
269
|
-
onInput: (e) => t.updateOption(a, n, e.target.value)
|
|
270
|
-
}, null, 40, Ce)
|
|
271
|
-
]))
|
|
272
|
-
]))), 128))
|
|
273
|
-
])) : O("", !0)
|
|
274
|
-
]))), 128))
|
|
275
|
-
])) : O("", !0);
|
|
276
|
-
}
|
|
277
|
-
const Ve = /* @__PURE__ */ I(oe, [["render", Se], ["__scopeId", "data-v-77c5b72f"]]), ye = v({
|
|
278
|
-
name: "PooderEditor",
|
|
279
|
-
components: {
|
|
280
|
-
CanvasArea: K,
|
|
281
|
-
ToolPanel: Ve
|
|
282
|
-
},
|
|
283
|
-
props: {
|
|
284
|
-
width: {
|
|
285
|
-
type: Number,
|
|
286
|
-
default: 1200
|
|
287
|
-
},
|
|
288
|
-
height: {
|
|
289
|
-
type: Number,
|
|
290
|
-
default: 600
|
|
291
|
-
}
|
|
292
|
-
},
|
|
293
|
-
setup(t) {
|
|
294
|
-
const o = L(null);
|
|
295
|
-
return {
|
|
296
|
-
editor: o,
|
|
297
|
-
onInit: (s) => {
|
|
298
|
-
s.use(new W()), s.use(new B()), s.use(new F()), s.use(new H()), s.use(new R()), s.use(new U()), o.value = s, console.log(s.getObjects());
|
|
299
|
-
}
|
|
50
|
+
exportConfig: () => n.export(),
|
|
51
|
+
generateCutImage: async () => await t.executeCommand("exportCutImage"),
|
|
52
|
+
setUserImage: async (o) => await t.executeCommand("setUserImage", o, 1)
|
|
53
|
+
});
|
|
54
|
+
const d = (o) => {
|
|
55
|
+
const s = new T(o);
|
|
56
|
+
e.registerService(s), [
|
|
57
|
+
new z(),
|
|
58
|
+
new E(),
|
|
59
|
+
// new FilmTool(),
|
|
60
|
+
// new WhiteInkTool(),
|
|
61
|
+
new R(),
|
|
62
|
+
new M(),
|
|
63
|
+
new U(),
|
|
64
|
+
new b()
|
|
65
|
+
].forEach((x) => {
|
|
66
|
+
e.extensionManager.register(x);
|
|
67
|
+
});
|
|
68
|
+
}, m = (o, s) => {
|
|
69
|
+
const l = e.getService("CanvasService");
|
|
70
|
+
l && l.canvas.setDimensions({ width: o, height: s });
|
|
300
71
|
};
|
|
72
|
+
return f(() => {
|
|
73
|
+
const o = e.getService("CanvasService");
|
|
74
|
+
o && o.dispose(), e.extensionManager.destroy();
|
|
75
|
+
}), (o, s) => (C(), _("div", P, [
|
|
76
|
+
I(O, {
|
|
77
|
+
onCanvasReady: d,
|
|
78
|
+
onResize: m
|
|
79
|
+
})
|
|
80
|
+
]));
|
|
301
81
|
}
|
|
302
|
-
}),
|
|
303
|
-
function Ae(t, o, d, s, f, _) {
|
|
304
|
-
const m = V("CanvasArea"), a = V("ToolPanel");
|
|
305
|
-
return h(), p("div", Te, [
|
|
306
|
-
l("div", Oe, [
|
|
307
|
-
y(m, {
|
|
308
|
-
width: t.width,
|
|
309
|
-
height: t.height,
|
|
310
|
-
onInit: t.onInit
|
|
311
|
-
}, null, 8, ["width", "height", "onInit"])
|
|
312
|
-
]),
|
|
313
|
-
l("div", ke, [
|
|
314
|
-
y(a, { editor: t.editor }, null, 8, ["editor"])
|
|
315
|
-
])
|
|
316
|
-
]);
|
|
317
|
-
}
|
|
318
|
-
const Ee = /* @__PURE__ */ I(ye, [["render", Ae], ["__scopeId", "data-v-b9b03377"]]);
|
|
82
|
+
}), V = /* @__PURE__ */ S(A, [["__scopeId", "data-v-014c232e"]]);
|
|
319
83
|
export {
|
|
320
|
-
|
|
84
|
+
V as PooderEditor
|
|
321
85
|
};
|
package/dist/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(t,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@pooder/core"),require("@pooder/kit")):typeof define=="function"&&define.amd?define(["exports","vue","@pooder/core","@pooder/kit"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.PooderVue={},t.Vue,t.PooderCore,t.PooderKit))})(this,(function(t,e,l,a){"use strict";const C=e.defineComponent({__name:"CanvasArea",emits:["canvas-ready","resize"],setup(n,{emit:i}){const o=i,s=e.ref(null),c=e.ref(null);let d=null;return e.onMounted(()=>{if(s.value&&c.value){const{clientWidth:p,clientHeight:u}=s.value;c.value.width=p,c.value.height=u,o("canvas-ready",c.value),d=new ResizeObserver(y=>{for(const v of y){const{width:m,height:r}=v.contentRect;o("resize",m,r)}}),d.observe(s.value)}}),e.onUnmounted(()=>{d&&d.disconnect()}),(p,u)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"container",ref:s,class:"pooder-canvas-area"},[e.createElementVNode("canvas",{ref_key:"canvas",ref:c},null,512)],512))}}),_=(n,i)=>{const o=n.__vccOpts||n;for(const[s,c]of i)o[s]=c;return o},h=_(C,[["__scopeId","data-v-dc60e8d6"]]),S={class:"pooder-editor"},w=_(e.defineComponent({__name:"PooderEditor",setup(n,{expose:i}){const o=new l.Pooder;e.provide("pooder",o),o.getService("CanvasService");const s=o.getService("CommandService"),c=o.getService("ConfigurationService");i({importConfig:r=>{c.import(r)},exportConfig:()=>c.export(),generateCutImage:async()=>await s.executeCommand("exportCutImage"),setUserImage:async r=>await s.executeCommand("setUserImage",r,1)});const v=r=>{const f=new a.CanvasService(r);o.registerService(f),[new a.BackgroundTool,new a.RulerTool,new a.MirrorTool,new a.DielineTool,new a.ImageTool,new a.HoleTool].forEach(O=>{o.extensionManager.register(O)})},m=(r,f)=>{const g=o.getService("CanvasService");g&&g.canvas.setDimensions({width:r,height:f})};return e.onUnmounted(()=>{const r=o.getService("CanvasService");r&&r.dispose(),o.extensionManager.destroy()}),(r,f)=>(e.openBlock(),e.createElementBlock("div",S,[e.createVNode(h,{onCanvasReady:v,onResize:m})]))}}),[["__scopeId","data-v-014c232e"]]);t.PooderEditor=w,Object.keys(l).forEach(n=>{n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:()=>l[n]})}),Object.keys(a).forEach(n=>{n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:()=>a[n]})}),Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})}));
|
|
@@ -1,129 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
height: {
|
|
8
|
-
type: NumberConstructor;
|
|
9
|
-
default: number;
|
|
10
|
-
};
|
|
11
|
-
}>, {
|
|
12
|
-
editor: import('vue').ShallowRef<Editor | null, Editor | null>;
|
|
13
|
-
onInit: (instance: Editor) => void;
|
|
14
|
-
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
15
|
-
width: {
|
|
16
|
-
type: NumberConstructor;
|
|
17
|
-
default: number;
|
|
18
|
-
};
|
|
19
|
-
height: {
|
|
20
|
-
type: NumberConstructor;
|
|
21
|
-
default: number;
|
|
22
|
-
};
|
|
23
|
-
}>> & Readonly<{}>, {
|
|
24
|
-
width: number;
|
|
25
|
-
height: number;
|
|
26
|
-
}, {}, {
|
|
27
|
-
CanvasArea: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
28
|
-
width: {
|
|
29
|
-
type: NumberConstructor;
|
|
30
|
-
required: true;
|
|
31
|
-
};
|
|
32
|
-
height: {
|
|
33
|
-
type: NumberConstructor;
|
|
34
|
-
required: true;
|
|
35
|
-
};
|
|
36
|
-
}>, {
|
|
37
|
-
canvasRef: import('vue').Ref<HTMLCanvasElement | null, HTMLCanvasElement | null>;
|
|
38
|
-
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, "init"[], "init", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
39
|
-
width: {
|
|
40
|
-
type: NumberConstructor;
|
|
41
|
-
required: true;
|
|
42
|
-
};
|
|
43
|
-
height: {
|
|
44
|
-
type: NumberConstructor;
|
|
45
|
-
required: true;
|
|
46
|
-
};
|
|
47
|
-
}>> & Readonly<{
|
|
48
|
-
onInit?: ((...args: any[]) => any) | undefined;
|
|
49
|
-
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
50
|
-
ToolPanel: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
51
|
-
editor: {
|
|
52
|
-
type: import('vue').PropType<Editor | null>;
|
|
53
|
-
default: null;
|
|
54
|
-
};
|
|
55
|
-
}>, {
|
|
56
|
-
extensionList: import('vue').Ref<{
|
|
57
|
-
name: string;
|
|
58
|
-
priority?: number | undefined;
|
|
59
|
-
options?: import('../../core/src/index.ts').ExtensionOptions | undefined;
|
|
60
|
-
schema?: Record<string | number, import('../../core/src/index.ts').OptionSchema> | undefined;
|
|
61
|
-
enabled?: boolean | undefined;
|
|
62
|
-
onCreate?: ((editor: Editor) => void) | undefined;
|
|
63
|
-
onMount?: ((editor: Editor) => void) | undefined;
|
|
64
|
-
onUpdate?: ((editor: Editor, state: import('../../core/src/index.ts').EditorState) => void) | undefined;
|
|
65
|
-
onUnmount?: ((editor: Editor) => void) | undefined;
|
|
66
|
-
onDestroy?: ((editor: Editor) => void) | undefined;
|
|
67
|
-
toJSON?: (() => any) | undefined;
|
|
68
|
-
loadFromJSON?: ((data: any) => void | Promise<void>) | undefined;
|
|
69
|
-
commands?: Record<string, import('../../core/src/index.ts').Command> | undefined;
|
|
70
|
-
}[], import('../../core/src/index.ts').Extension<import('../../core/src/index.ts').ExtensionOptions>[] | {
|
|
71
|
-
name: string;
|
|
72
|
-
priority?: number | undefined;
|
|
73
|
-
options?: import('../../core/src/index.ts').ExtensionOptions | undefined;
|
|
74
|
-
schema?: Record<string | number, import('../../core/src/index.ts').OptionSchema> | undefined;
|
|
75
|
-
enabled?: boolean | undefined;
|
|
76
|
-
onCreate?: ((editor: Editor) => void) | undefined;
|
|
77
|
-
onMount?: ((editor: Editor) => void) | undefined;
|
|
78
|
-
onUpdate?: ((editor: Editor, state: import('../../core/src/index.ts').EditorState) => void) | undefined;
|
|
79
|
-
onUnmount?: ((editor: Editor) => void) | undefined;
|
|
80
|
-
onDestroy?: ((editor: Editor) => void) | undefined;
|
|
81
|
-
toJSON?: (() => any) | undefined;
|
|
82
|
-
loadFromJSON?: ((data: any) => void | Promise<void>) | undefined;
|
|
83
|
-
commands?: Record<string, import('../../core/src/index.ts').Command> | undefined;
|
|
84
|
-
}[]>;
|
|
85
|
-
getInputType: (ext: import('../../core/src/index.ts').Extension, key: string, value: any) => string;
|
|
86
|
-
updateOption: (ext: import('../../core/src/index.ts').Extension, key: string | number, value: any) => void;
|
|
87
|
-
getMinMax: (ext: import('../../core/src/index.ts').Extension, key: string, val: number) => {
|
|
88
|
-
min: number;
|
|
89
|
-
max: number;
|
|
90
|
-
step: number;
|
|
91
|
-
};
|
|
92
|
-
formatNumber: (val: any) => any;
|
|
93
|
-
getLabel: (ext: import('../../core/src/index.ts').Extension, key: string) => string;
|
|
94
|
-
getSelectOptions: (ext: import('../../core/src/index.ts').Extension, key: string) => {
|
|
95
|
-
label: string;
|
|
96
|
-
value: any;
|
|
97
|
-
}[];
|
|
98
|
-
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
99
|
-
editor: {
|
|
100
|
-
type: import('vue').PropType<Editor | null>;
|
|
101
|
-
default: null;
|
|
102
|
-
};
|
|
103
|
-
}>> & Readonly<{}>, {
|
|
104
|
-
editor: Editor | null;
|
|
105
|
-
}, {}, {
|
|
106
|
-
ColorPicker: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
107
|
-
modelValue: {
|
|
108
|
-
type: StringConstructor;
|
|
109
|
-
default: string;
|
|
110
|
-
};
|
|
111
|
-
}>, {
|
|
112
|
-
hexValue: import('vue').ComputedRef<string>;
|
|
113
|
-
alphaValue: import('vue').ComputedRef<number>;
|
|
114
|
-
updateColor: (e: Event) => void;
|
|
115
|
-
updateAlpha: (e: Event) => void;
|
|
116
|
-
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("update:modelValue" | "change")[], "update:modelValue" | "change", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
117
|
-
modelValue: {
|
|
118
|
-
type: StringConstructor;
|
|
119
|
-
default: string;
|
|
120
|
-
};
|
|
121
|
-
}>> & Readonly<{
|
|
122
|
-
onChange?: ((...args: any[]) => any) | undefined;
|
|
123
|
-
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
124
|
-
}>, {
|
|
125
|
-
modelValue: string;
|
|
126
|
-
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
127
|
-
}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
128
|
-
}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {
|
|
2
|
+
importConfig: (config: Record<string, any>) => void;
|
|
3
|
+
exportConfig: () => Record<string, any>;
|
|
4
|
+
generateCutImage: () => Promise<any>;
|
|
5
|
+
setUserImage: (url: string) => Promise<any>;
|
|
6
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
129
7
|
export default _default;
|
|
@@ -1,24 +1,11 @@
|
|
|
1
|
-
declare const _default: import('vue').DefineComponent<import('vue').
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
height:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
canvasRef: import('vue').Ref<HTMLCanvasElement | null, HTMLCanvasElement | null>;
|
|
12
|
-
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, "init"[], "init", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
13
|
-
width: {
|
|
14
|
-
type: NumberConstructor;
|
|
15
|
-
required: true;
|
|
16
|
-
};
|
|
17
|
-
height: {
|
|
18
|
-
type: NumberConstructor;
|
|
19
|
-
required: true;
|
|
20
|
-
};
|
|
21
|
-
}>> & Readonly<{
|
|
22
|
-
onInit?: ((...args: any[]) => any) | undefined;
|
|
23
|
-
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
2
|
+
"canvas-ready": (el: HTMLCanvasElement) => any;
|
|
3
|
+
resize: (width: number, height: number) => any;
|
|
4
|
+
}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{
|
|
5
|
+
"onCanvas-ready"?: ((el: HTMLCanvasElement) => any) | undefined;
|
|
6
|
+
onResize?: ((width: number, height: number) => any) | undefined;
|
|
7
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
|
|
8
|
+
container: HTMLDivElement;
|
|
9
|
+
canvas: HTMLCanvasElement;
|
|
10
|
+
}, HTMLDivElement>;
|
|
24
11
|
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
2
|
+
export default _default;
|
|
@@ -1,81 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Editor, Extension, OptionSchema } from '../../../core/src/index.ts';
|
|
3
|
-
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
4
|
-
editor: {
|
|
5
|
-
type: PropType<Editor | null>;
|
|
6
|
-
default: null;
|
|
7
|
-
};
|
|
8
|
-
}>, {
|
|
9
|
-
extensionList: import('vue').Ref<{
|
|
10
|
-
name: string;
|
|
11
|
-
priority?: number | undefined;
|
|
12
|
-
options?: import('../../../core/src/index.ts').ExtensionOptions | undefined;
|
|
13
|
-
schema?: Record<string | number, OptionSchema> | undefined;
|
|
14
|
-
enabled?: boolean | undefined;
|
|
15
|
-
onCreate?: ((editor: Editor) => void) | undefined;
|
|
16
|
-
onMount?: ((editor: Editor) => void) | undefined;
|
|
17
|
-
onUpdate?: ((editor: Editor, state: import('../../../core/src/index.ts').EditorState) => void) | undefined;
|
|
18
|
-
onUnmount?: ((editor: Editor) => void) | undefined;
|
|
19
|
-
onDestroy?: ((editor: Editor) => void) | undefined;
|
|
20
|
-
toJSON?: (() => any) | undefined;
|
|
21
|
-
loadFromJSON?: ((data: any) => void | Promise<void>) | undefined;
|
|
22
|
-
commands?: Record<string, import('../../../core/src/index.ts').Command> | undefined;
|
|
23
|
-
}[], Extension<import('../../../core/src/index.ts').ExtensionOptions>[] | {
|
|
24
|
-
name: string;
|
|
25
|
-
priority?: number | undefined;
|
|
26
|
-
options?: import('../../../core/src/index.ts').ExtensionOptions | undefined;
|
|
27
|
-
schema?: Record<string | number, OptionSchema> | undefined;
|
|
28
|
-
enabled?: boolean | undefined;
|
|
29
|
-
onCreate?: ((editor: Editor) => void) | undefined;
|
|
30
|
-
onMount?: ((editor: Editor) => void) | undefined;
|
|
31
|
-
onUpdate?: ((editor: Editor, state: import('../../../core/src/index.ts').EditorState) => void) | undefined;
|
|
32
|
-
onUnmount?: ((editor: Editor) => void) | undefined;
|
|
33
|
-
onDestroy?: ((editor: Editor) => void) | undefined;
|
|
34
|
-
toJSON?: (() => any) | undefined;
|
|
35
|
-
loadFromJSON?: ((data: any) => void | Promise<void>) | undefined;
|
|
36
|
-
commands?: Record<string, import('../../../core/src/index.ts').Command> | undefined;
|
|
37
|
-
}[]>;
|
|
38
|
-
getInputType: (ext: Extension, key: string, value: any) => string;
|
|
39
|
-
updateOption: (ext: Extension, key: string | number, value: any) => void;
|
|
40
|
-
getMinMax: (ext: Extension, key: string, val: number) => {
|
|
41
|
-
min: number;
|
|
42
|
-
max: number;
|
|
43
|
-
step: number;
|
|
44
|
-
};
|
|
45
|
-
formatNumber: (val: any) => any;
|
|
46
|
-
getLabel: (ext: Extension, key: string) => string;
|
|
47
|
-
getSelectOptions: (ext: Extension, key: string) => {
|
|
48
|
-
label: string;
|
|
49
|
-
value: any;
|
|
50
|
-
}[];
|
|
51
|
-
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
52
|
-
editor: {
|
|
53
|
-
type: PropType<Editor | null>;
|
|
54
|
-
default: null;
|
|
55
|
-
};
|
|
56
|
-
}>> & Readonly<{}>, {
|
|
57
|
-
editor: Editor | null;
|
|
58
|
-
}, {}, {
|
|
59
|
-
ColorPicker: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
60
|
-
modelValue: {
|
|
61
|
-
type: StringConstructor;
|
|
62
|
-
default: string;
|
|
63
|
-
};
|
|
64
|
-
}>, {
|
|
65
|
-
hexValue: import('vue').ComputedRef<string>;
|
|
66
|
-
alphaValue: import('vue').ComputedRef<number>;
|
|
67
|
-
updateColor: (e: Event) => void;
|
|
68
|
-
updateAlpha: (e: Event) => void;
|
|
69
|
-
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("update:modelValue" | "change")[], "update:modelValue" | "change", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
70
|
-
modelValue: {
|
|
71
|
-
type: StringConstructor;
|
|
72
|
-
default: string;
|
|
73
|
-
};
|
|
74
|
-
}>> & Readonly<{
|
|
75
|
-
onChange?: ((...args: any[]) => any) | undefined;
|
|
76
|
-
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
77
|
-
}>, {
|
|
78
|
-
modelValue: string;
|
|
79
|
-
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
80
|
-
}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
81
2
|
export default _default;
|
package/dist/vue/src/index.d.ts
CHANGED
package/dist/vue.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.canvas-area[data-v-
|
|
1
|
+
.pooder-canvas-area[data-v-dc60e8d6]{flex:1;width:100%;height:100%;min-height:650px;min-width:650px;overflow:hidden;background:#f5f5f5;position:relative}canvas[data-v-dc60e8d6]{display:block}.pooder-editor[data-v-014c232e]{display:flex;width:100%;height:100%;overflow:hidden}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pooder/vue",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"main": "./dist/index.umd.js",
|
|
5
5
|
"module": "./dist/index.es.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"access": "public"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@pooder/
|
|
23
|
-
"@pooder/
|
|
22
|
+
"@pooder/core": "1.0.0",
|
|
23
|
+
"@pooder/kit": "3.0.0"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
26
|
"vue": "^3.0.0"
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
2
|
-
modelValue: {
|
|
3
|
-
type: StringConstructor;
|
|
4
|
-
default: string;
|
|
5
|
-
};
|
|
6
|
-
}>, {
|
|
7
|
-
hexValue: import('vue').ComputedRef<string>;
|
|
8
|
-
alphaValue: import('vue').ComputedRef<number>;
|
|
9
|
-
updateColor: (e: Event) => void;
|
|
10
|
-
updateAlpha: (e: Event) => void;
|
|
11
|
-
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("update:modelValue" | "change")[], "update:modelValue" | "change", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
12
|
-
modelValue: {
|
|
13
|
-
type: StringConstructor;
|
|
14
|
-
default: string;
|
|
15
|
-
};
|
|
16
|
-
}>> & Readonly<{
|
|
17
|
-
onChange?: ((...args: any[]) => any) | undefined;
|
|
18
|
-
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
19
|
-
}>, {
|
|
20
|
-
modelValue: string;
|
|
21
|
-
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
22
|
-
export default _default;
|