triiiceratops 0.5.0 → 0.7.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-BLPYh18n.js +22698 -0
- package/dist/index.js +1766 -1423
- package/dist/plugin-DMqSBxJD.js +400 -0
- package/dist/plugins/image-manipulation.js +51 -47
- package/dist/src/lib/index.d.ts +5 -0
- package/dist/src/lib/paraglide/messages/de.d.ts +51 -0
- package/dist/src/lib/paraglide/messages/en.d.ts +51 -0
- package/dist/src/lib/paraglide/messages.d.ts +153 -0
- package/dist/src/lib/plugins/image-manipulation/filters.d.ts +1 -1
- package/dist/src/lib/state/viewer.svelte.d.ts +48 -1
- package/dist/src/lib/theme/colorUtils.d.ts +36 -0
- package/dist/src/lib/theme/index.d.ts +51 -0
- package/dist/src/lib/theme/themeManager.d.ts +39 -0
- package/dist/src/lib/theme/types.d.ts +73 -0
- package/dist/src/lib/types/config.d.ts +129 -0
- package/dist/triiiceratops-element-image.js +338 -268
- package/dist/triiiceratops-element.js +86 -20
- package/dist/{triiiceratops-element.css → triiiceratops.css} +1 -1
- package/package.json +8 -3
- package/dist/chunks/TriiiceratopsViewer-BardJ3c3.js +0 -22029
- package/dist/plugin-DqOSV8lm.js +0 -30
|
@@ -1,147 +1,147 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
throw TypeError(
|
|
1
|
+
var Ie = Object.defineProperty;
|
|
2
|
+
var he = (a) => {
|
|
3
|
+
throw TypeError(a);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
import { p as
|
|
9
|
-
var
|
|
10
|
-
function
|
|
11
|
-
|
|
12
|
-
const t =
|
|
13
|
-
let
|
|
14
|
-
function
|
|
15
|
-
let { weight:
|
|
16
|
-
return
|
|
5
|
+
var Ce = (a, e, t) => e in a ? Ie(a, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[e] = t;
|
|
6
|
+
var K = (a, e, t) => Ce(a, typeof e != "symbol" ? e + "" : e, t), Me = (a, e, t) => e.has(a) || he("Cannot " + t);
|
|
7
|
+
var W = (a, e, t) => (Me(a, e, "read from private field"), t ? t.call(a) : e.get(a)), le = (a, e, t) => e.has(a) ? he("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(a) : e.set(a, t);
|
|
8
|
+
import { p as te, v as Ve, w as Z, x as we, i as v, y as A, e as f, g as i, k as O, r as c, m as s, n as ae, z as S, b as C, A as ye, B as ue, C as Ae, D as Ze, E as Se, f as xe, X as He, F as Y, G as Te, H as oe, I as ve, J as fe, s as de, j as ge, K as ke, L as Fe, c as Le, a as X, u as Oe, h as ze, T as Ee, l as Pe, d as Re, o as Be, q as De, t as Q } from "./chunks/TriiiceratopsViewer-BLPYh18n.js";
|
|
9
|
+
var je = Z('<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>'), Je = Z('<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), Ue = Z('<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>'), Ne = Z('<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>'), Ge = Z('<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>'), qe = Z('<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>'), Ke = Z('<svg><!><rect width="256" height="256" fill="none"></rect><!></svg>');
|
|
10
|
+
function Xe(a, e) {
|
|
11
|
+
te(e, !0);
|
|
12
|
+
const t = Ve();
|
|
13
|
+
let d = Ae(e, ["$$slots", "$$events", "$$legacy", "children"]), o = O(() => e.weight ?? t.weight ?? "regular"), w = O(() => e.color ?? t.color ?? "currentColor"), b = O(() => e.size ?? t.size ?? "1em"), V = O(() => e.mirrored ?? t.mirrored ?? !1);
|
|
14
|
+
function y(r) {
|
|
15
|
+
let { weight: l, color: m, size: T, mirrored: n, ...g } = r;
|
|
16
|
+
return g;
|
|
17
17
|
}
|
|
18
|
-
var
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
(r,
|
|
18
|
+
var h = Ke();
|
|
19
|
+
we(
|
|
20
|
+
h,
|
|
21
|
+
(r, l) => ({
|
|
22
22
|
xmlns: "http://www.w3.org/2000/svg",
|
|
23
23
|
role: "img",
|
|
24
|
-
width:
|
|
25
|
-
height:
|
|
26
|
-
fill:
|
|
27
|
-
transform:
|
|
24
|
+
width: i(b),
|
|
25
|
+
height: i(b),
|
|
26
|
+
fill: i(w),
|
|
27
|
+
transform: i(V) ? "scale(-1, 1)" : void 0,
|
|
28
28
|
viewBox: "0 0 256 256",
|
|
29
29
|
...r,
|
|
30
|
-
...
|
|
30
|
+
...l
|
|
31
31
|
}),
|
|
32
|
-
[() =>
|
|
32
|
+
[() => y(t), () => y(d)]
|
|
33
33
|
);
|
|
34
|
-
var
|
|
34
|
+
var H = v(h);
|
|
35
35
|
{
|
|
36
|
-
var
|
|
37
|
-
var
|
|
38
|
-
|
|
36
|
+
var D = (r) => {
|
|
37
|
+
var l = S(), m = C(l);
|
|
38
|
+
ye(m, () => e.children), s(r, l);
|
|
39
39
|
};
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
A(H, (r) => {
|
|
41
|
+
e.children && r(D);
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
|
-
var
|
|
44
|
+
var z = f(H, 2);
|
|
45
45
|
{
|
|
46
|
-
var
|
|
47
|
-
var
|
|
48
|
-
s(r,
|
|
49
|
-
},
|
|
50
|
-
var
|
|
46
|
+
var E = (r) => {
|
|
47
|
+
var l = je();
|
|
48
|
+
s(r, l);
|
|
49
|
+
}, P = (r) => {
|
|
50
|
+
var l = S(), m = C(l);
|
|
51
51
|
{
|
|
52
|
-
var
|
|
53
|
-
var
|
|
54
|
-
|
|
55
|
-
},
|
|
56
|
-
var
|
|
52
|
+
var T = (g) => {
|
|
53
|
+
var k = Je();
|
|
54
|
+
ue(), s(g, k);
|
|
55
|
+
}, n = (g) => {
|
|
56
|
+
var k = S(), j = C(k);
|
|
57
57
|
{
|
|
58
|
-
var
|
|
59
|
-
var
|
|
60
|
-
s(
|
|
61
|
-
},
|
|
62
|
-
var
|
|
58
|
+
var J = (_) => {
|
|
59
|
+
var M = Ue();
|
|
60
|
+
s(_, M);
|
|
61
|
+
}, N = (_) => {
|
|
62
|
+
var M = S(), G = C(M);
|
|
63
63
|
{
|
|
64
|
-
var U = (
|
|
65
|
-
var
|
|
66
|
-
s(
|
|
67
|
-
},
|
|
68
|
-
var
|
|
64
|
+
var U = (p) => {
|
|
65
|
+
var F = Ne();
|
|
66
|
+
s(p, F);
|
|
67
|
+
}, q = (p) => {
|
|
68
|
+
var F = S(), u = C(F);
|
|
69
69
|
{
|
|
70
|
-
var
|
|
71
|
-
var
|
|
72
|
-
s(
|
|
73
|
-
},
|
|
74
|
-
var
|
|
70
|
+
var L = (x) => {
|
|
71
|
+
var R = Ge();
|
|
72
|
+
s(x, R);
|
|
73
|
+
}, re = (x) => {
|
|
74
|
+
var R = S(), se = C(R);
|
|
75
75
|
{
|
|
76
|
-
var
|
|
77
|
-
var
|
|
78
|
-
s(
|
|
79
|
-
},
|
|
80
|
-
var
|
|
81
|
-
|
|
76
|
+
var ne = (I) => {
|
|
77
|
+
var B = qe();
|
|
78
|
+
s(I, B);
|
|
79
|
+
}, ie = (I) => {
|
|
80
|
+
var B = Ze();
|
|
81
|
+
B.nodeValue = (console.error('Unsupported icon weight. Choose from "thin", "light", "regular", "bold", "fill", or "duotone".'), ""), s(I, B);
|
|
82
82
|
};
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
(
|
|
86
|
-
o
|
|
83
|
+
A(
|
|
84
|
+
se,
|
|
85
|
+
(I) => {
|
|
86
|
+
i(o) === "thin" ? I(ne) : I(ie, !1);
|
|
87
87
|
},
|
|
88
88
|
!0
|
|
89
89
|
);
|
|
90
90
|
}
|
|
91
|
-
s(
|
|
91
|
+
s(x, R);
|
|
92
92
|
};
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
(
|
|
96
|
-
o
|
|
93
|
+
A(
|
|
94
|
+
u,
|
|
95
|
+
(x) => {
|
|
96
|
+
i(o) === "regular" ? x(L) : x(re, !1);
|
|
97
97
|
},
|
|
98
98
|
!0
|
|
99
99
|
);
|
|
100
100
|
}
|
|
101
|
-
s(
|
|
101
|
+
s(p, F);
|
|
102
102
|
};
|
|
103
|
-
|
|
103
|
+
A(
|
|
104
104
|
G,
|
|
105
|
-
(
|
|
106
|
-
o
|
|
105
|
+
(p) => {
|
|
106
|
+
i(o) === "light" ? p(U) : p(q, !1);
|
|
107
107
|
},
|
|
108
108
|
!0
|
|
109
109
|
);
|
|
110
110
|
}
|
|
111
|
-
s(
|
|
111
|
+
s(_, M);
|
|
112
112
|
};
|
|
113
|
-
|
|
113
|
+
A(
|
|
114
114
|
j,
|
|
115
|
-
(
|
|
116
|
-
o
|
|
115
|
+
(_) => {
|
|
116
|
+
i(o) === "fill" ? _(J) : _(N, !1);
|
|
117
117
|
},
|
|
118
118
|
!0
|
|
119
119
|
);
|
|
120
120
|
}
|
|
121
|
-
s(
|
|
121
|
+
s(g, k);
|
|
122
122
|
};
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
(
|
|
126
|
-
o
|
|
123
|
+
A(
|
|
124
|
+
m,
|
|
125
|
+
(g) => {
|
|
126
|
+
i(o) === "duotone" ? g(T) : g(n, !1);
|
|
127
127
|
},
|
|
128
128
|
!0
|
|
129
129
|
);
|
|
130
130
|
}
|
|
131
|
-
s(r,
|
|
131
|
+
s(r, l);
|
|
132
132
|
};
|
|
133
|
-
|
|
134
|
-
o
|
|
133
|
+
A(z, (r) => {
|
|
134
|
+
i(o) === "bold" ? r(E) : r(P, !1);
|
|
135
135
|
});
|
|
136
136
|
}
|
|
137
|
-
|
|
137
|
+
c(h), s(a, h), ae();
|
|
138
138
|
}
|
|
139
|
-
class
|
|
139
|
+
class Qe {
|
|
140
140
|
constructor() {
|
|
141
|
-
|
|
141
|
+
K(this, "context", null);
|
|
142
142
|
}
|
|
143
|
-
onRegister(
|
|
144
|
-
this.context =
|
|
143
|
+
onRegister(e) {
|
|
144
|
+
this.context = e;
|
|
145
145
|
}
|
|
146
146
|
onDestroy() {
|
|
147
147
|
this.context = null;
|
|
@@ -156,317 +156,387 @@ class U0 {
|
|
|
156
156
|
}
|
|
157
157
|
/** Convenience getter for OSD viewer */
|
|
158
158
|
get osdViewer() {
|
|
159
|
-
var
|
|
160
|
-
return ((
|
|
159
|
+
var e;
|
|
160
|
+
return ((e = this.context) == null ? void 0 : e.getOSDViewer()) ?? null;
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
|
-
function
|
|
164
|
-
|
|
163
|
+
function ce(a, e) {
|
|
164
|
+
var o;
|
|
165
|
+
const t = (o = a.drawer) == null ? void 0 : o.canvas;
|
|
165
166
|
if (!t) return;
|
|
166
|
-
const
|
|
167
|
-
|
|
167
|
+
const d = [];
|
|
168
|
+
e.brightness !== 100 && d.push(`brightness(${e.brightness / 100})`), e.contrast !== 100 && d.push(`contrast(${e.contrast / 100})`), e.saturation !== 100 && d.push(`saturate(${e.saturation / 100})`), e.invert && d.push("invert(1)"), e.grayscale && d.push("grayscale(1)"), t.style.filter = d.length > 0 ? d.join(" ") : "none";
|
|
168
169
|
}
|
|
169
|
-
function
|
|
170
|
-
|
|
171
|
-
|
|
170
|
+
function me(a) {
|
|
171
|
+
var t;
|
|
172
|
+
const e = (t = a.drawer) == null ? void 0 : t.canvas;
|
|
173
|
+
e && (e.style.filter = "none");
|
|
172
174
|
}
|
|
173
|
-
function
|
|
174
|
-
return
|
|
175
|
+
function _e(a) {
|
|
176
|
+
return a.brightness !== 100 || a.contrast !== 100 || a.saturation !== 100 || a.invert || a.grayscale;
|
|
175
177
|
}
|
|
176
|
-
const
|
|
178
|
+
const pe = {
|
|
177
179
|
brightness: 100,
|
|
178
180
|
contrast: 100,
|
|
179
181
|
saturation: 100,
|
|
180
182
|
invert: !1,
|
|
181
183
|
grayscale: !1
|
|
182
184
|
};
|
|
183
|
-
var
|
|
184
|
-
function
|
|
185
|
-
|
|
186
|
-
const t =
|
|
187
|
-
let
|
|
188
|
-
function
|
|
189
|
-
let { weight:
|
|
190
|
-
return
|
|
185
|
+
var We = Z('<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>'), Ye = Z('<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), $e = Z('<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>'), e0 = Z('<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>'), t0 = Z('<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>'), a0 = Z('<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>'), r0 = Z('<svg><!><rect width="256" height="256" fill="none"></rect><!></svg>');
|
|
186
|
+
function s0(a, e) {
|
|
187
|
+
te(e, !0);
|
|
188
|
+
const t = Ve();
|
|
189
|
+
let d = Ae(e, ["$$slots", "$$events", "$$legacy", "children"]), o = O(() => e.weight ?? t.weight ?? "regular"), w = O(() => e.color ?? t.color ?? "currentColor"), b = O(() => e.size ?? t.size ?? "1em"), V = O(() => e.mirrored ?? t.mirrored ?? !1);
|
|
190
|
+
function y(r) {
|
|
191
|
+
let { weight: l, color: m, size: T, mirrored: n, ...g } = r;
|
|
192
|
+
return g;
|
|
191
193
|
}
|
|
192
|
-
var
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
(r,
|
|
194
|
+
var h = r0();
|
|
195
|
+
we(
|
|
196
|
+
h,
|
|
197
|
+
(r, l) => ({
|
|
196
198
|
xmlns: "http://www.w3.org/2000/svg",
|
|
197
199
|
role: "img",
|
|
198
|
-
width:
|
|
199
|
-
height:
|
|
200
|
-
fill:
|
|
201
|
-
transform:
|
|
200
|
+
width: i(b),
|
|
201
|
+
height: i(b),
|
|
202
|
+
fill: i(w),
|
|
203
|
+
transform: i(V) ? "scale(-1, 1)" : void 0,
|
|
202
204
|
viewBox: "0 0 256 256",
|
|
203
205
|
...r,
|
|
204
|
-
...
|
|
206
|
+
...l
|
|
205
207
|
}),
|
|
206
|
-
[() =>
|
|
208
|
+
[() => y(t), () => y(d)]
|
|
207
209
|
);
|
|
208
|
-
var
|
|
210
|
+
var H = v(h);
|
|
209
211
|
{
|
|
210
|
-
var
|
|
211
|
-
var
|
|
212
|
-
|
|
212
|
+
var D = (r) => {
|
|
213
|
+
var l = S(), m = C(l);
|
|
214
|
+
ye(m, () => e.children), s(r, l);
|
|
213
215
|
};
|
|
214
|
-
|
|
215
|
-
|
|
216
|
+
A(H, (r) => {
|
|
217
|
+
e.children && r(D);
|
|
216
218
|
});
|
|
217
219
|
}
|
|
218
|
-
var
|
|
220
|
+
var z = f(H, 2);
|
|
219
221
|
{
|
|
220
|
-
var
|
|
221
|
-
var
|
|
222
|
-
s(r,
|
|
223
|
-
},
|
|
224
|
-
var
|
|
222
|
+
var E = (r) => {
|
|
223
|
+
var l = We();
|
|
224
|
+
s(r, l);
|
|
225
|
+
}, P = (r) => {
|
|
226
|
+
var l = S(), m = C(l);
|
|
225
227
|
{
|
|
226
|
-
var
|
|
227
|
-
var
|
|
228
|
-
|
|
229
|
-
},
|
|
230
|
-
var
|
|
228
|
+
var T = (g) => {
|
|
229
|
+
var k = Ye();
|
|
230
|
+
ue(), s(g, k);
|
|
231
|
+
}, n = (g) => {
|
|
232
|
+
var k = S(), j = C(k);
|
|
231
233
|
{
|
|
232
|
-
var
|
|
233
|
-
var
|
|
234
|
-
s(
|
|
235
|
-
},
|
|
236
|
-
var
|
|
234
|
+
var J = (_) => {
|
|
235
|
+
var M = $e();
|
|
236
|
+
s(_, M);
|
|
237
|
+
}, N = (_) => {
|
|
238
|
+
var M = S(), G = C(M);
|
|
237
239
|
{
|
|
238
|
-
var U = (
|
|
239
|
-
var
|
|
240
|
-
s(
|
|
241
|
-
},
|
|
242
|
-
var
|
|
240
|
+
var U = (p) => {
|
|
241
|
+
var F = e0();
|
|
242
|
+
s(p, F);
|
|
243
|
+
}, q = (p) => {
|
|
244
|
+
var F = S(), u = C(F);
|
|
243
245
|
{
|
|
244
|
-
var
|
|
245
|
-
var
|
|
246
|
-
s(
|
|
247
|
-
},
|
|
248
|
-
var
|
|
246
|
+
var L = (x) => {
|
|
247
|
+
var R = t0();
|
|
248
|
+
s(x, R);
|
|
249
|
+
}, re = (x) => {
|
|
250
|
+
var R = S(), se = C(R);
|
|
249
251
|
{
|
|
250
|
-
var
|
|
251
|
-
var
|
|
252
|
-
s(
|
|
253
|
-
},
|
|
254
|
-
var
|
|
255
|
-
|
|
252
|
+
var ne = (I) => {
|
|
253
|
+
var B = a0();
|
|
254
|
+
s(I, B);
|
|
255
|
+
}, ie = (I) => {
|
|
256
|
+
var B = Ze();
|
|
257
|
+
B.nodeValue = (console.error('Unsupported icon weight. Choose from "thin", "light", "regular", "bold", "fill", or "duotone".'), ""), s(I, B);
|
|
256
258
|
};
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
(
|
|
260
|
-
o
|
|
259
|
+
A(
|
|
260
|
+
se,
|
|
261
|
+
(I) => {
|
|
262
|
+
i(o) === "thin" ? I(ne) : I(ie, !1);
|
|
261
263
|
},
|
|
262
264
|
!0
|
|
263
265
|
);
|
|
264
266
|
}
|
|
265
|
-
s(
|
|
267
|
+
s(x, R);
|
|
266
268
|
};
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
(
|
|
270
|
-
o
|
|
269
|
+
A(
|
|
270
|
+
u,
|
|
271
|
+
(x) => {
|
|
272
|
+
i(o) === "regular" ? x(L) : x(re, !1);
|
|
271
273
|
},
|
|
272
274
|
!0
|
|
273
275
|
);
|
|
274
276
|
}
|
|
275
|
-
s(
|
|
277
|
+
s(p, F);
|
|
276
278
|
};
|
|
277
|
-
|
|
279
|
+
A(
|
|
278
280
|
G,
|
|
279
|
-
(
|
|
280
|
-
o
|
|
281
|
+
(p) => {
|
|
282
|
+
i(o) === "light" ? p(U) : p(q, !1);
|
|
281
283
|
},
|
|
282
284
|
!0
|
|
283
285
|
);
|
|
284
286
|
}
|
|
285
|
-
s(
|
|
287
|
+
s(_, M);
|
|
286
288
|
};
|
|
287
|
-
|
|
289
|
+
A(
|
|
288
290
|
j,
|
|
289
|
-
(
|
|
290
|
-
o
|
|
291
|
+
(_) => {
|
|
292
|
+
i(o) === "fill" ? _(J) : _(N, !1);
|
|
291
293
|
},
|
|
292
294
|
!0
|
|
293
295
|
);
|
|
294
296
|
}
|
|
295
|
-
s(
|
|
297
|
+
s(g, k);
|
|
296
298
|
};
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
(
|
|
300
|
-
o
|
|
299
|
+
A(
|
|
300
|
+
m,
|
|
301
|
+
(g) => {
|
|
302
|
+
i(o) === "duotone" ? g(T) : g(n, !1);
|
|
301
303
|
},
|
|
302
304
|
!0
|
|
303
305
|
);
|
|
304
306
|
}
|
|
305
|
-
s(r,
|
|
307
|
+
s(r, l);
|
|
306
308
|
};
|
|
307
|
-
|
|
308
|
-
o
|
|
309
|
+
A(z, (r) => {
|
|
310
|
+
i(o) === "bold" ? r(E) : r(P, !1);
|
|
309
311
|
});
|
|
310
312
|
}
|
|
311
|
-
|
|
313
|
+
c(h), s(a, h), ae();
|
|
312
314
|
}
|
|
313
|
-
var
|
|
314
|
-
function
|
|
315
|
-
|
|
316
|
-
function t(
|
|
317
|
-
|
|
315
|
+
var n0 = xe('<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>');
|
|
316
|
+
function i0(a, e) {
|
|
317
|
+
te(e, !0);
|
|
318
|
+
function t(u, L) {
|
|
319
|
+
e.onFilterChange({ ...e.filters, [u]: L });
|
|
318
320
|
}
|
|
319
|
-
var
|
|
320
|
-
|
|
321
|
-
var
|
|
322
|
-
(
|
|
321
|
+
var d = n0(), o = v(d), w = f(v(o), 2);
|
|
322
|
+
w.__click = function(...u) {
|
|
323
|
+
var L;
|
|
324
|
+
(L = e.onClose) == null || L.apply(this, u);
|
|
323
325
|
};
|
|
324
|
-
var
|
|
325
|
-
|
|
326
|
-
var
|
|
327
|
-
|
|
328
|
-
var
|
|
329
|
-
|
|
330
|
-
var
|
|
331
|
-
|
|
332
|
-
var
|
|
333
|
-
|
|
334
|
-
var
|
|
335
|
-
|
|
336
|
-
var j = f(
|
|
337
|
-
|
|
338
|
-
var
|
|
339
|
-
|
|
340
|
-
var
|
|
341
|
-
|
|
342
|
-
var
|
|
343
|
-
|
|
344
|
-
var
|
|
345
|
-
(
|
|
326
|
+
var b = v(w);
|
|
327
|
+
He(b, { size: 20 }), c(w), c(o);
|
|
328
|
+
var V = f(o, 2), y = v(V), h = v(y), H = f(v(h), 2), D = v(H);
|
|
329
|
+
c(H), c(h);
|
|
330
|
+
var z = f(h, 2);
|
|
331
|
+
Y(z), z.__input = (u) => t("brightness", +u.currentTarget.value), c(y);
|
|
332
|
+
var E = f(y, 2), P = v(E), r = f(v(P), 2), l = v(r);
|
|
333
|
+
c(r), c(P);
|
|
334
|
+
var m = f(P, 2);
|
|
335
|
+
Y(m), m.__input = (u) => t("contrast", +u.currentTarget.value), c(E);
|
|
336
|
+
var T = f(E, 2), n = v(T), g = f(v(n), 2), k = v(g);
|
|
337
|
+
c(g), c(n);
|
|
338
|
+
var j = f(n, 2);
|
|
339
|
+
Y(j), j.__input = (u) => t("saturation", +u.currentTarget.value), c(T);
|
|
340
|
+
var J = f(T, 4), N = v(J), _ = f(v(N), 2);
|
|
341
|
+
Y(_), _.__change = (u) => t("invert", u.currentTarget.checked), c(N), c(J);
|
|
342
|
+
var M = f(J, 2), G = v(M), U = f(v(G), 2);
|
|
343
|
+
Y(U), U.__change = (u) => t("grayscale", u.currentTarget.checked), c(G), c(M), c(V);
|
|
344
|
+
var q = f(V, 2), p = v(q);
|
|
345
|
+
p.__click = function(...u) {
|
|
346
|
+
var L;
|
|
347
|
+
(L = e.onReset) == null || L.apply(this, u);
|
|
346
348
|
};
|
|
347
|
-
var
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
}), s(
|
|
349
|
+
var F = v(p);
|
|
350
|
+
s0(F, { size: 20 }), ue(), c(p), c(q), c(d), Te(() => {
|
|
351
|
+
oe(D, `${e.filters.brightness ?? ""}%`), ve(z, e.filters.brightness), oe(l, `${e.filters.contrast ?? ""}%`), ve(m, e.filters.contrast), oe(k, `${e.filters.saturation ?? ""}%`), ve(j, e.filters.saturation), fe(_, e.filters.invert), fe(U, e.filters.grayscale);
|
|
352
|
+
}), s(a, d), ae();
|
|
351
353
|
}
|
|
352
|
-
|
|
353
|
-
var
|
|
354
|
-
class
|
|
354
|
+
Se(["click", "input", "change"]);
|
|
355
|
+
var $, ee;
|
|
356
|
+
class be extends Qe {
|
|
355
357
|
constructor() {
|
|
356
358
|
super(...arguments);
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
359
|
+
K(this, "id", "image-manipulation");
|
|
360
|
+
K(this, "name", "Image Manipulation");
|
|
361
|
+
K(this, "version", "1.0.0");
|
|
362
|
+
le(
|
|
361
363
|
this,
|
|
362
|
-
|
|
364
|
+
$,
|
|
363
365
|
// Reactive state using Svelte 5 runes
|
|
364
|
-
|
|
366
|
+
de(!1)
|
|
365
367
|
);
|
|
366
|
-
|
|
367
|
-
|
|
368
|
+
le(this, ee, de(ke({ ...pe })));
|
|
369
|
+
K(this, "osd", null);
|
|
368
370
|
}
|
|
369
371
|
get _panelOpen() {
|
|
370
|
-
return
|
|
372
|
+
return i(W(this, $));
|
|
371
373
|
}
|
|
372
374
|
set _panelOpen(t) {
|
|
373
|
-
|
|
375
|
+
ge(W(this, $), t, !0);
|
|
374
376
|
}
|
|
375
377
|
get _filters() {
|
|
376
|
-
return
|
|
378
|
+
return i(W(this, ee));
|
|
377
379
|
}
|
|
378
380
|
set _filters(t) {
|
|
379
|
-
|
|
381
|
+
ge(W(this, ee), t, !0);
|
|
380
382
|
}
|
|
381
383
|
onRegister(t) {
|
|
382
384
|
super.onRegister(t), t.registerMenuButton({
|
|
383
385
|
id: `${this.id}:toggle`,
|
|
384
|
-
icon:
|
|
385
|
-
tooltip
|
|
386
|
+
icon: Xe,
|
|
387
|
+
get tooltip() {
|
|
388
|
+
return Fe.image_adjustments();
|
|
389
|
+
},
|
|
386
390
|
onClick: () => this.togglePanel(),
|
|
387
391
|
isActive: () => this._panelOpen,
|
|
388
392
|
activeClass: "btn-secondary",
|
|
389
393
|
order: 50
|
|
390
394
|
}), t.registerPanel({
|
|
391
395
|
id: `${this.id}:panel`,
|
|
392
|
-
component:
|
|
396
|
+
component: i0,
|
|
393
397
|
position: "left",
|
|
394
398
|
isVisible: () => this._panelOpen,
|
|
395
399
|
props: {
|
|
396
400
|
filters: this._filters,
|
|
397
|
-
onFilterChange: (
|
|
401
|
+
onFilterChange: (d) => this.setFilters(d),
|
|
398
402
|
onReset: () => this.resetFilters(),
|
|
399
403
|
onClose: () => this.togglePanel()
|
|
400
404
|
}
|
|
401
405
|
});
|
|
402
406
|
}
|
|
403
407
|
onViewerReady(t) {
|
|
404
|
-
this.osd = t,
|
|
405
|
-
this.osd &&
|
|
408
|
+
this.osd = t, _e(this._filters) && ce(t, this._filters), this.osd.addHandler("open", () => {
|
|
409
|
+
this.osd && _e(this._filters) && ce(this.osd, this._filters);
|
|
406
410
|
});
|
|
407
411
|
}
|
|
408
412
|
onDestroy() {
|
|
409
|
-
this.osd &&
|
|
413
|
+
this.osd && me(this.osd), this.osd = null, super.onDestroy();
|
|
410
414
|
}
|
|
411
415
|
// Public API
|
|
412
416
|
togglePanel() {
|
|
413
417
|
this._panelOpen = !this._panelOpen;
|
|
414
418
|
}
|
|
415
419
|
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 &&
|
|
420
|
+
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 && ce(this.osd, t);
|
|
417
421
|
}
|
|
418
422
|
resetFilters() {
|
|
419
|
-
Object.assign(this._filters,
|
|
423
|
+
Object.assign(this._filters, pe), this.osd && me(this.osd);
|
|
420
424
|
}
|
|
421
425
|
getFilters() {
|
|
422
426
|
return { ...this._filters };
|
|
423
427
|
}
|
|
424
428
|
}
|
|
425
|
-
|
|
426
|
-
var
|
|
427
|
-
function
|
|
428
|
-
|
|
429
|
-
let t =
|
|
430
|
-
|
|
429
|
+
$ = new WeakMap(), ee = new WeakMap();
|
|
430
|
+
var l0 = xe('<!> <div class="w-full h-full"><!></div>', 1);
|
|
431
|
+
function o0(a, e) {
|
|
432
|
+
te(e, !0);
|
|
433
|
+
let t = X(e, "manifestId", 7, ""), d = X(e, "canvasId", 7, ""), o = X(e, "plugins", 23, () => [new be()]), w = X(e, "theme", 7, void 0), b = X(e, "themeConfig", 7, void 0), V = X(e, "config", 7, void 0), y, h = de(void 0), H = !1;
|
|
434
|
+
Oe(() => {
|
|
435
|
+
i(h) && y && !H && (H = !0, i(h).setEventTarget(y));
|
|
436
|
+
});
|
|
437
|
+
let D = O(() => {
|
|
438
|
+
if (w()) {
|
|
439
|
+
if (De(w())) return w();
|
|
440
|
+
console.warn(`Invalid theme "${w()}". Using system preference fallback.`);
|
|
441
|
+
}
|
|
442
|
+
}), z = O(() => {
|
|
443
|
+
if (b()) {
|
|
444
|
+
if (typeof b() == "string") {
|
|
445
|
+
const n = Be(b());
|
|
446
|
+
return n || console.warn(`Invalid theme-config JSON: "${b()}". Ignoring.`), n ?? void 0;
|
|
447
|
+
}
|
|
448
|
+
return b();
|
|
449
|
+
}
|
|
450
|
+
}), E = O(() => {
|
|
451
|
+
if (V()) {
|
|
452
|
+
if (typeof V() == "string")
|
|
453
|
+
try {
|
|
454
|
+
return JSON.parse(V());
|
|
455
|
+
} catch {
|
|
456
|
+
console.warn(`Invalid config JSON: "${V()}". Ignoring.`);
|
|
457
|
+
return;
|
|
458
|
+
}
|
|
459
|
+
return V();
|
|
460
|
+
}
|
|
461
|
+
});
|
|
462
|
+
var P = {
|
|
431
463
|
get manifestId() {
|
|
432
464
|
return t();
|
|
433
465
|
},
|
|
434
|
-
set manifestId(
|
|
435
|
-
t(
|
|
466
|
+
set manifestId(n = "") {
|
|
467
|
+
t(n), Q();
|
|
436
468
|
},
|
|
437
469
|
get canvasId() {
|
|
438
|
-
return
|
|
470
|
+
return d();
|
|
439
471
|
},
|
|
440
|
-
set canvasId(
|
|
441
|
-
|
|
472
|
+
set canvasId(n = "") {
|
|
473
|
+
d(n), Q();
|
|
442
474
|
},
|
|
443
475
|
get plugins() {
|
|
444
|
-
return
|
|
476
|
+
return o();
|
|
477
|
+
},
|
|
478
|
+
set plugins(n = [new be()]) {
|
|
479
|
+
o(n), Q();
|
|
480
|
+
},
|
|
481
|
+
get theme() {
|
|
482
|
+
return w();
|
|
445
483
|
},
|
|
446
|
-
set
|
|
447
|
-
|
|
484
|
+
set theme(n = void 0) {
|
|
485
|
+
w(n), Q();
|
|
486
|
+
},
|
|
487
|
+
get themeConfig() {
|
|
488
|
+
return b();
|
|
489
|
+
},
|
|
490
|
+
set themeConfig(n = void 0) {
|
|
491
|
+
b(n), Q();
|
|
492
|
+
},
|
|
493
|
+
get config() {
|
|
494
|
+
return V();
|
|
495
|
+
},
|
|
496
|
+
set config(n = void 0) {
|
|
497
|
+
V(n), Q();
|
|
448
498
|
}
|
|
449
|
-
},
|
|
450
|
-
|
|
499
|
+
}, r = l0(), l = C(r);
|
|
500
|
+
ze(l, () => `<style>${Re}</style>`);
|
|
501
|
+
var m = f(l, 2), T = v(m);
|
|
502
|
+
return Ee(T, {
|
|
451
503
|
get manifestId() {
|
|
452
504
|
return t();
|
|
453
505
|
},
|
|
454
506
|
get canvasId() {
|
|
455
|
-
return
|
|
507
|
+
return d();
|
|
456
508
|
},
|
|
457
509
|
get plugins() {
|
|
458
|
-
return
|
|
510
|
+
return o();
|
|
511
|
+
},
|
|
512
|
+
get theme() {
|
|
513
|
+
return i(D);
|
|
514
|
+
},
|
|
515
|
+
get themeConfig() {
|
|
516
|
+
return i(z);
|
|
517
|
+
},
|
|
518
|
+
get config() {
|
|
519
|
+
return i(E);
|
|
520
|
+
},
|
|
521
|
+
get viewerState() {
|
|
522
|
+
return i(h);
|
|
523
|
+
},
|
|
524
|
+
set viewerState(n) {
|
|
525
|
+
ge(h, n, !0);
|
|
459
526
|
}
|
|
460
|
-
}),
|
|
527
|
+
}), c(m), Pe(m, (n) => y = n, () => y), s(a, r), ae(P);
|
|
461
528
|
}
|
|
462
|
-
customElements.define("triiiceratops-viewer-image",
|
|
463
|
-
|
|
529
|
+
customElements.define("triiiceratops-viewer-image", Le(
|
|
530
|
+
o0,
|
|
464
531
|
{
|
|
465
532
|
manifestId: { attribute: "manifest-id", reflect: !0, type: "String" },
|
|
466
533
|
canvasId: { attribute: "canvas-id", reflect: !0, type: "String" },
|
|
534
|
+
theme: { attribute: "theme", reflect: !0, type: "String" },
|
|
535
|
+
themeConfig: { attribute: "theme-config", type: "String" },
|
|
536
|
+
config: { attribute: "config", type: "String" },
|
|
467
537
|
plugins: {}
|
|
468
538
|
},
|
|
469
539
|
[],
|
|
470
540
|
[],
|
|
471
|
-
!
|
|
541
|
+
!0
|
|
472
542
|
));
|