Tsm/fixes (#686)

* fix: resolve console error for incomplete charts

* chore: add spec clarifiction for constraints

* feat: add keyboard navigation as serve option

* chore: bump spec version
This commit is contained in:
Tobias Åström
2021-10-04 10:12:15 +02:00
committed by GitHub
parent 87f1be979f
commit df3605f7c5
6 changed files with 16 additions and 5 deletions

View File

@@ -3,7 +3,7 @@
"info": {
"name": "@nebula.js/stardust",
"description": "Product and framework agnostic integration API for Qlik's Associative Engine",
"version": "2.0.0",
"version": "2.1.0",
"license": "MIT",
"stability": "stable"
},
@@ -1534,14 +1534,17 @@
"kind": "interface",
"entries": {
"passive": {
"description": "Whether or not passive constraints are on. Should block any passive interaction by users, ie: tooltips",
"optional": true,
"type": "boolean"
},
"active": {
"description": "Whether or not active constraints are on. Should block any active interaction by users, ie: scroll, click",
"optional": true,
"type": "boolean"
},
"select": {
"description": "Whether or not active select are on. Should block any selection action. Implied when active is true.",
"optional": true,
"type": "boolean"
}

View File

@@ -832,9 +832,9 @@ export function useAction(fn, deps) {
/**
* @interface Constraints
* @property {boolean=} passive
* @property {boolean=} active
* @property {boolean=} select
* @property {boolean=} passive Whether or not passive constraints are on. Should block any passive interaction by users, ie: tooltips
* @property {boolean=} active Whether or not active constraints are on. Should block any active interaction by users, ie: scroll, click
* @property {boolean=} select Whether or not active select are on. Should block any selection action. Implied when active is true.
*/
/**
@@ -1120,7 +1120,8 @@ export function focus(component) {
export function blur(component) {
const acc = component.__hooks.accessibility;
if (!acc.active) {
// Incomplete/Invalid/Legacy viz hasn't been initialized with hooks
if (!acc || !acc.active) {
return;
}
acc.active = false;

View File

@@ -23,6 +23,7 @@ Options:
[string] [default: "nebula.config.js"]
--entry File entrypoint [string]
--type Generic object type [string]
--keyboardNavigation [boolean] [default: false]
--build [boolean] [default: true]
--host [string] [default: "localhost"]
--port [number]

View File

@@ -35,6 +35,10 @@ const options = {
type: 'boolean',
default: false,
},
keyboardNavigation: {
type: 'boolean',
default: false,
},
resources: {
type: 'string',
description: 'Path to a folder that will be served as static files under /resources',

View File

@@ -135,6 +135,7 @@ module.exports = async ({
flags: serveConfig.flags,
themes: themes.map((theme) => theme.id),
types: serveConfig.types,
keyboardNavigation: serveConfig.keyboardNavigation,
});
});

View File

@@ -84,6 +84,7 @@ export default function App({ app, info }) {
context: {
theme: currentThemeName,
language: currentLanguage,
keyboardNavigation: info.keyboardNavigation,
},
load: (type) => Promise.resolve(window[type.name]),
flags: info.flags,