From d38d34677dca231218c25d8610d381504fb2afaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Collonval?= Date: Mon, 5 Dec 2022 13:47:51 +0100 Subject: [PATCH 1/5] Make tabbable optional (backward change) --- packages/widgets/src/menubar.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/widgets/src/menubar.ts b/packages/widgets/src/menubar.ts index 3f36f3faa..463dc8e60 100644 --- a/packages/widgets/src/menubar.ts +++ b/packages/widgets/src/menubar.ts @@ -809,7 +809,7 @@ export namespace MenuBar { /** * Whether the user can tab to the item. */ - readonly tabbable: boolean; + readonly tabbable?: boolean; readonly onfocus?: (event: FocusEvent) => void; } From 128e9a6a3015399ec39ef401faad1ffe4ae15237 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Collonval?= Date: Mon, 5 Dec 2022 13:49:32 +0100 Subject: [PATCH 2/5] Bump version --- examples/example-accordionpanel/package.json | 6 +++--- examples/example-datagrid/package.json | 8 ++++---- examples/example-datastore/package.json | 4 ++-- examples/example-dockpanel/package.json | 6 +++--- examples/example-menubar/package.json | 6 +++--- examples/example-nested-dockpanel-amd/package.json | 2 +- packages/application/package.json | 4 ++-- packages/datagrid/package.json | 4 ++-- packages/default-theme/package.json | 4 ++-- packages/widgets/package.json | 2 +- 10 files changed, 23 insertions(+), 23 deletions(-) diff --git a/examples/example-accordionpanel/package.json b/examples/example-accordionpanel/package.json index bb9697ad5..1cc6876bd 100644 --- a/examples/example-accordionpanel/package.json +++ b/examples/example-accordionpanel/package.json @@ -1,15 +1,15 @@ { "name": "@lumino/example-accordionpanel", - "version": "0.8.5", + "version": "0.8.6", "private": true, "scripts": { "build": "tsc && webpack", "clean": "rimraf build" }, "dependencies": { - "@lumino/default-theme": "^0.22.5", + "@lumino/default-theme": "^0.22.6", "@lumino/messaging": "^1.10.3", - "@lumino/widgets": "^1.35.0", + "@lumino/widgets": "^1.36.0", "es6-promise": "^4.0.5" }, "devDependencies": { diff --git a/examples/example-datagrid/package.json b/examples/example-datagrid/package.json index 8358ce695..8c0ca909f 100644 --- a/examples/example-datagrid/package.json +++ b/examples/example-datagrid/package.json @@ -1,16 +1,16 @@ { "name": "@lumino/example-datagrid", - "version": "0.32.5", + "version": "0.32.6", "private": true, "scripts": { "build": "tsc && webpack", "clean": "rimraf build" }, "dependencies": { - "@lumino/datagrid": "^0.36.5", - "@lumino/default-theme": "^0.22.5", + "@lumino/datagrid": "^0.36.6", + "@lumino/default-theme": "^0.22.6", "@lumino/dragdrop": "^1.14.3", - "@lumino/widgets": "^1.35.0", + "@lumino/widgets": "^1.36.0", "es6-promise": "^4.0.5" }, "devDependencies": { diff --git a/examples/example-datastore/package.json b/examples/example-datastore/package.json index c8a65ed18..a5c9eced7 100644 --- a/examples/example-datastore/package.json +++ b/examples/example-datastore/package.json @@ -1,6 +1,6 @@ { "name": "@lumino/example-datastore", - "version": "0.21.5", + "version": "0.21.6", "private": true, "scripts": { "build": "tsc && webpack", @@ -14,7 +14,7 @@ "@lumino/datastore": "^0.18.3", "@lumino/disposable": "^1.10.3", "@lumino/dragdrop": "^1.14.3", - "@lumino/widgets": "^1.35.0", + "@lumino/widgets": "^1.36.0", "codemirror": "^5.48.2", "es6-promise": "^4.0.5", "websocket": "^1.0.28" diff --git a/examples/example-dockpanel/package.json b/examples/example-dockpanel/package.json index 9919dced3..628227d8e 100644 --- a/examples/example-dockpanel/package.json +++ b/examples/example-dockpanel/package.json @@ -1,6 +1,6 @@ { "name": "@lumino/example-dockpanel", - "version": "0.21.5", + "version": "0.21.6", "private": true, "scripts": { "build": "tsc && webpack", @@ -8,10 +8,10 @@ }, "dependencies": { "@lumino/commands": "^1.21.0", - "@lumino/default-theme": "^0.22.5", + "@lumino/default-theme": "^0.22.6", "@lumino/dragdrop": "^1.14.3", "@lumino/messaging": "^1.10.3", - "@lumino/widgets": "^1.35.0", + "@lumino/widgets": "^1.36.0", "es6-promise": "^4.0.5" }, "devDependencies": { diff --git a/examples/example-menubar/package.json b/examples/example-menubar/package.json index f337dd875..dad696821 100644 --- a/examples/example-menubar/package.json +++ b/examples/example-menubar/package.json @@ -1,15 +1,15 @@ { "name": "@lumino/example-menubar", - "version": "0.1.0-alpha.0", + "version": "0.1.1-alpha.0", "private": true, "scripts": { "build": "tsc && webpack", "clean": "rimraf build" }, "dependencies": { - "@lumino/default-theme": "^0.22.5", + "@lumino/default-theme": "^0.22.6", "@lumino/messaging": "^1.10.3", - "@lumino/widgets": "^1.35.0", + "@lumino/widgets": "^1.36.0", "es6-promise": "^4.0.5" }, "devDependencies": { diff --git a/examples/example-nested-dockpanel-amd/package.json b/examples/example-nested-dockpanel-amd/package.json index 7090b7747..c7dfb8302 100644 --- a/examples/example-nested-dockpanel-amd/package.json +++ b/examples/example-nested-dockpanel-amd/package.json @@ -1,6 +1,6 @@ { "name": "@lumino/example-nested-dockpanel-amd", - "version": "0.4.0", + "version": "0.4.1", "private": true, "scripts": { "test": "node ./test/runner.js" diff --git a/packages/application/package.json b/packages/application/package.json index e06c6d254..bf87ac1cb 100644 --- a/packages/application/package.json +++ b/packages/application/package.json @@ -1,6 +1,6 @@ { "name": "@lumino/application", - "version": "1.30.0", + "version": "1.31.0", "description": "Lumino Pluggable Application", "homepage": "https://github.com/jupyterlab/lumino", "bugs": { @@ -48,7 +48,7 @@ "dependencies": { "@lumino/commands": "^1.21.0", "@lumino/coreutils": "^1.12.1", - "@lumino/widgets": "^1.35.0" + "@lumino/widgets": "^1.36.0" }, "devDependencies": { "@microsoft/api-extractor": "^7.6.0", diff --git a/packages/datagrid/package.json b/packages/datagrid/package.json index f3804f17e..ea1dc3d7a 100644 --- a/packages/datagrid/package.json +++ b/packages/datagrid/package.json @@ -1,6 +1,6 @@ { "name": "@lumino/datagrid", - "version": "0.36.5", + "version": "0.36.6", "description": "Lumino Tabular Data Grid", "homepage": "https://github.com/jupyterlab/lumino", "bugs": { @@ -45,7 +45,7 @@ "@lumino/keyboard": "^1.8.2", "@lumino/messaging": "^1.10.3", "@lumino/signaling": "^1.11.0", - "@lumino/widgets": "^1.35.0" + "@lumino/widgets": "^1.36.0" }, "devDependencies": { "rimraf": "^3.0.2", diff --git a/packages/default-theme/package.json b/packages/default-theme/package.json index 8b4e4a8dc..484a447df 100644 --- a/packages/default-theme/package.json +++ b/packages/default-theme/package.json @@ -1,6 +1,6 @@ { "name": "@lumino/default-theme", - "version": "0.22.5", + "version": "0.22.6", "description": "Lumino Default Theme", "homepage": "https://github.com/jupyterlab/lumino", "bugs": { @@ -30,7 +30,7 @@ }, "dependencies": { "@lumino/dragdrop": "^1.14.3", - "@lumino/widgets": "^1.35.0" + "@lumino/widgets": "^1.36.0" }, "publishConfig": { "access": "public" diff --git a/packages/widgets/package.json b/packages/widgets/package.json index 8a7f220f1..5d6a1e177 100644 --- a/packages/widgets/package.json +++ b/packages/widgets/package.json @@ -1,6 +1,6 @@ { "name": "@lumino/widgets", - "version": "1.35.0", + "version": "1.36.0", "description": "Lumino Widgets", "homepage": "https://github.com/jupyterlab/lumino", "bugs": { From efcd13f6fa8bbc88a478dae1b3f946e6b9bf0802 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Collonval?= Date: Mon, 5 Dec 2022 13:49:52 +0100 Subject: [PATCH 3/5] Remove unpublished version from changelog --- CHANGELOG.md | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e566734b3..d7389fb33 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,30 +2,6 @@ -## 2022.11.29 - -([Full Changelog](https://github.com/jupyterlab/lumino/compare/@lumino/application@1.30.0...047d42205a32de8ec502f0d57d70fb161f1d1f41)) - -### Enhancements made - -- Improve the menubar accessibility [#476](https://github.com/jupyterlab/lumino/pull/476) ([@fcollonval](https://github.com/fcollonval)) - -### Bugs fixed - -- Fix drag-and-drop of nested dock panel [#473](https://github.com/jupyterlab/lumino/pull/473) ([@drcd1](https://github.com/drcd1)) - -### Maintenance and upkeep improvements - -- Correct example version for 1.x [#479](https://github.com/jupyterlab/lumino/pull/479) ([@fcollonval](https://github.com/fcollonval)) - -### Contributors to this release - -([GitHub contributors page for this release](https://github.com/jupyterlab/lumino/graphs/contributors?from=2022-10-31&to=2022-11-29&type=c)) - -[@afshin](https://github.com/search?q=repo%3Ajupyterlab%2Flumino+involves%3Aafshin+updated%3A2022-10-31..2022-11-29&type=Issues) | [@blink1073](https://github.com/search?q=repo%3Ajupyterlab%2Flumino+involves%3Ablink1073+updated%3A2022-10-31..2022-11-29&type=Issues) | [@fcollonval](https://github.com/search?q=repo%3Ajupyterlab%2Flumino+involves%3Afcollonval+updated%3A2022-10-31..2022-11-29&type=Issues) | [@meeseeksmachine](https://github.com/search?q=repo%3Ajupyterlab%2Flumino+involves%3Ameeseeksmachine+updated%3A2022-10-31..2022-11-29&type=Issues) | [@scmmmh](https://github.com/search?q=repo%3Ajupyterlab%2Flumino+involves%3Ascmmmh+updated%3A2022-10-31..2022-11-29&type=Issues) | [@vidartf](https://github.com/search?q=repo%3Ajupyterlab%2Flumino+involves%3Avidartf+updated%3A2022-10-31..2022-11-29&type=Issues) | [@welcome](https://github.com/search?q=repo%3Ajupyterlab%2Flumino+involves%3Awelcome+updated%3A2022-10-31..2022-11-29&type=Issues) - - - ## 2022.10.31 ([Full Changelog](https://github.com/jupyterlab/lumino/compare/@lumino/application@1.29.4...8362e3daa3afac6b2e832b5bd225b662bdbd6593)) @@ -52,6 +28,8 @@ [@fcollonval](https://github.com/search?q=repo%3Ajupyterlab%2Flumino+involves%3Afcollonval+updated%3A2022-10-05..2022-10-31&type=Issues) | [@krassowski](https://github.com/search?q=repo%3Ajupyterlab%2Flumino+involves%3Akrassowski+updated%3A2022-10-05..2022-10-31&type=Issues) | [@meeseeksdev](https://github.com/search?q=repo%3Ajupyterlab%2Flumino+involves%3Ameeseeksdev+updated%3A2022-10-05..2022-10-31&type=Issues) | [@meeseeksmachine](https://github.com/search?q=repo%3Ajupyterlab%2Flumino+involves%3Ameeseeksmachine+updated%3A2022-10-05..2022-10-31&type=Issues) | [@vidartf](https://github.com/search?q=repo%3Ajupyterlab%2Flumino+involves%3Avidartf+updated%3A2022-10-05..2022-10-31&type=Issues) | [@welcome](https://github.com/search?q=repo%3Ajupyterlab%2Flumino+involves%3Awelcome+updated%3A2022-10-05..2022-10-31&type=Issues) + + ## 2022.10.5 ([Full Changelog](https://github.com/jupyterlab/lumino/compare/@lumino/algorithm@1.9.2...013594a89254d533b687d98e61dde5a537acc1c1)) From 0c66aba47003e18133b616486d5ed371a166f405 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Collonval?= Date: Mon, 5 Dec 2022 13:50:34 +0100 Subject: [PATCH 4/5] Remove alpha from menubar example version --- examples/example-menubar/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/example-menubar/package.json b/examples/example-menubar/package.json index dad696821..557d9c6e4 100644 --- a/examples/example-menubar/package.json +++ b/examples/example-menubar/package.json @@ -1,6 +1,6 @@ { "name": "@lumino/example-menubar", - "version": "0.1.1-alpha.0", + "version": "0.1.1", "private": true, "scripts": { "build": "tsc && webpack", From ccef260a633dd9fa5c86668baf0fcd98ccf23987 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Collonval?= Date: Mon, 5 Dec 2022 13:57:42 +0100 Subject: [PATCH 5/5] Update extracted API --- api-extractor-base.json | 2 +- review/api/algorithm.api.md | 30 ++- review/api/application.api.md | 15 +- review/api/collections.api.md | 14 +- review/api/commands.api.md | 53 +++-- review/api/coreutils.api.md | 10 +- review/api/datagrid.api.md | 397 +++++++++++++++++++++++++++++++- review/api/datastore.api.md | 46 ++-- review/api/disposable.api.md | 6 +- review/api/dragdrop.api.md | 14 +- review/api/keyboard.api.md | 6 +- review/api/polling.api.md | 29 ++- review/api/virtualdom.api.md | 65 +++++- review/api/widgets.api.md | 414 +++++++++++++++++++++------------- 14 files changed, 827 insertions(+), 274 deletions(-) diff --git a/api-extractor-base.json b/api-extractor-base.json index f66889bf7..01044a7ce 100644 --- a/api-extractor-base.json +++ b/api-extractor-base.json @@ -45,7 +45,7 @@ * * SUPPORTED TOKENS: , , */ - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/types/index.d.ts", /** * A list of NPM package names whose exports should be treated as part of this package. diff --git a/review/api/algorithm.api.md b/review/api/algorithm.api.md index bd0c26223..36c74bc7b 100644 --- a/review/api/algorithm.api.md +++ b/review/api/algorithm.api.md @@ -53,7 +53,7 @@ export class ArrayIterator implements IIterator { clone(): IIterator; iter(): IIterator; next(): T | undefined; - } +} // @public export function chain(...objects: IterableOrArrayLike[]): IIterator; @@ -64,7 +64,7 @@ export class ChainIterator implements IIterator { clone(): IIterator; iter(): IIterator; next(): T | undefined; - } +} // @public export function each(object: IterableOrArrayLike, fn: (value: T, index: number) => boolean | void): void; @@ -74,7 +74,6 @@ export function empty(): IIterator; // @public export class EmptyIterator implements IIterator { - constructor(); clone(): IIterator; iter(): IIterator; next(): T | undefined; @@ -89,7 +88,7 @@ export class EnumerateIterator implements IIterator<[number, T]> { clone(): IIterator<[number, T]>; iter(): IIterator<[number, T]>; next(): [number, T] | undefined; - } +} // @public export function every(object: IterableOrArrayLike, fn: (value: T, index: number) => boolean): boolean; @@ -103,7 +102,7 @@ export class FilterIterator implements IIterator { clone(): IIterator; iter(): IIterator; next(): T | undefined; - } +} // @public export function find(object: IterableOrArrayLike, fn: (value: T, index: number) => boolean): T | undefined; @@ -143,7 +142,7 @@ export class ItemIterator implements IIterator<[string, T]> { clone(): IIterator<[string, T]>; iter(): IIterator<[string, T]>; next(): [string, T] | undefined; - } +} // @public export function iter(object: IterableOrArrayLike): IIterator; @@ -177,7 +176,7 @@ export class KeyIterator implements IIterator { clone(): IIterator; iter(): IIterator; next(): string | undefined; - } +} // @public export function map(object: IterableOrArrayLike, fn: (value: T, index: number) => U): IIterator; @@ -188,7 +187,7 @@ export class MapIterator implements IIterator { clone(): IIterator; iter(): IIterator; next(): U | undefined; - } +} // @public export function max(object: IterableOrArrayLike, fn: (first: T, second: T) => number): T | undefined; @@ -211,7 +210,7 @@ export class RangeIterator implements IIterator { clone(): IIterator; iter(): IIterator; next(): number | undefined; - } +} // @public export function reduce(object: IterableOrArrayLike, fn: (accumulator: T, value: T, index: number) => T): T; @@ -228,7 +227,7 @@ export class RepeatIterator implements IIterator { clone(): IIterator; iter(): IIterator; next(): T | undefined; - } +} // @public export function retro(object: RetroableOrArrayLike): IIterator; @@ -242,7 +241,7 @@ export class RetroArrayIterator implements IIterator { clone(): IIterator; iter(): IIterator; next(): T | undefined; - } +} // @public export function some(object: IterableOrArrayLike, fn: (value: T, index: number) => boolean): boolean; @@ -256,7 +255,7 @@ export class StrideIterator implements IIterator { clone(): IIterator; iter(): IIterator; next(): T | undefined; - } +} // @public export namespace StringExt { @@ -280,7 +279,7 @@ export class TakeIterator implements IIterator { clone(): IIterator; iter(): IIterator; next(): T | undefined; - } +} // @public export function toArray(object: IterableOrArrayLike): T[]; @@ -301,7 +300,7 @@ export class ValueIterator implements IIterator { clone(): IIterator; iter(): IIterator; next(): T | undefined; - } +} // @public export function zip(...objects: IterableOrArrayLike[]): IIterator; @@ -312,8 +311,7 @@ export class ZipIterator implements IIterator { clone(): IIterator; iter(): IIterator; next(): T[] | undefined; - } - +} // (No @packageDocumentation comment for this package) diff --git a/review/api/application.api.md b/review/api/application.api.md index 5a0b1b172..0e842841d 100644 --- a/review/api/application.api.md +++ b/review/api/application.api.md @@ -11,18 +11,22 @@ import { Token } from '@lumino/coreutils'; import { Widget } from '@lumino/widgets'; // @public -export class Application { +export class Application { constructor(options: Application.IOptions); activatePlugin(id: string): Promise; protected addEventListeners(): void; protected attachShell(id: string): void; readonly commands: CommandRegistry; readonly contextMenu: ContextMenu; + deactivatePlugin(id: string): Promise; + deregisterPlugin(id: string, force?: boolean): void; protected evtContextMenu(event: MouseEvent): void; protected evtKeydown(event: KeyboardEvent): void; protected evtResize(event: Event): void; + getPluginDescription(id: string): string; handleEvent(event: Event): void; hasPlugin(id: string): boolean; + isPluginActivated(id: string): boolean; listPlugins(): string[]; registerPlugin(plugin: IPlugin): void; registerPlugins(plugins: IPlugin[]): void; @@ -31,7 +35,7 @@ export class Application { readonly shell: T; start(options?: Application.IStartOptions): Promise; readonly started: Promise; - } +} // @public export namespace Application { @@ -47,16 +51,17 @@ export namespace Application { } // @public -export interface IPlugin { +export interface IPlugin { activate: (app: T, ...args: any[]) => U | Promise; autoStart?: boolean; + deactivate?: ((app: T, ...args: Token[]) => void | Promise) | null; + description?: string; id: string; optional?: Token[]; - provides?: Token; + provides?: Token | null; requires?: Token[]; } - // (No @packageDocumentation comment for this package) ``` diff --git a/review/api/collections.api.md b/review/api/collections.api.md index 9ba2ccff3..3ae470204 100644 --- a/review/api/collections.api.md +++ b/review/api/collections.api.md @@ -9,7 +9,7 @@ import { IIterator } from '@lumino/algorithm'; import { IRetroable } from '@lumino/algorithm'; import { IterableOrArrayLike } from '@lumino/algorithm'; -// @public +// @public @deprecated export class BPlusTree implements IIterable, IRetroable { constructor(cmp: (a: T, b: T) => number); assign(items: IterableOrArrayLike): void; @@ -33,14 +33,13 @@ export class BPlusTree implements IIterable, IRetroable { update(items: IterableOrArrayLike): void; } -// @public +// @public @deprecated export namespace BPlusTree { export function from(items: IterableOrArrayLike, cmp: (a: T, b: T) => number): BPlusTree; } // @public export class LinkedList implements IIterable, IRetroable { - constructor(); addFirst(value: T): LinkedList.INode; addLast(value: T): LinkedList.INode; assign(values: IterableOrArrayLike): void; @@ -74,13 +73,13 @@ export namespace LinkedList { clone(): IIterator>; iter(): IIterator>; next(): INode | undefined; - } + } export class ForwardValueIterator implements IIterator { constructor(node: INode | null); clone(): IIterator; iter(): IIterator; next(): T | undefined; - } + } export function from(values: IterableOrArrayLike): LinkedList; export interface INode { readonly list: LinkedList | null; @@ -93,16 +92,15 @@ export namespace LinkedList { clone(): IIterator>; iter(): IIterator>; next(): INode | undefined; - } + } export class RetroValueIterator implements IIterator { constructor(node: INode | null); clone(): IIterator; iter(): IIterator; next(): T | undefined; - } + } } - // (No @packageDocumentation comment for this package) ``` diff --git a/review/api/commands.api.md b/review/api/commands.api.md index 7ace453b0..673f75937 100644 --- a/review/api/commands.api.md +++ b/review/api/commands.api.md @@ -7,49 +7,53 @@ import { IDisposable } from '@lumino/disposable'; import { ISignal } from '@lumino/signaling'; import { ReadonlyJSONObject } from '@lumino/coreutils'; +import { ReadonlyPartialJSONObject } from '@lumino/coreutils'; +import { VirtualElement } from '@lumino/virtualdom'; // @public export class CommandRegistry { - constructor(); addCommand(id: string, options: CommandRegistry.ICommandOptions): IDisposable; addKeyBinding(options: CommandRegistry.IKeyBindingOptions): IDisposable; - caption(id: string, args?: ReadonlyJSONObject): string; - className(id: string, args?: ReadonlyJSONObject): string; + caption(id: string, args?: ReadonlyPartialJSONObject): string; + className(id: string, args?: ReadonlyPartialJSONObject): string; readonly commandChanged: ISignal; readonly commandExecuted: ISignal; - dataset(id: string, args?: ReadonlyJSONObject): CommandRegistry.Dataset; - execute(id: string, args?: ReadonlyJSONObject): Promise; + dataset(id: string, args?: ReadonlyPartialJSONObject): CommandRegistry.Dataset; + describedBy(id: string): { + args: ReadonlyJSONObject | null; + }; + execute(id: string, args?: ReadonlyPartialJSONObject): Promise; hasCommand(id: string): boolean; - // @deprecated (undocumented) - icon(id: string, args?: ReadonlyJSONObject): string; - iconClass(id: string, args?: ReadonlyJSONObject): string; - iconLabel(id: string, args?: ReadonlyJSONObject): string; - isEnabled(id: string, args?: ReadonlyJSONObject): boolean; - isToggled(id: string, args?: ReadonlyJSONObject): boolean; - isVisible(id: string, args?: ReadonlyJSONObject): boolean; + icon(id: string, args?: ReadonlyPartialJSONObject): VirtualElement.IRenderer | undefined | string; + iconClass(id: string, args?: ReadonlyPartialJSONObject): string; + iconLabel(id: string, args?: ReadonlyPartialJSONObject): string; + isEnabled(id: string, args?: ReadonlyPartialJSONObject): boolean; + isToggleable(id: string, args?: ReadonlyJSONObject): boolean; + isToggled(id: string, args?: ReadonlyPartialJSONObject): boolean; + isVisible(id: string, args?: ReadonlyPartialJSONObject): boolean; readonly keyBindingChanged: ISignal; readonly keyBindings: ReadonlyArray; - label(id: string, args?: ReadonlyJSONObject): string; + label(id: string, args?: ReadonlyPartialJSONObject): string; listCommands(): string[]; - mnemonic(id: string, args?: ReadonlyJSONObject): number; + mnemonic(id: string, args?: ReadonlyPartialJSONObject): number; notifyCommandChanged(id?: string): void; processKeydownEvent(event: KeyboardEvent): void; - usage(id: string, args?: ReadonlyJSONObject): string; + usage(id: string, args?: ReadonlyPartialJSONObject): string; } // @public export namespace CommandRegistry { - export type CommandFunc = (args: ReadonlyJSONObject) => T; + export type CommandFunc = (args: ReadonlyPartialJSONObject) => T; export type Dataset = { readonly [key: string]: string; }; - export function formatKeystroke(keystroke: string): string; + export function formatKeystroke(keystroke: string | readonly string[]): string; export interface ICommandChangedArgs { readonly id: string | undefined; readonly type: 'added' | 'removed' | 'changed' | 'many-changed'; } export interface ICommandExecutedArgs { - readonly args: ReadonlyJSONObject; + readonly args: ReadonlyPartialJSONObject; readonly id: string; readonly result: Promise; } @@ -57,12 +61,15 @@ export namespace CommandRegistry { caption?: string | CommandFunc; className?: string | CommandFunc; dataset?: Dataset | CommandFunc; + describedBy?: { + args?: ReadonlyJSONObject; + }; execute: CommandFunc>; - // @deprecated (undocumented) - icon?: string | CommandFunc; + icon?: VirtualElement.IRenderer | undefined | string | CommandFunc; iconClass?: string | CommandFunc; iconLabel?: string | CommandFunc; isEnabled?: CommandFunc; + isToggleable?: boolean; isToggled?: CommandFunc; isVisible?: CommandFunc; label?: string | CommandFunc; @@ -70,7 +77,7 @@ export namespace CommandRegistry { usage?: string | CommandFunc; } export interface IKeyBinding { - readonly args: ReadonlyJSONObject; + readonly args: ReadonlyPartialJSONObject; readonly command: string; readonly keys: ReadonlyArray; readonly selector: string; @@ -80,7 +87,7 @@ export namespace CommandRegistry { readonly type: 'added' | 'removed'; } export interface IKeyBindingOptions { - args?: ReadonlyJSONObject; + args?: ReadonlyPartialJSONObject; command: string; keys: string[]; linuxKeys?: string[]; @@ -95,13 +102,13 @@ export namespace CommandRegistry { key: string; shift: boolean; } + export function isModifierKeyPressed(event: KeyboardEvent): boolean; export function keystrokeForKeydownEvent(event: KeyboardEvent): string; export function normalizeKeys(options: IKeyBindingOptions): string[]; export function normalizeKeystroke(keystroke: string): string; export function parseKeystroke(keystroke: string): IKeystrokeParts; } - // (No @packageDocumentation comment for this package) ``` diff --git a/review/api/coreutils.api.md b/review/api/coreutils.api.md index 77e6180d2..77afd60ef 100644 --- a/review/api/coreutils.api.md +++ b/review/api/coreutils.api.md @@ -51,7 +51,7 @@ export class MimeData { hasData(mime: string): boolean; setData(mime: string, data: any): void; types(): string[]; - } +} // @public export interface PartialJSONArray extends Array { @@ -72,11 +72,12 @@ export class PromiseDelegate { readonly promise: Promise; reject(reason: any): void; resolve(value: T | PromiseLike): void; - } +} // @public export namespace Random { - const getRandomValues: (buffer: Uint8Array) => void; + const // Warning: (ae-forgotten-export) The symbol "fallbackRandomValues" needs to be exported by the entry point index.d.ts + getRandomValues: typeof fallbackRandomValues; } // @public @@ -109,14 +110,13 @@ export type ReadonlyPartialJSONValue = JSONPrimitive | ReadonlyPartialJSONObject export class Token { constructor(name: string); readonly name: string; - } +} // @public export namespace UUID { const uuid4: () => string; } - // (No @packageDocumentation comment for this package) ``` diff --git a/review/api/datagrid.api.md b/review/api/datagrid.api.md index e62c5756e..200706c19 100644 --- a/review/api/datagrid.api.md +++ b/review/api/datagrid.api.md @@ -10,6 +10,7 @@ import { IMessageHandler } from '@lumino/messaging'; import { ISignal } from '@lumino/signaling'; import { Message } from '@lumino/messaging'; import { ReadonlyJSONObject } from '@lumino/coreutils'; +import { Signal } from '@lumino/signaling'; import { Widget } from '@lumino/widgets'; // @public @@ -20,6 +21,7 @@ export class BasicKeyHandler implements DataGrid.IKeyHandler { protected onArrowLeft(grid: DataGrid, event: KeyboardEvent): void; protected onArrowRight(grid: DataGrid, event: KeyboardEvent): void; protected onArrowUp(grid: DataGrid, event: KeyboardEvent): void; + protected onDelete(grid: DataGrid, event: KeyboardEvent): void; protected onEscape(grid: DataGrid, event: KeyboardEvent): void; protected onKeyC(grid: DataGrid, event: KeyboardEvent): void; onKeyDown(grid: DataGrid, event: KeyboardEvent): void; @@ -29,15 +31,20 @@ export class BasicKeyHandler implements DataGrid.IKeyHandler { // @public export class BasicMouseHandler implements DataGrid.IMouseHandler { + cursorForHandle(handle: ResizeHandle): string; dispose(): void; readonly isDisposed: boolean; onContextMenu(grid: DataGrid, event: MouseEvent): void; + onMouseDoubleClick(grid: DataGrid, event: MouseEvent): void; onMouseDown(grid: DataGrid, event: MouseEvent): void; onMouseHover(grid: DataGrid, event: MouseEvent): void; onMouseLeave(grid: DataGrid, event: MouseEvent): void; onMouseMove(grid: DataGrid, event: MouseEvent): void; onMouseUp(grid: DataGrid, event: MouseEvent): void; onWheel(grid: DataGrid, event: WheelEvent): void; + readonly pressData: PressData.PressData | null; + // (undocumented) + protected _pressData: PressData.PressData | null; release(): void; } @@ -48,10 +55,97 @@ export class BasicSelectionModel extends SelectionModel { readonly cursorColumn: number; readonly cursorRow: number; readonly isEmpty: boolean; + moveCursorWithinSelections(direction: SelectionModel.CursorMoveDirection): void; protected onDataModelChanged(sender: DataModel, args: DataModel.ChangedArgs): void; select(args: SelectionModel.SelectArgs): void; selections(): IIterator; - } +} + +// @public +export class BooleanCellEditor extends CellEditor { + dispose(): void; + protected getInput(): boolean | null; + handleEvent(event: Event): void; + protected startEditing(): void; +} + +// @public (undocumented) +export type CellDataType = 'string' | 'number' | 'integer' | 'boolean' | 'date' | 'string:option' | 'number:option' | 'integer:option' | 'date:option' | 'string:dynamic-option' | 'number:dynamic-option' | 'integer:dynamic-option' | 'date:dynamic-option'; + +// @public +export abstract class CellEditor implements ICellEditor, IDisposable { + constructor(); + cancel(): void; + protected cell: CellEditor.CellConfig; + protected commit(cursorMovement?: SelectionModel.CursorMoveDirection): boolean; + protected createValidatorBasedOnType(): ICellInputValidator | undefined; + dispose(): void; + edit(cell: CellEditor.CellConfig, options?: ICellEditOptions): void; + protected editorContainer: HTMLDivElement; + // Warning: (ae-forgotten-export) The symbol "Private" needs to be exported by the entry point index.d.ts + protected getCellInfo(cell: CellEditor.CellConfig): Private_2.ICellInfo; + protected abstract getInput(): any; + protected inputChanged: Signal; + readonly isDisposed: boolean; + protected onCancel?: () => void; + protected onCommit?: (response: ICellEditResponse) => void; + protected setValidity(valid: boolean, message?: string): void; + protected abstract startEditing(): void; + protected updatePosition(): void; + protected validate(): void; + protected validator: ICellInputValidator | undefined; + protected readonly validInput: boolean; + // Warning: (ae-forgotten-export) The symbol "Notification" needs to be exported by the entry point index.d.ts + protected validityNotification: Notification_2 | null; + protected viewportOccluder: HTMLDivElement; +} + +// @public +export namespace CellEditor { + export type CellConfig = { + readonly grid: DataGrid; + readonly row: number; + readonly column: number; + }; +} + +// @public +export class CellEditorController implements ICellEditorController { + cancel(): void; + edit(cell: CellEditor.CellConfig, options?: ICellEditOptions): boolean; + setEditor(identifier: EditorOverrideIdentifier, editor: ICellEditor | Resolver): void; +} + +// @public +export interface CellGroup { + // (undocumented) + c1: number; + // (undocumented) + c2: number; + // (undocumented) + r1: number; + // (undocumented) + r2: number; +} + +// @public +export namespace CellGroup { + export function areCellGroupsIntersecting(group1: CellGroup, group2: CellGroup): boolean; + export function areCellGroupsIntersectingAtAxis(group1: CellGroup, group2: CellGroup, axis: 'row' | 'column'): boolean; + // (undocumented) + export function areCellsMerged(dataModel: DataModel, rgn: DataModel.CellRegion, cell1: number[], cell2: number[]): boolean; + export function calculateMergeOffsets(dataModel: DataModel, regions: DataModel.CellRegion[], axis: 'row' | 'column', sectionList: SectionList, index: number): [number, number, CellGroup]; + export function getCellGroupsAtColumn(dataModel: DataModel, rgn: DataModel.CellRegion, column: number): CellGroup[]; + export function getCellGroupsAtRegion(dataModel: DataModel, rgn: DataModel.CellRegion): CellGroup[]; + export function getCellGroupsAtRow(dataModel: DataModel, rgn: DataModel.CellRegion, row: number): CellGroup[]; + export function getGroup(dataModel: DataModel, rgn: DataModel.CellRegion, row: number, column: number): CellGroup | null; + export function getGroupIndex(dataModel: DataModel, rgn: DataModel.CellRegion, row: number, column: number): number; + export function isCellGroupAbove(group1: CellGroup, group2: CellGroup): boolean; + export function isCellGroupBelow(group1: CellGroup, group2: CellGroup): boolean; + export function joinCellGroups(groups: CellGroup[]): CellGroup; + export function joinCellGroupsIntersectingAtAxis(dataModel: DataModel, regions: DataModel.CellRegion[], axis: 'row' | 'column', group: CellGroup): CellGroup; + export function joinCellGroupWithMergedCellGroups(dataModel: DataModel, group: CellGroup, region: DataModel.CellRegion): CellGroup; +} // @public export abstract class CellRenderer { @@ -76,21 +170,35 @@ export namespace CellRenderer { export function resolveOption(option: ConfigOption, config: CellConfig): T; } +// @public +export type ConfigFunc = (config: CellEditor.CellConfig) => T; + +// @public +export type ConfigOption = T | ConfigFunc; + // @public export class DataGrid extends Widget { constructor(options?: DataGrid.IOptions); readonly bodyHeight: number; readonly bodyWidth: number; + protected readonly canvasGC: CanvasRenderingContext2D; cellRenderers: RendererMap; columnAt(region: DataModel.ColumnRegion, offset: number): number; - columnCount(region: DataModel.RowRegion): number; + columnCount(region: DataModel.ColumnRegion): number; + protected readonly columnHeaderSections: SectionList; columnOffset(region: DataModel.ColumnRegion, index: number): number; + protected readonly columnSections: SectionList; columnSize(region: DataModel.ColumnRegion, index: number): number; copyConfig: DataGrid.CopyConfig; copyToClipboard(): void; dataModel: DataModel | null; defaultSizes: DataGrid.DefaultSizes; dispose(): void; + protected drawCornerHeaderRegion(rx: number, ry: number, rw: number, rh: number): void; + readonly editable: boolean; + editingEnabled: boolean; + editorController: ICellEditorController | null; + fitColumnNames(area?: DataGrid.ColumnFitType, padding?: number, numCols?: number): void; handleEvent(event: Event): void; readonly headerHeight: number; headerVisibility: DataGrid.HeaderVisibility; @@ -108,7 +216,9 @@ export class DataGrid extends Widget { readonly maxScrollX: number; readonly maxScrollY: number; messageHook(handler: IMessageHandler, msg: Message): boolean; + minimumSizes: DataGrid.DefaultSizes; mouseHandler: DataGrid.IMouseHandler | null; + moveCursor(direction: SelectionModel.CursorMoveDirection): void; protected onActivateRequest(msg: Message): void; protected onAfterDetach(msg: Message): void; protected onBeforeAttach(msg: Message): void; @@ -116,14 +226,20 @@ export class DataGrid extends Widget { protected onResize(msg: Widget.ResizeMessage): void; readonly pageHeight: number; readonly pageWidth: number; + protected paintContent(rx: number, ry: number, rw: number, rh: number): void; processMessage(msg: Message): void; + protected repaintContent(): void; + protected repaintOverlay(): void; + protected repaintRegion(region: DataModel.CellRegion, r1: number, c1: number, r2: number, c2: number): void; resetColumns(region: DataModel.ColumnRegion | 'all'): void; resetRows(region: DataModel.RowRegion | 'all'): void; resizeColumn(region: DataModel.ColumnRegion, index: number, size: number): void; resizeRow(region: DataModel.RowRegion, index: number, size: number): void; rowAt(region: DataModel.RowRegion, offset: number): number; rowCount(region: DataModel.RowRegion): number; + protected readonly rowHeaderSections: SectionList; rowOffset(region: DataModel.RowRegion, index: number): number; + protected readonly rowSections: SectionList; rowSize(region: DataModel.RowRegion, index: number): number; scrollBy(dx: number, dy: number): void; scrollByPage(dir: 'up' | 'down' | 'left' | 'right'): void; @@ -144,10 +260,11 @@ export class DataGrid extends Widget { readonly viewport: Widget; readonly viewportHeight: number; readonly viewportWidth: number; - } +} // @public export namespace DataGrid { + export type ColumnFitType = 'all' | 'row-header' | 'body'; export type CopyConfig = { readonly separator: string; readonly headers: 'none' | 'row' | 'column' | 'all'; @@ -184,6 +301,7 @@ export namespace DataGrid { } export interface IMouseHandler extends IDisposable { onContextMenu(grid: DataGrid, event: MouseEvent): void; + onMouseDoubleClick(grid: DataGrid, event: MouseEvent): void; onMouseDown(grid: DataGrid, event: MouseEvent): void; onMouseHover(grid: DataGrid, event: MouseEvent): void; onMouseLeave(grid: DataGrid, event: MouseEvent): void; @@ -198,10 +316,17 @@ export namespace DataGrid { defaultRenderer?: CellRenderer; defaultSizes?: DefaultSizes; headerVisibility?: HeaderVisibility; + minimumSizes?: MinimumSizes; stretchLastColumn?: boolean; stretchLastRow?: boolean; style?: Style; } + export type MinimumSizes = { + readonly rowHeight: number; + readonly columnWidth: number; + readonly rowHeaderWidth: number; + readonly columnHeaderHeight: number; + }; export type Style = { readonly voidColor?: string; readonly backgroundColor?: string; @@ -229,6 +354,7 @@ export namespace DataGrid { }; const defaultStyle: Style; const defaultSizes: DefaultSizes; + const minimumSizes: MinimumSizes; const defaultCopyConfig: CopyConfig; } @@ -238,6 +364,8 @@ export abstract class DataModel { abstract columnCount(region: DataModel.ColumnRegion): number; abstract data(region: DataModel.CellRegion, row: number, column: number): any; protected emitChanged(args: DataModel.ChangedArgs): void; + group(region: DataModel.CellRegion, groupIndex: number): CellGroup | null; + groupCount(region: DataModel.CellRegion): number; metadata(region: DataModel.CellRegion, row: number, column: number): DataModel.Metadata; abstract rowCount(region: DataModel.RowRegion): number; } @@ -253,7 +381,7 @@ export namespace DataModel { readonly rowSpan: number; readonly columnSpan: number; }; - export type ChangedArgs = (RowsChangedArgs | ColumnsChangedArgs | RowsMovedArgs | ColumnsMovedArgs | CellsChangedArgs | ModelResetArgs); + export type ChangedArgs = RowsChangedArgs | ColumnsChangedArgs | RowsMovedArgs | ColumnsMovedArgs | CellsChangedArgs | ModelResetArgs; export type ColumnRegion = 'body' | 'row-header'; const emptyMetadata: Metadata; export type ColumnsChangedArgs = { @@ -291,6 +419,25 @@ export namespace DataModel { }; } +// @public +export class DateCellEditor extends CellEditor { + dispose(): void; + protected getInput(): string | null; + handleEvent(event: Event): void; + protected startEditing(): void; +} + +// @public +export class DynamicOptionCellEditor extends CellEditor { + dispose(): void; + protected getInput(): string | null; + handleEvent(event: Event): void; + protected startEditing(): void; +} + +// @public +export type EditorOverrideIdentifier = CellDataType | DataModel.Metadata | 'default'; + // @public export class GraphicsContext implements IDisposable { constructor(context: CanvasRenderingContext2D); @@ -315,7 +462,7 @@ export class GraphicsContext implements IDisposable { // (undocumented) createLinearGradient(x0: number, y0: number, x1: number, y1: number): CanvasGradient; // (undocumented) - createPattern(image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement, repetition: string): CanvasPattern; + createPattern(image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement, repetition: string): CanvasPattern | null; // (undocumented) createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): CanvasGradient; // (undocumented) @@ -355,11 +502,11 @@ export class GraphicsContext implements IDisposable { // (undocumented) isPointInPath(x: number, y: number, fillRule?: CanvasFillRule): boolean; // (undocumented) - lineCap: string; + lineCap: CanvasLineCap; // (undocumented) lineDashOffset: number; // (undocumented) - lineJoin: string; + lineJoin: CanvasLineJoin; // (undocumented) lineTo(x: number, y: number): void; // (undocumented) @@ -407,15 +554,105 @@ export class GraphicsContext implements IDisposable { // (undocumented) strokeText(text: string, x: number, y: number, maxWidth?: number): void; // (undocumented) - textAlign: string; + textAlign: CanvasTextAlign; // (undocumented) - textBaseline: string; + textBaseline: CanvasTextBaseline; // (undocumented) transform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void; // (undocumented) translate(x: number, y: number): void; } +// @public +export class HyperlinkRenderer extends TextRenderer { + constructor(options?: HyperlinkRenderer.IOptions); + drawText(gc: GraphicsContext, config: CellRenderer.CellConfig): void; + readonly url: CellRenderer.ConfigOption | undefined; + readonly urlName: CellRenderer.ConfigOption | undefined; +} + +// @public (undocumented) +export namespace HyperlinkRenderer { + export type ElideDirection = 'left' | 'right'; + export type HorizontalAlignment = 'left' | 'center' | 'right'; + export interface IOptions extends TextRenderer.IOptions { + url?: CellRenderer.ConfigOption | undefined; + urlName?: CellRenderer.ConfigOption | undefined; + } + export type VerticalAlignment = 'top' | 'center' | 'bottom'; +} + +// @public +export interface ICellEditOptions { + editor?: ICellEditor; + onCancel?: () => void; + onCommit?: (response: ICellEditResponse) => void; + validator?: ICellInputValidator; +} + +// @public +export interface ICellEditor { + cancel(): void; + edit(cell: CellEditor.CellConfig, options?: ICellEditOptions): void; +} + +// @public +export interface ICellEditorController { + cancel(): void; + edit(cell: CellEditor.CellConfig, options?: ICellEditOptions): boolean; + setEditor(identifier: EditorOverrideIdentifier, editor: ICellEditor | Resolver): void; +} + +// @public +export interface ICellEditResponse { + cell: CellEditor.CellConfig; + cursorMovement: SelectionModel.CursorMoveDirection; + value: any; +} + +// @public +export interface ICellInputValidator { + validate(cell: CellEditor.CellConfig, value: any): ICellInputValidatorResponse; +} + +// @public +export interface ICellInputValidatorResponse { + message?: string; + valid: boolean; +} + +// @public +export abstract class InputCellEditor extends CellEditor { + // (undocumented) + protected bindEvents(): void; + // (undocumented) + protected createWidget(): void; + // (undocumented) + protected deserialize(value: any): any; + dispose(): void; + handleEvent(event: Event): void; + // (undocumented) + protected input: HTMLInputElement; + // (undocumented) + protected abstract inputType: string; + protected startEditing(): void; +} + +// @public +export class IntegerCellEditor extends InputCellEditor { + protected getInput(): number | null; + // (undocumented) + protected inputType: string; + protected startEditing(): void; +} + +// @public +export class IntegerInputValidator implements ICellInputValidator { + max: number; + min: number; + validate(cell: CellEditor.CellConfig, value: number): ICellInputValidatorResponse; +} + // @public export class JSONModel extends DataModel { constructor(options: JSONModel.IOptions); @@ -445,13 +682,93 @@ export namespace JSONModel { }; } +// @public +export abstract class MutableDataModel extends DataModel { + abstract setData(region: DataModel.CellRegion, row: number, column: number, value: any): boolean; +} + +// @public +export class NumberCellEditor extends InputCellEditor { + protected getInput(): number | null; + // (undocumented) + protected inputType: string; + protected startEditing(): void; +} + +// @public +export class NumberInputValidator implements ICellInputValidator { + max: number; + min: number; + validate(cell: CellEditor.CellConfig, value: number): ICellInputValidatorResponse; +} + +// @public +export class OptionCellEditor extends CellEditor { + dispose(): void; + protected getInput(): string | string[] | null; + protected startEditing(): void; + protected updatePosition(): void; +} + +// @public +export class PassInputValidator implements ICellInputValidator { + validate(cell: CellEditor.CellConfig, value: any): ICellInputValidatorResponse; +} + +// @public +export namespace PressData { + export type ColumnResizeData = { + readonly type: 'column-resize'; + readonly region: DataModel.ColumnRegion; + readonly index: number; + readonly size: number; + readonly clientX: number; + readonly override: IDisposable; + }; + export type PressData = RowResizeData | ColumnResizeData | SelectData; + export type RowResizeData = { + readonly type: 'row-resize'; + readonly region: DataModel.RowRegion; + readonly index: number; + readonly size: number; + readonly clientY: number; + readonly override: IDisposable; + }; + export type SelectData = { + readonly type: 'select'; + readonly region: DataModel.CellRegion; + readonly row: number; + readonly column: number; + readonly override: IDisposable; + localX: number; + localY: number; + timeout: number; + }; +} + +// @public +export namespace Private { + export function autoselect(grid: DataGrid, data: PressData.SelectData): void; + export function computeTimeout(delta: number): number; + export function createCellConfigObject(grid: DataGrid, hit: DataGrid.HitTestResult): CellRenderer.CellConfig | undefined; + export function resizeHandleForHitTest(hit: DataGrid.HitTestResult): ResizeHandle; + const cursorMap: { + top: string; + left: string; + right: string; + bottom: string; + hyperlink: string; + none: string; + }; +} + // @public export class RendererMap { constructor(values?: RendererMap.Values, fallback?: CellRenderer); readonly changed: ISignal; get(config: CellRenderer.CellConfig): CellRenderer; update(values?: RendererMap.Values, fallback?: CellRenderer): void; - } +} // @public export namespace RendererMap { @@ -461,6 +778,43 @@ export namespace RendererMap { }; } +// @public +export type ResizeHandle = 'top' | 'left' | 'right' | 'bottom' | 'none' | 'hyperlink'; + +// @public +export function resolveOption(option: ConfigOption, config: CellEditor.CellConfig): T; + +// @public +export type Resolver = ConfigFunc; + +// @public +export class SectionList { + constructor(options: SectionList.IOptions); + clampSize(size: number): number; + clear(): void; + readonly count: number; + defaultSize: number; + extentOf(index: number): number; + indexOf(offset: number): number; + insert(index: number, count: number): void; + readonly length: number; + minimumSize: number; + move(index: number, count: number, destination: number): void; + offsetOf(index: number): number; + remove(index: number, count: number): void; + reset(): void; + resize(index: number, size: number): void; + sizeOf(index: number): number; +} + +// @public +export namespace SectionList { + export interface IOptions { + defaultSize: number; + minimumSize?: number; + } +} + // @public export abstract class SelectionModel { constructor(options: SelectionModel.IOptions); @@ -475,6 +829,7 @@ export abstract class SelectionModel { isColumnSelected(index: number): boolean; abstract readonly isEmpty: boolean; isRowSelected(index: number): boolean; + abstract moveCursorWithinSelections(direction: SelectionModel.CursorMoveDirection): void; protected onDataModelChanged(sender: DataModel, args: DataModel.ChangedArgs): void; abstract select(args: SelectionModel.SelectArgs): void; selectionMode: SelectionModel.SelectionMode; @@ -484,6 +839,7 @@ export abstract class SelectionModel { // @public export namespace SelectionModel { export type ClearMode = 'all' | 'current' | 'none'; + export type CursorMoveDirection = 'up' | 'down' | 'left' | 'right' | 'none'; export interface IOptions { dataModel: DataModel; selectionMode?: SelectionMode; @@ -506,22 +862,40 @@ export namespace SelectionModel { export type SelectionMode = 'row' | 'column' | 'cell'; } +// @public +export class TextCellEditor extends InputCellEditor { + protected getInput(): string | null; + // (undocumented) + protected inputType: string; +} + +// @public +export class TextInputValidator implements ICellInputValidator { + maxLength: number; + minLength: number; + pattern: RegExp | null; + validate(cell: CellEditor.CellConfig, value: string): ICellInputValidatorResponse; +} + // @public export class TextRenderer extends CellRenderer { constructor(options?: TextRenderer.IOptions); readonly backgroundColor: CellRenderer.ConfigOption; drawBackground(gc: GraphicsContext, config: CellRenderer.CellConfig): void; drawText(gc: GraphicsContext, config: CellRenderer.CellConfig): void; + readonly elideDirection: CellRenderer.ConfigOption; readonly font: CellRenderer.ConfigOption; readonly format: TextRenderer.FormatFunc; readonly horizontalAlignment: CellRenderer.ConfigOption; paint(gc: GraphicsContext, config: CellRenderer.CellConfig): void; readonly textColor: CellRenderer.ConfigOption; readonly verticalAlignment: CellRenderer.ConfigOption; + readonly wrapText: CellRenderer.ConfigOption; } // @public export namespace TextRenderer { + export type ElideDirection = 'left' | 'right'; export function formatDate(options?: formatDate.IOptions): FormatFunc; export namespace formatDate { export interface IOptions { @@ -593,17 +967,18 @@ export namespace TextRenderer { export type HorizontalAlignment = 'left' | 'center' | 'right'; export interface IOptions { backgroundColor?: CellRenderer.ConfigOption; + elideDirection?: CellRenderer.ConfigOption; font?: CellRenderer.ConfigOption; format?: FormatFunc; horizontalAlignment?: CellRenderer.ConfigOption; textColor?: CellRenderer.ConfigOption; verticalAlignment?: CellRenderer.ConfigOption; + wrapText?: CellRenderer.ConfigOption; } export function measureFontHeight(font: string): number; export type VerticalAlignment = 'top' | 'center' | 'bottom'; } - // (No @packageDocumentation comment for this package) ``` diff --git a/review/api/datastore.api.md b/review/api/datastore.api.md index bd55a6290..8ca05d4f6 100644 --- a/review/api/datastore.api.md +++ b/review/api/datastore.api.md @@ -52,7 +52,7 @@ export namespace Datastore { field: F; }; export function getField(datastore: Datastore, loc: FieldLocation): S['fields'][F]['ValueType']; - export function getRecord(datastore: Datastore, loc: RecordLocation): Record.Value | undefined; + export function getRecord(datastore: Datastore, loc: RecordLocation): Record_2.Value | undefined; export function getTable(datastore: Datastore, loc: TableLocation): Table; export interface IChangedArgs { readonly change: Change; @@ -68,7 +68,7 @@ export namespace Datastore { transactionIdFactory?: TransactionIdFactory; } export function listenField(datastore: Datastore, loc: FieldLocation, slot: (source: Datastore, args: S['fields'][F]['ChangeType']) => void, thisArg?: any): IDisposable; - export function listenRecord(datastore: Datastore, loc: RecordLocation, slot: (source: Datastore, args: Record.Change) => void, thisArg?: any): IDisposable; + export function listenRecord(datastore: Datastore, loc: RecordLocation, slot: (source: Datastore, args: Record_2.Change) => void, thisArg?: any): IDisposable; export function listenTable(datastore: Datastore, loc: TableLocation, slot: (source: Datastore, args: Table.Change) => void, thisArg?: any): IDisposable; // @internal (undocumented) export type MutableChange = { @@ -96,7 +96,7 @@ export namespace Datastore { export type TransactionIdFactory = (version: number, storeId: number) => string; export type TransactionType = 'transaction' | 'undo' | 'redo'; export function updateField(datastore: Datastore, loc: FieldLocation, update: S['fields'][F]['UpdateType']): void; - export function updateRecord(datastore: Datastore, loc: RecordLocation, update: Record.Update): void; + export function updateRecord(datastore: Datastore, loc: RecordLocation, update: Record_2.Update): void; export function updateTable(datastore: Datastore, loc: TableLocation, update: Table.Update): void; export function withTransaction(datastore: Datastore, update: (id: string) => void): string; } @@ -262,39 +262,40 @@ export namespace MapField { } // @public -export type Record = Record.Base & Record.Value; +type Record_2 = Record_2.Base & Record_2.Value; // @public -export namespace Record { - export type Base = { +namespace Record_2 { + type Base = { readonly $id: string; readonly '@@metadata': Metadata; }; - export type Change = { + type Change = { readonly [N in keyof S['fields']]?: S['fields'][N]['ChangeType']; }; // @internal - export type Metadata = { + type Metadata = { readonly [N in keyof S['fields']]: S['fields'][N]['MetadataType']; }; // @internal - export type MutableChange = { + type MutableChange = { [N in keyof S['fields']]?: S['fields'][N]['ChangeType']; }; // @internal - export type MutablePatch = { + type MutablePatch = { [N in keyof S['fields']]?: S['fields'][N]['PatchType']; }; - export type Patch = { + type Patch = { readonly [N in keyof S['fields']]?: S['fields'][N]['PatchType']; }; - export type Update = { + type Update = { readonly [N in keyof S['fields']]?: S['fields'][N]['UpdateType']; }; - export type Value = { + type Value = { readonly [N in keyof S['fields']]: S['fields'][N]['ValueType']; }; } +export { Record_2 as Record } // @public export class RegisterField extends Field, RegisterField.Update, RegisterField.Metadata, RegisterField.Change, RegisterField.Patch> { @@ -340,17 +341,17 @@ export type Schema = { }; // @public -export class Table implements IIterable> { +export class Table implements IIterable> { // @internal static create(schema: U, context: Datastore.Context): Table; - get(id: string): Record | undefined; + get(id: string): Record_2 | undefined; has(id: string): boolean; readonly isEmpty: boolean; - iter(): IIterator>; + iter(): IIterator>; // @internal static patch(table: Table, data: Table.Patch): Table.Change; // @internal - static recreate(schema: U, context: Datastore.Context, records: IterableOrArrayLike>): Table; + static recreate(schema: U, context: Datastore.Context, records: IterableOrArrayLike>): Table; readonly schema: S; readonly size: number; // @internal @@ -361,21 +362,21 @@ export class Table implements IIterable> { // @public export namespace Table { export type Change = { - readonly [recordId: string]: Record.Change; + readonly [recordId: string]: Record_2.Change; }; // @internal export type MutableChange = { - [recordId: string]: Record.MutableChange; + [recordId: string]: Record_2.MutableChange; }; // @internal export type MutablePatch = { - [recordId: string]: Record.MutablePatch; + [recordId: string]: Record_2.MutablePatch; }; export type Patch = { - readonly [recordId: string]: Record.Patch; + readonly [recordId: string]: Record_2.Patch; }; export type Update = { - readonly [recordId: string]: Record.Update; + readonly [recordId: string]: Record_2.Update; }; } @@ -427,7 +428,6 @@ export namespace TextField { // @public export function validateSchema(schema: Schema): string[]; - // (No @packageDocumentation comment for this package) ``` diff --git a/review/api/disposable.api.md b/review/api/disposable.api.md index b66f8e9da..48c07bcb5 100644 --- a/review/api/disposable.api.md +++ b/review/api/disposable.api.md @@ -16,7 +16,6 @@ export class DisposableDelegate implements IDisposable { // @public export class DisposableSet implements IDisposable { - constructor(); add(item: IDisposable): void; clear(): void; contains(item: IDisposable): boolean; @@ -45,20 +44,19 @@ export interface IObservableDisposable extends IDisposable { export class ObservableDisposableDelegate extends DisposableDelegate implements IObservableDisposable { dispose(): void; readonly disposed: ISignal; - } +} // @public export class ObservableDisposableSet extends DisposableSet implements IObservableDisposable { dispose(): void; readonly disposed: ISignal; - } +} // @public export namespace ObservableDisposableSet { export function from(items: IterableOrArrayLike): ObservableDisposableSet; } - // (No @packageDocumentation comment for this package) ``` diff --git a/review/api/dragdrop.api.md b/review/api/dragdrop.api.md index 3a7983d6a..96f6a9bef 100644 --- a/review/api/dragdrop.api.md +++ b/review/api/dragdrop.api.md @@ -11,32 +11,35 @@ import { MimeData } from '@lumino/coreutils'; export class Drag implements IDisposable { constructor(options: Drag.IOptions); dispose(): void; + readonly document: Document | ShadowRoot; readonly dragImage: HTMLElement | null; handleEvent(event: Event): void; readonly isDisposed: boolean; readonly mimeData: MimeData; + protected moveDragImage(clientX: number, clientY: number): void; readonly proposedAction: DropAction; readonly source: any; start(clientX: number, clientY: number): Promise; readonly supportedActions: SupportedActions; - } +} // @public export namespace Drag { export interface IOptions { + document?: Document | ShadowRoot; dragImage?: HTMLElement; mimeData: MimeData; proposedAction?: DropAction; source?: any; supportedActions?: SupportedActions; } - export function overrideCursor(cursor: string): IDisposable; + export function overrideCursor(cursor: string, doc?: Document | ShadowRoot): IDisposable; } -// @public +// @public @deprecated export type DropAction = 'none' | 'copy' | 'link' | 'move'; -// @public +// @public @deprecated export interface IDragEvent extends MouseEvent { dropAction: DropAction; readonly mimeData: MimeData; @@ -45,10 +48,9 @@ export interface IDragEvent extends MouseEvent { readonly supportedActions: SupportedActions; } -// @public +// @public @deprecated export type SupportedActions = DropAction | 'copy-link' | 'copy-move' | 'link-move' | 'all'; - // (No @packageDocumentation comment for this package) ``` diff --git a/review/api/keyboard.api.md b/review/api/keyboard.api.md index 03feb09db..cf1603c0e 100644 --- a/review/api/keyboard.api.md +++ b/review/api/keyboard.api.md @@ -12,6 +12,7 @@ export function getKeyboardLayout(): IKeyboardLayout; // @public export interface IKeyboardLayout { + isModifierKey(key: string): boolean; isValidKey(key: string): boolean; keyForKeydownEvent(event: KeyboardEvent): string; keys(): string[]; @@ -20,7 +21,8 @@ export interface IKeyboardLayout { // @public export class KeycodeLayout implements IKeyboardLayout { - constructor(name: string, codes: KeycodeLayout.CodeMap); + constructor(name: string, codes: KeycodeLayout.CodeMap, modifierKeys?: string[]); + isModifierKey(key: string): boolean; isValidKey(key: string): boolean; keyForKeydownEvent(event: KeyboardEvent): string; keys(): string[]; @@ -32,6 +34,7 @@ export namespace KeycodeLayout { export type CodeMap = { readonly [code: number]: string; }; + export function convertToKeySet(keys: string[]): KeySet; export function extractKeys(codes: CodeMap): KeySet; export type KeySet = { readonly [key: string]: boolean; @@ -41,7 +44,6 @@ export namespace KeycodeLayout { // @public export function setKeyboardLayout(layout: IKeyboardLayout): void; - // (No @packageDocumentation comment for this package) ``` diff --git a/review/api/polling.api.md b/review/api/polling.api.md index e57e2526e..feb03ac52 100644 --- a/review/api/polling.api.md +++ b/review/api/polling.api.md @@ -10,8 +10,8 @@ import { ISignal } from '@lumino/signaling'; import { PromiseDelegate } from '@lumino/coreutils'; // @public -export class Debouncer extends RateLimiter { - invoke(): Promise; +export class Debouncer extends RateLimiter { + invoke(...args: V): Promise; } // @public @@ -42,8 +42,8 @@ export namespace IPoll { } // @public -export interface IRateLimiter extends IDisposable { - invoke(): Promise; +export interface IRateLimiter extends IDisposable { + invoke(...args: V): Promise; readonly limit: number; stop(): Promise; } @@ -66,7 +66,7 @@ export class Poll implements IOb stop(): Promise; readonly tick: Promise; readonly ticked: ISignal>; - } +} // @public export namespace Poll { @@ -85,10 +85,11 @@ export namespace Poll { } // @public -export abstract class RateLimiter implements IRateLimiter { - constructor(fn: () => T | Promise, limit?: number); +export abstract class RateLimiter implements IRateLimiter { + constructor(fn: (...args: V) => T | Promise, limit?: number); + protected args: V | undefined; dispose(): void; - abstract invoke(): Promise; + abstract invoke(...args: V): Promise; readonly isDisposed: boolean; readonly limit: number; protected payload: PromiseDelegate | null; @@ -97,10 +98,18 @@ export abstract class RateLimiter implements IRateLimiter { } // @public -export class Throttler extends RateLimiter { - invoke(): Promise; +export class Throttler extends RateLimiter { + constructor(fn: (...args: V) => T | Promise, options?: Throttler.IOptions | number); + invoke(...args: V): Promise; } +// @public +export namespace Throttler { + export interface IOptions { + edge?: 'leading' | 'trailing'; + limit?: number; + } +} // (No @packageDocumentation comment for this package) diff --git a/review/api/virtualdom.api.md b/review/api/virtualdom.api.md index 5a869f31d..d117a91ca 100644 --- a/review/api/virtualdom.api.md +++ b/review/api/virtualdom.api.md @@ -5,13 +5,21 @@ ```ts // @public -export type CSSPropertyNames = ('alignContent' | 'alignItems' | 'alignSelf' | 'alignmentBaseline' | 'animation' | 'animationDelay' | 'animationDirection' | 'animationDuration' | 'animationFillMode' | 'animationIterationCount' | 'animationName' | 'animationPlayState' | 'animationTimingFunction' | 'backfaceVisibility' | 'background' | 'backgroundAttachment' | 'backgroundClip' | 'backgroundColor' | 'backgroundImage' | 'backgroundOrigin' | 'backgroundPosition' | 'backgroundPositionX' | 'backgroundPositionY' | 'backgroundRepeat' | 'backgroundSize' | 'baselineShift' | 'border' | 'borderBottom' | 'borderBottomColor' | 'borderBottomLeftRadius' | 'borderBottomRightRadius' | 'borderBottomStyle' | 'borderBottomWidth' | 'borderCollapse' | 'borderColor' | 'borderImage' | 'borderImageOutset' | 'borderImageRepeat' | 'borderImageSlice' | 'borderImageSource' | 'borderImageWidth' | 'borderLeft' | 'borderLeftColor' | 'borderLeftStyle' | 'borderLeftWidth' | 'borderRadius' | 'borderRight' | 'borderRightColor' | 'borderRightStyle' | 'borderRightWidth' | 'borderSpacing' | 'borderStyle' | 'borderTop' | 'borderTopColor' | 'borderTopLeftRadius' | 'borderTopRightRadius' | 'borderTopStyle' | 'borderTopWidth' | 'borderWidth' | 'bottom' | 'boxShadow' | 'boxSizing' | 'breakAfter' | 'breakBefore' | 'breakInside' | 'captionSide' | 'clear' | 'clip' | 'clipPath' | 'clipRule' | 'color' | 'colorInterpolationFilters' | 'columnCount' | 'columnFill' | 'columnGap' | 'columnRule' | 'columnRuleColor' | 'columnRuleStyle' | 'columnRuleWidth' | 'columnSpan' | 'columnWidth' | 'columns' | 'content' | 'counterIncrement' | 'counterReset' | 'cssFloat' | 'cssText' | 'cursor' | 'direction' | 'display' | 'dominantBaseline' | 'emptyCells' | 'enableBackground' | 'fill' | 'fillOpacity' | 'fillRule' | 'filter' | 'flex' | 'flexBasis' | 'flexDirection' | 'flexFlow' | 'flexGrow' | 'flexShrink' | 'flexWrap' | 'floodColor' | 'floodOpacity' | 'font' | 'fontFamily' | 'fontFeatureSettings' | 'fontSize' | 'fontSizeAdjust' | 'fontStretch' | 'fontStyle' | 'fontVariant' | 'fontWeight' | 'glyphOrientationHorizontal' | 'glyphOrientationVertical' | 'height' | 'imeMode' | 'justifyContent' | 'kerning' | 'left' | 'letterSpacing' | 'lightingColor' | 'lineHeight' | 'listStyle' | 'listStyleImage' | 'listStylePosition' | 'listStyleType' | 'margin' | 'marginBottom' | 'marginLeft' | 'marginRight' | 'marginTop' | 'marker' | 'markerEnd' | 'markerMid' | 'markerStart' | 'mask' | 'maxHeight' | 'maxWidth' | 'minHeight' | 'minWidth' | 'msContentZoomChaining' | 'msContentZoomLimit' | 'msContentZoomLimitMax' | 'msContentZoomLimitMin' | 'msContentZoomSnap' | 'msContentZoomSnapPoints' | 'msContentZoomSnapType' | 'msContentZooming' | 'msFlowFrom' | 'msFlowInto' | 'msFontFeatureSettings' | 'msGridColumn' | 'msGridColumnAlign' | 'msGridColumnSpan' | 'msGridColumns' | 'msGridRow' | 'msGridRowAlign' | 'msGridRowSpan' | 'msGridRows' | 'msHighContrastAdjust' | 'msHyphenateLimitChars' | 'msHyphenateLimitLines' | 'msHyphenateLimitZone' | 'msHyphens' | 'msImeAlign' | 'msOverflowStyle' | 'msScrollChaining' | 'msScrollLimit' | 'msScrollLimitXMax' | 'msScrollLimitXMin' | 'msScrollLimitYMax' | 'msScrollLimitYMin' | 'msScrollRails' | 'msScrollSnapPointsX' | 'msScrollSnapPointsY' | 'msScrollSnapType' | 'msScrollSnapX' | 'msScrollSnapY' | 'msScrollTranslation' | 'msTextCombineHorizontal' | 'msTextSizeAdjust' | 'msTouchAction' | 'msTouchSelect' | 'msUserSelect' | 'msWrapFlow' | 'msWrapMargin' | 'msWrapThrough' | 'opacity' | 'order' | 'orphans' | 'outline' | 'outlineColor' | 'outlineStyle' | 'outlineWidth' | 'overflow' | 'overflowX' | 'overflowY' | 'padding' | 'paddingBottom' | 'paddingLeft' | 'paddingRight' | 'paddingTop' | 'pageBreakAfter' | 'pageBreakBefore' | 'pageBreakInside' | 'perspective' | 'perspectiveOrigin' | 'pointerEvents' | 'position' | 'quotes' | 'resize' | 'right' | 'rubyAlign' | 'rubyOverhang' | 'rubyPosition' | 'stopColor' | 'stopOpacity' | 'stroke' | 'strokeDasharray' | 'strokeDashoffset' | 'strokeLinecap' | 'strokeLinejoin' | 'strokeMiterlimit' | 'strokeOpacity' | 'strokeWidth' | 'tableLayout' | 'textAlign' | 'textAlignLast' | 'textAnchor' | 'textDecoration' | 'textIndent' | 'textJustify' | 'textKashida' | 'textKashidaSpace' | 'textOverflow' | 'textShadow' | 'textTransform' | 'textUnderlinePosition' | 'top' | 'touchAction' | 'transform' | 'transformOrigin' | 'transformStyle' | 'transition' | 'transitionDelay' | 'transitionDuration' | 'transitionProperty' | 'transitionTimingFunction' | 'unicodeBidi' | 'verticalAlign' | 'visibility' | 'webkitAlignContent' | 'webkitAlignItems' | 'webkitAlignSelf' | 'webkitAnimation' | 'webkitAnimationDelay' | 'webkitAnimationDirection' | 'webkitAnimationDuration' | 'webkitAnimationFillMode' | 'webkitAnimationIterationCount' | 'webkitAnimationName' | 'webkitAnimationPlayState' | 'webkitAnimationTimingFunction' | 'webkitAppearance' | 'webkitBackfaceVisibility' | 'webkitBackgroundClip' | 'webkitBackgroundOrigin' | 'webkitBackgroundSize' | 'webkitBorderBottomLeftRadius' | 'webkitBorderBottomRightRadius' | 'webkitBorderImage' | 'webkitBorderRadius' | 'webkitBorderTopLeftRadius' | 'webkitBorderTopRightRadius' | 'webkitBoxAlign' | 'webkitBoxDirection' | 'webkitBoxFlex' | 'webkitBoxOrdinalGroup' | 'webkitBoxOrient' | 'webkitBoxPack' | 'webkitBoxSizing' | 'webkitColumnBreakAfter' | 'webkitColumnBreakBefore' | 'webkitColumnBreakInside' | 'webkitColumnCount' | 'webkitColumnGap' | 'webkitColumnRule' | 'webkitColumnRuleColor' | 'webkitColumnRuleStyle' | 'webkitColumnRuleWidth' | 'webkitColumnSpan' | 'webkitColumnWidth' | 'webkitColumns' | 'webkitFilter' | 'webkitFlex' | 'webkitFlexBasis' | 'webkitFlexDirection' | 'webkitFlexFlow' | 'webkitFlexGrow' | 'webkitFlexShrink' | 'webkitFlexWrap' | 'webkitJustifyContent' | 'webkitOrder' | 'webkitPerspective' | 'webkitPerspectiveOrigin' | 'webkitTapHighlightColor' | 'webkitTextFillColor' | 'webkitTextSizeAdjust' | 'webkitTransform' | 'webkitTransformOrigin' | 'webkitTransformStyle' | 'webkitTransition' | 'webkitTransitionDelay' | 'webkitTransitionDuration' | 'webkitTransitionProperty' | 'webkitTransitionTimingFunction' | 'webkitUserModify' | 'webkitUserSelect' | 'webkitWritingMode' | 'whiteSpace' | 'widows' | 'width' | 'wordBreak' | 'wordSpacing' | 'wordWrap' | 'writingMode' | 'zIndex' | 'zoom'); +export type ARIAAttrNames = 'aria-activedescendant' | 'aria-atomic' | 'aria-autocomplete' | 'aria-busy' | 'aria-checked' | 'aria-colcount' | 'aria-colindex' | 'aria-colspan' | 'aria-controls' | 'aria-current' | 'aria-describedby' | 'aria-details' | 'aria-dialog' | 'aria-disabled' | 'aria-dropeffect' | 'aria-errormessage' | 'aria-expanded' | 'aria-flowto' | 'aria-grabbed' | 'aria-haspopup' | 'aria-hidden' | 'aria-invalid' | 'aria-keyshortcuts' | 'aria-label' | 'aria-labelledby' | 'aria-level' | 'aria-live' | 'aria-multiline' | 'aria-multiselectable' | 'aria-orientation' | 'aria-owns' | 'aria-placeholder' | 'aria-posinset' | 'aria-pressed' | 'aria-readonly' | 'aria-relevant' | 'aria-required' | 'aria-roledescription' | 'aria-rowcount' | 'aria-rowindex' | 'aria-rowspan' | 'aria-selected' | 'aria-setsize' | 'aria-sort' | 'aria-valuemax' | 'aria-valuemin' | 'aria-valuenow' | 'aria-valuetext' | 'role'; // @public -export type ElementAttrNames = ('abbr' | 'accept' | 'accept-charset' | 'accesskey' | 'action' | 'allowfullscreen' | 'alt' | 'autocomplete' | 'autofocus' | 'autoplay' | 'autosave' | 'checked' | 'cite' | 'cols' | 'colspan' | 'contenteditable' | 'controls' | 'coords' | 'crossorigin' | 'data' | 'datetime' | 'default' | 'dir' | 'dirname' | 'disabled' | 'download' | 'draggable' | 'dropzone' | 'enctype' | 'form' | 'formaction' | 'formenctype' | 'formmethod' | 'formnovalidate' | 'formtarget' | 'headers' | 'height' | 'hidden' | 'high' | 'href' | 'hreflang' | 'id' | 'inputmode' | 'integrity' | 'ismap' | 'kind' | 'label' | 'lang' | 'list' | 'loop' | 'low' | 'max' | 'maxlength' | 'media' | 'mediagroup' | 'method' | 'min' | 'minlength' | 'multiple' | 'muted' | 'name' | 'novalidate' | 'optimum' | 'pattern' | 'placeholder' | 'poster' | 'preload' | 'readonly' | 'rel' | 'required' | 'reversed' | 'rows' | 'rowspan' | 'sandbox' | 'scope' | 'selected' | 'shape' | 'size' | 'sizes' | 'span' | 'spellcheck' | 'src' | 'srcdoc' | 'srclang' | 'srcset' | 'start' | 'step' | 'tabindex' | 'target' | 'title' | 'type' | 'typemustmatch' | 'usemap' | 'value' | 'width' | 'wrap'); +export type CSSPropertyNames = 'alignContent' | 'alignItems' | 'alignSelf' | 'alignmentBaseline' | 'animation' | 'animationDelay' | 'animationDirection' | 'animationDuration' | 'animationFillMode' | 'animationIterationCount' | 'animationName' | 'animationPlayState' | 'animationTimingFunction' | 'backfaceVisibility' | 'background' | 'backgroundAttachment' | 'backgroundClip' | 'backgroundColor' | 'backgroundImage' | 'backgroundOrigin' | 'backgroundPosition' | 'backgroundPositionX' | 'backgroundPositionY' | 'backgroundRepeat' | 'backgroundSize' | 'baselineShift' | 'border' | 'borderBottom' | 'borderBottomColor' | 'borderBottomLeftRadius' | 'borderBottomRightRadius' | 'borderBottomStyle' | 'borderBottomWidth' | 'borderCollapse' | 'borderColor' | 'borderImage' | 'borderImageOutset' | 'borderImageRepeat' | 'borderImageSlice' | 'borderImageSource' | 'borderImageWidth' | 'borderLeft' | 'borderLeftColor' | 'borderLeftStyle' | 'borderLeftWidth' | 'borderRadius' | 'borderRight' | 'borderRightColor' | 'borderRightStyle' | 'borderRightWidth' | 'borderSpacing' | 'borderStyle' | 'borderTop' | 'borderTopColor' | 'borderTopLeftRadius' | 'borderTopRightRadius' | 'borderTopStyle' | 'borderTopWidth' | 'borderWidth' | 'bottom' | 'boxShadow' | 'boxSizing' | 'breakAfter' | 'breakBefore' | 'breakInside' | 'captionSide' | 'clear' | 'clip' | 'clipPath' | 'clipRule' | 'color' | 'colorInterpolationFilters' | 'columnCount' | 'columnFill' | 'columnGap' | 'columnRule' | 'columnRuleColor' | 'columnRuleStyle' | 'columnRuleWidth' | 'columnSpan' | 'columnWidth' | 'columns' | 'content' | 'counterIncrement' | 'counterReset' | 'cssFloat' | 'cssText' | 'cursor' | 'direction' | 'display' | 'dominantBaseline' | 'emptyCells' | 'enableBackground' | 'fill' | 'fillOpacity' | 'fillRule' | 'filter' | 'flex' | 'flexBasis' | 'flexDirection' | 'flexFlow' | 'flexGrow' | 'flexShrink' | 'flexWrap' | 'floodColor' | 'floodOpacity' | 'font' | 'fontFamily' | 'fontFeatureSettings' | 'fontSize' | 'fontSizeAdjust' | 'fontStretch' | 'fontStyle' | 'fontVariant' | 'fontWeight' | 'glyphOrientationHorizontal' | 'glyphOrientationVertical' | 'height' | 'imeMode' | 'justifyContent' | 'kerning' | 'left' | 'letterSpacing' | 'lightingColor' | 'lineHeight' | 'listStyle' | 'listStyleImage' | 'listStylePosition' | 'listStyleType' | 'margin' | 'marginBottom' | 'marginLeft' | 'marginRight' | 'marginTop' | 'marker' | 'markerEnd' | 'markerMid' | 'markerStart' | 'mask' | 'maxHeight' | 'maxWidth' | 'minHeight' | 'minWidth' | 'msContentZoomChaining' | 'msContentZoomLimit' | 'msContentZoomLimitMax' | 'msContentZoomLimitMin' | 'msContentZoomSnap' | 'msContentZoomSnapPoints' | 'msContentZoomSnapType' | 'msContentZooming' | 'msFlowFrom' | 'msFlowInto' | 'msFontFeatureSettings' | 'msGridColumn' | 'msGridColumnAlign' | 'msGridColumnSpan' | 'msGridColumns' | 'msGridRow' | 'msGridRowAlign' | 'msGridRowSpan' | 'msGridRows' | 'msHighContrastAdjust' | 'msHyphenateLimitChars' | 'msHyphenateLimitLines' | 'msHyphenateLimitZone' | 'msHyphens' | 'msImeAlign' | 'msOverflowStyle' | 'msScrollChaining' | 'msScrollLimit' | 'msScrollLimitXMax' | 'msScrollLimitXMin' | 'msScrollLimitYMax' | 'msScrollLimitYMin' | 'msScrollRails' | 'msScrollSnapPointsX' | 'msScrollSnapPointsY' | 'msScrollSnapType' | 'msScrollSnapX' | 'msScrollSnapY' | 'msScrollTranslation' | 'msTextCombineHorizontal' | 'msTextSizeAdjust' | 'msTouchAction' | 'msTouchSelect' | 'msUserSelect' | 'msWrapFlow' | 'msWrapMargin' | 'msWrapThrough' | 'opacity' | 'order' | 'orphans' | 'outline' | 'outlineColor' | 'outlineStyle' | 'outlineWidth' | 'overflow' | 'overflowX' | 'overflowY' | 'padding' | 'paddingBottom' | 'paddingLeft' | 'paddingRight' | 'paddingTop' | 'pageBreakAfter' | 'pageBreakBefore' | 'pageBreakInside' | 'perspective' | 'perspectiveOrigin' | 'pointerEvents' | 'position' | 'quotes' | 'resize' | 'right' | 'rubyAlign' | 'rubyOverhang' | 'rubyPosition' | 'stopColor' | 'stopOpacity' | 'stroke' | 'strokeDasharray' | 'strokeDashoffset' | 'strokeLinecap' | 'strokeLinejoin' | 'strokeMiterlimit' | 'strokeOpacity' | 'strokeWidth' | 'tableLayout' | 'textAlign' | 'textAlignLast' | 'textAnchor' | 'textDecoration' | 'textIndent' | 'textJustify' | 'textKashida' | 'textKashidaSpace' | 'textOverflow' | 'textShadow' | 'textTransform' | 'textUnderlinePosition' | 'top' | 'touchAction' | 'transform' | 'transformOrigin' | 'transformStyle' | 'transition' | 'transitionDelay' | 'transitionDuration' | 'transitionProperty' | 'transitionTimingFunction' | 'unicodeBidi' | 'verticalAlign' | 'visibility' | 'webkitAlignContent' | 'webkitAlignItems' | 'webkitAlignSelf' | 'webkitAnimation' | 'webkitAnimationDelay' | 'webkitAnimationDirection' | 'webkitAnimationDuration' | 'webkitAnimationFillMode' | 'webkitAnimationIterationCount' | 'webkitAnimationName' | 'webkitAnimationPlayState' | 'webkitAnimationTimingFunction' | 'webkitAppearance' | 'webkitBackfaceVisibility' | 'webkitBackgroundClip' | 'webkitBackgroundOrigin' | 'webkitBackgroundSize' | 'webkitBorderBottomLeftRadius' | 'webkitBorderBottomRightRadius' | 'webkitBorderImage' | 'webkitBorderRadius' | 'webkitBorderTopLeftRadius' | 'webkitBorderTopRightRadius' | 'webkitBoxAlign' | 'webkitBoxDirection' | 'webkitBoxFlex' | 'webkitBoxOrdinalGroup' | 'webkitBoxOrient' | 'webkitBoxPack' | 'webkitBoxSizing' | 'webkitColumnBreakAfter' | 'webkitColumnBreakBefore' | 'webkitColumnBreakInside' | 'webkitColumnCount' | 'webkitColumnGap' | 'webkitColumnRule' | 'webkitColumnRuleColor' | 'webkitColumnRuleStyle' | 'webkitColumnRuleWidth' | 'webkitColumnSpan' | 'webkitColumnWidth' | 'webkitColumns' | 'webkitFilter' | 'webkitFlex' | 'webkitFlexBasis' | 'webkitFlexDirection' | 'webkitFlexFlow' | 'webkitFlexGrow' | 'webkitFlexShrink' | 'webkitFlexWrap' | 'webkitJustifyContent' | 'webkitOrder' | 'webkitPerspective' | 'webkitPerspectiveOrigin' | 'webkitTapHighlightColor' | 'webkitTextFillColor' | 'webkitTextSizeAdjust' | 'webkitTransform' | 'webkitTransformOrigin' | 'webkitTransformStyle' | 'webkitTransition' | 'webkitTransitionDelay' | 'webkitTransitionDuration' | 'webkitTransitionProperty' | 'webkitTransitionTimingFunction' | 'webkitUserModify' | 'webkitUserSelect' | 'webkitWritingMode' | 'whiteSpace' | 'widows' | 'width' | 'wordBreak' | 'wordSpacing' | 'wordWrap' | 'writingMode' | 'zIndex' | 'zoom'; // @public -export type ElementAttrs = (ElementBaseAttrs & ElementEventAttrs & ElementSpecialAttrs); +export type ElementARIAAttrs = { + readonly [T in ARIAAttrNames]?: string; +}; + +// @public +export type ElementAttrNames = 'abbr' | 'accept' | 'accept-charset' | 'accesskey' | 'action' | 'allowfullscreen' | 'alt' | 'autocomplete' | 'autofocus' | 'autoplay' | 'autosave' | 'checked' | 'cite' | 'cols' | 'colspan' | 'contenteditable' | 'controls' | 'coords' | 'crossorigin' | 'data' | 'datetime' | 'default' | 'dir' | 'dirname' | 'disabled' | 'download' | 'draggable' | 'dropzone' | 'enctype' | 'form' | 'formaction' | 'formenctype' | 'formmethod' | 'formnovalidate' | 'formtarget' | 'headers' | 'height' | 'hidden' | 'high' | 'href' | 'hreflang' | 'id' | 'inputmode' | 'integrity' | 'ismap' | 'kind' | 'label' | 'lang' | 'list' | 'loop' | 'low' | 'max' | 'maxlength' | 'media' | 'mediagroup' | 'method' | 'min' | 'minlength' | 'multiple' | 'muted' | 'name' | 'novalidate' | 'optimum' | 'pattern' | 'placeholder' | 'poster' | 'preload' | 'readonly' | 'rel' | 'required' | 'reversed' | 'rows' | 'rowspan' | 'sandbox' | 'scope' | 'selected' | 'shape' | 'size' | 'sizes' | 'span' | 'spellcheck' | 'src' | 'srcdoc' | 'srclang' | 'srcset' | 'start' | 'step' | 'tabindex' | 'target' | 'title' | 'type' | 'typemustmatch' | 'usemap' | 'value' | 'width' | 'wrap'; + +// @public +export type ElementAttrs = ElementBaseAttrs & ElementARIAAttrs & ElementEventAttrs & ElementSpecialAttrs; // @public export type ElementBaseAttrs = { @@ -25,11 +33,11 @@ export type ElementDataset = { // @public export type ElementEventAttrs = { - readonly [T in keyof ElementEventMap]?: (this: HTMLElement, event: ElementEventMap[T]) => any; + readonly [T in keyof ElementEventMap_2]?: (this: HTMLElement, event: ElementEventMap_2[T]) => any; }; // @public -export type ElementEventMap = { +type ElementEventMap_2 = { onabort: UIEvent; onauxclick: MouseEvent; onblur: FocusEvent; @@ -100,6 +108,7 @@ export type ElementEventMap = { onvolumechange: Event; onwaiting: Event; }; +export { ElementEventMap_2 as ElementEventMap } // @public export type ElementInlineStyle = { @@ -121,6 +130,12 @@ export function h(tag: string, ...children: h.Child[]): VirtualElement; // @public (undocumented) export function h(tag: string, attrs: ElementAttrs, ...children: h.Child[]): VirtualElement; +// @public (undocumented) +export function h(tag: string, renderer: VirtualElement.IRenderer, ...children: h.Child[]): VirtualElement; + +// @public (undocumented) +export function h(tag: string, attrs: ElementAttrs, renderer: VirtualElement.IRenderer, ...children: h.Child[]): VirtualElement; + // @public export namespace h { export type Child = (string | VirtualNode | null) | Array; @@ -129,6 +144,10 @@ export namespace h { (...children: Child[]): VirtualElement; // (undocumented) (attrs: ElementAttrs, ...children: Child[]): VirtualElement; + // (undocumented) + (renderer: VirtualElement.IRenderer, ...children: h.Child[]): VirtualElement; + // (undocumented) + (attrs: ElementAttrs, renderer: VirtualElement.IRenderer, ...children: h.Child[]): VirtualElement; } const // (undocumented) a: IFactory; @@ -326,21 +345,54 @@ export namespace h { wbr: IFactory; } +// @public +export function hpass(tag: string, renderer?: VirtualElementPass.IRenderer): VirtualElementPass; + +// @public (undocumented) +export function hpass(tag: string, attrs: ElementAttrs, renderer?: VirtualElementPass.IRenderer): VirtualElementPass; + // @public export namespace VirtualDOM { + export function realize(node: VirtualText): Text; + // (undocumented) export function realize(node: VirtualElement): HTMLElement; export function render(content: VirtualNode | ReadonlyArray | null, host: HTMLElement): void; } // @public export class VirtualElement { - constructor(tag: string, attrs: ElementAttrs, children: ReadonlyArray); + constructor(tag: string, attrs: ElementAttrs, children: ReadonlyArray, renderer?: VirtualElement.IRenderer); readonly attrs: ElementAttrs; readonly children: ReadonlyArray; + readonly renderer: VirtualElement.IRenderer | undefined; readonly tag: string; readonly type: 'element'; } +// @public (undocumented) +export namespace VirtualElement { + export type IRenderer = { + render: (host: HTMLElement, options?: { + attrs?: ElementAttrs; + children?: ReadonlyArray; + }) => void; + unrender?: (host: HTMLElement, options?: { + attrs?: ElementAttrs; + children?: ReadonlyArray; + }) => void; + }; +} + +// @public +export class VirtualElementPass extends VirtualElement { + constructor(tag: string, attrs: ElementAttrs, renderer: VirtualElementPass.IRenderer | null); +} + +// @public (undocumented) +export namespace VirtualElementPass { + export type IRenderer = VirtualElement.IRenderer; +} + // @public export type VirtualNode = VirtualElement | VirtualText; @@ -351,7 +403,6 @@ export class VirtualText { readonly type: 'text'; } - // (No @packageDocumentation comment for this package) ``` diff --git a/review/api/widgets.api.md b/review/api/widgets.api.md index c8b242d69..07b9ca32f 100644 --- a/review/api/widgets.api.md +++ b/review/api/widgets.api.md @@ -6,6 +6,7 @@ import { CommandRegistry } from '@lumino/commands'; import { ConflatableMessage } from '@lumino/messaging'; +import { ElementARIAAttrs } from '@lumino/virtualdom'; import { ElementDataset } from '@lumino/virtualdom'; import { ElementInlineStyle } from '@lumino/virtualdom'; import { h } from '@lumino/virtualdom'; @@ -19,6 +20,68 @@ import { Message } from '@lumino/messaging'; import { ReadonlyJSONObject } from '@lumino/coreutils'; import { VirtualElement } from '@lumino/virtualdom'; +// @public +export class AccordionLayout extends SplitLayout { + constructor(options: AccordionLayout.IOptions); + protected attachWidget(index: number, widget: Widget): void; + protected detachWidget(index: number, widget: Widget): void; + dispose(): void; + protected moveWidget(fromIndex: number, toIndex: number, widget: Widget): void; + readonly renderer: AccordionLayout.IRenderer; + readonly titles: ReadonlyArray; + titleSpace: number; + protected updateItemPosition(i: number, isHorizontal: boolean, left: number, top: number, height: number, width: number, size: number): void; + // (undocumented) + updateTitle(index: number, widget: Widget): void; +} + +// @public (undocumented) +export namespace AccordionLayout { + export type Alignment = SplitLayout.Alignment; + export interface IOptions extends SplitLayout.IOptions { + renderer: IRenderer; + titleSpace?: number; + } + export interface IRenderer extends SplitLayout.IRenderer { + createSectionTitle(title: Title): HTMLElement; + readonly titleClassName: string; + } + export type Orientation = SplitLayout.Orientation; +} + +// @public +export class AccordionPanel extends SplitPanel { + constructor(options?: AccordionPanel.IOptions); + addWidget(widget: Widget): void; + collapse(index: number): void; + expand(index: number): void; + handleEvent(event: Event): void; + insertWidget(index: number, widget: Widget): void; + protected onAfterDetach(msg: Message): void; + protected onBeforeAttach(msg: Message): void; + readonly renderer: AccordionPanel.IRenderer; + readonly titles: ReadonlyArray; + titleSpace: number; +} + +// @public +export namespace AccordionPanel { + export type Alignment = SplitLayout.Alignment; + export interface IOptions extends Partial { + layout?: AccordionLayout; + } + export type IRenderer = AccordionLayout.IRenderer; + export type Orientation = SplitLayout.Orientation; + export class Renderer extends SplitPanel.Renderer implements IRenderer { + constructor(); + createCollapseIcon(data: Title): HTMLElement; + createSectionTitle(data: Title): HTMLElement; + createTitleKey(data: Title): string; + readonly titleClassName = "lm-AccordionPanel-title"; + } + const defaultRenderer: Renderer; +} + // @public export namespace BoxEngine { export function adjust(sizers: ArrayLike, index: number, delta: number): void; @@ -43,12 +106,12 @@ export class BoxLayout extends PanelLayout { protected onResize(msg: Widget.ResizeMessage): void; protected onUpdateRequest(msg: Message): void; spacing: number; - } +} // @public export namespace BoxLayout { export type Alignment = 'start' | 'center' | 'end' | 'justify'; - export type Direction = ('left-to-right' | 'right-to-left' | 'top-to-bottom' | 'bottom-to-top'); + export type Direction = 'left-to-right' | 'right-to-left' | 'top-to-bottom' | 'bottom-to-top'; export function getSizeBasis(widget: Widget): number; export function getStretch(widget: Widget): number; export interface IOptions { @@ -100,6 +163,7 @@ export class BoxSizer { export class CommandPalette extends Widget { constructor(options: CommandPalette.IOptions); addItem(options: CommandPalette.IItemOptions): CommandPalette.IItem; + addItems(items: CommandPalette.IItemOptions[]): CommandPalette.IItem[]; clearItems(): void; readonly commands: CommandRegistry; readonly contentNode: HTMLUListElement; @@ -116,7 +180,7 @@ export class CommandPalette extends Widget { removeItemAt(index: number): void; readonly renderer: CommandPalette.IRenderer; readonly searchNode: HTMLDivElement; - } +} // @public export namespace CommandPalette { @@ -134,9 +198,11 @@ export namespace CommandPalette { readonly className: string; readonly command: string; readonly dataset: CommandRegistry.Dataset; + readonly icon: VirtualElement.IRenderer | undefined | string; readonly iconClass: string; readonly iconLabel: string; readonly isEnabled: boolean; + readonly isToggleable: boolean; readonly isToggled: boolean; readonly isVisible: boolean; readonly keyBinding: CommandRegistry.IKeyBinding | null; @@ -200,7 +266,9 @@ export namespace ContextMenu { } export interface IOptions { commands: CommandRegistry; + groupByTarget?: boolean; renderer?: Menu.IRenderer; + sortBySelector?: boolean; } } @@ -212,6 +280,7 @@ export class DockLayout extends Layout { protected detachWidget(widget: Widget): void; dispose(): void; handles(): IIterator; + hiddenMode: Widget.HiddenMode; hitTestTabAreas(clientX: number, clientY: number): DockLayout.ITabAreaGeometry | null; protected init(): void; readonly isEmpty: boolean; @@ -244,68 +313,68 @@ export namespace DockLayout { export interface ILayoutConfig { main: AreaConfig | null; } - export type InsertMode = ( + export type InsertMode = /** + * The area to the top of the reference widget. + * + * The widget will be inserted just above the reference widget. + * + * If the reference widget is null or invalid, the widget will be + * inserted at the top edge of the dock layout. + */ 'split-top' /** - * The area to the top of the reference widget. - * - * The widget will be inserted just above the reference widget. - * - * If the reference widget is null or invalid, the widget will be - * inserted at the top edge of the dock layout. - */ - 'split-top' | + * The area to the left of the reference widget. + * + * The widget will be inserted just left of the reference widget. + * + * If the reference widget is null or invalid, the widget will be + * inserted at the left edge of the dock layout. + */ + | 'split-left' /** - * The area to the left of the reference widget. - * - * The widget will be inserted just left of the reference widget. - * - * If the reference widget is null or invalid, the widget will be - * inserted at the left edge of the dock layout. - */ - 'split-left' | + * The area to the right of the reference widget. + * + * The widget will be inserted just right of the reference widget. + * + * If the reference widget is null or invalid, the widget will be + * inserted at the right edge of the dock layout. + */ + | 'split-right' /** - * The area to the right of the reference widget. - * - * The widget will be inserted just right of the reference widget. - * - * If the reference widget is null or invalid, the widget will be - * inserted at the right edge of the dock layout. - */ - 'split-right' | + * The area to the bottom of the reference widget. + * + * The widget will be inserted just below the reference widget. + * + * If the reference widget is null or invalid, the widget will be + * inserted at the bottom edge of the dock layout. + */ + | 'split-bottom' /** - * The area to the bottom of the reference widget. - * - * The widget will be inserted just below the reference widget. - * - * If the reference widget is null or invalid, the widget will be - * inserted at the bottom edge of the dock layout. - */ - 'split-bottom' | + * The tab position before the reference widget. + * + * The widget will be added as a tab before the reference widget. + * + * If the reference widget is null or invalid, a sensible default + * will be used. + */ + | 'tab-before' /** - * The tab position before the reference widget. - * - * The widget will be added as a tab before the reference widget. - * - * If the reference widget is null or invalid, a sensible default - * will be used. - */ - 'tab-before' | - /** - * The tab position after the reference widget. - * - * The widget will be added as a tab after the reference widget. - * - * If the reference widget is null or invalid, a sensible default - * will be used. - */ - 'tab-after'); + * The tab position after the reference widget. + * + * The widget will be added as a tab after the reference widget. + * + * If the reference widget is null or invalid, a sensible default + * will be used. + */ + | 'tab-after'; export interface IOptions { + document?: Document | ShadowRoot; + hiddenMode?: Widget.HiddenMode; renderer: IRenderer; spacing?: number; } export interface IRenderer { createHandle(): HTMLDivElement; - createTabBar(): TabBar; + createTabBar(document?: Document | ShadowRoot): TabBar; } export interface ISplitAreaConfig { children: AreaConfig[]; @@ -335,10 +404,13 @@ export namespace DockLayout { export class DockPanel extends Widget { constructor(options?: DockPanel.IOptions); activateWidget(widget: Widget): void; + addButtonEnabled: boolean; + readonly addRequested: ISignal>; addWidget(widget: Widget, options?: DockPanel.IAddOptions): void; dispose(): void; handleEvent(event: Event): void; handles(): IIterator; + hiddenMode: Widget.HiddenMode; readonly isEmpty: boolean; readonly layoutModified: ISignal; mode: DockPanel.Mode; @@ -355,6 +427,7 @@ export class DockPanel extends Widget { selectWidget(widget: Widget): void; spacing: number; tabBars(): IIterator>; + tabsConstrained: boolean; tabsMovable: boolean; widgets(): IIterator; } @@ -371,11 +444,15 @@ export namespace DockPanel { export type ILayoutConfig = DockLayout.ILayoutConfig; export type InsertMode = DockLayout.InsertMode; export interface IOptions { + addButtonEnabled?: boolean; + document?: Document | ShadowRoot; edges?: IEdges; + hiddenMode?: Widget.HiddenMode; mode?: DockPanel.Mode; overlay?: IOverlay; renderer?: IRenderer; spacing?: number; + tabsConstrained?: boolean; tabsMovable?: boolean; } export interface IOverlay { @@ -390,37 +467,34 @@ export namespace DockPanel { top: number; } export type IRenderer = DockLayout.IRenderer; - export type Mode = ( - /** - * The single document mode. - * - * In this mode, only a single widget is visible at a time, and that - * widget fills the available layout space. No tab bars are visible. - */ - 'single-document' | + export type Mode = /** + * The single document mode. + * + * In this mode, only a single widget is visible at a time, and that + * widget fills the available layout space. No tab bars are visible. + */ 'single-document' /** - * The multiple document mode. - * - * In this mode, multiple documents are displayed in separate tab - * areas, and those areas can be individually resized by the user. - */ - 'multiple-document'); + * The multiple document mode. + * + * In this mode, multiple documents are displayed in separate tab + * areas, and those areas can be individually resized by the user. + */ + | 'multiple-document'; export class Overlay implements IOverlay { constructor(); hide(delay: number): void; readonly node: HTMLDivElement; show(geo: IOverlayGeometry): void; - } + } export class Renderer implements IRenderer { createHandle(): HTMLDivElement; - createTabBar(): TabBar; + createTabBar(document?: Document | ShadowRoot): TabBar; } const defaultRenderer: Renderer; } // @public export class FocusTracker implements IDisposable { - constructor(); readonly activeChanged: ISignal>; readonly activeWidget: T | null; add(widget: T): void; @@ -433,7 +507,7 @@ export class FocusTracker implements IDisposable { readonly isDisposed: boolean; remove(widget: T): void; readonly widgets: ReadonlyArray; - } +} // @public export namespace FocusTracker { @@ -468,7 +542,7 @@ export class GridLayout extends Layout { rowStretch(index: number): number; setColumnStretch(index: number, value: number): void; setRowStretch(index: number, value: number): void; - } +} // @public export namespace GridLayout { @@ -517,15 +591,13 @@ export abstract class Layout implements IIterable, IDisposable { // @public export namespace Layout { - export type FitPolicy = ( - /** - * No size constraint will be applied to the parent widget. - */ - 'set-no-constraint' | + export type FitPolicy = /** + * No size constraint will be applied to the parent widget. + */ 'set-no-constraint' /** - * The computed min size will be applied to the parent widget. - */ - 'set-min-size'); + * The computed min size will be applied to the parent widget. + */ + | 'set-min-size'; export function getHorizontalAlignment(widget: Widget): HorizontalAlignment; export function getVerticalAlignment(widget: Widget): VerticalAlignment; export type HorizontalAlignment = 'left' | 'center' | 'right'; @@ -552,7 +624,7 @@ export class LayoutItem implements IDisposable { readonly minWidth: number; update(left: number, top: number, width: number, height: number): void; readonly widget: Widget; - } +} // @public export class Menu extends Widget { @@ -596,8 +668,7 @@ export namespace Menu { readonly className: string; readonly command: string; readonly dataset: CommandRegistry.Dataset; - // @deprecated (undocumented) - readonly icon: string; + readonly icon: VirtualElement.IRenderer | undefined | string; readonly iconClass: string; readonly iconLabel: string; readonly isEnabled: boolean; @@ -627,14 +698,15 @@ export namespace Menu { readonly active: boolean; readonly collapsed: boolean; readonly item: IItem; + readonly onfocus?: () => void; } export interface IRenderer { renderItem(data: IRenderData): VirtualElement; } export type ItemType = 'command' | 'submenu' | 'separator'; export class Renderer implements IRenderer { - constructor(); createIconClass(data: IRenderData): string; + createItemARIA(data: IRenderData): ElementARIAAttrs; createItemClass(data: IRenderData): string; createItemDataset(data: IRenderData): ElementDataset; formatLabel(data: IRenderData): h.Child; @@ -674,18 +746,22 @@ export class MenuBar extends Widget { // @public export namespace MenuBar { export interface IOptions { + forceItemsPosition?: Menu.IOpenOptions; renderer?: IRenderer; } export interface IRenderData { readonly active: boolean; + // (undocumented) + readonly onfocus?: (event: FocusEvent) => void; + readonly tabbable?: boolean; readonly title: Title; } export interface IRenderer { renderItem(data: IRenderData): VirtualElement; } export class Renderer implements IRenderer { - constructor(); createIconClass(data: IRenderData): string; + createItemARIA(data: IRenderData): ElementARIAAttrs; createItemClass(data: IRenderData): string; createItemDataset(data: IRenderData): ElementDataset; formatLabel(data: IRenderData): h.Child; @@ -724,7 +800,7 @@ export class PanelLayout extends Layout { removeWidget(widget: Widget): void; removeWidgetAt(index: number): void; readonly widgets: ReadonlyArray; - } +} // @public export class ScrollBar extends Widget { @@ -744,7 +820,7 @@ export class ScrollBar extends Widget { readonly thumbNode: HTMLDivElement; readonly trackNode: HTMLDivElement; value: number; - } +} // @public export namespace ScrollBar { @@ -766,11 +842,12 @@ export class SingletonLayout extends Layout { iter(): IIterator; removeWidget(widget: Widget): void; widget: Widget | null; - } +} // @public export class SplitLayout extends PanelLayout { constructor(options: SplitLayout.IOptions); + absoluteSizes(): number[]; alignment: SplitLayout.Alignment; protected attachWidget(index: number, widget: Widget): void; protected detachWidget(index: number, widget: Widget): void; @@ -789,9 +866,12 @@ export class SplitLayout extends PanelLayout { orientation: SplitLayout.Orientation; relativeSizes(): number[]; readonly renderer: SplitLayout.IRenderer; - setRelativeSizes(sizes: number[]): void; + setRelativeSizes(sizes: number[], update?: boolean): void; spacing: number; - } + protected updateItemPosition(i: number, isHorizontal: boolean, left: number, top: number, height: number, width: number, size: number): void; + // (undocumented) + protected widgetOffset: number; +} // @public export namespace SplitLayout { @@ -816,6 +896,7 @@ export class SplitPanel extends Panel { alignment: SplitPanel.Alignment; dispose(): void; handleEvent(event: Event): void; + readonly handleMoved: ISignal; readonly handles: ReadonlyArray; protected onAfterDetach(msg: Message): void; protected onBeforeAttach(msg: Message): void; @@ -824,7 +905,7 @@ export class SplitPanel extends Panel { orientation: SplitPanel.Orientation; relativeSizes(): number[]; readonly renderer: SplitPanel.IRenderer; - setRelativeSizes(sizes: number[]): void; + setRelativeSizes(sizes: number[], update?: boolean): void; spacing: number; } @@ -850,9 +931,11 @@ export namespace SplitPanel { // @public export class StackedLayout extends PanelLayout { + constructor(options?: StackedLayout.IOptions); protected attachWidget(index: number, widget: Widget): void; protected detachWidget(index: number, widget: Widget): void; dispose(): void; + hiddenMode: Widget.HiddenMode; protected moveWidget(fromIndex: number, toIndex: number, widget: Widget): void; protected onBeforeAttach(msg: Message): void; protected onBeforeShow(msg: Message): void; @@ -861,15 +944,23 @@ export class StackedLayout extends PanelLayout { protected onFitRequest(msg: Message): void; protected onResize(msg: Widget.ResizeMessage): void; protected onUpdateRequest(msg: Message): void; +} + +// @public +export namespace StackedLayout { + export interface IOptions extends Layout.IOptions { + hiddenMode?: Widget.HiddenMode; } +} // @public export class StackedPanel extends Panel { constructor(options?: StackedPanel.IOptions); + hiddenMode: Widget.HiddenMode; protected onChildAdded(msg: Widget.ChildMessage): void; protected onChildRemoved(msg: Widget.ChildMessage): void; readonly widgetRemoved: ISignal; - } +} // @public export namespace StackedPanel { @@ -881,6 +972,9 @@ export namespace StackedPanel { // @public export class TabBar extends Widget { constructor(options?: TabBar.IOptions); + addButtonEnabled: boolean; + readonly addButtonNode: HTMLDivElement; + readonly addRequested: ISignal; addTab(value: Title | Title.IOptions): Title; allowDeselect: boolean; clearTabs(): void; @@ -889,9 +983,11 @@ export class TabBar extends Widget { currentIndex: number; currentTitle: Title | null; dispose(): void; + readonly document: Document | ShadowRoot; handleEvent(event: Event): void; insertBehavior: TabBar.InsertBehavior; insertTab(index: number, value: Title | Title.IOptions): Title; + name: string; protected onAfterDetach(msg: Message): void; protected onBeforeAttach(msg: Message): void; protected onUpdateRequest(msg: Message): void; @@ -907,7 +1003,8 @@ export class TabBar extends Widget { readonly tabMoved: ISignal>; tabsMovable: boolean; readonly titles: ReadonlyArray>; - } + titlesEditable: boolean; +} // @public export namespace TabBar { @@ -917,26 +1014,28 @@ export namespace TabBar { readonly previousIndex: number; readonly previousTitle: Title | null; } - export type InsertBehavior = ( + export type InsertBehavior = /** + * The selected tab will not be changed. + */ 'none' /** - * The selected tab will not be changed. - */ - 'none' | + * The inserted tab will be selected. + */ + | 'select-tab' /** - * The inserted tab will be selected. - */ - 'select-tab' | - /** - * The inserted tab will be selected if the current tab is null. - */ - 'select-tab-if-needed'); + * The inserted tab will be selected if the current tab is null. + */ + | 'select-tab-if-needed'; export interface IOptions { + addButtonEnabled?: boolean; allowDeselect?: boolean; + document?: Document | ShadowRoot; insertBehavior?: TabBar.InsertBehavior; + name?: string; orientation?: TabBar.Orientation; removeBehavior?: TabBar.RemoveBehavior; renderer?: IRenderer; tabsMovable?: boolean; + titlesEditable?: boolean; } export interface IRenderData { readonly current: boolean; @@ -967,40 +1066,37 @@ export namespace TabBar { readonly title: Title; readonly toIndex: number; } - export type Orientation = ( - /** - * The tabs are arranged in a single row, left-to-right. - * - * The tab text orientation is horizontal. - */ - 'horizontal' | - /** - * The tabs are arranged in a single column, top-to-bottom. - * - * The tab text orientation is horizontal. - */ - 'vertical'); - export type RemoveBehavior = ( + export type Orientation = /** + * The tabs are arranged in a single row, left-to-right. + * + * The tab text orientation is horizontal. + */ 'horizontal' /** - * No tab will be selected. - */ - 'none' | + * The tabs are arranged in a single column, top-to-bottom. + * + * The tab text orientation is horizontal. + */ + | 'vertical'; + export type RemoveBehavior = /** + * No tab will be selected. + */ 'none' /** - * The tab after the removed tab will be selected if possible. - */ - 'select-tab-after' | + * The tab after the removed tab will be selected if possible. + */ + | 'select-tab-after' /** - * The tab before the removed tab will be selected if possible. - */ - 'select-tab-before' | + * The tab before the removed tab will be selected if possible. + */ + | 'select-tab-before' /** - * The previously selected tab will be selected if possible. - */ - 'select-previous-tab'); + * The previously selected tab will be selected if possible. + */ + | 'select-previous-tab'; export class Renderer implements IRenderer { constructor(); - readonly closeIconSelector: string; + readonly closeIconSelector = ".lm-TabBar-tabCloseIcon"; createIconClass(data: IRenderData): string; + createTabARIA(data: IRenderData): ElementARIAAttrs; createTabClass(data: IRenderData): string; createTabDataset(data: IRenderData): ElementDataset; createTabKey(data: IRenderData): string; @@ -1009,13 +1105,16 @@ export namespace TabBar { renderIcon(data: IRenderData): VirtualElement; renderLabel(data: IRenderData): VirtualElement; renderTab(data: IRenderData): VirtualElement; - } + } const defaultRenderer: Renderer; + const addButtonSelector = ".lm-TabBar-addButton"; } // @public export class TabPanel extends Widget { constructor(options?: TabPanel.IOptions); + addButtonEnabled: boolean; + readonly addRequested: ISignal>; addWidget(widget: Widget): void; readonly currentChanged: ISignal; currentIndex: number; @@ -1037,41 +1136,44 @@ export namespace TabPanel { previousWidget: Widget | null; } export interface IOptions { + addButtonEnabled?: boolean; + document?: Document | ShadowRoot; renderer?: TabBar.IRenderer; tabPlacement?: TabPlacement; tabsMovable?: boolean; } - export type TabPlacement = ( + export type TabPlacement = /** + * The tabs are placed as a row above the content. + */ 'top' /** - * The tabs are placed as a row above the content. - */ - 'top' | + * The tabs are placed as a column to the left of the content. + */ + | 'left' /** - * The tabs are placed as a column to the left of the content. - */ - 'left' | + * The tabs are placed as a column to the right of the content. + */ + | 'right' /** - * The tabs are placed as a column to the right of the content. - */ - 'right' | - /** - * The tabs are placed as a row below the content. - */ - 'bottom'); + * The tabs are placed as a row below the content. + */ + | 'bottom'; } // @public -export class Title { +export class Title implements IDisposable { constructor(options: Title.IOptions); caption: string; readonly changed: ISignal; className: string; closable: boolean; dataset: Title.Dataset; - // @deprecated (undocumented) - icon: string; + dispose(): void; + icon: VirtualElement.IRenderer | undefined | string; iconClass: string; iconLabel: string; + // @deprecated (undocumented) + iconRenderer: VirtualElement.IRenderer | undefined; + readonly isDisposed: boolean; label: string; mnemonic: number; readonly owner: T; @@ -1087,10 +1189,11 @@ export namespace Title { className?: string; closable?: boolean; dataset?: Dataset; - // @deprecated (undocumented) - icon?: string; + icon?: VirtualElement.IRenderer | string; iconClass?: string; iconLabel?: string; + // @deprecated (undocumented) + iconRenderer?: VirtualElement.IRenderer; label?: string; mnemonic?: number; owner: T; @@ -1111,6 +1214,7 @@ export class Widget implements IMessageHandler, IObservableDisposable { readonly disposed: ISignal; fit(): void; hasClass(name: string): boolean; + hiddenMode: Widget.HiddenMode; hide(): void; id: string; readonly isAttached: boolean; @@ -1162,8 +1266,13 @@ export namespace Widget { IsHidden = 4, IsVisible = 8 } + export enum HiddenMode { + Display = 0, + Scale = 1 + } export interface IOptions { node?: HTMLElement; + tag?: keyof HTMLElementTagNameMap; } export namespace Msg { const BeforeShow: Message; @@ -1190,7 +1299,6 @@ export namespace Widget { } } - // (No @packageDocumentation comment for this package) ```