@annotorious/svelte 3.0.0-rc.19 → 3.0.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/annotorious-svelte.es.js +6 -17
- package/dist/annotorious-svelte.es.js.map +1 -1
- package/dist/annotorious-svelte.es10.js +2 -111
- package/dist/annotorious-svelte.es10.js.map +1 -1
- package/dist/annotorious-svelte.es11.js +4 -2
- package/dist/annotorious-svelte.es11.js.map +1 -1
- package/dist/annotorious-svelte.es2.js +25 -30
- package/dist/annotorious-svelte.es2.js.map +1 -1
- package/dist/annotorious-svelte.es3.js +106 -86
- package/dist/annotorious-svelte.es3.js.map +1 -1
- package/dist/annotorious-svelte.es4.js +100 -91
- package/dist/annotorious-svelte.es4.js.map +1 -1
- package/dist/annotorious-svelte.es5.js +304 -118
- package/dist/annotorious-svelte.es5.js.map +1 -1
- package/dist/annotorious-svelte.es6.js +7 -96
- package/dist/annotorious-svelte.es6.js.map +1 -1
- package/dist/annotorious-svelte.es7.js +2 -43
- package/dist/annotorious-svelte.es7.js.map +1 -1
- package/dist/annotorious-svelte.es8.js +20598 -21
- package/dist/annotorious-svelte.es8.js.map +1 -1
- package/dist/annotorious-svelte.es9.js +119 -23
- package/dist/annotorious-svelte.es9.js.map +1 -1
- package/dist/index.d.ts +2 -14
- package/dist/index.d.ts.map +1 -1
- package/package.json +11 -17
- package/src/index.ts +5 -72
- package/vite.config.js +0 -1
- package/dist/annotorious-svelte.es12.js +0 -5
- package/dist/annotorious-svelte.es12.js.map +0 -1
- package/dist/annotorious-svelte.es13.js +0 -123
- package/dist/annotorious-svelte.es13.js.map +0 -1
- package/dist/annotorious-svelte.es14.js +0 -2
- package/dist/annotorious-svelte.es14.js.map +0 -1
- package/dist/annotorious-svelte.es15.js +0 -59
- package/dist/annotorious-svelte.es15.js.map +0 -1
- /package/dist/{annotorious-svelte.css → style.css} +0 -0
|
@@ -1,20 +1,9 @@
|
|
|
1
|
-
import { default as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { default as I } from "./annotorious-svelte.es4.js";
|
|
5
|
-
import { default as x } from "./annotorious-svelte.es5.js";
|
|
6
|
-
const r = e, n = o, p = a;
|
|
1
|
+
import { default as a } from "./annotorious-svelte.es2.js";
|
|
2
|
+
import { default as t } from "./annotorious-svelte.es3.js";
|
|
3
|
+
import { default as f } from "./annotorious-svelte.es4.js";
|
|
7
4
|
export {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
g as Origin,
|
|
12
|
-
d as PointerSelectAction,
|
|
13
|
-
n as ShapeType,
|
|
14
|
-
p as W3CImageFormat,
|
|
15
|
-
u as createAnonymousGuest,
|
|
16
|
-
i as createBody,
|
|
17
|
-
r as createImageAnnotator,
|
|
18
|
-
l as defaultColorProvider
|
|
5
|
+
a as MouseOverTooltip,
|
|
6
|
+
t as OpenSeadragonAnnotator,
|
|
7
|
+
f as OpenSeadragonPopup
|
|
19
8
|
};
|
|
20
9
|
//# sourceMappingURL=annotorious-svelte.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"annotorious-svelte.es.js","sources":[
|
|
1
|
+
{"version":3,"file":"annotorious-svelte.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
|
|
@@ -1,114 +1,5 @@
|
|
|
1
|
-
|
|
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
|
-
}
|
|
1
|
+
const e = "";
|
|
108
2
|
export {
|
|
109
|
-
|
|
110
|
-
F as destroy_component,
|
|
111
|
-
P as init,
|
|
112
|
-
D as mount_component
|
|
3
|
+
e as default
|
|
113
4
|
};
|
|
114
5
|
//# sourceMappingURL=annotorious-svelte.es10.js.map
|
|
@@ -1 +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":"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","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"annotorious-svelte.es10.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
let o = (n = 21) => crypto.getRandomValues(new Uint8Array(n)).reduce((r, e) => (e &= 63, e < 36 ? r += e.toString(36) : e < 62 ? r += (e - 26).toString(36).toUpperCase() : e > 62 ? r += "-" : r += "_", r), "");
|
|
2
|
+
export {
|
|
3
|
+
o as nanoid
|
|
4
|
+
};
|
|
3
5
|
//# sourceMappingURL=annotorious-svelte.es11.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"annotorious-svelte.es11.js","sources":["../../../node_modules/
|
|
1
|
+
{"version":3,"file":"annotorious-svelte.es11.js","sources":["../../../node_modules/nanoid/index.browser.js"],"sourcesContent":["export { urlAlphabet } from './url-alphabet/index.js'\nexport let random = bytes => crypto.getRandomValues(new Uint8Array(bytes))\nexport let customRandom = (alphabet, defaultSize, getRandom) => {\n let mask = (2 << (Math.log(alphabet.length - 1) / Math.LN2)) - 1\n let step = -~((1.6 * mask * defaultSize) / alphabet.length)\n return (size = defaultSize) => {\n let id = ''\n while (true) {\n let bytes = getRandom(step)\n let j = step\n while (j--) {\n id += alphabet[bytes[j] & mask] || ''\n if (id.length === size) return id\n }\n }\n }\n}\nexport let customAlphabet = (alphabet, size = 21) =>\n customRandom(alphabet, size, random)\nexport let nanoid = (size = 21) =>\n crypto.getRandomValues(new Uint8Array(size)).reduce((id, byte) => {\n byte &= 63\n if (byte < 36) {\n id += byte.toString(36)\n } else if (byte < 62) {\n id += (byte - 26).toString(36).toUpperCase()\n } else if (byte > 62) {\n id += '-'\n } else {\n id += '_'\n }\n return id\n }, '')\n"],"names":["nanoid","size","id","byte"],"mappings":"AAmBU,IAACA,IAAS,CAACC,IAAO,OAC1B,OAAO,gBAAgB,IAAI,WAAWA,CAAI,CAAC,EAAE,OAAO,CAACC,GAAIC,OACvDA,KAAQ,IACJA,IAAO,KACTD,KAAMC,EAAK,SAAS,EAAE,IACbA,IAAO,KAChBD,MAAOC,IAAO,IAAI,SAAS,EAAE,EAAE,YAAa,IACnCA,IAAO,KAChBD,KAAM,MAENA,KAAM,KAEDA,IACN,EAAE;","x_google_ignoreList":[0]}
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
import {
|
|
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";
|
|
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.es5.js";
|
|
7
2
|
const G = (o) => ({ hovered: o & /*hovered*/
|
|
8
3
|
16 }), b = (o) => ({ hovered: (
|
|
9
4
|
/*hovered*/
|
|
@@ -14,7 +9,7 @@ function g(o) {
|
|
|
14
9
|
const t = (
|
|
15
10
|
/*#slots*/
|
|
16
11
|
o[8].default
|
|
17
|
-
), n =
|
|
12
|
+
), n = Y(
|
|
18
13
|
t,
|
|
19
14
|
o,
|
|
20
15
|
/*$$scope*/
|
|
@@ -23,7 +18,7 @@ function g(o) {
|
|
|
23
18
|
);
|
|
24
19
|
return {
|
|
25
20
|
c() {
|
|
26
|
-
r =
|
|
21
|
+
r = j("div"), n && n.c(), c(r, "class", "a9s-tooltip"), c(r, "style", s = `left:${/*left*/
|
|
27
22
|
o[2]}px; top:${/*top*/
|
|
28
23
|
o[1]}px; position: absolute;`);
|
|
29
24
|
},
|
|
@@ -32,19 +27,19 @@ function g(o) {
|
|
|
32
27
|
},
|
|
33
28
|
p(i, l) {
|
|
34
29
|
n && n.p && (!e || l & /*$$scope, hovered*/
|
|
35
|
-
144) &&
|
|
30
|
+
144) && z(
|
|
36
31
|
n,
|
|
37
32
|
t,
|
|
38
33
|
i,
|
|
39
34
|
/*$$scope*/
|
|
40
35
|
i[7],
|
|
41
|
-
e ?
|
|
36
|
+
e ? D(
|
|
42
37
|
t,
|
|
43
38
|
/*$$scope*/
|
|
44
39
|
i[7],
|
|
45
40
|
l,
|
|
46
41
|
G
|
|
47
|
-
) :
|
|
42
|
+
) : B(
|
|
48
43
|
/*$$scope*/
|
|
49
44
|
i[7]
|
|
50
45
|
),
|
|
@@ -58,7 +53,7 @@ function g(o) {
|
|
|
58
53
|
e || (u(n, i), e = !0);
|
|
59
54
|
},
|
|
60
55
|
o(i) {
|
|
61
|
-
|
|
56
|
+
_(n, i), e = !1;
|
|
62
57
|
},
|
|
63
58
|
d(i) {
|
|
64
59
|
i && L(r), n && n.d(i);
|
|
@@ -73,7 +68,7 @@ function H(o) {
|
|
|
73
68
|
);
|
|
74
69
|
return {
|
|
75
70
|
c() {
|
|
76
|
-
e && e.c(), r =
|
|
71
|
+
e && e.c(), r = w();
|
|
77
72
|
},
|
|
78
73
|
m(t, n) {
|
|
79
74
|
e && e.m(t, n), E(t, r, n), s = !0;
|
|
@@ -82,52 +77,52 @@ function H(o) {
|
|
|
82
77
|
/*$hover*/
|
|
83
78
|
t[0] && /*show*/
|
|
84
79
|
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 && (
|
|
80
|
+
9 && u(e, 1)) : (e = g(t), e.c(), u(e, 1), e.m(r.parentNode, r)) : e && (F(), _(e, 1, 1, () => {
|
|
86
81
|
e = null;
|
|
87
|
-
}),
|
|
82
|
+
}), A());
|
|
88
83
|
},
|
|
89
84
|
i(t) {
|
|
90
85
|
s || (u(e), s = !0);
|
|
91
86
|
},
|
|
92
87
|
o(t) {
|
|
93
|
-
|
|
88
|
+
_(e), s = !1;
|
|
94
89
|
},
|
|
95
90
|
d(t) {
|
|
96
|
-
|
|
91
|
+
e && e.d(t), t && L(r);
|
|
97
92
|
}
|
|
98
93
|
};
|
|
99
94
|
}
|
|
100
95
|
function I(o, r, s) {
|
|
101
96
|
let e, t, { $$slots: n = {}, $$scope: i } = r, { container: l } = r;
|
|
102
|
-
const k =
|
|
103
|
-
|
|
104
|
-
let
|
|
105
|
-
return
|
|
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(() => {
|
|
106
101
|
const f = () => {
|
|
107
102
|
s(3, a = !0);
|
|
108
|
-
},
|
|
103
|
+
}, m = (y) => {
|
|
109
104
|
const { offsetX: P, offsetY: C } = y;
|
|
110
|
-
s(2,
|
|
105
|
+
s(2, d = P), s(1, v = C);
|
|
111
106
|
}, h = () => {
|
|
112
107
|
s(3, a = !1);
|
|
113
108
|
};
|
|
114
|
-
return l.addEventListener("pointerenter", f), l.addEventListener("pointermove",
|
|
115
|
-
l.removeEventListener("pointerenter", f), l.removeEventListener("pointermove",
|
|
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);
|
|
116
111
|
};
|
|
117
112
|
}), o.$$set = (f) => {
|
|
118
113
|
"container" in f && s(6, l = f.container), "$$scope" in f && s(7, i = f.$$scope);
|
|
119
114
|
}, o.$$.update = () => {
|
|
120
115
|
o.$$.dirty & /*$hover*/
|
|
121
116
|
1 && s(4, e = t ? M.getAnnotation(t) : void 0);
|
|
122
|
-
}, [t,
|
|
117
|
+
}, [t, v, d, a, e, p, l, i, n];
|
|
123
118
|
}
|
|
124
|
-
class J extends
|
|
119
|
+
class J extends O {
|
|
125
120
|
constructor(r) {
|
|
126
|
-
super(),
|
|
121
|
+
super(), T(this, r, I, H, q, { container: 6 });
|
|
127
122
|
}
|
|
128
123
|
}
|
|
129
|
-
const
|
|
124
|
+
const Q = J;
|
|
130
125
|
export {
|
|
131
|
-
|
|
126
|
+
Q as default
|
|
132
127
|
};
|
|
133
128
|
//# 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":"
|
|
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,93 +1,113 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { SvelteComponent as g, init as b, safe_not_equal as h, empty as k, insert as w, transition_in as l, transition_out as c, check_outros as A, detach as O, create_slot as v, update_slot_base as C, get_all_dirty_from_scope as N, get_slot_changes as q, group_outros as y, setContext as m } from "./annotorious-svelte.es5.js";
|
|
2
|
+
import { toSvelteStore as D } from "./annotorious-svelte.es6.js";
|
|
3
|
+
import "./annotorious-svelte.es7.js";
|
|
4
|
+
import { createOSDAnnotator as E } from "./annotorious-svelte.es8.js";
|
|
5
|
+
function d(s) {
|
|
6
|
+
let n;
|
|
7
|
+
const o = (
|
|
8
|
+
/*#slots*/
|
|
9
|
+
s[4].default
|
|
10
|
+
), t = v(
|
|
11
|
+
o,
|
|
12
|
+
s,
|
|
13
|
+
/*$$scope*/
|
|
14
|
+
s[3],
|
|
15
|
+
null
|
|
16
|
+
);
|
|
17
|
+
return {
|
|
18
|
+
c() {
|
|
19
|
+
t && t.c();
|
|
20
|
+
},
|
|
21
|
+
m(e, i) {
|
|
22
|
+
t && t.m(e, i), n = !0;
|
|
23
|
+
},
|
|
24
|
+
p(e, i) {
|
|
25
|
+
t && t.p && (!n || i & /*$$scope*/
|
|
26
|
+
8) && C(
|
|
27
|
+
t,
|
|
28
|
+
o,
|
|
29
|
+
e,
|
|
30
|
+
/*$$scope*/
|
|
31
|
+
e[3],
|
|
32
|
+
n ? q(
|
|
33
|
+
o,
|
|
34
|
+
/*$$scope*/
|
|
35
|
+
e[3],
|
|
36
|
+
i,
|
|
37
|
+
null
|
|
38
|
+
) : N(
|
|
39
|
+
/*$$scope*/
|
|
40
|
+
e[3]
|
|
41
|
+
),
|
|
42
|
+
null
|
|
43
|
+
);
|
|
44
|
+
},
|
|
45
|
+
i(e) {
|
|
46
|
+
n || (l(t, e), n = !0);
|
|
47
|
+
},
|
|
48
|
+
o(e) {
|
|
49
|
+
c(t, e), n = !1;
|
|
50
|
+
},
|
|
51
|
+
d(e) {
|
|
52
|
+
t && t.d(e);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
14
55
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
56
|
+
function j(s) {
|
|
57
|
+
let n, o, t = (
|
|
58
|
+
/*viewer*/
|
|
59
|
+
s[0] && d(s)
|
|
60
|
+
);
|
|
61
|
+
return {
|
|
62
|
+
c() {
|
|
63
|
+
t && t.c(), n = k();
|
|
64
|
+
},
|
|
65
|
+
m(e, i) {
|
|
66
|
+
t && t.m(e, i), w(e, n, i), o = !0;
|
|
67
|
+
},
|
|
68
|
+
p(e, [i]) {
|
|
69
|
+
/*viewer*/
|
|
70
|
+
e[0] ? t ? (t.p(e, i), i & /*viewer*/
|
|
71
|
+
1 && l(t, 1)) : (t = d(e), t.c(), l(t, 1), t.m(n.parentNode, n)) : t && (y(), c(t, 1, 1, () => {
|
|
72
|
+
t = null;
|
|
73
|
+
}), A());
|
|
74
|
+
},
|
|
75
|
+
i(e) {
|
|
76
|
+
o || (l(t), o = !0);
|
|
77
|
+
},
|
|
78
|
+
o(e) {
|
|
79
|
+
c(t), o = !1;
|
|
80
|
+
},
|
|
81
|
+
d(e) {
|
|
82
|
+
t && t.d(e), e && O(n);
|
|
83
|
+
}
|
|
84
|
+
};
|
|
30
85
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
...t,
|
|
41
|
-
subscribe: (o) => {
|
|
42
|
-
const r = (a) => o(a.state);
|
|
43
|
-
return t.observe(r), o(t.all()), () => t.unobserve(r);
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
let E = (t) => crypto.getRandomValues(new Uint8Array(t)), b = (t, o, r) => {
|
|
47
|
-
let a = (2 << Math.log(t.length - 1) / Math.LN2) - 1, n = -~(1.6 * a * o / t.length);
|
|
48
|
-
return (l = o) => {
|
|
49
|
-
let c = "";
|
|
50
|
-
for (; ; ) {
|
|
51
|
-
let d = r(n), u = n;
|
|
52
|
-
for (; u--; )
|
|
53
|
-
if (c += t[d[u] & a] || "", c.length === l)
|
|
54
|
-
return c;
|
|
86
|
+
function z(s, n, o) {
|
|
87
|
+
let { $$slots: t = {}, $$scope: e } = n, { viewer: i } = n, { opts: f = {} } = n, { anno: a = void 0 } = n;
|
|
88
|
+
const p = (r) => {
|
|
89
|
+
if (r) {
|
|
90
|
+
const u = E(r, f), S = D(u.state.store), _ = {
|
|
91
|
+
...u,
|
|
92
|
+
state: { ...u.state, store: S }
|
|
93
|
+
};
|
|
94
|
+
m("anno", _), m("viewer", r), o(1, a = _);
|
|
55
95
|
}
|
|
56
96
|
};
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
// pink
|
|
71
|
-
"#ffc400",
|
|
72
|
-
// khaki
|
|
73
|
-
"#00d7ff",
|
|
74
|
-
// cyan
|
|
75
|
-
"#023eff"
|
|
76
|
-
// blue
|
|
77
|
-
], A = () => {
|
|
78
|
-
const t = [...w];
|
|
79
|
-
return { assignRandomColor: () => {
|
|
80
|
-
const o = Math.floor(Math.random() * t.length), r = t[o];
|
|
81
|
-
return t.splice(o, 1), r;
|
|
82
|
-
}, releaseColor: (o) => t.push(o) };
|
|
83
|
-
};
|
|
84
|
-
S();
|
|
97
|
+
return s.$$set = (r) => {
|
|
98
|
+
"viewer" in r && o(0, i = r.viewer), "opts" in r && o(2, f = r.opts), "anno" in r && o(1, a = r.anno), "$$scope" in r && o(3, e = r.$$scope);
|
|
99
|
+
}, s.$$.update = () => {
|
|
100
|
+
s.$$.dirty & /*viewer*/
|
|
101
|
+
1 && p(i);
|
|
102
|
+
}, [i, a, f, e, t];
|
|
103
|
+
}
|
|
104
|
+
class B extends g {
|
|
105
|
+
constructor(n) {
|
|
106
|
+
super(), b(this, n, z, j, h, { viewer: 0, opts: 2, anno: 1 });
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
const J = B;
|
|
85
110
|
export {
|
|
86
|
-
|
|
87
|
-
f as PointerSelectAction,
|
|
88
|
-
v as createAnonymousGuest,
|
|
89
|
-
C as createBody,
|
|
90
|
-
A as defaultColorProvider,
|
|
91
|
-
D as toSvelteStore
|
|
111
|
+
J as default
|
|
92
112
|
};
|
|
93
113
|
//# sourceMappingURL=annotorious-svelte.es3.js.map
|