@deneb-ui/ui 2.0.100 → 2.0.101
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/dist/SiteDataProvider.d.ts +14 -0
- package/dist/SiteDataProvider.js +35 -0
- package/package.json +2 -2
|
@@ -167,3 +167,17 @@ export declare function useCommon(fallback?: GenericRecord): GenericRecord;
|
|
|
167
167
|
* with robust fallbacks across contact, common, and shop profile.
|
|
168
168
|
*/
|
|
169
169
|
export declare function useContact(fallback?: GenericRecord): GenericRecord;
|
|
170
|
+
export interface SyncedBranding {
|
|
171
|
+
logoUrl: string;
|
|
172
|
+
websiteTitle: string;
|
|
173
|
+
brandSubtext: string;
|
|
174
|
+
slogan: string;
|
|
175
|
+
faviconUrl: string;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Universal Synced Branding Hook:
|
|
179
|
+
* Guarantees real-time live synchronization for brand identity across visual editor preview,
|
|
180
|
+
* merchant DB profile, and template defaults.
|
|
181
|
+
* Hierarchy: Visual Editor Edits (content.common) -> Live Merchant Shop Profile -> Template Fallback.
|
|
182
|
+
*/
|
|
183
|
+
export declare function useSyncedBranding(fallback?: Partial<SyncedBranding>): SyncedBranding;
|
package/dist/SiteDataProvider.js
CHANGED
|
@@ -29,6 +29,7 @@ exports.useReviews = useReviews;
|
|
|
29
29
|
exports.isPreviewValidation = isPreviewValidation;
|
|
30
30
|
exports.useCommon = useCommon;
|
|
31
31
|
exports.useContact = useContact;
|
|
32
|
+
exports.useSyncedBranding = useSyncedBranding;
|
|
32
33
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
33
34
|
const react_1 = require("react");
|
|
34
35
|
const core_1 = require("@deneb-ui/core");
|
|
@@ -1086,3 +1087,37 @@ function useContact(fallback = {}) {
|
|
|
1086
1087
|
googleMapLink,
|
|
1087
1088
|
};
|
|
1088
1089
|
}
|
|
1090
|
+
/**
|
|
1091
|
+
* Universal Synced Branding Hook:
|
|
1092
|
+
* Guarantees real-time live synchronization for brand identity across visual editor preview,
|
|
1093
|
+
* merchant DB profile, and template defaults.
|
|
1094
|
+
* Hierarchy: Visual Editor Edits (content.common) -> Live Merchant Shop Profile -> Template Fallback.
|
|
1095
|
+
*/
|
|
1096
|
+
function useSyncedBranding(fallback = {}) {
|
|
1097
|
+
const siteData = useSiteData();
|
|
1098
|
+
const content = isRecord(siteData?.content) ? siteData.content : null;
|
|
1099
|
+
const common = isRecord(content?.common) ? content.common : {};
|
|
1100
|
+
const shop = useShop();
|
|
1101
|
+
const websiteTitle = (typeof common.websiteTitle === 'string' && common.websiteTitle.trim()) ||
|
|
1102
|
+
(typeof common.siteName === 'string' && common.siteName.trim()) ||
|
|
1103
|
+
(typeof shop.businessName === 'string' && shop.businessName.trim()) ||
|
|
1104
|
+
(typeof shop.name === 'string' && shop.name.trim()) ||
|
|
1105
|
+
(typeof fallback.websiteTitle === 'string' && fallback.websiteTitle.trim()) ||
|
|
1106
|
+
'Storefront';
|
|
1107
|
+
const logoUrl = (typeof common.logoUrl === 'string' && common.logoUrl.trim()) ||
|
|
1108
|
+
(typeof shop.logoUrl === 'string' && shop.logoUrl.trim()) ||
|
|
1109
|
+
(typeof fallback.logoUrl === 'string' && fallback.logoUrl.trim()) ||
|
|
1110
|
+
'';
|
|
1111
|
+
const brandSubtext = (typeof common.brandSubtext === 'string' && common.brandSubtext.trim()) ||
|
|
1112
|
+
(typeof common.slogan === 'string' && common.slogan.trim()) ||
|
|
1113
|
+
(typeof fallback.brandSubtext === 'string' && fallback.brandSubtext.trim()) ||
|
|
1114
|
+
'';
|
|
1115
|
+
const faviconUrl = logoUrl || fallback.faviconUrl || '';
|
|
1116
|
+
return {
|
|
1117
|
+
logoUrl,
|
|
1118
|
+
websiteTitle,
|
|
1119
|
+
brandSubtext,
|
|
1120
|
+
slogan: brandSubtext,
|
|
1121
|
+
faviconUrl,
|
|
1122
|
+
};
|
|
1123
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deneb-ui/ui",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.101",
|
|
4
4
|
"description": "Visual-first React component library for editable commerce storefronts. Built for Next.js and Fivora.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
],
|
|
51
51
|
"license": "MIT",
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@deneb-ui/core": "^2.0.
|
|
53
|
+
"@deneb-ui/core": "^2.0.101"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
56
|
"react": "^18.0.0 || ^19.0.0",
|