triiiceratops 0.10.2 → 0.10.4

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.
@@ -1,6 +1,6 @@
1
1
  import "svelte/internal/disclose-version";
2
2
  import * as a from "svelte/internal/client";
3
- import { g as N } from "./X-Dgb3I7Ob.js";
3
+ import { g as N } from "./X-DuHUJc5I.js";
4
4
  var O = a.from_svg('<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>'), P = a.from_svg('<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), Q = a.from_svg('<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>'), R = a.from_svg('<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>'), S = a.from_svg('<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>'), T = a.from_svg('<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>'), W = a.from_svg('<svg><!><rect width="256" height="256" fill="none"></rect><!></svg>');
5
5
  function $(L, r) {
6
6
  a.push(r, !0);
@@ -533,9 +533,9 @@ class ae {
533
533
  }));
534
534
  });
535
535
  } catch (r) {
536
- console.error("Search error:", r);
536
+ console.error("Search error:", r), this.isSearching = !1;
537
537
  } finally {
538
- this.isSearching = !1;
538
+ this.pendingSearchQuery || (this.isSearching = !1);
539
539
  }
540
540
  }
541
541
  }
@@ -1,4 +1,4 @@
1
- import { a as t } from "./X-Dgb3I7Ob.js";
1
+ import { a as t } from "./X-DuHUJc5I.js";
2
2
  const a = (
3
3
  /** @type {(inputs: {}) => LocalizedString} */
4
4
  () => (
@@ -539,6 +539,33 @@
539
539
  />
540
540
  </label>
541
541
  </li>
542
+ <li>
543
+ <label class="label cursor-pointer py-1 gap-2">
544
+ <span class="label-text"
545
+ >{m.settings_select_dock_position()}</span
546
+ >
547
+ <select
548
+ class="select select-bordered select-xs w-24"
549
+ value={config.search?.position ??
550
+ 'right'}
551
+ onchange={(e) => {
552
+ if (!config.search)
553
+ config.search = {};
554
+ config.search.position = (
555
+ e.currentTarget as HTMLSelectElement
556
+ ).value;
557
+ }}
558
+ onclick={(e) => e.stopPropagation()}
559
+ >
560
+ <option value="right"
561
+ >{m.settings_position_right()}</option
562
+ >
563
+ <option value="left"
564
+ >{m.settings_position_left()}</option
565
+ >
566
+ </select>
567
+ </label>
568
+ </li>
542
569
  <li>
543
570
  <label class="label cursor-pointer py-1 gap-2">
544
571
  <span class="label-text"
@@ -40,6 +40,7 @@
40
40
  }
41
41
  }
42
42
  let width = $derived(viewerState.config.search?.width ?? '320px');
43
+ let position = $derived(viewerState.config.search?.position ?? 'right');
43
44
  </script>
44
45
 
45
46
  <!-- Drawer / Panel -->
@@ -48,7 +49,9 @@
48
49
  class="h-full bg-base-200 shadow-2xl z-100 flex flex-col transition-[width] duration-200 {viewerState
49
50
  .config.transparentBackground
50
51
  ? ''
51
- : 'border-l border-base-300'}"
52
+ : position === 'left'
53
+ ? 'border-r border-base-300'
54
+ : 'border-l border-base-300'}"
52
55
  style="width: {width}"
53
56
  role="dialog"
54
57
  aria-label={m.search_panel_title()}
@@ -123,7 +126,10 @@
123
126
 
124
127
  {#each viewerState.searchResults as group}
125
128
  <button
126
- class="w-full text-left bg-base-100 shadow-sm border border-base-200 rounded-box cursor-pointer hover:shadow-md transition-all block p-0 select-none"
129
+ class="w-full text-left bg-base-100 shadow-sm border border-base-200 rounded-box cursor-pointer hover:shadow-md transition-all block p-0 select-none {viewerState.currentCanvasIndex ===
130
+ group.canvasIndex
131
+ ? 'ring-2 ring-primary bg-primary/5'
132
+ : ''}"
127
133
  onclick={() => navigate(group.canvasIndex)}
128
134
  >
129
135
  <div
@@ -162,13 +162,16 @@
162
162
  let isLeftSidebarVisible = $derived(
163
163
  (internalViewerState.showThumbnailGallery &&
164
164
  internalViewerState.dockSide === 'left') ||
165
+ (internalViewerState.showSearchPanel &&
166
+ internalViewerState.config.search?.position === 'left') ||
165
167
  internalViewerState.pluginPanels.some(
166
168
  (p) => p.position === 'left' && p.isVisible(),
167
169
  ),
168
170
  );
169
171
 
170
172
  let isRightSidebarVisible = $derived(
171
- internalViewerState.showSearchPanel ||
173
+ (internalViewerState.showSearchPanel &&
174
+ internalViewerState.config.search?.position !== 'left') ||
172
175
  (internalViewerState.showThumbnailGallery &&
173
176
  internalViewerState.dockSide === 'right') ||
174
177
  internalViewerState.pluginPanels.some(
@@ -373,6 +376,13 @@
373
376
  ? ''
374
377
  : 'bg-base-200 border-r border-base-300'}"
375
378
  >
379
+ <!-- Search Panel (when configured left) -->
380
+ {#if internalViewerState.showSearchPanel && internalViewerState.config.search?.position === 'left'}
381
+ <div class="h-full relative pointer-events-auto">
382
+ <SearchPanel />
383
+ </div>
384
+ {/if}
385
+
376
386
  <!-- Gallery (when docked left) -->
377
387
  {#if internalViewerState.showThumbnailGallery && internalViewerState.dockSide === 'left'}
378
388
  <div class="h-full w-[140px] pointer-events-auto relative">
@@ -507,7 +517,7 @@
507
517
  : 'bg-base-200 border-l border-base-300'}"
508
518
  >
509
519
  <!-- Search Panel -->
510
- {#if internalViewerState.showSearchPanel}
520
+ {#if internalViewerState.showSearchPanel && internalViewerState.config.search?.position !== 'left'}
511
521
  <div class="h-full relative pointer-events-auto">
512
522
  <SearchPanel />
513
523
  </div>
@@ -1,4 +1,4 @@
1
- import { a as t } from "./X-Dgb3I7Ob.js";
1
+ import { a as t } from "./X-DuHUJc5I.js";
2
2
  const s = (
3
3
  /** @type {(inputs: {}) => LocalizedString} */
4
4
  () => (
@@ -4,10 +4,10 @@ var nt = (s, e, t) => Mf(s, typeof e != "symbol" ? e + "" : e, t);
4
4
  import "svelte/internal/disclose-version";
5
5
  import * as d from "svelte/internal/client";
6
6
  import { getContext as Rf, onMount as If, onDestroy as Cf } from "svelte";
7
- import { m as xl, g as as, l as Pf, s as Df, X as bl, c as Lf, V as Of } from "../X-Dgb3I7Ob.js";
7
+ import { m as xl, g as as, l as Pf, s as Df, X as bl, c as Lf, V as Of } from "../X-DuHUJc5I.js";
8
8
  import Hs from "openseadragon";
9
- import { A as Bf } from "../ArrowCounterClockwise-CvTUOlYp.js";
10
- import { q as Nf, h as Ff, c as kf, j as Uf, k as $f, t as Gf, u as Hf, v as Vf, r as Xf, s as zf, m as jf, i as Yf, g as Wf, a as Zf, n as qf, f as Kf, e as Jf, b as Qf, d as ep, o as tp, l as sp, p as ip } from "../annotation_tool_point-CKkqbVDq.js";
9
+ import { A as Bf } from "../ArrowCounterClockwise-Bqd8M_aJ.js";
10
+ import { q as Nf, h as Ff, c as kf, j as Uf, k as $f, t as Gf, u as Hf, v as Vf, r as Xf, s as zf, m as jf, i as Yf, g as Wf, a as Zf, n as qf, f as Kf, e as Jf, b as Qf, d as ep, o as tp, l as sp, p as ip } from "../annotation_tool_point-r6erVcAH.js";
11
11
  import "manifesto.js";
12
12
  var np = Object.defineProperty, rp = (s, e, t) => e in s ? np(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, El = (s, e, t) => rp(s, typeof e != "symbol" ? e + "" : e, t), wl = Object.prototype.hasOwnProperty;
13
13
  function Vs(s, e) {
@@ -1,9 +1,9 @@
1
1
  import "svelte/internal/disclose-version";
2
2
  import * as e from "svelte/internal/client";
3
3
  import { getContext as s0 } from "svelte";
4
- import { l as l0, s as i0, X as n0, c as o0, V as c0, g as v0 } from "../X-Dgb3I7Ob.js";
5
- import { A as d0 } from "../ArrowCounterClockwise-CvTUOlYp.js";
6
- import { i as _0, a as g0, b as f0, g as u0, c as h0, e as m0, d as p0, f as b0 } from "../image_filters_reset-DZrbHhqM.js";
4
+ import { l as l0, s as i0, X as n0, c as o0, V as c0, g as v0 } from "../X-DuHUJc5I.js";
5
+ import { A as d0 } from "../ArrowCounterClockwise-Bqd8M_aJ.js";
6
+ import { i as _0, a as g0, b as f0, g as u0, c as h0, e as m0, d as p0, f as b0 } from "../image_filters_reset-GRY5dmGP.js";
7
7
  const G = {
8
8
  brightness: 100,
9
9
  contrast: 100,
@@ -281,6 +281,7 @@ export class ViewerState {
281
281
  }
282
282
  if (!service) {
283
283
  console.warn('No IIIF search service found in manifest');
284
+ // Ensure we stop searching if no service found
284
285
  this.isSearching = false;
285
286
  return;
286
287
  }
@@ -475,9 +476,13 @@ export class ViewerState {
475
476
  }
476
477
  catch (e) {
477
478
  console.error('Search error:', e);
479
+ this.isSearching = false;
478
480
  }
479
481
  finally {
480
- this.isSearching = false;
482
+ // Only stop searching if we are NOT pending (i.e. we finished or failed, but didn't defer)
483
+ if (!this.pendingSearchQuery) {
484
+ this.isSearching = false;
485
+ }
481
486
  }
482
487
  }
483
488
  // ==================== PLUGIN STATE ====================