@arbidocs/blocks 0.5.155 → 0.5.156
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/{ConnectedNativeDocxComparison-2DAQX5GX.cjs → ConnectedNativeDocxComparison-G3AIBKSN.cjs} +7 -7
- package/dist/{ConnectedNativeDocxComparison-2DAQX5GX.cjs.map → ConnectedNativeDocxComparison-G3AIBKSN.cjs.map} +1 -1
- package/dist/{ConnectedStreamedWordArtifact-LTYB62VM.cjs → ConnectedStreamedWordArtifact-ISNLUTAT.cjs} +7 -7
- package/dist/{ConnectedStreamedWordArtifact-LTYB62VM.cjs.map → ConnectedStreamedWordArtifact-ISNLUTAT.cjs.map} +1 -1
- package/dist/{DocumentReviewCard-5AP55NGZ.cjs → DocumentReviewCard-7ZH575KX.cjs} +13 -13
- package/dist/{DocumentReviewCard-5AP55NGZ.cjs.map → DocumentReviewCard-7ZH575KX.cjs.map} +1 -1
- package/dist/{FilesViewerDialog-SHWCE3UN.cjs → FilesViewerDialog-6RWJSZZV.cjs} +10 -10
- package/dist/{FilesViewerDialog-SHWCE3UN.cjs.map → FilesViewerDialog-6RWJSZZV.cjs.map} +1 -1
- package/dist/{WorkspaceTableView-S4IBYQVF.cjs → WorkspaceTableView-NMERZJZZ.cjs} +4 -4
- package/dist/{WorkspaceTableView-S4IBYQVF.cjs.map → WorkspaceTableView-NMERZJZZ.cjs.map} +1 -1
- package/dist/agents/index.cjs +172 -172
- package/dist/{chunk-JCFXS336.cjs → chunk-44M4FI2N.cjs} +8 -8
- package/dist/chunk-44M4FI2N.cjs.map +1 -0
- package/dist/{chunk-KWWGUQJV.cjs → chunk-4I4IYVC6.cjs} +7 -7
- package/dist/{chunk-KWWGUQJV.cjs.map → chunk-4I4IYVC6.cjs.map} +1 -1
- package/dist/{chunk-BTQ7IAOH.cjs → chunk-B2L3XNZH.cjs} +4 -4
- package/dist/{chunk-BTQ7IAOH.cjs.map → chunk-B2L3XNZH.cjs.map} +1 -1
- package/dist/{chunk-4XNP27N4.cjs → chunk-BNHFDXJI.cjs} +36 -36
- package/dist/{chunk-4XNP27N4.cjs.map → chunk-BNHFDXJI.cjs.map} +1 -1
- package/dist/{chunk-ZCQXQIBA.cjs → chunk-DCD4OHDF.cjs} +28 -28
- package/dist/{chunk-ZCQXQIBA.cjs.map → chunk-DCD4OHDF.cjs.map} +1 -1
- package/dist/{chunk-6ZZWQ3OL.cjs → chunk-FNBUFKHE.cjs} +4 -4
- package/dist/{chunk-6ZZWQ3OL.cjs.map → chunk-FNBUFKHE.cjs.map} +1 -1
- package/dist/{chunk-B5BGVPQ5.cjs → chunk-HGD4B7GO.cjs} +4 -4
- package/dist/{chunk-B5BGVPQ5.cjs.map → chunk-HGD4B7GO.cjs.map} +1 -1
- package/dist/{chunk-4UDGCXUR.cjs → chunk-HJHDKS4V.cjs} +5 -5
- package/dist/{chunk-4UDGCXUR.cjs.map → chunk-HJHDKS4V.cjs.map} +1 -1
- package/dist/{chunk-3SGFIDID.cjs → chunk-HLUZMXEZ.cjs} +56 -56
- package/dist/{chunk-3SGFIDID.cjs.map → chunk-HLUZMXEZ.cjs.map} +1 -1
- package/dist/{chunk-BZVK7JW5.cjs → chunk-K7GBHLLY.cjs} +4 -4
- package/dist/{chunk-BZVK7JW5.cjs.map → chunk-K7GBHLLY.cjs.map} +1 -1
- package/dist/{chunk-MAKCWF45.cjs → chunk-M24FBUAP.cjs} +4 -4
- package/dist/{chunk-MAKCWF45.cjs.map → chunk-M24FBUAP.cjs.map} +1 -1
- package/dist/{chunk-QEH375MU.cjs → chunk-PD47L6KS.cjs} +4 -4
- package/dist/{chunk-QEH375MU.cjs.map → chunk-PD47L6KS.cjs.map} +1 -1
- package/dist/{chunk-Y2Z5UHHV.cjs → chunk-PTT5MZ7O.cjs} +8 -8
- package/dist/{chunk-Y2Z5UHHV.cjs.map → chunk-PTT5MZ7O.cjs.map} +1 -1
- package/dist/{chunk-TSAZWUPZ.cjs → chunk-Q7G2W5VQ.cjs} +4 -4
- package/dist/{chunk-TSAZWUPZ.cjs.map → chunk-Q7G2W5VQ.cjs.map} +1 -1
- package/dist/{chunk-RL2HI6NP.cjs → chunk-S3GVFAFB.cjs} +3 -3
- package/dist/{chunk-RL2HI6NP.cjs.map → chunk-S3GVFAFB.cjs.map} +1 -1
- package/dist/{chunk-OZJENXU3.cjs → chunk-U6JUIJTP.cjs} +9 -9
- package/dist/{chunk-OZJENXU3.cjs.map → chunk-U6JUIJTP.cjs.map} +1 -1
- package/dist/{chunk-2XOIULVN.cjs → chunk-V4B2GSC6.cjs} +29 -29
- package/dist/{chunk-2XOIULVN.cjs.map → chunk-V4B2GSC6.cjs.map} +1 -1
- package/dist/{chunk-TN3UP3CI.cjs → chunk-YHXJWYOF.cjs} +6 -6
- package/dist/{chunk-TN3UP3CI.cjs.map → chunk-YHXJWYOF.cjs.map} +1 -1
- package/dist/{chunk-74RUAGVD.cjs → chunk-YO7GDNEW.cjs} +5 -5
- package/dist/{chunk-74RUAGVD.cjs.map → chunk-YO7GDNEW.cjs.map} +1 -1
- package/dist/connect/docx.cjs +10 -10
- package/dist/connect/index.cjs +658 -655
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/viewer.cjs +8 -8
- package/dist/connection/files/page/ConnectedFilesPage.js +16 -13
- package/dist/connection/files/page/ConnectedFilesPage.js.map +2 -2
- package/dist/connection/pages/DocumentBlocks.js +1 -1
- package/dist/connection/pages/DocumentBlocks.js.map +2 -2
- package/dist/connection/pages/EditablePageGrid.js +44 -13
- package/dist/connection/pages/EditablePageGrid.js.map +2 -2
- package/dist/connection/storage/ConnectedWorkspaceTrash.d.ts +5 -4
- package/dist/connection/storage/ConnectedWorkspaceTrash.js +1 -1
- package/dist/connection/storage/ConnectedWorkspaceTrash.js.map +2 -2
- package/dist/embed/index.cjs +12 -12
- package/dist/facts/index.cjs +43 -43
- package/dist/files/FilesPage.d.ts +4 -1
- package/dist/files/FilesPage.js +1 -1
- package/dist/files/FilesPage.js.map +2 -2
- package/dist/files/SelectionBar.js +1 -1
- package/dist/files/SelectionBar.js.map +2 -2
- package/dist/files/index.cjs +229 -229
- package/dist/index.cjs +220 -220
- package/dist/pages/index.cjs +53 -28
- package/dist/pages/index.cjs.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/workflow-canvas/index.cjs +23 -23
- package/node_modules/@arbidocs/coedit/package.json +1 -1
- package/package.json +5 -5
- package/src/blocks.css +18 -0
- package/dist/chunk-JCFXS336.cjs.map +0 -1
package/dist/facts/index.cjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var chunkYHXJWYOF_cjs = require('../chunk-YHXJWYOF.cjs');
|
|
5
5
|
var chunkTJY7XPDE_cjs = require('../chunk-TJY7XPDE.cjs');
|
|
6
6
|
var chunkDDWLMYRO_cjs = require('../chunk-DDWLMYRO.cjs');
|
|
7
7
|
require('../chunk-SNUBQMIS.cjs');
|
|
8
8
|
require('../chunk-6XKQAQWF.cjs');
|
|
9
9
|
require('../chunk-ADMNU2CR.cjs');
|
|
10
10
|
var chunkRC25WMVB_cjs = require('../chunk-RC25WMVB.cjs');
|
|
11
|
-
require('../chunk-
|
|
11
|
+
require('../chunk-S3GVFAFB.cjs');
|
|
12
12
|
require('../chunk-6UZC4XVV.cjs');
|
|
13
13
|
require('../chunk-QUMUAJ2P.cjs');
|
|
14
14
|
require('../chunk-SJSGSHIT.cjs');
|
|
@@ -42,167 +42,167 @@ function toFactRows(records) {
|
|
|
42
42
|
|
|
43
43
|
Object.defineProperty(exports, "DEFAULT_FACTS_BULK_BAR_LABELS", {
|
|
44
44
|
enumerable: true,
|
|
45
|
-
get: function () { return
|
|
45
|
+
get: function () { return chunkYHXJWYOF_cjs.DEFAULT_FACTS_BULK_BAR_LABELS; }
|
|
46
46
|
});
|
|
47
47
|
Object.defineProperty(exports, "DEFAULT_FACTS_EMPTY_STATE_LABELS", {
|
|
48
48
|
enumerable: true,
|
|
49
|
-
get: function () { return
|
|
49
|
+
get: function () { return chunkYHXJWYOF_cjs.DEFAULT_FACTS_EMPTY_STATE_LABELS; }
|
|
50
50
|
});
|
|
51
51
|
Object.defineProperty(exports, "DEFAULT_FACTS_FIELDS_BUTTON_LABELS", {
|
|
52
52
|
enumerable: true,
|
|
53
|
-
get: function () { return
|
|
53
|
+
get: function () { return chunkYHXJWYOF_cjs.DEFAULT_FACTS_FIELDS_BUTTON_LABELS; }
|
|
54
54
|
});
|
|
55
55
|
Object.defineProperty(exports, "DEFAULT_FACTS_TOOLBAR_LABELS", {
|
|
56
56
|
enumerable: true,
|
|
57
|
-
get: function () { return
|
|
57
|
+
get: function () { return chunkYHXJWYOF_cjs.DEFAULT_FACTS_TOOLBAR_LABELS; }
|
|
58
58
|
});
|
|
59
59
|
Object.defineProperty(exports, "DEFAULT_FACTS_VIEW_TOGGLE_LABELS", {
|
|
60
60
|
enumerable: true,
|
|
61
|
-
get: function () { return
|
|
61
|
+
get: function () { return chunkYHXJWYOF_cjs.DEFAULT_FACTS_VIEW_TOGGLE_LABELS; }
|
|
62
62
|
});
|
|
63
63
|
Object.defineProperty(exports, "DEFAULT_FACT_COLUMN_LABELS", {
|
|
64
64
|
enumerable: true,
|
|
65
|
-
get: function () { return
|
|
65
|
+
get: function () { return chunkYHXJWYOF_cjs.DEFAULT_FACT_COLUMN_LABELS; }
|
|
66
66
|
});
|
|
67
67
|
Object.defineProperty(exports, "DEFAULT_FACT_COLUMN_ORDER", {
|
|
68
68
|
enumerable: true,
|
|
69
|
-
get: function () { return
|
|
69
|
+
get: function () { return chunkYHXJWYOF_cjs.DEFAULT_FACT_COLUMN_ORDER; }
|
|
70
70
|
});
|
|
71
71
|
Object.defineProperty(exports, "DEFAULT_FACT_COMPOSER_LABELS", {
|
|
72
72
|
enumerable: true,
|
|
73
|
-
get: function () { return
|
|
73
|
+
get: function () { return chunkYHXJWYOF_cjs.DEFAULT_FACT_COMPOSER_LABELS; }
|
|
74
74
|
});
|
|
75
75
|
Object.defineProperty(exports, "DEFAULT_FACT_DATE_INPUT_LABELS", {
|
|
76
76
|
enumerable: true,
|
|
77
|
-
get: function () { return
|
|
77
|
+
get: function () { return chunkYHXJWYOF_cjs.DEFAULT_FACT_DATE_INPUT_LABELS; }
|
|
78
78
|
});
|
|
79
79
|
Object.defineProperty(exports, "DEFAULT_FACT_LABELS_CELL_LABELS", {
|
|
80
80
|
enumerable: true,
|
|
81
|
-
get: function () { return
|
|
81
|
+
get: function () { return chunkYHXJWYOF_cjs.DEFAULT_FACT_LABELS_CELL_LABELS; }
|
|
82
82
|
});
|
|
83
83
|
Object.defineProperty(exports, "DEFAULT_FACT_ROW_ACTIONS_LABELS", {
|
|
84
84
|
enumerable: true,
|
|
85
|
-
get: function () { return
|
|
85
|
+
get: function () { return chunkYHXJWYOF_cjs.DEFAULT_FACT_ROW_ACTIONS_LABELS; }
|
|
86
86
|
});
|
|
87
87
|
Object.defineProperty(exports, "DEFAULT_FACT_SEARCH_BAR_LABELS", {
|
|
88
88
|
enumerable: true,
|
|
89
|
-
get: function () { return
|
|
89
|
+
get: function () { return chunkYHXJWYOF_cjs.DEFAULT_FACT_SEARCH_BAR_LABELS; }
|
|
90
90
|
});
|
|
91
91
|
Object.defineProperty(exports, "DEFAULT_FACT_SEARCH_RESULT_LABELS", {
|
|
92
92
|
enumerable: true,
|
|
93
|
-
get: function () { return
|
|
93
|
+
get: function () { return chunkYHXJWYOF_cjs.DEFAULT_FACT_SEARCH_RESULT_LABELS; }
|
|
94
94
|
});
|
|
95
95
|
Object.defineProperty(exports, "DEFAULT_FACT_SOURCES_ROW_LABELS", {
|
|
96
96
|
enumerable: true,
|
|
97
|
-
get: function () { return
|
|
97
|
+
get: function () { return chunkYHXJWYOF_cjs.DEFAULT_FACT_SOURCES_ROW_LABELS; }
|
|
98
98
|
});
|
|
99
99
|
Object.defineProperty(exports, "DEFAULT_FACT_SOURCE_GROUP_LABELS", {
|
|
100
100
|
enumerable: true,
|
|
101
|
-
get: function () { return
|
|
101
|
+
get: function () { return chunkYHXJWYOF_cjs.DEFAULT_FACT_SOURCE_GROUP_LABELS; }
|
|
102
102
|
});
|
|
103
103
|
Object.defineProperty(exports, "DEFAULT_FACT_TIMELINE_LABELS", {
|
|
104
104
|
enumerable: true,
|
|
105
|
-
get: function () { return
|
|
105
|
+
get: function () { return chunkYHXJWYOF_cjs.DEFAULT_FACT_TIMELINE_LABELS; }
|
|
106
106
|
});
|
|
107
107
|
Object.defineProperty(exports, "FactComposer", {
|
|
108
108
|
enumerable: true,
|
|
109
|
-
get: function () { return
|
|
109
|
+
get: function () { return chunkYHXJWYOF_cjs.FactComposer; }
|
|
110
110
|
});
|
|
111
111
|
Object.defineProperty(exports, "FactDateInput", {
|
|
112
112
|
enumerable: true,
|
|
113
|
-
get: function () { return
|
|
113
|
+
get: function () { return chunkYHXJWYOF_cjs.FactDateInput; }
|
|
114
114
|
});
|
|
115
115
|
Object.defineProperty(exports, "FactFieldRow", {
|
|
116
116
|
enumerable: true,
|
|
117
|
-
get: function () { return
|
|
117
|
+
get: function () { return chunkYHXJWYOF_cjs.FactFieldRow; }
|
|
118
118
|
});
|
|
119
119
|
Object.defineProperty(exports, "FactLabelsCell", {
|
|
120
120
|
enumerable: true,
|
|
121
|
-
get: function () { return
|
|
121
|
+
get: function () { return chunkYHXJWYOF_cjs.FactLabelsCell; }
|
|
122
122
|
});
|
|
123
123
|
Object.defineProperty(exports, "FactRowActions", {
|
|
124
124
|
enumerable: true,
|
|
125
|
-
get: function () { return
|
|
125
|
+
get: function () { return chunkYHXJWYOF_cjs.FactRowActions; }
|
|
126
126
|
});
|
|
127
127
|
Object.defineProperty(exports, "FactSearchBar", {
|
|
128
128
|
enumerable: true,
|
|
129
|
-
get: function () { return
|
|
129
|
+
get: function () { return chunkYHXJWYOF_cjs.FactSearchBar; }
|
|
130
130
|
});
|
|
131
131
|
Object.defineProperty(exports, "FactSearchNoMatches", {
|
|
132
132
|
enumerable: true,
|
|
133
|
-
get: function () { return
|
|
133
|
+
get: function () { return chunkYHXJWYOF_cjs.FactSearchNoMatches; }
|
|
134
134
|
});
|
|
135
135
|
Object.defineProperty(exports, "FactSearchPending", {
|
|
136
136
|
enumerable: true,
|
|
137
|
-
get: function () { return
|
|
137
|
+
get: function () { return chunkYHXJWYOF_cjs.FactSearchPending; }
|
|
138
138
|
});
|
|
139
139
|
Object.defineProperty(exports, "FactSearchResult", {
|
|
140
140
|
enumerable: true,
|
|
141
|
-
get: function () { return
|
|
141
|
+
get: function () { return chunkYHXJWYOF_cjs.FactSearchResult; }
|
|
142
142
|
});
|
|
143
143
|
Object.defineProperty(exports, "FactSearchTotals", {
|
|
144
144
|
enumerable: true,
|
|
145
|
-
get: function () { return
|
|
145
|
+
get: function () { return chunkYHXJWYOF_cjs.FactSearchTotals; }
|
|
146
146
|
});
|
|
147
147
|
Object.defineProperty(exports, "FactSourceGroup", {
|
|
148
148
|
enumerable: true,
|
|
149
|
-
get: function () { return
|
|
149
|
+
get: function () { return chunkYHXJWYOF_cjs.FactSourceGroup; }
|
|
150
150
|
});
|
|
151
151
|
Object.defineProperty(exports, "FactSourcesRow", {
|
|
152
152
|
enumerable: true,
|
|
153
|
-
get: function () { return
|
|
153
|
+
get: function () { return chunkYHXJWYOF_cjs.FactSourcesRow; }
|
|
154
154
|
});
|
|
155
155
|
Object.defineProperty(exports, "FactsBulkBar", {
|
|
156
156
|
enumerable: true,
|
|
157
|
-
get: function () { return
|
|
157
|
+
get: function () { return chunkYHXJWYOF_cjs.FactsBulkBar; }
|
|
158
158
|
});
|
|
159
159
|
Object.defineProperty(exports, "FactsCalendar", {
|
|
160
160
|
enumerable: true,
|
|
161
|
-
get: function () { return
|
|
161
|
+
get: function () { return chunkYHXJWYOF_cjs.FactsCalendar; }
|
|
162
162
|
});
|
|
163
163
|
Object.defineProperty(exports, "FactsEmptyState", {
|
|
164
164
|
enumerable: true,
|
|
165
|
-
get: function () { return
|
|
165
|
+
get: function () { return chunkYHXJWYOF_cjs.FactsEmptyState; }
|
|
166
166
|
});
|
|
167
167
|
Object.defineProperty(exports, "FactsFieldsButton", {
|
|
168
168
|
enumerable: true,
|
|
169
|
-
get: function () { return
|
|
169
|
+
get: function () { return chunkYHXJWYOF_cjs.FactsFieldsButton; }
|
|
170
170
|
});
|
|
171
171
|
Object.defineProperty(exports, "FactsGanttPane", {
|
|
172
172
|
enumerable: true,
|
|
173
|
-
get: function () { return
|
|
173
|
+
get: function () { return chunkYHXJWYOF_cjs.FactsGanttPane; }
|
|
174
174
|
});
|
|
175
175
|
Object.defineProperty(exports, "FactsLoadError", {
|
|
176
176
|
enumerable: true,
|
|
177
|
-
get: function () { return
|
|
177
|
+
get: function () { return chunkYHXJWYOF_cjs.FactsLoadError; }
|
|
178
178
|
});
|
|
179
179
|
Object.defineProperty(exports, "FactsLoading", {
|
|
180
180
|
enumerable: true,
|
|
181
|
-
get: function () { return
|
|
181
|
+
get: function () { return chunkYHXJWYOF_cjs.FactsLoading; }
|
|
182
182
|
});
|
|
183
183
|
Object.defineProperty(exports, "FactsToolbar", {
|
|
184
184
|
enumerable: true,
|
|
185
|
-
get: function () { return
|
|
185
|
+
get: function () { return chunkYHXJWYOF_cjs.FactsToolbar; }
|
|
186
186
|
});
|
|
187
187
|
Object.defineProperty(exports, "FactsViewToggle", {
|
|
188
188
|
enumerable: true,
|
|
189
|
-
get: function () { return
|
|
189
|
+
get: function () { return chunkYHXJWYOF_cjs.FactsViewToggle; }
|
|
190
190
|
});
|
|
191
191
|
Object.defineProperty(exports, "ISO_DATE_FILTER_PARAMS", {
|
|
192
192
|
enumerable: true,
|
|
193
|
-
get: function () { return
|
|
193
|
+
get: function () { return chunkYHXJWYOF_cjs.ISO_DATE_FILTER_PARAMS; }
|
|
194
194
|
});
|
|
195
195
|
Object.defineProperty(exports, "createFactColumns", {
|
|
196
196
|
enumerable: true,
|
|
197
|
-
get: function () { return
|
|
197
|
+
get: function () { return chunkYHXJWYOF_cjs.createFactColumns; }
|
|
198
198
|
});
|
|
199
199
|
Object.defineProperty(exports, "enableFactTableColumnResize", {
|
|
200
200
|
enumerable: true,
|
|
201
|
-
get: function () { return
|
|
201
|
+
get: function () { return chunkYHXJWYOF_cjs.enableFactTableColumnResize; }
|
|
202
202
|
});
|
|
203
203
|
Object.defineProperty(exports, "sourceDocCount", {
|
|
204
204
|
enumerable: true,
|
|
205
|
-
get: function () { return
|
|
205
|
+
get: function () { return chunkYHXJWYOF_cjs.sourceDocCount; }
|
|
206
206
|
});
|
|
207
207
|
Object.defineProperty(exports, "EMPTY_FACT_DATE_FIELDS", {
|
|
208
208
|
enumerable: true,
|
|
@@ -8,7 +8,10 @@ export interface FilesPageProps extends ComponentProps<'div'> {
|
|
|
8
8
|
/**
|
|
9
9
|
* Files page column. `h-full` fills the bounded page scroll zone (not 100vh), so when a tip bar
|
|
10
10
|
* shrinks the shell this column shrinks with it and the sticky selection bar stays pinned to the
|
|
11
|
-
* visible bottom.
|
|
11
|
+
* visible bottom. In a modal the column keeps its own height and the modal's body scrolls it: it
|
|
12
|
+
* must not clip (no `overflow-hidden`), or its sticky footer and selection bar would stick to the
|
|
13
|
+
* column instead of the body, and on a short screen (a phone held sideways) they sat below the
|
|
14
|
+
* dialog's edge, out of reach.
|
|
12
15
|
*/
|
|
13
16
|
export declare function FilesPage({ isModal, testId, className, ...props }: FilesPageProps): import("react").JSX.Element;
|
|
14
17
|
/**
|
package/dist/files/FilesPage.js
CHANGED
|
@@ -7,7 +7,7 @@ function FilesPage({ isModal, testId, className, ...props }) {
|
|
|
7
7
|
"div",
|
|
8
8
|
{
|
|
9
9
|
"data-slot": "files-page",
|
|
10
|
-
className: cn("flex flex-col", isModal
|
|
10
|
+
className: cn("flex flex-col", !isModal && "h-full min-h-0", className),
|
|
11
11
|
...props,
|
|
12
12
|
"data-testid": testIdOr(testId, { testId: "documents-page" })
|
|
13
13
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/files/FilesPage.tsx"],
|
|
4
|
-
"sourcesContent": ["import type { ComponentProps } from 'react'\nimport { cn } from '@arbidocs/react/ui'\nimport { testIdOr } from '../chat/test-id'\n\nexport interface FilesPageProps extends ComponentProps<'div'> {\n /** Inside a modal the page keeps its own height instead of filling the page scroll zone. */\n isModal?: boolean\n /** Overrides the root test id (default `documents-page`). */\n testId?: string\n}\n\n/**\n * Files page column. `h-full` fills the bounded page scroll zone (not 100vh), so when a tip bar\n * shrinks the shell this column shrinks with it and the sticky selection bar stays pinned to the\n * visible bottom.\n */\nexport function FilesPage({ isModal, testId, className, ...props }: FilesPageProps) {\n return (\n <div\n data-slot=\"files-page\"\n className={cn('flex flex-col', isModal
|
|
5
|
-
"mappings": ";
|
|
4
|
+
"sourcesContent": ["import type { ComponentProps } from 'react'\nimport { cn } from '@arbidocs/react/ui'\nimport { testIdOr } from '../chat/test-id'\n\nexport interface FilesPageProps extends ComponentProps<'div'> {\n /** Inside a modal the page keeps its own height instead of filling the page scroll zone. */\n isModal?: boolean\n /** Overrides the root test id (default `documents-page`). */\n testId?: string\n}\n\n/**\n * Files page column. `h-full` fills the bounded page scroll zone (not 100vh), so when a tip bar\n * shrinks the shell this column shrinks with it and the sticky selection bar stays pinned to the\n * visible bottom. In a modal the column keeps its own height and the modal's body scrolls it: it\n * must not clip (no `overflow-hidden`), or its sticky footer and selection bar would stick to the\n * column instead of the body, and on a short screen (a phone held sideways) they sat below the\n * dialog's edge, out of reach.\n */\nexport function FilesPage({ isModal, testId, className, ...props }: FilesPageProps) {\n return (\n <div\n data-slot=\"files-page\"\n className={cn('flex flex-col', !isModal && 'h-full min-h-0', className)}\n {...props}\n data-testid={testIdOr(testId, { testId: 'documents-page' })}\n />\n )\n}\n\n/**\n * Sticky region on top: the title row (title, view switch, Add) and the calm filter row. 16px\n * gutters are owned by the shared TabHeader and the content toolbar.\n */\nexport function FilesPageHeader({ className, ...props }: ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"files-page-header\"\n className={cn('sticky top-0 z-10 flex flex-col bg-background', className)}\n {...props}\n />\n )\n}\n\n/** The scrolling content area (grid, gallery, review, smart search). */\nexport function FilesPageMain({ className, ...props }: ComponentProps<'main'>) {\n return (\n <main\n data-slot=\"files-page-main\"\n className={cn('min-h-0 flex-1 overflow-hidden bg-background px-4 sm:px-6', className)}\n {...props}\n />\n )\n}\n"],
|
|
5
|
+
"mappings": ";AAqBI;AApBJ,SAAS,UAAU;AACnB,SAAS,gBAAgB;AAiBlB,SAAS,UAAU,EAAE,SAAS,QAAQ,WAAW,GAAG,MAAM,GAAmB;AAClF,SACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAW,GAAG,iBAAiB,CAAC,WAAW,kBAAkB,SAAS;AAAA,MACrE,GAAG;AAAA,MACJ,eAAa,SAAS,QAAQ,EAAE,QAAQ,iBAAiB,CAAC;AAAA;AAAA,EAC5D;AAEJ;AAMO,SAAS,gBAAgB,EAAE,WAAW,GAAG,MAAM,GAA0B;AAC9E,SACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAW,GAAG,iDAAiD,SAAS;AAAA,MACvE,GAAG;AAAA;AAAA,EACN;AAEJ;AAGO,SAAS,cAAc,EAAE,WAAW,GAAG,MAAM,GAA2B;AAC7E,SACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAW,GAAG,6DAA6D,SAAS;AAAA,MACnF,GAAG;AAAA;AAAA,EACN;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -137,7 +137,7 @@ function SelectionBarInner({
|
|
|
137
137
|
"div",
|
|
138
138
|
{
|
|
139
139
|
ref: actionsRef,
|
|
140
|
-
className: "flex min-w-0 flex-1 items-center gap-2 overflow-x-auto overscroll-x-contain [scrollbar-width:none]",
|
|
140
|
+
className: "flex min-w-0 flex-1 items-center gap-2 overflow-x-auto overscroll-x-contain [scrollbar-width:none] pointer-coarse:min-h-11",
|
|
141
141
|
children: [
|
|
142
142
|
status && /* @__PURE__ */ jsx("div", { className: "flex shrink-0 items-center gap-2", children: status }),
|
|
143
143
|
/* @__PURE__ */ jsxs(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/files/SelectionBar.tsx"],
|
|
4
|
-
"sourcesContent": ["import { useLayoutEffect, useRef, useState } from 'react'\nimport type { ReactNode } from 'react'\nimport type { LucideIcon } from 'lucide-react'\nimport { BookOpen, X } from 'lucide-react'\nimport { Button, Tooltip, TooltipContent, TooltipTrigger, cn } from '@arbidocs/react/ui'\nimport { testIdOr } from '../chat/test-id'\nimport { observeResize } from '../lib/observe-resize'\n\nexport interface SelectionBarActionItem {\n id: string\n icon: LucideIcon\n label: string\n onClick: () => void\n disabled?: boolean\n variant?: 'default' | 'outline' | 'destructive' | 'ghost' | 'secondary'\n /** Tooltip text; falls back to `label`. */\n tooltip?: string\n testId?: string\n className?: string\n}\n\n/** Container width below which the bar is \"narrow\" (phones): only the essentials stay inline. */\nconst NARROW_BELOW_PX = 480\n\n/** Every fixed string of the selection bar. Pass a partial `labels` to translate or reword. */\nexport interface SelectionBarLabels {\n selected: string\n clearSelection: string\n review: string\n selectionActions: string\n}\n\nexport const DEFAULT_SELECTION_BAR_LABELS: SelectionBarLabels = {\n selected: 'selected',\n clearSelection: 'Clear selection',\n review: 'Review',\n selectionActions: 'Selection actions',\n}\n\nexport interface SelectionBarTestIds {\n toolbar: string\n count: string\n clear: string\n review: string\n}\n\nexport interface SelectionBarProps {\n /** Number of selected rows. The bar renders only while this is > 0 (or `status` is set). */\n count: number\n onClear: () => void\n /** Primary-in-bar \"Review\" shortcut (tonal, not the view's filled primary). */\n onReview?: () => void\n /** Actions as data. Rendered icon-only automatically when the bar is narrow. */\n actions?: SelectionBarActionItem[]\n /**\n * Free-form actions; a function receives `isCompact` (icon-only) and `isNarrow` (a phone-width\n * container: fold secondary actions into an overflow menu). Rendered after `actions`.\n */\n children?: ReactNode | ((isCompact: boolean, isNarrow: boolean) => ReactNode)\n /** Always-legible content before the actions (e.g. a running budget); never dimmed. */\n status?: ReactNode\n /** Singular noun shown after the count; wins over `labels.selected`. */\n selectedLabel?: string\n labels?: Partial<SelectionBarLabels>\n /** Overrides for the control test ids (defaults keep the current ids). */\n testIds?: Partial<SelectionBarTestIds>\n className?: string\n}\n\n/**\n * SelectionBar: the floating bar that appears while rows are selected.\n *\n * Stays on ONE row: when the actions overflow it flips to compact mode (icon-only actions and a\n * count-only badge) instead of wrapping. Sticky zero-height anchor, so showing/hiding it never\n * reflows the content beneath. Every control is always visible (nothing hover-only) and 44px on\n * coarse pointers.\n */\nexport function SelectionBar(props: SelectionBarProps) {\n if (props.count === 0 && !props.status) return null\n return <SelectionBarInner {...props} />\n}\n\nfunction SelectionBarInner({\n count,\n onClear,\n onReview,\n actions,\n children,\n status,\n selectedLabel,\n labels,\n testIds,\n className,\n}: SelectionBarProps) {\n const l = { ...DEFAULT_SELECTION_BAR_LABELS, ...labels }\n const hasSelection = count > 0\n const rootRef = useRef<HTMLDivElement>(null)\n const actionsRef = useRef<HTMLDivElement>(null)\n const [isCompact, setIsCompact] = useState(false)\n const [isNarrow, setIsNarrow] = useState(false)\n // Root width at which the labelled actions last overflowed. Compared against the (stable) root\n // width, never the actions' own width, which changes when we collapse labels and would oscillate.\n const overflowRootWidthRef = useRef(Number.POSITIVE_INFINITY)\n\n const measureRef = useRef<() => void>(() => {})\n measureRef.current = () => {\n const root = rootRef.current\n const el = actionsRef.current\n if (!root || !el) return\n // The bar is content-sized, so judge narrowness by the space it is given (its anchor).\n const available = root.parentElement?.clientWidth ?? 0\n setIsNarrow(available > 0 && available < NARROW_BELOW_PX)\n if (!isCompact) {\n if (el.scrollWidth > el.clientWidth + 1) {\n overflowRootWidthRef.current = root.clientWidth\n setIsCompact(true)\n }\n } else if (root.clientWidth > overflowRootWidthRef.current + 64) {\n setIsCompact(false)\n }\n }\n\n useLayoutEffect(() => {\n measureRef.current()\n const root = rootRef.current\n if (!root) return\n return observeResize(root, () => measureRef.current())\n }, [])\n // The bar is capped by its anchor, so its own size does not change when the actions overflow, and\n // the actions' text widens once the web font loads. Re-measure after every render and whenever\n // an action changes size. The measurement only sets state on a change, so this cannot loop.\n useLayoutEffect(() => {\n measureRef.current()\n const inner = actionsRef.current\n if (!inner || typeof ResizeObserver === 'undefined') return\n const observer = new ResizeObserver(() => measureRef.current())\n inner.querySelectorAll('button').forEach((button) => observer.observe(button))\n return () => observer.disconnect()\n })\n useLayoutEffect(() => {\n let isCancelled = false\n void document.fonts?.ready.then(() => {\n if (!isCancelled) measureRef.current()\n })\n return () => {\n isCancelled = true\n }\n }, [])\n\n return (\n <div\n data-slot=\"selection-bar\"\n className={cn('pointer-events-none sticky bottom-0 z-30 h-0', className)}\n >\n <div className=\"absolute inset-x-0 bottom-4 flex justify-center px-3\">\n <div\n ref={rootRef}\n role=\"toolbar\"\n aria-label={l.selectionActions}\n data-testid={testIdOr(testIds?.toolbar, { testId: 'bulk-actions-toolbar' })}\n data-narrow={isNarrow || undefined}\n className=\"pointer-events-auto flex min-h-12 max-w-full items-center rounded-lg border border-border bg-popover px-2 py-1.5 shadow-xl\"\n >\n <div className=\"flex min-w-0 flex-1 items-center gap-2 px-1\">\n <div\n data-testid={testIdOr(testIds?.count, { testId: 'bulk-selected-count' })}\n aria-live=\"polite\"\n className={cn(\n 'flex shrink-0 items-center rounded-full bg-accent text-sm font-semibold tabular-nums text-accent-foreground',\n isCompact ? 'gap-1 px-2.5 py-1' : 'gap-2 px-3 py-1'\n )}\n >\n <span>\n {count}\n {!isCompact && ` ${selectedLabel ?? l.selected}`}\n </span>\n {hasSelection && (\n <button\n type=\"button\"\n onClick={onClear}\n aria-label={l.clearSelection}\n data-testid={testIdOr(testIds?.clear, { testId: 'bulk-clear-selection-button' })}\n className=\"rounded-full p-0.5 transition-colors hover:bg-foreground/10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring pointer-coarse:p-[15px]\"\n >\n <X className=\"size-3.5\" />\n </button>\n )}\n </div>\n\n {onReview && (\n <button\n type=\"button\"\n onClick={onReview}\n aria-label={isNarrow ? l.review : undefined}\n data-testid={testIdOr(testIds?.review, { testId: 'bulk-review-button' })}\n className=\"flex h-8 shrink-0 items-center gap-1.5 rounded-md bg-accent px-2.5 text-sm font-medium text-accent-foreground transition-colors hover:bg-accent/70 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring pointer-coarse:h-11\"\n >\n <BookOpen className=\"size-3.5\" />\n {!isNarrow && l.review}\n </button>\n )}\n\n <div className=\"h-6 w-px shrink-0 bg-border\" />\n\n <div\n ref={actionsRef}\n className=\"flex min-w-0 flex-1 items-center gap-2 overflow-x-auto overscroll-x-contain [scrollbar-width:none]\"\n >\n {status && <div className=\"flex shrink-0 items-center gap-2\">{status}</div>}\n <div\n className={cn(\n 'flex min-w-0 items-center gap-2',\n !hasSelection && 'pointer-events-none opacity-40'\n )}\n >\n {actions?.map((a) => (\n <SelectionBarAction key={a.id} {...a} isCompact={isCompact} />\n ))}\n {typeof children === 'function' ? children(isCompact, isNarrow) : children}\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n )\n}\n\nexport interface SelectionBarActionProps extends Omit<SelectionBarActionItem, 'id'> {\n /** Icon-only (the bar passes this when narrow). */\n isCompact?: boolean\n}\n\n/** One action button in the bar: icon + label, icon-only when compact, always with a tooltip. */\nexport function SelectionBarAction({\n icon: Icon,\n label,\n onClick,\n disabled = false,\n variant = 'ghost',\n tooltip,\n testId,\n className,\n isCompact = false,\n}: SelectionBarActionProps) {\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n variant={variant}\n size=\"sm\"\n onClick={onClick}\n disabled={disabled}\n aria-label={isCompact ? label : undefined}\n data-testid={testId}\n className={cn(\n 'h-8 shrink-0 gap-1.5 whitespace-nowrap px-2 disabled:opacity-50 pointer-coarse:h-11',\n className\n )}\n >\n <Icon className=\"size-4\" />\n {!isCompact && <span className=\"text-sm\">{label}</span>}\n </Button>\n </TooltipTrigger>\n <TooltipContent>\n <p>{tooltip ?? label}</p>\n </TooltipContent>\n </Tooltip>\n )\n}\n"],
|
|
5
|
-
"mappings": ";AA+ES,cA6FK,YA7FL;AA/ET,SAAS,iBAAiB,QAAQ,gBAAgB;AAGlD,SAAS,UAAU,SAAS;AAC5B,SAAS,QAAQ,SAAS,gBAAgB,gBAAgB,UAAU;AACpE,SAAS,gBAAgB;AACzB,SAAS,qBAAqB;AAgB9B,MAAM,kBAAkB;AAUjB,MAAM,+BAAmD;AAAA,EAC9D,UAAU;AAAA,EACV,gBAAgB;AAAA,EAChB,QAAQ;AAAA,EACR,kBAAkB;AACpB;AAwCO,SAAS,aAAa,OAA0B;AACrD,MAAI,MAAM,UAAU,KAAK,CAAC,MAAM,OAAQ,QAAO;AAC/C,SAAO,oBAAC,qBAAmB,GAAG,OAAO;AACvC;AAEA,SAAS,kBAAkB;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAsB;AACpB,QAAM,IAAI,EAAE,GAAG,8BAA8B,GAAG,OAAO;AACvD,QAAM,eAAe,QAAQ;AAC7B,QAAM,UAAU,OAAuB,IAAI;AAC3C,QAAM,aAAa,OAAuB,IAAI;AAC9C,QAAM,CAAC,WAAW,YAAY,IAAI,SAAS,KAAK;AAChD,QAAM,CAAC,UAAU,WAAW,IAAI,SAAS,KAAK;AAG9C,QAAM,uBAAuB,OAAO,OAAO,iBAAiB;AAE5D,QAAM,aAAa,OAAmB,MAAM;AAAA,EAAC,CAAC;AAC9C,aAAW,UAAU,MAAM;AACzB,UAAM,OAAO,QAAQ;AACrB,UAAM,KAAK,WAAW;AACtB,QAAI,CAAC,QAAQ,CAAC,GAAI;AAElB,UAAM,YAAY,KAAK,eAA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A,UAEV,+BAAC,SAAI,WAAU,+CACb;AAAA;AAAA,cAAC;AAAA;AAAA,gBACC,eAAa,SAAS,SAAS,OAAO,EAAE,QAAQ,sBAAsB,CAAC;AAAA,gBACvE,aAAU;AAAA,gBACV,WAAW;AAAA,kBACT;AAAA,kBACA,YAAY,sBAAsB;AAAA,gBACpC;AAAA,gBAEA;AAAA,uCAAC,UACE;AAAA;AAAA,oBACA,CAAC,aAAa,IAAI,iBAAiB,EAAE,QAAQ;AAAA,qBAChD;AAAA,kBACC,gBACC;AAAA,oBAAC;AAAA;AAAA,sBACC,MAAK;AAAA,sBACL,SAAS;AAAA,sBACT,cAAY,EAAE;AAAA,sBACd,eAAa,SAAS,SAAS,OAAO,EAAE,QAAQ,8BAA8B,CAAC;AAAA,sBAC/E,WAAU;AAAA,sBAEV,8BAAC,KAAE,WAAU,YAAW;AAAA;AAAA,kBAC1B;AAAA;AAAA;AAAA,YAEJ;AAAA,YAEC,YACC;AAAA,cAAC;AAAA;AAAA,gBACC,MAAK;AAAA,gBACL,SAAS;AAAA,gBACT,cAAY,WAAW,EAAE,SAAS;AAAA,gBAClC,eAAa,SAAS,SAAS,QAAQ,EAAE,QAAQ,qBAAqB,CAAC;AAAA,gBACvE,WAAU;AAAA,gBAEV;AAAA,sCAAC,YAAS,WAAU,YAAW;AAAA,kBAC9B,CAAC,YAAY,EAAE;AAAA;AAAA;AAAA,YAClB;AAAA,YAGF,oBAAC,SAAI,WAAU,+BAA8B;AAAA,
|
|
4
|
+
"sourcesContent": ["import { useLayoutEffect, useRef, useState } from 'react'\nimport type { ReactNode } from 'react'\nimport type { LucideIcon } from 'lucide-react'\nimport { BookOpen, X } from 'lucide-react'\nimport { Button, Tooltip, TooltipContent, TooltipTrigger, cn } from '@arbidocs/react/ui'\nimport { testIdOr } from '../chat/test-id'\nimport { observeResize } from '../lib/observe-resize'\n\nexport interface SelectionBarActionItem {\n id: string\n icon: LucideIcon\n label: string\n onClick: () => void\n disabled?: boolean\n variant?: 'default' | 'outline' | 'destructive' | 'ghost' | 'secondary'\n /** Tooltip text; falls back to `label`. */\n tooltip?: string\n testId?: string\n className?: string\n}\n\n/** Container width below which the bar is \"narrow\" (phones): only the essentials stay inline. */\nconst NARROW_BELOW_PX = 480\n\n/** Every fixed string of the selection bar. Pass a partial `labels` to translate or reword. */\nexport interface SelectionBarLabels {\n selected: string\n clearSelection: string\n review: string\n selectionActions: string\n}\n\nexport const DEFAULT_SELECTION_BAR_LABELS: SelectionBarLabels = {\n selected: 'selected',\n clearSelection: 'Clear selection',\n review: 'Review',\n selectionActions: 'Selection actions',\n}\n\nexport interface SelectionBarTestIds {\n toolbar: string\n count: string\n clear: string\n review: string\n}\n\nexport interface SelectionBarProps {\n /** Number of selected rows. The bar renders only while this is > 0 (or `status` is set). */\n count: number\n onClear: () => void\n /** Primary-in-bar \"Review\" shortcut (tonal, not the view's filled primary). */\n onReview?: () => void\n /** Actions as data. Rendered icon-only automatically when the bar is narrow. */\n actions?: SelectionBarActionItem[]\n /**\n * Free-form actions; a function receives `isCompact` (icon-only) and `isNarrow` (a phone-width\n * container: fold secondary actions into an overflow menu). Rendered after `actions`.\n */\n children?: ReactNode | ((isCompact: boolean, isNarrow: boolean) => ReactNode)\n /** Always-legible content before the actions (e.g. a running budget); never dimmed. */\n status?: ReactNode\n /** Singular noun shown after the count; wins over `labels.selected`. */\n selectedLabel?: string\n labels?: Partial<SelectionBarLabels>\n /** Overrides for the control test ids (defaults keep the current ids). */\n testIds?: Partial<SelectionBarTestIds>\n className?: string\n}\n\n/**\n * SelectionBar: the floating bar that appears while rows are selected.\n *\n * Stays on ONE row: when the actions overflow it flips to compact mode (icon-only actions and a\n * count-only badge) instead of wrapping. Sticky zero-height anchor, so showing/hiding it never\n * reflows the content beneath. Every control is always visible (nothing hover-only) and 44px on\n * coarse pointers.\n */\nexport function SelectionBar(props: SelectionBarProps) {\n if (props.count === 0 && !props.status) return null\n return <SelectionBarInner {...props} />\n}\n\nfunction SelectionBarInner({\n count,\n onClear,\n onReview,\n actions,\n children,\n status,\n selectedLabel,\n labels,\n testIds,\n className,\n}: SelectionBarProps) {\n const l = { ...DEFAULT_SELECTION_BAR_LABELS, ...labels }\n const hasSelection = count > 0\n const rootRef = useRef<HTMLDivElement>(null)\n const actionsRef = useRef<HTMLDivElement>(null)\n const [isCompact, setIsCompact] = useState(false)\n const [isNarrow, setIsNarrow] = useState(false)\n // Root width at which the labelled actions last overflowed. Compared against the (stable) root\n // width, never the actions' own width, which changes when we collapse labels and would oscillate.\n const overflowRootWidthRef = useRef(Number.POSITIVE_INFINITY)\n\n const measureRef = useRef<() => void>(() => {})\n measureRef.current = () => {\n const root = rootRef.current\n const el = actionsRef.current\n if (!root || !el) return\n // The bar is content-sized, so judge narrowness by the space it is given (its anchor).\n const available = root.parentElement?.clientWidth ?? 0\n setIsNarrow(available > 0 && available < NARROW_BELOW_PX)\n if (!isCompact) {\n if (el.scrollWidth > el.clientWidth + 1) {\n overflowRootWidthRef.current = root.clientWidth\n setIsCompact(true)\n }\n } else if (root.clientWidth > overflowRootWidthRef.current + 64) {\n setIsCompact(false)\n }\n }\n\n useLayoutEffect(() => {\n measureRef.current()\n const root = rootRef.current\n if (!root) return\n return observeResize(root, () => measureRef.current())\n }, [])\n // The bar is capped by its anchor, so its own size does not change when the actions overflow, and\n // the actions' text widens once the web font loads. Re-measure after every render and whenever\n // an action changes size. The measurement only sets state on a change, so this cannot loop.\n useLayoutEffect(() => {\n measureRef.current()\n const inner = actionsRef.current\n if (!inner || typeof ResizeObserver === 'undefined') return\n const observer = new ResizeObserver(() => measureRef.current())\n inner.querySelectorAll('button').forEach((button) => observer.observe(button))\n return () => observer.disconnect()\n })\n useLayoutEffect(() => {\n let isCancelled = false\n void document.fonts?.ready.then(() => {\n if (!isCancelled) measureRef.current()\n })\n return () => {\n isCancelled = true\n }\n }, [])\n\n return (\n <div\n data-slot=\"selection-bar\"\n className={cn('pointer-events-none sticky bottom-0 z-30 h-0', className)}\n >\n <div className=\"absolute inset-x-0 bottom-4 flex justify-center px-3\">\n <div\n ref={rootRef}\n role=\"toolbar\"\n aria-label={l.selectionActions}\n data-testid={testIdOr(testIds?.toolbar, { testId: 'bulk-actions-toolbar' })}\n data-narrow={isNarrow || undefined}\n className=\"pointer-events-auto flex min-h-12 max-w-full items-center rounded-lg border border-border bg-popover px-2 py-1.5 shadow-xl\"\n >\n <div className=\"flex min-w-0 flex-1 items-center gap-2 px-1\">\n <div\n data-testid={testIdOr(testIds?.count, { testId: 'bulk-selected-count' })}\n aria-live=\"polite\"\n className={cn(\n 'flex shrink-0 items-center rounded-full bg-accent text-sm font-semibold tabular-nums text-accent-foreground',\n isCompact ? 'gap-1 px-2.5 py-1' : 'gap-2 px-3 py-1'\n )}\n >\n <span>\n {count}\n {!isCompact && ` ${selectedLabel ?? l.selected}`}\n </span>\n {hasSelection && (\n <button\n type=\"button\"\n onClick={onClear}\n aria-label={l.clearSelection}\n data-testid={testIdOr(testIds?.clear, { testId: 'bulk-clear-selection-button' })}\n className=\"rounded-full p-0.5 transition-colors hover:bg-foreground/10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring pointer-coarse:p-[15px]\"\n >\n <X className=\"size-3.5\" />\n </button>\n )}\n </div>\n\n {onReview && (\n <button\n type=\"button\"\n onClick={onReview}\n aria-label={isNarrow ? l.review : undefined}\n data-testid={testIdOr(testIds?.review, { testId: 'bulk-review-button' })}\n className=\"flex h-8 shrink-0 items-center gap-1.5 rounded-md bg-accent px-2.5 text-sm font-medium text-accent-foreground transition-colors hover:bg-accent/70 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring pointer-coarse:h-11\"\n >\n <BookOpen className=\"size-3.5\" />\n {!isNarrow && l.review}\n </button>\n )}\n\n <div className=\"h-6 w-px shrink-0 bg-border\" />\n\n {/* A horizontal scroller clips vertically too: on coarse pointers it is 44px tall, so the\n centred 44px touch hit areas of its pills (the sharing pill) are not cut. */}\n <div\n ref={actionsRef}\n className=\"flex min-w-0 flex-1 items-center gap-2 overflow-x-auto overscroll-x-contain [scrollbar-width:none] pointer-coarse:min-h-11\"\n >\n {status && <div className=\"flex shrink-0 items-center gap-2\">{status}</div>}\n <div\n className={cn(\n 'flex min-w-0 items-center gap-2',\n !hasSelection && 'pointer-events-none opacity-40'\n )}\n >\n {actions?.map((a) => (\n <SelectionBarAction key={a.id} {...a} isCompact={isCompact} />\n ))}\n {typeof children === 'function' ? children(isCompact, isNarrow) : children}\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n )\n}\n\nexport interface SelectionBarActionProps extends Omit<SelectionBarActionItem, 'id'> {\n /** Icon-only (the bar passes this when narrow). */\n isCompact?: boolean\n}\n\n/** One action button in the bar: icon + label, icon-only when compact, always with a tooltip. */\nexport function SelectionBarAction({\n icon: Icon,\n label,\n onClick,\n disabled = false,\n variant = 'ghost',\n tooltip,\n testId,\n className,\n isCompact = false,\n}: SelectionBarActionProps) {\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n variant={variant}\n size=\"sm\"\n onClick={onClick}\n disabled={disabled}\n aria-label={isCompact ? label : undefined}\n data-testid={testId}\n className={cn(\n 'h-8 shrink-0 gap-1.5 whitespace-nowrap px-2 disabled:opacity-50 pointer-coarse:h-11',\n className\n )}\n >\n <Icon className=\"size-4\" />\n {!isCompact && <span className=\"text-sm\">{label}</span>}\n </Button>\n </TooltipTrigger>\n <TooltipContent>\n <p>{tooltip ?? label}</p>\n </TooltipContent>\n </Tooltip>\n )\n}\n"],
|
|
5
|
+
"mappings": ";AA+ES,cA6FK,YA7FL;AA/ET,SAAS,iBAAiB,QAAQ,gBAAgB;AAGlD,SAAS,UAAU,SAAS;AAC5B,SAAS,QAAQ,SAAS,gBAAgB,gBAAgB,UAAU;AACpE,SAAS,gBAAgB;AACzB,SAAS,qBAAqB;AAgB9B,MAAM,kBAAkB;AAUjB,MAAM,+BAAmD;AAAA,EAC9D,UAAU;AAAA,EACV,gBAAgB;AAAA,EAChB,QAAQ;AAAA,EAC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