@annotorious/svelte 3.0.0-rc.2 → 3.0.0-rc.20
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 +17 -6
- package/dist/annotorious-svelte.es.js.map +1 -1
- package/dist/annotorious-svelte.es10.js +24 -2
- package/dist/annotorious-svelte.es10.js.map +1 -1
- package/dist/annotorious-svelte.es11.js +111 -2
- package/dist/annotorious-svelte.es11.js.map +1 -1
- package/dist/annotorious-svelte.es12.js +3 -0
- package/dist/annotorious-svelte.es12.js.map +1 -0
- package/dist/annotorious-svelte.es13.js +5 -0
- package/dist/annotorious-svelte.es13.js.map +1 -0
- package/dist/annotorious-svelte.es14.js +27439 -0
- package/dist/annotorious-svelte.es14.js.map +1 -0
- package/dist/annotorious-svelte.es15.js +123 -0
- package/dist/annotorious-svelte.es15.js.map +1 -0
- package/dist/annotorious-svelte.es16.js +2 -0
- package/dist/annotorious-svelte.es16.js.map +1 -0
- package/dist/annotorious-svelte.es17.js +59 -0
- package/dist/annotorious-svelte.es17.js.map +1 -0
- package/dist/annotorious-svelte.es2.js +30 -25
- package/dist/annotorious-svelte.es2.js.map +1 -1
- package/dist/annotorious-svelte.es3.js +91 -106
- package/dist/annotorious-svelte.es3.js.map +1 -1
- package/dist/annotorious-svelte.es4.js +4226 -110
- package/dist/annotorious-svelte.es4.js.map +1 -1
- package/dist/annotorious-svelte.es5.js +106 -305
- package/dist/annotorious-svelte.es5.js.map +1 -1
- package/dist/annotorious-svelte.es6.js +126 -7
- package/dist/annotorious-svelte.es6.js.map +1 -1
- package/dist/annotorious-svelte.es7.js +99 -2
- package/dist/annotorious-svelte.es7.js.map +1 -1
- package/dist/annotorious-svelte.es8.js +31 -20598
- package/dist/annotorious-svelte.es8.js.map +1 -1
- package/dist/annotorious-svelte.es9.js +29 -118
- package/dist/annotorious-svelte.es9.js.map +1 -1
- package/dist/index.d.ts +14 -2
- package/dist/index.d.ts.map +1 -1
- package/package.json +22 -11
- package/src/index.ts +72 -5
- package/vite.config.js +1 -0
- /package/dist/{style.css → annotorious-svelte.css} +0 -0
|
@@ -1,123 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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;
|
|
1
|
+
import { run_all as u } from "./annotorious-svelte.es7.js";
|
|
2
|
+
const r = /* @__PURE__ */ new Set();
|
|
3
|
+
let i;
|
|
4
|
+
function s() {
|
|
5
|
+
i = {
|
|
6
|
+
r: 0,
|
|
7
|
+
c: [],
|
|
8
|
+
p: i
|
|
9
|
+
// parent group
|
|
46
10
|
};
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
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)
|
|
11
|
+
}
|
|
12
|
+
function p() {
|
|
13
|
+
i.r || u(i.c), i = i.p;
|
|
14
|
+
}
|
|
15
|
+
function d(t, e) {
|
|
16
|
+
t && t.i && (r.delete(t), t.i(e));
|
|
17
|
+
}
|
|
18
|
+
function _(t, e, o, n) {
|
|
19
|
+
if (t && t.o) {
|
|
20
|
+
if (r.has(t))
|
|
91
21
|
return;
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
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
|
-
};
|
|
22
|
+
r.add(t), i.c.push(() => {
|
|
23
|
+
r.delete(t), n && (o && t.d(1), n());
|
|
24
|
+
}), t.o(e);
|
|
25
|
+
} else
|
|
26
|
+
n && n();
|
|
27
|
+
}
|
|
120
28
|
export {
|
|
121
|
-
|
|
29
|
+
p as check_outros,
|
|
30
|
+
s as group_outros,
|
|
31
|
+
d as transition_in,
|
|
32
|
+
_ as transition_out
|
|
122
33
|
};
|
|
123
34
|
//# sourceMappingURL=annotorious-svelte.es9.js.map
|
|
@@ -1 +1 @@
|
|
|
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,CAACJ,GAAEC,MAAQA,MAAJ,IAAM,IAAE,KAAK,KAAKD,IAAEC,CAAC,IAAEA;AAAE,SAAM,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H,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]}
|
|
1
|
+
{"version":3,"file":"annotorious-svelte.es9.js","sources":["../../../node_modules/svelte/src/runtime/internal/transitions.js"],"sourcesContent":["import { identity as linear, is_function, noop, run_all } from './utils.js';\nimport { now } from './environment.js';\nimport { loop } from './loop.js';\nimport { create_rule, delete_rule } from './style_manager.js';\nimport { custom_event } from './dom.js';\nimport { add_render_callback } from './scheduler.js';\n\n/**\n * @type {Promise<void> | null}\n */\nlet promise;\n\n/**\n * @returns {Promise<void>}\n */\nfunction wait() {\n\tif (!promise) {\n\t\tpromise = Promise.resolve();\n\t\tpromise.then(() => {\n\t\t\tpromise = null;\n\t\t});\n\t}\n\treturn promise;\n}\n\n/**\n * @param {Element} node\n * @param {INTRO | OUTRO | boolean} direction\n * @param {'start' | 'end'} kind\n * @returns {void}\n */\nfunction dispatch(node, direction, kind) {\n\tnode.dispatchEvent(custom_event(`${direction ? 'intro' : 'outro'}${kind}`));\n}\n\nconst outroing = new Set();\n\n/**\n * @type {Outro}\n */\nlet outros;\n\n/**\n * @returns {void} */\nexport function group_outros() {\n\toutros = {\n\t\tr: 0,\n\t\tc: [],\n\t\tp: outros // parent group\n\t};\n}\n\n/**\n * @returns {void} */\nexport function check_outros() {\n\tif (!outros.r) {\n\t\trun_all(outros.c);\n\t}\n\toutros = outros.p;\n}\n\n/**\n * @param {import('./private.js').Fragment} block\n * @param {0 | 1} [local]\n * @returns {void}\n */\nexport function transition_in(block, local) {\n\tif (block && block.i) {\n\t\toutroing.delete(block);\n\t\tblock.i(local);\n\t}\n}\n\n/**\n * @param {import('./private.js').Fragment} block\n * @param {0 | 1} local\n * @param {0 | 1} [detach]\n * @param {() => void} [callback]\n * @returns {void}\n */\nexport function transition_out(block, local, detach, callback) {\n\tif (block && block.o) {\n\t\tif (outroing.has(block)) return;\n\t\toutroing.add(block);\n\t\toutros.c.push(() => {\n\t\t\toutroing.delete(block);\n\t\t\tif (callback) {\n\t\t\t\tif (detach) block.d(1);\n\t\t\t\tcallback();\n\t\t\t}\n\t\t});\n\t\tblock.o(local);\n\t} else if (callback) {\n\t\tcallback();\n\t}\n}\n\n/**\n * @type {import('../transition/public.js').TransitionConfig}\n */\nconst null_transition = { duration: 0 };\n\n/**\n * @param {Element & ElementCSSInlineStyle} node\n * @param {TransitionFn} fn\n * @param {any} params\n * @returns {{ start(): void; invalidate(): void; end(): void; }}\n */\nexport function create_in_transition(node, fn, params) {\n\t/**\n\t * @type {TransitionOptions} */\n\tconst options = { direction: 'in' };\n\tlet config = fn(node, params, options);\n\tlet running = false;\n\tlet animation_name;\n\tlet task;\n\tlet uid = 0;\n\n\t/**\n\t * @returns {void} */\n\tfunction cleanup() {\n\t\tif (animation_name) delete_rule(node, animation_name);\n\t}\n\n\t/**\n\t * @returns {void} */\n\tfunction go() {\n\t\tconst {\n\t\t\tdelay = 0,\n\t\t\tduration = 300,\n\t\t\teasing = linear,\n\t\t\ttick = noop,\n\t\t\tcss\n\t\t} = config || null_transition;\n\t\tif (css) animation_name = create_rule(node, 0, 1, duration, delay, easing, css, uid++);\n\t\ttick(0, 1);\n\t\tconst start_time = now() + delay;\n\t\tconst end_time = start_time + duration;\n\t\tif (task) task.abort();\n\t\trunning = true;\n\t\tadd_render_callback(() => dispatch(node, true, 'start'));\n\t\ttask = loop((now) => {\n\t\t\tif (running) {\n\t\t\t\tif (now >= end_time) {\n\t\t\t\t\ttick(1, 0);\n\t\t\t\t\tdispatch(node, true, 'end');\n\t\t\t\t\tcleanup();\n\t\t\t\t\treturn (running = false);\n\t\t\t\t}\n\t\t\t\tif (now >= start_time) {\n\t\t\t\t\tconst t = easing((now - start_time) / duration);\n\t\t\t\t\ttick(t, 1 - t);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn running;\n\t\t});\n\t}\n\tlet started = false;\n\treturn {\n\t\tstart() {\n\t\t\tif (started) return;\n\t\t\tstarted = true;\n\t\t\tdelete_rule(node);\n\t\t\tif (is_function(config)) {\n\t\t\t\tconfig = config(options);\n\t\t\t\twait().then(go);\n\t\t\t} else {\n\t\t\t\tgo();\n\t\t\t}\n\t\t},\n\t\tinvalidate() {\n\t\t\tstarted = false;\n\t\t},\n\t\tend() {\n\t\t\tif (running) {\n\t\t\t\tcleanup();\n\t\t\t\trunning = false;\n\t\t\t}\n\t\t}\n\t};\n}\n\n/**\n * @param {Element & ElementCSSInlineStyle} node\n * @param {TransitionFn} fn\n * @param {any} params\n * @returns {{ end(reset: any): void; }}\n */\nexport function create_out_transition(node, fn, params) {\n\t/** @type {TransitionOptions} */\n\tconst options = { direction: 'out' };\n\tlet config = fn(node, params, options);\n\tlet running = true;\n\tlet animation_name;\n\tconst group = outros;\n\tgroup.r += 1;\n\t/** @type {boolean} */\n\tlet original_inert_value;\n\n\t/**\n\t * @returns {void} */\n\tfunction go() {\n\t\tconst {\n\t\t\tdelay = 0,\n\t\t\tduration = 300,\n\t\t\teasing = linear,\n\t\t\ttick = noop,\n\t\t\tcss\n\t\t} = config || null_transition;\n\n\t\tif (css) animation_name = create_rule(node, 1, 0, duration, delay, easing, css);\n\n\t\tconst start_time = now() + delay;\n\t\tconst end_time = start_time + duration;\n\t\tadd_render_callback(() => dispatch(node, false, 'start'));\n\n\t\tif ('inert' in node) {\n\t\t\toriginal_inert_value = /** @type {HTMLElement} */ (node).inert;\n\t\t\tnode.inert = true;\n\t\t}\n\n\t\tloop((now) => {\n\t\t\tif (running) {\n\t\t\t\tif (now >= end_time) {\n\t\t\t\t\ttick(0, 1);\n\t\t\t\t\tdispatch(node, false, 'end');\n\t\t\t\t\tif (!--group.r) {\n\t\t\t\t\t\t// this will result in `end()` being called,\n\t\t\t\t\t\t// so we don't need to clean up here\n\t\t\t\t\t\trun_all(group.c);\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif (now >= start_time) {\n\t\t\t\t\tconst t = easing((now - start_time) / duration);\n\t\t\t\t\ttick(1 - t, t);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn running;\n\t\t});\n\t}\n\n\tif (is_function(config)) {\n\t\twait().then(() => {\n\t\t\t// @ts-ignore\n\t\t\tconfig = config(options);\n\t\t\tgo();\n\t\t});\n\t} else {\n\t\tgo();\n\t}\n\n\treturn {\n\t\tend(reset) {\n\t\t\tif (reset && 'inert' in node) {\n\t\t\t\tnode.inert = original_inert_value;\n\t\t\t}\n\t\t\tif (reset && config.tick) {\n\t\t\t\tconfig.tick(1, 0);\n\t\t\t}\n\t\t\tif (running) {\n\t\t\t\tif (animation_name) delete_rule(node, animation_name);\n\t\t\t\trunning = false;\n\t\t\t}\n\t\t}\n\t};\n}\n\n/**\n * @param {Element & ElementCSSInlineStyle} node\n * @param {TransitionFn} fn\n * @param {any} params\n * @param {boolean} intro\n * @returns {{ run(b: 0 | 1): void; end(): void; }}\n */\nexport function create_bidirectional_transition(node, fn, params, intro) {\n\t/**\n\t * @type {TransitionOptions} */\n\tconst options = { direction: 'both' };\n\tlet config = fn(node, params, options);\n\tlet t = intro ? 0 : 1;\n\n\t/**\n\t * @type {Program | null} */\n\tlet running_program = null;\n\n\t/**\n\t * @type {PendingProgram | null} */\n\tlet pending_program = null;\n\tlet animation_name = null;\n\n\t/** @type {boolean} */\n\tlet original_inert_value;\n\n\t/**\n\t * @returns {void} */\n\tfunction clear_animation() {\n\t\tif (animation_name) delete_rule(node, animation_name);\n\t}\n\n\t/**\n\t * @param {PendingProgram} program\n\t * @param {number} duration\n\t * @returns {Program}\n\t */\n\tfunction init(program, duration) {\n\t\tconst d = /** @type {Program['d']} */ (program.b - t);\n\t\tduration *= Math.abs(d);\n\t\treturn {\n\t\t\ta: t,\n\t\t\tb: program.b,\n\t\t\td,\n\t\t\tduration,\n\t\t\tstart: program.start,\n\t\t\tend: program.start + duration,\n\t\t\tgroup: program.group\n\t\t};\n\t}\n\n\t/**\n\t * @param {INTRO | OUTRO} b\n\t * @returns {void}\n\t */\n\tfunction go(b) {\n\t\tconst {\n\t\t\tdelay = 0,\n\t\t\tduration = 300,\n\t\t\teasing = linear,\n\t\t\ttick = noop,\n\t\t\tcss\n\t\t} = config || null_transition;\n\n\t\t/**\n\t\t * @type {PendingProgram} */\n\t\tconst program = {\n\t\t\tstart: now() + delay,\n\t\t\tb\n\t\t};\n\n\t\tif (!b) {\n\t\t\t// @ts-ignore todo: improve typings\n\t\t\tprogram.group = outros;\n\t\t\toutros.r += 1;\n\t\t}\n\n\t\tif ('inert' in node) {\n\t\t\tif (b) {\n\t\t\t\tif (original_inert_value !== undefined) {\n\t\t\t\t\t// aborted/reversed outro — restore previous inert value\n\t\t\t\t\tnode.inert = original_inert_value;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\toriginal_inert_value = /** @type {HTMLElement} */ (node).inert;\n\t\t\t\tnode.inert = true;\n\t\t\t}\n\t\t}\n\n\t\tif (running_program || pending_program) {\n\t\t\tpending_program = program;\n\t\t} else {\n\t\t\t// if this is an intro, and there's a delay, we need to do\n\t\t\t// an initial tick and/or apply CSS animation immediately\n\t\t\tif (css) {\n\t\t\t\tclear_animation();\n\t\t\t\tanimation_name = create_rule(node, t, b, duration, delay, easing, css);\n\t\t\t}\n\t\t\tif (b) tick(0, 1);\n\t\t\trunning_program = init(program, duration);\n\t\t\tadd_render_callback(() => dispatch(node, b, 'start'));\n\t\t\tloop((now) => {\n\t\t\t\tif (pending_program && now > pending_program.start) {\n\t\t\t\t\trunning_program = init(pending_program, duration);\n\t\t\t\t\tpending_program = null;\n\t\t\t\t\tdispatch(node, running_program.b, 'start');\n\t\t\t\t\tif (css) {\n\t\t\t\t\t\tclear_animation();\n\t\t\t\t\t\tanimation_name = create_rule(\n\t\t\t\t\t\t\tnode,\n\t\t\t\t\t\t\tt,\n\t\t\t\t\t\t\trunning_program.b,\n\t\t\t\t\t\t\trunning_program.duration,\n\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\teasing,\n\t\t\t\t\t\t\tconfig.css\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (running_program) {\n\t\t\t\t\tif (now >= running_program.end) {\n\t\t\t\t\t\ttick((t = running_program.b), 1 - t);\n\t\t\t\t\t\tdispatch(node, running_program.b, 'end');\n\t\t\t\t\t\tif (!pending_program) {\n\t\t\t\t\t\t\t// we're done\n\t\t\t\t\t\t\tif (running_program.b) {\n\t\t\t\t\t\t\t\t// intro — we can tidy up immediately\n\t\t\t\t\t\t\t\tclear_animation();\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// outro — needs to be coordinated\n\t\t\t\t\t\t\t\tif (!--running_program.group.r) run_all(running_program.group.c);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\trunning_program = null;\n\t\t\t\t\t} else if (now >= running_program.start) {\n\t\t\t\t\t\tconst p = now - running_program.start;\n\t\t\t\t\t\tt = running_program.a + running_program.d * easing(p / running_program.duration);\n\t\t\t\t\t\ttick(t, 1 - t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn !!(running_program || pending_program);\n\t\t\t});\n\t\t}\n\t}\n\treturn {\n\t\trun(b) {\n\t\t\tif (is_function(config)) {\n\t\t\t\twait().then(() => {\n\t\t\t\t\tconst opts = { direction: b ? 'in' : 'out' };\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tconfig = config(opts);\n\t\t\t\t\tgo(b);\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tgo(b);\n\t\t\t}\n\t\t},\n\t\tend() {\n\t\t\tclear_animation();\n\t\t\trunning_program = pending_program = null;\n\t\t}\n\t};\n}\n\n/** @typedef {1} INTRO */\n/** @typedef {0} OUTRO */\n/** @typedef {{ direction: 'in' | 'out' | 'both' }} TransitionOptions */\n/** @typedef {(node: Element, params: any, options: TransitionOptions) => import('../transition/public.js').TransitionConfig} TransitionFn */\n\n/**\n * @typedef {Object} Outro\n * @property {number} r\n * @property {Function[]} c\n * @property {Object} p\n */\n\n/**\n * @typedef {Object} PendingProgram\n * @property {number} start\n * @property {INTRO|OUTRO} b\n * @property {Outro} [group]\n */\n\n/**\n * @typedef {Object} Program\n * @property {number} a\n * @property {INTRO|OUTRO} b\n * @property {1|-1} d\n * @property {number} duration\n * @property {number} start\n * @property {number} end\n * @property {Outro} [group]\n */\n"],"names":["outroing","outros","group_outros","check_outros","run_all","transition_in","block","local","transition_out","detach","callback"],"mappings":";AAmCA,MAAMA,IAAW,oBAAI;AAKrB,IAAIC;AAIG,SAASC,IAAe;AAC9B,EAAAD,IAAS;AAAA,IACR,GAAG;AAAA,IACH,GAAG,CAAE;AAAA,IACL,GAAGA;AAAA;AAAA,EACL;AACA;AAIO,SAASE,IAAe;AAC9B,EAAKF,EAAO,KACXG,EAAQH,EAAO,CAAC,GAEjBA,IAASA,EAAO;AACjB;AAOO,SAASI,EAAcC,GAAOC,GAAO;AAC3C,EAAID,KAASA,EAAM,MAClBN,EAAS,OAAOM,CAAK,GACrBA,EAAM,EAAEC,CAAK;AAEf;AASO,SAASC,EAAeF,GAAOC,GAAOE,GAAQC,GAAU;AAC9D,MAAIJ,KAASA,EAAM,GAAG;AACrB,QAAIN,EAAS,IAAIM,CAAK;AAAG;AACzB,IAAAN,EAAS,IAAIM,CAAK,GAClBL,EAAO,EAAE,KAAK,MAAM;AACnB,MAAAD,EAAS,OAAOM,CAAK,GACjBI,MACCD,KAAQH,EAAM,EAAE,CAAC,GACrBI;IAEJ,CAAG,GACDJ,EAAM,EAAEC,CAAK;AAAA,EACb;AAAM,IAAIG,KACVA;AAEF;","x_google_ignoreList":[0]}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
export * from './osd';
|
|
2
2
|
export { default as MouseOverTooltip } from './MouseOverTooltip.svelte';
|
|
3
|
-
export type { SvelteAnnotator, SvelteAnnotatorState } from '@annotorious/core';
|
|
4
|
-
|
|
3
|
+
export type { Annotation, AnnotationBody, AnnotationTarget, Annotator, AnnotatorState, Appearance, AppearanceProvider, Color, DrawingStyle, Filter, FormatAdapter, HoverState, LifecycleEvents, ParseResult, PresentUser, Purpose, Selection, SelectionState, Store, StoreChangeEvent, StoreObserver, SvelteAnnotator, SvelteAnnotatorState, User, W3CAnnotation, W3CAnnotationBody, W3CAnnotationTarget } from '@annotorious/core';
|
|
4
|
+
import { createAnonymousGuest as _createAnonymousGuest, createBody as _createBody, defaultColorProvider as _defaultColorProvider, Origin as _Origin, PointerSelectAction as _PointerSelectAction } from '@annotorious/core';
|
|
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';
|
|
5
17
|
//# 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,eAAe,EACf,oBAAoB,
|
|
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,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,SAAS,EACT,cAAc,EACd,UAAU,EACV,kBAAkB,EAClB,KAAK,EACL,YAAY,EACZ,MAAM,EACN,aAAa,EACb,UAAU,EACV,eAAe,EACf,WAAW,EACX,WAAW,EAC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0-rc.20",
|
|
4
4
|
"description": "Annotorious Svelte bindings",
|
|
5
5
|
"author": "Rainer Simon",
|
|
6
6
|
"license": "BSD-3-Clause",
|
|
@@ -12,22 +12,33 @@
|
|
|
12
12
|
"test": "echo 'Skipping tests in @annotorious/svelte package'"
|
|
13
13
|
},
|
|
14
14
|
"module": "./dist/annotorious-svelte.es.js",
|
|
15
|
-
"types": "./
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
16
|
"svelte": "./src/index.ts",
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@
|
|
19
|
-
"@
|
|
20
|
-
"@
|
|
21
|
-
"
|
|
22
|
-
"svelte": "^3.
|
|
23
|
-
"svelte-
|
|
18
|
+
"@sveltejs/vite-plugin-svelte": "^3.0.2",
|
|
19
|
+
"@tsconfig/svelte": "^5.0.2",
|
|
20
|
+
"@types/openseadragon": "^3.0.10",
|
|
21
|
+
"svelte": "^4.2.12",
|
|
22
|
+
"svelte-check": "^3.6.8",
|
|
23
|
+
"svelte-preprocess": "^5.1.3",
|
|
24
24
|
"tslib": "^2.6.2",
|
|
25
|
-
"typescript": "^
|
|
26
|
-
"vite": "^
|
|
27
|
-
"vite-plugin-dts": "^3.
|
|
25
|
+
"typescript": "^5.3.3",
|
|
26
|
+
"vite": "^5.2.2",
|
|
27
|
+
"vite-plugin-dts": "^3.7.3"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"openseadragon": "^3.0.0 || ^4.0.0"
|
|
31
31
|
},
|
|
32
|
+
"peerDependenciesMeta": {
|
|
33
|
+
"openseadragon": {
|
|
34
|
+
"optional": true
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"@annotorious/annotorious": "*",
|
|
39
|
+
"@annotorious/core": "*",
|
|
40
|
+
"@annotorious/openseadragon": "*",
|
|
41
|
+
"@neodrag/svelte": "^2.0.3"
|
|
42
|
+
},
|
|
32
43
|
"sideEffects": false
|
|
33
44
|
}
|
package/src/index.ts
CHANGED
|
@@ -2,13 +2,80 @@ export * from './osd';
|
|
|
2
2
|
|
|
3
3
|
export { default as MouseOverTooltip } from './MouseOverTooltip.svelte';
|
|
4
4
|
|
|
5
|
-
//
|
|
5
|
+
// Essential re-exports 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,
|
|
7
28
|
SvelteAnnotator,
|
|
8
|
-
SvelteAnnotatorState
|
|
29
|
+
SvelteAnnotatorState,
|
|
30
|
+
User,
|
|
31
|
+
W3CAnnotation,
|
|
32
|
+
W3CAnnotationBody,
|
|
33
|
+
W3CAnnotationTarget
|
|
9
34
|
} from '@annotorious/core';
|
|
10
35
|
|
|
11
|
-
|
|
36
|
+
import {
|
|
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
|
|
12
77
|
export type {
|
|
13
|
-
|
|
14
|
-
} from '@annotorious/
|
|
78
|
+
OpenSeadragonAnnotator as AnnotoriousOpenSeadragonAnnotator
|
|
79
|
+
} from '@annotorious/openseadragon';
|
|
80
|
+
|
|
81
|
+
export type { Viewer } from 'openseadragon';
|
package/vite.config.js
CHANGED
|
File without changes
|