camox 0.78.0 → 0.80.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.
@@ -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_MEMORY_PATH, STUDIO_SETTINGS_PATH } from "../routes.js";
7
+ import { STUDIO_BASE_PATH, STUDIO_BRAND_PATH, STUDIO_CONTENT_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";
@@ -29,11 +29,13 @@ const links = [
29
29
  aliases: ["Website"]
30
30
  },
31
31
  {
32
- to: STUDIO_MEMORY_PATH,
33
- title: "Memory",
34
- children: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Brain, {}), "Memory"] }),
32
+ to: STUDIO_BRAND_PATH,
33
+ title: "Brand",
34
+ children: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Brain, {}), "Brand"] }),
35
35
  icon: "Brain",
36
36
  aliases: [
37
+ "Brand",
38
+ "Voice",
37
39
  "Memory",
38
40
  "Memories",
39
41
  "Remember"
@@ -98,11 +100,11 @@ const Navbar = (t0) => {
98
100
  const isSettings = t2;
99
101
  let t3;
100
102
  if ($[2] !== pathname) {
101
- t3 = isInSection(STUDIO_MEMORY_PATH, pathname);
103
+ t3 = isInSection(STUDIO_BRAND_PATH, pathname);
102
104
  $[2] = pathname;
103
105
  $[3] = t3;
104
106
  } else t3 = $[3];
105
- const isMemory = t3;
107
+ const isBrand = t3;
106
108
  let t4;
107
109
  if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
108
110
  t4 = /* @__PURE__ */ jsx(ProjectMenu, {});
@@ -114,7 +116,7 @@ const Navbar = (t0) => {
114
116
  $[5] = isSettings;
115
117
  $[6] = t5;
116
118
  } else t5 = $[6];
117
- const t6 = isSettings || isMemory;
119
+ const t6 = isSettings || isBrand;
118
120
  let t7;
119
121
  if ($[7] !== recordPage || $[8] !== t6) {
120
122
  t7 = /* @__PURE__ */ jsx(LocalePicker, {
@@ -3,8 +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
+ /** The Brand Section, where members set the Voice and see and correct memory. */
7
+ const STUDIO_BRAND_PATH = `${STUDIO_BASE_PATH}/brand`;
8
8
  /** The Settings Section, where members change Project Settings. */
9
9
  const STUDIO_SETTINGS_PATH = `${STUDIO_BASE_PATH}/settings`;
10
10
  const collectionContentPath = (collectionId) => `${STUDIO_CONTENT_PATH}/collections/${encodeURIComponent(collectionId)}`;
@@ -34,4 +34,4 @@ function matchCollectionContentPath(pathname) {
34
34
  const STUDIO_CANVAS_PATH = `${STUDIO_BASE_PATH}/canvas`;
35
35
 
36
36
  //#endregion
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 };
37
+ export { STUDIO_ASSETS_PATH, STUDIO_BASE_PATH, STUDIO_BRAND_PATH, STUDIO_CANVAS_PATH, STUDIO_CONTENT_PATH, STUDIO_ROUTE_SEGMENT, STUDIO_SETTINGS_PATH, collectionContentPath, editCollectionItemPath, matchCollectionContentPath };
@@ -87,6 +87,7 @@ const CAMOX_OPTIMIZED_DEPS = [
87
87
  "camox > @base-ui/react/popover",
88
88
  "camox > @base-ui/react/select",
89
89
  "camox > @base-ui/react/separator",
90
+ "camox > @base-ui/react/slider",
90
91
  "camox > @base-ui/react/switch",
91
92
  "camox > @base-ui/react/tabs",
92
93
  "camox > @base-ui/react/toggle",
@@ -80,11 +80,15 @@ const localeMutations = {
80
80
  /** Adds a page or record deleted from the locale viewed back to it. */
81
81
  addBack: () => getOrpc().locales.addBack.mutationOptions()
82
82
  };
83
- /** Correcting memory: content writes, so on Live they start a draft (ADR 0049). */
84
- const memoryMutations = {
85
- add: () => getOrpc().memories.add.mutationOptions(),
86
- change: () => getOrpc().memories.change.mutationOptions(),
87
- delete: () => getOrpc().memories.delete.mutationOptions()
83
+ /**
84
+ * Changing the brand, by correcting memory or saving the Voice: content writes, so on Live they
85
+ * start a draft (ADR 0049, ADR 0051, ADR 0052).
86
+ */
87
+ const brandMutations = {
88
+ addMemory: () => getOrpc().memories.add.mutationOptions(),
89
+ changeMemory: () => getOrpc().memories.change.mutationOptions(),
90
+ deleteMemory: () => getOrpc().memories.delete.mutationOptions(),
91
+ saveVoice: () => getOrpc().memories.saveVoice.mutationOptions()
88
92
  };
89
93
  const blockMutations = {
90
94
  delete: () => getOrpc().blocks.delete.mutationOptions(),
@@ -159,4 +163,4 @@ const fileMutations = {
159
163
  };
160
164
 
161
165
  //#endregion
162
- export { blockMutations, collectionMutations, draftMutations, fileMutations, localeMutations, memoryMutations, pageMutations, projectMutations, publicationMutations, repeatableItemMutations, specialistMutations };
166
+ export { blockMutations, brandMutations, collectionMutations, draftMutations, fileMutations, localeMutations, pageMutations, projectMutations, publicationMutations, repeatableItemMutations, specialistMutations };
@@ -8,6 +8,7 @@ import "react";
8
8
  import "@camox/api-contract/query-keys";
9
9
  import "@camox/api-contract/specialists";
10
10
  import { QueryClient } from "@tanstack/react-query";
11
+ import "@camox/api-contract/voice";
11
12
  //#region src/lib/studio-reads.d.ts
12
13
  type LayoutRead = Awaited<ReturnType<ApiClient["layouts"]["get"]>>;
13
14
  /** A layout's structure: its blocks before and after the content of its pages. */
@@ -65,6 +65,12 @@ const reads = {
65
65
  fetch: ({ api, signal }, { projectId }) => api.memories.list({ projectId }, { signal }),
66
66
  staleTime: Infinity
67
67
  }),
68
+ voice: entry({
69
+ key: ({ projectId }) => [...queryKeys.memories.voice, projectId],
70
+ everyLocale: true,
71
+ fetch: ({ api, signal }, { projectId }) => api.memories.voice({ projectId }, { signal }),
72
+ staleTime: Infinity
73
+ }),
68
74
  missingFromLocale: entry({
69
75
  key: ({ projectId }) => [
70
76
  "camox",
package/dist/package.js CHANGED
@@ -1,5 +1,5 @@
1
1
  //#region package.json
2
- var version = "0.78.0";
2
+ var version = "0.80.0";
3
3
 
4
4
  //#endregion
5
5
  export { version };