@effindomv2/fui-as 0.1.32 → 0.1.34
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 +2 -2
- package/scripts/build-demo-as.sh +4 -0
- package/scripts/build.sh +14 -8
- package/src/nodes/ScrollBox.ts +18 -28
- package/src/nodes/ScrollView.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effindomv2/fui-as",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.34",
|
|
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",
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"dependencies": {
|
|
88
88
|
"@assemblyscript/loader": "^0.28.17",
|
|
89
89
|
"@devcycle/assemblyscript-json": "^2.0.0",
|
|
90
|
-
"@effindomv2/runtime": "0.1.
|
|
90
|
+
"@effindomv2/runtime": "0.1.17"
|
|
91
91
|
},
|
|
92
92
|
"devDependencies": {
|
|
93
93
|
"@as-pect/assembly": "8.1.0",
|
package/scripts/build-demo-as.sh
CHANGED
|
@@ -82,6 +82,7 @@ case "${BUILD_TARGET}" in
|
|
|
82
82
|
build_demo_app "demo/src/routes/demo_home.ts" "${DEMO_OUT_DIR}/home.wasm"
|
|
83
83
|
build_demo_app "demo/src/routes/demo_advanced_controls.ts" "${DEMO_OUT_DIR}/advanced-controls.wasm"
|
|
84
84
|
build_demo_app "demo/src/routes/templated-controls.ts" "${DEMO_OUT_DIR}/templated-controls.wasm"
|
|
85
|
+
build_demo_app "demo/src/routes/demo_scrollbar_gutter.ts" "${DEMO_OUT_DIR}/scrollbar-gutter.wasm"
|
|
85
86
|
;;
|
|
86
87
|
dashboard)
|
|
87
88
|
build_demo_app "demo/src/dashboard.ts" "${DEMO_OUT_DIR}/demo.wasm"
|
|
@@ -95,6 +96,9 @@ case "${BUILD_TARGET}" in
|
|
|
95
96
|
templated-controls|templated)
|
|
96
97
|
build_demo_app "demo/src/routes/templated-controls.ts" "${DEMO_OUT_DIR}/templated-controls.wasm"
|
|
97
98
|
;;
|
|
99
|
+
scrollbar-gutter)
|
|
100
|
+
build_demo_app "demo/src/routes/demo_scrollbar_gutter.ts" "${DEMO_OUT_DIR}/scrollbar-gutter.wasm"
|
|
101
|
+
;;
|
|
98
102
|
*)
|
|
99
103
|
echo "Unknown build target: ${BUILD_TARGET}" >&2
|
|
100
104
|
echo "Usage: bash scripts/build-demo-as.sh [all|dashboard|home|advanced-controls|templated-controls]" >&2
|
package/scripts/build.sh
CHANGED
|
@@ -223,7 +223,8 @@ build_workers() {
|
|
|
223
223
|
}
|
|
224
224
|
|
|
225
225
|
write_worker_manifest() {
|
|
226
|
-
|
|
226
|
+
local tmp_entries
|
|
227
|
+
tmp_entries="$(mktemp)"
|
|
227
228
|
local worker_entry=""
|
|
228
229
|
while IFS= read -r worker_entry; do
|
|
229
230
|
[ -n "${worker_entry}" ] || continue
|
|
@@ -232,28 +233,30 @@ write_worker_manifest() {
|
|
|
232
233
|
local export_name=""
|
|
233
234
|
while IFS= read -r export_name; do
|
|
234
235
|
[ -n "${export_name}" ] || continue
|
|
235
|
-
if
|
|
236
|
+
if grep -q "^${export_name} " "${tmp_entries}" 2>/dev/null; then
|
|
236
237
|
echo "Duplicate worker export name: ${export_name}" >&2
|
|
238
|
+
rm -f "${tmp_entries}"
|
|
237
239
|
exit 1
|
|
238
240
|
fi
|
|
239
|
-
|
|
241
|
+
echo "${export_name} ./workers/${worker_name}.wasm" >> "${tmp_entries}"
|
|
240
242
|
done < <(rg 'export function ([A-Za-z_][A-Za-z0-9_]*)\s*\(' "${worker_entry}" -or '$1')
|
|
241
243
|
done < <(find_worker_entries)
|
|
242
244
|
|
|
243
245
|
{
|
|
244
246
|
printf '{\n "version": 1,\n "entries": {\n'
|
|
245
247
|
local first=1
|
|
246
|
-
local
|
|
247
|
-
while IFS= read -r entry_name; do
|
|
248
|
+
local line=""
|
|
249
|
+
sort "${tmp_entries}" | while IFS=' ' read -r entry_name entry_path; do
|
|
248
250
|
[ -n "${entry_name}" ] || continue
|
|
249
251
|
if [ "${first}" -eq 0 ]; then
|
|
250
252
|
printf ',\n'
|
|
251
253
|
fi
|
|
252
254
|
first=0
|
|
253
|
-
printf ' "%s": "%s"' "${entry_name}" "${
|
|
254
|
-
done
|
|
255
|
+
printf ' "%s": "%s"' "${entry_name}" "${entry_path}"
|
|
256
|
+
done
|
|
255
257
|
printf '\n }\n}\n'
|
|
256
258
|
} > "${WORKER_MANIFEST_BUILD}"
|
|
259
|
+
rm -f "${tmp_entries}"
|
|
257
260
|
}
|
|
258
261
|
|
|
259
262
|
copy_worker_assets() {
|
|
@@ -283,6 +286,7 @@ build_app "demo/src/dashboard.ts" "${DEMO_OUT_DIR}/demo.wasm"
|
|
|
283
286
|
build_app "demo/src/routes/demo_home.ts" "${DEMO_OUT_DIR}/home.wasm"
|
|
284
287
|
build_app "demo/src/routes/demo_advanced_controls.ts" "${DEMO_OUT_DIR}/advanced-controls.wasm"
|
|
285
288
|
build_app "demo/src/routes/templated-controls.ts" "${DEMO_OUT_DIR}/templated-controls.wasm"
|
|
289
|
+
build_app "demo/src/routes/demo_scrollbar_gutter.ts" "${DEMO_OUT_DIR}/scrollbar-gutter.wasm"
|
|
286
290
|
build_workers
|
|
287
291
|
write_worker_manifest
|
|
288
292
|
|
|
@@ -342,9 +346,10 @@ cp "${PACKAGE_DIR}/browser/favicon.ico" "${REPO_ROOT}/public/favicon.ico"
|
|
|
342
346
|
cp "${PACKAGE_DIR}/demo/demo-texture.png" "${DEMO_OUT_DIR}/demo-texture.png"
|
|
343
347
|
cp "${PACKAGE_DIR}/demo/demo-secondary-texture.png" "${DEMO_OUT_DIR}/demo-secondary-texture.png"
|
|
344
348
|
|
|
345
|
-
mkdir -p "${DEMO_OUT_DIR}/advanced-controls" "${DEMO_OUT_DIR}/templated-controls"
|
|
349
|
+
mkdir -p "${DEMO_OUT_DIR}/advanced-controls" "${DEMO_OUT_DIR}/templated-controls" "${DEMO_OUT_DIR}/scrollbar-gutter"
|
|
346
350
|
render_html_with_loading_overlay "${PACKAGE_DIR}/demo/route-shell.html" "${DEMO_OUT_DIR}/advanced-controls/index.html"
|
|
347
351
|
render_html_with_loading_overlay "${PACKAGE_DIR}/demo/route-shell.html" "${DEMO_OUT_DIR}/templated-controls/index.html"
|
|
352
|
+
render_html_with_loading_overlay "${PACKAGE_DIR}/demo/route-shell.html" "${DEMO_OUT_DIR}/scrollbar-gutter/index.html"
|
|
348
353
|
|
|
349
354
|
copy_runtime_assets "${OUT_DIR}"
|
|
350
355
|
copy_runtime_assets "${DEMO_OUT_DIR}"
|
|
@@ -354,3 +359,4 @@ write_runtime_config "${OUT_DIR}" "${DEFAULT_MANIFEST_PATH}"
|
|
|
354
359
|
write_runtime_config "${DEMO_OUT_DIR}" "${DEFAULT_MANIFEST_PATH}"
|
|
355
360
|
write_runtime_config "${DEMO_OUT_DIR}/advanced-controls" "../runtime/dist/effindom.v2.manifest.json"
|
|
356
361
|
write_runtime_config "${DEMO_OUT_DIR}/templated-controls" "../runtime/dist/effindom.v2.manifest.json"
|
|
362
|
+
write_runtime_config "${DEMO_OUT_DIR}/scrollbar-gutter" "../runtime/dist/effindom.v2.manifest.json"
|
package/src/nodes/ScrollBox.ts
CHANGED
|
@@ -17,7 +17,7 @@ import { ScrollState } from "./ScrollState";
|
|
|
17
17
|
import { ScrollView } from "./ScrollView";
|
|
18
18
|
import { NodeTransitions } from "../core/Transitions";
|
|
19
19
|
|
|
20
|
-
const DEFAULT_SCROLLBAR_GUTTER: f32 =
|
|
20
|
+
const DEFAULT_SCROLLBAR_GUTTER: f32 = 0.0;
|
|
21
21
|
const OVERFLOW_TOLERANCE: f32 = 0.5;
|
|
22
22
|
|
|
23
23
|
function noopPointerCallback(_x: f32, _y: f32): void {}
|
|
@@ -294,45 +294,35 @@ export class ScrollBox extends FlexBox {
|
|
|
294
294
|
private refreshChrome(): void {
|
|
295
295
|
const verticalRailThickness = this.scrollbarGutterValue + this.verticalScrollBarValue.thickness;
|
|
296
296
|
const horizontalRailThickness = this.horizontalScrollBarValue.thickness;
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
this.horizontalScrollEnabledValue,
|
|
313
|
-
this.scrollStateValue.contentWidth.value,
|
|
314
|
-
availableWidth,
|
|
315
|
-
);
|
|
316
|
-
if (nextVertical == showVertical && nextHorizontal == showHorizontal) {
|
|
317
|
-
break;
|
|
318
|
-
}
|
|
319
|
-
showVertical = nextVertical;
|
|
320
|
-
showHorizontal = nextHorizontal;
|
|
321
|
-
}
|
|
297
|
+
// Use raw viewport dimensions — Yoga already accounts for applied rails.
|
|
298
|
+
// The decision is independent of the other axis since available space
|
|
299
|
+
// doesn't change with rail state, so no loop is needed.
|
|
300
|
+
const showVertical = this.shouldShow(
|
|
301
|
+
this.verticalVisibilityValue,
|
|
302
|
+
this.verticalScrollEnabledValue,
|
|
303
|
+
this.scrollStateValue.contentHeight.value,
|
|
304
|
+
this.scrollStateValue.viewportHeight.value,
|
|
305
|
+
);
|
|
306
|
+
const showHorizontal = this.shouldShow(
|
|
307
|
+
this.horizontalVisibilityValue,
|
|
308
|
+
this.horizontalScrollEnabledValue,
|
|
309
|
+
this.scrollStateValue.contentWidth.value,
|
|
310
|
+
this.scrollStateValue.viewportWidth.value,
|
|
311
|
+
);
|
|
322
312
|
this.verticalChromeVisibleValue = showVertical;
|
|
323
313
|
this.horizontalChromeVisibleValue = showHorizontal;
|
|
324
314
|
this.verticalScrollBarValue.chromeVisible(showVertical);
|
|
325
315
|
this.horizontalScrollBarValue.chromeVisible(showHorizontal);
|
|
326
|
-
const verticalRailWidth = showVertical ? verticalRailThickness : 0.0;
|
|
327
|
-
const horizontalRailHeight = showHorizontal ? horizontalRailThickness : 0.0;
|
|
328
316
|
|
|
329
317
|
this.verticalGutterValue.width(showVertical ? this.scrollbarGutterValue : 0.0, Unit.Pixel);
|
|
330
318
|
this.verticalScrollBarValue.render().width(
|
|
331
319
|
showVertical ? this.verticalScrollBarValue.thickness : 0.0,
|
|
332
320
|
Unit.Pixel,
|
|
333
321
|
);
|
|
322
|
+
const horizontalRailHeight = showHorizontal ? horizontalRailThickness : 0.0;
|
|
334
323
|
this.bottomRowValue.height(horizontalRailHeight, Unit.Pixel);
|
|
335
324
|
this.horizontalScrollBarValue.render().height(showHorizontal ? this.horizontalScrollBarValue.thickness : 0.0, Unit.Pixel);
|
|
325
|
+
const verticalRailWidth = showVertical ? verticalRailThickness : 0.0;
|
|
336
326
|
this.cornerValue.width(showVertical ? verticalRailWidth : 0.0, Unit.Pixel);
|
|
337
327
|
this.cornerValue.height(showHorizontal ? horizontalRailHeight : 0.0, Unit.Pixel);
|
|
338
328
|
}
|
package/src/nodes/ScrollView.ts
CHANGED
|
@@ -505,6 +505,7 @@ export class ScrollView extends Node {
|
|
|
505
505
|
this._scrollState.contentHeight.value = contentHeight;
|
|
506
506
|
this._scrollState.viewportWidth.value = viewportWidth;
|
|
507
507
|
this._scrollState.viewportHeight.value = viewportHeight;
|
|
508
|
+
|
|
508
509
|
}
|
|
509
510
|
|
|
510
511
|
private updateRetainedScrollOffset(x: f32, y: f32): void {
|