@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 CHANGED
@@ -1,321 +1,85 @@
1
- import { defineComponent as v, ref as k, onMounted as A, onBeforeUnmount as M, createElementBlock as p, openBlock as h, createElementVNode as l, computed as T, toDisplayString as b, watch as N, isReactive as P, reactive as E, resolveComponent as V, createCommentVNode as O, Fragment as C, renderList as S, createVNode as y, shallowRef as L } from "vue";
2
- import { BackgroundTool as W, ImageTool as B, WhiteInkTool as F, DielineTool as H, HoleTool as R, FilmTool as U } from "@pooder/kit";
3
- import { PooderEditor as j } from "@pooder/core";
4
- const q = v({
5
- name: "CanvasArea",
6
- props: {
7
- width: {
8
- type: Number,
9
- required: !0
10
- },
11
- height: {
12
- type: Number,
13
- required: !0
14
- }
15
- },
16
- emits: ["init"],
17
- setup(t, { emit: o }) {
18
- const d = k(null);
19
- let s = null;
20
- return A(() => {
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
- return "#000000";
74
- }, s = (r) => {
75
- if (!r) return 1;
76
- const n = String(r);
77
- if (n.startsWith("#"))
78
- return n.length === 9 ? parseInt(n.slice(7), 16) / 255 : 1;
79
- if (n.startsWith("rgba")) {
80
- const e = n.match(/\d+(\.\d+)?/g);
81
- if (e && e.length >= 4) return parseFloat(e[3]);
82
- }
83
- return 1;
84
- }, f = T(() => d(t.modelValue)), _ = T(
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
- }), X = { class: "color-picker" }, Y = ["value"], Z = { class: "alpha-slider-wrap" }, x = ["value"], ee = { class: "alpha-value" };
101
- function te(t, o, d, s, f, _) {
102
- return h(), p("div", X, [
103
- l("input", {
104
- type: "color",
105
- value: t.hexValue,
106
- onInput: o[0] || (o[0] = (...m) => t.updateColor && t.updateColor(...m))
107
- }, null, 40, Y),
108
- l("div", Z, [
109
- o[2] || (o[2] = l("span", { class: "alpha-label" }, "A:", -1)),
110
- l("input", {
111
- type: "range",
112
- min: "0",
113
- max: "100",
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
- { immediate: !0 }
143
- );
144
- const s = (e, u) => e.schema?.[u];
145
- return {
146
- extensionList: o,
147
- getInputType: (e, u, i) => {
148
- const c = s(e, u);
149
- if (c && c.type) return c.type;
150
- if (typeof i == "boolean") return "checkbox";
151
- if (typeof i == "number") return "number";
152
- if (typeof i == "string") {
153
- const g = u.toLowerCase();
154
- return g.includes("color") || g.includes("fill") || g.includes("stroke") || i.startsWith("#") || i.startsWith("rgb") ? "color" : "text";
155
- }
156
- return "text";
157
- },
158
- updateOption: (e, u, i) => {
159
- e.options && (e.options[String(u)] = i, t.editor && t.editor.updateState((c) => ({ ...c })));
160
- },
161
- getMinMax: (e, u, i) => {
162
- const c = s(e, u);
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
- }), Te = { class: "pooder-editor" }, Oe = { class: "center-area" }, ke = { class: "right-panel" };
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
- Ee as PooderEditor
84
+ V as PooderEditor
321
85
  };
package/dist/index.umd.js CHANGED
@@ -1 +1 @@
1
- (function(m,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@pooder/kit"),require("@pooder/core")):typeof define=="function"&&define.amd?define(["exports","vue","@pooder/kit","@pooder/core"],e):(m=typeof globalThis<"u"?globalThis:m||self,e(m.PooderVue={},m.Vue,m.PooderKit,m.PooderCore))})(this,(function(m,e,f,$){"use strict";const k=e.defineComponent({name:"CanvasArea",props:{width:{type:Number,required:!0},height:{type:Number,required:!0}},emits:["init"],setup(n,{emit:r}){const p=e.ref(null);let s=null;return e.onMounted(()=>{p.value&&(p.value.width=n.width,p.value.height=n.height,s=new $.PooderEditor(p.value,{width:n.width,height:n.height}),r("init",s))}),e.onBeforeUnmount(()=>{s&&s.destroy()}),{canvasRef:p}}}),V=(n,r)=>{const p=n.__vccOpts||n;for(const[s,g]of r)p[s]=g;return p},B={class:"canvas-area"},I={class:"canvas-wrapper"},N={ref:"canvasRef"};function C(n,r,p,s,g,_){return e.openBlock(),e.createElementBlock("div",B,[e.createElementVNode("div",I,[e.createElementVNode("canvas",N,null,512)])])}const y=V(k,[["render",C],["__scopeId","data-v-c0e5ef40"]]),S=e.defineComponent({name:"ColorPicker",props:{modelValue:{type:String,default:"#000000"}},emits:["update:modelValue","change"],setup(n,{emit:r}){const p=a=>{if(!a)return"#000000";const o=String(a);if(o.startsWith("#")){if(o.length===9)return o.slice(0,7);if(o.length===7)return o;if(o.length===4)return"#"+o[1]+o[1]+o[2]+o[2]+o[3]+o[3]}if(o.startsWith("rgb")){const t=o.match(/\d+(\.\d+)?/g);if(t&&t.length>=3){const c=parseInt(t[0]),i=parseInt(t[1]),d=parseInt(t[2]),u=E=>{const b=E.toString(16);return b.length===1?"0"+b:b};return`#${u(c)}${u(i)}${u(d)}`}}return"#000000"},s=a=>{if(!a)return 1;const o=String(a);if(o.startsWith("#"))return o.length===9?parseInt(o.slice(7),16)/255:1;if(o.startsWith("rgba")){const t=o.match(/\d+(\.\d+)?/g);if(t&&t.length>=4)return parseFloat(t[3])}return 1},g=e.computed(()=>p(n.modelValue)),_=e.computed(()=>Math.round(s(n.modelValue)*100));return{hexValue:g,alphaValue:_,updateColor:a=>{const o=a.target.value,t=s(n.modelValue),c=parseInt(o.slice(1,3),16),i=parseInt(o.slice(3,5),16),d=parseInt(o.slice(5,7),16),u=`rgba(${c}, ${i}, ${d}, ${t})`;r("update:modelValue",u),r("change",u)},updateAlpha:a=>{const o=a.target.value,t=parseInt(o)/100,c=p(n.modelValue),i=parseInt(c.slice(1,3),16),d=parseInt(c.slice(3,5),16),u=parseInt(c.slice(5,7),16),E=`rgba(${i}, ${d}, ${u}, ${t})`;r("update:modelValue",E),r("change",E)}}}}),w={class:"color-picker"},T=["value"],O={class:"alpha-slider-wrap"},P=["value"],M={class:"alpha-value"};function A(n,r,p,s,g,_){return e.openBlock(),e.createElementBlock("div",w,[e.createElementVNode("input",{type:"color",value:n.hexValue,onInput:r[0]||(r[0]=(...h)=>n.updateColor&&n.updateColor(...h))},null,40,T),e.createElementVNode("div",O,[r[2]||(r[2]=e.createElementVNode("span",{class:"alpha-label"},"A:",-1)),e.createElementVNode("input",{type:"range",min:"0",max:"100",step:"1",value:n.alphaValue,onInput:r[1]||(r[1]=(...h)=>n.updateAlpha&&n.updateAlpha(...h))},null,40,P),e.createElementVNode("span",M,e.toDisplayString(n.alphaValue)+"%",1)])])}const L=V(S,[["render",A],["__scopeId","data-v-21507ccd"]]),W=e.defineComponent({name:"ToolPanel",components:{ColorPicker:L},props:{editor:{type:Object,default:null}},setup(n){const r=e.ref([]),p=()=>{n.editor?r.value=Array.from(n.editor.getExtensions().map(t=>(t.options&&!e.isReactive(t.options)&&(t.options=e.reactive(t.options)),t))):r.value=[]};e.watch(()=>n.editor,t=>{p()},{immediate:!0});const s=(t,c)=>t.schema?.[c];return{extensionList:r,getInputType:(t,c,i)=>{const d=s(t,c);if(d&&d.type)return d.type;if(typeof i=="boolean")return"checkbox";if(typeof i=="number")return"number";if(typeof i=="string"){const u=c.toLowerCase();return u.includes("color")||u.includes("fill")||u.includes("stroke")||i.startsWith("#")||i.startsWith("rgb")?"color":"text"}return"text"},updateOption:(t,c,i)=>{t.options&&(t.options[String(c)]=i,n.editor&&n.editor.updateState(d=>({...d})))},getMinMax:(t,c,i)=>{const d=s(t,c);return d?{min:d.min??0,max:d.max??100,step:d.step??1}:i<=1&&i>=0?{min:0,max:1,step:.01}:{min:0,max:Math.max(1e3,i*2),step:1}},formatNumber:t=>typeof t=="number"?Number.isInteger(t)?t:t.toFixed(2):t,getLabel:(t,c)=>{const i=s(t,c);return i&&i.label?i.label:c.charAt(0).toUpperCase()+c.slice(1)},getSelectOptions:(t,c)=>{const i=s(t,c);return!i||!i.options?[]:i.options.map(d=>typeof d=="string"?{label:d,value:d}:d)}}}}),D={key:0,class:"tool-panel"},F={key:0},q={key:0},j=["value","onChange"],H=["value"],R={key:1},U={key:2},K=["value","onInput"],z={class:"slider-container"},G=["min","max","step","value","onInput"],J={class:"slider-value"},Q={key:3},X={class:"switch-wrapper"},Y={class:"switch"},Z=["checked","onChange"],x={key:4},v={class:"checkbox-wrapper"},ee=["checked","onChange"],te={key:5},ne=["value","onInput"];function oe(n,r,p,s,g,_){const h=e.resolveComponent("ColorPicker");return n.editor?(e.openBlock(),e.createElementBlock("div",D,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.extensionList,l=>(e.openBlock(),e.createElementBlock("div",{class:"plugin-section",key:l.name},[e.createElementVNode("h3",null,e.toDisplayString(l.name),1),l.options?(e.openBlock(),e.createElementBlock("div",F,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.options,(a,o)=>(e.openBlock(),e.createElementBlock("div",{key:o,class:"config-item"},[e.createElementVNode("label",null,e.toDisplayString(n.getLabel(l,String(o))),1),n.getInputType(l,String(o),a)==="select"?(e.openBlock(),e.createElementBlock("div",q,[e.createElementVNode("select",{value:a,onChange:t=>n.updateOption(l,o,t.target.value)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.getSelectOptions(l,String(o)),t=>(e.openBlock(),e.createElementBlock("option",{key:t.value,value:t.value},e.toDisplayString(t.label),9,H))),128))],40,j)])):n.getInputType(l,String(o),a)==="color"?(e.openBlock(),e.createElementBlock("div",R,[e.createVNode(h,{modelValue:String(a),"onUpdate:modelValue":t=>n.updateOption(l,o,t)},null,8,["modelValue","onUpdate:modelValue"])])):n.getInputType(l,String(o),a)==="number"?(e.openBlock(),e.createElementBlock("div",U,[e.createElementVNode("input",{type:"number",value:a,onInput:t=>n.updateOption(l,o,Number(t.target.value))},null,40,K),e.createElementVNode("div",z,[e.createElementVNode("input",{type:"range",min:n.getMinMax(l,String(o),a).min,max:n.getMinMax(l,String(o),a).max,step:n.getMinMax(l,String(o),a).step,value:a,onInput:t=>n.updateOption(l,o,Number(t.target.value))},null,40,G),e.createElementVNode("span",J,e.toDisplayString(n.formatNumber(a)),1)])])):n.getInputType(l,String(o),a)==="boolean"?(e.openBlock(),e.createElementBlock("div",Q,[e.createElementVNode("div",X,[e.createElementVNode("label",Y,[e.createElementVNode("input",{type:"checkbox",checked:!!a,onChange:t=>n.updateOption(l,o,t.target.checked)},null,40,Z),r[0]||(r[0]=e.createElementVNode("span",{class:"slider"},null,-1))])])])):n.getInputType(l,String(o),a)==="checkbox"?(e.openBlock(),e.createElementBlock("div",x,[e.createElementVNode("div",v,[e.createElementVNode("input",{type:"checkbox",checked:!!a,onChange:t=>n.updateOption(l,o,t.target.checked)},null,40,ee)])])):(e.openBlock(),e.createElementBlock("div",te,[e.createElementVNode("input",{type:"text",value:a,onInput:t=>n.updateOption(l,o,t.target.value)},null,40,ne)]))]))),128))])):e.createCommentVNode("",!0)]))),128))])):e.createCommentVNode("",!0)}const re=V(W,[["render",oe],["__scopeId","data-v-77c5b72f"]]),se=e.defineComponent({name:"PooderEditor",components:{CanvasArea:y,ToolPanel:re},props:{width:{type:Number,default:1200},height:{type:Number,default:600}},setup(n){const r=e.shallowRef(null);return{editor:r,onInit:s=>{s.use(new f.BackgroundTool),s.use(new f.ImageTool),s.use(new f.WhiteInkTool),s.use(new f.DielineTool),s.use(new f.HoleTool),s.use(new f.FilmTool),r.value=s,console.log(s.getObjects())}}}}),ae={class:"pooder-editor"},le={class:"center-area"},ie={class:"right-panel"};function ce(n,r,p,s,g,_){const h=e.resolveComponent("CanvasArea"),l=e.resolveComponent("ToolPanel");return e.openBlock(),e.createElementBlock("div",ae,[e.createElementVNode("div",le,[e.createVNode(h,{width:n.width,height:n.height,onInit:n.onInit},null,8,["width","height","onInit"])]),e.createElementVNode("div",ie,[e.createVNode(l,{editor:n.editor},null,8,["editor"])])])}const de=V(se,[["render",ce],["__scopeId","data-v-b9b03377"]]);m.PooderEditor=de,Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})}));
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
- import { Editor } from '../../core/src/index.ts';
2
- declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
3
- width: {
4
- type: NumberConstructor;
5
- default: number;
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').ExtractPropTypes<{
2
- width: {
3
- type: NumberConstructor;
4
- required: true;
5
- };
6
- height: {
7
- type: NumberConstructor;
8
- required: true;
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 { PropType } from 'vue';
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;
@@ -1,2 +1,4 @@
1
1
  import { default as PooderEditor } from './PooderEditor.vue';
2
2
  export { PooderEditor };
3
+ export * from '../../core/src/index.ts';
4
+ export * from '../../kit/src/index.ts';
package/dist/vue.css CHANGED
@@ -1 +1 @@
1
- .canvas-area[data-v-c0e5ef40]{flex:1;background:#e0e0e0;display:flex;align-items:center;justify-content:center;overflow:auto;padding:20px}.canvas-wrapper[data-v-c0e5ef40]{background:#fff;box-shadow:0 0 10px #0000001a}.color-picker[data-v-21507ccd]{display:flex;flex-direction:column}.color-picker input[type=color][data-v-21507ccd]{width:100%;height:30px;padding:0;border:none;cursor:pointer}.alpha-slider-wrap[data-v-21507ccd]{display:flex;align-items:center;margin-top:5px}.alpha-label[data-v-21507ccd]{font-size:12px;color:#666;margin-right:5px;width:15px}.alpha-slider-wrap input[type=range][data-v-21507ccd]{flex:1;margin-right:5px}.alpha-value[data-v-21507ccd]{font-size:12px;color:#666;width:30px;text-align:right}.tool-panel[data-v-77c5b72f]{padding:15px;overflow-x:auto;overflow-y:hidden;height:100%;display:flex;flex-direction:row;background:#f9f9f9}.plugin-section[data-v-77c5b72f]{width:300px;flex-shrink:0;margin-right:20px;border-right:1px solid #eee;padding-right:20px;height:100%;overflow-y:auto}.plugin-section h3[data-v-77c5b72f]{margin-top:0;margin-bottom:15px;font-size:16px;color:#333;border-bottom:2px solid #ddd;padding-bottom:5px}.config-item[data-v-77c5b72f]{margin-bottom:15px}.config-item label[data-v-77c5b72f]{display:block;margin-bottom:5px;font-size:14px;font-weight:500;color:#555}.config-item input[type=text][data-v-77c5b72f],.config-item input[type=number][data-v-77c5b72f],.config-item select[data-v-77c5b72f]{width:100%;padding:8px;border:1px solid #ddd;border-radius:4px;box-sizing:border-box;font-size:14px}.config-item input[type=checkbox][data-v-77c5b72f]{transform:scale(1.2)}.checkbox-wrapper[data-v-77c5b72f]{padding:5px 0}.slider-container[data-v-77c5b72f]{display:flex;align-items:center;margin-top:5px}.slider-container input[type=range][data-v-77c5b72f]{flex:1;margin-right:10px}.slider-value[data-v-77c5b72f]{font-size:12px;color:#666;width:35px;text-align:right}.switch-wrapper[data-v-77c5b72f]{padding:5px 0}.switch[data-v-77c5b72f]{position:relative;display:inline-block;width:40px;height:20px}.switch input[data-v-77c5b72f]{opacity:0;width:0;height:0}.slider[data-v-77c5b72f]{position:absolute;cursor:pointer;inset:0;background-color:#ccc;transition:.4s;border-radius:20px}.slider[data-v-77c5b72f]:before{position:absolute;content:"";height:16px;width:16px;left:2px;bottom:2px;background-color:#fff;transition:.4s;border-radius:50%}input:checked+.slider[data-v-77c5b72f]{background-color:#2196f3}input:checked+.slider[data-v-77c5b72f]:before{transform:translate(20px)}.pooder-editor[data-v-b9b03377]{display:flex;flex-direction:column;width:100%;height:100%;background:#f0f2f5;box-sizing:border-box}.center-area[data-v-b9b03377]{flex:1;display:flex;flex-direction:column;position:relative;overflow:hidden}.right-panel[data-v-b9b03377]{width:100%;height:320px;background:#fff;border-top:1px solid #ddd;display:flex;flex-direction:column;z-index:10}
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": "2.0.0",
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/kit": "2.0.0",
23
- "@pooder/core": "0.1.0"
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;