@eva/plugin-ui 2.1.0-beta.1 → 2.1.0-beta.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.
@@ -8,17 +8,18 @@ globalThis.EVA = globalThis.EVA || {};
8
8
  globalThis.EVA.plugin = globalThis.EVA.plugin || {};
9
9
  var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
10
10
  'use strict';
11
- exports.UIShapeType = void 0;
12
- (function (UIShapeType) {
13
- UIShapeType["RECT"] = "rect";
14
- UIShapeType["CIRCLE"] = "circle";
15
- UIShapeType["ELLIPSE"] = "ellipse";
16
- UIShapeType["ROUNDED_RECT"] = "roundedRect";
17
- })(exports.UIShapeType || (exports.UIShapeType = {}));
18
- class UI extends eva_js.Component {
11
+ exports.ShapeType = void 0;
12
+ (function (ShapeType) {
13
+ ShapeType["RECT"] = "rect";
14
+ ShapeType["CIRCLE"] = "circle";
15
+ ShapeType["ELLIPSE"] = "ellipse";
16
+ ShapeType["ROUNDED_RECT"] = "roundedRect";
17
+ })(exports.ShapeType || (exports.ShapeType = {}));
18
+ const UIShapeType = exports.ShapeType;
19
+ class Shape extends eva_js.Component {
19
20
  constructor() {
20
21
  super(...arguments);
21
- this.componentName = 'UI';
22
+ this.componentName = 'Shape';
22
23
  this.shapes = [];
23
24
  }
24
25
  static getInspectorMetadata() {
@@ -60,7 +61,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
60
61
  isArray: false
61
62
  }];
62
63
  return {
63
- name: UI.componentName,
64
+ name: Shape.componentName,
64
65
  type: 'object',
65
66
  isArray: false,
66
67
  isFolder: true,
@@ -185,22 +186,22 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
185
186
  const x = style.x || 0;
186
187
  const y = style.y || 0;
187
188
  switch (type) {
188
- case exports.UIShapeType.RECT:
189
- case exports.UIShapeType.ROUNDED_RECT:
189
+ case exports.ShapeType.RECT:
190
+ case exports.ShapeType.ROUNDED_RECT:
190
191
  return {
191
192
  width: style.width,
192
193
  height: style.height,
193
194
  x,
194
195
  y
195
196
  };
196
- case exports.UIShapeType.CIRCLE:
197
+ case exports.ShapeType.CIRCLE:
197
198
  return {
198
199
  width: style.radius * 2,
199
200
  height: style.radius * 2,
200
201
  x,
201
202
  y
202
203
  };
203
- case exports.UIShapeType.ELLIPSE:
204
+ case exports.ShapeType.ELLIPSE:
204
205
  return {
205
206
  width: style.width,
206
207
  height: style.height,
@@ -233,37 +234,27 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
233
234
  });
234
235
  }
235
236
  drawShape(graphics, type, style) {
237
+ var _a;
236
238
  if (style.alpha !== undefined) {
237
239
  graphics.alpha = style.alpha;
238
240
  }
239
- if (style.stroke && style.lineWidth !== undefined) {
240
- graphics.setStrokeStyle({
241
- color: style.stroke,
242
- width: style.lineWidth
243
- });
244
- } else if (style.stroke) {
245
- graphics.setStrokeStyle({
246
- color: style.stroke,
247
- width: 1
248
- });
249
- }
250
241
  switch (type) {
251
- case exports.UIShapeType.RECT:
242
+ case exports.ShapeType.RECT:
252
243
  this.drawRect(graphics, style);
253
244
  break;
254
- case exports.UIShapeType.CIRCLE:
245
+ case exports.ShapeType.CIRCLE:
255
246
  this.drawCircle(graphics, style);
256
247
  break;
257
- case exports.UIShapeType.ELLIPSE:
248
+ case exports.ShapeType.ELLIPSE:
258
249
  this.drawEllipse(graphics, style);
259
250
  break;
260
- case exports.UIShapeType.ROUNDED_RECT:
251
+ case exports.ShapeType.ROUNDED_RECT:
261
252
  this.drawRoundedRect(graphics, style);
262
253
  break;
263
254
  default:
264
255
  console.warn(`Unknown shape type: ${type}`);
265
256
  }
266
- if (style.fill) {
257
+ if (style.fill !== undefined) {
267
258
  if (typeof style.fill === 'string' && style.fill.includes('linear-gradient')) {
268
259
  const gradientInfo = this.parseLinearGradient(style.fill);
269
260
  if (gradientInfo) {
@@ -278,6 +269,12 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
278
269
  graphics.fill(style.fill);
279
270
  }
280
271
  }
272
+ if (style.stroke !== undefined) {
273
+ graphics.stroke({
274
+ color: style.stroke,
275
+ width: (_a = style.lineWidth) !== null && _a !== void 0 ? _a : 1
276
+ });
277
+ }
281
278
  }
282
279
  drawRect(graphics, style) {
283
280
  const x = style.x || 0;
@@ -355,7 +352,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
355
352
  this.redraw();
356
353
  }
357
354
  }
358
- UI.componentName = 'UI';
355
+ Shape.componentName = 'Shape';
359
356
  function createCommonjsModule(fn) {
360
357
  var module = {
361
358
  exports: {}
@@ -5946,7 +5943,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
5946
5943
  queueMicrotask(() => whenContainerReady(game, go, fn, attempts - 1));
5947
5944
  }
5948
5945
  function resolveViewRef(game, go, ref) {
5949
- var _a;
5946
+ var _a, _b;
5950
5947
  if (!ref) return null;
5951
5948
  if ('entityName' in ref) {
5952
5949
  const child = findChildEntity$1(go, ref.entityName);
@@ -5958,14 +5955,17 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
5958
5955
  childContainer.parent.removeChild(childContainer);
5959
5956
  }
5960
5957
  } catch (_) {}
5961
- return childContainer;
5958
+ return wrapBorrowedEntityView(childContainer, child.name);
5962
5959
  }
5963
5960
  }
5964
5961
  if (ref.fallback) return resolveViewRef(game, go, ref.fallback);
5965
5962
  return null;
5966
5963
  }
5964
+ if ('shape' in ref) {
5965
+ return (_a = drawInlineShape(ref.shape)) !== null && _a !== void 0 ? _a : ref.fallback ? resolveViewRef(game, go, ref.fallback) : null;
5966
+ }
5967
5967
  if ('ui' in ref) {
5968
- return (_a = drawInlineShape(ref.ui)) !== null && _a !== void 0 ? _a : ref.fallback ? resolveViewRef(game, go, ref.fallback) : null;
5968
+ return (_b = drawInlineShape(ref.ui)) !== null && _b !== void 0 ? _b : ref.fallback ? resolveViewRef(game, go, ref.fallback) : null;
5969
5969
  }
5970
5970
  if ('texture' in ref) {
5971
5971
  const tex = resolveTexture(game, ref.texture);
@@ -5990,8 +5990,51 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
5990
5990
  }
5991
5991
  return null;
5992
5992
  }
5993
+ function normalizeProgressFillViewRef(ref, fillPaddings, fallbackSize) {
5994
+ if (!ref) return ref;
5995
+ const paddings = normalizePaddings(fillPaddings);
5996
+ if (paddings.top === 0 && paddings.right === 0 && paddings.bottom === 0 && paddings.left === 0) {
5997
+ return ref;
5998
+ }
5999
+ const fallback = ref.fallback ? normalizeProgressFillViewRef(ref.fallback, paddings, fallbackSize) : undefined;
6000
+ if ('color' in ref) {
6001
+ const width = shrinkSize(ref.width, paddings.left + paddings.right);
6002
+ const height = shrinkSize(ref.height, paddings.top + paddings.bottom);
6003
+ return _extends(_extends(_extends({}, ref), {
6004
+ width,
6005
+ height,
6006
+ radius: shrinkRadius(ref.radius, width, height)
6007
+ }), fallback ? {
6008
+ fallback
6009
+ } : {});
6010
+ }
6011
+ if ('shape' in ref) {
6012
+ return _extends(_extends(_extends({}, ref), {
6013
+ shape: shrinkInlineShape(ref.shape, paddings, fallbackSize)
6014
+ }), fallback ? {
6015
+ fallback
6016
+ } : {});
6017
+ }
6018
+ if ('ui' in ref) {
6019
+ return _extends(_extends(_extends({}, ref), {
6020
+ ui: shrinkInlineShape(ref.ui, paddings, fallbackSize)
6021
+ }), fallback ? {
6022
+ fallback
6023
+ } : {});
6024
+ }
6025
+ if (fallback) return _extends(_extends({}, ref), {
6026
+ fallback
6027
+ });
6028
+ return ref;
6029
+ }
6030
+ function wrapBorrowedEntityView(childContainer, childName) {
6031
+ const wrapper = new pixi_js.Container();
6032
+ wrapper.label = childName ? `${childName}:view-ref` : 'plugin-ui-view-ref';
6033
+ wrapper.addChild(childContainer);
6034
+ return wrapper;
6035
+ }
5993
6036
  function resolveTexture(game, key) {
5994
- var _a, _b;
6037
+ var _a, _b, _c;
5995
6038
  const resourceModule = (_a = game === null || game === void 0 ? void 0 : game.resource) !== null && _a !== void 0 ? _a : null;
5996
6039
  if ((_b = resourceModule === null || resourceModule === void 0 ? void 0 : resourceModule.instances) === null || _b === void 0 ? void 0 : _b[key]) {
5997
6040
  const inst = resourceModule.instances[key];
@@ -5999,46 +6042,136 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
5999
6042
  if ((inst === null || inst === void 0 ? void 0 : inst.image) instanceof pixi_js.Texture) return inst.image;
6000
6043
  }
6001
6044
  try {
6002
- return pixi_js.Texture.from(key);
6045
+ return (_c = pixi_js.Texture.from(key)) !== null && _c !== void 0 ? _c : null;
6003
6046
  } catch (_) {
6004
6047
  return null;
6005
6048
  }
6006
6049
  }
6007
6050
  function drawInlineShape(shape) {
6008
- var _a, _b, _c;
6051
+ var _a, _b, _c, _d, _e;
6009
6052
  if (!shape || !shape.type) return null;
6010
6053
  const g = new pixi_js.Graphics();
6011
6054
  const {
6012
6055
  style
6013
6056
  } = shape;
6014
- const w = (_a = style.width) !== null && _a !== void 0 ? _a : 0;
6015
- const h = (_b = style.height) !== null && _b !== void 0 ? _b : 0;
6016
- const r = (_c = style.radius) !== null && _c !== void 0 ? _c : 0;
6057
+ const x = (_a = style.x) !== null && _a !== void 0 ? _a : 0;
6058
+ const y = (_b = style.y) !== null && _b !== void 0 ? _b : 0;
6059
+ const w = (_c = style.width) !== null && _c !== void 0 ? _c : 0;
6060
+ const h = (_d = style.height) !== null && _d !== void 0 ? _d : 0;
6061
+ const r = (_e = style.radius) !== null && _e !== void 0 ? _e : 0;
6017
6062
  switch (shape.type) {
6018
6063
  case 'rect':
6019
- g.rect(0, 0, w, h);
6064
+ drawRect(g, x, y, w, h);
6020
6065
  break;
6021
6066
  case 'roundedRect':
6022
- g.roundRect(0, 0, w, h, r);
6067
+ drawRoundedRect(g, x, y, w, h, r);
6023
6068
  break;
6024
6069
  case 'circle':
6025
- g.circle(r, r, r);
6070
+ drawCircle(g, x + r, y + r, r);
6026
6071
  break;
6027
6072
  case 'ellipse':
6028
- g.ellipse(w / 2, h / 2, w / 2, h / 2);
6073
+ drawEllipse(g, x + w / 2, y + h / 2, w / 2, h / 2);
6029
6074
  break;
6030
6075
  }
6031
6076
  if (style.fill !== undefined) g.fill(style.fill);
6032
6077
  if (style.stroke !== undefined && style.lineWidth !== undefined) {
6033
- g.setStrokeStyle({
6078
+ g.stroke({
6034
6079
  color: style.stroke,
6035
6080
  width: style.lineWidth
6036
6081
  });
6037
- g.stroke();
6082
+ } else if (style.stroke !== undefined) {
6083
+ g.stroke({
6084
+ color: style.stroke,
6085
+ width: 1
6086
+ });
6038
6087
  }
6039
6088
  if (style.alpha !== undefined) g.alpha = style.alpha;
6089
+ try {
6090
+ Object.defineProperty(g, 'clone', {
6091
+ value: () => {
6092
+ var _a;
6093
+ return (_a = drawInlineShape(shape)) !== null && _a !== void 0 ? _a : new pixi_js.Graphics();
6094
+ },
6095
+ configurable: true
6096
+ });
6097
+ } catch (_) {}
6040
6098
  return g;
6041
6099
  }
6100
+ function drawRect(g, x, y, width, height) {
6101
+ const anyGraphics = g;
6102
+ if (typeof anyGraphics.rect === 'function') {
6103
+ anyGraphics.rect(x, y, width, height);
6104
+ return;
6105
+ }
6106
+ anyGraphics.drawRect(x, y, width, height);
6107
+ }
6108
+ function drawRoundedRect(g, x, y, width, height, radius) {
6109
+ const anyGraphics = g;
6110
+ if (typeof anyGraphics.roundRect === 'function') {
6111
+ anyGraphics.roundRect(x, y, width, height, radius);
6112
+ return;
6113
+ }
6114
+ anyGraphics.drawRoundedRect(x, y, width, height, radius);
6115
+ }
6116
+ function drawCircle(g, x, y, radius) {
6117
+ const anyGraphics = g;
6118
+ if (typeof anyGraphics.circle === 'function') {
6119
+ anyGraphics.circle(x, y, radius);
6120
+ return;
6121
+ }
6122
+ anyGraphics.drawCircle(x, y, radius);
6123
+ }
6124
+ function drawEllipse(g, x, y, halfWidth, halfHeight) {
6125
+ const anyGraphics = g;
6126
+ if (typeof anyGraphics.ellipse === 'function') {
6127
+ anyGraphics.ellipse(x, y, halfWidth, halfHeight);
6128
+ return;
6129
+ }
6130
+ anyGraphics.drawEllipse(x, y, halfWidth, halfHeight);
6131
+ }
6132
+ function normalizePaddings(fillPaddings) {
6133
+ return {
6134
+ top: readPadding(fillPaddings === null || fillPaddings === void 0 ? void 0 : fillPaddings.top),
6135
+ right: readPadding(fillPaddings === null || fillPaddings === void 0 ? void 0 : fillPaddings.right),
6136
+ bottom: readPadding(fillPaddings === null || fillPaddings === void 0 ? void 0 : fillPaddings.bottom),
6137
+ left: readPadding(fillPaddings === null || fillPaddings === void 0 ? void 0 : fillPaddings.left)
6138
+ };
6139
+ }
6140
+ function readPadding(value) {
6141
+ if (typeof value !== 'number' || !Number.isFinite(value)) return 0;
6142
+ return Math.max(0, value);
6143
+ }
6144
+ function shrinkSize(value, inset) {
6145
+ return Math.max(0, value - inset);
6146
+ }
6147
+ function shrinkOptionalSize(value, fallback, inset) {
6148
+ if (typeof value === 'number') return shrinkSize(value, inset);
6149
+ if (typeof fallback === 'number') return shrinkSize(fallback, inset);
6150
+ return value;
6151
+ }
6152
+ function shrinkRadius(radius, width, height) {
6153
+ if (typeof radius !== 'number' || !Number.isFinite(radius)) return radius;
6154
+ const limits = [radius];
6155
+ if (typeof width === 'number') limits.push(width / 2);
6156
+ if (typeof height === 'number') limits.push(height / 2);
6157
+ return Math.max(0, Math.min(...limits));
6158
+ }
6159
+ function shrinkInlineShape(shape, paddings, fallbackSize) {
6160
+ var _a;
6161
+ const style = (_a = shape.style) !== null && _a !== void 0 ? _a : {};
6162
+ const width = shrinkOptionalSize(style.width, fallbackSize === null || fallbackSize === void 0 ? void 0 : fallbackSize.width, paddings.left + paddings.right);
6163
+ const height = shrinkOptionalSize(style.height, fallbackSize === null || fallbackSize === void 0 ? void 0 : fallbackSize.height, paddings.top + paddings.bottom);
6164
+ const radius = shrinkRadius(style.radius, width, height);
6165
+ return _extends(_extends({}, shape), {
6166
+ style: _extends(_extends(_extends(_extends({}, style), width !== undefined ? {
6167
+ width
6168
+ } : {}), height !== undefined ? {
6169
+ height
6170
+ } : {}), radius !== undefined ? {
6171
+ radius
6172
+ } : {})
6173
+ });
6174
+ }
6042
6175
  function findChildEntity$1(go, name) {
6043
6176
  var _a, _b, _c;
6044
6177
  if (typeof go.findChildByName === 'function') {
@@ -6058,11 +6191,18 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
6058
6191
  super(...arguments);
6059
6192
  this.toggleCount = 0;
6060
6193
  this.pressCount = 0;
6194
+ this.downCount = 0;
6195
+ this.upCount = 0;
6061
6196
  this.hoverCount = 0;
6197
+ this.outCount = 0;
6198
+ this.upOutCount = 0;
6062
6199
  this.changeCount = 0;
6063
6200
  this.updateCount = 0;
6064
6201
  this.selectCount = 0;
6202
+ this.lastSignal = 'idle';
6203
+ this.visualState = 'default';
6065
6204
  this.focused = false;
6205
+ this.__evaExplicitFields = new Set();
6066
6206
  }
6067
6207
  init(p) {
6068
6208
  if (p) this.applyParams(p);
@@ -6077,6 +6217,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
6077
6217
  if (!(name in p)) continue;
6078
6218
  const v = p[name];
6079
6219
  if (v === undefined) continue;
6220
+ this.__evaExplicitFields.add(name);
6080
6221
  switch (spec.kind) {
6081
6222
  case 'scalar':
6082
6223
  this[name] = v;
@@ -6194,6 +6335,99 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
6194
6335
  }
6195
6336
  }
6196
6337
  }
6338
+ function readTransformRenderSize(go, options = {}) {
6339
+ var _a;
6340
+ const size = (_a = go === null || go === void 0 ? void 0 : go.transform) === null || _a === void 0 ? void 0 : _a.size;
6341
+ if (!size) return null;
6342
+ const width = normalizeSizeValue(size.width, options.allowZero);
6343
+ const height = normalizeSizeValue(size.height, options.allowZero);
6344
+ if (width === undefined && height === undefined) return null;
6345
+ return {
6346
+ width,
6347
+ height
6348
+ };
6349
+ }
6350
+ function hasExplicitRenderSize(component) {
6351
+ if (!component) return false;
6352
+ const explicitFields = component.__evaExplicitFields;
6353
+ if (explicitFields && typeof explicitFields.has === 'function') {
6354
+ return explicitFields.has('width') || explicitFields.has('height');
6355
+ }
6356
+ return component.width !== undefined || component.height !== undefined;
6357
+ }
6358
+ function applyTransformSizeToInstance(def, instance, component, go, source) {
6359
+ const size = readTransformRenderSize(go, {
6360
+ allowZero: source === 'transform-change'
6361
+ });
6362
+ if (!size) return false;
6363
+ const context = {
6364
+ componentName: def.name,
6365
+ component,
6366
+ gameObject: go,
6367
+ source
6368
+ };
6369
+ if (def.applySize) def.applySize(instance, size, component !== null && component !== void 0 ? component : {}, context);else applyRuntimeSize(instance, size);
6370
+ return true;
6371
+ }
6372
+ function applyRuntimeSize(instance, size) {
6373
+ if (!instance || !size) return;
6374
+ const width = normalizeSizeValue(size.width, true);
6375
+ const height = normalizeSizeValue(size.height, true);
6376
+ if (width === undefined && height === undefined) return;
6377
+ const nextWidth = width !== null && width !== void 0 ? width : getCurrentSize(instance, 'width');
6378
+ const nextHeight = height !== null && height !== void 0 ? height : getCurrentSize(instance, 'height');
6379
+ let applied = false;
6380
+ if (typeof instance.setSize === 'function' && nextWidth !== undefined && nextHeight !== undefined) {
6381
+ try {
6382
+ instance.setSize(nextWidth, nextHeight);
6383
+ applied = true;
6384
+ } catch (_) {
6385
+ applied = false;
6386
+ }
6387
+ }
6388
+ if (!applied) {
6389
+ if (width !== undefined) instance.width = width;
6390
+ if (height !== undefined) instance.height = height;
6391
+ }
6392
+ relayoutRuntimeInstance(instance);
6393
+ }
6394
+ function applyListLayoutSize(instance, size) {
6395
+ const width = normalizeSizeValue(size.width, true);
6396
+ const height = normalizeSizeValue(size.height, true);
6397
+ if (width !== undefined) {
6398
+ try {
6399
+ instance.maxWidth = width;
6400
+ } catch (_) {}
6401
+ }
6402
+ if (height !== undefined) {
6403
+ try {
6404
+ instance.maxHeight = height;
6405
+ } catch (_) {}
6406
+ }
6407
+ relayoutRuntimeInstance(instance);
6408
+ }
6409
+ function relayoutRuntimeInstance(instance) {
6410
+ var _a, _b, _c, _d;
6411
+ try {
6412
+ (_b = (_a = instance === null || instance === void 0 ? void 0 : instance.list) === null || _a === void 0 ? void 0 : _a.arrangeChildren) === null || _b === void 0 ? void 0 : _b.call(_a);
6413
+ } catch (_) {}
6414
+ try {
6415
+ (_c = instance === null || instance === void 0 ? void 0 : instance.arrangeChildren) === null || _c === void 0 ? void 0 : _c.call(instance);
6416
+ } catch (_) {}
6417
+ try {
6418
+ (_d = instance === null || instance === void 0 ? void 0 : instance.resize) === null || _d === void 0 ? void 0 : _d.call(instance, true);
6419
+ } catch (_) {}
6420
+ }
6421
+ function normalizeSizeValue(value, allowZero = false) {
6422
+ const n = Number(value);
6423
+ if (!Number.isFinite(n)) return undefined;
6424
+ if (allowZero ? n < 0 : n <= 0) return undefined;
6425
+ return n;
6426
+ }
6427
+ function getCurrentSize(instance, key) {
6428
+ const n = Number(instance === null || instance === void 0 ? void 0 : instance[key]);
6429
+ return Number.isFinite(n) && n >= 0 ? n : undefined;
6430
+ }
6197
6431
  const ENABLED = {
6198
6432
  kind: 'scalar',
6199
6433
  default: true,
@@ -6247,11 +6481,64 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
6247
6481
  signalMap: c => ({
6248
6482
  press: () => {
6249
6483
  c.pressCount += 1;
6250
- return {};
6484
+ c.lastSignal = 'press';
6485
+ c.visualState = 'default';
6486
+ return {
6487
+ pressCount: c.pressCount,
6488
+ lastSignal: c.lastSignal,
6489
+ visualState: c.visualState
6490
+ };
6251
6491
  },
6252
- down: true,
6253
- up: true,
6254
- hover: true
6492
+ down: () => {
6493
+ c.downCount += 1;
6494
+ c.lastSignal = 'down';
6495
+ c.visualState = 'pressed';
6496
+ return {
6497
+ downCount: c.downCount,
6498
+ lastSignal: c.lastSignal,
6499
+ visualState: c.visualState
6500
+ };
6501
+ },
6502
+ up: () => {
6503
+ c.upCount += 1;
6504
+ c.lastSignal = 'up';
6505
+ c.visualState = 'default';
6506
+ return {
6507
+ upCount: c.upCount,
6508
+ lastSignal: c.lastSignal,
6509
+ visualState: c.visualState
6510
+ };
6511
+ },
6512
+ hover: () => {
6513
+ c.hoverCount += 1;
6514
+ c.lastSignal = 'hover';
6515
+ c.visualState = 'hover';
6516
+ return {
6517
+ hoverCount: c.hoverCount,
6518
+ lastSignal: c.lastSignal,
6519
+ visualState: c.visualState
6520
+ };
6521
+ },
6522
+ out: () => {
6523
+ c.outCount += 1;
6524
+ c.lastSignal = 'out';
6525
+ c.visualState = 'default';
6526
+ return {
6527
+ outCount: c.outCount,
6528
+ lastSignal: c.lastSignal,
6529
+ visualState: c.visualState
6530
+ };
6531
+ },
6532
+ upOut: () => {
6533
+ c.upOutCount += 1;
6534
+ c.lastSignal = 'upOut';
6535
+ c.visualState = 'default';
6536
+ return {
6537
+ upOutCount: c.upOutCount,
6538
+ lastSignal: c.lastSignal,
6539
+ visualState: c.visualState
6540
+ };
6541
+ }
6255
6542
  }),
6256
6543
  syncOnChange: (inst, c) => {
6257
6544
  inst.enabled = c.enabled;
@@ -6320,6 +6607,9 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
6320
6607
  }, {
6321
6608
  name: 'disabled',
6322
6609
  type: 'object'
6610
+ }, {
6611
+ name: 'icon',
6612
+ type: 'object'
6323
6613
  }]
6324
6614
  }
6325
6615
  },
@@ -6331,8 +6621,71 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
6331
6621
  kind: 'shallowMerge',
6332
6622
  default: {}
6333
6623
  },
6624
+ iconOffset: {
6625
+ kind: 'shallowMerge',
6626
+ default: {}
6627
+ },
6334
6628
  nineSliceSprite: {
6335
6629
  kind: 'opaque'
6630
+ },
6631
+ textStyle: {
6632
+ kind: 'shallowMerge',
6633
+ default: {}
6634
+ },
6635
+ textClass: {
6636
+ kind: 'scalar',
6637
+ default: 'text'
6638
+ },
6639
+ bitmapFontName: {
6640
+ kind: 'scalar',
6641
+ default: 'TitleFont'
6642
+ },
6643
+ defaultTextScale: {
6644
+ kind: 'opaque'
6645
+ },
6646
+ defaultIconScale: {
6647
+ kind: 'opaque'
6648
+ },
6649
+ defaultTextAnchor: {
6650
+ kind: 'opaque'
6651
+ },
6652
+ defaultIconAnchor: {
6653
+ kind: 'opaque'
6654
+ },
6655
+ anchor: {
6656
+ kind: 'scalar'
6657
+ },
6658
+ anchorX: {
6659
+ kind: 'scalar'
6660
+ },
6661
+ anchorY: {
6662
+ kind: 'scalar'
6663
+ },
6664
+ scale: {
6665
+ kind: 'scalar'
6666
+ },
6667
+ animations: {
6668
+ kind: 'opaque'
6669
+ },
6670
+ contentFittingMode: {
6671
+ kind: 'scalar'
6672
+ },
6673
+ ignoreRefitting: {
6674
+ kind: 'scalar'
6675
+ },
6676
+ width: {
6677
+ kind: 'scalar',
6678
+ inspector: {
6679
+ name: 'width',
6680
+ type: 'number'
6681
+ }
6682
+ },
6683
+ height: {
6684
+ kind: 'scalar',
6685
+ inspector: {
6686
+ name: 'height',
6687
+ type: 'number'
6688
+ }
6336
6689
  }
6337
6690
  },
6338
6691
  views: {
@@ -6350,25 +6703,44 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
6350
6703
  }, {
6351
6704
  name: 'disabled',
6352
6705
  required: false
6706
+ }, {
6707
+ name: 'icon',
6708
+ required: false
6353
6709
  }]
6354
6710
  },
6355
6711
  optionsBuilder: (c, v) => {
6356
- var _a, _b, _d, _e;
6712
+ var _a, _b, _d, _e, _f;
6357
6713
  const opts = {
6358
- text: c.text,
6714
+ text: makeFancyButtonText(c),
6359
6715
  padding: c.padding,
6360
6716
  offset: c.offset,
6361
6717
  textOffset: c.textOffset,
6362
- nineSliceSprite: c.nineSliceSprite
6718
+ iconOffset: c.iconOffset,
6719
+ nineSliceSprite: c.nineSliceSprite,
6720
+ defaultTextScale: c.defaultTextScale,
6721
+ defaultIconScale: c.defaultIconScale,
6722
+ defaultTextAnchor: c.defaultTextAnchor,
6723
+ defaultIconAnchor: c.defaultIconAnchor,
6724
+ anchor: c.anchor,
6725
+ anchorX: c.anchorX,
6726
+ anchorY: c.anchorY,
6727
+ scale: c.scale,
6728
+ animations: c.animations,
6729
+ contentFittingMode: c.contentFittingMode,
6730
+ ignoreRefitting: c.ignoreRefitting
6363
6731
  };
6364
- if ((_a = v.object) === null || _a === void 0 ? void 0 : _a.default) opts.defaultView = v.object.default;
6365
- if ((_b = v.object) === null || _b === void 0 ? void 0 : _b.hover) opts.hoverView = v.object.hover;
6366
- if ((_d = v.object) === null || _d === void 0 ? void 0 : _d.pressed) opts.pressedView = v.object.pressed;
6367
- if ((_e = v.object) === null || _e === void 0 ? void 0 : _e.disabled) opts.disabledView = v.object.disabled;
6732
+ if ((_a = v.object) === null || _a === void 0 ? void 0 : _a.default) opts.defaultView = getFancyButtonView(c, 'default', v.object.default);
6733
+ if ((_b = v.object) === null || _b === void 0 ? void 0 : _b.hover) opts.hoverView = getFancyButtonView(c, 'hover', v.object.hover);
6734
+ if ((_d = v.object) === null || _d === void 0 ? void 0 : _d.pressed) opts.pressedView = getFancyButtonView(c, 'pressed', v.object.pressed);
6735
+ if ((_e = v.object) === null || _e === void 0 ? void 0 : _e.disabled) opts.disabledView = getFancyButtonView(c, 'disabled', v.object.disabled);
6736
+ if ((_f = v.object) === null || _f === void 0 ? void 0 : _f.icon) opts.icon = v.object.icon;
6368
6737
  return opts;
6369
6738
  },
6370
6739
  postCreate: (inst, c) => {
6371
6740
  inst.enabled = c.enabled;
6741
+ if (c.state && typeof inst.setState === 'function') inst.setState(c.state, true);
6742
+ applyFancyButtonAnchor(inst, c);
6743
+ applyOptionalSize(inst, c);
6372
6744
  if (c.selected) applySelectedTint(inst, c);
6373
6745
  },
6374
6746
  signalMap: c => ({
@@ -6387,15 +6759,96 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
6387
6759
  inst.enabled = c.enabled;
6388
6760
  if (c.text !== undefined && inst.text !== c.text) inst.text = c.text;
6389
6761
  if (c.padding !== undefined && inst.padding !== c.padding) inst.padding = c.padding;
6762
+ if (c.textOffset !== undefined) inst.textOffset = c.textOffset;
6763
+ if (c.iconOffset !== undefined) inst.iconOffset = c.iconOffset;
6764
+ if (c.defaultTextScale !== undefined) inst.defaultTextScale = c.defaultTextScale;
6765
+ if (c.defaultIconScale !== undefined) inst.defaultIconScale = c.defaultIconScale;
6766
+ if (c.defaultTextAnchor !== undefined) inst.defaultTextAnchor = c.defaultTextAnchor;
6767
+ if (c.defaultIconAnchor !== undefined) inst.defaultIconAnchor = c.defaultIconAnchor;
6768
+ if (c.contentFittingMode !== undefined) inst.contentFittingMode = c.contentFittingMode;
6769
+ if (c.ignoreRefitting !== undefined && inst.options) inst.options.ignoreRefitting = c.ignoreRefitting;
6770
+ if (c.state && typeof inst.setState === 'function') inst.setState(c.state, true);
6771
+ applyFancyButtonAnchor(inst, c);
6772
+ applyOptionalSize(inst, c);
6390
6773
  applySelectedTint(inst, c);
6391
6774
  }
6392
6775
  };
6776
+ function applyFancyButtonAnchor(inst, c) {
6777
+ var _a, _b, _d, _e, _f, _g, _h;
6778
+ const hasAnchor = c.anchor !== undefined || c.anchorX !== undefined || c.anchorY !== undefined;
6779
+ if (!hasAnchor || !((_a = inst === null || inst === void 0 ? void 0 : inst.anchor) === null || _a === void 0 ? void 0 : _a.set)) return;
6780
+ const x = (_e = (_d = (_b = c.anchorX) !== null && _b !== void 0 ? _b : c.anchor) !== null && _d !== void 0 ? _d : inst.anchor.x) !== null && _e !== void 0 ? _e : 0;
6781
+ const y = (_h = (_g = (_f = c.anchorY) !== null && _f !== void 0 ? _f : c.anchor) !== null && _g !== void 0 ? _g : inst.anchor.y) !== null && _h !== void 0 ? _h : 0;
6782
+ try {
6783
+ inst.anchor.set(x, y);
6784
+ } catch (_) {}
6785
+ }
6786
+ function makeFancyButtonText(c) {
6787
+ var _a, _b, _d;
6788
+ if (c.text === undefined) return undefined;
6789
+ const text = String(c.text);
6790
+ if (c.textClass === 'html') {
6791
+ return new pixi_js.HTMLText({
6792
+ text,
6793
+ style: c.textStyle
6794
+ });
6795
+ }
6796
+ if (c.textClass === 'bitmap') {
6797
+ const fontFamily = (_a = c.bitmapFontName) !== null && _a !== void 0 ? _a : 'TitleFont';
6798
+ ensureBitmapFont(fontFamily, c.textStyle);
6799
+ return new pixi_js.BitmapText({
6800
+ text,
6801
+ style: {
6802
+ fontFamily,
6803
+ fontSize: (_d = (_b = c.textStyle) === null || _b === void 0 ? void 0 : _b.fontSize) !== null && _d !== void 0 ? _d : 40
6804
+ }
6805
+ });
6806
+ }
6807
+ if (c.textStyle && Object.keys(c.textStyle).length > 0) {
6808
+ return new pixi_js.Text({
6809
+ text,
6810
+ style: c.textStyle
6811
+ });
6812
+ }
6813
+ return c.text;
6814
+ }
6815
+ const installedBitmapFonts = new Set();
6816
+ function ensureBitmapFont(name, style) {
6817
+ if (installedBitmapFonts.has(name)) return;
6818
+ try {
6819
+ pixi_js.BitmapFontManager.install({
6820
+ name,
6821
+ style: style !== null && style !== void 0 ? style : {}
6822
+ });
6823
+ } catch (_) {}
6824
+ installedBitmapFonts.add(name);
6825
+ }
6826
+ function getFancyButtonView(c, key, resolved) {
6827
+ var _a;
6828
+ const ref = (_a = c.views) === null || _a === void 0 ? void 0 : _a[key];
6829
+ if (c.nineSliceSprite && ref && 'texture' in ref) return getTextureView(ref.texture);
6830
+ return resolved;
6831
+ }
6393
6832
  function applySelectedTint(inst, c) {
6394
6833
  try {
6395
6834
  const dv = inst.defaultView;
6396
6835
  if (dv && 'tint' in dv) dv.tint = c.selected ? c.selectedTint : 0xFFFFFF;
6397
6836
  } catch (_) {}
6398
6837
  }
6838
+ function syncCheckBoxTextStyle(inst, c) {
6839
+ var _a, _b, _d;
6840
+ const style = inst.style;
6841
+ if (!style || !c.textStyle && !c.textOffset) return;
6842
+ const nextStyle = _extends(_extends({}, style), {
6843
+ text: (_a = c.textStyle) !== null && _a !== void 0 ? _a : style.text,
6844
+ textOffset: (_b = c.textOffset) !== null && _b !== void 0 ? _b : style.textOffset
6845
+ });
6846
+ inst._style = nextStyle;
6847
+ if (inst.labelText && c.textStyle) inst.labelText.style = c.textStyle;
6848
+ try {
6849
+ (_d = inst.alignText) === null || _d === void 0 ? void 0 : _d.call(inst);
6850
+ } catch (_) {}
6851
+ }
6399
6852
  const CHECKBOX_DEF = {
6400
6853
  name: 'CheckBox',
6401
6854
  signalPrefix: 'checkbox',
@@ -6434,6 +6887,16 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
6434
6887
  }]
6435
6888
  }
6436
6889
  },
6890
+ textStyle: {
6891
+ kind: 'shallowMerge',
6892
+ default: {
6893
+ fill: 0xffffff
6894
+ }
6895
+ },
6896
+ textOffset: {
6897
+ kind: 'shallowMerge',
6898
+ default: {}
6899
+ },
6437
6900
  disabledStyle: {
6438
6901
  kind: 'shallowMerge',
6439
6902
  default: {
@@ -6456,7 +6919,9 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
6456
6919
  optionsBuilder: (c, v) => ({
6457
6920
  style: {
6458
6921
  checked: v.object.checked,
6459
- unchecked: v.object.unchecked
6922
+ unchecked: v.object.unchecked,
6923
+ text: c.textStyle,
6924
+ textOffset: c.textOffset
6460
6925
  },
6461
6926
  text: c.text,
6462
6927
  checked: c.checked
@@ -6472,6 +6937,8 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
6472
6937
  }),
6473
6938
  syncOnChange: (inst, c) => {
6474
6939
  if (inst.checked !== c.checked) inst.checked = c.checked;
6940
+ if (c.text !== undefined && inst.text !== c.text) inst.text = c.text;
6941
+ syncCheckBoxTextStyle(inst, c);
6475
6942
  }
6476
6943
  };
6477
6944
  const SWITCHER_DEF = {
@@ -6519,6 +6986,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
6519
6986
  }),
6520
6987
  syncOnChange: (inst, c) => {
6521
6988
  if (inst.active !== c.active) inst.active = c.active;
6989
+ if (c.triggerEvent !== undefined) inst.triggerEvents = c.triggerEvent;
6522
6990
  }
6523
6991
  };
6524
6992
  const SLIDER_DEF = {
@@ -6579,6 +7047,37 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
6579
7047
  kind: 'shallowMerge',
6580
7048
  default: {}
6581
7049
  },
7050
+ nineSliceSprite: {
7051
+ kind: 'opaque'
7052
+ },
7053
+ fillPaddings: {
7054
+ kind: 'shallowMerge',
7055
+ default: {}
7056
+ },
7057
+ valueTextStyle: {
7058
+ kind: 'shallowMerge',
7059
+ default: {
7060
+ fill: 0xffffff
7061
+ }
7062
+ },
7063
+ valueTextOffset: {
7064
+ kind: 'shallowMerge',
7065
+ default: {}
7066
+ },
7067
+ width: {
7068
+ kind: 'scalar',
7069
+ inspector: {
7070
+ name: 'width',
7071
+ type: 'number'
7072
+ }
7073
+ },
7074
+ height: {
7075
+ kind: 'scalar',
7076
+ inspector: {
7077
+ name: 'height',
7078
+ type: 'number'
7079
+ }
7080
+ },
6582
7081
  bindToStore: BIND_STORE
6583
7082
  },
6584
7083
  views: {
@@ -6596,18 +7095,26 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
6596
7095
  }]
6597
7096
  },
6598
7097
  optionsBuilder: (c, v) => {
6599
- centerThumbPivot(v.object.thumb);
7098
+ var _a, _b, _d;
7099
+ const bg = getSliderView((_a = c.views) === null || _a === void 0 ? void 0 : _a.bg, v.object.bg);
7100
+ const fill = getSliderView((_b = c.views) === null || _b === void 0 ? void 0 : _b.fill, v.object.fill);
7101
+ const thumb = getSliderView((_d = c.views) === null || _d === void 0 ? void 0 : _d.thumb, v.object.thumb);
6600
7102
  return {
6601
- bg: v.object.bg,
6602
- fill: v.object.fill,
6603
- slider: v.object.thumb,
7103
+ bg,
7104
+ fill,
7105
+ slider: thumb,
6604
7106
  min: c.min,
6605
7107
  max: c.max,
6606
7108
  step: c.step,
6607
7109
  value: c.value,
6608
- showValue: c.showValue
7110
+ showValue: c.showValue,
7111
+ fillPaddings: c.fillPaddings,
7112
+ nineSliceSprite: c.nineSliceSprite,
7113
+ valueTextStyle: c.valueTextStyle,
7114
+ valueTextOffset: c.valueTextOffset
6609
7115
  };
6610
7116
  },
7117
+ postCreate: (inst, c) => applyOptionalSize(inst, c),
6611
7118
  signalMap: c => ({
6612
7119
  update: vv => {
6613
7120
  c.value = vv;
@@ -6626,23 +7133,9 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
6626
7133
  }),
6627
7134
  syncOnChange: (inst, c) => {
6628
7135
  if (inst.value !== c.value) inst.value = c.value;
7136
+ applyOptionalSize(inst, c);
6629
7137
  }
6630
7138
  };
6631
- function centerThumbPivot(thumb) {
6632
- var _a, _b, _d, _e;
6633
- if (!thumb) return;
6634
- if (thumb.anchor) return;
6635
- let h = 0;
6636
- try {
6637
- const b = (_a = thumb.getBounds) === null || _a === void 0 ? void 0 : _a.call(thumb);
6638
- h = (_d = (_b = b === null || b === void 0 ? void 0 : b.height) !== null && _b !== void 0 ? _b : thumb.height) !== null && _d !== void 0 ? _d : 0;
6639
- } catch (_) {
6640
- h = (_e = thumb.height) !== null && _e !== void 0 ? _e : 0;
6641
- }
6642
- if (h > 0 && thumb.pivot) {
6643
- thumb.pivot.set(0, h / 2);
6644
- }
6645
- }
6646
7139
  const DOUBLE_SLIDER_DEF = {
6647
7140
  name: 'DoubleSlider',
6648
7141
  signalPrefix: 'doubleslider',
@@ -6697,6 +7190,37 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
6697
7190
  kind: 'shallowMerge',
6698
7191
  default: {}
6699
7192
  },
7193
+ nineSliceSprite: {
7194
+ kind: 'opaque'
7195
+ },
7196
+ fillPaddings: {
7197
+ kind: 'shallowMerge',
7198
+ default: {}
7199
+ },
7200
+ valueTextStyle: {
7201
+ kind: 'shallowMerge',
7202
+ default: {
7203
+ fill: 0xffffff
7204
+ }
7205
+ },
7206
+ valueTextOffset: {
7207
+ kind: 'shallowMerge',
7208
+ default: {}
7209
+ },
7210
+ width: {
7211
+ kind: 'scalar',
7212
+ inspector: {
7213
+ name: 'width',
7214
+ type: 'number'
7215
+ }
7216
+ },
7217
+ height: {
7218
+ kind: 'scalar',
7219
+ inspector: {
7220
+ name: 'height',
7221
+ type: 'number'
7222
+ }
7223
+ },
6700
7224
  bindToStore1: {
6701
7225
  kind: 'scalar'
6702
7226
  },
@@ -6722,20 +7246,29 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
6722
7246
  }]
6723
7247
  },
6724
7248
  optionsBuilder: (c, v) => {
6725
- centerThumbPivot(v.object.slider1);
6726
- centerThumbPivot(v.object.slider2);
7249
+ var _a, _b, _d, _e;
7250
+ const bg = getSliderView((_a = c.views) === null || _a === void 0 ? void 0 : _a.bg, v.object.bg);
7251
+ const fill = getSliderView((_b = c.views) === null || _b === void 0 ? void 0 : _b.fill, v.object.fill);
7252
+ const slider1 = getSliderView((_d = c.views) === null || _d === void 0 ? void 0 : _d.slider1, v.object.slider1);
7253
+ const slider2 = getSliderView((_e = c.views) === null || _e === void 0 ? void 0 : _e.slider2, v.object.slider2);
6727
7254
  return {
6728
- bg: v.object.bg,
6729
- fill: v.object.fill,
6730
- slider1: v.object.slider1,
6731
- slider2: v.object.slider2,
7255
+ bg,
7256
+ fill,
7257
+ slider1,
7258
+ slider2,
6732
7259
  min: c.min,
6733
7260
  max: c.max,
7261
+ step: c.step,
6734
7262
  value1: c.value1,
6735
7263
  value2: c.value2,
6736
- showValue: c.showValue
7264
+ showValue: c.showValue,
7265
+ fillPaddings: c.fillPaddings,
7266
+ nineSliceSprite: c.nineSliceSprite,
7267
+ valueTextStyle: c.valueTextStyle,
7268
+ valueTextOffset: c.valueTextOffset
6737
7269
  };
6738
7270
  },
7271
+ postCreate: (inst, c) => applyOptionalSize(inst, c),
6739
7272
  signalMap: c => ({
6740
7273
  update: (v1, v2) => {
6741
7274
  c.value1 = v1;
@@ -6759,6 +7292,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
6759
7292
  syncOnChange: (inst, c) => {
6760
7293
  if (inst.value1 !== c.value1) inst.value1 = c.value1;
6761
7294
  if (inst.value2 !== c.value2) inst.value2 = c.value2;
7295
+ applyOptionalSize(inst, c);
6762
7296
  }
6763
7297
  };
6764
7298
  const PROGRESS_BAR_DEF = {
@@ -6797,6 +7331,20 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
6797
7331
  kind: 'shallowMerge',
6798
7332
  default: {}
6799
7333
  },
7334
+ width: {
7335
+ kind: 'scalar',
7336
+ inspector: {
7337
+ name: 'width',
7338
+ type: 'number'
7339
+ }
7340
+ },
7341
+ height: {
7342
+ kind: 'scalar',
7343
+ inspector: {
7344
+ name: 'height',
7345
+ type: 'number'
7346
+ }
7347
+ },
6800
7348
  bindToStore: BIND_STORE
6801
7349
  },
6802
7350
  views: {
@@ -6805,19 +7353,52 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
6805
7353
  keys: []
6806
7354
  },
6807
7355
  optionsBuilder: (c, _v) => ({
6808
- bg: c.__resolved_bg,
6809
- fill: c.__resolved_fill,
7356
+ bg: c.__resolved_bg_view,
7357
+ fill: c.__resolved_fill_view,
6810
7358
  fillPaddings: c.fillPaddings,
7359
+ nineSliceSprite: c.nineSliceSprite,
6811
7360
  progress: computeProgressPct(c)
6812
7361
  }),
7362
+ postCreate: (inst, c) => applyOptionalSize(inst, c),
6813
7363
  syncOnChange: (inst, c) => {
6814
7364
  const pct = computeProgressPct(c);
6815
7365
  if (inst.progress !== pct) inst.progress = pct;
7366
+ applyOptionalSize(inst, c);
6816
7367
  },
6817
7368
  mixin: {
6818
7369
  getProgressPct: getProgressPctMixin
6819
7370
  }
6820
7371
  };
7372
+ function getSliderView(ref, resolved) {
7373
+ if (ref && 'texture' in ref) {
7374
+ return getTextureView(ref.texture);
7375
+ }
7376
+ return resolved;
7377
+ }
7378
+ function getProgressView(ref, resolved, nineSliceSprite) {
7379
+ if (nineSliceSprite && ref && 'texture' in ref) {
7380
+ return getTextureView(ref.texture);
7381
+ }
7382
+ return resolved;
7383
+ }
7384
+ function getTextureView(textureKey) {
7385
+ var _a;
7386
+ return (_a = resolveTexture(undefined, textureKey)) !== null && _a !== void 0 ? _a : textureKey;
7387
+ }
7388
+ function applyOptionalSize(inst, c) {
7389
+ var _a, _b;
7390
+ if (c.width === undefined && c.height === undefined) return;
7391
+ const width = (_a = c.width) !== null && _a !== void 0 ? _a : inst.width;
7392
+ const height = (_b = c.height) !== null && _b !== void 0 ? _b : inst.height;
7393
+ if (typeof inst.setSize === 'function') {
7394
+ try {
7395
+ inst.setSize(width, height);
7396
+ return;
7397
+ } catch (_) {}
7398
+ }
7399
+ if (c.width !== undefined) inst.width = c.width;
7400
+ if (c.height !== undefined) inst.height = c.height;
7401
+ }
6821
7402
  function computeProgressPct(c) {
6822
7403
  const [min, max] = c.valueRange;
6823
7404
  if (max <= min) return 0;
@@ -6906,6 +7487,21 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
6906
7487
  step: 0.05
6907
7488
  }
6908
7489
  },
7490
+ cap: {
7491
+ kind: 'scalar',
7492
+ inspector: {
7493
+ name: 'cap',
7494
+ type: 'string'
7495
+ }
7496
+ },
7497
+ rotation: {
7498
+ kind: 'scalar',
7499
+ default: 0
7500
+ },
7501
+ offset: {
7502
+ kind: 'shallowMerge',
7503
+ default: {}
7504
+ },
6909
7505
  bindToStore: BIND_STORE
6910
7506
  },
6911
7507
  optionsBuilder: c => ({
@@ -6915,16 +7511,27 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
6915
7511
  fillColor: c.fillColor,
6916
7512
  backgroundAlpha: c.backgroundAlpha,
6917
7513
  fillAlpha: c.fillAlpha,
7514
+ cap: c.cap,
6918
7515
  value: computeProgressPct(c)
6919
7516
  }),
7517
+ postCreate: (inst, c) => applyCircularProgressTransform(inst, c),
6920
7518
  syncOnChange: (inst, c) => {
6921
7519
  const pct = computeProgressPct(c);
6922
7520
  if (inst.progress !== pct) inst.progress = pct;
7521
+ applyCircularProgressTransform(inst, c);
6923
7522
  },
6924
7523
  mixin: {
6925
7524
  getProgressPct: getProgressPctMixin
6926
7525
  }
6927
7526
  };
7527
+ function applyCircularProgressTransform(inst, c) {
7528
+ var _a, _b;
7529
+ if (c.rotation !== undefined) inst.rotation = c.rotation;
7530
+ if (c.offset) {
7531
+ inst.x = (_a = c.offset.x) !== null && _a !== void 0 ? _a : 0;
7532
+ inst.y = (_b = c.offset.y) !== null && _b !== void 0 ? _b : 0;
7533
+ }
7534
+ }
6928
7535
  const INPUT_DEF = {
6929
7536
  name: 'Input',
6930
7537
  signalPrefix: 'input',
@@ -7006,6 +7613,20 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
7006
7613
  type: 'boolean'
7007
7614
  }
7008
7615
  },
7616
+ width: {
7617
+ kind: 'scalar',
7618
+ inspector: {
7619
+ name: 'width',
7620
+ type: 'number'
7621
+ }
7622
+ },
7623
+ height: {
7624
+ kind: 'scalar',
7625
+ inspector: {
7626
+ name: 'height',
7627
+ type: 'number'
7628
+ }
7629
+ },
7009
7630
  bindToStore: BIND_STORE
7010
7631
  },
7011
7632
  views: {
@@ -7014,7 +7635,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
7014
7635
  required: true
7015
7636
  },
7016
7637
  optionsBuilder: (c, v) => ({
7017
- bg: v.single,
7638
+ bg: getProgressView(c.bgView, v.single, c.nineSliceSprite),
7018
7639
  textStyle: c.textStyle,
7019
7640
  placeholder: c.placeholder,
7020
7641
  value: c.value,
@@ -7026,6 +7647,10 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
7026
7647
  nineSliceSprite: c.nineSliceSprite,
7027
7648
  addMask: c.addMask
7028
7649
  }),
7650
+ postCreate: (inst, c) => {
7651
+ inst.enabled = c.enabled;
7652
+ applyOptionalSize(inst, c);
7653
+ },
7029
7654
  signalMap: c => ({
7030
7655
  change: text => {
7031
7656
  c.value = text;
@@ -7040,6 +7665,8 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
7040
7665
  }),
7041
7666
  syncOnChange: (inst, c) => {
7042
7667
  if (inst.value !== c.value) inst.value = c.value;
7668
+ if (inst.enabled !== c.enabled) inst.enabled = c.enabled;
7669
+ applyOptionalSize(inst, c);
7043
7670
  }
7044
7671
  };
7045
7672
  const LIST_DEF = {
@@ -7095,28 +7722,34 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
7095
7722
  default: 'items'
7096
7723
  }
7097
7724
  },
7098
- optionsBuilder: (c, _v) => {
7725
+ optionsBuilder: (c, _v) => ({
7726
+ type: c.type,
7727
+ elementsMargin: c.elementsMargin,
7728
+ padding: c.padding,
7729
+ vertPadding: c.vertPadding,
7730
+ horPadding: c.horPadding,
7731
+ topPadding: c.topPadding,
7732
+ bottomPadding: c.bottomPadding,
7733
+ leftPadding: c.leftPadding,
7734
+ rightPadding: c.rightPadding,
7735
+ maxWidth: c.maxWidth,
7736
+ maxHeight: c.maxHeight
7737
+ }),
7738
+ postCreate: (inst, c) => {
7099
7739
  var _a;
7100
- return {
7101
- type: c.type,
7102
- elementsMargin: c.elementsMargin,
7103
- padding: c.padding,
7104
- vertPadding: c.vertPadding,
7105
- horPadding: c.horPadding,
7106
- topPadding: c.topPadding,
7107
- bottomPadding: c.bottomPadding,
7108
- leftPadding: c.leftPadding,
7109
- rightPadding: c.rightPadding,
7110
- maxWidth: c.maxWidth,
7111
- maxHeight: c.maxHeight,
7112
- children: (_a = c.__resolved_items) !== null && _a !== void 0 ? _a : []
7113
- };
7740
+ for (const item of (_a = c.__resolved_items) !== null && _a !== void 0 ? _a : []) {
7741
+ try {
7742
+ inst.addChild(item);
7743
+ } catch (_) {}
7744
+ }
7745
+ if (typeof inst.arrangeChildren === 'function') inst.arrangeChildren();
7114
7746
  },
7115
7747
  syncOnChange: (inst, c) => {
7116
7748
  if (inst.type !== c.type) inst.type = c.type;
7117
7749
  if (inst.elementsMargin !== c.elementsMargin) inst.elementsMargin = c.elementsMargin;
7118
7750
  if (typeof inst.arrangeChildren === 'function') inst.arrangeChildren();
7119
- }
7751
+ },
7752
+ applySize: applyListLayoutSize
7120
7753
  };
7121
7754
  const SCROLL_BOX_DEF = {
7122
7755
  name: 'ScrollBox',
@@ -7153,7 +7786,6 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
7153
7786
  },
7154
7787
  background: {
7155
7788
  kind: 'scalar',
7156
- default: 0x111111,
7157
7789
  inspector: {
7158
7790
  name: 'background',
7159
7791
  type: 'color'
@@ -7187,6 +7819,38 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
7187
7819
  kind: 'scalar',
7188
7820
  default: 0
7189
7821
  },
7822
+ vertPadding: {
7823
+ kind: 'scalar'
7824
+ },
7825
+ horPadding: {
7826
+ kind: 'scalar'
7827
+ },
7828
+ topPadding: {
7829
+ kind: 'scalar'
7830
+ },
7831
+ bottomPadding: {
7832
+ kind: 'scalar'
7833
+ },
7834
+ leftPadding: {
7835
+ kind: 'scalar'
7836
+ },
7837
+ rightPadding: {
7838
+ kind: 'scalar'
7839
+ },
7840
+ globalScroll: {
7841
+ kind: 'scalar',
7842
+ default: true
7843
+ },
7844
+ shiftScroll: {
7845
+ kind: 'scalar',
7846
+ default: false
7847
+ },
7848
+ proximityRange: {
7849
+ kind: 'scalar'
7850
+ },
7851
+ proximityDebounce: {
7852
+ kind: 'scalar'
7853
+ },
7190
7854
  inertia: {
7191
7855
  kind: 'scalar',
7192
7856
  default: true
@@ -7212,7 +7876,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
7212
7876
  }
7213
7877
  },
7214
7878
  optionsBuilder: (c, _v) => {
7215
- var _a, _b;
7879
+ var _a;
7216
7880
  const typeMap = {
7217
7881
  horizontal: 'horizontal',
7218
7882
  vertical: 'vertical',
@@ -7226,9 +7890,18 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
7226
7890
  radius: c.radius,
7227
7891
  elementsMargin: c.elementsMargin,
7228
7892
  padding: c.padding,
7893
+ vertPadding: c.vertPadding,
7894
+ horPadding: c.horPadding,
7895
+ topPadding: c.topPadding,
7896
+ bottomPadding: c.bottomPadding,
7897
+ leftPadding: c.leftPadding,
7898
+ rightPadding: c.rightPadding,
7229
7899
  disableEasing: c.disableEasing,
7230
7900
  disableDynamicRendering: c.disableDynamicRendering,
7231
- items: (_b = c.__resolved_items) !== null && _b !== void 0 ? _b : []
7901
+ globalScroll: c.globalScroll,
7902
+ shiftScroll: c.shiftScroll,
7903
+ proximityRange: c.proximityRange,
7904
+ proximityDebounce: c.proximityDebounce
7232
7905
  };
7233
7906
  },
7234
7907
  signalMap: () => ({
@@ -7236,12 +7909,22 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
7236
7909
  value: v
7237
7910
  })
7238
7911
  }),
7239
- syncOnChange: (inst, c) => {
7912
+ postCreate: (inst, c) => {
7913
+ var _a, _b;
7914
+ if (typeof inst.addItems === 'function') {
7915
+ try {
7916
+ inst.addItems((_a = c.__resolved_items) !== null && _a !== void 0 ? _a : []);
7917
+ } catch (_) {}
7918
+ }
7919
+ if (typeof ((_b = inst.list) === null || _b === void 0 ? void 0 : _b.arrangeChildren) === 'function') inst.list.arrangeChildren();
7240
7920
  if (typeof inst.resize === 'function') {
7241
7921
  try {
7242
- inst.resize(c.width, c.height);
7922
+ inst.resize();
7243
7923
  } catch (_) {}
7244
7924
  }
7925
+ },
7926
+ syncOnChange: (inst, c) => {
7927
+ applyOptionalSize(inst, c);
7245
7928
  }
7246
7929
  };
7247
7930
  const SELECT_DEF = {
@@ -7286,6 +7969,57 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
7286
7969
  nineSliceSprite: {
7287
7970
  kind: 'opaque'
7288
7971
  },
7972
+ width: {
7973
+ kind: 'scalar',
7974
+ inspector: {
7975
+ name: 'width',
7976
+ type: 'number'
7977
+ }
7978
+ },
7979
+ height: {
7980
+ kind: 'scalar',
7981
+ inspector: {
7982
+ name: 'height',
7983
+ type: 'number'
7984
+ }
7985
+ },
7986
+ radius: {
7987
+ kind: 'scalar',
7988
+ default: 4
7989
+ },
7990
+ visibleItems: {
7991
+ kind: 'scalar'
7992
+ },
7993
+ itemWidth: {
7994
+ kind: 'scalar'
7995
+ },
7996
+ itemHeight: {
7997
+ kind: 'scalar'
7998
+ },
7999
+ itemBackgroundColor: {
8000
+ kind: 'scalar',
8001
+ default: 0x000000
8002
+ },
8003
+ itemHoverColor: {
8004
+ kind: 'scalar',
8005
+ default: 0x666666
8006
+ },
8007
+ selectedTextOffset: {
8008
+ kind: 'shallowMerge',
8009
+ default: {}
8010
+ },
8011
+ scrollBox: {
8012
+ kind: 'shallowMerge',
8013
+ default: {}
8014
+ },
8015
+ textClass: {
8016
+ kind: 'scalar',
8017
+ default: 'text'
8018
+ },
8019
+ open: {
8020
+ kind: 'scalar',
8021
+ default: false
8022
+ },
7289
8023
  bindToStore: BIND_STORE
7290
8024
  },
7291
8025
  views: {
@@ -7294,24 +8028,36 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
7294
8028
  keys: []
7295
8029
  },
7296
8030
  optionsBuilder: c => {
7297
- var _a;
8031
+ var _a, _b, _d, _e, _f;
7298
8032
  return {
7299
8033
  closedBG: c.__resolved_closedView,
7300
8034
  openBG: c.__resolved_openView,
7301
8035
  textStyle: c.textStyle,
8036
+ TextClass: c.textClass === 'html' ? pixi_js.HTMLText : undefined,
8037
+ selectedTextOffset: c.selectedTextOffset,
7302
8038
  items: {
7303
8039
  items: ((_a = c.items) !== null && _a !== void 0 ? _a : []).map(it => it.text),
7304
- backgroundColor: 0x000000,
7305
- hoverColor: 0x666666,
7306
- width: 200,
7307
- height: 30,
8040
+ backgroundColor: c.itemBackgroundColor,
8041
+ hoverColor: c.itemHoverColor,
8042
+ width: (_d = (_b = c.itemWidth) !== null && _b !== void 0 ? _b : c.width) !== null && _d !== void 0 ? _d : 200,
8043
+ height: (_f = (_e = c.itemHeight) !== null && _e !== void 0 ? _e : c.height) !== null && _f !== void 0 ? _f : 30,
7308
8044
  textStyle: c.textStyle,
7309
- radius: 4
8045
+ TextClass: c.textClass === 'html' ? pixi_js.HTMLText : undefined,
8046
+ radius: c.radius
7310
8047
  },
7311
8048
  selected: c.selectedIndex >= 0 ? c.selectedIndex : undefined,
8049
+ visibleItems: c.visibleItems,
8050
+ scrollBox: _extends({
8051
+ width: c.width,
8052
+ height: c.height && c.visibleItems ? c.height * c.visibleItems : undefined,
8053
+ radius: c.radius
8054
+ }, c.scrollBox),
7312
8055
  nineSliceSprite: c.nineSliceSprite
7313
8056
  };
7314
8057
  },
8058
+ postCreate: (inst, c) => {
8059
+ if (c.open && typeof inst.open === 'function') inst.open();
8060
+ },
7315
8061
  signalMap: c => ({
7316
8062
  select: (value, text) => {
7317
8063
  c.selectedIndex = value;
@@ -7321,7 +8067,11 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
7321
8067
  text
7322
8068
  };
7323
8069
  }
7324
- })
8070
+ }),
8071
+ syncOnChange: (inst, c) => {
8072
+ if (c.open && typeof inst.open === 'function') inst.open();
8073
+ if (!c.open && typeof inst.close === 'function') inst.close();
8074
+ }
7325
8075
  };
7326
8076
  const DIALOG_DEF = {
7327
8077
  name: 'Dialog',
@@ -7406,26 +8156,75 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
7406
8156
  nineSliceSprite: {
7407
8157
  kind: 'opaque'
7408
8158
  },
8159
+ titleStyle: {
8160
+ kind: 'shallowMerge',
8161
+ default: {}
8162
+ },
8163
+ content: {
8164
+ kind: 'scalar'
8165
+ },
8166
+ contentStyle: {
8167
+ kind: 'shallowMerge',
8168
+ default: {}
8169
+ },
8170
+ contentButtons: {
8171
+ kind: 'arrayCopy',
8172
+ default: []
8173
+ },
8174
+ contentCheckBoxes: {
8175
+ kind: 'arrayCopy',
8176
+ default: []
8177
+ },
8178
+ buttons: {
8179
+ kind: 'arrayCopy',
8180
+ default: []
8181
+ },
8182
+ buttonList: {
8183
+ kind: 'shallowMerge',
8184
+ default: {}
8185
+ },
8186
+ buttonListOffset: {
8187
+ kind: 'shallowMerge',
8188
+ default: {}
8189
+ },
8190
+ scrollBox: {
8191
+ kind: 'shallowMerge',
8192
+ default: {}
8193
+ },
8194
+ animations: {
8195
+ kind: 'opaque'
8196
+ },
7409
8197
  bindToStore: BIND_STORE
7410
8198
  },
7411
8199
  optionsBuilder: c => {
7412
8200
  var _a;
8201
+ const background = c.nineSliceSprite && c.backgroundView && 'texture' in c.backgroundView ? c.backgroundView.texture : (_a = c.__resolved_background_view) !== null && _a !== void 0 ? _a : new pixi_js.Container();
7413
8202
  return {
7414
8203
  backdrop: c.__resolved_backdropView,
7415
8204
  backdropColor: backdropColorToNumber(c.backdropColor),
7416
8205
  backdropAlpha: c.backdropAlpha,
7417
- background: (_a = c.__resolved_backgroundView) !== null && _a !== void 0 ? _a : new pixi_js.Container(),
7418
- title: c.title,
8206
+ background,
8207
+ title: makeDialogText(c.title, c.titleStyle),
8208
+ content: makeDialogContent(c),
8209
+ buttons: makeDialogButtons(c.buttons),
8210
+ buttonList: c.buttonList,
8211
+ scrollBox: c.scrollBox,
7419
8212
  width: c.width,
7420
8213
  height: c.height,
7421
8214
  padding: c.padding,
7422
8215
  closeOnBackdropClick: c.closeOnBackdropClick,
7423
- nineSliceSprite: c.nineSliceSprite
8216
+ nineSliceSprite: c.nineSliceSprite,
8217
+ animations: c.animations
7424
8218
  };
7425
8219
  },
7426
8220
  postCreate: (inst, c) => {
8221
+ alignDialogAnchoredContent(inst, c);
7427
8222
  if (c.open && typeof inst.open === 'function') inst.open();
7428
8223
  },
8224
+ applySize: applyDialogSize,
8225
+ onAttachedExtra: (inst, c, go) => {
8226
+ wireDialogContentButtonPresses(inst, c, go);
8227
+ },
7429
8228
  signalMap: c => ({
7430
8229
  close: () => {
7431
8230
  c.open = false;
@@ -7437,9 +8236,282 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
7437
8236
  })
7438
8237
  }),
7439
8238
  syncOnChange: (inst, c) => {
8239
+ alignDialogAnchoredContent(inst, c);
7440
8240
  if (c.open && !inst.isOpen && typeof inst.open === 'function') inst.open();else if (!c.open && inst.isOpen && typeof inst.close === 'function') inst.close();
7441
8241
  }
7442
8242
  };
8243
+ function applyDialogSize(inst, size, c) {
8244
+ var _a, _b, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _w, _x, _y;
8245
+ const width = readPositiveSize((_b = (_a = size.width) !== null && _a !== void 0 ? _a : c.width) !== null && _b !== void 0 ? _b : (_d = inst === null || inst === void 0 ? void 0 : inst.options) === null || _d === void 0 ? void 0 : _d.width);
8246
+ const height = readPositiveSize((_f = (_e = size.height) !== null && _e !== void 0 ? _e : c.height) !== null && _f !== void 0 ? _f : (_g = inst === null || inst === void 0 ? void 0 : inst.options) === null || _g === void 0 ? void 0 : _g.height);
8247
+ if (width === undefined && height === undefined) return;
8248
+ inst.options = (_h = inst.options) !== null && _h !== void 0 ? _h : {};
8249
+ if (width !== undefined) inst.options.width = width;
8250
+ if (height !== undefined) inst.options.height = height;
8251
+ const dialogWidth = width !== null && width !== void 0 ? width : Number(inst.options.width) || Number((_j = inst.innerView) === null || _j === void 0 ? void 0 : _j.width) || 0;
8252
+ const dialogHeight = height !== null && height !== void 0 ? height : Number(inst.options.height) || Number((_k = inst.innerView) === null || _k === void 0 ? void 0 : _k.height) || 0;
8253
+ const padding = Number((_m = (_l = c.padding) !== null && _l !== void 0 ? _l : inst.options.padding) !== null && _m !== void 0 ? _m : 20) || 20;
8254
+ if (inst.innerView) {
8255
+ if (width !== undefined) inst.innerView.width = width;
8256
+ if (height !== undefined) inst.innerView.height = height;
8257
+ if ('anchor' in inst.innerView && ((_o = inst.innerView.anchor) === null || _o === void 0 ? void 0 : _o.set)) {
8258
+ inst.innerView.anchor.set(0.5, 0.5);
8259
+ } else {
8260
+ try {
8261
+ (_q = (_p = inst.innerView.pivot) === null || _p === void 0 ? void 0 : _p.set) === null || _q === void 0 ? void 0 : _q.call(_p, dialogWidth / 2, dialogHeight / 2);
8262
+ } catch (_) {}
8263
+ }
8264
+ }
8265
+ if (inst.titleText) {
8266
+ inst.titleText.x = dialogWidth / 2;
8267
+ inst.titleText.y = padding;
8268
+ }
8269
+ const titleHeight = Number((_r = inst.titleText) === null || _r === void 0 ? void 0 : _r.height) || 0;
8270
+ const buttonHeight = Number((_s = inst.buttonContainer) === null || _s === void 0 ? void 0 : _s.height) || 0;
8271
+ if (inst.buttonContainer) {
8272
+ inst.buttonContainer.x = dialogWidth / 2 - (Number(inst.buttonContainer.width) || 0) / 2;
8273
+ inst.buttonContainer.y = dialogHeight - padding - buttonHeight;
8274
+ }
8275
+ if (inst.scrollBox) {
8276
+ inst.scrollBox.x = padding;
8277
+ inst.scrollBox.y = padding + titleHeight;
8278
+ const overrideSize = (_t = c.scrollBox) === null || _t === void 0 ? void 0 : _t.size;
8279
+ const scrollWidth = (_u = readPositiveSize(overrideSize === null || overrideSize === void 0 ? void 0 : overrideSize.width)) !== null && _u !== void 0 ? _u : Math.max(0, dialogWidth - padding * 2);
8280
+ const scrollHeight = (_w = readPositiveSize(overrideSize === null || overrideSize === void 0 ? void 0 : overrideSize.height)) !== null && _w !== void 0 ? _w : Math.max(0, dialogHeight - padding * 2 - titleHeight - buttonHeight);
8281
+ if (typeof inst.scrollBox.setSize === 'function') inst.scrollBox.setSize(scrollWidth, scrollHeight);else {
8282
+ inst.scrollBox.width = scrollWidth;
8283
+ inst.scrollBox.height = scrollHeight;
8284
+ }
8285
+ try {
8286
+ (_y = (_x = inst.scrollBox).resize) === null || _y === void 0 ? void 0 : _y.call(_x, true);
8287
+ } catch (_) {}
8288
+ }
8289
+ alignDialogAnchoredContent(inst, _extends(_extends({}, c), {
8290
+ width: dialogWidth,
8291
+ height: dialogHeight
8292
+ }));
8293
+ }
8294
+ function readPositiveSize(value) {
8295
+ const n = Number(value);
8296
+ return Number.isFinite(n) && n > 0 ? n : undefined;
8297
+ }
8298
+ function alignDialogAnchoredContent(inst, c) {
8299
+ var _a, _b;
8300
+ const innerView = inst === null || inst === void 0 ? void 0 : inst.innerView;
8301
+ const contentView = inst === null || inst === void 0 ? void 0 : inst.contentView;
8302
+ if ((innerView === null || innerView === void 0 ? void 0 : innerView.anchor) && contentView && c.width && c.height) {
8303
+ contentView.x = -c.width / 2;
8304
+ contentView.y = -c.height / 2;
8305
+ }
8306
+ applyDialogOffset(inst, 'buttonListOffset', inst.buttonContainer, c.buttonListOffset);
8307
+ applyDialogOffset(inst, 'scrollBoxOffset', inst.scrollBox, (_a = c.scrollBox) === null || _a === void 0 ? void 0 : _a.offset);
8308
+ applyDialogScrollBoxSize(inst, (_b = c.scrollBox) === null || _b === void 0 ? void 0 : _b.size);
8309
+ }
8310
+ function applyDialogOffset(inst, key, target, nextOffset) {
8311
+ var _a, _b, _d, _e;
8312
+ if (!target) return;
8313
+ const applied = (_a = inst.__evaDialogAppliedOffsets) !== null && _a !== void 0 ? _a : {};
8314
+ const prev = (_b = applied[key]) !== null && _b !== void 0 ? _b : {
8315
+ x: 0,
8316
+ y: 0
8317
+ };
8318
+ const next = {
8319
+ x: (_d = nextOffset === null || nextOffset === void 0 ? void 0 : nextOffset.x) !== null && _d !== void 0 ? _d : 0,
8320
+ y: (_e = nextOffset === null || nextOffset === void 0 ? void 0 : nextOffset.y) !== null && _e !== void 0 ? _e : 0
8321
+ };
8322
+ target.x += next.x - prev.x;
8323
+ target.y += next.y - prev.y;
8324
+ inst.__evaDialogAppliedOffsets = _extends(_extends({}, applied), {
8325
+ [key]: next
8326
+ });
8327
+ }
8328
+ function applyDialogScrollBoxSize(inst, nextSize) {
8329
+ var _a, _b, _d;
8330
+ const scrollBox = inst === null || inst === void 0 ? void 0 : inst.scrollBox;
8331
+ if (!scrollBox) return;
8332
+ const base = (_a = inst.__evaDialogBaseScrollBoxSize) !== null && _a !== void 0 ? _a : {
8333
+ width: scrollBox.width,
8334
+ height: scrollBox.height
8335
+ };
8336
+ inst.__evaDialogBaseScrollBoxSize = base;
8337
+ const wasApplied = inst.__evaDialogAppliedScrollBoxSize;
8338
+ if (!nextSize && !wasApplied) return;
8339
+ const width = (_b = nextSize === null || nextSize === void 0 ? void 0 : nextSize.width) !== null && _b !== void 0 ? _b : base.width;
8340
+ const height = (_d = nextSize === null || nextSize === void 0 ? void 0 : nextSize.height) !== null && _d !== void 0 ? _d : base.height;
8341
+ if (typeof scrollBox.setSize === 'function') scrollBox.setSize(width, height);else {
8342
+ scrollBox.width = width;
8343
+ scrollBox.height = height;
8344
+ }
8345
+ if (typeof scrollBox.resize === 'function') scrollBox.resize(true);
8346
+ inst.__evaDialogAppliedScrollBoxSize = !!nextSize;
8347
+ }
8348
+ function makeDialogText(text, style) {
8349
+ if (text === undefined) return undefined;
8350
+ if (style && Object.keys(style).length > 0) {
8351
+ return new pixi_js.Text({
8352
+ text,
8353
+ style: style
8354
+ });
8355
+ }
8356
+ return text;
8357
+ }
8358
+ function makeDialogContent(c) {
8359
+ var _a, _b;
8360
+ if ((_a = c.contentButtons) === null || _a === void 0 ? void 0 : _a.length) {
8361
+ const records = [];
8362
+ const buttons = c.contentButtons.map((button, index) => {
8363
+ const pixiButton = new FancyButton$1(makeDialogButtonOptions(button));
8364
+ applyOptionalSize(pixiButton, button);
8365
+ if (button.disabled !== undefined) pixiButton.enabled = !button.disabled;
8366
+ records.push({
8367
+ button: pixiButton,
8368
+ params: button,
8369
+ index
8370
+ });
8371
+ return pixiButton;
8372
+ });
8373
+ c.__dialogContentButtons = records;
8374
+ return buttons;
8375
+ }
8376
+ if ((_b = c.contentCheckBoxes) === null || _b === void 0 ? void 0 : _b.length) {
8377
+ return c.contentCheckBoxes.map(checkBox => new CheckBox$1(makeDialogCheckBoxOptions(checkBox)));
8378
+ }
8379
+ return makeDialogText(c.content, c.contentStyle);
8380
+ }
8381
+ function wireDialogContentButtonPresses(inst, c, go) {
8382
+ const records = c.__dialogContentButtons;
8383
+ if (!Array.isArray(records) || records.length === 0 || inst.__evaDialogContentButtonPressesWired) return;
8384
+ inst.__evaDialogContentButtonPressesWired = true;
8385
+ inst.__evaDialogContentButtonPressCleanups = records.map(record => {
8386
+ var _a;
8387
+ const signal = (_a = record.button) === null || _a === void 0 ? void 0 : _a.onPress;
8388
+ if (!signal || typeof signal.connect !== 'function') return undefined;
8389
+ const conn = signal.connect(() => {
8390
+ var _a, _b, _d, _e;
8391
+ const value = (_b = (_a = record.params.value) !== null && _a !== void 0 ? _a : record.params.text) !== null && _b !== void 0 ? _b : record.index;
8392
+ c.selectedContentIndex = record.index;
8393
+ c.selectedContentValue = value;
8394
+ c.selectCount = ((_d = c.selectCount) !== null && _d !== void 0 ? _d : 0) + 1;
8395
+ c.lastSignal = 'select';
8396
+ emitDialogSelection(go, {
8397
+ index: record.index,
8398
+ text: String((_e = record.params.text) !== null && _e !== void 0 ? _e : ''),
8399
+ value
8400
+ });
8401
+ if (record.params.closeOnPress && typeof inst.close === 'function') inst.close();
8402
+ const reopenDelay = Number(record.params.reopenDelay);
8403
+ if (Number.isFinite(reopenDelay) && reopenDelay >= 0 && typeof inst.open === 'function') {
8404
+ setTimeout(() => {
8405
+ try {
8406
+ inst.open();
8407
+ } catch (_) {}
8408
+ }, reopenDelay);
8409
+ }
8410
+ });
8411
+ return () => {
8412
+ try {
8413
+ conn.disconnect();
8414
+ } catch (_) {}
8415
+ };
8416
+ }).filter(Boolean);
8417
+ }
8418
+ function emitDialogSelection(go, payload) {
8419
+ var _a, _b, _d;
8420
+ const eventPayload = _extends({
8421
+ entityName: go === null || go === void 0 ? void 0 : go.name
8422
+ }, payload);
8423
+ try {
8424
+ (_a = go === null || go === void 0 ? void 0 : go.emit) === null || _a === void 0 ? void 0 : _a.call(go, 'select', eventPayload);
8425
+ } catch (_) {}
8426
+ try {
8427
+ (_b = go === null || go === void 0 ? void 0 : go.emit) === null || _b === void 0 ? void 0 : _b.call(go, 'dialog:select', eventPayload);
8428
+ } catch (_) {}
8429
+ const mx = typeof globalThis !== 'undefined' ? globalThis.mx : undefined;
8430
+ if ((_d = mx === null || mx === void 0 ? void 0 : mx.event) === null || _d === void 0 ? void 0 : _d.emit) {
8431
+ try {
8432
+ mx.event.emit('dialog:select', eventPayload);
8433
+ } catch (_) {}
8434
+ }
8435
+ }
8436
+ function makeDialogButtons(buttons) {
8437
+ if (!(buttons === null || buttons === void 0 ? void 0 : buttons.length)) return undefined;
8438
+ return buttons.map(button => {
8439
+ const options = makeDialogButtonOptions(button);
8440
+ const shouldMaterialize = button.disabled !== undefined || !!(button.nineSliceSprite && (button.width !== undefined || button.height !== undefined));
8441
+ if (button.kind === 'button' || !shouldMaterialize) return options;
8442
+ const pixiButton = new FancyButton$1(options);
8443
+ applyOptionalSize(pixiButton, button);
8444
+ pixiButton.enabled = !button.disabled;
8445
+ return pixiButton;
8446
+ });
8447
+ }
8448
+ function makeDialogButtonOptions(button) {
8449
+ var _a, _b, _d, _e, _f, _g, _h, _j, _k, _l;
8450
+ if (button.kind === 'button') return makeDialogBareButton(button);
8451
+ const width = (_a = button.width) !== null && _a !== void 0 ? _a : 110;
8452
+ const height = (_b = button.height) !== null && _b !== void 0 ? _b : 48;
8453
+ const radius = (_d = button.radius) !== null && _d !== void 0 ? _d : 12;
8454
+ const color = (_e = button.color) !== null && _e !== void 0 ? _e : pixiStoryDefaultButtonColor;
8455
+ return {
8456
+ text: makeDialogText(button.text, button.textStyle),
8457
+ defaultView: (_f = resolveDialogButtonView(button.defaultView)) !== null && _f !== void 0 ? _f : makeDialogButtonView(width, height, radius, color),
8458
+ hoverView: (_g = resolveDialogButtonView(button.hoverView)) !== null && _g !== void 0 ? _g : makeDialogButtonView(width, height, radius, (_h = button.hoverColor) !== null && _h !== void 0 ? _h : color),
8459
+ pressedView: (_j = resolveDialogButtonView(button.pressedView)) !== null && _j !== void 0 ? _j : makeDialogButtonView(width, height, radius, (_k = button.pressedColor) !== null && _k !== void 0 ? _k : color),
8460
+ disabledView: (_l = resolveDialogButtonView(button.disabledView)) !== null && _l !== void 0 ? _l : button.disabledColor ? makeDialogButtonView(width, height, radius, button.disabledColor) : undefined,
8461
+ nineSliceSprite: button.nineSliceSprite,
8462
+ enabled: button.disabled === undefined ? undefined : !button.disabled,
8463
+ animations: button.animations
8464
+ };
8465
+ }
8466
+ function resolveDialogButtonView(view) {
8467
+ return view ? getTextureView(view) : undefined;
8468
+ }
8469
+ const pixiStoryDefaultButtonColor = '#e91e63';
8470
+ const pixiStoryDefaultTextColor = '#ffffff';
8471
+ function makeDialogButtonView(width, height, radius, color) {
8472
+ return new pixi_js.Graphics().roundRect(0, 0, width, height, radius).fill(color);
8473
+ }
8474
+ function makeDialogBareButton(button) {
8475
+ var _a, _b, _d, _e, _f, _g;
8476
+ const width = (_a = button.width) !== null && _a !== void 0 ? _a : 110;
8477
+ const height = (_b = button.height) !== null && _b !== void 0 ? _b : 48;
8478
+ const radius = (_d = button.radius) !== null && _d !== void 0 ? _d : 12;
8479
+ const view = makeDialogButtonView(width, height, radius, (_e = button.color) !== null && _e !== void 0 ? _e : pixiStoryDefaultButtonColor);
8480
+ const label = makeDialogText(button.text, button.textStyle);
8481
+ if (label) {
8482
+ label.x = width / 2;
8483
+ label.y = height / 2;
8484
+ try {
8485
+ (_g = (_f = label.anchor) === null || _f === void 0 ? void 0 : _f.set) === null || _g === void 0 ? void 0 : _g.call(_f, 0.5);
8486
+ } catch (_) {}
8487
+ view.addChild(label);
8488
+ }
8489
+ const pixiButton = new Button$1(view);
8490
+ if (button.disabled !== undefined) pixiButton.enabled = !button.disabled;
8491
+ return pixiButton;
8492
+ }
8493
+ function makeDialogCheckBoxOptions(checkBox) {
8494
+ var _a, _b, _d, _e, _f, _g;
8495
+ const size = (_a = checkBox.size) !== null && _a !== void 0 ? _a : 30;
8496
+ const radius = (_b = checkBox.radius) !== null && _b !== void 0 ? _b : 5;
8497
+ const strokeColor = (_d = checkBox.strokeColor) !== null && _d !== void 0 ? _d : pixiStoryDefaultTextColor;
8498
+ const strokeWidth = (_e = checkBox.strokeWidth) !== null && _e !== void 0 ? _e : 2;
8499
+ return {
8500
+ style: {
8501
+ unchecked: new pixi_js.Graphics().roundRect(0, 0, size, size, radius).fill((_f = checkBox.uncheckedColor) !== null && _f !== void 0 ? _f : '#3e3f40').stroke({
8502
+ color: strokeColor,
8503
+ width: strokeWidth
8504
+ }),
8505
+ checked: new pixi_js.Graphics().roundRect(0, 0, size, size, radius).fill((_g = checkBox.checkedColor) !== null && _g !== void 0 ? _g : pixiStoryDefaultButtonColor).stroke({
8506
+ color: strokeColor,
8507
+ width: strokeWidth
8508
+ }),
8509
+ text: checkBox.textStyle
8510
+ },
8511
+ text: checkBox.text,
8512
+ checked: checkBox.checked
8513
+ };
8514
+ }
7443
8515
  const MASKED_FRAME_DEF = {
7444
8516
  name: 'MaskedFrame',
7445
8517
  signalPrefix: 'maskedframe',
@@ -7453,13 +8525,29 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
7453
8525
  },
7454
8526
  borderView: {
7455
8527
  kind: 'opaque'
8528
+ },
8529
+ borderWidth: {
8530
+ kind: 'scalar',
8531
+ default: 0,
8532
+ inspector: {
8533
+ name: 'borderWidth',
8534
+ type: 'number'
8535
+ }
8536
+ },
8537
+ borderColor: {
8538
+ kind: 'scalar',
8539
+ default: 0x000000,
8540
+ inspector: {
8541
+ name: 'borderColor',
8542
+ type: 'color'
8543
+ }
7456
8544
  }
7457
8545
  },
7458
8546
  optionsBuilder: c => ({
7459
- target: c.__resolved_targetView,
7460
- mask: c.__resolved_maskView,
7461
- borderWidth: 0,
7462
- borderColor: 0
8547
+ target: c.__resolved_target_view,
8548
+ mask: c.__resolved_mask_view,
8549
+ borderWidth: c.borderWidth,
8550
+ borderColor: c.borderColor
7463
8551
  })
7464
8552
  };
7465
8553
  const Button = defineUiComponent(BUTTON_DEF);
@@ -7496,6 +8584,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
7496
8584
  constructor() {
7497
8585
  super(...arguments);
7498
8586
  this.componentName = 'RadioGroup';
8587
+ this.selectedId = undefined;
7499
8588
  this.direction = 'vertical';
7500
8589
  this.elementsMargin = 4;
7501
8590
  this.boundCheckBoxes = [];
@@ -7615,10 +8704,22 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
7615
8704
  }
7616
8705
  function buildObserverSchema() {
7617
8706
  const out = {
8707
+ Transform: [{
8708
+ prop: ['size'],
8709
+ deep: true
8710
+ }],
8711
+ Shape: [{
8712
+ prop: ['shapes'],
8713
+ deep: true
8714
+ }],
7618
8715
  UI: [{
7619
8716
  prop: ['shapes'],
7620
8717
  deep: true
7621
8718
  }],
8719
+ UIComponent: [{
8720
+ prop: ['shapes'],
8721
+ deep: true
8722
+ }],
7622
8723
  RadioGroup: [{
7623
8724
  prop: ['selectedId'],
7624
8725
  deep: false
@@ -7643,12 +8744,16 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
7643
8744
  }
7644
8745
  return out;
7645
8746
  }
8747
+ function isShapeComponentName(name) {
8748
+ return name === 'Shape' || name === 'UI' || name === 'UIComponent';
8749
+ }
7646
8750
  let UISystem = class UISystem extends eva_js.System {
7647
8751
  constructor() {
7648
8752
  super(...arguments);
7649
8753
  this.name = 'UISystem';
7650
8754
  this.instances = new Map();
7651
8755
  this.signalCleanups = new Map();
8756
+ this.transformSizeAuthorities = new Set();
7652
8757
  this.radioGroupInstances = new Map();
7653
8758
  }
7654
8759
  get checkBoxInstances() {
@@ -7668,15 +8773,16 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
7668
8773
  }
7669
8774
  componentChanged(changed) {
7670
8775
  const name = changed.componentName;
7671
- if (name === 'UI') return this.handleUI(changed);
8776
+ if (name === 'Transform') return this.handleTransformSizeChanged(changed);
8777
+ if (isShapeComponentName(name)) return this.handleShape(changed);
7672
8778
  if (name === 'RadioGroup') return this.handleRadioGroup(changed);
7673
8779
  const def = COMPONENT_DEFINITIONS[name];
7674
8780
  if (def) return this.handleGeneric(def, changed);
7675
8781
  }
7676
- handleUI(changed) {
8782
+ handleShape(changed) {
7677
8783
  if (changed.type === eva_js.OBSERVER_TYPE.ADD || changed.type === eva_js.OBSERVER_TYPE.CHANGE) {
7678
- const ui = changed.component;
7679
- if (typeof ui.redraw === 'function') ui.redraw();
8784
+ const shape = changed.component;
8785
+ if (typeof shape.redraw === 'function') shape.redraw();
7680
8786
  }
7681
8787
  }
7682
8788
  handleGeneric(def, changed) {
@@ -7694,12 +8800,15 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
7694
8800
  return;
7695
8801
  }
7696
8802
  (_a = def.syncOnChange) === null || _a === void 0 ? void 0 : _a.call(def, inst, c);
8803
+ if (this.transformSizeAuthorities.has(go.id)) {
8804
+ applyTransformSizeToInstance(def, inst, c, go, 'component-change');
8805
+ }
7697
8806
  } else if (changed.type === eva_js.OBSERVER_TYPE.REMOVE) {
7698
8807
  this.detachGeneric(go.id, instMap, go);
7699
8808
  }
7700
8809
  }
7701
8810
  attachGeneric(def, c, go, instMap) {
7702
- var _a, _b, _c, _d, _f, _g, _h;
8811
+ var _a, _b, _c, _d, _f, _g, _h, _j, _k;
7703
8812
  if (instMap.has(go.id)) return;
7704
8813
  const game = this.gameRef(go);
7705
8814
  const views = resolveViewsBySchema(game, go, c, def.views);
@@ -7709,19 +8818,30 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
7709
8818
  if (def.name === 'List' || def.name === 'ScrollBox') {
7710
8819
  const childName = def.name === 'List' ? c.itemsChildName : c.contentChildName;
7711
8820
  c.__resolved_items = collectChildContainers(game, go, childName);
8821
+ const expectedCount = getCollectedChildCount(go, childName);
8822
+ if (expectedCount > 0 && c.__resolved_items.length < expectedCount && ((_a = c.__collect_retry) !== null && _a !== void 0 ? _a : 0) < 10) {
8823
+ c.__collect_retry = ((_b = c.__collect_retry) !== null && _b !== void 0 ? _b : 0) + 1;
8824
+ requestAnimationFrame(() => this.attachGeneric(def, c, go, instMap));
8825
+ return;
8826
+ }
7712
8827
  }
8828
+ const restoreTransientSize = this.applyTransientTransformSize(c, go);
7713
8829
  const built = def.optionsBuilder(c, views !== null && views !== void 0 ? views : {});
7714
8830
  const inst = def.positional ? new def.pixiClass(...built) : new def.pixiClass(built);
7715
- (_a = def.postCreate) === null || _a === void 0 ? void 0 : _a.call(def, inst, c);
8831
+ (_c = def.postCreate) === null || _c === void 0 ? void 0 : _c.call(def, inst, c);
8832
+ if (this.transformSizeAuthorities.has(go.id) || !hasExplicitRenderSize(c)) {
8833
+ const applied = applyTransformSizeToInstance(def, inst, c, go, 'initial-transform');
8834
+ if (applied) this.transformSizeAuthorities.add(go.id);
8835
+ }
7716
8836
  instMap.set(go.id, inst);
7717
8837
  attachToGameObject(game, go, inst);
7718
8838
  if (def.name === 'Dialog') {
7719
- const contentChild = findChildEntity(go, (_b = c.contentChildName) !== null && _b !== void 0 ? _b : 'content');
8839
+ const contentChild = findChildEntity(go, (_d = c.contentChildName) !== null && _d !== void 0 ? _d : 'content');
7720
8840
  if (contentChild) {
7721
8841
  const cc = getEvaContainer(game, contentChild);
7722
8842
  if (cc) {
7723
8843
  try {
7724
- (_d = (_c = inst).addChild) === null || _d === void 0 ? void 0 : _d.call(_c, cc);
8844
+ (_g = (_f = inst).addChild) === null || _g === void 0 ? void 0 : _g.call(_f, cc);
7725
8845
  } catch (_) {}
7726
8846
  }
7727
8847
  }
@@ -7730,7 +8850,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
7730
8850
  const border = resolveViewRef(game, go, c.borderView);
7731
8851
  if (border) {
7732
8852
  try {
7733
- (_g = (_f = inst).addChild) === null || _g === void 0 ? void 0 : _g.call(_f, border);
8853
+ (_j = (_h = inst).addChild) === null || _j === void 0 ? void 0 : _j.call(_h, border);
7734
8854
  } catch (_) {}
7735
8855
  }
7736
8856
  }
@@ -7741,7 +8861,8 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
7741
8861
  }, def.signalMap(c));
7742
8862
  this.signalCleanups.set(go.id, offs);
7743
8863
  }
7744
- (_h = def.onAttachedExtra) === null || _h === void 0 ? void 0 : _h.call(def, inst, c, go, game);
8864
+ (_k = def.onAttachedExtra) === null || _k === void 0 ? void 0 : _k.call(def, inst, c, go, game);
8865
+ restoreTransientSize();
7745
8866
  }
7746
8867
  detachGeneric(id, instMap, go) {
7747
8868
  const inst = instMap.get(id);
@@ -7812,6 +8933,12 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
7812
8933
  elementsMargin: c.elementsMargin,
7813
8934
  selectedItem: initialIndex
7814
8935
  });
8936
+ if (this.transformSizeAuthorities.has(go.id)) {
8937
+ const size = readTransformRenderSize(go, {
8938
+ allowZero: true
8939
+ });
8940
+ if (size) applyRuntimeSize(inst, size);
8941
+ }
7815
8942
  this.radioGroupInstances.set(go.id, inst);
7816
8943
  attachToGameObject(game, go, inst);
7817
8944
  const offs = bridgeSignals(inst, {
@@ -7847,6 +8974,58 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
7847
8974
  }
7848
8975
  return null;
7849
8976
  }
8977
+ handleTransformSizeChanged(changed) {
8978
+ var _a, _b;
8979
+ if (changed.type !== eva_js.OBSERVER_TYPE.CHANGE) return;
8980
+ const transform = changed.component;
8981
+ const go = (_a = changed.gameObject) !== null && _a !== void 0 ? _a : transform === null || transform === void 0 ? void 0 : transform.gameObject;
8982
+ if (!go) return;
8983
+ let applied = false;
8984
+ for (const [componentName, def] of Object.entries(COMPONENT_DEFINITIONS)) {
8985
+ const inst = (_b = this.instances.get(componentName)) === null || _b === void 0 ? void 0 : _b.get(go.id);
8986
+ if (!inst) continue;
8987
+ const component = getComponentSafe(go, componentName);
8988
+ if (applyTransformSizeToInstance(def, inst, component, go, 'transform-change')) {
8989
+ applied = true;
8990
+ }
8991
+ }
8992
+ const radioGroup = this.radioGroupInstances.get(go.id);
8993
+ if (radioGroup) {
8994
+ const size = readTransformRenderSize(go, {
8995
+ allowZero: true
8996
+ });
8997
+ if (size) {
8998
+ applyRuntimeSize(radioGroup, size);
8999
+ applied = true;
9000
+ }
9001
+ }
9002
+ if (applied) this.transformSizeAuthorities.add(go.id);
9003
+ this.relayoutLayoutInstances();
9004
+ }
9005
+ relayoutLayoutInstances() {
9006
+ for (const name of ['List', 'ScrollBox']) {
9007
+ const instMap = this.instances.get(name);
9008
+ if (!instMap) continue;
9009
+ for (const inst of instMap.values()) {
9010
+ relayoutRuntimeInstance(inst);
9011
+ }
9012
+ }
9013
+ }
9014
+ applyTransientTransformSize(c, go) {
9015
+ if (hasExplicitRenderSize(c)) return () => {};
9016
+ const size = readTransformRenderSize(go);
9017
+ if (!size) return () => {};
9018
+ const hadWidth = Object.prototype.hasOwnProperty.call(c, 'width');
9019
+ const hadHeight = Object.prototype.hasOwnProperty.call(c, 'height');
9020
+ const prevWidth = c.width;
9021
+ const prevHeight = c.height;
9022
+ if (size.width !== undefined) c.width = size.width;
9023
+ if (size.height !== undefined) c.height = size.height;
9024
+ return () => {
9025
+ if (hadWidth) c.width = prevWidth;else delete c.width;
9026
+ if (hadHeight) c.height = prevHeight;else delete c.height;
9027
+ };
9028
+ }
7850
9029
  };
7851
9030
  UISystem.systemName = 'UISystem';
7852
9031
  UISystem = __decorate([eva_js.decorators.componentObserver(buildObserverSchema())], UISystem);
@@ -7854,9 +9033,17 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
7854
9033
  function inlineResolveSpecialViews(name, c, game, go) {
7855
9034
  switch (name) {
7856
9035
  case 'ProgressBar':
7857
- c.__resolved_bg = resolveViewRef(game, go, c.bgView);
7858
- c.__resolved_fill = resolveViewRef(game, go, c.fillView);
7859
- break;
9036
+ {
9037
+ const fillView = c.nineSliceSprite ? c.fillView : normalizeProgressFillViewRef(c.fillView, c.fillPaddings, {
9038
+ width: c.width,
9039
+ height: c.height
9040
+ });
9041
+ c.__resolved_bg = resolveViewRef(game, go, c.bgView);
9042
+ c.__resolved_fill = resolveViewRef(game, go, fillView);
9043
+ c.__resolved_bg_view = c.nineSliceSprite && c.bgView && 'texture' in c.bgView ? c.bgView.texture : c.__resolved_bg;
9044
+ c.__resolved_fill_view = c.nineSliceSprite && c.fillView && 'texture' in c.fillView ? c.fillView.texture : c.__resolved_fill;
9045
+ break;
9046
+ }
7860
9047
  case 'Select':
7861
9048
  c.__resolved_closedView = resolveViewRef(game, go, c.closedView);
7862
9049
  c.__resolved_openView = resolveViewRef(game, go, c.openView);
@@ -7864,23 +9051,26 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
7864
9051
  case 'Dialog':
7865
9052
  c.__resolved_backdropView = resolveViewRef(game, go, c.backdropView);
7866
9053
  c.__resolved_backgroundView = resolveViewRef(game, go, c.backgroundView);
9054
+ c.__resolved_background_view = c.nineSliceSprite && c.backgroundView && 'texture' in c.backgroundView ? c.backgroundView.texture : c.__resolved_backgroundView;
7867
9055
  break;
7868
9056
  case 'MaskedFrame':
7869
9057
  c.__resolved_targetView = resolveViewRef(game, go, c.targetView);
7870
9058
  c.__resolved_maskView = resolveViewRef(game, go, c.maskView);
9059
+ c.__resolved_target_view = c.targetView && 'texture' in c.targetView ? c.targetView.texture : c.__resolved_targetView;
9060
+ c.__resolved_mask_view = c.maskView && 'texture' in c.maskView ? c.maskView.texture : c.__resolved_maskView;
7871
9061
  break;
7872
9062
  }
7873
9063
  }
7874
9064
  function validateInlineResolved(name, c) {
7875
9065
  switch (name) {
7876
9066
  case 'ProgressBar':
7877
- return !!(c.__resolved_bg && c.__resolved_fill);
9067
+ return !!(c.__resolved_bg_view && c.__resolved_fill_view);
7878
9068
  case 'Select':
7879
9069
  return !!(c.__resolved_closedView && c.__resolved_openView);
7880
9070
  case 'Dialog':
7881
9071
  return true;
7882
9072
  case 'MaskedFrame':
7883
- return !!(c.__resolved_targetView && c.__resolved_maskView);
9073
+ return !!(c.__resolved_target_view && c.__resolved_mask_view);
7884
9074
  default:
7885
9075
  return true;
7886
9076
  }
@@ -7896,14 +9086,44 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
7896
9086
  if (!child) continue;
7897
9087
  const childContainer = getEvaContainer(game, child);
7898
9088
  if (childContainer) {
9089
+ if (childContainer.width <= 0 || childContainer.height <= 0) continue;
7899
9090
  try {
7900
9091
  (_c = (_b = childContainer.parent) === null || _b === void 0 ? void 0 : _b.removeChild) === null || _c === void 0 ? void 0 : _c.call(_b, childContainer);
7901
9092
  } catch (_) {}
7902
- result.push(childContainer);
9093
+ result.push(wrapLayoutItem(childContainer, child));
7903
9094
  }
7904
9095
  }
7905
9096
  return result;
7906
9097
  }
9098
+ function wrapLayoutItem(childContainer, child) {
9099
+ const wrapper = new pixi_js.Container();
9100
+ const childName = child === null || child === void 0 ? void 0 : child.name;
9101
+ wrapper.label = childName ? `${childName}:layout-item` : 'plugin-ui-layout-item';
9102
+ wrapper.addChild(childContainer);
9103
+ Object.defineProperty(wrapper, 'width', {
9104
+ get: () => resolveLayoutItemSize(child, childContainer, 'width'),
9105
+ set: () => {},
9106
+ configurable: true
9107
+ });
9108
+ Object.defineProperty(wrapper, 'height', {
9109
+ get: () => resolveLayoutItemSize(child, childContainer, 'height'),
9110
+ set: () => {},
9111
+ configurable: true
9112
+ });
9113
+ return wrapper;
9114
+ }
9115
+ function resolveLayoutItemSize(child, childContainer, key) {
9116
+ var _a, _b;
9117
+ const transformSize = Number((_b = (_a = child === null || child === void 0 ? void 0 : child.transform) === null || _a === void 0 ? void 0 : _a.size) === null || _b === void 0 ? void 0 : _b[key]);
9118
+ if (Number.isFinite(transformSize) && transformSize > 0) return transformSize;
9119
+ const containerSize = Number(childContainer === null || childContainer === void 0 ? void 0 : childContainer[key]);
9120
+ return Number.isFinite(containerSize) ? containerSize : 0;
9121
+ }
9122
+ function getCollectedChildCount(go, childName) {
9123
+ var _a, _b, _c;
9124
+ const contentChild = findChildEntity(go, childName);
9125
+ return (_c = (_b = (_a = contentChild === null || contentChild === void 0 ? void 0 : contentChild.transform) === null || _a === void 0 ? void 0 : _a.children) === null || _b === void 0 ? void 0 : _b.length) !== null && _c !== void 0 ? _c : 0;
9126
+ }
7907
9127
  function findChildEntity(go, name) {
7908
9128
  var _a, _b;
7909
9129
  if (!go) return null;
@@ -7919,6 +9139,14 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
7919
9139
  }
7920
9140
  return null;
7921
9141
  }
9142
+ function getComponentSafe(go, componentName) {
9143
+ var _a;
9144
+ try {
9145
+ return (_a = go === null || go === void 0 ? void 0 : go.getComponent) === null || _a === void 0 ? void 0 : _a.call(go, componentName);
9146
+ } catch (_) {
9147
+ return undefined;
9148
+ }
9149
+ }
7922
9150
  exports.Button = Button;
7923
9151
  exports.COMPONENT_DEFINITIONS = COMPONENT_DEFINITIONS;
7924
9152
  exports.CheckBox = CheckBox;
@@ -7935,9 +9163,11 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
7935
9163
  exports.RadioGroup = RadioGroup;
7936
9164
  exports.ScrollBox = ScrollBox;
7937
9165
  exports.Select = Select;
9166
+ exports.Shape = Shape;
7938
9167
  exports.Slider = Slider;
7939
9168
  exports.Switcher = Switcher;
7940
- exports.UI = UI;
9169
+ exports.UI = Shape;
9170
+ exports.UIShapeType = UIShapeType;
7941
9171
  exports.UISystem = UISystem$1;
7942
9172
  exports.defineUiComponent = defineUiComponent;
7943
9173
  Object.defineProperty(exports, '__esModule', {