@vizel/react 1.1.1 → 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/index.d.ts CHANGED
@@ -1,39 +1,39 @@
1
1
  import { ComponentProps } from 'react';
2
- import { CustomIconMap } from '../../packages/core/src/index.ts';
2
+ import { CustomIconMap } from '@vizel/core';
3
3
  import { default as default_2 } from 'react';
4
- import { Editor } from '../../packages/core/src/index.ts';
5
- import { Extensions } from '../../packages/core/src/index.ts';
4
+ import { Editor } from '@vizel/core';
5
+ import { Extensions } from '@vizel/core';
6
6
  import { Icon } from '@iconify/react';
7
- import { JSONContent } from '../../packages/core/src/index.ts';
7
+ import { JSONContent } from '@vizel/core';
8
8
  import { JSX } from 'react/jsx-runtime';
9
9
  import { ReactNode } from 'react';
10
10
  import { Ref } from 'react';
11
- import { SuggestionOptions } from '../../packages/core/src/index.ts';
12
- import { VizelAutoSaveOptions } from '../../packages/core/src/index.ts';
13
- import { VizelCollaborationOptions } from '../../packages/core/src/index.ts';
14
- import { VizelCollaborationUser } from '../../packages/core/src/index.ts';
15
- import { VizelColorDefinition } from '../../packages/core/src/index.ts';
16
- import { VizelComment } from '../../packages/core/src/index.ts';
17
- import { VizelCommentOptions } from '../../packages/core/src/index.ts';
18
- import { VizelCommentReply } from '../../packages/core/src/index.ts';
19
- import { VizelCreateEditorOptions } from '../../packages/core/src/index.ts';
20
- import { VizelEditorState } from '../../packages/core/src/index.ts';
21
- import { VizelEmbedData } from '../../packages/core/src/index.ts';
22
- import { VizelFeatureOptions } from '../../packages/core/src/index.ts';
23
- import { VizelIconContextValue } from '../../packages/core/src/index.ts';
24
- import { VizelIconName } from '../../packages/core/src/index.ts';
25
- import { VizelMarkdownSyncOptions } from '../../packages/core/src/index.ts';
26
- import { VizelNodeTypeOption } from '../../packages/core/src/index.ts';
27
- import { VizelPortalLayer } from '../../packages/core/src/index.ts';
28
- import { VizelSaveStatus } from '../../packages/core/src/index.ts';
29
- import { VizelSlashCommandItem } from '../../packages/core/src/index.ts';
30
- import { VizelSlashMenuRendererOptions } from '../../packages/core/src/index.ts';
31
- import { VizelThemeProviderOptions } from '../../packages/core/src/index.ts';
32
- import { VizelThemeState } from '../../packages/core/src/index.ts';
33
- import { VizelToolbarAction } from '../../packages/core/src/index.ts';
34
- import { VizelVersionHistoryOptions } from '../../packages/core/src/index.ts';
35
- import { VizelVersionSnapshot } from '../../packages/core/src/index.ts';
36
- import { VizelYjsProvider } from '../../packages/core/src/index.ts';
11
+ import { SuggestionOptions } from '@vizel/core';
12
+ import { VizelAutoSaveOptions } from '@vizel/core';
13
+ import { VizelCollaborationOptions } from '@vizel/core';
14
+ import { VizelCollaborationUser } from '@vizel/core';
15
+ import { VizelColorDefinition } from '@vizel/core';
16
+ import { VizelComment } from '@vizel/core';
17
+ import { VizelCommentOptions } from '@vizel/core';
18
+ import { VizelCommentReply } from '@vizel/core';
19
+ import { VizelCreateEditorOptions } from '@vizel/core';
20
+ import { VizelEditorState } from '@vizel/core';
21
+ import { VizelEmbedData } from '@vizel/core';
22
+ import { VizelFeatureOptions } from '@vizel/core';
23
+ import { VizelIconContextValue } from '@vizel/core';
24
+ import { VizelIconName } from '@vizel/core';
25
+ import { VizelMarkdownSyncOptions } from '@vizel/core';
26
+ import { VizelNodeTypeOption } from '@vizel/core';
27
+ import { VizelPortalLayer } from '@vizel/core';
28
+ import { VizelSaveStatus } from '@vizel/core';
29
+ import { VizelSlashCommandItem } from '@vizel/core';
30
+ import { VizelSlashMenuRendererOptions } from '@vizel/core';
31
+ import { VizelThemeProviderOptions } from '@vizel/core';
32
+ import { VizelThemeState } from '@vizel/core';
33
+ import { VizelToolbarAction } from '@vizel/core';
34
+ import { VizelVersionHistoryOptions } from '@vizel/core';
35
+ import { VizelVersionSnapshot } from '@vizel/core';
36
+ import { VizelYjsProvider } from '@vizel/core';
37
37
 
38
38
  /**
39
39
  * Creates a suggestion render configuration for the SlashCommand extension.
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.1",
3
+ "version": "1.1.2",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -43,14 +43,15 @@
43
43
  "typecheck": "tsc --noEmit"
44
44
  },
45
45
  "dependencies": {
46
- "@iconify/react": "^6.0.2",
47
- "@vizel/core": "^1.1.1"
46
+ "@iconify/react": "^6.0.2"
48
47
  },
49
48
  "peerDependencies": {
49
+ "@vizel/core": "^1.1.0",
50
50
  "react": "^19",
51
51
  "react-dom": "^19"
52
52
  },
53
53
  "devDependencies": {
54
+ "@vizel/core": "^1.1.2",
54
55
  "@tiptap/extension-bold": "^3.19.0",
55
56
  "@tiptap/extension-code": "^3.19.0",
56
57
  "@tiptap/extension-color": "^3.19.0",