camox 0.40.0 → 0.41.1

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 (108) hide show
  1. package/dist/components/PlatformLabel.js +62 -0
  2. package/dist/core/components/lexical/GradientNode.js +126 -0
  3. package/dist/core/components/lexical/InlineLexicalEditor.js +37 -56
  4. package/dist/core/components/lexical/InlineStylesPlugin.js +183 -0
  5. package/dist/core/components/lexical/SelectionBroadcaster.js +49 -46
  6. package/dist/core/components/lexical/SidebarLexicalEditor.js +197 -151
  7. package/dist/core/components/lexical/editorConfig.js +25 -7
  8. package/dist/core/components/lexical/selectTextLink.js +21 -0
  9. package/dist/core/createApp.d.ts +30 -17
  10. package/dist/core/createApp.js +14 -3
  11. package/dist/core/createBlock.d.ts +2 -2
  12. package/dist/core/createBlock.js +17 -28
  13. package/dist/core/createLayout.d.ts +48 -4
  14. package/dist/core/createLayout.js +51 -23
  15. package/dist/core/derivedRoutes.js +36 -0
  16. package/dist/core/editing/BlockEditingRuntime.js +4 -4
  17. package/dist/core/editing/CompleteBlockEditingRuntime.js +5 -5
  18. package/dist/core/editing/createEditableBlock.d.ts +9 -8
  19. package/dist/core/editing/createEditableBlock.js +265 -403
  20. package/dist/core/hooks/useIsEditable.js +4 -7
  21. package/dist/core/hooks/useRequireDraftSource.js +7 -11
  22. package/dist/core/lib/lexicalReact.d.ts +1 -26
  23. package/dist/core/lib/lexicalReact.js +46 -60
  24. package/dist/core/lib/lexicalState.js +164 -81
  25. package/dist/core/lib/modifierFormats.js +4 -15
  26. package/dist/core/lib/textStyles.d.ts +27 -0
  27. package/dist/core/lib/textStyles.js +47 -0
  28. package/dist/features/navigation/navigation.d.ts +2 -0
  29. package/dist/features/navigation/navigation.js +51 -46
  30. package/dist/features/page/DerivedPageContent.js +61 -0
  31. package/dist/features/page/PublishedPageContent.js +52 -83
  32. package/dist/features/page/SharedLayoutContent.js +66 -0
  33. package/dist/features/preview/CamoxPreview.d.ts +16 -1
  34. package/dist/features/preview/CamoxPreview.js +246 -290
  35. package/dist/features/preview/DerivedPreview.js +134 -0
  36. package/dist/features/preview/EditablePageExperience.js +25 -8
  37. package/dist/features/preview/components/AddBlockSidebar.js +43 -33
  38. package/dist/features/preview/components/AssetLightbox.js +1 -1
  39. package/dist/features/preview/components/BlockActionsPopover.js +8 -8
  40. package/dist/features/preview/components/BlockThumbnail.js +192 -0
  41. package/dist/features/preview/components/CreatePageModal.js +123 -115
  42. package/dist/features/preview/components/DerivedLayoutDialog.js +100 -0
  43. package/dist/features/preview/components/DerivedLayoutSidebar.d.ts +5 -0
  44. package/dist/features/preview/components/DerivedLayoutSidebar.js +160 -0
  45. package/dist/features/preview/components/DerivedPageInfoSidebar.js +57 -0
  46. package/dist/features/preview/components/FieldToolbar.js +42 -20
  47. package/dist/features/preview/components/Frame.js +133 -140
  48. package/dist/features/preview/components/LeftSidebar.js +42 -38
  49. package/dist/features/preview/components/LinkFieldEditor.js +3 -4
  50. package/dist/features/preview/components/MobilePreviewDrawer.js +4 -4
  51. package/dist/features/preview/components/Overlays.js +59 -47
  52. package/dist/features/preview/components/PageEditorSidebar.js +194 -203
  53. package/dist/features/preview/components/PageInfoSidebar.js +63 -55
  54. package/dist/features/preview/components/PageNavigatorSidebar.js +34 -483
  55. package/dist/features/preview/components/PagePicker.js +205 -153
  56. package/dist/features/preview/components/PageTree.js +366 -340
  57. package/dist/features/preview/components/PreviewActivation.js +78 -0
  58. package/dist/features/preview/components/PreviewPanel.js +98 -68
  59. package/dist/features/preview/components/PreviewToolbar.js +224 -241
  60. package/dist/features/preview/components/PreviewToolbarSpacer.js +43 -0
  61. package/dist/features/preview/components/PublicationRow.js +425 -0
  62. package/dist/features/preview/components/PublishDialog.js +180 -97
  63. package/dist/features/preview/components/RightSidebar.js +19 -34
  64. package/dist/features/preview/components/previewStyles.js +8 -0
  65. package/dist/features/preview/components/useUpdateBlockPosition.js +7 -13
  66. package/dist/features/preview/previewConstants.js +8 -0
  67. package/dist/features/preview/previewStore.js +18 -39
  68. package/dist/features/preview/publication.js +71 -0
  69. package/dist/features/provider/AuthenticatedCamoxProvider.js +2 -1
  70. package/dist/features/provider/CoreCamoxProvider.js +11 -2
  71. package/dist/features/provider/LocalhostPreviewProvider.js +6 -7
  72. package/dist/features/provider/useAdminShortcuts.js +5 -4
  73. package/dist/features/routes/pageRuntime.d.ts +10 -0
  74. package/dist/features/routes/pageRuntime.js +7 -9
  75. package/dist/features/runtime/PreviewDocumentContext.js +7 -0
  76. package/dist/features/runtime/RuntimeChrome.js +149 -0
  77. package/dist/features/runtime/SharedChromeContext.js +7 -0
  78. package/dist/features/runtime/navigationRequest.js +21 -0
  79. package/dist/features/runtime/navigationTarget.js +23 -0
  80. package/dist/features/runtime/pageApp.js +196 -121
  81. package/dist/features/runtime/pageNavigation.js +79 -130
  82. package/dist/features/runtime/runtime.d.ts +11 -0
  83. package/dist/features/runtime/runtime.js +183 -47
  84. package/dist/features/runtime/studioApp.d.ts +2 -11
  85. package/dist/features/runtime/studioApp.js +14 -177
  86. package/dist/features/studio/CamoxStudio.js +27 -13
  87. package/dist/features/studio/components/Navbar.js +80 -74
  88. package/dist/features/studio/components/UserButton.js +4 -4
  89. package/dist/features/studio/studioTheme.js +25 -0
  90. package/dist/features/studio/useTheme.js +94 -109
  91. package/dist/features/vite/appGeneration.js +12 -3
  92. package/dist/features/vite/definitionsSync.js +4 -2
  93. package/dist/features/vite/layoutGeneration.js +38 -0
  94. package/dist/features/vite/runtimeDev.js +3 -1
  95. package/dist/lib/auth.js +15 -13
  96. package/dist/lib/normalized-data.js +4 -4
  97. package/dist/lib/platform.js +13 -0
  98. package/dist/lib/utils.js +90 -38
  99. package/dist/studio-overlays.css +5 -40
  100. package/dist/studio.css +1 -1
  101. package/package.json +8 -4
  102. package/skills/camox/SKILL.md +2 -0
  103. package/skills/camox/references/block-definitions.md +31 -12
  104. package/skills/camox/references/layout-definitions.md +2 -0
  105. package/dist/core/lib/modifiers.js +0 -24
  106. package/dist/features/preview/components/DraftSwitchDialog.js +0 -66
  107. package/dist/features/preview/previewQueryFns.js +0 -23
  108. package/dist/features/runtime/studioNavigation.js +0 -120
@@ -51,7 +51,8 @@ function AuthenticatedCamoxProvider({ children }) {
51
51
  return /* @__PURE__ */ jsxs(Fragment, { children: [
52
52
  /* @__PURE__ */ jsx("link", {
53
53
  rel: "stylesheet",
54
- href: studioCssUrl
54
+ href: studioCssUrl,
55
+ "data-camox-studio": true
55
56
  }),
56
57
  children,
57
58
  /* @__PURE__ */ jsx(Toaster, { theme: resolvedTheme }),
@@ -1,6 +1,8 @@
1
1
  import { AuthContext, createCamoxAuthClient, useProcessOtt } from "../../lib/auth.js";
2
2
  import { initApiClient } from "../../lib/api-client.js";
3
+ import { projectQueries } from "../../lib/queries.js";
3
4
  import { CamoxAppProvider } from "./components/CamoxAppContext.js";
5
+ import { useQueryClient } from "@tanstack/react-query";
4
6
  import * as React from "react";
5
7
  import { jsx } from "react/jsx-runtime";
6
8
 
@@ -10,13 +12,19 @@ function isLocalhostPreview() {
10
12
  const { hostname } = window.location;
11
13
  return hostname === "localhost" || hostname === "127.0.0.1" || hostname === "::1";
12
14
  }
13
- function CoreCamoxProvider({ apiUrl, authenticationUrl, camoxApp, children, environmentName, projectSlug }) {
15
+ function CoreCamoxProvider({ apiUrl, authenticationUrl, camoxApp, children, environmentName, projectSlug, initialAuthenticated = false, initialProject }) {
16
+ const queryClient = useQueryClient();
14
17
  const authClient = React.useMemo(() => createCamoxAuthClient(apiUrl), [apiUrl]);
15
18
  const initializedApiUrl = React.useRef(null);
16
19
  if (initializedApiUrl.current !== apiUrl) {
17
20
  initApiClient(apiUrl, environmentName);
18
21
  initializedApiUrl.current = apiUrl;
19
22
  }
23
+ const seededProject = React.useRef(void 0);
24
+ if (initialProject && seededProject.current !== initialProject) {
25
+ queryClient.setQueryData(projectQueries.getBySlug(projectSlug).queryKey, initialProject);
26
+ seededProject.current = initialProject;
27
+ }
20
28
  useProcessOtt(authClient);
21
29
  return /* @__PURE__ */ jsx(AuthContext.Provider, {
22
30
  value: {
@@ -24,7 +32,8 @@ function CoreCamoxProvider({ apiUrl, authenticationUrl, camoxApp, children, envi
24
32
  authenticationUrl,
25
33
  apiUrl,
26
34
  projectSlug,
27
- environmentName
35
+ environmentName,
36
+ initialAuthenticated
28
37
  },
29
38
  children: /* @__PURE__ */ jsx(CamoxAppProvider, {
30
39
  app: camoxApp,
@@ -1,6 +1,7 @@
1
1
  import { actionsStore } from "./actionsStore.js";
2
2
  import { useSignInRedirect } from "../../lib/auth.js";
3
3
  import { useApplyTheme } from "../studio/useTheme.js";
4
+ import { EDIT_MODE_SHORTCUT } from "../preview/previewConstants.js";
4
5
  import { PreviewPanel } from "../preview/components/PreviewPanel.js";
5
6
  import { useAdminShortcuts } from "./useAdminShortcuts.js";
6
7
  import { c } from "react/compiler-runtime";
@@ -13,9 +14,9 @@ import studioCssUrl from "virtual:camox-studio-css";
13
14
  //#region src/features/provider/LocalhostPreviewProvider.tsx
14
15
  function LocalhostPreviewProvider(t0) {
15
16
  const $ = c(21);
16
- if ($[0] !== "bd39c46de8381d98c4a04fb8c92df87704f578a9561f6fbfafaa182175dd58dd") {
17
+ if ($[0] !== "fddfba0cee29e4fb721206c13e16fbe407ae9aeb750c2a716d0ba1347b862953") {
17
18
  for (let $i = 0; $i < 21; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
18
- $[0] = "bd39c46de8381d98c4a04fb8c92df87704f578a9561f6fbfafaa182175dd58dd";
19
+ $[0] = "fddfba0cee29e4fb721206c13e16fbe407ae9aeb750c2a716d0ba1347b862953";
19
20
  }
20
21
  const { children } = t0;
21
22
  const signInRedirect = useSignInRedirect();
@@ -33,10 +34,7 @@ function LocalhostPreviewProvider(t0) {
33
34
  groupLabel: "Preview",
34
35
  checkIfAvailable: _temp,
35
36
  execute: () => setIsSignInDialogOpen(true),
36
- shortcut: {
37
- key: "Enter",
38
- withMeta: true
39
- }
37
+ shortcut: EDIT_MODE_SHORTCUT
40
38
  }];
41
39
  actionsStore.send({
42
40
  type: "registerManyActions",
@@ -61,7 +59,8 @@ function LocalhostPreviewProvider(t0) {
61
59
  if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
62
60
  t3 = /* @__PURE__ */ jsx("link", {
63
61
  rel: "stylesheet",
64
- href: studioCssUrl
62
+ href: studioCssUrl,
63
+ "data-camox-studio": true
65
64
  });
66
65
  $[3] = t3;
67
66
  } else t3 = $[3];
@@ -10,9 +10,9 @@ import { useSelector } from "@xstate/store-react";
10
10
  */
11
11
  function useAdminShortcuts() {
12
12
  const $ = c(4);
13
- if ($[0] !== "e5d3a4bbb325cbcce579826abdfc85cc9e0df725cd31dd3b6fd2c699d88a926c") {
13
+ if ($[0] !== "0255d4249a070c82da3a967d899d13f2ef37b37575822c7a0d008029181a2db4") {
14
14
  for (let $i = 0; $i < 4; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
15
- $[0] = "e5d3a4bbb325cbcce579826abdfc85cc9e0df725cd31dd3b6fd2c699d88a926c";
15
+ $[0] = "0255d4249a070c82da3a967d899d13f2ef37b37575822c7a0d008029181a2db4";
16
16
  }
17
17
  const actions = useSelector(actionsStore, _temp);
18
18
  let t0;
@@ -33,6 +33,7 @@ function useAdminShortcuts() {
33
33
  if (shortcut.key === "Backspace") return;
34
34
  }
35
35
  event.preventDefault();
36
+ event.stopPropagation();
36
37
  matchingAction.execute();
37
38
  };
38
39
  const handleMessage = (event_0) => {
@@ -42,10 +43,10 @@ function useAdminShortcuts() {
42
43
  if (action_0) action_0.execute();
43
44
  }
44
45
  };
45
- document.addEventListener("keydown", handleKeyDown);
46
+ document.addEventListener("keydown", handleKeyDown, true);
46
47
  window.addEventListener("message", handleMessage);
47
48
  return () => {
48
- document.removeEventListener("keydown", handleKeyDown);
49
+ document.removeEventListener("keydown", handleKeyDown, true);
49
50
  window.removeEventListener("message", handleMessage);
50
51
  };
51
52
  };
@@ -0,0 +1,10 @@
1
+ import { QueryClient } from "@tanstack/react-query";
2
+ import { Router } from "@camox/api-contract";
3
+ import { RouterClient } from "@orpc/server";
4
+
5
+ //#region src/features/routes/pageRuntime.d.ts
6
+ declare function createServerApiClient(apiUrl: string, environmentName?: string, options?: {
7
+ authCookieHeader?: string;
8
+ }): RouterClient<Router>;
9
+ //#endregion
10
+ export { createServerApiClient };
@@ -194,15 +194,13 @@ function buildCamoxPageHead(camoxApp, loaderData) {
194
194
  let title = pageMetaTitle;
195
195
  if (page.layout) {
196
196
  const layout = camoxApp.getLayoutById(page.layout.layoutId);
197
- if (layout) {
198
- title = layout._internal.buildMetaTitle({
199
- pageMetaTitle,
200
- projectName: page.projectName,
201
- pageFullPath: page.page.fullPath
202
- });
203
- meta.push({ title });
204
- }
197
+ if (layout) title = layout._internal.buildMetaTitle({
198
+ pageMetaTitle,
199
+ projectName: page.projectName,
200
+ pageFullPath: page.page.fullPath
201
+ });
205
202
  }
203
+ meta.push({ title });
206
204
  if (page.page.metaDescription) meta.push({
207
205
  name: "description",
208
206
  content: page.page.metaDescription
@@ -241,4 +239,4 @@ function buildCamoxPageHead(camoxApp, loaderData) {
241
239
  }
242
240
 
243
241
  //#endregion
244
- export { buildCamoxPageHead, createMarkdownResponse, createServerApiClient, isNotFoundError, loadCamoxPageForRequest };
242
+ export { buildCamoxPageHead, createMarkdownResponse, createServerApiClient, isAuthSessionError, isNotFoundError, loadCamoxPageForRequest, seedBlockCaches };
@@ -0,0 +1,7 @@
1
+ import { createContext } from "react";
2
+
3
+ //#region src/features/runtime/PreviewDocumentContext.ts
4
+ const PreviewDocumentContext = createContext(void 0);
5
+
6
+ //#endregion
7
+ export { PreviewDocumentContext };
@@ -0,0 +1,149 @@
1
+ import { getApiClient } from "../../lib/api-client.js";
2
+ import { SharedChromeContext } from "./SharedChromeContext.js";
3
+ import { previewStore, selectPreviewSource } from "../preview/previewStore.js";
4
+ import { Navbar } from "../studio/components/Navbar.js";
5
+ import { PreviewToolbar } from "../preview/components/PreviewToolbar.js";
6
+ import { c } from "react/compiler-runtime";
7
+ import { useQuery } from "@tanstack/react-query";
8
+ import { jsx, jsxs } from "react/jsx-runtime";
9
+ import { useSelector } from "@xstate/store-react";
10
+ import { queryKeys } from "@camox/api-contract/query-keys";
11
+ import studioCssUrl from "virtual:camox-studio-css";
12
+
13
+ //#region src/features/runtime/RuntimeChrome.tsx
14
+ function RuntimeChrome(t0) {
15
+ const $ = c(33);
16
+ if ($[0] !== "b6bc64556f010bff957a9ab8a6f788b2f582426a19b86427f9d0314970d7a4dc") {
17
+ for (let $i = 0; $i < 33; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
18
+ $[0] = "b6bc64556f010bff957a9ab8a6f788b2f582426a19b86427f9d0314970d7a4dc";
19
+ }
20
+ const { input, children } = t0;
21
+ const preview = !input.routeKind;
22
+ const hidden = useSelector(previewStore, _temp);
23
+ const source = useSelector(previewStore, selectPreviewSource);
24
+ let t1;
25
+ if ($[1] !== input.pathname || $[2] !== source) {
26
+ t1 = queryKeys.pages.getByPath(input.pathname, source);
27
+ $[1] = input.pathname;
28
+ $[2] = source;
29
+ $[3] = t1;
30
+ } else t1 = $[3];
31
+ let t2;
32
+ if ($[4] !== input.pathname || $[5] !== input.projectSlug || $[6] !== source) {
33
+ t2 = () => getApiClient().pages.getStructure({
34
+ path: input.pathname,
35
+ projectSlug: input.projectSlug,
36
+ source
37
+ });
38
+ $[4] = input.pathname;
39
+ $[5] = input.projectSlug;
40
+ $[6] = source;
41
+ $[7] = t2;
42
+ } else t2 = $[7];
43
+ let t3;
44
+ if ($[8] !== t1 || $[9] !== t2) {
45
+ t3 = {
46
+ queryKey: t1,
47
+ queryFn: t2,
48
+ enabled: false
49
+ };
50
+ $[8] = t1;
51
+ $[9] = t2;
52
+ $[10] = t3;
53
+ } else t3 = $[10];
54
+ const { data: page } = useQuery(t3);
55
+ let t4;
56
+ if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
57
+ t4 = /* @__PURE__ */ jsx("link", {
58
+ rel: "stylesheet",
59
+ href: studioCssUrl,
60
+ "data-camox-studio": true
61
+ });
62
+ $[11] = t4;
63
+ } else t4 = $[11];
64
+ const t5 = preview ? "max-md:hidden" : void 0;
65
+ const t6 = preview && hidden;
66
+ let t7;
67
+ if ($[12] !== preview) {
68
+ t7 = /* @__PURE__ */ jsx(Navbar, { isPreview: preview });
69
+ $[12] = preview;
70
+ $[13] = t7;
71
+ } else t7 = $[13];
72
+ let t8;
73
+ if ($[14] !== t5 || $[15] !== t6 || $[16] !== t7) {
74
+ t8 = /* @__PURE__ */ jsx("div", {
75
+ className: t5,
76
+ hidden: t6,
77
+ children: t7
78
+ });
79
+ $[14] = t5;
80
+ $[15] = t6;
81
+ $[16] = t7;
82
+ $[17] = t8;
83
+ } else t8 = $[17];
84
+ let t9;
85
+ if ($[18] !== children) {
86
+ t9 = /* @__PURE__ */ jsx("div", {
87
+ className: "flex min-h-0 flex-1 flex-col overflow-auto",
88
+ children
89
+ });
90
+ $[18] = children;
91
+ $[19] = t9;
92
+ } else t9 = $[19];
93
+ const t10 = !preview;
94
+ const t11 = input.derived ? void 0 : "max-md:hidden";
95
+ const t12 = preview && !input.derived ? page?.page.status : void 0;
96
+ const t13 = !!page?.page.livePublishedCheckpointId;
97
+ let t14;
98
+ if ($[20] !== t12 || $[21] !== t13) {
99
+ t14 = /* @__PURE__ */ jsx(PreviewToolbar, {
100
+ pageStatus: t12,
101
+ hasLiveVersion: t13
102
+ });
103
+ $[20] = t12;
104
+ $[21] = t13;
105
+ $[22] = t14;
106
+ } else t14 = $[22];
107
+ let t15;
108
+ if ($[23] !== t10 || $[24] !== t11 || $[25] !== t14) {
109
+ t15 = /* @__PURE__ */ jsx("div", {
110
+ hidden: t10,
111
+ className: t11,
112
+ children: t14
113
+ });
114
+ $[23] = t10;
115
+ $[24] = t11;
116
+ $[25] = t14;
117
+ $[26] = t15;
118
+ } else t15 = $[26];
119
+ let t16;
120
+ if ($[27] !== t15 || $[28] !== t9) {
121
+ t16 = /* @__PURE__ */ jsxs("div", {
122
+ className: "relative flex min-h-0 flex-1 flex-col",
123
+ children: [t9, t15]
124
+ });
125
+ $[27] = t15;
126
+ $[28] = t9;
127
+ $[29] = t16;
128
+ } else t16 = $[29];
129
+ let t17;
130
+ if ($[30] !== t16 || $[31] !== t8) {
131
+ t17 = /* @__PURE__ */ jsxs(SharedChromeContext.Provider, {
132
+ value: true,
133
+ children: [t4, /* @__PURE__ */ jsxs("div", {
134
+ className: "bg-background flex h-screen flex-col overflow-hidden",
135
+ children: [t8, t16]
136
+ })]
137
+ });
138
+ $[30] = t16;
139
+ $[31] = t8;
140
+ $[32] = t17;
141
+ } else t17 = $[32];
142
+ return t17;
143
+ }
144
+ function _temp(state) {
145
+ return state.context.isToolbarHidden;
146
+ }
147
+
148
+ //#endregion
149
+ export { RuntimeChrome };
@@ -0,0 +1,7 @@
1
+ import { createContext } from "react";
2
+
3
+ //#region src/features/runtime/SharedChromeContext.ts
4
+ const SharedChromeContext = createContext(false);
5
+
6
+ //#endregion
7
+ export { SharedChromeContext };
@@ -0,0 +1,21 @@
1
+ //#region src/features/runtime/navigationRequest.ts
2
+ function createNavigationRequestTracker() {
3
+ let current;
4
+ return {
5
+ begin() {
6
+ current?.abort();
7
+ const controller = new AbortController();
8
+ current = controller;
9
+ return {
10
+ signal: controller.signal,
11
+ isCurrent: () => current === controller && !controller.signal.aborted
12
+ };
13
+ },
14
+ cancel() {
15
+ current?.abort();
16
+ }
17
+ };
18
+ }
19
+
20
+ //#endregion
21
+ export { createNavigationRequestTracker };
@@ -0,0 +1,23 @@
1
+ //#region src/features/runtime/navigationTarget.ts
2
+ function runtimePath(pathname, basePath) {
3
+ const base = basePath.replace(/\/$/, "");
4
+ if (!base || pathname === base || pathname.startsWith(`${base}/`)) return pathname;
5
+ return `${base}${pathname.startsWith("/") ? pathname : `/${pathname}`}`;
6
+ }
7
+ function getNavigationTarget(to, currentHref, basePath) {
8
+ const url = new URL(to, currentHref);
9
+ const current = new URL(currentHref);
10
+ if (url.origin !== current.origin || !["http:", "https:"].includes(url.protocol)) return null;
11
+ const base = basePath.replace(/\/$/, "");
12
+ if (base && /^(https?:)?\/\//.test(to) && url.pathname !== base && !url.pathname.startsWith(`${base}/`)) return null;
13
+ const pathname = base && (url.pathname === base || url.pathname.startsWith(`${base}/`)) ? url.pathname.slice(base.length) || "/" : url.pathname;
14
+ if (pathname === "/_camox" || pathname.startsWith("/_camox/") || pathname === "/og" || pathname === "/sitemap.xml") return null;
15
+ url.pathname = runtimePath(pathname, base);
16
+ return {
17
+ url,
18
+ pathname
19
+ };
20
+ }
21
+
22
+ //#endregion
23
+ export { getNavigationTarget, runtimePath };