@thebuilder/umbraco-docs 1.1.0 → 1.3.0

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.
@@ -0,0 +1,42 @@
1
+ import { validateUmbracoPackage } from "./package.js";
2
+ import { isRecord } from "./validation.js";
3
+ export const DEFAULT_REGISTRY_URL = "https://umbraco.thebuilder.dk/packages.json";
4
+ /**
5
+ * Reads the package list the hub publishes, for "related packages" sections.
6
+ * A docs build should never fail because the hub is down, so any problem is
7
+ * logged and the fallback is returned instead. Entries that fail validation
8
+ * are skipped one by one.
9
+ */
10
+ export async function loadUmbracoPackages(options = {}) {
11
+ const { url = DEFAULT_REGISTRY_URL, fallback = [], timeoutMs = 10_000 } = options;
12
+ const warn = (reason) => console.warn(`[umbraco-docs] Could not load packages from ${url}: ${reason}`);
13
+ let payload;
14
+ try {
15
+ const response = await fetch(url, { signal: AbortSignal.timeout(timeoutMs) });
16
+ if (!response.ok) {
17
+ warn(`HTTP ${response.status}`);
18
+ return [...fallback];
19
+ }
20
+ payload = await response.json();
21
+ }
22
+ catch (error) {
23
+ warn(error instanceof Error ? error.message : String(error));
24
+ return [...fallback];
25
+ }
26
+ if (!isRecord(payload) || payload.version !== 1 || !Array.isArray(payload.packages)) {
27
+ warn("expected a version 1 registry with a packages array");
28
+ return [...fallback];
29
+ }
30
+ const packages = [];
31
+ for (const entry of payload.packages) {
32
+ try {
33
+ packages.push(validateUmbracoPackage(entry));
34
+ }
35
+ catch (error) {
36
+ const id = isRecord(entry) && typeof entry.id === "string" ? entry.id : "unknown";
37
+ console.warn(`[umbraco-docs] Skipping package ${id} from ${url}: ${error instanceof Error ? error.message : String(error)}`);
38
+ }
39
+ }
40
+ return packages;
41
+ }
42
+ //# sourceMappingURL=registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.js","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAuB,MAAM,cAA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QAC5D,OAAO,CAAC,GAAG,QAAQ,CAAC,CAAC;IACvB,CAAC;IAED,MAAM,QAAQ,GAAqB,EAAE,CAAC;IACtC,KAAK,MAAM,KAAK,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;QACrC,IAAI,CAAC;YACH,QAAQ,CAAC,IAAI,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC,CAAC;QAC/C,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,EAAE,GAAG,QAAQ,CAAC,KAAK,CAAC,IAAI,OAAO,KAAK,CAAC,EAAE,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;YAClF,OAAO,CAAC,IAAI,CAAC,mCAAmC,EAAE,SAAS,GAAG,KAAK,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAC/H,CAAC;IACH,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thebuilder/umbraco-docs",
3
- "version": "1.1.0",
3
+ "version": "1.3.0",
4
4
  "description": "Composable Blume presentation and metadata contracts for TheBuilder Umbraco package documentation.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -36,6 +36,10 @@
36
36
  "types": "./dist/og/index.d.ts",
37
37
  "import": "./dist/og/index.js"
38
38
  },
39
+ "./hero": {
40
+ "types": "./dist/hero/index.d.ts",
41
+ "import": "./dist/hero/index.js"
42
+ },
39
43
  "./package.json": "./package.json"
40
44
  },
41
45
  "bin": {
@@ -46,21 +50,27 @@
46
50
  "sharp": "0.35.3"
47
51
  },
48
52
  "peerDependencies": {
49
- "blume": ">=1.4.3 <3"
53
+ "blume": ">=1.4.3 <3",
54
+ "vgpu": "^0.6.0"
50
55
  },
51
56
  "peerDependenciesMeta": {
52
57
  "blume": {
53
58
  "optional": true
59
+ },
60
+ "vgpu": {
61
+ "optional": true
54
62
  }
55
63
  },
56
64
  "devDependencies": {
57
65
  "@types/node": "^24.10.1",
66
+ "@vgpu/wgsl": "0.6.0",
58
67
  "blume": "2.2.3",
59
- "typescript": "^5.9.2"
68
+ "typescript": "^5.9.2",
69
+ "vgpu": "0.6.0"
60
70
  },
61
71
  "scripts": {
62
- "build": "tsc -p tsconfig.build.json",
63
- "check": "tsc -p tsconfig.json --noEmit",
72
+ "build": "node scripts/build-shaders.mjs && tsc -p tsconfig.build.json",
73
+ "check": "node scripts/build-shaders.mjs && tsc -p tsconfig.json --noEmit",
64
74
  "generate:brand": "node scripts/generate-brand.mjs",
65
75
  "test": "node --test tests/*.test.mjs",
66
76
  "test:fixtures": "node scripts/test-fixtures.mjs",
@@ -17,6 +17,25 @@
17
17
  .udocs-hero { position: relative; overflow: clip; padding-block: clamp(3rem, 8vw, 6rem); }
18
18
  /* An ellipse sized to its box is transparent before the box's bottom edge, and the box never outgrows the hero, so short heroes fade out instead of cutting off. */
19
19
  .udocs-hero__glow { position: absolute; inset: -30% -10% auto; height: min(40rem, 130%); background: radial-gradient(ellipse at top, color-mix(in oklab, var(--udocs-accent) 24%, transparent), transparent 70%); pointer-events: none; }
20
+ /* The particle hero (HeroParticles) sits behind the text, down to where the hero's content below the text begins. */
21
+ .udocs-particles { position: absolute; inset: calc(-1 * var(--udocs-particles-lift, 0px)) 0 auto; height: calc(var(--udocs-particles-height, 100%) + var(--udocs-particles-lift, 0px)); pointer-events: none; }
22
+ /* Let the particles reach up behind a header, and no further: content above the header stays clear. */
23
+ .udocs-hero:has(> .udocs-particles) { overflow: visible; clip-path: inset(calc(-1 * var(--udocs-particles-lift, 0px)) 0 0); }
24
+ .udocs-particles__canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 600ms ease; }
25
+ .udocs-particles__canvas[data-ready] { opacity: 1; }
26
+ /* Only when the particles can't run: the logo itself, large and faded where they would form. */
27
+ /* 84% of the uncovered height, centered in it, the same box the particles form in. */
28
+ .udocs-particles__fallback { position: absolute; top: calc(0.92 * var(--udocs-particles-lift, 0px) + 8%); left: 0; display: none; width: 100%; height: calc(84% - 0.84 * var(--udocs-particles-lift, 0px)); object-fit: contain; opacity: 0.14; }
29
+ .udocs-particles[data-fallback] .udocs-particles__fallback { display: block; }
30
+ /* Blume's sticky header is a near-opaque band that would cover the particles running up behind it.
31
+ Over a particle hero it starts clear and turns to its own frosted background over the first
32
+ scroll. Browsers without scroll-driven animations keep the header as it is. */
33
+ @supports (animation-timeline: scroll()) {
34
+ /* Longhands only: the timeline isn't allowed in the animation shorthand, which minifiers would merge them into. */
35
+ html[data-udocs-particles-header] [data-blume-header] { animation-name: udocs-header-clear; animation-timing-function: linear; animation-fill-mode: both; animation-timeline: scroll(root); animation-range: 0 8rem; }
36
+ }
37
+ .udocs-hero__glow { transition: opacity 600ms ease; }
38
+ .udocs-particles:has(> [data-ready]) ~ .udocs-hero__glow { opacity: 0; }
20
39
  .udocs-hero__inner { position: relative; display: flex; flex-direction: column; align-items: center; gap: 1.5rem; text-align: center; }
21
40
  .udocs-hero__logo { width: 4.5rem; height: 4.5rem; object-fit: contain; }
22
41
  .udocs-hero__title { max-width: 20ch; margin: 0; font-family: var(--blume-font-display, system-ui); font-size: clamp(2.4rem, 6vw, 4rem); line-height: 1.05; letter-spacing: -0.02em; text-wrap: balance; }
@@ -62,10 +81,18 @@
62
81
 
63
82
  @layer udocs.motion {
64
83
  [data-udocs-motion="true"] [data-udocs-reveal] { opacity: 0; transform: translateY(0.75rem); transition: opacity 0.45s ease, transform 0.45s ease; }
65
- [data-udocs-motion="true"] [data-udocs-visible="true"] { opacity: 1; transform: none; }
84
+ /* Only the way in waits. The stagger comes from the reveal behavior; a host can add an offset, for example to wait for its own intro. */
85
+ [data-udocs-motion="true"] [data-udocs-visible="true"] { opacity: 1; transform: none; transition-delay: calc(var(--udocs-reveal-offset, 0ms) + var(--udocs-reveal-stagger, 0ms)); }
66
86
  @media (prefers-reduced-motion: reduce) {
67
87
  [data-udocs-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }
68
- .udocs-ecosystem__card, .udocs-ecosystem__title svg { transition: none; }
69
- .udocs-ecosystem__card:hover, .udocs-ecosystem__card:hover .udocs-ecosystem__title svg { transform: none; }
70
88
  }
71
89
  }
90
+
91
+ /* Unlayered, like the transitions they turn off; a layered rule would lose to them. */
92
+ @media (prefers-reduced-motion: reduce) {
93
+ .udocs-ecosystem__card, .udocs-ecosystem__title svg, .udocs-particles__canvas, .udocs-hero__glow { transition: none; }
94
+ .udocs-ecosystem__card:hover, .udocs-ecosystem__card:hover .udocs-ecosystem__title svg { transform: none; }
95
+ }
96
+
97
+ /* Only a start: the header animates to its own background and blur. */
98
+ @keyframes udocs-header-clear { from { background-color: transparent; backdrop-filter: none; } }