camox 0.71.0 → 0.74.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/createApp.d.ts +4 -103
- package/dist/core/createApp.js +3 -24
- package/dist/core/createBlock.d.ts +2 -2
- package/dist/core/createBlock.js +41 -185
- package/dist/core/createLayout.d.ts +6 -77
- package/dist/core/createLayout.js +12 -50
- package/dist/core/editing/createEditableBlock.d.ts +9 -75
- package/dist/core/editing/createEditableBlock.js +258 -640
- package/dist/core/hooks/useIsEditable.js +2 -2
- package/dist/core/lib/artifactData.js +8 -3
- package/dist/core/lib/contentType.d.ts +23 -38
- package/dist/core/lib/contentType.js +34 -62
- package/dist/core/lib/iconTypes.d.ts +0 -3
- package/dist/core/lib/icons.js +63 -51
- package/dist/core/lib/recordScope.js +1 -1
- package/dist/features/canvas/CanvasOverlays.js +94 -176
- package/dist/features/canvas/CanvasPageFrame.js +62 -68
- package/dist/features/canvas/CanvasPreviewPageSlot.js +1 -3
- package/dist/features/canvas/canvasOverlayGeometry.js +1 -7
- package/dist/features/canvas/sidebar/CuratedPageInspector.js +3 -21
- package/dist/features/canvas/sidebar/LayoutPageBlocks.js +1 -2
- package/dist/features/canvas/useCanvasCamera.js +1 -1
- package/dist/features/canvas/useCanvasFrame.js +1 -1
- package/dist/features/content/ContentCollection.js +2 -2
- package/dist/features/content/collection-form.js +6 -7
- package/dist/features/page/CuratedPageContent.js +15 -24
- package/dist/features/page/UnplacedBlockContent.js +1 -6
- package/dist/features/preview/CamoxPreview.js +30 -33
- package/dist/features/preview/EditablePageContent.js +131 -151
- package/dist/features/preview/components/BlockActionsPopover.js +43 -152
- package/dist/features/preview/components/CanvasPreview.js +2 -2
- package/dist/features/preview/components/Frame.js +3 -3
- package/dist/features/preview/components/IconFieldEditor.js +1 -1
- package/dist/features/preview/components/ItemFieldsEditor.js +1 -3
- package/dist/features/preview/components/Overlays.js +18 -84
- package/dist/features/preview/components/PageInfo.js +121 -98
- package/dist/features/preview/components/PageTree.js +57 -103
- package/dist/features/preview/components/PreviewPanel.js +8 -11
- package/dist/features/preview/components/RecordCombobox.js +65 -78
- package/dist/features/preview/components/ReferenceFieldEditor.js +1 -19
- package/dist/features/preview/components/ReferenceListFieldEditor.js +1 -19
- package/dist/features/preview/components/RemovedBlockPlaceholder.js +2 -2
- package/dist/features/preview/components/SelectionEditor.js +6 -5
- package/dist/features/preview/components/useRepeatableItemActions.js +18 -24
- package/dist/features/preview/components/useUpdateBlockPosition.js +1 -1
- package/dist/features/preview/overlayMessages.js +1 -4
- package/dist/features/preview/previewStore.js +3 -23
- package/dist/features/renderer/RendererApp.js +17 -141
- package/dist/features/renderer/definitionAnswers.js +1 -8
- package/dist/features/renderer/rendererHost.js +1 -31
- package/dist/features/renderer/studioConnection.js +1 -25
- package/dist/features/routes/pageRuntime.js +15 -4
- package/dist/features/runtime/ClaimCard.js +192 -0
- package/dist/features/runtime/pageApp.js +5 -4
- package/dist/features/runtime/runtime.js +29 -8
- package/dist/features/runtime/worker.js +2 -2
- package/dist/features/runtime/workerRequest.d.ts +6 -0
- package/dist/features/runtime/workerRequest.js +13 -1
- package/dist/features/runtime/workerRuntime.d.ts +2 -2
- package/dist/features/runtime/workerRuntime.js +2 -2
- package/dist/features/studio/components/AgentSidebar.js +7 -7
- package/dist/features/studio/components/ChatWidget.js +142 -106
- package/dist/features/studio/components/ContentFindings.js +127 -230
- package/dist/features/studio/components/DeleteDraftDialog.js +112 -0
- package/dist/features/studio/components/DraftBar.js +98 -53
- package/dist/features/studio/components/DraftsControl.js +203 -190
- package/dist/features/studio/components/ReviewDraftDialog.js +670 -0
- package/dist/features/studio/components/{Patrol.js → Specialists.js} +291 -330
- package/dist/features/studio/components/Squareling.js +5 -5
- package/dist/features/studio/components/ThreadComposer.js +106 -127
- package/dist/features/studio/components/ThreadMessages.js +137 -45
- package/dist/features/studio/findingSentence.js +14 -12
- package/dist/features/studio/fixMessage.js +23 -0
- package/dist/features/studio/reportSentence.js +1 -1
- package/dist/features/studio/{patrollerBio.js → specialistBio.js} +8 -5
- package/dist/features/studio/studioStore.js +29 -15
- package/dist/features/studio/workingSentence.js +1 -1
- package/dist/features/vite/blockBoilerplate.js +1 -1
- package/dist/features/vite/definitionsSync.js +1 -8
- package/dist/lib/api-client.js +5 -1
- package/dist/lib/queries.js +5 -6
- package/dist/lib/studio-definitions.js +0 -2
- package/dist/lib/studio-reads.d.ts +1 -1
- package/dist/lib/studio-reads.js +5 -10
- package/dist/lib/use-thread.js +196 -138
- package/dist/package.js +1 -1
- package/dist/studio-overlays.css +0 -29
- package/dist/studio.css +1 -1
- package/package.json +4 -4
- package/skills/camox/SKILL.md +1 -1
- package/skills/camox/references/artifacts.md +4 -4
- package/skills/camox/references/block-definitions.md +21 -25
- package/skills/camox/references/dom-integrations.md +1 -1
- package/skills/camox/references/layout-definitions.md +3 -12
- package/skills/camox/references/routed-layouts.md +2 -2
- package/skills/camox-expand/SKILL.md +5 -5
- package/skills/camoxify/SKILL.md +4 -4
- package/dist/features/canvas/canvasInsertionSeams.js +0 -44
- package/dist/features/preview/components/AddBlockSheet.js +0 -314
- package/dist/features/preview/components/BlockPeek.js +0 -66
- package/dist/features/preview/components/BlockThumbnail.js +0 -281
- package/dist/features/preview/components/blockGridNavigation.js +0 -15
- package/dist/features/preview/referencePickerFocus.js +0 -29
- package/dist/features/studio/components/ReviewDraftSheet.js +0 -1587
|
@@ -5,33 +5,33 @@ import { useNavigate } from "../../navigation/navigation.js";
|
|
|
5
5
|
import { AuthContext } from "../../../lib/auth.js";
|
|
6
6
|
import { reads, useReadQuery } from "../../../lib/studio-reads.js";
|
|
7
7
|
import { cn } from "../../../lib/utils.js";
|
|
8
|
-
import {
|
|
8
|
+
import { specialistMutations } from "../../../lib/queries.js";
|
|
9
9
|
import { AssetLightbox } from "../../preview/components/AssetLightbox.js";
|
|
10
10
|
import { BOTTOM_CARD_EDGES, CARD_BODY_EDGES } from "../../preview/components/SidebarStack.js";
|
|
11
11
|
import { editCollectionItemPath } from "../routes.js";
|
|
12
12
|
import { studioStore } from "../studioStore.js";
|
|
13
|
-
import {
|
|
13
|
+
import { dismissLabel, dismissedSentence, findingSentence, fixWithAgentMessage } from "../findingSentence.js";
|
|
14
14
|
import { useShowInCanvas } from "../showInCanvas.js";
|
|
15
15
|
import { Squareling } from "./Squareling.js";
|
|
16
|
-
import { aboutSentence, whenTag } from "../patrollerBio.js";
|
|
17
16
|
import { moreSentence, reportSentence, shortTimeAgo, whereReportLeads } from "../reportSentence.js";
|
|
17
|
+
import { aboutSentence, whenTag } from "../specialistBio.js";
|
|
18
18
|
import { workingSentence } from "../workingSentence.js";
|
|
19
19
|
import { c } from "react/compiler-runtime";
|
|
20
20
|
import * as React from "react";
|
|
21
21
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
22
|
-
import { reportLocale } from "@camox/api-contract/
|
|
22
|
+
import { SPECIALIST_IDS, SPECIALIST_SEARCH_PARAM, reportLocale } from "@camox/api-contract/specialists";
|
|
23
23
|
import { useMutation } from "@tanstack/react-query";
|
|
24
24
|
import { Button } from "@camox/ui/button";
|
|
25
25
|
import { Popover, PopoverContent, PopoverTitle, PopoverTrigger } from "@camox/ui/popover";
|
|
26
26
|
import { Badge } from "@camox/ui/badge";
|
|
27
27
|
|
|
28
|
-
//#region src/features/studio/components/
|
|
28
|
+
//#region src/features/studio/components/Specialists.tsx
|
|
29
29
|
/**
|
|
30
|
-
* The Agent Sidebar's
|
|
31
|
-
* did without being asked in the draft viewed, or on Live (ADR 0024). It fetches the
|
|
32
|
-
* scope viewed, and holds which
|
|
30
|
+
* The Agent Sidebar's Specialists, over the Chat widget: every specialist of the project, and what
|
|
31
|
+
* each did without being asked in the draft viewed, or on Live (ADR 0024). It fetches the
|
|
32
|
+
* Specialists of the scope viewed, and holds which specialist's reports are open.
|
|
33
33
|
*/
|
|
34
|
-
function
|
|
34
|
+
function Specialists(t0) {
|
|
35
35
|
const $ = c(14);
|
|
36
36
|
const { className } = t0;
|
|
37
37
|
const { projectUuid } = React.useContext(AuthContext);
|
|
@@ -56,7 +56,7 @@ function Patrol(t0) {
|
|
|
56
56
|
className: cn("bg-background flex h-11 min-w-0 shrink-0 items-center justify-center px-3", BOTTOM_CARD_EDGES),
|
|
57
57
|
children: /* @__PURE__ */ jsx("h2", {
|
|
58
58
|
className: "truncate text-sm font-medium",
|
|
59
|
-
children: "
|
|
59
|
+
children: "Specialists"
|
|
60
60
|
})
|
|
61
61
|
});
|
|
62
62
|
t4 = cn("bg-background flex min-h-0 flex-1 flex-col overflow-y-auto", CARD_BODY_EDGES);
|
|
@@ -68,7 +68,7 @@ function Patrol(t0) {
|
|
|
68
68
|
}
|
|
69
69
|
let t5;
|
|
70
70
|
if ($[6] !== draftId || $[7] !== project) {
|
|
71
|
-
t5 = project && /* @__PURE__ */ jsx(
|
|
71
|
+
t5 = project && /* @__PURE__ */ jsx(ProjectSpecialists, {
|
|
72
72
|
projectId: project.id,
|
|
73
73
|
inDraft: draftId !== null
|
|
74
74
|
});
|
|
@@ -88,8 +88,8 @@ function Patrol(t0) {
|
|
|
88
88
|
let t7;
|
|
89
89
|
if ($[11] !== t2 || $[12] !== t6) {
|
|
90
90
|
t7 = /* @__PURE__ */ jsxs("section", {
|
|
91
|
-
"aria-label": "
|
|
92
|
-
"data-
|
|
91
|
+
"aria-label": "Specialists",
|
|
92
|
+
"data-specialists": true,
|
|
93
93
|
className: t2,
|
|
94
94
|
children: [t3, t6]
|
|
95
95
|
});
|
|
@@ -99,12 +99,24 @@ function Patrol(t0) {
|
|
|
99
99
|
} else t7 = $[13];
|
|
100
100
|
return t7;
|
|
101
101
|
}
|
|
102
|
-
|
|
103
|
-
|
|
102
|
+
/**
|
|
103
|
+
* The specialist whose findings a link opened the studio on, such as the email about Live's new
|
|
104
|
+
* findings, if any. Dropped from the URL, so that they open once.
|
|
105
|
+
*/
|
|
106
|
+
function takeLinkedSpecialist() {
|
|
107
|
+
const url = new URL(window.location.href);
|
|
108
|
+
const linked = url.searchParams.get(SPECIALIST_SEARCH_PARAM);
|
|
109
|
+
if (linked === null) return null;
|
|
110
|
+
url.searchParams.delete(SPECIALIST_SEARCH_PARAM);
|
|
111
|
+
window.history.replaceState(window.history.state, "", url.href);
|
|
112
|
+
return SPECIALIST_IDS.find((id) => id === linked) ?? null;
|
|
113
|
+
}
|
|
114
|
+
function ProjectSpecialists(t0) {
|
|
115
|
+
const $ = c(26);
|
|
104
116
|
const { projectId, inDraft } = t0;
|
|
105
117
|
let t1;
|
|
106
118
|
if ($[0] !== projectId) {
|
|
107
|
-
t1 = reads.
|
|
119
|
+
t1 = reads.specialists({ projectId });
|
|
108
120
|
$[0] = projectId;
|
|
109
121
|
$[1] = t1;
|
|
110
122
|
} else t1 = $[1];
|
|
@@ -117,135 +129,114 @@ function ProjectPatrol(t0) {
|
|
|
117
129
|
} else t2 = $[3];
|
|
118
130
|
const { data: locales } = useReadQuery(t2);
|
|
119
131
|
const [open, setOpen] = React.useState(null);
|
|
120
|
-
const now = useNow(3e4);
|
|
121
|
-
const [openFileId, setOpenFileId] = React.useState(null);
|
|
122
|
-
const showReport = useShowReport(inDraft, setOpenFileId);
|
|
123
|
-
const navigate = useNavigate();
|
|
124
132
|
let t3;
|
|
133
|
+
let t4;
|
|
125
134
|
if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
|
|
126
|
-
t3 =
|
|
135
|
+
t3 = () => {
|
|
136
|
+
const linked = takeLinkedSpecialist();
|
|
137
|
+
if (linked) setOpen(linked);
|
|
138
|
+
};
|
|
139
|
+
t4 = [];
|
|
127
140
|
$[4] = t3;
|
|
128
|
-
} else t3 = $[4];
|
|
129
|
-
const applyFix = useMutation(t3);
|
|
130
|
-
let t4;
|
|
131
|
-
if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
|
|
132
|
-
t4 = patrolMutations.dismissFinding();
|
|
133
141
|
$[5] = t4;
|
|
134
|
-
} else
|
|
135
|
-
|
|
142
|
+
} else {
|
|
143
|
+
t3 = $[4];
|
|
144
|
+
t4 = $[5];
|
|
145
|
+
}
|
|
146
|
+
React.useEffect(t3, t4);
|
|
147
|
+
const now = useNow(3e4);
|
|
148
|
+
const [openFileId, setOpenFileId] = React.useState(null);
|
|
149
|
+
const showReport = useShowReport(inDraft, setOpenFileId);
|
|
150
|
+
let t5;
|
|
151
|
+
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
|
152
|
+
t5 = specialistMutations.dismissFinding();
|
|
153
|
+
$[6] = t5;
|
|
154
|
+
} else t5 = $[6];
|
|
155
|
+
const dismissFinding = useMutation(t5);
|
|
136
156
|
if (!view) return null;
|
|
137
|
-
const
|
|
138
|
-
let
|
|
139
|
-
if ($[
|
|
140
|
-
|
|
157
|
+
const t6 = locales?.length === 1;
|
|
158
|
+
let t7;
|
|
159
|
+
if ($[7] !== showReport) {
|
|
160
|
+
t7 = (shown) => {
|
|
141
161
|
setOpen(null);
|
|
142
162
|
showReport(shown);
|
|
143
163
|
};
|
|
144
|
-
$[
|
|
145
|
-
$[
|
|
146
|
-
} else
|
|
147
|
-
let t7;
|
|
148
|
-
if ($[8] !== applyFix || $[9] !== projectId) {
|
|
149
|
-
t7 = (finding) => applyFix.mutate({
|
|
150
|
-
projectId,
|
|
151
|
-
findingId: finding.id
|
|
152
|
-
});
|
|
153
|
-
$[8] = applyFix;
|
|
154
|
-
$[9] = projectId;
|
|
155
|
-
$[10] = t7;
|
|
156
|
-
} else t7 = $[10];
|
|
164
|
+
$[7] = showReport;
|
|
165
|
+
$[8] = t7;
|
|
166
|
+
} else t7 = $[8];
|
|
157
167
|
let t8;
|
|
158
|
-
if ($[
|
|
159
|
-
t8 = (
|
|
168
|
+
if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
|
|
169
|
+
t8 = (specialist, finding) => {
|
|
160
170
|
setOpen(null);
|
|
161
|
-
studioStore.trigger.
|
|
171
|
+
studioStore.trigger.sendToAgent({ text: fixWithAgentMessage(finding, specialist.role) });
|
|
162
172
|
};
|
|
163
|
-
$[
|
|
164
|
-
} else t8 = $[
|
|
173
|
+
$[9] = t8;
|
|
174
|
+
} else t8 = $[9];
|
|
165
175
|
let t9;
|
|
166
|
-
if ($[
|
|
167
|
-
t9 = (
|
|
176
|
+
if ($[10] !== dismissFinding || $[11] !== projectId) {
|
|
177
|
+
t9 = (finding_0) => dismissFinding.mutate({
|
|
168
178
|
projectId,
|
|
169
|
-
findingId:
|
|
179
|
+
findingId: finding_0.id
|
|
170
180
|
});
|
|
171
|
-
$[
|
|
172
|
-
$[
|
|
173
|
-
$[
|
|
174
|
-
} else t9 = $[
|
|
181
|
+
$[10] = dismissFinding;
|
|
182
|
+
$[11] = projectId;
|
|
183
|
+
$[12] = t9;
|
|
184
|
+
} else t9 = $[12];
|
|
175
185
|
let t10;
|
|
176
|
-
if ($[15] !==
|
|
177
|
-
t10 = (
|
|
178
|
-
setOpen(null);
|
|
179
|
-
const kind = finding_2.place?.kind;
|
|
180
|
-
if (kind === "page" || kind === "record") showReport({
|
|
181
|
-
...shownOfFinding(finding_2),
|
|
182
|
-
draft
|
|
183
|
-
});
|
|
184
|
-
else navigate({
|
|
185
|
-
to: window.location.href,
|
|
186
|
-
draft: draft.id
|
|
187
|
-
});
|
|
188
|
-
};
|
|
189
|
-
$[15] = navigate;
|
|
190
|
-
$[16] = showReport;
|
|
191
|
-
$[17] = t10;
|
|
192
|
-
} else t10 = $[17];
|
|
193
|
-
let t11;
|
|
194
|
-
if ($[18] !== inDraft || $[19] !== now || $[20] !== open || $[21] !== t10 || $[22] !== t5 || $[23] !== t6 || $[24] !== t7 || $[25] !== t9 || $[26] !== view) {
|
|
195
|
-
t11 = /* @__PURE__ */ jsx(PatrolRoster, {
|
|
186
|
+
if ($[13] !== inDraft || $[14] !== now || $[15] !== open || $[16] !== t6 || $[17] !== t7 || $[18] !== t9 || $[19] !== view) {
|
|
187
|
+
t10 = /* @__PURE__ */ jsx(SpecialistRoster, {
|
|
196
188
|
view,
|
|
197
189
|
now,
|
|
198
190
|
inDraft,
|
|
199
|
-
singleLocale:
|
|
191
|
+
singleLocale: t6,
|
|
200
192
|
open,
|
|
201
193
|
onOpenChange: setOpen,
|
|
202
|
-
onShow:
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
$[
|
|
209
|
-
$[
|
|
210
|
-
$[
|
|
211
|
-
$[
|
|
212
|
-
$[
|
|
213
|
-
$[
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
} else t11 = $[27];
|
|
219
|
-
let t12;
|
|
220
|
-
if ($[28] !== openFileId) {
|
|
221
|
-
t12 = openFileId && /* @__PURE__ */ jsx(AssetLightbox, {
|
|
194
|
+
onShow: t7,
|
|
195
|
+
onFix: t8,
|
|
196
|
+
onDismiss: t9
|
|
197
|
+
});
|
|
198
|
+
$[13] = inDraft;
|
|
199
|
+
$[14] = now;
|
|
200
|
+
$[15] = open;
|
|
201
|
+
$[16] = t6;
|
|
202
|
+
$[17] = t7;
|
|
203
|
+
$[18] = t9;
|
|
204
|
+
$[19] = view;
|
|
205
|
+
$[20] = t10;
|
|
206
|
+
} else t10 = $[20];
|
|
207
|
+
let t11;
|
|
208
|
+
if ($[21] !== openFileId) {
|
|
209
|
+
t11 = openFileId && /* @__PURE__ */ jsx(AssetLightbox, {
|
|
222
210
|
open: true,
|
|
223
211
|
onOpenChange: (open_0) => {
|
|
224
212
|
if (!open_0) setOpenFileId(null);
|
|
225
213
|
},
|
|
226
214
|
fileId: openFileId
|
|
227
215
|
});
|
|
228
|
-
$[
|
|
229
|
-
$[
|
|
230
|
-
} else
|
|
231
|
-
let
|
|
232
|
-
if ($[
|
|
233
|
-
|
|
234
|
-
$[
|
|
235
|
-
$[
|
|
236
|
-
$[
|
|
237
|
-
} else
|
|
238
|
-
return
|
|
216
|
+
$[21] = openFileId;
|
|
217
|
+
$[22] = t11;
|
|
218
|
+
} else t11 = $[22];
|
|
219
|
+
let t12;
|
|
220
|
+
if ($[23] !== t10 || $[24] !== t11) {
|
|
221
|
+
t12 = /* @__PURE__ */ jsxs("div", { children: [t10, t11] });
|
|
222
|
+
$[23] = t10;
|
|
223
|
+
$[24] = t11;
|
|
224
|
+
$[25] = t12;
|
|
225
|
+
} else t12 = $[25];
|
|
226
|
+
return t12;
|
|
239
227
|
}
|
|
240
|
-
/** A report, as the
|
|
228
|
+
/** A report, as the Specialists shows its subject. */
|
|
241
229
|
const shownOf = (report) => ({
|
|
242
230
|
...report,
|
|
243
231
|
locale: reportLocale(report.summary)
|
|
244
232
|
});
|
|
245
|
-
/**
|
|
233
|
+
/**
|
|
234
|
+
* A finding, as the Specialists shows its subject: its field selected, where the studio is. A
|
|
235
|
+
* Live finding seen in a draft is about content the draft still holds, fixed there.
|
|
236
|
+
*/
|
|
246
237
|
const shownOfFinding = (finding) => ({
|
|
247
238
|
place: finding.place,
|
|
248
|
-
live:
|
|
239
|
+
live: false,
|
|
249
240
|
locale: finding.locale,
|
|
250
241
|
field: {
|
|
251
242
|
name: finding.field,
|
|
@@ -253,8 +244,8 @@ const shownOfFinding = (finding) => ({
|
|
|
253
244
|
}
|
|
254
245
|
});
|
|
255
246
|
/**
|
|
256
|
-
* Shows a report's or a finding's subject where it is, in its locale, and on Live for a Live
|
|
257
|
-
* seen from a draft
|
|
247
|
+
* Shows a report's or a finding's subject where it is, in its locale, and on Live for a Live
|
|
248
|
+
* report seen from a draft: a page, block, item or field selected on the
|
|
258
249
|
* Canvas, a record in its collection, or a file, opened over the Canvas.
|
|
259
250
|
*/
|
|
260
251
|
function useShowReport(inDraft, openFile) {
|
|
@@ -267,7 +258,7 @@ function useShowReport(inDraft, openFile) {
|
|
|
267
258
|
t0 = (report) => {
|
|
268
259
|
const { place } = report;
|
|
269
260
|
if (!place) return;
|
|
270
|
-
const inScope =
|
|
261
|
+
const inScope = inDraft && report.live ? { draft: null } : {};
|
|
271
262
|
const tag = report.locale;
|
|
272
263
|
if (place.kind === "page") {
|
|
273
264
|
const { pageId, blockId, itemId } = place;
|
|
@@ -332,62 +323,53 @@ function _temp() {
|
|
|
332
323
|
return Date.now();
|
|
333
324
|
}
|
|
334
325
|
/**
|
|
335
|
-
* A `
|
|
336
|
-
* story. Each opens its reports in a popover to the left, under its role and when it last worked,
|
|
326
|
+
* A `SpecialistsView`, in the order it gives, as avatars in rows of three, each over its role like
|
|
327
|
+
* a story. Each opens its reports in a popover to the left, under its role and when it last worked,
|
|
337
328
|
* or what it's on. Live's reports carry a tag when a draft is viewed. In a project with a single
|
|
338
329
|
* locale, the Translator invites the editor to add a language instead.
|
|
339
330
|
*/
|
|
340
|
-
function
|
|
341
|
-
const $ = c(
|
|
342
|
-
const { view, now, inDraft, singleLocale, open, onOpenChange, onShow,
|
|
331
|
+
function SpecialistRoster(t0) {
|
|
332
|
+
const $ = c(21);
|
|
333
|
+
const { view, now, inDraft, singleLocale, open, onOpenChange, onShow, onFix, onDismiss } = t0;
|
|
343
334
|
let t1;
|
|
344
|
-
if ($[0] !== inDraft || $[1] !== now || $[2] !==
|
|
335
|
+
if ($[0] !== inDraft || $[1] !== now || $[2] !== onDismiss || $[3] !== onFix || $[4] !== onOpenChange || $[5] !== onShow || $[6] !== open || $[7] !== singleLocale || $[8] !== view.specialists) {
|
|
345
336
|
let t2;
|
|
346
|
-
if ($[
|
|
347
|
-
t2 = (
|
|
348
|
-
|
|
337
|
+
if ($[10] !== inDraft || $[11] !== now || $[12] !== onDismiss || $[13] !== onFix || $[14] !== onOpenChange || $[15] !== onShow || $[16] !== open || $[17] !== singleLocale) {
|
|
338
|
+
t2 = (specialist) => /* @__PURE__ */ jsx(SpecialistRow, {
|
|
339
|
+
specialist,
|
|
349
340
|
now,
|
|
350
341
|
inDraft,
|
|
351
342
|
singleLocale,
|
|
352
|
-
open: open ===
|
|
353
|
-
onOpenChange: (next) => onOpenChange(next ?
|
|
343
|
+
open: open === specialist.id,
|
|
344
|
+
onOpenChange: (next) => onOpenChange(next ? specialist.id : null),
|
|
354
345
|
onShow,
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
$[13] =
|
|
362
|
-
$[14] =
|
|
363
|
-
$[15] =
|
|
364
|
-
$[16] =
|
|
365
|
-
$[17] =
|
|
366
|
-
$[18] =
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
$[21] = open;
|
|
370
|
-
$[22] = singleLocale;
|
|
371
|
-
$[23] = view.patrolDraft;
|
|
372
|
-
$[24] = t2;
|
|
373
|
-
} else t2 = $[24];
|
|
374
|
-
t1 = view.patrollers.map(t2);
|
|
346
|
+
onFix,
|
|
347
|
+
onDismiss
|
|
348
|
+
}, specialist.id);
|
|
349
|
+
$[10] = inDraft;
|
|
350
|
+
$[11] = now;
|
|
351
|
+
$[12] = onDismiss;
|
|
352
|
+
$[13] = onFix;
|
|
353
|
+
$[14] = onOpenChange;
|
|
354
|
+
$[15] = onShow;
|
|
355
|
+
$[16] = open;
|
|
356
|
+
$[17] = singleLocale;
|
|
357
|
+
$[18] = t2;
|
|
358
|
+
} else t2 = $[18];
|
|
359
|
+
t1 = view.specialists.map(t2);
|
|
375
360
|
$[0] = inDraft;
|
|
376
361
|
$[1] = now;
|
|
377
|
-
$[2] =
|
|
378
|
-
$[3] =
|
|
379
|
-
$[4] =
|
|
380
|
-
$[5] =
|
|
381
|
-
$[6] =
|
|
382
|
-
$[7] =
|
|
383
|
-
$[8] =
|
|
384
|
-
$[9] =
|
|
385
|
-
|
|
386
|
-
$[11] = view.patrollers;
|
|
387
|
-
$[12] = t1;
|
|
388
|
-
} else t1 = $[12];
|
|
362
|
+
$[2] = onDismiss;
|
|
363
|
+
$[3] = onFix;
|
|
364
|
+
$[4] = onOpenChange;
|
|
365
|
+
$[5] = onShow;
|
|
366
|
+
$[6] = open;
|
|
367
|
+
$[7] = singleLocale;
|
|
368
|
+
$[8] = view.specialists;
|
|
369
|
+
$[9] = t1;
|
|
370
|
+
} else t1 = $[9];
|
|
389
371
|
let t2;
|
|
390
|
-
if ($[
|
|
372
|
+
if ($[19] !== t1) {
|
|
391
373
|
t2 = /* @__PURE__ */ jsx("div", {
|
|
392
374
|
className: "px-1 py-3",
|
|
393
375
|
children: /* @__PURE__ */ jsx("ul", {
|
|
@@ -395,13 +377,13 @@ function PatrolRoster(t0) {
|
|
|
395
377
|
children: t1
|
|
396
378
|
})
|
|
397
379
|
});
|
|
398
|
-
$[
|
|
399
|
-
$[
|
|
400
|
-
} else t2 = $[
|
|
380
|
+
$[19] = t1;
|
|
381
|
+
$[20] = t2;
|
|
382
|
+
} else t2 = $[20];
|
|
401
383
|
return t2;
|
|
402
384
|
}
|
|
403
385
|
/**
|
|
404
|
-
* A thin, low-contrast arc travelling around a working
|
|
386
|
+
* A thin, low-contrast arc travelling around a working specialist's avatar, where its story ring
|
|
405
387
|
* goes, or the whole ring pulsing slowly under reduced motion. The motion lives in `studio.css`.
|
|
406
388
|
*/
|
|
407
389
|
function WorkingArc() {
|
|
@@ -412,7 +394,7 @@ function WorkingArc() {
|
|
|
412
394
|
"data-working-indicator": true,
|
|
413
395
|
"aria-hidden": true,
|
|
414
396
|
viewBox: "0 0 36 36",
|
|
415
|
-
className: "
|
|
397
|
+
className: "specialist-working text-foreground/40 pointer-events-none absolute -inset-[3px] size-[calc(100%+6px)]",
|
|
416
398
|
children: /* @__PURE__ */ jsx("circle", {
|
|
417
399
|
cx: "18",
|
|
418
400
|
cy: "18",
|
|
@@ -422,33 +404,33 @@ function WorkingArc() {
|
|
|
422
404
|
stroke: "currentColor",
|
|
423
405
|
strokeWidth: "1.5",
|
|
424
406
|
strokeLinecap: "round",
|
|
425
|
-
className: "
|
|
407
|
+
className: "specialist-working-arc"
|
|
426
408
|
})
|
|
427
409
|
});
|
|
428
410
|
$[0] = t0;
|
|
429
411
|
} else t0 = $[0];
|
|
430
412
|
return t0;
|
|
431
413
|
}
|
|
432
|
-
function
|
|
433
|
-
const $ = c(
|
|
434
|
-
const {
|
|
414
|
+
function SpecialistRow(t0) {
|
|
415
|
+
const $ = c(50);
|
|
416
|
+
const { specialist, now, inDraft, singleLocale, open, onOpenChange, onShow, onFix, onDismiss } = t0;
|
|
435
417
|
const statusId = React.useId();
|
|
436
418
|
let t1;
|
|
437
|
-
if ($[0] !==
|
|
438
|
-
t1 =
|
|
439
|
-
$[0] =
|
|
440
|
-
$[1] =
|
|
419
|
+
if ($[0] !== specialist.id || $[1] !== specialist.working) {
|
|
420
|
+
t1 = specialist.working && workingSentence(specialist.id, specialist.working);
|
|
421
|
+
$[0] = specialist.id;
|
|
422
|
+
$[1] = specialist.working;
|
|
441
423
|
$[2] = t1;
|
|
442
424
|
} else t1 = $[2];
|
|
443
425
|
const working = t1;
|
|
444
|
-
const count =
|
|
426
|
+
const count = specialist.findings.length;
|
|
445
427
|
const t2 = open || void 0;
|
|
446
428
|
const t3 = working ? statusId : void 0;
|
|
447
429
|
let t4;
|
|
448
430
|
if ($[3] !== count || $[4] !== working) {
|
|
449
431
|
t4 = !working && /* @__PURE__ */ jsx("span", {
|
|
450
432
|
"aria-hidden": true,
|
|
451
|
-
className: cn("group-focus-visible/
|
|
433
|
+
className: cn("group-focus-visible/specialist:ring-ring/50 pointer-events-none absolute -inset-[3px] rounded-full border group-focus-visible/specialist:ring-[3px]", count > 0 ? "border-foreground border-[1.5px]" : "border-border")
|
|
452
434
|
});
|
|
453
435
|
$[3] = count;
|
|
454
436
|
$[4] = working;
|
|
@@ -460,18 +442,18 @@ function PatrollerRow(t0) {
|
|
|
460
442
|
$[6] = working;
|
|
461
443
|
$[7] = t5;
|
|
462
444
|
} else t5 = $[7];
|
|
463
|
-
const t6 = working ? "working" :
|
|
445
|
+
const t6 = working ? "working" : specialist.duty === "off" ? "asleep" : "idle";
|
|
464
446
|
let t7;
|
|
465
|
-
if ($[8] !==
|
|
447
|
+
if ($[8] !== specialist.id || $[9] !== t6) {
|
|
466
448
|
t7 = /* @__PURE__ */ jsx("span", {
|
|
467
|
-
className: "bg-muted group-hover/
|
|
449
|
+
className: "bg-muted group-hover/specialist:bg-muted-foreground/15 group-data-popup-open/specialist:bg-muted-foreground/15 flex size-full items-center justify-center rounded-full transition-colors",
|
|
468
450
|
children: /* @__PURE__ */ jsx(Squareling, {
|
|
469
|
-
variant:
|
|
451
|
+
variant: specialist.id,
|
|
470
452
|
status: t6,
|
|
471
453
|
className: "size-6"
|
|
472
454
|
})
|
|
473
455
|
});
|
|
474
|
-
$[8] =
|
|
456
|
+
$[8] = specialist.id;
|
|
475
457
|
$[9] = t6;
|
|
476
458
|
$[10] = t7;
|
|
477
459
|
} else t7 = $[10];
|
|
@@ -489,7 +471,7 @@ function PatrollerRow(t0) {
|
|
|
489
471
|
let t9;
|
|
490
472
|
if ($[13] !== t4 || $[14] !== t5 || $[15] !== t7 || $[16] !== t8) {
|
|
491
473
|
t9 = /* @__PURE__ */ jsxs("span", {
|
|
492
|
-
className: "relative flex size-10 shrink-0 transition-[scale] duration-200 ease-out group-hover/
|
|
474
|
+
className: "relative flex size-10 shrink-0 transition-[scale] duration-200 ease-out group-hover/specialist:scale-105 group-active/specialist:scale-95 motion-reduce:transition-none",
|
|
493
475
|
children: [
|
|
494
476
|
t4,
|
|
495
477
|
t5,
|
|
@@ -504,20 +486,20 @@ function PatrollerRow(t0) {
|
|
|
504
486
|
$[17] = t9;
|
|
505
487
|
} else t9 = $[17];
|
|
506
488
|
let t10;
|
|
507
|
-
if ($[18] !==
|
|
489
|
+
if ($[18] !== specialist.role) {
|
|
508
490
|
t10 = /* @__PURE__ */ jsx("span", {
|
|
509
|
-
"data-
|
|
491
|
+
"data-specialist-role": true,
|
|
510
492
|
className: "max-w-full truncate text-[11px] leading-4 font-medium",
|
|
511
|
-
children:
|
|
493
|
+
children: specialist.role
|
|
512
494
|
});
|
|
513
|
-
$[18] =
|
|
495
|
+
$[18] = specialist.role;
|
|
514
496
|
$[19] = t10;
|
|
515
497
|
} else t10 = $[19];
|
|
516
498
|
let t11;
|
|
517
499
|
if ($[20] !== t10 || $[21] !== t3 || $[22] !== t9) {
|
|
518
500
|
t11 = /* @__PURE__ */ jsxs(PopoverTrigger, {
|
|
519
501
|
"aria-describedby": t3,
|
|
520
|
-
className: "group/
|
|
502
|
+
className: "group/specialist flex max-w-full min-w-0 cursor-pointer flex-col items-center gap-1 pt-[3px] outline-none",
|
|
521
503
|
children: [t9, t10]
|
|
522
504
|
});
|
|
523
505
|
$[20] = t10;
|
|
@@ -526,63 +508,57 @@ function PatrollerRow(t0) {
|
|
|
526
508
|
$[23] = t11;
|
|
527
509
|
} else t11 = $[23];
|
|
528
510
|
let t12;
|
|
529
|
-
if ($[24] !==
|
|
530
|
-
t12 = (finding) =>
|
|
531
|
-
$[24] =
|
|
532
|
-
$[25] =
|
|
511
|
+
if ($[24] !== onFix || $[25] !== specialist) {
|
|
512
|
+
t12 = (finding) => onFix(specialist, finding);
|
|
513
|
+
$[24] = onFix;
|
|
514
|
+
$[25] = specialist;
|
|
533
515
|
$[26] = t12;
|
|
534
516
|
} else t12 = $[26];
|
|
535
517
|
let t13;
|
|
536
|
-
if ($[27] !== inDraft || $[28] !== now || $[29] !==
|
|
518
|
+
if ($[27] !== inDraft || $[28] !== now || $[29] !== onDismiss || $[30] !== onShow || $[31] !== singleLocale || $[32] !== specialist || $[33] !== t12) {
|
|
537
519
|
t13 = /* @__PURE__ */ jsx(PopoverContent, {
|
|
538
520
|
sideOffset: 8,
|
|
539
521
|
className: "w-96 gap-3 p-4",
|
|
540
|
-
children: /* @__PURE__ */ jsx(
|
|
541
|
-
|
|
522
|
+
children: /* @__PURE__ */ jsx(SpecialistCard, {
|
|
523
|
+
specialist,
|
|
542
524
|
now,
|
|
543
525
|
inDraft,
|
|
544
526
|
singleLocale,
|
|
545
527
|
onShow,
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
onDismiss,
|
|
549
|
-
patrolDraft,
|
|
550
|
-
onOpenPatrolDraft
|
|
528
|
+
onFix: t12,
|
|
529
|
+
onDismiss
|
|
551
530
|
})
|
|
552
531
|
});
|
|
553
532
|
$[27] = inDraft;
|
|
554
533
|
$[28] = now;
|
|
555
|
-
$[29] =
|
|
556
|
-
$[30] =
|
|
557
|
-
$[31] =
|
|
558
|
-
$[32] =
|
|
559
|
-
$[33] =
|
|
560
|
-
$[34] =
|
|
561
|
-
|
|
562
|
-
$[36] = t12;
|
|
563
|
-
$[37] = t13;
|
|
564
|
-
} else t13 = $[37];
|
|
534
|
+
$[29] = onDismiss;
|
|
535
|
+
$[30] = onShow;
|
|
536
|
+
$[31] = singleLocale;
|
|
537
|
+
$[32] = specialist;
|
|
538
|
+
$[33] = t12;
|
|
539
|
+
$[34] = t13;
|
|
540
|
+
} else t13 = $[34];
|
|
565
541
|
let t14;
|
|
566
|
-
if ($[
|
|
542
|
+
if ($[35] !== onOpenChange || $[36] !== open || $[37] !== t11 || $[38] !== t13) {
|
|
567
543
|
t14 = /* @__PURE__ */ jsxs(Popover, {
|
|
568
544
|
open,
|
|
569
545
|
onOpenChange,
|
|
570
546
|
children: [t11, t13]
|
|
571
547
|
});
|
|
572
|
-
$[
|
|
573
|
-
$[
|
|
574
|
-
$[
|
|
575
|
-
$[
|
|
576
|
-
$[
|
|
577
|
-
} else t14 = $[
|
|
548
|
+
$[35] = onOpenChange;
|
|
549
|
+
$[36] = open;
|
|
550
|
+
$[37] = t11;
|
|
551
|
+
$[38] = t13;
|
|
552
|
+
$[39] = t14;
|
|
553
|
+
} else t14 = $[39];
|
|
578
554
|
let t15;
|
|
579
|
-
if ($[
|
|
555
|
+
if ($[40] !== working) {
|
|
580
556
|
t15 = working && `Working: ${working.charAt(0).toLowerCase()}${working.slice(1)}`;
|
|
581
|
-
$[
|
|
582
|
-
$[
|
|
583
|
-
} else t15 = $[
|
|
557
|
+
$[40] = working;
|
|
558
|
+
$[41] = t15;
|
|
559
|
+
} else t15 = $[41];
|
|
584
560
|
let t16;
|
|
585
|
-
if ($[
|
|
561
|
+
if ($[42] !== statusId || $[43] !== t15) {
|
|
586
562
|
t16 = /* @__PURE__ */ jsx("span", {
|
|
587
563
|
id: statusId,
|
|
588
564
|
"data-working-status": true,
|
|
@@ -590,31 +566,31 @@ function PatrollerRow(t0) {
|
|
|
590
566
|
className: "sr-only",
|
|
591
567
|
children: t15
|
|
592
568
|
});
|
|
593
|
-
$[
|
|
594
|
-
$[
|
|
595
|
-
$[
|
|
596
|
-
} else t16 = $[
|
|
569
|
+
$[42] = statusId;
|
|
570
|
+
$[43] = t15;
|
|
571
|
+
$[44] = t16;
|
|
572
|
+
} else t16 = $[44];
|
|
597
573
|
let t17;
|
|
598
|
-
if ($[
|
|
574
|
+
if ($[45] !== specialist.id || $[46] !== t14 || $[47] !== t16 || $[48] !== t2) {
|
|
599
575
|
t17 = /* @__PURE__ */ jsxs("li", {
|
|
600
|
-
"data-
|
|
576
|
+
"data-specialist": specialist.id,
|
|
601
577
|
"data-open": t2,
|
|
602
578
|
className: "flex justify-center",
|
|
603
579
|
children: [t14, t16]
|
|
604
580
|
});
|
|
605
|
-
$[
|
|
606
|
-
$[
|
|
607
|
-
$[
|
|
608
|
-
$[
|
|
609
|
-
$[
|
|
610
|
-
} else t17 = $[
|
|
581
|
+
$[45] = specialist.id;
|
|
582
|
+
$[46] = t14;
|
|
583
|
+
$[47] = t16;
|
|
584
|
+
$[48] = t2;
|
|
585
|
+
$[49] = t17;
|
|
586
|
+
} else t17 = $[49];
|
|
611
587
|
return t17;
|
|
612
588
|
}
|
|
613
589
|
/**
|
|
614
|
-
* A
|
|
590
|
+
* A specialist's popover, a profile card: its avatar and role, a tag of when it works where the
|
|
615
591
|
* editor is over what it does, what it's on while it works, then what it did.
|
|
616
592
|
*/
|
|
617
|
-
function
|
|
593
|
+
function SpecialistCard(t0) {
|
|
618
594
|
const $ = c(47);
|
|
619
595
|
let props;
|
|
620
596
|
let singleLocale;
|
|
@@ -627,34 +603,34 @@ function PatrollerCard(t0) {
|
|
|
627
603
|
props = $[1];
|
|
628
604
|
singleLocale = $[2];
|
|
629
605
|
}
|
|
630
|
-
const {
|
|
606
|
+
const { specialist, inDraft } = props;
|
|
631
607
|
let t1;
|
|
632
|
-
if ($[3] !==
|
|
633
|
-
t1 =
|
|
634
|
-
$[3] =
|
|
635
|
-
$[4] =
|
|
608
|
+
if ($[3] !== specialist.id || $[4] !== specialist.working) {
|
|
609
|
+
t1 = specialist.working && workingSentence(specialist.id, specialist.working);
|
|
610
|
+
$[3] = specialist.id;
|
|
611
|
+
$[4] = specialist.working;
|
|
636
612
|
$[5] = t1;
|
|
637
613
|
} else t1 = $[5];
|
|
638
614
|
const working = t1;
|
|
639
615
|
let t2;
|
|
640
|
-
if ($[6] !== inDraft || $[7] !==
|
|
641
|
-
t2 = whenTag(
|
|
616
|
+
if ($[6] !== inDraft || $[7] !== singleLocale || $[8] !== specialist.duty || $[9] !== specialist.id) {
|
|
617
|
+
t2 = whenTag(specialist.id, specialist.duty, inDraft, singleLocale);
|
|
642
618
|
$[6] = inDraft;
|
|
643
|
-
$[7] =
|
|
644
|
-
$[8] =
|
|
645
|
-
$[9] =
|
|
619
|
+
$[7] = singleLocale;
|
|
620
|
+
$[8] = specialist.duty;
|
|
621
|
+
$[9] = specialist.id;
|
|
646
622
|
$[10] = t2;
|
|
647
623
|
} else t2 = $[10];
|
|
648
624
|
const when = t2;
|
|
649
|
-
const t3 = working ? "working" :
|
|
625
|
+
const t3 = working ? "working" : specialist.duty === "off" ? "asleep" : "idle";
|
|
650
626
|
let t4;
|
|
651
|
-
if ($[11] !==
|
|
627
|
+
if ($[11] !== specialist.id || $[12] !== t3) {
|
|
652
628
|
t4 = /* @__PURE__ */ jsx(Squareling, {
|
|
653
|
-
variant:
|
|
629
|
+
variant: specialist.id,
|
|
654
630
|
status: t3,
|
|
655
631
|
className: "size-7"
|
|
656
632
|
});
|
|
657
|
-
$[11] =
|
|
633
|
+
$[11] = specialist.id;
|
|
658
634
|
$[12] = t3;
|
|
659
635
|
$[13] = t4;
|
|
660
636
|
} else t4 = $[13];
|
|
@@ -675,12 +651,12 @@ function PatrollerCard(t0) {
|
|
|
675
651
|
$[18] = t6;
|
|
676
652
|
} else t6 = $[18];
|
|
677
653
|
let t7;
|
|
678
|
-
if ($[19] !==
|
|
654
|
+
if ($[19] !== specialist.role) {
|
|
679
655
|
t7 = /* @__PURE__ */ jsx(PopoverTitle, {
|
|
680
656
|
className: "min-w-0 text-base",
|
|
681
|
-
children:
|
|
657
|
+
children: specialist.role
|
|
682
658
|
});
|
|
683
|
-
$[19] =
|
|
659
|
+
$[19] = specialist.role;
|
|
684
660
|
$[20] = t7;
|
|
685
661
|
} else t7 = $[20];
|
|
686
662
|
let t8;
|
|
@@ -712,7 +688,7 @@ function PatrollerCard(t0) {
|
|
|
712
688
|
let t12;
|
|
713
689
|
if ($[28] !== t11 || $[29] !== when.label) {
|
|
714
690
|
t12 = /* @__PURE__ */ jsxs("span", {
|
|
715
|
-
"data-
|
|
691
|
+
"data-specialist-when": true,
|
|
716
692
|
className: "bg-muted text-muted-foreground inline-flex items-center gap-1.5 rounded-full py-0.5 pr-2.5 pl-2 text-xs font-medium",
|
|
717
693
|
children: [t11, when.label]
|
|
718
694
|
});
|
|
@@ -721,15 +697,15 @@ function PatrollerCard(t0) {
|
|
|
721
697
|
$[30] = t12;
|
|
722
698
|
} else t12 = $[30];
|
|
723
699
|
let t13;
|
|
724
|
-
if ($[31] !==
|
|
725
|
-
t13 = aboutSentence(
|
|
726
|
-
$[31] =
|
|
700
|
+
if ($[31] !== specialist.id) {
|
|
701
|
+
t13 = aboutSentence(specialist.id);
|
|
702
|
+
$[31] = specialist.id;
|
|
727
703
|
$[32] = t13;
|
|
728
704
|
} else t13 = $[32];
|
|
729
705
|
let t14;
|
|
730
706
|
if ($[33] !== t13) {
|
|
731
707
|
t14 = /* @__PURE__ */ jsx("p", {
|
|
732
|
-
"data-
|
|
708
|
+
"data-specialist-about": true,
|
|
733
709
|
className: "text-sm",
|
|
734
710
|
children: t13
|
|
735
711
|
});
|
|
@@ -749,7 +725,7 @@ function PatrollerCard(t0) {
|
|
|
749
725
|
let t16;
|
|
750
726
|
if ($[38] !== working) {
|
|
751
727
|
t16 = working && /* @__PURE__ */ jsx("p", {
|
|
752
|
-
"data-
|
|
728
|
+
"data-specialist-working": true,
|
|
753
729
|
className: "bg-muted rounded-md px-2.5 py-1.5 text-xs",
|
|
754
730
|
children: working
|
|
755
731
|
});
|
|
@@ -760,7 +736,7 @@ function PatrollerCard(t0) {
|
|
|
760
736
|
if ($[40] !== props) {
|
|
761
737
|
t17 = /* @__PURE__ */ jsx("div", {
|
|
762
738
|
className: "flex flex-col gap-2 border-t pt-3",
|
|
763
|
-
children: /* @__PURE__ */ jsx(
|
|
739
|
+
children: /* @__PURE__ */ jsx(SpecialistDetails, { ...props })
|
|
764
740
|
});
|
|
765
741
|
$[40] = props;
|
|
766
742
|
$[41] = t17;
|
|
@@ -782,18 +758,18 @@ function PatrollerCard(t0) {
|
|
|
782
758
|
return t18;
|
|
783
759
|
}
|
|
784
760
|
/**
|
|
785
|
-
* What a
|
|
761
|
+
* What a specialist's popover shows: its open findings with their actions, then its reports, then
|
|
786
762
|
* the history of its dismissals.
|
|
787
763
|
*/
|
|
788
|
-
function
|
|
789
|
-
const $ = c(
|
|
790
|
-
const {
|
|
764
|
+
function SpecialistDetails(t0) {
|
|
765
|
+
const $ = c(20);
|
|
766
|
+
const { specialist, now, inDraft, onShow, onFix, onDismiss } = t0;
|
|
791
767
|
let t1;
|
|
792
|
-
if ($[0] !== inDraft || $[1] !==
|
|
793
|
-
t1 =
|
|
794
|
-
"data-findings":
|
|
768
|
+
if ($[0] !== inDraft || $[1] !== onDismiss || $[2] !== onFix || $[3] !== onShow || $[4] !== specialist.findings || $[5] !== specialist.id) {
|
|
769
|
+
t1 = specialist.findings.length > 0 && /* @__PURE__ */ jsx("ul", {
|
|
770
|
+
"data-findings": specialist.id,
|
|
795
771
|
className: "flex flex-col gap-2 text-xs",
|
|
796
|
-
children:
|
|
772
|
+
children: specialist.findings.map((finding) => /* @__PURE__ */ jsxs("li", {
|
|
797
773
|
"data-finding": true,
|
|
798
774
|
className: "flex flex-col gap-1",
|
|
799
775
|
children: [/* @__PURE__ */ jsxs("span", {
|
|
@@ -816,23 +792,11 @@ function PatrollerDetails(t0) {
|
|
|
816
792
|
onClick: () => onShow(shownOfFinding(finding)),
|
|
817
793
|
children: "Show"
|
|
818
794
|
}),
|
|
819
|
-
|
|
820
|
-
variant: "outline",
|
|
821
|
-
size: "xs",
|
|
822
|
-
onClick: () => onApply(finding),
|
|
823
|
-
children: fixLabel(finding.fix)
|
|
824
|
-
}),
|
|
825
|
-
inDraft && !finding.live && /* @__PURE__ */ jsx(Button, {
|
|
826
|
-
variant: "outline",
|
|
827
|
-
size: "xs",
|
|
828
|
-
onClick: () => onAsk(finding),
|
|
829
|
-
children: "Ask the agent"
|
|
830
|
-
}),
|
|
831
|
-
!inDraft && patrolDraft && /* @__PURE__ */ jsx(Button, {
|
|
795
|
+
/* @__PURE__ */ jsx(Button, {
|
|
832
796
|
variant: "outline",
|
|
833
797
|
size: "xs",
|
|
834
|
-
onClick: () =>
|
|
835
|
-
children: "
|
|
798
|
+
onClick: () => onFix(finding),
|
|
799
|
+
children: "Fix with agent"
|
|
836
800
|
}),
|
|
837
801
|
/* @__PURE__ */ jsx(Button, {
|
|
838
802
|
variant: "ghost",
|
|
@@ -845,37 +809,34 @@ function PatrollerDetails(t0) {
|
|
|
845
809
|
}, finding.id))
|
|
846
810
|
});
|
|
847
811
|
$[0] = inDraft;
|
|
848
|
-
$[1] =
|
|
849
|
-
$[2] =
|
|
850
|
-
$[3] =
|
|
851
|
-
$[4] =
|
|
852
|
-
$[5] =
|
|
853
|
-
$[6] =
|
|
854
|
-
|
|
855
|
-
$[8] = patroller.id;
|
|
856
|
-
$[9] = t1;
|
|
857
|
-
} else t1 = $[9];
|
|
812
|
+
$[1] = onDismiss;
|
|
813
|
+
$[2] = onFix;
|
|
814
|
+
$[3] = onShow;
|
|
815
|
+
$[4] = specialist.findings;
|
|
816
|
+
$[5] = specialist.id;
|
|
817
|
+
$[6] = t1;
|
|
818
|
+
} else t1 = $[6];
|
|
858
819
|
let t2;
|
|
859
|
-
if ($[
|
|
860
|
-
t2 = /* @__PURE__ */ jsx(
|
|
861
|
-
|
|
820
|
+
if ($[7] !== inDraft || $[8] !== now || $[9] !== onShow || $[10] !== specialist) {
|
|
821
|
+
t2 = /* @__PURE__ */ jsx(SpecialistReports, {
|
|
822
|
+
specialist,
|
|
862
823
|
now,
|
|
863
824
|
inDraft,
|
|
864
825
|
onShow
|
|
865
826
|
});
|
|
866
|
-
$[
|
|
867
|
-
$[
|
|
868
|
-
$[
|
|
869
|
-
$[
|
|
870
|
-
$[
|
|
871
|
-
} else t2 = $[
|
|
827
|
+
$[7] = inDraft;
|
|
828
|
+
$[8] = now;
|
|
829
|
+
$[9] = onShow;
|
|
830
|
+
$[10] = specialist;
|
|
831
|
+
$[11] = t2;
|
|
832
|
+
} else t2 = $[11];
|
|
872
833
|
let t3;
|
|
873
|
-
if ($[
|
|
874
|
-
t3 =
|
|
875
|
-
"data-dismissals":
|
|
834
|
+
if ($[12] !== now || $[13] !== specialist.dismissals || $[14] !== specialist.id) {
|
|
835
|
+
t3 = specialist.dismissals.length > 0 && /* @__PURE__ */ jsx("ul", {
|
|
836
|
+
"data-dismissals": specialist.id,
|
|
876
837
|
"aria-label": "Dismissed",
|
|
877
838
|
className: "text-muted-foreground flex flex-col gap-1 border-t pt-2 text-xs",
|
|
878
|
-
children:
|
|
839
|
+
children: specialist.dismissals.map((dismissal) => /* @__PURE__ */ jsxs("li", {
|
|
879
840
|
"data-dismissal": true,
|
|
880
841
|
className: "flex items-baseline gap-2",
|
|
881
842
|
children: [/* @__PURE__ */ jsx("span", {
|
|
@@ -888,34 +849,34 @@ function PatrollerDetails(t0) {
|
|
|
888
849
|
})]
|
|
889
850
|
}, dismissal.id))
|
|
890
851
|
});
|
|
891
|
-
$[
|
|
892
|
-
$[
|
|
893
|
-
$[
|
|
894
|
-
$[
|
|
895
|
-
} else t3 = $[
|
|
852
|
+
$[12] = now;
|
|
853
|
+
$[13] = specialist.dismissals;
|
|
854
|
+
$[14] = specialist.id;
|
|
855
|
+
$[15] = t3;
|
|
856
|
+
} else t3 = $[15];
|
|
896
857
|
let t4;
|
|
897
|
-
if ($[
|
|
858
|
+
if ($[16] !== t1 || $[17] !== t2 || $[18] !== t3) {
|
|
898
859
|
t4 = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
899
860
|
t1,
|
|
900
861
|
t2,
|
|
901
862
|
t3
|
|
902
863
|
] });
|
|
903
|
-
$[
|
|
904
|
-
$[
|
|
905
|
-
$[
|
|
906
|
-
$[
|
|
907
|
-
} else t4 = $[
|
|
864
|
+
$[16] = t1;
|
|
865
|
+
$[17] = t2;
|
|
866
|
+
$[18] = t3;
|
|
867
|
+
$[19] = t4;
|
|
868
|
+
} else t4 = $[19];
|
|
908
869
|
return t4;
|
|
909
870
|
}
|
|
910
871
|
/**
|
|
911
|
-
* A
|
|
872
|
+
* A specialist's reports, latest first, each with a Live tag when a draft is viewed and how long
|
|
912
873
|
* ago, then how many more there are, by locale.
|
|
913
874
|
*/
|
|
914
|
-
function
|
|
875
|
+
function SpecialistReports(t0) {
|
|
915
876
|
const $ = c(16);
|
|
916
|
-
const {
|
|
917
|
-
if (
|
|
918
|
-
if (
|
|
877
|
+
const { specialist, now, inDraft, onShow } = t0;
|
|
878
|
+
if (specialist.reports.length === 0 && specialist.more.length === 0) {
|
|
879
|
+
if (specialist.findings.length > 0 || specialist.dismissals.length > 0) return null;
|
|
919
880
|
let t1;
|
|
920
881
|
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
921
882
|
t1 = /* @__PURE__ */ jsx("p", {
|
|
@@ -926,9 +887,9 @@ function PatrollerReports(t0) {
|
|
|
926
887
|
} else t1 = $[0];
|
|
927
888
|
return t1;
|
|
928
889
|
}
|
|
929
|
-
const t1 =
|
|
890
|
+
const t1 = specialist.id;
|
|
930
891
|
let t2;
|
|
931
|
-
if ($[1] !== inDraft || $[2] !== now || $[3] !== onShow || $[4] !==
|
|
892
|
+
if ($[1] !== inDraft || $[2] !== now || $[3] !== onShow || $[4] !== specialist.reports) {
|
|
932
893
|
let t3;
|
|
933
894
|
if ($[6] !== inDraft || $[7] !== now || $[8] !== onShow) {
|
|
934
895
|
t3 = (report) => /* @__PURE__ */ jsxs("li", {
|
|
@@ -957,31 +918,31 @@ function PatrollerReports(t0) {
|
|
|
957
918
|
$[8] = onShow;
|
|
958
919
|
$[9] = t3;
|
|
959
920
|
} else t3 = $[9];
|
|
960
|
-
t2 =
|
|
921
|
+
t2 = specialist.reports.map(t3);
|
|
961
922
|
$[1] = inDraft;
|
|
962
923
|
$[2] = now;
|
|
963
924
|
$[3] = onShow;
|
|
964
|
-
$[4] =
|
|
925
|
+
$[4] = specialist.reports;
|
|
965
926
|
$[5] = t2;
|
|
966
927
|
} else t2 = $[5];
|
|
967
928
|
let t3;
|
|
968
|
-
if ($[10] !==
|
|
969
|
-
t3 =
|
|
929
|
+
if ($[10] !== specialist.more) {
|
|
930
|
+
t3 = specialist.more.length > 0 && /* @__PURE__ */ jsx("li", {
|
|
970
931
|
"data-more": true,
|
|
971
932
|
className: "text-muted-foreground",
|
|
972
|
-
children: moreSentence(
|
|
933
|
+
children: moreSentence(specialist.more)
|
|
973
934
|
});
|
|
974
|
-
$[10] =
|
|
935
|
+
$[10] = specialist.more;
|
|
975
936
|
$[11] = t3;
|
|
976
937
|
} else t3 = $[11];
|
|
977
938
|
let t4;
|
|
978
|
-
if ($[12] !==
|
|
939
|
+
if ($[12] !== specialist.id || $[13] !== t2 || $[14] !== t3) {
|
|
979
940
|
t4 = /* @__PURE__ */ jsxs("ul", {
|
|
980
941
|
"data-reports": t1,
|
|
981
942
|
className: "flex flex-col gap-1 text-xs",
|
|
982
943
|
children: [t2, t3]
|
|
983
944
|
});
|
|
984
|
-
$[12] =
|
|
945
|
+
$[12] = specialist.id;
|
|
985
946
|
$[13] = t2;
|
|
986
947
|
$[14] = t3;
|
|
987
948
|
$[15] = t4;
|
|
@@ -1049,4 +1010,4 @@ function ReportSentence(t0) {
|
|
|
1049
1010
|
}
|
|
1050
1011
|
|
|
1051
1012
|
//#endregion
|
|
1052
|
-
export {
|
|
1013
|
+
export { SpecialistCard, SpecialistDetails, SpecialistReports, SpecialistRoster, Specialists };
|