@awacloud/fw 0.1.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.
- package/CHANGELOG.md +79 -0
- package/LICENSE +176 -0
- package/NOTICE +12 -0
- package/README.md +355 -0
- package/dist/build/fw.core.pure.meta.json +29 -0
- package/dist/build/fw.core.pure.min.js +26 -0
- package/dist/build/fw.full.pure.meta.json +224 -0
- package/dist/build/fw.full.pure.min.js +60 -0
- package/dist/build/fw.minimal.pure.meta.json +21 -0
- package/dist/build/fw.minimal.pure.min.js +26 -0
- package/dist/build/fw.pack.compress-heavy.pure.meta.json +29 -0
- package/dist/build/fw.pack.compress-heavy.pure.min.js +8 -0
- package/dist/build/fw.pack.crypto-advanced.pure.meta.json +38 -0
- package/dist/build/fw.pack.crypto-advanced.pure.min.js +6 -0
- package/dist/build/fw.pack.crypto-basic.pure.meta.json +29 -0
- package/dist/build/fw.pack.crypto-basic.pure.min.js +6 -0
- package/dist/build/fw.pack.crypto-identity.pure.meta.json +29 -0
- package/dist/build/fw.pack.crypto-identity.pure.min.js +9 -0
- package/dist/build/fw.pack.realtime.pure.meta.json +21 -0
- package/dist/build/fw.pack.realtime.pure.min.js +6 -0
- package/dist/build/fw.pack.sensors.pure.meta.json +21 -0
- package/dist/build/fw.pack.sensors.pure.min.js +6 -0
- package/dist/build/fw.pack.structures-advanced.pure.meta.json +20 -0
- package/dist/build/fw.pack.structures-advanced.pure.min.js +6 -0
- package/dist/build/fw.pack.text-advanced.pure.meta.json +20 -0
- package/dist/build/fw.pack.text-advanced.pure.min.js +6 -0
- package/dist/build/fw.pwa.pure.meta.json +127 -0
- package/dist/build/fw.pwa.pure.min.js +55 -0
- package/dist/build/fw.site-interactive.pure.meta.json +81 -0
- package/dist/build/fw.site-interactive.pure.min.js +52 -0
- package/dist/build/fw.site.pure.meta.json +51 -0
- package/dist/build/fw.site.pure.min.js +35 -0
- package/dist/build/fw.spa.pure.meta.json +108 -0
- package/dist/build/fw.spa.pure.min.js +55 -0
- package/dist/build/io/compress/brotli_dict.bin +432 -0
- package/dist/build/sanity-base-classic.min.js +6 -0
- package/dist/build/sanity-community-classic.min.js +6 -0
- package/dist/build/sanity.min.js +6 -0
- package/dist/types/core/logger.d.ts +71 -0
- package/dist/types/core/logger.d.ts.map +1 -0
- package/dist/types/core/modules.d.ts +3962 -0
- package/dist/types/core/modules.d.ts.map +1 -0
- package/dist/types/core/readyState.d.ts +14 -0
- package/dist/types/core/readyState.d.ts.map +1 -0
- package/dist/types/core/runtime.d.ts +625 -0
- package/dist/types/core/runtime.d.ts.map +1 -0
- package/dist/types/core/worker-helper.d.ts +153 -0
- package/dist/types/core/worker-helper.d.ts.map +1 -0
- package/dist/types/crypto/cipher/aes.d.ts +55 -0
- package/dist/types/crypto/cipher/aes.d.ts.map +1 -0
- package/dist/types/crypto/cipher/chacha20.d.ts +33 -0
- package/dist/types/crypto/cipher/chacha20.d.ts.map +1 -0
- package/dist/types/crypto/hash/adf.d.ts +65 -0
- package/dist/types/crypto/hash/adf.d.ts.map +1 -0
- package/dist/types/crypto/hash/argon2.d.ts +79 -0
- package/dist/types/crypto/hash/argon2.d.ts.map +1 -0
- package/dist/types/crypto/hash/blake2b.d.ts +40 -0
- package/dist/types/crypto/hash/blake2b.d.ts.map +1 -0
- package/dist/types/crypto/hash/hkdf.d.ts +88 -0
- package/dist/types/crypto/hash/hkdf.d.ts.map +1 -0
- package/dist/types/crypto/hash/hmac.d.ts +85 -0
- package/dist/types/crypto/hash/hmac.d.ts.map +1 -0
- package/dist/types/crypto/hash/pbkdf2.d.ts +80 -0
- package/dist/types/crypto/hash/pbkdf2.d.ts.map +1 -0
- package/dist/types/crypto/hash/poly1305.d.ts +31 -0
- package/dist/types/crypto/hash/poly1305.d.ts.map +1 -0
- package/dist/types/crypto/hash/sha224.d.ts +80 -0
- package/dist/types/crypto/hash/sha224.d.ts.map +1 -0
- package/dist/types/crypto/hash/sha256.d.ts +82 -0
- package/dist/types/crypto/hash/sha256.d.ts.map +1 -0
- package/dist/types/crypto/hash/sha3.d.ts +111 -0
- package/dist/types/crypto/hash/sha3.d.ts.map +1 -0
- package/dist/types/crypto/hash/sha384.d.ts +84 -0
- package/dist/types/crypto/hash/sha384.d.ts.map +1 -0
- package/dist/types/crypto/hash/sha512.d.ts +87 -0
- package/dist/types/crypto/hash/sha512.d.ts.map +1 -0
- package/dist/types/crypto/hash/sha512_224.d.ts +84 -0
- package/dist/types/crypto/hash/sha512_224.d.ts.map +1 -0
- package/dist/types/crypto/hash/sha512_256.d.ts +84 -0
- package/dist/types/crypto/hash/sha512_256.d.ts.map +1 -0
- package/dist/types/crypto/mode/cbc.d.ts +38 -0
- package/dist/types/crypto/mode/cbc.d.ts.map +1 -0
- package/dist/types/crypto/mode/chacha20poly1305.d.ts +71 -0
- package/dist/types/crypto/mode/chacha20poly1305.d.ts.map +1 -0
- package/dist/types/crypto/mode/cmac.d.ts +56 -0
- package/dist/types/crypto/mode/cmac.d.ts.map +1 -0
- package/dist/types/crypto/mode/ctr.d.ts +52 -0
- package/dist/types/crypto/mode/ctr.d.ts.map +1 -0
- package/dist/types/crypto/mode/gcm.d.ts +88 -0
- package/dist/types/crypto/mode/gcm.d.ts.map +1 -0
- package/dist/types/crypto/mode/kw.d.ts +60 -0
- package/dist/types/crypto/mode/kw.d.ts.map +1 -0
- package/dist/types/crypto/pkc/ecc.d.ts +284 -0
- package/dist/types/crypto/pkc/ecc.d.ts.map +1 -0
- package/dist/types/crypto/pkc/ed25519.d.ts +107 -0
- package/dist/types/crypto/pkc/ed25519.d.ts.map +1 -0
- package/dist/types/crypto/pkc/hybridKem.d.ts +154 -0
- package/dist/types/crypto/pkc/hybridKem.d.ts.map +1 -0
- package/dist/types/crypto/pkc/hybridSign.d.ts +383 -0
- package/dist/types/crypto/pkc/hybridSign.d.ts.map +1 -0
- package/dist/types/crypto/pkc/ml_dsa.d.ts +174 -0
- package/dist/types/crypto/pkc/ml_dsa.d.ts.map +1 -0
- package/dist/types/crypto/pkc/ml_kem.d.ts +194 -0
- package/dist/types/crypto/pkc/ml_kem.d.ts.map +1 -0
- package/dist/types/crypto/pkc/rsa.d.ts +175 -0
- package/dist/types/crypto/pkc/rsa.d.ts.map +1 -0
- package/dist/types/crypto/pkc/slh_dsa.d.ts +232 -0
- package/dist/types/crypto/pkc/slh_dsa.d.ts.map +1 -0
- package/dist/types/crypto/pkc/x25519.d.ts +37 -0
- package/dist/types/crypto/pkc/x25519.d.ts.map +1 -0
- package/dist/types/crypto/utils/aes_ctr.d.ts +84 -0
- package/dist/types/crypto/utils/aes_ctr.d.ts.map +1 -0
- package/dist/types/crypto/utils/aes_modes.d.ts +128 -0
- package/dist/types/crypto/utils/aes_modes.d.ts.map +1 -0
- package/dist/types/crypto/utils/asn1-oid.d.ts +45 -0
- package/dist/types/crypto/utils/asn1-oid.d.ts.map +1 -0
- package/dist/types/crypto/utils/asn1.d.ts +115 -0
- package/dist/types/crypto/utils/asn1.d.ts.map +1 -0
- package/dist/types/crypto/utils/bitArray.d.ts +75 -0
- package/dist/types/crypto/utils/bitArray.d.ts.map +1 -0
- package/dist/types/crypto/utils/bn.d.ts +214 -0
- package/dist/types/crypto/utils/bn.d.ts.map +1 -0
- package/dist/types/crypto/utils/jws.d.ts +159 -0
- package/dist/types/crypto/utils/jws.d.ts.map +1 -0
- package/dist/types/crypto/utils/keyformat.d.ts +100 -0
- package/dist/types/crypto/utils/keyformat.d.ts.map +1 -0
- package/dist/types/crypto/utils/pad.d.ts +44 -0
- package/dist/types/crypto/utils/pad.d.ts.map +1 -0
- package/dist/types/crypto/utils/pem.d.ts +41 -0
- package/dist/types/crypto/utils/pem.d.ts.map +1 -0
- package/dist/types/crypto/utils/random.d.ts +203 -0
- package/dist/types/crypto/utils/random.d.ts.map +1 -0
- package/dist/types/crypto/utils/rsaKeygen.d.ts +162 -0
- package/dist/types/crypto/utils/rsaKeygen.d.ts.map +1 -0
- package/dist/types/crypto/utils/totp.d.ts +183 -0
- package/dist/types/crypto/utils/totp.d.ts.map +1 -0
- package/dist/types/crypto/utils/uuid.d.ts +29 -0
- package/dist/types/crypto/utils/uuid.d.ts.map +1 -0
- package/dist/types/crypto/wasm/aes.d.ts +59 -0
- package/dist/types/crypto/wasm/aes.d.ts.map +1 -0
- package/dist/types/crypto/wasm/argon2.d.ts +70 -0
- package/dist/types/crypto/wasm/argon2.d.ts.map +1 -0
- package/dist/types/crypto/wasm/blake2b.d.ts +59 -0
- package/dist/types/crypto/wasm/blake2b.d.ts.map +1 -0
- package/dist/types/crypto/wasm/chacha20poly1305.d.ts +43 -0
- package/dist/types/crypto/wasm/chacha20poly1305.d.ts.map +1 -0
- package/dist/types/crypto/wasm/cmac.d.ts +42 -0
- package/dist/types/crypto/wasm/cmac.d.ts.map +1 -0
- package/dist/types/crypto/wasm/ecc.d.ts +56 -0
- package/dist/types/crypto/wasm/ecc.d.ts.map +1 -0
- package/dist/types/crypto/wasm/ed25519.d.ts +52 -0
- package/dist/types/crypto/wasm/ed25519.d.ts.map +1 -0
- package/dist/types/crypto/wasm/hkdf.d.ts +40 -0
- package/dist/types/crypto/wasm/hkdf.d.ts.map +1 -0
- package/dist/types/crypto/wasm/hmac.d.ts +42 -0
- package/dist/types/crypto/wasm/hmac.d.ts.map +1 -0
- package/dist/types/crypto/wasm/ml_dsa.d.ts +48 -0
- package/dist/types/crypto/wasm/ml_dsa.d.ts.map +1 -0
- package/dist/types/crypto/wasm/ml_kem.d.ts +58 -0
- package/dist/types/crypto/wasm/ml_kem.d.ts.map +1 -0
- package/dist/types/crypto/wasm/pbkdf2.d.ts +38 -0
- package/dist/types/crypto/wasm/pbkdf2.d.ts.map +1 -0
- package/dist/types/crypto/wasm/rsa.d.ts +56 -0
- package/dist/types/crypto/wasm/rsa.d.ts.map +1 -0
- package/dist/types/crypto/wasm/runtime.d.ts +99 -0
- package/dist/types/crypto/wasm/runtime.d.ts.map +1 -0
- package/dist/types/crypto/wasm/sha2.d.ts +45 -0
- package/dist/types/crypto/wasm/sha2.d.ts.map +1 -0
- package/dist/types/crypto/wasm/sha3.d.ts +57 -0
- package/dist/types/crypto/wasm/sha3.d.ts.map +1 -0
- package/dist/types/crypto/wasm/slh_dsa.d.ts +62 -0
- package/dist/types/crypto/wasm/slh_dsa.d.ts.map +1 -0
- package/dist/types/crypto/wasm/x25519.d.ts +53 -0
- package/dist/types/crypto/wasm/x25519.d.ts.map +1 -0
- package/dist/types/crypto/webcrypto/aes.d.ts +59 -0
- package/dist/types/crypto/webcrypto/aes.d.ts.map +1 -0
- package/dist/types/crypto/webcrypto/aeskw.d.ts +40 -0
- package/dist/types/crypto/webcrypto/aeskw.d.ts.map +1 -0
- package/dist/types/crypto/webcrypto/digest.d.ts +43 -0
- package/dist/types/crypto/webcrypto/digest.d.ts.map +1 -0
- package/dist/types/crypto/webcrypto/ecc.d.ts +51 -0
- package/dist/types/crypto/webcrypto/ecc.d.ts.map +1 -0
- package/dist/types/crypto/webcrypto/ed25519.d.ts +43 -0
- package/dist/types/crypto/webcrypto/ed25519.d.ts.map +1 -0
- package/dist/types/crypto/webcrypto/hkdf.d.ts +18 -0
- package/dist/types/crypto/webcrypto/hkdf.d.ts.map +1 -0
- package/dist/types/crypto/webcrypto/hmac.d.ts +43 -0
- package/dist/types/crypto/webcrypto/hmac.d.ts.map +1 -0
- package/dist/types/crypto/webcrypto/pbkdf2.d.ts +18 -0
- package/dist/types/crypto/webcrypto/pbkdf2.d.ts.map +1 -0
- package/dist/types/crypto/webcrypto/rsa.d.ts +51 -0
- package/dist/types/crypto/webcrypto/rsa.d.ts.map +1 -0
- package/dist/types/crypto/webcrypto/x25519.d.ts +43 -0
- package/dist/types/crypto/webcrypto/x25519.d.ts.map +1 -0
- package/dist/types/dom/display/animate.d.ts +35 -0
- package/dist/types/dom/display/animate.d.ts.map +1 -0
- package/dist/types/dom/display/fullscreen.d.ts +59 -0
- package/dist/types/dom/display/fullscreen.d.ts.map +1 -0
- package/dist/types/dom/fs/download.d.ts +36 -0
- package/dist/types/dom/fs/download.d.ts.map +1 -0
- package/dist/types/dom/fs/fsAccess.d.ts +107 -0
- package/dist/types/dom/fs/fsAccess.d.ts.map +1 -0
- package/dist/types/dom/fs/indexedDB.d.ts +62 -0
- package/dist/types/dom/fs/indexedDB.d.ts.map +1 -0
- package/dist/types/dom/fs/remoteStore.d.ts +64 -0
- package/dist/types/dom/fs/remoteStore.d.ts.map +1 -0
- package/dist/types/dom/fs/storage.d.ts +56 -0
- package/dist/types/dom/fs/storage.d.ts.map +1 -0
- package/dist/types/dom/lifecycle/idle.d.ts +91 -0
- package/dist/types/dom/lifecycle/idle.d.ts.map +1 -0
- package/dist/types/dom/lifecycle/visibility.d.ts +49 -0
- package/dist/types/dom/lifecycle/visibility.d.ts.map +1 -0
- package/dist/types/dom/lifecycle/wakeLock.d.ts +69 -0
- package/dist/types/dom/lifecycle/wakeLock.d.ts.map +1 -0
- package/dist/types/dom/net/ajax.d.ts +27 -0
- package/dist/types/dom/net/ajax.d.ts.map +1 -0
- package/dist/types/dom/net/broadcastChannel.d.ts +51 -0
- package/dist/types/dom/net/broadcastChannel.d.ts.map +1 -0
- package/dist/types/dom/net/network.d.ts +80 -0
- package/dist/types/dom/net/network.d.ts.map +1 -0
- package/dist/types/dom/net/sse.d.ts +72 -0
- package/dist/types/dom/net/sse.d.ts.map +1 -0
- package/dist/types/dom/net/webrtc.d.ts +149 -0
- package/dist/types/dom/net/webrtc.d.ts.map +1 -0
- package/dist/types/dom/net/ws.d.ts +70 -0
- package/dist/types/dom/net/ws.d.ts.map +1 -0
- package/dist/types/dom/query/dnd.d.ts +86 -0
- package/dist/types/dom/query/dnd.d.ts.map +1 -0
- package/dist/types/dom/query/dom.d.ts +194 -0
- package/dist/types/dom/query/dom.d.ts.map +1 -0
- package/dist/types/dom/query/events.d.ts +135 -0
- package/dist/types/dom/query/events.d.ts.map +1 -0
- package/dist/types/dom/query/gesture.d.ts +59 -0
- package/dist/types/dom/query/gesture.d.ts.map +1 -0
- package/dist/types/dom/query/media.d.ts +156 -0
- package/dist/types/dom/query/media.d.ts.map +1 -0
- package/dist/types/dom/rendering/chart.d.ts +143 -0
- package/dist/types/dom/rendering/chart.d.ts.map +1 -0
- package/dist/types/dom/rendering/component.d.ts +92 -0
- package/dist/types/dom/rendering/component.d.ts.map +1 -0
- package/dist/types/dom/rendering/devtools-ui.d.ts +83 -0
- package/dist/types/dom/rendering/devtools-ui.d.ts.map +1 -0
- package/dist/types/dom/rendering/devtools.d.ts +68 -0
- package/dist/types/dom/rendering/devtools.d.ts.map +1 -0
- package/dist/types/dom/rendering/parser.d.ts +216 -0
- package/dist/types/dom/rendering/parser.d.ts.map +1 -0
- package/dist/types/dom/rendering/reactiveBind.d.ts +101 -0
- package/dist/types/dom/rendering/reactiveBind.d.ts.map +1 -0
- package/dist/types/dom/rendering/render.d.ts +121 -0
- package/dist/types/dom/rendering/render.d.ts.map +1 -0
- package/dist/types/dom/rendering/sanitize.d.ts +48 -0
- package/dist/types/dom/rendering/sanitize.d.ts.map +1 -0
- package/dist/types/dom/rendering/secPolicy.d.ts +89 -0
- package/dist/types/dom/rendering/secPolicy.d.ts.map +1 -0
- package/dist/types/dom/rendering/template.d.ts +251 -0
- package/dist/types/dom/rendering/template.d.ts.map +1 -0
- package/dist/types/dom/rendering/themeTokens.d.ts +61 -0
- package/dist/types/dom/rendering/themeTokens.d.ts.map +1 -0
- package/dist/types/dom/rendering/uiSession-core.d.ts +192 -0
- package/dist/types/dom/rendering/uiSession-core.d.ts.map +1 -0
- package/dist/types/dom/rendering/uiSession-direct.d.ts +63 -0
- package/dist/types/dom/rendering/uiSession-direct.d.ts.map +1 -0
- package/dist/types/dom/rendering/uiSession-list.d.ts +205 -0
- package/dist/types/dom/rendering/uiSession-list.d.ts.map +1 -0
- package/dist/types/dom/rendering/uiSession.d.ts +285 -0
- package/dist/types/dom/rendering/uiSession.d.ts.map +1 -0
- package/dist/types/dom/rendering/virtualScroll.d.ts +80 -0
- package/dist/types/dom/rendering/virtualScroll.d.ts.map +1 -0
- package/dist/types/dom/sensors/battery.d.ts +71 -0
- package/dist/types/dom/sensors/battery.d.ts.map +1 -0
- package/dist/types/dom/sensors/geolocation.d.ts +83 -0
- package/dist/types/dom/sensors/geolocation.d.ts.map +1 -0
- package/dist/types/dom/sensors/networkInfo.d.ts +82 -0
- package/dist/types/dom/sensors/networkInfo.d.ts.map +1 -0
- package/dist/types/dom/sensors/sensors.d.ts +191 -0
- package/dist/types/dom/sensors/sensors.d.ts.map +1 -0
- package/dist/types/dom/sw/backgroundSync.d.ts +48 -0
- package/dist/types/dom/sw/backgroundSync.d.ts.map +1 -0
- package/dist/types/dom/sw/cache.d.ts +71 -0
- package/dist/types/dom/sw/cache.d.ts.map +1 -0
- package/dist/types/dom/sw/push.d.ts +77 -0
- package/dist/types/dom/sw/push.d.ts.map +1 -0
- package/dist/types/dom/sw/serviceWorker.d.ts +57 -0
- package/dist/types/dom/sw/serviceWorker.d.ts.map +1 -0
- package/dist/types/dom/sw/sharedWorker.d.ts +81 -0
- package/dist/types/dom/sw/sharedWorker.d.ts.map +1 -0
- package/dist/types/dom/utils/a11y.d.ts +53 -0
- package/dist/types/dom/utils/a11y.d.ts.map +1 -0
- package/dist/types/dom/utils/clipboard.d.ts +44 -0
- package/dist/types/dom/utils/clipboard.d.ts.map +1 -0
- package/dist/types/dom/utils/entropyCollector.d.ts +58 -0
- package/dist/types/dom/utils/entropyCollector.d.ts.map +1 -0
- package/dist/types/dom/utils/focus.d.ts +123 -0
- package/dist/types/dom/utils/focus.d.ts.map +1 -0
- package/dist/types/dom/utils/form.d.ts +227 -0
- package/dist/types/dom/utils/form.d.ts.map +1 -0
- package/dist/types/dom/utils/formKit.d.ts +206 -0
- package/dist/types/dom/utils/formKit.d.ts.map +1 -0
- package/dist/types/dom/utils/keybindings.d.ts +53 -0
- package/dist/types/dom/utils/keybindings.d.ts.map +1 -0
- package/dist/types/dom/utils/leaderElection.d.ts +70 -0
- package/dist/types/dom/utils/leaderElection.d.ts.map +1 -0
- package/dist/types/dom/utils/notifications.d.ts +164 -0
- package/dist/types/dom/utils/notifications.d.ts.map +1 -0
- package/dist/types/dom/utils/permissions.d.ts +35 -0
- package/dist/types/dom/utils/permissions.d.ts.map +1 -0
- package/dist/types/dom/utils/route.d.ts +117 -0
- package/dist/types/dom/utils/route.d.ts.map +1 -0
- package/dist/types/dom/utils/ua.d.ts +35 -0
- package/dist/types/dom/utils/ua.d.ts.map +1 -0
- package/dist/types/dom/utils/webauthn.d.ts +98 -0
- package/dist/types/dom/utils/webauthn.d.ts.map +1 -0
- package/dist/types/io/binary/reader.d.ts +59 -0
- package/dist/types/io/binary/reader.d.ts.map +1 -0
- package/dist/types/io/binary/writer.d.ts +56 -0
- package/dist/types/io/binary/writer.d.ts.map +1 -0
- package/dist/types/io/calc/adler32.d.ts +31 -0
- package/dist/types/io/calc/adler32.d.ts.map +1 -0
- package/dist/types/io/calc/bigint.d.ts +74 -0
- package/dist/types/io/calc/bigint.d.ts.map +1 -0
- package/dist/types/io/calc/crc32.d.ts +36 -0
- package/dist/types/io/calc/crc32.d.ts.map +1 -0
- package/dist/types/io/calc/easing.d.ts +60 -0
- package/dist/types/io/calc/easing.d.ts.map +1 -0
- package/dist/types/io/codec/b64.d.ts +28 -0
- package/dist/types/io/codec/b64.d.ts.map +1 -0
- package/dist/types/io/codec/base32.d.ts +28 -0
- package/dist/types/io/codec/base32.d.ts.map +1 -0
- package/dist/types/io/codec/base58.d.ts +28 -0
- package/dist/types/io/codec/base58.d.ts.map +1 -0
- package/dist/types/io/codec/buffer.d.ts +66 -0
- package/dist/types/io/codec/buffer.d.ts.map +1 -0
- package/dist/types/io/codec/cbor.d.ts +43 -0
- package/dist/types/io/codec/cbor.d.ts.map +1 -0
- package/dist/types/io/codec/csv.d.ts +35 -0
- package/dist/types/io/codec/csv.d.ts.map +1 -0
- package/dist/types/io/codec/hex.d.ts +28 -0
- package/dist/types/io/codec/hex.d.ts.map +1 -0
- package/dist/types/io/codec/mime.d.ts +100 -0
- package/dist/types/io/codec/mime.d.ts.map +1 -0
- package/dist/types/io/codec/msgpack.d.ts +36 -0
- package/dist/types/io/codec/msgpack.d.ts.map +1 -0
- package/dist/types/io/codec/url.d.ts +52 -0
- package/dist/types/io/codec/url.d.ts.map +1 -0
- package/dist/types/io/codec/utf8.d.ts +22 -0
- package/dist/types/io/codec/utf8.d.ts.map +1 -0
- package/dist/types/io/codec/xml.d.ts +91 -0
- package/dist/types/io/codec/xml.d.ts.map +1 -0
- package/dist/types/io/compress/bitstream.d.ts +51 -0
- package/dist/types/io/compress/bitstream.d.ts.map +1 -0
- package/dist/types/io/compress/brotli.d.ts +86 -0
- package/dist/types/io/compress/brotli.d.ts.map +1 -0
- package/dist/types/io/compress/brotli_dict.d.ts +76 -0
- package/dist/types/io/compress/brotli_dict.d.ts.map +1 -0
- package/dist/types/io/compress/brotli_dict_words.d.ts +43 -0
- package/dist/types/io/compress/brotli_dict_words.d.ts.map +1 -0
- package/dist/types/io/compress/brotli_frame.d.ts +166 -0
- package/dist/types/io/compress/brotli_frame.d.ts.map +1 -0
- package/dist/types/io/compress/brotli_shared.d.ts +165 -0
- package/dist/types/io/compress/brotli_shared.d.ts.map +1 -0
- package/dist/types/io/compress/deflate.d.ts +89 -0
- package/dist/types/io/compress/deflate.d.ts.map +1 -0
- package/dist/types/io/compress/gzip.d.ts +100 -0
- package/dist/types/io/compress/gzip.d.ts.map +1 -0
- package/dist/types/io/compress/huffman.d.ts +37 -0
- package/dist/types/io/compress/huffman.d.ts.map +1 -0
- package/dist/types/io/compress/lz4.d.ts +45 -0
- package/dist/types/io/compress/lz4.d.ts.map +1 -0
- package/dist/types/io/compress/lz77.d.ts +66 -0
- package/dist/types/io/compress/lz77.d.ts.map +1 -0
- package/dist/types/io/compress/lzw.d.ts +37 -0
- package/dist/types/io/compress/lzw.d.ts.map +1 -0
- package/dist/types/io/compress/zip.d.ts +112 -0
- package/dist/types/io/compress/zip.d.ts.map +1 -0
- package/dist/types/io/compress/zlib.d.ts +97 -0
- package/dist/types/io/compress/zlib.d.ts.map +1 -0
- package/dist/types/io/i18n/i18n.d.ts +64 -0
- package/dist/types/io/i18n/i18n.d.ts.map +1 -0
- package/dist/types/io/math/fixed-point.d.ts +30 -0
- package/dist/types/io/math/fixed-point.d.ts.map +1 -0
- package/dist/types/io/math/geom.d.ts +125 -0
- package/dist/types/io/math/geom.d.ts.map +1 -0
- package/dist/types/io/math/interp.d.ts +48 -0
- package/dist/types/io/math/interp.d.ts.map +1 -0
- package/dist/types/io/math/linalg.d.ts +117 -0
- package/dist/types/io/math/linalg.d.ts.map +1 -0
- package/dist/types/io/math/stats.d.ts +45 -0
- package/dist/types/io/math/stats.d.ts.map +1 -0
- package/dist/types/io/structures/btree.d.ts +84 -0
- package/dist/types/io/structures/btree.d.ts.map +1 -0
- package/dist/types/io/structures/heap.d.ts +75 -0
- package/dist/types/io/structures/heap.d.ts.map +1 -0
- package/dist/types/io/structures/lruCache.d.ts +88 -0
- package/dist/types/io/structures/lruCache.d.ts.map +1 -0
- package/dist/types/io/structures/ringBuffer.d.ts +82 -0
- package/dist/types/io/structures/ringBuffer.d.ts.map +1 -0
- package/dist/types/io/structures/tree-walker.d.ts +95 -0
- package/dist/types/io/structures/tree-walker.d.ts.map +1 -0
- package/dist/types/io/structures/trie.d.ts +71 -0
- package/dist/types/io/structures/trie.d.ts.map +1 -0
- package/dist/types/io/sync/abort.d.ts +59 -0
- package/dist/types/io/sync/abort.d.ts.map +1 -0
- package/dist/types/io/sync/atomics.d.ts +107 -0
- package/dist/types/io/sync/atomics.d.ts.map +1 -0
- package/dist/types/io/sync/cancellable.d.ts +69 -0
- package/dist/types/io/sync/cancellable.d.ts.map +1 -0
- package/dist/types/io/sync/channel.d.ts +70 -0
- package/dist/types/io/sync/channel.d.ts.map +1 -0
- package/dist/types/io/sync/mutex.d.ts +39 -0
- package/dist/types/io/sync/mutex.d.ts.map +1 -0
- package/dist/types/io/sync/semaphore.d.ts +40 -0
- package/dist/types/io/sync/semaphore.d.ts.map +1 -0
- package/dist/types/io/sync/tokenBucket.d.ts +53 -0
- package/dist/types/io/sync/tokenBucket.d.ts.map +1 -0
- package/dist/types/io/text/ansi.d.ts +125 -0
- package/dist/types/io/text/ansi.d.ts.map +1 -0
- package/dist/types/io/text/html-entities.d.ts +35 -0
- package/dist/types/io/text/html-entities.d.ts.map +1 -0
- package/dist/types/io/text/semver.d.ts +75 -0
- package/dist/types/io/text/semver.d.ts.map +1 -0
- package/dist/types/io/text/str.d.ts +88 -0
- package/dist/types/io/text/str.d.ts.map +1 -0
- package/dist/types/io/text/unicode.d.ts +70 -0
- package/dist/types/io/text/unicode.d.ts.map +1 -0
- package/dist/types/io/time/date.d.ts +73 -0
- package/dist/types/io/time/date.d.ts.map +1 -0
- package/dist/types/io/timing/clock.d.ts +39 -0
- package/dist/types/io/timing/clock.d.ts.map +1 -0
- package/dist/types/io/timing/rateLimit.d.ts +40 -0
- package/dist/types/io/timing/rateLimit.d.ts.map +1 -0
- package/dist/types/io/timing/scheduler.d.ts +122 -0
- package/dist/types/io/timing/scheduler.d.ts.map +1 -0
- package/dist/types/io/utils/bitmap.d.ts +34 -0
- package/dist/types/io/utils/bitmap.d.ts.map +1 -0
- package/dist/types/io/utils/errors.d.ts +94 -0
- package/dist/types/io/utils/errors.d.ts.map +1 -0
- package/dist/types/io/utils/eventBus.d.ts +68 -0
- package/dist/types/io/utils/eventBus.d.ts.map +1 -0
- package/dist/types/io/utils/queue.d.ts +69 -0
- package/dist/types/io/utils/queue.d.ts.map +1 -0
- package/dist/types/io/utils/signal.d.ts +362 -0
- package/dist/types/io/utils/signal.d.ts.map +1 -0
- package/dist/types/io/utils/ui8.d.ts +34 -0
- package/dist/types/io/utils/ui8.d.ts.map +1 -0
- package/dist/types/io/utils/valid.d.ts +130 -0
- package/dist/types/io/utils/valid.d.ts.map +1 -0
- package/dist/types/main.d.ts +25 -0
- package/dist/types/main.d.ts.map +1 -0
- package/dist/types/process/message.d.ts +64 -0
- package/dist/types/process/message.d.ts.map +1 -0
- package/dist/types/process/rpc.d.ts +35 -0
- package/dist/types/process/rpc.d.ts.map +1 -0
- package/dist/types/process/workerPool.d.ts +62 -0
- package/dist/types/process/workerPool.d.ts.map +1 -0
- package/dist/types/sanity/base.d.ts +28 -0
- package/dist/types/sanity/base.d.ts.map +1 -0
- package/dist/types/sanity/community.d.ts +20 -0
- package/dist/types/sanity/community.d.ts.map +1 -0
- package/dist/types/sanity/lockdown-apply.d.ts +7 -0
- package/dist/types/sanity/lockdown-apply.d.ts.map +1 -0
- package/dist/types/sanity/lockdown.d.ts +43 -0
- package/dist/types/sanity/lockdown.d.ts.map +1 -0
- package/dist/types/sanity/wasm-gate.d.ts +128 -0
- package/dist/types/sanity/wasm-gate.d.ts.map +1 -0
- package/docs/README.md +301 -0
- package/docs/api/README.md +33 -0
- package/docs/api/core/README.md +14 -0
- package/docs/api/core/logger.md +151 -0
- package/docs/api/core/main.md +105 -0
- package/docs/api/core/modules.md +123 -0
- package/docs/api/core/readyState.md +94 -0
- package/docs/api/core/runtime.md +499 -0
- package/docs/api/core/worker-helper.md +180 -0
- package/docs/api/crypto/README.md +39 -0
- package/docs/api/crypto/cipher/README.md +24 -0
- package/docs/api/crypto/cipher/aes.md +101 -0
- package/docs/api/crypto/cipher/chacha20.md +85 -0
- package/docs/api/crypto/hash/README.md +49 -0
- package/docs/api/crypto/hash/adf.md +61 -0
- package/docs/api/crypto/hash/argon2.md +92 -0
- package/docs/api/crypto/hash/blake2b.md +88 -0
- package/docs/api/crypto/hash/hkdf.md +82 -0
- package/docs/api/crypto/hash/hmac.md +90 -0
- package/docs/api/crypto/hash/pbkdf2.md +93 -0
- package/docs/api/crypto/hash/poly1305.md +71 -0
- package/docs/api/crypto/hash/sha224.md +61 -0
- package/docs/api/crypto/hash/sha256.md +84 -0
- package/docs/api/crypto/hash/sha3.md +89 -0
- package/docs/api/crypto/hash/sha384.md +58 -0
- package/docs/api/crypto/hash/sha512.md +73 -0
- package/docs/api/crypto/hash/sha512_224.md +59 -0
- package/docs/api/crypto/hash/sha512_256.md +58 -0
- package/docs/api/crypto/mode/README.md +33 -0
- package/docs/api/crypto/mode/cbc.md +69 -0
- package/docs/api/crypto/mode/chacha20poly1305.md +77 -0
- package/docs/api/crypto/mode/cmac.md +79 -0
- package/docs/api/crypto/mode/ctr.md +66 -0
- package/docs/api/crypto/mode/gcm.md +93 -0
- package/docs/api/crypto/mode/kw.md +84 -0
- package/docs/api/crypto/pkc/README.md +48 -0
- package/docs/api/crypto/pkc/ecc.md +91 -0
- package/docs/api/crypto/pkc/ed25519.md +99 -0
- package/docs/api/crypto/pkc/hybridKem.md +178 -0
- package/docs/api/crypto/pkc/hybridSign.md +192 -0
- package/docs/api/crypto/pkc/ml_dsa.md +99 -0
- package/docs/api/crypto/pkc/ml_kem.md +90 -0
- package/docs/api/crypto/pkc/rsa.md +87 -0
- package/docs/api/crypto/pkc/slh_dsa.md +86 -0
- package/docs/api/crypto/pkc/x25519.md +84 -0
- package/docs/api/crypto/utils/README.md +39 -0
- package/docs/api/crypto/utils/aes_ctr.md +71 -0
- package/docs/api/crypto/utils/aes_modes.md +81 -0
- package/docs/api/crypto/utils/asn1-oid.md +130 -0
- package/docs/api/crypto/utils/asn1.md +69 -0
- package/docs/api/crypto/utils/bitArray.md +77 -0
- package/docs/api/crypto/utils/bn.md +67 -0
- package/docs/api/crypto/utils/jws.md +94 -0
- package/docs/api/crypto/utils/keyformat.md +78 -0
- package/docs/api/crypto/utils/pad.md +66 -0
- package/docs/api/crypto/utils/pem.md +63 -0
- package/docs/api/crypto/utils/random.md +103 -0
- package/docs/api/crypto/utils/rsaKeygen.md +118 -0
- package/docs/api/crypto/utils/totp.md +159 -0
- package/docs/api/crypto/utils/uuid.md +98 -0
- package/docs/api/crypto/wasm/README.md +76 -0
- package/docs/api/crypto/wasm/aes.md +128 -0
- package/docs/api/crypto/wasm/argon2.md +110 -0
- package/docs/api/crypto/wasm/blake2b.md +103 -0
- package/docs/api/crypto/wasm/chacha20poly1305.md +120 -0
- package/docs/api/crypto/wasm/cmac.md +119 -0
- package/docs/api/crypto/wasm/ecc.md +114 -0
- package/docs/api/crypto/wasm/ed25519.md +117 -0
- package/docs/api/crypto/wasm/hkdf.md +163 -0
- package/docs/api/crypto/wasm/hmac.md +129 -0
- package/docs/api/crypto/wasm/ml_dsa.md +99 -0
- package/docs/api/crypto/wasm/ml_kem.md +91 -0
- package/docs/api/crypto/wasm/pbkdf2.md +111 -0
- package/docs/api/crypto/wasm/rsa.md +113 -0
- package/docs/api/crypto/wasm/runtime.md +172 -0
- package/docs/api/crypto/wasm/sha2.md +95 -0
- package/docs/api/crypto/wasm/sha3.md +127 -0
- package/docs/api/crypto/wasm/slh_dsa.md +89 -0
- package/docs/api/crypto/wasm/x25519.md +116 -0
- package/docs/api/crypto/webcrypto/README.md +56 -0
- package/docs/api/crypto/webcrypto/aes.md +140 -0
- package/docs/api/crypto/webcrypto/aeskw.md +120 -0
- package/docs/api/crypto/webcrypto/digest.md +103 -0
- package/docs/api/crypto/webcrypto/ecc.md +122 -0
- package/docs/api/crypto/webcrypto/ed25519.md +121 -0
- package/docs/api/crypto/webcrypto/hkdf.md +141 -0
- package/docs/api/crypto/webcrypto/hmac.md +112 -0
- package/docs/api/crypto/webcrypto/pbkdf2.md +140 -0
- package/docs/api/crypto/webcrypto/rsa.md +149 -0
- package/docs/api/crypto/webcrypto/x25519.md +96 -0
- package/docs/api/dom/README.md +117 -0
- package/docs/api/dom/display/README.md +27 -0
- package/docs/api/dom/display/animate.md +113 -0
- package/docs/api/dom/display/fullscreen.md +121 -0
- package/docs/api/dom/fs/README.md +36 -0
- package/docs/api/dom/fs/download.md +108 -0
- package/docs/api/dom/fs/fsAccess.md +200 -0
- package/docs/api/dom/fs/indexedDB.md +219 -0
- package/docs/api/dom/fs/remoteStore.md +158 -0
- package/docs/api/dom/fs/storage.md +197 -0
- package/docs/api/dom/lifecycle/README.md +11 -0
- package/docs/api/dom/lifecycle/idle.md +89 -0
- package/docs/api/dom/lifecycle/visibility.md +73 -0
- package/docs/api/dom/lifecycle/wakeLock.md +94 -0
- package/docs/api/dom/net/README.md +31 -0
- package/docs/api/dom/net/ajax.md +176 -0
- package/docs/api/dom/net/broadcastChannel.md +110 -0
- package/docs/api/dom/net/network.md +137 -0
- package/docs/api/dom/net/sse.md +141 -0
- package/docs/api/dom/net/webrtc.md +158 -0
- package/docs/api/dom/net/ws.md +168 -0
- package/docs/api/dom/query/README.md +30 -0
- package/docs/api/dom/query/dnd.md +137 -0
- package/docs/api/dom/query/dom.md +275 -0
- package/docs/api/dom/query/events.md +211 -0
- package/docs/api/dom/query/gesture.md +137 -0
- package/docs/api/dom/query/media.md +188 -0
- package/docs/api/dom/rendering/README.md +41 -0
- package/docs/api/dom/rendering/chart.md +149 -0
- package/docs/api/dom/rendering/component.md +287 -0
- package/docs/api/dom/rendering/devtools-ui.md +129 -0
- package/docs/api/dom/rendering/devtools.md +157 -0
- package/docs/api/dom/rendering/parser.md +200 -0
- package/docs/api/dom/rendering/reactiveBind.md +234 -0
- package/docs/api/dom/rendering/render.md +219 -0
- package/docs/api/dom/rendering/sanitize.md +97 -0
- package/docs/api/dom/rendering/secPolicy.md +155 -0
- package/docs/api/dom/rendering/template.md +301 -0
- package/docs/api/dom/rendering/themeTokens.md +175 -0
- package/docs/api/dom/rendering/uiSession.md +546 -0
- package/docs/api/dom/rendering/virtualScroll.md +126 -0
- package/docs/api/dom/sensors/README.md +12 -0
- package/docs/api/dom/sensors/battery.md +70 -0
- package/docs/api/dom/sensors/geolocation.md +115 -0
- package/docs/api/dom/sensors/networkInfo.md +73 -0
- package/docs/api/dom/sensors/sensors.md +123 -0
- package/docs/api/dom/sw/README.md +31 -0
- package/docs/api/dom/sw/backgroundSync.md +145 -0
- package/docs/api/dom/sw/cache.md +116 -0
- package/docs/api/dom/sw/push.md +114 -0
- package/docs/api/dom/sw/serviceWorker.md +90 -0
- package/docs/api/dom/sw/sharedWorker.md +131 -0
- package/docs/api/dom/utils/README.md +25 -0
- package/docs/api/dom/utils/a11y.md +143 -0
- package/docs/api/dom/utils/clipboard.md +146 -0
- package/docs/api/dom/utils/entropyCollector.md +175 -0
- package/docs/api/dom/utils/focus.md +140 -0
- package/docs/api/dom/utils/form.md +196 -0
- package/docs/api/dom/utils/formKit.md +181 -0
- package/docs/api/dom/utils/keybindings.md +138 -0
- package/docs/api/dom/utils/leaderElection.md +130 -0
- package/docs/api/dom/utils/notifications.md +106 -0
- package/docs/api/dom/utils/permissions.md +82 -0
- package/docs/api/dom/utils/route.md +112 -0
- package/docs/api/dom/utils/ua.md +119 -0
- package/docs/api/dom/utils/webauthn.md +190 -0
- package/docs/api/io/README.md +20 -0
- package/docs/api/io/binary/README.md +29 -0
- package/docs/api/io/binary/reader.md +126 -0
- package/docs/api/io/binary/writer.md +127 -0
- package/docs/api/io/calc/README.md +22 -0
- package/docs/api/io/calc/adler32.md +75 -0
- package/docs/api/io/calc/bigint.md +105 -0
- package/docs/api/io/calc/crc32.md +74 -0
- package/docs/api/io/calc/easing.md +118 -0
- package/docs/api/io/codec/README.md +35 -0
- package/docs/api/io/codec/b64.md +92 -0
- package/docs/api/io/codec/base32.md +98 -0
- package/docs/api/io/codec/base58.md +104 -0
- package/docs/api/io/codec/buffer.md +144 -0
- package/docs/api/io/codec/cbor.md +179 -0
- package/docs/api/io/codec/csv.md +178 -0
- package/docs/api/io/codec/hex.md +75 -0
- package/docs/api/io/codec/mime.md +156 -0
- package/docs/api/io/codec/msgpack.md +142 -0
- package/docs/api/io/codec/url.md +265 -0
- package/docs/api/io/codec/utf8.md +84 -0
- package/docs/api/io/codec/xml.md +87 -0
- package/docs/api/io/compress/README.md +62 -0
- package/docs/api/io/compress/bitstream.md +131 -0
- package/docs/api/io/compress/brotli.md +232 -0
- package/docs/api/io/compress/brotli_dict.md +119 -0
- package/docs/api/io/compress/brotli_dict_words.md +142 -0
- package/docs/api/io/compress/brotli_frame.md +214 -0
- package/docs/api/io/compress/brotli_shared.md +144 -0
- package/docs/api/io/compress/deflate.md +474 -0
- package/docs/api/io/compress/gzip.md +130 -0
- package/docs/api/io/compress/huffman.md +210 -0
- package/docs/api/io/compress/lz4.md +278 -0
- package/docs/api/io/compress/lz77.md +180 -0
- package/docs/api/io/compress/lzw.md +121 -0
- package/docs/api/io/compress/zip.md +209 -0
- package/docs/api/io/compress/zlib.md +125 -0
- package/docs/api/io/i18n/README.md +23 -0
- package/docs/api/io/i18n/i18n.md +128 -0
- package/docs/api/io/math/README.md +24 -0
- package/docs/api/io/math/fixed-point.md +115 -0
- package/docs/api/io/math/geom.md +144 -0
- package/docs/api/io/math/interp.md +115 -0
- package/docs/api/io/math/linalg.md +138 -0
- package/docs/api/io/math/stats.md +109 -0
- package/docs/api/io/structures/README.md +31 -0
- package/docs/api/io/structures/btree.md +155 -0
- package/docs/api/io/structures/heap.md +166 -0
- package/docs/api/io/structures/lruCache.md +156 -0
- package/docs/api/io/structures/ringBuffer.md +188 -0
- package/docs/api/io/structures/tree-walker.md +132 -0
- package/docs/api/io/structures/trie.md +138 -0
- package/docs/api/io/sync/README.md +29 -0
- package/docs/api/io/sync/abort.md +129 -0
- package/docs/api/io/sync/atomics.md +159 -0
- package/docs/api/io/sync/cancellable.md +176 -0
- package/docs/api/io/sync/channel.md +125 -0
- package/docs/api/io/sync/mutex.md +93 -0
- package/docs/api/io/sync/semaphore.md +106 -0
- package/docs/api/io/sync/tokenBucket.md +139 -0
- package/docs/api/io/text/README.md +23 -0
- package/docs/api/io/text/ansi.md +182 -0
- package/docs/api/io/text/html-entities.md +79 -0
- package/docs/api/io/text/semver.md +158 -0
- package/docs/api/io/text/str.md +129 -0
- package/docs/api/io/text/unicode.md +89 -0
- package/docs/api/io/time/README.md +22 -0
- package/docs/api/io/time/date.md +128 -0
- package/docs/api/io/timing/README.md +32 -0
- package/docs/api/io/timing/clock.md +102 -0
- package/docs/api/io/timing/rateLimit.md +137 -0
- package/docs/api/io/timing/scheduler.md +163 -0
- package/docs/api/io/utils/README.md +30 -0
- package/docs/api/io/utils/bitmap.md +96 -0
- package/docs/api/io/utils/errors.md +165 -0
- package/docs/api/io/utils/eventBus.md +162 -0
- package/docs/api/io/utils/queue.md +141 -0
- package/docs/api/io/utils/signal.md +388 -0
- package/docs/api/io/utils/ui8.md +111 -0
- package/docs/api/io/utils/valid.md +272 -0
- package/docs/api/process/README.md +18 -0
- package/docs/api/process/message.md +166 -0
- package/docs/api/process/rpc.md +161 -0
- package/docs/api/process/workerPool.md +130 -0
- package/docs/api/sanity/base.md +132 -0
- package/docs/api/sanity/community.md +96 -0
- package/docs/api/sanity/lockdown.md +128 -0
- package/docs/api/typed.md +85 -0
- package/docs/dev/README.md +25 -0
- package/docs/dev/provenance.md +80 -0
- package/docs/dev/publishing.md +31 -0
- package/docs/dev/runtime.md +64 -0
- package/docs/dev/testing.md +61 -0
- package/docs/dev/types.md +35 -0
- package/docs/evidence/pqc-hybrid-evidence.md +438 -0
- package/docs/guide/README.md +38 -0
- package/docs/guide/_QUICK_REF.md +341 -0
- package/docs/guide/by-use-case.md +160 -0
- package/docs/guide/doc-format.md +306 -0
- package/docs/guide/gesture-dnd-side-channel.md +119 -0
- package/docs/guide/getting-started.md +134 -0
- package/docs/guide/hmr.md +187 -0
- package/docs/guide/integration-bundlers.md +193 -0
- package/docs/guide/integrations-hmr.md +103 -0
- package/docs/guide/module-creation-workflow.md +342 -0
- package/docs/guide/module-pattern.md +244 -0
- package/docs/guide/rendering-pipeline.md +422 -0
- package/docs/guide/security.md +346 -0
- package/docs/guide/test-format.md +190 -0
- package/docs/guide/tutorial-todo.md +298 -0
- package/docs/guide/typescript.md +215 -0
- package/docs/guide/worker-confinement.md +301 -0
- package/docs/guide/workers.md +168 -0
- package/docs/notes/lz77-deflate-factorization.md +96 -0
- package/docs/notes/worker-confinement-spike.md +302 -0
- package/docs/tools/README.md +56 -0
- package/docs/tools/aot.md +108 -0
- package/docs/tools/audit.md +61 -0
- package/docs/tools/bundler.md +215 -0
- package/docs/tools/codegen.md +64 -0
- package/docs/tools/jsx.md +236 -0
- package/docs/tools/precompilation.md +88 -0
- package/docs/tools/standalone.md +107 -0
- package/fw.config.json +129 -0
- package/integrations/README.md +52 -0
- package/integrations/_shared/catalog.generated.json +207 -0
- package/integrations/_shared/config-resolve.js +201 -0
- package/integrations/_shared/core.js +362 -0
- package/integrations/astro/README.md +96 -0
- package/integrations/astro/index.d.ts +42 -0
- package/integrations/astro/index.js +94 -0
- package/integrations/bun/README.md +62 -0
- package/integrations/bun/index.d.ts +30 -0
- package/integrations/bun/index.js +134 -0
- package/integrations/deno/README.md +55 -0
- package/integrations/deno/deno.json +10 -0
- package/integrations/esbuild/README.md +75 -0
- package/integrations/esbuild/backend.js +147 -0
- package/integrations/esbuild/index.d.ts +32 -0
- package/integrations/esbuild/index.js +147 -0
- package/integrations/eslint/README.md +27 -0
- package/integrations/eslint/no-factory-capture.js +99 -0
- package/integrations/jest/README.md +45 -0
- package/integrations/jest/bun-test-shim.js +43 -0
- package/integrations/nestjs/README.md +68 -0
- package/integrations/nestjs/index.d.ts +38 -0
- package/integrations/nestjs/index.js +99 -0
- package/integrations/nextjs/README.md +149 -0
- package/integrations/nextjs/index.d.ts +30 -0
- package/integrations/nextjs/index.js +98 -0
- package/integrations/nodejs/README.md +46 -0
- package/integrations/nodejs/package.node.example.json +31 -0
- package/integrations/rollup/README.md +65 -0
- package/integrations/rollup/backend.js +132 -0
- package/integrations/rollup/index.d.ts +32 -0
- package/integrations/rollup/index.js +84 -0
- package/integrations/turbopack/README.md +56 -0
- package/integrations/turbopack/index.d.ts +47 -0
- package/integrations/turbopack/index.js +164 -0
- package/integrations/typedoc/README.md +57 -0
- package/integrations/typedoc/categorize.js +121 -0
- package/integrations/typedoc/tsconfig.typedoc.json +14 -0
- package/integrations/typedoc/typedoc.json +19 -0
- package/integrations/vite/README.md +115 -0
- package/integrations/vite/index.d.ts +29 -0
- package/integrations/vite/index.js +182 -0
- package/integrations/vite/package.json +8 -0
- package/integrations/vite/vite-env.d.ts +36 -0
- package/integrations/vitest/README.md +77 -0
- package/integrations/vitest/bun-test-shim.js +92 -0
- package/integrations/vitest/vitest.config.js +41 -0
- package/integrations/webpack/README.md +53 -0
- package/integrations/webpack/index.d.ts +29 -0
- package/integrations/webpack/index.js +182 -0
- package/package.json +303 -0
- package/src/core/logger.js +373 -0
- package/src/core/modules.js +289 -0
- package/src/core/readyState.js +119 -0
- package/src/core/runtime.js +929 -0
- package/src/core/worker-helper.js +261 -0
- package/src/crypto/NIST_CONFORMANCE.md +249 -0
- package/src/crypto/cipher/aes.acvp.md +74 -0
- package/src/crypto/cipher/aes.js +512 -0
- package/src/crypto/cipher/chacha20.acvp.md +117 -0
- package/src/crypto/cipher/chacha20.js +147 -0
- package/src/crypto/hash/adf.acvp.md +144 -0
- package/src/crypto/hash/adf.js +127 -0
- package/src/crypto/hash/argon2.acvp.md +144 -0
- package/src/crypto/hash/argon2.js +517 -0
- package/src/crypto/hash/blake2b.acvp.md +122 -0
- package/src/crypto/hash/blake2b.js +367 -0
- package/src/crypto/hash/hkdf.acvp.md +128 -0
- package/src/crypto/hash/hkdf.js +145 -0
- package/src/crypto/hash/hmac.acvp.md +110 -0
- package/src/crypto/hash/hmac.js +177 -0
- package/src/crypto/hash/pbkdf2.acvp.md +122 -0
- package/src/crypto/hash/pbkdf2.js +120 -0
- package/src/crypto/hash/poly1305.acvp.md +111 -0
- package/src/crypto/hash/poly1305.js +126 -0
- package/src/crypto/hash/sha224.acvp.md +81 -0
- package/src/crypto/hash/sha224.js +60 -0
- package/src/crypto/hash/sha256.acvp.md +75 -0
- package/src/crypto/hash/sha256.js +217 -0
- package/src/crypto/hash/sha3.acvp.md +133 -0
- package/src/crypto/hash/sha3.js +391 -0
- package/src/crypto/hash/sha384.acvp.md +82 -0
- package/src/crypto/hash/sha384.js +61 -0
- package/src/crypto/hash/sha512.acvp.md +84 -0
- package/src/crypto/hash/sha512.js +314 -0
- package/src/crypto/hash/sha512_224.acvp.md +90 -0
- package/src/crypto/hash/sha512_224.js +66 -0
- package/src/crypto/hash/sha512_256.acvp.md +96 -0
- package/src/crypto/hash/sha512_256.js +75 -0
- package/src/crypto/mode/cbc.acvp.md +105 -0
- package/src/crypto/mode/cbc.js +136 -0
- package/src/crypto/mode/chacha20poly1305.acvp.md +116 -0
- package/src/crypto/mode/chacha20poly1305.js +190 -0
- package/src/crypto/mode/cmac.acvp.md +106 -0
- package/src/crypto/mode/cmac.js +172 -0
- package/src/crypto/mode/ctr.acvp.md +110 -0
- package/src/crypto/mode/ctr.js +174 -0
- package/src/crypto/mode/gcm.acvp.md +129 -0
- package/src/crypto/mode/gcm.js +333 -0
- package/src/crypto/mode/kw.acvp.md +145 -0
- package/src/crypto/mode/kw.js +323 -0
- package/src/crypto/pkc/ecc.acvp.md +181 -0
- package/src/crypto/pkc/ecc.js +941 -0
- package/src/crypto/pkc/ed25519.acvp.md +172 -0
- package/src/crypto/pkc/ed25519.js +582 -0
- package/src/crypto/pkc/hybrid-kat.provenance.md +89 -0
- package/src/crypto/pkc/hybridKem.js +255 -0
- package/src/crypto/pkc/hybridSign.js +437 -0
- package/src/crypto/pkc/ml_dsa.acvp.md +146 -0
- package/src/crypto/pkc/ml_dsa.js +984 -0
- package/src/crypto/pkc/ml_kem.acvp.md +117 -0
- package/src/crypto/pkc/ml_kem.js +596 -0
- package/src/crypto/pkc/rsa.acvp.md +187 -0
- package/src/crypto/pkc/rsa.js +470 -0
- package/src/crypto/pkc/slh_dsa.acvp.md +155 -0
- package/src/crypto/pkc/slh_dsa.js +820 -0
- package/src/crypto/pkc/x25519.acvp.md +113 -0
- package/src/crypto/pkc/x25519.js +290 -0
- package/src/crypto/utils/aes_ctr.acvp.md +67 -0
- package/src/crypto/utils/aes_ctr.js +134 -0
- package/src/crypto/utils/aes_modes.acvp.md +66 -0
- package/src/crypto/utils/aes_modes.js +241 -0
- package/src/crypto/utils/asn1-oid.js +369 -0
- package/src/crypto/utils/asn1.js +343 -0
- package/src/crypto/utils/bitArray.js +312 -0
- package/src/crypto/utils/bn.js +825 -0
- package/src/crypto/utils/jws.js +222 -0
- package/src/crypto/utils/keyformat.js +303 -0
- package/src/crypto/utils/pad.js +198 -0
- package/src/crypto/utils/pem.js +90 -0
- package/src/crypto/utils/random.acvp.md +167 -0
- package/src/crypto/utils/random.js +846 -0
- package/src/crypto/utils/rsaKeygen.acvp.md +158 -0
- package/src/crypto/utils/rsaKeygen.js +448 -0
- package/src/crypto/utils/totp.js +409 -0
- package/src/crypto/utils/uuid.acvp.md +137 -0
- package/src/crypto/utils/uuid.js +176 -0
- package/src/crypto/wasm/aes.js +494 -0
- package/src/crypto/wasm/argon2.js +236 -0
- package/src/crypto/wasm/blake2b.js +213 -0
- package/src/crypto/wasm/chacha20poly1305.js +238 -0
- package/src/crypto/wasm/cmac.js +207 -0
- package/src/crypto/wasm/ecc.js +437 -0
- package/src/crypto/wasm/ed25519.js +307 -0
- package/src/crypto/wasm/hkdf.js +183 -0
- package/src/crypto/wasm/hmac.js +215 -0
- package/src/crypto/wasm/ml_dsa.js +375 -0
- package/src/crypto/wasm/ml_kem.js +313 -0
- package/src/crypto/wasm/pbkdf2.js +205 -0
- package/src/crypto/wasm/rsa.js +674 -0
- package/src/crypto/wasm/runtime.js +400 -0
- package/src/crypto/wasm/sha2.js +183 -0
- package/src/crypto/wasm/sha3.js +221 -0
- package/src/crypto/wasm/slh_dsa.js +397 -0
- package/src/crypto/wasm/x25519.js +241 -0
- package/src/crypto/webcrypto/aes.js +370 -0
- package/src/crypto/webcrypto/aeskw.js +185 -0
- package/src/crypto/webcrypto/digest.js +136 -0
- package/src/crypto/webcrypto/ecc.js +371 -0
- package/src/crypto/webcrypto/ed25519.js +248 -0
- package/src/crypto/webcrypto/hkdf.js +132 -0
- package/src/crypto/webcrypto/hmac.js +213 -0
- package/src/crypto/webcrypto/pbkdf2.js +146 -0
- package/src/crypto/webcrypto/rsa.js +415 -0
- package/src/crypto/webcrypto/x25519.js +250 -0
- package/src/dom/display/animate.js +154 -0
- package/src/dom/display/fullscreen.js +305 -0
- package/src/dom/fs/download.js +118 -0
- package/src/dom/fs/fsAccess.js +307 -0
- package/src/dom/fs/indexedDB.js +465 -0
- package/src/dom/fs/remoteStore.js +484 -0
- package/src/dom/fs/storage.js +440 -0
- package/src/dom/lifecycle/idle.js +133 -0
- package/src/dom/lifecycle/visibility.js +140 -0
- package/src/dom/lifecycle/wakeLock.js +187 -0
- package/src/dom/net/ajax.js +303 -0
- package/src/dom/net/broadcastChannel.js +89 -0
- package/src/dom/net/network.js +260 -0
- package/src/dom/net/sse.js +295 -0
- package/src/dom/net/webrtc.js +381 -0
- package/src/dom/net/ws.js +290 -0
- package/src/dom/query/dnd.js +409 -0
- package/src/dom/query/dom.js +831 -0
- package/src/dom/query/events.js +425 -0
- package/src/dom/query/gesture.js +396 -0
- package/src/dom/query/media.js +616 -0
- package/src/dom/rendering/chart.js +663 -0
- package/src/dom/rendering/component.js +469 -0
- package/src/dom/rendering/devtools-ui.js +399 -0
- package/src/dom/rendering/devtools.js +352 -0
- package/src/dom/rendering/parser.js +1055 -0
- package/src/dom/rendering/reactiveBind.js +341 -0
- package/src/dom/rendering/render.js +601 -0
- package/src/dom/rendering/sanitize.js +364 -0
- package/src/dom/rendering/secPolicy.js +281 -0
- package/src/dom/rendering/template.js +1031 -0
- package/src/dom/rendering/themeTokens.js +522 -0
- package/src/dom/rendering/uiSession-core.js +597 -0
- package/src/dom/rendering/uiSession-direct.js +251 -0
- package/src/dom/rendering/uiSession-list.js +751 -0
- package/src/dom/rendering/uiSession.js +145 -0
- package/src/dom/rendering/virtualScroll.js +341 -0
- package/src/dom/sensors/battery.js +153 -0
- package/src/dom/sensors/geolocation.js +156 -0
- package/src/dom/sensors/networkInfo.js +136 -0
- package/src/dom/sensors/sensors.js +340 -0
- package/src/dom/sw/backgroundSync.js +113 -0
- package/src/dom/sw/cache.js +139 -0
- package/src/dom/sw/push.js +181 -0
- package/src/dom/sw/serviceWorker.js +193 -0
- package/src/dom/sw/sharedWorker.js +192 -0
- package/src/dom/utils/a11y.js +244 -0
- package/src/dom/utils/clipboard.js +113 -0
- package/src/dom/utils/entropyCollector.js +344 -0
- package/src/dom/utils/focus.js +421 -0
- package/src/dom/utils/form.js +535 -0
- package/src/dom/utils/formKit.js +427 -0
- package/src/dom/utils/keybindings.js +574 -0
- package/src/dom/utils/leaderElection.js +280 -0
- package/src/dom/utils/notifications.js +218 -0
- package/src/dom/utils/permissions.js +107 -0
- package/src/dom/utils/route.js +482 -0
- package/src/dom/utils/ua.js +109 -0
- package/src/dom/utils/webauthn.js +369 -0
- package/src/external/README.md +15 -0
- package/src/io/binary/reader.js +374 -0
- package/src/io/binary/writer.js +351 -0
- package/src/io/calc/adler32.js +94 -0
- package/src/io/calc/bigint.js +276 -0
- package/src/io/calc/crc32.js +111 -0
- package/src/io/calc/easing.js +514 -0
- package/src/io/codec/b64.js +235 -0
- package/src/io/codec/base32.js +147 -0
- package/src/io/codec/base58.js +167 -0
- package/src/io/codec/buffer.js +630 -0
- package/src/io/codec/cbor.js +550 -0
- package/src/io/codec/csv.js +299 -0
- package/src/io/codec/hex.js +129 -0
- package/src/io/codec/mime.js +398 -0
- package/src/io/codec/msgpack.js +491 -0
- package/src/io/codec/url.js +530 -0
- package/src/io/codec/utf8.js +181 -0
- package/src/io/codec/xml.js +428 -0
- package/src/io/compress/bitstream.js +199 -0
- package/src/io/compress/brotli.js +3073 -0
- package/src/io/compress/brotli_dict.bin +432 -0
- package/src/io/compress/brotli_dict.js +356 -0
- package/src/io/compress/brotli_dict_words.js +157 -0
- package/src/io/compress/brotli_frame.js +420 -0
- package/src/io/compress/brotli_shared.js +715 -0
- package/src/io/compress/deflate.js +1432 -0
- package/src/io/compress/gzip.js +406 -0
- package/src/io/compress/huffman.js +322 -0
- package/src/io/compress/lz4.js +451 -0
- package/src/io/compress/lz77.js +408 -0
- package/src/io/compress/lzw.js +332 -0
- package/src/io/compress/zip.js +815 -0
- package/src/io/compress/zlib.js +340 -0
- package/src/io/i18n/i18n.js +236 -0
- package/src/io/math/fixed-point.js +269 -0
- package/src/io/math/geom.js +350 -0
- package/src/io/math/interp.js +263 -0
- package/src/io/math/linalg.js +472 -0
- package/src/io/math/stats.js +339 -0
- package/src/io/structures/btree.js +357 -0
- package/src/io/structures/heap.js +249 -0
- package/src/io/structures/lruCache.js +219 -0
- package/src/io/structures/ringBuffer.js +208 -0
- package/src/io/structures/tree-walker.js +413 -0
- package/src/io/structures/trie.js +219 -0
- package/src/io/sync/abort.js +196 -0
- package/src/io/sync/atomics.js +342 -0
- package/src/io/sync/cancellable.js +279 -0
- package/src/io/sync/channel.js +301 -0
- package/src/io/sync/mutex.js +148 -0
- package/src/io/sync/semaphore.js +156 -0
- package/src/io/sync/tokenBucket.js +208 -0
- package/src/io/text/ansi.js +536 -0
- package/src/io/text/html-entities.js +143 -0
- package/src/io/text/semver.js +375 -0
- package/src/io/text/str.js +243 -0
- package/src/io/text/unicode.js +188 -0
- package/src/io/time/date.js +355 -0
- package/src/io/timing/clock.js +79 -0
- package/src/io/timing/rateLimit.js +264 -0
- package/src/io/timing/scheduler.js +351 -0
- package/src/io/utils/bitmap.js +94 -0
- package/src/io/utils/errors.js +269 -0
- package/src/io/utils/eventBus.js +315 -0
- package/src/io/utils/queue.js +223 -0
- package/src/io/utils/signal.js +858 -0
- package/src/io/utils/ui8.js +99 -0
- package/src/io/utils/valid.js +556 -0
- package/src/main.js +41 -0
- package/src/polyfill/README.md +9 -0
- package/src/process/message.js +257 -0
- package/src/process/rpc.js +286 -0
- package/src/process/workerPool.js +392 -0
- package/src/sanity/base.js +374 -0
- package/src/sanity/community.js +254 -0
- package/src/sanity/lockdown-apply.js +58 -0
- package/src/sanity/lockdown.js +408 -0
- package/src/sanity/wasm-gate.js +316 -0
- package/src/typed.js +53 -0
- package/third-party/NOTICE-penner-easing +88 -0
- package/third-party/NOTICE-sjcl +50 -0
- package/tools/_lib/cli-help.js +55 -0
- package/tools/rendering/aot/index.js +148 -0
- package/tools/rendering/aot/lib/dom-codegen.js +295 -0
- package/tools/rendering/jsx/index.js +654 -0
- package/tools/rendering/precompilation/index.js +368 -0
- package/types/registry.generated.d.ts +217 -0
- package/types/typed.d.ts +106 -0
|
@@ -0,0 +1,546 @@
|
|
|
1
|
+
---
|
|
2
|
+
module: uiSession
|
|
3
|
+
category: dom/rendering
|
|
4
|
+
dependencies: [uiSessionCore, uiSessionDirect, uiSessionList]
|
|
5
|
+
returns: function (factory)
|
|
6
|
+
worker-safe: false
|
|
7
|
+
status: complete
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# uiSession
|
|
11
|
+
|
|
12
|
+
> High-level facade over the parser→render→template+dom pipeline. Block-oriented API.
|
|
13
|
+
|
|
14
|
+
**Module** `uiSession` | **Source** `packages/front/fw/src/dom/rendering/uiSession.js` | **Deps** `uiSessionCore`, `uiSessionDirect`, `uiSessionList` | **Worker-safe** no
|
|
15
|
+
|
|
16
|
+
> `uiSession` is a **glue facade** that composes three sibling modules: `uiSessionCore` (lifecycle, mount/portals), `uiSessionDirect` (`text`/`attr`/`on`/`bind` mutators), `uiSessionList` (`UIList` class + `list()` factory). The actual pipeline consumers (`parser`, `render`, `template`, `dom`) are dependencies of the three sub-modules, not of `uiSession` directly.
|
|
17
|
+
|
|
18
|
+
## Resolve
|
|
19
|
+
|
|
20
|
+
```js
|
|
21
|
+
const uiSession = runtime.resolve('uiSession');
|
|
22
|
+
// Returns: function(containerName) → UISession
|
|
23
|
+
|
|
24
|
+
const ui = uiSession('myContext');
|
|
25
|
+
// 'myContext' must already exist (created via tpl.init)
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Prerequisites
|
|
29
|
+
|
|
30
|
+
`template.init` must have been called **before** creating the session:
|
|
31
|
+
|
|
32
|
+
```js
|
|
33
|
+
const tpl = runtime.resolve('template');
|
|
34
|
+
tpl.init('content', { to: '#app' });
|
|
35
|
+
|
|
36
|
+
const ui = uiSession('content');
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## API — UISession
|
|
40
|
+
|
|
41
|
+
All mutating methods return `this` (chainable).
|
|
42
|
+
|
|
43
|
+
### `ui.parse(htmlString)` → ParseResult
|
|
44
|
+
|
|
45
|
+
Shortcut for `parser.fromHTML(html)`.
|
|
46
|
+
|
|
47
|
+
```js
|
|
48
|
+
const block = ui.parse('<div><h1>#{title}</h1>${slot}</div>');
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
### `ui.add(items[])` → this
|
|
54
|
+
|
|
55
|
+
Renders and inserts blocks into the context.
|
|
56
|
+
|
|
57
|
+
```js
|
|
58
|
+
ui.add([{
|
|
59
|
+
id: 'main', // logical identifier of the block
|
|
60
|
+
block: parsedBlock, // ParseResult from ui.parse()
|
|
61
|
+
data: { title: 'Hello' } // variables to bind
|
|
62
|
+
}]);
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
#### Typedef: RenderItem
|
|
66
|
+
|
|
67
|
+
```js
|
|
68
|
+
{
|
|
69
|
+
id?: string, // logical identifier (for get/remove/move)
|
|
70
|
+
block?: ParseResult, // result of ui.parse()
|
|
71
|
+
template?: ElmNode[], // alternative: direct elm-array
|
|
72
|
+
data?: Object|Object[], // bindings; array → iterative render (loop)
|
|
73
|
+
attach?: { // attach into a slot of another block
|
|
74
|
+
elm: string, // blockId of the parent
|
|
75
|
+
name: string // name of the slot ${name}
|
|
76
|
+
},
|
|
77
|
+
prepend?: boolean // insert before existing children
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
### `ui.append(items[])` → this
|
|
84
|
+
|
|
85
|
+
Alias for `add` — semantically explicit for appending.
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
### `ui.prepend(items[])` → this
|
|
90
|
+
|
|
91
|
+
Inserts blocks **before** existing content.
|
|
92
|
+
|
|
93
|
+
```js
|
|
94
|
+
ui.prepend([{ id: 'banner', block: b, data: { msg: 'Header' } }]);
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
### `ui.hydrate(items[], opts?)` → this
|
|
100
|
+
|
|
101
|
+
Adopts **already-present** DOM (rendered by `render.toHTML` server-side) instead of materialising new nodes. Walks the session container subtree, finds each `[data-fw-id="<prefix>:<elm.id>"]`, and registers it in `_map` / `_attach` exactly as `ui.add` would have done.
|
|
102
|
+
|
|
103
|
+
```js
|
|
104
|
+
ui.hydrate(
|
|
105
|
+
[
|
|
106
|
+
{ id: 'layout', block: layoutTpl, data: { title: 'Page' } },
|
|
107
|
+
{ id: 'body', attach: { elm: 'layout', name: 'body' },
|
|
108
|
+
block: bodyTpl, data: { txt: 'inside' } },
|
|
109
|
+
],
|
|
110
|
+
{ idPrefix: 'app' },
|
|
111
|
+
);
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
| Option | Description |
|
|
115
|
+
|---|---|
|
|
116
|
+
| `idPrefix` | Must match the `idPrefix` passed to `render.toHTML`. Without it, defaults to `''`. |
|
|
117
|
+
|
|
118
|
+
**Guarantees**:
|
|
119
|
+
- DOM elements are **reused** (same references). `ui.get(blockId, lid)` returns the server-rendered node.
|
|
120
|
+
- All subsequent operations (`ui.text/attr/on/list/clear/remove/...`) work normally.
|
|
121
|
+
- `ui.clear(blockId)` removes the block from the DOM with its usual cascade.
|
|
122
|
+
- Throws with an explicit message if an expected `data-fw-id` is missing (template ↔ SSR HTML mismatch).
|
|
123
|
+
|
|
124
|
+
**v1 limitations**:
|
|
125
|
+
- Iterate blocks (`<!-- $name -->`) are not auto-reconnected to a `ui.list`. The wrapper is adopted, but to react to the array, call `ui.list(parent, slot, …).sync(items)` after hydrate.
|
|
126
|
+
- No listeners are re-attached automatically — the consumer must call `ui.on(...)` after hydrate (typically in the component `mount` hook).
|
|
127
|
+
|
|
128
|
+
See also [guide rendering-pipeline](../../../guide/rendering-pipeline.md) for the SSR round-trip flow.
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
### `ui.replace(blockId, items[])` → this
|
|
133
|
+
|
|
134
|
+
Clears a block and replaces it with new items.
|
|
135
|
+
|
|
136
|
+
```js
|
|
137
|
+
ui.replace('main', [{ id: 'main', block: newBlock, data: newData }]);
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
### `ui.get(blockId, logicalId?)` → Element | null
|
|
143
|
+
|
|
144
|
+
Retrieves a DOM node by logical identifiers.
|
|
145
|
+
|
|
146
|
+
```js
|
|
147
|
+
const rootNode = ui.get('main'); // root node of the 'main' block
|
|
148
|
+
const h1Node = ui.get('main', 'title'); // element with HTML id 'title' in the block
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
**Root resolution (1-arg)**: `ui.get(blockId)` first tries a logical id equal to the blockId (case where the template has an `id="X"` matching the caller's `add({id:'X', …})`). Otherwise it returns the **first element** of the block-map (render order: parent before children → that is the block root).
|
|
152
|
+
|
|
153
|
+
**Iterative blocks** (rendered via `add({data: <array>})`): returns `null` — there is no single root for N iterations. Use `template.get` directly to address items from a loop.
|
|
154
|
+
|
|
155
|
+
#### Slots vs attach — vocabulary
|
|
156
|
+
|
|
157
|
+
- **Slot** (`${name}` in the HTML template): declares a zone in the parent template that can receive attached content. One zone, one name.
|
|
158
|
+
- **Attach** (`attach: {elm, name}` in a `RenderItem`): specifies where a child block is inserted — into the slot `name` of the block `elm` in the session.
|
|
159
|
+
|
|
160
|
+
Both concepts coexist: the parent template **declares** slots, and children **attach** into them via their `attach.name`.
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
### `ui.query(blockId, logicalId, selector)` → Element | null
|
|
165
|
+
|
|
166
|
+
Searches for a CSS descendant within an element.
|
|
167
|
+
|
|
168
|
+
```js
|
|
169
|
+
const btn = ui.query('panel', 'form', 'button.submit');
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
### `ui.queryAll(blockId, logicalId, selector)` → NodeList | []
|
|
175
|
+
|
|
176
|
+
Searches for all CSS descendants.
|
|
177
|
+
|
|
178
|
+
```js
|
|
179
|
+
const items = ui.queryAll('list', 'ul', 'li');
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
184
|
+
### `ui.remove(blockId, logicalId)` → this
|
|
185
|
+
|
|
186
|
+
Removes an element and its children from the DOM and the session.
|
|
187
|
+
|
|
188
|
+
```js
|
|
189
|
+
ui.remove('main', 'subtitle');
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
### `ui.clear(blockId?, logicalId?)` → this
|
|
195
|
+
|
|
196
|
+
Overloads:
|
|
197
|
+
- `clear()` → full context reset
|
|
198
|
+
- `clear(blockId)` → removes all elements of the block
|
|
199
|
+
- `clear(blockId, logicalId)` → removes the **children** of the element (keeps the element)
|
|
200
|
+
|
|
201
|
+
```js
|
|
202
|
+
ui.clear(); // full reset
|
|
203
|
+
ui.clear('main'); // clears the entire 'main' block
|
|
204
|
+
ui.clear('main', 'ul'); // clears children of 'ul' (keeps 'ul')
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
### `ui.text(blockId, logicalId, value)` → this
|
|
210
|
+
|
|
211
|
+
Updates the `textContent` of a logical element. No-op if not found.
|
|
212
|
+
|
|
213
|
+
```js
|
|
214
|
+
ui.text('header', 'title', 'New title');
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
---
|
|
218
|
+
|
|
219
|
+
### `ui.attr(blockId, logicalId, name, value)` → this
|
|
220
|
+
|
|
221
|
+
Updates an attribute. If `value` is `null`, `false`, or `undefined`, the attribute is **removed** (consistent with conditional attributes in `template`).
|
|
222
|
+
|
|
223
|
+
```js
|
|
224
|
+
ui.attr('panel', 'btn', 'disabled', isLoading ? '' : null);
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
---
|
|
228
|
+
|
|
229
|
+
### `ui.on(blockId, logicalId, type, fn, name?, options?)` → string | null
|
|
230
|
+
|
|
231
|
+
Registers a **managed** listener bound to the logical element. The listener is tracked internally and automatically removed when the block/element is removed via `remove`, `clear`, or `replace`. Returns the listener name (auto-generated if not provided) to allow a manual `ui.off(name)`; returns `null` if the element is not found.
|
|
232
|
+
|
|
233
|
+
```js
|
|
234
|
+
ui.on('viewer', 'closeBtn', 'click', () => ui.remove('viewer'));
|
|
235
|
+
// listener automatically removed when `ui.remove('viewer')` is called
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
---
|
|
239
|
+
|
|
240
|
+
### `ui.off(name)` → this
|
|
241
|
+
|
|
242
|
+
Removes a managed listener by its name.
|
|
243
|
+
|
|
244
|
+
---
|
|
245
|
+
|
|
246
|
+
### `ui.exists(blockId, logicalId?)` → boolean
|
|
247
|
+
|
|
248
|
+
Checks whether a block (or a logical element within a block) exists in the session.
|
|
249
|
+
|
|
250
|
+
```js
|
|
251
|
+
if (ui.exists('modal')) ui.remove('modal');
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
---
|
|
255
|
+
|
|
256
|
+
### `ui.list(parentBlockId, slotName, options)` → UIList
|
|
257
|
+
|
|
258
|
+
Creates an **incremental keyed list** controller mounted in the `${slotName}` slot of an already-rendered block. Each item becomes its own addressable uiSession sub-block by the caller's key — so all session APIs (`text`, `attr`, `on`, `remove`, `move`) work per item.
|
|
259
|
+
|
|
260
|
+
```js
|
|
261
|
+
const list = ui.list('parent', 'items', {
|
|
262
|
+
keyFn: item => item.id, // required — stable key extractor
|
|
263
|
+
block: ui.parse('<li>#{text}</li>'), // required — item ParseResult
|
|
264
|
+
eqFn: Object.is, // optional — skip update if true (default Object.is)
|
|
265
|
+
onMount: (key, item) => {…}, // optional — called after each mount
|
|
266
|
+
onUpdate: 'replace' | 'patch' | 'none' | fn, // update mode (default 'replace')
|
|
267
|
+
dataFn: item => bindings, // optional — DOM-bound data extraction
|
|
268
|
+
metaFn: item => meta, // optional — side data (not DOM)
|
|
269
|
+
});
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
`ui.list` is **idempotent** by `(parentBlockId, slotName)`: a second call on the same pair returns the same instance, **and the options may be omitted**:
|
|
273
|
+
|
|
274
|
+
```js
|
|
275
|
+
// First call: options required (at least keyFn + block)
|
|
276
|
+
ui.list('parent', 'items', { keyFn: x => x.id, block: TPL.item, onUpdate: 'patch' });
|
|
277
|
+
|
|
278
|
+
// Subsequent calls: options optional, the already-created instance is returned
|
|
279
|
+
const list = ui.list('parent', 'items');
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
Options from subsequent calls are **ignored** except `block`, which must be the same `ParseResult` reference (otherwise throws — the template structure cannot change during a list's lifetime). Callbacks (`keyFn`, `dataFn`, `metaFn`, `eqFn`, `onUpdate`, `onMount`, `onRemove`) remain those fixed at creation — they are generally inline arrows recreated on each call and must not be compared by reference. To change an option, remove the parent via `ui.clear(parent)` and rebuild.
|
|
283
|
+
|
|
284
|
+
When the parent block is removed via `ui.clear(parentBlockId)` or `ui.remove(parentBlockId, …)`, the list is **auto-disposed**: any subsequent operation throws with an explicit message.
|
|
285
|
+
|
|
286
|
+
#### Controller API
|
|
287
|
+
|
|
288
|
+
| Method | Behaviour |
|
|
289
|
+
|---|---|
|
|
290
|
+
| `list.sync(items)` | Reconciles with a complete dataset. Returns `{added, kept, updated, removed, reordered}` (Sets of keys + boolean). Unchanged items keep their DOM node. |
|
|
291
|
+
| `list.adopt(items, { idPrefix? })` | **SSR only**: adopts rows already rendered server-side (cf. `render.toHTML` with `iterates`) without DOM rebuild. Must be called on an empty list, right after `ui.hydrate`. See [SSR section](#ssr-adopting-server-side-rendered-rows). |
|
|
292
|
+
| `list.push(item)` | Appends; throws if key already present. |
|
|
293
|
+
| `list.prepend(item)` | Inserts at head; throws on duplicate. |
|
|
294
|
+
| `list.insert(item, beforeKey?)` | Inserts before `beforeKey`, or appends if `beforeKey` is absent/unknown. |
|
|
295
|
+
| `list.upsert(item)` | Inserts or replaces; returns `'added'` \| `'updated'` \| `'unchanged'`. |
|
|
296
|
+
| `list.update(key, item)` | Strict update: throws if the key is absent. Returns `'updated'` \| `'unchanged'`. |
|
|
297
|
+
| `list.remove(key)` | Removes the item; releases DOM + managed listeners. Returns `boolean`. |
|
|
298
|
+
| `list.move(key, beforeKey?)` | Moves without recreating the DOM. |
|
|
299
|
+
| `list.clear()` | Clears the list. |
|
|
300
|
+
| `list.has(key)` / `list.get(key)` | Lookup. |
|
|
301
|
+
| `list.meta(key)` | Lookup of meta data (if `metaFn` provided). |
|
|
302
|
+
| `list.keys()` / `list.entries()` | Ordered iteration. |
|
|
303
|
+
| `list.element(key)` | Root DOM element of the item, or `null`. |
|
|
304
|
+
| `list.itemId(key)` | Internal uiSession block identifier of the item. |
|
|
305
|
+
| `list.attr(key, name, value)` or `list.attr(key, logicalId, name, value)` | Proxy of `ui.attr` by key. |
|
|
306
|
+
| `list.text(key, value)` or `list.text(key, logicalId, value)` | Proxy of `ui.text` by key. |
|
|
307
|
+
| `list.on(key, type, fn, name?)` or `list.on(key, logicalId, type, fn, name?)` | Proxy of `ui.on` by key. |
|
|
308
|
+
| `list.query(key, selector)` / `list.queryAll(key, selector)` | CSS search within an item's subtree. |
|
|
309
|
+
| `list.size` | Getter `number`. |
|
|
310
|
+
|
|
311
|
+
#### Update modes (`onUpdate`)
|
|
312
|
+
|
|
313
|
+
| Mode | Behaviour |
|
|
314
|
+
|---|---|
|
|
315
|
+
| `'replace'` (default) | `clear+add` of the item block — fresh DOM, managed listeners recreated. |
|
|
316
|
+
| `'patch'` | Re-binds `#{var}` and parameterised attrs on existing nodes via `render.applyParsedElm`. Stable DOM (focus, selection, transitions, listeners preserved). **Automatic fallback to `'replace'` if the item block contains iterates** (`<!-- $name -->`) that cannot be patched. |
|
|
317
|
+
| `'none'` | No DOM change on update — the list updates its bookkeeping (`get`, `meta`) but the caller must apply changes via `list.attr`/`list.text` if desired. |
|
|
318
|
+
| Function `(key, oldItem, newItem, controller) => 'patched' \| 'replaced' \| 'unchanged'` | Custom strategy. Must return one of the three labels; used in the `sync` delta. |
|
|
319
|
+
|
|
320
|
+
#### `dataFn` / `metaFn`
|
|
321
|
+
|
|
322
|
+
```js
|
|
323
|
+
ui.list(parent, slot, {
|
|
324
|
+
keyFn: item => item.id,
|
|
325
|
+
block: itemBlock,
|
|
326
|
+
dataFn: item => ({ label: item.label, href: '#/' + item.id }), // DOM bindings
|
|
327
|
+
metaFn: item => item.rawSource, // off-DOM
|
|
328
|
+
});
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
- `dataFn(item)`: if provided, its result is what is passed to the parser/render pipeline (for `#{...}`). Otherwise, the item itself is used. Allows keeping `item` as raw business data without polluting the DOM with unbound fields.
|
|
332
|
+
- `metaFn(item)`: if provided, its result is stored separately and accessible via `list.meta(key)`. No influence on the DOM. Typical use: reference to a sub-tree for recursion after `sync`.
|
|
333
|
+
|
|
334
|
+
#### Hooks `onMount` / `onRemove`
|
|
335
|
+
|
|
336
|
+
```js
|
|
337
|
+
ui.list(parent, slot, {
|
|
338
|
+
keyFn, block,
|
|
339
|
+
onMount: (key, item) => { /* item mounted */ },
|
|
340
|
+
onRemove: (key, item) => { /* before DOM removal — app cleanup */ },
|
|
341
|
+
});
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
- `onMount(key, item)`: called after the DOM insertion of an item (`push`, `prepend`, `insert`, additions via `sync`/`upsert`).
|
|
345
|
+
- `onRemove(key, item)`: called **before** the item's DOM disappears (`remove`, removal via `sync`, `clear`). Ideal for cancelling in-flight fetches, detaching external observers, stopping animations.
|
|
346
|
+
|
|
347
|
+
#### Diff semantics (`sync`)
|
|
348
|
+
|
|
349
|
+
For each `sync(items)` call:
|
|
350
|
+
|
|
351
|
+
1. **Remove**: every key present before and absent after → `ui.clear(itemId)` (releases DOM + managed listeners).
|
|
352
|
+
2. **Add**: every new key → mount at the end (will be reordered in phase 3).
|
|
353
|
+
3. **Update**: key present and `eqFn(old, new) === false` → `clear+add` of the item block (re-render), unless `onUpdate` is `'patch'`/`'none'`/a custom function — see [Update modes](#update-modes-onupdate). Otherwise, no change.
|
|
354
|
+
4. **Reorder**: `dom.reorder` reorders existing nodes with minimal moves whenever the current key order differs from `newKeys`, **or** whenever phase 3 replaced at least one item (a `'replace'`d row is a fresh DOM node freshly mounted at the slot's end, regardless of its position in the key sequence — the key-sequence diff alone can't see that the row moved). `delta.reordered` reflects whichever condition fired.
|
|
355
|
+
|
|
356
|
+
`upsert(item)` and `update(key, item)` apply the same rule for a single key: a `'replaced'` outcome from `_replaceItem` restores the row's position via the same reorder pass, even though the key's index in the list didn't change. A `'patched'` or `'unchanged'` outcome never moves the node, so no reorder runs for it.
|
|
357
|
+
|
|
358
|
+
With `eqFn = Object.is` (default), passing the **same reference** in `sync` skips the replace and fully preserves the DOM (focus, selection, scroll, CSS transitions). With an immutable dataset where each render reconstructs objects, passing a custom `eqFn` (`(a,b) => a.text === b.text && a.flag === b.flag`) restores this gain.
|
|
359
|
+
|
|
360
|
+
#### Prerequisite: slot in the parent template
|
|
361
|
+
|
|
362
|
+
```js
|
|
363
|
+
const parent = ui.parse('<div>${items}</div>'); // slot "items"
|
|
364
|
+
ui.add([{ id: 'parent', block: parent, data: {} }]);
|
|
365
|
+
const list = ui.list('parent', 'items', { … }); // OK
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
The slot can be a text slot (`${name}`). If the parent block has no slot named `slotName`, **the first `push`/`sync` throws** with an explicit message.
|
|
369
|
+
|
|
370
|
+
#### Edge cases
|
|
371
|
+
|
|
372
|
+
| Case | Behaviour |
|
|
373
|
+
|---|---|
|
|
374
|
+
| `keyFn` returns `null`/`undefined` | throws `keyFn returned null/undefined` |
|
|
375
|
+
| Duplicate key in `sync(items)` or `push` | throws `duplicate key '…'` |
|
|
376
|
+
| `remove(key)` on absent key | returns `false` (no-op) |
|
|
377
|
+
| `insert(item, beforeKey)` with `beforeKey` not found | appends (fallback) |
|
|
378
|
+
| Non-existent parent slot | throws `slot '…' not resolved on block '…'` |
|
|
379
|
+
|
|
380
|
+
#### Example — live filter
|
|
381
|
+
|
|
382
|
+
```js
|
|
383
|
+
const all = [{id:'a',text:'Alpha'}, {id:'b',text:'Beta'}, {id:'c',text:'Gamma'}];
|
|
384
|
+
const list = ui.list('panel', 'rows', {
|
|
385
|
+
keyFn: x => x.id,
|
|
386
|
+
block: ui.parse('<li id="row"><a id="lnk">#{text}</a></li>'),
|
|
387
|
+
});
|
|
388
|
+
list.sync(all);
|
|
389
|
+
|
|
390
|
+
// Filter input → re-sync the visible subset.
|
|
391
|
+
input.addEventListener('input', () => {
|
|
392
|
+
const q = input.value.toLowerCase();
|
|
393
|
+
list.sync(all.filter(x => x.text.toLowerCase().includes(q)));
|
|
394
|
+
});
|
|
395
|
+
// → only new items create DOM; those still visible keep their node
|
|
396
|
+
// (stable focus on the filter input).
|
|
397
|
+
```
|
|
398
|
+
|
|
399
|
+
#### SSR: adopting server-side rendered rows
|
|
400
|
+
|
|
401
|
+
When the server has already rendered the list via `render.toHTML(tpl, vars, { iterates: { rows: initialRows }, idPrefix })`, the HTML received by the client already contains the final `<li>` elements. `ui.hydrate` adopts the parent block but **does not adopt** the iterate rows (their parser IDs collide between rows — this is expected). To reuse them without rebuilding:
|
|
402
|
+
|
|
403
|
+
```js
|
|
404
|
+
// 1. Hydrate the parent block (the <ul>, not the <li>).
|
|
405
|
+
ui.hydrate(
|
|
406
|
+
[{ id: 'panel', block: panelTpl, data: vars }],
|
|
407
|
+
{ idPrefix: 'app' }
|
|
408
|
+
);
|
|
409
|
+
|
|
410
|
+
// 2. Create the list and pass it the initial snapshot.
|
|
411
|
+
const list = ui.list('panel', 'rows', {
|
|
412
|
+
keyFn: r => r.id,
|
|
413
|
+
block: rowTpl,
|
|
414
|
+
// Important: a content-aware eqFn; otherwise Object.is rejects subsequent
|
|
415
|
+
// re-fetches (new objects == "modified") and `sync` rebuilds every row.
|
|
416
|
+
eqFn: (a, b) => a.id === b.id && a.text === b.text,
|
|
417
|
+
});
|
|
418
|
+
list.adopt(initialRows, { idPrefix: 'app' });
|
|
419
|
+
// → list.size === initialRows.length, no DOM mutation,
|
|
420
|
+
// the SSR <li> elements are now under the list's control.
|
|
421
|
+
|
|
422
|
+
// 3. Later, incremental syncs reuse SSR nodes
|
|
423
|
+
// for unchanged items (focus / scroll / transitions preserved).
|
|
424
|
+
list.sync(await fetchRows());
|
|
425
|
+
```
|
|
426
|
+
|
|
427
|
+
Constraints:
|
|
428
|
+
- The sub-template (`block`) must have **a single root** (standard case: a `<li>`, a `<tr>`). Multi-root → throws; recreate via `sync` instead.
|
|
429
|
+
- The slot must contain **exactly** `items.length` child elements. Any client/server mismatch → throws with a clear message.
|
|
430
|
+
- `list.adopt` must be called on an **empty** list (no prior `push`). Throws otherwise.
|
|
431
|
+
- `onMount(key, item)` hooks are fired for each row; `onEnter` is intentionally **skipped** (the DOM is already visible — replaying the enter animation would be incoherent).
|
|
432
|
+
|
|
433
|
+
---
|
|
434
|
+
|
|
435
|
+
### `ui.move(blockId, logicalId, targetBlockId, targetLogicalId)` → this
|
|
436
|
+
|
|
437
|
+
Moves an element to a new parent.
|
|
438
|
+
|
|
439
|
+
```js
|
|
440
|
+
ui.move('left', 'item', 'right', 'container');
|
|
441
|
+
```
|
|
442
|
+
|
|
443
|
+
---
|
|
444
|
+
|
|
445
|
+
### `ui.onUnmount(blockId, fn)` → this
|
|
446
|
+
|
|
447
|
+
Registers a **pre-removal** hook on a block. The hook is invoked **just before** the block's DOM disappears (via `remove`, `clear(blockId)`, `replace`, or global `clear()`). Ideal for application cleanup tied to a block's lifecycle:
|
|
448
|
+
|
|
449
|
+
```js
|
|
450
|
+
const controller = new AbortController();
|
|
451
|
+
ui.add([{ id: 'feed', block: feedTpl, data: {} }]);
|
|
452
|
+
fetch('/stream', { signal: controller.signal });
|
|
453
|
+
ui.onUnmount('feed', () => controller.abort());
|
|
454
|
+
```
|
|
455
|
+
|
|
456
|
+
Typical use cases:
|
|
457
|
+
- Cancel an in-flight `fetch`/`AbortController`
|
|
458
|
+
- Detach an IntersectionObserver / ResizeObserver
|
|
459
|
+
- Stop an active `setInterval`/`requestAnimationFrame`
|
|
460
|
+
- Close a WebSocket / SSE connection bound to the block
|
|
461
|
+
|
|
462
|
+
Guarantees:
|
|
463
|
+
- **One hook per blockId** — re-registering replaces the previous one.
|
|
464
|
+
- **One-shot hook** — automatically removed after invocation (no manual cleanup needed).
|
|
465
|
+
- **Errors swallowed** — any exception thrown in the hook is silently ignored. The unmount flow cannot be broken by a consumer bug.
|
|
466
|
+
- **DOM still mounted** at invocation — the hook may call `ui.get(blockId)` or inspect attributes.
|
|
467
|
+
- Passing `null`/`undefined` as `fn` removes the hook without triggering it.
|
|
468
|
+
|
|
469
|
+
For individual **list** items, see `ui.list(parent, slot, { onRemove })` which covers the same need per item.
|
|
470
|
+
|
|
471
|
+
## Examples
|
|
472
|
+
|
|
473
|
+
### Basic example
|
|
474
|
+
|
|
475
|
+
```js
|
|
476
|
+
import fw from './fw/main.js';
|
|
477
|
+
const { runtime, domReady } = fw;
|
|
478
|
+
|
|
479
|
+
domReady.loaded(() => {
|
|
480
|
+
const tpl = runtime.resolve('template');
|
|
481
|
+
const uiSession = runtime.resolve('uiSession');
|
|
482
|
+
const dom = runtime.resolve('dom');
|
|
483
|
+
|
|
484
|
+
tpl.init('app', { to: '#root' });
|
|
485
|
+
const ui = uiSession('app');
|
|
486
|
+
|
|
487
|
+
const b = ui.parse('<div><h1>#{title}</h1><p>#{body}</p></div>');
|
|
488
|
+
|
|
489
|
+
ui.add([{ id: 'content', block: b, data: { title: 'Hello', body: 'World' } }]);
|
|
490
|
+
|
|
491
|
+
// Access the DOM
|
|
492
|
+
dom.style(ui.get('content', 'title'), 'color', 'blue');
|
|
493
|
+
});
|
|
494
|
+
```
|
|
495
|
+
|
|
496
|
+
### Slots and attachment
|
|
497
|
+
|
|
498
|
+
```js
|
|
499
|
+
const layout = ui.parse(`<div class="layout"><main>${'$'}main</main><aside>${'$'}sidebar</aside></div>`);
|
|
500
|
+
const widget = ui.parse('<p>#{text}</p>');
|
|
501
|
+
|
|
502
|
+
ui.add([{ id: 'layout', block: layout, data: {} }]);
|
|
503
|
+
ui.add([
|
|
504
|
+
{ id: 'main', attach: { elm: 'layout', name: 'main' }, block: widget, data: { text: 'Main content' } },
|
|
505
|
+
{ id: 'sidebar', attach: { elm: 'layout', name: 'sidebar' }, block: widget, data: { text: 'Sidebar' } }
|
|
506
|
+
]);
|
|
507
|
+
```
|
|
508
|
+
|
|
509
|
+
### Iterative render (array data → loop)
|
|
510
|
+
|
|
511
|
+
```js
|
|
512
|
+
const listBlock = ui.parse(`
|
|
513
|
+
<ul>
|
|
514
|
+
<!-- $item -->
|
|
515
|
+
<li class="#{cls}">#{text}</li>
|
|
516
|
+
<!-- item$ -->
|
|
517
|
+
</ul>
|
|
518
|
+
`);
|
|
519
|
+
|
|
520
|
+
ui.add([
|
|
521
|
+
{ id: 'list', block: listBlock, data: { cls: 'wrapper' } },
|
|
522
|
+
{
|
|
523
|
+
attach: { elm: 'list', name: 'item' },
|
|
524
|
+
block: listBlock,
|
|
525
|
+
data: [
|
|
526
|
+
{ text: 'First', cls: 'first' },
|
|
527
|
+
{ text: 'Second', cls: '' },
|
|
528
|
+
{ text: 'Third', cls: 'last' }
|
|
529
|
+
]
|
|
530
|
+
}
|
|
531
|
+
]);
|
|
532
|
+
```
|
|
533
|
+
|
|
534
|
+
## Notes
|
|
535
|
+
|
|
536
|
+
- The logical `id` in `add` is optional — without `id`, the block cannot be targeted by `get/remove/move`.
|
|
537
|
+
- The `logicalId → realId` translation is internal to the session — DOM IDs are not guaranteed stable between renders.
|
|
538
|
+
- `get(blockId)` without `logicalId` returns the root element of the block.
|
|
539
|
+
- `uiSession` wraps an existing `template` context — it does not create its own context.
|
|
540
|
+
- **Implementation**: `uiSession.js` composes three internal mixins (`uiSession-core.js` — state and base methods, `uiSession-direct.js` — `add`/`remove`/`text`/`attr`/`on`, `uiSession-list.js` — `UIList` controller). These files are implementation details not documented separately.
|
|
541
|
+
|
|
542
|
+
## See also
|
|
543
|
+
|
|
544
|
+
- [parser](./parser.md), [render](./render.md), [template](./template.md)
|
|
545
|
+
- [dom](../query/dom.md) — used by `query` / `queryAll`
|
|
546
|
+
- [Guide pipeline](../../../guide/rendering-pipeline.md)
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
---
|
|
2
|
+
module: virtualScroll
|
|
3
|
+
category: dom/rendering
|
|
4
|
+
dependencies: [dom, events]
|
|
5
|
+
returns: object
|
|
6
|
+
worker-safe: false
|
|
7
|
+
status: complete
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# virtualScroll
|
|
11
|
+
|
|
12
|
+
> Virtualised list — renders only visible items for 10⁴–10⁶ entries.
|
|
13
|
+
|
|
14
|
+
**Module** `virtualScroll` | **Source** `packages/front/fw/src/dom/rendering/virtualScroll.js` | **Deps** `dom`, `events` | **Worker-safe** no
|
|
15
|
+
|
|
16
|
+
Virtualises the rendering of a long list: only items within the visible window plus a configurable overscan are materialised in the DOM. The rest is represented by a CSS spacer of calculated height, avoiding any memory cost for off-screen nodes.
|
|
17
|
+
|
|
18
|
+
Two height-calculation modes:
|
|
19
|
+
|
|
20
|
+
- **`fixed`** (MVP, default): constant `itemHeight` → range calculated in O(1), no DOM measurements.
|
|
21
|
+
- **`variable`**: heights measured after insertion, cached in `Map<idx, height>`; `setTotal` invalidates the cache beyond the new index.
|
|
22
|
+
|
|
23
|
+
## Resolve
|
|
24
|
+
|
|
25
|
+
```js
|
|
26
|
+
const virtualScroll = runtime.resolve('virtualScroll');
|
|
27
|
+
// Returns: { create }
|
|
28
|
+
const list = virtualScroll.create({ container, itemHeight, total, renderItem });
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## API
|
|
32
|
+
|
|
33
|
+
| Method | Signature | Returns |
|
|
34
|
+
|---------|-----------|---------|
|
|
35
|
+
| `create` | `(opts) => Instance` | Virtualised list instance |
|
|
36
|
+
| `refresh` | `() => void` | Re-renders the visible range |
|
|
37
|
+
| `setTotal` | `(n: number) => void` | Updates total + refresh |
|
|
38
|
+
| `scrollTo` | `(idx: number, opts?: ScrollOpts) => void` | Programmatic scroll |
|
|
39
|
+
| `visibleRange` | `() => {start: number, end: number}` | Current visible indices |
|
|
40
|
+
| `measure` | `(idx: number) => number` | Measured height (variable mode) |
|
|
41
|
+
| `dispose` | `() => void` | Cleans up listeners + DOM |
|
|
42
|
+
|
|
43
|
+
### `create` options
|
|
44
|
+
|
|
45
|
+
| Option | Type | Default | Description |
|
|
46
|
+
|--------|------|--------|-------------|
|
|
47
|
+
| `container` | `Element` | — | Scrollable element (overflow: auto). |
|
|
48
|
+
| `itemHeight` | `number` | — | Item height in px. |
|
|
49
|
+
| `total` | `number` | — | Total number of items. |
|
|
50
|
+
| `renderItem` | `(idx: number) => HTMLElement \| ElmNode[]` | — | Creates a DOM item. |
|
|
51
|
+
| `overscan` | `number` | `3` | Extra items above/below. |
|
|
52
|
+
| `mode` | `'fixed' \| 'variable'` | `'fixed'` | Height-calculation mode. |
|
|
53
|
+
|
|
54
|
+
### `scrollTo` options
|
|
55
|
+
|
|
56
|
+
| Option | Type | Default | Description |
|
|
57
|
+
|--------|------|--------|-------------|
|
|
58
|
+
| `align` | `'start' \| 'center' \| 'end' \| 'auto'` | `'start'` | Target alignment in the viewport. |
|
|
59
|
+
|
|
60
|
+
## Examples
|
|
61
|
+
|
|
62
|
+
### Simple list (fixed mode)
|
|
63
|
+
|
|
64
|
+
```js
|
|
65
|
+
const virtualScroll = runtime.resolve('virtualScroll');
|
|
66
|
+
|
|
67
|
+
const list = virtualScroll.create({
|
|
68
|
+
container: document.getElementById('list'),
|
|
69
|
+
itemHeight: 32,
|
|
70
|
+
total: 50000,
|
|
71
|
+
renderItem(idx) {
|
|
72
|
+
const li = document.createElement('li');
|
|
73
|
+
li.textContent = `Item ${idx}`;
|
|
74
|
+
return li;
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
// Go to item 10000
|
|
79
|
+
list.scrollTo(10000);
|
|
80
|
+
|
|
81
|
+
// Update after loading additional data
|
|
82
|
+
list.setTotal(75000);
|
|
83
|
+
|
|
84
|
+
// Cleanup
|
|
85
|
+
list.dispose();
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Variable mode (measured heights)
|
|
89
|
+
|
|
90
|
+
```js
|
|
91
|
+
const list = virtualScroll.create({
|
|
92
|
+
container: document.getElementById('feed'),
|
|
93
|
+
itemHeight: 60, // default height before measurement
|
|
94
|
+
total: 1000,
|
|
95
|
+
renderItem(idx) {
|
|
96
|
+
const card = document.createElement('article');
|
|
97
|
+
card.className = 'card';
|
|
98
|
+
card.textContent = data[idx].body;
|
|
99
|
+
return card;
|
|
100
|
+
},
|
|
101
|
+
mode: 'variable'
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
// Measured height after rendering
|
|
105
|
+
console.log(list.measure(5)); // actual px of item 5
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### Scroll with centred alignment
|
|
109
|
+
|
|
110
|
+
```js
|
|
111
|
+
list.scrollTo(500, { align: 'center' });
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## Notes
|
|
115
|
+
|
|
116
|
+
- In `fixed` mode, range calculation is O(1) — optimal for homogeneous long lists (TTY scrollback, task manager).
|
|
117
|
+
- In `variable` mode, `getBoundingClientRect()` is called after insertion into the layer; happy-dom does not return real layout, so heights stay at the default in tests.
|
|
118
|
+
- `renderItem` may return an `HTMLElement` or an elm-array (array of elm nodes) — the bridge uses `dom.create` if available, with fallback to the first node of the array.
|
|
119
|
+
- `dispose` removes the spacer and the layer from the container and removes the scroll listener; a second call is a no-op.
|
|
120
|
+
- The scroll listener is registered in `passive` mode to avoid blocking the main thread.
|
|
121
|
+
|
|
122
|
+
## See also
|
|
123
|
+
|
|
124
|
+
- [template](./template.md) — materialises elm-arrays into DOM
|
|
125
|
+
- [uiSession](./uiSession.md) — high-level facade parse+render+template+dom
|
|
126
|
+
- [dom](../query/dom.md) — consistent DOM API
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# DOM / Sensors
|
|
2
|
+
|
|
3
|
+
Sensors and peripherals (not worker-safe — main thread).
|
|
4
|
+
|
|
5
|
+
## Modules
|
|
6
|
+
|
|
7
|
+
| Module | Returns | Deps | Description |
|
|
8
|
+
|--------|----------|------|-------------|
|
|
9
|
+
| [geolocation](./geolocation.md) | `{isSupported, current, watch}` | none | GPS / wifi position |
|
|
10
|
+
| [battery](./battery.md) | `{isSupported, current, watch}` | none | Battery Status API |
|
|
11
|
+
| [networkInfo](./networkInfo.md) | `{isSupported, current, watch}` | none | Network Information API |
|
|
12
|
+
| [sensors](./sensors.md) | `{orientation, motion, gyroscope, accelerometer, requestPermission}` | none | Gyro/accel/orientation |
|