@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,93 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { DocSidebarProps } from './DocSidebar.svelte'
|
|
3
|
+
|
|
4
|
+
export interface DocHeaderProps {
|
|
5
|
+
class?: string
|
|
6
|
+
/** See `Header`: overlays the page and slides away while reading down. */
|
|
7
|
+
stickable?: boolean
|
|
8
|
+
transitionAtTop?: boolean
|
|
9
|
+
/** Chapters the compact menu lists. */
|
|
10
|
+
documentNavigation?: DocSidebarProps['pageCategories']
|
|
11
|
+
documentNavigationTitle?: string
|
|
12
|
+
/** Accepted for section shells; the header always spans the page. */
|
|
13
|
+
contained?: boolean
|
|
14
|
+
}
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<script lang="ts">
|
|
18
|
+
// `.app-wrapper` sets the homepage sections' column gutters; the homepage loads it through this header.
|
|
19
|
+
import '../../styles/docs-shell/wrapper.css'
|
|
20
|
+
import Header from './Header.svelte'
|
|
21
|
+
import HeaderNav from './HeaderNav.svelte'
|
|
22
|
+
import LanguageButton from './LanguageButton.svelte'
|
|
23
|
+
import IconChevronDown from '@tabler/icons-svelte-runes/icons/chevron-down'
|
|
24
|
+
import IconArrowUpRight from '@tabler/icons-svelte-runes/icons/arrow-up-right'
|
|
25
|
+
import IconSearch from '@tabler/icons-svelte-runes/icons/search'
|
|
26
|
+
import DocVersionSelect from './DocVersionSelect.svelte'
|
|
27
|
+
import Link from './Link.svelte'
|
|
28
|
+
import DocMenuButton from './DocMenuButton.svelte'
|
|
29
|
+
import SearchButton from './SearchButton.svelte'
|
|
30
|
+
import isDateWithinSevenDays from '../utils/is-date-within-seven-days'
|
|
31
|
+
import app from 'virtual:master-site/app'
|
|
32
|
+
import { getSite } from '../site'
|
|
33
|
+
|
|
34
|
+
let { class: className, stickable, transitionAtTop, documentNavigation, documentNavigationTitle }: DocHeaderProps = $props()
|
|
35
|
+
const { t, locale, pathname, i18n } = getSite()
|
|
36
|
+
const tw = locale === 'tw'
|
|
37
|
+
const home = pathname === (tw ? '/tw' : '/')
|
|
38
|
+
const headerCommunityNavs = app.header?.communityNavs ?? app.communityNavs ?? []
|
|
39
|
+
const showLanguage = i18n.locales.length > 1
|
|
40
|
+
const version = import.meta.env.PUBLIC_VERSION ? `v${import.meta.env.PUBLIC_VERSION}` : ''
|
|
41
|
+
</script>
|
|
42
|
+
|
|
43
|
+
<Header class={className} {stickable} {transitionAtTop}>
|
|
44
|
+
<DocMenuButton class="ui-header-menu" {documentNavigation} {documentNavigationTitle} />
|
|
45
|
+
<Link href="/" class="ui-header-brand" aria-label={`${app.name} ${tw ? '首頁' : 'home'}`} oncontextmenu={(event: MouseEvent) => {
|
|
46
|
+
event.preventDefault()
|
|
47
|
+
location.assign(app.brandURL)
|
|
48
|
+
}}>
|
|
49
|
+
<app.Logotype style="height: 20px; width: auto" aria-hidden="true" />
|
|
50
|
+
</Link>
|
|
51
|
+
{#if app.versions.length}
|
|
52
|
+
<label class="ui-version">
|
|
53
|
+
{version}
|
|
54
|
+
<DocVersionSelect aria-label={t('Version')} />
|
|
55
|
+
<IconChevronDown aria-hidden="true" stroke={1.5} />
|
|
56
|
+
</label>
|
|
57
|
+
{:else if version}
|
|
58
|
+
<span class="ui-version">{version}</span>
|
|
59
|
+
{/if}
|
|
60
|
+
<nav class="ui-header-nav" aria-label={tw ? '主要導覽' : 'Main navigation'}>
|
|
61
|
+
{#each app.navs as { Icon: _Icon, fullName: _fullName, ...eachLink } (eachLink.name)}<HeaderNav {...eachLink}>
|
|
62
|
+
{t(eachLink.name)}
|
|
63
|
+
{#if eachLink.date && isDateWithinSevenDays(eachLink.date)}<small>{t('New')}</small>{/if}
|
|
64
|
+
</HeaderNav>{/each}
|
|
65
|
+
</nav>
|
|
66
|
+
<div class="ui-header-end" data-home-controls={app.header?.searchOnHome ? 'full' : undefined}>
|
|
67
|
+
<!-- Search leads the end group as a quiet pill: the glass and its shortcut. Homepages may opt into the same desktop search control. -->
|
|
68
|
+
<SearchButton class="ui-header-search" data-compact={home && !app.header?.searchOnHome ? '' : undefined}>
|
|
69
|
+
<IconSearch size={16} stroke={1.5} aria-hidden="true" />
|
|
70
|
+
<kbd class="ui-kbd" aria-hidden="true">⌘K</kbd>
|
|
71
|
+
</SearchButton>
|
|
72
|
+
{#each headerCommunityNavs as { Icon, disabled, fullName, ...eachLink } (eachLink.name)}
|
|
73
|
+
<Link
|
|
74
|
+
{...eachLink}
|
|
75
|
+
aria-label={fullName || eachLink.name}
|
|
76
|
+
class="ui-button"
|
|
77
|
+
data-variant="quiet"
|
|
78
|
+
data-shape="icon"
|
|
79
|
+
data-size="sm"
|
|
80
|
+
data-disabled={disabled || undefined}
|
|
81
|
+
{disabled}
|
|
82
|
+
>
|
|
83
|
+
{#if Icon}<Icon size={18} stroke={1.5} aria-hidden="true" />{/if}
|
|
84
|
+
{#if eachLink.href?.startsWith('http')}<IconArrowUpRight class="ui-header-external" size={10} stroke={1.5} aria-hidden="true" />{/if}
|
|
85
|
+
<span class="ui-tooltip" data-side="bottom" aria-hidden="true">{fullName || eachLink.name}</span>
|
|
86
|
+
</Link>
|
|
87
|
+
{/each}
|
|
88
|
+
{#if showLanguage}
|
|
89
|
+
{#if headerCommunityNavs.length}<span class="ui-header-divider" aria-hidden="true"></span>{/if}
|
|
90
|
+
<LanguageButton />
|
|
91
|
+
{/if}
|
|
92
|
+
</div>
|
|
93
|
+
</Header>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
import '../../styles/docs-shell/prose.css'
|
|
3
|
+
import resolveHeading from '../utils/resolve-heading'
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
tagName: 'h2' | 'h3'
|
|
7
|
+
id?: string
|
|
8
|
+
[key: string]: any
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const entities: Record<string, string> = { '&': '&', '<': '<', '>': '>', '"': '"', ''': "'", ''': "'" }
|
|
12
|
+
const decode = (html: string) => html.replace(/&(?:amp|lt|gt|quot|#39|#x27);/g, (entity) => entities[entity])
|
|
13
|
+
|
|
14
|
+
/** A section heading with its `ui-anchor`. Clicking a heading copies its link; see `docs-shell/scripts/document`. */
|
|
15
|
+
const { tagName, id, class: className, ...props } = Astro.props
|
|
16
|
+
const Element = tagName === 'h2' ? 'h2' : 'h3'
|
|
17
|
+
const html = await Astro.slots.render('default')
|
|
18
|
+
// Plain-text headings may end with ` [sr-only]`; headings with inline code or links render as written.
|
|
19
|
+
const plain = !html.includes('<')
|
|
20
|
+
const text = decode(html.replace(/<[^>]*>/g, '')).trim()
|
|
21
|
+
const heading = resolveHeading(plain ? decode(html) : undefined, id)
|
|
22
|
+
const title = typeof heading.title === 'string' ? heading.title : text
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
<Element {...props} id={heading.id ?? id} class:list={[className, heading.className]} title={title || undefined} data-doc-heading="">
|
|
26
|
+
<a class="ui-anchor" href={'#' + (heading.id ?? id)} aria-label={`Link to section: ${title}`}>#</a>
|
|
27
|
+
<Fragment set:html={plain ? html.replace(' [sr-only]', '') : html} />
|
|
28
|
+
</Element>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
import '../../styles/docs-shell/docs.css'
|
|
3
|
+
import type { HTMLAttributes } from 'astro/types'
|
|
4
|
+
import Footer, { type FooterProps } from './Footer.svelte'
|
|
5
|
+
|
|
6
|
+
interface Props extends HTMLAttributes<'main'> {
|
|
7
|
+
footerProps?: FooterProps
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/** The main column: the article and its contents rail, then the footer. */
|
|
11
|
+
const { footerProps, class: className, ...props } = Astro.props
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
<main {...props} class:list={['ui-docs-main', className]}>
|
|
15
|
+
<div class="ui-docs-body">
|
|
16
|
+
<slot />
|
|
17
|
+
</div>
|
|
18
|
+
{footerProps && <Footer client:load {...footerProps} />}
|
|
19
|
+
</main>
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { Attachment } from 'svelte/attachments'
|
|
3
|
+
|
|
4
|
+
/** The sheet lives at the end of the body, outside the header that opens it. */
|
|
5
|
+
const portal: Attachment<HTMLElement> = (node) => {
|
|
6
|
+
document.body.append(node)
|
|
7
|
+
return () => node.remove()
|
|
8
|
+
}
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<script lang="ts">
|
|
12
|
+
import '../../styles/docs-shell/menu.css'
|
|
13
|
+
import clsx from 'clsx'
|
|
14
|
+
import Link from './Link.svelte'
|
|
15
|
+
import DocSidebar, { type DocSidebarProps } from './DocSidebar.svelte'
|
|
16
|
+
import SearchButton from './SearchButton.svelte'
|
|
17
|
+
import IconArrowUpRight from '@tabler/icons-svelte-runes/icons/arrow-up-right'
|
|
18
|
+
import IconMenu2 from '@tabler/icons-svelte-runes/icons/menu-2'
|
|
19
|
+
import IconX from '@tabler/icons-svelte-runes/icons/x'
|
|
20
|
+
import ThemeSelect from './ThemeSelect.svelte'
|
|
21
|
+
import DocVersionSelect from './DocVersionSelect.svelte'
|
|
22
|
+
import LanguageSelect from './LanguageSelect.svelte'
|
|
23
|
+
import app from 'virtual:master-site/app'
|
|
24
|
+
import { getSite } from '../site'
|
|
25
|
+
|
|
26
|
+
interface Props {
|
|
27
|
+
class?: string
|
|
28
|
+
documentNavigation?: DocSidebarProps['pageCategories']
|
|
29
|
+
documentNavigationTitle?: string
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** The compact header's menu: site sections, the section's chapters, community links and preferences in one sheet. */
|
|
33
|
+
let { class: className, documentNavigation, documentNavigationTitle }: Props = $props()
|
|
34
|
+
let opened = $state(false)
|
|
35
|
+
const id = $props.id()
|
|
36
|
+
let dialog = $state<HTMLDialogElement>()
|
|
37
|
+
let trigger = $state<HTMLButtonElement>()
|
|
38
|
+
const { t, locale, i18n } = getSite()
|
|
39
|
+
const tw = locale === 'tw'
|
|
40
|
+
|
|
41
|
+
function close() {
|
|
42
|
+
dialog?.close()
|
|
43
|
+
opened = false
|
|
44
|
+
trigger?.focus({ preventScroll: true })
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
$effect(() => {
|
|
48
|
+
if (!opened) return
|
|
49
|
+
const element = dialog
|
|
50
|
+
if (element && !element.open) element.showModal()
|
|
51
|
+
const wide = matchMedia('(width >= 64rem)')
|
|
52
|
+
const resize = () => { if (wide.matches) close() }
|
|
53
|
+
wide.addEventListener('change', resize)
|
|
54
|
+
return () => wide.removeEventListener('change', resize)
|
|
55
|
+
})
|
|
56
|
+
</script>
|
|
57
|
+
|
|
58
|
+
<button bind:this={trigger} type="button" class={clsx('ui-button', className)} data-variant="quiet" data-shape="icon"
|
|
59
|
+
aria-label={t('Menu')} aria-expanded={opened} aria-haspopup="dialog" aria-controls={opened ? id : undefined}
|
|
60
|
+
onclick={() => { opened = !opened }}>
|
|
61
|
+
<IconMenu2 size={20} stroke={1.5} aria-hidden="true" />
|
|
62
|
+
</button>
|
|
63
|
+
{#if opened}
|
|
64
|
+
<dialog bind:this={dialog} {@attach portal} {id} class="ui-dialog" data-variant="sheet" aria-labelledby={`${id}-title`} oncancel={event => { event.preventDefault(); close() }}>
|
|
65
|
+
<div class="ui-dialog-bar">
|
|
66
|
+
<button type="button" class="ui-button" data-variant="quiet" data-shape="icon" onclick={close} aria-label={tw ? '關閉選單' : 'Close menu'}><IconX size={20} stroke={1.5} aria-hidden="true" /></button>
|
|
67
|
+
<Link href="/" class="ui-header-brand" onclick={close} aria-label={`${app.name} ${tw ? '首頁' : 'home'}`}><app.Logotype style="height: 20px; width: auto" aria-hidden="true" /></Link>
|
|
68
|
+
</div>
|
|
69
|
+
<div class="ui-dialog-body">
|
|
70
|
+
<h2 class="sr-only" id={`${id}-title`}>{tw ? '網站導覽' : 'Navigation'}</h2>
|
|
71
|
+
<SearchButton class="ui-search-trigger" />
|
|
72
|
+
<nav class="ui-nav-group" aria-label={tw ? '主要導覽' : 'Main navigation'}>
|
|
73
|
+
{#each app.navs as { Icon, disabled, fullName, ...link } (link.name)}<Link class="ui-nav-link" current="true" ambiguous {...link} {disabled} onclick={close}>
|
|
74
|
+
{#if Icon}<Icon size={18} stroke={1.5} aria-hidden="true" />{/if}{t(fullName || link.name)}
|
|
75
|
+
{#if link.href?.startsWith('http')}<IconArrowUpRight size={14} stroke={1.5} aria-hidden="true" />{/if}
|
|
76
|
+
</Link>{/each}
|
|
77
|
+
</nav>
|
|
78
|
+
{#if documentNavigation?.length}<details class="ui-disclosure" data-variant="rule" open>
|
|
79
|
+
<summary>{t(documentNavigationTitle || 'Documentation')}<span class="ui-disclosure-meta">{tw ? '文件章節' : 'Chapters'}</span></summary>
|
|
80
|
+
<DocSidebar embedded includeNestedPages pageCategories={documentNavigation} onNavigate={close} />
|
|
81
|
+
</details>{/if}
|
|
82
|
+
{#if app.communityNavs?.length}<nav class="ui-nav-group" aria-labelledby={`${id}-community`}>
|
|
83
|
+
<h4 id={`${id}-community`}>{t('Community')}</h4>
|
|
84
|
+
{#each app.communityNavs as { Icon, disabled, fullName, ...link } (link.name)}<Link class="ui-nav-link" {...link} {disabled} onclick={close}>
|
|
85
|
+
{#if Icon}<Icon size={18} stroke={1.5} aria-hidden="true" />{/if}{t(fullName || link.name)}<IconArrowUpRight size={14} stroke={1.5} aria-hidden="true" />
|
|
86
|
+
</Link>{/each}
|
|
87
|
+
</nav>{/if}
|
|
88
|
+
<section class="ui-dialog-fields" aria-labelledby={`${id}-system`}>
|
|
89
|
+
<h4 id={`${id}-system`}>{t('System')}</h4>
|
|
90
|
+
{#if app.versions.length > 0}<label class="ui-field">{t('Version')}<DocVersionSelect aria-label={t('Version')} data-variant={undefined} /></label>{/if}
|
|
91
|
+
{#if i18n.locales.length > 1}<label class="ui-field">{t('Language')}<LanguageSelect aria-label={t('Language')} data-variant={undefined} /></label>{/if}
|
|
92
|
+
<label class="ui-field">{t('Theme')}<ThemeSelect aria-label={t('Theme')} data-variant={undefined} /></label>
|
|
93
|
+
</section>
|
|
94
|
+
</div>
|
|
95
|
+
</dialog>
|
|
96
|
+
{/if}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { DefinedMetadata } from '../types/Metadata'
|
|
3
|
+
|
|
4
|
+
export interface DocSidebarProps {
|
|
5
|
+
pageCategories: {
|
|
6
|
+
name: string,
|
|
7
|
+
pages: (Pick<DefinedMetadata, 'pathname' | 'title'> & Partial<DefinedMetadata>)[]
|
|
8
|
+
}[],
|
|
9
|
+
includeNestedPages?: boolean
|
|
10
|
+
/** Inside the compact menu: the groups only, without the documentation landmark. */
|
|
11
|
+
embedded?: boolean
|
|
12
|
+
onNavigate?: () => void
|
|
13
|
+
}
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<script lang="ts">
|
|
17
|
+
import Link from './Link.svelte'
|
|
18
|
+
import { getSite } from '../site'
|
|
19
|
+
|
|
20
|
+
/** The documentation sidebar: one navigation group per category; the page being read inks a bar on the guide. Search lives in the header. */
|
|
21
|
+
let { pageCategories, includeNestedPages = false, embedded = false, onNavigate }: DocSidebarProps = $props()
|
|
22
|
+
const { t, locale } = getSite()
|
|
23
|
+
const tw = locale === 'tw'
|
|
24
|
+
const groups = $derived(pageCategories
|
|
25
|
+
.filter((eachPageCategory: any) => eachPageCategory.name !== 'Overview')
|
|
26
|
+
.map((eachPageCategory: any) => ({
|
|
27
|
+
name: eachPageCategory.name,
|
|
28
|
+
pages: eachPageCategory.pages.filter((metadata: any) => includeNestedPages || metadata.pathname.split('/').length === 3)
|
|
29
|
+
}))
|
|
30
|
+
.filter(({ pages }) => pages.length !== 0))
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
{#snippet sidebarGroups()}
|
|
34
|
+
{#each groups as eachPageCategory (eachPageCategory.name)}
|
|
35
|
+
{@const name = t(eachPageCategory.name)}
|
|
36
|
+
<nav class="ui-nav-group" aria-label={name}>
|
|
37
|
+
<h4>{name}</h4>
|
|
38
|
+
{#each eachPageCategory.pages as metadata (metadata.pathname)}
|
|
39
|
+
{@const translatedTitle = t(metadata.other?.subject || metadata.title.absolute || metadata.title)}
|
|
40
|
+
<Link class="ui-nav-link"
|
|
41
|
+
current="true"
|
|
42
|
+
ambiguous
|
|
43
|
+
href={metadata.pathname}
|
|
44
|
+
scrollIntoView
|
|
45
|
+
disabled={metadata.disabled}
|
|
46
|
+
unfinished={metadata.unfinished}
|
|
47
|
+
onclick={onNavigate}>
|
|
48
|
+
{t(translatedTitle)}
|
|
49
|
+
{#if metadata.type === 'entity' && locale !== 'en' && translatedTitle !== metadata.title}<small translate="no">{metadata.title}</small>{/if}
|
|
50
|
+
</Link>
|
|
51
|
+
{/each}
|
|
52
|
+
</nav>
|
|
53
|
+
{/each}
|
|
54
|
+
{/snippet}
|
|
55
|
+
|
|
56
|
+
{#if embedded}
|
|
57
|
+
<div class="ui-sidebar">{@render sidebarGroups()}</div>
|
|
58
|
+
{:else}
|
|
59
|
+
<aside id="sidebar" aria-label={tw ? '文件導覽' : 'Documentation navigation'} class="ui-sidebar">
|
|
60
|
+
{@render sidebarGroups()}
|
|
61
|
+
</aside>
|
|
62
|
+
{/if}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { HTMLSelectAttributes } from 'svelte/elements'
|
|
3
|
+
import clsx from 'clsx'
|
|
4
|
+
import app from 'virtual:master-site/app'
|
|
5
|
+
|
|
6
|
+
type Props = Omit<HTMLSelectAttributes, 'value' | 'onchange'>
|
|
7
|
+
|
|
8
|
+
/** A native select; by default invisible over its positioned label (`ui-select[data-variant="overlay"]`), which shows the value. */
|
|
9
|
+
let { class: className, ...props }: Props = $props()
|
|
10
|
+
const currentURL = import.meta.env.PUBLIC_URL
|
|
11
|
+
|
|
12
|
+
function navigate(event: Event & { currentTarget: HTMLSelectElement }) {
|
|
13
|
+
window.location.href = event.currentTarget.value
|
|
14
|
+
}
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<select name="version" value={currentURL}
|
|
18
|
+
data-variant="overlay" {...props} class={clsx('ui-select', className)}
|
|
19
|
+
onchange={navigate}>
|
|
20
|
+
<option value={currentURL}>v{import.meta.env.PUBLIC_VERSION}</option>
|
|
21
|
+
{#each app.versions as { name, href } (href)}<option value={href}>{name}</option>{/each}
|
|
22
|
+
</select>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
import '../../styles/docs-shell/docs.css'
|
|
3
|
+
import type { HTMLAttributes } from 'astro/types'
|
|
4
|
+
|
|
5
|
+
type Props = HTMLAttributes<'div'>
|
|
6
|
+
|
|
7
|
+
/** The documentation frame under the header: the sidebar, then the main column. */
|
|
8
|
+
const { class: className, ...props } = Astro.props
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
<div {...props} class:list={['ui-docs', className]}><slot /></div>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
import '@master/internal-site/styles/system/data.css'
|
|
3
|
+
import Link from '@master/internal-site/components/Link.svelte'
|
|
4
|
+
import DocumentIdentifier from '@master/internal-site/components/DocumentIdentifier.astro'
|
|
5
|
+
import type { DocumentAPIEntry } from '@master/internal-site/components/document-types.ts'
|
|
6
|
+
|
|
7
|
+
export type { DocumentAPIEntry } from '@master/internal-site/components/document-types.ts'
|
|
8
|
+
|
|
9
|
+
interface Props {
|
|
10
|
+
label: string
|
|
11
|
+
entries: readonly DocumentAPIEntry[]
|
|
12
|
+
compact?: boolean
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/** Static navigation for exact identifiers; long names wrap without changing copy text. */
|
|
16
|
+
const { label, entries, compact = false } = Astro.props
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
<nav class="ui-index" data-density={compact ? 'compact' : undefined} aria-label={label}>
|
|
20
|
+
{entries.map(entry => <Link href={entry.href}>
|
|
21
|
+
<b><code><DocumentIdentifier text={entry.name} /></code></b>
|
|
22
|
+
<span>{entry.description}</span>
|
|
23
|
+
</Link>)}
|
|
24
|
+
</nav>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
import '@master/internal-site/styles/system/data.css'
|
|
3
|
+
import Link from '@master/internal-site/components/Link.svelte'
|
|
4
|
+
import RenderNode from '@master/internal-site/components/RenderNode.astro'
|
|
5
|
+
import type { DocumentChoice } from '@master/internal-site/components/document-types.ts'
|
|
6
|
+
|
|
7
|
+
export type { DocumentChoice } from '@master/internal-site/components/document-types.ts'
|
|
8
|
+
|
|
9
|
+
interface Props {
|
|
10
|
+
label: string
|
|
11
|
+
entries: readonly DocumentChoice[]
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/** A compact reading-column index. Navigation stays outside measured demo layouts. */
|
|
15
|
+
const { label, entries } = Astro.props
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
<nav aria-label={label} class="ui-index">
|
|
19
|
+
{entries.map(entry => <Link href={entry.href}>
|
|
20
|
+
{entry.icon != null && <RenderNode node={entry.icon} />}
|
|
21
|
+
<b>{entry.title}</b>
|
|
22
|
+
<span>{entry.description}</span>
|
|
23
|
+
</Link>)}
|
|
24
|
+
</nav>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
import Code from '@master/internal-site/components/Code.astro'
|
|
3
|
+
import DocumentCodeExampleView from '@master/internal-site/components/DocumentCodeExampleView.astro'
|
|
4
|
+
import type { DocumentCodeExampleProps } from '@master/internal-site/components/document-types.ts'
|
|
5
|
+
|
|
6
|
+
export type { DocumentCodeExampleProps } from '@master/internal-site/components/document-types.ts'
|
|
7
|
+
|
|
8
|
+
type Props = DocumentCodeExampleProps
|
|
9
|
+
|
|
10
|
+
/** Labels name the two sides of a pair; a source alone, or above its Generated CSS disclosure, needs none. */
|
|
11
|
+
const { language, resultLanguage = language, source, result, sourceLabel, resultLabel = 'Result', ...props } = Astro.props
|
|
12
|
+
const pair = result !== undefined && props.resultKind !== 'generated-css'
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
<DocumentCodeExampleView {...props}>
|
|
16
|
+
<Code slot="sourceCode" lang={language} name={sourceLabel ?? (pair ? 'Source' : undefined)} code={source} />
|
|
17
|
+
{result !== undefined && (props.resultKind === 'generated-css'
|
|
18
|
+
? <Code slot="resultCode" lang={resultLanguage} code={result} />
|
|
19
|
+
: <Code slot="resultCode" lang={resultLanguage} name={resultLabel} code={result} />)}
|
|
20
|
+
</DocumentCodeExampleView>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
import '@master/internal-site/styles/system/data.css'
|
|
3
|
+
import IconAlertTriangle from '@tabler/icons-svelte-runes/icons/alert-triangle'
|
|
4
|
+
import IconCircleX from '@tabler/icons-svelte-runes/icons/circle-x'
|
|
5
|
+
import RenderNode from '@master/internal-site/components/RenderNode.astro'
|
|
6
|
+
import GeneratedCSS from '@master/internal-site/components/GeneratedCSS.astro'
|
|
7
|
+
import type { DocumentCodeExampleViewProps } from '@master/internal-site/components/document-types.ts'
|
|
8
|
+
|
|
9
|
+
export type { DocumentCodeExampleViewProps } from '@master/internal-site/components/document-types.ts'
|
|
10
|
+
|
|
11
|
+
type Props = DocumentCodeExampleViewProps
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Static, verified source/output pair in one tray. It does not simulate an editor or execute code.
|
|
15
|
+
* The code blocks arrive as the `sourceCode`/`resultCode` props, or as slots of the same names.
|
|
16
|
+
*/
|
|
17
|
+
const { title, sourceCode, resultCode, resultKind, diagnostic } = Astro.props
|
|
18
|
+
const DiagnosticIcon = diagnostic?.severity === 'Error' ? IconCircleX : IconAlertTriangle
|
|
19
|
+
const hasResult = resultCode != null || Astro.slots.has('resultCode')
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
<figure class="ui-tray" aria-label={title}>
|
|
23
|
+
<figcaption class="ui-tray-head"><p class="ui-tray-title">{title}</p></figcaption>
|
|
24
|
+
{sourceCode != null ? <RenderNode node={sourceCode} /> : <slot name="sourceCode" />}
|
|
25
|
+
{diagnostic && <div class="ui-callout" data-tone={diagnostic.severity === 'Error' ? 'danger' : 'warning'}>
|
|
26
|
+
<DiagnosticIcon stroke={1.6} aria-hidden="true" />
|
|
27
|
+
<div>
|
|
28
|
+
<p><b>{diagnostic.severity}</b> · <code>{diagnostic.rule}</code></p>
|
|
29
|
+
<p>{diagnostic.message}</p>
|
|
30
|
+
</div>
|
|
31
|
+
</div>}
|
|
32
|
+
{hasResult && (resultKind === 'generated-css'
|
|
33
|
+
? <GeneratedCSS>{resultCode != null ? <RenderNode node={resultCode} /> : <slot name="resultCode" />}</GeneratedCSS>
|
|
34
|
+
: resultCode != null ? <RenderNode node={resultCode} /> : <slot name="resultCode" />)}
|
|
35
|
+
</figure>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
import '@master/internal-site/styles/system/data.css'
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
label?: string
|
|
6
|
+
rows: { syntax: string, css: string }[]
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/** Preserve short syntax tokens while allowing native CSS to wrap at its spaces. */
|
|
10
|
+
const { label = 'Syntax', rows } = Astro.props
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
{/* The table's narrow overflow region must be focusable for native keyboard scrolling. */}
|
|
14
|
+
<div class="ui-table" data-variant="lookup" role="region" aria-label={`${label} and CSS`} tabindex="0"><table>
|
|
15
|
+
<thead><tr><th scope="col">{label}</th><th scope="col">CSS</th></tr></thead>
|
|
16
|
+
<tbody>{rows.map(({ syntax, css }) => <tr>
|
|
17
|
+
<th scope="row"><code>{syntax}</code></th><td><code>{css}</code></td>
|
|
18
|
+
</tr>)}</tbody>
|
|
19
|
+
</table></div>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { onMount } from 'svelte'
|
|
3
|
+
import IconCheck from '@tabler/icons-svelte-runes/icons/check'
|
|
4
|
+
import IconCopy from '@tabler/icons-svelte-runes/icons/copy'
|
|
5
|
+
|
|
6
|
+
/** Content stays server-rendered; only clipboard feedback needs client state. */
|
|
7
|
+
let { text, label }: { text: string, label: string } = $props()
|
|
8
|
+
|
|
9
|
+
let result = $state<'success' | 'error'>()
|
|
10
|
+
// Disabled in the server HTML until hydration can handle the click.
|
|
11
|
+
let ready = $state(false)
|
|
12
|
+
|
|
13
|
+
let timer: ReturnType<typeof setTimeout> | undefined
|
|
14
|
+
|
|
15
|
+
onMount(() => {
|
|
16
|
+
ready = true
|
|
17
|
+
return () => clearTimeout(timer)
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
async function copy() {
|
|
21
|
+
clearTimeout(timer)
|
|
22
|
+
try {
|
|
23
|
+
await navigator.clipboard.writeText(text)
|
|
24
|
+
result = 'success'
|
|
25
|
+
// Success feedback clears itself; an error stays until the next attempt.
|
|
26
|
+
timer = setTimeout(() => result = undefined, 2000)
|
|
27
|
+
} catch {
|
|
28
|
+
result = 'error'
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<span class="ui-copy">
|
|
34
|
+
<button type="button" class="ui-button" data-size="sm" disabled={!ready} aria-label={`Copy ${label}`} onclick={copy}>
|
|
35
|
+
{#if result === 'success'}<IconCheck stroke={1.8} aria-hidden="true" />{:else}<IconCopy stroke={1.8} aria-hidden="true" />{/if}
|
|
36
|
+
Copy
|
|
37
|
+
</button>
|
|
38
|
+
<span class="ui-copy-status" role="status" data-result={result}>
|
|
39
|
+
{#if result === 'success'}Copied<span class="sr-only"> {label}</span>{:else if result === 'error'}Clipboard unavailable. Select the text to copy it.{/if}
|
|
40
|
+
</span>
|
|
41
|
+
</span>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
import Code from '@master/internal-site/components/Code.astro'
|
|
3
|
+
import { slotText } from '@master/internal-site/utils/slot-text'
|
|
4
|
+
import DocumentDeclarationView from '@master/internal-site/components/DocumentDeclarationView.astro'
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
label?: string
|
|
8
|
+
/** The declaration; text children work too, as in `<DocumentDeclaration>{declaration}</DocumentDeclaration>`. */
|
|
9
|
+
code?: string
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const source = Astro.props.code ?? await slotText(Astro.slots) ?? ''
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
<DocumentDeclarationView source={source}>
|
|
16
|
+
<Code lang="typescript" beautify={false} dedent={false} code={source} />
|
|
17
|
+
</DocumentDeclarationView>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
import DocumentDisclosure from '@master/internal-site/components/DocumentDisclosure.astro'
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
source: string
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/** Full TypeScript remains server rendered and copyable, including long contracts. */
|
|
9
|
+
const lines = Astro.props.source.split('\n').length
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
{lines > 40 ? <DocumentDisclosure title={`Complete declaration · ${lines} lines`}><slot /></DocumentDisclosure> : <slot />}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
interface Props {
|
|
3
|
+
title: string
|
|
4
|
+
open?: boolean
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
/** A native disclosure remains usable before JavaScript loads; its body reads like the article. */
|
|
8
|
+
const { title, open = false } = Astro.props
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
<details class="ui-disclosure" data-variant="rule" open={open}>
|
|
12
|
+
<summary>{title}</summary>
|
|
13
|
+
<div class="ui-disclosure-body ui-prose"><slot /></div>
|
|
14
|
+
</details>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
import IconFile from '@tabler/icons-svelte-runes/icons/file'
|
|
3
|
+
import IconFolder from '@tabler/icons-svelte-runes/icons/folder'
|
|
4
|
+
import type { DocumentFileEntry, DocumentFileTreeProps } from '@master/internal-site/components/document-types.ts'
|
|
5
|
+
|
|
6
|
+
export type { DocumentFileEntry, DocumentFileTreeProps } from '@master/internal-site/components/document-types.ts'
|
|
7
|
+
|
|
8
|
+
type Props = DocumentFileTreeProps | {
|
|
9
|
+
/** Nested levels render through this component again with only their entries. */
|
|
10
|
+
entries: readonly DocumentFileEntry[]
|
|
11
|
+
nested: true
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/** Read-only nested lists; no tree widget or keyboard interaction is implied. */
|
|
15
|
+
const props = Astro.props
|
|
16
|
+
const Entries = Astro.self
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
{'nested' in props
|
|
20
|
+
? <ul role="list">{/* Preserve WebKit list semantics when list-style is none. */}
|
|
21
|
+
{props.entries.map(entry => <li>
|
|
22
|
+
<div>
|
|
23
|
+
{entry.children ? <IconFolder stroke={1.6} aria-hidden="true" /> : <IconFile stroke={1.6} aria-hidden="true" />}
|
|
24
|
+
<b>{entry.name}{entry.children ? '/' : ''}</b>
|
|
25
|
+
{entry.description && <span>{entry.description}</span>}
|
|
26
|
+
</div>
|
|
27
|
+
{!!entry.children?.length && <Entries entries={entry.children} nested />}
|
|
28
|
+
</li>)}
|
|
29
|
+
</ul>
|
|
30
|
+
: <figure class="ui-tray" aria-label={props.title}>
|
|
31
|
+
<figcaption class="ui-tray-head"><p class="ui-tray-title">{props.title}</p></figcaption>
|
|
32
|
+
<div class="ui-tree"><Entries entries={props.entries} nested /></div>
|
|
33
|
+
{props.caption && <p class="ui-tray-caption">{props.caption}</p>}
|
|
34
|
+
</figure>}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
import '@master/internal-site/styles/system/data.css'
|
|
3
|
+
import type { DocumentFlowProps } from '@master/internal-site/components/document-types.ts'
|
|
4
|
+
|
|
5
|
+
export type { DocumentFlowStep, DocumentFlowProps } from '@master/internal-site/components/document-types.ts'
|
|
6
|
+
|
|
7
|
+
type Props = DocumentFlowProps
|
|
8
|
+
|
|
9
|
+
/** A static, ordered process; no timeline duration or interactive state is implied. */
|
|
10
|
+
const { title, steps, caption } = Astro.props
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
<figure class="ui-tray" aria-label={title}>
|
|
14
|
+
<figcaption class="ui-tray-head"><p class="ui-tray-title">{title}</p></figcaption>
|
|
15
|
+
<div class="ui-stage" data-padding="sm" data-align="start">
|
|
16
|
+
{/* Preserve WebKit list semantics when list-style is none. */}
|
|
17
|
+
<ol class="ui-steps" role="list">
|
|
18
|
+
{steps.map(step => <li>
|
|
19
|
+
<div>
|
|
20
|
+
<h4>{step.title}</h4>
|
|
21
|
+
<p>{step.description}</p>
|
|
22
|
+
</div>
|
|
23
|
+
</li>)}
|
|
24
|
+
</ol>
|
|
25
|
+
</div>
|
|
26
|
+
{caption && <p class="ui-tray-caption">{caption}</p>}
|
|
27
|
+
</figure>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { slotText } from '@master/internal-site/utils/slot-text'
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
/** The identifier; text children work too, as in `<DocumentIdentifier>{name}</DocumentIdentifier>`. */
|
|
6
|
+
text?: string
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/** Prefer identifier boundaries without inserting characters into copied text. */
|
|
10
|
+
const text = Astro.props.text ?? await slotText(Astro.slots) ?? ''
|
|
11
|
+
const parts = text.split(/(?<=[a-z0-9])(?=[A-Z])|(?<=[A-Z])(?=[A-Z][a-z])|(?<=[/_-])/)
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
{parts.map((part, index) => <Fragment>{index > 0 && <wbr />}{part}</Fragment>)}
|