camox 0.75.0 → 0.76.1
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/core/editing/createEditableBlock.js +1077 -1681
- package/dist/core/editing/fieldSlot.js +251 -0
- package/dist/core/editing/useFieldSlot.js +159 -0
- package/dist/core/layoutContext.d.ts +2 -0
- package/dist/core/layoutContext.js +27 -1
- package/dist/features/canvas/CanvasPageFrame.js +2 -2
- package/dist/features/canvas/CanvasPreviewPageSlot.js +1 -1
- package/dist/features/canvas/canvasCameraController.js +595 -0
- package/dist/features/canvas/useCanvasCamera.js +141 -587
- package/dist/features/canvas/useCanvasFrame.js +1 -1
- package/dist/features/page/DerivedPageContent.js +4 -8
- package/dist/features/preview/components/AssetLightbox.js +6 -65
- package/dist/features/preview/components/CanvasPreview.js +2 -2
- package/dist/features/preview/components/Frame.js +3 -3
- package/dist/features/preview/components/ItemFieldsEditor.js +376 -460
- package/dist/features/preview/components/Overlays.js +4 -9
- package/dist/features/preview/components/PreviewPanel.js +3 -3
- package/dist/features/preview/components/RemovedBlockPlaceholder.js +2 -2
- package/dist/features/preview/components/SelectionEditor.js +285 -339
- package/dist/features/preview/components/ZoomableImage.js +105 -0
- package/dist/features/preview/components/contentFieldSchema.js +3 -1
- package/dist/features/preview/components/useFieldWriter.js +30 -51
- package/dist/features/preview/components/useRecordView.js +3 -3
- package/dist/features/preview/overlayMessages.js +20 -58
- package/dist/features/preview/previewStore.js +6 -123
- package/dist/features/preview/repeatableItemPath.js +47 -0
- package/dist/features/provider/AuthenticatedCamoxProvider.js +75 -63
- package/dist/features/renderer/RendererApp.js +6 -6
- package/dist/features/renderer/RendererFrames.js +2 -2
- package/dist/features/renderer/rendererHost.js +1 -1
- package/dist/features/routes/pageRuntime.d.ts +8 -12
- package/dist/features/routes/pageRuntime.js +26 -106
- package/dist/features/runtime/pageApp.js +1 -1
- package/dist/features/runtime/pageRead.js +105 -0
- package/dist/features/runtime/reader.d.ts +25 -0
- package/dist/features/runtime/reader.js +142 -0
- package/dist/features/runtime/runtime.d.ts +9 -3
- package/dist/features/runtime/runtime.js +608 -776
- package/dist/features/sdkBundle/buildSdkBundle.d.ts +5 -0
- package/dist/features/sdkBundle/buildSdkBundle.js +9 -3
- package/dist/features/studio/components/ChatWidget.js +137 -121
- package/dist/features/studio/components/ClearThread.js +121 -0
- package/dist/features/studio/components/DeleteDraftDialog.js +67 -65
- package/dist/features/studio/components/DraftBar.js +60 -49
- package/dist/features/studio/components/DraftNotices.js +149 -0
- package/dist/features/studio/components/DraftsControl.js +217 -180
- package/dist/features/studio/components/DraftsSheet.js +446 -0
- package/dist/features/studio/components/PublishedTab.js +511 -0
- package/dist/features/studio/components/ReviewDraftDialog.js +104 -89
- package/dist/features/studio/components/SheetTable.js +46 -0
- package/dist/features/studio/components/Specialists.js +1 -1
- package/dist/features/studio/components/ThreadMessages.js +227 -176
- package/dist/features/studio/draftLabel.js +15 -1
- package/dist/features/studio/draftNotice.js +1 -0
- package/dist/features/studio/showInCanvas.js +9 -19
- package/dist/features/studio/studioStore.js +5 -5
- package/dist/features/studio/useArchiveDraft.js +60 -0
- package/dist/features/studio/useEditorSelection.js +8 -19
- package/dist/features/studio/useRestoreDraft.js +70 -0
- package/dist/features/studio/viewSwitch.js +19 -11
- package/dist/lib/draft-scope.d.ts +1 -1
- package/dist/lib/draft-scope.js +6 -3
- package/dist/lib/queries.js +12 -1
- package/dist/lib/studio-reads.js +22 -0
- package/dist/lib/use-project-room.js +19 -13
- package/dist/lib/use-thread.js +1 -1
- package/dist/package.js +1 -1
- package/dist/studio.css +1 -1
- package/package.json +4 -4
- package/dist/core/hooks/useFieldSelection.js +0 -67
- package/dist/core/hooks/useIsEditable.js +0 -21
- package/dist/core/hooks/useOverlayMessage.js +0 -70
|
@@ -0,0 +1,446 @@
|
|
|
1
|
+
import { reads, useReadQuery } from "../../../lib/studio-reads.js";
|
|
2
|
+
import { useRestoreDraft } from "../useRestoreDraft.js";
|
|
3
|
+
import { daysLeft, draftLabel, timeAgo } from "../draftLabel.js";
|
|
4
|
+
import { DeleteDraftDialog } from "./DeleteDraftDialog.js";
|
|
5
|
+
import { Td, Th } from "./SheetTable.js";
|
|
6
|
+
import { PublishedTab } from "./PublishedTab.js";
|
|
7
|
+
import { c } from "react/compiler-runtime";
|
|
8
|
+
import * as React from "react";
|
|
9
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
import { Button } from "@camox/ui/button";
|
|
11
|
+
import { Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle } from "@camox/ui/sheet";
|
|
12
|
+
import { Spinner } from "@camox/ui/spinner";
|
|
13
|
+
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@camox/ui/tabs";
|
|
14
|
+
|
|
15
|
+
//#region src/features/studio/components/DraftsSheet.tsx
|
|
16
|
+
/**
|
|
17
|
+
* The drafts no longer in progress, opened from the draft picker: a tab of archived drafts to
|
|
18
|
+
* restore or delete (ADR 0046), and a tab of Publications, to read why Live changed (ADR 0045).
|
|
19
|
+
*/
|
|
20
|
+
function DraftsSheet(t0) {
|
|
21
|
+
const $ = c(36);
|
|
22
|
+
const { projectId, open, onOpenChange } = t0;
|
|
23
|
+
let t1;
|
|
24
|
+
if ($[0] !== projectId) {
|
|
25
|
+
t1 = reads.archivedDrafts({ projectId });
|
|
26
|
+
$[0] = projectId;
|
|
27
|
+
$[1] = t1;
|
|
28
|
+
} else t1 = $[1];
|
|
29
|
+
let t2;
|
|
30
|
+
if ($[2] !== open) {
|
|
31
|
+
t2 = { enabled: open };
|
|
32
|
+
$[2] = open;
|
|
33
|
+
$[3] = t2;
|
|
34
|
+
} else t2 = $[3];
|
|
35
|
+
const archived = useReadQuery(t1, t2);
|
|
36
|
+
let t3;
|
|
37
|
+
if ($[4] !== projectId) {
|
|
38
|
+
t3 = reads.publications({ projectId });
|
|
39
|
+
$[4] = projectId;
|
|
40
|
+
$[5] = t3;
|
|
41
|
+
} else t3 = $[5];
|
|
42
|
+
let t4;
|
|
43
|
+
if ($[6] !== open) {
|
|
44
|
+
t4 = { enabled: open };
|
|
45
|
+
$[6] = open;
|
|
46
|
+
$[7] = t4;
|
|
47
|
+
} else t4 = $[7];
|
|
48
|
+
const publications = useReadQuery(t3, t4);
|
|
49
|
+
let t5;
|
|
50
|
+
if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
|
|
51
|
+
t5 = /* @__PURE__ */ jsxs(SheetHeader, {
|
|
52
|
+
className: "border-b",
|
|
53
|
+
children: [/* @__PURE__ */ jsx(SheetTitle, { children: "Drafts" }), /* @__PURE__ */ jsx(SheetDescription, { children: "Drafts set aside, to bring back or delete, and what was published." })]
|
|
54
|
+
});
|
|
55
|
+
$[8] = t5;
|
|
56
|
+
} else t5 = $[8];
|
|
57
|
+
const t6 = archived.data?.length;
|
|
58
|
+
let t7;
|
|
59
|
+
if ($[9] !== t6) {
|
|
60
|
+
t7 = /* @__PURE__ */ jsxs(TabsTrigger, {
|
|
61
|
+
value: "archived",
|
|
62
|
+
children: ["Archived ", /* @__PURE__ */ jsx(TabCount, { count: t6 })]
|
|
63
|
+
});
|
|
64
|
+
$[9] = t6;
|
|
65
|
+
$[10] = t7;
|
|
66
|
+
} else t7 = $[10];
|
|
67
|
+
const t8 = publications.data?.length;
|
|
68
|
+
let t9;
|
|
69
|
+
if ($[11] !== t8) {
|
|
70
|
+
t9 = /* @__PURE__ */ jsxs(TabsTrigger, {
|
|
71
|
+
value: "published",
|
|
72
|
+
children: ["Published ", /* @__PURE__ */ jsx(TabCount, { count: t8 })]
|
|
73
|
+
});
|
|
74
|
+
$[11] = t8;
|
|
75
|
+
$[12] = t9;
|
|
76
|
+
} else t9 = $[12];
|
|
77
|
+
let t10;
|
|
78
|
+
if ($[13] !== t7 || $[14] !== t9) {
|
|
79
|
+
t10 = /* @__PURE__ */ jsxs(TabsList, { children: [t7, t9] });
|
|
80
|
+
$[13] = t7;
|
|
81
|
+
$[14] = t9;
|
|
82
|
+
$[15] = t10;
|
|
83
|
+
} else t10 = $[15];
|
|
84
|
+
let t11;
|
|
85
|
+
if ($[16] !== onOpenChange || $[17] !== open || $[18] !== projectId) {
|
|
86
|
+
t11 = open && /* @__PURE__ */ jsx(ArchivedDrafts, {
|
|
87
|
+
projectId,
|
|
88
|
+
onRestored: () => onOpenChange(false)
|
|
89
|
+
});
|
|
90
|
+
$[16] = onOpenChange;
|
|
91
|
+
$[17] = open;
|
|
92
|
+
$[18] = projectId;
|
|
93
|
+
$[19] = t11;
|
|
94
|
+
} else t11 = $[19];
|
|
95
|
+
let t12;
|
|
96
|
+
if ($[20] !== t11) {
|
|
97
|
+
t12 = /* @__PURE__ */ jsx(TabsContent, {
|
|
98
|
+
value: "archived",
|
|
99
|
+
className: "overflow-y-auto",
|
|
100
|
+
children: t11
|
|
101
|
+
});
|
|
102
|
+
$[20] = t11;
|
|
103
|
+
$[21] = t12;
|
|
104
|
+
} else t12 = $[21];
|
|
105
|
+
let t13;
|
|
106
|
+
if ($[22] !== onOpenChange || $[23] !== open || $[24] !== projectId) {
|
|
107
|
+
t13 = open && /* @__PURE__ */ jsx(PublishedTab, {
|
|
108
|
+
projectId,
|
|
109
|
+
onEntered: () => onOpenChange(false)
|
|
110
|
+
});
|
|
111
|
+
$[22] = onOpenChange;
|
|
112
|
+
$[23] = open;
|
|
113
|
+
$[24] = projectId;
|
|
114
|
+
$[25] = t13;
|
|
115
|
+
} else t13 = $[25];
|
|
116
|
+
let t14;
|
|
117
|
+
if ($[26] !== t13) {
|
|
118
|
+
t14 = /* @__PURE__ */ jsx(TabsContent, {
|
|
119
|
+
value: "published",
|
|
120
|
+
className: "overflow-y-auto",
|
|
121
|
+
children: t13
|
|
122
|
+
});
|
|
123
|
+
$[26] = t13;
|
|
124
|
+
$[27] = t14;
|
|
125
|
+
} else t14 = $[27];
|
|
126
|
+
let t15;
|
|
127
|
+
if ($[28] !== t10 || $[29] !== t12 || $[30] !== t14) {
|
|
128
|
+
t15 = /* @__PURE__ */ jsxs(SheetContent, {
|
|
129
|
+
side: "right",
|
|
130
|
+
className: "gap-0 data-[side=right]:sm:max-w-3xl",
|
|
131
|
+
children: [t5, /* @__PURE__ */ jsxs(Tabs, {
|
|
132
|
+
defaultValue: "archived",
|
|
133
|
+
className: "flex-1 overflow-hidden p-4",
|
|
134
|
+
children: [
|
|
135
|
+
t10,
|
|
136
|
+
t12,
|
|
137
|
+
t14
|
|
138
|
+
]
|
|
139
|
+
})]
|
|
140
|
+
});
|
|
141
|
+
$[28] = t10;
|
|
142
|
+
$[29] = t12;
|
|
143
|
+
$[30] = t14;
|
|
144
|
+
$[31] = t15;
|
|
145
|
+
} else t15 = $[31];
|
|
146
|
+
let t16;
|
|
147
|
+
if ($[32] !== onOpenChange || $[33] !== open || $[34] !== t15) {
|
|
148
|
+
t16 = /* @__PURE__ */ jsx(Sheet, {
|
|
149
|
+
open,
|
|
150
|
+
onOpenChange,
|
|
151
|
+
children: t15
|
|
152
|
+
});
|
|
153
|
+
$[32] = onOpenChange;
|
|
154
|
+
$[33] = open;
|
|
155
|
+
$[34] = t15;
|
|
156
|
+
$[35] = t16;
|
|
157
|
+
} else t16 = $[35];
|
|
158
|
+
return t16;
|
|
159
|
+
}
|
|
160
|
+
/** How many items a tab holds, once they've loaded. */
|
|
161
|
+
function TabCount(t0) {
|
|
162
|
+
const $ = c(2);
|
|
163
|
+
const { count } = t0;
|
|
164
|
+
if (count === void 0) return null;
|
|
165
|
+
let t1;
|
|
166
|
+
if ($[0] !== count) {
|
|
167
|
+
t1 = /* @__PURE__ */ jsx("span", {
|
|
168
|
+
className: "text-muted-foreground tabular-nums",
|
|
169
|
+
children: count
|
|
170
|
+
});
|
|
171
|
+
$[0] = count;
|
|
172
|
+
$[1] = t1;
|
|
173
|
+
} else t1 = $[1];
|
|
174
|
+
return t1;
|
|
175
|
+
}
|
|
176
|
+
/** The archived drafts, each with Restore and Delete. */
|
|
177
|
+
function ArchivedDrafts(t0) {
|
|
178
|
+
const $ = c(29);
|
|
179
|
+
const { projectId, onRestored } = t0;
|
|
180
|
+
let t1;
|
|
181
|
+
if ($[0] !== projectId) {
|
|
182
|
+
t1 = reads.archivedDrafts({ projectId });
|
|
183
|
+
$[0] = projectId;
|
|
184
|
+
$[1] = t1;
|
|
185
|
+
} else t1 = $[1];
|
|
186
|
+
const archived = useReadQuery(t1);
|
|
187
|
+
const [deleting, setDeleting] = React.useState(null);
|
|
188
|
+
let t2;
|
|
189
|
+
if ($[2] !== onRestored) {
|
|
190
|
+
t2 = { onRestored };
|
|
191
|
+
$[2] = onRestored;
|
|
192
|
+
$[3] = t2;
|
|
193
|
+
} else t2 = $[3];
|
|
194
|
+
const { restore, restoring } = useRestoreDraft(projectId, t2);
|
|
195
|
+
if (!archived.data) {
|
|
196
|
+
let t3;
|
|
197
|
+
if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
|
|
198
|
+
t3 = /* @__PURE__ */ jsxs("div", {
|
|
199
|
+
className: "text-muted-foreground flex items-center gap-2 py-6 text-sm",
|
|
200
|
+
children: [/* @__PURE__ */ jsx(Spinner, { className: "size-3.5" }), " Loading..."]
|
|
201
|
+
});
|
|
202
|
+
$[4] = t3;
|
|
203
|
+
} else t3 = $[4];
|
|
204
|
+
return t3;
|
|
205
|
+
}
|
|
206
|
+
if (archived.data.length === 0) {
|
|
207
|
+
let t3;
|
|
208
|
+
if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
|
|
209
|
+
t3 = /* @__PURE__ */ jsx("p", {
|
|
210
|
+
className: "text-muted-foreground py-6 text-sm",
|
|
211
|
+
children: "No archived drafts."
|
|
212
|
+
});
|
|
213
|
+
$[5] = t3;
|
|
214
|
+
} else t3 = $[5];
|
|
215
|
+
return t3;
|
|
216
|
+
}
|
|
217
|
+
let t3;
|
|
218
|
+
let t4;
|
|
219
|
+
let t5;
|
|
220
|
+
let t6;
|
|
221
|
+
let t7;
|
|
222
|
+
let t8;
|
|
223
|
+
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
|
224
|
+
t3 = /* @__PURE__ */ jsx(Th, { children: "Name" });
|
|
225
|
+
t4 = /* @__PURE__ */ jsx(Th, { children: "Overview" });
|
|
226
|
+
t5 = /* @__PURE__ */ jsx(Th, { children: "Started by" });
|
|
227
|
+
t6 = /* @__PURE__ */ jsx(Th, { children: "Last activity" });
|
|
228
|
+
t7 = /* @__PURE__ */ jsx(Th, { children: "Archived by" });
|
|
229
|
+
t8 = /* @__PURE__ */ jsx(Th, { children: "Deleted in" });
|
|
230
|
+
$[6] = t3;
|
|
231
|
+
$[7] = t4;
|
|
232
|
+
$[8] = t5;
|
|
233
|
+
$[9] = t6;
|
|
234
|
+
$[10] = t7;
|
|
235
|
+
$[11] = t8;
|
|
236
|
+
} else {
|
|
237
|
+
t3 = $[6];
|
|
238
|
+
t4 = $[7];
|
|
239
|
+
t5 = $[8];
|
|
240
|
+
t6 = $[9];
|
|
241
|
+
t7 = $[10];
|
|
242
|
+
t8 = $[11];
|
|
243
|
+
}
|
|
244
|
+
let t9;
|
|
245
|
+
if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
|
|
246
|
+
t9 = /* @__PURE__ */ jsx("thead", {
|
|
247
|
+
className: "text-muted-foreground text-xs",
|
|
248
|
+
children: /* @__PURE__ */ jsxs("tr", { children: [
|
|
249
|
+
t3,
|
|
250
|
+
t4,
|
|
251
|
+
t5,
|
|
252
|
+
t6,
|
|
253
|
+
t7,
|
|
254
|
+
t8,
|
|
255
|
+
/* @__PURE__ */ jsx(Th, { children: /* @__PURE__ */ jsx("span", {
|
|
256
|
+
className: "sr-only",
|
|
257
|
+
children: "Actions"
|
|
258
|
+
}) })
|
|
259
|
+
] })
|
|
260
|
+
});
|
|
261
|
+
$[12] = t9;
|
|
262
|
+
} else t9 = $[12];
|
|
263
|
+
let t10;
|
|
264
|
+
if ($[13] !== archived.data || $[14] !== restore || $[15] !== restoring) {
|
|
265
|
+
let t11;
|
|
266
|
+
if ($[17] !== restore || $[18] !== restoring) {
|
|
267
|
+
t11 = (draft) => /* @__PURE__ */ jsx(ArchivedRow, {
|
|
268
|
+
draft,
|
|
269
|
+
restoring: restoring === draft.id,
|
|
270
|
+
onRestore: () => restore(draft.id, draftLabel(draft)),
|
|
271
|
+
onDelete: () => setDeleting(draft.id)
|
|
272
|
+
}, draft.id);
|
|
273
|
+
$[17] = restore;
|
|
274
|
+
$[18] = restoring;
|
|
275
|
+
$[19] = t11;
|
|
276
|
+
} else t11 = $[19];
|
|
277
|
+
t10 = archived.data.map(t11);
|
|
278
|
+
$[13] = archived.data;
|
|
279
|
+
$[14] = restore;
|
|
280
|
+
$[15] = restoring;
|
|
281
|
+
$[16] = t10;
|
|
282
|
+
} else t10 = $[16];
|
|
283
|
+
let t11;
|
|
284
|
+
if ($[20] !== t10) {
|
|
285
|
+
t11 = /* @__PURE__ */ jsxs("table", {
|
|
286
|
+
className: "w-full text-left text-sm",
|
|
287
|
+
children: [t9, /* @__PURE__ */ jsx("tbody", { children: t10 })]
|
|
288
|
+
});
|
|
289
|
+
$[20] = t10;
|
|
290
|
+
$[21] = t11;
|
|
291
|
+
} else t11 = $[21];
|
|
292
|
+
let t12;
|
|
293
|
+
if ($[22] === Symbol.for("react.memo_cache_sentinel")) {
|
|
294
|
+
t12 = (open) => {
|
|
295
|
+
if (!open) setDeleting(null);
|
|
296
|
+
};
|
|
297
|
+
$[22] = t12;
|
|
298
|
+
} else t12 = $[22];
|
|
299
|
+
let t13;
|
|
300
|
+
if ($[23] !== deleting || $[24] !== projectId) {
|
|
301
|
+
t13 = /* @__PURE__ */ jsx(DeleteDraftDialog, {
|
|
302
|
+
projectId,
|
|
303
|
+
draftId: deleting,
|
|
304
|
+
onOpenChange: t12
|
|
305
|
+
});
|
|
306
|
+
$[23] = deleting;
|
|
307
|
+
$[24] = projectId;
|
|
308
|
+
$[25] = t13;
|
|
309
|
+
} else t13 = $[25];
|
|
310
|
+
let t14;
|
|
311
|
+
if ($[26] !== t11 || $[27] !== t13) {
|
|
312
|
+
t14 = /* @__PURE__ */ jsxs(Fragment, { children: [t11, t13] });
|
|
313
|
+
$[26] = t11;
|
|
314
|
+
$[27] = t13;
|
|
315
|
+
$[28] = t14;
|
|
316
|
+
} else t14 = $[28];
|
|
317
|
+
return t14;
|
|
318
|
+
}
|
|
319
|
+
function ArchivedRow(t0) {
|
|
320
|
+
const $ = c(34);
|
|
321
|
+
const { draft, restoring, onRestore, onDelete } = t0;
|
|
322
|
+
let t1;
|
|
323
|
+
if ($[0] !== draft) {
|
|
324
|
+
t1 = draftLabel(draft);
|
|
325
|
+
$[0] = draft;
|
|
326
|
+
$[1] = t1;
|
|
327
|
+
} else t1 = $[1];
|
|
328
|
+
let t2;
|
|
329
|
+
if ($[2] !== t1) {
|
|
330
|
+
t2 = /* @__PURE__ */ jsx(Td, {
|
|
331
|
+
className: "font-medium",
|
|
332
|
+
children: t1
|
|
333
|
+
});
|
|
334
|
+
$[2] = t1;
|
|
335
|
+
$[3] = t2;
|
|
336
|
+
} else t2 = $[3];
|
|
337
|
+
const t3 = draft.overviewHeadline ?? "";
|
|
338
|
+
let t4;
|
|
339
|
+
if ($[4] !== t3) {
|
|
340
|
+
t4 = /* @__PURE__ */ jsx(Td, {
|
|
341
|
+
className: "text-muted-foreground",
|
|
342
|
+
children: t3
|
|
343
|
+
});
|
|
344
|
+
$[4] = t3;
|
|
345
|
+
$[5] = t4;
|
|
346
|
+
} else t4 = $[5];
|
|
347
|
+
let t5;
|
|
348
|
+
if ($[6] !== draft.createdBy.name) {
|
|
349
|
+
t5 = /* @__PURE__ */ jsx(Td, { children: draft.createdBy.name });
|
|
350
|
+
$[6] = draft.createdBy.name;
|
|
351
|
+
$[7] = t5;
|
|
352
|
+
} else t5 = $[7];
|
|
353
|
+
let t6;
|
|
354
|
+
if ($[8] !== draft.lastActivityAt) {
|
|
355
|
+
t6 = timeAgo(draft.lastActivityAt);
|
|
356
|
+
$[8] = draft.lastActivityAt;
|
|
357
|
+
$[9] = t6;
|
|
358
|
+
} else t6 = $[9];
|
|
359
|
+
let t7;
|
|
360
|
+
if ($[10] !== t6) {
|
|
361
|
+
t7 = /* @__PURE__ */ jsx(Td, { children: t6 });
|
|
362
|
+
$[10] = t6;
|
|
363
|
+
$[11] = t7;
|
|
364
|
+
} else t7 = $[11];
|
|
365
|
+
let t8;
|
|
366
|
+
if ($[12] !== draft.archivedBy.name) {
|
|
367
|
+
t8 = /* @__PURE__ */ jsx(Td, { children: draft.archivedBy.name });
|
|
368
|
+
$[12] = draft.archivedBy.name;
|
|
369
|
+
$[13] = t8;
|
|
370
|
+
} else t8 = $[13];
|
|
371
|
+
let t9;
|
|
372
|
+
if ($[14] !== draft.deletesAt) {
|
|
373
|
+
t9 = daysLeft(draft.deletesAt);
|
|
374
|
+
$[14] = draft.deletesAt;
|
|
375
|
+
$[15] = t9;
|
|
376
|
+
} else t9 = $[15];
|
|
377
|
+
let t10;
|
|
378
|
+
if ($[16] !== t9) {
|
|
379
|
+
t10 = /* @__PURE__ */ jsx(Td, { children: t9 });
|
|
380
|
+
$[16] = t9;
|
|
381
|
+
$[17] = t10;
|
|
382
|
+
} else t10 = $[17];
|
|
383
|
+
let t11;
|
|
384
|
+
if ($[18] !== onRestore || $[19] !== restoring) {
|
|
385
|
+
t11 = /* @__PURE__ */ jsx(Button, {
|
|
386
|
+
type: "button",
|
|
387
|
+
variant: "outline",
|
|
388
|
+
size: "sm",
|
|
389
|
+
disabled: restoring,
|
|
390
|
+
onClick: onRestore,
|
|
391
|
+
children: "Restore"
|
|
392
|
+
});
|
|
393
|
+
$[18] = onRestore;
|
|
394
|
+
$[19] = restoring;
|
|
395
|
+
$[20] = t11;
|
|
396
|
+
} else t11 = $[20];
|
|
397
|
+
let t12;
|
|
398
|
+
if ($[21] !== onDelete) {
|
|
399
|
+
t12 = /* @__PURE__ */ jsx(Button, {
|
|
400
|
+
type: "button",
|
|
401
|
+
variant: "ghost",
|
|
402
|
+
size: "sm",
|
|
403
|
+
onClick: onDelete,
|
|
404
|
+
children: "Delete"
|
|
405
|
+
});
|
|
406
|
+
$[21] = onDelete;
|
|
407
|
+
$[22] = t12;
|
|
408
|
+
} else t12 = $[22];
|
|
409
|
+
let t13;
|
|
410
|
+
if ($[23] !== t11 || $[24] !== t12) {
|
|
411
|
+
t13 = /* @__PURE__ */ jsx(Td, { children: /* @__PURE__ */ jsxs("div", {
|
|
412
|
+
className: "flex justify-end gap-2",
|
|
413
|
+
children: [t11, t12]
|
|
414
|
+
}) });
|
|
415
|
+
$[23] = t11;
|
|
416
|
+
$[24] = t12;
|
|
417
|
+
$[25] = t13;
|
|
418
|
+
} else t13 = $[25];
|
|
419
|
+
let t14;
|
|
420
|
+
if ($[26] !== t10 || $[27] !== t13 || $[28] !== t2 || $[29] !== t4 || $[30] !== t5 || $[31] !== t7 || $[32] !== t8) {
|
|
421
|
+
t14 = /* @__PURE__ */ jsxs("tr", {
|
|
422
|
+
className: "border-t align-top",
|
|
423
|
+
children: [
|
|
424
|
+
t2,
|
|
425
|
+
t4,
|
|
426
|
+
t5,
|
|
427
|
+
t7,
|
|
428
|
+
t8,
|
|
429
|
+
t10,
|
|
430
|
+
t13
|
|
431
|
+
]
|
|
432
|
+
});
|
|
433
|
+
$[26] = t10;
|
|
434
|
+
$[27] = t13;
|
|
435
|
+
$[28] = t2;
|
|
436
|
+
$[29] = t4;
|
|
437
|
+
$[30] = t5;
|
|
438
|
+
$[31] = t7;
|
|
439
|
+
$[32] = t8;
|
|
440
|
+
$[33] = t14;
|
|
441
|
+
} else t14 = $[33];
|
|
442
|
+
return t14;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
//#endregion
|
|
446
|
+
export { DraftsSheet };
|