@almadar/ui 6.2.0 → 6.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7334,6 +7334,7 @@ function NativeSelect({
7334
7334
  error,
7335
7335
  onChange,
7336
7336
  onValueChange,
7337
+ action,
7337
7338
  value,
7338
7339
  ...props
7339
7340
  }) {
@@ -7345,6 +7346,9 @@ function NativeSelect({
7345
7346
  onChange?.(e);
7346
7347
  }
7347
7348
  dispatchValueChange(onValueChange, eventBus, e.target.value);
7349
+ if (action) {
7350
+ eventBus.emit(`UI:${action}`, { value: e.target.value });
7351
+ }
7348
7352
  };
7349
7353
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
7350
7354
  /* @__PURE__ */ jsxRuntime.jsxs(
@@ -7380,6 +7384,7 @@ function RichSelect({
7380
7384
  error,
7381
7385
  onChange,
7382
7386
  onValueChange,
7387
+ action,
7383
7388
  value,
7384
7389
  multiple,
7385
7390
  searchable,
@@ -7405,6 +7410,9 @@ function RichSelect({
7405
7410
  eventBus.emit(`UI:${onChange}`, { value: next });
7406
7411
  }
7407
7412
  dispatchValueChange(onValueChange, eventBus, next);
7413
+ if (action) {
7414
+ eventBus.emit(`UI:${action}`, { value: next });
7415
+ }
7408
7416
  };
7409
7417
  const clear = (e) => {
7410
7418
  e.stopPropagation();
@@ -7413,6 +7421,9 @@ function RichSelect({
7413
7421
  eventBus.emit(`UI:${onChange}`, { value: next });
7414
7422
  }
7415
7423
  dispatchValueChange(onValueChange, eventBus, next);
7424
+ if (action) {
7425
+ eventBus.emit(`UI:${action}`, { value: next });
7426
+ }
7416
7427
  };
7417
7428
  React94.useEffect(() => {
7418
7429
  const handler = (e) => {
@@ -13620,7 +13631,7 @@ function proceduralShapes(view, pos, fade, progress) {
13620
13631
  }
13621
13632
  }
13622
13633
  }
13623
- function expandFxItem(view, node, epochNowMs, dim) {
13634
+ function expandFxItem(view, node, epochNowMs, dim, projector) {
13624
13635
  if (view.space === "screen") return [];
13625
13636
  const tickMs = node.tickMs ?? DEFAULT_TICK_MS;
13626
13637
  const { ageMs, progress, fade } = fxLifecycle(view, epochNowMs, tickMs);
@@ -13656,24 +13667,26 @@ function expandFxItem(view, node, epochNowMs, dim) {
13656
13667
  out.push(...proceduralShapes(view, pos, fade, progress));
13657
13668
  }
13658
13669
  if (view.message) {
13670
+ const pxSize = projector && view.size !== void 0 ? Math.max(10, Math.round(view.size * projector.tileWidth)) : void 0;
13659
13671
  const text = {
13660
13672
  type: "draw-text",
13661
13673
  text: view.message,
13662
13674
  position: pos,
13663
13675
  offsetY: -(0.15 + 0.55 * progress),
13664
13676
  color: view.color ?? node.textColor ?? DEFAULT_TEXT_COLOR,
13665
- opacity: fade
13677
+ opacity: fade,
13678
+ ...pxSize ? { font: `bold ${pxSize}px system-ui, sans-serif` } : {}
13666
13679
  };
13667
13680
  out.push(text);
13668
13681
  }
13669
13682
  return out;
13670
13683
  }
13671
- function expandFxLayer(node, epochNowMs, dim) {
13684
+ function expandFxLayer(node, epochNowMs, dim, projector) {
13672
13685
  if (!Array.isArray(node.items)) return [];
13673
13686
  const out = [];
13674
13687
  for (const item of node.items) {
13675
13688
  if (!item || typeof item.id !== "string") continue;
13676
- out.push(...expandFxItem(resolveFxView(item, node.presets), node, epochNowMs, dim));
13689
+ out.push(...expandFxItem(resolveFxView(item, node.presets), node, epochNowMs, dim, projector));
13677
13690
  }
13678
13691
  return out;
13679
13692
  }
@@ -13740,7 +13753,7 @@ function paintDrawable(painter, node, dctx) {
13740
13753
  break;
13741
13754
  case "draw-fx-layer": {
13742
13755
  const epochNow = dctx.time > 0 && typeof performance !== "undefined" ? performance.timeOrigin + dctx.time : 0;
13743
- for (const child of expandFxLayer(node, epochNow, "2d")) paintDrawable(painter, child, dctx);
13756
+ for (const child of expandFxLayer(node, epochNow, "2d", dctx.projector)) paintDrawable(painter, child, dctx);
13744
13757
  break;
13745
13758
  }
13746
13759
  }
package/dist/avl/index.js CHANGED
@@ -7258,6 +7258,7 @@ function NativeSelect({
7258
7258
  error,
7259
7259
  onChange,
7260
7260
  onValueChange,
7261
+ action,
7261
7262
  value,
7262
7263
  ...props
7263
7264
  }) {
@@ -7269,6 +7270,9 @@ function NativeSelect({
7269
7270
  onChange?.(e);
7270
7271
  }
7271
7272
  dispatchValueChange(onValueChange, eventBus, e.target.value);
7273
+ if (action) {
7274
+ eventBus.emit(`UI:${action}`, { value: e.target.value });
7275
+ }
7272
7276
  };
7273
7277
  return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
7274
7278
  /* @__PURE__ */ jsxs(
@@ -7304,6 +7308,7 @@ function RichSelect({
7304
7308
  error,
7305
7309
  onChange,
7306
7310
  onValueChange,
7311
+ action,
7307
7312
  value,
7308
7313
  multiple,
7309
7314
  searchable,
@@ -7329,6 +7334,9 @@ function RichSelect({
7329
7334
  eventBus.emit(`UI:${onChange}`, { value: next });
7330
7335
  }
7331
7336
  dispatchValueChange(onValueChange, eventBus, next);
7337
+ if (action) {
7338
+ eventBus.emit(`UI:${action}`, { value: next });
7339
+ }
7332
7340
  };
7333
7341
  const clear = (e) => {
7334
7342
  e.stopPropagation();
@@ -7337,6 +7345,9 @@ function RichSelect({
7337
7345
  eventBus.emit(`UI:${onChange}`, { value: next });
7338
7346
  }
7339
7347
  dispatchValueChange(onValueChange, eventBus, next);
7348
+ if (action) {
7349
+ eventBus.emit(`UI:${action}`, { value: next });
7350
+ }
7340
7351
  };
7341
7352
  useEffect(() => {
7342
7353
  const handler = (e) => {
@@ -13544,7 +13555,7 @@ function proceduralShapes(view, pos, fade, progress) {
13544
13555
  }
13545
13556
  }
13546
13557
  }
13547
- function expandFxItem(view, node, epochNowMs, dim) {
13558
+ function expandFxItem(view, node, epochNowMs, dim, projector) {
13548
13559
  if (view.space === "screen") return [];
13549
13560
  const tickMs = node.tickMs ?? DEFAULT_TICK_MS;
13550
13561
  const { ageMs, progress, fade } = fxLifecycle(view, epochNowMs, tickMs);
@@ -13580,24 +13591,26 @@ function expandFxItem(view, node, epochNowMs, dim) {
13580
13591
  out.push(...proceduralShapes(view, pos, fade, progress));
13581
13592
  }
13582
13593
  if (view.message) {
13594
+ const pxSize = projector && view.size !== void 0 ? Math.max(10, Math.round(view.size * projector.tileWidth)) : void 0;
13583
13595
  const text = {
13584
13596
  type: "draw-text",
13585
13597
  text: view.message,
13586
13598
  position: pos,
13587
13599
  offsetY: -(0.15 + 0.55 * progress),
13588
13600
  color: view.color ?? node.textColor ?? DEFAULT_TEXT_COLOR,
13589
- opacity: fade
13601
+ opacity: fade,
13602
+ ...pxSize ? { font: `bold ${pxSize}px system-ui, sans-serif` } : {}
13590
13603
  };
13591
13604
  out.push(text);
13592
13605
  }
13593
13606
  return out;
13594
13607
  }
13595
- function expandFxLayer(node, epochNowMs, dim) {
13608
+ function expandFxLayer(node, epochNowMs, dim, projector) {
13596
13609
  if (!Array.isArray(node.items)) return [];
13597
13610
  const out = [];
13598
13611
  for (const item of node.items) {
13599
13612
  if (!item || typeof item.id !== "string") continue;
13600
- out.push(...expandFxItem(resolveFxView(item, node.presets), node, epochNowMs, dim));
13613
+ out.push(...expandFxItem(resolveFxView(item, node.presets), node, epochNowMs, dim, projector));
13601
13614
  }
13602
13615
  return out;
13603
13616
  }
@@ -13664,7 +13677,7 @@ function paintDrawable(painter, node, dctx) {
13664
13677
  break;
13665
13678
  case "draw-fx-layer": {
13666
13679
  const epochNow = dctx.time > 0 && typeof performance !== "undefined" ? performance.timeOrigin + dctx.time : 0;
13667
- for (const child of expandFxLayer(node, epochNow, "2d")) paintDrawable(painter, child, dctx);
13680
+ for (const child of expandFxLayer(node, epochNow, "2d", dctx.projector)) paintDrawable(painter, child, dctx);
13668
13681
  break;
13669
13682
  }
13670
13683
  }
@@ -2169,6 +2169,7 @@ function NativeSelect({
2169
2169
  error,
2170
2170
  onChange,
2171
2171
  onValueChange,
2172
+ action,
2172
2173
  value,
2173
2174
  ...props
2174
2175
  }) {
@@ -2180,6 +2181,9 @@ function NativeSelect({
2180
2181
  onChange?.(e);
2181
2182
  }
2182
2183
  dispatchValueChange(onValueChange, eventBus, e.target.value);
2184
+ if (action) {
2185
+ eventBus.emit(`UI:${action}`, { value: e.target.value });
2186
+ }
2183
2187
  };
2184
2188
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
2185
2189
  /* @__PURE__ */ jsxRuntime.jsxs(
@@ -2215,6 +2219,7 @@ function RichSelect({
2215
2219
  error,
2216
2220
  onChange,
2217
2221
  onValueChange,
2222
+ action,
2218
2223
  value,
2219
2224
  multiple,
2220
2225
  searchable,
@@ -2240,6 +2245,9 @@ function RichSelect({
2240
2245
  eventBus.emit(`UI:${onChange}`, { value: next });
2241
2246
  }
2242
2247
  dispatchValueChange(onValueChange, eventBus, next);
2248
+ if (action) {
2249
+ eventBus.emit(`UI:${action}`, { value: next });
2250
+ }
2243
2251
  };
2244
2252
  const clear = (e) => {
2245
2253
  e.stopPropagation();
@@ -2248,6 +2256,9 @@ function RichSelect({
2248
2256
  eventBus.emit(`UI:${onChange}`, { value: next });
2249
2257
  }
2250
2258
  dispatchValueChange(onValueChange, eventBus, next);
2259
+ if (action) {
2260
+ eventBus.emit(`UI:${action}`, { value: next });
2261
+ }
2251
2262
  };
2252
2263
  React77.useEffect(() => {
2253
2264
  const handler = (e) => {
@@ -9685,7 +9696,7 @@ function proceduralShapes(view, pos, fade, progress) {
9685
9696
  }
9686
9697
  }
9687
9698
  }
9688
- function expandFxItem(view, node, epochNowMs, dim) {
9699
+ function expandFxItem(view, node, epochNowMs, dim, projector) {
9689
9700
  if (view.space === "screen") return [];
9690
9701
  const tickMs = node.tickMs ?? DEFAULT_TICK_MS;
9691
9702
  const { ageMs, progress, fade } = fxLifecycle(view, epochNowMs, tickMs);
@@ -9721,24 +9732,26 @@ function expandFxItem(view, node, epochNowMs, dim) {
9721
9732
  out.push(...proceduralShapes(view, pos, fade, progress));
9722
9733
  }
9723
9734
  if (view.message) {
9735
+ const pxSize = projector && view.size !== void 0 ? Math.max(10, Math.round(view.size * projector.tileWidth)) : void 0;
9724
9736
  const text = {
9725
9737
  type: "draw-text",
9726
9738
  text: view.message,
9727
9739
  position: pos,
9728
9740
  offsetY: -(0.15 + 0.55 * progress),
9729
9741
  color: view.color ?? node.textColor ?? DEFAULT_TEXT_COLOR,
9730
- opacity: fade
9742
+ opacity: fade,
9743
+ ...pxSize ? { font: `bold ${pxSize}px system-ui, sans-serif` } : {}
9731
9744
  };
9732
9745
  out.push(text);
9733
9746
  }
9734
9747
  return out;
9735
9748
  }
9736
- function expandFxLayer(node, epochNowMs, dim) {
9749
+ function expandFxLayer(node, epochNowMs, dim, projector) {
9737
9750
  if (!Array.isArray(node.items)) return [];
9738
9751
  const out = [];
9739
9752
  for (const item of node.items) {
9740
9753
  if (!item || typeof item.id !== "string") continue;
9741
- out.push(...expandFxItem(resolveFxView(item, node.presets), node, epochNowMs, dim));
9754
+ out.push(...expandFxItem(resolveFxView(item, node.presets), node, epochNowMs, dim, projector));
9742
9755
  }
9743
9756
  return out;
9744
9757
  }
@@ -9805,7 +9818,7 @@ function paintDrawable(painter, node, dctx) {
9805
9818
  break;
9806
9819
  case "draw-fx-layer": {
9807
9820
  const epochNow = dctx.time > 0 && typeof performance !== "undefined" ? performance.timeOrigin + dctx.time : 0;
9808
- for (const child of expandFxLayer(node, epochNow, "2d")) paintDrawable(painter, child, dctx);
9821
+ for (const child of expandFxLayer(node, epochNow, "2d", dctx.projector)) paintDrawable(painter, child, dctx);
9809
9822
  break;
9810
9823
  }
9811
9824
  }
@@ -314,7 +314,9 @@ interface InputProps extends Omit<React__default.InputHTMLAttributes<HTMLInputEl
314
314
  value?: string | number;
315
315
  /** Whether input is disabled */
316
316
  disabled?: boolean;
317
- /** Declarative event name for trait dispatch */
317
+ /** Declarative event name for trait dispatch.
318
+ * @payloadTypeWhen value inputType=number->number
319
+ */
318
320
  action?: EventEmit<{
319
321
  value: string | number;
320
322
  }>;
@@ -406,8 +408,10 @@ interface SelectProps extends Omit<React__default.SelectHTMLAttributes<HTMLSelec
406
408
  placeholder?: string;
407
409
  /** Current value (string for single, string[] for multiple) */
408
410
  value?: string | string[];
409
- /** Declarative event name for trait dispatch */
410
- action?: EventKey;
411
+ /** Declarative event name for trait dispatch — emits `{ value }` on selection commit (same gestures as `onChange`). */
412
+ action?: EventEmit<{
413
+ value: string | string[];
414
+ }>;
411
415
  /** Error message */
412
416
  error?: string;
413
417
  /** Allow selecting multiple values — activates the rich dropdown. */
@@ -314,7 +314,9 @@ interface InputProps extends Omit<React__default.InputHTMLAttributes<HTMLInputEl
314
314
  value?: string | number;
315
315
  /** Whether input is disabled */
316
316
  disabled?: boolean;
317
- /** Declarative event name for trait dispatch */
317
+ /** Declarative event name for trait dispatch.
318
+ * @payloadTypeWhen value inputType=number->number
319
+ */
318
320
  action?: EventEmit<{
319
321
  value: string | number;
320
322
  }>;
@@ -406,8 +408,10 @@ interface SelectProps extends Omit<React__default.SelectHTMLAttributes<HTMLSelec
406
408
  placeholder?: string;
407
409
  /** Current value (string for single, string[] for multiple) */
408
410
  value?: string | string[];
409
- /** Declarative event name for trait dispatch */
410
- action?: EventKey;
411
+ /** Declarative event name for trait dispatch — emits `{ value }` on selection commit (same gestures as `onChange`). */
412
+ action?: EventEmit<{
413
+ value: string | string[];
414
+ }>;
411
415
  /** Error message */
412
416
  error?: string;
413
417
  /** Allow selecting multiple values — activates the rich dropdown. */
@@ -2094,6 +2094,7 @@ function NativeSelect({
2094
2094
  error,
2095
2095
  onChange,
2096
2096
  onValueChange,
2097
+ action,
2097
2098
  value,
2098
2099
  ...props
2099
2100
  }) {
@@ -2105,6 +2106,9 @@ function NativeSelect({
2105
2106
  onChange?.(e);
2106
2107
  }
2107
2108
  dispatchValueChange(onValueChange, eventBus, e.target.value);
2109
+ if (action) {
2110
+ eventBus.emit(`UI:${action}`, { value: e.target.value });
2111
+ }
2108
2112
  };
2109
2113
  return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
2110
2114
  /* @__PURE__ */ jsxs(
@@ -2140,6 +2144,7 @@ function RichSelect({
2140
2144
  error,
2141
2145
  onChange,
2142
2146
  onValueChange,
2147
+ action,
2143
2148
  value,
2144
2149
  multiple,
2145
2150
  searchable,
@@ -2165,6 +2170,9 @@ function RichSelect({
2165
2170
  eventBus.emit(`UI:${onChange}`, { value: next });
2166
2171
  }
2167
2172
  dispatchValueChange(onValueChange, eventBus, next);
2173
+ if (action) {
2174
+ eventBus.emit(`UI:${action}`, { value: next });
2175
+ }
2168
2176
  };
2169
2177
  const clear = (e) => {
2170
2178
  e.stopPropagation();
@@ -2173,6 +2181,9 @@ function RichSelect({
2173
2181
  eventBus.emit(`UI:${onChange}`, { value: next });
2174
2182
  }
2175
2183
  dispatchValueChange(onValueChange, eventBus, next);
2184
+ if (action) {
2185
+ eventBus.emit(`UI:${action}`, { value: next });
2186
+ }
2176
2187
  };
2177
2188
  useEffect(() => {
2178
2189
  const handler = (e) => {
@@ -9610,7 +9621,7 @@ function proceduralShapes(view, pos, fade, progress) {
9610
9621
  }
9611
9622
  }
9612
9623
  }
9613
- function expandFxItem(view, node, epochNowMs, dim) {
9624
+ function expandFxItem(view, node, epochNowMs, dim, projector) {
9614
9625
  if (view.space === "screen") return [];
9615
9626
  const tickMs = node.tickMs ?? DEFAULT_TICK_MS;
9616
9627
  const { ageMs, progress, fade } = fxLifecycle(view, epochNowMs, tickMs);
@@ -9646,24 +9657,26 @@ function expandFxItem(view, node, epochNowMs, dim) {
9646
9657
  out.push(...proceduralShapes(view, pos, fade, progress));
9647
9658
  }
9648
9659
  if (view.message) {
9660
+ const pxSize = projector && view.size !== void 0 ? Math.max(10, Math.round(view.size * projector.tileWidth)) : void 0;
9649
9661
  const text = {
9650
9662
  type: "draw-text",
9651
9663
  text: view.message,
9652
9664
  position: pos,
9653
9665
  offsetY: -(0.15 + 0.55 * progress),
9654
9666
  color: view.color ?? node.textColor ?? DEFAULT_TEXT_COLOR,
9655
- opacity: fade
9667
+ opacity: fade,
9668
+ ...pxSize ? { font: `bold ${pxSize}px system-ui, sans-serif` } : {}
9656
9669
  };
9657
9670
  out.push(text);
9658
9671
  }
9659
9672
  return out;
9660
9673
  }
9661
- function expandFxLayer(node, epochNowMs, dim) {
9674
+ function expandFxLayer(node, epochNowMs, dim, projector) {
9662
9675
  if (!Array.isArray(node.items)) return [];
9663
9676
  const out = [];
9664
9677
  for (const item of node.items) {
9665
9678
  if (!item || typeof item.id !== "string") continue;
9666
- out.push(...expandFxItem(resolveFxView(item, node.presets), node, epochNowMs, dim));
9679
+ out.push(...expandFxItem(resolveFxView(item, node.presets), node, epochNowMs, dim, projector));
9667
9680
  }
9668
9681
  return out;
9669
9682
  }
@@ -9730,7 +9743,7 @@ function paintDrawable(painter, node, dctx) {
9730
9743
  break;
9731
9744
  case "draw-fx-layer": {
9732
9745
  const epochNow = dctx.time > 0 && typeof performance !== "undefined" ? performance.timeOrigin + dctx.time : 0;
9733
- for (const child of expandFxLayer(node, epochNow, "2d")) paintDrawable(painter, child, dctx);
9746
+ for (const child of expandFxLayer(node, epochNow, "2d", dctx.projector)) paintDrawable(painter, child, dctx);
9734
9747
  break;
9735
9748
  }
9736
9749
  }
@@ -854,7 +854,7 @@ function proceduralShapes(view, pos, fade, progress) {
854
854
  }
855
855
  }
856
856
  }
857
- function expandFxItem(view, node, epochNowMs, dim) {
857
+ function expandFxItem(view, node, epochNowMs, dim, projector) {
858
858
  if (view.space === "screen") return [];
859
859
  const tickMs = node.tickMs ?? DEFAULT_TICK_MS;
860
860
  const { ageMs, progress, fade } = fxLifecycle(view, epochNowMs, tickMs);
@@ -896,13 +896,14 @@ function expandFxItem(view, node, epochNowMs, dim) {
896
896
  position: pos,
897
897
  offsetY: -(0.15 + 0.55 * progress),
898
898
  color: view.color ?? node.textColor ?? DEFAULT_TEXT_COLOR,
899
- opacity: fade
899
+ opacity: fade,
900
+ ...{}
900
901
  };
901
902
  out.push(text);
902
903
  }
903
904
  return out;
904
905
  }
905
- function expandFxLayer(node, epochNowMs, dim) {
906
+ function expandFxLayer(node, epochNowMs, dim, projector) {
906
907
  if (!Array.isArray(node.items)) return [];
907
908
  const out = [];
908
909
  for (const item of node.items) {
@@ -830,7 +830,7 @@ function proceduralShapes(view, pos, fade, progress) {
830
830
  }
831
831
  }
832
832
  }
833
- function expandFxItem(view, node, epochNowMs, dim) {
833
+ function expandFxItem(view, node, epochNowMs, dim, projector) {
834
834
  if (view.space === "screen") return [];
835
835
  const tickMs = node.tickMs ?? DEFAULT_TICK_MS;
836
836
  const { ageMs, progress, fade } = fxLifecycle(view, epochNowMs, tickMs);
@@ -872,13 +872,14 @@ function expandFxItem(view, node, epochNowMs, dim) {
872
872
  position: pos,
873
873
  offsetY: -(0.15 + 0.55 * progress),
874
874
  color: view.color ?? node.textColor ?? DEFAULT_TEXT_COLOR,
875
- opacity: fade
875
+ opacity: fade,
876
+ ...{}
876
877
  };
877
878
  out.push(text);
878
879
  }
879
880
  return out;
880
881
  }
881
- function expandFxLayer(node, epochNowMs, dim) {
882
+ function expandFxLayer(node, epochNowMs, dim, projector) {
882
883
  if (!Array.isArray(node.items)) return [];
883
884
  const out = [];
884
885
  for (const item of node.items) {
@@ -3506,6 +3506,7 @@ function NativeSelect({
3506
3506
  error,
3507
3507
  onChange,
3508
3508
  onValueChange,
3509
+ action,
3509
3510
  value,
3510
3511
  ...props
3511
3512
  }) {
@@ -3517,6 +3518,9 @@ function NativeSelect({
3517
3518
  onChange?.(e);
3518
3519
  }
3519
3520
  dispatchValueChange(onValueChange, eventBus, e.target.value);
3521
+ if (action) {
3522
+ eventBus.emit(`UI:${action}`, { value: e.target.value });
3523
+ }
3520
3524
  };
3521
3525
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
3522
3526
  /* @__PURE__ */ jsxRuntime.jsxs(
@@ -3552,6 +3556,7 @@ function RichSelect({
3552
3556
  error,
3553
3557
  onChange,
3554
3558
  onValueChange,
3559
+ action,
3555
3560
  value,
3556
3561
  multiple,
3557
3562
  searchable,
@@ -3577,6 +3582,9 @@ function RichSelect({
3577
3582
  eventBus.emit(`UI:${onChange}`, { value: next });
3578
3583
  }
3579
3584
  dispatchValueChange(onValueChange, eventBus, next);
3585
+ if (action) {
3586
+ eventBus.emit(`UI:${action}`, { value: next });
3587
+ }
3580
3588
  };
3581
3589
  const clear = (e) => {
3582
3590
  e.stopPropagation();
@@ -3585,6 +3593,9 @@ function RichSelect({
3585
3593
  eventBus.emit(`UI:${onChange}`, { value: next });
3586
3594
  }
3587
3595
  dispatchValueChange(onValueChange, eventBus, next);
3596
+ if (action) {
3597
+ eventBus.emit(`UI:${action}`, { value: next });
3598
+ }
3588
3599
  };
3589
3600
  React87.useEffect(() => {
3590
3601
  const handler = (e) => {
@@ -9878,7 +9889,7 @@ function proceduralShapes(view, pos, fade, progress) {
9878
9889
  }
9879
9890
  }
9880
9891
  }
9881
- function expandFxItem(view, node, epochNowMs, dim) {
9892
+ function expandFxItem(view, node, epochNowMs, dim, projector) {
9882
9893
  if (view.space === "screen") return [];
9883
9894
  const tickMs = node.tickMs ?? DEFAULT_TICK_MS;
9884
9895
  const { ageMs, progress, fade } = fxLifecycle(view, epochNowMs, tickMs);
@@ -9914,24 +9925,26 @@ function expandFxItem(view, node, epochNowMs, dim) {
9914
9925
  out.push(...proceduralShapes(view, pos, fade, progress));
9915
9926
  }
9916
9927
  if (view.message) {
9928
+ const pxSize = projector && view.size !== void 0 ? Math.max(10, Math.round(view.size * projector.tileWidth)) : void 0;
9917
9929
  const text = {
9918
9930
  type: "draw-text",
9919
9931
  text: view.message,
9920
9932
  position: pos,
9921
9933
  offsetY: -(0.15 + 0.55 * progress),
9922
9934
  color: view.color ?? node.textColor ?? DEFAULT_TEXT_COLOR,
9923
- opacity: fade
9935
+ opacity: fade,
9936
+ ...pxSize ? { font: `bold ${pxSize}px system-ui, sans-serif` } : {}
9924
9937
  };
9925
9938
  out.push(text);
9926
9939
  }
9927
9940
  return out;
9928
9941
  }
9929
- function expandFxLayer(node, epochNowMs, dim) {
9942
+ function expandFxLayer(node, epochNowMs, dim, projector) {
9930
9943
  if (!Array.isArray(node.items)) return [];
9931
9944
  const out = [];
9932
9945
  for (const item of node.items) {
9933
9946
  if (!item || typeof item.id !== "string") continue;
9934
- out.push(...expandFxItem(resolveFxView(item, node.presets), node, epochNowMs, dim));
9947
+ out.push(...expandFxItem(resolveFxView(item, node.presets), node, epochNowMs, dim, projector));
9935
9948
  }
9936
9949
  return out;
9937
9950
  }
@@ -9998,7 +10011,7 @@ function paintDrawable(painter, node, dctx) {
9998
10011
  break;
9999
10012
  case "draw-fx-layer": {
10000
10013
  const epochNow = dctx.time > 0 && typeof performance !== "undefined" ? performance.timeOrigin + dctx.time : 0;
10001
- for (const child of expandFxLayer(node, epochNow, "2d")) paintDrawable(painter, child, dctx);
10014
+ for (const child of expandFxLayer(node, epochNow, "2d", dctx.projector)) paintDrawable(painter, child, dctx);
10002
10015
  break;
10003
10016
  }
10004
10017
  }
@@ -3432,6 +3432,7 @@ function NativeSelect({
3432
3432
  error,
3433
3433
  onChange,
3434
3434
  onValueChange,
3435
+ action,
3435
3436
  value,
3436
3437
  ...props
3437
3438
  }) {
@@ -3443,6 +3444,9 @@ function NativeSelect({
3443
3444
  onChange?.(e);
3444
3445
  }
3445
3446
  dispatchValueChange(onValueChange, eventBus, e.target.value);
3447
+ if (action) {
3448
+ eventBus.emit(`UI:${action}`, { value: e.target.value });
3449
+ }
3446
3450
  };
3447
3451
  return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
3448
3452
  /* @__PURE__ */ jsxs(
@@ -3478,6 +3482,7 @@ function RichSelect({
3478
3482
  error,
3479
3483
  onChange,
3480
3484
  onValueChange,
3485
+ action,
3481
3486
  value,
3482
3487
  multiple,
3483
3488
  searchable,
@@ -3503,6 +3508,9 @@ function RichSelect({
3503
3508
  eventBus.emit(`UI:${onChange}`, { value: next });
3504
3509
  }
3505
3510
  dispatchValueChange(onValueChange, eventBus, next);
3511
+ if (action) {
3512
+ eventBus.emit(`UI:${action}`, { value: next });
3513
+ }
3506
3514
  };
3507
3515
  const clear = (e) => {
3508
3516
  e.stopPropagation();
@@ -3511,6 +3519,9 @@ function RichSelect({
3511
3519
  eventBus.emit(`UI:${onChange}`, { value: next });
3512
3520
  }
3513
3521
  dispatchValueChange(onValueChange, eventBus, next);
3522
+ if (action) {
3523
+ eventBus.emit(`UI:${action}`, { value: next });
3524
+ }
3514
3525
  };
3515
3526
  useEffect(() => {
3516
3527
  const handler = (e) => {
@@ -9804,7 +9815,7 @@ function proceduralShapes(view, pos, fade, progress) {
9804
9815
  }
9805
9816
  }
9806
9817
  }
9807
- function expandFxItem(view, node, epochNowMs, dim) {
9818
+ function expandFxItem(view, node, epochNowMs, dim, projector) {
9808
9819
  if (view.space === "screen") return [];
9809
9820
  const tickMs = node.tickMs ?? DEFAULT_TICK_MS;
9810
9821
  const { ageMs, progress, fade } = fxLifecycle(view, epochNowMs, tickMs);
@@ -9840,24 +9851,26 @@ function expandFxItem(view, node, epochNowMs, dim) {
9840
9851
  out.push(...proceduralShapes(view, pos, fade, progress));
9841
9852
  }
9842
9853
  if (view.message) {
9854
+ const pxSize = projector && view.size !== void 0 ? Math.max(10, Math.round(view.size * projector.tileWidth)) : void 0;
9843
9855
  const text = {
9844
9856
  type: "draw-text",
9845
9857
  text: view.message,
9846
9858
  position: pos,
9847
9859
  offsetY: -(0.15 + 0.55 * progress),
9848
9860
  color: view.color ?? node.textColor ?? DEFAULT_TEXT_COLOR,
9849
- opacity: fade
9861
+ opacity: fade,
9862
+ ...pxSize ? { font: `bold ${pxSize}px system-ui, sans-serif` } : {}
9850
9863
  };
9851
9864
  out.push(text);
9852
9865
  }
9853
9866
  return out;
9854
9867
  }
9855
- function expandFxLayer(node, epochNowMs, dim) {
9868
+ function expandFxLayer(node, epochNowMs, dim, projector) {
9856
9869
  if (!Array.isArray(node.items)) return [];
9857
9870
  const out = [];
9858
9871
  for (const item of node.items) {
9859
9872
  if (!item || typeof item.id !== "string") continue;
9860
- out.push(...expandFxItem(resolveFxView(item, node.presets), node, epochNowMs, dim));
9873
+ out.push(...expandFxItem(resolveFxView(item, node.presets), node, epochNowMs, dim, projector));
9861
9874
  }
9862
9875
  return out;
9863
9876
  }
@@ -9924,7 +9937,7 @@ function paintDrawable(painter, node, dctx) {
9924
9937
  break;
9925
9938
  case "draw-fx-layer": {
9926
9939
  const epochNow = dctx.time > 0 && typeof performance !== "undefined" ? performance.timeOrigin + dctx.time : 0;
9927
- for (const child of expandFxLayer(node, epochNow, "2d")) paintDrawable(painter, child, dctx);
9940
+ for (const child of expandFxLayer(node, epochNow, "2d", dctx.projector)) paintDrawable(painter, child, dctx);
9928
9941
  break;
9929
9942
  }
9930
9943
  }
@@ -3999,6 +3999,7 @@ function NativeSelect({
3999
3999
  error,
4000
4000
  onChange,
4001
4001
  onValueChange,
4002
+ action,
4002
4003
  value,
4003
4004
  ...props
4004
4005
  }) {
@@ -4010,6 +4011,9 @@ function NativeSelect({
4010
4011
  onChange?.(e);
4011
4012
  }
4012
4013
  dispatchValueChange(onValueChange, eventBus, e.target.value);
4014
+ if (action) {
4015
+ eventBus.emit(`UI:${action}`, { value: e.target.value });
4016
+ }
4013
4017
  };
4014
4018
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
4015
4019
  /* @__PURE__ */ jsxRuntime.jsxs(
@@ -4045,6 +4049,7 @@ function RichSelect({
4045
4049
  error,
4046
4050
  onChange,
4047
4051
  onValueChange,
4052
+ action,
4048
4053
  value,
4049
4054
  multiple,
4050
4055
  searchable,
@@ -4070,6 +4075,9 @@ function RichSelect({
4070
4075
  eventBus.emit(`UI:${onChange}`, { value: next });
4071
4076
  }
4072
4077
  dispatchValueChange(onValueChange, eventBus, next);
4078
+ if (action) {
4079
+ eventBus.emit(`UI:${action}`, { value: next });
4080
+ }
4073
4081
  };
4074
4082
  const clear = (e) => {
4075
4083
  e.stopPropagation();
@@ -4078,6 +4086,9 @@ function RichSelect({
4078
4086
  eventBus.emit(`UI:${onChange}`, { value: next });
4079
4087
  }
4080
4088
  dispatchValueChange(onValueChange, eventBus, next);
4089
+ if (action) {
4090
+ eventBus.emit(`UI:${action}`, { value: next });
4091
+ }
4081
4092
  };
4082
4093
  React85.useEffect(() => {
4083
4094
  const handler = (e) => {
@@ -10228,7 +10239,7 @@ function proceduralShapes(view, pos, fade, progress) {
10228
10239
  }
10229
10240
  }
10230
10241
  }
10231
- function expandFxItem(view, node, epochNowMs, dim) {
10242
+ function expandFxItem(view, node, epochNowMs, dim, projector) {
10232
10243
  if (view.space === "screen") return [];
10233
10244
  const tickMs = node.tickMs ?? DEFAULT_TICK_MS;
10234
10245
  const { ageMs, progress, fade } = fxLifecycle(view, epochNowMs, tickMs);
@@ -10264,24 +10275,26 @@ function expandFxItem(view, node, epochNowMs, dim) {
10264
10275
  out.push(...proceduralShapes(view, pos, fade, progress));
10265
10276
  }
10266
10277
  if (view.message) {
10278
+ const pxSize = projector && view.size !== void 0 ? Math.max(10, Math.round(view.size * projector.tileWidth)) : void 0;
10267
10279
  const text = {
10268
10280
  type: "draw-text",
10269
10281
  text: view.message,
10270
10282
  position: pos,
10271
10283
  offsetY: -(0.15 + 0.55 * progress),
10272
10284
  color: view.color ?? node.textColor ?? DEFAULT_TEXT_COLOR,
10273
- opacity: fade
10285
+ opacity: fade,
10286
+ ...pxSize ? { font: `bold ${pxSize}px system-ui, sans-serif` } : {}
10274
10287
  };
10275
10288
  out.push(text);
10276
10289
  }
10277
10290
  return out;
10278
10291
  }
10279
- function expandFxLayer(node, epochNowMs, dim) {
10292
+ function expandFxLayer(node, epochNowMs, dim, projector) {
10280
10293
  if (!Array.isArray(node.items)) return [];
10281
10294
  const out = [];
10282
10295
  for (const item of node.items) {
10283
10296
  if (!item || typeof item.id !== "string") continue;
10284
- out.push(...expandFxItem(resolveFxView(item, node.presets), node, epochNowMs, dim));
10297
+ out.push(...expandFxItem(resolveFxView(item, node.presets), node, epochNowMs, dim, projector));
10285
10298
  }
10286
10299
  return out;
10287
10300
  }
@@ -10348,7 +10361,7 @@ function paintDrawable(painter, node, dctx) {
10348
10361
  break;
10349
10362
  case "draw-fx-layer": {
10350
10363
  const epochNow = dctx.time > 0 && typeof performance !== "undefined" ? performance.timeOrigin + dctx.time : 0;
10351
- for (const child of expandFxLayer(node, epochNow, "2d")) paintDrawable(painter, child, dctx);
10364
+ for (const child of expandFxLayer(node, epochNow, "2d", dctx.projector)) paintDrawable(painter, child, dctx);
10352
10365
  break;
10353
10366
  }
10354
10367
  }
@@ -3925,6 +3925,7 @@ function NativeSelect({
3925
3925
  error,
3926
3926
  onChange,
3927
3927
  onValueChange,
3928
+ action,
3928
3929
  value,
3929
3930
  ...props
3930
3931
  }) {
@@ -3936,6 +3937,9 @@ function NativeSelect({
3936
3937
  onChange?.(e);
3937
3938
  }
3938
3939
  dispatchValueChange(onValueChange, eventBus, e.target.value);
3940
+ if (action) {
3941
+ eventBus.emit(`UI:${action}`, { value: e.target.value });
3942
+ }
3939
3943
  };
3940
3944
  return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
3941
3945
  /* @__PURE__ */ jsxs(
@@ -3971,6 +3975,7 @@ function RichSelect({
3971
3975
  error,
3972
3976
  onChange,
3973
3977
  onValueChange,
3978
+ action,
3974
3979
  value,
3975
3980
  multiple,
3976
3981
  searchable,
@@ -3996,6 +4001,9 @@ function RichSelect({
3996
4001
  eventBus.emit(`UI:${onChange}`, { value: next });
3997
4002
  }
3998
4003
  dispatchValueChange(onValueChange, eventBus, next);
4004
+ if (action) {
4005
+ eventBus.emit(`UI:${action}`, { value: next });
4006
+ }
3999
4007
  };
4000
4008
  const clear = (e) => {
4001
4009
  e.stopPropagation();
@@ -4004,6 +4012,9 @@ function RichSelect({
4004
4012
  eventBus.emit(`UI:${onChange}`, { value: next });
4005
4013
  }
4006
4014
  dispatchValueChange(onValueChange, eventBus, next);
4015
+ if (action) {
4016
+ eventBus.emit(`UI:${action}`, { value: next });
4017
+ }
4007
4018
  };
4008
4019
  useEffect(() => {
4009
4020
  const handler = (e) => {
@@ -10154,7 +10165,7 @@ function proceduralShapes(view, pos, fade, progress) {
10154
10165
  }
10155
10166
  }
10156
10167
  }
10157
- function expandFxItem(view, node, epochNowMs, dim) {
10168
+ function expandFxItem(view, node, epochNowMs, dim, projector) {
10158
10169
  if (view.space === "screen") return [];
10159
10170
  const tickMs = node.tickMs ?? DEFAULT_TICK_MS;
10160
10171
  const { ageMs, progress, fade } = fxLifecycle(view, epochNowMs, tickMs);
@@ -10190,24 +10201,26 @@ function expandFxItem(view, node, epochNowMs, dim) {
10190
10201
  out.push(...proceduralShapes(view, pos, fade, progress));
10191
10202
  }
10192
10203
  if (view.message) {
10204
+ const pxSize = projector && view.size !== void 0 ? Math.max(10, Math.round(view.size * projector.tileWidth)) : void 0;
10193
10205
  const text = {
10194
10206
  type: "draw-text",
10195
10207
  text: view.message,
10196
10208
  position: pos,
10197
10209
  offsetY: -(0.15 + 0.55 * progress),
10198
10210
  color: view.color ?? node.textColor ?? DEFAULT_TEXT_COLOR,
10199
- opacity: fade
10211
+ opacity: fade,
10212
+ ...pxSize ? { font: `bold ${pxSize}px system-ui, sans-serif` } : {}
10200
10213
  };
10201
10214
  out.push(text);
10202
10215
  }
10203
10216
  return out;
10204
10217
  }
10205
- function expandFxLayer(node, epochNowMs, dim) {
10218
+ function expandFxLayer(node, epochNowMs, dim, projector) {
10206
10219
  if (!Array.isArray(node.items)) return [];
10207
10220
  const out = [];
10208
10221
  for (const item of node.items) {
10209
10222
  if (!item || typeof item.id !== "string") continue;
10210
- out.push(...expandFxItem(resolveFxView(item, node.presets), node, epochNowMs, dim));
10223
+ out.push(...expandFxItem(resolveFxView(item, node.presets), node, epochNowMs, dim, projector));
10211
10224
  }
10212
10225
  return out;
10213
10226
  }
@@ -10274,7 +10287,7 @@ function paintDrawable(painter, node, dctx) {
10274
10287
  break;
10275
10288
  case "draw-fx-layer": {
10276
10289
  const epochNow = dctx.time > 0 && typeof performance !== "undefined" ? performance.timeOrigin + dctx.time : 0;
10277
- for (const child of expandFxLayer(node, epochNow, "2d")) paintDrawable(painter, child, dctx);
10290
+ for (const child of expandFxLayer(node, epochNow, "2d", dctx.projector)) paintDrawable(painter, child, dctx);
10278
10291
  break;
10279
10292
  }
10280
10293
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@almadar/ui",
3
- "version": "6.2.0",
3
+ "version": "6.3.0",
4
4
  "description": "React UI components, hooks, and providers for Almadar",
5
5
  "type": "module",
6
6
  "sideEffects": [
@@ -118,11 +118,11 @@
118
118
  "access": "public"
119
119
  },
120
120
  "dependencies": {
121
- "@almadar/core": "^10.79.0",
122
- "@almadar/evaluator": "^2.43.0",
121
+ "@almadar/core": "^10.80.0",
122
+ "@almadar/evaluator": "^2.44.0",
123
123
  "@almadar/logger": "^1.12.0",
124
124
  "@almadar/runtime": "^6.69.0",
125
- "@almadar/std": "^16.199.0",
125
+ "@almadar/std": "^16.200.0",
126
126
  "@almadar/syntax": "^1.16.0",
127
127
  "@dnd-kit/core": "^6.3.1",
128
128
  "@dnd-kit/sortable": "^10.0.0",