@glissade/scene 0.18.0-pre.2 → 0.18.0-pre.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/layout.d.ts CHANGED
@@ -77,7 +77,24 @@ interface StackProps extends LayoutProps {}
77
77
  * Every other prop passes straight through to `Layout`.
78
78
  */
79
79
  declare function Stack(props?: StackProps): Layout;
80
+ /**
81
+ * `Row`/`Column` props — `Stack`'s surface MINUS `direction` (the alias pins it).
82
+ * Omitting `direction` from the type means an explicit one can't even be passed,
83
+ * so `Row({...})` is unambiguously a row and `Column({...})` a column.
84
+ */
85
+ interface RowProps extends Omit<StackProps, 'direction'> {}
86
+ /**
87
+ * `Stack({ direction: 'row' })` read as a name — a horizontal stack. Inherits
88
+ * Stack's `align:'start'` default and Layout's pure memoized resolve; the only
89
+ * difference from `Stack` is the pinned `direction`.
90
+ */
91
+ declare function Row(props?: RowProps): Layout;
92
+ /**
93
+ * `Stack({ direction: 'column' })` read as a name — a vertical stack (the same
94
+ * direction `Stack` already defaults to, made explicit at the call site).
95
+ */
96
+ declare function Column(props?: RowProps): Layout;
80
97
  /** Load Yoga (wasm) and register it as the active LayoutEngine. Idempotent. */
81
98
  declare function loadYogaLayoutEngine(): Promise<LayoutEngine>;
82
99
  //#endregion
83
- export { Layout, type LayoutBox, type LayoutChildSpec, type LayoutContainerSpec, type LayoutEngine, LayoutEngineMissingError, LayoutProps, type LayoutResult, Stack, StackProps, getLayoutEngine, loadYogaLayoutEngine, setLayoutEngine };
100
+ export { Column, Layout, type LayoutBox, type LayoutChildSpec, type LayoutContainerSpec, type LayoutEngine, LayoutEngineMissingError, LayoutProps, type LayoutResult, Row, RowProps, Stack, StackProps, getLayoutEngine, loadYogaLayoutEngine, setLayoutEngine };
package/dist/layout.js CHANGED
@@ -170,6 +170,27 @@ function Stack(props = {}) {
170
170
  align: props.align ?? "start"
171
171
  });
172
172
  }
173
+ /**
174
+ * `Stack({ direction: 'row' })` read as a name — a horizontal stack. Inherits
175
+ * Stack's `align:'start'` default and Layout's pure memoized resolve; the only
176
+ * difference from `Stack` is the pinned `direction`.
177
+ */
178
+ function Row(props = {}) {
179
+ return Stack({
180
+ ...props,
181
+ direction: "row"
182
+ });
183
+ }
184
+ /**
185
+ * `Stack({ direction: 'column' })` read as a name — a vertical stack (the same
186
+ * direction `Stack` already defaults to, made explicit at the call site).
187
+ */
188
+ function Column(props = {}) {
189
+ return Stack({
190
+ ...props,
191
+ direction: "column"
192
+ });
193
+ }
173
194
  function initProp(sig, init) {
174
195
  if (typeof init === "function") sig.bindSource(init);
175
196
  else if (init !== void 0) sig.set(init);
@@ -234,4 +255,4 @@ async function loadYogaLayoutEngine() {
234
255
  return engine;
235
256
  }
236
257
  //#endregion
237
- export { Layout, LayoutEngineMissingError, Stack, getLayoutEngine, loadYogaLayoutEngine, setLayoutEngine };
258
+ export { Column, Layout, LayoutEngineMissingError, Row, Stack, getLayoutEngine, loadYogaLayoutEngine, setLayoutEngine };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glissade/scene",
3
- "version": "0.18.0-pre.2",
3
+ "version": "0.18.0-pre.4",
4
4
  "description": "glissade scene graph: nodes, transforms, DisplayList emission. Renderer-agnostic; zero DOM/Node dependencies.",
5
5
  "license": "Apache-2.0",
6
6
  "engines": {
@@ -27,7 +27,7 @@
27
27
  ],
28
28
  "dependencies": {
29
29
  "yoga-layout": "^3.2.1",
30
- "@glissade/core": "0.18.0-pre.2"
30
+ "@glissade/core": "0.18.0-pre.4"
31
31
  },
32
32
  "repository": {
33
33
  "type": "git",