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