camox 0.59.0 → 0.61.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/core/createApp.d.ts +8 -8
- package/dist/core/createBlock.d.ts +1 -2
- package/dist/core/createLayout.d.ts +10 -2
- package/dist/core/createLayout.js +1 -3
- package/dist/core/editing/BlockEditingRuntime.d.ts +1 -0
- package/dist/core/editing/CompleteBlockEditingRuntime.js +12 -9
- package/dist/core/editing/createEditableBlock.d.ts +4 -4
- package/dist/core/editing/createEditableBlock.js +20 -26
- package/dist/core/lib/artifactData.js +2 -2
- package/dist/core/lib/contentType.js +5 -4
- package/dist/features/preview/components/SelectionEditor.js +1 -1
- package/dist/features/renderer/RendererApp.js +187 -103
- package/dist/features/renderer/rendererHost.js +23 -16
- package/dist/features/renderer/studioConnection.js +8 -4
- package/dist/features/runtime/loopbackFetch.d.ts +8 -0
- package/dist/features/runtime/publicCache.d.ts +21 -0
- package/dist/features/runtime/publishingDraft.d.ts +4 -0
- package/dist/features/runtime/runtime.js +54 -3
- package/dist/features/runtime/worker.js +1 -4
- package/dist/features/runtime/workerRequest.d.ts +8 -0
- package/dist/features/runtime/workerRuntime.d.ts +5 -0
- package/dist/features/runtime/workerRuntime.js +6 -0
- package/dist/features/sdkBundle/buildSdkBundle.d.ts +40 -0
- package/dist/features/sdkBundle/buildSdkBundle.js +323 -0
- package/dist/features/sdkBundle/localSdkBundle.d.ts +44 -0
- package/dist/features/sdkBundle/localSdkBundle.js +162 -0
- package/dist/features/sdkBundle/sdkBundle.d.ts +3 -0
- package/dist/features/sdkBundle/sdkBundle.js +4 -0
- package/dist/features/sdkBundle/sdkBundleName.d.ts +59 -0
- package/dist/features/sdkBundle/sdkBundleName.js +164 -0
- package/dist/features/sdkBundle/specifiers.d.ts +34 -0
- package/dist/features/sdkBundle/specifiers.js +146 -0
- package/dist/features/settings/SocialProfilesSettings.js +284 -151
- package/dist/features/settings/useProjectMutation.js +6 -5
- package/dist/features/studio/FollowAgentProvider.js +71 -12
- package/dist/features/studio/components/ChatWidget.js +85 -43
- package/dist/features/studio/components/Patrol.js +311 -208
- package/dist/features/studio/components/Squareling.js +164 -66
- package/dist/features/studio/components/ThreadComposer.js +139 -69
- package/dist/features/studio/components/ThreadMessages.js +115 -45
- package/dist/features/studio/editorWhereContext.js +11 -0
- package/dist/features/studio/useEditorSelection.js +135 -0
- package/dist/features/vite/hostedChecks.js +1 -1
- package/dist/features/vite/runtimeDev.js +2 -1
- package/dist/features/vite/sdkBundleBuild.js +74 -0
- package/dist/features/vite/staticAssetHeaders.js +7 -4
- package/dist/features/vite/vite.d.ts +0 -2
- package/dist/features/vite/vite.js +33 -3
- package/dist/lib/auth.js +24 -58
- package/dist/lib/server-auth-cookie.js +12 -2
- package/dist/lib/stored-auth-cookies.js +76 -0
- package/dist/lib/use-thread.js +9 -5
- package/dist/package.js +1 -1
- package/dist/studio.css +1 -1
- package/package.json +17 -4
|
@@ -6,6 +6,8 @@ import { cn } from "../../../lib/utils.js";
|
|
|
6
6
|
import { BOTTOM_CARD_EDGES, CARD_BODY_EDGES } from "../../preview/components/SidebarStack.js";
|
|
7
7
|
import { FollowAgentContext } from "../followAgentContext.js";
|
|
8
8
|
import { useThread } from "../../../lib/use-thread.js";
|
|
9
|
+
import { EditorWhereContext } from "../editorWhereContext.js";
|
|
10
|
+
import { useEditorSelection } from "../useEditorSelection.js";
|
|
9
11
|
import { ThreadComposer } from "./ThreadComposer.js";
|
|
10
12
|
import { ThreadMessages } from "./ThreadMessages.js";
|
|
11
13
|
import { c } from "react/compiler-runtime";
|
|
@@ -19,7 +21,9 @@ import { EMPTY_THREAD_VIEW } from "@camox/api-contract/threads";
|
|
|
19
21
|
* studio it is only hidden: the studio keeps following the editor's runs there. It follows
|
|
20
22
|
* where the studio is: the editor's own Live thread on Live, and the draft's thread in a draft.
|
|
21
23
|
* When the agent on Live hands the editor's request off to a draft, the studio that asked enters
|
|
22
|
-
* it, if it still shows Live; the card the Live turn ends on opens it too.
|
|
24
|
+
* it, if it still shows Live; the card the Live turn ends on opens it too. Each message tells the
|
|
25
|
+
* agent where the editor is: the page they look at, with what they selected on it unless they
|
|
26
|
+
* cleared it from the composer, or the Canvas with no page selected.
|
|
23
27
|
*/
|
|
24
28
|
function ChatWidget(t0) {
|
|
25
29
|
const $ = c(6);
|
|
@@ -122,7 +126,7 @@ function CurrentThread() {
|
|
|
122
126
|
return t4;
|
|
123
127
|
}
|
|
124
128
|
function Thread(t0) {
|
|
125
|
-
const $ = c(
|
|
129
|
+
const $ = c(36);
|
|
126
130
|
const { apiUrl, projectId, draftId, onEnterDraft, onOpenDraft } = t0;
|
|
127
131
|
let t1;
|
|
128
132
|
if ($[0] !== onEnterDraft) {
|
|
@@ -155,64 +159,102 @@ function Thread(t0) {
|
|
|
155
159
|
$[8] = t4;
|
|
156
160
|
} else t4 = $[8];
|
|
157
161
|
React.useEffect(t3, t4);
|
|
162
|
+
const where = React.use(EditorWhereContext);
|
|
163
|
+
const selection = useEditorSelection(where);
|
|
158
164
|
let t5;
|
|
159
|
-
if ($[9] !==
|
|
160
|
-
t5 =
|
|
165
|
+
if ($[9] !== selection) {
|
|
166
|
+
t5 = selection ? JSON.stringify([
|
|
167
|
+
selection.blockId,
|
|
168
|
+
selection.itemId,
|
|
169
|
+
selection.recordId,
|
|
170
|
+
selection.fieldName
|
|
171
|
+
]) : null;
|
|
172
|
+
$[9] = selection;
|
|
173
|
+
$[10] = t5;
|
|
174
|
+
} else t5 = $[10];
|
|
175
|
+
const selectionKey = t5;
|
|
176
|
+
const [cleared, setCleared] = React.useState(null);
|
|
177
|
+
if (cleared !== null && selectionKey !== cleared) setCleared(null);
|
|
178
|
+
const carried = selection && selectionKey !== cleared ? selection : void 0;
|
|
179
|
+
let t6;
|
|
180
|
+
if ($[11] !== carried || $[12] !== follow || $[13] !== send || $[14] !== where) {
|
|
181
|
+
t6 = (text) => {
|
|
161
182
|
follow?.resume();
|
|
162
|
-
send(text
|
|
183
|
+
send(text, where?.on === "page" && carried ? {
|
|
184
|
+
...where,
|
|
185
|
+
selection: carried
|
|
186
|
+
} : where);
|
|
163
187
|
};
|
|
164
|
-
$[
|
|
165
|
-
$[
|
|
166
|
-
$[
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
188
|
+
$[11] = carried;
|
|
189
|
+
$[12] = follow;
|
|
190
|
+
$[13] = send;
|
|
191
|
+
$[14] = where;
|
|
192
|
+
$[15] = t6;
|
|
193
|
+
} else t6 = $[15];
|
|
194
|
+
const sendFollowing = t6;
|
|
195
|
+
let t7;
|
|
196
|
+
if ($[16] !== onOpenDraft || $[17] !== sending || $[18] !== view) {
|
|
197
|
+
t7 = /* @__PURE__ */ jsx(ThreadMessages, {
|
|
172
198
|
view,
|
|
173
199
|
sending,
|
|
174
200
|
onOpenDraft
|
|
175
201
|
});
|
|
176
|
-
$[
|
|
177
|
-
$[
|
|
178
|
-
$[
|
|
179
|
-
$[
|
|
180
|
-
} else
|
|
181
|
-
let
|
|
182
|
-
if ($[
|
|
183
|
-
|
|
202
|
+
$[16] = onOpenDraft;
|
|
203
|
+
$[17] = sending;
|
|
204
|
+
$[18] = view;
|
|
205
|
+
$[19] = t7;
|
|
206
|
+
} else t7 = $[19];
|
|
207
|
+
let t8;
|
|
208
|
+
if ($[20] !== error) {
|
|
209
|
+
t8 = error && /* @__PURE__ */ jsx("p", {
|
|
184
210
|
role: "alert",
|
|
185
211
|
className: "text-destructive px-2 pt-2 text-sm",
|
|
186
212
|
children: error
|
|
187
213
|
});
|
|
188
|
-
$[
|
|
189
|
-
$[
|
|
190
|
-
} else
|
|
191
|
-
let
|
|
192
|
-
if ($[
|
|
193
|
-
|
|
214
|
+
$[20] = error;
|
|
215
|
+
$[21] = t8;
|
|
216
|
+
} else t8 = $[21];
|
|
217
|
+
let t9;
|
|
218
|
+
if ($[22] !== carried?.path) {
|
|
219
|
+
t9 = carried?.path.at(-1);
|
|
220
|
+
$[22] = carried?.path;
|
|
221
|
+
$[23] = t9;
|
|
222
|
+
} else t9 = $[23];
|
|
223
|
+
let t10;
|
|
224
|
+
if ($[24] !== selectionKey) {
|
|
225
|
+
t10 = () => selectionKey !== null && setCleared(selectionKey);
|
|
226
|
+
$[24] = selectionKey;
|
|
227
|
+
$[25] = t10;
|
|
228
|
+
} else t10 = $[25];
|
|
229
|
+
let t11;
|
|
230
|
+
if ($[26] !== sendFollowing || $[27] !== stop || $[28] !== t10 || $[29] !== t9 || $[30] !== view.running) {
|
|
231
|
+
t11 = /* @__PURE__ */ jsx(ThreadComposer, {
|
|
194
232
|
onSend: sendFollowing,
|
|
195
233
|
onStop: stop,
|
|
234
|
+
selection: t9,
|
|
235
|
+
onClearSelection: t10,
|
|
196
236
|
running: view.running
|
|
197
237
|
});
|
|
198
|
-
$[
|
|
199
|
-
$[
|
|
200
|
-
$[
|
|
201
|
-
$[
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
238
|
+
$[26] = sendFollowing;
|
|
239
|
+
$[27] = stop;
|
|
240
|
+
$[28] = t10;
|
|
241
|
+
$[29] = t9;
|
|
242
|
+
$[30] = view.running;
|
|
243
|
+
$[31] = t11;
|
|
244
|
+
} else t11 = $[31];
|
|
245
|
+
let t12;
|
|
246
|
+
if ($[32] !== t11 || $[33] !== t7 || $[34] !== t8) {
|
|
247
|
+
t12 = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
207
248
|
t7,
|
|
208
|
-
t8
|
|
249
|
+
t8,
|
|
250
|
+
t11
|
|
209
251
|
] });
|
|
210
|
-
$[
|
|
211
|
-
$[
|
|
212
|
-
$[
|
|
213
|
-
$[
|
|
214
|
-
} else
|
|
215
|
-
return
|
|
252
|
+
$[32] = t11;
|
|
253
|
+
$[33] = t7;
|
|
254
|
+
$[34] = t8;
|
|
255
|
+
$[35] = t12;
|
|
256
|
+
} else t12 = $[35];
|
|
257
|
+
return t12;
|
|
216
258
|
}
|
|
217
259
|
|
|
218
260
|
//#endregion
|