@annotorious/svelte 3.0.0-rc.20 → 3.0.0-rc.3
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 +14 -17
- package/dist/annotorious-svelte.es.js.map +1 -1
- package/dist/annotorious-svelte.es10.js +2 -26
- package/dist/annotorious-svelte.es10.js.map +1 -1
- package/dist/annotorious-svelte.es11.js +20640 -89
- package/dist/annotorious-svelte.es11.js.map +1 -1
- package/dist/annotorious-svelte.es12.js +122 -2
- package/dist/annotorious-svelte.es12.js.map +1 -1
- package/dist/annotorious-svelte.es13.js +2 -2
- package/dist/annotorious-svelte.es13.js.map +1 -1
- package/dist/annotorious-svelte.es14.js +16 -27435
- package/dist/annotorious-svelte.es14.js.map +1 -1
- package/dist/annotorious-svelte.es15.js +3 -119
- package/dist/annotorious-svelte.es15.js.map +1 -1
- package/dist/annotorious-svelte.es16.js +10 -1
- package/dist/annotorious-svelte.es16.js.map +1 -1
- package/dist/annotorious-svelte.es17.js +6 -55
- package/dist/annotorious-svelte.es17.js.map +1 -1
- package/dist/annotorious-svelte.es18.js +5 -0
- package/dist/annotorious-svelte.es18.js.map +1 -0
- package/dist/annotorious-svelte.es2.js +25 -30
- package/dist/annotorious-svelte.es2.js.map +1 -1
- package/dist/annotorious-svelte.es3.js +2 -95
- package/dist/annotorious-svelte.es3.js.map +1 -1
- package/dist/annotorious-svelte.es4.js +8 -4238
- package/dist/annotorious-svelte.es4.js.map +1 -1
- package/dist/annotorious-svelte.es5.js +1263 -86
- package/dist/annotorious-svelte.es5.js.map +1 -1
- package/dist/annotorious-svelte.es6.js +87 -104
- package/dist/annotorious-svelte.es6.js.map +1 -1
- package/dist/annotorious-svelte.es7.js +118 -92
- package/dist/annotorious-svelte.es7.js.map +1 -1
- package/dist/annotorious-svelte.es8.js +303 -31
- package/dist/annotorious-svelte.es8.js.map +1 -1
- package/dist/annotorious-svelte.es9.js +8 -31
- package/dist/annotorious-svelte.es9.js.map +1 -1
- package/dist/index.d.ts +8 -11
- package/dist/index.d.ts.map +1 -1
- package/package.json +11 -22
- package/src/index.ts +21 -40
- package/vite.config.js +0 -1
- /package/dist/{annotorious-svelte.css → style.css} +0 -0
|
@@ -1,20 +1,17 @@
|
|
|
1
|
-
import { default as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { default as
|
|
6
|
-
|
|
1
|
+
import { default as l } from "./annotorious-svelte.es2.js";
|
|
2
|
+
import { PointerSelectAction as o } from "./annotorious-svelte.es3.js";
|
|
3
|
+
import { createBody as e } from "./annotorious-svelte.es4.js";
|
|
4
|
+
import { ShapeType as t, W3CImageFormat as r } from "./annotorious-svelte.es5.js";
|
|
5
|
+
import { default as u } from "./annotorious-svelte.es6.js";
|
|
6
|
+
import { default as g } from "./annotorious-svelte.es7.js";
|
|
7
|
+
const c = o, m = e, s = t, i = r;
|
|
7
8
|
export {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
u as createAnonymousGuest,
|
|
16
|
-
g as createBody,
|
|
17
|
-
r as createImageAnnotator,
|
|
18
|
-
l as defaultColorProvider
|
|
9
|
+
l as MouseOverTooltip,
|
|
10
|
+
u as OpenSeadragonAnnotator,
|
|
11
|
+
g as OpenSeadragonPopup,
|
|
12
|
+
c as PointerSelectAction,
|
|
13
|
+
s as ShapeType,
|
|
14
|
+
i as W3CImageFormat,
|
|
15
|
+
m as createBody
|
|
19
16
|
};
|
|
20
17
|
//# sourceMappingURL=annotorious-svelte.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"annotorious-svelte.es.js","sources":["../src/index.ts"],"sourcesContent":["export * from './osd';\n\nexport { default as MouseOverTooltip } from './MouseOverTooltip.svelte';\n\n// Essential re-exports from @annotorious/core\nexport type {\n Annotation,\n AnnotationBody,\n AnnotationTarget,\n Annotator,\n AnnotatorState,\n
|
|
1
|
+
{"version":3,"file":"annotorious-svelte.es.js","sources":["../src/index.ts"],"sourcesContent":["export * from './osd';\n\nexport { default as MouseOverTooltip } from './MouseOverTooltip.svelte';\n\n// Essential re-exports from @annotorious/core\nexport type {\n Annotation,\n AnnotationBody,\n AnnotationTarget,\n Annotator,\n AnnotatorState,\n Color,\n DrawingStyle,\n FormatAdapter,\n ParseResult,\n User,\n W3CAnnotation,\n W3CAnnotationBody,\n W3CAnnotationTarget,\n W3CSelector\n} from '@annotorious/core/src/model';\n\nexport type { \n HoverState,\n Selection,\n SelectionState,\n Store,\n StoreChangeEvent,\n StoreObserver,\n SvelteAnnotator,\n SvelteAnnotatorState\n} from '@annotorious/core/src/state';\n\nimport {\n PointerSelectAction as _PointerSelectAction\n} from '@annotorious/core/src/state';\n\nexport const PointerSelectAction = _PointerSelectAction;\n\nimport {\n createBody as _createBody\n} from '@annotorious/core/src/utils';\n\nexport const createBody = _createBody;\n\n// Essential re-exports from @annotorious/annotorious \nexport type {\n ImageAnnotator,\n ImageAnnotation,\n ImageAnnotatorState,\n Polygon,\n Rectangle,\n Shape\n} from '@annotorious/annotorious';\n\nimport { \n ShapeType as _ShapeType,\n W3CImageFormat as _W3CImageFormat\n} from '@annotorious/annotorious';\n\nexport const ShapeType = _ShapeType;\nexport const W3CImageFormat = _W3CImageFormat;"],"names":["PointerSelectAction","_PointerSelectAction","createBody","_createBody","ShapeType","_ShapeType","W3CImageFormat","_W3CImageFormat"],"mappings":";;;;;;AAqCO,MAAMA,IAAsBC,GAMtBC,IAAaC,GAiBbC,IAAYC,GACZC,IAAiBC;"}
|
|
@@ -1,27 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
t = n;
|
|
4
|
-
}
|
|
5
|
-
function o() {
|
|
6
|
-
if (!t)
|
|
7
|
-
throw new Error("Function called outside component initialization");
|
|
8
|
-
return t;
|
|
9
|
-
}
|
|
10
|
-
function u(n) {
|
|
11
|
-
o().$$.on_mount.push(n);
|
|
12
|
-
}
|
|
13
|
-
function c(n, e) {
|
|
14
|
-
return o().$$.context.set(n, e), e;
|
|
15
|
-
}
|
|
16
|
-
function i(n) {
|
|
17
|
-
return o().$$.context.get(n);
|
|
18
|
-
}
|
|
19
|
-
export {
|
|
20
|
-
t as current_component,
|
|
21
|
-
i as getContext,
|
|
22
|
-
o as get_current_component,
|
|
23
|
-
u as onMount,
|
|
24
|
-
c as setContext,
|
|
25
|
-
r as set_current_component
|
|
26
|
-
};
|
|
1
|
+
import { nanoid as o } from "./annotorious-svelte.es18.js";
|
|
2
|
+
o();
|
|
27
3
|
//# sourceMappingURL=annotorious-svelte.es10.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"annotorious-svelte.es10.js","sources":["
|
|
1
|
+
{"version":3,"file":"annotorious-svelte.es10.js","sources":["../../annotorious-core/src/presence/PresenceState.ts"],"sourcesContent":["import { nanoid } from 'nanoid';\nimport { createNanoEvents, type Unsubscribe } from 'nanoevents';\nimport type { User } from '../model';\nimport type { PresentUser } from './PresentUser';\nimport type { PresenceEvents } from './PresenceEvents';\nimport { createDefaultAppearenceProvider } from './AppearanceProvider';\nimport type { AppearanceProvider } from './AppearanceProvider';\n\nexport interface PresenceState {\n\n // Get users currently present to this room\n getPresentUsers(): PresentUser[];\n\n // Notify of a given present user's activity on the given annotations\n notifyActivity(presenceKey: string, annotationIds: string[]): void;\n\n // Add a listener for the given presence event\n on<E extends keyof PresenceEvents>(event: E, callback: PresenceEvents[E]): Unsubscribe;\n\n // Initial sync - which users are present under which keys\n syncUsers(state: { presenceKey: string, user: User }[]): void;\n\n // Update the selection state for the given prresent user\n updateSelection(presenceKey: string, selection: string[] | null): void;\n\n}\n\nconst isListEqual = (listA: any[], listB: any[]) => \n listA.every(a => listA.includes(a)) && listB.every(b => listA.includes(b));\n\n// This client's presence key\nexport const PRESENCE_KEY = nanoid();\n\nexport const createPresenceState = (\n appearanceProvider: AppearanceProvider = createDefaultAppearenceProvider()\n): PresenceState => {\n\n const emitter = createNanoEvents<PresenceEvents>();\n\n const presentUsers = new Map<string, PresentUser>();\n\n const selectionStates = new Map<string, string[]>();\n\n const addUser = (presenceKey: string, user: User) => {\n if (presentUsers.has(presenceKey)) {\n console.warn('Attempt to add user that is already present', presenceKey, user);\n return; \n }\n\n const appearance = appearanceProvider.addUser(presenceKey, user);\n\n presentUsers.set(presenceKey, { \n ...user,\n presenceKey,\n appearance\n });\n }\n\n const removeUser = (presenceKey: string) => {\n const user = presentUsers.get(presenceKey);\n if (!user) {\n console.warn('Attempt to remove user that is not present', presenceKey);\n return;\n }\n\n appearanceProvider.removeUser(user);\n\n presentUsers.delete(presenceKey);\n }\n\n const syncUsers = (state: { presenceKey: string, user: User }[]) => {\n // const keys = new Set(others.map(s => s.presenceKey));\n const keys = new Set(state.map(s => s.presenceKey));\n\n // These users need to be added to the presentUsers list\n // const toAdd = others.filter(({ presenceKey }) => !presentUsers.has(presenceKey));\n const toAdd = state.filter(({ presenceKey }) => !presentUsers.has(presenceKey));\n\n // These users need to be dropped from the list\n const toRemove = Array.from(presentUsers.values()).filter(presentUser =>\n !keys.has(presentUser.presenceKey));\n\n toAdd.forEach(({ presenceKey, user }) => addUser(presenceKey, user));\n\n toRemove.forEach(user => {\n const { presenceKey } = user;\n\n // If this user has a selection, fire deselect event\n if (selectionStates.has(presenceKey))\n emitter.emit('selectionChange', user, null);\n\n removeUser(presenceKey)\n });\n\n if (toAdd.length > 0 || toRemove.length > 0)\n emitter.emit('presence', getPresentUsers());\n }\n\n const notifyActivity = (presenceKey: string, annotationIds: string[]) => { \n const user = presentUsers.get(presenceKey);\n \n if (!user) {\n console.warn('Activity notification from user that is not present');\n return;\n }\n\n const currentSelection = selectionStates.get(presenceKey);\n\n // Was there a selection change we might have missed?\n if (!currentSelection || !isListEqual(currentSelection, annotationIds)) {\n selectionStates.set(presenceKey, annotationIds);\n emitter.emit('selectionChange', user, annotationIds);\n }\n }\n\n const updateSelection = (presenceKey: string, selection: string[] | null) => {\n const from = presentUsers.get(presenceKey);\n if (!from) {\n console.warn('Selection change for user that is not present', presenceKey);\n return;\n }\n\n if (selection)\n selectionStates.set(presenceKey, selection);\n else \n selectionStates.delete(presenceKey);\n\n emitter.emit('selectionChange', from, selection);\n }\n\n const getPresentUsers = () =>\n [...Array.from(presentUsers.values())];\n \n const on = <E extends keyof PresenceEvents>(event: E, callback: PresenceEvents[E]) =>\n emitter.on(event, callback);\n\n return {\n getPresentUsers,\n notifyActivity,\n on,\n syncUsers,\n updateSelection\n }\n\n}"],"names":["nanoid"],"mappings":";AA+B4BA,EAAO;"}
|