camox 0.45.0 → 0.46.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.
Files changed (39) hide show
  1. package/dist/core/hooks/useArtifactHost.js +2 -2
  2. package/dist/features/canvas/CamoxCanvas.js +438 -771
  3. package/dist/features/canvas/CanvasPageFrame.js +1 -3
  4. package/dist/features/canvas/CanvasPreviewPageSlot.js +26 -6
  5. package/dist/features/canvas/canvasCamera.js +3 -3
  6. package/dist/features/canvas/canvasFrameDocument.js +4 -19
  7. package/dist/features/canvas/canvasItems.js +12 -102
  8. package/dist/features/canvas/canvasStore.js +3 -92
  9. package/dist/features/canvas/sidebar/CanvasNavigator.js +81 -183
  10. package/dist/features/canvas/sidebar/CanvasSidebar.js +22 -28
  11. package/dist/features/canvas/sidebar/CuratedPageInspector.js +2 -2
  12. package/dist/features/canvas/useCanvasCamera.js +0 -20
  13. package/dist/features/canvas/useCanvasFrame.js +5 -6
  14. package/dist/features/preview/CamoxPreview.js +3 -3
  15. package/dist/features/preview/components/{AddBlockDialog.js → AddBlockSheet.js} +35 -32
  16. package/dist/features/preview/components/BlockActionsPopover.js +6 -6
  17. package/dist/features/preview/components/BlockThumbnail.js +31 -33
  18. package/dist/features/preview/components/Overlays.js +1 -1
  19. package/dist/features/preview/components/PageTree.js +1 -1
  20. package/dist/features/preview/components/PreviewPanel.js +1 -1
  21. package/dist/features/preview/previewStore.js +9 -9
  22. package/dist/features/provider/CoreCamoxProvider.js +9 -6
  23. package/dist/features/routes/pageRuntime.js +8 -8
  24. package/dist/features/runtime/runtime.d.ts +2 -7
  25. package/dist/features/runtime/runtime.js +6 -19
  26. package/dist/features/studio/FollowAgentProvider.js +11 -22
  27. package/dist/features/studio/components/FaviconDialog.js +3 -3
  28. package/dist/features/studio/followAgent.js +5 -14
  29. package/dist/features/studio/routes.js +1 -23
  30. package/dist/lib/auth.js +36 -24
  31. package/dist/lib/studio-reads.js +0 -20
  32. package/dist/package.js +1 -1
  33. package/dist/studio.css +1 -1
  34. package/package.json +4 -4
  35. package/skills/camox-expand/SKILL.md +5 -4
  36. package/dist/features/canvas/CanvasBlockFrame.js +0 -353
  37. package/dist/features/canvas/CanvasBlockHeader.js +0 -55
  38. package/dist/features/canvas/CanvasShelfMarker.js +0 -255
  39. package/dist/features/canvas/sidebar/CatalogBlockInspector.js +0 -189
package/dist/lib/auth.js CHANGED
@@ -285,46 +285,58 @@ function useSessionState(authClient, track) {
285
285
  return React.useSyncExternalStore(track ? subscribe : noSubscription, getSnapshot, getSnapshot);
286
286
  }
287
287
  function useAuthState() {
288
- const $ = c(8);
289
- const { authClient, initialAuthenticated: t0 } = useAuthContext();
288
+ const $ = c(9);
289
+ const { authClient, initialAuthenticated: t0, exchangingToken: t1 } = useAuthContext();
290
290
  const initialAuthenticated = t0 === void 0 ? false : t0;
291
+ const exchangingToken = t1 === void 0 ? false : t1;
291
292
  const hydrated = React.useSyncExternalStore(subscribeToHydration, _temp2, _temp3);
292
- let t1;
293
+ let t2;
293
294
  if ($[0] !== hydrated || $[1] !== initialAuthenticated) {
294
- t1 = initialAuthenticated || hydrated && hasStoredAuthCookie();
295
+ t2 = initialAuthenticated || hydrated && hasStoredAuthCookie();
295
296
  $[0] = hydrated;
296
297
  $[1] = initialAuthenticated;
297
- $[2] = t1;
298
- } else t1 = $[2];
299
- const tracksSession = t1;
298
+ $[2] = t2;
299
+ } else t2 = $[2];
300
+ const tracksSession = t2;
300
301
  const { data: session, isPending } = useSessionState(authClient, tracksSession);
301
- if (!tracksSession) {
302
- const t2 = !hydrated;
302
+ if (exchangingToken && !initialAuthenticated) {
303
303
  let t3;
304
- if ($[3] !== t2) {
304
+ if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
305
305
  t3 = {
306
306
  isAuthenticated: false,
307
- isLoading: t2
307
+ isLoading: true
308
308
  };
309
- $[3] = t2;
310
- $[4] = t3;
311
- } else t3 = $[4];
309
+ $[3] = t3;
310
+ } else t3 = $[3];
312
311
  return t3;
313
312
  }
313
+ if (!tracksSession) {
314
+ const t3 = !hydrated;
315
+ let t4;
316
+ if ($[4] !== t3) {
317
+ t4 = {
318
+ isAuthenticated: false,
319
+ isLoading: t3
320
+ };
321
+ $[4] = t3;
322
+ $[5] = t4;
323
+ } else t4 = $[5];
324
+ return t4;
325
+ }
314
326
  const useInitial = !hydrated || isPending;
315
- const t2 = useInitial ? initialAuthenticated : !!session;
316
- const t3 = useInitial && !initialAuthenticated;
317
- let t4;
318
- if ($[5] !== t2 || $[6] !== t3) {
319
- t4 = {
320
- isAuthenticated: t2,
321
- isLoading: t3
327
+ const t3 = useInitial ? initialAuthenticated : !!session;
328
+ const t4 = useInitial && !initialAuthenticated;
329
+ let t5;
330
+ if ($[6] !== t3 || $[7] !== t4) {
331
+ t5 = {
332
+ isAuthenticated: t3,
333
+ isLoading: t4
322
334
  };
323
- $[5] = t2;
324
335
  $[6] = t3;
325
336
  $[7] = t4;
326
- } else t4 = $[7];
327
- return t4;
337
+ $[8] = t5;
338
+ } else t5 = $[8];
339
+ return t5;
328
340
  }
329
341
  function _temp3() {
330
342
  return false;
@@ -148,26 +148,6 @@ const reads = {
148
148
  fetch: async ({ api, signal }, { projectId }) => Object.fromEntries((await api.blocks.getUsageCounts({ projectId }, { signal })).map(({ type, count }) => [type, count])),
149
149
  staleTime: Infinity
150
150
  }),
151
- pagesUsingBlock: entry({
152
- key: ({ type }) => [
153
- ...usageCountsPrefix,
154
- "pages",
155
- type
156
- ],
157
- fetch: ({ api, signal }, { projectId, type }) => api.blocks.getPagesUsing({
158
- projectId,
159
- type
160
- }, { signal }),
161
- staleTime: Infinity
162
- }),
163
- syncedContent: entry({
164
- key: ({ type }) => queryKeys.blocks.getSyncedContent(type),
165
- fetch: ({ api, signal }, { projectId, type }) => api.blocks.getSyncedContent({
166
- projectId,
167
- type
168
- }, { signal }),
169
- staleTime: Infinity
170
- }),
171
151
  pageMarkdown: entry({
172
152
  key: (pageId) => queryKeys.blocks.getPageMarkdown(pageId),
173
153
  fetch: async ({ api, signal }, pageId) => (await api.blocks.getPageMarkdown({ pageId }, { signal })).markdown,
package/dist/package.js CHANGED
@@ -1,5 +1,5 @@
1
1
  //#region package.json
2
- var version = "0.45.0";
2
+ var version = "0.46.0";
3
3
 
4
4
  //#endregion
5
5
  export { version };