@deneb-ui/ui 2.0.54 → 2.0.56

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.
@@ -0,0 +1,52 @@
1
+ /**
2
+ * PlatformAdditionalPages
3
+ * ────────────────────────
4
+ * Drop this component once inside your layout (or footer). It renders the
5
+ * `additionalPages` list with all the correct Fivora visual-editing markers
6
+ * so the editor can add, reorder, and rename pages via the control panel.
7
+ *
8
+ * WHY THIS EXISTS
9
+ * ───────────────
10
+ * The strict visual-editing contract requires:
11
+ * - data-preview-list-path on the container
12
+ * - data-preview-item-path on each <li>
13
+ * - data-preview-field-path on each editable field (label)
14
+ * - data-preview-static on navigation buttons (to cover the href)
15
+ * - field-path items must NOT be inside a data-preview-static ancestor
16
+ *
17
+ * This exact nesting is non-obvious and easy to get wrong. Putting it here
18
+ * means every template gets it right with ONE import — no template should
19
+ * need to know these rules.
20
+ *
21
+ * USAGE (in layout.tsx or footer.tsx)
22
+ * ─────────────────────────────────────
23
+ * import { PlatformAdditionalPages } from '@deneb-ui/ui';
24
+ *
25
+ * // Inside your Footer or Layout (renders as a styled nav):
26
+ * <PlatformAdditionalPages
27
+ * basePath={basePath}
28
+ * className="space-y-2.5 text-sm text-muted-foreground"
29
+ * linkClassName="hover:text-primary transition-colors text-left bg-transparent border-0 p-0 cursor-pointer"
30
+ * />
31
+ *
32
+ * The component is invisible when additionalPages is empty (default state).
33
+ * It only renders when the platform has assigned additional pages to this site.
34
+ */
35
+ import React from 'react';
36
+ export interface PlatformAdditionalPagesProps {
37
+ /** Base path prefix for navigation (e.g. from withBasePath). Defaults to ''. */
38
+ basePath?: string;
39
+ /** Optional className applied to the outer <ul> list container. */
40
+ className?: string;
41
+ /** Optional className applied to each navigation <button> element. */
42
+ linkClassName?: string;
43
+ /** Optional wrapper function for the route (e.g. withBasePath). */
44
+ resolveRoute?: (route: string) => string;
45
+ }
46
+ export declare function PlatformAdditionalPages({ basePath, className, linkClassName, resolveRoute, }: PlatformAdditionalPagesProps): React.JSX.Element | null;
47
+ /**
48
+ * @deprecated Use PlatformAdditionalPages instead.
49
+ * Kept for backwards compatibility with templates that imported this under
50
+ * the older name before it was standardised.
51
+ */
52
+ export declare const AdditionalPagesNav: typeof PlatformAdditionalPages;
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ 'use client';
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.AdditionalPagesNav = void 0;
5
+ exports.PlatformAdditionalPages = PlatformAdditionalPages;
6
+ const jsx_runtime_1 = require("react/jsx-runtime");
7
+ const SiteDataProvider_1 = require("./SiteDataProvider");
8
+ function PlatformAdditionalPages({ basePath = '', className = '', linkClassName = 'hover:text-primary transition-colors text-left bg-transparent border-0 p-0 cursor-pointer text-sm', resolveRoute, }) {
9
+ const siteData = (0, SiteDataProvider_1.useSiteData)();
10
+ const additionalPages = (0, SiteDataProvider_1.contentList)((0, SiteDataProvider_1.contentObject)(siteData.content).additionalPages);
11
+ if (additionalPages.length === 0)
12
+ return null;
13
+ function toHref(route) {
14
+ const r = (0, SiteDataProvider_1.contentText)(route) || '/';
15
+ if (resolveRoute)
16
+ return resolveRoute(r);
17
+ return `${basePath}${r}`.replace(/\/+/g, '/') || '/';
18
+ }
19
+ return ((0, jsx_runtime_1.jsx)("ul", { className: className, "data-preview-list-path": "additionalPages", children: additionalPages.map((page, index) => (
20
+ /*
21
+ * Marker nesting rules (enforced by strict contract):
22
+ * - data-preview-item-path } both on the <li> — item is also a concrete field
23
+ * - data-preview-field-path }
24
+ * - label span WRAPS the button so field-path is ABOVE data-preview-static
25
+ * - button has data-preview-static to cover its onClick/href without
26
+ * claiming the label text as a non-editable string
27
+ */
28
+ (0, jsx_runtime_1.jsx)("li", { "data-preview-item-path": `additionalPages[${index}]`, "data-preview-field-path": `additionalPages[${index}]`, children: (0, jsx_runtime_1.jsx)("span", { "data-preview-field-path": `additionalPages[${index}].label`, children: (0, jsx_runtime_1.jsx)("button", { type: "button", "data-preview-static": "Additional page navigation button", className: linkClassName, onClick: () => {
29
+ window.location.href = toHref(page['route']);
30
+ }, children: (0, SiteDataProvider_1.contentText)(page['label']) }) }) }, page['id'] != null ? String(page['id']) : index))) }));
31
+ }
32
+ /**
33
+ * @deprecated Use PlatformAdditionalPages instead.
34
+ * Kept for backwards compatibility with templates that imported this under
35
+ * the older name before it was standardised.
36
+ */
37
+ exports.AdditionalPagesNav = PlatformAdditionalPages;
package/dist/index.d.ts CHANGED
@@ -83,6 +83,7 @@ export { EditableAnnouncementBar as AnnouncementBar } from './EditableAnnounceme
83
83
  export { EditableCategoryPills as CategoryPills } from './EditableCategoryPills';
84
84
  export { EditableCartDrawer as CartDrawer } from './EditableCartDrawer';
85
85
  export { EditableFilterSidebar as FilterSidebar } from './EditableFilterSidebar';
86
+ export { PlatformAdditionalPages, AdditionalPagesNav } from './PlatformAdditionalPages';
86
87
  /**
87
88
  * DENEB UI Framework Metadata
88
89
  * Developed by Chamika Gayashan & Induranga Kawishwara
package/dist/index.js CHANGED
@@ -19,7 +19,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
19
19
  };
20
20
  Object.defineProperty(exports, "__esModule", { value: true });
21
21
  exports.ContactForm = exports.FAQ = exports.Accordion = exports.Testimonials = exports.TestimonialSection = exports.TestimonialCard = exports.PricingCard = exports.ServiceCard = exports.GoogleFeedback = exports.CustomerReviews = exports.ProductDetail = exports.ProductGrid = exports.ProductCard = exports.List = exports.Box = exports.Section = exports.Grid = exports.Map = exports.Image = exports.Quote = exports.Badge = exports.Paragraph = exports.Heading = exports.Text = exports.Dialog = exports.Card = exports.Button = exports.collectStyleTargetsFromHtml = exports.validateStyleTree = exports.styleToCssVariables = exports.patchStyleByPath = exports.patchElementStyle = exports.STYLE_TYPE_ATTRIBUTE = exports.STYLE_TARGET_ATTRIBUTE = exports.DENEB_STYLE_PATCH_MESSAGE = exports.STYLE_PATCH_MESSAGE = exports.formatResponsiveFontSize = exports.resolveInstallableFont = exports.normalizeFontId = exports.lookupFontDefinition = exports.listFontsByCategory = exports.collectFontIdsFromSiteData = exports.buildGoogleFontsStylesheetUrl = exports.DENEB_GOOGLE_FONT_COUNT = exports.DENEB_FONT_REGISTRY = exports.useDenebFonts = exports.DENEB_FONTS_LINK_ID = exports.FontLoader = exports.DenebComponentStyles = exports.ResponsiveBaseStyles = void 0;
22
- exports.DENEB_AUTHOR = exports.DENEB_FRAMEWORK_VERSION = exports.DENEB_FRAMEWORK_NAME = exports.FilterSidebar = exports.CartDrawer = exports.CategoryPills = exports.AnnouncementBar = exports.HeroSplit = exports.Hero = exports.Footer = exports.Header = exports.Navbar = void 0;
22
+ exports.DENEB_AUTHOR = exports.DENEB_FRAMEWORK_VERSION = exports.DENEB_FRAMEWORK_NAME = exports.AdditionalPagesNav = exports.PlatformAdditionalPages = exports.FilterSidebar = exports.CartDrawer = exports.CategoryPills = exports.AnnouncementBar = exports.HeroSplit = exports.Hero = exports.Footer = exports.Header = exports.Navbar = void 0;
23
23
  __exportStar(require("./PreviewField"), exports);
24
24
  __exportStar(require("./EditableText"), exports);
25
25
  __exportStar(require("./EditableImage"), exports);
@@ -162,6 +162,9 @@ var EditableCartDrawer_1 = require("./EditableCartDrawer");
162
162
  Object.defineProperty(exports, "CartDrawer", { enumerable: true, get: function () { return EditableCartDrawer_1.EditableCartDrawer; } });
163
163
  var EditableFilterSidebar_1 = require("./EditableFilterSidebar");
164
164
  Object.defineProperty(exports, "FilterSidebar", { enumerable: true, get: function () { return EditableFilterSidebar_1.EditableFilterSidebar; } });
165
+ var PlatformAdditionalPages_1 = require("./PlatformAdditionalPages");
166
+ Object.defineProperty(exports, "PlatformAdditionalPages", { enumerable: true, get: function () { return PlatformAdditionalPages_1.PlatformAdditionalPages; } });
167
+ Object.defineProperty(exports, "AdditionalPagesNav", { enumerable: true, get: function () { return PlatformAdditionalPages_1.AdditionalPagesNav; } });
165
168
  /**
166
169
  * DENEB UI Framework Metadata
167
170
  * Developed by Chamika Gayashan & Induranga Kawishwara
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deneb-ui/ui",
3
- "version": "2.0.54",
3
+ "version": "2.0.56",
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",
@@ -19,7 +19,8 @@
19
19
  "files": [
20
20
  "dist",
21
21
  "scripts",
22
- "README.md"
22
+ "README.md",
23
+ "platform-contract.json"
23
24
  ],
24
25
  "scripts": {
25
26
  "build": "tsc",
@@ -49,7 +50,7 @@
49
50
  ],
50
51
  "license": "MIT",
51
52
  "dependencies": {
52
- "@deneb-ui/core": "^2.0.54"
53
+ "@deneb-ui/core": "^2.0.56"
53
54
  },
54
55
  "peerDependencies": {
55
56
  "react": "^18.0.0 || ^19.0.0",
@@ -59,5 +60,14 @@
59
60
  "@types/react": "^19.0.0",
60
61
  "@types/react-dom": "^19.0.0",
61
62
  "typescript": "^5.0.0"
63
+ },
64
+ "exports": {
65
+ ".": {
66
+ "types": "./dist/index.d.ts",
67
+ "import": "./dist/index.js",
68
+ "require": "./dist/index.js",
69
+ "default": "./dist/index.js"
70
+ },
71
+ "./platform-contract": "./platform-contract.json"
62
72
  }
63
73
  }
@@ -0,0 +1,39 @@
1
+ {
2
+ "_comment": "Platform-managed field paths for Fivora templates. These are written by the Fivora platform (AI agent, site builder) and must NEVER require data-preview-field-path HTML markers. The CLI merges these into every template's controlOnlyPaths automatically — templates do not need to declare them.",
3
+ "version": 1,
4
+ "platformControlledPaths": [
5
+ "__fivoraIntake.tone",
6
+ "__fivoraIntake.outputLanguage",
7
+ "__fivoraIntake.businessSummary",
8
+ "__fivoraIntake.additionalBusinessDetails",
9
+ "__fivoraIntake.referenceWebsiteUrl",
10
+ "additionalPages[*].id",
11
+ "additionalPages[*].route",
12
+ "common.currency",
13
+ "common.whatsappNumber",
14
+ "common.whatsapp",
15
+ "common.email",
16
+ "common.address",
17
+ "common.contactNumber",
18
+ "common.openingHours",
19
+ "common.newsletterTitle",
20
+ "common.newsletterDescription",
21
+ "contact.contactNumber",
22
+ "contact.googleMapLink",
23
+ "contact.whatsapp",
24
+ "products[*].id",
25
+ "products[*].isAvailable",
26
+ "products[*].measurement",
27
+ "products[*].unit",
28
+ "testimonials[*].id",
29
+ "categories[*].slug"
30
+ ],
31
+ "platformSiteDataKeys": [
32
+ "__fivoraIntake",
33
+ "additionalPages"
34
+ ],
35
+ "forbiddenNextConfigKeys": [
36
+ "outputFileTracingRoot",
37
+ "experimental.outputFileTracingRoot"
38
+ ]
39
+ }