create-nextblock 0.2.44 → 0.2.45
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 +1 -1
- package/templates/nextblock-template/app/providers.tsx +1 -0
- package/templates/nextblock-template/components/blocks/renderers/ClientTextBlockRenderer.tsx +5 -0
- package/templates/nextblock-template/components/theme-switcher.tsx +17 -5
- package/templates/nextblock-template/next-env.d.ts +1 -1
- package/templates/nextblock-template/package.json +1 -1
- package/templates/nextblock-template/tailwind.config.js +3 -5
- package/templates/nextblock-template/tsconfig.json +1 -1
package/package.json
CHANGED
package/templates/nextblock-template/components/blocks/renderers/ClientTextBlockRenderer.tsx
CHANGED
|
@@ -16,6 +16,11 @@ const ClientTextBlockRenderer: React.FC<ClientTextBlockRendererProps> = ({ conte
|
|
|
16
16
|
const options: HTMLReactParserOptions = {
|
|
17
17
|
replace: (domNode) => {
|
|
18
18
|
if (domNode instanceof Element && domNode.attribs) {
|
|
19
|
+
if (domNode.attribs['fetchpriority']) {
|
|
20
|
+
domNode.attribs['fetchPriority'] = domNode.attribs['fetchpriority'];
|
|
21
|
+
delete domNode.attribs['fetchpriority'];
|
|
22
|
+
}
|
|
23
|
+
|
|
19
24
|
if (domNode.attribs['data-alert-widget'] !== undefined) {
|
|
20
25
|
const {
|
|
21
26
|
'data-type': type,
|
|
@@ -8,13 +8,15 @@ import {
|
|
|
8
8
|
DropdownMenuRadioItem,
|
|
9
9
|
DropdownMenuTrigger,
|
|
10
10
|
} from "@nextblock-cms/ui";
|
|
11
|
-
import { Laptop, Moon, Sun } from "lucide-react";
|
|
11
|
+
import { Laptop, Moon, Sun, Zap } from "lucide-react";
|
|
12
12
|
import { useTheme } from "next-themes";
|
|
13
13
|
import { useEffect, useState } from "react";
|
|
14
|
+
import { useTranslations } from "@nextblock-cms/utils";
|
|
14
15
|
|
|
15
16
|
const ThemeSwitcher = () => {
|
|
16
17
|
const [mounted, setMounted] = useState(false);
|
|
17
18
|
const { theme, setTheme } = useTheme();
|
|
19
|
+
const { t } = useTranslations();
|
|
18
20
|
|
|
19
21
|
// useEffect only runs on the client, so now we can safely show the UI
|
|
20
22
|
useEffect(() => {
|
|
@@ -30,7 +32,7 @@ const ThemeSwitcher = () => {
|
|
|
30
32
|
return (
|
|
31
33
|
<DropdownMenu>
|
|
32
34
|
<DropdownMenuTrigger asChild>
|
|
33
|
-
<Button variant="ghost" size={"sm"} aria-label=
|
|
35
|
+
<Button variant="ghost" size={"sm"} aria-label={t('theme_switcher')}>
|
|
34
36
|
{theme === "light" ? (
|
|
35
37
|
<Sun
|
|
36
38
|
key="light"
|
|
@@ -43,6 +45,12 @@ const ThemeSwitcher = () => {
|
|
|
43
45
|
size={ICON_SIZE}
|
|
44
46
|
className={"text-muted-foreground"}
|
|
45
47
|
/>
|
|
48
|
+
) : theme === "vibrant" ? (
|
|
49
|
+
<Zap
|
|
50
|
+
key="vibrant"
|
|
51
|
+
size={ICON_SIZE}
|
|
52
|
+
className={"text-muted-foreground"}
|
|
53
|
+
/>
|
|
46
54
|
) : (
|
|
47
55
|
<Laptop
|
|
48
56
|
key="system"
|
|
@@ -59,15 +67,19 @@ const ThemeSwitcher = () => {
|
|
|
59
67
|
>
|
|
60
68
|
<DropdownMenuRadioItem className="flex gap-2" value="light">
|
|
61
69
|
<Sun size={ICON_SIZE} className="text-muted-foreground" />{" "}
|
|
62
|
-
<span>
|
|
70
|
+
<span>{t('theme_light')}</span>
|
|
63
71
|
</DropdownMenuRadioItem>
|
|
64
72
|
<DropdownMenuRadioItem className="flex gap-2" value="dark">
|
|
65
73
|
<Moon size={ICON_SIZE} className="text-muted-foreground" />{" "}
|
|
66
|
-
<span>
|
|
74
|
+
<span>{t('theme_dark')}</span>
|
|
75
|
+
</DropdownMenuRadioItem>
|
|
76
|
+
<DropdownMenuRadioItem className="flex gap-2" value="vibrant">
|
|
77
|
+
<Zap size={ICON_SIZE} className="text-muted-foreground" />{" "}
|
|
78
|
+
<span>{t('theme_vibrant')}</span>
|
|
67
79
|
</DropdownMenuRadioItem>
|
|
68
80
|
<DropdownMenuRadioItem className="flex gap-2" value="system">
|
|
69
81
|
<Laptop size={ICON_SIZE} className="text-muted-foreground" />{" "}
|
|
70
|
-
<span>
|
|
82
|
+
<span>{t('theme_system')}</span>
|
|
71
83
|
</DropdownMenuRadioItem>
|
|
72
84
|
</DropdownMenuRadioGroup>
|
|
73
85
|
</DropdownMenuContent>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="next" />
|
|
2
2
|
/// <reference types="next/image-types/global" />
|
|
3
|
-
import "./.next/types/routes.d.ts";
|
|
3
|
+
import "./.next/dev/types/routes.d.ts";
|
|
4
4
|
|
|
5
5
|
// NOTE: This file should not be edited
|
|
6
6
|
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
|
|
@@ -3,19 +3,17 @@ const { join } = require('path');
|
|
|
3
3
|
|
|
4
4
|
/** @type {import('tailwindcss').Config} */
|
|
5
5
|
module.exports = {
|
|
6
|
-
presets: [require('../../tailwind.config.js')],
|
|
6
|
+
presets: [require('../../libs/ui/tailwind.config.js')],
|
|
7
7
|
content: (() => {
|
|
8
8
|
const projectGlobs = [
|
|
9
9
|
join(
|
|
10
10
|
__dirname,
|
|
11
|
-
'{src,pages,components,app,lib}/**/*!(*.stories|*.spec).{ts,tsx,js,jsx,md,mdx,html}'
|
|
11
|
+
'{src,pages,components,app,lib}/**/*!(*.stories|*.spec).{ts,tsx,js,jsx,md,mdx,html}',
|
|
12
12
|
),
|
|
13
13
|
];
|
|
14
14
|
const libsDir = join(__dirname, '../../libs');
|
|
15
15
|
if (existsSync(libsDir)) {
|
|
16
|
-
projectGlobs.push(
|
|
17
|
-
join(libsDir, '**/*.{ts,tsx,js,jsx,md,mdx,html,sql}')
|
|
18
|
-
);
|
|
16
|
+
projectGlobs.push(join(libsDir, '**/*.{ts,tsx,js,jsx,md,mdx,html,sql}'));
|
|
19
17
|
}
|
|
20
18
|
return projectGlobs;
|
|
21
19
|
})(),
|