@aglyn/aglyn 1.4.0 → 1.6.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/package.json +11 -11
- package/src/lib/app-utils/business-details.d.ts +93 -0
- package/src/lib/app-utils/business-details.js +145 -0
- package/src/lib/app-utils/business-details.js.map +1 -0
- package/src/lib/app-utils/business-profile.d.ts +20 -3
- package/src/lib/app-utils/business-profile.js +31 -7
- package/src/lib/app-utils/business-profile.js.map +1 -1
- package/src/lib/app-utils/content-authors.d.ts +2 -0
- package/src/lib/app-utils/content-authors.js.map +1 -1
- package/src/lib/app-utils/docs-help-sections.generated.js +0 -1
- package/src/lib/app-utils/docs-help-sections.generated.js.map +1 -1
- package/src/lib/app-utils/docs-help.generated.js +0 -1
- package/src/lib/app-utils/docs-help.generated.js.map +1 -1
- package/src/lib/app-utils/docs-index.generated.js +15 -15
- package/src/lib/app-utils/docs-index.generated.js.map +1 -1
- package/src/lib/app-utils/health-report.d.ts +39 -0
- package/src/lib/app-utils/health-report.js +41 -0
- package/src/lib/app-utils/health-report.js.map +1 -1
- package/src/lib/app-utils/host-tokens.d.ts +53 -11
- package/src/lib/app-utils/host-tokens.js +173 -18
- package/src/lib/app-utils/host-tokens.js.map +1 -1
- package/src/lib/app-utils/site-email-chrome.js +3 -0
- package/src/lib/app-utils/site-email-chrome.js.map +1 -1
- package/src/lib/app-utils/site-entity-json-ld.js +17 -2
- package/src/lib/app-utils/site-entity-json-ld.js.map +1 -1
- package/src/lib/app-utils/weekly-summary.d.ts +15 -4
- package/src/lib/app-utils/weekly-summary.js +76 -21
- package/src/lib/app-utils/weekly-summary.js.map +1 -1
- package/src/lib/plugin-manager/plugin-figures.d.ts +22 -2
- package/src/lib/plugin-manager/plugin-figures.js +5 -0
- package/src/lib/plugin-manager/plugin-figures.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aglyn/aglyn",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"homepage": "https://aglyn.com",
|
|
6
6
|
"repository": {
|
|
@@ -37,16 +37,16 @@
|
|
|
37
37
|
"./package.json": "./package.json"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@aglyn/shared-data-enums": "1.
|
|
41
|
-
"@aglyn/shared-data-mdi": "1.
|
|
42
|
-
"@aglyn/shared-data-types": "1.
|
|
43
|
-
"@aglyn/shared-util-email": "1.
|
|
44
|
-
"@aglyn/shared-util-first-touch": "1.
|
|
45
|
-
"@aglyn/shared-util-http": "1.
|
|
46
|
-
"@aglyn/shared-util-logger": "1.
|
|
47
|
-
"@aglyn/shared-util-timestamp": "1.
|
|
48
|
-
"@aglyn/shared-util-tools": "1.
|
|
49
|
-
"@aglyn/shared-util-vendor": "1.
|
|
40
|
+
"@aglyn/shared-data-enums": "1.6.0",
|
|
41
|
+
"@aglyn/shared-data-mdi": "1.6.0",
|
|
42
|
+
"@aglyn/shared-data-types": "1.6.0",
|
|
43
|
+
"@aglyn/shared-util-email": "1.6.0",
|
|
44
|
+
"@aglyn/shared-util-first-touch": "1.6.0",
|
|
45
|
+
"@aglyn/shared-util-http": "1.6.0",
|
|
46
|
+
"@aglyn/shared-util-logger": "1.6.0",
|
|
47
|
+
"@aglyn/shared-util-timestamp": "1.6.0",
|
|
48
|
+
"@aglyn/shared-util-tools": "1.6.0",
|
|
49
|
+
"@aglyn/shared-util-vendor": "1.6.0",
|
|
50
50
|
"@data-driven-forms/react-form-renderer": "^4.2.0",
|
|
51
51
|
"@msgpack/msgpack": "^3.1.3",
|
|
52
52
|
"@types/unist": "^3.0.3",
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import type { HostSeoEntity } from './content-authors';
|
|
18
|
+
/**
|
|
19
|
+
* A site's BUSINESS DETAILS, entered in one place (AGL-4136).
|
|
20
|
+
*
|
|
21
|
+
* The business name, slogan, phone, email, postal address and social links
|
|
22
|
+
* are entered on Setup → Business profile and nowhere else, and everything that uses
|
|
23
|
+
* them reads that one place. The storage did not move, so no site's data had
|
|
24
|
+
* to: each fact has one canonical path, and the older path that used to hold
|
|
25
|
+
* it is kept as a read fallback.
|
|
26
|
+
*
|
|
27
|
+
* | fact | canonical | kept in step |
|
|
28
|
+
* | ------------ | ----------------------------- | -------------------------- |
|
|
29
|
+
* | name | `seo.entity.name` | falls back to `displayName` |
|
|
30
|
+
* | slogan | `seo.entity.slogan` | |
|
|
31
|
+
* | phone | `seo.entity.telephone` | |
|
|
32
|
+
* | email | `seo.entity.email` | mirrored to `business.supportEmail` |
|
|
33
|
+
* | address | `seo.entity.address.*` | mirrored, formatted, to `business.address` |
|
|
34
|
+
* | social links | `business.socialLinks` | `seo.entity.sameAs` joins it when read |
|
|
35
|
+
*
|
|
36
|
+
* The two mirrors exist for the readers that have not moved yet: the native
|
|
37
|
+
* apps read and write the `business` copies, so a save here keeps them
|
|
38
|
+
* showing what the console shows until they follow.
|
|
39
|
+
*/
|
|
40
|
+
/** The longest slogan a site may set, as the field and the structured data hold it. */
|
|
41
|
+
export declare const SITE_SLOGAN_MAX_LENGTH = 120;
|
|
42
|
+
/** The most social links a site keeps, as the editor allows them. */
|
|
43
|
+
export declare const BUSINESS_SOCIAL_LINKS_MAX = 8;
|
|
44
|
+
/**
|
|
45
|
+
* The paths a Setup → Business profile save may take back to EMPTY.
|
|
46
|
+
*
|
|
47
|
+
* The form drops a cleared input from what it submits, and the write merges,
|
|
48
|
+
* so without this a cleared phone would save nothing and report "Saved!".
|
|
49
|
+
* Both mirrors are here as well: an email or address cleared on the card has
|
|
50
|
+
* to leave its copy too, or the fallback would bring it straight back.
|
|
51
|
+
*/
|
|
52
|
+
export declare const BUSINESS_DETAILS_CLEARABLE_PATHS: readonly ["seo.entity.name", "seo.entity.slogan", "seo.entity.telephone", "seo.entity.email", "seo.entity.address.streetAddress", "seo.entity.address.addressLocality", "seo.entity.address.addressRegion", "seo.entity.address.postalCode", "seo.entity.address.addressCountry", "business.supportEmail", "business.address"];
|
|
53
|
+
/** The host fields the business details read and write. */
|
|
54
|
+
export interface BusinessDetailsHost {
|
|
55
|
+
displayName?: string;
|
|
56
|
+
seo?: {
|
|
57
|
+
entity?: Pick<HostSeoEntity, 'name' | 'slogan' | 'telephone' | 'email' | 'address'> | null;
|
|
58
|
+
} | null;
|
|
59
|
+
business?: {
|
|
60
|
+
supportEmail?: unknown;
|
|
61
|
+
address?: unknown;
|
|
62
|
+
socialLinks?: Array<{
|
|
63
|
+
label?: unknown;
|
|
64
|
+
url?: unknown;
|
|
65
|
+
} | null> | null;
|
|
66
|
+
} | null;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* The host document as the Business details card is seeded with it: the
|
|
70
|
+
* site's one email in the Email field, so a site whose email so far lived
|
|
71
|
+
* only in the one-block copy shows it, and clearing the field clears it.
|
|
72
|
+
* Everything else is the document as stored. A new object; `host` is not
|
|
73
|
+
* changed.
|
|
74
|
+
*/
|
|
75
|
+
export declare function businessDetailsSeed<T extends BusinessDetailsHost>(host: T | null | undefined): T | null | undefined;
|
|
76
|
+
/**
|
|
77
|
+
* What a Setup → Business profile save writes, from what the card submitted and what
|
|
78
|
+
* the document stores now (AGL-4136):
|
|
79
|
+
*
|
|
80
|
+
* - every text value trimmed;
|
|
81
|
+
* - the email mirrored into `business.supportEmail`, `''` when it was cleared
|
|
82
|
+
* (a clearable path, so the save deletes it);
|
|
83
|
+
* - the structured address mirrored, as the one line every reader prints,
|
|
84
|
+
* into `business.address` — but ONLY when the structured address changed.
|
|
85
|
+
* A site whose address so far lives only in the one block keeps that block
|
|
86
|
+
* through a save that never touched the address, rather than losing it to
|
|
87
|
+
* an empty structured one;
|
|
88
|
+
* - social links without an address dropped, each label and address trimmed,
|
|
89
|
+
* up to {@link BUSINESS_SOCIAL_LINKS_MAX}.
|
|
90
|
+
*
|
|
91
|
+
* A new object: the form's values are not this function's to edit.
|
|
92
|
+
*/
|
|
93
|
+
export declare function businessDetailsWrite<T extends Record<string, unknown>>(fields: T, stored: BusinessDetailsHost | null | undefined): T;
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { _ as _extends } from "@swc/helpers/_/_extends";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright 2026 Aglyn LLC
|
|
5
|
+
*
|
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*/ import { structuredAddressLine } from "./business-profile.js";
|
|
18
|
+
import { siteContactEmail } from "./host-tokens.js";
|
|
19
|
+
/**
|
|
20
|
+
* A site's BUSINESS DETAILS, entered in one place (AGL-4136).
|
|
21
|
+
*
|
|
22
|
+
* The business name, slogan, phone, email, postal address and social links
|
|
23
|
+
* are entered on Setup → Business profile and nowhere else, and everything that uses
|
|
24
|
+
* them reads that one place. The storage did not move, so no site's data had
|
|
25
|
+
* to: each fact has one canonical path, and the older path that used to hold
|
|
26
|
+
* it is kept as a read fallback.
|
|
27
|
+
*
|
|
28
|
+
* | fact | canonical | kept in step |
|
|
29
|
+
* | ------------ | ----------------------------- | -------------------------- |
|
|
30
|
+
* | name | `seo.entity.name` | falls back to `displayName` |
|
|
31
|
+
* | slogan | `seo.entity.slogan` | |
|
|
32
|
+
* | phone | `seo.entity.telephone` | |
|
|
33
|
+
* | email | `seo.entity.email` | mirrored to `business.supportEmail` |
|
|
34
|
+
* | address | `seo.entity.address.*` | mirrored, formatted, to `business.address` |
|
|
35
|
+
* | social links | `business.socialLinks` | `seo.entity.sameAs` joins it when read |
|
|
36
|
+
*
|
|
37
|
+
* The two mirrors exist for the readers that have not moved yet: the native
|
|
38
|
+
* apps read and write the `business` copies, so a save here keeps them
|
|
39
|
+
* showing what the console shows until they follow.
|
|
40
|
+
*/ /** The longest slogan a site may set, as the field and the structured data hold it. */ export const SITE_SLOGAN_MAX_LENGTH = 120;
|
|
41
|
+
/** The most social links a site keeps, as the editor allows them. */ export const BUSINESS_SOCIAL_LINKS_MAX = 8;
|
|
42
|
+
/**
|
|
43
|
+
* The paths a Setup → Business profile save may take back to EMPTY.
|
|
44
|
+
*
|
|
45
|
+
* The form drops a cleared input from what it submits, and the write merges,
|
|
46
|
+
* so without this a cleared phone would save nothing and report "Saved!".
|
|
47
|
+
* Both mirrors are here as well: an email or address cleared on the card has
|
|
48
|
+
* to leave its copy too, or the fallback would bring it straight back.
|
|
49
|
+
*/ export const BUSINESS_DETAILS_CLEARABLE_PATHS = [
|
|
50
|
+
'seo.entity.name',
|
|
51
|
+
'seo.entity.slogan',
|
|
52
|
+
'seo.entity.telephone',
|
|
53
|
+
'seo.entity.email',
|
|
54
|
+
'seo.entity.address.streetAddress',
|
|
55
|
+
'seo.entity.address.addressLocality',
|
|
56
|
+
'seo.entity.address.addressRegion',
|
|
57
|
+
'seo.entity.address.postalCode',
|
|
58
|
+
'seo.entity.address.addressCountry',
|
|
59
|
+
'business.supportEmail',
|
|
60
|
+
'business.address'
|
|
61
|
+
];
|
|
62
|
+
const trimmed = (value)=>typeof value === 'string' ? value.trim() : '';
|
|
63
|
+
/**
|
|
64
|
+
* The host document as the Business details card is seeded with it: the
|
|
65
|
+
* site's one email in the Email field, so a site whose email so far lived
|
|
66
|
+
* only in the one-block copy shows it, and clearing the field clears it.
|
|
67
|
+
* Everything else is the document as stored. A new object; `host` is not
|
|
68
|
+
* changed.
|
|
69
|
+
*/ export function businessDetailsSeed(host) {
|
|
70
|
+
var _host_seo, _ref;
|
|
71
|
+
var _host_seo_entity, _host_seo1, _host_seo2;
|
|
72
|
+
if (!host) return host;
|
|
73
|
+
const email = siteContactEmail(host);
|
|
74
|
+
if (!email || trimmed((_host_seo1 = host.seo) == null ? void 0 : (_host_seo_entity = _host_seo1.entity) == null ? void 0 : _host_seo_entity.email)) return host;
|
|
75
|
+
return _extends({}, host, {
|
|
76
|
+
seo: _extends({}, (_host_seo = host.seo) != null ? _host_seo : {}, {
|
|
77
|
+
entity: _extends({}, (_ref = (_host_seo2 = host.seo) == null ? void 0 : _host_seo2.entity) != null ? _ref : {}, {
|
|
78
|
+
email
|
|
79
|
+
})
|
|
80
|
+
})
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* What a Setup → Business profile save writes, from what the card submitted and what
|
|
85
|
+
* the document stores now (AGL-4136):
|
|
86
|
+
*
|
|
87
|
+
* - every text value trimmed;
|
|
88
|
+
* - the email mirrored into `business.supportEmail`, `''` when it was cleared
|
|
89
|
+
* (a clearable path, so the save deletes it);
|
|
90
|
+
* - the structured address mirrored, as the one line every reader prints,
|
|
91
|
+
* into `business.address` — but ONLY when the structured address changed.
|
|
92
|
+
* A site whose address so far lives only in the one block keeps that block
|
|
93
|
+
* through a save that never touched the address, rather than losing it to
|
|
94
|
+
* an empty structured one;
|
|
95
|
+
* - social links without an address dropped, each label and address trimmed,
|
|
96
|
+
* up to {@link BUSINESS_SOCIAL_LINKS_MAX}.
|
|
97
|
+
*
|
|
98
|
+
* A new object: the form's values are not this function's to edit.
|
|
99
|
+
*/ export function businessDetailsWrite(fields, stored) {
|
|
100
|
+
var _ref, _seo_entity, _ref1;
|
|
101
|
+
var _stored_business, _stored_seo_entity, _stored_seo;
|
|
102
|
+
const seo = _extends({}, (_ref = fields == null ? void 0 : fields['seo']) != null ? _ref : {});
|
|
103
|
+
const entity = _extends({}, (_seo_entity = seo['entity']) != null ? _seo_entity : {});
|
|
104
|
+
for (const key of [
|
|
105
|
+
'name',
|
|
106
|
+
'slogan',
|
|
107
|
+
'telephone',
|
|
108
|
+
'email'
|
|
109
|
+
]){
|
|
110
|
+
if (typeof entity[key] === 'string') entity[key] = trimmed(entity[key]);
|
|
111
|
+
}
|
|
112
|
+
if (entity['address'] && typeof entity['address'] === 'object') {
|
|
113
|
+
const address = _extends({}, entity['address']);
|
|
114
|
+
for (const [key, value] of Object.entries(address)){
|
|
115
|
+
if (typeof value === 'string') address[key] = trimmed(value);
|
|
116
|
+
}
|
|
117
|
+
entity['address'] = address;
|
|
118
|
+
}
|
|
119
|
+
seo['entity'] = entity;
|
|
120
|
+
const business = _extends({}, (_ref1 = fields == null ? void 0 : fields['business']) != null ? _ref1 : {});
|
|
121
|
+
const email = trimmed(entity['email']);
|
|
122
|
+
if (email) business['supportEmail'] = email;
|
|
123
|
+
else if (trimmed(stored == null ? void 0 : (_stored_business = stored.business) == null ? void 0 : _stored_business.supportEmail)) business['supportEmail'] = '';
|
|
124
|
+
else delete business['supportEmail'];
|
|
125
|
+
const before = structuredAddressLine(stored == null ? void 0 : (_stored_seo = stored.seo) == null ? void 0 : (_stored_seo_entity = _stored_seo.entity) == null ? void 0 : _stored_seo_entity.address);
|
|
126
|
+
const after = structuredAddressLine(entity['address']);
|
|
127
|
+
if (after !== before) {
|
|
128
|
+
var _stored_business1;
|
|
129
|
+
if (after) business['address'] = after;
|
|
130
|
+
else if (trimmed(stored == null ? void 0 : (_stored_business1 = stored.business) == null ? void 0 : _stored_business1.address)) business['address'] = '';
|
|
131
|
+
else delete business['address'];
|
|
132
|
+
}
|
|
133
|
+
if (Array.isArray(business['socialLinks'])) {
|
|
134
|
+
business['socialLinks'] = business['socialLinks'].map((link)=>link).filter((link)=>trimmed(link == null ? void 0 : link.url)).slice(0, BUSINESS_SOCIAL_LINKS_MAX).map((link)=>({
|
|
135
|
+
label: trimmed(link == null ? void 0 : link.label),
|
|
136
|
+
url: trimmed(link == null ? void 0 : link.url)
|
|
137
|
+
}));
|
|
138
|
+
}
|
|
139
|
+
return _extends({}, fields, {
|
|
140
|
+
seo,
|
|
141
|
+
business
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
//# sourceMappingURL=business-details.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../libs/aglyn/src/lib/app-utils/business-details.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { structuredAddressLine } from './business-profile'\nimport type { HostSeoEntity } from './content-authors'\nimport { siteContactEmail } from './host-tokens'\n\n/**\n * A site's BUSINESS DETAILS, entered in one place (AGL-4136).\n *\n * The business name, slogan, phone, email, postal address and social links\n * are entered on Setup → Business profile and nowhere else, and everything that uses\n * them reads that one place. The storage did not move, so no site's data had\n * to: each fact has one canonical path, and the older path that used to hold\n * it is kept as a read fallback.\n *\n * | fact | canonical | kept in step |\n * | ------------ | ----------------------------- | -------------------------- |\n * | name | `seo.entity.name` | falls back to `displayName` |\n * | slogan | `seo.entity.slogan` | |\n * | phone | `seo.entity.telephone` | |\n * | email | `seo.entity.email` | mirrored to `business.supportEmail` |\n * | address | `seo.entity.address.*` | mirrored, formatted, to `business.address` |\n * | social links | `business.socialLinks` | `seo.entity.sameAs` joins it when read |\n *\n * The two mirrors exist for the readers that have not moved yet: the native\n * apps read and write the `business` copies, so a save here keeps them\n * showing what the console shows until they follow.\n */\n\n/** The longest slogan a site may set, as the field and the structured data hold it. */\nexport const SITE_SLOGAN_MAX_LENGTH = 120\n\n/** The most social links a site keeps, as the editor allows them. */\nexport const BUSINESS_SOCIAL_LINKS_MAX = 8\n\n/**\n * The paths a Setup → Business profile save may take back to EMPTY.\n *\n * The form drops a cleared input from what it submits, and the write merges,\n * so without this a cleared phone would save nothing and report \"Saved!\".\n * Both mirrors are here as well: an email or address cleared on the card has\n * to leave its copy too, or the fallback would bring it straight back.\n */\nexport const BUSINESS_DETAILS_CLEARABLE_PATHS = [\n 'seo.entity.name',\n 'seo.entity.slogan',\n 'seo.entity.telephone',\n 'seo.entity.email',\n 'seo.entity.address.streetAddress',\n 'seo.entity.address.addressLocality',\n 'seo.entity.address.addressRegion',\n 'seo.entity.address.postalCode',\n 'seo.entity.address.addressCountry',\n 'business.supportEmail',\n 'business.address',\n] as const\n\n/** The host fields the business details read and write. */\nexport interface BusinessDetailsHost {\n displayName?: string\n seo?: {\n entity?: Pick<\n HostSeoEntity,\n 'name' | 'slogan' | 'telephone' | 'email' | 'address'\n > | null\n } | null\n business?: {\n supportEmail?: unknown\n address?: unknown\n socialLinks?: Array<{ label?: unknown; url?: unknown } | null> | null\n } | null\n}\n\nconst trimmed = (value: unknown): string =>\n typeof value === 'string' ? value.trim() : ''\n\n/**\n * The host document as the Business details card is seeded with it: the\n * site's one email in the Email field, so a site whose email so far lived\n * only in the one-block copy shows it, and clearing the field clears it.\n * Everything else is the document as stored. A new object; `host` is not\n * changed.\n */\nexport function businessDetailsSeed<T extends BusinessDetailsHost>(\n host: T | null | undefined,\n): T | null | undefined {\n if (!host) return host\n const email = siteContactEmail(host)\n if (!email || trimmed(host.seo?.entity?.email)) return host\n return {\n ...host,\n seo: { ...(host.seo ?? {}), entity: { ...(host.seo?.entity ?? {}), email } },\n }\n}\n\n/**\n * What a Setup → Business profile save writes, from what the card submitted and what\n * the document stores now (AGL-4136):\n *\n * - every text value trimmed;\n * - the email mirrored into `business.supportEmail`, `''` when it was cleared\n * (a clearable path, so the save deletes it);\n * - the structured address mirrored, as the one line every reader prints,\n * into `business.address` — but ONLY when the structured address changed.\n * A site whose address so far lives only in the one block keeps that block\n * through a save that never touched the address, rather than losing it to\n * an empty structured one;\n * - social links without an address dropped, each label and address trimmed,\n * up to {@link BUSINESS_SOCIAL_LINKS_MAX}.\n *\n * A new object: the form's values are not this function's to edit.\n */\nexport function businessDetailsWrite<T extends Record<string, unknown>>(\n fields: T,\n stored: BusinessDetailsHost | null | undefined,\n): T {\n const seo = { ...((fields?.['seo'] as Record<string, unknown>) ?? {}) }\n const entity = { ...((seo['entity'] as Record<string, unknown>) ?? {}) }\n for (const key of ['name', 'slogan', 'telephone', 'email'] as const) {\n if (typeof entity[key] === 'string') entity[key] = trimmed(entity[key])\n }\n if (entity['address'] && typeof entity['address'] === 'object') {\n const address = { ...(entity['address'] as Record<string, unknown>) }\n for (const [key, value] of Object.entries(address)) {\n if (typeof value === 'string') address[key] = trimmed(value)\n }\n entity['address'] = address\n }\n seo['entity'] = entity\n\n const business = { ...((fields?.['business'] as Record<string, unknown>) ?? {}) }\n const email = trimmed(entity['email'])\n if (email) business['supportEmail'] = email\n else if (trimmed(stored?.business?.supportEmail)) business['supportEmail'] = ''\n else delete business['supportEmail']\n\n const before = structuredAddressLine(stored?.seo?.entity?.address)\n const after = structuredAddressLine(\n entity['address'] as HostSeoEntity['address'] | undefined,\n )\n if (after !== before) {\n if (after) business['address'] = after\n else if (trimmed(stored?.business?.address)) business['address'] = ''\n else delete business['address']\n }\n\n if (Array.isArray(business['socialLinks'])) {\n business['socialLinks'] = (business['socialLinks'] as unknown[])\n .map((link) => link as { label?: unknown; url?: unknown } | null)\n .filter((link) => trimmed(link?.url))\n .slice(0, BUSINESS_SOCIAL_LINKS_MAX)\n .map((link) => ({ label: trimmed(link?.label), url: trimmed(link?.url) }))\n }\n\n return { ...fields, seo, business }\n}\n"],"names":["structuredAddressLine","siteContactEmail","SITE_SLOGAN_MAX_LENGTH","BUSINESS_SOCIAL_LINKS_MAX","BUSINESS_DETAILS_CLEARABLE_PATHS","trimmed","value","trim","businessDetailsSeed","host","email","seo","entity","businessDetailsWrite","fields","stored","key","address","Object","entries","business","supportEmail","before","after","Array","isArray","map","link","filter","url","slice","label"],"mappings":";AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAASA,qBAAqB,QAAQ,wBAAoB;AAE1D,SAASC,gBAAgB,QAAQ,mBAAe;AAEhD;;;;;;;;;;;;;;;;;;;;;CAqBC,GAED,qFAAqF,GACrF,OAAO,MAAMC,yBAAyB,IAAG;AAEzC,mEAAmE,GACnE,OAAO,MAAMC,4BAA4B,EAAC;AAE1C;;;;;;;CAOC,GACD,OAAO,MAAMC,mCAAmC;IAC9C;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD,CAAS;AAkBV,MAAMC,UAAU,CAACC,QACf,OAAOA,UAAU,WAAWA,MAAMC,IAAI,KAAK;AAE7C;;;;;;CAMC,GACD,OAAO,SAASC,oBACdC,IAA0B;QAObA;QAHSA,kBAAAA,YAGsBA;IAL5C,IAAI,CAACA,MAAM,OAAOA;IAClB,MAAMC,QAAQT,iBAAiBQ;IAC/B,IAAI,CAACC,SAASL,SAAQI,aAAAA,KAAKE,GAAG,sBAARF,mBAAAA,WAAUG,MAAM,qBAAhBH,iBAAkBC,KAAK,GAAG,OAAOD;IACvD,O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AEpC,MAAME,SAAStB,sBAAsBe,2BAAAA,cAAAA,OAAQJ,GAAG,sBAAXI,qBAAAA,YAAaH,MAAM,qBAAnBG,mBAAqBE,OAAO;IACjE,MAAMM,QAAQvB,sBACZY,MAAM,CAAC,UAAU;IAEnB,IAAIW,UAAUD,QAAQ;YAEHP;QADjB,IAAIQ,OAAOH,QAAQ,CAAC,UAAU,GAAGG;aAC5B,IAAIlB,QAAQU,2BAAAA,oBAAAA,OAAQK,QAAQ,qBAAhBL,kBAAkBE,OAAO,GAAGG,QAAQ,CAAC,UAAU,GAAG;aAC9D,OAAOA,QAAQ,CAAC,UAAU;IACjC;IAEA,IAAII,MAAMC,OAAO,CAACL,QAAQ,CAAC,cAAc,GAAG;QAC1CA,QAAQ,CAAC,cAAc,GAAG,AAACA,QAAQ,CAAC,cAAc,CAC/CM,GAAG,CAAC,CAACC,OAASA,MACdC,MAAM,CAAC,CAACD,OAAStB,QAAQsB,wBAAAA,KAAME,GAAG,GAClCC,KAAK,CAAC,GAAG3B,2BACTuB,GAAG,CAAC,CAACC,OAAU,CAAA;gBAAEI,OAAO1B,QAAQsB,wBAAAA,KAAMI,KAAK;gBAAGF,KAAKxB,QAAQsB,wBAAAA,KAAME,GAAG;YAAE,CAAA;IAC3E;IAEA,OAAO,aAAKf;QAAQH;QAAKS;;AAC3B"}
|
|
@@ -32,9 +32,12 @@ export declare const BUSINESS_PROFILE_FIELD_ORDER: readonly string[];
|
|
|
32
32
|
* The site's name, its one-line description, its contact details, its hours,
|
|
33
33
|
* the areas it serves and its social profiles all have a home on the host
|
|
34
34
|
* document already: `seo.entity` (the publisher entity the JSON-LD is built
|
|
35
|
-
* from
|
|
36
|
-
*
|
|
37
|
-
*
|
|
35
|
+
* from) and `business` (its social links, and the one-block copies of the
|
|
36
|
+
* email and address older readers and the native apps still read). The name,
|
|
37
|
+
* phone, email, address and social links are entered in one place, Setup →
|
|
38
|
+
* Business (AGL-4136); the hours, business type and areas served in Setup →
|
|
39
|
+
* SEO → Local business. Copying them here would make two places to keep in
|
|
40
|
+
* step, and the copy would drift.
|
|
38
41
|
*
|
|
39
42
|
* So the profile document holds only what has no home yet — the services, the
|
|
40
43
|
* audience, the tone of voice, the year it was founded — plus a line about the
|
|
@@ -103,6 +106,16 @@ export interface ResolvedBusinessProfile {
|
|
|
103
106
|
profiles: string[];
|
|
104
107
|
logo: string | null;
|
|
105
108
|
}
|
|
109
|
+
/**
|
|
110
|
+
* The structured postal address (`seo.entity.address`) as one line, its
|
|
111
|
+
* parts joined by commas, or `''` when it has none (AGL-4136).
|
|
112
|
+
*
|
|
113
|
+
* The ONE formatter for a site's address. Setup → Business profile saves the parts
|
|
114
|
+
* and mirrors this line into `business.address`, and the `{{host.address}}`
|
|
115
|
+
* token, the email footer and the document PDFs print it, so the address a
|
|
116
|
+
* visitor reads is the same wherever it appears.
|
|
117
|
+
*/
|
|
118
|
+
export declare function structuredAddressLine(parts: HostSeoEntity['address'] | null | undefined): string;
|
|
106
119
|
/**
|
|
107
120
|
* The profile as every reader sees it, field by field (AGL-3661):
|
|
108
121
|
*
|
|
@@ -112,6 +125,10 @@ export interface ResolvedBusinessProfile {
|
|
|
112
125
|
* 3. what the guided start or a generator stored on the site's profile;
|
|
113
126
|
* 4. the workspace defaults.
|
|
114
127
|
*
|
|
128
|
+
* The area served is the one exception to that order: the site's settings
|
|
129
|
+
* (SEO → Local business) come first, then anything the profile holds, then
|
|
130
|
+
* the workspace default (AGL-4136).
|
|
131
|
+
*
|
|
115
132
|
* Contact details, the logo and the profiles come from the site's settings
|
|
116
133
|
* only: nothing but the owner's own entry may say how to reach the business.
|
|
117
134
|
*/
|
|
@@ -20,17 +20,26 @@ import { BUSINESS_PROFILE_FIELDS, BUSINESS_PROFILE_MAX_CHARS, BUSINESS_TONES, bu
|
|
|
20
20
|
export { BUSINESS_PROFILE_FIELDS, BUSINESS_PROFILE_MAX_CHARS, BUSINESS_PROFILE_MAX_SERVICES, BUSINESS_PROFILE_SITE_DOC, BUSINESS_PROFILE_SUBCOLLECTION, BUSINESS_PROFILE_WORKSPACE_DOC, BUSINESS_TONE_LABELS, BUSINESS_TONES, businessProfileFoundedProblem, businessProfileOwnerWrite, businessProfileSourceOf, mergeBusinessProfilePrefill, sanitizeBusinessProfileValues } from "./business-profile-values.js";
|
|
21
21
|
/** The tones as a plain list, in the order the owner picks them, for the native apps' pickers. */ export const BUSINESS_TONE_ORDER = BUSINESS_TONES;
|
|
22
22
|
/** The stored fields as a plain list, for the native apps' writers. */ export const BUSINESS_PROFILE_FIELD_ORDER = BUSINESS_PROFILE_FIELDS;
|
|
23
|
-
/**
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
/**
|
|
24
|
+
* The structured postal address (`seo.entity.address`) as one line, its
|
|
25
|
+
* parts joined by commas, or `''` when it has none (AGL-4136).
|
|
26
|
+
*
|
|
27
|
+
* The ONE formatter for a site's address. Setup → Business profile saves the parts
|
|
28
|
+
* and mirrors this line into `business.address`, and the `{{host.address}}`
|
|
29
|
+
* token, the email footer and the document PDFs print it, so the address a
|
|
30
|
+
* visitor reads is the same wherever it appears.
|
|
31
|
+
*/ export function structuredAddressLine(parts) {
|
|
32
|
+
return [
|
|
27
33
|
parts == null ? void 0 : parts.streetAddress,
|
|
28
34
|
parts == null ? void 0 : parts.addressLocality,
|
|
29
35
|
parts == null ? void 0 : parts.addressRegion,
|
|
30
36
|
parts == null ? void 0 : parts.postalCode,
|
|
31
37
|
parts == null ? void 0 : parts.addressCountry
|
|
32
38
|
].map((part)=>text(part, 200)).filter(Boolean).join(', ');
|
|
33
|
-
|
|
39
|
+
}
|
|
40
|
+
/** The postal address as one line: the SEO entity's parts, else the one-block `business.address`. */ function addressLine(host) {
|
|
41
|
+
var _host_seo_entity, _host_seo, _host_business;
|
|
42
|
+
return structuredAddressLine(host == null ? void 0 : (_host_seo = host.seo) == null ? void 0 : (_host_seo_entity = _host_seo.entity) == null ? void 0 : _host_seo_entity.address) || text(host == null ? void 0 : (_host_business = host.business) == null ? void 0 : _host_business.address, 400);
|
|
34
43
|
}
|
|
35
44
|
/**
|
|
36
45
|
* The profile as every reader sees it, field by field (AGL-3661):
|
|
@@ -41,6 +50,10 @@ export { BUSINESS_PROFILE_FIELDS, BUSINESS_PROFILE_MAX_CHARS, BUSINESS_PROFILE_M
|
|
|
41
50
|
* 3. what the guided start or a generator stored on the site's profile;
|
|
42
51
|
* 4. the workspace defaults.
|
|
43
52
|
*
|
|
53
|
+
* The area served is the one exception to that order: the site's settings
|
|
54
|
+
* (SEO → Local business) come first, then anything the profile holds, then
|
|
55
|
+
* the workspace default (AGL-4136).
|
|
56
|
+
*
|
|
44
57
|
* Contact details, the logo and the profiles come from the site's settings
|
|
45
58
|
* only: nothing but the owner's own entry may say how to reach the business.
|
|
46
59
|
*/ export function resolveBusinessProfile(input) {
|
|
@@ -54,12 +67,23 @@ export { BUSINESS_PROFILE_FIELDS, BUSINESS_PROFILE_MAX_CHARS, BUSINESS_PROFILE_M
|
|
|
54
67
|
};
|
|
55
68
|
const resolve = (field)=>{
|
|
56
69
|
const stored = businessProfileSourceOf(site, field);
|
|
70
|
+
const own = fromSite[field];
|
|
71
|
+
const fromSettings = own !== undefined && !isEmpty(own);
|
|
72
|
+
/*
|
|
73
|
+
The area served has ONE home now, SEO → Local business (AGL-4136), so
|
|
74
|
+
the site's settings win over anything the profile holds, even what the
|
|
75
|
+
owner typed there before the field left the profile card: that value
|
|
76
|
+
is a fallback for a site whose settings name no area, never a second
|
|
77
|
+
answer beside them.
|
|
78
|
+
*/ if (field === 'serviceArea' && fromSettings) return {
|
|
79
|
+
value: own,
|
|
80
|
+
origin: 'site'
|
|
81
|
+
};
|
|
57
82
|
if (stored === 'owner') return {
|
|
58
83
|
value: fieldValue(site, field),
|
|
59
84
|
origin: 'owner'
|
|
60
85
|
};
|
|
61
|
-
|
|
62
|
-
if (own !== undefined && !isEmpty(own)) return {
|
|
86
|
+
if (fromSettings) return {
|
|
63
87
|
value: own,
|
|
64
88
|
origin: 'site'
|
|
65
89
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../libs/aglyn/src/lib/app-utils/business-profile.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { siteProfileUrls, type HostSeoEntity } from './content-authors'\nimport { normalizeAreaServed } from './local-business'\nimport { PLATFORM_BRAND_NAME } from './platform-brand'\nimport {\n BUSINESS_PROFILE_FIELDS,\n BUSINESS_PROFILE_MAX_CHARS,\n BUSINESS_TONES,\n businessProfileSourceOf,\n fieldValue,\n isEmpty,\n text,\n type BusinessProfileDoc,\n type BusinessProfileField,\n type BusinessProfileOrigin,\n type BusinessProfileSource,\n type BusinessProfileValues,\n type BusinessTone,\n} from './business-profile-values'\n\nexport {\n BUSINESS_PROFILE_FIELDS,\n BUSINESS_PROFILE_MAX_CHARS,\n BUSINESS_PROFILE_MAX_SERVICES,\n BUSINESS_PROFILE_SITE_DOC,\n BUSINESS_PROFILE_SUBCOLLECTION,\n BUSINESS_PROFILE_WORKSPACE_DOC,\n BUSINESS_TONE_LABELS,\n BUSINESS_TONES,\n businessProfileFoundedProblem,\n businessProfileOwnerWrite,\n businessProfileSourceOf,\n mergeBusinessProfilePrefill,\n sanitizeBusinessProfileValues,\n} from './business-profile-values'\nexport type {\n BusinessProfileDoc,\n BusinessProfileField,\n BusinessProfileOrigin,\n BusinessProfileSource,\n BusinessProfileValues,\n BusinessTone,\n} from './business-profile-values'\n\n/** The tones as a plain list, in the order the owner picks them, for the native apps' pickers. */\nexport const BUSINESS_TONE_ORDER: readonly string[] = BUSINESS_TONES\n\n/** The stored fields as a plain list, for the native apps' writers. */\nexport const BUSINESS_PROFILE_FIELD_ORDER: readonly string[] = BUSINESS_PROFILE_FIELDS\n\n/**\n * A site's BUSINESS PROFILE (AGL-3661): what the business is, as everything\n * that writes about it needs to know — the site's own pages, the structured\n * data, and any generator a plugin brings.\n *\n * ── Most of it is already stored, so this stores only the rest ─────────────\n *\n * The site's name, its one-line description, its contact details, its hours,\n * the areas it serves and its social profiles all have a home on the host\n * document already: `seo.entity` (the publisher entity the JSON-LD is built\n * from, edited in Setup → SEO) and `business` (the contact card the `host.*`\n * tokens and the footer read, edited in Setup → Basic details). Copying them\n * here would make two places to keep in step, and the copy would drift.\n *\n * So the profile document holds only what has no home yet — the services, the\n * audience, the tone of voice, the year it was founded — plus a line about the\n * business and the area it serves for a site whose SEO entity does not say. {@link resolveBusinessProfile}\n * reads the two together into one picture, field by field, and says where\n * each value came from.\n *\n * ── Where it is stored ────────────────────────────────────────────────────\n *\n * `hosts/{hostId}/businessProfile/profile` for a site and\n * `orgs/{orgId}/businessProfile/defaults` for the workspace, whose values a\n * site inherits where it has none of its own. A subcollection document rather\n * than a key on the host: the host document's `business` map is replaced\n * whole by the contact card's save, and a key beside it would be one more\n * thing a partial write could blank.\n *\n * ── Whose words win ───────────────────────────────────────────────────────\n *\n * Every stored value carries its source. What the owner typed is never\n * replaced by anything else; what the guided start was told replaces only\n * what a generator guessed; and a generator's guess fills only what is empty.\n * {@link mergeBusinessProfilePrefill} is the one place that rule is applied.\n */\n\n\n/** The host fields the profile reads. A closed surface, as the host tokens' is. */\nexport interface BusinessProfileHost {\n displayName?: string\n logoUrl?: string\n seo?: { description?: string; entity?: HostSeoEntity | null } | null\n business?: {\n supportEmail?: string\n address?: string\n socialLinks?: Array<{ label?: string; url?: string } | null> | null\n } | null\n}\n\nexport interface ResolvedBusinessField<T> {\n value: T\n origin: BusinessProfileOrigin\n}\n\n/** The picture every reader works from: each field's value and where it came from. */\nexport interface ResolvedBusinessProfile {\n name: ResolvedBusinessField<string> | null\n whatYouDo: ResolvedBusinessField<string> | null\n services: ResolvedBusinessField<string[]> | null\n serviceArea: ResolvedBusinessField<string> | null\n audience: ResolvedBusinessField<string> | null\n tone: ResolvedBusinessField<BusinessTone> | null\n toneNotes: ResolvedBusinessField<string> | null\n /** The year the business started (AGL-4092). */\n founded: ResolvedBusinessField<string> | null\n /** The schema.org business type the SEO entity names, e.g. `Plumber`. */\n businessType: string | null\n /** Real contact details, each only where the owner entered it in the site's settings. */\n contact: {\n email: string | null\n phone: string | null\n address: string | null\n hours: string | null\n }\n /** The site's social and other profiles, https only. */\n profiles: string[]\n logo: string | null\n}\n\n\n/** The postal address as one line: the SEO entity's parts, else the contact card's block. */\nfunction addressLine(host: BusinessProfileHost | null | undefined): string {\n const parts = host?.seo?.entity?.address\n const line = [\n parts?.streetAddress,\n parts?.addressLocality,\n parts?.addressRegion,\n parts?.postalCode,\n parts?.addressCountry,\n ]\n .map((part) => text(part, 200))\n .filter(Boolean)\n .join(', ')\n return line || text(host?.business?.address, 400)\n}\n\n/**\n * The profile as every reader sees it, field by field (AGL-3661):\n *\n * 1. what the OWNER typed into the site's profile;\n * 2. what the site's own settings say (the SEO entity, the contact card, the\n * display name), which the owner typed too, elsewhere;\n * 3. what the guided start or a generator stored on the site's profile;\n * 4. the workspace defaults.\n *\n * Contact details, the logo and the profiles come from the site's settings\n * only: nothing but the owner's own entry may say how to reach the business.\n */\nexport function resolveBusinessProfile(input: {\n host: BusinessProfileHost | null | undefined\n site?: BusinessProfileDoc | null\n workspace?: BusinessProfileDoc | null\n}): ResolvedBusinessProfile {\n const { host, site, workspace } = input\n const entity = host?.seo?.entity ?? null\n const fromSite: Partial<Record<BusinessProfileField, unknown>> = {\n whatYouDo: text(entity?.description, BUSINESS_PROFILE_MAX_CHARS.whatYouDo),\n serviceArea: normalizeAreaServed(entity?.areaServed).join(', ').slice(0, BUSINESS_PROFILE_MAX_CHARS.serviceArea),\n }\n\n const resolve = <T>(field: BusinessProfileField): ResolvedBusinessField<T> | null => {\n const stored = businessProfileSourceOf(site, field)\n if (stored === 'owner') return { value: fieldValue(site, field) as T, origin: 'owner' }\n const own = fromSite[field]\n if (own !== undefined && !isEmpty(own)) return { value: own as T, origin: 'site' }\n if (stored) return { value: fieldValue(site, field) as T, origin: stored }\n if (businessProfileSourceOf(workspace, field)) {\n return { value: fieldValue(workspace, field) as T, origin: 'workspace' }\n }\n return null\n }\n\n const name = text(entity?.name, 200) || text(host?.displayName, 200)\n return {\n name: name ? { value: name, origin: 'site' } : null,\n whatYouDo: resolve<string>('whatYouDo'),\n services: resolve<string[]>('services'),\n serviceArea: resolve<string>('serviceArea'),\n audience: resolve<string>('audience'),\n tone: resolve<BusinessTone>('tone'),\n toneNotes: resolve<string>('toneNotes'),\n founded: resolve<string>('founded'),\n businessType: text(entity?.businessType, 80) || null,\n contact: {\n email: text(entity?.email, 320) || text(host?.business?.supportEmail, 320) || null,\n phone: text(entity?.telephone, 64) || null,\n address: addressLine(host) || null,\n hours: text(entity?.openingHours, 400) || null,\n },\n profiles: siteProfileUrls(host as Parameters<typeof siteProfileUrls>[0]),\n logo: text(host?.logoUrl, 800) || text(entity?.logo, 800) || null,\n }\n}\n\n/** Each origin as the profile screen labels it. */\nexport const BUSINESS_PROFILE_ORIGIN_LABELS: Readonly<Record<BusinessProfileOrigin, string>> = {\n owner: 'You',\n site: 'Site settings',\n start: 'Your answers when the site was started',\n ai: `Suggested by ${PLATFORM_BRAND_NAME} AI`,\n workspace: 'Workspace default',\n}\n"],"names":["siteProfileUrls","normalizeAreaServed","PLATFORM_BRAND_NAME","BUSINESS_PROFILE_FIELDS","BUSINESS_PROFILE_MAX_CHARS","BUSINESS_TONES","businessProfileSourceOf","fieldValue","isEmpty","text","BUSINESS_PROFILE_MAX_SERVICES","BUSINESS_PROFILE_SITE_DOC","BUSINESS_PROFILE_SUBCOLLECTION","BUSINESS_PROFILE_WORKSPACE_DOC","BUSINESS_TONE_LABELS","businessProfileFoundedProblem","businessProfileOwnerWrite","mergeBusinessProfilePrefill","sanitizeBusinessProfileValues","BUSINESS_TONE_ORDER","BUSINESS_PROFILE_FIELD_ORDER","addressLine","host","parts","seo","entity","address","line","streetAddress","addressLocality","addressRegion","postalCode","addressCountry","map","part","filter","Boolean","join","business","resolveBusinessProfile","input","site","workspace","fromSite","whatYouDo","description","serviceArea","areaServed","slice","resolve","field","stored","value","origin","own","undefined","name","displayName","services","audience","tone","toneNotes","founded","businessType","contact","email","supportEmail","phone","telephone","hours","openingHours","profiles","logo","logoUrl","BUSINESS_PROFILE_ORIGIN_LABELS","owner","start","ai"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAASA,eAAe,QAA4B,uBAAmB;AACvE,SAASC,mBAAmB,QAAQ,sBAAkB;AACtD,SAASC,mBAAmB,QAAQ,sBAAkB;AACtD,SACEC,uBAAuB,EACvBC,0BAA0B,EAC1BC,cAAc,EACdC,uBAAuB,EACvBC,UAAU,EACVC,OAAO,EACPC,IAAI,QAOC,+BAA2B;AAElC,SACEN,uBAAuB,EACvBC,0BAA0B,EAC1BM,6BAA6B,EAC7BC,yBAAyB,EACzBC,8BAA8B,EAC9BC,8BAA8B,EAC9BC,oBAAoB,EACpBT,cAAc,EACdU,6BAA6B,EAC7BC,yBAAyB,EACzBV,uBAAuB,EACvBW,2BAA2B,EAC3BC,6BAA6B,QACxB,+BAA2B;AAUlC,gGAAgG,GAChG,OAAO,MAAMC,sBAAyCd,eAAc;AAEpE,qEAAqE,GACrE,OAAO,MAAMe,+BAAkDjB,wBAAuB;AAmFtF,2FAA2F,GAC3F,SAASkB,YAAYC,IAA4C;QACjDA,kBAAAA,WAWMA;IAXpB,MAAMC,QAAQD,yBAAAA,YAAAA,KAAME,GAAG,sBAATF,mBAAAA,UAAWG,MAAM,qBAAjBH,iBAAmBI,OAAO;IACxC,MAAMC,OAAO;QACXJ,yBAAAA,MAAOK,aAAa;QACpBL,yBAAAA,MAA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,KAAKgB,0BAAAA,OAAQ+B,IAAI,EAAE,QAAQ/C,KAAKa,wBAAAA,KAAMmC,WAAW,EAAE;IAChE,OAAO;QACLD,MAAMA,OAAO;YAAEJ,OAAOI;YAAMH,QAAQ;QAAO,IAAI;QAC/CT,WAAWK,QAAgB;QAC3BS,UAAUT,QAAkB;QAC5BH,aAAaG,QAAgB;QAC7BU,UAAUV,QAAgB;QAC1BW,MAAMX,QAAsB;QAC5BY,WAAWZ,QAAgB;QAC3Ba,SAASb,QAAgB;QACzBc,cAActD,KAAKgB,0BAAAA,OAAQsC,YAAY,EAAE,OAAO;QAChDC,SAAS;YACPC,OAAOxD,KAAKgB,0BAAAA,OAAQwC,KAAK,EAAE,QAAQxD,KAAKa,yBAAAA,iBAAAA,KAAMgB,QAAQ,qBAAdhB,eAAgB4C,YAAY,EAAE,QAAQ;YAC9EC,OAAO1D,KAAKgB,0BAAAA,OAAQ2C,SAAS,EAAE,OAAO;YACtC1C,SAASL,YAAYC,SAAS;YAC9B+C,OAAO5D,KAAKgB,0BAAAA,OAAQ6C,YAAY,EAAE,QAAQ;QAC5C;QACAC,UAAUvE,gBAAgBsB;QAC1BkD,MAAM/D,KAAKa,wBAAAA,KAAMmD,OAAO,EAAE,QAAQhE,KAAKgB,0BAAAA,OAAQ+C,IAAI,EAAE,QAAQ;IAC/D;AACF;AAEA,iDAAiD,GACjD,OAAO,MAAME,iCAAkF;IAC7FC,OAAO;IACPlC,MAAM;IACNmC,OAAO;IACPC,IAAI,CAAC,aAAa,EAAE3E,oBAAoB,GAAG,CAAC;IAC5CwC,WAAW;AACb,EAAC"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../libs/aglyn/src/lib/app-utils/business-profile.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { siteProfileUrls, type HostSeoEntity } from './content-authors'\nimport { normalizeAreaServed } from './local-business'\nimport { PLATFORM_BRAND_NAME } from './platform-brand'\nimport {\n BUSINESS_PROFILE_FIELDS,\n BUSINESS_PROFILE_MAX_CHARS,\n BUSINESS_TONES,\n businessProfileSourceOf,\n fieldValue,\n isEmpty,\n text,\n type BusinessProfileDoc,\n type BusinessProfileField,\n type BusinessProfileOrigin,\n type BusinessProfileSource,\n type BusinessProfileValues,\n type BusinessTone,\n} from './business-profile-values'\n\nexport {\n BUSINESS_PROFILE_FIELDS,\n BUSINESS_PROFILE_MAX_CHARS,\n BUSINESS_PROFILE_MAX_SERVICES,\n BUSINESS_PROFILE_SITE_DOC,\n BUSINESS_PROFILE_SUBCOLLECTION,\n BUSINESS_PROFILE_WORKSPACE_DOC,\n BUSINESS_TONE_LABELS,\n BUSINESS_TONES,\n businessProfileFoundedProblem,\n businessProfileOwnerWrite,\n businessProfileSourceOf,\n mergeBusinessProfilePrefill,\n sanitizeBusinessProfileValues,\n} from './business-profile-values'\nexport type {\n BusinessProfileDoc,\n BusinessProfileField,\n BusinessProfileOrigin,\n BusinessProfileSource,\n BusinessProfileValues,\n BusinessTone,\n} from './business-profile-values'\n\n/** The tones as a plain list, in the order the owner picks them, for the native apps' pickers. */\nexport const BUSINESS_TONE_ORDER: readonly string[] = BUSINESS_TONES\n\n/** The stored fields as a plain list, for the native apps' writers. */\nexport const BUSINESS_PROFILE_FIELD_ORDER: readonly string[] = BUSINESS_PROFILE_FIELDS\n\n/**\n * A site's BUSINESS PROFILE (AGL-3661): what the business is, as everything\n * that writes about it needs to know — the site's own pages, the structured\n * data, and any generator a plugin brings.\n *\n * ── Most of it is already stored, so this stores only the rest ─────────────\n *\n * The site's name, its one-line description, its contact details, its hours,\n * the areas it serves and its social profiles all have a home on the host\n * document already: `seo.entity` (the publisher entity the JSON-LD is built\n * from) and `business` (its social links, and the one-block copies of the\n * email and address older readers and the native apps still read). The name,\n * phone, email, address and social links are entered in one place, Setup →\n * Business (AGL-4136); the hours, business type and areas served in Setup →\n * SEO → Local business. Copying them here would make two places to keep in\n * step, and the copy would drift.\n *\n * So the profile document holds only what has no home yet — the services, the\n * audience, the tone of voice, the year it was founded — plus a line about the\n * business and the area it serves for a site whose SEO entity does not say. {@link resolveBusinessProfile}\n * reads the two together into one picture, field by field, and says where\n * each value came from.\n *\n * ── Where it is stored ────────────────────────────────────────────────────\n *\n * `hosts/{hostId}/businessProfile/profile` for a site and\n * `orgs/{orgId}/businessProfile/defaults` for the workspace, whose values a\n * site inherits where it has none of its own. A subcollection document rather\n * than a key on the host: the host document's `business` map is replaced\n * whole by the contact card's save, and a key beside it would be one more\n * thing a partial write could blank.\n *\n * ── Whose words win ───────────────────────────────────────────────────────\n *\n * Every stored value carries its source. What the owner typed is never\n * replaced by anything else; what the guided start was told replaces only\n * what a generator guessed; and a generator's guess fills only what is empty.\n * {@link mergeBusinessProfilePrefill} is the one place that rule is applied.\n */\n\n\n/** The host fields the profile reads. A closed surface, as the host tokens' is. */\nexport interface BusinessProfileHost {\n displayName?: string\n logoUrl?: string\n seo?: { description?: string; entity?: HostSeoEntity | null } | null\n business?: {\n supportEmail?: string\n address?: string\n socialLinks?: Array<{ label?: string; url?: string } | null> | null\n } | null\n}\n\nexport interface ResolvedBusinessField<T> {\n value: T\n origin: BusinessProfileOrigin\n}\n\n/** The picture every reader works from: each field's value and where it came from. */\nexport interface ResolvedBusinessProfile {\n name: ResolvedBusinessField<string> | null\n whatYouDo: ResolvedBusinessField<string> | null\n services: ResolvedBusinessField<string[]> | null\n serviceArea: ResolvedBusinessField<string> | null\n audience: ResolvedBusinessField<string> | null\n tone: ResolvedBusinessField<BusinessTone> | null\n toneNotes: ResolvedBusinessField<string> | null\n /** The year the business started (AGL-4092). */\n founded: ResolvedBusinessField<string> | null\n /** The schema.org business type the SEO entity names, e.g. `Plumber`. */\n businessType: string | null\n /** Real contact details, each only where the owner entered it in the site's settings. */\n contact: {\n email: string | null\n phone: string | null\n address: string | null\n hours: string | null\n }\n /** The site's social and other profiles, https only. */\n profiles: string[]\n logo: string | null\n}\n\n\n/**\n * The structured postal address (`seo.entity.address`) as one line, its\n * parts joined by commas, or `''` when it has none (AGL-4136).\n *\n * The ONE formatter for a site's address. Setup → Business profile saves the parts\n * and mirrors this line into `business.address`, and the `{{host.address}}`\n * token, the email footer and the document PDFs print it, so the address a\n * visitor reads is the same wherever it appears.\n */\nexport function structuredAddressLine(\n parts: HostSeoEntity['address'] | null | undefined,\n): string {\n return [\n parts?.streetAddress,\n parts?.addressLocality,\n parts?.addressRegion,\n parts?.postalCode,\n parts?.addressCountry,\n ]\n .map((part) => text(part, 200))\n .filter(Boolean)\n .join(', ')\n}\n\n/** The postal address as one line: the SEO entity's parts, else the one-block `business.address`. */\nfunction addressLine(host: BusinessProfileHost | null | undefined): string {\n return structuredAddressLine(host?.seo?.entity?.address) || text(host?.business?.address, 400)\n}\n\n/**\n * The profile as every reader sees it, field by field (AGL-3661):\n *\n * 1. what the OWNER typed into the site's profile;\n * 2. what the site's own settings say (the SEO entity, the contact card, the\n * display name), which the owner typed too, elsewhere;\n * 3. what the guided start or a generator stored on the site's profile;\n * 4. the workspace defaults.\n *\n * The area served is the one exception to that order: the site's settings\n * (SEO → Local business) come first, then anything the profile holds, then\n * the workspace default (AGL-4136).\n *\n * Contact details, the logo and the profiles come from the site's settings\n * only: nothing but the owner's own entry may say how to reach the business.\n */\nexport function resolveBusinessProfile(input: {\n host: BusinessProfileHost | null | undefined\n site?: BusinessProfileDoc | null\n workspace?: BusinessProfileDoc | null\n}): ResolvedBusinessProfile {\n const { host, site, workspace } = input\n const entity = host?.seo?.entity ?? null\n const fromSite: Partial<Record<BusinessProfileField, unknown>> = {\n whatYouDo: text(entity?.description, BUSINESS_PROFILE_MAX_CHARS.whatYouDo),\n serviceArea: normalizeAreaServed(entity?.areaServed).join(', ').slice(0, BUSINESS_PROFILE_MAX_CHARS.serviceArea),\n }\n\n const resolve = <T>(field: BusinessProfileField): ResolvedBusinessField<T> | null => {\n const stored = businessProfileSourceOf(site, field)\n const own = fromSite[field]\n const fromSettings = own !== undefined && !isEmpty(own)\n /*\n The area served has ONE home now, SEO → Local business (AGL-4136), so\n the site's settings win over anything the profile holds, even what the\n owner typed there before the field left the profile card: that value\n is a fallback for a site whose settings name no area, never a second\n answer beside them.\n */\n if (field === 'serviceArea' && fromSettings) return { value: own as T, origin: 'site' }\n if (stored === 'owner') return { value: fieldValue(site, field) as T, origin: 'owner' }\n if (fromSettings) return { value: own as T, origin: 'site' }\n if (stored) return { value: fieldValue(site, field) as T, origin: stored }\n if (businessProfileSourceOf(workspace, field)) {\n return { value: fieldValue(workspace, field) as T, origin: 'workspace' }\n }\n return null\n }\n\n const name = text(entity?.name, 200) || text(host?.displayName, 200)\n return {\n name: name ? { value: name, origin: 'site' } : null,\n whatYouDo: resolve<string>('whatYouDo'),\n services: resolve<string[]>('services'),\n serviceArea: resolve<string>('serviceArea'),\n audience: resolve<string>('audience'),\n tone: resolve<BusinessTone>('tone'),\n toneNotes: resolve<string>('toneNotes'),\n founded: resolve<string>('founded'),\n businessType: text(entity?.businessType, 80) || null,\n contact: {\n email: text(entity?.email, 320) || text(host?.business?.supportEmail, 320) || null,\n phone: text(entity?.telephone, 64) || null,\n address: addressLine(host) || null,\n hours: text(entity?.openingHours, 400) || null,\n },\n profiles: siteProfileUrls(host as Parameters<typeof siteProfileUrls>[0]),\n logo: text(host?.logoUrl, 800) || text(entity?.logo, 800) || null,\n }\n}\n\n/** Each origin as the profile screen labels it. */\nexport const BUSINESS_PROFILE_ORIGIN_LABELS: Readonly<Record<BusinessProfileOrigin, string>> = {\n owner: 'You',\n site: 'Site settings',\n start: 'Your answers when the site was started',\n ai: `Suggested by ${PLATFORM_BRAND_NAME} AI`,\n workspace: 'Workspace default',\n}\n"],"names":["siteProfileUrls","normalizeAreaServed","PLATFORM_BRAND_NAME","BUSINESS_PROFILE_FIELDS","BUSINESS_PROFILE_MAX_CHARS","BUSINESS_TONES","businessProfileSourceOf","fieldValue","isEmpty","text","BUSINESS_PROFILE_MAX_SERVICES","BUSINESS_PROFILE_SITE_DOC","BUSINESS_PROFILE_SUBCOLLECTION","BUSINESS_PROFILE_WORKSPACE_DOC","BUSINESS_TONE_LABELS","businessProfileFoundedProblem","businessProfileOwnerWrite","mergeBusinessProfilePrefill","sanitizeBusinessProfileValues","BUSINESS_TONE_ORDER","BUSINESS_PROFILE_FIELD_ORDER","structuredAddressLine","parts","streetAddress","addressLocality","addressRegion","postalCode","addressCountry","map","part","filter","Boolean","join","addressLine","host","seo","entity","address","business","resolveBusinessProfile","input","site","workspace","fromSite","whatYouDo","description","serviceArea","areaServed","slice","resolve","field","stored","own","fromSettings","undefined","value","origin","name","displayName","services","audience","tone","toneNotes","founded","businessType","contact","email","supportEmail","phone","telephone","hours","openingHours","profiles","logo","logoUrl","BUSINESS_PROFILE_ORIGIN_LABELS","owner","start","ai"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAASA,eAAe,QAA4B,uBAAmB;AACvE,SAASC,mBAAmB,QAAQ,sBAAkB;AACtD,SAASC,mBAAmB,QAAQ,sBAAkB;AACtD,SACEC,uBAAuB,EACvBC,0BAA0B,EAC1BC,cAAc,EACdC,uBAAuB,EACvBC,UAAU,EACVC,OAAO,EACPC,IAAI,QAOC,+BAA2B;AAElC,SACEN,uBAAuB,EACvBC,0BAA0B,EAC1BM,6BAA6B,EAC7BC,yBAAyB,EACzBC,8BAA8B,EAC9BC,8BAA8B,EAC9BC,oBAAoB,EACpBT,cAAc,EACdU,6BAA6B,EAC7BC,yBAAyB,EACzBV,uBAAuB,EACvBW,2BAA2B,EAC3BC,6BAA6B,QACxB,+BAA2B;AAUlC,gGAAgG,GAChG,OAAO,MAAMC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EAAE,QAAQjE,KAAK2B,0BAAAA,OAAQqC,IAAI,EAAE,QAAQ;IAC/D;AACF;AAEA,iDAAiD,GACjD,OAAO,MAAME,iCAAkF;IAC7FC,OAAO;IACPnC,MAAM;IACNoC,OAAO;IACPC,IAAI,CAAC,aAAa,EAAE5E,oBAAoB,GAAG,CAAC;IAC5CwC,WAAW;AACb,EAAC"}
|
|
@@ -470,6 +470,8 @@ export interface HostSeoEntity {
|
|
|
470
470
|
logo?: string;
|
|
471
471
|
/** What the publisher IS, in a sentence (AGL-2716). */
|
|
472
472
|
description?: string;
|
|
473
|
+
/** A short line about the business, schema.org `slogan` (AGL-4136). */
|
|
474
|
+
slogan?: string;
|
|
473
475
|
/** The publisher's canonical address, when it is not this site. */
|
|
474
476
|
url?: string;
|
|
475
477
|
/** Profiles that identify the same entity. */
|