@eldrajs/theme-core 0.3.1 → 0.3.2
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/CHANGELOG.md +5 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +8 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,11 @@ Release-please writes the generated notes from commit messages and does not repl
|
|
|
5
5
|
|
|
6
6
|
## Unreleased
|
|
7
7
|
|
|
8
|
+
- **Company facts in `Organization`, alternate names in `WebSite`.** `buildOrganizationLd` takes
|
|
9
|
+
optional `legalName`, `taxID` (the kennitala in Iceland) and `address` (written as a
|
|
10
|
+
`PostalAddress`, left out when every part is empty); `buildWebSiteLd` takes an optional
|
|
11
|
+
`alternateName` list, which Google weighs when it picks a site name.
|
|
12
|
+
|
|
8
13
|
- **`buildToken` client option (WS-403).** `createEldraClient({ buildToken })` sends
|
|
9
14
|
`X-Eldra-Build-Token` on every read; pass a read-only build token (`eldra_bld_…`, Studio →
|
|
10
15
|
Settings → Developers → Build tokens), never the deploy token. Server and build only.
|
package/dist/index.d.ts
CHANGED
|
@@ -790,9 +790,21 @@ export declare function buildItemListLd(items: readonly {
|
|
|
790
790
|
url: string;
|
|
791
791
|
name: string;
|
|
792
792
|
}[]): JsonLd;
|
|
793
|
+
export interface PostalAddressLdInput {
|
|
794
|
+
streetAddress?: string | null;
|
|
795
|
+
postalCode?: string | null;
|
|
796
|
+
addressLocality?: string | null;
|
|
797
|
+
/** ISO 3166-1 alpha-2, e.g. `IS`. */
|
|
798
|
+
addressCountry?: string | null;
|
|
799
|
+
}
|
|
793
800
|
export interface OrganizationLdInput {
|
|
794
801
|
name: string;
|
|
795
802
|
url: string;
|
|
803
|
+
/** The registered name, e.g. `Eldra Tech ehf.`, when it differs from `name`. */
|
|
804
|
+
legalName?: string | null;
|
|
805
|
+
/** The company's registration or tax number; in Iceland the kennitala. */
|
|
806
|
+
taxID?: string | null;
|
|
807
|
+
address?: PostalAddressLdInput | null;
|
|
796
808
|
logo?: string | null;
|
|
797
809
|
sameAs?: readonly string[];
|
|
798
810
|
contact?: {
|
|
@@ -803,6 +815,8 @@ export interface OrganizationLdInput {
|
|
|
803
815
|
export declare function buildOrganizationLd(input: OrganizationLdInput): JsonLd;
|
|
804
816
|
export interface WebSiteLdInput {
|
|
805
817
|
name: string;
|
|
818
|
+
/** Other names people know the site by, e.g. its domain; Google weighs them when picking a site name. */
|
|
819
|
+
alternateName?: readonly string[];
|
|
806
820
|
url: string;
|
|
807
821
|
/** The site's search page path (`/search`), or `null`/absent when there is none. A SearchAction
|
|
808
822
|
* pointing at a page that does not exist is worse than none. It is queried with `?q=`. */
|
package/dist/index.js
CHANGED
|
@@ -1674,9 +1674,16 @@ function buildItemListLd(items) {
|
|
|
1674
1674
|
}
|
|
1675
1675
|
function buildOrganizationLd(input) {
|
|
1676
1676
|
const contact = input.contact;
|
|
1677
|
+
const address = clean({ ...input.address });
|
|
1677
1678
|
return node("Organization", {
|
|
1678
1679
|
name: input.name,
|
|
1680
|
+
legalName: input.legalName,
|
|
1679
1681
|
url: input.url,
|
|
1682
|
+
taxID: input.taxID,
|
|
1683
|
+
address: address ? {
|
|
1684
|
+
"@type": "PostalAddress",
|
|
1685
|
+
...address
|
|
1686
|
+
} : void 0,
|
|
1680
1687
|
logo: input.logo,
|
|
1681
1688
|
sameAs: input.sameAs,
|
|
1682
1689
|
contactPoint: contact && (contact.email || contact.telephone) ? {
|
|
@@ -1691,6 +1698,7 @@ function buildWebSiteLd(input) {
|
|
|
1691
1698
|
const search = (input.searchPath ?? "").trim();
|
|
1692
1699
|
return node("WebSite", {
|
|
1693
1700
|
name: input.name,
|
|
1701
|
+
alternateName: input.alternateName,
|
|
1694
1702
|
url: input.url,
|
|
1695
1703
|
potentialAction: search === "" ? void 0 : {
|
|
1696
1704
|
"@type": "SearchAction",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eldrajs/theme-core",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "Framework-free core of the Eldra theme SDK: the Studio preview bridge, stega encoding, the overlay runtime, layout CSS, rich-text positions, design tokens and image framing.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cms",
|