@arbidocs/react 0.5.18 → 0.5.20
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/{ProductionDialog.d-CttHqQAh.d.ts → ProductionDialog.d-BDJwBSzj.d.ts} +1 -1
- package/dist/{ProductionDialog.d-BD1osHeq.d.cts → ProductionDialog.d-DjRQFmQw.d.cts} +1 -1
- package/dist/annotations/freeze/index.cjs +15 -15
- package/dist/annotations/freeze/index.d.cts +1 -1
- package/dist/annotations/freeze/index.d.ts +1 -1
- package/dist/annotations/freeze/index.js +3 -3
- package/dist/annotations/index.cjs +56 -56
- package/dist/annotations/index.d.cts +5 -5
- package/dist/annotations/index.d.ts +5 -5
- package/dist/annotations/index.js +2 -2
- package/dist/artifacts/index.cjs +10 -10
- package/dist/artifacts/index.js +3 -3
- package/dist/bundle-DCWPYNGD.cjs +14 -0
- package/dist/{bundle-B5AN4B7H.cjs.map → bundle-DCWPYNGD.cjs.map} +1 -1
- package/dist/bundle-JCKKGEJE.js +5 -0
- package/dist/{bundle-4TKU5WEQ.js.map → bundle-JCKKGEJE.js.map} +1 -1
- package/dist/calls/livekit/index.cjs +42 -42
- package/dist/calls/livekit/index.js +3 -3
- package/dist/{chunk-YWYCEEBF.js → chunk-2HVCNYFH.js} +32 -3
- package/dist/chunk-2HVCNYFH.js.map +1 -0
- package/dist/{chunk-NSSGDZSL.cjs → chunk-2IJP73ZG.cjs} +2 -2
- package/dist/{chunk-NSSGDZSL.cjs.map → chunk-2IJP73ZG.cjs.map} +1 -1
- package/dist/{chunk-KFFH2JJM.cjs → chunk-4UDIA47U.cjs} +32 -32
- package/dist/{chunk-KFFH2JJM.cjs.map → chunk-4UDIA47U.cjs.map} +1 -1
- package/dist/{chunk-HUZB36QU.cjs → chunk-5YWIUUUT.cjs} +53 -2
- package/dist/chunk-5YWIUUUT.cjs.map +1 -0
- package/dist/{chunk-D63FAYES.js → chunk-A2XSLTIP.js} +5 -5
- package/dist/chunk-A2XSLTIP.js.map +1 -0
- package/dist/{chunk-EYOXZHXM.cjs → chunk-B6I2HRRF.cjs} +9 -9
- package/dist/chunk-B6I2HRRF.cjs.map +1 -0
- package/dist/{chunk-2M4B4FFA.cjs → chunk-CZP7FF3E.cjs} +31 -2
- package/dist/chunk-CZP7FF3E.cjs.map +1 -0
- package/dist/{chunk-GUCQMP6G.js → chunk-DUU537MW.js} +4 -4
- package/dist/{chunk-GUCQMP6G.js.map → chunk-DUU537MW.js.map} +1 -1
- package/dist/{chunk-4VQ3XHAQ.cjs → chunk-DYCONTUK.cjs} +41 -41
- package/dist/{chunk-4VQ3XHAQ.cjs.map → chunk-DYCONTUK.cjs.map} +1 -1
- package/dist/{chunk-CNRF5SLZ.cjs → chunk-FLAZSNC5.cjs} +33 -33
- package/dist/{chunk-CNRF5SLZ.cjs.map → chunk-FLAZSNC5.cjs.map} +1 -1
- package/dist/{chunk-WE7QWWJ4.js → chunk-KRAUMKBG.js} +4 -37
- package/dist/chunk-KRAUMKBG.js.map +1 -0
- package/dist/{chunk-J2GERLMU.js → chunk-LYGJVSNM.js} +3 -3
- package/dist/{chunk-J2GERLMU.js.map → chunk-LYGJVSNM.js.map} +1 -1
- package/dist/{chunk-GN33GLHR.js → chunk-MQ7LZWGP.js} +3 -3
- package/dist/{chunk-GN33GLHR.js.map → chunk-MQ7LZWGP.js.map} +1 -1
- package/dist/chunk-NA3FJX37.js +89 -0
- package/dist/chunk-NA3FJX37.js.map +1 -0
- package/dist/{chunk-RG2ZE7DF.js → chunk-PBXJFMES.js} +5 -2
- package/dist/chunk-PBXJFMES.js.map +1 -0
- package/dist/{chunk-H4FGDXYB.cjs → chunk-RRWAX52L.cjs} +5 -2
- package/dist/chunk-RRWAX52L.cjs.map +1 -0
- package/dist/{chunk-ALLWAYMB.cjs → chunk-SUZORMAB.cjs} +157 -65
- package/dist/chunk-SUZORMAB.cjs.map +1 -0
- package/dist/{chunk-XTWUMTCQ.js → chunk-T3USOSVN.js} +2 -2
- package/dist/{chunk-XTWUMTCQ.js.map → chunk-T3USOSVN.js.map} +1 -1
- package/dist/{chunk-2XMHFQ7M.js → chunk-T4CLW3DN.js} +141 -49
- package/dist/chunk-T4CLW3DN.js.map +1 -0
- package/dist/{chunk-XTYG5SIL.cjs → chunk-YBIW7T66.cjs} +5 -39
- package/dist/chunk-YBIW7T66.cjs.map +1 -0
- package/dist/document-tools/index.cjs +174 -69
- package/dist/document-tools/index.cjs.map +1 -1
- package/dist/document-tools/index.d.cts +99 -6
- package/dist/document-tools/index.d.ts +99 -6
- package/dist/document-tools/index.js +107 -10
- package/dist/document-tools/index.js.map +1 -1
- package/dist/index.cjs +911 -802
- package/dist/index.cjs.map +1 -1
- package/dist/{index.d-Dx9sGkW2.d.cts → index.d-DscWCwr2.d.cts} +15 -1
- package/dist/{index.d-Dx9sGkW2.d.ts → index.d-DscWCwr2.d.ts} +15 -1
- package/dist/index.d.cts +70 -22
- package/dist/index.d.ts +70 -22
- package/dist/index.js +122 -15
- package/dist/index.js.map +1 -1
- package/dist/{model.d-D63gedpb.d.cts → model.d-CNtRWKVK.d.cts} +1 -1
- package/dist/{model.d-D63gedpb.d.ts → model.d-CNtRWKVK.d.ts} +1 -1
- package/dist/{query-keys.d-ClYiYNBR.d.cts → query-keys.d-DM2N5pzN.d.cts} +3 -0
- package/dist/{query-keys.d-ClYiYNBR.d.ts → query-keys.d-DM2N5pzN.d.ts} +3 -0
- package/dist/shell/index.cjs +34 -34
- package/dist/shell/index.js +3 -3
- package/dist/ui/index.cjs +16 -12
- package/dist/ui/index.d.cts +1 -1
- package/dist/ui/index.d.ts +1 -1
- package/dist/ui/index.js +2 -2
- package/package.json +3 -3
- package/dist/bundle-4TKU5WEQ.js +0 -5
- package/dist/bundle-B5AN4B7H.cjs +0 -14
- package/dist/chunk-2M4B4FFA.cjs.map +0 -1
- package/dist/chunk-2XMHFQ7M.js.map +0 -1
- package/dist/chunk-ALLWAYMB.cjs.map +0 -1
- package/dist/chunk-D63FAYES.js.map +0 -1
- package/dist/chunk-EYOXZHXM.cjs.map +0 -1
- package/dist/chunk-H4FGDXYB.cjs.map +0 -1
- package/dist/chunk-HUZB36QU.cjs.map +0 -1
- package/dist/chunk-RG2ZE7DF.js.map +0 -1
- package/dist/chunk-W4H6XAIU.js +0 -39
- package/dist/chunk-W4H6XAIU.js.map +0 -1
- package/dist/chunk-WE7QWWJ4.js.map +0 -1
- package/dist/chunk-XTYG5SIL.cjs.map +0 -1
- package/dist/chunk-YWYCEEBF.js.map +0 -1
|
@@ -71,7 +71,7 @@ interface StampAnnotation extends AnnotationBase {
|
|
|
71
71
|
interface RedactionAnnotation extends AnnotationBase {
|
|
72
72
|
kind: 'redaction';
|
|
73
73
|
rects: NormRect[];
|
|
74
|
-
/**
|
|
74
|
+
/** The review reason (e.g. "Privileged"). Kept separately from the printed [REDACTED] label. */
|
|
75
75
|
reason: string;
|
|
76
76
|
/** The text under the mark. Sensitive: stays in the layer, never in a frozen document. */
|
|
77
77
|
text?: string;
|
|
@@ -71,7 +71,7 @@ interface StampAnnotation extends AnnotationBase {
|
|
|
71
71
|
interface RedactionAnnotation extends AnnotationBase {
|
|
72
72
|
kind: 'redaction';
|
|
73
73
|
rects: NormRect[];
|
|
74
|
-
/**
|
|
74
|
+
/** The review reason (e.g. "Privileged"). Kept separately from the printed [REDACTED] label. */
|
|
75
75
|
reason: string;
|
|
76
76
|
/** The text under the mark. Sensitive: stays in the layer, never in a frozen document. */
|
|
77
77
|
text?: string;
|
|
@@ -10,6 +10,9 @@ import { ListEventsParams, RoomQuery, CalendarWindow, OverlayLayerName } from '@
|
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
declare const arbiQueryKeys: {
|
|
13
|
+
fileShares: () => readonly ["arbi", "fileShares"];
|
|
14
|
+
fileShare: (id: string) => readonly ["arbi", "fileShare", string];
|
|
15
|
+
fileSharePdf: (id: string, status?: string) => readonly ["arbi", "fileSharePdf", string, string | undefined];
|
|
13
16
|
workspaces: () => readonly ["arbi", "workspaces"];
|
|
14
17
|
/** Every workspace's member list: what a workspace switch drops. */
|
|
15
18
|
allWorkspaceUsers: () => readonly ["arbi", "workspaceUsers"];
|
|
@@ -10,6 +10,9 @@ import { ListEventsParams, RoomQuery, CalendarWindow, OverlayLayerName } from '@
|
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
declare const arbiQueryKeys: {
|
|
13
|
+
fileShares: () => readonly ["arbi", "fileShares"];
|
|
14
|
+
fileShare: (id: string) => readonly ["arbi", "fileShare", string];
|
|
15
|
+
fileSharePdf: (id: string, status?: string) => readonly ["arbi", "fileSharePdf", string, string | undefined];
|
|
13
16
|
workspaces: () => readonly ["arbi", "workspaces"];
|
|
14
17
|
/** Every workspace's member list: what a workspace switch drops. */
|
|
15
18
|
allWorkspaceUsers: () => readonly ["arbi", "workspaceUsers"];
|
package/dist/shell/index.cjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkYBIW7T66_cjs = require('../chunk-YBIW7T66.cjs');
|
|
4
4
|
var chunkVAMPYLQ4_cjs = require('../chunk-VAMPYLQ4.cjs');
|
|
5
5
|
require('../chunk-N73IMVFF.cjs');
|
|
6
6
|
require('../chunk-ZWFMFOGP.cjs');
|
|
7
7
|
require('../chunk-VOFNX4P6.cjs');
|
|
8
|
-
require('../chunk-
|
|
9
|
-
require('../chunk-HJDR5HEO.cjs');
|
|
8
|
+
require('../chunk-5YWIUUUT.cjs');
|
|
10
9
|
require('../chunk-Z3LLUO32.cjs');
|
|
10
|
+
require('../chunk-HJDR5HEO.cjs');
|
|
11
11
|
require('../chunk-S6A6FSG7.cjs');
|
|
12
12
|
var chunkRCKA7BEF_cjs = require('../chunk-RCKA7BEF.cjs');
|
|
13
13
|
|
|
@@ -15,127 +15,127 @@ var chunkRCKA7BEF_cjs = require('../chunk-RCKA7BEF.cjs');
|
|
|
15
15
|
|
|
16
16
|
Object.defineProperty(exports, "ArbiHost", {
|
|
17
17
|
enumerable: true,
|
|
18
|
-
get: function () { return
|
|
18
|
+
get: function () { return chunkYBIW7T66_cjs.ArbiHost; }
|
|
19
19
|
});
|
|
20
20
|
Object.defineProperty(exports, "LEGACY_THREAD_DOCUMENTS_KEY", {
|
|
21
21
|
enumerable: true,
|
|
22
|
-
get: function () { return
|
|
22
|
+
get: function () { return chunkYBIW7T66_cjs.LEGACY_THREAD_DOCUMENTS_KEY; }
|
|
23
23
|
});
|
|
24
24
|
Object.defineProperty(exports, "MENTION_HREF_PREFIX", {
|
|
25
25
|
enumerable: true,
|
|
26
|
-
get: function () { return
|
|
26
|
+
get: function () { return chunkYBIW7T66_cjs.MENTION_HREF_PREFIX; }
|
|
27
27
|
});
|
|
28
28
|
Object.defineProperty(exports, "NotificationBell", {
|
|
29
29
|
enumerable: true,
|
|
30
|
-
get: function () { return
|
|
30
|
+
get: function () { return chunkYBIW7T66_cjs.NotificationBell; }
|
|
31
31
|
});
|
|
32
32
|
Object.defineProperty(exports, "Toaster", {
|
|
33
33
|
enumerable: true,
|
|
34
|
-
get: function () { return
|
|
34
|
+
get: function () { return chunkYBIW7T66_cjs.Toaster; }
|
|
35
35
|
});
|
|
36
36
|
Object.defineProperty(exports, "UNBOUND", {
|
|
37
37
|
enumerable: true,
|
|
38
|
-
get: function () { return
|
|
38
|
+
get: function () { return chunkYBIW7T66_cjs.UNBOUND; }
|
|
39
39
|
});
|
|
40
40
|
Object.defineProperty(exports, "bindingOfRow", {
|
|
41
41
|
enumerable: true,
|
|
42
|
-
get: function () { return
|
|
42
|
+
get: function () { return chunkYBIW7T66_cjs.bindingOfRow; }
|
|
43
43
|
});
|
|
44
44
|
Object.defineProperty(exports, "clearSearchSession", {
|
|
45
45
|
enumerable: true,
|
|
46
|
-
get: function () { return
|
|
46
|
+
get: function () { return chunkYBIW7T66_cjs.clearSearchSession; }
|
|
47
47
|
});
|
|
48
48
|
Object.defineProperty(exports, "createSearchSession", {
|
|
49
49
|
enumerable: true,
|
|
50
|
-
get: function () { return
|
|
50
|
+
get: function () { return chunkYBIW7T66_cjs.createSearchSession; }
|
|
51
51
|
});
|
|
52
52
|
Object.defineProperty(exports, "extractMentions", {
|
|
53
53
|
enumerable: true,
|
|
54
|
-
get: function () { return
|
|
54
|
+
get: function () { return chunkYBIW7T66_cjs.extractMentions; }
|
|
55
55
|
});
|
|
56
56
|
Object.defineProperty(exports, "filterMentionCandidates", {
|
|
57
57
|
enumerable: true,
|
|
58
|
-
get: function () { return
|
|
58
|
+
get: function () { return chunkYBIW7T66_cjs.filterMentionCandidates; }
|
|
59
59
|
});
|
|
60
60
|
Object.defineProperty(exports, "findMentionQuery", {
|
|
61
61
|
enumerable: true,
|
|
62
|
-
get: function () { return
|
|
62
|
+
get: function () { return chunkYBIW7T66_cjs.findMentionQuery; }
|
|
63
63
|
});
|
|
64
64
|
Object.defineProperty(exports, "forgetLegacyThreadDocuments", {
|
|
65
65
|
enumerable: true,
|
|
66
|
-
get: function () { return
|
|
66
|
+
get: function () { return chunkYBIW7T66_cjs.forgetLegacyThreadDocuments; }
|
|
67
67
|
});
|
|
68
68
|
Object.defineProperty(exports, "hasMessageBody", {
|
|
69
69
|
enumerable: true,
|
|
70
|
-
get: function () { return
|
|
70
|
+
get: function () { return chunkYBIW7T66_cjs.hasMessageBody; }
|
|
71
71
|
});
|
|
72
72
|
Object.defineProperty(exports, "insertMention", {
|
|
73
73
|
enumerable: true,
|
|
74
|
-
get: function () { return
|
|
74
|
+
get: function () { return chunkYBIW7T66_cjs.insertMention; }
|
|
75
75
|
});
|
|
76
76
|
Object.defineProperty(exports, "latestThreadOfDocument", {
|
|
77
77
|
enumerable: true,
|
|
78
|
-
get: function () { return
|
|
78
|
+
get: function () { return chunkYBIW7T66_cjs.latestThreadOfDocument; }
|
|
79
79
|
});
|
|
80
80
|
Object.defineProperty(exports, "linkMentions", {
|
|
81
81
|
enumerable: true,
|
|
82
|
-
get: function () { return
|
|
82
|
+
get: function () { return chunkYBIW7T66_cjs.linkMentions; }
|
|
83
83
|
});
|
|
84
84
|
Object.defineProperty(exports, "mentionFromHref", {
|
|
85
85
|
enumerable: true,
|
|
86
|
-
get: function () { return
|
|
86
|
+
get: function () { return chunkYBIW7T66_cjs.mentionFromHref; }
|
|
87
87
|
});
|
|
88
88
|
Object.defineProperty(exports, "openDocumentId", {
|
|
89
89
|
enumerable: true,
|
|
90
|
-
get: function () { return
|
|
90
|
+
get: function () { return chunkYBIW7T66_cjs.openDocumentId; }
|
|
91
91
|
});
|
|
92
92
|
Object.defineProperty(exports, "opensInWord", {
|
|
93
93
|
enumerable: true,
|
|
94
|
-
get: function () { return
|
|
94
|
+
get: function () { return chunkYBIW7T66_cjs.opensInWord; }
|
|
95
95
|
});
|
|
96
96
|
Object.defineProperty(exports, "persistSearchSession", {
|
|
97
97
|
enumerable: true,
|
|
98
|
-
get: function () { return
|
|
98
|
+
get: function () { return chunkYBIW7T66_cjs.persistSearchSession; }
|
|
99
99
|
});
|
|
100
100
|
Object.defineProperty(exports, "readLegacyThreadDocuments", {
|
|
101
101
|
enumerable: true,
|
|
102
|
-
get: function () { return
|
|
102
|
+
get: function () { return chunkYBIW7T66_cjs.readLegacyThreadDocuments; }
|
|
103
103
|
});
|
|
104
104
|
Object.defineProperty(exports, "requestSearch", {
|
|
105
105
|
enumerable: true,
|
|
106
|
-
get: function () { return
|
|
106
|
+
get: function () { return chunkYBIW7T66_cjs.requestSearch; }
|
|
107
107
|
});
|
|
108
108
|
Object.defineProperty(exports, "savedDocumentIdFor", {
|
|
109
109
|
enumerable: true,
|
|
110
|
-
get: function () { return
|
|
110
|
+
get: function () { return chunkYBIW7T66_cjs.savedDocumentIdFor; }
|
|
111
111
|
});
|
|
112
112
|
Object.defineProperty(exports, "sharedSearchSession", {
|
|
113
113
|
enumerable: true,
|
|
114
|
-
get: function () { return
|
|
114
|
+
get: function () { return chunkYBIW7T66_cjs.sharedSearchSession; }
|
|
115
115
|
});
|
|
116
116
|
Object.defineProperty(exports, "takeDocumentForTurn", {
|
|
117
117
|
enumerable: true,
|
|
118
|
-
get: function () { return
|
|
118
|
+
get: function () { return chunkYBIW7T66_cjs.takeDocumentForTurn; }
|
|
119
119
|
});
|
|
120
120
|
Object.defineProperty(exports, "takePendingSearch", {
|
|
121
121
|
enumerable: true,
|
|
122
|
-
get: function () { return
|
|
122
|
+
get: function () { return chunkYBIW7T66_cjs.takePendingSearch; }
|
|
123
123
|
});
|
|
124
124
|
Object.defineProperty(exports, "toMessageMentions", {
|
|
125
125
|
enumerable: true,
|
|
126
|
-
get: function () { return
|
|
126
|
+
get: function () { return chunkYBIW7T66_cjs.toMessageMentions; }
|
|
127
127
|
});
|
|
128
128
|
Object.defineProperty(exports, "useOpenDocumentId", {
|
|
129
129
|
enumerable: true,
|
|
130
|
-
get: function () { return
|
|
130
|
+
get: function () { return chunkYBIW7T66_cjs.useOpenDocumentId; }
|
|
131
131
|
});
|
|
132
132
|
Object.defineProperty(exports, "useRegisterOpenDocument", {
|
|
133
133
|
enumerable: true,
|
|
134
|
-
get: function () { return
|
|
134
|
+
get: function () { return chunkYBIW7T66_cjs.useRegisterOpenDocument; }
|
|
135
135
|
});
|
|
136
136
|
Object.defineProperty(exports, "useTurnDocumentId", {
|
|
137
137
|
enumerable: true,
|
|
138
|
-
get: function () { return
|
|
138
|
+
get: function () { return chunkYBIW7T66_cjs.useTurnDocumentId; }
|
|
139
139
|
});
|
|
140
140
|
Object.defineProperty(exports, "configureNotify", {
|
|
141
141
|
enumerable: true,
|
package/dist/shell/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export { ArbiHost, LEGACY_THREAD_DOCUMENTS_KEY, MENTION_HREF_PREFIX, NotificationBell, Toaster, UNBOUND, bindingOfRow, clearSearchSession, createSearchSession, extractMentions, filterMentionCandidates, findMentionQuery, forgetLegacyThreadDocuments, hasMessageBody, insertMention, latestThreadOfDocument, linkMentions, mentionFromHref, openDocumentId, opensInWord, persistSearchSession, readLegacyThreadDocuments, requestSearch, savedDocumentIdFor, sharedSearchSession, takeDocumentForTurn, takePendingSearch, toMessageMentions, useOpenDocumentId, useRegisterOpenDocument, useTurnDocumentId } from '../chunk-
|
|
1
|
+
export { ArbiHost, LEGACY_THREAD_DOCUMENTS_KEY, MENTION_HREF_PREFIX, NotificationBell, Toaster, UNBOUND, bindingOfRow, clearSearchSession, createSearchSession, extractMentions, filterMentionCandidates, findMentionQuery, forgetLegacyThreadDocuments, hasMessageBody, insertMention, latestThreadOfDocument, linkMentions, mentionFromHref, openDocumentId, opensInWord, persistSearchSession, readLegacyThreadDocuments, requestSearch, savedDocumentIdFor, sharedSearchSession, takeDocumentForTurn, takePendingSearch, toMessageMentions, useOpenDocumentId, useRegisterOpenDocument, useTurnDocumentId } from '../chunk-KRAUMKBG.js';
|
|
2
2
|
export { configureNotify, notify, persistNotifyHistory, selectUnread, toast, useNotify } from '../chunk-5HDC43MF.js';
|
|
3
3
|
import '../chunk-DPYBZDJB.js';
|
|
4
4
|
import '../chunk-NNWMHMEC.js';
|
|
5
5
|
import '../chunk-WUTL62MC.js';
|
|
6
|
-
import '../chunk-
|
|
7
|
-
import '../chunk-47CCGUWR.js';
|
|
6
|
+
import '../chunk-NA3FJX37.js';
|
|
8
7
|
import '../chunk-QRCMKEE6.js';
|
|
8
|
+
import '../chunk-47CCGUWR.js';
|
|
9
9
|
import '../chunk-SN5YV6FF.js';
|
|
10
10
|
export { useHostConfigRecord } from '../chunk-CPZ36AQS.js';
|
|
11
11
|
//# sourceMappingURL=index.js.map
|
package/dist/ui/index.cjs
CHANGED
|
@@ -4,9 +4,9 @@ var chunk7NHOKV7N_cjs = require('../chunk-7NHOKV7N.cjs');
|
|
|
4
4
|
var chunkEEIYXVM4_cjs = require('../chunk-EEIYXVM4.cjs');
|
|
5
5
|
var chunkOC7F5SNA_cjs = require('../chunk-OC7F5SNA.cjs');
|
|
6
6
|
var chunkWYZJLZ67_cjs = require('../chunk-WYZJLZ67.cjs');
|
|
7
|
-
var
|
|
8
|
-
var chunkHJDR5HEO_cjs = require('../chunk-HJDR5HEO.cjs');
|
|
7
|
+
var chunk5YWIUUUT_cjs = require('../chunk-5YWIUUUT.cjs');
|
|
9
8
|
var chunkZ3LLUO32_cjs = require('../chunk-Z3LLUO32.cjs');
|
|
9
|
+
var chunkHJDR5HEO_cjs = require('../chunk-HJDR5HEO.cjs');
|
|
10
10
|
var chunkS6A6FSG7_cjs = require('../chunk-S6A6FSG7.cjs');
|
|
11
11
|
require('../chunk-RCKA7BEF.cjs');
|
|
12
12
|
|
|
@@ -702,11 +702,23 @@ Object.defineProperty(exports, "buttonVariants", {
|
|
|
702
702
|
});
|
|
703
703
|
Object.defineProperty(exports, "ScrollArea", {
|
|
704
704
|
enumerable: true,
|
|
705
|
-
get: function () { return
|
|
705
|
+
get: function () { return chunk5YWIUUUT_cjs.ScrollArea; }
|
|
706
706
|
});
|
|
707
707
|
Object.defineProperty(exports, "ScrollBar", {
|
|
708
708
|
enumerable: true,
|
|
709
|
-
get: function () { return
|
|
709
|
+
get: function () { return chunk5YWIUUUT_cjs.ScrollBar; }
|
|
710
|
+
});
|
|
711
|
+
Object.defineProperty(exports, "formatRelativeTime", {
|
|
712
|
+
enumerable: true,
|
|
713
|
+
get: function () { return chunk5YWIUUUT_cjs.formatRelativeTime; }
|
|
714
|
+
});
|
|
715
|
+
Object.defineProperty(exports, "closeOpenEmphasis", {
|
|
716
|
+
enumerable: true,
|
|
717
|
+
get: function () { return chunkZ3LLUO32_cjs.closeOpenEmphasis; }
|
|
718
|
+
});
|
|
719
|
+
Object.defineProperty(exports, "trimOpenCitation", {
|
|
720
|
+
enumerable: true,
|
|
721
|
+
get: function () { return chunkZ3LLUO32_cjs.trimOpenCitation; }
|
|
710
722
|
});
|
|
711
723
|
Object.defineProperty(exports, "DropdownMenu", {
|
|
712
724
|
enumerable: true,
|
|
@@ -776,14 +788,6 @@ Object.defineProperty(exports, "usePortalContainer", {
|
|
|
776
788
|
enumerable: true,
|
|
777
789
|
get: function () { return chunkHJDR5HEO_cjs.usePortalContainer; }
|
|
778
790
|
});
|
|
779
|
-
Object.defineProperty(exports, "closeOpenEmphasis", {
|
|
780
|
-
enumerable: true,
|
|
781
|
-
get: function () { return chunkZ3LLUO32_cjs.closeOpenEmphasis; }
|
|
782
|
-
});
|
|
783
|
-
Object.defineProperty(exports, "trimOpenCitation", {
|
|
784
|
-
enumerable: true,
|
|
785
|
-
get: function () { return chunkZ3LLUO32_cjs.trimOpenCitation; }
|
|
786
|
-
});
|
|
787
791
|
Object.defineProperty(exports, "cn", {
|
|
788
792
|
enumerable: true,
|
|
789
793
|
get: function () { return chunkS6A6FSG7_cjs.cn; }
|
package/dist/ui/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as ARBI_MARK_SRC, a as AgentBadge, b as AiMarkdown, c as ArbiIcon, d as Avatar, e as AvatarFallback, f as AvatarImage, B as BASE_COLORS, g as Badge, h as BadgeProps, i as Button, j as ButtonProps, C as COLUMN_LABEL_FALLBACKS, k as Card, l as CardContent, m as CardDescription, n as CardFooter, o as CardHeader, p as CardProps, q as CardTitle, r as Checkbox, s as Collapsible, t as CollapsibleContent, u as CollapsibleTrigger, v as Command, w as CommandDialog, x as CommandEmpty, y as CommandGroup, z as CommandInput, D as CommandItem, E as CommandList, F as CommandSeparator, G as CommandShortcut, H as DEFAULT_METADATA_TAGS, I as DebouncedInput, J as DebouncedInputProps, K as Dialog, L as DialogClose, M as DialogContent, N as DialogDescription, O as DialogFooter, P as DialogHeader, Q as DialogOverlay, R as DialogPortal, S as DialogPresentation, T as DialogTitle, U as DialogTrigger, V as DictateContextValue, W as DocumentCard, X as DocumentCardProps, Y as DocumentEntity, Z as DocumentEntityProps, _ as DocumentLike, $ as DropdownMenu, a0 as DropdownMenuCheckboxItem, a1 as DropdownMenuContent, a2 as DropdownMenuGroup, a3 as DropdownMenuItem, a4 as DropdownMenuLabel, a5 as DropdownMenuPortal, a6 as DropdownMenuRadioGroup, a7 as DropdownMenuRadioItem, a8 as DropdownMenuSeparator, a9 as DropdownMenuShortcut, aa as DropdownMenuSub, ab as DropdownMenuSubContent, ac as DropdownMenuSubTrigger, ad as DropdownMenuTrigger, ae as ENTITY_MAPPINGS, af as EntityIcon, ag as EntityIconComponent, ah as EntityPill, ai as EntityRegistryOverride, aj as EntityType, ak as FileTypeIcon, al as FolderTreeNode, am as
|
|
1
|
+
export { A as ARBI_MARK_SRC, a as AgentBadge, b as AiMarkdown, c as ArbiIcon, d as Avatar, e as AvatarFallback, f as AvatarImage, B as BASE_COLORS, g as Badge, h as BadgeProps, i as Button, j as ButtonProps, C as COLUMN_LABEL_FALLBACKS, k as Card, l as CardContent, m as CardDescription, n as CardFooter, o as CardHeader, p as CardProps, q as CardTitle, r as Checkbox, s as Collapsible, t as CollapsibleContent, u as CollapsibleTrigger, v as Command, w as CommandDialog, x as CommandEmpty, y as CommandGroup, z as CommandInput, D as CommandItem, E as CommandList, F as CommandSeparator, G as CommandShortcut, H as DEFAULT_METADATA_TAGS, I as DebouncedInput, J as DebouncedInputProps, K as Dialog, L as DialogClose, M as DialogContent, N as DialogDescription, O as DialogFooter, P as DialogHeader, Q as DialogOverlay, R as DialogPortal, S as DialogPresentation, T as DialogTitle, U as DialogTrigger, V as DictateContextValue, W as DocumentCard, X as DocumentCardProps, Y as DocumentEntity, Z as DocumentEntityProps, _ as DocumentLike, $ as DropdownMenu, a0 as DropdownMenuCheckboxItem, a1 as DropdownMenuContent, a2 as DropdownMenuGroup, a3 as DropdownMenuItem, a4 as DropdownMenuLabel, a5 as DropdownMenuPortal, a6 as DropdownMenuRadioGroup, a7 as DropdownMenuRadioItem, a8 as DropdownMenuSeparator, a9 as DropdownMenuShortcut, aa as DropdownMenuSub, ab as DropdownMenuSubContent, ac as DropdownMenuSubTrigger, ad as DropdownMenuTrigger, ae as ENTITY_MAPPINGS, af as EntityIcon, ag as EntityIconComponent, ah as EntityPill, ai as EntityRegistryOverride, aj as EntityType, ak as FileTypeIcon, al as FolderTreeNode, am as FormatRelativeTimeOptions, an as HoverCard, ao as HoverCardContent, ap as HoverCardTrigger, aq as IconToggle, ar as IconToggleProps, as as IdentityBusy, at as IdentityProblem, au as IdentityPurchase, av as IdentityState, aw as IdentityStatus, ax as IdentityStep, ay as IdentityVerificationFlow, az as Input, aA as InputProps, aB as Label, aC as MarkMenu, aD as MarkMenuItem, aE as MarkMenuProps, aF as MarkdownCode, aG as MarkdownLink, aH as MarkdownRenderer, aI as MarkdownRendererProps, aJ as MarkdownStreamingContext, aK as NEUTRAL_GRAY, aL as PLACEHOLDER_COLOR, aM as PassageCard, aN as PassageCardProps, aO as Popover, aP as PopoverAnchor, aQ as PopoverClose, aR as PopoverContent, aS as PopoverTrigger, aT as PortalContainerProvider, aU as PresenceDisplayStatus, aV as PresenceLabel, aW as Progress, aX as ProjectEntity, aY as ProjectEntityProps, aZ as ProjectRelation, a_ as ProviderIcon, a$ as RadioGroup, b0 as RadioGroupItem, b1 as Rag, b2 as RagDot, b3 as RelevanceDot, b4 as ScrollArea, b5 as ScrollBar, b6 as Select, b7 as SelectContent, b8 as SelectGroup, b9 as SelectItem, ba as SelectLabel, bb as SelectScrollDownButton, bc as SelectScrollUpButton, bd as SelectSeparator, be as SelectTrigger, bf as SelectValue, bg as Separator, bh as ShieldIcon, bi as ShieldIconProps, bj as Slider, bk as StatusBadgeComponent, bl as StatusBadgeProps, bm as StatusPill, bn as StatusPillProps, bo as StatusVariant, bp as Switch, bq as TAG_TYPE_ICONS, br as TAG_TYPE_LABELS, bs as Table, bt as TableBody, bu as TableCaption, bv as TableCell, bw as TableFooter, bx as TableHead, by as TableHeader, bz as TableRow, bA as Tabs, bB as TabsContent, bC as TabsList, bD as TabsTrigger, bE as TagEntity, bF as TagEntityProps, bG as TagLike, bH as Textarea, bI as TextareaProps, bJ as ThreadVisibilityIcon, bK as Toggle, bL as ToggleGroup, bM as ToggleGroupItem, bN as Tooltip, bO as TooltipContent, bP as TooltipProvider, bQ as TooltipTrigger, bR as UserEntity, bS as UserEntityProps, bT as UserMenu, bU as UserMenuItem, bV as UserMenuProps, bW as UserMenuStatus, bX as VISIBILITY_ICONS, bY as VerifiedBadge, bZ as VerifiedBadgeProps, b_ as VerifiedToggle, b$ as VisibilityIcon, c0 as VisibilityToggle, c1 as VisibilityToggleProps, c2 as agentAvatarColors, c3 as badgeVariants, c4 as buildFolderTree, c5 as buttonVariants, c6 as canonicalFolderPath, c7 as cardVariants, c8 as closeOpenEmphasis, c9 as cn, ca as configureEntityRegistry, cb as configureRagLabels, cc as configureStatusRegistry, cd as createUserAvatarIcon, ce as extensionFromMime, cf as formatDocDate, cg as formatFolderLabel, ch as formatFriendlyDate, ci as formatRelativeTime, cj as friendlyFileType, ck as getDocIcon, cl as getDocumentAuthor, cm as getDocumentDate, cn as getDocumentNature, co as getDocumentSubject, cp as getDocumentTitle, cq as getEntityColor, cr as getEntityColorStyles, cs as getEntityIcon, ct as getEntityLabel, cu as getFileExtension, cv as getFileTypeIcon, cw as getStatusVariant, cx as getTagTypeIcon, cy as getTagTypeLabel, cz as getUserAvatarColor, cA as getUserDisplayName, cB as getUserInitials, cC as getWorkspaceColor, cD as isAgent, cE as isAudioFile, cF as isDocumentAddableToConversation, cG as isDownloadOnlyFile, cH as isImageDocument, cI as isImageFile, cJ as isMediaFile, cK as isVideoFile, cL as markdownBaseComponents, cM as markdownSanitizeSchema, cN as markdownToPlainText, cO as markdownToPlainTextBlocks, cQ as splitMarkdownBlocks, cR as tagKindNouns, cS as tagKindTitle, cT as toggleVariants, cU as trimOpenCitation, cV as useDictateContext, cW as usePortalContainer, cX as usesOriginalBytesForViewer } from '../index.d-DscWCwr2.cjs';
|
|
2
2
|
import 'clsx';
|
|
3
3
|
import 'react';
|
|
4
4
|
import '@radix-ui/react-avatar';
|
package/dist/ui/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as ARBI_MARK_SRC, a as AgentBadge, b as AiMarkdown, c as ArbiIcon, d as Avatar, e as AvatarFallback, f as AvatarImage, B as BASE_COLORS, g as Badge, h as BadgeProps, i as Button, j as ButtonProps, C as COLUMN_LABEL_FALLBACKS, k as Card, l as CardContent, m as CardDescription, n as CardFooter, o as CardHeader, p as CardProps, q as CardTitle, r as Checkbox, s as Collapsible, t as CollapsibleContent, u as CollapsibleTrigger, v as Command, w as CommandDialog, x as CommandEmpty, y as CommandGroup, z as CommandInput, D as CommandItem, E as CommandList, F as CommandSeparator, G as CommandShortcut, H as DEFAULT_METADATA_TAGS, I as DebouncedInput, J as DebouncedInputProps, K as Dialog, L as DialogClose, M as DialogContent, N as DialogDescription, O as DialogFooter, P as DialogHeader, Q as DialogOverlay, R as DialogPortal, S as DialogPresentation, T as DialogTitle, U as DialogTrigger, V as DictateContextValue, W as DocumentCard, X as DocumentCardProps, Y as DocumentEntity, Z as DocumentEntityProps, _ as DocumentLike, $ as DropdownMenu, a0 as DropdownMenuCheckboxItem, a1 as DropdownMenuContent, a2 as DropdownMenuGroup, a3 as DropdownMenuItem, a4 as DropdownMenuLabel, a5 as DropdownMenuPortal, a6 as DropdownMenuRadioGroup, a7 as DropdownMenuRadioItem, a8 as DropdownMenuSeparator, a9 as DropdownMenuShortcut, aa as DropdownMenuSub, ab as DropdownMenuSubContent, ac as DropdownMenuSubTrigger, ad as DropdownMenuTrigger, ae as ENTITY_MAPPINGS, af as EntityIcon, ag as EntityIconComponent, ah as EntityPill, ai as EntityRegistryOverride, aj as EntityType, ak as FileTypeIcon, al as FolderTreeNode, am as
|
|
1
|
+
export { A as ARBI_MARK_SRC, a as AgentBadge, b as AiMarkdown, c as ArbiIcon, d as Avatar, e as AvatarFallback, f as AvatarImage, B as BASE_COLORS, g as Badge, h as BadgeProps, i as Button, j as ButtonProps, C as COLUMN_LABEL_FALLBACKS, k as Card, l as CardContent, m as CardDescription, n as CardFooter, o as CardHeader, p as CardProps, q as CardTitle, r as Checkbox, s as Collapsible, t as CollapsibleContent, u as CollapsibleTrigger, v as Command, w as CommandDialog, x as CommandEmpty, y as CommandGroup, z as CommandInput, D as CommandItem, E as CommandList, F as CommandSeparator, G as CommandShortcut, H as DEFAULT_METADATA_TAGS, I as DebouncedInput, J as DebouncedInputProps, K as Dialog, L as DialogClose, M as DialogContent, N as DialogDescription, O as DialogFooter, P as DialogHeader, Q as DialogOverlay, R as DialogPortal, S as DialogPresentation, T as DialogTitle, U as DialogTrigger, V as DictateContextValue, W as DocumentCard, X as DocumentCardProps, Y as DocumentEntity, Z as DocumentEntityProps, _ as DocumentLike, $ as DropdownMenu, a0 as DropdownMenuCheckboxItem, a1 as DropdownMenuContent, a2 as DropdownMenuGroup, a3 as DropdownMenuItem, a4 as DropdownMenuLabel, a5 as DropdownMenuPortal, a6 as DropdownMenuRadioGroup, a7 as DropdownMenuRadioItem, a8 as DropdownMenuSeparator, a9 as DropdownMenuShortcut, aa as DropdownMenuSub, ab as DropdownMenuSubContent, ac as DropdownMenuSubTrigger, ad as DropdownMenuTrigger, ae as ENTITY_MAPPINGS, af as EntityIcon, ag as EntityIconComponent, ah as EntityPill, ai as EntityRegistryOverride, aj as EntityType, ak as FileTypeIcon, al as FolderTreeNode, am as FormatRelativeTimeOptions, an as HoverCard, ao as HoverCardContent, ap as HoverCardTrigger, aq as IconToggle, ar as IconToggleProps, as as IdentityBusy, at as IdentityProblem, au as IdentityPurchase, av as IdentityState, aw as IdentityStatus, ax as IdentityStep, ay as IdentityVerificationFlow, az as Input, aA as InputProps, aB as Label, aC as MarkMenu, aD as MarkMenuItem, aE as MarkMenuProps, aF as MarkdownCode, aG as MarkdownLink, aH as MarkdownRenderer, aI as MarkdownRendererProps, aJ as MarkdownStreamingContext, aK as NEUTRAL_GRAY, aL as PLACEHOLDER_COLOR, aM as PassageCard, aN as PassageCardProps, aO as Popover, aP as PopoverAnchor, aQ as PopoverClose, aR as PopoverContent, aS as PopoverTrigger, aT as PortalContainerProvider, aU as PresenceDisplayStatus, aV as PresenceLabel, aW as Progress, aX as ProjectEntity, aY as ProjectEntityProps, aZ as ProjectRelation, a_ as ProviderIcon, a$ as RadioGroup, b0 as RadioGroupItem, b1 as Rag, b2 as RagDot, b3 as RelevanceDot, b4 as ScrollArea, b5 as ScrollBar, b6 as Select, b7 as SelectContent, b8 as SelectGroup, b9 as SelectItem, ba as SelectLabel, bb as SelectScrollDownButton, bc as SelectScrollUpButton, bd as SelectSeparator, be as SelectTrigger, bf as SelectValue, bg as Separator, bh as ShieldIcon, bi as ShieldIconProps, bj as Slider, bk as StatusBadgeComponent, bl as StatusBadgeProps, bm as StatusPill, bn as StatusPillProps, bo as StatusVariant, bp as Switch, bq as TAG_TYPE_ICONS, br as TAG_TYPE_LABELS, bs as Table, bt as TableBody, bu as TableCaption, bv as TableCell, bw as TableFooter, bx as TableHead, by as TableHeader, bz as TableRow, bA as Tabs, bB as TabsContent, bC as TabsList, bD as TabsTrigger, bE as TagEntity, bF as TagEntityProps, bG as TagLike, bH as Textarea, bI as TextareaProps, bJ as ThreadVisibilityIcon, bK as Toggle, bL as ToggleGroup, bM as ToggleGroupItem, bN as Tooltip, bO as TooltipContent, bP as TooltipProvider, bQ as TooltipTrigger, bR as UserEntity, bS as UserEntityProps, bT as UserMenu, bU as UserMenuItem, bV as UserMenuProps, bW as UserMenuStatus, bX as VISIBILITY_ICONS, bY as VerifiedBadge, bZ as VerifiedBadgeProps, b_ as VerifiedToggle, b$ as VisibilityIcon, c0 as VisibilityToggle, c1 as VisibilityToggleProps, c2 as agentAvatarColors, c3 as badgeVariants, c4 as buildFolderTree, c5 as buttonVariants, c6 as canonicalFolderPath, c7 as cardVariants, c8 as closeOpenEmphasis, c9 as cn, ca as configureEntityRegistry, cb as configureRagLabels, cc as configureStatusRegistry, cd as createUserAvatarIcon, ce as extensionFromMime, cf as formatDocDate, cg as formatFolderLabel, ch as formatFriendlyDate, ci as formatRelativeTime, cj as friendlyFileType, ck as getDocIcon, cl as getDocumentAuthor, cm as getDocumentDate, cn as getDocumentNature, co as getDocumentSubject, cp as getDocumentTitle, cq as getEntityColor, cr as getEntityColorStyles, cs as getEntityIcon, ct as getEntityLabel, cu as getFileExtension, cv as getFileTypeIcon, cw as getStatusVariant, cx as getTagTypeIcon, cy as getTagTypeLabel, cz as getUserAvatarColor, cA as getUserDisplayName, cB as getUserInitials, cC as getWorkspaceColor, cD as isAgent, cE as isAudioFile, cF as isDocumentAddableToConversation, cG as isDownloadOnlyFile, cH as isImageDocument, cI as isImageFile, cJ as isMediaFile, cK as isVideoFile, cL as markdownBaseComponents, cM as markdownSanitizeSchema, cN as markdownToPlainText, cO as markdownToPlainTextBlocks, cQ as splitMarkdownBlocks, cR as tagKindNouns, cS as tagKindTitle, cT as toggleVariants, cU as trimOpenCitation, cV as useDictateContext, cW as usePortalContainer, cX as usesOriginalBytesForViewer } from '../index.d-DscWCwr2.js';
|
|
2
2
|
import 'clsx';
|
|
3
3
|
import 'react';
|
|
4
4
|
import '@radix-ui/react-avatar';
|
package/dist/ui/index.js
CHANGED
|
@@ -2,9 +2,9 @@ export { ARBI_MARK_SRC, AgentBadge, AiMarkdown, ArbiIcon, BASE_COLORS, Badge, CO
|
|
|
2
2
|
export { Avatar, AvatarFallback, AvatarImage, createUserAvatarIcon, getUserAvatarColor, getUserDisplayName, getUserInitials, isAgent } from '../chunk-APZZQZ6P.js';
|
|
3
3
|
export { MarkdownCode, MarkdownLink, MarkdownRenderer, MarkdownStreamingContext, markdownBaseComponents, markdownSanitizeSchema, splitMarkdownBlocks } from '../chunk-C44GO33B.js';
|
|
4
4
|
export { Button, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, buttonVariants } from '../chunk-YNNAJJ5Z.js';
|
|
5
|
-
export { ScrollArea, ScrollBar } from '../chunk-
|
|
6
|
-
export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, PortalContainerProvider, usePortalContainer } from '../chunk-47CCGUWR.js';
|
|
5
|
+
export { ScrollArea, ScrollBar, formatRelativeTime } from '../chunk-NA3FJX37.js';
|
|
7
6
|
export { closeOpenEmphasis, trimOpenCitation } from '../chunk-QRCMKEE6.js';
|
|
7
|
+
export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, PortalContainerProvider, usePortalContainer } from '../chunk-47CCGUWR.js';
|
|
8
8
|
export { cn } from '../chunk-SN5YV6FF.js';
|
|
9
9
|
import '../chunk-CPZ36AQS.js';
|
|
10
10
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arbidocs/react",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.20",
|
|
4
4
|
"description": "React hooks and provider for the ARBI SDK",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -101,8 +101,8 @@
|
|
|
101
101
|
"build-storybook": "storybook build"
|
|
102
102
|
},
|
|
103
103
|
"dependencies": {
|
|
104
|
-
"@arbidocs/client": "0.5.
|
|
105
|
-
"@arbidocs/sdk": "0.5.
|
|
104
|
+
"@arbidocs/client": "0.5.20",
|
|
105
|
+
"@arbidocs/sdk": "0.5.20",
|
|
106
106
|
"@didit-protocol/sdk-web": "0.4.0",
|
|
107
107
|
"@livekit/components-react": "2.9.24",
|
|
108
108
|
"@radix-ui/react-avatar": "^1.2.0",
|
package/dist/bundle-4TKU5WEQ.js
DELETED
package/dist/bundle-B5AN4B7H.cjs
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var chunkEYOXZHXM_cjs = require('./chunk-EYOXZHXM.cjs');
|
|
4
|
-
require('./chunk-NSSGDZSL.cjs');
|
|
5
|
-
require('./chunk-IU2CJNTB.cjs');
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
Object.defineProperty(exports, "buildBundle", {
|
|
10
|
-
enumerable: true,
|
|
11
|
-
get: function () { return chunkEYOXZHXM_cjs.buildBundle; }
|
|
12
|
-
});
|
|
13
|
-
//# sourceMappingURL=bundle-B5AN4B7H.cjs.map
|
|
14
|
-
//# sourceMappingURL=bundle-B5AN4B7H.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/document-tools/environment.tsx","../src/document-tools/document-pdf.ts","../src/document-tools/markup-download.ts"],"names":["createContext","useDeploymentDomain","useMemo","jsx","useContext","parseVersionRef"],"mappings":";;;;;;;AAmEO,SAAS,kBAAkB,KAAA,EAAoC;AACpE,EAAA,MAAM,MAAA,GAAS,IAAI,eAAA,EAAgB;AACnC,EAAA,KAAA,MAAW,CAAC,GAAA,EAAK,KAAK,KAAK,MAAA,CAAO,OAAA,CAAQ,KAAK,CAAA,EAAG;AAChD,IAAA,IAAI,KAAA,KAAU,IAAA,IAAQ,KAAA,KAAU,MAAA,EAAW;AAC3C,IAAA,KAAA,MAAW,IAAA,IAAQ,KAAA,CAAM,OAAA,CAAQ,KAAK,IAAI,KAAA,GAAQ,CAAC,KAAK,CAAA,EAAG,MAAA,CAAO,MAAA,CAAO,GAAA,EAAK,MAAA,CAAO,IAAI,CAAC,CAAA;AAAA,EAC5F;AACA,EAAA,OAAO,OAAO,QAAA,EAAS;AACzB;AAmDO,SAAS,YAAA,CAAa,MAAY,QAAA,EAAwB;AAC/D,EAAA,MAAM,GAAA,GAAM,GAAA,CAAI,eAAA,CAAgB,I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AAA,EAAM,QAAA,KAAa,MAAM,MAAA,CAAO,IAAI,2CAAA,EAA6C;AAAA,IACvF,MAAA,EAAQ,EAAE,IAAA,EAAM,EAAE,eAAA,EAAiB,UAAA,EAAW,EAAG,KAAA,EAAO,OAAA,GAAU,EAAE,OAAA,EAAQ,GAAI,EAAC,EAAE;AAAA,IACnF,OAAA,EAAS;AAAA,GACV,CAAA;AACD,EAAA,IAAI,CAAC,QAAA,CAAS,EAAA,IAAM,CAAC,IAAA,EAAM;AACzB,IAAA,MAAM,IAAI,mBAAA;AAAA,MACR,QAAA,CAAS,WAAW,GAAA,GAChB,iCAAA;AAAA;AAAA,QAEA,QAAA,CAAS,MAAA,KAAW,GAAA,GAClB,oBAAA,GACA;AAAA,OAAA;AAAA,MACN,QAAA,CAAS;AAAA,KACX;AAAA,EACF;AACA,EAAA,MAAM,WAAA,GAAc,QAAA,CAAS,OAAA,CAAQ,GAAA,CAAI,qBAAqB,CAAA,IAAK,EAAA;AACnE,EAAA,MAAM,IAAA,GAAO,4BAAA,CAA6B,IAAA,CAAK,WAAW,IAAI,CAAC,CAAA;AAC/D,EAAA,MAAM,KAAA,GAAQ,qBAAA,CAAsB,IAAA,CAAK,WAAW,IAAI,CAAC,CAAA;AACzD,EAAA,MAAM,QAAA,GAAW,IAAA,GAAO,kBAAA,CAAmB,IAAI,IAAK,KAAA,IAAS,YAAA;AAC7D,EAAA,OAAO,EAAE,IAAA,EAAM,IAAA,EAAc,QAAA,EAAS;AACxC","file":"chunk-2M4B4FFA.cjs","sourcesContent":["/**\n * The host app's side of the document tools (markup, freeze, e-signing, versions): the one place\n * the tools reach the app. They never import a store, a router, a toast library or app API code;\n * the host passes what it has to `<DocumentToolsProvider>` and every optional field has a default.\n *\n * `client` is an openapi-fetch client for the ARBI API (`ArbiClient['fetch']` from\n * `@arbidocs/client`, or `arbi.getClient().fetch` from an `@arbidocs/sdk` `Arbi`), signed in with the\n * user's session; it carries the auth.\n */\n\nimport { createContext, useContext, useMemo, type ReactNode } from 'react'\nimport type { ArbiClient, operations } from '@arbidocs/client'\nimport { useDeploymentDomain } from '../useArbi'\n\nexport type DocumentToolsClient = ArbiClient['fetch']\n\nexport type DocumentToolsNoticeKind = 'success' | 'error' | 'info' | 'warning'\n\nexport interface DocumentToolsNoticeOptions {\n /** A second line under the message. */\n description?: string\n /** One action button on the notice (\"Email it\"). */\n action?: { label: string; onClick: () => void }\n}\n\nexport type DocumentToolsNotify = (\n message: string,\n kind: DocumentToolsNoticeKind,\n options?: DocumentToolsNoticeOptions\n) => void\n\nexport interface DocumentToolsUser {\n /** The name marks are authored as and the signer's name is prefilled with. */\n name: string\n /** The sign-in email: signing re-derives the user's key from it and the password. */\n email?: string | null\n /** The user's id (usr-*): which fields of a signature request are theirs. */\n externalId?: string | null\n}\n\n/** What changed about a document, so the host can refresh its own lists and caches. */\nexport type DocumentChange =\n /** A version's markup got its first mark or lost its last one. */\n | 'markup'\n /** A signature was added: the document has a new current version. */\n | 'signed'\n /** A new document was made from it (a frozen copy). The ids are the NEW documents. */\n | 'copy'\n /** A new version was saved (the Word editor's Save version): the document's current version. */\n | 'version'\n\n/**\n * The `/v1/document/upload` query, typed from the API schema: `derived_from` is a list (a\n * production set is derived from every document in it), `shared` a boolean.\n */\nexport type DocumentUploadQuery = NonNullable<operations['upload_documents']['parameters']['query']>\n\nexport interface DocumentUploadRequest {\n file: File\n /** `/v1/document/upload` query: `derived_from`, `derived_role`, `shared`, `folder`. */\n query: DocumentUploadQuery\n}\n\n/**\n * The upload query as a URL query string, for a host that posts the upload itself (an XHR with\n * progress): a list repeats its key (`derived_from=a&derived_from=b`), empty values are left out.\n */\nexport function uploadQueryString(query: DocumentUploadQuery): string {\n const params = new URLSearchParams()\n for (const [key, value] of Object.entries(query)) {\n if (value === null || value === undefined) continue\n for (const item of Array.isArray(value) ? value : [value]) params.append(key, String(item))\n }\n return params.toString()\n}\n\nexport interface DocumentToolsEnvironment {\n client: DocumentToolsClient\n /**\n * The deployment domain the user's keys are derived for. Needed for signing. Default: the one\n * the host's `Arbi` computes (`arbi.getDeploymentDomain()`), if any.\n */\n deploymentDomain?: string\n /** The signed-in user; marks are authored as \"You\" without one, and signing is unavailable. */\n user?: DocumentToolsUser | null\n /** Surface a transient message. Default: none (errors still show inline where they can). */\n notify?: DocumentToolsNotify\n /** Open a document or a version reference (`doc-…@v2`): the copy just made, the signed copy. */\n openDocument?: (documentRef: string) => void\n /**\n * Documents changed on the server (see {@link DocumentChange}); refresh the host's lists. The\n * tools wait for it before opening the document, so a copy is listed when it opens.\n */\n onDocumentsChanged?: (documentIds: string[], change: DocumentChange) => void | Promise<void>\n /** Upload a derived copy. Default: `POST /v1/document/upload` through `client`. */\n uploadDocument?: (\n request: DocumentUploadRequest\n ) => Promise<{ doc_ext_ids?: string[] } | undefined>\n /** Save a file to the user's computer. Default: a temporary download link. */\n saveFile?: (blob: Blob, fileName: string) => void\n /** Email a document (offered once it is signed). Omitted: no \"Email it\". */\n emailDocument?: (documentRef: string) => void\n /**\n * The public page that checks a signature (the certificate) in this app. When given, \"View\n * certificate\" opens it in preference to the backend's `certificate_url` (which is on the\n * deployment domain, like the link embedded in the signed PDF). Without it: the backend's\n * `certificate_url`, else `/verify/{reference}` on this origin.\n */\n certificateUrl?: (reference: string) => string\n}\n\n/** The environment with every default filled in. */\nexport interface ResolvedDocumentToolsEnvironment extends DocumentToolsEnvironment {\n notify: DocumentToolsNotify\n saveFile: (blob: Blob, fileName: string) => void\n uploadDocument: (\n request: DocumentUploadRequest\n ) => Promise<{ doc_ext_ids?: string[] } | undefined>\n}\n\n/**\n * Save a blob through a temporary `<a download>`. The object URL is revoked a minute later, not at\n * once: revoking straight after `click()` can cancel the download (Safari, and large files\n * elsewhere) before the browser has read the blob.\n */\nexport function downloadBlob(blob: Blob, fileName: string): void {\n const url = URL.createObjectURL(blob)\n const a = document.createElement('a')\n a.href = url\n a.download = fileName\n document.body.appendChild(a)\n a.click()\n a.remove()\n setTimeout(() => URL.revokeObjectURL(url), 60_000)\n}\n\n/** The default upload: multipart `files` to `/v1/document/upload` through the API client. */\nexport function clientUpload(client: DocumentToolsClient) {\n return async ({ file, query }: DocumentUploadRequest) => {\n const formData = new FormData()\n formData.append('files', file)\n const { data, response } = await client.POST('/v1/document/upload', {\n params: { query },\n // The schema types the multipart body as `{ files: string[] }`; the FormData is sent as is.\n body: formData as unknown as { files: string[] },\n bodySerializer: () => formData,\n })\n if (!response.ok) throw new Error(`Upload failed with status ${response.status}`)\n return data\n }\n}\n\nexport function defaultCertificateUrl(reference: string): string {\n const origin = typeof location === 'undefined' ? '' : location.origin\n return `${origin}/verify/${encodeURIComponent(reference)}`\n}\n\n/**\n * Where \"View certificate\" goes for a signature: the host's `certificateUrl(reference)` when it\n * gives one, else the `certificate_url` the backend returned, else `/verify/{reference}` here.\n */\nexport function certificateLink(\n signature: { reference: string; certificate_url?: string | null },\n certificateUrl?: (reference: string) => string\n): string {\n if (certificateUrl) return certificateUrl(signature.reference)\n return signature.certificate_url || defaultCertificateUrl(signature.reference)\n}\n\nconst DocumentToolsContext = createContext<ResolvedDocumentToolsEnvironment | null>(null)\n\nexport interface DocumentToolsProviderProps extends DocumentToolsEnvironment {\n children: ReactNode\n}\n\nexport function DocumentToolsProvider({ children, ...env }: DocumentToolsProviderProps) {\n const arbiDeploymentDomain = useDeploymentDomain()\n const {\n client,\n deploymentDomain,\n user,\n notify,\n openDocument,\n onDocumentsChanged,\n uploadDocument,\n saveFile,\n emailDocument,\n certificateUrl,\n } = env\n const value = useMemo<ResolvedDocumentToolsEnvironment>(\n () => ({\n client,\n deploymentDomain: deploymentDomain ?? arbiDeploymentDomain,\n user,\n openDocument,\n onDocumentsChanged,\n emailDocument,\n notify: notify ?? (() => {}),\n saveFile: saveFile ?? downloadBlob,\n uploadDocument: uploadDocument ?? clientUpload(client),\n certificateUrl,\n }),\n [\n client,\n deploymentDomain,\n arbiDeploymentDomain,\n user,\n notify,\n openDocument,\n onDocumentsChanged,\n uploadDocument,\n saveFile,\n emailDocument,\n certificateUrl,\n ]\n )\n return <DocumentToolsContext.Provider value={value}>{children}</DocumentToolsContext.Provider>\n}\n\n/** The host's environment, or `null` outside a `<DocumentToolsProvider>`. */\nexport function useOptionalDocumentTools(): ResolvedDocumentToolsEnvironment | null {\n return useContext(DocumentToolsContext)\n}\n\n/** The host's environment; throws outside a `<DocumentToolsProvider>`. */\nexport function useDocumentTools(): ResolvedDocumentToolsEnvironment {\n const env = useContext(DocumentToolsContext)\n if (!env) throw new Error('The document tools must be used within a <DocumentToolsProvider>')\n return env\n}\n","/**\n * A document's bytes, through the host's API client: the PDF the viewer and the tools draw on\n * (`/view`: the file itself for a PDF, its PDF rendering for a Word or text file) and the stored\n * file (`/download`). Either takes a document id or a version reference `doc-…@v{n}`.\n */\n\nimport { parseVersionRef } from '../artifacts/versions'\nimport type { DocumentToolsClient } from './environment'\n\nexport interface DocumentFetchOptions {\n /** The version to fetch. Default: the one `documentRef` names, else the current version. */\n version?: number | null\n signal?: AbortSignal\n}\n\n/** A document's bytes could not be fetched; `status` is the HTTP status. */\nexport class DocumentFetchError extends Error {\n readonly status: number\n constructor(message: string, status: number) {\n super(message)\n this.name = 'DocumentFetchError'\n this.status = status\n }\n}\n\nasync function fetchDocumentBytes(\n client: DocumentToolsClient,\n endpoint: '/v1/document/{document_ext_id}/view' | '/v1/document/{document_ext_id}/download',\n documentRef: string,\n options: DocumentFetchOptions,\n headers: Record<string, string>,\n what: string\n): Promise<{ blob: Blob; response: Response }> {\n const ref = parseVersionRef(documentRef)\n const version = options.version ?? ref.version\n const { data, response } = await client.GET(endpoint, {\n params: { path: { document_ext_id: ref.docId }, query: version ? { version } : {} },\n headers,\n parseAs: 'blob',\n signal: options.signal,\n })\n if (!response.ok || !(data instanceof Blob)) {\n throw new DocumentFetchError(\n `${what} could not be loaded (${response.status})`,\n response.status\n )\n }\n return { blob: data, response }\n}\n\n/**\n * The file name a `Content-Disposition` header gives, or `undefined`. Prefers the RFC 5987\n * `filename*=UTF-8''…` form (percent-encoded, any script) over the plain `filename=`.\n */\nexport function contentDispositionFileName(header: string | null | undefined): string | undefined {\n if (!header) return undefined\n const extended = /filename\\*\\s*=\\s*(?:[\\w-]+)?'[^']*'([^;]+)/i.exec(header)\n if (extended) {\n try {\n return decodeURIComponent(extended[1].trim().replace(/^\"|\"$/g, '')) || undefined\n } catch {\n // A malformed escape: fall back to the plain parameter.\n }\n }\n const plain = /filename\\s*=\\s*(\"((?:[^\"\\\\]|\\\\.)*)\"|[^;]+)/i.exec(header)\n if (!plain) return undefined\n const name = plain[2] !== undefined ? plain[2].replace(/\\\\(.)/g, '$1') : plain[1].trim()\n return name || undefined\n}\n\n/**\n * The PDF of a document version: `GET /v1/document/{id}/view?version=` with\n * `Accept: application/pdf`. Throws a {@link DocumentFetchError} when there is none (yet).\n */\nexport async function fetchDocumentPdf(\n client: DocumentToolsClient,\n documentRef: string,\n options: DocumentFetchOptions = {}\n): Promise<Blob> {\n const { blob } = await fetchDocumentBytes(\n client,\n '/v1/document/{document_ext_id}/view',\n documentRef,\n options,\n { Accept: 'application/pdf' },\n 'The PDF'\n )\n return blob\n}\n\n/**\n * The stored file of a document version, as uploaded: `GET /v1/document/{id}/download`. When the\n * server names the file (`Content-Disposition`), the result is a `File` carrying that name.\n */\nexport async function fetchDocumentFile(\n client: DocumentToolsClient,\n documentRef: string,\n options: DocumentFetchOptions = {}\n): Promise<Blob | File> {\n const { blob, response } = await fetchDocumentBytes(\n client,\n '/v1/document/{document_ext_id}/download',\n documentRef,\n options,\n {},\n 'The file'\n )\n const name = contentDispositionFileName(response.headers.get('Content-Disposition'))\n return name ? new File([blob], name, { type: blob.type }) : blob\n}\n","/**\n * \"Download with markup\": a document version's markup PDF, the PDF with its annotations as native\n * PDF annotations (comments, highlights, stamps, unapplied redactions), which Acrobat and Preview\n * show. The plain Download serves the original. Kept apart from the annotation layer code so a\n * documents list can offer it without loading the annotation tools.\n *\n * A SIGNED version is locked: nothing but a further signature changes it. Its markup stays in the\n * separate markup layer (a title beside the signature, say) and is never written into its PDF, so\n * it has no \"Download with markup\"; the plain Download is the signed file as it is.\n */\n\nimport type { DocumentToolsClient } from './environment'\n\ninterface DocumentVersions {\n current_version?: number | null\n versions?: Array<{ n: number; markup_count?: number | null; reason?: string | null }> | null\n}\n\n/** Why \"Download with markup\" is off for a signed version. */\nexport const SIGNED_LOCKED_REASON =\n \"Signed documents can't be changed — download the signed file instead\"\n\n/** Whether a version (default: the current one) is a signed copy, per its version entry. */\nexport function isSignedVersion(doc: DocumentVersions, version?: number): boolean {\n const n = version ?? doc.current_version ?? 1\n return (doc.versions ?? []).some((v) => v.n === n && v.reason === 'signed')\n}\n\nexport class MarkupDownloadError extends Error {\n constructor(\n message: string,\n readonly status?: number\n ) {\n super(message)\n this.name = 'MarkupDownloadError'\n }\n}\n\n/** Whether a document's current version has markup (per its version entries). */\nexport function currentHasMarkup(doc: DocumentVersions): boolean {\n const n = doc.current_version ?? 1\n return (doc.versions ?? []).some((v) => v.n === n && (v.markup_count ?? 0) > 0)\n}\n\n/** Fetch a version's markup PDF (default: the current version's). */\nexport async function fetchMarkupPdf(\n client: DocumentToolsClient,\n documentId: string,\n version?: number\n): Promise<{ blob: Blob; fileName: string }> {\n const { data, response } = await client.GET('/v1/document/{document_ext_id}/markup/pdf', {\n params: { path: { document_ext_id: documentId }, query: version ? { version } : {} },\n parseAs: 'blob',\n })\n if (!response.ok || !data) {\n throw new MarkupDownloadError(\n response.status === 404\n ? 'This document has no markup yet'\n : // The server refuses a signed version: its PDF takes no more changes.\n response.status === 409\n ? SIGNED_LOCKED_REASON\n : 'The markup could not be downloaded',\n response.status\n )\n }\n const disposition = response.headers.get('content-disposition') ?? ''\n const utf8 = /filename\\*=UTF-8''([^;]+)/i.exec(disposition)?.[1]\n const plain = /filename=\"([^\"]+)\"/i.exec(disposition)?.[1]\n const fileName = utf8 ? decodeURIComponent(utf8) : (plain ?? 'markup.pdf')\n return { blob: data as Blob, fileName }\n}\n"]}
|