@pyreon/coolgrid 0.52.0 → 0.53.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/README.md +4 -0
- package/lib/native-plugin.d.ts +41 -0
- package/lib/native-plugin.js +158 -0
- package/lib/native-plugin.js.map +1 -0
- package/package.json +28 -9
package/README.md
CHANGED
|
@@ -177,6 +177,10 @@ Swap any layer's root element via `component`:
|
|
|
177
177
|
|
|
178
178
|
Full docs: [pyreon.dev/docs/coolgrid](https://pyreon.dev/docs/coolgrid) (or `docs/src/content/docs/coolgrid.md` in this repo).
|
|
179
179
|
|
|
180
|
+
## Native (iOS / Android)
|
|
181
|
+
|
|
182
|
+
`Container` and `Row` lower to native stacks, and a `<Col size={n}>` with a literal integer span to a fractional width of a 12-column grid (a responsive or non-literal `size` collapses to an equal-fill child with a named warning). The compile-time half ships in this package (`src/native-plugin/`, declared in `package.json` as `pyreon.native.plugin` and discovered by `pyreon-native`), not in `@pyreon/native-compiler`.
|
|
183
|
+
|
|
180
184
|
## License
|
|
181
185
|
|
|
182
186
|
MIT
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { CompilerPlugin, ElementLowering, JsxElementIR } from "@pyreon/native-compiler/plugin-api";
|
|
2
|
+
//#region src/native-plugin/plugin.d.ts
|
|
3
|
+
/** coolgrid tags this lowering claims. */
|
|
4
|
+
export declare const COOLGRID_TAGS: readonly ["Container", "Row", "Col"];
|
|
5
|
+
export declare function isCoolgridTag(name: string): boolean;
|
|
6
|
+
/**
|
|
7
|
+
* `<Container>` → a vertical `<Stack>`; `<Row>` → a horizontal `<Stack>`. Grid-
|
|
8
|
+
* specific props (columns/gutter/size/contentAlignX) are stripped; `gap` (raw px)
|
|
9
|
+
* is converted to the Stack's scale index; padding/style pass through. (`<Col>`
|
|
10
|
+
* is emitted separately — it needs the equal-fill modifier.)
|
|
11
|
+
*/
|
|
12
|
+
export declare function coolgridToStack(e: JsxElementIR): JsxElementIR;
|
|
13
|
+
/** The default coolgrid column count. A `<Col size>` is a span out of this.
|
|
14
|
+
* v1 assumes the default — a custom `columns` on the Row is not threaded to
|
|
15
|
+
* its Cols (documented). */
|
|
16
|
+
export declare const DEFAULT_COLUMNS = 12;
|
|
17
|
+
/** True if `<Col size=…>` carries an explicit span (of any shape — literal,
|
|
18
|
+
* responsive object/array, or non-literal). */
|
|
19
|
+
export declare function colHasExplicitSize(e: JsxElementIR): boolean;
|
|
20
|
+
/** The `<Col size={n}>` LITERAL integer span (clamped to 1..DEFAULT_COLUMNS), or
|
|
21
|
+
* null when absent / non-literal / responsive (`{ xs, md }` / `[a,b]`). Only a
|
|
22
|
+
* plain literal integer gets a fractional width; every other shape falls back
|
|
23
|
+
* to an equal column (the caller warns on a present-but-non-literal size). */
|
|
24
|
+
export declare function colSizeLiteral(e: JsxElementIR): number | null;
|
|
25
|
+
/** The `<Col>` body as a plain `<Stack>` (its children, column direction) — the
|
|
26
|
+
* emit wraps THIS with the per-target equal-fill modifier.
|
|
27
|
+
*
|
|
28
|
+
* `dropTestId` moves the column's `data-testid` OUT of the inner stack so the
|
|
29
|
+
* caller can put it on the node that actually carries the WIDTH. Device-found:
|
|
30
|
+
* with the id on the inner stack, the tagged node hugs its glyph (a 3/12
|
|
31
|
+
* column measured 7.2dp of a 308dp row — 2.3%, not 25%), so the column's real
|
|
32
|
+
* geometry was unaddressable and therefore unassertable. Same class as the
|
|
33
|
+
* `<Link>` identifier drop: an element you cannot select is an element nobody
|
|
34
|
+
* can prove works. Swift never had the split — it puts
|
|
35
|
+
* `.accessibilityIdentifier` and `.containerRelativeFrame` on one node. */
|
|
36
|
+
export declare function colToStack(e: JsxElementIR, dropTestId?: boolean): JsxElementIR;
|
|
37
|
+
export declare const coolgridLowering: ElementLowering;
|
|
38
|
+
/** The `@pyreon/coolgrid` native plugin — discovered from the package manifest when a source imports it. */
|
|
39
|
+
export declare const coolgridPlugin: CompilerPlugin;
|
|
40
|
+
//#endregion
|
|
41
|
+
export { coolgridPlugin as default };
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
//#region src/native-plugin/plugin.ts
|
|
2
|
+
/** coolgrid tags this lowering claims. */
|
|
3
|
+
const COOLGRID_TAGS = [
|
|
4
|
+
"Container",
|
|
5
|
+
"Row",
|
|
6
|
+
"Col"
|
|
7
|
+
];
|
|
8
|
+
function isCoolgridTag(name) {
|
|
9
|
+
return COOLGRID_TAGS.includes(name);
|
|
10
|
+
}
|
|
11
|
+
const STRIP = /* @__PURE__ */ new Set([
|
|
12
|
+
"columns",
|
|
13
|
+
"gutter",
|
|
14
|
+
"size",
|
|
15
|
+
"contentAlignX"
|
|
16
|
+
]);
|
|
17
|
+
const PX_TO_SPACE_INDEX = {
|
|
18
|
+
0: 0,
|
|
19
|
+
4: 1,
|
|
20
|
+
8: 2,
|
|
21
|
+
12: 3,
|
|
22
|
+
16: 4,
|
|
23
|
+
20: 5,
|
|
24
|
+
24: 6,
|
|
25
|
+
32: 7,
|
|
26
|
+
40: 8,
|
|
27
|
+
48: 9
|
|
28
|
+
};
|
|
29
|
+
function directionAttr(value) {
|
|
30
|
+
return {
|
|
31
|
+
kind: "attr",
|
|
32
|
+
name: "direction",
|
|
33
|
+
value: {
|
|
34
|
+
kind: "literal",
|
|
35
|
+
value
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/** Translate a coolgrid `gap` attr (raw px) to the Stack `gap` (scale index).
|
|
40
|
+
* A non-scale px value (e.g. 10) has no index → dropped. */
|
|
41
|
+
function translateGap(a) {
|
|
42
|
+
const v = a.value;
|
|
43
|
+
if (v.kind !== "literal" || typeof v.value !== "number") return a;
|
|
44
|
+
const idx = PX_TO_SPACE_INDEX[v.value];
|
|
45
|
+
if (idx === void 0) return null;
|
|
46
|
+
return {
|
|
47
|
+
kind: "attr",
|
|
48
|
+
name: "gap",
|
|
49
|
+
value: {
|
|
50
|
+
kind: "literal",
|
|
51
|
+
value: idx
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* `<Container>` → a vertical `<Stack>`; `<Row>` → a horizontal `<Stack>`. Grid-
|
|
57
|
+
* specific props (columns/gutter/size/contentAlignX) are stripped; `gap` (raw px)
|
|
58
|
+
* is converted to the Stack's scale index; padding/style pass through. (`<Col>`
|
|
59
|
+
* is emitted separately — it needs the equal-fill modifier.)
|
|
60
|
+
*/
|
|
61
|
+
function coolgridToStack(e) {
|
|
62
|
+
const dir = e.tag === "Row" ? "row" : "column";
|
|
63
|
+
const attrs = [];
|
|
64
|
+
for (const a of e.attrs) {
|
|
65
|
+
if (a.kind === "attr" && STRIP.has(a.name)) continue;
|
|
66
|
+
if (a.kind === "attr" && a.name === "gap") {
|
|
67
|
+
const translated = translateGap(a);
|
|
68
|
+
if (translated) attrs.push(translated);
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
71
|
+
attrs.push(a);
|
|
72
|
+
}
|
|
73
|
+
attrs.push(directionAttr(dir));
|
|
74
|
+
return {
|
|
75
|
+
...e,
|
|
76
|
+
tag: "Stack",
|
|
77
|
+
attrs
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
/** The default coolgrid column count. A `<Col size>` is a span out of this.
|
|
81
|
+
* v1 assumes the default — a custom `columns` on the Row is not threaded to
|
|
82
|
+
* its Cols (documented). */
|
|
83
|
+
const DEFAULT_COLUMNS = 12;
|
|
84
|
+
/** True if `<Col size=…>` carries an explicit span (of any shape — literal,
|
|
85
|
+
* responsive object/array, or non-literal). */
|
|
86
|
+
function colHasExplicitSize(e) {
|
|
87
|
+
return e.attrs.some((a) => a.kind === "attr" && a.name === "size");
|
|
88
|
+
}
|
|
89
|
+
/** The `<Col size={n}>` LITERAL integer span (clamped to 1..DEFAULT_COLUMNS), or
|
|
90
|
+
* null when absent / non-literal / responsive (`{ xs, md }` / `[a,b]`). Only a
|
|
91
|
+
* plain literal integer gets a fractional width; every other shape falls back
|
|
92
|
+
* to an equal column (the caller warns on a present-but-non-literal size). */
|
|
93
|
+
function colSizeLiteral(e) {
|
|
94
|
+
const a = e.attrs.find((x) => x.kind === "attr" && x.name === "size");
|
|
95
|
+
if (!a || a.kind !== "attr") return null;
|
|
96
|
+
const v = a.value;
|
|
97
|
+
if (v.kind !== "literal" || typeof v.value !== "number" || !Number.isInteger(v.value) || v.value <= 0) return null;
|
|
98
|
+
return Math.min(v.value, 12);
|
|
99
|
+
}
|
|
100
|
+
/** The `<Col>` body as a plain `<Stack>` (its children, column direction) — the
|
|
101
|
+
* emit wraps THIS with the per-target equal-fill modifier.
|
|
102
|
+
*
|
|
103
|
+
* `dropTestId` moves the column's `data-testid` OUT of the inner stack so the
|
|
104
|
+
* caller can put it on the node that actually carries the WIDTH. Device-found:
|
|
105
|
+
* with the id on the inner stack, the tagged node hugs its glyph (a 3/12
|
|
106
|
+
* column measured 7.2dp of a 308dp row — 2.3%, not 25%), so the column's real
|
|
107
|
+
* geometry was unaddressable and therefore unassertable. Same class as the
|
|
108
|
+
* `<Link>` identifier drop: an element you cannot select is an element nobody
|
|
109
|
+
* can prove works. Swift never had the split — it puts
|
|
110
|
+
* `.accessibilityIdentifier` and `.containerRelativeFrame` on one node. */
|
|
111
|
+
function colToStack(e, dropTestId = false) {
|
|
112
|
+
const attrs = e.attrs.filter((a) => !(a.kind === "attr" && (STRIP.has(a.name) || dropTestId && a.name === "data-testid")));
|
|
113
|
+
attrs.push(directionAttr("column"));
|
|
114
|
+
return {
|
|
115
|
+
...e,
|
|
116
|
+
tag: "Stack",
|
|
117
|
+
attrs
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
function warnNonLiteralSize(e, ctx) {
|
|
121
|
+
if (colHasExplicitSize(e)) ctx.warn("<Col size=…>: only a LITERAL integer span lowers to a fractional width; a responsive ({ xs, md } / [a,b]) or non-literal size lowers as an EQUAL column.");
|
|
122
|
+
}
|
|
123
|
+
function emitSwiftCol(e, ctx) {
|
|
124
|
+
const body = ctx.emit(colToStack(e));
|
|
125
|
+
const size = colSizeLiteral(e);
|
|
126
|
+
if (size !== null) return `${body}.containerRelativeFrame(.horizontal, count: ${12}, span: ${size}, spacing: 0)`;
|
|
127
|
+
warnNonLiteralSize(e, ctx);
|
|
128
|
+
return `${body}.frame(maxWidth: .infinity)`;
|
|
129
|
+
}
|
|
130
|
+
function emitKotlinCol(e, ctx) {
|
|
131
|
+
const p = ctx.pad();
|
|
132
|
+
const colTestId = ctx.staticAttr(e, "data-testid");
|
|
133
|
+
const idMod = typeof colTestId === "string" ? `.testTag(${ctx.stringLiteral(colTestId)})` : "";
|
|
134
|
+
const inner = `${ctx.pad(ctx.indent + 2)}${ctx.emit(colToStack(e, true), ctx.indent + 2)}`;
|
|
135
|
+
const size = colSizeLiteral(e);
|
|
136
|
+
if (size !== null) return `Box(modifier = Modifier.weight(${size}f)${idMod}) {\n${inner}\n${p}}`;
|
|
137
|
+
warnNonLiteralSize(e, ctx);
|
|
138
|
+
return `Box(modifier = Modifier.weight(1f)${idMod}) {\n${inner}\n${p}}`;
|
|
139
|
+
}
|
|
140
|
+
const coolgridLowering = Object.freeze({
|
|
141
|
+
module: "@pyreon/coolgrid",
|
|
142
|
+
tags: COOLGRID_TAGS,
|
|
143
|
+
retag: (e) => e.tag === "Col" ? void 0 : coolgridToStack(e),
|
|
144
|
+
emit: Object.freeze({
|
|
145
|
+
swift: emitSwiftCol,
|
|
146
|
+
kotlin: emitKotlinCol
|
|
147
|
+
})
|
|
148
|
+
});
|
|
149
|
+
/** The `@pyreon/coolgrid` native plugin — discovered from the package manifest when a source imports it. */
|
|
150
|
+
const coolgridPlugin = Object.freeze({
|
|
151
|
+
name: coolgridLowering.module,
|
|
152
|
+
apiVersion: 2,
|
|
153
|
+
elements: Object.freeze([coolgridLowering])
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
//#endregion
|
|
157
|
+
export { COOLGRID_TAGS, DEFAULT_COLUMNS, colHasExplicitSize, colSizeLiteral, colToStack, coolgridLowering, coolgridPlugin, coolgridPlugin as default, coolgridToStack, isCoolgridTag };
|
|
158
|
+
//# sourceMappingURL=native-plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"native-plugin.js","names":[],"sources":["../src/native-plugin/plugin.ts"],"sourcesContent":["// ============================================================================\n// `@pyreon/coolgrid` native FRONTEND — the 12-column responsive grid onto native\n// layout. `<Container>` / `<Row>` / `<Col>` are a Bootstrap-style flex grid:\n// Container (flex-direction: column) → a vertical Stack\n// Row (flex-direction: row) → a horizontal Stack\n// Col (width = size/columns) → a fractional (or equal-fill) child\n//\n// Container/Row are exactly the canonical Stack in a different vocabulary, so\n// they retag to `<Stack>` and the existing emit lowers them. Col is emitted\n// specially:\n// - `<Col size={8}>` (a LITERAL integer span) → a FRACTIONAL width of a\n// 12-column grid: SwiftUI `.containerRelativeFrame(.horizontal, count: 12,\n// span: 8, spacing: 0)` (iOS 17 native grid-column primitive), Compose\n// `Modifier.fillMaxWidth(8f / 12f)`. Both give the same size/12 absolute\n// fraction, so a partial row (cols summing < 12) leaves the rest empty —\n// faithful to coolgrid.\n// - `<Col>` with no size → an EQUAL-fill child (SwiftUI `.frame(maxWidth:\n// .infinity)`, Compose `Modifier.weight(1f)`), valid because a Col always\n// sits inside a Row = a horizontal Stack.\n//\n// SCOPE (v1) + honest caveats: only a LITERAL integer `size` is fractional; a\n// responsive `size` ({ xs, md } / [a,b,c]) or non-literal collapses to equal +\n// warns. The grid is assumed 12-column — a custom `columns` on the Row is not\n// threaded to its Cols. SwiftUI's `containerRelativeFrame` is relative to the\n// nearest CONTAINER (≈ the Row when the Container is full-width, the coolgrid\n// norm; a deeply-nested narrow row is approximate); the gutter is not subtracted\n// from the fractional width (cols summing to exactly 12 + a large gap can\n// slightly overflow on a very narrow screen). Compose `fillMaxWidth` is exact +\n// parent-relative.\n// ============================================================================\n\nimport {\n type AttrIR,\n type CompilerPlugin,\n type ElementLowering,\n type EmitContext,\n type JsxElementIR,\n} from '@pyreon/native-compiler/plugin-api'\n\n/** coolgrid tags this lowering claims. */\nexport const COOLGRID_TAGS = ['Container', 'Row', 'Col'] as const\n\nexport function isCoolgridTag(name: string): boolean {\n return (COOLGRID_TAGS as readonly string[]).includes(name)\n}\n\n// coolgrid props with no canonical-Stack equivalent (grid math) — stripped.\nconst STRIP = new Set(['columns', 'gutter', 'size', 'contentAlignX'])\n\n// coolgrid `gap` is a RAW PIXEL number; the canonical Stack's `gap` is a SCALE\n// INDEX (0→0, 1→4, …, 9→48px). This reverse map converts a raw-px gap to the\n// matching Stack index so `gap={16}` → 16px (index 4), not \"index 16\" (= 0).\nconst PX_TO_SPACE_INDEX: Record<number, number> = {\n 0: 0, 4: 1, 8: 2, 12: 3, 16: 4, 20: 5, 24: 6, 32: 7, 40: 8, 48: 9,\n}\n\nfunction directionAttr(value: string): AttrIR {\n return { kind: 'attr', name: 'direction', value: { kind: 'literal', value } }\n}\n\n/** Translate a coolgrid `gap` attr (raw px) to the Stack `gap` (scale index).\n * A non-scale px value (e.g. 10) has no index → dropped. */\nfunction translateGap(a: Extract<AttrIR, { kind: 'attr' }>): AttrIR | null {\n const v = a.value\n if (v.kind !== 'literal' || typeof v.value !== 'number') return a // token/non-literal → pass through\n const idx = PX_TO_SPACE_INDEX[v.value]\n if (idx === undefined) return null // off-scale px → drop\n return { kind: 'attr', name: 'gap', value: { kind: 'literal', value: idx } }\n}\n\n/**\n * `<Container>` → a vertical `<Stack>`; `<Row>` → a horizontal `<Stack>`. Grid-\n * specific props (columns/gutter/size/contentAlignX) are stripped; `gap` (raw px)\n * is converted to the Stack's scale index; padding/style pass through. (`<Col>`\n * is emitted separately — it needs the equal-fill modifier.)\n */\nexport function coolgridToStack(e: JsxElementIR): JsxElementIR {\n const dir = e.tag === 'Row' ? 'row' : 'column'\n const attrs: AttrIR[] = []\n for (const a of e.attrs) {\n if (a.kind === 'attr' && STRIP.has(a.name)) continue\n if (a.kind === 'attr' && a.name === 'gap') {\n const translated = translateGap(a)\n if (translated) attrs.push(translated)\n continue\n }\n attrs.push(a)\n }\n attrs.push(directionAttr(dir))\n return { ...e, tag: 'Stack', attrs }\n}\n\n/** The default coolgrid column count. A `<Col size>` is a span out of this.\n * v1 assumes the default — a custom `columns` on the Row is not threaded to\n * its Cols (documented). */\nexport const DEFAULT_COLUMNS = 12\n\n/** True if `<Col size=…>` carries an explicit span (of any shape — literal,\n * responsive object/array, or non-literal). */\nexport function colHasExplicitSize(e: JsxElementIR): boolean {\n return e.attrs.some((a) => a.kind === 'attr' && a.name === 'size')\n}\n\n/** The `<Col size={n}>` LITERAL integer span (clamped to 1..DEFAULT_COLUMNS), or\n * null when absent / non-literal / responsive (`{ xs, md }` / `[a,b]`). Only a\n * plain literal integer gets a fractional width; every other shape falls back\n * to an equal column (the caller warns on a present-but-non-literal size). */\nexport function colSizeLiteral(e: JsxElementIR): number | null {\n const a = e.attrs.find((x) => x.kind === 'attr' && x.name === 'size')\n if (!a || a.kind !== 'attr') return null\n const v = a.value\n if (v.kind !== 'literal' || typeof v.value !== 'number' || !Number.isInteger(v.value) || v.value <= 0) {\n return null\n }\n return Math.min(v.value, DEFAULT_COLUMNS)\n}\n\n/** The `<Col>` body as a plain `<Stack>` (its children, column direction) — the\n * emit wraps THIS with the per-target equal-fill modifier.\n *\n * `dropTestId` moves the column's `data-testid` OUT of the inner stack so the\n * caller can put it on the node that actually carries the WIDTH. Device-found:\n * with the id on the inner stack, the tagged node hugs its glyph (a 3/12\n * column measured 7.2dp of a 308dp row — 2.3%, not 25%), so the column's real\n * geometry was unaddressable and therefore unassertable. Same class as the\n * `<Link>` identifier drop: an element you cannot select is an element nobody\n * can prove works. Swift never had the split — it puts\n * `.accessibilityIdentifier` and `.containerRelativeFrame` on one node. */\nexport function colToStack(e: JsxElementIR, dropTestId = false): JsxElementIR {\n const attrs = e.attrs.filter(\n (a) => !(a.kind === 'attr' && (STRIP.has(a.name) || (dropTestId && a.name === 'data-testid'))),\n )\n attrs.push(directionAttr('column'))\n return { ...e, tag: 'Stack', attrs }\n}\n\nfunction warnNonLiteralSize(e: JsxElementIR, ctx: EmitContext): void {\n if (colHasExplicitSize(e)) {\n // A responsive / non-literal `size` can't resolve to a static span → equal.\n ctx.warn(\n `<Col size=…>: only a LITERAL integer span lowers to a fractional width; ` +\n `a responsive ({ xs, md } / [a,b]) or non-literal size lowers as an EQUAL column.`,\n )\n }\n}\n\nfunction emitSwiftCol(e: JsxElementIR, ctx: EmitContext): string {\n const body = ctx.emit(colToStack(e))\n const size = colSizeLiteral(e)\n if (size !== null) {\n // Fractional span of a 12-column grid — iOS 17's native grid-column\n // primitive (relative to the nearest container; greediness-free, unlike a\n // GeometryReader). A partial row (cols summing < 12) leaves the rest empty.\n return `${body}.containerRelativeFrame(.horizontal, count: ${DEFAULT_COLUMNS}, span: ${size}, spacing: 0)`\n }\n warnNonLiteralSize(e, ctx)\n return `${body}.frame(maxWidth: .infinity)`\n}\n\nfunction emitKotlinCol(e: JsxElementIR, ctx: EmitContext): string {\n const p = ctx.pad()\n // The test id rides the SIZED node (the Box), not the inner stack — see\n // colToStack's `dropTestId`. The id is emitted here as part of the Box's\n // modifier chain so exactly one node carries it.\n const colTestId = ctx.staticAttr(e, 'data-testid')\n const idMod = typeof colTestId === 'string' ? `.testTag(${ctx.stringLiteral(colTestId)})` : ''\n const inner = `${ctx.pad(ctx.indent + 2)}${ctx.emit(colToStack(e, true), ctx.indent + 2)}`\n const size = colSizeLiteral(e)\n if (size !== null) {\n // A 12-column span lowers to RowScope `weight`, NOT `fillMaxWidth(n/12)`.\n // Device-found: a Row measures each child against the REMAINING width, so\n // fractional fills compound — 3/12 then 9/12 yields 25% + 56%, and the row\n // never adds up. `weight(3f)` + `weight(9f)` divides the row exactly, which\n // is what a grid means and what the Swift twin's\n // `containerRelativeFrame(count:span:)` already did.\n return `Box(modifier = Modifier.weight(${size}f)${idMod}) {\\n${inner}\\n${p}}`\n }\n warnNonLiteralSize(e, ctx)\n return `Box(modifier = Modifier.weight(1f)${idMod}) {\\n${inner}\\n${p}}`\n}\n\nexport const coolgridLowering: ElementLowering = Object.freeze({\n module: '@pyreon/coolgrid',\n tags: COOLGRID_TAGS,\n retag: (e: JsxElementIR) => (e.tag === 'Col' ? undefined : coolgridToStack(e)),\n emit: Object.freeze({ swift: emitSwiftCol, kotlin: emitKotlinCol }),\n})\n\n/** The `@pyreon/coolgrid` native plugin — discovered from the package manifest when a source imports it. */\nexport const coolgridPlugin: CompilerPlugin = Object.freeze({\n name: coolgridLowering.module,\n apiVersion: 2,\n elements: Object.freeze([coolgridLowering]),\n})\n"],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pyreon/coolgrid",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.53.0",
|
|
4
4
|
"description": "Responsive grid system for Pyreon",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/pyreon/pyreon/tree/main/packages/ui-system/coolgrid#readme",
|
|
@@ -20,6 +20,10 @@
|
|
|
20
20
|
".": {
|
|
21
21
|
"import": "./lib/index.js",
|
|
22
22
|
"types": "./lib/index.d.ts"
|
|
23
|
+
},
|
|
24
|
+
"./native-plugin": {
|
|
25
|
+
"import": "./lib/native-plugin.js",
|
|
26
|
+
"types": "./lib/native-plugin.d.ts"
|
|
23
27
|
}
|
|
24
28
|
},
|
|
25
29
|
"files": [
|
|
@@ -40,19 +44,21 @@
|
|
|
40
44
|
"typecheck": "tsc --noEmit"
|
|
41
45
|
},
|
|
42
46
|
"peerDependencies": {
|
|
43
|
-
"@pyreon/core": "^0.
|
|
44
|
-
"@pyreon/reactivity": "^0.
|
|
47
|
+
"@pyreon/core": "^0.53.0",
|
|
48
|
+
"@pyreon/reactivity": "^0.53.0",
|
|
49
|
+
"@pyreon/native-compiler": "^0.53.0"
|
|
45
50
|
},
|
|
46
51
|
"dependencies": {
|
|
47
|
-
"@pyreon/ui-core": "^0.
|
|
48
|
-
"@pyreon/unistyle": "^0.
|
|
52
|
+
"@pyreon/ui-core": "^0.53.0",
|
|
53
|
+
"@pyreon/unistyle": "^0.53.0"
|
|
49
54
|
},
|
|
50
55
|
"devDependencies": {
|
|
51
56
|
"@pyreon/manifest": "0.50.0",
|
|
52
|
-
"@pyreon/
|
|
53
|
-
"@pyreon/
|
|
54
|
-
"@pyreon/
|
|
55
|
-
"@pyreon/
|
|
57
|
+
"@pyreon/native-compiler": "0.53.0",
|
|
58
|
+
"@pyreon/styler": "^0.53.0",
|
|
59
|
+
"@pyreon/test-utils": "^0.50.3",
|
|
60
|
+
"@pyreon/tsconfig": "0.50.3",
|
|
61
|
+
"@pyreon/typescript": "^0.53.0",
|
|
56
62
|
"@pyreon/vitest-config": "0.50.0",
|
|
57
63
|
"@vitest/browser-playwright": "^5.0.2",
|
|
58
64
|
"@vitus-labs/tools-rolldown": "^2.6.3"
|
|
@@ -62,5 +68,18 @@
|
|
|
62
68
|
},
|
|
63
69
|
"publishConfig": {
|
|
64
70
|
"access": "public"
|
|
71
|
+
},
|
|
72
|
+
"peerDependenciesMeta": {
|
|
73
|
+
"@pyreon/native-compiler": {
|
|
74
|
+
"optional": true
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
"pyreon": {
|
|
78
|
+
"native": {
|
|
79
|
+
"plugin": "./lib/native-plugin.js",
|
|
80
|
+
"modules": [
|
|
81
|
+
"@pyreon/coolgrid"
|
|
82
|
+
]
|
|
83
|
+
}
|
|
65
84
|
}
|
|
66
85
|
}
|