camox 0.76.1 → 0.78.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 (33) hide show
  1. package/dist/core/lib/artifactTheme.js +43 -6
  2. package/dist/features/canvas/CamoxCanvas.js +187 -197
  3. package/dist/features/canvas/canvasCameraController.js +1 -1
  4. package/dist/features/canvas/canvasItems.js +40 -9
  5. package/dist/features/canvas/sidebar/ContentSidebarFrame.js +15 -11
  6. package/dist/features/canvas/useCanvasLayout.js +34 -0
  7. package/dist/features/memory/CamoxMemory.js +747 -0
  8. package/dist/features/preview/EditablePageExperience.js +2 -0
  9. package/dist/features/runtime/publicCache.d.ts +2 -0
  10. package/dist/features/runtime/publicCache.js +27 -4
  11. package/dist/features/runtime/runtime.d.ts +1 -1
  12. package/dist/features/runtime/runtime.js +34 -15
  13. package/dist/features/studio/FollowAgentProvider.js +1 -1
  14. package/dist/features/studio/components/AgentSidebar.js +22 -16
  15. package/dist/features/studio/components/DraftBar.js +167 -103
  16. package/dist/features/studio/components/{ReviewDraftDialog.js → DraftReview.js} +191 -218
  17. package/dist/features/studio/components/DraftsControl.js +174 -202
  18. package/dist/features/studio/components/DraftsSheet.js +102 -94
  19. package/dist/features/studio/components/LocalePicker.js +518 -134
  20. package/dist/features/studio/components/Navbar.js +121 -84
  21. package/dist/features/studio/components/PublishedTab.js +21 -20
  22. package/dist/features/studio/routes.js +3 -1
  23. package/dist/features/studio/studioStore.js +12 -9
  24. package/dist/features/studio/usePublishDraft.js +116 -0
  25. package/dist/features/studio/viewSwitch.js +10 -7
  26. package/dist/lib/locale-path.js +2 -2
  27. package/dist/lib/queries.js +12 -2
  28. package/dist/lib/studio-reads.js +6 -0
  29. package/dist/package.js +1 -1
  30. package/dist/studio.css +1 -1
  31. package/package.json +5 -5
  32. package/skills/camox/references/artifacts.md +7 -0
  33. package/LICENSE.md +0 -21
@@ -16,146 +16,154 @@ import { Tabs, TabsContent, TabsList, TabsTrigger } from "@camox/ui/tabs";
16
16
  /**
17
17
  * The drafts no longer in progress, opened from the draft picker: a tab of archived drafts to
18
18
  * restore or delete (ADR 0046), and a tab of Publications, to read why Live changed (ADR 0045).
19
+ * Opened on `publicationId`, it shows that Publication.
19
20
  */
20
21
  function DraftsSheet(t0) {
21
- const $ = c(36);
22
- const { projectId, open, onOpenChange } = t0;
23
- let t1;
22
+ const $ = c(39);
23
+ const { projectId, open, publicationId: t1, onOpenChange } = t0;
24
+ const publicationId = t1 === void 0 ? null : t1;
25
+ let t2;
24
26
  if ($[0] !== projectId) {
25
- t1 = reads.archivedDrafts({ projectId });
27
+ t2 = reads.archivedDrafts({ projectId });
26
28
  $[0] = projectId;
27
- $[1] = t1;
28
- } else t1 = $[1];
29
- let t2;
29
+ $[1] = t2;
30
+ } else t2 = $[1];
31
+ let t3;
30
32
  if ($[2] !== open) {
31
- t2 = { enabled: open };
33
+ t3 = { enabled: open };
32
34
  $[2] = open;
33
- $[3] = t2;
34
- } else t2 = $[3];
35
- const archived = useReadQuery(t1, t2);
36
- let t3;
35
+ $[3] = t3;
36
+ } else t3 = $[3];
37
+ const archived = useReadQuery(t2, t3);
38
+ let t4;
37
39
  if ($[4] !== projectId) {
38
- t3 = reads.publications({ projectId });
40
+ t4 = reads.publications({ projectId });
39
41
  $[4] = projectId;
40
- $[5] = t3;
41
- } else t3 = $[5];
42
- let t4;
42
+ $[5] = t4;
43
+ } else t4 = $[5];
44
+ let t5;
43
45
  if ($[6] !== open) {
44
- t4 = { enabled: open };
46
+ t5 = { enabled: open };
45
47
  $[6] = open;
46
- $[7] = t4;
47
- } else t4 = $[7];
48
- const publications = useReadQuery(t3, t4);
49
- let t5;
48
+ $[7] = t5;
49
+ } else t5 = $[7];
50
+ const publications = useReadQuery(t4, t5);
51
+ let t6;
50
52
  if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
51
- t5 = /* @__PURE__ */ jsxs(SheetHeader, {
53
+ t6 = /* @__PURE__ */ jsxs(SheetHeader, {
52
54
  className: "border-b",
53
55
  children: [/* @__PURE__ */ jsx(SheetTitle, { children: "Drafts" }), /* @__PURE__ */ jsx(SheetDescription, { children: "Drafts set aside, to bring back or delete, and what was published." })]
54
56
  });
55
- $[8] = t5;
56
- } else t5 = $[8];
57
- const t6 = archived.data?.length;
58
- let t7;
59
- if ($[9] !== t6) {
60
- t7 = /* @__PURE__ */ jsxs(TabsTrigger, {
57
+ $[8] = t6;
58
+ } else t6 = $[8];
59
+ const t7 = publicationId ?? "archived";
60
+ const t8 = publicationId ? "published" : "archived";
61
+ const t9 = archived.data?.length;
62
+ let t10;
63
+ if ($[9] !== t9) {
64
+ t10 = /* @__PURE__ */ jsxs(TabsTrigger, {
61
65
  value: "archived",
62
- children: ["Archived ", /* @__PURE__ */ jsx(TabCount, { count: t6 })]
66
+ children: ["Archived ", /* @__PURE__ */ jsx(TabCount, { count: t9 })]
63
67
  });
64
- $[9] = t6;
65
- $[10] = t7;
66
- } else t7 = $[10];
67
- const t8 = publications.data?.length;
68
- let t9;
69
- if ($[11] !== t8) {
70
- t9 = /* @__PURE__ */ jsxs(TabsTrigger, {
68
+ $[9] = t9;
69
+ $[10] = t10;
70
+ } else t10 = $[10];
71
+ const t11 = publications.data?.length;
72
+ let t12;
73
+ if ($[11] !== t11) {
74
+ t12 = /* @__PURE__ */ jsxs(TabsTrigger, {
71
75
  value: "published",
72
- children: ["Published ", /* @__PURE__ */ jsx(TabCount, { count: t8 })]
76
+ children: ["Published ", /* @__PURE__ */ jsx(TabCount, { count: t11 })]
73
77
  });
74
- $[11] = t8;
75
- $[12] = t9;
76
- } else t9 = $[12];
77
- let t10;
78
- if ($[13] !== t7 || $[14] !== t9) {
79
- t10 = /* @__PURE__ */ jsxs(TabsList, { children: [t7, t9] });
80
- $[13] = t7;
81
- $[14] = t9;
82
- $[15] = t10;
83
- } else t10 = $[15];
84
- let t11;
78
+ $[11] = t11;
79
+ $[12] = t12;
80
+ } else t12 = $[12];
81
+ let t13;
82
+ if ($[13] !== t10 || $[14] !== t12) {
83
+ t13 = /* @__PURE__ */ jsxs(TabsList, { children: [t10, t12] });
84
+ $[13] = t10;
85
+ $[14] = t12;
86
+ $[15] = t13;
87
+ } else t13 = $[15];
88
+ let t14;
85
89
  if ($[16] !== onOpenChange || $[17] !== open || $[18] !== projectId) {
86
- t11 = open && /* @__PURE__ */ jsx(ArchivedDrafts, {
90
+ t14 = open && /* @__PURE__ */ jsx(ArchivedDrafts, {
87
91
  projectId,
88
92
  onRestored: () => onOpenChange(false)
89
93
  });
90
94
  $[16] = onOpenChange;
91
95
  $[17] = open;
92
96
  $[18] = projectId;
93
- $[19] = t11;
94
- } else t11 = $[19];
95
- let t12;
96
- if ($[20] !== t11) {
97
- t12 = /* @__PURE__ */ jsx(TabsContent, {
97
+ $[19] = t14;
98
+ } else t14 = $[19];
99
+ let t15;
100
+ if ($[20] !== t14) {
101
+ t15 = /* @__PURE__ */ jsx(TabsContent, {
98
102
  value: "archived",
99
103
  className: "overflow-y-auto",
100
- children: t11
104
+ children: t14
101
105
  });
102
- $[20] = t11;
103
- $[21] = t12;
104
- } else t12 = $[21];
105
- let t13;
106
- if ($[22] !== onOpenChange || $[23] !== open || $[24] !== projectId) {
107
- t13 = open && /* @__PURE__ */ jsx(PublishedTab, {
106
+ $[20] = t14;
107
+ $[21] = t15;
108
+ } else t15 = $[21];
109
+ let t16;
110
+ if ($[22] !== onOpenChange || $[23] !== open || $[24] !== projectId || $[25] !== publicationId) {
111
+ t16 = open && /* @__PURE__ */ jsx(PublishedTab, {
108
112
  projectId,
113
+ opening: publicationId,
109
114
  onEntered: () => onOpenChange(false)
110
115
  });
111
116
  $[22] = onOpenChange;
112
117
  $[23] = open;
113
118
  $[24] = projectId;
114
- $[25] = t13;
115
- } else t13 = $[25];
116
- let t14;
117
- if ($[26] !== t13) {
118
- t14 = /* @__PURE__ */ jsx(TabsContent, {
119
+ $[25] = publicationId;
120
+ $[26] = t16;
121
+ } else t16 = $[26];
122
+ let t17;
123
+ if ($[27] !== t16) {
124
+ t17 = /* @__PURE__ */ jsx(TabsContent, {
119
125
  value: "published",
120
126
  className: "overflow-y-auto",
121
- children: t13
127
+ children: t16
122
128
  });
123
- $[26] = t13;
124
- $[27] = t14;
125
- } else t14 = $[27];
126
- let t15;
127
- if ($[28] !== t10 || $[29] !== t12 || $[30] !== t14) {
128
- t15 = /* @__PURE__ */ jsxs(SheetContent, {
129
+ $[27] = t16;
130
+ $[28] = t17;
131
+ } else t17 = $[28];
132
+ let t18;
133
+ if ($[29] !== t13 || $[30] !== t15 || $[31] !== t17 || $[32] !== t7 || $[33] !== t8) {
134
+ t18 = /* @__PURE__ */ jsxs(SheetContent, {
129
135
  side: "right",
130
136
  className: "gap-0 data-[side=right]:sm:max-w-3xl",
131
- children: [t5, /* @__PURE__ */ jsxs(Tabs, {
132
- defaultValue: "archived",
137
+ children: [t6, /* @__PURE__ */ jsxs(Tabs, {
138
+ defaultValue: t8,
133
139
  className: "flex-1 overflow-hidden p-4",
134
140
  children: [
135
- t10,
136
- t12,
137
- t14
141
+ t13,
142
+ t15,
143
+ t17
138
144
  ]
139
- })]
145
+ }, t7)]
140
146
  });
141
- $[28] = t10;
142
- $[29] = t12;
143
- $[30] = t14;
144
- $[31] = t15;
145
- } else t15 = $[31];
146
- let t16;
147
- if ($[32] !== onOpenChange || $[33] !== open || $[34] !== t15) {
148
- t16 = /* @__PURE__ */ jsx(Sheet, {
147
+ $[29] = t13;
148
+ $[30] = t15;
149
+ $[31] = t17;
150
+ $[32] = t7;
151
+ $[33] = t8;
152
+ $[34] = t18;
153
+ } else t18 = $[34];
154
+ let t19;
155
+ if ($[35] !== onOpenChange || $[36] !== open || $[37] !== t18) {
156
+ t19 = /* @__PURE__ */ jsx(Sheet, {
149
157
  open,
150
158
  onOpenChange,
151
- children: t15
159
+ children: t18
152
160
  });
153
- $[32] = onOpenChange;
154
- $[33] = open;
155
- $[34] = t15;
156
- $[35] = t16;
157
- } else t16 = $[35];
158
- return t16;
161
+ $[35] = onOpenChange;
162
+ $[36] = open;
163
+ $[37] = t18;
164
+ $[38] = t19;
165
+ } else t19 = $[38];
166
+ return t19;
159
167
  }
160
168
  /** How many items a tab holds, once they've loaded. */
161
169
  function TabCount(t0) {