@arbidocs/blocks 0.4.84 → 0.4.85
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 +281 -280
- package/dist/agents/index.js +6 -5
- 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-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-RX35SMPR.js → chunk-FHOZMT5P.js} +7 -6
- package/dist/chunk-FHOZMT5P.js.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-YJQVLVBJ.cjs → chunk-S5HZBXZA.cjs} +2 -243
- package/dist/chunk-S5HZBXZA.cjs.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/{chunk-XA5S4776.cjs → chunk-Z7YUCYI6.cjs} +51 -50
- package/dist/chunk-Z7YUCYI6.cjs.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 +1647 -65
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/index.d.ts +2 -1
- package/dist/connect/index.js +1631 -55
- package/dist/connect/index.js.map +1 -1
- 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 +2 -2
- package/dist/facts/index.js +2 -2
- package/dist/files/index.cjs +47 -367
- package/dist/files/index.cjs.map +1 -1
- package/dist/files/index.js +10 -360
- package/dist/files/index.js.map +1 -1
- package/dist/index.cjs +450 -391
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +21 -18
- package/dist/index.js.map +1 -1
- package/dist/settings/index.cjs +10 -9
- package/dist/settings/index.cjs.map +1 -1
- package/dist/settings/index.js +2 -1
- package/dist/settings/index.js.map +1 -1
- package/dist/shell/index.cjs +1 -1
- package/dist/shell/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 +49 -48
- package/dist/workflow-canvas/index.cjs.map +1 -1
- package/dist/workflow-canvas/index.js +6 -5
- package/dist/workflow-canvas/index.js.map +1 -1
- package/package.json +29 -4
- 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-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
|
@@ -7,24 +7,21 @@ var ui = require('@arbidocs/react/ui');
|
|
|
7
7
|
var jsxRuntime = require('react/jsx-runtime');
|
|
8
8
|
var fflate = require('fflate');
|
|
9
9
|
|
|
10
|
-
// src/tags/
|
|
11
|
-
var
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
var cellValue = (row, column) => row.tag.field_values?.[rowFieldId(row, column)];
|
|
27
|
-
var isGap = (row) => row.doc_count + row.fact_count + row.thread_count === 0;
|
|
10
|
+
// src/tags/tagTableModel.ts
|
|
11
|
+
var NO_LINKS = {
|
|
12
|
+
docs: [],
|
|
13
|
+
facts: [],
|
|
14
|
+
threads: [],
|
|
15
|
+
doc_count: 0,
|
|
16
|
+
fact_count: 0,
|
|
17
|
+
thread_count: 0
|
|
18
|
+
};
|
|
19
|
+
var rowLinks = (row) => row.links ?? NO_LINKS;
|
|
20
|
+
var cellValue = (row, column) => row.field_values?.[column.id];
|
|
21
|
+
var isGap = (row) => {
|
|
22
|
+
const l = rowLinks(row);
|
|
23
|
+
return l.doc_count + l.fact_count + l.thread_count === 0;
|
|
24
|
+
};
|
|
28
25
|
function cellText(value, column, nameOf) {
|
|
29
26
|
if (value === void 0 || value === null || value === "") return "";
|
|
30
27
|
if (column.type === "checkbox") return value ? "Yes" : "No";
|
|
@@ -41,9 +38,10 @@ function parseCell(text, type) {
|
|
|
41
38
|
}
|
|
42
39
|
return t;
|
|
43
40
|
}
|
|
41
|
+
var fieldWrites = (columns) => columns.map((c) => ({ id: c.id, name: c.name, type: c.type, options: c.options ?? null }));
|
|
44
42
|
var escapeCell = (text) => text.replace(/\|/g, "\\|").replace(/\n+/g, " ");
|
|
45
|
-
function
|
|
46
|
-
const columns =
|
|
43
|
+
function tagTableMarkdown(table, options) {
|
|
44
|
+
const { columns } = table;
|
|
47
45
|
const heads = [
|
|
48
46
|
options.rowHeading ?? "Item",
|
|
49
47
|
...columns.map((c) => c.name),
|
|
@@ -57,14 +55,15 @@ function tagMatrixMarkdown(matrix, options) {
|
|
|
57
55
|
`| ${heads.map(escapeCell).join(" | ")} |`,
|
|
58
56
|
`| ${heads.map(() => "---").join(" | ")} |`
|
|
59
57
|
];
|
|
60
|
-
for (const row of
|
|
58
|
+
for (const row of table.rows) {
|
|
59
|
+
const l = rowLinks(row);
|
|
61
60
|
const evidence = [
|
|
62
|
-
`${
|
|
63
|
-
`${
|
|
64
|
-
...
|
|
61
|
+
`${l.doc_count} document${l.doc_count === 1 ? "" : "s"}`,
|
|
62
|
+
`${l.fact_count} fact${l.fact_count === 1 ? "" : "s"}`,
|
|
63
|
+
...l.thread_count ? [`${l.thread_count} thread${l.thread_count === 1 ? "" : "s"}`] : []
|
|
65
64
|
].join(", ");
|
|
66
65
|
const cells = [
|
|
67
|
-
row.
|
|
66
|
+
row.name,
|
|
68
67
|
...columns.map((c) => cellText(cellValue(row, c), c, options.nameOf)),
|
|
69
68
|
evidence
|
|
70
69
|
];
|
|
@@ -73,7 +72,206 @@ function tagMatrixMarkdown(matrix, options) {
|
|
|
73
72
|
return `${lines.join("\n")}
|
|
74
73
|
`;
|
|
75
74
|
}
|
|
76
|
-
var
|
|
75
|
+
var DEFAULT_TAG_COLUMNS_EDITOR_LABELS = {
|
|
76
|
+
title: "Columns",
|
|
77
|
+
addColumn: "Add column",
|
|
78
|
+
name: "Column name",
|
|
79
|
+
type: "Type",
|
|
80
|
+
options: "Choices",
|
|
81
|
+
optionsPlaceholder: "Choices, comma-separated",
|
|
82
|
+
remove: "Remove column",
|
|
83
|
+
moveUp: "Move up",
|
|
84
|
+
moveDown: "Move down",
|
|
85
|
+
save: "Save columns",
|
|
86
|
+
saving: "Saving\u2026",
|
|
87
|
+
cancel: "Cancel",
|
|
88
|
+
empty: "No columns.",
|
|
89
|
+
types: {
|
|
90
|
+
text: "Text",
|
|
91
|
+
number: "Number",
|
|
92
|
+
date: "Date",
|
|
93
|
+
checkbox: "Yes / no",
|
|
94
|
+
select: "Choice",
|
|
95
|
+
person: "Person",
|
|
96
|
+
document: "Document",
|
|
97
|
+
relation: "Relation",
|
|
98
|
+
lookup: "Lookup",
|
|
99
|
+
rollup: "Rollup"
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
var TYPES = ["text", "number", "date", "checkbox", "select", "person"];
|
|
103
|
+
var toDraft = (f) => ({
|
|
104
|
+
id: f.id,
|
|
105
|
+
name: f.name,
|
|
106
|
+
type: f.type,
|
|
107
|
+
options: (f.options ?? []).join(", ")
|
|
108
|
+
});
|
|
109
|
+
var toWrite = (d) => ({
|
|
110
|
+
...d.id ? { id: d.id } : {},
|
|
111
|
+
name: d.name.trim(),
|
|
112
|
+
type: d.type,
|
|
113
|
+
options: d.type === "select" ? d.options.split(",").map((o) => o.trim()).filter(Boolean) : null
|
|
114
|
+
});
|
|
115
|
+
function TagColumnsEditor({
|
|
116
|
+
columns,
|
|
117
|
+
onSave,
|
|
118
|
+
onCancel,
|
|
119
|
+
labels,
|
|
120
|
+
className,
|
|
121
|
+
testId = "tag-columns"
|
|
122
|
+
}) {
|
|
123
|
+
const l = { ...DEFAULT_TAG_COLUMNS_EDITOR_LABELS, ...labels };
|
|
124
|
+
const [drafts, setDrafts] = react.useState(() => columns.map(toDraft));
|
|
125
|
+
const [saving, setSaving] = react.useState(false);
|
|
126
|
+
const patch = (i, change) => setDrafts((ds) => ds.map((d, j) => j === i ? { ...d, ...change } : d));
|
|
127
|
+
const move = (i, by) => setDrafts((ds) => {
|
|
128
|
+
const next = [...ds];
|
|
129
|
+
const [d] = next.splice(i, 1);
|
|
130
|
+
next.splice(i + by, 0, d);
|
|
131
|
+
return next;
|
|
132
|
+
});
|
|
133
|
+
const valid = drafts.every(
|
|
134
|
+
(d) => d.name.trim() && (d.type !== "select" || toWrite(d).options?.length)
|
|
135
|
+
);
|
|
136
|
+
const input = "h-8 rounded-md border border-input bg-background px-2 text-sm focus:outline-none focus:ring-1 focus:ring-ring";
|
|
137
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
138
|
+
"form",
|
|
139
|
+
{
|
|
140
|
+
className: ui.cn("space-y-2 rounded-lg border border-border p-3", className),
|
|
141
|
+
onSubmit: async (e) => {
|
|
142
|
+
e.preventDefault();
|
|
143
|
+
if (!valid) return;
|
|
144
|
+
setSaving(true);
|
|
145
|
+
try {
|
|
146
|
+
await onSave(drafts.map(toWrite));
|
|
147
|
+
} finally {
|
|
148
|
+
setSaving(false);
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
"data-testid": testId,
|
|
152
|
+
children: [
|
|
153
|
+
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-sm font-semibold", children: l.title }),
|
|
154
|
+
drafts.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: l.empty }),
|
|
155
|
+
/* @__PURE__ */ jsxRuntime.jsx("ul", { className: "space-y-2", children: drafts.map((d, i) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
156
|
+
"li",
|
|
157
|
+
{
|
|
158
|
+
className: "flex flex-wrap items-center gap-2",
|
|
159
|
+
"data-testid": `${testId}-column-${i}`,
|
|
160
|
+
children: [
|
|
161
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
162
|
+
ui.Input,
|
|
163
|
+
{
|
|
164
|
+
className: "h-8 w-48",
|
|
165
|
+
value: d.name,
|
|
166
|
+
placeholder: l.name,
|
|
167
|
+
"aria-label": l.name,
|
|
168
|
+
onChange: (e) => patch(i, { name: e.target.value }),
|
|
169
|
+
"data-testid": `${testId}-name-${i}`
|
|
170
|
+
}
|
|
171
|
+
),
|
|
172
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
173
|
+
"select",
|
|
174
|
+
{
|
|
175
|
+
className: ui.cn(input, "w-32"),
|
|
176
|
+
value: d.type,
|
|
177
|
+
disabled: !!d.id,
|
|
178
|
+
"aria-label": l.type,
|
|
179
|
+
onChange: (e) => patch(i, { type: e.target.value }),
|
|
180
|
+
"data-testid": `${testId}-type-${i}`,
|
|
181
|
+
children: (TYPES.includes(d.type) ? TYPES : [d.type, ...TYPES]).map((t) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: t, children: l.types[t] }, t))
|
|
182
|
+
}
|
|
183
|
+
),
|
|
184
|
+
d.type === "select" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
185
|
+
ui.Input,
|
|
186
|
+
{
|
|
187
|
+
className: "h-8 min-w-48 flex-1",
|
|
188
|
+
value: d.options,
|
|
189
|
+
placeholder: l.optionsPlaceholder,
|
|
190
|
+
"aria-label": l.options,
|
|
191
|
+
onChange: (e) => patch(i, { options: e.target.value }),
|
|
192
|
+
"data-testid": `${testId}-options-${i}`
|
|
193
|
+
}
|
|
194
|
+
),
|
|
195
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ml-auto flex items-center", children: [
|
|
196
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
197
|
+
ui.Button,
|
|
198
|
+
{
|
|
199
|
+
type: "button",
|
|
200
|
+
variant: "ghost",
|
|
201
|
+
size: "icon",
|
|
202
|
+
disabled: i === 0,
|
|
203
|
+
"aria-label": l.moveUp,
|
|
204
|
+
onClick: () => move(i, -1),
|
|
205
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowUp, { className: "size-4" })
|
|
206
|
+
}
|
|
207
|
+
),
|
|
208
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
209
|
+
ui.Button,
|
|
210
|
+
{
|
|
211
|
+
type: "button",
|
|
212
|
+
variant: "ghost",
|
|
213
|
+
size: "icon",
|
|
214
|
+
disabled: i === drafts.length - 1,
|
|
215
|
+
"aria-label": l.moveDown,
|
|
216
|
+
onClick: () => move(i, 1),
|
|
217
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowDown, { className: "size-4" })
|
|
218
|
+
}
|
|
219
|
+
),
|
|
220
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
221
|
+
ui.Button,
|
|
222
|
+
{
|
|
223
|
+
type: "button",
|
|
224
|
+
variant: "ghost",
|
|
225
|
+
size: "icon",
|
|
226
|
+
"aria-label": l.remove,
|
|
227
|
+
onClick: () => setDrafts((ds) => ds.filter((_, j) => j !== i)),
|
|
228
|
+
"data-testid": `${testId}-remove-${i}`,
|
|
229
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "size-4" })
|
|
230
|
+
}
|
|
231
|
+
)
|
|
232
|
+
] })
|
|
233
|
+
]
|
|
234
|
+
},
|
|
235
|
+
d.id ?? `new-${i}`
|
|
236
|
+
)) }),
|
|
237
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
238
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
239
|
+
ui.Button,
|
|
240
|
+
{
|
|
241
|
+
type: "button",
|
|
242
|
+
variant: "outline",
|
|
243
|
+
size: "sm",
|
|
244
|
+
onClick: () => setDrafts((ds) => [...ds, { name: "", type: "text", options: "" }]),
|
|
245
|
+
"data-testid": `${testId}-add`,
|
|
246
|
+
children: [
|
|
247
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { className: "size-4" }),
|
|
248
|
+
" ",
|
|
249
|
+
l.addColumn
|
|
250
|
+
]
|
|
251
|
+
}
|
|
252
|
+
),
|
|
253
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ml-auto flex items-center gap-2", children: [
|
|
254
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Button, { type: "button", variant: "ghost", size: "sm", onClick: onCancel, children: l.cancel }),
|
|
255
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
256
|
+
ui.Button,
|
|
257
|
+
{
|
|
258
|
+
type: "submit",
|
|
259
|
+
size: "sm",
|
|
260
|
+
disabled: !valid || saving,
|
|
261
|
+
"data-testid": `${testId}-save`,
|
|
262
|
+
children: [
|
|
263
|
+
saving && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "size-4 animate-spin" }),
|
|
264
|
+
saving ? l.saving : l.save
|
|
265
|
+
]
|
|
266
|
+
}
|
|
267
|
+
)
|
|
268
|
+
] })
|
|
269
|
+
] })
|
|
270
|
+
]
|
|
271
|
+
}
|
|
272
|
+
);
|
|
273
|
+
}
|
|
274
|
+
var DEFAULT_TAG_TABLE_LABELS = {
|
|
77
275
|
row: "Item",
|
|
78
276
|
evidence: "Evidence",
|
|
79
277
|
documents: "{count} documents",
|
|
@@ -95,13 +293,14 @@ var DEFAULT_TAG_MATRIX_LABELS = {
|
|
|
95
293
|
exporting: "Exporting\u2026",
|
|
96
294
|
empty: "No rows yet.",
|
|
97
295
|
loading: "Loading\u2026",
|
|
98
|
-
noColumns: "No
|
|
296
|
+
noColumns: "No columns yet: add one to give each row a value.",
|
|
99
297
|
choose: "\u2014",
|
|
100
|
-
yes: "Yes"
|
|
298
|
+
yes: "Yes",
|
|
299
|
+
editColumns: "Columns"
|
|
101
300
|
};
|
|
102
301
|
var ROW_LABEL_WIDTH = "w-[18rem] min-w-[12rem] max-w-[18rem]";
|
|
103
302
|
var ROW_LABEL = "line-clamp-3 whitespace-normal break-words";
|
|
104
|
-
function
|
|
303
|
+
function TagTableCell({
|
|
105
304
|
row,
|
|
106
305
|
column,
|
|
107
306
|
people,
|
|
@@ -114,7 +313,7 @@ function TagMatrixCell({
|
|
|
114
313
|
const shown = cellText(value, column, nameOf);
|
|
115
314
|
const [draft, setDraft] = react.useState(shown);
|
|
116
315
|
react.useEffect(() => setDraft(cellText(value, column)), [value, column]);
|
|
117
|
-
const set = (next) => void onChange?.(row.
|
|
316
|
+
const set = (next) => void onChange?.(row.external_id, column.id, next);
|
|
118
317
|
if (!onChange)
|
|
119
318
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "block truncate", title: shown, "data-testid": testId, children: shown || /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: l.choose }) });
|
|
120
319
|
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";
|
|
@@ -125,7 +324,7 @@ function TagMatrixCell({
|
|
|
125
324
|
{
|
|
126
325
|
checked: value === true,
|
|
127
326
|
onCheckedChange: (v) => set(v === true),
|
|
128
|
-
"aria-label": `${row.
|
|
327
|
+
"aria-label": `${row.name}: ${column.name}`,
|
|
129
328
|
"data-testid": testId
|
|
130
329
|
}
|
|
131
330
|
);
|
|
@@ -138,7 +337,7 @@ function TagMatrixCell({
|
|
|
138
337
|
className: ui.cn(field, "min-w-32 pr-6"),
|
|
139
338
|
value: typeof value === "string" ? value : "",
|
|
140
339
|
onChange: (e) => set(e.target.value || null),
|
|
141
|
-
"aria-label": `${row.
|
|
340
|
+
"aria-label": `${row.name}: ${column.name}`,
|
|
142
341
|
"data-testid": testId,
|
|
143
342
|
children: [
|
|
144
343
|
/* @__PURE__ */ jsxRuntime.jsx("option", { value: "", children: l.choose }),
|
|
@@ -164,7 +363,7 @@ function TagMatrixCell({
|
|
|
164
363
|
if (e.key === "Enter") e.target.blur();
|
|
165
364
|
if (e.key === "Escape") setDraft(cellText(value, column));
|
|
166
365
|
},
|
|
167
|
-
"aria-label": `${row.
|
|
366
|
+
"aria-label": `${row.name}: ${column.name}`,
|
|
168
367
|
"data-testid": testId
|
|
169
368
|
}
|
|
170
369
|
);
|
|
@@ -194,16 +393,17 @@ function Evidence({
|
|
|
194
393
|
]
|
|
195
394
|
}
|
|
196
395
|
);
|
|
197
|
-
const
|
|
198
|
-
const
|
|
199
|
-
const
|
|
200
|
-
const
|
|
396
|
+
const links = rowLinks(row);
|
|
397
|
+
const docs = links.docs ?? [];
|
|
398
|
+
const facts = links.facts ?? [];
|
|
399
|
+
const threads = links.threads ?? [];
|
|
400
|
+
const more = links.doc_count - docs.length + (links.fact_count - facts.length) + (links.thread_count - threads.length);
|
|
201
401
|
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";
|
|
202
402
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center gap-1", "data-testid": testId, children: [
|
|
203
403
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "mr-1 text-xs text-muted-foreground", children: [
|
|
204
|
-
countText(
|
|
205
|
-
countText(
|
|
206
|
-
countText(
|
|
404
|
+
countText(links.doc_count, l.document, l.documents),
|
|
405
|
+
countText(links.fact_count, l.fact, l.facts),
|
|
406
|
+
countText(links.thread_count, l.thread, l.threads)
|
|
207
407
|
].filter(Boolean).join(" \xB7 ") }),
|
|
208
408
|
docs.map((d) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
209
409
|
"button",
|
|
@@ -258,18 +458,19 @@ function Evidence({
|
|
|
258
458
|
{
|
|
259
459
|
type: "button",
|
|
260
460
|
className: "text-xs text-primary hover:underline",
|
|
261
|
-
onClick: () => onOpenRow(row.
|
|
461
|
+
onClick: () => onOpenRow(row.external_id),
|
|
262
462
|
"data-testid": `${testId}-more`,
|
|
263
463
|
children: l.more.replace("{count}", String(more))
|
|
264
464
|
}
|
|
265
465
|
) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-muted-foreground", "data-testid": `${testId}-more`, children: l.more.replace("{count}", String(more)) }))
|
|
266
466
|
] });
|
|
267
467
|
}
|
|
268
|
-
function
|
|
269
|
-
|
|
468
|
+
function TagTable({
|
|
469
|
+
table,
|
|
270
470
|
isLoading,
|
|
271
471
|
onChangeValue,
|
|
272
472
|
onAddRow,
|
|
473
|
+
onChangeColumns,
|
|
273
474
|
onOpenDocument,
|
|
274
475
|
onOpenFact,
|
|
275
476
|
onOpenThread,
|
|
@@ -280,11 +481,12 @@ function TagMatrix({
|
|
|
280
481
|
actions,
|
|
281
482
|
labels,
|
|
282
483
|
className,
|
|
283
|
-
testId = "tag-
|
|
484
|
+
testId = "tag-table"
|
|
284
485
|
}) {
|
|
285
|
-
const l = { ...
|
|
286
|
-
const columns = react.useMemo(() =>
|
|
287
|
-
const rows =
|
|
486
|
+
const l = { ...DEFAULT_TAG_TABLE_LABELS, ...labels };
|
|
487
|
+
const columns = react.useMemo(() => table?.columns ?? [], [table]);
|
|
488
|
+
const rows = table?.rows ?? [];
|
|
489
|
+
const [editingColumns, setEditingColumns] = react.useState(false);
|
|
288
490
|
const gaps = rows.filter(isGap).length;
|
|
289
491
|
const [gapsOnly, setGapsOnly] = react.useState(false);
|
|
290
492
|
const [name, setName] = react.useState("");
|
|
@@ -322,6 +524,20 @@ function TagMatrix({
|
|
|
322
524
|
] }),
|
|
323
525
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ml-auto flex flex-wrap items-center gap-2", children: [
|
|
324
526
|
actions,
|
|
527
|
+
onChangeColumns && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
528
|
+
ui.Button,
|
|
529
|
+
{
|
|
530
|
+
variant: "outline",
|
|
531
|
+
size: "sm",
|
|
532
|
+
"aria-pressed": editingColumns,
|
|
533
|
+
onClick: () => setEditingColumns((v) => !v),
|
|
534
|
+
"data-testid": `${testId}-edit-columns`,
|
|
535
|
+
children: [
|
|
536
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.SlidersHorizontal, { className: "size-4" }),
|
|
537
|
+
l.editColumns
|
|
538
|
+
]
|
|
539
|
+
}
|
|
540
|
+
),
|
|
325
541
|
onDownload && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
326
542
|
ui.Button,
|
|
327
543
|
{
|
|
@@ -359,6 +575,19 @@ function TagMatrix({
|
|
|
359
575
|
)
|
|
360
576
|
] })
|
|
361
577
|
] }),
|
|
578
|
+
editingColumns && onChangeColumns && /* @__PURE__ */ jsxRuntime.jsx(
|
|
579
|
+
TagColumnsEditor,
|
|
580
|
+
{
|
|
581
|
+
columns,
|
|
582
|
+
labels: l.columns,
|
|
583
|
+
onCancel: () => setEditingColumns(false),
|
|
584
|
+
onSave: async (fields) => {
|
|
585
|
+
await onChangeColumns(fields);
|
|
586
|
+
setEditingColumns(false);
|
|
587
|
+
},
|
|
588
|
+
testId: `${testId}-columns`
|
|
589
|
+
}
|
|
590
|
+
),
|
|
362
591
|
isLoading ? /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
|
|
363
592
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "size-4 animate-spin" }),
|
|
364
593
|
" ",
|
|
@@ -389,7 +618,7 @@ function TagMatrix({
|
|
|
389
618
|
] }) }),
|
|
390
619
|
/* @__PURE__ */ jsxRuntime.jsxs("tbody", { children: [
|
|
391
620
|
shown.map((row) => {
|
|
392
|
-
const id = row.
|
|
621
|
+
const id = row.external_id;
|
|
393
622
|
const gap = isGap(row);
|
|
394
623
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
395
624
|
"tr",
|
|
@@ -413,24 +642,24 @@ function TagMatrix({
|
|
|
413
642
|
{
|
|
414
643
|
type: "button",
|
|
415
644
|
className: ui.cn(ROW_LABEL, "text-left hover:text-primary hover:underline"),
|
|
416
|
-
title: row.
|
|
645
|
+
title: row.name,
|
|
417
646
|
onClick: () => onOpenRow(id),
|
|
418
647
|
"data-testid": `${testId}-row-${id}-label`,
|
|
419
|
-
children: row.
|
|
648
|
+
children: row.name
|
|
420
649
|
}
|
|
421
650
|
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
422
651
|
"span",
|
|
423
652
|
{
|
|
424
653
|
className: ROW_LABEL,
|
|
425
|
-
title: row.
|
|
654
|
+
title: row.name,
|
|
426
655
|
"data-testid": `${testId}-row-${id}-label`,
|
|
427
|
-
children: row.
|
|
656
|
+
children: row.name
|
|
428
657
|
}
|
|
429
658
|
)
|
|
430
659
|
}
|
|
431
660
|
),
|
|
432
661
|
columns.map((c) => /* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-1.5 py-1", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
433
|
-
|
|
662
|
+
TagTableCell,
|
|
434
663
|
{
|
|
435
664
|
row,
|
|
436
665
|
column: c,
|
|
@@ -509,8 +738,8 @@ function TagMatrix({
|
|
|
509
738
|
] });
|
|
510
739
|
}
|
|
511
740
|
var DOCX_MIME_TYPE = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
|
|
512
|
-
var
|
|
513
|
-
var
|
|
741
|
+
var TAG_TABLE_DOCX_LANDSCAPE_AFTER = 6;
|
|
742
|
+
var DEFAULT_TAG_TABLE_DOCX_LABELS = {
|
|
514
743
|
row: "Item",
|
|
515
744
|
evidence: "Evidence",
|
|
516
745
|
gaps: "Gaps",
|
|
@@ -539,40 +768,46 @@ var cell = (paragraphs, width, fill) => `<w:tc><w:tcPr><w:tcW w:w="${width}" w:t
|
|
|
539
768
|
var count = (n, one, many) => n === 1 ? one : many.replace("{count}", String(n));
|
|
540
769
|
function evidenceParagraphs(row, l) {
|
|
541
770
|
if (isGap(row)) return [];
|
|
542
|
-
const
|
|
543
|
-
const
|
|
544
|
-
const
|
|
545
|
-
const
|
|
771
|
+
const links = rowLinks(row);
|
|
772
|
+
const docs = links.docs ?? [];
|
|
773
|
+
const facts = links.facts ?? [];
|
|
774
|
+
const threads = links.threads ?? [];
|
|
775
|
+
const more = links.doc_count - docs.length + (links.fact_count - facts.length) + (links.thread_count - threads.length);
|
|
546
776
|
return [
|
|
547
777
|
paragraph(
|
|
548
778
|
[
|
|
549
779
|
{
|
|
550
780
|
text: [
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
781
|
+
links.doc_count ? count(links.doc_count, l.document, l.documents) : null,
|
|
782
|
+
links.fact_count ? count(links.fact_count, l.fact, l.facts) : null,
|
|
783
|
+
links.thread_count ? count(links.thread_count, l.thread, l.threads) : null
|
|
554
784
|
].filter(Boolean).join(" \xB7 "),
|
|
555
785
|
muted: true
|
|
556
786
|
}
|
|
557
787
|
],
|
|
558
|
-
"
|
|
788
|
+
"TagTableCell"
|
|
559
789
|
),
|
|
560
790
|
...docs.map(
|
|
561
791
|
(d) => paragraph(
|
|
562
792
|
[{ text: d.file_name, bold: true }, ...d.note ? [{ text: ` \u2014 ${d.note}` }] : []],
|
|
563
|
-
"
|
|
793
|
+
"TagTableCell"
|
|
564
794
|
)
|
|
565
795
|
),
|
|
566
|
-
...facts.map((f) => paragraph([{ text: `\u201C${f.text}\u201D`, italic: true }], "
|
|
567
|
-
...threads.map((t) => paragraph([{ text: t.title || l.untitledThread }], "
|
|
568
|
-
...more > 0 ? [
|
|
796
|
+
...facts.map((f) => paragraph([{ text: `\u201C${f.text}\u201D`, italic: true }], "TagTableCell")),
|
|
797
|
+
...threads.map((t) => paragraph([{ text: t.title || l.untitledThread }], "TagTableCell")),
|
|
798
|
+
...more > 0 ? [
|
|
799
|
+
paragraph(
|
|
800
|
+
[{ text: l.more.replace("{count}", String(more)), muted: true }],
|
|
801
|
+
"TagTableCell"
|
|
802
|
+
)
|
|
803
|
+
] : []
|
|
569
804
|
];
|
|
570
805
|
}
|
|
571
806
|
function gapParagraphs(row, columns, l) {
|
|
572
807
|
const missing = columns.filter((c) => c.type !== "checkbox" && cellText(cellValue(row, c), c) === "").map((c) => c.name);
|
|
573
808
|
return [
|
|
574
|
-
...isGap(row) ? [paragraph([{ text: l.noEvidence, bold: true }], "
|
|
575
|
-
...missing.length ? [paragraph([{ text: l.missing.replace("{fields}", missing.join(", ")) }], "
|
|
809
|
+
...isGap(row) ? [paragraph([{ text: l.noEvidence, bold: true }], "TagTableCell")] : [],
|
|
810
|
+
...missing.length ? [paragraph([{ text: l.missing.replace("{fields}", missing.join(", ")) }], "TagTableCell")] : []
|
|
576
811
|
];
|
|
577
812
|
}
|
|
578
813
|
function page(landscape) {
|
|
@@ -585,40 +820,41 @@ function page(landscape) {
|
|
|
585
820
|
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>`
|
|
586
821
|
};
|
|
587
822
|
}
|
|
588
|
-
function
|
|
589
|
-
const l = { ...
|
|
590
|
-
const columns =
|
|
591
|
-
const rows = matrix.rows ?? [];
|
|
823
|
+
function tagTableDocumentXml(table, options) {
|
|
824
|
+
const l = { ...DEFAULT_TAG_TABLE_DOCX_LABELS, ...options.labels };
|
|
825
|
+
const { columns, rows } = table;
|
|
592
826
|
const heads = [l.row, ...columns.map((c) => c.name), l.evidence, l.gaps];
|
|
593
|
-
const landscape = heads.length >
|
|
827
|
+
const landscape = heads.length > TAG_TABLE_DOCX_LANDSCAPE_AFTER;
|
|
594
828
|
const { textWidth, sectPr } = page(landscape);
|
|
595
829
|
const weights = [2, ...columns.map(() => 1), 3, 1.5];
|
|
596
830
|
const total = weights.reduce((a, b) => a + b, 0);
|
|
597
831
|
const widths = weights.map((w) => Math.floor(textWidth * w / total));
|
|
598
832
|
const at = new Date(options.at ?? Date.now()).toISOString().slice(0, 16).replace("T", " ");
|
|
599
|
-
const header = `<w:tr><w:trPr><w:tblHeader/><w:cantSplit/></w:trPr>${heads.map(
|
|
833
|
+
const header = `<w:tr><w:trPr><w:tblHeader/><w:cantSplit/></w:trPr>${heads.map(
|
|
834
|
+
(h, i) => cell([paragraph([{ text: h, bold: true }], "TagTableCell")], widths[i], "E7E6E6")
|
|
835
|
+
).join("")}</w:tr>`;
|
|
600
836
|
const body = rows.map((row) => {
|
|
601
837
|
const fill = isGap(row) ? "FFF2CC" : void 0;
|
|
602
838
|
const cells = [
|
|
603
|
-
cell([paragraph([{ text: row.
|
|
839
|
+
cell([paragraph([{ text: row.name, bold: true }], "TagTableCell")], widths[0], fill),
|
|
604
840
|
...columns.map((c, i) => {
|
|
605
841
|
const text = cellText(cellValue(row, c), c, options.nameOf);
|
|
606
|
-
return cell(text ? [paragraph([{ text }], "
|
|
842
|
+
return cell(text ? [paragraph([{ text }], "TagTableCell")] : [], widths[i + 1], fill);
|
|
607
843
|
}),
|
|
608
844
|
cell(evidenceParagraphs(row, l), widths[columns.length + 1], fill),
|
|
609
845
|
cell(gapParagraphs(row, columns, l), widths[columns.length + 2], fill)
|
|
610
846
|
];
|
|
611
847
|
return `<w:tr><w:trPr><w:cantSplit/></w:trPr>${cells.join("")}</w:tr>`;
|
|
612
848
|
});
|
|
613
|
-
const
|
|
849
|
+
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>`;
|
|
614
850
|
return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
615
851
|
<w:document xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"><w:body>${paragraph(
|
|
616
852
|
[{ text: options.title }],
|
|
617
853
|
"Title"
|
|
618
|
-
)}${paragraph([{ text: l.takenAt.replace("{at}", `${at} UTC`), muted: true }])}${
|
|
854
|
+
)}${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>`;
|
|
619
855
|
}
|
|
620
856
|
var STYLES = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
621
|
-
<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="
|
|
857
|
+
<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>`;
|
|
622
858
|
var CONTENT_TYPES = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
623
859
|
<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>`;
|
|
624
860
|
var ROOT_RELS = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
@@ -629,32 +865,34 @@ var coreXml = (title, at) => `<?xml version="1.0" encoding="UTF-8" standalone="y
|
|
|
629
865
|
<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(
|
|
630
866
|
title
|
|
631
867
|
)}</dc:title><dcterms:created xsi:type="dcterms:W3CDTF">${at}</dcterms:created><dcterms:modified xsi:type="dcterms:W3CDTF">${at}</dcterms:modified></cp:coreProperties>`;
|
|
632
|
-
function
|
|
868
|
+
function tagTableDocx(table, options) {
|
|
633
869
|
const at = new Date(options.at ?? Date.now()).toISOString().replace(/\.\d{3}Z$/, "Z");
|
|
634
870
|
return fflate.zipSync({
|
|
635
871
|
"[Content_Types].xml": fflate.strToU8(CONTENT_TYPES),
|
|
636
872
|
"_rels/.rels": fflate.strToU8(ROOT_RELS),
|
|
637
873
|
"docProps/core.xml": fflate.strToU8(coreXml(options.title, at)),
|
|
638
|
-
"word/document.xml": fflate.strToU8(
|
|
874
|
+
"word/document.xml": fflate.strToU8(tagTableDocumentXml(table, { ...options, at })),
|
|
639
875
|
"word/styles.xml": fflate.strToU8(STYLES),
|
|
640
876
|
"word/_rels/document.xml.rels": fflate.strToU8(DOCUMENT_RELS)
|
|
641
877
|
});
|
|
642
878
|
}
|
|
643
879
|
|
|
644
|
-
exports.
|
|
645
|
-
exports.
|
|
880
|
+
exports.DEFAULT_TAG_COLUMNS_EDITOR_LABELS = DEFAULT_TAG_COLUMNS_EDITOR_LABELS;
|
|
881
|
+
exports.DEFAULT_TAG_TABLE_DOCX_LABELS = DEFAULT_TAG_TABLE_DOCX_LABELS;
|
|
882
|
+
exports.DEFAULT_TAG_TABLE_LABELS = DEFAULT_TAG_TABLE_LABELS;
|
|
646
883
|
exports.DOCX_MIME_TYPE = DOCX_MIME_TYPE;
|
|
647
|
-
exports.
|
|
648
|
-
exports.
|
|
649
|
-
exports.
|
|
884
|
+
exports.TAG_TABLE_DOCX_LANDSCAPE_AFTER = TAG_TABLE_DOCX_LANDSCAPE_AFTER;
|
|
885
|
+
exports.TagColumnsEditor = TagColumnsEditor;
|
|
886
|
+
exports.TagTable = TagTable;
|
|
887
|
+
exports.TagTableCell = TagTableCell;
|
|
650
888
|
exports.cellText = cellText;
|
|
651
889
|
exports.cellValue = cellValue;
|
|
890
|
+
exports.fieldWrites = fieldWrites;
|
|
652
891
|
exports.isGap = isGap;
|
|
653
892
|
exports.parseCell = parseCell;
|
|
654
|
-
exports.
|
|
655
|
-
exports.
|
|
656
|
-
exports.
|
|
657
|
-
exports.
|
|
658
|
-
|
|
659
|
-
//# sourceMappingURL=chunk-
|
|
660
|
-
//# sourceMappingURL=chunk-ZQYE7J3J.cjs.map
|
|
893
|
+
exports.rowLinks = rowLinks;
|
|
894
|
+
exports.tagTableDocumentXml = tagTableDocumentXml;
|
|
895
|
+
exports.tagTableDocx = tagTableDocx;
|
|
896
|
+
exports.tagTableMarkdown = tagTableMarkdown;
|
|
897
|
+
//# sourceMappingURL=chunk-WRSBM6QN.cjs.map
|
|
898
|
+
//# sourceMappingURL=chunk-WRSBM6QN.cjs.map
|