@orchidui/dashboard 1.19.0 → 1.20.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.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
var pt = Object.defineProperty;
|
|
2
2
|
var gt = (n, V, r) => V in n ? pt(n, V, { enumerable: !0, configurable: !0, writable: !0, value: r }) : n[V] = r;
|
|
3
|
-
var
|
|
4
|
-
import { ref as v, computed as
|
|
5
|
-
import { Q as
|
|
6
|
-
import { BaseInput as
|
|
7
|
-
import { rgbToHsl as
|
|
3
|
+
var We = (n, V, r) => gt(n, typeof V != "symbol" ? V + "" : V, r);
|
|
4
|
+
import { ref as v, computed as $e, createBlock as P, openBlock as m, unref as w, normalizeClass as Q, withCtx as W, createVNode as L, createElementBlock as E, createSlots as vt, renderSlot as je, normalizeStyle as te, createCommentVNode as H, onMounted as Je, watch as fe, createElementVNode as h, Teleport as mt, Fragment as ge, createTextVNode as ve, toDisplayString as Ne, renderList as Ke, withKeys as ot, inject as Re, reactive as _e, provide as Be, nextTick as ft, withDirectives as ht, vShow as yt, defineAsyncComponent as it } from "vue";
|
|
5
|
+
import { Q as Y, a as bt } from "./QuillEditor-DwCbpq2d.js";
|
|
6
|
+
import { BaseInput as st, Dropdown as rt, Input as we, Icon as A, Modal as xt, Select as Ze, Slider as Ae } from "@orchidui/core";
|
|
7
|
+
import { rgbToHsl as et, rgb2Hex as tt, rgbaToHex8 as kt, hsl2Hex as lt, hexToRgb as ze, rgbToHue as Qe, hslToRgb as at, hex8ToRgba as $t, parseRgba as wt, parseRgb as St } from "./Dashboard/ColorPicker/components/converters.js";
|
|
8
8
|
import { PieChart as Ct } from "./Dashboard/Charts/PieChart/OcPieChart.js";
|
|
9
9
|
import { LineChart as Ml } from "./Dashboard/Charts/LineChart/OcLineChart.js";
|
|
10
10
|
import { BarChart as Al } from "./Dashboard/Charts/BarChart/OcBarChart.js";
|
|
@@ -35,7 +35,7 @@ const It = { key: 1 }, Vt = {
|
|
|
35
35
|
setup(n, { emit: V }) {
|
|
36
36
|
const r = n, y = V, u = v(!1), f = v(r.modelValue), C = (U) => {
|
|
37
37
|
U && (f.value = U, y("update:model-value", U));
|
|
38
|
-
}, p =
|
|
38
|
+
}, p = $e(() => r.variant === "gradient" ? {
|
|
39
39
|
class: "w-[20px] h-[20px] hide-svg-icon",
|
|
40
40
|
style: {
|
|
41
41
|
background: f.value
|
|
@@ -44,41 +44,41 @@ const It = { key: 1 }, Vt = {
|
|
|
44
44
|
style: {
|
|
45
45
|
color: f.value
|
|
46
46
|
}
|
|
47
|
-
}), a = v(), O = v([]),
|
|
47
|
+
}), a = v(), O = v([]), Z = () => {
|
|
48
48
|
O.value.length > 8 && (O.value = O.value.filter((U, N) => N < 8)), localStorage.setItem("ck-cp-local-color-list", JSON.stringify(O.value));
|
|
49
49
|
};
|
|
50
50
|
let M = localStorage.getItem("ck-cp-local-color-list");
|
|
51
|
-
M && (O.value = [...new Set(JSON.parse(M))],
|
|
52
|
-
const
|
|
51
|
+
M && (O.value = [...new Set(JSON.parse(M))], Z());
|
|
52
|
+
const T = (U) => {
|
|
53
53
|
if (!U && f.value)
|
|
54
54
|
if (O.value.find((D) => D === f.value))
|
|
55
55
|
O.value = [
|
|
56
56
|
f.value,
|
|
57
57
|
...O.value.filter((D) => D !== f.value)
|
|
58
|
-
],
|
|
58
|
+
], Z();
|
|
59
59
|
else {
|
|
60
60
|
O.value.length >= 9 && O.value.pop();
|
|
61
61
|
let D = f.value;
|
|
62
|
-
O.value.unshift(D),
|
|
62
|
+
O.value.unshift(D), Z();
|
|
63
63
|
}
|
|
64
|
-
}, B = v(!1),
|
|
64
|
+
}, B = v(!1), z = (U) => {
|
|
65
65
|
f.value = U, y("update:model-value", U), u.value = !1;
|
|
66
66
|
};
|
|
67
|
-
return (U, N) => (m(),
|
|
67
|
+
return (U, N) => (m(), P(w(st), {
|
|
68
68
|
class: Q(n.hideInputColor ? "w-[40px]" : ""),
|
|
69
69
|
onClick: N[1] || (N[1] = () => {
|
|
70
70
|
var D;
|
|
71
71
|
return (D = a.value) == null ? void 0 : D.toggleDropdown();
|
|
72
72
|
})
|
|
73
73
|
}, {
|
|
74
|
-
default:
|
|
75
|
-
|
|
74
|
+
default: W(() => [
|
|
75
|
+
L(w(rt), {
|
|
76
76
|
ref_key: "dropdownRef",
|
|
77
77
|
ref: a,
|
|
78
78
|
modelValue: u.value,
|
|
79
79
|
"onUpdate:modelValue": [
|
|
80
80
|
N[0] || (N[0] = (D) => u.value = D),
|
|
81
|
-
|
|
81
|
+
T
|
|
82
82
|
],
|
|
83
83
|
"max-menu-height": 800,
|
|
84
84
|
placement: n.placement,
|
|
@@ -86,8 +86,8 @@ const It = { key: 1 }, Vt = {
|
|
|
86
86
|
strategy: "fixed"
|
|
87
87
|
}
|
|
88
88
|
}, {
|
|
89
|
-
menu:
|
|
90
|
-
B.value ? H("", !0) : (m(),
|
|
89
|
+
menu: W(() => [
|
|
90
|
+
B.value ? H("", !0) : (m(), P(w(xl), {
|
|
91
91
|
key: 0,
|
|
92
92
|
variant: n.variant,
|
|
93
93
|
"show-alpha": !n.hideOpacity,
|
|
@@ -96,19 +96,19 @@ const It = { key: 1 }, Vt = {
|
|
|
96
96
|
"last-used-colors": O.value,
|
|
97
97
|
"preset-colors": n.presetColors,
|
|
98
98
|
"onUpdate:modelValue": C,
|
|
99
|
-
onLastUsedPick:
|
|
99
|
+
onLastUsedPick: z
|
|
100
100
|
}, null, 8, ["variant", "show-alpha", "type", "model-value", "last-used-colors", "preset-colors"]))
|
|
101
101
|
]),
|
|
102
|
-
default:
|
|
102
|
+
default: W(() => [
|
|
103
103
|
n.hideInputColor ? (m(), E("div", It, [
|
|
104
|
-
|
|
105
|
-
|
|
104
|
+
je(U.$slots, "picker-icon", {}, () => [
|
|
105
|
+
L(w(A), {
|
|
106
106
|
class: "cursor-pointer",
|
|
107
|
-
style:
|
|
107
|
+
style: te(`color: ${f.value}`),
|
|
108
108
|
name: "drop"
|
|
109
109
|
}, null, 8, ["style"])
|
|
110
110
|
])
|
|
111
|
-
])) : (m(),
|
|
111
|
+
])) : (m(), P(w(we), {
|
|
112
112
|
key: 0,
|
|
113
113
|
"model-value": f.value,
|
|
114
114
|
icon: "drop",
|
|
@@ -118,8 +118,8 @@ const It = { key: 1 }, Vt = {
|
|
|
118
118
|
}, vt({ _: 2 }, [
|
|
119
119
|
U.$slots.leading ? {
|
|
120
120
|
name: "leading",
|
|
121
|
-
fn:
|
|
122
|
-
|
|
121
|
+
fn: W(() => [
|
|
122
|
+
je(U.$slots, "leading")
|
|
123
123
|
]),
|
|
124
124
|
key: "0"
|
|
125
125
|
} : void 0
|
|
@@ -131,7 +131,7 @@ const It = { key: 1 }, Vt = {
|
|
|
131
131
|
_: 3
|
|
132
132
|
}, 8, ["class"]));
|
|
133
133
|
}
|
|
134
|
-
},
|
|
134
|
+
}, Tt = ["id"], Lt = { class: "flex items-center gap-x-3 px-5" }, Bt = { class: "flex items-center gap-x-5 cursor-pointer" }, Rt = { class: "flex flex-col py-2 overflow-hidden" }, Et = ["onClick"], Ut = { class: "flex gap-x-3 items-center px-5" }, Dt = { class: "flex items-center gap-x-3 px-5" }, Ht = { class: "flex gap-x-3 items-center px-5" }, Ot = { class: "flex gap-x-3 items-center px-5" }, Mt = { class: "flex items-center" }, Qt = { class: "grid cursor-pointer px-5" }, At = {
|
|
135
135
|
key: 5,
|
|
136
136
|
class: "flex gap-x-3 items-center px-5"
|
|
137
137
|
}, Nt = { class: "flex" }, Pt = { class: "mt-1 mx-2 cursor-pointer" }, Rl = {
|
|
@@ -200,136 +200,111 @@ const It = { key: 1 }, Vt = {
|
|
|
200
200
|
"alignment"
|
|
201
201
|
],
|
|
202
202
|
"text-only": ["changes", "font-size", "font-style", "link", "quote", "list", "alignment"]
|
|
203
|
-
}, f =
|
|
204
|
-
C.whitelist = r.fontSizes.map((c) => c.value),
|
|
205
|
-
const p =
|
|
206
|
-
|
|
207
|
-
const a =
|
|
208
|
-
|
|
209
|
-
const O =
|
|
210
|
-
|
|
211
|
-
const
|
|
212
|
-
|
|
213
|
-
const M =
|
|
214
|
-
|
|
215
|
-
const
|
|
216
|
-
class B extends
|
|
203
|
+
}, f = $e(() => u[r.variant]), C = Y.import("attributors/style/size");
|
|
204
|
+
C.whitelist = r.fontSizes.map((c) => c.value), Y.register(C, !0);
|
|
205
|
+
const p = Y.import("attributors/style/align");
|
|
206
|
+
Y.register(p, !0);
|
|
207
|
+
const a = Y.import("attributors/style/background");
|
|
208
|
+
Y.register(a, !0);
|
|
209
|
+
const O = Y.import("attributors/style/color");
|
|
210
|
+
Y.register(O, !0);
|
|
211
|
+
const Z = Y.import("attributors/style/direction");
|
|
212
|
+
Y.register(Z, !0);
|
|
213
|
+
const M = Y.import("attributors/style/font");
|
|
214
|
+
Y.register(M, !0);
|
|
215
|
+
const T = Y.import("blots/block/embed");
|
|
216
|
+
class B extends T {
|
|
217
217
|
}
|
|
218
|
-
|
|
219
|
-
const
|
|
218
|
+
We(B, "blotName", "divider"), We(B, "tagName", "hr"), Y.register(B);
|
|
219
|
+
const z = v(
|
|
220
220
|
Math.random().toString(36).replace(/[^a-zA-Z]+/g, "")
|
|
221
|
-
), U = v(!1), N = v(!1), D = v(!1),
|
|
222
|
-
|
|
223
|
-
"background",
|
|
224
|
-
"bold",
|
|
225
|
-
"color",
|
|
226
|
-
"font",
|
|
227
|
-
"code",
|
|
228
|
-
"italic",
|
|
229
|
-
"link",
|
|
230
|
-
"size",
|
|
231
|
-
"strike",
|
|
232
|
-
"script",
|
|
233
|
-
"underline",
|
|
234
|
-
"blockquote",
|
|
235
|
-
"header",
|
|
236
|
-
"indent",
|
|
237
|
-
"list",
|
|
238
|
-
"align",
|
|
239
|
-
"direction",
|
|
240
|
-
"code-block",
|
|
241
|
-
"formula"
|
|
242
|
-
];
|
|
243
|
-
return f.value.includes("image") && c.push("image"), f.value.includes("media") && c.push("video"), {
|
|
244
|
-
formats: c
|
|
245
|
-
};
|
|
246
|
-
}), Se = (c) => {
|
|
247
|
-
U.value = x.value.getQuill().history.stack.undo.length > 0, N.value = x.value.getQuill().history.stack.redo.length > 0, D.value = x.value.getQuill().getFormat().bold, te.value = x.value.getQuill().getFormat().italic, K.value = x.value.getQuill().getFormat().underline, R.value = x.value.getQuill().getFormat().blockquote, le.value = x.value.getQuill().getFormat().list, _.value = x.value.getQuill().getFormat().align;
|
|
221
|
+
), U = v(!1), N = v(!1), D = v(!1), le = v(!1), J = v(!1), j = v(!1), R = v(!1), X = v(""), ae = v(""), ee = v(""), b = v(), Se = v(!1), ue = v(r.image), ie = (c) => {
|
|
222
|
+
U.value = b.value.getQuill().history.stack.undo.length > 0, N.value = b.value.getQuill().history.stack.redo.length > 0, D.value = b.value.getQuill().getFormat().bold, le.value = b.value.getQuill().getFormat().italic, J.value = b.value.getQuill().getFormat().underline, R.value = b.value.getQuill().getFormat().blockquote, ae.value = b.value.getQuill().getFormat().list, ee.value = b.value.getQuill().getFormat().align;
|
|
248
223
|
let o = document.createElement("div");
|
|
249
|
-
o.innerHTML = c,
|
|
250
|
-
},
|
|
251
|
-
if (
|
|
252
|
-
const o =
|
|
253
|
-
|
|
254
|
-
`,
|
|
224
|
+
o.innerHTML = c, Se.value && (o.innerText ? y("update:modelValue", c || "") : y("update:modelValue", ""), o.remove());
|
|
225
|
+
}, Pe = () => {
|
|
226
|
+
if (b.value.getQuill().getSelection(!0)) {
|
|
227
|
+
const o = b.value.getQuill().getSelection(!0);
|
|
228
|
+
b.value.getQuill().insertText(o.index, `
|
|
229
|
+
`, Y.sources.USER), b.value.getQuill().insertEmbed(o.index + 1, "divider", !0, Y.sources.USER), b.value.getQuill().setSelection(o.index + 2, Y.sources.SILENT);
|
|
255
230
|
}
|
|
256
231
|
}, Ee = () => {
|
|
257
|
-
|
|
232
|
+
b.value.getQuill().history.undo(), ie(r.modelValue);
|
|
233
|
+
}, Ue = () => {
|
|
234
|
+
b.value.getQuill().history.redo(), ie(r.modelValue);
|
|
258
235
|
}, Ce = () => {
|
|
259
|
-
x.value.getQuill().history.redo(), Se(r.modelValue);
|
|
260
|
-
}, ae = () => {
|
|
261
236
|
var c;
|
|
262
|
-
|
|
237
|
+
b.value.getQuill().format("bold", !D.value), (c = b.value.getQuill().getSelection()) != null && c.length || (D.value = !D.value);
|
|
238
|
+
}, ne = () => {
|
|
239
|
+
var c;
|
|
240
|
+
b.value.getQuill().format("italic", !le.value), (c = b.value.getQuill().getSelection()) != null && c.length || (le.value = !le.value);
|
|
263
241
|
}, Ie = () => {
|
|
264
242
|
var c;
|
|
265
|
-
|
|
243
|
+
b.value.getQuill().format("underline", !J.value), (c = b.value.getQuill().getSelection()) != null && c.length || (J.value = !J.value);
|
|
244
|
+
}, De = (c) => {
|
|
245
|
+
b.value.getQuill().format("size", c), X.value = c, j.value = !1;
|
|
246
|
+
}, me = () => {
|
|
247
|
+
const c = b.value.getQuill().getSelection();
|
|
248
|
+
c && c.length > 0 && b.value.getQuill().theme.tooltip.edit();
|
|
266
249
|
}, Xe = () => {
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
},
|
|
272
|
-
|
|
273
|
-
c && c.length > 0 && x.value.getQuill().theme.tooltip.edit();
|
|
274
|
-
}, ne = () => {
|
|
275
|
-
x.value.getQuill().format("blockquote", !R.value);
|
|
276
|
-
}, Ue = (c) => {
|
|
277
|
-
const o = x.value.getQuill().getSelection();
|
|
278
|
-
o && (x.value.getQuill().clipboard.dangerouslyPasteHTML(o.index, `<img src="${c}" />`), ue.value = c, y("update:image", ue.value));
|
|
279
|
-
}, Fe = () => {
|
|
280
|
-
x.value.getQuill().getSelection() || x.value.getQuill().setSelection(x.value.getQuill().getLength() - 1);
|
|
250
|
+
b.value.getQuill().format("blockquote", !R.value);
|
|
251
|
+
}, oe = (c) => {
|
|
252
|
+
const o = b.value.getQuill().getSelection();
|
|
253
|
+
o && (b.value.getQuill().clipboard.dangerouslyPasteHTML(o.index, `<img src="${c}" />`), ue.value = c, y("update:image", ue.value));
|
|
254
|
+
}, He = () => {
|
|
255
|
+
b.value.getQuill().getSelection() || b.value.getQuill().setSelection(b.value.getQuill().getLength() - 1);
|
|
281
256
|
const c = document.createElement("input");
|
|
282
257
|
c.type = "file", c.accept = "jpg,.jpeg,.png,.webp,.gif", c.onchange = () => {
|
|
283
|
-
const o = c.files[0],
|
|
284
|
-
|
|
258
|
+
const o = c.files[0], x = new FileReader();
|
|
259
|
+
x.onload = () => oe(x.result), x.readAsDataURL(o);
|
|
285
260
|
}, c.click();
|
|
286
|
-
},
|
|
261
|
+
}, Oe = (c) => /^data:image\/(png|jpg|jpeg|gif);base64,/.test(c), q = (c) => {
|
|
287
262
|
setTimeout(() => {
|
|
288
|
-
var
|
|
263
|
+
var x;
|
|
289
264
|
if (c) {
|
|
290
|
-
const
|
|
291
|
-
|
|
292
|
-
let
|
|
293
|
-
if (
|
|
294
|
-
for (let
|
|
295
|
-
const
|
|
296
|
-
|
|
265
|
+
const G = b.value.getHTML(), se = document.createElement("div");
|
|
266
|
+
se.innerHTML = G;
|
|
267
|
+
let xe = se.getElementsByTagName("img");
|
|
268
|
+
if (xe && xe.length > 0)
|
|
269
|
+
for (let pe = 0; pe < xe.length; pe++) {
|
|
270
|
+
const ke = (x = xe[pe]) == null ? void 0 : x.getAttribute("src");
|
|
271
|
+
Oe(ke) && y("update:image", ke);
|
|
297
272
|
}
|
|
298
273
|
}
|
|
299
274
|
}, 100);
|
|
300
275
|
const { items: o } = c.clipboardData;
|
|
301
|
-
o.length && o[0].getAsString((
|
|
302
|
-
|
|
276
|
+
o.length && o[0].getAsString((x) => {
|
|
277
|
+
Oe(x) && (b.value.getQuill().getSelection() || b.value.getQuill().setSelection(b.value.getQuill().getLength() - 1));
|
|
303
278
|
});
|
|
304
|
-
},
|
|
305
|
-
|
|
306
|
-
},
|
|
307
|
-
|
|
308
|
-
},
|
|
309
|
-
|
|
310
|
-
},
|
|
311
|
-
|
|
279
|
+
}, _ = () => {
|
|
280
|
+
b.value.getQuill().theme.tooltip.edit("video");
|
|
281
|
+
}, Ve = (c) => {
|
|
282
|
+
b.value.getQuill().format("list", c), ae.value = c;
|
|
283
|
+
}, he = (c = void 0) => {
|
|
284
|
+
b.value.getQuill().format("align", c), ee.value = c;
|
|
285
|
+
}, de = v(""), qe = () => {
|
|
286
|
+
b.value.getQuill().format("color", de.value);
|
|
312
287
|
};
|
|
313
|
-
|
|
314
|
-
|
|
288
|
+
Je(() => {
|
|
289
|
+
De(r.initialFontSize || r.fontSizes[0].value), Se.value = !0;
|
|
315
290
|
});
|
|
316
|
-
const
|
|
317
|
-
var
|
|
318
|
-
|
|
319
|
-
const o = (
|
|
320
|
-
o && o.nodeName !== "#text" && (
|
|
321
|
-
},
|
|
322
|
-
var
|
|
323
|
-
const o = (
|
|
291
|
+
const ye = v(100), ce = v(!1), Te = (c) => {
|
|
292
|
+
var x, G;
|
|
293
|
+
ye.value = c;
|
|
294
|
+
const o = (x = window.getSelection()) == null ? void 0 : x.focusNode;
|
|
295
|
+
o && o.nodeName !== "#text" && (b.value.getQuill().format("width", `${ye.value}%`), (G = o == null ? void 0 : o.querySelector("img")) == null || G.setAttribute("style", "margin:auto;display:block;"));
|
|
296
|
+
}, be = (c = "left") => {
|
|
297
|
+
var x, G;
|
|
298
|
+
const o = (x = window.getSelection()) == null ? void 0 : x.focusNode;
|
|
324
299
|
if (o && o.nodeName !== "#text") {
|
|
325
|
-
let
|
|
326
|
-
c == "center" ?
|
|
300
|
+
let se = "float:left";
|
|
301
|
+
c == "center" ? se = "" : c == "right" && (se = "float:right"), (G = o == null ? void 0 : o.querySelector("img")) == null || G.setAttribute("style", `margin:auto;display:block;${se}`);
|
|
327
302
|
}
|
|
328
|
-
},
|
|
303
|
+
}, Me = () => {
|
|
329
304
|
var o;
|
|
330
305
|
const c = (o = window.getSelection()) == null ? void 0 : o.focusNode;
|
|
331
|
-
|
|
332
|
-
},
|
|
306
|
+
ce.value = c.innerHTML && c.innerHTML.includes("<img");
|
|
307
|
+
}, K = v(!1), F = v(3), Le = v(3), Fe = $e(() => {
|
|
333
308
|
let c = [];
|
|
334
309
|
for (let o = 1; o < 30; o++)
|
|
335
310
|
c.push({
|
|
@@ -337,7 +312,7 @@ const It = { key: 1 }, Vt = {
|
|
|
337
312
|
value: o.toString()
|
|
338
313
|
});
|
|
339
314
|
return c;
|
|
340
|
-
}),
|
|
315
|
+
}), Ge = $e(() => {
|
|
341
316
|
let c = [];
|
|
342
317
|
for (let o = 1; o < 12; o++)
|
|
343
318
|
c.push({
|
|
@@ -345,16 +320,16 @@ const It = { key: 1 }, Vt = {
|
|
|
345
320
|
value: o.toString()
|
|
346
321
|
});
|
|
347
322
|
return c;
|
|
348
|
-
}),
|
|
349
|
-
let c =
|
|
350
|
-
c == null || c.insertTable(parseInt(
|
|
323
|
+
}), Ye = () => {
|
|
324
|
+
let c = b.value.getQuill().getModule("better-table");
|
|
325
|
+
c == null || c.insertTable(parseInt(F.value), parseInt(Le.value)), K.value = !1;
|
|
351
326
|
};
|
|
352
|
-
return
|
|
327
|
+
return fe(
|
|
353
328
|
() => r.modelValue,
|
|
354
329
|
(c) => {
|
|
355
|
-
c ||
|
|
330
|
+
c || b.value.getQuill().setContents([], "silent");
|
|
356
331
|
}
|
|
357
|
-
), (c, o) => (m(),
|
|
332
|
+
), (c, o) => (m(), P(w(st), {
|
|
358
333
|
label: n.label,
|
|
359
334
|
hint: n.hint,
|
|
360
335
|
"error-message": n.errorMessage,
|
|
@@ -363,300 +338,302 @@ const It = { key: 1 }, Vt = {
|
|
|
363
338
|
"tooltip-text": n.tooltipText,
|
|
364
339
|
"tooltip-options": n.tooltipOptions
|
|
365
340
|
}, {
|
|
366
|
-
default:
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
modelValue
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
341
|
+
default: W(() => [
|
|
342
|
+
(m(), P(mt, { to: "body" }, [
|
|
343
|
+
L(w(xt), {
|
|
344
|
+
size: "small",
|
|
345
|
+
title: "Insert table",
|
|
346
|
+
modelValue: K.value,
|
|
347
|
+
"onUpdate:modelValue": o[2] || (o[2] = (x) => K.value = x),
|
|
348
|
+
class: "!w-full !h-full",
|
|
349
|
+
confirmButtonProps: {
|
|
350
|
+
label: "Save",
|
|
351
|
+
onClick: () => Ye()
|
|
352
|
+
}
|
|
353
|
+
}, {
|
|
354
|
+
default: W(() => [
|
|
355
|
+
L(w(Ze), {
|
|
356
|
+
modelValue: Le.value,
|
|
357
|
+
"onUpdate:modelValue": o[0] || (o[0] = (x) => Le.value = x),
|
|
358
|
+
options: Ge.value,
|
|
359
|
+
label: "Table cell",
|
|
360
|
+
class: "mb-3"
|
|
361
|
+
}, null, 8, ["modelValue", "options"]),
|
|
362
|
+
L(w(Ze), {
|
|
363
|
+
modelValue: F.value,
|
|
364
|
+
"onUpdate:modelValue": o[1] || (o[1] = (x) => F.value = x),
|
|
365
|
+
options: Fe.value,
|
|
366
|
+
label: "Table rows"
|
|
367
|
+
}, null, 8, ["modelValue", "options"])
|
|
368
|
+
]),
|
|
369
|
+
_: 1
|
|
370
|
+
}, 8, ["modelValue", "confirmButtonProps"])
|
|
371
|
+
])),
|
|
372
|
+
h("div", {
|
|
395
373
|
class: Q(["grid", { "has-error": n.errorMessage }]),
|
|
396
|
-
onClick:
|
|
374
|
+
onClick: Me
|
|
397
375
|
}, [
|
|
398
|
-
|
|
376
|
+
z.value ? (m(), P(w(bt), {
|
|
399
377
|
key: 0,
|
|
400
|
-
id: `#${
|
|
378
|
+
id: `#${z.value}`,
|
|
401
379
|
ref_key: "quill",
|
|
402
|
-
ref:
|
|
380
|
+
ref: b,
|
|
403
381
|
content: n.modelValue,
|
|
404
382
|
options: {
|
|
405
|
-
bounds: `#${
|
|
383
|
+
bounds: `#${z.value}`
|
|
406
384
|
},
|
|
407
385
|
"is-text-only": "",
|
|
408
386
|
theme: "snow",
|
|
409
387
|
"content-type": "html",
|
|
410
|
-
"global-options": ve.value,
|
|
411
388
|
class: "min-h-[200px]",
|
|
412
389
|
placeholder: n.placeholder,
|
|
413
|
-
"onUpdate:content":
|
|
414
|
-
onPaste:
|
|
390
|
+
"onUpdate:content": ie,
|
|
391
|
+
onPaste: q
|
|
415
392
|
}, {
|
|
416
|
-
toolbar:
|
|
417
|
-
|
|
418
|
-
id:
|
|
393
|
+
toolbar: W(() => [
|
|
394
|
+
h("div", {
|
|
395
|
+
id: z.value,
|
|
419
396
|
class: "flex min-h-[36px] flex-wrap !py-2 !px-3 gap-y-2 rounded-t"
|
|
420
397
|
}, [
|
|
421
|
-
f.value.includes("changes") ? (m(), E(
|
|
422
|
-
|
|
423
|
-
|
|
398
|
+
f.value.includes("changes") ? (m(), E(ge, { key: 0 }, [
|
|
399
|
+
h("div", Lt, [
|
|
400
|
+
L(w(A), {
|
|
424
401
|
class: Q(U.value ? "text-oc-text cursor-pointer" : "text-oc-text-300"),
|
|
425
402
|
width: "20",
|
|
426
403
|
height: "20",
|
|
427
404
|
name: "text-editor/undo",
|
|
428
405
|
onClick: Ee
|
|
429
406
|
}, null, 8, ["class"]),
|
|
430
|
-
|
|
407
|
+
L(w(A), {
|
|
431
408
|
class: Q(N.value ? "text-oc-text cursor-pointer" : "text-oc-text-300"),
|
|
432
409
|
width: "20",
|
|
433
410
|
height: "20",
|
|
434
411
|
name: "text-editor/redo",
|
|
435
|
-
onClick:
|
|
412
|
+
onClick: Ue
|
|
436
413
|
}, null, 8, ["class"])
|
|
437
414
|
]),
|
|
438
|
-
o[16] || (o[16] =
|
|
415
|
+
o[16] || (o[16] = h("div", { class: "border-l border-oc-gray-200" }, null, -1))
|
|
439
416
|
], 64)) : H("", !0),
|
|
440
|
-
f.value.includes("font-size") ? (m(), E(
|
|
441
|
-
|
|
442
|
-
modelValue:
|
|
443
|
-
"onUpdate:modelValue": o[3] || (o[3] = (
|
|
417
|
+
f.value.includes("font-size") ? (m(), E(ge, { key: 1 }, [
|
|
418
|
+
L(w(rt), {
|
|
419
|
+
modelValue: j.value,
|
|
420
|
+
"onUpdate:modelValue": o[3] || (o[3] = (x) => j.value = x),
|
|
444
421
|
class: "px-5"
|
|
445
422
|
}, {
|
|
446
|
-
menu:
|
|
447
|
-
|
|
448
|
-
(m(!0), E(
|
|
449
|
-
key:
|
|
450
|
-
class: Q(["min-w-[120px] cursor-pointer py-2 px-3 hover:bg-oc-gray-50",
|
|
451
|
-
onClick: (
|
|
452
|
-
},
|
|
423
|
+
menu: W(() => [
|
|
424
|
+
h("div", Rt, [
|
|
425
|
+
(m(!0), E(ge, null, Ke(n.fontSizes, (x) => (m(), E("div", {
|
|
426
|
+
key: x.value,
|
|
427
|
+
class: Q(["min-w-[120px] cursor-pointer py-2 px-3 hover:bg-oc-gray-50", X.value === x.value ? "font-medium" : ""]),
|
|
428
|
+
onClick: (G) => De(x.value)
|
|
429
|
+
}, Ne(x.label), 11, Et))), 128))
|
|
453
430
|
])
|
|
454
431
|
]),
|
|
455
|
-
default:
|
|
456
|
-
var
|
|
432
|
+
default: W(() => {
|
|
433
|
+
var x;
|
|
457
434
|
return [
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
435
|
+
h("div", Bt, [
|
|
436
|
+
ve(Ne((x = n.fontSizes.find((G) => G.value === X.value)) == null ? void 0 : x.label) + " ", 1),
|
|
437
|
+
L(w(A), {
|
|
461
438
|
width: "20",
|
|
462
439
|
height: "20",
|
|
463
440
|
name: "chevron-down",
|
|
464
|
-
class: Q(["transition-all",
|
|
441
|
+
class: Q(["transition-all", j.value ? "rotate-180" : ""])
|
|
465
442
|
}, null, 8, ["class"])
|
|
466
443
|
])
|
|
467
444
|
];
|
|
468
445
|
}),
|
|
469
446
|
_: 1
|
|
470
447
|
}, 8, ["modelValue"]),
|
|
471
|
-
o[17] || (o[17] =
|
|
448
|
+
o[17] || (o[17] = h("div", { class: "border-l border-oc-gray-200" }, null, -1))
|
|
472
449
|
], 64)) : H("", !0),
|
|
473
|
-
f.value.includes("font-style") ? (m(), E(
|
|
474
|
-
|
|
475
|
-
|
|
450
|
+
f.value.includes("font-style") ? (m(), E(ge, { key: 2 }, [
|
|
451
|
+
h("div", Ut, [
|
|
452
|
+
L(w(A), {
|
|
476
453
|
class: Q(["cursor-pointer", D.value ? "text-oc-text" : "text-oc-text-300"]),
|
|
477
454
|
width: "20",
|
|
478
455
|
height: "20",
|
|
479
456
|
name: "text-editor/bold",
|
|
480
|
-
onClick:
|
|
457
|
+
onClick: Ce
|
|
481
458
|
}, null, 8, ["class"]),
|
|
482
|
-
|
|
483
|
-
class: Q(["cursor-pointer",
|
|
459
|
+
L(w(A), {
|
|
460
|
+
class: Q(["cursor-pointer", le.value ? "text-oc-text" : "text-oc-text-300"]),
|
|
484
461
|
width: "20",
|
|
485
462
|
height: "20",
|
|
486
463
|
name: "text-editor/italic",
|
|
487
|
-
onClick:
|
|
464
|
+
onClick: ne
|
|
488
465
|
}, null, 8, ["class"]),
|
|
489
|
-
|
|
490
|
-
class: Q(["cursor-pointer",
|
|
466
|
+
L(w(A), {
|
|
467
|
+
class: Q(["cursor-pointer", J.value ? "text-oc-text" : "text-oc-text-300"]),
|
|
491
468
|
width: "20",
|
|
492
469
|
height: "20",
|
|
493
470
|
name: "text-editor/underline",
|
|
494
|
-
onClick:
|
|
471
|
+
onClick: Ie
|
|
495
472
|
}, null, 8, ["class"])
|
|
496
473
|
]),
|
|
497
|
-
o[18] || (o[18] =
|
|
474
|
+
o[18] || (o[18] = h("div", { class: "border-l border-oc-gray-200" }, null, -1))
|
|
498
475
|
], 64)) : H("", !0),
|
|
499
|
-
|
|
500
|
-
f.value.includes("link") ? (m(),
|
|
476
|
+
h("div", Dt, [
|
|
477
|
+
f.value.includes("link") ? (m(), P(w(A), {
|
|
501
478
|
key: 0,
|
|
502
479
|
class: "cursor-pointer",
|
|
503
480
|
width: "20",
|
|
504
481
|
height: "20",
|
|
505
482
|
name: "text-editor/link",
|
|
506
|
-
onClick:
|
|
483
|
+
onClick: me
|
|
507
484
|
})) : H("", !0),
|
|
508
|
-
f.value.includes("image") ? (m(),
|
|
485
|
+
f.value.includes("image") ? (m(), P(w(A), {
|
|
509
486
|
key: 1,
|
|
510
487
|
class: "cursor-pointer",
|
|
511
488
|
width: "20",
|
|
512
489
|
height: "20",
|
|
513
490
|
name: "text-editor/image",
|
|
514
|
-
onClick:
|
|
491
|
+
onClick: He
|
|
515
492
|
})) : H("", !0),
|
|
516
|
-
f.value.includes("quote") ? (m(),
|
|
493
|
+
f.value.includes("quote") ? (m(), P(w(A), {
|
|
517
494
|
key: 2,
|
|
518
495
|
class: Q(["cursor-pointer", R.value ? "text-oc-text" : "text-oc-text-300"]),
|
|
519
496
|
width: "20",
|
|
520
497
|
height: "20",
|
|
521
498
|
name: "text-editor/quote",
|
|
522
|
-
onClick:
|
|
499
|
+
onClick: Xe
|
|
523
500
|
}, null, 8, ["class"])) : H("", !0),
|
|
524
|
-
f.value.includes("media") ? (m(),
|
|
501
|
+
f.value.includes("media") ? (m(), P(w(A), {
|
|
525
502
|
key: 3,
|
|
526
503
|
class: "cursor-pointer",
|
|
527
504
|
width: "20",
|
|
528
505
|
height: "20",
|
|
529
506
|
name: "text-editor/media",
|
|
530
|
-
onClick:
|
|
507
|
+
onClick: _
|
|
531
508
|
})) : H("", !0),
|
|
532
|
-
|
|
509
|
+
L(w(A), {
|
|
533
510
|
class: "cursor-pointer",
|
|
534
511
|
width: "20",
|
|
535
512
|
height: "20",
|
|
536
513
|
name: "table",
|
|
537
|
-
onClick: o[4] || (o[4] = (
|
|
514
|
+
onClick: o[4] || (o[4] = (x) => K.value = !K.value)
|
|
538
515
|
})
|
|
539
516
|
]),
|
|
540
|
-
f.value.includes("list") ? (m(), E(
|
|
541
|
-
o[19] || (o[19] =
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
class: Q(["cursor-pointer",
|
|
517
|
+
f.value.includes("list") ? (m(), E(ge, { key: 3 }, [
|
|
518
|
+
o[19] || (o[19] = h("div", { class: "border-l border-oc-gray-200" }, null, -1)),
|
|
519
|
+
h("div", Ht, [
|
|
520
|
+
L(w(A), {
|
|
521
|
+
class: Q(["cursor-pointer", ae.value === "bullet" ? "text-oc-text" : "text-oc-text-300"]),
|
|
545
522
|
width: "20",
|
|
546
523
|
height: "20",
|
|
547
524
|
name: "text-editor/bullet",
|
|
548
|
-
onClick: o[5] || (o[5] = (
|
|
525
|
+
onClick: o[5] || (o[5] = (x) => Ve("bullet"))
|
|
549
526
|
}, null, 8, ["class"]),
|
|
550
|
-
|
|
551
|
-
class: Q(["cursor-pointer",
|
|
527
|
+
L(w(A), {
|
|
528
|
+
class: Q(["cursor-pointer", ae.value === "ordered" ? "text-oc-text" : "text-oc-text-300"]),
|
|
552
529
|
width: "20",
|
|
553
530
|
height: "20",
|
|
554
531
|
name: "text-editor/number",
|
|
555
|
-
onClick: o[6] || (o[6] = (
|
|
532
|
+
onClick: o[6] || (o[6] = (x) => Ve("ordered"))
|
|
556
533
|
}, null, 8, ["class"])
|
|
557
534
|
])
|
|
558
535
|
], 64)) : H("", !0),
|
|
559
|
-
f.value.includes("alignment") ? (m(), E(
|
|
560
|
-
o[20] || (o[20] =
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
class: Q(["cursor-pointer",
|
|
536
|
+
f.value.includes("alignment") ? (m(), E(ge, { key: 4 }, [
|
|
537
|
+
o[20] || (o[20] = h("div", { class: "border-l border-oc-gray-200" }, null, -1)),
|
|
538
|
+
h("div", Ot, [
|
|
539
|
+
L(w(A), {
|
|
540
|
+
class: Q(["cursor-pointer", ee.value ? "text-oc-text-300" : "text-oc-text"]),
|
|
564
541
|
width: "20",
|
|
565
542
|
height: "20",
|
|
566
543
|
name: "text-editor/left",
|
|
567
|
-
onClick: o[7] || (o[7] = (
|
|
544
|
+
onClick: o[7] || (o[7] = (x) => he())
|
|
568
545
|
}, null, 8, ["class"]),
|
|
569
|
-
|
|
570
|
-
class: Q(["cursor-pointer",
|
|
546
|
+
L(w(A), {
|
|
547
|
+
class: Q(["cursor-pointer", ee.value === "center" ? "text-oc-text" : "text-oc-text-300"]),
|
|
571
548
|
width: "20",
|
|
572
549
|
height: "20",
|
|
573
550
|
name: "text-editor/center",
|
|
574
|
-
onClick: o[8] || (o[8] = (
|
|
551
|
+
onClick: o[8] || (o[8] = (x) => he("center"))
|
|
575
552
|
}, null, 8, ["class"]),
|
|
576
|
-
|
|
577
|
-
class: Q(["cursor-pointer",
|
|
553
|
+
L(w(A), {
|
|
554
|
+
class: Q(["cursor-pointer", ee.value === "right" ? "text-oc-text" : "text-oc-text-300"]),
|
|
578
555
|
width: "20",
|
|
579
556
|
height: "20",
|
|
580
557
|
name: "text-editor/right",
|
|
581
|
-
onClick: o[9] || (o[9] = (
|
|
558
|
+
onClick: o[9] || (o[9] = (x) => he("right"))
|
|
582
559
|
}, null, 8, ["class"]),
|
|
583
|
-
|
|
584
|
-
class: Q(["cursor-pointer",
|
|
560
|
+
L(w(A), {
|
|
561
|
+
class: Q(["cursor-pointer", ee.value === "justify" ? "text-oc-text" : "text-oc-text-300"]),
|
|
585
562
|
width: "20",
|
|
586
563
|
height: "20",
|
|
587
564
|
name: "text-editor/justify",
|
|
588
|
-
onClick: o[10] || (o[10] = (
|
|
565
|
+
onClick: o[10] || (o[10] = (x) => he("justify"))
|
|
589
566
|
}, null, 8, ["class"])
|
|
590
567
|
])
|
|
591
568
|
], 64)) : H("", !0),
|
|
592
|
-
o[22] || (o[22] =
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
modelValue:
|
|
569
|
+
o[22] || (o[22] = h("div", { class: "border-l border-oc-gray-200" }, null, -1)),
|
|
570
|
+
h("div", Mt, [
|
|
571
|
+
L(w(Vt), {
|
|
572
|
+
modelValue: de.value,
|
|
596
573
|
"onUpdate:modelValue": [
|
|
597
|
-
o[11] || (o[11] = (
|
|
598
|
-
|
|
574
|
+
o[11] || (o[11] = (x) => de.value = x),
|
|
575
|
+
qe
|
|
599
576
|
],
|
|
600
577
|
"hide-input-color": ""
|
|
601
578
|
}, {
|
|
602
|
-
"picker-icon":
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
style:
|
|
579
|
+
"picker-icon": W(() => [
|
|
580
|
+
h("div", Qt, [
|
|
581
|
+
h("div", {
|
|
582
|
+
style: te(`color:${de.value}`)
|
|
606
583
|
}, "A", 4),
|
|
607
|
-
|
|
584
|
+
h("div", {
|
|
608
585
|
class: "h-[5px] w-full rounded border",
|
|
609
|
-
style:
|
|
586
|
+
style: te(`background:${de.value}`)
|
|
610
587
|
}, null, 4)
|
|
611
588
|
])
|
|
612
589
|
]),
|
|
613
590
|
_: 1
|
|
614
591
|
}, 8, ["modelValue"])
|
|
615
592
|
]),
|
|
616
|
-
o[23] || (o[23] =
|
|
617
|
-
|
|
618
|
-
|
|
593
|
+
o[23] || (o[23] = h("div", { class: "border-l border-oc-gray-200" }, null, -1)),
|
|
594
|
+
ce.value ? (m(), E("div", At, [
|
|
595
|
+
L(w(Ae), {
|
|
619
596
|
label: "Image width",
|
|
620
597
|
class: "w-[120px]",
|
|
621
|
-
"model-value":
|
|
598
|
+
"model-value": ye.value,
|
|
622
599
|
"min-limit": 0,
|
|
623
600
|
"max-limit": 100,
|
|
624
|
-
"onUpdate:modelValue":
|
|
601
|
+
"onUpdate:modelValue": Te
|
|
625
602
|
}, null, 8, ["model-value"]),
|
|
626
|
-
|
|
627
|
-
|
|
603
|
+
h("div", Nt, [
|
|
604
|
+
L(w(A), {
|
|
628
605
|
class: "cursor-pointer",
|
|
629
606
|
width: "20",
|
|
630
607
|
height: "20",
|
|
631
608
|
name: "text-editor/left",
|
|
632
|
-
onClick: o[12] || (o[12] = (
|
|
609
|
+
onClick: o[12] || (o[12] = (x) => be())
|
|
633
610
|
}),
|
|
634
|
-
|
|
611
|
+
L(w(A), {
|
|
635
612
|
class: "cursor-pointer",
|
|
636
613
|
width: "20",
|
|
637
614
|
height: "20",
|
|
638
615
|
name: "text-editor/center",
|
|
639
|
-
onClick: o[13] || (o[13] = (
|
|
616
|
+
onClick: o[13] || (o[13] = (x) => be("center"))
|
|
640
617
|
}),
|
|
641
|
-
|
|
618
|
+
L(w(A), {
|
|
642
619
|
class: "cursor-pointer",
|
|
643
620
|
width: "20",
|
|
644
621
|
height: "20",
|
|
645
622
|
name: "text-editor/right",
|
|
646
|
-
onClick: o[14] || (o[14] = (
|
|
623
|
+
onClick: o[14] || (o[14] = (x) => be("right"))
|
|
647
624
|
})
|
|
648
625
|
])
|
|
649
626
|
])) : H("", !0),
|
|
650
|
-
|
|
627
|
+
h("div", Pt, [
|
|
651
628
|
(m(), E("svg", {
|
|
652
629
|
width: "20",
|
|
653
630
|
height: "20",
|
|
654
631
|
viewBox: "0 0 15 15",
|
|
655
632
|
fill: "none",
|
|
656
633
|
xmlns: "http://www.w3.org/2000/svg",
|
|
657
|
-
onClick: o[15] || (o[15] = (
|
|
634
|
+
onClick: o[15] || (o[15] = (x) => Pe())
|
|
658
635
|
}, o[21] || (o[21] = [
|
|
659
|
-
|
|
636
|
+
h("path", {
|
|
660
637
|
"fill-rule": "evenodd",
|
|
661
638
|
"clip-rule": "evenodd",
|
|
662
639
|
d: "M2 7.5C2 7.22386 2.22386 7 2.5 7H12.5C12.7761 7 13 7.22386 13 7.5C13 7.77614 12.7761 8 12.5 8H2.5C2.22386 8 2 7.77614 2 7.5Z",
|
|
@@ -664,10 +641,10 @@ const It = { key: 1 }, Vt = {
|
|
|
664
641
|
}, null, -1)
|
|
665
642
|
])))
|
|
666
643
|
])
|
|
667
|
-
], 8,
|
|
644
|
+
], 8, Tt)
|
|
668
645
|
]),
|
|
669
646
|
_: 1
|
|
670
|
-
}, 8, ["id", "content", "options", "
|
|
647
|
+
}, 8, ["id", "content", "options", "placeholder"])) : H("", !0)
|
|
671
648
|
], 2)
|
|
672
649
|
]),
|
|
673
650
|
_: 1
|
|
@@ -714,22 +691,22 @@ const It = { key: 1 }, Vt = {
|
|
|
714
691
|
}
|
|
715
692
|
u.value = `#${a.toUpperCase()}`, y("update:modelValue", u.value);
|
|
716
693
|
};
|
|
717
|
-
return
|
|
694
|
+
return fe(
|
|
718
695
|
() => r.modelValue,
|
|
719
696
|
(p, a) => {
|
|
720
697
|
p !== a && (u.value = p);
|
|
721
698
|
},
|
|
722
699
|
{ immediate: !0 }
|
|
723
|
-
), (p, a) => (m(),
|
|
700
|
+
), (p, a) => (m(), P(w(we), {
|
|
724
701
|
class: "w-[158px]",
|
|
725
702
|
placeholder: "#FFFFFF",
|
|
726
703
|
"model-value": u.value,
|
|
727
704
|
"onUpdate:modelValue": f,
|
|
728
705
|
onBlur: C,
|
|
729
|
-
onKeyup:
|
|
706
|
+
onKeyup: ot(C, ["enter"])
|
|
730
707
|
}, null, 8, ["model-value"]));
|
|
731
708
|
}
|
|
732
|
-
}, qt = { class: "grid grid-cols-3 gap-3" },
|
|
709
|
+
}, qt = { class: "grid grid-cols-3 gap-3" }, nt = {
|
|
733
710
|
__name: "InputRgbHsl",
|
|
734
711
|
props: {
|
|
735
712
|
inputType: {
|
|
@@ -752,19 +729,19 @@ const It = { key: 1 }, Vt = {
|
|
|
752
729
|
r: 0,
|
|
753
730
|
g: 0,
|
|
754
731
|
b: 0
|
|
755
|
-
}), f = v(), C = v(), p = v(), a = (M,
|
|
756
|
-
var
|
|
732
|
+
}), f = v(), C = v(), p = v(), a = (M, T) => {
|
|
733
|
+
var z, U, N;
|
|
757
734
|
let B = 255;
|
|
758
|
-
if (r.inputType == "HSL" && (B = 100, M == "r" && (B = 360)), !isNaN(parseInt(
|
|
735
|
+
if (r.inputType == "HSL" && (B = 100, M == "r" && (B = 360)), !isNaN(parseInt(T))) {
|
|
759
736
|
if (M == "r") {
|
|
760
|
-
let D = parseInt(
|
|
761
|
-
D <= B && (u.value.r = D, r.inputType == "RGB" ? O("r") :
|
|
737
|
+
let D = parseInt(T);
|
|
738
|
+
D <= B && (u.value.r = D, r.inputType == "RGB" ? O("r") : Z()), (z = f.value) == null || z.focus();
|
|
762
739
|
} else if (M == "g") {
|
|
763
|
-
let D = parseInt(
|
|
764
|
-
D <= B && (u.value.g = D, r.inputType == "RGB" ? O("g") :
|
|
740
|
+
let D = parseInt(T);
|
|
741
|
+
D <= B && (u.value.g = D, r.inputType == "RGB" ? O("g") : Z()), (U = C.value) == null || U.focus();
|
|
765
742
|
} else if (M == "b") {
|
|
766
|
-
let D = parseInt(
|
|
767
|
-
D <= B && (u.value.b = D, r.inputType == "RGB" ? O("b") :
|
|
743
|
+
let D = parseInt(T);
|
|
744
|
+
D <= B && (u.value.b = D, r.inputType == "RGB" ? O("b") : Z()), (N = p.value) == null || N.focus();
|
|
768
745
|
}
|
|
769
746
|
}
|
|
770
747
|
}, O = (M) => {
|
|
@@ -776,20 +753,20 @@ const It = { key: 1 }, Vt = {
|
|
|
776
753
|
b: parseInt(u.value.b)
|
|
777
754
|
}
|
|
778
755
|
});
|
|
779
|
-
},
|
|
756
|
+
}, Z = () => {
|
|
780
757
|
y("update-hsl-value", {
|
|
781
758
|
h: parseInt(u.value.r),
|
|
782
759
|
s: parseInt(u.value.g),
|
|
783
760
|
l: parseInt(u.value.b)
|
|
784
761
|
});
|
|
785
762
|
};
|
|
786
|
-
return r.inputType === "RGB" ?
|
|
763
|
+
return r.inputType === "RGB" ? fe(
|
|
787
764
|
() => r.rgbValue,
|
|
788
|
-
(M,
|
|
789
|
-
M !==
|
|
765
|
+
(M, T) => {
|
|
766
|
+
M !== T && (u.value = M);
|
|
790
767
|
},
|
|
791
768
|
{ immediate: !0, deep: !0 }
|
|
792
|
-
) :
|
|
769
|
+
) : fe(
|
|
793
770
|
() => r.hslValue,
|
|
794
771
|
(M) => {
|
|
795
772
|
u.value = {
|
|
@@ -799,27 +776,27 @@ const It = { key: 1 }, Vt = {
|
|
|
799
776
|
};
|
|
800
777
|
},
|
|
801
778
|
{ immediate: !0, deep: !0 }
|
|
802
|
-
), (M,
|
|
803
|
-
|
|
779
|
+
), (M, T) => (m(), E("div", qt, [
|
|
780
|
+
L(w(we), {
|
|
804
781
|
ref_key: "rInputEl",
|
|
805
782
|
ref: f,
|
|
806
783
|
"model-value": u.value.r,
|
|
807
784
|
placeholder: "100",
|
|
808
|
-
"onUpdate:modelValue":
|
|
785
|
+
"onUpdate:modelValue": T[0] || (T[0] = (B) => a("r", B))
|
|
809
786
|
}, null, 8, ["model-value"]),
|
|
810
|
-
|
|
787
|
+
L(w(we), {
|
|
811
788
|
ref_key: "gInputEl",
|
|
812
789
|
ref: C,
|
|
813
790
|
"model-value": u.value.g,
|
|
814
791
|
placeholder: "100",
|
|
815
|
-
"onUpdate:modelValue":
|
|
792
|
+
"onUpdate:modelValue": T[1] || (T[1] = (B) => a("g", B))
|
|
816
793
|
}, null, 8, ["model-value"]),
|
|
817
|
-
|
|
794
|
+
L(w(we), {
|
|
818
795
|
ref_key: "bInputEl",
|
|
819
796
|
ref: p,
|
|
820
797
|
"model-value": u.value.b,
|
|
821
798
|
placeholder: "100",
|
|
822
|
-
"onUpdate:modelValue":
|
|
799
|
+
"onUpdate:modelValue": T[2] || (T[2] = (B) => a("b", B))
|
|
823
800
|
}, null, 8, ["model-value"])
|
|
824
801
|
]));
|
|
825
802
|
}
|
|
@@ -840,22 +817,22 @@ const It = { key: 1 }, Vt = {
|
|
|
840
817
|
let p = parseInt(u.value);
|
|
841
818
|
p && p <= 100 ? y("update:modelValue", p) : u.value = r.modelValue;
|
|
842
819
|
};
|
|
843
|
-
return
|
|
820
|
+
return fe(
|
|
844
821
|
() => r.modelValue,
|
|
845
822
|
(p, a) => {
|
|
846
823
|
p !== a && (u.value = p);
|
|
847
824
|
},
|
|
848
825
|
{ immediate: !0 }
|
|
849
|
-
), (p, a) => (m(),
|
|
826
|
+
), (p, a) => (m(), P(w(we), {
|
|
850
827
|
class: "w-[75px]",
|
|
851
828
|
placeholder: "100",
|
|
852
829
|
"model-value": u.value,
|
|
853
830
|
"onUpdate:modelValue": f,
|
|
854
831
|
onBlur: C,
|
|
855
|
-
onKeyup:
|
|
832
|
+
onKeyup: ot(C, ["enter"])
|
|
856
833
|
}, {
|
|
857
|
-
leading:
|
|
858
|
-
|
|
834
|
+
leading: W(() => a[0] || (a[0] = [
|
|
835
|
+
ve("%")
|
|
859
836
|
])),
|
|
860
837
|
_: 1
|
|
861
838
|
}, 8, ["model-value"]));
|
|
@@ -870,7 +847,7 @@ const It = { key: 1 }, Vt = {
|
|
|
870
847
|
const y = v(n.modelValue), u = V, f = (C) => {
|
|
871
848
|
y.value = C, u("update:model-value", C);
|
|
872
849
|
};
|
|
873
|
-
return (C, p) => (m(),
|
|
850
|
+
return (C, p) => (m(), P(w(Ze), {
|
|
874
851
|
class: "!w-[80px]",
|
|
875
852
|
"model-value": y.value,
|
|
876
853
|
options: [
|
|
@@ -897,12 +874,12 @@ const It = { key: 1 }, Vt = {
|
|
|
897
874
|
},
|
|
898
875
|
emits: ["update:modelValue", "onInput"],
|
|
899
876
|
setup(n, { emit: V }) {
|
|
900
|
-
const r =
|
|
877
|
+
const r = Re("opacitySlider"), y = V, u = (f) => {
|
|
901
878
|
y("update:modelValue", parseInt(f.target.value)), y("onInput", f);
|
|
902
879
|
};
|
|
903
880
|
return (f, C) => (m(), E("div", Yt, [
|
|
904
|
-
|
|
905
|
-
|
|
881
|
+
h("div", Wt, [
|
|
882
|
+
h("input", {
|
|
906
883
|
ref_key: "opacitySlider",
|
|
907
884
|
ref: r,
|
|
908
885
|
value: n.modelValue,
|
|
@@ -922,38 +899,38 @@ const It = { key: 1 }, Vt = {
|
|
|
922
899
|
},
|
|
923
900
|
emits: ["onAddColor", "onMouseDown", "onDeleteColor"],
|
|
924
901
|
setup(n, { emit: V }) {
|
|
925
|
-
const r =
|
|
926
|
-
|
|
927
|
-
}, C = v("left:0"), p = v(!1), a = (
|
|
928
|
-
u("onMouseDown",
|
|
902
|
+
const r = Re("gradientBar"), y = v(), u = V, f = (T) => {
|
|
903
|
+
T.preventDefault();
|
|
904
|
+
}, C = v("left:0"), p = v(!1), a = (T) => {
|
|
905
|
+
u("onMouseDown", T);
|
|
929
906
|
}, O = () => {
|
|
930
|
-
let
|
|
931
|
-
C.value =
|
|
932
|
-
},
|
|
907
|
+
let T = y.value.querySelector(".select");
|
|
908
|
+
C.value = T == null ? void 0 : T.getAttribute("style");
|
|
909
|
+
}, Z = () => {
|
|
933
910
|
var B;
|
|
934
911
|
O(), (((B = y.value.querySelectorAll(".gradient-handle")) == null ? void 0 : B.length) ?? 2) > 2 ? p.value = !0 : p.value = !1;
|
|
935
|
-
}, M = (
|
|
936
|
-
p.value = !1, u("onAddColor",
|
|
912
|
+
}, M = (T) => {
|
|
913
|
+
p.value = !1, u("onAddColor", T);
|
|
937
914
|
};
|
|
938
|
-
return (
|
|
915
|
+
return (T, B) => (m(), E("div", {
|
|
939
916
|
ref_key: "gradientSlider",
|
|
940
917
|
ref: y,
|
|
941
918
|
class: "relative h-[40px]",
|
|
942
|
-
onClick:
|
|
919
|
+
onClick: Z
|
|
943
920
|
}, [
|
|
944
|
-
|
|
921
|
+
h("button", {
|
|
945
922
|
type: "button",
|
|
946
923
|
class: Q(["absolute top-[-18px] text-oc-accent-3 rounded-[4px] border-2 border-oc-gray-200 p-2 bg-oc-bg-light", p.value ? "" : "!hidden"]),
|
|
947
|
-
style:
|
|
948
|
-
onClick: B[0] || (B[0] = (
|
|
924
|
+
style: te(C.value),
|
|
925
|
+
onClick: B[0] || (B[0] = (z) => T.$emit("onDeleteColor"))
|
|
949
926
|
}, [
|
|
950
|
-
|
|
927
|
+
L(w(A), {
|
|
951
928
|
name: "bin",
|
|
952
929
|
width: "14",
|
|
953
930
|
height: "14"
|
|
954
931
|
})
|
|
955
932
|
], 6),
|
|
956
|
-
|
|
933
|
+
h("div", {
|
|
957
934
|
class: Q(["gradient-bar", {
|
|
958
935
|
"mt-[20px]": n.gradientType === "linear",
|
|
959
936
|
"mt-[12px]": n.gradientType === "radial"
|
|
@@ -961,7 +938,7 @@ const It = { key: 1 }, Vt = {
|
|
|
961
938
|
onMousedown: a,
|
|
962
939
|
onDragstart: f
|
|
963
940
|
}, [
|
|
964
|
-
|
|
941
|
+
h("div", {
|
|
965
942
|
ref_key: "gradientBar",
|
|
966
943
|
ref: r,
|
|
967
944
|
class: "gradient-container",
|
|
@@ -981,7 +958,7 @@ const It = { key: 1 }, Vt = {
|
|
|
981
958
|
r("update:modelValue", parseFloat(u.target.value)), r("onInput", u);
|
|
982
959
|
};
|
|
983
960
|
return (u, f) => (m(), E("div", Zt, [
|
|
984
|
-
|
|
961
|
+
h("input", {
|
|
985
962
|
value: n.modelValue,
|
|
986
963
|
class: "picker-hue-range-slider",
|
|
987
964
|
type: "range",
|
|
@@ -1011,7 +988,7 @@ const It = { key: 1 }, Vt = {
|
|
|
1011
988
|
emits: ["update:angle", "update:percentageX", "update:percentageY", "onInput"],
|
|
1012
989
|
setup(n, { emit: V }) {
|
|
1013
990
|
const r = v(!1), y = v(!1);
|
|
1014
|
-
|
|
991
|
+
Je(() => {
|
|
1015
992
|
r.value = !0, y.value = !0;
|
|
1016
993
|
});
|
|
1017
994
|
const u = V, f = (C, p) => {
|
|
@@ -1029,7 +1006,7 @@ const It = { key: 1 }, Vt = {
|
|
|
1029
1006
|
}
|
|
1030
1007
|
};
|
|
1031
1008
|
return (C, p) => (m(), E("div", el, [
|
|
1032
|
-
n.gradientType == "linear" && r.value ? (m(),
|
|
1009
|
+
n.gradientType == "linear" && r.value ? (m(), P(w(Ae), {
|
|
1033
1010
|
key: 0,
|
|
1034
1011
|
label: "Angle",
|
|
1035
1012
|
"model-value": n.angle,
|
|
@@ -1037,43 +1014,43 @@ const It = { key: 1 }, Vt = {
|
|
|
1037
1014
|
"max-limit": 360,
|
|
1038
1015
|
"onUpdate:modelValue": p[0] || (p[0] = (a) => f(a, "angle"))
|
|
1039
1016
|
}, {
|
|
1040
|
-
"min-limit-label":
|
|
1041
|
-
|
|
1017
|
+
"min-limit-label": W(() => p[3] || (p[3] = [
|
|
1018
|
+
ve("0 ")
|
|
1042
1019
|
])),
|
|
1043
|
-
"max-limit-label":
|
|
1044
|
-
|
|
1045
|
-
|
|
1020
|
+
"max-limit-label": W(() => p[4] || (p[4] = [
|
|
1021
|
+
ve("360"),
|
|
1022
|
+
h("span", null, "°", -1)
|
|
1046
1023
|
])),
|
|
1047
1024
|
_: 1
|
|
1048
1025
|
}, 8, ["model-value"])) : H("", !0),
|
|
1049
1026
|
n.gradientType == "radial" && y.value ? (m(), E("div", tl, [
|
|
1050
|
-
|
|
1027
|
+
L(w(Ae), {
|
|
1051
1028
|
label: "Position X",
|
|
1052
1029
|
"model-value": n.percentageX,
|
|
1053
1030
|
"min-limit": 0,
|
|
1054
1031
|
"max-limit": 100,
|
|
1055
1032
|
"onUpdate:modelValue": p[1] || (p[1] = (a) => f(a, "percentageX"))
|
|
1056
1033
|
}, {
|
|
1057
|
-
"min-limit-label":
|
|
1058
|
-
|
|
1034
|
+
"min-limit-label": W(() => p[5] || (p[5] = [
|
|
1035
|
+
ve("0")
|
|
1059
1036
|
])),
|
|
1060
|
-
"max-limit-label":
|
|
1061
|
-
|
|
1037
|
+
"max-limit-label": W(() => p[6] || (p[6] = [
|
|
1038
|
+
ve("100%")
|
|
1062
1039
|
])),
|
|
1063
1040
|
_: 1
|
|
1064
1041
|
}, 8, ["model-value"]),
|
|
1065
|
-
|
|
1042
|
+
L(w(Ae), {
|
|
1066
1043
|
label: "Position Y",
|
|
1067
1044
|
"model-value": n.percentageY,
|
|
1068
1045
|
"min-limit": 0,
|
|
1069
1046
|
"max-limit": 100,
|
|
1070
1047
|
"onUpdate:modelValue": p[2] || (p[2] = (a) => f(a, "percentageY"))
|
|
1071
1048
|
}, {
|
|
1072
|
-
"min-limit-label":
|
|
1073
|
-
|
|
1049
|
+
"min-limit-label": W(() => p[7] || (p[7] = [
|
|
1050
|
+
ve("0")
|
|
1074
1051
|
])),
|
|
1075
|
-
"max-limit-label":
|
|
1076
|
-
|
|
1052
|
+
"max-limit-label": W(() => p[8] || (p[8] = [
|
|
1053
|
+
ve("100%")
|
|
1077
1054
|
])),
|
|
1078
1055
|
_: 1
|
|
1079
1056
|
}, 8, ["model-value"])
|
|
@@ -1084,7 +1061,7 @@ const It = { key: 1 }, Vt = {
|
|
|
1084
1061
|
__name: "PickerWrap",
|
|
1085
1062
|
emits: ["onMouseDown"],
|
|
1086
1063
|
setup(n) {
|
|
1087
|
-
const V =
|
|
1064
|
+
const V = Re("canvas"), r = Re("pickerWrap"), y = Re("pickerPointer"), u = (f) => {
|
|
1088
1065
|
f.preventDefault();
|
|
1089
1066
|
};
|
|
1090
1067
|
return (f, C) => (m(), E("div", {
|
|
@@ -1094,13 +1071,13 @@ const It = { key: 1 }, Vt = {
|
|
|
1094
1071
|
onMousedown: C[0] || (C[0] = (p) => f.$emit("onMouseDown", p)),
|
|
1095
1072
|
onDragstart: u
|
|
1096
1073
|
}, [
|
|
1097
|
-
|
|
1074
|
+
h("canvas", {
|
|
1098
1075
|
ref_key: "canvas",
|
|
1099
1076
|
ref: V,
|
|
1100
1077
|
class: "colour-area"
|
|
1101
1078
|
}, null, 512),
|
|
1102
|
-
C[1] || (C[1] =
|
|
1103
|
-
|
|
1079
|
+
C[1] || (C[1] = h("div", { class: "colour-area-mask" }, null, -1)),
|
|
1080
|
+
h("div", {
|
|
1104
1081
|
ref_key: "pickerPointer",
|
|
1105
1082
|
ref: y,
|
|
1106
1083
|
class: "colour-area-point-circle"
|
|
@@ -1135,7 +1112,7 @@ const It = { key: 1 }, Vt = {
|
|
|
1135
1112
|
emits: ["onChangeMode"],
|
|
1136
1113
|
setup(n) {
|
|
1137
1114
|
return (V, r) => (m(), E("div", nl, [
|
|
1138
|
-
|
|
1115
|
+
h("button", {
|
|
1139
1116
|
type: "button",
|
|
1140
1117
|
class: Q(n.mode == "solid" ? "active" : ""),
|
|
1141
1118
|
style: { padding: "7px" },
|
|
@@ -1144,25 +1121,25 @@ const It = { key: 1 }, Vt = {
|
|
|
1144
1121
|
n.modelValue && n.mode == "solid" ? (m(), E("div", {
|
|
1145
1122
|
key: 0,
|
|
1146
1123
|
class: "w-[28px] h-[28px] rounded-full border",
|
|
1147
|
-
style:
|
|
1124
|
+
style: te(`background:${n.modelValue}`)
|
|
1148
1125
|
}, null, 4)) : (m(), E("svg", ol, r[3] || (r[3] = [
|
|
1149
|
-
|
|
1150
|
-
|
|
1126
|
+
h("g", { opacity: "0.5" }, [
|
|
1127
|
+
h("path", {
|
|
1151
1128
|
d: "M0 14C0 6.26801 6.26801 0 14 0C21.732 0 28 6.26801 28 14C28 21.732 21.732 28 14 28C6.26801 28 0 21.732 0 14Z",
|
|
1152
1129
|
fill: "#03102F"
|
|
1153
1130
|
})
|
|
1154
1131
|
], -1)
|
|
1155
1132
|
])))
|
|
1156
1133
|
], 2),
|
|
1157
|
-
|
|
1134
|
+
h("button", {
|
|
1158
1135
|
type: "button",
|
|
1159
1136
|
class: Q(n.gradientType == "linear" && n.mode != "solid" ? "active" : ""),
|
|
1160
|
-
style:
|
|
1137
|
+
style: te(`${n.iconClasses.linear ? "" : "padding: 7px;"}`),
|
|
1161
1138
|
onClick: r[1] || (r[1] = (y) => V.$emit("onChangeMode", "linear"))
|
|
1162
1139
|
}, [
|
|
1163
|
-
|
|
1140
|
+
h("div", {
|
|
1164
1141
|
class: "w-[28px] h-[28px] rounded-full border",
|
|
1165
|
-
style:
|
|
1142
|
+
style: te(
|
|
1166
1143
|
n.modelValue && n.gradientType == "linear" && n.mode != "solid" ? `background:${n.modelValue}` : `
|
|
1167
1144
|
background: linear-gradient(
|
|
1168
1145
|
180deg,
|
|
@@ -1173,15 +1150,15 @@ const It = { key: 1 }, Vt = {
|
|
|
1173
1150
|
)
|
|
1174
1151
|
}, null, 4)
|
|
1175
1152
|
], 6),
|
|
1176
|
-
|
|
1153
|
+
h("button", {
|
|
1177
1154
|
type: "button",
|
|
1178
1155
|
class: Q(n.gradientType == "radial" && n.mode != "solid" ? "active" : ""),
|
|
1179
|
-
style:
|
|
1156
|
+
style: te(`${n.iconClasses.radial ? "" : "padding: 6px;"}`),
|
|
1180
1157
|
onClick: r[2] || (r[2] = (y) => V.$emit("onChangeMode", "radial"))
|
|
1181
1158
|
}, [
|
|
1182
|
-
|
|
1159
|
+
h("div", {
|
|
1183
1160
|
class: "w-[28px] h-[28px] rounded-full border",
|
|
1184
|
-
style:
|
|
1161
|
+
style: te(
|
|
1185
1162
|
n.modelValue && n.gradientType == "radial" && n.mode != "solid" ? `background:${n.modelValue}` : "background: radial-gradient(circle at 50% 50%, rgb(255, 255, 255) 0%, rgb(3, 16, 47) 100%);"
|
|
1186
1163
|
)
|
|
1187
1164
|
}, null, 4)
|
|
@@ -1197,10 +1174,10 @@ const It = { key: 1 }, Vt = {
|
|
|
1197
1174
|
}, dl = { key: 2 }, cl = { key: 0 }, pl = { class: "ck-cp-local-color-conatiner" }, gl = ["onClick"], vl = { class: "flex items-center gap-2" }, ml = { id: "ck-cp-target-background" }, fl = { class: "flex gap-3" }, hl = {
|
|
1198
1175
|
key: 0,
|
|
1199
1176
|
class: "w-full flex gap-3"
|
|
1200
|
-
},
|
|
1177
|
+
}, yl = {
|
|
1201
1178
|
key: 4,
|
|
1202
1179
|
class: "ck-cp-local-color-conatiner"
|
|
1203
|
-
},
|
|
1180
|
+
}, bl = ["onClick"], xl = {
|
|
1204
1181
|
__name: "OcColorPickerPopup",
|
|
1205
1182
|
props: {
|
|
1206
1183
|
modelValue: {
|
|
@@ -1243,7 +1220,7 @@ const It = { key: 1 }, Vt = {
|
|
|
1243
1220
|
{ id: 1, r: 68, g: 71, b: 119, a: 100, percent: 0, hue: 0, select: !0 },
|
|
1244
1221
|
{ id: 2, r: 0, g: 0, b: 255, a: 100, percent: 100, hue: 0, select: !1 }
|
|
1245
1222
|
]), O = v(r.lastUsedColors);
|
|
1246
|
-
|
|
1223
|
+
fe(
|
|
1247
1224
|
() => r.lastUsedColors,
|
|
1248
1225
|
() => {
|
|
1249
1226
|
O.value = r.lastUsedColors;
|
|
@@ -1252,52 +1229,52 @@ const It = { key: 1 }, Vt = {
|
|
|
1252
1229
|
deep: !0
|
|
1253
1230
|
}
|
|
1254
1231
|
);
|
|
1255
|
-
const
|
|
1232
|
+
const Z = $e(() => r.variant !== "gradient" ? O.value.filter((t) => !t.includes("linear") && !t.includes("radial")) : O.value), M = v(!1), T = v("linear"), B = _e({
|
|
1256
1233
|
angle: 90,
|
|
1257
1234
|
percentageX: 50,
|
|
1258
1235
|
percentageY: 50
|
|
1259
|
-
}),
|
|
1236
|
+
}), z = v(""), U = v(r.inputType), N = v(!1), D = v(), le = v(), J = v(), j = v(), R = v(), X = _e({
|
|
1260
1237
|
h: 0,
|
|
1261
1238
|
s: 0,
|
|
1262
1239
|
l: 0
|
|
1263
1240
|
});
|
|
1264
|
-
|
|
1265
|
-
let
|
|
1266
|
-
const
|
|
1267
|
-
!
|
|
1268
|
-
},
|
|
1241
|
+
Be("gradientBar", le), Be("canvas", J), Be("pickerWrap", j), Be("pickerPointer", R), Be("opacitySlider", D);
|
|
1242
|
+
let ae = 0, ee = 0, b = 0, Se = 0, ue = 0, ie = 0;
|
|
1243
|
+
const Pe = (t) => {
|
|
1244
|
+
!j.value || !R.value || (ue = j.value.offsetHeight - R.value.offsetHeight, ie = j.value.offsetWidth - R.value.offsetWidth, b = t.clientX - t.target.getBoundingClientRect().left, Se = t.clientY - t.target.getBoundingClientRect().top, ae = b - R.value.offsetWidth / 2, ee = Se - R.value.offsetHeight / 2, R.value.style.left = `${ae}px`, R.value.style.top = `${ee}px`, Ce(!1), G(), window.addEventListener("mousemove", Ee), window.addEventListener("mouseup", Ue));
|
|
1245
|
+
}, Ee = (t) => {
|
|
1269
1246
|
t.preventDefault();
|
|
1270
|
-
const e =
|
|
1271
|
-
l >= 0 && l <=
|
|
1272
|
-
},
|
|
1273
|
-
window.removeEventListener("mousemove",
|
|
1247
|
+
const e = j.value.getBoundingClientRect(), l = t.clientX - e.left - R.value.offsetWidth / 2, i = t.clientY - e.top - R.value.offsetHeight / 2;
|
|
1248
|
+
l >= 0 && l <= ie ? (ae = l, R.value.style.left = `${l}px`) : 0 > l ? (ae = 0, R.value.style.left = "0px") : l > ie && (ae = ie, R.value.style.left = `${ie}px`), i >= 0 && i <= ue ? (ee = i, R.value.style.top = `${i}px`) : 0 > i ? (ee = 0, R.value.style.top = "0px") : i > ue && (ee = ue, R.value.style.top = `${ue}px`), Ce(!1), G();
|
|
1249
|
+
}, Ue = () => {
|
|
1250
|
+
window.removeEventListener("mousemove", Ee), window.removeEventListener("mouseup", Ue);
|
|
1274
1251
|
}, Ce = (t) => {
|
|
1275
1252
|
if (!t) {
|
|
1276
|
-
let e =
|
|
1277
|
-
const l =
|
|
1253
|
+
let e = De();
|
|
1254
|
+
const l = at(ne.value, e.s, e.l);
|
|
1278
1255
|
if (l) {
|
|
1279
1256
|
if (N.value) {
|
|
1280
1257
|
let i = a.value.find((s) => s.select == !0);
|
|
1281
1258
|
i && (i.r = l.r, i.g = l.g, i.b = l.b);
|
|
1282
1259
|
}
|
|
1283
|
-
|
|
1260
|
+
K(), F();
|
|
1284
1261
|
}
|
|
1285
1262
|
}
|
|
1286
|
-
},
|
|
1287
|
-
const { rgb: e } =
|
|
1288
|
-
|
|
1289
|
-
Ce(t),
|
|
1263
|
+
}, ne = v(0), Ie = async (t) => {
|
|
1264
|
+
const { rgb: e } = lt(ne.value, 100, 50);
|
|
1265
|
+
Me(e), setTimeout(() => {
|
|
1266
|
+
Ce(t), G();
|
|
1290
1267
|
}, 0);
|
|
1291
|
-
},
|
|
1292
|
-
let t = { s: 0, l: 0 }, e =
|
|
1268
|
+
}, De = () => {
|
|
1269
|
+
let t = { s: 0, l: 0 }, e = j.value.offsetWidth - R.value.offsetWidth, l = j.value.offsetHeight - R.value.offsetHeight, i = parseInt(R.value.style.left), d = 1 - parseInt(R.value.style.top) / l, k = i / e;
|
|
1293
1270
|
return t.l = d / 2 * (2 - k), t.s = d * k / (1 - Math.abs(2 * t.l - 1)), Number.isNaN(t.s) && (t.s = t.l), t.l = t.l > 1 ? 1 : t.l, t.s = t.s > 1 ? 1 : t.s, t;
|
|
1294
|
-
},
|
|
1271
|
+
}, me = () => {
|
|
1295
1272
|
const t = a.value.find((e) => e.select == !0);
|
|
1296
1273
|
if (t) {
|
|
1297
|
-
const { l: e, s: l } =
|
|
1274
|
+
const { l: e, s: l } = et(t.r, t.g, t.b);
|
|
1298
1275
|
let i = e, s = l;
|
|
1299
1276
|
Number.isNaN(s) && (s = i);
|
|
1300
|
-
let d = { x: 0, y: 0 }, k =
|
|
1277
|
+
let d = { x: 0, y: 0 }, k = j.value.offsetWidth - R.value.offsetWidth, I = j.value.offsetHeight - R.value.offsetHeight;
|
|
1301
1278
|
const [$, g] = 2 * i - 1 < 0 ? [
|
|
1302
1279
|
k * 2 * s / (1 + s),
|
|
1303
1280
|
I * (1 - i * (1 + s))
|
|
@@ -1308,26 +1285,26 @@ const It = { key: 1 }, Vt = {
|
|
|
1308
1285
|
return d.x = $, d.y = g, d;
|
|
1309
1286
|
} else
|
|
1310
1287
|
return null;
|
|
1311
|
-
},
|
|
1288
|
+
}, Xe = () => {
|
|
1312
1289
|
const t = a.value.find((e) => e.select == !0);
|
|
1313
|
-
t && (t.hue =
|
|
1314
|
-
},
|
|
1290
|
+
t && (t.hue = ne.value);
|
|
1291
|
+
}, oe = v(100), He = (t) => {
|
|
1315
1292
|
if (r.showAlpha) {
|
|
1316
1293
|
const e = a.value.find((l) => l.select == !0);
|
|
1317
|
-
e && (e.a = parseInt(t),
|
|
1294
|
+
e && (e.a = parseInt(t), F());
|
|
1318
1295
|
}
|
|
1319
|
-
},
|
|
1296
|
+
}, Oe = (t) => {
|
|
1320
1297
|
var l, i, s, d;
|
|
1321
1298
|
const e = (i = (l = u.value) == null ? void 0 : l.querySelector(".gradient-handle-content")) == null ? void 0 : i.getBoundingClientRect();
|
|
1322
|
-
return t === 0 ? "0px" : t === 100 && e ? `${(((s =
|
|
1299
|
+
return t === 0 ? "0px" : t === 100 && e ? `${(((s = le.value) == null ? void 0 : s.offsetWidth) || 0) - (e.width || 0)}px` : `${(((d = le.value) == null ? void 0 : d.offsetWidth) || 0) * (t / 100) - ((e == null ? void 0 : e.width) || 0) / 2}px`;
|
|
1323
1300
|
};
|
|
1324
|
-
let
|
|
1325
|
-
const
|
|
1301
|
+
let q = null, _ = null;
|
|
1302
|
+
const Ve = (t) => {
|
|
1326
1303
|
var i, s;
|
|
1327
1304
|
const l = t.target.offsetParent;
|
|
1328
1305
|
if ((i = l == null ? void 0 : l.id) != null && i.includes("clr-gb-")) {
|
|
1329
1306
|
const d = l.id.replace("clr-gb-", "");
|
|
1330
|
-
|
|
1307
|
+
_ = l;
|
|
1331
1308
|
const k = a.value.find((I) => I.select == !0);
|
|
1332
1309
|
if (k && k.id != d) {
|
|
1333
1310
|
const I = (s = u.value) == null ? void 0 : s.querySelector(".gradient-handle.select");
|
|
@@ -1336,30 +1313,30 @@ const It = { key: 1 }, Vt = {
|
|
|
1336
1313
|
for (let g = 0; g < a.value.length; g++) {
|
|
1337
1314
|
const S = a.value[g];
|
|
1338
1315
|
if (S.id == d) {
|
|
1339
|
-
$ != -1 && (a.value[$].select = !1), a.value[g].select = !0,
|
|
1316
|
+
$ != -1 && (a.value[$].select = !1), a.value[g].select = !0, oe.value = S.a, ce(S.r, S.g, S.b, S.hue, !0), K(), G();
|
|
1340
1317
|
break;
|
|
1341
1318
|
}
|
|
1342
1319
|
}
|
|
1343
1320
|
}
|
|
1344
|
-
window.addEventListener("mousemove",
|
|
1321
|
+
window.addEventListener("mousemove", de), window.addEventListener("mouseup", he);
|
|
1345
1322
|
}
|
|
1346
|
-
},
|
|
1347
|
-
window.removeEventListener("mousemove",
|
|
1348
|
-
},
|
|
1323
|
+
}, he = () => {
|
|
1324
|
+
window.removeEventListener("mousemove", de), window.removeEventListener("mouseup", Ve);
|
|
1325
|
+
}, de = (t) => {
|
|
1349
1326
|
var d, k;
|
|
1350
1327
|
t.preventDefault();
|
|
1351
|
-
const e = (k = (d = u.value) == null ? void 0 : d.querySelector(".gradient-handle-content")) == null ? void 0 : k.getBoundingClientRect(), l =
|
|
1328
|
+
const e = (k = (d = u.value) == null ? void 0 : d.querySelector(".gradient-handle-content")) == null ? void 0 : k.getBoundingClientRect(), l = q == null ? void 0 : q.getBoundingClientRect(), i = l.width - (e == null ? void 0 : e.width);
|
|
1352
1329
|
let s = t.clientX - (l.left || 0) - ((e == null ? void 0 : e.width) || 0) / 2;
|
|
1353
|
-
if (s < 0 ? s = 0 : s > i && (s = i),
|
|
1354
|
-
|
|
1330
|
+
if (s < 0 ? s = 0 : s > i && (s = i), _) {
|
|
1331
|
+
_.style.left = `${s}px`;
|
|
1355
1332
|
const I = parseFloat((s / ((l == null ? void 0 : l.width) - (e == null ? void 0 : e.width)) * 100).toFixed(0)), $ = a.value.find(
|
|
1356
|
-
(g) => g.id == (
|
|
1333
|
+
(g) => g.id == (_ == null ? void 0 : _.id.replace("clr-gb-", ""))
|
|
1357
1334
|
);
|
|
1358
|
-
$ && ($.percent = I),
|
|
1335
|
+
$ && ($.percent = I), F();
|
|
1359
1336
|
}
|
|
1360
|
-
},
|
|
1337
|
+
}, qe = (t) => {
|
|
1361
1338
|
var I, $;
|
|
1362
|
-
const e =
|
|
1339
|
+
const e = q == null ? void 0 : q.getBoundingClientRect(), l = Math.round((t.clientX - ((e == null ? void 0 : e.left) || 0)) / ((e == null ? void 0 : e.width) || 1) * 100), i = a.value.findIndex((g) => g.select == !0), s = a.value[i], d = {
|
|
1363
1340
|
id: Date.now(),
|
|
1364
1341
|
r: s.r,
|
|
1365
1342
|
g: s.g,
|
|
@@ -1371,14 +1348,14 @@ const It = { key: 1 }, Vt = {
|
|
|
1371
1348
|
};
|
|
1372
1349
|
a.value[i].select = !1;
|
|
1373
1350
|
const k = (I = u.value) == null ? void 0 : I.querySelector(".gradient-handle.select");
|
|
1374
|
-
k == null || k.classList.remove("select"), a.value = [...a.value, d],
|
|
1375
|
-
},
|
|
1351
|
+
k == null || k.classList.remove("select"), a.value = [...a.value, d], be(d), _ = ($ = u.value) == null ? void 0 : $.querySelector(`#clr-gb-${d.id}`), F();
|
|
1352
|
+
}, ye = (t) => {
|
|
1376
1353
|
if (t.r == 0 && t.g == 0 && t.b == 0)
|
|
1377
1354
|
return !0;
|
|
1378
1355
|
if (t.r == 255 && t.g == 255 && t.b == 255)
|
|
1379
1356
|
return !0;
|
|
1380
1357
|
{
|
|
1381
|
-
const e =
|
|
1358
|
+
const e = J.value.getContext("2d", { willReadFrequently: !0 }), l = J.value.width, i = J.value.height, s = e.getImageData(0, 0, l, i).data, d = t.r, k = t.g, I = t.b;
|
|
1382
1359
|
for (let $ = 0; $ < i; $++)
|
|
1383
1360
|
for (let g = 0; g < l; g++) {
|
|
1384
1361
|
const S = ($ * l + g) * 4, re = s[S], dt = s[S + 1], ct = s[S + 2];
|
|
@@ -1387,47 +1364,47 @@ const It = { key: 1 }, Vt = {
|
|
|
1387
1364
|
}
|
|
1388
1365
|
return !1;
|
|
1389
1366
|
}
|
|
1390
|
-
},
|
|
1367
|
+
}, ce = (t, e, l, i, s) => {
|
|
1391
1368
|
setTimeout(() => {
|
|
1392
|
-
if (
|
|
1393
|
-
let d =
|
|
1369
|
+
if (ye({ r: t, g: e, b: l })) {
|
|
1370
|
+
let d = me();
|
|
1394
1371
|
d && (R.value.style.left = `${d.x}px`, R.value.style.top = `${d.y}px`);
|
|
1395
1372
|
} else {
|
|
1396
|
-
let d =
|
|
1397
|
-
d && (R.value.style.left = `${d.x}px`, R.value.style.top = `${d.y}px`),
|
|
1373
|
+
let d = me();
|
|
1374
|
+
d && (R.value.style.left = `${d.x}px`, R.value.style.top = `${d.y}px`), ne.value = i, Ie(s);
|
|
1398
1375
|
}
|
|
1399
1376
|
}, 0);
|
|
1400
|
-
},
|
|
1401
|
-
a.value.forEach((l) =>
|
|
1377
|
+
}, Te = () => {
|
|
1378
|
+
a.value.forEach((l) => be(l)), Le();
|
|
1402
1379
|
const t = a.value[0];
|
|
1403
|
-
|
|
1404
|
-
let e =
|
|
1405
|
-
e && (R.value.style.left = `${e.x}px`, R.value.style.top = `${e.y}px`),
|
|
1406
|
-
},
|
|
1380
|
+
ne.value = t.hue, Ie(!0);
|
|
1381
|
+
let e = me();
|
|
1382
|
+
e && (R.value.style.left = `${e.x}px`, R.value.style.top = `${e.y}px`), K(), F();
|
|
1383
|
+
}, be = (t) => {
|
|
1407
1384
|
if (y.value == "gradient") {
|
|
1408
1385
|
let e = document.createElement("div");
|
|
1409
|
-
e.id = `clr-gb-${t.id}`, e.classList.add("gradient-handle"), e.style.left =
|
|
1386
|
+
e.id = `clr-gb-${t.id}`, e.classList.add("gradient-handle"), e.style.left = Oe(t.percent);
|
|
1410
1387
|
let l = document.createElement("div");
|
|
1411
|
-
l.classList.add("gradient-handle-content"), t.select == !0 && e.classList.add("select"), e.appendChild(l),
|
|
1388
|
+
l.classList.add("gradient-handle-content"), t.select == !0 && e.classList.add("select"), e.appendChild(l), q && q.appendChild(e);
|
|
1412
1389
|
}
|
|
1413
|
-
},
|
|
1414
|
-
const e =
|
|
1390
|
+
}, Me = (t) => {
|
|
1391
|
+
const e = J.value.getContext("2d", { willReadFrequently: !0 }), l = J.value.width, i = J.value.height;
|
|
1415
1392
|
e.fillStyle = `rgb(${t[0]},${t[1]},${t[2]})`, e.fillRect(0, 0, l, i);
|
|
1416
1393
|
let s = e.createLinearGradient(0, 0, l - 12, 0);
|
|
1417
1394
|
s.addColorStop(0, "rgb(255,255,255)"), s.addColorStop(1, "rgba(255,255,255,0)"), e.fillStyle = s, e.fillRect(0, 0, l, i);
|
|
1418
1395
|
let d = e.createLinearGradient(0, 0, 0, i);
|
|
1419
1396
|
d.addColorStop(0, "rgba(0,0,0,0)"), d.addColorStop(1, "rgb(0,0,0)"), e.fillStyle = d, e.fillRect(0, 0, l, i);
|
|
1420
|
-
},
|
|
1397
|
+
}, K = () => {
|
|
1421
1398
|
if (r.showAlpha) {
|
|
1422
1399
|
let t = a.value.find((e) => e.select == !0);
|
|
1423
1400
|
t && (D.value.style.background = ` linear-gradient(90deg,rgba(255, 255, 255, 0) 0%, rgba(${t.r}, ${t.g}, ${t.b}, 100) 97%)`);
|
|
1424
1401
|
}
|
|
1425
|
-
},
|
|
1402
|
+
}, F = () => {
|
|
1426
1403
|
var t;
|
|
1427
1404
|
if (y.value == "gradient") {
|
|
1428
1405
|
a.value.sort((s, d) => s.percent - d.percent);
|
|
1429
1406
|
let e = "linear-gradient(90deg, ", l;
|
|
1430
|
-
if (
|
|
1407
|
+
if (T.value == "linear") {
|
|
1431
1408
|
l = `linear-gradient(${B.angle}deg, `;
|
|
1432
1409
|
for (let s = 0; s < a.value.length; s++) {
|
|
1433
1410
|
const { r: d, g: k, b: I, a: $, percent: g } = a.value[s];
|
|
@@ -1440,7 +1417,7 @@ const It = { key: 1 }, Vt = {
|
|
|
1440
1417
|
a.value.length - 1 == s ? (e = e + `rgba(${d},${k},${I},${$ / 100}) ${g}%)`, l = l + `rgba(${d},${k},${I},${$ / 100}) ${g}%)`) : (e = e + `rgba(${d},${k},${I},${$ / 100}) ${g}%, `, l = l + `rgba(${d},${k},${I},${$ / 100}) ${g}%, `);
|
|
1441
1418
|
}
|
|
1442
1419
|
}
|
|
1443
|
-
|
|
1420
|
+
le.value.style.backgroundImage = e;
|
|
1444
1421
|
let i = (t = u.value) == null ? void 0 : t.querySelector("#ck-cp-target-background");
|
|
1445
1422
|
i && (i.style.backgroundImage = l, N.value && p(i.style.backgroundImage));
|
|
1446
1423
|
} else {
|
|
@@ -1457,17 +1434,17 @@ const It = { key: 1 }, Vt = {
|
|
|
1457
1434
|
d = `rgb(${e},${l},${i})`;
|
|
1458
1435
|
break;
|
|
1459
1436
|
case "HEX":
|
|
1460
|
-
d =
|
|
1437
|
+
d = tt(e, l, i);
|
|
1461
1438
|
break;
|
|
1462
1439
|
}
|
|
1463
1440
|
p(d);
|
|
1464
1441
|
}
|
|
1465
|
-
},
|
|
1442
|
+
}, Le = () => {
|
|
1466
1443
|
a.value.forEach((t) => {
|
|
1467
|
-
t.hue =
|
|
1444
|
+
t.hue = Qe(t.r, t.g, t.b);
|
|
1468
1445
|
});
|
|
1469
|
-
},
|
|
1470
|
-
|
|
1446
|
+
}, Fe = (t) => {
|
|
1447
|
+
T.value = t, F();
|
|
1471
1448
|
}, Ge = () => {
|
|
1472
1449
|
var t, e;
|
|
1473
1450
|
if (a.value.length > 2) {
|
|
@@ -1478,68 +1455,68 @@ const It = { key: 1 }, Vt = {
|
|
|
1478
1455
|
const s = (t = u.value) == null ? void 0 : t.querySelector(`#clr-gb-${i}`);
|
|
1479
1456
|
s == null || s.remove();
|
|
1480
1457
|
const d = a.value[0];
|
|
1481
|
-
d && (d.select = !0,
|
|
1458
|
+
d && (d.select = !0, _ = (e = u.value) == null ? void 0 : e.querySelector(`#clr-gb-${d.id}`), _ == null || _.classList.add("select"), ce(d.r, d.g, d.b, d.hue, !1), G(), F());
|
|
1482
1459
|
}
|
|
1483
1460
|
}
|
|
1484
1461
|
}, Ye = () => {
|
|
1485
1462
|
var l;
|
|
1486
1463
|
const t = (l = u.value) == null ? void 0 : l.querySelector("#cp-btn-eyedropper");
|
|
1487
1464
|
t == null || t.classList.add("active"), new EyeDropper().open().then((i) => {
|
|
1488
|
-
const { sRGBHex: s } = i, d = a.value.find((I) => I.select == !0), k =
|
|
1465
|
+
const { sRGBHex: s } = i, d = a.value.find((I) => I.select == !0), k = ze(s);
|
|
1489
1466
|
if (k) {
|
|
1490
|
-
const I =
|
|
1491
|
-
if (d && (d.hue = I, d.r = k.r, d.g = k.g, d.b = k.b),
|
|
1492
|
-
const $ =
|
|
1467
|
+
const I = Qe(k.r, k.g, k.b);
|
|
1468
|
+
if (d && (d.hue = I, d.r = k.r, d.g = k.g, d.b = k.b), ye(k)) {
|
|
1469
|
+
const $ = me();
|
|
1493
1470
|
$ && (R.value.style.left = `${$.x}px`, R.value.style.top = `${$.y}px`);
|
|
1494
1471
|
} else {
|
|
1495
|
-
|
|
1496
|
-
const { rgb: $ } =
|
|
1497
|
-
|
|
1498
|
-
const g =
|
|
1472
|
+
ne.value = I;
|
|
1473
|
+
const { rgb: $ } = lt(I, 100, 50);
|
|
1474
|
+
Me($);
|
|
1475
|
+
const g = me();
|
|
1499
1476
|
g && (R.value.style.left = `${g.x}px`, R.value.style.top = `${g.y}px`);
|
|
1500
1477
|
}
|
|
1501
|
-
|
|
1478
|
+
G(), K(), F(), t == null || t.classList.remove("active");
|
|
1502
1479
|
}
|
|
1503
1480
|
}).catch(() => {
|
|
1504
1481
|
t == null || t.classList.remove("active");
|
|
1505
1482
|
});
|
|
1506
|
-
},
|
|
1483
|
+
}, c = (t) => {
|
|
1507
1484
|
const { value: e, type: l } = t;
|
|
1508
1485
|
if (l != "a") {
|
|
1509
1486
|
const i = a.value.find((s) => s.select == !0);
|
|
1510
1487
|
if (i) {
|
|
1511
1488
|
i.r = parseInt(e.r), i.g = parseInt(e.g), i.b = parseInt(e.b);
|
|
1512
|
-
const s =
|
|
1513
|
-
i.hue = s,
|
|
1489
|
+
const s = Qe(i.r, i.g, i.b);
|
|
1490
|
+
i.hue = s, ce(i.r, i.g, i.b, i.hue, !0), F(), K();
|
|
1514
1491
|
}
|
|
1515
1492
|
} else
|
|
1516
|
-
|
|
1517
|
-
},
|
|
1518
|
-
|
|
1493
|
+
oe.value = e, F(), K();
|
|
1494
|
+
}, o = (t) => {
|
|
1495
|
+
X.h = t.h, X.s = t.s, X.l = t.l;
|
|
1519
1496
|
const e = a.value.find((l) => l.select == !0);
|
|
1520
|
-
if (e && !Number.isNaN(
|
|
1521
|
-
const { r: l, g: i, b: s } =
|
|
1522
|
-
e.hue =
|
|
1497
|
+
if (e && !Number.isNaN(X.h) && !Number.isNaN(X.s) && !Number.isNaN(X.l)) {
|
|
1498
|
+
const { r: l, g: i, b: s } = at(X.h, X.s / 100, X.l / 100);
|
|
1499
|
+
e.hue = X.h, e.r = l, e.g = i, e.b = s, ce(e.r, e.g, e.b, e.hue, !0), F(), K();
|
|
1523
1500
|
}
|
|
1524
|
-
},
|
|
1525
|
-
if (
|
|
1526
|
-
const t =
|
|
1501
|
+
}, x = () => {
|
|
1502
|
+
if (z.value) {
|
|
1503
|
+
const t = ze(z.value);
|
|
1527
1504
|
if (t) {
|
|
1528
|
-
const e =
|
|
1529
|
-
l && (l.r = t.r, l.g = t.g, l.b = t.b, l.hue = e,
|
|
1505
|
+
const e = Qe(t.r, t.g, t.b), l = a.value.find((i) => i.select == !0);
|
|
1506
|
+
l && (l.r = t.r, l.g = t.g, l.b = t.b, l.hue = e, ce(t.r, t.g, t.b, l.hue, !0), F(), K(), pe(U.value));
|
|
1530
1507
|
}
|
|
1531
1508
|
}
|
|
1532
|
-
},
|
|
1509
|
+
}, G = () => {
|
|
1533
1510
|
const t = a.value.find((e) => e.select == !0);
|
|
1534
|
-
t && (
|
|
1535
|
-
},
|
|
1511
|
+
t && (z.value = tt(t.r, t.g, t.b).toUpperCase()), pe(U.value);
|
|
1512
|
+
}, se = (t) => {
|
|
1536
1513
|
f("last-used-pick", t);
|
|
1537
1514
|
};
|
|
1538
1515
|
window.EyeDropper && (M.value = !0);
|
|
1539
|
-
const
|
|
1516
|
+
const xe = (t = "") => {
|
|
1540
1517
|
if (y.value == "gradient") {
|
|
1541
1518
|
let e = t.includes("linear") ? "linear" : "radial", l = [];
|
|
1542
|
-
if (
|
|
1519
|
+
if (T.value = e, e == "linear") {
|
|
1543
1520
|
let i = /^linear-gradient\((.*)\)$/, s = t.replace(";", "").trim().match(i), d = /,\s*(?![^()]*\))/;
|
|
1544
1521
|
if (s) {
|
|
1545
1522
|
let k = s[1].split(d);
|
|
@@ -1595,7 +1572,7 @@ const It = { key: 1 }, Vt = {
|
|
|
1595
1572
|
}
|
|
1596
1573
|
}
|
|
1597
1574
|
}
|
|
1598
|
-
l.length > 1 && (a.value = l, a.value[0].select = !0,
|
|
1575
|
+
l.length > 1 && (a.value = l, a.value[0].select = !0, oe.value = a.value[0].a);
|
|
1599
1576
|
} else if (t) {
|
|
1600
1577
|
let e = {
|
|
1601
1578
|
r: 0,
|
|
@@ -1607,7 +1584,7 @@ const It = { key: 1 }, Vt = {
|
|
|
1607
1584
|
if (t.length >= 8)
|
|
1608
1585
|
e = $t(t);
|
|
1609
1586
|
else {
|
|
1610
|
-
let l =
|
|
1587
|
+
let l = ze(t);
|
|
1611
1588
|
l ? (e.a = 1, e.r = l.r, e.g = l.g, e.b = l.b) : e = null;
|
|
1612
1589
|
}
|
|
1613
1590
|
else if (t.includes("rgb"))
|
|
@@ -1617,48 +1594,48 @@ const It = { key: 1 }, Vt = {
|
|
|
1617
1594
|
let l = St(t);
|
|
1618
1595
|
l ? (e.a = 1, e.r = l.r, e.g = l.g, e.b = l.b) : e = null;
|
|
1619
1596
|
}
|
|
1620
|
-
e && (a.value[0].r = e.r, a.value[0].b = e.b, a.value[0].g = e.g, a.value[0].a = parseInt((e.a * 100).toFixed(0)),
|
|
1597
|
+
e && (a.value[0].r = e.r, a.value[0].b = e.b, a.value[0].g = e.g, a.value[0].a = parseInt((e.a * 100).toFixed(0)), oe.value = a.value[0].a, a.value[0].hue = 0);
|
|
1621
1598
|
}
|
|
1622
|
-
},
|
|
1599
|
+
}, pe = (t) => {
|
|
1623
1600
|
const e = a.value.find((l) => l.select == !0);
|
|
1624
1601
|
if (e) {
|
|
1625
1602
|
switch (t) {
|
|
1626
1603
|
case "RGB":
|
|
1627
1604
|
break;
|
|
1628
1605
|
case "HSL": {
|
|
1629
|
-
const { h: l, s: i, l: s } =
|
|
1630
|
-
|
|
1606
|
+
const { h: l, s: i, l: s } = et(e.r, e.g, e.b);
|
|
1607
|
+
X.h = Math.round(l), X.s = Math.round(i * 100), X.l = Math.round(s * 100);
|
|
1631
1608
|
break;
|
|
1632
1609
|
}
|
|
1633
1610
|
}
|
|
1634
1611
|
U.value = t;
|
|
1635
1612
|
}
|
|
1636
|
-
},
|
|
1637
|
-
t &&
|
|
1613
|
+
}, ke = (t) => {
|
|
1614
|
+
t && xe(t), Te();
|
|
1638
1615
|
};
|
|
1639
|
-
|
|
1616
|
+
fe(
|
|
1640
1617
|
() => r.modelValue,
|
|
1641
1618
|
(t, e) => {
|
|
1642
1619
|
t !== e && t !== C.value && (a.value.forEach((l) => {
|
|
1643
|
-
const i =
|
|
1620
|
+
const i = q == null ? void 0 : q.querySelector(`#clr-gb-${l.id}`);
|
|
1644
1621
|
i == null || i.remove();
|
|
1645
|
-
}),
|
|
1622
|
+
}), ke(t));
|
|
1646
1623
|
}
|
|
1647
1624
|
);
|
|
1648
|
-
const
|
|
1625
|
+
const ut = (t) => {
|
|
1649
1626
|
a.value.forEach((e) => {
|
|
1650
|
-
const l =
|
|
1627
|
+
const l = q == null ? void 0 : q.querySelector(`#clr-gb-${e.id}`);
|
|
1651
1628
|
l == null || l.remove();
|
|
1652
1629
|
}), t !== "solid" ? (y.value = "gradient", setTimeout(() => {
|
|
1653
1630
|
var e;
|
|
1654
|
-
|
|
1631
|
+
q = (e = u.value) == null ? void 0 : e.querySelector(".gradient-bar"), Fe(t), Te();
|
|
1655
1632
|
}, 200)) : t === "solid" && (y.value = "solid", a.value = a.value.map((e) => (e.select = !1, e)), a.value[0].select = !0, setTimeout(() => {
|
|
1656
|
-
|
|
1633
|
+
ke(r.modelValue);
|
|
1657
1634
|
}, 200));
|
|
1658
1635
|
};
|
|
1659
|
-
return
|
|
1636
|
+
return Je(() => {
|
|
1660
1637
|
var t;
|
|
1661
|
-
y.value = r.modelValue.includes("linear") || r.modelValue.includes("radial") ? "gradient" : "solid", y.value == "gradient" && (
|
|
1638
|
+
y.value = r.modelValue.includes("linear") || r.modelValue.includes("radial") ? "gradient" : "solid", y.value == "gradient" && (q = (t = u.value) == null ? void 0 : t.querySelector(".gradient-bar")), ke(r.modelValue), pe(U.value), ft(() => {
|
|
1662
1639
|
N.value = !0;
|
|
1663
1640
|
});
|
|
1664
1641
|
}), (t, e) => (m(), E("div", {
|
|
@@ -1668,24 +1645,24 @@ const It = { key: 1 }, Vt = {
|
|
|
1668
1645
|
"cp-theme": n.theme
|
|
1669
1646
|
}, [
|
|
1670
1647
|
n.variant == "gradient" ? (m(), E("div", rl, [
|
|
1671
|
-
|
|
1648
|
+
L(il, {
|
|
1672
1649
|
class: "mr-auto",
|
|
1673
1650
|
variant: n.variant,
|
|
1674
1651
|
mode: y.value,
|
|
1675
1652
|
"model-value": n.modelValue,
|
|
1676
1653
|
iconClasses: n.iconClasses,
|
|
1677
|
-
gradientType:
|
|
1678
|
-
onOnChangeMode:
|
|
1654
|
+
gradientType: T.value,
|
|
1655
|
+
onOnChangeMode: ut
|
|
1679
1656
|
}, null, 8, ["variant", "mode", "model-value", "iconClasses", "gradientType"])
|
|
1680
1657
|
])) : H("", !0),
|
|
1681
1658
|
y.value == "gradient" && n.variant == "gradient" ? (m(), E("div", ul, [
|
|
1682
|
-
|
|
1683
|
-
gradientType:
|
|
1684
|
-
onOnAddColor:
|
|
1685
|
-
onOnMouseDown:
|
|
1659
|
+
L(Kt, {
|
|
1660
|
+
gradientType: T.value,
|
|
1661
|
+
onOnAddColor: qe,
|
|
1662
|
+
onOnMouseDown: Ve,
|
|
1686
1663
|
onOnDeleteColor: Ge
|
|
1687
1664
|
}, null, 8, ["gradientType"]),
|
|
1688
|
-
|
|
1665
|
+
L(ll, {
|
|
1689
1666
|
percentageY: B.percentageY,
|
|
1690
1667
|
"onUpdate:percentageY": e[0] || (e[0] = (l) => B.percentageY = l),
|
|
1691
1668
|
angle: B.angle,
|
|
@@ -1694,30 +1671,30 @@ const It = { key: 1 }, Vt = {
|
|
|
1694
1671
|
"onUpdate:percentageX": e[2] || (e[2] = (l) => B.percentageX = l),
|
|
1695
1672
|
inputType: U.value,
|
|
1696
1673
|
mode: y.value,
|
|
1697
|
-
gradientType:
|
|
1698
|
-
onOnInput:
|
|
1674
|
+
gradientType: T.value,
|
|
1675
|
+
onOnInput: F
|
|
1699
1676
|
}, null, 8, ["percentageY", "angle", "percentageX", "inputType", "mode", "gradientType"])
|
|
1700
1677
|
])) : (m(), E("div", dl, [
|
|
1701
1678
|
n.presetColors ? (m(), E("div", cl, [
|
|
1702
|
-
e[10] || (e[10] =
|
|
1703
|
-
|
|
1704
|
-
(m(!0), E(
|
|
1679
|
+
e[10] || (e[10] = h("div", { class: "text-oc-text-400 text-sm my-3 font-medium" }, "Choose color", -1)),
|
|
1680
|
+
h("div", pl, [
|
|
1681
|
+
(m(!0), E(ge, null, Ke(n.presetColors, (l) => (m(), E("div", {
|
|
1705
1682
|
key: `color-${l}`,
|
|
1706
1683
|
class: "ck-cp-color-item !w-[32px] !h-[32px]",
|
|
1707
|
-
style:
|
|
1708
|
-
onClick: (i) =>
|
|
1684
|
+
style: te(`background:${l}`),
|
|
1685
|
+
onClick: (i) => se(l)
|
|
1709
1686
|
}, null, 12, gl))), 128))
|
|
1710
1687
|
])
|
|
1711
1688
|
])) : H("", !0)
|
|
1712
1689
|
])),
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1690
|
+
L(al, { onOnMouseDown: Pe }),
|
|
1691
|
+
h("div", vl, [
|
|
1692
|
+
L(_t, {
|
|
1716
1693
|
class: Q(M.value ? "max-w-[90%]" : ""),
|
|
1717
|
-
modelValue:
|
|
1718
|
-
"onUpdate:modelValue": e[3] || (e[3] = (l) =>
|
|
1694
|
+
modelValue: ne.value,
|
|
1695
|
+
"onUpdate:modelValue": e[3] || (e[3] = (l) => ne.value = l),
|
|
1719
1696
|
onOnInput: e[4] || (e[4] = (l) => Ie(!1)),
|
|
1720
|
-
onOnChange:
|
|
1697
|
+
onOnChange: Xe
|
|
1721
1698
|
}, null, 8, ["class", "modelValue"]),
|
|
1722
1699
|
M.value ? (m(), E("button", {
|
|
1723
1700
|
key: 0,
|
|
@@ -1727,69 +1704,69 @@ const It = { key: 1 }, Vt = {
|
|
|
1727
1704
|
style: { padding: "7px" },
|
|
1728
1705
|
onClick: Ye
|
|
1729
1706
|
}, e[11] || (e[11] = [
|
|
1730
|
-
|
|
1707
|
+
h("svg", {
|
|
1731
1708
|
version: "1.1",
|
|
1732
1709
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1733
1710
|
width: "32",
|
|
1734
1711
|
height: "32",
|
|
1735
1712
|
viewBox: "0 0 32 32"
|
|
1736
1713
|
}, [
|
|
1737
|
-
|
|
1714
|
+
h("path", { d: "M21.35 1.825l-6.344 6.35-0.588-0.588c-0.781-0.781-2.050-0.781-2.831 0s-0.781 2.050 0 2.831l10 10c0.781 0.781 2.050 0.781 2.831 0s0.781-2.050 0-2.831l-0.587-0.587 6.344-6.35c2.438-2.438 2.438-6.388 0-8.819s-6.387-2.438-8.819 0zM3.462 20.206c-0.938 0.938-1.462 2.212-1.462 3.538v2.65l-1.663 2.494c-0.531 0.794-0.425 1.85 0.25 2.525s1.731 0.781 2.525 0.25l2.494-1.663h2.65c1.325 0 2.6-0.525 3.537-1.462l7.544-7.544-2.831-2.831-7.544 7.544c-0.188 0.188-0.444 0.294-0.706 0.294h-2.256v-2.256c0-0.262 0.106-0.519 0.294-0.706l7.544-7.544-2.831-2.831-7.544 7.544z" })
|
|
1738
1715
|
], -1)
|
|
1739
1716
|
]))) : H("", !0)
|
|
1740
1717
|
]),
|
|
1741
|
-
n.showAlpha ? (m(),
|
|
1718
|
+
n.showAlpha ? (m(), P(jt, {
|
|
1742
1719
|
key: 3,
|
|
1743
|
-
modelValue:
|
|
1744
|
-
"onUpdate:modelValue": e[5] || (e[5] = (l) =>
|
|
1745
|
-
onOnInput: e[6] || (e[6] = (l) =>
|
|
1720
|
+
modelValue: oe.value,
|
|
1721
|
+
"onUpdate:modelValue": e[5] || (e[5] = (l) => oe.value = l),
|
|
1722
|
+
onOnInput: e[6] || (e[6] = (l) => He(l.target.value))
|
|
1746
1723
|
}, null, 8, ["modelValue"])) : H("", !0),
|
|
1747
|
-
|
|
1748
|
-
[
|
|
1724
|
+
ht(h("div", ml, null, 512), [
|
|
1725
|
+
[yt, !1]
|
|
1749
1726
|
]),
|
|
1750
|
-
|
|
1751
|
-
|
|
1727
|
+
h("div", fl, [
|
|
1728
|
+
L(Gt, {
|
|
1752
1729
|
"model-value": U.value,
|
|
1753
|
-
"onUpdate:modelValue":
|
|
1730
|
+
"onUpdate:modelValue": pe
|
|
1754
1731
|
}, null, 8, ["model-value"]),
|
|
1755
1732
|
N.value && n.showInputSet ? (m(), E("div", hl, [
|
|
1756
|
-
U.value == "HEX" ? (m(),
|
|
1733
|
+
U.value == "HEX" ? (m(), P(Xt, {
|
|
1757
1734
|
key: 0,
|
|
1758
|
-
modelValue:
|
|
1735
|
+
modelValue: z.value,
|
|
1759
1736
|
"onUpdate:modelValue": [
|
|
1760
|
-
e[7] || (e[7] = (l) =>
|
|
1761
|
-
|
|
1737
|
+
e[7] || (e[7] = (l) => z.value = l),
|
|
1738
|
+
x
|
|
1762
1739
|
]
|
|
1763
1740
|
}, null, 8, ["modelValue"])) : H("", !0),
|
|
1764
|
-
U.value == "RGB" ? (m(),
|
|
1741
|
+
U.value == "RGB" ? (m(), P(nt, {
|
|
1765
1742
|
key: 1,
|
|
1766
1743
|
"rgb-value": a.value.find((l) => l.select == !0),
|
|
1767
|
-
onUpdateRgbValue:
|
|
1744
|
+
onUpdateRgbValue: c
|
|
1768
1745
|
}, null, 8, ["rgb-value"])) : H("", !0),
|
|
1769
|
-
U.value == "HSL" ? (m(),
|
|
1746
|
+
U.value == "HSL" ? (m(), P(nt, {
|
|
1770
1747
|
key: 2,
|
|
1771
1748
|
"input-type": "HSL",
|
|
1772
|
-
"hsl-value":
|
|
1773
|
-
onUpdateHslValue:
|
|
1749
|
+
"hsl-value": X,
|
|
1750
|
+
onUpdateHslValue: o
|
|
1774
1751
|
}, null, 8, ["hsl-value"])) : H("", !0),
|
|
1775
|
-
n.showAlpha ? (m(),
|
|
1752
|
+
n.showAlpha ? (m(), P(Ft, {
|
|
1776
1753
|
key: 3,
|
|
1777
|
-
modelValue:
|
|
1754
|
+
modelValue: oe.value,
|
|
1778
1755
|
"onUpdate:modelValue": [
|
|
1779
|
-
e[8] || (e[8] = (l) =>
|
|
1780
|
-
e[9] || (e[9] = (l) =>
|
|
1756
|
+
e[8] || (e[8] = (l) => oe.value = l),
|
|
1757
|
+
e[9] || (e[9] = (l) => He(l))
|
|
1781
1758
|
]
|
|
1782
1759
|
}, null, 8, ["modelValue"])) : H("", !0)
|
|
1783
1760
|
])) : H("", !0)
|
|
1784
1761
|
]),
|
|
1785
|
-
e[12] || (e[12] =
|
|
1786
|
-
O.value.length > 0 && n.showColorList ? (m(), E("div",
|
|
1787
|
-
(m(!0), E(
|
|
1762
|
+
e[12] || (e[12] = h("div", { class: "text-oc-text-400 text-sm my-3 font-medium font-inter" }, "Last used", -1)),
|
|
1763
|
+
O.value.length > 0 && n.showColorList ? (m(), E("div", yl, [
|
|
1764
|
+
(m(!0), E(ge, null, Ke(Z.value, (l) => (m(), E("div", {
|
|
1788
1765
|
key: `color-${l}`,
|
|
1789
1766
|
class: "ck-cp-color-item !w-[32px] !h-[32px]",
|
|
1790
|
-
style:
|
|
1791
|
-
onClick: (i) =>
|
|
1792
|
-
}, null, 12,
|
|
1767
|
+
style: te(`background:${l}`),
|
|
1768
|
+
onClick: (i) => se(l)
|
|
1769
|
+
}, null, 12, bl))), 128))
|
|
1793
1770
|
])) : H("", !0)
|
|
1794
1771
|
], 10, sl));
|
|
1795
1772
|
}
|
|
@@ -1799,7 +1776,7 @@ const It = { key: 1 }, Vt = {
|
|
|
1799
1776
|
}, Sl = {
|
|
1800
1777
|
key: 0,
|
|
1801
1778
|
class: "text-sm text-oc-text-400"
|
|
1802
|
-
}, El =
|
|
1779
|
+
}, El = {
|
|
1803
1780
|
__name: "OcOnboardingProgressbar",
|
|
1804
1781
|
props: {
|
|
1805
1782
|
title: {
|
|
@@ -1820,7 +1797,7 @@ const It = { key: 1 }, Vt = {
|
|
|
1820
1797
|
}
|
|
1821
1798
|
},
|
|
1822
1799
|
setup(n) {
|
|
1823
|
-
const V = n, r =
|
|
1800
|
+
const V = n, r = $e(() => ({
|
|
1824
1801
|
grid: {
|
|
1825
1802
|
containLabel: !1
|
|
1826
1803
|
},
|
|
@@ -1849,23 +1826,23 @@ const It = { key: 1 }, Vt = {
|
|
|
1849
1826
|
]
|
|
1850
1827
|
}));
|
|
1851
1828
|
return (y, u) => (m(), E("div", kl, [
|
|
1852
|
-
|
|
1829
|
+
L(w(Ct), {
|
|
1853
1830
|
class: "w-[140px] bg-white rounded-full h-[140px]",
|
|
1854
1831
|
"additional-options": r.value,
|
|
1855
1832
|
"tooltip-formatter": () => null,
|
|
1856
1833
|
"tooltip-value-formatter": () => null
|
|
1857
1834
|
}, null, 8, ["additional-options"]),
|
|
1858
|
-
|
|
1859
|
-
n.title ? (m(), E("span", wl,
|
|
1860
|
-
|
|
1861
|
-
n.description ? (m(), E("span", Sl,
|
|
1835
|
+
h("div", $l, [
|
|
1836
|
+
n.title ? (m(), E("span", wl, Ne(n.title), 1)) : H("", !0),
|
|
1837
|
+
je(y.$slots, "description", {}, () => [
|
|
1838
|
+
n.description ? (m(), E("span", Sl, Ne(n.description), 1)) : H("", !0)
|
|
1862
1839
|
])
|
|
1863
1840
|
])
|
|
1864
1841
|
]));
|
|
1865
1842
|
}
|
|
1866
|
-
}
|
|
1867
|
-
() => import("./OcCodeBlock-
|
|
1868
|
-
), Dl =
|
|
1843
|
+
}, Ul = it(
|
|
1844
|
+
() => import("./OcCodeBlock-B_LpoG2V.js")
|
|
1845
|
+
), Dl = it(
|
|
1869
1846
|
() => import("./OcLottieAnimation-BjY3rCjS.js")
|
|
1870
1847
|
);
|
|
1871
1848
|
export {
|