@annotorious/svelte 3.0.7 → 3.0.8

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 (34) hide show
  1. package/dist/annotorious-svelte.css +1 -1
  2. package/dist/annotorious-svelte.es.js +763 -16
  3. package/dist/annotorious-svelte.es.js.map +1 -1
  4. package/package.json +4 -4
  5. package/src/MouseOverTooltip.svelte +8 -2
  6. package/src/osd/OpenSeadragonAnnotator.svelte +3 -3
  7. package/src/osd/OpenSeadragonPopup.svelte +1 -1
  8. package/svelte.config.js +7 -0
  9. package/test/App.svelte +3 -3
  10. package/vite.config.js +1 -3
  11. package/dist/annotorious-svelte.es10.js +0 -3
  12. package/dist/annotorious-svelte.es10.js.map +0 -1
  13. package/dist/annotorious-svelte.es11.js +0 -5
  14. package/dist/annotorious-svelte.es11.js.map +0 -1
  15. package/dist/annotorious-svelte.es12.js +0 -106
  16. package/dist/annotorious-svelte.es12.js.map +0 -1
  17. package/dist/annotorious-svelte.es14.js +0 -58
  18. package/dist/annotorious-svelte.es14.js.map +0 -1
  19. package/dist/annotorious-svelte.es2.js +0 -133
  20. package/dist/annotorious-svelte.es2.js.map +0 -1
  21. package/dist/annotorious-svelte.es3.js +0 -117
  22. package/dist/annotorious-svelte.es3.js.map +0 -1
  23. package/dist/annotorious-svelte.es4.js +0 -130
  24. package/dist/annotorious-svelte.es4.js.map +0 -1
  25. package/dist/annotorious-svelte.es5.js +0 -99
  26. package/dist/annotorious-svelte.es5.js.map +0 -1
  27. package/dist/annotorious-svelte.es6.js +0 -44
  28. package/dist/annotorious-svelte.es6.js.map +0 -1
  29. package/dist/annotorious-svelte.es7.js +0 -32
  30. package/dist/annotorious-svelte.es7.js.map +0 -1
  31. package/dist/annotorious-svelte.es8.js +0 -26
  32. package/dist/annotorious-svelte.es8.js.map +0 -1
  33. package/dist/annotorious-svelte.es9.js +0 -114
  34. package/dist/annotorious-svelte.es9.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"annotorious-svelte.es14.js","sources":["../../../node_modules/svelte/src/runtime/internal/scheduler.js"],"sourcesContent":["import { run_all } from './utils.js';\nimport { current_component, set_current_component } from './lifecycle.js';\n\nexport const dirty_components = [];\nexport const intros = { enabled: false };\nexport const binding_callbacks = [];\n\nlet render_callbacks = [];\n\nconst flush_callbacks = [];\n\nconst resolved_promise = /* @__PURE__ */ Promise.resolve();\n\nlet update_scheduled = false;\n\n/** @returns {void} */\nexport function schedule_update() {\n\tif (!update_scheduled) {\n\t\tupdate_scheduled = true;\n\t\tresolved_promise.then(flush);\n\t}\n}\n\n/** @returns {Promise<void>} */\nexport function tick() {\n\tschedule_update();\n\treturn resolved_promise;\n}\n\n/** @returns {void} */\nexport function add_render_callback(fn) {\n\trender_callbacks.push(fn);\n}\n\n/** @returns {void} */\nexport function add_flush_callback(fn) {\n\tflush_callbacks.push(fn);\n}\n\n// flush() calls callbacks in this order:\n// 1. All beforeUpdate callbacks, in order: parents before children\n// 2. All bind:this callbacks, in reverse order: children before parents.\n// 3. All afterUpdate callbacks, in order: parents before children. EXCEPT\n// for afterUpdates called during the initial onMount, which are called in\n// reverse order: children before parents.\n// Since callbacks might update component values, which could trigger another\n// call to flush(), the following steps guard against this:\n// 1. During beforeUpdate, any updated components will be added to the\n// dirty_components array and will cause a reentrant call to flush(). Because\n// the flush index is kept outside the function, the reentrant call will pick\n// up where the earlier call left off and go through all dirty components. The\n// current_component value is saved and restored so that the reentrant call will\n// not interfere with the \"parent\" flush() call.\n// 2. bind:this callbacks cannot trigger new flush() calls.\n// 3. During afterUpdate, any updated components will NOT have their afterUpdate\n// callback called a second time; the seen_callbacks set, outside the flush()\n// function, guarantees this behavior.\nconst seen_callbacks = new Set();\n\nlet flushidx = 0; // Do *not* move this inside the flush() function\n\n/** @returns {void} */\nexport function flush() {\n\t// Do not reenter flush while dirty components are updated, as this can\n\t// result in an infinite loop. Instead, let the inner flush handle it.\n\t// Reentrancy is ok afterwards for bindings etc.\n\tif (flushidx !== 0) {\n\t\treturn;\n\t}\n\tconst saved_component = current_component;\n\tdo {\n\t\t// first, call beforeUpdate functions\n\t\t// and update components\n\t\ttry {\n\t\t\twhile (flushidx < dirty_components.length) {\n\t\t\t\tconst component = dirty_components[flushidx];\n\t\t\t\tflushidx++;\n\t\t\t\tset_current_component(component);\n\t\t\t\tupdate(component.$$);\n\t\t\t}\n\t\t} catch (e) {\n\t\t\t// reset dirty state to not end up in a deadlocked state and then rethrow\n\t\t\tdirty_components.length = 0;\n\t\t\tflushidx = 0;\n\t\t\tthrow e;\n\t\t}\n\t\tset_current_component(null);\n\t\tdirty_components.length = 0;\n\t\tflushidx = 0;\n\t\twhile (binding_callbacks.length) binding_callbacks.pop()();\n\t\t// then, once components are updated, call\n\t\t// afterUpdate functions. This may cause\n\t\t// subsequent updates...\n\t\tfor (let i = 0; i < render_callbacks.length; i += 1) {\n\t\t\tconst callback = render_callbacks[i];\n\t\t\tif (!seen_callbacks.has(callback)) {\n\t\t\t\t// ...so guard against infinite loops\n\t\t\t\tseen_callbacks.add(callback);\n\t\t\t\tcallback();\n\t\t\t}\n\t\t}\n\t\trender_callbacks.length = 0;\n\t} while (dirty_components.length);\n\twhile (flush_callbacks.length) {\n\t\tflush_callbacks.pop()();\n\t}\n\tupdate_scheduled = false;\n\tseen_callbacks.clear();\n\tset_current_component(saved_component);\n}\n\n/** @returns {void} */\nfunction update($$) {\n\tif ($$.fragment !== null) {\n\t\t$$.update();\n\t\trun_all($$.before_update);\n\t\tconst dirty = $$.dirty;\n\t\t$$.dirty = [-1];\n\t\t$$.fragment && $$.fragment.p($$.ctx, dirty);\n\t\t$$.after_update.forEach(add_render_callback);\n\t}\n}\n\n/**\n * Useful for example to execute remaining `afterUpdate` callbacks before executing `destroy`.\n * @param {Function[]} fns\n * @returns {void}\n */\nexport function flush_render_callbacks(fns) {\n\tconst filtered = [];\n\tconst targets = [];\n\trender_callbacks.forEach((c) => (fns.indexOf(c) === -1 ? filtered.push(c) : targets.push(c)));\n\ttargets.forEach((c) => c());\n\trender_callbacks = filtered;\n}\n"],"names":["dirty_components","binding_callbacks","render_callbacks","flush_callbacks","resolved_promise","update_scheduled","schedule_update","flush","add_render_callback","fn","seen_callbacks","flushidx","saved_component","current_component","component","set_current_component","update","e","i","callback","$$","run_all","dirty","flush_render_callbacks","fns","filtered","targets","c"],"mappings":";;AAGY,MAACA,IAAmB,CAAG,GAEtBC,IAAoB,CAAG;AAEpC,IAAIC,IAAmB,CAAA;AAEvB,MAAMC,IAAkB,CAAA,GAElBC,IAAmC,wBAAQ;AAEjD,IAAIC,IAAmB;AAGhB,SAASC,IAAkB;AACjC,EAAKD,MACJA,IAAmB,IACnBD,EAAiB,KAAKG,CAAK;AAE7B;AASO,SAASC,EAAoBC,GAAI;AACvC,EAAAP,EAAiB,KAAKO,CAAE;AACzB;AAyBA,MAAMC,IAAiB,oBAAI;AAE3B,IAAIC,IAAW;AAGR,SAASJ,IAAQ;AAIvB,MAAII,MAAa;AAChB;AAED,QAAMC,IAAkBC;AACxB,KAAG;AAGF,QAAI;AACH,aAAOF,IAAWX,EAAiB,UAAQ;AAC1C,cAAMc,IAAYd,EAAiBW,CAAQ;AAC3C,QAAAA,KACAI,EAAsBD,CAAS,GAC/BE,EAAOF,EAAU,EAAE;AAAA,MACnB;AAAA,IACD,SAAQG,GAAG;AAEX,YAAAjB,EAAiB,SAAS,GAC1BW,IAAW,GACLM;AAAA,IACN;AAID,SAHAF,EAAsB,IAAI,GAC1Bf,EAAiB,SAAS,GAC1BW,IAAW,GACJV,EAAkB,SAAQ,CAAAA,EAAkB,IAAK,EAAA;AAIxD,aAASiB,IAAI,GAAGA,IAAIhB,EAAiB,QAAQgB,KAAK,GAAG;AACpD,YAAMC,IAAWjB,EAAiBgB,CAAC;AACnC,MAAKR,EAAe,IAAIS,CAAQ,MAE/BT,EAAe,IAAIS,CAAQ,GAC3BA;IAED;AACD,IAAAjB,EAAiB,SAAS;AAAA,EAC5B,SAAUF,EAAiB;AAC1B,SAAOG,EAAgB;AACtB,IAAAA,EAAgB,IAAG;AAEpB,EAAAE,IAAmB,IACnBK,EAAe,MAAK,GACpBK,EAAsBH,CAAe;AACtC;AAGA,SAASI,EAAOI,GAAI;AACnB,MAAIA,EAAG,aAAa,MAAM;AACzB,IAAAA,EAAG,OAAM,GACTC,EAAQD,EAAG,aAAa;AACxB,UAAME,IAAQF,EAAG;AACjB,IAAAA,EAAG,QAAQ,CAAC,EAAE,GACdA,EAAG,YAAYA,EAAG,SAAS,EAAEA,EAAG,KAAKE,CAAK,GAC1CF,EAAG,aAAa,QAAQZ,CAAmB;AAAA,EAC3C;AACF;AAOO,SAASe,EAAuBC,GAAK;AAC3C,QAAMC,IAAW,CAAA,GACXC,IAAU,CAAA;AAChB,EAAAxB,EAAiB,QAAQ,CAACyB,MAAOH,EAAI,QAAQG,CAAC,MAAM,KAAKF,EAAS,KAAKE,CAAC,IAAID,EAAQ,KAAKC,CAAC,CAAE,GAC5FD,EAAQ,QAAQ,CAACC,MAAMA,EAAG,CAAA,GAC1BzB,IAAmBuB;AACpB;","x_google_ignoreList":[0]}
@@ -1,133 +0,0 @@
1
- import { safe_not_equal as O, component_subscribe as T, create_slot as q, update_slot_base as w, get_all_dirty_from_scope as A, get_slot_changes as N } from "./annotorious-svelte.es5.js";
2
- import { empty as S, insert as E, detach as L, element as X, attr as c } from "./annotorious-svelte.es6.js";
3
- import { transition_in as u, transition_out as p, check_outros as Y, group_outros as j } from "./annotorious-svelte.es7.js";
4
- import { getContext as z, onMount as B } from "./annotorious-svelte.es8.js";
5
- import { SvelteComponent as D, init as F } from "./annotorious-svelte.es9.js";
6
- import "./annotorious-svelte.es10.js";
7
- const G = (o) => ({ hovered: o & /*hovered*/
8
- 16 }), b = (o) => ({ hovered: (
9
- /*hovered*/
10
- o[4]
11
- ) });
12
- function g(o) {
13
- let r, s, e;
14
- const t = (
15
- /*#slots*/
16
- o[8].default
17
- ), n = q(
18
- t,
19
- o,
20
- /*$$scope*/
21
- o[7],
22
- b
23
- );
24
- return {
25
- c() {
26
- r = X("div"), n && n.c(), c(r, "class", "a9s-tooltip"), c(r, "style", s = `left:${/*left*/
27
- o[2]}px; top:${/*top*/
28
- o[1]}px; position: absolute;`);
29
- },
30
- m(i, l) {
31
- E(i, r, l), n && n.m(r, null), e = !0;
32
- },
33
- p(i, l) {
34
- n && n.p && (!e || l & /*$$scope, hovered*/
35
- 144) && w(
36
- n,
37
- t,
38
- i,
39
- /*$$scope*/
40
- i[7],
41
- e ? N(
42
- t,
43
- /*$$scope*/
44
- i[7],
45
- l,
46
- G
47
- ) : A(
48
- /*$$scope*/
49
- i[7]
50
- ),
51
- b
52
- ), (!e || l & /*left, top*/
53
- 6 && s !== (s = `left:${/*left*/
54
- i[2]}px; top:${/*top*/
55
- i[1]}px; position: absolute;`)) && c(r, "style", s);
56
- },
57
- i(i) {
58
- e || (u(n, i), e = !0);
59
- },
60
- o(i) {
61
- p(n, i), e = !1;
62
- },
63
- d(i) {
64
- i && L(r), n && n.d(i);
65
- }
66
- };
67
- }
68
- function H(o) {
69
- let r, s, e = (
70
- /*$hover*/
71
- o[0] && /*show*/
72
- o[3] && g(o)
73
- );
74
- return {
75
- c() {
76
- e && e.c(), r = S();
77
- },
78
- m(t, n) {
79
- e && e.m(t, n), E(t, r, n), s = !0;
80
- },
81
- p(t, [n]) {
82
- /*$hover*/
83
- t[0] && /*show*/
84
- t[3] ? e ? (e.p(t, n), n & /*$hover, show*/
85
- 9 && u(e, 1)) : (e = g(t), e.c(), u(e, 1), e.m(r.parentNode, r)) : e && (j(), p(e, 1, 1, () => {
86
- e = null;
87
- }), Y());
88
- },
89
- i(t) {
90
- s || (u(e), s = !0);
91
- },
92
- o(t) {
93
- p(e), s = !1;
94
- },
95
- d(t) {
96
- t && L(r), e && e.d(t);
97
- }
98
- };
99
- }
100
- function I(o, r, s) {
101
- let e, t, { $$slots: n = {}, $$scope: i } = r, { container: l } = r;
102
- const k = z("anno"), { store: M, hover: _ } = k.state;
103
- T(o, _, (f) => s(0, t = f));
104
- let m, v, a = !0;
105
- return B(() => {
106
- const f = () => {
107
- s(3, a = !0);
108
- }, d = (y) => {
109
- const { offsetX: P, offsetY: C } = y;
110
- s(2, v = P), s(1, m = C);
111
- }, h = () => {
112
- s(3, a = !1);
113
- };
114
- return l.addEventListener("pointerenter", f), l.addEventListener("pointermove", d), l.addEventListener("pointerleave", h), () => {
115
- l.removeEventListener("pointerenter", f), l.removeEventListener("pointermove", d), l.removeEventListener("pointerleave", h);
116
- };
117
- }), o.$$set = (f) => {
118
- "container" in f && s(6, l = f.container), "$$scope" in f && s(7, i = f.$$scope);
119
- }, o.$$.update = () => {
120
- o.$$.dirty & /*$hover*/
121
- 1 && s(4, e = t ? M.getAnnotation(t) : void 0);
122
- }, [t, m, v, a, e, _, l, i, n];
123
- }
124
- class J extends D {
125
- constructor(r) {
126
- super(), F(this, r, I, H, O, { container: 6 });
127
- }
128
- }
129
- const Z = J;
130
- export {
131
- Z as default
132
- };
133
- //# sourceMappingURL=annotorious-svelte.es2.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"annotorious-svelte.es2.js","sources":["../src/MouseOverTooltip.svelte"],"sourcesContent":["<script lang=\"ts\">\n import { getContext, onMount } from 'svelte';\n import type { ImageAnnotation } from '@annotorious/annotorious';\n import type { SvelteAnnotator } from '@annotorious/core';\n\n export let container: Element;\n\n const anno = getContext<SvelteAnnotator<ImageAnnotation>>('anno');\n\n const { store, hover } = anno.state;\n\n let top: number;\n\n let left: number;\n\n let show = true;\n\n $: hovered = $hover ? store.getAnnotation($hover) : undefined;\n \n onMount(() => {\n const onPointerEnter = () => {\n show = true;\n }\n\n const onPointerMove = (event: PointerEvent) => {\n const { offsetX, offsetY } = event;\n left = offsetX;\n top = offsetY;\n }\n\n const onPointerLeave = () => {\n show = false;\n }\n\n container.addEventListener('pointerenter', onPointerEnter);\n container.addEventListener('pointermove', onPointerMove);\n container.addEventListener('pointerleave', onPointerLeave);\n\n return () => {\n container.removeEventListener('pointerenter', onPointerEnter);\n container.removeEventListener('pointermove', onPointerMove);\n container.removeEventListener('pointerleave', onPointerLeave);\n }\n });\n</script>\n\n{#if $hover && show}\n <div \n class=\"a9s-tooltip\" \n style={`left:${left}px; top:${top}px; position: absolute;`}>\n\n <slot hovered={hovered} />\n\n </div>\n{/if}"],"names":["ctx","attr","div","div_style_value","insert","target","anchor","current","dirty","if_block","create_if_block","container","$$props","anno","getContext","store","hover","top","left","show","onMount","onPointerEnter","$$invalidate","onPointerMove","event","offsetX","offsetY","onPointerLeave","hovered","$hover"],"mappings":";;;;;;;;;EAmDmBA,EAAO,CAAA;AAAA,EAAA;;;;;;;;;;;;;;;8DAFPC,EAAAC,GAAA,SAAAC,IAAA;AAAA,MAAAH;MAAeA,EAAG,CAAA,CAAA,yBAAA;AAAA;;AAFnC,MAAAI,EAMKC,GAAAH,GAAAI,CAAA;;;;;;;;;;;;;;;;;;;;;UAJY,CAAAC,KAAAC;AAAA,MAAA,KAAAL,OAAAA,IAAA;AAAA,MAAAH;MAAeA,EAAG,CAAA,CAAA;;;;;;;;;;;;;;YAHhCS;AAAA;AAAA,IAAAT;IAAUA,EAAI,CAAA,KAAAU,EAAAV,CAAA;AAAA;;;;;;;;;AAAd;AAAA,MAAAA;MAAUA,EAAI,CAAA;;;;;;;;;;;;;;;;;mDAzCN,WAAAW,EAAkB,IAAAC;QAEvBC,IAAOC,EAA6C,MAAM,GAExD,EAAA,OAAAC,GAAO,OAAAC,MAAUH,EAAK;;MAE1BI,GAEAC,GAEAC,IAAO;AAIX,SAAAC,EAAO,MAAA;UACCC,IAAc,MAAA;AAClB,MAAAC,EAAA,GAAAH,IAAO,EAAI;AAAA,OAGPI,IAAiB,CAAAC,MAAmB;cAChC,SAAAC,GAAS,SAAAC,EAAO,IAAKF;AAC7B,MAAAF,EAAA,GAAAJ,IAAOO,CAAO,GACdH,EAAA,GAAAL,IAAMS,CAAO;AAAA,OAGTC,IAAc,MAAA;AAClB,MAAAL,EAAA,GAAAH,IAAO,EAAK;AAAA;AAGd,WAAAR,EAAU,iBAAiB,gBAAgBU,CAAc,GACzDV,EAAU,iBAAiB,eAAeY,CAAa,GACvDZ,EAAU,iBAAiB,gBAAgBgB,CAAc;AAGvD,MAAAhB,EAAU,oBAAoB,gBAAgBU,CAAc,GAC5DV,EAAU,oBAAoB,eAAeY,CAAa,GAC1DZ,EAAU,oBAAoB,gBAAgBgB,CAAc;AAAA;;;;;SAxB/DL,EAAA,GAAEM,IAAUC,IAASd,EAAM,cAAcc,CAAM,IAAI,MAAS;AAAA;;;;;;;;"}
@@ -1,117 +0,0 @@
1
- import { safe_not_equal as g, create_slot as b, update_slot_base as h, get_all_dirty_from_scope as k, get_slot_changes as w } from "./annotorious-svelte.es5.js";
2
- import { empty as A, insert as O, detach as v } from "./annotorious-svelte.es6.js";
3
- import { transition_in as s, transition_out as c, check_outros as C, group_outros as q } from "./annotorious-svelte.es7.js";
4
- import { setContext as _ } from "./annotorious-svelte.es8.js";
5
- import { SvelteComponent as y, init as D } from "./annotorious-svelte.es9.js";
6
- import "./annotorious-svelte.es10.js";
7
- import { toSvelteStore as N } from "@annotorious/core";
8
- import { createOSDAnnotator as j } from "@annotorious/openseadragon";
9
- function d(f) {
10
- let o;
11
- const n = (
12
- /*#slots*/
13
- f[4].default
14
- ), t = b(
15
- n,
16
- f,
17
- /*$$scope*/
18
- f[3],
19
- null
20
- );
21
- return {
22
- c() {
23
- t && t.c();
24
- },
25
- m(e, r) {
26
- t && t.m(e, r), o = !0;
27
- },
28
- p(e, r) {
29
- t && t.p && (!o || r & /*$$scope*/
30
- 8) && h(
31
- t,
32
- n,
33
- e,
34
- /*$$scope*/
35
- e[3],
36
- o ? w(
37
- n,
38
- /*$$scope*/
39
- e[3],
40
- r,
41
- null
42
- ) : k(
43
- /*$$scope*/
44
- e[3]
45
- ),
46
- null
47
- );
48
- },
49
- i(e) {
50
- o || (s(t, e), o = !0);
51
- },
52
- o(e) {
53
- c(t, e), o = !1;
54
- },
55
- d(e) {
56
- t && t.d(e);
57
- }
58
- };
59
- }
60
- function z(f) {
61
- let o, n, t = (
62
- /*viewer*/
63
- f[0] && d(f)
64
- );
65
- return {
66
- c() {
67
- t && t.c(), o = A();
68
- },
69
- m(e, r) {
70
- t && t.m(e, r), O(e, o, r), n = !0;
71
- },
72
- p(e, [r]) {
73
- /*viewer*/
74
- e[0] ? t ? (t.p(e, r), r & /*viewer*/
75
- 1 && s(t, 1)) : (t = d(e), t.c(), s(t, 1), t.m(o.parentNode, o)) : t && (q(), c(t, 1, 1, () => {
76
- t = null;
77
- }), C());
78
- },
79
- i(e) {
80
- n || (s(t), n = !0);
81
- },
82
- o(e) {
83
- c(t), n = !1;
84
- },
85
- d(e) {
86
- e && v(o), t && t.d(e);
87
- }
88
- };
89
- }
90
- function B(f, o, n) {
91
- let { $$slots: t = {}, $$scope: e } = o, { viewer: r } = o, { opts: l = {} } = o, { anno: a = void 0 } = o;
92
- const p = (i) => {
93
- if (i) {
94
- const u = j(i, l), S = N(u.state.store), m = {
95
- ...u,
96
- state: { ...u.state, store: S }
97
- };
98
- _("anno", m), _("viewer", i), n(1, a = m);
99
- }
100
- };
101
- return f.$$set = (i) => {
102
- "viewer" in i && n(0, r = i.viewer), "opts" in i && n(2, l = i.opts), "anno" in i && n(1, a = i.anno), "$$scope" in i && n(3, e = i.$$scope);
103
- }, f.$$.update = () => {
104
- f.$$.dirty & /*viewer*/
105
- 1 && p(r);
106
- }, [r, a, l, e, t];
107
- }
108
- class E extends y {
109
- constructor(o) {
110
- super(), D(this, o, B, z, g, { viewer: 0, opts: 2, anno: 1 });
111
- }
112
- }
113
- const P = E;
114
- export {
115
- P as default
116
- };
117
- //# sourceMappingURL=annotorious-svelte.es3.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"annotorious-svelte.es3.js","sources":["../src/osd/OpenSeadragonAnnotator.svelte"],"sourcesContent":["<script lang=\"ts\">\n import { setContext } from 'svelte';\n import { type SvelteAnnotator, type SvelteAnnotatorState, toSvelteStore } from '@annotorious/core';\n import { createOSDAnnotator, type ImageAnnotation } from '@annotorious/openseadragon';\n import type OpenSeadragon from 'openseadragon';\n\n /** props **/\n export let viewer: OpenSeadragon.Viewer;\n export let opts = {};\n export let anno: SvelteAnnotator<ImageAnnotation> = undefined;\n\n $: init(viewer);\n\n const init = (viewer: OpenSeadragon.Viewer) => {\n if (viewer) {\n const annotator = createOSDAnnotator(viewer, opts);\n\n // Wrap the store for Svelte reactivity\n const svelteStore = toSvelteStore(annotator.state.store);\n\n const shim = {\n ...annotator,\n state: {\n ...annotator.state,\n store: svelteStore\n } as SvelteAnnotatorState<ImageAnnotation>\n } as SvelteAnnotator<ImageAnnotation>\n\n setContext('anno', shim);\n setContext('viewer', viewer);\n\n anno = shim;\n }\n }\n</script>\n\n{#if viewer}\n <slot />\n{/if}\n"],"names":["ctx","create_if_block","viewer","$$props","opts","anno","init","annotator","createOSDAnnotator","svelteStore","toSvelteStore","shim","setContext","$$invalidate"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAoCKA,EAAM,CAAA,KAAAC,EAAAD,CAAA;AAAA;;;;;;;;;;MAANA,EAAM,CAAA;;;;;;;;;;;;;;;;;6CA7BE,QAAAE,EAA4B,IAAAC,KAC5B,MAAAC,IAAI,GAAA,IAAAD,GACJ,EAAA,MAAAE,IAAyC,OAAS,IAAAF;AAIvD,QAAAG,IAAQ,CAAAJ,MAA4B;QACpCA,GAAM;AACF,YAAAK,IAAYC,EAAmBN,GAAQE,CAAI,GAG3CK,IAAcC,EAAcH,EAAU,MAAM,KAAK,GAEjDI,IAAI;AAAA,WACLJ;AAAA,QACH,YACKA,EAAU,OACb,OAAOE,EAAA;AAAA;AAIX,MAAAG,EAAW,QAAQD,CAAI,GACvBC,EAAW,UAAUV,CAAM,GAE3BW,EAAA,GAAAR,IAAOM,CAAI;AAAA;;;;;;SApBZL,EAAKJ,CAAM;AAAA;;;;;;;;"}
@@ -1,130 +0,0 @@
1
- import { safe_not_equal as H, noop as v, component_subscribe as I, action_destroyer as T, is_function as X, run_all as Y } from "./annotorious-svelte.es5.js";
2
- import { empty as q, insert as y, detach as P, element as x, text as G, attr as L, append as R, listen as _, set_data as U } from "./annotorious-svelte.es6.js";
3
- import { onMount as z } from "./annotorious-svelte.es8.js";
4
- import { SvelteComponent as B, init as F } from "./annotorious-svelte.es9.js";
5
- import "./annotorious-svelte.es10.js";
6
- import { draggable as J } from "./annotorious-svelte.es12.js";
7
- import b from "openseadragon";
8
- /* empty css */
9
- function w(n) {
10
- let o, e = (
11
- /*$selection*/
12
- n[0].selected.map(S).join(", ") + ""
13
- ), t, s, r, d;
14
- return {
15
- c() {
16
- o = x("div"), t = G(e), L(o, "class", "a9s-popup a9s-osd-popup svelte-1xuxeat");
17
- },
18
- m(a, l) {
19
- y(a, o, l), R(o, t), r || (d = [
20
- T(s = J.call(null, o, {
21
- position: { x: (
22
- /*left*/
23
- n[1]
24
- ), y: (
25
- /*top*/
26
- n[2]
27
- ) }
28
- })),
29
- _(
30
- o,
31
- "neodrag:start",
32
- /*onDragStart*/
33
- n[4]
34
- ),
35
- _(
36
- o,
37
- "neodrag:end",
38
- /*onDragEnd*/
39
- n[5]
40
- )
41
- ], r = !0);
42
- },
43
- p(a, l) {
44
- l & /*$selection*/
45
- 1 && e !== (e = /*$selection*/
46
- a[0].selected.map(S).join(", ") + "") && U(t, e), s && X(s.update) && l & /*left, top*/
47
- 6 && s.update.call(null, {
48
- position: { x: (
49
- /*left*/
50
- a[1]
51
- ), y: (
52
- /*top*/
53
- a[2]
54
- ) }
55
- });
56
- },
57
- d(a) {
58
- a && P(o), r = !1, Y(d);
59
- }
60
- };
61
- }
62
- function K(n) {
63
- let o, e = (
64
- /*$selection*/
65
- n[0] && w(n)
66
- );
67
- return {
68
- c() {
69
- e && e.c(), o = q();
70
- },
71
- m(t, s) {
72
- e && e.m(t, s), y(t, o, s);
73
- },
74
- p(t, [s]) {
75
- /*$selection*/
76
- t[0] ? e ? e.p(t, s) : (e = w(t), e.c(), e.m(o.parentNode, o)) : e && (e.d(1), e = null);
77
- },
78
- i: v,
79
- o: v,
80
- d(t) {
81
- t && P(o), e && e.d(t);
82
- }
83
- };
84
- }
85
- const S = (n) => n.id;
86
- function Q(n, o, e) {
87
- let t, { state: s } = o, { viewer: r } = o, d, a, l = !1, p;
88
- const { selection: u, store: f } = s;
89
- I(n, u, (i) => e(0, t = i));
90
- const g = (i) => {
91
- var c;
92
- return ((c = i.selected) == null ? void 0 : c.length) > 0;
93
- }, E = () => {
94
- l = !0, r.setMouseNavEnabled(!1);
95
- }, D = () => {
96
- r.setMouseNavEnabled(!0);
97
- }, N = () => {
98
- p && f.unobserve(p), g(t) && (l = !1, m(t), p = (i) => {
99
- l || m(t);
100
- }, f.observe(p, {
101
- annotations: t.selected.map((i) => i.id)
102
- }));
103
- }, m = (i) => {
104
- const c = i.selected[0].id, O = f.getAnnotation(c), { minX: h, minY: k, maxX: C, maxY: M } = O.target.selector.geometry.bounds, V = 14, j = r.viewport.imageToViewerElementCoordinates(new b.Point(h, k)), A = r.viewport.imageToViewerElementCoordinates(new b.Point(C, M));
105
- e(1, d = A.x + V), e(2, a = j.y);
106
- };
107
- return z(() => {
108
- const i = () => {
109
- g(t) && !l && m(t);
110
- };
111
- return r.addHandler("update-viewport", i), () => {
112
- r.removeHandler("update-viewport", i);
113
- };
114
- }), n.$$set = (i) => {
115
- "state" in i && e(6, s = i.state), "viewer" in i && e(7, r = i.viewer);
116
- }, n.$$.update = () => {
117
- n.$$.dirty & /*$selection*/
118
- 1 && N();
119
- }, [t, d, a, u, E, D, s, r];
120
- }
121
- class W extends B {
122
- constructor(o) {
123
- super(), F(this, o, Q, K, H, { state: 6, viewer: 7 });
124
- }
125
- }
126
- const re = W;
127
- export {
128
- re as default
129
- };
130
- //# sourceMappingURL=annotorious-svelte.es4.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"annotorious-svelte.es4.js","sources":["../src/osd/OpenSeadragonPopup.svelte"],"sourcesContent":["<script lang=\"ts\">\n import { onMount } from 'svelte';\n import { draggable } from '@neodrag/svelte';\n import OpenSeadragon from 'openseadragon';\n import type { Selection, StoreChangeEvent, SvelteAnnotatorState } from '@annotorious/core';\n import type { ImageAnnotation } from '@annotorious/annotorious';\n\n export let state: SvelteAnnotatorState<ImageAnnotation>;\n\n export let viewer: OpenSeadragon.Viewer;\n\n let left: number;\n\n let top: number;\n\n let dragged = false;\n\n let storeObserver: (event: StoreChangeEvent<ImageAnnotation>) => void;\n\n const { selection, store } = state; \n\n const isSelected = (selection: Selection) => selection.selected?.length > 0;\n\n const onDragStart = () => {\n dragged = true;\n viewer.setMouseNavEnabled(false);\n }\n\n const onDragEnd = () => {\n viewer.setMouseNavEnabled(true);\n }\n\n $: $selection, onSelect();\n\n const onSelect = () => {\n if (storeObserver)\n store.unobserve(storeObserver);\n\n if (isSelected($selection)) {\n dragged = false;\n\n setPosition($selection);\n\n storeObserver = (event: StoreChangeEvent<ImageAnnotation>) => {\n if (!dragged)\n setPosition($selection);\n }\n\n store.observe(storeObserver, { annotations: $selection.selected.map(s => s.id) });\n }\n }\n\n const setPosition = (selection: Selection) => {\n // Note: this demo popup only supports a single selection\n const selectedId = selection.selected[0].id;\n const annotation = store.getAnnotation(selectedId);\n\n const { minX, minY, maxX, maxY } = annotation.target.selector.geometry.bounds;\n\n const PADDING = 14;\n\n const topLeft = viewer.viewport.imageToViewerElementCoordinates(new OpenSeadragon.Point(minX, minY));\n const bottomRight = viewer.viewport.imageToViewerElementCoordinates(new OpenSeadragon.Point(maxX, maxY));\n\n // [left, top] = defaultStrategy(annotation, lastPointerDown);\n left = bottomRight.x + PADDING;\n top = topLeft.y;\n }\n\n onMount(() => {\n const onUpdateViewport = () => {\n if (isSelected($selection) && !dragged)\n setPosition($selection);\n }\n\n viewer.addHandler('update-viewport', onUpdateViewport);\n\n return () => {\n viewer.removeHandler('update-viewport', onUpdateViewport);\n }\n });\n</script>\n\n{#if $selection}\n <div \n class=\"a9s-popup a9s-osd-popup\"\n use:draggable={{ position: { x: left, y: top }}}\n on:neodrag:start={onDragStart}\n on:neodrag:end={onDragEnd}>\n {$selection.selected.map(s => s.id).join(', ')}\n </div>\n{/if}\n\n<style>\n .a9s-osd-popup {\n background-color: #fff;\n border: 1px solid #a2a2a2;\n height: 250px;\n position: absolute;\n width: 400px;\n z-index: 1;\n }\n</style>"],"names":["t_value","ctx","func","insert","target","div","anchor","dirty","set_data","create_if_block","s","state","$$props","viewer","left","top","dragged","storeObserver","selection","store","isSelected","_a","onDragStart","onDragEnd","onSelect","$selection","setPosition","event","selectedId","annotation","minX","minY","maxX","maxY","PADDING","topLeft","OpenSeadragon","bottomRight","$$invalidate","onMount","onUpdateViewport"],"mappings":";;;;;;;;;SAyFKA;AAAA;AAAA,IAAAC,KAAW,SAAS,IAAeC,CAAA,EAAA,KAAK,IAAI,IAAA;AAAA;;;;;;AAL/C,MAAAC,EAMKC,GAAAC,GAAAC,CAAA;;UAJc,YAAY;AAAA;AAAA,YAAGL,EAAM,CAAA;AAAA,aAAA;AAAA;AAAA,YAAGA,EAAG,CAAA;AAAA,YAAA;AAAA;;;;;UAC1BA,EAAW,CAAA;AAAA,QAAA;AAAA;;;;UACbA,EAAS,CAAA;AAAA,QAAA;AAAA;;;AACxB,MAAAM;AAAA,MAAA,KAAAP,OAAAA;AAAA,MAAAC,KAAW,SAAS,IAAeC,CAAA,EAAA,KAAK,IAAI,IAAA,OAAAM,EAAA,GAAAR,CAAA;;QAH5B,YAAY;AAAA;AAAA,UAAGC,EAAM,CAAA;AAAA,WAAA;AAAA;AAAA,UAAGA,EAAG,CAAA;AAAA,UAAA;AAAA;;;;;;;;;;IAH3CA,EAAU,CAAA,KAAAQ,EAAAR,CAAA;AAAA;;;;;;;;;;MAAVA,EAAU,CAAA;;;;;;;;;UAMc,CAAAS,MAAKA,EAAE;;WAlFvB,OAAAC,EAA4C,IAAAC,KAE5C,QAAAC,EAA4B,IAAAD,GAEnCE,GAEAC,GAEAC,IAAU,IAEVC;UAEI,WAAAC,GAAW,OAAAC,EAAK,IAAKR;;QAEvBS,IAAc,CAAAF,MAAyB;;AAAA,aAAAG,IAAAH,EAAU,aAAV,gBAAAG,EAAoB,UAAS;AAAA,KAEpEC,IAAW,MAAA;AACf,IAAAN,IAAU,IACVH,EAAO,mBAAmB,EAAK;AAAA,KAG3BU,IAAS,MAAA;AACb,IAAAV,EAAO,mBAAmB,EAAI;AAAA,KAK1BW,IAAQ,MAAA;AACR,IAAAP,KACFE,EAAM,UAAUF,CAAa,GAE3BG,EAAWK,CAAU,MACvBT,IAAU,IAEVU,EAAYD,CAAU,GAEtBR,IAAiB,CAAAU,MAAwC;MAClDX,KACHU,EAAYD,CAAU;AAAA,OAG1BN,EAAM,QAAQF,GAAa;AAAA,MAAI,aAAaQ,EAAW,SAAS,IAAI,CAAAf,MAAKA,EAAE,EAAE;AAAA;KAI3EgB,IAAe,CAAAR,MAAoB;AAEjC,UAAAU,IAAaV,EAAU,SAAS,CAAC,EAAE,IACnCW,IAAaV,EAAM,cAAcS,CAAU,GAEzC,EAAA,MAAAE,GAAM,MAAAC,GAAM,MAAAC,GAAM,MAAAC,EAAI,IAAKJ,EAAW,OAAO,SAAS,SAAS,QAEjEK,IAAU,IAEVC,IAAUtB,EAAO,SAAS,gCAAoC,IAAAuB,EAAc,MAAMN,GAAMC,CAAI,CAAA,GAC5FM,IAAcxB,EAAO,SAAS,gCAAoC,IAAAuB,EAAc,MAAMJ,GAAMC,CAAI,CAAA;AAGtG,IAAAK,EAAA,GAAAxB,IAAOuB,EAAY,IAAIH,CAAO,QAC9BnB,IAAMoB,EAAQ,CAAC;AAAA;AAGjB,SAAAI,EAAO,MAAA;UACCC,IAAgB,MAAA;AAChB,MAAApB,EAAWK,CAAU,KAAA,CAAMT,KAC7BU,EAAYD,CAAU;AAAA;AAG1B,WAAAZ,EAAO,WAAW,mBAAmB2B,CAAgB;AAGnD,MAAA3B,EAAO,cAAc,mBAAmB2B,CAAgB;AAAA;;;;;SA9C7ChB,EAAQ;AAAA;;;;;;;;"}
@@ -1,99 +0,0 @@
1
- function i() {
2
- }
3
- function l(t, n) {
4
- for (const e in n) t[e] = n[e];
5
- return (
6
- /** @type {T & S} */
7
- t
8
- );
9
- }
10
- function _(t) {
11
- return t();
12
- }
13
- function d() {
14
- return /* @__PURE__ */ Object.create(null);
15
- }
16
- function g(t) {
17
- t.forEach(_);
18
- }
19
- function y(t) {
20
- return typeof t == "function";
21
- }
22
- function h(t, n) {
23
- return t != t ? n == n : t !== n || t && typeof t == "object" || typeof t == "function";
24
- }
25
- function x(t) {
26
- return Object.keys(t).length === 0;
27
- }
28
- function b(t, ...n) {
29
- if (t == null) {
30
- for (const r of n)
31
- r(void 0);
32
- return i;
33
- }
34
- const e = t.subscribe(...n);
35
- return e.unsubscribe ? () => e.unsubscribe() : e;
36
- }
37
- function a(t, n, e) {
38
- t.$$.on_destroy.push(b(n, e));
39
- }
40
- function p(t, n, e, r) {
41
- if (t) {
42
- const u = s(t, n, e, r);
43
- return t[0](u);
44
- }
45
- }
46
- function s(t, n, e, r) {
47
- return t[1] && r ? l(e.ctx.slice(), t[1](r(n))) : e.ctx;
48
- }
49
- function j(t, n, e, r) {
50
- if (t[2] && r) {
51
- const u = t[2](r(e));
52
- if (n.dirty === void 0)
53
- return u;
54
- if (typeof u == "object") {
55
- const c = [], f = Math.max(n.dirty.length, u.length);
56
- for (let o = 0; o < f; o += 1)
57
- c[o] = n.dirty[o] | u[o];
58
- return c;
59
- }
60
- return n.dirty | u;
61
- }
62
- return n.dirty;
63
- }
64
- function m(t, n, e, r, u, c) {
65
- if (u) {
66
- const f = s(n, e, r, c);
67
- t.p(f, u);
68
- }
69
- }
70
- function k(t) {
71
- if (t.ctx.length > 32) {
72
- const n = [], e = t.ctx.length / 32;
73
- for (let r = 0; r < e; r++)
74
- n[r] = -1;
75
- return n;
76
- }
77
- return -1;
78
- }
79
- function O(t) {
80
- return t && y(t.destroy) ? t.destroy : i;
81
- }
82
- export {
83
- O as action_destroyer,
84
- l as assign,
85
- d as blank_object,
86
- a as component_subscribe,
87
- p as create_slot,
88
- k as get_all_dirty_from_scope,
89
- j as get_slot_changes,
90
- x as is_empty,
91
- y as is_function,
92
- i as noop,
93
- _ as run,
94
- g as run_all,
95
- h as safe_not_equal,
96
- b as subscribe,
97
- m as update_slot_base
98
- };
99
- //# sourceMappingURL=annotorious-svelte.es5.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"annotorious-svelte.es5.js","sources":["../../../node_modules/svelte/src/runtime/internal/utils.js"],"sourcesContent":["/** @returns {void} */\nexport function noop() {}\n\nexport const identity = (x) => x;\n\n/**\n * @template T\n * @template S\n * @param {T} tar\n * @param {S} src\n * @returns {T & S}\n */\nexport function assign(tar, src) {\n\t// @ts-ignore\n\tfor (const k in src) tar[k] = src[k];\n\treturn /** @type {T & S} */ (tar);\n}\n\n// Adapted from https://github.com/then/is-promise/blob/master/index.js\n// Distributed under MIT License https://github.com/then/is-promise/blob/master/LICENSE\n/**\n * @param {any} value\n * @returns {value is PromiseLike<any>}\n */\nexport function is_promise(value) {\n\treturn (\n\t\t!!value &&\n\t\t(typeof value === 'object' || typeof value === 'function') &&\n\t\ttypeof (/** @type {any} */ (value).then) === 'function'\n\t);\n}\n\n/** @returns {void} */\nexport function add_location(element, file, line, column, char) {\n\telement.__svelte_meta = {\n\t\tloc: { file, line, column, char }\n\t};\n}\n\nexport function run(fn) {\n\treturn fn();\n}\n\nexport function blank_object() {\n\treturn Object.create(null);\n}\n\n/**\n * @param {Function[]} fns\n * @returns {void}\n */\nexport function run_all(fns) {\n\tfns.forEach(run);\n}\n\n/**\n * @param {any} thing\n * @returns {thing is Function}\n */\nexport function is_function(thing) {\n\treturn typeof thing === 'function';\n}\n\n/** @returns {boolean} */\nexport function safe_not_equal(a, b) {\n\treturn a != a ? b == b : a !== b || (a && typeof a === 'object') || typeof a === 'function';\n}\n\nlet src_url_equal_anchor;\n\n/**\n * @param {string} element_src\n * @param {string} url\n * @returns {boolean}\n */\nexport function src_url_equal(element_src, url) {\n\tif (element_src === url) return true;\n\tif (!src_url_equal_anchor) {\n\t\tsrc_url_equal_anchor = document.createElement('a');\n\t}\n\t// This is actually faster than doing URL(..).href\n\tsrc_url_equal_anchor.href = url;\n\treturn element_src === src_url_equal_anchor.href;\n}\n\n/** @param {string} srcset */\nfunction split_srcset(srcset) {\n\treturn srcset.split(',').map((src) => src.trim().split(' ').filter(Boolean));\n}\n\n/**\n * @param {HTMLSourceElement | HTMLImageElement} element_srcset\n * @param {string | undefined | null} srcset\n * @returns {boolean}\n */\nexport function srcset_url_equal(element_srcset, srcset) {\n\tconst element_urls = split_srcset(element_srcset.srcset);\n\tconst urls = split_srcset(srcset || '');\n\n\treturn (\n\t\turls.length === element_urls.length &&\n\t\turls.every(\n\t\t\t([url, width], i) =>\n\t\t\t\twidth === element_urls[i][1] &&\n\t\t\t\t// We need to test both ways because Vite will create an a full URL with\n\t\t\t\t// `new URL(asset, import.meta.url).href` for the client when `base: './'`, and the\n\t\t\t\t// relative URLs inside srcset are not automatically resolved to absolute URLs by\n\t\t\t\t// browsers (in contrast to img.src). This means both SSR and DOM code could\n\t\t\t\t// contain relative or absolute URLs.\n\t\t\t\t(src_url_equal(element_urls[i][0], url) || src_url_equal(url, element_urls[i][0]))\n\t\t)\n\t);\n}\n\n/** @returns {boolean} */\nexport function not_equal(a, b) {\n\treturn a != a ? b == b : a !== b;\n}\n\n/** @returns {boolean} */\nexport function is_empty(obj) {\n\treturn Object.keys(obj).length === 0;\n}\n\n/** @returns {void} */\nexport function validate_store(store, name) {\n\tif (store != null && typeof store.subscribe !== 'function') {\n\t\tthrow new Error(`'${name}' is not a store with a 'subscribe' method`);\n\t}\n}\n\nexport function subscribe(store, ...callbacks) {\n\tif (store == null) {\n\t\tfor (const callback of callbacks) {\n\t\t\tcallback(undefined);\n\t\t}\n\t\treturn noop;\n\t}\n\tconst unsub = store.subscribe(...callbacks);\n\treturn unsub.unsubscribe ? () => unsub.unsubscribe() : unsub;\n}\n\n/**\n * Get the current value from a store by subscribing and immediately unsubscribing.\n *\n * https://svelte.dev/docs/svelte-store#get\n * @template T\n * @param {import('../store/public.js').Readable<T>} store\n * @returns {T}\n */\nexport function get_store_value(store) {\n\tlet value;\n\tsubscribe(store, (_) => (value = _))();\n\treturn value;\n}\n\n/** @returns {void} */\nexport function component_subscribe(component, store, callback) {\n\tcomponent.$$.on_destroy.push(subscribe(store, callback));\n}\n\nexport function create_slot(definition, ctx, $$scope, fn) {\n\tif (definition) {\n\t\tconst slot_ctx = get_slot_context(definition, ctx, $$scope, fn);\n\t\treturn definition[0](slot_ctx);\n\t}\n}\n\nfunction get_slot_context(definition, ctx, $$scope, fn) {\n\treturn definition[1] && fn ? assign($$scope.ctx.slice(), definition[1](fn(ctx))) : $$scope.ctx;\n}\n\nexport function get_slot_changes(definition, $$scope, dirty, fn) {\n\tif (definition[2] && fn) {\n\t\tconst lets = definition[2](fn(dirty));\n\t\tif ($$scope.dirty === undefined) {\n\t\t\treturn lets;\n\t\t}\n\t\tif (typeof lets === 'object') {\n\t\t\tconst merged = [];\n\t\t\tconst len = Math.max($$scope.dirty.length, lets.length);\n\t\t\tfor (let i = 0; i < len; i += 1) {\n\t\t\t\tmerged[i] = $$scope.dirty[i] | lets[i];\n\t\t\t}\n\t\t\treturn merged;\n\t\t}\n\t\treturn $$scope.dirty | lets;\n\t}\n\treturn $$scope.dirty;\n}\n\n/** @returns {void} */\nexport function update_slot_base(\n\tslot,\n\tslot_definition,\n\tctx,\n\t$$scope,\n\tslot_changes,\n\tget_slot_context_fn\n) {\n\tif (slot_changes) {\n\t\tconst slot_context = get_slot_context(slot_definition, ctx, $$scope, get_slot_context_fn);\n\t\tslot.p(slot_context, slot_changes);\n\t}\n}\n\n/** @returns {void} */\nexport function update_slot(\n\tslot,\n\tslot_definition,\n\tctx,\n\t$$scope,\n\tdirty,\n\tget_slot_changes_fn,\n\tget_slot_context_fn\n) {\n\tconst slot_changes = get_slot_changes(slot_definition, $$scope, dirty, get_slot_changes_fn);\n\tupdate_slot_base(slot, slot_definition, ctx, $$scope, slot_changes, get_slot_context_fn);\n}\n\n/** @returns {any[] | -1} */\nexport function get_all_dirty_from_scope($$scope) {\n\tif ($$scope.ctx.length > 32) {\n\t\tconst dirty = [];\n\t\tconst length = $$scope.ctx.length / 32;\n\t\tfor (let i = 0; i < length; i++) {\n\t\t\tdirty[i] = -1;\n\t\t}\n\t\treturn dirty;\n\t}\n\treturn -1;\n}\n\n/** @returns {{}} */\nexport function exclude_internal_props(props) {\n\tconst result = {};\n\tfor (const k in props) if (k[0] !== '$') result[k] = props[k];\n\treturn result;\n}\n\n/** @returns {{}} */\nexport function compute_rest_props(props, keys) {\n\tconst rest = {};\n\tkeys = new Set(keys);\n\tfor (const k in props) if (!keys.has(k) && k[0] !== '$') rest[k] = props[k];\n\treturn rest;\n}\n\n/** @returns {{}} */\nexport function compute_slots(slots) {\n\tconst result = {};\n\tfor (const key in slots) {\n\t\tresult[key] = true;\n\t}\n\treturn result;\n}\n\n/** @returns {(this: any, ...args: any[]) => void} */\nexport function once(fn) {\n\tlet ran = false;\n\treturn function (...args) {\n\t\tif (ran) return;\n\t\tran = true;\n\t\tfn.call(this, ...args);\n\t};\n}\n\nexport function null_to_empty(value) {\n\treturn value == null ? '' : value;\n}\n\nexport function set_store_value(store, ret, value) {\n\tstore.set(value);\n\treturn ret;\n}\n\nexport const has_prop = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);\n\nexport function action_destroyer(action_result) {\n\treturn action_result && is_function(action_result.destroy) ? action_result.destroy : noop;\n}\n\n/** @param {number | string} value\n * @returns {[number, string]}\n */\nexport function split_css_unit(value) {\n\tconst split = typeof value === 'string' && value.match(/^\\s*(-?[\\d.]+)([^\\s]*)\\s*$/);\n\treturn split ? [parseFloat(split[1]), split[2] || 'px'] : [/** @type {number} */ (value), 'px'];\n}\n\nexport const contenteditable_truthy_values = ['', true, 1, 'true', 'contenteditable'];\n"],"names":["noop","assign","tar","src","k","run","fn","blank_object","run_all","fns","is_function","thing","safe_not_equal","a","b","is_empty","obj","subscribe","store","callbacks","callback","unsub","component_subscribe","component","create_slot","definition","ctx","$$scope","slot_ctx","get_slot_context","get_slot_changes","dirty","lets","merged","len","i","update_slot_base","slot","slot_definition","slot_changes","get_slot_context_fn","slot_context","get_all_dirty_from_scope","length","action_destroyer","action_result"],"mappings":"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","x_google_ignoreList":[0]}
@@ -1,44 +0,0 @@
1
- function u(e, t) {
2
- e.appendChild(t);
3
- }
4
- function c(e, t, n) {
5
- e.insertBefore(t, n || null);
6
- }
7
- function f(e) {
8
- e.parentNode && e.parentNode.removeChild(e);
9
- }
10
- function o(e) {
11
- return document.createElement(e);
12
- }
13
- function i(e) {
14
- return document.createTextNode(e);
15
- }
16
- function d() {
17
- return i("");
18
- }
19
- function l(e, t, n, r) {
20
- return e.addEventListener(t, n, r), () => e.removeEventListener(t, n, r);
21
- }
22
- function m(e, t, n) {
23
- n == null ? e.removeAttribute(t) : e.getAttribute(t) !== n && e.setAttribute(t, n);
24
- }
25
- function s(e) {
26
- return Array.from(e.childNodes);
27
- }
28
- function p(e, t) {
29
- t = "" + t, e.data !== t && (e.data = /** @type {string} */
30
- t);
31
- }
32
- export {
33
- u as append,
34
- m as attr,
35
- s as children,
36
- f as detach,
37
- o as element,
38
- d as empty,
39
- c as insert,
40
- l as listen,
41
- p as set_data,
42
- i as text
43
- };
44
- //# sourceMappingURL=annotorious-svelte.es6.js.map