@effindomv2/fui-as 0.2.3 → 0.2.4-alpha1

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@effindomv2/fui-as",
3
- "version": "0.2.3",
3
+ "version": "0.2.4-alpha1",
4
4
  "private": false,
5
5
  "license": "AGPL-3.0-only OR LicenseRef-EffinDom-Commercial",
6
6
  "description": "EffinDom v2 AssemblyScript frontend framework SDK and browser harness",
@@ -106,7 +106,7 @@
106
106
  "typecheck": "npm run guard:runtime-dependency && npm run check:abi && tsc -p tsconfig.json --noEmit"
107
107
  },
108
108
  "dependencies": {
109
- "@effindomv2/runtime": "0.2.11"
109
+ "@effindomv2/runtime": "0.2.12"
110
110
  },
111
111
  "devDependencies": {
112
112
  "@as-pect/assembly": "9.0.0",
@@ -116,7 +116,7 @@
116
116
  "@types/node": "^24.10.1",
117
117
  "assemblyscript": "0.28.19",
118
118
  "@devcycle/assemblyscript-json": "2.0.0",
119
- "esbuild": "^0.27.7",
119
+ "esbuild": "^0.28.1",
120
120
  "typescript": "^5.9.3"
121
121
  }
122
122
  }
@@ -8,7 +8,7 @@ const packagePath = join(packageDirectory, 'package.json');
8
8
  const npm = process.platform === 'win32' ? 'npm.cmd' : 'npm';
9
9
  const versionPattern = /^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/;
10
10
 
11
- const runtimeVersion = execFileSync(
11
+ const runtimeVersion = process.env.EFFINDOM_RUNTIME_VERSION ?? execFileSync(
12
12
  npm,
13
13
  ['view', '@effindomv2/runtime', 'dist-tags.latest'],
14
14
  { encoding: 'utf8' },
@@ -15,6 +15,12 @@ function clamp(value: f32, min: f32, max: f32): f32 {
15
15
  return value;
16
16
  }
17
17
 
18
+ const PROGRESS_BORDER_WIDTH: f32 = 1.0;
19
+
20
+ function insetRadius(radius: f32): f32 {
21
+ return radius > PROGRESS_BORDER_WIDTH ? radius - PROGRESS_BORDER_WIDTH : 0.0;
22
+ }
23
+
18
24
  export class ProgressBar extends FlexBox {
19
25
  private readonly fillNode: FlexBox;
20
26
  private readonly disposables: Array<Disposable> = new Array<Disposable>();
@@ -118,7 +124,7 @@ export class ProgressBar extends FlexBox {
118
124
  cornerRadius(radius: f32): this {
119
125
  this.cornerRadiusOverridden = true;
120
126
  super.cornerRadius(radius);
121
- this.fillNode.cornerRadius(radius);
127
+ this.fillNode.cornerRadius(insetRadius(radius));
122
128
  return this;
123
129
  }
124
130
 
@@ -139,13 +145,16 @@ export class ProgressBar extends FlexBox {
139
145
  private syncGeometry(): void {
140
146
  const range = this.maxValue - this.minValue;
141
147
  const fraction = range > 0.0 ? clamp((this.currentValue - this.minValue) / range, 0.0, 1.0) : 0.0;
142
- const fillLength = this.lengthValue * fraction;
148
+ const inset = PROGRESS_BORDER_WIDTH * 2.0;
149
+ const innerLength = this.lengthValue > inset ? this.lengthValue - inset : 0.0;
150
+ const innerThickness = this.thicknessValue > inset ? this.thicknessValue - inset : 0.0;
151
+ const fillLength = innerLength * fraction;
143
152
  if (this.orientationValue == Orientation.Vertical) {
144
153
  this.flexDirection(FlexDirection.Column);
145
154
  this.justifyContent(JustifyContent.End);
146
155
  this.width(this.thicknessValue);
147
156
  this.height(this.lengthValue);
148
- this.fillNode.width(this.thicknessValue);
157
+ this.fillNode.width(innerThickness);
149
158
  this.fillNode.height(fillLength);
150
159
  } else {
151
160
  this.flexDirection(FlexDirection.Row);
@@ -153,7 +162,7 @@ export class ProgressBar extends FlexBox {
153
162
  this.width(this.lengthValue);
154
163
  this.height(this.thicknessValue);
155
164
  this.fillNode.width(fillLength);
156
- this.fillNode.height(this.thicknessValue);
165
+ this.fillNode.height(innerThickness);
157
166
  }
158
167
  this.semanticValueRange(this.currentValue, this.minValue, this.maxValue);
159
168
  this.syncSemanticLabel();
@@ -173,10 +182,10 @@ export class ProgressBar extends FlexBox {
173
182
  const fillColor = this.fillColorOverridden ? this.fillColorValue : theme.colors.accent;
174
183
  if (!this.cornerRadiusOverridden) {
175
184
  super.cornerRadius(this.thicknessValue * 0.5);
176
- this.fillNode.cornerRadius(this.thicknessValue * 0.5);
185
+ this.fillNode.cornerRadius(insetRadius(this.thicknessValue * 0.5));
177
186
  }
178
187
  super.bgColor(trackColor);
179
- super.border(1.0, theme.colors.border);
188
+ super.border(PROGRESS_BORDER_WIDTH, theme.colors.border);
180
189
  this.fillNode.bgColor(fillColor);
181
190
  }
182
191
 
@@ -117,6 +117,7 @@ class DefaultSliderPresenter extends SliderPresenter {
117
117
  const crossAxisInset = crossAxisExtra * 0.5;
118
118
  const trackOffset = crossAxisInset + ((thumbSize - trackThickness) * 0.5);
119
119
  if (state.orientation == Orientation.Vertical) {
120
+ const fillLength = Mathf.round(available * fraction);
120
121
  this.root
121
122
  .width(thumbSize + crossAxisExtra, Unit.Pixel)
122
123
  .height(length, Unit.Pixel);
@@ -129,10 +130,10 @@ class DefaultSliderPresenter extends SliderPresenter {
129
130
  );
130
131
  this.fillNode
131
132
  .width(trackThickness, Unit.Pixel)
132
- .height(available * fraction, Unit.Pixel)
133
+ .height(fillLength, Unit.Pixel)
133
134
  .position(
134
135
  trackOffset,
135
- thumbSize * 0.5 + (available * (1.0 - fraction)),
136
+ thumbSize * 0.5 + available - fillLength,
136
137
  );
137
138
  this.thumbNode.position(
138
139
  crossAxisInset,