@conloca/astro-cms 0.1.14 → 0.1.15
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/collections.d.mts +3 -2
- package/dist/collections.d.mts.map +1 -1
- package/dist/collections.mjs +15 -6
- package/dist/collections.mjs.map +1 -1
- package/dist/components.d.mts +4 -24
- package/dist/components.d.mts.map +1 -1
- package/dist/components.mjs +98 -40
- package/dist/components.mjs.map +1 -1
- package/dist/hydration-scanner-B0NjYkZ_.mjs +109 -0
- package/dist/hydration-scanner-B0NjYkZ_.mjs.map +1 -0
- package/dist/hydration.d.mts +2 -2
- package/dist/hydration.mjs +1 -1
- package/dist/index.d.mts +9 -54
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +17 -796
- package/dist/index.mjs.map +1 -1
- package/dist/internal/acorn-default.mjs +29 -0
- package/dist/internal/cms-handler.d.mts.map +1 -0
- package/dist/{cms-handler.mjs → internal/cms-handler.mjs} +3 -1
- package/dist/internal/cms-handler.mjs.map +1 -0
- package/dist/internal/page-handler.astro +541 -0
- package/dist/lib/hydration-script.d.mts +1 -1
- package/dist/{loader-W3i9kf3p.mjs → loader-By-AQWHc.mjs} +10 -3
- package/dist/loader-By-AQWHc.mjs.map +1 -0
- package/dist/node/content.d.mts +19 -0
- package/dist/node/content.d.mts.map +1 -0
- package/dist/node/content.mjs +4 -0
- package/dist/node/index.d.mts +52 -0
- package/dist/node/index.d.mts.map +1 -0
- package/dist/node/index.mjs +753 -0
- package/dist/node/index.mjs.map +1 -0
- package/dist/{serialize-props-DqfDQeFl.mjs → serialize-props-Dhv_MnkY.mjs} +3 -3
- package/dist/{serialize-props-DqfDQeFl.mjs.map → serialize-props-Dhv_MnkY.mjs.map} +1 -1
- package/dist/{types-Bsd_qENn.d.mts → types-CVQNmPxF.d.mts} +1 -1
- package/dist/{types-Bsd_qENn.d.mts.map → types-CVQNmPxF.d.mts.map} +1 -1
- package/dist/{withHydration-692fMySA.mjs → withHydration-EzyzBQ-Y.mjs} +5 -1
- package/dist/withHydration-EzyzBQ-Y.mjs.map +1 -0
- package/dist/{withHydration-BGgQDE-H.d.mts → withHydration-HIvO9ysY.d.mts} +5 -1
- package/dist/withHydration-HIvO9ysY.d.mts.map +1 -0
- package/package.json +35 -25
- package/dist/cms-handler.d.mts.map +0 -1
- package/dist/cms-handler.mjs.map +0 -1
- package/dist/handlers/page-handler.astro +0 -299
- package/dist/loader-W3i9kf3p.mjs.map +0 -1
- package/dist/withHydration-692fMySA.mjs.map +0 -1
- package/dist/withHydration-BGgQDE-H.d.mts.map +0 -1
- /package/dist/{cms-handler.d.mts → internal/cms-handler.d.mts} +0 -0
package/dist/index.d.mts
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as WithHydrationStrategy, r as withHydration, t as HydrationMeta } from "./withHydration-
|
|
1
|
+
import { r as TemplateConfig, t as HydrationStrategy } from "./types-CVQNmPxF.mjs";
|
|
2
|
+
import { n as WithHydrationStrategy, r as withHydration, t as HydrationMeta } from "./withHydration-HIvO9ysY.mjs";
|
|
3
3
|
import { ComponentRegistry } from "./lib/hydration-script.mjs";
|
|
4
4
|
import { BlockMeta, PageMeta, blockMetaSchema, pageMetaSchema } from "@conloca/content-api/schemas";
|
|
5
5
|
import { Config, Data } from "@puckeditor/core";
|
|
6
|
-
import { AstroIntegration } from "astro";
|
|
7
|
-
import { Loader } from "astro/loaders";
|
|
8
|
-
import { UIConfig } from "@conloca/cms-spa";
|
|
9
6
|
|
|
10
7
|
//#region src/lib/hydration-scanner.d.ts
|
|
11
8
|
/**
|
|
@@ -91,6 +88,12 @@ declare function findHydratableComponents(data: Data, config: Config): Hydratabl
|
|
|
91
88
|
declare function hasHydratableComponents(data: Data, config: Config): boolean;
|
|
92
89
|
//#endregion
|
|
93
90
|
//#region src/lib/route-utils.d.ts
|
|
91
|
+
declare function toDate(value: string | Date | null | undefined): Date | undefined;
|
|
92
|
+
interface PublishSchedule {
|
|
93
|
+
publishAt?: string | Date | null;
|
|
94
|
+
unpublishAt?: string | Date | null;
|
|
95
|
+
}
|
|
96
|
+
declare function isPublished(data: PublishSchedule): boolean;
|
|
94
97
|
/**
|
|
95
98
|
* Extract slug from pathname given a route pattern.
|
|
96
99
|
*
|
|
@@ -132,53 +135,5 @@ declare function pathnameFromSlug(slug: string | undefined, pattern: string): st
|
|
|
132
135
|
*/
|
|
133
136
|
declare function serializeProps(props: Record<string, unknown>): string;
|
|
134
137
|
//#endregion
|
|
135
|
-
|
|
136
|
-
interface ConlocaLoaderOptions {
|
|
137
|
-
collection: string;
|
|
138
|
-
contentRoot: string;
|
|
139
|
-
site?: string;
|
|
140
|
-
/** Collection kind. If not provided, defaults to 'block' for 'blocks' collection, 'page' otherwise. */
|
|
141
|
-
kind?: 'page' | 'block' | 'data';
|
|
142
|
-
}
|
|
143
|
-
/**
|
|
144
|
-
* Custom Astro content loader for Conloca CMS.
|
|
145
|
-
* Loads content from the Conloca content directory into Astro collections.
|
|
146
|
-
*/
|
|
147
|
-
declare function conlocaLoader(options: ConlocaLoaderOptions): Loader;
|
|
148
|
-
//#endregion
|
|
149
|
-
//#region src/plugin-spa.d.ts
|
|
150
|
-
interface ConlocaCMSOptions extends Omit<UIConfig, 'basename'> {
|
|
151
|
-
contentRoot: string;
|
|
152
|
-
canvasDir?: string;
|
|
153
|
-
route?: string;
|
|
154
|
-
puckConfigPath: string;
|
|
155
|
-
schemasPath?: string;
|
|
156
|
-
/**
|
|
157
|
-
* Default layout for content pages.
|
|
158
|
-
* When provided without routing config, enables routing with catch-all pattern.
|
|
159
|
-
* For multi-route setups, use routing.routes.{name}.layout instead.
|
|
160
|
-
*
|
|
161
|
-
* @example './src/layouts/Layout.astro'
|
|
162
|
-
*/
|
|
163
|
-
layout?: string;
|
|
164
|
-
routing?: RoutingConfigInput;
|
|
165
|
-
templates?: Record<string, TemplateConfig>;
|
|
166
|
-
/**
|
|
167
|
-
* Paths to scan for hydratable components.
|
|
168
|
-
* Components using withHydration() in these directories are auto-discovered.
|
|
169
|
-
*
|
|
170
|
-
* @example ['src/components/puck']
|
|
171
|
-
*/
|
|
172
|
-
componentPaths?: string[];
|
|
173
|
-
/**
|
|
174
|
-
* Path to the assets directory for image uploads.
|
|
175
|
-
* When provided, enables the Media Library and asset upload API routes.
|
|
176
|
-
*
|
|
177
|
-
* @example 'src/assets/uploads'
|
|
178
|
-
*/
|
|
179
|
-
assetsPath?: string;
|
|
180
|
-
}
|
|
181
|
-
declare function conlocaCMS(options: ConlocaCMSOptions): AstroIntegration;
|
|
182
|
-
//#endregion
|
|
183
|
-
export { type BlockMeta, type ComponentRegistry, type ConlocaCMSOptions, type ConlocaLoaderOptions, type HydratableComponent, type HydratableComponentConfig, type HydrationDiscovery, type HydrationMeta, type HydrationStrategy, type PageMeta, type TemplateConfig, type WithHydrationStrategy, blockMetaSchema, conlocaCMS, conlocaLoader, extractSlugFromPathname, findHydratableComponents, hasHydratableComponents, isHydratable, pageMetaSchema, pathnameFromSlug, scanForHydratableComponents, serializeProps, withHydration };
|
|
138
|
+
export { type BlockMeta, type ComponentRegistry, type HydratableComponent, type HydratableComponentConfig, type HydrationDiscovery, type HydrationMeta, type HydrationStrategy, type PageMeta, type TemplateConfig, type WithHydrationStrategy, blockMetaSchema, extractSlugFromPathname, findHydratableComponents, hasHydratableComponents, isHydratable, isPublished, pageMetaSchema, pathnameFromSlug, scanForHydratableComponents, serializeProps, toDate, withHydration };
|
|
184
139
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/lib/hydration-scanner.ts","../src/lib/hydration-utils.ts","../src/lib/route-utils.ts","../src/lib/serialize-props.ts"
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/lib/hydration-scanner.ts","../src/lib/hydration-utils.ts","../src/lib/route-utils.ts","../src/lib/serialize-props.ts"],"mappings":";;;;;;;;;;UAOiB,kBAAA;;EAEf,aAAA;;EAEA,QAAA;EAJiC;EAMjC,QAAA;AAAA;;;;ACLF;;;;;;;;;;AAUA;;;;;;iBD6EsB,2BAAA,CACpB,cAAA,YACA,WAAA,WACC,OAAA,CAAQ,kBAAA;;;;;;;UC1FM,yBAAA;EDDA;ECGf,SAAA,GAAY,iBAAA;EACZ,MAAA,IAAU,KAAA;AAAA;;;;;UAOK,mBAAA;ED6EK;EC3EpB,IAAA;;EAEA,KAAA,EAAO,MAAA;ED0EP;ECxEA,QAAA,EAAU,OAAA,CAAQ,iBAAA;ED0EjB;ECxED,EAAA;AAAA;;;;;AAlBF;;;;;;iBA+BgB,YAAA,CAAa,aAAA,UAAuB,MAAA,EAAQ,MAAA,GAAS,iBAAA;;;;AArBrE;;;;;iBA2CgB,wBAAA,CAAyB,IAAA,EAAM,IAAA,EAAM,MAAA,EAAQ,MAAA,GAAS,mBAAA;;;;;iBA0CtD,uBAAA,CAAwB,IAAA,EAAM,IAAA,EAAM,MAAA,EAAQ,MAAA;;;iBCvG5C,MAAA,CAAO,KAAA,WAAgB,IAAA,sBAAuB,IAAA;AAAA,UAcpD,eAAA;EACR,SAAA,YAAqB,IAAA;EACrB,WAAA,YAAuB,IAAA;AAAA;AAAA,iBAGT,WAAA,CAAY,IAAA,EAAM,eAAA;;AFZlC;;;;;;;;;AAwFA;;;;;;iBE5CgB,uBAAA,CAAwB,QAAA,UAAkB,OAAA;;;;;;;AD3C1D;;;;;;;;;iBC6EgB,gBAAA,CAAiB,IAAA,sBAA0B,OAAA;;;;;;;iBCjF3C,cAAA,CAAe,KAAA,EAAO,MAAA"}
|