@a11d/lit-application 0.0.7 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/dist/Application.d.ts +0 -20
- package/dist/Application.d.ts.map +0 -1
- package/dist/Application.js +0 -100
- package/dist/Dialog/Dialog.d.ts +0 -22
- package/dist/Dialog/Dialog.d.ts.map +0 -1
- package/dist/Dialog/Dialog.js +0 -1
- package/dist/Dialog/DialogCancelledError.d.ts +0 -5
- package/dist/Dialog/DialogCancelledError.d.ts.map +0 -1
- package/dist/Dialog/DialogCancelledError.js +0 -5
- package/dist/Dialog/DialogComponent.d.ts +0 -43
- package/dist/Dialog/DialogComponent.d.ts.map +0 -1
- package/dist/Dialog/DialogComponent.js +0 -161
- package/dist/Dialog/DialogHost.d.ts +0 -11
- package/dist/Dialog/DialogHost.d.ts.map +0 -1
- package/dist/Dialog/DialogHost.js +0 -13
- package/dist/Dialog/PageDialog.d.ts +0 -13
- package/dist/Dialog/PageDialog.d.ts.map +0 -1
- package/dist/Dialog/PageDialog.js +0 -22
- package/dist/Dialog/index.d.ts +0 -6
- package/dist/Dialog/index.d.ts.map +0 -1
- package/dist/Dialog/index.js +0 -5
- package/dist/Notification/NotificationComponent.d.ts +0 -6
- package/dist/Notification/NotificationComponent.d.ts.map +0 -1
- package/dist/Notification/NotificationComponent.js +0 -1
- package/dist/Notification/NotificationHost.d.ts +0 -44
- package/dist/Notification/NotificationHost.d.ts.map +0 -1
- package/dist/Notification/NotificationHost.js +0 -94
- package/dist/Notification/index.d.ts +0 -3
- package/dist/Notification/index.d.ts.map +0 -1
- package/dist/Notification/index.js +0 -2
- package/dist/Page/Page.d.ts +0 -6
- package/dist/Page/Page.d.ts.map +0 -1
- package/dist/Page/Page.js +0 -1
- package/dist/Page/PageComponent.d.ts +0 -23
- package/dist/Page/PageComponent.d.ts.map +0 -1
- package/dist/Page/PageComponent.js +0 -48
- package/dist/Page/PageError.d.ts +0 -18
- package/dist/Page/PageError.d.ts.map +0 -1
- package/dist/Page/PageError.js +0 -68
- package/dist/Page/PageHost.d.ts +0 -11
- package/dist/Page/PageHost.d.ts.map +0 -1
- package/dist/Page/PageHost.js +0 -19
- package/dist/Page/index.d.ts +0 -5
- package/dist/Page/index.d.ts.map +0 -1
- package/dist/Page/index.js +0 -4
- package/dist/PwaHelper/Manifest.d.ts +0 -17
- package/dist/PwaHelper/Manifest.d.ts.map +0 -1
- package/dist/PwaHelper/Manifest.js +0 -1
- package/dist/PwaHelper/ManifestProvider.d.ts +0 -5
- package/dist/PwaHelper/ManifestProvider.d.ts.map +0 -1
- package/dist/PwaHelper/ManifestProvider.js +0 -17
- package/dist/PwaHelper/PwaHelper.d.ts +0 -16
- package/dist/PwaHelper/PwaHelper.d.ts.map +0 -1
- package/dist/PwaHelper/PwaHelper.js +0 -37
- package/dist/PwaHelper/index.d.ts +0 -4
- package/dist/PwaHelper/index.d.ts.map +0 -1
- package/dist/PwaHelper/index.js +0 -3
- package/dist/Router/Router.d.ts +0 -18
- package/dist/Router/Router.d.ts.map +0 -1
- package/dist/Router/Router.js +0 -31
- package/dist/Router/RouterController.d.ts +0 -2
- package/dist/Router/RouterController.d.ts.map +0 -1
- package/dist/Router/RouterController.js +0 -1
- package/dist/Router/index.d.ts +0 -5
- package/dist/Router/index.d.ts.map +0 -1
- package/dist/Router/index.js +0 -4
- package/dist/Router/routerLink.d.ts +0 -16
- package/dist/Router/routerLink.d.ts.map +0 -1
- package/dist/Router/routerLink.js +0 -37
- package/dist/index.d.ts +0 -8
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -7
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/dist/utilities/HookSet.d.ts +0 -5
- package/dist/utilities/HookSet.d.ts.map +0 -1
- package/dist/utilities/HookSet.js +0 -5
- package/dist/utilities/HttpError.d.ts +0 -7
- package/dist/utilities/HttpError.d.ts.map +0 -1
- package/dist/utilities/HttpError.js +0 -46
- package/dist/utilities/HttpErrorCode.d.ts +0 -41
- package/dist/utilities/HttpErrorCode.d.ts.map +0 -1
- package/dist/utilities/HttpErrorCode.js +0 -1
- package/dist/utilities/LocalStorageEntry.d.ts +0 -13
- package/dist/utilities/LocalStorageEntry.d.ts.map +0 -1
- package/dist/utilities/LocalStorageEntry.js +0 -30
- package/dist/utilities/RootCssInjectorController.d.ts +0 -12
- package/dist/utilities/RootCssInjectorController.d.ts.map +0 -1
- package/dist/utilities/RootCssInjectorController.js +0 -21
- package/dist/utilities/WindowHelper.d.ts +0 -10
- package/dist/utilities/WindowHelper.d.ts.map +0 -1
- package/dist/utilities/WindowHelper.js +0 -22
- package/dist/utilities/index.d.ts +0 -11
- package/dist/utilities/index.d.ts.map +0 -1
- package/dist/utilities/index.js +0 -10
- package/dist/utilities/nonInertable.d.ts +0 -3
- package/dist/utilities/nonInertable.d.ts.map +0 -1
- package/dist/utilities/nonInertable.js +0 -11
- package/dist/utilities/queryInstanceElement.d.ts +0 -3
- package/dist/utilities/queryInstanceElement.d.ts.map +0 -1
- package/dist/utilities/queryInstanceElement.js +0 -9
- package/dist/utilities/querySymbolizedElement.d.ts +0 -3
- package/dist/utilities/querySymbolizedElement.d.ts.map +0 -1
- package/dist/utilities/querySymbolizedElement.js +0 -15
package/dist/Page/Page.d.ts
DELETED
package/dist/Page/Page.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Page.d.ts","sourceRoot":"","sources":["../../Page/Page.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAEtC,MAAM,WAAW,IAAK,SAAQ,UAAU;IACvC,gEAAgE;IAChE,QAAQ,CAAC,iBAAiB,EAAE,eAAe,CAAC,MAAM,CAAC,CAAA;CACnD"}
|
package/dist/Page/Page.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { Component, LitElement } from '@a11d/lit';
|
|
2
|
-
import { HookSet } from '../index.js';
|
|
3
|
-
import { Page } from './index.js';
|
|
4
|
-
export declare type PageParameters = void | Record<string, string | number | undefined>;
|
|
5
|
-
export declare const enum PageNavigationStrategy {
|
|
6
|
-
Page = 0,
|
|
7
|
-
Tab = 1,
|
|
8
|
-
Window = 2
|
|
9
|
-
}
|
|
10
|
-
export declare abstract class PageComponent<T extends PageParameters = void> extends Component {
|
|
11
|
-
readonly parameters: T;
|
|
12
|
-
static readonly beforeNavigationHooks: HookSet<PageComponent<any>>;
|
|
13
|
-
private static readonly pageElementConstructorSymbol;
|
|
14
|
-
static defaultPageElementTag: import("lit-html/static.js").StaticValue;
|
|
15
|
-
static pageElement(): (constructor: Constructor<Page>) => void;
|
|
16
|
-
static getHost(): Promise<HTMLElement>;
|
|
17
|
-
static getCurrentPage(): Promise<PageComponent<any> | undefined>;
|
|
18
|
-
navigate(strategy?: PageNavigationStrategy, force?: boolean): Promise<void>;
|
|
19
|
-
readonly pageElement: LitElement;
|
|
20
|
-
constructor(parameters: T);
|
|
21
|
-
protected refresh(parameters?: T): any;
|
|
22
|
-
}
|
|
23
|
-
//# sourceMappingURL=PageComponent.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PageComponent.d.ts","sourceRoot":"","sources":["../../Page/PageComponent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAW,MAAM,WAAW,CAAA;AAC1D,OAAO,EAAwD,OAAO,EAAuB,MAAM,aAAa,CAAA;AAChH,OAAO,EAAE,IAAI,EAAY,MAAM,YAAY,CAAA;AAE3C,oBAAY,cAAc,GAAG,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC,CAAA;AAE/E,0BAAkB,sBAAsB;IAAG,IAAI,IAAA;IAAE,GAAG,IAAA;IAAE,MAAM,IAAA;CAAE;AAE9D,8BAAsB,aAAa,CAAC,CAAC,SAAS,cAAc,GAAG,IAAI,CAAE,SAAQ,SAAS;IAyCzE,QAAQ,CAAC,UAAU,EAAE,CAAC;IAxClC,MAAM,CAAC,QAAQ,CAAC,qBAAqB,8BAAoC;IAEzE,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,4BAA4B,CAAiD;IAErG,MAAM,CAAC,qBAAqB,2CAAoB;IAEhD,MAAM,CAAC,WAAW,kBACI,YAAY,IAAI,CAAC;IAKvC,MAAM,CAAC,OAAO;WAID,cAAc;IAMrB,QAAQ,CAAC,QAAQ,yBAA8B,EAAE,KAAK,UAAQ;IAgBA,QAAQ,CAAC,WAAW,EAAG,UAAU,CAAA;gBAEhF,UAAU,EAAE,CAAC;IAIlC,SAAS,CAAC,OAAO,CAAC,UAAU,IAAkB;CAG9C"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
import { Component, literal } from '@a11d/lit';
|
|
3
|
-
import { querySymbolizedElement, WindowHelper, HookSet, Application, Router } from '../index.js';
|
|
4
|
-
import { PageHost } from './index.js';
|
|
5
|
-
export class PageComponent extends Component {
|
|
6
|
-
constructor(parameters) {
|
|
7
|
-
super();
|
|
8
|
-
this.parameters = parameters;
|
|
9
|
-
}
|
|
10
|
-
static pageElement() {
|
|
11
|
-
return (constructor) => {
|
|
12
|
-
constructor[PageComponent.pageElementConstructorSymbol] = true;
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
static getHost() {
|
|
16
|
-
var _a, _b;
|
|
17
|
-
return Promise.resolve((_b = (_a = PageHost.instance) !== null && _a !== void 0 ? _a : Application.instance) !== null && _b !== void 0 ? _b : document.body);
|
|
18
|
-
}
|
|
19
|
-
static async getCurrentPage() {
|
|
20
|
-
var _a;
|
|
21
|
-
const host = await this.getHost();
|
|
22
|
-
return [...(_a = host.querySelectorAll('*')) !== null && _a !== void 0 ? _a : []]
|
|
23
|
-
.find((page) => page instanceof PageComponent);
|
|
24
|
-
}
|
|
25
|
-
async navigate(strategy = 0 /* PageNavigationStrategy.Page */, force = false) {
|
|
26
|
-
const currentPage = await PageComponent.getCurrentPage();
|
|
27
|
-
if (currentPage && Router.pathsMatch(currentPage, this) && force === false) {
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
await PageComponent.beforeNavigationHooks.execute(this);
|
|
31
|
-
if (strategy === 0 /* PageNavigationStrategy.Page */) {
|
|
32
|
-
Router.setPathByPage(this);
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
const url = window.location.origin + Router.getPathOf(this);
|
|
36
|
-
await WindowHelper.openAndFocus(url, strategy === 2 /* PageNavigationStrategy.Window */ ? 1 /* WindowOpenMode.Window */ : 0 /* WindowOpenMode.Tab */);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
refresh(parameters = this.parameters) {
|
|
40
|
-
return new this.constructor(parameters).navigate(0 /* PageNavigationStrategy.Page */, true);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
PageComponent.beforeNavigationHooks = new HookSet();
|
|
44
|
-
PageComponent.pageElementConstructorSymbol = Symbol('PageComponent.PageElementConstructor');
|
|
45
|
-
PageComponent.defaultPageElementTag = literal `lit-page`;
|
|
46
|
-
__decorate([
|
|
47
|
-
querySymbolizedElement(PageComponent.pageElementConstructorSymbol)
|
|
48
|
-
], PageComponent.prototype, "pageElement", void 0);
|
package/dist/Page/PageError.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { HTMLTemplateResult } from '@a11d/lit';
|
|
2
|
-
import { HttpErrorCode } from '../index.js';
|
|
3
|
-
import { PageComponent } from './PageComponent.js';
|
|
4
|
-
export declare class PageError extends PageComponent<{
|
|
5
|
-
readonly error: HttpErrorCode;
|
|
6
|
-
readonly message?: string;
|
|
7
|
-
}> {
|
|
8
|
-
private static readonly emojisByErrorCodes;
|
|
9
|
-
static get styles(): import("@a11d/lit").CSSResult;
|
|
10
|
-
protected get template(): HTMLTemplateResult;
|
|
11
|
-
private get errorTemplate();
|
|
12
|
-
}
|
|
13
|
-
declare global {
|
|
14
|
-
interface HTMLElementTagNameMap {
|
|
15
|
-
'lit-page-error': PageError;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=PageError.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PageError.d.ts","sourceRoot":"","sources":["../../Page/PageError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,kBAAkB,EAAqB,MAAM,WAAW,CAAA;AACvF,OAAO,EAAa,aAAa,EAAE,MAAM,aAAa,CAAA;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAElD,qBACa,SAAU,SAAQ,aAAa,CAAC;IAAE,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;IAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;IACzG,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,kBAAkB,CAoBxC;IAEF,WAAoB,MAAM,kCAazB;IAED,cAAuB,QAAQ,uBAW9B;IAED,OAAO,KAAK,aAAa,GAQxB;CACD;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,gBAAgB,EAAE,SAAS,CAAA;KAC3B;CACD"}
|
package/dist/Page/PageError.js
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
var PageError_1;
|
|
2
|
-
import { __decorate } from "tslib";
|
|
3
|
-
import { component, css, html, staticHtml, style } from '@a11d/lit';
|
|
4
|
-
import { HttpError } from '../index.js';
|
|
5
|
-
import { PageComponent } from './PageComponent.js';
|
|
6
|
-
let PageError = PageError_1 = class PageError extends PageComponent {
|
|
7
|
-
static get styles() {
|
|
8
|
-
return css `
|
|
9
|
-
.code {
|
|
10
|
-
font-size: 60px;
|
|
11
|
-
font-weight: 400;
|
|
12
|
-
text-align: center;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
h1, h2 {
|
|
16
|
-
text-align: center;
|
|
17
|
-
margin: 0;
|
|
18
|
-
}
|
|
19
|
-
`;
|
|
20
|
-
}
|
|
21
|
-
get template() {
|
|
22
|
-
var _a, _b;
|
|
23
|
-
return staticHtml `
|
|
24
|
-
<${PageComponent.defaultPageElementTag} heading=${`Error ${this.parameters.error}`} fullHeight>
|
|
25
|
-
<div ${style({ display: 'flex', gap: '8px', flexDirection: 'column', alignItems: 'center', justifyContent: 'center' })}>
|
|
26
|
-
<div class='code'>${this.errorTemplate}</div>
|
|
27
|
-
<div ${style({ display: 'flex', gap: '4px', flexDirection: 'column' })}>
|
|
28
|
-
<h1>${(_b = (_a = this.parameters.message) !== null && _a !== void 0 ? _a : HttpError.defaultMessageByErrorCode.get(this.parameters.error)) !== null && _b !== void 0 ? _b : 'Unknown Error'}</h1>
|
|
29
|
-
</div>
|
|
30
|
-
</div>
|
|
31
|
-
</${PageComponent.defaultPageElementTag}>
|
|
32
|
-
`;
|
|
33
|
-
}
|
|
34
|
-
get errorTemplate() {
|
|
35
|
-
const errorCode = String(this.parameters.error);
|
|
36
|
-
const emoji = PageError_1.emojisByErrorCodes.get(this.parameters.error);
|
|
37
|
-
return !emoji ? html `
|
|
38
|
-
<span>${errorCode}</span>
|
|
39
|
-
` : html `
|
|
40
|
-
<span>${errorCode.charAt(0)}</span>${emoji}<span>${errorCode.charAt(2)}</span>
|
|
41
|
-
`;
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
PageError.emojisByErrorCodes = new Map([
|
|
45
|
-
[400 /* HttpErrorCode.BadRequest */, '😟'],
|
|
46
|
-
[401 /* HttpErrorCode.Unauthorized */, '⛔'],
|
|
47
|
-
[402 /* HttpErrorCode.PaymentRequired */, '🤑'],
|
|
48
|
-
[404 /* HttpErrorCode.NotFound */, '🧐'],
|
|
49
|
-
[403 /* HttpErrorCode.Forbidden */, '🔒'],
|
|
50
|
-
[405 /* HttpErrorCode.MethodNotAllowed */, '🚫'],
|
|
51
|
-
[406 /* HttpErrorCode.NotAcceptable */, '😵'],
|
|
52
|
-
[407 /* HttpErrorCode.ProxyAuthenticationRequired */, '🤐'],
|
|
53
|
-
[408 /* HttpErrorCode.RequestTimeout */, '⏲'],
|
|
54
|
-
[409 /* HttpErrorCode.Conflict */, '😵'],
|
|
55
|
-
[500 /* HttpErrorCode.InternalServerError */, '😥'],
|
|
56
|
-
[501 /* HttpErrorCode.NotImplemented */, '😳'],
|
|
57
|
-
[502 /* HttpErrorCode.BadGateway */, '🥴'],
|
|
58
|
-
[503 /* HttpErrorCode.ServiceUnavailable */, '😴'],
|
|
59
|
-
[504 /* HttpErrorCode.GatewayTimeout */, '⌚'],
|
|
60
|
-
[505 /* HttpErrorCode.HttpVersionNotSupported */, '🙄'],
|
|
61
|
-
[506 /* HttpErrorCode.VariantAlsoNegotiates */, '🤪'],
|
|
62
|
-
[507 /* HttpErrorCode.InsufficientStorage */, '💾'],
|
|
63
|
-
[508 /* HttpErrorCode.LoopDetected */, '➰'],
|
|
64
|
-
]);
|
|
65
|
-
PageError = PageError_1 = __decorate([
|
|
66
|
-
component('lit-page-error')
|
|
67
|
-
], PageError);
|
|
68
|
-
export { PageError };
|
package/dist/Page/PageHost.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Component } from '@a11d/lit';
|
|
2
|
-
export declare class PageHost extends Component {
|
|
3
|
-
static readonly instance?: PageHost;
|
|
4
|
-
protected get template(): import("lit-html").TemplateResult<1>;
|
|
5
|
-
}
|
|
6
|
-
declare global {
|
|
7
|
-
interface HTMLElementTagNameMap {
|
|
8
|
-
'lit-page-host': PageHost;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=PageHost.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PageHost.d.ts","sourceRoot":"","sources":["../../Page/PageHost.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAA0B,MAAM,WAAW,CAAA;AAG7D,qBACa,QAAS,SAAQ,SAAS;IACd,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAA;IAE3D,cAAuB,QAAQ,yCAM9B;CACD;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,eAAe,EAAE,QAAQ,CAAA;KACzB;CACD"}
|
package/dist/Page/PageHost.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
import { Component, component, html, style } from '@a11d/lit';
|
|
3
|
-
import { queryInstanceElement } from '../utilities/index.js';
|
|
4
|
-
let PageHost = class PageHost extends Component {
|
|
5
|
-
get template() {
|
|
6
|
-
return html `
|
|
7
|
-
<div part='pageHolder' ${style({ display: 'grid', gridTemplateRows: '1fr', width: '100%' })}>
|
|
8
|
-
<slot></slot>
|
|
9
|
-
</div>
|
|
10
|
-
`;
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
__decorate([
|
|
14
|
-
queryInstanceElement()
|
|
15
|
-
], PageHost, "instance", void 0);
|
|
16
|
-
PageHost = __decorate([
|
|
17
|
-
component('lit-page-host')
|
|
18
|
-
], PageHost);
|
|
19
|
-
export { PageHost };
|
package/dist/Page/index.d.ts
DELETED
package/dist/Page/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../Page/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,eAAe,CAAA;AAC7B,cAAc,oBAAoB,CAAA;AAClC,cAAc,WAAW,CAAA"}
|
package/dist/Page/index.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export declare type Manifest = {
|
|
2
|
-
readonly name: string;
|
|
3
|
-
readonly short_name: string;
|
|
4
|
-
readonly description: string;
|
|
5
|
-
readonly start_url: string;
|
|
6
|
-
readonly display: string;
|
|
7
|
-
readonly display_override?: Array<string>;
|
|
8
|
-
readonly background_color: string;
|
|
9
|
-
readonly theme_color: string;
|
|
10
|
-
readonly icons: Array<ManifestIcon>;
|
|
11
|
-
};
|
|
12
|
-
export declare type ManifestIcon = {
|
|
13
|
-
readonly src: string;
|
|
14
|
-
readonly sizes: string;
|
|
15
|
-
readonly type: string;
|
|
16
|
-
};
|
|
17
|
-
//# sourceMappingURL=Manifest.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Manifest.d.ts","sourceRoot":"","sources":["../../PwaHelper/Manifest.ts"],"names":[],"mappings":"AAAA,oBAAY,QAAQ,GAAG;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,gBAAgB,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;IACzC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAA;IACjC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,YAAY,CAAC,CAAA;CACnC,CAAA;AAED,oBAAY,YAAY,GAAG;IAC1B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CACrB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ManifestProvider.d.ts","sourceRoot":"","sources":["../../PwaHelper/ManifestProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAA;AAoBxD,OAAO,CAAC,MAAM,CAAC;IAEd,MAAM,QAAQ,EAAE,QAAQ,GAAG,SAAS,CAAA;CACpC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Application } from '../index.js';
|
|
2
|
-
Application.connectedHooks.add(async () => {
|
|
3
|
-
// @ts-expect-error - This is declared as a constant property
|
|
4
|
-
globalThis.manifest = undefined;
|
|
5
|
-
const manifestLink = globalThis.document.head.querySelector('link[rel=manifest]');
|
|
6
|
-
try {
|
|
7
|
-
if (manifestLink) {
|
|
8
|
-
const content = await fetch(manifestLink.href);
|
|
9
|
-
const jsonText = await content.text();
|
|
10
|
-
// @ts-expect-error - This is declared as a constant property
|
|
11
|
-
globalThis.manifest = JSON.parse(jsonText);
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
catch (_a) {
|
|
15
|
-
// Ignore
|
|
16
|
-
}
|
|
17
|
-
});
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export interface BeforeInstallPromptEvent extends Event {
|
|
2
|
-
readonly platforms: Array<string>;
|
|
3
|
-
readonly userChoice: Promise<{
|
|
4
|
-
readonly outcome: 'accepted' | 'dismissed';
|
|
5
|
-
readonly platform: string;
|
|
6
|
-
}>;
|
|
7
|
-
prompt(): Promise<void>;
|
|
8
|
-
}
|
|
9
|
-
export declare class PwaHelper {
|
|
10
|
-
private static pwaPrompt?;
|
|
11
|
-
static get serviceWorkerContainer(): ServiceWorkerContainer | undefined;
|
|
12
|
-
static registerServiceWorker(absolutePath: string): Promise<void>;
|
|
13
|
-
static unregisterServiceWorkers(): Promise<void>;
|
|
14
|
-
private static requestInstallation;
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=PwaHelper.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PwaHelper.d.ts","sourceRoot":"","sources":["../../PwaHelper/PwaHelper.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,wBAAyB,SAAQ,KAAK;IACtD,QAAQ,CAAC,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;IACjC,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;QAC5B,QAAQ,CAAC,OAAO,EAAE,UAAU,GAAG,WAAW,CAAA;QAC1C,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;KACzB,CAAC,CAAA;IACF,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CACvB;AAED,qBAAa,SAAS;IACrB,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,CAA0B;IASnD,MAAM,KAAK,sBAAsB,uCAEhC;WAEY,qBAAqB,CAAC,YAAY,EAAE,MAAM;WAK1C,wBAAwB;mBAOhB,mBAAmB;CAaxC"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
var _a;
|
|
2
|
-
export class PwaHelper {
|
|
3
|
-
static get serviceWorkerContainer() {
|
|
4
|
-
return navigator.serviceWorker;
|
|
5
|
-
}
|
|
6
|
-
static async registerServiceWorker(absolutePath) {
|
|
7
|
-
var _b;
|
|
8
|
-
await ((_b = this.serviceWorkerContainer) === null || _b === void 0 ? void 0 : _b.register(absolutePath, { scope: '/' }));
|
|
9
|
-
await this.requestInstallation();
|
|
10
|
-
}
|
|
11
|
-
static async unregisterServiceWorkers() {
|
|
12
|
-
var _b;
|
|
13
|
-
const serviceWorkers = await ((_b = this.serviceWorkerContainer) === null || _b === void 0 ? void 0 : _b.getRegistrations()) || [];
|
|
14
|
-
for (const serviceWorker of serviceWorkers) {
|
|
15
|
-
serviceWorker.unregister();
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
static async requestInstallation() {
|
|
19
|
-
var _b, _c;
|
|
20
|
-
const isRequestPossible = this.pwaPrompt !== undefined;
|
|
21
|
-
if (isRequestPossible === false) {
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
await ((_b = this.pwaPrompt) === null || _b === void 0 ? void 0 : _b.prompt());
|
|
25
|
-
const userChoice = await ((_c = this.pwaPrompt) === null || _c === void 0 ? void 0 : _c.userChoice);
|
|
26
|
-
if ((userChoice === null || userChoice === void 0 ? void 0 : userChoice.outcome) !== 'accepted') {
|
|
27
|
-
throw new Error('PWA installation was not accepted');
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
_a = PwaHelper;
|
|
32
|
-
(() => {
|
|
33
|
-
window.addEventListener('beforeinstallprompt', e => {
|
|
34
|
-
_a.pwaPrompt = e;
|
|
35
|
-
e.preventDefault();
|
|
36
|
-
});
|
|
37
|
-
})();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../PwaHelper/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA;AAC7B,cAAc,uBAAuB,CAAA;AACrC,cAAc,gBAAgB,CAAA"}
|
package/dist/PwaHelper/index.js
DELETED
package/dist/Router/Router.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { PageComponent } from '../Page/index.js';
|
|
2
|
-
declare type Page = PageComponent<any>;
|
|
3
|
-
declare type PageConstructor = Constructor<Page>;
|
|
4
|
-
export declare const route: (...routes: Array<string>) => (pageConstructor: PageConstructor) => void;
|
|
5
|
-
export declare const enum RouteMatchMode {
|
|
6
|
-
All = "all",
|
|
7
|
-
IgnoreParameters = "ignore-parameters"
|
|
8
|
-
}
|
|
9
|
-
export declare class Router {
|
|
10
|
-
static readonly pageByRoute: Map<string, PageConstructor>;
|
|
11
|
-
static get path(): string;
|
|
12
|
-
static set path(value: string);
|
|
13
|
-
static getPathOf(page: Page): string | undefined;
|
|
14
|
-
static setPathByPage(page: Page): void;
|
|
15
|
-
static pathsMatch(page1: Page, page2: Page, mode?: RouteMatchMode): boolean;
|
|
16
|
-
}
|
|
17
|
-
export {};
|
|
18
|
-
//# sourceMappingURL=Router.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Router.d.ts","sourceRoot":"","sources":["../../Router/Router.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAErD,aAAK,IAAI,GAAG,aAAa,CAAC,GAAG,CAAC,CAAA;AAC9B,aAAK,eAAe,GAAG,WAAW,CAAC,IAAI,CAAC,CAAA;AAExC,eAAO,MAAM,KAAK,cAAe,MAAM,MAAM,CAAC,uBACpB,eAAe,SAGxC,CAAA;AAED,0BAAkB,cAAc;IAC/B,GAAG,QAAQ;IACX,gBAAgB,sBAAsB;CACtC;AAED,qBAAa,MAAM;IAClB,MAAM,CAAC,QAAQ,CAAC,WAAW,+BAAqC;IAEhE,MAAM,KAAK,IAAI,WAA+D;IAC9E,MAAM,KAAK,IAAI,CAAC,KAAK,QAAA,EAIpB;IAED,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI;IAO3B,MAAM,CAAC,aAAa,CAAC,IAAI,EAAE,IAAI;IAO/B,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,iBAAqB;CAIrE"}
|
package/dist/Router/Router.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import RouteParser from 'route-parser';
|
|
2
|
-
export const route = (...routes) => {
|
|
3
|
-
return (pageConstructor) => {
|
|
4
|
-
routes.forEach(route => Router.pageByRoute.set(route, pageConstructor));
|
|
5
|
-
};
|
|
6
|
-
};
|
|
7
|
-
export class Router {
|
|
8
|
-
static get path() { return window.location.pathname + window.location.search; }
|
|
9
|
-
static set path(value) {
|
|
10
|
-
if (Router.path !== value) {
|
|
11
|
-
window.location.pathname = value;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
static getPathOf(page) {
|
|
15
|
-
return [...Router.pageByRoute]
|
|
16
|
-
.filter(([, pageConstructor]) => pageConstructor.name === page.constructor.name)
|
|
17
|
-
.map(([route]) => new RouteParser(route).reverse(page.parameters || {}) || undefined)
|
|
18
|
-
.find((route) => route !== undefined);
|
|
19
|
-
}
|
|
20
|
-
static setPathByPage(page) {
|
|
21
|
-
const path = Router.getPathOf(page);
|
|
22
|
-
if (path) {
|
|
23
|
-
Router.path = path;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
static pathsMatch(page1, page2, mode = "all" /* RouteMatchMode.All */) {
|
|
27
|
-
return page1.tagName === page2.tagName
|
|
28
|
-
&& (Router.getPathOf(page1) === Router.getPathOf(page2) || mode === "ignore-parameters" /* RouteMatchMode.IgnoreParameters */);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
Router.pageByRoute = new Map();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RouterController.d.ts","sourceRoot":"","sources":["../../Router/RouterController.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,gBAAgB,EAAE,MAAM,kBAAkB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Router as RouterController } from '@lit-labs/router';
|
package/dist/Router/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../Router/index.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,uBAAuB,CAAA;AACrC,cAAc,iBAAiB,CAAA"}
|
package/dist/Router/index.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { PartInfo } from '@a11d/lit';
|
|
2
|
-
import { PageComponent } from '../Page/index.js';
|
|
3
|
-
declare type SelectionChangeHandler = (this: Element, selected: boolean) => void;
|
|
4
|
-
export declare const routerLink: (page: PageComponent<any>, selectionChange?: SelectionChangeHandler | undefined) => import("lit-html/directive.js").DirectiveResult<{
|
|
5
|
-
new (partInfo: PartInfo): {
|
|
6
|
-
readonly element: Element;
|
|
7
|
-
page: PageComponent<any>;
|
|
8
|
-
selectionChange?: SelectionChangeHandler | undefined;
|
|
9
|
-
render(page: PageComponent<any>, selectionChange?: SelectionChangeHandler): void;
|
|
10
|
-
executeSelectionChange(): void;
|
|
11
|
-
readonly _$isConnected: boolean;
|
|
12
|
-
update(_part: import("lit-html").Part, props: unknown[]): unknown;
|
|
13
|
-
};
|
|
14
|
-
}>;
|
|
15
|
-
export {};
|
|
16
|
-
//# sourceMappingURL=routerLink.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"routerLink.d.ts","sourceRoot":"","sources":["../../Router/routerLink.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqC,QAAQ,EAAY,MAAM,WAAW,CAAA;AAEjF,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAEhD,aAAK,sBAAsB,GAAG,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAA;AAExE,eAAO,MAAM,UAAU;mBAKA,QAAQ;0BAJZ,OAAO;cAClB,cAAc,GAAG,CAAC;;qBAqBZ,cAAc,GAAG,CAAC,oBAAoB,sBAAsB;;;;;EAoBxE,CAAA"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { directive, Directive, PartType } from '@a11d/lit';
|
|
2
|
-
import { Router } from './index.js';
|
|
3
|
-
export const routerLink = directive(class extends Directive {
|
|
4
|
-
constructor(partInfo) {
|
|
5
|
-
super(partInfo);
|
|
6
|
-
if (partInfo.type !== PartType.ELEMENT) {
|
|
7
|
-
throw new Error('routerLink can only be used on an element');
|
|
8
|
-
}
|
|
9
|
-
const part = partInfo;
|
|
10
|
-
this.element = part.element;
|
|
11
|
-
window.addEventListener('popstate', () => this.executeSelectionChange());
|
|
12
|
-
this.element.addEventListener('click', event => {
|
|
13
|
-
event.preventDefault();
|
|
14
|
-
this.page.navigate();
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
render(page, selectionChange) {
|
|
18
|
-
const firstRender = !this.page;
|
|
19
|
-
this.page = page;
|
|
20
|
-
this.selectionChange = selectionChange;
|
|
21
|
-
if (firstRender) {
|
|
22
|
-
this.executeSelectionChange();
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
executeSelectionChange() {
|
|
26
|
-
const selection = Router.getPathOf(this.page) === Router.path;
|
|
27
|
-
if (selection) {
|
|
28
|
-
this.element.setAttribute('data-router-selected', '');
|
|
29
|
-
}
|
|
30
|
-
else {
|
|
31
|
-
this.element.removeAttribute('data-router-selected');
|
|
32
|
-
}
|
|
33
|
-
if (this.selectionChange) {
|
|
34
|
-
this.selectionChange.call(this.element, selection);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
});
|
package/dist/index.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export * from './utilities/index.js';
|
|
2
|
-
export * from './Router/index.js';
|
|
3
|
-
export * from './Application.js';
|
|
4
|
-
export * from './Page/index.js';
|
|
5
|
-
export * from './Dialog/index.js';
|
|
6
|
-
export * from './Notification/index.js';
|
|
7
|
-
export * from './PwaHelper/index.js';
|
|
8
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA;AACpC,cAAc,mBAAmB,CAAA;AACjC,cAAc,kBAAkB,CAAA;AAChC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,mBAAmB,CAAA;AACjC,cAAc,yBAAyB,CAAA;AACvC,cAAc,sBAAsB,CAAA"}
|
package/dist/index.js
DELETED