camox 0.58.1 → 0.60.2

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.
Files changed (102) hide show
  1. package/dist/core/createBlock.js +1 -1
  2. package/dist/core/editing/createEditableBlock.js +2 -2
  3. package/dist/core/lib/recordScope.js +1 -1
  4. package/dist/features/canvas/CamoxCanvas.js +2 -2
  5. package/dist/features/canvas/CanvasOverlays.js +1 -1
  6. package/dist/features/canvas/sidebar/LayoutPageSeo.js +1 -1
  7. package/dist/features/canvas/sidebar/PageInspector.js +1 -1
  8. package/dist/features/content/CamoxContent.js +1 -1
  9. package/dist/features/content/components/MissingFromLocale.js +1 -1
  10. package/dist/features/page/CuratedPageContent.js +1 -1
  11. package/dist/features/preview/CamoxPreview.js +3 -3
  12. package/dist/features/preview/components/AddBlockSheet.js +1 -1
  13. package/dist/features/preview/components/AssetLightbox.js +1 -1
  14. package/dist/features/preview/components/BlockActionsPopover.js +1 -1
  15. package/dist/features/preview/components/CreatePageModal.js +2 -2
  16. package/dist/features/preview/components/FieldOverlayStyles.js +1 -1
  17. package/dist/features/preview/components/MobilePreviewDrawer.js +1 -1
  18. package/dist/features/preview/components/Overlays.js +1 -1
  19. package/dist/features/preview/components/PageInfo.js +1 -1
  20. package/dist/features/preview/components/PagePicker.js +1 -1
  21. package/dist/features/preview/components/PageTree.js +1 -1
  22. package/dist/features/preview/components/PreviewPanel.js +1 -1
  23. package/dist/features/preview/components/PreviewToolbar.js +1 -1
  24. package/dist/features/preview/components/SelectionEditor.js +2 -2
  25. package/dist/features/preview/components/StudioEditingFallback.js +1 -1
  26. package/dist/features/provider/AuthenticatedCamoxProvider.js +1 -1
  27. package/dist/features/provider/CamoxProvider.js +1 -1
  28. package/dist/features/provider/CoreCamoxProvider.js +3 -3
  29. package/dist/features/provider/components/CommandPalette.js +1 -1
  30. package/dist/features/renderer/RendererApp.js +187 -103
  31. package/dist/features/renderer/rendererHost.js +3 -7
  32. package/dist/features/routes/pageRuntime.d.ts +2 -5
  33. package/dist/features/routes/pageRuntime.js +1 -2
  34. package/dist/features/runtime/RuntimeChrome.js +1 -1
  35. package/dist/features/runtime/loopbackFetch.d.ts +8 -0
  36. package/dist/features/runtime/navigationTarget.js +1 -2
  37. package/dist/features/runtime/pageApp.js +1 -1
  38. package/dist/features/runtime/publicCache.d.ts +21 -0
  39. package/dist/features/runtime/publishingDraft.d.ts +4 -0
  40. package/dist/features/runtime/rendererClient.js +1 -1
  41. package/dist/features/runtime/runtime.d.ts +0 -5
  42. package/dist/features/runtime/runtime.js +80 -33
  43. package/dist/features/runtime/worker.js +4 -7
  44. package/dist/features/runtime/workerRequest.d.ts +8 -0
  45. package/dist/features/runtime/workerRuntime.d.ts +5 -0
  46. package/dist/features/runtime/workerRuntime.js +6 -0
  47. package/dist/features/sdkBundle/buildSdkBundle.d.ts +40 -0
  48. package/dist/features/sdkBundle/buildSdkBundle.js +323 -0
  49. package/dist/features/sdkBundle/localSdkBundle.d.ts +44 -0
  50. package/dist/features/sdkBundle/localSdkBundle.js +162 -0
  51. package/dist/features/sdkBundle/sdkBundle.d.ts +3 -0
  52. package/dist/features/sdkBundle/sdkBundle.js +4 -0
  53. package/dist/features/sdkBundle/sdkBundleName.d.ts +59 -0
  54. package/dist/features/sdkBundle/sdkBundleName.js +164 -0
  55. package/dist/features/sdkBundle/specifiers.d.ts +34 -0
  56. package/dist/features/sdkBundle/specifiers.js +146 -0
  57. package/dist/features/settings/FaviconSettings.js +1 -1
  58. package/dist/features/settings/SocialProfilesSettings.js +284 -151
  59. package/dist/features/studio/CamoxStudio.js +1 -1
  60. package/dist/features/studio/FollowAgentProvider.js +72 -13
  61. package/dist/features/studio/components/ChatWidget.js +86 -44
  62. package/dist/features/studio/components/DraftsControl.js +232 -201
  63. package/dist/features/studio/components/LocalePicker.js +2 -2
  64. package/dist/features/studio/components/Navbar.js +3 -3
  65. package/dist/features/studio/components/Patrol.js +312 -209
  66. package/dist/features/studio/components/ProjectMenu.js +2 -2
  67. package/dist/features/studio/components/ReviewDraftSheet.js +9 -15
  68. package/dist/features/studio/components/Squareling.js +164 -66
  69. package/dist/features/studio/components/ThreadComposer.js +139 -69
  70. package/dist/features/studio/components/ThreadMessages.js +216 -64
  71. package/dist/features/studio/components/UserButton.js +2 -2
  72. package/dist/features/studio/draftLabel.js +1 -2
  73. package/dist/features/studio/draftNotice.js +0 -1
  74. package/dist/features/studio/editorWhereContext.js +11 -0
  75. package/dist/features/studio/showInCanvas.js +1 -1
  76. package/dist/features/studio/useEditorSelection.js +135 -0
  77. package/dist/features/vite/definitionsSync.js +14 -60
  78. package/dist/features/vite/devSignIn.js +1 -1
  79. package/dist/features/vite/hostedChecks.js +1 -1
  80. package/dist/features/vite/runtimeDev.js +2 -2
  81. package/dist/features/vite/sdkBundleBuild.js +74 -0
  82. package/dist/features/vite/staticAssetHeaders.js +7 -4
  83. package/dist/features/vite/vite.d.ts +8 -7
  84. package/dist/features/vite/vite.js +67 -28
  85. package/dist/lib/api-client-server.js +25 -8
  86. package/dist/lib/api-client.js +2 -6
  87. package/dist/lib/auth.js +25 -59
  88. package/dist/lib/draft-scope.js +5 -25
  89. package/dist/lib/preview-handoff.js +1 -1
  90. package/dist/lib/server-auth-cookie.js +23 -11
  91. package/dist/lib/stored-auth-cookies.js +76 -0
  92. package/dist/lib/studio-reads.js +1 -1
  93. package/dist/lib/use-thread.js +40 -40
  94. package/dist/package.js +1 -1
  95. package/dist/studio.css +1 -1
  96. package/package.json +17 -4
  97. package/skills/camox/references/block-definitions.md +1 -1
  98. package/dist/features/vite/publishSeededContent.js +0 -30
  99. package/skills/camox-cli/SKILL.md +0 -15
  100. package/skills/camox-cli/references/cli-common.md +0 -58
  101. package/skills/camox-cli/references/cli-content.md +0 -181
  102. package/skills/camox-cli/references/cli-publishing.md +0 -26
@@ -1,11 +1,13 @@
1
- import { AuthContext } from "../../../lib/auth.js";
2
1
  import { useCurrentDraftId, useDraftScope } from "../../../lib/draft-scope.js";
3
2
  import { useNavigate } from "../../navigation/navigation.js";
3
+ import { AuthContext } from "../../../lib/auth.js";
4
4
  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 { 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(26);
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] !== follow || $[10] !== send) {
160
- t5 = (text) => {
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
- $[9] = follow;
165
- $[10] = send;
166
- $[11] = t5;
167
- } else t5 = $[11];
168
- const sendFollowing = t5;
169
- let t6;
170
- if ($[12] !== onOpenDraft || $[13] !== sending || $[14] !== view) {
171
- t6 = /* @__PURE__ */ jsx(ThreadMessages, {
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
- $[12] = onOpenDraft;
177
- $[13] = sending;
178
- $[14] = view;
179
- $[15] = t6;
180
- } else t6 = $[15];
181
- let t7;
182
- if ($[16] !== error) {
183
- t7 = error && /* @__PURE__ */ jsx("p", {
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
- $[16] = error;
189
- $[17] = t7;
190
- } else t7 = $[17];
191
- let t8;
192
- if ($[18] !== sendFollowing || $[19] !== stop || $[20] !== view.running) {
193
- t8 = /* @__PURE__ */ jsx(ThreadComposer, {
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
- $[18] = sendFollowing;
199
- $[19] = stop;
200
- $[20] = view.running;
201
- $[21] = t8;
202
- } else t8 = $[21];
203
- let t9;
204
- if ($[22] !== t6 || $[23] !== t7 || $[24] !== t8) {
205
- t9 = /* @__PURE__ */ jsxs(Fragment, { children: [
206
- t6,
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
- $[22] = t6;
211
- $[23] = t7;
212
- $[24] = t8;
213
- $[25] = t9;
214
- } else t9 = $[25];
215
- return t9;
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