@rb-games/core 0.1.1 → 0.1.2

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 (43) hide show
  1. package/dist/chunk-5BLUF2HG.js +25 -0
  2. package/dist/chunk-5BLUF2HG.js.map +1 -0
  3. package/dist/chunk-DOHQE2YZ.js +392 -0
  4. package/dist/chunk-DOHQE2YZ.js.map +1 -0
  5. package/dist/chunk-FOZO6TLY.js +673 -0
  6. package/dist/chunk-FOZO6TLY.js.map +1 -0
  7. package/dist/chunk-G3PMV62Z.js +33 -0
  8. package/dist/chunk-G3PMV62Z.js.map +1 -0
  9. package/dist/chunk-KOHCRCV3.js +490 -0
  10. package/dist/chunk-KOHCRCV3.js.map +1 -0
  11. package/dist/chunk-MI6BP7A6.js +11 -0
  12. package/dist/chunk-MI6BP7A6.js.map +1 -0
  13. package/dist/chunk-NQMORMNP.js +15 -0
  14. package/dist/chunk-NQMORMNP.js.map +1 -0
  15. package/dist/chunk-RAEOBW6E.js +133 -0
  16. package/dist/chunk-RAEOBW6E.js.map +1 -0
  17. package/dist/chunk-UE7T7Z45.js +884 -0
  18. package/dist/chunk-UE7T7Z45.js.map +1 -0
  19. package/dist/devtools/index.js +2 -882
  20. package/dist/devtools/index.js.map +1 -1
  21. package/dist/engine/index.js +6 -1267
  22. package/dist/engine/index.js.map +1 -1
  23. package/dist/filters/index.js +1 -1
  24. package/dist/helpers/index.js +6 -35
  25. package/dist/helpers/index.js.map +1 -1
  26. package/dist/i18n/index.js +4 -525
  27. package/dist/i18n/index.js.map +1 -1
  28. package/dist/layout/index.js +2 -671
  29. package/dist/layout/index.js.map +1 -1
  30. package/dist/particle/index.js +1 -6
  31. package/dist/particle/index.js.map +1 -1
  32. package/dist/plugins/Plugin.types.d.ts +4 -2
  33. package/dist/plugins/Plugin.types.d.ts.map +1 -1
  34. package/dist/plugins/index.js +6 -521
  35. package/dist/plugins/index.js.map +1 -1
  36. package/dist/state-machine/index.js +1 -1
  37. package/dist/store/index.js +1 -1
  38. package/dist/ui/index.js +5 -531
  39. package/dist/ui/index.js.map +1 -1
  40. package/dist/utils/index.js +4 -897
  41. package/dist/utils/index.js.map +1 -1
  42. package/dist/vite/index.js +1 -1
  43. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
+ import '../chunk-G3PMV62Z.js';
1
2
  import { EventEmitter } from 'pixi.js';
2
3
  import merge from 'lodash/merge';
3
4
 
4
- // state-machine/StateMachine.ts
5
5
  var StateMachine = class extends EventEmitter {
6
6
  config;
7
7
  context;
@@ -1,6 +1,6 @@
1
+ import '../chunk-G3PMV62Z.js';
1
2
  import { EventEmitter } from 'pixi.js';
2
3
 
3
- // store/DataStore.ts
4
4
  var DataStore = class _DataStore extends EventEmitter {
5
5
  constructor(contextId, initialData) {
6
6
  super();
package/dist/ui/index.js CHANGED
@@ -1,32 +1,9 @@
1
- import { Rectangle, Color, Texture, Sprite, Graphics, Container, Text, ColorMatrixFilter, Assets, Point } from 'pixi.js';
1
+ import { Align, Flow } from '../chunk-FOZO6TLY.js';
2
+ import { getNestedValue } from '../chunk-5BLUF2HG.js';
3
+ import { __commonJS, __toESM } from '../chunk-G3PMV62Z.js';
4
+ import { Rectangle, Color, Texture, Sprite, Graphics, Container, Text, ColorMatrixFilter, Assets } from 'pixi.js';
2
5
  import { merge } from 'lodash';
3
6
 
4
- var __create = Object.create;
5
- var __defProp = Object.defineProperty;
6
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
- var __getOwnPropNames = Object.getOwnPropertyNames;
8
- var __getProtoOf = Object.getPrototypeOf;
9
- var __hasOwnProp = Object.prototype.hasOwnProperty;
10
- var __commonJS = (cb, mod) => function __require() {
11
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
12
- };
13
- var __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from === "object" || typeof from === "function") {
15
- for (let key of __getOwnPropNames(from))
16
- if (!__hasOwnProp.call(to, key) && key !== except)
17
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
- }
19
- return to;
20
- };
21
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
- // If the importer is in node compatibility mode or this is not an ESM
23
- // file that has been converted to a CommonJS file using a Babel-
24
- // compatible transform (i.e. "__esModule" has not been set), then set
25
- // "default" to the CommonJS "module.exports" for node compatibility.
26
- __defProp(target, "default", { value: mod, enumerable: true }) ,
27
- mod
28
- ));
29
-
30
7
  // ../../node_modules/eventemitter3/index.js
31
8
  var require_eventemitter3 = __commonJS({
32
9
  "../../node_modules/eventemitter3/index.js"(exports, module) {
@@ -189,7 +166,7 @@ var require_eventemitter3 = __commonJS({
189
166
  });
190
167
 
191
168
  // ../../node_modules/eventemitter3/index.mjs
192
- var import_index = __toESM(require_eventemitter3());
169
+ var import_index = __toESM(require_eventemitter3(), 1);
193
170
 
194
171
  // ui/behaviors/ButtonBehavior.ts
195
172
  var ButtonBehavior = class _ButtonBehavior extends import_index.default {
@@ -1197,13 +1174,6 @@ var InputBehavior = class extends import_index.default {
1197
1174
  this.removeAllListeners();
1198
1175
  }
1199
1176
  };
1200
-
1201
- // utils/ObjectUtils.ts
1202
- function getNestedValue(obj, path) {
1203
- return path.split(".").reduce((current, key) => current == null ? void 0 : current[key], obj);
1204
- }
1205
-
1206
- // ui/components/Skinable.ts
1207
1177
  var SKIN = Symbol("skinData");
1208
1178
  function Skinable(Base) {
1209
1179
  class SkinableClass extends Base {
@@ -3570,502 +3540,6 @@ function createFlatButtonEffect(options) {
3570
3540
  }
3571
3541
  });
3572
3542
  }
3573
- function rectToBoundsLike(r) {
3574
- const left = r.x;
3575
- const top = r.y;
3576
- const width = r.width;
3577
- const height = r.height;
3578
- const right = left + width;
3579
- const bottom = top + height;
3580
- return {
3581
- left,
3582
- right,
3583
- top,
3584
- bottom,
3585
- width,
3586
- height,
3587
- centerX: left + width / 2,
3588
- centerY: top + height / 2
3589
- };
3590
- }
3591
- function getCommonParent(items) {
3592
- var _a;
3593
- const parent = (_a = items[0]) == null ? void 0 : _a.parent;
3594
- if (!parent) throw new Error("Items must have a parent");
3595
- for (const it of items) {
3596
- if (it.parent !== parent) throw new Error("All items must share the same parent");
3597
- }
3598
- return parent;
3599
- }
3600
- function getLocalBoundsInParent(child, parent) {
3601
- const world = child.getBounds();
3602
- const topLeft = parent.toLocal(new Point(world.x, world.y));
3603
- const bottomRight = parent.toLocal(new Point(world.x + world.width, world.y + world.height));
3604
- const left = Math.min(topLeft.x, bottomRight.x);
3605
- const right = Math.max(topLeft.x, bottomRight.x);
3606
- const top = Math.min(topLeft.y, bottomRight.y);
3607
- const bottom = Math.max(topLeft.y, bottomRight.y);
3608
- const width = right - left;
3609
- const height = bottom - top;
3610
- return {
3611
- left,
3612
- right,
3613
- top,
3614
- bottom,
3615
- width,
3616
- height,
3617
- centerX: left + width / 2,
3618
- centerY: top + height / 2
3619
- };
3620
- }
3621
- function getSelectionBounds(items, parent) {
3622
- const p = parent ?? getCommonParent(items);
3623
- let left = Infinity, right = -Infinity, top = Infinity, bottom = -Infinity;
3624
- for (const it of items) {
3625
- const b = getLocalBoundsInParent(it, p);
3626
- left = Math.min(left, b.left);
3627
- right = Math.max(right, b.right);
3628
- top = Math.min(top, b.top);
3629
- bottom = Math.max(bottom, b.bottom);
3630
- }
3631
- const width = right - left;
3632
- const height = bottom - top;
3633
- return {
3634
- left,
3635
- right,
3636
- top,
3637
- bottom,
3638
- width,
3639
- height,
3640
- centerX: left + width / 2,
3641
- centerY: top + height / 2
3642
- };
3643
- }
3644
- function getReferenceBounds(items, options) {
3645
- if (options == null ? void 0 : options.container) {
3646
- const box = options.container;
3647
- if (box instanceof Container) {
3648
- const parent2 = box;
3649
- const world = parent2.getBounds();
3650
- const topLeft = parent2.toLocal(new Point(world.x, world.y));
3651
- const bottomRight = parent2.toLocal(new Point(world.x + world.width, world.y + world.height));
3652
- const left = Math.min(topLeft.x, bottomRight.x);
3653
- const right = Math.max(topLeft.x, bottomRight.x);
3654
- const top = Math.min(topLeft.y, bottomRight.y);
3655
- const bottom = Math.max(topLeft.y, bottomRight.y);
3656
- const width = right - left;
3657
- const height = bottom - top;
3658
- return {
3659
- ref: {
3660
- left,
3661
- right,
3662
- top,
3663
- bottom,
3664
- width,
3665
- height,
3666
- centerX: left + width / 2,
3667
- centerY: top + height / 2
3668
- },
3669
- parent: parent2
3670
- };
3671
- } else {
3672
- const parent2 = getCommonParent(items);
3673
- return { ref: rectToBoundsLike(box), parent: parent2 };
3674
- }
3675
- }
3676
- const parent = getCommonParent(items);
3677
- if (options == null ? void 0 : options.key) {
3678
- if (options.key.parent !== parent) throw new Error("key and items must share the same parent");
3679
- return { ref: getLocalBoundsInParent(options.key, parent), parent };
3680
- }
3681
- return { ref: getSelectionBounds(items, parent), parent };
3682
- }
3683
- function nudgeX(child, dx) {
3684
- child.x += dx;
3685
- }
3686
- function nudgeY(child, dy) {
3687
- child.y += dy;
3688
- }
3689
-
3690
- // layout/Flow.ts
3691
- function normalizeGap(opts) {
3692
- if (typeof opts.gap === "number") return { h: opts.gap, v: opts.gap };
3693
- if (typeof opts.gap === "object" && opts.gap) return { h: opts.gap.h ?? 0, v: opts.gap.v ?? 0 };
3694
- const h = opts.columnGap ?? 0;
3695
- const v = opts.rowGap ?? 0;
3696
- return { h, v };
3697
- }
3698
- function normalizePadding(p) {
3699
- if (typeof p === "number") return { top: p, right: p, bottom: p, left: p };
3700
- return { top: (p == null ? void 0 : p.top) ?? 0, right: (p == null ? void 0 : p.right) ?? 0, bottom: (p == null ? void 0 : p.bottom) ?? 0, left: (p == null ? void 0 : p.left) ?? 0 };
3701
- }
3702
- function normalizeMargin(value) {
3703
- if (value === void 0) {
3704
- return { top: 0, right: 0, bottom: 0, left: 0 };
3705
- }
3706
- if (typeof value === "number") {
3707
- return { top: value, right: value, bottom: value, left: value };
3708
- }
3709
- const top = value.top ?? value.y ?? 0;
3710
- const bottom = value.bottom ?? value.y ?? 0;
3711
- const left = value.left ?? value.x ?? 0;
3712
- const right = value.right ?? value.x ?? 0;
3713
- return { top, right, bottom, left };
3714
- }
3715
- function getFlowBounds(items, opts, parent) {
3716
- const pad = normalizePadding(opts.padding);
3717
- if (opts.wrap === "bounds" && opts.bounds) {
3718
- let r;
3719
- if (opts.bounds instanceof Rectangle) {
3720
- r = opts.bounds;
3721
- } else {
3722
- const b = getLocalBoundsInParent(opts.bounds, parent);
3723
- r = new Rectangle(b.left, b.top, b.width, b.height);
3724
- }
3725
- return new Rectangle(
3726
- r.x + pad.left,
3727
- r.y + pad.top,
3728
- Math.max(0, r.width - pad.left - pad.right),
3729
- Math.max(0, r.height - pad.top - pad.bottom)
3730
- );
3731
- }
3732
- const sel = getSelectionBounds(items, parent);
3733
- return new Rectangle(
3734
- // TODO Not sure side effects check this out latter
3735
- /*sel.left +*/
3736
- pad.left,
3737
- /*sel.top + */
3738
- pad.top,
3739
- Math.max(0, sel.width - pad.left - pad.right),
3740
- Math.max(0, sel.height - pad.top - pad.bottom)
3741
- );
3742
- }
3743
- var Flow = class {
3744
- /**
3745
- * Arranges containers in a flexbox-like layout.
3746
- *
3747
- * This method modifies container positions in-place to create the desired layout.
3748
- * Items are sorted (if order function provided) and then arranged according to
3749
- * direction, wrapping, alignment, and justification settings.
3750
- *
3751
- * @param items - Array of containers to layout
3752
- * @param options - Layout configuration options
3753
- *
3754
- * @example
3755
- * ```typescript
3756
- * // Simple horizontal row
3757
- * Flow.layout(items, { direction: 'row', gap: 10 });
3758
- *
3759
- * // Grid with 4 columns
3760
- * Flow.layout(items, {
3761
- * direction: 'row',
3762
- * wrap: 'count',
3763
- * columnCount: 4,
3764
- * gap: { h: 10, v: 15 }
3765
- * });
3766
- *
3767
- * // Centered vertical list
3768
- * Flow.layout(items, {
3769
- * direction: 'column',
3770
- * align: 'center',
3771
- * gap: 20
3772
- * });
3773
- * ```
3774
- */
3775
- static layout(items, options) {
3776
- if (!items || items.length === 0) return;
3777
- const opts = {
3778
- direction: "row",
3779
- wrap: "none",
3780
- gap: 0,
3781
- justify: "start",
3782
- align: "start",
3783
- ...options
3784
- };
3785
- const parent = getCommonParent(items);
3786
- const gap = normalizeGap(opts);
3787
- const dir = opts.direction ?? "row";
3788
- const wrap = opts.wrap ?? "none";
3789
- const ordered = opts.order ? [...items].sort(opts.order) : [...items];
3790
- const area = getFlowBounds(ordered, opts, parent);
3791
- if (wrap === "count") {
3792
- if (dir === "row") {
3793
- const cols = opts.columnCount ?? (opts.rowCount ? Math.ceil(ordered.length / opts.rowCount) : ordered.length);
3794
- const lines = [];
3795
- for (let i = 0; i < ordered.length; i += cols) lines.push(ordered.slice(i, i + cols));
3796
- layoutLinesRow(lines, parent, area, gap, opts.justify, opts.align, opts.margins);
3797
- } else {
3798
- const rows = opts.rowCount ?? (opts.columnCount ? Math.ceil(ordered.length / opts.columnCount) : ordered.length);
3799
- const columns = [];
3800
- for (let i = 0; i < ordered.length; i += rows) columns.push(ordered.slice(i, i + rows));
3801
- layoutLinesColumn(columns, parent, area, gap, opts.justify, opts.align, opts.margins);
3802
- }
3803
- return;
3804
- }
3805
- if (wrap === "bounds") {
3806
- if (dir === "row") {
3807
- const lines = [];
3808
- let line = [];
3809
- let lineW = 0;
3810
- for (const it of ordered) {
3811
- const b = getLocalBoundsInParent(it, parent);
3812
- const needed = line.length === 0 ? b.width : gap.h + b.width;
3813
- if (line.length > 0 && lineW + needed > area.width) {
3814
- lines.push(line);
3815
- line = [it];
3816
- lineW = b.width;
3817
- } else {
3818
- line.push(it);
3819
- lineW += needed;
3820
- }
3821
- }
3822
- if (line.length) lines.push(line);
3823
- layoutLinesRow(lines, parent, area, gap, opts.justify, opts.align, opts.margins);
3824
- } else {
3825
- const columns = [];
3826
- let col = [];
3827
- let colH = 0;
3828
- for (const it of ordered) {
3829
- const b = getLocalBoundsInParent(it, parent);
3830
- const needed = col.length === 0 ? b.height : gap.v + b.height;
3831
- if (col.length > 0 && colH + needed > area.height) {
3832
- columns.push(col);
3833
- col = [it];
3834
- colH = b.height;
3835
- } else {
3836
- col.push(it);
3837
- colH += needed;
3838
- }
3839
- }
3840
- if (col.length) columns.push(col);
3841
- layoutLinesColumn(columns, parent, area, gap, opts.justify, opts.align, opts.margins);
3842
- }
3843
- return;
3844
- }
3845
- if (wrap === "none") {
3846
- if (dir === "row") {
3847
- const lines = [ordered];
3848
- layoutLinesRow(lines, parent, area, gap, opts.justify, opts.align, opts.margins);
3849
- } else {
3850
- const columns = [ordered];
3851
- layoutLinesColumn(columns, parent, area, gap, opts.justify, opts.align, opts.margins);
3852
- }
3853
- }
3854
- }
3855
- };
3856
- function layoutLinesRow(lines, parent, area, gap, justify, align, margins) {
3857
- let y = area.y;
3858
- for (const line of lines) {
3859
- let contentW = 0;
3860
- let lineH = 0;
3861
- const sizes = line.map((it) => {
3862
- const b = getLocalBoundsInParent(it, parent);
3863
- lineH = Math.max(lineH, b.height);
3864
- return b;
3865
- });
3866
- if (line.length > 0) contentW = sizes.reduce((s, b, i) => s + b.width + (i > 0 ? gap.h : 0), 0);
3867
- let x = area.x;
3868
- if (justify === "center") {
3869
- x += Math.max(0, (area.width - contentW) / 2);
3870
- } else if (justify === "end") {
3871
- x += Math.max(0, area.width - contentW);
3872
- } else if (justify === "space-between" && line.length > 1) {
3873
- const free = Math.max(0, area.width - sizes.reduce((s, b) => s + b.width, 0));
3874
- const g = free / (line.length - 1);
3875
- positionRow(line, sizes, parent, x, y, lineH, { h: g, v: gap.v }, align, margins);
3876
- y += lineH + gap.v;
3877
- continue;
3878
- } else if (justify === "space-around" && line.length > 0) {
3879
- const free = Math.max(0, area.width - sizes.reduce((s, b) => s + b.width, 0));
3880
- const g = free / line.length;
3881
- x += g / 2;
3882
- positionRow(line, sizes, parent, x, y, lineH, { h: g, v: gap.v }, align, margins);
3883
- y += lineH + gap.v;
3884
- continue;
3885
- } else if (justify === "space-evenly" && line.length > 0) {
3886
- const free = Math.max(0, area.width - sizes.reduce((s, b) => s + b.width, 0));
3887
- const g = free / (line.length + 1);
3888
- x += g;
3889
- positionRow(line, sizes, parent, x, y, lineH, { h: g, v: gap.v }, align, margins);
3890
- y += lineH + gap.v;
3891
- continue;
3892
- }
3893
- positionRow(line, sizes, parent, x, y, lineH, gap, align, margins);
3894
- y += lineH + gap.v;
3895
- }
3896
- }
3897
- function positionRow(line, sizes, parent, x, y, lineH, gap, align, margins) {
3898
- let cursor = x;
3899
- for (let i = 0; i < line.length; i++) {
3900
- const it = line[i];
3901
- const b = sizes[i];
3902
- const margin = normalizeMargin(margins == null ? void 0 : margins[i]);
3903
- const dx = cursor + margin.left - b.left;
3904
- let dy = 0;
3905
- if (align === "start") dy = y + margin.top - b.top;
3906
- else if (align === "center") dy = y + margin.top + (lineH - b.height) / 2 - b.top;
3907
- else dy = y + margin.top + (lineH - b.height) - b.top;
3908
- nudgeX(it, dx);
3909
- nudgeY(it, dy);
3910
- cursor += margin.left + b.width + margin.right + gap.h;
3911
- }
3912
- }
3913
- function layoutLinesColumn(columns, parent, area, gap, justify, align, margins) {
3914
- let x = area.x;
3915
- for (const col of columns) {
3916
- let contentH = 0;
3917
- let colW = 0;
3918
- const sizes = col.map((it) => {
3919
- const b = getLocalBoundsInParent(it, parent);
3920
- colW = Math.max(colW, b.width);
3921
- return b;
3922
- });
3923
- if (col.length > 0) contentH = sizes.reduce((s, b, i) => s + b.height + (i > 0 ? gap.v : 0), 0);
3924
- let y = area.y;
3925
- if (justify === "center") {
3926
- y += Math.max(0, (area.height - contentH) / 2);
3927
- } else if (justify === "end") {
3928
- y += Math.max(0, area.height - contentH);
3929
- } else if (justify === "space-between" && col.length > 1) {
3930
- const free = Math.max(0, area.height - sizes.reduce((s, b) => s + b.height, 0));
3931
- const g = free / (col.length - 1);
3932
- positionColumn(col, sizes, parent, x, y, colW, { h: gap.h, v: g }, align, margins);
3933
- x += colW + gap.h;
3934
- continue;
3935
- } else if (justify === "space-around" && col.length > 0) {
3936
- const free = Math.max(0, area.height - sizes.reduce((s, b) => s + b.height, 0));
3937
- const g = free / col.length;
3938
- y += g / 2;
3939
- positionColumn(col, sizes, parent, x, y, colW, { h: gap.h, v: g }, align, margins);
3940
- x += colW + gap.h;
3941
- continue;
3942
- } else if (justify === "space-evenly" && col.length > 0) {
3943
- const free = Math.max(0, area.height - sizes.reduce((s, b) => s + b.height, 0));
3944
- const g = free / (col.length + 1);
3945
- y += g;
3946
- positionColumn(col, sizes, parent, x, y, colW, { h: gap.h, v: g }, align, margins);
3947
- x += colW + gap.h;
3948
- continue;
3949
- }
3950
- positionColumn(col, sizes, parent, x, y, colW, gap, align, margins);
3951
- x += colW + gap.h;
3952
- }
3953
- }
3954
- function positionColumn(col, sizes, parent, x, y, colW, gap, align, margins) {
3955
- let cursor = y;
3956
- for (let i = 0; i < col.length; i++) {
3957
- const it = col[i];
3958
- const b = sizes[i];
3959
- const margin = normalizeMargin(margins == null ? void 0 : margins[i]);
3960
- let dx = 0;
3961
- if (align === "start") dx = x + margin.left - b.left;
3962
- else if (align === "center") dx = x + margin.left + (colW - b.width) / 2 - b.left;
3963
- else dx = x + margin.left + (colW - b.width) - b.left;
3964
- const dy = cursor + margin.top - b.top;
3965
- nudgeX(it, dx);
3966
- nudgeY(it, dy);
3967
- cursor += margin.top + b.height + margin.bottom + gap.v;
3968
- }
3969
- }
3970
-
3971
- // layout/Align.ts
3972
- var Align = class {
3973
- /**
3974
- * Aligns containers to the left edge of the reference bounds.
3975
- *
3976
- * @param items - Array of containers to align
3977
- * @param options - Alignment options to control the reference point
3978
- *
3979
- * @example
3980
- * ```typescript
3981
- * // Align to selection bounds (default)
3982
- * Align.left([sprite1, sprite2, sprite3]);
3983
- *
3984
- * // Align to container
3985
- * Align.left([sprite1, sprite2], { container: bounds });
3986
- * ```
3987
- */
3988
- static left(items, options) {
3989
- const { ref, parent } = getReferenceBounds(items, options);
3990
- for (const it of items) {
3991
- const b = getLocalBoundsInParent(it, parent);
3992
- nudgeX(it, ref.left - b.left);
3993
- }
3994
- }
3995
- /**
3996
- * Aligns containers to the horizontal center of the reference bounds.
3997
- *
3998
- * @param items - Array of containers to align
3999
- * @param options - Alignment options to control the reference point
4000
- *
4001
- * @example
4002
- * ```typescript
4003
- * // Center horizontally within selection
4004
- * Align.hCenter([sprite1, sprite2, sprite3]);
4005
- * ```
4006
- */
4007
- static hCenter(items, options) {
4008
- const { ref, parent } = getReferenceBounds(items, options);
4009
- for (const it of items) {
4010
- const b = getLocalBoundsInParent(it, parent);
4011
- nudgeX(it, ref.centerX - b.centerX);
4012
- }
4013
- }
4014
- /**
4015
- * Aligns containers to the right edge of the reference bounds.
4016
- *
4017
- * @param items - Array of containers to align
4018
- * @param options - Alignment options to control the reference point
4019
- */
4020
- static right(items, options) {
4021
- const { ref, parent } = getReferenceBounds(items, options);
4022
- for (const it of items) {
4023
- const b = getLocalBoundsInParent(it, parent);
4024
- nudgeX(it, ref.right - b.right);
4025
- }
4026
- }
4027
- /**
4028
- * Aligns containers to the top edge of the reference bounds.
4029
- *
4030
- * @param items - Array of containers to align
4031
- * @param options - Alignment options to control the reference point
4032
- */
4033
- static top(items, options) {
4034
- const { ref, parent } = getReferenceBounds(items, options);
4035
- for (const it of items) {
4036
- const b = getLocalBoundsInParent(it, parent);
4037
- nudgeY(it, ref.top - b.top);
4038
- }
4039
- }
4040
- /**
4041
- * Aligns containers to the vertical center of the reference bounds.
4042
- *
4043
- * @param items - Array of containers to align
4044
- * @param options - Alignment options to control the reference point
4045
- */
4046
- static vCenter(items, options) {
4047
- const { ref, parent } = getReferenceBounds(items, options);
4048
- for (const it of items) {
4049
- const b = getLocalBoundsInParent(it, parent);
4050
- nudgeY(it, ref.centerY - b.centerY);
4051
- }
4052
- }
4053
- /**
4054
- * Aligns containers to the bottom edge of the reference bounds.
4055
- *
4056
- * @param items - Array of containers to align
4057
- * @param options - Alignment options to control the reference point
4058
- */
4059
- static bottom(items, options) {
4060
- const { ref, parent } = getReferenceBounds(items, options);
4061
- for (const it of items) {
4062
- const b = getLocalBoundsInParent(it, parent);
4063
- nudgeY(it, ref.bottom - b.bottom);
4064
- }
4065
- }
4066
- };
4067
-
4068
- // ui/components/StepperComp.ts
4069
3543
  var StepperComp = class extends Skinable(Container) {
4070
3544
  _minusButton;
4071
3545
  _plusButton;