@wonderlandlabs-pixi-ux/box 1.0.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.
Files changed (63) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.BOX_VALUES.md +255 -0
  3. package/README.md +68 -0
  4. package/dist/Box.stories.d.ts +15 -0
  5. package/dist/Box.stories.js +103 -0
  6. package/dist/BoxLeafStore.d.ts +7 -0
  7. package/dist/BoxLeafStore.js +9 -0
  8. package/dist/BoxListStore.d.ts +7 -0
  9. package/dist/BoxListStore.js +10 -0
  10. package/dist/BoxStore.d.ts +56 -0
  11. package/dist/BoxStore.js +653 -0
  12. package/dist/BoxTextStore.d.ts +10 -0
  13. package/dist/BoxTextStore.js +6 -0
  14. package/dist/BoxTree.d.ts +48 -0
  15. package/dist/BoxTree.js +483 -0
  16. package/dist/ProductCatalog.stories.d.ts +10 -0
  17. package/dist/ProductCatalog.stories.js +221 -0
  18. package/dist/_deprecated/Box.stories.d.ts +15 -0
  19. package/dist/_deprecated/Box.stories.js +103 -0
  20. package/dist/_deprecated/BoxLeafStore.d.ts +7 -0
  21. package/dist/_deprecated/BoxLeafStore.js +9 -0
  22. package/dist/_deprecated/BoxListStore.d.ts +7 -0
  23. package/dist/_deprecated/BoxListStore.js +10 -0
  24. package/dist/_deprecated/BoxStore.d.ts +56 -0
  25. package/dist/_deprecated/BoxStore.js +654 -0
  26. package/dist/_deprecated/BoxTextStore.d.ts +10 -0
  27. package/dist/_deprecated/BoxTextStore.js +6 -0
  28. package/dist/_deprecated/ProductCatalog.stories.d.ts +10 -0
  29. package/dist/_deprecated/ProductCatalog.stories.js +222 -0
  30. package/dist/_deprecated/types.d.ts +564 -0
  31. package/dist/_deprecated/types.js +211 -0
  32. package/dist/boxTreeRenderers.d.ts +28 -0
  33. package/dist/boxTreeRenderers.js +97 -0
  34. package/dist/constants.d.ts +60 -0
  35. package/dist/constants.js +76 -0
  36. package/dist/enumUtils.d.ts +1 -0
  37. package/dist/enumUtils.js +7 -0
  38. package/dist/index.d.ts +7 -0
  39. package/dist/index.js +7 -0
  40. package/dist/measurement.d.ts +41 -0
  41. package/dist/measurement.js +52 -0
  42. package/dist/pathUtils.d.ts +5 -0
  43. package/dist/pathUtils.js +31 -0
  44. package/dist/sizeUtils.d.ts +12 -0
  45. package/dist/sizeUtils.js +32 -0
  46. package/dist/types.boxtree.d.ts +806 -0
  47. package/dist/types.boxtree.js +99 -0
  48. package/dist/types.d.ts +113 -0
  49. package/dist/types.js +59 -0
  50. package/package.json +29 -0
  51. package/src/BoxTree.ts +606 -0
  52. package/src/boxTreeRenderers.ts +189 -0
  53. package/src/constants.ts +87 -0
  54. package/src/enumUtils.ts +9 -0
  55. package/src/index.ts +106 -0
  56. package/src/pathUtils.ts +39 -0
  57. package/src/sizeUtils.ts +57 -0
  58. package/src/types.boxtree.ts +175 -0
  59. package/src/types.ts +96 -0
  60. package/test/BoxTree.test.ts +561 -0
  61. package/test/boxTreeRenderers.test.ts +80 -0
  62. package/test/sizeUtils.test.ts +132 -0
  63. package/tsconfig.json +19 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,13 @@
1
+ # CHANGELOG
2
+
3
+ ## 1.0
4
+
5
+ Achieved a basic system to use nested containers / tree system
6
+ to express flex -like containment in pixi
7
+
8
+ ## 1.0.1
9
+
10
+ Refactored for a single - class expression; full reboot with
11
+ fewer size modes and more robust updating. Fully removed all pixi/
12
+ rendering from the boxes; child classes/external utilities responsible
13
+ for rendering content.
@@ -0,0 +1,255 @@
1
+ # BoxTree Value Model
2
+
3
+ This document describes the current value model for `BoxTree` in `@wonderlandlabs-pixi-ux/box`.
4
+
5
+ ## Scope
6
+
7
+ This is for the new tree/value geometry model in:
8
+
9
+ - `/Users/davidedelhart/Documents/repos/forestry-pixi/packages/box/src/BoxTree.ts`
10
+ - `/Users/davidedelhart/Documents/repos/forestry-pixi/packages/box/src/types.boxtree.ts`
11
+ - `/Users/davidedelhart/Documents/repos/forestry-pixi/packages/box/src/types.ts`
12
+ - `/Users/davidedelhart/Documents/repos/forestry-pixi/packages/box/src/sizeUtils.ts`
13
+
14
+ ## State Schema
15
+
16
+ ```ts
17
+ type Measurement = { mode: 'px' | '%'; value: number };
18
+
19
+ type AxisConstrain = {
20
+ min?: number; // px
21
+ max?: number; // px
22
+ };
23
+
24
+ type BoxContent = {
25
+ type: 'text' | 'url';
26
+ value: string;
27
+ };
28
+
29
+ type BoxTreeState = {
30
+ area: {
31
+ x: number;
32
+ y: number;
33
+ width: Measurement;
34
+ height: Measurement;
35
+ px?: 's' | 'c' | 'e'; // optional pivot-x, aliases: < | >
36
+ py?: 's' | 'c' | 'e'; // optional pivot-y, aliases: < | >
37
+ };
38
+ align: {
39
+ x: 's' | 'c' | 'e' | 'f';
40
+ y: 's' | 'c' | 'e' | 'f';
41
+ direction: 'row' | 'column';
42
+ };
43
+ order: number;
44
+ absolute: boolean;
45
+ constrain?: { x?: AxisConstrain; y?: AxisConstrain };
46
+ content?: BoxContent;
47
+ style?: BoxStyle;
48
+ id?: string;
49
+ children?: Map<string, BoxTreeState>;
50
+ };
51
+ ```
52
+
53
+ ## Core Rules
54
+
55
+ - `x` and `y` are local (container-relative) coordinates.
56
+ - `absX` and `absY` are world-space coordinates.
57
+ - Root config must explicitly provide `area.x` and `area.y` (even `0, 0`) to define anchor origin.
58
+ - `state.area.width` and `state.area.height` are measurements (`px` or `%`).
59
+ - `state.area.px` and `state.area.py` are optional pivot axes and default to `s`.
60
+ - `align.direction` controls child flow axis and defaults to `column`.
61
+ - `order` controls sibling ordering (ascending; ties sorted by child key).
62
+ - `absolute: true` means the node uses its own area position/sizing and ignores align-driven positioning/fill behavior.
63
+ - `content` is optional structured payload for text or url content metadata (`{ type: 'text' | 'url', value: string }`).
64
+ - For layout/rendering, read geometry from local getters (`x`, `y`, `width`, `height`, `area`) instead of raw state values.
65
+ - Children are stored in `Map<string, BoxTreeState>`.
66
+ - Child branches are passively created with Forestry wildcard branch params (`'*'`).
67
+
68
+ ## Zod Schemas
69
+
70
+ The model is now Zod-first. Types are inferred from schemas and values are gated through parsing.
71
+
72
+ Primary schemas in `/Users/davidedelhart/Documents/repos/forestry-pixi/packages/box/src/types.boxtree.ts`:
73
+
74
+ - `AxisSchema`
75
+ - `AlignKeywordSchema`
76
+ - `AlignInputSchema`
77
+ - `AreaPivotKeywordSchema`
78
+ - `AreaPivotInputSchema`
79
+ - `BoxAreaSchema`
80
+ - `DirectionSchema`
81
+ - `BoxAlignSchema`
82
+ - `BoxConstrainSchema`
83
+ - `BoxTreeNodeStateSchema`
84
+ - `BoxTreeNodeConfigSchema`
85
+
86
+ Primary schemas in `/Users/davidedelhart/Documents/repos/forestry-pixi/packages/box/src/types.ts`:
87
+
88
+ - `SizeModeSchema`
89
+ - `MeasurementConfigSchema`
90
+ - `MeasurementSchema`
91
+ - `PxValueSchema`
92
+ - `AxisConstraintSchema`
93
+
94
+ ## Align Semantics
95
+
96
+ Accepted input values:
97
+
98
+ - `s` (`start`)
99
+ - `c` (`center`)
100
+ - `e` (`end`)
101
+ - `f` (`fill`)
102
+ - Aliases:
103
+ - `<` -> `s`
104
+ - `|` -> `c`
105
+ - `>` -> `e`
106
+ - `<>` -> `f`
107
+
108
+ Readable constants are exported for config readability:
109
+
110
+ ```ts
111
+ import { ALIGN } from '@wonderlandlabs-pixi-ux/box';
112
+
113
+ const align = {
114
+ x: ALIGN.RIGHT,
115
+ y: ALIGN.MIDDLE,
116
+ };
117
+ ```
118
+
119
+ Meaning:
120
+
121
+ - `s`: place child at parent start edge (+ local `area.x/y` offset).
122
+ - `c`: center child in parent (+ local offset).
123
+ - `e`: place child at parent end edge (- local offset).
124
+ - `f`: size child to parent axis size, position like `s`.
125
+
126
+ ## Pivot Semantics (`area.px` / `area.py`)
127
+
128
+ Accepted values:
129
+
130
+ - Canonical: `s`, `c`, `e`
131
+ - Aliases: `<`, `|`, `>`
132
+
133
+ Meaning per axis:
134
+
135
+ - `s`: anchor is at the start edge of the box on that axis.
136
+ - `c`: anchor is at the center of the box on that axis.
137
+ - `e`: anchor is at the end edge of the box on that axis.
138
+
139
+ Resolved local position is:
140
+
141
+ - `x = anchorX - pivotOffsetX`
142
+ - `y = anchorY - pivotOffsetY`
143
+ - `pivotOffsetX = 0 | width/2 | width` for `s | c | e`
144
+ - `pivotOffsetY = 0 | height/2 | height` for `s | c | e`
145
+
146
+ ## Constrain Semantics
147
+
148
+ `constrain.x` and `constrain.y` each support:
149
+
150
+ - `min?: number` (px)
151
+ - `max?: number` (px)
152
+
153
+ ### Impossible Ranges
154
+
155
+ If both `min` and `max` resolve and `min > max`, only `min` is respected.
156
+
157
+ ## Geometry Resolution
158
+
159
+ Width/height resolution per axis:
160
+
161
+ 1. Compute base size:
162
+ - non-absolute + `f` with parent: base = parent axis size
163
+ - otherwise: base = resolved local measurement from `state.area.width` / `state.area.height`
164
+ 2. Resolve axis `min`/`max` constraints.
165
+ 3. Apply constraints to base.
166
+ 4. If `min > max`, clamp only to `min`.
167
+
168
+ Position resolution:
169
+
170
+ - Root:
171
+ - `anchorX = area.x`, `anchorY = area.y`
172
+ - `x/y` are derived from `anchor - pivotOffset`
173
+ - Non-root:
174
+ - local anchor (when `absolute !== true`):
175
+ - on flow axis (`x` for `row`, `y` for `column`): `flowOffset + area.x/y`
176
+ - `s`/`f`: offset
177
+ - `c`: `(parentSize - childSize)/2` + offset
178
+ - `e`: `(parentSize - childSize)` - offset
179
+ - local anchor (when `absolute === true`):
180
+ - always `area.x` / `area.y` (align offsets are ignored)
181
+ - local `x`/`y`:
182
+ - `anchor - pivotOffset`
183
+ - world `absX`/`absY`:
184
+ - `parent.absX + x`, `parent.absY + y`
185
+
186
+ ## Practical Notes
187
+
188
+ - Root nodes generally own explicit `area` dimensions.
189
+ - `state.area.width` / `state.area.height` are measurements.
190
+ - Numeric measurement input is valid and treated as px shorthand (`12` -> `{ mode: 'px', value: 12 }`).
191
+ - `order` defaults to `0`; `absolute` defaults to `false`.
192
+ - Child constrained sizing uses plain px min/max values.
193
+ - `setWidthPx` / `setHeightPx` write measurement `{ mode: 'px', value }`.
194
+ - `setWidthPercent` / `setHeightPercent` write measurement `{ mode: '%', value }`.
195
+ - `resolveMeasurement(measurement, { axis, parentPixels })` resolves a full measurement object directly.
196
+
197
+ ## Config Example
198
+
199
+ ```json
200
+ {
201
+ "id": "root",
202
+ "area": {
203
+ "x": 10,
204
+ "y": 20,
205
+ "width": { "mode": "px", "value": 400 },
206
+ "height": { "mode": "px", "value": 200 }
207
+ },
208
+ "align": { "x": "s", "y": "s", "direction": "column" },
209
+ "children": {
210
+ "bubble": {
211
+ "content": { "type": "text", "value": "Hello there" },
212
+ "area": {
213
+ "x": 5,
214
+ "y": 6,
215
+ "px": ">",
216
+ "py": "<",
217
+ "width": { "mode": "%", "value": 0.2 },
218
+ "height": { "mode": "px", "value": 30 }
219
+ },
220
+ "align": { "x": "e", "y": "c", "direction": "column" },
221
+ "constrain": {
222
+ "x": {
223
+ "min": 40
224
+ }
225
+ }
226
+ }
227
+ }
228
+ }
229
+ ```
230
+
231
+ Notes for this example:
232
+
233
+ - `align` short forms are canonical (`s`, `c`, `e`, `f`).
234
+ - `width` can be `%` and is resolved against parent width.
235
+ - `constrain.x.min` is a px value and is applied directly.
236
+
237
+ ## Measurement Alias: `/`
238
+
239
+ For config input, you can also provide ratio measurements:
240
+
241
+ - `{ "mode": "/", "value": 2, "base": 3 }` means `2/3`, normalized to `{ "mode": "%", "value": 0.666... }`.
242
+ - `base` is required for `/` measurements.
243
+ - `base` must be `>= value`.
244
+ - `base` must be `> 0`.
245
+
246
+ Readable size mode constants are also exported:
247
+
248
+ ```ts
249
+ import { MEASUREMENT_MODE as SIZE } from '@wonderlandlabs-pixi-ux/box';
250
+
251
+ const area = {
252
+ width: { mode: SIZE.FRACTION, value: 2, base: 3 },
253
+ height: { mode: SIZE.PERCENT, value: 0.25 },
254
+ };
255
+ ```
package/README.md ADDED
@@ -0,0 +1,68 @@
1
+ # @wonderlandlabs-pixi-ux/box
2
+
3
+ Tree-first box layout model built on Forestry branches.
4
+
5
+ ## Status
6
+
7
+ - Public API is `BoxTree` + BoxTree measurement/alignment utilities.
8
+
9
+ ## Installation
10
+
11
+ ```bash
12
+ yarn add @wonderlandlabs-pixi-ux/box
13
+ ```
14
+
15
+ ## Basic Usage
16
+
17
+ ```ts
18
+ import { BoxTree, ALIGN, MEASUREMENT_MODE } from '@wonderlandlabs-pixi-ux/box';
19
+
20
+ const root = new BoxTree({
21
+ value: {
22
+ id: 'root',
23
+ area: {
24
+ x: 0,
25
+ y: 0,
26
+ width: { mode: MEASUREMENT_MODE.PIXELS, value: 400 },
27
+ height: { mode: MEASUREMENT_MODE.PIXELS, value: 200 },
28
+ px: 's',
29
+ py: 's',
30
+ },
31
+ align: {
32
+ x: ALIGN.S,
33
+ y: ALIGN.S,
34
+ direction: 'column',
35
+ },
36
+ },
37
+ });
38
+
39
+ root.$set('children.card', {
40
+ id: 'card',
41
+ area: {
42
+ x: 12,
43
+ y: 8,
44
+ width: { mode: MEASUREMENT_MODE.PERCENT, value: 0.5 },
45
+ height: { mode: MEASUREMENT_MODE.PIXELS, value: 48 },
46
+ px: 's',
47
+ py: 's',
48
+ },
49
+ align: { x: 's', y: 's', direction: 'column' },
50
+ });
51
+ ```
52
+
53
+ ## Public API
54
+
55
+ - `BoxTree`
56
+ - `createBoxTreeState`
57
+ - `resolveTreeMeasurement`
58
+ - `resolveMeasurementPx`
59
+ - `resolveConstraintValuePx`
60
+ - `applyAxisConstraints`
61
+ - `boxTreeToPixi`
62
+ - `boxTreeToSvg`
63
+ - `pathToString`, `pathString`, `combinePaths`
64
+ - `ALIGN`, `AXIS`, `MEASUREMENT_MODE`, `SIZE_MODE`, `SIZE_MODE_INPUT`
65
+
66
+ ## Data Model
67
+
68
+ See `/Users/davidedelhart/Documents/repos/forestry-pixi/packages/box/README.BOX_VALUES.md` for the current schema, constraints, aliases, and examples.
@@ -0,0 +1,15 @@
1
+ import type { Meta, StoryObj } from '@storybook/html';
2
+ import type { Align } from './types';
3
+ interface BoxArgs {
4
+ padding: number;
5
+ alignX: Align;
6
+ alignY: Align;
7
+ boxWidth: number;
8
+ boxHeight: number;
9
+ contentWidth: number;
10
+ contentHeight: number;
11
+ }
12
+ declare const meta: Meta<BoxArgs>;
13
+ export default meta;
14
+ type Story = StoryObj<BoxArgs>;
15
+ export declare const AlignmentDemo: Story;
@@ -0,0 +1,103 @@
1
+ import { Application, Graphics } from 'pixi.js';
2
+ import { BoxLeafStore } from './BoxLeafStore';
3
+ const meta = {
4
+ title: 'Box/BoxLeafStore',
5
+ argTypes: {
6
+ padding: {
7
+ control: { type: 'range', min: 0, max: 50, step: 5 },
8
+ description: 'Uniform padding around content',
9
+ },
10
+ alignX: {
11
+ control: { type: 'select' },
12
+ options: ['start', 'center', 'end'],
13
+ description: 'Horizontal alignment of content',
14
+ },
15
+ alignY: {
16
+ control: { type: 'select' },
17
+ options: ['start', 'center', 'end'],
18
+ description: 'Vertical alignment of content',
19
+ },
20
+ boxWidth: {
21
+ control: { type: 'range', min: 100, max: 500, step: 10 },
22
+ description: 'Box width',
23
+ },
24
+ boxHeight: {
25
+ control: { type: 'range', min: 100, max: 400, step: 10 },
26
+ description: 'Box height',
27
+ },
28
+ contentWidth: {
29
+ control: { type: 'range', min: 20, max: 200, step: 10 },
30
+ description: 'Content box width',
31
+ },
32
+ contentHeight: {
33
+ control: { type: 'range', min: 20, max: 200, step: 10 },
34
+ description: 'Content box height',
35
+ },
36
+ },
37
+ args: {
38
+ padding: 20,
39
+ alignX: 'center',
40
+ alignY: 'center',
41
+ boxWidth: 300,
42
+ boxHeight: 200,
43
+ contentWidth: 80,
44
+ contentHeight: 60,
45
+ },
46
+ };
47
+ export default meta;
48
+ export const AlignmentDemo = {
49
+ render: (args) => {
50
+ const wrapper = document.createElement('div');
51
+ wrapper.style.width = '100%';
52
+ wrapper.style.height = '600px';
53
+ wrapper.style.position = 'relative';
54
+ let boxStore;
55
+ const app = new Application();
56
+ app.init({
57
+ width: 800,
58
+ height: 600,
59
+ backgroundColor: 0x1a1a2e,
60
+ antialias: true,
61
+ }).then(() => {
62
+ wrapper.appendChild(app.canvas);
63
+ // Create the box store with new config format
64
+ boxStore = new BoxLeafStore({
65
+ id: 'demo-box',
66
+ x: 250,
67
+ y: 200,
68
+ xDef: { size: args.boxWidth, align: args.alignX, sizeMode: 'px' },
69
+ yDef: { size: args.boxHeight, align: args.alignY, sizeMode: 'px' },
70
+ padding: {
71
+ top: args.padding,
72
+ right: args.padding,
73
+ bottom: args.padding,
74
+ left: args.padding,
75
+ },
76
+ style: {
77
+ fill: {
78
+ color: { r: 0.2, g: 0.3, b: 0.5 },
79
+ alpha: 1,
80
+ },
81
+ stroke: {
82
+ color: { r: 0.4, g: 0.5, b: 0.8 },
83
+ alpha: 1,
84
+ width: 2,
85
+ },
86
+ borderRadius: 8,
87
+ },
88
+ }, app);
89
+ // Create content graphics
90
+ const contentBox = new Graphics({ label: 'content-box' });
91
+ contentBox.roundRect(0, 0, args.contentWidth, args.contentHeight, 4);
92
+ contentBox.fill({ color: 0xff6b6b, alpha: 0.9 });
93
+ contentBox.stroke({ color: 0xffffff, alpha: 0.5, width: 1 });
94
+ // Set content on the leaf store
95
+ boxStore.setContent(contentBox);
96
+ // Add box to stage
97
+ app.stage.addChild(boxStore.container);
98
+ // Trigger initial render
99
+ boxStore.markDirty();
100
+ });
101
+ return wrapper;
102
+ },
103
+ };
@@ -0,0 +1,7 @@
1
+ import { Application, type ContainerOptions, type Graphics, type Sprite, type Text, type Container } from 'pixi.js';
2
+ import { BoxStore } from './BoxStore';
3
+ import type { BaseBoxConfig, BoxProps } from './types';
4
+ export declare class BoxLeafStore extends BoxStore {
5
+ constructor(config: BaseBoxConfig, app: Application, boxProps?: BoxProps, rootProps?: ContainerOptions);
6
+ setContent(content: Graphics | Sprite | Text | Container | null): void;
7
+ }
@@ -0,0 +1,9 @@
1
+ import { BoxStore } from './BoxStore';
2
+ export class BoxLeafStore extends BoxStore {
3
+ constructor(config, app, boxProps, rootProps) {
4
+ super({ ...config, kind: 'leaf' }, app, boxProps, rootProps);
5
+ }
6
+ setContent(content) {
7
+ super.setContent(content);
8
+ }
9
+ }
@@ -0,0 +1,7 @@
1
+ import { Application, type ContainerOptions } from 'pixi.js';
2
+ import { BoxStore } from './BoxStore';
3
+ import type { BaseBoxConfig, BoxProps } from './types';
4
+ export declare class BoxListStore extends BoxStore {
5
+ constructor(config: BaseBoxConfig, app: Application, boxProps?: BoxProps, rootProps?: ContainerOptions);
6
+ addChild(child: BaseBoxConfig | BoxStore): BoxStore;
7
+ }
@@ -0,0 +1,10 @@
1
+ import { BoxStore } from './BoxStore';
2
+ export class BoxListStore extends BoxStore {
3
+ constructor(config, app, boxProps, rootProps) {
4
+ super({ ...config, kind: 'list' }, app, boxProps, rootProps);
5
+ }
6
+ addChild(child) {
7
+ const nextConfig = child instanceof BoxStore ? child.toConfig() : child;
8
+ return super.addChild(nextConfig);
9
+ }
10
+ }
@@ -0,0 +1,56 @@
1
+ import { StoreParams } from '@wonderlandlabs/forestry4';
2
+ import { TickerForest } from '@wonderlandlabs-pixi-ux/ticker-forest';
3
+ import { Application, Container, Graphics, Text, type ContainerOptions, type Sprite, type TextStyleOptions } from 'pixi.js';
4
+ import type { AxisDef, BaseBoxConfig, BoxProps, BoxState, BoxStyle, ContentArea, Padding, RgbColor } from './types';
5
+ export declare class BoxStore extends TickerForest<BoxState> {
6
+ #private;
7
+ readonly id: string;
8
+ protected _container: Container;
9
+ protected _background: Graphics;
10
+ protected _contentContainer: Container;
11
+ maskGraphics: Graphics;
12
+ protected _boxProps: BoxProps;
13
+ constructor(configOrParams: BaseBoxConfig | StoreParams<BoxState>, app: Application, boxProps?: BoxProps, rootProps?: ContainerOptions);
14
+ get container(): Container;
15
+ get contentContainer(): Container;
16
+ get rect(): {
17
+ x: number;
18
+ y: number;
19
+ width: number;
20
+ height: number;
21
+ };
22
+ get xDef(): AxisDef;
23
+ get yDef(): AxisDef;
24
+ get children(): readonly BoxStore[];
25
+ get style(): BoxStyle | undefined;
26
+ setStyle(style: Partial<BoxStyle>): void;
27
+ get gap(): number;
28
+ setGap(gap: number): void;
29
+ get direction(): 'horizontal' | 'vertical';
30
+ setDirection(direction: 'horizontal' | 'vertical'): void;
31
+ get gapMode(): 'between' | 'before' | 'after' | 'all';
32
+ setGapMode(gapMode: 'between' | 'before' | 'after' | 'all'): void;
33
+ get text(): string;
34
+ get textDisplay(): Text | null;
35
+ setText(text: string): void;
36
+ setTextStyle(style: TextStyleOptions): void;
37
+ setPadding(padding: Partial<Padding>): void;
38
+ setPosition(x: number, y: number): void;
39
+ setSize(width: number, height: number): void;
40
+ getContentArea(): ContentArea;
41
+ setContent(content: Graphics | Sprite | Text | Container | null): void;
42
+ get content(): Graphics | Sprite | Text | Container | null;
43
+ addChild(config: BaseBoxConfig): BoxStore;
44
+ removeChild(childOrId: string | BoxStore): void;
45
+ getChild(id: string): BoxStore | undefined;
46
+ toConfig(): BaseBoxConfig;
47
+ protected _rgbToNumber(rgb: RgbColor): number;
48
+ protected _renderBackground(): void;
49
+ protected _updateMask(): void;
50
+ protected _updateContentPosition(): void;
51
+ protected isDirty(): boolean;
52
+ protected clearDirty(): void;
53
+ markDirty(): void;
54
+ protected resolve(): void;
55
+ cleanup(): void;
56
+ }