vistaview 0.10.16 → 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 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 `createVistaView` action
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
2
  import { VistaParamsNeo, VistaInterface, VistaOpt } from './vistaview';
3
3
  export declare function useVistaView(options: VistaParamsNeo): VistaInterface;
4
- export interface VistaViewProps extends VistaOpt {
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
@@ -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,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5E,wBAAgB,YAAY,CAAC,OAAO,EAAE,cAAc,GAAG,cAAc,CAuBpE;AAED,MAAM,WAAW,cAAe,SAAQ,QAAQ;IAC9C,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,SAAS,2GA6BrB,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 { jsx as v } from "react/jsx-runtime";
3
- import { forwardRef as I, useRef as s, useId as w, useImperativeHandle as g, useEffect as a, useCallback as t } from "react";
4
- import { vistaView as d } from "./vistaview.js";
5
- function z(c) {
6
- const r = s(null);
7
- return a(() => (r.current = d(c), () => {
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
+ import { vistaView as m } from "./vistaview.js";
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 R = I(
54
- ({ children: c, className: r, id: e, selector: n = "> a", ...f }, m) => {
55
- const l = s(null), u = s(null), p = w(), o = e || `vvw-gallery-${p.replace(/:/g, "")}`;
56
- return g(m, () => u.current, []), a(() => {
57
- if (l.current)
58
- return u.current = d({
59
- ...f,
60
- elements: `#${o} ${n}`
61
- }), () => {
62
- var i;
63
- (i = u.current) == null || i.destroy(), u.current = null;
64
- };
65
- }, [o, n]), /* @__PURE__ */ v("div", { ref: l, id: o, className: r, children: c });
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
- R as VistaView,
70
- z as useVistaView
80
+ b as VistaView,
81
+ _ as useVistaView
71
82
  };
package/dist/solid.d.ts CHANGED
@@ -1,9 +1,13 @@
1
1
  import { VistaParamsNeo, VistaInterface, VistaOpt } from './vistaview';
2
2
  export declare function useVistaView(options: VistaParamsNeo): VistaInterface;
3
- export interface VistaViewOptions extends VistaOpt {
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 createVistaView(element: HTMLElement, options: VistaViewOptions): void;
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
@@ -1 +1 @@
1
- {"version":3,"file":"solid.d.ts","sourceRoot":"","sources":["../src/solid.ts"],"names":[],"mappings":"AAEA,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,gBAAiB,SAAQ,QAAQ;IAChD,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,IAAI,CAAC;CAC1C;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,gBAAgB,QAmB9E"}
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 { onCleanup as d, onMount as p } from "solid-js";
2
- import { vistaView as u } from "./vistaview.js";
3
- function y(t) {
4
- const o = u(t);
5
- return d(() => {
6
- o == null || o.destroy();
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: (r = 0) => o == null ? void 0 : o.open(r),
9
- close: () => (o == null ? void 0 : o.close()) ?? Promise.resolve(),
10
- reset: () => o == null ? void 0 : o.reset(),
11
- next: () => o == null ? void 0 : o.next(),
12
- prev: () => o == null ? void 0 : o.prev(),
13
- zoomIn: () => o == null ? void 0 : o.zoomIn(),
14
- zoomOut: () => o == null ? void 0 : o.zoomOut(),
15
- getCurrentIndex: () => (o == null ? void 0 : o.getCurrentIndex()) ?? -1,
16
- view: (r) => o == null ? void 0 : o.view(r),
17
- destroy: () => o == null ? void 0 : o.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 g(t, o) {
21
- const { selector: r = "> a", ref: l, ...v } = o, m = o.id || `vvw-gallery-${Math.random().toString(36).slice(2)}`;
22
- t.id = m, p(() => {
23
- const e = u({
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({
24
36
  ...v,
25
- elements: `#${m} ${r}`
37
+ elements: `#${u} ${d}`
26
38
  });
27
- l && e && l(e), d(() => {
28
- e == null || e.destroy();
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
- g as createVistaView,
34
- y as useVistaView
51
+ S as VistaView,
52
+ P as useVistaView
35
53
  };
package/dist/svelte.d.ts CHANGED
@@ -1,12 +1,8 @@
1
1
  import { VistaParamsNeo, VistaInterface, VistaOpt } from './vistaview';
2
2
  export declare function useVistaView(options: VistaParamsNeo): VistaInterface;
3
3
  export interface VistaViewProps extends VistaOpt {
4
- id?: string;
5
- class?: string;
6
4
  selector?: string;
7
5
  ref?: VistaInterface;
8
6
  }
9
- export declare function createVistaView(node: HTMLElement, params: VistaViewProps): {
10
- destroy(): void;
11
- };
7
+ export { default as VistaView } from './VistaView.svelte';
12
8
  //# sourceMappingURL=svelte.d.ts.map
@@ -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;AAClE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C,wBAAgB,YAAY,CAAC,OAAO,EAAE,cAAc,GAAG,cAAc,CAmBpE;AAED,MAAM,WAAW,cAAe,SAAQ,QAAQ;IAC9C,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,cAAc,CAAC;CACtB;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,cAAc;;EA0BxE"}
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"}