@thebuilder/umbraco-docs 1.8.0 → 1.9.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 +2 -2
- package/components/LandingHero.astro +9 -2
- 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 +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -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
|
|
|
@@ -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 @@
|
|
|
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,6 @@
|
|
|
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";
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
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";
|
|
4
5
|
//# 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"}
|
package/package.json
CHANGED