davaux 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BASELINE.md +169 -0
- package/CLAUDE.md +518 -0
- package/LICENSE +21 -0
- package/README.md +36 -0
- package/ROADMAP.md +198 -0
- package/build.mjs +101 -0
- package/client/control.ts +247 -0
- package/client/hydrate.ts +37 -0
- package/client/index.ts +19 -0
- package/client/jsx-runtime.ts +209 -0
- package/client/resource.ts +122 -0
- package/client/signal.ts +211 -0
- package/client/store.ts +110 -0
- package/client/useHead.ts +63 -0
- package/dist/build/config.d.ts +3 -0
- package/dist/build/config.d.ts.map +1 -0
- package/dist/build/config.js +38 -0
- package/dist/build/config.js.map +7 -0
- package/dist/build/index.d.ts +2 -0
- package/dist/build/index.d.ts.map +1 -0
- package/dist/build/index.js +13 -0
- package/dist/build/index.js.map +7 -0
- package/dist/build/plugins.d.ts +7 -0
- package/dist/build/plugins.d.ts.map +1 -0
- package/dist/build/plugins.js +85 -0
- package/dist/build/plugins.js.map +7 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +427 -0
- package/dist/cli.js.map +7 -0
- package/dist/client/control.d.ts +49 -0
- package/dist/client/control.d.ts.map +1 -0
- package/dist/client/control.js +154 -0
- package/dist/client/control.js.map +7 -0
- package/dist/client/hydrate.d.ts +7 -0
- package/dist/client/hydrate.d.ts.map +1 -0
- package/dist/client/hydrate.js +23 -0
- package/dist/client/hydrate.js.map +7 -0
- package/dist/client/index.d.ts +12 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +32 -0
- package/dist/client/index.js.map +7 -0
- package/dist/client/jsx-runtime.d.ts +40 -0
- package/dist/client/jsx-runtime.d.ts.map +1 -0
- package/dist/client/jsx-runtime.js +139 -0
- package/dist/client/jsx-runtime.js.map +7 -0
- package/dist/client/resource.d.ts +31 -0
- package/dist/client/resource.d.ts.map +1 -0
- package/dist/client/resource.js +64 -0
- package/dist/client/resource.js.map +7 -0
- package/dist/client/signal.d.ts +90 -0
- package/dist/client/signal.d.ts.map +1 -0
- package/dist/client/signal.js +115 -0
- package/dist/client/signal.js.map +7 -0
- package/dist/client/store.d.ts +26 -0
- package/dist/client/store.d.ts.map +1 -0
- package/dist/client/store.js +63 -0
- package/dist/client/store.js.map +7 -0
- package/dist/client/useHead.d.ts +28 -0
- package/dist/client/useHead.d.ts.map +1 -0
- package/dist/client/useHead.js +33 -0
- package/dist/client/useHead.js.map +7 -0
- package/dist/config.d.ts +182 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +21 -0
- package/dist/config.js.map +7 -0
- package/dist/create-multisite.d.ts +2 -0
- package/dist/create-multisite.d.ts.map +1 -0
- package/dist/create-multisite.js +291 -0
- package/dist/create-multisite.js.map +7 -0
- package/dist/create.d.ts +2 -0
- package/dist/create.d.ts.map +1 -0
- package/dist/create.js +179 -0
- package/dist/create.js.map +7 -0
- package/dist/dev/blueprints.d.ts +11 -0
- package/dist/dev/blueprints.d.ts.map +1 -0
- package/dist/dev/blueprints.js +65 -0
- package/dist/dev/blueprints.js.map +7 -0
- package/dist/dev/components.d.ts +19 -0
- package/dist/dev/components.d.ts.map +1 -0
- package/dist/dev/components.js +87 -0
- package/dist/dev/components.js.map +7 -0
- package/dist/dev/insert.d.ts +11 -0
- package/dist/dev/insert.d.ts.map +1 -0
- package/dist/dev/insert.js +160 -0
- package/dist/dev/insert.js.map +7 -0
- package/dist/dev/remove.d.ts +53 -0
- package/dist/dev/remove.d.ts.map +1 -0
- package/dist/dev/remove.js +518 -0
- package/dist/dev/remove.js.map +7 -0
- package/dist/dev/watch.d.ts +26 -0
- package/dist/dev/watch.d.ts.map +1 -0
- package/dist/dev/watch.js +2905 -0
- package/dist/dev/watch.js.map +7 -0
- package/dist/errors.d.ts +6 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +63 -0
- package/dist/errors.js.map +7 -0
- package/dist/generate.d.ts +2 -0
- package/dist/generate.d.ts.map +1 -0
- package/dist/generate.js +191 -0
- package/dist/generate.js.map +7 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +57 -0
- package/dist/index.js.map +7 -0
- package/dist/island.d.ts +24 -0
- package/dist/island.d.ts.map +1 -0
- package/dist/island.js +15 -0
- package/dist/island.js.map +7 -0
- package/dist/jsx-runtime.d.ts +406 -0
- package/dist/jsx-runtime.d.ts.map +1 -0
- package/dist/jsx-runtime.js +90 -0
- package/dist/jsx-runtime.js.map +7 -0
- package/dist/link.d.ts +27 -0
- package/dist/link.d.ts.map +1 -0
- package/dist/link.js +29 -0
- package/dist/link.js.map +7 -0
- package/dist/oml/fragment.d.ts +16 -0
- package/dist/oml/fragment.d.ts.map +1 -0
- package/dist/oml/fragment.js +26 -0
- package/dist/oml/fragment.js.map +7 -0
- package/dist/oml/index.d.ts +11 -0
- package/dist/oml/index.d.ts.map +1 -0
- package/dist/oml/index.js +21 -0
- package/dist/oml/index.js.map +7 -0
- package/dist/oml/jsx-runtime.d.ts +34 -0
- package/dist/oml/jsx-runtime.d.ts.map +1 -0
- package/dist/oml/jsx-runtime.js +59 -0
- package/dist/oml/jsx-runtime.js.map +7 -0
- package/dist/oml/jsx.d.ts +14 -0
- package/dist/oml/jsx.d.ts.map +1 -0
- package/dist/oml/jsx.js +96 -0
- package/dist/oml/jsx.js.map +7 -0
- package/dist/oml/page.d.ts +7 -0
- package/dist/oml/page.d.ts.map +1 -0
- package/dist/oml/page.js +6 -0
- package/dist/oml/page.js.map +7 -0
- package/dist/oml/render.d.ts +13 -0
- package/dist/oml/render.d.ts.map +1 -0
- package/dist/oml/render.js +117 -0
- package/dist/oml/render.js.map +7 -0
- package/dist/oml/types.d.ts +79 -0
- package/dist/oml/types.d.ts.map +1 -0
- package/dist/oml/types.js +64 -0
- package/dist/oml/types.js.map +7 -0
- package/dist/router/handler.d.ts +53 -0
- package/dist/router/handler.d.ts.map +1 -0
- package/dist/router/handler.js +342 -0
- package/dist/router/handler.js.map +7 -0
- package/dist/router/matcher.d.ts +21 -0
- package/dist/router/matcher.d.ts.map +1 -0
- package/dist/router/matcher.js +28 -0
- package/dist/router/matcher.js.map +7 -0
- package/dist/router/scanner.d.ts +17 -0
- package/dist/router/scanner.d.ts.map +1 -0
- package/dist/router/scanner.js +197 -0
- package/dist/router/scanner.js.map +7 -0
- package/dist/server/index.d.ts +23 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +29 -0
- package/dist/server/index.js.map +7 -0
- package/dist/signal.d.ts +15 -0
- package/dist/signal.d.ts.map +1 -0
- package/dist/signal.js +29 -0
- package/dist/signal.js.map +7 -0
- package/dist/ssg.d.ts +45 -0
- package/dist/ssg.d.ts.map +1 -0
- package/dist/ssg.js +175 -0
- package/dist/ssg.js.map +7 -0
- package/dist/test/actions.test.d.ts +2 -0
- package/dist/test/actions.test.d.ts.map +1 -0
- package/dist/test/body-limits.test.d.ts +2 -0
- package/dist/test/body-limits.test.d.ts.map +1 -0
- package/dist/test/errors.test.d.ts +2 -0
- package/dist/test/errors.test.d.ts.map +1 -0
- package/dist/test/fixtures/routes/[id].page.d.ts +4 -0
- package/dist/test/fixtures/routes/[id].page.d.ts.map +1 -0
- package/dist/test/fixtures/routes/_error.d.ts +3 -0
- package/dist/test/fixtures/routes/_error.d.ts.map +1 -0
- package/dist/test/fixtures/routes/_global.d.ts +3 -0
- package/dist/test/fixtures/routes/_global.d.ts.map +1 -0
- package/dist/test/fixtures/routes/_layout-template.d.ts +3 -0
- package/dist/test/fixtures/routes/_layout-template.d.ts.map +1 -0
- package/dist/test/fixtures/routes/_layout.d.ts +3 -0
- package/dist/test/fixtures/routes/_layout.d.ts.map +1 -0
- package/dist/test/fixtures/routes/_layout_scripts.d.ts +3 -0
- package/dist/test/fixtures/routes/_layout_scripts.d.ts.map +1 -0
- package/dist/test/fixtures/routes/_middleware.d.ts +3 -0
- package/dist/test/fixtures/routes/_middleware.d.ts.map +1 -0
- package/dist/test/fixtures/routes/_redirect301_mw.d.ts +3 -0
- package/dist/test/fixtures/routes/_redirect301_mw.d.ts.map +1 -0
- package/dist/test/fixtures/routes/_redirect_mw.d.ts +3 -0
- package/dist/test/fixtures/routes/_redirect_mw.d.ts.map +1 -0
- package/dist/test/fixtures/routes/about.page.d.ts +3 -0
- package/dist/test/fixtures/routes/about.page.d.ts.map +1 -0
- package/dist/test/fixtures/routes/action.page.d.ts +6 -0
- package/dist/test/fixtures/routes/action.page.d.ts.map +1 -0
- package/dist/test/fixtures/routes/api/form-all.post.d.ts +3 -0
- package/dist/test/fixtures/routes/api/form-all.post.d.ts.map +1 -0
- package/dist/test/fixtures/routes/api/form-limited.post.d.ts +6 -0
- package/dist/test/fixtures/routes/api/form-limited.post.d.ts.map +1 -0
- package/dist/test/fixtures/routes/api/response-obj.get.d.ts +3 -0
- package/dist/test/fixtures/routes/api/response-obj.get.d.ts.map +1 -0
- package/dist/test/fixtures/routes/api/upload.post.d.ts +12 -0
- package/dist/test/fixtures/routes/api/upload.post.d.ts.map +1 -0
- package/dist/test/fixtures/routes/api/users.get.d.ts +6 -0
- package/dist/test/fixtures/routes/api/users.get.d.ts.map +1 -0
- package/dist/test/fixtures/routes/api/xml.get.d.ts +3 -0
- package/dist/test/fixtures/routes/api/xml.get.d.ts.map +1 -0
- package/dist/test/fixtures/routes/auth/_middleware.d.ts +3 -0
- package/dist/test/fixtures/routes/auth/_middleware.d.ts.map +1 -0
- package/dist/test/fixtures/routes/auth/protected.page.d.ts +3 -0
- package/dist/test/fixtures/routes/auth/protected.page.d.ts.map +1 -0
- package/dist/test/fixtures/routes/index.page.d.ts +3 -0
- package/dist/test/fixtures/routes/index.page.d.ts.map +1 -0
- package/dist/test/fixtures/routes/oml.page.d.ts +3 -0
- package/dist/test/fixtures/routes/oml.page.d.ts.map +1 -0
- package/dist/test/fixtures/routes/redirect.page.d.ts +3 -0
- package/dist/test/fixtures/routes/redirect.page.d.ts.map +1 -0
- package/dist/test/fixtures/routes/ssg/[slug].page.d.ts +5 -0
- package/dist/test/fixtures/routes/ssg/[slug].page.d.ts.map +1 -0
- package/dist/test/fixtures/routes/ssg/server.page.d.ts +4 -0
- package/dist/test/fixtures/routes/ssg/server.page.d.ts.map +1 -0
- package/dist/test/fixtures/routes/state.page.d.ts +3 -0
- package/dist/test/fixtures/routes/state.page.d.ts.map +1 -0
- package/dist/test/fixtures/routes/throw.page.d.ts +3 -0
- package/dist/test/fixtures/routes/throw.page.d.ts.map +1 -0
- package/dist/test/fixtures/routes/wiki/[...slug].page.d.ts +3 -0
- package/dist/test/fixtures/routes/wiki/[...slug].page.d.ts.map +1 -0
- package/dist/test/helpers.d.ts +37 -0
- package/dist/test/helpers.d.ts.map +1 -0
- package/dist/test/layouts.test.d.ts +2 -0
- package/dist/test/layouts.test.d.ts.map +1 -0
- package/dist/test/middleware.test.d.ts +2 -0
- package/dist/test/middleware.test.d.ts.map +1 -0
- package/dist/test/multipart.test.d.ts +2 -0
- package/dist/test/multipart.test.d.ts.map +1 -0
- package/dist/test/oml-routing.test.d.ts +2 -0
- package/dist/test/oml-routing.test.d.ts.map +1 -0
- package/dist/test/oml.test.d.ts +2 -0
- package/dist/test/oml.test.d.ts.map +1 -0
- package/dist/test/redirects.test.d.ts +2 -0
- package/dist/test/redirects.test.d.ts.map +1 -0
- package/dist/test/routing.test.d.ts +2 -0
- package/dist/test/routing.test.d.ts.map +1 -0
- package/dist/test/ssg.test.d.ts +2 -0
- package/dist/test/ssg.test.d.ts.map +1 -0
- package/dist/test/web-response.test.d.ts +2 -0
- package/dist/test/web-response.test.d.ts.map +1 -0
- package/dist/types.d.ts +314 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +292 -0
- package/dist/types.js.map +7 -0
- package/package.json +103 -0
- package/pka.config.json +32 -0
- package/src/build/config.ts +42 -0
- package/src/build/index.ts +6 -0
- package/src/build/plugins.ts +118 -0
- package/src/cli.ts +502 -0
- package/src/config.ts +197 -0
- package/src/create-multisite.ts +310 -0
- package/src/create.ts +194 -0
- package/src/dev/blueprints.ts +75 -0
- package/src/dev/components.ts +108 -0
- package/src/dev/insert.ts +221 -0
- package/src/dev/remove.ts +677 -0
- package/src/dev/watch.ts +3098 -0
- package/src/env.d.ts +5 -0
- package/src/errors.ts +64 -0
- package/src/generate.ts +228 -0
- package/src/index.ts +67 -0
- package/src/island.ts +47 -0
- package/src/jsx-runtime.d.ts +408 -0
- package/src/jsx-runtime.d.ts.map +1 -0
- package/src/jsx-runtime.ts +536 -0
- package/src/link.ts +49 -0
- package/src/oml/fragment.ts +54 -0
- package/src/oml/index.ts +21 -0
- package/src/oml/jsx-runtime.ts +121 -0
- package/src/oml/jsx.ts +151 -0
- package/src/oml/page.ts +13 -0
- package/src/oml/render.ts +181 -0
- package/src/oml/types.ts +159 -0
- package/src/router/handler.ts +515 -0
- package/src/router/matcher.ts +52 -0
- package/src/router/scanner.ts +272 -0
- package/src/server/index.ts +49 -0
- package/src/signal.ts +39 -0
- package/src/ssg.ts +253 -0
- package/src/test/actions.test.ts +40 -0
- package/src/test/body-limits.test.ts +83 -0
- package/src/test/errors.test.ts +53 -0
- package/src/test/fixtures/routes/[id].page.ts +3 -0
- package/src/test/fixtures/routes/_error.ts +6 -0
- package/src/test/fixtures/routes/_global.ts +8 -0
- package/src/test/fixtures/routes/_layout-template.ts +7 -0
- package/src/test/fixtures/routes/_layout.ts +7 -0
- package/src/test/fixtures/routes/_layout_scripts.ts +8 -0
- package/src/test/fixtures/routes/_middleware.ts +8 -0
- package/src/test/fixtures/routes/_redirect301_mw.ts +5 -0
- package/src/test/fixtures/routes/_redirect_mw.ts +5 -0
- package/src/test/fixtures/routes/about.page.ts +6 -0
- package/src/test/fixtures/routes/action.page.ts +11 -0
- package/src/test/fixtures/routes/api/form-all.post.ts +5 -0
- package/src/test/fixtures/routes/api/form-limited.post.ts +6 -0
- package/src/test/fixtures/routes/api/response-obj.get.ts +17 -0
- package/src/test/fixtures/routes/api/upload.post.ts +14 -0
- package/src/test/fixtures/routes/api/users.get.ts +3 -0
- package/src/test/fixtures/routes/api/xml.get.ts +5 -0
- package/src/test/fixtures/routes/auth/_middleware.ts +11 -0
- package/src/test/fixtures/routes/auth/protected.page.ts +3 -0
- package/src/test/fixtures/routes/index.page.ts +3 -0
- package/src/test/fixtures/routes/oml.page.ts +7 -0
- package/src/test/fixtures/routes/redirect.page.ts +3 -0
- package/src/test/fixtures/routes/ssg/[slug].page.ts +8 -0
- package/src/test/fixtures/routes/ssg/server.page.ts +5 -0
- package/src/test/fixtures/routes/state.page.ts +4 -0
- package/src/test/fixtures/routes/throw.page.ts +5 -0
- package/src/test/fixtures/routes/wiki/[...slug].page.ts +3 -0
- package/src/test/helpers.ts +132 -0
- package/src/test/layouts.test.ts +76 -0
- package/src/test/middleware.test.ts +69 -0
- package/src/test/multipart.test.ts +91 -0
- package/src/test/oml-routing.test.ts +59 -0
- package/src/test/oml.test.ts +429 -0
- package/src/test/redirects.test.ts +32 -0
- package/src/test/routing.test.ts +118 -0
- package/src/test/ssg.test.ts +273 -0
- package/src/test/web-response.test.ts +33 -0
- package/src/types.ts +670 -0
- package/tsconfig.client.json +17 -0
- package/tsconfig.json +20 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const registry = /* @__PURE__ */ new Set();
|
|
2
|
+
function clearAllFragments() {
|
|
3
|
+
for (const cache of registry) cache.clear();
|
|
4
|
+
}
|
|
5
|
+
function defineFragment(fn, options) {
|
|
6
|
+
const cache = /* @__PURE__ */ new Map();
|
|
7
|
+
registry.add(cache);
|
|
8
|
+
return async (props) => {
|
|
9
|
+
const key = options?.key && props !== void 0 ? options.key(props) : JSON.stringify(props ?? null);
|
|
10
|
+
const entry = cache.get(key);
|
|
11
|
+
if (entry !== void 0) {
|
|
12
|
+
if (!options?.ttl || Date.now() - entry.at < options.ttl) {
|
|
13
|
+
return entry.node;
|
|
14
|
+
}
|
|
15
|
+
cache.delete(key);
|
|
16
|
+
}
|
|
17
|
+
const node = await fn(props);
|
|
18
|
+
cache.set(key, { node, at: Date.now() });
|
|
19
|
+
return node;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
clearAllFragments,
|
|
24
|
+
defineFragment
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=fragment.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/oml/fragment.ts"],
|
|
4
|
+
"sourcesContent": ["import type { OmlNode } from './types.js'\n\nexport type OmlFragmentOptions<P> = {\n /** Derive a stable string cache key from props. Defaults to JSON.stringify(props). */\n key?: (props: P) => string\n /** Time-to-live in milliseconds. Omit for indefinite caching. */\n ttl?: number\n}\n\ntype CacheEntry = { node: OmlNode; at: number }\n\nconst registry = new Set<Map<string, CacheEntry>>()\n\n/** Invalidate all fragment caches \u2014 useful after CMS updates or programmatic cache busting. */\nexport function clearAllFragments(): void {\n for (const cache of registry) cache.clear()\n}\n\n/** Define a cached, no-props OML fragment. The function runs once; subsequent calls return the cached node. */\nexport function defineFragment(\n fn: () => OmlNode | Promise<OmlNode>,\n options?: { ttl?: number },\n): () => Promise<OmlNode>\n\n/** Define a cached OML fragment that accepts props. Caches per unique prop combination. */\nexport function defineFragment<P extends Record<string, unknown>>(\n fn: (props: P) => OmlNode | Promise<OmlNode>,\n options?: OmlFragmentOptions<P>,\n): (props: P) => Promise<OmlNode>\n\nexport function defineFragment<P extends Record<string, unknown>>(\n fn: (props?: P) => OmlNode | Promise<OmlNode>,\n options?: OmlFragmentOptions<P>,\n): (props?: P) => Promise<OmlNode> {\n const cache = new Map<string, CacheEntry>()\n registry.add(cache)\n\n return async (props?: P): Promise<OmlNode> => {\n const key =\n options?.key && props !== undefined ? options.key(props) : JSON.stringify(props ?? null)\n\n const entry = cache.get(key)\n if (entry !== undefined) {\n if (!options?.ttl || Date.now() - entry.at < options.ttl) {\n return entry.node\n }\n cache.delete(key)\n }\n\n const node = await fn(props)\n cache.set(key, { node, at: Date.now() })\n return node\n }\n}\n"],
|
|
5
|
+
"mappings": "AAWA,MAAM,WAAW,oBAAI,IAA6B;AAG3C,SAAS,oBAA0B;AACxC,aAAW,SAAS,SAAU,OAAM,MAAM;AAC5C;AAcO,SAAS,eACd,IACA,SACiC;AACjC,QAAM,QAAQ,oBAAI,IAAwB;AAC1C,WAAS,IAAI,KAAK;AAElB,SAAO,OAAO,UAAgC;AAC5C,UAAM,MACJ,SAAS,OAAO,UAAU,SAAY,QAAQ,IAAI,KAAK,IAAI,KAAK,UAAU,SAAS,IAAI;AAEzF,UAAM,QAAQ,MAAM,IAAI,GAAG;AAC3B,QAAI,UAAU,QAAW;AACvB,UAAI,CAAC,SAAS,OAAO,KAAK,IAAI,IAAI,MAAM,KAAK,QAAQ,KAAK;AACxD,eAAO,MAAM;AAAA,MACf;AACA,YAAM,OAAO,GAAG;AAAA,IAClB;AAEA,UAAM,OAAO,MAAM,GAAG,KAAK;AAC3B,UAAM,IAAI,KAAK,EAAE,MAAM,IAAI,KAAK,IAAI,EAAE,CAAC;AACvC,WAAO;AAAA,EACT;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type { OmlFragmentOptions } from './fragment.js';
|
|
2
|
+
export { clearAllFragments, defineFragment } from './fragment.js';
|
|
3
|
+
export { blueprintToFile, renderToJsx } from './jsx.js';
|
|
4
|
+
export type { ComponentType as OmlComponentType, Props as OmlJsxProps } from './jsx-runtime.js';
|
|
5
|
+
export { Fragment, jsx, jsxDEV, jsxs } from './jsx-runtime.js';
|
|
6
|
+
export type { OmlPageHandler } from './page.js';
|
|
7
|
+
export { defineOmlPage } from './page.js';
|
|
8
|
+
export { renderToHtml } from './render.js';
|
|
9
|
+
export type { OmlBlueprint, OmlComponent, OmlElement, OmlFragment, OmlNode, OmlPropSchema, OmlProps, OmlPropType, OmlRaw, OmlText, } from './types.js';
|
|
10
|
+
export { parseOml, parseOmlBlueprint } from './types.js';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/oml/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AACvD,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AACjE,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AACvD,YAAY,EAAE,aAAa,IAAI,gBAAgB,EAAE,KAAK,IAAI,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC/F,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AAC9D,YAAY,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,YAAY,EACV,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,WAAW,EACX,OAAO,EACP,aAAa,EACb,QAAQ,EACR,WAAW,EACX,MAAM,EACN,OAAO,GACR,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { clearAllFragments, defineFragment } from "./fragment.js";
|
|
2
|
+
import { blueprintToFile, renderToJsx } from "./jsx.js";
|
|
3
|
+
import { Fragment, jsx, jsxDEV, jsxs } from "./jsx-runtime.js";
|
|
4
|
+
import { defineOmlPage } from "./page.js";
|
|
5
|
+
import { renderToHtml } from "./render.js";
|
|
6
|
+
import { parseOml, parseOmlBlueprint } from "./types.js";
|
|
7
|
+
export {
|
|
8
|
+
Fragment,
|
|
9
|
+
blueprintToFile,
|
|
10
|
+
clearAllFragments,
|
|
11
|
+
defineFragment,
|
|
12
|
+
defineOmlPage,
|
|
13
|
+
jsx,
|
|
14
|
+
jsxDEV,
|
|
15
|
+
jsxs,
|
|
16
|
+
parseOml,
|
|
17
|
+
parseOmlBlueprint,
|
|
18
|
+
renderToHtml,
|
|
19
|
+
renderToJsx
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/oml/index.ts"],
|
|
4
|
+
"sourcesContent": ["export type { OmlFragmentOptions } from './fragment.js'\nexport { clearAllFragments, defineFragment } from './fragment.js'\nexport { blueprintToFile, renderToJsx } from './jsx.js'\nexport type { ComponentType as OmlComponentType, Props as OmlJsxProps } from './jsx-runtime.js'\nexport { Fragment, jsx, jsxDEV, jsxs } from './jsx-runtime.js'\nexport type { OmlPageHandler } from './page.js'\nexport { defineOmlPage } from './page.js'\nexport { renderToHtml } from './render.js'\nexport type {\n OmlBlueprint,\n OmlComponent,\n OmlElement,\n OmlFragment,\n OmlNode,\n OmlPropSchema,\n OmlProps,\n OmlPropType,\n OmlRaw,\n OmlText,\n} from './types.js'\nexport { parseOml, parseOmlBlueprint } from './types.js'\n"],
|
|
5
|
+
"mappings": "AACA,SAAS,mBAAmB,sBAAsB;AAClD,SAAS,iBAAiB,mBAAmB;AAE7C,SAAS,UAAU,KAAK,QAAQ,YAAY;AAE5C,SAAS,qBAAqB;AAC9B,SAAS,oBAAoB;AAa7B,SAAS,UAAU,yBAAyB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { OmlNode } from './types.js';
|
|
2
|
+
type Primitive = string | number | boolean | null | undefined;
|
|
3
|
+
type Child = Primitive | Promise<OmlNode | string> | Child[];
|
|
4
|
+
export type Props = {
|
|
5
|
+
children?: Child | Child[];
|
|
6
|
+
key?: string | number;
|
|
7
|
+
ref?: unknown;
|
|
8
|
+
dangerouslySetInnerHTML?: {
|
|
9
|
+
__html: string;
|
|
10
|
+
};
|
|
11
|
+
style?: string | Record<string, string | number>;
|
|
12
|
+
className?: string;
|
|
13
|
+
htmlFor?: string;
|
|
14
|
+
tabIndex?: number;
|
|
15
|
+
[prop: string]: unknown;
|
|
16
|
+
};
|
|
17
|
+
export type ComponentType<P extends Props = Props> = (props: P) => Promise<OmlNode> | OmlNode;
|
|
18
|
+
export declare function jsx(type: string | ComponentType, props: Props, key?: string | number): Promise<OmlNode>;
|
|
19
|
+
export declare const jsxs: typeof jsx;
|
|
20
|
+
export declare const jsxDEV: typeof jsx;
|
|
21
|
+
export declare const Fragment = "__OmlFragment__";
|
|
22
|
+
import type { JSX as BaseJSX } from '../jsx-runtime.js';
|
|
23
|
+
export declare namespace JSX {
|
|
24
|
+
type Element = Promise<OmlNode | string>;
|
|
25
|
+
interface ElementChildrenAttribute {
|
|
26
|
+
children: object;
|
|
27
|
+
}
|
|
28
|
+
interface IntrinsicAttributes {
|
|
29
|
+
key?: string | number;
|
|
30
|
+
}
|
|
31
|
+
type IntrinsicElements = BaseJSX.IntrinsicElements;
|
|
32
|
+
}
|
|
33
|
+
export {};
|
|
34
|
+
//# sourceMappingURL=jsx-runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsx-runtime.d.ts","sourceRoot":"","sources":["../../src/oml/jsx-runtime.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAIV,OAAO,EAIR,MAAM,YAAY,CAAA;AAEnB,KAAK,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,CAAA;AAG7D,KAAK,KAAK,GAAG,SAAS,GAAG,OAAO,CAAC,OAAO,GAAG,MAAM,CAAC,GAAG,KAAK,EAAE,CAAA;AAE5D,MAAM,MAAM,KAAK,GAAG;IAClB,QAAQ,CAAC,EAAE,KAAK,GAAG,KAAK,EAAE,CAAA;IAC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(children) {
|
|
2
|
+
if (children == null || children === false) return [];
|
|
3
|
+
if (Array.isArray(children)) {
|
|
4
|
+
const parts = await Promise.all(children.map((c) => resolveChildren(c)));
|
|
5
|
+
return parts.flat();
|
|
6
|
+
}
|
|
7
|
+
if (children instanceof Promise) {
|
|
8
|
+
const resolved = await children;
|
|
9
|
+
if (resolved === null) return [];
|
|
10
|
+
if (typeof resolved === "string") return [{ type: "#raw", value: resolved }];
|
|
11
|
+
return [resolved];
|
|
12
|
+
}
|
|
13
|
+
if (typeof children === "boolean") return [];
|
|
14
|
+
const text = { type: "#text", value: String(children) };
|
|
15
|
+
return [text];
|
|
16
|
+
}
|
|
17
|
+
async function jsx(type, props, key) {
|
|
18
|
+
const { children, key: _key, ref: _ref, ...restProps } = props;
|
|
19
|
+
const id = key != null ? String(key) : void 0;
|
|
20
|
+
if (typeof type === "function") {
|
|
21
|
+
const result = type(props);
|
|
22
|
+
const rawResult = result instanceof Promise ? await result : result;
|
|
23
|
+
const resolved = typeof rawResult === "string" ? { type: "#raw", value: rawResult } : rawResult;
|
|
24
|
+
const resolvedChildren = await resolveChildren(children);
|
|
25
|
+
const node2 = {
|
|
26
|
+
type: "#component",
|
|
27
|
+
name: type.name || "Anonymous",
|
|
28
|
+
id,
|
|
29
|
+
props: restProps,
|
|
30
|
+
...resolvedChildren.length > 0 ? { children: resolvedChildren } : {},
|
|
31
|
+
output: resolved
|
|
32
|
+
};
|
|
33
|
+
return node2;
|
|
34
|
+
}
|
|
35
|
+
if (type === Fragment) {
|
|
36
|
+
const nodes2 = await resolveChildren(children);
|
|
37
|
+
const node2 = { type: "#fragment", children: nodes2 };
|
|
38
|
+
return node2;
|
|
39
|
+
}
|
|
40
|
+
const nodes = await resolveChildren(children);
|
|
41
|
+
const node = {
|
|
42
|
+
type: "element",
|
|
43
|
+
tag: type,
|
|
44
|
+
id,
|
|
45
|
+
props: restProps,
|
|
46
|
+
children: nodes
|
|
47
|
+
};
|
|
48
|
+
return node;
|
|
49
|
+
}
|
|
50
|
+
const jsxs = jsx;
|
|
51
|
+
const jsxDEV = jsx;
|
|
52
|
+
const Fragment = "__OmlFragment__";
|
|
53
|
+
export {
|
|
54
|
+
Fragment,
|
|
55
|
+
jsx,
|
|
56
|
+
jsxDEV,
|
|
57
|
+
jsxs
|
|
58
|
+
};
|
|
59
|
+
//# sourceMappingURL=jsx-runtime.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/oml/jsx-runtime.ts"],
|
|
4
|
+
"sourcesContent": ["// OML JSX runtime \u2014 produces an OmlNode tree instead of an HTML string.\n// Use via `jsxImportSource` in tsconfig, or import jsx directly for programmatic use.\n// Mirrors the API of src/jsx-runtime.ts; async components are fully supported.\n\nimport type {\n OmlComponent,\n OmlElement,\n OmlFragment,\n OmlNode,\n OmlProps,\n OmlRaw,\n OmlText,\n} from './types.js'\n\ntype Primitive = string | number | boolean | null | undefined\n// Promise<string> is included so standard-runtime components (e.g. @davaux/ui) can be used\n// as children in OML pages without TypeScript errors. The runtime handles both at render time.\ntype Child = Primitive | Promise<OmlNode | string> | Child[]\n\nexport type Props = {\n children?: Child | Child[]\n key?: string | number\n ref?: unknown\n dangerouslySetInnerHTML?: { __html: string }\n style?: string | Record<string, string | number>\n className?: string\n htmlFor?: string\n tabIndex?: number\n [prop: string]: unknown\n}\n\nexport type ComponentType<P extends Props = Props> = (props: P) => Promise<OmlNode> | OmlNode\n\nasync function resolveChildren(children: Child | Child[] | undefined): Promise<OmlNode[]> {\n if (children == null || children === false) return []\n if (Array.isArray(children)) {\n const parts = await Promise.all(children.map((c) => resolveChildren(c)))\n return parts.flat()\n }\n if (children instanceof Promise) {\n const resolved = await children\n if (resolved === null) return []\n // A Promise<string> carries raw HTML (e.g. layout children passed from renderPage).\n // Wrap as #raw so it passes through unescaped.\n if (typeof resolved === 'string') return [{ type: '#raw', value: resolved } satisfies OmlRaw]\n return [resolved as OmlNode]\n }\n if (typeof children === 'boolean') return []\n const text: OmlText = { type: '#text', value: String(children) }\n return [text]\n}\n\n// \u2500\u2500\u2500 JSX factory \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport async function jsx(\n type: string | ComponentType,\n props: Props,\n key?: string | number,\n): Promise<OmlNode> {\n const { children, key: _key, ref: _ref, ...restProps } = props\n const id = key != null ? String(key) : undefined\n\n if (typeof type === 'function') {\n const result = type(props)\n const rawResult = result instanceof Promise ? await result : result\n // Components may return raw HTML strings (e.g. island server stubs). Wrap in #raw so\n // renderToHtml passes the content through without escaping.\n const resolved: OmlNode =\n typeof rawResult === 'string'\n ? ({ type: '#raw', value: rawResult } satisfies OmlRaw)\n : (rawResult as OmlNode)\n const resolvedChildren = await resolveChildren(children)\n const node: OmlComponent = {\n type: '#component',\n name: type.name || 'Anonymous',\n id,\n props: restProps as OmlProps,\n ...(resolvedChildren.length > 0 ? { children: resolvedChildren } : {}),\n output: resolved,\n }\n return node\n }\n\n if (type === Fragment) {\n const nodes = await resolveChildren(children)\n const node: OmlFragment = { type: '#fragment', children: nodes }\n return node\n }\n\n const nodes = await resolveChildren(children)\n const node: OmlElement = {\n type: 'element',\n tag: type as string,\n id,\n props: restProps as OmlProps,\n children: nodes,\n }\n return node\n}\n\nexport const jsxs = jsx\nexport const jsxDEV = jsx\n\nexport const Fragment = '__OmlFragment__'\n\n// \u2500\u2500\u2500 JSX namespace \u2014 required for `jsxImportSource: \"davaux/oml\"` in tsconfig \u2500\u2500\n// Re-uses IntrinsicElements from the main runtime; only JSX.Element differs.\nimport type { JSX as BaseJSX } from '../jsx-runtime.js'\n\nexport namespace JSX {\n // Promise<string> is included so standard-runtime components are valid JSX elements\n // in OML pages (e.g. when jsxImportSource: \"davaux/oml\" is set globally in tsconfig).\n export type Element = Promise<OmlNode | string>\n export interface ElementChildrenAttribute {\n children: object\n }\n export interface IntrinsicAttributes {\n key?: string | number\n }\n export type IntrinsicElements = BaseJSX.IntrinsicElements\n}\n"],
|
|
5
|
+
"mappings": "AAiCA,eAAe,gBAAgB,UAA2D;AACxF,MAAI,YAAY,QAAQ,aAAa,MAAO,QAAO,CAAC;AACpD,MAAI,MAAM,QAAQ,QAAQ,GAAG;AAC3B,UAAM,QAAQ,MAAM,QAAQ,IAAI,SAAS,IAAI,CAAC,MAAM,gBAAgB,CAAC,CAAC,CAAC;AACvE,WAAO,MAAM,KAAK;AAAA,EACpB;AACA,MAAI,oBAAoB,SAAS;AAC/B,UAAM,WAAW,MAAM;AACvB,QAAI,aAAa,KAAM,QAAO,CAAC;AAG/B,QAAI,OAAO,aAAa,SAAU,QAAO,CAAC,EAAE,MAAM,QAAQ,OAAO,SAAS,CAAkB;AAC5F,WAAO,CAAC,QAAmB;AAAA,EAC7B;AACA,MAAI,OAAO,aAAa,UAAW,QAAO,CAAC;AAC3C,QAAM,OAAgB,EAAE,MAAM,SAAS,OAAO,OAAO,QAAQ,EAAE;AAC/D,SAAO,CAAC,IAAI;AACd;AAIA,eAAsB,IACpB,MACA,OACA,KACkB;AAClB,QAAM,EAAE,UAAU,KAAK,MAAM,KAAK,MAAM,GAAG,UAAU,IAAI;AACzD,QAAM,KAAK,OAAO,OAAO,OAAO,GAAG,IAAI;AAEvC,MAAI,OAAO,SAAS,YAAY;AAC9B,UAAM,SAAS,KAAK,KAAK;AACzB,UAAM,YAAY,kBAAkB,UAAU,MAAM,SAAS;AAG7D,UAAM,WACJ,OAAO,cAAc,WAChB,EAAE,MAAM,QAAQ,OAAO,UAAU,IACjC;AACP,UAAM,mBAAmB,MAAM,gBAAgB,QAAQ;AACvD,UAAMA,QAAqB;AAAA,MACzB,MAAM;AAAA,MACN,MAAM,KAAK,QAAQ;AAAA,MACnB;AAAA,MACA,OAAO;AAAA,MACP,GAAI,iBAAiB,SAAS,IAAI,EAAE,UAAU,iBAAiB,IAAI,CAAC;AAAA,MACpE,QAAQ;AAAA,IACV;AACA,WAAOA;AAAA,EACT;AAEA,MAAI,SAAS,UAAU;AACrB,UAAMC,SAAQ,MAAM,gBAAgB,QAAQ;AAC5C,UAAMD,QAAoB,EAAE,MAAM,aAAa,UAAUC,OAAM;AAC/D,WAAOD;AAAA,EACT;AAEA,QAAM,QAAQ,MAAM,gBAAgB,QAAQ;AAC5C,QAAM,OAAmB;AAAA,IACvB,MAAM;AAAA,IACN,KAAK;AAAA,IACL;AAAA,IACA,OAAO;AAAA,IACP,UAAU;AAAA,EACZ;AACA,SAAO;AACT;AAEO,MAAM,OAAO;AACb,MAAM,SAAS;AAEf,MAAM,WAAW;",
|
|
6
|
+
"names": ["node", "nodes"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { OmlBlueprint, OmlNode } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Render an OmlNode tree to a JSX expression string.
|
|
4
|
+
* `#component` nodes render as component invocations (`<Name prop="val" />`),
|
|
5
|
+
* not as their resolved output — preserving the component boundary.
|
|
6
|
+
*/
|
|
7
|
+
export declare function renderToJsx(node: OmlNode): string;
|
|
8
|
+
/**
|
|
9
|
+
* Convert an OmlBlueprint to a complete `.tsx` component file.
|
|
10
|
+
* Import paths are sourced from `blueprint.imports`; missing entries are
|
|
11
|
+
* left as bare identifiers for the developer to resolve.
|
|
12
|
+
*/
|
|
13
|
+
export declare function blueprintToFile(blueprint: OmlBlueprint): string;
|
|
14
|
+
//# sourceMappingURL=jsx.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsx.d.ts","sourceRoot":"","sources":["../../src/oml/jsx.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAe,MAAM,YAAY,CAAA;AAqGpE;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAEjD;AAID;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,YAAY,GAAG,MAAM,CA6B/D"}
|
package/dist/oml/jsx.js
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
const VOID_TAGS = /* @__PURE__ */ new Set([
|
|
2
|
+
"area",
|
|
3
|
+
"base",
|
|
4
|
+
"br",
|
|
5
|
+
"col",
|
|
6
|
+
"embed",
|
|
7
|
+
"hr",
|
|
8
|
+
"img",
|
|
9
|
+
"input",
|
|
10
|
+
"link",
|
|
11
|
+
"meta",
|
|
12
|
+
"param",
|
|
13
|
+
"source",
|
|
14
|
+
"track",
|
|
15
|
+
"wbr"
|
|
16
|
+
]);
|
|
17
|
+
const PROP_TS_TYPE = {
|
|
18
|
+
string: "string",
|
|
19
|
+
number: "number",
|
|
20
|
+
boolean: "boolean",
|
|
21
|
+
function: "() => void",
|
|
22
|
+
node: "string",
|
|
23
|
+
array: "unknown[]"
|
|
24
|
+
};
|
|
25
|
+
function escapeAttr(s) {
|
|
26
|
+
return s.replace(/&/g, "&").replace(/"/g, """);
|
|
27
|
+
}
|
|
28
|
+
function propToJsx(key, value) {
|
|
29
|
+
if (value === null || value === void 0) return "";
|
|
30
|
+
if (value === true) return ` ${key}`;
|
|
31
|
+
if (value === false) return ` ${key}={false}`;
|
|
32
|
+
if (typeof value === "string") return ` ${key}="${escapeAttr(value)}"`;
|
|
33
|
+
if (typeof value === "number") return ` ${key}={${value}}`;
|
|
34
|
+
return ` ${key}={${JSON.stringify(value)}}`;
|
|
35
|
+
}
|
|
36
|
+
function propsToJsx(props) {
|
|
37
|
+
return Object.entries(props).filter(([k]) => k !== "dangerouslySetInnerHTML" && k !== "key" && k !== "ref").map(([k, v]) => propToJsx(k, v)).join("");
|
|
38
|
+
}
|
|
39
|
+
function nodeToJsx(node, depth) {
|
|
40
|
+
if (node === null) return "";
|
|
41
|
+
const pad = " ".repeat(depth);
|
|
42
|
+
const childPad = " ".repeat(depth + 1);
|
|
43
|
+
if (node.type === "#text") return node.value;
|
|
44
|
+
if (node.type === "#fragment") {
|
|
45
|
+
if (node.children.length === 0) return "<></>";
|
|
46
|
+
const children2 = node.children.map((c) => nodeToJsx(c, depth + 1)).filter(Boolean).map((c) => `${childPad}${c}`).join("\n");
|
|
47
|
+
return `<>
|
|
48
|
+
${children2}
|
|
49
|
+
${pad}</>`;
|
|
50
|
+
}
|
|
51
|
+
if (node.type === "#component") {
|
|
52
|
+
const props2 = propsToJsx(node.props);
|
|
53
|
+
return `<${node.name}${props2} />`;
|
|
54
|
+
}
|
|
55
|
+
if (node.type === "#raw") return `{/* raw html */}`;
|
|
56
|
+
const { tag, props, children } = node;
|
|
57
|
+
const attrs = propsToJsx(props);
|
|
58
|
+
if (VOID_TAGS.has(tag)) return `<${tag}${attrs} />`;
|
|
59
|
+
if (children.length === 0) return `<${tag}${attrs}></${tag}>`;
|
|
60
|
+
if (children.length === 1 && children[0]?.type === "#text") {
|
|
61
|
+
const { dangerouslySetInnerHTML } = props;
|
|
62
|
+
if (dangerouslySetInnerHTML) {
|
|
63
|
+
return `<${tag}${attrs} dangerouslySetInnerHTML={{ __html: ${JSON.stringify(dangerouslySetInnerHTML.__html)} }} />`;
|
|
64
|
+
}
|
|
65
|
+
return `<${tag}${attrs}>${children[0].value}</${tag}>`;
|
|
66
|
+
}
|
|
67
|
+
const inner = children.map((c) => nodeToJsx(c, depth + 1)).filter(Boolean).map((c) => `${childPad}${c}`).join("\n");
|
|
68
|
+
return `<${tag}${attrs}>
|
|
69
|
+
${inner}
|
|
70
|
+
${pad}</${tag}>`;
|
|
71
|
+
}
|
|
72
|
+
function renderToJsx(node) {
|
|
73
|
+
return nodeToJsx(node, 0);
|
|
74
|
+
}
|
|
75
|
+
function blueprintToFile(blueprint) {
|
|
76
|
+
const lines = [];
|
|
77
|
+
for (const [name, path] of Object.entries(blueprint.imports ?? {})) {
|
|
78
|
+
lines.push(`import ${name} from '${path}'`);
|
|
79
|
+
}
|
|
80
|
+
if (lines.length > 0) lines.push("");
|
|
81
|
+
const propEntries = Object.entries(blueprint.props);
|
|
82
|
+
const propsType = propEntries.length > 0 ? `{ ${propEntries.map(([n, s]) => `${n}${s.required ? "" : "?"}: ${PROP_TS_TYPE[s.type]}`).join(", ")} }` : "";
|
|
83
|
+
const paramList = propEntries.length > 0 ? `{ ${propEntries.map(([n]) => n).join(", ")} }: ${propsType}` : "";
|
|
84
|
+
lines.push(`export default function ${blueprint.name}(${paramList}) {`);
|
|
85
|
+
lines.push(" return (");
|
|
86
|
+
const body = nodeToJsx(blueprint.output, 2);
|
|
87
|
+
lines.push(` ${body}`);
|
|
88
|
+
lines.push(" )");
|
|
89
|
+
lines.push("}");
|
|
90
|
+
return lines.join("\n");
|
|
91
|
+
}
|
|
92
|
+
export {
|
|
93
|
+
blueprintToFile,
|
|
94
|
+
renderToJsx
|
|
95
|
+
};
|
|
96
|
+
//# sourceMappingURL=jsx.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/oml/jsx.ts"],
|
|
4
|
+
"sourcesContent": ["// OML \u2192 JSX serializer.\n// Converts an OmlNode tree back to JSX source text, and an OmlBlueprint to a\n// complete .tsx component file. Enables round-trip export from Blueprint JSON.\n\nimport type { OmlBlueprint, OmlNode, OmlPropType } from './types.js'\n\nconst VOID_TAGS = new Set([\n 'area',\n 'base',\n 'br',\n 'col',\n 'embed',\n 'hr',\n 'img',\n 'input',\n 'link',\n 'meta',\n 'param',\n 'source',\n 'track',\n 'wbr',\n])\n\nconst PROP_TS_TYPE: Record<OmlPropType, string> = {\n string: 'string',\n number: 'number',\n boolean: 'boolean',\n function: '() => void',\n node: 'string',\n array: 'unknown[]',\n}\n\n// \u2500\u2500\u2500 Prop serialization \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction escapeAttr(s: string): string {\n return s.replace(/&/g, '&').replace(/\"/g, '"')\n}\n\nfunction propToJsx(key: string, value: unknown): string {\n if (value === null || value === undefined) return ''\n if (value === true) return ` ${key}`\n if (value === false) return ` ${key}={false}`\n if (typeof value === 'string') return ` ${key}=\"${escapeAttr(value)}\"`\n if (typeof value === 'number') return ` ${key}={${value}}`\n return ` ${key}={${JSON.stringify(value)}}`\n}\n\nfunction propsToJsx(props: Record<string, unknown>): string {\n return Object.entries(props)\n .filter(([k]) => k !== 'dangerouslySetInnerHTML' && k !== 'key' && k !== 'ref')\n .map(([k, v]) => propToJsx(k, v))\n .join('')\n}\n\n// \u2500\u2500\u2500 Node serialization \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction nodeToJsx(node: OmlNode, depth: number): string {\n if (node === null) return ''\n\n const pad = ' '.repeat(depth)\n const childPad = ' '.repeat(depth + 1)\n\n if (node.type === '#text') return node.value\n\n if (node.type === '#fragment') {\n if (node.children.length === 0) return '<></>'\n const children = node.children\n .map((c) => nodeToJsx(c, depth + 1))\n .filter(Boolean)\n .map((c) => `${childPad}${c}`)\n .join('\\n')\n return `<>\\n${children}\\n${pad}</>`\n }\n\n if (node.type === '#component') {\n const props = propsToJsx(node.props)\n return `<${node.name}${props} />`\n }\n\n if (node.type === '#raw') return `{/* raw html */}`\n\n // element\n const { tag, props, children } = node\n const attrs = propsToJsx(props)\n\n if (VOID_TAGS.has(tag)) return `<${tag}${attrs} />`\n if (children.length === 0) return `<${tag}${attrs}></${tag}>`\n\n // Single text child: keep inline\n if (children.length === 1 && children[0]?.type === '#text') {\n const { dangerouslySetInnerHTML } = props as { dangerouslySetInnerHTML?: { __html: string } }\n if (dangerouslySetInnerHTML) {\n return `<${tag}${attrs} dangerouslySetInnerHTML={{ __html: ${JSON.stringify(dangerouslySetInnerHTML.__html)} }} />`\n }\n return `<${tag}${attrs}>${children[0].value}</${tag}>`\n }\n\n const inner = children\n .map((c) => nodeToJsx(c, depth + 1))\n .filter(Boolean)\n .map((c) => `${childPad}${c}`)\n .join('\\n')\n return `<${tag}${attrs}>\\n${inner}\\n${pad}</${tag}>`\n}\n\n/**\n * Render an OmlNode tree to a JSX expression string.\n * `#component` nodes render as component invocations (`<Name prop=\"val\" />`),\n * not as their resolved output \u2014 preserving the component boundary.\n */\nexport function renderToJsx(node: OmlNode): string {\n return nodeToJsx(node, 0)\n}\n\n// \u2500\u2500\u2500 Blueprint \u2192 .tsx file \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n/**\n * Convert an OmlBlueprint to a complete `.tsx` component file.\n * Import paths are sourced from `blueprint.imports`; missing entries are\n * left as bare identifiers for the developer to resolve.\n */\nexport function blueprintToFile(blueprint: OmlBlueprint): string {\n const lines: string[] = []\n\n // Import statements\n for (const [name, path] of Object.entries(blueprint.imports ?? {})) {\n lines.push(`import ${name} from '${path}'`)\n }\n if (lines.length > 0) lines.push('')\n\n // Props type\n const propEntries = Object.entries(blueprint.props)\n const propsType =\n propEntries.length > 0\n ? `{ ${propEntries.map(([n, s]) => `${n}${s.required ? '' : '?'}: ${PROP_TS_TYPE[s.type]}`).join(', ')} }`\n : ''\n\n const paramList =\n propEntries.length > 0 ? `{ ${propEntries.map(([n]) => n).join(', ')} }: ${propsType}` : ''\n\n lines.push(`export default function ${blueprint.name}(${paramList}) {`)\n lines.push(' return (')\n\n const body = nodeToJsx(blueprint.output, 2)\n lines.push(` ${body}`)\n\n lines.push(' )')\n lines.push('}')\n\n return lines.join('\\n')\n}\n"],
|
|
5
|
+
"mappings": "AAMA,MAAM,YAAY,oBAAI,IAAI;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAED,MAAM,eAA4C;AAAA,EAChD,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,UAAU;AAAA,EACV,MAAM;AAAA,EACN,OAAO;AACT;AAIA,SAAS,WAAW,GAAmB;AACrC,SAAO,EAAE,QAAQ,MAAM,OAAO,EAAE,QAAQ,MAAM,QAAQ;AACxD;AAEA,SAAS,UAAU,KAAa,OAAwB;AACtD,MAAI,UAAU,QAAQ,UAAU,OAAW,QAAO;AAClD,MAAI,UAAU,KAAM,QAAO,IAAI,GAAG;AAClC,MAAI,UAAU,MAAO,QAAO,IAAI,GAAG;AACnC,MAAI,OAAO,UAAU,SAAU,QAAO,IAAI,GAAG,KAAK,WAAW,KAAK,CAAC;AACnE,MAAI,OAAO,UAAU,SAAU,QAAO,IAAI,GAAG,KAAK,KAAK;AACvD,SAAO,IAAI,GAAG,KAAK,K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AQ,CAAC;AAC1C,QAAM,KAAK,OAAO,IAAI,EAAE;AAExB,QAAM,KAAK,KAAK;AAChB,QAAM,KAAK,GAAG;AAEd,SAAO,MAAM,KAAK,IAAI;AACxB;",
|
|
6
|
+
"names": ["children", "props"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { PageHandler, RequestContext } from '../types.js';
|
|
2
|
+
import type { OmlNode } from './types.js';
|
|
3
|
+
/** Narrower alias for handlers that explicitly return OmlNode. Equivalent to PageHandler at runtime. */
|
|
4
|
+
export type OmlPageHandler<P extends Record<string, string> = Record<string, string>> = (ctx: RequestContext<P>) => OmlNode | Promise<OmlNode>;
|
|
5
|
+
/** Alias for definePage — kept for clarity when a handler is intentionally OML-only. */
|
|
6
|
+
export declare const defineOmlPage: <P extends Record<string, string> = Record<string, string>>(fn: OmlPageHandler<P>) => PageHandler<P>;
|
|
7
|
+
//# sourceMappingURL=page.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../src/oml/page.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAE9D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAEzC,wGAAwG;AACxG,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,CACtF,GAAG,EAAE,cAAc,CAAC,CAAC,CAAC,KACnB,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;AAE/B,wFAAwF;AACxF,eAAO,MAAM,aAAa,EAAE,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACpF,EAAE,EAAE,cAAc,CAAC,CAAC,CAAC,KAClB,WAAW,CAAC,CAAC,CAAc,CAAA"}
|
package/dist/oml/page.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/oml/page.ts"],
|
|
4
|
+
"sourcesContent": ["import type { PageHandler, RequestContext } from '../types.js'\nimport { definePage } from '../types.js'\nimport type { OmlNode } from './types.js'\n\n/** Narrower alias for handlers that explicitly return OmlNode. Equivalent to PageHandler at runtime. */\nexport type OmlPageHandler<P extends Record<string, string> = Record<string, string>> = (\n ctx: RequestContext<P>,\n) => OmlNode | Promise<OmlNode>\n\n/** Alias for definePage \u2014 kept for clarity when a handler is intentionally OML-only. */\nexport const defineOmlPage: <P extends Record<string, string> = Record<string, string>>(\n fn: OmlPageHandler<P>,\n) => PageHandler<P> = definePage\n"],
|
|
5
|
+
"mappings": "AACA,SAAS,kBAAkB;AASpB,MAAM,gBAES;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { OmlNode } from './types.js';
|
|
2
|
+
/** Render an OmlNode tree to an HTML string. */
|
|
3
|
+
export declare function renderToHtml(node: OmlNode): string;
|
|
4
|
+
type DevCounters = Map<string, number>;
|
|
5
|
+
/**
|
|
6
|
+
* Dev-mode renderer — identical to renderToHtml but injects `data-oml-comp` and
|
|
7
|
+
* `data-oml-inst` attributes into the first HTML tag of #raw-returning components
|
|
8
|
+
* and recursively into their JSX children. This lets the visual editor map clicked
|
|
9
|
+
* DOM elements back to their OML #component nodes.
|
|
10
|
+
*/
|
|
11
|
+
export declare function renderToHtmlDev(node: OmlNode, counters?: DevCounters): string;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=render.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../src/oml/render.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAY,MAAM,YAAY,CAAA;AA0EnD,gDAAgD;AAChD,wBAAgB,YAAY,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAyBlD;AAQD,KAAK,WAAW,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AA4BtC;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,GAAE,WAAuB,GAAG,MAAM,CAkCxF"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
const VOID_ELEMENTS = /* @__PURE__ */ new Set([
|
|
2
|
+
"area",
|
|
3
|
+
"base",
|
|
4
|
+
"br",
|
|
5
|
+
"col",
|
|
6
|
+
"embed",
|
|
7
|
+
"hr",
|
|
8
|
+
"img",
|
|
9
|
+
"input",
|
|
10
|
+
"link",
|
|
11
|
+
"meta",
|
|
12
|
+
"param",
|
|
13
|
+
"source",
|
|
14
|
+
"track",
|
|
15
|
+
"wbr"
|
|
16
|
+
]);
|
|
17
|
+
function escapeHtml(s) {
|
|
18
|
+
return s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
19
|
+
}
|
|
20
|
+
function styleToString(style) {
|
|
21
|
+
return Object.entries(style).map(([k, v]) => {
|
|
22
|
+
const prop = k.replace(/[A-Z]/g, (c) => `-${c.toLowerCase()}`);
|
|
23
|
+
return `${prop}:${v}`;
|
|
24
|
+
}).join(";");
|
|
25
|
+
}
|
|
26
|
+
function renderProps(props) {
|
|
27
|
+
if (!props) return "";
|
|
28
|
+
const parts = [];
|
|
29
|
+
for (const [key, val] of Object.entries(props)) {
|
|
30
|
+
if (key === "key" || key === "ref" || key === "dangerouslySetInnerHTML") continue;
|
|
31
|
+
if (val === false || val == null) continue;
|
|
32
|
+
const attr = key === "className" ? "class" : key === "htmlFor" ? "for" : key === "tabIndex" ? "tabindex" : key;
|
|
33
|
+
if (attr.startsWith("on") && attr[2] === attr[2]?.toUpperCase()) continue;
|
|
34
|
+
if (val === true) {
|
|
35
|
+
parts.push(attr);
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
if (attr === "style") {
|
|
39
|
+
const css = typeof val === "string" ? val : styleToString(val);
|
|
40
|
+
parts.push(`style="${escapeHtml(css)}"`);
|
|
41
|
+
continue;
|
|
42
|
+
}
|
|
43
|
+
parts.push(`${attr}="${escapeHtml(String(val))}"`);
|
|
44
|
+
}
|
|
45
|
+
return parts.length ? ` ${parts.join(" ")}` : "";
|
|
46
|
+
}
|
|
47
|
+
function renderToHtml(node) {
|
|
48
|
+
if (node === null) return "";
|
|
49
|
+
if (typeof node === "string") return node;
|
|
50
|
+
if (node.type === "#text") return escapeHtml(node.value);
|
|
51
|
+
if (node.type === "#fragment") return node.children.map(renderToHtml).join("");
|
|
52
|
+
if (node.type === "#component") return renderToHtml(node.output);
|
|
53
|
+
if (node.type === "#raw") return node.value;
|
|
54
|
+
const { tag, props, children } = node;
|
|
55
|
+
const attrs = renderProps(props);
|
|
56
|
+
if (VOID_ELEMENTS.has(tag)) return `<${tag}${attrs}>`;
|
|
57
|
+
const dsi = props?.dangerouslySetInnerHTML;
|
|
58
|
+
if (dsi) {
|
|
59
|
+
return `<${tag}${attrs}>${dsi.__html}</${tag}>`;
|
|
60
|
+
}
|
|
61
|
+
return `<${tag}${attrs}>${children.map(renderToHtml).join("")}</${tag}>`;
|
|
62
|
+
}
|
|
63
|
+
function injectOmlAttrs(html, name, inst) {
|
|
64
|
+
return html.replace(/(<[a-zA-Z][a-zA-Z0-9-]*)(\s|>|\/)/, (_, tag, after) => {
|
|
65
|
+
return `${tag} data-oml-comp="${name}" data-oml-inst="${inst}"${after}`;
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
function injectChildMarkers(parentHtml, children, counters) {
|
|
69
|
+
let html = parentHtml;
|
|
70
|
+
for (const child of children) {
|
|
71
|
+
if (!child) continue;
|
|
72
|
+
if (child.type === "#component" && child.output?.type === "#raw") {
|
|
73
|
+
const childInst = counters.get(child.name) ?? 0;
|
|
74
|
+
counters.set(child.name, childInst + 1);
|
|
75
|
+
let childHtml = child.output.value;
|
|
76
|
+
if (child.children && child.children.length > 0) {
|
|
77
|
+
childHtml = injectChildMarkers(childHtml, child.children, counters);
|
|
78
|
+
}
|
|
79
|
+
const markedChildHtml = injectOmlAttrs(childHtml, child.name, childInst);
|
|
80
|
+
html = html.replace(child.output.value, markedChildHtml);
|
|
81
|
+
} else if (child.type === "#fragment") {
|
|
82
|
+
html = injectChildMarkers(html, child.children, counters);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return html;
|
|
86
|
+
}
|
|
87
|
+
function renderToHtmlDev(node, counters = /* @__PURE__ */ new Map()) {
|
|
88
|
+
if (node === null) return "";
|
|
89
|
+
if (typeof node === "string") return node;
|
|
90
|
+
if (node.type === "#text") return escapeHtml(node.value);
|
|
91
|
+
if (node.type === "#fragment")
|
|
92
|
+
return node.children.map((c) => renderToHtmlDev(c, counters)).join("");
|
|
93
|
+
if (node.type === "#raw") return node.value;
|
|
94
|
+
if (node.type === "#component") {
|
|
95
|
+
const inst = counters.get(node.name) ?? 0;
|
|
96
|
+
counters.set(node.name, inst + 1);
|
|
97
|
+
if (node.output?.type === "#raw") {
|
|
98
|
+
let html = node.output.value;
|
|
99
|
+
if (node.children && node.children.length > 0) {
|
|
100
|
+
html = injectChildMarkers(html, node.children, counters);
|
|
101
|
+
}
|
|
102
|
+
return injectOmlAttrs(html, node.name, inst);
|
|
103
|
+
}
|
|
104
|
+
return renderToHtmlDev(node.output, counters);
|
|
105
|
+
}
|
|
106
|
+
const { tag, props, children } = node;
|
|
107
|
+
const attrs = renderProps(props);
|
|
108
|
+
if (VOID_ELEMENTS.has(tag)) return `<${tag}${attrs}>`;
|
|
109
|
+
const dsi = props?.dangerouslySetInnerHTML;
|
|
110
|
+
if (dsi) return `<${tag}${attrs}>${dsi.__html}</${tag}>`;
|
|
111
|
+
return `<${tag}${attrs}>${children.map((c) => renderToHtmlDev(c, counters)).join("")}</${tag}>`;
|
|
112
|
+
}
|
|
113
|
+
export {
|
|
114
|
+
renderToHtml,
|
|
115
|
+
renderToHtmlDev
|
|
116
|
+
};
|
|
117
|
+
//# sourceMappingURL=render.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/oml/render.ts"],
|
|
4
|
+
"sourcesContent": ["// OML renderer \u2014 converts an OmlNode tree to an HTML string.\n// Separating rendering from tree construction enables caching, diffing, and\n// multi-target output (HTML, email, etc.) from the same tree.\n\nimport type { OmlNode, OmlProps } from './types.js'\n\nconst VOID_ELEMENTS = new Set([\n 'area',\n 'base',\n 'br',\n 'col',\n 'embed',\n 'hr',\n 'img',\n 'input',\n 'link',\n 'meta',\n 'param',\n 'source',\n 'track',\n 'wbr',\n])\n\nfunction escapeHtml(s: string): string {\n return s\n .replace(/&/g, '&')\n .replace(/</g, '<')\n .replace(/>/g, '>')\n .replace(/\"/g, '"')\n .replace(/'/g, ''')\n}\n\nfunction styleToString(style: Record<string, string | number>): string {\n return Object.entries(style)\n .map(([k, v]) => {\n const prop = k.replace(/[A-Z]/g, (c) => `-${c.toLowerCase()}`)\n return `${prop}:${v}`\n })\n .join(';')\n}\n\nfunction renderProps(props: OmlProps | null | undefined): string {\n if (!props) return ''\n const parts: string[] = []\n\n for (const [key, val] of Object.entries(props)) {\n if (key === 'key' || key === 'ref' || key === 'dangerouslySetInnerHTML') continue\n if (val === false || val == null) continue\n\n const attr =\n key === 'className'\n ? 'class'\n : key === 'htmlFor'\n ? 'for'\n : key === 'tabIndex'\n ? 'tabindex'\n : key\n\n if (attr.startsWith('on') && attr[2] === attr[2]?.toUpperCase()) continue\n\n if (val === true) {\n parts.push(attr)\n continue\n }\n\n if (attr === 'style') {\n const css =\n typeof val === 'string' ? val : styleToString(val as Record<string, string | number>)\n parts.push(`style=\"${escapeHtml(css)}\"`)\n continue\n }\n\n parts.push(`${attr}=\"${escapeHtml(String(val))}\"`)\n }\n\n return parts.length ? ` ${parts.join(' ')}` : ''\n}\n\n/** Render an OmlNode tree to an HTML string. */\nexport function renderToHtml(node: OmlNode): string {\n if (node === null) return ''\n if (typeof (node as unknown) === 'string') return node as unknown as string\n\n if (node.type === '#text') return escapeHtml(node.value)\n\n if (node.type === '#fragment') return node.children.map(renderToHtml).join('')\n\n if (node.type === '#component') return renderToHtml(node.output)\n\n if (node.type === '#raw') return node.value\n\n // OmlElement\n const { tag, props, children } = node\n const attrs = renderProps(props)\n\n if (VOID_ELEMENTS.has(tag)) return `<${tag}${attrs}>`\n\n const dsi = (props as { dangerouslySetInnerHTML?: { __html: string } } | null | undefined)\n ?.dangerouslySetInnerHTML\n if (dsi) {\n return `<${tag}${attrs}>${dsi.__html}</${tag}>`\n }\n\n return `<${tag}${attrs}>${children.map(renderToHtml).join('')}</${tag}>`\n}\n\nfunction injectOmlAttrs(html: string, name: string, inst: number): string {\n return html.replace(/(<[a-zA-Z][a-zA-Z0-9-]*)(\\s|>|\\/)/, (_, tag, after) => {\n return `${tag} data-oml-comp=\"${name}\" data-oml-inst=\"${inst}\"${after}`\n })\n}\n\ntype DevCounters = Map<string, number>\n\n/**\n * For #raw-returning components whose JSX children are stored on the node, inject\n * child markers into the parent's raw HTML via string replacement. Each child's\n * original raw HTML is found in the parent string and replaced with the marked version.\n * This works because library components include their children's HTML verbatim.\n */\nfunction injectChildMarkers(parentHtml: string, children: OmlNode[], counters: DevCounters): string {\n let html = parentHtml\n for (const child of children) {\n if (!child) continue\n if (child.type === '#component' && child.output?.type === '#raw') {\n const childInst = counters.get(child.name) ?? 0\n counters.set(child.name, childInst + 1)\n let childHtml = child.output.value\n if (child.children && child.children.length > 0) {\n childHtml = injectChildMarkers(childHtml, child.children, counters)\n }\n const markedChildHtml = injectOmlAttrs(childHtml, child.name, childInst)\n html = html.replace(child.output.value, markedChildHtml)\n } else if (child.type === '#fragment') {\n html = injectChildMarkers(html, child.children, counters)\n }\n }\n return html\n}\n\n/**\n * Dev-mode renderer \u2014 identical to renderToHtml but injects `data-oml-comp` and\n * `data-oml-inst` attributes into the first HTML tag of #raw-returning components\n * and recursively into their JSX children. This lets the visual editor map clicked\n * DOM elements back to their OML #component nodes.\n */\nexport function renderToHtmlDev(node: OmlNode, counters: DevCounters = new Map()): string {\n if (node === null) return ''\n if (typeof (node as unknown) === 'string') return node as unknown as string\n\n if (node.type === '#text') return escapeHtml(node.value)\n\n if (node.type === '#fragment')\n return node.children.map((c) => renderToHtmlDev(c, counters)).join('')\n\n if (node.type === '#raw') return node.value\n\n if (node.type === '#component') {\n const inst = counters.get(node.name) ?? 0\n counters.set(node.name, inst + 1)\n if (node.output?.type === '#raw') {\n let html = node.output.value\n if (node.children && node.children.length > 0) {\n html = injectChildMarkers(html, node.children, counters)\n }\n return injectOmlAttrs(html, node.name, inst)\n }\n return renderToHtmlDev(node.output, counters)\n }\n\n const { tag, props, children } = node\n const attrs = renderProps(props)\n\n if (VOID_ELEMENTS.has(tag)) return `<${tag}${attrs}>`\n\n const dsi = (props as { dangerouslySetInnerHTML?: { __html: string } } | null | undefined)\n ?.dangerouslySetInnerHTML\n if (dsi) return `<${tag}${attrs}>${dsi.__html}</${tag}>`\n\n return `<${tag}${attrs}>${children.map((c) => renderToHtmlDev(c, counters)).join('')}</${tag}>`\n}\n"],
|
|
5
|
+
"mappings": "AAMA,MAAM,gBAAgB,oBAAI,IAAI;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAED,SAAS,WAAW,GAAmB;AACrC,SAAO,EACJ,QAAQ,MAAM,OAAO,EACrB,QAAQ,MAAM,MAAM,EACpB,QAAQ,MAAM,MAAM,EACpB,QAAQ,MAAM,QAAQ,EACtB,QAAQ,MAAM,OAAO;AAC1B;AAEA,SA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record<string, unknown>;
|
|
2
|
+
/** A plain text node. */
|
|
3
|
+
export type OmlText = {
|
|
4
|
+
type: '#text';
|
|
5
|
+
value: string;
|
|
6
|
+
};
|
|
7
|
+
/** A raw HTML passthrough node — not escaped; used for island server stubs and similar. */
|
|
8
|
+
export type OmlRaw = {
|
|
9
|
+
type: '#raw';
|
|
10
|
+
value: string;
|
|
11
|
+
};
|
|
12
|
+
/** A rendered HTML element. */
|
|
13
|
+
export type OmlElement = {
|
|
14
|
+
type: 'element';
|
|
15
|
+
/** The HTML tag name (div, span, button, etc.). */
|
|
16
|
+
tag: string;
|
|
17
|
+
/** Stable identity from the JSX `key` prop — used for diffing and caching. */
|
|
18
|
+
id?: string;
|
|
19
|
+
props: OmlProps;
|
|
20
|
+
children: OmlNode[];
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* A rendered component call — preserves component boundaries for the visual
|
|
24
|
+
* editor and inspector. The `return` field is what the component rendered.
|
|
25
|
+
*/
|
|
26
|
+
export type OmlComponent = {
|
|
27
|
+
type: '#component';
|
|
28
|
+
/** Component function name — shown in the inspector. */
|
|
29
|
+
name: string;
|
|
30
|
+
id?: string;
|
|
31
|
+
/** Props passed to the component (children excluded). */
|
|
32
|
+
props: OmlProps;
|
|
33
|
+
/**
|
|
34
|
+
* Resolved JSX children passed to the component — stored separately from `output`
|
|
35
|
+
* so the visual editor can show the JSX hierarchy even when `output` is #raw
|
|
36
|
+
* (i.e. when a library component renders to an HTML string).
|
|
37
|
+
*/
|
|
38
|
+
children?: OmlNode[];
|
|
39
|
+
/** The component's rendered output. */
|
|
40
|
+
output: OmlNode;
|
|
41
|
+
};
|
|
42
|
+
/** A JSX Fragment — a grouping with no wrapper element. */
|
|
43
|
+
export type OmlFragment = {
|
|
44
|
+
type: '#fragment';
|
|
45
|
+
children: OmlNode[];
|
|
46
|
+
};
|
|
47
|
+
export type OmlNode = OmlElement | OmlComponent | OmlFragment | OmlText | OmlRaw | null;
|
|
48
|
+
export type OmlPropType = 'string' | 'number' | 'boolean' | 'function' | 'node' | 'array';
|
|
49
|
+
export type OmlPropSchema = {
|
|
50
|
+
type: OmlPropType;
|
|
51
|
+
default?: unknown;
|
|
52
|
+
required?: boolean;
|
|
53
|
+
description?: string;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* A component definition stored in a Blueprint JSON file.
|
|
57
|
+
* The `return` field is the root OmlNode of the component's render tree.
|
|
58
|
+
* Wires (signal connections) between nodes are stored as id references.
|
|
59
|
+
* `imports` maps component names used in the tree to their module paths,
|
|
60
|
+
* enabling round-trip export back to .tsx without losing import information.
|
|
61
|
+
*/
|
|
62
|
+
export type OmlBlueprint = {
|
|
63
|
+
id: string;
|
|
64
|
+
name: string;
|
|
65
|
+
props: Record<string, OmlPropSchema>;
|
|
66
|
+
output: OmlNode;
|
|
67
|
+
imports?: Record<string, string>;
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* Parse and validate an `OmlNode` from untrusted JSON (e.g. a Blueprint file).
|
|
71
|
+
* Throws a descriptive error if the shape is invalid.
|
|
72
|
+
*/
|
|
73
|
+
export declare function parseOml(json: unknown): OmlNode;
|
|
74
|
+
/**
|
|
75
|
+
* Parse and validate an `OmlBlueprint` from untrusted JSON.
|
|
76
|
+
* Throws a descriptive error if the shape is invalid.
|
|
77
|
+
*/
|
|
78
|
+
export declare function parseOmlBlueprint(json: unknown): OmlBlueprint;
|
|
79
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/oml/types.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAE9C,yBAAyB;AACzB,MAAM,MAAM,OAAO,GAAG;IACpB,IAAI,EAAE,OAAO,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,2FAA2F;AAC3F,MAAM,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