@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
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Aoyue Design LLC.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,69 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @master/internal-site
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
First-party Astro and Svelte 5 website framework for Master websites. This package is public for installation; it is an internal platform, not a supported general-purpose product. Consumers pin an exact version and upgrade deliberately.
|
|
4
|
+
|
|
5
|
+
## Ownership
|
|
6
|
+
|
|
7
|
+
Master maintains document layouts, navigation, search, localization, MDX components, interface tokens, shared styles, artwork, demonstration primitives and design-system specimens here. Master CSS maintains its homepage composition, guide/reference content and adapters that read its product data. The organization blog, brand pages and design-system handbook live in the Master website, outside this package. Drafts are never packaged.
|
|
8
|
+
|
|
9
|
+
The package imports Master CSS rather than duplicating its compiler or maintaining a parallel CSS implementation. Install the matching Astro, Svelte, Vite and Master CSS toolchain versions declared by your site's lockfile. During RC development, use the exact source-pinned `site` snapshot and its dependency closure; never depend on a moving Git branch.
|
|
10
|
+
|
|
11
|
+
This initial release targets the CSS-first `site` snapshots, starting with `df48b35846c1`. Older npm RC releases do not provide that contract. The `0.0.0` peer alternative allows the product's unversioned development workspaces; published consumers must pin a validated snapshot of the complete toolchain.
|
|
12
|
+
|
|
13
|
+
## Configure a consumer
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
// astro.config.ts
|
|
17
|
+
import { defineConfig } from 'astro/config'
|
|
18
|
+
import masterSite from '@master/internal-site/astro'
|
|
19
|
+
import site from './site.config'
|
|
20
|
+
|
|
21
|
+
export default defineConfig({ integrations: [masterSite(site)] })
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
`site.config.ts` exports `defineSite(...)` from `@master/internal-site/config`. It declares the site's origin, content directory, app module, locale policy and section module URLs. Optional document layouts, category sources, styles and a server-only highlighter are also URLs. Keep route content lazy: do not import a complete page or specimen catalog into the configuration.
|
|
25
|
+
|
|
26
|
+
Optional `header.communityNavs` selects the links shown beside search without removing community links from the compact menu or footer. Set `header.searchOnHome` to show search in the desktop homepage header. When available, the language switch follows the community links and a divider.
|
|
27
|
+
|
|
28
|
+
The app module exports its logo component, navigation, version links and source/feedback URLs using the `SiteApp` contract. Consumers retain their own content and homepage composition. Ordinary documents use `content/<section>/<slug>/content.mdx` and `metadata.ts`; a local `page.astro` can override the generated entry. Dynamic routes enumerate params from lightweight `params.ts` files. The integration owns generated routes, page asset collection and the Astro/Svelte renderer setup.
|
|
29
|
+
|
|
30
|
+
```css
|
|
31
|
+
/* styles/globals.css */
|
|
32
|
+
@import '@master/css';
|
|
33
|
+
@reference '@master/internal-site/styles/foundation.css';
|
|
34
|
+
@import '@master/internal-site/styles/foundation.css';
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
The reference supplies definitions to headless tooling; the import delivers native styles. Import this stylesheet from the module configured as `styles.site`. Use the package's document/interface boundaries where the corresponding layouts need them. Do not combine every gallery stylesheet into a site-wide bundle.
|
|
38
|
+
|
|
39
|
+
The route loader delivers that foundation once for every page, including bare iframe examples. A bare section must not import a second global entry; it only opts out of the interface and document boundaries.
|
|
40
|
+
|
|
41
|
+
```astro
|
|
42
|
+
---
|
|
43
|
+
import Callout from '@master/internal-site/components/Callout.astro'
|
|
44
|
+
---
|
|
45
|
+
<Callout tone="info">Content remains in the product repository.</Callout>
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Import individual component subpaths, including `.astro` and `.svelte` extensions. Interactive Svelte islands use the consumer's Astro hydration directive. Shared theme/context data remains scoped to the rendered request. Components are distributed as source for the consumer's Astro and Svelte compilers; `astro` and `config` entrypoints are built Node ESM and include declarations.
|
|
49
|
+
|
|
50
|
+
## Subpaths
|
|
51
|
+
|
|
52
|
+
| Subpath | Purpose |
|
|
53
|
+
| --- | --- |
|
|
54
|
+
| `astro`, `config` | Integration and typed configuration |
|
|
55
|
+
| `components/*`, `layouts/*`, `contexts/*` | Document shell and reusable interface components |
|
|
56
|
+
| `styles/*` | Foundation, document, interface and component styles |
|
|
57
|
+
| `assets/*` | Shared fonts, icons and brand artwork |
|
|
58
|
+
| `home/*`, `blog/*` | Reusable homepage and article presentation |
|
|
59
|
+
| `demo/*`, `benchmarks/*`, `examples/*` | Presentation primitives and isolated example pages |
|
|
60
|
+
| `css/*` | Server-only Master CSS compiler/highlighter adapters and preset demonstrations |
|
|
61
|
+
| `env` | Virtual module declarations for a consumer's `env.d.ts` |
|
|
62
|
+
|
|
63
|
+
The CSS-specific subpaths require the matching optional compiler, tooling, schema, preset and language-service peers. Keep them out of browser-only imports. Shared public assets are served in development and copied into build output; consumer public files take precedence. No install hook writes consumer source files.
|
|
64
|
+
|
|
65
|
+
## Development and releases
|
|
66
|
+
|
|
67
|
+
From the Master repository, run `bun run build:packages`, `bun run --cwd packages/internal-site type-check` and `bun run --cwd packages/internal-site test`. Astro checks `.astro` implementations and Svelte checks interactive components separately. The root `build` builds the Node entrypoints before the site.
|
|
68
|
+
|
|
69
|
+
Before publishing, inspect the tarball, install it in the Master CSS consumer and validate both sites, including local CSS imports, themes, mobile navigation and lazy page styles. Publish an immutable version, update exact consumer pins and lockfiles, then deploy preview builds. Roll back by restoring the previous dependency version and deployment; do not unpublish a release in use.
|
package/dist/astro.d.mts
ADDED
package/dist/astro.mjs
ADDED
|
@@ -0,0 +1,510 @@
|
|
|
1
|
+
import { svgoOptimizer } from "astro/config";
|
|
2
|
+
import svelte from "@astrojs/svelte";
|
|
3
|
+
import mdx from "@astrojs/mdx";
|
|
4
|
+
import { unified } from "@astrojs/markdown-remark";
|
|
5
|
+
import masterCSS from "@master/css-astro";
|
|
6
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
7
|
+
import { dirname, extname, join, relative, resolve, sep } from "node:path";
|
|
8
|
+
import { cp, mkdir, readFile, readdir, unlink, writeFile } from "node:fs/promises";
|
|
9
|
+
import { createReadStream, existsSync } from "node:fs";
|
|
10
|
+
import { isCSSRequest, searchForWorkspaceRoot, transformWithOxc } from "vite";
|
|
11
|
+
import { optimize } from "svgo";
|
|
12
|
+
import Slugger from "github-slugger";
|
|
13
|
+
import { SKIP, visit } from "unist-util-visit";
|
|
14
|
+
import { parse, parseExpressionAt } from "acorn";
|
|
15
|
+
// src/astro/module-id.ts
|
|
16
|
+
/** A Vite module id without its query or hash. */
|
|
17
|
+
function cleanId(id) {
|
|
18
|
+
return id.replace(/[?#].*$/, "");
|
|
19
|
+
}
|
|
20
|
+
// src/astro/source-url.ts
|
|
21
|
+
const sourcePattern = /\.(?:[cm]?[jt]sx?|mdx|astro|svelte)$/;
|
|
22
|
+
/**
|
|
23
|
+
* Server chunks only run on the machine that builds the static site. Keep each
|
|
24
|
+
* module's source `import.meta.url` so site code and bundled dependencies resolve
|
|
25
|
+
* repository files, data files and native bindings relative to their sources.
|
|
26
|
+
*/
|
|
27
|
+
function sourceURL() {
|
|
28
|
+
return {
|
|
29
|
+
name: "master-css-site:source-url",
|
|
30
|
+
applyToEnvironment: (environment) => environment.config.consumer === "server",
|
|
31
|
+
transform(code, id) {
|
|
32
|
+
const file = cleanId(id);
|
|
33
|
+
if (id.startsWith("\0") || !file.startsWith("/") || !sourcePattern.test(file) || !code.includes("import.meta.url")) return;
|
|
34
|
+
return {
|
|
35
|
+
code: code.replaceAll("import.meta.url", JSON.stringify(pathToFileURL(file).href)),
|
|
36
|
+
map: null
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
// src/astro/content-pages.ts
|
|
42
|
+
async function contentFiles(directory) {
|
|
43
|
+
const files = [];
|
|
44
|
+
for (const entry of await readdir(directory, { withFileTypes: true })) {
|
|
45
|
+
const path = join(directory, entry.name);
|
|
46
|
+
if (entry.isDirectory()) files.push(...await contentFiles(path));
|
|
47
|
+
else if (entry.isFile()) files.push(path);
|
|
48
|
+
}
|
|
49
|
+
return files;
|
|
50
|
+
}
|
|
51
|
+
const specifier = (url) => JSON.stringify("/@fs/" + fileURLToPath(url));
|
|
52
|
+
/** Generate only ordinary MDX wrappers; content and metadata remain statically imported. */
|
|
53
|
+
async function prepareContentPages(site, root, contentPrefix) {
|
|
54
|
+
const content = fileURLToPath(site.content);
|
|
55
|
+
const files = new Set(await contentFiles(content));
|
|
56
|
+
const destination = join(root, ".astro/master-site/pages");
|
|
57
|
+
const pages = {};
|
|
58
|
+
const wanted = /* @__PURE__ */ new Set();
|
|
59
|
+
for (const file of files) {
|
|
60
|
+
if (!file.endsWith("/content.mdx")) continue;
|
|
61
|
+
const directory = dirname(file);
|
|
62
|
+
if (files.has(join(directory, "page.astro"))) continue;
|
|
63
|
+
const metadata = join(directory, "metadata.ts");
|
|
64
|
+
if (!files.has(metadata)) throw new Error(`${file} requires metadata.ts or an explicit page.astro`);
|
|
65
|
+
const route = relative(content, directory).replaceAll("\\", "/");
|
|
66
|
+
const section = route.split("/").find((segment) => !/^\(.+\)$/.test(segment)) ?? "home";
|
|
67
|
+
const config = site.documents?.[section];
|
|
68
|
+
if (!config) throw new Error(`${file} requires documents.${section} configuration or an explicit page.astro`);
|
|
69
|
+
const output = join(destination, route, "page.astro");
|
|
70
|
+
const source = `---
|
|
71
|
+
// Generated by @master/internal-site; edit the content or site config.
|
|
72
|
+
import Page from '@master/internal-site/factories/Page.astro'
|
|
73
|
+
import { createPageMetadata } from '@master/internal-site/factories/create-page'
|
|
74
|
+
import Layout from ${specifier(config.layout)}
|
|
75
|
+
import dictionaries from ${specifier(config.dictionaries)}
|
|
76
|
+
import metadata from ${specifier(pathToFileURL(metadata))}
|
|
77
|
+
import * as content from ${specifier(pathToFileURL(file))}
|
|
78
|
+
${config.categories ? `import categories from ${specifier(config.categories)}` : "const categories = undefined"}
|
|
79
|
+
export const generateMetadata = createPageMetadata(metadata, dictionaries)
|
|
80
|
+
---
|
|
81
|
+
<Page {...Astro.props} {metadata} {dictionaries} {categories} {content} {Layout} />
|
|
82
|
+
`;
|
|
83
|
+
await mkdir(dirname(output), { recursive: true });
|
|
84
|
+
if (await readFile(output, "utf8").catch(() => "") !== source) await writeFile(output, source);
|
|
85
|
+
wanted.add(output);
|
|
86
|
+
pages[`${contentPrefix}/${route ? route + "/" : ""}page.astro`] = pathToFileURL(output);
|
|
87
|
+
}
|
|
88
|
+
for (const stale of await contentFiles(destination).catch(() => [])) if (stale.endsWith("/page.astro") && !wanted.has(stale)) await unlink(stale);
|
|
89
|
+
const availableLocales = {};
|
|
90
|
+
for (const file of files) {
|
|
91
|
+
if (!file.endsWith("/content.mdx")) continue;
|
|
92
|
+
const directory = dirname(file);
|
|
93
|
+
const route = relative(content, directory).replaceAll("\\", "/");
|
|
94
|
+
const section = route.split("/").find((segment) => !/^\(.+\)$/.test(segment)) ?? "home";
|
|
95
|
+
if (!site.i18n.translatedOnly?.includes(section)) continue;
|
|
96
|
+
availableLocales[`${contentPrefix}/${route ? route + "/" : ""}page.astro`] = site.i18n.locales.filter((locale) => locale === site.i18n.defaultLocale || files.has(join(directory, `content.${locale}.mdx`)));
|
|
97
|
+
}
|
|
98
|
+
for (const section of site.i18n.translatedOnly ?? []) {
|
|
99
|
+
const key = `${contentPrefix}/${section}/page.astro`;
|
|
100
|
+
if (!files.has(join(content, section, "page.astro"))) continue;
|
|
101
|
+
const published = Object.entries(availableLocales).filter(([page]) => page.startsWith(`${contentPrefix}/${section}/`));
|
|
102
|
+
availableLocales[key] = site.i18n.locales.filter((locale) => locale === site.i18n.defaultLocale || published.some(([, locales]) => locales.includes(locale)));
|
|
103
|
+
}
|
|
104
|
+
return {
|
|
105
|
+
pages,
|
|
106
|
+
availableLocales
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
// src/astro/server-styles.ts
|
|
110
|
+
const empty = "\0site-server-style";
|
|
111
|
+
/**
|
|
112
|
+
* Pages link the stylesheets of every module they render on the server. Hydrated
|
|
113
|
+
* modules repeat those imports in the browser bundle, where Astro would attach
|
|
114
|
+
* them to every page of the route, so the client build omits site stylesheets.
|
|
115
|
+
* Development keeps them for Vite's CSS hot updates.
|
|
116
|
+
*/
|
|
117
|
+
function serverStyles(roots) {
|
|
118
|
+
return {
|
|
119
|
+
name: "master-css-site:server-styles",
|
|
120
|
+
enforce: "pre",
|
|
121
|
+
apply: "build",
|
|
122
|
+
applyToEnvironment: (environment) => environment.config.consumer === "client",
|
|
123
|
+
resolveId(source, importer) {
|
|
124
|
+
if (!importer || importer.startsWith("\0") || !roots.some((root) => cleanId(importer).startsWith(root.replace(/\/$/, "") + "/")) || isCSSRequest(cleanId(importer))) return;
|
|
125
|
+
if (isCSSRequest(source) && !/[?&](?:inline|raw|url)\b/.test(source)) return empty;
|
|
126
|
+
},
|
|
127
|
+
load(id) {
|
|
128
|
+
if (id === empty) return "export default undefined";
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
// src/docs-shell/common/svgo.config.js
|
|
133
|
+
var svgo_config_default = { plugins: [
|
|
134
|
+
{ name: "preset-default" },
|
|
135
|
+
"removeTitle",
|
|
136
|
+
"prefixIds"
|
|
137
|
+
] };
|
|
138
|
+
// src/astro/svg-markup.ts
|
|
139
|
+
/**
|
|
140
|
+
* `.svg?raw` imports give Svelte components inline SVG markup. Optimize it like Astro's SVG
|
|
141
|
+
* components, with the same configuration, so both render the same markup and file-prefixed ids.
|
|
142
|
+
*/
|
|
143
|
+
function svgMarkup() {
|
|
144
|
+
return {
|
|
145
|
+
name: "master-css-site:svg-markup",
|
|
146
|
+
enforce: "pre",
|
|
147
|
+
async load(id) {
|
|
148
|
+
if (!/\.svg\?raw$/.test(id)) return;
|
|
149
|
+
const file = cleanId(id);
|
|
150
|
+
this.addWatchFile(file);
|
|
151
|
+
const { data } = optimize(await readFile(file, "utf8"), {
|
|
152
|
+
...svgo_config_default,
|
|
153
|
+
path: file
|
|
154
|
+
});
|
|
155
|
+
return `export default ${JSON.stringify(data)}`;
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
// src/docs-shell/utils/resolve-heading.js
|
|
160
|
+
function resolveHeading(title, id) {
|
|
161
|
+
const explicit = typeof title === "string" && title.match(/\s+\{#([\w-]+)\}$/);
|
|
162
|
+
if (explicit) {
|
|
163
|
+
title = title.slice(0, explicit.index);
|
|
164
|
+
id = explicit[1];
|
|
165
|
+
}
|
|
166
|
+
const words = title?.split?.(" ");
|
|
167
|
+
if (words?.pop() === "[sr-only]") return {
|
|
168
|
+
title: words.join(" "),
|
|
169
|
+
id: id?.replace("-sr-only", "")?.replace("-[sr-only]", ""),
|
|
170
|
+
className: "sr-only"
|
|
171
|
+
};
|
|
172
|
+
return {
|
|
173
|
+
title,
|
|
174
|
+
id
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
// src/docs-shell/remark/slug-and-toc.js
|
|
178
|
+
function remarkSlugAndTOC() {
|
|
179
|
+
return (tree) => {
|
|
180
|
+
const slugs = new Slugger();
|
|
181
|
+
const toc = [];
|
|
182
|
+
visit(tree, "heading", (node) => {
|
|
183
|
+
const depth = node.depth;
|
|
184
|
+
if (depth !== 2 && depth !== 3) return;
|
|
185
|
+
const title = node.children.filter((n) => n.type === "text" || n.type === "inlineCode").map((n) => n.value).join(" ").trim();
|
|
186
|
+
const resolved = resolveHeading(title, slugs.slug(title));
|
|
187
|
+
const lastText = node.children.findLast((child) => child.type === "text");
|
|
188
|
+
if (lastText) lastText.value = lastText.value.replace(/\s+\{#[\w-]+\}$/, "");
|
|
189
|
+
node.data ??= {};
|
|
190
|
+
node.data.hProperties ??= {};
|
|
191
|
+
node.data.id = resolved.id;
|
|
192
|
+
node.data.hProperties.id = resolved.id;
|
|
193
|
+
toc.push({
|
|
194
|
+
id: resolved.id,
|
|
195
|
+
title: resolved.title,
|
|
196
|
+
level: depth
|
|
197
|
+
});
|
|
198
|
+
});
|
|
199
|
+
const tocCode = `export const toc = ${JSON.stringify(toc, null, 2)};`;
|
|
200
|
+
tree.children.unshift({
|
|
201
|
+
type: "mdxjsEsm",
|
|
202
|
+
value: tocCode,
|
|
203
|
+
data: { estree: parse(tocCode, {
|
|
204
|
+
ecmaVersion: "latest",
|
|
205
|
+
sourceType: "module"
|
|
206
|
+
}) }
|
|
207
|
+
});
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
// src/docs-shell/remark/markdown-components.js
|
|
211
|
+
/** Paragraph markers that turn a Markdown paragraph into a callout or a gesture hint. */
|
|
212
|
+
const paragraphMarkers = [
|
|
213
|
+
["(o) ", "Do"],
|
|
214
|
+
["(x) ", "DoNot"],
|
|
215
|
+
["(i) ", "Info"],
|
|
216
|
+
["(!) ", "Warn"],
|
|
217
|
+
[
|
|
218
|
+
"(!|) ",
|
|
219
|
+
"Warn",
|
|
220
|
+
{ leaded: true }
|
|
221
|
+
],
|
|
222
|
+
[
|
|
223
|
+
"(hover) ",
|
|
224
|
+
"InteractingIndicator",
|
|
225
|
+
{ icon: "hover" }
|
|
226
|
+
],
|
|
227
|
+
[
|
|
228
|
+
"(resize) ",
|
|
229
|
+
"InteractingIndicator",
|
|
230
|
+
{ icon: "resize" }
|
|
231
|
+
],
|
|
232
|
+
[
|
|
233
|
+
"(click) ",
|
|
234
|
+
"InteractingIndicator",
|
|
235
|
+
{ icon: "click" }
|
|
236
|
+
],
|
|
237
|
+
[
|
|
238
|
+
"(type) ",
|
|
239
|
+
"InteractingIndicator",
|
|
240
|
+
{ icon: "type" }
|
|
241
|
+
],
|
|
242
|
+
[
|
|
243
|
+
"(wand) ",
|
|
244
|
+
"InteractingIndicator",
|
|
245
|
+
{ icon: "wand" }
|
|
246
|
+
]
|
|
247
|
+
];
|
|
248
|
+
/** Inline code may lead with its grammar, as in `html <div>`. */
|
|
249
|
+
const inlineLanguages = /* @__PURE__ */ new Set([
|
|
250
|
+
"html",
|
|
251
|
+
"js",
|
|
252
|
+
"ts",
|
|
253
|
+
"css",
|
|
254
|
+
"json",
|
|
255
|
+
"mcss"
|
|
256
|
+
]);
|
|
257
|
+
function attribute(name, value) {
|
|
258
|
+
if (typeof value === "string") return {
|
|
259
|
+
type: "mdxJsxAttribute",
|
|
260
|
+
name,
|
|
261
|
+
value
|
|
262
|
+
};
|
|
263
|
+
const source = JSON.stringify(value);
|
|
264
|
+
return {
|
|
265
|
+
type: "mdxJsxAttribute",
|
|
266
|
+
name,
|
|
267
|
+
value: {
|
|
268
|
+
type: "mdxJsxAttributeValueExpression",
|
|
269
|
+
value: source,
|
|
270
|
+
data: { estree: {
|
|
271
|
+
type: "Program",
|
|
272
|
+
sourceType: "module",
|
|
273
|
+
body: [{
|
|
274
|
+
type: "ExpressionStatement",
|
|
275
|
+
expression: parseExpressionAt(source, 0, { ecmaVersion: "latest" })
|
|
276
|
+
}]
|
|
277
|
+
} }
|
|
278
|
+
}
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
function element(type, name, props, children = []) {
|
|
282
|
+
return {
|
|
283
|
+
type,
|
|
284
|
+
name,
|
|
285
|
+
attributes: Object.entries(props).filter(([, value]) => value !== void 0).map(([key, value]) => attribute(key, value)),
|
|
286
|
+
children
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
/** Fence meta reads as URL parameters whose values may be JSON, as in ```html name=index.html beautify=true. */
|
|
290
|
+
function fenceProps(node) {
|
|
291
|
+
const props = {
|
|
292
|
+
name: "",
|
|
293
|
+
lang: "",
|
|
294
|
+
dedent: "block"
|
|
295
|
+
};
|
|
296
|
+
if (node.meta) for (const [key, value] of new URLSearchParams(node.meta.trim())) try {
|
|
297
|
+
props[key] = JSON.parse(value);
|
|
298
|
+
} catch {
|
|
299
|
+
props[key] = value;
|
|
300
|
+
}
|
|
301
|
+
if (!props.lang) props.lang = node.lang ?? "";
|
|
302
|
+
return props;
|
|
303
|
+
}
|
|
304
|
+
const componentsExport = `import { markdownComponents as __markdownComponents } from '@master/internal-site/components/markdown-components'
|
|
305
|
+
export const components = __markdownComponents`;
|
|
306
|
+
/**
|
|
307
|
+
* Markdown constructs that render through site components: fences become `Code` (or a
|
|
308
|
+
* package-manager `PMAction`), inline code becomes `InlineCode`, and marked paragraphs become
|
|
309
|
+
* callouts. Every MDX module exports the site's `components`, so imported MDX renders the same way.
|
|
310
|
+
*/
|
|
311
|
+
function remarkMarkdownComponents() {
|
|
312
|
+
return (tree) => {
|
|
313
|
+
tree.children.unshift({
|
|
314
|
+
type: "mdxjsEsm",
|
|
315
|
+
value: componentsExport,
|
|
316
|
+
data: { estree: parse(componentsExport, {
|
|
317
|
+
ecmaVersion: "latest",
|
|
318
|
+
sourceType: "module"
|
|
319
|
+
}) }
|
|
320
|
+
});
|
|
321
|
+
visit(tree, (node, index, parent) => {
|
|
322
|
+
if (!parent || index === void 0) return;
|
|
323
|
+
if (node.type === "code") {
|
|
324
|
+
const props = fenceProps(node);
|
|
325
|
+
const code = node.value ? node.value + "\n" : "";
|
|
326
|
+
parent.children[index] = props.lang === "bash" && props.action ? element("mdxJsxFlowElement", "PMAction", {
|
|
327
|
+
action: props.action,
|
|
328
|
+
code: node.value
|
|
329
|
+
}) : element("mdxJsxFlowElement", "Code", {
|
|
330
|
+
...props,
|
|
331
|
+
code
|
|
332
|
+
});
|
|
333
|
+
return SKIP;
|
|
334
|
+
}
|
|
335
|
+
if (node.type === "inlineCode") {
|
|
336
|
+
const [first, ...rest] = node.value.split(" ");
|
|
337
|
+
const lang = rest.length && inlineLanguages.has(first) ? first : "";
|
|
338
|
+
parent.children[index] = element("mdxJsxTextElement", "InlineCode", {
|
|
339
|
+
lang,
|
|
340
|
+
code: lang ? rest.join(" ") : node.value
|
|
341
|
+
});
|
|
342
|
+
return SKIP;
|
|
343
|
+
}
|
|
344
|
+
if (node.type === "paragraph") {
|
|
345
|
+
const first = node.children[0];
|
|
346
|
+
if (first?.type !== "text") return;
|
|
347
|
+
const marker = paragraphMarkers.find(([prefix]) => first.value.startsWith(prefix));
|
|
348
|
+
if (!marker) return;
|
|
349
|
+
const [prefix, name, props = {}] = marker;
|
|
350
|
+
first.value = first.value.slice(prefix.length);
|
|
351
|
+
parent.children[index] = element("mdxJsxFlowElement", name, props, node.children);
|
|
352
|
+
return index;
|
|
353
|
+
}
|
|
354
|
+
});
|
|
355
|
+
};
|
|
356
|
+
}
|
|
357
|
+
// src/astro/index.ts
|
|
358
|
+
const packageSource = fileURLToPath(new URL("..", new URL("../src/astro/index.ts", import.meta.url).href));
|
|
359
|
+
const fsImport = (url) => "/@fs/" + fileURLToPath(url);
|
|
360
|
+
const moduleImport = (url) => `export { default } from ${JSON.stringify(fsImport(url))}`;
|
|
361
|
+
const propagated = (url) => `() => import(${JSON.stringify(fsImport(url) + "?astroPropagatedAssets")}).then(m => m.default)`;
|
|
362
|
+
function masterSite(site) {
|
|
363
|
+
let output;
|
|
364
|
+
return {
|
|
365
|
+
name: "@master/internal-site",
|
|
366
|
+
hooks: {
|
|
367
|
+
"astro:config:setup": async ({ config, updateConfig, addRenderer, injectRoute }) => {
|
|
368
|
+
const root = fileURLToPath(config.root);
|
|
369
|
+
const contentRelative = relative(root, fileURLToPath(site.content)).split(sep).join("/");
|
|
370
|
+
if (contentRelative.startsWith("..")) throw new Error("Site content must be inside the Astro project root");
|
|
371
|
+
const contentPrefix = "/" + contentRelative.replace(/\/$/, "");
|
|
372
|
+
const prepared = await prepareContentPages(site, root, contentPrefix);
|
|
373
|
+
const routeOptions = {
|
|
374
|
+
contentRoot: contentPrefix + "/",
|
|
375
|
+
defaultLocale: site.i18n.defaultLocale,
|
|
376
|
+
locales: site.i18n.locales,
|
|
377
|
+
sectionLocales: site.i18n.sectionLocales,
|
|
378
|
+
availableLocales: prepared.availableLocales
|
|
379
|
+
};
|
|
380
|
+
const imports = {
|
|
381
|
+
"virtual:master-site/navigation": Object.entries(site.navigation ?? {}).map(([key, url], index) => `import data${index} from ${JSON.stringify(fsImport(url))}`).join("\n") + `\nexport default {${Object.keys(site.navigation ?? {}).map((key, index) => `${JSON.stringify(key)}: data${index}`).join(",")}}`,
|
|
382
|
+
"virtual:master-site/config": `export default ${JSON.stringify(site)}`,
|
|
383
|
+
"virtual:master-site/app": moduleImport(site.app),
|
|
384
|
+
"virtual:master-site/highlight": moduleImport(site.highlighter ?? new URL("../docs-shell/utils/highlight-code-core.ts", new URL("../src/astro/index.ts", import.meta.url).href)),
|
|
385
|
+
"virtual:master-site/translations": `export default import.meta.glob(${JSON.stringify(`${contentPrefix}/**/content.*.mdx`)})`
|
|
386
|
+
};
|
|
387
|
+
const plugin = {
|
|
388
|
+
name: "@master/internal-site:modules",
|
|
389
|
+
resolveId(id) {
|
|
390
|
+
if (id === "virtual:master-site/routes") return "\0" + id + ".ts";
|
|
391
|
+
if (id in imports) return "\0" + id;
|
|
392
|
+
},
|
|
393
|
+
async load(id) {
|
|
394
|
+
if (id.slice(1) in imports) return imports[id.slice(1)];
|
|
395
|
+
if (id !== "\0virtual:master-site/routes.ts") return;
|
|
396
|
+
let source = await readFile(new URL("./routes.template.ts", new URL("../src/astro/index.ts", import.meta.url).href), "utf8");
|
|
397
|
+
source = source.replaceAll("__CONTENT_PREFIX__", contentPrefix);
|
|
398
|
+
source = source.replace("__ROUTE_OPTIONS__", JSON.stringify(routeOptions));
|
|
399
|
+
source = source.replace("__GENERATED_PAGES__", `{${Object.entries(prepared.pages).map(([name, url]) => `${JSON.stringify(name)}: ${propagated(url)}`).join(",\n")}}`);
|
|
400
|
+
const sections = Object.entries(site.sections).map(([name, url]) => `${JSON.stringify(`/sections/${name}.astro`)}: ${propagated(url)}`).join(",\n");
|
|
401
|
+
source = source.replace("__SECTION_IMPORTS__", `{${sections}}`);
|
|
402
|
+
for (const boundary of [
|
|
403
|
+
"site",
|
|
404
|
+
"interface",
|
|
405
|
+
"documents"
|
|
406
|
+
]) {
|
|
407
|
+
const url = site.styles?.[boundary] ?? new URL(`../styles/${boundary}.ts`, new URL("../src/astro/index.ts", import.meta.url).href);
|
|
408
|
+
source = source.replace(`__${boundary.toUpperCase()}_IMPORT__`, `{${JSON.stringify(`/styles/${boundary}.ts`)}: ${propagated(url)}}`);
|
|
409
|
+
}
|
|
410
|
+
source = source.replace("__SECTION_SHELLS__", JSON.stringify(Object.fromEntries(Object.keys(site.sections).map((key) => [key, key]))));
|
|
411
|
+
return transformWithOxc(source, "master-site-routes.ts");
|
|
412
|
+
},
|
|
413
|
+
configureServer(server) {
|
|
414
|
+
const routeFile = /(?:^|\/)(?:content(?:\.[^/]+)?\.mdx|metadata\.ts|page\.astro|params\.ts|layout\.astro)$/;
|
|
415
|
+
let restart;
|
|
416
|
+
const refresh = (file) => {
|
|
417
|
+
if (!file.startsWith(fileURLToPath(site.content)) || !routeFile.test(file.replaceAll("\\", "/"))) return;
|
|
418
|
+
clearTimeout(restart);
|
|
419
|
+
restart = setTimeout(() => {
|
|
420
|
+
server.restart();
|
|
421
|
+
}, 100);
|
|
422
|
+
};
|
|
423
|
+
server.watcher.on("add", refresh).on("unlink", refresh);
|
|
424
|
+
server.httpServer?.once("close", () => {
|
|
425
|
+
clearTimeout(restart);
|
|
426
|
+
server.watcher.off("add", refresh).off("unlink", refresh);
|
|
427
|
+
});
|
|
428
|
+
server.middlewares.use((request, response, next) => {
|
|
429
|
+
let pathname;
|
|
430
|
+
try {
|
|
431
|
+
pathname = decodeURIComponent(new URL(request.url ?? "/", "http://localhost").pathname);
|
|
432
|
+
} catch {
|
|
433
|
+
return next();
|
|
434
|
+
}
|
|
435
|
+
if (!/^\/(fonts|icons|images|brand|demo)\//.test(pathname)) return next();
|
|
436
|
+
const directory = resolve(packageSource, "public") + sep;
|
|
437
|
+
const file = resolve(directory, "." + pathname);
|
|
438
|
+
if (!file.startsWith(directory) || !existsSync(file) || existsSync(resolve(root, "public", "." + pathname))) return next();
|
|
439
|
+
const type = {
|
|
440
|
+
".woff2": "font/woff2",
|
|
441
|
+
".ttf": "font/ttf",
|
|
442
|
+
".css": "text/css",
|
|
443
|
+
".svg": "image/svg+xml",
|
|
444
|
+
".png": "image/png",
|
|
445
|
+
".jpg": "image/jpeg",
|
|
446
|
+
".webp": "image/webp",
|
|
447
|
+
".ico": "image/x-icon",
|
|
448
|
+
".json": "application/json"
|
|
449
|
+
}[extname(file)];
|
|
450
|
+
if (!type) return next();
|
|
451
|
+
response.setHeader("Content-Type", type);
|
|
452
|
+
createReadStream(file).pipe(response);
|
|
453
|
+
});
|
|
454
|
+
}
|
|
455
|
+
};
|
|
456
|
+
addRenderer({
|
|
457
|
+
name: "@master/internal-site:svelte",
|
|
458
|
+
serverEntrypoint: fileURLToPath(new URL("./svelte-renderer.ts", new URL("../src/astro/index.ts", import.meta.url).href)),
|
|
459
|
+
clientEntrypoint: "@astrojs/svelte/client.js"
|
|
460
|
+
});
|
|
461
|
+
injectRoute({
|
|
462
|
+
pattern: "/[...path]",
|
|
463
|
+
entrypoint: new URL("./Page.astro", new URL("../src/astro/index.ts", import.meta.url).href),
|
|
464
|
+
prerender: true
|
|
465
|
+
});
|
|
466
|
+
updateConfig({
|
|
467
|
+
site: site.origin,
|
|
468
|
+
trailingSlash: "never",
|
|
469
|
+
build: { format: "file" },
|
|
470
|
+
markdown: {
|
|
471
|
+
processor: unified({
|
|
472
|
+
remarkPlugins: [remarkSlugAndTOC, remarkMarkdownComponents],
|
|
473
|
+
gfm: true,
|
|
474
|
+
smartypants: false
|
|
475
|
+
}),
|
|
476
|
+
syntaxHighlight: false
|
|
477
|
+
},
|
|
478
|
+
experimental: { svgOptimizer: svgoOptimizer(svgo_config_default) },
|
|
479
|
+
vite: {
|
|
480
|
+
plugins: [
|
|
481
|
+
plugin,
|
|
482
|
+
sourceURL(),
|
|
483
|
+
serverStyles([root, packageSource]),
|
|
484
|
+
svgMarkup()
|
|
485
|
+
],
|
|
486
|
+
resolve: { dedupe: ["svelte"] },
|
|
487
|
+
server: { fs: { allow: [searchForWorkspaceRoot(root), packageSource] } }
|
|
488
|
+
},
|
|
489
|
+
integrations: [
|
|
490
|
+
svelte(),
|
|
491
|
+
mdx(),
|
|
492
|
+
masterCSS({ mode: "progressive" })
|
|
493
|
+
]
|
|
494
|
+
});
|
|
495
|
+
},
|
|
496
|
+
"astro:config:done": ({ config }) => {
|
|
497
|
+
output = config.outDir;
|
|
498
|
+
},
|
|
499
|
+
"astro:build:done": async () => {
|
|
500
|
+
const destination = output;
|
|
501
|
+
await mkdir(destination, { recursive: true });
|
|
502
|
+
await cp(new URL("../public/", new URL("../src/astro/index.ts", import.meta.url).href), destination, {
|
|
503
|
+
recursive: true,
|
|
504
|
+
force: false
|
|
505
|
+
});
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
};
|
|
509
|
+
}
|
|
510
|
+
export { masterSite as default };
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { Component } from "svelte";
|
|
2
|
+
export interface AppNavItem {
|
|
3
|
+
name: string;
|
|
4
|
+
href?: string;
|
|
5
|
+
fullName?: string;
|
|
6
|
+
date?: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
Icon?: Component<any>;
|
|
9
|
+
}
|
|
10
|
+
export interface SiteApp {
|
|
11
|
+
name: string;
|
|
12
|
+
brandURL: string;
|
|
13
|
+
Logotype: Component<any>;
|
|
14
|
+
navs: AppNavItem[];
|
|
15
|
+
communityNavs?: AppNavItem[];
|
|
16
|
+
/** Header controls can be quieter than the full community menu and footer. */
|
|
17
|
+
header?: {
|
|
18
|
+
communityNavs?: AppNavItem[];
|
|
19
|
+
searchOnHome?: boolean;
|
|
20
|
+
};
|
|
21
|
+
sourceBaseURL?: string;
|
|
22
|
+
feedbackURL?: string;
|
|
23
|
+
versions: {
|
|
24
|
+
name: string;
|
|
25
|
+
href: string;
|
|
26
|
+
}[];
|
|
27
|
+
}
|
|
28
|
+
export interface SiteI18nConfig {
|
|
29
|
+
defaultLocale: string;
|
|
30
|
+
locales: readonly string[];
|
|
31
|
+
hreflangOfLocale: Record<string, string>;
|
|
32
|
+
nameOfLocale: Record<string, string>;
|
|
33
|
+
localizablePathnameRoots: string[];
|
|
34
|
+
translations: Record<string, Record<string, string>>;
|
|
35
|
+
sectionLocales?: Record<string, readonly string[]>;
|
|
36
|
+
/** These sections emit translated URLs only when translated MDX exists. */
|
|
37
|
+
translatedOnly?: readonly string[];
|
|
38
|
+
}
|
|
39
|
+
export interface DocumentConfig {
|
|
40
|
+
layout: URL;
|
|
41
|
+
dictionaries: URL;
|
|
42
|
+
categories?: URL;
|
|
43
|
+
}
|
|
44
|
+
/** Configuration contains module URLs, not imported page components, to preserve lazy routes. */
|
|
45
|
+
export interface SiteConfig {
|
|
46
|
+
id: string;
|
|
47
|
+
name: string;
|
|
48
|
+
origin: string;
|
|
49
|
+
content: URL;
|
|
50
|
+
app: URL;
|
|
51
|
+
i18n: SiteI18nConfig;
|
|
52
|
+
sections: Record<string, URL>;
|
|
53
|
+
feeds?: {
|
|
54
|
+
title: string;
|
|
55
|
+
type: 'application/rss+xml' | 'application/atom+xml';
|
|
56
|
+
href: string;
|
|
57
|
+
}[];
|
|
58
|
+
documents?: Record<string, DocumentConfig>;
|
|
59
|
+
/** Server-only category sources, keyed by section. */
|
|
60
|
+
navigation?: Record<string, URL>;
|
|
61
|
+
/** Server module exporting a highlighter. Product semantic integrations live here. */
|
|
62
|
+
highlighter?: URL;
|
|
63
|
+
styles?: {
|
|
64
|
+
site?: URL;
|
|
65
|
+
interface?: URL;
|
|
66
|
+
documents?: URL;
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
export declare function defineSite(config: SiteConfig): SiteConfig;
|