@master/internal-site 0.0.0-stage → 0.1.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.
- package/LICENSE +21 -0
- package/README.md +68 -2
- package/dist/astro.d.mts +3 -0
- package/dist/astro.mjs +510 -0
- package/dist/config.d.mts +69 -0
- package/dist/config.mjs +10 -0
- package/package.json +384 -4
- package/src/astro/Page.astro +12 -0
- package/src/astro/content-pages.ts +75 -0
- package/src/astro/index.ts +124 -0
- package/src/astro/module-id.ts +4 -0
- package/src/astro/propagated-assets.ts +29 -0
- package/src/astro/route-paths.ts +78 -0
- package/src/astro/routes.template.ts +110 -0
- package/src/astro/server-styles.ts +26 -0
- package/src/astro/site-context.ts +27 -0
- package/src/astro/source-url.ts +22 -0
- package/src/astro/svelte-renderer.ts +45 -0
- package/src/astro/svg-markup.ts +23 -0
- package/src/benchmarks/BenchmarkBarRows.astro +34 -0
- package/src/benchmarks/BenchmarkBars.astro +14 -0
- package/src/benchmarks/BenchmarkChart.astro +53 -0
- package/src/benchmarks/BenchmarkChartGroup.astro +24 -0
- package/src/benchmarks/BenchmarkDataTable.astro +24 -0
- package/src/benchmarks/BenchmarkDelta.astro +23 -0
- package/src/benchmarks/BenchmarkFigure.astro +30 -0
- package/src/benchmarks/BenchmarkMetricTable.astro +38 -0
- package/src/benchmarks/BenchmarkMetrics.astro +23 -0
- package/src/benchmarks/BenchmarkSampleSummary.astro +30 -0
- package/src/benchmarks/BenchmarkScrollRegion.svelte +27 -0
- package/src/benchmarks/BenchmarkSource.astro +20 -0
- package/src/benchmarks/BenchmarkStackedBars.astro +54 -0
- package/src/benchmarks/BenchmarkStatus.astro +16 -0
- package/src/benchmarks/types.ts +98 -0
- package/src/benchmarks/utils.ts +42 -0
- package/src/blog/BlogAuthors.astro +25 -0
- package/src/blog/article/BlogArticleContents.svelte +24 -0
- package/src/blog/article/BlogArticleEnd.astro +55 -0
- package/src/blog/article/BlogArticleMasthead.astro +61 -0
- package/src/blog/article/language.ts +29 -0
- package/src/blog/article/neighbors.ts +27 -0
- package/src/blog/article/title-lines.astro +14 -0
- package/src/blog/article/title-parts.ts +9 -0
- package/src/components.d.ts +5 -0
- package/src/config.ts +68 -0
- package/src/css/ButtonPreview.astro +22 -0
- package/src/css/ConfiguredExample.astro +15 -0
- package/src/css/NamespaceUtilityTable.astro +50 -0
- package/src/css/StylesheetExample.astro +15 -0
- package/src/css/ThemeNumberVariableTable.astro +57 -0
- package/src/css/configured-example.ts +53 -0
- package/src/css/foundation-data/elevation/shadow-data.ts +52 -0
- package/src/css/foundation-data/sizing/scale-data.ts +37 -0
- package/src/css/foundation-data/specimen-content.ts +10 -0
- package/src/css/foundation-data/specimens.ts +96 -0
- package/src/css/foundation-data/tokens.ts +32 -0
- package/src/css/generate-preset-css.ts +12 -0
- package/src/css/highlight.ts +34 -0
- package/src/css/manifest-utilities.ts +29 -0
- package/src/css/markdown.ts +279 -0
- package/src/css/preset-css.ts +15 -0
- package/src/css/preset-manifest.ts +3 -0
- package/src/css/stylesheet-example.ts +26 -0
- package/src/css/theme-variables.ts +74 -0
- package/src/css/variable-namespace-sources.ts +20 -0
- package/src/demo/Demo.svelte +55 -0
- package/src/demo/DemoAsset.astro +38 -0
- package/src/demo/DemoAxes.svelte +22 -0
- package/src/demo/DemoBadge.svelte +18 -0
- package/src/demo/DemoCatalog.astro +36 -0
- package/src/demo/DemoComparison.svelte +36 -0
- package/src/demo/DemoConfiguredExample.astro +48 -0
- package/src/demo/DemoContainer.svelte +48 -0
- package/src/demo/DemoControls.svelte +16 -0
- package/src/demo/DemoCopyButton.svelte +50 -0
- package/src/demo/DemoCopyGroup.svelte +15 -0
- package/src/demo/DemoExample.astro +27 -0
- package/src/demo/DemoFeatureSupport.svelte +18 -0
- package/src/demo/DemoGeneratedCSS.svelte +8 -0
- package/src/demo/DemoIndex.astro +23 -0
- package/src/demo/DemoInstallation.astro +17 -0
- package/src/demo/DemoItem.svelte +17 -0
- package/src/demo/DemoLabel.svelte +15 -0
- package/src/demo/DemoLegend.svelte +15 -0
- package/src/demo/DemoMeasure.svelte +28 -0
- package/src/demo/DemoMedia.svelte +43 -0
- package/src/demo/DemoMotion.svelte +41 -0
- package/src/demo/DemoPageViewport.astro +17 -0
- package/src/demo/DemoPalette.astro +29 -0
- package/src/demo/DemoPaletteGroups.svelte +15 -0
- package/src/demo/DemoScrollArea.svelte +15 -0
- package/src/demo/DemoStyleComparison.astro +25 -0
- package/src/demo/DemoSurface.svelte +15 -0
- package/src/demo/DemoSwatch.svelte +19 -0
- package/src/demo/DemoThemeComparison.astro +30 -0
- package/src/demo/DemoTokenTable.astro +34 -0
- package/src/demo/DemoViewTransition.astro +18 -0
- package/src/demo/DemoViewport.svelte +324 -0
- package/src/demo/DemoWaterfall.astro +30 -0
- package/src/demo/FoundationBreakpoint.astro +12 -0
- package/src/demo/ProjectStyleExample.astro +13 -0
- package/src/demo/copy-feedback.ts +10 -0
- package/src/demo/demo-waterfall.ts +17 -0
- package/src/demo/drag-readings.ts +20 -0
- package/src/demo/foundations/FoundationAxes.astro +12 -0
- package/src/demo/foundations/FoundationColorRoles.astro +5 -0
- package/src/demo/foundations/FoundationContainerGrid.astro +24 -0
- package/src/demo/foundations/FoundationDialog.astro +14 -0
- package/src/demo/foundations/FoundationElevation.astro +5 -0
- package/src/demo/foundations/FoundationElevationState.astro +5 -0
- package/src/demo/foundations/FoundationHue.astro +5 -0
- package/src/demo/foundations/FoundationLines.astro +5 -0
- package/src/demo/foundations/FoundationMedia.astro +28 -0
- package/src/demo/foundations/FoundationMotion.astro +5 -0
- package/src/demo/foundations/FoundationPalette.astro +8 -0
- package/src/demo/foundations/FoundationRadius.astro +13 -0
- package/src/demo/foundations/FoundationShapes.astro +12 -0
- package/src/demo/foundations/FoundationShrink.astro +14 -0
- package/src/demo/foundations/FoundationSizing.astro +19 -0
- package/src/demo/foundations/FoundationSpecimen.astro +20 -0
- package/src/demo/foundations/FoundationSurfaces.astro +5 -0
- package/src/demo/foundations/FoundationTextHue.astro +5 -0
- package/src/demo/foundations/FoundationTextRoles.astro +5 -0
- package/src/demo/foundations/FoundationTokens.astro +22 -0
- package/src/demo/foundations/FoundationTokensView.astro +65 -0
- package/src/demo/foundations/FoundationTransition.astro +5 -0
- package/src/demo/foundations/FoundationTypeComparison.astro +12 -0
- package/src/demo/foundations/FoundationTypography.astro +5 -0
- package/src/demo/foundations/Palette.svelte +37 -0
- package/src/demo/foundations/ShadowScaleDemo.astro +22 -0
- package/src/demo/illustration-materials.ts +180 -0
- package/src/demo/maintenance-example.ts +62 -0
- package/src/demo/playback.ts +75 -0
- package/src/demo/project-style-examples.ts +128 -0
- package/src/demo/reference/alignment.ts +42 -0
- package/src/demo/reference/animations.ts +30 -0
- package/src/demo/reference/backgrounds.ts +39 -0
- package/src/demo/reference/border-paint.ts +31 -0
- package/src/demo/reference/clipping.ts +26 -0
- package/src/demo/reference/document.ts +55 -0
- package/src/demo/reference/edges.ts +40 -0
- package/src/demo/reference/effects.ts +27 -0
- package/src/demo/reference/flexbox.ts +33 -0
- package/src/demo/reference/frame.css +118 -0
- package/src/demo/reference/grid.ts +42 -0
- package/src/demo/reference/html.ts +40 -0
- package/src/demo/reference/interaction.ts +42 -0
- package/src/demo/reference/layout-html.ts +10 -0
- package/src/demo/reference/layout.ts +102 -0
- package/src/demo/reference/media.ts +29 -0
- package/src/demo/reference/positioning.ts +90 -0
- package/src/demo/reference/scenes.ts +197 -0
- package/src/demo/reference/scrolling.ts +66 -0
- package/src/demo/reference/shapes.ts +22 -0
- package/src/demo/reference/sizing.ts +43 -0
- package/src/demo/reference/source.ts +8 -0
- package/src/demo/reference/text-effects.ts +37 -0
- package/src/demo/reference/text-flow.ts +41 -0
- package/src/demo/reference/transforms.ts +26 -0
- package/src/demo/reference/transitions.ts +24 -0
- package/src/demo/reference/type-specimens.ts +56 -0
- package/src/demo/reference/types.ts +30 -0
- package/src/demo/reference/typography.ts +32 -0
- package/src/demo/specimens/accent-color.json +50 -0
- package/src/demo/specimens/align-items.json +56 -0
- package/src/demo/specimens/animation-delay.json +55 -0
- package/src/demo/specimens/animation-direction.json +49 -0
- package/src/demo/specimens/animation-fill-mode.json +55 -0
- package/src/demo/specimens/animation-iteration-count.json +55 -0
- package/src/demo/specimens/animation-play-state.json +83 -0
- package/src/demo/specimens/animation-timing-function.json +48 -0
- package/src/demo/specimens/appearance.json +44 -0
- package/src/demo/specimens/aspect-ratio.json +28 -0
- package/src/demo/specimens/backdrop-filter.json +44 -0
- package/src/demo/specimens/background-attachment.json +49 -0
- package/src/demo/specimens/background-image.json +25 -0
- package/src/demo/specimens/background-origin.json +36 -0
- package/src/demo/specimens/background-size.json +29 -0
- package/src/demo/specimens/border-collapse.json +45 -0
- package/src/demo/specimens/border-color.json +35 -0
- package/src/demo/specimens/border-image-repeat.json +50 -0
- package/src/demo/specimens/border-image-slice.json +45 -0
- package/src/demo/specimens/border-radius.json +30 -0
- package/src/demo/specimens/box-decoration-break.json +35 -0
- package/src/demo/specimens/box-shadow.json +33 -0
- package/src/demo/specimens/clear.json +77 -0
- package/src/demo/specimens/clip-path.json +38 -0
- package/src/demo/specimens/content.json +27 -0
- package/src/demo/specimens/counter-set.json +31 -0
- package/src/demo/specimens/fill.json +23 -0
- package/src/demo/specimens/filter.json +23 -0
- package/src/demo/specimens/flex-direction.json +27 -0
- package/src/demo/specimens/flex-grow.json +27 -0
- package/src/demo/specimens/font-style.json +23 -0
- package/src/demo/specimens/font-variant-numeric.json +28 -0
- package/src/demo/specimens/grid-auto-columns.json +29 -0
- package/src/demo/specimens/grid-auto-flow.json +37 -0
- package/src/demo/specimens/grid-template-areas.json +34 -0
- package/src/demo/specimens/grid-template-columns.json +36 -0
- package/src/demo/specimens/isolation.json +25 -0
- package/src/demo/specimens/justify-content.json +36 -0
- package/src/demo/specimens/line-height.json +28 -0
- package/src/demo/specimens/list-style-position.json +36 -0
- package/src/demo/specimens/mask-image.json +54 -0
- package/src/demo/specimens/min-width.json +39 -0
- package/src/demo/specimens/mix-blend-mode.json +43 -0
- package/src/demo/specimens/object-fit.json +27 -0
- package/src/demo/specimens/object-position.json +27 -0
- package/src/demo/specimens/opacity.json +37 -0
- package/src/demo/specimens/order.json +28 -0
- package/src/demo/specimens/overflow-wrap.json +26 -0
- package/src/demo/specimens/overflow.json +53 -0
- package/src/demo/specimens/overscroll-behavior.json +29 -0
- package/src/demo/specimens/padding.json +84 -0
- package/src/demo/specimens/place-content.json +31 -0
- package/src/demo/specimens/pointer-events.json +46 -0
- package/src/demo/specimens/position.json +29 -0
- package/src/demo/specimens/resize.json +32 -0
- package/src/demo/specimens/screen-readers.json +37 -0
- package/src/demo/specimens/scroll-padding.json +29 -0
- package/src/demo/specimens/scroll-snap-stop.json +33 -0
- package/src/demo/specimens/shape-image-threshold.json +37 -0
- package/src/demo/specimens/shape-margin.json +40 -0
- package/src/demo/specimens/shape-outside.json +37 -0
- package/src/demo/specimens/stroke-width.json +27 -0
- package/src/demo/specimens/text-fill-color.json +23 -0
- package/src/demo/specimens/text-stroke-width.json +32 -0
- package/src/demo/specimens/touch-action.json +45 -0
- package/src/demo/specimens/transform-box.json +37 -0
- package/src/demo/specimens/transform-origin.json +56 -0
- package/src/demo/specimens/transform-style.json +55 -0
- package/src/demo/specimens/transform.json +47 -0
- package/src/demo/specimens/transition-delay.json +57 -0
- package/src/demo/specimens/transition-duration.json +60 -0
- package/src/demo/specimens/transition-property.json +60 -0
- package/src/demo/specimens/transition-timing-function.json +65 -0
- package/src/demo/specimens/user-drag.json +28 -0
- package/src/demo/specimens/user-select.json +25 -0
- package/src/demo/specimens/vertical-align.json +28 -0
- package/src/demo/specimens/width.json +56 -0
- package/src/demo/specimens/will-change.json +50 -0
- package/src/demo/specimens/writing-mode.json +26 -0
- package/src/demo/specimens/z-index.json +35 -0
- package/src/demo/style.ts +15 -0
- package/src/demo/tone.ts +4 -0
- package/src/demo/useDemoViewTransition.svelte.ts +71 -0
- package/src/docs-shell/common/i18n.config.d.ts +2 -0
- package/src/docs-shell/common/i18n.config.js +13 -0
- package/src/docs-shell/common/svgo.config.d.ts +2 -0
- package/src/docs-shell/common/svgo.config.js +11 -0
- package/src/docs-shell/components/ArticleHeader.astro +65 -0
- package/src/docs-shell/components/ArticleTOC.astro +18 -0
- package/src/docs-shell/components/Callout.astro +26 -0
- package/src/docs-shell/components/Code.astro +25 -0
- package/src/docs-shell/components/CodeCopyButton.astro +25 -0
- package/src/docs-shell/components/CodeTabBar.astro +40 -0
- package/src/docs-shell/components/CodeTabs.astro +53 -0
- package/src/docs-shell/components/CodeView.astro +23 -0
- package/src/docs-shell/components/Do.astro +5 -0
- package/src/docs-shell/components/DoNot.astro +5 -0
- package/src/docs-shell/components/DocArticle.astro +14 -0
- package/src/docs-shell/components/DocHeader.svelte +93 -0
- package/src/docs-shell/components/DocHeading.astro +28 -0
- package/src/docs-shell/components/DocMain.astro +19 -0
- package/src/docs-shell/components/DocMenuButton.svelte +96 -0
- package/src/docs-shell/components/DocSidebar.svelte +62 -0
- package/src/docs-shell/components/DocVersionSelect.svelte +22 -0
- package/src/docs-shell/components/DocWrapper.astro +11 -0
- package/src/docs-shell/components/DocumentAPIIndex.astro +24 -0
- package/src/docs-shell/components/DocumentChoices.astro +24 -0
- package/src/docs-shell/components/DocumentCodeExample.astro +20 -0
- package/src/docs-shell/components/DocumentCodeExampleView.astro +35 -0
- package/src/docs-shell/components/DocumentCodeTable.astro +19 -0
- package/src/docs-shell/components/DocumentComparison.astro +7 -0
- package/src/docs-shell/components/DocumentCopyButton.svelte +41 -0
- package/src/docs-shell/components/DocumentDeclaration.astro +17 -0
- package/src/docs-shell/components/DocumentDeclarationView.astro +12 -0
- package/src/docs-shell/components/DocumentDisclosure.astro +14 -0
- package/src/docs-shell/components/DocumentFileTree.astro +34 -0
- package/src/docs-shell/components/DocumentFlow.astro +27 -0
- package/src/docs-shell/components/DocumentIdentifier.astro +14 -0
- package/src/docs-shell/components/DocumentIllustration.astro +46 -0
- package/src/docs-shell/components/DocumentKeyList.astro +22 -0
- package/src/docs-shell/components/DocumentNamespaceTable.astro +20 -0
- package/src/docs-shell/components/DocumentOptionEntry.astro +15 -0
- package/src/docs-shell/components/DocumentOptionList.astro +11 -0
- package/src/docs-shell/components/DocumentOptions.astro +23 -0
- package/src/docs-shell/components/DocumentParameters.astro +30 -0
- package/src/docs-shell/components/DocumentPrompt.astro +16 -0
- package/src/docs-shell/components/DocumentValueList.astro +25 -0
- package/src/docs-shell/components/DocumentationIndex.svelte +144 -0
- package/src/docs-shell/components/Dropped.astro +21 -0
- package/src/docs-shell/components/ExpandContent.svelte +21 -0
- package/src/docs-shell/components/ExplorerView.astro +37 -0
- package/src/docs-shell/components/FileIcon.astro +123 -0
- package/src/docs-shell/components/Footer.svelte +80 -0
- package/src/docs-shell/components/GeneratedCSS.astro +8 -0
- package/src/docs-shell/components/Header.svelte +121 -0
- package/src/docs-shell/components/HeaderIcon.astro +14 -0
- package/src/docs-shell/components/HeaderNav.svelte +20 -0
- package/src/docs-shell/components/Image.svelte +56 -0
- package/src/docs-shell/components/Info.astro +5 -0
- package/src/docs-shell/components/InlineCode.astro +30 -0
- package/src/docs-shell/components/InteractingIndicator.astro +19 -0
- package/src/docs-shell/components/LanguageButton.svelte +18 -0
- package/src/docs-shell/components/LanguageSelect.svelte +44 -0
- package/src/docs-shell/components/Link.svelte +127 -0
- package/src/docs-shell/components/ModeImg.astro +11 -0
- package/src/docs-shell/components/NotFound.astro +21 -0
- package/src/docs-shell/components/OverviewButtons.astro +36 -0
- package/src/docs-shell/components/PMAction.astro +25 -0
- package/src/docs-shell/components/PackageBadges.astro +39 -0
- package/src/docs-shell/components/PageContent.svelte +38 -0
- package/src/docs-shell/components/PageContentBootstrap.astro +13 -0
- package/src/docs-shell/components/PageContentDisclosure.astro +25 -0
- package/src/docs-shell/components/PageContentList.svelte +70 -0
- package/src/docs-shell/components/PageContentProvider.svelte +15 -0
- package/src/docs-shell/components/PageContentTitle.svelte +16 -0
- package/src/docs-shell/components/PageNavs.astro +40 -0
- package/src/docs-shell/components/PreparedCodeView.astro +12 -0
- package/src/docs-shell/components/RenderNode.astro +16 -0
- package/src/docs-shell/components/RouteLayers.astro +17 -0
- package/src/docs-shell/components/SearchButton.svelte +31 -0
- package/src/docs-shell/components/SearchDialog.svelte +174 -0
- package/src/docs-shell/components/Segments.svelte +62 -0
- package/src/docs-shell/components/Step.astro +13 -0
- package/src/docs-shell/components/StepL.astro +10 -0
- package/src/docs-shell/components/StepR.astro +10 -0
- package/src/docs-shell/components/StepSection.astro +12 -0
- package/src/docs-shell/components/Tab.astro +8 -0
- package/src/docs-shell/components/Tabs.astro +10 -0
- package/src/docs-shell/components/ThemeIcon.astro +19 -0
- package/src/docs-shell/components/ThemeSelect.svelte +20 -0
- package/src/docs-shell/components/TimeAgo.svelte +32 -0
- package/src/docs-shell/components/Translate.astro +14 -0
- package/src/docs-shell/components/Warn.astro +5 -0
- package/src/docs-shell/components/code-props.ts +28 -0
- package/src/docs-shell/components/document-types.ts +119 -0
- package/src/docs-shell/components/markdown/Anchor.astro +5 -0
- package/src/docs-shell/components/markdown/Heading2.astro +5 -0
- package/src/docs-shell/components/markdown/Heading3.astro +5 -0
- package/src/docs-shell/components/markdown/Table.astro +6 -0
- package/src/docs-shell/components/markdown-components.ts +36 -0
- package/src/docs-shell/components/page-content-bootstrap.ts +115 -0
- package/src/docs-shell/components/page-content.svelte.ts +125 -0
- package/src/docs-shell/contexts/search.ts +18 -0
- package/src/docs-shell/contexts/theme-mode.svelte.ts +61 -0
- package/src/docs-shell/data/authors.ts +17 -0
- package/src/docs-shell/data/base-colors.ts +29 -0
- package/src/docs-shell/data/brands.ts +79 -0
- package/src/docs-shell/data/color-names.ts +1 -0
- package/src/docs-shell/data/color-palette.ts +50 -0
- package/src/docs-shell/data/colors.ts +1 -0
- package/src/docs-shell/factories/Page.astro +35 -0
- package/src/docs-shell/factories/create-page.ts +31 -0
- package/src/docs-shell/layouts/BlogArticle.astro +53 -0
- package/src/docs-shell/layouts/Doc.astro +41 -0
- package/src/docs-shell/remark/markdown-components.d.ts +2 -0
- package/src/docs-shell/remark/markdown-components.js +101 -0
- package/src/docs-shell/remark/slug-and-toc.d.ts +2 -0
- package/src/docs-shell/remark/slug-and-toc.js +53 -0
- package/src/docs-shell/scripts/code-tabs-bootstrap.ts +34 -0
- package/src/docs-shell/scripts/code.ts +124 -0
- package/src/docs-shell/scripts/document-anchor.ts +57 -0
- package/src/docs-shell/scripts/document.ts +47 -0
- package/src/docs-shell/site.ts +67 -0
- package/src/docs-shell/types/IllustrationImages.ts +2 -0
- package/src/docs-shell/types/Metadata.ts +17 -0
- package/src/docs-shell/types/Props.ts +9 -0
- package/src/docs-shell/types/StaticImage.ts +6 -0
- package/src/docs-shell/uses/use-selected-preview-syntax.svelte.ts +16 -0
- package/src/docs-shell/utils/anchor.ts +24 -0
- package/src/docs-shell/utils/beautify-css.ts +14 -0
- package/src/docs-shell/utils/beautify-html.ts +12 -0
- package/src/docs-shell/utils/beautify-js.ts +9 -0
- package/src/docs-shell/utils/create-highlighter.ts +50 -0
- package/src/docs-shell/utils/css-modern-grammar.ts +339 -0
- package/src/docs-shell/utils/documentation-search.ts +68 -0
- package/src/docs-shell/utils/generate-metadata.ts +60 -0
- package/src/docs-shell/utils/group-page-content.ts +10 -0
- package/src/docs-shell/utils/head.ts +72 -0
- package/src/docs-shell/utils/highlight-code-core.ts +146 -0
- package/src/docs-shell/utils/highlight-code.ts +1 -0
- package/src/docs-shell/utils/highlighted-code-text.ts +27 -0
- package/src/docs-shell/utils/i18n-pathname.ts +98 -0
- package/src/docs-shell/utils/i18n.ts +12 -0
- package/src/docs-shell/utils/is-date-within-seven-days.ts +16 -0
- package/src/docs-shell/utils/isBrowser.ts +1 -0
- package/src/docs-shell/utils/isInteractOutside.ts +16 -0
- package/src/docs-shell/utils/markdown-tree.ts +22 -0
- package/src/docs-shell/utils/metadata.ts +25 -0
- package/src/docs-shell/utils/prepared-code.ts +21 -0
- package/src/docs-shell/utils/resolve-heading.d.ts +1 -0
- package/src/docs-shell/utils/resolve-heading.js +19 -0
- package/src/docs-shell/utils/search-pages.ts +271 -0
- package/src/docs-shell/utils/slot-text.ts +15 -0
- package/src/docs-shell/utils/snackbar.ts +39 -0
- package/src/docs-shell/utils/syntax-theme.ts +53 -0
- package/src/docs-shell/utils/transformer-notation-word-mark.ts +146 -0
- package/src/docs-shell/utils/unique-id.ts +11 -0
- package/src/examples/article-transitions/page.astro +7 -0
- package/src/examples/article-transitions/transitions.css +10 -0
- package/src/examples/components/ArticleTransitionScene.svelte +83 -0
- package/src/examples/components/ViewTransitionScene.svelte +31 -0
- package/src/examples/images/article-aurora.jpg +0 -0
- package/src/examples/images/article-coast.jpg +0 -0
- package/src/examples/images/article-grid.jpg +0 -0
- package/src/examples/images/article-studio.jpg +0 -0
- package/src/examples/layout-system/page.astro +59 -0
- package/src/examples/scene.css +3 -0
- package/src/examples/view-transitions/page.astro +7 -0
- package/src/examples/view-transitions/transitions.css +9 -0
- package/src/home/HeroCanvas.svelte +617 -0
- package/src/home/HomeAction.astro +17 -0
- package/src/home/HomeBentoFrame.astro +9 -0
- package/src/home/HomeBentoGrid.astro +9 -0
- package/src/home/HomeCompactIcon.astro +15 -0
- package/src/home/HomeFooter.svelte +63 -0
- package/src/home/HomeIllustration.astro +17 -0
- package/src/home/HomeIllustrationArt.svelte +15 -0
- package/src/home/HomeLamp.svelte +18 -0
- package/src/home/design.css +532 -0
- package/src/home/footer.css +225 -0
- package/src/home/hero-shaders.ts +460 -0
- package/src/home/hero-title-mask.ts +175 -0
- package/src/home/hero.css +547 -0
- package/src/home/home-illustration.ts +5 -0
- package/src/home/home-lamp.ts +225 -0
- package/src/home/home.css +1081 -0
- package/src/home/icons/agent-check-preview-apply.svg +24 -0
- package/src/home/icons/agent-clients.svg +26 -0
- package/src/home/icons/agent-project-tools.svg +23 -0
- package/src/home/icons/artwork/agent-check-preview-apply-dark.webp +0 -0
- package/src/home/icons/artwork/agent-check-preview-apply-light.webp +0 -0
- package/src/home/icons/artwork/agent-clients-dark.webp +0 -0
- package/src/home/icons/artwork/agent-clients-light.webp +0 -0
- package/src/home/icons/artwork/agent-edit-file-dark.webp +0 -0
- package/src/home/icons/artwork/agent-edit-file-light.webp +0 -0
- package/src/home/icons/artwork/agent-project-tools-dark.webp +0 -0
- package/src/home/icons/artwork/agent-project-tools-light.webp +0 -0
- package/src/home/icons/artwork/design-cascade-layers-dark.webp +0 -0
- package/src/home/icons/artwork/design-cascade-layers-light.webp +0 -0
- package/src/home/icons/artwork/design-layout-motion-dark.webp +0 -0
- package/src/home/icons/artwork/design-layout-motion-light.webp +0 -0
- package/src/home/icons/artwork/design-p3-gamut-dark.webp +0 -0
- package/src/home/icons/artwork/design-p3-gamut-light.webp +0 -0
- package/src/home/icons/artwork/design-theme-modes-dark.webp +0 -0
- package/src/home/icons/artwork/design-theme-modes-light.webp +0 -0
- package/src/home/icons/artwork/design-theme-tokens-dark.webp +0 -0
- package/src/home/icons/artwork/design-theme-tokens-light.webp +0 -0
- package/src/home/icons/artwork/editor-color-tools-dark.webp +0 -0
- package/src/home/icons/artwork/editor-color-tools-light.webp +0 -0
- package/src/home/icons/artwork/editor-focused-highlighting-dark.webp +0 -0
- package/src/home/icons/artwork/editor-focused-highlighting-light.webp +0 -0
- package/src/home/icons/artwork/editor-hover-inspection-dark.webp +0 -0
- package/src/home/icons/artwork/editor-hover-inspection-light.webp +0 -0
- package/src/home/icons/artwork/editor-manifest-completions-dark.webp +0 -0
- package/src/home/icons/artwork/editor-manifest-completions-light.webp +0 -0
- package/src/home/icons/artwork/lint-class-order-dark.webp +0 -0
- package/src/home/icons/artwork/lint-class-order-light.webp +0 -0
- package/src/home/icons/artwork/lint-conflicting-classes-dark.webp +0 -0
- package/src/home/icons/artwork/lint-conflicting-classes-light.webp +0 -0
- package/src/home/icons/artwork/lint-fix-previews-dark.webp +0 -0
- package/src/home/icons/artwork/lint-fix-previews-light.webp +0 -0
- package/src/home/icons/artwork/lint-invalid-classes-dark.webp +0 -0
- package/src/home/icons/artwork/lint-invalid-classes-light.webp +0 -0
- package/src/home/icons/artwork/lint-strict-vocabulary-dark.webp +0 -0
- package/src/home/icons/artwork/lint-strict-vocabulary-light.webp +0 -0
- package/src/home/icons/artwork/lint-theme-tokens-dark.webp +0 -0
- package/src/home/icons/artwork/lint-theme-tokens-light.webp +0 -0
- package/src/home/icons/artwork/mcp-apply-preview-dark.webp +0 -0
- package/src/home/icons/artwork/mcp-apply-preview-light.webp +0 -0
- package/src/home/icons/artwork/mcp-css-compare-dark.webp +0 -0
- package/src/home/icons/artwork/mcp-css-compare-light.webp +0 -0
- package/src/home/icons/artwork/mcp-inspect-class-dark.webp +0 -0
- package/src/home/icons/artwork/mcp-inspect-class-light.webp +0 -0
- package/src/home/icons/artwork/mcp-lint-project-dark.webp +0 -0
- package/src/home/icons/artwork/mcp-lint-project-light.webp +0 -0
- package/src/home/icons/artwork/mcp-manifest-query-dark.webp +0 -0
- package/src/home/icons/artwork/mcp-manifest-query-light.webp +0 -0
- package/src/home/icons/artwork/mcp-preview-fixes-dark.webp +0 -0
- package/src/home/icons/artwork/mcp-preview-fixes-light.webp +0 -0
- package/src/home/icons/artwork/mcp-render-css-dark.webp +0 -0
- package/src/home/icons/artwork/mcp-render-css-light.webp +0 -0
- package/src/home/icons/artwork/mcp-scan-project-dark.webp +0 -0
- package/src/home/icons/artwork/mcp-scan-project-light.webp +0 -0
- package/src/home/icons/artwork/mcp-trace-class-dark.webp +0 -0
- package/src/home/icons/artwork/mcp-trace-class-light.webp +0 -0
- package/src/home/icons/artwork/render-progressive-dark.webp +0 -0
- package/src/home/icons/artwork/render-progressive-light.webp +0 -0
- package/src/home/icons/artwork/render-runtime-dark.webp +0 -0
- package/src/home/icons/artwork/render-runtime-light.webp +0 -0
- package/src/home/icons/artwork/render-static-dark.webp +0 -0
- package/src/home/icons/artwork/render-static-light.webp +0 -0
- package/src/home/icons/artwork/section-ai-agents-dark.webp +0 -0
- package/src/home/icons/artwork/section-ai-agents-light.webp +0 -0
- package/src/home/icons/artwork/section-css-size-dark.webp +0 -0
- package/src/home/icons/artwork/section-css-size-light.webp +0 -0
- package/src/home/icons/artwork/section-design-system-dark.webp +0 -0
- package/src/home/icons/artwork/section-design-system-light.webp +0 -0
- package/src/home/icons/artwork/section-editor-dark.webp +0 -0
- package/src/home/icons/artwork/section-editor-light.webp +0 -0
- package/src/home/icons/artwork/section-lint-dark.webp +0 -0
- package/src/home/icons/artwork/section-lint-light.webp +0 -0
- package/src/home/icons/artwork/section-rendering-dark.webp +0 -0
- package/src/home/icons/artwork/section-rendering-light.webp +0 -0
- package/src/home/icons/artwork/section-workflow-dark.webp +0 -0
- package/src/home/icons/artwork/section-workflow-light.webp +0 -0
- package/src/home/icons/artwork/source.json +303 -0
- package/src/home/icons/artwork/workflow-integrations-dark.webp +0 -0
- package/src/home/icons/artwork/workflow-integrations-light.webp +0 -0
- package/src/home/icons/artwork/workflow-monorepo-dark.webp +0 -0
- package/src/home/icons/artwork/workflow-monorepo-light.webp +0 -0
- package/src/home/icons/artwork/workflow-route-styles-dark.webp +0 -0
- package/src/home/icons/artwork/workflow-route-styles-light.webp +0 -0
- package/src/home/icons/artwork/workflow-trace-change-dark.webp +0 -0
- package/src/home/icons/artwork/workflow-trace-change-light.webp +0 -0
- package/src/home/icons/artwork.css +4 -0
- package/src/home/icons/artwork.ts +131 -0
- package/src/home/icons/catalog.ts +381 -0
- package/src/home/icons/design-cascade-layers.svg +32 -0
- package/src/home/icons/design-layout-motion.svg +16 -0
- package/src/home/icons/design-p3-gamut.svg +12 -0
- package/src/home/icons/design-theme-modes.svg +12 -0
- package/src/home/icons/design-theme-tokens.svg +20 -0
- package/src/home/icons/editor-color-tools.svg +18 -0
- package/src/home/icons/editor-focused-highlighting.svg +15 -0
- package/src/home/icons/editor-hover-inspection.svg +19 -0
- package/src/home/icons/editor-manifest-completions.svg +24 -0
- package/src/home/icons/lint-class-order-compact.svg +15 -0
- package/src/home/icons/lint-class-order.svg +28 -0
- package/src/home/icons/lint-conflicting-classes-compact.svg +11 -0
- package/src/home/icons/lint-conflicting-classes.svg +24 -0
- package/src/home/icons/lint-fix-previews-compact.svg +9 -0
- package/src/home/icons/lint-fix-previews.svg +19 -0
- package/src/home/icons/lint-invalid-classes-compact.svg +7 -0
- package/src/home/icons/lint-invalid-classes.svg +17 -0
- package/src/home/icons/lint-strict-vocabulary-compact.svg +8 -0
- package/src/home/icons/lint-strict-vocabulary.svg +16 -0
- package/src/home/icons/lint-theme-tokens-compact.svg +7 -0
- package/src/home/icons/lint-theme-tokens.svg +14 -0
- package/src/home/icons/mcp-apply-preview-compact.svg +9 -0
- package/src/home/icons/mcp-apply-preview.svg +18 -0
- package/src/home/icons/mcp-css-compare-compact.svg +9 -0
- package/src/home/icons/mcp-css-compare.svg +20 -0
- package/src/home/icons/mcp-inspect-class-compact.svg +9 -0
- package/src/home/icons/mcp-inspect-class.svg +18 -0
- package/src/home/icons/mcp-lint-project-compact.svg +14 -0
- package/src/home/icons/mcp-lint-project.svg +30 -0
- package/src/home/icons/mcp-manifest-query-compact.svg +14 -0
- package/src/home/icons/mcp-manifest-query.svg +27 -0
- package/src/home/icons/mcp-preview-fixes-compact.svg +9 -0
- package/src/home/icons/mcp-preview-fixes.svg +15 -0
- package/src/home/icons/mcp-render-css-compact.svg +13 -0
- package/src/home/icons/mcp-render-css.svg +30 -0
- package/src/home/icons/mcp-scan-project-compact.svg +7 -0
- package/src/home/icons/mcp-scan-project.svg +13 -0
- package/src/home/icons/mcp-trace-class-compact.svg +11 -0
- package/src/home/icons/mcp-trace-class.svg +24 -0
- package/src/home/icons/render-progressive.svg +17 -0
- package/src/home/icons/render-runtime.svg +23 -0
- package/src/home/icons/render-static.svg +29 -0
- package/src/home/icons/section-ai-agents.svg +24 -0
- package/src/home/icons/section-css-size.svg +13 -0
- package/src/home/icons/section-design-system.svg +24 -0
- package/src/home/icons/section-editor.svg +14 -0
- package/src/home/icons/section-lint.svg +14 -0
- package/src/home/icons/section-rendering.svg +30 -0
- package/src/home/icons/section-workflow.svg +22 -0
- package/src/home/icons/workflow-integrations.svg +15 -0
- package/src/home/icons/workflow-monorepo.svg +27 -0
- package/src/home/icons/workflow-route-styles.svg +24 -0
- package/src/home/icons/workflow-trace-change.svg +21 -0
- package/src/layouts/Document.astro +71 -0
- package/src/public/brand/v2/logo/mark/master-mark-small-on-dark.svg +1 -0
- package/src/public/brand/v2/logo/master-css/master-css-horizontal-on-dark.svg +1 -0
- package/src/public/brand/v2/logo/master-css/master-css-horizontal-on-light.svg +1 -0
- package/src/public/demo/border-grid.svg +7 -0
- package/src/public/demo/landscape.svg +1 -0
- package/src/public/demo/marker.svg +1 -0
- package/src/public/demo/mask.svg +1 -0
- package/src/public/fonts/Geist-Medium.ttf +0 -0
- package/src/public/fonts/Geist-Regular.ttf +0 -0
- package/src/public/fonts/GeistVariable.woff2 +0 -0
- package/src/public/fonts/IBMPlexMono-Bold.woff2 +0 -0
- package/src/public/fonts/IBMPlexMono-Medium.woff2 +0 -0
- package/src/public/fonts/IBMPlexMono-Regular.woff2 +0 -0
- package/src/public/fonts/IBMPlexMono-SemiBold.woff2 +0 -0
- package/src/public/fonts/index.css +40 -0
- package/src/public/icons/csharp.svg +1 -0
- package/src/public/icons/css.svg +1 -0
- package/src/public/icons/eslint.svg +1 -0
- package/src/public/icons/folder.svg +12 -0
- package/src/public/icons/html.svg +1 -0
- package/src/public/icons/php.svg +1 -0
- package/src/public/icons/sass.svg +1 -0
- package/src/public/icons/storybook.svg +1 -0
- package/src/public/icons/visualstudiocode.svg +41 -0
- package/src/public/images/authors/aron.jpg +0 -0
- package/src/public/images/authors/benseage.jpg +0 -0
- package/src/public/images/authors/joy.jpg +0 -0
- package/src/public/images/authors/lola.jpg +0 -0
- package/src/public/images/authors/miles.jpg +0 -0
- package/src/public/images/bootstrap.svg +23 -0
- package/src/public/images/build-tools/rsbuild.svg +1 -0
- package/src/public/images/build-tools/rspack.svg +1 -0
- package/src/public/images/build-tools/vite.svg +15 -0
- package/src/public/images/build-tools/webpack.svg +10 -0
- package/src/public/images/cdns/esm-sh.svg +1 -0
- package/src/public/images/chevron-left.svg +4 -0
- package/src/public/images/cover-bg.jpg +0 -0
- package/src/public/images/emotion.svg +1 -0
- package/src/public/images/frameworks/angular.svg +29 -0
- package/src/public/images/frameworks/astro.svg +4 -0
- package/src/public/images/frameworks/blazor.svg +22 -0
- package/src/public/images/frameworks/express.svg +1 -0
- package/src/public/images/frameworks/laravel.svg +8 -0
- package/src/public/images/frameworks/line-liff.svg +1 -0
- package/src/public/images/frameworks/lit.svg +1 -0
- package/src/public/images/frameworks/nextjs.svg +16 -0
- package/src/public/images/frameworks/nuxtjs.svg +3 -0
- package/src/public/images/frameworks/rails.svg +1 -0
- package/src/public/images/frameworks/react.svg +8 -0
- package/src/public/images/frameworks/remix.svg +5 -0
- package/src/public/images/frameworks/shopify.svg +1 -0
- package/src/public/images/frameworks/svelte.svg +6 -0
- package/src/public/images/frameworks/tanstack.svg +1 -0
- package/src/public/images/frameworks/vuejs.svg +11 -0
- package/src/public/images/frameworks/wordpress.svg +1 -0
- package/src/public/images/mui.svg +1 -0
- package/src/public/images/styled-components.svg +4 -0
- package/src/public/images/tailwindcss.svg +1 -0
- package/src/scripts/bundler-imports.ts +25 -0
- package/src/scripts/static-social.ts +333 -0
- package/src/scripts/write-if-changed.ts +26 -0
- package/src/sections/blog.astro +11 -0
- package/src/sections/design-system.astro +14 -0
- package/src/sections/document.astro +8 -0
- package/src/sections/examples.astro +6 -0
- package/src/sections/guide.astro +26 -0
- package/src/sections/home.astro +7 -0
- package/src/sections/page.astro +12 -0
- package/src/styles/base.css +57 -0
- package/src/styles/benchmarks.css +20 -0
- package/src/styles/blog-article.css +670 -0
- package/src/styles/blog-materials.css +399 -0
- package/src/styles/blog.css +568 -0
- package/src/styles/demo.css +30 -0
- package/src/styles/design-system.css +15 -0
- package/src/styles/docs-shell/code.css +61 -0
- package/src/styles/docs-shell/docs.css +79 -0
- package/src/styles/docs-shell/documentation-search.css +42 -0
- package/src/styles/docs-shell/footer.css +38 -0
- package/src/styles/docs-shell/header.css +73 -0
- package/src/styles/docs-shell/materials.css +25 -0
- package/src/styles/docs-shell/menu.css +19 -0
- package/src/styles/docs-shell/not-found.css +10 -0
- package/src/styles/docs-shell/page-content.css +37 -0
- package/src/styles/docs-shell/prose.css +89 -0
- package/src/styles/docs-shell/segments.css +13 -0
- package/src/styles/docs-shell/steps.css +39 -0
- package/src/styles/docs-shell/syntax-theme.css +18 -0
- package/src/styles/docs-shell/theme.css +68 -0
- package/src/styles/docs-shell/wrapper.css +10 -0
- package/src/styles/document-comparison.css +7 -0
- package/src/styles/documentation-illustration.css +34 -0
- package/src/styles/documentation-index.css +100 -0
- package/src/styles/documents.css +4 -0
- package/src/styles/documents.ts +2 -0
- package/src/styles/foundation.css +4 -0
- package/src/styles/globals.css +2 -0
- package/src/styles/interface.css +3 -0
- package/src/styles/interface.ts +2 -0
- package/src/styles/site.ts +2 -0
- package/src/styles/system/DESIGN.md +108 -0
- package/src/styles/system/buttons.css +51 -0
- package/src/styles/system/code.css +85 -0
- package/src/styles/system/controls.css +110 -0
- package/src/styles/system/data.css +134 -0
- package/src/styles/system/mixins.css +7 -0
- package/src/styles/system/prose.css +75 -0
- package/src/styles/system/shell.css +102 -0
- package/src/styles/system/specimens.css +98 -0
- package/src/styles/system/surfaces.css +104 -0
- package/src/styles/system/tokens.css +136 -0
- package/src/utils/cloudflare-image-loader.js +85 -0
- package/src/virtual.d.ts +36 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Astro scopes stylesheets of modules imported with `?astroPropagatedAssets` to
|
|
3
|
+
* the render that uses them, as it does for content collection entries. Every
|
|
4
|
+
* page of the `[...path]` route would otherwise receive the CSS of all content.
|
|
5
|
+
* Keep this private Astro contract here: import modules only through `getMod()`.
|
|
6
|
+
*/
|
|
7
|
+
export interface PropagatedModule<T> {
|
|
8
|
+
getMod(): Promise<T>
|
|
9
|
+
collectedLinks: string[]
|
|
10
|
+
/** Built CSS text, or dev-time `{ id, content }` records. */
|
|
11
|
+
collectedStyles: (string | { id: string, content: string })[]
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface PageAssets {
|
|
15
|
+
links: string[]
|
|
16
|
+
styles: string[]
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const propagatedAssetsQuery = '?astroPropagatedAssets'
|
|
20
|
+
|
|
21
|
+
export function mergeAssets(...modules: PropagatedModule<unknown>[]): PageAssets {
|
|
22
|
+
const links = new Set<string>()
|
|
23
|
+
const styles = new Set<string>()
|
|
24
|
+
for (const module of modules) {
|
|
25
|
+
module.collectedLinks.forEach((link) => links.add(link))
|
|
26
|
+
module.collectedStyles.forEach((style) => styles.add(typeof style === 'string' ? style : style.content))
|
|
27
|
+
}
|
|
28
|
+
return { links: [...links], styles: [...styles] }
|
|
29
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type { PageParams } from '../docs-shell/types/Props'
|
|
2
|
+
|
|
3
|
+
export type Section = string
|
|
4
|
+
export interface RouteOptions {
|
|
5
|
+
contentRoot?: string
|
|
6
|
+
defaultLocale?: string
|
|
7
|
+
locales?: readonly string[]
|
|
8
|
+
sectionLocales?: Record<string, readonly string[]>
|
|
9
|
+
availableLocales?: Record<string, readonly string[]>
|
|
10
|
+
}
|
|
11
|
+
export type RouteParams = Record<string, string | string[]>
|
|
12
|
+
export interface RouteProps {
|
|
13
|
+
file: string
|
|
14
|
+
locale: PageParams['locale']
|
|
15
|
+
params: RouteParams
|
|
16
|
+
}
|
|
17
|
+
export interface ParamsModule {
|
|
18
|
+
generateStaticParams(): RouteParams[] | Promise<RouteParams[]>
|
|
19
|
+
}
|
|
20
|
+
type Segment = { kind: 'static', value: string } | { kind: 'param' | 'rest', name: string }
|
|
21
|
+
|
|
22
|
+
export function directoriesOf(file: string, contentRoot = '/content/') {
|
|
23
|
+
return file.slice(contentRoot.length).split('/').slice(0, -1)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function segmentsOf(file: string, contentRoot = '/content/'): Segment[] {
|
|
27
|
+
if (directoriesOf(file, contentRoot).at(-1) === 'index') throw new Error(`${file}: \`index\` is not a valid route segment`)
|
|
28
|
+
return directoriesOf(file, contentRoot)
|
|
29
|
+
.filter(directory => !/^\(.+\)$/.test(directory))
|
|
30
|
+
.map(directory => {
|
|
31
|
+
const rest = directory.match(/^\[\.\.\.(\w+)\]$/)
|
|
32
|
+
if (rest) return { kind: 'rest', name: rest[1] }
|
|
33
|
+
const param = directory.match(/^\[(\w+)\]$/)
|
|
34
|
+
if (param) return { kind: 'param', name: param[1] }
|
|
35
|
+
return { kind: 'static', value: directory }
|
|
36
|
+
})
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function sectionOf(file: string, contentRoot = '/content/'): Section {
|
|
40
|
+
const first = segmentsOf(file, contentRoot)[0]
|
|
41
|
+
return first?.kind === 'static' ? first.value as Section : 'home'
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function localesOf(section: Section, options: RouteOptions = {}): readonly string[] {
|
|
45
|
+
return options.sectionLocales?.[section] ?? options.locales ?? ['en']
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export function localizePathname(pathname: string, locale: string, defaultLocale = 'en') {
|
|
49
|
+
return locale === defaultLocale ? pathname : `/${locale}${pathname === '/' ? '' : pathname}`
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function pathnameOf(segments: Segment[], params: RouteParams) {
|
|
53
|
+
return '/' + segments.map(segment => {
|
|
54
|
+
if (segment.kind === 'static') return segment.value
|
|
55
|
+
const value = params[segment.name]
|
|
56
|
+
if (value === undefined) throw new Error(`Missing route parameter ${segment.name}`)
|
|
57
|
+
return Array.isArray(value) ? value.join('/') : value
|
|
58
|
+
}).join('/')
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/** Enumerate filenames and lightweight params providers without evaluating page modules. */
|
|
62
|
+
export async function createStaticPaths(files: string[], providers: Record<string, () => Promise<ParamsModule>>, options: RouteOptions = {}) {
|
|
63
|
+
const paths: { params: { path: string | undefined }, props: RouteProps }[] = []
|
|
64
|
+
for (const file of [...files].sort()) {
|
|
65
|
+
const segments = segmentsOf(file, options.contentRoot)
|
|
66
|
+
const dynamic = segments.some(segment => segment.kind !== 'static')
|
|
67
|
+
const providerFile = file.replace(/page\.astro$/, 'params.ts')
|
|
68
|
+
if (dynamic && !providers[providerFile]) throw new Error(`${file}: dynamic routes require a sibling params.ts`)
|
|
69
|
+
const paramSets = dynamic ? await (await providers[providerFile]()).generateStaticParams() : [{}]
|
|
70
|
+
for (const params of paramSets) {
|
|
71
|
+
for (const locale of options.availableLocales?.[file] ?? localesOf(sectionOf(file, options.contentRoot), options)) {
|
|
72
|
+
const pathname = localizePathname(pathnameOf(segments, params), locale, options.defaultLocale)
|
|
73
|
+
paths.push({ params: { path: pathname.slice(1) || undefined }, props: { file, locale: locale as RouteProps['locale'], params } })
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return paths
|
|
78
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import type { AstroComponentFactory } from 'astro/runtime/server/index.js'
|
|
2
|
+
import { mergeAssets, type PageAssets, type PropagatedModule } from '@master/internal-site/astro/propagated-assets'
|
|
3
|
+
import { createStaticPaths, directoriesOf, localesOf, sectionOf, type ParamsModule, type RouteProps, type Section } from '@master/internal-site/astro/route-paths'
|
|
4
|
+
import type { Metadata } from '@master/internal-site/types/Metadata'
|
|
5
|
+
import type { Props } from '@master/internal-site/types/Props'
|
|
6
|
+
|
|
7
|
+
export { localizePathname, sectionOf } from '@master/internal-site/astro/route-paths'
|
|
8
|
+
export type { RouteProps, Section } from '@master/internal-site/astro/route-paths'
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Content routes follow `content/<url>/page.astro`. A page component receives {@link Props}
|
|
12
|
+
* and may export `metadata` or `generateMetadata` from its frontmatter. Dynamic routes
|
|
13
|
+
* enumerate params through a lightweight sibling `params.ts`. `layout.astro` modules wrap
|
|
14
|
+
* nested pages through their default slot; `(group)` directories add no URL segment.
|
|
15
|
+
*/
|
|
16
|
+
interface PageModule {
|
|
17
|
+
default?: AstroComponentFactory
|
|
18
|
+
metadata?: Partial<Metadata>
|
|
19
|
+
generateMetadata?: (props: Pick<Props, 'params'>) => Promise<Partial<Metadata>> | Partial<Metadata>
|
|
20
|
+
/** `false` for pages that render no document surfaces, code or prose, such as indexes. */
|
|
21
|
+
documentStyles?: boolean
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
interface LayoutModule {
|
|
25
|
+
default: AstroComponentFactory
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
interface SectionModule {
|
|
29
|
+
default: AstroComponentFactory
|
|
30
|
+
bodyClass?: string
|
|
31
|
+
bare?: boolean
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
type Propagated<T> = () => Promise<PropagatedModule<T>>
|
|
35
|
+
|
|
36
|
+
const contentRoot = '__CONTENT_PREFIX__/'
|
|
37
|
+
const routeOptions = __ROUTE_OPTIONS__
|
|
38
|
+
// Literal globs: see astro/propagated-assets for why modules load through this query.
|
|
39
|
+
const pageModules: Record<string, Propagated<PageModule>> = { ...import.meta.glob<PropagatedModule<PageModule>>('__CONTENT_PREFIX__/**/page.astro', { query: '?astroPropagatedAssets', import: 'default' }), ...__GENERATED_PAGES__ }
|
|
40
|
+
const paramsModules = import.meta.glob<ParamsModule>('__CONTENT_PREFIX__/**/params.ts')
|
|
41
|
+
const layoutModules = import.meta.glob<PropagatedModule<LayoutModule>>('__CONTENT_PREFIX__/**/layout.astro', { query: '?astroPropagatedAssets', import: 'default' })
|
|
42
|
+
const sectionModules = __SECTION_IMPORTS__
|
|
43
|
+
const siteStyles = __SITE_IMPORT__
|
|
44
|
+
const interfaceStyles = __INTERFACE_IMPORT__
|
|
45
|
+
const documentStyles = __DOCUMENTS_IMPORT__
|
|
46
|
+
const sectionShells: Record<Section, string> = __SECTION_SHELLS__
|
|
47
|
+
|
|
48
|
+
async function loadPropagated<T>(modules: Record<string, Propagated<T>>, file: string) {
|
|
49
|
+
const load = modules[file]
|
|
50
|
+
if (!load) throw new Error(`Unknown module ${file}`)
|
|
51
|
+
const propagated = await load()
|
|
52
|
+
return { propagated, module: await propagated.getMod() }
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** Every content page × locale, as Astro `getStaticPaths()` entries. */
|
|
56
|
+
export async function getStaticPaths() {
|
|
57
|
+
return createStaticPaths(Object.keys(pageModules), paramsModules, routeOptions)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface LoadedRoute {
|
|
61
|
+
metadata: Partial<Metadata>
|
|
62
|
+
/** Components from the outermost (the section shell) to the page; each wraps the next in its default slot. */
|
|
63
|
+
layers: AstroComponentFactory[]
|
|
64
|
+
props: Props
|
|
65
|
+
assets: PageAssets
|
|
66
|
+
bodyClass?: string
|
|
67
|
+
bare?: boolean
|
|
68
|
+
locales: readonly string[]
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export async function loadRoute({ file, locale, params }: RouteProps): Promise<LoadedRoute> {
|
|
72
|
+
const page = await loadPropagated(pageModules, file)
|
|
73
|
+
const module = page.module
|
|
74
|
+
if (!module.default) throw new Error(`${file} must export a page component`)
|
|
75
|
+
const props: Props = { params: { ...params, locale } }
|
|
76
|
+
const metadata = (module.generateMetadata ? await module.generateMetadata(props) : module.metadata) ?? {}
|
|
77
|
+
const layers = [module.default]
|
|
78
|
+
const propagated: PropagatedModule<unknown>[] = [page.propagated]
|
|
79
|
+
const directories = directoriesOf(file, contentRoot)
|
|
80
|
+
for (let depth = directories.length; depth > 0; depth--) {
|
|
81
|
+
const layoutFile = `${contentRoot}${directories.slice(0, depth).join('/')}/layout.astro`
|
|
82
|
+
if (!layoutModules[layoutFile]) continue
|
|
83
|
+
const layout = await loadPropagated(layoutModules, layoutFile)
|
|
84
|
+
layers.unshift(layout.module.default)
|
|
85
|
+
propagated.unshift(layout.propagated)
|
|
86
|
+
}
|
|
87
|
+
const route = await withSection(sectionOf(file, contentRoot), metadata, layers, props, propagated, module.documentStyles)
|
|
88
|
+
route.locales = routeOptions.availableLocales[file] ?? route.locales
|
|
89
|
+
return route
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/** Wrap a page in its section shell, e.g. for routes outside `content/` such as 404. */
|
|
93
|
+
export async function withSection(sectionName: Section, metadata: Partial<Metadata>, layers: AstroComponentFactory[], props: Props, propagated: PropagatedModule<unknown>[] = [], documents = true): Promise<LoadedRoute> {
|
|
94
|
+
const section = await loadPropagated(sectionModules, `/sections/${sectionShells[sectionName]}.astro`)
|
|
95
|
+
// Links within one asset boundary are unordered, so the foundation, the shell interface and
|
|
96
|
+
// document styles each form their own boundary, in that order. Bare sections
|
|
97
|
+
// share the configured foundation but omit the interface and document chrome.
|
|
98
|
+
const site = [await siteStyles['/styles/site.ts']()]
|
|
99
|
+
if (!section.module.bare) site.push(await interfaceStyles['/styles/interface.ts']())
|
|
100
|
+
const document = section.module.bare || !documents ? [] : [await documentStyles['/styles/documents.ts']()]
|
|
101
|
+
return {
|
|
102
|
+
metadata,
|
|
103
|
+
layers: [section.module.default, ...layers],
|
|
104
|
+
props,
|
|
105
|
+
assets: mergeAssets(...site, ...document, section.propagated, ...propagated),
|
|
106
|
+
bodyClass: section.module.bodyClass,
|
|
107
|
+
bare: section.module.bare,
|
|
108
|
+
locales: localesOf(sectionName, routeOptions)
|
|
109
|
+
}
|
|
110
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { isCSSRequest, type Plugin } from 'vite'
|
|
2
|
+
import { cleanId } from './module-id'
|
|
3
|
+
|
|
4
|
+
const empty = '\0site-server-style'
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Pages link the stylesheets of every module they render on the server. Hydrated
|
|
8
|
+
* modules repeat those imports in the browser bundle, where Astro would attach
|
|
9
|
+
* them to every page of the route, so the client build omits site stylesheets.
|
|
10
|
+
* Development keeps them for Vite's CSS hot updates.
|
|
11
|
+
*/
|
|
12
|
+
export default function serverStyles(roots: string[]): Plugin {
|
|
13
|
+
return {
|
|
14
|
+
name: 'master-css-site:server-styles',
|
|
15
|
+
enforce: 'pre',
|
|
16
|
+
apply: 'build',
|
|
17
|
+
applyToEnvironment: (environment) => environment.config.consumer === 'client',
|
|
18
|
+
resolveId(source, importer) {
|
|
19
|
+
if (!importer || importer.startsWith('\0') || !roots.some(root => cleanId(importer).startsWith(root.replace(/\/$/, '') + '/')) || isCSSRequest(cleanId(importer))) return
|
|
20
|
+
if (isCSSRequest(source) && !/[?&](?:inline|raw|url)\b/.test(source)) return empty
|
|
21
|
+
},
|
|
22
|
+
load(id) {
|
|
23
|
+
if (id === empty) return 'export default undefined'
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import config from 'virtual:master-site/config'
|
|
2
|
+
import { createSite, type Site, type SiteContextValue } from '../docs-shell/site'
|
|
3
|
+
|
|
4
|
+
export function localeOfPathname(pathname: string): string {
|
|
5
|
+
const segment = pathname.split('/')[1]
|
|
6
|
+
return config.i18n.locales.includes(segment) ? segment : config.i18n.defaultLocale
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function canonicalPathname(pathname: string) {
|
|
10
|
+
const normalized = decodeURI(pathname).replace(/\.html$/, '').replace(/\/index$/, '/').replace(/(.)\/$/, '$1')
|
|
11
|
+
const locale = localeOfPathname(normalized)
|
|
12
|
+
if (locale !== config.i18n.defaultLocale) return normalized
|
|
13
|
+
const prefix = `/${config.i18n.defaultLocale}`
|
|
14
|
+
return normalized === prefix ? '/' : normalized.startsWith(prefix + '/') ? normalized.slice(prefix.length) : normalized || '/'
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/** Fresh context per render: different sites/locales never share mutable page state. */
|
|
18
|
+
export function siteContextOf(url: URL): SiteContextValue {
|
|
19
|
+
const pathname = canonicalPathname(url.pathname)
|
|
20
|
+
const locale = localeOfPathname(pathname)
|
|
21
|
+
const { translations, ...i18n } = config.i18n
|
|
22
|
+
return { locale, pathname, translations: translations[locale] ?? {}, i18n }
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function siteOf(astro: { url: URL }): Site {
|
|
26
|
+
return createSite(siteContextOf(astro.url))
|
|
27
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { pathToFileURL } from 'node:url'
|
|
2
|
+
import type { Plugin } from 'vite'
|
|
3
|
+
import { cleanId } from './module-id'
|
|
4
|
+
|
|
5
|
+
const sourcePattern = /\.(?:[cm]?[jt]sx?|mdx|astro|svelte)$/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Server chunks only run on the machine that builds the static site. Keep each
|
|
9
|
+
* module's source `import.meta.url` so site code and bundled dependencies resolve
|
|
10
|
+
* repository files, data files and native bindings relative to their sources.
|
|
11
|
+
*/
|
|
12
|
+
export default function sourceURL(): Plugin {
|
|
13
|
+
return {
|
|
14
|
+
name: 'master-css-site:source-url',
|
|
15
|
+
applyToEnvironment: (environment) => environment.config.consumer === 'server',
|
|
16
|
+
transform(code, id) {
|
|
17
|
+
const file = cleanId(id)
|
|
18
|
+
if (id.startsWith('\0') || !file.startsWith('/') || !sourcePattern.test(file) || !code.includes('import.meta.url')) return
|
|
19
|
+
return { code: code.replaceAll('import.meta.url', JSON.stringify(pathToFileURL(file).href)), map: null }
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { createRawSnippet } from 'svelte'
|
|
2
|
+
import { render } from 'svelte/server'
|
|
3
|
+
import svelteRenderer from '@astrojs/svelte/server.js'
|
|
4
|
+
import type { AstroComponentMetadata, NamedSSRLoadedRendererValue, SSRResult } from 'astro'
|
|
5
|
+
import { siteContextKey } from '../docs-shell/site'
|
|
6
|
+
import { siteContextOf } from './site-context'
|
|
7
|
+
|
|
8
|
+
type RenderContext = { result: SSRResult }
|
|
9
|
+
|
|
10
|
+
const ids = new WeakMap<SSRResult, number>()
|
|
11
|
+
|
|
12
|
+
function escapeSlotName(name: string) {
|
|
13
|
+
return name.replace(/[&"<>]/g, (character) => `&#${character.charCodeAt(0)};`)
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* `@astrojs/svelte` rendering with the page's site context, so every Svelte root can call
|
|
18
|
+
* `getSite()`. Astro slots arrive as snippets: the default slot as `children`, named slots by name.
|
|
19
|
+
*/
|
|
20
|
+
async function renderToStaticMarkup(this: RenderContext, Component: any, props: Record<string, any>, slotted: Record<string, string>, metadata?: AstroComponentMetadata) {
|
|
21
|
+
const tagName = metadata?.hydrate ? 'astro-slot' : 'astro-static-slot'
|
|
22
|
+
const snippets: Record<string, unknown> = {}
|
|
23
|
+
for (const [key, value] of Object.entries(slotted)) {
|
|
24
|
+
const name = key === 'default' ? '' : ` name="${escapeSlotName(key)}"`
|
|
25
|
+
snippets[key === 'default' ? 'children' : key] = createRawSnippet(() => ({ render: () => `<${tagName}${name}>${value}</${tagName}>` }))
|
|
26
|
+
}
|
|
27
|
+
const index = ids.get(this.result) ?? 0
|
|
28
|
+
ids.set(this.result, index + 1)
|
|
29
|
+
const result = await render(Component, {
|
|
30
|
+
props: { ...props, ...snippets },
|
|
31
|
+
context: new Map([[siteContextKey, siteContextOf(new URL(this.result.request.url))]]),
|
|
32
|
+
idPrefix: `s${index}`
|
|
33
|
+
})
|
|
34
|
+
// Svelte renders nullish class values as empty attributes.
|
|
35
|
+
return { html: result.body.replace(/\s+class=""/g, '') }
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const renderer: NamedSSRLoadedRendererValue = {
|
|
39
|
+
name: '@master/internal-site:svelte',
|
|
40
|
+
check: svelteRenderer.check,
|
|
41
|
+
renderToStaticMarkup,
|
|
42
|
+
supportsAstroStaticSlot: true
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export default renderer
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { readFile } from 'node:fs/promises'
|
|
2
|
+
import { optimize, type Config } from 'svgo'
|
|
3
|
+
import type { Plugin } from 'vite'
|
|
4
|
+
import svgoConfig from '../docs-shell/common/svgo.config.js'
|
|
5
|
+
import { cleanId } from './module-id'
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* `.svg?raw` imports give Svelte components inline SVG markup. Optimize it like Astro's SVG
|
|
9
|
+
* components, with the same configuration, so both render the same markup and file-prefixed ids.
|
|
10
|
+
*/
|
|
11
|
+
export default function svgMarkup(): Plugin {
|
|
12
|
+
return {
|
|
13
|
+
name: 'master-css-site:svg-markup',
|
|
14
|
+
enforce: 'pre',
|
|
15
|
+
async load(id) {
|
|
16
|
+
if (!/\.svg\?raw$/.test(id)) return
|
|
17
|
+
const file = cleanId(id)
|
|
18
|
+
this.addWatchFile(file)
|
|
19
|
+
const { data } = optimize(await readFile(file, 'utf8'), { ...(svgoConfig as Config), path: file })
|
|
20
|
+
return `export default ${JSON.stringify(data)}`
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
import '@master/internal-site/styles/system/data.css'
|
|
3
|
+
import '@master/internal-site/styles/benchmarks.css'
|
|
4
|
+
import { siteOf } from '@master/internal-site/astro/site-context'
|
|
5
|
+
import { uniqueId } from '@master/internal-site/utils/unique-id'
|
|
6
|
+
import type { BenchmarkBarsProps } from '@master/internal-site/benchmarks/types.ts'
|
|
7
|
+
import { clampPercent, formatMetricValue } from '@master/internal-site/benchmarks/utils.ts'
|
|
8
|
+
|
|
9
|
+
type Props = BenchmarkBarsProps
|
|
10
|
+
|
|
11
|
+
/** Rows of one measurement: every bar is named by its row, so bars stay ink. */
|
|
12
|
+
const { items, max, unit, valueFormatter } = Astro.props
|
|
13
|
+
const { t } = siteOf(Astro)
|
|
14
|
+
const labelPrefix = uniqueId(Astro, 'benchmark-bars')
|
|
15
|
+
const resolvedMax = max ?? Math.max(0, ...items.map((item) => item.max ?? item.value))
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
{items.map((item, index) => {
|
|
19
|
+
const labelId = `${labelPrefix}-label-${index}`
|
|
20
|
+
const valueId = `${labelPrefix}-value-${index}`
|
|
21
|
+
const itemMax = item.max ?? resolvedMax
|
|
22
|
+
const valueLabel = item.valueLabel ?? (valueFormatter ? valueFormatter(item.value) : formatMetricValue(item.value, unit))
|
|
23
|
+
return <div class="ui-chart-row">
|
|
24
|
+
<span>
|
|
25
|
+
{item.icon && <img src={item.icon.src} alt="" width={item.icon.width} height={item.icon.height} class={item.icon.class} />}
|
|
26
|
+
<span id={labelId}>{t(item.label)}{item.labelNote && <span class="ml-xs font-xs fg-text-muted">{item.labelNote}</span>}</span>
|
|
27
|
+
{item.detail && <small>{t(item.detail)}</small>}
|
|
28
|
+
</span>
|
|
29
|
+
<div class="ui-bar" role="meter" aria-labelledby={`${labelId} ${valueId}`} aria-valuemin={0} aria-valuemax={itemMax} aria-valuenow={item.value}>
|
|
30
|
+
<i data-tone={item.color === 'neutral' ? 'muted' : undefined} style={{ width: `${clampPercent(item.value, itemMax)}%` }} />
|
|
31
|
+
</div>
|
|
32
|
+
<output id={valueId}>{valueLabel}</output>
|
|
33
|
+
</div>
|
|
34
|
+
})}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
import '@master/internal-site/styles/system/data.css'
|
|
3
|
+
import '@master/internal-site/styles/benchmarks.css'
|
|
4
|
+
import BenchmarkBarRows from '@master/internal-site/benchmarks/BenchmarkBarRows.astro'
|
|
5
|
+
import type { BenchmarkBarsProps } from '@master/internal-site/benchmarks/types.ts'
|
|
6
|
+
|
|
7
|
+
interface Props extends BenchmarkBarsProps {
|
|
8
|
+
class?: string
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const { class: className, ...props } = Astro.props
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
<div class={className ? `ui-chart ${className}` : 'ui-chart'}><BenchmarkBarRows {...props} /></div>
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
---
|
|
2
|
+
import ExpandContent from '@master/internal-site/components/ExpandContent.svelte'
|
|
3
|
+
import BenchmarkBars from '@master/internal-site/benchmarks/BenchmarkBars.astro'
|
|
4
|
+
import BenchmarkMetricTable from '@master/internal-site/benchmarks/BenchmarkMetricTable.astro'
|
|
5
|
+
import BenchmarkStackedBars from '@master/internal-site/benchmarks/BenchmarkStackedBars.astro'
|
|
6
|
+
import type { BenchmarkChartModel } from '@master/internal-site/benchmarks/types.ts'
|
|
7
|
+
|
|
8
|
+
interface Props {
|
|
9
|
+
chart: BenchmarkChartModel
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/** Renders an authored chart model; `utils/benchmark-content` exports the same model as Markdown. */
|
|
13
|
+
const { chart } = Astro.props
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
{chart.kind === 'bars' && <BenchmarkBars items={chart.items} max={chart.max} unit={chart.unit} valueFormatter={chart.valueFormatter} />}
|
|
17
|
+
{chart.kind === 'stacked-bars' && <BenchmarkStackedBars items={chart.items} max={chart.max} unit={chart.unit} valueFormatter={chart.valueFormatter} />}
|
|
18
|
+
{chart.kind === 'metric-table' && <BenchmarkMetricTable label={chart.label} metrics={chart.metrics} />}
|
|
19
|
+
{chart.kind === 'chart-groups' && (
|
|
20
|
+
<div class="grid gap-lg">
|
|
21
|
+
{chart.groups.map((group) => (
|
|
22
|
+
<div class="grid gap-sm">
|
|
23
|
+
<div class="flex items-baseline justify-between gap-md">
|
|
24
|
+
<h4 class="m(0) font-sm (font-weight:var(--ui-weight-medium)) fg-text-strong">{group.title}</h4>
|
|
25
|
+
<span class="font-xs fg-text-muted">{group.detail}</span>
|
|
26
|
+
</div>
|
|
27
|
+
<BenchmarkBars items={group.items} unit={group.unit} />
|
|
28
|
+
</div>
|
|
29
|
+
))}
|
|
30
|
+
</div>
|
|
31
|
+
)}
|
|
32
|
+
{chart.kind === 'data-table' && (
|
|
33
|
+
<ExpandContent client:idle={{ timeout: 500 }}>
|
|
34
|
+
{/* Preserve keyboard access to wide result tables. */}
|
|
35
|
+
<div class="ui-table" data-numeric-from={chart.numericFrom} role="region" aria-label={chart.label} tabindex="0">
|
|
36
|
+
<table>
|
|
37
|
+
<thead>
|
|
38
|
+
<tr>
|
|
39
|
+
{chart.headers.map((header) => <th>{header}</th>)}
|
|
40
|
+
</tr>
|
|
41
|
+
</thead>
|
|
42
|
+
<tbody>
|
|
43
|
+
{chart.rows.map(([rowHeader, ...cells]) => (
|
|
44
|
+
<tr>
|
|
45
|
+
<th>{rowHeader}</th>
|
|
46
|
+
{cells.map((cell) => <td>{cell}</td>)}
|
|
47
|
+
</tr>
|
|
48
|
+
))}
|
|
49
|
+
</tbody>
|
|
50
|
+
</table>
|
|
51
|
+
</div>
|
|
52
|
+
</ExpandContent>
|
|
53
|
+
)}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
import '@master/internal-site/styles/system/data.css'
|
|
3
|
+
import { siteOf } from '@master/internal-site/astro/site-context'
|
|
4
|
+
import BenchmarkBarRows from '@master/internal-site/benchmarks/BenchmarkBarRows.astro'
|
|
5
|
+
import type { BenchmarkBarItem } from '@master/internal-site/benchmarks/types.ts'
|
|
6
|
+
|
|
7
|
+
interface Props {
|
|
8
|
+
title: string
|
|
9
|
+
detail?: string
|
|
10
|
+
items: BenchmarkBarItem[]
|
|
11
|
+
unit?: string
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/** One metric in one chart frame: its name, statistic and unit stay with the bars. */
|
|
15
|
+
const { title, detail = 'Median', items, unit = 'ms' } = Astro.props
|
|
16
|
+
const { t } = siteOf(Astro)
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
<div class="ui-chart">
|
|
20
|
+
<div class="ui-chart-head">
|
|
21
|
+
<div><b>{t(title)}</b><small>{t(detail)} · {unit}</small></div>
|
|
22
|
+
</div>
|
|
23
|
+
<BenchmarkBarRows items={items} unit={unit} />
|
|
24
|
+
</div>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
import '@master/internal-site/styles/system/data.css'
|
|
3
|
+
import '@master/internal-site/styles/benchmarks.css'
|
|
4
|
+
import { siteOf } from '@master/internal-site/astro/site-context'
|
|
5
|
+
import BenchmarkScrollRegion from '@master/internal-site/benchmarks/BenchmarkScrollRegion.svelte'
|
|
6
|
+
|
|
7
|
+
interface Props {
|
|
8
|
+
title: string
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/** Native disclosure preserves the full server-rendered table; keyboard scrolling is isolated. */
|
|
12
|
+
const { title } = Astro.props
|
|
13
|
+
const { t } = siteOf(Astro)
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
<details class="ui-disclosure" data-variant="rule">
|
|
17
|
+
<summary>
|
|
18
|
+
{t(title)}
|
|
19
|
+
<span class="ui-disclosure-meta">{t('Complete measurements')}</span>
|
|
20
|
+
</summary>
|
|
21
|
+
<div class="ui-disclosure-body">
|
|
22
|
+
<BenchmarkScrollRegion title={title} client:idle={{ timeout: 500 }}><slot /></BenchmarkScrollRegion>
|
|
23
|
+
</div>
|
|
24
|
+
</details>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
import '@master/internal-site/styles/system/specimens.css'
|
|
3
|
+
import { siteOf } from '@master/internal-site/astro/site-context'
|
|
4
|
+
import RenderNode from '@master/internal-site/components/RenderNode.astro'
|
|
5
|
+
import type { BenchmarkTone } from '@master/internal-site/benchmarks/types.ts'
|
|
6
|
+
import { benchmarkStatusTones } from '@master/internal-site/benchmarks/utils.ts'
|
|
7
|
+
|
|
8
|
+
interface Props {
|
|
9
|
+
value?: unknown
|
|
10
|
+
label?: unknown
|
|
11
|
+
tone?: BenchmarkTone
|
|
12
|
+
class?: string
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/** A change between two measurements; its status tone always comes with words. */
|
|
16
|
+
const { value, label, tone = 'neutral', class: className } = Astro.props
|
|
17
|
+
const { t } = siteOf(Astro)
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
<span class={className ? `ui-badge ${className}` : 'ui-badge'} data-tone={benchmarkStatusTones[tone]}>
|
|
21
|
+
<strong>{Astro.slots.has('default') ? <slot /> : <RenderNode node={value} />}</strong>
|
|
22
|
+
{label && <span>{typeof label === 'string' ? t(label) : <RenderNode node={label} />}</span>}
|
|
23
|
+
</span>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
import '@master/internal-site/styles/system/data.css'
|
|
3
|
+
import { siteOf } from '@master/internal-site/astro/site-context'
|
|
4
|
+
import RenderNode from '@master/internal-site/components/RenderNode.astro'
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
title?: unknown
|
|
8
|
+
description?: unknown
|
|
9
|
+
caption?: unknown
|
|
10
|
+
class?: string
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/** A titled chart, its sample context and its caption as one figure. */
|
|
14
|
+
const { title, description, caption, class: className } = Astro.props
|
|
15
|
+
const { t } = siteOf(Astro)
|
|
16
|
+
const text = (node: unknown) => typeof node === 'string' ? t(node) : node
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
<figure class={className ? `ui-tray ${className}` : 'ui-tray'}>
|
|
20
|
+
{(title || description) && (
|
|
21
|
+
<div class="ui-tray-head">
|
|
22
|
+
<div>
|
|
23
|
+
{title && <p class="ui-tray-title"><RenderNode node={text(title)} /></p>}
|
|
24
|
+
{description && <p class="ui-tray-description"><RenderNode node={text(description)} /></p>}
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
)}
|
|
28
|
+
<slot />
|
|
29
|
+
{caption && <figcaption class="ui-tray-caption"><RenderNode node={text(caption)} /></figcaption>}
|
|
30
|
+
</figure>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
import '@master/internal-site/styles/system/data.css'
|
|
3
|
+
import { siteOf } from '@master/internal-site/astro/site-context'
|
|
4
|
+
import BenchmarkStatus from '@master/internal-site/benchmarks/BenchmarkStatus.astro'
|
|
5
|
+
import type { BenchmarkMetric } from '@master/internal-site/benchmarks/types.ts'
|
|
6
|
+
|
|
7
|
+
interface Props {
|
|
8
|
+
metrics: BenchmarkMetric[]
|
|
9
|
+
/** Names the scrollable region; several metric tables share a page, so each needs its own name. */
|
|
10
|
+
label?: string
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const { metrics, label = 'Benchmark metrics' } = Astro.props
|
|
14
|
+
const { t } = siteOf(Astro)
|
|
15
|
+
const hasDetails = metrics.some((metric) => metric.detail)
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
{/* Preserve keyboard access to wide metric tables. */}
|
|
19
|
+
<div class="ui-table" role="region" aria-label={label} tabindex="0">
|
|
20
|
+
<table>
|
|
21
|
+
<thead>
|
|
22
|
+
<tr>
|
|
23
|
+
<th scope="col">{t('Metric')}</th>
|
|
24
|
+
<th scope="col">{t('Value')}</th>
|
|
25
|
+
{hasDetails && <th scope="col">{t('Detail')}</th>}
|
|
26
|
+
</tr>
|
|
27
|
+
</thead>
|
|
28
|
+
<tbody>
|
|
29
|
+
{metrics.map((metric) => (
|
|
30
|
+
<tr>
|
|
31
|
+
<th scope="row">{t(metric.label)}</th>
|
|
32
|
+
<td class="benchmark-value">{metric.value} <BenchmarkStatus tone={metric.tone} /></td>
|
|
33
|
+
{hasDetails && <td>{metric.detail && t(metric.detail)}</td>}
|
|
34
|
+
</tr>
|
|
35
|
+
))}
|
|
36
|
+
</tbody>
|
|
37
|
+
</table>
|
|
38
|
+
</div>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
import '@master/internal-site/styles/system/data.css'
|
|
3
|
+
import { siteOf } from '@master/internal-site/astro/site-context'
|
|
4
|
+
import BenchmarkStatus from '@master/internal-site/benchmarks/BenchmarkStatus.astro'
|
|
5
|
+
import type { BenchmarkMetric } from '@master/internal-site/benchmarks/types.ts'
|
|
6
|
+
|
|
7
|
+
interface Props {
|
|
8
|
+
metrics: BenchmarkMetric[]
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const { metrics } = Astro.props
|
|
12
|
+
const { t } = siteOf(Astro)
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
<div class="ui-metrics">
|
|
16
|
+
{metrics.map((metric) => (
|
|
17
|
+
<div class="ui-metric">
|
|
18
|
+
<small>{t(metric.label)}</small>
|
|
19
|
+
<b>{metric.value}</b>
|
|
20
|
+
{(metric.detail || (metric.tone && metric.tone !== 'neutral')) && <p><BenchmarkStatus tone={metric.tone} /> {metric.detail && t(metric.detail)}</p>}
|
|
21
|
+
</div>
|
|
22
|
+
))}
|
|
23
|
+
</div>
|