@drawnagency/primitives 0.1.49 → 0.1.51
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/{chunk-BJ6FYGYP.js → chunk-24SUF2BC.js} +98 -9
- package/dist/{chunk-P3HO76OS.js → chunk-KDGYHU36.js} +6 -3
- package/dist/{chunk-5XYUO4HP.js → chunk-PUNXQK4M.js} +19 -2
- package/dist/components/editor/MoveSectionModal.d.ts +12 -0
- package/dist/components/editor/MoveSectionModal.d.ts.map +1 -0
- package/dist/components/editor/PagesModal.d.ts +18 -0
- package/dist/components/editor/PagesModal.d.ts.map +1 -0
- package/dist/components/editor/SectionWrapper.d.ts +1 -1
- package/dist/components/editor/SectionWrapper.d.ts.map +1 -1
- package/dist/components/editor/SettingsForm.d.ts.map +1 -1
- package/dist/components/primitives/LinkPopover.d.ts.map +1 -1
- package/dist/components/primitives/tiptap-presets.d.ts.map +1 -1
- package/dist/components/sections/Button/CTAButton.d.ts +3 -3
- package/dist/components/sections/Button/CTAButton.d.ts.map +1 -1
- package/dist/components/sections/Button/index.d.ts +10 -2
- package/dist/components/sections/Button/index.d.ts.map +1 -1
- package/dist/components/shared/Input.d.ts +1 -0
- package/dist/components/shared/Input.d.ts.map +1 -1
- package/dist/components/shared/LinkField.d.ts +9 -0
- package/dist/components/shared/LinkField.d.ts.map +1 -0
- package/dist/components/shared/Navigation.d.ts +4 -3
- package/dist/components/shared/Navigation.d.ts.map +1 -1
- package/dist/components/shared/PagesContext.d.ts +13 -0
- package/dist/components/shared/PagesContext.d.ts.map +1 -0
- package/dist/components/shared/RadioGroup.d.ts +15 -0
- package/dist/components/shared/RadioGroup.d.ts.map +1 -0
- package/dist/components/shell/EditorShell.d.ts.map +1 -1
- package/dist/components/shell/SiteSettingsDisplay.d.ts.map +1 -1
- package/dist/hooks/useBuildStatus.d.ts.map +1 -1
- package/dist/index.js +17 -3
- package/dist/lib/dexie.d.ts.map +1 -1
- package/dist/lib/dexie.js +16 -3
- package/dist/lib/events.d.ts +3 -1
- package/dist/lib/events.d.ts.map +1 -1
- package/dist/lib/index.js +2 -2
- package/dist/lib/links.d.ts +25 -0
- package/dist/lib/links.d.ts.map +1 -0
- package/dist/lib/loader.d.ts +2 -2
- package/dist/lib/loader.d.ts.map +1 -1
- package/dist/lib/nav.d.ts +23 -0
- package/dist/lib/nav.d.ts.map +1 -1
- package/dist/lib/pages.d.ts +31 -0
- package/dist/lib/pages.d.ts.map +1 -0
- package/dist/lib/registry.d.ts +7 -0
- package/dist/lib/registry.d.ts.map +1 -1
- package/dist/schemas/index.d.ts +1 -0
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +17 -3
- package/dist/schemas/link.d.ts +24 -0
- package/dist/schemas/link.d.ts.map +1 -0
- package/dist/schemas/site-config.d.ts +129 -3
- package/dist/schemas/site-config.d.ts.map +1 -1
- package/package.json +5 -1
- package/src/components/editor/MoveSectionModal.tsx +36 -0
- package/src/components/editor/PagesModal.tsx +400 -0
- package/src/components/editor/SectionWrapper.tsx +13 -0
- package/src/components/editor/SettingsForm.tsx +12 -0
- package/src/components/primitives/LinkPopover.tsx +99 -27
- package/src/components/primitives/tiptap-presets.ts +3 -1
- package/src/components/sections/Button/CTAButton.tsx +10 -11
- package/src/components/sections/Button/index.tsx +4 -9
- package/src/components/shared/Input.tsx +14 -3
- package/src/components/shared/LinkField.tsx +90 -0
- package/src/components/shared/Navigation.tsx +147 -137
- package/src/components/shared/PagesContext.tsx +12 -0
- package/src/components/shared/RadioGroup.tsx +71 -0
- package/src/components/shell/EditorShell.tsx +273 -78
- package/src/components/shell/SiteSettingsDisplay.tsx +65 -0
- package/src/hooks/useBuildStatus.ts +19 -4
- package/src/hooks/useEditorPublish.ts +1 -1
- package/src/lib/dexie.ts +18 -5
- package/src/lib/events.ts +3 -1
- package/src/lib/links.ts +108 -0
- package/src/lib/loader.ts +5 -4
- package/src/lib/nav.ts +59 -0
- package/src/lib/pages.ts +209 -0
- package/src/lib/registry.ts +8 -0
- package/src/schemas/index.ts +1 -0
- package/src/schemas/link.ts +17 -0
- package/src/schemas/site-config.ts +119 -11
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"links.d.ts","sourceRoot":"","sources":["../../src/lib/links.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAIjD,wBAAgB,eAAe,CAC7B,IAAI,EAAE,SAAS,EACf,KAAK,EAAE,SAAS,EAChB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,GAC9C;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAWlC;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAEpF;AAED,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,MAAM,GACX;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GAAG,IAAI,CAG3D;AAwBD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,SAAS,EAChB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,GAC9C,OAAO,CAoCT"}
|
package/dist/lib/loader.d.ts
CHANGED
|
@@ -11,13 +11,13 @@ export interface SiteContent {
|
|
|
11
11
|
/**
|
|
12
12
|
* Merge a validated index with raw section file contents.
|
|
13
13
|
* Validates each section file against its Zod schema.
|
|
14
|
-
* Returns sections in the order
|
|
14
|
+
* Returns sections in the concatenated order of every page's order.
|
|
15
15
|
*/
|
|
16
16
|
export declare function mergeSiteContent(index: SiteIndex, sectionFiles: Record<string, unknown>): SiteContent;
|
|
17
17
|
/**
|
|
18
18
|
* Build a SiteContent from a Vite `import.meta.glob` result.
|
|
19
19
|
* Callers glob the section JSON files at build time, pass the parsed index, and
|
|
20
|
-
* receive sections merged
|
|
20
|
+
* receive sections merged across every page's order.
|
|
21
21
|
*/
|
|
22
22
|
export declare function loadStaticSiteContent(index: SiteIndex, sectionGlob: Record<string, unknown>): SiteContent;
|
|
23
23
|
/**
|
package/dist/lib/loader.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/lib/loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAe,KAAK,SAAS,EAAE,KAAK,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAGvF,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,WAAW,CAAC;CACnB;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,KAAK,EAAE,SAAS,CAAC;CAClB;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,SAAS,EAChB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACpC,WAAW,
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/lib/loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAe,KAAK,SAAS,EAAE,KAAK,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAGvF,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,WAAW,CAAC;CACnB;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,KAAK,EAAE,SAAS,CAAC;CAClB;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,SAAS,EAChB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACpC,WAAW,CA6Bb;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,SAAS,EAChB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACnC,WAAW,CAQb;AAED;;;GAGG;AACH,wBAAsB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAe9E"}
|
package/dist/lib/nav.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { LoadedSection } from "./loader";
|
|
2
2
|
import { type SectionRegistry } from "./registry";
|
|
3
|
+
import type { SiteIndex } from "../schemas/site-config";
|
|
3
4
|
export interface NavItem {
|
|
4
5
|
href: string;
|
|
5
6
|
label: string;
|
|
@@ -8,4 +9,26 @@ export interface NavItem {
|
|
|
8
9
|
}
|
|
9
10
|
export declare function toSectionId(text: string): string;
|
|
10
11
|
export declare function generateNavLinks(sections: LoadedSection[], registry?: SectionRegistry): NavItem[];
|
|
12
|
+
export interface PageNavItem {
|
|
13
|
+
id: string;
|
|
14
|
+
title: string;
|
|
15
|
+
href: string;
|
|
16
|
+
slug: string;
|
|
17
|
+
isActive: boolean;
|
|
18
|
+
headings: NavItem[];
|
|
19
|
+
}
|
|
20
|
+
export interface SiteNav {
|
|
21
|
+
pages: PageNavItem[];
|
|
22
|
+
/** Live pages with showInNav off — editor-only group, like the archive. */
|
|
23
|
+
hidden: PageNavItem[];
|
|
24
|
+
archive: PageNavItem[];
|
|
25
|
+
}
|
|
26
|
+
export declare function generateSiteNav(opts: {
|
|
27
|
+
index: SiteIndex;
|
|
28
|
+
activeSections: LoadedSection[];
|
|
29
|
+
activePageId: string | null;
|
|
30
|
+
mode: "viewer" | "editor";
|
|
31
|
+
audience: string | null;
|
|
32
|
+
registry?: SectionRegistry;
|
|
33
|
+
}): SiteNav;
|
|
11
34
|
//# sourceMappingURL=nav.d.ts.map
|
package/dist/lib/nav.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nav.d.ts","sourceRoot":"","sources":["../../src/lib/nav.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,YAAY,CAAC;AAE9D,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,OAAO,EAAE,CAAC;CACrB;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAchD;AAED,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,aAAa,EAAE,EACzB,QAAQ,CAAC,EAAE,eAAe,GACzB,OAAO,EAAE,CAqDX"}
|
|
1
|
+
{"version":3,"file":"nav.d.ts","sourceRoot":"","sources":["../../src/lib/nav.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,YAAY,CAAC;AAE9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,OAAO,EAAE,CAAC;CACrB;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAchD;AAED,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,aAAa,EAAE,EACzB,QAAQ,CAAC,EAAE,eAAe,GACzB,OAAO,EAAE,CAqDX;AAED,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,OAAO;IACtB,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,2EAA2E;IAC3E,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,OAAO,EAAE,WAAW,EAAE,CAAC;CACxB;AAMD,wBAAgB,eAAe,CAAC,IAAI,EAAE;IACpC,KAAK,EAAE,SAAS,CAAC;IACjB,cAAc,EAAE,aAAa,EAAE,CAAC;IAChC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,IAAI,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC1B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,QAAQ,CAAC,EAAE,eAAe,CAAC;CAC5B,GAAG,OAAO,CA4BV"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Page, SiteIndex, SectionMeta } from "../schemas/site-config";
|
|
2
|
+
/**
|
|
3
|
+
* Display fallback for blank page titles. addPage creates pages with an empty
|
|
4
|
+
* title (the editor prompts for one), and closing the modal can leave it blank
|
|
5
|
+
* — every UI that renders a page title must go through this.
|
|
6
|
+
*/
|
|
7
|
+
export declare function pageDisplayTitle(title: string): string;
|
|
8
|
+
export declare function slugifyPageSlug(input: string): string;
|
|
9
|
+
export declare function uniquePageSlug(base: string, existing: string[]): string;
|
|
10
|
+
export declare function pageById(index: SiteIndex, id: string): Page | undefined;
|
|
11
|
+
export declare function homePage(index: SiteIndex): Page;
|
|
12
|
+
export declare function pageBySlug(index: SiteIndex, slug: string): Page | undefined;
|
|
13
|
+
export declare function audiencePasses(access: string[], audience: string | null): boolean;
|
|
14
|
+
export declare function addPage(index: SiteIndex, id: string): SiteIndex;
|
|
15
|
+
export declare function reorderPages(index: SiteIndex, fromIndex: number, toIndex: number): SiteIndex;
|
|
16
|
+
export declare function setHomePage(index: SiteIndex, pageId: string): SiteIndex;
|
|
17
|
+
export declare function setPageArchived(index: SiteIndex, pageId: string, archived: boolean): SiteIndex;
|
|
18
|
+
export declare function setPageFields(index: SiteIndex, pageId: string, patch: Partial<Pick<Page, "title" | "slug" | "showInNav">>): SiteIndex;
|
|
19
|
+
export declare function setPageAudience(index: SiteIndex, pageId: string, access: string[]): {
|
|
20
|
+
index: SiteIndex;
|
|
21
|
+
resetSectionIds: string[];
|
|
22
|
+
};
|
|
23
|
+
export declare function deletePage(index: SiteIndex, pageId: string): {
|
|
24
|
+
index: SiteIndex;
|
|
25
|
+
removedSectionIds: string[];
|
|
26
|
+
};
|
|
27
|
+
export declare function addSectionToPage(index: SiteIndex, pageId: string, sectionId: string, meta: SectionMeta, insertIndex: number): SiteIndex;
|
|
28
|
+
export declare function removeSectionFromPages(index: SiteIndex, sectionId: string): SiteIndex;
|
|
29
|
+
export declare function reorderSectionInPage(index: SiteIndex, pageId: string, fromIndex: number, toIndex: number): SiteIndex;
|
|
30
|
+
export declare function moveSection(index: SiteIndex, sectionId: string, destPageId: string, position: "top" | "bottom"): SiteIndex;
|
|
31
|
+
//# sourceMappingURL=pages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pages.d.ts","sourceRoot":"","sources":["../../src/lib/pages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAG3E;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEtD;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CA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,wBAAgB,UAAU,CACxB,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,MAAM,GACb;IAAE,KAAK,EAAE,SAAS,CAAC;IAAC,iBAAiB,EAAE,MAAM,EAAE,CAAA;CAAE,CAUnD;AAED,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,WAAW,EACjB,WAAW,EAAE,MAAM,GAClB,SAAS,CAQX;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,GAAG,SAAS,CAOrF;AAED,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,GACd,SAAS,CAWX;AAED,wBAAgB,WAAW,CACzB,KAAK,EAAE,SAAS,EAChB,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,KAAK,GAAG,QAAQ,GACzB,SAAS,CAuBX"}
|
package/dist/lib/registry.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ZodType, z } from "zod";
|
|
2
2
|
import type { ComponentType, ReactNode } from "react";
|
|
3
3
|
import type { Audience } from "../schemas/auth";
|
|
4
|
+
import type { LinkValue } from "../schemas/link";
|
|
4
5
|
export type SettingsFieldDef = {
|
|
5
6
|
type: "text";
|
|
6
7
|
label: string;
|
|
@@ -37,6 +38,11 @@ export type SettingsFieldDef = {
|
|
|
37
38
|
min: number;
|
|
38
39
|
max: number;
|
|
39
40
|
step?: number;
|
|
41
|
+
} | {
|
|
42
|
+
type: "link";
|
|
43
|
+
label: string;
|
|
44
|
+
default: LinkValue;
|
|
45
|
+
target?: "content" | "options";
|
|
40
46
|
};
|
|
41
47
|
export type SettingsSchema = Record<string, SettingsFieldDef>;
|
|
42
48
|
export type Thumbnail = {
|
|
@@ -72,6 +78,7 @@ export interface WrapperProps {
|
|
|
72
78
|
onReorder?: (fromIndex: number, toIndex: number) => void;
|
|
73
79
|
onRequestInsert?: (index: number) => void;
|
|
74
80
|
onDelete?: () => void;
|
|
81
|
+
onMoveSection?: () => void;
|
|
75
82
|
mainStatus?: string | null;
|
|
76
83
|
contentDiffersFromMain?: boolean;
|
|
77
84
|
isLocalOnly?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/lib/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACtC,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/lib/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACtC,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,MAAM,gBAAgB,GACxB;IACE,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GACD;IACE,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IAC/B,GAA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AAC,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAE3D;AAED,wBAAgB,cAAc,IAAI,iBAAiB,EAAE,CAEpD;AAED,wBAAgB,aAAa,IAAI,OAAO,EAAE,CAEzC;AAED,wBAAgB,aAAa,IAAI,IAAI,CAEpC"}
|
package/dist/schemas/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC;AACrC,cAAc,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC;AACrC,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC"}
|
package/dist/schemas/index.js
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AudienceColorSchema,
|
|
3
3
|
AudienceNameSchema,
|
|
4
|
+
DEFAULT_LINK,
|
|
5
|
+
LinkTargetSchema,
|
|
6
|
+
LinkValueSchema,
|
|
4
7
|
MediaGridOptionsSchema,
|
|
5
8
|
slugifyAudienceName
|
|
6
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-PUNXQK4M.js";
|
|
7
10
|
import {
|
|
8
11
|
AudienceSchema,
|
|
9
12
|
RoleSchema,
|
|
@@ -16,12 +19,16 @@ import {
|
|
|
16
19
|
HexColorSchema,
|
|
17
20
|
IndexSchema,
|
|
18
21
|
MediaReferenceSchema,
|
|
22
|
+
PageSchema,
|
|
23
|
+
PageStatusSchema,
|
|
24
|
+
RESERVED_SLUGS,
|
|
19
25
|
SectionMetaSchema,
|
|
20
26
|
SiteConfigSchema,
|
|
21
27
|
TextLineSchema,
|
|
22
28
|
getSectionContentSchema,
|
|
23
|
-
getSectionSchema
|
|
24
|
-
|
|
29
|
+
getSectionSchema,
|
|
30
|
+
normalizeSiteIndex
|
|
31
|
+
} from "../chunk-24SUF2BC.js";
|
|
25
32
|
import {
|
|
26
33
|
ImageManifestSchema,
|
|
27
34
|
MediaConfigSchema,
|
|
@@ -34,13 +41,19 @@ export {
|
|
|
34
41
|
AudienceSchema,
|
|
35
42
|
ColorItemSchema,
|
|
36
43
|
ColorSpaceSchema,
|
|
44
|
+
DEFAULT_LINK,
|
|
37
45
|
HexColorSchema,
|
|
38
46
|
ImageManifestSchema,
|
|
39
47
|
IndexSchema,
|
|
48
|
+
LinkTargetSchema,
|
|
49
|
+
LinkValueSchema,
|
|
40
50
|
MediaConfigSchema,
|
|
41
51
|
MediaGridOptionsSchema,
|
|
42
52
|
MediaItemSchema,
|
|
43
53
|
MediaReferenceSchema,
|
|
54
|
+
PageSchema,
|
|
55
|
+
PageStatusSchema,
|
|
56
|
+
RESERVED_SLUGS,
|
|
44
57
|
RoleSchema,
|
|
45
58
|
SectionMetaSchema,
|
|
46
59
|
SessionSchema,
|
|
@@ -50,5 +63,6 @@ export {
|
|
|
50
63
|
VariantSchema,
|
|
51
64
|
getSectionContentSchema,
|
|
52
65
|
getSectionSchema,
|
|
66
|
+
normalizeSiteIndex,
|
|
53
67
|
slugifyAudienceName
|
|
54
68
|
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const LinkTargetSchema: z.ZodEnum<{
|
|
3
|
+
_self: "_self";
|
|
4
|
+
_blank: "_blank";
|
|
5
|
+
}>;
|
|
6
|
+
export declare const LinkValueSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
7
|
+
kind: z.ZodLiteral<"external">;
|
|
8
|
+
href: z.ZodString;
|
|
9
|
+
target: z.ZodEnum<{
|
|
10
|
+
_self: "_self";
|
|
11
|
+
_blank: "_blank";
|
|
12
|
+
}>;
|
|
13
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
14
|
+
kind: z.ZodLiteral<"internal">;
|
|
15
|
+
pageId: z.ZodString;
|
|
16
|
+
anchorSectionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
17
|
+
target: z.ZodEnum<{
|
|
18
|
+
_self: "_self";
|
|
19
|
+
_blank: "_blank";
|
|
20
|
+
}>;
|
|
21
|
+
}, z.core.$strip>], "kind">;
|
|
22
|
+
export type LinkValue = z.infer<typeof LinkValueSchema>;
|
|
23
|
+
export declare const DEFAULT_LINK: LinkValue;
|
|
24
|
+
//# sourceMappingURL=link.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../src/schemas/link.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,gBAAgB;;;EAA8B,CAAC;AAE5D,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;2BAQ1B,CAAC;AAEH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAExD,eAAO,MAAM,YAAY,EAAE,SAA2D,CAAC"}
|
|
@@ -10,9 +10,40 @@ export declare const SectionMetaSchema: z.ZodObject<{
|
|
|
10
10
|
access: z.ZodArray<z.ZodString>;
|
|
11
11
|
}, z.core.$strip>;
|
|
12
12
|
export type SectionMeta = z.infer<typeof SectionMetaSchema>;
|
|
13
|
-
export declare const
|
|
14
|
-
|
|
13
|
+
export declare const RESERVED_SLUGS: readonly ["edit", "api", "login", "set-password", "404"];
|
|
14
|
+
export declare const PageStatusSchema: z.ZodEnum<{
|
|
15
|
+
live: "live";
|
|
16
|
+
archived: "archived";
|
|
17
|
+
}>;
|
|
18
|
+
export declare const PageSchema: z.ZodObject<{
|
|
19
|
+
id: z.ZodString;
|
|
20
|
+
title: z.ZodString;
|
|
21
|
+
slug: z.ZodString;
|
|
22
|
+
isHome: z.ZodBoolean;
|
|
23
|
+
showInNav: z.ZodBoolean;
|
|
24
|
+
status: z.ZodEnum<{
|
|
25
|
+
live: "live";
|
|
26
|
+
archived: "archived";
|
|
27
|
+
}>;
|
|
28
|
+
access: z.ZodArray<z.ZodString>;
|
|
15
29
|
order: z.ZodArray<z.ZodString>;
|
|
30
|
+
}, z.core.$strip>;
|
|
31
|
+
export type Page = z.infer<typeof PageSchema>;
|
|
32
|
+
declare const CanonicalIndexSchema: z.ZodObject<{
|
|
33
|
+
siteId: z.ZodString;
|
|
34
|
+
pages: z.ZodArray<z.ZodObject<{
|
|
35
|
+
id: z.ZodString;
|
|
36
|
+
title: z.ZodString;
|
|
37
|
+
slug: z.ZodString;
|
|
38
|
+
isHome: z.ZodBoolean;
|
|
39
|
+
showInNav: z.ZodBoolean;
|
|
40
|
+
status: z.ZodEnum<{
|
|
41
|
+
live: "live";
|
|
42
|
+
archived: "archived";
|
|
43
|
+
}>;
|
|
44
|
+
access: z.ZodArray<z.ZodString>;
|
|
45
|
+
order: z.ZodArray<z.ZodString>;
|
|
46
|
+
}, z.core.$strip>>;
|
|
16
47
|
sections: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
17
48
|
type: z.ZodString;
|
|
18
49
|
status: z.ZodPipe<z.ZodEnum<{
|
|
@@ -25,7 +56,100 @@ export declare const IndexSchema: z.ZodObject<{
|
|
|
25
56
|
}, z.core.$strip>>;
|
|
26
57
|
lastModified: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
27
58
|
}, z.core.$strip>;
|
|
28
|
-
export
|
|
59
|
+
export declare const IndexSchema: z.ZodPipe<z.ZodPipe<z.ZodObject<{
|
|
60
|
+
siteId: z.ZodString;
|
|
61
|
+
order: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
62
|
+
pages: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
63
|
+
id: z.ZodString;
|
|
64
|
+
title: z.ZodString;
|
|
65
|
+
slug: z.ZodString;
|
|
66
|
+
isHome: z.ZodBoolean;
|
|
67
|
+
showInNav: z.ZodBoolean;
|
|
68
|
+
status: z.ZodEnum<{
|
|
69
|
+
live: "live";
|
|
70
|
+
archived: "archived";
|
|
71
|
+
}>;
|
|
72
|
+
access: z.ZodArray<z.ZodString>;
|
|
73
|
+
order: z.ZodArray<z.ZodString>;
|
|
74
|
+
}, z.core.$strip>>>;
|
|
75
|
+
sections: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
76
|
+
type: z.ZodString;
|
|
77
|
+
status: z.ZodPipe<z.ZodEnum<{
|
|
78
|
+
draft: "draft";
|
|
79
|
+
live: "live";
|
|
80
|
+
archived: "archived";
|
|
81
|
+
published: "published";
|
|
82
|
+
}>, z.ZodTransform<"draft" | "live" | "archived", "draft" | "live" | "archived" | "published">>;
|
|
83
|
+
access: z.ZodArray<z.ZodString>;
|
|
84
|
+
}, z.core.$strip>>;
|
|
85
|
+
lastModified: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
86
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
87
|
+
siteId: string;
|
|
88
|
+
pages: {
|
|
89
|
+
id: string;
|
|
90
|
+
title: string;
|
|
91
|
+
slug: string;
|
|
92
|
+
isHome: boolean;
|
|
93
|
+
showInNav: boolean;
|
|
94
|
+
status: "live" | "archived";
|
|
95
|
+
access: string[];
|
|
96
|
+
order: string[];
|
|
97
|
+
}[];
|
|
98
|
+
sections: Record<string, {
|
|
99
|
+
type: string;
|
|
100
|
+
status: "draft" | "live" | "archived" | "published";
|
|
101
|
+
access: string[];
|
|
102
|
+
}>;
|
|
103
|
+
lastModified?: string | null | undefined;
|
|
104
|
+
}, {
|
|
105
|
+
siteId: string;
|
|
106
|
+
sections: Record<string, {
|
|
107
|
+
type: string;
|
|
108
|
+
status: "draft" | "live" | "archived";
|
|
109
|
+
access: string[];
|
|
110
|
+
}>;
|
|
111
|
+
order?: string[] | undefined;
|
|
112
|
+
pages?: {
|
|
113
|
+
id: string;
|
|
114
|
+
title: string;
|
|
115
|
+
slug: string;
|
|
116
|
+
isHome: boolean;
|
|
117
|
+
showInNav: boolean;
|
|
118
|
+
status: "live" | "archived";
|
|
119
|
+
access: string[];
|
|
120
|
+
order: string[];
|
|
121
|
+
}[] | undefined;
|
|
122
|
+
lastModified?: string | null | undefined;
|
|
123
|
+
}>>, z.ZodObject<{
|
|
124
|
+
siteId: z.ZodString;
|
|
125
|
+
pages: z.ZodArray<z.ZodObject<{
|
|
126
|
+
id: z.ZodString;
|
|
127
|
+
title: z.ZodString;
|
|
128
|
+
slug: z.ZodString;
|
|
129
|
+
isHome: z.ZodBoolean;
|
|
130
|
+
showInNav: z.ZodBoolean;
|
|
131
|
+
status: z.ZodEnum<{
|
|
132
|
+
live: "live";
|
|
133
|
+
archived: "archived";
|
|
134
|
+
}>;
|
|
135
|
+
access: z.ZodArray<z.ZodString>;
|
|
136
|
+
order: z.ZodArray<z.ZodString>;
|
|
137
|
+
}, z.core.$strip>>;
|
|
138
|
+
sections: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
139
|
+
type: z.ZodString;
|
|
140
|
+
status: z.ZodPipe<z.ZodEnum<{
|
|
141
|
+
draft: "draft";
|
|
142
|
+
live: "live";
|
|
143
|
+
archived: "archived";
|
|
144
|
+
published: "published";
|
|
145
|
+
}>, z.ZodTransform<"draft" | "live" | "archived", "draft" | "live" | "archived" | "published">>;
|
|
146
|
+
access: z.ZodArray<z.ZodString>;
|
|
147
|
+
}, z.core.$strip>>;
|
|
148
|
+
lastModified: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
149
|
+
}, z.core.$strip>>;
|
|
150
|
+
export type SiteIndex = z.infer<typeof CanonicalIndexSchema>;
|
|
151
|
+
/** Parse + normalize any raw index (legacy or canonical) to the canonical shape. */
|
|
152
|
+
export declare function normalizeSiteIndex(raw: unknown): SiteIndex;
|
|
29
153
|
export declare const SiteConfigSchema: z.ZodObject<{
|
|
30
154
|
siteName: z.ZodDefault<z.ZodString>;
|
|
31
155
|
primaryColor: z.ZodDefault<z.ZodString>;
|
|
@@ -41,6 +165,7 @@ export declare const SiteConfigSchema: z.ZodObject<{
|
|
|
41
165
|
uppercaseSubheadings: z.ZodDefault<z.ZodBoolean>;
|
|
42
166
|
uppercaseNavHeadings: z.ZodDefault<z.ZodBoolean>;
|
|
43
167
|
googleFontsUrl: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
168
|
+
favicon: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
44
169
|
media: z.ZodDefault<z.ZodObject<{
|
|
45
170
|
sizes: z.ZodDefault<z.ZodArray<z.ZodNumber>>;
|
|
46
171
|
maxFileSize: z.ZodDefault<z.ZodNumber>;
|
|
@@ -48,4 +173,5 @@ export declare const SiteConfigSchema: z.ZodObject<{
|
|
|
48
173
|
}, z.core.$strip>>;
|
|
49
174
|
}, z.core.$strip>;
|
|
50
175
|
export type SiteConfig = z.infer<typeof SiteConfigSchema>;
|
|
176
|
+
export {};
|
|
51
177
|
//# sourceMappingURL=site-config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"site-config.d.ts","sourceRoot":"","sources":["../../src/schemas/site-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,eAAO,MAAM,iBAAiB;;;;;;;;;iBAI5B,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"site-config.d.ts","sourceRoot":"","sources":["../../src/schemas/site-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,eAAO,MAAM,iBAAiB;;;;;;;;;iBAI5B,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAO5D,eAAO,MAAM,cAAc,0DAA2D,CAAC;AAEvF,eAAO,MAAM,gBAAgB;;;EAA+B,CAAC;AAE7D,eAAO,MAAM,UAAU;;;;;;;;;;;;iBASrB,CAAC;AAEH,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AA0C9C,QAAA,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;iBA6CtB,CAAC;AAEL,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAAyE,CAAC;AAElG,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAE7D,oFAAoF;AACpF,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,OAAO,GAAG,SAAS,CAE1D;AAED,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;iBAqB3B,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@drawnagency/primitives",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.51",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./package.json": "./package.json",
|
|
@@ -16,6 +16,10 @@
|
|
|
16
16
|
"types": "./dist/schemas/auth.d.ts",
|
|
17
17
|
"default": "./dist/schemas/auth.js"
|
|
18
18
|
},
|
|
19
|
+
"./schemas/link": {
|
|
20
|
+
"types": "./dist/schemas/link.d.ts",
|
|
21
|
+
"default": "./dist/schemas/link.js"
|
|
22
|
+
},
|
|
19
23
|
"./lib": {
|
|
20
24
|
"types": "./dist/lib/index.d.ts",
|
|
21
25
|
"default": "./dist/lib/index.js"
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
import { Select } from "../shared/Select";
|
|
3
|
+
import { Button } from "../shared/Button";
|
|
4
|
+
import { RadioGroup } from "../shared/RadioGroup";
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
pages: { id: string; title: string }[];
|
|
8
|
+
currentPageId: string;
|
|
9
|
+
onMove: (destPageId: string, position: "top" | "bottom") => void;
|
|
10
|
+
onCancel: () => void;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function MoveSectionModal({ pages, currentPageId, onMove, onCancel }: Props) {
|
|
14
|
+
const options = pages.filter((p) => p.id !== currentPageId).map((p) => ({ label: p.title, value: p.id }));
|
|
15
|
+
const [dest, setDest] = useState(options[0]?.value ?? "");
|
|
16
|
+
const [position, setPosition] = useState<"top" | "bottom">("bottom");
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<div className="flex flex-col gap-4">
|
|
20
|
+
<Select label="Destination page" value={dest} options={options} onChange={setDest} />
|
|
21
|
+
<RadioGroup
|
|
22
|
+
label="Position"
|
|
23
|
+
options={[
|
|
24
|
+
{ label: "Top", value: "top" },
|
|
25
|
+
{ label: "Bottom", value: "bottom" },
|
|
26
|
+
]}
|
|
27
|
+
value={position}
|
|
28
|
+
onChange={setPosition}
|
|
29
|
+
/>
|
|
30
|
+
<div className="flex justify-end gap-3">
|
|
31
|
+
<Button variant="secondary" size="md" onClick={onCancel}>Cancel</Button>
|
|
32
|
+
<Button variant="primary" size="md" disabled={!dest} onClick={() => onMove(dest, position)}>Move</Button>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
);
|
|
36
|
+
}
|