triiiceratops 0.3.4 → 0.5.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/chunks/TriiiceratopsViewer-BardJ3c3.js +22029 -0
- package/dist/index.js +2119 -0
- package/dist/plugin-DqOSV8lm.js +30 -0
- package/dist/plugins/image-manipulation.js +177 -0
- package/dist/src/lib/components/LeftFab.svelte.d.ts +1 -0
- package/dist/src/lib/custom-element-image.d.ts +0 -0
- package/dist/src/lib/index.d.ts +2 -0
- package/dist/src/lib/plugins/image-manipulation/ImageManipulationPanel.svelte.d.ts +1 -0
- package/dist/src/lib/plugins/image-manipulation/ImageManipulationPlugin.svelte.d.ts +19 -0
- package/dist/src/lib/plugins/image-manipulation/filters.d.ts +20 -0
- package/dist/src/lib/plugins/image-manipulation/index.d.ts +3 -0
- package/dist/src/lib/plugins/image-manipulation/types.d.ts +8 -0
- package/dist/src/lib/state/viewer.svelte.d.ts +46 -1
- package/dist/src/lib/types/plugin.d.ts +101 -0
- package/dist/triiiceratops-element-image.js +472 -0
- package/dist/triiiceratops-element.css +1 -1
- package/dist/triiiceratops-element.js +33 -21430
- package/package.json +12 -6
- package/dist/triiiceratops-element.iife.js +0 -95
- package/dist/triiiceratops.js +0 -1722
|
@@ -0,0 +1,472 @@
|
|
|
1
|
+
var M0 = Object.defineProperty;
|
|
2
|
+
var h0 = (e) => {
|
|
3
|
+
throw TypeError(e);
|
|
4
|
+
};
|
|
5
|
+
var I0 = (e, a, t) => a in e ? M0(e, a, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[a] = t;
|
|
6
|
+
var J = (e, a, t) => I0(e, typeof a != "symbol" ? a + "" : a, t), H0 = (e, a, t) => a.has(e) || h0("Cannot " + t);
|
|
7
|
+
var N = (e, a, t) => (H0(e, a, "read from private field"), t ? t.call(e) : a.get(e)), i0 = (e, a, t) => a.has(e) ? h0("Cannot add the same private member more than once") : a instanceof WeakSet ? a.add(e) : a.set(e, t);
|
|
8
|
+
import { p as $, h as V0, i as p, j as A0, k as o, u as P, b as n, l as m, s as f, r as l, d as s, e as a0, m as w0, n as x, o as y, q as Z0, t as d0, v as x0, w as C0, f as y0, X as k0, x as Q, y as F0, z as n0, A as l0, B as g0, C as u0, D as f0, E as L0, c as z0, a as o0, T as S0, g as v0 } from "./chunks/TriiiceratopsViewer-BardJ3c3.js";
|
|
9
|
+
var T0 = p('<path d="M68,102.06V40a12,12,0,0,0-24,0v62.06a36,36,0,0,0,0,67.88V216a12,12,0,0,0,24,0V169.94a36,36,0,0,0,0-67.88ZM56,148a12,12,0,1,1,12-12A12,12,0,0,1,56,148ZM164,88a36.07,36.07,0,0,0-24-33.94V40a12,12,0,0,0-24,0V54.06a36,36,0,0,0,0,67.88V216a12,12,0,0,0,24,0V121.94A36.07,36.07,0,0,0,164,88Zm-36,12a12,12,0,1,1,12-12A12,12,0,0,1,128,100Zm108,68a36.07,36.07,0,0,0-24-33.94V40a12,12,0,0,0-24,0v94.06a36,36,0,0,0,0,67.88V216a12,12,0,0,0,24,0V201.94A36.07,36.07,0,0,0,236,168Zm-36,12a12,12,0,1,1,12-12A12,12,0,0,1,200,180Z"></path>'), O0 = p('<path d="M80,136a24,24,0,1,1-24-24A24,24,0,0,1,80,136Zm48-72a24,24,0,1,0,24,24A24,24,0,0,0,128,64Zm72,80a24,24,0,1,0,24,24A24,24,0,0,0,200,144Z" opacity="0.2"></path><path d="M64,105V40a8,8,0,0,0-16,0v65a32,32,0,0,0,0,62v49a8,8,0,0,0,16,0V167a32,32,0,0,0,0-62Zm-8,47a16,16,0,1,1,16-16A16,16,0,0,1,56,152Zm80-95V40a8,8,0,0,0-16,0V57a32,32,0,0,0,0,62v97a8,8,0,0,0,16,0V119a32,32,0,0,0,0-62Zm-8,47a16,16,0,1,1,16-16A16,16,0,0,1,128,104Zm104,64a32.06,32.06,0,0,0-24-31V40a8,8,0,0,0-16,0v97a32,32,0,0,0,0,62v17a8,8,0,0,0,16,0V199A32.06,32.06,0,0,0,232,168Zm-32,16a16,16,0,1,1,16-16A16,16,0,0,1,200,184Z"></path>', 1), P0 = p('<path d="M84,136a28,28,0,0,1-20,26.83V216a8,8,0,0,1-16,0V162.83a28,28,0,0,1,0-53.66V40a8,8,0,0,1,16,0v69.17A28,28,0,0,1,84,136Zm52-74.83V40a8,8,0,0,0-16,0V61.17a28,28,0,0,0,0,53.66V216a8,8,0,0,0,16,0V114.83a28,28,0,0,0,0-53.66Zm72,80V40a8,8,0,0,0-16,0V141.17a28,28,0,0,0,0,53.66V216a8,8,0,0,0,16,0V194.83a28,28,0,0,0,0-53.66Z"></path>'), R0 = p('<path d="M62,106.6V40a6,6,0,0,0-12,0v66.6a30,30,0,0,0,0,58.8V216a6,6,0,0,0,12,0V165.4a30,30,0,0,0,0-58.8ZM56,154a18,18,0,1,1,18-18A18,18,0,0,1,56,154Zm78-95.4V40a6,6,0,0,0-12,0V58.6a30,30,0,0,0,0,58.8V216a6,6,0,0,0,12,0V117.4a30,30,0,0,0,0-58.8ZM128,106a18,18,0,1,1,18-18A18,18,0,0,1,128,106Zm102,62a30.05,30.05,0,0,0-24-29.4V40a6,6,0,0,0-12,0v98.6a30,30,0,0,0,0,58.8V216a6,6,0,0,0,12,0V197.4A30.05,30.05,0,0,0,230,168Zm-30,18a18,18,0,1,1,18-18A18,18,0,0,1,200,186Z"></path>'), D0 = p('<path d="M64,105V40a8,8,0,0,0-16,0v65a32,32,0,0,0,0,62v49a8,8,0,0,0,16,0V167a32,32,0,0,0,0-62Zm-8,47a16,16,0,1,1,16-16A16,16,0,0,1,56,152Zm80-95V40a8,8,0,0,0-16,0V57a32,32,0,0,0,0,62v97a8,8,0,0,0,16,0V119a32,32,0,0,0,0-62Zm-8,47a16,16,0,1,1,16-16A16,16,0,0,1,128,104Zm104,64a32.06,32.06,0,0,0-24-31V40a8,8,0,0,0-16,0v97a32,32,0,0,0,0,62v17a8,8,0,0,0,16,0V199A32.06,32.06,0,0,0,232,168Zm-32,16a16,16,0,1,1,16-16A16,16,0,0,1,200,184Z"></path>'), E0 = p('<path d="M60,108.29V40a4,4,0,0,0-8,0v68.29a28,28,0,0,0,0,55.42V216a4,4,0,0,0,8,0V163.71a28,28,0,0,0,0-55.42ZM56,156a20,20,0,1,1,20-20A20,20,0,0,1,56,156Zm76-95.71V40a4,4,0,0,0-8,0V60.29a28,28,0,0,0,0,55.42V216a4,4,0,0,0,8,0V115.71a28,28,0,0,0,0-55.42ZM128,108a20,20,0,1,1,20-20A20,20,0,0,1,128,108Zm100,60a28,28,0,0,0-24-27.71V40a4,4,0,0,0-8,0V140.29a28,28,0,0,0,0,55.42V216a4,4,0,0,0,8,0V195.71A28,28,0,0,0,228,168Zm-28,20a20,20,0,1,1,20-20A20,20,0,0,1,200,188Z"></path>'), j0 = p('<svg><!><rect width="256" height="256" fill="none"></rect><!></svg>');
|
|
10
|
+
function B0(e, a) {
|
|
11
|
+
$(a, !0);
|
|
12
|
+
const t = V0();
|
|
13
|
+
let v = w0(a, ["$$slots", "$$events", "$$legacy", "children"]), c = P(() => a.weight ?? t.weight ?? "regular"), k = P(() => a.color ?? t.color ?? "currentColor"), M = P(() => a.size ?? t.size ?? "1em"), F = P(() => a.mirrored ?? t.mirrored ?? !1);
|
|
14
|
+
function _(r) {
|
|
15
|
+
let { weight: i, color: V, size: L, mirrored: z, ...d } = r;
|
|
16
|
+
return d;
|
|
17
|
+
}
|
|
18
|
+
var b = j0();
|
|
19
|
+
A0(
|
|
20
|
+
b,
|
|
21
|
+
(r, i) => ({
|
|
22
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
23
|
+
role: "img",
|
|
24
|
+
width: o(M),
|
|
25
|
+
height: o(M),
|
|
26
|
+
fill: o(k),
|
|
27
|
+
transform: o(F) ? "scale(-1, 1)" : void 0,
|
|
28
|
+
viewBox: "0 0 256 256",
|
|
29
|
+
...r,
|
|
30
|
+
...i
|
|
31
|
+
}),
|
|
32
|
+
[() => _(t), () => _(v)]
|
|
33
|
+
);
|
|
34
|
+
var O = n(b);
|
|
35
|
+
{
|
|
36
|
+
var K = (r) => {
|
|
37
|
+
var i = x(), V = y(i);
|
|
38
|
+
Z0(V, () => a.children), s(r, i);
|
|
39
|
+
};
|
|
40
|
+
m(O, (r) => {
|
|
41
|
+
a.children && r(K);
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
var R = f(O, 2);
|
|
45
|
+
{
|
|
46
|
+
var D = (r) => {
|
|
47
|
+
var i = T0();
|
|
48
|
+
s(r, i);
|
|
49
|
+
}, E = (r) => {
|
|
50
|
+
var i = x(), V = y(i);
|
|
51
|
+
{
|
|
52
|
+
var L = (d) => {
|
|
53
|
+
var I = O0();
|
|
54
|
+
d0(), s(d, I);
|
|
55
|
+
}, z = (d) => {
|
|
56
|
+
var I = x(), j = y(I);
|
|
57
|
+
{
|
|
58
|
+
var B = (g) => {
|
|
59
|
+
var Z = P0();
|
|
60
|
+
s(g, Z);
|
|
61
|
+
}, q = (g) => {
|
|
62
|
+
var Z = x(), G = y(Z);
|
|
63
|
+
{
|
|
64
|
+
var U = (u) => {
|
|
65
|
+
var H = R0();
|
|
66
|
+
s(u, H);
|
|
67
|
+
}, X = (u) => {
|
|
68
|
+
var H = x(), h = y(H);
|
|
69
|
+
{
|
|
70
|
+
var C = (A) => {
|
|
71
|
+
var S = D0();
|
|
72
|
+
s(A, S);
|
|
73
|
+
}, t0 = (A) => {
|
|
74
|
+
var S = x(), e0 = y(S);
|
|
75
|
+
{
|
|
76
|
+
var r0 = (w) => {
|
|
77
|
+
var T = E0();
|
|
78
|
+
s(w, T);
|
|
79
|
+
}, s0 = (w) => {
|
|
80
|
+
var T = x0();
|
|
81
|
+
T.nodeValue = (console.error('Unsupported icon weight. Choose from "thin", "light", "regular", "bold", "fill", or "duotone".'), ""), s(w, T);
|
|
82
|
+
};
|
|
83
|
+
m(
|
|
84
|
+
e0,
|
|
85
|
+
(w) => {
|
|
86
|
+
o(c) === "thin" ? w(r0) : w(s0, !1);
|
|
87
|
+
},
|
|
88
|
+
!0
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
s(A, S);
|
|
92
|
+
};
|
|
93
|
+
m(
|
|
94
|
+
h,
|
|
95
|
+
(A) => {
|
|
96
|
+
o(c) === "regular" ? A(C) : A(t0, !1);
|
|
97
|
+
},
|
|
98
|
+
!0
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
s(u, H);
|
|
102
|
+
};
|
|
103
|
+
m(
|
|
104
|
+
G,
|
|
105
|
+
(u) => {
|
|
106
|
+
o(c) === "light" ? u(U) : u(X, !1);
|
|
107
|
+
},
|
|
108
|
+
!0
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
s(g, Z);
|
|
112
|
+
};
|
|
113
|
+
m(
|
|
114
|
+
j,
|
|
115
|
+
(g) => {
|
|
116
|
+
o(c) === "fill" ? g(B) : g(q, !1);
|
|
117
|
+
},
|
|
118
|
+
!0
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
s(d, I);
|
|
122
|
+
};
|
|
123
|
+
m(
|
|
124
|
+
V,
|
|
125
|
+
(d) => {
|
|
126
|
+
o(c) === "duotone" ? d(L) : d(z, !1);
|
|
127
|
+
},
|
|
128
|
+
!0
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
s(r, i);
|
|
132
|
+
};
|
|
133
|
+
m(R, (r) => {
|
|
134
|
+
o(c) === "bold" ? r(D) : r(E, !1);
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
l(b), s(e, b), a0();
|
|
138
|
+
}
|
|
139
|
+
class U0 {
|
|
140
|
+
constructor() {
|
|
141
|
+
J(this, "context", null);
|
|
142
|
+
}
|
|
143
|
+
onRegister(a) {
|
|
144
|
+
this.context = a;
|
|
145
|
+
}
|
|
146
|
+
onDestroy() {
|
|
147
|
+
this.context = null;
|
|
148
|
+
}
|
|
149
|
+
/** Convenience getter for ViewerState */
|
|
150
|
+
get viewerState() {
|
|
151
|
+
if (!this.context)
|
|
152
|
+
throw new Error(
|
|
153
|
+
`Plugin ${this.id} accessed viewerState before registration`
|
|
154
|
+
);
|
|
155
|
+
return this.context.viewerState;
|
|
156
|
+
}
|
|
157
|
+
/** Convenience getter for OSD viewer */
|
|
158
|
+
get osdViewer() {
|
|
159
|
+
var a;
|
|
160
|
+
return ((a = this.context) == null ? void 0 : a.getOSDViewer()) ?? null;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
function c0(e, a) {
|
|
164
|
+
const t = e.drawer.canvas;
|
|
165
|
+
if (!t) return;
|
|
166
|
+
const v = [];
|
|
167
|
+
a.brightness !== 100 && v.push(`brightness(${a.brightness / 100})`), a.contrast !== 100 && v.push(`contrast(${a.contrast / 100})`), a.saturation !== 100 && v.push(`saturate(${a.saturation / 100})`), a.invert && v.push("invert(1)"), a.grayscale && v.push("grayscale(1)"), t.style.filter = v.length > 0 ? v.join(" ") : "none";
|
|
168
|
+
}
|
|
169
|
+
function _0(e) {
|
|
170
|
+
const a = e.drawer.canvas;
|
|
171
|
+
a && (a.style.filter = "none");
|
|
172
|
+
}
|
|
173
|
+
function m0(e) {
|
|
174
|
+
return e.brightness !== 100 || e.contrast !== 100 || e.saturation !== 100 || e.invert || e.grayscale;
|
|
175
|
+
}
|
|
176
|
+
const p0 = {
|
|
177
|
+
brightness: 100,
|
|
178
|
+
contrast: 100,
|
|
179
|
+
saturation: 100,
|
|
180
|
+
invert: !1,
|
|
181
|
+
grayscale: !1
|
|
182
|
+
};
|
|
183
|
+
var q0 = p('<path d="M228,128a100,100,0,0,1-98.66,100H128a99.39,99.39,0,0,1-68.62-27.29,12,12,0,0,1,16.48-17.45,76,76,0,1,0-1.57-109c-.13.13-.25.25-.39.37L54.89,92H72a12,12,0,0,1,0,24H24a12,12,0,0,1-12-12V56a12,12,0,0,1,24,0V76.72L57.48,57.06A100,100,0,0,1,228,128Z"></path>'), G0 = p('<path d="M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z" opacity="0.2"></path><path d="M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z"></path>', 1), X0 = p('<path d="M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L60.63,81.29l17,17A8,8,0,0,1,72,112H24a8,8,0,0,1-8-8V56A8,8,0,0,1,29.66,50.3L49.31,70,60.25,60A96,96,0,0,1,224,128Z"></path>'), J0 = p('<path d="M222,128a94,94,0,0,1-92.74,94H128a93.43,93.43,0,0,1-64.5-25.65,6,6,0,1,1,8.24-8.72A82,82,0,1,0,70,70l-.19.19L39.44,98H72a6,6,0,0,1,0,12H24a6,6,0,0,1-6-6V56a6,6,0,0,1,12,0V90.34L61.63,61.4A94,94,0,0,1,222,128Z"></path>'), K0 = p('<path d="M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z"></path>'), N0 = p('<path d="M220,128a92,92,0,0,1-90.77,92H128a91.47,91.47,0,0,1-63.13-25.1,4,4,0,1,1,5.5-5.82A84,84,0,1,0,68.6,68.57l-.13.12L34.3,100H72a4,4,0,0,1,0,8H24a4,4,0,0,1-4-4V56a4,4,0,0,1,8,0V94.89l35-32A92,92,0,0,1,220,128Z"></path>'), Q0 = p('<svg><!><rect width="256" height="256" fill="none"></rect><!></svg>');
|
|
184
|
+
function W0(e, a) {
|
|
185
|
+
$(a, !0);
|
|
186
|
+
const t = V0();
|
|
187
|
+
let v = w0(a, ["$$slots", "$$events", "$$legacy", "children"]), c = P(() => a.weight ?? t.weight ?? "regular"), k = P(() => a.color ?? t.color ?? "currentColor"), M = P(() => a.size ?? t.size ?? "1em"), F = P(() => a.mirrored ?? t.mirrored ?? !1);
|
|
188
|
+
function _(r) {
|
|
189
|
+
let { weight: i, color: V, size: L, mirrored: z, ...d } = r;
|
|
190
|
+
return d;
|
|
191
|
+
}
|
|
192
|
+
var b = Q0();
|
|
193
|
+
A0(
|
|
194
|
+
b,
|
|
195
|
+
(r, i) => ({
|
|
196
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
197
|
+
role: "img",
|
|
198
|
+
width: o(M),
|
|
199
|
+
height: o(M),
|
|
200
|
+
fill: o(k),
|
|
201
|
+
transform: o(F) ? "scale(-1, 1)" : void 0,
|
|
202
|
+
viewBox: "0 0 256 256",
|
|
203
|
+
...r,
|
|
204
|
+
...i
|
|
205
|
+
}),
|
|
206
|
+
[() => _(t), () => _(v)]
|
|
207
|
+
);
|
|
208
|
+
var O = n(b);
|
|
209
|
+
{
|
|
210
|
+
var K = (r) => {
|
|
211
|
+
var i = x(), V = y(i);
|
|
212
|
+
Z0(V, () => a.children), s(r, i);
|
|
213
|
+
};
|
|
214
|
+
m(O, (r) => {
|
|
215
|
+
a.children && r(K);
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
var R = f(O, 2);
|
|
219
|
+
{
|
|
220
|
+
var D = (r) => {
|
|
221
|
+
var i = q0();
|
|
222
|
+
s(r, i);
|
|
223
|
+
}, E = (r) => {
|
|
224
|
+
var i = x(), V = y(i);
|
|
225
|
+
{
|
|
226
|
+
var L = (d) => {
|
|
227
|
+
var I = G0();
|
|
228
|
+
d0(), s(d, I);
|
|
229
|
+
}, z = (d) => {
|
|
230
|
+
var I = x(), j = y(I);
|
|
231
|
+
{
|
|
232
|
+
var B = (g) => {
|
|
233
|
+
var Z = X0();
|
|
234
|
+
s(g, Z);
|
|
235
|
+
}, q = (g) => {
|
|
236
|
+
var Z = x(), G = y(Z);
|
|
237
|
+
{
|
|
238
|
+
var U = (u) => {
|
|
239
|
+
var H = J0();
|
|
240
|
+
s(u, H);
|
|
241
|
+
}, X = (u) => {
|
|
242
|
+
var H = x(), h = y(H);
|
|
243
|
+
{
|
|
244
|
+
var C = (A) => {
|
|
245
|
+
var S = K0();
|
|
246
|
+
s(A, S);
|
|
247
|
+
}, t0 = (A) => {
|
|
248
|
+
var S = x(), e0 = y(S);
|
|
249
|
+
{
|
|
250
|
+
var r0 = (w) => {
|
|
251
|
+
var T = N0();
|
|
252
|
+
s(w, T);
|
|
253
|
+
}, s0 = (w) => {
|
|
254
|
+
var T = x0();
|
|
255
|
+
T.nodeValue = (console.error('Unsupported icon weight. Choose from "thin", "light", "regular", "bold", "fill", or "duotone".'), ""), s(w, T);
|
|
256
|
+
};
|
|
257
|
+
m(
|
|
258
|
+
e0,
|
|
259
|
+
(w) => {
|
|
260
|
+
o(c) === "thin" ? w(r0) : w(s0, !1);
|
|
261
|
+
},
|
|
262
|
+
!0
|
|
263
|
+
);
|
|
264
|
+
}
|
|
265
|
+
s(A, S);
|
|
266
|
+
};
|
|
267
|
+
m(
|
|
268
|
+
h,
|
|
269
|
+
(A) => {
|
|
270
|
+
o(c) === "regular" ? A(C) : A(t0, !1);
|
|
271
|
+
},
|
|
272
|
+
!0
|
|
273
|
+
);
|
|
274
|
+
}
|
|
275
|
+
s(u, H);
|
|
276
|
+
};
|
|
277
|
+
m(
|
|
278
|
+
G,
|
|
279
|
+
(u) => {
|
|
280
|
+
o(c) === "light" ? u(U) : u(X, !1);
|
|
281
|
+
},
|
|
282
|
+
!0
|
|
283
|
+
);
|
|
284
|
+
}
|
|
285
|
+
s(g, Z);
|
|
286
|
+
};
|
|
287
|
+
m(
|
|
288
|
+
j,
|
|
289
|
+
(g) => {
|
|
290
|
+
o(c) === "fill" ? g(B) : g(q, !1);
|
|
291
|
+
},
|
|
292
|
+
!0
|
|
293
|
+
);
|
|
294
|
+
}
|
|
295
|
+
s(d, I);
|
|
296
|
+
};
|
|
297
|
+
m(
|
|
298
|
+
V,
|
|
299
|
+
(d) => {
|
|
300
|
+
o(c) === "duotone" ? d(L) : d(z, !1);
|
|
301
|
+
},
|
|
302
|
+
!0
|
|
303
|
+
);
|
|
304
|
+
}
|
|
305
|
+
s(r, i);
|
|
306
|
+
};
|
|
307
|
+
m(R, (r) => {
|
|
308
|
+
o(c) === "bold" ? r(D) : r(E, !1);
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
l(b), s(e, b), a0();
|
|
312
|
+
}
|
|
313
|
+
var Y0 = y0('<div class="w-72 h-full bg-base-200 border-l border-base-300 shadow-xl flex flex-col"><div class="flex items-center justify-between p-4 border-b border-base-300"><h2 class="text-lg font-semibold">Image Adjustments</h2> <button class="btn btn-sm btn-ghost btn-circle" aria-label="Close panel"><!></button></div> <div class="flex-1 overflow-y-auto p-4 space-y-6"><div class="form-control"><label class="label" for="brightness-slider"><span class="label-text">Brightness</span> <span class="label-text-alt"> </span></label> <input id="brightness-slider" type="range" min="0" max="200" class="range range-sm range-primary"/></div> <div class="form-control"><label class="label" for="contrast-slider"><span class="label-text">Contrast</span> <span class="label-text-alt"> </span></label> <input id="contrast-slider" type="range" min="0" max="200" class="range range-sm range-secondary"/></div> <div class="form-control"><label class="label" for="saturation-slider"><span class="label-text">Saturation</span> <span class="label-text-alt"> </span></label> <input id="saturation-slider" type="range" min="0" max="200" class="range range-sm range-accent"/></div> <div class="divider">Effects</div> <div class="form-control"><label class="label cursor-pointer"><span class="label-text">Invert Colors</span> <input type="checkbox" class="toggle toggle-primary"/></label></div> <div class="form-control"><label class="label cursor-pointer"><span class="label-text">Grayscale</span> <input type="checkbox" class="toggle toggle-secondary"/></label></div></div> <div class="p-4 border-t border-base-300"><button class="btn btn-outline btn-block"><!> Reset to Default</button></div></div>');
|
|
314
|
+
function $0(e, a) {
|
|
315
|
+
$(a, !0);
|
|
316
|
+
function t(h, C) {
|
|
317
|
+
a.onFilterChange({ ...a.filters, [h]: C });
|
|
318
|
+
}
|
|
319
|
+
var v = Y0(), c = n(v), k = f(n(c), 2);
|
|
320
|
+
k.__click = function(...h) {
|
|
321
|
+
var C;
|
|
322
|
+
(C = a.onClose) == null || C.apply(this, h);
|
|
323
|
+
};
|
|
324
|
+
var M = n(k);
|
|
325
|
+
k0(M, { size: 20 }), l(k), l(c);
|
|
326
|
+
var F = f(c, 2), _ = n(F), b = n(_), O = f(n(b), 2), K = n(O);
|
|
327
|
+
l(O), l(b);
|
|
328
|
+
var R = f(b, 2);
|
|
329
|
+
Q(R), R.__input = (h) => t("brightness", +h.currentTarget.value), l(_);
|
|
330
|
+
var D = f(_, 2), E = n(D), r = f(n(E), 2), i = n(r);
|
|
331
|
+
l(r), l(E);
|
|
332
|
+
var V = f(E, 2);
|
|
333
|
+
Q(V), V.__input = (h) => t("contrast", +h.currentTarget.value), l(D);
|
|
334
|
+
var L = f(D, 2), z = n(L), d = f(n(z), 2), I = n(d);
|
|
335
|
+
l(d), l(z);
|
|
336
|
+
var j = f(z, 2);
|
|
337
|
+
Q(j), j.__input = (h) => t("saturation", +h.currentTarget.value), l(L);
|
|
338
|
+
var B = f(L, 4), q = n(B), g = f(n(q), 2);
|
|
339
|
+
Q(g), g.__change = (h) => t("invert", h.currentTarget.checked), l(q), l(B);
|
|
340
|
+
var Z = f(B, 2), G = n(Z), U = f(n(G), 2);
|
|
341
|
+
Q(U), U.__change = (h) => t("grayscale", h.currentTarget.checked), l(G), l(Z), l(F);
|
|
342
|
+
var X = f(F, 2), u = n(X);
|
|
343
|
+
u.__click = function(...h) {
|
|
344
|
+
var C;
|
|
345
|
+
(C = a.onReset) == null || C.apply(this, h);
|
|
346
|
+
};
|
|
347
|
+
var H = n(u);
|
|
348
|
+
W0(H, { size: 20 }), d0(), l(u), l(X), l(v), F0(() => {
|
|
349
|
+
n0(K, `${a.filters.brightness ?? ""}%`), l0(R, a.filters.brightness), n0(i, `${a.filters.contrast ?? ""}%`), l0(V, a.filters.contrast), n0(I, `${a.filters.saturation ?? ""}%`), l0(j, a.filters.saturation), g0(g, a.filters.invert), g0(U, a.filters.grayscale);
|
|
350
|
+
}), s(e, v), a0();
|
|
351
|
+
}
|
|
352
|
+
C0(["click", "input", "change"]);
|
|
353
|
+
var W, Y;
|
|
354
|
+
class b0 extends U0 {
|
|
355
|
+
constructor() {
|
|
356
|
+
super(...arguments);
|
|
357
|
+
J(this, "id", "image-manipulation");
|
|
358
|
+
J(this, "name", "Image Manipulation");
|
|
359
|
+
J(this, "version", "1.0.0");
|
|
360
|
+
i0(
|
|
361
|
+
this,
|
|
362
|
+
W,
|
|
363
|
+
// Reactive state using Svelte 5 runes
|
|
364
|
+
u0(!1)
|
|
365
|
+
);
|
|
366
|
+
i0(this, Y, u0(L0({ ...p0 })));
|
|
367
|
+
J(this, "osd", null);
|
|
368
|
+
}
|
|
369
|
+
get _panelOpen() {
|
|
370
|
+
return o(N(this, W));
|
|
371
|
+
}
|
|
372
|
+
set _panelOpen(t) {
|
|
373
|
+
f0(N(this, W), t, !0);
|
|
374
|
+
}
|
|
375
|
+
get _filters() {
|
|
376
|
+
return o(N(this, Y));
|
|
377
|
+
}
|
|
378
|
+
set _filters(t) {
|
|
379
|
+
f0(N(this, Y), t, !0);
|
|
380
|
+
}
|
|
381
|
+
onRegister(t) {
|
|
382
|
+
super.onRegister(t), t.registerMenuButton({
|
|
383
|
+
id: `${this.id}:toggle`,
|
|
384
|
+
icon: B0,
|
|
385
|
+
tooltip: "Image Adjustments",
|
|
386
|
+
onClick: () => this.togglePanel(),
|
|
387
|
+
isActive: () => this._panelOpen,
|
|
388
|
+
activeClass: "btn-secondary",
|
|
389
|
+
order: 50
|
|
390
|
+
}), t.registerPanel({
|
|
391
|
+
id: `${this.id}:panel`,
|
|
392
|
+
component: $0,
|
|
393
|
+
position: "left",
|
|
394
|
+
isVisible: () => this._panelOpen,
|
|
395
|
+
props: {
|
|
396
|
+
filters: this._filters,
|
|
397
|
+
onFilterChange: (v) => this.setFilters(v),
|
|
398
|
+
onReset: () => this.resetFilters(),
|
|
399
|
+
onClose: () => this.togglePanel()
|
|
400
|
+
}
|
|
401
|
+
});
|
|
402
|
+
}
|
|
403
|
+
onViewerReady(t) {
|
|
404
|
+
this.osd = t, m0(this._filters) && c0(t, this._filters), this.osd.addHandler("open", () => {
|
|
405
|
+
this.osd && m0(this._filters) && c0(this.osd, this._filters);
|
|
406
|
+
});
|
|
407
|
+
}
|
|
408
|
+
onDestroy() {
|
|
409
|
+
this.osd && _0(this.osd), this.osd = null, super.onDestroy();
|
|
410
|
+
}
|
|
411
|
+
// Public API
|
|
412
|
+
togglePanel() {
|
|
413
|
+
this._panelOpen = !this._panelOpen;
|
|
414
|
+
}
|
|
415
|
+
setFilters(t) {
|
|
416
|
+
this._filters.brightness = t.brightness, this._filters.contrast = t.contrast, this._filters.saturation = t.saturation, this._filters.invert = t.invert, this._filters.grayscale = t.grayscale, this.osd && c0(this.osd, t);
|
|
417
|
+
}
|
|
418
|
+
resetFilters() {
|
|
419
|
+
Object.assign(this._filters, p0), this.osd && _0(this.osd);
|
|
420
|
+
}
|
|
421
|
+
getFilters() {
|
|
422
|
+
return { ...this._filters };
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
W = new WeakMap(), Y = new WeakMap();
|
|
426
|
+
var aa = y0('<div class="w-full h-full"><!></div>');
|
|
427
|
+
function ta(e, a) {
|
|
428
|
+
$(a, !0);
|
|
429
|
+
let t = o0(a, "manifestId", 7, ""), v = o0(a, "canvasId", 7, ""), c = o0(a, "plugins", 23, () => [new b0()]);
|
|
430
|
+
var k = {
|
|
431
|
+
get manifestId() {
|
|
432
|
+
return t();
|
|
433
|
+
},
|
|
434
|
+
set manifestId(_ = "") {
|
|
435
|
+
t(_), v0();
|
|
436
|
+
},
|
|
437
|
+
get canvasId() {
|
|
438
|
+
return v();
|
|
439
|
+
},
|
|
440
|
+
set canvasId(_ = "") {
|
|
441
|
+
v(_), v0();
|
|
442
|
+
},
|
|
443
|
+
get plugins() {
|
|
444
|
+
return c();
|
|
445
|
+
},
|
|
446
|
+
set plugins(_ = [new b0()]) {
|
|
447
|
+
c(_), v0();
|
|
448
|
+
}
|
|
449
|
+
}, M = aa(), F = n(M);
|
|
450
|
+
return S0(F, {
|
|
451
|
+
get manifestId() {
|
|
452
|
+
return t();
|
|
453
|
+
},
|
|
454
|
+
get canvasId() {
|
|
455
|
+
return v();
|
|
456
|
+
},
|
|
457
|
+
get plugins() {
|
|
458
|
+
return c();
|
|
459
|
+
}
|
|
460
|
+
}), l(M), s(e, M), a0(k);
|
|
461
|
+
}
|
|
462
|
+
customElements.define("triiiceratops-viewer-image", z0(
|
|
463
|
+
ta,
|
|
464
|
+
{
|
|
465
|
+
manifestId: { attribute: "manifest-id", reflect: !0, type: "String" },
|
|
466
|
+
canvasId: { attribute: "canvas-id", reflect: !0, type: "String" },
|
|
467
|
+
plugins: {}
|
|
468
|
+
},
|
|
469
|
+
[],
|
|
470
|
+
[],
|
|
471
|
+
!1
|
|
472
|
+
));
|