@nuasite/cms 0.3.0 → 0.5.0
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/editor.js +35991 -0
- package/package.json +12 -11
- package/src/dev-middleware.ts +82 -2
- package/src/editor/components/block-editor.tsx +48 -57
- package/src/editor/components/outline.tsx +42 -35
- package/src/editor/components/toolbar.tsx +7 -4
- package/src/editor/hooks/useBlockEditorHandlers.ts +5 -5
- package/src/editor/hooks/useElementDetection.ts +2 -2
- package/src/editor/index.tsx +3 -2
- package/src/handlers/array-ops.ts +4 -4
- package/src/index.ts +54 -28
- package/dist/src/build-processor.d.ts +0 -20
- package/dist/src/build-processor.d.ts.map +0 -1
- package/dist/src/collection-scanner.d.ts +0 -6
- package/dist/src/collection-scanner.d.ts.map +0 -1
- package/dist/src/component-registry.d.ts +0 -67
- package/dist/src/component-registry.d.ts.map +0 -1
- package/dist/src/config.d.ts +0 -24
- package/dist/src/config.d.ts.map +0 -1
- package/dist/src/dev-middleware.d.ts +0 -20
- package/dist/src/dev-middleware.d.ts.map +0 -1
- package/dist/src/editor/ai.d.ts +0 -60
- package/dist/src/editor/ai.d.ts.map +0 -1
- package/dist/src/editor/api.d.ts +0 -154
- package/dist/src/editor/api.d.ts.map +0 -1
- package/dist/src/editor/color-utils.d.ts +0 -106
- package/dist/src/editor/color-utils.d.ts.map +0 -1
- package/dist/src/editor/components/ai-chat.d.ts +0 -11
- package/dist/src/editor/components/ai-chat.d.ts.map +0 -1
- package/dist/src/editor/components/ai-tooltip.d.ts +0 -12
- package/dist/src/editor/components/ai-tooltip.d.ts.map +0 -1
- package/dist/src/editor/components/attribute-editor.d.ts +0 -5
- package/dist/src/editor/components/attribute-editor.d.ts.map +0 -1
- package/dist/src/editor/components/block-editor.d.ts +0 -12
- package/dist/src/editor/components/block-editor.d.ts.map +0 -1
- package/dist/src/editor/components/collections-browser.d.ts +0 -2
- package/dist/src/editor/components/collections-browser.d.ts.map +0 -1
- package/dist/src/editor/components/color-toolbar.d.ts +0 -12
- package/dist/src/editor/components/color-toolbar.d.ts.map +0 -1
- package/dist/src/editor/components/confirm-dialog.d.ts +0 -2
- package/dist/src/editor/components/confirm-dialog.d.ts.map +0 -1
- package/dist/src/editor/components/create-page-modal.d.ts +0 -2
- package/dist/src/editor/components/create-page-modal.d.ts.map +0 -1
- package/dist/src/editor/components/editable-highlights.d.ts +0 -9
- package/dist/src/editor/components/editable-highlights.d.ts.map +0 -1
- package/dist/src/editor/components/error-boundary.d.ts +0 -32
- package/dist/src/editor/components/error-boundary.d.ts.map +0 -1
- package/dist/src/editor/components/fields.d.ts +0 -75
- package/dist/src/editor/components/fields.d.ts.map +0 -1
- package/dist/src/editor/components/frontmatter-fields.d.ts +0 -29
- package/dist/src/editor/components/frontmatter-fields.d.ts.map +0 -1
- package/dist/src/editor/components/highlight-overlay.d.ts +0 -64
- package/dist/src/editor/components/highlight-overlay.d.ts.map +0 -1
- package/dist/src/editor/components/image-overlay.d.ts +0 -12
- package/dist/src/editor/components/image-overlay.d.ts.map +0 -1
- package/dist/src/editor/components/markdown-editor-overlay.d.ts +0 -6
- package/dist/src/editor/components/markdown-editor-overlay.d.ts.map +0 -1
- package/dist/src/editor/components/markdown-inline-editor.d.ts +0 -10
- package/dist/src/editor/components/markdown-inline-editor.d.ts.map +0 -1
- package/dist/src/editor/components/media-library.d.ts +0 -2
- package/dist/src/editor/components/media-library.d.ts.map +0 -1
- package/dist/src/editor/components/outline.d.ts +0 -21
- package/dist/src/editor/components/outline.d.ts.map +0 -1
- package/dist/src/editor/components/redirect-countdown.d.ts +0 -2
- package/dist/src/editor/components/redirect-countdown.d.ts.map +0 -1
- package/dist/src/editor/components/seo-editor.d.ts +0 -2
- package/dist/src/editor/components/seo-editor.d.ts.map +0 -1
- package/dist/src/editor/components/text-style-toolbar.d.ts +0 -8
- package/dist/src/editor/components/text-style-toolbar.d.ts.map +0 -1
- package/dist/src/editor/components/toast/toast-container.d.ts +0 -7
- package/dist/src/editor/components/toast/toast-container.d.ts.map +0 -1
- package/dist/src/editor/components/toast/toast.d.ts +0 -7
- package/dist/src/editor/components/toast/toast.d.ts.map +0 -1
- package/dist/src/editor/components/toast/types.d.ts +0 -7
- package/dist/src/editor/components/toast/types.d.ts.map +0 -1
- package/dist/src/editor/components/toolbar.d.ts +0 -21
- package/dist/src/editor/components/toolbar.d.ts.map +0 -1
- package/dist/src/editor/config.d.ts +0 -4
- package/dist/src/editor/config.d.ts.map +0 -1
- package/dist/src/editor/constants.d.ts +0 -102
- package/dist/src/editor/constants.d.ts.map +0 -1
- package/dist/src/editor/context.d.ts +0 -14
- package/dist/src/editor/context.d.ts.map +0 -1
- package/dist/src/editor/dom.d.ts +0 -86
- package/dist/src/editor/dom.d.ts.map +0 -1
- package/dist/src/editor/editor.d.ts +0 -64
- package/dist/src/editor/editor.d.ts.map +0 -1
- package/dist/src/editor/history.d.ts +0 -20
- package/dist/src/editor/history.d.ts.map +0 -1
- package/dist/src/editor/hooks/index.d.ts +0 -14
- package/dist/src/editor/hooks/index.d.ts.map +0 -1
- package/dist/src/editor/hooks/useAIHandlers.d.ts +0 -22
- package/dist/src/editor/hooks/useAIHandlers.d.ts.map +0 -1
- package/dist/src/editor/hooks/useBlockEditorHandlers.d.ts +0 -18
- package/dist/src/editor/hooks/useBlockEditorHandlers.d.ts.map +0 -1
- package/dist/src/editor/hooks/useElementDetection.d.ts +0 -26
- package/dist/src/editor/hooks/useElementDetection.d.ts.map +0 -1
- package/dist/src/editor/hooks/useImageHoverDetection.d.ts +0 -12
- package/dist/src/editor/hooks/useImageHoverDetection.d.ts.map +0 -1
- package/dist/src/editor/hooks/useTextSelection.d.ts +0 -23
- package/dist/src/editor/hooks/useTextSelection.d.ts.map +0 -1
- package/dist/src/editor/hooks/useTooltipState.d.ts +0 -19
- package/dist/src/editor/hooks/useTooltipState.d.ts.map +0 -1
- package/dist/src/editor/hooks/utils.d.ts +0 -32
- package/dist/src/editor/hooks/utils.d.ts.map +0 -1
- package/dist/src/editor/index.d.ts +0 -12
- package/dist/src/editor/index.d.ts.map +0 -1
- package/dist/src/editor/lib/cn.d.ts +0 -3
- package/dist/src/editor/lib/cn.d.ts.map +0 -1
- package/dist/src/editor/manifest.d.ts +0 -19
- package/dist/src/editor/manifest.d.ts.map +0 -1
- package/dist/src/editor/markdown-api.d.ts +0 -36
- package/dist/src/editor/markdown-api.d.ts.map +0 -1
- package/dist/src/editor/signals.d.ts +0 -242
- package/dist/src/editor/signals.d.ts.map +0 -1
- package/dist/src/editor/storage.d.ts +0 -29
- package/dist/src/editor/storage.d.ts.map +0 -1
- package/dist/src/editor/text-styling.d.ts +0 -350
- package/dist/src/editor/text-styling.d.ts.map +0 -1
- package/dist/src/editor/themes.d.ts +0 -38
- package/dist/src/editor/themes.d.ts.map +0 -1
- package/dist/src/editor/types.d.ts +0 -454
- package/dist/src/editor/types.d.ts.map +0 -1
- package/dist/src/error-collector.d.ts +0 -56
- package/dist/src/error-collector.d.ts.map +0 -1
- package/dist/src/handlers/array-ops.d.ts +0 -59
- package/dist/src/handlers/array-ops.d.ts.map +0 -1
- package/dist/src/handlers/component-ops.d.ts +0 -60
- package/dist/src/handlers/component-ops.d.ts.map +0 -1
- package/dist/src/handlers/markdown-ops.d.ts +0 -41
- package/dist/src/handlers/markdown-ops.d.ts.map +0 -1
- package/dist/src/handlers/request-utils.d.ts +0 -20
- package/dist/src/handlers/request-utils.d.ts.map +0 -1
- package/dist/src/handlers/source-writer.d.ts +0 -51
- package/dist/src/handlers/source-writer.d.ts.map +0 -1
- package/dist/src/html-processor.d.ts +0 -63
- package/dist/src/html-processor.d.ts.map +0 -1
- package/dist/src/index.d.ts +0 -41
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/manifest-writer.d.ts +0 -111
- package/dist/src/manifest-writer.d.ts.map +0 -1
- package/dist/src/media/contember.d.ts +0 -15
- package/dist/src/media/contember.d.ts.map +0 -1
- package/dist/src/media/local.d.ts +0 -9
- package/dist/src/media/local.d.ts.map +0 -1
- package/dist/src/media/s3.d.ts +0 -12
- package/dist/src/media/s3.d.ts.map +0 -1
- package/dist/src/media/types.d.ts +0 -40
- package/dist/src/media/types.d.ts.map +0 -1
- package/dist/src/preview-generator.d.ts +0 -19
- package/dist/src/preview-generator.d.ts.map +0 -1
- package/dist/src/seo-processor.d.ts +0 -23
- package/dist/src/seo-processor.d.ts.map +0 -1
- package/dist/src/source-finder/ast-extractors.d.ts +0 -35
- package/dist/src/source-finder/ast-extractors.d.ts.map +0 -1
- package/dist/src/source-finder/ast-parser.d.ts +0 -18
- package/dist/src/source-finder/ast-parser.d.ts.map +0 -1
- package/dist/src/source-finder/cache.d.ts +0 -18
- package/dist/src/source-finder/cache.d.ts.map +0 -1
- package/dist/src/source-finder/collection-finder.d.ts +0 -29
- package/dist/src/source-finder/collection-finder.d.ts.map +0 -1
- package/dist/src/source-finder/cross-file-tracker.d.ts +0 -39
- package/dist/src/source-finder/cross-file-tracker.d.ts.map +0 -1
- package/dist/src/source-finder/element-finder.d.ts +0 -42
- package/dist/src/source-finder/element-finder.d.ts.map +0 -1
- package/dist/src/source-finder/image-finder.d.ts +0 -24
- package/dist/src/source-finder/image-finder.d.ts.map +0 -1
- package/dist/src/source-finder/index.d.ts +0 -9
- package/dist/src/source-finder/index.d.ts.map +0 -1
- package/dist/src/source-finder/search-index.d.ts +0 -27
- package/dist/src/source-finder/search-index.d.ts.map +0 -1
- package/dist/src/source-finder/snippet-utils.d.ts +0 -96
- package/dist/src/source-finder/snippet-utils.d.ts.map +0 -1
- package/dist/src/source-finder/source-lookup.d.ts +0 -16
- package/dist/src/source-finder/source-lookup.d.ts.map +0 -1
- package/dist/src/source-finder/types.d.ts +0 -167
- package/dist/src/source-finder/types.d.ts.map +0 -1
- package/dist/src/source-finder/variable-extraction.d.ts +0 -37
- package/dist/src/source-finder/variable-extraction.d.ts.map +0 -1
- package/dist/src/tailwind-colors.d.ts +0 -54
- package/dist/src/tailwind-colors.d.ts.map +0 -1
- package/dist/src/tsconfig.tsbuildinfo +0 -1
- package/dist/src/types.d.ts +0 -367
- package/dist/src/types.d.ts.map +0 -1
- package/dist/src/utils.d.ts +0 -61
- package/dist/src/utils.d.ts.map +0 -1
- package/dist/src/vite-plugin.d.ts +0 -14
- package/dist/src/vite-plugin.d.ts.map +0 -1
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import type { ManifestWriter } from '../manifest-writer';
|
|
2
|
-
import type { CmsManifest, ComponentInstance } from '../types';
|
|
3
|
-
export type InsertPosition = 'before' | 'after';
|
|
4
|
-
export interface InsertComponentRequest {
|
|
5
|
-
position: InsertPosition;
|
|
6
|
-
referenceComponentId: string;
|
|
7
|
-
componentName: string;
|
|
8
|
-
props: Record<string, unknown>;
|
|
9
|
-
meta?: {
|
|
10
|
-
source: string;
|
|
11
|
-
url: string;
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
export interface InsertComponentResponse {
|
|
15
|
-
success: boolean;
|
|
16
|
-
message?: string;
|
|
17
|
-
sourceFile?: string;
|
|
18
|
-
error?: string;
|
|
19
|
-
}
|
|
20
|
-
export interface RemoveComponentRequest {
|
|
21
|
-
componentId: string;
|
|
22
|
-
meta?: {
|
|
23
|
-
source: string;
|
|
24
|
-
url: string;
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
export interface RemoveComponentResponse {
|
|
28
|
-
success: boolean;
|
|
29
|
-
message?: string;
|
|
30
|
-
sourceFile?: string;
|
|
31
|
-
error?: string;
|
|
32
|
-
}
|
|
33
|
-
export declare function handleInsertComponent(request: InsertComponentRequest, manifestWriter: ManifestWriter): Promise<InsertComponentResponse>;
|
|
34
|
-
export declare function handleRemoveComponent(request: RemoveComponentRequest, manifestWriter: ManifestWriter): Promise<RemoveComponentResponse>;
|
|
35
|
-
export declare function getPageFileCandidates(pageUrl: string): string[];
|
|
36
|
-
export declare function getComponentOccurrenceIndex(manifest: CmsManifest, referenceComponent: ComponentInstance): number;
|
|
37
|
-
export declare function findComponentInvocationFile(projectRoot: string, pageUrl: string, manifest: CmsManifest, referenceComponent: ComponentInstance): Promise<{
|
|
38
|
-
filePath: string;
|
|
39
|
-
lineIndex: number;
|
|
40
|
-
} | null>;
|
|
41
|
-
export declare function findComponentInvocationLine(lines: string[], componentName: string, occurrenceIndex: number): number;
|
|
42
|
-
/**
|
|
43
|
-
* Find the line index after the frontmatter block (--- ... ---).
|
|
44
|
-
* Returns 0 if no frontmatter is found.
|
|
45
|
-
*/
|
|
46
|
-
export declare function findFrontmatterEnd(lines: string[]): number;
|
|
47
|
-
export declare function getIndentation(line: string): string;
|
|
48
|
-
export declare function normalizeFilePath(p: string): string;
|
|
49
|
-
/**
|
|
50
|
-
* Extract prop values from a component invocation in source code.
|
|
51
|
-
* Parses the opening JSX tag starting at `lineIndex` and returns a map of prop names to values.
|
|
52
|
-
*/
|
|
53
|
-
export declare function extractPropsFromSource(lines: string[], lineIndex: number, componentName: string): Record<string, any>;
|
|
54
|
-
/**
|
|
55
|
-
* Ensure the component has an import statement in the file's frontmatter.
|
|
56
|
-
* If the component is already imported, this is a no-op.
|
|
57
|
-
* Mutates the `lines` array in place.
|
|
58
|
-
*/
|
|
59
|
-
export declare function ensureComponentImport(lines: string[], componentName: string, componentFile: string, targetFile: string): void;
|
|
60
|
-
//# sourceMappingURL=component-ops.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"component-ops.d.ts","sourceRoot":"","sources":["../../../src/handlers/component-ops.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,KAAK,EAAE,WAAW,EAAuB,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAGnF,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,OAAO,CAAA;AAE/C,MAAM,WAAW,sBAAsB;IACtC,QAAQ,EAAE,cAAc,CAAA;IACxB,oBAAoB,EAAE,MAAM,CAAA;IAC5B,aAAa,EAAE,MAAM,CAAA;IACrB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC9B,IAAI,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAA;CACtC;AAED,MAAM,WAAW,uBAAuB;IACvC,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,KAAK,CAAC,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,sBAAsB;IACtC,WAAW,EAAE,MAAM,CAAA;IACnB,IAAI,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAA;CACtC;AAED,MAAM,WAAW,uBAAuB;IACvC,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,KAAK,CAAC,EAAE,MAAM,CAAA;CACd;AAED,wBAAsB,qBAAqB,CAC1C,OAAO,EAAE,sBAAsB,EAC/B,cAAc,EAAE,cAAc,GAC5B,OAAO,CAAC,uBAAuB,CAAC,CAwGlC;AAED,wBAAsB,qBAAqB,CAC1C,OAAO,EAAE,sBAAsB,EAC/B,cAAc,EAAE,cAAc,GAC5B,OAAO,CAAC,uBAAuB,CAAC,CAuFlC;AAqED,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAwB/D;AAED,wBAAgB,2BAA2B,CAC1C,QAAQ,EAAE,WAAW,EACrB,kBAAkB,EAAE,iBAAiB,GACnC,MAAM,CAeR;AAED,wBAAsB,2BAA2B,CAChD,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,WAAW,EACrB,kBAAkB,EAAE,iBAAiB,GACnC,OAAO,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,CA4CzD;AAED,wBAAgB,2BAA2B,CAC1C,KAAK,EAAE,MAAM,EAAE,EACf,aAAa,EAAE,MAAM,EACrB,eAAe,EAAE,MAAM,GACrB,MAAM,CAYR;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAM1D;AAqCD,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAGnD;AAED,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAOnD;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CACrC,KAAK,EAAE,MAAM,EAAE,EACf,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,MAAM,GACnB,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAQrB;AAyKD;;;;GAIG;AACH,wBAAgB,qBAAqB,CACpC,KAAK,EAAE,MAAM,EAAE,EACf,aAAa,EAAE,MAAM,EACrB,aAAa,EAAE,MAAM,EACrB,UAAU,EAAE,MAAM,GAChB,IAAI,CAsCN"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
export interface BlogFrontmatter {
|
|
2
|
-
title: string;
|
|
3
|
-
date: string;
|
|
4
|
-
author?: string;
|
|
5
|
-
categories?: string[];
|
|
6
|
-
excerpt?: string;
|
|
7
|
-
featuredImage?: string;
|
|
8
|
-
draft?: boolean;
|
|
9
|
-
[key: string]: unknown;
|
|
10
|
-
}
|
|
11
|
-
export interface CreateMarkdownRequest {
|
|
12
|
-
collection: string;
|
|
13
|
-
title: string;
|
|
14
|
-
slug: string;
|
|
15
|
-
frontmatter?: Partial<BlogFrontmatter>;
|
|
16
|
-
content?: string;
|
|
17
|
-
}
|
|
18
|
-
export interface CreateMarkdownResponse {
|
|
19
|
-
success: boolean;
|
|
20
|
-
filePath?: string;
|
|
21
|
-
slug?: string;
|
|
22
|
-
error?: string;
|
|
23
|
-
}
|
|
24
|
-
export interface UpdateMarkdownRequest {
|
|
25
|
-
filePath: string;
|
|
26
|
-
frontmatter?: Partial<BlogFrontmatter>;
|
|
27
|
-
content?: string;
|
|
28
|
-
}
|
|
29
|
-
export interface UpdateMarkdownResponse {
|
|
30
|
-
success: boolean;
|
|
31
|
-
error?: string;
|
|
32
|
-
}
|
|
33
|
-
export interface GetMarkdownContentResponse {
|
|
34
|
-
content: string;
|
|
35
|
-
frontmatter: BlogFrontmatter;
|
|
36
|
-
filePath: string;
|
|
37
|
-
}
|
|
38
|
-
export declare function handleGetMarkdownContent(filePath: string): Promise<GetMarkdownContentResponse | null>;
|
|
39
|
-
export declare function handleUpdateMarkdown(request: UpdateMarkdownRequest): Promise<UpdateMarkdownResponse>;
|
|
40
|
-
export declare function handleCreateMarkdown(request: CreateMarkdownRequest): Promise<CreateMarkdownResponse>;
|
|
41
|
-
//# sourceMappingURL=markdown-ops.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"markdown-ops.d.ts","sourceRoot":"","sources":["../../../src/handlers/markdown-ops.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,eAAe;IAC/B,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACtB;AAED,MAAM,WAAW,qBAAqB;IACrC,UAAU,EAAE,MAAM,CAAA;IAClB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAA;IACtC,OAAO,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,sBAAsB;IACtC,OAAO,EAAE,OAAO,CAAA;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,qBAAqB;IACrC,QAAQ,EAAE,MAAM,CAAA;IAChB,WAAW,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAA;IACtC,OAAO,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,sBAAsB;IACtC,OAAO,EAAE,OAAO,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,0BAA0B;IAC1C,OAAO,EAAE,MAAM,CAAA;IACf,WAAW,EAAE,eAAe,CAAA;IAC5B,QAAQ,EAAE,MAAM,CAAA;CAChB;AAED,wBAAsB,wBAAwB,CAC7C,QAAQ,EAAE,MAAM,GACd,OAAO,CAAC,0BAA0B,GAAG,IAAI,CAAC,CAc5C;AAED,wBAAsB,oBAAoB,CACzC,OAAO,EAAE,qBAAqB,GAC5B,OAAO,CAAC,sBAAsB,CAAC,CA0BjC;AAED,wBAAsB,oBAAoB,CACzC,OAAO,EAAE,qBAAqB,GAC5B,OAAO,CAAC,sBAAsB,CAAC,CAoCjC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { IncomingMessage, ServerResponse } from 'node:http';
|
|
2
|
-
export declare function readBody(req: IncomingMessage, maxSize?: number): Promise<Buffer>;
|
|
3
|
-
export declare function parseJsonBody<T>(req: IncomingMessage): Promise<T>;
|
|
4
|
-
export interface ParsedFile {
|
|
5
|
-
buffer: Buffer;
|
|
6
|
-
filename: string;
|
|
7
|
-
contentType: string;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Minimal multipart/form-data parser.
|
|
11
|
-
* Extracts the first file part from the request body.
|
|
12
|
-
*/
|
|
13
|
-
export declare function parseMultipartFile(body: Buffer, contentTypeHeader: string): ParsedFile | null;
|
|
14
|
-
export declare function sendJson(res: ServerResponse, data: unknown, status?: number, req?: IncomingMessage): void;
|
|
15
|
-
export declare function sendError(res: ServerResponse, message: string, status?: number, req?: IncomingMessage): void;
|
|
16
|
-
/**
|
|
17
|
-
* Handle CORS preflight. Returns true if the request was an OPTIONS request and was handled.
|
|
18
|
-
*/
|
|
19
|
-
export declare function handleCors(req: IncomingMessage, res: ServerResponse): boolean;
|
|
20
|
-
//# sourceMappingURL=request-utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"request-utils.d.ts","sourceRoot":"","sources":["../../../src/handlers/request-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAKhE,wBAAgB,QAAQ,CAAC,GAAG,EAAE,eAAe,EAAE,OAAO,GAAE,MAAsB,GAAG,OAAO,CAAC,MAAM,CAAC,CAgB/F;AAED,wBAAsB,aAAa,CAAC,CAAC,EAAE,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC,CAAC,CAAC,CAOvE;AAED,MAAM,WAAW,UAAU;IAC1B,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;IAChB,WAAW,EAAE,MAAM,CAAA;CACnB;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI,CAuE7F;AAQD,wBAAgB,QAAQ,CAAC,GAAG,EAAE,cAAc,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,SAAM,EAAE,GAAG,CAAC,EAAE,eAAe,GAAG,IAAI,CAQtG;AAED,wBAAgB,SAAS,CAAC,GAAG,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,SAAM,EAAE,GAAG,CAAC,EAAE,eAAe,GAAG,IAAI,CAEzG;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,cAAc,GAAG,OAAO,CAY7E"}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import type { ManifestWriter } from '../manifest-writer';
|
|
2
|
-
export interface ColorChangePayload {
|
|
3
|
-
oldClass: string;
|
|
4
|
-
newClass: string;
|
|
5
|
-
type: 'bg' | 'text' | 'border' | 'hoverBg' | 'hoverText';
|
|
6
|
-
sourcePath?: string;
|
|
7
|
-
sourceLine?: number;
|
|
8
|
-
sourceSnippet?: string;
|
|
9
|
-
}
|
|
10
|
-
export interface ImageChangePayload {
|
|
11
|
-
newSrc: string;
|
|
12
|
-
newAlt: string;
|
|
13
|
-
}
|
|
14
|
-
export interface AttributeChangePayload {
|
|
15
|
-
attributeName: string;
|
|
16
|
-
oldValue: string | undefined;
|
|
17
|
-
newValue: string | undefined;
|
|
18
|
-
sourcePath?: string;
|
|
19
|
-
sourceLine?: number;
|
|
20
|
-
sourceSnippet?: string;
|
|
21
|
-
}
|
|
22
|
-
export interface ChangePayload {
|
|
23
|
-
cmsId: string;
|
|
24
|
-
newValue: string;
|
|
25
|
-
originalValue: string;
|
|
26
|
-
sourcePath: string;
|
|
27
|
-
sourceLine: number;
|
|
28
|
-
sourceSnippet: string;
|
|
29
|
-
htmlValue?: string;
|
|
30
|
-
childCmsIds?: string[];
|
|
31
|
-
hasStyledContent?: boolean;
|
|
32
|
-
colorChange?: ColorChangePayload;
|
|
33
|
-
imageChange?: ImageChangePayload;
|
|
34
|
-
attributeChanges?: AttributeChangePayload[];
|
|
35
|
-
}
|
|
36
|
-
export interface SaveBatchRequest {
|
|
37
|
-
changes: ChangePayload[];
|
|
38
|
-
meta: {
|
|
39
|
-
source: string;
|
|
40
|
-
url: string;
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
export interface SaveBatchResponse {
|
|
44
|
-
updated: number;
|
|
45
|
-
errors?: Array<{
|
|
46
|
-
cmsId: string;
|
|
47
|
-
error: string;
|
|
48
|
-
}>;
|
|
49
|
-
}
|
|
50
|
-
export declare function handleUpdate(request: SaveBatchRequest, manifestWriter: ManifestWriter): Promise<SaveBatchResponse>;
|
|
51
|
-
//# sourceMappingURL=source-writer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"source-writer.d.ts","sourceRoot":"","sources":["../../../src/handlers/source-writer.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAIxD,MAAM,WAAW,kBAAkB;IAClC,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,IAAI,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,GAAG,WAAW,CAAA;IACxD,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,aAAa,CAAC,EAAE,MAAM,CAAA;CACtB;AAED,MAAM,WAAW,kBAAkB;IAClC,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,sBAAsB;IACtC,aAAa,EAAE,MAAM,CAAA;IACrB,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAA;IAC5B,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAA;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,aAAa,CAAC,EAAE,MAAM,CAAA;CACtB;AAED,MAAM,WAAW,aAAa;IAC7B,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,CAAA;IAChB,aAAa,EAAE,MAAM,CAAA;IACrB,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,aAAa,EAAE,MAAM,CAAA;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;IACtB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,WAAW,CAAC,EAAE,kBAAkB,CAAA;IAChC,WAAW,CAAC,EAAE,kBAAkB,CAAA;IAChC,gBAAgB,CAAC,EAAE,sBAAsB,EAAE,CAAA;CAC3C;AAED,MAAM,WAAW,gBAAgB;IAChC,OAAO,EAAE,aAAa,EAAE,CAAA;IACxB,IAAI,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAA;CACrC;AAED,MAAM,WAAW,iBAAiB;IACjC,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAChD;AAED,wBAAsB,YAAY,CACjC,OAAO,EAAE,gBAAgB,EACzB,cAAc,EAAE,cAAc,GAC5B,OAAO,CAAC,iBAAiB,CAAC,CAoE5B"}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import type { ComponentInstance, ManifestEntry, PageSeoData, SeoOptions } from './types';
|
|
2
|
-
/**
|
|
3
|
-
* Inline text styling elements that should NOT be marked with CMS IDs.
|
|
4
|
-
* These elements are text formatting and should be part of their parent's content.
|
|
5
|
-
* They will be preserved as HTML when editing the parent element.
|
|
6
|
-
*/
|
|
7
|
-
export declare const INLINE_STYLE_TAGS: readonly ["strong", "b", "em", "i", "u", "s", "strike", "del", "ins", "mark", "small", "sub", "sup", "abbr", "cite", "code", "kbd", "samp", "var", "time", "dfn", "q"];
|
|
8
|
-
export interface ProcessHtmlOptions {
|
|
9
|
-
attributeName: string;
|
|
10
|
-
includeTags: string[] | null;
|
|
11
|
-
excludeTags: string[];
|
|
12
|
-
includeEmptyText: boolean;
|
|
13
|
-
generateManifest: boolean;
|
|
14
|
-
markComponents?: boolean;
|
|
15
|
-
componentDirs?: string[];
|
|
16
|
-
excludeComponentDirs?: string[];
|
|
17
|
-
markStyledSpans?: boolean;
|
|
18
|
-
/** When true, only mark elements that have source file attributes (from Astro templates) */
|
|
19
|
-
skipMarkdownContent?: boolean;
|
|
20
|
-
/**
|
|
21
|
-
* When true, skip marking inline text styling elements (strong, b, em, i, etc.).
|
|
22
|
-
* These elements will be preserved as part of their parent's HTML content.
|
|
23
|
-
* Defaults to true.
|
|
24
|
-
*/
|
|
25
|
-
skipInlineStyleTags?: boolean;
|
|
26
|
-
/** Collection info for marking the wrapper element containing markdown content */
|
|
27
|
-
collectionInfo?: {
|
|
28
|
-
name: string;
|
|
29
|
-
slug: string;
|
|
30
|
-
/** First line of the markdown body (used to find wrapper element in build mode) */
|
|
31
|
-
bodyFirstLine?: string;
|
|
32
|
-
/** Full markdown body text (used for robust wrapper detection in build mode) */
|
|
33
|
-
bodyText?: string;
|
|
34
|
-
/** Path to the markdown file (e.g., 'src/content/blog/my-post.md') */
|
|
35
|
-
contentPath?: string;
|
|
36
|
-
};
|
|
37
|
-
/** SEO tracking options */
|
|
38
|
-
seo?: SeoOptions;
|
|
39
|
-
}
|
|
40
|
-
export interface ProcessHtmlResult {
|
|
41
|
-
html: string;
|
|
42
|
-
entries: Record<string, ManifestEntry>;
|
|
43
|
-
components: Record<string, ComponentInstance>;
|
|
44
|
-
/** ID of the element wrapping collection markdown content */
|
|
45
|
-
collectionWrapperId?: string;
|
|
46
|
-
/** Extracted SEO data from the page */
|
|
47
|
-
seo?: PageSeoData;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Process HTML to inject CMS markers and extract manifest entries
|
|
51
|
-
*/
|
|
52
|
-
export declare function processHtml(html: string, fileId: string, options: ProcessHtmlOptions, getNextId: () => string, sourcePath?: string): Promise<ProcessHtmlResult>;
|
|
53
|
-
/**
|
|
54
|
-
* Extract component name from source file path
|
|
55
|
-
* e.g., "src/components/Welcome.astro" -> "Welcome"
|
|
56
|
-
* e.g., "src/components/ui/Button.astro" -> "Button"
|
|
57
|
-
*/
|
|
58
|
-
export declare function extractComponentName(sourceFile: string): string;
|
|
59
|
-
/**
|
|
60
|
-
* Clean text for comparison (normalize whitespace)
|
|
61
|
-
*/
|
|
62
|
-
export declare function cleanText(text: string): string;
|
|
63
|
-
//# sourceMappingURL=html-processor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"html-processor.d.ts","sourceRoot":"","sources":["../../src/html-processor.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAa,iBAAiB,EAAiB,aAAa,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAMlH;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,wKAuBpB,CAAA;AAEV,MAAM,WAAW,kBAAkB;IAClC,aAAa,EAAE,MAAM,CAAA;IACrB,WAAW,EAAE,MAAM,EAAE,GAAG,IAAI,CAAA;IAC5B,WAAW,EAAE,MAAM,EAAE,CAAA;IACrB,gBAAgB,EAAE,OAAO,CAAA;IACzB,gBAAgB,EAAE,OAAO,CAAA;IACzB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;IACxB,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC/B,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,4FAA4F;IAC5F,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,kFAAkF;IAClF,cAAc,CAAC,EAAE;QAChB,IAAI,EAAE,MAAM,CAAA;QACZ,IAAI,EAAE,MAAM,CAAA;QACZ,mFAAmF;QACnF,aAAa,CAAC,EAAE,MAAM,CAAA;QACtB,gFAAgF;QAChF,QAAQ,CAAC,EAAE,MAAM,CAAA;QACjB,sEAAsE;QACtE,WAAW,CAAC,EAAE,MAAM,CAAA;KACpB,CAAA;IACD,2BAA2B;IAC3B,GAAG,CAAC,EAAE,UAAU,CAAA;CAChB;AAED,MAAM,WAAW,iBAAiB;IACjC,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAA;IACtC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAA;IAC7C,6DAA6D;IAC7D,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,uCAAuC;IACvC,GAAG,CAAC,EAAE,WAAW,CAAA;CACjB;AAwHD;;GAEG;AACH,wBAAsB,WAAW,CAChC,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,kBAAkB,EAC3B,SAAS,EAAE,MAAM,MAAM,EACvB,UAAU,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,iBAAiB,CAAC,CAksB5B;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAK/D;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE9C"}
|
package/dist/src/index.d.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import type { AstroIntegration } from 'astro';
|
|
2
|
-
import type { MediaStorageAdapter } from './media/types';
|
|
3
|
-
import type { CmsMarkerOptions } from './types';
|
|
4
|
-
export interface NuaCmsOptions extends CmsMarkerOptions {
|
|
5
|
-
/**
|
|
6
|
-
* URL to the CMS editor script.
|
|
7
|
-
* If not set, the built-in editor bundle is served from the dev server.
|
|
8
|
-
*/
|
|
9
|
-
src?: string;
|
|
10
|
-
/**
|
|
11
|
-
* CMS configuration passed as window.NuaCmsConfig.
|
|
12
|
-
*/
|
|
13
|
-
cmsConfig?: {
|
|
14
|
-
apiBase?: string;
|
|
15
|
-
highlightColor?: string;
|
|
16
|
-
debug?: boolean;
|
|
17
|
-
theme?: Record<string, string>;
|
|
18
|
-
themePreset?: string;
|
|
19
|
-
};
|
|
20
|
-
/**
|
|
21
|
-
* Proxy /_nua/cms requests to this target URL during dev.
|
|
22
|
-
* Example: 'http://localhost:8787'
|
|
23
|
-
*/
|
|
24
|
-
proxy?: string;
|
|
25
|
-
/**
|
|
26
|
-
* Media storage adapter for file uploads.
|
|
27
|
-
* Defaults to local filesystem (public/uploads) when no proxy is configured.
|
|
28
|
-
*/
|
|
29
|
-
media?: MediaStorageAdapter;
|
|
30
|
-
}
|
|
31
|
-
export default function nuaCms(options?: NuaCmsOptions): AstroIntegration;
|
|
32
|
-
export { createContemberStorageAdapter as contemberMedia } from './media/contember';
|
|
33
|
-
export { createLocalStorageAdapter as localMedia } from './media/local';
|
|
34
|
-
export { createS3StorageAdapter as s3Media } from './media/s3';
|
|
35
|
-
export type { MediaItem, MediaStorageAdapter } from './media/types';
|
|
36
|
-
export { scanCollections } from './collection-scanner';
|
|
37
|
-
export { getProjectRoot, resetProjectRoot, setProjectRoot } from './config';
|
|
38
|
-
export type { CollectionInfo, MarkdownContent, SourceLocation, VariableReference } from './source-finder';
|
|
39
|
-
export { findCollectionSource, parseMarkdownContent } from './source-finder';
|
|
40
|
-
export type { Attribute, AvailableColors, AvailableTextStyles, CanonicalUrl, CmsManifest, CmsMarkerOptions, CollectionDefinition, CollectionEntry, ComponentDefinition, ComponentInstance, ComponentProp, ContentConstraints, FieldDefinition, FieldType, ImageMetadata, JsonLdEntry, ManifestEntry, ManifestMetadata, OpenGraphData, PageEntry, PageSeoData, SeoKeywords, SeoMetaTag, SeoOptions, SeoSourceInfo, SeoTitle, TailwindColor, TextStyleValue, TwitterCardData, } from './types';
|
|
41
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAA;AAY7C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAA;AACxD,OAAO,KAAK,EAAE,gBAAgB,EAAuB,MAAM,SAAS,CAAA;AAGpE,MAAM,WAAW,aAAc,SAAQ,gBAAgB;IACtD;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,SAAS,CAAC,EAAE;QACX,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,cAAc,CAAC,EAAE,MAAM,CAAA;QACvB,KAAK,CAAC,EAAE,OAAO,CAAA;QACf,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;QAC9B,WAAW,CAAC,EAAE,MAAM,CAAA;KACpB,CAAA;IACD;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;OAGG;IACH,KAAK,CAAC,EAAE,mBAAmB,CAAA;CAC3B;AAID,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,OAAO,GAAE,aAAkB,GAAG,gBAAgB,CAwM5E;AAED,OAAO,EAAE,6BAA6B,IAAI,cAAc,EAAE,MAAM,mBAAmB,CAAA;AACnF,OAAO,EAAE,yBAAyB,IAAI,UAAU,EAAE,MAAM,eAAe,CAAA;AACvE,OAAO,EAAE,sBAAsB,IAAI,OAAO,EAAE,MAAM,YAAY,CAAA;AAC9D,YAAY,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAA;AAEnE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAC3E,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AACzG,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AAC5E,YAAY,EACX,SAAS,EACT,eAAe,EACf,mBAAmB,EACnB,YAAY,EACZ,WAAW,EACX,gBAAgB,EAChB,oBAAoB,EACpB,eAAe,EACf,mBAAmB,EACnB,iBAAiB,EACjB,aAAa,EACb,kBAAkB,EAClB,eAAe,EACf,SAAS,EACT,aAAa,EACb,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,SAAS,EACT,WAAW,EACX,WAAW,EACX,UAAU,EACV,UAAU,EACV,aAAa,EACb,QAAQ,EACR,aAAa,EACb,cAAc,EACd,eAAe,GACf,MAAM,SAAS,CAAA"}
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import type { AvailableColors, AvailableTextStyles, CmsManifest, CollectionDefinition, CollectionEntry, ComponentDefinition, ComponentInstance, ManifestEntry, PageSeoData } from './types';
|
|
2
|
-
/**
|
|
3
|
-
* Manages streaming manifest writes during build.
|
|
4
|
-
* Accumulates entries and writes per-page manifests as pages are processed.
|
|
5
|
-
*/
|
|
6
|
-
export declare class ManifestWriter {
|
|
7
|
-
private globalManifest;
|
|
8
|
-
private pageManifests;
|
|
9
|
-
private outDir;
|
|
10
|
-
private manifestFile;
|
|
11
|
-
private componentDefinitions;
|
|
12
|
-
private collectionDefinitions;
|
|
13
|
-
private availableColors;
|
|
14
|
-
private availableTextStyles;
|
|
15
|
-
private writeQueue;
|
|
16
|
-
constructor(manifestFile: string, componentDefinitions?: Record<string, ComponentDefinition>);
|
|
17
|
-
/**
|
|
18
|
-
* Set the output directory for manifest files
|
|
19
|
-
*/
|
|
20
|
-
setOutDir(dir: string): void;
|
|
21
|
-
/**
|
|
22
|
-
* Update component definitions (called after initial scan)
|
|
23
|
-
*/
|
|
24
|
-
setComponentDefinitions(definitions: Record<string, ComponentDefinition>): void;
|
|
25
|
-
/**
|
|
26
|
-
* Load available Tailwind colors and text styles from the project's CSS config
|
|
27
|
-
*/
|
|
28
|
-
loadAvailableColors(projectRoot?: string): Promise<void>;
|
|
29
|
-
/**
|
|
30
|
-
* Set available colors directly (for testing or custom colors)
|
|
31
|
-
*/
|
|
32
|
-
setAvailableColors(colors: AvailableColors): void;
|
|
33
|
-
/**
|
|
34
|
-
* Set available text styles directly (for testing or custom styles)
|
|
35
|
-
*/
|
|
36
|
-
setAvailableTextStyles(textStyles: AvailableTextStyles): void;
|
|
37
|
-
/**
|
|
38
|
-
* Set collection definitions (inferred schemas for content collections)
|
|
39
|
-
*/
|
|
40
|
-
setCollectionDefinitions(definitions: Record<string, CollectionDefinition>): void;
|
|
41
|
-
/**
|
|
42
|
-
* Get collection definitions
|
|
43
|
-
*/
|
|
44
|
-
getCollectionDefinitions(): Record<string, CollectionDefinition>;
|
|
45
|
-
/**
|
|
46
|
-
* Get the manifest path for a given page
|
|
47
|
-
* Places manifest next to the page: /about -> /about.json, / -> /index.json
|
|
48
|
-
*/
|
|
49
|
-
private getPageManifestPath;
|
|
50
|
-
/**
|
|
51
|
-
* Add a page's entries to the manifest (called after each page is processed)
|
|
52
|
-
* This is non-blocking - writes are queued
|
|
53
|
-
*/
|
|
54
|
-
addPage(pagePath: string, entries: Record<string, ManifestEntry>, components: Record<string, ComponentInstance>, collection?: CollectionEntry, seo?: PageSeoData): void;
|
|
55
|
-
/**
|
|
56
|
-
* Write a single page manifest to disk
|
|
57
|
-
*/
|
|
58
|
-
private writePageManifest;
|
|
59
|
-
/**
|
|
60
|
-
* Finalize manifest writes
|
|
61
|
-
* Call this in astro:build:done to ensure all writes complete
|
|
62
|
-
*/
|
|
63
|
-
finalize(): Promise<{
|
|
64
|
-
totalEntries: number;
|
|
65
|
-
totalPages: number;
|
|
66
|
-
totalComponents: number;
|
|
67
|
-
}>;
|
|
68
|
-
/**
|
|
69
|
-
* Get the global manifest (for virtual module support)
|
|
70
|
-
*/
|
|
71
|
-
getGlobalManifest(): CmsManifest;
|
|
72
|
-
/**
|
|
73
|
-
* Get a page's manifest data (for dev mode)
|
|
74
|
-
*/
|
|
75
|
-
getPageManifest(pagePath: string): {
|
|
76
|
-
entries: Record<string, ManifestEntry>;
|
|
77
|
-
components: Record<string, ComponentInstance>;
|
|
78
|
-
collection?: CollectionEntry;
|
|
79
|
-
seo?: PageSeoData;
|
|
80
|
-
} | undefined;
|
|
81
|
-
/**
|
|
82
|
-
* Reset state (for dev mode reloads)
|
|
83
|
-
*/
|
|
84
|
-
reset(): void;
|
|
85
|
-
/**
|
|
86
|
-
* Get page data for preview generation (pages and their components)
|
|
87
|
-
*/
|
|
88
|
-
getPageDataForPreviews(): Map<string, {
|
|
89
|
-
entries: Record<string, ManifestEntry>;
|
|
90
|
-
components: Record<string, ComponentInstance>;
|
|
91
|
-
collection?: CollectionEntry;
|
|
92
|
-
seo?: PageSeoData;
|
|
93
|
-
}>;
|
|
94
|
-
/**
|
|
95
|
-
* Get component definitions
|
|
96
|
-
*/
|
|
97
|
-
getComponentDefinitions(): Record<string, ComponentDefinition>;
|
|
98
|
-
/**
|
|
99
|
-
* Get the output directory
|
|
100
|
-
*/
|
|
101
|
-
getOutDir(): string;
|
|
102
|
-
/**
|
|
103
|
-
* Get available colors (for use in dev middleware)
|
|
104
|
-
*/
|
|
105
|
-
getAvailableColors(): AvailableColors | undefined;
|
|
106
|
-
/**
|
|
107
|
-
* Get available text styles (for use in dev middleware)
|
|
108
|
-
*/
|
|
109
|
-
getAvailableTextStyles(): AvailableTextStyles | undefined;
|
|
110
|
-
}
|
|
111
|
-
//# sourceMappingURL=manifest-writer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"manifest-writer.d.ts","sourceRoot":"","sources":["../../src/manifest-writer.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACX,eAAe,EACf,mBAAmB,EACnB,WAAW,EACX,oBAAoB,EACpB,eAAe,EACf,mBAAmB,EACnB,iBAAiB,EACjB,aAAa,EAGb,WAAW,EACX,MAAM,SAAS,CAAA;AAMhB;;;GAGG;AACH,qBAAa,cAAc;IAC1B,OAAO,CAAC,cAAc,CAAa;IACnC,OAAO,CAAC,aAAa,CAKP;IACd,OAAO,CAAC,MAAM,CAAa;IAC3B,OAAO,CAAC,YAAY,CAAQ;IAC5B,OAAO,CAAC,oBAAoB,CAAqC;IACjE,OAAO,CAAC,qBAAqB,CAA2C;IACxE,OAAO,CAAC,eAAe,CAA6B;IACpD,OAAO,CAAC,mBAAmB,CAAiC;IAC5D,OAAO,CAAC,UAAU,CAAmC;gBAEzC,YAAY,EAAE,MAAM,EAAE,oBAAoB,GAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAM;IAYhG;;OAEG;IACH,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAI5B;;OAEG;IACH,uBAAuB,CAAC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,GAAG,IAAI;IAK/E;;OAEG;IACG,mBAAmB,CAAC,WAAW,GAAE,MAAyB,GAAG,OAAO,CAAC,IAAI,CAAC;IAOhF;;OAEG;IACH,kBAAkB,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI;IAKjD;;OAEG;IACH,sBAAsB,CAAC,UAAU,EAAE,mBAAmB,GAAG,IAAI;IAK7D;;OAEG;IACH,wBAAwB,CAAC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,GAAG,IAAI;IAKjF;;OAEG;IACH,wBAAwB,IAAI,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC;IAIhE;;;OAGG;IACH,OAAO,CAAC,mBAAmB;IAQ3B;;;OAGG;IACH,OAAO,CACN,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,EACtC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,EAC7C,UAAU,CAAC,EAAE,eAAe,EAC5B,GAAG,CAAC,EAAE,WAAW,GACf,IAAI;IAoCP;;OAEG;YACW,iBAAiB;IAgD/B;;;OAGG;IACG,QAAQ,IAAI,OAAO,CAAC;QAAE,YAAY,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,eAAe,EAAE,MAAM,CAAA;KAAE,CAAC;IAwEhG;;OAEG;IACH,iBAAiB,IAAI,WAAW;IAIhC;;OAEG;IACH,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG;QAClC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAA;QACtC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAA;QAC7C,UAAU,CAAC,EAAE,eAAe,CAAA;QAC5B,GAAG,CAAC,EAAE,WAAW,CAAA;KACjB,GAAG,SAAS;IAIb;;OAEG;IACH,KAAK,IAAI,IAAI;IAcb;;OAEG;IACH,sBAAsB,IAAI,GAAG,CAAC,MAAM,EAAE;QACrC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAA;QACtC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAA;QAC7C,UAAU,CAAC,EAAE,eAAe,CAAA;QAC5B,GAAG,CAAC,EAAE,WAAW,CAAA;KACjB,CAAC;IAIF;;OAEG;IACH,uBAAuB,IAAI,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC;IAI9D;;OAEG;IACH,SAAS,IAAI,MAAM;IAInB;;OAEG;IACH,kBAAkB,IAAI,eAAe,GAAG,SAAS;IAIjD;;OAEG;IACH,sBAAsB,IAAI,mBAAmB,GAAG,SAAS;CAGzD"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { MediaStorageAdapter } from './types';
|
|
2
|
-
export interface ContemberStorageOptions {
|
|
3
|
-
/** Base URL of the worker API, e.g. 'https://api.example.com' */
|
|
4
|
-
apiBaseUrl: string;
|
|
5
|
-
/** Project slug used in the API path */
|
|
6
|
-
projectSlug: string;
|
|
7
|
-
/** Session token for authentication (NUA_SITE_SESSION_TOKEN cookie value) */
|
|
8
|
-
sessionToken?: string;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Media storage adapter that proxies to the Contember worker's CMS media endpoints.
|
|
12
|
-
* Uses the existing /cms/:projectSlug/media/* API backed by R2 storage + Contember database.
|
|
13
|
-
*/
|
|
14
|
-
export declare function createContemberStorageAdapter(options: ContemberStorageOptions): MediaStorageAdapter;
|
|
15
|
-
//# sourceMappingURL=contember.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"contember.d.ts","sourceRoot":"","sources":["../../../src/media/contember.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAmB,mBAAmB,EAAqB,MAAM,SAAS,CAAA;AAEtF,MAAM,WAAW,uBAAuB;IACvC,iEAAiE;IACjE,UAAU,EAAE,MAAM,CAAA;IAClB,wCAAwC;IACxC,WAAW,EAAE,MAAM,CAAA;IACnB,6EAA6E;IAC7E,YAAY,CAAC,EAAE,MAAM,CAAA;CACrB;AAED;;;GAGG;AACH,wBAAgB,6BAA6B,CAAC,OAAO,EAAE,uBAAuB,GAAG,mBAAmB,CAoEnG"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { MediaStorageAdapter } from './types';
|
|
2
|
-
export interface LocalStorageOptions {
|
|
3
|
-
/** Directory to store media files (relative to project root or absolute). Default: 'public/uploads' */
|
|
4
|
-
dir?: string;
|
|
5
|
-
/** URL prefix for serving files. Default: '/uploads' */
|
|
6
|
-
urlPrefix?: string;
|
|
7
|
-
}
|
|
8
|
-
export declare function createLocalStorageAdapter(options?: LocalStorageOptions): MediaStorageAdapter;
|
|
9
|
-
//# sourceMappingURL=local.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"local.d.ts","sourceRoot":"","sources":["../../../src/media/local.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAmB,mBAAmB,EAAqB,MAAM,SAAS,CAAA;AAEtF,MAAM,WAAW,mBAAmB;IACnC,uGAAuG;IACvG,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,wBAAgB,yBAAyB,CAAC,OAAO,GAAE,mBAAwB,GAAG,mBAAmB,CA6EhG"}
|
package/dist/src/media/s3.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { MediaStorageAdapter } from './types';
|
|
2
|
-
export interface S3StorageOptions {
|
|
3
|
-
bucket: string;
|
|
4
|
-
region: string;
|
|
5
|
-
accessKeyId?: string;
|
|
6
|
-
secretAccessKey?: string;
|
|
7
|
-
endpoint?: string;
|
|
8
|
-
cdnPrefix?: string;
|
|
9
|
-
prefix?: string;
|
|
10
|
-
}
|
|
11
|
-
export declare function createS3StorageAdapter(options: S3StorageOptions): MediaStorageAdapter;
|
|
12
|
-
//# sourceMappingURL=s3.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"s3.d.ts","sourceRoot":"","sources":["../../../src/media/s3.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAmB,mBAAmB,EAAqB,MAAM,SAAS,CAAA;AAEtF,MAAM,WAAW,gBAAgB;IAChC,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,MAAM,CAAC,EAAE,MAAM,CAAA;CACf;AAQD,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,gBAAgB,GAAG,mBAAmB,CA2GrF"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
export interface MediaItem {
|
|
2
|
-
id: string;
|
|
3
|
-
url: string;
|
|
4
|
-
filename: string;
|
|
5
|
-
annotation?: string;
|
|
6
|
-
contentType: string;
|
|
7
|
-
width?: number;
|
|
8
|
-
height?: number;
|
|
9
|
-
uploadedAt?: string;
|
|
10
|
-
}
|
|
11
|
-
export interface MediaListResult {
|
|
12
|
-
items: MediaItem[];
|
|
13
|
-
hasMore: boolean;
|
|
14
|
-
cursor?: string;
|
|
15
|
-
}
|
|
16
|
-
export interface MediaUploadResult {
|
|
17
|
-
success: boolean;
|
|
18
|
-
url?: string;
|
|
19
|
-
filename?: string;
|
|
20
|
-
annotation?: string;
|
|
21
|
-
id?: string;
|
|
22
|
-
error?: string;
|
|
23
|
-
}
|
|
24
|
-
export interface MediaStorageAdapter {
|
|
25
|
-
list(options?: {
|
|
26
|
-
limit?: number;
|
|
27
|
-
cursor?: string;
|
|
28
|
-
}): Promise<MediaListResult>;
|
|
29
|
-
upload(file: Buffer, filename: string, contentType: string): Promise<MediaUploadResult>;
|
|
30
|
-
delete(id: string): Promise<{
|
|
31
|
-
success: boolean;
|
|
32
|
-
error?: string;
|
|
33
|
-
}>;
|
|
34
|
-
/** Local filesystem info for direct file serving in dev (bypasses Vite's public dir cache) */
|
|
35
|
-
staticFiles?: {
|
|
36
|
-
urlPrefix: string;
|
|
37
|
-
dir: string;
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/media/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IACzB,EAAE,EAAE,MAAM,CAAA;IACV,GAAG,EAAE,MAAM,CAAA;IACX,QAAQ,EAAE,MAAM,CAAA;IAChB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,MAAM,CAAA;IACnB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,UAAU,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,eAAe;IAC/B,KAAK,EAAE,SAAS,EAAE,CAAA;IAClB,OAAO,EAAE,OAAO,CAAA;IAChB,MAAM,CAAC,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,iBAAiB;IACjC,OAAO,EAAE,OAAO,CAAA;IAChB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,mBAAmB;IACnC,IAAI,CAAC,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,eAAe,CAAC,CAAA;IAC7E,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAA;IACvF,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IACjE,8FAA8F;IAC9F,WAAW,CAAC,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAA;CAChD"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { ComponentDefinition, ComponentInstance, ManifestEntry } from './types';
|
|
2
|
-
import type { CollectionEntry, PageSeoData } from './types';
|
|
3
|
-
type PageData = {
|
|
4
|
-
entries: Record<string, ManifestEntry>;
|
|
5
|
-
components: Record<string, ComponentInstance>;
|
|
6
|
-
collection?: CollectionEntry;
|
|
7
|
-
seo?: PageSeoData;
|
|
8
|
-
};
|
|
9
|
-
/**
|
|
10
|
-
* Generate standalone preview HTML files for each component that has
|
|
11
|
-
* at least one instance on a built page.
|
|
12
|
-
*
|
|
13
|
-
* Reads the built HTML, extracts the component DOM fragment, annotates
|
|
14
|
-
* text props for live preview updates, and writes a self-contained HTML
|
|
15
|
-
* page to `outDir/_cms-preview/<ComponentName>/index.html`.
|
|
16
|
-
*/
|
|
17
|
-
export declare function generateComponentPreviews(outDir: string, pageManifests: Map<string, PageData>, componentDefinitions: Record<string, ComponentDefinition>): Promise<void>;
|
|
18
|
-
export {};
|
|
19
|
-
//# sourceMappingURL=preview-generator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"preview-generator.d.ts","sourceRoot":"","sources":["../../src/preview-generator.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AACpF,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE3D,KAAK,QAAQ,GAAG;IACf,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAA;IACtC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAA;IAC7C,UAAU,CAAC,EAAE,eAAe,CAAA;IAC5B,GAAG,CAAC,EAAE,WAAW,CAAA;CACjB,CAAA;AA4LD;;;;;;;GAOG;AACH,wBAAsB,yBAAyB,CAC9C,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,EACpC,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,GACvD,OAAO,CAAC,IAAI,CAAC,CAiFf"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { PageSeoData } from './types';
|
|
2
|
-
export interface ProcessSeoOptions {
|
|
3
|
-
/** Whether to mark the page title with a CMS ID (default: true) */
|
|
4
|
-
markTitle?: boolean;
|
|
5
|
-
/** Whether to parse JSON-LD structured data (default: true) */
|
|
6
|
-
parseJsonLd?: boolean;
|
|
7
|
-
/** Path to source file for source tracking (fallback) */
|
|
8
|
-
sourcePath?: string;
|
|
9
|
-
}
|
|
10
|
-
export interface ProcessSeoResult {
|
|
11
|
-
/** Extracted SEO data */
|
|
12
|
-
seo: PageSeoData;
|
|
13
|
-
/** The modified HTML with title CMS ID if markTitle is enabled */
|
|
14
|
-
html: string;
|
|
15
|
-
/** The CMS ID assigned to the title element */
|
|
16
|
-
titleId?: string;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Process HTML to extract SEO metadata from the <head> section.
|
|
20
|
-
* Returns structured SEO data with source tracking information.
|
|
21
|
-
*/
|
|
22
|
-
export declare function processSeoFromHtml(html: string, options?: ProcessSeoOptions, getNextId?: () => string): Promise<ProcessSeoResult>;
|
|
23
|
-
//# sourceMappingURL=seo-processor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"seo-processor.d.ts","sourceRoot":"","sources":["../../src/seo-processor.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAA4C,WAAW,EAAkE,MAAM,SAAS,CAAA;AAKpJ,MAAM,WAAW,iBAAiB;IACjC,mEAAmE;IACnE,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,+DAA+D;IAC/D,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,yDAAyD;IACzD,UAAU,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,gBAAgB;IAChC,yBAAyB;IACzB,GAAG,EAAE,WAAW,CAAA;IAChB,kEAAkE;IAClE,IAAI,EAAE,MAAM,CAAA;IACZ,+CAA+C;IAC/C,OAAO,CAAC,EAAE,MAAM,CAAA;CAChB;AAED;;;GAGG;AACH,wBAAsB,kBAAkB,CACvC,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,iBAAsB,EAC/B,SAAS,CAAC,EAAE,MAAM,MAAM,GACtB,OAAO,CAAC,gBAAgB,CAAC,CAwD3B"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import type { BabelNode, LineTransformer, VariableDefinition } from './types';
|
|
2
|
-
/**
|
|
3
|
-
* Extract string value from a Babel node (StringLiteral or simple TemplateLiteral)
|
|
4
|
-
*/
|
|
5
|
-
export declare function getStringValue(node: BabelNode): string | null;
|
|
6
|
-
/**
|
|
7
|
-
* Recursively extract properties from an object expression
|
|
8
|
-
* @param objNode - The ObjectExpression node
|
|
9
|
-
* @param parentPath - The full path to this object (e.g., 'config' or 'config.nav')
|
|
10
|
-
* @param definitions - Array to collect definitions into
|
|
11
|
-
* @param lineTransformer - Transforms Babel line numbers to file line numbers
|
|
12
|
-
*/
|
|
13
|
-
export declare function extractObjectProperties(objNode: BabelNode, parentPath: string, definitions: VariableDefinition[], lineTransformer: LineTransformer): void;
|
|
14
|
-
/**
|
|
15
|
-
* Extract elements from an array expression
|
|
16
|
-
* @param arrNode - The ArrayExpression node
|
|
17
|
-
* @param parentPath - The full path to this array (e.g., 'items' or 'config.items')
|
|
18
|
-
* @param definitions - Array to collect definitions into
|
|
19
|
-
* @param lineTransformer - Transforms Babel line numbers to file line numbers
|
|
20
|
-
* @param defaultLine - Fallback line if element has no location
|
|
21
|
-
*/
|
|
22
|
-
export declare function extractArrayElements(arrNode: BabelNode, parentPath: string, definitions: VariableDefinition[], lineTransformer: LineTransformer, defaultLine: number): void;
|
|
23
|
-
/**
|
|
24
|
-
* Build the full path for a variable definition.
|
|
25
|
-
* For array indices (numeric names), uses bracket notation: items[0]
|
|
26
|
-
* For object properties, uses dot notation: config.nav.title
|
|
27
|
-
*/
|
|
28
|
-
export declare function buildDefinitionPath(def: VariableDefinition): string;
|
|
29
|
-
/**
|
|
30
|
-
* Parse an expression path and extract the full path for variable lookup.
|
|
31
|
-
* Handles patterns like: varName, obj.prop, items[0], config.nav.title, links[0].text
|
|
32
|
-
* @returns The full expression path or null if not a simple variable reference
|
|
33
|
-
*/
|
|
34
|
-
export declare function parseExpressionPath(exprText: string): string | null;
|
|
35
|
-
//# sourceMappingURL=ast-extractors.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ast-extractors.d.ts","sourceRoot":"","sources":["../../../src/source-finder/ast-extractors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAM7E;;GAEG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,GAAG,IAAI,CAY7D;AAgBD;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACtC,OAAO,EAAE,SAAS,EAClB,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,kBAAkB,EAAE,EACjC,eAAe,EAAE,eAAe,GAC9B,IAAI,CAiCN;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CACnC,OAAO,EAAE,SAAS,EAClB,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,kBAAkB,EAAE,EACjC,eAAe,EAAE,eAAe,EAChC,WAAW,EAAE,MAAM,GACjB,IAAI,CAmDN;AAMD;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,kBAAkB,GAAG,MAAM,CASnE;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAQnE"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { BabelFile, CachedParsedFile, ParsedAstroFile } from './types';
|
|
2
|
-
/**
|
|
3
|
-
* Parse an Astro file and return both template AST and frontmatter content
|
|
4
|
-
*/
|
|
5
|
-
export declare function parseAstroFile(content: string): Promise<ParsedAstroFile>;
|
|
6
|
-
/**
|
|
7
|
-
* Parse frontmatter JavaScript/TypeScript with Babel
|
|
8
|
-
* @param content - The frontmatter content to parse
|
|
9
|
-
* @param filePath - Optional file path for error reporting
|
|
10
|
-
*/
|
|
11
|
-
export declare function parseFrontmatter(content: string, filePath?: string): BabelFile | null;
|
|
12
|
-
/**
|
|
13
|
-
* Get a cached parsed file, parsing it if not cached.
|
|
14
|
-
* Concurrent requests for the same file are deduplicated to avoid
|
|
15
|
-
* redundant parsing and potential race conditions.
|
|
16
|
-
*/
|
|
17
|
-
export declare function getCachedParsedFile(filePath: string): Promise<CachedParsedFile | null>;
|
|
18
|
-
//# sourceMappingURL=ast-parser.d.ts.map
|