@vizel/react 1.1.0 → 1.1.2

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/index39.js CHANGED
@@ -1,22 +1,22 @@
1
1
  import { VIZEL_DEFAULT_COMMENT_OPTIONS as d, createVizelCommentHandlers as k } from "@vizel/core";
2
- import { useRef as v, useState as E, useCallback as n, useMemo as S, useEffect as h } from "react";
3
- function V(s, m = {}) {
4
- const t = v(m);
2
+ import { useRef as f, useState as S, useCallback as n, useMemo as h, useEffect as M } from "react";
3
+ function _(a, m = {}) {
4
+ const t = f(m);
5
5
  t.current = m;
6
- const c = m.enabled ?? d.enabled, C = m.storage ?? d.storage, l = m.key ?? d.key, [a, f] = E({
6
+ const s = m.enabled ?? d.enabled, C = m.storage ?? d.storage, l = m.key ?? d.key, [c, R] = S({
7
7
  comments: [],
8
8
  activeCommentId: null,
9
9
  isLoading: !1,
10
10
  error: null
11
- }), u = v(s);
12
- u.current = s;
11
+ }), u = f(a);
12
+ u.current = a;
13
13
  const i = n((e) => {
14
- f((r) => ({ ...r, ...e }));
15
- }, []), o = S(
14
+ R((r) => ({ ...r, ...e }));
15
+ }, []), o = h(
16
16
  () => k(
17
17
  () => u.current(),
18
18
  {
19
- enabled: c,
19
+ enabled: s,
20
20
  storage: C,
21
21
  key: l,
22
22
  onAdd: (e) => t.current.onAdd?.(e),
@@ -27,27 +27,27 @@ function V(s, m = {}) {
27
27
  },
28
28
  i
29
29
  ),
30
- [c, C, l, i]
31
- );
32
- h(() => {
33
- s() && c && o.loadComments();
34
- }, [s, c, o]);
35
- const R = n(
30
+ [s, C, l, i]
31
+ ), v = a();
32
+ M(() => {
33
+ v && s && o.loadComments();
34
+ }, [v, s, o]);
35
+ const g = n(
36
36
  (e, r) => o.addComment(e, r),
37
37
  [o]
38
- ), g = n(
38
+ ), y = n(
39
39
  (e) => o.removeComment(e),
40
40
  [o]
41
- ), y = n(
41
+ ), I = n(
42
42
  (e) => o.resolveComment(e),
43
43
  [o]
44
- ), I = n(
44
+ ), p = n(
45
45
  (e) => o.reopenComment(e),
46
46
  [o]
47
- ), p = n(
47
+ ), A = n(
48
48
  (e, r, b) => o.replyToComment(e, r, b),
49
49
  [o]
50
- ), A = n(
50
+ ), E = n(
51
51
  (e) => o.setActiveComment(e),
52
52
  [o]
53
53
  ), L = n(() => o.loadComments(), [o]), T = n(
@@ -55,20 +55,20 @@ function V(s, m = {}) {
55
55
  [o]
56
56
  );
57
57
  return {
58
- comments: a.comments,
59
- activeCommentId: a.activeCommentId,
60
- isLoading: a.isLoading,
61
- error: a.error,
62
- addComment: R,
63
- removeComment: g,
64
- resolveComment: y,
65
- reopenComment: I,
66
- replyToComment: p,
67
- setActiveComment: A,
58
+ comments: c.comments,
59
+ activeCommentId: c.activeCommentId,
60
+ isLoading: c.isLoading,
61
+ error: c.error,
62
+ addComment: g,
63
+ removeComment: y,
64
+ resolveComment: I,
65
+ reopenComment: p,
66
+ replyToComment: A,
67
+ setActiveComment: E,
68
68
  loadComments: L,
69
69
  getCommentById: T
70
70
  };
71
71
  }
72
72
  export {
73
- V as useVizelComment
73
+ _ as useVizelComment
74
74
  };
package/dist/index44.js CHANGED
@@ -1,42 +1,42 @@
1
- import { VIZEL_DEFAULT_VERSION_HISTORY_OPTIONS as c, createVizelVersionHistoryHandlers as k } from "@vizel/core";
2
- import { useRef as S, useState as v, useCallback as o, useMemo as x, useEffect as E } from "react";
3
- function O(n, r = {}) {
4
- const t = S(r);
5
- t.current = r;
6
- const a = r.enabled ?? c.enabled, V = r.maxVersions ?? c.maxVersions, u = r.storage ?? c.storage, d = r.key ?? c.key, [i, R] = v({
1
+ import { VIZEL_DEFAULT_VERSION_HISTORY_OPTIONS as a, createVizelVersionHistoryHandlers as k } from "@vizel/core";
2
+ import { useRef as R, useState as v, useCallback as o, useMemo as x, useEffect as H } from "react";
3
+ function _(c, r = {}) {
4
+ const n = R(r);
5
+ n.current = r;
6
+ const t = r.enabled ?? a.enabled, V = r.maxVersions ?? a.maxVersions, u = r.storage ?? a.storage, d = r.key ?? a.key, [i, g] = v({
7
7
  snapshots: [],
8
8
  isLoading: !1,
9
9
  error: null
10
- }), f = S(n);
11
- f.current = n;
10
+ }), f = R(c);
11
+ f.current = c;
12
12
  const m = o((e) => {
13
- R((l) => ({ ...l, ...e }));
13
+ g((l) => ({ ...l, ...e }));
14
14
  }, []), s = x(
15
15
  () => k(
16
16
  () => f.current(),
17
17
  {
18
- enabled: a,
18
+ enabled: t,
19
19
  maxVersions: V,
20
20
  storage: u,
21
21
  key: d,
22
- onSave: (e) => t.current.onSave?.(e),
23
- onError: (e) => t.current.onError?.(e),
24
- onRestore: (e) => t.current.onRestore?.(e)
22
+ onSave: (e) => n.current.onSave?.(e),
23
+ onError: (e) => n.current.onError?.(e),
24
+ onRestore: (e) => n.current.onRestore?.(e)
25
25
  },
26
26
  m
27
27
  ),
28
- [a, V, u, d, m]
29
- );
30
- E(() => {
31
- n() && a && s.loadVersions();
32
- }, [n, a, s]);
28
+ [t, V, u, d, m]
29
+ ), S = c();
30
+ H(() => {
31
+ S && t && s.loadVersions();
32
+ }, [S, t, s]);
33
33
  const h = o(
34
34
  (e, l) => s.saveVersion(e, l),
35
35
  [s]
36
- ), g = o(
36
+ ), y = o(
37
37
  (e) => s.restoreVersion(e),
38
38
  [s]
39
- ), y = o(() => s.loadVersions(), [s]), L = o(
39
+ ), E = o(() => s.loadVersions(), [s]), L = o(
40
40
  (e) => s.deleteVersion(e),
41
41
  [s]
42
42
  ), b = o(() => s.clearVersions(), [s]);
@@ -45,12 +45,12 @@ function O(n, r = {}) {
45
45
  isLoading: i.isLoading,
46
46
  error: i.error,
47
47
  saveVersion: h,
48
- restoreVersion: g,
49
- loadVersions: y,
48
+ restoreVersion: y,
49
+ loadVersions: E,
50
50
  deleteVersion: L,
51
51
  clearVersions: b
52
52
  };
53
53
  }
54
54
  export {
55
- O as useVizelVersionHistory
55
+ _ as useVizelVersionHistory
56
56
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vizel/react",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -27,22 +27,12 @@
27
27
  "rich-text",
28
28
  "block-editor"
29
29
  ],
30
- "main": "./src/index.ts",
31
- "types": "./src/index.ts",
30
+ "main": "./dist/index.js",
31
+ "types": "./dist/index.d.ts",
32
32
  "exports": {
33
33
  ".": {
34
- "types": "./src/index.ts",
35
- "import": "./src/index.ts"
36
- }
37
- },
38
- "publishConfig": {
39
- "main": "./dist/index.js",
40
- "types": "./dist/index.d.ts",
41
- "exports": {
42
- ".": {
43
- "types": "./dist/index.d.ts",
44
- "import": "./dist/index.js"
45
- }
34
+ "types": "./dist/index.d.ts",
35
+ "import": "./dist/index.js"
46
36
  }
47
37
  },
48
38
  "files": [
@@ -53,14 +43,15 @@
53
43
  "typecheck": "tsc --noEmit"
54
44
  },
55
45
  "dependencies": {
56
- "@iconify/react": "^6.0.2",
57
- "@vizel/core": "^1.1.0"
46
+ "@iconify/react": "^6.0.2"
58
47
  },
59
48
  "peerDependencies": {
49
+ "@vizel/core": "^1.1.0",
60
50
  "react": "^19",
61
51
  "react-dom": "^19"
62
52
  },
63
53
  "devDependencies": {
54
+ "@vizel/core": "^1.1.2",
64
55
  "@tiptap/extension-bold": "^3.19.0",
65
56
  "@tiptap/extension-code": "^3.19.0",
66
57
  "@tiptap/extension-color": "^3.19.0",