@lightningjs/blits
Advanced tools
Comparing version 0.6.0 to 0.6.1
@@ -34,4 +34,4 @@ { | ||
"dependencies": { | ||
"@lightningjs/blits": "^0.6.0" | ||
"@lightningjs/blits": "^0.6.1" | ||
} | ||
} |
# Changelog | ||
# v0.6.1 | ||
_8 jan 2024_ | ||
- Fixed issue with using single quotes as Text content | ||
- Added first Text-to-Speech / Announcer functionality | ||
# v0.6.0 | ||
@@ -4,0 +11,0 @@ |
@@ -12,2 +12,3 @@ - [Getting started](getting_started.md) | ||
- [Displaying images](displaying_images.md) | ||
- [Text-to-Speech / Announcer](text-to-speech-announcer.md) | ||
{ | ||
"name": "@lightningjs/blits", | ||
"version": "0.6.0", | ||
"version": "0.6.1", | ||
"description": "Blits: The Lightning 3 App Development Framework", | ||
@@ -5,0 +5,0 @@ "bin": "bin/index.cjs", |
@@ -73,2 +73,15 @@ /* | ||
interface RouteAnnounce { | ||
/** | ||
* Message to be announced | ||
*/ | ||
message: String, | ||
/** | ||
* Politeness level | ||
* | ||
* Defaults to 'off' | ||
*/ | ||
politeness?: 'off' | 'polite' | 'assertive' | ||
} | ||
function Application( | ||
@@ -98,3 +111,10 @@ config: Application.ApplicationConfig | ||
*/ | ||
options?: object // todo: specify which options are available | ||
options?: object // todo: specify which options are available, | ||
/** | ||
* Message to be announced when visiting the route (often used for accessibility purposes) | ||
* | ||
* Can be either a `String` with the message or an object that defines the message and the | ||
* politeness level | ||
*/ | ||
announce?: String | RouteAnnounce | ||
} | ||
@@ -101,0 +121,0 @@ |
@@ -319,3 +319,4 @@ /* | ||
} else { | ||
castedValue = `'${parseInlineContent(val, component)}'` | ||
// unescaped single quotes must be escaped | ||
castedValue = `'${parseInlineContent(val.replace(/(?<!\\)'/g, "\\'"), component)}'` | ||
} | ||
@@ -322,0 +323,0 @@ } |
@@ -31,2 +31,3 @@ /* | ||
import { trigger } from '../reactivity/effect.js' | ||
import Announcer from '../../announcer/announcer.js' | ||
@@ -226,2 +227,8 @@ const shaderAlias = { | ||
}, | ||
$announcer: { | ||
value: Announcer, | ||
writable: false, | ||
enumerable: false, | ||
configurable: false, | ||
}, | ||
}) | ||
@@ -228,0 +235,0 @@ } |
@@ -24,2 +24,3 @@ /* | ||
import Focus from '../focus.js' | ||
import Announcer from '../announcer/announcer.js' | ||
@@ -59,3 +60,3 @@ export let currentRoute | ||
if (route) { | ||
// add the previous route (tecnhically still the current route at this point) | ||
// add the previous route (technically still the current route at this point) | ||
// into the history stack, unless navigating back or inHistory flag of route is false | ||
@@ -137,2 +138,12 @@ if (navigatingBack === false && previousRoute && previousRoute.options.inHistory === true) { | ||
// Announce route change if a message has been specified for this route | ||
if (route.announce) { | ||
if (typeof route.announce === 'string') { | ||
route.announce = { | ||
message: route.announce, | ||
} | ||
} | ||
Announcer.speak(route.announce.message, route.announce.politeness) | ||
} | ||
// focus the new view | ||
@@ -139,0 +150,0 @@ focus ? Focus.set(focus) : view.focus() |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
928219
105
22535