camox 0.65.1 → 0.67.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/canvas/CamoxCanvas.js +195 -173
- package/dist/features/canvas/canvasFrameCapture.js +5 -12
- package/dist/features/canvas/canvasFrameDocument.js +90 -29
- package/dist/features/canvas/canvasItems.js +22 -6
- package/dist/features/canvas/sidebar/ContentSidebar.js +19 -21
- package/dist/features/canvas/sidebar/LayoutPageOverview.js +22 -49
- package/dist/features/canvas/sidebar/LayoutPageSeo.js +73 -76
- package/dist/features/canvas/sidebar/PageInspector.js +61 -50
- package/dist/features/canvas/sidebar/PageInspectorSkeleton.js +4 -4
- package/dist/features/canvas/useCanvasCamera.js +22 -5
- package/dist/features/content/components/MissingFromLocale.js +1 -1
- package/dist/features/page/UnplacedLayoutContent.js +141 -0
- package/dist/features/preview/components/ItemFieldsEditor.js +50 -44
- package/dist/features/preview/components/PageInfo.js +103 -100
- package/dist/features/preview/components/SelectionEditor.js +284 -231
- package/dist/features/preview/components/contentFieldSchema.js +5 -1
- package/dist/features/runtime/RuntimeChrome.js +66 -40
- package/dist/features/runtime/pageApp.js +24 -10
- package/dist/features/runtime/runtime.d.ts +13 -0
- package/dist/features/runtime/runtime.js +58 -2
- package/dist/features/studio/components/AgentSidebar.js +3 -3
- package/dist/features/studio/components/ChatWidget.js +34 -29
- package/dist/features/studio/components/ContentFindings.js +397 -0
- package/dist/features/studio/components/DraftsControl.js +172 -159
- package/dist/features/studio/components/Patrol.js +449 -426
- package/dist/features/studio/components/ReviewDraftSheet.js +231 -192
- package/dist/features/studio/components/Squareling.js +0 -9
- package/dist/features/studio/components/ThreadComposer.js +183 -121
- package/dist/features/studio/components/ThreadMessages.js +19 -11
- package/dist/features/studio/components/UnnamedDraftBar.js +349 -0
- package/dist/features/studio/findingSentence.js +3 -5
- package/dist/features/studio/patrollerBio.js +39 -0
- package/dist/features/studio/reportSentence.js +0 -5
- package/dist/features/studio/studioStore.js +13 -0
- package/dist/features/studio/workingSentence.js +2 -11
- package/dist/lib/revisions.js +25 -3
- 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/features/canvas/sidebar/DerivedPageInspector.js +0 -49
- package/dist/features/canvas/sidebar/SingletonPageInspector.js +0 -39
|
@@ -5,6 +5,7 @@ import { Navbar } from "../studio/components/Navbar.js";
|
|
|
5
5
|
import { EditingFallbackContext } from "./editingFallback.js";
|
|
6
6
|
import { PreviewToolbar } from "../preview/components/PreviewToolbar.js";
|
|
7
7
|
import { AgentSidebar } from "../studio/components/AgentSidebar.js";
|
|
8
|
+
import { UnnamedDraftBar } from "../studio/components/UnnamedDraftBar.js";
|
|
8
9
|
import { FollowAgentProvider } from "../studio/FollowAgentProvider.js";
|
|
9
10
|
import { c } from "react/compiler-runtime";
|
|
10
11
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -14,7 +15,7 @@ import studioCssUrl from "virtual:camox-studio-css";
|
|
|
14
15
|
//#region src/features/runtime/RuntimeChrome.tsx
|
|
15
16
|
const renderEditingFallback = ({ layoutPage }) => /* @__PURE__ */ jsx(StudioEditingFallback, { layoutPage });
|
|
16
17
|
function RuntimeChrome(t0) {
|
|
17
|
-
const $ = c(
|
|
18
|
+
const $ = c(39);
|
|
18
19
|
const { input, children } = t0;
|
|
19
20
|
const website = !input.routeKind;
|
|
20
21
|
const hidden = useSelector(previewStore, _temp);
|
|
@@ -92,56 +93,81 @@ function RuntimeChrome(t0) {
|
|
|
92
93
|
$[15] = t11;
|
|
93
94
|
$[16] = t13;
|
|
94
95
|
} else t13 = $[16];
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
96
|
+
const t14 = website && hidden;
|
|
97
|
+
const t15 = website ? "max-md:hidden" : void 0;
|
|
98
|
+
let t16;
|
|
99
|
+
if ($[17] !== website) {
|
|
100
|
+
t16 = /* @__PURE__ */ jsx(UnnamedDraftBar, { stacked: website });
|
|
101
|
+
$[17] = website;
|
|
102
|
+
$[18] = t16;
|
|
103
|
+
} else t16 = $[18];
|
|
104
|
+
let t17;
|
|
105
|
+
if ($[19] !== t14 || $[20] !== t15 || $[21] !== t16) {
|
|
106
|
+
t17 = /* @__PURE__ */ jsx("div", {
|
|
107
|
+
hidden: t14,
|
|
108
|
+
className: t15,
|
|
109
|
+
children: t16
|
|
100
110
|
});
|
|
101
|
-
$[17] = t13;
|
|
102
|
-
$[18] = t9;
|
|
103
111
|
$[19] = t14;
|
|
104
|
-
} else t14 = $[19];
|
|
105
|
-
const t15 = !showAgentSidebar;
|
|
106
|
-
let t16;
|
|
107
|
-
if ($[20] !== t15) {
|
|
108
|
-
t16 = /* @__PURE__ */ jsx(AgentSidebar, { hidden: t15 });
|
|
109
112
|
$[20] = t15;
|
|
110
113
|
$[21] = t16;
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
if ($[22] !== t14 || $[23] !== t16) {
|
|
114
|
-
t17 = /* @__PURE__ */ jsxs("div", {
|
|
115
|
-
className: "relative flex min-h-0 flex-1",
|
|
116
|
-
children: [t14, t16]
|
|
117
|
-
});
|
|
118
|
-
$[22] = t14;
|
|
119
|
-
$[23] = t16;
|
|
120
|
-
$[24] = t17;
|
|
121
|
-
} else t17 = $[24];
|
|
114
|
+
$[22] = t17;
|
|
115
|
+
} else t17 = $[22];
|
|
122
116
|
let t18;
|
|
123
|
-
if ($[
|
|
117
|
+
if ($[23] !== t13 || $[24] !== t17 || $[25] !== t9) {
|
|
124
118
|
t18 = /* @__PURE__ */ jsxs("div", {
|
|
119
|
+
className: "relative flex min-h-0 min-w-0 flex-1 flex-col",
|
|
120
|
+
children: [
|
|
121
|
+
t9,
|
|
122
|
+
t13,
|
|
123
|
+
t17
|
|
124
|
+
]
|
|
125
|
+
});
|
|
126
|
+
$[23] = t13;
|
|
127
|
+
$[24] = t17;
|
|
128
|
+
$[25] = t9;
|
|
129
|
+
$[26] = t18;
|
|
130
|
+
} else t18 = $[26];
|
|
131
|
+
const t19 = !showAgentSidebar;
|
|
132
|
+
let t20;
|
|
133
|
+
if ($[27] !== t19) {
|
|
134
|
+
t20 = /* @__PURE__ */ jsx(AgentSidebar, { hidden: t19 });
|
|
135
|
+
$[27] = t19;
|
|
136
|
+
$[28] = t20;
|
|
137
|
+
} else t20 = $[28];
|
|
138
|
+
let t21;
|
|
139
|
+
if ($[29] !== t18 || $[30] !== t20) {
|
|
140
|
+
t21 = /* @__PURE__ */ jsxs("div", {
|
|
141
|
+
className: "relative flex min-h-0 flex-1",
|
|
142
|
+
children: [t18, t20]
|
|
143
|
+
});
|
|
144
|
+
$[29] = t18;
|
|
145
|
+
$[30] = t20;
|
|
146
|
+
$[31] = t21;
|
|
147
|
+
} else t21 = $[31];
|
|
148
|
+
let t22;
|
|
149
|
+
if ($[32] !== t21 || $[33] !== t7) {
|
|
150
|
+
t22 = /* @__PURE__ */ jsxs("div", {
|
|
125
151
|
className: "bg-background flex h-screen flex-col overflow-hidden",
|
|
126
|
-
children: [t7,
|
|
152
|
+
children: [t7, t21]
|
|
127
153
|
});
|
|
128
|
-
$[
|
|
129
|
-
$[
|
|
130
|
-
$[
|
|
131
|
-
} else
|
|
132
|
-
let
|
|
133
|
-
if ($[
|
|
134
|
-
|
|
154
|
+
$[32] = t21;
|
|
155
|
+
$[33] = t7;
|
|
156
|
+
$[34] = t22;
|
|
157
|
+
} else t22 = $[34];
|
|
158
|
+
let t23;
|
|
159
|
+
if ($[35] !== input.runtimeBasePath || $[36] !== t22 || $[37] !== website) {
|
|
160
|
+
t23 = /* @__PURE__ */ jsxs(FollowAgentProvider, {
|
|
135
161
|
runtimeBasePath: t1,
|
|
136
162
|
website,
|
|
137
|
-
children: [t2,
|
|
163
|
+
children: [t2, t22]
|
|
138
164
|
});
|
|
139
|
-
$[
|
|
140
|
-
$[
|
|
141
|
-
$[
|
|
142
|
-
$[
|
|
143
|
-
} else
|
|
144
|
-
return
|
|
165
|
+
$[35] = input.runtimeBasePath;
|
|
166
|
+
$[36] = t22;
|
|
167
|
+
$[37] = website;
|
|
168
|
+
$[38] = t23;
|
|
169
|
+
} else t23 = $[38];
|
|
170
|
+
return t23;
|
|
145
171
|
}
|
|
146
172
|
function _temp(state) {
|
|
147
173
|
return state.context.isToolbarHidden;
|
|
@@ -9,6 +9,7 @@ import { CoreCamoxProvider } from "../provider/CoreCamoxProvider.js";
|
|
|
9
9
|
import { CuratedPageContent } from "../page/CuratedPageContent.js";
|
|
10
10
|
import { DerivedPageContent } from "../page/DerivedPageContent.js";
|
|
11
11
|
import { UnplacedBlockContent } from "../page/UnplacedBlockContent.js";
|
|
12
|
+
import { UnplacedLayoutContent } from "../page/UnplacedLayoutContent.js";
|
|
12
13
|
import { EditingFallbackSlot } from "./editingFallback.js";
|
|
13
14
|
import { PageNavigationProvider } from "./pageNavigation.js";
|
|
14
15
|
import { RuntimeChromeSlot } from "./runtimeChromeLoader.js";
|
|
@@ -252,9 +253,9 @@ function _temp2() {
|
|
|
252
253
|
function _temp() {
|
|
253
254
|
return true;
|
|
254
255
|
}
|
|
255
|
-
/** The page's blocks, read-only, or the look document's
|
|
256
|
+
/** The page's blocks, read-only, or the look document's unplaced block or Layout. */
|
|
256
257
|
function PageContent(t0) {
|
|
257
|
-
const $ = c(
|
|
258
|
+
const $ = c(9);
|
|
258
259
|
const { camoxApp, input } = t0;
|
|
259
260
|
if (input.lookBlock) {
|
|
260
261
|
let t1;
|
|
@@ -265,24 +266,37 @@ function PageContent(t0) {
|
|
|
265
266
|
} else t1 = $[1];
|
|
266
267
|
return t1;
|
|
267
268
|
}
|
|
268
|
-
if (input.
|
|
269
|
+
if (input.lookLayout) {
|
|
269
270
|
let t1;
|
|
270
|
-
if ($[2] !== camoxApp || $[3] !== input.
|
|
271
|
-
t1 = /* @__PURE__ */ jsx(
|
|
271
|
+
if ($[2] !== camoxApp || $[3] !== input.lookLayout) {
|
|
272
|
+
t1 = /* @__PURE__ */ jsx(UnplacedLayoutContent, {
|
|
272
273
|
camoxApp,
|
|
273
|
-
|
|
274
|
+
lookLayout: input.lookLayout
|
|
274
275
|
});
|
|
275
276
|
$[2] = camoxApp;
|
|
276
|
-
$[3] = input.
|
|
277
|
+
$[3] = input.lookLayout;
|
|
277
278
|
$[4] = t1;
|
|
278
279
|
} else t1 = $[4];
|
|
279
280
|
return t1;
|
|
280
281
|
}
|
|
282
|
+
if (input.derived) {
|
|
283
|
+
let t1;
|
|
284
|
+
if ($[5] !== camoxApp || $[6] !== input.derived) {
|
|
285
|
+
t1 = /* @__PURE__ */ jsx(DerivedPageContent, {
|
|
286
|
+
camoxApp,
|
|
287
|
+
derived: input.derived
|
|
288
|
+
});
|
|
289
|
+
$[5] = camoxApp;
|
|
290
|
+
$[6] = input.derived;
|
|
291
|
+
$[7] = t1;
|
|
292
|
+
} else t1 = $[7];
|
|
293
|
+
return t1;
|
|
294
|
+
}
|
|
281
295
|
let t1;
|
|
282
|
-
if ($[
|
|
296
|
+
if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
|
|
283
297
|
t1 = /* @__PURE__ */ jsx(CuratedPageContent, {});
|
|
284
|
-
$[
|
|
285
|
-
} else t1 = $[
|
|
298
|
+
$[8] = t1;
|
|
299
|
+
} else t1 = $[8];
|
|
286
300
|
return t1;
|
|
287
301
|
}
|
|
288
302
|
function StudioLoadError() {
|
|
@@ -6,6 +6,7 @@ import { AnalyticsProviders } from "./analytics.js";
|
|
|
6
6
|
import { RuntimeOwnedRouteKind } from "./runtimeRoutes.js";
|
|
7
7
|
import { StudioRenderInput } from "./studioApp.js";
|
|
8
8
|
import { DraftRead, MemberProject, PageHead, createServerApiClient } from "../routes/pageRuntime.js";
|
|
9
|
+
import { LookPlaceholderHeight } from "@camox/api-contract/drafts";
|
|
9
10
|
import { UseHeadInput } from "unhead/types";
|
|
10
11
|
//#region src/features/runtime/runtime.d.ts
|
|
11
12
|
/** The studio's own routes, rather than a page or the Canvas. */
|
|
@@ -39,6 +40,18 @@ export interface PageRenderInput extends DraftRead {
|
|
|
39
40
|
* instead of a page. Its block bundle is in the dehydrated state.
|
|
40
41
|
*/
|
|
41
42
|
lookBlock?: string;
|
|
43
|
+
/**
|
|
44
|
+
* The look document's Layout Definition mode: the curated Layout it shows around no page, its
|
|
45
|
+
* blocks' bundles in the dehydrated state, with a placeholder `placeholder` tall where a page's
|
|
46
|
+
* content goes.
|
|
47
|
+
*/
|
|
48
|
+
lookLayout?: {
|
|
49
|
+
layoutId: string;
|
|
50
|
+
layout: Awaited<ReturnType<ReturnType<typeof createServerApiClient>["layouts"]["getUnplaced"]>>["layout"];
|
|
51
|
+
placeholder: LookPlaceholderHeight;
|
|
52
|
+
path: string;
|
|
53
|
+
projectName: string;
|
|
54
|
+
};
|
|
42
55
|
/**
|
|
43
56
|
* Whether this is the look document (ADR 0032), whose client only shows the draft: it asks
|
|
44
57
|
* nothing about a session and offers no sign-in, which would add requests to its captures.
|
|
@@ -27,7 +27,7 @@ import { getPageBlockTypes } from "./pageBlockTypes.js";
|
|
|
27
27
|
import { withPageUrls } from "./structuredData.js";
|
|
28
28
|
import { curatedPageDescription, pageRecords, placedBlockNodes, withStructuredData } from "./pageGraph.js";
|
|
29
29
|
import { createProjectLogoResponse, projectLogo } from "./projectLogo.js";
|
|
30
|
-
import { DRAFT_SEARCH_PARAM, LOCALE_HEADER, LOOK_BLOCK_DEFINITION_PARAM, LOOK_CONTENT_PARAM, LOOK_LOCALE_PARAM, LOOK_PATH_PARAM, LOOK_SETTINGS_PARAM, UNPLACED_BLOCK_ID } from "@camox/api-contract/drafts";
|
|
30
|
+
import { DRAFT_SEARCH_PARAM, LOCALE_HEADER, LOOK_BLOCKS_PARAM, LOOK_BLOCK_DEFINITION_PARAM, LOOK_CONTENT_PARAM, LOOK_LAYOUT_DEFINITION_PARAM, LOOK_LOCALE_PARAM, LOOK_PATH_PARAM, LOOK_PLACEHOLDER_HEIGHTS, LOOK_PLACEHOLDER_PARAM, LOOK_SETTINGS_PARAM, UNPLACED_BLOCK_ID } from "@camox/api-contract/drafts";
|
|
31
31
|
import { QueryClient, dehydrate } from "@tanstack/react-query";
|
|
32
32
|
import { createHead, renderSSRHead } from "@unhead/react/server";
|
|
33
33
|
|
|
@@ -571,6 +571,7 @@ async function createLookDocumentResponse(request, options) {
|
|
|
571
571
|
if (!lookToken || !draftId || !apiUrl || !authenticationUrl || !projectUuid || !renderPage) return lookNotFound();
|
|
572
572
|
const tag = searchParams.get(LOOK_LOCALE_PARAM)?.toLowerCase();
|
|
573
573
|
const blockDefinition = searchParams.get(LOOK_BLOCK_DEFINITION_PARAM);
|
|
574
|
+
const layoutDefinition = searchParams.get(LOOK_LAYOUT_DEFINITION_PARAM);
|
|
574
575
|
const queryClient = new QueryClient();
|
|
575
576
|
let locales;
|
|
576
577
|
let locale;
|
|
@@ -590,7 +591,7 @@ async function createLookDocumentResponse(request, options) {
|
|
|
590
591
|
projectUuid,
|
|
591
592
|
queryClient
|
|
592
593
|
};
|
|
593
|
-
shown = blockDefinition ? await lookAtBlockDefinition(request, options, reading, blockDefinition) : await lookAtPage(request, options, reading);
|
|
594
|
+
shown = layoutDefinition ? await lookAtLayoutDefinition(request, options, reading, layoutDefinition) : blockDefinition ? await lookAtBlockDefinition(request, options, reading, blockDefinition) : await lookAtPage(request, options, reading);
|
|
594
595
|
} catch (error) {
|
|
595
596
|
if (isAuthSessionError(error) || isNotFoundError(error)) return lookNotFound();
|
|
596
597
|
throw error;
|
|
@@ -806,6 +807,61 @@ async function lookAtBlockDefinition(request, options, reading, type) {
|
|
|
806
807
|
lookBlock: UNPLACED_BLOCK_ID
|
|
807
808
|
};
|
|
808
809
|
}
|
|
810
|
+
/**
|
|
811
|
+
* The look document's Layout Definition mode: the curated Layout `layoutId` around no page, its
|
|
812
|
+
* blocks with their default content and Block Settings and the overrides the URL gives merged on,
|
|
813
|
+
* by the API, which checks them against their schemas and refuses a Singleton or Derived Layout,
|
|
814
|
+
* answering its message. Where a page's content goes, a labelled placeholder as tall as the URL
|
|
815
|
+
* says. Its path is the Locale's home, which links resolve against.
|
|
816
|
+
*/
|
|
817
|
+
async function lookAtLayoutDefinition(request, options, reading, layoutId) {
|
|
818
|
+
const { apiUrl, lookToken, draftId, locale, projectUuid, queryClient } = reading;
|
|
819
|
+
const { searchParams } = new URL(request.url);
|
|
820
|
+
const blocks = overrideParam(searchParams, LOOK_BLOCKS_PARAM);
|
|
821
|
+
if (!blocks.ok) return lookRefused(blocks.error);
|
|
822
|
+
const placeholder = searchParams.get(LOOK_PLACEHOLDER_PARAM) ?? LOOK_PLACEHOLDER_HEIGHTS[0];
|
|
823
|
+
if (!LOOK_PLACEHOLDER_HEIGHTS.includes(placeholder)) return lookRefused(`The placeholder is ${LOOK_PLACEHOLDER_HEIGHTS.join(" or ")}.`);
|
|
824
|
+
const studioCache = createServerStudioCache(queryClient, {
|
|
825
|
+
apiUrl,
|
|
826
|
+
lookToken,
|
|
827
|
+
locale
|
|
828
|
+
});
|
|
829
|
+
const inDraft = { in: draftId };
|
|
830
|
+
let shared;
|
|
831
|
+
try {
|
|
832
|
+
[shared] = await Promise.all([createServerApiClient(apiUrl, {
|
|
833
|
+
lookToken,
|
|
834
|
+
draftId,
|
|
835
|
+
locale
|
|
836
|
+
}).layouts.getUnplaced({
|
|
837
|
+
projectUuid,
|
|
838
|
+
layoutId,
|
|
839
|
+
blocks: blocks.value
|
|
840
|
+
}), studioCache.ensure(reads.pageList({ projectUuid }), inDraft).catch(() => null)]);
|
|
841
|
+
} catch (error) {
|
|
842
|
+
if (isBadRequestError(error)) return lookRefused(error.message);
|
|
843
|
+
throw error;
|
|
844
|
+
}
|
|
845
|
+
studioCache.land(reads.layoutStructure({
|
|
846
|
+
projectUuid,
|
|
847
|
+
layoutId
|
|
848
|
+
}), shared, inDraft);
|
|
849
|
+
const pathname = localizedPath("/", locale);
|
|
850
|
+
return {
|
|
851
|
+
head: {},
|
|
852
|
+
href: lookHref(request, options, pathname, draftId).href,
|
|
853
|
+
layoutIdentity: null,
|
|
854
|
+
loaderData: null,
|
|
855
|
+
pathname,
|
|
856
|
+
lookLayout: {
|
|
857
|
+
layoutId,
|
|
858
|
+
layout: shared.layout,
|
|
859
|
+
placeholder,
|
|
860
|
+
path: pathname,
|
|
861
|
+
projectName: shared.projectName
|
|
862
|
+
}
|
|
863
|
+
};
|
|
864
|
+
}
|
|
809
865
|
/** Whether an API error refused the request's input, such as an override its schema refuses. */
|
|
810
866
|
function isBadRequestError(error) {
|
|
811
867
|
const { code, status } = error ?? {};
|
|
@@ -7,8 +7,8 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
7
7
|
|
|
8
8
|
//#region src/features/studio/components/AgentSidebar.tsx
|
|
9
9
|
/**
|
|
10
|
-
* The sidebar on the Canvas's right side, where editors work with Camox's agent: the Patrol
|
|
11
|
-
* over the Chat widget, which gets the
|
|
10
|
+
* The sidebar on the Canvas's right side, where editors work with Camox's agent: the Patrol, as
|
|
11
|
+
* tall as its patrollers, over the Chat widget, which gets the rest of the height. Laid over the Canvas,
|
|
12
12
|
* as the Content Sidebar is over its left: only the cards have a background, and the Canvas shows
|
|
13
13
|
* around them. Elsewhere in the studio it is only hidden, so the chat keeps its thread and the
|
|
14
14
|
* Preview and Studio pages follow the editor's runs too.
|
|
@@ -24,7 +24,7 @@ function AgentSidebar(t0) {
|
|
|
24
24
|
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
25
25
|
t2 = cn("absolute inset-y-0 right-0 z-10 flex flex-col gap-2 py-2 max-md:hidden", SIDEBAR_GUTTER);
|
|
26
26
|
t3 = { width: 265 };
|
|
27
|
-
t4 = /* @__PURE__ */ jsx(Patrol, { className: "min-h-0 flex-[
|
|
27
|
+
t4 = /* @__PURE__ */ jsx(Patrol, { className: "min-h-0 flex-[0_1_auto]" });
|
|
28
28
|
t5 = /* @__PURE__ */ jsx(ChatWidget, { className: "min-h-0 flex-[7_1_0]" });
|
|
29
29
|
$[0] = t2;
|
|
30
30
|
$[1] = t3;
|
|
@@ -10,7 +10,7 @@ import { useThread } from "../../../lib/use-thread.js";
|
|
|
10
10
|
import { EditorWhereContext } from "../editorWhereContext.js";
|
|
11
11
|
import { useEditorSelection } from "../useEditorSelection.js";
|
|
12
12
|
import { ConnectAgent } from "./ConnectAgent.js";
|
|
13
|
-
import { ThreadComposer } from "./ThreadComposer.js";
|
|
13
|
+
import { ThreadComposer, useComposerCarrier } from "./ThreadComposer.js";
|
|
14
14
|
import { ThreadMessages } from "./ThreadMessages.js";
|
|
15
15
|
import { c } from "react/compiler-runtime";
|
|
16
16
|
import * as React from "react";
|
|
@@ -72,7 +72,7 @@ function ChatWidget(t0) {
|
|
|
72
72
|
return t4;
|
|
73
73
|
}
|
|
74
74
|
function CurrentThread() {
|
|
75
|
-
const $ = c(
|
|
75
|
+
const $ = c(15);
|
|
76
76
|
const { apiUrl, projectUuid } = React.useContext(AuthContext);
|
|
77
77
|
let t0;
|
|
78
78
|
if ($[0] !== projectUuid) {
|
|
@@ -84,6 +84,7 @@ function CurrentThread() {
|
|
|
84
84
|
const draftId = useCurrentDraftId();
|
|
85
85
|
const draftScope = useDraftScope();
|
|
86
86
|
const navigate = useNavigate();
|
|
87
|
+
const composerCarry = useComposerCarrier();
|
|
87
88
|
let t1;
|
|
88
89
|
if ($[2] !== draftScope) {
|
|
89
90
|
t1 = (started) => draftScope.enterStarted(started);
|
|
@@ -111,27 +112,29 @@ function CurrentThread() {
|
|
|
111
112
|
}
|
|
112
113
|
const t3 = `${project.id}:${draftId ?? "live"}`;
|
|
113
114
|
let t4;
|
|
114
|
-
if ($[7] !== apiUrl || $[8] !==
|
|
115
|
+
if ($[7] !== apiUrl || $[8] !== composerCarry || $[9] !== draftId || $[10] !== enterDraft || $[11] !== openDraft || $[12] !== project.id || $[13] !== t3) {
|
|
115
116
|
t4 = /* @__PURE__ */ jsx(Thread, {
|
|
116
117
|
apiUrl,
|
|
117
118
|
projectId: project.id,
|
|
118
119
|
draftId,
|
|
119
120
|
onEnterDraft: enterDraft,
|
|
120
|
-
onOpenDraft: openDraft
|
|
121
|
+
onOpenDraft: openDraft,
|
|
122
|
+
composerCarry
|
|
121
123
|
}, t3);
|
|
122
124
|
$[7] = apiUrl;
|
|
123
|
-
$[8] =
|
|
124
|
-
$[9] =
|
|
125
|
-
$[10] =
|
|
126
|
-
$[11] =
|
|
127
|
-
$[12] =
|
|
128
|
-
$[13] =
|
|
129
|
-
|
|
125
|
+
$[8] = composerCarry;
|
|
126
|
+
$[9] = draftId;
|
|
127
|
+
$[10] = enterDraft;
|
|
128
|
+
$[11] = openDraft;
|
|
129
|
+
$[12] = project.id;
|
|
130
|
+
$[13] = t3;
|
|
131
|
+
$[14] = t4;
|
|
132
|
+
} else t4 = $[14];
|
|
130
133
|
return t4;
|
|
131
134
|
}
|
|
132
135
|
function Thread(t0) {
|
|
133
|
-
const $ = c(
|
|
134
|
-
const { apiUrl, projectId, draftId, onEnterDraft, onOpenDraft } = t0;
|
|
136
|
+
const $ = c(41);
|
|
137
|
+
const { apiUrl, projectId, draftId, onEnterDraft, onOpenDraft, composerCarry } = t0;
|
|
135
138
|
let t1;
|
|
136
139
|
if ($[0] !== onEnterDraft) {
|
|
137
140
|
t1 = { onEnterDraft };
|
|
@@ -248,35 +251,37 @@ function Thread(t0) {
|
|
|
248
251
|
} else t12 = $[28];
|
|
249
252
|
const t13 = asked ?? void 0;
|
|
250
253
|
let t14;
|
|
251
|
-
if ($[29] !==
|
|
254
|
+
if ($[29] !== composerCarry || $[30] !== sendFollowing || $[31] !== stop || $[32] !== t11 || $[33] !== t12 || $[34] !== t13 || $[35] !== view.running) {
|
|
252
255
|
t14 = /* @__PURE__ */ jsx(ThreadComposer, {
|
|
253
256
|
onSend: sendFollowing,
|
|
254
257
|
onStop: stop,
|
|
255
258
|
selection: t11,
|
|
256
259
|
onClearSelection: t12,
|
|
257
260
|
running: view.running,
|
|
258
|
-
filled: t13
|
|
261
|
+
filled: t13,
|
|
262
|
+
carry: composerCarry
|
|
259
263
|
});
|
|
260
|
-
$[29] =
|
|
261
|
-
$[30] =
|
|
262
|
-
$[31] =
|
|
263
|
-
$[32] =
|
|
264
|
-
$[33] =
|
|
265
|
-
$[34] =
|
|
266
|
-
$[35] =
|
|
267
|
-
|
|
264
|
+
$[29] = composerCarry;
|
|
265
|
+
$[30] = sendFollowing;
|
|
266
|
+
$[31] = stop;
|
|
267
|
+
$[32] = t11;
|
|
268
|
+
$[33] = t12;
|
|
269
|
+
$[34] = t13;
|
|
270
|
+
$[35] = view.running;
|
|
271
|
+
$[36] = t14;
|
|
272
|
+
} else t14 = $[36];
|
|
268
273
|
let t15;
|
|
269
|
-
if ($[
|
|
274
|
+
if ($[37] !== t10 || $[38] !== t14 || $[39] !== t9) {
|
|
270
275
|
t15 = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
271
276
|
t9,
|
|
272
277
|
t10,
|
|
273
278
|
t14
|
|
274
279
|
] });
|
|
275
|
-
$[
|
|
276
|
-
$[
|
|
277
|
-
$[
|
|
278
|
-
$[
|
|
279
|
-
} else t15 = $[
|
|
280
|
+
$[37] = t10;
|
|
281
|
+
$[38] = t14;
|
|
282
|
+
$[39] = t9;
|
|
283
|
+
$[40] = t15;
|
|
284
|
+
} else t15 = $[40];
|
|
280
285
|
return t15;
|
|
281
286
|
}
|
|
282
287
|
function _temp(state) {
|