@arbidocs/blocks 0.4.84 → 0.4.86
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/MailBodyEditor-5PIQLYVY.js +217 -0
- package/dist/MailBodyEditor-5PIQLYVY.js.map +1 -0
- package/dist/MailBodyEditor-D7MGJMLH.cjs +223 -0
- package/dist/MailBodyEditor-D7MGJMLH.cjs.map +1 -0
- package/dist/agents/index.cjs +282 -281
- package/dist/agents/index.js +7 -6
- package/dist/agents/workflows/StepBarFrame.d.ts +3 -1
- package/dist/agents/workflows/WorkflowRunner.d.ts +10 -1
- package/dist/agents/workflows/run.d.ts +24 -3
- package/dist/agents/workflows/stepWindow.d.ts +4 -2
- package/dist/agents/workflows/types.d.ts +5 -0
- package/dist/agents/workflows/useWorkflowView.d.ts +16 -1
- package/dist/chat/index.cjs +1 -1
- package/dist/chat/index.js +1 -1
- package/dist/chunk-3R6XBYL7.cjs +576 -0
- package/dist/chunk-3R6XBYL7.cjs.map +1 -0
- package/dist/{chunk-CKB64Z4R.js → chunk-4XJZ6AAY.js} +6 -245
- package/dist/chunk-4XJZ6AAY.js.map +1 -0
- package/dist/{chunk-B3WCKBJ7.cjs → chunk-5YXG342J.cjs} +6 -18
- package/dist/chunk-5YXG342J.cjs.map +1 -0
- package/dist/{chunk-SB5ZKOYN.js → chunk-7C35WXYB.js} +4 -63
- package/dist/chunk-7C35WXYB.js.map +1 -0
- package/dist/chunk-7RJTEWYM.js +362 -0
- package/dist/chunk-7RJTEWYM.js.map +1 -0
- package/dist/chunk-AFSOUS5X.cjs +253 -0
- package/dist/chunk-AFSOUS5X.cjs.map +1 -0
- package/dist/{chunk-F4RUCUXF.cjs → chunk-C2HRZSAT.cjs} +2 -63
- package/dist/chunk-C2HRZSAT.cjs.map +1 -0
- package/dist/{chunk-XA5S4776.cjs → chunk-IHYVK6F7.cjs} +52 -51
- package/dist/chunk-IHYVK6F7.cjs.map +1 -0
- package/dist/{chunk-CONIA2ZA.js → chunk-KHY4PYU7.js} +246 -146
- package/dist/chunk-KHY4PYU7.js.map +1 -0
- package/dist/chunk-LGX6UFYG.js +557 -0
- package/dist/chunk-LGX6UFYG.js.map +1 -0
- package/dist/chunk-O4YPVYPO.cjs +373 -0
- package/dist/chunk-O4YPVYPO.cjs.map +1 -0
- package/dist/chunk-R26OHONI.js +250 -0
- package/dist/chunk-R26OHONI.js.map +1 -0
- package/dist/{chunk-RYYYHPFU.cjs → chunk-RZUMQM7W.cjs} +246 -146
- package/dist/chunk-RZUMQM7W.cjs.map +1 -0
- package/dist/{chunk-RX35SMPR.js → chunk-S2NFD4QV.js} +8 -7
- package/dist/chunk-S2NFD4QV.js.map +1 -0
- package/dist/{chunk-YJQVLVBJ.cjs → chunk-S5HZBXZA.cjs} +2 -243
- package/dist/chunk-S5HZBXZA.cjs.map +1 -0
- package/dist/{chunk-GJV2G4FC.js → chunk-W7NZRZ54.js} +6 -18
- package/dist/chunk-W7NZRZ54.js.map +1 -0
- package/dist/{chunk-ZQYE7J3J.cjs → chunk-WRSBM6QN.cjs} +332 -94
- package/dist/chunk-WRSBM6QN.cjs.map +1 -0
- package/dist/{chunk-RSKSXEPW.js → chunk-X23U6QEJ.js} +324 -88
- package/dist/chunk-X23U6QEJ.js.map +1 -0
- package/dist/collaboration/index.cjs +100 -49
- package/dist/collaboration/index.js +4 -1
- package/dist/collaboration/mail/MailBodyEditor.d.ts +7 -0
- package/dist/collaboration/mail/MailDeliveryList.d.ts +8 -0
- package/dist/collaboration/mail/MailDocumentPicker.d.ts +15 -0
- package/dist/collaboration/mail/MailGrid.d.ts +17 -0
- package/dist/collaboration/mail/MailMessageView.d.ts +27 -0
- package/dist/collaboration/mail/PlainMailBodyEditor.d.ts +12 -0
- package/dist/collaboration/mail/index.d.ts +6 -0
- package/dist/collaboration/mail/mailCompose.d.ts +24 -0
- package/dist/connect/index.cjs +1673 -96
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/index.d.ts +2 -1
- package/dist/connect/index.js +1634 -63
- package/dist/connect/index.js.map +1 -1
- package/dist/connection/ConnectedSettings.d.ts +1 -4
- package/dist/connection/ConnectedTagTable.d.ts +32 -0
- package/dist/connection/mail/ConnectedMailAccounts.d.ts +21 -0
- package/dist/connection/mail/ConnectedMailComposer.d.ts +40 -0
- package/dist/connection/mail/ConnectedMailSetup.d.ts +16 -0
- package/dist/connection/mail/ConnectedMailbox.d.ts +65 -0
- package/dist/connection/mail/MailComposerForm.d.ts +25 -0
- package/dist/connection/mail/attachments.d.ts +13 -0
- package/dist/connection/mail/index.d.ts +6 -0
- package/dist/connection/mail/mailbox.d.ts +6 -0
- package/dist/connection/mail/types.d.ts +92 -0
- package/dist/connection/useConnectedWorkNotifications.d.ts +6 -0
- package/dist/connection/useWorkflowThread.d.ts +7 -2
- package/dist/facts/index.cjs +3 -3
- package/dist/facts/index.js +3 -3
- package/dist/files/index.cjs +48 -368
- package/dist/files/index.cjs.map +1 -1
- package/dist/files/index.js +11 -361
- package/dist/files/index.js.map +1 -1
- package/dist/home/index.cjs +1 -1
- package/dist/home/index.js +1 -1
- package/dist/index.cjs +496 -437
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +23 -20
- package/dist/index.js.map +1 -1
- package/dist/settings/PasswordChangeDialog.d.ts +9 -12
- package/dist/settings/index.cjs +44 -43
- package/dist/settings/index.cjs.map +1 -1
- package/dist/settings/index.js +3 -2
- package/dist/settings/index.js.map +1 -1
- package/dist/shell/index.cjs +2 -2
- package/dist/shell/index.js +2 -2
- package/dist/studio/index.cjs +1 -1
- package/dist/studio/index.js +1 -1
- package/dist/tags/TagColumnsEditor.d.ts +34 -0
- package/dist/tags/TagDetail.d.ts +13 -11
- package/dist/tags/TagTable.d.ts +99 -0
- package/dist/tags/TagsNav.d.ts +2 -2
- package/dist/tags/index.d.ts +7 -5
- package/dist/tags/{tagMatrixDocx.d.ts → tagTableDocx.d.ts} +12 -12
- package/dist/tags/tagTableModel.d.ts +47 -0
- package/dist/workflow-canvas/index.cjs +50 -49
- package/dist/workflow-canvas/index.cjs.map +1 -1
- package/dist/workflow-canvas/index.js +7 -6
- package/dist/workflow-canvas/index.js.map +1 -1
- package/package.json +29 -4
- package/dist/chunk-B3WCKBJ7.cjs.map +0 -1
- package/dist/chunk-CKB64Z4R.js.map +0 -1
- package/dist/chunk-CONIA2ZA.js.map +0 -1
- package/dist/chunk-F4RUCUXF.cjs.map +0 -1
- package/dist/chunk-GJV2G4FC.js.map +0 -1
- package/dist/chunk-RSKSXEPW.js.map +0 -1
- package/dist/chunk-RX35SMPR.js.map +0 -1
- package/dist/chunk-RYYYHPFU.cjs.map +0 -1
- package/dist/chunk-SB5ZKOYN.js.map +0 -1
- package/dist/chunk-XA5S4776.cjs.map +0 -1
- package/dist/chunk-YJQVLVBJ.cjs.map +0 -1
- package/dist/chunk-ZQYE7J3J.cjs.map +0 -1
- package/dist/connection/ConnectedTagMatrix.d.ts +0 -23
- package/dist/tags/TagMatrix.d.ts +0 -87
- package/dist/tags/tagMatrixModel.d.ts +0 -43
|
@@ -1,28 +1,25 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useState, useEffect, useMemo } from 'react';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { ArrowUp, ArrowDown, X, Plus, Loader2, SlidersHorizontal, Download, FileDown, AlertTriangle, FileText, Lightbulb, MessagesSquare } from 'lucide-react';
|
|
4
|
+
import { Input, cn, Button, Checkbox } from '@arbidocs/react/ui';
|
|
5
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
6
6
|
import { zipSync, strToU8 } from 'fflate';
|
|
7
7
|
|
|
8
|
-
// src/tags/
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
var cellValue = (row, column) => row.tag.field_values?.[rowFieldId(row, column)];
|
|
25
|
-
var isGap = (row) => row.doc_count + row.fact_count + row.thread_count === 0;
|
|
8
|
+
// src/tags/tagTableModel.ts
|
|
9
|
+
var NO_LINKS = {
|
|
10
|
+
docs: [],
|
|
11
|
+
facts: [],
|
|
12
|
+
threads: [],
|
|
13
|
+
doc_count: 0,
|
|
14
|
+
fact_count: 0,
|
|
15
|
+
thread_count: 0
|
|
16
|
+
};
|
|
17
|
+
var rowLinks = (row) => row.links ?? NO_LINKS;
|
|
18
|
+
var cellValue = (row, column) => row.field_values?.[column.id];
|
|
19
|
+
var isGap = (row) => {
|
|
20
|
+
const l = rowLinks(row);
|
|
21
|
+
return l.doc_count + l.fact_count + l.thread_count === 0;
|
|
22
|
+
};
|
|
26
23
|
function cellText(value, column, nameOf) {
|
|
27
24
|
if (value === void 0 || value === null || value === "") return "";
|
|
28
25
|
if (column.type === "checkbox") return value ? "Yes" : "No";
|
|
@@ -39,9 +36,10 @@ function parseCell(text, type) {
|
|
|
39
36
|
}
|
|
40
37
|
return t;
|
|
41
38
|
}
|
|
39
|
+
var fieldWrites = (columns) => columns.map((c) => ({ id: c.id, name: c.name, type: c.type, options: c.options ?? null }));
|
|
42
40
|
var escapeCell = (text) => text.replace(/\|/g, "\\|").replace(/\n+/g, " ");
|
|
43
|
-
function
|
|
44
|
-
const columns =
|
|
41
|
+
function tagTableMarkdown(table, options) {
|
|
42
|
+
const { columns } = table;
|
|
45
43
|
const heads = [
|
|
46
44
|
options.rowHeading ?? "Item",
|
|
47
45
|
...columns.map((c) => c.name),
|
|
@@ -55,14 +53,15 @@ function tagMatrixMarkdown(matrix, options) {
|
|
|
55
53
|
`| ${heads.map(escapeCell).join(" | ")} |`,
|
|
56
54
|
`| ${heads.map(() => "---").join(" | ")} |`
|
|
57
55
|
];
|
|
58
|
-
for (const row of
|
|
56
|
+
for (const row of table.rows) {
|
|
57
|
+
const l = rowLinks(row);
|
|
59
58
|
const evidence = [
|
|
60
|
-
`${
|
|
61
|
-
`${
|
|
62
|
-
...
|
|
59
|
+
`${l.doc_count} document${l.doc_count === 1 ? "" : "s"}`,
|
|
60
|
+
`${l.fact_count} fact${l.fact_count === 1 ? "" : "s"}`,
|
|
61
|
+
...l.thread_count ? [`${l.thread_count} thread${l.thread_count === 1 ? "" : "s"}`] : []
|
|
63
62
|
].join(", ");
|
|
64
63
|
const cells = [
|
|
65
|
-
row.
|
|
64
|
+
row.name,
|
|
66
65
|
...columns.map((c) => cellText(cellValue(row, c), c, options.nameOf)),
|
|
67
66
|
evidence
|
|
68
67
|
];
|
|
@@ -71,7 +70,206 @@ function tagMatrixMarkdown(matrix, options) {
|
|
|
71
70
|
return `${lines.join("\n")}
|
|
72
71
|
`;
|
|
73
72
|
}
|
|
74
|
-
var
|
|
73
|
+
var DEFAULT_TAG_COLUMNS_EDITOR_LABELS = {
|
|
74
|
+
title: "Columns",
|
|
75
|
+
addColumn: "Add column",
|
|
76
|
+
name: "Column name",
|
|
77
|
+
type: "Type",
|
|
78
|
+
options: "Choices",
|
|
79
|
+
optionsPlaceholder: "Choices, comma-separated",
|
|
80
|
+
remove: "Remove column",
|
|
81
|
+
moveUp: "Move up",
|
|
82
|
+
moveDown: "Move down",
|
|
83
|
+
save: "Save columns",
|
|
84
|
+
saving: "Saving\u2026",
|
|
85
|
+
cancel: "Cancel",
|
|
86
|
+
empty: "No columns.",
|
|
87
|
+
types: {
|
|
88
|
+
text: "Text",
|
|
89
|
+
number: "Number",
|
|
90
|
+
date: "Date",
|
|
91
|
+
checkbox: "Yes / no",
|
|
92
|
+
select: "Choice",
|
|
93
|
+
person: "Person",
|
|
94
|
+
document: "Document",
|
|
95
|
+
relation: "Relation",
|
|
96
|
+
lookup: "Lookup",
|
|
97
|
+
rollup: "Rollup"
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
var TYPES = ["text", "number", "date", "checkbox", "select", "person"];
|
|
101
|
+
var toDraft = (f) => ({
|
|
102
|
+
id: f.id,
|
|
103
|
+
name: f.name,
|
|
104
|
+
type: f.type,
|
|
105
|
+
options: (f.options ?? []).join(", ")
|
|
106
|
+
});
|
|
107
|
+
var toWrite = (d) => ({
|
|
108
|
+
...d.id ? { id: d.id } : {},
|
|
109
|
+
name: d.name.trim(),
|
|
110
|
+
type: d.type,
|
|
111
|
+
options: d.type === "select" ? d.options.split(",").map((o) => o.trim()).filter(Boolean) : null
|
|
112
|
+
});
|
|
113
|
+
function TagColumnsEditor({
|
|
114
|
+
columns,
|
|
115
|
+
onSave,
|
|
116
|
+
onCancel,
|
|
117
|
+
labels,
|
|
118
|
+
className,
|
|
119
|
+
testId = "tag-columns"
|
|
120
|
+
}) {
|
|
121
|
+
const l = { ...DEFAULT_TAG_COLUMNS_EDITOR_LABELS, ...labels };
|
|
122
|
+
const [drafts, setDrafts] = useState(() => columns.map(toDraft));
|
|
123
|
+
const [saving, setSaving] = useState(false);
|
|
124
|
+
const patch = (i, change) => setDrafts((ds) => ds.map((d, j) => j === i ? { ...d, ...change } : d));
|
|
125
|
+
const move = (i, by) => setDrafts((ds) => {
|
|
126
|
+
const next = [...ds];
|
|
127
|
+
const [d] = next.splice(i, 1);
|
|
128
|
+
next.splice(i + by, 0, d);
|
|
129
|
+
return next;
|
|
130
|
+
});
|
|
131
|
+
const valid = drafts.every(
|
|
132
|
+
(d) => d.name.trim() && (d.type !== "select" || toWrite(d).options?.length)
|
|
133
|
+
);
|
|
134
|
+
const input = "h-8 rounded-md border border-input bg-background px-2 text-sm focus:outline-none focus:ring-1 focus:ring-ring";
|
|
135
|
+
return /* @__PURE__ */ jsxs(
|
|
136
|
+
"form",
|
|
137
|
+
{
|
|
138
|
+
className: cn("space-y-2 rounded-lg border border-border p-3", className),
|
|
139
|
+
onSubmit: async (e) => {
|
|
140
|
+
e.preventDefault();
|
|
141
|
+
if (!valid) return;
|
|
142
|
+
setSaving(true);
|
|
143
|
+
try {
|
|
144
|
+
await onSave(drafts.map(toWrite));
|
|
145
|
+
} finally {
|
|
146
|
+
setSaving(false);
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
"data-testid": testId,
|
|
150
|
+
children: [
|
|
151
|
+
/* @__PURE__ */ jsx("h3", { className: "text-sm font-semibold", children: l.title }),
|
|
152
|
+
drafts.length === 0 && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: l.empty }),
|
|
153
|
+
/* @__PURE__ */ jsx("ul", { className: "space-y-2", children: drafts.map((d, i) => /* @__PURE__ */ jsxs(
|
|
154
|
+
"li",
|
|
155
|
+
{
|
|
156
|
+
className: "flex flex-wrap items-center gap-2",
|
|
157
|
+
"data-testid": `${testId}-column-${i}`,
|
|
158
|
+
children: [
|
|
159
|
+
/* @__PURE__ */ jsx(
|
|
160
|
+
Input,
|
|
161
|
+
{
|
|
162
|
+
className: "h-8 w-48",
|
|
163
|
+
value: d.name,
|
|
164
|
+
placeholder: l.name,
|
|
165
|
+
"aria-label": l.name,
|
|
166
|
+
onChange: (e) => patch(i, { name: e.target.value }),
|
|
167
|
+
"data-testid": `${testId}-name-${i}`
|
|
168
|
+
}
|
|
169
|
+
),
|
|
170
|
+
/* @__PURE__ */ jsx(
|
|
171
|
+
"select",
|
|
172
|
+
{
|
|
173
|
+
className: cn(input, "w-32"),
|
|
174
|
+
value: d.type,
|
|
175
|
+
disabled: !!d.id,
|
|
176
|
+
"aria-label": l.type,
|
|
177
|
+
onChange: (e) => patch(i, { type: e.target.value }),
|
|
178
|
+
"data-testid": `${testId}-type-${i}`,
|
|
179
|
+
children: (TYPES.includes(d.type) ? TYPES : [d.type, ...TYPES]).map((t) => /* @__PURE__ */ jsx("option", { value: t, children: l.types[t] }, t))
|
|
180
|
+
}
|
|
181
|
+
),
|
|
182
|
+
d.type === "select" && /* @__PURE__ */ jsx(
|
|
183
|
+
Input,
|
|
184
|
+
{
|
|
185
|
+
className: "h-8 min-w-48 flex-1",
|
|
186
|
+
value: d.options,
|
|
187
|
+
placeholder: l.optionsPlaceholder,
|
|
188
|
+
"aria-label": l.options,
|
|
189
|
+
onChange: (e) => patch(i, { options: e.target.value }),
|
|
190
|
+
"data-testid": `${testId}-options-${i}`
|
|
191
|
+
}
|
|
192
|
+
),
|
|
193
|
+
/* @__PURE__ */ jsxs("div", { className: "ml-auto flex items-center", children: [
|
|
194
|
+
/* @__PURE__ */ jsx(
|
|
195
|
+
Button,
|
|
196
|
+
{
|
|
197
|
+
type: "button",
|
|
198
|
+
variant: "ghost",
|
|
199
|
+
size: "icon",
|
|
200
|
+
disabled: i === 0,
|
|
201
|
+
"aria-label": l.moveUp,
|
|
202
|
+
onClick: () => move(i, -1),
|
|
203
|
+
children: /* @__PURE__ */ jsx(ArrowUp, { className: "size-4" })
|
|
204
|
+
}
|
|
205
|
+
),
|
|
206
|
+
/* @__PURE__ */ jsx(
|
|
207
|
+
Button,
|
|
208
|
+
{
|
|
209
|
+
type: "button",
|
|
210
|
+
variant: "ghost",
|
|
211
|
+
size: "icon",
|
|
212
|
+
disabled: i === drafts.length - 1,
|
|
213
|
+
"aria-label": l.moveDown,
|
|
214
|
+
onClick: () => move(i, 1),
|
|
215
|
+
children: /* @__PURE__ */ jsx(ArrowDown, { className: "size-4" })
|
|
216
|
+
}
|
|
217
|
+
),
|
|
218
|
+
/* @__PURE__ */ jsx(
|
|
219
|
+
Button,
|
|
220
|
+
{
|
|
221
|
+
type: "button",
|
|
222
|
+
variant: "ghost",
|
|
223
|
+
size: "icon",
|
|
224
|
+
"aria-label": l.remove,
|
|
225
|
+
onClick: () => setDrafts((ds) => ds.filter((_, j) => j !== i)),
|
|
226
|
+
"data-testid": `${testId}-remove-${i}`,
|
|
227
|
+
children: /* @__PURE__ */ jsx(X, { className: "size-4" })
|
|
228
|
+
}
|
|
229
|
+
)
|
|
230
|
+
] })
|
|
231
|
+
]
|
|
232
|
+
},
|
|
233
|
+
d.id ?? `new-${i}`
|
|
234
|
+
)) }),
|
|
235
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
236
|
+
/* @__PURE__ */ jsxs(
|
|
237
|
+
Button,
|
|
238
|
+
{
|
|
239
|
+
type: "button",
|
|
240
|
+
variant: "outline",
|
|
241
|
+
size: "sm",
|
|
242
|
+
onClick: () => setDrafts((ds) => [...ds, { name: "", type: "text", options: "" }]),
|
|
243
|
+
"data-testid": `${testId}-add`,
|
|
244
|
+
children: [
|
|
245
|
+
/* @__PURE__ */ jsx(Plus, { className: "size-4" }),
|
|
246
|
+
" ",
|
|
247
|
+
l.addColumn
|
|
248
|
+
]
|
|
249
|
+
}
|
|
250
|
+
),
|
|
251
|
+
/* @__PURE__ */ jsxs("div", { className: "ml-auto flex items-center gap-2", children: [
|
|
252
|
+
/* @__PURE__ */ jsx(Button, { type: "button", variant: "ghost", size: "sm", onClick: onCancel, children: l.cancel }),
|
|
253
|
+
/* @__PURE__ */ jsxs(
|
|
254
|
+
Button,
|
|
255
|
+
{
|
|
256
|
+
type: "submit",
|
|
257
|
+
size: "sm",
|
|
258
|
+
disabled: !valid || saving,
|
|
259
|
+
"data-testid": `${testId}-save`,
|
|
260
|
+
children: [
|
|
261
|
+
saving && /* @__PURE__ */ jsx(Loader2, { className: "size-4 animate-spin" }),
|
|
262
|
+
saving ? l.saving : l.save
|
|
263
|
+
]
|
|
264
|
+
}
|
|
265
|
+
)
|
|
266
|
+
] })
|
|
267
|
+
] })
|
|
268
|
+
]
|
|
269
|
+
}
|
|
270
|
+
);
|
|
271
|
+
}
|
|
272
|
+
var DEFAULT_TAG_TABLE_LABELS = {
|
|
75
273
|
row: "Item",
|
|
76
274
|
evidence: "Evidence",
|
|
77
275
|
documents: "{count} documents",
|
|
@@ -93,13 +291,14 @@ var DEFAULT_TAG_MATRIX_LABELS = {
|
|
|
93
291
|
exporting: "Exporting\u2026",
|
|
94
292
|
empty: "No rows yet.",
|
|
95
293
|
loading: "Loading\u2026",
|
|
96
|
-
noColumns: "No
|
|
294
|
+
noColumns: "No columns yet: add one to give each row a value.",
|
|
97
295
|
choose: "\u2014",
|
|
98
|
-
yes: "Yes"
|
|
296
|
+
yes: "Yes",
|
|
297
|
+
editColumns: "Columns"
|
|
99
298
|
};
|
|
100
299
|
var ROW_LABEL_WIDTH = "w-[18rem] min-w-[12rem] max-w-[18rem]";
|
|
101
300
|
var ROW_LABEL = "line-clamp-3 whitespace-normal break-words";
|
|
102
|
-
function
|
|
301
|
+
function TagTableCell({
|
|
103
302
|
row,
|
|
104
303
|
column,
|
|
105
304
|
people,
|
|
@@ -112,7 +311,7 @@ function TagMatrixCell({
|
|
|
112
311
|
const shown = cellText(value, column, nameOf);
|
|
113
312
|
const [draft, setDraft] = useState(shown);
|
|
114
313
|
useEffect(() => setDraft(cellText(value, column)), [value, column]);
|
|
115
|
-
const set = (next) => void onChange?.(row.
|
|
314
|
+
const set = (next) => void onChange?.(row.external_id, column.id, next);
|
|
116
315
|
if (!onChange)
|
|
117
316
|
return /* @__PURE__ */ jsx("span", { className: "block truncate", title: shown, "data-testid": testId, children: shown || /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: l.choose }) });
|
|
118
317
|
const field = "h-8 w-full min-w-24 rounded-md border border-transparent bg-transparent px-1.5 text-sm hover:border-input focus:border-input focus:bg-background focus:outline-none";
|
|
@@ -123,7 +322,7 @@ function TagMatrixCell({
|
|
|
123
322
|
{
|
|
124
323
|
checked: value === true,
|
|
125
324
|
onCheckedChange: (v) => set(v === true),
|
|
126
|
-
"aria-label": `${row.
|
|
325
|
+
"aria-label": `${row.name}: ${column.name}`,
|
|
127
326
|
"data-testid": testId
|
|
128
327
|
}
|
|
129
328
|
);
|
|
@@ -136,7 +335,7 @@ function TagMatrixCell({
|
|
|
136
335
|
className: cn(field, "min-w-32 pr-6"),
|
|
137
336
|
value: typeof value === "string" ? value : "",
|
|
138
337
|
onChange: (e) => set(e.target.value || null),
|
|
139
|
-
"aria-label": `${row.
|
|
338
|
+
"aria-label": `${row.name}: ${column.name}`,
|
|
140
339
|
"data-testid": testId,
|
|
141
340
|
children: [
|
|
142
341
|
/* @__PURE__ */ jsx("option", { value: "", children: l.choose }),
|
|
@@ -162,7 +361,7 @@ function TagMatrixCell({
|
|
|
162
361
|
if (e.key === "Enter") e.target.blur();
|
|
163
362
|
if (e.key === "Escape") setDraft(cellText(value, column));
|
|
164
363
|
},
|
|
165
|
-
"aria-label": `${row.
|
|
364
|
+
"aria-label": `${row.name}: ${column.name}`,
|
|
166
365
|
"data-testid": testId
|
|
167
366
|
}
|
|
168
367
|
);
|
|
@@ -192,16 +391,17 @@ function Evidence({
|
|
|
192
391
|
]
|
|
193
392
|
}
|
|
194
393
|
);
|
|
195
|
-
const
|
|
196
|
-
const
|
|
197
|
-
const
|
|
198
|
-
const
|
|
394
|
+
const links = rowLinks(row);
|
|
395
|
+
const docs = links.docs ?? [];
|
|
396
|
+
const facts = links.facts ?? [];
|
|
397
|
+
const threads = links.threads ?? [];
|
|
398
|
+
const more = links.doc_count - docs.length + (links.fact_count - facts.length) + (links.thread_count - threads.length);
|
|
199
399
|
const chip = "inline-flex max-w-44 items-center gap-1 truncate rounded-md border border-border px-1.5 py-0.5 text-xs hover:border-primary/40 hover:text-primary disabled:hover:border-border disabled:hover:text-inherit";
|
|
200
400
|
return /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-1", "data-testid": testId, children: [
|
|
201
401
|
/* @__PURE__ */ jsx("span", { className: "mr-1 text-xs text-muted-foreground", children: [
|
|
202
|
-
countText(
|
|
203
|
-
countText(
|
|
204
|
-
countText(
|
|
402
|
+
countText(links.doc_count, l.document, l.documents),
|
|
403
|
+
countText(links.fact_count, l.fact, l.facts),
|
|
404
|
+
countText(links.thread_count, l.thread, l.threads)
|
|
205
405
|
].filter(Boolean).join(" \xB7 ") }),
|
|
206
406
|
docs.map((d) => /* @__PURE__ */ jsxs(
|
|
207
407
|
"button",
|
|
@@ -256,18 +456,19 @@ function Evidence({
|
|
|
256
456
|
{
|
|
257
457
|
type: "button",
|
|
258
458
|
className: "text-xs text-primary hover:underline",
|
|
259
|
-
onClick: () => onOpenRow(row.
|
|
459
|
+
onClick: () => onOpenRow(row.external_id),
|
|
260
460
|
"data-testid": `${testId}-more`,
|
|
261
461
|
children: l.more.replace("{count}", String(more))
|
|
262
462
|
}
|
|
263
463
|
) : /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", "data-testid": `${testId}-more`, children: l.more.replace("{count}", String(more)) }))
|
|
264
464
|
] });
|
|
265
465
|
}
|
|
266
|
-
function
|
|
267
|
-
|
|
466
|
+
function TagTable({
|
|
467
|
+
table,
|
|
268
468
|
isLoading,
|
|
269
469
|
onChangeValue,
|
|
270
470
|
onAddRow,
|
|
471
|
+
onChangeColumns,
|
|
271
472
|
onOpenDocument,
|
|
272
473
|
onOpenFact,
|
|
273
474
|
onOpenThread,
|
|
@@ -278,11 +479,12 @@ function TagMatrix({
|
|
|
278
479
|
actions,
|
|
279
480
|
labels,
|
|
280
481
|
className,
|
|
281
|
-
testId = "tag-
|
|
482
|
+
testId = "tag-table"
|
|
282
483
|
}) {
|
|
283
|
-
const l = { ...
|
|
284
|
-
const columns = useMemo(() =>
|
|
285
|
-
const rows =
|
|
484
|
+
const l = { ...DEFAULT_TAG_TABLE_LABELS, ...labels };
|
|
485
|
+
const columns = useMemo(() => table?.columns ?? [], [table]);
|
|
486
|
+
const rows = table?.rows ?? [];
|
|
487
|
+
const [editingColumns, setEditingColumns] = useState(false);
|
|
286
488
|
const gaps = rows.filter(isGap).length;
|
|
287
489
|
const [gapsOnly, setGapsOnly] = useState(false);
|
|
288
490
|
const [name, setName] = useState("");
|
|
@@ -320,6 +522,20 @@ function TagMatrix({
|
|
|
320
522
|
] }),
|
|
321
523
|
/* @__PURE__ */ jsxs("div", { className: "ml-auto flex flex-wrap items-center gap-2", children: [
|
|
322
524
|
actions,
|
|
525
|
+
onChangeColumns && /* @__PURE__ */ jsxs(
|
|
526
|
+
Button,
|
|
527
|
+
{
|
|
528
|
+
variant: "outline",
|
|
529
|
+
size: "sm",
|
|
530
|
+
"aria-pressed": editingColumns,
|
|
531
|
+
onClick: () => setEditingColumns((v) => !v),
|
|
532
|
+
"data-testid": `${testId}-edit-columns`,
|
|
533
|
+
children: [
|
|
534
|
+
/* @__PURE__ */ jsx(SlidersHorizontal, { className: "size-4" }),
|
|
535
|
+
l.editColumns
|
|
536
|
+
]
|
|
537
|
+
}
|
|
538
|
+
),
|
|
323
539
|
onDownload && /* @__PURE__ */ jsxs(
|
|
324
540
|
Button,
|
|
325
541
|
{
|
|
@@ -357,6 +573,19 @@ function TagMatrix({
|
|
|
357
573
|
)
|
|
358
574
|
] })
|
|
359
575
|
] }),
|
|
576
|
+
editingColumns && onChangeColumns && /* @__PURE__ */ jsx(
|
|
577
|
+
TagColumnsEditor,
|
|
578
|
+
{
|
|
579
|
+
columns,
|
|
580
|
+
labels: l.columns,
|
|
581
|
+
onCancel: () => setEditingColumns(false),
|
|
582
|
+
onSave: async (fields) => {
|
|
583
|
+
await onChangeColumns(fields);
|
|
584
|
+
setEditingColumns(false);
|
|
585
|
+
},
|
|
586
|
+
testId: `${testId}-columns`
|
|
587
|
+
}
|
|
588
|
+
),
|
|
360
589
|
isLoading ? /* @__PURE__ */ jsxs("p", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
|
|
361
590
|
/* @__PURE__ */ jsx(Loader2, { className: "size-4 animate-spin" }),
|
|
362
591
|
" ",
|
|
@@ -387,7 +616,7 @@ function TagMatrix({
|
|
|
387
616
|
] }) }),
|
|
388
617
|
/* @__PURE__ */ jsxs("tbody", { children: [
|
|
389
618
|
shown.map((row) => {
|
|
390
|
-
const id = row.
|
|
619
|
+
const id = row.external_id;
|
|
391
620
|
const gap = isGap(row);
|
|
392
621
|
return /* @__PURE__ */ jsxs(
|
|
393
622
|
"tr",
|
|
@@ -411,24 +640,24 @@ function TagMatrix({
|
|
|
411
640
|
{
|
|
412
641
|
type: "button",
|
|
413
642
|
className: cn(ROW_LABEL, "text-left hover:text-primary hover:underline"),
|
|
414
|
-
title: row.
|
|
643
|
+
title: row.name,
|
|
415
644
|
onClick: () => onOpenRow(id),
|
|
416
645
|
"data-testid": `${testId}-row-${id}-label`,
|
|
417
|
-
children: row.
|
|
646
|
+
children: row.name
|
|
418
647
|
}
|
|
419
648
|
) : /* @__PURE__ */ jsx(
|
|
420
649
|
"span",
|
|
421
650
|
{
|
|
422
651
|
className: ROW_LABEL,
|
|
423
|
-
title: row.
|
|
652
|
+
title: row.name,
|
|
424
653
|
"data-testid": `${testId}-row-${id}-label`,
|
|
425
|
-
children: row.
|
|
654
|
+
children: row.name
|
|
426
655
|
}
|
|
427
656
|
)
|
|
428
657
|
}
|
|
429
658
|
),
|
|
430
659
|
columns.map((c) => /* @__PURE__ */ jsx("td", { className: "px-1.5 py-1", children: /* @__PURE__ */ jsx(
|
|
431
|
-
|
|
660
|
+
TagTableCell,
|
|
432
661
|
{
|
|
433
662
|
row,
|
|
434
663
|
column: c,
|
|
@@ -507,8 +736,8 @@ function TagMatrix({
|
|
|
507
736
|
] });
|
|
508
737
|
}
|
|
509
738
|
var DOCX_MIME_TYPE = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
|
|
510
|
-
var
|
|
511
|
-
var
|
|
739
|
+
var TAG_TABLE_DOCX_LANDSCAPE_AFTER = 6;
|
|
740
|
+
var DEFAULT_TAG_TABLE_DOCX_LABELS = {
|
|
512
741
|
row: "Item",
|
|
513
742
|
evidence: "Evidence",
|
|
514
743
|
gaps: "Gaps",
|
|
@@ -537,40 +766,46 @@ var cell = (paragraphs, width, fill) => `<w:tc><w:tcPr><w:tcW w:w="${width}" w:t
|
|
|
537
766
|
var count = (n, one, many) => n === 1 ? one : many.replace("{count}", String(n));
|
|
538
767
|
function evidenceParagraphs(row, l) {
|
|
539
768
|
if (isGap(row)) return [];
|
|
540
|
-
const
|
|
541
|
-
const
|
|
542
|
-
const
|
|
543
|
-
const
|
|
769
|
+
const links = rowLinks(row);
|
|
770
|
+
const docs = links.docs ?? [];
|
|
771
|
+
const facts = links.facts ?? [];
|
|
772
|
+
const threads = links.threads ?? [];
|
|
773
|
+
const more = links.doc_count - docs.length + (links.fact_count - facts.length) + (links.thread_count - threads.length);
|
|
544
774
|
return [
|
|
545
775
|
paragraph(
|
|
546
776
|
[
|
|
547
777
|
{
|
|
548
778
|
text: [
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
779
|
+
links.doc_count ? count(links.doc_count, l.document, l.documents) : null,
|
|
780
|
+
links.fact_count ? count(links.fact_count, l.fact, l.facts) : null,
|
|
781
|
+
links.thread_count ? count(links.thread_count, l.thread, l.threads) : null
|
|
552
782
|
].filter(Boolean).join(" \xB7 "),
|
|
553
783
|
muted: true
|
|
554
784
|
}
|
|
555
785
|
],
|
|
556
|
-
"
|
|
786
|
+
"TagTableCell"
|
|
557
787
|
),
|
|
558
788
|
...docs.map(
|
|
559
789
|
(d) => paragraph(
|
|
560
790
|
[{ text: d.file_name, bold: true }, ...d.note ? [{ text: ` \u2014 ${d.note}` }] : []],
|
|
561
|
-
"
|
|
791
|
+
"TagTableCell"
|
|
562
792
|
)
|
|
563
793
|
),
|
|
564
|
-
...facts.map((f) => paragraph([{ text: `\u201C${f.text}\u201D`, italic: true }], "
|
|
565
|
-
...threads.map((t) => paragraph([{ text: t.title || l.untitledThread }], "
|
|
566
|
-
...more > 0 ? [
|
|
794
|
+
...facts.map((f) => paragraph([{ text: `\u201C${f.text}\u201D`, italic: true }], "TagTableCell")),
|
|
795
|
+
...threads.map((t) => paragraph([{ text: t.title || l.untitledThread }], "TagTableCell")),
|
|
796
|
+
...more > 0 ? [
|
|
797
|
+
paragraph(
|
|
798
|
+
[{ text: l.more.replace("{count}", String(more)), muted: true }],
|
|
799
|
+
"TagTableCell"
|
|
800
|
+
)
|
|
801
|
+
] : []
|
|
567
802
|
];
|
|
568
803
|
}
|
|
569
804
|
function gapParagraphs(row, columns, l) {
|
|
570
805
|
const missing = columns.filter((c) => c.type !== "checkbox" && cellText(cellValue(row, c), c) === "").map((c) => c.name);
|
|
571
806
|
return [
|
|
572
|
-
...isGap(row) ? [paragraph([{ text: l.noEvidence, bold: true }], "
|
|
573
|
-
...missing.length ? [paragraph([{ text: l.missing.replace("{fields}", missing.join(", ")) }], "
|
|
807
|
+
...isGap(row) ? [paragraph([{ text: l.noEvidence, bold: true }], "TagTableCell")] : [],
|
|
808
|
+
...missing.length ? [paragraph([{ text: l.missing.replace("{fields}", missing.join(", ")) }], "TagTableCell")] : []
|
|
574
809
|
];
|
|
575
810
|
}
|
|
576
811
|
function page(landscape) {
|
|
@@ -583,40 +818,41 @@ function page(landscape) {
|
|
|
583
818
|
sectPr: `<w:sectPr><w:pgSz w:w="${landscape ? long : short}" w:h="${landscape ? short : long}"${landscape ? ' w:orient="landscape"' : ""}/><w:pgMar w:top="${margin}" w:right="${margin}" w:bottom="${margin}" w:left="${margin}" w:header="708" w:footer="708" w:gutter="0"/></w:sectPr>`
|
|
584
819
|
};
|
|
585
820
|
}
|
|
586
|
-
function
|
|
587
|
-
const l = { ...
|
|
588
|
-
const columns =
|
|
589
|
-
const rows = matrix.rows ?? [];
|
|
821
|
+
function tagTableDocumentXml(table, options) {
|
|
822
|
+
const l = { ...DEFAULT_TAG_TABLE_DOCX_LABELS, ...options.labels };
|
|
823
|
+
const { columns, rows } = table;
|
|
590
824
|
const heads = [l.row, ...columns.map((c) => c.name), l.evidence, l.gaps];
|
|
591
|
-
const landscape = heads.length >
|
|
825
|
+
const landscape = heads.length > TAG_TABLE_DOCX_LANDSCAPE_AFTER;
|
|
592
826
|
const { textWidth, sectPr } = page(landscape);
|
|
593
827
|
const weights = [2, ...columns.map(() => 1), 3, 1.5];
|
|
594
828
|
const total = weights.reduce((a, b) => a + b, 0);
|
|
595
829
|
const widths = weights.map((w) => Math.floor(textWidth * w / total));
|
|
596
830
|
const at = new Date(options.at ?? Date.now()).toISOString().slice(0, 16).replace("T", " ");
|
|
597
|
-
const header = `<w:tr><w:trPr><w:tblHeader/><w:cantSplit/></w:trPr>${heads.map(
|
|
831
|
+
const header = `<w:tr><w:trPr><w:tblHeader/><w:cantSplit/></w:trPr>${heads.map(
|
|
832
|
+
(h, i) => cell([paragraph([{ text: h, bold: true }], "TagTableCell")], widths[i], "E7E6E6")
|
|
833
|
+
).join("")}</w:tr>`;
|
|
598
834
|
const body = rows.map((row) => {
|
|
599
835
|
const fill = isGap(row) ? "FFF2CC" : void 0;
|
|
600
836
|
const cells = [
|
|
601
|
-
cell([paragraph([{ text: row.
|
|
837
|
+
cell([paragraph([{ text: row.name, bold: true }], "TagTableCell")], widths[0], fill),
|
|
602
838
|
...columns.map((c, i) => {
|
|
603
839
|
const text = cellText(cellValue(row, c), c, options.nameOf);
|
|
604
|
-
return cell(text ? [paragraph([{ text }], "
|
|
840
|
+
return cell(text ? [paragraph([{ text }], "TagTableCell")] : [], widths[i + 1], fill);
|
|
605
841
|
}),
|
|
606
842
|
cell(evidenceParagraphs(row, l), widths[columns.length + 1], fill),
|
|
607
843
|
cell(gapParagraphs(row, columns, l), widths[columns.length + 2], fill)
|
|
608
844
|
];
|
|
609
845
|
return `<w:tr><w:trPr><w:cantSplit/></w:trPr>${cells.join("")}</w:tr>`;
|
|
610
846
|
});
|
|
611
|
-
const
|
|
847
|
+
const grid = `<w:tbl><w:tblPr><w:tblStyle w:val="TagTableGrid"/><w:tblW w:w="${textWidth}" w:type="dxa"/><w:tblLayout w:type="fixed"/><w:tblLook w:val="04A0" w:firstRow="1" w:lastRow="0" w:firstColumn="1" w:lastColumn="0" w:noHBand="0" w:noVBand="1"/></w:tblPr><w:tblGrid>${widths.map((w) => `<w:gridCol w:w="${w}"/>`).join("")}</w:tblGrid>${header}${body.join("")}</w:tbl>`;
|
|
612
848
|
return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
613
849
|
<w:document xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"><w:body>${paragraph(
|
|
614
850
|
[{ text: options.title }],
|
|
615
851
|
"Title"
|
|
616
|
-
)}${paragraph([{ text: l.takenAt.replace("{at}", `${at} UTC`), muted: true }])}${
|
|
852
|
+
)}${paragraph([{ text: l.takenAt.replace("{at}", `${at} UTC`), muted: true }])}${grid}${rows.length ? "" : paragraph([{ text: l.empty, muted: true }])}<w:p/>${sectPr}</w:body></w:document>`;
|
|
617
853
|
}
|
|
618
854
|
var STYLES = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
619
|
-
<w:styles xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"><w:docDefaults><w:rPrDefault><w:rPr><w:rFonts w:ascii="Calibri" w:hAnsi="Calibri" w:eastAsia="Calibri" w:cs="Calibri"/><w:sz w:val="22"/><w:szCs w:val="22"/><w:lang w:val="en-GB"/></w:rPr></w:rPrDefault><w:pPrDefault><w:pPr><w:spacing w:after="160" w:line="259" w:lineRule="auto"/></w:pPr></w:pPrDefault></w:docDefaults><w:style w:type="paragraph" w:default="1" w:styleId="Normal"><w:name w:val="Normal"/><w:qFormat/></w:style><w:style w:type="paragraph" w:styleId="Title"><w:name w:val="Title"/><w:basedOn w:val="Normal"/><w:next w:val="Normal"/><w:qFormat/><w:pPr><w:spacing w:after="80" w:line="240" w:lineRule="auto"/></w:pPr><w:rPr><w:sz w:val="48"/><w:szCs w:val="48"/></w:rPr></w:style><w:style w:type="paragraph" w:customStyle="1" w:styleId="
|
|
855
|
+
<w:styles xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"><w:docDefaults><w:rPrDefault><w:rPr><w:rFonts w:ascii="Calibri" w:hAnsi="Calibri" w:eastAsia="Calibri" w:cs="Calibri"/><w:sz w:val="22"/><w:szCs w:val="22"/><w:lang w:val="en-GB"/></w:rPr></w:rPrDefault><w:pPrDefault><w:pPr><w:spacing w:after="160" w:line="259" w:lineRule="auto"/></w:pPr></w:pPrDefault></w:docDefaults><w:style w:type="paragraph" w:default="1" w:styleId="Normal"><w:name w:val="Normal"/><w:qFormat/></w:style><w:style w:type="paragraph" w:styleId="Title"><w:name w:val="Title"/><w:basedOn w:val="Normal"/><w:next w:val="Normal"/><w:qFormat/><w:pPr><w:spacing w:after="80" w:line="240" w:lineRule="auto"/></w:pPr><w:rPr><w:sz w:val="48"/><w:szCs w:val="48"/></w:rPr></w:style><w:style w:type="paragraph" w:customStyle="1" w:styleId="TagTableCell"><w:name w:val="Tag Table Cell"/><w:basedOn w:val="Normal"/><w:qFormat/><w:pPr><w:spacing w:after="40" w:line="240" w:lineRule="auto"/></w:pPr><w:rPr><w:sz w:val="18"/><w:szCs w:val="18"/></w:rPr></w:style><w:style w:type="table" w:default="1" w:styleId="TableNormal"><w:name w:val="Normal Table"/><w:tblPr><w:tblInd w:w="0" w:type="dxa"/><w:tblCellMar><w:top w:w="0" w:type="dxa"/><w:left w:w="108" w:type="dxa"/><w:bottom w:w="0" w:type="dxa"/><w:right w:w="108" w:type="dxa"/></w:tblCellMar></w:tblPr></w:style><w:style w:type="table" w:customStyle="1" w:styleId="TagTableGrid"><w:name w:val="Tag Table"/><w:basedOn w:val="TableNormal"/><w:tblPr><w:tblBorders><w:top w:val="single" w:sz="4" w:space="0" w:color="BFBFBF"/><w:left w:val="single" w:sz="4" w:space="0" w:color="BFBFBF"/><w:bottom w:val="single" w:sz="4" w:space="0" w:color="BFBFBF"/><w:right w:val="single" w:sz="4" w:space="0" w:color="BFBFBF"/><w:insideH w:val="single" w:sz="4" w:space="0" w:color="BFBFBF"/><w:insideV w:val="single" w:sz="4" w:space="0" w:color="BFBFBF"/></w:tblBorders><w:tblCellMar><w:top w:w="60" w:type="dxa"/><w:left w:w="100" w:type="dxa"/><w:bottom w:w="60" w:type="dxa"/><w:right w:w="100" w:type="dxa"/></w:tblCellMar></w:tblPr></w:style></w:styles>`;
|
|
620
856
|
var CONTENT_TYPES = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
621
857
|
<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/><Default Extension="xml" ContentType="application/xml"/><Override PartName="/word/document.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"/><Override PartName="/word/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml"/><Override PartName="/docProps/core.xml" ContentType="application/vnd.openxmlformats-package.core-properties+xml"/></Types>`;
|
|
622
858
|
var ROOT_RELS = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
@@ -627,18 +863,18 @@ var coreXml = (title, at) => `<?xml version="1.0" encoding="UTF-8" standalone="y
|
|
|
627
863
|
<cp:coreProperties xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><dc:title>${esc(
|
|
628
864
|
title
|
|
629
865
|
)}</dc:title><dcterms:created xsi:type="dcterms:W3CDTF">${at}</dcterms:created><dcterms:modified xsi:type="dcterms:W3CDTF">${at}</dcterms:modified></cp:coreProperties>`;
|
|
630
|
-
function
|
|
866
|
+
function tagTableDocx(table, options) {
|
|
631
867
|
const at = new Date(options.at ?? Date.now()).toISOString().replace(/\.\d{3}Z$/, "Z");
|
|
632
868
|
return zipSync({
|
|
633
869
|
"[Content_Types].xml": strToU8(CONTENT_TYPES),
|
|
634
870
|
"_rels/.rels": strToU8(ROOT_RELS),
|
|
635
871
|
"docProps/core.xml": strToU8(coreXml(options.title, at)),
|
|
636
|
-
"word/document.xml": strToU8(
|
|
872
|
+
"word/document.xml": strToU8(tagTableDocumentXml(table, { ...options, at })),
|
|
637
873
|
"word/styles.xml": strToU8(STYLES),
|
|
638
874
|
"word/_rels/document.xml.rels": strToU8(DOCUMENT_RELS)
|
|
639
875
|
});
|
|
640
876
|
}
|
|
641
877
|
|
|
642
|
-
export {
|
|
643
|
-
//# sourceMappingURL=chunk-
|
|
644
|
-
//# sourceMappingURL=chunk-
|
|
878
|
+
export { DEFAULT_TAG_COLUMNS_EDITOR_LABELS, DEFAULT_TAG_TABLE_DOCX_LABELS, DEFAULT_TAG_TABLE_LABELS, DOCX_MIME_TYPE, TAG_TABLE_DOCX_LANDSCAPE_AFTER, TagColumnsEditor, TagTable, TagTableCell, cellText, cellValue, fieldWrites, isGap, parseCell, rowLinks, tagTableDocumentXml, tagTableDocx, tagTableMarkdown };
|
|
879
|
+
//# sourceMappingURL=chunk-X23U6QEJ.js.map
|
|
880
|
+
//# sourceMappingURL=chunk-X23U6QEJ.js.map
|