@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,211 @@
|
|
|
1
|
+
//
|
|
2
|
+
// contacts-core.ts — the shared Core/Contacts core: the permission surface, the paging
|
|
3
|
+
// arithmetic, the read/write access decisions, the label vocabulary and the picker fold. The
|
|
4
|
+
// law is the corpus, OpenSource/Conformance/contacts/{crud,pick}.json (parity F12); the Kotlin
|
|
5
|
+
// twin is :core ContactsCore.kt and the Swift twin is Engine/Swift/ContactsCore.swift.
|
|
6
|
+
//
|
|
7
|
+
// Everything platform-shaped lives OUTSIDE this file: CNContactStore, ContactsContract and
|
|
8
|
+
// navigator.contacts are per-renderer plumbing. What is pinned here is the part that must be
|
|
9
|
+
// IDENTICAL on all three — how far a page reaches, what a grant permits, what a label is
|
|
10
|
+
// called, and what the picker hands back.
|
|
11
|
+
//
|
|
12
|
+
/** The shared label vocabulary. A platform constant folds into one of these five, never leaks. */
|
|
13
|
+
export const CONTACT_LABELS = ["home", "work", "mobile", "main", "other"];
|
|
14
|
+
/** A contact with no name at all still needs something to render. */
|
|
15
|
+
export const CONTACT_UNNAMED = "Unnamed Contact";
|
|
16
|
+
/** One page may never fetch the world, and may never be unbounded. */
|
|
17
|
+
export const CONTACT_MAX_PAGE = 500;
|
|
18
|
+
/**
|
|
19
|
+
* Which grant each action requires before it will run.
|
|
20
|
+
*
|
|
21
|
+
* `none` is the CONTRACT, not an implementation detail: an action listed as `none` that starts
|
|
22
|
+
* prompting is a regression, and an action listed as read/write that stops refusing is a
|
|
23
|
+
* privacy bug. `pick` is `none` on every renderer because the user hand-picks and the OS
|
|
24
|
+
* returns only what was picked.
|
|
25
|
+
*/
|
|
26
|
+
export const CONTACTS_PERMISSION_SURFACE = {
|
|
27
|
+
pick: "none",
|
|
28
|
+
"permission.status": "none",
|
|
29
|
+
"permission.request": "none",
|
|
30
|
+
"permission.openSettings": "none",
|
|
31
|
+
"permission.manage": "none",
|
|
32
|
+
list: "read",
|
|
33
|
+
get: "read",
|
|
34
|
+
groups: "read",
|
|
35
|
+
add: "write",
|
|
36
|
+
update: "write",
|
|
37
|
+
remove: "write",
|
|
38
|
+
};
|
|
39
|
+
/** The refusal messages. A caller that cannot find the fix retries the same call forever, so
|
|
40
|
+
* each one names the specific escalation that would work. */
|
|
41
|
+
export const CONTACTS_READ_REFUSAL = 'Contacts access has not been granted. Call dsx.module.contacts.permission.request with level "read" '
|
|
42
|
+
+ "first, or use dsx.module.contacts.pick, which needs no permission.";
|
|
43
|
+
export const CONTACTS_WRITE_REFUSAL = 'Writing contacts has not been granted. Call dsx.module.contacts.permission.request with level "write" first.';
|
|
44
|
+
export const CONTACTS_RESTRICTED_MESSAGE = "Contacts access is restricted on this device.";
|
|
45
|
+
export const CONTACTS_INVALID_MESSAGE = "A contact needs at least one non-empty writable field.";
|
|
46
|
+
/** A limit past the cap clamps rather than fetching the world; zero or negative clamps to 1,
|
|
47
|
+
* never to unbounded. */
|
|
48
|
+
export function clampContactLimit(requested, fallback) {
|
|
49
|
+
const raw = requested === null || requested === undefined || Number.isNaN(Number(requested))
|
|
50
|
+
? fallback
|
|
51
|
+
: Math.trunc(Number(requested));
|
|
52
|
+
return Math.min(Math.max(raw, 1), CONTACT_MAX_PAGE);
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* The paging arithmetic — the same on all three renderers even though the underlying cursor is
|
|
56
|
+
* not (an enumeration offset on iOS, a SQL LIMIT/OFFSET on Android).
|
|
57
|
+
*
|
|
58
|
+
* `endCursor` is present only when there IS a next page, so a caller that loops until the cursor
|
|
59
|
+
* is absent terminates instead of asking for an empty page forever.
|
|
60
|
+
*/
|
|
61
|
+
export function contactPage(total, limit, offset) {
|
|
62
|
+
const size = clampContactLimit(limit, CONTACT_MAX_PAGE);
|
|
63
|
+
const start = Math.max(0, Math.trunc(offset));
|
|
64
|
+
const returned = Math.max(0, Math.min(size, Math.trunc(total) - start));
|
|
65
|
+
return contactCollectedPage(start, returned, start + returned < Math.trunc(total));
|
|
66
|
+
}
|
|
67
|
+
/** The same page, reported by a store that ENUMERATED rather than counted: neither CNContactStore
|
|
68
|
+
* nor a content-provider query knows the total, but both learn whether one more row exists.
|
|
69
|
+
* `contactPage` is defined in terms of this, so the corpus judges the code the modules call. */
|
|
70
|
+
export function contactCollectedPage(offset, returned, sawMore) {
|
|
71
|
+
const start = Math.max(0, Math.trunc(offset));
|
|
72
|
+
const count = Math.max(0, Math.trunc(returned));
|
|
73
|
+
return { returned: count, hasNextPage: sawMore, endCursor: sawMore ? String(start + count) : null };
|
|
74
|
+
}
|
|
75
|
+
function allow(access) {
|
|
76
|
+
return { runs: true, access, error: null, message: null, recoverable: true, prompted: false };
|
|
77
|
+
}
|
|
78
|
+
function refuse(error, message, recoverable) {
|
|
79
|
+
return { runs: false, access: null, error, message, recoverable, prompted: false };
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Can a read run, and what does it report?
|
|
83
|
+
*
|
|
84
|
+
* `limited` (iOS 18+ limited contact access) is a REAL GRANT over a shared subset, not a soft
|
|
85
|
+
* denial: the read runs and reports access:"limited" rather than pretending it enumerated the
|
|
86
|
+
* book. `restricted` is a device-policy denial and is NOT recoverable by asking again.
|
|
87
|
+
*/
|
|
88
|
+
export function contactReadDecision(access) {
|
|
89
|
+
switch (String(access ?? "").trim()) {
|
|
90
|
+
case "granted": return allow("granted");
|
|
91
|
+
case "limited": return allow("limited");
|
|
92
|
+
case "restricted": return refuse("restricted", CONTACTS_RESTRICTED_MESSAGE, false);
|
|
93
|
+
default: return refuse("permission_denied", CONTACTS_READ_REFUSAL, true);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
/** How many rows a read may see: the whole book on a full grant, the shared subset on a limited
|
|
97
|
+
* one, and nothing at all when the read did not run. */
|
|
98
|
+
export function contactReadCount(access, shared, total) {
|
|
99
|
+
const decision = contactReadDecision(access);
|
|
100
|
+
if (!decision.runs)
|
|
101
|
+
return 0;
|
|
102
|
+
return decision.access === "limited" ? Math.max(0, shared) : Math.max(0, total);
|
|
103
|
+
}
|
|
104
|
+
/** At least one of these makes a contact worth saving; an empty object is refused before any
|
|
105
|
+
* store call. */
|
|
106
|
+
export function isMeaningfulContact(contact) {
|
|
107
|
+
if (contact === null || contact === undefined)
|
|
108
|
+
return false;
|
|
109
|
+
for (const key of ["displayName", "givenName", "familyName", "middleName", "prefix", "suffix", "nickname", "company", "jobTitle", "note", "birthday"]) {
|
|
110
|
+
const value = contact[key];
|
|
111
|
+
if (typeof value === "string" && value.trim() !== "")
|
|
112
|
+
return true;
|
|
113
|
+
}
|
|
114
|
+
for (const key of ["phones", "emails", "addresses", "urls", "socialProfiles"]) {
|
|
115
|
+
const value = contact[key];
|
|
116
|
+
if (Array.isArray(value) && value.length > 0)
|
|
117
|
+
return true;
|
|
118
|
+
}
|
|
119
|
+
return false;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Can a write run?
|
|
123
|
+
*
|
|
124
|
+
* Limited access permits writes to shared contacts; the OS enforces the subset, and the refusal names the WRITE level
|
|
125
|
+
* specifically — a caller told to ask for "read" again would loop. Validity is checked after
|
|
126
|
+
* permission, so an unauthorised caller never learns whether its payload was well-formed.
|
|
127
|
+
*/
|
|
128
|
+
export function contactWriteDecision(access, contact) {
|
|
129
|
+
const word = String(access ?? "").trim();
|
|
130
|
+
if (word === "restricted")
|
|
131
|
+
return refuse("restricted", CONTACTS_RESTRICTED_MESSAGE, false);
|
|
132
|
+
if (word !== "granted" && word !== "limited")
|
|
133
|
+
return refuse("permission_denied", CONTACTS_WRITE_REFUSAL, true);
|
|
134
|
+
if (contact !== undefined && !isMeaningfulContact(contact)) {
|
|
135
|
+
return refuse("invalid_contact", CONTACTS_INVALID_MESSAGE, true);
|
|
136
|
+
}
|
|
137
|
+
return allow(word);
|
|
138
|
+
}
|
|
139
|
+
/** A platform label to the shared vocabulary. Apple wraps its constants as `_$!<Word>!$_`;
|
|
140
|
+
* Android hands over its own word already. Custom labels are preserved, never a guess. */
|
|
141
|
+
export function normalizeContactLabel(raw) {
|
|
142
|
+
let text = String(raw ?? "").trim();
|
|
143
|
+
const wrapped = /^_\$!<(.+)>!\$_$/.exec(text);
|
|
144
|
+
if (wrapped !== null)
|
|
145
|
+
text = wrapped[1];
|
|
146
|
+
switch (text.toLowerCase()) {
|
|
147
|
+
case "home": return "home";
|
|
148
|
+
case "work": return "work";
|
|
149
|
+
case "mobile":
|
|
150
|
+
case "iphone":
|
|
151
|
+
case "cell": return "mobile";
|
|
152
|
+
case "main": return "main";
|
|
153
|
+
default: return text || "other";
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
/** A birthday is an ISO date, never a locale string. */
|
|
157
|
+
export function contactBirthday(year, month, day) {
|
|
158
|
+
if (month === null || month === undefined
|
|
159
|
+
|| day === null || day === undefined)
|
|
160
|
+
return null;
|
|
161
|
+
const pad = (value, width) => String(Math.trunc(value)).padStart(width, "0");
|
|
162
|
+
return year === null || year === undefined ? `--${pad(month, 2)}-${pad(day, 2)}` : `${pad(year, 4)}-${pad(month, 2)}-${pad(day, 2)}`;
|
|
163
|
+
}
|
|
164
|
+
/** A nameless contact still has a display name. `formatted` is the platform's own full-name
|
|
165
|
+
* rendering where it has one; the given/family join is the fallback. */
|
|
166
|
+
export function contactDisplayName(givenName, familyName, formatted) {
|
|
167
|
+
const platform = String(formatted ?? "").trim();
|
|
168
|
+
if (platform !== "")
|
|
169
|
+
return platform;
|
|
170
|
+
const joined = `${String(givenName ?? "").trim()} ${String(familyName ?? "").trim()}`.trim();
|
|
171
|
+
return joined === "" ? CONTACT_UNNAMED : joined;
|
|
172
|
+
}
|
|
173
|
+
/** `fields` subsets the hydrated shape and drops nothing else in: `id` always survives, and the
|
|
174
|
+
* requested fields keep the order the caller asked for. */
|
|
175
|
+
export function subsetContact(contact, fields) {
|
|
176
|
+
if (fields === null || fields === undefined || fields.length === 0)
|
|
177
|
+
return { ...contact };
|
|
178
|
+
const out = {};
|
|
179
|
+
if ("id" in contact)
|
|
180
|
+
out["id"] = contact["id"];
|
|
181
|
+
for (const field of fields) {
|
|
182
|
+
if (field !== "id" && field in contact)
|
|
183
|
+
out[field] = contact[field];
|
|
184
|
+
}
|
|
185
|
+
return out;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* The picker fold.
|
|
189
|
+
*
|
|
190
|
+
* A dismissal RESOLVES cancelled — the user declining is an outcome the caller branches on, not
|
|
191
|
+
* an error it should log. A platform with no multi-select SAYS SO (`multiple: false`) rather
|
|
192
|
+
* than quietly returning a one-element array, and a browser with no Contact Picker API refuses
|
|
193
|
+
* in type rather than resolving an empty list.
|
|
194
|
+
*/
|
|
195
|
+
export function contactPickOutcome(input) {
|
|
196
|
+
if (input.pickerAvailable === false) {
|
|
197
|
+
return { contacts: [], cancelled: false, prompted: false, multiple: null, error: "unsupported_platform" };
|
|
198
|
+
}
|
|
199
|
+
const degraded = input.multiple === true && input.multiSelect === false ? false : null;
|
|
200
|
+
if (input.picked === null || input.picked === undefined) {
|
|
201
|
+
return { contacts: [], cancelled: true, prompted: false, multiple: degraded, error: null };
|
|
202
|
+
}
|
|
203
|
+
return {
|
|
204
|
+
contacts: input.picked.map((entry) => subsetContact(entry, input.fields)),
|
|
205
|
+
cancelled: false,
|
|
206
|
+
prompted: false,
|
|
207
|
+
multiple: degraded,
|
|
208
|
+
error: null,
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
//# sourceMappingURL=contacts-core.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contacts-core.js","sourceRoot":"","sources":["../src/contacts-core.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,wFAAwF;AACxF,8FAA8F;AAC9F,gGAAgG;AAChG,wFAAwF;AACxF,EAAE;AACF,4FAA4F;AAC5F,8FAA8F;AAC9F,0FAA0F;AAC1F,2CAA2C;AAC3C,EAAE;AAEF,kGAAkG;AAClG,MAAM,CAAC,MAAM,cAAc,GAAsB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;AAE7F,qEAAqE;AACrE,MAAM,CAAC,MAAM,eAAe,GAAG,iBAAiB,CAAC;AAEjD,sEAAsE;AACtE,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAEpC;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAA0C;IAChF,IAAI,EAAE,MAAM;IACZ,mBAAmB,EAAE,MAAM;IAC3B,oBAAoB,EAAE,MAAM;IAC5B,yBAAyB,EAAE,MAAM;IACjC,mBAAmB,EAAE,MAAM;IAC3B,IAAI,EAAE,MAAM;IACZ,GAAG,EAAE,MAAM;IACX,MAAM,EAAE,MAAM;IACd,GAAG,EAAE,OAAO;IACZ,MAAM,EAAE,OAAO;IACf,MAAM,EAAE,OAAO;CAChB,CAAC;AAEF;8DAC8D;AAC9D,MAAM,CAAC,MAAM,qBAAqB,GAChC,sGAAsG;MACpG,oEAAoE,CAAC;AACzE,MAAM,CAAC,MAAM,sBAAs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AAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,aAAa,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;QACzE,SAAS,EAAE,KAAK;QAChB,QAAQ,EAAE,KAAK;QACf,QAAQ,EAAE,QAAQ;QAClB,KAAK,EAAE,IAAI;KACZ,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/** One user input, as the renderer saw it. `editable` = the target takes typed text (a text field, a
|
|
2
|
+
* text area, a contenteditable region); `key` is the KeyboardEvent key for a key press. */
|
|
3
|
+
export type ContentInput = {
|
|
4
|
+
type: string;
|
|
5
|
+
key?: string;
|
|
6
|
+
editable: boolean;
|
|
7
|
+
};
|
|
8
|
+
/** Does this input open an interaction transaction? A tap or click, a committed `change`, an `input`
|
|
9
|
+
* from a control that is not typed into (a radio, a checkbox, a slider, a select), or a selection key.
|
|
10
|
+
* Typing never does. */
|
|
11
|
+
export declare function opensContentTransaction(input: ContentInput): boolean;
|
|
12
|
+
export type ContentChange = {
|
|
13
|
+
/** the document has settled (never on the first render) */
|
|
14
|
+
settled: boolean;
|
|
15
|
+
reducedMotion: boolean;
|
|
16
|
+
/** the resolved `--dsx-presence` value on the element, null when unset */
|
|
17
|
+
knob: string | null;
|
|
18
|
+
/** the change was written inside an interaction transaction */
|
|
19
|
+
interaction: boolean;
|
|
20
|
+
before: string;
|
|
21
|
+
after: string;
|
|
22
|
+
};
|
|
23
|
+
export type ContentPlan = {
|
|
24
|
+
animate: boolean;
|
|
25
|
+
/** there is old copy to cross-fade out (an empty text only fades the new copy in) */
|
|
26
|
+
ghost: boolean;
|
|
27
|
+
};
|
|
28
|
+
export declare function planContentTransition(change: ContentChange): ContentPlan;
|
|
29
|
+
/** How long a qualifying input keeps the transaction open, in milliseconds. */
|
|
30
|
+
export declare const CONTENT_INTERACTION_WINDOW_MS = 1200;
|
|
31
|
+
/** The transaction's state after one input at `nowMs`: the time it stays open until (0 = closed). A qualifying input
|
|
32
|
+
* (re)opens it for the window, typing into an editable target closes it, anything else leaves it as it was. */
|
|
33
|
+
export declare function nextInteractionUntil(until: number, input: ContentInput, nowMs: number): number;
|
|
34
|
+
/** Is the transaction open at `nowMs`? */
|
|
35
|
+
export declare function interactionOpenAt(until: number, nowMs: number): boolean;
|
|
36
|
+
/** The share of a swap (and of a text change) the old copy fades out in; the new copy fades in over the rest. */
|
|
37
|
+
export declare const CONTENT_OUT_SHARE = 0.45;
|
|
38
|
+
export type ContentPhases = {
|
|
39
|
+
outMs: number;
|
|
40
|
+
inDelayMs: number;
|
|
41
|
+
inMs: number;
|
|
42
|
+
};
|
|
43
|
+
/** The two halves of a transition of `durationMs`: the old copy fades out for `outMs` from the start, the new copy
|
|
44
|
+
* fades in for `inMs` after `inDelayMs` (= `outMs`), so the two never overlap. With no old copy the new one fades
|
|
45
|
+
* in over the whole duration. */
|
|
46
|
+
export declare function contentPhases(durationMs: number, hasOldCopy: boolean): ContentPhases;
|
|
47
|
+
/** The fade through of a swap, as cubic-bezier control points (x1, y1, x2, y2). The old copy accelerates out, so it is
|
|
48
|
+
* drawn until the hand-off and gone exactly at it; the new copy decelerates in, so it is drawn from the hand-off on.
|
|
49
|
+
* A curve that falls fast and lingers (the presence spring) had the old copy gone a third of the way in while the new
|
|
50
|
+
* one had not begun, and the copy read as blank between them. */
|
|
51
|
+
export declare const CONTENT_OUT_CURVE: readonly [number, number, number, number];
|
|
52
|
+
export declare const CONTENT_IN_CURVE: readonly [number, number, number, number];
|
|
53
|
+
/** The opacity of each copy `elapsedMs` into a swap of `durationMs` (old copy out, then new copy in). */
|
|
54
|
+
export declare function swapOpacity(durationMs: number, elapsedMs: number): {
|
|
55
|
+
old: number;
|
|
56
|
+
new: number;
|
|
57
|
+
};
|
|
58
|
+
//# sourceMappingURL=content-transition.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content-transition.d.ts","sourceRoot":"","sources":["../src/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Aa,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,GAAG,aAAa,CAIpF;AAED;;;kEAGkE;AAClE,eAAO,MAAM,iBAAiB,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAkB,CAAC;AAC3F,eAAO,MAAM,gBAAgB,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAkB,CAAC;AAE1F,yGAAyG;AACzG,wBAAgB,WAAW,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAO/F"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
//
|
|
2
|
+
// content-transition.ts — THE CONTENT TRANSITION. Corpus: Conformance/motion/content-transition.json.
|
|
3
|
+
//
|
|
4
|
+
// When a person changes a selection (a segmented control, a picker, a toggle, a tab, a tapped row),
|
|
5
|
+
// the copy that follows from it changes in the same commit: a row title, a section footer, a button
|
|
6
|
+
// label. Such a change is an interaction transaction, and inside one every renderer animates it the way
|
|
7
|
+
// SwiftUI animates a `Text` whose value changes inside `withAnimation`, or Compose an `AnimatedContent`:
|
|
8
|
+
// the old copy cross-fades out over the new one, and what the copy's new size displaced glides to its
|
|
9
|
+
// new place instead of jumping. The same commit's conditional rows take the presence motion
|
|
10
|
+
// (motion/presence.json, motion/list-presence.json); this law covers the copy that stays.
|
|
11
|
+
//
|
|
12
|
+
// Outside an interaction a text change is instant: data landing, a timer, a live counter and the echo
|
|
13
|
+
// of what someone types are not a person changing their mind, and animating them reads as lag.
|
|
14
|
+
//
|
|
15
|
+
// This file is only the platform-neutral DECISION: which input opens an interaction transaction, and
|
|
16
|
+
// whether one text change inside it animates. The motion is each platform's own: SwiftUI's
|
|
17
|
+
// `.contentTransition(.opacity)` with the presence spring, Compose `AnimatedContent` with
|
|
18
|
+
// `fadeIn() togetherWith fadeOut()` and `SizeTransform`, the web polyfill in
|
|
19
|
+
// packages/dom/src/element-motion.ts (a ghost of the old copy over the new, FLIP for the followers).
|
|
20
|
+
//
|
|
21
|
+
import { listPresenceKnobOff } from "./list-presence.js";
|
|
22
|
+
import { sceneBezier } from "./scene/anim.js";
|
|
23
|
+
/** The keys that change a selection or press a control. A printable key in an editable target is
|
|
24
|
+
* typing; Enter there submits, which is a commit like a tap. */
|
|
25
|
+
const SELECTION_KEYS = new Set([
|
|
26
|
+
"Enter", " ", "Spacebar", "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight", "Home", "End", "PageUp", "PageDown",
|
|
27
|
+
]);
|
|
28
|
+
/** Does this input open an interaction transaction? A tap or click, a committed `change`, an `input`
|
|
29
|
+
* from a control that is not typed into (a radio, a checkbox, a slider, a select), or a selection key.
|
|
30
|
+
* Typing never does. */
|
|
31
|
+
export function opensContentTransaction(input) {
|
|
32
|
+
switch (input.type) {
|
|
33
|
+
case "click":
|
|
34
|
+
case "change":
|
|
35
|
+
return true;
|
|
36
|
+
case "input":
|
|
37
|
+
return !input.editable;
|
|
38
|
+
case "keydown":
|
|
39
|
+
if (input.key === undefined || !SELECTION_KEYS.has(input.key))
|
|
40
|
+
return false;
|
|
41
|
+
return !input.editable || input.key === "Enter";
|
|
42
|
+
default:
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
export function planContentTransition(change) {
|
|
47
|
+
const animate = change.interaction && change.settled && !change.reducedMotion
|
|
48
|
+
&& !listPresenceKnobOff(change.knob) && change.before !== change.after;
|
|
49
|
+
return { animate, ghost: animate && change.before.trim() !== "" };
|
|
50
|
+
}
|
|
51
|
+
/** How long a qualifying input keeps the transaction open, in milliseconds. */
|
|
52
|
+
export const CONTENT_INTERACTION_WINDOW_MS = 1200;
|
|
53
|
+
/** Does this key write or remove text (as opposed to moving the caret)? */
|
|
54
|
+
function editsText(key) {
|
|
55
|
+
return key !== undefined && (key.length === 1 || key === "Backspace" || key === "Delete");
|
|
56
|
+
}
|
|
57
|
+
/** The transaction's state after one input at `nowMs`: the time it stays open until (0 = closed). A qualifying input
|
|
58
|
+
* (re)opens it for the window, typing into an editable target closes it, anything else leaves it as it was. */
|
|
59
|
+
export function nextInteractionUntil(until, input, nowMs) {
|
|
60
|
+
if (opensContentTransaction(input))
|
|
61
|
+
return nowMs + CONTENT_INTERACTION_WINDOW_MS;
|
|
62
|
+
if (input.editable && (input.type === "input" || (input.type === "keydown" && editsText(input.key))))
|
|
63
|
+
return 0;
|
|
64
|
+
return until;
|
|
65
|
+
}
|
|
66
|
+
/** Is the transaction open at `nowMs`? */
|
|
67
|
+
export function interactionOpenAt(until, nowMs) { return nowMs < until; }
|
|
68
|
+
/** The share of a swap (and of a text change) the old copy fades out in; the new copy fades in over the rest. */
|
|
69
|
+
export const CONTENT_OUT_SHARE = 0.45;
|
|
70
|
+
/** The two halves of a transition of `durationMs`: the old copy fades out for `outMs` from the start, the new copy
|
|
71
|
+
* fades in for `inMs` after `inDelayMs` (= `outMs`), so the two never overlap. With no old copy the new one fades
|
|
72
|
+
* in over the whole duration. */
|
|
73
|
+
export function contentPhases(durationMs, hasOldCopy) {
|
|
74
|
+
if (!hasOldCopy)
|
|
75
|
+
return { outMs: 0, inDelayMs: 0, inMs: durationMs };
|
|
76
|
+
const outMs = durationMs * CONTENT_OUT_SHARE;
|
|
77
|
+
return { outMs, inDelayMs: outMs, inMs: durationMs - outMs };
|
|
78
|
+
}
|
|
79
|
+
/** The fade through of a swap, as cubic-bezier control points (x1, y1, x2, y2). The old copy accelerates out, so it is
|
|
80
|
+
* drawn until the hand-off and gone exactly at it; the new copy decelerates in, so it is drawn from the hand-off on.
|
|
81
|
+
* A curve that falls fast and lingers (the presence spring) had the old copy gone a third of the way in while the new
|
|
82
|
+
* one had not begun, and the copy read as blank between them. */
|
|
83
|
+
export const CONTENT_OUT_CURVE = [0.6, 0, 1, 1];
|
|
84
|
+
export const CONTENT_IN_CURVE = [0, 0, 0.1, 1];
|
|
85
|
+
/** The opacity of each copy `elapsedMs` into a swap of `durationMs` (old copy out, then new copy in). */
|
|
86
|
+
export function swapOpacity(durationMs, elapsedMs) {
|
|
87
|
+
const p = contentPhases(durationMs, true);
|
|
88
|
+
const along = (t, ms) => (ms <= 0 ? 1 : Math.min(Math.max(t / ms, 0), 1));
|
|
89
|
+
return {
|
|
90
|
+
old: 1 - sceneBezier(along(elapsedMs, p.outMs), ...CONTENT_OUT_CURVE),
|
|
91
|
+
new: sceneBezier(along(elapsedMs - p.inDelayMs, p.inMs), ...CONTENT_IN_CURVE),
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=content-transition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content-transition.js","sourceRoot":"","sources":["../src/content-transition.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,uGAAuG;AACvG,EAAE;AACF,qGAAqG;AACrG,qGAAqG;AACrG,yGAAyG;AACzG,0GAA0G;AAC1G,uGAAuG;AACvG,6FAA6F;AAC7F,2FAA2F;AAC3F,EAAE;AACF,uGAAuG;AACvG,gGAAgG;AAChG,EAAE;AACF,sGAAsG;AACtG,4FAA4F;AAC5F,2FAA2F;AAC3F,8EAA8E;AAC9E,sGAAsG;AACtG,EAAE;AACF,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAM9C;iEACiE;AACjE,MAAM,cAAc,GAAwB,IAAI,GAAG,CAAC;IAClD,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,UAAU;CACjH,CAAC,CAAC;AAEH;;yBAEyB;AACzB,MAAM,UAAU,uBAAuB,CAAC,KAAmB;IACzD,QAAQ,KAAK,CAAC,IAAI,EAAE,CAAC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CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAClG,OAAO;QACL,GAAG,EAAE,CAAC,GAAG,WAAW,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,EAAE,GAAG,iBAAiB,CAAC;QACrE,GAAG,EAAE,WAAW,CAAC,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,GAAG,gBAAgB,CAAC;KAC9E,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
export declare function declaredBool(value: string | null | undefined): boolean;
|
|
2
|
+
export type GradientType = "linear" | "radial" | "angular" | "mesh";
|
|
3
|
+
export declare const GRADIENT_TYPES: readonly GradientType[];
|
|
4
|
+
/** Neither `gradientAngle` nor `gradientDir` declared = today's behaviour: top to bottom. */
|
|
5
|
+
export declare const GRADIENT_ANGLE_DEFAULT = 180;
|
|
6
|
+
export interface UnitPoint {
|
|
7
|
+
readonly x: number;
|
|
8
|
+
readonly y: number;
|
|
9
|
+
}
|
|
10
|
+
export interface MeshPoint {
|
|
11
|
+
readonly x: number;
|
|
12
|
+
readonly y: number;
|
|
13
|
+
readonly color: string;
|
|
14
|
+
}
|
|
15
|
+
export interface MeshGrid {
|
|
16
|
+
readonly columns: number;
|
|
17
|
+
readonly rows: number;
|
|
18
|
+
readonly points: readonly MeshPoint[];
|
|
19
|
+
}
|
|
20
|
+
export interface MeshLayer {
|
|
21
|
+
readonly center: UnitPoint;
|
|
22
|
+
readonly radius: number;
|
|
23
|
+
readonly color: string;
|
|
24
|
+
}
|
|
25
|
+
/** The DECLARED mesh degradation: a base fill plus one radial per control point, in row-major
|
|
26
|
+
* paint order. Pinned, so "mesh falls back" is a specification and not an accident. */
|
|
27
|
+
export interface MeshFallback {
|
|
28
|
+
readonly base: string;
|
|
29
|
+
readonly layers: readonly MeshLayer[];
|
|
30
|
+
}
|
|
31
|
+
export interface GradientResolution {
|
|
32
|
+
readonly type: GradientType;
|
|
33
|
+
readonly colors: readonly string[];
|
|
34
|
+
readonly stops: readonly number[];
|
|
35
|
+
readonly angle: number;
|
|
36
|
+
readonly start: UnitPoint;
|
|
37
|
+
readonly end: UnitPoint;
|
|
38
|
+
readonly center: UnitPoint;
|
|
39
|
+
readonly radius: number;
|
|
40
|
+
/** Fewer than two colours is not a gradient; the caller paints nothing rather than a flat band. */
|
|
41
|
+
readonly valid: boolean;
|
|
42
|
+
readonly mesh: MeshGrid | null;
|
|
43
|
+
readonly meshFallback: MeshFallback | null;
|
|
44
|
+
}
|
|
45
|
+
export interface GradientAttributes {
|
|
46
|
+
gradient?: string | null;
|
|
47
|
+
gradientType?: string | null;
|
|
48
|
+
gradientStops?: string | null;
|
|
49
|
+
gradientAngle?: string | number | null;
|
|
50
|
+
gradientDir?: string | null;
|
|
51
|
+
gradientCenter?: string | null;
|
|
52
|
+
gradientRadius?: string | number | null;
|
|
53
|
+
gradientPoints?: string | null;
|
|
54
|
+
}
|
|
55
|
+
/** `135deg` · `135` · `0.25turn` · `1.57rad` · `150grad`. An ANGLE and nothing else: the three
|
|
56
|
+
* direction words that used to be accepted here were a private vocabulary for three points on a
|
|
57
|
+
* scale CSS already spells, and a word that is not an angle is now refused the way every other
|
|
58
|
+
* unparsable angle is, with null. */
|
|
59
|
+
export declare function parseGradientAngle(input: string | number | null | undefined): number | null;
|
|
60
|
+
/** The gradient axis as unit points, from the pinned angle convention. */
|
|
61
|
+
export declare function gradientUnitPoints(angle: number): {
|
|
62
|
+
start: UnitPoint;
|
|
63
|
+
end: UnitPoint;
|
|
64
|
+
};
|
|
65
|
+
/** `gradientCenter="0.25 0.75"` / `"25% 75%"`. A single value means both axes. */
|
|
66
|
+
export declare function parseUnitPoint(input: string | null | undefined, fallback: UnitPoint): UnitPoint;
|
|
67
|
+
/** `gradientRadius` as a fraction of the box's larger side. Default 0.5, capped at 4. */
|
|
68
|
+
export declare function parseGradientRadius(input: string | number | null | undefined): number;
|
|
69
|
+
/**
|
|
70
|
+
* The colour bound. A gradient is a handful of stops; a list in the thousands is a bug or an
|
|
71
|
+
* attack, and every renderer turns each colour into shader geometry. The desktop lane already
|
|
72
|
+
* bounded this on its own, which made the bound a property of one renderer instead of the
|
|
73
|
+
* grammar - so it lives here now, where all four read it.
|
|
74
|
+
*
|
|
75
|
+
* TRUNCATION rather than rejection: a bounded gradient still paints, and past sixty-four stops
|
|
76
|
+
* no display can show the difference. Refusing to paint would turn a cosmetic excess into a
|
|
77
|
+
* blank element.
|
|
78
|
+
*/
|
|
79
|
+
export declare const MAX_GRADIENT_COLORS = 64;
|
|
80
|
+
/** `gradient="c1|c2|…"` — the shorthand every existing app already writes. */
|
|
81
|
+
export declare function parseGradientColors(input: string | null | undefined): string[];
|
|
82
|
+
/**
|
|
83
|
+
* `gradientStops` — positions matching the colour list. A COUNT MISMATCH FALLS BACK TO EVEN
|
|
84
|
+
* SPACING rather than guessing which colour lost its stop: a gradient that silently reorders
|
|
85
|
+
* itself when the author adds a colour is worse than one that ignores the attribute.
|
|
86
|
+
* Values are clamped to 0…1 and forced monotonically non-decreasing.
|
|
87
|
+
*/
|
|
88
|
+
export declare function parseGradientStops(input: string | null | undefined, count: number): number[];
|
|
89
|
+
/**
|
|
90
|
+
* `gradientPoints` — the mesh control grid. Rows are `;`-separated, points `,`-separated, and
|
|
91
|
+
* each point is `x y color`. The grid must be rectangular and at least 2x2; anything else
|
|
92
|
+
* returns null and the caller degrades to a linear gradient rather than painting a blank.
|
|
93
|
+
*/
|
|
94
|
+
export declare function parseMeshPoints(input: string | null | undefined): MeshGrid | null;
|
|
95
|
+
/**
|
|
96
|
+
* The declared mesh degradation, used by every target that cannot draw a real mesh (Android,
|
|
97
|
+
* the web, and iOS below 18): one radial per control point over a base fill, painted row-major.
|
|
98
|
+
* The base is the control point nearest the centre, chosen by index so it is deterministic.
|
|
99
|
+
*/
|
|
100
|
+
export declare function meshFallbackLayers(mesh: MeshGrid): MeshFallback;
|
|
101
|
+
/** Fold every gradient attribute into the one descriptor each renderer paints from. */
|
|
102
|
+
export declare function resolveGradient(attributes: GradientAttributes): GradientResolution;
|
|
103
|
+
export type GaugeVariant = "circular" | "accessoryCircular" | "linear" | "accessoryLinear";
|
|
104
|
+
export interface GaugeMetrics {
|
|
105
|
+
readonly arcStart: number;
|
|
106
|
+
readonly arcSweep: number;
|
|
107
|
+
readonly thickness: number;
|
|
108
|
+
readonly showsCurrentLabel: boolean;
|
|
109
|
+
readonly showsBoundLabels: boolean;
|
|
110
|
+
}
|
|
111
|
+
/** The circular arc starts at 225 and sweeps 270, leaving the 90-degree gap at the bottom that
|
|
112
|
+
* makes a gauge read as a gauge and not as a progress ring. */
|
|
113
|
+
export declare const GAUGE_VARIANTS: {
|
|
114
|
+
readonly [variant: string]: GaugeMetrics;
|
|
115
|
+
};
|
|
116
|
+
export interface GaugeAccessibility {
|
|
117
|
+
readonly role: "meter";
|
|
118
|
+
readonly min: number;
|
|
119
|
+
readonly max: number;
|
|
120
|
+
readonly now: number;
|
|
121
|
+
readonly percent: number;
|
|
122
|
+
readonly valueText: string;
|
|
123
|
+
}
|
|
124
|
+
export interface GaugeResolution extends GaugeMetrics {
|
|
125
|
+
readonly variant: GaugeVariant;
|
|
126
|
+
readonly fraction: number;
|
|
127
|
+
readonly clampedValue: number;
|
|
128
|
+
readonly valueAngle: number;
|
|
129
|
+
readonly a11y: GaugeAccessibility;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* `<gauge>` — value to arc, plus the meter semantics that are contract, not follow-up. An
|
|
133
|
+
* inverted or empty range resolves to fraction 0 rather than NaN, because a gauge that renders
|
|
134
|
+
* nothing is recoverable and one that renders invalid output is not.
|
|
135
|
+
*/
|
|
136
|
+
export declare function resolveGauge(args: {
|
|
137
|
+
value?: unknown;
|
|
138
|
+
min?: unknown;
|
|
139
|
+
max?: unknown;
|
|
140
|
+
variant?: string | null;
|
|
141
|
+
currentLabel?: string | null;
|
|
142
|
+
}): GaugeResolution;
|
|
143
|
+
export interface GaugeTintSegment {
|
|
144
|
+
readonly fromIndex: number;
|
|
145
|
+
readonly toIndex: number;
|
|
146
|
+
readonly t: number;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* The value-following tint: which two colours of `tint="a|b|c"` the needle sits between, and
|
|
150
|
+
* how far. Colour RESOLUTION is per-renderer (tokens differ), so the core returns indices and
|
|
151
|
+
* an interpolation factor and lets each target mix in its own colour space.
|
|
152
|
+
*/
|
|
153
|
+
export declare function gaugeTintSegment(colors: readonly string[], stops: readonly number[], fraction: number): GaugeTintSegment | null;
|
|
154
|
+
export interface Rgba {
|
|
155
|
+
readonly r: number;
|
|
156
|
+
readonly g: number;
|
|
157
|
+
readonly b: number;
|
|
158
|
+
readonly a: number;
|
|
159
|
+
}
|
|
160
|
+
/** The pinned name table the picker announces from. Small on purpose: a screen reader saying
|
|
161
|
+
* "cornflower blue" is not more useful than "blue", and a big table is a big disagreement. */
|
|
162
|
+
export declare const COLOR_NAMES: readonly {
|
|
163
|
+
readonly name: string;
|
|
164
|
+
readonly hex: string;
|
|
165
|
+
}[];
|
|
166
|
+
/** Extra tones of the table's own names (common UI palette steps), so the perceptual nearest match lands on the word a person
|
|
167
|
+
* would say: #DB2777 is pink, #16A34A green, #0A84FF blue. Every anchor names a table entry. */
|
|
168
|
+
export declare const COLOR_NAME_ANCHORS: readonly {
|
|
169
|
+
readonly name: string;
|
|
170
|
+
readonly hex: string;
|
|
171
|
+
}[];
|
|
172
|
+
/** `#RGB` · `#RGBA` · `#RRGGBB` · `#RRGGBBAA` → channels, or null. Nothing else is a colour here. */
|
|
173
|
+
export declare function parseHexColor(input: string | null | undefined): Rgba | null;
|
|
174
|
+
/** Uppercase output, and the alpha pair only when it is both allowed and not opaque. */
|
|
175
|
+
export declare function formatHexColor(color: Rgba, alphaAllowed?: boolean): string;
|
|
176
|
+
/** Nearest name by squared OKLab distance over the table and its anchors, ties broken by order (table first). Deterministic. */
|
|
177
|
+
export declare function nearestColorName(color: Rgba): string;
|
|
178
|
+
/** Presets shown first. Invalid entries drop, duplicates collapse, and the list caps at 24. */
|
|
179
|
+
export declare function resolveSwatches(input: string | null | undefined, alphaAllowed?: boolean): string[];
|
|
180
|
+
export type ColorPickerMode = "wheel" | "sliders" | "swatches";
|
|
181
|
+
export declare const COLOR_PICKER_MODES: readonly ColorPickerMode[];
|
|
182
|
+
/** Undeclared mode: swatches when presets exist (they are the fast path), otherwise the wheel. */
|
|
183
|
+
export declare function resolveColorPickerMode(mode: string | null | undefined, _alpha: boolean, swatchCount: number): ColorPickerMode;
|
|
184
|
+
/** `<input type="color">` supports neither alpha nor presets, so the web ejects to its own panel. */
|
|
185
|
+
export declare function webNeedsCustomColorPanel(alpha: boolean, swatchCount: number): boolean;
|
|
186
|
+
export type MaskMode = "alpha" | "luminance";
|
|
187
|
+
export interface MaskWebLayer {
|
|
188
|
+
readonly image: "mask" | "opaque";
|
|
189
|
+
readonly composite: "add" | "subtract";
|
|
190
|
+
}
|
|
191
|
+
export interface MaskResolution {
|
|
192
|
+
readonly mode: MaskMode;
|
|
193
|
+
readonly invert: boolean;
|
|
194
|
+
/** The Compose blend mode: DstIn keeps what the mask covers, DstOut keeps what it does not. */
|
|
195
|
+
readonly blend: "dstIn" | "dstOut";
|
|
196
|
+
readonly cssMaskMode: "alpha" | "luminance";
|
|
197
|
+
readonly webLayers: readonly MaskWebLayer[];
|
|
198
|
+
/** Always true: the mask child is decorative BY CONSTRUCTION. */
|
|
199
|
+
readonly maskChildHidden: boolean;
|
|
200
|
+
/** Always true: `<masked>` changes appearance, not content. */
|
|
201
|
+
readonly contentSemanticsPreserved: boolean;
|
|
202
|
+
}
|
|
203
|
+
export declare function resolveMask(mode: string | null | undefined, invert: boolean | string | null | undefined): MaskResolution;
|
|
204
|
+
export declare const MENU_ROW_LIMITS: Readonly<{
|
|
205
|
+
maxItems: 32;
|
|
206
|
+
maxValues: 1024;
|
|
207
|
+
maxTextCharacters: 128;
|
|
208
|
+
}>;
|
|
209
|
+
export type MenuRowLimitName = keyof typeof MENU_ROW_LIMITS;
|
|
210
|
+
export type MenuRowLimits = {
|
|
211
|
+
readonly [K in MenuRowLimitName]: number;
|
|
212
|
+
};
|
|
213
|
+
export type MenuRowRefusal = Readonly<{
|
|
214
|
+
limit: MenuRowLimitName;
|
|
215
|
+
max: number;
|
|
216
|
+
}>;
|
|
217
|
+
/** The order a refusal names its limit in; the same list on every lane. */
|
|
218
|
+
export declare const MENU_ROW_LIMIT_ORDER: readonly MenuRowLimitName[];
|
|
219
|
+
/** One limit as an app wrote it: a whole number of zero or more (a fraction is floored), as a
|
|
220
|
+
* number or as decimal text. Anything else reads as the default. */
|
|
221
|
+
export declare function menuRowLimit(value: unknown, fallback: number): number;
|
|
222
|
+
/** The three limits from a reader of the element's attributes (or the package's settings). */
|
|
223
|
+
export declare function menuRowLimits(read: (name: MenuRowLimitName) => unknown): MenuRowLimits;
|
|
224
|
+
/** null when the rows are within every limit (or are not a list: nothing to show), else the first
|
|
225
|
+
* limit they exceed. Reads own data properties only and never invokes an accessor. */
|
|
226
|
+
export declare function menuRowsRefusal(input: unknown, limits?: MenuRowLimits): MenuRowRefusal | null;
|
|
227
|
+
//# sourceMappingURL=controls-core.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"controls-core.d.ts","sourceRoot":"","sources":["../src/controls-core.ts"],"names":[],"mappings":"AA0CA,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAMtE;AAED,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,CAAC;AACpE,eAAO,MAAM,cAAc,EAAE,SAAS,YAAY,EAA4C,CAAC;AAE/F,6FAA6F;AAC7F,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAE1C,MAAM,WAAW,SAAS;IAAG,QAAQ,CAA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