@despia-native/kernel 0.0.0-stage → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/NOTICE +1414 -0
- package/README.md +17 -2
- package/dist/.dsx-build-stamp.json +7 -0
- package/dist/api-cohort.d.ts +27 -0
- package/dist/api-cohort.d.ts.map +1 -0
- package/dist/api-cohort.js +94 -0
- package/dist/api-cohort.js.map +1 -0
- package/dist/api.d.ts +454 -0
- package/dist/api.d.ts.map +1 -0
- package/dist/api.js +2442 -0
- package/dist/api.js.map +1 -0
- package/dist/app-consts.d.ts +10 -0
- package/dist/app-consts.d.ts.map +1 -0
- package/dist/app-consts.js +39 -0
- package/dist/app-consts.js.map +1 -0
- package/dist/app-update.d.ts +12 -0
- package/dist/app-update.d.ts.map +1 -0
- package/dist/app-update.js +32 -0
- package/dist/app-update.js.map +1 -0
- package/dist/aria.d.ts +152 -0
- package/dist/aria.d.ts.map +1 -0
- package/dist/aria.js +524 -0
- package/dist/aria.js.map +1 -0
- package/dist/audio-core.d.ts +260 -0
- package/dist/audio-core.d.ts.map +1 -0
- package/dist/audio-core.js +1440 -0
- package/dist/audio-core.js.map +1 -0
- package/dist/audio-edit.d.ts +100 -0
- package/dist/audio-edit.d.ts.map +1 -0
- package/dist/audio-edit.js +489 -0
- package/dist/audio-edit.js.map +1 -0
- package/dist/audio-mix.d.ts +84 -0
- package/dist/audio-mix.d.ts.map +1 -0
- package/dist/audio-mix.js +393 -0
- package/dist/audio-mix.js.map +1 -0
- package/dist/auth-proof.d.ts +145 -0
- package/dist/auth-proof.d.ts.map +1 -0
- package/dist/auth-proof.js +644 -0
- package/dist/auth-proof.js.map +1 -0
- package/dist/availability-explain.d.ts +3 -0
- package/dist/availability-explain.d.ts.map +1 -0
- package/dist/availability-explain.js +322 -0
- package/dist/availability-explain.js.map +1 -0
- package/dist/availability.d.ts +246 -0
- package/dist/availability.d.ts.map +1 -0
- package/dist/availability.js +615 -0
- package/dist/availability.js.map +1 -0
- package/dist/background.d.ts +116 -0
- package/dist/background.d.ts.map +1 -0
- package/dist/background.js +235 -0
- package/dist/background.js.map +1 -0
- package/dist/boot-tables-flag.d.ts +2 -0
- package/dist/boot-tables-flag.d.ts.map +1 -0
- package/dist/boot-tables-flag.js +16 -0
- package/dist/boot-tables-flag.js.map +1 -0
- package/dist/boot-tables.d.ts +40 -0
- package/dist/boot-tables.d.ts.map +1 -0
- package/dist/boot-tables.js +102 -0
- package/dist/boot-tables.js.map +1 -0
- package/dist/border-edges.d.ts +5 -0
- package/dist/border-edges.d.ts.map +1 -0
- package/dist/border-edges.js +47 -0
- package/dist/border-edges.js.map +1 -0
- package/dist/bus.d.ts +1203 -0
- package/dist/bus.d.ts.map +1 -0
- package/dist/bus.js +2647 -0
- package/dist/bus.js.map +1 -0
- package/dist/calendar-core.d.ts +143 -0
- package/dist/calendar-core.d.ts.map +1 -0
- package/dist/calendar-core.js +372 -0
- package/dist/calendar-core.js.map +1 -0
- package/dist/call-value.d.ts +16 -0
- package/dist/call-value.d.ts.map +1 -0
- package/dist/call-value.js +54 -0
- package/dist/call-value.js.map +1 -0
- package/dist/camera-core.d.ts +222 -0
- package/dist/camera-core.d.ts.map +1 -0
- package/dist/camera-core.js +980 -0
- package/dist/camera-core.js.map +1 -0
- package/dist/canvas-core.d.ts +404 -0
- package/dist/canvas-core.d.ts.map +1 -0
- package/dist/canvas-core.js +2186 -0
- package/dist/canvas-core.js.map +1 -0
- package/dist/capture-core.d.ts +74 -0
- package/dist/capture-core.d.ts.map +1 -0
- package/dist/capture-core.js +158 -0
- package/dist/capture-core.js.map +1 -0
- package/dist/compile/codegen.d.ts +146 -0
- package/dist/compile/codegen.d.ts.map +1 -0
- package/dist/compile/codegen.js +1949 -0
- package/dist/compile/codegen.js.map +1 -0
- package/dist/compile/jstier.d.ts +44 -0
- package/dist/compile/jstier.d.ts.map +1 -0
- package/dist/compile/jstier.js +181 -0
- package/dist/compile/jstier.js.map +1 -0
- package/dist/compile/tier-door.d.ts +41 -0
- package/dist/compile/tier-door.d.ts.map +1 -0
- package/dist/compile/tier-door.js +167 -0
- package/dist/compile/tier-door.js.map +1 -0
- package/dist/compile/tier-realm.d.ts +49 -0
- package/dist/compile/tier-realm.d.ts.map +1 -0
- package/dist/compile/tier-realm.js +368 -0
- package/dist/compile/tier-realm.js.map +1 -0
- package/dist/compile/tier.d.ts +23 -0
- package/dist/compile/tier.d.ts.map +1 -0
- package/dist/compile/tier.js +157 -0
- package/dist/compile/tier.js.map +1 -0
- package/dist/compose-core.d.ts +86 -0
- package/dist/compose-core.d.ts.map +1 -0
- package/dist/compose-core.js +112 -0
- package/dist/compose-core.js.map +1 -0
- package/dist/config-validate.d.ts +31 -0
- package/dist/config-validate.d.ts.map +1 -0
- package/dist/config-validate.js +147 -0
- package/dist/config-validate.js.map +1 -0
- package/dist/config-values.d.ts +106 -0
- package/dist/config-values.d.ts.map +1 -0
- package/dist/config-values.js +340 -0
- package/dist/config-values.js.map +1 -0
- package/dist/contacts-core.d.ts +127 -0
- package/dist/contacts-core.d.ts.map +1 -0
- package/dist/contacts-core.js +211 -0
- package/dist/contacts-core.js.map +1 -0
- package/dist/content-transition.d.ts +58 -0
- package/dist/content-transition.d.ts.map +1 -0
- package/dist/content-transition.js +94 -0
- package/dist/content-transition.js.map +1 -0
- package/dist/controls-core.d.ts +227 -0
- package/dist/controls-core.d.ts.map +1 -0
- package/dist/controls-core.js +652 -0
- package/dist/controls-core.js.map +1 -0
- package/dist/cookies.d.ts +78 -0
- package/dist/cookies.d.ts.map +1 -0
- package/dist/cookies.js +265 -0
- package/dist/cookies.js.map +1 -0
- package/dist/corner-shape-core.d.ts +69 -0
- package/dist/corner-shape-core.d.ts.map +1 -0
- package/dist/corner-shape-core.js +261 -0
- package/dist/corner-shape-core.js.map +1 -0
- package/dist/crypto-core.d.ts +57 -0
- package/dist/crypto-core.d.ts.map +1 -0
- package/dist/crypto-core.js +128 -0
- package/dist/crypto-core.js.map +1 -0
- package/dist/dataviz.d.ts +436 -0
- package/dist/dataviz.d.ts.map +1 -0
- package/dist/dataviz.js +956 -0
- package/dist/dataviz.js.map +1 -0
- package/dist/debug.d.ts +293 -0
- package/dist/debug.d.ts.map +1 -0
- package/dist/debug.js +767 -0
- package/dist/debug.js.map +1 -0
- package/dist/device-ownership.d.ts +50 -0
- package/dist/device-ownership.d.ts.map +1 -0
- package/dist/device-ownership.js +105 -0
- package/dist/device-ownership.js.map +1 -0
- package/dist/effects.d.ts +86 -0
- package/dist/effects.d.ts.map +1 -0
- package/dist/effects.js +98 -0
- package/dist/effects.js.map +1 -0
- package/dist/element.d.ts +108 -0
- package/dist/element.d.ts.map +1 -0
- package/dist/element.js +63 -0
- package/dist/element.js.map +1 -0
- package/dist/file-watch.d.ts +16 -0
- package/dist/file-watch.d.ts.map +1 -0
- package/dist/file-watch.js +49 -0
- package/dist/file-watch.js.map +1 -0
- package/dist/filepaths.d.ts +72 -0
- package/dist/filepaths.d.ts.map +1 -0
- package/dist/filepaths.js +271 -0
- package/dist/filepaths.js.map +1 -0
- package/dist/film.d.ts +264 -0
- package/dist/film.d.ts.map +1 -0
- package/dist/film.js +313 -0
- package/dist/film.js.map +1 -0
- package/dist/fonts.d.ts +66 -0
- package/dist/fonts.d.ts.map +1 -0
- package/dist/fonts.js +135 -0
- package/dist/fonts.js.map +1 -0
- package/dist/forms.d.ts +191 -0
- package/dist/forms.d.ts.map +1 -0
- package/dist/forms.js +663 -0
- package/dist/forms.js.map +1 -0
- package/dist/geo.d.ts +289 -0
- package/dist/geo.d.ts.map +1 -0
- package/dist/geo.js +460 -0
- package/dist/geo.js.map +1 -0
- package/dist/handler-announce.d.ts +46 -0
- package/dist/handler-announce.d.ts.map +1 -0
- package/dist/handler-announce.js +96 -0
- package/dist/handler-announce.js.map +1 -0
- package/dist/handoff.d.ts +71 -0
- package/dist/handoff.d.ts.map +1 -0
- package/dist/handoff.js +250 -0
- package/dist/handoff.js.map +1 -0
- package/dist/identity-durability.d.ts +76 -0
- package/dist/identity-durability.d.ts.map +1 -0
- package/dist/identity-durability.js +150 -0
- package/dist/identity-durability.js.map +1 -0
- package/dist/image-core.d.ts +240 -0
- package/dist/image-core.d.ts.map +1 -0
- package/dist/image-core.js +618 -0
- package/dist/image-core.js.map +1 -0
- package/dist/image-schemes.d.ts +10 -0
- package/dist/image-schemes.d.ts.map +1 -0
- package/dist/image-schemes.js +28 -0
- package/dist/image-schemes.js.map +1 -0
- package/dist/index.d.ts +143 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +299 -0
- package/dist/index.js.map +1 -0
- package/dist/ink-core.d.ts +53 -0
- package/dist/ink-core.d.ts.map +1 -0
- package/dist/ink-core.js +119 -0
- package/dist/ink-core.js.map +1 -0
- package/dist/input.d.ts +148 -0
- package/dist/input.d.ts.map +1 -0
- package/dist/input.js +358 -0
- package/dist/input.js.map +1 -0
- package/dist/integrity.d.ts +63 -0
- package/dist/integrity.d.ts.map +1 -0
- package/dist/integrity.js +150 -0
- package/dist/integrity.js.map +1 -0
- package/dist/intents.d.ts +95 -0
- package/dist/intents.d.ts.map +1 -0
- package/dist/intents.js +282 -0
- package/dist/intents.js.map +1 -0
- package/dist/interpolate-core.d.ts +37 -0
- package/dist/interpolate-core.d.ts.map +1 -0
- package/dist/interpolate-core.js +443 -0
- package/dist/interpolate-core.js.map +1 -0
- package/dist/jse/color.d.ts +12 -0
- package/dist/jse/color.d.ts.map +1 -0
- package/dist/jse/color.js +196 -0
- package/dist/jse/color.js.map +1 -0
- package/dist/jse/core.d.ts +54 -0
- package/dist/jse/core.d.ts.map +1 -0
- package/dist/jse/core.js +1519 -0
- package/dist/jse/core.js.map +1 -0
- package/dist/jse/dispatch.d.ts +28 -0
- package/dist/jse/dispatch.d.ts.map +1 -0
- package/dist/jse/dispatch.js +116 -0
- package/dist/jse/dispatch.js.map +1 -0
- package/dist/jse/highlight-grammar.d.ts +15 -0
- package/dist/jse/highlight-grammar.d.ts.map +1 -0
- package/dist/jse/highlight-grammar.js +161 -0
- package/dist/jse/highlight-grammar.js.map +1 -0
- package/dist/jse/highlight-grammars.generated.d.ts +2 -0
- package/dist/jse/highlight-grammars.generated.d.ts.map +1 -0
- package/dist/jse/highlight-grammars.generated.js +4 -0
- package/dist/jse/highlight-grammars.generated.js.map +1 -0
- package/dist/jse/highlight.d.ts +37 -0
- package/dist/jse/highlight.d.ts.map +1 -0
- package/dist/jse/highlight.js +323 -0
- package/dist/jse/highlight.js.map +1 -0
- package/dist/jse/jse.d.ts +674 -0
- package/dist/jse/jse.d.ts.map +1 -0
- package/dist/jse/jse.js +5841 -0
- package/dist/jse/jse.js.map +1 -0
- package/dist/jse/pathmatch.d.ts +10 -0
- package/dist/jse/pathmatch.d.ts.map +1 -0
- package/dist/jse/pathmatch.js +73 -0
- package/dist/jse/pathmatch.js.map +1 -0
- package/dist/jse/regex.d.ts +33 -0
- package/dist/jse/regex.d.ts.map +1 -0
- package/dist/jse/regex.js +375 -0
- package/dist/jse/regex.js.map +1 -0
- package/dist/jse/stdlib.d.ts +8 -0
- package/dist/jse/stdlib.d.ts.map +1 -0
- package/dist/jse/stdlib.js +765 -0
- package/dist/jse/stdlib.js.map +1 -0
- package/dist/jse/tokens.d.ts +102 -0
- package/dist/jse/tokens.d.ts.map +1 -0
- package/dist/jse/tokens.js +982 -0
- package/dist/jse/tokens.js.map +1 -0
- package/dist/jse/values.d.ts +206 -0
- package/dist/jse/values.d.ts.map +1 -0
- package/dist/jse/values.js +846 -0
- package/dist/jse/values.js.map +1 -0
- package/dist/keyboard.d.ts +196 -0
- package/dist/keyboard.d.ts.map +1 -0
- package/dist/keyboard.js +186 -0
- package/dist/keyboard.js.map +1 -0
- package/dist/label-choices.d.ts +3 -0
- package/dist/label-choices.d.ts.map +1 -0
- package/dist/label-choices.js +168 -0
- package/dist/label-choices.js.map +1 -0
- package/dist/language.d.ts +33 -0
- package/dist/language.d.ts.map +1 -0
- package/dist/language.js +50 -0
- package/dist/language.js.map +1 -0
- package/dist/length-units.d.ts +30 -0
- package/dist/length-units.d.ts.map +1 -0
- package/dist/length-units.js +83 -0
- package/dist/length-units.js.map +1 -0
- package/dist/lightsensor.d.ts +48 -0
- package/dist/lightsensor.d.ts.map +1 -0
- package/dist/lightsensor.js +97 -0
- package/dist/lightsensor.js.map +1 -0
- package/dist/link-refresh.d.ts +27 -0
- package/dist/link-refresh.d.ts.map +1 -0
- package/dist/link-refresh.js +166 -0
- package/dist/link-refresh.js.map +1 -0
- package/dist/link.d.ts +57 -0
- package/dist/link.d.ts.map +1 -0
- package/dist/link.js +333 -0
- package/dist/link.js.map +1 -0
- package/dist/linkpreview.d.ts +114 -0
- package/dist/linkpreview.d.ts.map +1 -0
- package/dist/linkpreview.js +439 -0
- package/dist/linkpreview.js.map +1 -0
- package/dist/list-presence.d.ts +32 -0
- package/dist/list-presence.d.ts.map +1 -0
- package/dist/list-presence.js +48 -0
- package/dist/list-presence.js.map +1 -0
- package/dist/live-stream.d.ts +27 -0
- package/dist/live-stream.d.ts.map +1 -0
- package/dist/live-stream.js +274 -0
- package/dist/live-stream.js.map +1 -0
- package/dist/livelogs.d.ts +134 -0
- package/dist/livelogs.d.ts.map +1 -0
- package/dist/livelogs.js +409 -0
- package/dist/livelogs.js.map +1 -0
- package/dist/logs.d.ts +80 -0
- package/dist/logs.d.ts.map +1 -0
- package/dist/logs.js +206 -0
- package/dist/logs.js.map +1 -0
- package/dist/mcp/apps.d.ts +82 -0
- package/dist/mcp/apps.d.ts.map +1 -0
- package/dist/mcp/apps.js +219 -0
- package/dist/mcp/apps.js.map +1 -0
- package/dist/mcp/entities.d.ts +25 -0
- package/dist/mcp/entities.d.ts.map +1 -0
- package/dist/mcp/entities.js +71 -0
- package/dist/mcp/entities.js.map +1 -0
- package/dist/mcp/result.d.ts +73 -0
- package/dist/mcp/result.d.ts.map +1 -0
- package/dist/mcp/result.js +119 -0
- package/dist/mcp/result.js.map +1 -0
- package/dist/mcp/webmcp.d.ts +162 -0
- package/dist/mcp/webmcp.d.ts.map +1 -0
- package/dist/mcp/webmcp.js +214 -0
- package/dist/mcp/webmcp.js.map +1 -0
- package/dist/mcp.d.ts +5 -0
- package/dist/mcp.d.ts.map +1 -0
- package/dist/mcp.js +14 -0
- package/dist/mcp.js.map +1 -0
- package/dist/media-core.d.ts +191 -0
- package/dist/media-core.d.ts.map +1 -0
- package/dist/media-core.js +446 -0
- package/dist/media-core.js.map +1 -0
- package/dist/media-timeline-core.d.ts +94 -0
- package/dist/media-timeline-core.d.ts.map +1 -0
- package/dist/media-timeline-core.js +620 -0
- package/dist/media-timeline-core.js.map +1 -0
- package/dist/message.d.ts +42 -0
- package/dist/message.d.ts.map +1 -0
- package/dist/message.js +582 -0
- package/dist/message.js.map +1 -0
- package/dist/missing-element.d.ts +29 -0
- package/dist/missing-element.d.ts.map +1 -0
- package/dist/missing-element.js +76 -0
- package/dist/missing-element.js.map +1 -0
- package/dist/motion-core.d.ts +160 -0
- package/dist/motion-core.d.ts.map +1 -0
- package/dist/motion-core.js +752 -0
- package/dist/motion-core.js.map +1 -0
- package/dist/motion-pose.d.ts +65 -0
- package/dist/motion-pose.d.ts.map +1 -0
- package/dist/motion-pose.js +143 -0
- package/dist/motion-pose.js.map +1 -0
- package/dist/motion.d.ts +132 -0
- package/dist/motion.d.ts.map +1 -0
- package/dist/motion.js +260 -0
- package/dist/motion.js.map +1 -0
- package/dist/mount-core.d.ts +203 -0
- package/dist/mount-core.d.ts.map +1 -0
- package/dist/mount-core.js +437 -0
- package/dist/mount-core.js.map +1 -0
- package/dist/net-core.d.ts +110 -0
- package/dist/net-core.d.ts.map +1 -0
- package/dist/net-core.js +225 -0
- package/dist/net-core.js.map +1 -0
- package/dist/notify.d.ts +399 -0
- package/dist/notify.d.ts.map +1 -0
- package/dist/notify.js +964 -0
- package/dist/notify.js.map +1 -0
- package/dist/orientation-binding.d.ts +39 -0
- package/dist/orientation-binding.d.ts.map +1 -0
- package/dist/orientation-binding.js +64 -0
- package/dist/orientation-binding.js.map +1 -0
- package/dist/orientation.d.ts +55 -0
- package/dist/orientation.d.ts.map +1 -0
- package/dist/orientation.js +89 -0
- package/dist/orientation.js.map +1 -0
- package/dist/ota.d.ts +52 -0
- package/dist/ota.d.ts.map +1 -0
- package/dist/ota.js +122 -0
- package/dist/ota.js.map +1 -0
- package/dist/passkeys.d.ts +91 -0
- package/dist/passkeys.d.ts.map +1 -0
- package/dist/passkeys.js +307 -0
- package/dist/passkeys.js.map +1 -0
- package/dist/payment.d.ts +85 -0
- package/dist/payment.d.ts.map +1 -0
- package/dist/payment.js +270 -0
- package/dist/payment.js.map +1 -0
- package/dist/pending-presenter.d.ts +31 -0
- package/dist/pending-presenter.d.ts.map +1 -0
- package/dist/pending-presenter.js +119 -0
- package/dist/pending-presenter.js.map +1 -0
- package/dist/permission-core.d.ts +59 -0
- package/dist/permission-core.d.ts.map +1 -0
- package/dist/permission-core.js +102 -0
- package/dist/permission-core.js.map +1 -0
- package/dist/persist.d.ts +169 -0
- package/dist/persist.d.ts.map +1 -0
- package/dist/persist.js +361 -0
- package/dist/persist.js.map +1 -0
- package/dist/phase-plan.d.ts +114 -0
- package/dist/phase-plan.d.ts.map +1 -0
- package/dist/phase-plan.js +837 -0
- package/dist/phase-plan.js.map +1 -0
- package/dist/playback-core.d.ts +64 -0
- package/dist/playback-core.d.ts.map +1 -0
- package/dist/playback-core.js +176 -0
- package/dist/playback-core.js.map +1 -0
- package/dist/player-sources.d.ts +12 -0
- package/dist/player-sources.d.ts.map +1 -0
- package/dist/player-sources.js +44 -0
- package/dist/player-sources.js.map +1 -0
- package/dist/proxy-denylist.d.ts +11 -0
- package/dist/proxy-denylist.d.ts.map +1 -0
- package/dist/proxy-denylist.js +44 -0
- package/dist/proxy-denylist.js.map +1 -0
- package/dist/public-config.d.ts +20 -0
- package/dist/public-config.d.ts.map +1 -0
- package/dist/public-config.js +109 -0
- package/dist/public-config.js.map +1 -0
- package/dist/qoe-core.d.ts +72 -0
- package/dist/qoe-core.d.ts.map +1 -0
- package/dist/qoe-core.js +113 -0
- package/dist/qoe-core.js.map +1 -0
- package/dist/reactive-request.d.ts +80 -0
- package/dist/reactive-request.d.ts.map +1 -0
- package/dist/reactive-request.js +192 -0
- package/dist/reactive-request.js.map +1 -0
- package/dist/read-cache.d.ts +129 -0
- package/dist/read-cache.d.ts.map +1 -0
- package/dist/read-cache.js +566 -0
- package/dist/read-cache.js.map +1 -0
- package/dist/recorder-core.d.ts +57 -0
- package/dist/recorder-core.d.ts.map +1 -0
- package/dist/recorder-core.js +136 -0
- package/dist/recorder-core.js.map +1 -0
- package/dist/ref.d.ts +41 -0
- package/dist/ref.d.ts.map +1 -0
- package/dist/ref.js +98 -0
- package/dist/ref.js.map +1 -0
- package/dist/refusal.d.ts +82 -0
- package/dist/refusal.d.ts.map +1 -0
- package/dist/refusal.js +218 -0
- package/dist/refusal.js.map +1 -0
- package/dist/region-insets.d.ts +61 -0
- package/dist/region-insets.d.ts.map +1 -0
- package/dist/region-insets.js +67 -0
- package/dist/region-insets.js.map +1 -0
- package/dist/rive-core.d.ts +323 -0
- package/dist/rive-core.d.ts.map +1 -0
- package/dist/rive-core.js +677 -0
- package/dist/rive-core.js.map +1 -0
- package/dist/runner.d.ts +595 -0
- package/dist/runner.d.ts.map +1 -0
- package/dist/runner.js +4094 -0
- package/dist/runner.js.map +1 -0
- package/dist/scene/a11y.d.ts +11 -0
- package/dist/scene/a11y.d.ts.map +1 -0
- package/dist/scene/a11y.js +67 -0
- package/dist/scene/a11y.js.map +1 -0
- package/dist/scene/anim.d.ts +149 -0
- package/dist/scene/anim.d.ts.map +1 -0
- package/dist/scene/anim.js +396 -0
- package/dist/scene/anim.js.map +1 -0
- package/dist/scene/bind.d.ts +33 -0
- package/dist/scene/bind.d.ts.map +1 -0
- package/dist/scene/bind.js +66 -0
- package/dist/scene/bind.js.map +1 -0
- package/dist/scene/collide.d.ts +56 -0
- package/dist/scene/collide.d.ts.map +1 -0
- package/dist/scene/collide.js +146 -0
- package/dist/scene/collide.js.map +1 -0
- package/dist/scene/frame.d.ts +22 -0
- package/dist/scene/frame.d.ts.map +1 -0
- package/dist/scene/frame.js +57 -0
- package/dist/scene/frame.js.map +1 -0
- package/dist/scene/gltf.d.ts +79 -0
- package/dist/scene/gltf.d.ts.map +1 -0
- package/dist/scene/gltf.js +409 -0
- package/dist/scene/gltf.js.map +1 -0
- package/dist/scene/ir.d.ts +293 -0
- package/dist/scene/ir.d.ts.map +1 -0
- package/dist/scene/ir.js +692 -0
- package/dist/scene/ir.js.map +1 -0
- package/dist/scene/math.d.ts +50 -0
- package/dist/scene/math.d.ts.map +1 -0
- package/dist/scene/math.js +180 -0
- package/dist/scene/math.js.map +1 -0
- package/dist/scene/orbit.d.ts +19 -0
- package/dist/scene/orbit.d.ts.map +1 -0
- package/dist/scene/orbit.js +60 -0
- package/dist/scene/orbit.js.map +1 -0
- package/dist/scene/physics.d.ts +228 -0
- package/dist/scene/physics.d.ts.map +1 -0
- package/dist/scene/physics.js +1500 -0
- package/dist/scene/physics.js.map +1 -0
- package/dist/scene/registry.d.ts +85 -0
- package/dist/scene/registry.d.ts.map +1 -0
- package/dist/scene/registry.js +75 -0
- package/dist/scene/registry.js.map +1 -0
- package/dist/scene/skin.d.ts +82 -0
- package/dist/scene/skin.d.ts.map +1 -0
- package/dist/scene/skin.js +351 -0
- package/dist/scene/skin.js.map +1 -0
- package/dist/scene/sprite.d.ts +36 -0
- package/dist/scene/sprite.d.ts.map +1 -0
- package/dist/scene/sprite.js +107 -0
- package/dist/scene/sprite.js.map +1 -0
- package/dist/scene/viewer.d.ts +96 -0
- package/dist/scene/viewer.d.ts.map +1 -0
- package/dist/scene/viewer.js +235 -0
- package/dist/scene/viewer.js.map +1 -0
- package/dist/scoped-slots.d.ts +9 -0
- package/dist/scoped-slots.d.ts.map +1 -0
- package/dist/scoped-slots.js +42 -0
- package/dist/scoped-slots.js.map +1 -0
- package/dist/screen.d.ts +109 -0
- package/dist/screen.d.ts.map +1 -0
- package/dist/screen.js +309 -0
- package/dist/screen.js.map +1 -0
- package/dist/scroll.d.ts +525 -0
- package/dist/scroll.d.ts.map +1 -0
- package/dist/scroll.js +1226 -0
- package/dist/scroll.js.map +1 -0
- package/dist/settings-plane.d.ts +58 -0
- package/dist/settings-plane.d.ts.map +1 -0
- package/dist/settings-plane.js +86 -0
- package/dist/settings-plane.js.map +1 -0
- package/dist/share-inbox.d.ts +56 -0
- package/dist/share-inbox.d.ts.map +1 -0
- package/dist/share-inbox.js +114 -0
- package/dist/share-inbox.js.map +1 -0
- package/dist/shared-transition.d.ts +152 -0
- package/dist/shared-transition.d.ts.map +1 -0
- package/dist/shared-transition.js +257 -0
- package/dist/shared-transition.js.map +1 -0
- package/dist/sheet-content-padding.d.ts +24 -0
- package/dist/sheet-content-padding.d.ts.map +1 -0
- package/dist/sheet-content-padding.js +32 -0
- package/dist/sheet-content-padding.js.map +1 -0
- package/dist/shot-devices.d.ts +36 -0
- package/dist/shot-devices.d.ts.map +1 -0
- package/dist/shot-devices.js +90 -0
- package/dist/shot-devices.js.map +1 -0
- package/dist/shot-guards.d.ts +100 -0
- package/dist/shot-guards.d.ts.map +1 -0
- package/dist/shot-guards.js +260 -0
- package/dist/shot-guards.js.map +1 -0
- package/dist/shot-scope.d.ts +140 -0
- package/dist/shot-scope.d.ts.map +1 -0
- package/dist/shot-scope.js +302 -0
- package/dist/shot-scope.js.map +1 -0
- package/dist/slot-partition.d.ts +9 -0
- package/dist/slot-partition.d.ts.map +1 -0
- package/dist/slot-partition.js +38 -0
- package/dist/slot-partition.js.map +1 -0
- package/dist/snackbar.d.ts +165 -0
- package/dist/snackbar.d.ts.map +1 -0
- package/dist/snackbar.js +220 -0
- package/dist/snackbar.js.map +1 -0
- package/dist/socket.d.ts +96 -0
- package/dist/socket.d.ts.map +1 -0
- package/dist/socket.js +370 -0
- package/dist/socket.js.map +1 -0
- package/dist/spotlight.d.ts +77 -0
- package/dist/spotlight.d.ts.map +1 -0
- package/dist/spotlight.js +174 -0
- package/dist/spotlight.js.map +1 -0
- package/dist/state-primitive.d.ts +37 -0
- package/dist/state-primitive.d.ts.map +1 -0
- package/dist/state-primitive.js +91 -0
- package/dist/state-primitive.js.map +1 -0
- package/dist/store-query.d.ts +25 -0
- package/dist/store-query.d.ts.map +1 -0
- package/dist/store-query.js +88 -0
- package/dist/store-query.js.map +1 -0
- package/dist/store-value.d.ts +48 -0
- package/dist/store-value.d.ts.map +1 -0
- package/dist/store-value.js +264 -0
- package/dist/store-value.js.map +1 -0
- package/dist/store-versioning.d.ts +70 -0
- package/dist/store-versioning.d.ts.map +1 -0
- package/dist/store-versioning.js +188 -0
- package/dist/store-versioning.js.map +1 -0
- package/dist/store.d.ts +282 -0
- package/dist/store.d.ts.map +1 -0
- package/dist/store.js +1144 -0
- package/dist/store.js.map +1 -0
- package/dist/strings.d.ts +141 -0
- package/dist/strings.d.ts.map +1 -0
- package/dist/strings.js +581 -0
- package/dist/strings.js.map +1 -0
- package/dist/telemetry.d.ts +95 -0
- package/dist/telemetry.d.ts.map +1 -0
- package/dist/telemetry.js +255 -0
- package/dist/telemetry.js.map +1 -0
- package/dist/transform-core.d.ts +228 -0
- package/dist/transform-core.d.ts.map +1 -0
- package/dist/transform-core.js +921 -0
- package/dist/transform-core.js.map +1 -0
- package/dist/transition-core.d.ts +58 -0
- package/dist/transition-core.d.ts.map +1 -0
- package/dist/transition-core.js +352 -0
- package/dist/transition-core.js.map +1 -0
- package/dist/trim-trailing.d.ts +3 -0
- package/dist/trim-trailing.d.ts.map +1 -0
- package/dist/trim-trailing.js +14 -0
- package/dist/trim-trailing.js.map +1 -0
- package/dist/upload.d.ts +51 -0
- package/dist/upload.d.ts.map +1 -0
- package/dist/upload.js +68 -0
- package/dist/upload.js.map +1 -0
- package/dist/vendor-face.d.ts +44 -0
- package/dist/vendor-face.d.ts.map +1 -0
- package/dist/vendor-face.js +80 -0
- package/dist/vendor-face.js.map +1 -0
- package/dist/vendor-session.d.ts +166 -0
- package/dist/vendor-session.d.ts.map +1 -0
- package/dist/vendor-session.js +423 -0
- package/dist/vendor-session.js.map +1 -0
- package/dist/vendor-surface.d.ts +290 -0
- package/dist/vendor-surface.d.ts.map +1 -0
- package/dist/vendor-surface.js +439 -0
- package/dist/vendor-surface.js.map +1 -0
- package/dist/version-rules.generated.d.ts +17 -0
- package/dist/version-rules.generated.d.ts.map +1 -0
- package/dist/version-rules.generated.js +99 -0
- package/dist/version-rules.generated.js.map +1 -0
- package/dist/view-transition-core.d.ts +99 -0
- package/dist/view-transition-core.d.ts.map +1 -0
- package/dist/view-transition-core.js +127 -0
- package/dist/view-transition-core.js.map +1 -0
- package/dist/view-transition-door.d.ts +26 -0
- package/dist/view-transition-door.d.ts.map +1 -0
- package/dist/view-transition-door.js +88 -0
- package/dist/view-transition-door.js.map +1 -0
- package/dist/window-identity.d.ts +3 -0
- package/dist/window-identity.d.ts.map +1 -0
- package/dist/window-identity.js +27 -0
- package/dist/window-identity.js.map +1 -0
- package/package.json +139 -4
|
@@ -0,0 +1,677 @@
|
|
|
1
|
+
//
|
|
2
|
+
// rive-core.ts - the shared `<rive>` core (parity/U12-rive.md): the state-machine input
|
|
3
|
+
// plane, artboard/machine/animation selection, the fit and alignment fold, the playback
|
|
4
|
+
// and residency lifecycle, the event payloads and the accessibility verdict. The law is
|
|
5
|
+
// the corpus, OpenSource/Conformance/rive/; the Kotlin twin is :core RiveCore.kt and the
|
|
6
|
+
// Swift twin is Engine/Swift/RiveCore.swift, both reading the SAME six files off disk.
|
|
7
|
+
//
|
|
8
|
+
// WHY A SHARED CORE WHEN THE RENDERER IS ONE VENDOR LIBRARY. Rive's own runtime draws the
|
|
9
|
+
// same picture on all three platforms, so pixels are the one thing that cannot diverge and
|
|
10
|
+
// the one thing worth pinning nowhere. What CAN diverge is everything around the vendor
|
|
11
|
+
// library: which artboard a missing name resolves to, whether a trigger fires twice on a
|
|
12
|
+
// re-render, whether an offscreen animation keeps advancing, what a state change looks like
|
|
13
|
+
// when it reaches an author's handler. Three hand-written adapters would answer those four
|
|
14
|
+
// questions four ways. They live here instead, as data folds with no vendor type in sight.
|
|
15
|
+
//
|
|
16
|
+
// This file imports only the kernel's own image core (the CSS `object-position` fold) and names no Rive symbol: the RUNTIME is a separate module
|
|
17
|
+
// (Core/Rive, MIT, vendored and pinned there), and the kernel keeps resolving zero package
|
|
18
|
+
// coordinates. What lives here is arithmetic and vocabulary.
|
|
19
|
+
//
|
|
20
|
+
// ── numbers ──────────────────────────────────────────────────────────────────────────
|
|
21
|
+
import { resolveContentPosition } from "./image-core.js";
|
|
22
|
+
/** the canonical text of a number, used as the input plane's change token. Six decimals,
|
|
23
|
+
* no negative zero, integers without a point - the same spelling CanvasCore uses, for the
|
|
24
|
+
* same reason: three languages must agree on when a value "changed". */
|
|
25
|
+
export function riveNumberText(value) {
|
|
26
|
+
if (!Number.isFinite(value))
|
|
27
|
+
return "0";
|
|
28
|
+
const rounded = Math.round(value * 1e6) / 1e6;
|
|
29
|
+
if (Object.is(rounded, -0) || rounded === 0)
|
|
30
|
+
return "0";
|
|
31
|
+
return String(rounded);
|
|
32
|
+
}
|
|
33
|
+
function round6(value) {
|
|
34
|
+
return Math.round(value * 1e6) / 1e6;
|
|
35
|
+
}
|
|
36
|
+
/** the ONE numeric grammar all three renderers accept in a bound input: an optional sign,
|
|
37
|
+
* decimal digits, an optional exponent. Deliberately narrower than either language's own
|
|
38
|
+
* parser - JS `Number()` reads `0x10` and Kotlin's `toDouble()` reads `1d`, and a value that
|
|
39
|
+
* means 16 on the web and nothing on Android is the exact drift this corpus exists to stop. */
|
|
40
|
+
const RIVE_NUMBER_GRAMMAR = /^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/;
|
|
41
|
+
function parseFiniteNumber(text) {
|
|
42
|
+
const trimmed = text.trim();
|
|
43
|
+
if (!RIVE_NUMBER_GRAMMAR.test(trimmed))
|
|
44
|
+
return null;
|
|
45
|
+
const value = Number(trimmed);
|
|
46
|
+
return Number.isFinite(value) ? value : null;
|
|
47
|
+
}
|
|
48
|
+
/** the tokens a trigger reads as "not fired yet" */
|
|
49
|
+
const RIVE_FALSY_TOKENS = new Set(["", "false", "0"]);
|
|
50
|
+
function booleanToken(raw) {
|
|
51
|
+
if (typeof raw === "boolean")
|
|
52
|
+
return raw;
|
|
53
|
+
if (typeof raw === "number")
|
|
54
|
+
return Number.isFinite(raw) ? raw !== 0 : null;
|
|
55
|
+
if (typeof raw === "string") {
|
|
56
|
+
const low = raw.trim().toLowerCase();
|
|
57
|
+
if (low === "true")
|
|
58
|
+
return true;
|
|
59
|
+
if (low === "false")
|
|
60
|
+
return false;
|
|
61
|
+
const parsed = parseFiniteNumber(low);
|
|
62
|
+
return parsed === null ? null : parsed !== 0;
|
|
63
|
+
}
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
function numberToken(raw) {
|
|
67
|
+
if (typeof raw === "boolean")
|
|
68
|
+
return null; // `count: true` is a shape mistake, not a 1
|
|
69
|
+
if (typeof raw === "number")
|
|
70
|
+
return Number.isFinite(raw) ? raw : null;
|
|
71
|
+
if (typeof raw === "string")
|
|
72
|
+
return parseFiniteNumber(raw);
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
function triggerToken(raw) {
|
|
76
|
+
if (typeof raw === "boolean")
|
|
77
|
+
return raw ? "true" : "false";
|
|
78
|
+
if (typeof raw === "number")
|
|
79
|
+
return riveNumberText(raw);
|
|
80
|
+
return String(raw).trim();
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Turn a bound `inputs` object into the smallest set of writes the machine needs.
|
|
84
|
+
*
|
|
85
|
+
* The DECLARED list is authority (an undeclared key is refused, never guessed at), LEVELS
|
|
86
|
+
* are diffed against `previous` so an unchanged re-render writes nothing, and a TRIGGER is
|
|
87
|
+
* an EDGE: it fires when its token changes to a truthy one. That last rule is the whole
|
|
88
|
+
* reason `inputs` can be declarative - `{ celebrate: order.justPlaced }` fires once per
|
|
89
|
+
* order rather than once per frame, with no imperative call anywhere.
|
|
90
|
+
*
|
|
91
|
+
* A refusal never aborts the plan: one bad binding must not freeze an animation.
|
|
92
|
+
*/
|
|
93
|
+
export function riveInputPlan(declared, bound, previous) {
|
|
94
|
+
const ops = [];
|
|
95
|
+
const refusals = [];
|
|
96
|
+
const values = { ...previous };
|
|
97
|
+
const seen = new Set();
|
|
98
|
+
for (const input of declared) {
|
|
99
|
+
const name = input.name;
|
|
100
|
+
seen.add(name);
|
|
101
|
+
if (!Object.prototype.hasOwnProperty.call(bound, name))
|
|
102
|
+
continue;
|
|
103
|
+
const raw = bound[name];
|
|
104
|
+
if (raw === null || raw === undefined)
|
|
105
|
+
continue; // an unresolved binding is not an error
|
|
106
|
+
const prev = previous[name];
|
|
107
|
+
if (input.type === "boolean") {
|
|
108
|
+
const flag = booleanToken(raw);
|
|
109
|
+
if (flag === null) {
|
|
110
|
+
refusals.push({ name, code: "input_type", message: `input '${name}' expects a boolean` });
|
|
111
|
+
continue;
|
|
112
|
+
}
|
|
113
|
+
const token = flag ? "true" : "false";
|
|
114
|
+
if (token !== prev) {
|
|
115
|
+
ops.push({ name, kind: "boolean", value: flag });
|
|
116
|
+
values[name] = token;
|
|
117
|
+
}
|
|
118
|
+
continue;
|
|
119
|
+
}
|
|
120
|
+
if (input.type === "number") {
|
|
121
|
+
const value = numberToken(raw);
|
|
122
|
+
if (value === null) {
|
|
123
|
+
refusals.push({ name, code: "input_type", message: `input '${name}' expects a number` });
|
|
124
|
+
continue;
|
|
125
|
+
}
|
|
126
|
+
const token = riveNumberText(value);
|
|
127
|
+
if (token !== prev) {
|
|
128
|
+
ops.push({ name, kind: "number", value: round6(value) });
|
|
129
|
+
values[name] = token;
|
|
130
|
+
}
|
|
131
|
+
continue;
|
|
132
|
+
}
|
|
133
|
+
if (input.type === "trigger") {
|
|
134
|
+
const token = triggerToken(raw);
|
|
135
|
+
if (token !== prev && !RIVE_FALSY_TOKENS.has(token.toLowerCase())) {
|
|
136
|
+
ops.push({ name, kind: "trigger", value: null });
|
|
137
|
+
}
|
|
138
|
+
values[name] = token; // the falling edge is recorded too
|
|
139
|
+
continue;
|
|
140
|
+
}
|
|
141
|
+
refusals.push({ name, code: "input_type", message: `input '${name}' has an unknown input type` });
|
|
142
|
+
}
|
|
143
|
+
for (const name of Object.keys(bound).filter((key) => !seen.has(key)).sort()) {
|
|
144
|
+
refusals.push({
|
|
145
|
+
name,
|
|
146
|
+
code: "unknown_input",
|
|
147
|
+
message: `the state machine declares no input named '${name}'`,
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
return { ops, refusals, values };
|
|
151
|
+
}
|
|
152
|
+
function attrText(attrs, name) {
|
|
153
|
+
const raw = attrs[name];
|
|
154
|
+
return raw === null || raw === undefined ? "" : String(raw).trim();
|
|
155
|
+
}
|
|
156
|
+
function refused(code, message) {
|
|
157
|
+
// A refusal is TOTAL: nothing half-mounts a selection it was told to reject.
|
|
158
|
+
return { artboard: null, stateMachine: null, animation: null, mode: "idle", error: { code, message } };
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Resolve which artboard, and which machine or animation inside it, this `<rive>` plays.
|
|
162
|
+
*
|
|
163
|
+
* Every miss is `not_found` NAMING what was asked for and where it was looked up, because a
|
|
164
|
+
* mistyped artboard rendering a blank box is the single worst failure mode this component
|
|
165
|
+
* has (plan §7). `stateMachine` and `animation` together is a conflict rather than a silent
|
|
166
|
+
* precedence rule - the kind of rule an author never finds when it goes the other way.
|
|
167
|
+
*/
|
|
168
|
+
export function riveSelection(manifest, attrs) {
|
|
169
|
+
const boards = manifest.artboards ?? [];
|
|
170
|
+
if (boards.length === 0)
|
|
171
|
+
return refused("not_found", "this .riv file declares no artboard");
|
|
172
|
+
const wantBoard = attrText(attrs, "artboard");
|
|
173
|
+
const wantMachine = attrText(attrs, "stateMachine");
|
|
174
|
+
const wantAnimation = attrText(attrs, "animation");
|
|
175
|
+
if (wantMachine !== "" && wantAnimation !== "") {
|
|
176
|
+
return refused("conflict", "<rive> takes stateMachine or animation, not both");
|
|
177
|
+
}
|
|
178
|
+
let board;
|
|
179
|
+
if (wantBoard !== "") {
|
|
180
|
+
board = boards.find((candidate) => candidate.name === wantBoard);
|
|
181
|
+
if (board === undefined) {
|
|
182
|
+
return refused("not_found", `no artboard named '${wantBoard}' in this .riv file`);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
else {
|
|
186
|
+
board = boards.find((candidate) => candidate.default === true) ?? boards[0];
|
|
187
|
+
}
|
|
188
|
+
const machines = board.stateMachines ?? [];
|
|
189
|
+
const animations = board.animations ?? [];
|
|
190
|
+
if (wantAnimation !== "") {
|
|
191
|
+
if (!animations.includes(wantAnimation)) {
|
|
192
|
+
return refused("not_found", `no animation named '${wantAnimation}' on artboard '${board.name}'`);
|
|
193
|
+
}
|
|
194
|
+
return { artboard: board.name, stateMachine: null, animation: wantAnimation, mode: "animation", error: null };
|
|
195
|
+
}
|
|
196
|
+
if (wantMachine !== "") {
|
|
197
|
+
if (!machines.includes(wantMachine)) {
|
|
198
|
+
return refused("not_found", `no state machine named '${wantMachine}' on artboard '${board.name}'`);
|
|
199
|
+
}
|
|
200
|
+
return { artboard: board.name, stateMachine: wantMachine, animation: null, mode: "machine", error: null };
|
|
201
|
+
}
|
|
202
|
+
if (machines.length > 0) {
|
|
203
|
+
return { artboard: board.name, stateMachine: machines[0], animation: null, mode: "machine", error: null };
|
|
204
|
+
}
|
|
205
|
+
if (animations.length > 0) {
|
|
206
|
+
return { artboard: board.name, stateMachine: null, animation: animations[0], mode: "animation", error: null };
|
|
207
|
+
}
|
|
208
|
+
// An artboard with neither is a static drawing. Legal, and not an error.
|
|
209
|
+
return { artboard: board.name, stateMachine: null, animation: null, mode: "idle", error: null };
|
|
210
|
+
}
|
|
211
|
+
// ── fit and alignment ────────────────────────────────────────────────────────────────
|
|
212
|
+
export const RIVE_FIT_WORDS = {
|
|
213
|
+
cover: "cover", contain: "contain", fill: "fill",
|
|
214
|
+
fitwidth: "fitWidth", fitheight: "fitHeight", none: "none",
|
|
215
|
+
};
|
|
216
|
+
export const RIVE_ALIGNMENT_WORDS = {
|
|
217
|
+
center: "center", centre: "center",
|
|
218
|
+
top: "topCenter", topcenter: "topCenter", topleft: "topLeft", topright: "topRight",
|
|
219
|
+
bottom: "bottomCenter", bottomcenter: "bottomCenter",
|
|
220
|
+
bottomleft: "bottomLeft", bottomright: "bottomRight",
|
|
221
|
+
left: "centerLeft", centerleft: "centerLeft",
|
|
222
|
+
right: "centerRight", centerright: "centerRight",
|
|
223
|
+
};
|
|
224
|
+
const RIVE_ALIGNMENT_FACTORS = {
|
|
225
|
+
topLeft: [0, 0], topCenter: [0.5, 0], topRight: [1, 0],
|
|
226
|
+
centerLeft: [0, 0.5], center: [0.5, 0.5], centerRight: [1, 0.5],
|
|
227
|
+
bottomLeft: [0, 1], bottomCenter: [0.5, 1], bottomRight: [1, 1],
|
|
228
|
+
};
|
|
229
|
+
const RIVE_ALIGNMENT_GRID = [
|
|
230
|
+
["topLeft", "topCenter", "topRight"],
|
|
231
|
+
["centerLeft", "center", "centerRight"],
|
|
232
|
+
["bottomLeft", "bottomCenter", "bottomRight"],
|
|
233
|
+
];
|
|
234
|
+
/** A CSS `object-position` (`left top`, `100% 100%`, `30% 80%`) is the artboard's anchor, snapped to the nearest of the
|
|
235
|
+
* nine positions Rive's runtimes have; a single word or a Rive position word folds as before. */
|
|
236
|
+
function alignmentFromPosition(raw) {
|
|
237
|
+
if (typeof raw !== "string")
|
|
238
|
+
return raw;
|
|
239
|
+
const text = raw.trim();
|
|
240
|
+
if (!/[%\s]/.test(text))
|
|
241
|
+
return raw;
|
|
242
|
+
const anchor = resolveContentPosition(text);
|
|
243
|
+
const column = Math.min(2, Math.max(0, Math.round(anchor.x * 2)));
|
|
244
|
+
const row = Math.min(2, Math.max(0, Math.round(anchor.y * 2)));
|
|
245
|
+
return RIVE_ALIGNMENT_GRID[row][column];
|
|
246
|
+
}
|
|
247
|
+
/** lowercase, strip every separator, then look the word up: `Bottom-Right` is `bottomright`. */
|
|
248
|
+
function foldWord(raw, table, fallback, diagnostics, kind) {
|
|
249
|
+
if (raw === null || raw === undefined)
|
|
250
|
+
return fallback;
|
|
251
|
+
const text = String(raw).trim();
|
|
252
|
+
const key = text.toLowerCase().replace(/[^a-z0-9]/g, "");
|
|
253
|
+
if (key === "")
|
|
254
|
+
return fallback; // absent is not a diagnostic
|
|
255
|
+
const word = table[key];
|
|
256
|
+
if (word === undefined) {
|
|
257
|
+
diagnostics.push(`unknown ${kind} '${text}'`);
|
|
258
|
+
return fallback;
|
|
259
|
+
}
|
|
260
|
+
return word;
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Place an artboard of `content` size inside a `box`. Scale is per-fit; placement is
|
|
264
|
+
* `align * (box - content * scale)`, so the same nine factors serve all six fits.
|
|
265
|
+
*
|
|
266
|
+
* An unknown word FOLDS to the default and is diagnosed rather than refused: a typo in a
|
|
267
|
+
* presentation attribute must not blank an animation, and must not be silent either. A
|
|
268
|
+
* zero-sized artboard is diagnosed and placed at scale 1, because a NaN transform is an
|
|
269
|
+
* invisible animation nobody can debug.
|
|
270
|
+
*/
|
|
271
|
+
export function riveFit(fit, alignment, contentWidth, contentHeight, boxWidth, boxHeight) {
|
|
272
|
+
const diagnostics = [];
|
|
273
|
+
const fitWord = foldWord(fit, RIVE_FIT_WORDS, "contain", diagnostics, "fit");
|
|
274
|
+
const alignWord = foldWord(alignmentFromPosition(alignment), RIVE_ALIGNMENT_WORDS, "center", diagnostics, "alignment");
|
|
275
|
+
const [ax, ay] = RIVE_ALIGNMENT_FACTORS[alignWord] ?? [0.5, 0.5];
|
|
276
|
+
const sane = Number.isFinite(contentWidth) && Number.isFinite(contentHeight)
|
|
277
|
+
&& Number.isFinite(boxWidth) && Number.isFinite(boxHeight)
|
|
278
|
+
&& contentWidth > 0 && contentHeight > 0 && boxWidth >= 0 && boxHeight >= 0;
|
|
279
|
+
if (!sane) {
|
|
280
|
+
diagnostics.push("the artboard has no intrinsic size");
|
|
281
|
+
return {
|
|
282
|
+
fit: fitWord, alignment: alignWord, scaleX: 1, scaleY: 1,
|
|
283
|
+
x: round6(ax * Math.max(Number.isFinite(boxWidth) ? boxWidth : 0, 0)),
|
|
284
|
+
y: round6(ay * Math.max(Number.isFinite(boxHeight) ? boxHeight : 0, 0)),
|
|
285
|
+
diagnostics,
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
let scaleX;
|
|
289
|
+
let scaleY;
|
|
290
|
+
switch (fitWord) {
|
|
291
|
+
case "cover":
|
|
292
|
+
scaleX = scaleY = Math.max(boxWidth / contentWidth, boxHeight / contentHeight);
|
|
293
|
+
break;
|
|
294
|
+
case "fill":
|
|
295
|
+
scaleX = boxWidth / contentWidth;
|
|
296
|
+
scaleY = boxHeight / contentHeight;
|
|
297
|
+
break;
|
|
298
|
+
case "fitWidth":
|
|
299
|
+
scaleX = scaleY = boxWidth / contentWidth;
|
|
300
|
+
break;
|
|
301
|
+
case "fitHeight":
|
|
302
|
+
scaleX = scaleY = boxHeight / contentHeight;
|
|
303
|
+
break;
|
|
304
|
+
case "none":
|
|
305
|
+
scaleX = scaleY = 1;
|
|
306
|
+
break;
|
|
307
|
+
default:
|
|
308
|
+
scaleX = scaleY = Math.min(boxWidth / contentWidth, boxHeight / contentHeight);
|
|
309
|
+
break;
|
|
310
|
+
}
|
|
311
|
+
return {
|
|
312
|
+
fit: fitWord, alignment: alignWord,
|
|
313
|
+
scaleX: round6(scaleX), scaleY: round6(scaleY),
|
|
314
|
+
x: round6(ax * (boxWidth - contentWidth * scaleX)),
|
|
315
|
+
y: round6(ay * (boxHeight - contentHeight * scaleY)),
|
|
316
|
+
diagnostics,
|
|
317
|
+
};
|
|
318
|
+
}
|
|
319
|
+
// ── playback lifecycle ───────────────────────────────────────────────────────────────
|
|
320
|
+
export const RIVE_FRAME_MIN_INTERVAL_MS = 1000 / 60;
|
|
321
|
+
/**
|
|
322
|
+
* A Rive artboard is a live scene, not a decoded image: an offscreen one that keeps
|
|
323
|
+
* advancing is a battery bug, and twenty of them retained in a list is a memory bug. The
|
|
324
|
+
* machine advances only while it is LIVE (mounted), WANTED (autoplay or an explicit play),
|
|
325
|
+
* ON SCREEN, and the app is FOREGROUND; a tick arriving otherwise is DROPPED, never queued,
|
|
326
|
+
* so `time` is accumulated delta and excludes the offscreen interval.
|
|
327
|
+
*
|
|
328
|
+
* Unmount DISPOSES, and a remount is a fresh instance: the clock restarts at zero and the
|
|
329
|
+
* wanted-state returns to `autoplay`, because an imperative play() belongs to the scene that
|
|
330
|
+
* received it.
|
|
331
|
+
*/
|
|
332
|
+
export class RivePlayback {
|
|
333
|
+
visible = true;
|
|
334
|
+
active = true;
|
|
335
|
+
wanted;
|
|
336
|
+
liveFlag = false;
|
|
337
|
+
advancingFlag = false;
|
|
338
|
+
lastTick = null;
|
|
339
|
+
time = 0;
|
|
340
|
+
frame = 0;
|
|
341
|
+
starts = 0;
|
|
342
|
+
pauses = 0;
|
|
343
|
+
instantiations = 0;
|
|
344
|
+
disposals = 0;
|
|
345
|
+
drops = 0;
|
|
346
|
+
autoplay;
|
|
347
|
+
constructor(autoplay) {
|
|
348
|
+
this.autoplay = autoplay;
|
|
349
|
+
this.wanted = autoplay;
|
|
350
|
+
}
|
|
351
|
+
get live() { return this.liveFlag; }
|
|
352
|
+
get advancing() { return this.advancingFlag; }
|
|
353
|
+
setMounted(value) {
|
|
354
|
+
if (value) {
|
|
355
|
+
if (!this.liveFlag) {
|
|
356
|
+
this.liveFlag = true;
|
|
357
|
+
this.instantiations += 1;
|
|
358
|
+
}
|
|
359
|
+
this.settle();
|
|
360
|
+
return;
|
|
361
|
+
}
|
|
362
|
+
if (this.liveFlag) {
|
|
363
|
+
this.liveFlag = false;
|
|
364
|
+
this.disposals += 1;
|
|
365
|
+
}
|
|
366
|
+
this.settle();
|
|
367
|
+
this.wanted = this.autoplay; // a fresh instance forgets the imperative state
|
|
368
|
+
this.time = 0;
|
|
369
|
+
this.frame = 0;
|
|
370
|
+
this.lastTick = null;
|
|
371
|
+
}
|
|
372
|
+
setVisible(value) { this.visible = value; this.settle(); }
|
|
373
|
+
setActive(value) { this.active = value; this.settle(); }
|
|
374
|
+
play() { this.wanted = true; this.settle(); }
|
|
375
|
+
pause() { this.wanted = false; this.settle(); }
|
|
376
|
+
settle() {
|
|
377
|
+
const want = this.liveFlag && this.wanted && this.visible && this.active;
|
|
378
|
+
if (want && !this.advancingFlag) {
|
|
379
|
+
this.advancingFlag = true;
|
|
380
|
+
this.starts += 1;
|
|
381
|
+
this.lastTick = null;
|
|
382
|
+
}
|
|
383
|
+
else if (!want && this.advancingFlag) {
|
|
384
|
+
this.advancingFlag = false;
|
|
385
|
+
this.pauses += 1;
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
/** one raw platform tick (ms); the advance to apply, or null when dropped or coalesced */
|
|
389
|
+
tick(nowMs) {
|
|
390
|
+
if (!this.advancingFlag) {
|
|
391
|
+
this.drops += 1;
|
|
392
|
+
return null;
|
|
393
|
+
}
|
|
394
|
+
if (this.lastTick === null) {
|
|
395
|
+
this.lastTick = nowMs;
|
|
396
|
+
const advance = { time: round6(this.time), delta: 0, frame: this.frame };
|
|
397
|
+
this.frame += 1;
|
|
398
|
+
return advance;
|
|
399
|
+
}
|
|
400
|
+
const gap = nowMs - this.lastTick;
|
|
401
|
+
if (gap < RIVE_FRAME_MIN_INTERVAL_MS) {
|
|
402
|
+
this.drops += 1;
|
|
403
|
+
return null;
|
|
404
|
+
}
|
|
405
|
+
this.lastTick = nowMs;
|
|
406
|
+
const delta = gap / 1000;
|
|
407
|
+
this.time += delta;
|
|
408
|
+
const advance = { time: round6(this.time), delta: round6(delta), frame: this.frame };
|
|
409
|
+
this.frame += 1;
|
|
410
|
+
return advance;
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
/** the pure fold the corpus pins: an autoplay flag plus a lifecycle/tick event list */
|
|
414
|
+
export function rivePlaybackSchedule(autoplay, events) {
|
|
415
|
+
const loop = new RivePlayback(autoplay);
|
|
416
|
+
const emitted = [];
|
|
417
|
+
for (const event of events) {
|
|
418
|
+
switch (event.type) {
|
|
419
|
+
case "mount":
|
|
420
|
+
loop.setMounted(true);
|
|
421
|
+
break;
|
|
422
|
+
case "unmount":
|
|
423
|
+
loop.setMounted(false);
|
|
424
|
+
break;
|
|
425
|
+
case "visible":
|
|
426
|
+
loop.setVisible(event.value);
|
|
427
|
+
break;
|
|
428
|
+
case "active":
|
|
429
|
+
loop.setActive(event.value);
|
|
430
|
+
break;
|
|
431
|
+
case "play":
|
|
432
|
+
loop.play();
|
|
433
|
+
break;
|
|
434
|
+
case "pause":
|
|
435
|
+
loop.pause();
|
|
436
|
+
break;
|
|
437
|
+
default: {
|
|
438
|
+
const advance = loop.tick(event.at);
|
|
439
|
+
if (advance !== null)
|
|
440
|
+
emitted.push(advance);
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
return {
|
|
445
|
+
emitted,
|
|
446
|
+
starts: loop.starts, pauses: loop.pauses,
|
|
447
|
+
instantiations: loop.instantiations, disposals: loop.disposals, drops: loop.drops,
|
|
448
|
+
advancing: loop.advancing, live: loop.live,
|
|
449
|
+
};
|
|
450
|
+
}
|
|
451
|
+
/**
|
|
452
|
+
* At most `capacity` live artboards, most-recently-visible first. An offscreen row is
|
|
453
|
+
* DEMOTED rather than disposed (it keeps its instance while there is room), queues right behind
|
|
454
|
+
* the visible rows so the row hidden LONGEST AGO is the first evicted, and is evicted before any
|
|
455
|
+
* visible one; eviction disposes, and a returning row is re-instantiated. That
|
|
456
|
+
* re-instantiation is the price of the cap and the corpus counts it, because "bounded
|
|
457
|
+
* memory" is a number a fixture can assert while an allocation is not.
|
|
458
|
+
*/
|
|
459
|
+
export function riveResidency(capacity, events) {
|
|
460
|
+
const cap = Math.max(1, Math.floor(Number.isFinite(capacity) ? capacity : 1));
|
|
461
|
+
const live = [];
|
|
462
|
+
const visible = new Set();
|
|
463
|
+
let instantiated = 0;
|
|
464
|
+
let disposed = 0;
|
|
465
|
+
for (const event of events) {
|
|
466
|
+
const at = live.indexOf(event.key);
|
|
467
|
+
if (!event.visible) {
|
|
468
|
+
visible.delete(event.key);
|
|
469
|
+
if (at >= 0) {
|
|
470
|
+
live.splice(at, 1);
|
|
471
|
+
live.splice(visible.size, 0, event.key);
|
|
472
|
+
}
|
|
473
|
+
continue;
|
|
474
|
+
}
|
|
475
|
+
if (at >= 0)
|
|
476
|
+
live.splice(at, 1);
|
|
477
|
+
else
|
|
478
|
+
instantiated += 1;
|
|
479
|
+
visible.add(event.key);
|
|
480
|
+
live.unshift(event.key);
|
|
481
|
+
while (live.length > cap) {
|
|
482
|
+
live.pop();
|
|
483
|
+
disposed += 1;
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
return { live, instantiated, disposed };
|
|
487
|
+
}
|
|
488
|
+
/**
|
|
489
|
+
* The residency fold, one event at a time, for a runtime that holds the artboards: the module
|
|
490
|
+
* calls `show` when a row's liveness is near or active, `hide` when it is far, and `remove`
|
|
491
|
+
* when the element unmounts. `capacity` bounds the DEMOTED population; the cap is
|
|
492
|
+
* `max(capacity, visible rows)`, so a row the reader can see or is about to see is never the
|
|
493
|
+
* one evicted, and a twenty-row list still holds only the visible rows plus `capacity` warm
|
|
494
|
+
* ones. Eviction means the caller disposes that key's instance; `instantiate` means the caller
|
|
495
|
+
* builds one. `riveResidency` above stays the pure fold of the same law at a fixed cap.
|
|
496
|
+
*/
|
|
497
|
+
export class RiveResidencyLedger {
|
|
498
|
+
base;
|
|
499
|
+
live = [];
|
|
500
|
+
visible = new Set();
|
|
501
|
+
constructor(capacity) {
|
|
502
|
+
this.base = Math.max(1, Math.floor(Number.isFinite(capacity) ? capacity : 1));
|
|
503
|
+
}
|
|
504
|
+
get keys() { return this.live; }
|
|
505
|
+
show(key) {
|
|
506
|
+
const at = this.live.indexOf(key);
|
|
507
|
+
if (at >= 0)
|
|
508
|
+
this.live.splice(at, 1);
|
|
509
|
+
this.live.unshift(key);
|
|
510
|
+
this.visible.add(key);
|
|
511
|
+
const evicted = [];
|
|
512
|
+
const cap = Math.max(this.base, this.visible.size);
|
|
513
|
+
while (this.live.length > cap)
|
|
514
|
+
evicted.push(this.live.pop());
|
|
515
|
+
return { instantiate: at < 0, evicted };
|
|
516
|
+
}
|
|
517
|
+
hide(key) {
|
|
518
|
+
const at = this.live.indexOf(key);
|
|
519
|
+
this.visible.delete(key);
|
|
520
|
+
if (at < 0)
|
|
521
|
+
return;
|
|
522
|
+
this.live.splice(at, 1);
|
|
523
|
+
this.live.splice(this.visible.size, 0, key);
|
|
524
|
+
}
|
|
525
|
+
remove(key) {
|
|
526
|
+
const at = this.live.indexOf(key);
|
|
527
|
+
this.visible.delete(key);
|
|
528
|
+
if (at >= 0)
|
|
529
|
+
this.live.splice(at, 1);
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
/** `on:state-change` fires on a TRANSITION, never on an advance: a state that survives sixty
|
|
533
|
+
* frames is one emission, and returning to a previous state emits again. */
|
|
534
|
+
export function riveStateChanges(machine, states) {
|
|
535
|
+
const out = [];
|
|
536
|
+
let last = null;
|
|
537
|
+
for (const raw of states) {
|
|
538
|
+
const name = raw === null || raw === undefined ? "" : String(raw).trim();
|
|
539
|
+
if (name === "" || name === last)
|
|
540
|
+
continue;
|
|
541
|
+
last = name;
|
|
542
|
+
out.push({ machine, state: name });
|
|
543
|
+
}
|
|
544
|
+
return out;
|
|
545
|
+
}
|
|
546
|
+
/**
|
|
547
|
+
* `on:event` is `{name, properties}`. Properties keep booleans, finite numbers and strings,
|
|
548
|
+
* in sorted key order so three renderers agree; anything else is dropped and counted,
|
|
549
|
+
* because a bus payload is data and a nested handle is not portable.
|
|
550
|
+
*
|
|
551
|
+
* A Rive `openUrl` event arrives here as ordinary properties (`url`, `target`) and NOTHING
|
|
552
|
+
* NAVIGATES. The .riv file is an asset, and an asset that could open a URL by itself would
|
|
553
|
+
* be a hole an OTA-delivered animation walks straight through.
|
|
554
|
+
*/
|
|
555
|
+
export function riveEventPayload(name, properties) {
|
|
556
|
+
const trimmed = name === null || name === undefined ? "" : String(name).trim();
|
|
557
|
+
if (trimmed === "")
|
|
558
|
+
return { payload: null, dropped: 0 };
|
|
559
|
+
const out = {};
|
|
560
|
+
let dropped = 0;
|
|
561
|
+
for (const key of Object.keys(properties ?? {}).sort()) {
|
|
562
|
+
const value = properties[key];
|
|
563
|
+
if (typeof value === "boolean" || typeof value === "string")
|
|
564
|
+
out[key] = value;
|
|
565
|
+
else if (typeof value === "number" && Number.isFinite(value))
|
|
566
|
+
out[key] = round6(value);
|
|
567
|
+
else
|
|
568
|
+
dropped += 1;
|
|
569
|
+
}
|
|
570
|
+
return { payload: { name: trimmed, properties: out }, dropped };
|
|
571
|
+
}
|
|
572
|
+
/** `on:load` carries the resolved selection plus the artboard's INTRINSIC size, which is
|
|
573
|
+
* what a caller needs to size a box around it. */
|
|
574
|
+
export function riveLoadPayload(selection, width, height) {
|
|
575
|
+
return {
|
|
576
|
+
artboard: selection.artboard,
|
|
577
|
+
stateMachine: selection.stateMachine,
|
|
578
|
+
animation: selection.animation,
|
|
579
|
+
width: round6(Number.isFinite(width) ? width : 0),
|
|
580
|
+
height: round6(Number.isFinite(height) ? height : 0),
|
|
581
|
+
};
|
|
582
|
+
}
|
|
583
|
+
export const RIVE_ERROR_MESSAGES = {
|
|
584
|
+
not_found: "the artboard, state machine or animation this <rive> names is not in the file",
|
|
585
|
+
no_source: "<rive> has no src",
|
|
586
|
+
decode_failed: "this .riv file could not be decoded",
|
|
587
|
+
load_failed: "the .riv file could not be loaded",
|
|
588
|
+
unsupported_platform: "this platform ships no Rive runtime",
|
|
589
|
+
};
|
|
590
|
+
/** `on:error` over a closed code set; an unknown code keeps the code and takes the generic
|
|
591
|
+
* message rather than vanishing, and a blank code IS `load_failed`. */
|
|
592
|
+
export function riveErrorPayload(code) {
|
|
593
|
+
let resolved = code === null || code === undefined ? "" : String(code).trim();
|
|
594
|
+
if (resolved === "")
|
|
595
|
+
resolved = "load_failed";
|
|
596
|
+
return { code: resolved, message: RIVE_ERROR_MESSAGES[resolved] ?? "this <rive> could not be played" };
|
|
597
|
+
}
|
|
598
|
+
/**
|
|
599
|
+
* Where a `<rive>` file comes from and when the stage may construct (source.json). Every
|
|
600
|
+
* Rive constructor wants its bytes at construction, so no adapter hands a url to the vendor
|
|
601
|
+
* loader: `local` is whether bytes are on disk at mount (the content plane's last-known-good
|
|
602
|
+
* for a remote url, the app bundle for a name) and `fresh` is the content plane's fetch. A
|
|
603
|
+
* warm mount constructs from the cache and revalidates; a generation that lands is for the
|
|
604
|
+
* NEXT mount, never swapped under a live machine.
|
|
605
|
+
*/
|
|
606
|
+
export function riveSourceLoad(src, local, fresh) {
|
|
607
|
+
const s = src === null || src === undefined ? "" : String(src).trim();
|
|
608
|
+
const fail = (kind, name, error) => ({ kind, name, phase: "failed", origin: null, revalidate: false, error });
|
|
609
|
+
if (s === "")
|
|
610
|
+
return fail("none", "", "no_source");
|
|
611
|
+
const lower = s.toLowerCase();
|
|
612
|
+
if (lower.startsWith("http://") || lower.startsWith("https://")) {
|
|
613
|
+
if (local)
|
|
614
|
+
return { kind: "remote", name: s, phase: "ready", origin: "cache", revalidate: true, error: null };
|
|
615
|
+
if (fresh === "pending")
|
|
616
|
+
return { kind: "remote", name: s, phase: "loading", origin: null, revalidate: false, error: null };
|
|
617
|
+
if (fresh === "ok")
|
|
618
|
+
return { kind: "remote", name: s, phase: "ready", origin: "network", revalidate: false, error: null };
|
|
619
|
+
return fail("remote", s, "load_failed");
|
|
620
|
+
}
|
|
621
|
+
if (s.includes("://"))
|
|
622
|
+
return fail("refused", s, "load_failed");
|
|
623
|
+
const segment = s.slice(s.lastIndexOf("/") + 1);
|
|
624
|
+
const name = segment.endsWith(".riv") ? segment.slice(0, -4) : segment;
|
|
625
|
+
if (name === "" || !local)
|
|
626
|
+
return fail("bundled", name, "load_failed");
|
|
627
|
+
return { kind: "bundled", name, phase: "ready", origin: "bundle", revalidate: false, error: null };
|
|
628
|
+
}
|
|
629
|
+
// ── accessibility ────────────────────────────────────────────────────────────────────
|
|
630
|
+
/** the same gesture words `<canvas>` uses. `on:state-change` and `on:event` are absent
|
|
631
|
+
* on purpose: an animation reporting what it did is not a control. */
|
|
632
|
+
export const RIVE_GESTURE_HANDLERS = [
|
|
633
|
+
"on:tap", "on:doubletap", "on:long-press", "on:long-press-end", "on:drag", "on:pan",
|
|
634
|
+
"on:pinch", "on:rotate", "on:swipe", "on:press", "on:adjust",
|
|
635
|
+
];
|
|
636
|
+
export const RIVE_A11Y_LINT_CODE = "rive_a11y_label";
|
|
637
|
+
export const RIVE_A11Y_LINT_MESSAGE = "<rive> with a gesture handler needs aria-label — an animation is opaque to assistive tech";
|
|
638
|
+
/**
|
|
639
|
+
* The `<canvas>` verdict shape applied to an animation: same six fields, same three-surface
|
|
640
|
+
* fold, one extra input. A Rive state machine can carry its OWN pointer listeners inside the
|
|
641
|
+
* .riv file, so the component can be interactive with no `on:` handler in sight. That flips
|
|
642
|
+
* `interactive` and the role but emits NO lint, because the linter reads markup and markup
|
|
643
|
+
* cannot see inside an asset. Two verdicts, one fold, and the difference is stated rather
|
|
644
|
+
* than fudged.
|
|
645
|
+
*/
|
|
646
|
+
export function riveA11y(attrs, a11yChildren, hasListeners) {
|
|
647
|
+
const handled = RIVE_GESTURE_HANDLERS.some((name) => {
|
|
648
|
+
const raw = attrs[name];
|
|
649
|
+
return raw !== undefined && raw !== null && String(raw).trim() !== "";
|
|
650
|
+
});
|
|
651
|
+
const interactive = handled || hasListeners === true;
|
|
652
|
+
const rawLabel = attrs["aria-label"];
|
|
653
|
+
const trimmed = rawLabel === undefined || rawLabel === null ? "" : String(rawLabel).trim();
|
|
654
|
+
const label = trimmed === "" ? null : trimmed;
|
|
655
|
+
const children = (a11yChildren ?? []).map((child) => ({
|
|
656
|
+
role: child.role ?? "image",
|
|
657
|
+
label: child.label ?? "",
|
|
658
|
+
value: child.value ?? null,
|
|
659
|
+
}));
|
|
660
|
+
const declared = label !== null || children.length > 0;
|
|
661
|
+
const role = children.length > 0
|
|
662
|
+
? "group"
|
|
663
|
+
: interactive
|
|
664
|
+
? (label !== null ? "button" : "group")
|
|
665
|
+
: (label !== null ? "image" : "none");
|
|
666
|
+
return {
|
|
667
|
+
interactive,
|
|
668
|
+
label,
|
|
669
|
+
children,
|
|
670
|
+
role,
|
|
671
|
+
hidden: !interactive && !declared,
|
|
672
|
+
lint: handled && !declared
|
|
673
|
+
? { code: RIVE_A11Y_LINT_CODE, level: "error", message: RIVE_A11Y_LINT_MESSAGE }
|
|
674
|
+
: null,
|
|
675
|
+
};
|
|
676
|
+
}
|
|
677
|
+
//# sourceMappingURL=rive-core.js.map
|