Comparing version 0.5.6 to 0.6.0
@@ -7,2 +7,11 @@ /*! | ||
import * as Types from './Types'; | ||
interface CrossOriginInstanceContext { | ||
ignoreKeyboardNavigationStateUpdate: boolean; | ||
focusOwner?: string; | ||
focusOwnerTimestamp?: number; | ||
deloserByUId: { | ||
[uid: string]: Types.Deloser; | ||
}; | ||
origOutlineSetup?: ((props?: Partial<Types.OutlineProps>) => void); | ||
} | ||
interface KnownTargets { | ||
@@ -58,3 +67,4 @@ [id: string]: { | ||
sendUp: Types.CrossOriginTransactionSend | undefined; | ||
constructor(tabster: Types.TabsterCore, getOwner: Types.GetWindow); | ||
ctx: CrossOriginInstanceContext; | ||
constructor(tabster: Types.TabsterCore, getOwner: Types.GetWindow, context: CrossOriginInstanceContext); | ||
setup(sendUp?: Types.CrossOriginTransactionSend | null): (msg: Types.CrossOriginMessage) => void; | ||
@@ -114,2 +124,3 @@ setSendUp(sendUp?: Types.CrossOriginTransactionSend | null): (msg: Types.CrossOriginMessage) => void; | ||
private _blurTimer; | ||
private _ctx; | ||
focusedElement: Types.CrossOriginFocusedElementState; | ||
@@ -116,0 +127,0 @@ observedElement: Types.CrossOriginObservedElementState; |
@@ -44,2 +44,3 @@ /*! | ||
readonly uid: string; | ||
private _win; | ||
private _tabster; | ||
@@ -46,0 +47,0 @@ private _basic; |
@@ -6,2 +6,10 @@ /*! | ||
import * as Types from './Types'; | ||
interface CurrentGrouppers { | ||
focused: { | ||
[id: string]: Types.Groupper; | ||
}; | ||
current: { | ||
[id: string]: Types.Groupper; | ||
}; | ||
} | ||
export declare class UberGroupper implements Types.UberGroupper { | ||
@@ -12,2 +20,3 @@ private static _containers; | ||
private _element; | ||
private _cur; | ||
private _current; | ||
@@ -34,3 +43,3 @@ private _prev; | ||
readonly id: string; | ||
constructor(tabster: Types.TabsterCore, element: HTMLElement, getWindow: Types.GetWindow); | ||
constructor(tabster: Types.TabsterCore, element: HTMLElement, getWindow: Types.GetWindow, current: CurrentGrouppers); | ||
dispose(): void; | ||
@@ -56,2 +65,3 @@ getElement(): HTMLElement | undefined; | ||
private _win; | ||
private _cur; | ||
private _element; | ||
@@ -62,3 +72,3 @@ private _container; | ||
readonly id: string; | ||
constructor(tabster: Types.TabsterCore, element: HTMLElement, getWindow: Types.GetWindow, basic?: Types.GroupperBasicProps, extended?: Types.GroupperExtendedProps); | ||
constructor(tabster: Types.TabsterCore, element: HTMLElement, getWindow: Types.GetWindow, current: CurrentGrouppers, basic?: Types.GroupperBasicProps, extended?: Types.GroupperExtendedProps); | ||
dispose(): void; | ||
@@ -84,2 +94,3 @@ getBasicProps(): Types.GroupperBasicProps; | ||
private _scrollTargets; | ||
private _cur; | ||
constructor(tabster: Types.TabsterCore, getWindow: Types.GetWindow); | ||
@@ -134,1 +145,2 @@ private _init; | ||
} | ||
export {}; |
@@ -6,2 +6,5 @@ /*! | ||
import * as Types from './Types'; | ||
export interface WindowWithTabsterInstance extends Window { | ||
__tabsterInstance?: Types.TabsterCore; | ||
} | ||
export declare class Root implements Types.Root { | ||
@@ -48,2 +51,5 @@ readonly uid: string; | ||
private _autoRootInstance; | ||
rootById: { | ||
[id: string]: Types.Root; | ||
}; | ||
constructor(tabster: Types.TabsterCore, forgetFocusedGrouppers: () => void, autoRoot?: Types.RootBasicProps); | ||
@@ -59,4 +65,12 @@ private _init; | ||
private static _getRootOnly; | ||
static getRootByUId(id: string): Types.Root | undefined; | ||
static getTabsterContext(tabster: Types.TabsterCore, element: Node): Types.TabsterContext | undefined; | ||
static getRootByUId(getWindow: Types.GetWindow, id: string): Types.Root | undefined; | ||
/** | ||
* Fetches the tabster context for an element walking up its ancestors | ||
* | ||
* @param tabster Tabster instance | ||
* @param element The element the tabster context should represent | ||
* @param options Additional options | ||
* @returns undefined if the element is not a child of a tabster root, otherwise all applicable tabster behaviours and configurations | ||
*/ | ||
static getTabsterContext(tabster: Types.TabsterCore, element: Node, options?: Types.GetTabsterContextOptions): Types.TabsterContext | undefined; | ||
} |
@@ -32,3 +32,3 @@ /*! | ||
private _onFocusOut; | ||
static replaceFocus(win: Window): void; | ||
static replaceFocus(getWindow: Types.GetWindow): void; | ||
static restoreFocus(win: Window): void; | ||
@@ -35,0 +35,0 @@ private _onMouseDown; |
@@ -13,2 +13,4 @@ /*! | ||
private _lastRequestFocusId; | ||
private _observedById; | ||
private _observedByName; | ||
constructor(tabster: Types.TabsterCore); | ||
@@ -15,0 +17,0 @@ private _init; |
@@ -5,2 +5,3 @@ /*! | ||
*/ | ||
import { WindowWithTabsterInstance } from './Root'; | ||
import * as Types from './Types'; | ||
@@ -12,5 +13,2 @@ import { setBasics as overrideBasics } from './Utils'; | ||
*/ | ||
interface WindowWithTabsterInstance extends Window { | ||
__tabsterInstance?: Types.TabsterCore; | ||
} | ||
declare class Tabster implements Types.TabsterCore, Types.TabsterInternal { | ||
@@ -17,0 +15,0 @@ private _storage; |
@@ -382,2 +382,8 @@ /*! | ||
} | ||
export interface GetTabsterContextOptions { | ||
/** | ||
* Should visit **all** element ancestors to verify if `dir='rtl'` is set | ||
*/ | ||
checkRtl?: boolean; | ||
} | ||
export interface TabsterContext { | ||
@@ -390,2 +396,6 @@ root: Root; | ||
isGroupperFirst?: boolean; | ||
/** | ||
* Whether `dir='rtl'` is set on an ancestor | ||
*/ | ||
isRtl?: boolean; | ||
} | ||
@@ -392,0 +402,0 @@ export interface RootAPI { |
@@ -25,20 +25,45 @@ /*! | ||
} | ||
export declare const elementByUId: { | ||
[uid: string]: WeakHTMLElement<HTMLElementWithUID>; | ||
}; | ||
export interface InstanceContext { | ||
getWindow: GetWindow; | ||
elementByUId: { | ||
[uid: string]: WeakHTMLElement<HTMLElementWithUID>; | ||
}; | ||
basics: Types.InternalBasics; | ||
WeakRef?: WeakRefConstructor; | ||
containerBoundingRectCache: { | ||
[id: string]: { | ||
rect: TabsterDOMRect; | ||
element: HTMLElementWithBoundingRectCacheId; | ||
}; | ||
}; | ||
lastContainerBoundingRectCacheId: number; | ||
containerBoundingRectCacheTimer?: number; | ||
weakElementStorage: { | ||
[id: string]: TabsterWeakRef; | ||
}; | ||
lastWeakElementId: number; | ||
weakCleanupTimer?: number; | ||
weakCleanupStarted: boolean; | ||
} | ||
export declare function getInstanceContext(getWindow: GetWindow): InstanceContext; | ||
export declare function disposeInstanceContext(win: Window): void; | ||
interface TabsterWeakRef { | ||
deref(): HTMLElement | undefined; | ||
} | ||
export declare class WeakHTMLElement<T extends HTMLElement = HTMLElement, D = undefined> { | ||
private _ctx; | ||
private _id; | ||
private _data; | ||
constructor(element: T, data?: D); | ||
constructor(getWindow: GetWindow, element: T, data?: D); | ||
get(): T | undefined; | ||
getData(): D | undefined; | ||
} | ||
export declare function cleanupWeakRefStorage(forceRemove?: boolean): void; | ||
export declare function startWeakRefStorageCleanup(win: GetWindow): void; | ||
export declare function stopWeakRefStorageCleanupAndClearStorage(win: GetWindow): void; | ||
export declare function cleanupWeakRefStorage(getWindow: GetWindow, forceRemove?: boolean): void; | ||
export declare function startWeakRefStorageCleanup(getWindow: GetWindow): void; | ||
export declare function stopWeakRefStorageCleanupAndClearStorage(getWindow: GetWindow): void; | ||
export declare function createElementTreeWalker(doc: Document, root: Node, acceptNode: (node: Node) => number): TreeWalker | undefined; | ||
export declare function getBoundingRect(element: HTMLElementWithBoundingRectCacheId): TabsterDOMRect; | ||
export declare function isElementVerticallyVisibleInContainer(element: HTMLElement): boolean; | ||
export declare function isElementVisibleInContainer(element: HTMLElement, gap?: number): ElementVisibility; | ||
export declare function scrollIntoView(element: HTMLElement, alignToTop: boolean): void; | ||
export declare function getBoundingRect(getWindow: GetWindow, element: HTMLElementWithBoundingRectCacheId): TabsterDOMRect; | ||
export declare function isElementVerticallyVisibleInContainer(getWindow: GetWindow, element: HTMLElement): boolean; | ||
export declare function isElementVisibleInContainer(getWindow: GetWindow, element: HTMLElement, gap?: number): ElementVisibility; | ||
export declare function scrollIntoView(getWindow: GetWindow, element: HTMLElement, alignToTop: boolean): void; | ||
export declare function getScrollableContainer(element: HTMLElement): HTMLElement | null; | ||
@@ -51,10 +76,11 @@ export declare function makeFocusIgnored(element: HTMLElement): void; | ||
}): string; | ||
export declare function getElementUId(element: HTMLElementWithUID, win: Window): string; | ||
export declare function getElementUId(getWindow: GetWindow, element: HTMLElementWithUID): string; | ||
export declare function getElementByUId(context: InstanceContext, uid: string): WeakHTMLElement<HTMLElementWithUID, undefined> | undefined; | ||
export declare function getWindowUId(win: WindowWithUID): string; | ||
export declare function clearElementCache(parent?: HTMLElement): void; | ||
export declare function clearElementCache(getWindow: GetWindow, parent?: HTMLElement): void; | ||
export declare function documentContains(doc: HTMLDocument | null | undefined, element: HTMLElement): boolean; | ||
export declare function matchesSelector(element: HTMLElement, selector: string): boolean; | ||
export declare function getPromise(): PromiseConstructor; | ||
export declare function getWeakRef<T>(): WeakRefConstructor | undefined; | ||
export declare function setBasics(basics: Types.InternalBasics): void; | ||
export declare function getPromise(getWindow: GetWindow): PromiseConstructor; | ||
export declare function getWeakRef<T>(context: InstanceContext): WeakRefConstructor | undefined; | ||
export declare function setBasics(win: Window, basics: Types.InternalBasics): void; | ||
export {}; |
{ | ||
"name": "tabster", | ||
"version": "0.5.6", | ||
"version": "0.6.0", | ||
"description": "Focus Management Tools for Web", | ||
@@ -20,3 +20,4 @@ "author": "Marat Abdullin <marata@microsoft.com>", | ||
"clean": "rimraf dist", | ||
"tslint": "tslint --project tsconfig.json -r tslint.json -r ./node_modules/tslint-microsoft-contrib --fix || true", | ||
"tslint": "tslint --project tsconfig.json --fix || true", | ||
"tslint:check": "tslint --project tsconfig.json", | ||
"prepare": "npm run build" | ||
@@ -27,10 +28,10 @@ }, | ||
"core-js": "^3.9.1", | ||
"lint": "^0.6.0", | ||
"rimraf": "^3.0.2", | ||
"tsdx": "^0.14.1", | ||
"tslint": "^6.1.3", | ||
"tslint-microsoft-contrib": "^6.2.0", | ||
"tsutils": "^3.21.0", | ||
"typescript": "^4.2.3" | ||
}, | ||
"gitHead": "73032fcc24c4b3db0e18b302a3c84afbfafdd56e" | ||
"gitHead": "ed298c0a1907a3bdf5c6cebb98500ae37da0b68d" | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
629438
14625