camox 0.21.0 → 0.22.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.
@@ -19,6 +19,10 @@ declare function usePreviewedPage(): {
19
19
  updatedAt: number;
20
20
  };
21
21
  projectName: string;
22
+ project: {
23
+ id: number;
24
+ updatedAt: number;
25
+ };
22
26
  layout: {
23
27
  id: number;
24
28
  layoutId: string;
@@ -62,15 +62,16 @@ function pageFullQueryFn(queryClient, path, projectSlug) {
62
62
  return {
63
63
  page: data.page,
64
64
  layout: data.layout,
65
- projectName: data.projectName
65
+ projectName: data.projectName,
66
+ project: data.project
66
67
  };
67
68
  };
68
69
  }
69
70
  function usePreviewedPage() {
70
71
  const $ = c(22);
71
- if ($[0] !== "1904ead0ba438223b84fc30561cf474bfcc8d3ce9c88c2aa8502ed3a3535ff4c") {
72
+ if ($[0] !== "069eff6982da6e4159df17e8edcf4b3a08c7294570ccd8f684892ed8c223d55f") {
72
73
  for (let $i = 0; $i < 22; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
73
- $[0] = "1904ead0ba438223b84fc30561cf474bfcc8d3ce9c88c2aa8502ed3a3535ff4c";
74
+ $[0] = "069eff6982da6e4159df17e8edcf4b3a08c7294570ccd8f684892ed8c223d55f";
74
75
  }
75
76
  const { pathname } = useLocation();
76
77
  const queryClient = useQueryClient();
@@ -159,9 +160,9 @@ function _temp(state) {
159
160
  }
160
161
  const BlockRenderer = (t0) => {
161
162
  const $ = c(22);
162
- if ($[0] !== "1904ead0ba438223b84fc30561cf474bfcc8d3ce9c88c2aa8502ed3a3535ff4c") {
163
+ if ($[0] !== "069eff6982da6e4159df17e8edcf4b3a08c7294570ccd8f684892ed8c223d55f") {
163
164
  for (let $i = 0; $i < 22; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
164
- $[0] = "1904ead0ba438223b84fc30561cf474bfcc8d3ce9c88c2aa8502ed3a3535ff4c";
165
+ $[0] = "069eff6982da6e4159df17e8edcf4b3a08c7294570ccd8f684892ed8c223d55f";
165
166
  }
166
167
  const { blockId, mode, showAddBlockTop, showAddBlockBottom } = t0;
167
168
  let t1;
@@ -302,9 +303,9 @@ const PageContent = () => {
302
303
  };
303
304
  const CamoxPreview = (t0) => {
304
305
  const $ = c(29);
305
- if ($[0] !== "1904ead0ba438223b84fc30561cf474bfcc8d3ce9c88c2aa8502ed3a3535ff4c") {
306
+ if ($[0] !== "069eff6982da6e4159df17e8edcf4b3a08c7294570ccd8f684892ed8c223d55f") {
306
307
  for (let $i = 0; $i < 29; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
307
- $[0] = "1904ead0ba438223b84fc30561cf474bfcc8d3ce9c88c2aa8502ed3a3535ff4c";
308
+ $[0] = "069eff6982da6e4159df17e8edcf4b3a08c7294570ccd8f684892ed8c223d55f";
308
309
  }
309
310
  const { children } = t0;
310
311
  const isAuthenticated = useIsAuthenticated();
@@ -492,9 +493,9 @@ const CamoxPreview = (t0) => {
492
493
  };
493
494
  function usePreviewPagesActions() {
494
495
  const $ = c(13);
495
- if ($[0] !== "1904ead0ba438223b84fc30561cf474bfcc8d3ce9c88c2aa8502ed3a3535ff4c") {
496
+ if ($[0] !== "069eff6982da6e4159df17e8edcf4b3a08c7294570ccd8f684892ed8c223d55f") {
496
497
  for (let $i = 0; $i < 13; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
497
- $[0] = "1904ead0ba438223b84fc30561cf474bfcc8d3ce9c88c2aa8502ed3a3535ff4c";
498
+ $[0] = "069eff6982da6e4159df17e8edcf4b3a08c7294570ccd8f684892ed8c223d55f";
498
499
  }
499
500
  const navigate = useNavigate();
500
501
  const { pathname } = useLocation();
@@ -43,8 +43,13 @@ declare function createPageLoader(apiUrl: string, projectSlug: string, environme
43
43
  afterBlockIds: number[];
44
44
  } | null;
45
45
  projectName: string;
46
+ project: {
47
+ id: number;
48
+ updatedAt: number;
49
+ };
46
50
  };
47
51
  origin: string;
52
+ faviconUrl: string;
48
53
  }>;
49
54
  declare function createPageHead(camoxApp: CamoxApp): ({
50
55
  loaderData
@@ -52,11 +57,17 @@ declare function createPageHead(camoxApp: CamoxApp): ({
52
57
  loaderData?: {
53
58
  page: PageStructure;
54
59
  origin: string;
60
+ faviconUrl: string;
55
61
  };
56
62
  }) => {
57
63
  meta?: undefined;
64
+ links?: undefined;
58
65
  } | {
59
66
  meta: Record<string, string>[];
67
+ links: {
68
+ rel: string;
69
+ href: string;
70
+ }[];
60
71
  };
61
72
  declare const PageRouteComponent: () => _$react_jsx_runtime0.JSX.Element;
62
73
  //#endregion
@@ -79,14 +79,16 @@ function createPageLoader(apiUrl, projectSlug, environmentName) {
79
79
  return {
80
80
  page: data.page,
81
81
  layout: data.layout,
82
- projectName: data.projectName
82
+ projectName: data.projectName,
83
+ project: data.project
83
84
  };
84
85
  },
85
86
  staleTime: Infinity
86
87
  }), getOrigin()]);
87
88
  return {
88
89
  page,
89
- origin
90
+ origin,
91
+ faviconUrl: `${apiUrl}/favicons/${page.project.id}?v=${page.project.updatedAt}`
90
92
  };
91
93
  } catch {
92
94
  throw notFound();
@@ -96,7 +98,7 @@ function createPageLoader(apiUrl, projectSlug, environmentName) {
96
98
  function createPageHead(camoxApp) {
97
99
  return ({ loaderData }) => {
98
100
  if (!loaderData) return {};
99
- const { page, origin } = loaderData;
101
+ const { page, origin, faviconUrl } = loaderData;
100
102
  const pageMetaTitle = page.page.metaTitle ?? page.page.pathSegment;
101
103
  const meta = [];
102
104
  let title = pageMetaTitle;
@@ -138,14 +140,20 @@ function createPageHead(camoxApp) {
138
140
  property: "og:description",
139
141
  content: page.page.metaDescription
140
142
  });
141
- return { meta };
143
+ return {
144
+ meta,
145
+ links: [{
146
+ rel: "icon",
147
+ href: faviconUrl
148
+ }]
149
+ };
142
150
  };
143
151
  }
144
152
  const PageRouteComponent = () => {
145
153
  const $ = c(2);
146
- if ($[0] !== "af05e19496b4a2096f4315eaed68c6a75307af2bf2159c4789e0b818ba1bd1c7") {
154
+ if ($[0] !== "4272e30e312eefa840c2b2498844aebeea94a415ce1efe0a8248fab111737756") {
147
155
  for (let $i = 0; $i < 2; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
148
- $[0] = "af05e19496b4a2096f4315eaed68c6a75307af2bf2159c4789e0b818ba1bd1c7";
156
+ $[0] = "4272e30e312eefa840c2b2498844aebeea94a415ce1efe0a8248fab111737756";
149
157
  }
150
158
  let t0;
151
159
  if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
@@ -6,6 +6,7 @@ type PageStructure = {
6
6
  page: PageWithBlocks["page"];
7
7
  layout: PageWithBlocks["layout"];
8
8
  projectName: string;
9
+ project: PageWithBlocks["project"];
9
10
  };
10
11
  //#endregion
11
12
  export { PageStructure };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "camox",
3
- "version": "0.21.0",
3
+ "version": "0.22.0",
4
4
  "bin": {
5
5
  "camox": "./bin/camox.mjs"
6
6
  },
@@ -126,9 +126,9 @@
126
126
  "react-og-preview": "^0.2.0",
127
127
  "shiki": "^4.0.2",
128
128
  "zod": "^4.3.6",
129
- "@camox/api-contract": "0.21.0",
130
- "@camox/cli": "0.21.0",
131
- "@camox/ui": "0.21.0"
129
+ "@camox/api-contract": "0.22.0",
130
+ "@camox/cli": "0.22.0",
131
+ "@camox/ui": "0.22.0"
132
132
  },
133
133
  "devDependencies": {
134
134
  "@babel/core": "^7.29.0",