@annotorious/svelte 3.0.0-rc.15 → 3.0.0-rc.17

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 (35) hide show
  1. package/dist/annotorious-svelte.es.js.map +1 -1
  2. package/dist/annotorious-svelte.es10.js +114 -0
  3. package/dist/annotorious-svelte.es10.js.map +1 -0
  4. package/dist/annotorious-svelte.es11.js +3 -0
  5. package/dist/annotorious-svelte.es11.js.map +1 -0
  6. package/dist/annotorious-svelte.es12.js +5 -0
  7. package/dist/annotorious-svelte.es12.js.map +1 -0
  8. package/dist/annotorious-svelte.es13.js +123 -0
  9. package/dist/annotorious-svelte.es13.js.map +1 -0
  10. package/dist/annotorious-svelte.es14.js +2 -0
  11. package/dist/annotorious-svelte.es14.js.map +1 -0
  12. package/dist/annotorious-svelte.es15.js +59 -0
  13. package/dist/annotorious-svelte.es15.js.map +1 -0
  14. package/dist/annotorious-svelte.es2.js +30 -25
  15. package/dist/annotorious-svelte.es2.js.map +1 -1
  16. package/dist/annotorious-svelte.es3.js +13 -13
  17. package/dist/annotorious-svelte.es3.js.map +1 -1
  18. package/dist/annotorious-svelte.es4.js +58 -53
  19. package/dist/annotorious-svelte.es4.js.map +1 -1
  20. package/dist/annotorious-svelte.es5.js +43 -39
  21. package/dist/annotorious-svelte.es5.js.map +1 -1
  22. package/dist/annotorious-svelte.es6.js +56 -272
  23. package/dist/annotorious-svelte.es6.js.map +1 -1
  24. package/dist/annotorious-svelte.es7.js +40 -119
  25. package/dist/annotorious-svelte.es7.js.map +1 -1
  26. package/dist/annotorious-svelte.es8.js +31 -2
  27. package/dist/annotorious-svelte.es8.js.map +1 -1
  28. package/dist/annotorious-svelte.es9.js +27 -0
  29. package/dist/annotorious-svelte.es9.js.map +1 -0
  30. package/dist/index.d.ts +2 -2
  31. package/dist/index.d.ts.map +1 -1
  32. package/package.json +9 -9
  33. package/src/index.ts +2 -3
  34. package/vite.config.js +1 -0
  35. /package/dist/{style.css → annotorious-svelte.css} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"annotorious-svelte.es.js","sources":["../src/index.ts"],"sourcesContent":["export * from './osd';\n\nexport { default as MouseOverTooltip } from './MouseOverTooltip.svelte';\n\n// Essential re-exports from @annotorious/core\nexport type {\n Annotation,\n AnnotationBody,\n AnnotationTarget,\n Annotator,\n AnnotatorState,\n Appearance,\n AppearanceProvider,\n Color,\n DrawingStyle,\n Filter,\n FormatAdapter,\n HoverState,\n LifecycleEvents,\n ParseResult,\n PresentUser,\n Purpose,\n Selection,\n SelectionState,\n Store,\n StoreChangeEvent,\n StoreObserver,\n SvelteAnnotator,\n SvelteAnnotatorState,\n User,\n W3CAnnotation,\n W3CAnnotationBody,\n W3CAnnotationTarget,\n W3CSelector\n} from '@annotorious/core';\n\nimport {\n createAnonymousGuest as _createAnonymousGuest, \n createBody as _createBody,\n defaultColorProvider as _defaultColorProvider,\n Origin as _Origin,\n PointerSelectAction as _PointerSelectAction\n} from '@annotorious/core';\n\nexport { _createAnonymousGuest as createAnonymousGuest };\nexport { _createBody as createBody };\nexport { _defaultColorProvider as defaultColorProvider };\nexport { _Origin as Origin };\nexport { _PointerSelectAction as PointerSelectAction };\n\n// Essential re-exports from @annotorious/annotorious \nexport type {\n AnnotoriousOpts,\n DrawingMode,\n DrawingTool,\n ImageAnnotator as AnnotoriousImageAnnotator,\n ImageAnnotation,\n ImageAnnotator,\n ImageAnnotatorState,\n Polygon,\n PolygonGeometry,\n Rectangle,\n RectangleGeometry,\n Shape\n} from '@annotorious/annotorious';\n\nimport { \n createImageAnnotator as _createImageAnnotator,\n ShapeType as _ShapeType,\n W3CImageFormat as _W3CImageFormat\n} from '@annotorious/annotorious';\n\nexport const createImageAnnotator = _createImageAnnotator;\nexport const ShapeType = _ShapeType;\nexport const W3CImageFormat = _W3CImageFormat;\n\n// Essential re-exports from @annotorious/openseadragon \nexport type {\n OpenSeadragonAnnotator as AnnotoriousOpenSeadragonAnnotator\n} from '@annotorious/openseadragon';\n\nexport type { Viewer } from 'openseadragon';"],"names":["createImageAnnotator","_createImageAnnotator","ShapeType","_ShapeType","W3CImageFormat","_W3CImageFormat"],"mappings":";;;;;AAwEO,MAAMA,IAAuBC,GACvBC,IAAYC,GACZC,IAAiBC;"}
1
+ {"version":3,"file":"annotorious-svelte.es.js","sources":["../src/index.ts"],"sourcesContent":["export * from './osd';\n\nexport { default as MouseOverTooltip } from './MouseOverTooltip.svelte';\n\n// Essential re-exports from @annotorious/core\nexport type {\n Annotation,\n AnnotationBody,\n AnnotationTarget,\n Annotator,\n AnnotatorState,\n Appearance,\n AppearanceProvider,\n Color,\n DrawingStyle,\n Filter,\n FormatAdapter,\n HoverState,\n LifecycleEvents,\n ParseResult,\n PresentUser,\n Purpose,\n Selection,\n SelectionState,\n Store,\n StoreChangeEvent,\n StoreObserver,\n SvelteAnnotator,\n SvelteAnnotatorState,\n User,\n W3CAnnotation,\n W3CAnnotationBody,\n W3CAnnotationTarget\n} from '@annotorious/core';\n\nimport {\n createAnonymousGuest as _createAnonymousGuest, \n createBody as _createBody,\n defaultColorProvider as _defaultColorProvider,\n Origin as _Origin,\n PointerSelectAction as _PointerSelectAction\n} from '@annotorious/core';\n\nexport { _createAnonymousGuest as createAnonymousGuest };\nexport { _createBody as createBody };\nexport { _defaultColorProvider as defaultColorProvider };\nexport { _Origin as Origin };\nexport { _PointerSelectAction as PointerSelectAction };\n\n// Essential re-exports from @annotorious/annotorious \nexport type {\n AnnotoriousOpts,\n DrawingMode,\n DrawingTool,\n ImageAnnotator as AnnotoriousImageAnnotator,\n ImageAnnotation,\n ImageAnnotator,\n ImageAnnotatorState,\n Polygon,\n PolygonGeometry,\n Rectangle,\n RectangleGeometry,\n Shape\n} from '@annotorious/annotorious';\n\nimport { \n createImageAnnotator as _createImageAnnotator,\n ShapeType as _ShapeType,\n W3CImageFormat as _W3CImageFormat\n} from '@annotorious/annotorious';\n\nexport const createImageAnnotator = _createImageAnnotator;\nexport const ShapeType = _ShapeType;\nexport const W3CImageFormat = _W3CImageFormat;\n\n// Essential re-exports from @annotorious/openseadragon \nexport type {\n OpenSeadragonAnnotator as AnnotoriousOpenSeadragonAnnotator\n} from '@annotorious/openseadragon';\n\nexport type { Viewer } from 'openseadragon';\n"],"names":["createImageAnnotator","_createImageAnnotator","ShapeType","_ShapeType","W3CImageFormat","_W3CImageFormat"],"mappings":";;;;;AAuEO,MAAMA,IAAuBC,GACvBC,IAAYC,GACZC,IAAiBC;"}
@@ -0,0 +1,114 @@
1
+ var k = Object.defineProperty;
2
+ var v = (e, t, r) => t in e ? k(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
+ var d = (e, t, r) => (v(e, typeof t != "symbol" ? t + "" : t, r), r);
4
+ import { flush as w, add_render_callback as g, flush_render_callbacks as E, dirty_components as j, schedule_update as C } from "./annotorious-svelte.es15.js";
5
+ import { current_component as M, set_current_component as b } from "./annotorious-svelte.es9.js";
6
+ import { noop as u, blank_object as y, run_all as i, is_function as x, is_empty as O, run as S } from "./annotorious-svelte.es6.js";
7
+ import { children as z, detach as A } from "./annotorious-svelte.es7.js";
8
+ import { transition_in as B } from "./annotorious-svelte.es8.js";
9
+ function D(e, t, r) {
10
+ const { fragment: f, after_update: o } = e.$$;
11
+ f && f.m(t, r), g(() => {
12
+ const $ = e.$$.on_mount.map(S).filter(x);
13
+ e.$$.on_destroy ? e.$$.on_destroy.push(...$) : i($), e.$$.on_mount = [];
14
+ }), o.forEach(g);
15
+ }
16
+ function F(e, t) {
17
+ const r = e.$$;
18
+ r.fragment !== null && (E(r.after_update), i(r.on_destroy), r.fragment && r.fragment.d(t), r.on_destroy = r.fragment = null, r.ctx = []);
19
+ }
20
+ function G(e, t) {
21
+ e.$$.dirty[0] === -1 && (j.push(e), C(), e.$$.dirty.fill(0)), e.$$.dirty[t / 31 | 0] |= 1 << t % 31;
22
+ }
23
+ function P(e, t, r, f, o, $, c = null, p = [-1]) {
24
+ const s = M;
25
+ b(e);
26
+ const n = e.$$ = {
27
+ fragment: null,
28
+ ctx: [],
29
+ // state
30
+ props: $,
31
+ update: u,
32
+ not_equal: o,
33
+ bound: y(),
34
+ // lifecycle
35
+ on_mount: [],
36
+ on_destroy: [],
37
+ on_disconnect: [],
38
+ before_update: [],
39
+ after_update: [],
40
+ context: new Map(t.context || (s ? s.$$.context : [])),
41
+ // everything else
42
+ callbacks: y(),
43
+ dirty: p,
44
+ skip_bound: !1,
45
+ root: t.target || s.$$.root
46
+ };
47
+ c && c(n.root);
48
+ let l = !1;
49
+ if (n.ctx = r ? r(e, t.props || {}, (a, _, ...m) => {
50
+ const h = m.length ? m[0] : _;
51
+ return n.ctx && o(n.ctx[a], n.ctx[a] = h) && (!n.skip_bound && n.bound[a] && n.bound[a](h), l && G(e, a)), _;
52
+ }) : [], n.update(), l = !0, i(n.before_update), n.fragment = f ? f(n.ctx) : !1, t.target) {
53
+ if (t.hydrate) {
54
+ const a = z(t.target);
55
+ n.fragment && n.fragment.l(a), a.forEach(A);
56
+ } else
57
+ n.fragment && n.fragment.c();
58
+ t.intro && B(e.$$.fragment), D(e, t.target, t.anchor), w();
59
+ }
60
+ b(s);
61
+ }
62
+ class Q {
63
+ constructor() {
64
+ /**
65
+ * ### PRIVATE API
66
+ *
67
+ * Do not use, may change at any time
68
+ *
69
+ * @type {any}
70
+ */
71
+ d(this, "$$");
72
+ /**
73
+ * ### PRIVATE API
74
+ *
75
+ * Do not use, may change at any time
76
+ *
77
+ * @type {any}
78
+ */
79
+ d(this, "$$set");
80
+ }
81
+ /** @returns {void} */
82
+ $destroy() {
83
+ F(this, 1), this.$destroy = u;
84
+ }
85
+ /**
86
+ * @template {Extract<keyof Events, string>} K
87
+ * @param {K} type
88
+ * @param {((e: Events[K]) => void) | null | undefined} callback
89
+ * @returns {() => void}
90
+ */
91
+ $on(t, r) {
92
+ if (!x(r))
93
+ return u;
94
+ const f = this.$$.callbacks[t] || (this.$$.callbacks[t] = []);
95
+ return f.push(r), () => {
96
+ const o = f.indexOf(r);
97
+ o !== -1 && f.splice(o, 1);
98
+ };
99
+ }
100
+ /**
101
+ * @param {Partial<Props>} props
102
+ * @returns {void}
103
+ */
104
+ $set(t) {
105
+ this.$$set && !O(t) && (this.$$.skip_bound = !0, this.$$set(t), this.$$.skip_bound = !1);
106
+ }
107
+ }
108
+ export {
109
+ Q as SvelteComponent,
110
+ F as destroy_component,
111
+ P as init,
112
+ D as mount_component
113
+ };
114
+ //# sourceMappingURL=annotorious-svelte.es10.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"annotorious-svelte.es10.js","sources":["../../../node_modules/svelte/src/runtime/internal/Component.js"],"sourcesContent":["import {\n\tadd_render_callback,\n\tflush,\n\tflush_render_callbacks,\n\tschedule_update,\n\tdirty_components\n} from './scheduler.js';\nimport { current_component, set_current_component } from './lifecycle.js';\nimport { blank_object, is_empty, is_function, run, run_all, noop } from './utils.js';\nimport {\n\tchildren,\n\tdetach,\n\tstart_hydrating,\n\tend_hydrating,\n\tget_custom_elements_slots,\n\tinsert,\n\telement,\n\tattr\n} from './dom.js';\nimport { transition_in } from './transitions.js';\n\n/** @returns {void} */\nexport function bind(component, name, callback) {\n\tconst index = component.$$.props[name];\n\tif (index !== undefined) {\n\t\tcomponent.$$.bound[index] = callback;\n\t\tcallback(component.$$.ctx[index]);\n\t}\n}\n\n/** @returns {void} */\nexport function create_component(block) {\n\tblock && block.c();\n}\n\n/** @returns {void} */\nexport function claim_component(block, parent_nodes) {\n\tblock && block.l(parent_nodes);\n}\n\n/** @returns {void} */\nexport function mount_component(component, target, anchor) {\n\tconst { fragment, after_update } = component.$$;\n\tfragment && fragment.m(target, anchor);\n\t// onMount happens before the initial afterUpdate\n\tadd_render_callback(() => {\n\t\tconst new_on_destroy = component.$$.on_mount.map(run).filter(is_function);\n\t\t// if the component was destroyed immediately\n\t\t// it will update the `$$.on_destroy` reference to `null`.\n\t\t// the destructured on_destroy may still reference to the old array\n\t\tif (component.$$.on_destroy) {\n\t\t\tcomponent.$$.on_destroy.push(...new_on_destroy);\n\t\t} else {\n\t\t\t// Edge case - component was destroyed immediately,\n\t\t\t// most likely as a result of a binding initialising\n\t\t\trun_all(new_on_destroy);\n\t\t}\n\t\tcomponent.$$.on_mount = [];\n\t});\n\tafter_update.forEach(add_render_callback);\n}\n\n/** @returns {void} */\nexport function destroy_component(component, detaching) {\n\tconst $$ = component.$$;\n\tif ($$.fragment !== null) {\n\t\tflush_render_callbacks($$.after_update);\n\t\trun_all($$.on_destroy);\n\t\t$$.fragment && $$.fragment.d(detaching);\n\t\t// TODO null out other refs, including component.$$ (but need to\n\t\t// preserve final state?)\n\t\t$$.on_destroy = $$.fragment = null;\n\t\t$$.ctx = [];\n\t}\n}\n\n/** @returns {void} */\nfunction make_dirty(component, i) {\n\tif (component.$$.dirty[0] === -1) {\n\t\tdirty_components.push(component);\n\t\tschedule_update();\n\t\tcomponent.$$.dirty.fill(0);\n\t}\n\tcomponent.$$.dirty[(i / 31) | 0] |= 1 << i % 31;\n}\n\n// TODO: Document the other params\n/**\n * @param {SvelteComponent} component\n * @param {import('./public.js').ComponentConstructorOptions} options\n *\n * @param {import('./utils.js')['not_equal']} not_equal Used to compare props and state values.\n * @param {(target: Element | ShadowRoot) => void} [append_styles] Function that appends styles to the DOM when the component is first initialised.\n * This will be the `add_css` function from the compiled component.\n *\n * @returns {void}\n */\nexport function init(\n\tcomponent,\n\toptions,\n\tinstance,\n\tcreate_fragment,\n\tnot_equal,\n\tprops,\n\tappend_styles = null,\n\tdirty = [-1]\n) {\n\tconst parent_component = current_component;\n\tset_current_component(component);\n\t/** @type {import('./private.js').T$$} */\n\tconst $$ = (component.$$ = {\n\t\tfragment: null,\n\t\tctx: [],\n\t\t// state\n\t\tprops,\n\t\tupdate: noop,\n\t\tnot_equal,\n\t\tbound: blank_object(),\n\t\t// lifecycle\n\t\ton_mount: [],\n\t\ton_destroy: [],\n\t\ton_disconnect: [],\n\t\tbefore_update: [],\n\t\tafter_update: [],\n\t\tcontext: new Map(options.context || (parent_component ? parent_component.$$.context : [])),\n\t\t// everything else\n\t\tcallbacks: blank_object(),\n\t\tdirty,\n\t\tskip_bound: false,\n\t\troot: options.target || parent_component.$$.root\n\t});\n\tappend_styles && append_styles($$.root);\n\tlet ready = false;\n\t$$.ctx = instance\n\t\t? instance(component, options.props || {}, (i, ret, ...rest) => {\n\t\t\t\tconst value = rest.length ? rest[0] : ret;\n\t\t\t\tif ($$.ctx && not_equal($$.ctx[i], ($$.ctx[i] = value))) {\n\t\t\t\t\tif (!$$.skip_bound && $$.bound[i]) $$.bound[i](value);\n\t\t\t\t\tif (ready) make_dirty(component, i);\n\t\t\t\t}\n\t\t\t\treturn ret;\n\t\t })\n\t\t: [];\n\t$$.update();\n\tready = true;\n\trun_all($$.before_update);\n\t// `false` as a special case of no DOM component\n\t$$.fragment = create_fragment ? create_fragment($$.ctx) : false;\n\tif (options.target) {\n\t\tif (options.hydrate) {\n\t\t\tstart_hydrating();\n\t\t\t// TODO: what is the correct type here?\n\t\t\t// @ts-expect-error\n\t\t\tconst nodes = children(options.target);\n\t\t\t$$.fragment && $$.fragment.l(nodes);\n\t\t\tnodes.forEach(detach);\n\t\t} else {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t$$.fragment && $$.fragment.c();\n\t\t}\n\t\tif (options.intro) transition_in(component.$$.fragment);\n\t\tmount_component(component, options.target, options.anchor);\n\t\tend_hydrating();\n\t\tflush();\n\t}\n\tset_current_component(parent_component);\n}\n\nexport let SvelteElement;\n\nif (typeof HTMLElement === 'function') {\n\tSvelteElement = class extends HTMLElement {\n\t\t/** The Svelte component constructor */\n\t\t$$ctor;\n\t\t/** Slots */\n\t\t$$s;\n\t\t/** The Svelte component instance */\n\t\t$$c;\n\t\t/** Whether or not the custom element is connected */\n\t\t$$cn = false;\n\t\t/** Component props data */\n\t\t$$d = {};\n\t\t/** `true` if currently in the process of reflecting component props back to attributes */\n\t\t$$r = false;\n\t\t/** @type {Record<string, CustomElementPropDefinition>} Props definition (name, reflected, type etc) */\n\t\t$$p_d = {};\n\t\t/** @type {Record<string, Function[]>} Event listeners */\n\t\t$$l = {};\n\t\t/** @type {Map<Function, Function>} Event listener unsubscribe functions */\n\t\t$$l_u = new Map();\n\n\t\tconstructor($$componentCtor, $$slots, use_shadow_dom) {\n\t\t\tsuper();\n\t\t\tthis.$$ctor = $$componentCtor;\n\t\t\tthis.$$s = $$slots;\n\t\t\tif (use_shadow_dom) {\n\t\t\t\tthis.attachShadow({ mode: 'open' });\n\t\t\t}\n\t\t}\n\n\t\taddEventListener(type, listener, options) {\n\t\t\t// We can't determine upfront if the event is a custom event or not, so we have to\n\t\t\t// listen to both. If someone uses a custom event with the same name as a regular\n\t\t\t// browser event, this fires twice - we can't avoid that.\n\t\t\tthis.$$l[type] = this.$$l[type] || [];\n\t\t\tthis.$$l[type].push(listener);\n\t\t\tif (this.$$c) {\n\t\t\t\tconst unsub = this.$$c.$on(type, listener);\n\t\t\t\tthis.$$l_u.set(listener, unsub);\n\t\t\t}\n\t\t\tsuper.addEventListener(type, listener, options);\n\t\t}\n\n\t\tremoveEventListener(type, listener, options) {\n\t\t\tsuper.removeEventListener(type, listener, options);\n\t\t\tif (this.$$c) {\n\t\t\t\tconst unsub = this.$$l_u.get(listener);\n\t\t\t\tif (unsub) {\n\t\t\t\t\tunsub();\n\t\t\t\t\tthis.$$l_u.delete(listener);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tasync connectedCallback() {\n\t\t\tthis.$$cn = true;\n\t\t\tif (!this.$$c) {\n\t\t\t\t// We wait one tick to let possible child slot elements be created/mounted\n\t\t\t\tawait Promise.resolve();\n\t\t\t\tif (!this.$$cn) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tfunction create_slot(name) {\n\t\t\t\t\treturn () => {\n\t\t\t\t\t\tlet node;\n\t\t\t\t\t\tconst obj = {\n\t\t\t\t\t\t\tc: function create() {\n\t\t\t\t\t\t\t\tnode = element('slot');\n\t\t\t\t\t\t\t\tif (name !== 'default') {\n\t\t\t\t\t\t\t\t\tattr(node, 'name', name);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * @param {HTMLElement} target\n\t\t\t\t\t\t\t * @param {HTMLElement} [anchor]\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tm: function mount(target, anchor) {\n\t\t\t\t\t\t\t\tinsert(target, node, anchor);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\td: function destroy(detaching) {\n\t\t\t\t\t\t\t\tif (detaching) {\n\t\t\t\t\t\t\t\t\tdetach(node);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\t\t\t\t\t\treturn obj;\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tconst $$slots = {};\n\t\t\t\tconst existing_slots = get_custom_elements_slots(this);\n\t\t\t\tfor (const name of this.$$s) {\n\t\t\t\t\tif (name in existing_slots) {\n\t\t\t\t\t\t$$slots[name] = [create_slot(name)];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor (const attribute of this.attributes) {\n\t\t\t\t\t// this.$$data takes precedence over this.attributes\n\t\t\t\t\tconst name = this.$$g_p(attribute.name);\n\t\t\t\t\tif (!(name in this.$$d)) {\n\t\t\t\t\t\tthis.$$d[name] = get_custom_element_value(name, attribute.value, this.$$p_d, 'toProp');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Port over props that were set programmatically before ce was initialized\n\t\t\t\tfor (const key in this.$$p_d) {\n\t\t\t\t\tif (!(key in this.$$d) && this[key] !== undefined) {\n\t\t\t\t\t\tthis.$$d[key] = this[key]; // don't transform, these were set through JavaScript\n\t\t\t\t\t\tdelete this[key]; // remove the property that shadows the getter/setter\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.$$c = new this.$$ctor({\n\t\t\t\t\ttarget: this.shadowRoot || this,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...this.$$d,\n\t\t\t\t\t\t$$slots,\n\t\t\t\t\t\t$$scope: {\n\t\t\t\t\t\t\tctx: []\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\t// Reflect component props as attributes\n\t\t\t\tconst reflect_attributes = () => {\n\t\t\t\t\tthis.$$r = true;\n\t\t\t\t\tfor (const key in this.$$p_d) {\n\t\t\t\t\t\tthis.$$d[key] = this.$$c.$$.ctx[this.$$c.$$.props[key]];\n\t\t\t\t\t\tif (this.$$p_d[key].reflect) {\n\t\t\t\t\t\t\tconst attribute_value = get_custom_element_value(\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\tthis.$$d[key],\n\t\t\t\t\t\t\t\tthis.$$p_d,\n\t\t\t\t\t\t\t\t'toAttribute'\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tif (attribute_value == null) {\n\t\t\t\t\t\t\t\tthis.removeAttribute(this.$$p_d[key].attribute || key);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthis.setAttribute(this.$$p_d[key].attribute || key, attribute_value);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tthis.$$r = false;\n\t\t\t\t};\n\t\t\t\tthis.$$c.$$.after_update.push(reflect_attributes);\n\t\t\t\treflect_attributes(); // once initially because after_update is added too late for first render\n\n\t\t\t\tfor (const type in this.$$l) {\n\t\t\t\t\tfor (const listener of this.$$l[type]) {\n\t\t\t\t\t\tconst unsub = this.$$c.$on(type, listener);\n\t\t\t\t\t\tthis.$$l_u.set(listener, unsub);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.$$l = {};\n\t\t\t}\n\t\t}\n\n\t\t// We don't need this when working within Svelte code, but for compatibility of people using this outside of Svelte\n\t\t// and setting attributes through setAttribute etc, this is helpful\n\t\tattributeChangedCallback(attr, _oldValue, newValue) {\n\t\t\tif (this.$$r) return;\n\t\t\tattr = this.$$g_p(attr);\n\t\t\tthis.$$d[attr] = get_custom_element_value(attr, newValue, this.$$p_d, 'toProp');\n\t\t\tthis.$$c?.$set({ [attr]: this.$$d[attr] });\n\t\t}\n\n\t\tdisconnectedCallback() {\n\t\t\tthis.$$cn = false;\n\t\t\t// In a microtask, because this could be a move within the DOM\n\t\t\tPromise.resolve().then(() => {\n\t\t\t\tif (!this.$$cn) {\n\t\t\t\t\tthis.$$c.$destroy();\n\t\t\t\t\tthis.$$c = undefined;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\t$$g_p(attribute_name) {\n\t\t\treturn (\n\t\t\t\tObject.keys(this.$$p_d).find(\n\t\t\t\t\t(key) =>\n\t\t\t\t\t\tthis.$$p_d[key].attribute === attribute_name ||\n\t\t\t\t\t\t(!this.$$p_d[key].attribute && key.toLowerCase() === attribute_name)\n\t\t\t\t) || attribute_name\n\t\t\t);\n\t\t}\n\t};\n}\n\n/**\n * @param {string} prop\n * @param {any} value\n * @param {Record<string, CustomElementPropDefinition>} props_definition\n * @param {'toAttribute' | 'toProp'} [transform]\n */\nfunction get_custom_element_value(prop, value, props_definition, transform) {\n\tconst type = props_definition[prop]?.type;\n\tvalue = type === 'Boolean' && typeof value !== 'boolean' ? value != null : value;\n\tif (!transform || !props_definition[prop]) {\n\t\treturn value;\n\t} else if (transform === 'toAttribute') {\n\t\tswitch (type) {\n\t\t\tcase 'Object':\n\t\t\tcase 'Array':\n\t\t\t\treturn value == null ? null : JSON.stringify(value);\n\t\t\tcase 'Boolean':\n\t\t\t\treturn value ? '' : null;\n\t\t\tcase 'Number':\n\t\t\t\treturn value == null ? null : value;\n\t\t\tdefault:\n\t\t\t\treturn value;\n\t\t}\n\t} else {\n\t\tswitch (type) {\n\t\t\tcase 'Object':\n\t\t\tcase 'Array':\n\t\t\t\treturn value && JSON.parse(value);\n\t\t\tcase 'Boolean':\n\t\t\t\treturn value; // conversion already handled above\n\t\t\tcase 'Number':\n\t\t\t\treturn value != null ? +value : value;\n\t\t\tdefault:\n\t\t\t\treturn value;\n\t\t}\n\t}\n}\n\n/**\n * @internal\n *\n * Turn a Svelte component into a custom element.\n * @param {import('./public.js').ComponentType} Component A Svelte component constructor\n * @param {Record<string, CustomElementPropDefinition>} props_definition The props to observe\n * @param {string[]} slots The slots to create\n * @param {string[]} accessors Other accessors besides the ones for props the component has\n * @param {boolean} use_shadow_dom Whether to use shadow DOM\n * @param {(ce: new () => HTMLElement) => new () => HTMLElement} [extend]\n */\nexport function create_custom_element(\n\tComponent,\n\tprops_definition,\n\tslots,\n\taccessors,\n\tuse_shadow_dom,\n\textend\n) {\n\tlet Class = class extends SvelteElement {\n\t\tconstructor() {\n\t\t\tsuper(Component, slots, use_shadow_dom);\n\t\t\tthis.$$p_d = props_definition;\n\t\t}\n\t\tstatic get observedAttributes() {\n\t\t\treturn Object.keys(props_definition).map((key) =>\n\t\t\t\t(props_definition[key].attribute || key).toLowerCase()\n\t\t\t);\n\t\t}\n\t};\n\tObject.keys(props_definition).forEach((prop) => {\n\t\tObject.defineProperty(Class.prototype, prop, {\n\t\t\tget() {\n\t\t\t\treturn this.$$c && prop in this.$$c ? this.$$c[prop] : this.$$d[prop];\n\t\t\t},\n\t\t\tset(value) {\n\t\t\t\tvalue = get_custom_element_value(prop, value, props_definition);\n\t\t\t\tthis.$$d[prop] = value;\n\t\t\t\tthis.$$c?.$set({ [prop]: value });\n\t\t\t}\n\t\t});\n\t});\n\taccessors.forEach((accessor) => {\n\t\tObject.defineProperty(Class.prototype, accessor, {\n\t\t\tget() {\n\t\t\t\treturn this.$$c?.[accessor];\n\t\t\t}\n\t\t});\n\t});\n\tif (extend) {\n\t\t// @ts-expect-error - assigning here is fine\n\t\tClass = extend(Class);\n\t}\n\tComponent.element = /** @type {any} */ (Class);\n\treturn Class;\n}\n\n/**\n * Base class for Svelte components. Used when dev=false.\n *\n * @template {Record<string, any>} [Props=any]\n * @template {Record<string, any>} [Events=any]\n */\nexport class SvelteComponent {\n\t/**\n\t * ### PRIVATE API\n\t *\n\t * Do not use, may change at any time\n\t *\n\t * @type {any}\n\t */\n\t$$ = undefined;\n\t/**\n\t * ### PRIVATE API\n\t *\n\t * Do not use, may change at any time\n\t *\n\t * @type {any}\n\t */\n\t$$set = undefined;\n\n\t/** @returns {void} */\n\t$destroy() {\n\t\tdestroy_component(this, 1);\n\t\tthis.$destroy = noop;\n\t}\n\n\t/**\n\t * @template {Extract<keyof Events, string>} K\n\t * @param {K} type\n\t * @param {((e: Events[K]) => void) | null | undefined} callback\n\t * @returns {() => void}\n\t */\n\t$on(type, callback) {\n\t\tif (!is_function(callback)) {\n\t\t\treturn noop;\n\t\t}\n\t\tconst callbacks = this.$$.callbacks[type] || (this.$$.callbacks[type] = []);\n\t\tcallbacks.push(callback);\n\t\treturn () => {\n\t\t\tconst index = callbacks.indexOf(callback);\n\t\t\tif (index !== -1) callbacks.splice(index, 1);\n\t\t};\n\t}\n\n\t/**\n\t * @param {Partial<Props>} props\n\t * @returns {void}\n\t */\n\t$set(props) {\n\t\tif (this.$$set && !is_empty(props)) {\n\t\t\tthis.$$.skip_bound = true;\n\t\t\tthis.$$set(props);\n\t\t\tthis.$$.skip_bound = false;\n\t\t}\n\t}\n}\n\n/**\n * @typedef {Object} CustomElementPropDefinition\n * @property {string} [attribute]\n * @property {boolean} [reflect]\n * @property {'String'|'Boolean'|'Number'|'Array'|'Object'} [type]\n */\n"],"names":["mount_component","component","target","anchor","fragment","after_update","add_render_callback","new_on_destroy","run","is_function","run_all","destroy_component","detaching","$$","flush_render_callbacks","make_dirty","i","dirty_components","schedule_update","init","options","instance","create_fragment","not_equal","props","append_styles","dirty","parent_component","current_component","set_current_component","noop","blank_object","ready","ret","rest","value","nodes","children","detach","transition_in","flush","SvelteComponent","__publicField","type","callback","callbacks","index","is_empty"],"mappings":";;;;;;;;AAyCO,SAASA,EAAgBC,GAAWC,GAAQC,GAAQ;AAC1D,QAAM,EAAE,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AQN;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAC,EAAA;AAQA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,EAAA;AAAA;AAAA;AAAA,EAGA,WAAW;AACV,IAAA/B,EAAkB,MAAM,CAAC,GACzB,KAAK,WAAWmB;AAAA,EAChB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQD,IAAIa,GAAMC,GAAU;AACnB,QAAI,CAACnC,EAAYmC,CAAQ;AACxB,aAAOd;AAER,UAAMe,IAAY,KAAK,GAAG,UAAUF,CAAI,MAAM,KAAK,GAAG,UAAUA,CAAI,IAAI,CAAE;AAC1E,WAAAE,EAAU,KAAKD,CAAQ,GAChB,MAAM;AACZ,YAAME,IAAQD,EAAU,QAAQD,CAAQ;AACxC,MAAIE,MAAU,MAAID,EAAU,OAAOC,GAAO,CAAC;AAAA,IAC9C;AAAA,EACE;AAAA;AAAA;AAAA;AAAA;AAAA,EAMD,KAAKtB,GAAO;AACX,IAAI,KAAK,SAAS,CAACuB,EAASvB,CAAK,MAChC,KAAK,GAAG,aAAa,IACrB,KAAK,MAAMA,CAAK,GAChB,KAAK,GAAG,aAAa;AAAA,EAEtB;AACF;","x_google_ignoreList":[0]}
@@ -0,0 +1,3 @@
1
+ import { PUBLIC_VERSION as e } from "./annotorious-svelte.es12.js";
2
+ typeof window < "u" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(e);
3
+ //# sourceMappingURL=annotorious-svelte.es11.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"annotorious-svelte.es11.js","sources":["../../../node_modules/svelte/src/runtime/internal/disclose-version/index.js"],"sourcesContent":["import { PUBLIC_VERSION } from '../../../shared/version.js';\n\nif (typeof window !== 'undefined')\n\t// @ts-ignore\n\t(window.__svelte || (window.__svelte = { v: new Set() })).v.add(PUBLIC_VERSION);\n"],"names":["PUBLIC_VERSION"],"mappings":";AAEI,OAAO,SAAW,QAEpB,OAAO,aAAa,OAAO,WAAW,EAAE,GAAG,oBAAI,IAAK,EAAA,IAAK,EAAE,IAAIA,CAAc;","x_google_ignoreList":[0]}
@@ -0,0 +1,5 @@
1
+ const o = "4";
2
+ export {
3
+ o as PUBLIC_VERSION
4
+ };
5
+ //# sourceMappingURL=annotorious-svelte.es12.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"annotorious-svelte.es12.js","sources":["../../../node_modules/svelte/src/shared/version.js"],"sourcesContent":["// generated during release, do not modify\n\n/**\n * The current version, as set in package.json.\n *\n * https://svelte.dev/docs/svelte-compiler#svelte-version\n * @type {string}\n */\nexport const VERSION = '4.2.8';\nexport const PUBLIC_VERSION = '4';\n"],"names":["PUBLIC_VERSION"],"mappings":"AASY,MAACA,IAAiB;","x_google_ignoreList":[0]}
@@ -0,0 +1,123 @@
1
+ var F = { dragStart: !0 }, rt = (e, s, i) => Math.min(Math.max(e, s), i), G = (e) => typeof e == "string", dt = ([e, s], i, d) => {
2
+ const u = (y, f) => f === 0 ? 0 : Math.ceil(y / f) * f;
3
+ return [u(i, e), u(d, s)];
4
+ }, ot = (e, s) => e.some((i) => s.some((d) => i.contains(d)));
5
+ function I(e, s) {
6
+ if (e === void 0)
7
+ return;
8
+ if (J(e))
9
+ return e.getBoundingClientRect();
10
+ if (typeof e == "object") {
11
+ const { top: d = 0, left: u = 0, right: y = 0, bottom: f = 0 } = e;
12
+ return { top: d, right: window.innerWidth - y, bottom: window.innerHeight - f, left: u };
13
+ }
14
+ if (e === "parent")
15
+ return s.parentNode.getBoundingClientRect();
16
+ const i = document.querySelector(e);
17
+ if (i === null)
18
+ throw new Error("The selector provided for bound doesn't exists in the document.");
19
+ return i.getBoundingClientRect();
20
+ }
21
+ var H = (e, s, i) => e.style.setProperty(s, i), J = (e) => e instanceof HTMLElement, ut = (e, s = {}) => {
22
+ let i, d, { bounds: u, axis: y = "both", gpuAcceleration: f = !0, legacyTranslate: K = !0, transform: L, applyUserSelectHack: P = !0, disabled: O = !1, ignoreMultitouch: Q = !1, recomputeBounds: x = F, grid: T, position: p, cancel: N, handle: D, defaultClass: M = "neodrag", defaultClassDragging: X = "neodrag-dragging", defaultClassDragged: S = "neodrag-dragged", defaultPosition: it = { x: 0, y: 0 }, onDragStart: at, onDrag: st, onDragEnd: lt } = s, B = !1, b = 0, w = 0, A = 0, C = 0, Y = 0, q = 0, { x: $, y: R } = p ? { x: (p == null ? void 0 : p.x) ?? 0, y: (p == null ? void 0 : p.y) ?? 0 } : it;
23
+ W($, R);
24
+ let g, v, E, k, V, Z = "", ct = !!p;
25
+ x = { ...F, ...x };
26
+ const U = document.body.style, m = e.classList;
27
+ function W(t = b, r = w) {
28
+ if (!L) {
29
+ if (K) {
30
+ let a = `${+t}px, ${+r}px`;
31
+ return H(e, "transform", f ? `translate3d(${a}, 0)` : `translate(${a})`);
32
+ }
33
+ return H(e, "translate", `${+t}px ${+r}px ${f ? "1px" : ""}`);
34
+ }
35
+ const o = L({ offsetX: t, offsetY: r, rootNode: e });
36
+ G(o) && H(e, "transform", o);
37
+ }
38
+ const j = (t, r) => {
39
+ const o = { offsetX: b, offsetY: w, rootNode: e, currentNode: V };
40
+ e.dispatchEvent(new CustomEvent(t, { detail: o })), r == null || r(o);
41
+ }, z = addEventListener;
42
+ z("pointerdown", tt, !1), z("pointerup", et, !1), z("pointermove", nt, !1), H(e, "touch-action", "none");
43
+ const _ = () => {
44
+ let t = e.offsetWidth / v.width;
45
+ return isNaN(t) && (t = 1), t;
46
+ };
47
+ function tt(t) {
48
+ if (O || t.button === 2 || Q && !t.isPrimary)
49
+ return;
50
+ if (x.dragStart && (g = I(u, e)), G(D) && G(N) && D === N)
51
+ throw new Error("`handle` selector can't be same as `cancel` selector");
52
+ if (m.add(M), E = function(n, c) {
53
+ if (!n)
54
+ return [c];
55
+ if (J(n))
56
+ return [n];
57
+ if (Array.isArray(n))
58
+ return n;
59
+ const h = c.querySelectorAll(n);
60
+ if (h === null)
61
+ throw new Error("Selector passed for `handle` option should be child of the element on which the action is applied");
62
+ return Array.from(h.values());
63
+ }(D, e), k = function(n, c) {
64
+ if (!n)
65
+ return [];
66
+ if (J(n))
67
+ return [n];
68
+ if (Array.isArray(n))
69
+ return n;
70
+ const h = c.querySelectorAll(n);
71
+ if (h === null)
72
+ throw new Error("Selector passed for `cancel` option should be child of the element on which the action is applied");
73
+ return Array.from(h.values());
74
+ }(N, e), i = /(both|x)/.test(y), d = /(both|y)/.test(y), ot(k, E))
75
+ throw new Error("Element being dragged can't be a child of the element on which `cancel` is applied");
76
+ const r = t.composedPath()[0];
77
+ if (!E.some((n) => {
78
+ var c;
79
+ return n.contains(r) || ((c = n.shadowRoot) == null ? void 0 : c.contains(r));
80
+ }) || ot(k, [r]))
81
+ return;
82
+ V = E.length === 1 ? e : E.find((n) => n.contains(r)), B = !0, v = e.getBoundingClientRect(), P && (Z = U.userSelect, U.userSelect = "none"), j("neodrag:start", at);
83
+ const { clientX: o, clientY: a } = t, l = _();
84
+ i && (A = o - $ / l), d && (C = a - R / l), g && (Y = o - v.left, q = a - v.top);
85
+ }
86
+ function et() {
87
+ B && (x.dragEnd && (g = I(u, e)), m.remove(X), m.add(S), P && (U.userSelect = Z), j("neodrag:end", lt), i && (A = b), d && (C = w), B = !1);
88
+ }
89
+ function nt(t) {
90
+ if (!B)
91
+ return;
92
+ x.drag && (g = I(u, e)), m.add(X), t.preventDefault(), v = e.getBoundingClientRect();
93
+ let r = t.clientX, o = t.clientY;
94
+ const a = _();
95
+ if (g) {
96
+ const l = { left: g.left + Y, top: g.top + q, right: g.right + Y - v.width, bottom: g.bottom + q - v.height };
97
+ r = rt(r, l.left, l.right), o = rt(o, l.top, l.bottom);
98
+ }
99
+ if (Array.isArray(T)) {
100
+ let [l, n] = T;
101
+ if (isNaN(+l) || l < 0)
102
+ throw new Error("1st argument of `grid` must be a valid positive number");
103
+ if (isNaN(+n) || n < 0)
104
+ throw new Error("2nd argument of `grid` must be a valid positive number");
105
+ let c = r - A, h = o - C;
106
+ [c, h] = dt([l / a, n / a], c, h), r = A + c, o = C + h;
107
+ }
108
+ i && (b = Math.round((r - A) * a)), d && (w = Math.round((o - C) * a)), $ = b, R = w, j("neodrag", st), W();
109
+ }
110
+ return { destroy: () => {
111
+ const t = removeEventListener;
112
+ t("pointerdown", tt, !1), t("pointerup", et, !1), t("pointermove", nt, !1);
113
+ }, update: (t) => {
114
+ var o, a;
115
+ y = t.axis || "both", O = t.disabled ?? !1, Q = t.ignoreMultitouch ?? !1, D = t.handle, u = t.bounds, x = t.recomputeBounds ?? F, N = t.cancel, P = t.applyUserSelectHack ?? !0, T = t.grid, f = t.gpuAcceleration ?? !0, K = t.legacyTranslate ?? !0, L = t.transform;
116
+ const r = m.contains(S);
117
+ m.remove(M, S), M = t.defaultClass ?? "neodrag", X = t.defaultClassDragging ?? "neodrag-dragging", S = t.defaultClassDragged ?? "neodrag-dragged", m.add(M), r && m.add(S), ct && ($ = b = ((o = t.position) == null ? void 0 : o.x) ?? b, R = w = ((a = t.position) == null ? void 0 : a.y) ?? w, W());
118
+ } };
119
+ };
120
+ export {
121
+ ut as draggable
122
+ };
123
+ //# sourceMappingURL=annotorious-svelte.es13.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"annotorious-svelte.es13.js","sources":["../../../node_modules/@neodrag/svelte/dist/min/index.js"],"sourcesContent":["var t={dragStart:!0},e=(t,e,n)=>Math.min(Math.max(t,e),n),n=t=>\"string\"==typeof t,r=([t,e],n,r)=>{const o=(t,e)=>0===e?0:Math.ceil(t/e)*e;return[o(n,t),o(r,e)]};var o=(t,e)=>t.some((t=>e.some((e=>t.contains(e)))));function i(t,e){if(void 0===t)return;if(s(t))return t.getBoundingClientRect();if(\"object\"==typeof t){const{top:e=0,left:n=0,right:r=0,bottom:o=0}=t;return{top:e,right:window.innerWidth-r,bottom:window.innerHeight-o,left:n}}if(\"parent\"===t)return e.parentNode.getBoundingClientRect();const n=document.querySelector(t);if(null===n)throw new Error(\"The selector provided for bound doesn't exists in the document.\");return n.getBoundingClientRect()}var a=(t,e,n)=>t.style.setProperty(e,n),s=t=>t instanceof HTMLElement,d=(d,l={})=>{let c,u,{bounds:f,axis:g=\"both\",gpuAcceleration:h=!0,legacyTranslate:p=!0,transform:m,applyUserSelectHack:y=!0,disabled:b=!1,ignoreMultitouch:w=!1,recomputeBounds:v=t,grid:x,position:E,cancel:S,handle:A,defaultClass:C=\"neodrag\",defaultClassDragging:N=\"neodrag-dragging\",defaultClassDragged:D=\"neodrag-dragged\",defaultPosition:M={x:0,y:0},onDragStart:B,onDrag:$,onDragEnd:R}=l,H=!1,L=0,P=0,T=0,X=0,Y=0,q=0,{x:k,y:U}=E?{x:E?.x??0,y:E?.y??0}:M;Q(k,U);let W,j,z,F,G,I=\"\",J=!!E;v={...t,...v};const K=document.body.style,O=d.classList;function Q(t=L,e=P){if(!m){if(p){let n=`${+t}px, ${+e}px`;return a(d,\"transform\",h?`translate3d(${n}, 0)`:`translate(${n})`)}return a(d,\"translate\",`${+t}px ${+e}px ${h?\"1px\":\"\"}`)}const r=m({offsetX:t,offsetY:e,rootNode:d});n(r)&&a(d,\"transform\",r)}const V=(t,e)=>{const n={offsetX:L,offsetY:P,rootNode:d,currentNode:G};d.dispatchEvent(new CustomEvent(t,{detail:n})),e?.(n)};const Z=addEventListener;Z(\"pointerdown\",tt,!1),Z(\"pointerup\",et,!1),Z(\"pointermove\",nt,!1),a(d,\"touch-action\",\"none\");const _=()=>{let t=d.offsetWidth/j.width;return isNaN(t)&&(t=1),t};function tt(t){if(b)return;if(2===t.button)return;if(w&&!t.isPrimary)return;if(v.dragStart&&(W=i(f,d)),n(A)&&n(S)&&A===S)throw new Error(\"`handle` selector can't be same as `cancel` selector\");if(O.add(C),z=function(t,e){if(!t)return[e];if(s(t))return[t];if(Array.isArray(t))return t;const n=e.querySelectorAll(t);if(null===n)throw new Error(\"Selector passed for `handle` option should be child of the element on which the action is applied\");return Array.from(n.values())}(A,d),F=function(t,e){if(!t)return[];if(s(t))return[t];if(Array.isArray(t))return t;const n=e.querySelectorAll(t);if(null===n)throw new Error(\"Selector passed for `cancel` option should be child of the element on which the action is applied\");return Array.from(n.values())}(S,d),c=/(both|x)/.test(g),u=/(both|y)/.test(g),o(F,z))throw new Error(\"Element being dragged can't be a child of the element on which `cancel` is applied\");const e=t.composedPath()[0];if(!z.some((t=>t.contains(e)||t.shadowRoot?.contains(e)))||o(F,[e]))return;G=1===z.length?d:z.find((t=>t.contains(e))),H=!0,j=d.getBoundingClientRect(),y&&(I=K.userSelect,K.userSelect=\"none\"),V(\"neodrag:start\",B);const{clientX:r,clientY:a}=t,l=_();c&&(T=r-k/l),u&&(X=a-U/l),W&&(Y=r-j.left,q=a-j.top)}function et(){H&&(v.dragEnd&&(W=i(f,d)),O.remove(N),O.add(D),y&&(K.userSelect=I),V(\"neodrag:end\",R),c&&(T=L),u&&(X=P),H=!1)}function nt(t){if(!H)return;v.drag&&(W=i(f,d)),O.add(N),t.preventDefault(),j=d.getBoundingClientRect();let n=t.clientX,o=t.clientY;const a=_();if(W){const t={left:W.left+Y,top:W.top+q,right:W.right+Y-j.width,bottom:W.bottom+q-j.height};n=e(n,t.left,t.right),o=e(o,t.top,t.bottom)}if(Array.isArray(x)){let[t,e]=x;if(isNaN(+t)||t<0)throw new Error(\"1st argument of `grid` must be a valid positive number\");if(isNaN(+e)||e<0)throw new Error(\"2nd argument of `grid` must be a valid positive number\");let i=n-T,s=o-X;[i,s]=r([t/a,e/a],i,s),n=T+i,o=X+s}c&&(L=Math.round((n-T)*a)),u&&(P=Math.round((o-X)*a)),k=L,U=P,V(\"neodrag\",$),Q()}return{destroy:()=>{const t=removeEventListener;t(\"pointerdown\",tt,!1),t(\"pointerup\",et,!1),t(\"pointermove\",nt,!1)},update:e=>{g=e.axis||\"both\",b=e.disabled??!1,w=e.ignoreMultitouch??!1,A=e.handle,f=e.bounds,v=e.recomputeBounds??t,S=e.cancel,y=e.applyUserSelectHack??!0,x=e.grid,h=e.gpuAcceleration??!0,p=e.legacyTranslate??!0,m=e.transform;const n=O.contains(D);O.remove(C,D),C=e.defaultClass??\"neodrag\",N=e.defaultClassDragging??\"neodrag-dragging\",D=e.defaultClassDragged??\"neodrag-dragged\",O.add(C),n&&O.add(D),J&&(k=L=e.position?.x??L,U=P=e.position?.y??P,Q())}}};export{d as draggable};"],"names":["t","e","n","r","o","i","s","a","d","l","c","u","f","g","h","p","m","y","b","w","v","x","E","S","A","C","N","D","M","B","$","R","H","L","P","T","X","k","U","Q","W","j","z","F","G","I","J","K","O","V","Z","_a","_b"],"mappings":"AAAA,IAAIA,IAAE,EAAC,WAAU,GAAE,GAAEC,KAAE,CAACD,GAAEC,GAAEC,MAAI,KAAK,IAAI,KAAK,IAAIF,GAAEC,CAAC,GAAEC,CAAC,GAAEA,IAAE,CAAAF,MAAa,OAAOA,KAAjB,UAAmBG,KAAE,CAAC,CAACH,GAAEC,CAAC,GAAEC,GAAEC,MAAI;AAAC,QAAMC,IAAE,CAACJ,GAAEC,MAAQA,MAAJ,IAAM,IAAE,KAAK,KAAKD,IAAEC,CAAC,IAAEA;AAAE,SAAM,CAACG,EAAEF,GAAEF,CAAC,GAAEI,EAAED,GAAEF,CAAC,CAAC;AAAC,GAAMG,KAAE,CAACJ,GAAEC,MAAID,EAAE,KAAM,CAAAA,MAAGC,EAAE,KAAM,CAAAA,MAAGD,EAAE,SAASC,CAAC,CAAC,CAAI;AAAC,SAASI,EAAEL,GAAEC,GAAE;AAAC,MAAYD,MAAT;AAAW;AAAO,MAAGM,EAAEN,CAAC;AAAE,WAAOA,EAAE,sBAAqB;AAAG,MAAa,OAAOA,KAAjB,UAAmB;AAAC,UAAK,EAAC,KAAIC,IAAE,GAAE,MAAKC,IAAE,GAAE,OAAMC,IAAE,GAAE,QAAOC,IAAE,EAAC,IAAEJ;AAAE,WAAM,EAAC,KAAIC,GAAE,OAAM,OAAO,aAAWE,GAAE,QAAO,OAAO,cAAYC,GAAE,MAAKF,EAAC;AAAA,EAAC;A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AAIvB,CAAC,GAAEvB,KAAG8C,EAAE,IAAIrB,CAAC,GAAEmB,OAAIT,IAAEJ,MAAEkB,IAAAlD,EAAE,aAAF,gBAAAkD,EAAY,MAAGlB,GAAEK,IAAEJ,MAAEkB,IAAAnD,EAAE,aAAF,gBAAAmD,EAAY,MAAGlB,GAAEK,EAAC;AAAA,EAAG,EAAC;AAAC;","x_google_ignoreList":[0]}
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=annotorious-svelte.es14.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"annotorious-svelte.es14.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,59 @@
1
+ import { run_all as i } from "./annotorious-svelte.es6.js";
2
+ import { set_current_component as a, current_component as u } from "./annotorious-svelte.es9.js";
3
+ const r = [], h = [];
4
+ let c = [];
5
+ const d = [], p = /* @__PURE__ */ Promise.resolve();
6
+ let f = !1;
7
+ function w() {
8
+ f || (f = !0, p.then(m));
9
+ }
10
+ function _(e) {
11
+ c.push(e);
12
+ }
13
+ const s = /* @__PURE__ */ new Set();
14
+ let l = 0;
15
+ function m() {
16
+ if (l !== 0)
17
+ return;
18
+ const e = u;
19
+ do {
20
+ try {
21
+ for (; l < r.length; ) {
22
+ const t = r[l];
23
+ l++, a(t), g(t.$$);
24
+ }
25
+ } catch (t) {
26
+ throw r.length = 0, l = 0, t;
27
+ }
28
+ for (a(null), r.length = 0, l = 0; h.length; )
29
+ h.pop()();
30
+ for (let t = 0; t < c.length; t += 1) {
31
+ const n = c[t];
32
+ s.has(n) || (s.add(n), n());
33
+ }
34
+ c.length = 0;
35
+ } while (r.length);
36
+ for (; d.length; )
37
+ d.pop()();
38
+ f = !1, s.clear(), a(e);
39
+ }
40
+ function g(e) {
41
+ if (e.fragment !== null) {
42
+ e.update(), i(e.before_update);
43
+ const t = e.dirty;
44
+ e.dirty = [-1], e.fragment && e.fragment.p(e.ctx, t), e.after_update.forEach(_);
45
+ }
46
+ }
47
+ function y(e) {
48
+ const t = [], n = [];
49
+ c.forEach((o) => e.indexOf(o) === -1 ? t.push(o) : n.push(o)), n.forEach((o) => o()), c = t;
50
+ }
51
+ export {
52
+ _ as add_render_callback,
53
+ h as binding_callbacks,
54
+ r as dirty_components,
55
+ m as flush,
56
+ y as flush_render_callbacks,
57
+ w as schedule_update
58
+ };
59
+ //# sourceMappingURL=annotorious-svelte.es15.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"annotorious-svelte.es15.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;AAAQ,MAAAA,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,4 +1,9 @@
1
- import { SvelteComponent as O, init as T, safe_not_equal as q, empty as w, insert as E, transition_in as u, transition_out as _, check_outros as A, detach as L, getContext as N, component_subscribe as S, onMount as X, create_slot as Y, element as j, attr as c, update_slot_base as z, get_all_dirty_from_scope as B, get_slot_changes as D, group_outros as F } from "./annotorious-svelte.es6.js";
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.es6.js";
2
+ import { empty as S, insert as E, detach as L, element as X, attr as c } from "./annotorious-svelte.es7.js";
3
+ import { transition_in as u, transition_out as p, check_outros as Y, group_outros as j } from "./annotorious-svelte.es8.js";
4
+ import { getContext as z, onMount as B } from "./annotorious-svelte.es9.js";
5
+ import { SvelteComponent as D, init as F } from "./annotorious-svelte.es10.js";
6
+ import "./annotorious-svelte.es11.js";
2
7
  const G = (o) => ({ hovered: o & /*hovered*/
3
8
  16 }), b = (o) => ({ hovered: (
4
9
  /*hovered*/
@@ -9,7 +14,7 @@ function g(o) {
9
14
  const t = (
10
15
  /*#slots*/
11
16
  o[8].default
12
- ), n = Y(
17
+ ), n = q(
13
18
  t,
14
19
  o,
15
20
  /*$$scope*/
@@ -18,7 +23,7 @@ function g(o) {
18
23
  );
19
24
  return {
20
25
  c() {
21
- r = j("div"), n && n.c(), c(r, "class", "a9s-tooltip"), c(r, "style", s = `left:${/*left*/
26
+ r = X("div"), n && n.c(), c(r, "class", "a9s-tooltip"), c(r, "style", s = `left:${/*left*/
22
27
  o[2]}px; top:${/*top*/
23
28
  o[1]}px; position: absolute;`);
24
29
  },
@@ -27,19 +32,19 @@ function g(o) {
27
32
  },
28
33
  p(i, l) {
29
34
  n && n.p && (!e || l & /*$$scope, hovered*/
30
- 144) && z(
35
+ 144) && w(
31
36
  n,
32
37
  t,
33
38
  i,
34
39
  /*$$scope*/
35
40
  i[7],
36
- e ? D(
41
+ e ? N(
37
42
  t,
38
43
  /*$$scope*/
39
44
  i[7],
40
45
  l,
41
46
  G
42
- ) : B(
47
+ ) : A(
43
48
  /*$$scope*/
44
49
  i[7]
45
50
  ),
@@ -53,7 +58,7 @@ function g(o) {
53
58
  e || (u(n, i), e = !0);
54
59
  },
55
60
  o(i) {
56
- _(n, i), e = !1;
61
+ p(n, i), e = !1;
57
62
  },
58
63
  d(i) {
59
64
  i && L(r), n && n.d(i);
@@ -68,7 +73,7 @@ function H(o) {
68
73
  );
69
74
  return {
70
75
  c() {
71
- e && e.c(), r = w();
76
+ e && e.c(), r = S();
72
77
  },
73
78
  m(t, n) {
74
79
  e && e.m(t, n), E(t, r, n), s = !0;
@@ -77,52 +82,52 @@ function H(o) {
77
82
  /*$hover*/
78
83
  t[0] && /*show*/
79
84
  t[3] ? e ? (e.p(t, n), n & /*$hover, show*/
80
- 9 && u(e, 1)) : (e = g(t), e.c(), u(e, 1), e.m(r.parentNode, r)) : e && (F(), _(e, 1, 1, () => {
85
+ 9 && u(e, 1)) : (e = g(t), e.c(), u(e, 1), e.m(r.parentNode, r)) : e && (j(), p(e, 1, 1, () => {
81
86
  e = null;
82
- }), A());
87
+ }), Y());
83
88
  },
84
89
  i(t) {
85
90
  s || (u(e), s = !0);
86
91
  },
87
92
  o(t) {
88
- _(e), s = !1;
93
+ p(e), s = !1;
89
94
  },
90
95
  d(t) {
91
- e && e.d(t), t && L(r);
96
+ t && L(r), e && e.d(t);
92
97
  }
93
98
  };
94
99
  }
95
100
  function I(o, r, s) {
96
101
  let e, t, { $$slots: n = {}, $$scope: i } = r, { container: l } = r;
97
- const k = N("anno"), { store: M, hover: p } = k.state;
98
- S(o, p, (f) => s(0, t = f));
99
- let v, d, a = !0;
100
- return X(() => {
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(() => {
101
106
  const f = () => {
102
107
  s(3, a = !0);
103
- }, m = (y) => {
108
+ }, d = (y) => {
104
109
  const { offsetX: P, offsetY: C } = y;
105
- s(2, d = P), s(1, v = C);
110
+ s(2, v = P), s(1, m = C);
106
111
  }, h = () => {
107
112
  s(3, a = !1);
108
113
  };
109
- return l.addEventListener("pointerenter", f), l.addEventListener("pointermove", m), l.addEventListener("pointerleave", h), () => {
110
- l.removeEventListener("pointerenter", f), l.removeEventListener("pointermove", m), l.removeEventListener("pointerleave", h);
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);
111
116
  };
112
117
  }), o.$$set = (f) => {
113
118
  "container" in f && s(6, l = f.container), "$$scope" in f && s(7, i = f.$$scope);
114
119
  }, o.$$.update = () => {
115
120
  o.$$.dirty & /*$hover*/
116
121
  1 && s(4, e = t ? M.getAnnotation(t) : void 0);
117
- }, [t, v, d, a, e, p, l, i, n];
122
+ }, [t, m, v, a, e, _, l, i, n];
118
123
  }
119
- class J extends O {
124
+ class J extends D {
120
125
  constructor(r) {
121
- super(), T(this, r, I, H, q, { container: 6 });
126
+ super(), F(this, r, I, H, O, { container: 6 });
122
127
  }
123
128
  }
124
- const Q = J;
129
+ const Z = J;
125
130
  export {
126
- Q as default
131
+ Z as default
127
132
  };
128
133
  //# sourceMappingURL=annotorious-svelte.es2.js.map
@@ -1 +1 @@
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
+ {"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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