camox 0.75.0 → 0.76.0
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/features/provider/AuthenticatedCamoxProvider.js +75 -63
- package/dist/features/routes/pageRuntime.d.ts +6 -4
- package/dist/features/routes/pageRuntime.js +5 -1
- 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 +387 -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 +222 -167
- package/dist/features/studio/draftLabel.js +15 -1
- package/dist/features/studio/draftNotice.js +1 -0
- package/dist/features/studio/studioStore.js +5 -5
- package/dist/features/studio/useArchiveDraft.js +60 -0
- 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
|
@@ -7,18 +7,18 @@ import { useApplyTheme, useThemeActions } from "../studio/useTheme.js";
|
|
|
7
7
|
import { usePreviewPagesActions, useShowCanvasAction } from "../preview/CamoxPreview.js";
|
|
8
8
|
import { useProjectRoom } from "../../lib/use-project-room.js";
|
|
9
9
|
import { useLeaveDraft } from "../studio/viewSwitch.js";
|
|
10
|
+
import { DraftNotices } from "../studio/components/DraftNotices.js";
|
|
10
11
|
import { useNavbarActions } from "../studio/components/Navbar.js";
|
|
11
|
-
import { draftNoticeMessage } from "../studio/draftNotice.js";
|
|
12
12
|
import { CommandPalette, useCommandPaletteActions } from "./components/CommandPalette.js";
|
|
13
13
|
import { c } from "react/compiler-runtime";
|
|
14
14
|
import * as React from "react";
|
|
15
15
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
16
|
-
import { Toaster
|
|
16
|
+
import { Toaster } from "@camox/ui/toaster";
|
|
17
17
|
import studioCssUrl from "virtual:camox-studio-css";
|
|
18
18
|
|
|
19
19
|
//#region src/features/provider/AuthenticatedCamoxProvider.tsx
|
|
20
20
|
function AuthenticatedCamoxProvider(t0) {
|
|
21
|
-
const $ = c(
|
|
21
|
+
const $ = c(24);
|
|
22
22
|
const { children } = t0;
|
|
23
23
|
useAdminShortcuts();
|
|
24
24
|
useCommandPaletteActions();
|
|
@@ -37,85 +37,97 @@ function AuthenticatedCamoxProvider(t0) {
|
|
|
37
37
|
const { data: project } = useReadQuery(t1);
|
|
38
38
|
const draftScope = useDraftScope();
|
|
39
39
|
const studioCache = useStudioCache();
|
|
40
|
+
const [revisions] = React.useState(createRevisions);
|
|
41
|
+
const leaveDraft = useLeaveDraft();
|
|
40
42
|
let t2;
|
|
43
|
+
if ($[2] !== authClient || $[3] !== draftScope || $[4] !== leaveDraft) {
|
|
44
|
+
t2 = (left, by) => {
|
|
45
|
+
if (left.draftId !== draftScope.current()) return;
|
|
46
|
+
if (by === signedInUserId(authClient)) return leaveDraft(left);
|
|
47
|
+
draftScope.leave(left, { notice: true });
|
|
48
|
+
};
|
|
49
|
+
$[2] = authClient;
|
|
50
|
+
$[3] = draftScope;
|
|
51
|
+
$[4] = leaveDraft;
|
|
52
|
+
$[5] = t2;
|
|
53
|
+
} else t2 = $[5];
|
|
54
|
+
const onDraftLeft = t2;
|
|
41
55
|
let t3;
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
t3 =
|
|
45
|
-
|
|
46
|
-
$[
|
|
47
|
-
$[
|
|
56
|
+
let t4;
|
|
57
|
+
if ($[6] !== onDraftLeft) {
|
|
58
|
+
t3 = (ended) => onDraftLeft(ended, ended.endedBy.id);
|
|
59
|
+
t4 = (archived) => onDraftLeft(archived, archived.archivedBy.id);
|
|
60
|
+
$[6] = onDraftLeft;
|
|
61
|
+
$[7] = t3;
|
|
62
|
+
$[8] = t4;
|
|
48
63
|
} else {
|
|
49
|
-
|
|
50
|
-
|
|
64
|
+
t3 = $[7];
|
|
65
|
+
t4 = $[8];
|
|
51
66
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
t4 = {
|
|
64
|
-
onDraftEnded(ended) {
|
|
65
|
-
if (ended.draftId !== draftScope.current()) return;
|
|
66
|
-
if (ended.endedBy.id === signedInUserId(authClient)) return leaveDraft(ended);
|
|
67
|
-
draftScope.leave(ended, { notice: true });
|
|
68
|
-
},
|
|
67
|
+
let t5;
|
|
68
|
+
if ($[9] !== revisions) {
|
|
69
|
+
t5 = (revision) => revisions.announce(revision);
|
|
70
|
+
$[9] = revisions;
|
|
71
|
+
$[10] = t5;
|
|
72
|
+
} else t5 = $[10];
|
|
73
|
+
let t6;
|
|
74
|
+
if ($[11] !== t3 || $[12] !== t4 || $[13] !== t5) {
|
|
75
|
+
t6 = {
|
|
76
|
+
onDraftEnded: t3,
|
|
77
|
+
onDraftArchived: t4,
|
|
69
78
|
onRevision: t5
|
|
70
79
|
};
|
|
71
|
-
$[
|
|
72
|
-
$[
|
|
73
|
-
$[
|
|
74
|
-
$[
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
useProjectRoom(apiUrl, project?.id, studioCache, t4);
|
|
80
|
+
$[11] = t3;
|
|
81
|
+
$[12] = t4;
|
|
82
|
+
$[13] = t5;
|
|
83
|
+
$[14] = t6;
|
|
84
|
+
} else t6 = $[14];
|
|
85
|
+
useProjectRoom(apiUrl, project?.id, studioCache, t6);
|
|
78
86
|
const { resolvedTheme } = useApplyTheme();
|
|
79
|
-
let
|
|
80
|
-
if ($[
|
|
81
|
-
|
|
87
|
+
let t7;
|
|
88
|
+
if ($[15] === Symbol.for("react.memo_cache_sentinel")) {
|
|
89
|
+
t7 = /* @__PURE__ */ jsx("link", {
|
|
82
90
|
rel: "stylesheet",
|
|
83
91
|
href: studioCssUrl,
|
|
84
92
|
"data-camox-studio": true
|
|
85
93
|
});
|
|
86
|
-
$[12] = t5;
|
|
87
|
-
} else t5 = $[12];
|
|
88
|
-
let t6;
|
|
89
|
-
if ($[13] !== resolvedTheme) {
|
|
90
|
-
t6 = /* @__PURE__ */ jsx(Toaster, { theme: resolvedTheme });
|
|
91
|
-
$[13] = resolvedTheme;
|
|
92
|
-
$[14] = t6;
|
|
93
|
-
} else t6 = $[14];
|
|
94
|
-
let t7;
|
|
95
|
-
if ($[15] === Symbol.for("react.memo_cache_sentinel")) {
|
|
96
|
-
t7 = /* @__PURE__ */ jsx(CommandPalette, {});
|
|
97
94
|
$[15] = t7;
|
|
98
95
|
} else t7 = $[15];
|
|
99
96
|
let t8;
|
|
100
|
-
if ($[16] !==
|
|
101
|
-
t8 = /* @__PURE__ */
|
|
97
|
+
if ($[16] !== resolvedTheme) {
|
|
98
|
+
t8 = /* @__PURE__ */ jsx(Toaster, { theme: resolvedTheme });
|
|
99
|
+
$[16] = resolvedTheme;
|
|
100
|
+
$[17] = t8;
|
|
101
|
+
} else t8 = $[17];
|
|
102
|
+
let t10;
|
|
103
|
+
let t9;
|
|
104
|
+
if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
|
|
105
|
+
t9 = /* @__PURE__ */ jsx(CommandPalette, {});
|
|
106
|
+
t10 = /* @__PURE__ */ jsx(DraftNotices, {});
|
|
107
|
+
$[18] = t10;
|
|
108
|
+
$[19] = t9;
|
|
109
|
+
} else {
|
|
110
|
+
t10 = $[18];
|
|
111
|
+
t9 = $[19];
|
|
112
|
+
}
|
|
113
|
+
let t11;
|
|
114
|
+
if ($[20] !== children || $[21] !== revisions || $[22] !== t8) {
|
|
115
|
+
t11 = /* @__PURE__ */ jsxs(RevisionsContext, {
|
|
102
116
|
value: revisions,
|
|
103
117
|
children: [
|
|
104
|
-
|
|
118
|
+
t7,
|
|
105
119
|
children,
|
|
106
|
-
|
|
107
|
-
|
|
120
|
+
t8,
|
|
121
|
+
t9,
|
|
122
|
+
t10
|
|
108
123
|
]
|
|
109
124
|
});
|
|
110
|
-
$[
|
|
111
|
-
$[
|
|
112
|
-
$[
|
|
113
|
-
$[
|
|
114
|
-
} else
|
|
115
|
-
return
|
|
116
|
-
}
|
|
117
|
-
function _temp(notice) {
|
|
118
|
-
toast(draftNoticeMessage(notice));
|
|
125
|
+
$[20] = children;
|
|
126
|
+
$[21] = revisions;
|
|
127
|
+
$[22] = t8;
|
|
128
|
+
$[23] = t11;
|
|
129
|
+
} else t11 = $[23];
|
|
130
|
+
return t11;
|
|
119
131
|
}
|
|
120
132
|
|
|
121
133
|
//#endregion
|
|
@@ -4,7 +4,7 @@ import "../../core/structuredData.js";
|
|
|
4
4
|
import "../../core/createLayout.js";
|
|
5
5
|
import "../../core/createApp.js";
|
|
6
6
|
import "../../lib/studio-reads.js";
|
|
7
|
-
import { EndedDraft } from "@camox/api-contract/drafts";
|
|
7
|
+
import { ArchivedDraft, EndedDraft } from "@camox/api-contract/drafts";
|
|
8
8
|
import { QueryClient } from "@tanstack/react-query";
|
|
9
9
|
import { Router } from "@camox/api-contract/router";
|
|
10
10
|
import { RouterClient } from "@orpc/server";
|
|
@@ -22,8 +22,8 @@ export type PageStructure = {
|
|
|
22
22
|
recordStructuredData?: PageWithBlocks["recordStructuredData"];
|
|
23
23
|
};
|
|
24
24
|
/**
|
|
25
|
-
* Why a member can't see the draft a URL names: it doesn't exist, it isn't open to them,
|
|
26
|
-
* was published or deleted (ADR 0011).
|
|
25
|
+
* Why a member can't see the draft a URL names: it doesn't exist, it isn't open to them, it
|
|
26
|
+
* was published or deleted (ADR 0011), or it's archived (ADR 0046).
|
|
27
27
|
*/
|
|
28
28
|
export type DraftNotice = {
|
|
29
29
|
reason: "missing";
|
|
@@ -31,7 +31,9 @@ export type DraftNotice = {
|
|
|
31
31
|
reason: "forbidden";
|
|
32
32
|
} | ({
|
|
33
33
|
reason: "ended";
|
|
34
|
-
} & EndedDraft)
|
|
34
|
+
} & EndedDraft) | ({
|
|
35
|
+
reason: "archived";
|
|
36
|
+
} & ArchivedDraft);
|
|
35
37
|
/** Which draft a render read: the URL's, or Live when there was none or it couldn't be read. */
|
|
36
38
|
export interface DraftRead {
|
|
37
39
|
/** The draft the render read. Absent for Live. */
|
|
@@ -6,7 +6,7 @@ import { PAGE_IMAGE_SIZE, pageImageUrl } from "../og/pageImage.js";
|
|
|
6
6
|
import { curatedLayoutContext } from "../../core/layoutContext.js";
|
|
7
7
|
import { isArticle } from "../../core/structuredData.js";
|
|
8
8
|
import { publishingDraft } from "../runtime/publishingDraft.js";
|
|
9
|
-
import { DRAFT_ENDED_ERROR_CODE, DRAFT_HEADER, LOOK_TOKEN_HEADER, PUBLISHING_DRAFT_HEADER } from "@camox/api-contract/drafts";
|
|
9
|
+
import { DRAFT_ARCHIVED_ERROR_CODE, DRAFT_ENDED_ERROR_CODE, DRAFT_HEADER, LOOK_TOKEN_HEADER, PUBLISHING_DRAFT_HEADER } from "@camox/api-contract/drafts";
|
|
10
10
|
import { createORPCClient } from "@orpc/client";
|
|
11
11
|
import { RPCLink } from "@orpc/client/fetch";
|
|
12
12
|
|
|
@@ -84,6 +84,10 @@ function draftRefusalNotice(error, draftId) {
|
|
|
84
84
|
reason: "ended",
|
|
85
85
|
...data
|
|
86
86
|
};
|
|
87
|
+
if (code === DRAFT_ARCHIVED_ERROR_CODE && data) return {
|
|
88
|
+
reason: "archived",
|
|
89
|
+
...data
|
|
90
|
+
};
|
|
87
91
|
if (isNotFoundError(error) && data?.draftId === draftId) return { reason: "missing" };
|
|
88
92
|
if (code === "FORBIDDEN" || status === 403) return { reason: "forbidden" };
|
|
89
93
|
if (code === "UNAUTHORIZED" || status === 401) return null;
|
|
@@ -5,13 +5,14 @@ import { reads, useReadQuery } from "../../../lib/studio-reads.js";
|
|
|
5
5
|
import { cn } from "../../../lib/utils.js";
|
|
6
6
|
import { BOTTOM_CARD_EDGES, CARD_BODY_EDGES } from "../../preview/components/SidebarStack.js";
|
|
7
7
|
import { studioStore } from "../studioStore.js";
|
|
8
|
+
import { useRestoreDraft } from "../useRestoreDraft.js";
|
|
9
|
+
import { ThreadMessages } from "./ThreadMessages.js";
|
|
8
10
|
import { FollowAgentContext } from "../followAgentContext.js";
|
|
9
11
|
import { useThread } from "../../../lib/use-thread.js";
|
|
10
12
|
import { useAgentRunToast } from "../agentRunToast.js";
|
|
11
13
|
import { EditorWhereContext } from "../editorWhereContext.js";
|
|
12
14
|
import { useEditorSelection } from "../useEditorSelection.js";
|
|
13
15
|
import { ThreadComposer, useComposerCarrier } from "./ThreadComposer.js";
|
|
14
|
-
import { ThreadMessages } from "./ThreadMessages.js";
|
|
15
16
|
import { c } from "react/compiler-runtime";
|
|
16
17
|
import * as React from "react";
|
|
17
18
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -24,9 +25,10 @@ import { EMPTY_THREAD_VIEW } from "@camox/api-contract/threads";
|
|
|
24
25
|
* studio it is only hidden: the studio keeps following the editor's runs there. It follows
|
|
25
26
|
* where the studio is: the editor's own Live thread on Live, and the draft's thread in a draft.
|
|
26
27
|
* When the agent on Live hands the editor's request off to a draft, the studio that asked enters
|
|
27
|
-
* it, if it still shows Live; the card the Live turn ends on opens it too
|
|
28
|
-
* agent where the editor is: the page they look at, with
|
|
29
|
-
* cleared it from the composer, or the Canvas with no page
|
|
28
|
+
* it, if it still shows Live; the card the Live turn ends on opens it too, or restores it once
|
|
29
|
+
* it's archived. Each message tells the agent where the editor is: the page they look at, with
|
|
30
|
+
* what they selected on it unless they cleared it from the composer, or the Canvas with no page
|
|
31
|
+
* selected. A message the studio sends
|
|
30
32
|
* from elsewhere (`studioStore`'s `sendToAgent`), such as Fix with agent's, goes out through the
|
|
31
33
|
* thread it follows, as if the editor had sent it. In a draft, it tells the studio whether a turn
|
|
32
34
|
* is going in the draft's thread, whoever started it, which publishing waits for.
|
|
@@ -135,7 +137,7 @@ function CurrentThread() {
|
|
|
135
137
|
return t4;
|
|
136
138
|
}
|
|
137
139
|
function Thread(t0) {
|
|
138
|
-
const $ = c(
|
|
140
|
+
const $ = c(52);
|
|
139
141
|
const { apiUrl, projectId, draftId, onEnterDraft, onOpenDraft, composerCarry } = t0;
|
|
140
142
|
let t1;
|
|
141
143
|
if ($[0] !== onEnterDraft) {
|
|
@@ -145,10 +147,22 @@ function Thread(t0) {
|
|
|
145
147
|
} else t1 = $[1];
|
|
146
148
|
const { view, sending, send, stop, error, touched } = useThread(apiUrl, projectId, draftId, t1);
|
|
147
149
|
useAgentRunToast(view, draftId);
|
|
150
|
+
const { restore } = useRestoreDraft(projectId);
|
|
148
151
|
let t2;
|
|
152
|
+
if ($[2] !== restore || $[3] !== view.messages) {
|
|
153
|
+
t2 = (restored) => {
|
|
154
|
+
const card = view.messages.find((message) => message.from === "draft" && message.draftId === restored);
|
|
155
|
+
restore(restored, card?.from === "draft" ? card.name : void 0);
|
|
156
|
+
};
|
|
157
|
+
$[2] = restore;
|
|
158
|
+
$[3] = view.messages;
|
|
159
|
+
$[4] = t2;
|
|
160
|
+
} else t2 = $[4];
|
|
161
|
+
const restoreCard = t2;
|
|
149
162
|
let t3;
|
|
150
|
-
|
|
151
|
-
|
|
163
|
+
let t4;
|
|
164
|
+
if ($[5] !== draftId || $[6] !== view.running) {
|
|
165
|
+
t3 = () => {
|
|
152
166
|
if (!draftId) return;
|
|
153
167
|
studioStore.trigger.agentWorking({
|
|
154
168
|
draftId,
|
|
@@ -159,167 +173,169 @@ function Thread(t0) {
|
|
|
159
173
|
working: false
|
|
160
174
|
});
|
|
161
175
|
};
|
|
162
|
-
|
|
163
|
-
$[
|
|
164
|
-
$[
|
|
165
|
-
$[
|
|
166
|
-
$[
|
|
176
|
+
t4 = [draftId, view.running];
|
|
177
|
+
$[5] = draftId;
|
|
178
|
+
$[6] = view.running;
|
|
179
|
+
$[7] = t3;
|
|
180
|
+
$[8] = t4;
|
|
167
181
|
} else {
|
|
168
|
-
|
|
169
|
-
|
|
182
|
+
t3 = $[7];
|
|
183
|
+
t4 = $[8];
|
|
170
184
|
}
|
|
171
|
-
React.useEffect(
|
|
185
|
+
React.useEffect(t3, t4);
|
|
172
186
|
const follow = React.use(FollowAgentContext);
|
|
173
|
-
let t4;
|
|
174
|
-
if ($[6] !== follow) {
|
|
175
|
-
t4 = (batch) => follow?.receive(batch);
|
|
176
|
-
$[6] = follow;
|
|
177
|
-
$[7] = t4;
|
|
178
|
-
} else t4 = $[7];
|
|
179
|
-
const followTouched = React.useEffectEvent(t4);
|
|
180
187
|
let t5;
|
|
181
|
-
if ($[
|
|
182
|
-
t5 = () =>
|
|
183
|
-
|
|
184
|
-
};
|
|
185
|
-
$[8] = followTouched;
|
|
186
|
-
$[9] = touched;
|
|
188
|
+
if ($[9] !== follow) {
|
|
189
|
+
t5 = (batch) => follow?.receive(batch);
|
|
190
|
+
$[9] = follow;
|
|
187
191
|
$[10] = t5;
|
|
188
192
|
} else t5 = $[10];
|
|
193
|
+
const followTouched = React.useEffectEvent(t5);
|
|
189
194
|
let t6;
|
|
190
|
-
if ($[11] !== touched) {
|
|
191
|
-
t6 =
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
195
|
+
if ($[11] !== followTouched || $[12] !== touched) {
|
|
196
|
+
t6 = () => {
|
|
197
|
+
if (touched) followTouched(touched.batch);
|
|
198
|
+
};
|
|
199
|
+
$[11] = followTouched;
|
|
200
|
+
$[12] = touched;
|
|
201
|
+
$[13] = t6;
|
|
202
|
+
} else t6 = $[13];
|
|
203
|
+
let t7;
|
|
204
|
+
if ($[14] !== touched) {
|
|
205
|
+
t7 = [touched];
|
|
206
|
+
$[14] = touched;
|
|
207
|
+
$[15] = t7;
|
|
208
|
+
} else t7 = $[15];
|
|
209
|
+
React.useEffect(t6, t7);
|
|
196
210
|
const where = React.use(EditorWhereContext);
|
|
197
211
|
const selection = useEditorSelection(where);
|
|
198
|
-
let
|
|
199
|
-
if ($[
|
|
200
|
-
|
|
212
|
+
let t8;
|
|
213
|
+
if ($[16] !== selection) {
|
|
214
|
+
t8 = selection ? JSON.stringify([
|
|
201
215
|
selection.blockId,
|
|
202
216
|
selection.itemId,
|
|
203
217
|
selection.recordId,
|
|
204
218
|
selection.fieldName
|
|
205
219
|
]) : null;
|
|
206
|
-
$[
|
|
207
|
-
$[
|
|
208
|
-
} else
|
|
209
|
-
const selectionKey =
|
|
220
|
+
$[16] = selection;
|
|
221
|
+
$[17] = t8;
|
|
222
|
+
} else t8 = $[17];
|
|
223
|
+
const selectionKey = t8;
|
|
210
224
|
const [cleared, setCleared] = React.useState(null);
|
|
211
225
|
if (cleared !== null && selectionKey !== cleared) setCleared(null);
|
|
212
226
|
const carried = selection && selectionKey !== cleared ? selection : void 0;
|
|
213
|
-
let
|
|
214
|
-
if ($[
|
|
215
|
-
|
|
227
|
+
let t9;
|
|
228
|
+
if ($[18] !== carried || $[19] !== follow || $[20] !== send || $[21] !== where) {
|
|
229
|
+
t9 = (text) => {
|
|
216
230
|
follow?.resume();
|
|
217
231
|
send(text, where?.on === "page" && carried ? {
|
|
218
232
|
...where,
|
|
219
233
|
selection: carried
|
|
220
234
|
} : where);
|
|
221
235
|
};
|
|
222
|
-
$[
|
|
223
|
-
$[
|
|
224
|
-
$[
|
|
225
|
-
$[
|
|
226
|
-
$[
|
|
227
|
-
} else
|
|
228
|
-
const sendFollowing =
|
|
236
|
+
$[18] = carried;
|
|
237
|
+
$[19] = follow;
|
|
238
|
+
$[20] = send;
|
|
239
|
+
$[21] = where;
|
|
240
|
+
$[22] = t9;
|
|
241
|
+
} else t9 = $[22];
|
|
242
|
+
const sendFollowing = t9;
|
|
229
243
|
const waiting = useSelector(studioStore, _temp);
|
|
230
|
-
let t9;
|
|
231
|
-
if ($[20] !== sendFollowing) {
|
|
232
|
-
t9 = () => {
|
|
233
|
-
for (const message of studioStore.getSnapshot().context.agentMessages) {
|
|
234
|
-
studioStore.trigger.takeAgentMessage({ id: message.id });
|
|
235
|
-
sendFollowing(message.text);
|
|
236
|
-
}
|
|
237
|
-
};
|
|
238
|
-
$[20] = sendFollowing;
|
|
239
|
-
$[21] = t9;
|
|
240
|
-
} else t9 = $[21];
|
|
241
|
-
const sendWaiting = React.useEffectEvent(t9);
|
|
242
244
|
let t10;
|
|
243
|
-
if ($[
|
|
245
|
+
if ($[23] !== sendFollowing) {
|
|
244
246
|
t10 = () => {
|
|
245
|
-
|
|
247
|
+
for (const message_0 of studioStore.getSnapshot().context.agentMessages) {
|
|
248
|
+
studioStore.trigger.takeAgentMessage({ id: message_0.id });
|
|
249
|
+
sendFollowing(message_0.text);
|
|
250
|
+
}
|
|
246
251
|
};
|
|
247
|
-
$[
|
|
248
|
-
$[23] = waiting;
|
|
252
|
+
$[23] = sendFollowing;
|
|
249
253
|
$[24] = t10;
|
|
250
254
|
} else t10 = $[24];
|
|
255
|
+
const sendWaiting = React.useEffectEvent(t10);
|
|
251
256
|
let t11;
|
|
252
|
-
if ($[25] !== waiting) {
|
|
253
|
-
t11 =
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
257
|
+
if ($[25] !== sendWaiting || $[26] !== waiting) {
|
|
258
|
+
t11 = () => {
|
|
259
|
+
if (waiting.length > 0) sendWaiting();
|
|
260
|
+
};
|
|
261
|
+
$[25] = sendWaiting;
|
|
262
|
+
$[26] = waiting;
|
|
263
|
+
$[27] = t11;
|
|
264
|
+
} else t11 = $[27];
|
|
258
265
|
let t12;
|
|
259
|
-
if ($[
|
|
260
|
-
t12 =
|
|
266
|
+
if ($[28] !== waiting) {
|
|
267
|
+
t12 = [waiting];
|
|
268
|
+
$[28] = waiting;
|
|
269
|
+
$[29] = t12;
|
|
270
|
+
} else t12 = $[29];
|
|
271
|
+
React.useEffect(t11, t12);
|
|
272
|
+
let t13;
|
|
273
|
+
if ($[30] !== onOpenDraft || $[31] !== restoreCard || $[32] !== sending || $[33] !== view) {
|
|
274
|
+
t13 = /* @__PURE__ */ jsx(ThreadMessages, {
|
|
261
275
|
view,
|
|
262
276
|
sending,
|
|
263
|
-
onOpenDraft
|
|
277
|
+
onOpenDraft,
|
|
278
|
+
onRestoreDraft: restoreCard
|
|
264
279
|
});
|
|
265
|
-
$[
|
|
266
|
-
$[
|
|
267
|
-
$[
|
|
268
|
-
$[
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
280
|
+
$[30] = onOpenDraft;
|
|
281
|
+
$[31] = restoreCard;
|
|
282
|
+
$[32] = sending;
|
|
283
|
+
$[33] = view;
|
|
284
|
+
$[34] = t13;
|
|
285
|
+
} else t13 = $[34];
|
|
286
|
+
let t14;
|
|
287
|
+
if ($[35] !== error) {
|
|
288
|
+
t14 = error && /* @__PURE__ */ jsx("p", {
|
|
273
289
|
role: "alert",
|
|
274
290
|
className: "text-destructive px-2 pt-2 text-sm",
|
|
275
291
|
children: error
|
|
276
292
|
});
|
|
277
|
-
$[
|
|
278
|
-
$[
|
|
279
|
-
} else
|
|
280
|
-
let t14;
|
|
281
|
-
if ($[33] !== carried?.path) {
|
|
282
|
-
t14 = carried?.path.at(-1);
|
|
283
|
-
$[33] = carried?.path;
|
|
284
|
-
$[34] = t14;
|
|
285
|
-
} else t14 = $[34];
|
|
293
|
+
$[35] = error;
|
|
294
|
+
$[36] = t14;
|
|
295
|
+
} else t14 = $[36];
|
|
286
296
|
let t15;
|
|
287
|
-
if ($[
|
|
288
|
-
t15 = ()
|
|
289
|
-
$[
|
|
290
|
-
$[
|
|
291
|
-
} else t15 = $[
|
|
297
|
+
if ($[37] !== carried?.path) {
|
|
298
|
+
t15 = carried?.path.at(-1);
|
|
299
|
+
$[37] = carried?.path;
|
|
300
|
+
$[38] = t15;
|
|
301
|
+
} else t15 = $[38];
|
|
292
302
|
let t16;
|
|
293
|
-
if ($[
|
|
294
|
-
t16 =
|
|
303
|
+
if ($[39] !== selectionKey) {
|
|
304
|
+
t16 = () => selectionKey !== null && setCleared(selectionKey);
|
|
305
|
+
$[39] = selectionKey;
|
|
306
|
+
$[40] = t16;
|
|
307
|
+
} else t16 = $[40];
|
|
308
|
+
let t17;
|
|
309
|
+
if ($[41] !== composerCarry || $[42] !== sendFollowing || $[43] !== stop || $[44] !== t15 || $[45] !== t16 || $[46] !== view.running) {
|
|
310
|
+
t17 = /* @__PURE__ */ jsx(ThreadComposer, {
|
|
295
311
|
onSend: sendFollowing,
|
|
296
312
|
onStop: stop,
|
|
297
|
-
selection:
|
|
298
|
-
onClearSelection:
|
|
313
|
+
selection: t15,
|
|
314
|
+
onClearSelection: t16,
|
|
299
315
|
running: view.running,
|
|
300
316
|
carry: composerCarry
|
|
301
317
|
});
|
|
302
|
-
$[
|
|
303
|
-
$[
|
|
304
|
-
$[
|
|
305
|
-
$[
|
|
306
|
-
$[
|
|
307
|
-
$[
|
|
308
|
-
$[43] = t16;
|
|
309
|
-
} else t16 = $[43];
|
|
310
|
-
let t17;
|
|
311
|
-
if ($[44] !== t12 || $[45] !== t13 || $[46] !== t16) {
|
|
312
|
-
t17 = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
313
|
-
t12,
|
|
314
|
-
t13,
|
|
315
|
-
t16
|
|
316
|
-
] });
|
|
317
|
-
$[44] = t12;
|
|
318
|
-
$[45] = t13;
|
|
319
|
-
$[46] = t16;
|
|
318
|
+
$[41] = composerCarry;
|
|
319
|
+
$[42] = sendFollowing;
|
|
320
|
+
$[43] = stop;
|
|
321
|
+
$[44] = t15;
|
|
322
|
+
$[45] = t16;
|
|
323
|
+
$[46] = view.running;
|
|
320
324
|
$[47] = t17;
|
|
321
325
|
} else t17 = $[47];
|
|
322
|
-
|
|
326
|
+
let t18;
|
|
327
|
+
if ($[48] !== t13 || $[49] !== t14 || $[50] !== t17) {
|
|
328
|
+
t18 = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
329
|
+
t13,
|
|
330
|
+
t14,
|
|
331
|
+
t17
|
|
332
|
+
] });
|
|
333
|
+
$[48] = t13;
|
|
334
|
+
$[49] = t14;
|
|
335
|
+
$[50] = t17;
|
|
336
|
+
$[51] = t18;
|
|
337
|
+
} else t18 = $[51];
|
|
338
|
+
return t18;
|
|
323
339
|
}
|
|
324
340
|
function _temp(state) {
|
|
325
341
|
return state.context.agentMessages;
|