okno 1.0.0-beta4

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 (96) hide show
  1. package/README.md +138 -0
  2. package/dist/adapters/astro.d.ts +3 -0
  3. package/dist/adapters/astro.d.ts.map +1 -0
  4. package/dist/adapters/astro.js +32 -0
  5. package/dist/adapters/index.d.ts +3 -0
  6. package/dist/adapters/index.d.ts.map +1 -0
  7. package/dist/adapters/vite.d.ts +4 -0
  8. package/dist/adapters/vite.d.ts.map +1 -0
  9. package/dist/adapters/vite.js +21 -0
  10. package/dist/client-CeppRtrT.js +55 -0
  11. package/dist/core/__tests__/builders.test.d.ts +2 -0
  12. package/dist/core/__tests__/builders.test.d.ts.map +1 -0
  13. package/dist/core/__tests__/fields.test.d.ts +2 -0
  14. package/dist/core/__tests__/fields.test.d.ts.map +1 -0
  15. package/dist/core/__tests__/runtime.test.d.ts +2 -0
  16. package/dist/core/__tests__/runtime.test.d.ts.map +1 -0
  17. package/dist/core/builders/collection.d.ts +9 -0
  18. package/dist/core/builders/collection.d.ts.map +1 -0
  19. package/dist/core/builders/component.d.ts +26 -0
  20. package/dist/core/builders/component.d.ts.map +1 -0
  21. package/dist/core/builders/global.d.ts +8 -0
  22. package/dist/core/builders/global.d.ts.map +1 -0
  23. package/dist/core/builders/group.d.ts +18 -0
  24. package/dist/core/builders/group.d.ts.map +1 -0
  25. package/dist/core/builders/index.d.ts +8 -0
  26. package/dist/core/builders/index.d.ts.map +1 -0
  27. package/dist/core/builders/page.d.ts +9 -0
  28. package/dist/core/builders/page.d.ts.map +1 -0
  29. package/dist/core/builders/utils.d.ts +8 -0
  30. package/dist/core/builders/utils.d.ts.map +1 -0
  31. package/dist/core/components/index.d.ts +3 -0
  32. package/dist/core/components/index.d.ts.map +1 -0
  33. package/dist/core/components/link.d.ts +12 -0
  34. package/dist/core/components/link.d.ts.map +1 -0
  35. package/dist/core/components/meta.d.ts +12 -0
  36. package/dist/core/components/meta.d.ts.map +1 -0
  37. package/dist/core/field-result.d.ts +26 -0
  38. package/dist/core/field-result.d.ts.map +1 -0
  39. package/dist/core/fields/boolean.d.ts +12 -0
  40. package/dist/core/fields/boolean.d.ts.map +1 -0
  41. package/dist/core/fields/date.d.ts +14 -0
  42. package/dist/core/fields/date.d.ts.map +1 -0
  43. package/dist/core/fields/enum.d.ts +14 -0
  44. package/dist/core/fields/enum.d.ts.map +1 -0
  45. package/dist/core/fields/index.d.ts +12 -0
  46. package/dist/core/fields/index.d.ts.map +1 -0
  47. package/dist/core/fields/media.d.ts +33 -0
  48. package/dist/core/fields/media.d.ts.map +1 -0
  49. package/dist/core/fields/number.d.ts +16 -0
  50. package/dist/core/fields/number.d.ts.map +1 -0
  51. package/dist/core/fields/reference.d.ts +12 -0
  52. package/dist/core/fields/reference.d.ts.map +1 -0
  53. package/dist/core/fields/richtext.d.ts +13 -0
  54. package/dist/core/fields/richtext.d.ts.map +1 -0
  55. package/dist/core/fields/slug.d.ts +10 -0
  56. package/dist/core/fields/slug.d.ts.map +1 -0
  57. package/dist/core/fields/string.d.ts +21 -0
  58. package/dist/core/fields/string.d.ts.map +1 -0
  59. package/dist/core/fields/types.d.ts +101 -0
  60. package/dist/core/fields/types.d.ts.map +1 -0
  61. package/dist/core/fields/user.d.ts +13 -0
  62. package/dist/core/fields/user.d.ts.map +1 -0
  63. package/dist/core/index.d.ts +6 -0
  64. package/dist/core/index.d.ts.map +1 -0
  65. package/dist/core/index.js +23 -0
  66. package/dist/core/okno.d.ts +21 -0
  67. package/dist/core/okno.d.ts.map +1 -0
  68. package/dist/core/runtime.d.ts +9 -0
  69. package/dist/core/runtime.d.ts.map +1 -0
  70. package/dist/core/schema.d.ts +2 -0
  71. package/dist/core/schema.d.ts.map +1 -0
  72. package/dist/editor/index.js +1753 -0
  73. package/dist/index.d.ts +8 -0
  74. package/dist/index.d.ts.map +1 -0
  75. package/dist/index.js +27 -0
  76. package/dist/meta-D-_nuC5Y.js +548 -0
  77. package/dist/server/client.d.ts +29 -0
  78. package/dist/server/client.d.ts.map +1 -0
  79. package/dist/server/index.d.ts +3 -0
  80. package/dist/server/index.d.ts.map +1 -0
  81. package/dist/server/index.js +6 -0
  82. package/dist/server/types.d.ts +48 -0
  83. package/dist/server/types.d.ts.map +1 -0
  84. package/dist/types/global.d.ts +54 -0
  85. package/dist/types/global.d.ts.map +1 -0
  86. package/dist/types/index.d.ts +4 -0
  87. package/dist/types/index.d.ts.map +1 -0
  88. package/dist/types/path.d.ts +35 -0
  89. package/dist/types/path.d.ts.map +1 -0
  90. package/dist/types/query.d.ts +31 -0
  91. package/dist/types/query.d.ts.map +1 -0
  92. package/dist/vite.config.d.ts +3 -0
  93. package/dist/vite.config.d.ts.map +1 -0
  94. package/dist/vite.dev.config.d.ts +3 -0
  95. package/dist/vite.dev.config.d.ts.map +1 -0
  96. package/package.json +71 -0
package/README.md ADDED
@@ -0,0 +1,138 @@
1
+ # OknoCMS
2
+
3
+ A developer-friendly headless CMS with live editing capabilities for static and dynamic sites.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ bun add okno
9
+ ```
10
+
11
+ ## Quick Start
12
+
13
+ ### 1. Define your schema
14
+
15
+ ```typescript
16
+ // /okno/schema.ts
17
+ import { collection, page, string, richtext, media, enum, slug } from "okno"
18
+
19
+ export const schema = {
20
+ articles: collection({
21
+ title: string(),
22
+ slug: slug("title"),
23
+ content: richtext(),
24
+ excerpt: string().max(200).optional(),
25
+ category: enum(['news', 'tutorial', 'guide']),
26
+ featuredMedia: media()
27
+ .image({ maxWidth: 1920, maxHeight: 1080 })
28
+ .video({ maxSize: '100MB', maxDuration: 120 }),
29
+ author: string()
30
+ }).draftable(),
31
+
32
+ pages: {
33
+ home: page({
34
+ heroTitle: string(),
35
+ heroMedia: media().image().video()
36
+ })
37
+ }
38
+ }
39
+ ```
40
+
41
+ ### 2. Define initial content
42
+
43
+ ```typescript
44
+ // /okno/content.ts
45
+ import { schema } from "./schema";
46
+
47
+ export const content = {
48
+ articles: [
49
+ {
50
+ title: "Getting Started",
51
+ content: "<p>Welcome to Conte!</p>",
52
+ excerpt: "Quick introduction...",
53
+ author: "John Doe",
54
+ featuredMedia: {
55
+ src: "/hero.jpg",
56
+ alt: "Hero image",
57
+ width: 1920,
58
+ height: 1080,
59
+ type: "image",
60
+ },
61
+ category: "tutorial",
62
+ },
63
+ ],
64
+ pages: {
65
+ home: {
66
+ heroTitle: "Welcome to okno",
67
+ heroMedia: {
68
+ src: "/intro.mp4",
69
+ poster: "/intro-poster.jpg",
70
+ width: 1920,
71
+ height: 1080,
72
+ duration: 30,
73
+ type: "video",
74
+ },
75
+ },
76
+ },
77
+ };
78
+ ```
79
+
80
+ ### 3. Create Oknoinstance
81
+
82
+ ```typescript
83
+ // /okno/index.ts
84
+ import { create } from "okno";
85
+ import { schema } from "./schema";
86
+ import { content } from "./content";
87
+
88
+ export const okno = create({ schema, content });
89
+ ```
90
+
91
+ ### 4. Use in your site
92
+
93
+ ```typescript
94
+ import { okno } from "@/okno";
95
+
96
+ // Get single item
97
+ const article = okno("articles.my-post");
98
+
99
+ // Get by slug
100
+ const article = okno("articles", { slug: "getting-started" });
101
+
102
+ // Get collection
103
+ const articles = okno("articles");
104
+
105
+ // With filters
106
+ const tutorials = okno("articles", {
107
+ where: { category: "tutorial" },
108
+ limit: 10,
109
+ sort: "-publishedAt",
110
+ });
111
+ ```
112
+
113
+ ### 5. Enable editing
114
+
115
+ ```typescript
116
+ import { editor } from "okno/editor";
117
+ s;
118
+ editor(okno);
119
+ ```
120
+
121
+ Press 'e' to enter edit mode!
122
+
123
+ ## Features
124
+
125
+ - **Live Editing**: Edit content directly on your site
126
+ - **Type-Safe**: Full TypeScript support with auto-generated types
127
+ - **Framework Agnostic**: Works with Astro, Vite, and more
128
+ - **Draft System**: Save drafts before publishing
129
+ - **Flexible Schema**: Rich field types with validation
130
+ - **Lightweight**: Minimal bundle impact
131
+
132
+ ## Documentation
133
+
134
+ Coming soon...
135
+
136
+ ## License
137
+
138
+ MIT
@@ -0,0 +1,3 @@
1
+ import type { AstroIntegration } from "astro";
2
+ export declare function okno(): AstroIntegration;
3
+ //# sourceMappingURL=astro.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"astro.d.ts","sourceRoot":"","sources":["../../adapters/astro.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AAK9C,wBAAgB,IAAI,IAAI,gBAAgB,CA4DvC"}
@@ -0,0 +1,32 @@
1
+ import { loadEnv as o } from "vite";
2
+ import { O as t } from "../client-CeppRtrT.js";
3
+ function e() {
4
+ return { name: "okno", hooks: { "astro:config:setup": async ({ command: e2, injectScript: n }) => {
5
+ const _ = o("build" === e2 ? "production" : "development", process.cwd(), "OKNO_"), r = _.OKNO_TOKEN, i = _.OKNO_PROJECT, O = _.OKNO_DEV_API_URL;
6
+ if (!r) return void console.warn("[Okno] Missing OKNO_TOKEN environment variable");
7
+ const s = { token: r, _devApiUrl: O };
8
+ globalThis.__OKNO_CONFIG__ = s;
9
+ let c = {};
10
+ try {
11
+ const o2 = new t(s), e3 = await o2.fetchAll();
12
+ globalThis.__OKNO_CONTENT__ = e3.content, c = e3.schema || {};
13
+ } catch (o2) {
14
+ console.error("[Okno] Failed to fetch content:", o2);
15
+ }
16
+ n("head-inline", `window.__OKNO_ADAPTER__=true;window.__OKNO_PROJECT__="${i || ""}";window.__OKNO_SCHEMA__=${JSON.stringify(c)};`), n("page", 'import "okno/editor";');
17
+ }, "astro:server:setup": ({ server: o2 }) => {
18
+ o2.middlewares.use(async (o3, e2, n) => {
19
+ const _ = globalThis.__OKNO_CONFIG__;
20
+ if (_ && o3.url && !o3.url.startsWith("/@") && !o3.url.startsWith("/node_modules")) try {
21
+ const o4 = new t(_);
22
+ globalThis.__OKNO_CONTENT__ = await o4.fetchContent();
23
+ } catch (o4) {
24
+ console.error("[Okno] Fetch failed:", o4);
25
+ }
26
+ n();
27
+ });
28
+ } } };
29
+ }
30
+ export {
31
+ e as okno
32
+ };
@@ -0,0 +1,3 @@
1
+ export { okno as astro } from "./astro";
2
+ export { okno as vite } from "./vite";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../adapters/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,IAAI,KAAK,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,IAAI,IAAI,IAAI,EAAE,MAAM,QAAQ,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { Plugin } from "vite";
2
+ import type { OknoServerConfig } from "../server/types";
3
+ export declare function okno(config?: OknoServerConfig): Plugin;
4
+ //# sourceMappingURL=vite.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vite.d.ts","sourceRoot":"","sources":["../../adapters/vite.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAEnC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAExD,wBAAgB,IAAI,CAAC,MAAM,CAAC,EAAE,gBAAgB,GAAG,MAAM,CAmCtD"}
@@ -0,0 +1,21 @@
1
+ import { O as n } from "../client-CeppRtrT.js";
2
+ function o(o2) {
3
+ return { name: "okno", async buildStart() {
4
+ let t;
5
+ if (o2) t = o2;
6
+ else {
7
+ const { loadEnv: n2 } = await import("vite"), o3 = n2("production", process.cwd(), "OKNO_"), e = o3.OKNO_TOKEN, i = o3.OKNO_DEV_API_URL;
8
+ if (!e) return void console.warn("[Okno] Missing OKNO_TOKEN environment variable");
9
+ t = { token: e, _devApiUrl: i };
10
+ }
11
+ try {
12
+ const o3 = new n(t), e = await o3.fetchContent();
13
+ globalThis.__OKNO_CONTENT__ = e;
14
+ } catch (n2) {
15
+ console.error("[Okno] Failed to fetch content:", n2);
16
+ }
17
+ } };
18
+ }
19
+ export {
20
+ o as okno
21
+ };
@@ -0,0 +1,55 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
+ import t from "pocketbase";
5
+ class e {
6
+ constructor(t2) {
7
+ __publicField(this, "apiUrl");
8
+ __publicField(this, "token");
9
+ this.token = t2.token, this.apiUrl = t2._devApiUrl || "https://db.conte.build";
10
+ }
11
+ async fetchAll() {
12
+ const t2 = await fetch(`${this.apiUrl}/api/content`, { headers: { "X-Okno-Token": this.token } });
13
+ if (!t2.ok) throw new Error(`Failed to fetch content: ${t2.status}`);
14
+ const e2 = await t2.json(), n2 = {};
15
+ for (const t3 of e2.content) {
16
+ const c2 = e2.collections.find((e3) => e3.id === t3.collection);
17
+ if (!c2) continue;
18
+ const a2 = c2.name, o = c2.type;
19
+ "page" === o || "global" === o ? n2[a2] = t3.data : "collection" === o && (n2[a2] || (n2[a2] = []), n2[a2].push({ id: t3.id, slug: t3.slug, created: t3.created, updated: t3.updated, published: t3.published, created_by: t3.created_by, updated_by: t3.updated_by, published_by: t3.published_by, data: t3.data || {}, draft: t3.draft }));
20
+ }
21
+ return { schema: e2.schema || {}, content: n2 };
22
+ }
23
+ async fetchContent() {
24
+ const { content: t2 } = await this.fetchAll();
25
+ return t2;
26
+ }
27
+ async fetchSchema() {
28
+ const { schema: t2 } = await this.fetchAll();
29
+ return t2;
30
+ }
31
+ async syncSchema(e2) {
32
+ const n2 = new t(this.apiUrl);
33
+ try {
34
+ const t2 = await n2.collection("projects").getFirstListItem(`token="${this.token}"`);
35
+ await n2.collection("projects").update(t2.id, { schema: e2 }, { query: { token: this.token } });
36
+ } catch (t2) {
37
+ console.error("[Okno] Failed to sync schema:", t2);
38
+ }
39
+ }
40
+ }
41
+ async function n(t2) {
42
+ return new e(t2).fetchContent();
43
+ }
44
+ async function c(t2) {
45
+ return new e(t2).fetchSchema();
46
+ }
47
+ async function a(t2, n2) {
48
+ return new e(t2).syncSchema(n2);
49
+ }
50
+ export {
51
+ e as O,
52
+ c as a,
53
+ n as f,
54
+ a as s
55
+ };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=builders.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"builders.test.d.ts","sourceRoot":"","sources":["../../../core/__tests__/builders.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=fields.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fields.test.d.ts","sourceRoot":"","sources":["../../../core/__tests__/fields.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=runtime.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.test.d.ts","sourceRoot":"","sources":["../../../core/__tests__/runtime.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ import type { CollectionDefinition, FieldInput } from "../../types/global";
2
+ declare class CollectionBuilder {
3
+ def: CollectionDefinition;
4
+ constructor(fields: FieldInput);
5
+ draftable(): this;
6
+ }
7
+ export declare function collection(fields: FieldInput): CollectionBuilder;
8
+ export {};
9
+ //# sourceMappingURL=collection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collection.d.ts","sourceRoot":"","sources":["../../../core/builders/collection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAG3E,cAAM,iBAAiB;IACf,GAAG,EAAE,oBAAoB,CAAC;gBAErB,MAAM,EAAE,UAAU;IAQ9B,SAAS,IAAI,IAAI;CAIjB;AAED,wBAAgB,UAAU,CAAC,MAAM,EAAE,UAAU,GAAG,iBAAiB,CAEhE"}
@@ -0,0 +1,26 @@
1
+ import type { AnyField } from "../fields/types";
2
+ import type { FieldInput } from "../../types/global";
3
+ export interface ComponentDefinition {
4
+ type: "component";
5
+ name: string;
6
+ fields: Record<string, AnyField>;
7
+ preview: string[];
8
+ when?: {
9
+ field: string;
10
+ value: any | any[];
11
+ };
12
+ }
13
+ export declare class ComponentBuilder {
14
+ def: ComponentDefinition;
15
+ constructor(name: string, fields: FieldInput, preview?: string[]);
16
+ when(field: string, value: any | any[]): this;
17
+ }
18
+ /**
19
+ * Create a custom component field with accordion UI in editor
20
+ *
21
+ * @param name - Component type name (used by editor for rendering)
22
+ * @param fields - Field definitions inside the component
23
+ * @param preview - Array of field names to show in collapsed state
24
+ */
25
+ export declare function component(name: string, fields: FieldInput, preview?: string[]): ComponentBuilder;
26
+ //# sourceMappingURL=component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../core/builders/component.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAOrD,MAAM,WAAW,mBAAmB;IACnC,IAAI,EAAE,WAAW,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IACjC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,IAAI,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,GAAG,GAAG,GAAG,EAAE,CAAA;KAAE,CAAC;CAC7C;AAMD,qBAAa,gBAAgB;IACrB,GAAG,EAAE,mBAAmB,CAAC;gBAEpB,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,GAAE,MAAM,EAAO;IASpE,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,GAAG,EAAE,GAAG,IAAI;CAI7C;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,GAAE,MAAM,EAAO,GAAG,gBAAgB,CAEpG"}
@@ -0,0 +1,8 @@
1
+ import type { GlobalDefinition, FieldInput } from "../../types/global";
2
+ declare class GlobalBuilder {
3
+ def: GlobalDefinition;
4
+ constructor(fields: FieldInput);
5
+ }
6
+ export declare function global(fields: FieldInput): GlobalBuilder;
7
+ export {};
8
+ //# sourceMappingURL=global.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"global.d.ts","sourceRoot":"","sources":["../../../core/builders/global.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGvE,cAAM,aAAa;IACX,GAAG,EAAE,gBAAgB,CAAC;gBAEjB,MAAM,EAAE,UAAU;CAM9B;AAED,wBAAgB,MAAM,CAAC,MAAM,EAAE,UAAU,GAAG,aAAa,CAExD"}
@@ -0,0 +1,18 @@
1
+ import type { AnyField } from "../fields/types";
2
+ import type { FieldInput } from "../../types/global";
3
+ export interface GroupDefinition {
4
+ type: "group";
5
+ fields: Record<string, AnyField>;
6
+ when?: {
7
+ field: string;
8
+ value: any | any[];
9
+ };
10
+ }
11
+ declare class GroupBuilder {
12
+ def: GroupDefinition;
13
+ constructor(fields: FieldInput);
14
+ when(field: string, value: any | any[]): this;
15
+ }
16
+ export declare function group(fields: FieldInput): GroupBuilder;
17
+ export {};
18
+ //# sourceMappingURL=group.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"group.d.ts","sourceRoot":"","sources":["../../../core/builders/group.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,MAAM,WAAW,eAAe;IAC/B,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IACjC,IAAI,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,GAAG,GAAG,GAAG,EAAE,CAAA;KAAE,CAAC;CAC7C;AAED,cAAM,YAAY;IACV,GAAG,EAAE,eAAe,CAAC;gBAEhB,MAAM,EAAE,UAAU;IAQ9B,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,GAAG,EAAE,GAAG,IAAI;CAI7C;AAED,wBAAgB,KAAK,CAAC,MAAM,EAAE,UAAU,GAAG,YAAY,CAEtD"}
@@ -0,0 +1,8 @@
1
+ export { collection } from "./collection";
2
+ export { page } from "./page";
3
+ export { global } from "./global";
4
+ export { group } from "./group";
5
+ export { component, ComponentBuilder } from "./component";
6
+ export type { GroupDefinition } from "./group";
7
+ export type { ComponentDefinition } from "./component";
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../core/builders/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC1D,YAAY,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC/C,YAAY,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { PageDefinition, FieldInput } from "../../types/global";
2
+ declare class PageBuilder {
3
+ def: PageDefinition;
4
+ constructor(fields: FieldInput);
5
+ route(path: string): this;
6
+ }
7
+ export declare function page(fields: FieldInput): PageBuilder;
8
+ export {};
9
+ //# sourceMappingURL=page.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../../core/builders/page.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGrE,cAAM,WAAW;IACT,GAAG,EAAE,cAAc,CAAC;gBAEf,MAAM,EAAE,UAAU;IAO9B,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;CAIzB;AAED,wBAAgB,IAAI,CAAC,MAAM,EAAE,UAAU,GAAG,WAAW,CAEpD"}
@@ -0,0 +1,8 @@
1
+ import type { AnyField } from "../fields/types";
2
+ import type { FieldInput } from "../../types/global";
3
+ /**
4
+ * Resolves field input (builders or raw definitions) to plain field definitions.
5
+ * Recursively handles group fields.
6
+ */
7
+ export declare function resolveFields(fields: FieldInput): Record<string, AnyField>;
8
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../core/builders/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD;;;GAGG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CA0C1E"}
@@ -0,0 +1,3 @@
1
+ export { link } from "./link";
2
+ export { meta } from "./meta";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../core/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { ComponentBuilder } from "../builders/component";
2
+ /**
3
+ * Link component - text, url, and external flag
4
+ *
5
+ * Preview shows: "Link text • https://..."
6
+ */
7
+ declare class LinkBuilder extends ComponentBuilder {
8
+ constructor();
9
+ }
10
+ export declare function link(): LinkBuilder;
11
+ export {};
12
+ //# sourceMappingURL=link.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../../core/components/link.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAIzD;;;;GAIG;AACH,cAAM,WAAY,SAAQ,gBAAgB;;CAYzC;AAED,wBAAgB,IAAI,IAAI,WAAW,CAElC"}
@@ -0,0 +1,12 @@
1
+ import { ComponentBuilder } from "../builders/component";
2
+ /**
3
+ * Meta component - title, description, og image
4
+ *
5
+ * Preview shows: "Page Title"
6
+ */
7
+ declare class MetaBuilder extends ComponentBuilder {
8
+ constructor();
9
+ }
10
+ export declare function meta(): MetaBuilder;
11
+ export {};
12
+ //# sourceMappingURL=meta.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../core/components/meta.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAIzD;;;;GAIG;AACH,cAAM,WAAY,SAAQ,gBAAgB;;CAYzC;AAED,wBAAgB,IAAI,IAAI,WAAW,CAElC"}
@@ -0,0 +1,26 @@
1
+ import type { QueryOptions } from "../types/global";
2
+ /**
3
+ * Wraps field values for editable content rendering
4
+ */
5
+ export declare class FieldResult {
6
+ private value;
7
+ private path;
8
+ private isEmpty;
9
+ private options?;
10
+ constructor(value: any, path: string, isEmpty?: boolean, options?: {
11
+ plain?: boolean;
12
+ raw?: boolean;
13
+ } | undefined);
14
+ /** Get raw unwrapped value */
15
+ raw(): any;
16
+ /** Provide fallback for empty values */
17
+ default(defaultValue: any): FieldResult;
18
+ /** Render as string with edit span wrapper */
19
+ toString(): any;
20
+ toJSON(): any;
21
+ }
22
+ /**
23
+ * Create a field result, wrapping primitives for editing
24
+ */
25
+ export declare function createFieldResult(value: any, path: string, isEmpty: boolean, options?: QueryOptions): any;
26
+ //# sourceMappingURL=field-result.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"field-result.d.ts","sourceRoot":"","sources":["../../core/field-result.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD;;GAEG;AACH,qBAAa,WAAW;IAEtB,OAAO,CAAC,KAAK;IACb,OAAO,CAAC,IAAI;IACZ,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,OAAO,CAAC;gBAHR,KAAK,EAAE,GAAG,EACV,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,OAAc,EACvB,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAC;QAAC,GAAG,CAAC,EAAE,OAAO,CAAA;KAAE,YAAA;IAGrD,8BAA8B;IAC9B,GAAG;IAIH,wCAAwC;IACxC,OAAO,CAAC,YAAY,EAAE,GAAG,GAAG,WAAW;IAIvC,8CAA8C;IAC9C,QAAQ;IAmBR,MAAM;CAGN;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,GAAG,CASzG"}
@@ -0,0 +1,12 @@
1
+ import type { BooleanField } from "./types";
2
+ declare class BooleanBuilder {
3
+ def: BooleanField;
4
+ constructor();
5
+ default(value: boolean): this;
6
+ help(text: string): this;
7
+ protected(): this;
8
+ when(field: string, value: any | any[]): this;
9
+ }
10
+ export declare function boolean(): BooleanBuilder;
11
+ export {};
12
+ //# sourceMappingURL=boolean.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"boolean.d.ts","sourceRoot":"","sources":["../../../core/fields/boolean.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,cAAM,cAAc;IACZ,GAAG,EAAE,YAAY,CAAC;;IAQzB,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI;IAK7B,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAKxB,SAAS,IAAI,IAAI;IAKjB,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,GAAG,EAAE,GAAG,IAAI;CAI7C;AAED,wBAAgB,OAAO,IAAI,cAAc,CAExC"}
@@ -0,0 +1,14 @@
1
+ import type { DateField } from "./types";
2
+ declare class DateBuilder {
3
+ def: DateField;
4
+ constructor();
5
+ optional(): this;
6
+ default(value: string | (() => Date)): this;
7
+ help(text: string): this;
8
+ protected(): this;
9
+ localized(): this;
10
+ when(field: string, value: any | any[]): this;
11
+ }
12
+ export declare function date(): DateBuilder;
13
+ export {};
14
+ //# sourceMappingURL=date.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"date.d.ts","sourceRoot":"","sources":["../../../core/fields/date.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC,cAAM,WAAW;IACT,GAAG,EAAE,SAAS,CAAC;;IAQtB,QAAQ,IAAI,IAAI;IAKhB,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI;IAK3C,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAKxB,SAAS,IAAI,IAAI;IAKjB,SAAS,IAAI,IAAI;IAKjB,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,GAAG,EAAE,GAAG,IAAI;CAI7C;AAED,wBAAgB,IAAI,IAAI,WAAW,CAElC"}
@@ -0,0 +1,14 @@
1
+ import type { EnumField } from "./types";
2
+ declare class EnumBuilder {
3
+ def: EnumField;
4
+ constructor(values: string[]);
5
+ multiple(): this;
6
+ default(value: string | string[]): this;
7
+ help(text: string): this;
8
+ protected(): this;
9
+ localized(): this;
10
+ when(field: string, value: any | any[]): this;
11
+ }
12
+ export declare function enumField(values: string[]): EnumBuilder;
13
+ export { enumField as select };
14
+ //# sourceMappingURL=enum.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enum.d.ts","sourceRoot":"","sources":["../../../core/fields/enum.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC,cAAM,WAAW;IACT,GAAG,EAAE,SAAS,CAAC;gBAEV,MAAM,EAAE,MAAM,EAAE;IAO5B,QAAQ,IAAI,IAAI;IAKhB,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI;IAKvC,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAKxB,SAAS,IAAI,IAAI;IAKjB,SAAS,IAAI,IAAI;IAKjB,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,GAAG,EAAE,GAAG,IAAI;CAI7C;AAED,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,WAAW,CAEvD;AAGD,OAAO,EAAE,SAAS,IAAI,MAAM,EAAE,CAAC"}
@@ -0,0 +1,12 @@
1
+ export { string } from "./string";
2
+ export { number } from "./number";
3
+ export { boolean } from "./boolean";
4
+ export { date } from "./date";
5
+ export { enumField, enumField as enum, select } from "./enum";
6
+ export { richtext } from "./richtext";
7
+ export { media } from "./media";
8
+ export { slug } from "./slug";
9
+ export { reference } from "./reference";
10
+ export { user } from "./user";
11
+ export type { AnyField, StringField, NumberField, BooleanField, DateField, EnumField, RichtextField, MarkdownField, MediaField, SlugField, ReferenceField, UserField, GroupField, BaseFieldOptions, } from "./types";
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../core/fields/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAE,SAAS,IAAI,IAAI,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAG9B,YAAY,EACX,QAAQ,EACR,WAAW,EACX,WAAW,EACX,YAAY,EACZ,SAAS,EACT,SAAS,EACT,aAAa,EACb,aAAa,EACb,UAAU,EACV,SAAS,EACT,cAAc,EACd,SAAS,EACT,UAAU,EACV,gBAAgB,GAChB,MAAM,SAAS,CAAC"}
@@ -0,0 +1,33 @@
1
+ import type { MediaField } from "./types";
2
+ interface ImageOptions {
3
+ maxWidth?: number;
4
+ maxHeight?: number;
5
+ format?: string[];
6
+ }
7
+ interface VideoOptions {
8
+ maxSize?: string;
9
+ maxDuration?: number;
10
+ }
11
+ interface AudioOptions {
12
+ maxSize?: string;
13
+ maxDuration?: number;
14
+ }
15
+ interface DocumentOptions {
16
+ maxSize?: string;
17
+ accept?: string[];
18
+ }
19
+ declare class MediaBuilder {
20
+ def: MediaField;
21
+ constructor();
22
+ image(options?: ImageOptions): this;
23
+ video(options?: VideoOptions): this;
24
+ audio(options?: AudioOptions): this;
25
+ document(options?: DocumentOptions): this;
26
+ optional(): this;
27
+ help(text: string): this;
28
+ protected(): this;
29
+ when(field: string, value: any | any[]): this;
30
+ }
31
+ export declare function media(): MediaBuilder;
32
+ export {};
33
+ //# sourceMappingURL=media.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"media.d.ts","sourceRoot":"","sources":["../../../core/fields/media.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C,UAAU,YAAY;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,UAAU,YAAY;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,UAAU,YAAY;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,UAAU,eAAe;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,cAAM,YAAY;IACV,GAAG,EAAE,UAAU,CAAC;;IAQvB,KAAK,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,IAAI;IAOnC,KAAK,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,IAAI;IAOnC,KAAK,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,IAAI;IAOnC,QAAQ,CAAC,OAAO,CAAC,EAAE,eAAe,GAAG,IAAI;IAOzC,QAAQ,IAAI,IAAI;IAKhB,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAKxB,SAAS,IAAI,IAAI;IAKjB,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,GAAG,EAAE,GAAG,IAAI;CAI7C;AAED,wBAAgB,KAAK,IAAI,YAAY,CAEpC"}
@@ -0,0 +1,16 @@
1
+ import type { NumberField } from "./types";
2
+ declare class NumberBuilder {
3
+ def: NumberField;
4
+ constructor();
5
+ optional(): this;
6
+ min(value: number): this;
7
+ max(value: number): this;
8
+ default(value: number): this;
9
+ help(text: string): this;
10
+ protected(): this;
11
+ localized(): this;
12
+ when(field: string, value: any | any[]): this;
13
+ }
14
+ export declare function number(): NumberBuilder;
15
+ export {};
16
+ //# sourceMappingURL=number.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"number.d.ts","sourceRoot":"","sources":["../../../core/fields/number.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,cAAM,aAAa;IACX,GAAG,EAAE,WAAW,CAAC;;IASxB,QAAQ,IAAI,IAAI;IAKhB,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAKxB,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAKxB,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAK5B,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAKxB,SAAS,IAAI,IAAI;IAKjB,SAAS,IAAI,IAAI;IAKjB,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,GAAG,EAAE,GAAG,IAAI;CAI7C;AAED,wBAAgB,MAAM,IAAI,aAAa,CAEtC"}