@almadar/ui 6.1.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.
@@ -3733,9 +3733,16 @@ var init_Input = __esm({
3733
3733
  }
3734
3734
  };
3735
3735
  const handleKeyDown = (e) => {
3736
- if (action && e.key === "Enter") {
3737
- eventBus.emit(`UI:${action}`, { value: e.currentTarget.value });
3736
+ if (!action || e.key !== "Enter") return;
3737
+ const raw = e.currentTarget.value;
3738
+ if (type === "number") {
3739
+ if (raw.trim() === "") return;
3740
+ const numeric = Number(raw);
3741
+ if (Number.isNaN(numeric)) return;
3742
+ eventBus.emit(`UI:${action}`, { value: numeric });
3743
+ return;
3738
3744
  }
3745
+ eventBus.emit(`UI:${action}`, { value: raw });
3739
3746
  };
3740
3747
  const wrapField = (field, fullWidth = true) => /* @__PURE__ */ jsxs("div", { className: fullWidth ? "w-full" : "w-fit", children: [
3741
3748
  label && /* @__PURE__ */ jsx("label", { className: "block text-sm font-medium text-foreground mb-1", children: label }),
@@ -3918,6 +3925,7 @@ function NativeSelect({
3918
3925
  error,
3919
3926
  onChange,
3920
3927
  onValueChange,
3928
+ action,
3921
3929
  value,
3922
3930
  ...props
3923
3931
  }) {
@@ -3929,6 +3937,9 @@ function NativeSelect({
3929
3937
  onChange?.(e);
3930
3938
  }
3931
3939
  dispatchValueChange(onValueChange, eventBus, e.target.value);
3940
+ if (action) {
3941
+ eventBus.emit(`UI:${action}`, { value: e.target.value });
3942
+ }
3932
3943
  };
3933
3944
  return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
3934
3945
  /* @__PURE__ */ jsxs(
@@ -3964,6 +3975,7 @@ function RichSelect({
3964
3975
  error,
3965
3976
  onChange,
3966
3977
  onValueChange,
3978
+ action,
3967
3979
  value,
3968
3980
  multiple,
3969
3981
  searchable,
@@ -3989,6 +4001,9 @@ function RichSelect({
3989
4001
  eventBus.emit(`UI:${onChange}`, { value: next });
3990
4002
  }
3991
4003
  dispatchValueChange(onValueChange, eventBus, next);
4004
+ if (action) {
4005
+ eventBus.emit(`UI:${action}`, { value: next });
4006
+ }
3992
4007
  };
3993
4008
  const clear = (e) => {
3994
4009
  e.stopPropagation();
@@ -3997,6 +4012,9 @@ function RichSelect({
3997
4012
  eventBus.emit(`UI:${onChange}`, { value: next });
3998
4013
  }
3999
4014
  dispatchValueChange(onValueChange, eventBus, next);
4015
+ if (action) {
4016
+ eventBus.emit(`UI:${action}`, { value: next });
4017
+ }
4000
4018
  };
4001
4019
  useEffect(() => {
4002
4020
  const handler = (e) => {
@@ -10147,7 +10165,7 @@ function proceduralShapes(view, pos, fade, progress) {
10147
10165
  }
10148
10166
  }
10149
10167
  }
10150
- function expandFxItem(view, node, epochNowMs, dim) {
10168
+ function expandFxItem(view, node, epochNowMs, dim, projector) {
10151
10169
  if (view.space === "screen") return [];
10152
10170
  const tickMs = node.tickMs ?? DEFAULT_TICK_MS;
10153
10171
  const { ageMs, progress, fade } = fxLifecycle(view, epochNowMs, tickMs);
@@ -10183,24 +10201,26 @@ function expandFxItem(view, node, epochNowMs, dim) {
10183
10201
  out.push(...proceduralShapes(view, pos, fade, progress));
10184
10202
  }
10185
10203
  if (view.message) {
10204
+ const pxSize = projector && view.size !== void 0 ? Math.max(10, Math.round(view.size * projector.tileWidth)) : void 0;
10186
10205
  const text = {
10187
10206
  type: "draw-text",
10188
10207
  text: view.message,
10189
10208
  position: pos,
10190
10209
  offsetY: -(0.15 + 0.55 * progress),
10191
10210
  color: view.color ?? node.textColor ?? DEFAULT_TEXT_COLOR,
10192
- opacity: fade
10211
+ opacity: fade,
10212
+ ...pxSize ? { font: `bold ${pxSize}px system-ui, sans-serif` } : {}
10193
10213
  };
10194
10214
  out.push(text);
10195
10215
  }
10196
10216
  return out;
10197
10217
  }
10198
- function expandFxLayer(node, epochNowMs, dim) {
10218
+ function expandFxLayer(node, epochNowMs, dim, projector) {
10199
10219
  if (!Array.isArray(node.items)) return [];
10200
10220
  const out = [];
10201
10221
  for (const item of node.items) {
10202
10222
  if (!item || typeof item.id !== "string") continue;
10203
- out.push(...expandFxItem(resolveFxView(item, node.presets), node, epochNowMs, dim));
10223
+ out.push(...expandFxItem(resolveFxView(item, node.presets), node, epochNowMs, dim, projector));
10204
10224
  }
10205
10225
  return out;
10206
10226
  }
@@ -10267,7 +10287,7 @@ function paintDrawable(painter, node, dctx) {
10267
10287
  break;
10268
10288
  case "draw-fx-layer": {
10269
10289
  const epochNow = dctx.time > 0 && typeof performance !== "undefined" ? performance.timeOrigin + dctx.time : 0;
10270
- 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);
10271
10291
  break;
10272
10292
  }
10273
10293
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@almadar/ui",
3
- "version": "6.1.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.78.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
- "@almadar/runtime": "^6.68.0",
125
- "@almadar/std": "^16.198.0",
124
+ "@almadar/runtime": "^6.69.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",