From 780e94d0eb961de6895dfdf47fb0a0afdfeb9d80 Mon Sep 17 00:00:00 2001 From: Brad Mering Date: Tue, 17 Sep 2024 08:30:18 -0600 Subject: [PATCH] Fix a path issue in the ComponentDesignTokens component --- dist/cli.js | 2 +- dist/transformers/integration/index.d.ts | 1 + dist/transformers/utils.d.ts | 10 +++++++-- src/app/components/AnchorNavLink.tsx | 23 +++++++++++++++----- src/app/components/ComponentDesignTokens.tsx | 2 +- src/app/pages/_app.tsx | 2 +- src/cli.ts | 2 +- 7 files changed, 30 insertions(+), 12 deletions(-) diff --git a/dist/cli.js b/dist/cli.js index e5b9e773..31e0e2ed 100755 --- a/dist/cli.js +++ b/dist/cli.js @@ -80,7 +80,7 @@ var showHelp = function () { * Show the help message */ var showVersion = function () { - cliError('Handoff App - 0.13.0', 2); + cliError('Handoff App - 0.13.1', 2); }; /** * Define a CLI error diff --git a/dist/transformers/integration/index.d.ts b/dist/transformers/integration/index.d.ts index 92c04a9b..e480ea51 100644 --- a/dist/transformers/integration/index.d.ts +++ b/dist/transformers/integration/index.d.ts @@ -1,3 +1,4 @@ +/// import archiver from 'archiver'; import * as stream from 'node:stream'; import { DocumentationObject } from '../../types'; diff --git a/dist/transformers/utils.d.ts b/dist/transformers/utils.d.ts index acd57a17..cb7ad534 100644 --- a/dist/transformers/utils.d.ts +++ b/dist/transformers/utils.d.ts @@ -24,14 +24,20 @@ export declare const formatComponentCodeBlockComment: (component: ComponentInsta * @param options * @returns */ -export declare const formatTokenName: (tokenType: TokenType, componentName: string, componentVariantProps: [string, string][], part: string, property: string, options?: IntegrationObjectComponentOptions) => string; +export declare const formatTokenName: (tokenType: TokenType, componentName: string, componentVariantProps: [ + string, + string +][], part: string, property: string, options?: IntegrationObjectComponentOptions) => string; /** * Returns the token name segments * @param component * @param options * @returns */ -export declare const getTokenNameSegments: (componentName: string, componentVariantProps: [string, string][], part: string, property: string, options?: IntegrationObjectComponentOptions) => string[]; +export declare const getTokenNameSegments: (componentName: string, componentVariantProps: [ + string, + string +][], part: string, property: string, options?: IntegrationObjectComponentOptions) => string[]; /** * Normalizes the token name variable (specifier) by considering if the value should be replaced * with some other value based replace rules defined in the transformer options of the component diff --git a/src/app/components/AnchorNavLink.tsx b/src/app/components/AnchorNavLink.tsx index 477eacda..be0c6942 100644 --- a/src/app/components/AnchorNavLink.tsx +++ b/src/app/components/AnchorNavLink.tsx @@ -11,14 +11,25 @@ export const AnchorNavLink: React.FC = ({ to, children }) => useEffect(() => { setOffset(document.getElementById('site-header')?.clientHeight ?? 0); - }, []) + }, []); return ( - { - history.pushState ? history.pushState(null, '', `#${to}`) : location.hash = `#${to}`; - }}> - {children} - + <> + {/* @ts-ignore */} + { + history.pushState ? history.pushState(null, '', `#${to}`) : (location.hash = `#${to}`); + }} + > + {children} + + ); }; diff --git a/src/app/components/ComponentDesignTokens.tsx b/src/app/components/ComponentDesignTokens.tsx index f40aa37d..7fa862ff 100644 --- a/src/app/components/ComponentDesignTokens.tsx +++ b/src/app/components/ComponentDesignTokens.tsx @@ -4,7 +4,7 @@ import React, { useEffect } from 'react'; import Icon from './Icon'; import { transformComponentTokensToScssVariables } from '@handoff/transformers/scss/component'; import { ComponentInstance } from '@handoff/exporters/components/types'; -import { IntegrationObjectComponentOptions } from '../../types/config'; +import { IntegrationObjectComponentOptions } from '@handoff/types/config'; const PropertyIconPathMap = { 'border-width': 'token-border-width', diff --git a/src/app/pages/_app.tsx b/src/app/pages/_app.tsx index 622cf87b..31e20cc2 100644 --- a/src/app/pages/_app.tsx +++ b/src/app/pages/_app.tsx @@ -7,8 +7,8 @@ import '../sass/main.scss'; function MyApp({ Component, pageProps }: AppProps) { return ( <> + {/* @ts-ignore */} - ); } diff --git a/src/cli.ts b/src/cli.ts index da3c1ce0..fc27ee1b 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -57,7 +57,7 @@ const showHelp = () => { * Show the help message */ const showVersion = () => { - cliError('Handoff App - 0.13.0', 2); + cliError('Handoff App - 0.13.1', 2); }; /**