@thebuilder/umbraco-docs 1.8.0 → 1.10.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.
- package/README.md +18 -2
- package/components/LandingHero.astro +9 -2
- package/dist/analytics.d.ts +14 -0
- package/dist/analytics.js +20 -0
- package/dist/analytics.js.map +1 -0
- package/dist/compatibility.d.ts +1 -0
- package/dist/compatibility.js +19 -0
- package/dist/compatibility.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/pageflock.d.ts +5 -0
- package/dist/pageflock.js +6 -0
- package/dist/pageflock.js.map +1 -0
- package/package.json +5 -1
package/README.md
CHANGED
|
@@ -40,13 +40,13 @@ import { InstallCommand, LandingHero, LandingRoot } from "@thebuilder/umbraco-do
|
|
|
40
40
|
---
|
|
41
41
|
|
|
42
42
|
<LandingRoot>
|
|
43
|
-
<LandingHero title="Example" description="A focused Umbraco package." logo="/logo.svg">
|
|
43
|
+
<LandingHero title="Example" description="A focused Umbraco package." logo="/logo.svg" compatibility={packageManifest.compatibility}>
|
|
44
44
|
<InstallCommand slot="install" command="dotnet add package TheBuilder.Example" />
|
|
45
45
|
</LandingHero>
|
|
46
46
|
</LandingRoot>
|
|
47
47
|
```
|
|
48
48
|
|
|
49
|
-
`logo` and `
|
|
49
|
+
`logo`, `description` and `compatibility` are optional. Pass `compatibility` from the package's manifest rather than writing the line by hand: the hero words it the same way on every site, so `{ umbraco: ">=17.1 <19" }` reads "Umbraco CMS 17.1 through 18.x" under the install command. It leaves out .NET, since each Umbraco major already requires its own. `formatUmbracoVersions` returns the same line for use elsewhere, such as the hub's package cards. There is no eyebrow: the family doesn't put small text labels above headings, so start with the title. A hero can also draw its own background, such as a canvas, through the `background` slot, which renders behind the glow and the content.
|
|
50
50
|
|
|
51
51
|
`layout="split"` puts the text on the left, left-aligned, and the logo large on the right, as on the social cards. Below 56rem the logo sits above the text, smaller, with the text centered under it. Below 36rem, in either layout, the action buttons share the full width of the text in equal parts and the install command spans the same width, so every site's hero lines up the same way on a phone. The default, `centered`, stacks a small logo and the text in the middle. Give a split hero a `logo` or a `HeroParticles` background to fill that column. Content in the default slot, such as a `ScreenshotFrame`, goes below either layout at full width.
|
|
52
52
|
|
|
@@ -67,6 +67,22 @@ export default defineConfig({
|
|
|
67
67
|
|
|
68
68
|
The accent has a shade per color mode, `#7557e8` in light and `#a78bfa` in dark, and each meets WCAG AA as link text and with its button label, which Blume picks: white in light, dark in dark. It needs Blume 2. `DOCS_ACCENT` exports the two shades for other uses, such as the hub's own CSS.
|
|
69
69
|
|
|
70
|
+
## Analytics
|
|
71
|
+
|
|
72
|
+
Every docs site counts visits with [Pageflock](https://pageflock.com), in the thebuilder workspace, where each site has a Pageflock site of its own. Its ID is the site's domain with dots as dashes, such as `blur-thebuilder-dk`. Add `pageflock()` to `analytics` in `blume.config.ts`, next to any other adapters:
|
|
73
|
+
|
|
74
|
+
```ts
|
|
75
|
+
import { pageflock } from "@thebuilder/umbraco-docs/analytics";
|
|
76
|
+
import { defineConfig } from "blume";
|
|
77
|
+
import { vercel } from "blume/analytics";
|
|
78
|
+
|
|
79
|
+
export default defineConfig({
|
|
80
|
+
analytics: [vercel(), pageflock("blur-thebuilder-dk")],
|
|
81
|
+
});
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
It loads Pageflock's script with automatic events on, so outbound links, file downloads and 404s count too. It needs Blume 2. `PAGEFLOCK_SCRIPT_SRC` exports the script's URL for a site that isn't built with Blume, such as the hub.
|
|
85
|
+
|
|
70
86
|
## Diagrams
|
|
71
87
|
|
|
72
88
|
Blume turns a ` ```mermaid ` fence in an `.mdx` page into a [Mermaid](https://mermaid.js.org) diagram, and only loads Mermaid on pages that have one. Out of the box it uses Mermaid's own lavender and yellow. `styles/diagrams.css` repaints diagrams from the site's Blume tokens instead, so boxes take the family accent, notes and frames use the muted surface, and the text uses the body font, in both color modes. Import it at the top of the site's `theme.css`:
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
---
|
|
2
|
+
import { formatUmbracoVersions, type UmbracoCompatibility } from "@thebuilder/umbraco-docs";
|
|
3
|
+
|
|
2
4
|
interface Props {
|
|
3
5
|
title: string;
|
|
4
6
|
description?: string;
|
|
5
7
|
logo?: string;
|
|
6
8
|
logoAlt?: string;
|
|
7
9
|
accent?: string;
|
|
8
|
-
|
|
10
|
+
/**
|
|
11
|
+
* The line under the install command. Pass the package's `compatibility` from its
|
|
12
|
+
* `defineUmbracoPackage` manifest, so every docs site words it the same way. A string is
|
|
13
|
+
* still shown as written, but is deprecated.
|
|
14
|
+
*/
|
|
15
|
+
compatibility?: UmbracoCompatibility | string;
|
|
9
16
|
/**
|
|
10
17
|
* `centered` (the default) stacks everything in the middle. `split` puts the text on the left
|
|
11
18
|
* and the logo, or a particle logo from the background slot, large on the right; on narrow
|
|
@@ -30,7 +37,7 @@ const split = layout === "split";
|
|
|
30
37
|
{description && <p class="udocs-hero__description" data-udocs-reveal>{description}</p>}
|
|
31
38
|
<div class="udocs-hero__actions" data-udocs-reveal><slot name="actions" /></div>
|
|
32
39
|
<slot name="install" />
|
|
33
|
-
{compatibility && <p class="udocs-hero__compatibility" data-udocs-reveal>{compatibility}</p>}
|
|
40
|
+
{compatibility && <p class="udocs-hero__compatibility" data-udocs-reveal>{typeof compatibility === "string" ? compatibility : formatUmbracoVersions(compatibility.umbraco)}</p>}
|
|
34
41
|
</div>
|
|
35
42
|
{/* Where the logo goes in the split layout. A particle logo forms here too. */}
|
|
36
43
|
{split && (
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { PAGEFLOCK_SCRIPT_SRC } from "./pageflock.js";
|
|
2
|
+
export { PAGEFLOCK_SCRIPT_SRC };
|
|
3
|
+
/**
|
|
4
|
+
* Pageflock analytics for a package docs site, as a Blume analytics adapter. Each docs site has its
|
|
5
|
+
* own Pageflock site in the thebuilder workspace; pass its ID (the domain with dots as dashes,
|
|
6
|
+
* such as `blur-thebuilder-dk`). Add it to `analytics` in `blume.config.ts`:
|
|
7
|
+
*
|
|
8
|
+
* ```ts
|
|
9
|
+
* import { pageflock } from "@thebuilder/umbraco-docs/analytics";
|
|
10
|
+
*
|
|
11
|
+
* export default defineConfig({ analytics: [vercel(), pageflock("blur-thebuilder-dk")] });
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export declare const pageflock: (site: string) => import("blume/analytics").ScriptAdapter;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { script } from "blume/analytics";
|
|
2
|
+
import { PAGEFLOCK_SCRIPT_SRC } from "./pageflock.js";
|
|
3
|
+
export { PAGEFLOCK_SCRIPT_SRC };
|
|
4
|
+
/**
|
|
5
|
+
* Pageflock analytics for a package docs site, as a Blume analytics adapter. Each docs site has its
|
|
6
|
+
* own Pageflock site in the thebuilder workspace; pass its ID (the domain with dots as dashes,
|
|
7
|
+
* such as `blur-thebuilder-dk`). Add it to `analytics` in `blume.config.ts`:
|
|
8
|
+
*
|
|
9
|
+
* ```ts
|
|
10
|
+
* import { pageflock } from "@thebuilder/umbraco-docs/analytics";
|
|
11
|
+
*
|
|
12
|
+
* export default defineConfig({ analytics: [vercel(), pageflock("blur-thebuilder-dk")] });
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export const pageflock = (site) => script({
|
|
16
|
+
src: PAGEFLOCK_SCRIPT_SRC,
|
|
17
|
+
strategy: "defer",
|
|
18
|
+
attributes: { "data-site": site },
|
|
19
|
+
});
|
|
20
|
+
//# sourceMappingURL=analytics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analytics.js","sourceRoot":"","sources":["../src/analytics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAEtD,OAAO,EAAE,oBAAoB,EAAE,CAAC;AAEhC;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,IAAY,EAAE,EAAE,CACxC,MAAM,CAAC;IACL,GAAG,EAAE,oBAAoB;IACzB,QAAQ,EAAE,OAAO;IACjB,UAAU,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE;CAClC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function formatUmbracoVersions(range: string): string;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Turns ">=17.1 <19" into "Umbraco CMS 17.1 through 18.x", ">=17.5 <18" into
|
|
2
|
+
// "Umbraco CMS 17.5 through 17.x", ">=17 <18" into "Umbraco CMS 17" and ">=17.5"
|
|
3
|
+
// into "Umbraco CMS 17.5 or later". Any other range is shown as written. This is the line under
|
|
4
|
+
// the install command on every docs site. It leaves out .NET: each Umbraco major already requires one.
|
|
5
|
+
export function formatUmbracoVersions(range) {
|
|
6
|
+
const value = range.trim();
|
|
7
|
+
const openEnded = /^>=(\d+(?:\.\d+)*)$/.exec(value);
|
|
8
|
+
if (openEnded)
|
|
9
|
+
return `Umbraco CMS ${openEnded[1]} or later`;
|
|
10
|
+
const bounded = /^>=((\d+)(?:\.\d+)*)\s+<(\d+)$/.exec(value);
|
|
11
|
+
if (!bounded)
|
|
12
|
+
return `Umbraco CMS ${value}`;
|
|
13
|
+
const [, lower, lowerMajor, upperMajor] = bounded;
|
|
14
|
+
const lastMajor = Number(upperMajor) - 1;
|
|
15
|
+
if (lower === lowerMajor && Number(lowerMajor) === lastMajor)
|
|
16
|
+
return `Umbraco CMS ${lastMajor}`;
|
|
17
|
+
return `Umbraco CMS ${lower} through ${lastMajor}.x`;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=compatibility.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compatibility.js","sourceRoot":"","sources":["../src/compatibility.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,iFAAiF;AACjF,gGAAgG;AAChG,uGAAuG;AACvG,MAAM,UAAU,qBAAqB,CAAC,KAAa;IACjD,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAC3B,MAAM,SAAS,GAAG,qBAAqB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACpD,IAAI,SAAS;QAAE,OAAO,eAAe,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC;IAC7D,MAAM,OAAO,GAAG,gCAAgC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC7D,IAAI,CAAC,OAAO;QAAE,OAAO,eAAe,KAAK,EAAE,CAAC;IAC5C,MAAM,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,UAAU,CAAC,GAAG,OAAO,CAAC;IAClD,MAAM,SAAS,GAAG,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IACzC,IAAI,KAAK,KAAK,UAAU,IAAI,MAAM,CAAC,UAAU,CAAC,KAAK,SAAS;QAAE,OAAO,eAAe,SAAS,EAAE,CAAC;IAChG,OAAO,eAAe,KAAK,YAAY,SAAS,IAAI,CAAC;AACvD,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export { UMBRACO_PACKAGE_STATUSES, defineUmbracoPackage, validateUmbracoPackage, } from "./package.js";
|
|
2
2
|
export type { UmbracoCompatibility, UmbracoPackage, UmbracoPackageLinks, UmbracoPackageStatus, } from "./package.js";
|
|
3
|
+
export { formatUmbracoVersions } from "./compatibility.js";
|
|
3
4
|
export { DEFAULT_REGISTRY_URL, loadUmbracoPackages } from "./registry.js";
|
|
4
5
|
export type { LoadUmbracoPackagesOptions } from "./registry.js";
|
|
5
6
|
export { DOCS_ACCENT, docsTheme } from "./theme.js";
|
|
7
|
+
export { PAGEFLOCK_SCRIPT_SRC } from "./pageflock.js";
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export { UMBRACO_PACKAGE_STATUSES, defineUmbracoPackage, validateUmbracoPackage, } from "./package.js";
|
|
2
|
+
export { formatUmbracoVersions } from "./compatibility.js";
|
|
2
3
|
export { DEFAULT_REGISTRY_URL, loadUmbracoPackages } from "./registry.js";
|
|
3
4
|
export { DOCS_ACCENT, docsTheme } from "./theme.js";
|
|
5
|
+
export { PAGEFLOCK_SCRIPT_SRC } from "./pageflock.js";
|
|
4
6
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,cAAc,CAAC;AAOtB,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAE1E,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,cAAc,CAAC;AAOtB,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAE1E,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pageflock's tracking script, with automatic events on: outbound links, file downloads and 404s
|
|
3
|
+
* count on top of page views. Every docs site and the hub load it with their own `data-site`.
|
|
4
|
+
*/
|
|
5
|
+
export declare const PAGEFLOCK_SCRIPT_SRC = "https://e.pageflock.com/s.auto.js";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pageflock's tracking script, with automatic events on: outbound links, file downloads and 404s
|
|
3
|
+
* count on top of page views. Every docs site and the hub load it with their own `data-site`.
|
|
4
|
+
*/
|
|
5
|
+
export const PAGEFLOCK_SCRIPT_SRC = "https://e.pageflock.com/s.auto.js";
|
|
6
|
+
//# sourceMappingURL=pageflock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pageflock.js","sourceRoot":"","sources":["../src/pageflock.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,mCAAmC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thebuilder/umbraco-docs",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.0",
|
|
4
4
|
"description": "Composable Blume presentation and metadata contracts for TheBuilder Umbraco package documentation.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -33,6 +33,10 @@
|
|
|
33
33
|
"./styles/landing.css": "./styles/landing.css",
|
|
34
34
|
"./styles/diagrams.css": "./styles/diagrams.css",
|
|
35
35
|
"./behaviors": "./dist/behaviors.js",
|
|
36
|
+
"./analytics": {
|
|
37
|
+
"types": "./dist/analytics.d.ts",
|
|
38
|
+
"import": "./dist/analytics.js"
|
|
39
|
+
},
|
|
36
40
|
"./og": {
|
|
37
41
|
"types": "./dist/og/index.d.ts",
|
|
38
42
|
"import": "./dist/og/index.js"
|