@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 +30 -30
- package/dist/index39.js +31 -31
- package/dist/index44.js +23 -23
- package/package.json +4 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
import { ComponentProps } from 'react';
|
|
2
|
-
import { CustomIconMap } from '
|
|
2
|
+
import { CustomIconMap } from '@vizel/core';
|
|
3
3
|
import { default as default_2 } from 'react';
|
|
4
|
-
import { Editor } from '
|
|
5
|
-
import { Extensions } from '
|
|
4
|
+
import { Editor } from '@vizel/core';
|
|
5
|
+
import { Extensions } from '@vizel/core';
|
|
6
6
|
import { Icon } from '@iconify/react';
|
|
7
|
-
import { JSONContent } from '
|
|
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 '
|
|
12
|
-
import { VizelAutoSaveOptions } from '
|
|
13
|
-
import { VizelCollaborationOptions } from '
|
|
14
|
-
import { VizelCollaborationUser } from '
|
|
15
|
-
import { VizelColorDefinition } from '
|
|
16
|
-
import { VizelComment } from '
|
|
17
|
-
import { VizelCommentOptions } from '
|
|
18
|
-
import { VizelCommentReply } from '
|
|
19
|
-
import { VizelCreateEditorOptions } from '
|
|
20
|
-
import { VizelEditorState } from '
|
|
21
|
-
import { VizelEmbedData } from '
|
|
22
|
-
import { VizelFeatureOptions } from '
|
|
23
|
-
import { VizelIconContextValue } from '
|
|
24
|
-
import { VizelIconName } from '
|
|
25
|
-
import { VizelMarkdownSyncOptions } from '
|
|
26
|
-
import { VizelNodeTypeOption } from '
|
|
27
|
-
import { VizelPortalLayer } from '
|
|
28
|
-
import { VizelSaveStatus } from '
|
|
29
|
-
import { VizelSlashCommandItem } from '
|
|
30
|
-
import { VizelSlashMenuRendererOptions } from '
|
|
31
|
-
import { VizelThemeProviderOptions } from '
|
|
32
|
-
import { VizelThemeState } from '
|
|
33
|
-
import { VizelToolbarAction } from '
|
|
34
|
-
import { VizelVersionHistoryOptions } from '
|
|
35
|
-
import { VizelVersionSnapshot } from '
|
|
36
|
-
import { VizelYjsProvider } from '
|
|
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
|
|
3
|
-
function
|
|
4
|
-
const t =
|
|
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
|
|
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 =
|
|
12
|
-
u.current =
|
|
11
|
+
}), u = f(a);
|
|
12
|
+
u.current = a;
|
|
13
13
|
const i = n((e) => {
|
|
14
|
-
|
|
15
|
-
}, []), o =
|
|
14
|
+
R((r) => ({ ...r, ...e }));
|
|
15
|
+
}, []), o = h(
|
|
16
16
|
() => k(
|
|
17
17
|
() => u.current(),
|
|
18
18
|
{
|
|
19
|
-
enabled:
|
|
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
|
-
[
|
|
31
|
-
);
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}, [
|
|
35
|
-
const
|
|
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
|
-
),
|
|
38
|
+
), y = n(
|
|
39
39
|
(e) => o.removeComment(e),
|
|
40
40
|
[o]
|
|
41
|
-
),
|
|
41
|
+
), I = n(
|
|
42
42
|
(e) => o.resolveComment(e),
|
|
43
43
|
[o]
|
|
44
|
-
),
|
|
44
|
+
), p = n(
|
|
45
45
|
(e) => o.reopenComment(e),
|
|
46
46
|
[o]
|
|
47
|
-
),
|
|
47
|
+
), A = n(
|
|
48
48
|
(e, r, b) => o.replyToComment(e, r, b),
|
|
49
49
|
[o]
|
|
50
|
-
),
|
|
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:
|
|
59
|
-
activeCommentId:
|
|
60
|
-
isLoading:
|
|
61
|
-
error:
|
|
62
|
-
addComment:
|
|
63
|
-
removeComment:
|
|
64
|
-
resolveComment:
|
|
65
|
-
reopenComment:
|
|
66
|
-
replyToComment:
|
|
67
|
-
setActiveComment:
|
|
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
|
-
|
|
73
|
+
_ as useVizelComment
|
|
74
74
|
};
|
package/dist/index44.js
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import { VIZEL_DEFAULT_VERSION_HISTORY_OPTIONS as
|
|
2
|
-
import { useRef as
|
|
3
|
-
function
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
const
|
|
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 =
|
|
11
|
-
f.current =
|
|
10
|
+
}), f = R(c);
|
|
11
|
+
f.current = c;
|
|
12
12
|
const m = o((e) => {
|
|
13
|
-
|
|
13
|
+
g((l) => ({ ...l, ...e }));
|
|
14
14
|
}, []), s = x(
|
|
15
15
|
() => k(
|
|
16
16
|
() => f.current(),
|
|
17
17
|
{
|
|
18
|
-
enabled:
|
|
18
|
+
enabled: t,
|
|
19
19
|
maxVersions: V,
|
|
20
20
|
storage: u,
|
|
21
21
|
key: d,
|
|
22
|
-
onSave: (e) =>
|
|
23
|
-
onError: (e) =>
|
|
24
|
-
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
|
-
[
|
|
29
|
-
);
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}, [
|
|
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
|
-
),
|
|
36
|
+
), y = o(
|
|
37
37
|
(e) => s.restoreVersion(e),
|
|
38
38
|
[s]
|
|
39
|
-
),
|
|
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:
|
|
49
|
-
loadVersions:
|
|
48
|
+
restoreVersion: y,
|
|
49
|
+
loadVersions: E,
|
|
50
50
|
deleteVersion: L,
|
|
51
51
|
clearVersions: b
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
54
|
export {
|
|
55
|
-
|
|
55
|
+
_ as useVizelVersionHistory
|
|
56
56
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vizel/react",
|
|
3
|
-
"version": "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",
|