camox 0.77.0 → 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 (29) hide show
  1. package/dist/features/canvas/CamoxCanvas.js +187 -197
  2. package/dist/features/canvas/canvasCameraController.js +1 -1
  3. package/dist/features/canvas/canvasItems.js +40 -9
  4. package/dist/features/canvas/sidebar/ContentSidebarFrame.js +15 -11
  5. package/dist/features/canvas/useCanvasLayout.js +34 -0
  6. package/dist/features/memory/CamoxMemory.js +747 -0
  7. package/dist/features/preview/EditablePageExperience.js +2 -0
  8. package/dist/features/runtime/publicCache.d.ts +2 -0
  9. package/dist/features/runtime/publicCache.js +27 -4
  10. package/dist/features/runtime/runtime.d.ts +1 -1
  11. package/dist/features/runtime/runtime.js +34 -15
  12. package/dist/features/studio/FollowAgentProvider.js +1 -1
  13. package/dist/features/studio/components/AgentSidebar.js +22 -16
  14. package/dist/features/studio/components/DraftBar.js +167 -103
  15. package/dist/features/studio/components/{ReviewDraftDialog.js → DraftReview.js} +191 -218
  16. package/dist/features/studio/components/DraftsControl.js +174 -202
  17. package/dist/features/studio/components/DraftsSheet.js +102 -94
  18. package/dist/features/studio/components/Navbar.js +121 -84
  19. package/dist/features/studio/components/PublishedTab.js +21 -20
  20. package/dist/features/studio/routes.js +3 -1
  21. package/dist/features/studio/studioStore.js +12 -9
  22. package/dist/features/studio/usePublishDraft.js +116 -0
  23. package/dist/features/studio/viewSwitch.js +10 -7
  24. package/dist/lib/queries.js +7 -1
  25. package/dist/lib/studio-reads.js +6 -0
  26. package/dist/package.js +1 -1
  27. package/dist/studio.css +1 -1
  28. package/package.json +5 -5
  29. 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) {
@@ -4,7 +4,7 @@ import { actionsStore } from "../../provider/actionsStore.js";
4
4
  import { cn } from "../../../lib/utils.js";
5
5
  import { usePageDestinations } from "../../../hooks/use-page-destinations.js";
6
6
  import { useLocalePath, useLocalizedPath } from "../../../lib/view-locale.js";
7
- import { STUDIO_BASE_PATH, STUDIO_CONTENT_PATH, STUDIO_SETTINGS_PATH } from "../routes.js";
7
+ import { STUDIO_BASE_PATH, STUDIO_CONTENT_PATH, STUDIO_MEMORY_PATH, STUDIO_SETTINGS_PATH } from "../routes.js";
8
8
  import { studioStore } from "../studioStore.js";
9
9
  import { UserButton } from "./UserButton.js";
10
10
  import { ConnectAgent } from "./ConnectAgent.js";
@@ -16,28 +16,43 @@ import * as React from "react";
16
16
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
17
17
  import { useSelector } from "@xstate/store-react";
18
18
  import { buttonVariants } from "@camox/ui/button";
19
- import { Database, Globe } from "lucide-react";
19
+ import { Brain, Database, Globe } from "lucide-react";
20
20
 
21
21
  //#region src/features/studio/components/Navbar.tsx
22
- const links = [{
23
- to: "/",
24
- title: "Website",
25
- isWebsite: true,
26
- children: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Globe, {}), "Website"] }),
27
- icon: "Globe",
28
- aliases: ["Website"]
29
- }, {
30
- to: STUDIO_CONTENT_PATH,
31
- title: "Content",
32
- children: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Database, {}), "Content"] }),
33
- icon: "FileText",
34
- aliases: [
35
- "Content",
36
- "Pages",
37
- "CMS"
38
- ]
39
- }];
22
+ const links = [
23
+ {
24
+ to: "/",
25
+ title: "Website",
26
+ isWebsite: true,
27
+ children: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Globe, {}), "Website"] }),
28
+ icon: "Globe",
29
+ aliases: ["Website"]
30
+ },
31
+ {
32
+ to: STUDIO_MEMORY_PATH,
33
+ title: "Memory",
34
+ children: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Brain, {}), "Memory"] }),
35
+ icon: "Brain",
36
+ aliases: [
37
+ "Memory",
38
+ "Memories",
39
+ "Remember"
40
+ ]
41
+ },
42
+ {
43
+ to: STUDIO_CONTENT_PATH,
44
+ title: "Content",
45
+ children: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Database, {}), "Content"] }),
46
+ icon: "FileText",
47
+ aliases: [
48
+ "Content",
49
+ "Pages",
50
+ "CMS"
51
+ ]
52
+ }
53
+ ];
40
54
  const getNavbarLinks = () => links;
55
+ const WEBSITE_LINK = links.find((link) => link.isWebsite);
41
56
  /**
42
57
  * Where a navbar link goes. The Website goes back where it was last, Canvas included. In another
43
58
  * locale since, a Studio location stays, while a page, whose path may differ there, goes home.
@@ -48,11 +63,25 @@ function navbarHref(link, last, locale, localized) {
48
63
  if (last.path.startsWith(`${"/camox"}/`)) return localized(last.path);
49
64
  return localized(link.to);
50
65
  }
66
+ /** Where the Website link goes now: where the website was last, Canvas included. */
67
+ function useWebsiteHref() {
68
+ const $ = c(3);
69
+ const localized = useLocalizedPath();
70
+ const { locale } = useViewLocale();
71
+ let t0;
72
+ if ($[0] !== locale.tag || $[1] !== localized) {
73
+ t0 = () => navbarHref(WEBSITE_LINK, studioStore.getSnapshot().context.websiteLocation, locale.tag, localized);
74
+ $[0] = locale.tag;
75
+ $[1] = localized;
76
+ $[2] = t0;
77
+ } else t0 = $[2];
78
+ return t0;
79
+ }
51
80
  /** Whether `pathname` is in the studio section at `sectionPath`. */
52
81
  const isInSection = (sectionPath, pathname) => pathname === sectionPath || pathname.startsWith(`${sectionPath}/`);
53
82
  const isSettingsNavbarPath = (pathname) => isInSection(STUDIO_SETTINGS_PATH, pathname);
54
83
  const Navbar = (t0) => {
55
- const $ = c(26);
84
+ const $ = c(28);
56
85
  const { isWebsite: t1, recordPage } = t0;
57
86
  const isWebsite = t1 === void 0 ? false : t1;
58
87
  const pages = usePageDestinations();
@@ -68,43 +97,51 @@ const Navbar = (t0) => {
68
97
  } else t2 = $[1];
69
98
  const isSettings = t2;
70
99
  let t3;
71
- if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
72
- t3 = /* @__PURE__ */ jsx(ProjectMenu, {});
73
- $[2] = t3;
74
- } else t3 = $[2];
100
+ if ($[2] !== pathname) {
101
+ t3 = isInSection(STUDIO_MEMORY_PATH, pathname);
102
+ $[2] = pathname;
103
+ $[3] = t3;
104
+ } else t3 = $[3];
105
+ const isMemory = t3;
75
106
  let t4;
76
- if ($[3] !== isSettings) {
77
- t4 = /* @__PURE__ */ jsx(DraftPicker, { disabled: isSettings });
78
- $[3] = isSettings;
107
+ if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
108
+ t4 = /* @__PURE__ */ jsx(ProjectMenu, {});
79
109
  $[4] = t4;
80
110
  } else t4 = $[4];
81
111
  let t5;
82
- if ($[5] !== isSettings || $[6] !== recordPage) {
83
- t5 = /* @__PURE__ */ jsx(LocalePicker, {
112
+ if ($[5] !== isSettings) {
113
+ t5 = /* @__PURE__ */ jsx(DraftPicker, { disabled: isSettings });
114
+ $[5] = isSettings;
115
+ $[6] = t5;
116
+ } else t5 = $[6];
117
+ const t6 = isSettings || isMemory;
118
+ let t7;
119
+ if ($[7] !== recordPage || $[8] !== t6) {
120
+ t7 = /* @__PURE__ */ jsx(LocalePicker, {
84
121
  recordPage,
85
- disabled: isSettings
122
+ disabled: t6
86
123
  });
87
- $[5] = isSettings;
88
- $[6] = recordPage;
89
- $[7] = t5;
90
- } else t5 = $[7];
91
- let t6;
92
- if ($[8] !== t4 || $[9] !== t5) {
93
- t6 = /* @__PURE__ */ jsxs("div", {
124
+ $[7] = recordPage;
125
+ $[8] = t6;
126
+ $[9] = t7;
127
+ } else t7 = $[9];
128
+ let t8;
129
+ if ($[10] !== t5 || $[11] !== t7) {
130
+ t8 = /* @__PURE__ */ jsxs("div", {
94
131
  className: "flex items-center gap-1",
95
132
  children: [
96
- t3,
97
133
  t4,
98
- t5
134
+ t5,
135
+ t7
99
136
  ]
100
137
  });
101
- $[8] = t4;
102
- $[9] = t5;
103
- $[10] = t6;
104
- } else t6 = $[10];
105
- let t7;
106
- if ($[11] !== isWebsite || $[12] !== last || $[13] !== locale || $[14] !== localized || $[15] !== pages || $[16] !== pathname) {
107
- t7 = getNavbarLinks().map((link) => {
138
+ $[10] = t5;
139
+ $[11] = t7;
140
+ $[12] = t8;
141
+ } else t8 = $[12];
142
+ let t9;
143
+ if ($[13] !== isWebsite || $[14] !== last || $[15] !== locale || $[16] !== localized || $[17] !== pages || $[18] !== pathname) {
144
+ t9 = getNavbarLinks().map((link) => {
108
145
  const isActive = link.isWebsite ? isWebsite || !!pages?.some((page) => page.fullPath === pathname) : isInSection(link.to, pathname);
109
146
  return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link$1, {
110
147
  to: navbarHref(link, last, locale.tag, localized),
@@ -114,51 +151,51 @@ const Navbar = (t0) => {
114
151
  children: link.children
115
152
  }) }, link.to);
116
153
  });
117
- $[11] = isWebsite;
118
- $[12] = last;
119
- $[13] = locale;
120
- $[14] = localized;
121
- $[15] = pages;
122
- $[16] = pathname;
123
- $[17] = t7;
124
- } else t7 = $[17];
125
- let t8;
126
- if ($[18] !== t7) {
127
- t8 = /* @__PURE__ */ jsx("ul", {
154
+ $[13] = isWebsite;
155
+ $[14] = last;
156
+ $[15] = locale;
157
+ $[16] = localized;
158
+ $[17] = pages;
159
+ $[18] = pathname;
160
+ $[19] = t9;
161
+ } else t9 = $[19];
162
+ let t10;
163
+ if ($[20] !== t9) {
164
+ t10 = /* @__PURE__ */ jsx("ul", {
128
165
  className: "flex items-center gap-1",
129
- children: t7
166
+ children: t9
130
167
  });
131
- $[18] = t7;
132
- $[19] = t8;
133
- } else t8 = $[19];
134
- let t9;
135
- if ($[20] !== t6 || $[21] !== t8) {
136
- t9 = /* @__PURE__ */ jsxs("div", {
168
+ $[20] = t9;
169
+ $[21] = t10;
170
+ } else t10 = $[21];
171
+ let t11;
172
+ if ($[22] !== t10 || $[23] !== t8) {
173
+ t11 = /* @__PURE__ */ jsxs("div", {
137
174
  className: "flex flex-row gap-2",
138
- children: [t6, t8]
175
+ children: [t8, t10]
139
176
  });
140
- $[20] = t6;
141
- $[21] = t8;
142
- $[22] = t9;
143
- } else t9 = $[22];
144
- let t10;
145
- if ($[23] === Symbol.for("react.memo_cache_sentinel")) {
146
- t10 = /* @__PURE__ */ jsxs("div", {
177
+ $[22] = t10;
178
+ $[23] = t8;
179
+ $[24] = t11;
180
+ } else t11 = $[24];
181
+ let t12;
182
+ if ($[25] === Symbol.for("react.memo_cache_sentinel")) {
183
+ t12 = /* @__PURE__ */ jsxs("div", {
147
184
  className: "flex items-center gap-2",
148
185
  children: [/* @__PURE__ */ jsx(ConnectAgent, {}), /* @__PURE__ */ jsx(UserButton, {})]
149
186
  });
150
- $[23] = t10;
151
- } else t10 = $[23];
152
- let t11;
153
- if ($[24] !== t9) {
154
- t11 = /* @__PURE__ */ jsxs("nav", {
187
+ $[25] = t12;
188
+ } else t12 = $[25];
189
+ let t13;
190
+ if ($[26] !== t11) {
191
+ t13 = /* @__PURE__ */ jsxs("nav", {
155
192
  className: "bg-background relative flex items-center justify-between gap-4 border-b px-2 py-2",
156
- children: [t9, t10]
193
+ children: [t11, t12]
157
194
  });
158
- $[24] = t9;
159
- $[25] = t11;
160
- } else t11 = $[25];
161
- return t11;
195
+ $[26] = t11;
196
+ $[27] = t13;
197
+ } else t13 = $[27];
198
+ return t13;
162
199
  };
163
200
  function useNavbarActions() {
164
201
  const $ = c(5);
@@ -240,4 +277,4 @@ function _temp(state) {
240
277
  }
241
278
 
242
279
  //#endregion
243
- export { Navbar, useNavbarActions };
280
+ export { Navbar, useNavbarActions, useWebsiteHref };
@@ -17,45 +17,46 @@ import { Spinner } from "@camox/ui/spinner";
17
17
 
18
18
  //#region src/features/studio/components/PublishedTab.tsx
19
19
  /**
20
- * The Publications (ADR 0045), the latest first. Opening one shows its overview and its thread,
21
- * read-only: how a member finds out why Live changed. Reverting one takes the member into the
22
- * draft it starts, once `onEntered` closed the sheet.
20
+ * The Publications (ADR 0045), the latest first, or the one `opening` names. Opening one shows its
21
+ * overview and its thread, read-only: how a member finds out why Live changed. Reverting one takes
22
+ * the member into the draft it starts, once `onEntered` closed the sheet.
23
23
  */
24
24
  function PublishedTab(t0) {
25
25
  const $ = c(7);
26
- const { projectId, onEntered } = t0;
27
- const [opened, setOpened] = React.useState(null);
26
+ const { projectId, opening: t1, onEntered } = t0;
27
+ const opening = t1 === void 0 ? null : t1;
28
+ const [opened, setOpened] = React.useState(opening);
28
29
  if (opened) {
29
- let t1;
30
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
31
- t1 = () => setOpened(null);
32
- $[0] = t1;
33
- } else t1 = $[0];
34
30
  let t2;
31
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
32
+ t2 = () => setOpened(null);
33
+ $[0] = t2;
34
+ } else t2 = $[0];
35
+ let t3;
35
36
  if ($[1] !== onEntered || $[2] !== opened || $[3] !== projectId) {
36
- t2 = /* @__PURE__ */ jsx(PublicationView, {
37
+ t3 = /* @__PURE__ */ jsx(PublicationView, {
37
38
  projectId,
38
39
  id: opened,
39
- onBack: t1,
40
+ onBack: t2,
40
41
  onEntered
41
42
  });
42
43
  $[1] = onEntered;
43
44
  $[2] = opened;
44
45
  $[3] = projectId;
45
- $[4] = t2;
46
- } else t2 = $[4];
47
- return t2;
46
+ $[4] = t3;
47
+ } else t3 = $[4];
48
+ return t3;
48
49
  }
49
- let t1;
50
+ let t2;
50
51
  if ($[5] !== projectId) {
51
- t1 = /* @__PURE__ */ jsx(PublicationList, {
52
+ t2 = /* @__PURE__ */ jsx(PublicationList, {
52
53
  projectId,
53
54
  onOpen: setOpened
54
55
  });
55
56
  $[5] = projectId;
56
- $[6] = t1;
57
- } else t1 = $[6];
58
- return t1;
57
+ $[6] = t2;
58
+ } else t2 = $[6];
59
+ return t2;
59
60
  }
60
61
  function PublicationList(t0) {
61
62
  const $ = c(16);
@@ -3,6 +3,8 @@ const STUDIO_ROUTE_SEGMENT = "camox";
3
3
  const STUDIO_BASE_PATH = `/${STUDIO_ROUTE_SEGMENT}`;
4
4
  const STUDIO_CONTENT_PATH = `${STUDIO_BASE_PATH}/content`;
5
5
  const STUDIO_ASSETS_PATH = `${STUDIO_CONTENT_PATH}/assets`;
6
+ /** The Memory Section, where members see and correct what Camox's agent remembers. */
7
+ const STUDIO_MEMORY_PATH = `${STUDIO_BASE_PATH}/memory`;
6
8
  /** The Settings Section, where members change Project Settings. */
7
9
  const STUDIO_SETTINGS_PATH = `${STUDIO_BASE_PATH}/settings`;
8
10
  const collectionContentPath = (collectionId) => `${STUDIO_CONTENT_PATH}/collections/${encodeURIComponent(collectionId)}`;
@@ -32,4 +34,4 @@ function matchCollectionContentPath(pathname) {
32
34
  const STUDIO_CANVAS_PATH = `${STUDIO_BASE_PATH}/canvas`;
33
35
 
34
36
  //#endregion
35
- export { STUDIO_ASSETS_PATH, STUDIO_BASE_PATH, STUDIO_CANVAS_PATH, STUDIO_CONTENT_PATH, STUDIO_ROUTE_SEGMENT, STUDIO_SETTINGS_PATH, collectionContentPath, editCollectionItemPath, matchCollectionContentPath };
37
+ export { STUDIO_ASSETS_PATH, STUDIO_BASE_PATH, STUDIO_CANVAS_PATH, STUDIO_CONTENT_PATH, STUDIO_MEMORY_PATH, STUDIO_ROUTE_SEGMENT, STUDIO_SETTINGS_PATH, collectionContentPath, editCollectionItemPath, matchCollectionContentPath };
@@ -5,8 +5,9 @@ const studioStore = createStore({
5
5
  context: {
6
6
  isCommandPaletteOpen: false,
7
7
  commandPalettePages: [],
8
- isReviewDraftDialogOpen: false,
8
+ isDraftReviewOpen: false,
9
9
  isDraftsSheetOpen: false,
10
+ draftsSheetPublication: null,
10
11
  localeDialog: null,
11
12
  websiteLocation: null,
12
13
  agentMessages: [],
@@ -46,28 +47,30 @@ const studioStore = createStore({
46
47
  commandPalettePages: context.commandPalettePages.slice(0, -1)
47
48
  };
48
49
  },
49
- openReviewDraftDialog: (context) => {
50
+ openDraftReview: (context) => {
50
51
  return {
51
52
  ...context,
52
- isReviewDraftDialogOpen: true
53
+ isDraftReviewOpen: true
53
54
  };
54
55
  },
55
- closeReviewDraftDialog: (context) => {
56
+ closeDraftReview: (context) => {
56
57
  return {
57
58
  ...context,
58
- isReviewDraftDialogOpen: false
59
+ isDraftReviewOpen: false
59
60
  };
60
61
  },
61
- openDraftsSheet: (context) => {
62
+ openDraftsSheet: (context, event) => {
62
63
  return {
63
64
  ...context,
64
- isDraftsSheetOpen: true
65
+ isDraftsSheetOpen: true,
66
+ draftsSheetPublication: event.publicationId ?? null
65
67
  };
66
68
  },
67
69
  closeDraftsSheet: (context) => {
68
70
  return {
69
71
  ...context,
70
- isDraftsSheetOpen: false
72
+ isDraftsSheetOpen: false,
73
+ draftsSheetPublication: null
71
74
  };
72
75
  },
73
76
  openLocaleDialog: (context, event) => {
@@ -86,7 +89,7 @@ const studioStore = createStore({
86
89
  const id = context.agentMessagesSent + 1;
87
90
  return {
88
91
  ...context,
89
- isReviewDraftDialogOpen: false,
92
+ isDraftReviewOpen: false,
90
93
  agentMessages: [...context.agentMessages, {
91
94
  text: event.text,
92
95
  id