@master/internal-site 0.2.4 → 0.2.6

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.
Files changed (46) hide show
  1. package/dist/astro.mjs +1842 -5
  2. package/dist/{localization-LfIbIysE.mjs → localization-IeZXkrNw.mjs} +11 -2
  3. package/dist/localization.mjs +1 -1
  4. package/package.json +9 -8
  5. package/src/astro/image-variants.ts +96 -0
  6. package/src/astro/index.ts +12 -3
  7. package/src/astro/site-translations.ts +31 -0
  8. package/src/astro/svelte-client.ts +13 -0
  9. package/src/demo/specimens/background-attachment.json +3 -3
  10. package/src/demo/specimens/background-origin.json +9 -9
  11. package/src/demo/specimens/clip-path.json +3 -3
  12. package/src/demo/specimens/counter-set.json +8 -8
  13. package/src/demo/specimens/filter.json +6 -6
  14. package/src/demo/specimens/grid-auto-flow.json +3 -3
  15. package/src/demo/specimens/grid-template-areas.json +5 -5
  16. package/src/demo/specimens/grid-template-columns.json +6 -6
  17. package/src/demo/specimens/justify-content.json +8 -8
  18. package/src/demo/specimens/mask-image.json +3 -3
  19. package/src/demo/specimens/object-position.json +6 -6
  20. package/src/demo/specimens/place-content.json +4 -4
  21. package/src/demo/specimens/scroll-snap-stop.json +3 -3
  22. package/src/demo/specimens/shape-margin.json +5 -5
  23. package/src/demo/specimens/shape-outside.json +3 -3
  24. package/src/demo/specimens/transform-origin.json +3 -3
  25. package/src/docs-shell/components/Image.svelte +7 -4
  26. package/src/docs-shell/components/SearchButton.svelte +5 -3
  27. package/src/docs-shell/components/SearchDialog.svelte +47 -161
  28. package/src/docs-shell/components/SearchDialogPanel.svelte +182 -0
  29. package/src/docs-shell/contexts/search.ts +8 -0
  30. package/src/docs-shell/contexts/theme-mode.svelte.ts +6 -1
  31. package/src/docs-shell/scripts/code.ts +9 -4
  32. package/src/docs-shell/site-dictionary.ts +36 -0
  33. package/src/docs-shell/types/StaticImage.ts +2 -0
  34. package/src/examples/components/ArticleTransitionScene.svelte +16 -14
  35. package/src/home/home-lamp.ts +35 -13
  36. package/src/home/icons/artwork/render-prerender-dark.webp +0 -0
  37. package/src/home/icons/artwork/render-prerender-light.webp +0 -0
  38. package/src/home/icons/artwork/source.json +6 -0
  39. package/src/home/icons/artwork.ts +3 -0
  40. package/src/home/icons/catalog.ts +9 -1
  41. package/src/home/icons/render-prerender.svg +12 -0
  42. package/src/layouts/Document.astro +24 -9
  43. package/src/scripts/atomic-class-authoring.ts +4 -1
  44. package/src/scripts/localization.ts +13 -4
  45. package/src/styles/blog-article.css +5 -4
  46. package/src/styles/system/DESIGN.md +1 -1
@@ -162,6 +162,16 @@ export async function sharedInterfaceKeys(sourceRoot = join(dirname(fileURLToPat
162
162
  return [...keys].sort()
163
163
  }
164
164
 
165
+ /**
166
+ * Shared copy and data modules can hold reader-facing prose that a translation mirrors.
167
+ * Shared components and compiled tooling cannot: their interface strings are reviewed
168
+ * through the localized dictionaries, so a rendering change must not mark every
169
+ * document that uses them as changed English source.
170
+ */
171
+ function isSharedSourceModule(path: string) {
172
+ return !/^dist\//.test(path) && !/\.(?:astro|svelte)$/.test(path) && !/\/common\/(?:translations|locales)\.[jt]s$/.test(path)
173
+ }
174
+
165
175
  /** Follow local prose/data modules without executing them or importing product compiler code. */
166
176
  export async function collectSourceDependencies(files: readonly string[], { siteRoot }: { siteRoot: string }): Promise<Record<string, string>> {
167
177
  const root = resolve(siteRoot)
@@ -171,15 +181,14 @@ export async function collectSourceDependencies(files: readonly string[], { site
171
181
  const visit = async (file: string) => {
172
182
  file = resolve(file).replace(/\.(tw|ja|ko|cn)\.mdx$/, '.mdx')
173
183
  if ((!file.startsWith(root + sep) && !file.startsWith(sharedRoot + sep)) || seen.has(file)) return
174
- // Localized dictionaries have their own review resource. Their translations
175
- // must not masquerade as a change to every article's English source.
176
- if (file.startsWith(sharedRoot + sep) && /\/common\/(?:translations|locales)\.[jt]s$/.test(file.replaceAll('\\', '/'))) return
184
+ if (file.startsWith(sharedRoot + sep) && !isSharedSourceModule(relative(sharedRoot, file).replaceAll('\\', '/'))) return
177
185
  seen.add(file)
178
186
  const source = await readFile(file, 'utf8').catch(() => undefined)
179
187
  if (source === undefined) return
180
188
  const key = file.startsWith(sharedRoot + sep) ? `@master/internal-site/${relative(sharedRoot, file)}` : relative(root, file)
181
189
  collected[key.replaceAll('\\', '/')] = source
182
- const imports = source.matchAll(/(?:\bfrom\s*|\bimport\s*(?:\(\s*)?)(['"])([^'"\n]+)\1/g)
190
+ // Type-only imports are erased before rendering and carry no reader-facing text.
191
+ const imports = source.replace(/\b(?:import|export)\s+type\b[^'";]*?\bfrom\s*(['"])[^'"\n]+\1/g, '').matchAll(/(?:\bfrom\s*|\bimport\s*(?:\(\s*)?)(['"])([^'"\n]+)\1/g)
183
192
  for (const [, , specifier] of imports) {
184
193
  if (!specifier.startsWith('.') && !specifier.startsWith('~/site/') && !specifier.startsWith('@master/internal-site/')) continue
185
194
  let target: string
@@ -313,12 +313,13 @@
313
313
  * clear of the rails and their rulers. Narrower (below a 1392px window), the contents disclosure the post places in
314
314
  * its text stands in.
315
315
  */
316
- .blog-article-contents {
316
+ /* The article owns visibility even when the shared .ui-toc stylesheet loads later. */
317
+ .blog-article-contents.ui-toc {
317
318
  display: none;
318
319
  }
319
320
 
320
321
  @container blog-article (width >= 80rem) {
321
- .blog-article-contents {
322
+ .blog-article-contents.ui-toc {
322
323
  /* Its ticks start on the header logo's edge, without the documentation rail's inset, so the titles keep their
323
324
  room beside the wide frame; air is kept before the left ruler (2rem outside the frame). The caption sits on
324
325
  the first line of text. */
@@ -366,7 +367,7 @@
366
367
  }
367
368
 
368
369
  @container blog-article (width >= 88rem) {
369
- .blog-article-contents {
370
+ .blog-article-contents.ui-toc {
370
371
  --air: 2.5rem;
371
372
  }
372
373
  }
@@ -613,7 +614,7 @@
613
614
  background: none;
614
615
  }
615
616
 
616
- .blog-article-contents,
617
+ .blog-article-contents.ui-toc,
617
618
  .blog-article-end,
618
619
  .blog-article-footer {
619
620
  display: none;
@@ -27,7 +27,7 @@ Pages load foundation → interface → documents → component styles in that o
27
27
 
28
28
  MDX imports only the Markdown mappings and built-in JSX components used by its transformed AST. The legacy `markdownComponents` export remains available to explicit consumers. Do not restore its blanket style side effects or substitute a runtime registry. Nested MDX keeps its own static imports.
29
29
 
30
- The shared Astro build integration flattens only unconditional same-directory compiler fragments, preserving order and repeated occurrences. Entries with unresolved imports stay intact. It combines adjacent plain stylesheet links only when their complete route usage is identical; foundation, interface and documents remain separate. Original assets remain available for JS references. This changes delivery, never progressive rendering, runtime or hydration.
30
+ The shared Astro build integration flattens only unconditional same-directory compiler fragments, preserving order and repeated occurrences. Entries with unresolved imports stay intact. It combines adjacent plain stylesheet links only when their complete route usage is identical; foundation, interface and documents remain separate. Original assets remain available for JS references. This changes delivery, never the pre-rendered Master CSS of a page.
31
31
 
32
32
  Use native classes for roles, tokens for shared semantic values, mixins for repeated declarations, and utilities for local decisions. Keep global native pruning disabled. Explicit opt-in currently covers `menu`, `logos`, `scroll` and `checks`; their finite native classes are present in shared sources. Product homepage rules opt in in the product repository, with full literal class maps for dynamic states. Other files retain native rules until their states and dependency closure can be proven. A package must opt in at its own source. Coverage alone cannot justify removing a rule.
33
33