chore: updated all site base urls
This commit is contained in:
@ -5,8 +5,8 @@ import {
|
|||||||
BillingRemaining,
|
BillingRemaining,
|
||||||
BillingRemainingMode,
|
BillingRemainingMode,
|
||||||
} from '@src/components/BillingRemaining'
|
} from '@src/components/BillingRemaining'
|
||||||
|
|
||||||
import { type BillingActor } from '@src/machines/billingMachine'
|
import { type BillingActor } from '@src/machines/billingMachine'
|
||||||
|
import { withSiteBaseURL } from '@src/lib/withBaseURL'
|
||||||
|
|
||||||
export const BillingDialog = (props: { billingActor: BillingActor }) => {
|
export const BillingDialog = (props: { billingActor: BillingActor }) => {
|
||||||
const billingContext = useSelector(
|
const billingContext = useSelector(
|
||||||
@ -42,7 +42,7 @@ export const BillingDialog = (props: { billingActor: BillingActor }) => {
|
|||||||
{!hasUnlimited && (
|
{!hasUnlimited && (
|
||||||
<a
|
<a
|
||||||
className="bg-ml-black text-ml-white rounded-lg text-center p-1 cursor-pointer"
|
className="bg-ml-black text-ml-white rounded-lg text-center p-1 cursor-pointer"
|
||||||
href="https://zoo.dev/design-studio-pricing"
|
href={withSiteBaseURL('/design-studio-pricing')}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
data-testid="billing-upgrade-button"
|
data-testid="billing-upgrade-button"
|
||||||
|
@ -15,6 +15,7 @@ import {
|
|||||||
import { onboardingStartPath } from '@src/lib/onboardingPaths'
|
import { onboardingStartPath } from '@src/lib/onboardingPaths'
|
||||||
import { reportRejection } from '@src/lib/trap'
|
import { reportRejection } from '@src/lib/trap'
|
||||||
import { isDesktop } from '@src/lib/isDesktop'
|
import { isDesktop } from '@src/lib/isDesktop'
|
||||||
|
import { withSiteBaseURL } from '@src/lib/withBaseURL'
|
||||||
|
|
||||||
const HelpMenuDivider = () => (
|
const HelpMenuDivider = () => (
|
||||||
<div className="h-[1px] bg-chalkboard-110 dark:bg-chalkboard-80" />
|
<div className="h-[1px] bg-chalkboard-110 dark:bg-chalkboard-80" />
|
||||||
@ -89,7 +90,7 @@ export function HelpMenu() {
|
|||||||
<HelpMenuDivider />
|
<HelpMenuDivider />
|
||||||
<HelpMenuItem
|
<HelpMenuItem
|
||||||
as="a"
|
as="a"
|
||||||
href="https://zoo.dev/docs/kcl-samples"
|
href={withSiteBaseURL('/docs/kcl-samples')}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
>
|
>
|
||||||
@ -97,7 +98,7 @@ export function HelpMenu() {
|
|||||||
</HelpMenuItem>
|
</HelpMenuItem>
|
||||||
<HelpMenuItem
|
<HelpMenuItem
|
||||||
as="a"
|
as="a"
|
||||||
href="https://zoo.dev/docs/kcl-lang"
|
href={withSiteBaseURL('/docs/kcl-lang')}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
>
|
>
|
||||||
|
@ -12,6 +12,7 @@ import { reportRejection } from '@src/lib/trap'
|
|||||||
import { commandBarActor, settingsActor } from '@src/lib/singletons'
|
import { commandBarActor, settingsActor } from '@src/lib/singletons'
|
||||||
|
|
||||||
import styles from './KclEditorMenu.module.css'
|
import styles from './KclEditorMenu.module.css'
|
||||||
|
import { withSiteBaseURL } from '@src/lib/withBaseURL'
|
||||||
|
|
||||||
export const KclEditorMenu = ({ children }: PropsWithChildren) => {
|
export const KclEditorMenu = ({ children }: PropsWithChildren) => {
|
||||||
const { enable: convertToVarEnabled, handleClick: handleConvertToVarClick } =
|
const { enable: convertToVarEnabled, handleClick: handleConvertToVarClick } =
|
||||||
@ -67,7 +68,7 @@ export const KclEditorMenu = ({ children }: PropsWithChildren) => {
|
|||||||
<Menu.Item>
|
<Menu.Item>
|
||||||
<a
|
<a
|
||||||
className={styles.button}
|
className={styles.button}
|
||||||
href="https://zoo.dev/docs/kcl-lang"
|
href={withSiteBaseURL('/docs/kcl-lang')}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
onClick={openExternalBrowserIfDesktop()}
|
onClick={openExternalBrowserIfDesktop()}
|
||||||
@ -108,7 +109,7 @@ export const KclEditorMenu = ({ children }: PropsWithChildren) => {
|
|||||||
<Menu.Item>
|
<Menu.Item>
|
||||||
<a
|
<a
|
||||||
className={styles.button}
|
className={styles.button}
|
||||||
href="https://zoo.dev/docs/kcl-samples"
|
href={withSiteBaseURL('/docs/kcl-samples')}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
onClick={openExternalBrowserIfDesktop()}
|
onClick={openExternalBrowserIfDesktop()}
|
||||||
|
@ -13,6 +13,7 @@ import { isDesktop } from '@src/lib/isDesktop'
|
|||||||
import { PATHS } from '@src/lib/paths'
|
import { PATHS } from '@src/lib/paths'
|
||||||
import { authActor } from '@src/lib/singletons'
|
import { authActor } from '@src/lib/singletons'
|
||||||
import { reportRejection } from '@src/lib/trap'
|
import { reportRejection } from '@src/lib/trap'
|
||||||
|
import { withSiteBaseURL } from '@src/lib/withBaseURL'
|
||||||
|
|
||||||
type User = Models['User_type']
|
type User = Models['User_type']
|
||||||
|
|
||||||
@ -62,7 +63,7 @@ const UserSidebarMenu = ({ user }: { user?: User }) => {
|
|||||||
{
|
{
|
||||||
id: 'account',
|
id: 'account',
|
||||||
Element: 'externalLink',
|
Element: 'externalLink',
|
||||||
to: 'https://zoo.dev/account',
|
to: withSiteBaseURL('/account'),
|
||||||
children: (
|
children: (
|
||||||
<>
|
<>
|
||||||
<span className="flex-1">Manage account</span>
|
<span className="flex-1">Manage account</span>
|
||||||
|
@ -11,6 +11,7 @@ import {
|
|||||||
pipeHasCircle,
|
pipeHasCircle,
|
||||||
} from '@src/machines/modelingMachine'
|
} from '@src/machines/modelingMachine'
|
||||||
import { IS_ML_EXPERIMENTAL } from '@src/lib/constants'
|
import { IS_ML_EXPERIMENTAL } from '@src/lib/constants'
|
||||||
|
import { withSiteBaseURL } from '@src/lib/withBaseURL'
|
||||||
|
|
||||||
export type ToolbarModeName = 'modeling' | 'sketching'
|
export type ToolbarModeName = 'modeling' | 'sketching'
|
||||||
|
|
||||||
@ -105,7 +106,9 @@ export const toolbarConfig: Record<ToolbarModeName, ToolbarMode> = {
|
|||||||
links: [
|
links: [
|
||||||
{
|
{
|
||||||
label: 'KCL docs',
|
label: 'KCL docs',
|
||||||
url: 'https://zoo.dev/docs/kcl-std/functions/std-sketch-startSketchOn',
|
url: withSiteBaseURL(
|
||||||
|
'/docs/kcl-std/functions/std-sketch-startSketchOn'
|
||||||
|
),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@ -125,7 +128,7 @@ export const toolbarConfig: Record<ToolbarModeName, ToolbarMode> = {
|
|||||||
links: [
|
links: [
|
||||||
{
|
{
|
||||||
label: 'KCL docs',
|
label: 'KCL docs',
|
||||||
url: 'https://zoo.dev/docs/kcl-std/functions/std-sketch-extrude',
|
url: withSiteBaseURL('/docs/kcl-std/functions/std-sketch-extrude'),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@ -145,7 +148,7 @@ export const toolbarConfig: Record<ToolbarModeName, ToolbarMode> = {
|
|||||||
links: [
|
links: [
|
||||||
{
|
{
|
||||||
label: 'KCL docs',
|
label: 'KCL docs',
|
||||||
url: 'https://zoo.dev/docs/kcl-std/functions/std-sketch-sweep',
|
url: withSiteBaseURL('/docs/kcl-std/functions/std-sketch-sweep'),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@ -165,7 +168,7 @@ export const toolbarConfig: Record<ToolbarModeName, ToolbarMode> = {
|
|||||||
links: [
|
links: [
|
||||||
{
|
{
|
||||||
label: 'KCL docs',
|
label: 'KCL docs',
|
||||||
url: 'https://zoo.dev/docs/kcl-std/functions/std-sketch-loft',
|
url: withSiteBaseURL('/docs/kcl-std/functions/std-sketch-loft'),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@ -185,11 +188,11 @@ export const toolbarConfig: Record<ToolbarModeName, ToolbarMode> = {
|
|||||||
links: [
|
links: [
|
||||||
{
|
{
|
||||||
label: 'KCL docs',
|
label: 'KCL docs',
|
||||||
url: 'https://zoo.dev/docs/kcl-std/functions/std-sketch-revolve',
|
url: withSiteBaseURL('/docs/kcl-std/functions/std-sketch-revolve'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'KCL example',
|
label: 'KCL example',
|
||||||
url: 'https://zoo.dev/docs/kcl-samples/ball-bearing',
|
url: withSiteBaseURL('/docs/kcl-samples/ball-bearing'),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@ -209,7 +212,7 @@ export const toolbarConfig: Record<ToolbarModeName, ToolbarMode> = {
|
|||||||
links: [
|
links: [
|
||||||
{
|
{
|
||||||
label: 'KCL docs',
|
label: 'KCL docs',
|
||||||
url: 'https://zoo.dev/docs/kcl-std/functions/std-solid-fillet',
|
url: withSiteBaseURL('/docs/kcl-std/functions/std-solid-fillet'),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@ -234,7 +237,7 @@ export const toolbarConfig: Record<ToolbarModeName, ToolbarMode> = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'KCL docs',
|
label: 'KCL docs',
|
||||||
url: 'https://zoo.dev/docs/kcl-std/functions/std-solid-chamfer',
|
url: withSiteBaseURL('/docs/kcl-std/functions/std-solid-chamfer'),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@ -253,7 +256,7 @@ export const toolbarConfig: Record<ToolbarModeName, ToolbarMode> = {
|
|||||||
links: [
|
links: [
|
||||||
{
|
{
|
||||||
label: 'KCL docs',
|
label: 'KCL docs',
|
||||||
url: 'https://zoo.dev/docs/kcl-std/functions/std-solid-shell',
|
url: withSiteBaseURL('/docs/kcl-std/functions/std-solid-shell'),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@ -275,7 +278,7 @@ export const toolbarConfig: Record<ToolbarModeName, ToolbarMode> = {
|
|||||||
links: [
|
links: [
|
||||||
{
|
{
|
||||||
label: 'KCL docs',
|
label: 'KCL docs',
|
||||||
url: 'https://zoo.dev/docs/kcl-std/functions/std-solid-union',
|
url: withSiteBaseURL('/docs/kcl-std/functions/std-solid-union'),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@ -293,7 +296,9 @@ export const toolbarConfig: Record<ToolbarModeName, ToolbarMode> = {
|
|||||||
links: [
|
links: [
|
||||||
{
|
{
|
||||||
label: 'KCL docs',
|
label: 'KCL docs',
|
||||||
url: 'https://zoo.dev/docs/kcl-std/functions/std-solid-subtract',
|
url: withSiteBaseURL(
|
||||||
|
'/docs/kcl-std/functions/std-solid-subtract'
|
||||||
|
),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@ -311,7 +316,9 @@ export const toolbarConfig: Record<ToolbarModeName, ToolbarMode> = {
|
|||||||
links: [
|
links: [
|
||||||
{
|
{
|
||||||
label: 'KCL docs',
|
label: 'KCL docs',
|
||||||
url: 'https://zoo.dev/docs/kcl-std/functions/std-solid-intersect',
|
url: withSiteBaseURL(
|
||||||
|
'/docs/kcl-std/functions/std-solid-intersect'
|
||||||
|
),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@ -337,7 +344,7 @@ export const toolbarConfig: Record<ToolbarModeName, ToolbarMode> = {
|
|||||||
links: [
|
links: [
|
||||||
{
|
{
|
||||||
label: 'KCL docs',
|
label: 'KCL docs',
|
||||||
url: 'https://zoo.dev/docs/kcl-std/functions/std-offsetPlane',
|
url: withSiteBaseURL('/docs/kcl-std/functions/std-offsetPlane'),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@ -368,7 +375,7 @@ export const toolbarConfig: Record<ToolbarModeName, ToolbarMode> = {
|
|||||||
links: [
|
links: [
|
||||||
{
|
{
|
||||||
label: 'KCL docs',
|
label: 'KCL docs',
|
||||||
url: 'https://zoo.dev/docs/kcl-std/functions/std-helix',
|
url: withSiteBaseURL('/docs/kcl-std/functions/std-helix'),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@ -389,7 +396,7 @@ export const toolbarConfig: Record<ToolbarModeName, ToolbarMode> = {
|
|||||||
links: [
|
links: [
|
||||||
{
|
{
|
||||||
label: 'API docs',
|
label: 'API docs',
|
||||||
url: 'https://zoo.dev/docs/kcl-lang/modules',
|
url: withSiteBaseURL('/docs/kcl-lang/modules'),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@ -410,7 +417,9 @@ export const toolbarConfig: Record<ToolbarModeName, ToolbarMode> = {
|
|||||||
links: [
|
links: [
|
||||||
{
|
{
|
||||||
label: 'API docs',
|
label: 'API docs',
|
||||||
url: 'https://zoo.dev/docs/kcl-std/functions/std-transform-translate',
|
url: withSiteBaseURL(
|
||||||
|
'/docs/kcl-std/functions/std-transform-translate'
|
||||||
|
),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@ -428,7 +437,9 @@ export const toolbarConfig: Record<ToolbarModeName, ToolbarMode> = {
|
|||||||
links: [
|
links: [
|
||||||
{
|
{
|
||||||
label: 'API docs',
|
label: 'API docs',
|
||||||
url: 'https://zoo.dev/docs/kcl-std/functions/std-transform-rotate',
|
url: withSiteBaseURL(
|
||||||
|
'/docs/kcl-std/functions/std-transform-rotate'
|
||||||
|
),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@ -446,7 +457,7 @@ export const toolbarConfig: Record<ToolbarModeName, ToolbarMode> = {
|
|||||||
links: [
|
links: [
|
||||||
{
|
{
|
||||||
label: 'API docs',
|
label: 'API docs',
|
||||||
url: 'https://zoo.dev/docs/kcl-std/functions/std-clone',
|
url: withSiteBaseURL('/docs/kcl-std/functions/std-clone'),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@ -482,7 +493,9 @@ export const toolbarConfig: Record<ToolbarModeName, ToolbarMode> = {
|
|||||||
links: [
|
links: [
|
||||||
{
|
{
|
||||||
label: 'API docs',
|
label: 'API docs',
|
||||||
url: 'https://zoo.dev/docs/api/ml/generate-a-cad-model-from-text',
|
url: withSiteBaseURL(
|
||||||
|
'/docs/api/ml/generate-a-cad-model-from-text'
|
||||||
|
),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@ -739,7 +752,7 @@ export const toolbarConfig: Record<ToolbarModeName, ToolbarMode> = {
|
|||||||
links: [
|
links: [
|
||||||
{
|
{
|
||||||
label: 'KCL docs',
|
label: 'KCL docs',
|
||||||
url: 'https://zoo.dev/docs/kcl-std/functions/std-sketch-polygon',
|
url: withSiteBaseURL('/docs/kcl-std/functions/std-sketch-polygon'),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@ -755,7 +768,9 @@ export const toolbarConfig: Record<ToolbarModeName, ToolbarMode> = {
|
|||||||
links: [
|
links: [
|
||||||
{
|
{
|
||||||
label: 'KCL docs',
|
label: 'KCL docs',
|
||||||
url: 'https://zoo.dev/docs/kcl-std/functions/std-transform-mirror2d',
|
url: withSiteBaseURL(
|
||||||
|
'/docs/kcl-std/functions/std-transform-mirror2d'
|
||||||
|
),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
6
src/lib/withBaseURLNode.ts
Normal file
6
src/lib/withBaseURLNode.ts
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
/**
|
||||||
|
* This will not run in the browser, look at withBaseURL
|
||||||
|
*/
|
||||||
|
export function withSiteBaseURLNode(path: string): string {
|
||||||
|
return process.env.VITE_KC_SITE_BASE_URL + path
|
||||||
|
}
|
@ -5,6 +5,7 @@ import { reportRejection } from '@src/lib/trap'
|
|||||||
import { typeSafeWebContentsSend } from '@src/menu/channels'
|
import { typeSafeWebContentsSend } from '@src/menu/channels'
|
||||||
import type { ZooMenuItemConstructorOptions } from '@src/menu/roles'
|
import type { ZooMenuItemConstructorOptions } from '@src/menu/roles'
|
||||||
import { getAutoUpdater } from '@src/updater'
|
import { getAutoUpdater } from '@src/updater'
|
||||||
|
import { withSiteBaseURLNode } from '@src/lib/withBaseURLNode'
|
||||||
|
|
||||||
export const helpRole = (
|
export const helpRole = (
|
||||||
mainWindow: BrowserWindow
|
mainWindow: BrowserWindow
|
||||||
@ -26,14 +27,16 @@ export const helpRole = (
|
|||||||
id: 'Help.KCL code samples',
|
id: 'Help.KCL code samples',
|
||||||
click: () => {
|
click: () => {
|
||||||
shell
|
shell
|
||||||
.openExternal('https://zoo.dev/docs/kcl-samples')
|
.openExternal(withSiteBaseURLNode('/docs/kcl-samples'))
|
||||||
.catch(reportRejection)
|
.catch(reportRejection)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'KCL Docs',
|
label: 'KCL Docs',
|
||||||
click: () => {
|
click: () => {
|
||||||
shell.openExternal('https://zoo.dev/docs/kcl').catch(reportRejection)
|
shell
|
||||||
|
.openExternal(withSiteBaseURLNode('/docs/kcl'))
|
||||||
|
.catch(reportRejection)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -116,7 +119,9 @@ export const helpRole = (
|
|||||||
{
|
{
|
||||||
label: 'Manage Account',
|
label: 'Manage Account',
|
||||||
click: () => {
|
click: () => {
|
||||||
shell.openExternal('https://zoo.dev/account').catch(reportRejection)
|
shell
|
||||||
|
.openExternal(withSiteBaseURLNode('/account'))
|
||||||
|
.catch(reportRejection)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
@ -67,7 +67,7 @@ import {
|
|||||||
defaultGlobalStatusBarItems,
|
defaultGlobalStatusBarItems,
|
||||||
} from '@src/components/StatusBar/defaultStatusBarItems'
|
} from '@src/components/StatusBar/defaultStatusBarItems'
|
||||||
import { useSelector } from '@xstate/react'
|
import { useSelector } from '@xstate/react'
|
||||||
import {withSiteBaseURL} from '@src/lib/withBaseURL'
|
import { withSiteBaseURL } from '@src/lib/withBaseURL'
|
||||||
|
|
||||||
type ReadWriteProjectState = {
|
type ReadWriteProjectState = {
|
||||||
value: boolean
|
value: boolean
|
||||||
|
Reference in New Issue
Block a user