@nuvler/cli 0.4.0 → 0.4.1
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/commands/theme/create.js +2 -2
- package/dist/index.js +1 -1
- package/dist/migrate/generator.js +49 -8
- package/dist/migrate/generator.js.map +1 -1
- package/dist/migrate/transformer.js +20 -4
- package/dist/migrate/transformer.js.map +1 -1
- package/dist/nuvler.js +125 -45
- package/dist/nuvler.js.map +1 -1
- package/dist/templates/nuvler-atelier/nuvler.theme.json +10 -3
- package/dist/templates/nuvler-atelier/package.json +3 -3
- package/dist/templates/nuvler-atelier/src/definition.tsx +11 -1
- package/dist/templates/nuvler-atelier/src/theme.css +26 -26
- package/dist/templates/nuvler-atelier/src/theme.tsx +12 -1
- package/dist/templates/nuvler-default/nuvler.theme.json +10 -3
- package/dist/templates/nuvler-default/package.json +2 -2
- package/dist/templates/nuvler-default/src/definition.ts +11 -0
- package/dist/templates/nuvler-default/src/theme-component.tsx +11 -0
- package/dist/templates/nuvler-default/src/theme.css +27 -16
- package/dist/templates/starter/nuvler.theme.json +9 -2
- package/dist/templates/starter/package.json +2 -2
- package/dist/templates/starter/src/definition.tsx +8 -1
- package/dist/templates/starter/src/theme.css +10 -10
- package/dist/templates/starter/src/theme.tsx +11 -0
- package/package.json +3 -3
- package/preview-host/index.html +1 -0
- package/preview-host/package.json +1 -1
- package/preview-host/public/nuvler-icon.ico +0 -0
- package/preview-host/public/nuvler-logo-white.png +0 -0
- package/preview-host/src/app/globals.css +28 -0
- package/preview-host/src/main.tsx +11 -1
- package/preview-host/vendor/theme-runtime/default-theme.tsx +24 -2
|
@@ -14,3 +14,31 @@ img {
|
|
|
14
14
|
display: block;
|
|
15
15
|
max-width: 100%;
|
|
16
16
|
}
|
|
17
|
+
|
|
18
|
+
.nuvler-platform-footer {
|
|
19
|
+
position: relative;
|
|
20
|
+
z-index: 1;
|
|
21
|
+
display: flex;
|
|
22
|
+
min-height: 76px;
|
|
23
|
+
align-items: center;
|
|
24
|
+
justify-content: center;
|
|
25
|
+
border-top: 1px solid rgb(255 255 255 / 10%);
|
|
26
|
+
background: #0b1220;
|
|
27
|
+
padding: 20px 24px;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.nuvler-platform-footer img {
|
|
31
|
+
width: 132px;
|
|
32
|
+
height: auto;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@media (max-width: 640px) {
|
|
36
|
+
.nuvler-platform-footer {
|
|
37
|
+
min-height: 68px;
|
|
38
|
+
padding-block: 18px;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.nuvler-platform-footer img {
|
|
42
|
+
width: 116px;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -69,6 +69,11 @@ function PreviewApp() {
|
|
|
69
69
|
const [route, setRoute] = useState<ThemeRoute>({ type: "loading", pathname: window.location.pathname });
|
|
70
70
|
const requestId = useRef(0);
|
|
71
71
|
|
|
72
|
+
useEffect(() => {
|
|
73
|
+
const favicon = document.querySelector<HTMLLinkElement>('link[rel~="icon"]');
|
|
74
|
+
if (favicon) favicon.href = context.site.settings?.favicon?.url || "/nuvler-icon.ico";
|
|
75
|
+
}, []);
|
|
76
|
+
|
|
72
77
|
const loadRoute = useCallback(async (url: URL) => {
|
|
73
78
|
const currentRequest = ++requestId.current;
|
|
74
79
|
const localRoute = routeFromLocalData(url);
|
|
@@ -137,7 +142,12 @@ function PreviewApp() {
|
|
|
137
142
|
};
|
|
138
143
|
}, [loadRoute]);
|
|
139
144
|
|
|
140
|
-
return
|
|
145
|
+
return <>
|
|
146
|
+
<ActiveTheme adapters={adapters} context={context} route={route} />
|
|
147
|
+
<footer className="nuvler-platform-footer" aria-label="Nuvler">
|
|
148
|
+
<img src="/nuvler-logo-white.png" alt="Nuvler" width="1532" height="289" />
|
|
149
|
+
</footer>
|
|
150
|
+
</>;
|
|
141
151
|
}
|
|
142
152
|
|
|
143
153
|
const container = document.getElementById("root");
|
|
@@ -13,9 +13,20 @@ import type { ThemeRoute } from "./index.js";
|
|
|
13
13
|
|
|
14
14
|
const fallbackColors: ThemeSiteColors = {
|
|
15
15
|
primary: "#176b3a",
|
|
16
|
+
primaryText: "#ffffff",
|
|
16
17
|
secondary: "#d99b31",
|
|
18
|
+
secondaryText: "#18221b",
|
|
19
|
+
accent: "#b45309",
|
|
17
20
|
background: "#f7f7f2",
|
|
21
|
+
surface: "#ffffff",
|
|
22
|
+
surfaceAlt: "#eef2e9",
|
|
18
23
|
text: "#18221b",
|
|
24
|
+
textMuted: "#657068",
|
|
25
|
+
border: "#dfe4dd",
|
|
26
|
+
headerBackground: "#ffffff",
|
|
27
|
+
headerText: "#18221b",
|
|
28
|
+
footerBackground: "#14251a",
|
|
29
|
+
footerText: "#f7f7f2",
|
|
19
30
|
};
|
|
20
31
|
|
|
21
32
|
const template = {
|
|
@@ -552,20 +563,31 @@ function FloatingWhatsapp({ context }: { context: ThemeContext }) {
|
|
|
552
563
|
|
|
553
564
|
export function DefaultTheme({ context, adapters, route = { type: "home" } }: DefaultThemeProps) {
|
|
554
565
|
const configured = context.site.settings?.theme;
|
|
555
|
-
const colors = configured?.colors
|
|
566
|
+
const colors = { ...fallbackColors, ...configured?.colors };
|
|
556
567
|
const layout = configured?.layout;
|
|
557
568
|
const style = {
|
|
558
569
|
"--color-primary": colors.primary,
|
|
570
|
+
"--color-primary-text": colors.primaryText,
|
|
559
571
|
"--color-secondary": colors.secondary,
|
|
572
|
+
"--color-secondary-text": colors.secondaryText,
|
|
573
|
+
"--color-accent": colors.accent,
|
|
560
574
|
"--store-background": colors.background,
|
|
575
|
+
"--store-surface": colors.surface,
|
|
576
|
+
"--store-surface-alt": colors.surfaceAlt,
|
|
561
577
|
"--store-text": colors.text,
|
|
578
|
+
"--store-muted": colors.textMuted,
|
|
579
|
+
"--store-line": colors.border,
|
|
580
|
+
"--store-header-background": colors.headerBackground,
|
|
581
|
+
"--store-header-text": colors.headerText,
|
|
582
|
+
"--store-footer-background": colors.footerBackground,
|
|
583
|
+
"--store-footer-text": colors.footerText,
|
|
562
584
|
"--container-width": `${layout?.containerWidth ?? 1280}px`,
|
|
563
585
|
"--border-radius": `${layout?.borderRadius ?? 18}px`,
|
|
564
586
|
} as CSSProperties;
|
|
565
587
|
const visible = context.home.content.sections.filter((section) => section.enabled).sort((a, b) => a.order - b.order);
|
|
566
588
|
const sections = visible.length ? visible : fallbackSections(context);
|
|
567
589
|
|
|
568
|
-
return <div className="store-shell nuvler-default-theme" data-theme-id="nuvler-default" data-theme-version="1.0.
|
|
590
|
+
return <div className="store-shell nuvler-default-theme" data-theme-id="nuvler-default" data-theme-version="1.0.2" style={style}>
|
|
569
591
|
<Header adapters={adapters} context={context} />
|
|
570
592
|
<div className="store-page"><RouteContent adapters={adapters} context={context} route={route} home={<main>{sections.map((section, index) => {
|
|
571
593
|
const Renderer = defaultSectionRegistry[section.type];
|