-
+
diff --git a/apps/www/.vitepress/theme/components/Stackblitz.vue b/apps/www/.vitepress/theme/components/Stackblitz.vue
index 383c470d..658fca3f 100644
--- a/apps/www/.vitepress/theme/components/Stackblitz.vue
+++ b/apps/www/.vitepress/theme/components/Stackblitz.vue
@@ -4,7 +4,7 @@ import { Icon } from '@iconify/vue'
import { makeStackblitzParams } from '../utils/codeeditor'
import Tooltip from './Tooltip.vue'
import { Button } from '@/lib/registry/new-york/ui/button'
-import { type Style } from '@/lib/registry/styles'
+import type { Style } from '@/lib/registry/styles'
const props = defineProps<{
name: string
diff --git a/apps/www/.vitepress/theme/components/TabPreview.vue b/apps/www/.vitepress/theme/components/TabPreview.vue
index 46bb64ee..ebc2cd0c 100644
--- a/apps/www/.vitepress/theme/components/TabPreview.vue
+++ b/apps/www/.vitepress/theme/components/TabPreview.vue
@@ -7,6 +7,8 @@ const props = withDefaults(defineProps<{
align?: 'center' | 'start' | 'end'
sfcTsCode?: string
sfcTsHtml?: string
+ sfcTsCodeNewYork?: string
+ sfcTsHtmlNewYork?: string
}>(), {
align: 'center',
names: () => ['CLI', 'Manual'],
diff --git a/apps/www/.vitepress/theme/plugins/previewer.ts b/apps/www/.vitepress/theme/plugins/previewer.ts
index 5b5fca74..b4fc4137 100644
--- a/apps/www/.vitepress/theme/plugins/previewer.ts
+++ b/apps/www/.vitepress/theme/plugins/previewer.ts
@@ -18,11 +18,16 @@ export default function (md: MarkdownRenderer) {
const { name, attrs } = props
const pluginPath = dirname(__dirname)
const srcPath = resolve(pluginPath, '../../src/lib/registry/default/example/', `${name}.vue`).replace(/\\/g, '/')
+ const srcPathNewYork = resolve(pluginPath, '../../src/lib/registry/new-york/example/', `${name}.vue`).replace(/\\/g, '/')
if (!fs.existsSync(srcPath)) {
console.error(`rendering ${path}: ${srcPath} does not exist`)
return defaultRender!(tokens, idx, options, env, self)
}
+ if (!fs.existsSync(srcPathNewYork)) {
+ console.error(`rendering ${path}: ${srcPathNewYork} does not exist`)
+ return defaultRender!(tokens, idx, options, env, self)
+ }
let code = fs.readFileSync(srcPath, 'utf-8')
code = code.replaceAll(
@@ -30,10 +35,17 @@ export default function (md: MarkdownRenderer) {
'@/components/',
)
+ let codeNewYork = fs.readFileSync(srcPathNewYork, 'utf-8')
+ codeNewYork = codeNewYork.replaceAll(
+ '@/lib/registry/default/',
+ '@/components/',
+ )
+
const demoScripts = generateDemoComponent(md, env, {
attrs,
props,
code,
+ codeNewYork,
path: srcPath,
})
diff --git a/apps/www/.vitepress/theme/plugins/utils.ts b/apps/www/.vitepress/theme/plugins/utils.ts
index 2d925566..026ac38c 100644
--- a/apps/www/.vitepress/theme/plugins/utils.ts
+++ b/apps/www/.vitepress/theme/plugins/utils.ts
@@ -9,19 +9,24 @@ export interface GenerateOptions {
props: Record
path: string
code: string
+ codeNewYork: string
}
export function parse(
md: MarkdownRenderer,
env: MarkdownEnv,
- { code, attrs: _attrs, props }: GenerateOptions,
+ { code, codeNewYork, attrs: _attrs, props }: GenerateOptions,
) {
const highlightedHtml = md.options.highlight!(code, 'vue', _attrs || '')
+ const highlightedNewYorkHtml = md.options.highlight!(codeNewYork, 'vue', _attrs || '')
const sfcTsHtml = highlightedHtml
+ const sfcTsHtmlNewYork = highlightedNewYorkHtml
const attrs
= `sfcTsCode="${encodeURIComponent(code)}"\n`
+ `sfcTsHtml="${encodeURIComponent(sfcTsHtml)}"\n`
+ + `sfcTsCodeNewYork="${encodeURIComponent(codeNewYork)}"\n`
+ + `sfcTsHtmlNewYork="${encodeURIComponent(sfcTsHtmlNewYork)}"\n`
+ `v-bind='${JSON.stringify(props)}'\n`
return {
@@ -29,6 +34,8 @@ export function parse(
highlightedHtml,
sfcTsCode: code,
sfcTsHtml,
+ sfcTsCodeNewYork: codeNewYork,
+ sfcTsHtmlNewYork,
}
}
diff --git a/apps/www/src/lib/registry/default/example/InputWithIcon.vue b/apps/www/src/lib/registry/default/example/InputWithIcon.vue
index 04d295ff..0e393679 100644
--- a/apps/www/src/lib/registry/default/example/InputWithIcon.vue
+++ b/apps/www/src/lib/registry/default/example/InputWithIcon.vue
@@ -1,5 +1,5 @@
@@ -7,7 +7,7 @@ import { Input } from '@/lib/registry/default/ui/input'
-
+
diff --git a/apps/www/src/lib/registry/new-york/example/DrawerDemo.vue b/apps/www/src/lib/registry/new-york/example/DrawerDemo.vue
index a92c3e04..9bb93e5b 100644
--- a/apps/www/src/lib/registry/new-york/example/DrawerDemo.vue
+++ b/apps/www/src/lib/registry/new-york/example/DrawerDemo.vue
@@ -1,6 +1,6 @@