From 271911a7967e2b0f06da17674696d06ad77ae262 Mon Sep 17 00:00:00 2001 From: Ahmed Yasin Koculu Date: Tue, 13 Oct 2026 01:43:04 +0200 Subject: [PATCH 1/6] Update Regor --- package.json | 2 +- packages/purestack/package.json | 2 +- packages/purestack/src/index.ts | 2 +- packages/ts-common/package.json | 2 +- packages/ts-components/package.json | 2 +- packages/ts-css/package.json | 2 +- packages/ts-html/package.json | 2 +- packages/ts-minidom/package.json | 2 +- packages/ts-page-scripts/package.json | 2 +- packages/ts-render/package.json | 2 +- packages/ts-ssg-vscode/package.json | 2 +- packages/ts-ssg/package.json | 4 ++-- packages/ts-ssg/src/config/head.ts | 2 +- packages/ts-style/package.json | 2 +- packages/ts-svg-icons/package.json | 2 +- packages/ts-util-node/package.json | 2 +- packages/ts-util/package.json | 2 +- yarn.lock | 9 ++++++++- 18 files changed, 26 insertions(+), 19 deletions(-) diff --git a/package.json b/package.json index e34edf64..4b80ed9c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "purestack-repo", - "version": "1.1.8", + "version": "1.1.9", "packageManager": "yarn@4.18.1", "type": "module", "sideEffects": false, diff --git a/packages/purestack/package.json b/packages/purestack/package.json index 7a9cff36..428c2f77 100644 --- a/packages/purestack/package.json +++ b/packages/purestack/package.json @@ -1,6 +1,6 @@ { "name": "purestack", - "version": "1.1.8", + "version": "1.1.9", "packageManager": "yarn@4.9.2", "module": "./dist/purestack.mjs", "types": "./dist/purestack.d.mts", diff --git a/packages/purestack/src/index.ts b/packages/purestack/src/index.ts index de6775e8..cf19fe12 100644 --- a/packages/purestack/src/index.ts +++ b/packages/purestack/src/index.ts @@ -1,3 +1,3 @@ -export const version: string = '1.1.8' +export const version: string = '1.1.9' export * from '@purestack/ts-ssg' diff --git a/packages/ts-common/package.json b/packages/ts-common/package.json index 3f450c88..cf766b98 100644 --- a/packages/ts-common/package.json +++ b/packages/ts-common/package.json @@ -1,6 +1,6 @@ { "name": "@purestack/ts-common", - "version": "1.1.8", + "version": "1.1.9", "packageManager": "yarn@4.9.2", "module": "./dist/ts-common.mjs", "types": "./dist/ts-common.d.mts", diff --git a/packages/ts-components/package.json b/packages/ts-components/package.json index e1c5a068..e5d40476 100644 --- a/packages/ts-components/package.json +++ b/packages/ts-components/package.json @@ -1,6 +1,6 @@ { "name": "@purestack/ts-components", - "version": "1.1.8", + "version": "1.1.9", "packageManager": "yarn@4.9.2", "module": "./dist/ts-components.mjs", "types": "./dist/ts-components.d.mts", diff --git a/packages/ts-css/package.json b/packages/ts-css/package.json index e70f8308..13bd661d 100644 --- a/packages/ts-css/package.json +++ b/packages/ts-css/package.json @@ -1,6 +1,6 @@ { "name": "@purestack/ts-css", - "version": "1.1.8", + "version": "1.1.9", "packageManager": "yarn@4.9.2", "module": "./dist/ts-css.mjs", "types": "./dist/ts-css.d.mts", diff --git a/packages/ts-html/package.json b/packages/ts-html/package.json index 7ea4e78b..6153fdac 100644 --- a/packages/ts-html/package.json +++ b/packages/ts-html/package.json @@ -1,6 +1,6 @@ { "name": "@purestack/ts-html", - "version": "1.1.8", + "version": "1.1.9", "packageManager": "yarn@4.9.2", "module": "./dist/ts-html.mjs", "types": "./dist/ts-html.d.mts", diff --git a/packages/ts-minidom/package.json b/packages/ts-minidom/package.json index 33acf4a3..67df97c7 100644 --- a/packages/ts-minidom/package.json +++ b/packages/ts-minidom/package.json @@ -1,6 +1,6 @@ { "name": "@purestack/ts-minidom", - "version": "1.1.8", + "version": "1.1.9", "packageManager": "yarn@4.9.2", "module": "./dist/ts-minidom.mjs", "types": "./dist/ts-minidom.d.mts", diff --git a/packages/ts-page-scripts/package.json b/packages/ts-page-scripts/package.json index 31c3466b..abd614fa 100644 --- a/packages/ts-page-scripts/package.json +++ b/packages/ts-page-scripts/package.json @@ -1,6 +1,6 @@ { "name": "@purestack/ts-page-scripts", - "version": "1.1.8", + "version": "1.1.9", "packageManager": "yarn@4.9.2", "module": "./dist/ts-page-scripts.mjs", "types": "./dist/ts-page-scripts.d.mts", diff --git a/packages/ts-render/package.json b/packages/ts-render/package.json index 591cc738..ed8b8076 100644 --- a/packages/ts-render/package.json +++ b/packages/ts-render/package.json @@ -1,6 +1,6 @@ { "name": "@purestack/ts-render", - "version": "1.1.8", + "version": "1.1.9", "packageManager": "yarn@4.9.2", "module": "./dist/ts-render.mjs", "types": "./dist/ts-render.d.mts", diff --git a/packages/ts-ssg-vscode/package.json b/packages/ts-ssg-vscode/package.json index bba63be6..2a6211f2 100644 --- a/packages/ts-ssg-vscode/package.json +++ b/packages/ts-ssg-vscode/package.json @@ -2,7 +2,7 @@ "name": "purestack-component-navigation", "displayName": "PureStack Component Tools", "description": "Component navigation, prop IntelliSense, lit-html syntax highlighting, and template formatting for Markdown, Regor MDX, and TypeScript templates.", - "version": "1.1.8", + "version": "1.1.9", "private": true, "publisher": "purestack", "license": "MIT", diff --git a/packages/ts-ssg/package.json b/packages/ts-ssg/package.json index 20b6e877..d407d04d 100644 --- a/packages/ts-ssg/package.json +++ b/packages/ts-ssg/package.json @@ -1,6 +1,6 @@ { "name": "@purestack/ts-ssg", - "version": "1.1.8", + "version": "1.1.9", "packageManager": "yarn@4.9.2", "module": "./dist/ts-ssg.mjs", "types": "./dist/ts-ssg.d.mts", @@ -60,7 +60,7 @@ "logpot": "^1.0.7", "mdast-util-to-hast": "^13.2.1", "pagefind": "^1.4.0", - "regor": "^1.7.3", + "regor": "^1.7.4", "rehype-raw": "^7.0.0", "rehype-stringify": "^10.0.1", "remark-gfm": "^4.0.1", diff --git a/packages/ts-ssg/src/config/head.ts b/packages/ts-ssg/src/config/head.ts index 8b9d3bed..14188e02 100644 --- a/packages/ts-ssg/src/config/head.ts +++ b/packages/ts-ssg/src/config/head.ts @@ -25,7 +25,7 @@ export function getHead(config?: BasicHeadConfig) { const head = createHead(getHeadConfig(merge(DEFAULTS, config))).push( h('meta').attr({ name: 'generator', - content: 'PureStack v1.1.8', + content: 'PureStack v1.1.9', }), h('meta').attr({ name: 'color-scheme', diff --git a/packages/ts-style/package.json b/packages/ts-style/package.json index 9ae5e616..18413efa 100644 --- a/packages/ts-style/package.json +++ b/packages/ts-style/package.json @@ -1,6 +1,6 @@ { "name": "@purestack/ts-style", - "version": "1.1.8", + "version": "1.1.9", "packageManager": "yarn@4.9.2", "module": "./dist/ts-style.mjs", "types": "./dist/ts-style.d.mts", diff --git a/packages/ts-svg-icons/package.json b/packages/ts-svg-icons/package.json index 3c85c058..5540fea3 100644 --- a/packages/ts-svg-icons/package.json +++ b/packages/ts-svg-icons/package.json @@ -1,6 +1,6 @@ { "name": "@purestack/ts-svg-icons", - "version": "1.1.8", + "version": "1.1.9", "packageManager": "yarn@4.9.2", "module": "./dist/ts-svg-icons.mjs", "types": "./dist/ts-svg-icons.d.mts", diff --git a/packages/ts-util-node/package.json b/packages/ts-util-node/package.json index bb9bb167..e51983a6 100644 --- a/packages/ts-util-node/package.json +++ b/packages/ts-util-node/package.json @@ -1,6 +1,6 @@ { "name": "@purestack/ts-util-node", - "version": "1.1.8", + "version": "1.1.9", "packageManager": "yarn@4.9.2", "module": "./dist/ts-util-node.mjs", "types": "./dist/ts-util-node.d.mts", diff --git a/packages/ts-util/package.json b/packages/ts-util/package.json index cc7bb5a3..f08d08ee 100644 --- a/packages/ts-util/package.json +++ b/packages/ts-util/package.json @@ -1,6 +1,6 @@ { "name": "@purestack/ts-util", - "version": "1.1.8", + "version": "1.1.9", "packageManager": "yarn@4.9.2", "module": "./dist/ts-util.mjs", "types": "./dist/ts-util.d.mts", diff --git a/yarn.lock b/yarn.lock index 6effe4cb..1e68097d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -834,7 +834,7 @@ __metadata: logpot: "npm:^1.0.7" mdast-util-to-hast: "npm:^13.2.1" pagefind: "npm:^1.4.0" - regor: "npm:^1.7.3" + regor: "npm:^1.7.4" rehype-raw: "npm:^7.0.0" rehype-stringify: "npm:^10.0.1" remark-gfm: "npm:^4.0.1" @@ -4406,6 +4406,13 @@ __metadata: languageName: node linkType: hard +"regor@npm:^1.7.4": + version: 1.7.4 + resolution: "regor@npm:1.7.4" + checksum: 10c0/d698b2245750b589ea84f51aa585b7f31a5f1fa896f9d3803ce84596fcb82f37fa079ee9123b4fc79de500c4a0549081ef8ec52ceecc2bab395696dc22087d9a + languageName: node + linkType: hard + "rehype-raw@npm:^7.0.0": version: 7.0.0 resolution: "rehype-raw@npm:7.0.0" From 4d6d632e22b62d558bdf00c5e752747c7d00db58 Mon Sep 17 00:00:00 2001 From: Ahmed Yasin Koculu Date: Tue, 13 Oct 2026 01:53:32 +0200 Subject: [PATCH 2/6] Rename tsSsgContext to pageContext. --- frontend/components/studioBrand.ts | 4 +- .../guides/extending/regor.mdx | 45 ++++++++------- packages/ts-common/README.md | 6 +- packages/ts-common/src/index.ts | 8 +-- packages/ts-common/src/resolvePageContext.ts | 37 +++++++++++++ packages/ts-common/src/resolveTsSsgContext.ts | 37 ------------- packages/ts-common/src/ts-ssg-context.ts | 2 +- .../src/standard/barChart/barChart.test.ts | 8 +-- .../ts-components/src/standard/btn/btn.ts | 8 +-- .../src/standard/classicLogo/classicLogo.ts | 20 +++++-- .../src/standard/composer/composer.test.ts | 2 +- .../src/standard/composer/composer.ts | 43 ++++++++++----- .../src/standard/consent/consent.ts | 12 ++-- .../doughnutChart/doughnutChart.test.ts | 10 ++-- .../standard/form/autoCompleteInput.test.ts | 12 ++-- .../ts-components/src/standard/form/form.ts | 10 ++-- .../src/standard/form/formCheck.test.ts | 10 ++-- .../src/standard/form/formInputField.test.ts | 4 +- .../src/standard/form/formSelectField.test.ts | 4 +- .../form/multiAutoCompleteInput.test.ts | 6 +- .../src/standard/lineChart/lineChart.test.ts | 8 +-- .../ts-components/src/standard/logo/logo.ts | 55 +++++++++++++++---- .../ts-components/src/standard/modal/modal.ts | 4 +- .../src/standard/navMenu/navMenu.ts | 14 ++--- .../src/standard/pageLinks/pageLinks.ts | 8 +-- .../src/standard/pageScript/pageScript.ts | 15 ++--- .../src/standard/pageToc/pageToc.ts | 14 ++--- .../src/standard/searchBox/searchBox.ts | 8 +-- .../src/standard/signIn/signIn.ts | 4 +- .../src/standard/tabs/tabs.test.ts | 2 +- .../ts-components/src/standard/tabs/tabs.ts | 4 +- .../src/standard/topBar/topBar.test.ts | 2 +- .../src/standard/topBar/topBar.ts | 8 +-- .../virtualList/variableMeasurement.test.ts | 2 +- .../ts-components/src/test/testContext.ts | 4 +- packages/ts-render/README.md | 2 +- packages/ts-render/src/renderApp.ts | 18 +++--- packages/ts-ssg/README.md | 4 +- packages/ts-ssg/src/index.ts | 2 +- packages/ts-ssg/src/mdx/md.test.ts | 4 +- packages/ts-ssg/src/mdx/mdx.test.ts | 4 +- 41 files changed, 266 insertions(+), 208 deletions(-) create mode 100644 packages/ts-common/src/resolvePageContext.ts delete mode 100644 packages/ts-common/src/resolveTsSsgContext.ts diff --git a/frontend/components/studioBrand.ts b/frontend/components/studioBrand.ts index ccca7160..67abdcd0 100644 --- a/frontend/components/studioBrand.ts +++ b/frontend/components/studioBrand.ts @@ -1,7 +1,7 @@ import { type LogoConfig, type LogoSize, - resolveTsSsgContext, + resolvePageContext, } from '@purestack/ts-common' import { defineComponent, html, type RefOrValue } from 'regor' @@ -17,7 +17,7 @@ export function defineStudioBrandComponent() { props: ['size'], context: (head) => ({ ...head.props, - config: resolveTsSsgContext(head).site.logo, + config: resolvePageContext(head).site.logo, }), }) } diff --git a/frontend/purestack.studio/guides/extending/regor.mdx b/frontend/purestack.studio/guides/extending/regor.mdx index 1957b37f..8d83ee02 100644 --- a/frontend/purestack.studio/guides/extending/regor.mdx +++ b/frontend/purestack.studio/guides/extending/regor.mdx @@ -17,7 +17,13 @@ highlights: # Regor -Regor is the component framework PureStack is built on. It runs in two places: +Regor +is the component framework PureStack is built on. It runs in two places: @@ -153,7 +159,7 @@ Every page goes through the same four steps: | Where it runs | Your build, once per page | The visitor's browser | | What it produces | Static HTML | A live, interactive interface | | Event handlers, `r-model`, timers | Not kept | Run normally | -| Page data (`tsSsgContext`) | Available | Not available | +| Page data (`pageContext`) | Available | Not available | | Components | All built-in and registered components | The component families you register | ## Regor at build time @@ -185,24 +191,24 @@ A plain attribute passes a string. An attribute that starts with a colon is a Re ### Expressions and page data -Text in double braces is a Regor expression, anywhere in a page. Inside markup, expressions can read `tsSsgContext`, which holds the page and site data that PureStack provides during the build: +Text in double braces is a Regor expression, anywhere in a page. Inside markup, expressions can read `pageContext`, which holds the page and site data that PureStack provides during the build: | Field | Contents | | --- | --- | -| `tsSsgContext.pageInfo.frontmatter` | The page's frontmatter, including any custom fields you add | -| `tsSsgContext.pageInfo.urlPath` | The page's URL, such as `/guides/extending/regor/` | -| `tsSsgContext.pageInfo.relPath` | The source file path inside the content folder | -| `tsSsgContext.site` | The resolved site configuration | -| `tsSsgContext.navigation`, `tsSsgContext.outline` | The page's navigation and heading outline | -| `tsSsgContext.locale`, `tsSsgContext.locales` | The page's language and the site's languages | +| `pageContext.pageInfo.frontmatter` | The page's frontmatter, including any custom fields you add | +| `pageContext.pageInfo.urlPath` | The page's URL, such as `/guides/extending/regor/` | +| `pageContext.pageInfo.relPath` | The source file path inside the content folder | +| `pageContext.site` | The resolved site configuration | +| `pageContext.navigation`, `pageContext.outline` | The page's navigation and heading outline | +| `pageContext.locale`, `pageContext.locales` | The page's language and the site's languages | This page lists three highlights in its frontmatter. The panel below reads them during the build:

From this page's frontmatter

- {{ tsSsgContext.pageInfo.frontmatter.title }} + {{ pageContext.pageInfo.frontmatter.title }}
    -
  • +
  • {{ item }}
@@ -218,9 +224,9 @@ highlights: --- - {{ tsSsgContext.pageInfo.frontmatter.title }} + {{ pageContext.pageInfo.frontmatter.title }}
    -
  • {{ item }}
  • +
  • {{ item }}
``` @@ -294,9 +300,10 @@ export default defineConfig({ > Export the interface that types a component, as ReleaseNote is exported here. The - VS Code extension finds components - through their exported interfaces. Without the export, it can't complete the - component's props or jump from a tag in your markup to the component's source. + VS Code extension + finds components through their exported interfaces. Without the export, it + can't complete the component's props or jump from a tag in your markup to the + component's source. Then use it in any page. Content between the tags fills the ``: @@ -307,7 +314,7 @@ Then use it in any page. Content between the tags fills the ``: ``` -Tag names match registered keys regardless of case, so `` finds `releaseNote`. The kebab-case form `` works too. Components can also read page data. Pass the component head to `resolveTsSsgContext` from `@purestack/ts-common`, as the built-in navigation and page-link components do. +Tag names match registered keys regardless of case, so `` finds `releaseNote`. The kebab-case form `` works too. Components can also read page data. Pass the component head to `resolvePageContext` from `@purestack/ts-common`, as the built-in navigation and page-link components do. ## Regor in the browser @@ -332,8 +339,8 @@ Browser apps do not get the build's component list. Each app registers the compo Register each icon your app shows, including the defaults that components draw themselves, such as the arrow in a select field. The - Icons guide lists those - defaults. + Icons guide lists + those defaults. ### Template syntax diff --git a/packages/ts-common/README.md b/packages/ts-common/README.md index e7a287aa..855951f2 100644 --- a/packages/ts-common/README.md +++ b/packages/ts-common/README.md @@ -5,6 +5,6 @@ scripts. This package defines site configuration, page frontmatter, navigation, logos, templates, and the rendering context so those packages agree on the same shapes. -Import types such as `SiteConfig`, `PageFrontmatter`, and `TsSsgContext` when -building a custom integration. The runtime exports `resolveTsSsgContext` and -`tryResolveTsSsgContext` find the site context in a Regor component. +Import types such as `SiteConfig`, `PageFrontmatter`, and `PageContext` when +building a custom integration. The runtime exports `resolvePageContext` and +`tryResolvePageContext` find the site context in a Regor component. diff --git a/packages/ts-common/src/index.ts b/packages/ts-common/src/index.ts index 14ae61d9..ee661f61 100644 --- a/packages/ts-common/src/index.ts +++ b/packages/ts-common/src/index.ts @@ -39,9 +39,9 @@ export type { PageTranslationInfo, } from './page-template-types' export { - resolveTsSsgContext, - tryResolveTsSsgContext, -} from './resolveTsSsgContext' + resolvePageContext, + tryResolvePageContext, +} from './resolvePageContext' export type { AnalyticsConfig, AuthConfig, @@ -64,6 +64,6 @@ export type { } from './site-config-types' export type { PageOutlineItem, - TsSsgContext, + PageContext, TsSsgNavigation, } from './ts-ssg-context' diff --git a/packages/ts-common/src/resolvePageContext.ts b/packages/ts-common/src/resolvePageContext.ts new file mode 100644 index 00000000..0976103f --- /dev/null +++ b/packages/ts-common/src/resolvePageContext.ts @@ -0,0 +1,37 @@ +import type { PageContext } from './ts-ssg-context' + +type ContextCarrier = { + pageContext?: PageContext +} + +type HeadLike = { + ctx?: unknown[] +} + +function hasPageContext(value: unknown): value is ContextCarrier { + return typeof value === 'object' && value !== null && 'pageContext' in value +} + +function hasContextStack(value: unknown): value is HeadLike { + return typeof value === 'object' && value !== null && 'ctx' in value +} + +export function resolvePageContext(head: unknown): PageContext { + const stack = hasContextStack(head) && Array.isArray(head.ctx) ? head.ctx : [] + for (const ctx of stack) { + if (!hasPageContext(ctx)) continue + if (ctx.pageContext) return ctx.pageContext + } + throw new Error('pageContext is not available in the Regor context stack.') +} + +export function tryResolvePageContext( + head: unknown, +): PageContext | undefined { + const stack = hasContextStack(head) && Array.isArray(head.ctx) ? head.ctx : [] + for (const ctx of stack) { + if (!hasPageContext(ctx)) continue + if (ctx.pageContext) return ctx.pageContext + } + return undefined +} diff --git a/packages/ts-common/src/resolveTsSsgContext.ts b/packages/ts-common/src/resolveTsSsgContext.ts deleted file mode 100644 index e6c5a95a..00000000 --- a/packages/ts-common/src/resolveTsSsgContext.ts +++ /dev/null @@ -1,37 +0,0 @@ -import type { TsSsgContext } from './ts-ssg-context' - -type ContextCarrier = { - tsSsgContext?: TsSsgContext -} - -type HeadLike = { - ctx?: unknown[] -} - -function hasTsSsgContext(value: unknown): value is ContextCarrier { - return typeof value === 'object' && value !== null && 'tsSsgContext' in value -} - -function hasContextStack(value: unknown): value is HeadLike { - return typeof value === 'object' && value !== null && 'ctx' in value -} - -export function resolveTsSsgContext(head: unknown): TsSsgContext { - const stack = hasContextStack(head) && Array.isArray(head.ctx) ? head.ctx : [] - for (const ctx of stack) { - if (!hasTsSsgContext(ctx)) continue - if (ctx.tsSsgContext) return ctx.tsSsgContext - } - throw new Error('tsSsgContext is not available in the Regor context stack.') -} - -export function tryResolveTsSsgContext( - head: unknown, -): TsSsgContext | undefined { - const stack = hasContextStack(head) && Array.isArray(head.ctx) ? head.ctx : [] - for (const ctx of stack) { - if (!hasTsSsgContext(ctx)) continue - if (ctx.tsSsgContext) return ctx.tsSsgContext - } - return undefined -} diff --git a/packages/ts-common/src/ts-ssg-context.ts b/packages/ts-common/src/ts-ssg-context.ts index 537c7fc2..d9c4c242 100644 --- a/packages/ts-common/src/ts-ssg-context.ts +++ b/packages/ts-common/src/ts-ssg-context.ts @@ -21,7 +21,7 @@ export interface TsSsgNavigation { pageLinks?: PageNavigationLinks } -export interface TsSsgContext { +export interface PageContext { site: SiteConfig pageInfo: PageInfo navigation?: TsSsgNavigation diff --git a/packages/ts-components/src/standard/barChart/barChart.test.ts b/packages/ts-components/src/standard/barChart/barChart.test.ts index 3ea785ec..03d06454 100644 --- a/packages/ts-components/src/standard/barChart/barChart.test.ts +++ b/packages/ts-components/src/standard/barChart/barChart.test.ts @@ -17,7 +17,7 @@ describe('BarChart rendering', () => { const app = createApp( { components: defineBarChartComponents(), - tsSsgContext: createTestContext(), + pageContext: createTestContext(), items: values.map((value, index) => ({ label: `Day ${index + 1}`, value, @@ -57,7 +57,7 @@ describe('BarChart rendering', () => { const app = createApp( { components: defineBarChartComponents(), - tsSsgContext: createTestContext(), + pageContext: createTestContext(), items: [ { label: 'Core', value: 42, color: '#18a999' }, { label: 'Edge', value: 28, color: '#f4a261' }, @@ -102,7 +102,7 @@ describe('BarChart rendering', () => { const app = createApp( { components: defineBarChartComponents(), - tsSsgContext: createTestContext(), + pageContext: createTestContext(), items: [{ label: 'Invalid', value: Number.NaN }], }, { @@ -131,7 +131,7 @@ describe('BarChart rendering', () => { const app = createApp( { components: defineBarChartComponents(), - tsSsgContext: createTestContext(), + pageContext: createTestContext(), items: [{ label: 'Core', value: 42 }], }, { diff --git a/packages/ts-components/src/standard/btn/btn.ts b/packages/ts-components/src/standard/btn/btn.ts index dbd58e94..1cde5c35 100644 --- a/packages/ts-components/src/standard/btn/btn.ts +++ b/packages/ts-components/src/standard/btn/btn.ts @@ -1,4 +1,4 @@ -import { type TsSsgContext, tryResolveTsSsgContext } from '@purestack/ts-common' +import { type PageContext, tryResolvePageContext } from '@purestack/ts-common' import type { SemanticTone } from '@purestack/ts-style' import { type ComputedRef, @@ -104,7 +104,7 @@ function defineButtonLinkComponent() { 'iconOnly', 'ariaLabel', ], - context: (head) => resolveBtnLink(head.props, tryResolveTsSsgContext(head)), + context: (head) => resolveBtnLink(head.props, tryResolvePageContext(head)), }) } @@ -132,7 +132,7 @@ function resolveBtn(props: Btn): Btn { function resolveBtnLink( props: BtnLink, - context: TsSsgContext | undefined, + context: PageContext | undefined, ): BtnLink { return { ...props, @@ -176,7 +176,7 @@ function resolveShowEndIcon(props: BtnBase) { return hasIcon && unref(props.iconPosition) === 'end' } -function resolveButtonHref(props: BtnLink, context: TsSsgContext | undefined) { +function resolveButtonHref(props: BtnLink, context: PageContext | undefined) { const value = unref(props.href) const href = typeof value === 'string' ? value.trim() : undefined return href ? (context?.resolvePublicHref(href) ?? href) : undefined diff --git a/packages/ts-components/src/standard/classicLogo/classicLogo.ts b/packages/ts-components/src/standard/classicLogo/classicLogo.ts index 1ff498a6..b05e9443 100644 --- a/packages/ts-components/src/standard/classicLogo/classicLogo.ts +++ b/packages/ts-components/src/standard/classicLogo/classicLogo.ts @@ -1,7 +1,7 @@ import { type ClassicLogoConfig, - type TsSsgContext, - tryResolveTsSsgContext, + type PageContext, + tryResolvePageContext, } from '@purestack/ts-common' import { getCurrentThemePaletteVar, @@ -19,8 +19,16 @@ import { } from 'regor' const logoTemplate = html`