@drawnagency/primitives 0.1.31 → 0.1.32

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.
Files changed (107) hide show
  1. package/dist/auth/index.js +3 -2
  2. package/dist/auth/security.d.ts +0 -4
  3. package/dist/auth/security.d.ts.map +1 -1
  4. package/dist/{chunk-ZDKSJY2K.js → chunk-C2MVDXD7.js} +1 -1
  5. package/dist/chunk-LZKVV4K2.js +30 -0
  6. package/dist/{chunk-MNK7XA6S.js → chunk-OUFUUBZ4.js} +1 -29
  7. package/dist/{chunk-EUNJDXYX.js → chunk-S2L3BPLS.js} +4 -3
  8. package/dist/chunk-WKZ7OENC.js +8 -0
  9. package/dist/{chunk-PKMPRW7T.js → chunk-YEOGH3QH.js} +1 -1
  10. package/dist/components/primitives/RichTextToolbar.d.ts.map +1 -1
  11. package/dist/components/shell/EditorShell.d.ts.map +1 -1
  12. package/dist/hooks/useBuildStatus.d.ts +0 -1
  13. package/dist/hooks/useBuildStatus.d.ts.map +1 -1
  14. package/dist/hooks/useContentLifecycle.d.ts +0 -1
  15. package/dist/hooks/useContentLifecycle.d.ts.map +1 -1
  16. package/dist/hooks/useEditorPersistence.d.ts +2 -3
  17. package/dist/hooks/useEditorPersistence.d.ts.map +1 -1
  18. package/dist/hooks/useEditorPublish.d.ts.map +1 -1
  19. package/dist/index.js +13 -7
  20. package/dist/lib/dexie.d.ts +2 -2
  21. package/dist/lib/dexie.d.ts.map +1 -1
  22. package/dist/lib/env.d.ts +7 -0
  23. package/dist/lib/env.d.ts.map +1 -0
  24. package/dist/lib/env.js +6 -0
  25. package/dist/lib/index.d.ts +1 -0
  26. package/dist/lib/index.d.ts.map +1 -1
  27. package/dist/lib/index.js +6 -2
  28. package/dist/schemas/auth.js +12 -0
  29. package/dist/schemas/index.js +6 -4
  30. package/package.json +9 -1
  31. package/src/auth/security.ts +1 -4
  32. package/src/components/primitives/RichTextToolbar.tsx +18 -0
  33. package/src/components/primitives/tiptap-presets.ts +1 -1
  34. package/src/components/shell/EditorShell.tsx +16 -16
  35. package/src/hooks/useBuildStatus.ts +1 -5
  36. package/src/hooks/useContentLifecycle.ts +3 -4
  37. package/src/hooks/useEditorPersistence.ts +3 -19
  38. package/src/hooks/useEditorPublish.ts +78 -98
  39. package/src/lib/dexie.ts +3 -3
  40. package/src/lib/env.ts +13 -0
  41. package/src/lib/index.ts +1 -0
  42. package/src/components/brandguide/ColorSwatchSettings.d.ts +0 -8
  43. package/src/components/brandguide/Colors.d.ts +0 -15
  44. package/src/components/brandguide/DoDontList.d.ts +0 -16
  45. package/src/components/brandguide/DoDontMediaGrid.d.ts +0 -16
  46. package/src/components/primitives/CustomParagraph.d.ts +0 -2
  47. package/src/components/primitives/EditableGrid.d.ts +0 -19
  48. package/src/components/primitives/EditablePlainText.d.ts +0 -12
  49. package/src/components/primitives/EditableRichText.d.ts +0 -12
  50. package/src/components/primitives/HeadingSection.d.ts +0 -10
  51. package/src/components/primitives/IconPicker.d.ts +0 -9
  52. package/src/components/primitives/LinkPopover.d.ts +0 -8
  53. package/src/components/primitives/MediaSettingsForms.d.ts +0 -19
  54. package/src/components/primitives/ResolvedMedia.d.ts +0 -8
  55. package/src/components/primitives/RichTextToolbar.d.ts +0 -9
  56. package/src/components/primitives/tiptap-presets.d.ts +0 -4
  57. package/src/components/primitives/useEditableCollection.d.ts +0 -19
  58. package/src/components/primitives/useEditablePlainText.d.ts +0 -14
  59. package/src/components/primitives/useEditableRichText.d.ts +0 -17
  60. package/src/components/sections/Button/CTAButton.d.ts +0 -11
  61. package/src/components/sections/Button/index.d.ts +0 -11
  62. package/src/components/sections/Colors/index.d.ts +0 -22
  63. package/src/components/sections/DoDontList/index.d.ts +0 -21
  64. package/src/components/sections/DoDontMediaGrid/index.d.ts +0 -55
  65. package/src/components/sections/IconList/IconList.d.ts +0 -20
  66. package/src/components/sections/IconList/IconListSettings.d.ts +0 -11
  67. package/src/components/sections/IconList/index.d.ts +0 -17
  68. package/src/components/sections/LinkHeading/index.d.ts +0 -8
  69. package/src/components/sections/MediaGrid/MediaGrid.d.ts +0 -17
  70. package/src/components/sections/MediaGrid/index.d.ts +0 -55
  71. package/src/components/sections/Prose/Prose.d.ts +0 -8
  72. package/src/components/sections/Prose/index.d.ts +0 -8
  73. package/src/components/sections/SplitContent/SplitContent.d.ts +0 -11
  74. package/src/components/sections/SplitContent/index.d.ts +0 -13
  75. package/src/components/sections/SubHeading/index.d.ts +0 -9
  76. package/src/components/sections/SubSubHeading/index.d.ts +0 -9
  77. package/src/components/sections/register-schemas.d.ts +0 -2
  78. package/src/components/shared/Button.d.ts +0 -15
  79. package/src/components/shared/Checkbox.d.ts +0 -14
  80. package/src/components/shared/FormLabel.d.ts +0 -8
  81. package/src/components/shared/IconButton.d.ts +0 -12
  82. package/src/components/shared/Input.d.ts +0 -8
  83. package/src/components/shared/Select.d.ts +0 -16
  84. package/src/components/shared/icons.d.ts +0 -17
  85. package/src/components/shell/MediaLibraryContext.d.ts +0 -14
  86. package/src/env.d.ts +0 -3
  87. package/src/hooks/useResolvedMedia.d.ts +0 -9
  88. package/src/lib/cn.d.ts +0 -3
  89. package/src/lib/grid.d.ts +0 -2
  90. package/src/lib/icons.d.ts +0 -9
  91. package/src/lib/loader.d.ts +0 -28
  92. package/src/lib/nav.d.ts +0 -15
  93. package/src/lib/registry.d.ts +0 -110
  94. package/src/lib/sanitize.d.ts +0 -2
  95. package/src/media/github.d.ts +0 -3
  96. package/src/media/index.d.ts +0 -8
  97. package/src/media/queue.d.ts +0 -74
  98. package/src/media/resolve.d.ts +0 -14
  99. package/src/media/types.d.ts +0 -42
  100. package/src/media/utils.d.ts +0 -7
  101. package/src/media/videoPoster.d.ts +0 -6
  102. package/src/schemas/auth.d.ts +0 -36
  103. package/src/schemas/media-grid-options.d.ts +0 -8
  104. package/src/schemas/media.d.ts +0 -63
  105. package/src/schemas/sections.d.ts +0 -12
  106. package/src/schemas/shared.d.ts +0 -98
  107. package/src/schemas/site-config.d.ts +0 -48
@@ -1,55 +0,0 @@
1
- declare const _default: import("../../../lib/registry").SectionDefinition<{
2
- type: "do_dont_grid";
3
- content: {
4
- columns: number;
5
- media: ({
6
- imageId: string;
7
- type: "image";
8
- caption?: string | string[] | undefined;
9
- background?: string | undefined;
10
- invertFrom?: string | undefined;
11
- border?: boolean | undefined;
12
- objectFit?: "cover" | "contain" | undefined;
13
- } | {
14
- imageId: string;
15
- type: "video";
16
- caption?: string | string[] | undefined;
17
- background?: string | undefined;
18
- invertFrom?: string | undefined;
19
- border?: boolean | undefined;
20
- objectFit?: "cover" | "contain" | undefined;
21
- poster?: string | undefined;
22
- autoplay?: boolean | undefined;
23
- loop?: boolean | undefined;
24
- muted?: boolean | undefined;
25
- } | {
26
- imageId: string;
27
- type: "doDontImage";
28
- doDont: "do" | "dont";
29
- caption?: string | string[] | undefined;
30
- background?: string | undefined;
31
- invertFrom?: string | undefined;
32
- border?: boolean | undefined;
33
- objectFit?: "cover" | "contain" | undefined;
34
- } | {
35
- imageId: string;
36
- type: "linkedImage";
37
- href: string;
38
- caption?: string | string[] | undefined;
39
- background?: string | undefined;
40
- invertFrom?: string | undefined;
41
- border?: boolean | undefined;
42
- objectFit?: "cover" | "contain" | undefined;
43
- target?: string | undefined;
44
- linkText?: string | undefined;
45
- })[];
46
- };
47
- options: {
48
- square?: boolean | undefined;
49
- border?: boolean | undefined;
50
- crop?: boolean | undefined;
51
- showCaptions?: boolean | undefined;
52
- };
53
- }>;
54
- export default _default;
55
- //# sourceMappingURL=index.d.ts.map
@@ -1,20 +0,0 @@
1
- import type { SectionContent } from "../../../schemas/sections";
2
- interface IconListItem {
3
- label: string;
4
- text: string;
5
- icon?: string;
6
- }
7
- interface Props {
8
- items: IconListItem[];
9
- icon?: string | null;
10
- showLabel?: boolean;
11
- stackText?: boolean;
12
- labelClassName?: string;
13
- textClassName?: string;
14
- iconClassName?: string;
15
- onChange?: (content: SectionContent) => void;
16
- onItemsChange?: (items: IconListItem[]) => void;
17
- }
18
- export default function IconList({ items, icon, showLabel, stackText, labelClassName, textClassName, iconClassName, onChange, onItemsChange, }: Props): import("react/jsx-runtime").JSX.Element;
19
- export {};
20
- //# sourceMappingURL=IconList.d.ts.map
@@ -1,11 +0,0 @@
1
- export declare function IconListSettings({ icon: initialIcon, showLabel: initialShowLabel, stackText: initialStackText, onChange, }: {
2
- icon: string | null;
3
- showLabel: boolean;
4
- stackText: boolean;
5
- onChange: (values: {
6
- icon: string | null;
7
- showLabel: boolean;
8
- stackText: boolean;
9
- }) => void;
10
- }): import("react/jsx-runtime").JSX.Element;
11
- //# sourceMappingURL=IconListSettings.d.ts.map
@@ -1,17 +0,0 @@
1
- declare const _default: import("../../../lib/registry").SectionDefinition<{
2
- type: "icon_list";
3
- content: {
4
- items: {
5
- label: string;
6
- text: string;
7
- icon?: string | undefined;
8
- }[];
9
- };
10
- options?: {
11
- icon?: string | null | undefined;
12
- showLabel?: boolean | undefined;
13
- stackText?: boolean | undefined;
14
- } | undefined;
15
- }>;
16
- export default _default;
17
- //# sourceMappingURL=index.d.ts.map
@@ -1,8 +0,0 @@
1
- declare const _default: import("../../../lib/registry").SectionDefinition<{
2
- type: "link_heading";
3
- content: {
4
- heading: string;
5
- };
6
- }>;
7
- export default _default;
8
- //# sourceMappingURL=index.d.ts.map
@@ -1,17 +0,0 @@
1
- import type { MediaReference } from "../../../schemas/shared";
2
- import type { SectionContent } from "../../../schemas/sections";
3
- import type { ReactNode } from "react";
4
- interface Props {
5
- media: MediaReference[];
6
- columns: number;
7
- square?: boolean;
8
- border?: boolean;
9
- crop?: boolean;
10
- showCaptions?: boolean;
11
- sectionType?: string;
12
- onChange?: (content: SectionContent) => void;
13
- openModal?: (title: string, content: ReactNode) => void;
14
- }
15
- export default function MediaGrid({ media, columns, square, border, crop, showCaptions, sectionType, onChange, openModal }: Props): import("react/jsx-runtime").JSX.Element;
16
- export {};
17
- //# sourceMappingURL=MediaGrid.d.ts.map
@@ -1,55 +0,0 @@
1
- declare const _default: import("../../../lib/registry").SectionDefinition<{
2
- type: "media_grid";
3
- content: {
4
- columns: number;
5
- media: ({
6
- imageId: string;
7
- type: "image";
8
- caption?: string | string[] | undefined;
9
- background?: string | undefined;
10
- invertFrom?: string | undefined;
11
- border?: boolean | undefined;
12
- objectFit?: "cover" | "contain" | undefined;
13
- } | {
14
- imageId: string;
15
- type: "video";
16
- caption?: string | string[] | undefined;
17
- background?: string | undefined;
18
- invertFrom?: string | undefined;
19
- border?: boolean | undefined;
20
- objectFit?: "cover" | "contain" | undefined;
21
- poster?: string | undefined;
22
- autoplay?: boolean | undefined;
23
- loop?: boolean | undefined;
24
- muted?: boolean | undefined;
25
- } | {
26
- imageId: string;
27
- type: "doDontImage";
28
- doDont: "do" | "dont";
29
- caption?: string | string[] | undefined;
30
- background?: string | undefined;
31
- invertFrom?: string | undefined;
32
- border?: boolean | undefined;
33
- objectFit?: "cover" | "contain" | undefined;
34
- } | {
35
- imageId: string;
36
- type: "linkedImage";
37
- href: string;
38
- caption?: string | string[] | undefined;
39
- background?: string | undefined;
40
- invertFrom?: string | undefined;
41
- border?: boolean | undefined;
42
- objectFit?: "cover" | "contain" | undefined;
43
- target?: string | undefined;
44
- linkText?: string | undefined;
45
- })[];
46
- };
47
- options: {
48
- square?: boolean | undefined;
49
- border?: boolean | undefined;
50
- crop?: boolean | undefined;
51
- showCaptions?: boolean | undefined;
52
- };
53
- }>;
54
- export default _default;
55
- //# sourceMappingURL=index.d.ts.map
@@ -1,8 +0,0 @@
1
- import type { SectionContent } from "../../../schemas/sections";
2
- interface Props {
3
- body: string;
4
- onChange?: (content: SectionContent) => void;
5
- }
6
- export default function Prose({ body, onChange }: Props): import("react/jsx-runtime").JSX.Element;
7
- export {};
8
- //# sourceMappingURL=Prose.d.ts.map
@@ -1,8 +0,0 @@
1
- declare const _default: import("../../../lib/registry").SectionDefinition<{
2
- type: "prose";
3
- content: {
4
- body: string;
5
- };
6
- }>;
7
- export default _default;
8
- //# sourceMappingURL=index.d.ts.map
@@ -1,11 +0,0 @@
1
- import type { SectionContent } from "../../../schemas/sections";
2
- interface Props {
3
- imageId: string | undefined;
4
- body: string;
5
- border?: boolean;
6
- imagePosition?: "left" | "right";
7
- onChange?: (content: SectionContent) => void;
8
- }
9
- export default function SplitContent({ imageId, body, border, imagePosition, onChange }: Props): import("react/jsx-runtime").JSX.Element;
10
- export {};
11
- //# sourceMappingURL=SplitContent.d.ts.map
@@ -1,13 +0,0 @@
1
- declare const _default: import("../../../lib/registry").SectionDefinition<{
2
- type: "split_content";
3
- content: {
4
- body: string;
5
- imageId?: string | undefined;
6
- };
7
- options?: {
8
- border?: boolean | undefined;
9
- imagePosition?: "left" | "right" | undefined;
10
- } | undefined;
11
- }>;
12
- export default _default;
13
- //# sourceMappingURL=index.d.ts.map
@@ -1,9 +0,0 @@
1
- declare const _default: import("../../../lib/registry").SectionDefinition<{
2
- type: "sub_heading";
3
- content: {
4
- heading: string;
5
- excludeFromNav?: boolean | undefined;
6
- };
7
- }>;
8
- export default _default;
9
- //# sourceMappingURL=index.d.ts.map
@@ -1,9 +0,0 @@
1
- declare const _default: import("../../../lib/registry").SectionDefinition<{
2
- type: "sub_sub_heading";
3
- content: {
4
- heading: string;
5
- excludeFromNav?: boolean | undefined;
6
- };
7
- }>;
8
- export default _default;
9
- //# sourceMappingURL=index.d.ts.map
@@ -1,2 +0,0 @@
1
- export declare const schemaCount: number;
2
- //# sourceMappingURL=register-schemas.d.ts.map
@@ -1,15 +0,0 @@
1
- import { type ButtonHTMLAttributes, type ReactNode } from "react";
2
- export type ButtonVariant = "primary" | "brand" | "secondary" | "destructive" | "ghost";
3
- export type ButtonSize = "sm" | "md";
4
- export type ButtonTone = "neutral" | "destructive";
5
- export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
6
- variant?: ButtonVariant;
7
- size?: ButtonSize;
8
- tone?: ButtonTone;
9
- fullWidth?: boolean;
10
- isLoading?: boolean;
11
- loadingLabel?: string;
12
- children?: ReactNode;
13
- }
14
- export declare const Button: import("react").ForwardRefExoticComponent<ButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
15
- //# sourceMappingURL=Button.d.ts.map
@@ -1,14 +0,0 @@
1
- import { type ReactNode } from "react";
2
- interface CheckboxProps {
3
- checked: boolean;
4
- onChange: (checked: boolean) => void;
5
- label: string;
6
- description?: string;
7
- disabled?: boolean;
8
- className?: string;
9
- startAdornment?: ReactNode;
10
- align?: "start" | "center";
11
- }
12
- export declare function Checkbox({ checked, onChange, label, description, disabled, className, startAdornment, align, }: CheckboxProps): import("react/jsx-runtime").JSX.Element;
13
- export {};
14
- //# sourceMappingURL=Checkbox.d.ts.map
@@ -1,8 +0,0 @@
1
- interface FormLabelProps {
2
- htmlFor?: string;
3
- children: React.ReactNode;
4
- className?: string;
5
- }
6
- export declare function FormLabel({ htmlFor, children, className }: FormLabelProps): import("react/jsx-runtime").JSX.Element;
7
- export {};
8
- //# sourceMappingURL=FormLabel.d.ts.map
@@ -1,12 +0,0 @@
1
- import { type ButtonHTMLAttributes, type ReactNode } from "react";
2
- type Size = "sm" | "md" | "lg";
3
- type Intent = "default" | "destructive" | "primary";
4
- interface IconButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
5
- icon: ReactNode;
6
- label: string;
7
- size?: Size;
8
- intent?: Intent;
9
- }
10
- export declare const IconButton: import("react").ForwardRefExoticComponent<IconButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
11
- export {};
12
- //# sourceMappingURL=IconButton.d.ts.map
@@ -1,8 +0,0 @@
1
- import { type InputHTMLAttributes } from "react";
2
- interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "onChange"> {
3
- label: string;
4
- onChange: (value: string) => void;
5
- }
6
- export declare const Input: import("react").ForwardRefExoticComponent<InputProps & import("react").RefAttributes<HTMLInputElement>>;
7
- export {};
8
- //# sourceMappingURL=Input.d.ts.map
@@ -1,16 +0,0 @@
1
- interface SelectOption {
2
- value: string;
3
- label: string;
4
- }
5
- interface SelectProps {
6
- label?: string;
7
- value: string;
8
- onChange: (value: string) => void;
9
- options: SelectOption[];
10
- disabled?: boolean;
11
- className?: string;
12
- selectClassName?: string;
13
- }
14
- export declare function Select({ label, value, onChange, options, disabled, className, selectClassName, }: SelectProps): import("react/jsx-runtime").JSX.Element;
15
- export {};
16
- //# sourceMappingURL=Select.d.ts.map
@@ -1,17 +0,0 @@
1
- export declare function DragHandle({ size }: {
2
- size?: number;
3
- }): import("react/jsx-runtime").JSX.Element;
4
- export declare function AddIcon({ size }: {
5
- size?: number;
6
- }): import("react/jsx-runtime").JSX.Element;
7
- export declare function RemoveIcon({ size }: {
8
- size?: number;
9
- }): import("react/jsx-runtime").JSX.Element;
10
- export declare function DeleteIcon({ size }: {
11
- size?: number;
12
- }): import("react/jsx-runtime").JSX.Element;
13
- export declare function SettingsIcon({ size }: {
14
- size?: number;
15
- }): import("react/jsx-runtime").JSX.Element;
16
- export { GripVertical, Plus, Trash2, X, Settings } from "lucide-react";
17
- //# sourceMappingURL=icons.d.ts.map
@@ -1,14 +0,0 @@
1
- import type { MediaManifest, MediaItem } from "../../media/types";
2
- import type { SiteConfig } from "../../schemas/site-config";
3
- export interface MediaLibraryContextValue {
4
- openSelectModal: (onSelect: (imageId: string) => void) => void;
5
- uploadFile: (file: File) => void;
6
- uploadFileWithCallback: (file: File, onComplete: (imageId: string) => void) => string;
7
- manifest: MediaManifest;
8
- pendingItems: MediaItem[];
9
- pendingLocalUrls: Record<string, string>;
10
- siteConfig: SiteConfig | null;
11
- }
12
- export declare const MediaLibraryContext: import("react").Context<MediaLibraryContextValue | null>;
13
- export declare function useMediaLibrary(): MediaLibraryContextValue | null;
14
- //# sourceMappingURL=MediaLibraryContext.d.ts.map
package/src/env.d.ts DELETED
@@ -1,3 +0,0 @@
1
- interface ImportMeta {
2
- readonly env: Record<string, string | undefined>;
3
- }
@@ -1,9 +0,0 @@
1
- export interface ResolvedMediaResult {
2
- src: string | undefined;
3
- srcset: string | undefined;
4
- poster: string | undefined;
5
- alt: string;
6
- kind: "image" | "animated" | "video";
7
- }
8
- export declare function useResolvedMedia(imageId: string | undefined): ResolvedMediaResult;
9
- //# sourceMappingURL=useResolvedMedia.d.ts.map
package/src/lib/cn.d.ts DELETED
@@ -1,3 +0,0 @@
1
- import { type ClassValue } from "clsx";
2
- export declare function cn(...inputs: ClassValue[]): string;
3
- //# sourceMappingURL=cn.d.ts.map
package/src/lib/grid.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export declare const gridColsClass: Record<number, string>;
2
- //# sourceMappingURL=grid.d.ts.map
@@ -1,9 +0,0 @@
1
- import { type LucideIcon } from "lucide-react";
2
- export interface IconEntry {
3
- id: string;
4
- label: string;
5
- icon: LucideIcon;
6
- }
7
- export declare const curatedIcons: IconEntry[];
8
- export declare function getIcon(id: string): IconEntry | undefined;
9
- //# sourceMappingURL=icons.d.ts.map
@@ -1,28 +0,0 @@
1
- import { type Section } from "../schemas/sections";
2
- import { type SiteIndex, type SectionMeta } from "../schemas/site-config";
3
- export interface LoadedSection {
4
- section: Section;
5
- meta: SectionMeta;
6
- }
7
- export interface SiteContent {
8
- sections: LoadedSection[];
9
- index: SiteIndex;
10
- }
11
- /**
12
- * Merge a validated index with raw section file contents.
13
- * Validates each section file against its Zod schema.
14
- * Returns sections in the order specified by index.order.
15
- */
16
- export declare function mergeSiteContent(index: SiteIndex, sectionFiles: Record<string, unknown>): SiteContent;
17
- /**
18
- * Build a SiteContent from a Vite `import.meta.glob` result.
19
- * Callers glob the section JSON files at build time, pass the parsed index, and
20
- * receive sections merged in index.order.
21
- */
22
- export declare function loadStaticSiteContent(index: SiteIndex, sectionGlob: Record<string, unknown>): SiteContent;
23
- /**
24
- * Load site content from the filesystem.
25
- * For use in scripts and tests — Astro pages should use import.meta.glob instead.
26
- */
27
- export declare function loadSiteContent(contentDir: string): Promise<SiteContent>;
28
- //# sourceMappingURL=loader.d.ts.map
package/src/lib/nav.d.ts DELETED
@@ -1,15 +0,0 @@
1
- import type { LoadedSection } from "./loader";
2
- export interface NavItem {
3
- href: string;
4
- label: string;
5
- status?: string;
6
- children: NavItem[];
7
- }
8
- export declare function toSectionId(text: string): string;
9
- /**
10
- * Generate a three-tier navigation structure from sections.
11
- * link_heading → top-level, sub_heading → second-level, sub_sub_heading → third-level.
12
- * Non-heading sections are skipped.
13
- */
14
- export declare function generateNavLinks(sections: LoadedSection[]): NavItem[];
15
- //# sourceMappingURL=nav.d.ts.map
@@ -1,110 +0,0 @@
1
- import type { ZodType, z } from "zod";
2
- import type { ComponentType, ReactNode } from "react";
3
- import type { Audience } from "../schemas/auth";
4
- export type SettingsFieldDef = {
5
- type: "text";
6
- label: string;
7
- default: string;
8
- target?: "content" | "options";
9
- placeholder?: string;
10
- } | {
11
- type: "number";
12
- label: string;
13
- default: number;
14
- target?: "content" | "options";
15
- min?: number;
16
- max?: number;
17
- } | {
18
- type: "checkbox";
19
- label: string;
20
- default: boolean;
21
- target?: "content" | "options";
22
- } | {
23
- type: "select";
24
- label: string;
25
- default: string;
26
- target?: "content" | "options";
27
- coerce?: "number";
28
- options: {
29
- label: string;
30
- value: string;
31
- }[];
32
- } | {
33
- type: "range";
34
- label: string;
35
- default: number;
36
- target?: "content" | "options";
37
- min: number;
38
- max: number;
39
- step?: number;
40
- };
41
- export type SettingsSchema = Record<string, SettingsFieldDef>;
42
- export type CustomSettingsFormProps = Record<string, any>;
43
- export interface SectionProps<T = unknown> {
44
- content: T;
45
- options?: Record<string, unknown>;
46
- onChange?: (content: T) => void;
47
- isEditMode: boolean;
48
- openModal?: (title: string, content: ReactNode) => void;
49
- }
50
- export interface WrapperProps {
51
- sectionId: string;
52
- sectionType: string;
53
- status: string;
54
- dirty?: boolean;
55
- index: number;
56
- isLast: boolean;
57
- definition: SectionDefinition;
58
- options?: Record<string, unknown>;
59
- audiences: Audience[];
60
- access: string[];
61
- onAccessChange?: (access: string[]) => void;
62
- onStatusChange?: (status: "draft" | "published" | "archived") => void;
63
- onSectionChange?: (options: Record<string, unknown>) => void;
64
- onReorder?: (fromIndex: number, toIndex: number) => void;
65
- onRequestInsert?: (index: number) => void;
66
- onDelete?: () => void;
67
- children: React.ReactNode;
68
- }
69
- export interface SectionDefinition<T = unknown> {
70
- type: string;
71
- label: string;
72
- icon?: string;
73
- schema: ZodType<T>;
74
- component: ComponentType<SectionProps<T>>;
75
- defaults: () => T;
76
- wrapper?: ComponentType<WrapperProps>;
77
- settings?: SettingsSchema;
78
- settingsForm?: ComponentType<any>;
79
- }
80
- type DefineSectionInput<S extends ZodType> = {
81
- type: string;
82
- label: string;
83
- icon?: string;
84
- schema: S;
85
- component: ComponentType<SectionProps<z.infer<S>>>;
86
- defaults: () => z.infer<S>;
87
- wrapper?: ComponentType<WrapperProps>;
88
- settings?: SettingsSchema;
89
- settingsForm?: ComponentType<any>;
90
- };
91
- export declare function defineSection<S extends ZodType>(def: DefineSectionInput<S>): SectionDefinition<z.infer<S>>;
92
- export interface SectionRegistry {
93
- registerSection(def: SectionDefinition<any>): void;
94
- registerSchema(type: string, schema: ZodType): void;
95
- getSection(type: string): SectionDefinition | undefined;
96
- getSchema(type: string): ZodType | undefined;
97
- getAllSections(): SectionDefinition[];
98
- getAllSchemas(): ZodType[];
99
- clearRegistry(): void;
100
- }
101
- export declare function createRegistry(): SectionRegistry;
102
- export declare function registerSection(def: SectionDefinition<any>): void;
103
- export declare function registerSchema(type: string, schema: ZodType): void;
104
- export declare function getSection(type: string): SectionDefinition | undefined;
105
- export declare function getSchema(type: string): ZodType | undefined;
106
- export declare function getAllSections(): SectionDefinition[];
107
- export declare function getAllSchemas(): ZodType[];
108
- export declare function clearRegistry(): void;
109
- export {};
110
- //# sourceMappingURL=registry.d.ts.map
@@ -1,2 +0,0 @@
1
- export declare function sanitizeHtml(html: string): string;
2
- //# sourceMappingURL=sanitize.d.ts.map
@@ -1,3 +0,0 @@
1
- import type { MediaAdapter, MediaManifest } from "./types";
2
- export declare function createGitHubMediaAdapter(manifest: MediaManifest): MediaAdapter;
3
- //# sourceMappingURL=github.d.ts.map
@@ -1,8 +0,0 @@
1
- import type { MediaAdapter, MediaManifest } from "./types";
2
- export * from "./types";
3
- export * from "./utils";
4
- export * from "./queue";
5
- export * from "./resolve";
6
- export { generateVideoPoster } from "./videoPoster";
7
- export declare function createMediaAdapter(manifest: MediaManifest): MediaAdapter;
8
- //# sourceMappingURL=index.d.ts.map