cirrojs 0.0.9 → 0.0.11
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/CHANGELOG.md +22 -1
- package/dist/cli.js +1 -1
- package/dist/{css-BZ1E8BDE.js → css-CPDjsrSK.js} +1 -1
- package/dist/css-J_tbT4BH.d.ts +17 -0
- package/dist/index.d.ts +2 -15
- package/dist/index.js +1 -1
- package/dist/layout.d.ts +92 -0
- package/dist/layout.js +1 -0
- package/dist/registry-Bg8dxPHm.d.ts +15 -0
- package/dist/registry.d.ts +1 -14
- package/package.json +5 -1
package/CHANGELOG.md
CHANGED
|
@@ -13,6 +13,25 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
|
|
13
13
|
|
|
14
14
|
## [Unreleased]
|
|
15
15
|
|
|
16
|
+
## [0.0.11] - 2026-06-28
|
|
17
|
+
|
|
18
|
+
### Added
|
|
19
|
+
- `createLayout`'s `cluster` now accepts an optional `wrap` option (`Properties["flex_wrap"]`) to override its flex-wrap behavior.
|
|
20
|
+
- Two new `LayoutDefaults` fields: `clusterWrap`, the default flex-wrap applied by `cluster`, and `sidebarSideWidth`, the default inline size of the sidebar's side slot.
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
- The sidebar's side slot now defaults its `flex-basis` to `sidebarSideWidth` (default `30ch`) instead of `auto`.
|
|
24
|
+
- Changed the `sidebarContentMin` default from `50%` to `65ch`.
|
|
25
|
+
|
|
26
|
+
## [0.0.10] - 2026-06-27
|
|
27
|
+
|
|
28
|
+
### Added
|
|
29
|
+
- New `cirrojs/layout` entry point exporting `createLayout`, a factory that produces the Every Layout primitives (`stack`, `cluster`, `center`, `grid`, `switcher`, `sidebar`, `cover`, `frame`, `reel`, `imposter`, `box`) as typed functions returning deterministic class names. `createLayout` accepts a `LayoutTheme` for overriding the output `css` function and partially overriding the defaults. Also exports the `Layout`, `LayoutTheme`, `LayoutDefaults`, `SidebarSlots`, and `CoverSlots` types.
|
|
30
|
+
|
|
31
|
+
### Changed
|
|
32
|
+
- Replaced the `mediaAtRule?: string` field of `GenCssFnOpt` with `atRules?: string[]`. `genCssFn` now accepts any at-rules directly instead of only a media query condition.
|
|
33
|
+
- The dev server now responds with the error's stack trace instead of its string representation when a render throws.
|
|
34
|
+
|
|
16
35
|
## [0.0.9] - 2026-06-22
|
|
17
36
|
|
|
18
37
|
### Fixed
|
|
@@ -72,7 +91,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
|
|
72
91
|
## 0.0.1 - 2026-06-15
|
|
73
92
|
- initial release
|
|
74
93
|
|
|
75
|
-
[Unreleased]: https://github.com/osawa-naotaka/cirro/compare/v0.0.
|
|
94
|
+
[Unreleased]: https://github.com/osawa-naotaka/cirro/compare/v0.0.11...HEAD
|
|
95
|
+
[0.0.11]: https://github.com/osawa-naotaka/cirro/compare/v0.0.10...v0.0.11
|
|
96
|
+
[0.0.10]: https://github.com/osawa-naotaka/cirro/compare/v0.0.9...v0.0.10
|
|
76
97
|
[0.0.9]: https://github.com/osawa-naotaka/cirro/compare/v0.0.8...v0.0.9
|
|
77
98
|
[0.0.8]: https://github.com/osawa-naotaka/cirro/compare/v0.0.7...v0.0.8
|
|
78
99
|
[0.0.7]: https://github.com/osawa-naotaka/cirro/compare/v0.0.6...v0.0.7
|
package/dist/cli.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./css-
|
|
1
|
+
import{r as e}from"./css-CPDjsrSK.js";import{Fragment as t,createElement as n}from"react";import{renderToStaticMarkup as r}from"react-dom/server";import{dirname as i,extname as a,join as o,resolve as s}from"node:path";import{mkdir as c,readFile as l,writeFile as u}from"node:fs/promises";import{build as d,createServer as f,createServerModuleRunner as p}from"vite";import{createServer as m}from"node:http";function h(e){let t=[];for(let n of e)switch(n.type){case`static`:t.push({type:`html`,path:n.path,cssPath:o(n.path,`index.css`),render:()=>n.component({params:{}})}),t.push({type:`css`,path:o(n.path,`index.css`),render:()=>n.component({params:{}})});break;case`dynamic`:for(let e of n.getStaticPaths())t.push({type:`html`,path:n.path(e),cssPath:n.cssPath,render:()=>n.component({params:e})});t.push({type:`css`,path:n.cssPath,render:()=>n.component({params:n.getStaticPaths()[0]})});break;case`file`:t.push({type:`file`,path:n.path,ext:a(n.path),render:()=>n.component({params:{}})});break}return t}function g(e){return e===`/`?`index.html`:`${e.replace(/^\/+|\/+$/g,``)}/index.html`}function _(e){return e===`/`?`index.css`:`${e.replace(/^\/+|\/+$/g,``)}`}function v(e,r,i){return n(t,null,e,n(`script`,{async:!0,type:`module`,src:r,key:`cirro-client`}),n(`link`,{rel:`stylesheet`,href:i,precedence:`default`,key:`cirro-css`}))}function y(e){for(let t of e.plugins){let e=t.api;if(t.name===`cirro`&&e?.options)return e.options}throw Error(`cirro: plugin not found in Vite config (did you add cirro() to plugins?)`)}async function b(){await d();let t=await f({server:{middlewareMode:!0,hmr:!1},appType:`custom`}),n=p(t.environments.ssr);try{let a=t.config,d=y(a),f=a.root,p=s(f,a.build.outDir),m=s(f,d.routes),b=JSON.parse(await l(o(p,`.vite/manifest.json`),`utf-8`))[`virtual:cirro/client`];if(!b)throw Error(`cirro: manifest entry "virtual:cirro/client" not found`);let x=`/${b.file}`,{routes:S,runWithRegistry:C}=await n.import(m);for(let t of h(S))switch(t.type){case`css`:{let{registry:n}=C(()=>r(t.render())),a=e(n),s=o(p,_(t.path));await c(i(s),{recursive:!0}),await u(s,a),console.log(`wrote ${s} (url: ${t.path})`);break}case`html`:{let{result:e}=C(()=>`<!DOCTYPE html>${r(v(t.render(),x,t.cssPath))}`),n=o(p,g(t.path));await c(i(n),{recursive:!0}),await u(n,e),console.log(`wrote ${n} (url: ${t.path})`);break}case`file`:{let e=t.render(),n=o(p,t.path);await c(i(n),{recursive:!0}),await u(n,e),console.log(`wrote ${n} (url: ${t.path})`);break}}}finally{await t.close()}}const x=[[`.aac`,`audio/aac`],[`.abw`,`application/x-abiword`],[`.arc`,`application/x-freearc`],[`.avi`,`video/x-msvideo`],[`.azw`,`application/vnd.amazon.ebook`],[`.bin`,`application/octet-stream`],[`.bmp`,`image/bmp`],[`.bz`,`application/x-bzip`],[`.bz2`,`application/x-bzip2`],[`.csh`,`application/x-csh`],[`.css`,`text/css`],[`.csv`,`text/csv`],[`.doc`,`application/msword`],[`.docx`,`application/vnd.openxmlformats-officedocument.wordprocessingml.document`],[`.eot`,`application/vnd.ms-fontobject`],[`.epub`,`application/epub+zip`],[`.gz`,`application/gzip`],[`.gif`,`image/gif`],[`.htm`,`text/html`],[`.html`,`text/html`],[`.ico`,`image/vnd.microsoft.icon`],[`.ics`,`text/calendar`],[`.jar`,`application/java-archive`],[`.jpeg`,`image/jpeg`],[`.jpg`,`image/jpeg`],[`.js`,`text/javascript`],[`.json`,`application/json`],[`.jsonld`,`application/ld+json`],[`.mid`,`audio/midi`],[`.midi`,`audio/x-midi`],[`.mjs`,`text/javascript`],[`.mp3`,`audio/mpeg`],[`.mpeg`,`video/mpeg`],[`.mpkg`,`application/vnd.apple.installer+xml`],[`.odp`,`application/vnd.oasis.opendocument.presentation`],[`.ods`,`application/vnd.oasis.opendocument.spreadsheet`],[`.odt`,`application/vnd.oasis.opendocument.text`],[`.oga`,`audio/ogg`],[`.ogv`,`video/ogg`],[`.ogx`,`application/ogg`],[`.opus`,`audio/opus`],[`.otf`,`font/otf`],[`.png`,`image/png`],[`.pdf`,`application/pdf`],[`.php`,`application/x-httpd-php`],[`.ppt`,`application/vnd.ms-powerpoint`],[`.pptx`,`application/vnd.openxmlformats-officedocument.presentationml.presentation`],[`.rar`,`application/vnd.rar`],[`.rtf`,`application/rtf`],[`.sh`,`application/x-sh`],[`.svg`,`image/svg+xml`],[`.swf`,`application/x-shockwave-flash`],[`.tar`,`application/x-tar`],[`.tif`,`image/tiff`],[`.tiff`,`image/tiff`],[`.ts`,`video/mp2t`],[`.ttf`,`font/ttf`],[`.txt`,`text/plain`],[`.vsd`,`application/vnd.visio`],[`.wav`,`audio/wav`],[`.weba`,`audio/webm`],[`.webm`,`video/webm`],[`.webp`,`image/webp`],[`.woff`,`font/woff`],[`.woff2`,`font/woff2`],[`.xhtml`,`application/xhtml+xml`],[`.xls`,`application/vnd.ms-excel`],[`.xlsx`,`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`],[`.xml`,`application/xml`],[`.xul`,`application/vnd.mozilla.xul+xml`],[`.zip`,`application/zip`],[`.3gp`,`video/3gpp`],[`.3g2`,`video/3gpp2`],[`.7z`,`application/x-7z-compressed`]];function S(e){return x.find(t=>t[0]===e)?.[1]||`text/plain`}function C(e,t){let n=[t,t.replaceAll(`\\`,`/`)];for(let t of Object.values(e.environments)){let e=t.moduleGraph;if(!e)continue;let r=new Set,i=t=>{if(!r.has(t)){r.add(t),e.invalidateModule(t);for(let e of t.importers)i(e)}};for(let t of n){let n=e.getModulesByFile(t);if(n)for(let e of n)i(e)}}}async function w(t=5173){let n=await f({server:{middlewareMode:!0},appType:`custom`}),a=p(n.environments.ssr),o=y(n.config),c=n.config.root,l=s(c,o.routes),u=i(s(c,o.islands)).replaceAll(`\\`,`/`),d=m((t,i)=>{function o(e,t){i.statusCode=200,i.setHeader(`Content-Type`,S(e)),i.end(t)}function s(e){i.statusCode=404,i.setHeader(`Content-Type`,S(e)),e===`.html`?i.end(`<!DOCTYPE html><meta charset="utf-8"><h1>404 Not Found</h1>`):i.end()}n.middlewares(t,i,async()=>{let c=t.url??`/`,u=new URL(c,`http://localhost`).pathname.replace(/\/+$/,``)||`/`;try{let{routes:t,runWithRegistry:i}=await a.import(l),d=h(t).find(e=>e.path===u);if(d===void 0){s(`.html`);return}switch(d.type){case`html`:{let{result:e}=i(()=>`<!DOCTYPE html>${r(v(d.render(),`/@id/__x00__virtual:cirro/client`,d.cssPath))}`);o(`.html`,await n.transformIndexHtml(c,e));break}case`css`:{let{registry:t}=i(()=>r(d.render()));o(`.css`,e(t));break}case`file`:{let e=d.render();o(d.ext,e);break}}return}catch(e){i.statusCode=500,e instanceof Error?i.end(e.stack):i.end(String(e))}})}),g=`${s(c,o.watchDir??`./src`).replaceAll(`\\`,`/`).replace(/\/+$/,``)}/`;n.watcher.on(`change`,e=>{let t=e.replaceAll(`\\`,`/`);t.startsWith(u)||t.startsWith(g)&&(C(n,e),n.ws.send({type:`full-reload`}))}),d.listen(t,()=>{console.log(`cirro dev: http://localhost:${t}`)})}async function T(e){let t=e[0];t===`dev`?await w():t===`build`?await b():(console.error(`usage: cirro <dev|build>`),process.exit(1))}export{T as main};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{registerCss as e}from"cirrojs/registry";function t(e,t){let n=t?.selector??`&`,r=t?.atrules??[],o=a({selector:n,atrules:r,properties:e}),s=`${t?.name??`cirro`}-${o.toString(16)}`;return i([...r,n],e,s),s}function n(e){let n=[];return e.layer&&n.push(`@layer ${e.layer}`),e.
|
|
1
|
+
import{registerCss as e}from"cirrojs/registry";function t(e,t){let n=t?.selector??`&`,r=t?.atrules??[],o=a({selector:n,atrules:r,properties:e}),s=`${t?.name??`cirro`}-${o.toString(16)}`;return i([...r,n],e,s),s}function n(e){let n=[];return e.layer&&n.push(`@layer ${e.layer}`),e.atRules&&n.push(...e.atRules),(e,r)=>t(e,{atrules:n,name:r?.name,selector:r?.selector})}function r(e){let t=`@charset "utf-8";
|
|
2
2
|
@layer base, font, low, main, high;
|
|
3
3
|
`;for(let[n,[r,i]]of e)t+=r.reduceRight((e,t)=>`${t} { ${e} }`,Object.entries(i).map(([e,t])=>`${e.replaceAll(`_`,`-`)}: ${t};`).join(` `)),t+=`
|
|
4
4
|
`;return t}function i(t,n,r){e(r,t.map(e=>e.replaceAll(`&`,`.${r}`)),n)}function a(...e){return o(e.map(e=>JSON.stringify(e)).join(``))}function o(e){let t=5381;for(let n of[...e])t=(t<<5)+t+n.charCodeAt(0)&4294967295;return t>>>0}export{n,r,t};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { t as Properties } from "./properties-FKQ-gJeC.js";
|
|
2
|
+
|
|
3
|
+
//#region src/css.d.ts
|
|
4
|
+
type CssOpt = {
|
|
5
|
+
name?: string;
|
|
6
|
+
atrules?: string[];
|
|
7
|
+
selector?: string;
|
|
8
|
+
};
|
|
9
|
+
declare function css(properties: Properties, opt?: CssOpt): string;
|
|
10
|
+
type CssFnT = (properties: Properties, opt?: Omit<CssOpt, "atrules">) => string;
|
|
11
|
+
type GenCssFnOpt = {
|
|
12
|
+
atRules?: string[];
|
|
13
|
+
layer?: string;
|
|
14
|
+
};
|
|
15
|
+
declare function genCssFn(opt: GenCssFnOpt): CssFnT;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { genCssFn as i, CssOpt as n, css as r, CssFnT as t };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,22 +1,9 @@
|
|
|
1
1
|
import { t as Properties } from "./properties-FKQ-gJeC.js";
|
|
2
|
-
import { Registry } from "./registry.js";
|
|
2
|
+
import { t as Registry } from "./registry-Bg8dxPHm.js";
|
|
3
|
+
import { i as genCssFn, n as CssOpt, r as css } from "./css-J_tbT4BH.js";
|
|
3
4
|
import { runWithRegistry } from "cirrojs/registry";
|
|
4
5
|
import { ReactElement } from "react";
|
|
5
6
|
|
|
6
|
-
//#region src/css.d.ts
|
|
7
|
-
type CssOpt = {
|
|
8
|
-
name?: string;
|
|
9
|
-
atrules?: string[];
|
|
10
|
-
selector?: string;
|
|
11
|
-
};
|
|
12
|
-
declare function css(properties: Properties, opt?: CssOpt): string;
|
|
13
|
-
type CssFnT = (properties: Properties, opt?: Omit<CssOpt, "atrules">) => string;
|
|
14
|
-
type GenCssFnOpt = {
|
|
15
|
-
mediaAtRule?: string;
|
|
16
|
-
layer?: string;
|
|
17
|
-
};
|
|
18
|
-
declare function genCssFn(opt: GenCssFnOpt): CssFnT;
|
|
19
|
-
//#endregion
|
|
20
7
|
//#region src/route.d.ts
|
|
21
8
|
type Params = Record<string, unknown>;
|
|
22
9
|
type StaticRoute = {
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,t}from"./css-
|
|
1
|
+
import{n as e,t}from"./css-CPDjsrSK.js";import{runWithRegistry as n}from"cirrojs/registry";export{t as css,e as genCssFn,n as runWithRegistry};
|
package/dist/layout.d.ts
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { t as Properties } from "./properties-FKQ-gJeC.js";
|
|
2
|
+
import { t as CssFnT } from "./css-J_tbT4BH.js";
|
|
3
|
+
|
|
4
|
+
//#region src/layout.d.ts
|
|
5
|
+
interface LayoutDefaults {
|
|
6
|
+
gap: string;
|
|
7
|
+
stackGap?: string;
|
|
8
|
+
clusterGap?: string;
|
|
9
|
+
clusterWrap?: Properties["flex_wrap"];
|
|
10
|
+
gridGap?: string;
|
|
11
|
+
switcherGap?: string;
|
|
12
|
+
sidebarGap?: string;
|
|
13
|
+
clusterJustify: Properties["justify_content"];
|
|
14
|
+
clusterAlign: Properties["align_items"];
|
|
15
|
+
centerMax: string;
|
|
16
|
+
gridMin: string;
|
|
17
|
+
switcherThreshold: string;
|
|
18
|
+
switcherLimit: number;
|
|
19
|
+
sidebarContentMin: string;
|
|
20
|
+
sidebarSideWidth: string;
|
|
21
|
+
coverMinHeight: string;
|
|
22
|
+
frameRatio: string;
|
|
23
|
+
boxPadding?: string;
|
|
24
|
+
}
|
|
25
|
+
interface LayoutTheme {
|
|
26
|
+
css?: CssFnT;
|
|
27
|
+
defaults?: Partial<LayoutDefaults>;
|
|
28
|
+
}
|
|
29
|
+
interface SidebarSlots {
|
|
30
|
+
root: string;
|
|
31
|
+
side: string;
|
|
32
|
+
content: string;
|
|
33
|
+
}
|
|
34
|
+
interface CoverSlots {
|
|
35
|
+
root: string;
|
|
36
|
+
centered: string;
|
|
37
|
+
}
|
|
38
|
+
interface Layout {
|
|
39
|
+
stack(opts?: {
|
|
40
|
+
gap?: string;
|
|
41
|
+
}): string;
|
|
42
|
+
cluster(opts?: {
|
|
43
|
+
gap?: string;
|
|
44
|
+
justify?: Properties["justify_content"];
|
|
45
|
+
align?: Properties["align_items"];
|
|
46
|
+
}): string;
|
|
47
|
+
center(opts?: {
|
|
48
|
+
max?: string;
|
|
49
|
+
gutters?: string;
|
|
50
|
+
intrinsic?: boolean;
|
|
51
|
+
andText?: boolean;
|
|
52
|
+
}): string;
|
|
53
|
+
grid(opts?: {
|
|
54
|
+
gap?: string;
|
|
55
|
+
min?: string;
|
|
56
|
+
}): string;
|
|
57
|
+
switcher(opts?: {
|
|
58
|
+
threshold?: string;
|
|
59
|
+
gap?: string;
|
|
60
|
+
limit?: number;
|
|
61
|
+
}): string;
|
|
62
|
+
sidebar(opts?: {
|
|
63
|
+
sideWidth?: string;
|
|
64
|
+
contentMin?: string;
|
|
65
|
+
gap?: string;
|
|
66
|
+
}): SidebarSlots;
|
|
67
|
+
cover(opts?: {
|
|
68
|
+
minHeight?: string;
|
|
69
|
+
gap?: string;
|
|
70
|
+
padding?: string;
|
|
71
|
+
}): CoverSlots;
|
|
72
|
+
frame(opts?: {
|
|
73
|
+
ratio?: string;
|
|
74
|
+
}): string;
|
|
75
|
+
reel(opts?: {
|
|
76
|
+
itemWidth?: string;
|
|
77
|
+
height?: string;
|
|
78
|
+
gap?: string;
|
|
79
|
+
}): string;
|
|
80
|
+
imposter(opts?: {
|
|
81
|
+
fixed?: boolean;
|
|
82
|
+
contain?: boolean;
|
|
83
|
+
margin?: string;
|
|
84
|
+
}): string;
|
|
85
|
+
box(opts?: {
|
|
86
|
+
padding?: string;
|
|
87
|
+
border?: string;
|
|
88
|
+
}): string;
|
|
89
|
+
}
|
|
90
|
+
declare function createLayout(theme?: LayoutTheme): Layout;
|
|
91
|
+
//#endregion
|
|
92
|
+
export { CoverSlots, Layout, LayoutDefaults, LayoutTheme, SidebarSlots, createLayout };
|
package/dist/layout.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./css-CPDjsrSK.js";const t={gap:`1rem`,clusterJustify:`flex-start`,clusterAlign:`center`,centerMax:`60ch`,gridMin:`16rem`,switcherThreshold:`30rem`,switcherLimit:4,sidebarContentMin:`65ch`,sidebarSideWidth:`30ch`,coverMinHeight:`100vh`,frameRatio:`16 / 9`};function n(...e){return e.filter(Boolean).join(` `)}function r(r={}){let i=r.css??e({layer:`low`}),a={...t,...r.defaults};function o(e){return i({display:`flex`,flex_direction:`column`,gap:e?.gap??a.stackGap??a.gap})}function s(e){return i({display:`flex`,flex_wrap:e?.wrap??a.clusterWrap??`wrap`,gap:e?.gap??a.clusterGap??a.gap,justify_content:e?.justify??a.clusterJustify,align_items:e?.align??a.clusterAlign})}function c(e){return n(i({box_sizing:`border-box`,margin_inline:`auto`,max_inline_size:e?.max??a.centerMax}),e?.gutters?i({padding_inline:e.gutters}):``,e?.intrinsic?i({display:`flex`,flex_direction:`column`,align_items:`center`}):``,e?.andText?i({text_align:`center`}):``)}function l(e){let t=e?.min??a.gridMin;return i({display:`grid`,gap:e?.gap??a.gridGap??a.gap,grid_template_columns:`repeat(auto-fit, minmax(min(${t}, 100%), 1fr))`})}function u(e){let t=e?.threshold??a.switcherThreshold,r=e?.limit??a.switcherLimit;return n(i({display:`flex`,flex_wrap:`wrap`,gap:e?.gap??a.switcherGap??a.gap}),i({flex_grow:`1`,flex_basis:`calc((${t} - 100%) * 999)`},{selector:`& > *`}),i({flex_basis:`100%`},{selector:`& > :nth-last-child(n+${r+1})`}),i({flex_basis:`100%`},{selector:`& > :nth-last-child(n+${r+1}) ~ *`}))}function d(e){return{root:i({display:`flex`,flex_wrap:`wrap`,gap:e?.gap??a.sidebarGap??a.gap}),side:i({flex_grow:`1`,flex_basis:e?.sideWidth??a.sidebarSideWidth??`auto`}),content:i({flex_grow:`999`,flex_basis:`0`,min_inline_size:e?.contentMin??a.sidebarContentMin})}}function f(e){let t=e?.gap??a.gap,r=i({margin_block:`auto`});return{root:n(i({display:`flex`,flex_direction:`column`,min_block_size:e?.minHeight??a.coverMinHeight,padding:e?.padding??t}),i({margin_block:t},{selector:`& > :not(.${r})`}),i({margin_block_start:`0`},{selector:`& > :first-child:not(.${r})`}),i({margin_block_end:`0`},{selector:`& > :last-child:not(.${r})`})),centered:r}}function p(e){return n(i({aspect_ratio:e?.ratio??a.frameRatio,overflow:`hidden`,display:`flex`,justify_content:`center`,align_items:`center`}),i({inline_size:`100%`,block_size:`100%`,object_fit:`cover`},{selector:`& > img, & > video`}))}function m(e){return n(i({display:`flex`,block_size:e?.height??`auto`,overflow_x:`auto`,overflow_y:`hidden`,gap:e?.gap??a.gap}),i({flex:`0 0 ${e?.itemWidth??`auto`}`},{selector:`& > *`}),i({block_size:`100%`,flex_basis:`auto`,inline_size:`auto`},{selector:`& > img`}))}function h(e){let t=e?.margin??`0px`;return n(i({position:e?.fixed?`fixed`:`absolute`,inset_block_start:`50%`,inset_inline_start:`50%`,transform:`translate(-50%, -50%)`}),e?.contain?i({overflow:`auto`,max_inline_size:`calc(100% - (${t} * 2))`,max_block_size:`calc(100% - (${t} * 2))`}):``)}function g(e){return n(i({box_sizing:`border-box`,padding:e?.padding??a.boxPadding??a.gap}),e?.border?i({border:e.border}):``)}return{stack:o,cluster:s,center:c,grid:l,switcher:u,sidebar:d,cover:f,frame:p,reel:m,imposter:h,box:g}}export{r as createLayout};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { t as Properties } from "./properties-FKQ-gJeC.js";
|
|
2
|
+
|
|
3
|
+
//#region src/registry.d.ts
|
|
4
|
+
type Registry = Map<string, [string[], Partial<Properties>]>;
|
|
5
|
+
declare function registerCss(designator: string, selectors: string[], properties: Partial<Properties>): void;
|
|
6
|
+
declare function runWithRegistry<T>(fn: () => T): {
|
|
7
|
+
result: T;
|
|
8
|
+
registry: Registry;
|
|
9
|
+
};
|
|
10
|
+
type RunWithRegistry<T> = (fn: () => T) => {
|
|
11
|
+
result: T;
|
|
12
|
+
registry: Registry;
|
|
13
|
+
};
|
|
14
|
+
//#endregion
|
|
15
|
+
export { runWithRegistry as i, RunWithRegistry as n, registerCss as r, Registry as t };
|
package/dist/registry.d.ts
CHANGED
|
@@ -1,15 +1,2 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
|
|
3
|
-
//#region src/registry.d.ts
|
|
4
|
-
type Registry = Map<string, [string[], Partial<Properties>]>;
|
|
5
|
-
declare function registerCss(designator: string, selectors: string[], properties: Partial<Properties>): void;
|
|
6
|
-
declare function runWithRegistry<T>(fn: () => T): {
|
|
7
|
-
result: T;
|
|
8
|
-
registry: Registry;
|
|
9
|
-
};
|
|
10
|
-
type RunWithRegistry<T> = (fn: () => T) => {
|
|
11
|
-
result: T;
|
|
12
|
-
registry: Registry;
|
|
13
|
-
};
|
|
14
|
-
//#endregion
|
|
1
|
+
import { i as runWithRegistry, n as RunWithRegistry, r as registerCss, t as Registry } from "./registry-Bg8dxPHm.js";
|
|
15
2
|
export { Registry, RunWithRegistry, registerCss, runWithRegistry };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cirrojs",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.11",
|
|
4
4
|
"description": "React islands SSG with strict CSP (no unsafe-inline). Vite-based, MPA-first.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -31,6 +31,10 @@
|
|
|
31
31
|
"types": "./dist/cli.d.ts",
|
|
32
32
|
"default": "./dist/cli.js"
|
|
33
33
|
},
|
|
34
|
+
"./layout": {
|
|
35
|
+
"types": "./dist/layout.d.ts",
|
|
36
|
+
"default": "./dist/layout.js"
|
|
37
|
+
},
|
|
34
38
|
"./registry": {
|
|
35
39
|
"types": "./dist/registry.d.ts",
|
|
36
40
|
"browser": "./dist/registry.browser.js",
|