@annotorious/svelte 3.0.0-rc.3 → 3.0.0-rc.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/dist/annotorious-svelte.es.js +17 -14
  2. package/dist/annotorious-svelte.es.js.map +1 -1
  3. package/dist/annotorious-svelte.es10.js +2 -2
  4. package/dist/annotorious-svelte.es10.js.map +1 -1
  5. package/dist/annotorious-svelte.es11.js +2 -20662
  6. package/dist/annotorious-svelte.es11.js.map +1 -1
  7. package/dist/annotorious-svelte.es12.js +50 -115
  8. package/dist/annotorious-svelte.es12.js.map +1 -1
  9. package/dist/annotorious-svelte.es13.js +103 -2
  10. package/dist/annotorious-svelte.es13.js.map +1 -1
  11. package/dist/annotorious-svelte.es2.js +30 -25
  12. package/dist/annotorious-svelte.es2.js.map +1 -1
  13. package/dist/annotorious-svelte.es3.js +114 -2
  14. package/dist/annotorious-svelte.es3.js.map +1 -1
  15. package/dist/annotorious-svelte.es4.js +127 -9
  16. package/dist/annotorious-svelte.es4.js.map +1 -1
  17. package/dist/annotorious-svelte.es5.js +66 -1261
  18. package/dist/annotorious-svelte.es5.js.map +1 -1
  19. package/dist/annotorious-svelte.es6.js +37 -106
  20. package/dist/annotorious-svelte.es6.js.map +1 -1
  21. package/dist/annotorious-svelte.es7.js +24 -118
  22. package/dist/annotorious-svelte.es7.js.map +1 -1
  23. package/dist/annotorious-svelte.es8.js +17 -307
  24. package/dist/annotorious-svelte.es8.js.map +1 -1
  25. package/dist/annotorious-svelte.es9.js +110 -7
  26. package/dist/annotorious-svelte.es9.js.map +1 -1
  27. package/dist/index.d.ts +13 -10
  28. package/dist/index.d.ts.map +1 -1
  29. package/package.json +24 -13
  30. package/src/index.ts +39 -21
  31. package/src/osd/OpenSeadragonAnnotator.svelte +2 -2
  32. package/tsconfig.json +2 -2
  33. package/vite.config.js +8 -5
  34. package/dist/annotorious-svelte.es14.js +0 -20
  35. package/dist/annotorious-svelte.es14.js.map +0 -1
  36. package/dist/annotorious-svelte.es15.js +0 -7
  37. package/dist/annotorious-svelte.es15.js.map +0 -1
  38. package/dist/annotorious-svelte.es16.js +0 -11
  39. package/dist/annotorious-svelte.es16.js.map +0 -1
  40. package/dist/annotorious-svelte.es17.js +0 -10
  41. package/dist/annotorious-svelte.es17.js.map +0 -1
  42. package/dist/annotorious-svelte.es18.js +0 -5
  43. package/dist/annotorious-svelte.es18.js.map +0 -1
  44. /package/dist/{style.css → annotorious-svelte.css} +0 -0
package/src/index.ts CHANGED
@@ -9,54 +9,72 @@ export type {
9
9
  AnnotationTarget,
10
10
  Annotator,
11
11
  AnnotatorState,
12
+ Appearance,
13
+ AppearanceProvider,
12
14
  Color,
13
15
  DrawingStyle,
16
+ Filter,
14
17
  FormatAdapter,
15
- ParseResult,
16
- User,
17
- W3CAnnotation,
18
- W3CAnnotationBody,
19
- W3CAnnotationTarget,
20
- W3CSelector
21
- } from '@annotorious/core/src/model';
22
-
23
- export type {
24
18
  HoverState,
19
+ LifecycleEvents,
20
+ ParseResult,
21
+ PresentUser,
25
22
  Selection,
26
23
  SelectionState,
27
24
  Store,
28
25
  StoreChangeEvent,
29
26
  StoreObserver,
30
27
  SvelteAnnotator,
31
- SvelteAnnotatorState
32
- } from '@annotorious/core/src/state';
28
+ SvelteAnnotatorState,
29
+ User,
30
+ W3CAnnotation,
31
+ W3CAnnotationBody,
32
+ W3CAnnotationTarget
33
+ } from '@annotorious/core';
33
34
 
34
35
  import {
36
+ createAnonymousGuest as _createAnonymousGuest,
37
+ createBody as _createBody,
38
+ defaultColorProvider as _defaultColorProvider,
39
+ Origin as _Origin,
35
40
  PointerSelectAction as _PointerSelectAction
36
- } from '@annotorious/core/src/state';
41
+ } from '@annotorious/core';
37
42
 
38
- export const PointerSelectAction = _PointerSelectAction;
39
-
40
- import {
41
- createBody as _createBody
42
- } from '@annotorious/core/src/utils';
43
-
44
- export const createBody = _createBody;
43
+ export { _createAnonymousGuest as createAnonymousGuest };
44
+ export { _createBody as createBody };
45
+ export { _defaultColorProvider as defaultColorProvider };
46
+ export { _Origin as Origin };
47
+ export { _PointerSelectAction as PointerSelectAction };
45
48
 
46
49
  // Essential re-exports from @annotorious/annotorious
47
50
  export type {
48
- ImageAnnotator,
51
+ AnnotoriousOpts,
52
+ DrawingMode,
53
+ DrawingTool,
54
+ ImageAnnotator as AnnotoriousImageAnnotator,
49
55
  ImageAnnotation,
56
+ ImageAnnotator,
50
57
  ImageAnnotatorState,
51
58
  Polygon,
59
+ PolygonGeometry,
52
60
  Rectangle,
61
+ RectangleGeometry,
53
62
  Shape
54
63
  } from '@annotorious/annotorious';
55
64
 
56
65
  import {
66
+ createImageAnnotator as _createImageAnnotator,
57
67
  ShapeType as _ShapeType,
58
68
  W3CImageFormat as _W3CImageFormat
59
69
  } from '@annotorious/annotorious';
60
70
 
71
+ export const createImageAnnotator = _createImageAnnotator;
61
72
  export const ShapeType = _ShapeType;
62
- export const W3CImageFormat = _W3CImageFormat;
73
+ export const W3CImageFormat = _W3CImageFormat;
74
+
75
+ // Essential re-exports from @annotorious/openseadragon
76
+ export type {
77
+ OpenSeadragonAnnotator as AnnotoriousOpenSeadragonAnnotator
78
+ } from '@annotorious/openseadragon';
79
+
80
+ export type { Viewer } from 'openseadragon';
@@ -1,7 +1,7 @@
1
1
  <script lang="ts">
2
2
  import { setContext } from 'svelte';
3
- import { SvelteAnnotator, SvelteAnnotatorState, toSvelteStore } from '@annotorious/core';
4
- import { createOSDAnnotator, ImageAnnotation } from '@annotorious/openseadragon';
3
+ import { type SvelteAnnotator, type SvelteAnnotatorState, toSvelteStore } from '@annotorious/core';
4
+ import { createOSDAnnotator, type ImageAnnotation } from '@annotorious/openseadragon';
5
5
  import type OpenSeadragon from 'openseadragon';
6
6
 
7
7
  /** props **/
package/tsconfig.json CHANGED
@@ -8,7 +8,6 @@
8
8
  "esModuleInterop": true,
9
9
  "forceConsistentCasingInFileNames": true,
10
10
  "ignoreDeprecations": "5.0",
11
- "importsNotUsedAsValues": "error",
12
11
  "incremental": false,
13
12
  "isolatedModules": true,
14
13
  "module": "ESNext",
@@ -18,7 +17,8 @@
18
17
  "skipLibCheck": false,
19
18
  "sourceMap": true,
20
19
  "target": "ESNext",
21
- "types": ["svelte"]
20
+ "types": ["svelte"],
21
+ "verbatimModuleSyntax": true
22
22
  },
23
23
  "include": ["./src/**/*", "./test/**/*"],
24
24
  "exclude": ["node_modules", "dist"]
package/vite.config.js CHANGED
@@ -24,14 +24,17 @@ export default defineConfig({
24
24
  fileName: (format) => `annotorious-svelte.${format}.js`
25
25
  },
26
26
  rollupOptions: {
27
- external: [...Object.keys(packageJson.peerDependencies)],
27
+ external: [
28
+ ...Object.keys(packageJson.peerDependencies),
29
+ '@annotorious/core',
30
+ '@annotorious/annotorious',
31
+ '@annotorious/openseadragon'
32
+ ],
28
33
  output: {
29
34
  preserveModules: true,
30
- globals: {
31
- openseadragon: 'OpenSeadragon'
32
- }
35
+ assetFileNames: 'annotorious-svelte.[ext]'
33
36
  }
34
37
  },
35
38
  sourcemap: true
36
39
  }
37
- });
40
+ });
@@ -1,20 +0,0 @@
1
- import e from "./annotorious-svelte.es15.js";
2
- import i from "./annotorious-svelte.es16.js";
3
- import { unsafeStringify as d } from "./annotorious-svelte.es17.js";
4
- function g(n, m, t) {
5
- if (e.randomUUID && !m && !n)
6
- return e.randomUUID();
7
- n = n || {};
8
- const r = n.random || (n.rng || i)();
9
- if (r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, m) {
10
- t = t || 0;
11
- for (let a = 0; a < 16; ++a)
12
- m[t + a] = r[a];
13
- return m;
14
- }
15
- return d(r);
16
- }
17
- export {
18
- g as default
19
- };
20
- //# sourceMappingURL=annotorious-svelte.es14.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"annotorious-svelte.es14.js","sources":["../../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/v4.js"],"sourcesContent":["import native from './native.js';\nimport rng from './rng.js';\nimport { unsafeStringify } from './stringify.js';\n\nfunction v4(options, buf, offset) {\n if (native.randomUUID && !buf && !options) {\n return native.randomUUID();\n }\n\n options = options || {};\n const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return unsafeStringify(rnds);\n}\n\nexport default v4;"],"names":["v4","options","buf","offset","native","rnds","rng","i","unsafeStringify"],"mappings":";;;AAIA,SAASA,EAAGC,GAASC,GAAKC,GAAQ;AAChC,MAAIC,EAAO,cAAc,CAACF,KAAO,CAACD;AAChC,WAAOG,EAAO;AAGhB,EAAAH,IAAUA,KAAW;AACrB,QAAMI,IAAOJ,EAAQ,WAAWA,EAAQ,OAAOK;AAK/C,MAHAD,EAAK,CAAC,IAAIA,EAAK,CAAC,IAAI,KAAO,IAC3BA,EAAK,CAAC,IAAIA,EAAK,CAAC,IAAI,KAAO,KAEvBH,GAAK;AACP,IAAAC,IAASA,KAAU;AAEnB,aAASI,IAAI,GAAGA,IAAI,IAAI,EAAEA;AACxB,MAAAL,EAAIC,IAASI,CAAC,IAAIF,EAAKE,CAAC;AAG1B,WAAOL;AAAA,EACR;AAED,SAAOM,EAAgBH,CAAI;AAC7B;","x_google_ignoreList":[0]}
@@ -1,7 +0,0 @@
1
- const o = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), t = {
2
- randomUUID: o
3
- };
4
- export {
5
- t as default
6
- };
7
- //# sourceMappingURL=annotorious-svelte.es15.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"annotorious-svelte.es15.js","sources":["../../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/native.js"],"sourcesContent":["const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);\nexport default {\n randomUUID\n};"],"names":["randomUUID","native"],"mappings":"AAAA,MAAMA,IAAa,OAAO,SAAW,OAAe,OAAO,cAAc,OAAO,WAAW,KAAK,MAAM,GACvFC,IAAA;AAAA,EACb,YAAAD;AACF;","x_google_ignoreList":[0]}
@@ -1,11 +0,0 @@
1
- let t;
2
- const e = new Uint8Array(16);
3
- function o() {
4
- if (!t && (t = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !t))
5
- throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
6
- return t(e);
7
- }
8
- export {
9
- o as default
10
- };
11
- //# sourceMappingURL=annotorious-svelte.es16.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"annotorious-svelte.es16.js","sources":["../../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/rng.js"],"sourcesContent":["// Unique ID creation requires a high quality random # generator. In the browser we therefore\n// require the crypto API and do not support built-in fallback to lower quality random number\n// generators (like Math.random()).\nlet getRandomValues;\nconst rnds8 = new Uint8Array(16);\nexport default function rng() {\n // lazy load so that environments that need to polyfill have a chance to do so\n if (!getRandomValues) {\n // getRandomValues needs to be invoked in a context where \"this\" is a Crypto implementation.\n getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);\n\n if (!getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n }\n\n return getRandomValues(rnds8);\n}"],"names":["getRandomValues","rnds8","rng"],"mappings":"AAGA,IAAIA;AACJ,MAAMC,IAAQ,IAAI,WAAW,EAAE;AAChB,SAASC,IAAM;AAE5B,MAAI,CAACF,MAEHA,IAAkB,OAAO,SAAW,OAAe,OAAO,mBAAmB,OAAO,gBAAgB,KAAK,MAAM,GAE3G,CAACA;AACH,UAAM,IAAI,MAAM,0GAA0G;AAI9H,SAAOA,EAAgBC,CAAK;AAC9B;","x_google_ignoreList":[0]}
@@ -1,10 +0,0 @@
1
- const i = [];
2
- for (let n = 0; n < 256; ++n)
3
- i.push((n + 256).toString(16).slice(1));
4
- function c(n, u = 0) {
5
- return i[n[u + 0]] + i[n[u + 1]] + i[n[u + 2]] + i[n[u + 3]] + "-" + i[n[u + 4]] + i[n[u + 5]] + "-" + i[n[u + 6]] + i[n[u + 7]] + "-" + i[n[u + 8]] + i[n[u + 9]] + "-" + i[n[u + 10]] + i[n[u + 11]] + i[n[u + 12]] + i[n[u + 13]] + i[n[u + 14]] + i[n[u + 15]];
6
- }
7
- export {
8
- c as unsafeStringify
9
- };
10
- //# sourceMappingURL=annotorious-svelte.es17.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"annotorious-svelte.es17.js","sources":["../../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/stringify.js"],"sourcesContent":["import validate from './validate.js';\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\nconst byteToHex = [];\n\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).slice(1));\n}\n\nexport function unsafeStringify(arr, offset = 0) {\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];\n}\n\nfunction stringify(arr, offset = 0) {\n const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nexport default stringify;"],"names":["byteToHex","i","unsafeStringify","arr","offset"],"mappings":"AAMA,MAAMA,IAAY,CAAA;AAElB,SAASC,IAAI,GAAGA,IAAI,KAAK,EAAEA;AACzB,EAAAD,EAAU,MAAMC,IAAI,KAAO,SAAS,EAAE,EAAE,MAAM,CAAC,CAAC;AAG3C,SAASC,EAAgBC,GAAKC,IAAS,GAAG;AAG/C,SAAOJ,EAAUG,EAAIC,IAAS,CAAC,CAAC,IAAIJ,EAAUG,EAAIC,IAAS,CAAC,CAAC,IAAIJ,EAAUG,EAAIC,IAAS,CAAC,CAAC,IAAIJ,EAAUG,EAAIC,IAAS,CAAC,CAAC,IAAI,MAAMJ,EAAUG,EAAIC,IAAS,CAAC,CAAC,IAAIJ,EAAUG,EAAIC,IAAS,CAAC,CAAC,IAAI,MAAMJ,EAAUG,EAAIC,IAAS,CAAC,CAAC,IAAIJ,EAAUG,EAAIC,IAAS,CAAC,CAAC,IAAI,MAAMJ,EAAUG,EAAIC,IAAS,CAAC,CAAC,IAAIJ,EAAUG,EAAIC,IAAS,CAAC,CAAC,IAAI,MAAMJ,EAAUG,EAAIC,IAAS,EAAE,CAAC,IAAIJ,EAAUG,EAAIC,IAAS,EAAE,CAAC,IAAIJ,EAAUG,EAAIC,IAAS,EAAE,CAAC,IAAIJ,EAAUG,EAAIC,IAAS,EAAE,CAAC,IAAIJ,EAAUG,EAAIC,IAAS,EAAE,CAAC,IAAIJ,EAAUG,EAAIC,IAAS,EAAE,CAAC;AACnf;","x_google_ignoreList":[0]}
@@ -1,5 +0,0 @@
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
- };
5
- //# sourceMappingURL=annotorious-svelte.es18.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"annotorious-svelte.es18.js","sources":["../../../node_modules/.pnpm/nanoid@5.0.4/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]}
File without changes