@awacloud/fw 0.1.0 → 1.0.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 +125 -0
- package/NOTICE +8 -0
- package/README.md +163 -31
- package/dist/build/fw.core.pure.meta.json +6 -6
- package/dist/build/fw.core.pure.min.js +15 -12
- package/dist/build/fw.full.pure.meta.json +13 -7
- package/dist/build/fw.full.pure.min.js +45 -42
- package/dist/build/fw.minimal.pure.meta.json +6 -6
- package/dist/build/fw.minimal.pure.min.js +16 -13
- package/dist/build/fw.pack.compress-heavy.pure.meta.json +6 -6
- package/dist/build/fw.pack.compress-heavy.pure.min.js +3 -3
- package/dist/build/fw.pack.crypto-advanced.pure.meta.json +6 -6
- package/dist/build/fw.pack.crypto-advanced.pure.min.js +1 -1
- package/dist/build/fw.pack.crypto-basic.pure.meta.json +6 -6
- package/dist/build/fw.pack.crypto-basic.pure.min.js +1 -1
- package/dist/build/fw.pack.crypto-identity.pure.meta.json +7 -6
- package/dist/build/fw.pack.crypto-identity.pure.min.js +4 -4
- package/dist/build/fw.pwa.pure.meta.json +7 -6
- package/dist/build/fw.pwa.pure.min.js +38 -35
- package/dist/build/fw.site-interactive.pure.meta.json +6 -6
- package/dist/build/fw.site-interactive.pure.min.js +37 -34
- package/dist/build/fw.site.pure.meta.json +6 -6
- package/dist/build/fw.site.pure.min.js +24 -21
- package/dist/build/fw.spa.pure.meta.json +8 -7
- package/dist/build/fw.spa.pure.min.js +41 -38
- package/dist/build/sanity-base-classic.min.js +1 -1
- package/dist/build/sanity.min.js +1 -1
- package/dist/types/core/internal.d.ts +29 -0
- package/dist/types/core/internal.d.ts.map +1 -0
- package/dist/types/core/logger.d.ts +23 -4
- package/dist/types/core/logger.d.ts.map +1 -1
- package/dist/types/core/modules.d.ts +374 -61
- package/dist/types/core/modules.d.ts.map +1 -1
- package/dist/types/core/runtime.d.ts +10 -6
- package/dist/types/core/runtime.d.ts.map +1 -1
- package/dist/types/core/worker-helper.d.ts +35 -0
- package/dist/types/core/worker-helper.d.ts.map +1 -1
- package/dist/types/crypto/cipher/aes.d.ts +1 -7
- package/dist/types/crypto/cipher/aes.d.ts.map +1 -1
- package/dist/types/crypto/cipher/chacha20.d.ts +0 -10
- package/dist/types/crypto/cipher/chacha20.d.ts.map +1 -1
- package/dist/types/crypto/hash/argon2.d.ts +0 -15
- package/dist/types/crypto/hash/argon2.d.ts.map +1 -1
- package/dist/types/crypto/hash/blake2b.d.ts.map +1 -1
- package/dist/types/crypto/hash/hmac.d.ts.map +1 -1
- package/dist/types/crypto/hash/pbkdf2.d.ts.map +1 -1
- package/dist/types/crypto/hash/poly1305.d.ts.map +1 -1
- package/dist/types/crypto/hash/sha224.d.ts +1 -1
- package/dist/types/crypto/hash/sha256.d.ts +4 -13
- package/dist/types/crypto/hash/sha256.d.ts.map +1 -1
- package/dist/types/crypto/hash/sha3.d.ts.map +1 -1
- package/dist/types/crypto/hash/sha384.d.ts +1 -1
- package/dist/types/crypto/hash/sha512.d.ts +4 -13
- package/dist/types/crypto/hash/sha512.d.ts.map +1 -1
- package/dist/types/crypto/mode/cmac.d.ts +0 -6
- package/dist/types/crypto/mode/cmac.d.ts.map +1 -1
- package/dist/types/crypto/mode/ctr.d.ts +0 -6
- package/dist/types/crypto/mode/ctr.d.ts.map +1 -1
- package/dist/types/crypto/mode/gcm.d.ts +0 -9
- package/dist/types/crypto/mode/gcm.d.ts.map +1 -1
- package/dist/types/crypto/pkc/ecc.d.ts +0 -1
- package/dist/types/crypto/pkc/ecc.d.ts.map +1 -1
- package/dist/types/crypto/pkc/ed25519.d.ts +4 -25
- package/dist/types/crypto/pkc/ed25519.d.ts.map +1 -1
- package/dist/types/crypto/pkc/hybridSign.d.ts +25 -5
- package/dist/types/crypto/pkc/hybridSign.d.ts.map +1 -1
- package/dist/types/crypto/pkc/ml_dsa.d.ts +6 -26
- package/dist/types/crypto/pkc/ml_dsa.d.ts.map +1 -1
- package/dist/types/crypto/pkc/ml_kem.d.ts +0 -43
- package/dist/types/crypto/pkc/ml_kem.d.ts.map +1 -1
- package/dist/types/crypto/pkc/rsa.d.ts +0 -24
- package/dist/types/crypto/pkc/rsa.d.ts.map +1 -1
- package/dist/types/crypto/pkc/slh_dsa.d.ts +6 -16
- package/dist/types/crypto/pkc/slh_dsa.d.ts.map +1 -1
- package/dist/types/crypto/pkc/x25519.d.ts +0 -6
- package/dist/types/crypto/pkc/x25519.d.ts.map +1 -1
- package/dist/types/crypto/utils/bitArray.d.ts +0 -8
- package/dist/types/crypto/utils/bitArray.d.ts.map +1 -1
- package/dist/types/crypto/utils/jws.d.ts +6 -14
- package/dist/types/crypto/utils/jws.d.ts.map +1 -1
- package/dist/types/crypto/utils/keyformat.d.ts +52 -0
- package/dist/types/crypto/utils/keyformat.d.ts.map +1 -1
- package/dist/types/crypto/utils/random.d.ts +1 -10
- package/dist/types/crypto/utils/random.d.ts.map +1 -1
- package/dist/types/crypto/utils/rsaKeygen.d.ts +0 -10
- package/dist/types/crypto/utils/rsaKeygen.d.ts.map +1 -1
- package/dist/types/crypto/utils/uuid.d.ts.map +1 -1
- package/dist/types/crypto/utils/x509.d.ts +397 -0
- package/dist/types/crypto/utils/x509.d.ts.map +1 -0
- package/dist/types/crypto/wasm/argon2.d.ts +2 -1
- package/dist/types/crypto/wasm/argon2.d.ts.map +1 -1
- package/dist/types/crypto/wasm/pbkdf2.d.ts +2 -2
- package/dist/types/crypto/wasm/pbkdf2.d.ts.map +1 -1
- package/dist/types/crypto/wasm/rsa.d.ts.map +1 -1
- package/dist/types/crypto/wasm/runtime.d.ts +13 -0
- package/dist/types/crypto/wasm/runtime.d.ts.map +1 -1
- package/dist/types/crypto/webcrypto/aes.d.ts.map +1 -1
- package/dist/types/crypto/webcrypto/aeskw.d.ts.map +1 -1
- package/dist/types/crypto/webcrypto/digest.d.ts +0 -4
- package/dist/types/crypto/webcrypto/digest.d.ts.map +1 -1
- package/dist/types/crypto/webcrypto/rsa.d.ts.map +1 -1
- package/dist/types/dom/fs/fileIntake.d.ts +59 -0
- package/dist/types/dom/fs/fileIntake.d.ts.map +1 -0
- package/dist/types/dom/fs/fsAccess.d.ts.map +1 -1
- package/dist/types/dom/query/dnd.d.ts.map +1 -1
- package/dist/types/dom/query/sound.d.ts +89 -0
- package/dist/types/dom/query/sound.d.ts.map +1 -0
- package/dist/types/dom/rendering/chart.d.ts.map +1 -1
- package/dist/types/dom/rendering/component.d.ts +9 -3
- package/dist/types/dom/rendering/component.d.ts.map +1 -1
- package/dist/types/dom/rendering/parser.d.ts +39 -0
- package/dist/types/dom/rendering/parser.d.ts.map +1 -1
- package/dist/types/dom/rendering/render.d.ts.map +1 -1
- package/dist/types/dom/rendering/sanitize.d.ts +4 -0
- package/dist/types/dom/rendering/sanitize.d.ts.map +1 -1
- package/dist/types/dom/rendering/secPolicy.d.ts.map +1 -1
- package/dist/types/dom/rendering/styleSheet.d.ts +74 -0
- package/dist/types/dom/rendering/styleSheet.d.ts.map +1 -0
- package/dist/types/dom/rendering/template.d.ts +9 -3
- package/dist/types/dom/rendering/template.d.ts.map +1 -1
- package/dist/types/dom/rendering/themeTokens.d.ts +9 -3
- package/dist/types/dom/rendering/themeTokens.d.ts.map +1 -1
- package/dist/types/dom/rendering/uiSession-core.d.ts +9 -3
- package/dist/types/dom/rendering/uiSession-core.d.ts.map +1 -1
- package/dist/types/dom/rendering/uiSession-list.d.ts +9 -3
- package/dist/types/dom/rendering/uiSession-list.d.ts.map +1 -1
- package/dist/types/dom/rendering/uiSession.d.ts +18 -6
- package/dist/types/dom/rendering/uiSession.d.ts.map +1 -1
- package/dist/types/dom/sw/installPrompt.d.ts +89 -0
- package/dist/types/dom/sw/installPrompt.d.ts.map +1 -0
- package/dist/types/dom/sw/precache.d.ts +149 -0
- package/dist/types/dom/sw/precache.d.ts.map +1 -0
- package/dist/types/dom/sw/swUpdate.d.ts +129 -0
- package/dist/types/dom/sw/swUpdate.d.ts.map +1 -0
- package/dist/types/dom/utils/clipboard.d.ts +8 -0
- package/dist/types/dom/utils/clipboard.d.ts.map +1 -1
- package/dist/types/dom/utils/keybindings.d.ts.map +1 -1
- package/dist/types/dom/utils/route.d.ts.map +1 -1
- package/dist/types/dom/utils/ua.d.ts +2 -2
- package/dist/types/dom/utils/ua.d.ts.map +1 -1
- package/dist/types/io/calc/crc32.d.ts.map +1 -1
- package/dist/types/io/codec/b64.d.ts +24 -0
- package/dist/types/io/codec/b64.d.ts.map +1 -1
- package/dist/types/io/codec/cbor.d.ts +1 -0
- package/dist/types/io/codec/cbor.d.ts.map +1 -1
- package/dist/types/io/codec/hex.d.ts.map +1 -1
- package/dist/types/io/codec/msgpack.d.ts +1 -0
- package/dist/types/io/codec/msgpack.d.ts.map +1 -1
- package/dist/types/io/codec/url.d.ts +3 -1
- package/dist/types/io/codec/url.d.ts.map +1 -1
- package/dist/types/io/codec/utf8.d.ts.map +1 -1
- package/dist/types/io/compress/bitstream.d.ts +1 -1
- package/dist/types/io/compress/brotli.d.ts +0 -1
- package/dist/types/io/compress/brotli.d.ts.map +1 -1
- package/dist/types/io/compress/brotli_shared.d.ts +0 -4
- package/dist/types/io/compress/brotli_shared.d.ts.map +1 -1
- package/dist/types/io/compress/deflate.d.ts +14 -1
- package/dist/types/io/compress/deflate.d.ts.map +1 -1
- package/dist/types/io/compress/gzip.d.ts +4 -0
- package/dist/types/io/compress/gzip.d.ts.map +1 -1
- package/dist/types/io/compress/huffman.d.ts +7 -0
- package/dist/types/io/compress/huffman.d.ts.map +1 -1
- package/dist/types/io/compress/lz4.d.ts +4 -2
- package/dist/types/io/compress/lz4.d.ts.map +1 -1
- package/dist/types/io/compress/lz77.d.ts +17 -0
- package/dist/types/io/compress/lz77.d.ts.map +1 -1
- package/dist/types/io/compress/lzw.d.ts +2 -0
- package/dist/types/io/compress/lzw.d.ts.map +1 -1
- package/dist/types/io/compress/zip.d.ts.map +1 -1
- package/dist/types/io/compress/zlib.d.ts +9 -2
- package/dist/types/io/compress/zlib.d.ts.map +1 -1
- package/dist/types/io/math/linalg.d.ts.map +1 -1
- package/dist/types/process/rpc.d.ts.map +1 -1
- package/dist/types/process/workerPool.d.ts.map +1 -1
- package/dist/types/sanity/base.d.ts +12 -2
- package/dist/types/sanity/base.d.ts.map +1 -1
- package/dist/types/sanity/lockdown.d.ts +6 -5
- package/dist/types/sanity/lockdown.d.ts.map +1 -1
- package/dist/types/sanity/wasm-gate.d.ts +1 -1
- package/docs/README.md +17 -10
- package/docs/api/README.md +5 -5
- package/docs/api/core/logger.md +2 -1
- package/docs/api/core/modules.md +3 -3
- package/docs/api/core/runtime.md +9 -9
- package/docs/api/core/worker-helper.md +12 -2
- package/docs/api/crypto/README.md +1 -1
- package/docs/api/crypto/cipher/README.md +2 -2
- package/docs/api/crypto/cipher/aes.md +5 -10
- package/docs/api/crypto/cipher/chacha20.md +3 -8
- package/docs/api/crypto/hash/README.md +5 -5
- package/docs/api/crypto/hash/adf.md +21 -11
- package/docs/api/crypto/hash/argon2.md +3 -12
- package/docs/api/crypto/hash/blake2b.md +12 -14
- package/docs/api/crypto/hash/pbkdf2.md +1 -1
- package/docs/api/crypto/hash/sha224.md +2 -2
- package/docs/api/crypto/hash/sha256.md +4 -4
- package/docs/api/crypto/hash/sha3.md +2 -2
- package/docs/api/crypto/hash/sha384.md +1 -1
- package/docs/api/crypto/hash/sha512.md +5 -5
- package/docs/api/crypto/hash/sha512_224.md +1 -1
- package/docs/api/crypto/hash/sha512_256.md +1 -1
- package/docs/api/crypto/mode/README.md +3 -3
- package/docs/api/crypto/mode/cbc.md +2 -2
- package/docs/api/crypto/mode/chacha20poly1305.md +1 -1
- package/docs/api/crypto/mode/cmac.md +4 -4
- package/docs/api/crypto/mode/ctr.md +2 -3
- package/docs/api/crypto/mode/gcm.md +5 -5
- package/docs/api/crypto/mode/kw.md +4 -4
- package/docs/api/crypto/pkc/README.md +8 -8
- package/docs/api/crypto/pkc/ecc.md +19 -17
- package/docs/api/crypto/pkc/ed25519.md +10 -15
- package/docs/api/crypto/pkc/hybridKem.md +8 -2
- package/docs/api/crypto/pkc/hybridSign.md +34 -7
- package/docs/api/crypto/pkc/ml_dsa.md +20 -19
- package/docs/api/crypto/pkc/ml_kem.md +3 -3
- package/docs/api/crypto/pkc/rsa.md +7 -9
- package/docs/api/crypto/pkc/slh_dsa.md +12 -12
- package/docs/api/crypto/pkc/x25519.md +5 -4
- package/docs/api/crypto/utils/README.md +7 -7
- package/docs/api/crypto/utils/aes_modes.md +2 -5
- package/docs/api/crypto/utils/asn1.md +25 -16
- package/docs/api/crypto/utils/jws.md +6 -4
- package/docs/api/crypto/utils/keyformat.md +24 -15
- package/docs/api/crypto/utils/pad.md +1 -1
- package/docs/api/crypto/utils/pem.md +3 -3
- package/docs/api/crypto/utils/random.md +3 -4
- package/docs/api/crypto/utils/rsaKeygen.md +2 -2
- package/docs/api/crypto/utils/totp.md +2 -2
- package/docs/api/crypto/utils/uuid.md +5 -5
- package/docs/api/crypto/utils/x509.md +124 -0
- package/docs/api/crypto/wasm/aes.md +1 -1
- package/docs/api/crypto/wasm/argon2.md +6 -4
- package/docs/api/crypto/wasm/ml_kem.md +1 -0
- package/docs/api/crypto/wasm/pbkdf2.md +8 -8
- package/docs/api/crypto/wasm/rsa.md +1 -1
- package/docs/api/crypto/wasm/runtime.md +27 -10
- package/docs/api/crypto/webcrypto/aes.md +1 -1
- package/docs/api/crypto/webcrypto/aeskw.md +2 -2
- package/docs/api/crypto/webcrypto/digest.md +3 -5
- package/docs/api/crypto/webcrypto/ecc.md +1 -1
- package/docs/api/crypto/webcrypto/ed25519.md +1 -1
- package/docs/api/crypto/webcrypto/rsa.md +3 -2
- package/docs/api/crypto/webcrypto/x25519.md +1 -1
- package/docs/api/dom/README.md +6 -1
- package/docs/api/dom/fs/README.md +1 -0
- package/docs/api/dom/fs/fileIntake.md +120 -0
- package/docs/api/dom/fs/fsAccess.md +1 -0
- package/docs/api/dom/fs/indexedDB.md +1 -1
- package/docs/api/dom/fs/storage.md +1 -1
- package/docs/api/dom/query/README.md +2 -1
- package/docs/api/dom/query/dnd.md +4 -1
- package/docs/api/dom/query/dom.md +5 -0
- package/docs/api/dom/query/sound.md +103 -0
- package/docs/api/dom/rendering/README.md +4 -3
- package/docs/api/dom/rendering/chart.md +5 -4
- package/docs/api/dom/rendering/component.md +25 -3
- package/docs/api/dom/rendering/parser.md +5 -2
- package/docs/api/dom/rendering/reactiveBind.md +1 -1
- package/docs/api/dom/rendering/render.md +2 -2
- package/docs/api/dom/rendering/sanitize.md +10 -2
- package/docs/api/dom/rendering/secPolicy.md +4 -4
- package/docs/api/dom/rendering/styleSheet.md +85 -0
- package/docs/api/dom/rendering/template.md +20 -5
- package/docs/api/dom/rendering/themeTokens.md +6 -3
- package/docs/api/dom/rendering/uiSession.md +18 -5
- package/docs/api/dom/rendering/virtualScroll.md +2 -2
- package/docs/api/dom/sensors/geolocation.md +1 -1
- package/docs/api/dom/sw/README.md +7 -1
- package/docs/api/dom/sw/cache.md +2 -1
- package/docs/api/dom/sw/installPrompt.md +111 -0
- package/docs/api/dom/sw/precache.md +124 -0
- package/docs/api/dom/sw/serviceWorker.md +4 -2
- package/docs/api/dom/sw/swUpdate.md +112 -0
- package/docs/api/dom/utils/clipboard.md +56 -5
- package/docs/api/dom/utils/entropyCollector.md +1 -1
- package/docs/api/dom/utils/keybindings.md +17 -2
- package/docs/api/dom/utils/leaderElection.md +2 -2
- package/docs/api/dom/utils/route.md +1 -0
- package/docs/api/dom/utils/ua.md +15 -10
- package/docs/api/io/calc/crc32.md +4 -1
- package/docs/api/io/codec/README.md +2 -2
- package/docs/api/io/codec/b64.md +31 -2
- package/docs/api/io/codec/buffer.md +1 -1
- package/docs/api/io/codec/cbor.md +6 -4
- package/docs/api/io/codec/csv.md +178 -178
- package/docs/api/io/codec/hex.md +10 -2
- package/docs/api/io/codec/msgpack.md +4 -3
- package/docs/api/io/codec/url.md +4 -3
- package/docs/api/io/codec/utf8.md +3 -3
- package/docs/api/io/compress/bitstream.md +6 -3
- package/docs/api/io/compress/brotli.md +36 -4
- package/docs/api/io/compress/brotli_shared.md +1 -1
- package/docs/api/io/compress/deflate.md +42 -34
- package/docs/api/io/compress/gzip.md +26 -6
- package/docs/api/io/compress/huffman.md +2 -1
- package/docs/api/io/compress/lz4.md +5 -3
- package/docs/api/io/compress/lz77.md +26 -3
- package/docs/api/io/compress/lzw.md +13 -8
- package/docs/api/io/compress/zip.md +36 -10
- package/docs/api/io/compress/zlib.md +21 -5
- package/docs/api/io/math/linalg.md +1 -1
- package/docs/api/io/utils/valid.md +1 -1
- package/docs/api/process/rpc.md +3 -2
- package/docs/api/process/workerPool.md +1 -1
- package/docs/api/sanity/base.md +9 -5
- package/docs/api/sanity/lockdown.md +7 -6
- package/docs/api/surface.json +12311 -0
- package/docs/api/typed.md +5 -3
- package/docs/dev/README.md +2 -0
- package/docs/dev/bench.md +76 -0
- package/docs/dev/crypto-references.md +54 -0
- package/docs/dev/provenance.md +30 -7
- package/docs/dev/publishing.md +7 -7
- package/docs/dev/runtime.md +1 -1
- package/docs/dev/testing.md +13 -0
- package/docs/evidence/l4-evidence.md +86 -0
- package/docs/evidence/pqc-hybrid-evidence.md +7 -6
- package/docs/guide/README.md +1 -0
- package/docs/guide/_QUICK_REF.md +5 -5
- package/docs/guide/doc-format.md +4 -3
- package/docs/guide/integrations-hmr.md +1 -1
- package/docs/guide/module-creation-workflow.md +8 -8
- package/docs/guide/rendering-pipeline.md +11 -4
- package/docs/guide/security.md +7 -5
- package/docs/guide/stability.md +123 -0
- package/docs/guide/tutorial-todo.md +20 -8
- package/docs/guide/typescript.md +9 -0
- package/docs/guide/worker-confinement.md +30 -17
- package/docs/notes/lz77-deflate-factorization.md +3 -3
- package/docs/tools/README.md +1 -1
- package/docs/tools/bundler.md +3 -3
- package/docs/tools/codegen.md +1 -1
- package/docs/tools/standalone.md +0 -1
- package/fw.config.json +2 -2
- package/integrations/_shared/catalog.generated.json +7 -1
- package/integrations/_shared/core.js +1 -1
- package/integrations/astro/index.js +1 -1
- package/integrations/eslint/README.md +7 -1
- package/integrations/nextjs/index.js +1 -1
- package/integrations/nodejs/README.md +3 -3
- package/integrations/turbopack/index.js +2 -2
- package/integrations/typedoc/categorize.js +1 -1
- package/integrations/typedoc/typedoc.json +2 -1
- package/integrations/vite/index.js +2 -2
- package/integrations/vite/vite-env.d.ts +7 -4
- package/integrations/webpack/index.js +3 -3
- package/package.json +76 -10
- package/src/core/internal.js +31 -0
- package/src/core/logger.js +95 -23
- package/src/core/modules.js +17 -8
- package/src/core/readyState.js +1 -1
- package/src/core/runtime.js +74 -27
- package/src/core/worker-helper.js +83 -4
- package/src/crypto/NIST_CONFORMANCE.md +47 -34
- package/src/crypto/cipher/aes.acvp.md +7 -8
- package/src/crypto/cipher/aes.js +280 -229
- package/src/crypto/cipher/chacha20.acvp.md +6 -7
- package/src/crypto/cipher/chacha20.js +91 -61
- package/src/crypto/hash/adf.js +1 -1
- package/src/crypto/hash/argon2.acvp.md +11 -15
- package/src/crypto/hash/argon2.js +9 -24
- package/src/crypto/hash/blake2b.js +157 -125
- package/src/crypto/hash/hkdf.acvp.md +15 -15
- package/src/crypto/hash/hkdf.js +1 -1
- package/src/crypto/hash/hmac.acvp.md +10 -12
- package/src/crypto/hash/hmac.js +5 -1
- package/src/crypto/hash/pbkdf2.acvp.md +13 -13
- package/src/crypto/hash/pbkdf2.js +36 -8
- package/src/crypto/hash/poly1305.acvp.md +10 -6
- package/src/crypto/hash/poly1305.js +171 -50
- package/src/crypto/hash/sha224.acvp.md +3 -3
- package/src/crypto/hash/sha224.js +4 -4
- package/src/crypto/hash/sha256.acvp.md +2 -2
- package/src/crypto/hash/sha256.js +514 -50
- package/src/crypto/hash/sha3.acvp.md +9 -9
- package/src/crypto/hash/sha3.js +127 -71
- package/src/crypto/hash/sha384.acvp.md +3 -3
- package/src/crypto/hash/sha384.js +4 -4
- package/src/crypto/hash/sha512.acvp.md +7 -8
- package/src/crypto/hash/sha512.js +107 -108
- package/src/crypto/hash/sha512_224.acvp.md +6 -6
- package/src/crypto/hash/sha512_224.js +2 -2
- package/src/crypto/hash/sha512_256.acvp.md +6 -6
- package/src/crypto/hash/sha512_256.js +2 -2
- package/src/crypto/mode/cbc.acvp.md +2 -2
- package/src/crypto/mode/cbc.js +1 -1
- package/src/crypto/mode/chacha20poly1305.acvp.md +6 -6
- package/src/crypto/mode/chacha20poly1305.js +3 -3
- package/src/crypto/mode/cmac.acvp.md +5 -5
- package/src/crypto/mode/cmac.js +8 -8
- package/src/crypto/mode/ctr.acvp.md +2 -2
- package/src/crypto/mode/ctr.js +1 -3
- package/src/crypto/mode/gcm.acvp.md +6 -6
- package/src/crypto/mode/gcm.js +7 -7
- package/src/crypto/mode/kw.acvp.md +4 -4
- package/src/crypto/mode/kw.js +5 -5
- package/src/crypto/pkc/ecc.acvp.md +13 -13
- package/src/crypto/pkc/ecc.js +9 -11
- package/src/crypto/pkc/ed25519.acvp.md +30 -34
- package/src/crypto/pkc/ed25519.js +453 -94
- package/src/crypto/pkc/hybrid-kat.provenance.md +4 -4
- package/src/crypto/pkc/hybridSign.js +103 -24
- package/src/crypto/pkc/ml_dsa.acvp.md +18 -18
- package/src/crypto/pkc/ml_dsa.js +29 -32
- package/src/crypto/pkc/ml_kem.acvp.md +7 -7
- package/src/crypto/pkc/ml_kem.js +15 -21
- package/src/crypto/pkc/rsa.acvp.md +11 -15
- package/src/crypto/pkc/rsa.js +7 -44
- package/src/crypto/pkc/slh_dsa.acvp.md +16 -16
- package/src/crypto/pkc/slh_dsa.js +16 -18
- package/src/crypto/pkc/x25519.acvp.md +13 -10
- package/src/crypto/pkc/x25519.js +273 -29
- package/src/crypto/utils/aes_modes.acvp.md +1 -2
- package/src/crypto/utils/aes_modes.js +2 -2
- package/src/crypto/utils/asn1-oid.js +1 -1
- package/src/crypto/utils/asn1.js +1 -1
- package/src/crypto/utils/bitArray.js +33 -48
- package/src/crypto/utils/bn.js +1 -1
- package/src/crypto/utils/jws.js +37 -41
- package/src/crypto/utils/keyformat.js +181 -2
- package/src/crypto/utils/pem.js +1 -1
- package/src/crypto/utils/random.acvp.md +5 -5
- package/src/crypto/utils/random.js +845 -846
- package/src/crypto/utils/rsaKeygen.acvp.md +3 -2
- package/src/crypto/utils/rsaKeygen.js +6 -6
- package/src/crypto/utils/totp.js +1 -1
- package/src/crypto/utils/uuid.acvp.md +5 -5
- package/src/crypto/utils/uuid.js +11 -10
- package/src/crypto/utils/x509.js +591 -0
- package/src/crypto/wasm/aes.js +1 -1
- package/src/crypto/wasm/aes.scalar.wasm +0 -0
- package/src/crypto/wasm/argon2.js +17 -1
- package/src/crypto/wasm/argon2.scalar.wasm +0 -0
- package/src/crypto/wasm/blake2b.scalar.wasm +0 -0
- package/src/crypto/wasm/blake2b.simd.wasm +0 -0
- package/src/crypto/wasm/chacha20poly1305.scalar.wasm +0 -0
- package/src/crypto/wasm/chacha20poly1305.simd.wasm +0 -0
- package/src/crypto/wasm/cmac.scalar.wasm +0 -0
- package/src/crypto/wasm/ecc.js +3 -3
- package/src/crypto/wasm/ecc.scalar.wasm +0 -0
- package/src/crypto/wasm/ed25519.js +1 -1
- package/src/crypto/wasm/ed25519.scalar.wasm +0 -0
- package/src/crypto/wasm/hkdf.scalar.wasm +0 -0
- package/src/crypto/wasm/hmac.scalar.wasm +0 -0
- package/src/crypto/wasm/ml_dsa.js +2 -2
- package/src/crypto/wasm/ml_dsa.scalar.wasm +0 -0
- package/src/crypto/wasm/ml_dsa.simd.wasm +0 -0
- package/src/crypto/wasm/ml_kem.js +2 -2
- package/src/crypto/wasm/ml_kem.scalar.wasm +0 -0
- package/src/crypto/wasm/ml_kem.simd.wasm +0 -0
- package/src/crypto/wasm/pbkdf2.js +8 -6
- package/src/crypto/wasm/pbkdf2.scalar.wasm +0 -0
- package/src/crypto/wasm/rsa.js +6 -5
- package/src/crypto/wasm/rsa.scalar.wasm +0 -0
- package/src/crypto/wasm/runtime.js +84 -17
- package/src/crypto/wasm/sha2.scalar.wasm +0 -0
- package/src/crypto/wasm/sha3.scalar.wasm +0 -0
- package/src/crypto/wasm/sha3.simd.wasm +0 -0
- package/src/crypto/wasm/slh_dsa.js +1 -1
- package/src/crypto/wasm/slh_dsa.scalar.wasm +0 -0
- package/src/crypto/wasm/x25519.js +1 -1
- package/src/crypto/wasm/x25519.scalar.wasm +0 -0
- package/src/crypto/webcrypto/aes.js +8 -2
- package/src/crypto/webcrypto/aeskw.js +7 -2
- package/src/crypto/webcrypto/digest.js +1 -15
- package/src/crypto/webcrypto/ecc.js +2 -2
- package/src/crypto/webcrypto/ed25519.js +2 -2
- package/src/crypto/webcrypto/hmac.js +2 -2
- package/src/crypto/webcrypto/rsa.js +7 -2
- package/src/crypto/webcrypto/x25519.js +2 -2
- package/src/dom/display/animate.js +1 -1
- package/src/dom/display/fullscreen.js +1 -1
- package/src/dom/fs/download.js +1 -1
- package/src/dom/fs/fileIntake.js +192 -0
- package/src/dom/fs/fsAccess.js +2 -3
- package/src/dom/fs/indexedDB.js +1 -1
- package/src/dom/fs/remoteStore.js +1 -1
- package/src/dom/fs/storage.js +1 -1
- package/src/dom/lifecycle/idle.js +1 -1
- package/src/dom/lifecycle/visibility.js +1 -1
- package/src/dom/lifecycle/wakeLock.js +1 -1
- package/src/dom/net/ajax.js +1 -1
- package/src/dom/net/network.js +1 -1
- package/src/dom/net/sse.js +1 -1
- package/src/dom/net/webrtc.js +1 -1
- package/src/dom/net/ws.js +1 -1
- package/src/dom/query/dnd.js +56 -4
- package/src/dom/query/dom.js +1 -1
- package/src/dom/query/events.js +1 -1
- package/src/dom/query/gesture.js +1 -1
- package/src/dom/query/media.js +1 -1
- package/src/dom/query/sound.js +333 -0
- package/src/dom/rendering/chart.js +736 -663
- package/src/dom/rendering/component.js +25 -14
- package/src/dom/rendering/devtools.js +2 -2
- package/src/dom/rendering/parser.js +155 -12
- package/src/dom/rendering/render.js +14 -4
- package/src/dom/rendering/sanitize.js +11 -4
- package/src/dom/rendering/secPolicy.js +6 -4
- package/src/dom/rendering/styleSheet.js +217 -0
- package/src/dom/rendering/template.js +72 -13
- package/src/dom/rendering/themeTokens.js +542 -522
- package/src/dom/rendering/uiSession-core.js +51 -6
- package/src/dom/rendering/uiSession-direct.js +1 -1
- package/src/dom/rendering/uiSession-list.js +4 -4
- package/src/dom/rendering/uiSession.js +1 -1
- package/src/dom/rendering/virtualScroll.js +341 -341
- package/src/dom/sensors/battery.js +1 -1
- package/src/dom/sensors/geolocation.js +1 -1
- package/src/dom/sensors/networkInfo.js +1 -1
- package/src/dom/sensors/sensors.js +1 -1
- package/src/dom/sw/backgroundSync.js +1 -1
- package/src/dom/sw/cache.js +1 -1
- package/src/dom/sw/installPrompt.js +151 -0
- package/src/dom/sw/precache.js +257 -0
- package/src/dom/sw/push.js +1 -1
- package/src/dom/sw/sharedWorker.js +1 -1
- package/src/dom/sw/swUpdate.js +239 -0
- package/src/dom/utils/a11y.js +1 -1
- package/src/dom/utils/clipboard.js +56 -6
- package/src/dom/utils/entropyCollector.js +1 -1
- package/src/dom/utils/focus.js +1 -1
- package/src/dom/utils/form.js +1 -1
- package/src/dom/utils/keybindings.js +600 -574
- package/src/dom/utils/leaderElection.js +1 -1
- package/src/dom/utils/notifications.js +1 -1
- package/src/dom/utils/permissions.js +107 -107
- package/src/dom/utils/route.js +14 -2
- package/src/dom/utils/ua.js +42 -28
- package/src/dom/utils/webauthn.js +1 -1
- package/src/io/binary/reader.js +1 -1
- package/src/io/binary/writer.js +1 -1
- package/src/io/calc/bigint.js +1 -1
- package/src/io/calc/crc32.js +28 -2
- package/src/io/calc/easing.js +514 -514
- package/src/io/codec/b64.js +189 -52
- package/src/io/codec/base32.js +1 -1
- package/src/io/codec/base58.js +1 -1
- package/src/io/codec/buffer.js +1 -1
- package/src/io/codec/cbor.js +111 -18
- package/src/io/codec/csv.js +1 -1
- package/src/io/codec/hex.js +51 -6
- package/src/io/codec/mime.js +1 -1
- package/src/io/codec/msgpack.js +47 -6
- package/src/io/codec/url.js +24 -7
- package/src/io/codec/utf8.js +5 -3
- package/src/io/codec/xml.js +1 -1
- package/src/io/compress/bitstream.js +2 -2
- package/src/io/compress/brotli.js +663 -163
- package/src/io/compress/brotli_dict.js +1 -1
- package/src/io/compress/brotli_dict_words.js +1 -1
- package/src/io/compress/brotli_frame.js +1 -1
- package/src/io/compress/brotli_shared.js +7 -7
- package/src/io/compress/deflate.js +87 -53
- package/src/io/compress/gzip.js +187 -74
- package/src/io/compress/huffman.js +24 -1
- package/src/io/compress/lz4.js +45 -7
- package/src/io/compress/lz77.js +148 -63
- package/src/io/compress/lzw.js +35 -19
- package/src/io/compress/zip.js +862 -815
- package/src/io/compress/zlib.js +87 -7
- package/src/io/i18n/i18n.js +1 -1
- package/src/io/math/fixed-point.js +1 -1
- package/src/io/math/geom.js +1 -1
- package/src/io/math/interp.js +1 -1
- package/src/io/math/linalg.js +10 -4
- package/src/io/math/stats.js +1 -1
- package/src/io/structures/btree.js +1 -1
- package/src/io/structures/heap.js +1 -1
- package/src/io/structures/lruCache.js +1 -1
- package/src/io/structures/ringBuffer.js +1 -1
- package/src/io/structures/tree-walker.js +1 -1
- package/src/io/structures/trie.js +1 -1
- package/src/io/sync/abort.js +1 -1
- package/src/io/sync/atomics.js +1 -1
- package/src/io/sync/cancellable.js +1 -1
- package/src/io/sync/channel.js +1 -1
- package/src/io/sync/mutex.js +1 -1
- package/src/io/sync/semaphore.js +1 -1
- package/src/io/sync/tokenBucket.js +1 -1
- package/src/io/text/ansi.js +1 -1
- package/src/io/text/html-entities.js +1 -1
- package/src/io/time/date.js +1 -1
- package/src/io/timing/clock.js +1 -1
- package/src/io/timing/rateLimit.js +1 -1
- package/src/io/timing/scheduler.js +1 -1
- package/src/io/utils/errors.js +1 -1
- package/src/io/utils/eventBus.js +1 -1
- package/src/io/utils/signal.js +1 -1
- package/src/io/utils/valid.js +1 -1
- package/src/main.js +1 -1
- package/src/process/message.js +1 -1
- package/src/process/rpc.js +7 -3
- package/src/process/workerPool.js +11 -4
- package/src/sanity/base.js +85 -39
- package/src/sanity/lockdown-apply.js +3 -3
- package/src/sanity/lockdown.js +58 -32
- package/src/sanity/wasm-gate.js +2 -2
- package/src/typed.js +7 -3
- package/third-party/NOTICE-brotli-dictionary.txt +69 -0
- package/third-party/NOTICE-fw-wasm-crypto.txt +576 -0
- package/third-party/NOTICE-whatwg-entities.txt +44 -0
- package/types/registry.generated.d.ts +7 -1
- package/types/typed.d.ts +7 -3
- package/dist/types/crypto/utils/aes_ctr.d.ts +0 -84
- package/dist/types/crypto/utils/aes_ctr.d.ts.map +0 -1
- package/docs/api/crypto/utils/aes_ctr.md +0 -71
- package/src/crypto/utils/aes_ctr.acvp.md +0 -67
- package/src/crypto/utils/aes_ctr.js +0 -134
|
@@ -1,107 +1,107 @@
|
|
|
1
|
-
|
|
2
|
-
// Author: Matthieu Bouilloux
|
|
3
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* @description Wrapper around `navigator.permissions.query` with a `watch()` helper
|
|
7
|
-
* that surfaces permission state changes via an `onchange` listener.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Public surface returned by the permissions factory.
|
|
12
|
-
* @typedef {object} PermissionsAPI
|
|
13
|
-
* @property {() => boolean} isSupported - `true` if `navigator.permissions` is present.
|
|
14
|
-
* @property {(name: string) => Promise<string>} query - Query the current state of a named permission (`"granted"`, `"denied"`, or `"prompt"`).
|
|
15
|
-
* @property {(name: string, callback: (state: string) => void, onError?: (err: Error) => void) => (() => void)} watch - Watch a permission for state changes; returns a `stop` function that detaches the listener.
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
export const permissions = {
|
|
19
|
-
name: 'permissions',
|
|
20
|
-
version: '1.0.0',
|
|
21
|
-
type: 'fw.dom.utils',
|
|
22
|
-
dependencies: [],
|
|
23
|
-
worker: false,
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Factory producing the permissions utility instance.
|
|
27
|
-
* @returns {PermissionsAPI}
|
|
28
|
-
*/
|
|
29
|
-
factory() {
|
|
30
|
-
/**
|
|
31
|
-
* Detects whether the Permissions API is available in the current environment.
|
|
32
|
-
* @returns {boolean} `true` if `navigator.permissions` is present.
|
|
33
|
-
*/
|
|
34
|
-
function isSupported() {
|
|
35
|
-
return 'permissions' in navigator;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Queries the current state of a named permission.
|
|
40
|
-
* @param {string} name - Permission name (e.g. `"geolocation"`, `"camera"`).
|
|
41
|
-
* @returns {Promise<string>} The permission state: `"granted"`, `"denied"`, or `"prompt"`.
|
|
42
|
-
* @throws {Error} If the Permissions API is unavailable, or if `name` is not a supported permission.
|
|
43
|
-
*/
|
|
44
|
-
async function query(name) {
|
|
45
|
-
if (!isSupported()) throw new Error('permissions: unsupported');
|
|
46
|
-
try {
|
|
47
|
-
// @ts-ignore - PermissionName is a strict union; custom string names are valid per spec
|
|
48
|
-
const status = await navigator.permissions.query({ name });
|
|
49
|
-
return status.state;
|
|
50
|
-
} catch (err) {
|
|
51
|
-
throw new Error(`permissions: unsupported name "${name}"`, { cause: err });
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Watches a permission for state changes and invokes `callback` whenever
|
|
57
|
-
* the permission's `onchange` event fires.
|
|
58
|
-
*
|
|
59
|
-
* Errors from the underlying `navigator.permissions.query` call (e.g. unknown
|
|
60
|
-
* permission name) are asynchronous: they are delivered to the optional
|
|
61
|
-
* `onError` handler. If `onError` is not provided, the rejection is swallowed
|
|
62
|
-
* silently (the caller has opted out of error notification) - it will NOT
|
|
63
|
-
* surface as an unhandled rejection.
|
|
64
|
-
*
|
|
65
|
-
* @param {string} name - Permission name to watch.
|
|
66
|
-
* @param {(state: string) => void} callback - Invoked with the new state on each change.
|
|
67
|
-
* @param {(err: Error) => void} [onError] - Optional handler for async query errors.
|
|
68
|
-
* @returns {() => void} `stop` function that detaches the listener and prevents
|
|
69
|
-
* further callbacks (even if the underlying query has not yet resolved).
|
|
70
|
-
* @throws {Error} Synchronously if the Permissions API is unavailable.
|
|
71
|
-
*/
|
|
72
|
-
function watch(name, callback, onError) {
|
|
73
|
-
if (!isSupported()) throw new Error('permissions: unsupported');
|
|
74
|
-
|
|
75
|
-
let status = null;
|
|
76
|
-
let stopped = false;
|
|
77
|
-
|
|
78
|
-
function handler() {
|
|
79
|
-
if (!stopped) callback(status.state);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
// @ts-ignore - PermissionName is a strict union; custom string names are valid per spec
|
|
83
|
-
navigator.permissions.query({ name }).then(s => {
|
|
84
|
-
if (stopped) return;
|
|
85
|
-
status = s;
|
|
86
|
-
status.onchange = handler;
|
|
87
|
-
}).catch(err => {
|
|
88
|
-
if (stopped) return;
|
|
89
|
-
if (onError) {
|
|
90
|
-
try {
|
|
91
|
-
onError(new Error(`permissions: unsupported name "${name}"`));
|
|
92
|
-
} catch {
|
|
93
|
-
// user-supplied onError threw - suppress to avoid unhandled rejection
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
// else: caller opted out of error notification - swallow silently
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
return function stop() {
|
|
100
|
-
stopped = true;
|
|
101
|
-
if (status) status.onchange = null;
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
return { isSupported, query, watch };
|
|
106
|
-
},
|
|
107
|
-
};
|
|
1
|
+
// Copyright (c) 2026 AwaCloud SAS
|
|
2
|
+
// Author: Matthieu Bouilloux
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @description Wrapper around `navigator.permissions.query` with a `watch()` helper
|
|
7
|
+
* that surfaces permission state changes via an `onchange` listener.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Public surface returned by the permissions factory.
|
|
12
|
+
* @typedef {object} PermissionsAPI
|
|
13
|
+
* @property {() => boolean} isSupported - `true` if `navigator.permissions` is present.
|
|
14
|
+
* @property {(name: string) => Promise<string>} query - Query the current state of a named permission (`"granted"`, `"denied"`, or `"prompt"`).
|
|
15
|
+
* @property {(name: string, callback: (state: string) => void, onError?: (err: Error) => void) => (() => void)} watch - Watch a permission for state changes; returns a `stop` function that detaches the listener.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
export const permissions = {
|
|
19
|
+
name: 'permissions',
|
|
20
|
+
version: '1.0.0',
|
|
21
|
+
type: 'fw.dom.utils',
|
|
22
|
+
dependencies: [],
|
|
23
|
+
worker: false,
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Factory producing the permissions utility instance.
|
|
27
|
+
* @returns {PermissionsAPI}
|
|
28
|
+
*/
|
|
29
|
+
factory() {
|
|
30
|
+
/**
|
|
31
|
+
* Detects whether the Permissions API is available in the current environment.
|
|
32
|
+
* @returns {boolean} `true` if `navigator.permissions` is present.
|
|
33
|
+
*/
|
|
34
|
+
function isSupported() {
|
|
35
|
+
return 'permissions' in navigator;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Queries the current state of a named permission.
|
|
40
|
+
* @param {string} name - Permission name (e.g. `"geolocation"`, `"camera"`).
|
|
41
|
+
* @returns {Promise<string>} The permission state: `"granted"`, `"denied"`, or `"prompt"`.
|
|
42
|
+
* @throws {Error} If the Permissions API is unavailable, or if `name` is not a supported permission.
|
|
43
|
+
*/
|
|
44
|
+
async function query(name) {
|
|
45
|
+
if (!isSupported()) throw new Error('permissions: unsupported');
|
|
46
|
+
try {
|
|
47
|
+
// @ts-ignore - PermissionName is a strict union; custom string names are valid per spec
|
|
48
|
+
const status = await navigator.permissions.query({ name });
|
|
49
|
+
return status.state;
|
|
50
|
+
} catch (err) {
|
|
51
|
+
throw new Error(`permissions: unsupported name "${name}"`, { cause: err });
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Watches a permission for state changes and invokes `callback` whenever
|
|
57
|
+
* the permission's `onchange` event fires.
|
|
58
|
+
*
|
|
59
|
+
* Errors from the underlying `navigator.permissions.query` call (e.g. unknown
|
|
60
|
+
* permission name) are asynchronous: they are delivered to the optional
|
|
61
|
+
* `onError` handler. If `onError` is not provided, the rejection is swallowed
|
|
62
|
+
* silently (the caller has opted out of error notification) - it will NOT
|
|
63
|
+
* surface as an unhandled rejection.
|
|
64
|
+
*
|
|
65
|
+
* @param {string} name - Permission name to watch.
|
|
66
|
+
* @param {(state: string) => void} callback - Invoked with the new state on each change.
|
|
67
|
+
* @param {(err: Error) => void} [onError] - Optional handler for async query errors.
|
|
68
|
+
* @returns {() => void} `stop` function that detaches the listener and prevents
|
|
69
|
+
* further callbacks (even if the underlying query has not yet resolved).
|
|
70
|
+
* @throws {Error} Synchronously if the Permissions API is unavailable.
|
|
71
|
+
*/
|
|
72
|
+
function watch(name, callback, onError) {
|
|
73
|
+
if (!isSupported()) throw new Error('permissions: unsupported');
|
|
74
|
+
|
|
75
|
+
let status = null;
|
|
76
|
+
let stopped = false;
|
|
77
|
+
|
|
78
|
+
function handler() {
|
|
79
|
+
if (!stopped) callback(status.state);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// @ts-ignore - PermissionName is a strict union; custom string names are valid per spec
|
|
83
|
+
navigator.permissions.query({ name }).then(s => {
|
|
84
|
+
if (stopped) return;
|
|
85
|
+
status = s;
|
|
86
|
+
status.onchange = handler;
|
|
87
|
+
}).catch(err => {
|
|
88
|
+
if (stopped) return;
|
|
89
|
+
if (onError) {
|
|
90
|
+
try {
|
|
91
|
+
onError(new Error(`permissions: unsupported name "${name}"`));
|
|
92
|
+
} catch {
|
|
93
|
+
// user-supplied onError threw - suppress to avoid unhandled rejection
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
// else: caller opted out of error notification - swallow silently
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
return function stop() {
|
|
100
|
+
stopped = true;
|
|
101
|
+
if (status) status.onchange = null;
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
return { isSupported, query, watch };
|
|
106
|
+
},
|
|
107
|
+
};
|
package/src/dom/utils/route.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// Copyright (c) 2026 AwaCloud SAS
|
|
2
2
|
// Author: Matthieu Bouilloux
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
|
|
@@ -218,6 +218,10 @@ export const route = {
|
|
|
218
218
|
let _dispatching = false;
|
|
219
219
|
/** Last successfully-matched route info, for `beforeLeave`. */
|
|
220
220
|
let _activeRoute = null; // { name, params, query, info, prevHash } | null
|
|
221
|
+
// Hash of the last dispatch. A `hashchange` that finds the same hash
|
|
222
|
+
// has nothing new to dispatch: the event `go()` causes after its own
|
|
223
|
+
// direct dispatch, or a stale event delivered late.
|
|
224
|
+
let _lastDispatchedHash = null;
|
|
221
225
|
|
|
222
226
|
/**
|
|
223
227
|
* Convert a guard return value to a boolean (sync) or `Promise<boolean>`.
|
|
@@ -240,10 +244,17 @@ export const route = {
|
|
|
240
244
|
}
|
|
241
245
|
}
|
|
242
246
|
|
|
247
|
+
/** `hashchange` listener: dispatch only when the hash moved since the last dispatch. */
|
|
248
|
+
function _onHashChange() {
|
|
249
|
+
if (location.hash === _lastDispatchedHash) return;
|
|
250
|
+
dispatch();
|
|
251
|
+
}
|
|
252
|
+
|
|
243
253
|
async function dispatch() {
|
|
244
254
|
if (_dispatching) return;
|
|
245
255
|
_dispatching = true;
|
|
246
256
|
const currentHash = location.hash;
|
|
257
|
+
_lastDispatchedHash = currentHash;
|
|
247
258
|
try {
|
|
248
259
|
const { path, query } = parseHash(currentHash);
|
|
249
260
|
|
|
@@ -458,7 +469,7 @@ export const route = {
|
|
|
458
469
|
start() {
|
|
459
470
|
if (started) return;
|
|
460
471
|
started = true;
|
|
461
|
-
events.on('fw:route:hashchange', window, 'hashchange',
|
|
472
|
+
events.on('fw:route:hashchange', window, 'hashchange', _onHashChange);
|
|
462
473
|
dispatch();
|
|
463
474
|
},
|
|
464
475
|
|
|
@@ -472,6 +483,7 @@ export const route = {
|
|
|
472
483
|
}
|
|
473
484
|
routes.length = 0;
|
|
474
485
|
_activeRoute = null;
|
|
486
|
+
_lastDispatchedHash = null;
|
|
475
487
|
},
|
|
476
488
|
|
|
477
489
|
get size() { return routes.length; },
|
package/src/dom/utils/ua.js
CHANGED
|
@@ -1,20 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
// Copyright (c) 2026 AwaCloud SAS
|
|
2
2
|
// Author: Matthieu Bouilloux
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @fileoverview User-Agent and environment detection factory.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
8
|
+
* Follows MDN's "Browser detection using the user agent": feature detection
|
|
9
|
+
* and User-Agent Client Hints first, a minimal reading of the UA string only
|
|
10
|
+
* where they say nothing. `navigator.userAgentData` (UA-CH, Chromium-based
|
|
11
|
+
* browsers) gives `mobile` and `platform` directly; elsewhere `mobile()` looks
|
|
12
|
+
* for "Mobi" anywhere in the UA and `platform()` reads a few tokens. Values are
|
|
13
|
+
* computed once at factory initialisation; `touch()` is read at call time.
|
|
11
14
|
*
|
|
12
15
|
* ## API
|
|
13
16
|
*
|
|
14
17
|
* | Method | Returns |
|
|
15
18
|
* |---|---|
|
|
16
19
|
* | `string()` | Raw `navigator.userAgent` string |
|
|
17
|
-
* | `mobile()` | `true`
|
|
20
|
+
* | `mobile()` | `true` on a phone-class device (UA-CH `mobile`, else "Mobi" in the UA) |
|
|
18
21
|
* | `touch()` | `true` when the device reports touch capability |
|
|
19
22
|
* | `platform()` | `'ios'` \| `'android'` \| `'windows'` \| `'mac'` \| `'linux'` \| `'unknown'` |
|
|
20
23
|
*
|
|
@@ -24,10 +27,10 @@
|
|
|
24
27
|
* Public surface returned by `ua.factory()`.
|
|
25
28
|
* @typedef {object} UaAPI
|
|
26
29
|
* @property {() => string} string Raw `navigator.userAgent` string (empty outside the browser).
|
|
27
|
-
* @property {() => boolean} mobile `true`
|
|
30
|
+
* @property {() => boolean} mobile `true` on a phone-class device: UA-CH `mobile` when available, else "Mobi" in the UA.
|
|
28
31
|
* @property {() => boolean} touch `true` when the device reports touch capability.
|
|
29
32
|
* @property {() => ('ios'|'android'|'windows'|'mac'|'linux'|'unknown')} platform
|
|
30
|
-
* Normalised platform
|
|
33
|
+
* Normalised platform: UA-CH `platform` when available, else a minimal UA reading.
|
|
31
34
|
*/
|
|
32
35
|
|
|
33
36
|
export const ua = {
|
|
@@ -39,27 +42,36 @@ export const ua = {
|
|
|
39
42
|
/** @returns {UaAPI} */
|
|
40
43
|
factory() {
|
|
41
44
|
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
: '';
|
|
45
|
+
const _nav = typeof navigator !== 'undefined' ? navigator : null;
|
|
46
|
+
const _ua = _nav ? (_nav.userAgent || _nav.vendor || '') : '';
|
|
45
47
|
|
|
46
|
-
//
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
const _mobilePrefixRe = /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i;
|
|
48
|
+
// UA-CH low-entropy hints: synchronous, no permission, Chromium-based browsers only.
|
|
49
|
+
// @ts-ignore - userAgentData is not in every lib.dom version
|
|
50
|
+
const _hints = _nav && _nav.userAgentData && typeof _nav.userAgentData === 'object' ? _nav.userAgentData : null;
|
|
50
51
|
|
|
51
|
-
//
|
|
52
|
-
const _isMobile =
|
|
52
|
+
// MDN: "we recommend looking for the string 'Mobi' anywhere in the User Agent".
|
|
53
|
+
const _isMobile = _hints && typeof _hints.mobile === 'boolean' ? _hints.mobile : /Mobi/i.test(_ua);
|
|
53
54
|
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
/
|
|
60
|
-
/
|
|
61
|
-
|
|
62
|
-
|
|
55
|
+
const HINT_PLATFORMS = { 'windows': 'windows', 'macos': 'mac', 'linux': 'linux', 'android': 'android', 'ios': 'ios', 'chrome os': 'linux' };
|
|
56
|
+
|
|
57
|
+
/** @returns {'ios'|'android'|'windows'|'mac'|'linux'|'unknown'} */
|
|
58
|
+
function _fromUa() {
|
|
59
|
+
const u = _ua.toLowerCase();
|
|
60
|
+
if (/iphone|ipad|ipod/.test(u)) return 'ios';
|
|
61
|
+
if (/android/.test(u)) return 'android';
|
|
62
|
+
if (/windows/.test(u)) return 'windows';
|
|
63
|
+
if (/macintosh|mac os x/.test(u)) {
|
|
64
|
+
// iPadOS asks for desktop sites with a Mac UA; a Mac has no multi-touch screen
|
|
65
|
+
return _nav && _nav.maxTouchPoints > 1 ? 'ios' : 'mac';
|
|
66
|
+
}
|
|
67
|
+
if (/linux|cros/.test(u)) return 'linux';
|
|
68
|
+
return 'unknown';
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/** @type {'ios'|'android'|'windows'|'mac'|'linux'|'unknown'} */
|
|
72
|
+
const _platform = _hints && typeof _hints.platform === 'string' && _hints.platform
|
|
73
|
+
? (HINT_PLATFORMS[_hints.platform.toLowerCase()] || 'unknown')
|
|
74
|
+
: _fromUa();
|
|
63
75
|
|
|
64
76
|
return {
|
|
65
77
|
|
|
@@ -74,8 +86,9 @@ export const ua = {
|
|
|
74
86
|
},
|
|
75
87
|
|
|
76
88
|
/**
|
|
77
|
-
* Return `true`
|
|
78
|
-
*
|
|
89
|
+
* Return `true` on a phone-class device: UA-CH `mobile` when the
|
|
90
|
+
* browser offers it, else "Mobi" anywhere in the UA (computed once
|
|
91
|
+
* at factory initialisation). Tablets are not mobile.
|
|
79
92
|
*
|
|
80
93
|
* @returns {boolean}
|
|
81
94
|
*/
|
|
@@ -96,7 +109,8 @@ export const ua = {
|
|
|
96
109
|
},
|
|
97
110
|
|
|
98
111
|
/**
|
|
99
|
-
* Return a normalised platform identifier
|
|
112
|
+
* Return a normalised platform identifier: UA-CH `platform` when
|
|
113
|
+
* the browser offers it, else a minimal reading of the UA string
|
|
100
114
|
* (computed once at factory initialisation).
|
|
101
115
|
*
|
|
102
116
|
* @returns {'ios'|'android'|'windows'|'mac'|'linux'|'unknown'}
|
package/src/io/binary/reader.js
CHANGED
package/src/io/binary/writer.js
CHANGED
package/src/io/calc/bigint.js
CHANGED
package/src/io/calc/crc32.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// Copyright (c) 2026 AwaCloud SAS
|
|
2
2
|
// Author: Matthieu Bouilloux
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
|
|
@@ -55,6 +55,17 @@ export const crc32 = {
|
|
|
55
55
|
table[i] = t;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
+
// Slicing-by-16: slice k (entries 256k .. 256k + 255) holds the CRC of
|
|
59
|
+
// byte i followed by k zero bytes, so sixteen input bytes fold into
|
|
60
|
+
// the state with sixteen independent lookups instead of sixteen
|
|
61
|
+
// dependent ones. One flat table (16 KiB), read through a local.
|
|
62
|
+
const slices = new Uint32Array(16 * 256);
|
|
63
|
+
slices.set(table);
|
|
64
|
+
for (let k = 256; k < 16 * 256; k++) {
|
|
65
|
+
const prev = slices[k - 256];
|
|
66
|
+
slices[k] = (prev >>> 8) ^ table[prev & 0xFF];
|
|
67
|
+
}
|
|
68
|
+
|
|
58
69
|
/**
|
|
59
70
|
* CRC32 constructor - Creates a new CRC32 instance for calculating checksums.
|
|
60
71
|
* Each instance maintains its own CRC state and can process data incrementally.
|
|
@@ -88,7 +99,22 @@ export const crc32 = {
|
|
|
88
99
|
Crc32.prototype.append = function(data) {
|
|
89
100
|
// @ts-ignore - crc is a private field; accessed from subclass-like context, safe at runtime
|
|
90
101
|
let crc = this.crc | 0;
|
|
91
|
-
|
|
102
|
+
const length = data.length | 0;
|
|
103
|
+
let offset = 0;
|
|
104
|
+
if (data instanceof Uint8Array) {
|
|
105
|
+
// Sixteen bytes a step; an array of numbers (whose elements the
|
|
106
|
+
// byte loop masks to 8 bits) and the last 0-15 bytes take the
|
|
107
|
+
// byte loop.
|
|
108
|
+
const t = slices;
|
|
109
|
+
for (const end = length - 15; offset < end; offset += 16) {
|
|
110
|
+
const a = crc ^ (data[offset] | (data[offset + 1] << 8) | (data[offset + 2] << 16) | (data[offset + 3] << 24));
|
|
111
|
+
crc = t[3840 + (a & 0xFF)] ^ t[3584 + ((a >>> 8) & 0xFF)] ^ t[3328 + ((a >>> 16) & 0xFF)] ^ t[3072 + (a >>> 24)] ^
|
|
112
|
+
t[2816 + data[offset + 4]] ^ t[2560 + data[offset + 5]] ^ t[2304 + data[offset + 6]] ^ t[2048 + data[offset + 7]] ^
|
|
113
|
+
t[1792 + data[offset + 8]] ^ t[1536 + data[offset + 9]] ^ t[1280 + data[offset + 10]] ^ t[1024 + data[offset + 11]] ^
|
|
114
|
+
t[768 + data[offset + 12]] ^ t[512 + data[offset + 13]] ^ t[256 + data[offset + 14]] ^ t[data[offset + 15]];
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
for (; offset < length; offset++) {
|
|
92
118
|
crc = (crc >>> 8) ^ table[(crc ^ data[offset]) & 0xFF];
|
|
93
119
|
}
|
|
94
120
|
// @ts-ignore - crc is a private field; accessed from subclass-like context, safe at runtime
|