From 389bd232945d1cdcb99f16be48ad0370ba951d41 Mon Sep 17 00:00:00 2001 From: Ryan Carniato Date: Sat, 26 Oct 2019 23:46:52 -0700 Subject: [PATCH 01/38] update version --- package-lock.json | 22 +++++++++++----------- package.json | 8 ++++---- src/h.ts | 16 ++++++++++++++-- src/html.ts | 16 ++++++++++++++-- src/runtime.d.ts | 2 +- src/runtime.js | 8 +++++--- 6 files changed, 49 insertions(+), 23 deletions(-) diff --git a/package-lock.json b/package-lock.json index 96ac98c..08353eb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "mobx-jsx", - "version": "0.7.0", + "version": "0.8.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -319,12 +319,12 @@ } }, "dom-expressions": { - "version": "0.13.0", - "resolved": "https://registry.npmjs.org/dom-expressions/-/dom-expressions-0.13.0.tgz", - "integrity": "sha512-0cf0R+illaZFxqnYQoH+4DAoBDQaZ9QqIX0uJXQnBOxrkxFgNa0gEBKvUjQZ9eH5xuNFXu0FSJWI9/m6P5Xzmg==", + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/dom-expressions/-/dom-expressions-0.14.0.tgz", + "integrity": "sha512-5YzbcbT9+elbS1wpirK+bmPTl6Kcis378Wz9DFiH0+Qs5yroQuVNmrZZTWbrgmFDntih/Gz/EEu5ZcCI9Dtqcw==", "dev": true, "requires": { - "ejs": "^2.6.2" + "ejs": "^2.7.1" } }, "ejs": { @@ -364,9 +364,9 @@ "dev": true }, "hyper-dom-expressions": { - "version": "0.13.0", - "resolved": "https://registry.npmjs.org/hyper-dom-expressions/-/hyper-dom-expressions-0.13.0.tgz", - "integrity": "sha512-dHYyBcaEh34MIGZ8TMAKfbw11Nz/LLUTquoJTqDLTajX66pG4dgV6UJ2JLZGDOzHWgympRahBaipgMP9C5Vj5g==", + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/hyper-dom-expressions/-/hyper-dom-expressions-0.14.0.tgz", + "integrity": "sha512-liLOQyYLHf5RjeuKpXOTIc2/ujSKWy+fEr8F9haZzP+5Cv88PHD/UgOGRs9k9z2E0MSGIrKaT9M3pKYOSPVFpw==", "dev": true }, "is-module": { @@ -397,9 +397,9 @@ } }, "lit-dom-expressions": { - "version": "0.13.0", - "resolved": "https://registry.npmjs.org/lit-dom-expressions/-/lit-dom-expressions-0.13.0.tgz", - "integrity": "sha512-AG+fzW4EBbAIn6UTqQ/o8N421Gj1Gk4o3hWGZuYSakkeOUlXWwAkDHrAzNxejCHo9Rn/XhTjV8fHAvmMYIU/cg==", + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/lit-dom-expressions/-/lit-dom-expressions-0.14.0.tgz", + "integrity": "sha512-JXb/daUvD6/WIy+hehKcvEcTN622BOyCaDPlehmWvgHNm0HxAwZk/KBr1yww/id4gwvpVDQZUIegCIsgdayFHw==", "dev": true }, "lodash": { diff --git a/package.json b/package.json index abd59c7..aec3ebd 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "mobx-jsx", "description": "Raw MobX performance without the restraints of a Virtual DOM", - "version": "0.7.0", + "version": "0.8.0", "author": "Ryan Carniato", "license": "MIT", "repository": { @@ -18,9 +18,9 @@ "devDependencies": { "@babel/core": "7.6.4", "@babel/preset-typescript": "7.6.0", - "dom-expressions": "0.13.0", - "hyper-dom-expressions": "0.13.0", - "lit-dom-expressions": "0.13.0", + "dom-expressions": "0.14.0", + "hyper-dom-expressions": "0.14.0", + "lit-dom-expressions": "0.14.0", "mobx": "^5.14.0", "rollup": "^1.24.0", "rollup-plugin-babel": "4.3.3", diff --git a/src/h.ts b/src/h.ts index a6b1b13..1c2c6d5 100644 --- a/src/h.ts +++ b/src/h.ts @@ -1,6 +1,18 @@ /// import { createHyperScript } from 'hyper-dom-expressions'; -import * as r from './index'; +import { + wrap, + insert, + createComponent, + delegateEvents, + classList +} from './index'; export * from './index'; -export const h = createHyperScript(r); \ No newline at end of file +export const h = createHyperScript({ + wrap, + insert, + createComponent, + delegateEvents, + classList +}); \ No newline at end of file diff --git a/src/html.ts b/src/html.ts index 37dbab3..b274b30 100644 --- a/src/html.ts +++ b/src/html.ts @@ -1,6 +1,18 @@ /// import { createHTML } from 'lit-dom-expressions'; -import * as r from './index'; +import { + wrap, + insert, + createComponent, + delegateEvents, + classList +} from './index'; export * from './index'; -export const html = createHTML(r); \ No newline at end of file +export const html = createHTML({ + wrap, + insert, + createComponent, + delegateEvents, + classList +}); \ No newline at end of file diff --git a/src/runtime.d.ts b/src/runtime.d.ts index 82c0ba3..7e148a6 100644 --- a/src/runtime.d.ts +++ b/src/runtime.d.ts @@ -1,4 +1,4 @@ -export function template(html: string): HTMLTemplateElement; +export function template(html: string, isSVG?: boolean): Element; export function wrap(fn: (prev?: T) => T): any; export function insert( parent: Element | Document | ShadowRoot | DocumentFragment, diff --git a/src/runtime.js b/src/runtime.js index c81c439..fa002d0 100644 --- a/src/runtime.js +++ b/src/runtime.js @@ -7,11 +7,13 @@ const eventRegistry = new Set(); export { wrap }; -export function template(html) { +export function template(html, isSVG) { const t = document.createElement('template'); t.innerHTML = html; if (t.innerHTML !== html) throw new Error(`Template html does not match input:\n${t.innerHTML}\n${html}`); - return t; + let node = t.content.firstChild; + if (isSVG) node = node.firstChild; + return node; } export function createComponent(Comp, props, dynamicKeys) { @@ -96,7 +98,7 @@ export function hydration(code, root) { export function getNextElement(template) { if (!hydrateRegistry) { - const el = template.content.firstChild.cloneNode(true); + const el = template.cloneNode(true); if (SSR) el.setAttribute('_hk', `${hydrateKey++}`); return el; } From 4fb7744ec6751a50d0db957353bcd924596b9d4f Mon Sep 17 00:00:00 2001 From: Ryan Carniato Date: Fri, 8 Nov 2019 22:24:33 -0800 Subject: [PATCH 02/38] wrap conditionals, sample components --- dom-expressions.config.js | 6 ++- package-lock.json | 26 ++++++------- package.json | 10 ++--- src/core.ts | 80 +++++++++++++++++++++++++++++---------- src/index.ts | 19 ++++++---- src/runtime.js | 13 ++++--- 6 files changed, 101 insertions(+), 53 deletions(-) diff --git a/dom-expressions.config.js b/dom-expressions.config.js index 55e862f..b87fb59 100644 --- a/dom-expressions.config.js +++ b/dom-expressions.config.js @@ -3,8 +3,10 @@ module.exports = { includeTypes: true, variables: { imports: [ - `import { computed as wrap } from './core'` + `import { effect as wrap, condition as wrapCondition } from './core';`, + `import { untracked as ignore } from 'mobx';` ], - classComponents: true + classComponents: true, + wrapConditionals: true } } \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 08353eb..f275533 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "mobx-jsx", - "version": "0.8.0", + "version": "0.8.1", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -319,9 +319,9 @@ } }, "dom-expressions": { - "version": "0.14.0", - "resolved": "https://registry.npmjs.org/dom-expressions/-/dom-expressions-0.14.0.tgz", - "integrity": "sha512-5YzbcbT9+elbS1wpirK+bmPTl6Kcis378Wz9DFiH0+Qs5yroQuVNmrZZTWbrgmFDntih/Gz/EEu5ZcCI9Dtqcw==", + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/dom-expressions/-/dom-expressions-0.14.1.tgz", + "integrity": "sha512-a2gO6pX2dDhA5qFKXuFg5P0JiNdxSvHdAFwKfm+qy8JjX6nQtHyRVoSk/7/K8VtIFqZ+YE3JyOQZxmF2Ld8qXA==", "dev": true, "requires": { "ejs": "^2.7.1" @@ -364,9 +364,9 @@ "dev": true }, "hyper-dom-expressions": { - "version": "0.14.0", - "resolved": "https://registry.npmjs.org/hyper-dom-expressions/-/hyper-dom-expressions-0.14.0.tgz", - "integrity": "sha512-liLOQyYLHf5RjeuKpXOTIc2/ujSKWy+fEr8F9haZzP+5Cv88PHD/UgOGRs9k9z2E0MSGIrKaT9M3pKYOSPVFpw==", + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/hyper-dom-expressions/-/hyper-dom-expressions-0.14.1.tgz", + "integrity": "sha512-NdwKKR/Njdg1xAbfeqtwCTY7DxbLA92GPP9YlE+II4i0+9DeIsy8qchvHunO+Kv8SZb74/AGLovCFdSH+JeLHg==", "dev": true }, "is-module": { @@ -397,9 +397,9 @@ } }, "lit-dom-expressions": { - "version": "0.14.0", - "resolved": "https://registry.npmjs.org/lit-dom-expressions/-/lit-dom-expressions-0.14.0.tgz", - "integrity": "sha512-JXb/daUvD6/WIy+hehKcvEcTN622BOyCaDPlehmWvgHNm0HxAwZk/KBr1yww/id4gwvpVDQZUIegCIsgdayFHw==", + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/lit-dom-expressions/-/lit-dom-expressions-0.14.1.tgz", + "integrity": "sha512-3PUkIkVjpBc5E8GAAthaSvVE5enIkzuKzZqFM9uTFO+/I4yD/UJhDXvHdaC8UjzBpglKiktVHAqi9jE0nyXfqg==", "dev": true }, "lodash": { @@ -518,9 +518,9 @@ "dev": true }, "typescript": { - "version": "3.6.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.6.4.tgz", - "integrity": "sha512-unoCll1+l+YK4i4F8f22TaNVPRHcD9PA3yCuZ8g5e0qGqlVlJ/8FSateOLLSagn+Yg5+ZwuPkL8LFUc0Jcvksg==", + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.7.2.tgz", + "integrity": "sha512-ml7V7JfiN2Xwvcer+XAf2csGO1bPBdRbFCkYBczNZggrBZ9c7G3riSUeJmqEU5uOtXNPMhE3n+R4FA/3YOAWOQ==", "dev": true } } diff --git a/package.json b/package.json index aec3ebd..e5591a6 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "mobx-jsx", "description": "Raw MobX performance without the restraints of a Virtual DOM", - "version": "0.8.0", + "version": "0.8.1", "author": "Ryan Carniato", "license": "MIT", "repository": { @@ -18,14 +18,14 @@ "devDependencies": { "@babel/core": "7.6.4", "@babel/preset-typescript": "7.6.0", - "dom-expressions": "0.14.0", - "hyper-dom-expressions": "0.14.0", - "lit-dom-expressions": "0.14.0", + "dom-expressions": "0.14.1", + "hyper-dom-expressions": "0.14.1", + "lit-dom-expressions": "0.14.1", "mobx": "^5.14.0", "rollup": "^1.24.0", "rollup-plugin-babel": "4.3.3", "rollup-plugin-node-resolve": "5.2.0", - "typescript": "3.6.4" + "typescript": "3.7.2" }, "peerDependencies": { "mobx": "*" diff --git a/src/core.ts b/src/core.ts index 84c2c1a..bda10c0 100644 --- a/src/core.ts +++ b/src/core.ts @@ -1,4 +1,4 @@ -import { autorun, untracked, $mobx, IObservableArray } from "mobx"; +import { autorun, computed, untracked, $mobx, IObservableArray, observable } from "mobx"; type ContextOwner = { disposables: any[]; @@ -7,7 +7,8 @@ type ContextOwner = { }; export interface Context { id: symbol; - Provide: (props: any) => any; + Provider: (props: any) => any; + defaultValue: unknown; } let globalContext: ContextOwner | null = null; @@ -39,7 +40,7 @@ export function cleanup(fn: () => void) { (ref = globalContext) != null && ref.disposables.push(fn); } -export function computed(fn: (prev?: T) => T) { +export function effect(fn: (prev?: T) => T) { let current: T, d: any[]; const context = { disposables: d = [], @@ -58,35 +59,72 @@ export function computed(fn: (prev?: T) => T) { }); } -export function createContext(initFn?: Function): Context { +// only updates when boolean expression changes +export function condition(fn: () => T) { + const o = observable.box(!!untracked(fn)); + effect(prev => { + const res = !!fn(); + prev !== res && o.set(res); + return res; + }) + return () => o.get(); +} + +// dynamic import to support code splitting +export function lazy(fn: () => Promise<{ default: T }>) { + return (props: object) => { + let Comp: T; + const result = observable.box(); + fn().then(component => result.set(component.default)); + const rendered = computed( + () => (Comp = result.get()) && untracked(() => Comp(props)) + ); + return () => rendered.get(); + }; +} + +// context api +export function createContext(defaultValue?: unknown): Context { const id = Symbol("context"); - return { id, Provide: createProvider(id, initFn) }; + return { id, Provider: createProvider(id), defaultValue }; } export function useContext(context: Context) { - if (globalContext === null) - return console.warn( - "Context keys cannot be looked up without a root or parent" - ); - return lookup(globalContext, context.id); + return lookup(globalContext, context.id) || context.defaultValue; } -function lookup(owner: ContextOwner, key: symbol | string): any { +function lookup(owner: ContextOwner | null, key: symbol | string): any { return ( - (owner && owner.context && owner.context[key]) || - (owner.owner && lookup(owner.owner, key)) + owner && + ((owner.context && owner.context[key]) || + (owner.owner && lookup(owner.owner, key))) ); } -function createProvider(id: symbol, initFn?: Function) { - return (props: any) => { +function resolveChildren(children: any): any { + if (typeof children === "function") { + const c = computed(children); + return () => c.get(); + } + if (Array.isArray(children)) { + const results: any[] = []; + for (let i = 0; i < children.length; i++) { + let result = resolveChildren(children[i]); + Array.isArray(result) + ? results.push.apply(results, result) + : results.push(result); + } + return results; + } + return children; +} + +function createProvider(id: symbol) { + return function provider(props: { value: unknown; children: any }) { let rendered; - computed(() => { - untracked(() => { - const context = globalContext!.context || (globalContext!.context = {}); - context[id] = initFn ? initFn(props.value) : props.value; - rendered = props.children; - }); + effect(() => { + globalContext!.context = { [id]: props.value }; + rendered = untracked(() => resolveChildren(props.children)); }); return rendered; }; diff --git a/src/index.ts b/src/index.ts index 3a93457..438b807 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,11 +1,10 @@ -export * from './core' -export * from './runtime' -import { root } from './core'; +export * from "./core"; +export * from "./runtime"; +import { root } from "./core"; import { insert, hydration, startSSR } from "./runtime"; type MountableElement = Element | Document | ShadowRoot | DocumentFragment; - export function render(code: () => any, mount: MountableElement): () => void { let dispose: () => void; root(disposer => { @@ -15,15 +14,21 @@ export function render(code: () => any, mount: MountableElement): () => void { return dispose!; } -export function renderSSR(code: () => any, element: MountableElement): () => void { +export function renderSSR( + code: () => any, + element: MountableElement +): () => void { startSSR(); return render(code, element); } -export function hydrate(code: () => any, element: MountableElement): () => void { +export function hydrate( + code: () => any, + element: MountableElement +): () => void { let disposer: () => void; hydration(() => { disposer = render(code, element); }, element); return disposer!; -} \ No newline at end of file +} diff --git a/src/runtime.js b/src/runtime.js index fa002d0..dc0d92e 100644 --- a/src/runtime.js +++ b/src/runtime.js @@ -1,11 +1,12 @@ import { Attributes, SVGAttributes, NonComposedEvents } from 'dom-expressions'; -import { computed as wrap } from './core'; +import { effect as wrap, condition as wrapCondition } from './core';; +import { untracked as ignore } from 'mobx';; const eventRegistry = new Set(); -export { wrap }; +export { wrap, wrapCondition }; export function template(html, isSVG) { const t = document.createElement('template'); @@ -22,11 +23,13 @@ export function createComponent(Comp, props, dynamicKeys) { } if (Comp.prototype && Comp.prototype.isClassComponent) { - const comp = new Comp(props); - return comp.render(); + return ignore(() => { + const comp = new Comp(props); + return comp.render(); + }); } - return Comp(props); + return ignore(() => Comp(props)); } export function delegateEvents(eventNames) { From 2e0f26b09a9154b35a6919669dcadf950a09539c Mon Sep 17 00:00:00 2001 From: Ryan Carniato Date: Fri, 8 Nov 2019 22:32:11 -0800 Subject: [PATCH 03/38] update readme --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 26b4265..829e0f9 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ render(App, document.getElementById('main')); And include 'babel-plugin-jsx-dom-expressions' in your babelrc, webpack babel loader, or rollup babel plugin. ```js -"plugins": [["jsx-dom-expressions", {moduleName: 'mobx-jsx', alwaysCreateComponents: true}]] +"plugins": [["jsx-dom-expressions", {moduleName: 'mobx-jsx', wrapConditionals: true}]] ``` ## Installation @@ -32,6 +32,8 @@ And include 'babel-plugin-jsx-dom-expressions' in your babelrc, webpack babel lo [MobX Counter(Classes)](https://codesandbox.io/s/mobx-counterclasses-uz7g9) +[MobX Lazy](https://codesandbox.io/s/mobx-lazy-demo-ev95s) + ## API MobX JSX works both with function and class components(extend Component from this library). It also ships a specialize map function for optimal list rendering that takes an observable array as it's first argument. From b5cc4c5b873bcbaf79b3d6273747d98dacc1a9f5 Mon Sep 17 00:00:00 2001 From: Ryan Carniato Date: Fri, 8 Nov 2019 22:32:46 -0800 Subject: [PATCH 04/38] update readme --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 829e0f9..cbc6c17 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,8 @@ And include 'babel-plugin-jsx-dom-expressions' in your babelrc, webpack babel lo [MobX Lazy](https://codesandbox.io/s/mobx-lazy-demo-ev95s) +[Mobx Context](https://codesandbox.io/s/mobx-counter-context-wlu1x) + ## API MobX JSX works both with function and class components(extend Component from this library). It also ships a specialize map function for optimal list rendering that takes an observable array as it's first argument. From 1d39be5dbf8db15dba8462d666470ceba95c86c4 Mon Sep 17 00:00:00 2001 From: Ryan Carniato Date: Mon, 11 Nov 2019 21:41:04 -0800 Subject: [PATCH 05/38] Many fixes around Context and nested reactivity --- dom-expressions.config.js | 1 + package-lock.json | 353 ++++++++++++++++++++++++++------------ package.json | 10 +- src/core.ts | 9 +- src/runtime.d.ts | 1 + src/runtime.js | 2 + 6 files changed, 262 insertions(+), 114 deletions(-) diff --git a/dom-expressions.config.js b/dom-expressions.config.js index b87fb59..456bd3c 100644 --- a/dom-expressions.config.js +++ b/dom-expressions.config.js @@ -7,6 +7,7 @@ module.exports = { `import { untracked as ignore } from 'mobx';` ], classComponents: true, + wrapNested: true, wrapConditionals: true } } \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index f275533..a712664 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "mobx-jsx", - "version": "0.8.1", + "version": "0.8.2", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -14,80 +14,145 @@ } }, "@babel/core": { - "version": "7.6.4", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.6.4.tgz", - "integrity": "sha512-Rm0HGw101GY8FTzpWSyRbki/jzq+/PkNQJ+nSulrdY6gFGOsNseCqD6KHRYe2E+EdzuBdr2pxCp6s4Uk6eJ+XQ==", + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.7.2.tgz", + "integrity": "sha512-eeD7VEZKfhK1KUXGiyPFettgF3m513f8FoBSWiQ1xTvl1RAopLs42Wp9+Ze911I6H0N9lNqJMDgoZT7gHsipeQ==", "dev": true, "requires": { "@babel/code-frame": "^7.5.5", - "@babel/generator": "^7.6.4", - "@babel/helpers": "^7.6.2", - "@babel/parser": "^7.6.4", - "@babel/template": "^7.6.0", - "@babel/traverse": "^7.6.3", - "@babel/types": "^7.6.3", - "convert-source-map": "^1.1.0", + "@babel/generator": "^7.7.2", + "@babel/helpers": "^7.7.0", + "@babel/parser": "^7.7.2", + "@babel/template": "^7.7.0", + "@babel/traverse": "^7.7.2", + "@babel/types": "^7.7.2", + "convert-source-map": "^1.7.0", "debug": "^4.1.0", "json5": "^2.1.0", "lodash": "^4.17.13", "resolve": "^1.3.2", "semver": "^5.4.1", "source-map": "^0.5.0" + }, + "dependencies": { + "@babel/types": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.2.tgz", + "integrity": "sha512-YTf6PXoh3+eZgRCBzzP25Bugd2ngmpQVrk7kXX0i5N9BO7TFBtIgZYs7WtxtOGs8e6A4ZI7ECkbBCEHeXocvOA==", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + } } }, "@babel/generator": { - "version": "7.6.4", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.6.4.tgz", - "integrity": "sha512-jsBuXkFoZxk0yWLyGI9llT9oiQ2FeTASmRFE32U+aaDTfoE92t78eroO7PTpU/OrYq38hlcDM6vbfLDaOLy+7w==", + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.7.2.tgz", + "integrity": "sha512-WthSArvAjYLz4TcbKOi88me+KmDJdKSlfwwN8CnUYn9jBkzhq0ZEPuBfkAWIvjJ3AdEV1Cf/+eSQTnp3IDJKlQ==", "dev": true, "requires": { - "@babel/types": "^7.6.3", + "@babel/types": "^7.7.2", "jsesc": "^2.5.1", "lodash": "^4.17.13", "source-map": "^0.5.0" + }, + "dependencies": { + "@babel/types": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.2.tgz", + "integrity": "sha512-YTf6PXoh3+eZgRCBzzP25Bugd2ngmpQVrk7kXX0i5N9BO7TFBtIgZYs7WtxtOGs8e6A4ZI7ECkbBCEHeXocvOA==", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + } } }, "@babel/helper-create-class-features-plugin": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.6.0.tgz", - "integrity": "sha512-O1QWBko4fzGju6VoVvrZg0RROCVifcLxiApnGP3OWfWzvxRZFCoBD81K5ur5e3bVY2Vf/5rIJm8cqPKn8HUJng==", + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.7.0.tgz", + "integrity": "sha512-MZiB5qvTWoyiFOgootmRSDV1udjIqJW/8lmxgzKq6oDqxdmHUjeP2ZUOmgHdYjmUVNABqRrHjYAYRvj8Eox/UA==", "dev": true, "requires": { - "@babel/helper-function-name": "^7.1.0", - "@babel/helper-member-expression-to-functions": "^7.5.5", - "@babel/helper-optimise-call-expression": "^7.0.0", + "@babel/helper-function-name": "^7.7.0", + "@babel/helper-member-expression-to-functions": "^7.7.0", + "@babel/helper-optimise-call-expression": "^7.7.0", "@babel/helper-plugin-utils": "^7.0.0", - "@babel/helper-replace-supers": "^7.5.5", - "@babel/helper-split-export-declaration": "^7.4.4" + "@babel/helper-replace-supers": "^7.7.0", + "@babel/helper-split-export-declaration": "^7.7.0" } }, "@babel/helper-function-name": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.1.0.tgz", - "integrity": "sha512-A95XEoCpb3TO+KZzJ4S/5uW5fNe26DjBGqf1o9ucyLyCmi1dXq/B3c8iaWTfBk3VvetUxl16e8tIrd5teOCfGw==", - "dev": true, - "requires": { - "@babel/helper-get-function-arity": "^7.0.0", - "@babel/template": "^7.1.0", - "@babel/types": "^7.0.0" + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.7.0.tgz", + "integrity": "sha512-tDsJgMUAP00Ugv8O2aGEua5I2apkaQO7lBGUq1ocwN3G23JE5Dcq0uh3GvFTChPa4b40AWiAsLvCZOA2rdnQ7Q==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "^7.7.0", + "@babel/template": "^7.7.0", + "@babel/types": "^7.7.0" + }, + "dependencies": { + "@babel/types": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.2.tgz", + "integrity": "sha512-YTf6PXoh3+eZgRCBzzP25Bugd2ngmpQVrk7kXX0i5N9BO7TFBtIgZYs7WtxtOGs8e6A4ZI7ECkbBCEHeXocvOA==", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + } } }, "@babel/helper-get-function-arity": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0.tgz", - "integrity": "sha512-r2DbJeg4svYvt3HOS74U4eWKsUAMRH01Z1ds1zx8KNTPtpTL5JAsdFv8BNyOpVqdFhHkkRDIg5B4AsxmkjAlmQ==", - "dev": true, - "requires": { - "@babel/types": "^7.0.0" + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.7.0.tgz", + "integrity": "sha512-tLdojOTz4vWcEnHWHCuPN5P85JLZWbm5Fx5ZsMEMPhF3Uoe3O7awrbM2nQ04bDOUToH/2tH/ezKEOR8zEYzqyw==", + "dev": true, + "requires": { + "@babel/types": "^7.7.0" + }, + "dependencies": { + "@babel/types": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.2.tgz", + "integrity": "sha512-YTf6PXoh3+eZgRCBzzP25Bugd2ngmpQVrk7kXX0i5N9BO7TFBtIgZYs7WtxtOGs8e6A4ZI7ECkbBCEHeXocvOA==", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + } } }, "@babel/helper-member-expression-to-functions": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.5.5.tgz", - "integrity": "sha512-5qZ3D1uMclSNqYcXqiHoA0meVdv+xUEex9em2fqMnrk/scphGlGgg66zjMrPJESPwrFJ6sbfFQYUSa0Mz7FabA==", - "dev": true, - "requires": { - "@babel/types": "^7.5.5" + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.7.0.tgz", + "integrity": "sha512-QaCZLO2RtBcmvO/ekOLp8p7R5X2JriKRizeDpm5ChATAFWrrYDcDxPuCIBXKyBjY+i1vYSdcUTMIb8psfxHDPA==", + "dev": true, + "requires": { + "@babel/types": "^7.7.0" + }, + "dependencies": { + "@babel/types": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.2.tgz", + "integrity": "sha512-YTf6PXoh3+eZgRCBzzP25Bugd2ngmpQVrk7kXX0i5N9BO7TFBtIgZYs7WtxtOGs8e6A4ZI7ECkbBCEHeXocvOA==", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + } } }, "@babel/helper-module-imports": { @@ -100,12 +165,25 @@ } }, "@babel/helper-optimise-call-expression": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.0.0.tgz", - "integrity": "sha512-u8nd9NQePYNQV8iPWu/pLLYBqZBa4ZaY1YWRFMuxrid94wKI1QNt67NEZ7GAe5Kc/0LLScbim05xZFWkAdrj9g==", - "dev": true, - "requires": { - "@babel/types": "^7.0.0" + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.7.0.tgz", + "integrity": "sha512-48TeqmbazjNU/65niiiJIJRc5JozB8acui1OS7bSd6PgxfuovWsvjfWSzlgx+gPFdVveNzUdpdIg5l56Pl5jqg==", + "dev": true, + "requires": { + "@babel/types": "^7.7.0" + }, + "dependencies": { + "@babel/types": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.2.tgz", + "integrity": "sha512-YTf6PXoh3+eZgRCBzzP25Bugd2ngmpQVrk7kXX0i5N9BO7TFBtIgZYs7WtxtOGs8e6A4ZI7ECkbBCEHeXocvOA==", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + } } }, "@babel/helper-plugin-utils": { @@ -115,35 +193,74 @@ "dev": true }, "@babel/helper-replace-supers": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.5.5.tgz", - "integrity": "sha512-XvRFWrNnlsow2u7jXDuH4jDDctkxbS7gXssrP4q2nUD606ukXHRvydj346wmNg+zAgpFx4MWf4+usfC93bElJg==", - "dev": true, - "requires": { - "@babel/helper-member-expression-to-functions": "^7.5.5", - "@babel/helper-optimise-call-expression": "^7.0.0", - "@babel/traverse": "^7.5.5", - "@babel/types": "^7.5.5" + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.7.0.tgz", + "integrity": "sha512-5ALYEul5V8xNdxEeWvRsBzLMxQksT7MaStpxjJf9KsnLxpAKBtfw5NeMKZJSYDa0lKdOcy0g+JT/f5mPSulUgg==", + "dev": true, + "requires": { + "@babel/helper-member-expression-to-functions": "^7.7.0", + "@babel/helper-optimise-call-expression": "^7.7.0", + "@babel/traverse": "^7.7.0", + "@babel/types": "^7.7.0" + }, + "dependencies": { + "@babel/types": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.2.tgz", + "integrity": "sha512-YTf6PXoh3+eZgRCBzzP25Bugd2ngmpQVrk7kXX0i5N9BO7TFBtIgZYs7WtxtOGs8e6A4ZI7ECkbBCEHeXocvOA==", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + } } }, "@babel/helper-split-export-declaration": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.4.4.tgz", - "integrity": "sha512-Ro/XkzLf3JFITkW6b+hNxzZ1n5OQ80NvIUdmHspih1XAhtN3vPTuUFT4eQnela+2MaZ5ulH+iyP513KJrxbN7Q==", - "dev": true, - "requires": { - "@babel/types": "^7.4.4" + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.7.0.tgz", + "integrity": "sha512-HgYSI8rH08neWlAH3CcdkFg9qX9YsZysZI5GD8LjhQib/mM0jGOZOVkoUiiV2Hu978fRtjtsGsW6w0pKHUWtqA==", + "dev": true, + "requires": { + "@babel/types": "^7.7.0" + }, + "dependencies": { + "@babel/types": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.2.tgz", + "integrity": "sha512-YTf6PXoh3+eZgRCBzzP25Bugd2ngmpQVrk7kXX0i5N9BO7TFBtIgZYs7WtxtOGs8e6A4ZI7ECkbBCEHeXocvOA==", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + } } }, "@babel/helpers": { - "version": "7.6.2", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.6.2.tgz", - "integrity": "sha512-3/bAUL8zZxYs1cdX2ilEE0WobqbCmKWr/889lf2SS0PpDcpEIY8pb1CCyz0pEcX3pEb+MCbks1jIokz2xLtGTA==", - "dev": true, - "requires": { - "@babel/template": "^7.6.0", - "@babel/traverse": "^7.6.2", - "@babel/types": "^7.6.0" + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.7.0.tgz", + "integrity": "sha512-VnNwL4YOhbejHb7x/b5F39Zdg5vIQpUUNzJwx0ww1EcVRt41bbGRZWhAURrfY32T5zTT3qwNOQFWpn+P0i0a2g==", + "dev": true, + "requires": { + "@babel/template": "^7.7.0", + "@babel/traverse": "^7.7.0", + "@babel/types": "^7.7.0" + }, + "dependencies": { + "@babel/types": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.2.tgz", + "integrity": "sha512-YTf6PXoh3+eZgRCBzzP25Bugd2ngmpQVrk7kXX0i5N9BO7TFBtIgZYs7WtxtOGs8e6A4ZI7ECkbBCEHeXocvOA==", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + } } }, "@babel/highlight": { @@ -158,9 +275,9 @@ } }, "@babel/parser": { - "version": "7.6.4", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.6.4.tgz", - "integrity": "sha512-D8RHPW5qd0Vbyo3qb+YjO5nvUVRTXFLQ/FsDxJU2Nqz4uB5EnUN0ZQSEYpvTIbRuttig1XbHWU5oMeQwQSAA+A==", + "version": "7.7.3", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.7.3.tgz", + "integrity": "sha512-bqv+iCo9i+uLVbI0ILzKkvMorqxouI+GbV13ivcARXn9NNEabi2IEz912IgNpT/60BNXac5dgcfjb94NjsF33A==", "dev": true }, "@babel/plugin-syntax-typescript": { @@ -173,52 +290,78 @@ } }, "@babel/plugin-transform-typescript": { - "version": "7.6.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.6.3.tgz", - "integrity": "sha512-aiWINBrPMSC3xTXRNM/dfmyYuPNKY/aexYqBgh0HBI5Y+WO5oRAqW/oROYeYHrF4Zw12r9rK4fMk/ZlAmqx/FQ==", + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.7.2.tgz", + "integrity": "sha512-UWhDaJRqdPUtdK1s0sKYdoRuqK0NepjZto2UZltvuCgMoMZmdjhgz5hcRokie/3aYEaSz3xvusyoayVaq4PjRg==", "dev": true, "requires": { - "@babel/helper-create-class-features-plugin": "^7.6.0", + "@babel/helper-create-class-features-plugin": "^7.7.0", "@babel/helper-plugin-utils": "^7.0.0", "@babel/plugin-syntax-typescript": "^7.2.0" } }, "@babel/preset-typescript": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.6.0.tgz", - "integrity": "sha512-4xKw3tTcCm0qApyT6PqM9qniseCE79xGHiUnNdKGdxNsGUc2X7WwZybqIpnTmoukg3nhPceI5KPNzNqLNeIJww==", + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.7.2.tgz", + "integrity": "sha512-1B4HthAelaLGfNRyrWqJtBEjXX1ulThCrLQ5B2VOtEAznWFIFXFJahgXImqppy66lx/Oh+cOSCQdJzZqh2Jh5g==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-transform-typescript": "^7.6.0" + "@babel/plugin-transform-typescript": "^7.7.2" } }, "@babel/template": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.6.0.tgz", - "integrity": "sha512-5AEH2EXD8euCk446b7edmgFdub/qfH1SN6Nii3+fyXP807QRx9Q73A2N5hNwRRslC2H9sNzaFhsPubkS4L8oNQ==", + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.7.0.tgz", + "integrity": "sha512-OKcwSYOW1mhWbnTBgQY5lvg1Fxg+VyfQGjcBduZFljfc044J5iDlnDSfhQ867O17XHiSCxYHUxHg2b7ryitbUQ==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", - "@babel/parser": "^7.6.0", - "@babel/types": "^7.6.0" + "@babel/parser": "^7.7.0", + "@babel/types": "^7.7.0" + }, + "dependencies": { + "@babel/types": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.2.tgz", + "integrity": "sha512-YTf6PXoh3+eZgRCBzzP25Bugd2ngmpQVrk7kXX0i5N9BO7TFBtIgZYs7WtxtOGs8e6A4ZI7ECkbBCEHeXocvOA==", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + } } }, "@babel/traverse": { - "version": "7.6.3", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.6.3.tgz", - "integrity": "sha512-unn7P4LGsijIxaAJo/wpoU11zN+2IaClkQAxcJWBNCMS6cmVh802IyLHNkAjQ0iYnRS3nnxk5O3fuXW28IMxTw==", + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.7.2.tgz", + "integrity": "sha512-TM01cXib2+rgIZrGJOLaHV/iZUAxf4A0dt5auY6KNZ+cm6aschuJGqKJM3ROTt3raPUdIDk9siAufIFEleRwtw==", "dev": true, "requires": { "@babel/code-frame": "^7.5.5", - "@babel/generator": "^7.6.3", - "@babel/helper-function-name": "^7.1.0", - "@babel/helper-split-export-declaration": "^7.4.4", - "@babel/parser": "^7.6.3", - "@babel/types": "^7.6.3", + "@babel/generator": "^7.7.2", + "@babel/helper-function-name": "^7.7.0", + "@babel/helper-split-export-declaration": "^7.7.0", + "@babel/parser": "^7.7.2", + "@babel/types": "^7.7.2", "debug": "^4.1.0", "globals": "^11.1.0", "lodash": "^4.17.13" + }, + "dependencies": { + "@babel/types": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.2.tgz", + "integrity": "sha512-YTf6PXoh3+eZgRCBzzP25Bugd2ngmpQVrk7kXX0i5N9BO7TFBtIgZYs7WtxtOGs8e6A4ZI7ECkbBCEHeXocvOA==", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + } } }, "@babel/types": { @@ -301,9 +444,9 @@ "dev": true }, "convert-source-map": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.6.0.tgz", - "integrity": "sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A==", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", + "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", "dev": true, "requires": { "safe-buffer": "~5.1.1" @@ -319,9 +462,9 @@ } }, "dom-expressions": { - "version": "0.14.1", - "resolved": "https://registry.npmjs.org/dom-expressions/-/dom-expressions-0.14.1.tgz", - "integrity": "sha512-a2gO6pX2dDhA5qFKXuFg5P0JiNdxSvHdAFwKfm+qy8JjX6nQtHyRVoSk/7/K8VtIFqZ+YE3JyOQZxmF2Ld8qXA==", + "version": "0.14.3", + "resolved": "https://registry.npmjs.org/dom-expressions/-/dom-expressions-0.14.3.tgz", + "integrity": "sha512-Li/hR4cjRXoLdMKZT177JYr0YOXskGnN71uWADako3QFvYpcZkBphhWnd8KaXLXOBpwb1HQU/jpoT4xtyn2O8Q==", "dev": true, "requires": { "ejs": "^2.7.1" @@ -442,9 +585,9 @@ } }, "rollup": { - "version": "1.24.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-1.24.0.tgz", - "integrity": "sha512-PiFETY/rPwodQ8TTC52Nz2DSCYUATznGh/ChnxActCr8rV5FIk3afBUb3uxNritQW/Jpbdn3kq1Rwh1HHYMwdQ==", + "version": "1.26.5", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-1.26.5.tgz", + "integrity": "sha512-c6Pv0yWzjYNpy2DIhLFUnyP6e1UTGownr4IfpJcPY/k186RJjpaGGPRwKQ62KCauctG6dgtHt88pw1EGrPRkuA==", "dev": true, "requires": { "@types/estree": "*", diff --git a/package.json b/package.json index e5591a6..150311e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "mobx-jsx", "description": "Raw MobX performance without the restraints of a Virtual DOM", - "version": "0.8.1", + "version": "0.8.2", "author": "Ryan Carniato", "license": "MIT", "repository": { @@ -16,13 +16,13 @@ "prepublishOnly": "npm run build" }, "devDependencies": { - "@babel/core": "7.6.4", - "@babel/preset-typescript": "7.6.0", - "dom-expressions": "0.14.1", + "@babel/core": "7.7.2", + "@babel/preset-typescript": "7.7.2", + "dom-expressions": "0.14.3", "hyper-dom-expressions": "0.14.1", "lit-dom-expressions": "0.14.1", "mobx": "^5.14.0", - "rollup": "^1.24.0", + "rollup": "^1.26.5", "rollup-plugin-babel": "4.3.3", "rollup-plugin-node-resolve": "5.2.0", "typescript": "3.7.2" diff --git a/src/core.ts b/src/core.ts index bda10c0..56071c7 100644 --- a/src/core.ts +++ b/src/core.ts @@ -103,7 +103,8 @@ function lookup(owner: ContextOwner | null, key: symbol | string): any { function resolveChildren(children: any): any { if (typeof children === "function") { - const c = computed(children); + const c = observable.box(); + effect(() => c.set(children())); return () => c.get(); } if (Array.isArray(children)) { @@ -121,12 +122,12 @@ function resolveChildren(children: any): any { function createProvider(id: symbol) { return function provider(props: { value: unknown; children: any }) { - let rendered; + let rendered = observable.box(); effect(() => { globalContext!.context = { [id]: props.value }; - rendered = untracked(() => resolveChildren(props.children)); + rendered.set(untracked(() => resolveChildren(props.children))); }); - return rendered; + return () => rendered.get(); }; } diff --git a/src/runtime.d.ts b/src/runtime.d.ts index 7e148a6..caecc2d 100644 --- a/src/runtime.d.ts +++ b/src/runtime.d.ts @@ -1,5 +1,6 @@ export function template(html: string, isSVG?: boolean): Element; export function wrap(fn: (prev?: T) => T): any; +export function wrapCondition(fn: () => boolean): () => boolean; export function insert( parent: Element | Document | ShadowRoot | DocumentFragment, accessor: any, diff --git a/src/runtime.js b/src/runtime.js index dc0d92e..b7ef0a3 100644 --- a/src/runtime.js +++ b/src/runtime.js @@ -249,6 +249,7 @@ function checkDynamicArray(array) { } function insertExpression(parent, value, current, marker) { + if (typeof current === "function") current = current(); if (value === current) return current; const t = typeof value, multi = marker !== undefined; @@ -271,6 +272,7 @@ function insertExpression(parent, value, current, marker) { current = cleanChildren(parent, current, marker); } else if (t === 'function') { wrap(() => current = insertExpression(parent, value(), current, marker)); + return () => current; } else if (Array.isArray(value)) { const array = normalizeIncomingArray([], value); if (array.length === 0) { From e389004667464363667a771e4ba1f9ff20e97184 Mon Sep 17 00:00:00 2001 From: Ryan Carniato Date: Mon, 23 Dec 2019 09:42:19 -0800 Subject: [PATCH 06/38] Set this.props on class components and pass props to render --- package-lock.json | 250 +++++++++++++++++++++++----------------------- package.json | 8 +- src/core.ts | 7 +- src/runtime.d.ts | 6 +- src/runtime.js | 92 ++++++++++------- 5 files changed, 195 insertions(+), 168 deletions(-) diff --git a/package-lock.json b/package-lock.json index a712664..ee0e260 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "mobx-jsx", - "version": "0.8.2", + "version": "0.8.3", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -14,18 +14,18 @@ } }, "@babel/core": { - "version": "7.7.2", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.7.2.tgz", - "integrity": "sha512-eeD7VEZKfhK1KUXGiyPFettgF3m513f8FoBSWiQ1xTvl1RAopLs42Wp9+Ze911I6H0N9lNqJMDgoZT7gHsipeQ==", + "version": "7.7.7", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.7.7.tgz", + "integrity": "sha512-jlSjuj/7z138NLZALxVgrx13AOtqip42ATZP7+kYl53GvDV6+4dCek1mVUo8z8c8Xnw/mx2q3d9HWh3griuesQ==", "dev": true, "requires": { "@babel/code-frame": "^7.5.5", - "@babel/generator": "^7.7.2", - "@babel/helpers": "^7.7.0", - "@babel/parser": "^7.7.2", - "@babel/template": "^7.7.0", - "@babel/traverse": "^7.7.2", - "@babel/types": "^7.7.2", + "@babel/generator": "^7.7.7", + "@babel/helpers": "^7.7.4", + "@babel/parser": "^7.7.7", + "@babel/template": "^7.7.4", + "@babel/traverse": "^7.7.4", + "@babel/types": "^7.7.4", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "json5": "^2.1.0", @@ -36,9 +36,9 @@ }, "dependencies": { "@babel/types": { - "version": "7.7.2", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.2.tgz", - "integrity": "sha512-YTf6PXoh3+eZgRCBzzP25Bugd2ngmpQVrk7kXX0i5N9BO7TFBtIgZYs7WtxtOGs8e6A4ZI7ECkbBCEHeXocvOA==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.4.tgz", + "integrity": "sha512-cz5Ji23KCi4T+YIE/BolWosrJuSmoZeN1EFnRtBwF+KKLi8GG/Z2c2hOJJeCXPk4mwk4QFvTmwIodJowXgttRA==", "dev": true, "requires": { "esutils": "^2.0.2", @@ -49,21 +49,21 @@ } }, "@babel/generator": { - "version": "7.7.2", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.7.2.tgz", - "integrity": "sha512-WthSArvAjYLz4TcbKOi88me+KmDJdKSlfwwN8CnUYn9jBkzhq0ZEPuBfkAWIvjJ3AdEV1Cf/+eSQTnp3IDJKlQ==", + "version": "7.7.7", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.7.7.tgz", + "integrity": "sha512-/AOIBpHh/JU1l0ZFS4kiRCBnLi6OTHzh0RPk3h9isBxkkqELtQNFi1Vr/tiG9p1yfoUdKVwISuXWQR+hwwM4VQ==", "dev": true, "requires": { - "@babel/types": "^7.7.2", + "@babel/types": "^7.7.4", "jsesc": "^2.5.1", "lodash": "^4.17.13", "source-map": "^0.5.0" }, "dependencies": { "@babel/types": { - "version": "7.7.2", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.2.tgz", - "integrity": "sha512-YTf6PXoh3+eZgRCBzzP25Bugd2ngmpQVrk7kXX0i5N9BO7TFBtIgZYs7WtxtOGs8e6A4ZI7ECkbBCEHeXocvOA==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.4.tgz", + "integrity": "sha512-cz5Ji23KCi4T+YIE/BolWosrJuSmoZeN1EFnRtBwF+KKLi8GG/Z2c2hOJJeCXPk4mwk4QFvTmwIodJowXgttRA==", "dev": true, "requires": { "esutils": "^2.0.2", @@ -74,34 +74,34 @@ } }, "@babel/helper-create-class-features-plugin": { - "version": "7.7.0", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.7.0.tgz", - "integrity": "sha512-MZiB5qvTWoyiFOgootmRSDV1udjIqJW/8lmxgzKq6oDqxdmHUjeP2ZUOmgHdYjmUVNABqRrHjYAYRvj8Eox/UA==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.7.4.tgz", + "integrity": "sha512-l+OnKACG4uiDHQ/aJT8dwpR+LhCJALxL0mJ6nzjB25e5IPwqV1VOsY7ah6UB1DG+VOXAIMtuC54rFJGiHkxjgA==", "dev": true, "requires": { - "@babel/helper-function-name": "^7.7.0", - "@babel/helper-member-expression-to-functions": "^7.7.0", - "@babel/helper-optimise-call-expression": "^7.7.0", + "@babel/helper-function-name": "^7.7.4", + "@babel/helper-member-expression-to-functions": "^7.7.4", + "@babel/helper-optimise-call-expression": "^7.7.4", "@babel/helper-plugin-utils": "^7.0.0", - "@babel/helper-replace-supers": "^7.7.0", - "@babel/helper-split-export-declaration": "^7.7.0" + "@babel/helper-replace-supers": "^7.7.4", + "@babel/helper-split-export-declaration": "^7.7.4" } }, "@babel/helper-function-name": { - "version": "7.7.0", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.7.0.tgz", - "integrity": "sha512-tDsJgMUAP00Ugv8O2aGEua5I2apkaQO7lBGUq1ocwN3G23JE5Dcq0uh3GvFTChPa4b40AWiAsLvCZOA2rdnQ7Q==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.7.4.tgz", + "integrity": "sha512-AnkGIdiBhEuiwdoMnKm7jfPfqItZhgRaZfMg1XX3bS25INOnLPjPG1Ppnajh8eqgt5kPJnfqrRHqFqmjKDZLzQ==", "dev": true, "requires": { - "@babel/helper-get-function-arity": "^7.7.0", - "@babel/template": "^7.7.0", - "@babel/types": "^7.7.0" + "@babel/helper-get-function-arity": "^7.7.4", + "@babel/template": "^7.7.4", + "@babel/types": "^7.7.4" }, "dependencies": { "@babel/types": { - "version": "7.7.2", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.2.tgz", - "integrity": "sha512-YTf6PXoh3+eZgRCBzzP25Bugd2ngmpQVrk7kXX0i5N9BO7TFBtIgZYs7WtxtOGs8e6A4ZI7ECkbBCEHeXocvOA==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.4.tgz", + "integrity": "sha512-cz5Ji23KCi4T+YIE/BolWosrJuSmoZeN1EFnRtBwF+KKLi8GG/Z2c2hOJJeCXPk4mwk4QFvTmwIodJowXgttRA==", "dev": true, "requires": { "esutils": "^2.0.2", @@ -112,18 +112,18 @@ } }, "@babel/helper-get-function-arity": { - "version": "7.7.0", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.7.0.tgz", - "integrity": "sha512-tLdojOTz4vWcEnHWHCuPN5P85JLZWbm5Fx5ZsMEMPhF3Uoe3O7awrbM2nQ04bDOUToH/2tH/ezKEOR8zEYzqyw==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.7.4.tgz", + "integrity": "sha512-QTGKEdCkjgzgfJ3bAyRwF4yyT3pg+vDgan8DSivq1eS0gwi+KGKE5x8kRcbeFTb/673mkO5SN1IZfmCfA5o+EA==", "dev": true, "requires": { - "@babel/types": "^7.7.0" + "@babel/types": "^7.7.4" }, "dependencies": { "@babel/types": { - "version": "7.7.2", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.2.tgz", - "integrity": "sha512-YTf6PXoh3+eZgRCBzzP25Bugd2ngmpQVrk7kXX0i5N9BO7TFBtIgZYs7WtxtOGs8e6A4ZI7ECkbBCEHeXocvOA==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.4.tgz", + "integrity": "sha512-cz5Ji23KCi4T+YIE/BolWosrJuSmoZeN1EFnRtBwF+KKLi8GG/Z2c2hOJJeCXPk4mwk4QFvTmwIodJowXgttRA==", "dev": true, "requires": { "esutils": "^2.0.2", @@ -134,18 +134,18 @@ } }, "@babel/helper-member-expression-to-functions": { - "version": "7.7.0", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.7.0.tgz", - "integrity": "sha512-QaCZLO2RtBcmvO/ekOLp8p7R5X2JriKRizeDpm5ChATAFWrrYDcDxPuCIBXKyBjY+i1vYSdcUTMIb8psfxHDPA==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.7.4.tgz", + "integrity": "sha512-9KcA1X2E3OjXl/ykfMMInBK+uVdfIVakVe7W7Lg3wfXUNyS3Q1HWLFRwZIjhqiCGbslummPDnmb7vIekS0C1vw==", "dev": true, "requires": { - "@babel/types": "^7.7.0" + "@babel/types": "^7.7.4" }, "dependencies": { "@babel/types": { - "version": "7.7.2", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.2.tgz", - "integrity": "sha512-YTf6PXoh3+eZgRCBzzP25Bugd2ngmpQVrk7kXX0i5N9BO7TFBtIgZYs7WtxtOGs8e6A4ZI7ECkbBCEHeXocvOA==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.4.tgz", + "integrity": "sha512-cz5Ji23KCi4T+YIE/BolWosrJuSmoZeN1EFnRtBwF+KKLi8GG/Z2c2hOJJeCXPk4mwk4QFvTmwIodJowXgttRA==", "dev": true, "requires": { "esutils": "^2.0.2", @@ -165,18 +165,18 @@ } }, "@babel/helper-optimise-call-expression": { - "version": "7.7.0", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.7.0.tgz", - "integrity": "sha512-48TeqmbazjNU/65niiiJIJRc5JozB8acui1OS7bSd6PgxfuovWsvjfWSzlgx+gPFdVveNzUdpdIg5l56Pl5jqg==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.7.4.tgz", + "integrity": "sha512-VB7gWZ2fDkSuqW6b1AKXkJWO5NyNI3bFL/kK79/30moK57blr6NbH8xcl2XcKCwOmJosftWunZqfO84IGq3ZZg==", "dev": true, "requires": { - "@babel/types": "^7.7.0" + "@babel/types": "^7.7.4" }, "dependencies": { "@babel/types": { - "version": "7.7.2", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.2.tgz", - "integrity": "sha512-YTf6PXoh3+eZgRCBzzP25Bugd2ngmpQVrk7kXX0i5N9BO7TFBtIgZYs7WtxtOGs8e6A4ZI7ECkbBCEHeXocvOA==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.4.tgz", + "integrity": "sha512-cz5Ji23KCi4T+YIE/BolWosrJuSmoZeN1EFnRtBwF+KKLi8GG/Z2c2hOJJeCXPk4mwk4QFvTmwIodJowXgttRA==", "dev": true, "requires": { "esutils": "^2.0.2", @@ -193,21 +193,21 @@ "dev": true }, "@babel/helper-replace-supers": { - "version": "7.7.0", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.7.0.tgz", - "integrity": "sha512-5ALYEul5V8xNdxEeWvRsBzLMxQksT7MaStpxjJf9KsnLxpAKBtfw5NeMKZJSYDa0lKdOcy0g+JT/f5mPSulUgg==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.7.4.tgz", + "integrity": "sha512-pP0tfgg9hsZWo5ZboYGuBn/bbYT/hdLPVSS4NMmiRJdwWhP0IznPwN9AE1JwyGsjSPLC364I0Qh5p+EPkGPNpg==", "dev": true, "requires": { - "@babel/helper-member-expression-to-functions": "^7.7.0", - "@babel/helper-optimise-call-expression": "^7.7.0", - "@babel/traverse": "^7.7.0", - "@babel/types": "^7.7.0" + "@babel/helper-member-expression-to-functions": "^7.7.4", + "@babel/helper-optimise-call-expression": "^7.7.4", + "@babel/traverse": "^7.7.4", + "@babel/types": "^7.7.4" }, "dependencies": { "@babel/types": { - "version": "7.7.2", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.2.tgz", - "integrity": "sha512-YTf6PXoh3+eZgRCBzzP25Bugd2ngmpQVrk7kXX0i5N9BO7TFBtIgZYs7WtxtOGs8e6A4ZI7ECkbBCEHeXocvOA==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.4.tgz", + "integrity": "sha512-cz5Ji23KCi4T+YIE/BolWosrJuSmoZeN1EFnRtBwF+KKLi8GG/Z2c2hOJJeCXPk4mwk4QFvTmwIodJowXgttRA==", "dev": true, "requires": { "esutils": "^2.0.2", @@ -218,18 +218,18 @@ } }, "@babel/helper-split-export-declaration": { - "version": "7.7.0", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.7.0.tgz", - "integrity": "sha512-HgYSI8rH08neWlAH3CcdkFg9qX9YsZysZI5GD8LjhQib/mM0jGOZOVkoUiiV2Hu978fRtjtsGsW6w0pKHUWtqA==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.7.4.tgz", + "integrity": "sha512-guAg1SXFcVr04Guk9eq0S4/rWS++sbmyqosJzVs8+1fH5NI+ZcmkaSkc7dmtAFbHFva6yRJnjW3yAcGxjueDug==", "dev": true, "requires": { - "@babel/types": "^7.7.0" + "@babel/types": "^7.7.4" }, "dependencies": { "@babel/types": { - "version": "7.7.2", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.2.tgz", - "integrity": "sha512-YTf6PXoh3+eZgRCBzzP25Bugd2ngmpQVrk7kXX0i5N9BO7TFBtIgZYs7WtxtOGs8e6A4ZI7ECkbBCEHeXocvOA==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.4.tgz", + "integrity": "sha512-cz5Ji23KCi4T+YIE/BolWosrJuSmoZeN1EFnRtBwF+KKLi8GG/Z2c2hOJJeCXPk4mwk4QFvTmwIodJowXgttRA==", "dev": true, "requires": { "esutils": "^2.0.2", @@ -240,20 +240,20 @@ } }, "@babel/helpers": { - "version": "7.7.0", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.7.0.tgz", - "integrity": "sha512-VnNwL4YOhbejHb7x/b5F39Zdg5vIQpUUNzJwx0ww1EcVRt41bbGRZWhAURrfY32T5zTT3qwNOQFWpn+P0i0a2g==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.7.4.tgz", + "integrity": "sha512-ak5NGZGJ6LV85Q1Zc9gn2n+ayXOizryhjSUBTdu5ih1tlVCJeuQENzc4ItyCVhINVXvIT/ZQ4mheGIsfBkpskg==", "dev": true, "requires": { - "@babel/template": "^7.7.0", - "@babel/traverse": "^7.7.0", - "@babel/types": "^7.7.0" + "@babel/template": "^7.7.4", + "@babel/traverse": "^7.7.4", + "@babel/types": "^7.7.4" }, "dependencies": { "@babel/types": { - "version": "7.7.2", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.2.tgz", - "integrity": "sha512-YTf6PXoh3+eZgRCBzzP25Bugd2ngmpQVrk7kXX0i5N9BO7TFBtIgZYs7WtxtOGs8e6A4ZI7ECkbBCEHeXocvOA==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.4.tgz", + "integrity": "sha512-cz5Ji23KCi4T+YIE/BolWosrJuSmoZeN1EFnRtBwF+KKLi8GG/Z2c2hOJJeCXPk4mwk4QFvTmwIodJowXgttRA==", "dev": true, "requires": { "esutils": "^2.0.2", @@ -275,56 +275,56 @@ } }, "@babel/parser": { - "version": "7.7.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.7.3.tgz", - "integrity": "sha512-bqv+iCo9i+uLVbI0ILzKkvMorqxouI+GbV13ivcARXn9NNEabi2IEz912IgNpT/60BNXac5dgcfjb94NjsF33A==", + "version": "7.7.7", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.7.7.tgz", + "integrity": "sha512-WtTZMZAZLbeymhkd/sEaPD8IQyGAhmuTuvTzLiCFM7iXiVdY0gc0IaI+cW0fh1BnSMbJSzXX6/fHllgHKwHhXw==", "dev": true }, "@babel/plugin-syntax-typescript": { - "version": "7.3.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.3.3.tgz", - "integrity": "sha512-dGwbSMA1YhVS8+31CnPR7LB4pcbrzcV99wQzby4uAfrkZPYZlQ7ImwdpzLqi6Z6IL02b8IAL379CaMwo0x5Lag==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.7.4.tgz", + "integrity": "sha512-77blgY18Hud4NM1ggTA8xVT/dBENQf17OpiToSa2jSmEY3fWXD2jwrdVlO4kq5yzUTeF15WSQ6b4fByNvJcjpQ==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.0.0" } }, "@babel/plugin-transform-typescript": { - "version": "7.7.2", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.7.2.tgz", - "integrity": "sha512-UWhDaJRqdPUtdK1s0sKYdoRuqK0NepjZto2UZltvuCgMoMZmdjhgz5hcRokie/3aYEaSz3xvusyoayVaq4PjRg==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.7.4.tgz", + "integrity": "sha512-X8e3tcPEKnwwPVG+vP/vSqEShkwODOEeyQGod82qrIuidwIrfnsGn11qPM1jBLF4MqguTXXYzm58d0dY+/wdpg==", "dev": true, "requires": { - "@babel/helper-create-class-features-plugin": "^7.7.0", + "@babel/helper-create-class-features-plugin": "^7.7.4", "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-typescript": "^7.2.0" + "@babel/plugin-syntax-typescript": "^7.7.4" } }, "@babel/preset-typescript": { - "version": "7.7.2", - "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.7.2.tgz", - "integrity": "sha512-1B4HthAelaLGfNRyrWqJtBEjXX1ulThCrLQ5B2VOtEAznWFIFXFJahgXImqppy66lx/Oh+cOSCQdJzZqh2Jh5g==", + "version": "7.7.7", + "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.7.7.tgz", + "integrity": "sha512-Apg0sCTovsSA+pEaI8efnA44b9x4X/7z4P8vsWMiN8rSUaM4y4+Shl5NMWnMl6njvt96+CEb6jwpXAKYAVCSQA==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-transform-typescript": "^7.7.2" + "@babel/plugin-transform-typescript": "^7.7.4" } }, "@babel/template": { - "version": "7.7.0", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.7.0.tgz", - "integrity": "sha512-OKcwSYOW1mhWbnTBgQY5lvg1Fxg+VyfQGjcBduZFljfc044J5iDlnDSfhQ867O17XHiSCxYHUxHg2b7ryitbUQ==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.7.4.tgz", + "integrity": "sha512-qUzihgVPguAzXCK7WXw8pqs6cEwi54s3E+HrejlkuWO6ivMKx9hZl3Y2fSXp9i5HgyWmj7RKP+ulaYnKM4yYxw==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", - "@babel/parser": "^7.7.0", - "@babel/types": "^7.7.0" + "@babel/parser": "^7.7.4", + "@babel/types": "^7.7.4" }, "dependencies": { "@babel/types": { - "version": "7.7.2", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.2.tgz", - "integrity": "sha512-YTf6PXoh3+eZgRCBzzP25Bugd2ngmpQVrk7kXX0i5N9BO7TFBtIgZYs7WtxtOGs8e6A4ZI7ECkbBCEHeXocvOA==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.4.tgz", + "integrity": "sha512-cz5Ji23KCi4T+YIE/BolWosrJuSmoZeN1EFnRtBwF+KKLi8GG/Z2c2hOJJeCXPk4mwk4QFvTmwIodJowXgttRA==", "dev": true, "requires": { "esutils": "^2.0.2", @@ -335,26 +335,26 @@ } }, "@babel/traverse": { - "version": "7.7.2", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.7.2.tgz", - "integrity": "sha512-TM01cXib2+rgIZrGJOLaHV/iZUAxf4A0dt5auY6KNZ+cm6aschuJGqKJM3ROTt3raPUdIDk9siAufIFEleRwtw==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.7.4.tgz", + "integrity": "sha512-P1L58hQyupn8+ezVA2z5KBm4/Zr4lCC8dwKCMYzsa5jFMDMQAzaBNy9W5VjB+KAmBjb40U7a/H6ao+Xo+9saIw==", "dev": true, "requires": { "@babel/code-frame": "^7.5.5", - "@babel/generator": "^7.7.2", - "@babel/helper-function-name": "^7.7.0", - "@babel/helper-split-export-declaration": "^7.7.0", - "@babel/parser": "^7.7.2", - "@babel/types": "^7.7.2", + "@babel/generator": "^7.7.4", + "@babel/helper-function-name": "^7.7.4", + "@babel/helper-split-export-declaration": "^7.7.4", + "@babel/parser": "^7.7.4", + "@babel/types": "^7.7.4", "debug": "^4.1.0", "globals": "^11.1.0", "lodash": "^4.17.13" }, "dependencies": { "@babel/types": { - "version": "7.7.2", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.2.tgz", - "integrity": "sha512-YTf6PXoh3+eZgRCBzzP25Bugd2ngmpQVrk7kXX0i5N9BO7TFBtIgZYs7WtxtOGs8e6A4ZI7ECkbBCEHeXocvOA==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.4.tgz", + "integrity": "sha512-cz5Ji23KCi4T+YIE/BolWosrJuSmoZeN1EFnRtBwF+KKLi8GG/Z2c2hOJJeCXPk4mwk4QFvTmwIodJowXgttRA==", "dev": true, "requires": { "esutils": "^2.0.2", @@ -462,18 +462,18 @@ } }, "dom-expressions": { - "version": "0.14.3", - "resolved": "https://registry.npmjs.org/dom-expressions/-/dom-expressions-0.14.3.tgz", - "integrity": "sha512-Li/hR4cjRXoLdMKZT177JYr0YOXskGnN71uWADako3QFvYpcZkBphhWnd8KaXLXOBpwb1HQU/jpoT4xtyn2O8Q==", + "version": "0.14.7", + "resolved": "https://registry.npmjs.org/dom-expressions/-/dom-expressions-0.14.7.tgz", + "integrity": "sha512-dqKxyZ2jA/WLZlNKihW8XZKEz4JQRGRhdneHGXZIYFfp1SVGi6/S4rV4i+/ZMxSX8X8KE9EPGtC2xzL/h3LvXQ==", "dev": true, "requires": { - "ejs": "^2.7.1" + "ejs": "^3.0.1" } }, "ejs": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/ejs/-/ejs-2.7.1.tgz", - "integrity": "sha512-kS/gEPzZs3Y1rRsbGX4UOSjtP/CeJP0CxSNZHYxGfVM/VgLcv0ZqM7C45YyTj2DI2g7+P9Dd24C+IMIg6D0nYQ==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.0.1.tgz", + "integrity": "sha512-cuIMtJwxvzumSAkqaaoGY/L6Fc/t6YvoP9/VIaK0V/CyqKLEQ8sqODmYfy/cjXEdZ9+OOL8TecbJu+1RsofGDw==", "dev": true }, "escape-string-regexp": { diff --git a/package.json b/package.json index 150311e..fc9d56e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "mobx-jsx", "description": "Raw MobX performance without the restraints of a Virtual DOM", - "version": "0.8.2", + "version": "0.8.3", "author": "Ryan Carniato", "license": "MIT", "repository": { @@ -16,9 +16,9 @@ "prepublishOnly": "npm run build" }, "devDependencies": { - "@babel/core": "7.7.2", - "@babel/preset-typescript": "7.7.2", - "dom-expressions": "0.14.3", + "@babel/core": "7.7.7", + "@babel/preset-typescript": "7.7.7", + "dom-expressions": "0.14.7", "hyper-dom-expressions": "0.14.1", "lit-dom-expressions": "0.14.1", "mobx": "^5.14.0", diff --git a/src/core.ts b/src/core.ts index 56071c7..f7b2a24 100644 --- a/src/core.ts +++ b/src/core.ts @@ -13,8 +13,13 @@ export interface Context { let globalContext: ContextOwner | null = null; -export class Component { +export class Component { isClassComponent?: boolean; + props: T; + constructor(props: T) { + this.props = props; + } + render(props: T) { return props.children } } Component.prototype.isClassComponent = true; diff --git a/src/runtime.d.ts b/src/runtime.d.ts index caecc2d..278a94f 100644 --- a/src/runtime.d.ts +++ b/src/runtime.d.ts @@ -15,7 +15,11 @@ export function createComponent( export function delegateEvents(eventNames: string[]): void; export function clearDelegatedEvents(): void; export function spread(node: Element, accessor: any, isSVG: Boolean): void; -export function classList(node: Element, value: { [k: string]: boolean }): void; +export function classList( + node: Element, + value: { [k: string]: boolean }, + prev?: { [k: string]: boolean } +): void; export function currentContext(): any; export function isSSR(): boolean; export function startSSR(): void; diff --git a/src/runtime.js b/src/runtime.js index b7ef0a3..70f077f 100644 --- a/src/runtime.js +++ b/src/runtime.js @@ -25,7 +25,7 @@ export function createComponent(Comp, props, dynamicKeys) { if (Comp.prototype && Comp.prototype.isClassComponent) { return ignore(() => { const comp = new Comp(props); - return comp.render(); + return comp.render(props); }); } @@ -47,13 +47,15 @@ export function clearDelegatedEvents() { eventRegistry.clear(); } -export function classList(node, value) { +export function classList(node, value, prev) { const classKeys = Object.keys(value); - for (let i = 0; i < classKeys.length; i++) { + for (let i = 0, len = classKeys.length; i < len; i++) { const key = classKeys[i], + classValue = value[key], classNames = key.split(/\s+/); - for (let j = 0; j < classNames.length; j++) - node.classList.toggle(classNames[j], value[key]); + if (prev && prev[key] === classValue) continue; + for (let j = 0, nameLen = classNames.length; j < nameLen; j++) + node.classList.toggle(classNames[j], classValue); } } @@ -172,39 +174,55 @@ function eventHandler(e) { function spreadExpression(node, props, prevProps = {}, isSVG) { let info; - for (const prop in props) { - const value = props[prop]; - if (value === prevProps[prop]) continue; - if (prop === 'style') { - Object.assign(node.style, value); - } else if (prop === 'classList') { - classList(node, value); - // really only for forwarding from Components, can't forward normal ref - } else if (prop === 'ref' || prop === 'forwardRef') { - value(node); - } else if (prop.slice(0, 2) === 'on') { - const lc = prop.toLowerCase(); - if (lc !== prop && !NonComposedEvents.has(lc.slice(2))) { - const name = lc.slice(2); - node[`__${name}`] = value; - delegateEvents([name]); - } else node[lc] = value; - } else if (prop === 'events') { - for (const eventName in value) node.addEventListener(eventName, value[eventName]); - } else if (prop === 'children') { - insertExpression(node, value, prevProps[prop]); - } else if (info = Attributes[prop]) { - if (info.type === 'attribute') { - node.setAttribute(prop, value); - } else node[info.alias] = value; - } else if (isSVG) { - if (info = SVGAttributes[prop]) { - if (info.alias) node.setAttribute(info.alias, value); - else node.setAttribute(prop, value); - } else node.setAttribute(prop.replace(/([A-Z])/g, g => `-${g[0].toLowerCase()}`), value); - } else node[prop] = value; + if ("children" in props) { + wrap(() => + (prevProps.children = insertExpression( + node, + props.children, + prevProps.children + )) + ); } - return Object.assign({}, props); + wrap(() => { + for (const prop in props) { + if (prop === "children") continue; + const value = props[prop]; + if (value === prevProps[prop]) continue; + if (prop === "style") { + Object.assign(node.style, value); + } else if (prop === "classList") { + classList(node, value, prevProps[prop]); + // really only for forwarding from Components, can't forward normal ref + } else if (prop === "ref" || prop === "forwardRef") { + value(node); + } else if (prop.slice(0, 2) === "on") { + const lc = prop.toLowerCase(); + if (lc !== prop && !NonComposedEvents.has(lc.slice(2))) { + const name = lc.slice(2); + node[`__${name}`] = value; + delegateEvents([name]); + } else node[lc] = value; + } else if (prop === "events") { + for (const eventName in value) + node.addEventListener(eventName, value[eventName]); + } else if ((info = Attributes[prop])) { + if (info.type === "attribute") { + node.setAttribute(prop, value); + } else node[info.alias] = value; + } else if (isSVG) { + if ((info = SVGAttributes[prop])) { + if (info.alias) node.setAttribute(info.alias, value); + else node.setAttribute(prop, value); + } else + node.setAttribute( + prop.replace(/([A-Z])/g, g => `-${g[0].toLowerCase()}`), + value + ); + } else node[prop] = value; + prevProps[prop] = value; + } + }); + return prevProps; } function normalizeIncomingArray(normalized, array) { From 03a09a8a9c05b4a44299f8640222946867dcf801 Mon Sep 17 00:00:00 2001 From: Ryan Carniato Date: Sat, 11 Jan 2020 22:40:36 -0800 Subject: [PATCH 07/38] Update for release --- package-lock.json | 470 +++++++++++++++++----------------------------- package.json | 21 ++- src/index.ts | 16 +- src/runtime.d.ts | 24 ++- src/runtime.js | 77 +++++--- 5 files changed, 255 insertions(+), 353 deletions(-) diff --git a/package-lock.json b/package-lock.json index ee0e260..2c649d3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,272 +1,156 @@ { "name": "mobx-jsx", - "version": "0.8.3", + "version": "0.9.0", "lockfileVersion": 1, "requires": true, "dependencies": { "@babel/code-frame": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz", - "integrity": "sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==", + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.0.tgz", + "integrity": "sha512-AN2IR/wCUYsM+PdErq6Bp3RFTXl8W0p9Nmymm7zkpsCmh+r/YYcckaCGpU8Q/mEKmST19kkGRaG42A/jxOWwBA==", "dev": true, "requires": { - "@babel/highlight": "^7.0.0" + "@babel/highlight": "^7.8.0" } }, "@babel/core": { - "version": "7.7.7", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.7.7.tgz", - "integrity": "sha512-jlSjuj/7z138NLZALxVgrx13AOtqip42ATZP7+kYl53GvDV6+4dCek1mVUo8z8c8Xnw/mx2q3d9HWh3griuesQ==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.5.5", - "@babel/generator": "^7.7.7", - "@babel/helpers": "^7.7.4", - "@babel/parser": "^7.7.7", - "@babel/template": "^7.7.4", - "@babel/traverse": "^7.7.4", - "@babel/types": "^7.7.4", + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.8.0.tgz", + "integrity": "sha512-3rqPi/bv/Xfu2YzHvBz4XqMI1fKVwnhntPA1/fjoECrSjrhbOCxlTrbVu5gUtr8zkxW+RpkDOa/HCW93gzS2Dw==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.8.0", + "@babel/generator": "^7.8.0", + "@babel/helpers": "^7.8.0", + "@babel/parser": "^7.8.0", + "@babel/template": "^7.8.0", + "@babel/traverse": "^7.8.0", + "@babel/types": "^7.8.0", "convert-source-map": "^1.7.0", "debug": "^4.1.0", + "gensync": "^1.0.0-beta.1", "json5": "^2.1.0", "lodash": "^4.17.13", "resolve": "^1.3.2", "semver": "^5.4.1", "source-map": "^0.5.0" - }, - "dependencies": { - "@babel/types": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.4.tgz", - "integrity": "sha512-cz5Ji23KCi4T+YIE/BolWosrJuSmoZeN1EFnRtBwF+KKLi8GG/Z2c2hOJJeCXPk4mwk4QFvTmwIodJowXgttRA==", - "dev": true, - "requires": { - "esutils": "^2.0.2", - "lodash": "^4.17.13", - "to-fast-properties": "^2.0.0" - } - } } }, "@babel/generator": { - "version": "7.7.7", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.7.7.tgz", - "integrity": "sha512-/AOIBpHh/JU1l0ZFS4kiRCBnLi6OTHzh0RPk3h9isBxkkqELtQNFi1Vr/tiG9p1yfoUdKVwISuXWQR+hwwM4VQ==", + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.8.0.tgz", + "integrity": "sha512-2Lp2e02CV2C7j/H4n4D9YvsvdhPVVg9GDIamr6Tu4tU35mL3mzOrzl1lZ8ZJtysfZXh+y+AGORc2rPS7yHxBUg==", "dev": true, "requires": { - "@babel/types": "^7.7.4", + "@babel/types": "^7.8.0", "jsesc": "^2.5.1", "lodash": "^4.17.13", "source-map": "^0.5.0" - }, - "dependencies": { - "@babel/types": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.4.tgz", - "integrity": "sha512-cz5Ji23KCi4T+YIE/BolWosrJuSmoZeN1EFnRtBwF+KKLi8GG/Z2c2hOJJeCXPk4mwk4QFvTmwIodJowXgttRA==", - "dev": true, - "requires": { - "esutils": "^2.0.2", - "lodash": "^4.17.13", - "to-fast-properties": "^2.0.0" - } - } } }, "@babel/helper-create-class-features-plugin": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.7.4.tgz", - "integrity": "sha512-l+OnKACG4uiDHQ/aJT8dwpR+LhCJALxL0mJ6nzjB25e5IPwqV1VOsY7ah6UB1DG+VOXAIMtuC54rFJGiHkxjgA==", + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.8.0.tgz", + "integrity": "sha512-ctCvqYBTlwEl2uF4hCxE0cd/sSw71Zfag0jKa39y4HDLh0BQ4PVBX1384Ye8GqrEZ69xgLp9fwPbv3GgIDDF2Q==", "dev": true, "requires": { - "@babel/helper-function-name": "^7.7.4", - "@babel/helper-member-expression-to-functions": "^7.7.4", - "@babel/helper-optimise-call-expression": "^7.7.4", - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/helper-replace-supers": "^7.7.4", - "@babel/helper-split-export-declaration": "^7.7.4" + "@babel/helper-function-name": "^7.8.0", + "@babel/helper-member-expression-to-functions": "^7.8.0", + "@babel/helper-optimise-call-expression": "^7.8.0", + "@babel/helper-plugin-utils": "^7.8.0", + "@babel/helper-replace-supers": "^7.8.0", + "@babel/helper-split-export-declaration": "^7.8.0" } }, "@babel/helper-function-name": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.7.4.tgz", - "integrity": "sha512-AnkGIdiBhEuiwdoMnKm7jfPfqItZhgRaZfMg1XX3bS25INOnLPjPG1Ppnajh8eqgt5kPJnfqrRHqFqmjKDZLzQ==", - "dev": true, - "requires": { - "@babel/helper-get-function-arity": "^7.7.4", - "@babel/template": "^7.7.4", - "@babel/types": "^7.7.4" - }, - "dependencies": { - "@babel/types": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.4.tgz", - "integrity": "sha512-cz5Ji23KCi4T+YIE/BolWosrJuSmoZeN1EFnRtBwF+KKLi8GG/Z2c2hOJJeCXPk4mwk4QFvTmwIodJowXgttRA==", - "dev": true, - "requires": { - "esutils": "^2.0.2", - "lodash": "^4.17.13", - "to-fast-properties": "^2.0.0" - } - } + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.8.0.tgz", + "integrity": "sha512-x9psucuU0Xalw+0Vpr2FYJMLB7/KnPSLZhlkUyOGbYAWRDfmtZBrguYpJYiaNCRV7vGkYjO/gF6/J6yMvdWTDw==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "^7.8.0", + "@babel/template": "^7.8.0", + "@babel/types": "^7.8.0" } }, "@babel/helper-get-function-arity": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.7.4.tgz", - "integrity": "sha512-QTGKEdCkjgzgfJ3bAyRwF4yyT3pg+vDgan8DSivq1eS0gwi+KGKE5x8kRcbeFTb/673mkO5SN1IZfmCfA5o+EA==", - "dev": true, - "requires": { - "@babel/types": "^7.7.4" - }, - "dependencies": { - "@babel/types": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.4.tgz", - "integrity": "sha512-cz5Ji23KCi4T+YIE/BolWosrJuSmoZeN1EFnRtBwF+KKLi8GG/Z2c2hOJJeCXPk4mwk4QFvTmwIodJowXgttRA==", - "dev": true, - "requires": { - "esutils": "^2.0.2", - "lodash": "^4.17.13", - "to-fast-properties": "^2.0.0" - } - } + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.8.0.tgz", + "integrity": "sha512-eUP5grliToMapQiTaYS2AAO/WwaCG7cuJztR1v/a1aPzUzUeGt+AaI9OvLATc/AfFkF8SLJ10d5ugGt/AQ9d6w==", + "dev": true, + "requires": { + "@babel/types": "^7.8.0" } }, "@babel/helper-member-expression-to-functions": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.7.4.tgz", - "integrity": "sha512-9KcA1X2E3OjXl/ykfMMInBK+uVdfIVakVe7W7Lg3wfXUNyS3Q1HWLFRwZIjhqiCGbslummPDnmb7vIekS0C1vw==", - "dev": true, - "requires": { - "@babel/types": "^7.7.4" - }, - "dependencies": { - "@babel/types": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.4.tgz", - "integrity": "sha512-cz5Ji23KCi4T+YIE/BolWosrJuSmoZeN1EFnRtBwF+KKLi8GG/Z2c2hOJJeCXPk4mwk4QFvTmwIodJowXgttRA==", - "dev": true, - "requires": { - "esutils": "^2.0.2", - "lodash": "^4.17.13", - "to-fast-properties": "^2.0.0" - } - } + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.8.0.tgz", + "integrity": "sha512-0m1QabGrdXuoxX/g+KOAGndoHwskC70WweqHRQyCsaO67KOEELYh4ECcGw6ZGKjDKa5Y7SW4Qbhw6ly4Fah/jQ==", + "dev": true, + "requires": { + "@babel/types": "^7.8.0" } }, "@babel/helper-module-imports": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.0.0.tgz", - "integrity": "sha512-aP/hlLq01DWNEiDg4Jn23i+CXxW/owM4WpDLFUbpjxe4NS3BhLVZQ5i7E0ZrxuQ/vwekIeciyamgB1UIYxxM6A==", + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.8.0.tgz", + "integrity": "sha512-ylY9J6ZxEcjmJaJ4P6aVs/fZdrZVctCGnxxfYXwCnSMapqd544zT8lWK2qI/vBPjE5gS0o2jILnH+AkpsPauEQ==", "dev": true, "requires": { - "@babel/types": "^7.0.0" + "@babel/types": "^7.8.0" } }, "@babel/helper-optimise-call-expression": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.7.4.tgz", - "integrity": "sha512-VB7gWZ2fDkSuqW6b1AKXkJWO5NyNI3bFL/kK79/30moK57blr6NbH8xcl2XcKCwOmJosftWunZqfO84IGq3ZZg==", - "dev": true, - "requires": { - "@babel/types": "^7.7.4" - }, - "dependencies": { - "@babel/types": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.4.tgz", - "integrity": "sha512-cz5Ji23KCi4T+YIE/BolWosrJuSmoZeN1EFnRtBwF+KKLi8GG/Z2c2hOJJeCXPk4mwk4QFvTmwIodJowXgttRA==", - "dev": true, - "requires": { - "esutils": "^2.0.2", - "lodash": "^4.17.13", - "to-fast-properties": "^2.0.0" - } - } + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.8.0.tgz", + "integrity": "sha512-aiJt1m+K57y0n10fTw+QXcCXzmpkG+o+NoQmAZqlZPstkTE0PZT+Z27QSd/6Gf00nuXJQO4NiJ0/YagSW5kC2A==", + "dev": true, + "requires": { + "@babel/types": "^7.8.0" } }, "@babel/helper-plugin-utils": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.0.0.tgz", - "integrity": "sha512-CYAOUCARwExnEixLdB6sDm2dIJ/YgEAKDM1MOeMeZu9Ld/bDgVo8aiWrXwcY7OBh+1Ea2uUcVRcxKk0GJvW7QA==", + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.0.tgz", + "integrity": "sha512-+hAlRGdf8fHQAyNnDBqTHQhwdLURLdrCROoWaEQYiQhk2sV9Rhs+GoFZZfMJExTq9HG8o2NX3uN2G90bFtmFdA==", "dev": true }, "@babel/helper-replace-supers": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.7.4.tgz", - "integrity": "sha512-pP0tfgg9hsZWo5ZboYGuBn/bbYT/hdLPVSS4NMmiRJdwWhP0IznPwN9AE1JwyGsjSPLC364I0Qh5p+EPkGPNpg==", - "dev": true, - "requires": { - "@babel/helper-member-expression-to-functions": "^7.7.4", - "@babel/helper-optimise-call-expression": "^7.7.4", - "@babel/traverse": "^7.7.4", - "@babel/types": "^7.7.4" - }, - "dependencies": { - "@babel/types": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.4.tgz", - "integrity": "sha512-cz5Ji23KCi4T+YIE/BolWosrJuSmoZeN1EFnRtBwF+KKLi8GG/Z2c2hOJJeCXPk4mwk4QFvTmwIodJowXgttRA==", - "dev": true, - "requires": { - "esutils": "^2.0.2", - "lodash": "^4.17.13", - "to-fast-properties": "^2.0.0" - } - } + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.8.0.tgz", + "integrity": "sha512-R2CyorW4tcO3YzdkClLpt6MS84G+tPkOi0MmiCn1bvYVnmDpdl9R15XOi3NQW2mhOAEeBnuQ4g1Bh7pT2sX8fg==", + "dev": true, + "requires": { + "@babel/helper-member-expression-to-functions": "^7.8.0", + "@babel/helper-optimise-call-expression": "^7.8.0", + "@babel/traverse": "^7.8.0", + "@babel/types": "^7.8.0" } }, "@babel/helper-split-export-declaration": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.7.4.tgz", - "integrity": "sha512-guAg1SXFcVr04Guk9eq0S4/rWS++sbmyqosJzVs8+1fH5NI+ZcmkaSkc7dmtAFbHFva6yRJnjW3yAcGxjueDug==", - "dev": true, - "requires": { - "@babel/types": "^7.7.4" - }, - "dependencies": { - "@babel/types": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.4.tgz", - "integrity": "sha512-cz5Ji23KCi4T+YIE/BolWosrJuSmoZeN1EFnRtBwF+KKLi8GG/Z2c2hOJJeCXPk4mwk4QFvTmwIodJowXgttRA==", - "dev": true, - "requires": { - "esutils": "^2.0.2", - "lodash": "^4.17.13", - "to-fast-properties": "^2.0.0" - } - } + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.8.0.tgz", + "integrity": "sha512-YhYFhH4T6DlbT6CPtVgLfC1Jp2gbCawU/ml7WJvUpBg01bCrXSzTYMZZXbbIGjq/kHmK8YUATxTppcRGzj31pA==", + "dev": true, + "requires": { + "@babel/types": "^7.8.0" } }, "@babel/helpers": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.7.4.tgz", - "integrity": "sha512-ak5NGZGJ6LV85Q1Zc9gn2n+ayXOizryhjSUBTdu5ih1tlVCJeuQENzc4ItyCVhINVXvIT/ZQ4mheGIsfBkpskg==", - "dev": true, - "requires": { - "@babel/template": "^7.7.4", - "@babel/traverse": "^7.7.4", - "@babel/types": "^7.7.4" - }, - "dependencies": { - "@babel/types": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.4.tgz", - "integrity": "sha512-cz5Ji23KCi4T+YIE/BolWosrJuSmoZeN1EFnRtBwF+KKLi8GG/Z2c2hOJJeCXPk4mwk4QFvTmwIodJowXgttRA==", - "dev": true, - "requires": { - "esutils": "^2.0.2", - "lodash": "^4.17.13", - "to-fast-properties": "^2.0.0" - } - } + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.8.0.tgz", + "integrity": "sha512-srWKpjAFbiut5JoCReZJ098hLqoZ9HufOnKZPggc7j74XaPuQ+9b3RYPV1M/HfjL63lCNd8uI1O487qIWxAFNA==", + "dev": true, + "requires": { + "@babel/template": "^7.8.0", + "@babel/traverse": "^7.8.0", + "@babel/types": "^7.8.0" } }, "@babel/highlight": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.5.0.tgz", - "integrity": "sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ==", + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.8.0.tgz", + "integrity": "sha512-OsdTJbHlPtIk2mmtwXItYrdmalJ8T0zpVzNAbKSkHshuywj7zb29Y09McV/jQsQunc/nEyHiPV2oy9llYMLqxw==", "dev": true, "requires": { "chalk": "^2.0.0", @@ -275,99 +159,73 @@ } }, "@babel/parser": { - "version": "7.7.7", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.7.7.tgz", - "integrity": "sha512-WtTZMZAZLbeymhkd/sEaPD8IQyGAhmuTuvTzLiCFM7iXiVdY0gc0IaI+cW0fh1BnSMbJSzXX6/fHllgHKwHhXw==", + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.8.0.tgz", + "integrity": "sha512-VVtsnUYbd1+2A2vOVhm4P2qNXQE8L/W859GpUHfUcdhX8d3pEKThZuIr6fztocWx9HbK+00/CR0tXnhAggJ4CA==", "dev": true }, "@babel/plugin-syntax-typescript": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.7.4.tgz", - "integrity": "sha512-77blgY18Hud4NM1ggTA8xVT/dBENQf17OpiToSa2jSmEY3fWXD2jwrdVlO4kq5yzUTeF15WSQ6b4fByNvJcjpQ==", + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.8.0.tgz", + "integrity": "sha512-LrvVrabb993Ve5fzXsyEkfYCuhpXBwsUFjlvgD8UmXXg3r/8/ceooSdRvjdmtPXXz+lHaqZHZooV1jMWer2qkA==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.0" } }, "@babel/plugin-transform-typescript": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.7.4.tgz", - "integrity": "sha512-X8e3tcPEKnwwPVG+vP/vSqEShkwODOEeyQGod82qrIuidwIrfnsGn11qPM1jBLF4MqguTXXYzm58d0dY+/wdpg==", + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.8.0.tgz", + "integrity": "sha512-RhMZnNWcyvX+rM6mk888MaeoVl5pGfmYP3as709n4+0d15SRedz4r+LPRg2a9s4z+t+DM+gy8uz/rmM3Cb8JBw==", "dev": true, "requires": { - "@babel/helper-create-class-features-plugin": "^7.7.4", - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-typescript": "^7.7.4" + "@babel/helper-create-class-features-plugin": "^7.8.0", + "@babel/helper-plugin-utils": "^7.8.0", + "@babel/plugin-syntax-typescript": "^7.8.0" } }, "@babel/preset-typescript": { - "version": "7.7.7", - "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.7.7.tgz", - "integrity": "sha512-Apg0sCTovsSA+pEaI8efnA44b9x4X/7z4P8vsWMiN8rSUaM4y4+Shl5NMWnMl6njvt96+CEb6jwpXAKYAVCSQA==", + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.8.0.tgz", + "integrity": "sha512-mvu4OmrLK6qRPiXlOkE4yOeOszHzk9itwe6aiMN0RL9Bc5uAwAotVTy4kKl17evLMd1WsvWT1O3mZltynuqxXg==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-transform-typescript": "^7.7.4" + "@babel/helper-plugin-utils": "^7.8.0", + "@babel/plugin-transform-typescript": "^7.8.0" } }, "@babel/template": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.7.4.tgz", - "integrity": "sha512-qUzihgVPguAzXCK7WXw8pqs6cEwi54s3E+HrejlkuWO6ivMKx9hZl3Y2fSXp9i5HgyWmj7RKP+ulaYnKM4yYxw==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.0.0", - "@babel/parser": "^7.7.4", - "@babel/types": "^7.7.4" - }, - "dependencies": { - "@babel/types": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.4.tgz", - "integrity": "sha512-cz5Ji23KCi4T+YIE/BolWosrJuSmoZeN1EFnRtBwF+KKLi8GG/Z2c2hOJJeCXPk4mwk4QFvTmwIodJowXgttRA==", - "dev": true, - "requires": { - "esutils": "^2.0.2", - "lodash": "^4.17.13", - "to-fast-properties": "^2.0.0" - } - } + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.8.0.tgz", + "integrity": "sha512-0NNMDsY2t3ltAVVK1WHNiaePo3tXPUeJpCX4I3xSKFoEl852wJHG8mrgHVADf8Lz1y+8al9cF7cSSfzSnFSYiw==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.8.0", + "@babel/parser": "^7.8.0", + "@babel/types": "^7.8.0" } }, "@babel/traverse": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.7.4.tgz", - "integrity": "sha512-P1L58hQyupn8+ezVA2z5KBm4/Zr4lCC8dwKCMYzsa5jFMDMQAzaBNy9W5VjB+KAmBjb40U7a/H6ao+Xo+9saIw==", + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.8.0.tgz", + "integrity": "sha512-d/6sPXFLGlJHZO/zWDtgFaKyalCOHLedzxpVJn6el1cw+f2TZa7xZEszeXdOw6EUemqRFBAn106BWBvtSck9Qw==", "dev": true, "requires": { - "@babel/code-frame": "^7.5.5", - "@babel/generator": "^7.7.4", - "@babel/helper-function-name": "^7.7.4", - "@babel/helper-split-export-declaration": "^7.7.4", - "@babel/parser": "^7.7.4", - "@babel/types": "^7.7.4", + "@babel/code-frame": "^7.8.0", + "@babel/generator": "^7.8.0", + "@babel/helper-function-name": "^7.8.0", + "@babel/helper-split-export-declaration": "^7.8.0", + "@babel/parser": "^7.8.0", + "@babel/types": "^7.8.0", "debug": "^4.1.0", "globals": "^11.1.0", "lodash": "^4.17.13" - }, - "dependencies": { - "@babel/types": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.4.tgz", - "integrity": "sha512-cz5Ji23KCi4T+YIE/BolWosrJuSmoZeN1EFnRtBwF+KKLi8GG/Z2c2hOJJeCXPk4mwk4QFvTmwIodJowXgttRA==", - "dev": true, - "requires": { - "esutils": "^2.0.2", - "lodash": "^4.17.13", - "to-fast-properties": "^2.0.0" - } - } } }, "@babel/types": { - "version": "7.6.3", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.6.3.tgz", - "integrity": "sha512-CqbcpTxMcpuQTMhjI37ZHVgjBkysg5icREQIEZ0eG1yCNwg3oy+5AaLiOKmjsCj6nqOsa6Hf0ObjRVwokb7srA==", + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.8.0.tgz", + "integrity": "sha512-1RF84ehyx9HH09dMMwGWl3UTWlVoCPtqqJPjGuC4JzMe1ZIVDJ2DT8mv3cPv/A7veLD6sgR7vi95lJqm+ZayIg==", "dev": true, "requires": { "esutils": "^2.0.2", @@ -376,15 +234,15 @@ } }, "@types/estree": { - "version": "0.0.39", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", - "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", + "version": "0.0.42", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.42.tgz", + "integrity": "sha512-K1DPVvnBCPxzD+G51/cxVIoc2X8uUVl1zpJeE6iKcgHMj4+tbat5Xu4TjV7v2QSDbIeAfLi2hIk+u2+s0MlpUQ==", "dev": true }, "@types/node": { - "version": "12.6.8", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.6.8.tgz", - "integrity": "sha512-aX+gFgA5GHcDi89KG5keey2zf0WfZk/HAQotEamsK2kbey+8yGKcson0hbK8E+v0NArlCJQCqMP161YhV6ZXLg==", + "version": "13.1.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-13.1.6.tgz", + "integrity": "sha512-Jg1F+bmxcpENHP23sVKkNuU3uaxPnsBMW0cLjleiikFKomJQbsn0Cqk2yDvQArqzZN6ABfBkZ0To7pQ8sLdWDg==", "dev": true }, "@types/resolve": { @@ -462,9 +320,9 @@ } }, "dom-expressions": { - "version": "0.14.7", - "resolved": "https://registry.npmjs.org/dom-expressions/-/dom-expressions-0.14.7.tgz", - "integrity": "sha512-dqKxyZ2jA/WLZlNKihW8XZKEz4JQRGRhdneHGXZIYFfp1SVGi6/S4rV4i+/ZMxSX8X8KE9EPGtC2xzL/h3LvXQ==", + "version": "0.15.0", + "resolved": "https://registry.npmjs.org/dom-expressions/-/dom-expressions-0.15.0.tgz", + "integrity": "sha512-cLdwLkjjsWsRB2Qh/OvKWFPKDnUiVP78QzD0DmY3+lvC0zGXhKNe2/cfCANzW3B5a2Xz9wK2r6ix29gXQOla7w==", "dev": true, "requires": { "ejs": "^3.0.1" @@ -494,6 +352,12 @@ "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "dev": true }, + "gensync": { + "version": "1.0.0-beta.1", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.1.tgz", + "integrity": "sha512-r8EC6NO1sngH/zdD9fiRDLdcgnbayXah+mLgManTaIZJqEC1MZstmnox8KpnI2/fxQwrp5OpCOYWLp4rBl4Jcg==", + "dev": true + }, "globals": { "version": "11.12.0", "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", @@ -507,9 +371,9 @@ "dev": true }, "hyper-dom-expressions": { - "version": "0.14.1", - "resolved": "https://registry.npmjs.org/hyper-dom-expressions/-/hyper-dom-expressions-0.14.1.tgz", - "integrity": "sha512-NdwKKR/Njdg1xAbfeqtwCTY7DxbLA92GPP9YlE+II4i0+9DeIsy8qchvHunO+Kv8SZb74/AGLovCFdSH+JeLHg==", + "version": "0.15.0", + "resolved": "https://registry.npmjs.org/hyper-dom-expressions/-/hyper-dom-expressions-0.15.0.tgz", + "integrity": "sha512-Ju5uNfMgx6yQLMaXcJl8qIcOaxbCFC9VZ7Y9E0D99/52QZPe+cPjthKmus9hocUp/2FYSzngE+xcw7hWgCgF/g==", "dev": true }, "is-module": { @@ -540,9 +404,9 @@ } }, "lit-dom-expressions": { - "version": "0.14.1", - "resolved": "https://registry.npmjs.org/lit-dom-expressions/-/lit-dom-expressions-0.14.1.tgz", - "integrity": "sha512-3PUkIkVjpBc5E8GAAthaSvVE5enIkzuKzZqFM9uTFO+/I4yD/UJhDXvHdaC8UjzBpglKiktVHAqi9jE0nyXfqg==", + "version": "0.15.0", + "resolved": "https://registry.npmjs.org/lit-dom-expressions/-/lit-dom-expressions-0.15.0.tgz", + "integrity": "sha512-vbu8bfr0VIkDcSUzx5I0OTsuXRDeeIpWpVGQzN2zZsbh+w+hmgyeQfLzABLICl5+1u1+mtigwPOOEMsG+EcOBQ==", "dev": true }, "lodash": { @@ -558,9 +422,9 @@ "dev": true }, "mobx": { - "version": "5.14.0", - "resolved": "https://registry.npmjs.org/mobx/-/mobx-5.14.0.tgz", - "integrity": "sha512-GhDSZV9rGlCeVBpFPVYaYSn7UjgkD3158Njailp4IJhKqbT5iiEtiRyr76b7gPj3wpUSl+NHREQqBXzc1I8jpQ==", + "version": "5.15.1", + "resolved": "https://registry.npmjs.org/mobx/-/mobx-5.15.1.tgz", + "integrity": "sha512-o4aN0GqKcDmKwu2wVsqbujU4F63ZvmbBLSc7WhzuAu9S9eF2wgNjqIkzrb/kbY3C9/mGYG4k1M0KbCuG1GJ7IQ==", "dev": true }, "ms": { @@ -569,6 +433,12 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, + "ncp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ncp/-/ncp-2.0.0.tgz", + "integrity": "sha1-GVoh1sRuNh0vsSgbo4uR6d9727M=", + "dev": true + }, "path-parse": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", @@ -576,18 +446,18 @@ "dev": true }, "resolve": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.11.1.tgz", - "integrity": "sha512-vIpgF6wfuJOZI7KKKSP+HmiKggadPQAdsp5HiC1mvqnfp0gF1vdwgBWZIdrVft9pgqoMFQN+R7BSWZiBxx+BBw==", + "version": "1.14.2", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.14.2.tgz", + "integrity": "sha512-EjlOBLBO1kxsUxsKjLt7TAECyKW6fOh1VRkykQkKGzcBbjjPIxBqGh0jf7GJ3k/f5mxMqW3htMD3WdTUVtW8HQ==", "dev": true, "requires": { "path-parse": "^1.0.6" } }, "rollup": { - "version": "1.26.5", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-1.26.5.tgz", - "integrity": "sha512-c6Pv0yWzjYNpy2DIhLFUnyP6e1UTGownr4IfpJcPY/k186RJjpaGGPRwKQ62KCauctG6dgtHt88pw1EGrPRkuA==", + "version": "1.29.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-1.29.0.tgz", + "integrity": "sha512-V63Iz0dSdI5qPPN5HmCN6OBRzBFhMqNWcvwgq863JtSCTU6Vdvqq6S2fYle/dSCyoPrBkIP3EIr1RVs3HTRqqg==", "dev": true, "requires": { "@types/estree": "*", @@ -619,9 +489,9 @@ } }, "rollup-pluginutils": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.1.tgz", - "integrity": "sha512-J5oAoysWar6GuZo0s+3bZ6sVZAC0pfqKz68De7ZgDi5z63jOVZn1uJL/+z1jeKHNbGII8kAyHF5q8LnxSX5lQg==", + "version": "2.8.2", + "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz", + "integrity": "sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ==", "dev": true, "requires": { "estree-walker": "^0.6.1" @@ -661,9 +531,9 @@ "dev": true }, "typescript": { - "version": "3.7.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.7.2.tgz", - "integrity": "sha512-ml7V7JfiN2Xwvcer+XAf2csGO1bPBdRbFCkYBczNZggrBZ9c7G3riSUeJmqEU5uOtXNPMhE3n+R4FA/3YOAWOQ==", + "version": "3.7.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.7.4.tgz", + "integrity": "sha512-A25xv5XCtarLwXpcDNZzCGvW2D1S3/bACratYBx2sax8PefsFhlYmkQicKHvpYflFS8if4zne5zT5kpJ7pzuvw==", "dev": true } } diff --git a/package.json b/package.json index fc9d56e..35d44b4 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "mobx-jsx", "description": "Raw MobX performance without the restraints of a Virtual DOM", - "version": "0.8.3", + "version": "0.9.0", "author": "Ryan Carniato", "license": "MIT", "repository": { @@ -12,20 +12,21 @@ "main": "lib/index.js", "types": "types/index.d.ts", "scripts": { - "build": "dom-expressions && rollup -c && tsc", + "build": "dom-expressions && rollup -c && tsc && ncp ./src/runtime.d.ts ./types/runtime.d.ts", "prepublishOnly": "npm run build" }, "devDependencies": { - "@babel/core": "7.7.7", - "@babel/preset-typescript": "7.7.7", - "dom-expressions": "0.14.7", - "hyper-dom-expressions": "0.14.1", - "lit-dom-expressions": "0.14.1", - "mobx": "^5.14.0", - "rollup": "^1.26.5", + "@babel/core": "7.8.0", + "@babel/preset-typescript": "7.8.0", + "dom-expressions": "0.15.0", + "hyper-dom-expressions": "0.15.0", + "lit-dom-expressions": "0.15.0", + "mobx": "^5.15.1", + "ncp": "2.0.0", + "rollup": "^1.29.0", "rollup-plugin-babel": "4.3.3", "rollup-plugin-node-resolve": "5.2.0", - "typescript": "3.7.2" + "typescript": "3.7.4" }, "peerDependencies": { "mobx": "*" diff --git a/src/index.ts b/src/index.ts index 438b807..6bc17ed 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,7 +1,7 @@ export * from "./core"; export * from "./runtime"; import { root } from "./core"; -import { insert, hydration, startSSR } from "./runtime"; +import { insert, hydrate as hydr, renderToString as rTS } from "./runtime"; type MountableElement = Element | Document | ShadowRoot | DocumentFragment; @@ -14,12 +14,12 @@ export function render(code: () => any, mount: MountableElement): () => void { return dispose!; } -export function renderSSR( - code: () => any, - element: MountableElement -): () => void { - startSSR(); - return render(code, element); +export function renderToString(code: () => any): Promise { + return root(dispose => { + const p = rTS(code); + dispose(); + return p; + }); } export function hydrate( @@ -27,7 +27,7 @@ export function hydrate( element: MountableElement ): () => void { let disposer: () => void; - hydration(() => { + hydr(() => { disposer = render(code, element); }, element); return disposer!; diff --git a/src/runtime.d.ts b/src/runtime.d.ts index 278a94f..0931dcd 100644 --- a/src/runtime.d.ts +++ b/src/runtime.d.ts @@ -1,6 +1,6 @@ export function template(html: string, isSVG?: boolean): Element; export function wrap(fn: (prev?: T) => T): any; -export function wrapCondition(fn: () => boolean): () => boolean; +export function wrapCondition(fn: () => any): () => any; export function insert( parent: Element | Document | ShadowRoot | DocumentFragment, accessor: any, @@ -14,18 +14,30 @@ export function createComponent( ): any; export function delegateEvents(eventNames: string[]): void; export function clearDelegatedEvents(): void; -export function spread(node: Element, accessor: any, isSVG: Boolean): void; +export function spread( + node: Element, + accessor: any, + isSVG?: Boolean, + skipChildren?: Boolean +): void; export function classList( node: Element, value: { [k: string]: boolean }, prev?: { [k: string]: boolean } ): void; export function currentContext(): any; -export function isSSR(): boolean; -export function startSSR(): void; -export function hydration( +export function renderToString( + fn: (done?: () => void) => any, + options?: { + timeoutMs?: number; + } +): Promise; +export function hydrate( fn: () => unknown, node: Element | Document | ShadowRoot | DocumentFragment ): void; -export function getNextElement(template: HTMLTemplateElement): Node; +export function getNextElement( + template: HTMLTemplateElement, + isSSR: boolean +): Node; export function getNextMarker(start: Node): [Node, Array]; diff --git a/src/runtime.js b/src/runtime.js index 70f077f..82121bb 100644 --- a/src/runtime.js +++ b/src/runtime.js @@ -5,6 +5,7 @@ import { untracked as ignore } from 'mobx';; const eventRegistry = new Set(); +const config = {}; export { wrap, wrapCondition }; @@ -59,10 +60,10 @@ export function classList(node, value, prev) { } } -export function spread(node, accessor, isSVG) { +export function spread(node, accessor, isSVG, skipChildren) { if (typeof accessor === 'function') { - wrap(current => spreadExpression(node, accessor(), current, isSVG)); - } else spreadExpression(node, accessor, undefined, isSVG); + wrap(current => spreadExpression(node, accessor(), current, isSVG, skipChildren)); + } else spreadExpression(node, accessor, undefined, isSVG, skipChildren); } export function insert(parent, accessor, marker, initial) { @@ -77,44 +78,48 @@ export function insert(parent, accessor, marker, initial) { } // SSR -let hydrateRegistry = null, - hydrateKey = 0, - SSR = false; - -export function isSSR() { return SSR; } -export function startSSR() { - hydrateKey = 0; - SSR = true; -} - -export function hydration(code, root) { - hydrateRegistry = new Map(); - hydrateKey = 0; - SSR = false; - const iterator = document.createTreeWalker(root, NodeFilter.SHOW_ELEMENT, { - acceptNode: node => node.hasAttribute('_hk') && NodeFilter.FILTER_ACCEPT +export function renderToString(code, options = {}) { + options = { timeoutMs: 10000, ...options } + config.hydrate = { id: '', count: 0 }; + const container = document.createElement("div"); + return new Promise(resolve => { + setTimeout(() => resolve(container.innerHTML), options.timeoutMs); + if (!code.length) { + insert(container, code()); + resolve(container.innerHTML); + } else insert(container, code(() => resolve(container.innerHTML))); }); - let node; - while (node = iterator.nextNode()) hydrateRegistry.set(node.getAttribute('_hk'), node); +} +export function hydrate(code, root) { + config.hydrate = { id: '', count: 0, registry: new Map() }; + const templates = root.querySelectorAll(`*[_hk]`); + for (let i = 0; i < templates.length; i++) { + const node = templates[i]; + config.hydrate.registry.set(node.getAttribute('_hk'), node); + } code(); - hydrateRegistry = null; + delete config.hydrate; } -export function getNextElement(template) { - if (!hydrateRegistry) { +export function getNextElement(template, isSSR) { + const hydrate = config.hydrate; + let node, key; + if (!hydrate || !hydrate.registry || !(node = hydrate.registry.get(key = `${hydrate.id}:${hydrate.count++}`))) { const el = template.cloneNode(true); - if (SSR) el.setAttribute('_hk', `${hydrateKey++}`); + if (isSSR && hydrate) + el.setAttribute('_hk', `${hydrate.id}:${hydrate.count++}`); return el; } - return hydrateRegistry.get(`${hydrateKey++}`); + if (window && window._$HYDRATION) window._$HYDRATION.completed.add(key); + return node; } export function getNextMarker(start) { let end = start, count = 0, current = []; - if (hydrateRegistry) { + if (config.hydrate && config.hydrate.registry) { while (end) { if (end.nodeType === 8) { const v = end.nodeValue; @@ -131,6 +136,18 @@ export function getNextMarker(start) { return [end, current]; } +export function runHydrationEvents(id) { + if (window && window._$HYDRATION) { + const { completed, events } = window._$HYDRATION; + while (events.length) { + const [id, e] = events[0]; + if (!completed.has(id)) return; + eventHandler(e); + events.shift(); + } + } +} + // Internal Functions function dynamicProp(props, key) { const src = props[key]; @@ -172,9 +189,9 @@ function eventHandler(e) { } } -function spreadExpression(node, props, prevProps = {}, isSVG) { +function spreadExpression(node, props, prevProps = {}, isSVG, skipChildren) { let info; - if ("children" in props) { + if (!skipChildren && "children" in props) { wrap(() => (prevProps.children = insertExpression( node, @@ -287,12 +304,14 @@ function insertExpression(parent, value, current, marker) { } else current = parent.textContent = value; } } else if (value == null || t === 'boolean') { + if (config.hydrate && config.hydrate.registry) return current; current = cleanChildren(parent, current, marker); } else if (t === 'function') { wrap(() => current = insertExpression(parent, value(), current, marker)); return () => current; } else if (Array.isArray(value)) { const array = normalizeIncomingArray([], value); + if (config.hydrate && config.hydrate.registry) return current; if (array.length === 0) { current = cleanChildren(parent, current, marker); if (multi) return current; From 6df131a8e45f3441bab951c2e2d9844718ddeb77 Mon Sep 17 00:00:00 2001 From: Ryan Carniato Date: Mon, 23 Mar 2020 20:26:30 -0700 Subject: [PATCH 08/38] update version --- dom-expressions.config.js | 6 +- package-lock.json | 402 +++++++++++++++++++++----------------- package.json | 22 +-- rollup.config.js | 2 +- src/core.ts | 4 +- src/index.ts | 4 +- src/runtime.d.ts | 11 +- src/runtime.js | 369 ++++++++++++---------------------- 8 files changed, 369 insertions(+), 451 deletions(-) diff --git a/dom-expressions.config.js b/dom-expressions.config.js index 456bd3c..5149a25 100644 --- a/dom-expressions.config.js +++ b/dom-expressions.config.js @@ -3,11 +3,9 @@ module.exports = { includeTypes: true, variables: { imports: [ - `import { effect as wrap, condition as wrapCondition } from './core';`, + `import { effect as wrap } from './core';`, `import { untracked as ignore } from 'mobx';` ], - classComponents: true, - wrapNested: true, - wrapConditionals: true + classComponents: true } } \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 2c649d3..57b42f1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,35 +1,36 @@ { "name": "mobx-jsx", - "version": "0.9.0", + "version": "0.10.0", "lockfileVersion": 1, "requires": true, "dependencies": { "@babel/code-frame": { - "version": "7.8.0", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.0.tgz", - "integrity": "sha512-AN2IR/wCUYsM+PdErq6Bp3RFTXl8W0p9Nmymm7zkpsCmh+r/YYcckaCGpU8Q/mEKmST19kkGRaG42A/jxOWwBA==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz", + "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==", "dev": true, "requires": { - "@babel/highlight": "^7.8.0" + "@babel/highlight": "^7.8.3" } }, "@babel/core": { - "version": "7.8.0", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.8.0.tgz", - "integrity": "sha512-3rqPi/bv/Xfu2YzHvBz4XqMI1fKVwnhntPA1/fjoECrSjrhbOCxlTrbVu5gUtr8zkxW+RpkDOa/HCW93gzS2Dw==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.8.0", - "@babel/generator": "^7.8.0", - "@babel/helpers": "^7.8.0", - "@babel/parser": "^7.8.0", - "@babel/template": "^7.8.0", - "@babel/traverse": "^7.8.0", - "@babel/types": "^7.8.0", + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.9.0.tgz", + "integrity": "sha512-kWc7L0fw1xwvI0zi8OKVBuxRVefwGOrKSQMvrQ3dW+bIIavBY3/NpXmpjMy7bQnLgwgzWQZ8TlM57YHpHNHz4w==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.8.3", + "@babel/generator": "^7.9.0", + "@babel/helper-module-transforms": "^7.9.0", + "@babel/helpers": "^7.9.0", + "@babel/parser": "^7.9.0", + "@babel/template": "^7.8.6", + "@babel/traverse": "^7.9.0", + "@babel/types": "^7.9.0", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.1", - "json5": "^2.1.0", + "json5": "^2.1.2", "lodash": "^4.17.13", "resolve": "^1.3.2", "semver": "^5.4.1", @@ -37,212 +38,259 @@ } }, "@babel/generator": { - "version": "7.8.0", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.8.0.tgz", - "integrity": "sha512-2Lp2e02CV2C7j/H4n4D9YvsvdhPVVg9GDIamr6Tu4tU35mL3mzOrzl1lZ8ZJtysfZXh+y+AGORc2rPS7yHxBUg==", + "version": "7.9.3", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.9.3.tgz", + "integrity": "sha512-RpxM252EYsz9qLUIq6F7YJyK1sv0wWDBFuztfDGWaQKzHjqDHysxSiRUpA/X9jmfqo+WzkAVKFaUily5h+gDCQ==", "dev": true, "requires": { - "@babel/types": "^7.8.0", + "@babel/types": "^7.9.0", "jsesc": "^2.5.1", "lodash": "^4.17.13", "source-map": "^0.5.0" } }, "@babel/helper-create-class-features-plugin": { - "version": "7.8.0", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.8.0.tgz", - "integrity": "sha512-ctCvqYBTlwEl2uF4hCxE0cd/sSw71Zfag0jKa39y4HDLh0BQ4PVBX1384Ye8GqrEZ69xgLp9fwPbv3GgIDDF2Q==", + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.8.6.tgz", + "integrity": "sha512-klTBDdsr+VFFqaDHm5rR69OpEQtO2Qv8ECxHS1mNhJJvaHArR6a1xTf5K/eZW7eZpJbhCx3NW1Yt/sKsLXLblg==", "dev": true, "requires": { - "@babel/helper-function-name": "^7.8.0", - "@babel/helper-member-expression-to-functions": "^7.8.0", - "@babel/helper-optimise-call-expression": "^7.8.0", - "@babel/helper-plugin-utils": "^7.8.0", - "@babel/helper-replace-supers": "^7.8.0", - "@babel/helper-split-export-declaration": "^7.8.0" + "@babel/helper-function-name": "^7.8.3", + "@babel/helper-member-expression-to-functions": "^7.8.3", + "@babel/helper-optimise-call-expression": "^7.8.3", + "@babel/helper-plugin-utils": "^7.8.3", + "@babel/helper-replace-supers": "^7.8.6", + "@babel/helper-split-export-declaration": "^7.8.3" } }, "@babel/helper-function-name": { - "version": "7.8.0", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.8.0.tgz", - "integrity": "sha512-x9psucuU0Xalw+0Vpr2FYJMLB7/KnPSLZhlkUyOGbYAWRDfmtZBrguYpJYiaNCRV7vGkYjO/gF6/J6yMvdWTDw==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.8.3.tgz", + "integrity": "sha512-BCxgX1BC2hD/oBlIFUgOCQDOPV8nSINxCwM3o93xP4P9Fq6aV5sgv2cOOITDMtCfQ+3PvHp3l689XZvAM9QyOA==", "dev": true, "requires": { - "@babel/helper-get-function-arity": "^7.8.0", - "@babel/template": "^7.8.0", - "@babel/types": "^7.8.0" + "@babel/helper-get-function-arity": "^7.8.3", + "@babel/template": "^7.8.3", + "@babel/types": "^7.8.3" } }, "@babel/helper-get-function-arity": { - "version": "7.8.0", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.8.0.tgz", - "integrity": "sha512-eUP5grliToMapQiTaYS2AAO/WwaCG7cuJztR1v/a1aPzUzUeGt+AaI9OvLATc/AfFkF8SLJ10d5ugGt/AQ9d6w==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.8.3.tgz", + "integrity": "sha512-FVDR+Gd9iLjUMY1fzE2SR0IuaJToR4RkCDARVfsBBPSP53GEqSFjD8gNyxg246VUyc/ALRxFaAK8rVG7UT7xRA==", "dev": true, "requires": { - "@babel/types": "^7.8.0" + "@babel/types": "^7.8.3" } }, "@babel/helper-member-expression-to-functions": { - "version": "7.8.0", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.8.0.tgz", - "integrity": "sha512-0m1QabGrdXuoxX/g+KOAGndoHwskC70WweqHRQyCsaO67KOEELYh4ECcGw6ZGKjDKa5Y7SW4Qbhw6ly4Fah/jQ==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.8.3.tgz", + "integrity": "sha512-fO4Egq88utkQFjbPrSHGmGLFqmrshs11d46WI+WZDESt7Wu7wN2G2Iu+NMMZJFDOVRHAMIkB5SNh30NtwCA7RA==", "dev": true, "requires": { - "@babel/types": "^7.8.0" + "@babel/types": "^7.8.3" } }, "@babel/helper-module-imports": { - "version": "7.8.0", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.8.0.tgz", - "integrity": "sha512-ylY9J6ZxEcjmJaJ4P6aVs/fZdrZVctCGnxxfYXwCnSMapqd544zT8lWK2qI/vBPjE5gS0o2jILnH+AkpsPauEQ==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.8.3.tgz", + "integrity": "sha512-R0Bx3jippsbAEtzkpZ/6FIiuzOURPcMjHp+Z6xPe6DtApDJx+w7UYyOLanZqO8+wKR9G10s/FmHXvxaMd9s6Kg==", "dev": true, "requires": { - "@babel/types": "^7.8.0" + "@babel/types": "^7.8.3" + } + }, + "@babel/helper-module-transforms": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.9.0.tgz", + "integrity": "sha512-0FvKyu0gpPfIQ8EkxlrAydOWROdHpBmiCiRwLkUiBGhCUPRRbVD2/tm3sFr/c/GWFrQ/ffutGUAnx7V0FzT2wA==", + "dev": true, + "requires": { + "@babel/helper-module-imports": "^7.8.3", + "@babel/helper-replace-supers": "^7.8.6", + "@babel/helper-simple-access": "^7.8.3", + "@babel/helper-split-export-declaration": "^7.8.3", + "@babel/template": "^7.8.6", + "@babel/types": "^7.9.0", + "lodash": "^4.17.13" } }, "@babel/helper-optimise-call-expression": { - "version": "7.8.0", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.8.0.tgz", - "integrity": "sha512-aiJt1m+K57y0n10fTw+QXcCXzmpkG+o+NoQmAZqlZPstkTE0PZT+Z27QSd/6Gf00nuXJQO4NiJ0/YagSW5kC2A==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.8.3.tgz", + "integrity": "sha512-Kag20n86cbO2AvHca6EJsvqAd82gc6VMGule4HwebwMlwkpXuVqrNRj6CkCV2sKxgi9MyAUnZVnZ6lJ1/vKhHQ==", "dev": true, "requires": { - "@babel/types": "^7.8.0" + "@babel/types": "^7.8.3" } }, "@babel/helper-plugin-utils": { - "version": "7.8.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.0.tgz", - "integrity": "sha512-+hAlRGdf8fHQAyNnDBqTHQhwdLURLdrCROoWaEQYiQhk2sV9Rhs+GoFZZfMJExTq9HG8o2NX3uN2G90bFtmFdA==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz", + "integrity": "sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ==", "dev": true }, "@babel/helper-replace-supers": { - "version": "7.8.0", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.8.0.tgz", - "integrity": "sha512-R2CyorW4tcO3YzdkClLpt6MS84G+tPkOi0MmiCn1bvYVnmDpdl9R15XOi3NQW2mhOAEeBnuQ4g1Bh7pT2sX8fg==", + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.8.6.tgz", + "integrity": "sha512-PeMArdA4Sv/Wf4zXwBKPqVj7n9UF/xg6slNRtZW84FM7JpE1CbG8B612FyM4cxrf4fMAMGO0kR7voy1ForHHFA==", + "dev": true, + "requires": { + "@babel/helper-member-expression-to-functions": "^7.8.3", + "@babel/helper-optimise-call-expression": "^7.8.3", + "@babel/traverse": "^7.8.6", + "@babel/types": "^7.8.6" + } + }, + "@babel/helper-simple-access": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.8.3.tgz", + "integrity": "sha512-VNGUDjx5cCWg4vvCTR8qQ7YJYZ+HBjxOgXEl7ounz+4Sn7+LMD3CFrCTEU6/qXKbA2nKg21CwhhBzO0RpRbdCw==", "dev": true, "requires": { - "@babel/helper-member-expression-to-functions": "^7.8.0", - "@babel/helper-optimise-call-expression": "^7.8.0", - "@babel/traverse": "^7.8.0", - "@babel/types": "^7.8.0" + "@babel/template": "^7.8.3", + "@babel/types": "^7.8.3" } }, "@babel/helper-split-export-declaration": { - "version": "7.8.0", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.8.0.tgz", - "integrity": "sha512-YhYFhH4T6DlbT6CPtVgLfC1Jp2gbCawU/ml7WJvUpBg01bCrXSzTYMZZXbbIGjq/kHmK8YUATxTppcRGzj31pA==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.8.3.tgz", + "integrity": "sha512-3x3yOeyBhW851hroze7ElzdkeRXQYQbFIb7gLK1WQYsw2GWDay5gAJNw1sWJ0VFP6z5J1whqeXH/WCdCjZv6dA==", "dev": true, "requires": { - "@babel/types": "^7.8.0" + "@babel/types": "^7.8.3" } }, + "@babel/helper-validator-identifier": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.9.0.tgz", + "integrity": "sha512-6G8bQKjOh+of4PV/ThDm/rRqlU7+IGoJuofpagU5GlEl29Vv0RGqqt86ZGRV8ZuSOY3o+8yXl5y782SMcG7SHw==", + "dev": true + }, "@babel/helpers": { - "version": "7.8.0", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.8.0.tgz", - "integrity": "sha512-srWKpjAFbiut5JoCReZJ098hLqoZ9HufOnKZPggc7j74XaPuQ+9b3RYPV1M/HfjL63lCNd8uI1O487qIWxAFNA==", + "version": "7.9.2", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.9.2.tgz", + "integrity": "sha512-JwLvzlXVPjO8eU9c/wF9/zOIN7X6h8DYf7mG4CiFRZRvZNKEF5dQ3H3V+ASkHoIB3mWhatgl5ONhyqHRI6MppA==", "dev": true, "requires": { - "@babel/template": "^7.8.0", - "@babel/traverse": "^7.8.0", - "@babel/types": "^7.8.0" + "@babel/template": "^7.8.3", + "@babel/traverse": "^7.9.0", + "@babel/types": "^7.9.0" } }, "@babel/highlight": { - "version": "7.8.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.8.0.tgz", - "integrity": "sha512-OsdTJbHlPtIk2mmtwXItYrdmalJ8T0zpVzNAbKSkHshuywj7zb29Y09McV/jQsQunc/nEyHiPV2oy9llYMLqxw==", + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.9.0.tgz", + "integrity": "sha512-lJZPilxX7Op3Nv/2cvFdnlepPXDxi29wxteT57Q965oc5R9v86ztx0jfxVrTcBk8C2kcPkkDa2Z4T3ZsPPVWsQ==", "dev": true, "requires": { + "@babel/helper-validator-identifier": "^7.9.0", "chalk": "^2.0.0", - "esutils": "^2.0.2", "js-tokens": "^4.0.0" } }, "@babel/parser": { - "version": "7.8.0", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.8.0.tgz", - "integrity": "sha512-VVtsnUYbd1+2A2vOVhm4P2qNXQE8L/W859GpUHfUcdhX8d3pEKThZuIr6fztocWx9HbK+00/CR0tXnhAggJ4CA==", + "version": "7.9.3", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.9.3.tgz", + "integrity": "sha512-E6SpIDJZ0cZAKoCNk+qSDd0ChfTnpiJN9FfNf3RZ20dzwA2vL2oq5IX1XTVT+4vDmRlta2nGk5HGMMskJAR+4A==", "dev": true }, "@babel/plugin-syntax-typescript": { - "version": "7.8.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.8.0.tgz", - "integrity": "sha512-LrvVrabb993Ve5fzXsyEkfYCuhpXBwsUFjlvgD8UmXXg3r/8/ceooSdRvjdmtPXXz+lHaqZHZooV1jMWer2qkA==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.8.3.tgz", + "integrity": "sha512-GO1MQ/SGGGoiEXY0e0bSpHimJvxqB7lktLLIq2pv8xG7WZ8IMEle74jIe1FhprHBWjwjZtXHkycDLZXIWM5Wfg==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.8.0" + "@babel/helper-plugin-utils": "^7.8.3" } }, "@babel/plugin-transform-typescript": { - "version": "7.8.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.8.0.tgz", - "integrity": "sha512-RhMZnNWcyvX+rM6mk888MaeoVl5pGfmYP3as709n4+0d15SRedz4r+LPRg2a9s4z+t+DM+gy8uz/rmM3Cb8JBw==", + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.9.0.tgz", + "integrity": "sha512-GRffJyCu16H3tEhbt9Q4buVFFBqrgS8FzTuhqSxlXNgmqD8aw2xmwtRwrvWXXlw7gHs664uqacsJymHJ9SUE/Q==", "dev": true, "requires": { - "@babel/helper-create-class-features-plugin": "^7.8.0", - "@babel/helper-plugin-utils": "^7.8.0", - "@babel/plugin-syntax-typescript": "^7.8.0" + "@babel/helper-create-class-features-plugin": "^7.8.3", + "@babel/helper-plugin-utils": "^7.8.3", + "@babel/plugin-syntax-typescript": "^7.8.3" } }, "@babel/preset-typescript": { - "version": "7.8.0", - "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.8.0.tgz", - "integrity": "sha512-mvu4OmrLK6qRPiXlOkE4yOeOszHzk9itwe6aiMN0RL9Bc5uAwAotVTy4kKl17evLMd1WsvWT1O3mZltynuqxXg==", + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.9.0.tgz", + "integrity": "sha512-S4cueFnGrIbvYJgwsVFKdvOmpiL0XGw9MFW9D0vgRys5g36PBhZRL8NX8Gr2akz8XRtzq6HuDXPD/1nniagNUg==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.8.0", - "@babel/plugin-transform-typescript": "^7.8.0" + "@babel/helper-plugin-utils": "^7.8.3", + "@babel/plugin-transform-typescript": "^7.9.0" } }, "@babel/template": { - "version": "7.8.0", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.8.0.tgz", - "integrity": "sha512-0NNMDsY2t3ltAVVK1WHNiaePo3tXPUeJpCX4I3xSKFoEl852wJHG8mrgHVADf8Lz1y+8al9cF7cSSfzSnFSYiw==", + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.8.6.tgz", + "integrity": "sha512-zbMsPMy/v0PWFZEhQJ66bqjhH+z0JgMoBWuikXybgG3Gkd/3t5oQ1Rw2WQhnSrsOmsKXnZOx15tkC4qON/+JPg==", "dev": true, "requires": { - "@babel/code-frame": "^7.8.0", - "@babel/parser": "^7.8.0", - "@babel/types": "^7.8.0" + "@babel/code-frame": "^7.8.3", + "@babel/parser": "^7.8.6", + "@babel/types": "^7.8.6" } }, "@babel/traverse": { - "version": "7.8.0", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.8.0.tgz", - "integrity": "sha512-d/6sPXFLGlJHZO/zWDtgFaKyalCOHLedzxpVJn6el1cw+f2TZa7xZEszeXdOw6EUemqRFBAn106BWBvtSck9Qw==", + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.9.0.tgz", + "integrity": "sha512-jAZQj0+kn4WTHO5dUZkZKhbFrqZE7K5LAQ5JysMnmvGij+wOdr+8lWqPeW0BcF4wFwrEXXtdGO7wcV6YPJcf3w==", "dev": true, "requires": { - "@babel/code-frame": "^7.8.0", - "@babel/generator": "^7.8.0", - "@babel/helper-function-name": "^7.8.0", - "@babel/helper-split-export-declaration": "^7.8.0", - "@babel/parser": "^7.8.0", - "@babel/types": "^7.8.0", + "@babel/code-frame": "^7.8.3", + "@babel/generator": "^7.9.0", + "@babel/helper-function-name": "^7.8.3", + "@babel/helper-split-export-declaration": "^7.8.3", + "@babel/parser": "^7.9.0", + "@babel/types": "^7.9.0", "debug": "^4.1.0", "globals": "^11.1.0", "lodash": "^4.17.13" } }, "@babel/types": { - "version": "7.8.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.8.0.tgz", - "integrity": "sha512-1RF84ehyx9HH09dMMwGWl3UTWlVoCPtqqJPjGuC4JzMe1ZIVDJ2DT8mv3cPv/A7veLD6sgR7vi95lJqm+ZayIg==", + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.0.tgz", + "integrity": "sha512-BS9JKfXkzzJl8RluW4JGknzpiUV7ZrvTayM6yfqLTVBEnFtyowVIOu6rqxRd5cVO6yGoWf4T8u8dgK9oB+GCng==", "dev": true, "requires": { - "esutils": "^2.0.2", + "@babel/helper-validator-identifier": "^7.9.0", "lodash": "^4.17.13", "to-fast-properties": "^2.0.0" } }, - "@types/estree": { - "version": "0.0.42", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.42.tgz", - "integrity": "sha512-K1DPVvnBCPxzD+G51/cxVIoc2X8uUVl1zpJeE6iKcgHMj4+tbat5Xu4TjV7v2QSDbIeAfLi2hIk+u2+s0MlpUQ==", - "dev": true + "@rollup/plugin-node-resolve": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-7.1.1.tgz", + "integrity": "sha512-14ddhD7TnemeHE97a4rLOhobfYvUVcaYuqTnL8Ti7Jxi9V9Jr5LY7Gko4HZ5k4h4vqQM0gBQt6tsp9xXW94WPA==", + "dev": true, + "requires": { + "@rollup/pluginutils": "^3.0.6", + "@types/resolve": "0.0.8", + "builtin-modules": "^3.1.0", + "is-module": "^1.0.0", + "resolve": "^1.14.2" + } + }, + "@rollup/pluginutils": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.0.8.tgz", + "integrity": "sha512-rYGeAc4sxcZ+kPG/Tw4/fwJODC3IXHYDH4qusdN/b6aLw5LPUbzpecYbEJh4sVQGPFJxd2dBU4kc1H3oy9/bnw==", + "dev": true, + "requires": { + "estree-walker": "^1.0.1" + } }, "@types/node": { - "version": "13.1.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-13.1.6.tgz", - "integrity": "sha512-Jg1F+bmxcpENHP23sVKkNuU3uaxPnsBMW0cLjleiikFKomJQbsn0Cqk2yDvQArqzZN6ABfBkZ0To7pQ8sLdWDg==", + "version": "13.9.3", + "resolved": "https://registry.npmjs.org/@types/node/-/node-13.9.3.tgz", + "integrity": "sha512-01s+ac4qerwd6RHD+mVbOEsraDHSgUaefQlEdBbUolnQFjKwCr7luvAlEwW1RFojh67u0z4OUTjPn9LEl4zIkA==", "dev": true }, "@types/resolve": { @@ -254,12 +302,6 @@ "@types/node": "*" } }, - "acorn": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.0.tgz", - "integrity": "sha512-kL5CuoXA/dgxlBbVrflsflzQ3PAas7RYZB52NOm/6839iVYJgKMJ3cQJD+t2i5+qFa8h3MDpEOJiS64E8JLnSQ==", - "dev": true - }, "ansi-styles": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", @@ -320,9 +362,9 @@ } }, "dom-expressions": { - "version": "0.15.0", - "resolved": "https://registry.npmjs.org/dom-expressions/-/dom-expressions-0.15.0.tgz", - "integrity": "sha512-cLdwLkjjsWsRB2Qh/OvKWFPKDnUiVP78QzD0DmY3+lvC0zGXhKNe2/cfCANzW3B5a2Xz9wK2r6ix29gXQOla7w==", + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/dom-expressions/-/dom-expressions-0.17.0.tgz", + "integrity": "sha512-HKSgoodRFJbLeLlBU7slqHYESQ7FPmQFykyYHR9GyfrR160lPFg8H8toSfc6C7djr7mAqZYjqTy2szWtvWTtyg==", "dev": true, "requires": { "ejs": "^3.0.1" @@ -341,16 +383,17 @@ "dev": true }, "estree-walker": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.1.tgz", - "integrity": "sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-1.0.1.tgz", + "integrity": "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==", "dev": true }, - "esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true + "fsevents": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.2.tgz", + "integrity": "sha512-R4wDiBwZ0KzpgOWetKDug1FZcYhqYnUYKtfZYt4mD5SBz76q0KR4Q9o7GIPamsVPGmW3EYPPJ0dOOjvx32ldZA==", + "dev": true, + "optional": true }, "gensync": { "version": "1.0.0-beta.1", @@ -371,9 +414,9 @@ "dev": true }, "hyper-dom-expressions": { - "version": "0.15.0", - "resolved": "https://registry.npmjs.org/hyper-dom-expressions/-/hyper-dom-expressions-0.15.0.tgz", - "integrity": "sha512-Ju5uNfMgx6yQLMaXcJl8qIcOaxbCFC9VZ7Y9E0D99/52QZPe+cPjthKmus9hocUp/2FYSzngE+xcw7hWgCgF/g==", + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/hyper-dom-expressions/-/hyper-dom-expressions-0.17.0.tgz", + "integrity": "sha512-NhOy+U+t4wHrONgTPmDl0y84J2iJwsURz6kkGeQ/EihoQ7uZFmMLGx28nUbs4x2YfGdKuL8gYYLw3m0dtSzPyQ==", "dev": true }, "is-module": { @@ -395,18 +438,18 @@ "dev": true }, "json5": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.1.tgz", - "integrity": "sha512-l+3HXD0GEI3huGq1njuqtzYK8OYJyXMkOLtQ53pjWh89tvWS2h6l+1zMkYWqlb57+SiQodKZyvMEFb2X+KrFhQ==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.2.tgz", + "integrity": "sha512-MoUOQ4WdiN3yxhm7NEVJSJrieAo5hNSLQ5sj05OTRHPL9HOBy8u4Bu88jsC1jvqAdN+E1bJmsUcZH+1HQxliqQ==", "dev": true, "requires": { - "minimist": "^1.2.0" + "minimist": "^1.2.5" } }, "lit-dom-expressions": { - "version": "0.15.0", - "resolved": "https://registry.npmjs.org/lit-dom-expressions/-/lit-dom-expressions-0.15.0.tgz", - "integrity": "sha512-vbu8bfr0VIkDcSUzx5I0OTsuXRDeeIpWpVGQzN2zZsbh+w+hmgyeQfLzABLICl5+1u1+mtigwPOOEMsG+EcOBQ==", + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/lit-dom-expressions/-/lit-dom-expressions-0.17.0.tgz", + "integrity": "sha512-Jdbf0wrGB9aNrgayR1dLsguWtASiX3yfyq+NNs5ZH+G1lpdHi2Tqk4ohaKiHd+HJpqOTxZWvSnsW4LHhChCqFg==", "dev": true }, "lodash": { @@ -416,15 +459,15 @@ "dev": true }, "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", "dev": true }, "mobx": { - "version": "5.15.1", - "resolved": "https://registry.npmjs.org/mobx/-/mobx-5.15.1.tgz", - "integrity": "sha512-o4aN0GqKcDmKwu2wVsqbujU4F63ZvmbBLSc7WhzuAu9S9eF2wgNjqIkzrb/kbY3C9/mGYG4k1M0KbCuG1GJ7IQ==", + "version": "5.15.4", + "resolved": "https://registry.npmjs.org/mobx/-/mobx-5.15.4.tgz", + "integrity": "sha512-xRFJxSU2Im3nrGCdjSuOTFmxVDGeqOHL+TyADCGbT0k4HHqGmx5u2yaHNryvoORpI4DfbzjJ5jPmuv+d7sioFw==", "dev": true }, "ms": { @@ -446,48 +489,33 @@ "dev": true }, "resolve": { - "version": "1.14.2", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.14.2.tgz", - "integrity": "sha512-EjlOBLBO1kxsUxsKjLt7TAECyKW6fOh1VRkykQkKGzcBbjjPIxBqGh0jf7GJ3k/f5mxMqW3htMD3WdTUVtW8HQ==", + "version": "1.15.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.15.1.tgz", + "integrity": "sha512-84oo6ZTtoTUpjgNEr5SJyzQhzL72gaRodsSfyxC/AXRvwu0Yse9H8eF9IpGo7b8YetZhlI6v7ZQ6bKBFV/6S7w==", "dev": true, "requires": { "path-parse": "^1.0.6" } }, "rollup": { - "version": "1.29.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-1.29.0.tgz", - "integrity": "sha512-V63Iz0dSdI5qPPN5HmCN6OBRzBFhMqNWcvwgq863JtSCTU6Vdvqq6S2fYle/dSCyoPrBkIP3EIr1RVs3HTRqqg==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.1.0.tgz", + "integrity": "sha512-gfE1455AEazVVTJoeQtcOq/U6GSxwoj4XPSWVsuWmgIxj7sBQNLDOSA82PbdMe+cP8ql8fR1jogPFe8Wg8g4SQ==", "dev": true, "requires": { - "@types/estree": "*", - "@types/node": "*", - "acorn": "^7.1.0" + "fsevents": "~2.1.2" } }, "rollup-plugin-babel": { - "version": "4.3.3", - "resolved": "https://registry.npmjs.org/rollup-plugin-babel/-/rollup-plugin-babel-4.3.3.tgz", - "integrity": "sha512-tKzWOCmIJD/6aKNz0H1GMM+lW1q9KyFubbWzGiOG540zxPPifnEAHTZwjo0g991Y+DyOZcLqBgqOdqazYE5fkw==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-babel/-/rollup-plugin-babel-4.4.0.tgz", + "integrity": "sha512-Lek/TYp1+7g7I+uMfJnnSJ7YWoD58ajo6Oarhlex7lvUce+RCKRuGRSgztDO3/MF/PuGKmUL5iTHKf208UNszw==", "dev": true, "requires": { "@babel/helper-module-imports": "^7.0.0", "rollup-pluginutils": "^2.8.1" } }, - "rollup-plugin-node-resolve": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-5.2.0.tgz", - "integrity": "sha512-jUlyaDXts7TW2CqQ4GaO5VJ4PwwaV8VUGA7+km3n6k6xtOEacf61u0VXwN80phY/evMcaS+9eIeJ9MOyDxt5Zw==", - "dev": true, - "requires": { - "@types/resolve": "0.0.8", - "builtin-modules": "^3.1.0", - "is-module": "^1.0.0", - "resolve": "^1.11.1", - "rollup-pluginutils": "^2.8.1" - } - }, "rollup-pluginutils": { "version": "2.8.2", "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz", @@ -495,6 +523,14 @@ "dev": true, "requires": { "estree-walker": "^0.6.1" + }, + "dependencies": { + "estree-walker": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.1.tgz", + "integrity": "sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==", + "dev": true + } } }, "safe-buffer": { @@ -531,9 +567,9 @@ "dev": true }, "typescript": { - "version": "3.7.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.7.4.tgz", - "integrity": "sha512-A25xv5XCtarLwXpcDNZzCGvW2D1S3/bACratYBx2sax8PefsFhlYmkQicKHvpYflFS8if4zne5zT5kpJ7pzuvw==", + "version": "3.8.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.8.3.tgz", + "integrity": "sha512-MYlEfn5VrLNsgudQTVJeNaQFUAI7DkhnOjdpAp4T+ku1TfQClewlbSuTVHiA+8skNBgaf02TL/kLOvig4y3G8w==", "dev": true } } diff --git a/package.json b/package.json index 35d44b4..aa842bc 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "mobx-jsx", "description": "Raw MobX performance without the restraints of a Virtual DOM", - "version": "0.9.0", + "version": "0.10.0", "author": "Ryan Carniato", "license": "MIT", "repository": { @@ -16,17 +16,17 @@ "prepublishOnly": "npm run build" }, "devDependencies": { - "@babel/core": "7.8.0", - "@babel/preset-typescript": "7.8.0", - "dom-expressions": "0.15.0", - "hyper-dom-expressions": "0.15.0", - "lit-dom-expressions": "0.15.0", - "mobx": "^5.15.1", + "@babel/core": "7.9.0", + "@babel/preset-typescript": "7.9.0", + "dom-expressions": "0.17.0", + "hyper-dom-expressions": "0.17.0", + "lit-dom-expressions": "0.17.0", + "mobx": "^5.15.4", "ncp": "2.0.0", - "rollup": "^1.29.0", - "rollup-plugin-babel": "4.3.3", - "rollup-plugin-node-resolve": "5.2.0", - "typescript": "3.7.4" + "rollup": "^2.1.0", + "rollup-plugin-babel": "4.4.0", + "@rollup/plugin-node-resolve": "7.1.1", + "typescript": "3.8.3" }, "peerDependencies": { "mobx": "*" diff --git a/rollup.config.js b/rollup.config.js index a5ea831..895c65e 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,5 +1,5 @@ import babel from 'rollup-plugin-babel'; -import nodeResolve from 'rollup-plugin-node-resolve'; +import nodeResolve from '@rollup/plugin-node-resolve'; const plugins = [ nodeResolve({ diff --git a/src/core.ts b/src/core.ts index f7b2a24..5bab766 100644 --- a/src/core.ts +++ b/src/core.ts @@ -66,9 +66,9 @@ export function effect(fn: (prev?: T) => T) { // only updates when boolean expression changes export function condition(fn: () => T) { - const o = observable.box(!!untracked(fn)); + const o = observable.box(untracked(fn)); effect(prev => { - const res = !!fn(); + const res = fn(); prev !== res && o.set(res); return res; }) diff --git a/src/index.ts b/src/index.ts index 6bc17ed..7e3da5e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,10 +1,12 @@ export * from "./core"; export * from "./runtime"; -import { root } from "./core"; +import { root, condition } from "./core"; import { insert, hydrate as hydr, renderToString as rTS } from "./runtime"; type MountableElement = Element | Document | ShadowRoot | DocumentFragment; +export { condition as wrapCondition } + export function render(code: () => any, mount: MountableElement): () => void { let dispose: () => void; root(disposer => { diff --git a/src/runtime.d.ts b/src/runtime.d.ts index 0931dcd..9002328 100644 --- a/src/runtime.d.ts +++ b/src/runtime.d.ts @@ -1,8 +1,8 @@ -export function template(html: string, isSVG?: boolean): Element; -export function wrap(fn: (prev?: T) => T): any; +export function template(html: string, count: number, isSVG?: boolean): Element; +export function wrap(fn: (prev?: T) => T, init?: T): any; export function wrapCondition(fn: () => any): () => any; export function insert( - parent: Element | Document | ShadowRoot | DocumentFragment, + parent: Element | Document | ShadowRoot | DocumentFragment | Node, accessor: any, init?: any, marker?: Node @@ -27,17 +27,18 @@ export function classList( ): void; export function currentContext(): any; export function renderToString( - fn: (done?: () => void) => any, + fn: (done?: (rendered: any) => void) => any, options?: { timeoutMs?: number; } ): Promise; export function hydrate( fn: () => unknown, - node: Element | Document | ShadowRoot | DocumentFragment + node: Element | Document | ShadowRoot | DocumentFragment | Node ): void; export function getNextElement( template: HTMLTemplateElement, isSSR: boolean ): Node; export function getNextMarker(start: Node): [Node, Array]; +export function generateHydrationEventsScript(eventNames: string[]): string; diff --git a/src/runtime.js b/src/runtime.js index 82121bb..f87a315 100644 --- a/src/runtime.js +++ b/src/runtime.js @@ -1,5 +1,5 @@ import { Attributes, SVGAttributes, NonComposedEvents } from 'dom-expressions'; -import { effect as wrap, condition as wrapCondition } from './core';; +import { effect as wrap } from './core';; import { untracked as ignore } from 'mobx';; @@ -7,12 +7,12 @@ import { untracked as ignore } from 'mobx';; const eventRegistry = new Set(); const config = {}; -export { wrap, wrapCondition }; +export { wrap }; -export function template(html, isSVG) { +export function template(html, check, isSVG) { const t = document.createElement('template'); t.innerHTML = html; - if (t.innerHTML !== html) throw new Error(`Template html does not match input:\n${t.innerHTML}\n${html}`); + if (check && t.innerHTML.split("<").length - 1 !== check) console.warn(`Template html does not match input:\n${t.innerHTML}\n\n${html}`); let node = t.content.firstChild; if (isSVG) node = node.firstChild; return node; @@ -52,9 +52,9 @@ export function classList(node, value, prev) { const classKeys = Object.keys(value); for (let i = 0, len = classKeys.length; i < len; i++) { const key = classKeys[i], - classValue = value[key], + classValue = !!value[key], classNames = key.split(/\s+/); - if (prev && prev[key] === classValue) continue; + if (!key || prev && prev[key] === classValue) continue; for (let j = 0, nameLen = classNames.length; j < nameLen; j++) node.classList.toggle(classNames[j], classValue); } @@ -68,26 +68,24 @@ export function spread(node, accessor, isSVG, skipChildren) { export function insert(parent, accessor, marker, initial) { if (marker !== undefined && !initial) initial = []; - if (typeof accessor === 'function') - wrap((current = initial) => insertExpression(parent, accessor(), current, marker)); - else if (Array.isArray(accessor) && checkDynamicArray(accessor)) { - wrap((current = initial) => insertExpression(parent, accessor, current, marker)); - } else { - return insertExpression(parent, accessor, initial, marker); - } + if (typeof accessor !== 'function') return insertExpression(parent, accessor, initial, marker); + wrap(current => insertExpression(parent, accessor(), current, marker), initial); } // SSR export function renderToString(code, options = {}) { - options = { timeoutMs: 10000, ...options } + options = { timeoutMs: 30000, ...options } config.hydrate = { id: '', count: 0 }; const container = document.createElement("div"); - return new Promise(resolve => { - setTimeout(() => resolve(container.innerHTML), options.timeoutMs); - if (!code.length) { - insert(container, code()); + document.body.appendChild(container); + return new Promise((resolve, reject) => { + setTimeout(() => reject("renderToString timed out"), options.timeoutMs); + function render(rendered) { + insert(container, rendered); resolve(container.innerHTML); - } else insert(container, code(() => resolve(container.innerHTML))); + document.body.removeChild(container); + } + !code.length ? render(code()) : code(render); }); } @@ -148,6 +146,12 @@ export function runHydrationEvents(id) { } } +export function generateHydrationEventsScript(eventNames) { + return `!function(){function t(t){const e=function t(e){return e&&(e.getAttribute("_hk")||t(e.host&&e.host instanceof Node?e.host:e.parentNode))}(t.composedPath&&t.composedPath()[0]||t.target);e&&!window._$HYDRATION.completed.has(e)&&window._$HYDRATION.events.push([e,t])}window._$HYDRATION={events:[],completed:new Set},["${eventNames.join( + '","' + )}"].forEach(e=>document.addEventListener(e,t))}();`; +} + // Internal Functions function dynamicProp(props, key) { const src = props[key]; @@ -157,10 +161,6 @@ function dynamicProp(props, key) { }); } -function lookup(el) { - return el && (el.model || lookup(el.host || el.parentNode)); -} - function eventHandler(e) { const key = `__${e.type}`; let node = (e.composedPath && e.composedPath()[0]) || e.target; @@ -181,8 +181,8 @@ function eventHandler(e) { while (node !== null) { const handler = node[key]; if (handler) { - const model = handler.length > 1 ? lookup(node): undefined; - handler(e, model); + const data = node[`${key}Data`]; + data ? handler(data, e): handler(e); if (e.cancelBubble) return; } node = (node.host && node.host instanceof Node) ? node.host : node.parentNode; @@ -212,16 +212,22 @@ function spreadExpression(node, props, prevProps = {}, isSVG, skipChildren) { // really only for forwarding from Components, can't forward normal ref } else if (prop === "ref" || prop === "forwardRef") { value(node); + } else if (prop === "on") { + for (const eventName in value) + node.addEventListener(eventName, value[eventName]); + } else if (prop === "onCapture") { + for (const eventName in value) + node.addEventListener(eventName, value[eventName], true); } else if (prop.slice(0, 2) === "on") { const lc = prop.toLowerCase(); - if (lc !== prop && !NonComposedEvents.has(lc.slice(2))) { + if (!NonComposedEvents.has(lc.slice(2))) { const name = lc.slice(2); - node[`__${name}`] = value; + if (Array.isArray(value)) { + node[`__${name}`] = value[0]; + node[`__${name}Data`] = value[1]; + } else node[`__${name}`] = value; delegateEvents([name]); } else node[lc] = value; - } else if (prop === "events") { - for (const eventName in value) - node.addEventListener(eventName, value[eventName]); } else if ((info = Attributes[prop])) { if (info.type === "attribute") { node.setAttribute(prop, value); @@ -242,7 +248,8 @@ function spreadExpression(node, props, prevProps = {}, isSVG, skipChildren) { return prevProps; } -function normalizeIncomingArray(normalized, array) { +function normalizeIncomingArray(normalized, array, unwrap) { + let dynamic = false; for (let i = 0, len = array.length; i < len; i++) { let item = array[i], t; if (item instanceof Node) { @@ -250,15 +257,20 @@ function normalizeIncomingArray(normalized, array) { } else if (item == null || item === true || item === false) { // matches null, undefined, true or false // skip } else if (Array.isArray(item)) { - normalizeIncomingArray(normalized, item); + dynamic = normalizeIncomingArray(normalized, item) || dynamic; } else if ((t = typeof item) === 'string') { normalized.push(document.createTextNode(item)); } else if (t === 'function') { - const idx = item(); - normalizeIncomingArray(normalized, Array.isArray(idx) ? idx : [idx]); + if (unwrap) { + const idx = item(); + dynamic = normalizeIncomingArray(normalized, Array.isArray(idx) ? idx : [idx]) || dynamic; + } else { + normalized.push(item); + dynamic = true; + } } else normalized.push(document.createTextNode(item.toString())); } - return normalized; + return dynamic; } function appendNodes(parent, array, marker) { @@ -275,16 +287,8 @@ function cleanChildren(parent, current, marker, replacement) { return [node]; } -function checkDynamicArray(array) { - for (let i = 0, len = array.length; i < len; i++) { - const item = array[i]; - if (Array.isArray(item) && checkDynamicArray(item) || typeof item === 'function') return true; - } - return false; -} - -function insertExpression(parent, value, current, marker) { - if (typeof current === "function") current = current(); +function insertExpression(parent, value, current, marker, unwrapArray) { + while (typeof current === "function") current = current(); if (value === current) return current; const t = typeof value, multi = marker !== undefined; @@ -310,7 +314,11 @@ function insertExpression(parent, value, current, marker) { wrap(() => current = insertExpression(parent, value(), current, marker)); return () => current; } else if (Array.isArray(value)) { - const array = normalizeIncomingArray([], value); + const array = []; + if (normalizeIncomingArray(array, value, unwrapArray)) { + wrap(() => current = insertExpression(parent, array, current, marker, true)); + return () => current; + }; if (config.hydrate && config.hydrate.registry) return current; if (array.length === 0) { current = cleanChildren(parent, current, marker); @@ -340,212 +348,85 @@ function insertExpression(parent, value, current, marker) { return current; } -// Picked from -// https://github.com/adamhaile/surplus/blob/master/src/runtime/content.ts#L368 -var NOMATCH = -1 - -// reconcile the content of parent from ns to us -// see ivi's excellent writeup of diffing arrays in a vdom library: -// https://github.com/ivijs/ivi/blob/2c81ead934b9128e092cc2a5ef2d3cabc73cb5dd/packages/ivi/src/vdom/implementation.ts#L1187 -// this code isn't identical, since we're diffing real dom nodes to nodes-or-strings, -// but the core methodology of trimming ends and reversals, matching nodes, then using -// the longest increasing subsequence to minimize DOM ops is inspired by ivi. -function reconcileArrays(parent, ns, us) { - var ulen = us.length, - // n = nodes, u = updates - // ranges defined by min and max indices - nmin = 0, - nmax = ns.length - 1, - umin = 0, - umax = ulen - 1, - // start nodes of ranges - n = ns[nmin], - u = us[umin], - // end nodes of ranges - nx = ns[nmax], - ux = us[umax], - // node, if any, just after ux, used for doing .insertBefore() to put nodes at end - ul = nx.nextSibling, - i, j, k, - loop = true; - - // scan over common prefixes, suffixes, and simple reversals - fixes: while (loop) { - loop = false; - - // common prefix, u === n - while (u === n) { - umin++; - nmin++; - if (umin > umax || nmin > nmax) break fixes; - u = us[umin]; - n = ns[nmin]; - } - - // common suffix, ux === nx - while (ux === nx) { - ul = nx; - umax--; - nmax--; - if (umin > umax || nmin > nmax) break fixes; - ux = us[umax]; - nx = ns[nmax]; - } - - // reversal u === nx, have to swap node forward - while (u === nx) { - loop = true; - parent.insertBefore(nx, n); - umin++; - nmax--; - if (umin > umax || nmin > nmax) break fixes; - u = us[umin]; - nx = ns[nmax]; - } - - // reversal ux === n, have to swap node back - while (ux === n) { - loop = true; - if (ul === null) parent.appendChild(n); - else parent.insertBefore(n, ul); - ul = n; - umax--; - nmin++; - if (umin > umax || nmin > nmax) break fixes; - ux = us[umax]; - n = ns[nmin]; - } - } - - // if that covered all updates, just need to remove any remaining nodes and we're done - if (umin > umax) { - // remove any remaining nodes - while (nmin <= nmax) { - parent.removeChild(ns[nmax]); - nmax--; - } - return; - } - - // if that covered all current nodes, just need to insert any remaining updates and we're done - if (nmin > nmax) { - // insert any remaining nodes - while (umin <= umax) { - parent.insertBefore(us[umin], ul); - umin++; - } - return; - } - - // Positions for reusing nodes from current DOM state - const P = new Array(umax - umin + 1), - I = new Map(); - for(let i = umin; i <= umax; i++) { - P[i] = NOMATCH; - I.set(us[i], i); - } - - let reusingNodes = umin + us.length - 1 - umax, - toRemove = [] - - for(let i = nmin; i <= nmax; i++) { - if (I.has(ns[i])) { - P[I.get(ns[i])] = i - reusingNodes++ - } else toRemove.push(i) - } - - // Fast path for full replace - if (reusingNodes === 0) { - if (n !== parent.firstChild || nx !== parent.lastChild) { - for (i = nmin; i <= nmax; i++) parent.removeChild(ns[i]); - while (umin <= umax) { - parent.insertBefore(us[umin], ul); - umin++ +/* +Slightly modified version of: https://github.com/WebReflection/udomdiff/blob/master/index.js +*/ +function reconcileArrays(parentNode, a, b) { + let bLength = b.length, + aEnd = a.length, + bEnd = bLength, + aStart = 0, + bStart = 0, + after = a[aEnd - 1].nextSibling, + map = null; + + while (aStart < aEnd || bStart < bEnd) { + // append + if (aEnd === aStart) { + const node = + bEnd < bLength + ? bStart + ? b[bStart - 1].nextSibling + : b[bEnd - bStart] + : after; + + while (bStart < bEnd) parentNode.insertBefore(b[bStart++], node); + // remove + } else if (bEnd === bStart) { + while (aStart < aEnd) { + if (!map || !map.has(a[aStart])) parentNode.removeChild(a[aStart]); + aStart++; } - return; - } - // no nodes preserved, use fast clear and append - parent.textContent = ''; - while (umin <= umax) { - parent.appendChild(us[umin]); - umin++; - } - return; - } - - // find longest common sequence between ns and us, represented as the indices - // of the longest increasing subsequence in src - var lcs = longestPositiveIncreasingSubsequence(P, umin), - nodes = [], - tmp = ns[nmin], lisIdx = lcs.length - 1, tmpB;; - - // Collect nodes to work with them - for(let i = nmin; i <= nmax; i++) { - nodes[i] = tmp; - tmp = tmp.nextSibling; - } - - for(let i = 0; i < toRemove.length; i++) parent.removeChild(nodes[toRemove[i]]) - - for(let i = umax; i >= umin; i--) { - if(lcs[lisIdx] === i) { - ul = nodes[P[lcs[lisIdx]]] - lisIdx-- + // common prefix + } else if (a[aStart] === b[bStart]) { + aStart++; + bStart++; + // common suffix + } else if (a[aEnd - 1] === b[bEnd - 1]) { + aEnd--; + bEnd--; + // swap forward + } else if (aEnd - aStart === 1 && bEnd - bStart === 1) { + if (map && map.has(a[aStart])) { + parentNode.insertBefore(b[bStart], bEnd < bLength ? b[bEnd] : after); + } else parentNode.replaceChild(b[bStart], a[aStart]); + break; + // swap backward + } else if (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]) { + const node = a[--aEnd].nextSibling; + parentNode.insertBefore(b[bStart++], a[aStart++].nextSibling); + parentNode.insertBefore(b[--bEnd], node); + + a[aEnd] = b[bEnd]; + // fallback to map } else { - tmpB = (P[i] === NOMATCH) ? us[i] : nodes[P[i]]; - parent.insertBefore(tmpB, ul) - ul = tmpB - } - } -} + if (!map) { + map = new Map(); + let i = bStart; -// return an array of the indices of ns that comprise the longest increasing subsequence within ns -function longestPositiveIncreasingSubsequence(ns, newStart) { - let seq = [], - is = [], - l = -1, - pre = new Array(ns.length); - - for (let i = newStart, len = ns.length; i < len; i++) { - let n = ns[i]; - if (n < 0) continue; - let j = findGreatestIndexLEQ(seq, n); - if (j !== -1) pre[i] = is[j]; - if (j === l) { - l++; - seq[l] = n; - is[l] = i; - } else if (n < seq[j + 1]) { - seq[j + 1] = n; - is[j + 1] = i; - } - } - - for (let i = is[l]; l >= 0; i = pre[i], l--) { - seq[l] = i; - } + while (i < bEnd) map.set(b[i], i++); + } - return seq; -} + if (map.has(a[aStart])) { + const index = map.get(a[aStart]); -function findGreatestIndexLEQ(seq, n) { - // invariant: lo is guaranteed to be index of a value <= n, hi to be > - // therefore, they actually start out of range: (-1, last + 1) - var lo = -1, - hi = seq.length; + if (bStart < index && index < bEnd) { + let i = aStart, + sequence = 1; - // fast path for simple increasing sequences - if (hi > 0 && seq[hi - 1] <= n) return hi - 1; + while (++i < aEnd && i < bEnd) { + if (!map.has(a[i]) || map.get(a[i]) !== index + sequence) break; + sequence++; + } - while (hi - lo > 1) { - var mid = Math.floor((lo + hi) / 2); - if (seq[mid] > n) { - hi = mid; - } else { - lo = mid; + if (sequence > index - bStart) { + const node = a[aStart]; + while (bStart < index) parentNode.insertBefore(b[bStart++], node); + } else parentNode.replaceChild(b[bStart++], a[aStart++]); + } else aStart++; + } else parentNode.removeChild(a[aStart++]); } } - return lo; + return b; } \ No newline at end of file From bbc8e795343742d9266025a6bf34614de1fc2fdc Mon Sep 17 00:00:00 2001 From: Ryan Carniato Date: Fri, 15 May 2020 03:53:09 -0700 Subject: [PATCH 09/38] Update to latest --- .prettierrc | 8 + dom-expressions.config.js | 11 - package-lock.json | 46 +- package.json | 12 +- rollup.config.js | 11 +- src/core.ts | 275 +--------- src/h.ts | 22 +- src/html.ts | 17 +- src/index.ts | 35 +- src/jsx.ts | 1057 +++++++++++++++++++++++++++++++++++++ src/lib.ts | 303 +++++++++++ src/runtime.d.ts | 69 ++- src/runtime.js | 433 +-------------- 13 files changed, 1472 insertions(+), 827 deletions(-) create mode 100644 .prettierrc delete mode 100644 dom-expressions.config.js create mode 100644 src/jsx.ts create mode 100644 src/lib.ts diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..00441c4 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,8 @@ +{ + "trailingComma": "none", + "tabWidth": 2, + "semi": true, + "singleQuote": false, + "arrowParens": "avoid", + "printWidth": 100 +} \ No newline at end of file diff --git a/dom-expressions.config.js b/dom-expressions.config.js deleted file mode 100644 index 5149a25..0000000 --- a/dom-expressions.config.js +++ /dev/null @@ -1,11 +0,0 @@ -module.exports = { - output: 'src/runtime.js', - includeTypes: true, - variables: { - imports: [ - `import { effect as wrap } from './core';`, - `import { untracked as ignore } from 'mobx';` - ], - classComponents: true - } -} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 57b42f1..ef997e2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "mobx-jsx", - "version": "0.10.0", + "version": "0.11.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -311,6 +311,12 @@ "color-convert": "^1.9.0" } }, + "babel-plugin-transform-rename-import": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-rename-import/-/babel-plugin-transform-rename-import-2.3.0.tgz", + "integrity": "sha512-dPgJoT57XC0PqSnLgl2FwNvxFrWlspatX2dkk7yjKQj5HHGw071vAcOf+hqW8ClqcBDMvEbm6mevn5yHAD8mlQ==", + "dev": true + }, "builtin-modules": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.1.0.tgz", @@ -362,20 +368,14 @@ } }, "dom-expressions": { - "version": "0.17.0", - "resolved": "https://registry.npmjs.org/dom-expressions/-/dom-expressions-0.17.0.tgz", - "integrity": "sha512-HKSgoodRFJbLeLlBU7slqHYESQ7FPmQFykyYHR9GyfrR160lPFg8H8toSfc6C7djr7mAqZYjqTy2szWtvWTtyg==", + "version": "0.18.1", + "resolved": "https://registry.npmjs.org/dom-expressions/-/dom-expressions-0.18.1.tgz", + "integrity": "sha512-GeMyI8cyzkbcNTW1Tkqw/z0/dBAvlp94I2wm6hcVXIzFecDavataCJlNUs2vRGiU033iUDhvRDZFMaecXmdd4Q==", "dev": true, "requires": { - "ejs": "^3.0.1" + "babel-plugin-transform-rename-import": "^2.3.0" } }, - "ejs": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.0.1.tgz", - "integrity": "sha512-cuIMtJwxvzumSAkqaaoGY/L6Fc/t6YvoP9/VIaK0V/CyqKLEQ8sqODmYfy/cjXEdZ9+OOL8TecbJu+1RsofGDw==", - "dev": true - }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -389,9 +389,9 @@ "dev": true }, "fsevents": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.2.tgz", - "integrity": "sha512-R4wDiBwZ0KzpgOWetKDug1FZcYhqYnUYKtfZYt4mD5SBz76q0KR4Q9o7GIPamsVPGmW3EYPPJ0dOOjvx32ldZA==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", + "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", "dev": true, "optional": true }, @@ -414,9 +414,9 @@ "dev": true }, "hyper-dom-expressions": { - "version": "0.17.0", - "resolved": "https://registry.npmjs.org/hyper-dom-expressions/-/hyper-dom-expressions-0.17.0.tgz", - "integrity": "sha512-NhOy+U+t4wHrONgTPmDl0y84J2iJwsURz6kkGeQ/EihoQ7uZFmMLGx28nUbs4x2YfGdKuL8gYYLw3m0dtSzPyQ==", + "version": "0.18.2", + "resolved": "https://registry.npmjs.org/hyper-dom-expressions/-/hyper-dom-expressions-0.18.2.tgz", + "integrity": "sha512-6rYMBQLmrRVMsZz/FffhsUMA6S3EGd15qq5DfBhbsG+vZxIKlYU30STZ7d8cJtnxFHAh4EkBqRiEIDAY3rs/gA==", "dev": true }, "is-module": { @@ -447,9 +447,9 @@ } }, "lit-dom-expressions": { - "version": "0.17.0", - "resolved": "https://registry.npmjs.org/lit-dom-expressions/-/lit-dom-expressions-0.17.0.tgz", - "integrity": "sha512-Jdbf0wrGB9aNrgayR1dLsguWtASiX3yfyq+NNs5ZH+G1lpdHi2Tqk4ohaKiHd+HJpqOTxZWvSnsW4LHhChCqFg==", + "version": "0.18.1", + "resolved": "https://registry.npmjs.org/lit-dom-expressions/-/lit-dom-expressions-0.18.1.tgz", + "integrity": "sha512-8uMZcdn3S4H2NzLiPFngAR6bH1VMHnazR80YlFXjR5BX+6ZDn3kv7FMR/YKrG7+9UNbXIdQh5BuOH/FfaqRwPQ==", "dev": true }, "lodash": { @@ -498,9 +498,9 @@ } }, "rollup": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.1.0.tgz", - "integrity": "sha512-gfE1455AEazVVTJoeQtcOq/U6GSxwoj4XPSWVsuWmgIxj7sBQNLDOSA82PbdMe+cP8ql8fR1jogPFe8Wg8g4SQ==", + "version": "2.10.2", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.10.2.tgz", + "integrity": "sha512-tivFM8UXBlYOUqpBYD3pRktYpZvK/eiCQ190eYlrAyrpE/lzkyG2gbawroNdbwmzyUc7Y4eT297xfzv0BDh9qw==", "dev": true, "requires": { "fsevents": "~2.1.2" diff --git a/package.json b/package.json index aa842bc..e45cf89 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "mobx-jsx", "description": "Raw MobX performance without the restraints of a Virtual DOM", - "version": "0.10.0", + "version": "0.11.0", "author": "Ryan Carniato", "license": "MIT", "repository": { @@ -12,18 +12,18 @@ "main": "lib/index.js", "types": "types/index.d.ts", "scripts": { - "build": "dom-expressions && rollup -c && tsc && ncp ./src/runtime.d.ts ./types/runtime.d.ts", + "build": "rollup -c && tsc && ncp ./src/runtime.d.ts ./types/runtime.d.ts", "prepublishOnly": "npm run build" }, "devDependencies": { "@babel/core": "7.9.0", "@babel/preset-typescript": "7.9.0", - "dom-expressions": "0.17.0", - "hyper-dom-expressions": "0.17.0", - "lit-dom-expressions": "0.17.0", + "dom-expressions": "0.18.1", + "hyper-dom-expressions": "~0.18.2", + "lit-dom-expressions": "~0.18.1", "mobx": "^5.15.4", "ncp": "2.0.0", - "rollup": "^2.1.0", + "rollup": "^2.10.2", "rollup-plugin-babel": "4.4.0", "@rollup/plugin-node-resolve": "7.1.1", "typescript": "3.8.3" diff --git a/rollup.config.js b/rollup.config.js index 895c65e..1d0c1c2 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -8,8 +8,15 @@ const plugins = [ babel({ extensions: ['.js', '.ts'], presets: ["@babel/preset-typescript"], - exclude: 'node_modules/**', - retainLines: true + plugins: [ + [ + "babel-plugin-transform-rename-import", + { + original: "rxcore", + replacement: "../../../src/core" + } + ] + ] }) ]; diff --git a/src/core.ts b/src/core.ts index 5bab766..175f81c 100644 --- a/src/core.ts +++ b/src/core.ts @@ -1,267 +1,8 @@ -import { autorun, computed, untracked, $mobx, IObservableArray, observable } from "mobx"; - -type ContextOwner = { - disposables: any[]; - owner: ContextOwner | null; - context?: any; -}; -export interface Context { - id: symbol; - Provider: (props: any) => any; - defaultValue: unknown; -} - -let globalContext: ContextOwner | null = null; - -export class Component { - isClassComponent?: boolean; - props: T; - constructor(props: T) { - this.props = props; - } - render(props: T) { return props.children } -} -Component.prototype.isClassComponent = true; - -export function root(fn: (dispose: () => void) => T) { - let d: any[], ret: T; - globalContext = { - disposables: d = [], - owner: globalContext - }; - ret = untracked(() => - fn(() => { - let k, len: number; - for (k = 0, len = d.length; k < len; k++) d[k](); - d = []; - }) - ); - globalContext = globalContext.owner; - return ret; -} - -export function cleanup(fn: () => void) { - let ref; - (ref = globalContext) != null && ref.disposables.push(fn); -} - -export function effect(fn: (prev?: T) => T) { - let current: T, d: any[]; - const context = { - disposables: d = [], - owner: globalContext - }, - dispose = autorun(() => { - for (let k = 0, len = d.length; k < len; k++) d[k](); - d = []; - globalContext = context; - current = fn(current); - globalContext = globalContext.owner; - }); - cleanup(() => { - for (let k = 0, len = d.length; k < len; k++) d[k](); - dispose(); - }); -} - -// only updates when boolean expression changes -export function condition(fn: () => T) { - const o = observable.box(untracked(fn)); - effect(prev => { - const res = fn(); - prev !== res && o.set(res); - return res; - }) - return () => o.get(); -} - -// dynamic import to support code splitting -export function lazy(fn: () => Promise<{ default: T }>) { - return (props: object) => { - let Comp: T; - const result = observable.box(); - fn().then(component => result.set(component.default)); - const rendered = computed( - () => (Comp = result.get()) && untracked(() => Comp(props)) - ); - return () => rendered.get(); - }; -} - -// context api -export function createContext(defaultValue?: unknown): Context { - const id = Symbol("context"); - return { id, Provider: createProvider(id), defaultValue }; -} - -export function useContext(context: Context) { - return lookup(globalContext, context.id) || context.defaultValue; -} - -function lookup(owner: ContextOwner | null, key: symbol | string): any { - return ( - owner && - ((owner.context && owner.context[key]) || - (owner.owner && lookup(owner.owner, key))) - ); -} - -function resolveChildren(children: any): any { - if (typeof children === "function") { - const c = observable.box(); - effect(() => c.set(children())); - return () => c.get(); - } - if (Array.isArray(children)) { - const results: any[] = []; - for (let i = 0; i < children.length; i++) { - let result = resolveChildren(children[i]); - Array.isArray(result) - ? results.push.apply(results, result) - : results.push(result); - } - return results; - } - return children; -} - -function createProvider(id: symbol) { - return function provider(props: { value: unknown; children: any }) { - let rendered = observable.box(); - effect(() => { - globalContext!.context = { [id]: props.value }; - rendered.set(untracked(() => resolveChildren(props.children))); - }); - return () => rendered.get(); - }; -} - -// Modified version of mapSample from S-array[https://github.com/adamhaile/S-array] by Adam Haile -export function map( - list: IObservableArray & { [$mobx]: any }, - mapFn: (v: T, i: number) => U | any -) { - let items = [] as T[], - mapped = [] as U[], - disposers = [] as (() => void)[], - len = 0; - cleanup(() => { - for (let i = 0, length = disposers.length; i < length; i++) disposers[i](); - }); - return () => { - list[$mobx].atom.reportObserved(); - let newItems = list, - i: number, - j: number; - return untracked(() => { - let newLen = newItems.length, - newIndices: Map, - newIndicesNext: number[], - temp: U[], - tempdisposers: (() => void)[], - start: number, - end: number, - newEnd: number, - item: T; - - // fast path for empty arrays - if (newLen === 0) { - if (len !== 0) { - for (i = 0; i < len; i++) disposers[i](); - disposers = []; - items = []; - mapped = []; - len = 0; - } - } else if (len === 0) { - for (j = 0; j < newLen; j++) { - items[j] = newItems[j]; - mapped[j] = root(mapper); - } - len = newLen; - } else { - temp = new Array(newLen); - tempdisposers = new Array(newLen); - - // skip common prefix - for ( - start = 0, end = Math.min(len, newLen); - start < end && items[start] === newItems[start]; - start++ - ); - - // common suffix - for ( - end = len - 1, newEnd = newLen - 1; - end >= start && newEnd >= start && items[end] === newItems[newEnd]; - end--, newEnd-- - ) { - temp[newEnd] = mapped[end]; - tempdisposers[newEnd] = disposers[end]; - } - - // remove any remaining nodes and we're done - if (start > newEnd) { - for (j = end; start <= j; j--) disposers[j](); - const rLen = end - start + 1; - if (rLen > 0) { - mapped.splice(start, rLen); - disposers.splice(start, rLen); - } - items = newItems.slice(0); - len = newLen; - return mapped; - } - - // insert any remaining updates and we're done - if (start > end) { - for (j = start; j <= newEnd; j++) mapped[j] = root(mapper); - for (; j < newLen; j++) { - mapped[j] = temp[j]; - disposers[j] = tempdisposers[j]; - } - items = newItems.slice(0); - len = newLen; - return mapped; - } - - // 0) prepare a map of all indices in newItems, scanning backwards so we encounter them in natural order - newIndices = new Map(); - newIndicesNext = new Array(newEnd + 1); - for (j = newEnd; j >= start; j--) { - item = newItems[j]; - i = newIndices.get(item)!; - newIndicesNext[j] = i === undefined ? -1 : i; - newIndices.set(item, j); - } - // 1) step through all old items and see if they can be found in the new set; if so, save them in a temp array and mark them moved; if not, exit them - for (i = start; i <= end; i++) { - item = items[i]; - j = newIndices.get(item)!; - if (j !== undefined && j !== -1) { - temp[j] = mapped[i]; - tempdisposers[j] = disposers[i]; - j = newIndicesNext[j]; - newIndices.set(item, j); - } else disposers[i](); - } - // 2) set all the new values, pulling from the temp array if copied, otherwise entering the new value - for (j = start; j < newLen; j++) { - if (j in temp) { - mapped[j] = temp[j]; - disposers[j] = tempdisposers[j]; - } else mapped[j] = root(mapper); - } - // 3) in case the new set is shorter than the old, set the length of the mapped array - len = mapped.length = newLen; - // 4) save a copy of the mapped items for the next update - items = newItems.slice(0); - } - return mapped; - }); - function mapper(disposer: () => void) { - disposers[j] = disposer; - return mapFn(newItems[j], j); - } - }; -} +export { + root, + effect, + memo, + createComponent +} from "./lib" + +export const currentContext = {}; diff --git a/src/h.ts b/src/h.ts index 1c2c6d5..f2b5dd1 100644 --- a/src/h.ts +++ b/src/h.ts @@ -1,18 +1,12 @@ -/// -import { createHyperScript } from 'hyper-dom-expressions'; -import { - wrap, - insert, - createComponent, - delegateEvents, - classList -} from './index'; +import { createHyperScript } from "hyper-dom-expressions"; +import { spread, assign, insert, createComponent, delegateEvents } from "./index"; -export * from './index'; export const h = createHyperScript({ - wrap, + spread, + assign, insert, createComponent, - delegateEvents, - classList -}); \ No newline at end of file + delegateEvents +}); + +export * from './index'; \ No newline at end of file diff --git a/src/html.ts b/src/html.ts index b274b30..dffbf0e 100644 --- a/src/html.ts +++ b/src/html.ts @@ -1,18 +1,13 @@ -/// import { createHTML } from 'lit-dom-expressions'; -import { - wrap, - insert, - createComponent, - delegateEvents, - classList -} from './index'; +import { effect, style, insert, createComponent, delegateEvents, classList } from "./index"; -export * from './index'; export const html = createHTML({ - wrap, + effect, + style, insert, createComponent, delegateEvents, classList -}); \ No newline at end of file +}); + +export * from './index'; \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index 7e3da5e..b82282d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,36 +1,7 @@ -export * from "./core"; +export { root, cleanup, lazy, createContext, useContext, map } from "./lib"; +export type { Context, Component } from "./lib"; export * from "./runtime"; -import { root, condition } from "./core"; -import { insert, hydrate as hydr, renderToString as rTS } from "./runtime"; -type MountableElement = Element | Document | ShadowRoot | DocumentFragment; +import "./jsx" -export { condition as wrapCondition } -export function render(code: () => any, mount: MountableElement): () => void { - let dispose: () => void; - root(disposer => { - dispose = disposer; - insert(mount, code()); - }); - return dispose!; -} - -export function renderToString(code: () => any): Promise { - return root(dispose => { - const p = rTS(code); - dispose(); - return p; - }); -} - -export function hydrate( - code: () => any, - element: MountableElement -): () => void { - let disposer: () => void; - hydr(() => { - disposer = render(code, element); - }, element); - return disposer!; -} diff --git a/src/jsx.ts b/src/jsx.ts new file mode 100644 index 0000000..754ee29 --- /dev/null +++ b/src/jsx.ts @@ -0,0 +1,1057 @@ +declare global { + /** + * Forked from `https://github.com/adamhaile/surplus` and adapted for `babel-plugin-jsx-dom-expressions`. + * + * @onceee https://github.com/adamhaile/surplus/blob/master/index.d.ts + * @onceee https://github.com/ryansolid/dom-expressions + */ + + namespace JSX { + type Element = + | Node + | ArrayElement + | FunctionElement + | string + | number + | boolean + | undefined; + + interface ArrayElement extends Array {} + interface FunctionElement { + (): Element; + } + + // Let TS know the name of the `children` property in order for it to be able to type check them. + // https://github.com/Microsoft/TypeScript/issues/18357 + interface ElementChildrenAttribute { + children: {}; + } + + interface EventHandler { + (e: E & { currentTarget: T; target: T }): void; + } + + interface BoundEventHandler { + 0: (data: any, e: E & { currentTarget: T; target: T }) => void; + 1: any + } + + type EventHandlerUnion = EventHandler | BoundEventHandler; + + // Intrinsic attributes enable us to define certain keys as attributes on an element, while + // at the same time hiding them from the element's `props`. + // https://github.com/Microsoft/TypeScript/issues/5478 + interface IntrinsicAttributes { + ref?: HTMLElement | ((e: HTMLElement) => void); + } + + // https://github.com/ryansolid/babel-plugin-jsx-dom-expressions#special-binding + interface CustomAttributes { + ref?: T | ((el: T) => void); + classList?: { [k: string]: boolean | undefined }; + on?: { [key: string]: EventHandler }; + onCapture?: { [key: string]: EventHandler }; + } + + // https://github.com/ryansolid/babel-plugin-jsx-dom-expressions#oneventname + interface DOMAttributes extends CustomAttributes { + children?: Element; + innerHTML?: string; + innerText?: string; + textContent?: string; + + // Clipboard Events + onCopy?: EventHandlerUnion; + onCut?: EventHandlerUnion; + onPaste?: EventHandlerUnion; + + // Composition Events + onCompositionEnd?: EventHandlerUnion; + onCompositionStart?: EventHandlerUnion; + onCompositionUpdate?: EventHandlerUnion; + + // Focus Events + onFocus?: EventHandlerUnion; + onBlur?: EventHandlerUnion; + + // Form Events + onChange?: EventHandlerUnion; + onInput?: EventHandlerUnion; + onReset?: EventHandlerUnion; + onSubmit?: EventHandlerUnion; + + // Image Events + onLoad?: EventHandlerUnion; + onError?: EventHandlerUnion; // also a Media Event + + // Keyboard Events + onKeyDown?: EventHandlerUnion; + onKeyPress?: EventHandlerUnion; + onKeyUp?: EventHandlerUnion; + + // Pointer Events + onGotPointerCapture?: EventHandlerUnion; + onLostPointerCapture?: EventHandlerUnion; + onPointerCancel?: EventHandlerUnion; + onPointerDown?: EventHandlerUnion; + onPointerEnter?: EventHandlerUnion; + onPointerLeave?: EventHandlerUnion; + onPointerMove?: EventHandlerUnion; + onPointerOver?: EventHandlerUnion; + onPointerOut?: EventHandlerUnion; + onPointerUp?: EventHandlerUnion; + + // Media Events + onAbort?: EventHandlerUnion; + onCanPlay?: EventHandlerUnion; + onCanPlayThrough?: EventHandlerUnion; + onDurationChange?: EventHandlerUnion; + onEmptied?: EventHandlerUnion; + onEncrypted?: EventHandlerUnion; + onEnded?: EventHandlerUnion; + onLoadedData?: EventHandlerUnion; + onLoadedMetadata?: EventHandlerUnion; + onLoadStart?: EventHandlerUnion; + onPause?: EventHandlerUnion; + onPlay?: EventHandlerUnion; + onPlaying?: EventHandlerUnion; + onProgress?: EventHandlerUnion; + onRateChange?: EventHandlerUnion; + onSeeked?: EventHandlerUnion; + onSeeking?: EventHandlerUnion; + onStalled?: EventHandlerUnion; + onSuspend?: EventHandlerUnion; + onTimeUpdate?: EventHandlerUnion; + onVolumeChange?: EventHandlerUnion; + onWaiting?: EventHandlerUnion; + + // MouseEvents + onClick?: EventHandlerUnion; + onContextMenu?: EventHandlerUnion; + onDoubleClick?: EventHandlerUnion; + onDrag?: EventHandlerUnion; + onDragEnd?: EventHandlerUnion; + onDragEnter?: EventHandlerUnion; + onDragExit?: EventHandlerUnion; + onDragLeave?: EventHandlerUnion; + onDragOver?: EventHandlerUnion; + onDragStart?: EventHandlerUnion; + onDrop?: EventHandlerUnion; + onMouseDown?: EventHandlerUnion; + onMouseEnter?: EventHandlerUnion; + onMouseLeave?: EventHandlerUnion; + onMouseMove?: EventHandlerUnion; + onMouseOut?: EventHandlerUnion; + onMouseOver?: EventHandlerUnion; + onMouseUp?: EventHandlerUnion; + + // Selection Events + onSelect?: EventHandlerUnion; + + // Touch Events + onTouchCancel?: EventHandlerUnion; + onTouchEnd?: EventHandlerUnion; + onTouchMove?: EventHandlerUnion; + onTouchStart?: EventHandlerUnion; + + // UI Events + onScroll?: EventHandlerUnion; + + // Wheel Events + onWheel?: EventHandlerUnion; + + // Animation Events + onAnimationStart?: EventHandlerUnion; + onAnimationEnd?: EventHandlerUnion; + onAnimationIteration?: EventHandlerUnion; + + // Transition Events + onTransitionEnd?: EventHandlerUnion; + } + + type HTMLAutocapitalize = + | "off" + | "none" + | "on" + | "sentences" + | "words" + | "characters"; + + type HTMLDir = "ltr" | "rtl" | "auto"; + + type HTMLFormEncType = + | "application/x-www-form-urlencoded" + | "multipart/form-data" + | "text/plain"; + + type HTMLFormMethod = "post" | "get" | "dialog"; + + type HTMLCrossorigin = "anonymous" | "use-credentials" | ""; + + type HTMLReferrerPolicy = + | "no-referrer" + | "no-referrer-when-downgrade" + | "origin" + | "origin-when-cross-origin" + | "same-origin" + | "strict-origin" + | "strict-origin-when-cross-origin" + | "unsafe-url"; + + type HTMLIframeSandbox = + | "allow-downloads-without-user-activation" + | "allow-forms" + | "allow-modals" + | "allow-orientation-lock" + | "allow-pointer-lock" + | "allow-popups" + | "allow-popups-to-escape-sandbox" + | "allow-presentation" + | "allow-same-origin" + | "allow-scripts" + | "allow-storage-access-by-user-activation" + | "allow-top-navigation" + | "allow-top-navigation-by-user-activation"; + + type HTMLLinkAs = + | "audio" + | "document" + | "embed" + | "fetch" + | "font" + | "image" + | "object" + | "script" + | "style" + | "track" + | "video" + | "worker"; + + interface HTMLAttributes extends DOMAttributes { + // Standard HTML Attributes + accessKey?: string; + className?: string; + class?: string; + contentEditable?: boolean | "inherit"; + contextMenu?: string; + dir?: HTMLDir; + draggable?: boolean; + hidden?: boolean; + id?: string; + lang?: string; + spellcheck?: boolean; + style?: Partial | string; + tabIndex?: number | string; + tabindex?: number | string; + title?: string; + translate?: "yes" | "no"; + + // RDFa Attributes + about?: string; + datatype?: string; + inlist?: any; + prefix?: string; + property?: string; + resource?: string; + typeof?: string; + vocab?: string; + + // Non-standard Attributes + autoCapitalize?: HTMLAutocapitalize; + color?: string; + itemProp?: string; + itemScope?: boolean; + itemType?: string; + itemId?: string; + itemRef?: string; + } + + // HTML Elements + + interface AnchorHTMLAttributes extends HTMLAttributes { + download?: any; + href?: string; + hreflang?: string; + media?: string; + ping?: string; + referrerPolicy?: HTMLReferrerPolicy; + rel?: string; + target?: string; + type?: string; + } + + interface AudioHTMLAttributes extends MediaHTMLAttributes {} + + interface AreaHTMLAttributes extends HTMLAttributes { + alt?: string; + coords?: string; + download?: any; + href?: string; + hreflang?: string; + ping?: string; + referrerPolicy?: HTMLReferrerPolicy; + rel?: string; + shape?: "rect" | "circle" | "poly" | "default"; + target?: string; + } + + interface BaseHTMLAttributes extends HTMLAttributes { + href?: string; + target?: string; + } + + interface BlockquoteHTMLAttributes extends HTMLAttributes { + cite?: string; + } + + interface ButtonHTMLAttributes extends HTMLAttributes { + autofocus?: boolean; + disabled?: boolean; + form?: string; + formAction?: string; + formEnctype?: HTMLFormEncType; + formMethod?: HTMLFormMethod; + formNoValidate?: boolean; + formTarget?: string; + name?: string; + type?: "submit" | "reset" | "button"; + value?: string; + } + + interface CanvasHTMLAttributes extends HTMLAttributes { + width?: number | string; + height?: number | string; + } + + interface ColHTMLAttributes extends HTMLAttributes { + span?: number | string; + width?: number | string; + } + + interface ColgroupHTMLAttributes extends HTMLAttributes { + span?: number | string; + } + + interface DataHTMLAttributes extends HTMLAttributes { + value?: string | string[] | number; + } + + interface DetailsHtmlAttributes extends HTMLAttributes { + open?: boolean; + } + + interface DialogHtmlAttributes extends HTMLAttributes { + open?: boolean; + } + + interface EmbedHTMLAttributes extends HTMLAttributes { + height?: number | string; + src?: string; + type?: string; + width?: number | string; + } + + interface FieldsetHTMLAttributes extends HTMLAttributes { + disabled?: boolean; + form?: string; + name?: string; + } + + interface FormHTMLAttributes extends HTMLAttributes { + acceptCharset?: string; + action?: string; + autocomplete?: string; + encoding?: HTMLFormEncType; + enctype?: HTMLFormEncType; + method?: HTMLFormMethod; + name?: string; + noValidate?: boolean; + target?: string; + } + + interface IframeHTMLAttributes extends HTMLAttributes { + allow?: string; + allowfullscreen?: boolean; + height?: number | string; + name?: string; + referrerPolicy?: HTMLReferrerPolicy; + sandbox?: HTMLIframeSandbox; + src?: string; + srcdoc?: string; + width?: number | string; + } + + interface ImgHTMLAttributes extends HTMLAttributes { + alt?: string; + crossOrigin?: HTMLCrossorigin; + decoding?: "sync" | "async" | "auto"; + height?: number | string; + referrerPolicy?: HTMLReferrerPolicy; + sizes?: string; + src?: string; + srcset?: string; + width?: number | string; + } + + interface InputHTMLAttributes extends HTMLAttributes { + accept?: string; + alt?: string; + autocomplete?: string; + autofocus?: boolean; + capture?: boolean | string; + checked?: boolean; + crossOrigin?: HTMLCrossorigin; + disabled?: boolean; + form?: string; + formAction?: string; + formEnctype?: HTMLFormEncType; + formMethod?: HTMLFormMethod; + formNoValidate?: boolean; + formTarget?: string; + height?: number | string; + list?: string; + max?: number | string; + maxLength?: number | string; + min?: number | string; + minLength?: number | string; + multiple?: boolean; + name?: string; + pattern?: string; + placeholder?: string; + readOnly?: boolean; + required?: boolean; + size?: number | string; + src?: string; + step?: number | string; + type?: string; + value?: string | string[] | number; + width?: number | string; + } + + interface InsHTMLAttributes extends HTMLAttributes { + cite?: string; + dateTime?: string; + } + + interface KeygenHTMLAttributes extends HTMLAttributes { + autofocus?: boolean; + challenge?: string; + disabled?: boolean; + form?: string; + keytype?: string; + keyparams?: string; + name?: string; + } + + interface LabelHTMLAttributes extends HTMLAttributes { + htmlFor?: string; + for?: string; + form?: string; + } + + interface LiHTMLAttributes extends HTMLAttributes { + value?: number | string; + } + + interface LinkHTMLAttributes extends HTMLAttributes { + as?: HTMLLinkAs; + crossOrigin?: HTMLCrossorigin; + disabled?: boolean; + href?: string; + hreflang?: string; + integrity?: string; + media?: string; + referrerPolicy?: HTMLReferrerPolicy; + rel?: string; + sizes?: string; + type?: string; + } + + interface MapHTMLAttributes extends HTMLAttributes { + name?: string; + } + + interface MediaHTMLAttributes extends HTMLAttributes { + autoplay?: boolean; + controls?: boolean; + crossOrigin?: HTMLCrossorigin; + loop?: boolean; + mediaGroup?: string; + muted?: boolean; + preload?: "none" | "metadata" | "auto" | ""; + src?: string; + } + + interface MenuHTMLAttributes extends HTMLAttributes { + label?: string; + type?: "context" | "toolbar"; + } + + interface MetaHTMLAttributes extends HTMLAttributes { + charset?: string; + content?: string; + httpEquiv?: string; + name?: string; + } + + interface MeterHTMLAttributes extends HTMLAttributes { + form?: string; + high?: number | string; + low?: number | string; + max?: number | string; + min?: number | string; + optimum?: number | string; + value?: string | string[] | number; + } + + interface QuoteHTMLAttributes extends HTMLAttributes { + cite?: string; + } + + interface ObjectHTMLAttributes extends HTMLAttributes { + data?: string; + form?: string; + height?: number | string; + name?: string; + type?: string; + useMap?: string; + width?: number | string; + } + + interface OlHTMLAttributes extends HTMLAttributes { + reversed?: boolean; + start?: number | string; + type?: "1" | "a" | "A" | "i" | "I"; + } + + interface OptgroupHTMLAttributes extends HTMLAttributes { + disabled?: boolean; + label?: string; + } + + interface OptionHTMLAttributes extends HTMLAttributes { + disabled?: boolean; + label?: string; + selected?: boolean; + value?: string | string[] | number; + } + + interface OutputHTMLAttributes extends HTMLAttributes { + form?: string; + htmlFor?: string; + name?: string; + } + + interface ParamHTMLAttributes extends HTMLAttributes { + name?: string; + value?: string | string[] | number; + } + + interface ProgressHTMLAttributes extends HTMLAttributes { + max?: number | string; + value?: string | string[] | number; + } + + interface ScriptHTMLAttributes extends HTMLAttributes { + async?: boolean; + charset?: string; + crossOrigin?: HTMLCrossorigin; + defer?: boolean; + integrity?: string; + noModule?: boolean; + nonce?: string; + referrerPolicy?: HTMLReferrerPolicy; + src?: string; + type?: string; + } + + interface SelectHTMLAttributes extends HTMLAttributes { + autocomplete?: string; + autofocus?: boolean; + disabled?: boolean; + form?: string; + multiple?: boolean; + name?: string; + required?: boolean; + size?: number | string; + value?: string | string[] | number; + } + + interface HTMLSlotElementAttributes extends HTMLAttributes { + name?: string; + } + + interface SourceHTMLAttributes extends HTMLAttributes { + media?: string; + sizes?: string; + src?: string; + srcset?: string; + type?: string; + } + + interface StyleHTMLAttributes extends HTMLAttributes { + media?: string; + nonce?: string; + scoped?: boolean; + type?: string; + } + + interface TdHTMLAttributes extends HTMLAttributes { + colSpan?: number | string; + headers?: string; + rowSpan?: number | string; + } + + interface TextareaHTMLAttributes extends HTMLAttributes { + autocomplete?: string; + autofocus?: boolean; + cols?: number | string; + dirname?: string; + disabled?: boolean; + form?: string; + maxLength?: number | string; + minLength?: number | string; + name?: string; + placeholder?: string; + readOnly?: boolean; + required?: boolean; + rows?: number | string; + value?: string | string[] | number; + wrap?: "hard" | "soft" | "off"; + } + + interface ThHTMLAttributes extends HTMLAttributes { + colSpan?: number | string; + headers?: string; + rowSpan?: number | string; + } + + interface TimeHTMLAttributes extends HTMLAttributes { + dateTime?: string; + } + + interface TrackHTMLAttributes extends HTMLAttributes { + default?: boolean; + kind?: + | "subtitles" + | "captions" + | "descriptions" + | "chapters" + | "metadata"; + label?: string; + src?: string; + srclang?: string; + } + + interface VideoHTMLAttributes extends MediaHTMLAttributes { + height?: number | string; + playsinline?: boolean; + poster?: string; + width?: number | string; + } + + // SVG Elements + interface SVGAttributes extends HTMLAttributes { + accumulate?: "none" | "sum"; + additive?: "replace" | "sum"; + alignmentBaseline?: + | "auto" + | "baseline" + | "before-edge" + | "text-before-edge" + | "middle" + | "central" + | "after-edge" + | "text-after-edge" + | "ideographic" + | "alphabetic" + | "hanging" + | "mathematical" + | "inherit"; + allowReorder?: "no" | "yes"; + amplitude?: number | string; + attributeName?: string; + attributeType?: string; + autoReverse?: number | string; + azimuth?: number | string; + baseFrequency?: number | string; + baselineShift?: number | string; + baseProfile?: number | string; + begin?: number | string; + bias?: number | string; + by?: number | string; + calcMode?: number | string; + clip?: number | string; + clipPath?: string; + clipPathUnits?: number | string; + clipRule?: number | string; + colorInterpolation?: number | string; + colorInterpolationFilters?: "auto" | "sRGB" | "linearRGB" | "inherit"; + colorProfile?: number | string; + colorRendering?: number | string; + contentScriptType?: number | string; + contentStyleType?: number | string; + cursor?: number | string; + cx?: number | string; + cy?: number | string; + d?: string; + decelerate?: number | string; + diffuseConstant?: number | string; + direction?: number | string; + display?: number | string; + divisor?: number | string; + dominantBaseline?: number | string; + dur?: number | string; + dx?: number | string; + dy?: number | string; + edgeMode?: number | string; + elevation?: number | string; + enableBackground?: number | string; + end?: number | string; + exponent?: number | string; + externalResourcesRequired?: number | string; + fill?: string; + fillOpacity?: number | string; + fillRule?: "nonzero" | "evenodd" | "inherit"; + filter?: string; + filterRes?: number | string; + filterUnits?: number | string; + floodColor?: number | string; + floodOpacity?: number | string; + focusable?: number | string; + fontFamily?: string; + fontSize?: number | string; + fontSizeAdjust?: number | string; + fontStretch?: number | string; + fontStyle?: number | string; + fontVariant?: number | string; + fontWeight?: number | string; + format?: number | string; + from?: number | string; + fx?: number | string; + fy?: number | string; + glyphOrientationHorizontal?: number | string; + glyphOrientationVertical?: number | string; + glyphRef?: number | string; + gradientTransform?: string; + gradientUnits?: string; + height?: number | string; + href?: string; + hreflang?: string; + imageRendering?: number | string; + in2?: number | string; + in?: string; + intercept?: number | string; + k1?: number | string; + k2?: number | string; + k3?: number | string; + k4?: number | string; + kernelMatrix?: number | string; + kernelUnitLength?: number | string; + kerning?: number | string; + keyPoints?: number | string; + keySplines?: number | string; + keyTimes?: number | string; + lengthAdjust?: number | string; + letterSpacing?: number | string; + lightingColor?: number | string; + limitingConeAngle?: number | string; + markerEnd?: string; + markerHeight?: number | string; + markerMid?: string; + markerStart?: string; + markerUnits?: number | string; + markerWidth?: number | string; + mask?: string; + maskContentUnits?: number | string; + maskUnits?: number | string; + max?: number | string; + media?: string; + method?: string; + min?: number | string; + mode?: number | string; + name?: string; + numOctaves?: number | string; + offset?: number | string; + opacity?: number | string; + operator?: number | string; + order?: number | string; + orient?: number | string; + origin?: number | string; + overflow?: number | string; + paintOrder?: number | string; + pathLength?: number | string; + patternContentUnits?: string; + patternTransform?: number | string; + patternUnits?: string; + pointerEvents?: number | string; + points?: string; + pointsAtX?: number | string; + pointsAtY?: number | string; + pointsAtZ?: number | string; + preserveAlpha?: number | string; + preserveAspectRatio?: string; + primitiveUnits?: number | string; + r?: number | string; + radius?: number | string; + refX?: number | string; + refY?: number | string; + rel?: string; + repeatCount?: number | string; + repeatDur?: number | string; + requiredExtensions?: number | string; + requiredFeatures?: number | string; + restart?: number | string; + result?: string; + rotate?: number | string; + rx?: number | string; + ry?: number | string; + scale?: number | string; + seed?: number | string; + shapeRendering?: number | string; + spacing?: number | string; + specularConstant?: number | string; + specularExponent?: number | string; + speed?: number | string; + spreadMethod?: string; + startOffset?: number | string; + stdDeviation?: number | string; + stitchTiles?: number | string; + stopColor?: string; + stopOpacity?: number | string; + string?: number | string; + stroke?: string; + strokeDasharray?: string | number; + strokeDashoffset?: string | number; + strokeLinecap?: "butt" | "round" | "square" | "inherit"; + strokeLinejoin?: "miter" | "round" | "bevel" | "inherit"; + strokeMiterlimit?: number | string; + strokeOpacity?: number | string; + strokeWidth?: number | string; + surfaceScale?: number | string; + systemLanguage?: number | string; + tableValues?: number | string; + target?: string; + targetX?: number | string; + targetY?: number | string; + textAnchor?: string; + textDecoration?: number | string; + textLength?: number | string; + textRendering?: number | string; + to?: number | string; + transform?: string; + type?: string; + unicodeBidi?: number | string; + values?: string; + vectorEffect?: number | string; + version?: string; + viewBox?: string; + viewTarget?: number | string; + visibility?: number | string; + width?: number | string; + wordSpacing?: number | string; + writingMode?: number | string; + x1?: number | string; + x2?: number | string; + x?: number | string; + xChannelSelector?: string; + xlinkActuate?: string; + xlinkArcrole?: string; + xlinkHref?: string; + xlinkRole?: string; + xlinkShow?: string; + xlinkTitle?: string; + xlinkType?: string; + xmlBase?: string; + xmlLang?: string; + xmlns?: string; + xmlnsXlink?: string; + xmlSpace?: string; + y1?: number | string; + y2?: number | string; + y?: number | string; + yChannelSelector?: string; + z?: number | string; + zoomAndPan?: string; + } + + interface IntrinsicElements { + // HTML + a: AnchorHTMLAttributes; + abbr: HTMLAttributes; + address: HTMLAttributes; + area: AreaHTMLAttributes; + article: HTMLAttributes; + aside: HTMLAttributes; + audio: AudioHTMLAttributes; + b: HTMLAttributes; + base: BaseHTMLAttributes; + bdi: HTMLAttributes; + bdo: HTMLAttributes; + big: HTMLAttributes; + blockquote: BlockquoteHTMLAttributes; + body: HTMLAttributes; + br: HTMLAttributes; + button: ButtonHTMLAttributes; + canvas: CanvasHTMLAttributes; + caption: HTMLAttributes; + cite: HTMLAttributes; + code: HTMLAttributes; + col: ColHTMLAttributes; + colgroup: ColgroupHTMLAttributes; + data: DataHTMLAttributes; + datalist: HTMLAttributes; + dd: HTMLAttributes; + del: HTMLAttributes; + details: DetailsHtmlAttributes; + dfn: HTMLAttributes; + dialog: DialogHtmlAttributes; + div: HTMLAttributes; + dl: HTMLAttributes; + dt: HTMLAttributes; + em: HTMLAttributes; + embed: EmbedHTMLAttributes; + fieldset: FieldsetHTMLAttributes; + figcaption: HTMLAttributes; + figure: HTMLAttributes; + footer: HTMLAttributes; + form: FormHTMLAttributes; + h1: HTMLAttributes; + h2: HTMLAttributes; + h3: HTMLAttributes; + h4: HTMLAttributes; + h5: HTMLAttributes; + h6: HTMLAttributes; + head: HTMLAttributes; + header: HTMLAttributes; + hgroup: HTMLAttributes; + hr: HTMLAttributes; + html: HTMLAttributes; + i: HTMLAttributes; + iframe: IframeHTMLAttributes; + img: ImgHTMLAttributes; + input: InputHTMLAttributes; + ins: InsHTMLAttributes; + kbd: HTMLAttributes; + keygen: KeygenHTMLAttributes; + label: LabelHTMLAttributes; + legend: HTMLAttributes; + li: LiHTMLAttributes; + link: LinkHTMLAttributes; + main: HTMLAttributes; + map: MapHTMLAttributes; + mark: HTMLAttributes; + menu: MenuHTMLAttributes; + menuitem: HTMLAttributes; + meta: MetaHTMLAttributes; + meter: MeterHTMLAttributes; + nav: HTMLAttributes; + noindex: HTMLAttributes; + noscript: HTMLAttributes; + object: ObjectHTMLAttributes; + ol: OlHTMLAttributes; + optgroup: OptgroupHTMLAttributes; + option: OptionHTMLAttributes; + output: OutputHTMLAttributes; + p: HTMLAttributes; + param: ParamHTMLAttributes; + picture: HTMLAttributes; + pre: HTMLAttributes; + progress: ProgressHTMLAttributes; + q: HTMLAttributes; + rp: HTMLAttributes; + rt: HTMLAttributes; + ruby: HTMLAttributes; + s: HTMLAttributes; + samp: HTMLAttributes; + script: ScriptHTMLAttributes; + section: HTMLAttributes; + select: SelectHTMLAttributes; + slot: HTMLSlotElementAttributes; + small: HTMLAttributes; + source: SourceHTMLAttributes; + span: HTMLAttributes; + strong: HTMLAttributes; + style: StyleHTMLAttributes; + sub: HTMLAttributes; + summary: HTMLAttributes; + sup: HTMLAttributes; + table: HTMLAttributes; + tbody: HTMLAttributes; + td: TdHTMLAttributes; + textarea: TextareaHTMLAttributes; + tfoot: HTMLAttributes; + th: HTMLAttributes; + thead: HTMLAttributes; + time: TimeHTMLAttributes; + title: HTMLAttributes; + tr: HTMLAttributes; + track: TrackHTMLAttributes; + u: HTMLAttributes; + ul: HTMLAttributes; + var: HTMLAttributes; + video: VideoHTMLAttributes; + wbr: HTMLAttributes; + + // SVG + svg: SVGAttributes; + + animate: SVGAttributes; + animateTransform: SVGAttributes; + circle: SVGAttributes; + clipPath: SVGAttributes; + defs: SVGAttributes; + desc: SVGAttributes; + ellipse: SVGAttributes; + feBlend: SVGAttributes; + feColorMatrix: SVGAttributes; + feComponentTransfer: SVGAttributes; + feComposite: SVGAttributes; + feConvolveMatrix: SVGAttributes; + feDiffuseLighting: SVGAttributes; + feDisplacementMap: SVGAttributes; + feDistantLight: SVGAttributes; + feFlood: SVGAttributes; + feFuncA: SVGAttributes; + feFuncB: SVGAttributes; + feFuncG: SVGAttributes; + feFuncR: SVGAttributes; + feGaussianBlur: SVGAttributes; + feImage: SVGAttributes; + feMerge: SVGAttributes; + feMergeNode: SVGAttributes; + feMorphology: SVGAttributes; + feOffset: SVGAttributes; + fePointLight: SVGAttributes; + feSpecularLighting: SVGAttributes; + feSpotLight: SVGAttributes; + feTile: SVGAttributes; + feTurbulence: SVGAttributes; + filter: SVGAttributes; + foreignObject: SVGAttributes; + g: SVGAttributes; + image: SVGAttributes; + line: SVGAttributes; + linearGradient: SVGAttributes; + marker: SVGAttributes; + mask: SVGAttributes; + metadata: SVGAttributes; + path: SVGAttributes; + pattern: SVGAttributes; + polygon: SVGAttributes; + polyline: SVGAttributes; + radialGradient: SVGAttributes; + rect: SVGAttributes; + stop: SVGAttributes; + switch: SVGAttributes; + symbol: SVGAttributes; + text: SVGAttributes; + textPath: SVGAttributes; + tspan: SVGAttributes; + use: SVGAttributes; + view: SVGAttributes; + } + } +} + +export {}; diff --git a/src/lib.ts b/src/lib.ts new file mode 100644 index 0000000..0ae3304 --- /dev/null +++ b/src/lib.ts @@ -0,0 +1,303 @@ +import { autorun, computed, untracked, $mobx, IObservableArray, observable } from "mobx"; + +type ContextOwner = { + disposables: any[]; + owner: ContextOwner | null; + context?: any; +}; +export interface Context { + id: symbol; + Provider: (props: any) => any; + defaultValue: unknown; +} + +let globalContext: ContextOwner | null = null; + +export class Component { + isClassComponent?: boolean; + props: T; + constructor(props: T) { + this.props = props; + } + render(props: T) { return props.children } +} +Component.prototype.isClassComponent = true; + +export function root(fn: (dispose: () => void) => T) { + let d: any[], ret: T; + globalContext = { + disposables: d = [], + owner: globalContext + }; + ret = untracked(() => + fn(() => { + let k, len: number; + for (k = 0, len = d.length; k < len; k++) d[k](); + d = []; + }) + ); + globalContext = globalContext.owner; + return ret; +} + +export function cleanup(fn: () => void) { + let ref; + (ref = globalContext) != null && ref.disposables.push(fn); +} + +export function effect(fn: (prev?: T) => T) { + let current: T, d: any[]; + const context = { + disposables: d = [], + owner: globalContext + }, + dispose = autorun(() => { + for (let k = 0, len = d.length; k < len; k++) d[k](); + d = []; + globalContext = context; + current = fn(current); + globalContext = globalContext.owner; + }); + cleanup(() => { + for (let k = 0, len = d.length; k < len; k++) d[k](); + dispose(); + }); +} + +// only updates when boolean expression changes +export function memo(fn: () => T, equal: boolean) { + if (typeof fn !== "function") return fn; + const o = observable.box(untracked(fn)); + effect(prev => { + const res = fn(); + (!equal || prev !== res) && o.set(res); + return res; + }) + return () => o.get(); +} + +type PropsWithChildren

= P & { children?: JSX.Element }; +export type FunctionComponent

= (props: PropsWithChildren

) => JSX.Element; + +type PossiblyWrapped = { + [P in keyof T]: T[P] | (() => T[P]); +}; + +function dynamicProperty(props: any, key: string) { + const src = props[key]; + Object.defineProperty(props, key, { + get() { + return src(); + }, + enumerable: true, + }); +} + +export function createComponent( + Comp: Component & FunctionComponent, + props: PossiblyWrapped, + dynamicKeys?: (keyof T)[] +): JSX.Element { + if (dynamicKeys) { + for (let i = 0; i < dynamicKeys.length; i++) + dynamicProperty(props, dynamicKeys[i] as string); + } + if (Comp.prototype && Comp.prototype.isClassComponent) { + return untracked(() => { + const comp: Component = new (Comp as any)(props as T); + return comp.render(props as T); + }); + } + return untracked(() => Comp(props as T)); +} + +// dynamic import to support code splitting +export function lazy(fn: () => Promise<{ default: T }>) { + return (props: object) => { + let Comp: T; + const result = observable.box(); + fn().then(component => result.set(component.default)); + const rendered = computed( + () => (Comp = result.get()) && untracked(() => Comp(props)) + ); + return () => rendered.get(); + }; +} + +// context api +export function createContext(defaultValue?: unknown): Context { + const id = Symbol("context"); + return { id, Provider: createProvider(id), defaultValue }; +} + +export function useContext(context: Context) { + return lookup(globalContext, context.id) || context.defaultValue; +} + +function lookup(owner: ContextOwner | null, key: symbol | string): any { + return ( + owner && + ((owner.context && owner.context[key]) || + (owner.owner && lookup(owner.owner, key))) + ); +} + +function resolveChildren(children: any): any { + if (typeof children === "function") { + const c = observable.box(); + effect(() => c.set(children())); + return () => c.get(); + } + if (Array.isArray(children)) { + const results: any[] = []; + for (let i = 0; i < children.length; i++) { + let result = resolveChildren(children[i]); + Array.isArray(result) + ? results.push.apply(results, result) + : results.push(result); + } + return results; + } + return children; +} + +function createProvider(id: symbol) { + return function provider(props: { value: unknown; children: any }) { + let rendered = observable.box(); + effect(() => { + globalContext!.context = { [id]: props.value }; + rendered.set(untracked(() => resolveChildren(props.children))); + }); + return () => rendered.get(); + }; +} + +// Modified version of mapSample from S-array[https://github.com/adamhaile/S-array] by Adam Haile +export function map( + list: IObservableArray & { [$mobx]: any }, + mapFn: (v: T, i: number) => U | any +) { + let items = [] as T[], + mapped = [] as U[], + disposers = [] as (() => void)[], + len = 0; + cleanup(() => { + for (let i = 0, length = disposers.length; i < length; i++) disposers[i](); + }); + return () => { + list[$mobx].atom.reportObserved(); + let newItems = list, + i: number, + j: number; + return untracked(() => { + let newLen = newItems.length, + newIndices: Map, + newIndicesNext: number[], + temp: U[], + tempdisposers: (() => void)[], + start: number, + end: number, + newEnd: number, + item: T; + + // fast path for empty arrays + if (newLen === 0) { + if (len !== 0) { + for (i = 0; i < len; i++) disposers[i](); + disposers = []; + items = []; + mapped = []; + len = 0; + } + } else if (len === 0) { + for (j = 0; j < newLen; j++) { + items[j] = newItems[j]; + mapped[j] = root(mapper); + } + len = newLen; + } else { + temp = new Array(newLen); + tempdisposers = new Array(newLen); + + // skip common prefix + for ( + start = 0, end = Math.min(len, newLen); + start < end && items[start] === newItems[start]; + start++ + ); + + // common suffix + for ( + end = len - 1, newEnd = newLen - 1; + end >= start && newEnd >= start && items[end] === newItems[newEnd]; + end--, newEnd-- + ) { + temp[newEnd] = mapped[end]; + tempdisposers[newEnd] = disposers[end]; + } + + // remove any remaining nodes and we're done + if (start > newEnd) { + for (j = end; start <= j; j--) disposers[j](); + const rLen = end - start + 1; + if (rLen > 0) { + mapped.splice(start, rLen); + disposers.splice(start, rLen); + } + items = newItems.slice(0); + len = newLen; + return mapped; + } + + // insert any remaining updates and we're done + if (start > end) { + for (j = start; j <= newEnd; j++) mapped[j] = root(mapper); + for (; j < newLen; j++) { + mapped[j] = temp[j]; + disposers[j] = tempdisposers[j]; + } + items = newItems.slice(0); + len = newLen; + return mapped; + } + + // 0) prepare a map of all indices in newItems, scanning backwards so we encounter them in natural order + newIndices = new Map(); + newIndicesNext = new Array(newEnd + 1); + for (j = newEnd; j >= start; j--) { + item = newItems[j]; + i = newIndices.get(item)!; + newIndicesNext[j] = i === undefined ? -1 : i; + newIndices.set(item, j); + } + // 1) step through all old items and see if they can be found in the new set; if so, save them in a temp array and mark them moved; if not, exit them + for (i = start; i <= end; i++) { + item = items[i]; + j = newIndices.get(item)!; + if (j !== undefined && j !== -1) { + temp[j] = mapped[i]; + tempdisposers[j] = disposers[i]; + j = newIndicesNext[j]; + newIndices.set(item, j); + } else disposers[i](); + } + // 2) set all the new values, pulling from the temp array if copied, otherwise entering the new value + for (j = start; j < newLen; j++) { + if (j in temp) { + mapped[j] = temp[j]; + disposers[j] = tempdisposers[j]; + } else mapped[j] = root(mapper); + } + // 3) in case the new set is shorter than the old, set the length of the mapped array + len = mapped.length = newLen; + // 4) save a copy of the mapped items for the next update + items = newItems.slice(0); + } + return mapped; + }); + function mapper(disposer: () => void) { + disposers[j] = disposer; + return mapFn(newItems[j], j); + } + }; +} diff --git a/src/runtime.d.ts b/src/runtime.d.ts index 9002328..b0ad50a 100644 --- a/src/runtime.d.ts +++ b/src/runtime.d.ts @@ -1,44 +1,55 @@ +type MountableElement = Element | Document | ShadowRoot | DocumentFragment | Node; +export function render(code: () => any, element: MountableElement): () => void +export function renderToString( + fn: (done?: (rendered: any) => void) => any, + options?: { + timeoutMs?: number; + } +): Promise; +export function renderDOMToString( + fn: (done?: (rendered: any) => void) => any, + options?: { + timeoutMs?: number; + } +): Promise; +export function hydrate( + fn: () => unknown, + node: MountableElement +): void; + export function template(html: string, count: number, isSVG?: boolean): Element; -export function wrap(fn: (prev?: T) => T, init?: T): any; -export function wrapCondition(fn: () => any): () => any; +export function effect(fn: (prev?: T) => T, init?: T): any; +export function memo(fn: () => T, equal: boolean): () => T; export function insert( - parent: Element | Document | ShadowRoot | DocumentFragment | Node, + parent: MountableElement, accessor: any, init?: any, - marker?: Node -): any; -export function createComponent( - Comp: (props: any) => any, - props: any, - dynamicKeys?: string[] + marker?: Node | null ): any; +export function createComponent(Comp: (props: any) => any, props: any, dynamicKeys?: string[]): any; export function delegateEvents(eventNames: string[]): void; export function clearDelegatedEvents(): void; -export function spread( - node: Element, - accessor: any, - isSVG?: Boolean, - skipChildren?: Boolean -): void; +export function spread(node: Element, accessor: any, isSVG?: Boolean, skipChildren?: Boolean): void; +export function assign(node: Element, props: any, isSVG?: Boolean, skipChildren?: Boolean): void; export function classList( node: Element, value: { [k: string]: boolean }, prev?: { [k: string]: boolean } ): void; -export function currentContext(): any; -export function renderToString( - fn: (done?: (rendered: any) => void) => any, - options?: { - timeoutMs?: number; - } -): Promise; -export function hydrate( - fn: () => unknown, - node: Element | Document | ShadowRoot | DocumentFragment | Node +export function style( + node: Element, + value: { [k: string]: string }, + prev?: { [k: string]: string } ): void; -export function getNextElement( - template: HTMLTemplateElement, - isSSR: boolean -): Node; +export function currentContext(): any; + +export function ssr(template: TemplateStringsArray, ...nodes: any[]): () => string; +export function ssrClassList(value: { [k: string]: boolean }): string; +export function ssrStyle(value: { [k: string]: string }): string; +export function ssrSpread(accessor: any, isSVG: boolean, skipChildren: boolean): () => string; +export function escape(html: string): string; + +export function getHydrationKey(): string; +export function getNextElement(template: HTMLTemplateElement, isSSR: boolean): Node; export function getNextMarker(start: Node): [Node, Array]; export function generateHydrationEventsScript(eventNames: string[]): string; diff --git a/src/runtime.js b/src/runtime.js index f87a315..65e55b7 100644 --- a/src/runtime.js +++ b/src/runtime.js @@ -1,432 +1 @@ -import { Attributes, SVGAttributes, NonComposedEvents } from 'dom-expressions'; -import { effect as wrap } from './core';; -import { untracked as ignore } from 'mobx';; - - - -const eventRegistry = new Set(); -const config = {}; - -export { wrap }; - -export function template(html, check, isSVG) { - const t = document.createElement('template'); - t.innerHTML = html; - if (check && t.innerHTML.split("<").length - 1 !== check) console.warn(`Template html does not match input:\n${t.innerHTML}\n\n${html}`); - let node = t.content.firstChild; - if (isSVG) node = node.firstChild; - return node; -} - -export function createComponent(Comp, props, dynamicKeys) { - if (dynamicKeys) { - for (let i = 0; i < dynamicKeys.length; i++) dynamicProp(props, dynamicKeys[i]); - } - - if (Comp.prototype && Comp.prototype.isClassComponent) { - return ignore(() => { - const comp = new Comp(props); - return comp.render(props); - }); - } - - return ignore(() => Comp(props)); -} - -export function delegateEvents(eventNames) { - for (let i = 0, l = eventNames.length; i < l; i++) { - const name = eventNames[i]; - if (!eventRegistry.has(name)) { - eventRegistry.add(name); - document.addEventListener(name, eventHandler); - } - } -} - -export function clearDelegatedEvents() { - for (let name of eventRegistry.keys()) document.removeEventListener(name, eventHandler); - eventRegistry.clear(); -} - -export function classList(node, value, prev) { - const classKeys = Object.keys(value); - for (let i = 0, len = classKeys.length; i < len; i++) { - const key = classKeys[i], - classValue = !!value[key], - classNames = key.split(/\s+/); - if (!key || prev && prev[key] === classValue) continue; - for (let j = 0, nameLen = classNames.length; j < nameLen; j++) - node.classList.toggle(classNames[j], classValue); - } -} - -export function spread(node, accessor, isSVG, skipChildren) { - if (typeof accessor === 'function') { - wrap(current => spreadExpression(node, accessor(), current, isSVG, skipChildren)); - } else spreadExpression(node, accessor, undefined, isSVG, skipChildren); -} - -export function insert(parent, accessor, marker, initial) { - if (marker !== undefined && !initial) initial = []; - if (typeof accessor !== 'function') return insertExpression(parent, accessor, initial, marker); - wrap(current => insertExpression(parent, accessor(), current, marker), initial); -} - -// SSR -export function renderToString(code, options = {}) { - options = { timeoutMs: 30000, ...options } - config.hydrate = { id: '', count: 0 }; - const container = document.createElement("div"); - document.body.appendChild(container); - return new Promise((resolve, reject) => { - setTimeout(() => reject("renderToString timed out"), options.timeoutMs); - function render(rendered) { - insert(container, rendered); - resolve(container.innerHTML); - document.body.removeChild(container); - } - !code.length ? render(code()) : code(render); - }); -} - -export function hydrate(code, root) { - config.hydrate = { id: '', count: 0, registry: new Map() }; - const templates = root.querySelectorAll(`*[_hk]`); - for (let i = 0; i < templates.length; i++) { - const node = templates[i]; - config.hydrate.registry.set(node.getAttribute('_hk'), node); - } - code(); - delete config.hydrate; -} - -export function getNextElement(template, isSSR) { - const hydrate = config.hydrate; - let node, key; - if (!hydrate || !hydrate.registry || !(node = hydrate.registry.get(key = `${hydrate.id}:${hydrate.count++}`))) { - const el = template.cloneNode(true); - if (isSSR && hydrate) - el.setAttribute('_hk', `${hydrate.id}:${hydrate.count++}`); - return el; - } - if (window && window._$HYDRATION) window._$HYDRATION.completed.add(key); - return node; -} - -export function getNextMarker(start) { - let end = start, - count = 0, - current = []; - if (config.hydrate && config.hydrate.registry) { - while (end) { - if (end.nodeType === 8) { - const v = end.nodeValue; - if (v === "#") count++; - else if (v === "/") { - if (count === 0) return [end, current]; - count--; - } - } - current.push(end); - end = end.nextSibling; - } - } - return [end, current]; -} - -export function runHydrationEvents(id) { - if (window && window._$HYDRATION) { - const { completed, events } = window._$HYDRATION; - while (events.length) { - const [id, e] = events[0]; - if (!completed.has(id)) return; - eventHandler(e); - events.shift(); - } - } -} - -export function generateHydrationEventsScript(eventNames) { - return `!function(){function t(t){const e=function t(e){return e&&(e.getAttribute("_hk")||t(e.host&&e.host instanceof Node?e.host:e.parentNode))}(t.composedPath&&t.composedPath()[0]||t.target);e&&!window._$HYDRATION.completed.has(e)&&window._$HYDRATION.events.push([e,t])}window._$HYDRATION={events:[],completed:new Set},["${eventNames.join( - '","' - )}"].forEach(e=>document.addEventListener(e,t))}();`; -} - -// Internal Functions -function dynamicProp(props, key) { - const src = props[key]; - Object.defineProperty(props, key, { - get() { return src(); }, - enumerable: true - }); -} - -function eventHandler(e) { - const key = `__${e.type}`; - let node = (e.composedPath && e.composedPath()[0]) || e.target; - // reverse Shadow DOM retargetting - if (e.target !== node) { - Object.defineProperty(e, 'target', { - configurable: true, - value: node - }) - } - - // simulate currentTarget - Object.defineProperty(e, 'currentTarget', { - configurable: true, - get() { return node; } - }) - - while (node !== null) { - const handler = node[key]; - if (handler) { - const data = node[`${key}Data`]; - data ? handler(data, e): handler(e); - if (e.cancelBubble) return; - } - node = (node.host && node.host instanceof Node) ? node.host : node.parentNode; - } -} - -function spreadExpression(node, props, prevProps = {}, isSVG, skipChildren) { - let info; - if (!skipChildren && "children" in props) { - wrap(() => - (prevProps.children = insertExpression( - node, - props.children, - prevProps.children - )) - ); - } - wrap(() => { - for (const prop in props) { - if (prop === "children") continue; - const value = props[prop]; - if (value === prevProps[prop]) continue; - if (prop === "style") { - Object.assign(node.style, value); - } else if (prop === "classList") { - classList(node, value, prevProps[prop]); - // really only for forwarding from Components, can't forward normal ref - } else if (prop === "ref" || prop === "forwardRef") { - value(node); - } else if (prop === "on") { - for (const eventName in value) - node.addEventListener(eventName, value[eventName]); - } else if (prop === "onCapture") { - for (const eventName in value) - node.addEventListener(eventName, value[eventName], true); - } else if (prop.slice(0, 2) === "on") { - const lc = prop.toLowerCase(); - if (!NonComposedEvents.has(lc.slice(2))) { - const name = lc.slice(2); - if (Array.isArray(value)) { - node[`__${name}`] = value[0]; - node[`__${name}Data`] = value[1]; - } else node[`__${name}`] = value; - delegateEvents([name]); - } else node[lc] = value; - } else if ((info = Attributes[prop])) { - if (info.type === "attribute") { - node.setAttribute(prop, value); - } else node[info.alias] = value; - } else if (isSVG) { - if ((info = SVGAttributes[prop])) { - if (info.alias) node.setAttribute(info.alias, value); - else node.setAttribute(prop, value); - } else - node.setAttribute( - prop.replace(/([A-Z])/g, g => `-${g[0].toLowerCase()}`), - value - ); - } else node[prop] = value; - prevProps[prop] = value; - } - }); - return prevProps; -} - -function normalizeIncomingArray(normalized, array, unwrap) { - let dynamic = false; - for (let i = 0, len = array.length; i < len; i++) { - let item = array[i], t; - if (item instanceof Node) { - normalized.push(item); - } else if (item == null || item === true || item === false) { // matches null, undefined, true or false - // skip - } else if (Array.isArray(item)) { - dynamic = normalizeIncomingArray(normalized, item) || dynamic; - } else if ((t = typeof item) === 'string') { - normalized.push(document.createTextNode(item)); - } else if (t === 'function') { - if (unwrap) { - const idx = item(); - dynamic = normalizeIncomingArray(normalized, Array.isArray(idx) ? idx : [idx]) || dynamic; - } else { - normalized.push(item); - dynamic = true; - } - } else normalized.push(document.createTextNode(item.toString())); - } - return dynamic; -} - -function appendNodes(parent, array, marker) { - for (let i = 0, len = array.length; i < len; i++) parent.insertBefore(array[i], marker); -} - -function cleanChildren(parent, current, marker, replacement) { - if (marker === undefined) return parent.textContent = ''; - const node = (replacement || document.createTextNode('')); - if (current.length) { - node !== current[0] && parent.replaceChild(node, current[0]); - for (let i = current.length - 1; i > 0; i--) parent.removeChild(current[i]); - } else parent.insertBefore(node, marker); - return [node]; -} - -function insertExpression(parent, value, current, marker, unwrapArray) { - while (typeof current === "function") current = current(); - if (value === current) return current; - const t = typeof value, - multi = marker !== undefined; - parent = (multi && current[0] && current[0].parentNode) || parent; - - if (t === 'string' || t === 'number') { - if (t === 'number') value = value.toString(); - if (multi) { - let node = current[0]; - if (node && node.nodeType === 3) { - node.data = value; - } else node = document.createTextNode(value); - current = cleanChildren(parent, current, marker, node) - } else { - if (current !== '' && typeof current === 'string') { - current = parent.firstChild.data = value; - } else current = parent.textContent = value; - } - } else if (value == null || t === 'boolean') { - if (config.hydrate && config.hydrate.registry) return current; - current = cleanChildren(parent, current, marker); - } else if (t === 'function') { - wrap(() => current = insertExpression(parent, value(), current, marker)); - return () => current; - } else if (Array.isArray(value)) { - const array = []; - if (normalizeIncomingArray(array, value, unwrapArray)) { - wrap(() => current = insertExpression(parent, array, current, marker, true)); - return () => current; - }; - if (config.hydrate && config.hydrate.registry) return current; - if (array.length === 0) { - current = cleanChildren(parent, current, marker); - if (multi) return current; - } else { - if (Array.isArray(current)) { - if (current.length === 0) { - appendNodes(parent, array, marker); - } else reconcileArrays(parent, current, array); - } else if (current == null || current === '') { - appendNodes(parent, array); - } else { - reconcileArrays(parent, (multi && current) || [parent.firstChild], array); - } - } - current = array; - } else if (value instanceof Node) { - if (Array.isArray(current)) { - if (multi) return current = cleanChildren(parent, current, marker, value); - cleanChildren(parent, current, null, value); - } else if (current == null || current === '') { - parent.appendChild(value); - } else parent.replaceChild(value, parent.firstChild); - current = value; - } - - return current; -} - -/* -Slightly modified version of: https://github.com/WebReflection/udomdiff/blob/master/index.js -*/ -function reconcileArrays(parentNode, a, b) { - let bLength = b.length, - aEnd = a.length, - bEnd = bLength, - aStart = 0, - bStart = 0, - after = a[aEnd - 1].nextSibling, - map = null; - - while (aStart < aEnd || bStart < bEnd) { - // append - if (aEnd === aStart) { - const node = - bEnd < bLength - ? bStart - ? b[bStart - 1].nextSibling - : b[bEnd - bStart] - : after; - - while (bStart < bEnd) parentNode.insertBefore(b[bStart++], node); - // remove - } else if (bEnd === bStart) { - while (aStart < aEnd) { - if (!map || !map.has(a[aStart])) parentNode.removeChild(a[aStart]); - aStart++; - } - // common prefix - } else if (a[aStart] === b[bStart]) { - aStart++; - bStart++; - // common suffix - } else if (a[aEnd - 1] === b[bEnd - 1]) { - aEnd--; - bEnd--; - // swap forward - } else if (aEnd - aStart === 1 && bEnd - bStart === 1) { - if (map && map.has(a[aStart])) { - parentNode.insertBefore(b[bStart], bEnd < bLength ? b[bEnd] : after); - } else parentNode.replaceChild(b[bStart], a[aStart]); - break; - // swap backward - } else if (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]) { - const node = a[--aEnd].nextSibling; - parentNode.insertBefore(b[bStart++], a[aStart++].nextSibling); - parentNode.insertBefore(b[--bEnd], node); - - a[aEnd] = b[bEnd]; - // fallback to map - } else { - if (!map) { - map = new Map(); - let i = bStart; - - while (i < bEnd) map.set(b[i], i++); - } - - if (map.has(a[aStart])) { - const index = map.get(a[aStart]); - - if (bStart < index && index < bEnd) { - let i = aStart, - sequence = 1; - - while (++i < aEnd && i < bEnd) { - if (!map.has(a[i]) || map.get(a[i]) !== index + sequence) break; - sequence++; - } - - if (sequence > index - bStart) { - const node = a[aStart]; - while (bStart < index) parentNode.insertBefore(b[bStart++], node); - } else parentNode.replaceChild(b[bStart++], a[aStart++]); - } else aStart++; - } else parentNode.removeChild(a[aStart++]); - } - } - - return b; -} \ No newline at end of file +export * from "dom-expressions/src/runtime"; \ No newline at end of file From 1aaec1ca519728dd1d4645265f85c1930e177562 Mon Sep 17 00:00:00 2001 From: Ryan Carniato Date: Fri, 15 May 2020 03:56:42 -0700 Subject: [PATCH 10/38] fix missing Component export --- package.json | 2 +- src/index.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index e45cf89..f3e9f2b 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "mobx-jsx", "description": "Raw MobX performance without the restraints of a Virtual DOM", - "version": "0.11.0", + "version": "0.11.1", "author": "Ryan Carniato", "license": "MIT", "repository": { diff --git a/src/index.ts b/src/index.ts index b82282d..bc1b9d6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,5 +1,5 @@ -export { root, cleanup, lazy, createContext, useContext, map } from "./lib"; -export type { Context, Component } from "./lib"; +export { root, cleanup, Component, lazy, createContext, useContext, map } from "./lib"; +export type { Context, FunctionComponent } from "./lib"; export * from "./runtime"; import "./jsx" From 00feed920639891f09d6c296a1d11665352f3245 Mon Sep 17 00:00:00 2001 From: Ryan Carniato Date: Thu, 28 May 2020 21:05:31 -0700 Subject: [PATCH 11/38] update jsx style types --- package-lock.json | 20 +- package.json | 8 +- src/jsx.ts | 1732 ++++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 1720 insertions(+), 40 deletions(-) diff --git a/package-lock.json b/package-lock.json index ef997e2..4d5548d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "mobx-jsx", - "version": "0.11.0", + "version": "0.11.2", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -368,9 +368,9 @@ } }, "dom-expressions": { - "version": "0.18.1", - "resolved": "https://registry.npmjs.org/dom-expressions/-/dom-expressions-0.18.1.tgz", - "integrity": "sha512-GeMyI8cyzkbcNTW1Tkqw/z0/dBAvlp94I2wm6hcVXIzFecDavataCJlNUs2vRGiU033iUDhvRDZFMaecXmdd4Q==", + "version": "0.18.5", + "resolved": "https://registry.npmjs.org/dom-expressions/-/dom-expressions-0.18.5.tgz", + "integrity": "sha512-kfTkgjjc/ZRJBWxBIlCGYpCiYeYx4z7/2t1KiEeaQW35ksb9Ws2RqRFJH2nGfTH1Y5DP9VVPF4g3YIcfS2Jm8A==", "dev": true, "requires": { "babel-plugin-transform-rename-import": "^2.3.0" @@ -414,9 +414,9 @@ "dev": true }, "hyper-dom-expressions": { - "version": "0.18.2", - "resolved": "https://registry.npmjs.org/hyper-dom-expressions/-/hyper-dom-expressions-0.18.2.tgz", - "integrity": "sha512-6rYMBQLmrRVMsZz/FffhsUMA6S3EGd15qq5DfBhbsG+vZxIKlYU30STZ7d8cJtnxFHAh4EkBqRiEIDAY3rs/gA==", + "version": "0.18.5", + "resolved": "https://registry.npmjs.org/hyper-dom-expressions/-/hyper-dom-expressions-0.18.5.tgz", + "integrity": "sha512-dO7WqT+taVJKvYLjZ1uUwUPCF7a10SrpXHW1cEXoNxAQtKHKkvy+uxpy1Ix/bpQW2sruHkNhaQLl4BnewHYBzQ==", "dev": true }, "is-module": { @@ -447,9 +447,9 @@ } }, "lit-dom-expressions": { - "version": "0.18.1", - "resolved": "https://registry.npmjs.org/lit-dom-expressions/-/lit-dom-expressions-0.18.1.tgz", - "integrity": "sha512-8uMZcdn3S4H2NzLiPFngAR6bH1VMHnazR80YlFXjR5BX+6ZDn3kv7FMR/YKrG7+9UNbXIdQh5BuOH/FfaqRwPQ==", + "version": "0.18.5", + "resolved": "https://registry.npmjs.org/lit-dom-expressions/-/lit-dom-expressions-0.18.5.tgz", + "integrity": "sha512-Qi4GMGdq4GIo4wpu45BP96g4azhZjoDOMqGvU/vl40RbzBJOr2E7umiYWpLMzGvvH5lj3rai3lqe928G4h0IJA==", "dev": true }, "lodash": { diff --git a/package.json b/package.json index f3e9f2b..3ede4bf 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "mobx-jsx", "description": "Raw MobX performance without the restraints of a Virtual DOM", - "version": "0.11.1", + "version": "0.11.2", "author": "Ryan Carniato", "license": "MIT", "repository": { @@ -18,9 +18,9 @@ "devDependencies": { "@babel/core": "7.9.0", "@babel/preset-typescript": "7.9.0", - "dom-expressions": "0.18.1", - "hyper-dom-expressions": "~0.18.2", - "lit-dom-expressions": "~0.18.1", + "dom-expressions": "0.18.5", + "hyper-dom-expressions": "0.18.5", + "lit-dom-expressions": "0.18.5", "mobx": "^5.15.4", "ncp": "2.0.0", "rollup": "^2.10.2", diff --git a/src/jsx.ts b/src/jsx.ts index 754ee29..e05a343 100644 --- a/src/jsx.ts +++ b/src/jsx.ts @@ -1,20 +1,13 @@ declare global { /** - * Forked from `https://github.com/adamhaile/surplus` and adapted for `babel-plugin-jsx-dom-expressions`. + * Based on JSX types for Surplus and Inferno and adapted for `dom-expressions`. * - * @onceee https://github.com/adamhaile/surplus/blob/master/index.d.ts - * @onceee https://github.com/ryansolid/dom-expressions + * https://github.com/adamhaile/surplus/blob/master/index.d.ts + * https://github.com/infernojs/inferno/blob/master/packages/inferno/src/core/types.ts */ namespace JSX { - type Element = - | Node - | ArrayElement - | FunctionElement - | string - | number - | boolean - | undefined; + type Element = Node | ArrayElement | FunctionElement | string | number | boolean | undefined; interface ArrayElement extends Array {} interface FunctionElement { @@ -33,7 +26,7 @@ declare global { interface BoundEventHandler { 0: (data: any, e: E & { currentTarget: T; target: T }) => void; - 1: any + 1: any; } type EventHandlerUnion = EventHandler | BoundEventHandler; @@ -169,13 +162,1705 @@ declare global { onTransitionEnd?: EventHandlerUnion; } - type HTMLAutocapitalize = - | "off" - | "none" - | "on" - | "sentences" - | "words" - | "characters"; + // See CSS 3 CSS-wide keywords https://www.w3.org/TR/css3-values/#common-keywords + // See CSS 3 Explicit Defaulting https://www.w3.org/TR/css-cascade-3/#defaulting-keywords + // "all CSS properties can accept these values" + type CSSWideKeyword = "initial" | "inherit" | "unset"; + + // See CSS 3 type https://drafts.csswg.org/css-values-3/#percentages + type CSSPercentage = string; + + // See CSS 3 type https://drafts.csswg.org/css-values-3/#lengths + type CSSLength = number | string; + + // This interface is not complete. Only properties accepting + // unitless numbers are listed here (see CSSProperty.js in Inferno) + interface CSSProperties { + /** + * Aligns a flex container's lines within the flex container when there is extra space in the cross-axis, similar to how justify-content aligns individual items within the main-axis. + */ + "align-content"?: + | CSSWideKeyword + | "flex-start" + | "flex-end" + | "center" + | "space-between" + | "space-around" + | "stretch"; + + /** + * Sets the default alignment in the cross axis for all of the flex container's items, including anonymous flex items, similarly to how justify-content aligns items along the main axis. + */ + "align-items"?: + | CSSWideKeyword + | "flex-start" + | "flex-end" + | "center" + | "baseline" + | "stretch"; + + /** + * Allows the default alignment to be overridden for individual flex items. + */ + "align-self"?: + | CSSWideKeyword + | "auto" + | "flex-start" + | "flex-end" + | "center" + | "baseline" + | "stretch"; + + /** + * This property allows precise alignment of elements, such as graphics, + * that do not have a baseline-table or lack the desired baseline in their baseline-table. + * With the alignment-adjust property, the position of the baseline identified by the alignment-baseline + * can be explicitly determined. It also determines precisely the alignment point for each glyph within a textual element. + */ + "alignment-adjust"?: CSSWideKeyword | any; + + "alignment-baseline"?: CSSWideKeyword | any; + + /** + * Defines a length of time to elapse before an animation starts, allowing an animation to begin execution some time after it is applied. + */ + "animation-delay"?: CSSWideKeyword | any; + + /** + * Defines whether an animation should run in reverse on some or all cycles. + */ + "animation-direction"?: CSSWideKeyword | any; + + /** + * Specifies how many times an animation cycle should play. + */ + "animation-iteration-count"?: CSSWideKeyword | any; + + /** + * Defines the list of animations that apply to the element. + */ + "animation-name"?: CSSWideKeyword | any; + + /** + * Defines whether an animation is running or paused. + */ + "animation-play-state"?: CSSWideKeyword | any; + + /** + * Allows changing the style of any element to platform-based interface elements or vice versa. + */ + appearance?: CSSWideKeyword | any; + + /** + * Determines whether or not the “back” side of a transformed element is visible when facing the viewer. + */ + "backface-visibility"?: CSSWideKeyword | any; + + /** + * Shorthand property to set the values for one or more of: + * background-clip, background-color, background-image, + * background-origin, background-position, background-repeat, + * background-size, and background-attachment. + */ + background?: CSSWideKeyword | any; + + /** + * If a background-image is specified, this property determines + * whether that image's position is fixed within the viewport, + * or scrolls along with its containing block. + * See CSS 3 background-attachment property https://drafts.csswg.org/css-backgrounds-3/#the-background-attachment + */ + "background-attachment"?: CSSWideKeyword | "scroll" | "fixed" | "local"; + + /** + * This property describes how the element's background images should blend with each other and the element's background color. + * The value is a list of blend modes that corresponds to each background image. Each element in the list will apply to the + * corresponding element of background-image. If a property doesn’t have enough comma-separated values to match the number of layers, + * the UA must calculate its used value by repeating the list of values until there are enough. + */ + "background-blend-mode"?: CSSWideKeyword | any; + + /** + * Sets the background color of an element. + */ + "background-color"?: CSSWideKeyword | any; + + "background-composite"?: CSSWideKeyword | any; + + /** + * Applies one or more background images to an element. These can be any valid CSS image, including url() paths to image files or CSS gradients. + */ + "background-image"?: CSSWideKeyword | any; + + /** + * Specifies what the background-position property is relative to. + */ + "background-origin"?: CSSWideKeyword | any; + + /** + * Sets the position of a background image. + */ + "background-position"?: CSSWideKeyword | any; + + /** + * Background-repeat defines if and how background images will be repeated after they have been sized and positioned + */ + "background-repeat"?: CSSWideKeyword | any; + + /** + * Defines the size of the background images + */ + "background-size"?: CSSWideKeyword | any; + + /** + * Obsolete - spec retired, not implemented. + */ + "baseline-shift"?: CSSWideKeyword | any; + + /** + * Non standard. Sets or retrieves the location of the Dynamic HTML (DHTML) behavior. + */ + behavior?: CSSWideKeyword | any; + + /** + * Shorthand property that defines the different properties of all four sides of an element's border in a single declaration. + * It can be used to set border-width, border-style and border-color, or a subset of these. + */ + border?: CSSWideKeyword | any; + + /** + * Shorthand that sets the values of border-bottom-color, + * border-bottom-style, and border-bottom-width. + */ + "border-bottom"?: CSSWideKeyword | any; + + /** + * Sets the color of the bottom border of an element. + */ + "border-bottom-color"?: CSSWideKeyword | any; + + /** + * Defines the shape of the border of the bottom-left corner. + */ + "border-bottom-left-radius"?: CSSWideKeyword | CSSLength; + + /** + * Defines the shape of the border of the bottom-right corner. + */ + "border-bottom-right-radius"?: CSSWideKeyword | CSSLength; + + /** + * Sets the line style of the bottom border of a box. + */ + "border-bottom-style"?: CSSWideKeyword | any; + + /** + * Sets the width of an element's bottom border. To set all four borders, + * use the border-width shorthand property which sets the values simultaneously for border-top-width, + * border-right-width, border-bottom-width, and border-left-width. + */ + "border-bottom-width"?: CSSWideKeyword | any; + + /** + * Border-collapse can be used for collapsing the borders between table cells + */ + "border-collapse"?: CSSWideKeyword | any; + + /** + * The CSS border-color property sets the color of an element's four borders. + * This property can have from one to four values, made up of the elementary properties: + * • border-top-color + * • border-right-color + * • border-bottom-color + * • border-left-color The default color is the currentColor of each of these values. + * If you provide one value, it sets the color for the element. Two values set the horizontal and vertical values, + * respectively. Providing three values sets the top, vertical, and bottom values, in that order. + * Four values set all for sides: top, right, bottom, and left, in that order. + */ + "border-color"?: CSSWideKeyword | any; + + /** + * Specifies different corner clipping effects, such as scoop (inner curves), bevel (straight cuts) or notch (cut-off rectangles). + * Works along with border-radius to specify the size of each corner effect. + */ + "border-corner-shape"?: CSSWideKeyword | any; + + /** + * The property border-image-source is used to set the image to be used instead of the border style. + * If this is set to none the border-style is used instead. + */ + "border-image-source"?: CSSWideKeyword | any; + + /** + * The border-image-width CSS property defines the offset to use for dividing the border image in nine parts, + * the top-left corner, central top edge, top-right-corner, central right edge, bottom-right corner, central bottom edge, + * bottom-left corner, and central right edge. They represent inward distance from the top, right, bottom, and left edges. + */ + "border-image-width"?: CSSWideKeyword | any; + + /** + * Shorthand property that defines the border-width, border-style and border-color of an element's left border in a single declaration. + * Note that you can use the corresponding longhand properties to set specific individual properties of the left border — border-left-width, + * border-left-style and border-left-color. + */ + "border-left"?: CSSWideKeyword | any; + + /** + * The CSS border-left-color property sets the color of an element's left border. This page explains the border-left-color value, + * but often you will find it more convenient to fix the border's left color as part of a shorthand set, either border-left or border-color. + * Colors can be defined several ways. For more information, see Usage. + */ + "border-left-color"?: CSSWideKeyword | any; + + /** + * Sets the style of an element's left border. To set all four borders, use the shorthand property, border-style. + * Otherwise, you can set the borders individually with border-top-style, border-right-style, border-bottom-style, border-left-style. + */ + "border-left-style"?: CSSWideKeyword | any; + + /** + * Sets the width of an element's left border. To set all four borders, + * use the border-width shorthand property which sets the values simultaneously for border-top-width, + * border-right-width, border-bottom-width, and border-left-width. + */ + "border-left-width"?: CSSWideKeyword | any; + + /** + * Shorthand property that sets the rounding of all four corners. + */ + "border-radius"?: CSSWideKeyword | CSSLength; + + /** + * Shorthand property that defines the border-width, border-style and border-color of an element's right border + * in a single declaration. Note that you can use the corresponding longhand properties to set specific + * individual properties of the right border — border-right-width, border-right-style and border-right-color. + */ + "border-right"?: CSSWideKeyword | any; + + /** + * Sets the color of an element's right border. This page explains the border-right-color value, + * but often you will find it more convenient to fix the border's right color as part of a shorthand set, + * either border-right or border-color. + * Colors can be defined several ways. For more information, see Usage. + */ + "border-right-color"?: CSSWideKeyword | any; + + /** + * Sets the style of an element's right border. To set all four borders, use the shorthand property, + * border-style. Otherwise, you can set the borders individually with border-top-style, border-right-style, + * border-bottom-style, border-left-style. + */ + "border-right-style"?: CSSWideKeyword | any; + + /** + * Sets the width of an element's right border. To set all four borders, + * use the border-width shorthand property which sets the values simultaneously for border-top-width, + * border-right-width, border-bottom-width, and border-left-width. + */ + "border-right-width"?: CSSWideKeyword | any; + + /** + * Specifies the distance between the borders of adjacent cells. + */ + "border-spacing"?: CSSWideKeyword | any; + + /** + * Sets the style of an element's four borders. This property can have from one to four values. + * With only one value, the value will be applied to all four borders; + * otherwise, this works as a shorthand property for each of border-top-style, border-right-style, + * border-bottom-style, border-left-style, where each border style may be assigned a separate value. + */ + "border-style"?: CSSWideKeyword | any; + + /** + * Shorthand property that defines the border-width, border-style and border-color of an element's top border + * in a single declaration. Note that you can use the corresponding longhand properties to set specific + * individual properties of the top border — border-top-width, border-top-style and border-top-color. + */ + "border-top"?: CSSWideKeyword | any; + + /** + * Sets the color of an element's top border. This page explains the border-top-color value, + * but often you will find it more convenient to fix the border's top color as part of a shorthand set, + * either border-top or border-color. + * Colors can be defined several ways. For more information, see Usage. + */ + "border-top-color"?: CSSWideKeyword | any; + + /** + * Sets the rounding of the top-left corner of the element. + */ + "border-top-left-radius"?: CSSWideKeyword | CSSLength; + + /** + * Sets the rounding of the top-right corner of the element. + */ + "border-top-right-radius"?: CSSWideKeyword | CSSLength; + + /** + * Sets the style of an element's top border. To set all four borders, use the shorthand property, border-style. + * Otherwise, you can set the borders individually with border-top-style, border-right-style, border-bottom-style, border-left-style. + */ + "border-top-style"?: CSSWideKeyword | any; + + /** + * Sets the width of an element's top border. To set all four borders, + * use the border-width shorthand property which sets the values simultaneously for border-top-width, + * border-right-width, border-bottom-width, and border-left-width. + */ + "border-top-width"?: CSSWideKeyword | any; + + /** + * Sets the width of an element's four borders. This property can have from one to four values. + * This is a shorthand property for setting values simultaneously for border-top-width, + * border-right-width, border-bottom-width, and border-left-width. + */ + "border-width"?: CSSWideKeyword | any; + + /** + * This property specifies how far an absolutely positioned box's bottom margin edge + * is offset above the bottom edge of the box's containing block. For relatively positioned boxes, + * the offset is with respect to the bottom edges of the box itself + * (i.e., the box is given a position in the normal flow, then offset from that position according to these properties). + */ + bottom?: CSSWideKeyword | any; + + /** + * Obsolete. + */ + "box-align"?: CSSWideKeyword | any; + + /** + * Breaks a box into fragments creating new borders, + * padding and repeating backgrounds or lets it stay as a continuous box on a page break, + * column break, or, for inline elements, at a line break. + */ + "box-decoration-break"?: CSSWideKeyword | any; + + /** + * Deprecated + */ + "box-direction"?: CSSWideKeyword | any; + + /** + * Do not use. This property has been replaced by the flex-wrap property. + * Gets or sets a value that specifies the direction to add successive rows or columns when the value of box-lines is set to multiple. + */ + "box-line-progression"?: CSSWideKeyword | any; + + /** + * Do not use. This property has been replaced by the flex-wrap property. + * Gets or sets a value that specifies whether child elements wrap onto multiple lines or columns based on the space available in the object. + */ + "box-lines"?: CSSWideKeyword | any; + + /** + * Do not use. This property has been replaced by flex-order. + * Specifies the ordinal group that a child element of the object belongs to. + * This ordinal value identifies the display order (along the axis defined by the box-orient property) for the group. + */ + "box-ordinal-group"?: CSSWideKeyword | any; + + /** + * Deprecated. + */ + "box-flex"?: CSSWideKeyword | number; + + /** + * Deprecated. + */ + "box-flex-group"?: CSSWideKeyword | number; + + /** + * Cast a drop shadow from the frame of almost any element. + * MDN: https://developer.mozilla.org/en-US/docs/Web/CSS/box-shadow + */ + "box-shadow"?: CSSWideKeyword | any; + + /** + * The CSS break-after property allows you to force a break on multi-column layouts. + * More specifically, it allows you to force a break after an element. + * It allows you to determine if a break should occur, and what type of break it should be. + * The break-after CSS property describes how the page, column or region break behaves after the generated box. + * If there is no generated box, the property is ignored. + */ + "break-after"?: CSSWideKeyword | any; + + /** + * Control page/column/region breaks that fall above a block of content + */ + "break-before"?: CSSWideKeyword | any; + + /** + * Control page/column/region breaks that fall within a block of content + */ + "break-inside"?: CSSWideKeyword | any; + + /** + * The clear CSS property specifies if an element can be positioned next to + * or must be positioned below the floating elements that precede it in the markup. + */ + clear?: CSSWideKeyword | any; + + /** + * Deprecated; see clip-path. + * Lets you specify the dimensions of an absolutely positioned element that should be visible, + * and the element is clipped into this shape, and displayed. + */ + clip?: CSSWideKeyword | any; + + /** + * Clipping crops an graphic, so that only a portion of the graphic is rendered, or filled. + * This clip-rule property, when used with the clip-path property, defines which clip rule, or algorithm, + * to use when filling the different parts of a graphics. + */ + "clip-rule"?: CSSWideKeyword | any; + + /** + * The color property sets the color of an element's foreground content (usually text), + * accepting any standard CSS color from keywords and hex values to RGB(a) and HSL(a). + */ + color?: CSSWideKeyword | any; + + /** + * Describes the number of columns of the element. + * See CSS 3 column-count property https://www.w3.org/TR/css3-multicol/#cc + */ + "column-count"?: CSSWideKeyword | number | "auto"; + + /** + * Specifies how to fill columns (balanced or sequential). + */ + "column-fill"?: CSSWideKeyword | any; + + /** + * The column-gap property controls the width of the gap between columns in multi-column elements. + */ + "column-gap"?: CSSWideKeyword | any; + + /** + * Sets the width, style, and color of the rule between columns. + */ + "column-rule"?: CSSWideKeyword | any; + + /** + * Specifies the color of the rule between columns. + */ + "column-rule-color"?: CSSWideKeyword | any; + + /** + * Specifies the width of the rule between columns. + */ + "column-rule-width"?: CSSWideKeyword | any; + + /** + * The column-span CSS property makes it possible for an element to span across all columns when its value is set to all. + * An element that spans more than one column is called a spanning element. + */ + "column-span"?: CSSWideKeyword | any; + + /** + * Specifies the width of columns in multi-column elements. + */ + "column-width"?: CSSWideKeyword | any; + + /** + * This property is a shorthand property for setting column-width and/or column-count. + */ + columns?: CSSWideKeyword | any; + + /** + * The counter-increment property accepts one or more names of counters (identifiers), + * each one optionally followed by an integer which specifies the value by which the counter should be incremented + * (e.g. if the value is 2, the counter increases by 2 each time it is invoked). + */ + "counter-increment"?: CSSWideKeyword | any; + + /** + * The counter-reset property contains a list of one or more names of counters, + * each one optionally followed by an integer (otherwise, the integer defaults to 0.). + * Each time the given element is invoked, the counters specified by the property are set to the given integer. + */ + "counter-reset"?: CSSWideKeyword | any; + + /** + * The cue property specifies sound files (known as an "auditory icon") to be played by speech media agents + * before and after presenting an element's content; if only one file is specified, it is played both before and after. + * The volume at which the file(s) should be played, relative to the volume of the main element, may also be specified. + * The icon files may also be set separately with the cue-before and cue-after properties. + */ + cue?: CSSWideKeyword | any; + + /** + * The cue-after property specifies a sound file (known as an "auditory icon") to be played by speech media agents + * after presenting an element's content; the volume at which the file should be played may also be specified. + * The shorthand property cue sets cue sounds for both before and after the element is presented. + */ + "cue-after"?: CSSWideKeyword | any; + + /** + * Specifies the mouse cursor displayed when the mouse pointer is over an element. + */ + cursor?: CSSWideKeyword | any; + + /** + * The direction CSS property specifies the text direction/writing direction. The rtl is used for Hebrew or Arabic text, the ltr is for other languages. + */ + direction?: CSSWideKeyword | any; + + /** + * This property specifies the type of rendering box used for an element. It is a shorthand property for many other display properties. + */ + display?: CSSWideKeyword | any; + + /** + * The ‘fill’ property paints the interior of the given graphical element. + * The area to be painted consists of any areas inside the outline of the shape. + * To determine the inside of the shape, all subpaths are considered, + * and the interior is determined according to the rules associated with the current value of the ‘fill-rule’ property. + * The zero-width geometric outline of a shape is included in the area to be painted. + */ + fill?: CSSWideKeyword | any; + + /** + * SVG: Specifies the opacity of the color or the content the current object is filled with. + * See SVG 1.1 https://www.w3.org/TR/SVG/painting.html#FillOpacityProperty + */ + "fill-opacity"?: CSSWideKeyword | number; + + /** + * The ‘fill-rule’ property indicates the algorithm which is to be used to determine what parts of the canvas are included inside the shape. + * For a simple, non-intersecting path, it is intuitively clear what region lies "inside"; + * however, for a more complex path, such as a path that intersects itself or where one subpath encloses another, + * the interpretation of "inside" is not so obvious. + * The ‘fill-rule’ property provides two options for how the inside of a shape is determined: + */ + "fill-rule"?: CSSWideKeyword | any; + + /** + * Applies various image processing effects. This property is largely unsupported. See Compatibility section for more information. + */ + filter?: CSSWideKeyword | any; + + /** + * Shorthand for `flex-grow`, `flex-shrink`, and `flex-basis`. + */ + flex?: CSSWideKeyword | number | string; + + /** + * Obsolete, do not use. This property has been renamed to align-items. + * Specifies the alignment (perpendicular to the layout axis defined by the flex-direction property) of child elements of the object. + */ + "flex-align"?: CSSWideKeyword | any; + + /** + * The flex-basis CSS property describes the initial main size of the flex item + * before any free space is distributed according to the flex factors described in the flex property (flex-grow and flex-shrink). + */ + "flex-basis"?: CSSWideKeyword | any; + + /** + * The flex-direction CSS property describes how flex items are placed in the flex container, by setting the direction of the flex container's main axis. + */ + "flex-direction"?: CSSWideKeyword | "row" | "row-reverse" | "column" | "column-reverse"; + + /** + * The flex-flow CSS property defines the flex container's main and cross axis. It is a shorthand property for the flex-direction and flex-wrap properties. + */ + "flex-flow"?: CSSWideKeyword | string; + + /** + * Specifies the flex grow factor of a flex item. + * See CSS flex-grow property https://drafts.csswg.org/css-flexbox-1/#flex-grow-property + */ + "flex-grow"?: CSSWideKeyword | number; + + /** + * Do not use. This property has been renamed to align-self + * Specifies the alignment (perpendicular to the layout axis defined by flex-direction) of child elements of the object. + */ + "flex-item-align"?: CSSWideKeyword | any; + + /** + * Do not use. This property has been renamed to align-content. + * Specifies how a flexbox's lines align within the flexbox when there is extra space along the axis that is perpendicular to the axis defined by the flex-direction property. + */ + "flex-line-pack"?: CSSWideKeyword | any; + + /** + * Gets or sets a value that specifies the ordinal group that a flexbox element belongs to. This ordinal value identifies the display order for the group. + */ + "flex-order"?: CSSWideKeyword | any; + + /** + * Specifies the flex shrink factor of a flex item. + * See CSS flex-shrink property https://drafts.csswg.org/css-flexbox-1/#flex-shrink-property + */ + "flex-shrink"?: CSSWideKeyword | number; + + /** + * Specifies whether flex items are forced into a single line or can be wrapped onto multiple lines. + * If wrapping is allowed, this property also enables you to control the direction in which lines are stacked. + * See CSS flex-wrap property https://drafts.csswg.org/css-flexbox-1/#flex-wrap-property + */ + "flex-wrap"?: CSSWideKeyword | "nowrap" | "wrap" | "wrap-reverse"; + + /** + * Elements which have the style float are floated horizontally. + * These elements can move as far to the left or right of the containing element. + * All elements after the floating element will flow around it, but elements before the floating element are not impacted. + * If several floating elements are placed after each other, they will float next to each other as long as there is room. + */ + float?: CSSWideKeyword | any; + + /** + * Flows content from a named flow (specified by a corresponding flow-into) through selected elements to form a dynamic chain of layout regions. + */ + "flow-from"?: CSSWideKeyword | any; + + /** + * The font property is shorthand that allows you to do one of two things: you can either set up six of the most mature font properties in one line, + * or you can set one of a choice of keywords to adopt a system font setting. + */ + font?: CSSWideKeyword | any; + + /** + * The font-family property allows one or more font family names and/or generic family names to be specified for usage on the selected element(s)' text. + * The browser then goes through the list; for each character in the selection it applies the first font family that has an available glyph for that character. + */ + "font-family"?: CSSWideKeyword | any; + + /** + * The font-kerning property allows contextual adjustment of inter-glyph spacing, i.e. the spaces between the characters in text. + * This property controls metric kerning - that utilizes adjustment data contained in the font. Optical Kerning is not supported as yet. + */ + "font-kerning"?: CSSWideKeyword | any; + + /** + * Specifies the size of the font. Used to compute em and ex units. + * See CSS 3 font-size property https://www.w3.org/TR/css-fonts-3/#propdef-font-size + */ + "font-size"?: + | CSSWideKeyword + | "xx-small" + | "x-small" + | "small" + | "medium" + | "large" + | "x-large" + | "xx-large" + | "larger" + | "smaller" + | CSSLength + | CSSPercentage; + + /** + * The font-size-adjust property adjusts the font-size of the fallback fonts defined with font-family, + * so that the x-height is the same no matter what font is used. + * This preserves the readability of the text when fallback happens. + * See CSS 3 font-size-adjust property https://www.w3.org/TR/css-fonts-3/#propdef-font-size-adjust + */ + "font-size-adjust"?: CSSWideKeyword | "none" | number; + + /** + * Allows you to expand or condense the widths for a normal, condensed, or expanded font face. + * See CSS 3 font-stretch property https://drafts.csswg.org/css-fonts-3/#propdef-font-stretch + */ + "font-stretch"?: + | CSSWideKeyword + | "normal" + | "ultra-condensed" + | "extra-condensed" + | "condensed" + | "semi-condensed" + | "semi-expanded" + | "expanded" + | "extra-expanded" + | "ultra-expanded"; + + /** + * The font-style property allows normal, italic, or oblique faces to be selected. + * Italic forms are generally cursive in nature while oblique faces are typically sloped versions of the regular face. + * Oblique faces can be simulated by artificially sloping the glyphs of the regular face. + * See CSS 3 font-style property https://www.w3.org/TR/css-fonts-3/#propdef-font-style + */ + "font-style"?: CSSWideKeyword | "normal" | "italic" | "oblique"; + + /** + * This value specifies whether the user agent is allowed to synthesize bold or oblique font faces when a font family lacks bold or italic faces. + */ + "font-synthesis"?: CSSWideKeyword | any; + + /** + * The font-variant property enables you to select the small-caps font within a font family. + */ + "font-variant"?: CSSWideKeyword | any; + + /** + * Fonts can provide alternate glyphs in addition to default glyph for a character. This property provides control over the selection of these alternate glyphs. + */ + "font-variant-alternates"?: CSSWideKeyword | any; + + /** + * Specifies the weight or boldness of the font. + * See CSS 3 'font-weight' property https://www.w3.org/TR/css-fonts-3/#propdef-font-weight + */ + "font-weight"?: + | CSSWideKeyword + | "normal" + | "bold" + | "bolder" + | "lighter" + | 100 + | 200 + | 300 + | 400 + | 500 + | 600 + | 700 + | 800 + | 900; + + /** + * Lays out one or more grid items bound by 4 grid lines. Shorthand for setting grid-column-start, grid-column-end, grid-row-start, and grid-row-end in a single declaration. + */ + "grid-area"?: CSSWideKeyword | any; + + /** + * Controls a grid item's placement in a grid area, particularly grid position and a grid span. Shorthand for setting grid-column-start and grid-column-end in a single declaration. + */ + "grid-column"?: CSSWideKeyword | any; + + /** + * Controls a grid item's placement in a grid area as well as grid position and a grid span. + * The grid-column-end property (with grid-row-start, grid-row-end, and grid-column-start) determines a grid item's placement by specifying the grid lines of a grid item's grid area. + */ + "grid-column-end"?: CSSWideKeyword | any; + + /** + * Determines a grid item's placement by specifying the starting grid lines of a grid item's grid area. + * A grid item's placement in a grid area consists of a grid position and a grid span. + * See also ( grid-row-start, grid-row-end, and grid-column-end) + */ + "grid-column-start"?: CSSWideKeyword | any; + + /** + * Gets or sets a value that indicates which row an element within a Grid should appear in. Shorthand for setting grid-row-start and grid-row-end in a single declaration. + */ + "grid-row"?: CSSWideKeyword | any; + + /** + * Determines a grid item’s placement by specifying the block-end. A grid item's placement in a grid area consists of a grid position and a grid span. + * The grid-row-end property (with grid-row-start, grid-column-start, and grid-column-end) determines a grid item's placement by specifying the grid lines of a grid item's grid area. + */ + "grid-row-end"?: CSSWideKeyword | any; + + /** + * Specifies a row position based upon an integer location, string value, or desired row size. + * css/properties/grid-row is used as short-hand for grid-row-position and grid-row-position + */ + "grid-row-position"?: CSSWideKeyword | any; + + "grid-row-span"?: CSSWideKeyword | any; + + /** + * Specifies named grid areas which are not associated with any particular grid item, but can be referenced from the grid-placement properties. + * The syntax of the grid-template-areas property also provides a visualization of the structure of the grid, making the overall layout of the grid container easier to understand. + */ + "grid-template-areas"?: CSSWideKeyword | any; + + /** + * Specifies (with grid-template-rows) the line names and track sizing functions of the grid. + * Each sizing function can be specified as a length, a percentage of the grid container’s size, + * a measurement of the contents occupying the column or row, or a fraction of the free space in the grid. + */ + "grid-template-columns"?: CSSWideKeyword | any; + + /** + * Specifies (with grid-template-columns) the line names and track sizing functions of the grid. + * Each sizing function can be specified as a length, a percentage of the grid container’s size, + * a measurement of the contents occupying the column or row, or a fraction of the free space in the grid. + */ + "grid-template-rows"?: CSSWideKeyword | any; + + /** + * Sets the height of an element. The content area of the element height does not include the padding, border, and margin of the element. + */ + height?: CSSWideKeyword | any; + + /** + * Specifies the minimum number of characters in a hyphenated word + */ + "hyphenate-limit-chars"?: CSSWideKeyword | any; + + /** + * Indicates the maximum number of successive hyphenated lines in an element. The ‘no-limit’ value means that there is no limit. + */ + "hyphenate-limit-lines"?: CSSWideKeyword | any; + + /** + * Specifies the maximum amount of trailing whitespace (before justification) that may be left in a line before hyphenation is triggered + * to pull part of a word from the next line back up into the current one. + */ + "hyphenate-limit-zone"?: CSSWideKeyword | any; + + /** + * Specifies whether or not words in a sentence can be split by the use of a manual or automatic hyphenation mechanism. + */ + hyphens?: CSSWideKeyword | any; + + imeMode?: CSSWideKeyword | any; + + /** + * Defines how the browser distributes space between and around flex items + * along the main-axis of their container. + * See CSS justify-content property https://www.w3.org/TR/css-flexbox-1/#justify-content-property + */ + "justify-content"?: + | CSSWideKeyword + | "flex-start" + | "flex-end" + | "center" + | "space-between" + | "space-around" + | "space-evenly" + | "stretch"; + + "layout-grid"?: CSSWideKeyword | any; + + "layout-grid-char"?: CSSWideKeyword | any; + + "layout-grid-line"?: CSSWideKeyword | any; + + "layout-grid-mode"?: CSSWideKeyword | any; + + "layout-grid-type"?: CSSWideKeyword | any; + + /** + * Sets the left edge of an element + */ + left?: CSSWideKeyword | any; + + /** + * The letter-spacing CSS property specifies the spacing behavior between text characters. + */ + "letter-spacing"?: CSSWideKeyword | any; + + /** + * Deprecated. Gets or sets line-breaking rules for text in selected languages such as Japanese, Chinese, and Korean. + */ + "line-break"?: CSSWideKeyword | any; + + "line-clamp"?: CSSWideKeyword | number; + + /** + * Specifies the height of an inline block level element. + * See CSS 2.1 line-height property https://www.w3.org/TR/CSS21/visudet.html#propdef-line-height + */ + "line-height"?: CSSWideKeyword | "normal" | number | CSSLength | CSSPercentage; + + /** + * Shorthand property that sets the list-style-type, list-style-position and list-style-image properties in one declaration. + */ + "list-style"?: CSSWideKeyword | any; + + /** + * This property sets the image that will be used as the list item marker. When the image is available, + * it will replace the marker set with the 'list-style-type' marker. That also means that if the image is not available, + * it will show the style specified by list-style-property + */ + "list-style-image"?: CSSWideKeyword | any; + + /** + * Specifies if the list-item markers should appear inside or outside the content flow. + */ + "list-style-position"?: CSSWideKeyword | any; + + /** + * Specifies the type of list-item marker in a list. + */ + "list-style-type"?: CSSWideKeyword | any; + + /** + * The margin property is shorthand to allow you to set all four margins of an element at once. + * Its equivalent longhand properties are margin-top, margin-right, margin-bottom and margin-left. + * Negative values are also allowed. + */ + margin?: CSSWideKeyword | any; + + /** + * margin-bottom sets the bottom margin of an element. + */ + "margin-bottom"?: CSSWideKeyword | any; + + /** + * margin-left sets the left margin of an element. + */ + "margin-left"?: CSSWideKeyword | any; + + /** + * margin-right sets the right margin of an element. + */ + "margin-right"?: CSSWideKeyword | any; + + /** + * margin-top sets the top margin of an element. + */ + "margin-top"?: CSSWideKeyword | any; + + /** + * The marquee-direction determines the initial direction in which the marquee content moves. + */ + "marquee-direction"?: CSSWideKeyword | any; + + /** + * The 'marquee-style' property determines a marquee's scrolling behavior. + */ + "marquee-style"?: CSSWideKeyword | any; + + /** + * This property is shorthand for setting mask-image, mask-mode, mask-repeat, mask-position, mask-clip, mask-origin, mask-composite and mask-size. + * Omitted values are set to their original properties' initial values. + */ + mask?: CSSWideKeyword | any; + + /** + * This property is shorthand for setting mask-border-source, mask-border-slice, mask-border-width, mask-border-outset, and mask-border-repeat. + * Omitted values are set to their original properties' initial values. + */ + "mask-border"?: CSSWideKeyword | any; + + /** + * This property specifies how the images for the sides and the middle part of the mask image are scaled and tiled. + * The first keyword applies to the horizontal sides, the second one applies to the vertical ones. + * If the second keyword is absent, it is assumed to be the same as the first, similar to the CSS border-image-repeat property. + */ + "mask-border-repeat"?: CSSWideKeyword | any; + + /** + * This property specifies inward offsets from the top, right, bottom, and left edges of the mask image, + * dividing it into nine regions: four corners, four edges, and a middle. + * The middle image part is discarded and treated as fully transparent black unless the fill keyword is present. + * The four values set the top, right, bottom and left offsets in that order, similar to the CSS border-image-slice property. + */ + "mask-border-slice"?: CSSWideKeyword | any; + + /** + * Specifies an image to be used as a mask. An image that is empty, fails to download, is non-existent, or cannot be displayed is ignored and does not mask the element. + */ + "mask-border-source"?: CSSWideKeyword | any; + + /** + * This property sets the width of the mask box image, similar to the CSS border-image-width property. + */ + "mask-border-width"?: CSSWideKeyword | any; + + /** + * Determines the mask painting area, which defines the area that is affected by the mask. + * The painted content of an element may be restricted to this area. + */ + "mask-clip"?: CSSWideKeyword | any; + + /** + * For elements rendered as a single box, specifies the mask positioning area. + * For elements rendered as multiple boxes (e.g., inline boxes on several lines, boxes on several pages) + * specifies which boxes box-decoration-break operates on to determine the mask positioning area(s). + */ + "mask-origin"?: CSSWideKeyword | any; + + /** + * This property must not be used. It is no longer included in any standard or standard track specification, + * nor is it implemented in any browser. It is only used when the text-align-last property is set to size. + * It controls allowed adjustments of font-size to fit line content. + */ + "max-font-size"?: CSSWideKeyword | any; + + /** + * Sets the maximum height for an element. It prevents the height of the element to exceed the specified value. + * If min-height is specified and is greater than max-height, max-height is overridden. + */ + "max-height"?: CSSWideKeyword | any; + + /** + * Sets the maximum width for an element. It limits the width property to be larger than the value specified in max-width. + */ + "max-width"?: CSSWideKeyword | any; + + /** + * Sets the minimum height for an element. It prevents the height of the element to be smaller than the specified value. + * The value of min-height overrides both max-height and height. + */ + "min-height"?: CSSWideKeyword | any; + + /** + * Sets the minimum width of an element. It limits the width property to be not smaller than the value specified in min-width. + */ + "min-width"?: CSSWideKeyword | any; + + /** + * Specifies the transparency of an element. + * See CSS 3 opacity property https://drafts.csswg.org/css-color-3/#opacity + */ + opacity?: CSSWideKeyword | number; + + /** + * Specifies the order used to lay out flex items in their flex container. + * Elements are laid out in the ascending order of the order value. + * See CSS order property https://drafts.csswg.org/css-flexbox-1/#order-property + */ + order?: CSSWideKeyword | number; + + /** + * In paged media, this property defines the minimum number of lines in + * a block container that must be left at the bottom of the page. + * See CSS 3 orphans, widows properties https://drafts.csswg.org/css-break-3/#widows-orphans + */ + orphans?: CSSWideKeyword | number; + + /** + * The CSS outline property is a shorthand property for setting one or more of the individual outline properties outline-style, + * outline-width and outline-color in a single rule. In most cases the use of this shortcut is preferable and more convenient. + * Outlines differ from borders in the following ways: + * • Outlines do not take up space, they are drawn above the content. + * • Outlines may be non-rectangular. They are rectangular in Gecko/Firefox. + * Internet Explorer attempts to place the smallest contiguous outline around all elements or shapes that are indicated to have an outline. + * Opera draws a non-rectangular shape around a construct. + */ + outline?: CSSWideKeyword | any; + + /** + * The outline-color property sets the color of the outline of an element. An outline is a line that is drawn around elements, outside the border edge, to make the element stand out. + */ + "outline-color"?: CSSWideKeyword | any; + + /** + * The outline-offset property offsets the outline and draw it beyond the border edge. + */ + "outline-offset"?: CSSWideKeyword | any; + + /** + * The overflow property controls how extra content exceeding the bounding box of an element is rendered. + * It can be used in conjunction with an element that has a fixed width and height, to eliminate text-induced page distortion. + */ + overflow?: CSSWideKeyword | "auto" | "hidden" | "scroll" | "visible"; + + /** + * Specifies the preferred scrolling methods for elements that overflow. + */ + "overflow-style"?: CSSWideKeyword | any; + + /** + * Controls how extra content exceeding the x-axis of the bounding box of an element is rendered. + */ + overflowX?: CSSWideKeyword | "auto" | "hidden" | "scroll" | "visible"; + + /** + * Controls how extra content exceeding the y-axis of the bounding box of an element is rendered. + */ + overflowY?: CSSWideKeyword | "auto" | "hidden" | "scroll" | "visible"; + + /** + * The padding optional CSS property sets the required padding space on one to four sides of an element. + * The padding area is the space between an element and its border. Negative values are not allowed but decimal values are permitted. + * The element size is treated as fixed, and the content of the element shifts toward the center as padding is increased. + * The padding property is a shorthand to avoid setting each side separately (padding-top, padding-right, padding-bottom, padding-left). + */ + padding?: CSSWideKeyword | any; + + /** + * The padding-bottom CSS property of an element sets the padding space required on the bottom of an element. + * The padding area is the space between the content of the element and its border. + * Contrary to margin-bottom values, negative values of padding-bottom are invalid. + */ + "padding-bottom"?: CSSWideKeyword | any; + + /** + * The padding-left CSS property of an element sets the padding space required on the left side of an element. + * The padding area is the space between the content of the element and its border. + * Contrary to margin-left values, negative values of padding-left are invalid. + */ + "padding-left"?: CSSWideKeyword | any; + + /** + * The padding-right CSS property of an element sets the padding space required on the right side of an element. + * The padding area is the space between the content of the element and its border. + * Contrary to margin-right values, negative values of padding-right are invalid. + */ + "padding-right"?: CSSWideKeyword | any; + + /** + * The padding-top CSS property of an element sets the padding space required on the top of an element. + * The padding area is the space between the content of the element and its border. + * Contrary to margin-top values, negative values of padding-top are invalid. + */ + "padding-top"?: CSSWideKeyword | any; + + /** + * The page-break-after property is supported in all major browsers. With CSS3, page-break-* properties are only aliases of the break-* properties. + * The CSS3 Fragmentation spec defines breaks for all CSS box fragmentation. + */ + "page-break-after"?: CSSWideKeyword | any; + + /** + * The page-break-before property sets the page-breaking behavior before an element. + * With CSS3, page-break-* properties are only aliases of the break-* properties. + * The CSS3 Fragmentation spec defines breaks for all CSS box fragmentation. + */ + "page-break-before"?: CSSWideKeyword | any; + + /** + * Sets the page-breaking behavior inside an element. With CSS3, page-break-* properties are only aliases of the break-* properties. + * The CSS3 Fragmentation spec defines breaks for all CSS box fragmentation. + */ + "page-break-inside"?: CSSWideKeyword | any; + + /** + * The pause property determines how long a speech media agent should pause before and after presenting an element. + * It is a shorthand for the pause-before and pause-after properties. + */ + pause?: CSSWideKeyword | any; + + /** + * The pause-after property determines how long a speech media agent should pause after presenting an element. + * It may be replaced by the shorthand property pause, which sets pause time before and after. + */ + "pause-after"?: CSSWideKeyword | any; + + /** + * The pause-before property determines how long a speech media agent should pause before presenting an element. + * It may be replaced by the shorthand property pause, which sets pause time before and after. + */ + "pause-before"?: CSSWideKeyword | any; + + /** + * The perspective property defines how far an element is placed from the view on the z-axis, from the screen to the viewer. + * Perspective defines how an object is viewed. In graphic arts, perspective is the representation on a flat surface of what the viewer's eye would see in a 3D space. + * (See Wikipedia for more information about graphical perspective and for related illustrations.) + * The illusion of perspective on a flat surface, such as a computer screen, + * is created by projecting points on the flat surface as they would appear if the flat surface were a window + * through which the viewer was looking at the object. In discussion of virtual environments, this flat surface is called a projection plane. + */ + perspective?: CSSWideKeyword | any; + + /** + * The perspective-origin property establishes the origin for the perspective property. + * It effectively sets the X and Y position at which the viewer appears to be looking at the children of the element. + * When used with perspective, perspective-origin changes the appearance of an object, + * as if a viewer were looking at it from a different origin. + * An object appears differently if a viewer is looking directly at it versus looking at it from below, above, or from the side. + * Thus, the perspective-origin is like a vanishing point. + * The default value of perspective-origin is 50% 50%. + * This displays an object as if the viewer's eye were positioned directly at the center of the screen, both top-to-bottom and left-to-right. + * A value of 0% 0% changes the object as if the viewer was looking toward the top left angle. + * A value of 100% 100% changes the appearance as if viewed toward the bottom right angle. + */ + "perspective-origin"?: CSSWideKeyword | any; + + /** + * The pointer-events property allows you to control whether an element can be the target for the pointing device (e.g, mouse, pen) events. + */ + "pointer-events"?: CSSWideKeyword | any; + + /** + * The position property controls the type of positioning used by an element within its parent elements. + * The effect of the position property depends on a lot of factors, for example the position property of parent elements. + */ + position?: CSSWideKeyword | "static" | "relative" | "absolute" | "fixed" | "sticky"; + + /** + * Obsolete: unsupported. + * This property determines whether or not a full-width punctuation mark character should be trimmed if it appears at the beginning of a line, + * so that its "ink" lines up with the first glyph in the line above and below. + */ + "punctuation-trim"?: CSSWideKeyword | any; + + /** + * Sets the type of quotation marks for embedded quotations. + */ + quotes?: CSSWideKeyword | any; + + /** + * Controls whether the last region in a chain displays additional 'overset' content according its default overflow property, + * or if it displays a fragment of content as if it were flowing into a subsequent region. + */ + "region-fragment"?: CSSWideKeyword | any; + + /** + * The rest-after property determines how long a speech media agent should pause after presenting an element's main content, + * before presenting that element's exit cue sound. It may be replaced by the shorthand property rest, which sets rest time before and after. + */ + "rest-after"?: CSSWideKeyword | any; + + /** + * The rest-before property determines how long a speech media agent should pause after presenting an intro cue sound for an element, + * before presenting that element's main content. It may be replaced by the shorthand property rest, which sets rest time before and after. + */ + "rest-before"?: CSSWideKeyword | any; + + /** + * Specifies the position an element in relation to the right side of the containing element. + */ + right?: CSSWideKeyword | any; + + "ruby-align"?: CSSWideKeyword | any; + + "ruby-position"?: CSSWideKeyword | any; + + /** + * Defines the alpha channel threshold used to extract a shape from an image. Can be thought of as a "minimum opacity" threshold; + * that is, a value of 0.5 means that the shape will enclose all the pixels that are more than 50% opaque. + */ + "shape-image-threshold"?: CSSWideKeyword | any; + + /** + * A future level of CSS Shapes will define a shape-inside property, which will define a shape to wrap content within the element. + * See Editor's Draft and CSSWG wiki page on next-level plans + */ + "shape-inside"?: CSSWideKeyword | any; + + /** + * Adds a margin to a shape-outside. In effect, defines a new shape that is the smallest contour around all the points + * that are the shape-margin distance outward perpendicular to each point on the underlying shape. + * For points where a perpendicular direction is not defined (e.g., a triangle corner), + * takes all points on a circle centered at the point and with a radius of the shape-margin distance. + * This property accepts only non-negative values. + */ + "shape-margin"?: CSSWideKeyword | any; + + /** + * Declares a shape around which text should be wrapped, with possible modifications from the shape-margin property. + * The shape defined by shape-outside and shape-margin changes the geometry of a float element's float area. + */ + "shape-outside"?: CSSWideKeyword | any; + + /** + * The speak property determines whether or not a speech synthesizer will read aloud the contents of an element. + */ + speak?: CSSWideKeyword | any; + + /** + * The speak-as property determines how the speech synthesizer interprets the content: words as whole words or as a sequence of letters, + * numbers as a numerical value or a sequence of digits, punctuation as pauses in speech or named punctuation characters. + */ + "speak-as"?: CSSWideKeyword | any; + + /** + * SVG: Specifies the opacity of the outline on the current object. + * See SVG 1.1 https://www.w3.org/TR/SVG/painting.html#StrokeOpacityProperty + */ + "stroke-opacity"?: CSSWideKeyword | number; + + /** + * SVG: Specifies the width of the outline on the current object. + * See SVG 1.1 https://www.w3.org/TR/SVG/painting.html#StrokeWidthProperty + */ + "stroke-width"?: CSSWideKeyword | CSSPercentage | CSSLength; + + /** + * The tab-size CSS property is used to customise the width of a tab (U+0009) character. + */ + "tab-size"?: CSSWideKeyword | any; + + /** + * The 'table-layout' property controls the algorithm used to lay out the table cells, rows, and columns. + */ + "table-layout"?: CSSWideKeyword | any; + + /** + * The text-align CSS property describes how inline content like text is aligned in its parent block element. + * text-align does not control the alignment of block elements itself, only their inline content. + */ + "text-align"?: CSSWideKeyword | any; + + /** + * The text-align-last CSS property describes how the last line of a block element or a line before line break is aligned in its parent block element. + */ + "text-align-last"?: CSSWideKeyword | any; + + /** + * The text-decoration CSS property is used to set the text formatting to underline, overline, line-through or blink. + * underline and overline decorations are positioned under the text, line-through over it. + */ + "text-decoration"?: CSSWideKeyword | any; + + /** + * Sets the color of any text decoration, such as underlines, overlines, and strike throughs. + */ + "text-decoration-color"?: CSSWideKeyword | any; + + /** + * Sets what kind of line decorations are added to an element, such as underlines, overlines, etc. + */ + "text-decoration-line"?: CSSWideKeyword | any; + + "text-decoration-line-through"?: CSSWideKeyword | any; + + "text-decoration-none"?: CSSWideKeyword | any; + + "text-decoration-overline"?: CSSWideKeyword | any; + + /** + * Specifies what parts of an element’s content are skipped over when applying any text decoration. + */ + "text-decoration-skip"?: CSSWideKeyword | any; + + /** + * This property specifies the style of the text decoration line drawn on the specified element. + * The intended meaning for the values are the same as those of the border-style-properties. + */ + "text-decoration-style"?: CSSWideKeyword | any; + + "text-decoration-underline"?: CSSWideKeyword | any; + + /** + * The text-emphasis property will apply special emphasis marks to the elements text. + * Slightly similar to the text-decoration property only that this property can have affect on the line-height. + * It also is noted that this is shorthand for text-emphasis-style and for text-emphasis-color. + */ + "text-emphasis"?: CSSWideKeyword | any; + + /** + * The text-emphasis-color property specifies the foreground color of the emphasis marks. + */ + "text-emphasis-color"?: CSSWideKeyword | any; + + /** + * The text-emphasis-style property applies special emphasis marks to an element's text. + */ + "text-emphasis-style"?: CSSWideKeyword | any; + + /** + * This property helps determine an inline box's block-progression dimension, + * derived from the text-height and font-size properties for non-replaced elements, + * the height or the width for replaced elements, and the stacked block-progression dimension for inline-block elements. + * The block-progression dimension determines the position of the padding, border and margin for the element. + */ + "text-height"?: CSSWideKeyword | any; + + /** + * Specifies the amount of space horizontally that should be left on the first line of the text of an element. + * This horizontal spacing is at the beginning of the first line and is in respect to the left edge of the containing block box. + */ + "text-indent"?: CSSWideKeyword | any; + + "text-justify-trim"?: CSSWideKeyword | any; + + "text-kashida-space"?: CSSWideKeyword | any; + + /** + * The text-line-through property is a shorthand property for text-line-through-style, text-line-through-color and text-line-through-mode. + * (Considered obsolete; use text-decoration instead.) + */ + "text-line-through"?: CSSWideKeyword | any; + + /** + * Specifies the line colors for the line-through text decoration. + * (Considered obsolete; use text-decoration-color instead.) + */ + "text-line-through-color"?: CSSWideKeyword | any; + + /** + * Sets the mode for the line-through text decoration, determining whether the text decoration affects the space characters or not. + * (Considered obsolete; use text-decoration-skip instead.) + */ + "text-line-through-mode"?: CSSWideKeyword | any; + + /** + * Specifies the line style for line-through text decoration. + * (Considered obsolete; use text-decoration-style instead.) + */ + "text-line-through-style"?: CSSWideKeyword | any; + + /** + * Specifies the line width for the line-through text decoration. + */ + "text-line-through-width"?: CSSWideKeyword | any; + + /** + * The text-overflow shorthand CSS property determines how overflowed content that is not displayed is signaled to the users. + * It can be clipped, display an ellipsis ('…', U+2026 HORIZONTAL ELLIPSIS) or a Web author-defined string. + * It covers the two long-hand properties text-overflow-mode and text-overflow-ellipsis + */ + "text-overflow"?: CSSWideKeyword | any; + + /** + * The text-overline property is the shorthand for the text-overline-style, text-overline-width, text-overline-color, and text-overline-mode properties. + */ + "text-overline"?: CSSWideKeyword | any; + + /** + * Specifies the line color for the overline text decoration. + */ + "text-overline-color"?: CSSWideKeyword | any; + + /** + * Sets the mode for the overline text decoration, determining whether the text decoration affects the space characters or not. + */ + "text-overline-mode"?: CSSWideKeyword | any; + + /** + * Specifies the line style for overline text decoration. + */ + "text-overline-style"?: CSSWideKeyword | any; + + /** + * Specifies the line width for the overline text decoration. + */ + "text-overline-width"?: CSSWideKeyword | any; + + /** + * The text-rendering CSS property provides information to the browser about how to optimize when rendering text. + * Options are: legibility, speed or geometric precision. + */ + "text-rendering"?: CSSWideKeyword | any; + + /** + * Obsolete: unsupported. + */ + "text-script"?: CSSWideKeyword | any; + + /** + * The CSS text-shadow property applies one or more drop shadows to the text and of an element. + * Each shadow is specified as an offset from the text, along with optional color and blur radius values. + */ + "text-shadow"?: CSSWideKeyword | any; + + /** + * This property transforms text for styling purposes. (It has no effect on the underlying content.) + */ + "text-transform"?: CSSWideKeyword | any; + + /** + * Unsupported. + * This property will add a underline position value to the element that has an underline defined. + */ + "text-underline-position"?: CSSWideKeyword | any; + + /** + * After review this should be replaced by text-decoration should it not? + * This property will set the underline style for text with a line value for underline, overline, and line-through. + */ + "text-underline-style"?: CSSWideKeyword | any; + + /** + * This property specifies how far an absolutely positioned box's top margin edge is offset below the top edge of the box's containing block. + * For relatively positioned boxes, the offset is with respect to the top edges of the box itself (i.e., the box is given a position in the normal flow, + * then offset from that position according to these properties). + */ + top?: CSSWideKeyword | any; + + /** + * Determines whether touch input may trigger default behavior supplied by the user agent, such as panning or zooming. + */ + "touch-action"?: CSSWideKeyword | any; + + /** + * CSS transforms allow elements styled with CSS to be transformed in two-dimensional or three-dimensional space. + * Using this property, elements can be translated, rotated, scaled, and skewed. The value list may consist of 2D and/or 3D transform values. + */ + transform?: CSSWideKeyword | any; + + /** + * This property defines the origin of the transformation axes relative to the element to which the transformation is applied. + */ + "transform-origin"?: CSSWideKeyword | any; + + /** + * This property allows you to define the relative position of the origin of the transformation grid along the z-axis. + */ + "transform-origin-z"?: CSSWideKeyword | any; + + /** + * This property specifies how nested elements are rendered in 3D space relative to their parent. + */ + "transform-style"?: CSSWideKeyword | any; + + /** + * The transition CSS property is a shorthand property for transition-property, transition-duration, transition-timing-function, + * and transition-delay. It allows to define the transition between two states of an element. + */ + transition?: CSSWideKeyword | any; + + /** + * Defines when the transition will start. A value of ‘0s’ means the transition will execute as soon as the property is changed. + * Otherwise, the value specifies an offset from the moment the property is changed, and the transition will delay execution by that offset. + */ + "transition-delay"?: CSSWideKeyword | any; + + /** + * The 'transition-duration' property specifies the length of time a transition animation takes to complete. + */ + "transition-duration"?: CSSWideKeyword | any; + + /** + * The 'transition-property' property specifies the name of the CSS property to which the transition is applied. + */ + "transition-property"?: CSSWideKeyword | any; + + /** + * Sets the pace of action within a transition + */ + "transition-timing-function"?: CSSWideKeyword | any; + + /** + * The unicode-bidi CSS property specifies the level of embedding with respect to the bidirectional algorithm. + */ + "unicode-bidi"?: CSSWideKeyword | any; + + /** + * unicode-range allows you to set a specific range of characters to be downloaded from a font (embedded using @font-face) and made available for use on the current page. + */ + "unicode-range"?: CSSWideKeyword | any; + + /** + * This is for all the high level UX stuff. + */ + "user-focus"?: CSSWideKeyword | any; + + /** + * For inputing user content + */ + "user-input"?: CSSWideKeyword | any; + + /** + * The vertical-align property controls how inline elements or text are vertically aligned compared to the baseline. + * If this property is used on table-cells it controls the vertical alignment of content of the table cell. + */ + "vertical-align"?: CSSWideKeyword | any; + + /** + * The visibility property specifies whether the boxes generated by an element are rendered. + */ + visibility?: CSSWideKeyword | any; + + /** + * The voice-balance property sets the apparent position (in stereo sound) of the synthesized voice for spoken media. + */ + "voice-balance"?: CSSWideKeyword | any; + + /** + * The voice-duration property allows the author to explicitly set the amount of time it should take a speech synthesizer to read an element's content, + * for example to allow the speech to be synchronized with other media. + * With a value of auto (the default) the length of time it takes to read the content is determined by the content itself and the voice-rate property. + */ + "voice-duration"?: CSSWideKeyword | any; + + /** + * The voice-family property sets the speaker's voice used by a speech media agent to read an element. + * The speaker may be specified as a named character (to match a voice option in the speech reading software) + * or as a generic description of the age and gender of the voice. + * Similar to the font-family property for visual media, + * a comma-separated list of fallback options may be given in case the speech reader does not recognize the character name + * or cannot synthesize the requested combination of generic properties. + */ + "voice-family"?: CSSWideKeyword | any; + + /** + * The voice-pitch property sets pitch or tone (high or low) for the synthesized speech when reading an element; + * the pitch may be specified absolutely or relative to the normal pitch for the voice-family used to read the text. + */ + "voice-pitch"?: CSSWideKeyword | any; + + /** + * The voice-range property determines how much variation in pitch or tone will be created by the speech synthesize when reading an element. + * Emphasized text, grammatical structures and punctuation may all be rendered as changes in pitch, + * this property determines how strong or obvious those changes are; + * large ranges are associated with enthusiastic or emotional speech, + * while small ranges are associated with flat or mechanical speech. + */ + "voice-range"?: CSSWideKeyword | any; + + /** + * The voice-rate property sets the speed at which the voice synthesized by a speech media agent will read content. + */ + "voice-rate"?: CSSWideKeyword | any; + + /** + * The voice-stress property sets the level of vocal emphasis to be used for synthesized speech reading the element. + */ + "voice-stress"?: CSSWideKeyword | any; + + /** + * The voice-volume property sets the volume for spoken content in speech media. It replaces the deprecated volume property. + */ + "voice-volume"?: CSSWideKeyword | any; + + /** + * The white-space property controls whether and how white space inside the element is collapsed, and whether lines may wrap at unforced "soft wrap" opportunities. + */ + "white-space"?: CSSWideKeyword | any; + + /** + * Obsolete: unsupported. + */ + "white-space-treatment"?: CSSWideKeyword | any; + + /** + * In paged media, this property defines the mimimum number of lines + * that must be left at the top of the second page. + * See CSS 3 orphans, widows properties https://drafts.csswg.org/css-break-3/#widows-orphans + */ + widows?: CSSWideKeyword | number; + + /** + * Specifies the width of the content area of an element. The content area of the element width does not include the padding, border, and margin of the element. + */ + width?: CSSWideKeyword | any; + + /** + * The word-break property is often used when there is long generated content that is strung together without and spaces or hyphens to beak apart. + * A common case of this is when there is a long URL that does not have any hyphens. This case could potentially cause the breaking of the layout as it could extend past the parent element. + */ + "word-break"?: CSSWideKeyword | any; + + /** + * The word-spacing CSS property specifies the spacing behavior between "words". + */ + "word-spacing"?: CSSWideKeyword | any; + + /** + * An alias of css/properties/overflow-wrap, word-wrap defines whether to break words when the content exceeds the boundaries of its container. + */ + "word-wrap"?: CSSWideKeyword | any; + + /** + * Specifies how exclusions affect inline content within block-level elements. Elements lay out their inline content in their content area but wrap around exclusion areas. + */ + "wrap-flow"?: CSSWideKeyword | any; + + /** + * Set the value that is used to offset the inner wrap shape from other shapes. Inline content that intersects a shape with this property will be pushed by this shape's margin. + */ + "wrap-margin"?: CSSWideKeyword | any; + + /** + * Obsolete and unsupported. Do not use. + * This CSS property controls the text when it reaches the end of the block in which it is enclosed. + */ + "wrap-option"?: CSSWideKeyword | any; + + /** + * writing-mode specifies if lines of text are laid out horizontally or vertically, and the direction which lines of text and blocks progress. + */ + "writing-mode"?: CSSWideKeyword | any; + + /** + * The z-index property specifies the z-order of an element and its descendants. + * When elements overlap, z-order determines which one covers the other. + * See CSS 2 z-index property https://www.w3.org/TR/CSS2/visuren.html#z-index + */ + "z-index"?: CSSWideKeyword | "auto" | number; + + /** + * Sets the initial zoom factor of a document defined by @viewport. + * See CSS zoom descriptor https://drafts.csswg.org/css-device-adapt/#zoom-desc + */ + zoom?: CSSWideKeyword | "auto" | number | CSSPercentage; + + [propertyName: string]: any; + } + + type HTMLAutocapitalize = "off" | "none" | "on" | "sentences" | "words" | "characters"; type HTMLDir = "ltr" | "rtl" | "auto"; @@ -240,7 +1925,7 @@ declare global { id?: string; lang?: string; spellcheck?: boolean; - style?: Partial | string; + style?: CSSProperties | string; tabIndex?: number | string; tabindex?: number | string; title?: string; @@ -632,12 +2317,7 @@ declare global { interface TrackHTMLAttributes extends HTMLAttributes { default?: boolean; - kind?: - | "subtitles" - | "captions" - | "descriptions" - | "chapters" - | "metadata"; + kind?: "subtitles" | "captions" | "descriptions" | "chapters" | "metadata"; label?: string; src?: string; srclang?: string; From 03f1d3c264b7d8eb08278f63978feb9a5b8e93a2 Mon Sep 17 00:00:00 2001 From: Ryan Carniato Date: Thu, 18 Jun 2020 22:56:47 -0700 Subject: [PATCH 12/38] update versions --- package-lock.json | 20 ++++++++++---------- package.json | 8 ++++---- src/jsx.ts | 2 +- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4d5548d..9460c9a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "mobx-jsx", - "version": "0.11.2", + "version": "0.11.3", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -368,9 +368,9 @@ } }, "dom-expressions": { - "version": "0.18.5", - "resolved": "https://registry.npmjs.org/dom-expressions/-/dom-expressions-0.18.5.tgz", - "integrity": "sha512-kfTkgjjc/ZRJBWxBIlCGYpCiYeYx4z7/2t1KiEeaQW35ksb9Ws2RqRFJH2nGfTH1Y5DP9VVPF4g3YIcfS2Jm8A==", + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/dom-expressions/-/dom-expressions-0.19.0.tgz", + "integrity": "sha512-lnT2QQP9Pcf80YeThMHW98X4XWf2Ye8JfyEvtVDVEUw57KMWBUder/r5x12vX+6lrrQ+jrP7okGeKLWJqCEwQg==", "dev": true, "requires": { "babel-plugin-transform-rename-import": "^2.3.0" @@ -414,9 +414,9 @@ "dev": true }, "hyper-dom-expressions": { - "version": "0.18.5", - "resolved": "https://registry.npmjs.org/hyper-dom-expressions/-/hyper-dom-expressions-0.18.5.tgz", - "integrity": "sha512-dO7WqT+taVJKvYLjZ1uUwUPCF7a10SrpXHW1cEXoNxAQtKHKkvy+uxpy1Ix/bpQW2sruHkNhaQLl4BnewHYBzQ==", + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/hyper-dom-expressions/-/hyper-dom-expressions-0.19.0.tgz", + "integrity": "sha512-+1EcmI0xaWrzKq2dZM1APS9060jNOaLUHjmGzVp5MnbOnxDc6vhTSq/C3XKTmJQzad1WqhNLy67GmBZz9PotzQ==", "dev": true }, "is-module": { @@ -447,9 +447,9 @@ } }, "lit-dom-expressions": { - "version": "0.18.5", - "resolved": "https://registry.npmjs.org/lit-dom-expressions/-/lit-dom-expressions-0.18.5.tgz", - "integrity": "sha512-Qi4GMGdq4GIo4wpu45BP96g4azhZjoDOMqGvU/vl40RbzBJOr2E7umiYWpLMzGvvH5lj3rai3lqe928G4h0IJA==", + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/lit-dom-expressions/-/lit-dom-expressions-0.19.0.tgz", + "integrity": "sha512-wSWXDcA72T+nWvSFpbYkjrLR3UCB1nVF8yCKU6bMDlqbsIyPS2SE9seQOjm1YjpFGIaefjKKlYxgF5EKNIQKQQ==", "dev": true }, "lodash": { diff --git a/package.json b/package.json index 3ede4bf..dbff167 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "mobx-jsx", "description": "Raw MobX performance without the restraints of a Virtual DOM", - "version": "0.11.2", + "version": "0.11.3", "author": "Ryan Carniato", "license": "MIT", "repository": { @@ -18,9 +18,9 @@ "devDependencies": { "@babel/core": "7.9.0", "@babel/preset-typescript": "7.9.0", - "dom-expressions": "0.18.5", - "hyper-dom-expressions": "0.18.5", - "lit-dom-expressions": "0.18.5", + "dom-expressions": "0.19.0", + "hyper-dom-expressions": "0.19.0", + "lit-dom-expressions": "0.19.0", "mobx": "^5.15.4", "ncp": "2.0.0", "rollup": "^2.10.2", diff --git a/src/jsx.ts b/src/jsx.ts index e05a343..9f80275 100644 --- a/src/jsx.ts +++ b/src/jsx.ts @@ -7,7 +7,7 @@ declare global { */ namespace JSX { - type Element = Node | ArrayElement | FunctionElement | string | number | boolean | undefined; + type Element = Node | ArrayElement | FunctionElement | string | number | boolean | null | undefined; interface ArrayElement extends Array {} interface FunctionElement { From fc02716a5706fcbf5b39091c2bd561365c188ae9 Mon Sep 17 00:00:00 2001 From: Ryan Carniato Date: Sun, 21 Jun 2020 02:03:30 -0700 Subject: [PATCH 13/38] updates --- package-lock.json | 20 ++++++++++---------- package.json | 8 ++++---- src/lib.ts | 9 +++++---- 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9460c9a..04a8f9a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "mobx-jsx", - "version": "0.11.3", + "version": "0.11.4", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -368,9 +368,9 @@ } }, "dom-expressions": { - "version": "0.19.0", - "resolved": "https://registry.npmjs.org/dom-expressions/-/dom-expressions-0.19.0.tgz", - "integrity": "sha512-lnT2QQP9Pcf80YeThMHW98X4XWf2Ye8JfyEvtVDVEUw57KMWBUder/r5x12vX+6lrrQ+jrP7okGeKLWJqCEwQg==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/dom-expressions/-/dom-expressions-0.19.4.tgz", + "integrity": "sha512-C01qCLhQWAuYWBRes1Zxe//59JSjn8ZIGwC3/S58PtkpvzGPNFOumon4Y5HqW55DOFyRscy+214SNcNFo4PGbQ==", "dev": true, "requires": { "babel-plugin-transform-rename-import": "^2.3.0" @@ -414,9 +414,9 @@ "dev": true }, "hyper-dom-expressions": { - "version": "0.19.0", - "resolved": "https://registry.npmjs.org/hyper-dom-expressions/-/hyper-dom-expressions-0.19.0.tgz", - "integrity": "sha512-+1EcmI0xaWrzKq2dZM1APS9060jNOaLUHjmGzVp5MnbOnxDc6vhTSq/C3XKTmJQzad1WqhNLy67GmBZz9PotzQ==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/hyper-dom-expressions/-/hyper-dom-expressions-0.19.4.tgz", + "integrity": "sha512-K35hhc1bajt6j1b2UrsqpCjeCAyJXHWKUlonnqCdrbJ3kw1CuQXQnQDvmiN6G6k6mcaFDaiht4b3ZC37ckr11A==", "dev": true }, "is-module": { @@ -447,9 +447,9 @@ } }, "lit-dom-expressions": { - "version": "0.19.0", - "resolved": "https://registry.npmjs.org/lit-dom-expressions/-/lit-dom-expressions-0.19.0.tgz", - "integrity": "sha512-wSWXDcA72T+nWvSFpbYkjrLR3UCB1nVF8yCKU6bMDlqbsIyPS2SE9seQOjm1YjpFGIaefjKKlYxgF5EKNIQKQQ==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/lit-dom-expressions/-/lit-dom-expressions-0.19.4.tgz", + "integrity": "sha512-iE2IyWUKisOtjrXr02xOrRXwCAnDUyw/ps8dHvKsRq5exJRX5wCjHpVZjFW7GMRL0d9BjDrjvDNclEwGBqQuTw==", "dev": true }, "lodash": { diff --git a/package.json b/package.json index dbff167..27e3b30 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "mobx-jsx", "description": "Raw MobX performance without the restraints of a Virtual DOM", - "version": "0.11.3", + "version": "0.11.4", "author": "Ryan Carniato", "license": "MIT", "repository": { @@ -18,9 +18,9 @@ "devDependencies": { "@babel/core": "7.9.0", "@babel/preset-typescript": "7.9.0", - "dom-expressions": "0.19.0", - "hyper-dom-expressions": "0.19.0", - "lit-dom-expressions": "0.19.0", + "dom-expressions": "0.19.4", + "hyper-dom-expressions": "0.19.4", + "lit-dom-expressions": "0.19.4", "mobx": "^5.15.4", "ncp": "2.0.0", "rollup": "^2.10.2", diff --git a/src/lib.ts b/src/lib.ts index 0ae3304..a598b44 100644 --- a/src/lib.ts +++ b/src/lib.ts @@ -65,8 +65,7 @@ export function effect(fn: (prev?: T) => T) { } // only updates when boolean expression changes -export function memo(fn: () => T, equal: boolean) { - if (typeof fn !== "function") return fn; +export function memo(fn: () => T, equal?: boolean) { const o = observable.box(untracked(fn)); effect(prev => { const res = fn(); @@ -102,13 +101,15 @@ export function createComponent( for (let i = 0; i < dynamicKeys.length; i++) dynamicProperty(props, dynamicKeys[i] as string); } + let c; if (Comp.prototype && Comp.prototype.isClassComponent) { - return untracked(() => { + c = untracked(() => { const comp: Component = new (Comp as any)(props as T); return comp.render(props as T); }); } - return untracked(() => Comp(props as T)); + c = untracked(() => Comp(props as T)); + return typeof c === "function" ? memo(c) : c; } // dynamic import to support code splitting From d74c68174361e1abfe167fb22e47cf663f965e87 Mon Sep 17 00:00:00 2001 From: Ryan Carniato Date: Sun, 19 Jul 2020 20:18:05 -0700 Subject: [PATCH 14/38] fix multi inserts --- package-lock.json | 416 ++++++++++++++++++++++++---------------------- package.json | 20 +-- rollup.config.js | 2 +- src/lib.ts | 4 +- 4 files changed, 226 insertions(+), 216 deletions(-) diff --git a/package-lock.json b/package-lock.json index 04a8f9a..7c0d9b0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,302 +1,321 @@ { "name": "mobx-jsx", - "version": "0.11.4", + "version": "0.11.5", "lockfileVersion": 1, "requires": true, "dependencies": { "@babel/code-frame": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz", - "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", + "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==", "dev": true, "requires": { - "@babel/highlight": "^7.8.3" + "@babel/highlight": "^7.10.4" } }, "@babel/core": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.9.0.tgz", - "integrity": "sha512-kWc7L0fw1xwvI0zi8OKVBuxRVefwGOrKSQMvrQ3dW+bIIavBY3/NpXmpjMy7bQnLgwgzWQZ8TlM57YHpHNHz4w==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.8.3", - "@babel/generator": "^7.9.0", - "@babel/helper-module-transforms": "^7.9.0", - "@babel/helpers": "^7.9.0", - "@babel/parser": "^7.9.0", - "@babel/template": "^7.8.6", - "@babel/traverse": "^7.9.0", - "@babel/types": "^7.9.0", + "version": "7.10.5", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.10.5.tgz", + "integrity": "sha512-O34LQooYVDXPl7QWCdW9p4NR+QlzOr7xShPPJz8GsuCU3/8ua/wqTr7gmnxXv+WBESiGU/G5s16i6tUvHkNb+w==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.10.4", + "@babel/generator": "^7.10.5", + "@babel/helper-module-transforms": "^7.10.5", + "@babel/helpers": "^7.10.4", + "@babel/parser": "^7.10.5", + "@babel/template": "^7.10.4", + "@babel/traverse": "^7.10.5", + "@babel/types": "^7.10.5", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.1", "json5": "^2.1.2", - "lodash": "^4.17.13", + "lodash": "^4.17.19", "resolve": "^1.3.2", "semver": "^5.4.1", "source-map": "^0.5.0" } }, "@babel/generator": { - "version": "7.9.3", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.9.3.tgz", - "integrity": "sha512-RpxM252EYsz9qLUIq6F7YJyK1sv0wWDBFuztfDGWaQKzHjqDHysxSiRUpA/X9jmfqo+WzkAVKFaUily5h+gDCQ==", + "version": "7.10.5", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.10.5.tgz", + "integrity": "sha512-3vXxr3FEW7E7lJZiWQ3bM4+v/Vyr9C+hpolQ8BGFr9Y8Ri2tFLWTixmwKBafDujO1WVah4fhZBeU1bieKdghig==", "dev": true, "requires": { - "@babel/types": "^7.9.0", + "@babel/types": "^7.10.5", "jsesc": "^2.5.1", - "lodash": "^4.17.13", "source-map": "^0.5.0" } }, "@babel/helper-create-class-features-plugin": { - "version": "7.8.6", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.8.6.tgz", - "integrity": "sha512-klTBDdsr+VFFqaDHm5rR69OpEQtO2Qv8ECxHS1mNhJJvaHArR6a1xTf5K/eZW7eZpJbhCx3NW1Yt/sKsLXLblg==", + "version": "7.10.5", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.10.5.tgz", + "integrity": "sha512-0nkdeijB7VlZoLT3r/mY3bUkw3T8WG/hNw+FATs/6+pG2039IJWjTYL0VTISqsNHMUTEnwbVnc89WIJX9Qed0A==", "dev": true, "requires": { - "@babel/helper-function-name": "^7.8.3", - "@babel/helper-member-expression-to-functions": "^7.8.3", - "@babel/helper-optimise-call-expression": "^7.8.3", - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/helper-replace-supers": "^7.8.6", - "@babel/helper-split-export-declaration": "^7.8.3" + "@babel/helper-function-name": "^7.10.4", + "@babel/helper-member-expression-to-functions": "^7.10.5", + "@babel/helper-optimise-call-expression": "^7.10.4", + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/helper-replace-supers": "^7.10.4", + "@babel/helper-split-export-declaration": "^7.10.4" } }, "@babel/helper-function-name": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.8.3.tgz", - "integrity": "sha512-BCxgX1BC2hD/oBlIFUgOCQDOPV8nSINxCwM3o93xP4P9Fq6aV5sgv2cOOITDMtCfQ+3PvHp3l689XZvAM9QyOA==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.10.4.tgz", + "integrity": "sha512-YdaSyz1n8gY44EmN7x44zBn9zQ1Ry2Y+3GTA+3vH6Mizke1Vw0aWDM66FOYEPw8//qKkmqOckrGgTYa+6sceqQ==", "dev": true, "requires": { - "@babel/helper-get-function-arity": "^7.8.3", - "@babel/template": "^7.8.3", - "@babel/types": "^7.8.3" + "@babel/helper-get-function-arity": "^7.10.4", + "@babel/template": "^7.10.4", + "@babel/types": "^7.10.4" } }, "@babel/helper-get-function-arity": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.8.3.tgz", - "integrity": "sha512-FVDR+Gd9iLjUMY1fzE2SR0IuaJToR4RkCDARVfsBBPSP53GEqSFjD8gNyxg246VUyc/ALRxFaAK8rVG7UT7xRA==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.10.4.tgz", + "integrity": "sha512-EkN3YDB+SRDgiIUnNgcmiD361ti+AVbL3f3Henf6dqqUyr5dMsorno0lJWJuLhDhkI5sYEpgj6y9kB8AOU1I2A==", "dev": true, "requires": { - "@babel/types": "^7.8.3" + "@babel/types": "^7.10.4" } }, "@babel/helper-member-expression-to-functions": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.8.3.tgz", - "integrity": "sha512-fO4Egq88utkQFjbPrSHGmGLFqmrshs11d46WI+WZDESt7Wu7wN2G2Iu+NMMZJFDOVRHAMIkB5SNh30NtwCA7RA==", + "version": "7.10.5", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.10.5.tgz", + "integrity": "sha512-HiqJpYD5+WopCXIAbQDG0zye5XYVvcO9w/DHp5GsaGkRUaamLj2bEtu6i8rnGGprAhHM3qidCMgp71HF4endhA==", "dev": true, "requires": { - "@babel/types": "^7.8.3" + "@babel/types": "^7.10.5" } }, "@babel/helper-module-imports": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.8.3.tgz", - "integrity": "sha512-R0Bx3jippsbAEtzkpZ/6FIiuzOURPcMjHp+Z6xPe6DtApDJx+w7UYyOLanZqO8+wKR9G10s/FmHXvxaMd9s6Kg==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.10.4.tgz", + "integrity": "sha512-nEQJHqYavI217oD9+s5MUBzk6x1IlvoS9WTPfgG43CbMEeStE0v+r+TucWdx8KFGowPGvyOkDT9+7DHedIDnVw==", "dev": true, "requires": { - "@babel/types": "^7.8.3" + "@babel/types": "^7.10.4" } }, "@babel/helper-module-transforms": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.9.0.tgz", - "integrity": "sha512-0FvKyu0gpPfIQ8EkxlrAydOWROdHpBmiCiRwLkUiBGhCUPRRbVD2/tm3sFr/c/GWFrQ/ffutGUAnx7V0FzT2wA==", + "version": "7.10.5", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.10.5.tgz", + "integrity": "sha512-4P+CWMJ6/j1W915ITJaUkadLObmCRRSC234uctJfn/vHrsLNxsR8dwlcXv9ZhJWzl77awf+mWXSZEKt5t0OnlA==", "dev": true, "requires": { - "@babel/helper-module-imports": "^7.8.3", - "@babel/helper-replace-supers": "^7.8.6", - "@babel/helper-simple-access": "^7.8.3", - "@babel/helper-split-export-declaration": "^7.8.3", - "@babel/template": "^7.8.6", - "@babel/types": "^7.9.0", - "lodash": "^4.17.13" + "@babel/helper-module-imports": "^7.10.4", + "@babel/helper-replace-supers": "^7.10.4", + "@babel/helper-simple-access": "^7.10.4", + "@babel/helper-split-export-declaration": "^7.10.4", + "@babel/template": "^7.10.4", + "@babel/types": "^7.10.5", + "lodash": "^4.17.19" } }, "@babel/helper-optimise-call-expression": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.8.3.tgz", - "integrity": "sha512-Kag20n86cbO2AvHca6EJsvqAd82gc6VMGule4HwebwMlwkpXuVqrNRj6CkCV2sKxgi9MyAUnZVnZ6lJ1/vKhHQ==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.10.4.tgz", + "integrity": "sha512-n3UGKY4VXwXThEiKrgRAoVPBMqeoPgHVqiHZOanAJCG9nQUL2pLRQirUzl0ioKclHGpGqRgIOkgcIJaIWLpygg==", "dev": true, "requires": { - "@babel/types": "^7.8.3" + "@babel/types": "^7.10.4" } }, "@babel/helper-plugin-utils": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz", - "integrity": "sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.10.4.tgz", + "integrity": "sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg==", "dev": true }, "@babel/helper-replace-supers": { - "version": "7.8.6", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.8.6.tgz", - "integrity": "sha512-PeMArdA4Sv/Wf4zXwBKPqVj7n9UF/xg6slNRtZW84FM7JpE1CbG8B612FyM4cxrf4fMAMGO0kR7voy1ForHHFA==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.10.4.tgz", + "integrity": "sha512-sPxZfFXocEymYTdVK1UNmFPBN+Hv5mJkLPsYWwGBxZAxaWfFu+xqp7b6qWD0yjNuNL2VKc6L5M18tOXUP7NU0A==", "dev": true, "requires": { - "@babel/helper-member-expression-to-functions": "^7.8.3", - "@babel/helper-optimise-call-expression": "^7.8.3", - "@babel/traverse": "^7.8.6", - "@babel/types": "^7.8.6" + "@babel/helper-member-expression-to-functions": "^7.10.4", + "@babel/helper-optimise-call-expression": "^7.10.4", + "@babel/traverse": "^7.10.4", + "@babel/types": "^7.10.4" } }, "@babel/helper-simple-access": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.8.3.tgz", - "integrity": "sha512-VNGUDjx5cCWg4vvCTR8qQ7YJYZ+HBjxOgXEl7ounz+4Sn7+LMD3CFrCTEU6/qXKbA2nKg21CwhhBzO0RpRbdCw==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.10.4.tgz", + "integrity": "sha512-0fMy72ej/VEvF8ULmX6yb5MtHG4uH4Dbd6I/aHDb/JVg0bbivwt9Wg+h3uMvX+QSFtwr5MeItvazbrc4jtRAXw==", "dev": true, "requires": { - "@babel/template": "^7.8.3", - "@babel/types": "^7.8.3" + "@babel/template": "^7.10.4", + "@babel/types": "^7.10.4" } }, "@babel/helper-split-export-declaration": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.8.3.tgz", - "integrity": "sha512-3x3yOeyBhW851hroze7ElzdkeRXQYQbFIb7gLK1WQYsw2GWDay5gAJNw1sWJ0VFP6z5J1whqeXH/WCdCjZv6dA==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.10.4.tgz", + "integrity": "sha512-pySBTeoUff56fL5CBU2hWm9TesA4r/rOkI9DyJLvvgz09MB9YtfIYe3iBriVaYNaPe+Alua0vBIOVOLs2buWhg==", "dev": true, "requires": { - "@babel/types": "^7.8.3" + "@babel/types": "^7.10.4" } }, "@babel/helper-validator-identifier": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.9.0.tgz", - "integrity": "sha512-6G8bQKjOh+of4PV/ThDm/rRqlU7+IGoJuofpagU5GlEl29Vv0RGqqt86ZGRV8ZuSOY3o+8yXl5y782SMcG7SHw==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz", + "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==", "dev": true }, "@babel/helpers": { - "version": "7.9.2", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.9.2.tgz", - "integrity": "sha512-JwLvzlXVPjO8eU9c/wF9/zOIN7X6h8DYf7mG4CiFRZRvZNKEF5dQ3H3V+ASkHoIB3mWhatgl5ONhyqHRI6MppA==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.10.4.tgz", + "integrity": "sha512-L2gX/XeUONeEbI78dXSrJzGdz4GQ+ZTA/aazfUsFaWjSe95kiCuOZ5HsXvkiw3iwF+mFHSRUfJU8t6YavocdXA==", "dev": true, "requires": { - "@babel/template": "^7.8.3", - "@babel/traverse": "^7.9.0", - "@babel/types": "^7.9.0" + "@babel/template": "^7.10.4", + "@babel/traverse": "^7.10.4", + "@babel/types": "^7.10.4" } }, "@babel/highlight": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.9.0.tgz", - "integrity": "sha512-lJZPilxX7Op3Nv/2cvFdnlepPXDxi29wxteT57Q965oc5R9v86ztx0jfxVrTcBk8C2kcPkkDa2Z4T3ZsPPVWsQ==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", + "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.9.0", + "@babel/helper-validator-identifier": "^7.10.4", "chalk": "^2.0.0", "js-tokens": "^4.0.0" } }, "@babel/parser": { - "version": "7.9.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.9.3.tgz", - "integrity": "sha512-E6SpIDJZ0cZAKoCNk+qSDd0ChfTnpiJN9FfNf3RZ20dzwA2vL2oq5IX1XTVT+4vDmRlta2nGk5HGMMskJAR+4A==", + "version": "7.10.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.10.5.tgz", + "integrity": "sha512-wfryxy4bE1UivvQKSQDU4/X6dr+i8bctjUjj8Zyt3DQy7NtPizJXT8M52nqpNKL+nq2PW8lxk4ZqLj0fD4B4hQ==", "dev": true }, "@babel/plugin-syntax-typescript": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.8.3.tgz", - "integrity": "sha512-GO1MQ/SGGGoiEXY0e0bSpHimJvxqB7lktLLIq2pv8xG7WZ8IMEle74jIe1FhprHBWjwjZtXHkycDLZXIWM5Wfg==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.10.4.tgz", + "integrity": "sha512-oSAEz1YkBCAKr5Yiq8/BNtvSAPwkp/IyUnwZogd8p+F0RuYQQrLeRUzIQhueQTTBy/F+a40uS7OFKxnkRvmvFQ==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.8.3" + "@babel/helper-plugin-utils": "^7.10.4" } }, "@babel/plugin-transform-typescript": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.9.0.tgz", - "integrity": "sha512-GRffJyCu16H3tEhbt9Q4buVFFBqrgS8FzTuhqSxlXNgmqD8aw2xmwtRwrvWXXlw7gHs664uqacsJymHJ9SUE/Q==", + "version": "7.10.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.10.5.tgz", + "integrity": "sha512-YCyYsFrrRMZ3qR7wRwtSSJovPG5vGyG4ZdcSAivGwTfoasMp3VOB/AKhohu3dFtmB4cCDcsndCSxGtrdliCsZQ==", "dev": true, "requires": { - "@babel/helper-create-class-features-plugin": "^7.8.3", - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/plugin-syntax-typescript": "^7.8.3" + "@babel/helper-create-class-features-plugin": "^7.10.5", + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/plugin-syntax-typescript": "^7.10.4" } }, "@babel/preset-typescript": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.9.0.tgz", - "integrity": "sha512-S4cueFnGrIbvYJgwsVFKdvOmpiL0XGw9MFW9D0vgRys5g36PBhZRL8NX8Gr2akz8XRtzq6HuDXPD/1nniagNUg==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.10.4.tgz", + "integrity": "sha512-SdYnvGPv+bLlwkF2VkJnaX/ni1sMNetcGI1+nThF1gyv6Ph8Qucc4ZZAjM5yZcE/AKRXIOTZz7eSRDWOEjPyRQ==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/plugin-transform-typescript": "^7.9.0" + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/plugin-transform-typescript": "^7.10.4" } }, "@babel/template": { - "version": "7.8.6", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.8.6.tgz", - "integrity": "sha512-zbMsPMy/v0PWFZEhQJ66bqjhH+z0JgMoBWuikXybgG3Gkd/3t5oQ1Rw2WQhnSrsOmsKXnZOx15tkC4qON/+JPg==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.10.4.tgz", + "integrity": "sha512-ZCjD27cGJFUB6nmCB1Enki3r+L5kJveX9pq1SvAUKoICy6CZ9yD8xO086YXdYhvNjBdnekm4ZnaP5yC8Cs/1tA==", "dev": true, "requires": { - "@babel/code-frame": "^7.8.3", - "@babel/parser": "^7.8.6", - "@babel/types": "^7.8.6" + "@babel/code-frame": "^7.10.4", + "@babel/parser": "^7.10.4", + "@babel/types": "^7.10.4" } }, "@babel/traverse": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.9.0.tgz", - "integrity": "sha512-jAZQj0+kn4WTHO5dUZkZKhbFrqZE7K5LAQ5JysMnmvGij+wOdr+8lWqPeW0BcF4wFwrEXXtdGO7wcV6YPJcf3w==", + "version": "7.10.5", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.10.5.tgz", + "integrity": "sha512-yc/fyv2gUjPqzTz0WHeRJH2pv7jA9kA7mBX2tXl/x5iOE81uaVPuGPtaYk7wmkx4b67mQ7NqI8rmT2pF47KYKQ==", "dev": true, "requires": { - "@babel/code-frame": "^7.8.3", - "@babel/generator": "^7.9.0", - "@babel/helper-function-name": "^7.8.3", - "@babel/helper-split-export-declaration": "^7.8.3", - "@babel/parser": "^7.9.0", - "@babel/types": "^7.9.0", + "@babel/code-frame": "^7.10.4", + "@babel/generator": "^7.10.5", + "@babel/helper-function-name": "^7.10.4", + "@babel/helper-split-export-declaration": "^7.10.4", + "@babel/parser": "^7.10.5", + "@babel/types": "^7.10.5", "debug": "^4.1.0", "globals": "^11.1.0", - "lodash": "^4.17.13" + "lodash": "^4.17.19" } }, "@babel/types": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.0.tgz", - "integrity": "sha512-BS9JKfXkzzJl8RluW4JGknzpiUV7ZrvTayM6yfqLTVBEnFtyowVIOu6rqxRd5cVO6yGoWf4T8u8dgK9oB+GCng==", + "version": "7.10.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.5.tgz", + "integrity": "sha512-ixV66KWfCI6GKoA/2H9v6bQdbfXEwwpOdQ8cRvb4F+eyvhlaHxWFMQB4+3d9QFJXZsiiiqVrewNV0DFEQpyT4Q==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.9.0", - "lodash": "^4.17.13", + "@babel/helper-validator-identifier": "^7.10.4", + "lodash": "^4.17.19", "to-fast-properties": "^2.0.0" } }, + "@rollup/plugin-babel": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-babel/-/plugin-babel-5.1.0.tgz", + "integrity": "sha512-zXBEYmfiLAMvB+ZBa6m/q9hsQYAq1sUFdjuP1F6C2pf6uQcpHwAWQveZgzS63zXdKPUYHD3Dr7BhjCqcr0bbLw==", + "dev": true, + "requires": { + "@babel/helper-module-imports": "^7.7.4", + "@rollup/pluginutils": "^3.0.8" + } + }, "@rollup/plugin-node-resolve": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-7.1.1.tgz", - "integrity": "sha512-14ddhD7TnemeHE97a4rLOhobfYvUVcaYuqTnL8Ti7Jxi9V9Jr5LY7Gko4HZ5k4h4vqQM0gBQt6tsp9xXW94WPA==", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-8.4.0.tgz", + "integrity": "sha512-LFqKdRLn0ShtQyf6SBYO69bGE1upV6wUhBX0vFOUnLAyzx5cwp8svA0eHUnu8+YU57XOkrMtfG63QOpQx25pHQ==", "dev": true, "requires": { - "@rollup/pluginutils": "^3.0.6", - "@types/resolve": "0.0.8", + "@rollup/pluginutils": "^3.1.0", + "@types/resolve": "1.17.1", "builtin-modules": "^3.1.0", + "deep-freeze": "^0.0.1", + "deepmerge": "^4.2.2", "is-module": "^1.0.0", - "resolve": "^1.14.2" + "resolve": "^1.17.0" } }, "@rollup/pluginutils": { - "version": "3.0.8", - "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.0.8.tgz", - "integrity": "sha512-rYGeAc4sxcZ+kPG/Tw4/fwJODC3IXHYDH4qusdN/b6aLw5LPUbzpecYbEJh4sVQGPFJxd2dBU4kc1H3oy9/bnw==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.1.0.tgz", + "integrity": "sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==", "dev": true, "requires": { - "estree-walker": "^1.0.1" + "@types/estree": "0.0.39", + "estree-walker": "^1.0.1", + "picomatch": "^2.2.2" } }, + "@types/estree": { + "version": "0.0.39", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", + "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", + "dev": true + }, "@types/node": { - "version": "13.9.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-13.9.3.tgz", - "integrity": "sha512-01s+ac4qerwd6RHD+mVbOEsraDHSgUaefQlEdBbUolnQFjKwCr7luvAlEwW1RFojh67u0z4OUTjPn9LEl4zIkA==", + "version": "14.0.23", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.23.tgz", + "integrity": "sha512-Z4U8yDAl5TFkmYsZdFPdjeMa57NOvnaf1tljHzhouaPEp7LCj2JKkejpI1ODviIAQuW4CcQmxkQ77rnLsOOoKw==", "dev": true }, "@types/resolve": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-0.0.8.tgz", - "integrity": "sha512-auApPaJf3NPfe18hSoJkp8EbZzer2ISk7o8mCC3M9he/a04+gbMF97NkpD2S8riMGvm4BMRI59/SZQSaLTKpsQ==", + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.17.1.tgz", + "integrity": "sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==", "dev": true, "requires": { "@types/node": "*" @@ -367,10 +386,22 @@ "ms": "^2.1.1" } }, + "deep-freeze": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/deep-freeze/-/deep-freeze-0.0.1.tgz", + "integrity": "sha1-OgsABd4YZygZ39OM0x+RF5yJPoQ=", + "dev": true + }, + "deepmerge": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", + "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==", + "dev": true + }, "dom-expressions": { - "version": "0.19.4", - "resolved": "https://registry.npmjs.org/dom-expressions/-/dom-expressions-0.19.4.tgz", - "integrity": "sha512-C01qCLhQWAuYWBRes1Zxe//59JSjn8ZIGwC3/S58PtkpvzGPNFOumon4Y5HqW55DOFyRscy+214SNcNFo4PGbQ==", + "version": "0.19.10", + "resolved": "https://registry.npmjs.org/dom-expressions/-/dom-expressions-0.19.10.tgz", + "integrity": "sha512-Dk46xCntigMO2/JPc/O+7SwbTxqTI1530ns7hvztntbXcTKSVQ6FoNRLAmgaYMQPtFR3eVbqnODoJoZyYQBFsA==", "dev": true, "requires": { "babel-plugin-transform-rename-import": "^2.3.0" @@ -414,9 +445,9 @@ "dev": true }, "hyper-dom-expressions": { - "version": "0.19.4", - "resolved": "https://registry.npmjs.org/hyper-dom-expressions/-/hyper-dom-expressions-0.19.4.tgz", - "integrity": "sha512-K35hhc1bajt6j1b2UrsqpCjeCAyJXHWKUlonnqCdrbJ3kw1CuQXQnQDvmiN6G6k6mcaFDaiht4b3ZC37ckr11A==", + "version": "0.19.10", + "resolved": "https://registry.npmjs.org/hyper-dom-expressions/-/hyper-dom-expressions-0.19.10.tgz", + "integrity": "sha512-aTdkWbGsWctrjnuK1PjUq+xfK98rs2MaU9RyvoTOOKwKJV6CxZz9ogHQ2w+gFSQetBcd4Stdfqj+RXJ3V+oPdQ==", "dev": true }, "is-module": { @@ -438,24 +469,24 @@ "dev": true }, "json5": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.2.tgz", - "integrity": "sha512-MoUOQ4WdiN3yxhm7NEVJSJrieAo5hNSLQ5sj05OTRHPL9HOBy8u4Bu88jsC1jvqAdN+E1bJmsUcZH+1HQxliqQ==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz", + "integrity": "sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==", "dev": true, "requires": { "minimist": "^1.2.5" } }, "lit-dom-expressions": { - "version": "0.19.4", - "resolved": "https://registry.npmjs.org/lit-dom-expressions/-/lit-dom-expressions-0.19.4.tgz", - "integrity": "sha512-iE2IyWUKisOtjrXr02xOrRXwCAnDUyw/ps8dHvKsRq5exJRX5wCjHpVZjFW7GMRL0d9BjDrjvDNclEwGBqQuTw==", + "version": "0.19.10", + "resolved": "https://registry.npmjs.org/lit-dom-expressions/-/lit-dom-expressions-0.19.10.tgz", + "integrity": "sha512-7kQj+g32kApWWlA6qHk4MWgUTSG3U4DwCwvaxITz1sJAUbXLQmbBKJKNlKO4Gl6eWtCCgV9pM2Hl0MMrNMqvvQ==", "dev": true }, "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "version": "4.17.19", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", + "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==", "dev": true }, "minimist": { @@ -488,51 +519,30 @@ "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", "dev": true }, + "picomatch": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", + "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", + "dev": true + }, "resolve": { - "version": "1.15.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.15.1.tgz", - "integrity": "sha512-84oo6ZTtoTUpjgNEr5SJyzQhzL72gaRodsSfyxC/AXRvwu0Yse9H8eF9IpGo7b8YetZhlI6v7ZQ6bKBFV/6S7w==", + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", "dev": true, "requires": { "path-parse": "^1.0.6" } }, "rollup": { - "version": "2.10.2", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.10.2.tgz", - "integrity": "sha512-tivFM8UXBlYOUqpBYD3pRktYpZvK/eiCQ190eYlrAyrpE/lzkyG2gbawroNdbwmzyUc7Y4eT297xfzv0BDh9qw==", + "version": "2.22.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.22.1.tgz", + "integrity": "sha512-K9AUQUCJkVqC+A7uUDacfhmpEeAjc2uOmSpvGI5xaYsm8pXgy4ZWEM8wHPfKj11xvCwFZppkRDo8a0RESJXCnw==", "dev": true, "requires": { "fsevents": "~2.1.2" } }, - "rollup-plugin-babel": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/rollup-plugin-babel/-/rollup-plugin-babel-4.4.0.tgz", - "integrity": "sha512-Lek/TYp1+7g7I+uMfJnnSJ7YWoD58ajo6Oarhlex7lvUce+RCKRuGRSgztDO3/MF/PuGKmUL5iTHKf208UNszw==", - "dev": true, - "requires": { - "@babel/helper-module-imports": "^7.0.0", - "rollup-pluginutils": "^2.8.1" - } - }, - "rollup-pluginutils": { - "version": "2.8.2", - "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz", - "integrity": "sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ==", - "dev": true, - "requires": { - "estree-walker": "^0.6.1" - }, - "dependencies": { - "estree-walker": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.1.tgz", - "integrity": "sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==", - "dev": true - } - } - }, "safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", @@ -567,9 +577,9 @@ "dev": true }, "typescript": { - "version": "3.8.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.8.3.tgz", - "integrity": "sha512-MYlEfn5VrLNsgudQTVJeNaQFUAI7DkhnOjdpAp4T+ku1TfQClewlbSuTVHiA+8skNBgaf02TL/kLOvig4y3G8w==", + "version": "3.9.7", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.7.tgz", + "integrity": "sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw==", "dev": true } } diff --git a/package.json b/package.json index 27e3b30..cf981a2 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "mobx-jsx", "description": "Raw MobX performance without the restraints of a Virtual DOM", - "version": "0.11.4", + "version": "0.11.5", "author": "Ryan Carniato", "license": "MIT", "repository": { @@ -16,17 +16,17 @@ "prepublishOnly": "npm run build" }, "devDependencies": { - "@babel/core": "7.9.0", - "@babel/preset-typescript": "7.9.0", - "dom-expressions": "0.19.4", - "hyper-dom-expressions": "0.19.4", - "lit-dom-expressions": "0.19.4", + "@babel/core": "7.10.5", + "@babel/preset-typescript": "7.10.4", + "dom-expressions": "0.19.10", + "hyper-dom-expressions": "0.19.10", + "lit-dom-expressions": "0.19.10", "mobx": "^5.15.4", "ncp": "2.0.0", - "rollup": "^2.10.2", - "rollup-plugin-babel": "4.4.0", - "@rollup/plugin-node-resolve": "7.1.1", - "typescript": "3.8.3" + "rollup": "^2.22.1", + "@rollup/plugin-babel": "5.1.0", + "@rollup/plugin-node-resolve": "8.4.0", + "typescript": "3.9.7" }, "peerDependencies": { "mobx": "*" diff --git a/rollup.config.js b/rollup.config.js index 1d0c1c2..fc20999 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,4 +1,4 @@ -import babel from 'rollup-plugin-babel'; +import babel from '@rollup/plugin-babel'; import nodeResolve from '@rollup/plugin-node-resolve'; const plugins = [ diff --git a/src/lib.ts b/src/lib.ts index a598b44..34dcf6c 100644 --- a/src/lib.ts +++ b/src/lib.ts @@ -45,8 +45,8 @@ export function cleanup(fn: () => void) { (ref = globalContext) != null && ref.disposables.push(fn); } -export function effect(fn: (prev?: T) => T) { - let current: T, d: any[]; +export function effect(fn: (prev?: T) => T, current?: T) { + let d: any[]; const context = { disposables: d = [], owner: globalContext From 7c7550975d85a9122c81ff54cf0fdfd26168fa35 Mon Sep 17 00:00:00 2001 From: Ryan Carniato Date: Sun, 19 Jul 2020 20:25:56 -0700 Subject: [PATCH 15/38] Fix class components --- package.json | 2 +- src/lib.ts | 26 ++++++++++---------------- 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/package.json b/package.json index cf981a2..41908c2 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "mobx-jsx", "description": "Raw MobX performance without the restraints of a Virtual DOM", - "version": "0.11.5", + "version": "0.11.6", "author": "Ryan Carniato", "license": "MIT", "repository": { diff --git a/src/lib.ts b/src/lib.ts index 34dcf6c..f34427f 100644 --- a/src/lib.ts +++ b/src/lib.ts @@ -19,7 +19,9 @@ export class Component { constructor(props: T) { this.props = props; } - render(props: T) { return props.children } + render(props: T) { + return props.children; + } } Component.prototype.isClassComponent = true; @@ -71,7 +73,7 @@ export function memo(fn: () => T, equal?: boolean) { const res = fn(); (!equal || prev !== res) && o.set(res); return res; - }) + }); return () => o.get(); } @@ -88,7 +90,7 @@ function dynamicProperty(props: any, key: string) { get() { return src(); }, - enumerable: true, + enumerable: true }); } @@ -98,8 +100,7 @@ export function createComponent( dynamicKeys?: (keyof T)[] ): JSX.Element { if (dynamicKeys) { - for (let i = 0; i < dynamicKeys.length; i++) - dynamicProperty(props, dynamicKeys[i] as string); + for (let i = 0; i < dynamicKeys.length; i++) dynamicProperty(props, dynamicKeys[i] as string); } let c; if (Comp.prototype && Comp.prototype.isClassComponent) { @@ -107,8 +108,7 @@ export function createComponent( const comp: Component = new (Comp as any)(props as T); return comp.render(props as T); }); - } - c = untracked(() => Comp(props as T)); + } else c = untracked(() => Comp(props as T)); return typeof c === "function" ? memo(c) : c; } @@ -118,9 +118,7 @@ export function lazy(fn: () => Promise<{ default: T }>) { let Comp: T; const result = observable.box(); fn().then(component => result.set(component.default)); - const rendered = computed( - () => (Comp = result.get()) && untracked(() => Comp(props)) - ); + const rendered = computed(() => (Comp = result.get()) && untracked(() => Comp(props))); return () => rendered.get(); }; } @@ -137,9 +135,7 @@ export function useContext(context: Context) { function lookup(owner: ContextOwner | null, key: symbol | string): any { return ( - owner && - ((owner.context && owner.context[key]) || - (owner.owner && lookup(owner.owner, key))) + owner && ((owner.context && owner.context[key]) || (owner.owner && lookup(owner.owner, key))) ); } @@ -153,9 +149,7 @@ function resolveChildren(children: any): any { const results: any[] = []; for (let i = 0; i < children.length; i++) { let result = resolveChildren(children[i]); - Array.isArray(result) - ? results.push.apply(results, result) - : results.push(result); + Array.isArray(result) ? results.push.apply(results, result) : results.push(result); } return results; } From a5fb1b45c7def11e788e0012113e2eae3879b96e Mon Sep 17 00:00:00 2001 From: Ryan Carniato Date: Tue, 21 Jul 2020 04:29:40 -0700 Subject: [PATCH 16/38] Move memo back to map helper/update for strict mode --- package.json | 2 +- src/lib.ts | 32 ++++++++++++++++++-------------- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/package.json b/package.json index 41908c2..f33b0a2 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "mobx-jsx", "description": "Raw MobX performance without the restraints of a Virtual DOM", - "version": "0.11.6", + "version": "0.11.7", "author": "Ryan Carniato", "license": "MIT", "repository": { diff --git a/src/lib.ts b/src/lib.ts index f34427f..8d9a897 100644 --- a/src/lib.ts +++ b/src/lib.ts @@ -1,4 +1,4 @@ -import { autorun, computed, untracked, $mobx, IObservableArray, observable } from "mobx"; +import { autorun, computed, untracked, $mobx, IObservableArray, observable, action } from "mobx"; type ContextOwner = { disposables: any[]; @@ -68,10 +68,11 @@ export function effect(fn: (prev?: T) => T, current?: T) { // only updates when boolean expression changes export function memo(fn: () => T, equal?: boolean) { - const o = observable.box(untracked(fn)); + const o = observable.box(untracked(fn)), + update = action((r: T) => o.set(r)); effect(prev => { const res = fn(); - (!equal || prev !== res) && o.set(res); + (!equal || prev !== res) && update(res); return res; }); return () => o.get(); @@ -104,20 +105,21 @@ export function createComponent( } let c; if (Comp.prototype && Comp.prototype.isClassComponent) { - c = untracked(() => { + return untracked(() => { const comp: Component = new (Comp as any)(props as T); return comp.render(props as T); }); - } else c = untracked(() => Comp(props as T)); - return typeof c === "function" ? memo(c) : c; + } + return untracked(() => Comp(props as T)); } // dynamic import to support code splitting export function lazy(fn: () => Promise<{ default: T }>) { return (props: object) => { let Comp: T; - const result = observable.box(); - fn().then(component => result.set(component.default)); + const result = observable.box(), + update = action((component: { default: T }) => result.set(component.default)); + fn().then(update); const rendered = computed(() => (Comp = result.get()) && untracked(() => Comp(props))); return () => rendered.get(); }; @@ -141,8 +143,9 @@ function lookup(owner: ContextOwner | null, key: symbol | string): any { function resolveChildren(children: any): any { if (typeof children === "function") { - const c = observable.box(); - effect(() => c.set(children())); + const c = observable.box(), + update = action((child: any) => c.set(child)); + effect(() => update(children())); return () => c.get(); } if (Array.isArray(children)) { @@ -158,10 +161,11 @@ function resolveChildren(children: any): any { function createProvider(id: symbol) { return function provider(props: { value: unknown; children: any }) { - let rendered = observable.box(); + let rendered = observable.box(), + update = action(() => rendered.set(resolveChildren(props.children))) effect(() => { globalContext!.context = { [id]: props.value }; - rendered.set(untracked(() => resolveChildren(props.children))); + update(); }); return () => rendered.get(); }; @@ -179,7 +183,7 @@ export function map( cleanup(() => { for (let i = 0, length = disposers.length; i < length; i++) disposers[i](); }); - return () => { + return memo(() => { list[$mobx].atom.reportObserved(); let newItems = list, i: number, @@ -294,5 +298,5 @@ export function map( disposers[j] = disposer; return mapFn(newItems[j], j); } - }; + }); } From 55bf622e312adfd6841b5a5ef7a42035f1a37ab9 Mon Sep 17 00:00:00 2001 From: Ryan Carniato Date: Tue, 21 Jul 2020 04:54:55 -0700 Subject: [PATCH 17/38] remove map memo only necessary for components not helpers --- src/lib.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib.ts b/src/lib.ts index 8d9a897..e89ad39 100644 --- a/src/lib.ts +++ b/src/lib.ts @@ -183,7 +183,7 @@ export function map( cleanup(() => { for (let i = 0, length = disposers.length; i < length; i++) disposers[i](); }); - return memo(() => { + return () => { list[$mobx].atom.reportObserved(); let newItems = list, i: number, @@ -298,5 +298,5 @@ export function map( disposers[j] = disposer; return mapFn(newItems[j], j); } - }); + }; } From 1f9abe392bf62dc14c07c815d079b504c7a33451 Mon Sep 17 00:00:00 2001 From: Ryan Carniato Date: Tue, 21 Jul 2020 20:33:00 -0700 Subject: [PATCH 18/38] fix cleanup ref bug --- package.json | 2 +- src/lib.ts | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index f33b0a2..b399bb0 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "mobx-jsx", "description": "Raw MobX performance without the restraints of a Virtual DOM", - "version": "0.11.7", + "version": "0.11.8", "author": "Ryan Carniato", "license": "MIT", "repository": { diff --git a/src/lib.ts b/src/lib.ts index e89ad39..abbe13e 100644 --- a/src/lib.ts +++ b/src/lib.ts @@ -48,19 +48,20 @@ export function cleanup(fn: () => void) { } export function effect(fn: (prev?: T) => T, current?: T) { - let d: any[]; const context = { - disposables: d = [], + disposables: [] as (() => void)[], owner: globalContext }, dispose = autorun(() => { + const d = context.disposables; for (let k = 0, len = d.length; k < len; k++) d[k](); - d = []; + context.disposables = []; globalContext = context; current = fn(current); globalContext = globalContext.owner; }); cleanup(() => { + const d = context.disposables; for (let k = 0, len = d.length; k < len; k++) d[k](); dispose(); }); From 491d5a2f59bce4d8310baea8285058486f6e1895 Mon Sep 17 00:00:00 2001 From: Ryan Carniato Date: Tue, 21 Jul 2020 20:59:26 -0700 Subject: [PATCH 19/38] better fix --- package.json | 2 +- src/lib.ts | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index b399bb0..1f1c0a7 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "mobx-jsx", "description": "Raw MobX performance without the restraints of a Virtual DOM", - "version": "0.11.8", + "version": "0.11.9", "author": "Ryan Carniato", "license": "MIT", "repository": { diff --git a/src/lib.ts b/src/lib.ts index abbe13e..9a1857a 100644 --- a/src/lib.ts +++ b/src/lib.ts @@ -48,23 +48,24 @@ export function cleanup(fn: () => void) { } export function effect(fn: (prev?: T) => T, current?: T) { + let disposed const context = { disposables: [] as (() => void)[], owner: globalContext }, - dispose = autorun(() => { + cleanupFn = (final: boolean) => { const d = context.disposables; for (let k = 0, len = d.length; k < len; k++) d[k](); context.disposables = []; + final && dispose(); + }, + dispose = autorun(() => { + cleanupFn(false); globalContext = context; current = fn(current); globalContext = globalContext.owner; }); - cleanup(() => { - const d = context.disposables; - for (let k = 0, len = d.length; k < len; k++) d[k](); - dispose(); - }); + cleanup(() => cleanupFn(true)); } // only updates when boolean expression changes From 088d20d5a86a84f9f0ef0c31f6beef35edc6efb0 Mon Sep 17 00:00:00 2001 From: Ryan Carniato Date: Tue, 21 Jul 2020 22:22:42 -0700 Subject: [PATCH 20/38] Fix cyclic timing issue --- package.json | 2 +- src/lib.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 1f1c0a7..c77142e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "mobx-jsx", "description": "Raw MobX performance without the restraints of a Virtual DOM", - "version": "0.11.9", + "version": "0.11.10", "author": "Ryan Carniato", "license": "MIT", "repository": { diff --git a/src/lib.ts b/src/lib.ts index 9a1857a..64bca6b 100644 --- a/src/lib.ts +++ b/src/lib.ts @@ -55,8 +55,8 @@ export function effect(fn: (prev?: T) => T, current?: T) { }, cleanupFn = (final: boolean) => { const d = context.disposables; - for (let k = 0, len = d.length; k < len; k++) d[k](); context.disposables = []; + for (let k = 0, len = d.length; k < len; k++) d[k](); final && dispose(); }, dispose = autorun(() => { From 387667aaa6899eb559a98288fec4773f71fdc2c3 Mon Sep 17 00:00:00 2001 From: Tito Date: Mon, 31 Aug 2020 16:22:28 -0300 Subject: [PATCH 21/38] Update README.md lazy example + minor style changes --- README.md | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index cbc6c17..a2f0c94 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ And include 'babel-plugin-jsx-dom-expressions' in your babelrc, webpack babel lo > npm install mobx-jsx babel-plugin-jsx-dom-expressions ``` -## Example +## Examples [Mobx Counter(Functions)](https://codesandbox.io/s/mobx-counterfunctions-3sqv1) @@ -38,9 +38,15 @@ And include 'babel-plugin-jsx-dom-expressions' in your babelrc, webpack babel lo ## API -MobX JSX works both with function and class components(extend Component from this library). It also ships a specialize map function for optimal list rendering that takes an observable array as it's first argument. +MobX JSX works both with function and class components(extend Component from this library). + +### Note on observable arrays + +It also ships a specialize map function for optimal list rendering that takes an observable array as it's first argument. To avoid re-rendering the complete list on changes. ```jsx +import { map } from "mobx-jsx"; + const list = observable(["Alpha", "Beta", "Gamma"]);

    { @@ -48,8 +54,28 @@ const list = observable(["Alpha", "Beta", "Gamma"]); }
``` -MobX JSX also supports a Context API. +### MobX JSX also supports a Context API. + +### Components can be loaded lazily + +```jsx +import { render, lazy } from "mobx-jsx"; + +// use lazy to allow code splitting +const SomeComponent = lazy(() => import("./SomeComponent")); + +function App() { + return ( + <> + + + ); +} + +render(App, document.body); +``` +### Non-precompiled environments Alternatively this library supports Tagged Template Literals or HyperScript for non-precompiled environments by installing the companion library and including variants: ```js From a602001cbb1a02751882a51d6a76a33a76265087 Mon Sep 17 00:00:00 2001 From: Ryan Carniato Date: Tue, 1 Sep 2020 22:04:26 -0700 Subject: [PATCH 22/38] update dom-expressions --- README.md | 4 +- package-lock.json | 173 +++++-- package.json | 18 +- src/h.ts | 4 +- src/html.ts | 9 +- src/index.ts | 2 +- src/jsx.ts | 1148 +++++++++++++++++++++++++++++++++++---------- src/lib.ts | 33 +- src/runtime.d.ts | 40 +- 9 files changed, 1081 insertions(+), 350 deletions(-) diff --git a/README.md b/README.md index a2f0c94..f46cc93 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ render(App, document.getElementById('main')); And include 'babel-plugin-jsx-dom-expressions' in your babelrc, webpack babel loader, or rollup babel plugin. ```js -"plugins": [["jsx-dom-expressions", {moduleName: 'mobx-jsx', wrapConditionals: true}]] +"plugins": [["jsx-dom-expressions", {moduleName: 'mobx-jsx'}]] ``` ## Installation @@ -38,7 +38,7 @@ And include 'babel-plugin-jsx-dom-expressions' in your babelrc, webpack babel lo ## API -MobX JSX works both with function and class components(extend Component from this library). +MobX JSX works both with function and class components(extend Component from this library). ### Note on observable arrays diff --git a/package-lock.json b/package-lock.json index 7c0d9b0..d1d3370 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "mobx-jsx", - "version": "0.11.5", + "version": "0.12.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -14,19 +14,19 @@ } }, "@babel/core": { - "version": "7.10.5", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.10.5.tgz", - "integrity": "sha512-O34LQooYVDXPl7QWCdW9p4NR+QlzOr7xShPPJz8GsuCU3/8ua/wqTr7gmnxXv+WBESiGU/G5s16i6tUvHkNb+w==", + "version": "7.11.5", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.11.5.tgz", + "integrity": "sha512-fsEANVOcZHzrsV6dMVWqpSeXClq3lNbYrfFGme6DE25FQWe7pyeYpXyx9guqUnpy466JLzZ8z4uwSr2iv60V5Q==", "dev": true, "requires": { "@babel/code-frame": "^7.10.4", - "@babel/generator": "^7.10.5", - "@babel/helper-module-transforms": "^7.10.5", + "@babel/generator": "^7.11.5", + "@babel/helper-module-transforms": "^7.11.0", "@babel/helpers": "^7.10.4", - "@babel/parser": "^7.10.5", + "@babel/parser": "^7.11.5", "@babel/template": "^7.10.4", - "@babel/traverse": "^7.10.5", - "@babel/types": "^7.10.5", + "@babel/traverse": "^7.11.5", + "@babel/types": "^7.11.5", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.1", @@ -34,7 +34,69 @@ "lodash": "^4.17.19", "resolve": "^1.3.2", "semver": "^5.4.1", - "source-map": "^0.5.0" + "source-map": "^0.6.1" + }, + "dependencies": { + "@babel/generator": { + "version": "7.11.5", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.11.5.tgz", + "integrity": "sha512-9UqHWJ4IwRTy4l0o8gq2ef8ws8UPzvtMkVKjTLAiRmza9p9V6Z+OfuNd9fB1j5Q67F+dVJtPC2sZXI8NM9br4g==", + "dev": true, + "requires": { + "@babel/types": "^7.11.5", + "jsesc": "^2.5.1", + "source-map": "^0.6.1" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.11.0", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.11.0.tgz", + "integrity": "sha512-74Vejvp6mHkGE+m+k5vHY93FX2cAtrw1zXrZXRlG4l410Nm9PxfEiVTn1PjDPV5SnmieiueY4AFg2xqhNFuuZg==", + "dev": true, + "requires": { + "@babel/types": "^7.11.0" + } + }, + "@babel/parser": { + "version": "7.11.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.11.5.tgz", + "integrity": "sha512-X9rD8qqm695vgmeaQ4fvz/o3+Wk4ZzQvSHkDBgpYKxpD4qTAUm88ZKtHkVqIOsYFFbIQ6wQYhC6q7pjqVK0E0Q==", + "dev": true + }, + "@babel/traverse": { + "version": "7.11.5", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.11.5.tgz", + "integrity": "sha512-EjiPXt+r7LiCZXEfRpSJd+jUMnBd4/9OUv7Nx3+0u9+eimMwJmG0Q98lw4/289JCoxSE8OolDMNZaaF/JZ69WQ==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.10.4", + "@babel/generator": "^7.11.5", + "@babel/helper-function-name": "^7.10.4", + "@babel/helper-split-export-declaration": "^7.11.0", + "@babel/parser": "^7.11.5", + "@babel/types": "^7.11.5", + "debug": "^4.1.0", + "globals": "^11.1.0", + "lodash": "^4.17.19" + } + }, + "@babel/types": { + "version": "7.11.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.5.tgz", + "integrity": "sha512-bvM7Qz6eKnJVFIn+1LPtjlBFPVN5jNDc1XmN15vWe7Q3DPBufWWsLiIvUu7xW87uTG6QoggpIDnUgLQvPheU+Q==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.4", + "lodash": "^4.17.19", + "to-fast-properties": "^2.0.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } } }, "@babel/generator": { @@ -101,18 +163,40 @@ } }, "@babel/helper-module-transforms": { - "version": "7.10.5", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.10.5.tgz", - "integrity": "sha512-4P+CWMJ6/j1W915ITJaUkadLObmCRRSC234uctJfn/vHrsLNxsR8dwlcXv9ZhJWzl77awf+mWXSZEKt5t0OnlA==", + "version": "7.11.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.11.0.tgz", + "integrity": "sha512-02EVu8COMuTRO1TAzdMtpBPbe6aQ1w/8fePD2YgQmxZU4gpNWaL9gK3Jp7dxlkUlUCJOTaSeA+Hrm1BRQwqIhg==", "dev": true, "requires": { "@babel/helper-module-imports": "^7.10.4", "@babel/helper-replace-supers": "^7.10.4", "@babel/helper-simple-access": "^7.10.4", - "@babel/helper-split-export-declaration": "^7.10.4", + "@babel/helper-split-export-declaration": "^7.11.0", "@babel/template": "^7.10.4", - "@babel/types": "^7.10.5", + "@babel/types": "^7.11.0", "lodash": "^4.17.19" + }, + "dependencies": { + "@babel/helper-split-export-declaration": { + "version": "7.11.0", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.11.0.tgz", + "integrity": "sha512-74Vejvp6mHkGE+m+k5vHY93FX2cAtrw1zXrZXRlG4l410Nm9PxfEiVTn1PjDPV5SnmieiueY4AFg2xqhNFuuZg==", + "dev": true, + "requires": { + "@babel/types": "^7.11.0" + } + }, + "@babel/types": { + "version": "7.11.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.5.tgz", + "integrity": "sha512-bvM7Qz6eKnJVFIn+1LPtjlBFPVN5jNDc1XmN15vWe7Q3DPBufWWsLiIvUu7xW87uTG6QoggpIDnUgLQvPheU+Q==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.4", + "lodash": "^4.17.19", + "to-fast-properties": "^2.0.0" + } + } } }, "@babel/helper-optimise-call-expression": { @@ -265,25 +349,24 @@ } }, "@rollup/plugin-babel": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/@rollup/plugin-babel/-/plugin-babel-5.1.0.tgz", - "integrity": "sha512-zXBEYmfiLAMvB+ZBa6m/q9hsQYAq1sUFdjuP1F6C2pf6uQcpHwAWQveZgzS63zXdKPUYHD3Dr7BhjCqcr0bbLw==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-babel/-/plugin-babel-5.2.0.tgz", + "integrity": "sha512-CPABsajaKjINgBQ3it+yMnfVO3ibsrMBxRzbUOUw2cL1hsZJ7aogU8mgglQm3S2hHJgjnAmxPz0Rq7DVdmHsTw==", "dev": true, "requires": { - "@babel/helper-module-imports": "^7.7.4", - "@rollup/pluginutils": "^3.0.8" + "@babel/helper-module-imports": "^7.10.4", + "@rollup/pluginutils": "^3.1.0" } }, "@rollup/plugin-node-resolve": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-8.4.0.tgz", - "integrity": "sha512-LFqKdRLn0ShtQyf6SBYO69bGE1upV6wUhBX0vFOUnLAyzx5cwp8svA0eHUnu8+YU57XOkrMtfG63QOpQx25pHQ==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-9.0.0.tgz", + "integrity": "sha512-gPz+utFHLRrd41WMP13Jq5mqqzHL3OXrfj3/MkSyB6UBIcuNt9j60GCbarzMzdf1VHFpOxfQh/ez7wyadLMqkg==", "dev": true, "requires": { "@rollup/pluginutils": "^3.1.0", "@types/resolve": "1.17.1", "builtin-modules": "^3.1.0", - "deep-freeze": "^0.0.1", "deepmerge": "^4.2.2", "is-module": "^1.0.0", "resolve": "^1.17.0" @@ -307,9 +390,9 @@ "dev": true }, "@types/node": { - "version": "14.0.23", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.23.tgz", - "integrity": "sha512-Z4U8yDAl5TFkmYsZdFPdjeMa57NOvnaf1tljHzhouaPEp7LCj2JKkejpI1ODviIAQuW4CcQmxkQ77rnLsOOoKw==", + "version": "14.6.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.6.2.tgz", + "integrity": "sha512-onlIwbaeqvZyniGPfdw/TEhKIh79pz66L1q06WUQqJLnAb6wbjvOtepLYTGHTqzdXgBYIE3ZdmqHDGsRsbBz7A==", "dev": true }, "@types/resolve": { @@ -386,12 +469,6 @@ "ms": "^2.1.1" } }, - "deep-freeze": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/deep-freeze/-/deep-freeze-0.0.1.tgz", - "integrity": "sha1-OgsABd4YZygZ39OM0x+RF5yJPoQ=", - "dev": true - }, "deepmerge": { "version": "4.2.2", "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", @@ -399,9 +476,9 @@ "dev": true }, "dom-expressions": { - "version": "0.19.10", - "resolved": "https://registry.npmjs.org/dom-expressions/-/dom-expressions-0.19.10.tgz", - "integrity": "sha512-Dk46xCntigMO2/JPc/O+7SwbTxqTI1530ns7hvztntbXcTKSVQ6FoNRLAmgaYMQPtFR3eVbqnODoJoZyYQBFsA==", + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/dom-expressions/-/dom-expressions-0.20.0.tgz", + "integrity": "sha512-M5A01nAcXWT4SepXG9RoXR5VCb9X9dLb8bKuhKDs2Qw3VmkIP9p59x1djw0YDhfflr5H73IHw26z7e7sZxRfRQ==", "dev": true, "requires": { "babel-plugin-transform-rename-import": "^2.3.0" @@ -445,9 +522,9 @@ "dev": true }, "hyper-dom-expressions": { - "version": "0.19.10", - "resolved": "https://registry.npmjs.org/hyper-dom-expressions/-/hyper-dom-expressions-0.19.10.tgz", - "integrity": "sha512-aTdkWbGsWctrjnuK1PjUq+xfK98rs2MaU9RyvoTOOKwKJV6CxZz9ogHQ2w+gFSQetBcd4Stdfqj+RXJ3V+oPdQ==", + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/hyper-dom-expressions/-/hyper-dom-expressions-0.20.0.tgz", + "integrity": "sha512-CB+TGGpJJAts1g1oQL9douTQOu5IBlQfPMlAYfQ8RE7YRPpKknnn8NrqGFr0PwuqQLskSeH4Xv2dWeN7q/IIMQ==", "dev": true }, "is-module": { @@ -478,9 +555,9 @@ } }, "lit-dom-expressions": { - "version": "0.19.10", - "resolved": "https://registry.npmjs.org/lit-dom-expressions/-/lit-dom-expressions-0.19.10.tgz", - "integrity": "sha512-7kQj+g32kApWWlA6qHk4MWgUTSG3U4DwCwvaxITz1sJAUbXLQmbBKJKNlKO4Gl6eWtCCgV9pM2Hl0MMrNMqvvQ==", + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/lit-dom-expressions/-/lit-dom-expressions-0.20.0.tgz", + "integrity": "sha512-uxGi3nAElM0s1gbxh2j8J8eKzx0dEtlaMUsewIkYkpmVmwpAzIS2335TSilbKMnkiw3RRLRO/VBM3o0AwgYdmw==", "dev": true }, "lodash": { @@ -535,9 +612,9 @@ } }, "rollup": { - "version": "2.22.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.22.1.tgz", - "integrity": "sha512-K9AUQUCJkVqC+A7uUDacfhmpEeAjc2uOmSpvGI5xaYsm8pXgy4ZWEM8wHPfKj11xvCwFZppkRDo8a0RESJXCnw==", + "version": "2.26.9", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.26.9.tgz", + "integrity": "sha512-XIiWYLayLqV+oY4S2Lub/shJq4uk/QQLwWToYCL4LjZbYHbFK3czea4UDVRUJu+zNmKmxq5Zb/OG7c5HSvH2TQ==", "dev": true, "requires": { "fsevents": "~2.1.2" @@ -577,9 +654,9 @@ "dev": true }, "typescript": { - "version": "3.9.7", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.7.tgz", - "integrity": "sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.0.2.tgz", + "integrity": "sha512-e4ERvRV2wb+rRZ/IQeb3jm2VxBsirQLpQhdxplZ2MEzGvDkkMmPglecnNDfSUBivMjP93vRbngYYDQqQ/78bcQ==", "dev": true } } diff --git a/package.json b/package.json index c77142e..af3e4bb 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "mobx-jsx", "description": "Raw MobX performance without the restraints of a Virtual DOM", - "version": "0.11.10", + "version": "0.12.0", "author": "Ryan Carniato", "license": "MIT", "repository": { @@ -16,17 +16,17 @@ "prepublishOnly": "npm run build" }, "devDependencies": { - "@babel/core": "7.10.5", + "@babel/core": "7.11.5", "@babel/preset-typescript": "7.10.4", - "dom-expressions": "0.19.10", - "hyper-dom-expressions": "0.19.10", - "lit-dom-expressions": "0.19.10", + "dom-expressions": "0.20.0", + "hyper-dom-expressions": "0.20.0", + "lit-dom-expressions": "0.20.0", "mobx": "^5.15.4", "ncp": "2.0.0", - "rollup": "^2.22.1", - "@rollup/plugin-babel": "5.1.0", - "@rollup/plugin-node-resolve": "8.4.0", - "typescript": "3.9.7" + "rollup": "^2.26.9", + "@rollup/plugin-babel": "5.2.0", + "@rollup/plugin-node-resolve": "9.0.0", + "typescript": "4.0.2" }, "peerDependencies": { "mobx": "*" diff --git a/src/h.ts b/src/h.ts index f2b5dd1..97589a8 100644 --- a/src/h.ts +++ b/src/h.ts @@ -1,12 +1,12 @@ import { createHyperScript } from "hyper-dom-expressions"; -import { spread, assign, insert, createComponent, delegateEvents } from "./index"; +import { spread, assign, insert, createComponent, dynamicProperty } from "./index"; export const h = createHyperScript({ spread, assign, insert, createComponent, - delegateEvents + dynamicProperty }); export * from './index'; \ No newline at end of file diff --git a/src/html.ts b/src/html.ts index dffbf0e..5380790 100644 --- a/src/html.ts +++ b/src/html.ts @@ -1,5 +1,5 @@ -import { createHTML } from 'lit-dom-expressions'; -import { effect, style, insert, createComponent, delegateEvents, classList } from "./index"; +import { createHTML } from "lit-dom-expressions"; +import { effect, style, insert, createComponent, delegateEvents, classList, dynamicProperty } from "./index"; export const html = createHTML({ effect, @@ -7,7 +7,8 @@ export const html = createHTML({ insert, createComponent, delegateEvents, - classList + classList, + dynamicProperty }); -export * from './index'; \ No newline at end of file +export * from "./index"; \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index bc1b9d6..be0491b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,5 +1,5 @@ export { root, cleanup, Component, lazy, createContext, useContext, map } from "./lib"; -export type { Context, FunctionComponent } from "./lib"; +export type { Context, FunctionComponent, ComponentProps } from "./lib"; export * from "./runtime"; import "./jsx" diff --git a/src/jsx.ts b/src/jsx.ts index 9f80275..61c6396 100644 --- a/src/jsx.ts +++ b/src/jsx.ts @@ -121,7 +121,7 @@ declare global { // MouseEvents onClick?: EventHandlerUnion; onContextMenu?: EventHandlerUnion; - onDoubleClick?: EventHandlerUnion; + onDblClick?: EventHandlerUnion; onDrag?: EventHandlerUnion; onDragEnd?: EventHandlerUnion; onDragEnter?: EventHandlerUnion; @@ -2331,9 +2331,141 @@ declare global { } // SVG Elements - interface SVGAttributes extends HTMLAttributes { - accumulate?: "none" | "sum"; + + type SVGPreserveAspectRatio = + | "none" + | "xMinYMin" + | "xMidYMin" + | "xMaxYMin" + | "xMinYMid" + | "xMidYMid" + | "xMaxYMid" + | "xMinYMax" + | "xMidYMax" + | "xMaxYMax" + | "xMinYMin meet" + | "xMidYMin meet" + | "xMaxYMin meet" + | "xMinYMid meet" + | "xMidYMid meet" + | "xMaxYMid meet" + | "xMinYMax meet" + | "xMidYMax meet" + | "xMaxYMax meet" + | "xMinYMin slice" + | "xMidYMin slice" + | "xMaxYMin slice" + | "xMinYMid slice" + | "xMidYMid slice" + | "xMaxYMid slice" + | "xMinYMax slice" + | "xMidYMax slice" + | "xMaxYMax slice"; + + type ImagePreserveAspectRatio = + | SVGPreserveAspectRatio + | "defer none" + | "defer xMinYMin" + | "defer xMidYMin" + | "defer xMaxYMin" + | "defer xMinYMid" + | "defer xMidYMid" + | "defer xMaxYMid" + | "defer xMinYMax" + | "defer xMidYMax" + | "defer xMaxYMax" + | "defer xMinYMin meet" + | "defer xMidYMin meet" + | "defer xMaxYMin meet" + | "defer xMinYMid meet" + | "defer xMidYMid meet" + | "defer xMaxYMid meet" + | "defer xMinYMax meet" + | "defer xMidYMax meet" + | "defer xMaxYMax meet" + | "defer xMinYMin slice" + | "defer xMidYMin slice" + | "defer xMaxYMin slice" + | "defer xMinYMid slice" + | "defer xMidYMid slice" + | "defer xMaxYMid slice" + | "defer xMinYMax slice" + | "defer xMidYMax slice" + | "defer xMaxYMax slice"; + + type SVGUnits = "userSpaceOnUse" | "objectBoundingBox"; + + interface CoreSVGAttributes extends DOMAttributes { + id?: string; + lang?: string; + tabIndex?: number | string; + tabindex?: number | string; + } + + interface StylableSVGAttributes { + class?: string; + className?: string; + style?: CSSProperties | string; + } + + interface TransformableSVGAttributes { + transform?: string; + } + + interface XLinkSVGAttributes { + xlinkActuate?: string; + xlinkArcrole?: string; + xlinkHref?: string; + xlinkRole?: string; + xlinkShow?: string; + xlinkTitle?: string; + xlinkType?: string; + } + + interface ConditionalProcessingSVGAttributes { + requiredExtensions?: string; + requiredFeatures?: string; + systemLanguage?: string; + } + + interface ExternalResourceSVGAttributes { + externalResourcesRequired?: "true" | "false"; + } + + interface AnimationTimingSVGAttributes { + begin?: string; + dur?: string; + end?: string; + min?: string; + max?: string; + restart?: "always" | "whenNotActive" | "never"; + repeatCount?: number | "indefinite"; + repeatDur?: string; + fill?: "freeze" | "remove"; + } + + interface AnimationValueSVGAttributes { + calcMode?: "discrete" | "linear" | "paced" | "spline"; + values?: string; + keyTimes?: string; + keySplines?: string; + from?: number | string; + to?: number | string; + by?: number | string; + } + + interface AnimationAdditionSVGAttributes { + attributeName?: string; additive?: "replace" | "sum"; + accumulate?: "none" | "sum"; + } + + interface AnimationAttributeTargetSVGAttributes { + attributeName?: string; + attributeType?: "CSS" | "XML" | "auto"; + } + + interface PresentationSVGAttributes { alignmentBaseline?: | "auto" | "baseline" @@ -2348,211 +2480,752 @@ declare global { | "hanging" | "mathematical" | "inherit"; - allowReorder?: "no" | "yes"; - amplitude?: number | string; - attributeName?: string; - attributeType?: string; - autoReverse?: number | string; - azimuth?: number | string; - baseFrequency?: number | string; baselineShift?: number | string; - baseProfile?: number | string; - begin?: number | string; - bias?: number | string; - by?: number | string; - calcMode?: number | string; - clip?: number | string; + clip?: string; clipPath?: string; - clipPathUnits?: number | string; - clipRule?: number | string; - colorInterpolation?: number | string; + clipRule?: "nonzero" | "evenodd" | "inherit"; + color?: string; + colorInterpolation?: "auto" | "sRGB" | "linearRGB" | "inherit"; colorInterpolationFilters?: "auto" | "sRGB" | "linearRGB" | "inherit"; - colorProfile?: number | string; - colorRendering?: number | string; - contentScriptType?: number | string; - contentStyleType?: number | string; - cursor?: number | string; - cx?: number | string; - cy?: number | string; - d?: string; - decelerate?: number | string; - diffuseConstant?: number | string; - direction?: number | string; - display?: number | string; - divisor?: number | string; - dominantBaseline?: number | string; - dur?: number | string; - dx?: number | string; - dy?: number | string; - edgeMode?: number | string; - elevation?: number | string; - enableBackground?: number | string; - end?: number | string; - exponent?: number | string; - externalResourcesRequired?: number | string; + colorProfile?: string; + colorRendering?: "auto" | "optimizeSpeed" | "optimizeQuality" | "inherit"; + cursor?: string; + direction?: "ltr" | "rtl" | "inherit"; + display?: string; + dominantBaseline?: + | "auto" + | "text-bottom" + | "alphabetic" + | "ideographic" + | "middle" + | "central" + | "mathematical" + | "hanging" + | "text-top" + | "inherit"; + enableBackground?: string; fill?: string; - fillOpacity?: number | string; + fillOpacity?: number | string | "inherit"; fillRule?: "nonzero" | "evenodd" | "inherit"; filter?: string; - filterRes?: number | string; - filterUnits?: number | string; - floodColor?: number | string; - floodOpacity?: number | string; - focusable?: number | string; + floodColor?: string; + floodOpacity?: number | string | "inherit"; fontFamily?: string; - fontSize?: number | string; + fontSize?: string; fontSizeAdjust?: number | string; - fontStretch?: number | string; - fontStyle?: number | string; - fontVariant?: number | string; + fontStretch?: string; + fontStyle?: "normal" | "italic" | "oblique" | "inherit"; + fontVariant?: string; fontWeight?: number | string; - format?: number | string; - from?: number | string; - fx?: number | string; - fy?: number | string; - glyphOrientationHorizontal?: number | string; - glyphOrientationVertical?: number | string; - glyphRef?: number | string; - gradientTransform?: string; - gradientUnits?: string; + glyphOrientationHorizontal?: string; + glyphOrientationVertical?: string; + imageRendering?: "auto" | "optimizeQuality" | "optimizeSpeed" | "inherit"; + kerning?: string; + letterSpacing?: number | string; + lightingColor?: string; + markerEnd?: string; + markerMid?: string; + markerStart?: string; + mask?: string; + opacity?: number | string | "inherit"; + overflow?: "visible" | "hidden" | "scroll" | "auto" | "inherit"; + pointerEvents?: + | "bounding-box" + | "visiblePainted" + | "visibleFill" + | "visibleStroke" + | "visible" + | "painted" + | "color" + | "fill" + | "stroke" + | "all" + | "none" + | "inherit"; + shapeRendering?: "auto" | "optimizeSpeed" | "crispEdges" | "geometricPrecision" | "inherit"; + stopColor?: string; + stopOpacity?: number | string | "inherit"; + stroke?: string; + strokeDasharray?: string; + strokeDashoffset?: number | string; + strokeLinecap?: "butt" | "round" | "square" | "inherit"; + strokeLinejoin?: "arcs" | "bevel" | "miter" | "miter-clip" | "round" | "inherit"; + strokeMiterlimit?: number | string | "inherit"; + strokeOpacity?: number | string | "inherit"; + strokeWidth?: number | string; + textAnchor?: "start" | "middle" | "end" | "inherit"; + textDecoration?: "none" | "underline" | "overline" | "line-through" | "blink" | "inherit"; + textRendering?: + | "auto" + | "optimizeSpeed" + | "optimizeLegibility" + | "geometricPrecision" + | "inherit"; + unicodeBidi?: string; + visibility?: "visible" | "hidden" | "collapse" | "inherit"; + wordSpacing?: number | string; + writingMode?: "lr-tb" | "rl-tb" | "tb-rl" | "lr" | "rl" | "tb" | "inherit"; + } + + interface AnimationElementSVGAttributes + extends CoreSVGAttributes, + ExternalResourceSVGAttributes, + ConditionalProcessingSVGAttributes {} + + interface ContainerElementSVGAttributes + extends CoreSVGAttributes, + Pick< + PresentationSVGAttributes, + | "clipPath" + | "mask" + | "cursor" + | "opacity" + | "filter" + | "enableBackground" + | "colorInterpolation" + | "colorRendering" + > {} + + interface FilterPrimitiveElementSVGAttributes + extends CoreSVGAttributes, + Pick { + x?: number | string; + y?: number | string; + width?: number | string; height?: number | string; - href?: string; - hreflang?: string; - imageRendering?: number | string; - in2?: number | string; + result?: string; + } + + interface SingleInputFilterSVGAttributes { in?: string; - intercept?: number | string; + } + + interface DoubleInputFilterSVGAttributes { + in?: string; + in2?: string; + } + + interface FitToViewBoxSVGAttributes { + viewBox?: string; + preserveAspectRatio?: SVGPreserveAspectRatio; + } + + interface GradientElementSVGAttributes + extends CoreSVGAttributes, + XLinkSVGAttributes, + ExternalResourceSVGAttributes, + StylableSVGAttributes { + gradientUnits?: SVGUnits; + gradientTransform?: string; + spreadMethod?: "pad" | "reflect" | "repeat"; + } + + interface GraphicsElementSVGAttributes + extends CoreSVGAttributes, + Pick< + PresentationSVGAttributes, + | "clipRule" + | "mask" + | "pointerEvents" + | "cursor" + | "opacity" + | "filter" + | "display" + | "visibility" + | "colorInterpolation" + | "colorRendering" + > {} + + interface LightSourceElementSVGAttributes extends CoreSVGAttributes {} + + interface NewViewportSVGAttributes + extends CoreSVGAttributes, + Pick { + viewBox?: string; + } + + interface ShapeElementSVGAttributes + extends CoreSVGAttributes, + Pick< + PresentationSVGAttributes, + | "color" + | "fill" + | "fillRule" + | "fillOpacity" + | "stroke" + | "strokeWidth" + | "strokeLinecap" + | "strokeLinejoin" + | "strokeMiterlimit" + | "strokeDasharray" + | "strokeDashoffset" + | "strokeOpacity" + | "shapeRendering" + > {} + + interface TextContentElementSVGAttributes + extends CoreSVGAttributes, + Pick< + PresentationSVGAttributes, + | "fontFamily" + | "fontStyle" + | "fontVariant" + | "fontWeight" + | "fontStretch" + | "fontSize" + | "fontSizeAdjust" + | "kerning" + | "letterSpacing" + | "wordSpacing" + | "textDecoration" + | "glyphOrientationHorizontal" + | "glyphOrientationVertical" + | "direction" + | "unicodeBidi" + | "textAnchor" + | "dominantBaseline" + | "color" + | "fill" + | "fillRule" + | "fillOpacity" + | "stroke" + | "strokeWidth" + | "strokeLinecap" + | "strokeLinejoin" + | "strokeMiterlimit" + | "strokeDasharray" + | "strokeDashoffset" + | "strokeOpacity" + > {} + + interface ZoomAndPanSVGAttributes { + zoomAndPan?: "disable" | "magnify"; + } + + interface AnimateSVGAttributes + extends AnimationElementSVGAttributes, + XLinkSVGAttributes, + AnimationAttributeTargetSVGAttributes, + AnimationTimingSVGAttributes, + AnimationValueSVGAttributes, + AnimationAdditionSVGAttributes, + Pick {} + + interface AnimateMotionSVGAttributes + extends AnimationElementSVGAttributes, + XLinkSVGAttributes, + AnimationTimingSVGAttributes, + AnimationValueSVGAttributes, + AnimationAdditionSVGAttributes { + path?: string; + keyPoints?: string; + rotate?: number | string |"auto" | "auto-reverse"; + origin?: "default"; + } + + interface AnimateTransformSVGAttributes + extends AnimationElementSVGAttributes, + XLinkSVGAttributes, + AnimationAttributeTargetSVGAttributes, + AnimationTimingSVGAttributes, + AnimationValueSVGAttributes, + AnimationAdditionSVGAttributes { + type?: "translate" | "scale" | "rotate" | "skewX" | "skewY"; + } + + interface CircleSVGAttributes + extends GraphicsElementSVGAttributes, + ShapeElementSVGAttributes, + ConditionalProcessingSVGAttributes, + StylableSVGAttributes, + TransformableSVGAttributes { + cx?: number | string; + cy?: number | string; + r?: number | string; + } + + interface ClipPathSVGAttributes + extends CoreSVGAttributes, + ConditionalProcessingSVGAttributes, + ExternalResourceSVGAttributes, + StylableSVGAttributes, + TransformableSVGAttributes, + Pick { + clipPathUnits?: SVGUnits; + } + + interface DefsSVGAttributes + extends ContainerElementSVGAttributes, + ConditionalProcessingSVGAttributes, + ExternalResourceSVGAttributes, + StylableSVGAttributes, + TransformableSVGAttributes {} + + interface DescSVGAttributes extends CoreSVGAttributes, StylableSVGAttributes {} + + interface EllipseSVGAttributes + extends GraphicsElementSVGAttributes, + ShapeElementSVGAttributes, + ConditionalProcessingSVGAttributes, + ExternalResourceSVGAttributes, + StylableSVGAttributes, + TransformableSVGAttributes { + cx?: number | string; + cy?: number | string; + rx?: number | string; + ry?: number | string; + } + + interface FeBlendSVGAttributes + extends FilterPrimitiveElementSVGAttributes, + DoubleInputFilterSVGAttributes, + StylableSVGAttributes { + mode?: "normal" | "multiply" | "screen" | "darken" | "lighten"; + } + + interface FeColorMatrixSVGAttributes + extends FilterPrimitiveElementSVGAttributes, + SingleInputFilterSVGAttributes, + StylableSVGAttributes { + type?: "matrix" | "saturate" | "hueRotate" | "luminanceToAlpha"; + values?: string; + } + + interface FeComponentTransferSVGAttributes + extends FilterPrimitiveElementSVGAttributes, + SingleInputFilterSVGAttributes, + StylableSVGAttributes {} + + interface FeCompositeSVGAttributes + extends FilterPrimitiveElementSVGAttributes, + DoubleInputFilterSVGAttributes, + StylableSVGAttributes { + operator?: "over" | "in" | "out" | "atop" | "xor" | "arithmetic"; k1?: number | string; k2?: number | string; k3?: number | string; k4?: number | string; - kernelMatrix?: number | string; + } + + interface FeConvolveMatrixSVGAttributes + extends FilterPrimitiveElementSVGAttributes, + SingleInputFilterSVGAttributes, + StylableSVGAttributes { + order?: number | string; + kernelMatrix?: string; + divisor?: number | string; + bias?: number | string; + targetX?: number | string; + targetY?: number | string; + edgeMode?: "duplicate" | "wrap" | "none"; kernelUnitLength?: number | string; - kerning?: number | string; - keyPoints?: number | string; - keySplines?: number | string; - keyTimes?: number | string; - lengthAdjust?: number | string; - letterSpacing?: number | string; - lightingColor?: number | string; - limitingConeAngle?: number | string; - markerEnd?: string; - markerHeight?: number | string; - markerMid?: string; - markerStart?: string; - markerUnits?: number | string; - markerWidth?: number | string; - mask?: string; - maskContentUnits?: number | string; - maskUnits?: number | string; - max?: number | string; - media?: string; - method?: string; - min?: number | string; - mode?: number | string; - name?: string; - numOctaves?: number | string; + preserveAlpha?: "true" | "false"; + } + + interface FeDiffuseLightingSVGAttributes + extends FilterPrimitiveElementSVGAttributes, + SingleInputFilterSVGAttributes, + StylableSVGAttributes, + Pick { + surfaceScale?: number | string; + diffuseConstant?: number | string; + kernelUnitLength?: number | string; + } + + interface FeDisplacementMapSVGAttributes + extends FilterPrimitiveElementSVGAttributes, + DoubleInputFilterSVGAttributes, + StylableSVGAttributes { + scale?: number | string; + xChannelSelector?: "R" | "G" | "B" | "A"; + yChannelSelector?: "R" | "G" | "B" | "A"; + } + + interface FeDistantLightSVGAttributes extends LightSourceElementSVGAttributes { + azimuth?: number | string; + elevation?: number | string; + } + + interface FeFloodSVGAttributes + extends FilterPrimitiveElementSVGAttributes, + StylableSVGAttributes, + Pick {} + + interface FeFuncSVGAttributes extends CoreSVGAttributes { + type?: "identity" | "table" | "discrete" | "linear" | "gamma"; + tableValues?: string; + slope?: number | string; + intercept?: number | string; + amplitude?: number | string; + exponent?: number | string; offset?: number | string; - opacity?: number | string; - operator?: number | string; - order?: number | string; - orient?: number | string; - origin?: number | string; - overflow?: number | string; - paintOrder?: number | string; - pathLength?: number | string; - patternContentUnits?: string; - patternTransform?: number | string; - patternUnits?: string; - pointerEvents?: number | string; - points?: string; + } + + interface FeGaussianBlurSVGAttributes + extends FilterPrimitiveElementSVGAttributes, + SingleInputFilterSVGAttributes, + StylableSVGAttributes { + stdDeviation?: number | string; + } + + interface FeImageSVGAttributes + extends FilterPrimitiveElementSVGAttributes, + XLinkSVGAttributes, + ExternalResourceSVGAttributes, + StylableSVGAttributes { + preserveAspectRatio: SVGPreserveAspectRatio; + } + + interface FeMergeSVGAttributes + extends FilterPrimitiveElementSVGAttributes, + StylableSVGAttributes {} + + interface FeMergeNodeSVGAttributes + extends CoreSVGAttributes, + SingleInputFilterSVGAttributes {} + + interface FeMorphologySVGAttributes + extends FilterPrimitiveElementSVGAttributes, + SingleInputFilterSVGAttributes, + StylableSVGAttributes { + operator?: "erode" | "dilate"; + radius?: number | string; + } + + interface FeOffsetSVGAttributes + extends FilterPrimitiveElementSVGAttributes, + SingleInputFilterSVGAttributes, + StylableSVGAttributes { + dx?: number | string; + dy?: number | string; + } + + interface FePointLightSVGAttributes extends LightSourceElementSVGAttributes { + x?: number | string; + y?: number | string; + z?: number | string; + } + + interface FeSpecularLightingSVGAttributes + extends FilterPrimitiveElementSVGAttributes, + SingleInputFilterSVGAttributes, + StylableSVGAttributes, + Pick { + surfaceScale?: string; + specularConstant?: string; + specularExponent?: string; + kernelUnitLength?: number | string; + } + + interface FeSpotLightSVGAttributes extends LightSourceElementSVGAttributes { + x?: number | string; + y?: number | string; + z?: number | string; pointsAtX?: number | string; pointsAtY?: number | string; pointsAtZ?: number | string; - preserveAlpha?: number | string; - preserveAspectRatio?: string; - primitiveUnits?: number | string; - r?: number | string; - radius?: number | string; + specularExponent?: number | string; + limitingConeAngle?: number | string; + } + + interface FeTileSVGAttributes + extends FilterPrimitiveElementSVGAttributes, + SingleInputFilterSVGAttributes, + StylableSVGAttributes {} + + interface FeTurbulanceSVGAttributes + extends FilterPrimitiveElementSVGAttributes, + StylableSVGAttributes { + baseFrequency?: number | string; + numOctaves?: number | string; + seed?: number | string; + stitchTiles?: "stitch" | "noStitch"; + type?: "fractalNoise" | "turbulence"; + } + + interface FilterSVGAttributes + extends CoreSVGAttributes, + XLinkSVGAttributes, + ExternalResourceSVGAttributes, + StylableSVGAttributes { + filterUnits?: SVGUnits; + primitiveUnits?: SVGUnits; + x?: number | string; + y?: number | string; + width?: number | string; + height?: number | string; + filterRes?: number | string; + } + + interface ForeignObjectSVGAttributes + extends NewViewportSVGAttributes, + ConditionalProcessingSVGAttributes, + ExternalResourceSVGAttributes, + StylableSVGAttributes, + TransformableSVGAttributes, + Pick { + x?: number | string; + y?: number | string; + width?: number | string; + height?: number | string; + } + + interface GSVGAttributes + extends ContainerElementSVGAttributes, + ConditionalProcessingSVGAttributes, + ExternalResourceSVGAttributes, + StylableSVGAttributes, + Pick {} + + interface ImageSVGAttributes + extends NewViewportSVGAttributes, + GraphicsElementSVGAttributes, + ConditionalProcessingSVGAttributes, + XLinkSVGAttributes, + StylableSVGAttributes, + TransformableSVGAttributes, + Pick { + x?: number | string; + y?: number | string; + width?: number | string; + height?: number | string; + preserveAspectRatio?: ImagePreserveAspectRatio; + } + + interface LineSVGAttributes + extends GraphicsElementSVGAttributes, + ShapeElementSVGAttributes, + ConditionalProcessingSVGAttributes, + ExternalResourceSVGAttributes, + StylableSVGAttributes, + TransformableSVGAttributes, + Pick { + x1?: number | string; + y1?: number | string; + x2?: number | string; + y2?: number | string; + } + + interface LinearGradientSVGAttributes extends GradientElementSVGAttributes { + x1?: number | string; + x2?: number | string; + y1?: number | string; + y2?: number | string; + } + + interface MarkerSVGAttributes + extends ContainerElementSVGAttributes, + ExternalResourceSVGAttributes, + StylableSVGAttributes, + FitToViewBoxSVGAttributes, + Pick { + markerUnits?: "strokeWidth" | "userSpaceOnUse"; refX?: number | string; refY?: number | string; - rel?: string; - repeatCount?: number | string; - repeatDur?: number | string; - requiredExtensions?: number | string; - requiredFeatures?: number | string; - restart?: number | string; - result?: string; - rotate?: number | string; + markerWidth?: number | string; + markerHeight?: number | string; + orient?: string; + } + + interface MaskSVGAttributes + extends Omit, "opacity" | "filter">, + ConditionalProcessingSVGAttributes, + ExternalResourceSVGAttributes, + StylableSVGAttributes { + maskUnits?: SVGUnits; + maskContentUnits?: SVGUnits; + x?: number | string; + y?: number | string; + width?: number | string; + height?: number | string; + } + + interface MetadataSVGAttributes extends CoreSVGAttributes {} + + interface PathSVGAttributes + extends GraphicsElementSVGAttributes, + ShapeElementSVGAttributes, + ConditionalProcessingSVGAttributes, + ExternalResourceSVGAttributes, + StylableSVGAttributes, + TransformableSVGAttributes, + Pick { + d?: string; + pathLength?: number | string; + } + + interface PatternSVGAttributes + extends ContainerElementSVGAttributes, + ConditionalProcessingSVGAttributes, + XLinkSVGAttributes, + ExternalResourceSVGAttributes, + StylableSVGAttributes, + FitToViewBoxSVGAttributes, + Pick { + x?: number | string; + y?: number | string; + width?: number | string; + height?: number | string; + patternUnits?: SVGUnits; + patternContentUnits?: SVGUnits; + patternTransform?: string; + } + + interface PolygonSVGAttributes + extends GraphicsElementSVGAttributes, + ShapeElementSVGAttributes, + ConditionalProcessingSVGAttributes, + ExternalResourceSVGAttributes, + StylableSVGAttributes, + TransformableSVGAttributes, + Pick { + points?: string; + } + + interface PolylineSVGAttributes + extends GraphicsElementSVGAttributes, + ShapeElementSVGAttributes, + ConditionalProcessingSVGAttributes, + ExternalResourceSVGAttributes, + StylableSVGAttributes, + TransformableSVGAttributes, + Pick { + points?: string; + } + + interface RadialGradientSVGAttributes extends GradientElementSVGAttributes { + cx?: number | string; + cy?: number | string; + r?: number | string; + fx?: number | string; + fy?: number | string; + } + + interface RectSVGAttributes + extends GraphicsElementSVGAttributes, + ShapeElementSVGAttributes, + ConditionalProcessingSVGAttributes, + ExternalResourceSVGAttributes, + StylableSVGAttributes, + TransformableSVGAttributes { + x?: number | string; + y?: number | string; + width?: number | string; + height?: number | string; rx?: number | string; ry?: number | string; - scale?: number | string; - seed?: number | string; - shapeRendering?: number | string; - spacing?: number | string; - specularConstant?: number | string; - specularExponent?: number | string; - speed?: number | string; - spreadMethod?: string; - startOffset?: number | string; - stdDeviation?: number | string; - stitchTiles?: number | string; - stopColor?: string; - stopOpacity?: number | string; - string?: number | string; - stroke?: string; - strokeDasharray?: string | number; - strokeDashoffset?: string | number; - strokeLinecap?: "butt" | "round" | "square" | "inherit"; - strokeLinejoin?: "miter" | "round" | "bevel" | "inherit"; - strokeMiterlimit?: number | string; - strokeOpacity?: number | string; - strokeWidth?: number | string; - surfaceScale?: number | string; - systemLanguage?: number | string; - tableValues?: number | string; - target?: string; - targetX?: number | string; - targetY?: number | string; - textAnchor?: string; - textDecoration?: number | string; - textLength?: number | string; - textRendering?: number | string; - to?: number | string; - transform?: string; - type?: string; - unicodeBidi?: number | string; - values?: string; - vectorEffect?: number | string; + } + + interface StopSVGAttributes + extends CoreSVGAttributes, + StylableSVGAttributes, + Pick { + offset?: number | string; + } + + interface SvgSVGAttributes + extends ContainerElementSVGAttributes, + NewViewportSVGAttributes, + ConditionalProcessingSVGAttributes, + ExternalResourceSVGAttributes, + StylableSVGAttributes, + FitToViewBoxSVGAttributes, + ZoomAndPanSVGAttributes, + Pick { version?: string; - viewBox?: string; - viewTarget?: number | string; - visibility?: number | string; + baseProfile?: string; + x?: number | string; + y?: number | string; width?: number | string; - wordSpacing?: number | string; - writingMode?: number | string; - x1?: number | string; - x2?: number | string; + height?: number | string; + contentScriptType?: string; + contentStyleType?: string; + } + + interface SwitchSVGAttributes + extends ContainerElementSVGAttributes, + ConditionalProcessingSVGAttributes, + ExternalResourceSVGAttributes, + StylableSVGAttributes, + TransformableSVGAttributes, + Pick {} + + interface SymbolSVGAttributes + extends ContainerElementSVGAttributes, + NewViewportSVGAttributes, + ExternalResourceSVGAttributes, + StylableSVGAttributes, + FitToViewBoxSVGAttributes {} + + interface TextSVGAttributes + extends TextContentElementSVGAttributes, + GraphicsElementSVGAttributes, + ConditionalProcessingSVGAttributes, + ExternalResourceSVGAttributes, + StylableSVGAttributes, + TransformableSVGAttributes, + Pick { x?: number | string; - xChannelSelector?: string; - xlinkActuate?: string; - xlinkArcrole?: string; - xlinkHref?: string; - xlinkRole?: string; - xlinkShow?: string; - xlinkTitle?: string; - xlinkType?: string; - xmlBase?: string; - xmlLang?: string; - xmlns?: string; - xmlnsXlink?: string; - xmlSpace?: string; - y1?: number | string; - y2?: number | string; y?: number | string; - yChannelSelector?: string; - z?: number | string; - zoomAndPan?: string; + dx?: number | string; + dy?: number | string; + rotate?: number | string; + textLength?: number | string; + lengthAdjust?: "spacing" | "spacingAndGlyphs"; + } + + interface TextPathSVGAttributes + extends TextContentElementSVGAttributes, + ConditionalProcessingSVGAttributes, + XLinkSVGAttributes, + ExternalResourceSVGAttributes, + StylableSVGAttributes, + Pick< + PresentationSVGAttributes, + "alignmentBaseline" | "baselineShift" | "display" | "visibility" + > { + startOffset?: number | string; + method?: "align" | "stretch"; + spacing?: "auto" | "exact"; + } + + interface TSpanSVGAttributes + extends TextContentElementSVGAttributes, + ConditionalProcessingSVGAttributes, + ExternalResourceSVGAttributes, + StylableSVGAttributes, + Pick< + PresentationSVGAttributes, + "alignmentBaseline" | "baselineShift" | "display" | "visibility" + > { + x?: number | string; + y?: number | string; + dx?: number | string; + dy?: number | string; + rotate?: number | string; + textLength?: number | string; + lengthAdjust?: "spacing" | "spacingAndGlyphs"; + } + + interface UseSVGAttributes + extends GraphicsElementSVGAttributes, + ConditionalProcessingSVGAttributes, + XLinkSVGAttributes, + ExternalResourceSVGAttributes, + StylableSVGAttributes, + TransformableSVGAttributes { + x?: number | string; + y?: number | string; + width?: number | string; + height?: number | string; + } + + interface ViewSVGAttributes + extends CoreSVGAttributes, + ExternalResourceSVGAttributes, + FitToViewBoxSVGAttributes, + ZoomAndPanSVGAttributes { + viewTarget?: string; } interface IntrinsicElements { @@ -2674,64 +3347,65 @@ declare global { wbr: HTMLAttributes; // SVG - svg: SVGAttributes; - - animate: SVGAttributes; - animateTransform: SVGAttributes; - circle: SVGAttributes; - clipPath: SVGAttributes; - defs: SVGAttributes; - desc: SVGAttributes; - ellipse: SVGAttributes; - feBlend: SVGAttributes; - feColorMatrix: SVGAttributes; - feComponentTransfer: SVGAttributes; - feComposite: SVGAttributes; - feConvolveMatrix: SVGAttributes; - feDiffuseLighting: SVGAttributes; - feDisplacementMap: SVGAttributes; - feDistantLight: SVGAttributes; - feFlood: SVGAttributes; - feFuncA: SVGAttributes; - feFuncB: SVGAttributes; - feFuncG: SVGAttributes; - feFuncR: SVGAttributes; - feGaussianBlur: SVGAttributes; - feImage: SVGAttributes; - feMerge: SVGAttributes; - feMergeNode: SVGAttributes; - feMorphology: SVGAttributes; - feOffset: SVGAttributes; - fePointLight: SVGAttributes; - feSpecularLighting: SVGAttributes; - feSpotLight: SVGAttributes; - feTile: SVGAttributes; - feTurbulence: SVGAttributes; - filter: SVGAttributes; - foreignObject: SVGAttributes; - g: SVGAttributes; - image: SVGAttributes; - line: SVGAttributes; - linearGradient: SVGAttributes; - marker: SVGAttributes; - mask: SVGAttributes; - metadata: SVGAttributes; - path: SVGAttributes; - pattern: SVGAttributes; - polygon: SVGAttributes; - polyline: SVGAttributes; - radialGradient: SVGAttributes; - rect: SVGAttributes; - stop: SVGAttributes; - switch: SVGAttributes; - symbol: SVGAttributes; - text: SVGAttributes; - textPath: SVGAttributes; - tspan: SVGAttributes; - use: SVGAttributes; - view: SVGAttributes; + svg: SvgSVGAttributes; + + animate: AnimateSVGAttributes; + animateMotion: AnimateMotionSVGAttributes; + animateTransform: AnimateTransformSVGAttributes; + circle: CircleSVGAttributes; + clipPath: ClipPathSVGAttributes; + defs: DefsSVGAttributes; + desc: DescSVGAttributes; + ellipse: EllipseSVGAttributes; + feBlend: FeBlendSVGAttributes; + feColorMatrix: FeColorMatrixSVGAttributes; + feComponentTransfer: FeComponentTransferSVGAttributes; + feComposite: FeCompositeSVGAttributes; + feConvolveMatrix: FeConvolveMatrixSVGAttributes; + feDiffuseLighting: FeDiffuseLightingSVGAttributes; + feDisplacementMap: FeDisplacementMapSVGAttributes; + feDistantLight: FeDistantLightSVGAttributes; + feFlood: FeFloodSVGAttributes; + feFuncA: FeFuncSVGAttributes; + feFuncB: FeFuncSVGAttributes; + feFuncG: FeFuncSVGAttributes; + feFuncR: FeFuncSVGAttributes; + feGaussianBlur: FeGaussianBlurSVGAttributes; + feImage: FeImageSVGAttributes; + feMerge: FeMergeSVGAttributes; + feMergeNode: FeMergeNodeSVGAttributes; + feMorphology: FeMorphologySVGAttributes; + feOffset: FeOffsetSVGAttributes; + fePointLight: FePointLightSVGAttributes; + feSpecularLighting: FeSpecularLightingSVGAttributes; + feSpotLight: FeSpotLightSVGAttributes; + feTile: FeTileSVGAttributes; + feTurbulence: FeTurbulanceSVGAttributes; + filter: FilterSVGAttributes; + foreignObject: ForeignObjectSVGAttributes; + g: GSVGAttributes; + image: ImageSVGAttributes; + line: LineSVGAttributes; + linearGradient: LinearGradientSVGAttributes; + marker: MarkerSVGAttributes; + mask: MaskSVGAttributes; + metadata: MetadataSVGAttributes; + path: PathSVGAttributes; + pattern: PatternSVGAttributes; + polygon: PolygonSVGAttributes; + polyline: PolylineSVGAttributes; + radialGradient: RadialGradientSVGAttributes; + rect: RectSVGAttributes; + stop: StopSVGAttributes; + switch: SwitchSVGAttributes; + symbol: SymbolSVGAttributes; + text: TextSVGAttributes; + textPath: TextPathSVGAttributes; + tspan: TSpanSVGAttributes; + use: UseSVGAttributes; + view: ViewSVGAttributes; } } } -export {}; +export {}; \ No newline at end of file diff --git a/src/lib.ts b/src/lib.ts index 64bca6b..a4a378b 100644 --- a/src/lib.ts +++ b/src/lib.ts @@ -48,7 +48,6 @@ export function cleanup(fn: () => void) { } export function effect(fn: (prev?: T) => T, current?: T) { - let disposed const context = { disposables: [] as (() => void)[], owner: globalContext @@ -82,30 +81,22 @@ export function memo(fn: () => T, equal?: boolean) { type PropsWithChildren

= P & { children?: JSX.Element }; export type FunctionComponent

= (props: PropsWithChildren

) => JSX.Element; +type ComponentConstructor

= + | FunctionComponent

+ | (new (props: PropsWithChildren

) => JSX.Element); -type PossiblyWrapped = { - [P in keyof T]: T[P] | (() => T[P]); -}; - -function dynamicProperty(props: any, key: string) { - const src = props[key]; - Object.defineProperty(props, key, { - get() { - return src(); - }, - enumerable: true - }); -} +export type ComponentProps< + T extends keyof JSX.IntrinsicElements | ComponentConstructor +> = T extends ComponentConstructor + ? P + : T extends keyof JSX.IntrinsicElements + ? JSX.IntrinsicElements[T] + : {}; export function createComponent( Comp: Component & FunctionComponent, - props: PossiblyWrapped, - dynamicKeys?: (keyof T)[] + props: T ): JSX.Element { - if (dynamicKeys) { - for (let i = 0; i < dynamicKeys.length; i++) dynamicProperty(props, dynamicKeys[i] as string); - } - let c; if (Comp.prototype && Comp.prototype.isClassComponent) { return untracked(() => { const comp: Component = new (Comp as any)(props as T); @@ -164,7 +155,7 @@ function resolveChildren(children: any): any { function createProvider(id: symbol) { return function provider(props: { value: unknown; children: any }) { let rendered = observable.box(), - update = action(() => rendered.set(resolveChildren(props.children))) + update = action(() => rendered.set(resolveChildren(props.children))); effect(() => { globalContext!.context = { [id]: props.value }; update(); diff --git a/src/runtime.d.ts b/src/runtime.d.ts index b0ad50a..7c4a388 100644 --- a/src/runtime.d.ts +++ b/src/runtime.d.ts @@ -1,21 +1,6 @@ type MountableElement = Element | Document | ShadowRoot | DocumentFragment | Node; -export function render(code: () => any, element: MountableElement): () => void -export function renderToString( - fn: (done?: (rendered: any) => void) => any, - options?: { - timeoutMs?: number; - } -): Promise; -export function renderDOMToString( - fn: (done?: (rendered: any) => void) => any, - options?: { - timeoutMs?: number; - } -): Promise; -export function hydrate( - fn: () => unknown, - node: MountableElement -): void; +export function render(code: () => any, element: MountableElement): () => void; +export function hydrate(fn: () => unknown, node: MountableElement): void; export function template(html: string, count: number, isSVG?: boolean): Element; export function effect(fn: (prev?: T) => T, init?: T): any; @@ -23,14 +8,16 @@ export function memo(fn: () => T, equal: boolean): () => T; export function insert( parent: MountableElement, accessor: any, - init?: any, - marker?: Node | null + marker?: Node | null, + init?: any ): any; -export function createComponent(Comp: (props: any) => any, props: any, dynamicKeys?: string[]): any; +export function createComponent(Comp: (props: any) => any, props: any): any; export function delegateEvents(eventNames: string[]): void; export function clearDelegatedEvents(): void; export function spread(node: Element, accessor: any, isSVG?: Boolean, skipChildren?: Boolean): void; export function assign(node: Element, props: any, isSVG?: Boolean, skipChildren?: Boolean): void; +export function setAttribute(node: Element, name: string, value: any): void; +export function setAttributeNS(node: Element, namespace: string, name: string, value: any): void; export function classList( node: Element, value: { [k: string]: boolean }, @@ -42,14 +29,15 @@ export function style( prev?: { [k: string]: string } ): void; export function currentContext(): any; +export function dynamicProperty(props: any, key: string): any; +export function assignProps(target: any, ...sources: any): any + +export function getHydrationKey(): string; +export function getNextElement(template: HTMLTemplateElement, isSSR: boolean): Node; +export function getNextMarker(start: Node): [Node, Array]; +export function generateHydrationScript(options: { eventNames: string[], streaming: boolean }): string; -export function ssr(template: TemplateStringsArray, ...nodes: any[]): () => string; export function ssrClassList(value: { [k: string]: boolean }): string; export function ssrStyle(value: { [k: string]: string }): string; export function ssrSpread(accessor: any, isSVG: boolean, skipChildren: boolean): () => string; export function escape(html: string): string; - -export function getHydrationKey(): string; -export function getNextElement(template: HTMLTemplateElement, isSSR: boolean): Node; -export function getNextMarker(start: Node): [Node, Array]; -export function generateHydrationEventsScript(eventNames: string[]): string; From e01a04bb8dd9c736a60bd2b14011802665c9ae2e Mon Sep 17 00:00:00 2001 From: Ryan Carniato Date: Mon, 7 Sep 2020 21:59:03 -0700 Subject: [PATCH 23/38] Account for MobX nested computation execution order --- src/lib.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib.ts b/src/lib.ts index a4a378b..e89c59f 100644 --- a/src/lib.ts +++ b/src/lib.ts @@ -60,9 +60,10 @@ export function effect(fn: (prev?: T) => T, current?: T) { }, dispose = autorun(() => { cleanupFn(false); + const prev = globalContext; globalContext = context; current = fn(current); - globalContext = globalContext.owner; + globalContext = prev; }); cleanup(() => cleanupFn(true)); } From a944b4049d48ab619e7054cc49e791176ff24987 Mon Sep 17 00:00:00 2001 From: Ryan Carniato Date: Mon, 7 Sep 2020 22:01:46 -0700 Subject: [PATCH 24/38] bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index af3e4bb..eb33a69 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "mobx-jsx", "description": "Raw MobX performance without the restraints of a Virtual DOM", - "version": "0.12.0", + "version": "0.12.1", "author": "Ryan Carniato", "license": "MIT", "repository": { From 88fbc7f5bc4693347f910585ca5e3241bac52e6f Mon Sep 17 00:00:00 2001 From: Ryan Carniato Date: Thu, 10 Sep 2020 22:29:41 -0700 Subject: [PATCH 25/38] don't double initialize, allow functions in map --- package.json | 4 ++-- src/lib.ts | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index eb33a69..6a5a0c9 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "mobx-jsx", "description": "Raw MobX performance without the restraints of a Virtual DOM", - "version": "0.12.1", + "version": "0.12.2", "author": "Ryan Carniato", "license": "MIT", "repository": { @@ -21,7 +21,7 @@ "dom-expressions": "0.20.0", "hyper-dom-expressions": "0.20.0", "lit-dom-expressions": "0.20.0", - "mobx": "^5.15.4", + "mobx": "^5.15.6", "ncp": "2.0.0", "rollup": "^2.26.9", "@rollup/plugin-babel": "5.2.0", diff --git a/src/lib.ts b/src/lib.ts index e89c59f..3610c7a 100644 --- a/src/lib.ts +++ b/src/lib.ts @@ -70,7 +70,7 @@ export function effect(fn: (prev?: T) => T, current?: T) { // only updates when boolean expression changes export function memo(fn: () => T, equal?: boolean) { - const o = observable.box(untracked(fn)), + const o = observable.box(), update = action((r: T) => o.set(r)); effect(prev => { const res = fn(); @@ -167,21 +167,22 @@ function createProvider(id: symbol) { // Modified version of mapSample from S-array[https://github.com/adamhaile/S-array] by Adam Haile export function map( - list: IObservableArray & { [$mobx]: any }, + list: IObservableArray & { [$mobx]: any } | (() => Array), mapFn: (v: T, i: number) => U | any ) { let items = [] as T[], mapped = [] as U[], disposers = [] as (() => void)[], + fn = typeof list === "function", len = 0; cleanup(() => { for (let i = 0, length = disposers.length; i < length; i++) disposers[i](); }); return () => { - list[$mobx].atom.reportObserved(); - let newItems = list, + let newItems = fn ? (list as () => Array)() : list as T[], i: number, j: number; + !fn && (list as IObservableArray & { [$mobx]: any })[$mobx].atom.reportObserved(); return untracked(() => { let newLen = newItems.length, newIndices: Map, From a111bc6800b932195d1be98ce616fe572d774b26 Mon Sep 17 00:00:00 2001 From: Ryan Carniato Date: Thu, 24 Sep 2020 02:48:58 -0700 Subject: [PATCH 26/38] update runtime --- package-lock.json | 68 +++++++++++++++++++++-------------------------- package.json | 16 +++++------ src/jsx.ts | 5 ++-- 3 files changed, 42 insertions(+), 47 deletions(-) diff --git a/package-lock.json b/package-lock.json index d1d3370..f2c4a65 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "mobx-jsx", - "version": "0.12.0", + "version": "0.12.3", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -14,13 +14,13 @@ } }, "@babel/core": { - "version": "7.11.5", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.11.5.tgz", - "integrity": "sha512-fsEANVOcZHzrsV6dMVWqpSeXClq3lNbYrfFGme6DE25FQWe7pyeYpXyx9guqUnpy466JLzZ8z4uwSr2iv60V5Q==", + "version": "7.11.6", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.11.6.tgz", + "integrity": "sha512-Wpcv03AGnmkgm6uS6k8iwhIwTrcP0m17TL1n1sy7qD0qelDu4XNeW0dN0mHfa+Gei211yDaLoEe/VlbXQzM4Bg==", "dev": true, "requires": { "@babel/code-frame": "^7.10.4", - "@babel/generator": "^7.11.5", + "@babel/generator": "^7.11.6", "@babel/helper-module-transforms": "^7.11.0", "@babel/helpers": "^7.10.4", "@babel/parser": "^7.11.5", @@ -34,18 +34,18 @@ "lodash": "^4.17.19", "resolve": "^1.3.2", "semver": "^5.4.1", - "source-map": "^0.6.1" + "source-map": "^0.5.0" }, "dependencies": { "@babel/generator": { - "version": "7.11.5", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.11.5.tgz", - "integrity": "sha512-9UqHWJ4IwRTy4l0o8gq2ef8ws8UPzvtMkVKjTLAiRmza9p9V6Z+OfuNd9fB1j5Q67F+dVJtPC2sZXI8NM9br4g==", + "version": "7.11.6", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.11.6.tgz", + "integrity": "sha512-DWtQ1PV3r+cLbySoHrwn9RWEgKMBLLma4OBQloPRyDYvc5msJM9kvTLo1YnlJd1P/ZuKbdli3ijr5q3FvAF3uA==", "dev": true, "requires": { "@babel/types": "^7.11.5", "jsesc": "^2.5.1", - "source-map": "^0.6.1" + "source-map": "^0.5.0" } }, "@babel/helper-split-export-declaration": { @@ -90,12 +90,6 @@ "lodash": "^4.17.19", "to-fast-properties": "^2.0.0" } - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true } } }, @@ -349,9 +343,9 @@ } }, "@rollup/plugin-babel": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/@rollup/plugin-babel/-/plugin-babel-5.2.0.tgz", - "integrity": "sha512-CPABsajaKjINgBQ3it+yMnfVO3ibsrMBxRzbUOUw2cL1hsZJ7aogU8mgglQm3S2hHJgjnAmxPz0Rq7DVdmHsTw==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/@rollup/plugin-babel/-/plugin-babel-5.2.1.tgz", + "integrity": "sha512-Jd7oqFR2dzZJ3NWANDyBjwTtX/lYbZpVcmkHrfQcpvawHs9E4c0nYk5U2mfZ6I/DZcIvy506KZJi54XK/jxH7A==", "dev": true, "requires": { "@babel/helper-module-imports": "^7.10.4", @@ -476,9 +470,9 @@ "dev": true }, "dom-expressions": { - "version": "0.20.0", - "resolved": "https://registry.npmjs.org/dom-expressions/-/dom-expressions-0.20.0.tgz", - "integrity": "sha512-M5A01nAcXWT4SepXG9RoXR5VCb9X9dLb8bKuhKDs2Qw3VmkIP9p59x1djw0YDhfflr5H73IHw26z7e7sZxRfRQ==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/dom-expressions/-/dom-expressions-0.20.8.tgz", + "integrity": "sha512-TWrayRwn0Rgc9OLry+5ueuzsdG66enfLywCCwVVPTzF7RHC+4mIXSJoi9skt0KMp/Kknmnhods2AQc9+uRe28Q==", "dev": true, "requires": { "babel-plugin-transform-rename-import": "^2.3.0" @@ -522,9 +516,9 @@ "dev": true }, "hyper-dom-expressions": { - "version": "0.20.0", - "resolved": "https://registry.npmjs.org/hyper-dom-expressions/-/hyper-dom-expressions-0.20.0.tgz", - "integrity": "sha512-CB+TGGpJJAts1g1oQL9douTQOu5IBlQfPMlAYfQ8RE7YRPpKknnn8NrqGFr0PwuqQLskSeH4Xv2dWeN7q/IIMQ==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/hyper-dom-expressions/-/hyper-dom-expressions-0.20.8.tgz", + "integrity": "sha512-w8g4WOM5ZHUrLYFRUfRJ3jyhYqHuMjCN8ZC0YEO5sdXTsoyBGC8luKYJOVRYfXT4W4TrcSnY27WJNFNrlaq51Q==", "dev": true }, "is-module": { @@ -555,9 +549,9 @@ } }, "lit-dom-expressions": { - "version": "0.20.0", - "resolved": "https://registry.npmjs.org/lit-dom-expressions/-/lit-dom-expressions-0.20.0.tgz", - "integrity": "sha512-uxGi3nAElM0s1gbxh2j8J8eKzx0dEtlaMUsewIkYkpmVmwpAzIS2335TSilbKMnkiw3RRLRO/VBM3o0AwgYdmw==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/lit-dom-expressions/-/lit-dom-expressions-0.20.8.tgz", + "integrity": "sha512-mNnufpLwXEZAudq5R7N5FBFAFKoOuGTcKPpqe7YU77trVNOgfTEFosCZd64SHM39z0buEofO+3sYaHPCealMcQ==", "dev": true }, "lodash": { @@ -573,9 +567,9 @@ "dev": true }, "mobx": { - "version": "5.15.4", - "resolved": "https://registry.npmjs.org/mobx/-/mobx-5.15.4.tgz", - "integrity": "sha512-xRFJxSU2Im3nrGCdjSuOTFmxVDGeqOHL+TyADCGbT0k4HHqGmx5u2yaHNryvoORpI4DfbzjJ5jPmuv+d7sioFw==", + "version": "5.15.7", + "resolved": "https://registry.npmjs.org/mobx/-/mobx-5.15.7.tgz", + "integrity": "sha512-wyM3FghTkhmC+hQjyPGGFdpehrcX1KOXsDuERhfK2YbJemkUhEB+6wzEN639T21onxlfYBmriA1PFnvxTUhcKw==", "dev": true }, "ms": { @@ -612,9 +606,9 @@ } }, "rollup": { - "version": "2.26.9", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.26.9.tgz", - "integrity": "sha512-XIiWYLayLqV+oY4S2Lub/shJq4uk/QQLwWToYCL4LjZbYHbFK3czea4UDVRUJu+zNmKmxq5Zb/OG7c5HSvH2TQ==", + "version": "2.28.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.28.1.tgz", + "integrity": "sha512-DOtVoqOZt3+FjPJWLU8hDIvBjUylc9s6IZvy76XklxzcLvAQLtVAG/bbhsMhcWnYxC0TKKcf1QQ/tg29zeID0Q==", "dev": true, "requires": { "fsevents": "~2.1.2" @@ -654,9 +648,9 @@ "dev": true }, "typescript": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.0.2.tgz", - "integrity": "sha512-e4ERvRV2wb+rRZ/IQeb3jm2VxBsirQLpQhdxplZ2MEzGvDkkMmPglecnNDfSUBivMjP93vRbngYYDQqQ/78bcQ==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.0.3.tgz", + "integrity": "sha512-tEu6DGxGgRJPb/mVPIZ48e69xCn2yRmCgYmDugAVwmJ6o+0u1RI18eO7E7WBTLYLaEVVOhwQmcdhQHweux/WPg==", "dev": true } } diff --git a/package.json b/package.json index 6a5a0c9..0fff21d 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "mobx-jsx", "description": "Raw MobX performance without the restraints of a Virtual DOM", - "version": "0.12.2", + "version": "0.12.3", "author": "Ryan Carniato", "license": "MIT", "repository": { @@ -16,17 +16,17 @@ "prepublishOnly": "npm run build" }, "devDependencies": { - "@babel/core": "7.11.5", + "@babel/core": "7.11.6", "@babel/preset-typescript": "7.10.4", - "dom-expressions": "0.20.0", - "hyper-dom-expressions": "0.20.0", - "lit-dom-expressions": "0.20.0", + "dom-expressions": "0.20.8", + "hyper-dom-expressions": "0.20.8", + "lit-dom-expressions": "0.20.8", "mobx": "^5.15.6", "ncp": "2.0.0", - "rollup": "^2.26.9", - "@rollup/plugin-babel": "5.2.0", + "rollup": "^2.28.1", + "@rollup/plugin-babel": "5.2.1", "@rollup/plugin-node-resolve": "9.0.0", - "typescript": "4.0.2" + "typescript": "4.0.3" }, "peerDependencies": { "mobx": "*" diff --git a/src/jsx.ts b/src/jsx.ts index 61c6396..7b683f3 100644 --- a/src/jsx.ts +++ b/src/jsx.ts @@ -2975,6 +2975,7 @@ declare global { ConditionalProcessingSVGAttributes, ExternalResourceSVGAttributes, StylableSVGAttributes, + TransformableSVGAttributes, Pick {} interface ImageSVGAttributes @@ -3311,7 +3312,7 @@ declare global { picture: HTMLAttributes; pre: HTMLAttributes; progress: ProgressHTMLAttributes; - q: HTMLAttributes; + q: QuoteHTMLAttributes; rp: HTMLAttributes; rt: HTMLAttributes; ruby: HTMLAttributes; @@ -3334,7 +3335,7 @@ declare global { td: TdHTMLAttributes; textarea: TextareaHTMLAttributes; tfoot: HTMLAttributes; - th: HTMLAttributes; + th: ThHTMLAttributes; thead: HTMLAttributes; time: TimeHTMLAttributes; title: HTMLAttributes; From f77844187334b8bc04340b017d8bb8b9f0c5d630 Mon Sep 17 00:00:00 2001 From: Ryan Carniato Date: Thu, 24 Sep 2020 02:55:08 -0700 Subject: [PATCH 27/38] Add props helpers --- package.json | 2 +- src/index.ts | 2 +- src/lib.ts | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 79 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 0fff21d..37282c3 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "mobx-jsx", "description": "Raw MobX performance without the restraints of a Virtual DOM", - "version": "0.12.3", + "version": "0.12.4", "author": "Ryan Carniato", "license": "MIT", "repository": { diff --git a/src/index.ts b/src/index.ts index be0491b..191e4ad 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,4 @@ -export { root, cleanup, Component, lazy, createContext, useContext, map } from "./lib"; +export { root, cleanup, Component, lazy, createContext, useContext, map, splitProps, assignProps } from "./lib"; export type { Context, FunctionComponent, ComponentProps } from "./lib"; export * from "./runtime"; diff --git a/src/lib.ts b/src/lib.ts index 3610c7a..98bc0ff 100644 --- a/src/lib.ts +++ b/src/lib.ts @@ -119,6 +119,83 @@ export function lazy(fn: () => Promise<{ default: T }>) { }; } +export function assignProps(target: T, source: U): T & U; +export function assignProps(target: T, source1: U, source2: V): T & U & V; +export function assignProps( + target: T, + source1: U, + source2: V, + source3: W +): T & U & V & W; +export function assignProps(target: any, ...sources: any): any { + for (let i = 0; i < sources.length; i++) { + const descriptors = Object.getOwnPropertyDescriptors(sources[i]); + Object.defineProperties(target, descriptors); + } + return target; +} + +export function splitProps( + props: T, + ...keys: [K1[]] +): [Pick, Omit]; +export function splitProps( + props: T, + ...keys: [K1[], K2[]] +): [Pick, Pick, Omit]; +export function splitProps< + T extends object, + K1 extends keyof T, + K2 extends keyof T, + K3 extends keyof T +>( + props: T, + ...keys: [K1[], K2[], K3[]] +): [Pick, Pick, Pick, Omit]; +export function splitProps< + T extends object, + K1 extends keyof T, + K2 extends keyof T, + K3 extends keyof T, + K4 extends keyof T +>( + props: T, + ...keys: [K1[], K2[], K3[], K4[]] +): [Pick, Pick, Pick, Pick, Omit]; +export function splitProps< + T extends object, + K1 extends keyof T, + K2 extends keyof T, + K3 extends keyof T, + K4 extends keyof T, + K5 extends keyof T +>( + props: T, + ...keys: [K1[], K2[], K3[], K4[], K5[]] +): [ + Pick, + Pick, + Pick, + Pick, + Pick, + Omit +]; +export function splitProps(props: T, ...keys: [(keyof T)[]]) { + const descriptors = Object.getOwnPropertyDescriptors(props), + split = (k: (keyof T)[]) => { + const clone: Partial = {}; + for (let i = 0; i < k.length; i++) { + const key = k[i]; + if (descriptors[key]) { + Object.defineProperty(clone, key, descriptors[key]); + delete descriptors[key]; + } + } + return clone; + }; + return keys.map(split).concat(split(Object.keys(descriptors) as (keyof T)[])); +} + // context api export function createContext(defaultValue?: unknown): Context { const id = Symbol("context"); From d15e3607edc55078606f2a2e1f5fe54490b149d5 Mon Sep 17 00:00:00 2001 From: Ryan Carniato Date: Thu, 24 Sep 2020 02:55:56 -0700 Subject: [PATCH 28/38] fix build --- rollup.config.js | 1 + 1 file changed, 1 insertion(+) diff --git a/rollup.config.js b/rollup.config.js index fc20999..dd67ece 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -7,6 +7,7 @@ const plugins = [ }), babel({ extensions: ['.js', '.ts'], + babelHelpers: "bundled", presets: ["@babel/preset-typescript"], plugins: [ [ From 051a593a280fb377b051b259198fa1abc3abe6af Mon Sep 17 00:00:00 2001 From: Tito Date: Tue, 29 Sep 2020 15:48:02 -0300 Subject: [PATCH 29/38] Update README.md --- README.md | 67 +++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 50 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index f46cc93..82b7f3b 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,11 @@ This library is a demonstration of how MobX fine grain control can be leveraged Check out MobX JSX performance near the top of the charts on the [JS Frameworks Benchmark](https://github.com/krausest/js-framework-benchmark). -It accomplishes this with using [Babel Plugin JSX DOM Expressions](https://github.com/ryansolid/babel-plugin-jsx-dom-expressions). It compiles JSX to DOM statements and wraps expressions in functions that can be called by the library of choice. In this case `autorun` wraps these expressions ensuring the view stays up to date. Unlike Virtual DOM only the changed nodes are affected and the whole tree is not re-rendered over and over. +It accomplishes this with using [Babel Plugin JSX DOM Expressions](https://github.com/ryansolid/dom-expressions/tree/master/packages/babel-plugin-jsx-dom-expressions). It compiles JSX to DOM statements and wraps expressions in functions that can be called by the library of choice. In this case `autorun` wraps these expressions ensuring the view stays up to date. Unlike Virtual DOM only the changed nodes are affected and the whole tree is not re-rendered over and over. -To use call render: +## Usage + +To use call render as follow ```js import { render } from 'mobx-jsx'; @@ -17,8 +19,9 @@ render(App, document.getElementById('main')); And include 'babel-plugin-jsx-dom-expressions' in your babelrc, webpack babel loader, or rollup babel plugin. ```js -"plugins": [["jsx-dom-expressions", {moduleName: 'mobx-jsx'}]] +"plugins": [["babel-plugin-jsx-dom-expressions", {moduleName: 'mobx-jsx'}]] ``` +See [plugin options](https://github.com/ryansolid/dom-expressions/tree/master/packages/babel-plugin-jsx-dom-expressions#plugin-options) ## Installation @@ -28,21 +31,18 @@ And include 'babel-plugin-jsx-dom-expressions' in your babelrc, webpack babel lo ## Examples -[Mobx Counter(Functions)](https://codesandbox.io/s/mobx-counterfunctions-3sqv1) - -[MobX Counter(Classes)](https://codesandbox.io/s/mobx-counterclasses-uz7g9) - -[MobX Lazy](https://codesandbox.io/s/mobx-lazy-demo-ev95s) - -[Mobx Context](https://codesandbox.io/s/mobx-counter-context-wlu1x) +- [Counter Using Functions](https://codesandbox.io/s/mobx-counterfunctions-3sqv1) +- [Counter Using Classes](https://codesandbox.io/s/mobx-counterclasses-uz7g9) +- [Lazy Loading](https://codesandbox.io/s/mobx-lazy-demo-ev95s) +- [Context](https://codesandbox.io/s/mobx-counter-context-wlu1x) ## API -MobX JSX works both with function and class components(extend Component from this library). +MobX JSX works both with function and Class components (extend Component from this library). -### Note on observable arrays +### Map For Observable Arrays -It also ships a specialize map function for optimal list rendering that takes an observable array as it's first argument. To avoid re-rendering the complete list on changes. +Ships a specialize map function for optimal list rendering that takes an observable array as it's first argument. To avoid re-rendering the complete list on changes. ```jsx import { map } from "mobx-jsx"; @@ -54,9 +54,14 @@ const list = observable(["Alpha", "Beta", "Gamma"]); } ``` -### MobX JSX also supports a Context API. +### Lifecycles -### Components can be loaded lazily +Unlike React `render` only runs once, so you may not need to split in functions or methods your Lifecycles, all the initialization code could be set on `render`. See the issue [Lifecycles](https://github.com/ryansolid/mobx-jsx/issues/23) for furter information + +However, you may emulate `componentDidMount` and `componentWillUnmount`. The microtak`Promise` resolution will be after mount and `cleanup` runs at the beginning of re-evaluation so the elements aren't removed yet. + + +### Lazily Loading a Component ```jsx import { render, lazy } from "mobx-jsx"; @@ -75,9 +80,37 @@ function App() { render(App, document.body); ``` -### Non-precompiled environments +#### Example + +```jsx +import { render, cleanup, Component as _Component } from 'mobx-jsx' + +class Component extends _Component { + constructor(props) { + super(props) + if (this.componentDidMount) { + Promise.resolve().then(() => this.componentDidMount()) + } + if (this.componentWillUnmount) { + cleanup(() => this.componentWillUnmount()) + } + } +} + +class App extends Component { + componentDidMount(){ console.log('componentDidMount')} + componentWillUnmount(){ console.log('componentWillUnmount') } +} + +``` + + + +### MobX JSX also supports a Context API. + +## Non-precompiled environments -Alternatively this library supports Tagged Template Literals or HyperScript for non-precompiled environments by installing the companion library and including variants: +Alternatively supports Tagged Template Literals or HyperScript for non-precompiled environments by installing the companion library and including variants: ```js import { html } from 'mobx-jsx/html'; // or import { h } from 'mobx-jsx/h'; From 85a58b10e5b105d2ca833bf499360f67c876ff48 Mon Sep 17 00:00:00 2001 From: Tito Date: Thu, 1 Oct 2020 16:44:59 -0300 Subject: [PATCH 30/38] Update README.md messed up the example location for lifecycles --- README.md | 38 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 82b7f3b..a354478 100644 --- a/README.md +++ b/README.md @@ -60,26 +60,6 @@ Unlike React `render` only runs once, so you may not need to split in functions However, you may emulate `componentDidMount` and `componentWillUnmount`. The microtak`Promise` resolution will be after mount and `cleanup` runs at the beginning of re-evaluation so the elements aren't removed yet. - -### Lazily Loading a Component - -```jsx -import { render, lazy } from "mobx-jsx"; - -// use lazy to allow code splitting -const SomeComponent = lazy(() => import("./SomeComponent")); - -function App() { - return ( - <> - - - ); -} - -render(App, document.body); -``` - #### Example ```jsx @@ -105,6 +85,24 @@ class App extends Component { ``` +### Lazily Loading a Component + +```jsx +import { render, lazy } from "mobx-jsx"; + +// use lazy to allow code splitting +const SomeComponent = lazy(() => import("./SomeComponent")); + +function App() { + return ( + <> + + + ); +} + +render(App, document.body); +``` ### MobX JSX also supports a Context API. From 90e1075dc0281bd949bdc13b8ed7f7a217ec87b5 Mon Sep 17 00:00:00 2001 From: Ryan Carniato Date: Sat, 17 Oct 2020 23:07:53 -0700 Subject: [PATCH 31/38] Update to attribute by default fixes #35 --- package-lock.json | 26 +-- package.json | 10 +- src/h.ts | 5 +- src/html.ts | 28 ++- src/jsx.ts | 441 ++++++++++++++++++++++++++++------------------ src/runtime.d.ts | 17 +- 6 files changed, 336 insertions(+), 191 deletions(-) diff --git a/package-lock.json b/package-lock.json index f2c4a65..5f8ec73 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "mobx-jsx", - "version": "0.12.3", + "version": "0.13.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -470,9 +470,9 @@ "dev": true }, "dom-expressions": { - "version": "0.20.8", - "resolved": "https://registry.npmjs.org/dom-expressions/-/dom-expressions-0.20.8.tgz", - "integrity": "sha512-TWrayRwn0Rgc9OLry+5ueuzsdG66enfLywCCwVVPTzF7RHC+4mIXSJoi9skt0KMp/Kknmnhods2AQc9+uRe28Q==", + "version": "0.22.0", + "resolved": "https://registry.npmjs.org/dom-expressions/-/dom-expressions-0.22.0.tgz", + "integrity": "sha512-ShVoBqmQxeGefV57CFXv8WZO3jKH8K1tGfqYZG7pJXK8Dj0bD51kUpkoc0eIkmU3iYio4X57qYPd9sxtW275IQ==", "dev": true, "requires": { "babel-plugin-transform-rename-import": "^2.3.0" @@ -516,9 +516,9 @@ "dev": true }, "hyper-dom-expressions": { - "version": "0.20.8", - "resolved": "https://registry.npmjs.org/hyper-dom-expressions/-/hyper-dom-expressions-0.20.8.tgz", - "integrity": "sha512-w8g4WOM5ZHUrLYFRUfRJ3jyhYqHuMjCN8ZC0YEO5sdXTsoyBGC8luKYJOVRYfXT4W4TrcSnY27WJNFNrlaq51Q==", + "version": "0.22.0", + "resolved": "https://registry.npmjs.org/hyper-dom-expressions/-/hyper-dom-expressions-0.22.0.tgz", + "integrity": "sha512-Wvssg2JOArScUpVtfKnv8NficgJxJiCommlpsivh1rggSw5ulbLLwjbceqvsHOY5VMPIpBZUgxMHYb+qqB23LA==", "dev": true }, "is-module": { @@ -549,9 +549,9 @@ } }, "lit-dom-expressions": { - "version": "0.20.8", - "resolved": "https://registry.npmjs.org/lit-dom-expressions/-/lit-dom-expressions-0.20.8.tgz", - "integrity": "sha512-mNnufpLwXEZAudq5R7N5FBFAFKoOuGTcKPpqe7YU77trVNOgfTEFosCZd64SHM39z0buEofO+3sYaHPCealMcQ==", + "version": "0.22.0", + "resolved": "https://registry.npmjs.org/lit-dom-expressions/-/lit-dom-expressions-0.22.0.tgz", + "integrity": "sha512-VNqmGxQ82IAFNCfGEZVd2nLWSvT8gJiM/bLXoDtk+r1aoB3yZSw+tISq2/FNuYNsd/O90V5pvh6Cq6FJKFwumw==", "dev": true }, "lodash": { @@ -606,9 +606,9 @@ } }, "rollup": { - "version": "2.28.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.28.1.tgz", - "integrity": "sha512-DOtVoqOZt3+FjPJWLU8hDIvBjUylc9s6IZvy76XklxzcLvAQLtVAG/bbhsMhcWnYxC0TKKcf1QQ/tg29zeID0Q==", + "version": "2.32.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.32.0.tgz", + "integrity": "sha512-0FIG1jY88uhCP2yP4CfvtKEqPDRmsUwfY1kEOOM+DH/KOGATgaIFd/is1+fQOxsvh62ELzcFfKonwKWnHhrqmw==", "dev": true, "requires": { "fsevents": "~2.1.2" diff --git a/package.json b/package.json index 37282c3..b9fedb5 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "mobx-jsx", "description": "Raw MobX performance without the restraints of a Virtual DOM", - "version": "0.12.4", + "version": "0.13.0", "author": "Ryan Carniato", "license": "MIT", "repository": { @@ -18,12 +18,12 @@ "devDependencies": { "@babel/core": "7.11.6", "@babel/preset-typescript": "7.10.4", - "dom-expressions": "0.20.8", - "hyper-dom-expressions": "0.20.8", - "lit-dom-expressions": "0.20.8", + "dom-expressions": "0.22.0", + "hyper-dom-expressions": "0.22.0", + "lit-dom-expressions": "0.22.0", "mobx": "^5.15.6", "ncp": "2.0.0", - "rollup": "^2.28.1", + "rollup": "^2.32.0", "@rollup/plugin-babel": "5.2.1", "@rollup/plugin-node-resolve": "9.0.0", "typescript": "4.0.3" diff --git a/src/h.ts b/src/h.ts index 97589a8..ccbb2f2 100644 --- a/src/h.ts +++ b/src/h.ts @@ -1,12 +1,13 @@ import { createHyperScript } from "hyper-dom-expressions"; -import { spread, assign, insert, createComponent, dynamicProperty } from "./index"; +import { spread, assign, insert, createComponent, dynamicProperty, SVGElements } from "./index.js"; export const h = createHyperScript({ spread, assign, insert, createComponent, - dynamicProperty + dynamicProperty, + SVGElements }); export * from './index'; \ No newline at end of file diff --git a/src/html.ts b/src/html.ts index 5380790..5379e45 100644 --- a/src/html.ts +++ b/src/html.ts @@ -1,5 +1,21 @@ import { createHTML } from "lit-dom-expressions"; -import { effect, style, insert, createComponent, delegateEvents, classList, dynamicProperty } from "./index"; +import { + effect, + style, + insert, + createComponent, + delegateEvents, + classList, + dynamicProperty, + setAttribute, + setAttributeNS, + Aliases, + Properties, + ChildProperties, + NonComposedEvents, + SVGElements, + SVGNamespace +} from "./index.js"; export const html = createHTML({ effect, @@ -8,7 +24,15 @@ export const html = createHTML({ createComponent, delegateEvents, classList, - dynamicProperty + dynamicProperty, + setAttribute, + setAttributeNS, + Aliases, + Properties, + ChildProperties, + NonComposedEvents, + SVGElements, + SVGNamespace }); export * from "./index"; \ No newline at end of file diff --git a/src/jsx.ts b/src/jsx.ts index 7b683f3..18f217c 100644 --- a/src/jsx.ts +++ b/src/jsx.ts @@ -7,13 +7,27 @@ declare global { */ namespace JSX { - type Element = Node | ArrayElement | FunctionElement | string | number | boolean | null | undefined; + type Element = + | Node + | ArrayElement + | FunctionElement + | string + | number + | boolean + | null + | undefined; interface ArrayElement extends Array {} interface FunctionElement { (): Element; } + interface ElementClass { + render(props: any): Element; + } + + type LibraryManagedAttributes = Props; + // Let TS know the name of the `children` property in order for it to be able to type check them. // https://github.com/Microsoft/TypeScript/issues/18357 interface ElementChildrenAttribute { @@ -71,7 +85,7 @@ declare global { onChange?: EventHandlerUnion; onInput?: EventHandlerUnion; onReset?: EventHandlerUnion; - onSubmit?: EventHandlerUnion; + onSubmit?: EventHandlerUnion; // Image Events onLoad?: EventHandlerUnion; @@ -1009,7 +1023,7 @@ declare global { */ hyphens?: CSSWideKeyword | any; - imeMode?: CSSWideKeyword | any; + "ime-mode"?: CSSWideKeyword | any; /** * Defines how the browser distributes space between and around flex items @@ -1252,12 +1266,12 @@ declare global { /** * Controls how extra content exceeding the x-axis of the bounding box of an element is rendered. */ - overflowX?: CSSWideKeyword | "auto" | "hidden" | "scroll" | "visible"; + "overflow-x"?: CSSWideKeyword | "auto" | "hidden" | "scroll" | "visible"; /** * Controls how extra content exceeding the y-axis of the bounding box of an element is rendered. */ - overflowY?: CSSWideKeyword | "auto" | "hidden" | "scroll" | "visible"; + "overflow-y"?: CSSWideKeyword | "auto" | "hidden" | "scroll" | "visible"; /** * The padding optional CSS property sets the required padding space on one to four sides of an element. @@ -1917,8 +1931,8 @@ declare global { accessKey?: string; className?: string; class?: string; - contentEditable?: boolean | "inherit"; - contextMenu?: string; + contenteditable?: boolean | "inherit"; + contextmenu?: string; dir?: HTMLDir; draggable?: boolean; hidden?: boolean; @@ -1926,7 +1940,6 @@ declare global { lang?: string; spellcheck?: boolean; style?: CSSProperties | string; - tabIndex?: number | string; tabindex?: number | string; title?: string; translate?: "yes" | "no"; @@ -1942,13 +1955,32 @@ declare global { vocab?: string; // Non-standard Attributes - autoCapitalize?: HTMLAutocapitalize; + autocapitalize?: HTMLAutocapitalize; color?: string; + itemprop?: string; + itemscope?: boolean; + itemtype?: string; + itemid?: string; + itemref?: string; + + // others + align?: "start" | "end" | "center" | "baseline" | "stretch" | "left" | "right"; + part?: string; + exportparts?: string; + inputmode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search"; + + // camelcase + contentEditable?: boolean | "inherit"; + contextMenu?: string; + tabIndex?: number | string; + autoCapitalize?: HTMLAutocapitalize; itemProp?: string; itemScope?: boolean; itemType?: string; itemId?: string; itemRef?: string; + exportParts?: string; + inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search"; } // HTML Elements @@ -1959,10 +1991,13 @@ declare global { hreflang?: string; media?: string; ping?: string; - referrerPolicy?: HTMLReferrerPolicy; + referrerpolicy?: HTMLReferrerPolicy; rel?: string; target?: string; type?: string; + + // camelcase + referrerPolicy?: HTMLReferrerPolicy; } interface AudioHTMLAttributes extends MediaHTMLAttributes {} @@ -1974,10 +2009,13 @@ declare global { href?: string; hreflang?: string; ping?: string; - referrerPolicy?: HTMLReferrerPolicy; + referrerpolicy?: HTMLReferrerPolicy; rel?: string; shape?: "rect" | "circle" | "poly" | "default"; target?: string; + + // camelcase + referrerPolicy?: HTMLReferrerPolicy; } interface BaseHTMLAttributes extends HTMLAttributes { @@ -1993,14 +2031,21 @@ declare global { autofocus?: boolean; disabled?: boolean; form?: string; + formaction?: string; + formenctype?: HTMLFormEncType; + formmethod?: HTMLFormMethod; + formnovalidate?: boolean; + formtarget?: string; + name?: string; + type?: "submit" | "reset" | "button"; + value?: string; + + // camelcase formAction?: string; formEnctype?: HTMLFormEncType; formMethod?: HTMLFormMethod; formNoValidate?: boolean; formTarget?: string; - name?: string; - type?: "submit" | "reset" | "button"; - value?: string; } interface CanvasHTMLAttributes extends HTMLAttributes { @@ -2043,15 +2088,19 @@ declare global { } interface FormHTMLAttributes extends HTMLAttributes { - acceptCharset?: string; + acceptcharset?: string; action?: string; autocomplete?: string; encoding?: HTMLFormEncType; enctype?: HTMLFormEncType; method?: HTMLFormMethod; name?: string; - noValidate?: boolean; + novalidate?: boolean; target?: string; + + // camelcase + acceptCharset?: string; + noValidate?: boolean; } interface IframeHTMLAttributes extends HTMLAttributes { @@ -2059,23 +2108,30 @@ declare global { allowfullscreen?: boolean; height?: number | string; name?: string; - referrerPolicy?: HTMLReferrerPolicy; + referrerpolicy?: HTMLReferrerPolicy; sandbox?: HTMLIframeSandbox; src?: string; srcdoc?: string; width?: number | string; + + // camelcase + referrerPolicy?: HTMLReferrerPolicy; } interface ImgHTMLAttributes extends HTMLAttributes { alt?: string; - crossOrigin?: HTMLCrossorigin; + crossorigin?: HTMLCrossorigin; decoding?: "sync" | "async" | "auto"; height?: number | string; - referrerPolicy?: HTMLReferrerPolicy; + referrerpolicy?: HTMLReferrerPolicy; sizes?: string; src?: string; srcset?: string; width?: number | string; + + // camelcase + crossOrigin?: HTMLCrossorigin; + referrerPolicy?: HTMLReferrerPolicy; } interface InputHTMLAttributes extends HTMLAttributes { @@ -2085,25 +2141,25 @@ declare global { autofocus?: boolean; capture?: boolean | string; checked?: boolean; - crossOrigin?: HTMLCrossorigin; + crossorigin?: HTMLCrossorigin; disabled?: boolean; form?: string; - formAction?: string; - formEnctype?: HTMLFormEncType; - formMethod?: HTMLFormMethod; - formNoValidate?: boolean; - formTarget?: string; + formaction?: string; + formenctype?: HTMLFormEncType; + formmethod?: HTMLFormMethod; + formnovalidate?: boolean; + formtarget?: string; height?: number | string; list?: string; max?: number | string; - maxLength?: number | string; + maxlength?: number | string; min?: number | string; - minLength?: number | string; + minlength?: number | string; multiple?: boolean; name?: string; pattern?: string; placeholder?: string; - readOnly?: boolean; + readonly?: boolean; required?: boolean; size?: number | string; src?: string; @@ -2111,6 +2167,17 @@ declare global { type?: string; value?: string | string[] | number; width?: number | string; + + // camelcase + crossOrigin?: HTMLCrossorigin; + formAction?: string; + formEnctype?: HTMLFormEncType; + formMethod?: HTMLFormMethod; + formNoValidate?: boolean; + formTarget?: string; + maxLength?: number | string; + minLength?: number | string; + readOnly?: boolean; } interface InsHTMLAttributes extends HTMLAttributes { @@ -2140,16 +2207,20 @@ declare global { interface LinkHTMLAttributes extends HTMLAttributes { as?: HTMLLinkAs; - crossOrigin?: HTMLCrossorigin; + crossorigin?: HTMLCrossorigin; disabled?: boolean; href?: string; hreflang?: string; integrity?: string; media?: string; - referrerPolicy?: HTMLReferrerPolicy; + referrerpolicy?: HTMLReferrerPolicy; rel?: string; sizes?: string; type?: string; + + // camelcase + crossOrigin?: HTMLCrossorigin; + referrerPolicy?: HTMLReferrerPolicy; } interface MapHTMLAttributes extends HTMLAttributes { @@ -2159,12 +2230,16 @@ declare global { interface MediaHTMLAttributes extends HTMLAttributes { autoplay?: boolean; controls?: boolean; - crossOrigin?: HTMLCrossorigin; + crossorigin?: HTMLCrossorigin; loop?: boolean; - mediaGroup?: string; + mediagroup?: string; muted?: boolean; preload?: "none" | "metadata" | "auto" | ""; src?: string; + + // camelcase + crossOrigin?: HTMLCrossorigin; + mediaGroup?: string; } interface MenuHTMLAttributes extends HTMLAttributes { @@ -2175,8 +2250,11 @@ declare global { interface MetaHTMLAttributes extends HTMLAttributes { charset?: string; content?: string; - httpEquiv?: string; + httpequiv?: string; name?: string; + + // camelcase + httpEquiv?: string; } interface MeterHTMLAttributes extends HTMLAttributes { @@ -2199,8 +2277,11 @@ declare global { height?: number | string; name?: string; type?: string; - useMap?: string; + usemap?: string; width?: number | string; + + //camelcase + useMap?: string; } interface OlHTMLAttributes extends HTMLAttributes { @@ -2224,6 +2305,7 @@ declare global { interface OutputHTMLAttributes extends HTMLAttributes { form?: string; htmlFor?: string; + for?: string; name?: string; } @@ -2240,14 +2322,19 @@ declare global { interface ScriptHTMLAttributes extends HTMLAttributes { async?: boolean; charset?: string; - crossOrigin?: HTMLCrossorigin; + crossorigin?: HTMLCrossorigin; defer?: boolean; integrity?: string; - noModule?: boolean; + nomodule?: boolean; nonce?: string; - referrerPolicy?: HTMLReferrerPolicy; + referrerpolicy?: HTMLReferrerPolicy; src?: string; type?: string; + + // camelcase + crossOrigin?: HTMLCrossorigin; + noModule?: boolean; + referrerPolicy?: HTMLReferrerPolicy; } interface SelectHTMLAttributes extends HTMLAttributes { @@ -2282,8 +2369,12 @@ declare global { } interface TdHTMLAttributes extends HTMLAttributes { - colSpan?: number | string; + colspan?: number | string; headers?: string; + rowspan?: number | string; + + // camelcase + colSpan?: number | string; rowSpan?: number | string; } @@ -2294,24 +2385,34 @@ declare global { dirname?: string; disabled?: boolean; form?: string; - maxLength?: number | string; - minLength?: number | string; + maxlength?: number | string; + minlength?: number | string; name?: string; placeholder?: string; - readOnly?: boolean; + readonly?: boolean; required?: boolean; rows?: number | string; value?: string | string[] | number; wrap?: "hard" | "soft" | "off"; + + // camelcase + maxLength?: number | string; + minLength?: number | string; + readOnly?: boolean; } interface ThHTMLAttributes extends HTMLAttributes { - colSpan?: number | string; + colspan?: number | string; headers?: string; + rowspan?: number | string; + + // camelcase + colSpan?: number | string; rowSpan?: number | string; } interface TimeHTMLAttributes extends HTMLAttributes { + datetime?: string; dateTime?: string; } @@ -2412,15 +2513,16 @@ declare global { transform?: string; } - interface XLinkSVGAttributes { - xlinkActuate?: string; - xlinkArcrole?: string; - xlinkHref?: string; - xlinkRole?: string; - xlinkShow?: string; - xlinkTitle?: string; - xlinkType?: string; - } + // Fix when namespaces introduced + // interface XLinkSVGAttributes { + // xlinkActuate?: string; + // xlinkArcrole?: string; + // xlinkHref?: string; + // xlinkRole?: string; + // xlinkShow?: string; + // xlinkTitle?: string; + // xlinkType?: string; + // } interface ConditionalProcessingSVGAttributes { requiredExtensions?: string; @@ -2466,7 +2568,7 @@ declare global { } interface PresentationSVGAttributes { - alignmentBaseline?: + "alignment-baseline"?: | "auto" | "baseline" | "before-edge" @@ -2480,19 +2582,19 @@ declare global { | "hanging" | "mathematical" | "inherit"; - baselineShift?: number | string; + "baseline-shift"?: number | string; clip?: string; - clipPath?: string; - clipRule?: "nonzero" | "evenodd" | "inherit"; + "clip-path"?: string; + "clip-rule"?: "nonzero" | "evenodd" | "inherit"; color?: string; - colorInterpolation?: "auto" | "sRGB" | "linearRGB" | "inherit"; - colorInterpolationFilters?: "auto" | "sRGB" | "linearRGB" | "inherit"; - colorProfile?: string; - colorRendering?: "auto" | "optimizeSpeed" | "optimizeQuality" | "inherit"; + "color-interpolation"?: "auto" | "sRGB" | "linearRGB" | "inherit"; + "color-interpolation-filters"?: "auto" | "sRGB" | "linearRGB" | "inherit"; + "color-profile"?: string; + "color-rendering"?: "auto" | "optimizeSpeed" | "optimizeQuality" | "inherit"; cursor?: string; direction?: "ltr" | "rtl" | "inherit"; display?: string; - dominantBaseline?: + "dominant-baseline"?: | "auto" | "text-bottom" | "alphabetic" @@ -2503,33 +2605,33 @@ declare global { | "hanging" | "text-top" | "inherit"; - enableBackground?: string; + "enable-background"?: string; fill?: string; - fillOpacity?: number | string | "inherit"; - fillRule?: "nonzero" | "evenodd" | "inherit"; + "fill-opacity"?: number | string | "inherit"; + "fill-rule"?: "nonzero" | "evenodd" | "inherit"; filter?: string; - floodColor?: string; - floodOpacity?: number | string | "inherit"; - fontFamily?: string; - fontSize?: string; - fontSizeAdjust?: number | string; - fontStretch?: string; - fontStyle?: "normal" | "italic" | "oblique" | "inherit"; - fontVariant?: string; - fontWeight?: number | string; - glyphOrientationHorizontal?: string; - glyphOrientationVertical?: string; - imageRendering?: "auto" | "optimizeQuality" | "optimizeSpeed" | "inherit"; + "flood-color"?: string; + "flood-opacity"?: number | string | "inherit"; + "font-family"?: string; + "font-size"?: string; + "font-size-adjust"?: number | string; + "font-stretch"?: string; + "font-style"?: "normal" | "italic" | "oblique" | "inherit"; + "font-variant"?: string; + "font-weight"?: number | string; + "glyph-orientation-horizontal"?: string; + "glyph-orientation-vertical"?: string; + "image-rendering"?: "auto" | "optimizeQuality" | "optimizeSpeed" | "inherit"; kerning?: string; - letterSpacing?: number | string; - lightingColor?: string; - markerEnd?: string; - markerMid?: string; - markerStart?: string; + "letter-spacing"?: number | string; + "lighting-color"?: string; + "marker-end"?: string; + "marker-mid"?: string; + "marker-start"?: string; mask?: string; opacity?: number | string | "inherit"; overflow?: "visible" | "hidden" | "scroll" | "auto" | "inherit"; - pointerEvents?: + "pointer-events"?: | "bounding-box" | "visiblePainted" | "visibleFill" @@ -2542,29 +2644,34 @@ declare global { | "all" | "none" | "inherit"; - shapeRendering?: "auto" | "optimizeSpeed" | "crispEdges" | "geometricPrecision" | "inherit"; - stopColor?: string; - stopOpacity?: number | string | "inherit"; + "shape-rendering"?: + | "auto" + | "optimizeSpeed" + | "crispEdges" + | "geometricPrecision" + | "inherit"; + "stop-color"?: string; + "stop-opacity"?: number | string | "inherit"; stroke?: string; - strokeDasharray?: string; - strokeDashoffset?: number | string; - strokeLinecap?: "butt" | "round" | "square" | "inherit"; - strokeLinejoin?: "arcs" | "bevel" | "miter" | "miter-clip" | "round" | "inherit"; - strokeMiterlimit?: number | string | "inherit"; - strokeOpacity?: number | string | "inherit"; - strokeWidth?: number | string; - textAnchor?: "start" | "middle" | "end" | "inherit"; - textDecoration?: "none" | "underline" | "overline" | "line-through" | "blink" | "inherit"; - textRendering?: + "stroke-dasharray"?: string; + "stroke-dashoffset"?: number | string; + "stroke-linecap"?: "butt" | "round" | "square" | "inherit"; + "stroke-linejoin"?: "arcs" | "bevel" | "miter" | "miter-clip" | "round" | "inherit"; + "stroke-miterlimit"?: number | string | "inherit"; + "stroke-opacity"?: number | string | "inherit"; + "stroke-width"?: number | string; + "text-anchor"?: "start" | "middle" | "end" | "inherit"; + "text-decoration"?: "none" | "underline" | "overline" | "line-through" | "blink" | "inherit"; + "text-rendering"?: | "auto" | "optimizeSpeed" | "optimizeLegibility" | "geometricPrecision" | "inherit"; - unicodeBidi?: string; + "unicode-bidi"?: string; visibility?: "visible" | "hidden" | "collapse" | "inherit"; - wordSpacing?: number | string; - writingMode?: "lr-tb" | "rl-tb" | "tb-rl" | "lr" | "rl" | "tb" | "inherit"; + "word-spacing"?: number | string; + "writing-mode"?: "lr-tb" | "rl-tb" | "tb-rl" | "lr" | "rl" | "tb" | "inherit"; } interface AnimationElementSVGAttributes @@ -2576,19 +2683,19 @@ declare global { extends CoreSVGAttributes, Pick< PresentationSVGAttributes, - | "clipPath" + | "clip-path" | "mask" | "cursor" | "opacity" | "filter" - | "enableBackground" - | "colorInterpolation" - | "colorRendering" + | "enable-background" + | "color-interpolation" + | "color-rendering" > {} interface FilterPrimitiveElementSVGAttributes extends CoreSVGAttributes, - Pick { + Pick { x?: number | string; y?: number | string; width?: number | string; @@ -2612,7 +2719,7 @@ declare global { interface GradientElementSVGAttributes extends CoreSVGAttributes, - XLinkSVGAttributes, + // XLinkSVGAttributes, ExternalResourceSVGAttributes, StylableSVGAttributes { gradientUnits?: SVGUnits; @@ -2624,16 +2731,16 @@ declare global { extends CoreSVGAttributes, Pick< PresentationSVGAttributes, - | "clipRule" + | "clip-rule" | "mask" - | "pointerEvents" + | "pointer-events" | "cursor" | "opacity" | "filter" | "display" | "visibility" - | "colorInterpolation" - | "colorRendering" + | "color-interpolation" + | "color-rendering" > {} interface LightSourceElementSVGAttributes extends CoreSVGAttributes {} @@ -2650,52 +2757,52 @@ declare global { PresentationSVGAttributes, | "color" | "fill" - | "fillRule" - | "fillOpacity" + | "fill-rule" + | "fill-opacity" | "stroke" - | "strokeWidth" - | "strokeLinecap" - | "strokeLinejoin" - | "strokeMiterlimit" - | "strokeDasharray" - | "strokeDashoffset" - | "strokeOpacity" - | "shapeRendering" + | "stroke-width" + | "stroke-linecap" + | "stroke-linejoin" + | "stroke-miterlimit" + | "stroke-dasharray" + | "stroke-dashoffset" + | "stroke-opacity" + | "shape-rendering" > {} interface TextContentElementSVGAttributes extends CoreSVGAttributes, Pick< PresentationSVGAttributes, - | "fontFamily" - | "fontStyle" - | "fontVariant" - | "fontWeight" - | "fontStretch" - | "fontSize" - | "fontSizeAdjust" + | "font-family" + | "font-style" + | "font-variant" + | "font-weight" + | "font-stretch" + | "font-size" + | "font-size-adjust" | "kerning" - | "letterSpacing" - | "wordSpacing" - | "textDecoration" - | "glyphOrientationHorizontal" - | "glyphOrientationVertical" + | "letter-spacing" + | "word-spacing" + | "text-decoration" + | "glyph-orientation-horizontal" + | "glyph-orientation-vertical" | "direction" - | "unicodeBidi" - | "textAnchor" - | "dominantBaseline" + | "unicode-bidi" + | "text-anchor" + | "dominant-baseline" | "color" | "fill" - | "fillRule" - | "fillOpacity" + | "fill-rule" + | "fill-opacity" | "stroke" - | "strokeWidth" - | "strokeLinecap" - | "strokeLinejoin" - | "strokeMiterlimit" - | "strokeDasharray" - | "strokeDashoffset" - | "strokeOpacity" + | "stroke-width" + | "stroke-linecap" + | "stroke-linejoin" + | "stroke-miterlimit" + | "stroke-dasharray" + | "stroke-dashoffset" + | "stroke-opacity" > {} interface ZoomAndPanSVGAttributes { @@ -2704,28 +2811,28 @@ declare global { interface AnimateSVGAttributes extends AnimationElementSVGAttributes, - XLinkSVGAttributes, + // XLinkSVGAttributes, AnimationAttributeTargetSVGAttributes, AnimationTimingSVGAttributes, AnimationValueSVGAttributes, AnimationAdditionSVGAttributes, - Pick {} + Pick {} interface AnimateMotionSVGAttributes extends AnimationElementSVGAttributes, - XLinkSVGAttributes, + // XLinkSVGAttributes, AnimationTimingSVGAttributes, AnimationValueSVGAttributes, AnimationAdditionSVGAttributes { path?: string; keyPoints?: string; - rotate?: number | string |"auto" | "auto-reverse"; + rotate?: number | string | "auto" | "auto-reverse"; origin?: "default"; } interface AnimateTransformSVGAttributes extends AnimationElementSVGAttributes, - XLinkSVGAttributes, + // XLinkSVGAttributes, AnimationAttributeTargetSVGAttributes, AnimationTimingSVGAttributes, AnimationValueSVGAttributes, @@ -2750,7 +2857,7 @@ declare global { ExternalResourceSVGAttributes, StylableSVGAttributes, TransformableSVGAttributes, - Pick { + Pick { clipPathUnits?: SVGUnits; } @@ -2826,7 +2933,7 @@ declare global { extends FilterPrimitiveElementSVGAttributes, SingleInputFilterSVGAttributes, StylableSVGAttributes, - Pick { + Pick { surfaceScale?: number | string; diffuseConstant?: number | string; kernelUnitLength?: number | string; @@ -2849,7 +2956,7 @@ declare global { interface FeFloodSVGAttributes extends FilterPrimitiveElementSVGAttributes, StylableSVGAttributes, - Pick {} + Pick {} interface FeFuncSVGAttributes extends CoreSVGAttributes { type?: "identity" | "table" | "discrete" | "linear" | "gamma"; @@ -2870,7 +2977,7 @@ declare global { interface FeImageSVGAttributes extends FilterPrimitiveElementSVGAttributes, - XLinkSVGAttributes, + // XLinkSVGAttributes, ExternalResourceSVGAttributes, StylableSVGAttributes { preserveAspectRatio: SVGPreserveAspectRatio; @@ -2910,7 +3017,7 @@ declare global { extends FilterPrimitiveElementSVGAttributes, SingleInputFilterSVGAttributes, StylableSVGAttributes, - Pick { + Pick { surfaceScale?: string; specularConstant?: string; specularExponent?: string; @@ -2945,7 +3052,7 @@ declare global { interface FilterSVGAttributes extends CoreSVGAttributes, - XLinkSVGAttributes, + // XLinkSVGAttributes, ExternalResourceSVGAttributes, StylableSVGAttributes { filterUnits?: SVGUnits; @@ -2982,10 +3089,10 @@ declare global { extends NewViewportSVGAttributes, GraphicsElementSVGAttributes, ConditionalProcessingSVGAttributes, - XLinkSVGAttributes, + // XLinkSVGAttributes, StylableSVGAttributes, TransformableSVGAttributes, - Pick { + Pick { x?: number | string; y?: number | string; width?: number | string; @@ -3000,7 +3107,7 @@ declare global { ExternalResourceSVGAttributes, StylableSVGAttributes, TransformableSVGAttributes, - Pick { + Pick { x1?: number | string; y1?: number | string; x2?: number | string; @@ -3050,7 +3157,7 @@ declare global { ExternalResourceSVGAttributes, StylableSVGAttributes, TransformableSVGAttributes, - Pick { + Pick { d?: string; pathLength?: number | string; } @@ -3058,7 +3165,7 @@ declare global { interface PatternSVGAttributes extends ContainerElementSVGAttributes, ConditionalProcessingSVGAttributes, - XLinkSVGAttributes, + // XLinkSVGAttributes, ExternalResourceSVGAttributes, StylableSVGAttributes, FitToViewBoxSVGAttributes, @@ -3079,7 +3186,7 @@ declare global { ExternalResourceSVGAttributes, StylableSVGAttributes, TransformableSVGAttributes, - Pick { + Pick { points?: string; } @@ -3090,7 +3197,7 @@ declare global { ExternalResourceSVGAttributes, StylableSVGAttributes, TransformableSVGAttributes, - Pick { + Pick { points?: string; } @@ -3120,7 +3227,7 @@ declare global { interface StopSVGAttributes extends CoreSVGAttributes, StylableSVGAttributes, - Pick { + Pick { offset?: number | string; } @@ -3134,7 +3241,7 @@ declare global { ZoomAndPanSVGAttributes, Pick { version?: string; - baseProfile?: string; + "base-profile"?: string; x?: number | string; y?: number | string; width?: number | string; @@ -3165,7 +3272,7 @@ declare global { ExternalResourceSVGAttributes, StylableSVGAttributes, TransformableSVGAttributes, - Pick { + Pick { x?: number | string; y?: number | string; dx?: number | string; @@ -3178,12 +3285,12 @@ declare global { interface TextPathSVGAttributes extends TextContentElementSVGAttributes, ConditionalProcessingSVGAttributes, - XLinkSVGAttributes, + // XLinkSVGAttributes, ExternalResourceSVGAttributes, StylableSVGAttributes, Pick< PresentationSVGAttributes, - "alignmentBaseline" | "baselineShift" | "display" | "visibility" + "alignment-baseline" | "baseline-shift" | "display" | "visibility" > { startOffset?: number | string; method?: "align" | "stretch"; @@ -3197,7 +3304,7 @@ declare global { StylableSVGAttributes, Pick< PresentationSVGAttributes, - "alignmentBaseline" | "baselineShift" | "display" | "visibility" + "alignment-baseline" | "baseline-shift" | "display" | "visibility" > { x?: number | string; y?: number | string; @@ -3211,7 +3318,7 @@ declare global { interface UseSVGAttributes extends GraphicsElementSVGAttributes, ConditionalProcessingSVGAttributes, - XLinkSVGAttributes, + // XLinkSVGAttributes, ExternalResourceSVGAttributes, StylableSVGAttributes, TransformableSVGAttributes { @@ -3409,4 +3516,4 @@ declare global { } } -export {}; \ No newline at end of file +export {}; diff --git a/src/runtime.d.ts b/src/runtime.d.ts index 7c4a388..1c7243b 100644 --- a/src/runtime.d.ts +++ b/src/runtime.d.ts @@ -35,9 +35,22 @@ export function assignProps(target: any, ...sources: any): any export function getHydrationKey(): string; export function getNextElement(template: HTMLTemplateElement, isSSR: boolean): Node; export function getNextMarker(start: Node): [Node, Array]; -export function generateHydrationScript(options: { eventNames: string[], streaming: boolean }): string; +export function generateHydrationScript(options?: { eventNames?: string[], streaming?: boolean, resolved?: boolean }): string; export function ssrClassList(value: { [k: string]: boolean }): string; export function ssrStyle(value: { [k: string]: string }): string; -export function ssrSpread(accessor: any, isSVG: boolean, skipChildren: boolean): () => string; +export function ssrSpread(accessor: any): () => string; export function escape(html: string): string; + +declare type AttributeInfo = { + [key: string]: { + type: string; + alias?: string; + }; +}; +export const Aliases: Record; +export const Properties: Set; +export const ChildProperties: Set; +export const NonComposedEvents: Set; +export const SVGElements: Set; +export const SVGNamespace: Record; From 1034251995e64b1121da568f970dde5ab9bbf298 Mon Sep 17 00:00:00 2001 From: Ryan Carniato Date: Tue, 16 Mar 2021 23:30:05 -0700 Subject: [PATCH 32/38] update dom expressions --- README.md | 6 + jsx-runtime.d.ts | 1 + package-lock.json | 893 +++++++++++- package.json | 22 +- rollup.config.js | 4 +- src/client.d.ts | 51 + src/client.js | 1 + src/core.ts | 3 +- src/html.ts | 8 +- src/index.ts | 6 +- src/jsx.d.ts | 3338 ++++++++++++++++++++++++++++++++++++++++++ src/jsx.ts | 3519 --------------------------------------------- src/lib.ts | 49 +- src/runtime.d.ts | 56 - src/runtime.js | 1 - 15 files changed, 4313 insertions(+), 3645 deletions(-) create mode 100644 jsx-runtime.d.ts create mode 100644 src/client.d.ts create mode 100644 src/client.js create mode 100644 src/jsx.d.ts delete mode 100644 src/jsx.ts delete mode 100644 src/runtime.d.ts delete mode 100644 src/runtime.js diff --git a/README.md b/README.md index a354478..3b4c319 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,12 @@ And include 'babel-plugin-jsx-dom-expressions' in your babelrc, webpack babel lo ``` See [plugin options](https://github.com/ryansolid/dom-expressions/tree/master/packages/babel-plugin-jsx-dom-expressions#plugin-options) +For TS JSX types add to your `tsconfig.json`: +```js +"jsx": "preserve", +"jsxImportSource": "mobx-jsx" +``` + ## Installation ```sh diff --git a/jsx-runtime.d.ts b/jsx-runtime.d.ts new file mode 100644 index 0000000..20cd695 --- /dev/null +++ b/jsx-runtime.d.ts @@ -0,0 +1 @@ +export * from "./types/jsx" \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 5f8ec73..cbf1038 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,8 +1,814 @@ { "name": "mobx-jsx", - "version": "0.13.0", - "lockfileVersion": 1, + "version": "0.14.0", + "lockfileVersion": 2, "requires": true, + "packages": { + "": { + "version": "0.14.0", + "license": "MIT", + "devDependencies": { + "@babel/core": "7.11.6", + "@babel/preset-typescript": "7.10.4", + "@rollup/plugin-babel": "5.2.1", + "@rollup/plugin-node-resolve": "11.2.0", + "dom-expressions": "0.25.15", + "hyper-dom-expressions": "0.25.15", + "lit-dom-expressions": "0.25.15", + "mobx": "^6.1.8", + "ncp": "2.0.0", + "rollup": "^2.41.4", + "typescript": "4.1.3" + }, + "peerDependencies": { + "mobx": "*" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", + "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==", + "dev": true, + "dependencies": { + "@babel/highlight": "^7.10.4" + } + }, + "node_modules/@babel/core": { + "version": "7.11.6", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.11.6.tgz", + "integrity": "sha512-Wpcv03AGnmkgm6uS6k8iwhIwTrcP0m17TL1n1sy7qD0qelDu4XNeW0dN0mHfa+Gei211yDaLoEe/VlbXQzM4Bg==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.10.4", + "@babel/generator": "^7.11.6", + "@babel/helper-module-transforms": "^7.11.0", + "@babel/helpers": "^7.10.4", + "@babel/parser": "^7.11.5", + "@babel/template": "^7.10.4", + "@babel/traverse": "^7.11.5", + "@babel/types": "^7.11.5", + "convert-source-map": "^1.7.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.1", + "json5": "^2.1.2", + "lodash": "^4.17.19", + "resolve": "^1.3.2", + "semver": "^5.4.1", + "source-map": "^0.5.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core/node_modules/@babel/generator": { + "version": "7.11.6", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.11.6.tgz", + "integrity": "sha512-DWtQ1PV3r+cLbySoHrwn9RWEgKMBLLma4OBQloPRyDYvc5msJM9kvTLo1YnlJd1P/ZuKbdli3ijr5q3FvAF3uA==", + "dev": true, + "dependencies": { + "@babel/types": "^7.11.5", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" + } + }, + "node_modules/@babel/core/node_modules/@babel/helper-split-export-declaration": { + "version": "7.11.0", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.11.0.tgz", + "integrity": "sha512-74Vejvp6mHkGE+m+k5vHY93FX2cAtrw1zXrZXRlG4l410Nm9PxfEiVTn1PjDPV5SnmieiueY4AFg2xqhNFuuZg==", + "dev": true, + "dependencies": { + "@babel/types": "^7.11.0" + } + }, + "node_modules/@babel/core/node_modules/@babel/parser": { + "version": "7.11.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.11.5.tgz", + "integrity": "sha512-X9rD8qqm695vgmeaQ4fvz/o3+Wk4ZzQvSHkDBgpYKxpD4qTAUm88ZKtHkVqIOsYFFbIQ6wQYhC6q7pjqVK0E0Q==", + "dev": true, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/core/node_modules/@babel/traverse": { + "version": "7.11.5", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.11.5.tgz", + "integrity": "sha512-EjiPXt+r7LiCZXEfRpSJd+jUMnBd4/9OUv7Nx3+0u9+eimMwJmG0Q98lw4/289JCoxSE8OolDMNZaaF/JZ69WQ==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.10.4", + "@babel/generator": "^7.11.5", + "@babel/helper-function-name": "^7.10.4", + "@babel/helper-split-export-declaration": "^7.11.0", + "@babel/parser": "^7.11.5", + "@babel/types": "^7.11.5", + "debug": "^4.1.0", + "globals": "^11.1.0", + "lodash": "^4.17.19" + } + }, + "node_modules/@babel/core/node_modules/@babel/types": { + "version": "7.11.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.5.tgz", + "integrity": "sha512-bvM7Qz6eKnJVFIn+1LPtjlBFPVN5jNDc1XmN15vWe7Q3DPBufWWsLiIvUu7xW87uTG6QoggpIDnUgLQvPheU+Q==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.10.4", + "lodash": "^4.17.19", + "to-fast-properties": "^2.0.0" + } + }, + "node_modules/@babel/generator": { + "version": "7.10.5", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.10.5.tgz", + "integrity": "sha512-3vXxr3FEW7E7lJZiWQ3bM4+v/Vyr9C+hpolQ8BGFr9Y8Ri2tFLWTixmwKBafDujO1WVah4fhZBeU1bieKdghig==", + "dev": true, + "dependencies": { + "@babel/types": "^7.10.5", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" + } + }, + "node_modules/@babel/helper-create-class-features-plugin": { + "version": "7.10.5", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.10.5.tgz", + "integrity": "sha512-0nkdeijB7VlZoLT3r/mY3bUkw3T8WG/hNw+FATs/6+pG2039IJWjTYL0VTISqsNHMUTEnwbVnc89WIJX9Qed0A==", + "dev": true, + "dependencies": { + "@babel/helper-function-name": "^7.10.4", + "@babel/helper-member-expression-to-functions": "^7.10.5", + "@babel/helper-optimise-call-expression": "^7.10.4", + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/helper-replace-supers": "^7.10.4", + "@babel/helper-split-export-declaration": "^7.10.4" + } + }, + "node_modules/@babel/helper-function-name": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.10.4.tgz", + "integrity": "sha512-YdaSyz1n8gY44EmN7x44zBn9zQ1Ry2Y+3GTA+3vH6Mizke1Vw0aWDM66FOYEPw8//qKkmqOckrGgTYa+6sceqQ==", + "dev": true, + "dependencies": { + "@babel/helper-get-function-arity": "^7.10.4", + "@babel/template": "^7.10.4", + "@babel/types": "^7.10.4" + } + }, + "node_modules/@babel/helper-get-function-arity": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.10.4.tgz", + "integrity": "sha512-EkN3YDB+SRDgiIUnNgcmiD361ti+AVbL3f3Henf6dqqUyr5dMsorno0lJWJuLhDhkI5sYEpgj6y9kB8AOU1I2A==", + "dev": true, + "dependencies": { + "@babel/types": "^7.10.4" + } + }, + "node_modules/@babel/helper-member-expression-to-functions": { + "version": "7.10.5", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.10.5.tgz", + "integrity": "sha512-HiqJpYD5+WopCXIAbQDG0zye5XYVvcO9w/DHp5GsaGkRUaamLj2bEtu6i8rnGGprAhHM3qidCMgp71HF4endhA==", + "dev": true, + "dependencies": { + "@babel/types": "^7.10.5" + } + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.10.4.tgz", + "integrity": "sha512-nEQJHqYavI217oD9+s5MUBzk6x1IlvoS9WTPfgG43CbMEeStE0v+r+TucWdx8KFGowPGvyOkDT9+7DHedIDnVw==", + "dev": true, + "dependencies": { + "@babel/types": "^7.10.4" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.11.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.11.0.tgz", + "integrity": "sha512-02EVu8COMuTRO1TAzdMtpBPbe6aQ1w/8fePD2YgQmxZU4gpNWaL9gK3Jp7dxlkUlUCJOTaSeA+Hrm1BRQwqIhg==", + "dev": true, + "dependencies": { + "@babel/helper-module-imports": "^7.10.4", + "@babel/helper-replace-supers": "^7.10.4", + "@babel/helper-simple-access": "^7.10.4", + "@babel/helper-split-export-declaration": "^7.11.0", + "@babel/template": "^7.10.4", + "@babel/types": "^7.11.0", + "lodash": "^4.17.19" + } + }, + "node_modules/@babel/helper-module-transforms/node_modules/@babel/helper-split-export-declaration": { + "version": "7.11.0", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.11.0.tgz", + "integrity": "sha512-74Vejvp6mHkGE+m+k5vHY93FX2cAtrw1zXrZXRlG4l410Nm9PxfEiVTn1PjDPV5SnmieiueY4AFg2xqhNFuuZg==", + "dev": true, + "dependencies": { + "@babel/types": "^7.11.0" + } + }, + "node_modules/@babel/helper-module-transforms/node_modules/@babel/types": { + "version": "7.11.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.5.tgz", + "integrity": "sha512-bvM7Qz6eKnJVFIn+1LPtjlBFPVN5jNDc1XmN15vWe7Q3DPBufWWsLiIvUu7xW87uTG6QoggpIDnUgLQvPheU+Q==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.10.4", + "lodash": "^4.17.19", + "to-fast-properties": "^2.0.0" + } + }, + "node_modules/@babel/helper-optimise-call-expression": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.10.4.tgz", + "integrity": "sha512-n3UGKY4VXwXThEiKrgRAoVPBMqeoPgHVqiHZOanAJCG9nQUL2pLRQirUzl0ioKclHGpGqRgIOkgcIJaIWLpygg==", + "dev": true, + "dependencies": { + "@babel/types": "^7.10.4" + } + }, + "node_modules/@babel/helper-plugin-utils": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.10.4.tgz", + "integrity": "sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg==", + "dev": true + }, + "node_modules/@babel/helper-replace-supers": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.10.4.tgz", + "integrity": "sha512-sPxZfFXocEymYTdVK1UNmFPBN+Hv5mJkLPsYWwGBxZAxaWfFu+xqp7b6qWD0yjNuNL2VKc6L5M18tOXUP7NU0A==", + "dev": true, + "dependencies": { + "@babel/helper-member-expression-to-functions": "^7.10.4", + "@babel/helper-optimise-call-expression": "^7.10.4", + "@babel/traverse": "^7.10.4", + "@babel/types": "^7.10.4" + } + }, + "node_modules/@babel/helper-simple-access": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.10.4.tgz", + "integrity": "sha512-0fMy72ej/VEvF8ULmX6yb5MtHG4uH4Dbd6I/aHDb/JVg0bbivwt9Wg+h3uMvX+QSFtwr5MeItvazbrc4jtRAXw==", + "dev": true, + "dependencies": { + "@babel/template": "^7.10.4", + "@babel/types": "^7.10.4" + } + }, + "node_modules/@babel/helper-split-export-declaration": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.10.4.tgz", + "integrity": "sha512-pySBTeoUff56fL5CBU2hWm9TesA4r/rOkI9DyJLvvgz09MB9YtfIYe3iBriVaYNaPe+Alua0vBIOVOLs2buWhg==", + "dev": true, + "dependencies": { + "@babel/types": "^7.10.4" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz", + "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==", + "dev": true + }, + "node_modules/@babel/helpers": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.10.4.tgz", + "integrity": "sha512-L2gX/XeUONeEbI78dXSrJzGdz4GQ+ZTA/aazfUsFaWjSe95kiCuOZ5HsXvkiw3iwF+mFHSRUfJU8t6YavocdXA==", + "dev": true, + "dependencies": { + "@babel/template": "^7.10.4", + "@babel/traverse": "^7.10.4", + "@babel/types": "^7.10.4" + } + }, + "node_modules/@babel/highlight": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", + "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.10.4", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.10.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.10.5.tgz", + "integrity": "sha512-wfryxy4bE1UivvQKSQDU4/X6dr+i8bctjUjj8Zyt3DQy7NtPizJXT8M52nqpNKL+nq2PW8lxk4ZqLj0fD4B4hQ==", + "dev": true, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/plugin-syntax-typescript": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.10.4.tgz", + "integrity": "sha512-oSAEz1YkBCAKr5Yiq8/BNtvSAPwkp/IyUnwZogd8p+F0RuYQQrLeRUzIQhueQTTBy/F+a40uS7OFKxnkRvmvFQ==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "node_modules/@babel/plugin-transform-typescript": { + "version": "7.10.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.10.5.tgz", + "integrity": "sha512-YCyYsFrrRMZ3qR7wRwtSSJovPG5vGyG4ZdcSAivGwTfoasMp3VOB/AKhohu3dFtmB4cCDcsndCSxGtrdliCsZQ==", + "dev": true, + "dependencies": { + "@babel/helper-create-class-features-plugin": "^7.10.5", + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/plugin-syntax-typescript": "^7.10.4" + } + }, + "node_modules/@babel/preset-typescript": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.10.4.tgz", + "integrity": "sha512-SdYnvGPv+bLlwkF2VkJnaX/ni1sMNetcGI1+nThF1gyv6Ph8Qucc4ZZAjM5yZcE/AKRXIOTZz7eSRDWOEjPyRQ==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/plugin-transform-typescript": "^7.10.4" + } + }, + "node_modules/@babel/template": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.10.4.tgz", + "integrity": "sha512-ZCjD27cGJFUB6nmCB1Enki3r+L5kJveX9pq1SvAUKoICy6CZ9yD8xO086YXdYhvNjBdnekm4ZnaP5yC8Cs/1tA==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.10.4", + "@babel/parser": "^7.10.4", + "@babel/types": "^7.10.4" + } + }, + "node_modules/@babel/traverse": { + "version": "7.10.5", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.10.5.tgz", + "integrity": "sha512-yc/fyv2gUjPqzTz0WHeRJH2pv7jA9kA7mBX2tXl/x5iOE81uaVPuGPtaYk7wmkx4b67mQ7NqI8rmT2pF47KYKQ==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.10.4", + "@babel/generator": "^7.10.5", + "@babel/helper-function-name": "^7.10.4", + "@babel/helper-split-export-declaration": "^7.10.4", + "@babel/parser": "^7.10.5", + "@babel/types": "^7.10.5", + "debug": "^4.1.0", + "globals": "^11.1.0", + "lodash": "^4.17.19" + } + }, + "node_modules/@babel/types": { + "version": "7.10.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.5.tgz", + "integrity": "sha512-ixV66KWfCI6GKoA/2H9v6bQdbfXEwwpOdQ8cRvb4F+eyvhlaHxWFMQB4+3d9QFJXZsiiiqVrewNV0DFEQpyT4Q==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.10.4", + "lodash": "^4.17.19", + "to-fast-properties": "^2.0.0" + } + }, + "node_modules/@rollup/plugin-babel": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/@rollup/plugin-babel/-/plugin-babel-5.2.1.tgz", + "integrity": "sha512-Jd7oqFR2dzZJ3NWANDyBjwTtX/lYbZpVcmkHrfQcpvawHs9E4c0nYk5U2mfZ6I/DZcIvy506KZJi54XK/jxH7A==", + "dev": true, + "dependencies": { + "@babel/helper-module-imports": "^7.10.4", + "@rollup/pluginutils": "^3.1.0" + }, + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/@rollup/plugin-node-resolve": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-11.2.0.tgz", + "integrity": "sha512-qHjNIKYt5pCcn+5RUBQxK8krhRvf1HnyVgUCcFFcweDS7fhkOLZeYh0mhHK6Ery8/bb9tvN/ubPzmfF0qjDCTA==", + "dev": true, + "dependencies": { + "@rollup/pluginutils": "^3.1.0", + "@types/resolve": "1.17.1", + "builtin-modules": "^3.1.0", + "deepmerge": "^4.2.2", + "is-module": "^1.0.0", + "resolve": "^1.19.0" + }, + "engines": { + "node": ">= 10.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0" + } + }, + "node_modules/@rollup/pluginutils": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.1.0.tgz", + "integrity": "sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==", + "dev": true, + "dependencies": { + "@types/estree": "0.0.39", + "estree-walker": "^1.0.1", + "picomatch": "^2.2.2" + }, + "engines": { + "node": ">= 8.0.0" + } + }, + "node_modules/@types/estree": { + "version": "0.0.39", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", + "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", + "dev": true + }, + "node_modules/@types/node": { + "version": "14.6.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.6.2.tgz", + "integrity": "sha512-onlIwbaeqvZyniGPfdw/TEhKIh79pz66L1q06WUQqJLnAb6wbjvOtepLYTGHTqzdXgBYIE3ZdmqHDGsRsbBz7A==", + "dev": true + }, + "node_modules/@types/resolve": { + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.17.1.tgz", + "integrity": "sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/babel-plugin-transform-rename-import": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-rename-import/-/babel-plugin-transform-rename-import-2.3.0.tgz", + "integrity": "sha512-dPgJoT57XC0PqSnLgl2FwNvxFrWlspatX2dkk7yjKQj5HHGw071vAcOf+hqW8ClqcBDMvEbm6mevn5yHAD8mlQ==", + "dev": true + }, + "node_modules/builtin-modules": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.1.0.tgz", + "integrity": "sha512-k0KL0aWZuBt2lrxrcASWDfwOLMnodeQjodT/1SxEQAXsHANgo6ZC/VEaSEHCXt7aSTZ4/4H5LKa+tBXmW7Vtvw==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "node_modules/convert-source-map": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", + "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.1.1" + } + }, + "node_modules/debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/deepmerge": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", + "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/dom-expressions": { + "version": "0.25.15", + "resolved": "https://registry.npmjs.org/dom-expressions/-/dom-expressions-0.25.15.tgz", + "integrity": "sha512-52fpIq5npPq+kKZWU4NvC2Z3mekg4jHS/hLwPO2vV5AjOr8KAYnQz1SQ4B2B6lxQnXJ6k36wDbvCZImgVvDglw==", + "dev": true, + "dependencies": { + "babel-plugin-transform-rename-import": "^2.3.0" + } + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/estree-walker": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-1.0.1.tgz", + "integrity": "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==", + "dev": true + }, + "node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "node_modules/gensync": { + "version": "1.0.0-beta.1", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.1.tgz", + "integrity": "sha512-r8EC6NO1sngH/zdD9fiRDLdcgnbayXah+mLgManTaIZJqEC1MZstmnox8KpnI2/fxQwrp5OpCOYWLp4rBl4Jcg==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.1" + }, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/hyper-dom-expressions": { + "version": "0.25.15", + "resolved": "https://registry.npmjs.org/hyper-dom-expressions/-/hyper-dom-expressions-0.25.15.tgz", + "integrity": "sha512-olVQBQXCkfEY4blGqVZrNfgeqvdnbLTcGqAG73RfKOYMtiWIe2ngyIIa4HQMhuz0pUjj7si+1OYAwGWSyT3grA==", + "dev": true + }, + "node_modules/is-core-module": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.2.0.tgz", + "integrity": "sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ==", + "dev": true, + "dependencies": { + "has": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", + "integrity": "sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE=", + "dev": true + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "node_modules/jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "dev": true, + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/json5": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz", + "integrity": "sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==", + "dev": true, + "dependencies": { + "minimist": "^1.2.5" + }, + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/lit-dom-expressions": { + "version": "0.25.15", + "resolved": "https://registry.npmjs.org/lit-dom-expressions/-/lit-dom-expressions-0.25.15.tgz", + "integrity": "sha512-zbXRIF8LJct49aViDE1g+Y+G+N90o/JK90IycQxkZKZYo8Uj8XTXV3m6osCwDFT1PoCrxQqyiXt451Vv0Huizg==", + "dev": true + }, + "node_modules/lodash": { + "version": "4.17.19", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", + "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==", + "dev": true + }, + "node_modules/minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "node_modules/mobx": { + "version": "6.1.8", + "resolved": "https://registry.npmjs.org/mobx/-/mobx-6.1.8.tgz", + "integrity": "sha512-U4yCvUeh6yKXRwFxm2lyJjXPVekOEar/R8ZKWAXem/3fthJqYflViawfjDAUh7lZEvbKqljC3NT/pSaUKpE+gg==", + "dev": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mobx" + } + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/ncp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ncp/-/ncp-2.0.0.tgz", + "integrity": "sha1-GVoh1sRuNh0vsSgbo4uR6d9727M=", + "dev": true, + "bin": { + "ncp": "bin/ncp" + } + }, + "node_modules/path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "dev": true + }, + "node_modules/picomatch": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", + "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", + "dev": true, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/resolve": { + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", + "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", + "dev": true, + "dependencies": { + "is-core-module": "^2.2.0", + "path-parse": "^1.0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/rollup": { + "version": "2.41.4", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.41.4.tgz", + "integrity": "sha512-f9IHfMO8p2Y8OdisI7Oj3oKkPuaQ6cgSwYqAi0TDvP3w2p+oX1VejX/w28a1h8WTnrapzfO5d4Uqhww+gL0b0g==", + "dev": true, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=10.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.1" + } + }, + "node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "node_modules/semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/typescript": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.1.3.tgz", + "integrity": "sha512-B3ZIOf1IKeH2ixgHhj6la6xdwR9QrLC5d1VKeCSY4tvkqhF2eqd9O7txNlS0PO3GrBAFIdr3L1ndNwteUbZLYg==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + } + }, "dependencies": { "@babel/code-frame": { "version": "7.10.4", @@ -353,9 +1159,9 @@ } }, "@rollup/plugin-node-resolve": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-9.0.0.tgz", - "integrity": "sha512-gPz+utFHLRrd41WMP13Jq5mqqzHL3OXrfj3/MkSyB6UBIcuNt9j60GCbarzMzdf1VHFpOxfQh/ez7wyadLMqkg==", + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-11.2.0.tgz", + "integrity": "sha512-qHjNIKYt5pCcn+5RUBQxK8krhRvf1HnyVgUCcFFcweDS7fhkOLZeYh0mhHK6Ery8/bb9tvN/ubPzmfF0qjDCTA==", "dev": true, "requires": { "@rollup/pluginutils": "^3.1.0", @@ -363,7 +1169,7 @@ "builtin-modules": "^3.1.0", "deepmerge": "^4.2.2", "is-module": "^1.0.0", - "resolve": "^1.17.0" + "resolve": "^1.19.0" } }, "@rollup/pluginutils": { @@ -470,9 +1276,9 @@ "dev": true }, "dom-expressions": { - "version": "0.22.0", - "resolved": "https://registry.npmjs.org/dom-expressions/-/dom-expressions-0.22.0.tgz", - "integrity": "sha512-ShVoBqmQxeGefV57CFXv8WZO3jKH8K1tGfqYZG7pJXK8Dj0bD51kUpkoc0eIkmU3iYio4X57qYPd9sxtW275IQ==", + "version": "0.25.15", + "resolved": "https://registry.npmjs.org/dom-expressions/-/dom-expressions-0.25.15.tgz", + "integrity": "sha512-52fpIq5npPq+kKZWU4NvC2Z3mekg4jHS/hLwPO2vV5AjOr8KAYnQz1SQ4B2B6lxQnXJ6k36wDbvCZImgVvDglw==", "dev": true, "requires": { "babel-plugin-transform-rename-import": "^2.3.0" @@ -491,12 +1297,18 @@ "dev": true }, "fsevents": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", - "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", "dev": true, "optional": true }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, "gensync": { "version": "1.0.0-beta.1", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.1.tgz", @@ -509,6 +1321,15 @@ "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", "dev": true }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1" + } + }, "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", @@ -516,11 +1337,20 @@ "dev": true }, "hyper-dom-expressions": { - "version": "0.22.0", - "resolved": "https://registry.npmjs.org/hyper-dom-expressions/-/hyper-dom-expressions-0.22.0.tgz", - "integrity": "sha512-Wvssg2JOArScUpVtfKnv8NficgJxJiCommlpsivh1rggSw5ulbLLwjbceqvsHOY5VMPIpBZUgxMHYb+qqB23LA==", + "version": "0.25.15", + "resolved": "https://registry.npmjs.org/hyper-dom-expressions/-/hyper-dom-expressions-0.25.15.tgz", + "integrity": "sha512-olVQBQXCkfEY4blGqVZrNfgeqvdnbLTcGqAG73RfKOYMtiWIe2ngyIIa4HQMhuz0pUjj7si+1OYAwGWSyT3grA==", "dev": true }, + "is-core-module": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.2.0.tgz", + "integrity": "sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ==", + "dev": true, + "requires": { + "has": "^1.0.3" + } + }, "is-module": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", @@ -549,9 +1379,9 @@ } }, "lit-dom-expressions": { - "version": "0.22.0", - "resolved": "https://registry.npmjs.org/lit-dom-expressions/-/lit-dom-expressions-0.22.0.tgz", - "integrity": "sha512-VNqmGxQ82IAFNCfGEZVd2nLWSvT8gJiM/bLXoDtk+r1aoB3yZSw+tISq2/FNuYNsd/O90V5pvh6Cq6FJKFwumw==", + "version": "0.25.15", + "resolved": "https://registry.npmjs.org/lit-dom-expressions/-/lit-dom-expressions-0.25.15.tgz", + "integrity": "sha512-zbXRIF8LJct49aViDE1g+Y+G+N90o/JK90IycQxkZKZYo8Uj8XTXV3m6osCwDFT1PoCrxQqyiXt451Vv0Huizg==", "dev": true }, "lodash": { @@ -567,9 +1397,9 @@ "dev": true }, "mobx": { - "version": "5.15.7", - "resolved": "https://registry.npmjs.org/mobx/-/mobx-5.15.7.tgz", - "integrity": "sha512-wyM3FghTkhmC+hQjyPGGFdpehrcX1KOXsDuERhfK2YbJemkUhEB+6wzEN639T21onxlfYBmriA1PFnvxTUhcKw==", + "version": "6.1.8", + "resolved": "https://registry.npmjs.org/mobx/-/mobx-6.1.8.tgz", + "integrity": "sha512-U4yCvUeh6yKXRwFxm2lyJjXPVekOEar/R8ZKWAXem/3fthJqYflViawfjDAUh7lZEvbKqljC3NT/pSaUKpE+gg==", "dev": true }, "ms": { @@ -597,21 +1427,22 @@ "dev": true }, "resolve": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", - "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", + "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", "dev": true, "requires": { + "is-core-module": "^2.2.0", "path-parse": "^1.0.6" } }, "rollup": { - "version": "2.32.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.32.0.tgz", - "integrity": "sha512-0FIG1jY88uhCP2yP4CfvtKEqPDRmsUwfY1kEOOM+DH/KOGATgaIFd/is1+fQOxsvh62ELzcFfKonwKWnHhrqmw==", + "version": "2.41.4", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.41.4.tgz", + "integrity": "sha512-f9IHfMO8p2Y8OdisI7Oj3oKkPuaQ6cgSwYqAi0TDvP3w2p+oX1VejX/w28a1h8WTnrapzfO5d4Uqhww+gL0b0g==", "dev": true, "requires": { - "fsevents": "~2.1.2" + "fsevents": "~2.3.1" } }, "safe-buffer": { @@ -648,9 +1479,9 @@ "dev": true }, "typescript": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.0.3.tgz", - "integrity": "sha512-tEu6DGxGgRJPb/mVPIZ48e69xCn2yRmCgYmDugAVwmJ6o+0u1RI18eO7E7WBTLYLaEVVOhwQmcdhQHweux/WPg==", + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.1.3.tgz", + "integrity": "sha512-B3ZIOf1IKeH2ixgHhj6la6xdwR9QrLC5d1VKeCSY4tvkqhF2eqd9O7txNlS0PO3GrBAFIdr3L1ndNwteUbZLYg==", "dev": true } } diff --git a/package.json b/package.json index b9fedb5..eaa1da8 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "mobx-jsx", "description": "Raw MobX performance without the restraints of a Virtual DOM", - "version": "0.13.0", + "version": "0.14.0", "author": "Ryan Carniato", "license": "MIT", "repository": { @@ -12,23 +12,23 @@ "main": "lib/index.js", "types": "types/index.d.ts", "scripts": { - "build": "rollup -c && tsc && ncp ./src/runtime.d.ts ./types/runtime.d.ts", + "build": "rollup -c && ncp ./src/client.d.ts ./types/client.d.ts && ncp ./src/jsx.d.ts ./types/jsx.d.ts && tsc", "prepublishOnly": "npm run build" }, "devDependencies": { "@babel/core": "7.11.6", "@babel/preset-typescript": "7.10.4", - "dom-expressions": "0.22.0", - "hyper-dom-expressions": "0.22.0", - "lit-dom-expressions": "0.22.0", - "mobx": "^5.15.6", - "ncp": "2.0.0", - "rollup": "^2.32.0", "@rollup/plugin-babel": "5.2.1", - "@rollup/plugin-node-resolve": "9.0.0", - "typescript": "4.0.3" + "@rollup/plugin-node-resolve": "11.2.0", + "dom-expressions": "0.25.15", + "hyper-dom-expressions": "0.25.15", + "lit-dom-expressions": "0.25.15", + "mobx": "^6.1.8", + "ncp": "2.0.0", + "rollup": "^2.41.4", + "typescript": "4.1.3" }, "peerDependencies": { - "mobx": "*" + "mobx": "> 6.0.0" } } diff --git a/rollup.config.js b/rollup.config.js index dd67ece..cf2aa7f 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -41,7 +41,7 @@ export default [{ format: 'es', file: 'dist/html.js' }], - external: ['./index', 'lit-dom-expressions'], + external: ['./index', 'mobx'], plugins }, { input: 'src/h.ts', @@ -52,6 +52,6 @@ export default [{ format: 'es', file: 'dist/h.js' }], - external: ['./index', 'hyper-dom-expressions'], + external: ['./index', 'mobx'], plugins }]; \ No newline at end of file diff --git a/src/client.d.ts b/src/client.d.ts new file mode 100644 index 0000000..fdfdbbe --- /dev/null +++ b/src/client.d.ts @@ -0,0 +1,51 @@ +import { JSX } from "./jsx"; +export const Aliases: Record; +export const Properties: Set; +export const ChildProperties: Set; +export const DelegatedEvents: Set; +export const SVGElements: Set; +export const SVGNamespace: Record; + +type MountableElement = Element | Document | ShadowRoot | DocumentFragment | Node; +export function render(code: () => JSX.Element, element: MountableElement): () => void; +export function template(html: string, count: number, isSVG?: boolean): Element; +export function effect(fn: (prev?: T) => T, init?: T): void; +export function memo(fn: () => T, equal: boolean): () => T; +export function insert( + parent: MountableElement, + accessor: (() => T) | T, + marker?: Node | null, + init?: JSX.Element +): JSX.Element; +export function createComponent(Comp: (props: T) => JSX.Element, props: T): JSX.Element; +export function delegateEvents(eventNames: string[]): void; +export function clearDelegatedEvents(): void; +export function spread( + node: Element, + accessor: (() => T) | T, + isSVG?: Boolean, + skipChildren?: Boolean +): void; +export function assign(node: Element, props: any, isSVG?: Boolean, skipChildren?: Boolean): void; +export function setAttribute(node: Element, name: string, value: string): void; +export function setAttributeNS(node: Element, namespace: string, name: string, value: string): void; +export function addEventListener(node: Element, name: string, handler: () => void, delegate: boolean): void; +export function classList( + node: Element, + value: { [k: string]: boolean }, + prev?: { [k: string]: boolean } +): void; +export function style( + node: Element, + value: { [k: string]: string }, + prev?: { [k: string]: string } +): void; +export function getOwner(): unknown; +export function mergeProps(target: unknown, ...sources: unknown[]): unknown; +export function dynamicProperty(props: unknown, key: string): unknown; + +export function hydrate(fn: () => JSX.Element, node: MountableElement): () => void; +export function gatherHydratable(node: Element): void; +export function getHydrationKey(): string; +export function getNextElement(template: HTMLTemplateElement): Node; +export function getNextMarker(start: Node): [Node, Array]; diff --git a/src/client.js b/src/client.js new file mode 100644 index 0000000..0260ac4 --- /dev/null +++ b/src/client.js @@ -0,0 +1 @@ +export * from "dom-expressions/src/client"; \ No newline at end of file diff --git a/src/core.ts b/src/core.ts index 175f81c..a752543 100644 --- a/src/core.ts +++ b/src/core.ts @@ -5,4 +5,5 @@ export { createComponent } from "./lib" -export const currentContext = {}; +export const sharedConfig = {}; +export const getOwner = null; \ No newline at end of file diff --git a/src/html.ts b/src/html.ts index 5379e45..ee11406 100644 --- a/src/html.ts +++ b/src/html.ts @@ -9,10 +9,11 @@ import { dynamicProperty, setAttribute, setAttributeNS, + addEventListener, Aliases, Properties, ChildProperties, - NonComposedEvents, + DelegatedEvents, SVGElements, SVGNamespace } from "./index.js"; @@ -27,12 +28,13 @@ export const html = createHTML({ dynamicProperty, setAttribute, setAttributeNS, + addEventListener, Aliases, Properties, ChildProperties, - NonComposedEvents, + DelegatedEvents, SVGElements, SVGNamespace }); -export * from "./index"; \ No newline at end of file +export { root, cleanup } from "./index"; diff --git a/src/index.ts b/src/index.ts index 191e4ad..2b7c5ca 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,7 +1,7 @@ -export { root, cleanup, Component, lazy, createContext, useContext, map, splitProps, assignProps } from "./lib"; +export { root, cleanup, createSelector, Component, lazy, createContext, useContext, map, splitProps } from "./lib"; export type { Context, FunctionComponent, ComponentProps } from "./lib"; -export * from "./runtime"; +export * from "./client"; -import "./jsx" +export type { JSX } from "./jsx" diff --git a/src/jsx.d.ts b/src/jsx.d.ts new file mode 100644 index 0000000..71bc443 --- /dev/null +++ b/src/jsx.d.ts @@ -0,0 +1,3338 @@ +/** + * Based on JSX types for Surplus and Inferno and adapted for `dom-expressions`. + * + * https://github.com/adamhaile/surplus/blob/master/index.d.ts + * https://github.com/infernojs/inferno/blob/master/packages/inferno/src/core/types.ts + */ +type DOMElement = Element; + +export namespace JSX { + type Element = + | Node + | ArrayElement + | FunctionElement + | string + | number + | boolean + | null + | undefined; + interface ArrayElement extends Array {} + interface FunctionElement { + (): Element; + } + interface ElementClass { + render(props: any): Element; + } + type LibraryManagedAttributes = Props; + interface ElementChildrenAttribute { + children: {}; + } + interface EventHandler { + ( + e: E & { + currentTarget: T; + target: DOMElement; + } + ): void; + } + interface BoundEventHandler { + 0: ( + data: any, + e: E & { + currentTarget: T; + target: DOMElement; + } + ) => void; + 1: any; + } + type EventHandlerUnion = EventHandler | BoundEventHandler; + interface IntrinsicAttributes { + ref?: unknown | ((e: unknown) => void); + } + interface CustomAttributes { + ref?: T | ((el: T) => void); + classList?: { + [k: string]: boolean | undefined; + }; + on?: { + [key: string]: EventHandler; + }; + onCapture?: { + [key: string]: EventHandler; + }; + } + interface DOMAttributes extends CustomAttributes { + children?: Element; + innerHTML?: string; + innerText?: string; + textContent?: string; + onCopy?: EventHandlerUnion; + onCut?: EventHandlerUnion; + onPaste?: EventHandlerUnion; + onCompositionEnd?: EventHandlerUnion; + onCompositionStart?: EventHandlerUnion; + onCompositionUpdate?: EventHandlerUnion; + onFocus?: EventHandlerUnion; + onBlur?: EventHandlerUnion; + onChange?: EventHandlerUnion; + onInput?: EventHandlerUnion; + onReset?: EventHandlerUnion; + onSubmit?: EventHandlerUnion< + T, + Event & { + submitter: HTMLElement; + } + >; + onLoad?: EventHandlerUnion; + onError?: EventHandlerUnion; + onKeyDown?: EventHandlerUnion; + onKeyPress?: EventHandlerUnion; + onKeyUp?: EventHandlerUnion; + onGotPointerCapture?: EventHandlerUnion; + onLostPointerCapture?: EventHandlerUnion; + onPointerCancel?: EventHandlerUnion; + onPointerDown?: EventHandlerUnion; + onPointerEnter?: EventHandlerUnion; + onPointerLeave?: EventHandlerUnion; + onPointerMove?: EventHandlerUnion; + onPointerOver?: EventHandlerUnion; + onPointerOut?: EventHandlerUnion; + onPointerUp?: EventHandlerUnion; + onAbort?: EventHandlerUnion; + onCanPlay?: EventHandlerUnion; + onCanPlayThrough?: EventHandlerUnion; + onDurationChange?: EventHandlerUnion; + onEmptied?: EventHandlerUnion; + onEncrypted?: EventHandlerUnion; + onEnded?: EventHandlerUnion; + onLoadedData?: EventHandlerUnion; + onLoadedMetadata?: EventHandlerUnion; + onLoadStart?: EventHandlerUnion; + onPause?: EventHandlerUnion; + onPlay?: EventHandlerUnion; + onPlaying?: EventHandlerUnion; + onProgress?: EventHandlerUnion; + onRateChange?: EventHandlerUnion; + onSeeked?: EventHandlerUnion; + onSeeking?: EventHandlerUnion; + onStalled?: EventHandlerUnion; + onSuspend?: EventHandlerUnion; + onTimeUpdate?: EventHandlerUnion; + onVolumeChange?: EventHandlerUnion; + onWaiting?: EventHandlerUnion; + onClick?: EventHandlerUnion; + onContextMenu?: EventHandlerUnion; + onDblClick?: EventHandlerUnion; + onDrag?: EventHandlerUnion; + onDragEnd?: EventHandlerUnion; + onDragEnter?: EventHandlerUnion; + onDragExit?: EventHandlerUnion; + onDragLeave?: EventHandlerUnion; + onDragOver?: EventHandlerUnion; + onDragStart?: EventHandlerUnion; + onDrop?: EventHandlerUnion; + onMouseDown?: EventHandlerUnion; + onMouseEnter?: EventHandlerUnion; + onMouseLeave?: EventHandlerUnion; + onMouseMove?: EventHandlerUnion; + onMouseOut?: EventHandlerUnion; + onMouseOver?: EventHandlerUnion; + onMouseUp?: EventHandlerUnion; + onSelect?: EventHandlerUnion; + onTouchCancel?: EventHandlerUnion; + onTouchEnd?: EventHandlerUnion; + onTouchMove?: EventHandlerUnion; + onTouchStart?: EventHandlerUnion; + onScroll?: EventHandlerUnion; + onWheel?: EventHandlerUnion; + onAnimationStart?: EventHandlerUnion; + onAnimationEnd?: EventHandlerUnion; + onAnimationIteration?: EventHandlerUnion; + onTransitionEnd?: EventHandlerUnion; + + // lower case events + oncopy?: EventHandlerUnion; + oncut?: EventHandlerUnion; + onpaste?: EventHandlerUnion; + oncompositionend?: EventHandlerUnion; + oncompositionstart?: EventHandlerUnion; + oncompositionupdate?: EventHandlerUnion; + onfocus?: EventHandlerUnion; + onblur?: EventHandlerUnion; + onchange?: EventHandlerUnion; + oninput?: EventHandlerUnion; + onreset?: EventHandlerUnion; + onsubmit?: EventHandlerUnion< + T, + Event & { + submitter: HTMLElement; + } + >; + onload?: EventHandlerUnion; + onerror?: EventHandlerUnion; + onkeydown?: EventHandlerUnion; + onkeypress?: EventHandlerUnion; + onkeyup?: EventHandlerUnion; + ongotpointercapture?: EventHandlerUnion; + onlostpointercapture?: EventHandlerUnion; + onpointercancel?: EventHandlerUnion; + onpointerdown?: EventHandlerUnion; + onpointerenter?: EventHandlerUnion; + onpointerleave?: EventHandlerUnion; + onpointermove?: EventHandlerUnion; + onpointerover?: EventHandlerUnion; + onpointerout?: EventHandlerUnion; + onpointerup?: EventHandlerUnion; + onabort?: EventHandlerUnion; + oncanplay?: EventHandlerUnion; + oncanplaythrough?: EventHandlerUnion; + ondurationchange?: EventHandlerUnion; + onemptied?: EventHandlerUnion; + onencrypted?: EventHandlerUnion; + onended?: EventHandlerUnion; + onloadeddata?: EventHandlerUnion; + onloadedmetadata?: EventHandlerUnion; + onloadstart?: EventHandlerUnion; + onpause?: EventHandlerUnion; + onplay?: EventHandlerUnion; + onplaying?: EventHandlerUnion; + onprogress?: EventHandlerUnion; + onratechange?: EventHandlerUnion; + onseeked?: EventHandlerUnion; + onseeking?: EventHandlerUnion; + onstalled?: EventHandlerUnion; + onsuspend?: EventHandlerUnion; + ontimeupdate?: EventHandlerUnion; + onvolumechange?: EventHandlerUnion; + onwaiting?: EventHandlerUnion; + onclick?: EventHandlerUnion; + oncontextmenu?: EventHandlerUnion; + ondblclick?: EventHandlerUnion; + ondrag?: EventHandlerUnion; + ondragend?: EventHandlerUnion; + ondragenter?: EventHandlerUnion; + ondragexit?: EventHandlerUnion; + ondragleave?: EventHandlerUnion; + ondragover?: EventHandlerUnion; + ondragstart?: EventHandlerUnion; + ondrop?: EventHandlerUnion; + onmousedown?: EventHandlerUnion; + onmouseenter?: EventHandlerUnion; + onmouseleave?: EventHandlerUnion; + onmousemove?: EventHandlerUnion; + onmouseout?: EventHandlerUnion; + onmouseover?: EventHandlerUnion; + onmouseup?: EventHandlerUnion; + onselect?: EventHandlerUnion; + ontouchcancel?: EventHandlerUnion; + ontouchend?: EventHandlerUnion; + ontouchmove?: EventHandlerUnion; + ontouchstart?: EventHandlerUnion; + onscroll?: EventHandlerUnion; + onwheel?: EventHandlerUnion; + onanimationstart?: EventHandlerUnion; + onanimationend?: EventHandlerUnion; + onanimationiteration?: EventHandlerUnion; + ontransitionend?: EventHandlerUnion; + } + type CSSWideKeyword = "initial" | "inherit" | "unset"; + type CSSPercentage = string; + type CSSLength = number | string; + interface CSSProperties { + /** + * Aligns a flex container's lines within the flex container when there is extra space in the cross-axis, similar to how justify-content aligns individual items within the main-axis. + */ + "align-content"?: + | CSSWideKeyword + | "flex-start" + | "flex-end" + | "center" + | "space-between" + | "space-around" + | "stretch"; + /** + * Sets the default alignment in the cross axis for all of the flex container's items, including anonymous flex items, similarly to how justify-content aligns items along the main axis. + */ + "align-items"?: CSSWideKeyword | "flex-start" | "flex-end" | "center" | "baseline" | "stretch"; + /** + * Allows the default alignment to be overridden for individual flex items. + */ + "align-self"?: + | CSSWideKeyword + | "auto" + | "flex-start" + | "flex-end" + | "center" + | "baseline" + | "stretch"; + /** + * This property allows precise alignment of elements, such as graphics, + * that do not have a baseline-table or lack the desired baseline in their baseline-table. + * With the alignment-adjust property, the position of the baseline identified by the alignment-baseline + * can be explicitly determined. It also determines precisely the alignment point for each glyph within a textual element. + */ + "alignment-adjust"?: CSSWideKeyword | any; + "alignment-baseline"?: CSSWideKeyword | any; + /** + * Defines a length of time to elapse before an animation starts, allowing an animation to begin execution some time after it is applied. + */ + "animation-delay"?: CSSWideKeyword | any; + /** + * Defines whether an animation should run in reverse on some or all cycles. + */ + "animation-direction"?: CSSWideKeyword | any; + /** + * Specifies how many times an animation cycle should play. + */ + "animation-iteration-count"?: CSSWideKeyword | any; + /** + * Defines the list of animations that apply to the element. + */ + "animation-name"?: CSSWideKeyword | any; + /** + * Defines whether an animation is running or paused. + */ + "animation-play-state"?: CSSWideKeyword | any; + /** + * Allows changing the style of any element to platform-based interface elements or vice versa. + */ + appearance?: CSSWideKeyword | any; + /** + * Determines whether or not the “back” side of a transformed element is visible when facing the viewer. + */ + "backface-visibility"?: CSSWideKeyword | any; + /** + * Shorthand property to set the values for one or more of: + * background-clip, background-color, background-image, + * background-origin, background-position, background-repeat, + * background-size, and background-attachment. + */ + background?: CSSWideKeyword | any; + /** + * If a background-image is specified, this property determines + * whether that image's position is fixed within the viewport, + * or scrolls along with its containing block. + * See CSS 3 background-attachment property https://drafts.csswg.org/css-backgrounds-3/#the-background-attachment + */ + "background-attachment"?: CSSWideKeyword | "scroll" | "fixed" | "local"; + /** + * This property describes how the element's background images should blend with each other and the element's background color. + * The value is a list of blend modes that corresponds to each background image. Each element in the list will apply to the + * corresponding element of background-image. If a property doesn’t have enough comma-separated values to match the number of layers, + * the UA must calculate its used value by repeating the list of values until there are enough. + */ + "background-blend-mode"?: CSSWideKeyword | any; + /** + * Sets the background color of an element. + */ + "background-color"?: CSSWideKeyword | any; + "background-composite"?: CSSWideKeyword | any; + /** + * Applies one or more background images to an element. These can be any valid CSS image, including url() paths to image files or CSS gradients. + */ + "background-image"?: CSSWideKeyword | any; + /** + * Specifies what the background-position property is relative to. + */ + "background-origin"?: CSSWideKeyword | any; + /** + * Sets the position of a background image. + */ + "background-position"?: CSSWideKeyword | any; + /** + * Background-repeat defines if and how background images will be repeated after they have been sized and positioned + */ + "background-repeat"?: CSSWideKeyword | any; + /** + * Defines the size of the background images + */ + "background-size"?: CSSWideKeyword | any; + /** + * Obsolete - spec retired, not implemented. + */ + "baseline-shift"?: CSSWideKeyword | any; + /** + * Non standard. Sets or retrieves the location of the Dynamic HTML (DHTML) behavior. + */ + behavior?: CSSWideKeyword | any; + /** + * Shorthand property that defines the different properties of all four sides of an element's border in a single declaration. + * It can be used to set border-width, border-style and border-color, or a subset of these. + */ + border?: CSSWideKeyword | any; + /** + * Shorthand that sets the values of border-bottom-color, + * border-bottom-style, and border-bottom-width. + */ + "border-bottom"?: CSSWideKeyword | any; + /** + * Sets the color of the bottom border of an element. + */ + "border-bottom-color"?: CSSWideKeyword | any; + /** + * Defines the shape of the border of the bottom-left corner. + */ + "border-bottom-left-radius"?: CSSWideKeyword | CSSLength; + /** + * Defines the shape of the border of the bottom-right corner. + */ + "border-bottom-right-radius"?: CSSWideKeyword | CSSLength; + /** + * Sets the line style of the bottom border of a box. + */ + "border-bottom-style"?: CSSWideKeyword | any; + /** + * Sets the width of an element's bottom border. To set all four borders, + * use the border-width shorthand property which sets the values simultaneously for border-top-width, + * border-right-width, border-bottom-width, and border-left-width. + */ + "border-bottom-width"?: CSSWideKeyword | any; + /** + * Border-collapse can be used for collapsing the borders between table cells + */ + "border-collapse"?: CSSWideKeyword | any; + /** + * The CSS border-color property sets the color of an element's four borders. + * This property can have from one to four values, made up of the elementary properties: + * • border-top-color + * • border-right-color + * • border-bottom-color + * • border-left-color The default color is the currentColor of each of these values. + * If you provide one value, it sets the color for the element. Two values set the horizontal and vertical values, + * respectively. Providing three values sets the top, vertical, and bottom values, in that order. + * Four values set all for sides: top, right, bottom, and left, in that order. + */ + "border-color"?: CSSWideKeyword | any; + /** + * Specifies different corner clipping effects, such as scoop (inner curves), bevel (straight cuts) or notch (cut-off rectangles). + * Works along with border-radius to specify the size of each corner effect. + */ + "border-corner-shape"?: CSSWideKeyword | any; + /** + * The property border-image-source is used to set the image to be used instead of the border style. + * If this is set to none the border-style is used instead. + */ + "border-image-source"?: CSSWideKeyword | any; + /** + * The border-image-width CSS property defines the offset to use for dividing the border image in nine parts, + * the top-left corner, central top edge, top-right-corner, central right edge, bottom-right corner, central bottom edge, + * bottom-left corner, and central right edge. They represent inward distance from the top, right, bottom, and left edges. + */ + "border-image-width"?: CSSWideKeyword | any; + /** + * Shorthand property that defines the border-width, border-style and border-color of an element's left border in a single declaration. + * Note that you can use the corresponding longhand properties to set specific individual properties of the left border — border-left-width, + * border-left-style and border-left-color. + */ + "border-left"?: CSSWideKeyword | any; + /** + * The CSS border-left-color property sets the color of an element's left border. This page explains the border-left-color value, + * but often you will find it more convenient to fix the border's left color as part of a shorthand set, either border-left or border-color. + * Colors can be defined several ways. For more information, see Usage. + */ + "border-left-color"?: CSSWideKeyword | any; + /** + * Sets the style of an element's left border. To set all four borders, use the shorthand property, border-style. + * Otherwise, you can set the borders individually with border-top-style, border-right-style, border-bottom-style, border-left-style. + */ + "border-left-style"?: CSSWideKeyword | any; + /** + * Sets the width of an element's left border. To set all four borders, + * use the border-width shorthand property which sets the values simultaneously for border-top-width, + * border-right-width, border-bottom-width, and border-left-width. + */ + "border-left-width"?: CSSWideKeyword | any; + /** + * Shorthand property that sets the rounding of all four corners. + */ + "border-radius"?: CSSWideKeyword | CSSLength; + /** + * Shorthand property that defines the border-width, border-style and border-color of an element's right border + * in a single declaration. Note that you can use the corresponding longhand properties to set specific + * individual properties of the right border — border-right-width, border-right-style and border-right-color. + */ + "border-right"?: CSSWideKeyword | any; + /** + * Sets the color of an element's right border. This page explains the border-right-color value, + * but often you will find it more convenient to fix the border's right color as part of a shorthand set, + * either border-right or border-color. + * Colors can be defined several ways. For more information, see Usage. + */ + "border-right-color"?: CSSWideKeyword | any; + /** + * Sets the style of an element's right border. To set all four borders, use the shorthand property, + * border-style. Otherwise, you can set the borders individually with border-top-style, border-right-style, + * border-bottom-style, border-left-style. + */ + "border-right-style"?: CSSWideKeyword | any; + /** + * Sets the width of an element's right border. To set all four borders, + * use the border-width shorthand property which sets the values simultaneously for border-top-width, + * border-right-width, border-bottom-width, and border-left-width. + */ + "border-right-width"?: CSSWideKeyword | any; + /** + * Specifies the distance between the borders of adjacent cells. + */ + "border-spacing"?: CSSWideKeyword | any; + /** + * Sets the style of an element's four borders. This property can have from one to four values. + * With only one value, the value will be applied to all four borders; + * otherwise, this works as a shorthand property for each of border-top-style, border-right-style, + * border-bottom-style, border-left-style, where each border style may be assigned a separate value. + */ + "border-style"?: CSSWideKeyword | any; + /** + * Shorthand property that defines the border-width, border-style and border-color of an element's top border + * in a single declaration. Note that you can use the corresponding longhand properties to set specific + * individual properties of the top border — border-top-width, border-top-style and border-top-color. + */ + "border-top"?: CSSWideKeyword | any; + /** + * Sets the color of an element's top border. This page explains the border-top-color value, + * but often you will find it more convenient to fix the border's top color as part of a shorthand set, + * either border-top or border-color. + * Colors can be defined several ways. For more information, see Usage. + */ + "border-top-color"?: CSSWideKeyword | any; + /** + * Sets the rounding of the top-left corner of the element. + */ + "border-top-left-radius"?: CSSWideKeyword | CSSLength; + /** + * Sets the rounding of the top-right corner of the element. + */ + "border-top-right-radius"?: CSSWideKeyword | CSSLength; + /** + * Sets the style of an element's top border. To set all four borders, use the shorthand property, border-style. + * Otherwise, you can set the borders individually with border-top-style, border-right-style, border-bottom-style, border-left-style. + */ + "border-top-style"?: CSSWideKeyword | any; + /** + * Sets the width of an element's top border. To set all four borders, + * use the border-width shorthand property which sets the values simultaneously for border-top-width, + * border-right-width, border-bottom-width, and border-left-width. + */ + "border-top-width"?: CSSWideKeyword | any; + /** + * Sets the width of an element's four borders. This property can have from one to four values. + * This is a shorthand property for setting values simultaneously for border-top-width, + * border-right-width, border-bottom-width, and border-left-width. + */ + "border-width"?: CSSWideKeyword | any; + /** + * This property specifies how far an absolutely positioned box's bottom margin edge + * is offset above the bottom edge of the box's containing block. For relatively positioned boxes, + * the offset is with respect to the bottom edges of the box itself + * (i.e., the box is given a position in the normal flow, then offset from that position according to these properties). + */ + bottom?: CSSWideKeyword | any; + /** + * Obsolete. + */ + "box-align"?: CSSWideKeyword | any; + /** + * Breaks a box into fragments creating new borders, + * padding and repeating backgrounds or lets it stay as a continuous box on a page break, + * column break, or, for inline elements, at a line break. + */ + "box-decoration-break"?: CSSWideKeyword | any; + /** + * Deprecated + */ + "box-direction"?: CSSWideKeyword | any; + /** + * Do not use. This property has been replaced by the flex-wrap property. + * Gets or sets a value that specifies the direction to add successive rows or columns when the value of box-lines is set to multiple. + */ + "box-line-progression"?: CSSWideKeyword | any; + /** + * Do not use. This property has been replaced by the flex-wrap property. + * Gets or sets a value that specifies whether child elements wrap onto multiple lines or columns based on the space available in the object. + */ + "box-lines"?: CSSWideKeyword | any; + /** + * Do not use. This property has been replaced by flex-order. + * Specifies the ordinal group that a child element of the object belongs to. + * This ordinal value identifies the display order (along the axis defined by the box-orient property) for the group. + */ + "box-ordinal-group"?: CSSWideKeyword | any; + /** + * Deprecated. + */ + "box-flex"?: CSSWideKeyword | number; + /** + * Deprecated. + */ + "box-flex-group"?: CSSWideKeyword | number; + /** + * Cast a drop shadow from the frame of almost any element. + * MDN: https://developer.mozilla.org/en-US/docs/Web/CSS/box-shadow + */ + "box-shadow"?: CSSWideKeyword | any; + /** + * The CSS break-after property allows you to force a break on multi-column layouts. + * More specifically, it allows you to force a break after an element. + * It allows you to determine if a break should occur, and what type of break it should be. + * The break-after CSS property describes how the page, column or region break behaves after the generated box. + * If there is no generated box, the property is ignored. + */ + "break-after"?: CSSWideKeyword | any; + /** + * Control page/column/region breaks that fall above a block of content + */ + "break-before"?: CSSWideKeyword | any; + /** + * Control page/column/region breaks that fall within a block of content + */ + "break-inside"?: CSSWideKeyword | any; + /** + * The clear CSS property specifies if an element can be positioned next to + * or must be positioned below the floating elements that precede it in the markup. + */ + clear?: CSSWideKeyword | any; + /** + * Deprecated; see clip-path. + * Lets you specify the dimensions of an absolutely positioned element that should be visible, + * and the element is clipped into this shape, and displayed. + */ + clip?: CSSWideKeyword | any; + /** + * Clipping crops an graphic, so that only a portion of the graphic is rendered, or filled. + * This clip-rule property, when used with the clip-path property, defines which clip rule, or algorithm, + * to use when filling the different parts of a graphics. + */ + "clip-rule"?: CSSWideKeyword | any; + /** + * The color property sets the color of an element's foreground content (usually text), + * accepting any standard CSS color from keywords and hex values to RGB(a) and HSL(a). + */ + color?: CSSWideKeyword | any; + /** + * Describes the number of columns of the element. + * See CSS 3 column-count property https://www.w3.org/TR/css3-multicol/#cc + */ + "column-count"?: CSSWideKeyword | number | "auto"; + /** + * Specifies how to fill columns (balanced or sequential). + */ + "column-fill"?: CSSWideKeyword | any; + /** + * The column-gap property controls the width of the gap between columns in multi-column elements. + */ + "column-gap"?: CSSWideKeyword | any; + /** + * Sets the width, style, and color of the rule between columns. + */ + "column-rule"?: CSSWideKeyword | any; + /** + * Specifies the color of the rule between columns. + */ + "column-rule-color"?: CSSWideKeyword | any; + /** + * Specifies the width of the rule between columns. + */ + "column-rule-width"?: CSSWideKeyword | any; + /** + * The column-span CSS property makes it possible for an element to span across all columns when its value is set to all. + * An element that spans more than one column is called a spanning element. + */ + "column-span"?: CSSWideKeyword | any; + /** + * Specifies the width of columns in multi-column elements. + */ + "column-width"?: CSSWideKeyword | any; + /** + * This property is a shorthand property for setting column-width and/or column-count. + */ + columns?: CSSWideKeyword | any; + /** + * The counter-increment property accepts one or more names of counters (identifiers), + * each one optionally followed by an integer which specifies the value by which the counter should be incremented + * (e.g. if the value is 2, the counter increases by 2 each time it is invoked). + */ + "counter-increment"?: CSSWideKeyword | any; + /** + * The counter-reset property contains a list of one or more names of counters, + * each one optionally followed by an integer (otherwise, the integer defaults to 0.). + * Each time the given element is invoked, the counters specified by the property are set to the given integer. + */ + "counter-reset"?: CSSWideKeyword | any; + /** + * The cue property specifies sound files (known as an "auditory icon") to be played by speech media agents + * before and after presenting an element's content; if only one file is specified, it is played both before and after. + * The volume at which the file(s) should be played, relative to the volume of the main element, may also be specified. + * The icon files may also be set separately with the cue-before and cue-after properties. + */ + cue?: CSSWideKeyword | any; + /** + * The cue-after property specifies a sound file (known as an "auditory icon") to be played by speech media agents + * after presenting an element's content; the volume at which the file should be played may also be specified. + * The shorthand property cue sets cue sounds for both before and after the element is presented. + */ + "cue-after"?: CSSWideKeyword | any; + /** + * Specifies the mouse cursor displayed when the mouse pointer is over an element. + */ + cursor?: CSSWideKeyword | any; + /** + * The direction CSS property specifies the text direction/writing direction. The rtl is used for Hebrew or Arabic text, the ltr is for other languages. + */ + direction?: CSSWideKeyword | any; + /** + * This property specifies the type of rendering box used for an element. It is a shorthand property for many other display properties. + */ + display?: CSSWideKeyword | any; + /** + * The ‘fill’ property paints the interior of the given graphical element. + * The area to be painted consists of any areas inside the outline of the shape. + * To determine the inside of the shape, all subpaths are considered, + * and the interior is determined according to the rules associated with the current value of the ‘fill-rule’ property. + * The zero-width geometric outline of a shape is included in the area to be painted. + */ + fill?: CSSWideKeyword | any; + /** + * SVG: Specifies the opacity of the color or the content the current object is filled with. + * See SVG 1.1 https://www.w3.org/TR/SVG/painting.html#FillOpacityProperty + */ + "fill-opacity"?: CSSWideKeyword | number; + /** + * The ‘fill-rule’ property indicates the algorithm which is to be used to determine what parts of the canvas are included inside the shape. + * For a simple, non-intersecting path, it is intuitively clear what region lies "inside"; + * however, for a more complex path, such as a path that intersects itself or where one subpath encloses another, + * the interpretation of "inside" is not so obvious. + * The ‘fill-rule’ property provides two options for how the inside of a shape is determined: + */ + "fill-rule"?: CSSWideKeyword | any; + /** + * Applies various image processing effects. This property is largely unsupported. See Compatibility section for more information. + */ + filter?: CSSWideKeyword | any; + /** + * Shorthand for `flex-grow`, `flex-shrink`, and `flex-basis`. + */ + flex?: CSSWideKeyword | number | string; + /** + * Obsolete, do not use. This property has been renamed to align-items. + * Specifies the alignment (perpendicular to the layout axis defined by the flex-direction property) of child elements of the object. + */ + "flex-align"?: CSSWideKeyword | any; + /** + * The flex-basis CSS property describes the initial main size of the flex item + * before any free space is distributed according to the flex factors described in the flex property (flex-grow and flex-shrink). + */ + "flex-basis"?: CSSWideKeyword | any; + /** + * The flex-direction CSS property describes how flex items are placed in the flex container, by setting the direction of the flex container's main axis. + */ + "flex-direction"?: CSSWideKeyword | "row" | "row-reverse" | "column" | "column-reverse"; + /** + * The flex-flow CSS property defines the flex container's main and cross axis. It is a shorthand property for the flex-direction and flex-wrap properties. + */ + "flex-flow"?: CSSWideKeyword | string; + /** + * Specifies the flex grow factor of a flex item. + * See CSS flex-grow property https://drafts.csswg.org/css-flexbox-1/#flex-grow-property + */ + "flex-grow"?: CSSWideKeyword | number; + /** + * Do not use. This property has been renamed to align-self + * Specifies the alignment (perpendicular to the layout axis defined by flex-direction) of child elements of the object. + */ + "flex-item-align"?: CSSWideKeyword | any; + /** + * Do not use. This property has been renamed to align-content. + * Specifies how a flexbox's lines align within the flexbox when there is extra space along the axis that is perpendicular to the axis defined by the flex-direction property. + */ + "flex-line-pack"?: CSSWideKeyword | any; + /** + * Gets or sets a value that specifies the ordinal group that a flexbox element belongs to. This ordinal value identifies the display order for the group. + */ + "flex-order"?: CSSWideKeyword | any; + /** + * Specifies the flex shrink factor of a flex item. + * See CSS flex-shrink property https://drafts.csswg.org/css-flexbox-1/#flex-shrink-property + */ + "flex-shrink"?: CSSWideKeyword | number; + /** + * Specifies whether flex items are forced into a single line or can be wrapped onto multiple lines. + * If wrapping is allowed, this property also enables you to control the direction in which lines are stacked. + * See CSS flex-wrap property https://drafts.csswg.org/css-flexbox-1/#flex-wrap-property + */ + "flex-wrap"?: CSSWideKeyword | "nowrap" | "wrap" | "wrap-reverse"; + /** + * Elements which have the style float are floated horizontally. + * These elements can move as far to the left or right of the containing element. + * All elements after the floating element will flow around it, but elements before the floating element are not impacted. + * If several floating elements are placed after each other, they will float next to each other as long as there is room. + */ + float?: CSSWideKeyword | any; + /** + * Flows content from a named flow (specified by a corresponding flow-into) through selected elements to form a dynamic chain of layout regions. + */ + "flow-from"?: CSSWideKeyword | any; + /** + * The font property is shorthand that allows you to do one of two things: you can either set up six of the most mature font properties in one line, + * or you can set one of a choice of keywords to adopt a system font setting. + */ + font?: CSSWideKeyword | any; + /** + * The font-family property allows one or more font family names and/or generic family names to be specified for usage on the selected element(s)' text. + * The browser then goes through the list; for each character in the selection it applies the first font family that has an available glyph for that character. + */ + "font-family"?: CSSWideKeyword | any; + /** + * The font-kerning property allows contextual adjustment of inter-glyph spacing, i.e. the spaces between the characters in text. + * This property controls metric kerning - that utilizes adjustment data contained in the font. Optical Kerning is not supported as yet. + */ + "font-kerning"?: CSSWideKeyword | any; + /** + * Specifies the size of the font. Used to compute em and ex units. + * See CSS 3 font-size property https://www.w3.org/TR/css-fonts-3/#propdef-font-size + */ + "font-size"?: + | CSSWideKeyword + | "xx-small" + | "x-small" + | "small" + | "medium" + | "large" + | "x-large" + | "xx-large" + | "larger" + | "smaller" + | CSSLength + | CSSPercentage; + /** + * The font-size-adjust property adjusts the font-size of the fallback fonts defined with font-family, + * so that the x-height is the same no matter what font is used. + * This preserves the readability of the text when fallback happens. + * See CSS 3 font-size-adjust property https://www.w3.org/TR/css-fonts-3/#propdef-font-size-adjust + */ + "font-size-adjust"?: CSSWideKeyword | "none" | number; + /** + * Allows you to expand or condense the widths for a normal, condensed, or expanded font face. + * See CSS 3 font-stretch property https://drafts.csswg.org/css-fonts-3/#propdef-font-stretch + */ + "font-stretch"?: + | CSSWideKeyword + | "normal" + | "ultra-condensed" + | "extra-condensed" + | "condensed" + | "semi-condensed" + | "semi-expanded" + | "expanded" + | "extra-expanded" + | "ultra-expanded"; + /** + * The font-style property allows normal, italic, or oblique faces to be selected. + * Italic forms are generally cursive in nature while oblique faces are typically sloped versions of the regular face. + * Oblique faces can be simulated by artificially sloping the glyphs of the regular face. + * See CSS 3 font-style property https://www.w3.org/TR/css-fonts-3/#propdef-font-style + */ + "font-style"?: CSSWideKeyword | "normal" | "italic" | "oblique"; + /** + * This value specifies whether the user agent is allowed to synthesize bold or oblique font faces when a font family lacks bold or italic faces. + */ + "font-synthesis"?: CSSWideKeyword | any; + /** + * The font-variant property enables you to select the small-caps font within a font family. + */ + "font-variant"?: CSSWideKeyword | any; + /** + * Fonts can provide alternate glyphs in addition to default glyph for a character. This property provides control over the selection of these alternate glyphs. + */ + "font-variant-alternates"?: CSSWideKeyword | any; + /** + * Specifies the weight or boldness of the font. + * See CSS 3 'font-weight' property https://www.w3.org/TR/css-fonts-3/#propdef-font-weight + */ + "font-weight"?: + | CSSWideKeyword + | "normal" + | "bold" + | "bolder" + | "lighter" + | 100 + | 200 + | 300 + | 400 + | 500 + | 600 + | 700 + | 800 + | 900; + /** + * Lays out one or more grid items bound by 4 grid lines. Shorthand for setting grid-column-start, grid-column-end, grid-row-start, and grid-row-end in a single declaration. + */ + "grid-area"?: CSSWideKeyword | any; + /** + * Controls a grid item's placement in a grid area, particularly grid position and a grid span. Shorthand for setting grid-column-start and grid-column-end in a single declaration. + */ + "grid-column"?: CSSWideKeyword | any; + /** + * Controls a grid item's placement in a grid area as well as grid position and a grid span. + * The grid-column-end property (with grid-row-start, grid-row-end, and grid-column-start) determines a grid item's placement by specifying the grid lines of a grid item's grid area. + */ + "grid-column-end"?: CSSWideKeyword | any; + /** + * Determines a grid item's placement by specifying the starting grid lines of a grid item's grid area. + * A grid item's placement in a grid area consists of a grid position and a grid span. + * See also ( grid-row-start, grid-row-end, and grid-column-end) + */ + "grid-column-start"?: CSSWideKeyword | any; + /** + * Gets or sets a value that indicates which row an element within a Grid should appear in. Shorthand for setting grid-row-start and grid-row-end in a single declaration. + */ + "grid-row"?: CSSWideKeyword | any; + /** + * Determines a grid item’s placement by specifying the block-end. A grid item's placement in a grid area consists of a grid position and a grid span. + * The grid-row-end property (with grid-row-start, grid-column-start, and grid-column-end) determines a grid item's placement by specifying the grid lines of a grid item's grid area. + */ + "grid-row-end"?: CSSWideKeyword | any; + /** + * Specifies a row position based upon an integer location, string value, or desired row size. + * css/properties/grid-row is used as short-hand for grid-row-position and grid-row-position + */ + "grid-row-position"?: CSSWideKeyword | any; + "grid-row-span"?: CSSWideKeyword | any; + /** + * Specifies named grid areas which are not associated with any particular grid item, but can be referenced from the grid-placement properties. + * The syntax of the grid-template-areas property also provides a visualization of the structure of the grid, making the overall layout of the grid container easier to understand. + */ + "grid-template-areas"?: CSSWideKeyword | any; + /** + * Specifies (with grid-template-rows) the line names and track sizing functions of the grid. + * Each sizing function can be specified as a length, a percentage of the grid container’s size, + * a measurement of the contents occupying the column or row, or a fraction of the free space in the grid. + */ + "grid-template-columns"?: CSSWideKeyword | any; + /** + * Specifies (with grid-template-columns) the line names and track sizing functions of the grid. + * Each sizing function can be specified as a length, a percentage of the grid container’s size, + * a measurement of the contents occupying the column or row, or a fraction of the free space in the grid. + */ + "grid-template-rows"?: CSSWideKeyword | any; + /** + * Sets the height of an element. The content area of the element height does not include the padding, border, and margin of the element. + */ + height?: CSSWideKeyword | any; + /** + * Specifies the minimum number of characters in a hyphenated word + */ + "hyphenate-limit-chars"?: CSSWideKeyword | any; + /** + * Indicates the maximum number of successive hyphenated lines in an element. The ‘no-limit’ value means that there is no limit. + */ + "hyphenate-limit-lines"?: CSSWideKeyword | any; + /** + * Specifies the maximum amount of trailing whitespace (before justification) that may be left in a line before hyphenation is triggered + * to pull part of a word from the next line back up into the current one. + */ + "hyphenate-limit-zone"?: CSSWideKeyword | any; + /** + * Specifies whether or not words in a sentence can be split by the use of a manual or automatic hyphenation mechanism. + */ + hyphens?: CSSWideKeyword | any; + "ime-mode"?: CSSWideKeyword | any; + /** + * Defines how the browser distributes space between and around flex items + * along the main-axis of their container. + * See CSS justify-content property https://www.w3.org/TR/css-flexbox-1/#justify-content-property + */ + "justify-content"?: + | CSSWideKeyword + | "flex-start" + | "flex-end" + | "center" + | "space-between" + | "space-around" + | "space-evenly" + | "stretch"; + "layout-grid"?: CSSWideKeyword | any; + "layout-grid-char"?: CSSWideKeyword | any; + "layout-grid-line"?: CSSWideKeyword | any; + "layout-grid-mode"?: CSSWideKeyword | any; + "layout-grid-type"?: CSSWideKeyword | any; + /** + * Sets the left edge of an element + */ + left?: CSSWideKeyword | any; + /** + * The letter-spacing CSS property specifies the spacing behavior between text characters. + */ + "letter-spacing"?: CSSWideKeyword | any; + /** + * Deprecated. Gets or sets line-breaking rules for text in selected languages such as Japanese, Chinese, and Korean. + */ + "line-break"?: CSSWideKeyword | any; + "line-clamp"?: CSSWideKeyword | number; + /** + * Specifies the height of an inline block level element. + * See CSS 2.1 line-height property https://www.w3.org/TR/CSS21/visudet.html#propdef-line-height + */ + "line-height"?: CSSWideKeyword | "normal" | number | CSSLength | CSSPercentage; + /** + * Shorthand property that sets the list-style-type, list-style-position and list-style-image properties in one declaration. + */ + "list-style"?: CSSWideKeyword | any; + /** + * This property sets the image that will be used as the list item marker. When the image is available, + * it will replace the marker set with the 'list-style-type' marker. That also means that if the image is not available, + * it will show the style specified by list-style-property + */ + "list-style-image"?: CSSWideKeyword | any; + /** + * Specifies if the list-item markers should appear inside or outside the content flow. + */ + "list-style-position"?: CSSWideKeyword | any; + /** + * Specifies the type of list-item marker in a list. + */ + "list-style-type"?: CSSWideKeyword | any; + /** + * The margin property is shorthand to allow you to set all four margins of an element at once. + * Its equivalent longhand properties are margin-top, margin-right, margin-bottom and margin-left. + * Negative values are also allowed. + */ + margin?: CSSWideKeyword | any; + /** + * margin-bottom sets the bottom margin of an element. + */ + "margin-bottom"?: CSSWideKeyword | any; + /** + * margin-left sets the left margin of an element. + */ + "margin-left"?: CSSWideKeyword | any; + /** + * margin-right sets the right margin of an element. + */ + "margin-right"?: CSSWideKeyword | any; + /** + * margin-top sets the top margin of an element. + */ + "margin-top"?: CSSWideKeyword | any; + /** + * The marquee-direction determines the initial direction in which the marquee content moves. + */ + "marquee-direction"?: CSSWideKeyword | any; + /** + * The 'marquee-style' property determines a marquee's scrolling behavior. + */ + "marquee-style"?: CSSWideKeyword | any; + /** + * This property is shorthand for setting mask-image, mask-mode, mask-repeat, mask-position, mask-clip, mask-origin, mask-composite and mask-size. + * Omitted values are set to their original properties' initial values. + */ + mask?: CSSWideKeyword | any; + /** + * This property is shorthand for setting mask-border-source, mask-border-slice, mask-border-width, mask-border-outset, and mask-border-repeat. + * Omitted values are set to their original properties' initial values. + */ + "mask-border"?: CSSWideKeyword | any; + /** + * This property specifies how the images for the sides and the middle part of the mask image are scaled and tiled. + * The first keyword applies to the horizontal sides, the second one applies to the vertical ones. + * If the second keyword is absent, it is assumed to be the same as the first, similar to the CSS border-image-repeat property. + */ + "mask-border-repeat"?: CSSWideKeyword | any; + /** + * This property specifies inward offsets from the top, right, bottom, and left edges of the mask image, + * dividing it into nine regions: four corners, four edges, and a middle. + * The middle image part is discarded and treated as fully transparent black unless the fill keyword is present. + * The four values set the top, right, bottom and left offsets in that order, similar to the CSS border-image-slice property. + */ + "mask-border-slice"?: CSSWideKeyword | any; + /** + * Specifies an image to be used as a mask. An image that is empty, fails to download, is non-existent, or cannot be displayed is ignored and does not mask the element. + */ + "mask-border-source"?: CSSWideKeyword | any; + /** + * This property sets the width of the mask box image, similar to the CSS border-image-width property. + */ + "mask-border-width"?: CSSWideKeyword | any; + /** + * Determines the mask painting area, which defines the area that is affected by the mask. + * The painted content of an element may be restricted to this area. + */ + "mask-clip"?: CSSWideKeyword | any; + /** + * For elements rendered as a single box, specifies the mask positioning area. + * For elements rendered as multiple boxes (e.g., inline boxes on several lines, boxes on several pages) + * specifies which boxes box-decoration-break operates on to determine the mask positioning area(s). + */ + "mask-origin"?: CSSWideKeyword | any; + /** + * This property must not be used. It is no longer included in any standard or standard track specification, + * nor is it implemented in any browser. It is only used when the text-align-last property is set to size. + * It controls allowed adjustments of font-size to fit line content. + */ + "max-font-size"?: CSSWideKeyword | any; + /** + * Sets the maximum height for an element. It prevents the height of the element to exceed the specified value. + * If min-height is specified and is greater than max-height, max-height is overridden. + */ + "max-height"?: CSSWideKeyword | any; + /** + * Sets the maximum width for an element. It limits the width property to be larger than the value specified in max-width. + */ + "max-width"?: CSSWideKeyword | any; + /** + * Sets the minimum height for an element. It prevents the height of the element to be smaller than the specified value. + * The value of min-height overrides both max-height and height. + */ + "min-height"?: CSSWideKeyword | any; + /** + * Sets the minimum width of an element. It limits the width property to be not smaller than the value specified in min-width. + */ + "min-width"?: CSSWideKeyword | any; + /** + * Specifies the transparency of an element. + * See CSS 3 opacity property https://drafts.csswg.org/css-color-3/#opacity + */ + opacity?: CSSWideKeyword | number; + /** + * Specifies the order used to lay out flex items in their flex container. + * Elements are laid out in the ascending order of the order value. + * See CSS order property https://drafts.csswg.org/css-flexbox-1/#order-property + */ + order?: CSSWideKeyword | number; + /** + * In paged media, this property defines the minimum number of lines in + * a block container that must be left at the bottom of the page. + * See CSS 3 orphans, widows properties https://drafts.csswg.org/css-break-3/#widows-orphans + */ + orphans?: CSSWideKeyword | number; + /** + * The CSS outline property is a shorthand property for setting one or more of the individual outline properties outline-style, + * outline-width and outline-color in a single rule. In most cases the use of this shortcut is preferable and more convenient. + * Outlines differ from borders in the following ways: + * • Outlines do not take up space, they are drawn above the content. + * • Outlines may be non-rectangular. They are rectangular in Gecko/Firefox. + * Internet Explorer attempts to place the smallest contiguous outline around all elements or shapes that are indicated to have an outline. + * Opera draws a non-rectangular shape around a construct. + */ + outline?: CSSWideKeyword | any; + /** + * The outline-color property sets the color of the outline of an element. An outline is a line that is drawn around elements, outside the border edge, to make the element stand out. + */ + "outline-color"?: CSSWideKeyword | any; + /** + * The outline-offset property offsets the outline and draw it beyond the border edge. + */ + "outline-offset"?: CSSWideKeyword | any; + /** + * The overflow property controls how extra content exceeding the bounding box of an element is rendered. + * It can be used in conjunction with an element that has a fixed width and height, to eliminate text-induced page distortion. + */ + overflow?: CSSWideKeyword | "auto" | "hidden" | "scroll" | "visible"; + /** + * Specifies the preferred scrolling methods for elements that overflow. + */ + "overflow-style"?: CSSWideKeyword | any; + /** + * Controls how extra content exceeding the x-axis of the bounding box of an element is rendered. + */ + "overflow-x"?: CSSWideKeyword | "auto" | "hidden" | "scroll" | "visible"; + /** + * Controls how extra content exceeding the y-axis of the bounding box of an element is rendered. + */ + "overflow-y"?: CSSWideKeyword | "auto" | "hidden" | "scroll" | "visible"; + /** + * The padding optional CSS property sets the required padding space on one to four sides of an element. + * The padding area is the space between an element and its border. Negative values are not allowed but decimal values are permitted. + * The element size is treated as fixed, and the content of the element shifts toward the center as padding is increased. + * The padding property is a shorthand to avoid setting each side separately (padding-top, padding-right, padding-bottom, padding-left). + */ + padding?: CSSWideKeyword | any; + /** + * The padding-bottom CSS property of an element sets the padding space required on the bottom of an element. + * The padding area is the space between the content of the element and its border. + * Contrary to margin-bottom values, negative values of padding-bottom are invalid. + */ + "padding-bottom"?: CSSWideKeyword | any; + /** + * The padding-left CSS property of an element sets the padding space required on the left side of an element. + * The padding area is the space between the content of the element and its border. + * Contrary to margin-left values, negative values of padding-left are invalid. + */ + "padding-left"?: CSSWideKeyword | any; + /** + * The padding-right CSS property of an element sets the padding space required on the right side of an element. + * The padding area is the space between the content of the element and its border. + * Contrary to margin-right values, negative values of padding-right are invalid. + */ + "padding-right"?: CSSWideKeyword | any; + /** + * The padding-top CSS property of an element sets the padding space required on the top of an element. + * The padding area is the space between the content of the element and its border. + * Contrary to margin-top values, negative values of padding-top are invalid. + */ + "padding-top"?: CSSWideKeyword | any; + /** + * The page-break-after property is supported in all major browsers. With CSS3, page-break-* properties are only aliases of the break-* properties. + * The CSS3 Fragmentation spec defines breaks for all CSS box fragmentation. + */ + "page-break-after"?: CSSWideKeyword | any; + /** + * The page-break-before property sets the page-breaking behavior before an element. + * With CSS3, page-break-* properties are only aliases of the break-* properties. + * The CSS3 Fragmentation spec defines breaks for all CSS box fragmentation. + */ + "page-break-before"?: CSSWideKeyword | any; + /** + * Sets the page-breaking behavior inside an element. With CSS3, page-break-* properties are only aliases of the break-* properties. + * The CSS3 Fragmentation spec defines breaks for all CSS box fragmentation. + */ + "page-break-inside"?: CSSWideKeyword | any; + /** + * The pause property determines how long a speech media agent should pause before and after presenting an element. + * It is a shorthand for the pause-before and pause-after properties. + */ + pause?: CSSWideKeyword | any; + /** + * The pause-after property determines how long a speech media agent should pause after presenting an element. + * It may be replaced by the shorthand property pause, which sets pause time before and after. + */ + "pause-after"?: CSSWideKeyword | any; + /** + * The pause-before property determines how long a speech media agent should pause before presenting an element. + * It may be replaced by the shorthand property pause, which sets pause time before and after. + */ + "pause-before"?: CSSWideKeyword | any; + /** + * The perspective property defines how far an element is placed from the view on the z-axis, from the screen to the viewer. + * Perspective defines how an object is viewed. In graphic arts, perspective is the representation on a flat surface of what the viewer's eye would see in a 3D space. + * (See Wikipedia for more information about graphical perspective and for related illustrations.) + * The illusion of perspective on a flat surface, such as a computer screen, + * is created by projecting points on the flat surface as they would appear if the flat surface were a window + * through which the viewer was looking at the object. In discussion of virtual environments, this flat surface is called a projection plane. + */ + perspective?: CSSWideKeyword | any; + /** + * The perspective-origin property establishes the origin for the perspective property. + * It effectively sets the X and Y position at which the viewer appears to be looking at the children of the element. + * When used with perspective, perspective-origin changes the appearance of an object, + * as if a viewer were looking at it from a different origin. + * An object appears differently if a viewer is looking directly at it versus looking at it from below, above, or from the side. + * Thus, the perspective-origin is like a vanishing point. + * The default value of perspective-origin is 50% 50%. + * This displays an object as if the viewer's eye were positioned directly at the center of the screen, both top-to-bottom and left-to-right. + * A value of 0% 0% changes the object as if the viewer was looking toward the top left angle. + * A value of 100% 100% changes the appearance as if viewed toward the bottom right angle. + */ + "perspective-origin"?: CSSWideKeyword | any; + /** + * The pointer-events property allows you to control whether an element can be the target for the pointing device (e.g, mouse, pen) events. + */ + "pointer-events"?: CSSWideKeyword | any; + /** + * The position property controls the type of positioning used by an element within its parent elements. + * The effect of the position property depends on a lot of factors, for example the position property of parent elements. + */ + position?: CSSWideKeyword | "static" | "relative" | "absolute" | "fixed" | "sticky"; + /** + * Obsolete: unsupported. + * This property determines whether or not a full-width punctuation mark character should be trimmed if it appears at the beginning of a line, + * so that its "ink" lines up with the first glyph in the line above and below. + */ + "punctuation-trim"?: CSSWideKeyword | any; + /** + * Sets the type of quotation marks for embedded quotations. + */ + quotes?: CSSWideKeyword | any; + /** + * Controls whether the last region in a chain displays additional 'overset' content according its default overflow property, + * or if it displays a fragment of content as if it were flowing into a subsequent region. + */ + "region-fragment"?: CSSWideKeyword | any; + /** + * The rest-after property determines how long a speech media agent should pause after presenting an element's main content, + * before presenting that element's exit cue sound. It may be replaced by the shorthand property rest, which sets rest time before and after. + */ + "rest-after"?: CSSWideKeyword | any; + /** + * The rest-before property determines how long a speech media agent should pause after presenting an intro cue sound for an element, + * before presenting that element's main content. It may be replaced by the shorthand property rest, which sets rest time before and after. + */ + "rest-before"?: CSSWideKeyword | any; + /** + * Specifies the position an element in relation to the right side of the containing element. + */ + right?: CSSWideKeyword | any; + "ruby-align"?: CSSWideKeyword | any; + "ruby-position"?: CSSWideKeyword | any; + /** + * Defines the alpha channel threshold used to extract a shape from an image. Can be thought of as a "minimum opacity" threshold; + * that is, a value of 0.5 means that the shape will enclose all the pixels that are more than 50% opaque. + */ + "shape-image-threshold"?: CSSWideKeyword | any; + /** + * A future level of CSS Shapes will define a shape-inside property, which will define a shape to wrap content within the element. + * See Editor's Draft and CSSWG wiki page on next-level plans + */ + "shape-inside"?: CSSWideKeyword | any; + /** + * Adds a margin to a shape-outside. In effect, defines a new shape that is the smallest contour around all the points + * that are the shape-margin distance outward perpendicular to each point on the underlying shape. + * For points where a perpendicular direction is not defined (e.g., a triangle corner), + * takes all points on a circle centered at the point and with a radius of the shape-margin distance. + * This property accepts only non-negative values. + */ + "shape-margin"?: CSSWideKeyword | any; + /** + * Declares a shape around which text should be wrapped, with possible modifications from the shape-margin property. + * The shape defined by shape-outside and shape-margin changes the geometry of a float element's float area. + */ + "shape-outside"?: CSSWideKeyword | any; + /** + * The speak property determines whether or not a speech synthesizer will read aloud the contents of an element. + */ + speak?: CSSWideKeyword | any; + /** + * The speak-as property determines how the speech synthesizer interprets the content: words as whole words or as a sequence of letters, + * numbers as a numerical value or a sequence of digits, punctuation as pauses in speech or named punctuation characters. + */ + "speak-as"?: CSSWideKeyword | any; + /** + * SVG: Specifies the opacity of the outline on the current object. + * See SVG 1.1 https://www.w3.org/TR/SVG/painting.html#StrokeOpacityProperty + */ + "stroke-opacity"?: CSSWideKeyword | number; + /** + * SVG: Specifies the width of the outline on the current object. + * See SVG 1.1 https://www.w3.org/TR/SVG/painting.html#StrokeWidthProperty + */ + "stroke-width"?: CSSWideKeyword | CSSPercentage | CSSLength; + /** + * The tab-size CSS property is used to customise the width of a tab (U+0009) character. + */ + "tab-size"?: CSSWideKeyword | any; + /** + * The 'table-layout' property controls the algorithm used to lay out the table cells, rows, and columns. + */ + "table-layout"?: CSSWideKeyword | any; + /** + * The text-align CSS property describes how inline content like text is aligned in its parent block element. + * text-align does not control the alignment of block elements itself, only their inline content. + */ + "text-align"?: CSSWideKeyword | any; + /** + * The text-align-last CSS property describes how the last line of a block element or a line before line break is aligned in its parent block element. + */ + "text-align-last"?: CSSWideKeyword | any; + /** + * The text-decoration CSS property is used to set the text formatting to underline, overline, line-through or blink. + * underline and overline decorations are positioned under the text, line-through over it. + */ + "text-decoration"?: CSSWideKeyword | any; + /** + * Sets the color of any text decoration, such as underlines, overlines, and strike throughs. + */ + "text-decoration-color"?: CSSWideKeyword | any; + /** + * Sets what kind of line decorations are added to an element, such as underlines, overlines, etc. + */ + "text-decoration-line"?: CSSWideKeyword | any; + "text-decoration-line-through"?: CSSWideKeyword | any; + "text-decoration-none"?: CSSWideKeyword | any; + "text-decoration-overline"?: CSSWideKeyword | any; + /** + * Specifies what parts of an element’s content are skipped over when applying any text decoration. + */ + "text-decoration-skip"?: CSSWideKeyword | any; + /** + * This property specifies the style of the text decoration line drawn on the specified element. + * The intended meaning for the values are the same as those of the border-style-properties. + */ + "text-decoration-style"?: CSSWideKeyword | any; + "text-decoration-underline"?: CSSWideKeyword | any; + /** + * The text-emphasis property will apply special emphasis marks to the elements text. + * Slightly similar to the text-decoration property only that this property can have affect on the line-height. + * It also is noted that this is shorthand for text-emphasis-style and for text-emphasis-color. + */ + "text-emphasis"?: CSSWideKeyword | any; + /** + * The text-emphasis-color property specifies the foreground color of the emphasis marks. + */ + "text-emphasis-color"?: CSSWideKeyword | any; + /** + * The text-emphasis-style property applies special emphasis marks to an element's text. + */ + "text-emphasis-style"?: CSSWideKeyword | any; + /** + * This property helps determine an inline box's block-progression dimension, + * derived from the text-height and font-size properties for non-replaced elements, + * the height or the width for replaced elements, and the stacked block-progression dimension for inline-block elements. + * The block-progression dimension determines the position of the padding, border and margin for the element. + */ + "text-height"?: CSSWideKeyword | any; + /** + * Specifies the amount of space horizontally that should be left on the first line of the text of an element. + * This horizontal spacing is at the beginning of the first line and is in respect to the left edge of the containing block box. + */ + "text-indent"?: CSSWideKeyword | any; + "text-justify-trim"?: CSSWideKeyword | any; + "text-kashida-space"?: CSSWideKeyword | any; + /** + * The text-line-through property is a shorthand property for text-line-through-style, text-line-through-color and text-line-through-mode. + * (Considered obsolete; use text-decoration instead.) + */ + "text-line-through"?: CSSWideKeyword | any; + /** + * Specifies the line colors for the line-through text decoration. + * (Considered obsolete; use text-decoration-color instead.) + */ + "text-line-through-color"?: CSSWideKeyword | any; + /** + * Sets the mode for the line-through text decoration, determining whether the text decoration affects the space characters or not. + * (Considered obsolete; use text-decoration-skip instead.) + */ + "text-line-through-mode"?: CSSWideKeyword | any; + /** + * Specifies the line style for line-through text decoration. + * (Considered obsolete; use text-decoration-style instead.) + */ + "text-line-through-style"?: CSSWideKeyword | any; + /** + * Specifies the line width for the line-through text decoration. + */ + "text-line-through-width"?: CSSWideKeyword | any; + /** + * The text-overflow shorthand CSS property determines how overflowed content that is not displayed is signaled to the users. + * It can be clipped, display an ellipsis ('…', U+2026 HORIZONTAL ELLIPSIS) or a Web author-defined string. + * It covers the two long-hand properties text-overflow-mode and text-overflow-ellipsis + */ + "text-overflow"?: CSSWideKeyword | any; + /** + * The text-overline property is the shorthand for the text-overline-style, text-overline-width, text-overline-color, and text-overline-mode properties. + */ + "text-overline"?: CSSWideKeyword | any; + /** + * Specifies the line color for the overline text decoration. + */ + "text-overline-color"?: CSSWideKeyword | any; + /** + * Sets the mode for the overline text decoration, determining whether the text decoration affects the space characters or not. + */ + "text-overline-mode"?: CSSWideKeyword | any; + /** + * Specifies the line style for overline text decoration. + */ + "text-overline-style"?: CSSWideKeyword | any; + /** + * Specifies the line width for the overline text decoration. + */ + "text-overline-width"?: CSSWideKeyword | any; + /** + * The text-rendering CSS property provides information to the browser about how to optimize when rendering text. + * Options are: legibility, speed or geometric precision. + */ + "text-rendering"?: CSSWideKeyword | any; + /** + * Obsolete: unsupported. + */ + "text-script"?: CSSWideKeyword | any; + /** + * The CSS text-shadow property applies one or more drop shadows to the text and of an element. + * Each shadow is specified as an offset from the text, along with optional color and blur radius values. + */ + "text-shadow"?: CSSWideKeyword | any; + /** + * This property transforms text for styling purposes. (It has no effect on the underlying content.) + */ + "text-transform"?: CSSWideKeyword | any; + /** + * Unsupported. + * This property will add a underline position value to the element that has an underline defined. + */ + "text-underline-position"?: CSSWideKeyword | any; + /** + * After review this should be replaced by text-decoration should it not? + * This property will set the underline style for text with a line value for underline, overline, and line-through. + */ + "text-underline-style"?: CSSWideKeyword | any; + /** + * This property specifies how far an absolutely positioned box's top margin edge is offset below the top edge of the box's containing block. + * For relatively positioned boxes, the offset is with respect to the top edges of the box itself (i.e., the box is given a position in the normal flow, + * then offset from that position according to these properties). + */ + top?: CSSWideKeyword | any; + /** + * Determines whether touch input may trigger default behavior supplied by the user agent, such as panning or zooming. + */ + "touch-action"?: CSSWideKeyword | any; + /** + * CSS transforms allow elements styled with CSS to be transformed in two-dimensional or three-dimensional space. + * Using this property, elements can be translated, rotated, scaled, and skewed. The value list may consist of 2D and/or 3D transform values. + */ + transform?: CSSWideKeyword | any; + /** + * This property defines the origin of the transformation axes relative to the element to which the transformation is applied. + */ + "transform-origin"?: CSSWideKeyword | any; + /** + * This property allows you to define the relative position of the origin of the transformation grid along the z-axis. + */ + "transform-origin-z"?: CSSWideKeyword | any; + /** + * This property specifies how nested elements are rendered in 3D space relative to their parent. + */ + "transform-style"?: CSSWideKeyword | any; + /** + * The transition CSS property is a shorthand property for transition-property, transition-duration, transition-timing-function, + * and transition-delay. It allows to define the transition between two states of an element. + */ + transition?: CSSWideKeyword | any; + /** + * Defines when the transition will start. A value of ‘0s’ means the transition will execute as soon as the property is changed. + * Otherwise, the value specifies an offset from the moment the property is changed, and the transition will delay execution by that offset. + */ + "transition-delay"?: CSSWideKeyword | any; + /** + * The 'transition-duration' property specifies the length of time a transition animation takes to complete. + */ + "transition-duration"?: CSSWideKeyword | any; + /** + * The 'transition-property' property specifies the name of the CSS property to which the transition is applied. + */ + "transition-property"?: CSSWideKeyword | any; + /** + * Sets the pace of action within a transition + */ + "transition-timing-function"?: CSSWideKeyword | any; + /** + * The unicode-bidi CSS property specifies the level of embedding with respect to the bidirectional algorithm. + */ + "unicode-bidi"?: CSSWideKeyword | any; + /** + * unicode-range allows you to set a specific range of characters to be downloaded from a font (embedded using @font-face) and made available for use on the current page. + */ + "unicode-range"?: CSSWideKeyword | any; + /** + * This is for all the high level UX stuff. + */ + "user-focus"?: CSSWideKeyword | any; + /** + * For inputing user content + */ + "user-input"?: CSSWideKeyword | any; + /** + * The vertical-align property controls how inline elements or text are vertically aligned compared to the baseline. + * If this property is used on table-cells it controls the vertical alignment of content of the table cell. + */ + "vertical-align"?: CSSWideKeyword | any; + /** + * The visibility property specifies whether the boxes generated by an element are rendered. + */ + visibility?: CSSWideKeyword | any; + /** + * The voice-balance property sets the apparent position (in stereo sound) of the synthesized voice for spoken media. + */ + "voice-balance"?: CSSWideKeyword | any; + /** + * The voice-duration property allows the author to explicitly set the amount of time it should take a speech synthesizer to read an element's content, + * for example to allow the speech to be synchronized with other media. + * With a value of auto (the default) the length of time it takes to read the content is determined by the content itself and the voice-rate property. + */ + "voice-duration"?: CSSWideKeyword | any; + /** + * The voice-family property sets the speaker's voice used by a speech media agent to read an element. + * The speaker may be specified as a named character (to match a voice option in the speech reading software) + * or as a generic description of the age and gender of the voice. + * Similar to the font-family property for visual media, + * a comma-separated list of fallback options may be given in case the speech reader does not recognize the character name + * or cannot synthesize the requested combination of generic properties. + */ + "voice-family"?: CSSWideKeyword | any; + /** + * The voice-pitch property sets pitch or tone (high or low) for the synthesized speech when reading an element; + * the pitch may be specified absolutely or relative to the normal pitch for the voice-family used to read the text. + */ + "voice-pitch"?: CSSWideKeyword | any; + /** + * The voice-range property determines how much variation in pitch or tone will be created by the speech synthesize when reading an element. + * Emphasized text, grammatical structures and punctuation may all be rendered as changes in pitch, + * this property determines how strong or obvious those changes are; + * large ranges are associated with enthusiastic or emotional speech, + * while small ranges are associated with flat or mechanical speech. + */ + "voice-range"?: CSSWideKeyword | any; + /** + * The voice-rate property sets the speed at which the voice synthesized by a speech media agent will read content. + */ + "voice-rate"?: CSSWideKeyword | any; + /** + * The voice-stress property sets the level of vocal emphasis to be used for synthesized speech reading the element. + */ + "voice-stress"?: CSSWideKeyword | any; + /** + * The voice-volume property sets the volume for spoken content in speech media. It replaces the deprecated volume property. + */ + "voice-volume"?: CSSWideKeyword | any; + /** + * The white-space property controls whether and how white space inside the element is collapsed, and whether lines may wrap at unforced "soft wrap" opportunities. + */ + "white-space"?: CSSWideKeyword | any; + /** + * Obsolete: unsupported. + */ + "white-space-treatment"?: CSSWideKeyword | any; + /** + * In paged media, this property defines the mimimum number of lines + * that must be left at the top of the second page. + * See CSS 3 orphans, widows properties https://drafts.csswg.org/css-break-3/#widows-orphans + */ + widows?: CSSWideKeyword | number; + /** + * Specifies the width of the content area of an element. The content area of the element width does not include the padding, border, and margin of the element. + */ + width?: CSSWideKeyword | any; + /** + * The word-break property is often used when there is long generated content that is strung together without and spaces or hyphens to beak apart. + * A common case of this is when there is a long URL that does not have any hyphens. This case could potentially cause the breaking of the layout as it could extend past the parent element. + */ + "word-break"?: CSSWideKeyword | any; + /** + * The word-spacing CSS property specifies the spacing behavior between "words". + */ + "word-spacing"?: CSSWideKeyword | any; + /** + * An alias of css/properties/overflow-wrap, word-wrap defines whether to break words when the content exceeds the boundaries of its container. + */ + "word-wrap"?: CSSWideKeyword | any; + /** + * Specifies how exclusions affect inline content within block-level elements. Elements lay out their inline content in their content area but wrap around exclusion areas. + */ + "wrap-flow"?: CSSWideKeyword | any; + /** + * Set the value that is used to offset the inner wrap shape from other shapes. Inline content that intersects a shape with this property will be pushed by this shape's margin. + */ + "wrap-margin"?: CSSWideKeyword | any; + /** + * Obsolete and unsupported. Do not use. + * This CSS property controls the text when it reaches the end of the block in which it is enclosed. + */ + "wrap-option"?: CSSWideKeyword | any; + /** + * writing-mode specifies if lines of text are laid out horizontally or vertically, and the direction which lines of text and blocks progress. + */ + "writing-mode"?: CSSWideKeyword | any; + /** + * The z-index property specifies the z-order of an element and its descendants. + * When elements overlap, z-order determines which one covers the other. + * See CSS 2 z-index property https://www.w3.org/TR/CSS2/visuren.html#z-index + */ + "z-index"?: CSSWideKeyword | "auto" | number; + /** + * Sets the initial zoom factor of a document defined by @viewport. + * See CSS zoom descriptor https://drafts.csswg.org/css-device-adapt/#zoom-desc + */ + zoom?: CSSWideKeyword | "auto" | number | CSSPercentage; + [propertyName: string]: any; + } + type HTMLAutocapitalize = "off" | "none" | "on" | "sentences" | "words" | "characters"; + type HTMLDir = "ltr" | "rtl" | "auto"; + type HTMLFormEncType = "application/x-www-form-urlencoded" | "multipart/form-data" | "text/plain"; + type HTMLFormMethod = "post" | "get" | "dialog"; + type HTMLCrossorigin = "anonymous" | "use-credentials" | ""; + type HTMLReferrerPolicy = + | "no-referrer" + | "no-referrer-when-downgrade" + | "origin" + | "origin-when-cross-origin" + | "same-origin" + | "strict-origin" + | "strict-origin-when-cross-origin" + | "unsafe-url"; + type HTMLIframeSandbox = + | "allow-downloads-without-user-activation" + | "allow-forms" + | "allow-modals" + | "allow-orientation-lock" + | "allow-pointer-lock" + | "allow-popups" + | "allow-popups-to-escape-sandbox" + | "allow-presentation" + | "allow-same-origin" + | "allow-scripts" + | "allow-storage-access-by-user-activation" + | "allow-top-navigation" + | "allow-top-navigation-by-user-activation"; + type HTMLLinkAs = + | "audio" + | "document" + | "embed" + | "fetch" + | "font" + | "image" + | "object" + | "script" + | "style" + | "track" + | "video" + | "worker"; + + // All the WAI-ARIA 1.1 attributes from https://www.w3.org/TR/wai-aria-1.1/ + interface AriaAttributes { + /** Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application. */ + "aria-activedescendant"?: string; + /** Indicates whether assistive technologies will present all, or only parts of, the changed region based on the change notifications defined by the aria-relevant attribute. */ + "aria-atomic"?: boolean | "false" | "true"; + /** + * Indicates whether inputting text could trigger display of one or more predictions of the user's intended value for an input and specifies how predictions would be + * presented if they are made. + */ + "aria-autocomplete"?: "none" | "inline" | "list" | "both"; + /** Indicates an element is being modified and that assistive technologies MAY want to wait until the modifications are complete before exposing them to the user. */ + "aria-busy"?: boolean | "false" | "true"; + /** + * Indicates the current "checked" state of checkboxes, radio buttons, and other widgets. + * @see aria-pressed @see aria-selected. + */ + "aria-checked"?: boolean | "false" | "mixed" | "true"; + /** + * Defines the total number of columns in a table, grid, or treegrid. + * @see aria-colindex. + */ + "aria-colcount"?: number; + /** + * Defines an element's column index or position with respect to the total number of columns within a table, grid, or treegrid. + * @see aria-colcount @see aria-colspan. + */ + "aria-colindex"?: number; + /** + * Defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid. + * @see aria-colindex @see aria-rowspan. + */ + "aria-colspan"?: number; + /** + * Identifies the element (or elements) whose contents or presence are controlled by the current element. + * @see aria-owns. + */ + "aria-controls"?: string; + /** Indicates the element that represents the current item within a container or set of related elements. */ + "aria-current"?: boolean | "false" | "true" | "page" | "step" | "location" | "date" | "time"; + /** + * Identifies the element (or elements) that describes the object. + * @see aria-labelledby + */ + "aria-describedby"?: string; + /** + * Identifies the element that provides a detailed, extended description for the object. + * @see aria-describedby. + */ + "aria-details"?: string; + /** + * Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable. + * @see aria-hidden @see aria-readonly. + */ + "aria-disabled"?: boolean | "false" | "true"; + /** + * Indicates what functions can be performed when a dragged object is released on the drop target. + * @deprecated in ARIA 1.1 + */ + "aria-dropeffect"?: "none" | "copy" | "execute" | "link" | "move" | "popup"; + /** + * Identifies the element that provides an error message for the object. + * @see aria-invalid @see aria-describedby. + */ + "aria-errormessage"?: string; + /** Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed. */ + "aria-expanded"?: boolean | "false" | "true"; + /** + * Identifies the next element (or elements) in an alternate reading order of content which, at the user's discretion, + * allows assistive technology to override the general default of reading in document source order. + */ + "aria-flowto"?: string; + /** + * Indicates an element's "grabbed" state in a drag-and-drop operation. + * @deprecated in ARIA 1.1 + */ + "aria-grabbed"?: boolean | "false" | "true"; + /** Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element. */ + "aria-haspopup"?: boolean | "false" | "true" | "menu" | "listbox" | "tree" | "grid" | "dialog"; + /** + * Indicates whether the element is exposed to an accessibility API. + * @see aria-disabled. + */ + "aria-hidden"?: boolean | "false" | "true"; + /** + * Indicates the entered value does not conform to the format expected by the application. + * @see aria-errormessage. + */ + "aria-invalid"?: boolean | "false" | "true" | "grammar" | "spelling"; + /** Indicates keyboard shortcuts that an author has implemented to activate or give focus to an element. */ + "aria-keyshortcuts"?: string; + /** + * Defines a string value that labels the current element. + * @see aria-labelledby. + */ + "aria-label"?: string; + /** + * Identifies the element (or elements) that labels the current element. + * @see aria-describedby. + */ + "aria-labelledby"?: string; + /** Defines the hierarchical level of an element within a structure. */ + "aria-level"?: number; + /** Indicates that an element will be updated, and describes the types of updates the user agents, assistive technologies, and user can expect from the live region. */ + "aria-live"?: "off" | "assertive" | "polite"; + /** Indicates whether an element is modal when displayed. */ + "aria-modal"?: boolean | "false" | "true"; + /** Indicates whether a text box accepts multiple lines of input or only a single line. */ + "aria-multiline"?: boolean | "false" | "true"; + /** Indicates that the user may select more than one item from the current selectable descendants. */ + "aria-multiselectable"?: boolean | "false" | "true"; + /** Indicates whether the element's orientation is horizontal, vertical, or unknown/ambiguous. */ + "aria-orientation"?: "horizontal" | "vertical"; + /** + * Identifies an element (or elements) in order to define a visual, functional, or contextual parent/child relationship + * between DOM elements where the DOM hierarchy cannot be used to represent the relationship. + * @see aria-controls. + */ + "aria-owns"?: string; + /** + * Defines a short hint (a word or short phrase) intended to aid the user with data entry when the control has no value. + * A hint could be a sample value or a brief description of the expected format. + */ + "aria-placeholder"?: string; + /** + * Defines an element's number or position in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM. + * @see aria-setsize. + */ + "aria-posinset"?: number; + /** + * Indicates the current "pressed" state of toggle buttons. + * @see aria-checked @see aria-selected. + */ + "aria-pressed"?: boolean | "false" | "mixed" | "true"; + /** + * Indicates that the element is not editable, but is otherwise operable. + * @see aria-disabled. + */ + "aria-readonly"?: boolean | "false" | "true"; + /** + * Indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified. + * @see aria-atomic. + */ + "aria-relevant"?: + | "additions" + | "additions removals" + | "additions text" + | "all" + | "removals" + | "removals additions" + | "removals text" + | "text" + | "text additions" + | "text removals"; + /** Indicates that user input is required on the element before a form may be submitted. */ + "aria-required"?: boolean | "false" | "true"; + /** Defines a human-readable, author-localized description for the role of an element. */ + "aria-roledescription"?: string; + /** + * Defines the total number of rows in a table, grid, or treegrid. + * @see aria-rowindex. + */ + "aria-rowcount"?: number; + /** + * Defines an element's row index or position with respect to the total number of rows within a table, grid, or treegrid. + * @see aria-rowcount @see aria-rowspan. + */ + "aria-rowindex"?: number; + /** + * Defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid. + * @see aria-rowindex @see aria-colspan. + */ + "aria-rowspan"?: number; + /** + * Indicates the current "selected" state of various widgets. + * @see aria-checked @see aria-pressed. + */ + "aria-selected"?: boolean | "false" | "true"; + /** + * Defines the number of items in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM. + * @see aria-posinset. + */ + "aria-setsize"?: number; + /** Indicates if items in a table or grid are sorted in ascending or descending order. */ + "aria-sort"?: "none" | "ascending" | "descending" | "other"; + /** Defines the maximum allowed value for a range widget. */ + "aria-valuemax"?: number; + /** Defines the minimum allowed value for a range widget. */ + "aria-valuemin"?: number; + /** + * Defines the current value for a range widget. + * @see aria-valuetext. + */ + "aria-valuenow"?: number; + /** Defines the human readable text alternative of aria-valuenow for a range widget. */ + "aria-valuetext"?: string; + } + + interface HTMLAttributes extends AriaAttributes, DOMAttributes { + accessKey?: string; + className?: string; + class?: string; + contenteditable?: boolean | "inherit"; + contextmenu?: string; + dir?: HTMLDir; + draggable?: boolean; + hidden?: boolean; + id?: string; + lang?: string; + spellcheck?: boolean; + style?: CSSProperties | string; + tabindex?: number | string; + title?: string; + translate?: "yes" | "no"; + about?: string; + datatype?: string; + inlist?: any; + prefix?: string; + property?: string; + resource?: string; + typeof?: string; + vocab?: string; + role?: + | "alert" + | "alertdialog" + | "application" + | "article" + | "banner" + | "button" + | "cell" + | "checkbox" + | "columnheader" + | "combobox" + | "complementary" + | "contentinfo" + | "definition" + | "dialog" + | "directory" + | "document" + | "feed" + | "figure" + | "form" + | "grid" + | "gridcell" + | "group" + | "heading" + | "img" + | "link" + | "list" + | "listbox" + | "listitem" + | "log" + | "main" + | "marquee" + | "math" + | "menu" + | "menubar" + | "menuitem" + | "menuitemcheckbox" + | "menuitemradio" + | "navigation" + | "none" + | "note" + | "option" + | "presentation" + | "progressbar" + | "radio" + | "radiogroup" + | "region" + | "row" + | "rowgroup" + | "rowheader" + | "scrollbar" + | "search" + | "searchbox" + | "separator" + | "slider" + | "spinbutton" + | "status" + | "switch" + | "tab" + | "table" + | "tablist" + | "tabpanel" + | "term" + | "textbox" + | "timer" + | "toolbar" + | "tooltip" + | "tree" + | "treegrid" + | "treeitem"; + autocapitalize?: HTMLAutocapitalize; + color?: string; + itemprop?: string; + itemscope?: boolean; + itemtype?: string; + itemid?: string; + itemref?: string; + align?: "start" | "end" | "center" | "baseline" | "stretch" | "left" | "right"; + part?: string; + exportparts?: string; + inputmode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search"; + contentEditable?: boolean | "inherit"; + contextMenu?: string; + tabIndex?: number | string; + autoCapitalize?: HTMLAutocapitalize; + itemProp?: string; + itemScope?: boolean; + itemType?: string; + itemId?: string; + itemRef?: string; + exportParts?: string; + inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search"; + } + interface AnchorHTMLAttributes extends HTMLAttributes { + download?: any; + href?: string; + hreflang?: string; + media?: string; + ping?: string; + referrerpolicy?: HTMLReferrerPolicy; + rel?: string; + target?: string; + type?: string; + referrerPolicy?: HTMLReferrerPolicy; + } + interface AudioHTMLAttributes extends MediaHTMLAttributes {} + interface AreaHTMLAttributes extends HTMLAttributes { + alt?: string; + coords?: string; + download?: any; + href?: string; + hreflang?: string; + ping?: string; + referrerpolicy?: HTMLReferrerPolicy; + rel?: string; + shape?: "rect" | "circle" | "poly" | "default"; + target?: string; + referrerPolicy?: HTMLReferrerPolicy; + } + interface BaseHTMLAttributes extends HTMLAttributes { + href?: string; + target?: string; + } + interface BlockquoteHTMLAttributes extends HTMLAttributes { + cite?: string; + } + interface ButtonHTMLAttributes extends HTMLAttributes { + autofocus?: boolean; + disabled?: boolean; + form?: string; + formaction?: string; + formenctype?: HTMLFormEncType; + formmethod?: HTMLFormMethod; + formnovalidate?: boolean; + formtarget?: string; + name?: string; + type?: "submit" | "reset" | "button"; + value?: string; + formAction?: string; + formEnctype?: HTMLFormEncType; + formMethod?: HTMLFormMethod; + formNoValidate?: boolean; + formTarget?: string; + } + interface CanvasHTMLAttributes extends HTMLAttributes { + width?: number | string; + height?: number | string; + } + interface ColHTMLAttributes extends HTMLAttributes { + span?: number | string; + width?: number | string; + } + interface ColgroupHTMLAttributes extends HTMLAttributes { + span?: number | string; + } + interface DataHTMLAttributes extends HTMLAttributes { + value?: string | string[] | number; + } + interface DetailsHtmlAttributes extends HTMLAttributes { + open?: boolean; + } + interface DialogHtmlAttributes extends HTMLAttributes { + open?: boolean; + } + interface EmbedHTMLAttributes extends HTMLAttributes { + height?: number | string; + src?: string; + type?: string; + width?: number | string; + } + interface FieldsetHTMLAttributes extends HTMLAttributes { + disabled?: boolean; + form?: string; + name?: string; + } + interface FormHTMLAttributes extends HTMLAttributes { + acceptcharset?: string; + action?: string; + autocomplete?: string; + encoding?: HTMLFormEncType; + enctype?: HTMLFormEncType; + method?: HTMLFormMethod; + name?: string; + novalidate?: boolean; + target?: string; + acceptCharset?: string; + noValidate?: boolean; + } + interface IframeHTMLAttributes extends HTMLAttributes { + allow?: string; + allowfullscreen?: boolean; + height?: number | string; + name?: string; + referrerpolicy?: HTMLReferrerPolicy; + sandbox?: HTMLIframeSandbox; + src?: string; + srcdoc?: string; + width?: number | string; + referrerPolicy?: HTMLReferrerPolicy; + } + interface ImgHTMLAttributes extends HTMLAttributes { + alt?: string; + crossorigin?: HTMLCrossorigin; + decoding?: "sync" | "async" | "auto"; + height?: number | string; + loading?: "eager" | "lazy"; + referrerpolicy?: HTMLReferrerPolicy; + referrerPolicy?: HTMLReferrerPolicy; + sizes?: string; + src?: string; + srcset?: string; + srcSet?: string; + usemap?: string; + useMap?: string; + width?: number | string; + crossOrigin?: HTMLCrossorigin; + } + interface InputHTMLAttributes extends HTMLAttributes { + accept?: string; + alt?: string; + autocomplete?: string; + autofocus?: boolean; + capture?: boolean | string; + checked?: boolean; + crossorigin?: HTMLCrossorigin; + disabled?: boolean; + form?: string; + formaction?: string; + formenctype?: HTMLFormEncType; + formmethod?: HTMLFormMethod; + formnovalidate?: boolean; + formtarget?: string; + height?: number | string; + list?: string; + max?: number | string; + maxlength?: number | string; + min?: number | string; + minlength?: number | string; + multiple?: boolean; + name?: string; + pattern?: string; + placeholder?: string; + readonly?: boolean; + required?: boolean; + size?: number | string; + src?: string; + step?: number | string; + type?: string; + value?: string | string[] | number; + width?: number | string; + crossOrigin?: HTMLCrossorigin; + formAction?: string; + formEnctype?: HTMLFormEncType; + formMethod?: HTMLFormMethod; + formNoValidate?: boolean; + formTarget?: string; + maxLength?: number | string; + minLength?: number | string; + readOnly?: boolean; + } + interface InsHTMLAttributes extends HTMLAttributes { + cite?: string; + dateTime?: string; + } + interface KeygenHTMLAttributes extends HTMLAttributes { + autofocus?: boolean; + challenge?: string; + disabled?: boolean; + form?: string; + keytype?: string; + keyparams?: string; + name?: string; + } + interface LabelHTMLAttributes extends HTMLAttributes { + htmlFor?: string; + for?: string; + form?: string; + } + interface LiHTMLAttributes extends HTMLAttributes { + value?: number | string; + } + interface LinkHTMLAttributes extends HTMLAttributes { + as?: HTMLLinkAs; + crossorigin?: HTMLCrossorigin; + disabled?: boolean; + href?: string; + hreflang?: string; + integrity?: string; + media?: string; + referrerpolicy?: HTMLReferrerPolicy; + rel?: string; + sizes?: string; + type?: string; + crossOrigin?: HTMLCrossorigin; + referrerPolicy?: HTMLReferrerPolicy; + } + interface MapHTMLAttributes extends HTMLAttributes { + name?: string; + } + interface MediaHTMLAttributes extends HTMLAttributes { + autoplay?: boolean; + controls?: boolean; + crossorigin?: HTMLCrossorigin; + loop?: boolean; + mediagroup?: string; + muted?: boolean; + preload?: "none" | "metadata" | "auto" | ""; + src?: string; + crossOrigin?: HTMLCrossorigin; + mediaGroup?: string; + } + interface MenuHTMLAttributes extends HTMLAttributes { + label?: string; + type?: "context" | "toolbar"; + } + interface MetaHTMLAttributes extends HTMLAttributes { + charset?: string; + content?: string; + httpequiv?: string; + name?: string; + httpEquiv?: string; + } + interface MeterHTMLAttributes extends HTMLAttributes { + form?: string; + high?: number | string; + low?: number | string; + max?: number | string; + min?: number | string; + optimum?: number | string; + value?: string | string[] | number; + } + interface QuoteHTMLAttributes extends HTMLAttributes { + cite?: string; + } + interface ObjectHTMLAttributes extends HTMLAttributes { + data?: string; + form?: string; + height?: number | string; + name?: string; + type?: string; + usemap?: string; + width?: number | string; + useMap?: string; + } + interface OlHTMLAttributes extends HTMLAttributes { + reversed?: boolean; + start?: number | string; + type?: "1" | "a" | "A" | "i" | "I"; + } + interface OptgroupHTMLAttributes extends HTMLAttributes { + disabled?: boolean; + label?: string; + } + interface OptionHTMLAttributes extends HTMLAttributes { + disabled?: boolean; + label?: string; + selected?: boolean; + value?: string | string[] | number; + } + interface OutputHTMLAttributes extends HTMLAttributes { + form?: string; + htmlFor?: string; + for?: string; + name?: string; + } + interface ParamHTMLAttributes extends HTMLAttributes { + name?: string; + value?: string | string[] | number; + } + interface ProgressHTMLAttributes extends HTMLAttributes { + max?: number | string; + value?: string | string[] | number; + } + interface ScriptHTMLAttributes extends HTMLAttributes { + async?: boolean; + charset?: string; + crossorigin?: HTMLCrossorigin; + defer?: boolean; + integrity?: string; + nomodule?: boolean; + nonce?: string; + referrerpolicy?: HTMLReferrerPolicy; + src?: string; + type?: string; + crossOrigin?: HTMLCrossorigin; + noModule?: boolean; + referrerPolicy?: HTMLReferrerPolicy; + } + interface SelectHTMLAttributes extends HTMLAttributes { + autocomplete?: string; + autofocus?: boolean; + disabled?: boolean; + form?: string; + multiple?: boolean; + name?: string; + required?: boolean; + size?: number | string; + value?: string | string[] | number; + } + interface HTMLSlotElementAttributes extends HTMLAttributes { + name?: string; + } + interface SourceHTMLAttributes extends HTMLAttributes { + media?: string; + sizes?: string; + src?: string; + srcset?: string; + type?: string; + } + interface StyleHTMLAttributes extends HTMLAttributes { + media?: string; + nonce?: string; + scoped?: boolean; + type?: string; + } + interface TdHTMLAttributes extends HTMLAttributes { + colspan?: number | string; + headers?: string; + rowspan?: number | string; + colSpan?: number | string; + rowSpan?: number | string; + } + interface TextareaHTMLAttributes extends HTMLAttributes { + autocomplete?: string; + autofocus?: boolean; + cols?: number | string; + dirname?: string; + disabled?: boolean; + form?: string; + maxlength?: number | string; + minlength?: number | string; + name?: string; + placeholder?: string; + readonly?: boolean; + required?: boolean; + rows?: number | string; + value?: string | string[] | number; + wrap?: "hard" | "soft" | "off"; + maxLength?: number | string; + minLength?: number | string; + readOnly?: boolean; + } + interface ThHTMLAttributes extends HTMLAttributes { + colspan?: number | string; + headers?: string; + rowspan?: number | string; + colSpan?: number | string; + rowSpan?: number | string; + } + interface TimeHTMLAttributes extends HTMLAttributes { + datetime?: string; + dateTime?: string; + } + interface TrackHTMLAttributes extends HTMLAttributes { + default?: boolean; + kind?: "subtitles" | "captions" | "descriptions" | "chapters" | "metadata"; + label?: string; + src?: string; + srclang?: string; + } + interface VideoHTMLAttributes extends MediaHTMLAttributes { + height?: number | string; + playsinline?: boolean; + poster?: string; + width?: number | string; + } + type SVGPreserveAspectRatio = + | "none" + | "xMinYMin" + | "xMidYMin" + | "xMaxYMin" + | "xMinYMid" + | "xMidYMid" + | "xMaxYMid" + | "xMinYMax" + | "xMidYMax" + | "xMaxYMax" + | "xMinYMin meet" + | "xMidYMin meet" + | "xMaxYMin meet" + | "xMinYMid meet" + | "xMidYMid meet" + | "xMaxYMid meet" + | "xMinYMax meet" + | "xMidYMax meet" + | "xMaxYMax meet" + | "xMinYMin slice" + | "xMidYMin slice" + | "xMaxYMin slice" + | "xMinYMid slice" + | "xMidYMid slice" + | "xMaxYMid slice" + | "xMinYMax slice" + | "xMidYMax slice" + | "xMaxYMax slice"; + type ImagePreserveAspectRatio = + | SVGPreserveAspectRatio + | "defer none" + | "defer xMinYMin" + | "defer xMidYMin" + | "defer xMaxYMin" + | "defer xMinYMid" + | "defer xMidYMid" + | "defer xMaxYMid" + | "defer xMinYMax" + | "defer xMidYMax" + | "defer xMaxYMax" + | "defer xMinYMin meet" + | "defer xMidYMin meet" + | "defer xMaxYMin meet" + | "defer xMinYMid meet" + | "defer xMidYMid meet" + | "defer xMaxYMid meet" + | "defer xMinYMax meet" + | "defer xMidYMax meet" + | "defer xMaxYMax meet" + | "defer xMinYMin slice" + | "defer xMidYMin slice" + | "defer xMaxYMin slice" + | "defer xMinYMid slice" + | "defer xMidYMid slice" + | "defer xMaxYMid slice" + | "defer xMinYMax slice" + | "defer xMidYMax slice" + | "defer xMaxYMax slice"; + type SVGUnits = "userSpaceOnUse" | "objectBoundingBox"; + interface CoreSVGAttributes extends DOMAttributes { + id?: string; + lang?: string; + tabIndex?: number | string; + tabindex?: number | string; + } + interface StylableSVGAttributes { + class?: string; + className?: string; + style?: CSSProperties | string; + } + interface TransformableSVGAttributes { + transform?: string; + } + interface ConditionalProcessingSVGAttributes { + requiredExtensions?: string; + requiredFeatures?: string; + systemLanguage?: string; + } + interface ExternalResourceSVGAttributes { + externalResourcesRequired?: "true" | "false"; + } + interface AnimationTimingSVGAttributes { + begin?: string; + dur?: string; + end?: string; + min?: string; + max?: string; + restart?: "always" | "whenNotActive" | "never"; + repeatCount?: number | "indefinite"; + repeatDur?: string; + fill?: "freeze" | "remove"; + } + interface AnimationValueSVGAttributes { + calcMode?: "discrete" | "linear" | "paced" | "spline"; + values?: string; + keyTimes?: string; + keySplines?: string; + from?: number | string; + to?: number | string; + by?: number | string; + } + interface AnimationAdditionSVGAttributes { + attributeName?: string; + additive?: "replace" | "sum"; + accumulate?: "none" | "sum"; + } + interface AnimationAttributeTargetSVGAttributes { + attributeName?: string; + attributeType?: "CSS" | "XML" | "auto"; + } + interface PresentationSVGAttributes { + "alignment-baseline"?: + | "auto" + | "baseline" + | "before-edge" + | "text-before-edge" + | "middle" + | "central" + | "after-edge" + | "text-after-edge" + | "ideographic" + | "alphabetic" + | "hanging" + | "mathematical" + | "inherit"; + "baseline-shift"?: number | string; + clip?: string; + "clip-path"?: string; + "clip-rule"?: "nonzero" | "evenodd" | "inherit"; + color?: string; + "color-interpolation"?: "auto" | "sRGB" | "linearRGB" | "inherit"; + "color-interpolation-filters"?: "auto" | "sRGB" | "linearRGB" | "inherit"; + "color-profile"?: string; + "color-rendering"?: "auto" | "optimizeSpeed" | "optimizeQuality" | "inherit"; + cursor?: string; + direction?: "ltr" | "rtl" | "inherit"; + display?: string; + "dominant-baseline"?: + | "auto" + | "text-bottom" + | "alphabetic" + | "ideographic" + | "middle" + | "central" + | "mathematical" + | "hanging" + | "text-top" + | "inherit"; + "enable-background"?: string; + fill?: string; + "fill-opacity"?: number | string | "inherit"; + "fill-rule"?: "nonzero" | "evenodd" | "inherit"; + filter?: string; + "flood-color"?: string; + "flood-opacity"?: number | string | "inherit"; + "font-family"?: string; + "font-size"?: string; + "font-size-adjust"?: number | string; + "font-stretch"?: string; + "font-style"?: "normal" | "italic" | "oblique" | "inherit"; + "font-variant"?: string; + "font-weight"?: number | string; + "glyph-orientation-horizontal"?: string; + "glyph-orientation-vertical"?: string; + "image-rendering"?: "auto" | "optimizeQuality" | "optimizeSpeed" | "inherit"; + kerning?: string; + "letter-spacing"?: number | string; + "lighting-color"?: string; + "marker-end"?: string; + "marker-mid"?: string; + "marker-start"?: string; + mask?: string; + opacity?: number | string | "inherit"; + overflow?: "visible" | "hidden" | "scroll" | "auto" | "inherit"; + "pointer-events"?: + | "bounding-box" + | "visiblePainted" + | "visibleFill" + | "visibleStroke" + | "visible" + | "painted" + | "color" + | "fill" + | "stroke" + | "all" + | "none" + | "inherit"; + "shape-rendering"?: "auto" | "optimizeSpeed" | "crispEdges" | "geometricPrecision" | "inherit"; + "stop-color"?: string; + "stop-opacity"?: number | string | "inherit"; + stroke?: string; + "stroke-dasharray"?: string; + "stroke-dashoffset"?: number | string; + "stroke-linecap"?: "butt" | "round" | "square" | "inherit"; + "stroke-linejoin"?: "arcs" | "bevel" | "miter" | "miter-clip" | "round" | "inherit"; + "stroke-miterlimit"?: number | string | "inherit"; + "stroke-opacity"?: number | string | "inherit"; + "stroke-width"?: number | string; + "text-anchor"?: "start" | "middle" | "end" | "inherit"; + "text-decoration"?: "none" | "underline" | "overline" | "line-through" | "blink" | "inherit"; + "text-rendering"?: + | "auto" + | "optimizeSpeed" + | "optimizeLegibility" + | "geometricPrecision" + | "inherit"; + "unicode-bidi"?: string; + visibility?: "visible" | "hidden" | "collapse" | "inherit"; + "word-spacing"?: number | string; + "writing-mode"?: "lr-tb" | "rl-tb" | "tb-rl" | "lr" | "rl" | "tb" | "inherit"; + } + interface AnimationElementSVGAttributes + extends CoreSVGAttributes, + ExternalResourceSVGAttributes, + ConditionalProcessingSVGAttributes {} + interface ContainerElementSVGAttributes + extends CoreSVGAttributes, + Pick< + PresentationSVGAttributes, + | "clip-path" + | "mask" + | "cursor" + | "opacity" + | "filter" + | "enable-background" + | "color-interpolation" + | "color-rendering" + > {} + interface FilterPrimitiveElementSVGAttributes + extends CoreSVGAttributes, + Pick { + x?: number | string; + y?: number | string; + width?: number | string; + height?: number | string; + result?: string; + } + interface SingleInputFilterSVGAttributes { + in?: string; + } + interface DoubleInputFilterSVGAttributes { + in?: string; + in2?: string; + } + interface FitToViewBoxSVGAttributes { + viewBox?: string; + preserveAspectRatio?: SVGPreserveAspectRatio; + } + interface GradientElementSVGAttributes + extends CoreSVGAttributes, + ExternalResourceSVGAttributes, + StylableSVGAttributes { + gradientUnits?: SVGUnits; + gradientTransform?: string; + spreadMethod?: "pad" | "reflect" | "repeat"; + } + interface GraphicsElementSVGAttributes + extends CoreSVGAttributes, + Pick< + PresentationSVGAttributes, + | "clip-rule" + | "mask" + | "pointer-events" + | "cursor" + | "opacity" + | "filter" + | "display" + | "visibility" + | "color-interpolation" + | "color-rendering" + > {} + interface LightSourceElementSVGAttributes extends CoreSVGAttributes {} + interface NewViewportSVGAttributes + extends CoreSVGAttributes, + Pick { + viewBox?: string; + } + interface ShapeElementSVGAttributes + extends CoreSVGAttributes, + Pick< + PresentationSVGAttributes, + | "color" + | "fill" + | "fill-rule" + | "fill-opacity" + | "stroke" + | "stroke-width" + | "stroke-linecap" + | "stroke-linejoin" + | "stroke-miterlimit" + | "stroke-dasharray" + | "stroke-dashoffset" + | "stroke-opacity" + | "shape-rendering" + > {} + interface TextContentElementSVGAttributes + extends CoreSVGAttributes, + Pick< + PresentationSVGAttributes, + | "font-family" + | "font-style" + | "font-variant" + | "font-weight" + | "font-stretch" + | "font-size" + | "font-size-adjust" + | "kerning" + | "letter-spacing" + | "word-spacing" + | "text-decoration" + | "glyph-orientation-horizontal" + | "glyph-orientation-vertical" + | "direction" + | "unicode-bidi" + | "text-anchor" + | "dominant-baseline" + | "color" + | "fill" + | "fill-rule" + | "fill-opacity" + | "stroke" + | "stroke-width" + | "stroke-linecap" + | "stroke-linejoin" + | "stroke-miterlimit" + | "stroke-dasharray" + | "stroke-dashoffset" + | "stroke-opacity" + > {} + interface ZoomAndPanSVGAttributes { + zoomAndPan?: "disable" | "magnify"; + } + interface AnimateSVGAttributes + extends AnimationElementSVGAttributes, + AnimationAttributeTargetSVGAttributes, + AnimationTimingSVGAttributes, + AnimationValueSVGAttributes, + AnimationAdditionSVGAttributes, + Pick {} + interface AnimateMotionSVGAttributes + extends AnimationElementSVGAttributes, + AnimationTimingSVGAttributes, + AnimationValueSVGAttributes, + AnimationAdditionSVGAttributes { + path?: string; + keyPoints?: string; + rotate?: number | string | "auto" | "auto-reverse"; + origin?: "default"; + } + interface AnimateTransformSVGAttributes + extends AnimationElementSVGAttributes, + AnimationAttributeTargetSVGAttributes, + AnimationTimingSVGAttributes, + AnimationValueSVGAttributes, + AnimationAdditionSVGAttributes { + type?: "translate" | "scale" | "rotate" | "skewX" | "skewY"; + } + interface CircleSVGAttributes + extends GraphicsElementSVGAttributes, + ShapeElementSVGAttributes, + ConditionalProcessingSVGAttributes, + StylableSVGAttributes, + TransformableSVGAttributes { + cx?: number | string; + cy?: number | string; + r?: number | string; + } + interface ClipPathSVGAttributes + extends CoreSVGAttributes, + ConditionalProcessingSVGAttributes, + ExternalResourceSVGAttributes, + StylableSVGAttributes, + TransformableSVGAttributes, + Pick { + clipPathUnits?: SVGUnits; + } + interface DefsSVGAttributes + extends ContainerElementSVGAttributes, + ConditionalProcessingSVGAttributes, + ExternalResourceSVGAttributes, + StylableSVGAttributes, + TransformableSVGAttributes {} + interface DescSVGAttributes extends CoreSVGAttributes, StylableSVGAttributes {} + interface EllipseSVGAttributes + extends GraphicsElementSVGAttributes, + ShapeElementSVGAttributes, + ConditionalProcessingSVGAttributes, + ExternalResourceSVGAttributes, + StylableSVGAttributes, + TransformableSVGAttributes { + cx?: number | string; + cy?: number | string; + rx?: number | string; + ry?: number | string; + } + interface FeBlendSVGAttributes + extends FilterPrimitiveElementSVGAttributes, + DoubleInputFilterSVGAttributes, + StylableSVGAttributes { + mode?: "normal" | "multiply" | "screen" | "darken" | "lighten"; + } + interface FeColorMatrixSVGAttributes + extends FilterPrimitiveElementSVGAttributes, + SingleInputFilterSVGAttributes, + StylableSVGAttributes { + type?: "matrix" | "saturate" | "hueRotate" | "luminanceToAlpha"; + values?: string; + } + interface FeComponentTransferSVGAttributes + extends FilterPrimitiveElementSVGAttributes, + SingleInputFilterSVGAttributes, + StylableSVGAttributes {} + interface FeCompositeSVGAttributes + extends FilterPrimitiveElementSVGAttributes, + DoubleInputFilterSVGAttributes, + StylableSVGAttributes { + operator?: "over" | "in" | "out" | "atop" | "xor" | "arithmetic"; + k1?: number | string; + k2?: number | string; + k3?: number | string; + k4?: number | string; + } + interface FeConvolveMatrixSVGAttributes + extends FilterPrimitiveElementSVGAttributes, + SingleInputFilterSVGAttributes, + StylableSVGAttributes { + order?: number | string; + kernelMatrix?: string; + divisor?: number | string; + bias?: number | string; + targetX?: number | string; + targetY?: number | string; + edgeMode?: "duplicate" | "wrap" | "none"; + kernelUnitLength?: number | string; + preserveAlpha?: "true" | "false"; + } + interface FeDiffuseLightingSVGAttributes + extends FilterPrimitiveElementSVGAttributes, + SingleInputFilterSVGAttributes, + StylableSVGAttributes, + Pick { + surfaceScale?: number | string; + diffuseConstant?: number | string; + kernelUnitLength?: number | string; + } + interface FeDisplacementMapSVGAttributes + extends FilterPrimitiveElementSVGAttributes, + DoubleInputFilterSVGAttributes, + StylableSVGAttributes { + scale?: number | string; + xChannelSelector?: "R" | "G" | "B" | "A"; + yChannelSelector?: "R" | "G" | "B" | "A"; + } + interface FeDistantLightSVGAttributes extends LightSourceElementSVGAttributes { + azimuth?: number | string; + elevation?: number | string; + } + interface FeFloodSVGAttributes + extends FilterPrimitiveElementSVGAttributes, + StylableSVGAttributes, + Pick {} + interface FeFuncSVGAttributes extends CoreSVGAttributes { + type?: "identity" | "table" | "discrete" | "linear" | "gamma"; + tableValues?: string; + slope?: number | string; + intercept?: number | string; + amplitude?: number | string; + exponent?: number | string; + offset?: number | string; + } + interface FeGaussianBlurSVGAttributes + extends FilterPrimitiveElementSVGAttributes, + SingleInputFilterSVGAttributes, + StylableSVGAttributes { + stdDeviation?: number | string; + } + interface FeImageSVGAttributes + extends FilterPrimitiveElementSVGAttributes, + ExternalResourceSVGAttributes, + StylableSVGAttributes { + preserveAspectRatio: SVGPreserveAspectRatio; + } + interface FeMergeSVGAttributes + extends FilterPrimitiveElementSVGAttributes, + StylableSVGAttributes {} + interface FeMergeNodeSVGAttributes + extends CoreSVGAttributes, + SingleInputFilterSVGAttributes {} + interface FeMorphologySVGAttributes + extends FilterPrimitiveElementSVGAttributes, + SingleInputFilterSVGAttributes, + StylableSVGAttributes { + operator?: "erode" | "dilate"; + radius?: number | string; + } + interface FeOffsetSVGAttributes + extends FilterPrimitiveElementSVGAttributes, + SingleInputFilterSVGAttributes, + StylableSVGAttributes { + dx?: number | string; + dy?: number | string; + } + interface FePointLightSVGAttributes extends LightSourceElementSVGAttributes { + x?: number | string; + y?: number | string; + z?: number | string; + } + interface FeSpecularLightingSVGAttributes + extends FilterPrimitiveElementSVGAttributes, + SingleInputFilterSVGAttributes, + StylableSVGAttributes, + Pick { + surfaceScale?: string; + specularConstant?: string; + specularExponent?: string; + kernelUnitLength?: number | string; + } + interface FeSpotLightSVGAttributes extends LightSourceElementSVGAttributes { + x?: number | string; + y?: number | string; + z?: number | string; + pointsAtX?: number | string; + pointsAtY?: number | string; + pointsAtZ?: number | string; + specularExponent?: number | string; + limitingConeAngle?: number | string; + } + interface FeTileSVGAttributes + extends FilterPrimitiveElementSVGAttributes, + SingleInputFilterSVGAttributes, + StylableSVGAttributes {} + interface FeTurbulanceSVGAttributes + extends FilterPrimitiveElementSVGAttributes, + StylableSVGAttributes { + baseFrequency?: number | string; + numOctaves?: number | string; + seed?: number | string; + stitchTiles?: "stitch" | "noStitch"; + type?: "fractalNoise" | "turbulence"; + } + interface FilterSVGAttributes + extends CoreSVGAttributes, + ExternalResourceSVGAttributes, + StylableSVGAttributes { + filterUnits?: SVGUnits; + primitiveUnits?: SVGUnits; + x?: number | string; + y?: number | string; + width?: number | string; + height?: number | string; + filterRes?: number | string; + } + interface ForeignObjectSVGAttributes + extends NewViewportSVGAttributes, + ConditionalProcessingSVGAttributes, + ExternalResourceSVGAttributes, + StylableSVGAttributes, + TransformableSVGAttributes, + Pick { + x?: number | string; + y?: number | string; + width?: number | string; + height?: number | string; + } + interface GSVGAttributes + extends ContainerElementSVGAttributes, + ConditionalProcessingSVGAttributes, + ExternalResourceSVGAttributes, + StylableSVGAttributes, + TransformableSVGAttributes, + Pick {} + interface ImageSVGAttributes + extends NewViewportSVGAttributes, + GraphicsElementSVGAttributes, + ConditionalProcessingSVGAttributes, + StylableSVGAttributes, + TransformableSVGAttributes, + Pick { + x?: number | string; + y?: number | string; + width?: number | string; + height?: number | string; + preserveAspectRatio?: ImagePreserveAspectRatio; + } + interface LineSVGAttributes + extends GraphicsElementSVGAttributes, + ShapeElementSVGAttributes, + ConditionalProcessingSVGAttributes, + ExternalResourceSVGAttributes, + StylableSVGAttributes, + TransformableSVGAttributes, + Pick { + x1?: number | string; + y1?: number | string; + x2?: number | string; + y2?: number | string; + } + interface LinearGradientSVGAttributes extends GradientElementSVGAttributes { + x1?: number | string; + x2?: number | string; + y1?: number | string; + y2?: number | string; + } + interface MarkerSVGAttributes + extends ContainerElementSVGAttributes, + ExternalResourceSVGAttributes, + StylableSVGAttributes, + FitToViewBoxSVGAttributes, + Pick { + markerUnits?: "strokeWidth" | "userSpaceOnUse"; + refX?: number | string; + refY?: number | string; + markerWidth?: number | string; + markerHeight?: number | string; + orient?: string; + } + interface MaskSVGAttributes + extends Omit, "opacity" | "filter">, + ConditionalProcessingSVGAttributes, + ExternalResourceSVGAttributes, + StylableSVGAttributes { + maskUnits?: SVGUnits; + maskContentUnits?: SVGUnits; + x?: number | string; + y?: number | string; + width?: number | string; + height?: number | string; + } + interface MetadataSVGAttributes extends CoreSVGAttributes {} + interface PathSVGAttributes + extends GraphicsElementSVGAttributes, + ShapeElementSVGAttributes, + ConditionalProcessingSVGAttributes, + ExternalResourceSVGAttributes, + StylableSVGAttributes, + TransformableSVGAttributes, + Pick { + d?: string; + pathLength?: number | string; + } + interface PatternSVGAttributes + extends ContainerElementSVGAttributes, + ConditionalProcessingSVGAttributes, + ExternalResourceSVGAttributes, + StylableSVGAttributes, + FitToViewBoxSVGAttributes, + Pick { + x?: number | string; + y?: number | string; + width?: number | string; + height?: number | string; + patternUnits?: SVGUnits; + patternContentUnits?: SVGUnits; + patternTransform?: string; + } + interface PolygonSVGAttributes + extends GraphicsElementSVGAttributes, + ShapeElementSVGAttributes, + ConditionalProcessingSVGAttributes, + ExternalResourceSVGAttributes, + StylableSVGAttributes, + TransformableSVGAttributes, + Pick { + points?: string; + } + interface PolylineSVGAttributes + extends GraphicsElementSVGAttributes, + ShapeElementSVGAttributes, + ConditionalProcessingSVGAttributes, + ExternalResourceSVGAttributes, + StylableSVGAttributes, + TransformableSVGAttributes, + Pick { + points?: string; + } + interface RadialGradientSVGAttributes extends GradientElementSVGAttributes { + cx?: number | string; + cy?: number | string; + r?: number | string; + fx?: number | string; + fy?: number | string; + } + interface RectSVGAttributes + extends GraphicsElementSVGAttributes, + ShapeElementSVGAttributes, + ConditionalProcessingSVGAttributes, + ExternalResourceSVGAttributes, + StylableSVGAttributes, + TransformableSVGAttributes { + x?: number | string; + y?: number | string; + width?: number | string; + height?: number | string; + rx?: number | string; + ry?: number | string; + } + interface StopSVGAttributes + extends CoreSVGAttributes, + StylableSVGAttributes, + Pick { + offset?: number | string; + } + interface SvgSVGAttributes + extends ContainerElementSVGAttributes, + NewViewportSVGAttributes, + ConditionalProcessingSVGAttributes, + ExternalResourceSVGAttributes, + StylableSVGAttributes, + FitToViewBoxSVGAttributes, + ZoomAndPanSVGAttributes, + PresentationSVGAttributes { + version?: string; + "base-profile"?: string; + x?: number | string; + y?: number | string; + width?: number | string; + height?: number | string; + contentScriptType?: string; + contentStyleType?: string; + xmlns?: string; + } + interface SwitchSVGAttributes + extends ContainerElementSVGAttributes, + ConditionalProcessingSVGAttributes, + ExternalResourceSVGAttributes, + StylableSVGAttributes, + TransformableSVGAttributes, + Pick {} + interface SymbolSVGAttributes + extends ContainerElementSVGAttributes, + NewViewportSVGAttributes, + ExternalResourceSVGAttributes, + StylableSVGAttributes, + FitToViewBoxSVGAttributes {} + interface TextSVGAttributes + extends TextContentElementSVGAttributes, + GraphicsElementSVGAttributes, + ConditionalProcessingSVGAttributes, + ExternalResourceSVGAttributes, + StylableSVGAttributes, + TransformableSVGAttributes, + Pick { + x?: number | string; + y?: number | string; + dx?: number | string; + dy?: number | string; + rotate?: number | string; + textLength?: number | string; + lengthAdjust?: "spacing" | "spacingAndGlyphs"; + } + interface TextPathSVGAttributes + extends TextContentElementSVGAttributes, + ConditionalProcessingSVGAttributes, + ExternalResourceSVGAttributes, + StylableSVGAttributes, + Pick< + PresentationSVGAttributes, + "alignment-baseline" | "baseline-shift" | "display" | "visibility" + > { + startOffset?: number | string; + method?: "align" | "stretch"; + spacing?: "auto" | "exact"; + } + interface TSpanSVGAttributes + extends TextContentElementSVGAttributes, + ConditionalProcessingSVGAttributes, + ExternalResourceSVGAttributes, + StylableSVGAttributes, + Pick< + PresentationSVGAttributes, + "alignment-baseline" | "baseline-shift" | "display" | "visibility" + > { + x?: number | string; + y?: number | string; + dx?: number | string; + dy?: number | string; + rotate?: number | string; + textLength?: number | string; + lengthAdjust?: "spacing" | "spacingAndGlyphs"; + } + interface UseSVGAttributes + extends GraphicsElementSVGAttributes, + ConditionalProcessingSVGAttributes, + ExternalResourceSVGAttributes, + StylableSVGAttributes, + TransformableSVGAttributes { + x?: number | string; + y?: number | string; + width?: number | string; + height?: number | string; + } + interface ViewSVGAttributes + extends CoreSVGAttributes, + ExternalResourceSVGAttributes, + FitToViewBoxSVGAttributes, + ZoomAndPanSVGAttributes { + viewTarget?: string; + } + interface IntrinsicElements { + a: AnchorHTMLAttributes; + abbr: HTMLAttributes; + address: HTMLAttributes; + area: AreaHTMLAttributes; + article: HTMLAttributes; + aside: HTMLAttributes; + audio: AudioHTMLAttributes; + b: HTMLAttributes; + base: BaseHTMLAttributes; + bdi: HTMLAttributes; + bdo: HTMLAttributes; + big: HTMLAttributes; + blockquote: BlockquoteHTMLAttributes; + body: HTMLAttributes; + br: HTMLAttributes; + button: ButtonHTMLAttributes; + canvas: CanvasHTMLAttributes; + caption: HTMLAttributes; + cite: HTMLAttributes; + code: HTMLAttributes; + col: ColHTMLAttributes; + colgroup: ColgroupHTMLAttributes; + data: DataHTMLAttributes; + datalist: HTMLAttributes; + dd: HTMLAttributes; + del: HTMLAttributes; + details: DetailsHtmlAttributes; + dfn: HTMLAttributes; + dialog: DialogHtmlAttributes; + div: HTMLAttributes; + dl: HTMLAttributes; + dt: HTMLAttributes; + em: HTMLAttributes; + embed: EmbedHTMLAttributes; + fieldset: FieldsetHTMLAttributes; + figcaption: HTMLAttributes; + figure: HTMLAttributes; + footer: HTMLAttributes; + form: FormHTMLAttributes; + h1: HTMLAttributes; + h2: HTMLAttributes; + h3: HTMLAttributes; + h4: HTMLAttributes; + h5: HTMLAttributes; + h6: HTMLAttributes; + head: HTMLAttributes; + header: HTMLAttributes; + hgroup: HTMLAttributes; + hr: HTMLAttributes; + html: HTMLAttributes; + i: HTMLAttributes; + iframe: IframeHTMLAttributes; + img: ImgHTMLAttributes; + input: InputHTMLAttributes; + ins: InsHTMLAttributes; + kbd: HTMLAttributes; + keygen: KeygenHTMLAttributes; + label: LabelHTMLAttributes; + legend: HTMLAttributes; + li: LiHTMLAttributes; + link: LinkHTMLAttributes; + main: HTMLAttributes; + map: MapHTMLAttributes; + mark: HTMLAttributes; + menu: MenuHTMLAttributes; + menuitem: HTMLAttributes; + meta: MetaHTMLAttributes; + meter: MeterHTMLAttributes; + nav: HTMLAttributes; + noindex: HTMLAttributes; + noscript: HTMLAttributes; + object: ObjectHTMLAttributes; + ol: OlHTMLAttributes; + optgroup: OptgroupHTMLAttributes; + option: OptionHTMLAttributes; + output: OutputHTMLAttributes; + p: HTMLAttributes; + param: ParamHTMLAttributes; + picture: HTMLAttributes; + pre: HTMLAttributes; + progress: ProgressHTMLAttributes; + q: QuoteHTMLAttributes; + rp: HTMLAttributes; + rt: HTMLAttributes; + ruby: HTMLAttributes; + s: HTMLAttributes; + samp: HTMLAttributes; + script: ScriptHTMLAttributes; + section: HTMLAttributes; + select: SelectHTMLAttributes; + slot: HTMLSlotElementAttributes; + small: HTMLAttributes; + source: SourceHTMLAttributes; + span: HTMLAttributes; + strong: HTMLAttributes; + style: StyleHTMLAttributes; + sub: HTMLAttributes; + summary: HTMLAttributes; + sup: HTMLAttributes; + table: HTMLAttributes; + tbody: HTMLAttributes; + td: TdHTMLAttributes; + textarea: TextareaHTMLAttributes; + tfoot: HTMLAttributes; + th: ThHTMLAttributes; + thead: HTMLAttributes; + time: TimeHTMLAttributes; + title: HTMLAttributes; + tr: HTMLAttributes; + track: TrackHTMLAttributes; + u: HTMLAttributes; + ul: HTMLAttributes; + var: HTMLAttributes; + video: VideoHTMLAttributes; + wbr: HTMLAttributes; + svg: SvgSVGAttributes; + animate: AnimateSVGAttributes; + animateMotion: AnimateMotionSVGAttributes; + animateTransform: AnimateTransformSVGAttributes; + circle: CircleSVGAttributes; + clipPath: ClipPathSVGAttributes; + defs: DefsSVGAttributes; + desc: DescSVGAttributes; + ellipse: EllipseSVGAttributes; + feBlend: FeBlendSVGAttributes; + feColorMatrix: FeColorMatrixSVGAttributes; + feComponentTransfer: FeComponentTransferSVGAttributes; + feComposite: FeCompositeSVGAttributes; + feConvolveMatrix: FeConvolveMatrixSVGAttributes; + feDiffuseLighting: FeDiffuseLightingSVGAttributes; + feDisplacementMap: FeDisplacementMapSVGAttributes; + feDistantLight: FeDistantLightSVGAttributes; + feFlood: FeFloodSVGAttributes; + feFuncA: FeFuncSVGAttributes; + feFuncB: FeFuncSVGAttributes; + feFuncG: FeFuncSVGAttributes; + feFuncR: FeFuncSVGAttributes; + feGaussianBlur: FeGaussianBlurSVGAttributes; + feImage: FeImageSVGAttributes; + feMerge: FeMergeSVGAttributes; + feMergeNode: FeMergeNodeSVGAttributes; + feMorphology: FeMorphologySVGAttributes; + feOffset: FeOffsetSVGAttributes; + fePointLight: FePointLightSVGAttributes; + feSpecularLighting: FeSpecularLightingSVGAttributes; + feSpotLight: FeSpotLightSVGAttributes; + feTile: FeTileSVGAttributes; + feTurbulence: FeTurbulanceSVGAttributes; + filter: FilterSVGAttributes; + foreignObject: ForeignObjectSVGAttributes; + g: GSVGAttributes; + image: ImageSVGAttributes; + line: LineSVGAttributes; + linearGradient: LinearGradientSVGAttributes; + marker: MarkerSVGAttributes; + mask: MaskSVGAttributes; + metadata: MetadataSVGAttributes; + path: PathSVGAttributes; + pattern: PatternSVGAttributes; + polygon: PolygonSVGAttributes; + polyline: PolylineSVGAttributes; + radialGradient: RadialGradientSVGAttributes; + rect: RectSVGAttributes; + stop: StopSVGAttributes; + switch: SwitchSVGAttributes; + symbol: SymbolSVGAttributes; + text: TextSVGAttributes; + textPath: TextPathSVGAttributes; + tspan: TSpanSVGAttributes; + use: UseSVGAttributes; + view: ViewSVGAttributes; + } +} diff --git a/src/jsx.ts b/src/jsx.ts deleted file mode 100644 index 18f217c..0000000 --- a/src/jsx.ts +++ /dev/null @@ -1,3519 +0,0 @@ -declare global { - /** - * Based on JSX types for Surplus and Inferno and adapted for `dom-expressions`. - * - * https://github.com/adamhaile/surplus/blob/master/index.d.ts - * https://github.com/infernojs/inferno/blob/master/packages/inferno/src/core/types.ts - */ - - namespace JSX { - type Element = - | Node - | ArrayElement - | FunctionElement - | string - | number - | boolean - | null - | undefined; - - interface ArrayElement extends Array {} - interface FunctionElement { - (): Element; - } - - interface ElementClass { - render(props: any): Element; - } - - type LibraryManagedAttributes = Props; - - // Let TS know the name of the `children` property in order for it to be able to type check them. - // https://github.com/Microsoft/TypeScript/issues/18357 - interface ElementChildrenAttribute { - children: {}; - } - - interface EventHandler { - (e: E & { currentTarget: T; target: T }): void; - } - - interface BoundEventHandler { - 0: (data: any, e: E & { currentTarget: T; target: T }) => void; - 1: any; - } - - type EventHandlerUnion = EventHandler | BoundEventHandler; - - // Intrinsic attributes enable us to define certain keys as attributes on an element, while - // at the same time hiding them from the element's `props`. - // https://github.com/Microsoft/TypeScript/issues/5478 - interface IntrinsicAttributes { - ref?: HTMLElement | ((e: HTMLElement) => void); - } - - // https://github.com/ryansolid/babel-plugin-jsx-dom-expressions#special-binding - interface CustomAttributes { - ref?: T | ((el: T) => void); - classList?: { [k: string]: boolean | undefined }; - on?: { [key: string]: EventHandler }; - onCapture?: { [key: string]: EventHandler }; - } - - // https://github.com/ryansolid/babel-plugin-jsx-dom-expressions#oneventname - interface DOMAttributes extends CustomAttributes { - children?: Element; - innerHTML?: string; - innerText?: string; - textContent?: string; - - // Clipboard Events - onCopy?: EventHandlerUnion; - onCut?: EventHandlerUnion; - onPaste?: EventHandlerUnion; - - // Composition Events - onCompositionEnd?: EventHandlerUnion; - onCompositionStart?: EventHandlerUnion; - onCompositionUpdate?: EventHandlerUnion; - - // Focus Events - onFocus?: EventHandlerUnion; - onBlur?: EventHandlerUnion; - - // Form Events - onChange?: EventHandlerUnion; - onInput?: EventHandlerUnion; - onReset?: EventHandlerUnion; - onSubmit?: EventHandlerUnion; - - // Image Events - onLoad?: EventHandlerUnion; - onError?: EventHandlerUnion; // also a Media Event - - // Keyboard Events - onKeyDown?: EventHandlerUnion; - onKeyPress?: EventHandlerUnion; - onKeyUp?: EventHandlerUnion; - - // Pointer Events - onGotPointerCapture?: EventHandlerUnion; - onLostPointerCapture?: EventHandlerUnion; - onPointerCancel?: EventHandlerUnion; - onPointerDown?: EventHandlerUnion; - onPointerEnter?: EventHandlerUnion; - onPointerLeave?: EventHandlerUnion; - onPointerMove?: EventHandlerUnion; - onPointerOver?: EventHandlerUnion; - onPointerOut?: EventHandlerUnion; - onPointerUp?: EventHandlerUnion; - - // Media Events - onAbort?: EventHandlerUnion; - onCanPlay?: EventHandlerUnion; - onCanPlayThrough?: EventHandlerUnion; - onDurationChange?: EventHandlerUnion; - onEmptied?: EventHandlerUnion; - onEncrypted?: EventHandlerUnion; - onEnded?: EventHandlerUnion; - onLoadedData?: EventHandlerUnion; - onLoadedMetadata?: EventHandlerUnion; - onLoadStart?: EventHandlerUnion; - onPause?: EventHandlerUnion; - onPlay?: EventHandlerUnion; - onPlaying?: EventHandlerUnion; - onProgress?: EventHandlerUnion; - onRateChange?: EventHandlerUnion; - onSeeked?: EventHandlerUnion; - onSeeking?: EventHandlerUnion; - onStalled?: EventHandlerUnion; - onSuspend?: EventHandlerUnion; - onTimeUpdate?: EventHandlerUnion; - onVolumeChange?: EventHandlerUnion; - onWaiting?: EventHandlerUnion; - - // MouseEvents - onClick?: EventHandlerUnion; - onContextMenu?: EventHandlerUnion; - onDblClick?: EventHandlerUnion; - onDrag?: EventHandlerUnion; - onDragEnd?: EventHandlerUnion; - onDragEnter?: EventHandlerUnion; - onDragExit?: EventHandlerUnion; - onDragLeave?: EventHandlerUnion; - onDragOver?: EventHandlerUnion; - onDragStart?: EventHandlerUnion; - onDrop?: EventHandlerUnion; - onMouseDown?: EventHandlerUnion; - onMouseEnter?: EventHandlerUnion; - onMouseLeave?: EventHandlerUnion; - onMouseMove?: EventHandlerUnion; - onMouseOut?: EventHandlerUnion; - onMouseOver?: EventHandlerUnion; - onMouseUp?: EventHandlerUnion; - - // Selection Events - onSelect?: EventHandlerUnion; - - // Touch Events - onTouchCancel?: EventHandlerUnion; - onTouchEnd?: EventHandlerUnion; - onTouchMove?: EventHandlerUnion; - onTouchStart?: EventHandlerUnion; - - // UI Events - onScroll?: EventHandlerUnion; - - // Wheel Events - onWheel?: EventHandlerUnion; - - // Animation Events - onAnimationStart?: EventHandlerUnion; - onAnimationEnd?: EventHandlerUnion; - onAnimationIteration?: EventHandlerUnion; - - // Transition Events - onTransitionEnd?: EventHandlerUnion; - } - - // See CSS 3 CSS-wide keywords https://www.w3.org/TR/css3-values/#common-keywords - // See CSS 3 Explicit Defaulting https://www.w3.org/TR/css-cascade-3/#defaulting-keywords - // "all CSS properties can accept these values" - type CSSWideKeyword = "initial" | "inherit" | "unset"; - - // See CSS 3 type https://drafts.csswg.org/css-values-3/#percentages - type CSSPercentage = string; - - // See CSS 3 type https://drafts.csswg.org/css-values-3/#lengths - type CSSLength = number | string; - - // This interface is not complete. Only properties accepting - // unitless numbers are listed here (see CSSProperty.js in Inferno) - interface CSSProperties { - /** - * Aligns a flex container's lines within the flex container when there is extra space in the cross-axis, similar to how justify-content aligns individual items within the main-axis. - */ - "align-content"?: - | CSSWideKeyword - | "flex-start" - | "flex-end" - | "center" - | "space-between" - | "space-around" - | "stretch"; - - /** - * Sets the default alignment in the cross axis for all of the flex container's items, including anonymous flex items, similarly to how justify-content aligns items along the main axis. - */ - "align-items"?: - | CSSWideKeyword - | "flex-start" - | "flex-end" - | "center" - | "baseline" - | "stretch"; - - /** - * Allows the default alignment to be overridden for individual flex items. - */ - "align-self"?: - | CSSWideKeyword - | "auto" - | "flex-start" - | "flex-end" - | "center" - | "baseline" - | "stretch"; - - /** - * This property allows precise alignment of elements, such as graphics, - * that do not have a baseline-table or lack the desired baseline in their baseline-table. - * With the alignment-adjust property, the position of the baseline identified by the alignment-baseline - * can be explicitly determined. It also determines precisely the alignment point for each glyph within a textual element. - */ - "alignment-adjust"?: CSSWideKeyword | any; - - "alignment-baseline"?: CSSWideKeyword | any; - - /** - * Defines a length of time to elapse before an animation starts, allowing an animation to begin execution some time after it is applied. - */ - "animation-delay"?: CSSWideKeyword | any; - - /** - * Defines whether an animation should run in reverse on some or all cycles. - */ - "animation-direction"?: CSSWideKeyword | any; - - /** - * Specifies how many times an animation cycle should play. - */ - "animation-iteration-count"?: CSSWideKeyword | any; - - /** - * Defines the list of animations that apply to the element. - */ - "animation-name"?: CSSWideKeyword | any; - - /** - * Defines whether an animation is running or paused. - */ - "animation-play-state"?: CSSWideKeyword | any; - - /** - * Allows changing the style of any element to platform-based interface elements or vice versa. - */ - appearance?: CSSWideKeyword | any; - - /** - * Determines whether or not the “back” side of a transformed element is visible when facing the viewer. - */ - "backface-visibility"?: CSSWideKeyword | any; - - /** - * Shorthand property to set the values for one or more of: - * background-clip, background-color, background-image, - * background-origin, background-position, background-repeat, - * background-size, and background-attachment. - */ - background?: CSSWideKeyword | any; - - /** - * If a background-image is specified, this property determines - * whether that image's position is fixed within the viewport, - * or scrolls along with its containing block. - * See CSS 3 background-attachment property https://drafts.csswg.org/css-backgrounds-3/#the-background-attachment - */ - "background-attachment"?: CSSWideKeyword | "scroll" | "fixed" | "local"; - - /** - * This property describes how the element's background images should blend with each other and the element's background color. - * The value is a list of blend modes that corresponds to each background image. Each element in the list will apply to the - * corresponding element of background-image. If a property doesn’t have enough comma-separated values to match the number of layers, - * the UA must calculate its used value by repeating the list of values until there are enough. - */ - "background-blend-mode"?: CSSWideKeyword | any; - - /** - * Sets the background color of an element. - */ - "background-color"?: CSSWideKeyword | any; - - "background-composite"?: CSSWideKeyword | any; - - /** - * Applies one or more background images to an element. These can be any valid CSS image, including url() paths to image files or CSS gradients. - */ - "background-image"?: CSSWideKeyword | any; - - /** - * Specifies what the background-position property is relative to. - */ - "background-origin"?: CSSWideKeyword | any; - - /** - * Sets the position of a background image. - */ - "background-position"?: CSSWideKeyword | any; - - /** - * Background-repeat defines if and how background images will be repeated after they have been sized and positioned - */ - "background-repeat"?: CSSWideKeyword | any; - - /** - * Defines the size of the background images - */ - "background-size"?: CSSWideKeyword | any; - - /** - * Obsolete - spec retired, not implemented. - */ - "baseline-shift"?: CSSWideKeyword | any; - - /** - * Non standard. Sets or retrieves the location of the Dynamic HTML (DHTML) behavior. - */ - behavior?: CSSWideKeyword | any; - - /** - * Shorthand property that defines the different properties of all four sides of an element's border in a single declaration. - * It can be used to set border-width, border-style and border-color, or a subset of these. - */ - border?: CSSWideKeyword | any; - - /** - * Shorthand that sets the values of border-bottom-color, - * border-bottom-style, and border-bottom-width. - */ - "border-bottom"?: CSSWideKeyword | any; - - /** - * Sets the color of the bottom border of an element. - */ - "border-bottom-color"?: CSSWideKeyword | any; - - /** - * Defines the shape of the border of the bottom-left corner. - */ - "border-bottom-left-radius"?: CSSWideKeyword | CSSLength; - - /** - * Defines the shape of the border of the bottom-right corner. - */ - "border-bottom-right-radius"?: CSSWideKeyword | CSSLength; - - /** - * Sets the line style of the bottom border of a box. - */ - "border-bottom-style"?: CSSWideKeyword | any; - - /** - * Sets the width of an element's bottom border. To set all four borders, - * use the border-width shorthand property which sets the values simultaneously for border-top-width, - * border-right-width, border-bottom-width, and border-left-width. - */ - "border-bottom-width"?: CSSWideKeyword | any; - - /** - * Border-collapse can be used for collapsing the borders between table cells - */ - "border-collapse"?: CSSWideKeyword | any; - - /** - * The CSS border-color property sets the color of an element's four borders. - * This property can have from one to four values, made up of the elementary properties: - * • border-top-color - * • border-right-color - * • border-bottom-color - * • border-left-color The default color is the currentColor of each of these values. - * If you provide one value, it sets the color for the element. Two values set the horizontal and vertical values, - * respectively. Providing three values sets the top, vertical, and bottom values, in that order. - * Four values set all for sides: top, right, bottom, and left, in that order. - */ - "border-color"?: CSSWideKeyword | any; - - /** - * Specifies different corner clipping effects, such as scoop (inner curves), bevel (straight cuts) or notch (cut-off rectangles). - * Works along with border-radius to specify the size of each corner effect. - */ - "border-corner-shape"?: CSSWideKeyword | any; - - /** - * The property border-image-source is used to set the image to be used instead of the border style. - * If this is set to none the border-style is used instead. - */ - "border-image-source"?: CSSWideKeyword | any; - - /** - * The border-image-width CSS property defines the offset to use for dividing the border image in nine parts, - * the top-left corner, central top edge, top-right-corner, central right edge, bottom-right corner, central bottom edge, - * bottom-left corner, and central right edge. They represent inward distance from the top, right, bottom, and left edges. - */ - "border-image-width"?: CSSWideKeyword | any; - - /** - * Shorthand property that defines the border-width, border-style and border-color of an element's left border in a single declaration. - * Note that you can use the corresponding longhand properties to set specific individual properties of the left border — border-left-width, - * border-left-style and border-left-color. - */ - "border-left"?: CSSWideKeyword | any; - - /** - * The CSS border-left-color property sets the color of an element's left border. This page explains the border-left-color value, - * but often you will find it more convenient to fix the border's left color as part of a shorthand set, either border-left or border-color. - * Colors can be defined several ways. For more information, see Usage. - */ - "border-left-color"?: CSSWideKeyword | any; - - /** - * Sets the style of an element's left border. To set all four borders, use the shorthand property, border-style. - * Otherwise, you can set the borders individually with border-top-style, border-right-style, border-bottom-style, border-left-style. - */ - "border-left-style"?: CSSWideKeyword | any; - - /** - * Sets the width of an element's left border. To set all four borders, - * use the border-width shorthand property which sets the values simultaneously for border-top-width, - * border-right-width, border-bottom-width, and border-left-width. - */ - "border-left-width"?: CSSWideKeyword | any; - - /** - * Shorthand property that sets the rounding of all four corners. - */ - "border-radius"?: CSSWideKeyword | CSSLength; - - /** - * Shorthand property that defines the border-width, border-style and border-color of an element's right border - * in a single declaration. Note that you can use the corresponding longhand properties to set specific - * individual properties of the right border — border-right-width, border-right-style and border-right-color. - */ - "border-right"?: CSSWideKeyword | any; - - /** - * Sets the color of an element's right border. This page explains the border-right-color value, - * but often you will find it more convenient to fix the border's right color as part of a shorthand set, - * either border-right or border-color. - * Colors can be defined several ways. For more information, see Usage. - */ - "border-right-color"?: CSSWideKeyword | any; - - /** - * Sets the style of an element's right border. To set all four borders, use the shorthand property, - * border-style. Otherwise, you can set the borders individually with border-top-style, border-right-style, - * border-bottom-style, border-left-style. - */ - "border-right-style"?: CSSWideKeyword | any; - - /** - * Sets the width of an element's right border. To set all four borders, - * use the border-width shorthand property which sets the values simultaneously for border-top-width, - * border-right-width, border-bottom-width, and border-left-width. - */ - "border-right-width"?: CSSWideKeyword | any; - - /** - * Specifies the distance between the borders of adjacent cells. - */ - "border-spacing"?: CSSWideKeyword | any; - - /** - * Sets the style of an element's four borders. This property can have from one to four values. - * With only one value, the value will be applied to all four borders; - * otherwise, this works as a shorthand property for each of border-top-style, border-right-style, - * border-bottom-style, border-left-style, where each border style may be assigned a separate value. - */ - "border-style"?: CSSWideKeyword | any; - - /** - * Shorthand property that defines the border-width, border-style and border-color of an element's top border - * in a single declaration. Note that you can use the corresponding longhand properties to set specific - * individual properties of the top border — border-top-width, border-top-style and border-top-color. - */ - "border-top"?: CSSWideKeyword | any; - - /** - * Sets the color of an element's top border. This page explains the border-top-color value, - * but often you will find it more convenient to fix the border's top color as part of a shorthand set, - * either border-top or border-color. - * Colors can be defined several ways. For more information, see Usage. - */ - "border-top-color"?: CSSWideKeyword | any; - - /** - * Sets the rounding of the top-left corner of the element. - */ - "border-top-left-radius"?: CSSWideKeyword | CSSLength; - - /** - * Sets the rounding of the top-right corner of the element. - */ - "border-top-right-radius"?: CSSWideKeyword | CSSLength; - - /** - * Sets the style of an element's top border. To set all four borders, use the shorthand property, border-style. - * Otherwise, you can set the borders individually with border-top-style, border-right-style, border-bottom-style, border-left-style. - */ - "border-top-style"?: CSSWideKeyword | any; - - /** - * Sets the width of an element's top border. To set all four borders, - * use the border-width shorthand property which sets the values simultaneously for border-top-width, - * border-right-width, border-bottom-width, and border-left-width. - */ - "border-top-width"?: CSSWideKeyword | any; - - /** - * Sets the width of an element's four borders. This property can have from one to four values. - * This is a shorthand property for setting values simultaneously for border-top-width, - * border-right-width, border-bottom-width, and border-left-width. - */ - "border-width"?: CSSWideKeyword | any; - - /** - * This property specifies how far an absolutely positioned box's bottom margin edge - * is offset above the bottom edge of the box's containing block. For relatively positioned boxes, - * the offset is with respect to the bottom edges of the box itself - * (i.e., the box is given a position in the normal flow, then offset from that position according to these properties). - */ - bottom?: CSSWideKeyword | any; - - /** - * Obsolete. - */ - "box-align"?: CSSWideKeyword | any; - - /** - * Breaks a box into fragments creating new borders, - * padding and repeating backgrounds or lets it stay as a continuous box on a page break, - * column break, or, for inline elements, at a line break. - */ - "box-decoration-break"?: CSSWideKeyword | any; - - /** - * Deprecated - */ - "box-direction"?: CSSWideKeyword | any; - - /** - * Do not use. This property has been replaced by the flex-wrap property. - * Gets or sets a value that specifies the direction to add successive rows or columns when the value of box-lines is set to multiple. - */ - "box-line-progression"?: CSSWideKeyword | any; - - /** - * Do not use. This property has been replaced by the flex-wrap property. - * Gets or sets a value that specifies whether child elements wrap onto multiple lines or columns based on the space available in the object. - */ - "box-lines"?: CSSWideKeyword | any; - - /** - * Do not use. This property has been replaced by flex-order. - * Specifies the ordinal group that a child element of the object belongs to. - * This ordinal value identifies the display order (along the axis defined by the box-orient property) for the group. - */ - "box-ordinal-group"?: CSSWideKeyword | any; - - /** - * Deprecated. - */ - "box-flex"?: CSSWideKeyword | number; - - /** - * Deprecated. - */ - "box-flex-group"?: CSSWideKeyword | number; - - /** - * Cast a drop shadow from the frame of almost any element. - * MDN: https://developer.mozilla.org/en-US/docs/Web/CSS/box-shadow - */ - "box-shadow"?: CSSWideKeyword | any; - - /** - * The CSS break-after property allows you to force a break on multi-column layouts. - * More specifically, it allows you to force a break after an element. - * It allows you to determine if a break should occur, and what type of break it should be. - * The break-after CSS property describes how the page, column or region break behaves after the generated box. - * If there is no generated box, the property is ignored. - */ - "break-after"?: CSSWideKeyword | any; - - /** - * Control page/column/region breaks that fall above a block of content - */ - "break-before"?: CSSWideKeyword | any; - - /** - * Control page/column/region breaks that fall within a block of content - */ - "break-inside"?: CSSWideKeyword | any; - - /** - * The clear CSS property specifies if an element can be positioned next to - * or must be positioned below the floating elements that precede it in the markup. - */ - clear?: CSSWideKeyword | any; - - /** - * Deprecated; see clip-path. - * Lets you specify the dimensions of an absolutely positioned element that should be visible, - * and the element is clipped into this shape, and displayed. - */ - clip?: CSSWideKeyword | any; - - /** - * Clipping crops an graphic, so that only a portion of the graphic is rendered, or filled. - * This clip-rule property, when used with the clip-path property, defines which clip rule, or algorithm, - * to use when filling the different parts of a graphics. - */ - "clip-rule"?: CSSWideKeyword | any; - - /** - * The color property sets the color of an element's foreground content (usually text), - * accepting any standard CSS color from keywords and hex values to RGB(a) and HSL(a). - */ - color?: CSSWideKeyword | any; - - /** - * Describes the number of columns of the element. - * See CSS 3 column-count property https://www.w3.org/TR/css3-multicol/#cc - */ - "column-count"?: CSSWideKeyword | number | "auto"; - - /** - * Specifies how to fill columns (balanced or sequential). - */ - "column-fill"?: CSSWideKeyword | any; - - /** - * The column-gap property controls the width of the gap between columns in multi-column elements. - */ - "column-gap"?: CSSWideKeyword | any; - - /** - * Sets the width, style, and color of the rule between columns. - */ - "column-rule"?: CSSWideKeyword | any; - - /** - * Specifies the color of the rule between columns. - */ - "column-rule-color"?: CSSWideKeyword | any; - - /** - * Specifies the width of the rule between columns. - */ - "column-rule-width"?: CSSWideKeyword | any; - - /** - * The column-span CSS property makes it possible for an element to span across all columns when its value is set to all. - * An element that spans more than one column is called a spanning element. - */ - "column-span"?: CSSWideKeyword | any; - - /** - * Specifies the width of columns in multi-column elements. - */ - "column-width"?: CSSWideKeyword | any; - - /** - * This property is a shorthand property for setting column-width and/or column-count. - */ - columns?: CSSWideKeyword | any; - - /** - * The counter-increment property accepts one or more names of counters (identifiers), - * each one optionally followed by an integer which specifies the value by which the counter should be incremented - * (e.g. if the value is 2, the counter increases by 2 each time it is invoked). - */ - "counter-increment"?: CSSWideKeyword | any; - - /** - * The counter-reset property contains a list of one or more names of counters, - * each one optionally followed by an integer (otherwise, the integer defaults to 0.). - * Each time the given element is invoked, the counters specified by the property are set to the given integer. - */ - "counter-reset"?: CSSWideKeyword | any; - - /** - * The cue property specifies sound files (known as an "auditory icon") to be played by speech media agents - * before and after presenting an element's content; if only one file is specified, it is played both before and after. - * The volume at which the file(s) should be played, relative to the volume of the main element, may also be specified. - * The icon files may also be set separately with the cue-before and cue-after properties. - */ - cue?: CSSWideKeyword | any; - - /** - * The cue-after property specifies a sound file (known as an "auditory icon") to be played by speech media agents - * after presenting an element's content; the volume at which the file should be played may also be specified. - * The shorthand property cue sets cue sounds for both before and after the element is presented. - */ - "cue-after"?: CSSWideKeyword | any; - - /** - * Specifies the mouse cursor displayed when the mouse pointer is over an element. - */ - cursor?: CSSWideKeyword | any; - - /** - * The direction CSS property specifies the text direction/writing direction. The rtl is used for Hebrew or Arabic text, the ltr is for other languages. - */ - direction?: CSSWideKeyword | any; - - /** - * This property specifies the type of rendering box used for an element. It is a shorthand property for many other display properties. - */ - display?: CSSWideKeyword | any; - - /** - * The ‘fill’ property paints the interior of the given graphical element. - * The area to be painted consists of any areas inside the outline of the shape. - * To determine the inside of the shape, all subpaths are considered, - * and the interior is determined according to the rules associated with the current value of the ‘fill-rule’ property. - * The zero-width geometric outline of a shape is included in the area to be painted. - */ - fill?: CSSWideKeyword | any; - - /** - * SVG: Specifies the opacity of the color or the content the current object is filled with. - * See SVG 1.1 https://www.w3.org/TR/SVG/painting.html#FillOpacityProperty - */ - "fill-opacity"?: CSSWideKeyword | number; - - /** - * The ‘fill-rule’ property indicates the algorithm which is to be used to determine what parts of the canvas are included inside the shape. - * For a simple, non-intersecting path, it is intuitively clear what region lies "inside"; - * however, for a more complex path, such as a path that intersects itself or where one subpath encloses another, - * the interpretation of "inside" is not so obvious. - * The ‘fill-rule’ property provides two options for how the inside of a shape is determined: - */ - "fill-rule"?: CSSWideKeyword | any; - - /** - * Applies various image processing effects. This property is largely unsupported. See Compatibility section for more information. - */ - filter?: CSSWideKeyword | any; - - /** - * Shorthand for `flex-grow`, `flex-shrink`, and `flex-basis`. - */ - flex?: CSSWideKeyword | number | string; - - /** - * Obsolete, do not use. This property has been renamed to align-items. - * Specifies the alignment (perpendicular to the layout axis defined by the flex-direction property) of child elements of the object. - */ - "flex-align"?: CSSWideKeyword | any; - - /** - * The flex-basis CSS property describes the initial main size of the flex item - * before any free space is distributed according to the flex factors described in the flex property (flex-grow and flex-shrink). - */ - "flex-basis"?: CSSWideKeyword | any; - - /** - * The flex-direction CSS property describes how flex items are placed in the flex container, by setting the direction of the flex container's main axis. - */ - "flex-direction"?: CSSWideKeyword | "row" | "row-reverse" | "column" | "column-reverse"; - - /** - * The flex-flow CSS property defines the flex container's main and cross axis. It is a shorthand property for the flex-direction and flex-wrap properties. - */ - "flex-flow"?: CSSWideKeyword | string; - - /** - * Specifies the flex grow factor of a flex item. - * See CSS flex-grow property https://drafts.csswg.org/css-flexbox-1/#flex-grow-property - */ - "flex-grow"?: CSSWideKeyword | number; - - /** - * Do not use. This property has been renamed to align-self - * Specifies the alignment (perpendicular to the layout axis defined by flex-direction) of child elements of the object. - */ - "flex-item-align"?: CSSWideKeyword | any; - - /** - * Do not use. This property has been renamed to align-content. - * Specifies how a flexbox's lines align within the flexbox when there is extra space along the axis that is perpendicular to the axis defined by the flex-direction property. - */ - "flex-line-pack"?: CSSWideKeyword | any; - - /** - * Gets or sets a value that specifies the ordinal group that a flexbox element belongs to. This ordinal value identifies the display order for the group. - */ - "flex-order"?: CSSWideKeyword | any; - - /** - * Specifies the flex shrink factor of a flex item. - * See CSS flex-shrink property https://drafts.csswg.org/css-flexbox-1/#flex-shrink-property - */ - "flex-shrink"?: CSSWideKeyword | number; - - /** - * Specifies whether flex items are forced into a single line or can be wrapped onto multiple lines. - * If wrapping is allowed, this property also enables you to control the direction in which lines are stacked. - * See CSS flex-wrap property https://drafts.csswg.org/css-flexbox-1/#flex-wrap-property - */ - "flex-wrap"?: CSSWideKeyword | "nowrap" | "wrap" | "wrap-reverse"; - - /** - * Elements which have the style float are floated horizontally. - * These elements can move as far to the left or right of the containing element. - * All elements after the floating element will flow around it, but elements before the floating element are not impacted. - * If several floating elements are placed after each other, they will float next to each other as long as there is room. - */ - float?: CSSWideKeyword | any; - - /** - * Flows content from a named flow (specified by a corresponding flow-into) through selected elements to form a dynamic chain of layout regions. - */ - "flow-from"?: CSSWideKeyword | any; - - /** - * The font property is shorthand that allows you to do one of two things: you can either set up six of the most mature font properties in one line, - * or you can set one of a choice of keywords to adopt a system font setting. - */ - font?: CSSWideKeyword | any; - - /** - * The font-family property allows one or more font family names and/or generic family names to be specified for usage on the selected element(s)' text. - * The browser then goes through the list; for each character in the selection it applies the first font family that has an available glyph for that character. - */ - "font-family"?: CSSWideKeyword | any; - - /** - * The font-kerning property allows contextual adjustment of inter-glyph spacing, i.e. the spaces between the characters in text. - * This property controls metric kerning - that utilizes adjustment data contained in the font. Optical Kerning is not supported as yet. - */ - "font-kerning"?: CSSWideKeyword | any; - - /** - * Specifies the size of the font. Used to compute em and ex units. - * See CSS 3 font-size property https://www.w3.org/TR/css-fonts-3/#propdef-font-size - */ - "font-size"?: - | CSSWideKeyword - | "xx-small" - | "x-small" - | "small" - | "medium" - | "large" - | "x-large" - | "xx-large" - | "larger" - | "smaller" - | CSSLength - | CSSPercentage; - - /** - * The font-size-adjust property adjusts the font-size of the fallback fonts defined with font-family, - * so that the x-height is the same no matter what font is used. - * This preserves the readability of the text when fallback happens. - * See CSS 3 font-size-adjust property https://www.w3.org/TR/css-fonts-3/#propdef-font-size-adjust - */ - "font-size-adjust"?: CSSWideKeyword | "none" | number; - - /** - * Allows you to expand or condense the widths for a normal, condensed, or expanded font face. - * See CSS 3 font-stretch property https://drafts.csswg.org/css-fonts-3/#propdef-font-stretch - */ - "font-stretch"?: - | CSSWideKeyword - | "normal" - | "ultra-condensed" - | "extra-condensed" - | "condensed" - | "semi-condensed" - | "semi-expanded" - | "expanded" - | "extra-expanded" - | "ultra-expanded"; - - /** - * The font-style property allows normal, italic, or oblique faces to be selected. - * Italic forms are generally cursive in nature while oblique faces are typically sloped versions of the regular face. - * Oblique faces can be simulated by artificially sloping the glyphs of the regular face. - * See CSS 3 font-style property https://www.w3.org/TR/css-fonts-3/#propdef-font-style - */ - "font-style"?: CSSWideKeyword | "normal" | "italic" | "oblique"; - - /** - * This value specifies whether the user agent is allowed to synthesize bold or oblique font faces when a font family lacks bold or italic faces. - */ - "font-synthesis"?: CSSWideKeyword | any; - - /** - * The font-variant property enables you to select the small-caps font within a font family. - */ - "font-variant"?: CSSWideKeyword | any; - - /** - * Fonts can provide alternate glyphs in addition to default glyph for a character. This property provides control over the selection of these alternate glyphs. - */ - "font-variant-alternates"?: CSSWideKeyword | any; - - /** - * Specifies the weight or boldness of the font. - * See CSS 3 'font-weight' property https://www.w3.org/TR/css-fonts-3/#propdef-font-weight - */ - "font-weight"?: - | CSSWideKeyword - | "normal" - | "bold" - | "bolder" - | "lighter" - | 100 - | 200 - | 300 - | 400 - | 500 - | 600 - | 700 - | 800 - | 900; - - /** - * Lays out one or more grid items bound by 4 grid lines. Shorthand for setting grid-column-start, grid-column-end, grid-row-start, and grid-row-end in a single declaration. - */ - "grid-area"?: CSSWideKeyword | any; - - /** - * Controls a grid item's placement in a grid area, particularly grid position and a grid span. Shorthand for setting grid-column-start and grid-column-end in a single declaration. - */ - "grid-column"?: CSSWideKeyword | any; - - /** - * Controls a grid item's placement in a grid area as well as grid position and a grid span. - * The grid-column-end property (with grid-row-start, grid-row-end, and grid-column-start) determines a grid item's placement by specifying the grid lines of a grid item's grid area. - */ - "grid-column-end"?: CSSWideKeyword | any; - - /** - * Determines a grid item's placement by specifying the starting grid lines of a grid item's grid area. - * A grid item's placement in a grid area consists of a grid position and a grid span. - * See also ( grid-row-start, grid-row-end, and grid-column-end) - */ - "grid-column-start"?: CSSWideKeyword | any; - - /** - * Gets or sets a value that indicates which row an element within a Grid should appear in. Shorthand for setting grid-row-start and grid-row-end in a single declaration. - */ - "grid-row"?: CSSWideKeyword | any; - - /** - * Determines a grid item’s placement by specifying the block-end. A grid item's placement in a grid area consists of a grid position and a grid span. - * The grid-row-end property (with grid-row-start, grid-column-start, and grid-column-end) determines a grid item's placement by specifying the grid lines of a grid item's grid area. - */ - "grid-row-end"?: CSSWideKeyword | any; - - /** - * Specifies a row position based upon an integer location, string value, or desired row size. - * css/properties/grid-row is used as short-hand for grid-row-position and grid-row-position - */ - "grid-row-position"?: CSSWideKeyword | any; - - "grid-row-span"?: CSSWideKeyword | any; - - /** - * Specifies named grid areas which are not associated with any particular grid item, but can be referenced from the grid-placement properties. - * The syntax of the grid-template-areas property also provides a visualization of the structure of the grid, making the overall layout of the grid container easier to understand. - */ - "grid-template-areas"?: CSSWideKeyword | any; - - /** - * Specifies (with grid-template-rows) the line names and track sizing functions of the grid. - * Each sizing function can be specified as a length, a percentage of the grid container’s size, - * a measurement of the contents occupying the column or row, or a fraction of the free space in the grid. - */ - "grid-template-columns"?: CSSWideKeyword | any; - - /** - * Specifies (with grid-template-columns) the line names and track sizing functions of the grid. - * Each sizing function can be specified as a length, a percentage of the grid container’s size, - * a measurement of the contents occupying the column or row, or a fraction of the free space in the grid. - */ - "grid-template-rows"?: CSSWideKeyword | any; - - /** - * Sets the height of an element. The content area of the element height does not include the padding, border, and margin of the element. - */ - height?: CSSWideKeyword | any; - - /** - * Specifies the minimum number of characters in a hyphenated word - */ - "hyphenate-limit-chars"?: CSSWideKeyword | any; - - /** - * Indicates the maximum number of successive hyphenated lines in an element. The ‘no-limit’ value means that there is no limit. - */ - "hyphenate-limit-lines"?: CSSWideKeyword | any; - - /** - * Specifies the maximum amount of trailing whitespace (before justification) that may be left in a line before hyphenation is triggered - * to pull part of a word from the next line back up into the current one. - */ - "hyphenate-limit-zone"?: CSSWideKeyword | any; - - /** - * Specifies whether or not words in a sentence can be split by the use of a manual or automatic hyphenation mechanism. - */ - hyphens?: CSSWideKeyword | any; - - "ime-mode"?: CSSWideKeyword | any; - - /** - * Defines how the browser distributes space between and around flex items - * along the main-axis of their container. - * See CSS justify-content property https://www.w3.org/TR/css-flexbox-1/#justify-content-property - */ - "justify-content"?: - | CSSWideKeyword - | "flex-start" - | "flex-end" - | "center" - | "space-between" - | "space-around" - | "space-evenly" - | "stretch"; - - "layout-grid"?: CSSWideKeyword | any; - - "layout-grid-char"?: CSSWideKeyword | any; - - "layout-grid-line"?: CSSWideKeyword | any; - - "layout-grid-mode"?: CSSWideKeyword | any; - - "layout-grid-type"?: CSSWideKeyword | any; - - /** - * Sets the left edge of an element - */ - left?: CSSWideKeyword | any; - - /** - * The letter-spacing CSS property specifies the spacing behavior between text characters. - */ - "letter-spacing"?: CSSWideKeyword | any; - - /** - * Deprecated. Gets or sets line-breaking rules for text in selected languages such as Japanese, Chinese, and Korean. - */ - "line-break"?: CSSWideKeyword | any; - - "line-clamp"?: CSSWideKeyword | number; - - /** - * Specifies the height of an inline block level element. - * See CSS 2.1 line-height property https://www.w3.org/TR/CSS21/visudet.html#propdef-line-height - */ - "line-height"?: CSSWideKeyword | "normal" | number | CSSLength | CSSPercentage; - - /** - * Shorthand property that sets the list-style-type, list-style-position and list-style-image properties in one declaration. - */ - "list-style"?: CSSWideKeyword | any; - - /** - * This property sets the image that will be used as the list item marker. When the image is available, - * it will replace the marker set with the 'list-style-type' marker. That also means that if the image is not available, - * it will show the style specified by list-style-property - */ - "list-style-image"?: CSSWideKeyword | any; - - /** - * Specifies if the list-item markers should appear inside or outside the content flow. - */ - "list-style-position"?: CSSWideKeyword | any; - - /** - * Specifies the type of list-item marker in a list. - */ - "list-style-type"?: CSSWideKeyword | any; - - /** - * The margin property is shorthand to allow you to set all four margins of an element at once. - * Its equivalent longhand properties are margin-top, margin-right, margin-bottom and margin-left. - * Negative values are also allowed. - */ - margin?: CSSWideKeyword | any; - - /** - * margin-bottom sets the bottom margin of an element. - */ - "margin-bottom"?: CSSWideKeyword | any; - - /** - * margin-left sets the left margin of an element. - */ - "margin-left"?: CSSWideKeyword | any; - - /** - * margin-right sets the right margin of an element. - */ - "margin-right"?: CSSWideKeyword | any; - - /** - * margin-top sets the top margin of an element. - */ - "margin-top"?: CSSWideKeyword | any; - - /** - * The marquee-direction determines the initial direction in which the marquee content moves. - */ - "marquee-direction"?: CSSWideKeyword | any; - - /** - * The 'marquee-style' property determines a marquee's scrolling behavior. - */ - "marquee-style"?: CSSWideKeyword | any; - - /** - * This property is shorthand for setting mask-image, mask-mode, mask-repeat, mask-position, mask-clip, mask-origin, mask-composite and mask-size. - * Omitted values are set to their original properties' initial values. - */ - mask?: CSSWideKeyword | any; - - /** - * This property is shorthand for setting mask-border-source, mask-border-slice, mask-border-width, mask-border-outset, and mask-border-repeat. - * Omitted values are set to their original properties' initial values. - */ - "mask-border"?: CSSWideKeyword | any; - - /** - * This property specifies how the images for the sides and the middle part of the mask image are scaled and tiled. - * The first keyword applies to the horizontal sides, the second one applies to the vertical ones. - * If the second keyword is absent, it is assumed to be the same as the first, similar to the CSS border-image-repeat property. - */ - "mask-border-repeat"?: CSSWideKeyword | any; - - /** - * This property specifies inward offsets from the top, right, bottom, and left edges of the mask image, - * dividing it into nine regions: four corners, four edges, and a middle. - * The middle image part is discarded and treated as fully transparent black unless the fill keyword is present. - * The four values set the top, right, bottom and left offsets in that order, similar to the CSS border-image-slice property. - */ - "mask-border-slice"?: CSSWideKeyword | any; - - /** - * Specifies an image to be used as a mask. An image that is empty, fails to download, is non-existent, or cannot be displayed is ignored and does not mask the element. - */ - "mask-border-source"?: CSSWideKeyword | any; - - /** - * This property sets the width of the mask box image, similar to the CSS border-image-width property. - */ - "mask-border-width"?: CSSWideKeyword | any; - - /** - * Determines the mask painting area, which defines the area that is affected by the mask. - * The painted content of an element may be restricted to this area. - */ - "mask-clip"?: CSSWideKeyword | any; - - /** - * For elements rendered as a single box, specifies the mask positioning area. - * For elements rendered as multiple boxes (e.g., inline boxes on several lines, boxes on several pages) - * specifies which boxes box-decoration-break operates on to determine the mask positioning area(s). - */ - "mask-origin"?: CSSWideKeyword | any; - - /** - * This property must not be used. It is no longer included in any standard or standard track specification, - * nor is it implemented in any browser. It is only used when the text-align-last property is set to size. - * It controls allowed adjustments of font-size to fit line content. - */ - "max-font-size"?: CSSWideKeyword | any; - - /** - * Sets the maximum height for an element. It prevents the height of the element to exceed the specified value. - * If min-height is specified and is greater than max-height, max-height is overridden. - */ - "max-height"?: CSSWideKeyword | any; - - /** - * Sets the maximum width for an element. It limits the width property to be larger than the value specified in max-width. - */ - "max-width"?: CSSWideKeyword | any; - - /** - * Sets the minimum height for an element. It prevents the height of the element to be smaller than the specified value. - * The value of min-height overrides both max-height and height. - */ - "min-height"?: CSSWideKeyword | any; - - /** - * Sets the minimum width of an element. It limits the width property to be not smaller than the value specified in min-width. - */ - "min-width"?: CSSWideKeyword | any; - - /** - * Specifies the transparency of an element. - * See CSS 3 opacity property https://drafts.csswg.org/css-color-3/#opacity - */ - opacity?: CSSWideKeyword | number; - - /** - * Specifies the order used to lay out flex items in their flex container. - * Elements are laid out in the ascending order of the order value. - * See CSS order property https://drafts.csswg.org/css-flexbox-1/#order-property - */ - order?: CSSWideKeyword | number; - - /** - * In paged media, this property defines the minimum number of lines in - * a block container that must be left at the bottom of the page. - * See CSS 3 orphans, widows properties https://drafts.csswg.org/css-break-3/#widows-orphans - */ - orphans?: CSSWideKeyword | number; - - /** - * The CSS outline property is a shorthand property for setting one or more of the individual outline properties outline-style, - * outline-width and outline-color in a single rule. In most cases the use of this shortcut is preferable and more convenient. - * Outlines differ from borders in the following ways: - * • Outlines do not take up space, they are drawn above the content. - * • Outlines may be non-rectangular. They are rectangular in Gecko/Firefox. - * Internet Explorer attempts to place the smallest contiguous outline around all elements or shapes that are indicated to have an outline. - * Opera draws a non-rectangular shape around a construct. - */ - outline?: CSSWideKeyword | any; - - /** - * The outline-color property sets the color of the outline of an element. An outline is a line that is drawn around elements, outside the border edge, to make the element stand out. - */ - "outline-color"?: CSSWideKeyword | any; - - /** - * The outline-offset property offsets the outline and draw it beyond the border edge. - */ - "outline-offset"?: CSSWideKeyword | any; - - /** - * The overflow property controls how extra content exceeding the bounding box of an element is rendered. - * It can be used in conjunction with an element that has a fixed width and height, to eliminate text-induced page distortion. - */ - overflow?: CSSWideKeyword | "auto" | "hidden" | "scroll" | "visible"; - - /** - * Specifies the preferred scrolling methods for elements that overflow. - */ - "overflow-style"?: CSSWideKeyword | any; - - /** - * Controls how extra content exceeding the x-axis of the bounding box of an element is rendered. - */ - "overflow-x"?: CSSWideKeyword | "auto" | "hidden" | "scroll" | "visible"; - - /** - * Controls how extra content exceeding the y-axis of the bounding box of an element is rendered. - */ - "overflow-y"?: CSSWideKeyword | "auto" | "hidden" | "scroll" | "visible"; - - /** - * The padding optional CSS property sets the required padding space on one to four sides of an element. - * The padding area is the space between an element and its border. Negative values are not allowed but decimal values are permitted. - * The element size is treated as fixed, and the content of the element shifts toward the center as padding is increased. - * The padding property is a shorthand to avoid setting each side separately (padding-top, padding-right, padding-bottom, padding-left). - */ - padding?: CSSWideKeyword | any; - - /** - * The padding-bottom CSS property of an element sets the padding space required on the bottom of an element. - * The padding area is the space between the content of the element and its border. - * Contrary to margin-bottom values, negative values of padding-bottom are invalid. - */ - "padding-bottom"?: CSSWideKeyword | any; - - /** - * The padding-left CSS property of an element sets the padding space required on the left side of an element. - * The padding area is the space between the content of the element and its border. - * Contrary to margin-left values, negative values of padding-left are invalid. - */ - "padding-left"?: CSSWideKeyword | any; - - /** - * The padding-right CSS property of an element sets the padding space required on the right side of an element. - * The padding area is the space between the content of the element and its border. - * Contrary to margin-right values, negative values of padding-right are invalid. - */ - "padding-right"?: CSSWideKeyword | any; - - /** - * The padding-top CSS property of an element sets the padding space required on the top of an element. - * The padding area is the space between the content of the element and its border. - * Contrary to margin-top values, negative values of padding-top are invalid. - */ - "padding-top"?: CSSWideKeyword | any; - - /** - * The page-break-after property is supported in all major browsers. With CSS3, page-break-* properties are only aliases of the break-* properties. - * The CSS3 Fragmentation spec defines breaks for all CSS box fragmentation. - */ - "page-break-after"?: CSSWideKeyword | any; - - /** - * The page-break-before property sets the page-breaking behavior before an element. - * With CSS3, page-break-* properties are only aliases of the break-* properties. - * The CSS3 Fragmentation spec defines breaks for all CSS box fragmentation. - */ - "page-break-before"?: CSSWideKeyword | any; - - /** - * Sets the page-breaking behavior inside an element. With CSS3, page-break-* properties are only aliases of the break-* properties. - * The CSS3 Fragmentation spec defines breaks for all CSS box fragmentation. - */ - "page-break-inside"?: CSSWideKeyword | any; - - /** - * The pause property determines how long a speech media agent should pause before and after presenting an element. - * It is a shorthand for the pause-before and pause-after properties. - */ - pause?: CSSWideKeyword | any; - - /** - * The pause-after property determines how long a speech media agent should pause after presenting an element. - * It may be replaced by the shorthand property pause, which sets pause time before and after. - */ - "pause-after"?: CSSWideKeyword | any; - - /** - * The pause-before property determines how long a speech media agent should pause before presenting an element. - * It may be replaced by the shorthand property pause, which sets pause time before and after. - */ - "pause-before"?: CSSWideKeyword | any; - - /** - * The perspective property defines how far an element is placed from the view on the z-axis, from the screen to the viewer. - * Perspective defines how an object is viewed. In graphic arts, perspective is the representation on a flat surface of what the viewer's eye would see in a 3D space. - * (See Wikipedia for more information about graphical perspective and for related illustrations.) - * The illusion of perspective on a flat surface, such as a computer screen, - * is created by projecting points on the flat surface as they would appear if the flat surface were a window - * through which the viewer was looking at the object. In discussion of virtual environments, this flat surface is called a projection plane. - */ - perspective?: CSSWideKeyword | any; - - /** - * The perspective-origin property establishes the origin for the perspective property. - * It effectively sets the X and Y position at which the viewer appears to be looking at the children of the element. - * When used with perspective, perspective-origin changes the appearance of an object, - * as if a viewer were looking at it from a different origin. - * An object appears differently if a viewer is looking directly at it versus looking at it from below, above, or from the side. - * Thus, the perspective-origin is like a vanishing point. - * The default value of perspective-origin is 50% 50%. - * This displays an object as if the viewer's eye were positioned directly at the center of the screen, both top-to-bottom and left-to-right. - * A value of 0% 0% changes the object as if the viewer was looking toward the top left angle. - * A value of 100% 100% changes the appearance as if viewed toward the bottom right angle. - */ - "perspective-origin"?: CSSWideKeyword | any; - - /** - * The pointer-events property allows you to control whether an element can be the target for the pointing device (e.g, mouse, pen) events. - */ - "pointer-events"?: CSSWideKeyword | any; - - /** - * The position property controls the type of positioning used by an element within its parent elements. - * The effect of the position property depends on a lot of factors, for example the position property of parent elements. - */ - position?: CSSWideKeyword | "static" | "relative" | "absolute" | "fixed" | "sticky"; - - /** - * Obsolete: unsupported. - * This property determines whether or not a full-width punctuation mark character should be trimmed if it appears at the beginning of a line, - * so that its "ink" lines up with the first glyph in the line above and below. - */ - "punctuation-trim"?: CSSWideKeyword | any; - - /** - * Sets the type of quotation marks for embedded quotations. - */ - quotes?: CSSWideKeyword | any; - - /** - * Controls whether the last region in a chain displays additional 'overset' content according its default overflow property, - * or if it displays a fragment of content as if it were flowing into a subsequent region. - */ - "region-fragment"?: CSSWideKeyword | any; - - /** - * The rest-after property determines how long a speech media agent should pause after presenting an element's main content, - * before presenting that element's exit cue sound. It may be replaced by the shorthand property rest, which sets rest time before and after. - */ - "rest-after"?: CSSWideKeyword | any; - - /** - * The rest-before property determines how long a speech media agent should pause after presenting an intro cue sound for an element, - * before presenting that element's main content. It may be replaced by the shorthand property rest, which sets rest time before and after. - */ - "rest-before"?: CSSWideKeyword | any; - - /** - * Specifies the position an element in relation to the right side of the containing element. - */ - right?: CSSWideKeyword | any; - - "ruby-align"?: CSSWideKeyword | any; - - "ruby-position"?: CSSWideKeyword | any; - - /** - * Defines the alpha channel threshold used to extract a shape from an image. Can be thought of as a "minimum opacity" threshold; - * that is, a value of 0.5 means that the shape will enclose all the pixels that are more than 50% opaque. - */ - "shape-image-threshold"?: CSSWideKeyword | any; - - /** - * A future level of CSS Shapes will define a shape-inside property, which will define a shape to wrap content within the element. - * See Editor's Draft and CSSWG wiki page on next-level plans - */ - "shape-inside"?: CSSWideKeyword | any; - - /** - * Adds a margin to a shape-outside. In effect, defines a new shape that is the smallest contour around all the points - * that are the shape-margin distance outward perpendicular to each point on the underlying shape. - * For points where a perpendicular direction is not defined (e.g., a triangle corner), - * takes all points on a circle centered at the point and with a radius of the shape-margin distance. - * This property accepts only non-negative values. - */ - "shape-margin"?: CSSWideKeyword | any; - - /** - * Declares a shape around which text should be wrapped, with possible modifications from the shape-margin property. - * The shape defined by shape-outside and shape-margin changes the geometry of a float element's float area. - */ - "shape-outside"?: CSSWideKeyword | any; - - /** - * The speak property determines whether or not a speech synthesizer will read aloud the contents of an element. - */ - speak?: CSSWideKeyword | any; - - /** - * The speak-as property determines how the speech synthesizer interprets the content: words as whole words or as a sequence of letters, - * numbers as a numerical value or a sequence of digits, punctuation as pauses in speech or named punctuation characters. - */ - "speak-as"?: CSSWideKeyword | any; - - /** - * SVG: Specifies the opacity of the outline on the current object. - * See SVG 1.1 https://www.w3.org/TR/SVG/painting.html#StrokeOpacityProperty - */ - "stroke-opacity"?: CSSWideKeyword | number; - - /** - * SVG: Specifies the width of the outline on the current object. - * See SVG 1.1 https://www.w3.org/TR/SVG/painting.html#StrokeWidthProperty - */ - "stroke-width"?: CSSWideKeyword | CSSPercentage | CSSLength; - - /** - * The tab-size CSS property is used to customise the width of a tab (U+0009) character. - */ - "tab-size"?: CSSWideKeyword | any; - - /** - * The 'table-layout' property controls the algorithm used to lay out the table cells, rows, and columns. - */ - "table-layout"?: CSSWideKeyword | any; - - /** - * The text-align CSS property describes how inline content like text is aligned in its parent block element. - * text-align does not control the alignment of block elements itself, only their inline content. - */ - "text-align"?: CSSWideKeyword | any; - - /** - * The text-align-last CSS property describes how the last line of a block element or a line before line break is aligned in its parent block element. - */ - "text-align-last"?: CSSWideKeyword | any; - - /** - * The text-decoration CSS property is used to set the text formatting to underline, overline, line-through or blink. - * underline and overline decorations are positioned under the text, line-through over it. - */ - "text-decoration"?: CSSWideKeyword | any; - - /** - * Sets the color of any text decoration, such as underlines, overlines, and strike throughs. - */ - "text-decoration-color"?: CSSWideKeyword | any; - - /** - * Sets what kind of line decorations are added to an element, such as underlines, overlines, etc. - */ - "text-decoration-line"?: CSSWideKeyword | any; - - "text-decoration-line-through"?: CSSWideKeyword | any; - - "text-decoration-none"?: CSSWideKeyword | any; - - "text-decoration-overline"?: CSSWideKeyword | any; - - /** - * Specifies what parts of an element’s content are skipped over when applying any text decoration. - */ - "text-decoration-skip"?: CSSWideKeyword | any; - - /** - * This property specifies the style of the text decoration line drawn on the specified element. - * The intended meaning for the values are the same as those of the border-style-properties. - */ - "text-decoration-style"?: CSSWideKeyword | any; - - "text-decoration-underline"?: CSSWideKeyword | any; - - /** - * The text-emphasis property will apply special emphasis marks to the elements text. - * Slightly similar to the text-decoration property only that this property can have affect on the line-height. - * It also is noted that this is shorthand for text-emphasis-style and for text-emphasis-color. - */ - "text-emphasis"?: CSSWideKeyword | any; - - /** - * The text-emphasis-color property specifies the foreground color of the emphasis marks. - */ - "text-emphasis-color"?: CSSWideKeyword | any; - - /** - * The text-emphasis-style property applies special emphasis marks to an element's text. - */ - "text-emphasis-style"?: CSSWideKeyword | any; - - /** - * This property helps determine an inline box's block-progression dimension, - * derived from the text-height and font-size properties for non-replaced elements, - * the height or the width for replaced elements, and the stacked block-progression dimension for inline-block elements. - * The block-progression dimension determines the position of the padding, border and margin for the element. - */ - "text-height"?: CSSWideKeyword | any; - - /** - * Specifies the amount of space horizontally that should be left on the first line of the text of an element. - * This horizontal spacing is at the beginning of the first line and is in respect to the left edge of the containing block box. - */ - "text-indent"?: CSSWideKeyword | any; - - "text-justify-trim"?: CSSWideKeyword | any; - - "text-kashida-space"?: CSSWideKeyword | any; - - /** - * The text-line-through property is a shorthand property for text-line-through-style, text-line-through-color and text-line-through-mode. - * (Considered obsolete; use text-decoration instead.) - */ - "text-line-through"?: CSSWideKeyword | any; - - /** - * Specifies the line colors for the line-through text decoration. - * (Considered obsolete; use text-decoration-color instead.) - */ - "text-line-through-color"?: CSSWideKeyword | any; - - /** - * Sets the mode for the line-through text decoration, determining whether the text decoration affects the space characters or not. - * (Considered obsolete; use text-decoration-skip instead.) - */ - "text-line-through-mode"?: CSSWideKeyword | any; - - /** - * Specifies the line style for line-through text decoration. - * (Considered obsolete; use text-decoration-style instead.) - */ - "text-line-through-style"?: CSSWideKeyword | any; - - /** - * Specifies the line width for the line-through text decoration. - */ - "text-line-through-width"?: CSSWideKeyword | any; - - /** - * The text-overflow shorthand CSS property determines how overflowed content that is not displayed is signaled to the users. - * It can be clipped, display an ellipsis ('…', U+2026 HORIZONTAL ELLIPSIS) or a Web author-defined string. - * It covers the two long-hand properties text-overflow-mode and text-overflow-ellipsis - */ - "text-overflow"?: CSSWideKeyword | any; - - /** - * The text-overline property is the shorthand for the text-overline-style, text-overline-width, text-overline-color, and text-overline-mode properties. - */ - "text-overline"?: CSSWideKeyword | any; - - /** - * Specifies the line color for the overline text decoration. - */ - "text-overline-color"?: CSSWideKeyword | any; - - /** - * Sets the mode for the overline text decoration, determining whether the text decoration affects the space characters or not. - */ - "text-overline-mode"?: CSSWideKeyword | any; - - /** - * Specifies the line style for overline text decoration. - */ - "text-overline-style"?: CSSWideKeyword | any; - - /** - * Specifies the line width for the overline text decoration. - */ - "text-overline-width"?: CSSWideKeyword | any; - - /** - * The text-rendering CSS property provides information to the browser about how to optimize when rendering text. - * Options are: legibility, speed or geometric precision. - */ - "text-rendering"?: CSSWideKeyword | any; - - /** - * Obsolete: unsupported. - */ - "text-script"?: CSSWideKeyword | any; - - /** - * The CSS text-shadow property applies one or more drop shadows to the text and of an element. - * Each shadow is specified as an offset from the text, along with optional color and blur radius values. - */ - "text-shadow"?: CSSWideKeyword | any; - - /** - * This property transforms text for styling purposes. (It has no effect on the underlying content.) - */ - "text-transform"?: CSSWideKeyword | any; - - /** - * Unsupported. - * This property will add a underline position value to the element that has an underline defined. - */ - "text-underline-position"?: CSSWideKeyword | any; - - /** - * After review this should be replaced by text-decoration should it not? - * This property will set the underline style for text with a line value for underline, overline, and line-through. - */ - "text-underline-style"?: CSSWideKeyword | any; - - /** - * This property specifies how far an absolutely positioned box's top margin edge is offset below the top edge of the box's containing block. - * For relatively positioned boxes, the offset is with respect to the top edges of the box itself (i.e., the box is given a position in the normal flow, - * then offset from that position according to these properties). - */ - top?: CSSWideKeyword | any; - - /** - * Determines whether touch input may trigger default behavior supplied by the user agent, such as panning or zooming. - */ - "touch-action"?: CSSWideKeyword | any; - - /** - * CSS transforms allow elements styled with CSS to be transformed in two-dimensional or three-dimensional space. - * Using this property, elements can be translated, rotated, scaled, and skewed. The value list may consist of 2D and/or 3D transform values. - */ - transform?: CSSWideKeyword | any; - - /** - * This property defines the origin of the transformation axes relative to the element to which the transformation is applied. - */ - "transform-origin"?: CSSWideKeyword | any; - - /** - * This property allows you to define the relative position of the origin of the transformation grid along the z-axis. - */ - "transform-origin-z"?: CSSWideKeyword | any; - - /** - * This property specifies how nested elements are rendered in 3D space relative to their parent. - */ - "transform-style"?: CSSWideKeyword | any; - - /** - * The transition CSS property is a shorthand property for transition-property, transition-duration, transition-timing-function, - * and transition-delay. It allows to define the transition between two states of an element. - */ - transition?: CSSWideKeyword | any; - - /** - * Defines when the transition will start. A value of ‘0s’ means the transition will execute as soon as the property is changed. - * Otherwise, the value specifies an offset from the moment the property is changed, and the transition will delay execution by that offset. - */ - "transition-delay"?: CSSWideKeyword | any; - - /** - * The 'transition-duration' property specifies the length of time a transition animation takes to complete. - */ - "transition-duration"?: CSSWideKeyword | any; - - /** - * The 'transition-property' property specifies the name of the CSS property to which the transition is applied. - */ - "transition-property"?: CSSWideKeyword | any; - - /** - * Sets the pace of action within a transition - */ - "transition-timing-function"?: CSSWideKeyword | any; - - /** - * The unicode-bidi CSS property specifies the level of embedding with respect to the bidirectional algorithm. - */ - "unicode-bidi"?: CSSWideKeyword | any; - - /** - * unicode-range allows you to set a specific range of characters to be downloaded from a font (embedded using @font-face) and made available for use on the current page. - */ - "unicode-range"?: CSSWideKeyword | any; - - /** - * This is for all the high level UX stuff. - */ - "user-focus"?: CSSWideKeyword | any; - - /** - * For inputing user content - */ - "user-input"?: CSSWideKeyword | any; - - /** - * The vertical-align property controls how inline elements or text are vertically aligned compared to the baseline. - * If this property is used on table-cells it controls the vertical alignment of content of the table cell. - */ - "vertical-align"?: CSSWideKeyword | any; - - /** - * The visibility property specifies whether the boxes generated by an element are rendered. - */ - visibility?: CSSWideKeyword | any; - - /** - * The voice-balance property sets the apparent position (in stereo sound) of the synthesized voice for spoken media. - */ - "voice-balance"?: CSSWideKeyword | any; - - /** - * The voice-duration property allows the author to explicitly set the amount of time it should take a speech synthesizer to read an element's content, - * for example to allow the speech to be synchronized with other media. - * With a value of auto (the default) the length of time it takes to read the content is determined by the content itself and the voice-rate property. - */ - "voice-duration"?: CSSWideKeyword | any; - - /** - * The voice-family property sets the speaker's voice used by a speech media agent to read an element. - * The speaker may be specified as a named character (to match a voice option in the speech reading software) - * or as a generic description of the age and gender of the voice. - * Similar to the font-family property for visual media, - * a comma-separated list of fallback options may be given in case the speech reader does not recognize the character name - * or cannot synthesize the requested combination of generic properties. - */ - "voice-family"?: CSSWideKeyword | any; - - /** - * The voice-pitch property sets pitch or tone (high or low) for the synthesized speech when reading an element; - * the pitch may be specified absolutely or relative to the normal pitch for the voice-family used to read the text. - */ - "voice-pitch"?: CSSWideKeyword | any; - - /** - * The voice-range property determines how much variation in pitch or tone will be created by the speech synthesize when reading an element. - * Emphasized text, grammatical structures and punctuation may all be rendered as changes in pitch, - * this property determines how strong or obvious those changes are; - * large ranges are associated with enthusiastic or emotional speech, - * while small ranges are associated with flat or mechanical speech. - */ - "voice-range"?: CSSWideKeyword | any; - - /** - * The voice-rate property sets the speed at which the voice synthesized by a speech media agent will read content. - */ - "voice-rate"?: CSSWideKeyword | any; - - /** - * The voice-stress property sets the level of vocal emphasis to be used for synthesized speech reading the element. - */ - "voice-stress"?: CSSWideKeyword | any; - - /** - * The voice-volume property sets the volume for spoken content in speech media. It replaces the deprecated volume property. - */ - "voice-volume"?: CSSWideKeyword | any; - - /** - * The white-space property controls whether and how white space inside the element is collapsed, and whether lines may wrap at unforced "soft wrap" opportunities. - */ - "white-space"?: CSSWideKeyword | any; - - /** - * Obsolete: unsupported. - */ - "white-space-treatment"?: CSSWideKeyword | any; - - /** - * In paged media, this property defines the mimimum number of lines - * that must be left at the top of the second page. - * See CSS 3 orphans, widows properties https://drafts.csswg.org/css-break-3/#widows-orphans - */ - widows?: CSSWideKeyword | number; - - /** - * Specifies the width of the content area of an element. The content area of the element width does not include the padding, border, and margin of the element. - */ - width?: CSSWideKeyword | any; - - /** - * The word-break property is often used when there is long generated content that is strung together without and spaces or hyphens to beak apart. - * A common case of this is when there is a long URL that does not have any hyphens. This case could potentially cause the breaking of the layout as it could extend past the parent element. - */ - "word-break"?: CSSWideKeyword | any; - - /** - * The word-spacing CSS property specifies the spacing behavior between "words". - */ - "word-spacing"?: CSSWideKeyword | any; - - /** - * An alias of css/properties/overflow-wrap, word-wrap defines whether to break words when the content exceeds the boundaries of its container. - */ - "word-wrap"?: CSSWideKeyword | any; - - /** - * Specifies how exclusions affect inline content within block-level elements. Elements lay out their inline content in their content area but wrap around exclusion areas. - */ - "wrap-flow"?: CSSWideKeyword | any; - - /** - * Set the value that is used to offset the inner wrap shape from other shapes. Inline content that intersects a shape with this property will be pushed by this shape's margin. - */ - "wrap-margin"?: CSSWideKeyword | any; - - /** - * Obsolete and unsupported. Do not use. - * This CSS property controls the text when it reaches the end of the block in which it is enclosed. - */ - "wrap-option"?: CSSWideKeyword | any; - - /** - * writing-mode specifies if lines of text are laid out horizontally or vertically, and the direction which lines of text and blocks progress. - */ - "writing-mode"?: CSSWideKeyword | any; - - /** - * The z-index property specifies the z-order of an element and its descendants. - * When elements overlap, z-order determines which one covers the other. - * See CSS 2 z-index property https://www.w3.org/TR/CSS2/visuren.html#z-index - */ - "z-index"?: CSSWideKeyword | "auto" | number; - - /** - * Sets the initial zoom factor of a document defined by @viewport. - * See CSS zoom descriptor https://drafts.csswg.org/css-device-adapt/#zoom-desc - */ - zoom?: CSSWideKeyword | "auto" | number | CSSPercentage; - - [propertyName: string]: any; - } - - type HTMLAutocapitalize = "off" | "none" | "on" | "sentences" | "words" | "characters"; - - type HTMLDir = "ltr" | "rtl" | "auto"; - - type HTMLFormEncType = - | "application/x-www-form-urlencoded" - | "multipart/form-data" - | "text/plain"; - - type HTMLFormMethod = "post" | "get" | "dialog"; - - type HTMLCrossorigin = "anonymous" | "use-credentials" | ""; - - type HTMLReferrerPolicy = - | "no-referrer" - | "no-referrer-when-downgrade" - | "origin" - | "origin-when-cross-origin" - | "same-origin" - | "strict-origin" - | "strict-origin-when-cross-origin" - | "unsafe-url"; - - type HTMLIframeSandbox = - | "allow-downloads-without-user-activation" - | "allow-forms" - | "allow-modals" - | "allow-orientation-lock" - | "allow-pointer-lock" - | "allow-popups" - | "allow-popups-to-escape-sandbox" - | "allow-presentation" - | "allow-same-origin" - | "allow-scripts" - | "allow-storage-access-by-user-activation" - | "allow-top-navigation" - | "allow-top-navigation-by-user-activation"; - - type HTMLLinkAs = - | "audio" - | "document" - | "embed" - | "fetch" - | "font" - | "image" - | "object" - | "script" - | "style" - | "track" - | "video" - | "worker"; - - interface HTMLAttributes extends DOMAttributes { - // Standard HTML Attributes - accessKey?: string; - className?: string; - class?: string; - contenteditable?: boolean | "inherit"; - contextmenu?: string; - dir?: HTMLDir; - draggable?: boolean; - hidden?: boolean; - id?: string; - lang?: string; - spellcheck?: boolean; - style?: CSSProperties | string; - tabindex?: number | string; - title?: string; - translate?: "yes" | "no"; - - // RDFa Attributes - about?: string; - datatype?: string; - inlist?: any; - prefix?: string; - property?: string; - resource?: string; - typeof?: string; - vocab?: string; - - // Non-standard Attributes - autocapitalize?: HTMLAutocapitalize; - color?: string; - itemprop?: string; - itemscope?: boolean; - itemtype?: string; - itemid?: string; - itemref?: string; - - // others - align?: "start" | "end" | "center" | "baseline" | "stretch" | "left" | "right"; - part?: string; - exportparts?: string; - inputmode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search"; - - // camelcase - contentEditable?: boolean | "inherit"; - contextMenu?: string; - tabIndex?: number | string; - autoCapitalize?: HTMLAutocapitalize; - itemProp?: string; - itemScope?: boolean; - itemType?: string; - itemId?: string; - itemRef?: string; - exportParts?: string; - inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search"; - } - - // HTML Elements - - interface AnchorHTMLAttributes extends HTMLAttributes { - download?: any; - href?: string; - hreflang?: string; - media?: string; - ping?: string; - referrerpolicy?: HTMLReferrerPolicy; - rel?: string; - target?: string; - type?: string; - - // camelcase - referrerPolicy?: HTMLReferrerPolicy; - } - - interface AudioHTMLAttributes extends MediaHTMLAttributes {} - - interface AreaHTMLAttributes extends HTMLAttributes { - alt?: string; - coords?: string; - download?: any; - href?: string; - hreflang?: string; - ping?: string; - referrerpolicy?: HTMLReferrerPolicy; - rel?: string; - shape?: "rect" | "circle" | "poly" | "default"; - target?: string; - - // camelcase - referrerPolicy?: HTMLReferrerPolicy; - } - - interface BaseHTMLAttributes extends HTMLAttributes { - href?: string; - target?: string; - } - - interface BlockquoteHTMLAttributes extends HTMLAttributes { - cite?: string; - } - - interface ButtonHTMLAttributes extends HTMLAttributes { - autofocus?: boolean; - disabled?: boolean; - form?: string; - formaction?: string; - formenctype?: HTMLFormEncType; - formmethod?: HTMLFormMethod; - formnovalidate?: boolean; - formtarget?: string; - name?: string; - type?: "submit" | "reset" | "button"; - value?: string; - - // camelcase - formAction?: string; - formEnctype?: HTMLFormEncType; - formMethod?: HTMLFormMethod; - formNoValidate?: boolean; - formTarget?: string; - } - - interface CanvasHTMLAttributes extends HTMLAttributes { - width?: number | string; - height?: number | string; - } - - interface ColHTMLAttributes extends HTMLAttributes { - span?: number | string; - width?: number | string; - } - - interface ColgroupHTMLAttributes extends HTMLAttributes { - span?: number | string; - } - - interface DataHTMLAttributes extends HTMLAttributes { - value?: string | string[] | number; - } - - interface DetailsHtmlAttributes extends HTMLAttributes { - open?: boolean; - } - - interface DialogHtmlAttributes extends HTMLAttributes { - open?: boolean; - } - - interface EmbedHTMLAttributes extends HTMLAttributes { - height?: number | string; - src?: string; - type?: string; - width?: number | string; - } - - interface FieldsetHTMLAttributes extends HTMLAttributes { - disabled?: boolean; - form?: string; - name?: string; - } - - interface FormHTMLAttributes extends HTMLAttributes { - acceptcharset?: string; - action?: string; - autocomplete?: string; - encoding?: HTMLFormEncType; - enctype?: HTMLFormEncType; - method?: HTMLFormMethod; - name?: string; - novalidate?: boolean; - target?: string; - - // camelcase - acceptCharset?: string; - noValidate?: boolean; - } - - interface IframeHTMLAttributes extends HTMLAttributes { - allow?: string; - allowfullscreen?: boolean; - height?: number | string; - name?: string; - referrerpolicy?: HTMLReferrerPolicy; - sandbox?: HTMLIframeSandbox; - src?: string; - srcdoc?: string; - width?: number | string; - - // camelcase - referrerPolicy?: HTMLReferrerPolicy; - } - - interface ImgHTMLAttributes extends HTMLAttributes { - alt?: string; - crossorigin?: HTMLCrossorigin; - decoding?: "sync" | "async" | "auto"; - height?: number | string; - referrerpolicy?: HTMLReferrerPolicy; - sizes?: string; - src?: string; - srcset?: string; - width?: number | string; - - // camelcase - crossOrigin?: HTMLCrossorigin; - referrerPolicy?: HTMLReferrerPolicy; - } - - interface InputHTMLAttributes extends HTMLAttributes { - accept?: string; - alt?: string; - autocomplete?: string; - autofocus?: boolean; - capture?: boolean | string; - checked?: boolean; - crossorigin?: HTMLCrossorigin; - disabled?: boolean; - form?: string; - formaction?: string; - formenctype?: HTMLFormEncType; - formmethod?: HTMLFormMethod; - formnovalidate?: boolean; - formtarget?: string; - height?: number | string; - list?: string; - max?: number | string; - maxlength?: number | string; - min?: number | string; - minlength?: number | string; - multiple?: boolean; - name?: string; - pattern?: string; - placeholder?: string; - readonly?: boolean; - required?: boolean; - size?: number | string; - src?: string; - step?: number | string; - type?: string; - value?: string | string[] | number; - width?: number | string; - - // camelcase - crossOrigin?: HTMLCrossorigin; - formAction?: string; - formEnctype?: HTMLFormEncType; - formMethod?: HTMLFormMethod; - formNoValidate?: boolean; - formTarget?: string; - maxLength?: number | string; - minLength?: number | string; - readOnly?: boolean; - } - - interface InsHTMLAttributes extends HTMLAttributes { - cite?: string; - dateTime?: string; - } - - interface KeygenHTMLAttributes extends HTMLAttributes { - autofocus?: boolean; - challenge?: string; - disabled?: boolean; - form?: string; - keytype?: string; - keyparams?: string; - name?: string; - } - - interface LabelHTMLAttributes extends HTMLAttributes { - htmlFor?: string; - for?: string; - form?: string; - } - - interface LiHTMLAttributes extends HTMLAttributes { - value?: number | string; - } - - interface LinkHTMLAttributes extends HTMLAttributes { - as?: HTMLLinkAs; - crossorigin?: HTMLCrossorigin; - disabled?: boolean; - href?: string; - hreflang?: string; - integrity?: string; - media?: string; - referrerpolicy?: HTMLReferrerPolicy; - rel?: string; - sizes?: string; - type?: string; - - // camelcase - crossOrigin?: HTMLCrossorigin; - referrerPolicy?: HTMLReferrerPolicy; - } - - interface MapHTMLAttributes extends HTMLAttributes { - name?: string; - } - - interface MediaHTMLAttributes extends HTMLAttributes { - autoplay?: boolean; - controls?: boolean; - crossorigin?: HTMLCrossorigin; - loop?: boolean; - mediagroup?: string; - muted?: boolean; - preload?: "none" | "metadata" | "auto" | ""; - src?: string; - - // camelcase - crossOrigin?: HTMLCrossorigin; - mediaGroup?: string; - } - - interface MenuHTMLAttributes extends HTMLAttributes { - label?: string; - type?: "context" | "toolbar"; - } - - interface MetaHTMLAttributes extends HTMLAttributes { - charset?: string; - content?: string; - httpequiv?: string; - name?: string; - - // camelcase - httpEquiv?: string; - } - - interface MeterHTMLAttributes extends HTMLAttributes { - form?: string; - high?: number | string; - low?: number | string; - max?: number | string; - min?: number | string; - optimum?: number | string; - value?: string | string[] | number; - } - - interface QuoteHTMLAttributes extends HTMLAttributes { - cite?: string; - } - - interface ObjectHTMLAttributes extends HTMLAttributes { - data?: string; - form?: string; - height?: number | string; - name?: string; - type?: string; - usemap?: string; - width?: number | string; - - //camelcase - useMap?: string; - } - - interface OlHTMLAttributes extends HTMLAttributes { - reversed?: boolean; - start?: number | string; - type?: "1" | "a" | "A" | "i" | "I"; - } - - interface OptgroupHTMLAttributes extends HTMLAttributes { - disabled?: boolean; - label?: string; - } - - interface OptionHTMLAttributes extends HTMLAttributes { - disabled?: boolean; - label?: string; - selected?: boolean; - value?: string | string[] | number; - } - - interface OutputHTMLAttributes extends HTMLAttributes { - form?: string; - htmlFor?: string; - for?: string; - name?: string; - } - - interface ParamHTMLAttributes extends HTMLAttributes { - name?: string; - value?: string | string[] | number; - } - - interface ProgressHTMLAttributes extends HTMLAttributes { - max?: number | string; - value?: string | string[] | number; - } - - interface ScriptHTMLAttributes extends HTMLAttributes { - async?: boolean; - charset?: string; - crossorigin?: HTMLCrossorigin; - defer?: boolean; - integrity?: string; - nomodule?: boolean; - nonce?: string; - referrerpolicy?: HTMLReferrerPolicy; - src?: string; - type?: string; - - // camelcase - crossOrigin?: HTMLCrossorigin; - noModule?: boolean; - referrerPolicy?: HTMLReferrerPolicy; - } - - interface SelectHTMLAttributes extends HTMLAttributes { - autocomplete?: string; - autofocus?: boolean; - disabled?: boolean; - form?: string; - multiple?: boolean; - name?: string; - required?: boolean; - size?: number | string; - value?: string | string[] | number; - } - - interface HTMLSlotElementAttributes extends HTMLAttributes { - name?: string; - } - - interface SourceHTMLAttributes extends HTMLAttributes { - media?: string; - sizes?: string; - src?: string; - srcset?: string; - type?: string; - } - - interface StyleHTMLAttributes extends HTMLAttributes { - media?: string; - nonce?: string; - scoped?: boolean; - type?: string; - } - - interface TdHTMLAttributes extends HTMLAttributes { - colspan?: number | string; - headers?: string; - rowspan?: number | string; - - // camelcase - colSpan?: number | string; - rowSpan?: number | string; - } - - interface TextareaHTMLAttributes extends HTMLAttributes { - autocomplete?: string; - autofocus?: boolean; - cols?: number | string; - dirname?: string; - disabled?: boolean; - form?: string; - maxlength?: number | string; - minlength?: number | string; - name?: string; - placeholder?: string; - readonly?: boolean; - required?: boolean; - rows?: number | string; - value?: string | string[] | number; - wrap?: "hard" | "soft" | "off"; - - // camelcase - maxLength?: number | string; - minLength?: number | string; - readOnly?: boolean; - } - - interface ThHTMLAttributes extends HTMLAttributes { - colspan?: number | string; - headers?: string; - rowspan?: number | string; - - // camelcase - colSpan?: number | string; - rowSpan?: number | string; - } - - interface TimeHTMLAttributes extends HTMLAttributes { - datetime?: string; - dateTime?: string; - } - - interface TrackHTMLAttributes extends HTMLAttributes { - default?: boolean; - kind?: "subtitles" | "captions" | "descriptions" | "chapters" | "metadata"; - label?: string; - src?: string; - srclang?: string; - } - - interface VideoHTMLAttributes extends MediaHTMLAttributes { - height?: number | string; - playsinline?: boolean; - poster?: string; - width?: number | string; - } - - // SVG Elements - - type SVGPreserveAspectRatio = - | "none" - | "xMinYMin" - | "xMidYMin" - | "xMaxYMin" - | "xMinYMid" - | "xMidYMid" - | "xMaxYMid" - | "xMinYMax" - | "xMidYMax" - | "xMaxYMax" - | "xMinYMin meet" - | "xMidYMin meet" - | "xMaxYMin meet" - | "xMinYMid meet" - | "xMidYMid meet" - | "xMaxYMid meet" - | "xMinYMax meet" - | "xMidYMax meet" - | "xMaxYMax meet" - | "xMinYMin slice" - | "xMidYMin slice" - | "xMaxYMin slice" - | "xMinYMid slice" - | "xMidYMid slice" - | "xMaxYMid slice" - | "xMinYMax slice" - | "xMidYMax slice" - | "xMaxYMax slice"; - - type ImagePreserveAspectRatio = - | SVGPreserveAspectRatio - | "defer none" - | "defer xMinYMin" - | "defer xMidYMin" - | "defer xMaxYMin" - | "defer xMinYMid" - | "defer xMidYMid" - | "defer xMaxYMid" - | "defer xMinYMax" - | "defer xMidYMax" - | "defer xMaxYMax" - | "defer xMinYMin meet" - | "defer xMidYMin meet" - | "defer xMaxYMin meet" - | "defer xMinYMid meet" - | "defer xMidYMid meet" - | "defer xMaxYMid meet" - | "defer xMinYMax meet" - | "defer xMidYMax meet" - | "defer xMaxYMax meet" - | "defer xMinYMin slice" - | "defer xMidYMin slice" - | "defer xMaxYMin slice" - | "defer xMinYMid slice" - | "defer xMidYMid slice" - | "defer xMaxYMid slice" - | "defer xMinYMax slice" - | "defer xMidYMax slice" - | "defer xMaxYMax slice"; - - type SVGUnits = "userSpaceOnUse" | "objectBoundingBox"; - - interface CoreSVGAttributes extends DOMAttributes { - id?: string; - lang?: string; - tabIndex?: number | string; - tabindex?: number | string; - } - - interface StylableSVGAttributes { - class?: string; - className?: string; - style?: CSSProperties | string; - } - - interface TransformableSVGAttributes { - transform?: string; - } - - // Fix when namespaces introduced - // interface XLinkSVGAttributes { - // xlinkActuate?: string; - // xlinkArcrole?: string; - // xlinkHref?: string; - // xlinkRole?: string; - // xlinkShow?: string; - // xlinkTitle?: string; - // xlinkType?: string; - // } - - interface ConditionalProcessingSVGAttributes { - requiredExtensions?: string; - requiredFeatures?: string; - systemLanguage?: string; - } - - interface ExternalResourceSVGAttributes { - externalResourcesRequired?: "true" | "false"; - } - - interface AnimationTimingSVGAttributes { - begin?: string; - dur?: string; - end?: string; - min?: string; - max?: string; - restart?: "always" | "whenNotActive" | "never"; - repeatCount?: number | "indefinite"; - repeatDur?: string; - fill?: "freeze" | "remove"; - } - - interface AnimationValueSVGAttributes { - calcMode?: "discrete" | "linear" | "paced" | "spline"; - values?: string; - keyTimes?: string; - keySplines?: string; - from?: number | string; - to?: number | string; - by?: number | string; - } - - interface AnimationAdditionSVGAttributes { - attributeName?: string; - additive?: "replace" | "sum"; - accumulate?: "none" | "sum"; - } - - interface AnimationAttributeTargetSVGAttributes { - attributeName?: string; - attributeType?: "CSS" | "XML" | "auto"; - } - - interface PresentationSVGAttributes { - "alignment-baseline"?: - | "auto" - | "baseline" - | "before-edge" - | "text-before-edge" - | "middle" - | "central" - | "after-edge" - | "text-after-edge" - | "ideographic" - | "alphabetic" - | "hanging" - | "mathematical" - | "inherit"; - "baseline-shift"?: number | string; - clip?: string; - "clip-path"?: string; - "clip-rule"?: "nonzero" | "evenodd" | "inherit"; - color?: string; - "color-interpolation"?: "auto" | "sRGB" | "linearRGB" | "inherit"; - "color-interpolation-filters"?: "auto" | "sRGB" | "linearRGB" | "inherit"; - "color-profile"?: string; - "color-rendering"?: "auto" | "optimizeSpeed" | "optimizeQuality" | "inherit"; - cursor?: string; - direction?: "ltr" | "rtl" | "inherit"; - display?: string; - "dominant-baseline"?: - | "auto" - | "text-bottom" - | "alphabetic" - | "ideographic" - | "middle" - | "central" - | "mathematical" - | "hanging" - | "text-top" - | "inherit"; - "enable-background"?: string; - fill?: string; - "fill-opacity"?: number | string | "inherit"; - "fill-rule"?: "nonzero" | "evenodd" | "inherit"; - filter?: string; - "flood-color"?: string; - "flood-opacity"?: number | string | "inherit"; - "font-family"?: string; - "font-size"?: string; - "font-size-adjust"?: number | string; - "font-stretch"?: string; - "font-style"?: "normal" | "italic" | "oblique" | "inherit"; - "font-variant"?: string; - "font-weight"?: number | string; - "glyph-orientation-horizontal"?: string; - "glyph-orientation-vertical"?: string; - "image-rendering"?: "auto" | "optimizeQuality" | "optimizeSpeed" | "inherit"; - kerning?: string; - "letter-spacing"?: number | string; - "lighting-color"?: string; - "marker-end"?: string; - "marker-mid"?: string; - "marker-start"?: string; - mask?: string; - opacity?: number | string | "inherit"; - overflow?: "visible" | "hidden" | "scroll" | "auto" | "inherit"; - "pointer-events"?: - | "bounding-box" - | "visiblePainted" - | "visibleFill" - | "visibleStroke" - | "visible" - | "painted" - | "color" - | "fill" - | "stroke" - | "all" - | "none" - | "inherit"; - "shape-rendering"?: - | "auto" - | "optimizeSpeed" - | "crispEdges" - | "geometricPrecision" - | "inherit"; - "stop-color"?: string; - "stop-opacity"?: number | string | "inherit"; - stroke?: string; - "stroke-dasharray"?: string; - "stroke-dashoffset"?: number | string; - "stroke-linecap"?: "butt" | "round" | "square" | "inherit"; - "stroke-linejoin"?: "arcs" | "bevel" | "miter" | "miter-clip" | "round" | "inherit"; - "stroke-miterlimit"?: number | string | "inherit"; - "stroke-opacity"?: number | string | "inherit"; - "stroke-width"?: number | string; - "text-anchor"?: "start" | "middle" | "end" | "inherit"; - "text-decoration"?: "none" | "underline" | "overline" | "line-through" | "blink" | "inherit"; - "text-rendering"?: - | "auto" - | "optimizeSpeed" - | "optimizeLegibility" - | "geometricPrecision" - | "inherit"; - "unicode-bidi"?: string; - visibility?: "visible" | "hidden" | "collapse" | "inherit"; - "word-spacing"?: number | string; - "writing-mode"?: "lr-tb" | "rl-tb" | "tb-rl" | "lr" | "rl" | "tb" | "inherit"; - } - - interface AnimationElementSVGAttributes - extends CoreSVGAttributes, - ExternalResourceSVGAttributes, - ConditionalProcessingSVGAttributes {} - - interface ContainerElementSVGAttributes - extends CoreSVGAttributes, - Pick< - PresentationSVGAttributes, - | "clip-path" - | "mask" - | "cursor" - | "opacity" - | "filter" - | "enable-background" - | "color-interpolation" - | "color-rendering" - > {} - - interface FilterPrimitiveElementSVGAttributes - extends CoreSVGAttributes, - Pick { - x?: number | string; - y?: number | string; - width?: number | string; - height?: number | string; - result?: string; - } - - interface SingleInputFilterSVGAttributes { - in?: string; - } - - interface DoubleInputFilterSVGAttributes { - in?: string; - in2?: string; - } - - interface FitToViewBoxSVGAttributes { - viewBox?: string; - preserveAspectRatio?: SVGPreserveAspectRatio; - } - - interface GradientElementSVGAttributes - extends CoreSVGAttributes, - // XLinkSVGAttributes, - ExternalResourceSVGAttributes, - StylableSVGAttributes { - gradientUnits?: SVGUnits; - gradientTransform?: string; - spreadMethod?: "pad" | "reflect" | "repeat"; - } - - interface GraphicsElementSVGAttributes - extends CoreSVGAttributes, - Pick< - PresentationSVGAttributes, - | "clip-rule" - | "mask" - | "pointer-events" - | "cursor" - | "opacity" - | "filter" - | "display" - | "visibility" - | "color-interpolation" - | "color-rendering" - > {} - - interface LightSourceElementSVGAttributes extends CoreSVGAttributes {} - - interface NewViewportSVGAttributes - extends CoreSVGAttributes, - Pick { - viewBox?: string; - } - - interface ShapeElementSVGAttributes - extends CoreSVGAttributes, - Pick< - PresentationSVGAttributes, - | "color" - | "fill" - | "fill-rule" - | "fill-opacity" - | "stroke" - | "stroke-width" - | "stroke-linecap" - | "stroke-linejoin" - | "stroke-miterlimit" - | "stroke-dasharray" - | "stroke-dashoffset" - | "stroke-opacity" - | "shape-rendering" - > {} - - interface TextContentElementSVGAttributes - extends CoreSVGAttributes, - Pick< - PresentationSVGAttributes, - | "font-family" - | "font-style" - | "font-variant" - | "font-weight" - | "font-stretch" - | "font-size" - | "font-size-adjust" - | "kerning" - | "letter-spacing" - | "word-spacing" - | "text-decoration" - | "glyph-orientation-horizontal" - | "glyph-orientation-vertical" - | "direction" - | "unicode-bidi" - | "text-anchor" - | "dominant-baseline" - | "color" - | "fill" - | "fill-rule" - | "fill-opacity" - | "stroke" - | "stroke-width" - | "stroke-linecap" - | "stroke-linejoin" - | "stroke-miterlimit" - | "stroke-dasharray" - | "stroke-dashoffset" - | "stroke-opacity" - > {} - - interface ZoomAndPanSVGAttributes { - zoomAndPan?: "disable" | "magnify"; - } - - interface AnimateSVGAttributes - extends AnimationElementSVGAttributes, - // XLinkSVGAttributes, - AnimationAttributeTargetSVGAttributes, - AnimationTimingSVGAttributes, - AnimationValueSVGAttributes, - AnimationAdditionSVGAttributes, - Pick {} - - interface AnimateMotionSVGAttributes - extends AnimationElementSVGAttributes, - // XLinkSVGAttributes, - AnimationTimingSVGAttributes, - AnimationValueSVGAttributes, - AnimationAdditionSVGAttributes { - path?: string; - keyPoints?: string; - rotate?: number | string | "auto" | "auto-reverse"; - origin?: "default"; - } - - interface AnimateTransformSVGAttributes - extends AnimationElementSVGAttributes, - // XLinkSVGAttributes, - AnimationAttributeTargetSVGAttributes, - AnimationTimingSVGAttributes, - AnimationValueSVGAttributes, - AnimationAdditionSVGAttributes { - type?: "translate" | "scale" | "rotate" | "skewX" | "skewY"; - } - - interface CircleSVGAttributes - extends GraphicsElementSVGAttributes, - ShapeElementSVGAttributes, - ConditionalProcessingSVGAttributes, - StylableSVGAttributes, - TransformableSVGAttributes { - cx?: number | string; - cy?: number | string; - r?: number | string; - } - - interface ClipPathSVGAttributes - extends CoreSVGAttributes, - ConditionalProcessingSVGAttributes, - ExternalResourceSVGAttributes, - StylableSVGAttributes, - TransformableSVGAttributes, - Pick { - clipPathUnits?: SVGUnits; - } - - interface DefsSVGAttributes - extends ContainerElementSVGAttributes, - ConditionalProcessingSVGAttributes, - ExternalResourceSVGAttributes, - StylableSVGAttributes, - TransformableSVGAttributes {} - - interface DescSVGAttributes extends CoreSVGAttributes, StylableSVGAttributes {} - - interface EllipseSVGAttributes - extends GraphicsElementSVGAttributes, - ShapeElementSVGAttributes, - ConditionalProcessingSVGAttributes, - ExternalResourceSVGAttributes, - StylableSVGAttributes, - TransformableSVGAttributes { - cx?: number | string; - cy?: number | string; - rx?: number | string; - ry?: number | string; - } - - interface FeBlendSVGAttributes - extends FilterPrimitiveElementSVGAttributes, - DoubleInputFilterSVGAttributes, - StylableSVGAttributes { - mode?: "normal" | "multiply" | "screen" | "darken" | "lighten"; - } - - interface FeColorMatrixSVGAttributes - extends FilterPrimitiveElementSVGAttributes, - SingleInputFilterSVGAttributes, - StylableSVGAttributes { - type?: "matrix" | "saturate" | "hueRotate" | "luminanceToAlpha"; - values?: string; - } - - interface FeComponentTransferSVGAttributes - extends FilterPrimitiveElementSVGAttributes, - SingleInputFilterSVGAttributes, - StylableSVGAttributes {} - - interface FeCompositeSVGAttributes - extends FilterPrimitiveElementSVGAttributes, - DoubleInputFilterSVGAttributes, - StylableSVGAttributes { - operator?: "over" | "in" | "out" | "atop" | "xor" | "arithmetic"; - k1?: number | string; - k2?: number | string; - k3?: number | string; - k4?: number | string; - } - - interface FeConvolveMatrixSVGAttributes - extends FilterPrimitiveElementSVGAttributes, - SingleInputFilterSVGAttributes, - StylableSVGAttributes { - order?: number | string; - kernelMatrix?: string; - divisor?: number | string; - bias?: number | string; - targetX?: number | string; - targetY?: number | string; - edgeMode?: "duplicate" | "wrap" | "none"; - kernelUnitLength?: number | string; - preserveAlpha?: "true" | "false"; - } - - interface FeDiffuseLightingSVGAttributes - extends FilterPrimitiveElementSVGAttributes, - SingleInputFilterSVGAttributes, - StylableSVGAttributes, - Pick { - surfaceScale?: number | string; - diffuseConstant?: number | string; - kernelUnitLength?: number | string; - } - - interface FeDisplacementMapSVGAttributes - extends FilterPrimitiveElementSVGAttributes, - DoubleInputFilterSVGAttributes, - StylableSVGAttributes { - scale?: number | string; - xChannelSelector?: "R" | "G" | "B" | "A"; - yChannelSelector?: "R" | "G" | "B" | "A"; - } - - interface FeDistantLightSVGAttributes extends LightSourceElementSVGAttributes { - azimuth?: number | string; - elevation?: number | string; - } - - interface FeFloodSVGAttributes - extends FilterPrimitiveElementSVGAttributes, - StylableSVGAttributes, - Pick {} - - interface FeFuncSVGAttributes extends CoreSVGAttributes { - type?: "identity" | "table" | "discrete" | "linear" | "gamma"; - tableValues?: string; - slope?: number | string; - intercept?: number | string; - amplitude?: number | string; - exponent?: number | string; - offset?: number | string; - } - - interface FeGaussianBlurSVGAttributes - extends FilterPrimitiveElementSVGAttributes, - SingleInputFilterSVGAttributes, - StylableSVGAttributes { - stdDeviation?: number | string; - } - - interface FeImageSVGAttributes - extends FilterPrimitiveElementSVGAttributes, - // XLinkSVGAttributes, - ExternalResourceSVGAttributes, - StylableSVGAttributes { - preserveAspectRatio: SVGPreserveAspectRatio; - } - - interface FeMergeSVGAttributes - extends FilterPrimitiveElementSVGAttributes, - StylableSVGAttributes {} - - interface FeMergeNodeSVGAttributes - extends CoreSVGAttributes, - SingleInputFilterSVGAttributes {} - - interface FeMorphologySVGAttributes - extends FilterPrimitiveElementSVGAttributes, - SingleInputFilterSVGAttributes, - StylableSVGAttributes { - operator?: "erode" | "dilate"; - radius?: number | string; - } - - interface FeOffsetSVGAttributes - extends FilterPrimitiveElementSVGAttributes, - SingleInputFilterSVGAttributes, - StylableSVGAttributes { - dx?: number | string; - dy?: number | string; - } - - interface FePointLightSVGAttributes extends LightSourceElementSVGAttributes { - x?: number | string; - y?: number | string; - z?: number | string; - } - - interface FeSpecularLightingSVGAttributes - extends FilterPrimitiveElementSVGAttributes, - SingleInputFilterSVGAttributes, - StylableSVGAttributes, - Pick { - surfaceScale?: string; - specularConstant?: string; - specularExponent?: string; - kernelUnitLength?: number | string; - } - - interface FeSpotLightSVGAttributes extends LightSourceElementSVGAttributes { - x?: number | string; - y?: number | string; - z?: number | string; - pointsAtX?: number | string; - pointsAtY?: number | string; - pointsAtZ?: number | string; - specularExponent?: number | string; - limitingConeAngle?: number | string; - } - - interface FeTileSVGAttributes - extends FilterPrimitiveElementSVGAttributes, - SingleInputFilterSVGAttributes, - StylableSVGAttributes {} - - interface FeTurbulanceSVGAttributes - extends FilterPrimitiveElementSVGAttributes, - StylableSVGAttributes { - baseFrequency?: number | string; - numOctaves?: number | string; - seed?: number | string; - stitchTiles?: "stitch" | "noStitch"; - type?: "fractalNoise" | "turbulence"; - } - - interface FilterSVGAttributes - extends CoreSVGAttributes, - // XLinkSVGAttributes, - ExternalResourceSVGAttributes, - StylableSVGAttributes { - filterUnits?: SVGUnits; - primitiveUnits?: SVGUnits; - x?: number | string; - y?: number | string; - width?: number | string; - height?: number | string; - filterRes?: number | string; - } - - interface ForeignObjectSVGAttributes - extends NewViewportSVGAttributes, - ConditionalProcessingSVGAttributes, - ExternalResourceSVGAttributes, - StylableSVGAttributes, - TransformableSVGAttributes, - Pick { - x?: number | string; - y?: number | string; - width?: number | string; - height?: number | string; - } - - interface GSVGAttributes - extends ContainerElementSVGAttributes, - ConditionalProcessingSVGAttributes, - ExternalResourceSVGAttributes, - StylableSVGAttributes, - TransformableSVGAttributes, - Pick {} - - interface ImageSVGAttributes - extends NewViewportSVGAttributes, - GraphicsElementSVGAttributes, - ConditionalProcessingSVGAttributes, - // XLinkSVGAttributes, - StylableSVGAttributes, - TransformableSVGAttributes, - Pick { - x?: number | string; - y?: number | string; - width?: number | string; - height?: number | string; - preserveAspectRatio?: ImagePreserveAspectRatio; - } - - interface LineSVGAttributes - extends GraphicsElementSVGAttributes, - ShapeElementSVGAttributes, - ConditionalProcessingSVGAttributes, - ExternalResourceSVGAttributes, - StylableSVGAttributes, - TransformableSVGAttributes, - Pick { - x1?: number | string; - y1?: number | string; - x2?: number | string; - y2?: number | string; - } - - interface LinearGradientSVGAttributes extends GradientElementSVGAttributes { - x1?: number | string; - x2?: number | string; - y1?: number | string; - y2?: number | string; - } - - interface MarkerSVGAttributes - extends ContainerElementSVGAttributes, - ExternalResourceSVGAttributes, - StylableSVGAttributes, - FitToViewBoxSVGAttributes, - Pick { - markerUnits?: "strokeWidth" | "userSpaceOnUse"; - refX?: number | string; - refY?: number | string; - markerWidth?: number | string; - markerHeight?: number | string; - orient?: string; - } - - interface MaskSVGAttributes - extends Omit, "opacity" | "filter">, - ConditionalProcessingSVGAttributes, - ExternalResourceSVGAttributes, - StylableSVGAttributes { - maskUnits?: SVGUnits; - maskContentUnits?: SVGUnits; - x?: number | string; - y?: number | string; - width?: number | string; - height?: number | string; - } - - interface MetadataSVGAttributes extends CoreSVGAttributes {} - - interface PathSVGAttributes - extends GraphicsElementSVGAttributes, - ShapeElementSVGAttributes, - ConditionalProcessingSVGAttributes, - ExternalResourceSVGAttributes, - StylableSVGAttributes, - TransformableSVGAttributes, - Pick { - d?: string; - pathLength?: number | string; - } - - interface PatternSVGAttributes - extends ContainerElementSVGAttributes, - ConditionalProcessingSVGAttributes, - // XLinkSVGAttributes, - ExternalResourceSVGAttributes, - StylableSVGAttributes, - FitToViewBoxSVGAttributes, - Pick { - x?: number | string; - y?: number | string; - width?: number | string; - height?: number | string; - patternUnits?: SVGUnits; - patternContentUnits?: SVGUnits; - patternTransform?: string; - } - - interface PolygonSVGAttributes - extends GraphicsElementSVGAttributes, - ShapeElementSVGAttributes, - ConditionalProcessingSVGAttributes, - ExternalResourceSVGAttributes, - StylableSVGAttributes, - TransformableSVGAttributes, - Pick { - points?: string; - } - - interface PolylineSVGAttributes - extends GraphicsElementSVGAttributes, - ShapeElementSVGAttributes, - ConditionalProcessingSVGAttributes, - ExternalResourceSVGAttributes, - StylableSVGAttributes, - TransformableSVGAttributes, - Pick { - points?: string; - } - - interface RadialGradientSVGAttributes extends GradientElementSVGAttributes { - cx?: number | string; - cy?: number | string; - r?: number | string; - fx?: number | string; - fy?: number | string; - } - - interface RectSVGAttributes - extends GraphicsElementSVGAttributes, - ShapeElementSVGAttributes, - ConditionalProcessingSVGAttributes, - ExternalResourceSVGAttributes, - StylableSVGAttributes, - TransformableSVGAttributes { - x?: number | string; - y?: number | string; - width?: number | string; - height?: number | string; - rx?: number | string; - ry?: number | string; - } - - interface StopSVGAttributes - extends CoreSVGAttributes, - StylableSVGAttributes, - Pick { - offset?: number | string; - } - - interface SvgSVGAttributes - extends ContainerElementSVGAttributes, - NewViewportSVGAttributes, - ConditionalProcessingSVGAttributes, - ExternalResourceSVGAttributes, - StylableSVGAttributes, - FitToViewBoxSVGAttributes, - ZoomAndPanSVGAttributes, - Pick { - version?: string; - "base-profile"?: string; - x?: number | string; - y?: number | string; - width?: number | string; - height?: number | string; - contentScriptType?: string; - contentStyleType?: string; - } - - interface SwitchSVGAttributes - extends ContainerElementSVGAttributes, - ConditionalProcessingSVGAttributes, - ExternalResourceSVGAttributes, - StylableSVGAttributes, - TransformableSVGAttributes, - Pick {} - - interface SymbolSVGAttributes - extends ContainerElementSVGAttributes, - NewViewportSVGAttributes, - ExternalResourceSVGAttributes, - StylableSVGAttributes, - FitToViewBoxSVGAttributes {} - - interface TextSVGAttributes - extends TextContentElementSVGAttributes, - GraphicsElementSVGAttributes, - ConditionalProcessingSVGAttributes, - ExternalResourceSVGAttributes, - StylableSVGAttributes, - TransformableSVGAttributes, - Pick { - x?: number | string; - y?: number | string; - dx?: number | string; - dy?: number | string; - rotate?: number | string; - textLength?: number | string; - lengthAdjust?: "spacing" | "spacingAndGlyphs"; - } - - interface TextPathSVGAttributes - extends TextContentElementSVGAttributes, - ConditionalProcessingSVGAttributes, - // XLinkSVGAttributes, - ExternalResourceSVGAttributes, - StylableSVGAttributes, - Pick< - PresentationSVGAttributes, - "alignment-baseline" | "baseline-shift" | "display" | "visibility" - > { - startOffset?: number | string; - method?: "align" | "stretch"; - spacing?: "auto" | "exact"; - } - - interface TSpanSVGAttributes - extends TextContentElementSVGAttributes, - ConditionalProcessingSVGAttributes, - ExternalResourceSVGAttributes, - StylableSVGAttributes, - Pick< - PresentationSVGAttributes, - "alignment-baseline" | "baseline-shift" | "display" | "visibility" - > { - x?: number | string; - y?: number | string; - dx?: number | string; - dy?: number | string; - rotate?: number | string; - textLength?: number | string; - lengthAdjust?: "spacing" | "spacingAndGlyphs"; - } - - interface UseSVGAttributes - extends GraphicsElementSVGAttributes, - ConditionalProcessingSVGAttributes, - // XLinkSVGAttributes, - ExternalResourceSVGAttributes, - StylableSVGAttributes, - TransformableSVGAttributes { - x?: number | string; - y?: number | string; - width?: number | string; - height?: number | string; - } - - interface ViewSVGAttributes - extends CoreSVGAttributes, - ExternalResourceSVGAttributes, - FitToViewBoxSVGAttributes, - ZoomAndPanSVGAttributes { - viewTarget?: string; - } - - interface IntrinsicElements { - // HTML - a: AnchorHTMLAttributes; - abbr: HTMLAttributes; - address: HTMLAttributes; - area: AreaHTMLAttributes; - article: HTMLAttributes; - aside: HTMLAttributes; - audio: AudioHTMLAttributes; - b: HTMLAttributes; - base: BaseHTMLAttributes; - bdi: HTMLAttributes; - bdo: HTMLAttributes; - big: HTMLAttributes; - blockquote: BlockquoteHTMLAttributes; - body: HTMLAttributes; - br: HTMLAttributes; - button: ButtonHTMLAttributes; - canvas: CanvasHTMLAttributes; - caption: HTMLAttributes; - cite: HTMLAttributes; - code: HTMLAttributes; - col: ColHTMLAttributes; - colgroup: ColgroupHTMLAttributes; - data: DataHTMLAttributes; - datalist: HTMLAttributes; - dd: HTMLAttributes; - del: HTMLAttributes; - details: DetailsHtmlAttributes; - dfn: HTMLAttributes; - dialog: DialogHtmlAttributes; - div: HTMLAttributes; - dl: HTMLAttributes; - dt: HTMLAttributes; - em: HTMLAttributes; - embed: EmbedHTMLAttributes; - fieldset: FieldsetHTMLAttributes; - figcaption: HTMLAttributes; - figure: HTMLAttributes; - footer: HTMLAttributes; - form: FormHTMLAttributes; - h1: HTMLAttributes; - h2: HTMLAttributes; - h3: HTMLAttributes; - h4: HTMLAttributes; - h5: HTMLAttributes; - h6: HTMLAttributes; - head: HTMLAttributes; - header: HTMLAttributes; - hgroup: HTMLAttributes; - hr: HTMLAttributes; - html: HTMLAttributes; - i: HTMLAttributes; - iframe: IframeHTMLAttributes; - img: ImgHTMLAttributes; - input: InputHTMLAttributes; - ins: InsHTMLAttributes; - kbd: HTMLAttributes; - keygen: KeygenHTMLAttributes; - label: LabelHTMLAttributes; - legend: HTMLAttributes; - li: LiHTMLAttributes; - link: LinkHTMLAttributes; - main: HTMLAttributes; - map: MapHTMLAttributes; - mark: HTMLAttributes; - menu: MenuHTMLAttributes; - menuitem: HTMLAttributes; - meta: MetaHTMLAttributes; - meter: MeterHTMLAttributes; - nav: HTMLAttributes; - noindex: HTMLAttributes; - noscript: HTMLAttributes; - object: ObjectHTMLAttributes; - ol: OlHTMLAttributes; - optgroup: OptgroupHTMLAttributes; - option: OptionHTMLAttributes; - output: OutputHTMLAttributes; - p: HTMLAttributes; - param: ParamHTMLAttributes; - picture: HTMLAttributes; - pre: HTMLAttributes; - progress: ProgressHTMLAttributes; - q: QuoteHTMLAttributes; - rp: HTMLAttributes; - rt: HTMLAttributes; - ruby: HTMLAttributes; - s: HTMLAttributes; - samp: HTMLAttributes; - script: ScriptHTMLAttributes; - section: HTMLAttributes; - select: SelectHTMLAttributes; - slot: HTMLSlotElementAttributes; - small: HTMLAttributes; - source: SourceHTMLAttributes; - span: HTMLAttributes; - strong: HTMLAttributes; - style: StyleHTMLAttributes; - sub: HTMLAttributes; - summary: HTMLAttributes; - sup: HTMLAttributes; - table: HTMLAttributes; - tbody: HTMLAttributes; - td: TdHTMLAttributes; - textarea: TextareaHTMLAttributes; - tfoot: HTMLAttributes; - th: ThHTMLAttributes; - thead: HTMLAttributes; - time: TimeHTMLAttributes; - title: HTMLAttributes; - tr: HTMLAttributes; - track: TrackHTMLAttributes; - u: HTMLAttributes; - ul: HTMLAttributes; - var: HTMLAttributes; - video: VideoHTMLAttributes; - wbr: HTMLAttributes; - - // SVG - svg: SvgSVGAttributes; - - animate: AnimateSVGAttributes; - animateMotion: AnimateMotionSVGAttributes; - animateTransform: AnimateTransformSVGAttributes; - circle: CircleSVGAttributes; - clipPath: ClipPathSVGAttributes; - defs: DefsSVGAttributes; - desc: DescSVGAttributes; - ellipse: EllipseSVGAttributes; - feBlend: FeBlendSVGAttributes; - feColorMatrix: FeColorMatrixSVGAttributes; - feComponentTransfer: FeComponentTransferSVGAttributes; - feComposite: FeCompositeSVGAttributes; - feConvolveMatrix: FeConvolveMatrixSVGAttributes; - feDiffuseLighting: FeDiffuseLightingSVGAttributes; - feDisplacementMap: FeDisplacementMapSVGAttributes; - feDistantLight: FeDistantLightSVGAttributes; - feFlood: FeFloodSVGAttributes; - feFuncA: FeFuncSVGAttributes; - feFuncB: FeFuncSVGAttributes; - feFuncG: FeFuncSVGAttributes; - feFuncR: FeFuncSVGAttributes; - feGaussianBlur: FeGaussianBlurSVGAttributes; - feImage: FeImageSVGAttributes; - feMerge: FeMergeSVGAttributes; - feMergeNode: FeMergeNodeSVGAttributes; - feMorphology: FeMorphologySVGAttributes; - feOffset: FeOffsetSVGAttributes; - fePointLight: FePointLightSVGAttributes; - feSpecularLighting: FeSpecularLightingSVGAttributes; - feSpotLight: FeSpotLightSVGAttributes; - feTile: FeTileSVGAttributes; - feTurbulence: FeTurbulanceSVGAttributes; - filter: FilterSVGAttributes; - foreignObject: ForeignObjectSVGAttributes; - g: GSVGAttributes; - image: ImageSVGAttributes; - line: LineSVGAttributes; - linearGradient: LinearGradientSVGAttributes; - marker: MarkerSVGAttributes; - mask: MaskSVGAttributes; - metadata: MetadataSVGAttributes; - path: PathSVGAttributes; - pattern: PatternSVGAttributes; - polygon: PolygonSVGAttributes; - polyline: PolylineSVGAttributes; - radialGradient: RadialGradientSVGAttributes; - rect: RectSVGAttributes; - stop: StopSVGAttributes; - switch: SwitchSVGAttributes; - symbol: SymbolSVGAttributes; - text: TextSVGAttributes; - textPath: TextPathSVGAttributes; - tspan: TSpanSVGAttributes; - use: UseSVGAttributes; - view: ViewSVGAttributes; - } - } -} - -export {}; diff --git a/src/lib.ts b/src/lib.ts index 98bc0ff..d4c9c2b 100644 --- a/src/lib.ts +++ b/src/lib.ts @@ -1,4 +1,5 @@ -import { autorun, computed, untracked, $mobx, IObservableArray, observable, action } from "mobx"; +import { autorun, computed, untracked, $mobx, IObservableArray, observable, action, IObservableValue } from "mobx"; +import type { JSX } from "./jsx" type ContextOwner = { disposables: any[]; @@ -80,6 +81,34 @@ export function memo(fn: () => T, equal?: boolean) { return () => o.get(); } +export function createSelector( + source: () => T, + fn: (a: U, b: T) => boolean = (a, b) => a === b +){ + let subs = new Map(); + let v: T; + effect((p?: U) => { + v = source(); + const keys = [...subs.keys()]; + for (let i = 0, len = keys.length; i < len; i++) { + const key = keys[i]; + if (fn(key, v) || p !== undefined && fn(key, p)) { + const o = subs.get(key); + o.set(null); + } + } + return v as U; + }); + return (key: U) => { + let l: IObservableValue & { _count?: number }; + if (!(l = subs.get(key))) subs.set(key, l = observable.box()); + l.get(); + l._count ? (l._count++) : (l._count = 1); + cleanup(() => l._count! > 1 ? l._count!-- : subs.delete(key)) + return fn(key, v); + }; +} + type PropsWithChildren

= P & { children?: JSX.Element }; export type FunctionComponent

= (props: PropsWithChildren

) => JSX.Element; type ComponentConstructor

= @@ -119,22 +148,6 @@ export function lazy(fn: () => Promise<{ default: T }>) { }; } -export function assignProps(target: T, source: U): T & U; -export function assignProps(target: T, source1: U, source2: V): T & U & V; -export function assignProps( - target: T, - source1: U, - source2: V, - source3: W -): T & U & V & W; -export function assignProps(target: any, ...sources: any): any { - for (let i = 0; i < sources.length; i++) { - const descriptors = Object.getOwnPropertyDescriptors(sources[i]); - Object.defineProperties(target, descriptors); - } - return target; -} - export function splitProps( props: T, ...keys: [K1[]] @@ -259,7 +272,7 @@ export function map( let newItems = fn ? (list as () => Array)() : list as T[], i: number, j: number; - !fn && (list as IObservableArray & { [$mobx]: any })[$mobx].atom.reportObserved(); + !fn && (list as IObservableArray & { [$mobx]: any })[$mobx].atom_.reportObserved(); return untracked(() => { let newLen = newItems.length, newIndices: Map, diff --git a/src/runtime.d.ts b/src/runtime.d.ts deleted file mode 100644 index 1c7243b..0000000 --- a/src/runtime.d.ts +++ /dev/null @@ -1,56 +0,0 @@ -type MountableElement = Element | Document | ShadowRoot | DocumentFragment | Node; -export function render(code: () => any, element: MountableElement): () => void; -export function hydrate(fn: () => unknown, node: MountableElement): void; - -export function template(html: string, count: number, isSVG?: boolean): Element; -export function effect(fn: (prev?: T) => T, init?: T): any; -export function memo(fn: () => T, equal: boolean): () => T; -export function insert( - parent: MountableElement, - accessor: any, - marker?: Node | null, - init?: any -): any; -export function createComponent(Comp: (props: any) => any, props: any): any; -export function delegateEvents(eventNames: string[]): void; -export function clearDelegatedEvents(): void; -export function spread(node: Element, accessor: any, isSVG?: Boolean, skipChildren?: Boolean): void; -export function assign(node: Element, props: any, isSVG?: Boolean, skipChildren?: Boolean): void; -export function setAttribute(node: Element, name: string, value: any): void; -export function setAttributeNS(node: Element, namespace: string, name: string, value: any): void; -export function classList( - node: Element, - value: { [k: string]: boolean }, - prev?: { [k: string]: boolean } -): void; -export function style( - node: Element, - value: { [k: string]: string }, - prev?: { [k: string]: string } -): void; -export function currentContext(): any; -export function dynamicProperty(props: any, key: string): any; -export function assignProps(target: any, ...sources: any): any - -export function getHydrationKey(): string; -export function getNextElement(template: HTMLTemplateElement, isSSR: boolean): Node; -export function getNextMarker(start: Node): [Node, Array]; -export function generateHydrationScript(options?: { eventNames?: string[], streaming?: boolean, resolved?: boolean }): string; - -export function ssrClassList(value: { [k: string]: boolean }): string; -export function ssrStyle(value: { [k: string]: string }): string; -export function ssrSpread(accessor: any): () => string; -export function escape(html: string): string; - -declare type AttributeInfo = { - [key: string]: { - type: string; - alias?: string; - }; -}; -export const Aliases: Record; -export const Properties: Set; -export const ChildProperties: Set; -export const NonComposedEvents: Set; -export const SVGElements: Set; -export const SVGNamespace: Record; diff --git a/src/runtime.js b/src/runtime.js deleted file mode 100644 index 65e55b7..0000000 --- a/src/runtime.js +++ /dev/null @@ -1 +0,0 @@ -export * from "dom-expressions/src/runtime"; \ No newline at end of file From 865f9a1caa7537de74c788550653f7f30ef6341e Mon Sep 17 00:00:00 2001 From: Shawn Van Ittersum Date: Sat, 17 Apr 2021 00:27:44 +0700 Subject: [PATCH 33/38] Update README.md Fix spelling --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3b4c319..1b6f7a6 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # MobX JSX -This library is a demonstration of how MobX fine grain control can be leveraged directly in JSX for considerably better performance than pairing it with a Virtual DOM library. Even the fastest Virtual DOM library will have overhead when reconciling many small discreet changes into a scheduled render and patch. +This library is a demonstration of how MobX fine grain control can be leveraged directly in JSX for considerably better performance than pairing it with a Virtual DOM library. Even the fastest Virtual DOM library will have overhead when reconciling many small discrete changes into a scheduled render and patch. Check out MobX JSX performance near the top of the charts on the [JS Frameworks Benchmark](https://github.com/krausest/js-framework-benchmark). From 3b3faa33ef663e7f653e3391c3833d86ad3d7258 Mon Sep 17 00:00:00 2001 From: Ryan Carniato Date: Thu, 29 Apr 2021 01:26:38 -0700 Subject: [PATCH 34/38] Update to the latest --- README.md | 66 ++++++++++++++++++++++++++--------------------- package-lock.json | 54 +++++++++++++++++++------------------- package.json | 8 +++--- src/jsx.d.ts | 64 +++++++++++++++++++++++++++++++-------------- 4 files changed, 114 insertions(+), 78 deletions(-) diff --git a/README.md b/README.md index 3b4c319..d9c8a57 100644 --- a/README.md +++ b/README.md @@ -11,9 +11,9 @@ It accomplishes this with using [Babel Plugin JSX DOM Expressions](https://githu To use call render as follow ```js -import { render } from 'mobx-jsx'; +import { render } from "mobx-jsx"; -render(App, document.getElementById('main')); +render(App, document.getElementById("main")); ``` And include 'babel-plugin-jsx-dom-expressions' in your babelrc, webpack babel loader, or rollup babel plugin. @@ -21,12 +21,14 @@ And include 'babel-plugin-jsx-dom-expressions' in your babelrc, webpack babel lo ```js "plugins": [["babel-plugin-jsx-dom-expressions", {moduleName: 'mobx-jsx'}]] ``` + See [plugin options](https://github.com/ryansolid/dom-expressions/tree/master/packages/babel-plugin-jsx-dom-expressions#plugin-options) For TS JSX types add to your `tsconfig.json`: + ```js "jsx": "preserve", -"jsxImportSource": "mobx-jsx" +"jsxImportSource": "mobx-jsx" ``` ## Installation @@ -55,42 +57,46 @@ import { map } from "mobx-jsx"; const list = observable(["Alpha", "Beta", "Gamma"]); -

    { - map(list, item =>
  • {item}
  • ) -}
+
    + {map(list, item => ( +
  • {item}
  • + ))} +
; ``` -### Lifecycles +### Lifecycles -Unlike React `render` only runs once, so you may not need to split in functions or methods your Lifecycles, all the initialization code could be set on `render`. See the issue [Lifecycles](https://github.com/ryansolid/mobx-jsx/issues/23) for furter information +Unlike React `render` only runs once, so you may not need to split in functions or methods your Lifecycles, all the initialization code could be set on `render`. See the issue [Lifecycles](https://github.com/ryansolid/mobx-jsx/issues/23) for furter information. However, you may emulate `componentDidMount` and `componentWillUnmount`. The microtak`Promise` resolution will be after mount and `cleanup` runs at the beginning of re-evaluation so the elements aren't removed yet. -#### Example +#### Example ```jsx -import { render, cleanup, Component as _Component } from 'mobx-jsx' +import { render, cleanup, Component as _Component } from "mobx-jsx"; class Component extends _Component { - constructor(props) { - super(props) - if (this.componentDidMount) { - Promise.resolve().then(() => this.componentDidMount()) - } - if (this.componentWillUnmount) { - cleanup(() => this.componentWillUnmount()) - } - } + constructor(props) { + super(props); + if (this.componentDidMount) { + Promise.resolve().then(() => this.componentDidMount()); + } + if (this.componentWillUnmount) { + cleanup(() => this.componentWillUnmount()); + } + } } -class App extends Component { - componentDidMount(){ console.log('componentDidMount')} - componentWillUnmount(){ console.log('componentWillUnmount') } -} - +class App extends Component { + componentDidMount() { + console.log("componentDidMount"); + } + componentWillUnmount() { + console.log("componentWillUnmount"); + } +} ``` - ### Lazily Loading a Component ```jsx @@ -115,13 +121,15 @@ render(App, document.body); ## Non-precompiled environments Alternatively supports Tagged Template Literals or HyperScript for non-precompiled environments by installing the companion library and including variants: + ```js -import { html } from 'mobx-jsx/html'; // or -import { h } from 'mobx-jsx/h'; +import { html } from "mobx-jsx/html"; // or +import { h } from "mobx-jsx/h"; ``` + There is a small performance overhead of using these runtimes but the performance is still very impressive. Tagged Template solution is much more performant that the HyperScript version, but HyperScript opens up compatibility with some companion tooling like: -* [HyperScript Helpers](https://github.com/ohanhi/hyperscript-helpers) Use an element as functions DSL -* [Babel Plugin HTM](https://github.com/developit/htm/tree/master/packages/babel-plugin-htm) Transpile Tagged Template Literals to HyperScript for IE11 compatibility +- [HyperScript Helpers](https://github.com/ohanhi/hyperscript-helpers) Use an element as functions DSL +- [Babel Plugin HTM](https://github.com/developit/htm/tree/master/packages/babel-plugin-htm) Transpile Tagged Template Literals to HyperScript for IE11 compatibility Further documentation available at: [Lit DOM Expressions](https://github.com/ryansolid/lit-dom-expressions) and [Hyper DOM Expressions](https://github.com/ryansolid/hyper-dom-expressions). diff --git a/package-lock.json b/package-lock.json index cbf1038..cc318cc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,27 +1,27 @@ { "name": "mobx-jsx", - "version": "0.14.0", + "version": "0.15.0", "lockfileVersion": 2, "requires": true, "packages": { "": { - "version": "0.14.0", + "version": "0.15.0", "license": "MIT", "devDependencies": { "@babel/core": "7.11.6", "@babel/preset-typescript": "7.10.4", "@rollup/plugin-babel": "5.2.1", "@rollup/plugin-node-resolve": "11.2.0", - "dom-expressions": "0.25.15", - "hyper-dom-expressions": "0.25.15", - "lit-dom-expressions": "0.25.15", + "dom-expressions": "0.27.0", + "hyper-dom-expressions": "0.27.0", + "lit-dom-expressions": "0.27.0", "mobx": "^6.1.8", "ncp": "2.0.0", "rollup": "^2.41.4", "typescript": "4.1.3" }, "peerDependencies": { - "mobx": "*" + "mobx": "> 6.0.0" } }, "node_modules/@babel/code-frame": { @@ -525,9 +525,9 @@ } }, "node_modules/dom-expressions": { - "version": "0.25.15", - "resolved": "https://registry.npmjs.org/dom-expressions/-/dom-expressions-0.25.15.tgz", - "integrity": "sha512-52fpIq5npPq+kKZWU4NvC2Z3mekg4jHS/hLwPO2vV5AjOr8KAYnQz1SQ4B2B6lxQnXJ6k36wDbvCZImgVvDglw==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/dom-expressions/-/dom-expressions-0.27.0.tgz", + "integrity": "sha512-aUOgAVjiNWMFKZtyKbKNzhoUZQG4p9bIU+7XS9pWEg9uygZEqy21M1E6gbuzQ643pGWVBr7QhF5z2bLVyneTpw==", "dev": true, "dependencies": { "babel-plugin-transform-rename-import": "^2.3.0" @@ -608,10 +608,11 @@ } }, "node_modules/hyper-dom-expressions": { - "version": "0.25.15", - "resolved": "https://registry.npmjs.org/hyper-dom-expressions/-/hyper-dom-expressions-0.25.15.tgz", - "integrity": "sha512-olVQBQXCkfEY4blGqVZrNfgeqvdnbLTcGqAG73RfKOYMtiWIe2ngyIIa4HQMhuz0pUjj7si+1OYAwGWSyT3grA==", - "dev": true + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/hyper-dom-expressions/-/hyper-dom-expressions-0.27.0.tgz", + "integrity": "sha512-5AvA0RAmNkfaP/upKtwmRLNpE4C9kFwdFxLl7YVgTZ29n5ENsySJJMMkSEFtzaKkN1k8y1Tf+oYAnja61f8JbQ==", + "dev": true, + "license": "MIT" }, "node_modules/is-core-module": { "version": "2.2.0", @@ -665,10 +666,11 @@ } }, "node_modules/lit-dom-expressions": { - "version": "0.25.15", - "resolved": "https://registry.npmjs.org/lit-dom-expressions/-/lit-dom-expressions-0.25.15.tgz", - "integrity": "sha512-zbXRIF8LJct49aViDE1g+Y+G+N90o/JK90IycQxkZKZYo8Uj8XTXV3m6osCwDFT1PoCrxQqyiXt451Vv0Huizg==", - "dev": true + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/lit-dom-expressions/-/lit-dom-expressions-0.27.0.tgz", + "integrity": "sha512-qBdqpgwX04AD1HjfzWHOnTitc0YCQm2w2cvMAyUowcMZJdZFuIELMgIcbrwYensY+13dkKnFnOPzf6Vk6H/gkQ==", + "dev": true, + "license": "MIT" }, "node_modules/lodash": { "version": "4.17.19", @@ -1276,9 +1278,9 @@ "dev": true }, "dom-expressions": { - "version": "0.25.15", - "resolved": "https://registry.npmjs.org/dom-expressions/-/dom-expressions-0.25.15.tgz", - "integrity": "sha512-52fpIq5npPq+kKZWU4NvC2Z3mekg4jHS/hLwPO2vV5AjOr8KAYnQz1SQ4B2B6lxQnXJ6k36wDbvCZImgVvDglw==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/dom-expressions/-/dom-expressions-0.27.0.tgz", + "integrity": "sha512-aUOgAVjiNWMFKZtyKbKNzhoUZQG4p9bIU+7XS9pWEg9uygZEqy21M1E6gbuzQ643pGWVBr7QhF5z2bLVyneTpw==", "dev": true, "requires": { "babel-plugin-transform-rename-import": "^2.3.0" @@ -1337,9 +1339,9 @@ "dev": true }, "hyper-dom-expressions": { - "version": "0.25.15", - "resolved": "https://registry.npmjs.org/hyper-dom-expressions/-/hyper-dom-expressions-0.25.15.tgz", - "integrity": "sha512-olVQBQXCkfEY4blGqVZrNfgeqvdnbLTcGqAG73RfKOYMtiWIe2ngyIIa4HQMhuz0pUjj7si+1OYAwGWSyT3grA==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/hyper-dom-expressions/-/hyper-dom-expressions-0.27.0.tgz", + "integrity": "sha512-5AvA0RAmNkfaP/upKtwmRLNpE4C9kFwdFxLl7YVgTZ29n5ENsySJJMMkSEFtzaKkN1k8y1Tf+oYAnja61f8JbQ==", "dev": true }, "is-core-module": { @@ -1379,9 +1381,9 @@ } }, "lit-dom-expressions": { - "version": "0.25.15", - "resolved": "https://registry.npmjs.org/lit-dom-expressions/-/lit-dom-expressions-0.25.15.tgz", - "integrity": "sha512-zbXRIF8LJct49aViDE1g+Y+G+N90o/JK90IycQxkZKZYo8Uj8XTXV3m6osCwDFT1PoCrxQqyiXt451Vv0Huizg==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/lit-dom-expressions/-/lit-dom-expressions-0.27.0.tgz", + "integrity": "sha512-qBdqpgwX04AD1HjfzWHOnTitc0YCQm2w2cvMAyUowcMZJdZFuIELMgIcbrwYensY+13dkKnFnOPzf6Vk6H/gkQ==", "dev": true }, "lodash": { diff --git a/package.json b/package.json index eaa1da8..37b59b0 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "mobx-jsx", "description": "Raw MobX performance without the restraints of a Virtual DOM", - "version": "0.14.0", + "version": "0.15.0", "author": "Ryan Carniato", "license": "MIT", "repository": { @@ -20,9 +20,9 @@ "@babel/preset-typescript": "7.10.4", "@rollup/plugin-babel": "5.2.1", "@rollup/plugin-node-resolve": "11.2.0", - "dom-expressions": "0.25.15", - "hyper-dom-expressions": "0.25.15", - "lit-dom-expressions": "0.25.15", + "dom-expressions": "0.27.0", + "hyper-dom-expressions": "0.27.0", + "lit-dom-expressions": "0.27.0", "mobx": "^6.1.8", "ncp": "2.0.0", "rollup": "^2.41.4", diff --git a/src/jsx.d.ts b/src/jsx.d.ts index 71bc443..fc64ab1 100644 --- a/src/jsx.d.ts +++ b/src/jsx.d.ts @@ -54,14 +54,34 @@ export namespace JSX { classList?: { [k: string]: boolean | undefined; }; - on?: { - [key: string]: EventHandler; - }; - onCapture?: { - [key: string]: EventHandler; - }; } - interface DOMAttributes extends CustomAttributes { + interface Directives {} + interface ExplicitProperties {} + interface ExplicitAttributes {} + interface CustomEvents {} + interface CustomCaptureEvents {} + type DirectiveAttributes = { + [Key in keyof Directives as `use:${Key}`]?: Directives[Key]; + }; + type PropAttributes = { + [Key in keyof ExplicitProperties as `prop:${Key}`]?: ExplicitProperties[Key]; + }; + type AttrAttributes = { + [Key in keyof ExplicitAttributes as `attr:${Key}`]?: ExplicitAttributes[Key]; + }; + type OnAttributes = { + [Key in keyof CustomEvents as `on:${Key}`]?: EventHandler; + }; + type OnCaptureAttributes = { + [Key in keyof CustomEvents as `oncapture:${Key}`]?: EventHandler; + }; + interface DOMAttributes + extends CustomAttributes, + DirectiveAttributes, + PropAttributes, + AttrAttributes, + OnAttributes, + OnCaptureAttributes { children?: Element; innerHTML?: string; innerText?: string; @@ -281,6 +301,10 @@ export namespace JSX { * Defines whether an animation should run in reverse on some or all cycles. */ "animation-direction"?: CSSWideKeyword | any; + /** + * Defines how long an animation runs for. + */ + "animation-duration"?: CSSWideKeyword | any; /** * Specifies how many times an animation cycle should play. */ @@ -1697,17 +1721,17 @@ export namespace JSX { * Defines the total number of columns in a table, grid, or treegrid. * @see aria-colindex. */ - "aria-colcount"?: number; + "aria-colcount"?: number | string; /** * Defines an element's column index or position with respect to the total number of columns within a table, grid, or treegrid. * @see aria-colcount @see aria-colspan. */ - "aria-colindex"?: number; + "aria-colindex"?: number | string; /** * Defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid. * @see aria-colindex @see aria-rowspan. */ - "aria-colspan"?: number; + "aria-colspan"?: number | string; /** * Identifies the element (or elements) whose contents or presence are controlled by the current element. * @see aria-owns. @@ -1777,7 +1801,7 @@ export namespace JSX { */ "aria-labelledby"?: string; /** Defines the hierarchical level of an element within a structure. */ - "aria-level"?: number; + "aria-level"?: number | string; /** Indicates that an element will be updated, and describes the types of updates the user agents, assistive technologies, and user can expect from the live region. */ "aria-live"?: "off" | "assertive" | "polite"; /** Indicates whether an element is modal when displayed. */ @@ -1803,7 +1827,7 @@ export namespace JSX { * Defines an element's number or position in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM. * @see aria-setsize. */ - "aria-posinset"?: number; + "aria-posinset"?: number | string; /** * Indicates the current "pressed" state of toggle buttons. * @see aria-checked @see aria-selected. @@ -1837,17 +1861,17 @@ export namespace JSX { * Defines the total number of rows in a table, grid, or treegrid. * @see aria-rowindex. */ - "aria-rowcount"?: number; + "aria-rowcount"?: number | string; /** * Defines an element's row index or position with respect to the total number of rows within a table, grid, or treegrid. * @see aria-rowcount @see aria-rowspan. */ - "aria-rowindex"?: number; + "aria-rowindex"?: number | string; /** * Defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid. * @see aria-rowindex @see aria-colspan. */ - "aria-rowspan"?: number; + "aria-rowspan"?: number | string; /** * Indicates the current "selected" state of various widgets. * @see aria-checked @see aria-pressed. @@ -1857,18 +1881,18 @@ export namespace JSX { * Defines the number of items in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM. * @see aria-posinset. */ - "aria-setsize"?: number; + "aria-setsize"?: number | string; /** Indicates if items in a table or grid are sorted in ascending or descending order. */ "aria-sort"?: "none" | "ascending" | "descending" | "other"; /** Defines the maximum allowed value for a range widget. */ - "aria-valuemax"?: number; + "aria-valuemax"?: number | string; /** Defines the minimum allowed value for a range widget. */ - "aria-valuemin"?: number; + "aria-valuemin"?: number | string; /** * Defines the current value for a range widget. * @see aria-valuetext. */ - "aria-valuenow"?: number; + "aria-valuenow"?: number | string; /** Defines the human readable text alternative of aria-valuenow for a range widget. */ "aria-valuetext"?: string; } @@ -2345,6 +2369,7 @@ export namespace JSX { rowspan?: number | string; colSpan?: number | string; rowSpan?: number | string; + scope?: "col" | "row" | "rowgroup" | "colgroup"; } interface TimeHTMLAttributes extends HTMLAttributes { datetime?: string; @@ -3154,6 +3179,7 @@ export namespace JSX { y?: number | string; width?: number | string; height?: number | string; + href?: string; } interface ViewSVGAttributes extends CoreSVGAttributes, From 59bb2a92fe315c465fd400f92985743c51e7aeec Mon Sep 17 00:00:00 2001 From: Tito Date: Sun, 12 Dec 2021 13:46:43 -0300 Subject: [PATCH 35/38] Update README.md Add examples for initial render and references --- README.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/README.md b/README.md index a138e5f..141d0bd 100644 --- a/README.md +++ b/README.md @@ -97,6 +97,43 @@ class App extends Component { } ``` +### Mounting + +Mounting can be done by functions and not class components. However you may use an arrow function as follows: + +```jsx +import { render, Component } from "mobx-jsx"; + +class App extends Component { + render() { + return
Mounted
+ } +} + +render(() => , document.body); +``` + +### References + +`ref` assigns to a variable and `forwardRef` uses a function form. + + +```jsx +let elRef; +Promise.resolve().then(() => elRef.clientWidth); +
+``` + +or + +```jsx +let elRef; +Promise.resolve().then(() => elRef.clientWidth); +
elRef = ref} /> +``` + +Note: Promise.resolve().then is used as `mount` see the issue [Lifecycles](https://github.com/ryansolid/mobx-jsx/issues/23) for furter information. + ### Lazily Loading a Component ```jsx From ec7e0d716ce8c6e10258b080f63af8f0b64e6b40 Mon Sep 17 00:00:00 2001 From: Tito Date: Mon, 13 Dec 2021 11:47:44 -0300 Subject: [PATCH 36/38] Update README.md removes forwardRef --- README.md | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/README.md b/README.md index 141d0bd..625b49d 100644 --- a/README.md +++ b/README.md @@ -115,7 +115,7 @@ render(() => , document.body); ### References -`ref` assigns to a variable and `forwardRef` uses a function form. +`ref` assigns to a variable. ```jsx @@ -124,14 +124,6 @@ Promise.resolve().then(() => elRef.clientWidth);
``` -or - -```jsx -let elRef; -Promise.resolve().then(() => elRef.clientWidth); -
elRef = ref} /> -``` - Note: Promise.resolve().then is used as `mount` see the issue [Lifecycles](https://github.com/ryansolid/mobx-jsx/issues/23) for furter information. ### Lazily Loading a Component From 8bb6234777c4d5cc2edb0531d6894e435a292b2d Mon Sep 17 00:00:00 2001 From: Kid <44045911+kidonng@users.noreply.github.com> Date: Mon, 5 Sep 2022 19:48:12 +0800 Subject: [PATCH 37/38] Fix typos --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 625b49d..bbd55da 100644 --- a/README.md +++ b/README.md @@ -66,9 +66,9 @@ const list = observable(["Alpha", "Beta", "Gamma"]); ### Lifecycles -Unlike React `render` only runs once, so you may not need to split in functions or methods your Lifecycles, all the initialization code could be set on `render`. See the issue [Lifecycles](https://github.com/ryansolid/mobx-jsx/issues/23) for furter information. +Unlike React `render` only runs once, so you may not need to split in functions or methods your Lifecycles, all the initialization code could be set on `render`. See the issue [Lifecycles](https://github.com/ryansolid/mobx-jsx/issues/23) for further information. -However, you may emulate `componentDidMount` and `componentWillUnmount`. The microtak`Promise` resolution will be after mount and `cleanup` runs at the beginning of re-evaluation so the elements aren't removed yet. +However, you may emulate `componentDidMount` and `componentWillUnmount`. The microtask `Promise` resolution will be after mount and `cleanup` runs at the beginning of re-evaluation so the elements aren't removed yet. #### Example @@ -124,7 +124,7 @@ Promise.resolve().then(() => elRef.clientWidth);
``` -Note: Promise.resolve().then is used as `mount` see the issue [Lifecycles](https://github.com/ryansolid/mobx-jsx/issues/23) for furter information. +Note: Promise.resolve().then is used as `mount` see the issue [Lifecycles](https://github.com/ryansolid/mobx-jsx/issues/23) for further information. ### Lazily Loading a Component From d192fd0218ecd890e6b99483f8568ffacac2b381 Mon Sep 17 00:00:00 2001 From: Ryan Carniato Date: Thu, 6 Oct 2022 20:22:52 -0700 Subject: [PATCH 38/38] v0.16.0 --- package-lock.json | 1623 ++++++++++++++++++++++--------------- package.json | 23 +- src/client.d.ts | 36 +- src/core.ts | 3 +- src/html.ts | 8 + src/index.ts | 4 +- src/jsx.d.ts | 1938 +++++++-------------------------------------- src/lib.ts | 53 +- 8 files changed, 1378 insertions(+), 2310 deletions(-) diff --git a/package-lock.json b/package-lock.json index cc318cc..47fecc7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,301 +1,373 @@ { "name": "mobx-jsx", - "version": "0.15.0", + "version": "0.16.0", "lockfileVersion": 2, "requires": true, "packages": { "": { - "version": "0.15.0", + "name": "mobx-jsx", + "version": "0.16.0", "license": "MIT", + "dependencies": { + "csstype": "^3.1.0" + }, "devDependencies": { - "@babel/core": "7.11.6", - "@babel/preset-typescript": "7.10.4", - "@rollup/plugin-babel": "5.2.1", - "@rollup/plugin-node-resolve": "11.2.0", - "dom-expressions": "0.27.0", - "hyper-dom-expressions": "0.27.0", - "lit-dom-expressions": "0.27.0", - "mobx": "^6.1.8", + "@babel/core": "7.19.3", + "@babel/preset-typescript": "7.18.6", + "@rollup/plugin-babel": "5.3.1", + "@rollup/plugin-node-resolve": "14.1.0", + "dom-expressions": "0.34.12", + "hyper-dom-expressions": "0.34.12", + "lit-dom-expressions": "0.34.12", + "mobx": "^6.6.2", "ncp": "2.0.0", "rollup": "^2.41.4", - "typescript": "4.1.3" + "typescript": "4.8.4" }, "peerDependencies": { "mobx": "> 6.0.0" } }, + "node_modules/@ampproject/remapping": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.0.tgz", + "integrity": "sha512-qRmjj8nj9qmLTQXXmaR1cck3UXSRMPrbsLJAasZpF+t3riI71BXed5ebIOYwQntykeZuhjsdweEc9BxH5Jc26w==", + "dev": true, + "dependencies": { + "@jridgewell/gen-mapping": "^0.1.0", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/@babel/code-frame": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", - "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz", + "integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==", "dev": true, "dependencies": { - "@babel/highlight": "^7.10.4" + "@babel/highlight": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/compat-data": { + "version": "7.19.3", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.19.3.tgz", + "integrity": "sha512-prBHMK4JYYK+wDjJF1q99KK4JLL+egWS4nmNqdlMUgCExMZ+iZW0hGhyC3VEbsPjvaN0TBhW//VIFwBrk8sEiw==", + "dev": true, + "engines": { + "node": ">=6.9.0" } }, "node_modules/@babel/core": { - "version": "7.11.6", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.11.6.tgz", - "integrity": "sha512-Wpcv03AGnmkgm6uS6k8iwhIwTrcP0m17TL1n1sy7qD0qelDu4XNeW0dN0mHfa+Gei211yDaLoEe/VlbXQzM4Bg==", + "version": "7.19.3", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.19.3.tgz", + "integrity": "sha512-WneDJxdsjEvyKtXKsaBGbDeiyOjR5vYq4HcShxnIbG0qixpoHjI3MqeZM9NDvsojNCEBItQE4juOo/bU6e72gQ==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.10.4", - "@babel/generator": "^7.11.6", - "@babel/helper-module-transforms": "^7.11.0", - "@babel/helpers": "^7.10.4", - "@babel/parser": "^7.11.5", - "@babel/template": "^7.10.4", - "@babel/traverse": "^7.11.5", - "@babel/types": "^7.11.5", + "@ampproject/remapping": "^2.1.0", + "@babel/code-frame": "^7.18.6", + "@babel/generator": "^7.19.3", + "@babel/helper-compilation-targets": "^7.19.3", + "@babel/helper-module-transforms": "^7.19.0", + "@babel/helpers": "^7.19.0", + "@babel/parser": "^7.19.3", + "@babel/template": "^7.18.10", + "@babel/traverse": "^7.19.3", + "@babel/types": "^7.19.3", "convert-source-map": "^1.7.0", "debug": "^4.1.0", - "gensync": "^1.0.0-beta.1", - "json5": "^2.1.2", - "lodash": "^4.17.19", - "resolve": "^1.3.2", - "semver": "^5.4.1", - "source-map": "^0.5.0" + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.1", + "semver": "^6.3.0" }, "engines": { "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" } }, - "node_modules/@babel/core/node_modules/@babel/generator": { - "version": "7.11.6", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.11.6.tgz", - "integrity": "sha512-DWtQ1PV3r+cLbySoHrwn9RWEgKMBLLma4OBQloPRyDYvc5msJM9kvTLo1YnlJd1P/ZuKbdli3ijr5q3FvAF3uA==", + "node_modules/@babel/generator": { + "version": "7.19.3", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.19.3.tgz", + "integrity": "sha512-fqVZnmp1ncvZU757UzDheKZpfPgatqY59XtW2/j/18H7u76akb8xqvjw82f+i2UKd/ksYsSick/BCLQUUtJ/qQ==", "dev": true, "dependencies": { - "@babel/types": "^7.11.5", - "jsesc": "^2.5.1", - "source-map": "^0.5.0" + "@babel/types": "^7.19.3", + "@jridgewell/gen-mapping": "^0.3.2", + "jsesc": "^2.5.1" + }, + "engines": { + "node": ">=6.9.0" } }, - "node_modules/@babel/core/node_modules/@babel/helper-split-export-declaration": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.11.0.tgz", - "integrity": "sha512-74Vejvp6mHkGE+m+k5vHY93FX2cAtrw1zXrZXRlG4l410Nm9PxfEiVTn1PjDPV5SnmieiueY4AFg2xqhNFuuZg==", + "node_modules/@babel/generator/node_modules/@jridgewell/gen-mapping": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz", + "integrity": "sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==", "dev": true, "dependencies": { - "@babel/types": "^7.11.0" - } - }, - "node_modules/@babel/core/node_modules/@babel/parser": { - "version": "7.11.5", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.11.5.tgz", - "integrity": "sha512-X9rD8qqm695vgmeaQ4fvz/o3+Wk4ZzQvSHkDBgpYKxpD4qTAUm88ZKtHkVqIOsYFFbIQ6wQYhC6q7pjqVK0E0Q==", - "dev": true, - "bin": { - "parser": "bin/babel-parser.js" + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" }, "engines": { "node": ">=6.0.0" } }, - "node_modules/@babel/core/node_modules/@babel/traverse": { - "version": "7.11.5", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.11.5.tgz", - "integrity": "sha512-EjiPXt+r7LiCZXEfRpSJd+jUMnBd4/9OUv7Nx3+0u9+eimMwJmG0Q98lw4/289JCoxSE8OolDMNZaaF/JZ69WQ==", + "node_modules/@babel/helper-annotate-as-pure": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.18.6.tgz", + "integrity": "sha512-duORpUiYrEpzKIop6iNbjnwKLAKnJ47csTyRACyEmWj0QdUrm5aqNJGHSSEQSUAvNW0ojX0dOmK9dZduvkfeXA==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.10.4", - "@babel/generator": "^7.11.5", - "@babel/helper-function-name": "^7.10.4", - "@babel/helper-split-export-declaration": "^7.11.0", - "@babel/parser": "^7.11.5", - "@babel/types": "^7.11.5", - "debug": "^4.1.0", - "globals": "^11.1.0", - "lodash": "^4.17.19" + "@babel/types": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" } }, - "node_modules/@babel/core/node_modules/@babel/types": { - "version": "7.11.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.5.tgz", - "integrity": "sha512-bvM7Qz6eKnJVFIn+1LPtjlBFPVN5jNDc1XmN15vWe7Q3DPBufWWsLiIvUu7xW87uTG6QoggpIDnUgLQvPheU+Q==", + "node_modules/@babel/helper-compilation-targets": { + "version": "7.19.3", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.19.3.tgz", + "integrity": "sha512-65ESqLGyGmLvgR0mst5AdW1FkNlj9rQsCKduzEoEPhBCDFGXvz2jW6bXFG6i0/MrV2s7hhXjjb2yAzcPuQlLwg==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.10.4", - "lodash": "^4.17.19", - "to-fast-properties": "^2.0.0" + "@babel/compat-data": "^7.19.3", + "@babel/helper-validator-option": "^7.18.6", + "browserslist": "^4.21.3", + "semver": "^6.3.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" } }, - "node_modules/@babel/generator": { - "version": "7.10.5", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.10.5.tgz", - "integrity": "sha512-3vXxr3FEW7E7lJZiWQ3bM4+v/Vyr9C+hpolQ8BGFr9Y8Ri2tFLWTixmwKBafDujO1WVah4fhZBeU1bieKdghig==", + "node_modules/@babel/helper-create-class-features-plugin": { + "version": "7.19.0", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.19.0.tgz", + "integrity": "sha512-NRz8DwF4jT3UfrmUoZjd0Uph9HQnP30t7Ash+weACcyNkiYTywpIjDBgReJMKgr+n86sn2nPVVmJ28Dm053Kqw==", "dev": true, "dependencies": { - "@babel/types": "^7.10.5", - "jsesc": "^2.5.1", - "source-map": "^0.5.0" + "@babel/helper-annotate-as-pure": "^7.18.6", + "@babel/helper-environment-visitor": "^7.18.9", + "@babel/helper-function-name": "^7.19.0", + "@babel/helper-member-expression-to-functions": "^7.18.9", + "@babel/helper-optimise-call-expression": "^7.18.6", + "@babel/helper-replace-supers": "^7.18.9", + "@babel/helper-split-export-declaration": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" } }, - "node_modules/@babel/helper-create-class-features-plugin": { - "version": "7.10.5", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.10.5.tgz", - "integrity": "sha512-0nkdeijB7VlZoLT3r/mY3bUkw3T8WG/hNw+FATs/6+pG2039IJWjTYL0VTISqsNHMUTEnwbVnc89WIJX9Qed0A==", + "node_modules/@babel/helper-environment-visitor": { + "version": "7.18.9", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.9.tgz", + "integrity": "sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg==", "dev": true, - "dependencies": { - "@babel/helper-function-name": "^7.10.4", - "@babel/helper-member-expression-to-functions": "^7.10.5", - "@babel/helper-optimise-call-expression": "^7.10.4", - "@babel/helper-plugin-utils": "^7.10.4", - "@babel/helper-replace-supers": "^7.10.4", - "@babel/helper-split-export-declaration": "^7.10.4" + "engines": { + "node": ">=6.9.0" } }, "node_modules/@babel/helper-function-name": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.10.4.tgz", - "integrity": "sha512-YdaSyz1n8gY44EmN7x44zBn9zQ1Ry2Y+3GTA+3vH6Mizke1Vw0aWDM66FOYEPw8//qKkmqOckrGgTYa+6sceqQ==", + "version": "7.19.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.19.0.tgz", + "integrity": "sha512-WAwHBINyrpqywkUH0nTnNgI5ina5TFn85HKS0pbPDfxFfhyR/aNQEn4hGi1P1JyT//I0t4OgXUlofzWILRvS5w==", "dev": true, "dependencies": { - "@babel/helper-get-function-arity": "^7.10.4", - "@babel/template": "^7.10.4", - "@babel/types": "^7.10.4" + "@babel/template": "^7.18.10", + "@babel/types": "^7.19.0" + }, + "engines": { + "node": ">=6.9.0" } }, - "node_modules/@babel/helper-get-function-arity": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.10.4.tgz", - "integrity": "sha512-EkN3YDB+SRDgiIUnNgcmiD361ti+AVbL3f3Henf6dqqUyr5dMsorno0lJWJuLhDhkI5sYEpgj6y9kB8AOU1I2A==", + "node_modules/@babel/helper-hoist-variables": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.18.6.tgz", + "integrity": "sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==", "dev": true, "dependencies": { - "@babel/types": "^7.10.4" + "@babel/types": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" } }, "node_modules/@babel/helper-member-expression-to-functions": { - "version": "7.10.5", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.10.5.tgz", - "integrity": "sha512-HiqJpYD5+WopCXIAbQDG0zye5XYVvcO9w/DHp5GsaGkRUaamLj2bEtu6i8rnGGprAhHM3qidCMgp71HF4endhA==", + "version": "7.18.9", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.18.9.tgz", + "integrity": "sha512-RxifAh2ZoVU67PyKIO4AMi1wTenGfMR/O/ae0CCRqwgBAt5v7xjdtRw7UoSbsreKrQn5t7r89eruK/9JjYHuDg==", "dev": true, "dependencies": { - "@babel/types": "^7.10.5" + "@babel/types": "^7.18.9" + }, + "engines": { + "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-imports": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.10.4.tgz", - "integrity": "sha512-nEQJHqYavI217oD9+s5MUBzk6x1IlvoS9WTPfgG43CbMEeStE0v+r+TucWdx8KFGowPGvyOkDT9+7DHedIDnVw==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.18.6.tgz", + "integrity": "sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA==", "dev": true, "dependencies": { - "@babel/types": "^7.10.4" + "@babel/types": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-transforms": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.11.0.tgz", - "integrity": "sha512-02EVu8COMuTRO1TAzdMtpBPbe6aQ1w/8fePD2YgQmxZU4gpNWaL9gK3Jp7dxlkUlUCJOTaSeA+Hrm1BRQwqIhg==", - "dev": true, - "dependencies": { - "@babel/helper-module-imports": "^7.10.4", - "@babel/helper-replace-supers": "^7.10.4", - "@babel/helper-simple-access": "^7.10.4", - "@babel/helper-split-export-declaration": "^7.11.0", - "@babel/template": "^7.10.4", - "@babel/types": "^7.11.0", - "lodash": "^4.17.19" - } - }, - "node_modules/@babel/helper-module-transforms/node_modules/@babel/helper-split-export-declaration": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.11.0.tgz", - "integrity": "sha512-74Vejvp6mHkGE+m+k5vHY93FX2cAtrw1zXrZXRlG4l410Nm9PxfEiVTn1PjDPV5SnmieiueY4AFg2xqhNFuuZg==", + "version": "7.19.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.19.0.tgz", + "integrity": "sha512-3HBZ377Fe14RbLIA+ac3sY4PTgpxHVkFrESaWhoI5PuyXPBBX8+C34qblV9G89ZtycGJCmCI/Ut+VUDK4bltNQ==", "dev": true, "dependencies": { - "@babel/types": "^7.11.0" - } - }, - "node_modules/@babel/helper-module-transforms/node_modules/@babel/types": { - "version": "7.11.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.5.tgz", - "integrity": "sha512-bvM7Qz6eKnJVFIn+1LPtjlBFPVN5jNDc1XmN15vWe7Q3DPBufWWsLiIvUu7xW87uTG6QoggpIDnUgLQvPheU+Q==", - "dev": true, - "dependencies": { - "@babel/helper-validator-identifier": "^7.10.4", - "lodash": "^4.17.19", - "to-fast-properties": "^2.0.0" + "@babel/helper-environment-visitor": "^7.18.9", + "@babel/helper-module-imports": "^7.18.6", + "@babel/helper-simple-access": "^7.18.6", + "@babel/helper-split-export-declaration": "^7.18.6", + "@babel/helper-validator-identifier": "^7.18.6", + "@babel/template": "^7.18.10", + "@babel/traverse": "^7.19.0", + "@babel/types": "^7.19.0" + }, + "engines": { + "node": ">=6.9.0" } }, "node_modules/@babel/helper-optimise-call-expression": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.10.4.tgz", - "integrity": "sha512-n3UGKY4VXwXThEiKrgRAoVPBMqeoPgHVqiHZOanAJCG9nQUL2pLRQirUzl0ioKclHGpGqRgIOkgcIJaIWLpygg==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.18.6.tgz", + "integrity": "sha512-HP59oD9/fEHQkdcbgFCnbmgH5vIQTJbxh2yf+CdM89/glUNnuzr87Q8GIjGEnOktTROemO0Pe0iPAYbqZuOUiA==", "dev": true, "dependencies": { - "@babel/types": "^7.10.4" + "@babel/types": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" } }, "node_modules/@babel/helper-plugin-utils": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.10.4.tgz", - "integrity": "sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg==", - "dev": true + "version": "7.19.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.19.0.tgz", + "integrity": "sha512-40Ryx7I8mT+0gaNxm8JGTZFUITNqdLAgdg0hXzeVZxVD6nFsdhQvip6v8dqkRHzsz1VFpFAaOCHNn0vKBL7Czw==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } }, "node_modules/@babel/helper-replace-supers": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.10.4.tgz", - "integrity": "sha512-sPxZfFXocEymYTdVK1UNmFPBN+Hv5mJkLPsYWwGBxZAxaWfFu+xqp7b6qWD0yjNuNL2VKc6L5M18tOXUP7NU0A==", + "version": "7.19.1", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.19.1.tgz", + "integrity": "sha512-T7ahH7wV0Hfs46SFh5Jz3s0B6+o8g3c+7TMxu7xKfmHikg7EAZ3I2Qk9LFhjxXq8sL7UkP5JflezNwoZa8WvWw==", "dev": true, "dependencies": { - "@babel/helper-member-expression-to-functions": "^7.10.4", - "@babel/helper-optimise-call-expression": "^7.10.4", - "@babel/traverse": "^7.10.4", - "@babel/types": "^7.10.4" + "@babel/helper-environment-visitor": "^7.18.9", + "@babel/helper-member-expression-to-functions": "^7.18.9", + "@babel/helper-optimise-call-expression": "^7.18.6", + "@babel/traverse": "^7.19.1", + "@babel/types": "^7.19.0" + }, + "engines": { + "node": ">=6.9.0" } }, "node_modules/@babel/helper-simple-access": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.10.4.tgz", - "integrity": "sha512-0fMy72ej/VEvF8ULmX6yb5MtHG4uH4Dbd6I/aHDb/JVg0bbivwt9Wg+h3uMvX+QSFtwr5MeItvazbrc4jtRAXw==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.18.6.tgz", + "integrity": "sha512-iNpIgTgyAvDQpDj76POqg+YEt8fPxx3yaNBg3S30dxNKm2SWfYhD0TGrK/Eu9wHpUW63VQU894TsTg+GLbUa1g==", "dev": true, "dependencies": { - "@babel/template": "^7.10.4", - "@babel/types": "^7.10.4" + "@babel/types": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" } }, "node_modules/@babel/helper-split-export-declaration": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.10.4.tgz", - "integrity": "sha512-pySBTeoUff56fL5CBU2hWm9TesA4r/rOkI9DyJLvvgz09MB9YtfIYe3iBriVaYNaPe+Alua0vBIOVOLs2buWhg==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.18.6.tgz", + "integrity": "sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA==", "dev": true, "dependencies": { - "@babel/types": "^7.10.4" + "@babel/types": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.18.10", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.18.10.tgz", + "integrity": "sha512-XtIfWmeNY3i4t7t4D2t02q50HvqHybPqW2ki1kosnvWCwuCMeo81Jf0gwr85jy/neUdg5XDdeFE/80DXiO+njw==", + "dev": true, + "engines": { + "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz", - "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==", - "dev": true + "version": "7.19.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz", + "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.18.6.tgz", + "integrity": "sha512-XO7gESt5ouv/LRJdrVjkShckw6STTaB7l9BrpBaAHDeF5YZT+01PCwmR0SJHnkW6i8OwW/EVWRShfi4j2x+KQw==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } }, "node_modules/@babel/helpers": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.10.4.tgz", - "integrity": "sha512-L2gX/XeUONeEbI78dXSrJzGdz4GQ+ZTA/aazfUsFaWjSe95kiCuOZ5HsXvkiw3iwF+mFHSRUfJU8t6YavocdXA==", + "version": "7.19.0", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.19.0.tgz", + "integrity": "sha512-DRBCKGwIEdqY3+rPJgG/dKfQy9+08rHIAJx8q2p+HSWP87s2HCrQmaAMMyMll2kIXKCW0cO1RdQskx15Xakftg==", "dev": true, "dependencies": { - "@babel/template": "^7.10.4", - "@babel/traverse": "^7.10.4", - "@babel/types": "^7.10.4" + "@babel/template": "^7.18.10", + "@babel/traverse": "^7.19.0", + "@babel/types": "^7.19.0" + }, + "engines": { + "node": ">=6.9.0" } }, "node_modules/@babel/highlight": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", - "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz", + "integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.10.4", + "@babel/helper-validator-identifier": "^7.18.6", "chalk": "^2.0.0", "js-tokens": "^4.0.0" + }, + "engines": { + "node": ">=6.9.0" } }, "node_modules/@babel/parser": { - "version": "7.10.5", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.10.5.tgz", - "integrity": "sha512-wfryxy4bE1UivvQKSQDU4/X6dr+i8bctjUjj8Zyt3DQy7NtPizJXT8M52nqpNKL+nq2PW8lxk4ZqLj0fD4B4hQ==", + "version": "7.19.3", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.19.3.tgz", + "integrity": "sha512-pJ9xOlNWHiy9+FuFP09DEAFbAn4JskgRsVcc169w2xRBC3FRGuQEwjeIMMND9L2zc0iEhO/tGv4Zq+km+hxNpQ==", "dev": true, "bin": { "parser": "bin/babel-parser.js" @@ -305,78 +377,154 @@ } }, "node_modules/@babel/plugin-syntax-typescript": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.10.4.tgz", - "integrity": "sha512-oSAEz1YkBCAKr5Yiq8/BNtvSAPwkp/IyUnwZogd8p+F0RuYQQrLeRUzIQhueQTTBy/F+a40uS7OFKxnkRvmvFQ==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.18.6.tgz", + "integrity": "sha512-mAWAuq4rvOepWCBid55JuRNvpTNf2UGVgoz4JV0fXEKolsVZDzsa4NqCef758WZJj/GDu0gVGItjKFiClTAmZA==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.10.4" + "@babel/helper-plugin-utils": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, "node_modules/@babel/plugin-transform-typescript": { - "version": "7.10.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.10.5.tgz", - "integrity": "sha512-YCyYsFrrRMZ3qR7wRwtSSJovPG5vGyG4ZdcSAivGwTfoasMp3VOB/AKhohu3dFtmB4cCDcsndCSxGtrdliCsZQ==", + "version": "7.19.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.19.3.tgz", + "integrity": "sha512-z6fnuK9ve9u/0X0rRvI9MY0xg+DOUaABDYOe+/SQTxtlptaBB/V9JIUxJn6xp3lMBeb9qe8xSFmHU35oZDXD+w==", "dev": true, "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.10.5", - "@babel/helper-plugin-utils": "^7.10.4", - "@babel/plugin-syntax-typescript": "^7.10.4" + "@babel/helper-create-class-features-plugin": "^7.19.0", + "@babel/helper-plugin-utils": "^7.19.0", + "@babel/plugin-syntax-typescript": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, "node_modules/@babel/preset-typescript": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.10.4.tgz", - "integrity": "sha512-SdYnvGPv+bLlwkF2VkJnaX/ni1sMNetcGI1+nThF1gyv6Ph8Qucc4ZZAjM5yZcE/AKRXIOTZz7eSRDWOEjPyRQ==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.18.6.tgz", + "integrity": "sha512-s9ik86kXBAnD760aybBucdpnLsAt0jK1xqJn2juOn9lkOvSHV60os5hxoVJsPzMQxvnUJFAlkont2DvvaYEBtQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.10.4", - "@babel/plugin-transform-typescript": "^7.10.4" + "@babel/helper-plugin-utils": "^7.18.6", + "@babel/helper-validator-option": "^7.18.6", + "@babel/plugin-transform-typescript": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, "node_modules/@babel/template": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.10.4.tgz", - "integrity": "sha512-ZCjD27cGJFUB6nmCB1Enki3r+L5kJveX9pq1SvAUKoICy6CZ9yD8xO086YXdYhvNjBdnekm4ZnaP5yC8Cs/1tA==", + "version": "7.18.10", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.18.10.tgz", + "integrity": "sha512-TI+rCtooWHr3QJ27kJxfjutghu44DLnasDMwpDqCXVTal9RLp3RSYNh4NdBrRP2cQAoG9A8juOQl6P6oZG4JxA==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.10.4", - "@babel/parser": "^7.10.4", - "@babel/types": "^7.10.4" + "@babel/code-frame": "^7.18.6", + "@babel/parser": "^7.18.10", + "@babel/types": "^7.18.10" + }, + "engines": { + "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.10.5", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.10.5.tgz", - "integrity": "sha512-yc/fyv2gUjPqzTz0WHeRJH2pv7jA9kA7mBX2tXl/x5iOE81uaVPuGPtaYk7wmkx4b67mQ7NqI8rmT2pF47KYKQ==", + "version": "7.19.3", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.19.3.tgz", + "integrity": "sha512-qh5yf6149zhq2sgIXmwjnsvmnNQC2iw70UFjp4olxucKrWd/dvlUsBI88VSLUsnMNF7/vnOiA+nk1+yLoCqROQ==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.10.4", - "@babel/generator": "^7.10.5", - "@babel/helper-function-name": "^7.10.4", - "@babel/helper-split-export-declaration": "^7.10.4", - "@babel/parser": "^7.10.5", - "@babel/types": "^7.10.5", + "@babel/code-frame": "^7.18.6", + "@babel/generator": "^7.19.3", + "@babel/helper-environment-visitor": "^7.18.9", + "@babel/helper-function-name": "^7.19.0", + "@babel/helper-hoist-variables": "^7.18.6", + "@babel/helper-split-export-declaration": "^7.18.6", + "@babel/parser": "^7.19.3", + "@babel/types": "^7.19.3", "debug": "^4.1.0", - "globals": "^11.1.0", - "lodash": "^4.17.19" + "globals": "^11.1.0" + }, + "engines": { + "node": ">=6.9.0" } }, "node_modules/@babel/types": { - "version": "7.10.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.5.tgz", - "integrity": "sha512-ixV66KWfCI6GKoA/2H9v6bQdbfXEwwpOdQ8cRvb4F+eyvhlaHxWFMQB4+3d9QFJXZsiiiqVrewNV0DFEQpyT4Q==", + "version": "7.19.3", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.19.3.tgz", + "integrity": "sha512-hGCaQzIY22DJlDh9CH7NOxgKkFjBk0Cw9xDO1Xmh2151ti7wiGfQ3LauXzL4HP1fmFlTX6XjpRETTpUcv7wQLw==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.10.4", - "lodash": "^4.17.19", + "@babel/helper-string-parser": "^7.18.10", + "@babel/helper-validator-identifier": "^7.19.1", "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz", + "integrity": "sha512-sQXCasFk+U8lWYEe66WxRDOE9PjVz4vSM51fTu3Hw+ClTpUSQb718772vH3pyS5pShp6lvQM7SxgIDXXXmOX7w==", + "dev": true, + "dependencies": { + "@jridgewell/set-array": "^1.0.0", + "@jridgewell/sourcemap-codec": "^1.4.10" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", + "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", + "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.14", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", + "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", + "dev": true + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.15", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.15.tgz", + "integrity": "sha512-oWZNOULl+UbhsgB51uuZzglikfIKSUBO/M9W2OfEjn7cmqoAiCgmv9lyACTUacZwBz0ITnJ2NqjU8Tx0DHL88g==", + "dev": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" } }, "node_modules/@rollup/plugin-babel": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/@rollup/plugin-babel/-/plugin-babel-5.2.1.tgz", - "integrity": "sha512-Jd7oqFR2dzZJ3NWANDyBjwTtX/lYbZpVcmkHrfQcpvawHs9E4c0nYk5U2mfZ6I/DZcIvy506KZJi54XK/jxH7A==", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/@rollup/plugin-babel/-/plugin-babel-5.3.1.tgz", + "integrity": "sha512-WFfdLWU/xVWKeRQnKmIAQULUI7Il0gZnBIH/ZFO069wYIfPu+8zrfp/KMW0atmELoRDq8FbiP3VCss9MhCut7Q==", "dev": true, "dependencies": { "@babel/helper-module-imports": "^7.10.4", @@ -384,18 +532,28 @@ }, "engines": { "node": ">= 10.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0", + "@types/babel__core": "^7.1.9", + "rollup": "^1.20.0||^2.0.0" + }, + "peerDependenciesMeta": { + "@types/babel__core": { + "optional": true + } } }, "node_modules/@rollup/plugin-node-resolve": { - "version": "11.2.0", - "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-11.2.0.tgz", - "integrity": "sha512-qHjNIKYt5pCcn+5RUBQxK8krhRvf1HnyVgUCcFFcweDS7fhkOLZeYh0mhHK6Ery8/bb9tvN/ubPzmfF0qjDCTA==", + "version": "14.1.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-14.1.0.tgz", + "integrity": "sha512-5G2niJroNCz/1zqwXtk0t9+twOSDlG00k1Wfd7bkbbXmwg8H8dvgHdIWAun53Ps/rckfvOC7scDBjuGFg5OaWw==", "dev": true, "dependencies": { "@rollup/pluginutils": "^3.1.0", "@types/resolve": "1.17.1", - "builtin-modules": "^3.1.0", "deepmerge": "^4.2.2", + "is-builtin-module": "^3.1.0", "is-module": "^1.0.0", "resolve": "^1.19.0" }, @@ -403,7 +561,7 @@ "node": ">= 10.0.0" }, "peerDependencies": { - "rollup": "^1.20.0||^2.0.0" + "rollup": "^2.78.0" } }, "node_modules/@rollup/pluginutils": { @@ -418,6 +576,9 @@ }, "engines": { "node": ">= 8.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0" } }, "node_modules/@types/estree": { @@ -427,9 +588,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "14.6.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.6.2.tgz", - "integrity": "sha512-onlIwbaeqvZyniGPfdw/TEhKIh79pz66L1q06WUQqJLnAb6wbjvOtepLYTGHTqzdXgBYIE3ZdmqHDGsRsbBz7A==", + "version": "18.8.3", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.8.3.tgz", + "integrity": "sha512-0os9vz6BpGwxGe9LOhgP/ncvYN5Tx1fNcd2TM3rD/aCGBkysb+ZWpXEocG24h6ZzOi13+VB8HndAQFezsSOw1w==", "dev": true }, "node_modules/@types/resolve": { @@ -459,15 +620,62 @@ "integrity": "sha512-dPgJoT57XC0PqSnLgl2FwNvxFrWlspatX2dkk7yjKQj5HHGw071vAcOf+hqW8ClqcBDMvEbm6mevn5yHAD8mlQ==", "dev": true }, + "node_modules/browserslist": { + "version": "4.21.4", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.4.tgz", + "integrity": "sha512-CBHJJdDmgjl3daYjN5Cp5kbTf1mUhZoS+beLklHIvkOWscs83YAhLlF3Wsh/lciQYAcbBJgTOD44VtG31ZM4Hw==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + } + ], + "dependencies": { + "caniuse-lite": "^1.0.30001400", + "electron-to-chromium": "^1.4.251", + "node-releases": "^2.0.6", + "update-browserslist-db": "^1.0.9" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, "node_modules/builtin-modules": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.1.0.tgz", - "integrity": "sha512-k0KL0aWZuBt2lrxrcASWDfwOLMnodeQjodT/1SxEQAXsHANgo6ZC/VEaSEHCXt7aSTZ4/4H5LKa+tBXmW7Vtvw==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.3.0.tgz", + "integrity": "sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==", "dev": true, "engines": { "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/caniuse-lite": { + "version": "1.0.30001416", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001416.tgz", + "integrity": "sha512-06wzzdAkCPZO+Qm4e/eNghZBDfVNDsCgw33T27OwBH9unE9S478OYw//Q2L7Npf/zBzs7rjZOszIFQkwQKAEqA==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + } + ] + }, "node_modules/chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", @@ -494,25 +702,38 @@ "node_modules/color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", "dev": true }, "node_modules/convert-source-map": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", - "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", + "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", "dev": true, "dependencies": { "safe-buffer": "~5.1.1" } }, + "node_modules/csstype": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.1.tgz", + "integrity": "sha512-DJR/VvkAvSZW9bTouZue2sSxDwdTN92uHjqeKVm+0dAqdfNykRzQ95tay8aXMBAAPpUiq4Qcug2L7neoRh2Egw==" + }, "node_modules/debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dev": true, "dependencies": { - "ms": "^2.1.1" + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } } }, "node_modules/deepmerge": { @@ -524,19 +745,44 @@ "node": ">=0.10.0" } }, + "node_modules/devalue": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/devalue/-/devalue-2.0.1.tgz", + "integrity": "sha512-I2TiqT5iWBEyB8GRfTDP0hiLZ0YeDJZ+upDxjBfOC2lebO5LezQMv7QvIUTzdb64jQyAKLf1AHADtGN+jw6v8Q==", + "dev": true + }, "node_modules/dom-expressions": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/dom-expressions/-/dom-expressions-0.27.0.tgz", - "integrity": "sha512-aUOgAVjiNWMFKZtyKbKNzhoUZQG4p9bIU+7XS9pWEg9uygZEqy21M1E6gbuzQ643pGWVBr7QhF5z2bLVyneTpw==", + "version": "0.34.12", + "resolved": "https://registry.npmjs.org/dom-expressions/-/dom-expressions-0.34.12.tgz", + "integrity": "sha512-GIKL8KOJ45RsBe7hI3QeTe9gtBUty36FIcSG0CFE9U6CVPciWX2ye5W5kmfI64TENFh19k9u1anZBQEqmfudoA==", "dev": true, "dependencies": { - "babel-plugin-transform-rename-import": "^2.3.0" + "babel-plugin-transform-rename-import": "^2.3.0", + "devalue": "^2.0.1" + }, + "peerDependencies": { + "csstype": "^3.0" + } + }, + "node_modules/electron-to-chromium": { + "version": "1.4.275", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.275.tgz", + "integrity": "sha512-aJeQQ+Hl9Jyyzv4chBqYJwmVRY46N5i2BEX5Cuyk/5gFCUZ5F3i7Hnba6snZftWla7Gglwc5pIgcd+E7cW+rPg==", + "dev": true + }, + "node_modules/escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true, + "engines": { + "node": ">=6" } }, "node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "dev": true, "engines": { "node": ">=0.8.0" @@ -569,9 +815,9 @@ "dev": true }, "node_modules/gensync": { - "version": "1.0.0-beta.1", - "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.1.tgz", - "integrity": "sha512-r8EC6NO1sngH/zdD9fiRDLdcgnbayXah+mLgManTaIZJqEC1MZstmnox8KpnI2/fxQwrp5OpCOYWLp4rBl4Jcg==", + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", "dev": true, "engines": { "node": ">=6.9.0" @@ -601,23 +847,37 @@ "node_modules/has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", "dev": true, "engines": { "node": ">=4" } }, "node_modules/hyper-dom-expressions": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/hyper-dom-expressions/-/hyper-dom-expressions-0.27.0.tgz", - "integrity": "sha512-5AvA0RAmNkfaP/upKtwmRLNpE4C9kFwdFxLl7YVgTZ29n5ENsySJJMMkSEFtzaKkN1k8y1Tf+oYAnja61f8JbQ==", + "version": "0.34.12", + "resolved": "https://registry.npmjs.org/hyper-dom-expressions/-/hyper-dom-expressions-0.34.12.tgz", + "integrity": "sha512-mz6lUmtWt16Xx4hHjnN32QPV19gfy6Lh+C/ASyn+6Hxsgv2+8Q4P552etfNnhgoIE4c7foRSlvow5OU6m6ljmA==", + "dev": true + }, + "node_modules/is-builtin-module": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-3.2.0.tgz", + "integrity": "sha512-phDA4oSGt7vl1n5tJvTWooWWAsXLY+2xCnxNqvKhGEzujg+A43wPlPOyDg3C8XQHN+6k/JTQWJ/j0dQh/qr+Hw==", "dev": true, - "license": "MIT" + "dependencies": { + "builtin-modules": "^3.3.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, "node_modules/is-core-module": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.2.0.tgz", - "integrity": "sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ==", + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.10.0.tgz", + "integrity": "sha512-Erxj2n/LDAZ7H8WNJXd9tw38GYM3dv8rk8Zcs+jJuxYTW7sozH+SS8NtrSjVL1/vpLvWi1hxy96IzjJ3EHTJJg==", "dev": true, "dependencies": { "has": "^1.0.3" @@ -629,7 +889,7 @@ "node_modules/is-module": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", - "integrity": "sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE=", + "integrity": "sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==", "dev": true }, "node_modules/js-tokens": { @@ -651,13 +911,10 @@ } }, "node_modules/json5": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz", - "integrity": "sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", + "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==", "dev": true, - "dependencies": { - "minimist": "^1.2.5" - }, "bin": { "json5": "lib/cli.js" }, @@ -666,28 +923,15 @@ } }, "node_modules/lit-dom-expressions": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/lit-dom-expressions/-/lit-dom-expressions-0.27.0.tgz", - "integrity": "sha512-qBdqpgwX04AD1HjfzWHOnTitc0YCQm2w2cvMAyUowcMZJdZFuIELMgIcbrwYensY+13dkKnFnOPzf6Vk6H/gkQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/lodash": { - "version": "4.17.19", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", - "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==", - "dev": true - }, - "node_modules/minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "version": "0.34.12", + "resolved": "https://registry.npmjs.org/lit-dom-expressions/-/lit-dom-expressions-0.34.12.tgz", + "integrity": "sha512-Bffcw6tTA4qsBJt034ip28xx9sAx1xMJ56h6lOd4cQ0gC+goVpPiQMkoNLeMUvrcRIPdsOpdjraZHvRO5/H5Rg==", "dev": true }, "node_modules/mobx": { - "version": "6.1.8", - "resolved": "https://registry.npmjs.org/mobx/-/mobx-6.1.8.tgz", - "integrity": "sha512-U4yCvUeh6yKXRwFxm2lyJjXPVekOEar/R8ZKWAXem/3fthJqYflViawfjDAUh7lZEvbKqljC3NT/pSaUKpE+gg==", + "version": "6.6.2", + "resolved": "https://registry.npmjs.org/mobx/-/mobx-6.6.2.tgz", + "integrity": "sha512-IOpS0bf3+hXIhDIy+CmlNMBfFpAbHS0aVHcNC+xH/TFYEKIIVDKNYRh9eKlXuVfJ1iRKAp0cRVmO145CyJAMVQ==", "dev": true, "funding": { "type": "opencollective", @@ -703,44 +947,63 @@ "node_modules/ncp": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ncp/-/ncp-2.0.0.tgz", - "integrity": "sha1-GVoh1sRuNh0vsSgbo4uR6d9727M=", + "integrity": "sha512-zIdGUrPRFTUELUvr3Gmc7KZ2Sw/h1PiVM0Af/oHB6zgnV1ikqSfRk+TOufi79aHYCW3NiOXmr1BP5nWbzojLaA==", "dev": true, "bin": { "ncp": "bin/ncp" } }, + "node_modules/node-releases": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.6.tgz", + "integrity": "sha512-PiVXnNuFm5+iYkLBNeq5211hvO38y63T0i2KKh2KnUs3RpzJ+JtODFjkD8yjLwnDkTYF1eKXheUwdssR+NRZdg==", + "dev": true + }, "node_modules/path-parse": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "node_modules/picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", "dev": true }, "node_modules/picomatch": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", - "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "dev": true, "engines": { "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" } }, "node_modules/resolve": { - "version": "1.20.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", - "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", + "version": "1.22.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", + "integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==", "dev": true, "dependencies": { - "is-core-module": "^2.2.0", - "path-parse": "^1.0.6" + "is-core-module": "^2.9.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/rollup": { - "version": "2.41.4", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.41.4.tgz", - "integrity": "sha512-f9IHfMO8p2Y8OdisI7Oj3oKkPuaQ6cgSwYqAi0TDvP3w2p+oX1VejX/w28a1h8WTnrapzfO5d4Uqhww+gL0b0g==", + "version": "2.79.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.79.1.tgz", + "integrity": "sha512-uKxbd0IhMZOhjAiD5oAFp7BqvkA4Dv47qpOCtaNvng4HBwdbWtdOh8f5nZNuk2rp51PMGk3bzfWu5oayNEuYnw==", "dev": true, "bin": { "rollup": "dist/bin/rollup" @@ -749,7 +1012,7 @@ "node": ">=10.0.0" }, "optionalDependencies": { - "fsevents": "~2.3.1" + "fsevents": "~2.3.2" } }, "node_modules/safe-buffer": { @@ -759,21 +1022,12 @@ "dev": true }, "node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true, "bin": { - "semver": "bin/semver" - } - }, - "node_modules/source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true, - "engines": { - "node": ">=0.10.0" + "semver": "bin/semver.js" } }, "node_modules/supports-color": { @@ -788,19 +1042,31 @@ "node": ">=4" } }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/to-fast-properties": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", "dev": true, "engines": { "node": ">=4" } }, "node_modules/typescript": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.1.3.tgz", - "integrity": "sha512-B3ZIOf1IKeH2ixgHhj6la6xdwR9QrLC5d1VKeCSY4tvkqhF2eqd9O7txNlS0PO3GrBAFIdr3L1ndNwteUbZLYg==", + "version": "4.8.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.4.tgz", + "integrity": "sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -809,351 +1075,407 @@ "engines": { "node": ">=4.2.0" } + }, + "node_modules/update-browserslist-db": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.10.tgz", + "integrity": "sha512-OztqDenkfFkbSG+tRxBeAnCVPckDBcvibKd35yDONx6OU8N7sqgwc7rCbkJ/WcYtVRZ4ba68d6byhC21GFh7sQ==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + } + ], + "dependencies": { + "escalade": "^3.1.1", + "picocolors": "^1.0.0" + }, + "bin": { + "browserslist-lint": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } } }, "dependencies": { + "@ampproject/remapping": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.0.tgz", + "integrity": "sha512-qRmjj8nj9qmLTQXXmaR1cck3UXSRMPrbsLJAasZpF+t3riI71BXed5ebIOYwQntykeZuhjsdweEc9BxH5Jc26w==", + "dev": true, + "requires": { + "@jridgewell/gen-mapping": "^0.1.0", + "@jridgewell/trace-mapping": "^0.3.9" + } + }, "@babel/code-frame": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", - "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz", + "integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==", "dev": true, "requires": { - "@babel/highlight": "^7.10.4" + "@babel/highlight": "^7.18.6" } }, + "@babel/compat-data": { + "version": "7.19.3", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.19.3.tgz", + "integrity": "sha512-prBHMK4JYYK+wDjJF1q99KK4JLL+egWS4nmNqdlMUgCExMZ+iZW0hGhyC3VEbsPjvaN0TBhW//VIFwBrk8sEiw==", + "dev": true + }, "@babel/core": { - "version": "7.11.6", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.11.6.tgz", - "integrity": "sha512-Wpcv03AGnmkgm6uS6k8iwhIwTrcP0m17TL1n1sy7qD0qelDu4XNeW0dN0mHfa+Gei211yDaLoEe/VlbXQzM4Bg==", + "version": "7.19.3", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.19.3.tgz", + "integrity": "sha512-WneDJxdsjEvyKtXKsaBGbDeiyOjR5vYq4HcShxnIbG0qixpoHjI3MqeZM9NDvsojNCEBItQE4juOo/bU6e72gQ==", "dev": true, "requires": { - "@babel/code-frame": "^7.10.4", - "@babel/generator": "^7.11.6", - "@babel/helper-module-transforms": "^7.11.0", - "@babel/helpers": "^7.10.4", - "@babel/parser": "^7.11.5", - "@babel/template": "^7.10.4", - "@babel/traverse": "^7.11.5", - "@babel/types": "^7.11.5", + "@ampproject/remapping": "^2.1.0", + "@babel/code-frame": "^7.18.6", + "@babel/generator": "^7.19.3", + "@babel/helper-compilation-targets": "^7.19.3", + "@babel/helper-module-transforms": "^7.19.0", + "@babel/helpers": "^7.19.0", + "@babel/parser": "^7.19.3", + "@babel/template": "^7.18.10", + "@babel/traverse": "^7.19.3", + "@babel/types": "^7.19.3", "convert-source-map": "^1.7.0", "debug": "^4.1.0", - "gensync": "^1.0.0-beta.1", - "json5": "^2.1.2", - "lodash": "^4.17.19", - "resolve": "^1.3.2", - "semver": "^5.4.1", - "source-map": "^0.5.0" + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.1", + "semver": "^6.3.0" + } + }, + "@babel/generator": { + "version": "7.19.3", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.19.3.tgz", + "integrity": "sha512-fqVZnmp1ncvZU757UzDheKZpfPgatqY59XtW2/j/18H7u76akb8xqvjw82f+i2UKd/ksYsSick/BCLQUUtJ/qQ==", + "dev": true, + "requires": { + "@babel/types": "^7.19.3", + "@jridgewell/gen-mapping": "^0.3.2", + "jsesc": "^2.5.1" }, "dependencies": { - "@babel/generator": { - "version": "7.11.6", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.11.6.tgz", - "integrity": "sha512-DWtQ1PV3r+cLbySoHrwn9RWEgKMBLLma4OBQloPRyDYvc5msJM9kvTLo1YnlJd1P/ZuKbdli3ijr5q3FvAF3uA==", - "dev": true, - "requires": { - "@babel/types": "^7.11.5", - "jsesc": "^2.5.1", - "source-map": "^0.5.0" - } - }, - "@babel/helper-split-export-declaration": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.11.0.tgz", - "integrity": "sha512-74Vejvp6mHkGE+m+k5vHY93FX2cAtrw1zXrZXRlG4l410Nm9PxfEiVTn1PjDPV5SnmieiueY4AFg2xqhNFuuZg==", - "dev": true, - "requires": { - "@babel/types": "^7.11.0" - } - }, - "@babel/parser": { - "version": "7.11.5", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.11.5.tgz", - "integrity": "sha512-X9rD8qqm695vgmeaQ4fvz/o3+Wk4ZzQvSHkDBgpYKxpD4qTAUm88ZKtHkVqIOsYFFbIQ6wQYhC6q7pjqVK0E0Q==", - "dev": true - }, - "@babel/traverse": { - "version": "7.11.5", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.11.5.tgz", - "integrity": "sha512-EjiPXt+r7LiCZXEfRpSJd+jUMnBd4/9OUv7Nx3+0u9+eimMwJmG0Q98lw4/289JCoxSE8OolDMNZaaF/JZ69WQ==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.10.4", - "@babel/generator": "^7.11.5", - "@babel/helper-function-name": "^7.10.4", - "@babel/helper-split-export-declaration": "^7.11.0", - "@babel/parser": "^7.11.5", - "@babel/types": "^7.11.5", - "debug": "^4.1.0", - "globals": "^11.1.0", - "lodash": "^4.17.19" - } - }, - "@babel/types": { - "version": "7.11.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.5.tgz", - "integrity": "sha512-bvM7Qz6eKnJVFIn+1LPtjlBFPVN5jNDc1XmN15vWe7Q3DPBufWWsLiIvUu7xW87uTG6QoggpIDnUgLQvPheU+Q==", + "@jridgewell/gen-mapping": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz", + "integrity": "sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.10.4", - "lodash": "^4.17.19", - "to-fast-properties": "^2.0.0" + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" } } } }, - "@babel/generator": { - "version": "7.10.5", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.10.5.tgz", - "integrity": "sha512-3vXxr3FEW7E7lJZiWQ3bM4+v/Vyr9C+hpolQ8BGFr9Y8Ri2tFLWTixmwKBafDujO1WVah4fhZBeU1bieKdghig==", + "@babel/helper-annotate-as-pure": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.18.6.tgz", + "integrity": "sha512-duORpUiYrEpzKIop6iNbjnwKLAKnJ47csTyRACyEmWj0QdUrm5aqNJGHSSEQSUAvNW0ojX0dOmK9dZduvkfeXA==", "dev": true, "requires": { - "@babel/types": "^7.10.5", - "jsesc": "^2.5.1", - "source-map": "^0.5.0" + "@babel/types": "^7.18.6" } }, - "@babel/helper-create-class-features-plugin": { - "version": "7.10.5", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.10.5.tgz", - "integrity": "sha512-0nkdeijB7VlZoLT3r/mY3bUkw3T8WG/hNw+FATs/6+pG2039IJWjTYL0VTISqsNHMUTEnwbVnc89WIJX9Qed0A==", + "@babel/helper-compilation-targets": { + "version": "7.19.3", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.19.3.tgz", + "integrity": "sha512-65ESqLGyGmLvgR0mst5AdW1FkNlj9rQsCKduzEoEPhBCDFGXvz2jW6bXFG6i0/MrV2s7hhXjjb2yAzcPuQlLwg==", "dev": true, "requires": { - "@babel/helper-function-name": "^7.10.4", - "@babel/helper-member-expression-to-functions": "^7.10.5", - "@babel/helper-optimise-call-expression": "^7.10.4", - "@babel/helper-plugin-utils": "^7.10.4", - "@babel/helper-replace-supers": "^7.10.4", - "@babel/helper-split-export-declaration": "^7.10.4" + "@babel/compat-data": "^7.19.3", + "@babel/helper-validator-option": "^7.18.6", + "browserslist": "^4.21.3", + "semver": "^6.3.0" } }, + "@babel/helper-create-class-features-plugin": { + "version": "7.19.0", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.19.0.tgz", + "integrity": "sha512-NRz8DwF4jT3UfrmUoZjd0Uph9HQnP30t7Ash+weACcyNkiYTywpIjDBgReJMKgr+n86sn2nPVVmJ28Dm053Kqw==", + "dev": true, + "requires": { + "@babel/helper-annotate-as-pure": "^7.18.6", + "@babel/helper-environment-visitor": "^7.18.9", + "@babel/helper-function-name": "^7.19.0", + "@babel/helper-member-expression-to-functions": "^7.18.9", + "@babel/helper-optimise-call-expression": "^7.18.6", + "@babel/helper-replace-supers": "^7.18.9", + "@babel/helper-split-export-declaration": "^7.18.6" + } + }, + "@babel/helper-environment-visitor": { + "version": "7.18.9", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.9.tgz", + "integrity": "sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg==", + "dev": true + }, "@babel/helper-function-name": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.10.4.tgz", - "integrity": "sha512-YdaSyz1n8gY44EmN7x44zBn9zQ1Ry2Y+3GTA+3vH6Mizke1Vw0aWDM66FOYEPw8//qKkmqOckrGgTYa+6sceqQ==", + "version": "7.19.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.19.0.tgz", + "integrity": "sha512-WAwHBINyrpqywkUH0nTnNgI5ina5TFn85HKS0pbPDfxFfhyR/aNQEn4hGi1P1JyT//I0t4OgXUlofzWILRvS5w==", "dev": true, "requires": { - "@babel/helper-get-function-arity": "^7.10.4", - "@babel/template": "^7.10.4", - "@babel/types": "^7.10.4" + "@babel/template": "^7.18.10", + "@babel/types": "^7.19.0" } }, - "@babel/helper-get-function-arity": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.10.4.tgz", - "integrity": "sha512-EkN3YDB+SRDgiIUnNgcmiD361ti+AVbL3f3Henf6dqqUyr5dMsorno0lJWJuLhDhkI5sYEpgj6y9kB8AOU1I2A==", + "@babel/helper-hoist-variables": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.18.6.tgz", + "integrity": "sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==", "dev": true, "requires": { - "@babel/types": "^7.10.4" + "@babel/types": "^7.18.6" } }, "@babel/helper-member-expression-to-functions": { - "version": "7.10.5", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.10.5.tgz", - "integrity": "sha512-HiqJpYD5+WopCXIAbQDG0zye5XYVvcO9w/DHp5GsaGkRUaamLj2bEtu6i8rnGGprAhHM3qidCMgp71HF4endhA==", + "version": "7.18.9", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.18.9.tgz", + "integrity": "sha512-RxifAh2ZoVU67PyKIO4AMi1wTenGfMR/O/ae0CCRqwgBAt5v7xjdtRw7UoSbsreKrQn5t7r89eruK/9JjYHuDg==", "dev": true, "requires": { - "@babel/types": "^7.10.5" + "@babel/types": "^7.18.9" } }, "@babel/helper-module-imports": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.10.4.tgz", - "integrity": "sha512-nEQJHqYavI217oD9+s5MUBzk6x1IlvoS9WTPfgG43CbMEeStE0v+r+TucWdx8KFGowPGvyOkDT9+7DHedIDnVw==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.18.6.tgz", + "integrity": "sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA==", "dev": true, "requires": { - "@babel/types": "^7.10.4" + "@babel/types": "^7.18.6" } }, "@babel/helper-module-transforms": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.11.0.tgz", - "integrity": "sha512-02EVu8COMuTRO1TAzdMtpBPbe6aQ1w/8fePD2YgQmxZU4gpNWaL9gK3Jp7dxlkUlUCJOTaSeA+Hrm1BRQwqIhg==", + "version": "7.19.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.19.0.tgz", + "integrity": "sha512-3HBZ377Fe14RbLIA+ac3sY4PTgpxHVkFrESaWhoI5PuyXPBBX8+C34qblV9G89ZtycGJCmCI/Ut+VUDK4bltNQ==", "dev": true, "requires": { - "@babel/helper-module-imports": "^7.10.4", - "@babel/helper-replace-supers": "^7.10.4", - "@babel/helper-simple-access": "^7.10.4", - "@babel/helper-split-export-declaration": "^7.11.0", - "@babel/template": "^7.10.4", - "@babel/types": "^7.11.0", - "lodash": "^4.17.19" - }, - "dependencies": { - "@babel/helper-split-export-declaration": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.11.0.tgz", - "integrity": "sha512-74Vejvp6mHkGE+m+k5vHY93FX2cAtrw1zXrZXRlG4l410Nm9PxfEiVTn1PjDPV5SnmieiueY4AFg2xqhNFuuZg==", - "dev": true, - "requires": { - "@babel/types": "^7.11.0" - } - }, - "@babel/types": { - "version": "7.11.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.5.tgz", - "integrity": "sha512-bvM7Qz6eKnJVFIn+1LPtjlBFPVN5jNDc1XmN15vWe7Q3DPBufWWsLiIvUu7xW87uTG6QoggpIDnUgLQvPheU+Q==", - "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.10.4", - "lodash": "^4.17.19", - "to-fast-properties": "^2.0.0" - } - } + "@babel/helper-environment-visitor": "^7.18.9", + "@babel/helper-module-imports": "^7.18.6", + "@babel/helper-simple-access": "^7.18.6", + "@babel/helper-split-export-declaration": "^7.18.6", + "@babel/helper-validator-identifier": "^7.18.6", + "@babel/template": "^7.18.10", + "@babel/traverse": "^7.19.0", + "@babel/types": "^7.19.0" } }, "@babel/helper-optimise-call-expression": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.10.4.tgz", - "integrity": "sha512-n3UGKY4VXwXThEiKrgRAoVPBMqeoPgHVqiHZOanAJCG9nQUL2pLRQirUzl0ioKclHGpGqRgIOkgcIJaIWLpygg==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.18.6.tgz", + "integrity": "sha512-HP59oD9/fEHQkdcbgFCnbmgH5vIQTJbxh2yf+CdM89/glUNnuzr87Q8GIjGEnOktTROemO0Pe0iPAYbqZuOUiA==", "dev": true, "requires": { - "@babel/types": "^7.10.4" + "@babel/types": "^7.18.6" } }, "@babel/helper-plugin-utils": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.10.4.tgz", - "integrity": "sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg==", + "version": "7.19.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.19.0.tgz", + "integrity": "sha512-40Ryx7I8mT+0gaNxm8JGTZFUITNqdLAgdg0hXzeVZxVD6nFsdhQvip6v8dqkRHzsz1VFpFAaOCHNn0vKBL7Czw==", "dev": true }, "@babel/helper-replace-supers": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.10.4.tgz", - "integrity": "sha512-sPxZfFXocEymYTdVK1UNmFPBN+Hv5mJkLPsYWwGBxZAxaWfFu+xqp7b6qWD0yjNuNL2VKc6L5M18tOXUP7NU0A==", + "version": "7.19.1", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.19.1.tgz", + "integrity": "sha512-T7ahH7wV0Hfs46SFh5Jz3s0B6+o8g3c+7TMxu7xKfmHikg7EAZ3I2Qk9LFhjxXq8sL7UkP5JflezNwoZa8WvWw==", "dev": true, "requires": { - "@babel/helper-member-expression-to-functions": "^7.10.4", - "@babel/helper-optimise-call-expression": "^7.10.4", - "@babel/traverse": "^7.10.4", - "@babel/types": "^7.10.4" + "@babel/helper-environment-visitor": "^7.18.9", + "@babel/helper-member-expression-to-functions": "^7.18.9", + "@babel/helper-optimise-call-expression": "^7.18.6", + "@babel/traverse": "^7.19.1", + "@babel/types": "^7.19.0" } }, "@babel/helper-simple-access": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.10.4.tgz", - "integrity": "sha512-0fMy72ej/VEvF8ULmX6yb5MtHG4uH4Dbd6I/aHDb/JVg0bbivwt9Wg+h3uMvX+QSFtwr5MeItvazbrc4jtRAXw==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.18.6.tgz", + "integrity": "sha512-iNpIgTgyAvDQpDj76POqg+YEt8fPxx3yaNBg3S30dxNKm2SWfYhD0TGrK/Eu9wHpUW63VQU894TsTg+GLbUa1g==", "dev": true, "requires": { - "@babel/template": "^7.10.4", - "@babel/types": "^7.10.4" + "@babel/types": "^7.18.6" } }, "@babel/helper-split-export-declaration": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.10.4.tgz", - "integrity": "sha512-pySBTeoUff56fL5CBU2hWm9TesA4r/rOkI9DyJLvvgz09MB9YtfIYe3iBriVaYNaPe+Alua0vBIOVOLs2buWhg==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.18.6.tgz", + "integrity": "sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA==", "dev": true, "requires": { - "@babel/types": "^7.10.4" + "@babel/types": "^7.18.6" } }, + "@babel/helper-string-parser": { + "version": "7.18.10", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.18.10.tgz", + "integrity": "sha512-XtIfWmeNY3i4t7t4D2t02q50HvqHybPqW2ki1kosnvWCwuCMeo81Jf0gwr85jy/neUdg5XDdeFE/80DXiO+njw==", + "dev": true + }, "@babel/helper-validator-identifier": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz", - "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==", + "version": "7.19.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz", + "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==", + "dev": true + }, + "@babel/helper-validator-option": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.18.6.tgz", + "integrity": "sha512-XO7gESt5ouv/LRJdrVjkShckw6STTaB7l9BrpBaAHDeF5YZT+01PCwmR0SJHnkW6i8OwW/EVWRShfi4j2x+KQw==", "dev": true }, "@babel/helpers": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.10.4.tgz", - "integrity": "sha512-L2gX/XeUONeEbI78dXSrJzGdz4GQ+ZTA/aazfUsFaWjSe95kiCuOZ5HsXvkiw3iwF+mFHSRUfJU8t6YavocdXA==", + "version": "7.19.0", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.19.0.tgz", + "integrity": "sha512-DRBCKGwIEdqY3+rPJgG/dKfQy9+08rHIAJx8q2p+HSWP87s2HCrQmaAMMyMll2kIXKCW0cO1RdQskx15Xakftg==", "dev": true, "requires": { - "@babel/template": "^7.10.4", - "@babel/traverse": "^7.10.4", - "@babel/types": "^7.10.4" + "@babel/template": "^7.18.10", + "@babel/traverse": "^7.19.0", + "@babel/types": "^7.19.0" } }, "@babel/highlight": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", - "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz", + "integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.10.4", + "@babel/helper-validator-identifier": "^7.18.6", "chalk": "^2.0.0", "js-tokens": "^4.0.0" } }, "@babel/parser": { - "version": "7.10.5", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.10.5.tgz", - "integrity": "sha512-wfryxy4bE1UivvQKSQDU4/X6dr+i8bctjUjj8Zyt3DQy7NtPizJXT8M52nqpNKL+nq2PW8lxk4ZqLj0fD4B4hQ==", + "version": "7.19.3", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.19.3.tgz", + "integrity": "sha512-pJ9xOlNWHiy9+FuFP09DEAFbAn4JskgRsVcc169w2xRBC3FRGuQEwjeIMMND9L2zc0iEhO/tGv4Zq+km+hxNpQ==", "dev": true }, "@babel/plugin-syntax-typescript": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.10.4.tgz", - "integrity": "sha512-oSAEz1YkBCAKr5Yiq8/BNtvSAPwkp/IyUnwZogd8p+F0RuYQQrLeRUzIQhueQTTBy/F+a40uS7OFKxnkRvmvFQ==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.18.6.tgz", + "integrity": "sha512-mAWAuq4rvOepWCBid55JuRNvpTNf2UGVgoz4JV0fXEKolsVZDzsa4NqCef758WZJj/GDu0gVGItjKFiClTAmZA==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.10.4" + "@babel/helper-plugin-utils": "^7.18.6" } }, "@babel/plugin-transform-typescript": { - "version": "7.10.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.10.5.tgz", - "integrity": "sha512-YCyYsFrrRMZ3qR7wRwtSSJovPG5vGyG4ZdcSAivGwTfoasMp3VOB/AKhohu3dFtmB4cCDcsndCSxGtrdliCsZQ==", + "version": "7.19.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.19.3.tgz", + "integrity": "sha512-z6fnuK9ve9u/0X0rRvI9MY0xg+DOUaABDYOe+/SQTxtlptaBB/V9JIUxJn6xp3lMBeb9qe8xSFmHU35oZDXD+w==", "dev": true, "requires": { - "@babel/helper-create-class-features-plugin": "^7.10.5", - "@babel/helper-plugin-utils": "^7.10.4", - "@babel/plugin-syntax-typescript": "^7.10.4" + "@babel/helper-create-class-features-plugin": "^7.19.0", + "@babel/helper-plugin-utils": "^7.19.0", + "@babel/plugin-syntax-typescript": "^7.18.6" } }, "@babel/preset-typescript": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.10.4.tgz", - "integrity": "sha512-SdYnvGPv+bLlwkF2VkJnaX/ni1sMNetcGI1+nThF1gyv6Ph8Qucc4ZZAjM5yZcE/AKRXIOTZz7eSRDWOEjPyRQ==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.18.6.tgz", + "integrity": "sha512-s9ik86kXBAnD760aybBucdpnLsAt0jK1xqJn2juOn9lkOvSHV60os5hxoVJsPzMQxvnUJFAlkont2DvvaYEBtQ==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.10.4", - "@babel/plugin-transform-typescript": "^7.10.4" + "@babel/helper-plugin-utils": "^7.18.6", + "@babel/helper-validator-option": "^7.18.6", + "@babel/plugin-transform-typescript": "^7.18.6" } }, "@babel/template": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.10.4.tgz", - "integrity": "sha512-ZCjD27cGJFUB6nmCB1Enki3r+L5kJveX9pq1SvAUKoICy6CZ9yD8xO086YXdYhvNjBdnekm4ZnaP5yC8Cs/1tA==", + "version": "7.18.10", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.18.10.tgz", + "integrity": "sha512-TI+rCtooWHr3QJ27kJxfjutghu44DLnasDMwpDqCXVTal9RLp3RSYNh4NdBrRP2cQAoG9A8juOQl6P6oZG4JxA==", "dev": true, "requires": { - "@babel/code-frame": "^7.10.4", - "@babel/parser": "^7.10.4", - "@babel/types": "^7.10.4" + "@babel/code-frame": "^7.18.6", + "@babel/parser": "^7.18.10", + "@babel/types": "^7.18.10" } }, "@babel/traverse": { - "version": "7.10.5", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.10.5.tgz", - "integrity": "sha512-yc/fyv2gUjPqzTz0WHeRJH2pv7jA9kA7mBX2tXl/x5iOE81uaVPuGPtaYk7wmkx4b67mQ7NqI8rmT2pF47KYKQ==", + "version": "7.19.3", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.19.3.tgz", + "integrity": "sha512-qh5yf6149zhq2sgIXmwjnsvmnNQC2iw70UFjp4olxucKrWd/dvlUsBI88VSLUsnMNF7/vnOiA+nk1+yLoCqROQ==", "dev": true, "requires": { - "@babel/code-frame": "^7.10.4", - "@babel/generator": "^7.10.5", - "@babel/helper-function-name": "^7.10.4", - "@babel/helper-split-export-declaration": "^7.10.4", - "@babel/parser": "^7.10.5", - "@babel/types": "^7.10.5", + "@babel/code-frame": "^7.18.6", + "@babel/generator": "^7.19.3", + "@babel/helper-environment-visitor": "^7.18.9", + "@babel/helper-function-name": "^7.19.0", + "@babel/helper-hoist-variables": "^7.18.6", + "@babel/helper-split-export-declaration": "^7.18.6", + "@babel/parser": "^7.19.3", + "@babel/types": "^7.19.3", "debug": "^4.1.0", - "globals": "^11.1.0", - "lodash": "^4.17.19" + "globals": "^11.1.0" } }, "@babel/types": { - "version": "7.10.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.5.tgz", - "integrity": "sha512-ixV66KWfCI6GKoA/2H9v6bQdbfXEwwpOdQ8cRvb4F+eyvhlaHxWFMQB4+3d9QFJXZsiiiqVrewNV0DFEQpyT4Q==", + "version": "7.19.3", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.19.3.tgz", + "integrity": "sha512-hGCaQzIY22DJlDh9CH7NOxgKkFjBk0Cw9xDO1Xmh2151ti7wiGfQ3LauXzL4HP1fmFlTX6XjpRETTpUcv7wQLw==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.10.4", - "lodash": "^4.17.19", + "@babel/helper-string-parser": "^7.18.10", + "@babel/helper-validator-identifier": "^7.19.1", "to-fast-properties": "^2.0.0" } }, + "@jridgewell/gen-mapping": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz", + "integrity": "sha512-sQXCasFk+U8lWYEe66WxRDOE9PjVz4vSM51fTu3Hw+ClTpUSQb718772vH3pyS5pShp6lvQM7SxgIDXXXmOX7w==", + "dev": true, + "requires": { + "@jridgewell/set-array": "^1.0.0", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, + "@jridgewell/resolve-uri": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", + "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", + "dev": true + }, + "@jridgewell/set-array": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", + "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "dev": true + }, + "@jridgewell/sourcemap-codec": { + "version": "1.4.14", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", + "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", + "dev": true + }, + "@jridgewell/trace-mapping": { + "version": "0.3.15", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.15.tgz", + "integrity": "sha512-oWZNOULl+UbhsgB51uuZzglikfIKSUBO/M9W2OfEjn7cmqoAiCgmv9lyACTUacZwBz0ITnJ2NqjU8Tx0DHL88g==", + "dev": true, + "requires": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, "@rollup/plugin-babel": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/@rollup/plugin-babel/-/plugin-babel-5.2.1.tgz", - "integrity": "sha512-Jd7oqFR2dzZJ3NWANDyBjwTtX/lYbZpVcmkHrfQcpvawHs9E4c0nYk5U2mfZ6I/DZcIvy506KZJi54XK/jxH7A==", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/@rollup/plugin-babel/-/plugin-babel-5.3.1.tgz", + "integrity": "sha512-WFfdLWU/xVWKeRQnKmIAQULUI7Il0gZnBIH/ZFO069wYIfPu+8zrfp/KMW0atmELoRDq8FbiP3VCss9MhCut7Q==", "dev": true, "requires": { "@babel/helper-module-imports": "^7.10.4", @@ -1161,15 +1483,15 @@ } }, "@rollup/plugin-node-resolve": { - "version": "11.2.0", - "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-11.2.0.tgz", - "integrity": "sha512-qHjNIKYt5pCcn+5RUBQxK8krhRvf1HnyVgUCcFFcweDS7fhkOLZeYh0mhHK6Ery8/bb9tvN/ubPzmfF0qjDCTA==", + "version": "14.1.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-14.1.0.tgz", + "integrity": "sha512-5G2niJroNCz/1zqwXtk0t9+twOSDlG00k1Wfd7bkbbXmwg8H8dvgHdIWAun53Ps/rckfvOC7scDBjuGFg5OaWw==", "dev": true, "requires": { "@rollup/pluginutils": "^3.1.0", "@types/resolve": "1.17.1", - "builtin-modules": "^3.1.0", "deepmerge": "^4.2.2", + "is-builtin-module": "^3.1.0", "is-module": "^1.0.0", "resolve": "^1.19.0" } @@ -1192,9 +1514,9 @@ "dev": true }, "@types/node": { - "version": "14.6.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.6.2.tgz", - "integrity": "sha512-onlIwbaeqvZyniGPfdw/TEhKIh79pz66L1q06WUQqJLnAb6wbjvOtepLYTGHTqzdXgBYIE3ZdmqHDGsRsbBz7A==", + "version": "18.8.3", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.8.3.tgz", + "integrity": "sha512-0os9vz6BpGwxGe9LOhgP/ncvYN5Tx1fNcd2TM3rD/aCGBkysb+ZWpXEocG24h6ZzOi13+VB8HndAQFezsSOw1w==", "dev": true }, "@types/resolve": { @@ -1221,10 +1543,28 @@ "integrity": "sha512-dPgJoT57XC0PqSnLgl2FwNvxFrWlspatX2dkk7yjKQj5HHGw071vAcOf+hqW8ClqcBDMvEbm6mevn5yHAD8mlQ==", "dev": true }, + "browserslist": { + "version": "4.21.4", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.4.tgz", + "integrity": "sha512-CBHJJdDmgjl3daYjN5Cp5kbTf1mUhZoS+beLklHIvkOWscs83YAhLlF3Wsh/lciQYAcbBJgTOD44VtG31ZM4Hw==", + "dev": true, + "requires": { + "caniuse-lite": "^1.0.30001400", + "electron-to-chromium": "^1.4.251", + "node-releases": "^2.0.6", + "update-browserslist-db": "^1.0.9" + } + }, "builtin-modules": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.1.0.tgz", - "integrity": "sha512-k0KL0aWZuBt2lrxrcASWDfwOLMnodeQjodT/1SxEQAXsHANgo6ZC/VEaSEHCXt7aSTZ4/4H5LKa+tBXmW7Vtvw==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.3.0.tgz", + "integrity": "sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==", + "dev": true + }, + "caniuse-lite": { + "version": "1.0.30001416", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001416.tgz", + "integrity": "sha512-06wzzdAkCPZO+Qm4e/eNghZBDfVNDsCgw33T27OwBH9unE9S478OYw//Q2L7Npf/zBzs7rjZOszIFQkwQKAEqA==", "dev": true }, "chalk": { @@ -1250,25 +1590,30 @@ "color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", "dev": true }, "convert-source-map": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", - "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", + "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", "dev": true, "requires": { "safe-buffer": "~5.1.1" } }, + "csstype": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.1.tgz", + "integrity": "sha512-DJR/VvkAvSZW9bTouZue2sSxDwdTN92uHjqeKVm+0dAqdfNykRzQ95tay8aXMBAAPpUiq4Qcug2L7neoRh2Egw==" + }, "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dev": true, "requires": { - "ms": "^2.1.1" + "ms": "2.1.2" } }, "deepmerge": { @@ -1277,19 +1622,38 @@ "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==", "dev": true }, + "devalue": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/devalue/-/devalue-2.0.1.tgz", + "integrity": "sha512-I2TiqT5iWBEyB8GRfTDP0hiLZ0YeDJZ+upDxjBfOC2lebO5LezQMv7QvIUTzdb64jQyAKLf1AHADtGN+jw6v8Q==", + "dev": true + }, "dom-expressions": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/dom-expressions/-/dom-expressions-0.27.0.tgz", - "integrity": "sha512-aUOgAVjiNWMFKZtyKbKNzhoUZQG4p9bIU+7XS9pWEg9uygZEqy21M1E6gbuzQ643pGWVBr7QhF5z2bLVyneTpw==", + "version": "0.34.12", + "resolved": "https://registry.npmjs.org/dom-expressions/-/dom-expressions-0.34.12.tgz", + "integrity": "sha512-GIKL8KOJ45RsBe7hI3QeTe9gtBUty36FIcSG0CFE9U6CVPciWX2ye5W5kmfI64TENFh19k9u1anZBQEqmfudoA==", "dev": true, "requires": { - "babel-plugin-transform-rename-import": "^2.3.0" + "babel-plugin-transform-rename-import": "^2.3.0", + "devalue": "^2.0.1" } }, + "electron-to-chromium": { + "version": "1.4.275", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.275.tgz", + "integrity": "sha512-aJeQQ+Hl9Jyyzv4chBqYJwmVRY46N5i2BEX5Cuyk/5gFCUZ5F3i7Hnba6snZftWla7Gglwc5pIgcd+E7cW+rPg==", + "dev": true + }, + "escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true + }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "dev": true }, "estree-walker": { @@ -1312,9 +1676,9 @@ "dev": true }, "gensync": { - "version": "1.0.0-beta.1", - "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.1.tgz", - "integrity": "sha512-r8EC6NO1sngH/zdD9fiRDLdcgnbayXah+mLgManTaIZJqEC1MZstmnox8KpnI2/fxQwrp5OpCOYWLp4rBl4Jcg==", + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", "dev": true }, "globals": { @@ -1335,19 +1699,28 @@ "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", "dev": true }, "hyper-dom-expressions": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/hyper-dom-expressions/-/hyper-dom-expressions-0.27.0.tgz", - "integrity": "sha512-5AvA0RAmNkfaP/upKtwmRLNpE4C9kFwdFxLl7YVgTZ29n5ENsySJJMMkSEFtzaKkN1k8y1Tf+oYAnja61f8JbQ==", + "version": "0.34.12", + "resolved": "https://registry.npmjs.org/hyper-dom-expressions/-/hyper-dom-expressions-0.34.12.tgz", + "integrity": "sha512-mz6lUmtWt16Xx4hHjnN32QPV19gfy6Lh+C/ASyn+6Hxsgv2+8Q4P552etfNnhgoIE4c7foRSlvow5OU6m6ljmA==", "dev": true }, + "is-builtin-module": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-3.2.0.tgz", + "integrity": "sha512-phDA4oSGt7vl1n5tJvTWooWWAsXLY+2xCnxNqvKhGEzujg+A43wPlPOyDg3C8XQHN+6k/JTQWJ/j0dQh/qr+Hw==", + "dev": true, + "requires": { + "builtin-modules": "^3.3.0" + } + }, "is-core-module": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.2.0.tgz", - "integrity": "sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ==", + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.10.0.tgz", + "integrity": "sha512-Erxj2n/LDAZ7H8WNJXd9tw38GYM3dv8rk8Zcs+jJuxYTW7sozH+SS8NtrSjVL1/vpLvWi1hxy96IzjJ3EHTJJg==", "dev": true, "requires": { "has": "^1.0.3" @@ -1356,7 +1729,7 @@ "is-module": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", - "integrity": "sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE=", + "integrity": "sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==", "dev": true }, "js-tokens": { @@ -1372,36 +1745,21 @@ "dev": true }, "json5": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz", - "integrity": "sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==", - "dev": true, - "requires": { - "minimist": "^1.2.5" - } - }, - "lit-dom-expressions": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/lit-dom-expressions/-/lit-dom-expressions-0.27.0.tgz", - "integrity": "sha512-qBdqpgwX04AD1HjfzWHOnTitc0YCQm2w2cvMAyUowcMZJdZFuIELMgIcbrwYensY+13dkKnFnOPzf6Vk6H/gkQ==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", + "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==", "dev": true }, - "lodash": { - "version": "4.17.19", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", - "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==", - "dev": true - }, - "minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "lit-dom-expressions": { + "version": "0.34.12", + "resolved": "https://registry.npmjs.org/lit-dom-expressions/-/lit-dom-expressions-0.34.12.tgz", + "integrity": "sha512-Bffcw6tTA4qsBJt034ip28xx9sAx1xMJ56h6lOd4cQ0gC+goVpPiQMkoNLeMUvrcRIPdsOpdjraZHvRO5/H5Rg==", "dev": true }, "mobx": { - "version": "6.1.8", - "resolved": "https://registry.npmjs.org/mobx/-/mobx-6.1.8.tgz", - "integrity": "sha512-U4yCvUeh6yKXRwFxm2lyJjXPVekOEar/R8ZKWAXem/3fthJqYflViawfjDAUh7lZEvbKqljC3NT/pSaUKpE+gg==", + "version": "6.6.2", + "resolved": "https://registry.npmjs.org/mobx/-/mobx-6.6.2.tgz", + "integrity": "sha512-IOpS0bf3+hXIhDIy+CmlNMBfFpAbHS0aVHcNC+xH/TFYEKIIVDKNYRh9eKlXuVfJ1iRKAp0cRVmO145CyJAMVQ==", "dev": true }, "ms": { @@ -1413,38 +1771,51 @@ "ncp": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ncp/-/ncp-2.0.0.tgz", - "integrity": "sha1-GVoh1sRuNh0vsSgbo4uR6d9727M=", + "integrity": "sha512-zIdGUrPRFTUELUvr3Gmc7KZ2Sw/h1PiVM0Af/oHB6zgnV1ikqSfRk+TOufi79aHYCW3NiOXmr1BP5nWbzojLaA==", + "dev": true + }, + "node-releases": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.6.tgz", + "integrity": "sha512-PiVXnNuFm5+iYkLBNeq5211hvO38y63T0i2KKh2KnUs3RpzJ+JtODFjkD8yjLwnDkTYF1eKXheUwdssR+NRZdg==", "dev": true }, "path-parse": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", "dev": true }, "picomatch": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", - "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "dev": true }, "resolve": { - "version": "1.20.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", - "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", + "version": "1.22.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", + "integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==", "dev": true, "requires": { - "is-core-module": "^2.2.0", - "path-parse": "^1.0.6" + "is-core-module": "^2.9.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" } }, "rollup": { - "version": "2.41.4", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.41.4.tgz", - "integrity": "sha512-f9IHfMO8p2Y8OdisI7Oj3oKkPuaQ6cgSwYqAi0TDvP3w2p+oX1VejX/w28a1h8WTnrapzfO5d4Uqhww+gL0b0g==", + "version": "2.79.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.79.1.tgz", + "integrity": "sha512-uKxbd0IhMZOhjAiD5oAFp7BqvkA4Dv47qpOCtaNvng4HBwdbWtdOh8f5nZNuk2rp51PMGk3bzfWu5oayNEuYnw==", "dev": true, "requires": { - "fsevents": "~2.3.1" + "fsevents": "~2.3.2" } }, "safe-buffer": { @@ -1454,15 +1825,9 @@ "dev": true }, "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - }, - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true }, "supports-color": { @@ -1474,17 +1839,33 @@ "has-flag": "^3.0.0" } }, + "supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true + }, "to-fast-properties": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", "dev": true }, "typescript": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.1.3.tgz", - "integrity": "sha512-B3ZIOf1IKeH2ixgHhj6la6xdwR9QrLC5d1VKeCSY4tvkqhF2eqd9O7txNlS0PO3GrBAFIdr3L1ndNwteUbZLYg==", + "version": "4.8.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.4.tgz", + "integrity": "sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==", "dev": true + }, + "update-browserslist-db": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.10.tgz", + "integrity": "sha512-OztqDenkfFkbSG+tRxBeAnCVPckDBcvibKd35yDONx6OU8N7sqgwc7rCbkJ/WcYtVRZ4ba68d6byhC21GFh7sQ==", + "dev": true, + "requires": { + "escalade": "^3.1.1", + "picocolors": "^1.0.0" + } } } } diff --git a/package.json b/package.json index 37b59b0..5df1139 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "mobx-jsx", "description": "Raw MobX performance without the restraints of a Virtual DOM", - "version": "0.15.0", + "version": "0.16.0", "author": "Ryan Carniato", "license": "MIT", "repository": { @@ -15,18 +15,21 @@ "build": "rollup -c && ncp ./src/client.d.ts ./types/client.d.ts && ncp ./src/jsx.d.ts ./types/jsx.d.ts && tsc", "prepublishOnly": "npm run build" }, + "dependencies": { + "csstype": "^3.1.0" + }, "devDependencies": { - "@babel/core": "7.11.6", - "@babel/preset-typescript": "7.10.4", - "@rollup/plugin-babel": "5.2.1", - "@rollup/plugin-node-resolve": "11.2.0", - "dom-expressions": "0.27.0", - "hyper-dom-expressions": "0.27.0", - "lit-dom-expressions": "0.27.0", - "mobx": "^6.1.8", + "@babel/core": "7.19.3", + "@babel/preset-typescript": "7.18.6", + "@rollup/plugin-babel": "5.3.1", + "@rollup/plugin-node-resolve": "14.1.0", + "dom-expressions": "0.34.12", + "hyper-dom-expressions": "0.34.12", + "lit-dom-expressions": "0.34.12", + "mobx": "^6.6.2", "ncp": "2.0.0", "rollup": "^2.41.4", - "typescript": "4.1.3" + "typescript": "4.8.4" }, "peerDependencies": { "mobx": "> 6.0.0" diff --git a/src/client.d.ts b/src/client.d.ts index fdfdbbe..f2e79e8 100644 --- a/src/client.d.ts +++ b/src/client.d.ts @@ -1,8 +1,10 @@ -import { JSX } from "./jsx"; +import { JSX } from "./jsx.js"; export const Aliases: Record; +export const PropAliases: Record; export const Properties: Set; export const ChildProperties: Set; export const DelegatedEvents: Set; +export const DOMElements: Set; export const SVGElements: Set; export const SVGNamespace: Record; @@ -11,6 +13,7 @@ export function render(code: () => JSX.Element, element: MountableElement): () = export function template(html: string, count: number, isSVG?: boolean): Element; export function effect(fn: (prev?: T) => T, init?: T): void; export function memo(fn: () => T, equal: boolean): () => T; +export function untrack(fn: () => T): T; export function insert( parent: MountableElement, accessor: (() => T) | T, @@ -18,8 +21,8 @@ export function insert( init?: JSX.Element ): JSX.Element; export function createComponent(Comp: (props: T) => JSX.Element, props: T): JSX.Element; -export function delegateEvents(eventNames: string[]): void; -export function clearDelegatedEvents(): void; +export function delegateEvents(eventNames: string[], d?: Document): void; +export function clearDelegatedEvents(d?: Document): void; export function spread( node: Element, accessor: (() => T) | T, @@ -29,7 +32,14 @@ export function spread( export function assign(node: Element, props: any, isSVG?: Boolean, skipChildren?: Boolean): void; export function setAttribute(node: Element, name: string, value: string): void; export function setAttributeNS(node: Element, namespace: string, name: string, value: string): void; -export function addEventListener(node: Element, name: string, handler: () => void, delegate: boolean): void; +export function className(node: Element, value: string): void; +export function innerHTML(node: Element, content: string): void; +export function addEventListener( + node: Element, + name: string, + handler: () => void, + delegate: boolean +): void; export function classList( node: Element, value: { [k: string]: boolean }, @@ -41,11 +51,21 @@ export function style( prev?: { [k: string]: string } ): void; export function getOwner(): unknown; -export function mergeProps(target: unknown, ...sources: unknown[]): unknown; +export function mergeProps(...sources: unknown[]): unknown; export function dynamicProperty(props: unknown, key: string): unknown; -export function hydrate(fn: () => JSX.Element, node: MountableElement): () => void; -export function gatherHydratable(node: Element): void; +export function hydrate( + fn: () => JSX.Element, + node: MountableElement, + options?: { renderId?: string } +): () => void; export function getHydrationKey(): string; -export function getNextElement(template: HTMLTemplateElement): Node; +export function getNextElement(template?: HTMLTemplateElement): Element; +export function getNextMatch(start: Node, elementName: string): Element; export function getNextMarker(start: Node): [Node, Array]; +export function useAssets(fn: () => string): void; +export function getAssets(): string; +export function Assets(props: { children?: JSX.Element }): JSX.Element; +export function HydrationScript(): JSX.Element; +export function NoHydration(props: { children?: JSX.Element }): JSX.Element; +export function generateHydrationScript(): string; \ No newline at end of file diff --git a/src/core.ts b/src/core.ts index a752543..ed16e0c 100644 --- a/src/core.ts +++ b/src/core.ts @@ -2,7 +2,8 @@ export { root, effect, memo, - createComponent + createComponent, + untrack } from "./lib" export const sharedConfig = {}; diff --git a/src/html.ts b/src/html.ts index ee11406..6bb0461 100644 --- a/src/html.ts +++ b/src/html.ts @@ -3,14 +3,18 @@ import { effect, style, insert, + untrack, + spread, createComponent, delegateEvents, classList, dynamicProperty, + mergeProps, setAttribute, setAttributeNS, addEventListener, Aliases, + PropAliases, Properties, ChildProperties, DelegatedEvents, @@ -22,14 +26,18 @@ export const html = createHTML({ effect, style, insert, + untrack, + spread, createComponent, delegateEvents, classList, + mergeProps, dynamicProperty, setAttribute, setAttributeNS, addEventListener, Aliases, + PropAliases, Properties, ChildProperties, DelegatedEvents, diff --git a/src/index.ts b/src/index.ts index 2b7c5ca..4afcffe 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,7 +1,5 @@ -export { root, cleanup, createSelector, Component, lazy, createContext, useContext, map, splitProps } from "./lib"; +export { root, cleanup, createSelector, Component, lazy, createContext, useContext, map, splitProps, untrack } from "./lib"; export type { Context, FunctionComponent, ComponentProps } from "./lib"; export * from "./client"; export type { JSX } from "./jsx" - - diff --git a/src/jsx.d.ts b/src/jsx.d.ts index fc64ab1..a5417ab 100644 --- a/src/jsx.d.ts +++ b/src/jsx.d.ts @@ -1,3 +1,5 @@ +import * as csstype from 'csstype'; + /** * Based on JSX types for Surplus and Inferno and adapted for `dom-expressions`. * @@ -11,7 +13,7 @@ export namespace JSX { | Node | ArrayElement | FunctionElement - | string + | (string & {}) | number | boolean | null @@ -21,9 +23,11 @@ export namespace JSX { (): Element; } interface ElementClass { - render(props: any): Element; + // empty, libs can define requirements downstream + } + interface ElementAttributesProperty { + // empty, libs can define requirements downstream } - type LibraryManagedAttributes = Props; interface ElementChildrenAttribute { children: {}; } @@ -50,1613 +54,240 @@ export namespace JSX { ref?: unknown | ((e: unknown) => void); } interface CustomAttributes { - ref?: T | ((el: T) => void); - classList?: { - [k: string]: boolean | undefined; - }; - } - interface Directives {} - interface ExplicitProperties {} - interface ExplicitAttributes {} - interface CustomEvents {} - interface CustomCaptureEvents {} - type DirectiveAttributes = { - [Key in keyof Directives as `use:${Key}`]?: Directives[Key]; - }; - type PropAttributes = { - [Key in keyof ExplicitProperties as `prop:${Key}`]?: ExplicitProperties[Key]; - }; - type AttrAttributes = { - [Key in keyof ExplicitAttributes as `attr:${Key}`]?: ExplicitAttributes[Key]; - }; - type OnAttributes = { - [Key in keyof CustomEvents as `on:${Key}`]?: EventHandler; - }; - type OnCaptureAttributes = { - [Key in keyof CustomEvents as `oncapture:${Key}`]?: EventHandler; - }; - interface DOMAttributes - extends CustomAttributes, - DirectiveAttributes, - PropAttributes, - AttrAttributes, - OnAttributes, - OnCaptureAttributes { - children?: Element; - innerHTML?: string; - innerText?: string; - textContent?: string; - onCopy?: EventHandlerUnion; - onCut?: EventHandlerUnion; - onPaste?: EventHandlerUnion; - onCompositionEnd?: EventHandlerUnion; - onCompositionStart?: EventHandlerUnion; - onCompositionUpdate?: EventHandlerUnion; - onFocus?: EventHandlerUnion; - onBlur?: EventHandlerUnion; - onChange?: EventHandlerUnion; - onInput?: EventHandlerUnion; - onReset?: EventHandlerUnion; - onSubmit?: EventHandlerUnion< - T, - Event & { - submitter: HTMLElement; - } - >; - onLoad?: EventHandlerUnion; - onError?: EventHandlerUnion; - onKeyDown?: EventHandlerUnion; - onKeyPress?: EventHandlerUnion; - onKeyUp?: EventHandlerUnion; - onGotPointerCapture?: EventHandlerUnion; - onLostPointerCapture?: EventHandlerUnion; - onPointerCancel?: EventHandlerUnion; - onPointerDown?: EventHandlerUnion; - onPointerEnter?: EventHandlerUnion; - onPointerLeave?: EventHandlerUnion; - onPointerMove?: EventHandlerUnion; - onPointerOver?: EventHandlerUnion; - onPointerOut?: EventHandlerUnion; - onPointerUp?: EventHandlerUnion; - onAbort?: EventHandlerUnion; - onCanPlay?: EventHandlerUnion; - onCanPlayThrough?: EventHandlerUnion; - onDurationChange?: EventHandlerUnion; - onEmptied?: EventHandlerUnion; - onEncrypted?: EventHandlerUnion; - onEnded?: EventHandlerUnion; - onLoadedData?: EventHandlerUnion; - onLoadedMetadata?: EventHandlerUnion; - onLoadStart?: EventHandlerUnion; - onPause?: EventHandlerUnion; - onPlay?: EventHandlerUnion; - onPlaying?: EventHandlerUnion; - onProgress?: EventHandlerUnion; - onRateChange?: EventHandlerUnion; - onSeeked?: EventHandlerUnion; - onSeeking?: EventHandlerUnion; - onStalled?: EventHandlerUnion; - onSuspend?: EventHandlerUnion; - onTimeUpdate?: EventHandlerUnion; - onVolumeChange?: EventHandlerUnion; - onWaiting?: EventHandlerUnion; - onClick?: EventHandlerUnion; - onContextMenu?: EventHandlerUnion; - onDblClick?: EventHandlerUnion; - onDrag?: EventHandlerUnion; - onDragEnd?: EventHandlerUnion; - onDragEnter?: EventHandlerUnion; - onDragExit?: EventHandlerUnion; - onDragLeave?: EventHandlerUnion; - onDragOver?: EventHandlerUnion; - onDragStart?: EventHandlerUnion; - onDrop?: EventHandlerUnion; - onMouseDown?: EventHandlerUnion; - onMouseEnter?: EventHandlerUnion; - onMouseLeave?: EventHandlerUnion; - onMouseMove?: EventHandlerUnion; - onMouseOut?: EventHandlerUnion; - onMouseOver?: EventHandlerUnion; - onMouseUp?: EventHandlerUnion; - onSelect?: EventHandlerUnion; - onTouchCancel?: EventHandlerUnion; - onTouchEnd?: EventHandlerUnion; - onTouchMove?: EventHandlerUnion; - onTouchStart?: EventHandlerUnion; - onScroll?: EventHandlerUnion; - onWheel?: EventHandlerUnion; - onAnimationStart?: EventHandlerUnion; - onAnimationEnd?: EventHandlerUnion; - onAnimationIteration?: EventHandlerUnion; - onTransitionEnd?: EventHandlerUnion; - - // lower case events - oncopy?: EventHandlerUnion; - oncut?: EventHandlerUnion; - onpaste?: EventHandlerUnion; - oncompositionend?: EventHandlerUnion; - oncompositionstart?: EventHandlerUnion; - oncompositionupdate?: EventHandlerUnion; - onfocus?: EventHandlerUnion; - onblur?: EventHandlerUnion; - onchange?: EventHandlerUnion; - oninput?: EventHandlerUnion; - onreset?: EventHandlerUnion; - onsubmit?: EventHandlerUnion< - T, - Event & { - submitter: HTMLElement; - } - >; - onload?: EventHandlerUnion; - onerror?: EventHandlerUnion; - onkeydown?: EventHandlerUnion; - onkeypress?: EventHandlerUnion; - onkeyup?: EventHandlerUnion; - ongotpointercapture?: EventHandlerUnion; - onlostpointercapture?: EventHandlerUnion; - onpointercancel?: EventHandlerUnion; - onpointerdown?: EventHandlerUnion; - onpointerenter?: EventHandlerUnion; - onpointerleave?: EventHandlerUnion; - onpointermove?: EventHandlerUnion; - onpointerover?: EventHandlerUnion; - onpointerout?: EventHandlerUnion; - onpointerup?: EventHandlerUnion; - onabort?: EventHandlerUnion; - oncanplay?: EventHandlerUnion; - oncanplaythrough?: EventHandlerUnion; - ondurationchange?: EventHandlerUnion; - onemptied?: EventHandlerUnion; - onencrypted?: EventHandlerUnion; - onended?: EventHandlerUnion; - onloadeddata?: EventHandlerUnion; - onloadedmetadata?: EventHandlerUnion; - onloadstart?: EventHandlerUnion; - onpause?: EventHandlerUnion; - onplay?: EventHandlerUnion; - onplaying?: EventHandlerUnion; - onprogress?: EventHandlerUnion; - onratechange?: EventHandlerUnion; - onseeked?: EventHandlerUnion; - onseeking?: EventHandlerUnion; - onstalled?: EventHandlerUnion; - onsuspend?: EventHandlerUnion; - ontimeupdate?: EventHandlerUnion; - onvolumechange?: EventHandlerUnion; - onwaiting?: EventHandlerUnion; - onclick?: EventHandlerUnion; - oncontextmenu?: EventHandlerUnion; - ondblclick?: EventHandlerUnion; - ondrag?: EventHandlerUnion; - ondragend?: EventHandlerUnion; - ondragenter?: EventHandlerUnion; - ondragexit?: EventHandlerUnion; - ondragleave?: EventHandlerUnion; - ondragover?: EventHandlerUnion; - ondragstart?: EventHandlerUnion; - ondrop?: EventHandlerUnion; - onmousedown?: EventHandlerUnion; - onmouseenter?: EventHandlerUnion; - onmouseleave?: EventHandlerUnion; - onmousemove?: EventHandlerUnion; - onmouseout?: EventHandlerUnion; - onmouseover?: EventHandlerUnion; - onmouseup?: EventHandlerUnion; - onselect?: EventHandlerUnion; - ontouchcancel?: EventHandlerUnion; - ontouchend?: EventHandlerUnion; - ontouchmove?: EventHandlerUnion; - ontouchstart?: EventHandlerUnion; - onscroll?: EventHandlerUnion; - onwheel?: EventHandlerUnion; - onanimationstart?: EventHandlerUnion; - onanimationend?: EventHandlerUnion; - onanimationiteration?: EventHandlerUnion; - ontransitionend?: EventHandlerUnion; - } - type CSSWideKeyword = "initial" | "inherit" | "unset"; - type CSSPercentage = string; - type CSSLength = number | string; - interface CSSProperties { - /** - * Aligns a flex container's lines within the flex container when there is extra space in the cross-axis, similar to how justify-content aligns individual items within the main-axis. - */ - "align-content"?: - | CSSWideKeyword - | "flex-start" - | "flex-end" - | "center" - | "space-between" - | "space-around" - | "stretch"; - /** - * Sets the default alignment in the cross axis for all of the flex container's items, including anonymous flex items, similarly to how justify-content aligns items along the main axis. - */ - "align-items"?: CSSWideKeyword | "flex-start" | "flex-end" | "center" | "baseline" | "stretch"; - /** - * Allows the default alignment to be overridden for individual flex items. - */ - "align-self"?: - | CSSWideKeyword - | "auto" - | "flex-start" - | "flex-end" - | "center" - | "baseline" - | "stretch"; - /** - * This property allows precise alignment of elements, such as graphics, - * that do not have a baseline-table or lack the desired baseline in their baseline-table. - * With the alignment-adjust property, the position of the baseline identified by the alignment-baseline - * can be explicitly determined. It also determines precisely the alignment point for each glyph within a textual element. - */ - "alignment-adjust"?: CSSWideKeyword | any; - "alignment-baseline"?: CSSWideKeyword | any; - /** - * Defines a length of time to elapse before an animation starts, allowing an animation to begin execution some time after it is applied. - */ - "animation-delay"?: CSSWideKeyword | any; - /** - * Defines whether an animation should run in reverse on some or all cycles. - */ - "animation-direction"?: CSSWideKeyword | any; - /** - * Defines how long an animation runs for. - */ - "animation-duration"?: CSSWideKeyword | any; - /** - * Specifies how many times an animation cycle should play. - */ - "animation-iteration-count"?: CSSWideKeyword | any; - /** - * Defines the list of animations that apply to the element. - */ - "animation-name"?: CSSWideKeyword | any; - /** - * Defines whether an animation is running or paused. - */ - "animation-play-state"?: CSSWideKeyword | any; - /** - * Allows changing the style of any element to platform-based interface elements or vice versa. - */ - appearance?: CSSWideKeyword | any; - /** - * Determines whether or not the “back” side of a transformed element is visible when facing the viewer. - */ - "backface-visibility"?: CSSWideKeyword | any; - /** - * Shorthand property to set the values for one or more of: - * background-clip, background-color, background-image, - * background-origin, background-position, background-repeat, - * background-size, and background-attachment. - */ - background?: CSSWideKeyword | any; - /** - * If a background-image is specified, this property determines - * whether that image's position is fixed within the viewport, - * or scrolls along with its containing block. - * See CSS 3 background-attachment property https://drafts.csswg.org/css-backgrounds-3/#the-background-attachment - */ - "background-attachment"?: CSSWideKeyword | "scroll" | "fixed" | "local"; - /** - * This property describes how the element's background images should blend with each other and the element's background color. - * The value is a list of blend modes that corresponds to each background image. Each element in the list will apply to the - * corresponding element of background-image. If a property doesn’t have enough comma-separated values to match the number of layers, - * the UA must calculate its used value by repeating the list of values until there are enough. - */ - "background-blend-mode"?: CSSWideKeyword | any; - /** - * Sets the background color of an element. - */ - "background-color"?: CSSWideKeyword | any; - "background-composite"?: CSSWideKeyword | any; - /** - * Applies one or more background images to an element. These can be any valid CSS image, including url() paths to image files or CSS gradients. - */ - "background-image"?: CSSWideKeyword | any; - /** - * Specifies what the background-position property is relative to. - */ - "background-origin"?: CSSWideKeyword | any; - /** - * Sets the position of a background image. - */ - "background-position"?: CSSWideKeyword | any; - /** - * Background-repeat defines if and how background images will be repeated after they have been sized and positioned - */ - "background-repeat"?: CSSWideKeyword | any; - /** - * Defines the size of the background images - */ - "background-size"?: CSSWideKeyword | any; - /** - * Obsolete - spec retired, not implemented. - */ - "baseline-shift"?: CSSWideKeyword | any; - /** - * Non standard. Sets or retrieves the location of the Dynamic HTML (DHTML) behavior. - */ - behavior?: CSSWideKeyword | any; - /** - * Shorthand property that defines the different properties of all four sides of an element's border in a single declaration. - * It can be used to set border-width, border-style and border-color, or a subset of these. - */ - border?: CSSWideKeyword | any; - /** - * Shorthand that sets the values of border-bottom-color, - * border-bottom-style, and border-bottom-width. - */ - "border-bottom"?: CSSWideKeyword | any; - /** - * Sets the color of the bottom border of an element. - */ - "border-bottom-color"?: CSSWideKeyword | any; - /** - * Defines the shape of the border of the bottom-left corner. - */ - "border-bottom-left-radius"?: CSSWideKeyword | CSSLength; - /** - * Defines the shape of the border of the bottom-right corner. - */ - "border-bottom-right-radius"?: CSSWideKeyword | CSSLength; - /** - * Sets the line style of the bottom border of a box. - */ - "border-bottom-style"?: CSSWideKeyword | any; - /** - * Sets the width of an element's bottom border. To set all four borders, - * use the border-width shorthand property which sets the values simultaneously for border-top-width, - * border-right-width, border-bottom-width, and border-left-width. - */ - "border-bottom-width"?: CSSWideKeyword | any; - /** - * Border-collapse can be used for collapsing the borders between table cells - */ - "border-collapse"?: CSSWideKeyword | any; - /** - * The CSS border-color property sets the color of an element's four borders. - * This property can have from one to four values, made up of the elementary properties: - * • border-top-color - * • border-right-color - * • border-bottom-color - * • border-left-color The default color is the currentColor of each of these values. - * If you provide one value, it sets the color for the element. Two values set the horizontal and vertical values, - * respectively. Providing three values sets the top, vertical, and bottom values, in that order. - * Four values set all for sides: top, right, bottom, and left, in that order. - */ - "border-color"?: CSSWideKeyword | any; - /** - * Specifies different corner clipping effects, such as scoop (inner curves), bevel (straight cuts) or notch (cut-off rectangles). - * Works along with border-radius to specify the size of each corner effect. - */ - "border-corner-shape"?: CSSWideKeyword | any; - /** - * The property border-image-source is used to set the image to be used instead of the border style. - * If this is set to none the border-style is used instead. - */ - "border-image-source"?: CSSWideKeyword | any; - /** - * The border-image-width CSS property defines the offset to use for dividing the border image in nine parts, - * the top-left corner, central top edge, top-right-corner, central right edge, bottom-right corner, central bottom edge, - * bottom-left corner, and central right edge. They represent inward distance from the top, right, bottom, and left edges. - */ - "border-image-width"?: CSSWideKeyword | any; - /** - * Shorthand property that defines the border-width, border-style and border-color of an element's left border in a single declaration. - * Note that you can use the corresponding longhand properties to set specific individual properties of the left border — border-left-width, - * border-left-style and border-left-color. - */ - "border-left"?: CSSWideKeyword | any; - /** - * The CSS border-left-color property sets the color of an element's left border. This page explains the border-left-color value, - * but often you will find it more convenient to fix the border's left color as part of a shorthand set, either border-left or border-color. - * Colors can be defined several ways. For more information, see Usage. - */ - "border-left-color"?: CSSWideKeyword | any; - /** - * Sets the style of an element's left border. To set all four borders, use the shorthand property, border-style. - * Otherwise, you can set the borders individually with border-top-style, border-right-style, border-bottom-style, border-left-style. - */ - "border-left-style"?: CSSWideKeyword | any; - /** - * Sets the width of an element's left border. To set all four borders, - * use the border-width shorthand property which sets the values simultaneously for border-top-width, - * border-right-width, border-bottom-width, and border-left-width. - */ - "border-left-width"?: CSSWideKeyword | any; - /** - * Shorthand property that sets the rounding of all four corners. - */ - "border-radius"?: CSSWideKeyword | CSSLength; - /** - * Shorthand property that defines the border-width, border-style and border-color of an element's right border - * in a single declaration. Note that you can use the corresponding longhand properties to set specific - * individual properties of the right border — border-right-width, border-right-style and border-right-color. - */ - "border-right"?: CSSWideKeyword | any; - /** - * Sets the color of an element's right border. This page explains the border-right-color value, - * but often you will find it more convenient to fix the border's right color as part of a shorthand set, - * either border-right or border-color. - * Colors can be defined several ways. For more information, see Usage. - */ - "border-right-color"?: CSSWideKeyword | any; - /** - * Sets the style of an element's right border. To set all four borders, use the shorthand property, - * border-style. Otherwise, you can set the borders individually with border-top-style, border-right-style, - * border-bottom-style, border-left-style. - */ - "border-right-style"?: CSSWideKeyword | any; - /** - * Sets the width of an element's right border. To set all four borders, - * use the border-width shorthand property which sets the values simultaneously for border-top-width, - * border-right-width, border-bottom-width, and border-left-width. - */ - "border-right-width"?: CSSWideKeyword | any; - /** - * Specifies the distance between the borders of adjacent cells. - */ - "border-spacing"?: CSSWideKeyword | any; - /** - * Sets the style of an element's four borders. This property can have from one to four values. - * With only one value, the value will be applied to all four borders; - * otherwise, this works as a shorthand property for each of border-top-style, border-right-style, - * border-bottom-style, border-left-style, where each border style may be assigned a separate value. - */ - "border-style"?: CSSWideKeyword | any; - /** - * Shorthand property that defines the border-width, border-style and border-color of an element's top border - * in a single declaration. Note that you can use the corresponding longhand properties to set specific - * individual properties of the top border — border-top-width, border-top-style and border-top-color. - */ - "border-top"?: CSSWideKeyword | any; - /** - * Sets the color of an element's top border. This page explains the border-top-color value, - * but often you will find it more convenient to fix the border's top color as part of a shorthand set, - * either border-top or border-color. - * Colors can be defined several ways. For more information, see Usage. - */ - "border-top-color"?: CSSWideKeyword | any; - /** - * Sets the rounding of the top-left corner of the element. - */ - "border-top-left-radius"?: CSSWideKeyword | CSSLength; - /** - * Sets the rounding of the top-right corner of the element. - */ - "border-top-right-radius"?: CSSWideKeyword | CSSLength; - /** - * Sets the style of an element's top border. To set all four borders, use the shorthand property, border-style. - * Otherwise, you can set the borders individually with border-top-style, border-right-style, border-bottom-style, border-left-style. - */ - "border-top-style"?: CSSWideKeyword | any; - /** - * Sets the width of an element's top border. To set all four borders, - * use the border-width shorthand property which sets the values simultaneously for border-top-width, - * border-right-width, border-bottom-width, and border-left-width. - */ - "border-top-width"?: CSSWideKeyword | any; - /** - * Sets the width of an element's four borders. This property can have from one to four values. - * This is a shorthand property for setting values simultaneously for border-top-width, - * border-right-width, border-bottom-width, and border-left-width. - */ - "border-width"?: CSSWideKeyword | any; - /** - * This property specifies how far an absolutely positioned box's bottom margin edge - * is offset above the bottom edge of the box's containing block. For relatively positioned boxes, - * the offset is with respect to the bottom edges of the box itself - * (i.e., the box is given a position in the normal flow, then offset from that position according to these properties). - */ - bottom?: CSSWideKeyword | any; - /** - * Obsolete. - */ - "box-align"?: CSSWideKeyword | any; - /** - * Breaks a box into fragments creating new borders, - * padding and repeating backgrounds or lets it stay as a continuous box on a page break, - * column break, or, for inline elements, at a line break. - */ - "box-decoration-break"?: CSSWideKeyword | any; - /** - * Deprecated - */ - "box-direction"?: CSSWideKeyword | any; - /** - * Do not use. This property has been replaced by the flex-wrap property. - * Gets or sets a value that specifies the direction to add successive rows or columns when the value of box-lines is set to multiple. - */ - "box-line-progression"?: CSSWideKeyword | any; - /** - * Do not use. This property has been replaced by the flex-wrap property. - * Gets or sets a value that specifies whether child elements wrap onto multiple lines or columns based on the space available in the object. - */ - "box-lines"?: CSSWideKeyword | any; - /** - * Do not use. This property has been replaced by flex-order. - * Specifies the ordinal group that a child element of the object belongs to. - * This ordinal value identifies the display order (along the axis defined by the box-orient property) for the group. - */ - "box-ordinal-group"?: CSSWideKeyword | any; - /** - * Deprecated. - */ - "box-flex"?: CSSWideKeyword | number; - /** - * Deprecated. - */ - "box-flex-group"?: CSSWideKeyword | number; - /** - * Cast a drop shadow from the frame of almost any element. - * MDN: https://developer.mozilla.org/en-US/docs/Web/CSS/box-shadow - */ - "box-shadow"?: CSSWideKeyword | any; - /** - * The CSS break-after property allows you to force a break on multi-column layouts. - * More specifically, it allows you to force a break after an element. - * It allows you to determine if a break should occur, and what type of break it should be. - * The break-after CSS property describes how the page, column or region break behaves after the generated box. - * If there is no generated box, the property is ignored. - */ - "break-after"?: CSSWideKeyword | any; - /** - * Control page/column/region breaks that fall above a block of content - */ - "break-before"?: CSSWideKeyword | any; - /** - * Control page/column/region breaks that fall within a block of content - */ - "break-inside"?: CSSWideKeyword | any; - /** - * The clear CSS property specifies if an element can be positioned next to - * or must be positioned below the floating elements that precede it in the markup. - */ - clear?: CSSWideKeyword | any; - /** - * Deprecated; see clip-path. - * Lets you specify the dimensions of an absolutely positioned element that should be visible, - * and the element is clipped into this shape, and displayed. - */ - clip?: CSSWideKeyword | any; - /** - * Clipping crops an graphic, so that only a portion of the graphic is rendered, or filled. - * This clip-rule property, when used with the clip-path property, defines which clip rule, or algorithm, - * to use when filling the different parts of a graphics. - */ - "clip-rule"?: CSSWideKeyword | any; - /** - * The color property sets the color of an element's foreground content (usually text), - * accepting any standard CSS color from keywords and hex values to RGB(a) and HSL(a). - */ - color?: CSSWideKeyword | any; - /** - * Describes the number of columns of the element. - * See CSS 3 column-count property https://www.w3.org/TR/css3-multicol/#cc - */ - "column-count"?: CSSWideKeyword | number | "auto"; - /** - * Specifies how to fill columns (balanced or sequential). - */ - "column-fill"?: CSSWideKeyword | any; - /** - * The column-gap property controls the width of the gap between columns in multi-column elements. - */ - "column-gap"?: CSSWideKeyword | any; - /** - * Sets the width, style, and color of the rule between columns. - */ - "column-rule"?: CSSWideKeyword | any; - /** - * Specifies the color of the rule between columns. - */ - "column-rule-color"?: CSSWideKeyword | any; - /** - * Specifies the width of the rule between columns. - */ - "column-rule-width"?: CSSWideKeyword | any; - /** - * The column-span CSS property makes it possible for an element to span across all columns when its value is set to all. - * An element that spans more than one column is called a spanning element. - */ - "column-span"?: CSSWideKeyword | any; - /** - * Specifies the width of columns in multi-column elements. - */ - "column-width"?: CSSWideKeyword | any; - /** - * This property is a shorthand property for setting column-width and/or column-count. - */ - columns?: CSSWideKeyword | any; - /** - * The counter-increment property accepts one or more names of counters (identifiers), - * each one optionally followed by an integer which specifies the value by which the counter should be incremented - * (e.g. if the value is 2, the counter increases by 2 each time it is invoked). - */ - "counter-increment"?: CSSWideKeyword | any; - /** - * The counter-reset property contains a list of one or more names of counters, - * each one optionally followed by an integer (otherwise, the integer defaults to 0.). - * Each time the given element is invoked, the counters specified by the property are set to the given integer. - */ - "counter-reset"?: CSSWideKeyword | any; - /** - * The cue property specifies sound files (known as an "auditory icon") to be played by speech media agents - * before and after presenting an element's content; if only one file is specified, it is played both before and after. - * The volume at which the file(s) should be played, relative to the volume of the main element, may also be specified. - * The icon files may also be set separately with the cue-before and cue-after properties. - */ - cue?: CSSWideKeyword | any; - /** - * The cue-after property specifies a sound file (known as an "auditory icon") to be played by speech media agents - * after presenting an element's content; the volume at which the file should be played may also be specified. - * The shorthand property cue sets cue sounds for both before and after the element is presented. - */ - "cue-after"?: CSSWideKeyword | any; - /** - * Specifies the mouse cursor displayed when the mouse pointer is over an element. - */ - cursor?: CSSWideKeyword | any; - /** - * The direction CSS property specifies the text direction/writing direction. The rtl is used for Hebrew or Arabic text, the ltr is for other languages. - */ - direction?: CSSWideKeyword | any; - /** - * This property specifies the type of rendering box used for an element. It is a shorthand property for many other display properties. - */ - display?: CSSWideKeyword | any; - /** - * The ‘fill’ property paints the interior of the given graphical element. - * The area to be painted consists of any areas inside the outline of the shape. - * To determine the inside of the shape, all subpaths are considered, - * and the interior is determined according to the rules associated with the current value of the ‘fill-rule’ property. - * The zero-width geometric outline of a shape is included in the area to be painted. - */ - fill?: CSSWideKeyword | any; - /** - * SVG: Specifies the opacity of the color or the content the current object is filled with. - * See SVG 1.1 https://www.w3.org/TR/SVG/painting.html#FillOpacityProperty - */ - "fill-opacity"?: CSSWideKeyword | number; - /** - * The ‘fill-rule’ property indicates the algorithm which is to be used to determine what parts of the canvas are included inside the shape. - * For a simple, non-intersecting path, it is intuitively clear what region lies "inside"; - * however, for a more complex path, such as a path that intersects itself or where one subpath encloses another, - * the interpretation of "inside" is not so obvious. - * The ‘fill-rule’ property provides two options for how the inside of a shape is determined: - */ - "fill-rule"?: CSSWideKeyword | any; - /** - * Applies various image processing effects. This property is largely unsupported. See Compatibility section for more information. - */ - filter?: CSSWideKeyword | any; - /** - * Shorthand for `flex-grow`, `flex-shrink`, and `flex-basis`. - */ - flex?: CSSWideKeyword | number | string; - /** - * Obsolete, do not use. This property has been renamed to align-items. - * Specifies the alignment (perpendicular to the layout axis defined by the flex-direction property) of child elements of the object. - */ - "flex-align"?: CSSWideKeyword | any; - /** - * The flex-basis CSS property describes the initial main size of the flex item - * before any free space is distributed according to the flex factors described in the flex property (flex-grow and flex-shrink). - */ - "flex-basis"?: CSSWideKeyword | any; - /** - * The flex-direction CSS property describes how flex items are placed in the flex container, by setting the direction of the flex container's main axis. - */ - "flex-direction"?: CSSWideKeyword | "row" | "row-reverse" | "column" | "column-reverse"; - /** - * The flex-flow CSS property defines the flex container's main and cross axis. It is a shorthand property for the flex-direction and flex-wrap properties. - */ - "flex-flow"?: CSSWideKeyword | string; - /** - * Specifies the flex grow factor of a flex item. - * See CSS flex-grow property https://drafts.csswg.org/css-flexbox-1/#flex-grow-property - */ - "flex-grow"?: CSSWideKeyword | number; - /** - * Do not use. This property has been renamed to align-self - * Specifies the alignment (perpendicular to the layout axis defined by flex-direction) of child elements of the object. - */ - "flex-item-align"?: CSSWideKeyword | any; - /** - * Do not use. This property has been renamed to align-content. - * Specifies how a flexbox's lines align within the flexbox when there is extra space along the axis that is perpendicular to the axis defined by the flex-direction property. - */ - "flex-line-pack"?: CSSWideKeyword | any; - /** - * Gets or sets a value that specifies the ordinal group that a flexbox element belongs to. This ordinal value identifies the display order for the group. - */ - "flex-order"?: CSSWideKeyword | any; - /** - * Specifies the flex shrink factor of a flex item. - * See CSS flex-shrink property https://drafts.csswg.org/css-flexbox-1/#flex-shrink-property - */ - "flex-shrink"?: CSSWideKeyword | number; - /** - * Specifies whether flex items are forced into a single line or can be wrapped onto multiple lines. - * If wrapping is allowed, this property also enables you to control the direction in which lines are stacked. - * See CSS flex-wrap property https://drafts.csswg.org/css-flexbox-1/#flex-wrap-property - */ - "flex-wrap"?: CSSWideKeyword | "nowrap" | "wrap" | "wrap-reverse"; - /** - * Elements which have the style float are floated horizontally. - * These elements can move as far to the left or right of the containing element. - * All elements after the floating element will flow around it, but elements before the floating element are not impacted. - * If several floating elements are placed after each other, they will float next to each other as long as there is room. - */ - float?: CSSWideKeyword | any; - /** - * Flows content from a named flow (specified by a corresponding flow-into) through selected elements to form a dynamic chain of layout regions. - */ - "flow-from"?: CSSWideKeyword | any; - /** - * The font property is shorthand that allows you to do one of two things: you can either set up six of the most mature font properties in one line, - * or you can set one of a choice of keywords to adopt a system font setting. - */ - font?: CSSWideKeyword | any; - /** - * The font-family property allows one or more font family names and/or generic family names to be specified for usage on the selected element(s)' text. - * The browser then goes through the list; for each character in the selection it applies the first font family that has an available glyph for that character. - */ - "font-family"?: CSSWideKeyword | any; - /** - * The font-kerning property allows contextual adjustment of inter-glyph spacing, i.e. the spaces between the characters in text. - * This property controls metric kerning - that utilizes adjustment data contained in the font. Optical Kerning is not supported as yet. - */ - "font-kerning"?: CSSWideKeyword | any; - /** - * Specifies the size of the font. Used to compute em and ex units. - * See CSS 3 font-size property https://www.w3.org/TR/css-fonts-3/#propdef-font-size - */ - "font-size"?: - | CSSWideKeyword - | "xx-small" - | "x-small" - | "small" - | "medium" - | "large" - | "x-large" - | "xx-large" - | "larger" - | "smaller" - | CSSLength - | CSSPercentage; - /** - * The font-size-adjust property adjusts the font-size of the fallback fonts defined with font-family, - * so that the x-height is the same no matter what font is used. - * This preserves the readability of the text when fallback happens. - * See CSS 3 font-size-adjust property https://www.w3.org/TR/css-fonts-3/#propdef-font-size-adjust - */ - "font-size-adjust"?: CSSWideKeyword | "none" | number; - /** - * Allows you to expand or condense the widths for a normal, condensed, or expanded font face. - * See CSS 3 font-stretch property https://drafts.csswg.org/css-fonts-3/#propdef-font-stretch - */ - "font-stretch"?: - | CSSWideKeyword - | "normal" - | "ultra-condensed" - | "extra-condensed" - | "condensed" - | "semi-condensed" - | "semi-expanded" - | "expanded" - | "extra-expanded" - | "ultra-expanded"; - /** - * The font-style property allows normal, italic, or oblique faces to be selected. - * Italic forms are generally cursive in nature while oblique faces are typically sloped versions of the regular face. - * Oblique faces can be simulated by artificially sloping the glyphs of the regular face. - * See CSS 3 font-style property https://www.w3.org/TR/css-fonts-3/#propdef-font-style - */ - "font-style"?: CSSWideKeyword | "normal" | "italic" | "oblique"; - /** - * This value specifies whether the user agent is allowed to synthesize bold or oblique font faces when a font family lacks bold or italic faces. - */ - "font-synthesis"?: CSSWideKeyword | any; - /** - * The font-variant property enables you to select the small-caps font within a font family. - */ - "font-variant"?: CSSWideKeyword | any; - /** - * Fonts can provide alternate glyphs in addition to default glyph for a character. This property provides control over the selection of these alternate glyphs. - */ - "font-variant-alternates"?: CSSWideKeyword | any; - /** - * Specifies the weight or boldness of the font. - * See CSS 3 'font-weight' property https://www.w3.org/TR/css-fonts-3/#propdef-font-weight - */ - "font-weight"?: - | CSSWideKeyword - | "normal" - | "bold" - | "bolder" - | "lighter" - | 100 - | 200 - | 300 - | 400 - | 500 - | 600 - | 700 - | 800 - | 900; - /** - * Lays out one or more grid items bound by 4 grid lines. Shorthand for setting grid-column-start, grid-column-end, grid-row-start, and grid-row-end in a single declaration. - */ - "grid-area"?: CSSWideKeyword | any; - /** - * Controls a grid item's placement in a grid area, particularly grid position and a grid span. Shorthand for setting grid-column-start and grid-column-end in a single declaration. - */ - "grid-column"?: CSSWideKeyword | any; - /** - * Controls a grid item's placement in a grid area as well as grid position and a grid span. - * The grid-column-end property (with grid-row-start, grid-row-end, and grid-column-start) determines a grid item's placement by specifying the grid lines of a grid item's grid area. - */ - "grid-column-end"?: CSSWideKeyword | any; - /** - * Determines a grid item's placement by specifying the starting grid lines of a grid item's grid area. - * A grid item's placement in a grid area consists of a grid position and a grid span. - * See also ( grid-row-start, grid-row-end, and grid-column-end) - */ - "grid-column-start"?: CSSWideKeyword | any; - /** - * Gets or sets a value that indicates which row an element within a Grid should appear in. Shorthand for setting grid-row-start and grid-row-end in a single declaration. - */ - "grid-row"?: CSSWideKeyword | any; - /** - * Determines a grid item’s placement by specifying the block-end. A grid item's placement in a grid area consists of a grid position and a grid span. - * The grid-row-end property (with grid-row-start, grid-column-start, and grid-column-end) determines a grid item's placement by specifying the grid lines of a grid item's grid area. - */ - "grid-row-end"?: CSSWideKeyword | any; - /** - * Specifies a row position based upon an integer location, string value, or desired row size. - * css/properties/grid-row is used as short-hand for grid-row-position and grid-row-position - */ - "grid-row-position"?: CSSWideKeyword | any; - "grid-row-span"?: CSSWideKeyword | any; - /** - * Specifies named grid areas which are not associated with any particular grid item, but can be referenced from the grid-placement properties. - * The syntax of the grid-template-areas property also provides a visualization of the structure of the grid, making the overall layout of the grid container easier to understand. - */ - "grid-template-areas"?: CSSWideKeyword | any; - /** - * Specifies (with grid-template-rows) the line names and track sizing functions of the grid. - * Each sizing function can be specified as a length, a percentage of the grid container’s size, - * a measurement of the contents occupying the column or row, or a fraction of the free space in the grid. - */ - "grid-template-columns"?: CSSWideKeyword | any; - /** - * Specifies (with grid-template-columns) the line names and track sizing functions of the grid. - * Each sizing function can be specified as a length, a percentage of the grid container’s size, - * a measurement of the contents occupying the column or row, or a fraction of the free space in the grid. - */ - "grid-template-rows"?: CSSWideKeyword | any; - /** - * Sets the height of an element. The content area of the element height does not include the padding, border, and margin of the element. - */ - height?: CSSWideKeyword | any; - /** - * Specifies the minimum number of characters in a hyphenated word - */ - "hyphenate-limit-chars"?: CSSWideKeyword | any; - /** - * Indicates the maximum number of successive hyphenated lines in an element. The ‘no-limit’ value means that there is no limit. - */ - "hyphenate-limit-lines"?: CSSWideKeyword | any; - /** - * Specifies the maximum amount of trailing whitespace (before justification) that may be left in a line before hyphenation is triggered - * to pull part of a word from the next line back up into the current one. - */ - "hyphenate-limit-zone"?: CSSWideKeyword | any; - /** - * Specifies whether or not words in a sentence can be split by the use of a manual or automatic hyphenation mechanism. - */ - hyphens?: CSSWideKeyword | any; - "ime-mode"?: CSSWideKeyword | any; - /** - * Defines how the browser distributes space between and around flex items - * along the main-axis of their container. - * See CSS justify-content property https://www.w3.org/TR/css-flexbox-1/#justify-content-property - */ - "justify-content"?: - | CSSWideKeyword - | "flex-start" - | "flex-end" - | "center" - | "space-between" - | "space-around" - | "space-evenly" - | "stretch"; - "layout-grid"?: CSSWideKeyword | any; - "layout-grid-char"?: CSSWideKeyword | any; - "layout-grid-line"?: CSSWideKeyword | any; - "layout-grid-mode"?: CSSWideKeyword | any; - "layout-grid-type"?: CSSWideKeyword | any; - /** - * Sets the left edge of an element - */ - left?: CSSWideKeyword | any; - /** - * The letter-spacing CSS property specifies the spacing behavior between text characters. - */ - "letter-spacing"?: CSSWideKeyword | any; - /** - * Deprecated. Gets or sets line-breaking rules for text in selected languages such as Japanese, Chinese, and Korean. - */ - "line-break"?: CSSWideKeyword | any; - "line-clamp"?: CSSWideKeyword | number; - /** - * Specifies the height of an inline block level element. - * See CSS 2.1 line-height property https://www.w3.org/TR/CSS21/visudet.html#propdef-line-height - */ - "line-height"?: CSSWideKeyword | "normal" | number | CSSLength | CSSPercentage; - /** - * Shorthand property that sets the list-style-type, list-style-position and list-style-image properties in one declaration. - */ - "list-style"?: CSSWideKeyword | any; - /** - * This property sets the image that will be used as the list item marker. When the image is available, - * it will replace the marker set with the 'list-style-type' marker. That also means that if the image is not available, - * it will show the style specified by list-style-property - */ - "list-style-image"?: CSSWideKeyword | any; - /** - * Specifies if the list-item markers should appear inside or outside the content flow. - */ - "list-style-position"?: CSSWideKeyword | any; - /** - * Specifies the type of list-item marker in a list. - */ - "list-style-type"?: CSSWideKeyword | any; - /** - * The margin property is shorthand to allow you to set all four margins of an element at once. - * Its equivalent longhand properties are margin-top, margin-right, margin-bottom and margin-left. - * Negative values are also allowed. - */ - margin?: CSSWideKeyword | any; - /** - * margin-bottom sets the bottom margin of an element. - */ - "margin-bottom"?: CSSWideKeyword | any; - /** - * margin-left sets the left margin of an element. - */ - "margin-left"?: CSSWideKeyword | any; - /** - * margin-right sets the right margin of an element. - */ - "margin-right"?: CSSWideKeyword | any; - /** - * margin-top sets the top margin of an element. - */ - "margin-top"?: CSSWideKeyword | any; - /** - * The marquee-direction determines the initial direction in which the marquee content moves. - */ - "marquee-direction"?: CSSWideKeyword | any; - /** - * The 'marquee-style' property determines a marquee's scrolling behavior. - */ - "marquee-style"?: CSSWideKeyword | any; - /** - * This property is shorthand for setting mask-image, mask-mode, mask-repeat, mask-position, mask-clip, mask-origin, mask-composite and mask-size. - * Omitted values are set to their original properties' initial values. - */ - mask?: CSSWideKeyword | any; - /** - * This property is shorthand for setting mask-border-source, mask-border-slice, mask-border-width, mask-border-outset, and mask-border-repeat. - * Omitted values are set to their original properties' initial values. - */ - "mask-border"?: CSSWideKeyword | any; - /** - * This property specifies how the images for the sides and the middle part of the mask image are scaled and tiled. - * The first keyword applies to the horizontal sides, the second one applies to the vertical ones. - * If the second keyword is absent, it is assumed to be the same as the first, similar to the CSS border-image-repeat property. - */ - "mask-border-repeat"?: CSSWideKeyword | any; - /** - * This property specifies inward offsets from the top, right, bottom, and left edges of the mask image, - * dividing it into nine regions: four corners, four edges, and a middle. - * The middle image part is discarded and treated as fully transparent black unless the fill keyword is present. - * The four values set the top, right, bottom and left offsets in that order, similar to the CSS border-image-slice property. - */ - "mask-border-slice"?: CSSWideKeyword | any; - /** - * Specifies an image to be used as a mask. An image that is empty, fails to download, is non-existent, or cannot be displayed is ignored and does not mask the element. - */ - "mask-border-source"?: CSSWideKeyword | any; - /** - * This property sets the width of the mask box image, similar to the CSS border-image-width property. - */ - "mask-border-width"?: CSSWideKeyword | any; - /** - * Determines the mask painting area, which defines the area that is affected by the mask. - * The painted content of an element may be restricted to this area. - */ - "mask-clip"?: CSSWideKeyword | any; - /** - * For elements rendered as a single box, specifies the mask positioning area. - * For elements rendered as multiple boxes (e.g., inline boxes on several lines, boxes on several pages) - * specifies which boxes box-decoration-break operates on to determine the mask positioning area(s). - */ - "mask-origin"?: CSSWideKeyword | any; - /** - * This property must not be used. It is no longer included in any standard or standard track specification, - * nor is it implemented in any browser. It is only used when the text-align-last property is set to size. - * It controls allowed adjustments of font-size to fit line content. - */ - "max-font-size"?: CSSWideKeyword | any; - /** - * Sets the maximum height for an element. It prevents the height of the element to exceed the specified value. - * If min-height is specified and is greater than max-height, max-height is overridden. - */ - "max-height"?: CSSWideKeyword | any; - /** - * Sets the maximum width for an element. It limits the width property to be larger than the value specified in max-width. - */ - "max-width"?: CSSWideKeyword | any; - /** - * Sets the minimum height for an element. It prevents the height of the element to be smaller than the specified value. - * The value of min-height overrides both max-height and height. - */ - "min-height"?: CSSWideKeyword | any; - /** - * Sets the minimum width of an element. It limits the width property to be not smaller than the value specified in min-width. - */ - "min-width"?: CSSWideKeyword | any; - /** - * Specifies the transparency of an element. - * See CSS 3 opacity property https://drafts.csswg.org/css-color-3/#opacity - */ - opacity?: CSSWideKeyword | number; - /** - * Specifies the order used to lay out flex items in their flex container. - * Elements are laid out in the ascending order of the order value. - * See CSS order property https://drafts.csswg.org/css-flexbox-1/#order-property - */ - order?: CSSWideKeyword | number; - /** - * In paged media, this property defines the minimum number of lines in - * a block container that must be left at the bottom of the page. - * See CSS 3 orphans, widows properties https://drafts.csswg.org/css-break-3/#widows-orphans - */ - orphans?: CSSWideKeyword | number; - /** - * The CSS outline property is a shorthand property for setting one or more of the individual outline properties outline-style, - * outline-width and outline-color in a single rule. In most cases the use of this shortcut is preferable and more convenient. - * Outlines differ from borders in the following ways: - * • Outlines do not take up space, they are drawn above the content. - * • Outlines may be non-rectangular. They are rectangular in Gecko/Firefox. - * Internet Explorer attempts to place the smallest contiguous outline around all elements or shapes that are indicated to have an outline. - * Opera draws a non-rectangular shape around a construct. - */ - outline?: CSSWideKeyword | any; - /** - * The outline-color property sets the color of the outline of an element. An outline is a line that is drawn around elements, outside the border edge, to make the element stand out. - */ - "outline-color"?: CSSWideKeyword | any; - /** - * The outline-offset property offsets the outline and draw it beyond the border edge. - */ - "outline-offset"?: CSSWideKeyword | any; - /** - * The overflow property controls how extra content exceeding the bounding box of an element is rendered. - * It can be used in conjunction with an element that has a fixed width and height, to eliminate text-induced page distortion. - */ - overflow?: CSSWideKeyword | "auto" | "hidden" | "scroll" | "visible"; - /** - * Specifies the preferred scrolling methods for elements that overflow. - */ - "overflow-style"?: CSSWideKeyword | any; - /** - * Controls how extra content exceeding the x-axis of the bounding box of an element is rendered. - */ - "overflow-x"?: CSSWideKeyword | "auto" | "hidden" | "scroll" | "visible"; - /** - * Controls how extra content exceeding the y-axis of the bounding box of an element is rendered. - */ - "overflow-y"?: CSSWideKeyword | "auto" | "hidden" | "scroll" | "visible"; - /** - * The padding optional CSS property sets the required padding space on one to four sides of an element. - * The padding area is the space between an element and its border. Negative values are not allowed but decimal values are permitted. - * The element size is treated as fixed, and the content of the element shifts toward the center as padding is increased. - * The padding property is a shorthand to avoid setting each side separately (padding-top, padding-right, padding-bottom, padding-left). - */ - padding?: CSSWideKeyword | any; - /** - * The padding-bottom CSS property of an element sets the padding space required on the bottom of an element. - * The padding area is the space between the content of the element and its border. - * Contrary to margin-bottom values, negative values of padding-bottom are invalid. - */ - "padding-bottom"?: CSSWideKeyword | any; - /** - * The padding-left CSS property of an element sets the padding space required on the left side of an element. - * The padding area is the space between the content of the element and its border. - * Contrary to margin-left values, negative values of padding-left are invalid. - */ - "padding-left"?: CSSWideKeyword | any; - /** - * The padding-right CSS property of an element sets the padding space required on the right side of an element. - * The padding area is the space between the content of the element and its border. - * Contrary to margin-right values, negative values of padding-right are invalid. - */ - "padding-right"?: CSSWideKeyword | any; - /** - * The padding-top CSS property of an element sets the padding space required on the top of an element. - * The padding area is the space between the content of the element and its border. - * Contrary to margin-top values, negative values of padding-top are invalid. - */ - "padding-top"?: CSSWideKeyword | any; - /** - * The page-break-after property is supported in all major browsers. With CSS3, page-break-* properties are only aliases of the break-* properties. - * The CSS3 Fragmentation spec defines breaks for all CSS box fragmentation. - */ - "page-break-after"?: CSSWideKeyword | any; - /** - * The page-break-before property sets the page-breaking behavior before an element. - * With CSS3, page-break-* properties are only aliases of the break-* properties. - * The CSS3 Fragmentation spec defines breaks for all CSS box fragmentation. - */ - "page-break-before"?: CSSWideKeyword | any; - /** - * Sets the page-breaking behavior inside an element. With CSS3, page-break-* properties are only aliases of the break-* properties. - * The CSS3 Fragmentation spec defines breaks for all CSS box fragmentation. - */ - "page-break-inside"?: CSSWideKeyword | any; - /** - * The pause property determines how long a speech media agent should pause before and after presenting an element. - * It is a shorthand for the pause-before and pause-after properties. - */ - pause?: CSSWideKeyword | any; - /** - * The pause-after property determines how long a speech media agent should pause after presenting an element. - * It may be replaced by the shorthand property pause, which sets pause time before and after. - */ - "pause-after"?: CSSWideKeyword | any; - /** - * The pause-before property determines how long a speech media agent should pause before presenting an element. - * It may be replaced by the shorthand property pause, which sets pause time before and after. - */ - "pause-before"?: CSSWideKeyword | any; - /** - * The perspective property defines how far an element is placed from the view on the z-axis, from the screen to the viewer. - * Perspective defines how an object is viewed. In graphic arts, perspective is the representation on a flat surface of what the viewer's eye would see in a 3D space. - * (See Wikipedia for more information about graphical perspective and for related illustrations.) - * The illusion of perspective on a flat surface, such as a computer screen, - * is created by projecting points on the flat surface as they would appear if the flat surface were a window - * through which the viewer was looking at the object. In discussion of virtual environments, this flat surface is called a projection plane. - */ - perspective?: CSSWideKeyword | any; - /** - * The perspective-origin property establishes the origin for the perspective property. - * It effectively sets the X and Y position at which the viewer appears to be looking at the children of the element. - * When used with perspective, perspective-origin changes the appearance of an object, - * as if a viewer were looking at it from a different origin. - * An object appears differently if a viewer is looking directly at it versus looking at it from below, above, or from the side. - * Thus, the perspective-origin is like a vanishing point. - * The default value of perspective-origin is 50% 50%. - * This displays an object as if the viewer's eye were positioned directly at the center of the screen, both top-to-bottom and left-to-right. - * A value of 0% 0% changes the object as if the viewer was looking toward the top left angle. - * A value of 100% 100% changes the appearance as if viewed toward the bottom right angle. - */ - "perspective-origin"?: CSSWideKeyword | any; - /** - * The pointer-events property allows you to control whether an element can be the target for the pointing device (e.g, mouse, pen) events. - */ - "pointer-events"?: CSSWideKeyword | any; - /** - * The position property controls the type of positioning used by an element within its parent elements. - * The effect of the position property depends on a lot of factors, for example the position property of parent elements. - */ - position?: CSSWideKeyword | "static" | "relative" | "absolute" | "fixed" | "sticky"; - /** - * Obsolete: unsupported. - * This property determines whether or not a full-width punctuation mark character should be trimmed if it appears at the beginning of a line, - * so that its "ink" lines up with the first glyph in the line above and below. - */ - "punctuation-trim"?: CSSWideKeyword | any; - /** - * Sets the type of quotation marks for embedded quotations. - */ - quotes?: CSSWideKeyword | any; - /** - * Controls whether the last region in a chain displays additional 'overset' content according its default overflow property, - * or if it displays a fragment of content as if it were flowing into a subsequent region. - */ - "region-fragment"?: CSSWideKeyword | any; - /** - * The rest-after property determines how long a speech media agent should pause after presenting an element's main content, - * before presenting that element's exit cue sound. It may be replaced by the shorthand property rest, which sets rest time before and after. - */ - "rest-after"?: CSSWideKeyword | any; - /** - * The rest-before property determines how long a speech media agent should pause after presenting an intro cue sound for an element, - * before presenting that element's main content. It may be replaced by the shorthand property rest, which sets rest time before and after. - */ - "rest-before"?: CSSWideKeyword | any; - /** - * Specifies the position an element in relation to the right side of the containing element. - */ - right?: CSSWideKeyword | any; - "ruby-align"?: CSSWideKeyword | any; - "ruby-position"?: CSSWideKeyword | any; - /** - * Defines the alpha channel threshold used to extract a shape from an image. Can be thought of as a "minimum opacity" threshold; - * that is, a value of 0.5 means that the shape will enclose all the pixels that are more than 50% opaque. - */ - "shape-image-threshold"?: CSSWideKeyword | any; - /** - * A future level of CSS Shapes will define a shape-inside property, which will define a shape to wrap content within the element. - * See Editor's Draft and CSSWG wiki page on next-level plans - */ - "shape-inside"?: CSSWideKeyword | any; - /** - * Adds a margin to a shape-outside. In effect, defines a new shape that is the smallest contour around all the points - * that are the shape-margin distance outward perpendicular to each point on the underlying shape. - * For points where a perpendicular direction is not defined (e.g., a triangle corner), - * takes all points on a circle centered at the point and with a radius of the shape-margin distance. - * This property accepts only non-negative values. - */ - "shape-margin"?: CSSWideKeyword | any; - /** - * Declares a shape around which text should be wrapped, with possible modifications from the shape-margin property. - * The shape defined by shape-outside and shape-margin changes the geometry of a float element's float area. - */ - "shape-outside"?: CSSWideKeyword | any; - /** - * The speak property determines whether or not a speech synthesizer will read aloud the contents of an element. - */ - speak?: CSSWideKeyword | any; - /** - * The speak-as property determines how the speech synthesizer interprets the content: words as whole words or as a sequence of letters, - * numbers as a numerical value or a sequence of digits, punctuation as pauses in speech or named punctuation characters. - */ - "speak-as"?: CSSWideKeyword | any; - /** - * SVG: Specifies the opacity of the outline on the current object. - * See SVG 1.1 https://www.w3.org/TR/SVG/painting.html#StrokeOpacityProperty - */ - "stroke-opacity"?: CSSWideKeyword | number; - /** - * SVG: Specifies the width of the outline on the current object. - * See SVG 1.1 https://www.w3.org/TR/SVG/painting.html#StrokeWidthProperty - */ - "stroke-width"?: CSSWideKeyword | CSSPercentage | CSSLength; - /** - * The tab-size CSS property is used to customise the width of a tab (U+0009) character. - */ - "tab-size"?: CSSWideKeyword | any; - /** - * The 'table-layout' property controls the algorithm used to lay out the table cells, rows, and columns. - */ - "table-layout"?: CSSWideKeyword | any; - /** - * The text-align CSS property describes how inline content like text is aligned in its parent block element. - * text-align does not control the alignment of block elements itself, only their inline content. - */ - "text-align"?: CSSWideKeyword | any; - /** - * The text-align-last CSS property describes how the last line of a block element or a line before line break is aligned in its parent block element. - */ - "text-align-last"?: CSSWideKeyword | any; - /** - * The text-decoration CSS property is used to set the text formatting to underline, overline, line-through or blink. - * underline and overline decorations are positioned under the text, line-through over it. - */ - "text-decoration"?: CSSWideKeyword | any; - /** - * Sets the color of any text decoration, such as underlines, overlines, and strike throughs. - */ - "text-decoration-color"?: CSSWideKeyword | any; - /** - * Sets what kind of line decorations are added to an element, such as underlines, overlines, etc. - */ - "text-decoration-line"?: CSSWideKeyword | any; - "text-decoration-line-through"?: CSSWideKeyword | any; - "text-decoration-none"?: CSSWideKeyword | any; - "text-decoration-overline"?: CSSWideKeyword | any; - /** - * Specifies what parts of an element’s content are skipped over when applying any text decoration. - */ - "text-decoration-skip"?: CSSWideKeyword | any; - /** - * This property specifies the style of the text decoration line drawn on the specified element. - * The intended meaning for the values are the same as those of the border-style-properties. - */ - "text-decoration-style"?: CSSWideKeyword | any; - "text-decoration-underline"?: CSSWideKeyword | any; - /** - * The text-emphasis property will apply special emphasis marks to the elements text. - * Slightly similar to the text-decoration property only that this property can have affect on the line-height. - * It also is noted that this is shorthand for text-emphasis-style and for text-emphasis-color. - */ - "text-emphasis"?: CSSWideKeyword | any; - /** - * The text-emphasis-color property specifies the foreground color of the emphasis marks. - */ - "text-emphasis-color"?: CSSWideKeyword | any; - /** - * The text-emphasis-style property applies special emphasis marks to an element's text. - */ - "text-emphasis-style"?: CSSWideKeyword | any; - /** - * This property helps determine an inline box's block-progression dimension, - * derived from the text-height and font-size properties for non-replaced elements, - * the height or the width for replaced elements, and the stacked block-progression dimension for inline-block elements. - * The block-progression dimension determines the position of the padding, border and margin for the element. - */ - "text-height"?: CSSWideKeyword | any; - /** - * Specifies the amount of space horizontally that should be left on the first line of the text of an element. - * This horizontal spacing is at the beginning of the first line and is in respect to the left edge of the containing block box. - */ - "text-indent"?: CSSWideKeyword | any; - "text-justify-trim"?: CSSWideKeyword | any; - "text-kashida-space"?: CSSWideKeyword | any; - /** - * The text-line-through property is a shorthand property for text-line-through-style, text-line-through-color and text-line-through-mode. - * (Considered obsolete; use text-decoration instead.) - */ - "text-line-through"?: CSSWideKeyword | any; - /** - * Specifies the line colors for the line-through text decoration. - * (Considered obsolete; use text-decoration-color instead.) - */ - "text-line-through-color"?: CSSWideKeyword | any; - /** - * Sets the mode for the line-through text decoration, determining whether the text decoration affects the space characters or not. - * (Considered obsolete; use text-decoration-skip instead.) - */ - "text-line-through-mode"?: CSSWideKeyword | any; - /** - * Specifies the line style for line-through text decoration. - * (Considered obsolete; use text-decoration-style instead.) - */ - "text-line-through-style"?: CSSWideKeyword | any; - /** - * Specifies the line width for the line-through text decoration. - */ - "text-line-through-width"?: CSSWideKeyword | any; - /** - * The text-overflow shorthand CSS property determines how overflowed content that is not displayed is signaled to the users. - * It can be clipped, display an ellipsis ('…', U+2026 HORIZONTAL ELLIPSIS) or a Web author-defined string. - * It covers the two long-hand properties text-overflow-mode and text-overflow-ellipsis - */ - "text-overflow"?: CSSWideKeyword | any; - /** - * The text-overline property is the shorthand for the text-overline-style, text-overline-width, text-overline-color, and text-overline-mode properties. - */ - "text-overline"?: CSSWideKeyword | any; - /** - * Specifies the line color for the overline text decoration. - */ - "text-overline-color"?: CSSWideKeyword | any; - /** - * Sets the mode for the overline text decoration, determining whether the text decoration affects the space characters or not. - */ - "text-overline-mode"?: CSSWideKeyword | any; - /** - * Specifies the line style for overline text decoration. - */ - "text-overline-style"?: CSSWideKeyword | any; - /** - * Specifies the line width for the overline text decoration. - */ - "text-overline-width"?: CSSWideKeyword | any; - /** - * The text-rendering CSS property provides information to the browser about how to optimize when rendering text. - * Options are: legibility, speed or geometric precision. - */ - "text-rendering"?: CSSWideKeyword | any; - /** - * Obsolete: unsupported. - */ - "text-script"?: CSSWideKeyword | any; - /** - * The CSS text-shadow property applies one or more drop shadows to the text and of an element. - * Each shadow is specified as an offset from the text, along with optional color and blur radius values. - */ - "text-shadow"?: CSSWideKeyword | any; - /** - * This property transforms text for styling purposes. (It has no effect on the underlying content.) - */ - "text-transform"?: CSSWideKeyword | any; - /** - * Unsupported. - * This property will add a underline position value to the element that has an underline defined. - */ - "text-underline-position"?: CSSWideKeyword | any; - /** - * After review this should be replaced by text-decoration should it not? - * This property will set the underline style for text with a line value for underline, overline, and line-through. - */ - "text-underline-style"?: CSSWideKeyword | any; - /** - * This property specifies how far an absolutely positioned box's top margin edge is offset below the top edge of the box's containing block. - * For relatively positioned boxes, the offset is with respect to the top edges of the box itself (i.e., the box is given a position in the normal flow, - * then offset from that position according to these properties). - */ - top?: CSSWideKeyword | any; - /** - * Determines whether touch input may trigger default behavior supplied by the user agent, such as panning or zooming. - */ - "touch-action"?: CSSWideKeyword | any; - /** - * CSS transforms allow elements styled with CSS to be transformed in two-dimensional or three-dimensional space. - * Using this property, elements can be translated, rotated, scaled, and skewed. The value list may consist of 2D and/or 3D transform values. - */ - transform?: CSSWideKeyword | any; - /** - * This property defines the origin of the transformation axes relative to the element to which the transformation is applied. - */ - "transform-origin"?: CSSWideKeyword | any; - /** - * This property allows you to define the relative position of the origin of the transformation grid along the z-axis. - */ - "transform-origin-z"?: CSSWideKeyword | any; - /** - * This property specifies how nested elements are rendered in 3D space relative to their parent. - */ - "transform-style"?: CSSWideKeyword | any; - /** - * The transition CSS property is a shorthand property for transition-property, transition-duration, transition-timing-function, - * and transition-delay. It allows to define the transition between two states of an element. - */ - transition?: CSSWideKeyword | any; - /** - * Defines when the transition will start. A value of ‘0s’ means the transition will execute as soon as the property is changed. - * Otherwise, the value specifies an offset from the moment the property is changed, and the transition will delay execution by that offset. - */ - "transition-delay"?: CSSWideKeyword | any; - /** - * The 'transition-duration' property specifies the length of time a transition animation takes to complete. - */ - "transition-duration"?: CSSWideKeyword | any; - /** - * The 'transition-property' property specifies the name of the CSS property to which the transition is applied. - */ - "transition-property"?: CSSWideKeyword | any; - /** - * Sets the pace of action within a transition - */ - "transition-timing-function"?: CSSWideKeyword | any; - /** - * The unicode-bidi CSS property specifies the level of embedding with respect to the bidirectional algorithm. - */ - "unicode-bidi"?: CSSWideKeyword | any; - /** - * unicode-range allows you to set a specific range of characters to be downloaded from a font (embedded using @font-face) and made available for use on the current page. - */ - "unicode-range"?: CSSWideKeyword | any; - /** - * This is for all the high level UX stuff. - */ - "user-focus"?: CSSWideKeyword | any; - /** - * For inputing user content - */ - "user-input"?: CSSWideKeyword | any; - /** - * The vertical-align property controls how inline elements or text are vertically aligned compared to the baseline. - * If this property is used on table-cells it controls the vertical alignment of content of the table cell. - */ - "vertical-align"?: CSSWideKeyword | any; - /** - * The visibility property specifies whether the boxes generated by an element are rendered. - */ - visibility?: CSSWideKeyword | any; - /** - * The voice-balance property sets the apparent position (in stereo sound) of the synthesized voice for spoken media. - */ - "voice-balance"?: CSSWideKeyword | any; - /** - * The voice-duration property allows the author to explicitly set the amount of time it should take a speech synthesizer to read an element's content, - * for example to allow the speech to be synchronized with other media. - * With a value of auto (the default) the length of time it takes to read the content is determined by the content itself and the voice-rate property. - */ - "voice-duration"?: CSSWideKeyword | any; - /** - * The voice-family property sets the speaker's voice used by a speech media agent to read an element. - * The speaker may be specified as a named character (to match a voice option in the speech reading software) - * or as a generic description of the age and gender of the voice. - * Similar to the font-family property for visual media, - * a comma-separated list of fallback options may be given in case the speech reader does not recognize the character name - * or cannot synthesize the requested combination of generic properties. - */ - "voice-family"?: CSSWideKeyword | any; - /** - * The voice-pitch property sets pitch or tone (high or low) for the synthesized speech when reading an element; - * the pitch may be specified absolutely or relative to the normal pitch for the voice-family used to read the text. - */ - "voice-pitch"?: CSSWideKeyword | any; - /** - * The voice-range property determines how much variation in pitch or tone will be created by the speech synthesize when reading an element. - * Emphasized text, grammatical structures and punctuation may all be rendered as changes in pitch, - * this property determines how strong or obvious those changes are; - * large ranges are associated with enthusiastic or emotional speech, - * while small ranges are associated with flat or mechanical speech. - */ - "voice-range"?: CSSWideKeyword | any; - /** - * The voice-rate property sets the speed at which the voice synthesized by a speech media agent will read content. - */ - "voice-rate"?: CSSWideKeyword | any; - /** - * The voice-stress property sets the level of vocal emphasis to be used for synthesized speech reading the element. - */ - "voice-stress"?: CSSWideKeyword | any; - /** - * The voice-volume property sets the volume for spoken content in speech media. It replaces the deprecated volume property. - */ - "voice-volume"?: CSSWideKeyword | any; - /** - * The white-space property controls whether and how white space inside the element is collapsed, and whether lines may wrap at unforced "soft wrap" opportunities. - */ - "white-space"?: CSSWideKeyword | any; - /** - * Obsolete: unsupported. - */ - "white-space-treatment"?: CSSWideKeyword | any; - /** - * In paged media, this property defines the mimimum number of lines - * that must be left at the top of the second page. - * See CSS 3 orphans, widows properties https://drafts.csswg.org/css-break-3/#widows-orphans - */ - widows?: CSSWideKeyword | number; - /** - * Specifies the width of the content area of an element. The content area of the element width does not include the padding, border, and margin of the element. - */ - width?: CSSWideKeyword | any; - /** - * The word-break property is often used when there is long generated content that is strung together without and spaces or hyphens to beak apart. - * A common case of this is when there is a long URL that does not have any hyphens. This case could potentially cause the breaking of the layout as it could extend past the parent element. - */ - "word-break"?: CSSWideKeyword | any; - /** - * The word-spacing CSS property specifies the spacing behavior between "words". - */ - "word-spacing"?: CSSWideKeyword | any; - /** - * An alias of css/properties/overflow-wrap, word-wrap defines whether to break words when the content exceeds the boundaries of its container. - */ - "word-wrap"?: CSSWideKeyword | any; - /** - * Specifies how exclusions affect inline content within block-level elements. Elements lay out their inline content in their content area but wrap around exclusion areas. - */ - "wrap-flow"?: CSSWideKeyword | any; - /** - * Set the value that is used to offset the inner wrap shape from other shapes. Inline content that intersects a shape with this property will be pushed by this shape's margin. - */ - "wrap-margin"?: CSSWideKeyword | any; - /** - * Obsolete and unsupported. Do not use. - * This CSS property controls the text when it reaches the end of the block in which it is enclosed. - */ - "wrap-option"?: CSSWideKeyword | any; - /** - * writing-mode specifies if lines of text are laid out horizontally or vertically, and the direction which lines of text and blocks progress. - */ - "writing-mode"?: CSSWideKeyword | any; - /** - * The z-index property specifies the z-order of an element and its descendants. - * When elements overlap, z-order determines which one covers the other. - * See CSS 2 z-index property https://www.w3.org/TR/CSS2/visuren.html#z-index - */ - "z-index"?: CSSWideKeyword | "auto" | number; - /** - * Sets the initial zoom factor of a document defined by @viewport. - * See CSS zoom descriptor https://drafts.csswg.org/css-device-adapt/#zoom-desc - */ - zoom?: CSSWideKeyword | "auto" | number | CSSPercentage; - [propertyName: string]: any; + ref?: T | ((el: T) => void); + classList?: { + [k: string]: boolean | undefined; + }; + $ServerOnly?: boolean; + } + type Accessor = () => T + interface Directives {} + interface DirectiveFunctions { + [x: string]: (el: Element, accessor: Accessor) => void; + } + interface ExplicitProperties {} + interface ExplicitAttributes {} + interface CustomEvents {} + interface CustomCaptureEvents {} + type DirectiveAttributes = { + [Key in keyof Directives as `use:${Key}`]?: Directives[Key]; + }; + type DirectiveFunctionAttributes = { + [K in keyof DirectiveFunctions as string extends K ? never : `use:${K}`]?: DirectiveFunctions[K] extends ( + el: infer E, // will be unknown if not provided + ...rest: infer R // use rest so that we can check whether it's provided or not + ) => void + ? T extends E // everything extends unknown if E is unknown + ? R extends [infer A] // check if has accessor provided + ? A extends Accessor + ? V // it's an accessor + : never // it isn't, type error + : true // no accessor provided + : never // T is the wrong element + : never; // it isn't a function + }; + type PropAttributes = { + [Key in keyof ExplicitProperties as `prop:${Key}`]?: ExplicitProperties[Key]; + }; + type AttrAttributes = { + [Key in keyof ExplicitAttributes as `attr:${Key}`]?: ExplicitAttributes[Key]; + }; + type OnAttributes = { + [Key in keyof CustomEvents as `on:${Key}`]?: EventHandler; + } + type OnCaptureAttributes = { + [Key in keyof CustomCaptureEvents as `oncapture:${Key}`]?: EventHandler; + } + interface DOMAttributes extends CustomAttributes, DirectiveAttributes, DirectiveFunctionAttributes, PropAttributes, AttrAttributes, OnAttributes, OnCaptureAttributes { + children?: Element; + innerHTML?: string; + innerText?: string | number; + textContent?: string | number; + onCopy?: EventHandlerUnion; + onCut?: EventHandlerUnion; + onPaste?: EventHandlerUnion; + onCompositionEnd?: EventHandlerUnion; + onCompositionStart?: EventHandlerUnion; + onCompositionUpdate?: EventHandlerUnion; + onFocus?: EventHandlerUnion; + onFocusOut?: EventHandlerUnion; + onFocusIn?: EventHandlerUnion; + onBlur?: EventHandlerUnion; + onChange?: EventHandlerUnion; + onInvalid?: EventHandlerUnion; + onInput?: EventHandlerUnion; + onBeforeInput?: EventHandlerUnion; + onReset?: EventHandlerUnion; + onSubmit?: EventHandlerUnion< + T, + Event & { + submitter: HTMLElement; + } + >; + onLoad?: EventHandlerUnion; + onError?: EventHandlerUnion; + onKeyDown?: EventHandlerUnion; + onKeyPress?: EventHandlerUnion; + onKeyUp?: EventHandlerUnion; + onGotPointerCapture?: EventHandlerUnion; + onLostPointerCapture?: EventHandlerUnion; + onPointerCancel?: EventHandlerUnion; + onPointerDown?: EventHandlerUnion; + onPointerEnter?: EventHandlerUnion; + onPointerLeave?: EventHandlerUnion; + onPointerMove?: EventHandlerUnion; + onPointerOver?: EventHandlerUnion; + onPointerOut?: EventHandlerUnion; + onPointerUp?: EventHandlerUnion; + onAbort?: EventHandlerUnion; + onCanPlay?: EventHandlerUnion; + onCanPlayThrough?: EventHandlerUnion; + onDurationChange?: EventHandlerUnion; + onEmptied?: EventHandlerUnion; + onEncrypted?: EventHandlerUnion; + onEnded?: EventHandlerUnion; + onLoadedData?: EventHandlerUnion; + onLoadedMetadata?: EventHandlerUnion; + onLoadStart?: EventHandlerUnion; + onPause?: EventHandlerUnion; + onPlay?: EventHandlerUnion; + onPlaying?: EventHandlerUnion; + onProgress?: EventHandlerUnion; + onRateChange?: EventHandlerUnion; + onSeeked?: EventHandlerUnion; + onSeeking?: EventHandlerUnion; + onStalled?: EventHandlerUnion; + onSuspend?: EventHandlerUnion; + onTimeUpdate?: EventHandlerUnion; + onVolumeChange?: EventHandlerUnion; + onWaiting?: EventHandlerUnion; + onClick?: EventHandlerUnion; + onAuxClick?: EventHandlerUnion; + onContextMenu?: EventHandlerUnion; + onDblClick?: EventHandlerUnion; + onDrag?: EventHandlerUnion; + onDragEnd?: EventHandlerUnion; + onDragEnter?: EventHandlerUnion; + onDragExit?: EventHandlerUnion; + onDragLeave?: EventHandlerUnion; + onDragOver?: EventHandlerUnion; + onDragStart?: EventHandlerUnion; + onDrop?: EventHandlerUnion; + onMouseDown?: EventHandlerUnion; + onMouseEnter?: EventHandlerUnion; + onMouseLeave?: EventHandlerUnion; + onMouseMove?: EventHandlerUnion; + onMouseOut?: EventHandlerUnion; + onMouseOver?: EventHandlerUnion; + onMouseUp?: EventHandlerUnion; + onSelect?: EventHandlerUnion; + onTouchCancel?: EventHandlerUnion; + onTouchEnd?: EventHandlerUnion; + onTouchMove?: EventHandlerUnion; + onTouchStart?: EventHandlerUnion; + onScroll?: EventHandlerUnion; + onWheel?: EventHandlerUnion; + onAnimationStart?: EventHandlerUnion; + onAnimationEnd?: EventHandlerUnion; + onAnimationIteration?: EventHandlerUnion; + onTransitionEnd?: EventHandlerUnion; + + // lower case events + oncopy?: EventHandlerUnion; + oncut?: EventHandlerUnion; + onpaste?: EventHandlerUnion; + oncompositionend?: EventHandlerUnion; + oncompositionstart?: EventHandlerUnion; + oncompositionupdate?: EventHandlerUnion; + onfocus?: EventHandlerUnion; + onfocusout?: EventHandlerUnion; + onfocusin?: EventHandlerUnion; + onblur?: EventHandlerUnion; + onchange?: EventHandlerUnion; + oninvalid?: EventHandlerUnion; + oninput?: EventHandlerUnion; + onbeforeinput?: EventHandlerUnion; + onreset?: EventHandlerUnion; + onsubmit?: EventHandlerUnion< + T, + Event & { + submitter: HTMLElement; + } + >; + onload?: EventHandlerUnion; + onerror?: EventHandlerUnion; + onkeydown?: EventHandlerUnion; + onkeypress?: EventHandlerUnion; + onkeyup?: EventHandlerUnion; + ongotpointercapture?: EventHandlerUnion; + onlostpointercapture?: EventHandlerUnion; + onpointercancel?: EventHandlerUnion; + onpointerdown?: EventHandlerUnion; + onpointerenter?: EventHandlerUnion; + onpointerleave?: EventHandlerUnion; + onpointermove?: EventHandlerUnion; + onpointerover?: EventHandlerUnion; + onpointerout?: EventHandlerUnion; + onpointerup?: EventHandlerUnion; + onabort?: EventHandlerUnion; + oncanplay?: EventHandlerUnion; + oncanplaythrough?: EventHandlerUnion; + ondurationchange?: EventHandlerUnion; + onemptied?: EventHandlerUnion; + onencrypted?: EventHandlerUnion; + onended?: EventHandlerUnion; + onloadeddata?: EventHandlerUnion; + onloadedmetadata?: EventHandlerUnion; + onloadstart?: EventHandlerUnion; + onpause?: EventHandlerUnion; + onplay?: EventHandlerUnion; + onplaying?: EventHandlerUnion; + onprogress?: EventHandlerUnion; + onratechange?: EventHandlerUnion; + onseeked?: EventHandlerUnion; + onseeking?: EventHandlerUnion; + onstalled?: EventHandlerUnion; + onsuspend?: EventHandlerUnion; + ontimeupdate?: EventHandlerUnion; + onvolumechange?: EventHandlerUnion; + onwaiting?: EventHandlerUnion; + onclick?: EventHandlerUnion; + onauxclick?: EventHandlerUnion; + oncontextmenu?: EventHandlerUnion; + ondblclick?: EventHandlerUnion; + ondrag?: EventHandlerUnion; + ondragend?: EventHandlerUnion; + ondragenter?: EventHandlerUnion; + ondragexit?: EventHandlerUnion; + ondragleave?: EventHandlerUnion; + ondragover?: EventHandlerUnion; + ondragstart?: EventHandlerUnion; + ondrop?: EventHandlerUnion; + onmousedown?: EventHandlerUnion; + onmouseenter?: EventHandlerUnion; + onmouseleave?: EventHandlerUnion; + onmousemove?: EventHandlerUnion; + onmouseout?: EventHandlerUnion; + onmouseover?: EventHandlerUnion; + onmouseup?: EventHandlerUnion; + onselect?: EventHandlerUnion; + ontouchcancel?: EventHandlerUnion; + ontouchend?: EventHandlerUnion; + ontouchmove?: EventHandlerUnion; + ontouchstart?: EventHandlerUnion; + onscroll?: EventHandlerUnion; + onwheel?: EventHandlerUnion; + onanimationstart?: EventHandlerUnion; + onanimationend?: EventHandlerUnion; + onanimationiteration?: EventHandlerUnion; + ontransitionend?: EventHandlerUnion; } + + interface CSSProperties extends csstype.PropertiesHyphen { + // Override + [key: `-${string}`]: string | number | undefined + } + type HTMLAutocapitalize = "off" | "none" | "on" | "sentences" | "words" | "characters"; type HTMLDir = "ltr" | "rtl" | "auto"; type HTMLFormEncType = "application/x-www-form-urlencoded" | "multipart/form-data" | "text/plain"; @@ -1673,6 +304,7 @@ export namespace JSX { | "unsafe-url"; type HTMLIframeSandbox = | "allow-downloads-without-user-activation" + | "allow-downloads" | "allow-forms" | "allow-modals" | "allow-orientation-lock" @@ -1895,32 +527,6 @@ export namespace JSX { "aria-valuenow"?: number | string; /** Defines the human readable text alternative of aria-valuenow for a range widget. */ "aria-valuetext"?: string; - } - - interface HTMLAttributes extends AriaAttributes, DOMAttributes { - accessKey?: string; - className?: string; - class?: string; - contenteditable?: boolean | "inherit"; - contextmenu?: string; - dir?: HTMLDir; - draggable?: boolean; - hidden?: boolean; - id?: string; - lang?: string; - spellcheck?: boolean; - style?: CSSProperties | string; - tabindex?: number | string; - title?: string; - translate?: "yes" | "no"; - about?: string; - datatype?: string; - inlist?: any; - prefix?: string; - property?: string; - resource?: string; - typeof?: string; - vocab?: string; role?: | "alert" | "alertdialog" @@ -1959,6 +565,7 @@ export namespace JSX { | "menuitem" | "menuitemcheckbox" | "menuitemradio" + | "meter" | "navigation" | "none" | "note" @@ -1991,14 +598,48 @@ export namespace JSX { | "tree" | "treegrid" | "treeitem"; + } + + // TODO: Should we allow this? + // type ClassKeys = `class:${string}`; + // type CSSKeys = Exclude; + + // type CSSAttributes = { + // [key in CSSKeys as `style:${key}`]: csstype.PropertiesHyphen[key]; + // }; + + interface HTMLAttributes extends AriaAttributes, DOMAttributes { + // [key: ClassKeys]: boolean; + accessKey?: string; + class?: string; + contenteditable?: boolean | "inherit"; + contextmenu?: string; + dir?: HTMLDir; + draggable?: boolean; + hidden?: boolean; + id?: string; + lang?: string; + spellcheck?: boolean; + style?: CSSProperties | string; + tabindex?: number | string; + title?: string; + translate?: "yes" | "no"; + about?: string; + datatype?: string; + inlist?: any; + prefix?: string; + property?: string; + resource?: string; + typeof?: string; + vocab?: string; autocapitalize?: HTMLAutocapitalize; + slot?: string; color?: string; itemprop?: string; itemscope?: boolean; itemtype?: string; itemid?: string; itemref?: string; - align?: "start" | "end" | "center" | "baseline" | "stretch" | "left" | "right"; part?: string; exportparts?: string; inputmode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search"; @@ -2081,6 +722,8 @@ export namespace JSX { } interface DetailsHtmlAttributes extends HTMLAttributes { open?: boolean; + onToggle?: EventHandlerUnion; + ontoggle?: EventHandlerUnion; } interface DialogHtmlAttributes extends HTMLAttributes { open?: boolean; @@ -2115,7 +758,7 @@ export namespace JSX { height?: number | string; name?: string; referrerpolicy?: HTMLReferrerPolicy; - sandbox?: HTMLIframeSandbox; + sandbox?: HTMLIframeSandbox | string; src?: string; srcdoc?: string; width?: number | string; @@ -2126,6 +769,8 @@ export namespace JSX { crossorigin?: HTMLCrossorigin; decoding?: "sync" | "async" | "auto"; height?: number | string; + ismap?: boolean; + isMap?: boolean; loading?: "eager" | "lazy"; referrerpolicy?: HTMLReferrerPolicy; referrerPolicy?: HTMLReferrerPolicy; @@ -2195,7 +840,6 @@ export namespace JSX { name?: string; } interface LabelHTMLAttributes extends HTMLAttributes { - htmlFor?: string; for?: string; form?: string; } @@ -2282,7 +926,6 @@ export namespace JSX { } interface OutputHTMLAttributes extends HTMLAttributes { form?: string; - htmlFor?: string; for?: string; name?: string; } @@ -2369,7 +1012,7 @@ export namespace JSX { rowspan?: number | string; colSpan?: number | string; rowSpan?: number | string; - scope?: "col" | "row" | "rowgroup" | "colgroup"; + scope?: 'col' | 'row' | 'rowgroup' | 'colgroup'; } interface TimeHTMLAttributes extends HTMLAttributes { datetime?: string; @@ -2448,7 +1091,7 @@ export namespace JSX { | "defer xMidYMax slice" | "defer xMaxYMax slice"; type SVGUnits = "userSpaceOnUse" | "objectBoundingBox"; - interface CoreSVGAttributes extends DOMAttributes { + interface CoreSVGAttributes extends AriaAttributes, DOMAttributes { id?: string; lang?: string; tabIndex?: number | string; @@ -2456,7 +1099,6 @@ export namespace JSX { } interface StylableSVGAttributes { class?: string; - className?: string; style?: CSSProperties | string; } interface TransformableSVGAttributes { @@ -2606,6 +1248,7 @@ export namespace JSX { ConditionalProcessingSVGAttributes {} interface ContainerElementSVGAttributes extends CoreSVGAttributes, + ShapeElementSVGAttributes, Pick< PresentationSVGAttributes, | "clip-path" @@ -2869,7 +1512,8 @@ export namespace JSX { extends FilterPrimitiveElementSVGAttributes, ExternalResourceSVGAttributes, StylableSVGAttributes { - preserveAspectRatio: SVGPreserveAspectRatio; + preserveAspectRatio?: SVGPreserveAspectRatio; + href?: string; } interface FeMergeSVGAttributes extends FilterPrimitiveElementSVGAttributes, @@ -2972,6 +1616,7 @@ export namespace JSX { width?: number | string; height?: number | string; preserveAspectRatio?: ImagePreserveAspectRatio; + href?: string; } interface LineSVGAttributes extends GraphicsElementSVGAttributes, @@ -3101,7 +1746,7 @@ export namespace JSX { ZoomAndPanSVGAttributes, PresentationSVGAttributes { version?: string; - "base-profile"?: string; + baseProfile?: string; x?: number | string; y?: number | string; width?: number | string; @@ -3151,6 +1796,7 @@ export namespace JSX { startOffset?: number | string; method?: "align" | "stretch"; spacing?: "auto" | "exact"; + href?: string; } interface TSpanSVGAttributes extends TextContentElementSVGAttributes, @@ -3215,9 +1861,9 @@ export namespace JSX { datalist: HTMLAttributes; dd: HTMLAttributes; del: HTMLAttributes; - details: DetailsHtmlAttributes; + details: DetailsHtmlAttributes; dfn: HTMLAttributes; - dialog: DialogHtmlAttributes; + dialog: DialogHtmlAttributes; div: HTMLAttributes; dl: HTMLAttributes; dt: HTMLAttributes; diff --git a/src/lib.ts b/src/lib.ts index d4c9c2b..edc4e44 100644 --- a/src/lib.ts +++ b/src/lib.ts @@ -1,5 +1,14 @@ -import { autorun, computed, untracked, $mobx, IObservableArray, observable, action, IObservableValue } from "mobx"; -import type { JSX } from "./jsx" +import { + autorun, + computed, + untracked, + $mobx, + IObservableArray, + observable, + action, + IObservableValue +} from "mobx"; +import type { JSX } from "./jsx"; type ContextOwner = { disposables: any[]; @@ -29,7 +38,7 @@ Component.prototype.isClassComponent = true; export function root(fn: (dispose: () => void) => T) { let d: any[], ret: T; globalContext = { - disposables: d = [], + disposables: (d = []), owner: globalContext }; ret = untracked(() => @@ -84,7 +93,7 @@ export function memo(fn: () => T, equal?: boolean) { export function createSelector( source: () => T, fn: (a: U, b: T) => boolean = (a, b) => a === b -){ +) { let subs = new Map(); let v: T; effect((p?: U) => { @@ -92,7 +101,7 @@ export function createSelector( const keys = [...subs.keys()]; for (let i = 0, len = keys.length; i < len; i++) { const key = keys[i]; - if (fn(key, v) || p !== undefined && fn(key, p)) { + if (fn(key, v) || (p !== undefined && fn(key, p))) { const o = subs.get(key); o.set(null); } @@ -101,10 +110,11 @@ export function createSelector( }); return (key: U) => { let l: IObservableValue & { _count?: number }; - if (!(l = subs.get(key))) subs.set(key, l = observable.box()); + if (!(l = subs.get(key))) + subs.set(key, (l = observable.box() as IObservableValue & { _count?: number })); l.get(); - l._count ? (l._count++) : (l._count = 1); - cleanup(() => l._count! > 1 ? l._count!-- : subs.delete(key)) + l._count ? l._count++ : (l._count = 1); + cleanup(() => (l._count! > 1 ? l._count!-- : subs.delete(key))); return fn(key, v); }; } @@ -115,15 +125,14 @@ type ComponentConstructor

= | FunctionComponent

| (new (props: PropsWithChildren

) => JSX.Element); -export type ComponentProps< - T extends keyof JSX.IntrinsicElements | ComponentConstructor -> = T extends ComponentConstructor - ? P - : T extends keyof JSX.IntrinsicElements - ? JSX.IntrinsicElements[T] - : {}; +export type ComponentProps> = + T extends ComponentConstructor + ? P + : T extends keyof JSX.IntrinsicElements + ? JSX.IntrinsicElements[T] + : {}; -export function createComponent( +export function createComponent( Comp: Component & FunctionComponent, props: T ): JSX.Element { @@ -139,15 +148,17 @@ export function createComponent( // dynamic import to support code splitting export function lazy(fn: () => Promise<{ default: T }>) { return (props: object) => { - let Comp: T; - const result = observable.box(), + let Comp: T | undefined; + const result = observable.box(), update = action((component: { default: T }) => result.set(component.default)); fn().then(update); - const rendered = computed(() => (Comp = result.get()) && untracked(() => Comp(props))); + const rendered = computed(() => (Comp = result.get()) && untracked(() => Comp!(props))); return () => rendered.get(); }; } +export { untracked as untrack }; + export function splitProps( props: T, ...keys: [K1[]] @@ -257,7 +268,7 @@ function createProvider(id: symbol) { // Modified version of mapSample from S-array[https://github.com/adamhaile/S-array] by Adam Haile export function map( - list: IObservableArray & { [$mobx]: any } | (() => Array), + list: (IObservableArray & { [$mobx]: any }) | (() => Array), mapFn: (v: T, i: number) => U | any ) { let items = [] as T[], @@ -269,7 +280,7 @@ export function map( for (let i = 0, length = disposers.length; i < length; i++) disposers[i](); }); return () => { - let newItems = fn ? (list as () => Array)() : list as T[], + let newItems = fn ? (list as () => Array)() : (list as T[]), i: number, j: number; !fn && (list as IObservableArray & { [$mobx]: any })[$mobx].atom_.reportObserved();