@autumnsgrove/groveengine 0.6.2 → 0.6.3
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/auth/jwt.d.ts +10 -4
- package/dist/auth/jwt.js +18 -4
- package/dist/auth/session.d.ts +22 -15
- package/dist/auth/session.js +35 -16
- package/dist/components/admin/GutterManager.svelte +81 -139
- package/dist/components/admin/GutterManager.svelte.d.ts +6 -6
- package/dist/components/admin/MarkdownEditor.svelte +80 -23
- package/dist/components/admin/MarkdownEditor.svelte.d.ts +14 -8
- package/dist/components/admin/composables/useAmbientSounds.svelte.d.ts +52 -2
- package/dist/components/admin/composables/useAmbientSounds.svelte.js +38 -4
- package/dist/components/admin/composables/useCommandPalette.svelte.d.ts +80 -10
- package/dist/components/admin/composables/useCommandPalette.svelte.js +45 -5
- package/dist/components/admin/composables/useDraftManager.svelte.d.ts +76 -14
- package/dist/components/admin/composables/useDraftManager.svelte.js +44 -10
- package/dist/components/admin/composables/useEditorTheme.svelte.d.ts +168 -2
- package/dist/components/admin/composables/useEditorTheme.svelte.js +40 -7
- package/dist/components/admin/composables/useSlashCommands.svelte.d.ts +94 -22
- package/dist/components/admin/composables/useSlashCommands.svelte.js +58 -9
- package/dist/components/admin/composables/useSnippets.svelte.d.ts +51 -2
- package/dist/components/admin/composables/useSnippets.svelte.js +35 -3
- package/dist/components/admin/composables/useWritingSession.svelte.d.ts +64 -6
- package/dist/components/admin/composables/useWritingSession.svelte.js +42 -5
- package/dist/components/custom/ContentWithGutter.svelte +53 -23
- package/dist/components/custom/ContentWithGutter.svelte.d.ts +6 -14
- package/dist/components/custom/GutterItem.svelte +1 -1
- package/dist/components/custom/LeftGutter.svelte +43 -13
- package/dist/components/custom/LeftGutter.svelte.d.ts +6 -6
- package/dist/config/ai-models.js +1 -1
- package/dist/groveauth/client.js +11 -11
- package/dist/index.d.ts +3 -1
- package/dist/index.js +2 -2
- package/dist/server/logger.d.ts +74 -26
- package/dist/server/logger.js +133 -184
- package/dist/server/services/cache.js +1 -10
- package/dist/ui/components/charts/ActivityOverview.svelte +14 -3
- package/dist/ui/components/charts/ActivityOverview.svelte.d.ts +10 -7
- package/dist/ui/components/charts/RepoBreakdown.svelte +9 -3
- package/dist/ui/components/charts/RepoBreakdown.svelte.d.ts +12 -11
- package/dist/ui/components/charts/Sparkline.svelte +18 -7
- package/dist/ui/components/charts/Sparkline.svelte.d.ts +21 -2
- package/dist/ui/components/gallery/ImageGallery.svelte +12 -8
- package/dist/ui/components/gallery/ImageGallery.svelte.d.ts +2 -2
- package/dist/ui/components/gallery/Lightbox.svelte +5 -2
- package/dist/ui/components/gallery/ZoomableImage.svelte +8 -5
- package/dist/ui/components/primitives/accordion/index.d.ts +1 -1
- package/dist/ui/components/primitives/input/input.svelte.d.ts +1 -1
- package/dist/ui/components/primitives/tabs/index.d.ts +1 -1
- package/dist/ui/components/primitives/textarea/textarea.svelte.d.ts +1 -1
- package/dist/ui/components/ui/Button.svelte +5 -0
- package/dist/ui/components/ui/Button.svelte.d.ts +4 -1
- package/dist/ui/components/ui/Input.svelte +4 -0
- package/dist/ui/components/ui/Input.svelte.d.ts +3 -1
- package/dist/ui/components/ui/Logo.svelte +86 -0
- package/dist/ui/components/ui/Logo.svelte.d.ts +25 -0
- package/dist/ui/components/ui/LogoLoader.svelte +71 -0
- package/dist/ui/components/ui/LogoLoader.svelte.d.ts +9 -0
- package/dist/ui/components/ui/index.d.ts +2 -0
- package/dist/ui/components/ui/index.js +2 -0
- package/dist/ui/tailwind.preset.js +8 -8
- package/dist/utils/api.js +2 -1
- package/dist/utils/debounce.d.ts +4 -3
- package/dist/utils/debounce.js +10 -6
- package/dist/utils/gallery.d.ts +58 -32
- package/dist/utils/gallery.js +111 -129
- package/dist/utils/gutter.d.ts +47 -26
- package/dist/utils/gutter.js +116 -124
- package/dist/utils/imageProcessor.d.ts +66 -19
- package/dist/utils/imageProcessor.js +31 -10
- package/dist/utils/index.d.ts +11 -11
- package/dist/utils/index.js +4 -3
- package/dist/utils/json.js +1 -1
- package/dist/utils/markdown.d.ts +183 -103
- package/dist/utils/markdown.js +517 -678
- package/dist/utils/sanitize.d.ts +22 -12
- package/dist/utils/sanitize.js +268 -282
- package/dist/utils/validation.js +4 -3
- package/package.json +3 -2
package/dist/utils/markdown.d.ts
CHANGED
|
@@ -1,165 +1,245 @@
|
|
|
1
|
+
/** Header extracted from markdown for table of contents */
|
|
2
|
+
export interface Header {
|
|
3
|
+
level: number;
|
|
4
|
+
text: string;
|
|
5
|
+
id: string;
|
|
6
|
+
}
|
|
7
|
+
/** Frontmatter data from markdown files */
|
|
8
|
+
export interface Frontmatter {
|
|
9
|
+
title?: string;
|
|
10
|
+
date?: string;
|
|
11
|
+
tags?: string[];
|
|
12
|
+
description?: string;
|
|
13
|
+
hero?: {
|
|
14
|
+
title?: string;
|
|
15
|
+
subtitle?: string;
|
|
16
|
+
cta?: {
|
|
17
|
+
text: string;
|
|
18
|
+
link: string;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
galleries?: unknown[];
|
|
22
|
+
[key: string]: unknown;
|
|
23
|
+
}
|
|
24
|
+
/** Parsed markdown content result */
|
|
25
|
+
export interface ParsedContent {
|
|
26
|
+
data: Frontmatter;
|
|
27
|
+
content: string;
|
|
28
|
+
headers: Header[];
|
|
29
|
+
rawMarkdown?: string;
|
|
30
|
+
}
|
|
31
|
+
/** Image in a gallery */
|
|
32
|
+
export interface GalleryImage {
|
|
33
|
+
url: string;
|
|
34
|
+
alt: string;
|
|
35
|
+
caption: string;
|
|
36
|
+
}
|
|
37
|
+
/** Base gutter item */
|
|
38
|
+
export interface GutterItemBase {
|
|
39
|
+
type: string;
|
|
40
|
+
anchor?: string;
|
|
41
|
+
file?: string;
|
|
42
|
+
url?: string;
|
|
43
|
+
alt?: string;
|
|
44
|
+
caption?: string;
|
|
45
|
+
images?: Array<{
|
|
46
|
+
url?: string;
|
|
47
|
+
file?: string;
|
|
48
|
+
alt?: string;
|
|
49
|
+
caption?: string;
|
|
50
|
+
}>;
|
|
51
|
+
}
|
|
52
|
+
/** Processed gutter item with resolved content */
|
|
53
|
+
export interface GutterItem extends GutterItemBase {
|
|
54
|
+
content?: string;
|
|
55
|
+
src?: string;
|
|
56
|
+
images?: GalleryImage[];
|
|
57
|
+
}
|
|
58
|
+
/** Gutter manifest structure */
|
|
59
|
+
export interface GutterManifest {
|
|
60
|
+
items: GutterItemBase[];
|
|
61
|
+
}
|
|
62
|
+
/** Post/Recipe metadata */
|
|
63
|
+
export interface PostMeta {
|
|
64
|
+
slug: string;
|
|
65
|
+
title: string;
|
|
66
|
+
date: string;
|
|
67
|
+
tags: string[];
|
|
68
|
+
description: string;
|
|
69
|
+
}
|
|
70
|
+
/** Full post/recipe with content */
|
|
71
|
+
export interface Post extends PostMeta {
|
|
72
|
+
content: string;
|
|
73
|
+
headers: Header[];
|
|
74
|
+
gutterContent?: GutterItem[];
|
|
75
|
+
sidecar?: unknown;
|
|
76
|
+
}
|
|
77
|
+
/** Page content (home, about, contact) */
|
|
78
|
+
export interface Page {
|
|
79
|
+
slug: string;
|
|
80
|
+
title: string;
|
|
81
|
+
description: string;
|
|
82
|
+
content: string;
|
|
83
|
+
headers: Header[];
|
|
84
|
+
date?: string;
|
|
85
|
+
hero?: Frontmatter["hero"];
|
|
86
|
+
galleries?: unknown[];
|
|
87
|
+
gutterContent?: GutterItem[];
|
|
88
|
+
}
|
|
89
|
+
/** Site configuration */
|
|
90
|
+
export interface SiteConfig {
|
|
91
|
+
owner: {
|
|
92
|
+
name: string;
|
|
93
|
+
email: string;
|
|
94
|
+
};
|
|
95
|
+
site: {
|
|
96
|
+
title: string;
|
|
97
|
+
description: string;
|
|
98
|
+
copyright: string;
|
|
99
|
+
};
|
|
100
|
+
social: Record<string, string>;
|
|
101
|
+
}
|
|
102
|
+
/** Module map from import.meta.glob */
|
|
103
|
+
export type ModuleMap = Record<string, string>;
|
|
104
|
+
/** Gutter modules configuration */
|
|
105
|
+
export interface GutterModules {
|
|
106
|
+
manifest: Record<string, GutterManifest | {
|
|
107
|
+
default: GutterManifest;
|
|
108
|
+
}>;
|
|
109
|
+
markdown?: Record<string, string>;
|
|
110
|
+
images?: Record<string, string>;
|
|
111
|
+
}
|
|
112
|
+
/** Options for getItemBySlug */
|
|
113
|
+
export interface GetItemOptions {
|
|
114
|
+
gutterModules?: GutterModules;
|
|
115
|
+
sidecarModules?: Record<string, unknown>;
|
|
116
|
+
}
|
|
117
|
+
/** Options for getPageByFilename */
|
|
118
|
+
export interface GetPageOptions {
|
|
119
|
+
gutterModules?: GutterModules;
|
|
120
|
+
slug?: string;
|
|
121
|
+
}
|
|
122
|
+
/** Content loader interface */
|
|
123
|
+
export interface ContentLoader {
|
|
124
|
+
getAllPosts(): PostMeta[];
|
|
125
|
+
getAllRecipes(): PostMeta[];
|
|
126
|
+
getLatestPost(): Post | null;
|
|
127
|
+
getPostBySlug(slug: string): Post | null;
|
|
128
|
+
getRecipeBySlug(slug: string): Post | null;
|
|
129
|
+
getHomePage(): Page | null;
|
|
130
|
+
getAboutPage(): Page | null;
|
|
131
|
+
getContactPage(): Page | null;
|
|
132
|
+
getSiteConfig(): SiteConfig;
|
|
133
|
+
getGutterContent(slug: string): GutterItem[];
|
|
134
|
+
getRecipeGutterContent(slug: string): GutterItem[];
|
|
135
|
+
getHomeGutterContent(slug: string): GutterItem[];
|
|
136
|
+
getAboutGutterContent(slug: string): GutterItem[];
|
|
137
|
+
getContactGutterContent(slug: string): GutterItem[];
|
|
138
|
+
getRecipeSidecar(slug: string): unknown;
|
|
139
|
+
}
|
|
140
|
+
/** Content loader configuration */
|
|
141
|
+
export interface ContentLoaderConfig {
|
|
142
|
+
posts?: ModuleMap;
|
|
143
|
+
recipes?: ModuleMap;
|
|
144
|
+
about?: ModuleMap;
|
|
145
|
+
home?: ModuleMap;
|
|
146
|
+
contact?: ModuleMap;
|
|
147
|
+
siteConfig?: Record<string, SiteConfig | {
|
|
148
|
+
default: SiteConfig;
|
|
149
|
+
}>;
|
|
150
|
+
postGutter?: Partial<GutterModules>;
|
|
151
|
+
recipeGutter?: Partial<GutterModules>;
|
|
152
|
+
recipeMetadata?: Record<string, unknown>;
|
|
153
|
+
aboutGutter?: Partial<GutterModules>;
|
|
154
|
+
homeGutter?: Partial<GutterModules>;
|
|
155
|
+
contactGutter?: Partial<GutterModules>;
|
|
156
|
+
}
|
|
1
157
|
/**
|
|
2
158
|
* Extract headers from markdown content for table of contents
|
|
3
|
-
* @param {string} markdown - The raw markdown content
|
|
4
|
-
* @returns {Array} Array of header objects with level, text, and id
|
|
5
159
|
*/
|
|
6
|
-
export function extractHeaders(markdown: string):
|
|
160
|
+
export declare function extractHeaders(markdown: string): Header[];
|
|
7
161
|
/**
|
|
8
162
|
* Process anchor tags in HTML content
|
|
9
163
|
* Converts <!-- anchor:tagname --> comments to identifiable span elements
|
|
10
|
-
* @param {string} html - The HTML content
|
|
11
|
-
* @returns {string} HTML with anchor markers converted to spans
|
|
12
164
|
*/
|
|
13
|
-
export function processAnchorTags(html: string): string;
|
|
165
|
+
export declare function processAnchorTags(html: string): string;
|
|
14
166
|
/**
|
|
15
167
|
* Parse markdown content and convert to HTML
|
|
16
|
-
* @param {string} markdownContent - The raw markdown content (may include frontmatter)
|
|
17
|
-
* @returns {Object} Object with data (frontmatter), content (HTML), headers, and raw markdown
|
|
18
168
|
*/
|
|
19
|
-
export function parseMarkdownContent(markdownContent: string):
|
|
169
|
+
export declare function parseMarkdownContent(markdownContent: string): ParsedContent;
|
|
20
170
|
/**
|
|
21
171
|
* Parse markdown content with sanitization (for user-facing pages like home, about, contact)
|
|
22
|
-
* @param {string} markdownContent - The raw markdown content (may include frontmatter)
|
|
23
|
-
* @returns {Object} Object with data (frontmatter), content (sanitized HTML), headers
|
|
24
172
|
*/
|
|
25
|
-
export function parseMarkdownContentSanitized(markdownContent: string):
|
|
173
|
+
export declare function parseMarkdownContentSanitized(markdownContent: string): ParsedContent;
|
|
26
174
|
/**
|
|
27
175
|
* Get gutter content from provided modules
|
|
28
176
|
* This is a utility function that processes gutter manifests, markdown, and images
|
|
29
|
-
*
|
|
30
|
-
* @param {string} slug - The page/post slug
|
|
31
|
-
* @param {Object} manifestModules - The manifest modules (from import.meta.glob)
|
|
32
|
-
* @param {Object} markdownModules - The markdown modules (from import.meta.glob)
|
|
33
|
-
* @param {Object} imageModules - The image modules (from import.meta.glob)
|
|
34
|
-
* @returns {Array} Array of gutter items with content and position info
|
|
35
177
|
*/
|
|
36
|
-
export function processGutterContent(slug: string, manifestModules:
|
|
178
|
+
export declare function processGutterContent(slug: string, manifestModules: Record<string, GutterManifest | {
|
|
179
|
+
default: GutterManifest;
|
|
180
|
+
}>, markdownModules: Record<string, string>, imageModules: Record<string, string>): GutterItem[];
|
|
37
181
|
/**
|
|
38
182
|
* Process a list of markdown files into post/recipe objects
|
|
39
|
-
*
|
|
40
|
-
* @param {Object} modules - The modules from import.meta.glob (filepath -> content)
|
|
41
|
-
* @returns {Array} Array of post/content objects with metadata and slug
|
|
42
183
|
*/
|
|
43
|
-
export function processMarkdownModules(modules:
|
|
184
|
+
export declare function processMarkdownModules(modules: ModuleMap): PostMeta[];
|
|
44
185
|
/**
|
|
45
186
|
* Get a single item by slug from modules
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
* @param {Object} modules - The modules from import.meta.glob (filepath -> content)
|
|
49
|
-
* @param {Object} options - Optional configuration
|
|
50
|
-
* @param {Object} options.gutterModules - Gutter modules { manifest, markdown, images }
|
|
51
|
-
* @param {Object} options.sidecarModules - Sidecar/metadata modules (for recipes)
|
|
52
|
-
* @returns {Object|null} Item object with content and metadata
|
|
53
|
-
*/
|
|
54
|
-
export function getItemBySlug(slug: string, modules: Object, options?: {
|
|
55
|
-
gutterModules: Object;
|
|
56
|
-
sidecarModules: Object;
|
|
57
|
-
}): Object | null;
|
|
187
|
+
*/
|
|
188
|
+
export declare function getItemBySlug(slug: string, modules: ModuleMap, options?: GetItemOptions): Post | null;
|
|
58
189
|
/**
|
|
59
190
|
* Get a page (home, about, contact) by filename from modules
|
|
60
191
|
* Uses sanitization for security
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
* @param {Object} modules - The modules from import.meta.glob (filepath -> content)
|
|
64
|
-
* @param {Object} options - Optional configuration
|
|
65
|
-
* @param {Object} options.gutterModules - Gutter modules { manifest, markdown, images }
|
|
66
|
-
* @param {string} options.slug - Override slug (defaults to filename without .md)
|
|
67
|
-
* @returns {Object|null} Page object with content and metadata
|
|
68
|
-
*/
|
|
69
|
-
export function getPageByFilename(filename: string, modules: Object, options?: {
|
|
70
|
-
gutterModules: Object;
|
|
71
|
-
slug: string;
|
|
72
|
-
}): Object | null;
|
|
192
|
+
*/
|
|
193
|
+
export declare function getPageByFilename(filename: string, modules: ModuleMap, options?: GetPageOptions): Page | null;
|
|
73
194
|
/**
|
|
74
195
|
* Get site configuration from a config module
|
|
75
|
-
*
|
|
76
|
-
* @param {Object} configModule - The config module from import.meta.glob
|
|
77
|
-
* @returns {Object} Site configuration object
|
|
78
196
|
*/
|
|
79
|
-
export function getSiteConfigFromModule(configModule:
|
|
197
|
+
export declare function getSiteConfigFromModule(configModule: Record<string, SiteConfig | {
|
|
198
|
+
default: SiteConfig;
|
|
199
|
+
}>): SiteConfig;
|
|
80
200
|
/**
|
|
81
201
|
* Create a configured content loader with all functions bound to the provided modules
|
|
82
202
|
* This is the main factory function for creating a content loader in the consuming app
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
* @param {Object} config.posts - Post modules from import.meta.glob
|
|
86
|
-
* @param {Object} config.recipes - Recipe modules from import.meta.glob
|
|
87
|
-
* @param {Object} config.about - About page modules from import.meta.glob
|
|
88
|
-
* @param {Object} config.home - Home page modules from import.meta.glob
|
|
89
|
-
* @param {Object} config.contact - Contact page modules from import.meta.glob
|
|
90
|
-
* @param {Object} config.siteConfig - Site config module from import.meta.glob
|
|
91
|
-
* @param {Object} config.postGutter - Post gutter modules { manifest, markdown, images }
|
|
92
|
-
* @param {Object} config.recipeGutter - Recipe gutter modules { manifest, markdown, images }
|
|
93
|
-
* @param {Object} config.recipeMetadata - Recipe metadata modules from import.meta.glob
|
|
94
|
-
* @param {Object} config.aboutGutter - About gutter modules { manifest, markdown, images }
|
|
95
|
-
* @param {Object} config.homeGutter - Home gutter modules { manifest, markdown, images }
|
|
96
|
-
* @param {Object} config.contactGutter - Contact gutter modules { manifest, markdown, images }
|
|
97
|
-
* @returns {Object} Object with all content loader functions
|
|
98
|
-
*/
|
|
99
|
-
export function createContentLoader(config: {
|
|
100
|
-
posts: Object;
|
|
101
|
-
recipes: Object;
|
|
102
|
-
about: Object;
|
|
103
|
-
home: Object;
|
|
104
|
-
contact: Object;
|
|
105
|
-
siteConfig: Object;
|
|
106
|
-
postGutter: Object;
|
|
107
|
-
recipeGutter: Object;
|
|
108
|
-
recipeMetadata: Object;
|
|
109
|
-
aboutGutter: Object;
|
|
110
|
-
homeGutter: Object;
|
|
111
|
-
contactGutter: Object;
|
|
112
|
-
}): Object;
|
|
203
|
+
*/
|
|
204
|
+
export declare function createContentLoader(config: ContentLoaderConfig): ContentLoader;
|
|
113
205
|
/**
|
|
114
206
|
* Register a content loader for the site
|
|
115
207
|
* This should be called by the consuming site to provide access to content
|
|
116
|
-
* @param {Object} loader - Object with getAllPosts, getSiteConfig, getLatestPost functions
|
|
117
208
|
*/
|
|
118
|
-
export function registerContentLoader(loader:
|
|
209
|
+
export declare function registerContentLoader(loader: ContentLoader): void;
|
|
119
210
|
/**
|
|
120
211
|
* Get all blog posts
|
|
121
|
-
* @returns {Array} Array of post objects
|
|
122
212
|
*/
|
|
123
|
-
export function getAllPosts():
|
|
213
|
+
export declare function getAllPosts(): PostMeta[];
|
|
124
214
|
/**
|
|
125
215
|
* Get site configuration
|
|
126
|
-
* @returns {Object} Site config object
|
|
127
216
|
*/
|
|
128
|
-
export function getSiteConfig():
|
|
217
|
+
export declare function getSiteConfig(): SiteConfig;
|
|
129
218
|
/**
|
|
130
219
|
* Get the latest post
|
|
131
|
-
* @returns {Object|null} Latest post or null
|
|
132
220
|
*/
|
|
133
|
-
export function getLatestPost():
|
|
221
|
+
export declare function getLatestPost(): Post | null;
|
|
134
222
|
/**
|
|
135
223
|
* Get home page content
|
|
136
|
-
* @returns {Object|null} Home page data or null
|
|
137
224
|
*/
|
|
138
|
-
export function getHomePage():
|
|
225
|
+
export declare function getHomePage(): Page | null;
|
|
139
226
|
/**
|
|
140
227
|
* Get a post by its slug
|
|
141
|
-
* @param {string} slug - The post slug
|
|
142
|
-
* @returns {Object|null} Post object or null
|
|
143
228
|
*/
|
|
144
|
-
export function getPostBySlug(slug: string):
|
|
229
|
+
export declare function getPostBySlug(slug: string): Post | null;
|
|
145
230
|
/**
|
|
146
231
|
* Get about page content
|
|
147
|
-
* @returns {Object|null} About page data or null
|
|
148
232
|
*/
|
|
149
|
-
export function getAboutPage():
|
|
233
|
+
export declare function getAboutPage(): Page | null;
|
|
150
234
|
/**
|
|
151
235
|
* Get contact page content
|
|
152
|
-
* @returns {Object|null} Contact page data or null
|
|
153
236
|
*/
|
|
154
|
-
export function getContactPage():
|
|
237
|
+
export declare function getContactPage(): Page | null;
|
|
155
238
|
/**
|
|
156
239
|
* Get all recipes
|
|
157
|
-
* @returns {Array} Array of recipe objects
|
|
158
240
|
*/
|
|
159
|
-
export function getAllRecipes():
|
|
241
|
+
export declare function getAllRecipes(): PostMeta[];
|
|
160
242
|
/**
|
|
161
243
|
* Get a recipe by its slug
|
|
162
|
-
* @param {string} slug - The recipe slug
|
|
163
|
-
* @returns {Object|null} Recipe object or null
|
|
164
244
|
*/
|
|
165
|
-
export function getRecipeBySlug(slug: string):
|
|
245
|
+
export declare function getRecipeBySlug(slug: string): Post | null;
|