okno 1.0.0-beta.45 → 1.0.0-beta.47
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/{parse-tlTHgSSs.js → acorn-oIjaFBVA.js} +198 -252
- package/dist/astro/index.js +1 -1
- package/dist/boot.js +5 -5
- package/dist/{cli.d.ts → cli/index.d.ts} +1 -1
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/{init.d.ts → cli/init.d.ts} +20 -9
- package/dist/cli/init.d.ts.map +1 -0
- package/dist/cli/mcp.d.ts.map +1 -0
- package/dist/codegen/generate.d.ts +5 -1
- package/dist/codegen/generate.d.ts.map +1 -1
- package/dist/codegen/icon-assets.d.ts +13 -0
- package/dist/codegen/icon-assets.d.ts.map +1 -0
- package/dist/{bake.d.ts → codegen/identity.d.ts} +1 -1
- package/dist/codegen/identity.d.ts.map +1 -0
- package/dist/codegen/modules.d.ts +5 -3
- package/dist/codegen/modules.d.ts.map +1 -1
- package/dist/codegen/revision.d.ts +7 -0
- package/dist/codegen/revision.d.ts.map +1 -0
- package/dist/codegen/validate-content.d.ts +3 -34
- package/dist/codegen/validate-content.d.ts.map +1 -1
- package/dist/contracts/bootstrap.d.ts +74 -0
- package/dist/contracts/bootstrap.d.ts.map +1 -0
- package/dist/{types → contracts}/fields.d.ts +41 -20
- package/dist/contracts/fields.d.ts.map +1 -0
- package/dist/contracts/index.d.ts +5 -0
- package/dist/contracts/index.d.ts.map +1 -0
- package/dist/contracts/permissions.d.ts.map +1 -0
- package/dist/{types → contracts}/schema.d.ts +10 -12
- package/dist/contracts/schema.d.ts.map +1 -0
- package/dist/core/content-path.d.ts +13 -0
- package/dist/core/content-path.d.ts.map +1 -0
- package/dist/core/content.d.ts +53 -0
- package/dist/core/content.d.ts.map +1 -0
- package/dist/{engine → core}/encode.d.ts +2 -4
- package/dist/core/encode.d.ts.map +1 -0
- package/dist/core/fields.d.ts.map +1 -0
- package/dist/core/index.d.ts +22 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/order.d.ts.map +1 -0
- package/dist/{engine → core}/parse.d.ts +4 -5
- package/dist/core/parse.d.ts.map +1 -0
- package/dist/core/schema-mutation.d.ts +67 -0
- package/dist/core/schema-mutation.d.ts.map +1 -0
- package/dist/core/schema.d.ts.map +1 -0
- package/dist/core/svg-icon.d.ts +21 -0
- package/dist/core/svg-icon.d.ts.map +1 -0
- package/dist/core/usage.d.ts +46 -0
- package/dist/core/usage.d.ts.map +1 -0
- package/dist/dispatch-DaiWy5Uk.js +1550 -0
- package/dist/editor/index.js +53991 -42591
- package/dist/engine/index.js +3392 -166
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/init.js +420 -189
- package/dist/{astro → integrations/astro}/index.d.ts +1 -1
- package/dist/integrations/astro/index.d.ts.map +1 -0
- package/dist/integrations/next/assets.d.ts +13 -0
- package/dist/integrations/next/assets.d.ts.map +1 -0
- package/dist/{next → integrations/next}/codegen.d.ts +3 -1
- package/dist/integrations/next/codegen.d.ts.map +1 -0
- package/dist/{next → integrations/next}/config.d.ts +2 -2
- package/dist/integrations/next/config.d.ts.map +1 -0
- package/dist/integrations/next/handler.d.ts.map +1 -0
- package/dist/integrations/next/index.d.ts.map +1 -0
- package/dist/{vite → integrations/vite}/dev-server.d.ts +1 -1
- package/dist/integrations/vite/dev-server.d.ts.map +1 -0
- package/dist/integrations/vite/editor-aliases.d.ts.map +1 -0
- package/dist/integrations/vite/index.d.ts.map +1 -0
- package/dist/{vite → integrations/vite}/local-engine.d.ts +4 -4
- package/dist/integrations/vite/local-engine.d.ts.map +1 -0
- package/dist/{vite → integrations/vite}/plugin.d.ts +2 -2
- package/dist/integrations/vite/plugin.d.ts.map +1 -0
- package/dist/local/disk.d.ts +17 -9
- package/dist/local/disk.d.ts.map +1 -1
- package/dist/local/dispatch.d.ts.map +1 -1
- package/dist/local/schema-mutation.d.ts +29 -0
- package/dist/local/schema-mutation.d.ts.map +1 -0
- package/dist/local/self-written.d.ts +5 -5
- package/dist/local/self-written.d.ts.map +1 -1
- package/dist/local/setup.d.ts +33 -0
- package/dist/local/setup.d.ts.map +1 -0
- package/dist/mcp.js +85 -69
- package/dist/next/index.js +172 -111
- package/dist/okno.css +1 -1
- package/dist/plugin-DNXklUmq.js +538 -0
- package/dist/runtime/boot.d.ts.map +1 -0
- package/dist/runtime/date-format.d.ts +11 -0
- package/dist/runtime/date-format.d.ts.map +1 -0
- package/dist/runtime/hooks.d.ts +4 -0
- package/dist/runtime/hooks.d.ts.map +1 -0
- package/dist/runtime/preview-contract.d.ts +54 -0
- package/dist/runtime/preview-contract.d.ts.map +1 -0
- package/dist/runtime/preview-renderers.d.ts +15 -0
- package/dist/runtime/preview-renderers.d.ts.map +1 -0
- package/dist/runtime/preview-sync.d.ts +9 -0
- package/dist/runtime/preview-sync.d.ts.map +1 -0
- package/dist/runtime/preview.d.ts +72 -0
- package/dist/runtime/preview.d.ts.map +1 -0
- package/dist/runtime/slot-format.d.ts +21 -0
- package/dist/runtime/slot-format.d.ts.map +1 -0
- package/dist/runtime/transitions.d.ts +6 -0
- package/dist/runtime/transitions.d.ts.map +1 -0
- package/dist/runtime/values.d.ts +166 -0
- package/dist/runtime/values.d.ts.map +1 -0
- package/dist/runtime/wrap.d.ts +7 -191
- package/dist/runtime/wrap.d.ts.map +1 -1
- package/dist/runtime/wrap.js +4165 -508
- package/dist/schema-mutation-BWtb40Qj.js +675 -0
- package/dist/schema-mutation-DVgVbjdl.js +103 -0
- package/dist/vite/index.js +1 -1
- package/package.json +17 -25
- package/skills/connect-okno/SKILL.md +125 -395
- package/skills/connect-okno/references/content.md +298 -0
- package/src/runtime/boot.ts +312 -0
- package/src/runtime/date-format.ts +46 -0
- package/src/runtime/hooks.ts +78 -0
- package/src/runtime/preview-contract.ts +53 -0
- package/src/runtime/preview-renderers.ts +67 -0
- package/src/runtime/preview-sync.ts +380 -0
- package/src/runtime/preview.ts +401 -0
- package/src/runtime/slot-format.ts +73 -0
- package/src/runtime/transitions.ts +154 -0
- package/src/runtime/values.ts +1241 -0
- package/src/runtime/wrap.ts +22 -1737
- package/dist/astro/index.d.ts.map +0 -1
- package/dist/bake.d.ts.map +0 -1
- package/dist/boot.d.ts.map +0 -1
- package/dist/build-revision.d.ts +0 -5
- package/dist/build-revision.d.ts.map +0 -1
- package/dist/cli.d.ts.map +0 -1
- package/dist/content-path-Bc0rnTVl.js +0 -24
- package/dist/dispatch-C1NpqUhY.js +0 -1187
- package/dist/engine/content-path.d.ts +0 -5
- package/dist/engine/content-path.d.ts.map +0 -1
- package/dist/engine/encode.d.ts.map +0 -1
- package/dist/engine/fields.d.ts.map +0 -1
- package/dist/engine/index.d.ts +0 -18
- package/dist/engine/index.d.ts.map +0 -1
- package/dist/engine/order.d.ts.map +0 -1
- package/dist/engine/parse.d.ts.map +0 -1
- package/dist/engine/schema.d.ts.map +0 -1
- package/dist/init.d.ts.map +0 -1
- package/dist/mcp.d.ts.map +0 -1
- package/dist/next/codegen.d.ts.map +0 -1
- package/dist/next/config.d.ts.map +0 -1
- package/dist/next/handler.d.ts.map +0 -1
- package/dist/next/index.d.ts.map +0 -1
- package/dist/order-bAkdncZC.js +0 -21
- package/dist/plugin-4k3fA3lQ.js +0 -504
- package/dist/types/fields.d.ts.map +0 -1
- package/dist/types/index.d.ts +0 -4
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/permissions.d.ts.map +0 -1
- package/dist/types/schema.d.ts.map +0 -1
- package/dist/vite/dev-server.d.ts.map +0 -1
- package/dist/vite/editor-aliases.d.ts.map +0 -1
- package/dist/vite/index.d.ts.map +0 -1
- package/dist/vite/local-engine.d.ts.map +0 -1
- package/dist/vite/plugin.d.ts.map +0 -1
- package/src/runtime/wrap.test.ts +0 -376
- /package/dist/{mcp.d.ts → cli/mcp.d.ts} +0 -0
- /package/dist/{types → contracts}/permissions.d.ts +0 -0
- /package/dist/{engine → core}/fields.d.ts +0 -0
- /package/dist/{engine → core}/order.d.ts +0 -0
- /package/dist/{engine → core}/schema.d.ts +0 -0
- /package/dist/{next → integrations/next}/handler.d.ts +0 -0
- /package/dist/{next → integrations/next}/index.d.ts +0 -0
- /package/dist/{vite → integrations/vite}/editor-aliases.d.ts +0 -0
- /package/dist/{vite → integrations/vite}/index.d.ts +0 -0
- /package/dist/{boot.d.ts → runtime/boot.d.ts} +0 -0
package/dist/astro/index.js
CHANGED
package/dist/boot.js
CHANGED
|
@@ -52,7 +52,7 @@ function p(t) {
|
|
|
52
52
|
const n = e.document?.getElementById(c);
|
|
53
53
|
n instanceof HTMLElement && v(n);
|
|
54
54
|
}
|
|
55
|
-
function
|
|
55
|
+
function y(t) {
|
|
56
56
|
const n = t.viewTransition;
|
|
57
57
|
if (!u() || !n || !e.document) return;
|
|
58
58
|
const o = e.document.documentElement;
|
|
@@ -66,7 +66,7 @@ function w(t) {
|
|
|
66
66
|
function f() {
|
|
67
67
|
return !!e.__okno_loaded;
|
|
68
68
|
}
|
|
69
|
-
function
|
|
69
|
+
function w() {
|
|
70
70
|
let t = e.document?.activeElement;
|
|
71
71
|
for (; t && t.shadowRoot?.activeElement; )
|
|
72
72
|
t = t.shadowRoot.activeElement;
|
|
@@ -106,12 +106,12 @@ function k() {
|
|
|
106
106
|
return o;
|
|
107
107
|
}
|
|
108
108
|
function g() {
|
|
109
|
-
if (!e.document || (typeof __OKNO_IS_DEV__ < "u" ? __OKNO_IS_DEV__ : !1) || e.__okno_gate_installed) return;
|
|
109
|
+
if (!e.document || (typeof __OKNO_IS_DEV__ < "u" ? __OKNO_IS_DEV__ : !1) && e.document.querySelector('script[src="/__okno_bootstrap.js"]') || e.__okno_gate_installed) return;
|
|
110
110
|
e.__okno_gate_installed = !0, e.document.addEventListener("keydown", (i) => {
|
|
111
|
-
f() || i.key !== "e" || i.ctrlKey || i.metaKey || i.altKey ||
|
|
111
|
+
f() || i.key !== "e" || i.ctrlKey || i.metaKey || i.altKey || w() || s("key");
|
|
112
112
|
}), e.__okno_ensure_vt = d;
|
|
113
113
|
const n = window;
|
|
114
|
-
n.addEventListener("pageswap", p), n.addEventListener("pagereveal",
|
|
114
|
+
n.addEventListener("pageswap", p), n.addEventListener("pagereveal", y), u() && (d(), s("session"));
|
|
115
115
|
const o = k();
|
|
116
116
|
if (o) {
|
|
117
117
|
e.__okno_invite = o, s("url");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";AACA;;;;GAIG;AAIH,iBAAe,IAAI,kBAuBlB"}
|
|
@@ -43,10 +43,11 @@ export declare function addAstroIntegration(configPath: string): boolean;
|
|
|
43
43
|
* {@link addAstroIntegration}).
|
|
44
44
|
* - sveltekit: create `src/hooks.client.ts` — runs once on the client for every
|
|
45
45
|
* route, so its `import "okno/boot"` side effect installs the gate everywhere.
|
|
46
|
-
* - nuxt: create
|
|
46
|
+
* - nuxt: create `<srcDir>/plugins/okno.client.ts` after verifying the static
|
|
47
|
+
* configuration/layout — Nuxt auto-loads plugins from its source directory.
|
|
47
48
|
* Idempotent (never overwrites an existing file). Returns a note line or null.
|
|
48
49
|
*/
|
|
49
|
-
export declare function wireBoot(cwd: string, framework: Framework): string | null;
|
|
50
|
+
export declare function wireBoot(cwd: string, framework: Framework, nuxtSrcDir?: string): string | null;
|
|
50
51
|
export type ScaffoldMode = "starter" | "empty";
|
|
51
52
|
/**
|
|
52
53
|
* Scaffold okno/ if there's no okno/ yet. Two modes:
|
|
@@ -60,15 +61,25 @@ export type ScaffoldMode = "starter" | "empty";
|
|
|
60
61
|
* model. Returns false if okno/ already exists (left untouched).
|
|
61
62
|
*/
|
|
62
63
|
export declare function scaffold(cwd: string, mode?: ScaffoldMode): boolean;
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
*/
|
|
69
|
-
export declare function writeSkill(cwd: string):
|
|
64
|
+
export interface AgentSetupResult {
|
|
65
|
+
updated: string[];
|
|
66
|
+
unchanged: string[];
|
|
67
|
+
blockers: string[];
|
|
68
|
+
}
|
|
69
|
+
/** One packaged skill, discovered by both clients; preserve custom agent files. */
|
|
70
|
+
export declare function writeSkill(cwd: string): AgentSetupResult;
|
|
70
71
|
/** Register the okno MCP server for an AI client. */
|
|
71
72
|
export declare function writeMcpConfig(cwd: string, client: "claude" | "cursor"): string;
|
|
73
|
+
/** Prefer the declared package manager, then its lockfile (default npm). */
|
|
74
|
+
export declare function detectPackageManager(cwd: string): "bun" | "pnpm" | "yarn" | "npm";
|
|
75
|
+
/** Only suggest a command when the project actually defines a start script. */
|
|
76
|
+
export declare function startCommand(cwd: string): string | null;
|
|
77
|
+
/** Keep successful setup quiet, but never hide a required manual step. */
|
|
78
|
+
export declare function summarizeSetup(notes: string[]): {
|
|
79
|
+
ready: boolean;
|
|
80
|
+
title: string;
|
|
81
|
+
details: string[];
|
|
82
|
+
};
|
|
72
83
|
export declare function runInit(): Promise<void>;
|
|
73
84
|
export {};
|
|
74
85
|
//# sourceMappingURL=init.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/cli/init.ts"],"names":[],"mappings":"AAuBA,KAAK,SAAS,GAAG,OAAO,GAAG,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;AAEpE,UAAU,QAAQ;IACjB,SAAS,EAAE,SAAS,CAAA;IACpB,yEAAyE;IACzE,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,oFAAoF;IACpF,SAAS,EAAE,KAAK,GAAG,MAAM,CAAA;CACzB;AAiBD,kEAAkE;AAClE,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ,CA0B5C;AAED;6DAC6D;AAC7D,MAAM,WAAW,MAAM;IACtB;yEACqE;IACrE,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,SAAS,CAAA;CACpB;AA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E,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAA;CAChD,CAIA;AAyBD,wBAAsB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAsK7C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../src/cli/mcp.ts"],"names":[],"mappings":"AA4CA;kCACkC;AAClC,wBAAsB,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAsL5C"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { type ContentValidationPolicy } from "./validate-content.ts";
|
|
2
|
+
import { type Framework } from "../core/index.ts";
|
|
1
3
|
/**
|
|
2
4
|
* Read the schema, scan content directories, and generate:
|
|
3
5
|
* - modules.d.ts (type declarations for okno:* virtual modules)
|
|
@@ -6,5 +8,7 @@
|
|
|
6
8
|
* `import { x } from "okno/<kind>"` so names referenced before scaffolding
|
|
7
9
|
* still get a (placeholder) type, mirroring the runtime virtual modules.
|
|
8
10
|
*/
|
|
9
|
-
|
|
11
|
+
/** `framework` selects the render snippets in field docs; omitted, docs keep
|
|
12
|
+
* the schema summary and value hints without framework-specific markup. */
|
|
13
|
+
export declare function generateTypes(oknoDir: string, root: string, policy?: ContentValidationPolicy, framework?: Framework): Promise<void>;
|
|
10
14
|
//# sourceMappingURL=generate.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../src/codegen/generate.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../src/codegen/generate.ts"],"names":[],"mappings":"AAKA,OAAO,EAAmB,KAAK,uBAAuB,EAAE,MAAM,uBAAuB,CAAA;AACrF,OAAO,EAA6E,KAAK,SAAS,EAAmB,MAAM,kBAAkB,CAAA;AA6N7I;;;;;;;GAOG;AACH;2EAC2E;AAC3E,wBAAsB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,GAAE,uBAAkC,EAAE,SAAS,CAAC,EAAE,SAAS,iBA8QnI"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** Read canonical file labels without rewriting content. Legacy labels remain
|
|
2
|
+
* migration candidates only; no per-usage value can override file metadata. */
|
|
3
|
+
export declare function readFileAlts(oknoDir: string, warn?: (message: string) => void): Record<string, string>;
|
|
4
|
+
/** Build-time IO owner: validate only Icon references. The existing Files asset
|
|
5
|
+
* pipeline emits originals; builds never prepare, replace or duplicate sources. */
|
|
6
|
+
export declare function readIconAssets(oknoDir: string): Array<{
|
|
7
|
+
path: string;
|
|
8
|
+
address: string;
|
|
9
|
+
}>;
|
|
10
|
+
/** Icon fragment URLs are separate from optimized media imports and stay on the
|
|
11
|
+
* site's own origin so native external use references work in every browser. */
|
|
12
|
+
export declare function iconAssetMap(oknoDir: string, basePath?: string): Record<string, string>;
|
|
13
|
+
//# sourceMappingURL=icon-assets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon-assets.d.ts","sourceRoot":"","sources":["../../src/codegen/icon-assets.ts"],"names":[],"mappings":"AAkEA;+EAC+E;AAC/E,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,GAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAe,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CA4BhH;AAED;mFACmF;AACnF,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,CAqBxF;AAED;gFACgF;AAChF,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,SAAK,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAMnF"}
|
|
@@ -25,4 +25,4 @@ export declare function bakeRepoIdentity(oknoDir?: string): string | null;
|
|
|
25
25
|
* hosted backend knows which subtree holds this project's `okno/`. "" at the repo
|
|
26
26
|
* root (single-project repo), "apps/site" in a monorepo. POSIX-normalized. */
|
|
27
27
|
export declare function bakeRootPath(): string;
|
|
28
|
-
//# sourceMappingURL=
|
|
28
|
+
//# sourceMappingURL=identity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../src/codegen/identity.ts"],"names":[],"mappings":"AAoBA;;;;sEAIsE;AACtE,wBAAgB,UAAU,IAAI,MAAM,CAWnC;AAiBD;;;;;;;;;;;;;;;uBAeuB;AACvB,wBAAgB,gBAAgB,CAAC,OAAO,SAAS,GAAG,MAAM,GAAG,IAAI,CAOhE;AAED;;+EAE+E;AAC/E,wBAAgB,YAAY,IAAI,MAAM,CAIrC"}
|
|
@@ -28,6 +28,8 @@ export declare function readCollectionConfig(oknoDir: string): {
|
|
|
28
28
|
};
|
|
29
29
|
export declare function toExportName(filename: string): string;
|
|
30
30
|
export declare function toContentName(filename: string): string;
|
|
31
|
+
/** Namespace methods must never silently replace an existing content export. */
|
|
32
|
+
export declare function assertContentNamespaceNames(kind: string, names: string[]): void;
|
|
31
33
|
/** Build the framework-agnostic `okno:locales` module: ONE export, `locales` —
|
|
32
34
|
* an array of the configured languages (`{ id, name, slug, link(url) }`) with a
|
|
33
35
|
* `.default` property pointing at the base-locale entry. `link(url)` emits the
|
|
@@ -45,9 +47,9 @@ export declare function buildLocalesModule(oknoDir: string): string;
|
|
|
45
47
|
*/
|
|
46
48
|
export declare function buildStringsModule(oknoDir: string): Promise<string>;
|
|
47
49
|
/** Build virtual module for okno:pages */
|
|
48
|
-
export declare function buildPagesModule(oknoDir: string, used?: Set<string>, imageMode?: ImageMode): Promise<string>;
|
|
50
|
+
export declare function buildPagesModule(oknoDir: string, used?: Set<string>, imageMode?: ImageMode, assetSetup?: string): Promise<string>;
|
|
49
51
|
/** Build virtual module for okno:collections — exports each collection as a named array */
|
|
50
|
-
export declare function buildCollectionsModule(oknoDir: string, used?: Set<string>, isBuild?: boolean, imageMode?: ImageMode): Promise<string>;
|
|
52
|
+
export declare function buildCollectionsModule(oknoDir: string, used?: Set<string>, isBuild?: boolean, imageMode?: ImageMode, assetSetup?: string): Promise<string>;
|
|
51
53
|
/** Build virtual module for okno:globals */
|
|
52
|
-
export declare function buildGlobalsModule(oknoDir: string, used?: Set<string>, imageMode?: ImageMode): Promise<string>;
|
|
54
|
+
export declare function buildGlobalsModule(oknoDir: string, used?: Set<string>, imageMode?: ImageMode, assetSetup?: string): Promise<string>;
|
|
53
55
|
//# sourceMappingURL=modules.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modules.d.ts","sourceRoot":"","sources":["../../src/codegen/modules.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"modules.d.ts","sourceRoot":"","sources":["../../src/codegen/modules.ts"],"names":[],"mappings":"AAqBA;;;4EAG4E;AAC5E,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,OAAO,CAAA;AAMvC;oFACoF;AACpF,wBAAgB,aAAa,CAAC,IAAI,GAAE,SAAiB,GAAG,MAAM,CAE7D;AAoBD;kEACkE;AAClE,wBAAgB,gBAAgB,IAAI,MAAM,GAAG,IAAI,CAKhD;AAED;;;mCAGmC;AACnC,wBAAgB,kBAAkB,IAAI,MAAM,CAO3C;AA+CD,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAIrE;AAED;;qDAEqD;AACrD,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG;IACtD,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;IAChC,oFAAoF;IACpF,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IACtB,wEAAwE;IACxE,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CAC1B,CAuBA;AAwBD,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAErD;AAED,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEtD;AAED,gFAAgF;AAChF,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAI/E;AAUD;;;;;+EAK+E;AAC/E,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAoD1D;AAED;;;;;;;GAOG;AACH,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAwDzE;AAED,0CAA0C;AAC1C,wBAAsB,gBAAgB,CACrC,OAAO,EAAE,MAAM,EACf,IAAI,GAAE,GAAG,CAAC,MAAM,CAAa,EAC7B,SAAS,GAAE,SAAiB,EAC5B,UAAU,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,MAAM,CAAC,CAoGjB;AAED,2FAA2F;AAC3F,wBAAsB,sBAAsB,CAC3C,OAAO,EAAE,MAAM,EACf,IAAI,GAAE,GAAG,CAAC,MAAM,CAAa,EAC7B,OAAO,UAAQ,EACf,SAAS,GAAE,SAAiB,EAC5B,UAAU,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,MAAM,CAAC,CA+JjB;AAED,4CAA4C;AAC5C,wBAAsB,kBAAkB,CACvC,OAAO,EAAE,MAAM,EACf,IAAI,GAAE,GAAG,CAAC,MAAM,CAAa,EAC7B,SAAS,GAAE,SAAiB,EAC5B,UAAU,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,MAAM,CAAC,CAqFjB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** The only publication metadata a deployed site needs. It is generated from
|
|
2
|
+
* the checked-out content alongside the framework's ordinary build output. */
|
|
3
|
+
export declare function readPublicationRevision(oknoDir: string): number;
|
|
4
|
+
/** Framework bridges emit this into their build output; never write to a
|
|
5
|
+
* consumer's public/static source directory. */
|
|
6
|
+
export declare function deploymentMarkerSource(oknoDir: string): string | null;
|
|
7
|
+
//# sourceMappingURL=revision.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"revision.d.ts","sourceRoot":"","sources":["../../src/codegen/revision.ts"],"names":[],"mappings":"AAGA;8EAC8E;AAC9E,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAS/D;AAED;gDACgD;AAChD,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAGrE"}
|
|
@@ -1,39 +1,8 @@
|
|
|
1
|
-
type
|
|
2
|
-
|
|
3
|
-
required?: boolean;
|
|
4
|
-
multiple?: boolean;
|
|
5
|
-
collection?: string;
|
|
6
|
-
block?: string;
|
|
7
|
-
blocks?: string[];
|
|
8
|
-
fields?: Fields;
|
|
9
|
-
options?: Array<string | {
|
|
10
|
-
value?: string;
|
|
11
|
-
}>;
|
|
12
|
-
};
|
|
13
|
-
type Fields = Record<string, Def>;
|
|
14
|
-
type Schema = {
|
|
15
|
-
pages?: Record<string, {
|
|
16
|
-
fields?: Fields;
|
|
17
|
-
}>;
|
|
18
|
-
collections?: Record<string, {
|
|
19
|
-
fields?: Fields;
|
|
20
|
-
}>;
|
|
21
|
-
globals?: Record<string, {
|
|
22
|
-
fields?: Fields;
|
|
23
|
-
}>;
|
|
24
|
-
blocks?: Record<string, {
|
|
25
|
-
fields?: Fields;
|
|
26
|
-
}>;
|
|
27
|
-
locales?: {
|
|
28
|
-
supported?: Array<string | {
|
|
29
|
-
id?: string;
|
|
30
|
-
}>;
|
|
31
|
-
};
|
|
32
|
-
};
|
|
1
|
+
import { type ContentSchema } from "../core/index.ts";
|
|
2
|
+
export type ContentValidationPolicy = "strict" | "development";
|
|
33
3
|
/** Validate the small part TypeScript cannot prove by itself: actual repository
|
|
34
4
|
* values against schema fields, polymorphic block tags, and reference targets.
|
|
35
5
|
* Content remains plain static TS; this runs during codegen/build and has no
|
|
36
6
|
* runtime or framework dependency. */
|
|
37
|
-
export declare function validateContent(oknoDir: string, schema:
|
|
38
|
-
export {};
|
|
7
|
+
export declare function validateContent(oknoDir: string, schema: ContentSchema | null, policy?: ContentValidationPolicy): void;
|
|
39
8
|
//# sourceMappingURL=validate-content.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate-content.d.ts","sourceRoot":"","sources":["../../src/codegen/validate-content.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"validate-content.d.ts","sourceRoot":"","sources":["../../src/codegen/validate-content.ts"],"names":[],"mappings":"AAEA,OAAO,EAA+C,KAAK,aAAa,EAAqB,MAAM,kBAAkB,CAAA;AAGrH,MAAM,MAAM,uBAAuB,GAAG,QAAQ,GAAG,aAAa,CAAA;AAmB9D;;;sCAGsC;AACtC,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,GAAG,IAAI,EAAE,MAAM,GAAE,uBAAkC,GAAG,IAAI,CAyE/H"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/** Authenticated editor bootstrap wire contract. Identity is separate from project readiness. */
|
|
2
|
+
export type BootstrapOutcome = "needs-repository" | "needs-installation" | "needs-initialization" | "access-denied" | "conflict" | "retryable-error" | "project-verified";
|
|
3
|
+
export interface BootstrapBilling {
|
|
4
|
+
override: "unlimited" | "blocked" | null;
|
|
5
|
+
spend: number;
|
|
6
|
+
days: number;
|
|
7
|
+
unlimited: boolean;
|
|
8
|
+
blocked: boolean;
|
|
9
|
+
todayActive: boolean;
|
|
10
|
+
todayEndsAt?: string | null;
|
|
11
|
+
cycleStart: string | null;
|
|
12
|
+
cycleEnd: string | null;
|
|
13
|
+
coverYear: number;
|
|
14
|
+
card?: {
|
|
15
|
+
brand: string;
|
|
16
|
+
last4: string;
|
|
17
|
+
} | null;
|
|
18
|
+
history?: {
|
|
19
|
+
day: string;
|
|
20
|
+
charged: number;
|
|
21
|
+
label?: string;
|
|
22
|
+
}[];
|
|
23
|
+
}
|
|
24
|
+
export interface BootstrapUser {
|
|
25
|
+
id: string;
|
|
26
|
+
login: string;
|
|
27
|
+
name: string;
|
|
28
|
+
avatar: string;
|
|
29
|
+
role?: string;
|
|
30
|
+
owner?: boolean;
|
|
31
|
+
authorized?: boolean;
|
|
32
|
+
billing?: BootstrapBilling | null;
|
|
33
|
+
spend?: number;
|
|
34
|
+
projectId?: string | null;
|
|
35
|
+
oknoDir?: string;
|
|
36
|
+
}
|
|
37
|
+
export interface BootstrapDiagnostic {
|
|
38
|
+
error: string;
|
|
39
|
+
step: string;
|
|
40
|
+
code: string;
|
|
41
|
+
retryable: boolean;
|
|
42
|
+
status?: number;
|
|
43
|
+
upstreamStatus?: number;
|
|
44
|
+
repo?: string;
|
|
45
|
+
path?: string;
|
|
46
|
+
branch?: string;
|
|
47
|
+
correlationId?: string;
|
|
48
|
+
completed?: string[];
|
|
49
|
+
}
|
|
50
|
+
export interface BootstrapResponse {
|
|
51
|
+
user: BootstrapUser;
|
|
52
|
+
outcome: BootstrapOutcome;
|
|
53
|
+
status?: {
|
|
54
|
+
hasInstallation: boolean;
|
|
55
|
+
initialized: boolean;
|
|
56
|
+
missing?: string[];
|
|
57
|
+
productionBranch?: string;
|
|
58
|
+
projectId?: string;
|
|
59
|
+
};
|
|
60
|
+
accessBranch?: string;
|
|
61
|
+
workingBranch?: string;
|
|
62
|
+
installUrl?: string | null;
|
|
63
|
+
/** Hosted permissions from the authorized access branch; absent means not supplied. */
|
|
64
|
+
permissions?: string | null;
|
|
65
|
+
/** Single-repository contents:read token; never a full installation token. */
|
|
66
|
+
readToken?: {
|
|
67
|
+
token: string;
|
|
68
|
+
expiresAt: string;
|
|
69
|
+
};
|
|
70
|
+
diagnostic?: BootstrapDiagnostic;
|
|
71
|
+
/** A billing outage keeps content preview available but cannot grant hosted editing. */
|
|
72
|
+
billingDiagnostic?: BootstrapDiagnostic;
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=bootstrap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../../src/contracts/bootstrap.ts"],"names":[],"mappings":"AAAA,iGAAiG;AACjG,MAAM,MAAM,gBAAgB,GACzB,kBAAkB,GAClB,oBAAoB,GACpB,sBAAsB,GACtB,eAAe,GACf,UAAU,GACV,iBAAiB,GACjB,kBAAkB,CAAA;AAErB,MAAM,WAAW,gBAAgB;IAChC,QAAQ,EAAE,WAAW,GAAG,SAAS,GAAG,IAAI,CAAA;IACxC,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,OAAO,CAAA;IAClB,OAAO,EAAE,OAAO,CAAA;IAChB,WAAW,EAAE,OAAO,CAAA;IACpB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAA;IAC9C,OAAO,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;CAC5D;AAED,MAAM,WAAW,aAAa;IAC7B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,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AAmB,CAAA;IAChC,wFAAwF;IACxF,iBAAiB,CAAC,EAAE,mBAAmB,CAAA;CACvC"}
|
|
@@ -8,9 +8,18 @@ interface FieldBase {
|
|
|
8
8
|
hidden?: boolean;
|
|
9
9
|
help?: string;
|
|
10
10
|
}
|
|
11
|
-
/**
|
|
12
|
-
|
|
11
|
+
/** Constraints shared by repeatable fields. Item count is independent of value limits. */
|
|
12
|
+
interface RepeatableField extends FieldBase {
|
|
13
|
+
multiple?: boolean;
|
|
14
|
+
/** Maximum entries when multiple is enabled; omitted means unlimited. */
|
|
15
|
+
maxItems?: number;
|
|
16
|
+
}
|
|
17
|
+
/** Text field */
|
|
18
|
+
export interface StringField extends RepeatableField {
|
|
13
19
|
type: "string";
|
|
20
|
+
/** Render stored inline HTML with the framework's explicit HTML binding.
|
|
21
|
+
* Adds the data-okno-html preview marker; does not change the raw string. */
|
|
22
|
+
html?: boolean;
|
|
14
23
|
default?: string;
|
|
15
24
|
placeholder?: string;
|
|
16
25
|
min?: number;
|
|
@@ -21,17 +30,17 @@ export interface StringField extends FieldBase {
|
|
|
21
30
|
phone?: boolean;
|
|
22
31
|
multiline?: boolean;
|
|
23
32
|
multiple?: boolean;
|
|
24
|
-
/** Slot definitions — slot name → kind
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
33
|
+
/** Slot definitions — slot name → kind. Configured Text fields are callable
|
|
34
|
+
* and fill `{name}` tokens, returning a wrapped string. Text parameters accept
|
|
35
|
+
* strings or numbers and insert their text without locale number formatting;
|
|
36
|
+
* Number parameters accept numbers without locale formatting; Count selects CLDR plural
|
|
37
|
+
* forms. Same interpolation primitive as strings-store slots — see `SlotKind`
|
|
38
|
+
* in `./schema.ts` and `docs/strings-i18n.md` §2. Single Text fields only
|
|
39
|
+
* (never richtext); declarations remain dormant while Multiple is enabled. */
|
|
31
40
|
slots?: Record<string, "text" | "number" | "count">;
|
|
32
41
|
}
|
|
33
42
|
/** Numeric field */
|
|
34
|
-
export interface NumberField extends
|
|
43
|
+
export interface NumberField extends RepeatableField {
|
|
35
44
|
type: "number";
|
|
36
45
|
default?: number;
|
|
37
46
|
min?: number;
|
|
@@ -47,10 +56,12 @@ export interface BooleanField extends FieldBase {
|
|
|
47
56
|
/** Date/datetime field */
|
|
48
57
|
export interface DateField extends FieldBase {
|
|
49
58
|
type: "date";
|
|
59
|
+
/** Include a local time in the editor and save edited instants as UTC ISO strings. */
|
|
60
|
+
time?: boolean;
|
|
50
61
|
default?: string | "now";
|
|
51
62
|
}
|
|
52
|
-
/** One Option choice: a human `name` (shown in the editor picker
|
|
53
|
-
*
|
|
63
|
+
/** One Option choice: a human `name` (shown in the editor picker and available as
|
|
64
|
+
* `.name`) mapped to a stored `value` (what's saved, and what `.value`
|
|
54
65
|
* exposes to consumers). A bare string is shorthand for `{ name: s, value: s }`
|
|
55
66
|
* — back-compat with the old plain-string options. */
|
|
56
67
|
export interface EnumOption {
|
|
@@ -60,9 +71,9 @@ export interface EnumOption {
|
|
|
60
71
|
/** Dropdown / multi-select. `options` are name→value pairs; the editor stores
|
|
61
72
|
* the `value`(s), and the runtime hydrates each stored value back to
|
|
62
73
|
* `{ name, value }` (from the schema) so consumers get both the human label
|
|
63
|
-
* and the stored value — `{home.size}` renders the
|
|
64
|
-
* gives the value. Mirrors how reference fields resolve a slug to its item. */
|
|
65
|
-
export interface EnumField extends
|
|
74
|
+
* and the stored value — `{home.size}` renders the stored value, `home.size.name`
|
|
75
|
+
* gives the label and `home.size.value` returns a raw string. Mirrors how reference fields resolve a slug to its item. */
|
|
76
|
+
export interface EnumField extends RepeatableField {
|
|
66
77
|
type: "enum";
|
|
67
78
|
options: (EnumOption | string)[];
|
|
68
79
|
multiple?: boolean;
|
|
@@ -84,13 +95,23 @@ export type MediaKind = "image" | "video" | "audio" | "document";
|
|
|
84
95
|
* split: a hero image is `{ accept: ["image"] }`, a photo+clip gallery is
|
|
85
96
|
* `{ accept: ["image", "video"], multiple: true }`, downloadable docs are
|
|
86
97
|
* `{ accept: ["document"], multiple: true }`. */
|
|
87
|
-
export interface MediaField extends
|
|
98
|
+
export interface MediaField extends RepeatableField {
|
|
88
99
|
type: "media";
|
|
89
100
|
accept?: MediaKind[];
|
|
90
101
|
multiple?: boolean;
|
|
91
102
|
/** Files folder this field's uploads are saved to (folder id, "" = root). */
|
|
92
103
|
uploadFolder?: string;
|
|
93
104
|
}
|
|
105
|
+
/** SVG icon selected from the Files library. */
|
|
106
|
+
export interface IconField extends RepeatableField {
|
|
107
|
+
type: "icon";
|
|
108
|
+
/** Ordinary Files folder id: restricts selection and receives uploads. */
|
|
109
|
+
folder?: string;
|
|
110
|
+
}
|
|
111
|
+
export interface IconValue {
|
|
112
|
+
src: string;
|
|
113
|
+
viewBox: string;
|
|
114
|
+
}
|
|
94
115
|
/** Color field — stores a raw CSS color string (any valid CSS color). Edited
|
|
95
116
|
* via a dependency-free HSV picker. Foundation for the Theme global. */
|
|
96
117
|
export interface ColorField extends FieldBase {
|
|
@@ -99,7 +120,7 @@ export interface ColorField extends FieldBase {
|
|
|
99
120
|
}
|
|
100
121
|
/** Link field — stores `{ text, url, external }`. Spreads onto an `<a>`
|
|
101
122
|
* (url→href, +target/rel when external) and renders its text as the child. */
|
|
102
|
-
export interface LinkField extends
|
|
123
|
+
export interface LinkField extends RepeatableField {
|
|
103
124
|
type: "link";
|
|
104
125
|
multiple?: boolean;
|
|
105
126
|
}
|
|
@@ -110,7 +131,7 @@ export interface SlugField extends FieldBase {
|
|
|
110
131
|
from?: string;
|
|
111
132
|
}
|
|
112
133
|
/** Reference to another collection */
|
|
113
|
-
export interface ReferenceField extends
|
|
134
|
+
export interface ReferenceField extends RepeatableField {
|
|
114
135
|
type: "reference";
|
|
115
136
|
collection: string;
|
|
116
137
|
multiple?: boolean;
|
|
@@ -123,7 +144,7 @@ export interface GroupField {
|
|
|
123
144
|
/** One or more embedded instances of a reusable Block (a named field shape from
|
|
124
145
|
* `schema.blocks`). Each placement owns its OWN values — an embed, not a
|
|
125
146
|
* reference. `multiple` makes it a repeatable array of instances. */
|
|
126
|
-
export interface BlockField extends
|
|
147
|
+
export interface BlockField extends RepeatableField {
|
|
127
148
|
type: "block";
|
|
128
149
|
/** One permitted block shape (the original, compact form). */
|
|
129
150
|
block?: string;
|
|
@@ -145,6 +166,6 @@ export interface DividerField {
|
|
|
145
166
|
collapsed?: boolean;
|
|
146
167
|
}
|
|
147
168
|
/** Union of all field types */
|
|
148
|
-
export type AnyField = StringField | NumberField | BooleanField | DateField | EnumField | RichtextField | MediaField | ColorField | LinkField | SlugField | ReferenceField | GroupField | BlockField | DividerField;
|
|
169
|
+
export type AnyField = StringField | NumberField | BooleanField | DateField | EnumField | RichtextField | MediaField | IconField | ColorField | LinkField | SlugField | ReferenceField | GroupField | BlockField | DividerField;
|
|
149
170
|
export {};
|
|
150
171
|
//# sourceMappingURL=fields.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fields.d.ts","sourceRoot":"","sources":["../../src/contracts/fields.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,UAAU,SAAS;IAClB;+CAC2C;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,IAAI,CAAC,EAAE,MAAM,CAAA;CACb;AAED,0FAA0F;AAC1F,UAAU,eAAgB,SAAQ,SAAS;IAC1C,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,yEAAyE;IACzE,QAAQ,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,iBAAiB;AACjB,MAAM,WAAW,WAAY,SAAQ,eAAe;IACnD,IAAI,EAAE,QAAQ,CAAA;IACd;iFAC6E;IAC7E,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAA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,eAAe;IACtD,IAAI,EAAE,WAAW,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,yBAAyB;AACzB,MAAM,WAAW,UAAU;IAC1B,IAAI,EAAE,OAAO,CAAA;IACb,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;CAChC;AAED;;sEAEsE;AACtE,MAAM,WAAW,UAAW,SAAQ,eAAe;IAClD,IAAI,EAAE,OAAO,CAAA;IACb,8DAA8D;IAC9D,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;uEAEmE;IACnE,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAA;CAClB;AAED;;;4CAG4C;AAC5C,MAAM,WAAW,YAAY;IAC5B,IAAI,EAAE,SAAS,CAAA;IACf,yCAAyC;IACzC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,mCAAmC;IACnC,SAAS,CAAC,EAAE,OAAO,CAAA;CACnB;AAED,+BAA+B;AAC/B,MAAM,MAAM,QAAQ,GACjB,WAAW,GACX,WAAW,GACX,YAAY,GACZ,SAAS,GACT,SAAS,GACT,aAAa,GACb,UAAU,GACV,SAAS,GACT,UAAU,GACV,SAAS,GACT,SAAS,GACT,cAAc,GACd,UAAU,GACV,UAAU,GACV,YAAY,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type { StringField, NumberField, BooleanField, DateField, EnumField, EnumOption, RichtextField, MediaField, IconField, IconValue, MediaKind, SlugField, ReferenceField, GroupField, BlockField, DividerField, AnyField, } from "./fields.ts";
|
|
2
|
+
export type { Fields, PageDef, CollectionDef, GlobalDef, BlockDef, OknoSchema, Schema, OknoConfig, LayoutNode, SchemaLayout, OknoLocale, SchemaLocales, } from "./schema.ts";
|
|
3
|
+
export type { ResourcePermissions, RolePermissions, PermissionsConfig } from "./permissions.ts";
|
|
4
|
+
export type { BootstrapOutcome, BootstrapBilling, BootstrapUser, BootstrapDiagnostic, BootstrapResponse, } from "./bootstrap.ts";
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/contracts/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACX,WAAW,EACX,WAAW,EACX,YAAY,EACZ,SAAS,EACT,SAAS,EACT,UAAU,EACV,aAAa,EACb,UAAU,EACV,SAAS,EACT,SAAS,EACT,SAAS,EACT,SAAS,EACT,cAAc,EACd,UAAU,EACV,UAAU,EACV,YAAY,EACZ,QAAQ,GACR,MAAM,aAAa,CAAA;AAEpB,YAAY,EACX,MAAM,EACN,OAAO,EACP,aAAa,EACb,SAAS,EACT,QAAQ,EACR,UAAU,EACV,MAAM,EACN,UAAU,EACV,UAAU,EACV,YAAY,EACZ,UAAU,EACV,aAAa,GACb,MAAM,aAAa,CAAA;AAEpB,YAAY,EAAE,mBAAmB,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAE/F,YAAY,EACX,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,mBAAmB,EACnB,iBAAiB,GACjB,MAAM,gBAAgB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../src/contracts/permissions.ts"],"names":[],"mappings":"AAAA;6BAC6B;AAC7B,MAAM,WAAW,mBAAmB;IACnC,IAAI,EAAE,OAAO,CAAA;IACb,KAAK,EAAE,OAAO,CAAA;IACd,MAAM,EAAE,OAAO,CAAA;IACf,OAAO,EAAE,OAAO,CAAA;CAChB;AAED,kDAAkD;AAClD,MAAM,WAAW,eAAe;IAC/B,KAAK,EAAE,mBAAmB,CAAA;IAC1B,WAAW,EAAE,mBAAmB,CAAA;IAChC,OAAO,EAAE,mBAAmB,CAAA;IAC5B,KAAK,EAAE,mBAAmB,CAAA;IAC1B,WAAW,EAAE,mBAAmB,CAAA;CAChC;AAED;yEACyE;AACzE,MAAM,WAAW,iBAAiB;IACjC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAA;CACtC"}
|
|
@@ -20,11 +20,11 @@ export interface CollectionDef {
|
|
|
20
20
|
* (drag-to-reorder, create, delete); drives `okno:collections` iteration. */
|
|
21
21
|
order?: string[];
|
|
22
22
|
/** Draft workflow. ON by default — set `false` to opt OUT. Items carry a
|
|
23
|
-
* `
|
|
24
|
-
* `
|
|
25
|
-
* references to them resolve to nothing too). A missing
|
|
23
|
+
* reserved boolean `draft` the editor toggles, and items with
|
|
24
|
+
* `draft: true` are EXCLUDED from `okno/collections` at build (so
|
|
25
|
+
* references to them resolve to nothing too). A missing flag counts as live,
|
|
26
26
|
* so nothing disappears from an existing collection. `false` → the collection
|
|
27
|
-
* has no status
|
|
27
|
+
* has no draft workflow. `status` remains an ordinary custom field. Orthogonal to git publish: a draft item still
|
|
28
28
|
* lives in the repo, it just isn't served. */
|
|
29
29
|
drafts?: boolean;
|
|
30
30
|
/** Scheduled publishing. ON by default — set `false` to opt OUT. Items may carry
|
|
@@ -85,7 +85,7 @@ export interface SchemaLayout {
|
|
|
85
85
|
blocks?: LayoutNode[];
|
|
86
86
|
}
|
|
87
87
|
/** The kind of a string slot — drives the param type codegen emits and the
|
|
88
|
-
* runtime fill. `text` →
|
|
88
|
+
* runtime fill. `text` → string/number text, `number` → plain numeric text,
|
|
89
89
|
* `count` → the reserved slot that selects CLDR plural forms. v1 ships these
|
|
90
90
|
* three; `select`/`date` come later. See `docs/strings-i18n.md` §2. */
|
|
91
91
|
export type SlotKind = "text" | "number" | "count";
|
|
@@ -149,13 +149,11 @@ export interface OknoConfig {
|
|
|
149
149
|
apiUrl?: string;
|
|
150
150
|
/** Whether this is the editor build (disables HMR on content changes) */
|
|
151
151
|
isEditor?: boolean;
|
|
152
|
-
/**
|
|
153
|
-
*
|
|
154
|
-
*
|
|
155
|
-
*
|
|
156
|
-
*
|
|
157
|
-
* to load `dist/editor` instead. Rebuild okno (`bun run build:pkg`) to pick up
|
|
158
|
-
* editor changes. No-op for a normal `npm install` (no source present). */
|
|
152
|
+
/** Use the compiled editor bundle (the default), including linked packages.
|
|
153
|
+
* Set false explicitly for internal editor source HMR; this requires the
|
|
154
|
+
* consumer's Svelte toolchain and editor dependencies. Source HMR applies
|
|
155
|
+
* only during dev when the checkout's editor source is present. Builds and
|
|
156
|
+
* normal installed packages always use the compiled editor. */
|
|
159
157
|
builtEditor?: boolean;
|
|
160
158
|
/** Public demo mode: the editor boots login-less, reads content from a
|
|
161
159
|
* static `okno-demo.json` snapshot, and no-ops every write (nothing is
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/contracts/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEtD,iEAAiE;AACjE,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;AAE7C,iDAAiD;AACjD,MAAM,WAAW,OAAO;IACvB,8EAA8E;IAC9E,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;+EAC2E;IAC3E,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;CACd;AAED,gEAAgE;AAChE,MAAM,WAAW,aAAa;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;;;kFAI8E;IAC9E,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;IAChB;;;;;;mDAM+C;IAC/C,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB;;;;;;;;qFAQiF;IACjF,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB;;sDAEkD;IAClD,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,GAAG;QAChB,IAAI,EAAE,SAAS,CA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M,CAAA;IACf,SAAS,EAAE,UAAU,EAAE,GAAG,MAAM,EAAE,CAAA;CAClC;AAED,0DAA0D;AAC1D,MAAM,WAAW,UAAU;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAA;IAC3C,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;IACnC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;IACjC,gFAAgF;IAChF,MAAM,CAAC,EAAE,YAAY,CAAA;IACrB,8EAA8E;IAC9E,OAAO,CAAC,EAAE,aAAa,CAAA;IACvB;;4DAEwD;IACxD,OAAO,CAAC,EAAE,aAAa,CAAA;CACvB;AAED;yDACyD;AACzD,MAAM,MAAM,MAAM,GAAG,UAAU,CAAA;AAE/B,2BAA2B;AAC3B,MAAM,WAAW,UAAU;IAC1B,2DAA2D;IAC3D,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,4EAA4E;IAC5E,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,yEAAyE;IACzE,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;;;oEAIgE;IAChE,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB;;;2EAGuE;IACvE,IAAI,CAAC,EAAE,OAAO,CAAA;IACd;;8EAE0E;IAC1E,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,iCAAiC;IACjC,OAAO,CAAC,EAAE;QACT,2CAA2C;QAC3C,OAAO,EAAE,MAAM,CAAA;QACf,uDAAuD;QACvD,SAAS,EAAE,MAAM,EAAE,CAAA;KACnB,CAAA;CACD"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type SchemaObj } from "./schema.ts";
|
|
2
|
+
export declare function isReservedCreationPath(path: string): boolean;
|
|
3
|
+
/** Shared owner resolution for current per-record and older collection modules. */
|
|
4
|
+
export declare function contentOwnerForPath(path: string, schema: SchemaObj): {
|
|
5
|
+
kind: string;
|
|
6
|
+
name: string;
|
|
7
|
+
} | undefined;
|
|
8
|
+
/** IO callers share collection ownership and new-write validation. Reads keep
|
|
9
|
+
* malformed flags/envelopes intact rather than deleting recoverable content. */
|
|
10
|
+
export declare function normalizeCollectionContent(path: string, schema: SchemaObj, value: unknown, options?: {
|
|
11
|
+
forWrite?: boolean;
|
|
12
|
+
}): unknown;
|
|
13
|
+
//# sourceMappingURL=content-path.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content-path.d.ts","sourceRoot":"","sources":["../../src/core/content-path.ts"],"names":[],"mappings":"AAIA,OAAO,EAAe,KAAK,SAAS,EAAE,MAAM,aAAa,CAAA;AAEzD,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE5D;AAED,mFAAmF;AACnF,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAO/G;AAED;gFACgF;AAChF,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,GAAE;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAO,GAAG,OAAO,CAWzI"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
type Def = {
|
|
2
|
+
type?: string;
|
|
3
|
+
required?: boolean;
|
|
4
|
+
multiple?: boolean;
|
|
5
|
+
collection?: string;
|
|
6
|
+
block?: string;
|
|
7
|
+
blocks?: string[];
|
|
8
|
+
fields?: Fields;
|
|
9
|
+
options?: Array<string | {
|
|
10
|
+
value?: string;
|
|
11
|
+
}>;
|
|
12
|
+
};
|
|
13
|
+
type Fields = Record<string, Def>;
|
|
14
|
+
export type ContentSchema = {
|
|
15
|
+
pages?: Record<string, {
|
|
16
|
+
fields?: Fields;
|
|
17
|
+
}>;
|
|
18
|
+
collections?: Record<string, {
|
|
19
|
+
fields?: Fields;
|
|
20
|
+
}>;
|
|
21
|
+
globals?: Record<string, {
|
|
22
|
+
fields?: Fields;
|
|
23
|
+
}>;
|
|
24
|
+
blocks?: Record<string, {
|
|
25
|
+
fields?: Fields;
|
|
26
|
+
}>;
|
|
27
|
+
locales?: {
|
|
28
|
+
supported?: Array<string | {
|
|
29
|
+
id?: string;
|
|
30
|
+
}>;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
export type ContentIssue = {
|
|
34
|
+
path: string;
|
|
35
|
+
message: string;
|
|
36
|
+
fatal?: boolean;
|
|
37
|
+
code?: "required_missing";
|
|
38
|
+
};
|
|
39
|
+
export type ContentRecord = {
|
|
40
|
+
kind: "pages" | "globals" | "collections";
|
|
41
|
+
name: string;
|
|
42
|
+
locale?: string;
|
|
43
|
+
value: Record<string, unknown>;
|
|
44
|
+
};
|
|
45
|
+
/** Normalize only the former collection publication flag. Missing metadata
|
|
46
|
+
* stays absent so a locale override cannot reset the base record's draft. */
|
|
47
|
+
export declare function normalizeCollectionDraft(record: Record<string, unknown>, fields?: Record<string, unknown>): Record<string, unknown>;
|
|
48
|
+
/** Validate supplied records in order against the caller's reference inventory.
|
|
49
|
+
* Localized records are partial overrides; references always use the inventory
|
|
50
|
+
* supplied by the caller. Returns diagnostics without IO or warning policy. */
|
|
51
|
+
export declare function validateContentRecords(schema: ContentSchema, records: readonly ContentRecord[], refs: ReadonlyMap<string, ReadonlySet<string>>): ContentIssue[];
|
|
52
|
+
export {};
|
|
53
|
+
//# sourceMappingURL=content.d.ts.map
|