@otl-core/cms-types 1.0.0 → 1.0.4
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/index.cjs +46 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1800 -0
- package/dist/index.d.ts +1800 -0
- package/dist/index.js +40 -0
- package/dist/index.js.map +1 -0
- package/package.json +1 -1
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// src/schema.types.ts
|
|
4
|
+
var RESERVED_SECTION_TYPES = [
|
|
5
|
+
"hero-banner",
|
|
6
|
+
"content-blocks",
|
|
7
|
+
"feature-grid",
|
|
8
|
+
"testimonial-carousel",
|
|
9
|
+
"cta-banner",
|
|
10
|
+
"team-grid",
|
|
11
|
+
"faq-accordion",
|
|
12
|
+
"stats-showcase",
|
|
13
|
+
"logo-cloud"
|
|
14
|
+
];
|
|
15
|
+
var RESERVED_BLOCK_TYPES = [
|
|
16
|
+
"markdown",
|
|
17
|
+
"html",
|
|
18
|
+
"image",
|
|
19
|
+
"quote",
|
|
20
|
+
"gallery",
|
|
21
|
+
"embed",
|
|
22
|
+
"cta",
|
|
23
|
+
"divider",
|
|
24
|
+
"code",
|
|
25
|
+
"about-the-authors",
|
|
26
|
+
"more-from-the-authors",
|
|
27
|
+
"recommended-posts",
|
|
28
|
+
"related-posts"
|
|
29
|
+
];
|
|
30
|
+
function isReservedSchemaType(type) {
|
|
31
|
+
return RESERVED_SECTION_TYPES.includes(type) || RESERVED_BLOCK_TYPES.includes(type);
|
|
32
|
+
}
|
|
33
|
+
function isReservedSectionType(type) {
|
|
34
|
+
return RESERVED_SECTION_TYPES.includes(type);
|
|
35
|
+
}
|
|
36
|
+
function isReservedBlockType(type) {
|
|
37
|
+
return RESERVED_BLOCK_TYPES.includes(type);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
exports.RESERVED_BLOCK_TYPES = RESERVED_BLOCK_TYPES;
|
|
41
|
+
exports.RESERVED_SECTION_TYPES = RESERVED_SECTION_TYPES;
|
|
42
|
+
exports.isReservedBlockType = isReservedBlockType;
|
|
43
|
+
exports.isReservedSchemaType = isReservedSchemaType;
|
|
44
|
+
exports.isReservedSectionType = isReservedSectionType;
|
|
45
|
+
//# sourceMappingURL=index.cjs.map
|
|
46
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/schema.types.ts"],"names":[],"mappings":";;;AAgCO,IAAM,sBAAA,GAAyB;AAAA,EACpC,aAAA;AAAA,EACA,gBAAA;AAAA,EACA,cAAA;AAAA,EACA,sBAAA;AAAA,EACA,YAAA;AAAA,EACA,WAAA;AAAA,EACA,eAAA;AAAA,EACA,gBAAA;AAAA,EACA;AACF;AAEO,IAAM,oBAAA,GAAuB;AAAA,EAClC,UAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA;AAAA,EACA,OAAA;AAAA,EACA,SAAA;AAAA,EACA,OAAA;AAAA,EACA,KAAA;AAAA,EACA,SAAA;AAAA,EACA,MAAA;AAAA,EACA,mBAAA;AAAA,EACA,uBAAA;AAAA,EACA,mBAAA;AAAA,EACA;AACF;AAMO,SAAS,qBAAqB,IAAA,EAA0C;AAC7E,EAAA,OACG,uBAA6C,QAAA,CAAS,IAAI,CAAA,IAC1D,oBAAA,CAA2C,SAAS,IAAI,CAAA;AAE7D;AAEO,SAAS,sBACd,IAAA,EAC6B;AAC7B,EAAA,OAAQ,sBAAA,CAA6C,SAAS,IAAI,CAAA;AACpE;AAEO,SAAS,oBAAoB,IAAA,EAAyC;AAC3E,EAAA,OAAQ,oBAAA,CAA2C,SAAS,IAAI,CAAA;AAClE","file":"index.cjs","sourcesContent":["// ============================================================================\n// UNIFIED SCHEMA SYSTEM - Public types for engine rendering\n// ============================================================================\n\n/**\n * Block target - what pages/contexts can a block be added to\n */\nexport type BlockTarget =\n | \"blog.post\"\n | \"blog.index\"\n | \"blog.category\"\n | \"blog.author\"\n | \"blog.tag\"\n | \"blog.search\"\n | \"page\"\n | \"form\"\n | \"footer\"\n | \"*\";\n\n/**\n * Schema instance in a page (section) or blog post (block)\n */\nexport interface SchemaInstance {\n id: string;\n type: string;\n config: Record<string, unknown>;\n}\n\n// ============================================================================\n// RESERVED/BUILT-IN SCHEMA TYPES\n// ============================================================================\n\nexport const RESERVED_SECTION_TYPES = [\n \"hero-banner\",\n \"content-blocks\",\n \"feature-grid\",\n \"testimonial-carousel\",\n \"cta-banner\",\n \"team-grid\",\n \"faq-accordion\",\n \"stats-showcase\",\n \"logo-cloud\",\n] as const;\n\nexport const RESERVED_BLOCK_TYPES = [\n \"markdown\",\n \"html\",\n \"image\",\n \"quote\",\n \"gallery\",\n \"embed\",\n \"cta\",\n \"divider\",\n \"code\",\n \"about-the-authors\",\n \"more-from-the-authors\",\n \"recommended-posts\",\n \"related-posts\",\n] as const;\n\nexport type ReservedSectionType = (typeof RESERVED_SECTION_TYPES)[number];\nexport type ReservedBlockType = (typeof RESERVED_BLOCK_TYPES)[number];\nexport type ReservedSchemaType = ReservedSectionType | ReservedBlockType;\n\nexport function isReservedSchemaType(type: string): type is ReservedSchemaType {\n return (\n (RESERVED_SECTION_TYPES as readonly string[]).includes(type) ||\n (RESERVED_BLOCK_TYPES as readonly string[]).includes(type)\n );\n}\n\nexport function isReservedSectionType(\n type: string\n): type is ReservedSectionType {\n return (RESERVED_SECTION_TYPES as readonly string[]).includes(type);\n}\n\nexport function isReservedBlockType(type: string): type is ReservedBlockType {\n return (RESERVED_BLOCK_TYPES as readonly string[]).includes(type);\n}\n"]}
|