@nextsparkjs/core 0.1.0-beta.192 → 0.1.0-beta.193
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/components/app/layouts/PublicFooter.js +1 -1
- package/dist/components/app/layouts/PublicNavbar.js +1 -1
- package/dist/components/app/misc/ThemeToggle.d.ts.map +1 -1
- package/dist/components/app/misc/ThemeToggle.js +4 -3
- package/dist/lib/config/features-types.d.ts +5 -4
- package/dist/lib/config/features-types.d.ts.map +1 -1
- package/dist/lib/selectors/auth-sel.d.ts +2 -7
- package/dist/lib/selectors/auth-sel.d.ts.map +1 -1
- package/dist/lib/selectors/auth-sel.js +1 -3
- package/dist/lib/selectors/by-domain/auth.d.ts +8 -0
- package/dist/lib/selectors/by-domain/auth.d.ts.map +1 -0
- package/dist/lib/selectors/by-domain/auth.js +10 -0
- package/dist/lib/selectors/by-domain/block-editor.d.ts +8 -0
- package/dist/lib/selectors/by-domain/block-editor.d.ts.map +1 -0
- package/dist/lib/selectors/by-domain/block-editor.js +10 -0
- package/dist/lib/selectors/by-domain/common.d.ts +8 -0
- package/dist/lib/selectors/by-domain/common.d.ts.map +1 -0
- package/dist/lib/selectors/by-domain/common.js +10 -0
- package/dist/lib/selectors/by-domain/dashboard.d.ts +8 -0
- package/dist/lib/selectors/by-domain/dashboard.d.ts.map +1 -0
- package/dist/lib/selectors/by-domain/dashboard.js +10 -0
- package/dist/lib/selectors/by-domain/devtools.d.ts +8 -0
- package/dist/lib/selectors/by-domain/devtools.d.ts.map +1 -0
- package/dist/lib/selectors/by-domain/devtools.js +10 -0
- package/dist/lib/selectors/by-domain/entities.d.ts +8 -0
- package/dist/lib/selectors/by-domain/entities.d.ts.map +1 -0
- package/dist/lib/selectors/by-domain/entities.js +10 -0
- package/dist/lib/selectors/by-domain/global-search.d.ts +8 -0
- package/dist/lib/selectors/by-domain/global-search.d.ts.map +1 -0
- package/dist/lib/selectors/by-domain/global-search.js +10 -0
- package/dist/lib/selectors/by-domain/media.d.ts +8 -0
- package/dist/lib/selectors/by-domain/media.d.ts.map +1 -0
- package/dist/lib/selectors/by-domain/media.js +10 -0
- package/dist/lib/selectors/by-domain/patterns.d.ts +8 -0
- package/dist/lib/selectors/by-domain/patterns.d.ts.map +1 -0
- package/dist/lib/selectors/by-domain/patterns.js +10 -0
- package/dist/lib/selectors/by-domain/public.d.ts +8 -0
- package/dist/lib/selectors/by-domain/public.d.ts.map +1 -0
- package/dist/lib/selectors/by-domain/public.js +10 -0
- package/dist/lib/selectors/by-domain/settings.d.ts +8 -0
- package/dist/lib/selectors/by-domain/settings.d.ts.map +1 -0
- package/dist/lib/selectors/by-domain/settings.js +10 -0
- package/dist/lib/selectors/by-domain/superadmin.d.ts +8 -0
- package/dist/lib/selectors/by-domain/superadmin.d.ts.map +1 -0
- package/dist/lib/selectors/by-domain/superadmin.js +10 -0
- package/dist/lib/selectors/by-domain/taxonomies.d.ts +8 -0
- package/dist/lib/selectors/by-domain/taxonomies.d.ts.map +1 -0
- package/dist/lib/selectors/by-domain/taxonomies.js +10 -0
- package/dist/lib/selectors/by-domain/teams.d.ts +8 -0
- package/dist/lib/selectors/by-domain/teams.d.ts.map +1 -0
- package/dist/lib/selectors/by-domain/teams.js +10 -0
- package/dist/lib/selectors/core-selectors.d.ts +1 -0
- package/dist/lib/selectors/core-selectors.d.ts.map +1 -1
- package/dist/lib/selectors/domains/public.selectors.d.ts +1 -0
- package/dist/lib/selectors/domains/public.selectors.d.ts.map +1 -1
- package/dist/lib/selectors/domains/public.selectors.js +3 -1
- package/dist/lib/selectors/selectors.d.ts +2 -0
- package/dist/lib/selectors/selectors.d.ts.map +1 -1
- package/dist/lib/theme/ThemeProvider.d.ts.map +1 -1
- package/dist/lib/theme/ThemeProvider.js +7 -5
- package/dist/routes/(auth)/accept-invite/[token]/page.js +1 -1
- package/dist/routes/(auth)/forgot-password/page.js +1 -1
- package/dist/routes/(auth)/reset-password/page.js +1 -1
- package/dist/routes/(auth)/signup/page.cc.d.ts +2 -2
- package/dist/routes/(auth)/signup/page.d.ts +1 -1
- package/dist/routes/(auth)/signup/page.d.ts.map +1 -1
- package/dist/routes/(auth)/signup/page.js +1 -5
- package/dist/routes/(auth)/verify-email/page.js +1 -1
- package/dist/routes/(public)/docs/[section]/[page]/page.cc.js +1 -1
- package/dist/routes/(public)/docs/[section]/[page]/page.js +1 -1
- package/dist/routes/(public)/docs/layout.js +1 -1
- package/dist/routes/(public)/docs/page.js +1 -1
- package/dist/routes/_internal/default-public-layout.d.ts +5 -0
- package/dist/routes/_internal/default-public-layout.d.ts.map +1 -1
- package/dist/routes/_internal/default-public-layout.js +1 -2
- package/dist/routes/devtools/blocks/[slug]/page.d.ts +4 -1
- package/dist/routes/devtools/blocks/[slug]/page.d.ts.map +1 -1
- package/dist/routes/devtools/blocks/[slug]/page.js +2 -1
- package/dist/templates/features/blog/blocks/post-content/component.tsx +1 -1
- package/dist/templates/features/blog/entities/posts/posts.config.ts +0 -11
- package/dist/templates/features/pages/blocks/hero/component.tsx +1 -1
- package/dist/templates/features/pages/entities/pages/pages.config.ts +0 -11
- package/dist/templates/projects/blog/lib/block-selectors.ts +29 -0
- package/dist/templates/projects/blog/lib/selectors.ts +2 -9
- package/dist/templates/projects/blog/package.json +1 -4
- package/dist/templates/projects/crm/lib/block-selectors.ts +29 -0
- package/dist/templates/projects/crm/lib/selectors.ts +2 -9
- package/dist/templates/projects/crm/package.json +1 -1
- package/dist/templates/projects/crm/templates/dashboard/(main)/layout.tsx +2 -17
- package/dist/templates/projects/crm/templates/shared/CRMSidebarContext.tsx +23 -0
- package/dist/templates/projects/productivity/entities/boards/boards.service.ts +18 -18
- package/dist/templates/projects/productivity/entities/cards/cards.service.ts +18 -18
- package/dist/templates/projects/productivity/entities/lists/lists.service.ts +18 -18
- package/dist/templates/projects/productivity/lib/block-selectors.ts +29 -0
- package/dist/templates/projects/productivity/lib/selectors.ts +2 -9
- package/dist/templates/projects/productivity/package.json +1 -1
- package/dist/templates/projects/starter/lib/block-selectors.ts +28 -0
- package/dist/templates/projects/starter/lib/selectors.ts +2 -11
- package/package.json +6 -2
- package/templates/features/blog/blocks/post-content/component.tsx +1 -1
- package/templates/features/blog/entities/posts/posts.config.ts +0 -11
- package/templates/features/pages/blocks/hero/component.tsx +1 -1
- package/templates/features/pages/entities/pages/pages.config.ts +0 -11
- package/templates/projects/blog/lib/block-selectors.ts +29 -0
- package/templates/projects/blog/lib/selectors.ts +2 -9
- package/templates/projects/blog/package.json +1 -4
- package/templates/projects/crm/lib/block-selectors.ts +29 -0
- package/templates/projects/crm/lib/selectors.ts +2 -9
- package/templates/projects/crm/package.json +1 -1
- package/templates/projects/crm/templates/dashboard/(main)/layout.tsx +2 -17
- package/templates/projects/crm/templates/shared/CRMSidebarContext.tsx +23 -0
- package/templates/projects/productivity/entities/boards/boards.service.ts +18 -18
- package/templates/projects/productivity/entities/cards/cards.service.ts +18 -18
- package/templates/projects/productivity/entities/lists/lists.service.ts +18 -18
- package/templates/projects/productivity/lib/block-selectors.ts +29 -0
- package/templates/projects/productivity/lib/selectors.ts +2 -9
- package/templates/projects/productivity/package.json +1 -1
- package/templates/projects/starter/lib/block-selectors.ts +28 -0
- package/templates/projects/starter/lib/selectors.ts +2 -11
|
@@ -9,9 +9,9 @@ function getCurrentClientTheme() {
|
|
|
9
9
|
}
|
|
10
10
|
const ThemeContext = createContext(null);
|
|
11
11
|
function ThemeProvider({ children }) {
|
|
12
|
-
const [currentTheme, setCurrentTheme] = useState(null);
|
|
13
|
-
const [loading, setLoading] = useState(
|
|
14
|
-
const [error, setError] = useState();
|
|
12
|
+
const [currentTheme, setCurrentTheme] = useState(() => getCurrentClientTheme() ?? null);
|
|
13
|
+
const [loading, setLoading] = useState(false);
|
|
14
|
+
const [error, setError] = useState(() => getCurrentClientTheme() ? void 0 : "Project theme was not generated");
|
|
15
15
|
const loadTheme = React.useCallback(() => {
|
|
16
16
|
var _a;
|
|
17
17
|
try {
|
|
@@ -45,8 +45,10 @@ function ThemeProvider({ children }) {
|
|
|
45
45
|
});
|
|
46
46
|
}, [currentTheme, loadTheme]);
|
|
47
47
|
useEffect(() => {
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
var _a;
|
|
49
|
+
if (!currentTheme) console.error("[ThemeProvider] Project theme was not generated");
|
|
50
|
+
else if ((_a = currentTheme.styles) == null ? void 0 : _a.globals) applyThemeStyles(currentTheme);
|
|
51
|
+
}, []);
|
|
50
52
|
useEffect(() => {
|
|
51
53
|
if (process.env.NODE_ENV === "development") {
|
|
52
54
|
const handleHotReload = () => {
|
|
@@ -8,7 +8,7 @@ import { Alert, AlertDescription, AlertTitle } from "@nextsparkjs/core/component
|
|
|
8
8
|
import { Loader2, CheckCircle, XCircle, Users, LogIn, UserPlus } from "lucide-react";
|
|
9
9
|
import { toast } from "sonner";
|
|
10
10
|
import Link from "next/link";
|
|
11
|
-
import { sel } from "@nextsparkjs/core/
|
|
11
|
+
import { sel } from "@nextsparkjs/core/selectors/teams";
|
|
12
12
|
import { withBasePath } from "@nextsparkjs/core/lib/base-path";
|
|
13
13
|
function AcceptInvitePage() {
|
|
14
14
|
const params = useParams();
|
|
@@ -7,7 +7,7 @@ import { zodResolver } from "@hookform/resolvers/zod";
|
|
|
7
7
|
import { AlertCircle, ArrowLeft, CheckCircle, Loader2, Mail } from "lucide-react";
|
|
8
8
|
import Link from "next/link";
|
|
9
9
|
import { useState, useCallback } from "react";
|
|
10
|
-
import { sel } from "@nextsparkjs/core/
|
|
10
|
+
import { sel } from "@nextsparkjs/core/selectors/auth";
|
|
11
11
|
import { useTranslations } from "next-intl";
|
|
12
12
|
import { useForm } from "react-hook-form";
|
|
13
13
|
import { Button } from "@nextsparkjs/core/components/ui/button";
|
|
@@ -17,7 +17,7 @@ import { Label } from "@nextsparkjs/core/components/ui/label";
|
|
|
17
17
|
import { PasswordInput } from "@nextsparkjs/core/components/ui/password-input";
|
|
18
18
|
import { Alert, AlertDescription } from "@nextsparkjs/core/components/ui/alert";
|
|
19
19
|
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@nextsparkjs/core/components/ui/card";
|
|
20
|
-
import { sel } from "@nextsparkjs/core/
|
|
20
|
+
import { sel } from "@nextsparkjs/core/selectors/auth";
|
|
21
21
|
function ResetPasswordContent() {
|
|
22
22
|
const searchParams = useSearchParams();
|
|
23
23
|
const token = searchParams.get("token") || "";
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Signup page for a host with `cacheComponents` on (variant of ./page).
|
|
3
3
|
*
|
|
4
4
|
* Same page and metadata; `dynamic = 'force-dynamic'` is left out because Next.js fails a build that
|
|
5
|
-
* has it under Cache Components. The page reads the database and calls redirect()
|
|
6
|
-
*
|
|
5
|
+
* has it under Cache Components. The page reads the database and calls redirect(); under Cache Components
|
|
6
|
+
* the group or root layout puts it behind Suspense, so the redirect streams per request, after the static shell.
|
|
7
7
|
*/
|
|
8
8
|
export { default, metadata } from './page';
|
|
9
9
|
//# sourceMappingURL=page.cc.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Metadata } from 'next';
|
|
2
2
|
export declare const dynamic = "force-dynamic";
|
|
3
3
|
export declare const metadata: Metadata;
|
|
4
|
-
declare function SignupPage(): import("react/jsx-runtime").JSX.Element
|
|
4
|
+
declare function SignupPage(): Promise<import("react/jsx-runtime").JSX.Element>;
|
|
5
5
|
export default SignupPage;
|
|
6
6
|
//# sourceMappingURL=page.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../../../src/routes/(auth)/signup/page.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../../../src/routes/(auth)/signup/page.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAA;AASpC,eAAO,MAAM,OAAO,kBAAkB,CAAA;AAOtC,eAAO,MAAM,QAAQ,EAAE,QAA0B,CAAA;AAKjD,iBAAe,UAAU,qDA4BxB;AAED,eAAe,UAAU,CAAA"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Suspense } from "react";
|
|
3
2
|
import { redirect } from "next/navigation";
|
|
4
3
|
import { SignupForm } from "@nextsparkjs/core/components/auth/forms/SignupForm";
|
|
5
4
|
import { AUTH_CONFIG } from "@nextsparkjs/core/lib/config";
|
|
@@ -11,7 +10,7 @@ const defaultMetadata = {
|
|
|
11
10
|
description: "Create your account to start using our platform"
|
|
12
11
|
};
|
|
13
12
|
export const metadata = defaultMetadata;
|
|
14
|
-
async function
|
|
13
|
+
async function SignupPage() {
|
|
15
14
|
var _a, _b;
|
|
16
15
|
const registrationMode = ((_b = (_a = AUTH_CONFIG) == null ? void 0 : _a.registration) == null ? void 0 : _b.mode) ?? "open";
|
|
17
16
|
if (!resolveAuthMethods(AUTH_CONFIG).includes("email-password")) {
|
|
@@ -28,7 +27,4 @@ async function SignupPageContent() {
|
|
|
28
27
|
}
|
|
29
28
|
return /* @__PURE__ */ jsx(SignupForm, {});
|
|
30
29
|
}
|
|
31
|
-
function SignupPage() {
|
|
32
|
-
return /* @__PURE__ */ jsx(Suspense, { fallback: null, children: /* @__PURE__ */ jsx(SignupPageContent, {}) });
|
|
33
|
-
}
|
|
34
30
|
export default SignupPage;
|
|
@@ -5,7 +5,7 @@ import { useSearchParams, useRouter } from "next/navigation";
|
|
|
5
5
|
import { Suspense, useEffect, useState } from "react";
|
|
6
6
|
import { Button } from "@nextsparkjs/core/components/ui/button";
|
|
7
7
|
import { Alert, AlertDescription } from "@nextsparkjs/core/components/ui/alert";
|
|
8
|
-
import { sel } from "@nextsparkjs/core/
|
|
8
|
+
import { sel } from "@nextsparkjs/core/selectors/auth";
|
|
9
9
|
import { withBasePath } from "@nextsparkjs/core/lib/base-path";
|
|
10
10
|
function VerifyEmailContent() {
|
|
11
11
|
const searchParams = useSearchParams();
|
|
@@ -5,7 +5,7 @@ import { DOCS_REGISTRY } from "@nextsparkjs/registries/docs-registry";
|
|
|
5
5
|
import { parseMarkdownFile } from "@nextsparkjs/core/lib/docs/parser";
|
|
6
6
|
import { DocsBreadcrumbs } from "@nextsparkjs/core/components/docs/docs-breadcrumbs";
|
|
7
7
|
import { DocsContent } from "@nextsparkjs/core/components/docs/docs-content";
|
|
8
|
-
import { sel } from "@nextsparkjs/core/
|
|
8
|
+
import { sel } from "@nextsparkjs/core/selectors/public";
|
|
9
9
|
import { getTranslations } from "next-intl/server";
|
|
10
10
|
import path from "path";
|
|
11
11
|
export async function generateStaticParams() {
|
|
@@ -4,7 +4,7 @@ import { DOCS_REGISTRY } from "@nextsparkjs/registries/docs-registry";
|
|
|
4
4
|
import { parseMarkdownFile } from "@nextsparkjs/core/lib/docs/parser";
|
|
5
5
|
import { DocsBreadcrumbs } from "@nextsparkjs/core/components/docs/docs-breadcrumbs";
|
|
6
6
|
import { DocsContent } from "@nextsparkjs/core/components/docs/docs-content";
|
|
7
|
-
import { sel } from "@nextsparkjs/core/
|
|
7
|
+
import { sel } from "@nextsparkjs/core/selectors/public";
|
|
8
8
|
import { getTranslations } from "next-intl/server";
|
|
9
9
|
import path from "path";
|
|
10
10
|
export const dynamicParams = false;
|
|
@@ -3,7 +3,7 @@ import { Suspense } from "react";
|
|
|
3
3
|
import { DocsLayout } from "@nextsparkjs/core/components/docs/docs-layout";
|
|
4
4
|
import { DocsSidebar } from "@nextsparkjs/core/components/docs/docs-sidebar";
|
|
5
5
|
import { DOCS_REGISTRY } from "@nextsparkjs/registries/docs-registry";
|
|
6
|
-
import { sel } from "@nextsparkjs/core/
|
|
6
|
+
import { sel } from "@nextsparkjs/core/selectors/public";
|
|
7
7
|
export default function DocsLayoutPage({
|
|
8
8
|
children
|
|
9
9
|
}) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@nextsparkjs/core/components/ui/card";
|
|
3
3
|
import { DOCS_REGISTRY } from "@nextsparkjs/registries/docs-registry";
|
|
4
|
-
import { sel } from "@nextsparkjs/core/
|
|
4
|
+
import { sel } from "@nextsparkjs/core/selectors/public";
|
|
5
5
|
import { BookOpen, Folder, FileText, ArrowRight } from "lucide-react";
|
|
6
6
|
import Link from "next/link";
|
|
7
7
|
export const metadata = {
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Core's default public layout. A module of its own: the composition module (./public-layout) and the metadata a
|
|
3
3
|
* project override keeps are imported without it, so an override's route ships none of its client components.
|
|
4
|
+
*
|
|
5
|
+
* `children` is not behind a Suspense boundary: one makes a `notFound()` thrown by a public page (the `[slug]` of the
|
|
6
|
+
* pages entity) arrive in the stream after the head went out, so an unknown URL answers 200 instead of 404 in the
|
|
7
|
+
* legacy host. The Cache Components wrapper (group-layouts.cc) puts its own boundary around the page, which that
|
|
8
|
+
* mode needs.
|
|
4
9
|
*/
|
|
5
10
|
export declare function DefaultPublicLayout({ children }: {
|
|
6
11
|
children: React.ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default-public-layout.d.ts","sourceRoot":"","sources":["../../../src/routes/_internal/default-public-layout.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"default-public-layout.d.ts","sourceRoot":"","sources":["../../../src/routes/_internal/default-public-layout.tsx"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,QAAQ,EACT,EAAE;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B,2CAeA"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Suspense } from "react";
|
|
3
2
|
import { PublicNavbar } from "@nextsparkjs/core/components/app/layouts/PublicNavbar";
|
|
4
3
|
import { PublicFooter } from "@nextsparkjs/core/components/app/layouts/PublicFooter";
|
|
5
4
|
export function DefaultPublicLayout({
|
|
@@ -7,7 +6,7 @@ export function DefaultPublicLayout({
|
|
|
7
6
|
}) {
|
|
8
7
|
return /* @__PURE__ */ jsxs("div", { className: "min-h-screen bg-background flex flex-col", children: [
|
|
9
8
|
/* @__PURE__ */ jsx(PublicNavbar, {}),
|
|
10
|
-
/* @__PURE__ */ jsx("main", { className: "flex-1", children
|
|
9
|
+
/* @__PURE__ */ jsx("main", { className: "flex-1", children }),
|
|
11
10
|
/* @__PURE__ */ jsx(PublicFooter, {})
|
|
12
11
|
] });
|
|
13
12
|
}
|
|
@@ -11,7 +11,10 @@ interface BlockDetailPageProps {
|
|
|
11
11
|
*/
|
|
12
12
|
export default function BlockDetailPage({ params }: BlockDetailPageProps): Promise<import("react/jsx-runtime").JSX.Element>;
|
|
13
13
|
/**
|
|
14
|
-
* Generate static params for all blocks
|
|
14
|
+
* Generate static params for all blocks.
|
|
15
|
+
*
|
|
16
|
+
* Cache Components needs at least one result. A project with no blocks (the productivity template) returns a
|
|
17
|
+
* placeholder no block matches, so the page answers notFound() instead of failing the build.
|
|
15
18
|
*/
|
|
16
19
|
export declare function generateStaticParams(): Promise<{
|
|
17
20
|
slug: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../../../../src/routes/devtools/blocks/[slug]/page.tsx"],"names":[],"mappings":"AAIA,UAAU,oBAAoB;IAC5B,MAAM,EAAE,OAAO,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;KACd,CAAC,CAAC;CACJ;AAED;;;;;GAKG;AACH,wBAA8B,eAAe,CAAC,EAAE,MAAM,EAAE,EAAE,oBAAoB,oDAa7E;AAED
|
|
1
|
+
{"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../../../../src/routes/devtools/blocks/[slug]/page.tsx"],"names":[],"mappings":"AAIA,UAAU,oBAAoB;IAC5B,MAAM,EAAE,OAAO,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;KACd,CAAC,CAAC;CACJ;AAED;;;;;GAKG;AACH,wBAA8B,eAAe,CAAC,EAAE,MAAM,EAAE,EAAE,oBAAoB,oDAa7E;AAED;;;;;GAKG;AACH,wBAAsB,oBAAoB;;KAKzC"}
|
|
@@ -10,7 +10,8 @@ export default async function BlockDetailPage({ params }) {
|
|
|
10
10
|
return /* @__PURE__ */ jsx("div", { className: "space-y-6", "data-cy": `devtools-block-detail-${slug}`, children: /* @__PURE__ */ jsx(BlockDetailViewer, { slug }) });
|
|
11
11
|
}
|
|
12
12
|
export async function generateStaticParams() {
|
|
13
|
-
|
|
13
|
+
const slugs = Object.keys(BLOCK_REGISTRY);
|
|
14
|
+
return (slugs.length > 0 ? slugs : ["_none"]).map((slug) => ({
|
|
14
15
|
slug
|
|
15
16
|
}));
|
|
16
17
|
}
|
|
@@ -2,7 +2,7 @@ import React from 'react'
|
|
|
2
2
|
import { cn } from '@nextsparkjs/core/lib/utils'
|
|
3
3
|
import { buildSectionClasses } from '@nextsparkjs/core/types/blocks'
|
|
4
4
|
import { sanitizeBlockHtml } from '@nextsparkjs/core/lib/blocks/sanitize-html'
|
|
5
|
-
import { sel } from '../../lib/selectors'
|
|
5
|
+
import { sel } from '../../lib/block-selectors'
|
|
6
6
|
import type { PostContentBlockProps } from './schema'
|
|
7
7
|
import { withBasePathIfInApp } from '@nextsparkjs/core/lib/base-path'
|
|
8
8
|
|
|
@@ -65,17 +65,6 @@ export const postsEntityConfig: EntityConfig = {
|
|
|
65
65
|
// Permissions are now centralized in permissions.config.ts
|
|
66
66
|
// See: config/permissions.config.ts -> entities.posts
|
|
67
67
|
|
|
68
|
-
// ==========================================
|
|
69
|
-
// 5. INTERNATIONALIZATION
|
|
70
|
-
// ==========================================
|
|
71
|
-
i18n: {
|
|
72
|
-
fallbackLocale: 'en',
|
|
73
|
-
loaders: {
|
|
74
|
-
en: () => import('./messages/en.json'),
|
|
75
|
-
es: () => import('./messages/es.json'),
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
|
|
79
68
|
// ==========================================
|
|
80
69
|
// 6. BUILDER CONFIGURATION
|
|
81
70
|
// ==========================================
|
|
@@ -2,7 +2,7 @@ import React from 'react'
|
|
|
2
2
|
import { Button } from '@nextsparkjs/core/components/ui/button'
|
|
3
3
|
import { cn } from '@nextsparkjs/core/lib/utils'
|
|
4
4
|
import { buildSectionClasses, resolveMediaUrl } from '@nextsparkjs/core/types/blocks'
|
|
5
|
-
import { sel } from '../../lib/selectors'
|
|
5
|
+
import { sel } from '../../lib/block-selectors'
|
|
6
6
|
import type { HeroBlockProps } from './schema'
|
|
7
7
|
import { withBasePathIfInApp } from '@nextsparkjs/core/lib/base-path'
|
|
8
8
|
|
|
@@ -65,17 +65,6 @@ export const pagesEntityConfig: EntityConfig = {
|
|
|
65
65
|
// Permissions are now centralized in permissions.config.ts
|
|
66
66
|
// See: config/permissions.config.ts -> entities.pages
|
|
67
67
|
|
|
68
|
-
// ==========================================
|
|
69
|
-
// 5. INTERNATIONALIZATION
|
|
70
|
-
// ==========================================
|
|
71
|
-
i18n: {
|
|
72
|
-
fallbackLocale: 'en',
|
|
73
|
-
loaders: {
|
|
74
|
-
en: () => import('./messages/en.json'),
|
|
75
|
-
es: () => import('./messages/es.json'),
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
|
|
79
68
|
// ==========================================
|
|
80
69
|
// 6. BUILDER CONFIGURATION
|
|
81
70
|
// ==========================================
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Block selectors, and a `sel` bound to them alone.
|
|
3
|
+
*
|
|
4
|
+
* Block components import `sel` from here, not from ./selectors: that file merges CORE_SELECTORS (every domain's
|
|
5
|
+
* map, ~10 kB gzip), and the loader that renders a page imports every block, so a block importing it puts the
|
|
6
|
+
* whole map on each public page. ./selectors re-exports BLOCK_SELECTORS, so Cypress still reaches the same paths.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { createSelectorHelpers } from '@nextsparkjs/core/lib/selectors/selector-factory'
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Block-specific selectors for the blog theme.
|
|
13
|
+
* Each block has at minimum a 'container' selector.
|
|
14
|
+
* Dynamic selectors use {index} placeholder.
|
|
15
|
+
*/
|
|
16
|
+
export const BLOCK_SELECTORS = {
|
|
17
|
+
// Blocks the pages and blog content features copy into the project (blocks/hero, blocks/post-content)
|
|
18
|
+
hero: {
|
|
19
|
+
container: 'block-hero',
|
|
20
|
+
cta: 'hero-cta',
|
|
21
|
+
},
|
|
22
|
+
postContent: {
|
|
23
|
+
container: 'block-post-content',
|
|
24
|
+
divider: 'post-content-divider',
|
|
25
|
+
cta: 'post-content-cta',
|
|
26
|
+
},
|
|
27
|
+
} as const
|
|
28
|
+
|
|
29
|
+
export const { sel } = createSelectorHelpers({ blocks: BLOCK_SELECTORS })
|
|
@@ -10,20 +10,13 @@
|
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
import { createSelectorHelpers, CORE_SELECTORS } from '@nextsparkjs/core/selectors'
|
|
13
|
+
import { BLOCK_SELECTORS } from './block-selectors'
|
|
13
14
|
|
|
14
15
|
// =============================================================================
|
|
15
16
|
// BLOCK SELECTORS
|
|
16
17
|
// =============================================================================
|
|
17
18
|
|
|
18
|
-
|
|
19
|
-
* Block-specific selectors for the blog theme.
|
|
20
|
-
* Each block has at minimum a 'container' selector.
|
|
21
|
-
* Dynamic selectors use {index} placeholder.
|
|
22
|
-
*/
|
|
23
|
-
export const BLOCK_SELECTORS = {
|
|
24
|
-
// Blog theme currently has no custom blocks
|
|
25
|
-
// Add block selectors here when blocks are created
|
|
26
|
-
} as const
|
|
19
|
+
export { BLOCK_SELECTORS }
|
|
27
20
|
|
|
28
21
|
// =============================================================================
|
|
29
22
|
// ENTITY SELECTORS
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nextsparkjs/theme-blog",
|
|
3
3
|
"version": "0.1.0-beta.192",
|
|
4
|
-
"private":
|
|
4
|
+
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./config/theme.config.ts",
|
|
7
7
|
"requiredPlugins": [],
|
|
@@ -23,8 +23,5 @@
|
|
|
23
23
|
"nextspark": {
|
|
24
24
|
"type": "theme",
|
|
25
25
|
"name": "blog"
|
|
26
|
-
},
|
|
27
|
-
"devDependencies": {
|
|
28
|
-
"@types/dompurify": "^3.2.0"
|
|
29
26
|
}
|
|
30
27
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Block selectors, and a `sel` bound to them alone.
|
|
3
|
+
*
|
|
4
|
+
* Block components import `sel` from here, not from ./selectors: that file merges CORE_SELECTORS (every domain's
|
|
5
|
+
* map, ~10 kB gzip), and the loader that renders a page imports every block, so a block importing it puts the
|
|
6
|
+
* whole map on each public page. ./selectors re-exports BLOCK_SELECTORS, so Cypress still reaches the same paths.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { createSelectorHelpers } from '@nextsparkjs/core/lib/selectors/selector-factory'
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Block-specific selectors for the CRM theme.
|
|
13
|
+
* Each block has at minimum a 'container' selector.
|
|
14
|
+
* Dynamic selectors use {index} placeholder.
|
|
15
|
+
*/
|
|
16
|
+
export const BLOCK_SELECTORS = {
|
|
17
|
+
// Blocks the pages and blog content features copy into the project (blocks/hero, blocks/post-content)
|
|
18
|
+
hero: {
|
|
19
|
+
container: 'block-hero',
|
|
20
|
+
cta: 'hero-cta',
|
|
21
|
+
},
|
|
22
|
+
postContent: {
|
|
23
|
+
container: 'block-post-content',
|
|
24
|
+
divider: 'post-content-divider',
|
|
25
|
+
cta: 'post-content-cta',
|
|
26
|
+
},
|
|
27
|
+
} as const
|
|
28
|
+
|
|
29
|
+
export const { sel } = createSelectorHelpers({ blocks: BLOCK_SELECTORS })
|
|
@@ -10,20 +10,13 @@
|
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
import { createSelectorHelpers, CORE_SELECTORS } from '@nextsparkjs/core/selectors'
|
|
13
|
+
import { BLOCK_SELECTORS } from './block-selectors'
|
|
13
14
|
|
|
14
15
|
// =============================================================================
|
|
15
16
|
// BLOCK SELECTORS
|
|
16
17
|
// =============================================================================
|
|
17
18
|
|
|
18
|
-
|
|
19
|
-
* Block-specific selectors for the CRM theme.
|
|
20
|
-
* Each block has at minimum a 'container' selector.
|
|
21
|
-
* Dynamic selectors use {index} placeholder.
|
|
22
|
-
*/
|
|
23
|
-
export const BLOCK_SELECTORS = {
|
|
24
|
-
// CRM theme currently has no custom blocks
|
|
25
|
-
// Add block selectors here when blocks are created
|
|
26
|
-
} as const
|
|
19
|
+
export { BLOCK_SELECTORS }
|
|
27
20
|
|
|
28
21
|
// =============================================================================
|
|
29
22
|
// ENTITY SELECTORS
|
|
@@ -5,28 +5,13 @@
|
|
|
5
5
|
|
|
6
6
|
'use client'
|
|
7
7
|
|
|
8
|
-
import { useState,
|
|
8
|
+
import { useState, ReactNode, useEffect } from 'react'
|
|
9
9
|
import { CRMSidebar } from '@/templates/shared/CRMSidebar'
|
|
10
10
|
import { CRMTopBar } from '@/templates/shared/CRMTopBar'
|
|
11
11
|
import { CRMMobileNav } from '@/templates/shared/CRMMobileNav'
|
|
12
|
+
import { SidebarContext } from '@/templates/shared/CRMSidebarContext'
|
|
12
13
|
import { cn } from '@nextsparkjs/core/lib/utils'
|
|
13
14
|
|
|
14
|
-
// Context for sidebar state
|
|
15
|
-
interface SidebarContextValue {
|
|
16
|
-
expanded: boolean
|
|
17
|
-
setExpanded: (value: boolean) => void
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
const SidebarContext = createContext<SidebarContextValue | undefined>(undefined)
|
|
21
|
-
|
|
22
|
-
export function useCRMSidebar() {
|
|
23
|
-
const context = useContext(SidebarContext)
|
|
24
|
-
if (!context) {
|
|
25
|
-
return { expanded: false, setExpanded: () => {} }
|
|
26
|
-
}
|
|
27
|
-
return context
|
|
28
|
-
}
|
|
29
|
-
|
|
30
15
|
interface CRMDashboardLayoutProps {
|
|
31
16
|
children: ReactNode
|
|
32
17
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CRM sidebar state, shared by the dashboard layout (provider) and any component that reads it.
|
|
3
|
+
* Lives outside the layout: Next only allows a layout to export its default component.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
'use client'
|
|
7
|
+
|
|
8
|
+
import { createContext, useContext } from 'react'
|
|
9
|
+
|
|
10
|
+
export interface SidebarContextValue {
|
|
11
|
+
expanded: boolean
|
|
12
|
+
setExpanded: (value: boolean) => void
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const SidebarContext = createContext<SidebarContextValue | undefined>(undefined)
|
|
16
|
+
|
|
17
|
+
export function useCRMSidebar() {
|
|
18
|
+
const context = useContext(SidebarContext)
|
|
19
|
+
if (!context) {
|
|
20
|
+
return { expanded: false, setExpanded: () => {} }
|
|
21
|
+
}
|
|
22
|
+
return context
|
|
23
|
+
}
|
|
@@ -82,9 +82,9 @@ export class BoardsService {
|
|
|
82
82
|
*/
|
|
83
83
|
static async getById(id: string, userId: string): Promise<Board | null> {
|
|
84
84
|
const result = await queryOneWithRLS<DbBoard>(
|
|
85
|
-
userId,
|
|
86
85
|
`SELECT * FROM boards WHERE id = $1`,
|
|
87
|
-
[id]
|
|
86
|
+
[id],
|
|
87
|
+
userId
|
|
88
88
|
)
|
|
89
89
|
|
|
90
90
|
return result ? mapDbBoard(result) : null
|
|
@@ -121,9 +121,9 @@ export class BoardsService {
|
|
|
121
121
|
|
|
122
122
|
// Get total count
|
|
123
123
|
const countResult = await queryOneWithRLS<{ count: string }>(
|
|
124
|
-
userId,
|
|
125
124
|
`SELECT COUNT(*) as count FROM boards ${whereClause}`,
|
|
126
|
-
params
|
|
125
|
+
params,
|
|
126
|
+
userId
|
|
127
127
|
)
|
|
128
128
|
const total = parseInt(countResult?.count || '0', 10)
|
|
129
129
|
|
|
@@ -135,9 +135,9 @@ export class BoardsService {
|
|
|
135
135
|
|
|
136
136
|
params.push(limit, offset)
|
|
137
137
|
const boards = await queryWithRLS<DbBoard>(
|
|
138
|
-
userId,
|
|
139
138
|
`SELECT * FROM boards ${whereClause} ORDER BY ${validOrderBy} ${validOrderDir} LIMIT $${paramIndex++} OFFSET $${paramIndex++}`,
|
|
140
|
-
params
|
|
139
|
+
params,
|
|
140
|
+
userId
|
|
141
141
|
)
|
|
142
142
|
|
|
143
143
|
return {
|
|
@@ -173,13 +173,13 @@ export class BoardsService {
|
|
|
173
173
|
teamId,
|
|
174
174
|
} = data
|
|
175
175
|
|
|
176
|
-
const result = await mutateWithRLS<DbBoard>(
|
|
177
|
-
userId,
|
|
176
|
+
const result = (await mutateWithRLS<DbBoard>(
|
|
178
177
|
`INSERT INTO boards (name, description, color, is_archived, position, user_id, team_id)
|
|
179
178
|
VALUES ($1, $2, $3, $4, $5, $6, $7)
|
|
180
179
|
RETURNING *`,
|
|
181
|
-
[name, description, color, isArchived, position, userId, teamId]
|
|
182
|
-
|
|
180
|
+
[name, description, color, isArchived, position, userId, teamId],
|
|
181
|
+
userId
|
|
182
|
+
)).rows[0] ?? null
|
|
183
183
|
|
|
184
184
|
if (!result) {
|
|
185
185
|
throw new Error('Failed to create board')
|
|
@@ -228,11 +228,11 @@ export class BoardsService {
|
|
|
228
228
|
updates.push(`updated_at = NOW()`)
|
|
229
229
|
params.push(id)
|
|
230
230
|
|
|
231
|
-
const result = await mutateWithRLS<DbBoard>(
|
|
232
|
-
userId,
|
|
231
|
+
const result = (await mutateWithRLS<DbBoard>(
|
|
233
232
|
`UPDATE boards SET ${updates.join(', ')} WHERE id = $${paramIndex} RETURNING *`,
|
|
234
|
-
params
|
|
235
|
-
|
|
233
|
+
params,
|
|
234
|
+
userId
|
|
235
|
+
)).rows[0] ?? null
|
|
236
236
|
|
|
237
237
|
if (!result) {
|
|
238
238
|
throw new Error('Board not found or access denied')
|
|
@@ -245,11 +245,11 @@ export class BoardsService {
|
|
|
245
245
|
* Delete a board with RLS
|
|
246
246
|
*/
|
|
247
247
|
static async delete(userId: string, id: string): Promise<boolean> {
|
|
248
|
-
const result = await mutateWithRLS<DbBoard>(
|
|
249
|
-
userId,
|
|
248
|
+
const result = (await mutateWithRLS<DbBoard>(
|
|
250
249
|
`DELETE FROM boards WHERE id = $1 RETURNING *`,
|
|
251
|
-
[id]
|
|
252
|
-
|
|
250
|
+
[id],
|
|
251
|
+
userId
|
|
252
|
+
)).rows[0] ?? null
|
|
253
253
|
|
|
254
254
|
return result !== null
|
|
255
255
|
}
|
|
@@ -105,9 +105,9 @@ export class CardsService {
|
|
|
105
105
|
*/
|
|
106
106
|
static async getById(id: string, userId: string): Promise<Card | null> {
|
|
107
107
|
const result = await queryOneWithRLS<DbCard>(
|
|
108
|
-
userId,
|
|
109
108
|
`SELECT * FROM cards WHERE id = $1`,
|
|
110
|
-
[id]
|
|
109
|
+
[id],
|
|
110
|
+
userId
|
|
111
111
|
)
|
|
112
112
|
|
|
113
113
|
return result ? mapDbCard(result) : null
|
|
@@ -162,9 +162,9 @@ export class CardsService {
|
|
|
162
162
|
|
|
163
163
|
// Get total count
|
|
164
164
|
const countResult = await queryOneWithRLS<{ count: string }>(
|
|
165
|
-
userId,
|
|
166
165
|
`SELECT COUNT(*) as count FROM cards ${whereClause}`,
|
|
167
|
-
params
|
|
166
|
+
params,
|
|
167
|
+
userId
|
|
168
168
|
)
|
|
169
169
|
const total = parseInt(countResult?.count || '0', 10)
|
|
170
170
|
|
|
@@ -176,9 +176,9 @@ export class CardsService {
|
|
|
176
176
|
|
|
177
177
|
params.push(limit, offset)
|
|
178
178
|
const cards = await queryWithRLS<DbCard>(
|
|
179
|
-
userId,
|
|
180
179
|
`SELECT * FROM cards ${whereClause} ORDER BY ${validOrderBy} ${validOrderDir} LIMIT $${paramIndex++} OFFSET $${paramIndex++}`,
|
|
181
|
-
params
|
|
180
|
+
params,
|
|
181
|
+
userId
|
|
182
182
|
)
|
|
183
183
|
|
|
184
184
|
return {
|
|
@@ -218,13 +218,13 @@ export class CardsService {
|
|
|
218
218
|
teamId,
|
|
219
219
|
} = data
|
|
220
220
|
|
|
221
|
-
const result = await mutateWithRLS<DbCard>(
|
|
222
|
-
userId,
|
|
221
|
+
const result = (await mutateWithRLS<DbCard>(
|
|
223
222
|
`INSERT INTO cards (title, description, list_id, board_id, position, due_date, assignee_id, labels, is_archived, user_id, team_id)
|
|
224
223
|
VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11)
|
|
225
224
|
RETURNING *`,
|
|
226
|
-
[title, description, listId, boardId, position, dueDate, assigneeId, JSON.stringify(labels), isArchived, userId, teamId]
|
|
227
|
-
|
|
225
|
+
[title, description, listId, boardId, position, dueDate, assigneeId, JSON.stringify(labels), isArchived, userId, teamId],
|
|
226
|
+
userId
|
|
227
|
+
)).rows[0] ?? null
|
|
228
228
|
|
|
229
229
|
if (!result) {
|
|
230
230
|
throw new Error('Failed to create card')
|
|
@@ -293,11 +293,11 @@ export class CardsService {
|
|
|
293
293
|
updates.push(`updated_at = NOW()`)
|
|
294
294
|
params.push(id)
|
|
295
295
|
|
|
296
|
-
const result = await mutateWithRLS<DbCard>(
|
|
297
|
-
userId,
|
|
296
|
+
const result = (await mutateWithRLS<DbCard>(
|
|
298
297
|
`UPDATE cards SET ${updates.join(', ')} WHERE id = $${paramIndex} RETURNING *`,
|
|
299
|
-
params
|
|
300
|
-
|
|
298
|
+
params,
|
|
299
|
+
userId
|
|
300
|
+
)).rows[0] ?? null
|
|
301
301
|
|
|
302
302
|
if (!result) {
|
|
303
303
|
throw new Error('Card not found or access denied')
|
|
@@ -325,11 +325,11 @@ export class CardsService {
|
|
|
325
325
|
* Delete a card with RLS
|
|
326
326
|
*/
|
|
327
327
|
static async delete(userId: string, id: string): Promise<boolean> {
|
|
328
|
-
const result = await mutateWithRLS<DbCard>(
|
|
329
|
-
userId,
|
|
328
|
+
const result = (await mutateWithRLS<DbCard>(
|
|
330
329
|
`DELETE FROM cards WHERE id = $1 RETURNING *`,
|
|
331
|
-
[id]
|
|
332
|
-
|
|
330
|
+
[id],
|
|
331
|
+
userId
|
|
332
|
+
)).rows[0] ?? null
|
|
333
333
|
|
|
334
334
|
return result !== null
|
|
335
335
|
}
|