vistaview 0.10.15 → 0.10.17
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/README.md +16 -1
- package/dist/VistaView.svelte.d.ts +1 -0
- package/dist/react.d.ts +4 -5
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +33 -22
- package/dist/solid.d.ts +8 -4
- package/dist/solid.d.ts.map +1 -1
- package/dist/solid.js +46 -28
- package/dist/svelte.d.ts +3 -7
- package/dist/svelte.d.ts.map +1 -1
- package/dist/svelte.js +1843 -33
- package/dist/vue.d.ts +5 -18
- package/dist/vue.d.ts.map +1 -1
- package/dist/vue.js +30 -36
- package/dist/web-D29dUeNW.js +448 -0
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -344,7 +344,7 @@ VistaView provides official bindings for popular frameworks:
|
|
|
344
344
|
|
|
345
345
|
- **React** — `useVistaView` hook and `<VistaView>` component
|
|
346
346
|
- **Vue 3** — `useVistaView` composable and `<VistaView>` component
|
|
347
|
-
- **Svelte** — `useVistaView` hook and
|
|
347
|
+
- **Svelte** — `useVistaView` hook and `<VistaView>` component
|
|
348
348
|
- **Solid** — `useVistaView` hook and `createVistaView` directive
|
|
349
349
|
- **Angular** — Manual setup example
|
|
350
350
|
- **Vanilla JS** — Works out of the box
|
|
@@ -369,6 +369,21 @@ function Gallery() {
|
|
|
369
369
|
}
|
|
370
370
|
```
|
|
371
371
|
|
|
372
|
+
### Quick Example (Svelte)
|
|
373
|
+
|
|
374
|
+
```svelte
|
|
375
|
+
<script>
|
|
376
|
+
import { VistaView } from 'vistaview/svelte';
|
|
377
|
+
import 'vistaview/style.css';
|
|
378
|
+
</script>
|
|
379
|
+
|
|
380
|
+
<VistaView selector="> a">
|
|
381
|
+
<a href="/full.jpg">
|
|
382
|
+
<img src="/thumb.jpg" alt="Photo" />
|
|
383
|
+
</a>
|
|
384
|
+
</VistaView>
|
|
385
|
+
```
|
|
386
|
+
|
|
372
387
|
## Accessibility
|
|
373
388
|
|
|
374
389
|
VistaView is built with accessibility in mind:
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SvelteComponent as default } from 'svelte';
|
package/dist/react.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { VistaParamsNeo, VistaInterface } from './vistaview';
|
|
2
|
+
import { VistaParamsNeo, VistaInterface, VistaOpt } from './vistaview';
|
|
3
3
|
export declare function useVistaView(options: VistaParamsNeo): VistaInterface;
|
|
4
|
-
export interface VistaViewProps
|
|
4
|
+
export interface VistaViewProps {
|
|
5
5
|
children: ReactNode;
|
|
6
|
-
className?: string;
|
|
7
|
-
id?: string;
|
|
8
6
|
selector?: string;
|
|
7
|
+
options?: VistaOpt;
|
|
9
8
|
}
|
|
10
|
-
export declare const VistaView: import('react').ForwardRefExoticComponent<VistaViewProps & import('react').RefAttributes<VistaInterface>>;
|
|
9
|
+
export declare const VistaView: import('react').ForwardRefExoticComponent<VistaViewProps & import('react').HTMLAttributes<HTMLDivElement> & import('react').RefAttributes<VistaInterface>>;
|
|
11
10
|
//# sourceMappingURL=react.d.ts.map
|
package/dist/react.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../src/react.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../src/react.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5E,wBAAgB,YAAY,CAAC,OAAO,EAAE,cAAc,GAAG,cAAc,CAuBpE;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,QAAQ,CAAC;CACpB;AAED,eAAO,MAAM,SAAS,4JA6BrB,CAAC"}
|
package/dist/react.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import { forwardRef as
|
|
2
|
+
import { t as v, u as I, s as g, i as w } from "./web-D29dUeNW.js";
|
|
3
|
+
import { forwardRef as y, useRef as l, useId as x, useImperativeHandle as V, useEffect as i, useCallback as t } from "react";
|
|
4
4
|
import { vistaView as m } from "./vistaview.js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
import { mergeProps as $ } from "solid-js";
|
|
6
|
+
var z = /* @__PURE__ */ v("<div>");
|
|
7
|
+
function _(o) {
|
|
8
|
+
const r = l(null);
|
|
9
|
+
return i(() => (r.current = m(o), () => {
|
|
8
10
|
var e;
|
|
9
11
|
(e = r.current) == null || e.destroy(), r.current = null;
|
|
10
12
|
}), []), {
|
|
@@ -50,22 +52,31 @@ function z(c) {
|
|
|
50
52
|
}, [])
|
|
51
53
|
};
|
|
52
54
|
}
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
55
|
+
const b = y(({
|
|
56
|
+
children: o,
|
|
57
|
+
selector: r = "> a",
|
|
58
|
+
options: e,
|
|
59
|
+
id: n,
|
|
60
|
+
...d
|
|
61
|
+
}, p) => {
|
|
62
|
+
const a = l(null), s = l(null), f = x(), c = n || `vvw-gallery-${f.replace(/:/g, "")}`;
|
|
63
|
+
return V(p, () => s.current, []), i(() => {
|
|
64
|
+
if (a.current)
|
|
65
|
+
return s.current = m({
|
|
66
|
+
...e,
|
|
67
|
+
elements: `#${c} ${r}`
|
|
68
|
+
}), () => {
|
|
69
|
+
var u;
|
|
70
|
+
(u = s.current) == null || u.destroy(), s.current = null;
|
|
71
|
+
};
|
|
72
|
+
}, [c, r]), (() => {
|
|
73
|
+
var u = z();
|
|
74
|
+
return I(a, u), g(u, $(d, {
|
|
75
|
+
id: c
|
|
76
|
+
}), !1), w(u, o), u;
|
|
77
|
+
})();
|
|
78
|
+
});
|
|
68
79
|
export {
|
|
69
|
-
|
|
70
|
-
|
|
80
|
+
b as VistaView,
|
|
81
|
+
_ as useVistaView
|
|
71
82
|
};
|
package/dist/solid.d.ts
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import { VistaParamsNeo, VistaInterface } from './vistaview';
|
|
1
|
+
import { VistaParamsNeo, VistaInterface, VistaOpt } from './vistaview';
|
|
2
2
|
export declare function useVistaView(options: VistaParamsNeo): VistaInterface;
|
|
3
|
-
export interface
|
|
4
|
-
id?: string;
|
|
3
|
+
export interface VistaViewProps {
|
|
5
4
|
selector?: string;
|
|
5
|
+
options?: VistaOpt;
|
|
6
6
|
ref?: (instance: VistaInterface) => void;
|
|
7
7
|
}
|
|
8
|
-
export declare function
|
|
8
|
+
export declare function VistaView(props: VistaViewProps & {
|
|
9
|
+
children: any;
|
|
10
|
+
id?: string;
|
|
11
|
+
[key: string]: any;
|
|
12
|
+
}): import("solid-js").JSX.Element;
|
|
9
13
|
//# sourceMappingURL=solid.d.ts.map
|
package/dist/solid.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"solid.d.ts","sourceRoot":"","sources":["../src/solid.
|
|
1
|
+
{"version":3,"file":"solid.d.ts","sourceRoot":"","sources":["../src/solid.tsx"],"names":[],"mappings":"AAAA,gCAAgC;AAIhC,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5E,wBAAgB,YAAY,CAAC,OAAO,EAAE,cAAc,GAAG,cAAc,CAmBpE;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,QAAQ,CAAC;IACnB,GAAG,CAAC,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,IAAI,CAAC;CAC1C;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,GAAG;IAAE,QAAQ,EAAE,GAAG,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,kCA8BnG"}
|
package/dist/solid.js
CHANGED
|
@@ -1,35 +1,53 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { t as y, u as I, s as x, i as V } from "./web-D29dUeNW.js";
|
|
2
|
+
import { onCleanup as m, createSignal as $, onMount as z, mergeProps as C } from "solid-js";
|
|
3
|
+
import { vistaView as p } from "./vistaview.js";
|
|
4
|
+
var a = /* @__PURE__ */ y("<div>");
|
|
5
|
+
function P(t) {
|
|
6
|
+
const r = p(t);
|
|
7
|
+
return m(() => {
|
|
8
|
+
r == null || r.destroy();
|
|
7
9
|
}), {
|
|
8
|
-
open: (e = 0) =>
|
|
9
|
-
close: () => (
|
|
10
|
-
reset: () =>
|
|
11
|
-
next: () =>
|
|
12
|
-
prev: () =>
|
|
13
|
-
zoomIn: () =>
|
|
14
|
-
zoomOut: () =>
|
|
15
|
-
getCurrentIndex: () => (
|
|
16
|
-
view: (e) =>
|
|
17
|
-
destroy: () =>
|
|
10
|
+
open: (e = 0) => r == null ? void 0 : r.open(e),
|
|
11
|
+
close: () => (r == null ? void 0 : r.close()) ?? Promise.resolve(),
|
|
12
|
+
reset: () => r == null ? void 0 : r.reset(),
|
|
13
|
+
next: () => r == null ? void 0 : r.next(),
|
|
14
|
+
prev: () => r == null ? void 0 : r.prev(),
|
|
15
|
+
zoomIn: () => r == null ? void 0 : r.zoomIn(),
|
|
16
|
+
zoomOut: () => r == null ? void 0 : r.zoomOut(),
|
|
17
|
+
getCurrentIndex: () => (r == null ? void 0 : r.getCurrentIndex()) ?? -1,
|
|
18
|
+
view: (e) => r == null ? void 0 : r.view(e),
|
|
19
|
+
destroy: () => r == null ? void 0 : r.destroy()
|
|
18
20
|
};
|
|
19
21
|
}
|
|
20
|
-
function
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
function S(t) {
|
|
23
|
+
const [r, e] = $(null);
|
|
24
|
+
let s;
|
|
25
|
+
const {
|
|
26
|
+
selector: d = "> a",
|
|
27
|
+
options: v,
|
|
28
|
+
ref: l,
|
|
29
|
+
id: f,
|
|
30
|
+
children: g,
|
|
31
|
+
...i
|
|
32
|
+
} = t, u = f || `vvw-gallery-${Math.random().toString(36).substr(2, 9)}`;
|
|
33
|
+
return z(() => {
|
|
34
|
+
if (!s) return;
|
|
35
|
+
const o = p({
|
|
36
|
+
...v,
|
|
37
|
+
elements: `#${u} ${d}`
|
|
26
38
|
});
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
39
|
+
o && (e(o), l == null || l(o));
|
|
40
|
+
}), m(() => {
|
|
41
|
+
var o;
|
|
42
|
+
(o = r()) == null || o.destroy();
|
|
43
|
+
}), (() => {
|
|
44
|
+
var o = a();
|
|
45
|
+
return I((w) => s = w, o), x(o, C(i, {
|
|
46
|
+
id: u
|
|
47
|
+
}), !1), V(o, g), o;
|
|
48
|
+
})();
|
|
31
49
|
}
|
|
32
50
|
export {
|
|
33
|
-
|
|
34
|
-
|
|
51
|
+
S as VistaView,
|
|
52
|
+
P as useVistaView
|
|
35
53
|
};
|
package/dist/svelte.d.ts
CHANGED
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
import { VistaParamsNeo, VistaInterface } from './vistaview';
|
|
1
|
+
import { VistaParamsNeo, VistaInterface, VistaOpt } from './vistaview';
|
|
2
2
|
export declare function useVistaView(options: VistaParamsNeo): VistaInterface;
|
|
3
|
-
export interface VistaViewProps extends
|
|
4
|
-
id?: string;
|
|
5
|
-
class?: string;
|
|
3
|
+
export interface VistaViewProps extends VistaOpt {
|
|
6
4
|
selector?: string;
|
|
7
5
|
ref?: VistaInterface;
|
|
8
6
|
}
|
|
9
|
-
export
|
|
10
|
-
destroy(): void;
|
|
11
|
-
};
|
|
7
|
+
export { default as VistaView } from './VistaView.svelte';
|
|
12
8
|
//# sourceMappingURL=svelte.d.ts.map
|
package/dist/svelte.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"svelte.d.ts","sourceRoot":"","sources":["../src/svelte.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"svelte.d.ts","sourceRoot":"","sources":["../src/svelte.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C,wBAAgB,YAAY,CAAC,OAAO,EAAE,cAAc,GAAG,cAAc,CA8BpE;AAED,MAAM,WAAW,cAAe,SAAQ,QAAQ;IAC9C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,cAAc,CAAC;CACtB;AAED,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,oBAAoB,CAAC"}
|