@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,27 +1,123 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
5
|
-
function
|
|
6
|
-
if (
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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();
|
|
18
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
|
+
};
|
|
19
120
|
export {
|
|
20
|
-
|
|
21
|
-
i as getContext,
|
|
22
|
-
o as get_current_component,
|
|
23
|
-
u as onMount,
|
|
24
|
-
c as setContext,
|
|
25
|
-
r as set_current_component
|
|
121
|
+
ut as draggable
|
|
26
122
|
};
|
|
27
123
|
//# sourceMappingURL=annotorious-svelte.es9.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"annotorious-svelte.es9.js","sources":["../../../node_modules/svelte/src/runtime/internal/lifecycle.js"],"sourcesContent":["import { custom_event } from './dom.js';\n\nexport let current_component;\n\n/** @returns {void} */\nexport function set_current_component(component) {\n\tcurrent_component = component;\n}\n\nexport function get_current_component() {\n\tif (!current_component) throw new Error('Function called outside component initialization');\n\treturn current_component;\n}\n\n/**\n * Schedules a callback to run immediately before the component is updated after any state change.\n *\n * The first time the callback runs will be before the initial `onMount`\n *\n * https://svelte.dev/docs/svelte#beforeupdate\n * @param {() => any} fn\n * @returns {void}\n */\nexport function beforeUpdate(fn) {\n\tget_current_component().$$.before_update.push(fn);\n}\n\n/**\n * The `onMount` function schedules a callback to run as soon as the component has been mounted to the DOM.\n * It must be called during the component's initialisation (but doesn't need to live *inside* the component;\n * it can be called from an external module).\n *\n * If a function is returned _synchronously_ from `onMount`, it will be called when the component is unmounted.\n *\n * `onMount` does not run inside a [server-side component](/docs#run-time-server-side-component-api).\n *\n * https://svelte.dev/docs/svelte#onmount\n * @template T\n * @param {() => import('./private.js').NotFunction<T> | Promise<import('./private.js').NotFunction<T>> | (() => any)} fn\n * @returns {void}\n */\nexport function onMount(fn) {\n\tget_current_component().$$.on_mount.push(fn);\n}\n\n/**\n * Schedules a callback to run immediately after the component has been updated.\n *\n * The first time the callback runs will be after the initial `onMount`\n *\n * https://svelte.dev/docs/svelte#afterupdate\n * @param {() => any} fn\n * @returns {void}\n */\nexport function afterUpdate(fn) {\n\tget_current_component().$$.after_update.push(fn);\n}\n\n/**\n * Schedules a callback to run immediately before the component is unmounted.\n *\n * Out of `onMount`, `beforeUpdate`, `afterUpdate` and `onDestroy`, this is the\n * only one that runs inside a server-side component.\n *\n * https://svelte.dev/docs/svelte#ondestroy\n * @param {() => any} fn\n * @returns {void}\n */\nexport function onDestroy(fn) {\n\tget_current_component().$$.on_destroy.push(fn);\n}\n\n/**\n * Creates an event dispatcher that can be used to dispatch [component events](/docs#template-syntax-component-directives-on-eventname).\n * Event dispatchers are functions that can take two arguments: `name` and `detail`.\n *\n * Component events created with `createEventDispatcher` create a\n * [CustomEvent](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent).\n * These events do not [bubble](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Building_blocks/Events#Event_bubbling_and_capture).\n * The `detail` argument corresponds to the [CustomEvent.detail](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/detail)\n * property and can contain any type of data.\n *\n * The event dispatcher can be typed to narrow the allowed event names and the type of the `detail` argument:\n * ```ts\n * const dispatch = createEventDispatcher<{\n * loaded: never; // does not take a detail argument\n * change: string; // takes a detail argument of type string, which is required\n * optional: number | null; // takes an optional detail argument of type number\n * }>();\n * ```\n *\n * https://svelte.dev/docs/svelte#createeventdispatcher\n * @template {Record<string, any>} [EventMap=any]\n * @returns {import('./public.js').EventDispatcher<EventMap>}\n */\nexport function createEventDispatcher() {\n\tconst component = get_current_component();\n\treturn (type, detail, { cancelable = false } = {}) => {\n\t\tconst callbacks = component.$$.callbacks[type];\n\t\tif (callbacks) {\n\t\t\t// TODO are there situations where events could be dispatched\n\t\t\t// in a server (non-DOM) environment?\n\t\t\tconst event = custom_event(/** @type {string} */ (type), detail, { cancelable });\n\t\t\tcallbacks.slice().forEach((fn) => {\n\t\t\t\tfn.call(component, event);\n\t\t\t});\n\t\t\treturn !event.defaultPrevented;\n\t\t}\n\t\treturn true;\n\t};\n}\n\n/**\n * Associates an arbitrary `context` object with the current component and the specified `key`\n * and returns that object. The context is then available to children of the component\n * (including slotted content) with `getContext`.\n *\n * Like lifecycle functions, this must be called during component initialisation.\n *\n * https://svelte.dev/docs/svelte#setcontext\n * @template T\n * @param {any} key\n * @param {T} context\n * @returns {T}\n */\nexport function setContext(key, context) {\n\tget_current_component().$$.context.set(key, context);\n\treturn context;\n}\n\n/**\n * Retrieves the context that belongs to the closest parent component with the specified `key`.\n * Must be called during component initialisation.\n *\n * https://svelte.dev/docs/svelte#getcontext\n * @template T\n * @param {any} key\n * @returns {T}\n */\nexport function getContext(key) {\n\treturn get_current_component().$$.context.get(key);\n}\n\n/**\n * Retrieves the whole context map that belongs to the closest parent component.\n * Must be called during component initialisation. Useful, for example, if you\n * programmatically create a component and want to pass the existing context to it.\n *\n * https://svelte.dev/docs/svelte#getallcontexts\n * @template {Map<any, any>} [T=Map<any, any>]\n * @returns {T}\n */\nexport function getAllContexts() {\n\treturn get_current_component().$$.context;\n}\n\n/**\n * Checks whether a given `key` has been set in the context of a parent component.\n * Must be called during component initialisation.\n *\n * https://svelte.dev/docs/svelte#hascontext\n * @param {any} key\n * @returns {boolean}\n */\nexport function hasContext(key) {\n\treturn get_current_component().$$.context.has(key);\n}\n\n// TODO figure out if we still want to support\n// shorthand events, or if we want to implement\n// a real bubbling mechanism\n/**\n * @param component\n * @param event\n * @returns {void}\n */\nexport function bubble(component, event) {\n\tconst callbacks = component.$$.callbacks[event.type];\n\tif (callbacks) {\n\t\t// @ts-ignore\n\t\tcallbacks.slice().forEach((fn) => fn.call(this, event));\n\t}\n}\n"],"names":["current_component","set_current_component","component","get_current_component","onMount","fn","setContext","key","context","getContext"],"mappings":"AAEU,IAACA;AAGJ,SAASC,EAAsBC,GAAW;AAChD,EAAAF,IAAoBE;AACrB;AAEO,SAASC,IAAwB;AACvC,MAAI,CAACH;AAAmB,UAAM,IAAI,MAAM,kDAAkD;AAC1F,SAAOA;AACR;AA6BO,SAASI,EAAQC,GAAI;AAC3B,EAAAF,EAAuB,EAAC,GAAG,SAAS,KAAKE,CAAE;AAC5C;AAkFO,SAASC,EAAWC,GAAKC,GAAS;AACxC,SAAAL,EAAqB,EAAG,GAAG,QAAQ,IAAII,GAAKC,CAAO,GAC5CA;AACR;AAWO,SAASC,EAAWF,GAAK;AAC/B,SAAOJ,EAAuB,EAAC,GAAG,QAAQ,IAAII,CAAG;AAClD;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"annotorious-svelte.es9.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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,IAAG,EAAE,GAAE,EAAE,eAAc,IAAG,EAAE;AAAA,EAAC,GAAE,QAAO,CAAAtC,MAAG;AAAt2H,QAAAkD,GAAAC;AAAu2H,IAAAvC,IAAEZ,EAAE,QAAM,QAAOiB,IAAEjB,EAAE,YAAU,IAAGkB,IAAElB,EAAE,oBAAkB,IAAGuB,IAAEvB,EAAE,QAAOW,IAAEX,EAAE,QAAOmB,IAAEnB,EAAE,mBAAiBD,GAAEuB,IAAEtB,EAAE,QAAOgB,IAAEhB,EAAE,uBAAqB,IAAGoB,IAAEpB,EAAE,MAAKa,IAAEb,EAAE,mBAAiB,IAAGc,IAAEd,EAAE,mBAAiB,IAAGe,IAAEf,EAAE;AAAU,UAAMC,IAAE8C,EAAE,SAASrB,CAAC;AAAE,IAAAqB,EAAE,OAAOvB,GAAEE,CAAC,GAAEF,IAAExB,EAAE,gBAAc,WAAUyB,IAAEzB,EAAE,wBAAsB,oBAAmB0B,IAAE1B,EAAE,uBAAqB,mBAAkB+C,EAAE,IAAIvB,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]}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,17 +1,5 @@
|
|
|
1
1
|
export * from './osd';
|
|
2
2
|
export { default as MouseOverTooltip } from './MouseOverTooltip.svelte';
|
|
3
|
-
export type {
|
|
4
|
-
|
|
5
|
-
export { _createAnonymousGuest as createAnonymousGuest };
|
|
6
|
-
export { _createBody as createBody };
|
|
7
|
-
export { _defaultColorProvider as defaultColorProvider };
|
|
8
|
-
export { _Origin as Origin };
|
|
9
|
-
export { _PointerSelectAction as PointerSelectAction };
|
|
10
|
-
export type { AnnotoriousOpts, DrawingMode, DrawingTool, ImageAnnotator as AnnotoriousImageAnnotator, ImageAnnotation, ImageAnnotator, ImageAnnotatorState, Polygon, PolygonGeometry, Rectangle, RectangleGeometry, Shape } from '@annotorious/annotorious';
|
|
11
|
-
import { ShapeType as _ShapeType } from '@annotorious/annotorious';
|
|
12
|
-
export declare const createImageAnnotator: <E extends unknown = import("@annotorious/annotorious").ImageAnnotation>(image: string | HTMLImageElement | HTMLCanvasElement, options?: import("@annotorious/annotorious").AnnotoriousOpts<import("@annotorious/annotorious").ImageAnnotation, E>) => import("@annotorious/annotorious").ImageAnnotator<E>;
|
|
13
|
-
export declare const ShapeType: typeof _ShapeType;
|
|
14
|
-
export declare const W3CImageFormat: (source: string, invertY?: boolean) => import("@annotorious/annotorious").W3CImageFormatAdapter;
|
|
15
|
-
export type { OpenSeadragonAnnotator as AnnotoriousOpenSeadragonAnnotator } from '@annotorious/openseadragon';
|
|
16
|
-
export type { Viewer } from 'openseadragon';
|
|
3
|
+
export type { SvelteAnnotator, SvelteAnnotatorState } from '@annotorious/core';
|
|
4
|
+
export type { ImageAnnotation } from '@annotorious/annotorious';
|
|
17
5
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AAEtB,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAGxE,YAAY,EACV,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AAEtB,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAGxE,YAAY,EACV,eAAe,EACf,oBAAoB,EACrB,MAAM,mBAAmB,CAAC;AAG3B,YAAY,EACV,eAAe,EAChB,MAAM,0BAA0B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@annotorious/svelte",
|
|
3
|
-
"version": "3.0.0-rc.
|
|
3
|
+
"version": "3.0.0-rc.2",
|
|
4
4
|
"description": "Annotorious Svelte bindings",
|
|
5
5
|
"author": "Rainer Simon",
|
|
6
6
|
"license": "BSD-3-Clause",
|
|
@@ -12,28 +12,22 @@
|
|
|
12
12
|
"test": "echo 'Skipping tests in @annotorious/svelte package'"
|
|
13
13
|
},
|
|
14
14
|
"module": "./dist/annotorious-svelte.es.js",
|
|
15
|
-
"types": "./
|
|
15
|
+
"types": "./src/index.ts",
|
|
16
16
|
"svelte": "./src/index.ts",
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@
|
|
19
|
-
"@
|
|
20
|
-
"@
|
|
21
|
-
"
|
|
22
|
-
"svelte
|
|
18
|
+
"@annotorious/core": "*",
|
|
19
|
+
"@sveltejs/vite-plugin-svelte": "^2.4.6",
|
|
20
|
+
"@tsconfig/svelte": "^3.0.0",
|
|
21
|
+
"@types/openseadragon": "^3.0.7",
|
|
22
|
+
"svelte": "^3.59.2",
|
|
23
|
+
"svelte-check": "^3.5.2",
|
|
23
24
|
"tslib": "^2.6.2",
|
|
24
|
-
"typescript": "^
|
|
25
|
-
"vite": "^
|
|
26
|
-
"vite-plugin-dts": "^3.
|
|
25
|
+
"typescript": "^4.9.5",
|
|
26
|
+
"vite": "^4.4.9",
|
|
27
|
+
"vite-plugin-dts": "^3.6.0"
|
|
27
28
|
},
|
|
28
29
|
"peerDependencies": {
|
|
29
|
-
"@annotorious/annotorious": "*",
|
|
30
|
-
"@annotorious/openseadragon": "*",
|
|
31
30
|
"openseadragon": "^3.0.0 || ^4.0.0"
|
|
32
31
|
},
|
|
33
|
-
"peerDependenciesMeta": {
|
|
34
|
-
"openseadragon": {
|
|
35
|
-
"optional": true
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
32
|
"sideEffects": false
|
|
39
33
|
}
|
package/src/index.ts
CHANGED
|
@@ -2,80 +2,13 @@ export * from './osd';
|
|
|
2
2
|
|
|
3
3
|
export { default as MouseOverTooltip } from './MouseOverTooltip.svelte';
|
|
4
4
|
|
|
5
|
-
//
|
|
5
|
+
// Re-export essentials from @annotorious/core
|
|
6
6
|
export type {
|
|
7
|
-
Annotation,
|
|
8
|
-
AnnotationBody,
|
|
9
|
-
AnnotationTarget,
|
|
10
|
-
Annotator,
|
|
11
|
-
AnnotatorState,
|
|
12
|
-
Appearance,
|
|
13
|
-
AppearanceProvider,
|
|
14
|
-
Color,
|
|
15
|
-
DrawingStyle,
|
|
16
|
-
Filter,
|
|
17
|
-
FormatAdapter,
|
|
18
|
-
HoverState,
|
|
19
|
-
LifecycleEvents,
|
|
20
|
-
ParseResult,
|
|
21
|
-
PresentUser,
|
|
22
|
-
Purpose,
|
|
23
|
-
Selection,
|
|
24
|
-
SelectionState,
|
|
25
|
-
Store,
|
|
26
|
-
StoreChangeEvent,
|
|
27
|
-
StoreObserver,
|
|
28
7
|
SvelteAnnotator,
|
|
29
|
-
SvelteAnnotatorState
|
|
30
|
-
User,
|
|
31
|
-
W3CAnnotation,
|
|
32
|
-
W3CAnnotationBody,
|
|
33
|
-
W3CAnnotationTarget
|
|
8
|
+
SvelteAnnotatorState
|
|
34
9
|
} from '@annotorious/core';
|
|
35
10
|
|
|
36
|
-
|
|
37
|
-
createAnonymousGuest as _createAnonymousGuest,
|
|
38
|
-
createBody as _createBody,
|
|
39
|
-
defaultColorProvider as _defaultColorProvider,
|
|
40
|
-
Origin as _Origin,
|
|
41
|
-
PointerSelectAction as _PointerSelectAction
|
|
42
|
-
} from '@annotorious/core';
|
|
43
|
-
|
|
44
|
-
export { _createAnonymousGuest as createAnonymousGuest };
|
|
45
|
-
export { _createBody as createBody };
|
|
46
|
-
export { _defaultColorProvider as defaultColorProvider };
|
|
47
|
-
export { _Origin as Origin };
|
|
48
|
-
export { _PointerSelectAction as PointerSelectAction };
|
|
49
|
-
|
|
50
|
-
// Essential re-exports from @annotorious/annotorious
|
|
51
|
-
export type {
|
|
52
|
-
AnnotoriousOpts,
|
|
53
|
-
DrawingMode,
|
|
54
|
-
DrawingTool,
|
|
55
|
-
ImageAnnotator as AnnotoriousImageAnnotator,
|
|
56
|
-
ImageAnnotation,
|
|
57
|
-
ImageAnnotator,
|
|
58
|
-
ImageAnnotatorState,
|
|
59
|
-
Polygon,
|
|
60
|
-
PolygonGeometry,
|
|
61
|
-
Rectangle,
|
|
62
|
-
RectangleGeometry,
|
|
63
|
-
Shape
|
|
64
|
-
} from '@annotorious/annotorious';
|
|
65
|
-
|
|
66
|
-
import {
|
|
67
|
-
createImageAnnotator as _createImageAnnotator,
|
|
68
|
-
ShapeType as _ShapeType,
|
|
69
|
-
W3CImageFormat as _W3CImageFormat
|
|
70
|
-
} from '@annotorious/annotorious';
|
|
71
|
-
|
|
72
|
-
export const createImageAnnotator = _createImageAnnotator;
|
|
73
|
-
export const ShapeType = _ShapeType;
|
|
74
|
-
export const W3CImageFormat = _W3CImageFormat;
|
|
75
|
-
|
|
76
|
-
// Essential re-exports from @annotorious/openseadragon
|
|
11
|
+
// Re-export essentials from @annotorious/annotorious
|
|
77
12
|
export type {
|
|
78
|
-
|
|
79
|
-
} from '@annotorious/
|
|
80
|
-
|
|
81
|
-
export type { Viewer } from 'openseadragon';
|
|
13
|
+
ImageAnnotation
|
|
14
|
+
} from '@annotorious/annotorious';
|
package/vite.config.js
CHANGED
|
@@ -1 +0,0 @@
|
|
|
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.9';\nexport const PUBLIC_VERSION = '4';\n"],"names":["PUBLIC_VERSION"],"mappings":"AASY,MAACA,IAAiB;","x_google_ignoreList":[0]}
|
|
@@ -1,123 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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,MAA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EX,EAAE,QAAOmB,IAAEnB,EAAE,mBAAiBD,GAAEuB,IAAEtB,EAAE,QAAOgB,IAAEhB,EAAE,uBAAqB,IAAGoB,IAAEpB,EAAE,MAAKa,IAAEb,EAAE,mBAAiB,IAAGc,IAAEd,EAAE,mBAAiB,IAAGe,IAAEf,EAAE;AAAU,UAAMC,IAAE8C,EAAE,SAASrB,CAAC;AAAE,IAAAqB,EAAE,OAAOvB,GAAEE,CAAC,GAAEF,IAAExB,EAAE,gBAAc,WAAUyB,IAAEzB,EAAE,wBAAsB,oBAAmB0B,IAAE1B,EAAE,uBAAqB,mBAAkB+C,EAAE,IAAIvB,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]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"annotorious-svelte.es14.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,59 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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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