@a11d/lit-application 0.0.37 → 0.0.39

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.
Files changed (77) hide show
  1. package/dist/Application.d.ts +22 -22
  2. package/dist/Application.js +68 -67
  3. package/dist/Dialog/Dialog.d.ts +21 -21
  4. package/dist/Dialog/Dialog.js +1 -1
  5. package/dist/Dialog/DialogCancelledError.d.ts +4 -4
  6. package/dist/Dialog/DialogCancelledError.js +5 -5
  7. package/dist/Dialog/DialogComponent.d.ts +44 -43
  8. package/dist/Dialog/DialogComponent.d.ts.map +1 -1
  9. package/dist/Dialog/DialogComponent.js +164 -162
  10. package/dist/Dialog/DialogHost.d.ts +10 -10
  11. package/dist/Dialog/DialogHost.js +13 -13
  12. package/dist/Dialog/PageDialog.d.ts +12 -12
  13. package/dist/Dialog/PageDialog.js +23 -23
  14. package/dist/Dialog/index.d.ts +5 -5
  15. package/dist/Dialog/index.js +5 -5
  16. package/dist/Notification/NotificationComponent.d.ts +5 -5
  17. package/dist/Notification/NotificationComponent.js +1 -1
  18. package/dist/Notification/NotificationHost.d.ts +43 -43
  19. package/dist/Notification/NotificationHost.js +78 -78
  20. package/dist/Notification/index.d.ts +2 -2
  21. package/dist/Notification/index.js +2 -2
  22. package/dist/Page/Page.d.ts +5 -5
  23. package/dist/Page/Page.js +1 -1
  24. package/dist/Page/PageComponent.d.ts +21 -21
  25. package/dist/Page/PageComponent.js +40 -39
  26. package/dist/Page/PageError.d.ts +17 -17
  27. package/dist/Page/PageError.js +45 -45
  28. package/dist/Page/PageHost.d.ts +10 -10
  29. package/dist/Page/PageHost.js +15 -15
  30. package/dist/Page/index.d.ts +4 -4
  31. package/dist/Page/index.js +4 -4
  32. package/dist/PwaHelper/Manifest.d.ts +17 -17
  33. package/dist/PwaHelper/Manifest.js +1 -1
  34. package/dist/PwaHelper/ManifestProvider.d.ts +4 -4
  35. package/dist/PwaHelper/ManifestProvider.js +17 -17
  36. package/dist/PwaHelper/PwaHelper.d.ts +15 -15
  37. package/dist/PwaHelper/PwaHelper.js +40 -40
  38. package/dist/PwaHelper/index.d.ts +3 -3
  39. package/dist/PwaHelper/index.js +3 -3
  40. package/dist/Router/Router.d.ts +16 -16
  41. package/dist/Router/Router.js +39 -38
  42. package/dist/Router/RouterController.d.ts +9 -9
  43. package/dist/Router/RouterController.js +27 -27
  44. package/dist/Router/RoutesContainer.d.ts +18 -18
  45. package/dist/Router/RoutesContainer.js +9 -9
  46. package/dist/Router/index.d.ts +5 -5
  47. package/dist/Router/index.js +5 -5
  48. package/dist/Router/route.d.ts +5 -5
  49. package/dist/Router/route.js +20 -20
  50. package/dist/Router/routerLink.d.ts +26 -26
  51. package/dist/Router/routerLink.js +109 -109
  52. package/dist/index.d.ts +7 -7
  53. package/dist/index.js +7 -7
  54. package/dist/tsconfig.tsbuildinfo +1 -1
  55. package/dist/utilities/HookSet.d.ts +4 -4
  56. package/dist/utilities/HookSet.js +5 -5
  57. package/dist/utilities/HttpError.d.ts +6 -6
  58. package/dist/utilities/HttpError.js +47 -46
  59. package/dist/utilities/HttpErrorCode.d.ts +40 -40
  60. package/dist/utilities/HttpErrorCode.js +1 -1
  61. package/dist/utilities/RootCssInjectorController.d.ts +11 -11
  62. package/dist/utilities/RootCssInjectorController.js +20 -20
  63. package/dist/utilities/WindowHelper.d.ts +9 -9
  64. package/dist/utilities/WindowHelper.js +22 -21
  65. package/dist/utilities/index.d.ts +9 -10
  66. package/dist/utilities/index.d.ts.map +1 -1
  67. package/dist/utilities/index.js +9 -10
  68. package/dist/utilities/nonInertable.d.ts +2 -2
  69. package/dist/utilities/nonInertable.js +11 -11
  70. package/dist/utilities/queryInstanceElement.d.ts +2 -2
  71. package/dist/utilities/queryInstanceElement.js +9 -9
  72. package/dist/utilities/querySymbolizedElement.d.ts +2 -2
  73. package/dist/utilities/querySymbolizedElement.js +14 -14
  74. package/package.json +6 -5
  75. package/dist/utilities/LocalStorageEntry.d.ts +0 -13
  76. package/dist/utilities/LocalStorageEntry.d.ts.map +0 -1
  77. package/dist/utilities/LocalStorageEntry.js +0 -29
@@ -1,5 +1,5 @@
1
- import { Component } from '@a11d/lit';
2
- export declare class HookSet<TComponent extends Component | void = void> extends Set<(component: TComponent) => void | PromiseLike<void>> {
3
- execute(component: TComponent): Promise<void>;
4
- }
1
+ import { Component } from '@a11d/lit';
2
+ export declare class HookSet<TComponent extends Component | void = void> extends Set<(component: TComponent) => void | PromiseLike<void>> {
3
+ execute(component: TComponent): Promise<void>;
4
+ }
5
5
  //# sourceMappingURL=HookSet.d.ts.map
@@ -1,5 +1,5 @@
1
- export class HookSet extends Set {
2
- async execute(component) {
3
- await Promise.allSettled([...this].map(hook => hook(component)));
4
- }
5
- }
1
+ export class HookSet extends Set {
2
+ async execute(component) {
3
+ await Promise.allSettled([...this].map(hook => hook(component)));
4
+ }
5
+ }
@@ -1,7 +1,7 @@
1
- import { HttpErrorCode } from './HttpErrorCode.js';
2
- export declare class HttpError extends Error {
3
- readonly statusCode: HttpErrorCode;
4
- static readonly defaultMessageByErrorCode: Map<HttpErrorCode, string>;
5
- constructor(statusCode: HttpErrorCode, message?: string | undefined);
6
- }
1
+ import { HttpErrorCode } from './HttpErrorCode.js';
2
+ export declare class HttpError extends Error {
3
+ readonly statusCode: HttpErrorCode;
4
+ static readonly defaultMessageByErrorCode: Map<HttpErrorCode, string>;
5
+ constructor(statusCode: HttpErrorCode, message?: string | undefined);
6
+ }
7
7
  //# sourceMappingURL=HttpError.d.ts.map
@@ -1,46 +1,47 @@
1
- export class HttpError extends Error {
2
- constructor(statusCode, message = HttpError.defaultMessageByErrorCode.get(statusCode)) {
3
- super(message);
4
- this.statusCode = statusCode;
5
- }
6
- }
7
- HttpError.defaultMessageByErrorCode = new Map([
8
- [400 /* HttpErrorCode.BadRequest */, 'Bad Request'],
9
- [401 /* HttpErrorCode.Unauthorized */, 'Unauthorized'],
10
- [402 /* HttpErrorCode.PaymentRequired */, 'Payment Required'],
11
- [404 /* HttpErrorCode.NotFound */, 'Page Not Found'],
12
- [403 /* HttpErrorCode.Forbidden */, 'Access Denied'],
13
- [405 /* HttpErrorCode.MethodNotAllowed */, 'Method Not Allowed'],
14
- [406 /* HttpErrorCode.NotAcceptable */, 'Not Accepted'],
15
- [407 /* HttpErrorCode.ProxyAuthenticationRequired */, 'Proxy Authentication Required'],
16
- [408 /* HttpErrorCode.RequestTimeout */, 'Request Timeout'],
17
- [409 /* HttpErrorCode.Conflict */, 'Conflict'],
18
- [410 /* HttpErrorCode.Gone */, 'Gone'],
19
- [411 /* HttpErrorCode.LengthRequired */, 'Length Required'],
20
- [412 /* HttpErrorCode.PreconditionFailed */, 'Precondition Failed'],
21
- [413 /* HttpErrorCode.RequestEntityTooLarge */, 'Request Entity Too Large'],
22
- [414 /* HttpErrorCode.RequestUriTooLong */, 'Request Uri Too Long'],
23
- [415 /* HttpErrorCode.UnsupportedMediaType */, 'Unsupported Media Type'],
24
- [416 /* HttpErrorCode.RequestedRangeNotSatisfiable */, 'Requested Range Not Satisfiable'],
25
- [417 /* HttpErrorCode.ExpectationFailed */, 'Expectation Failed'],
26
- [421 /* HttpErrorCode.MisdirectedRequest */, 'Misdirected Request'],
27
- [422 /* HttpErrorCode.UnprocessableEntity */, 'Unprocessable Entity'],
28
- [423 /* HttpErrorCode.Locked */, 'Locked'],
29
- [424 /* HttpErrorCode.FailedDependency */, 'Failed Dependency'],
30
- [426 /* HttpErrorCode.UpgradeRequired */, 'Upgrade Required'],
31
- [428 /* HttpErrorCode.PreconditionRequired */, 'Precondition Required'],
32
- [429 /* HttpErrorCode.TooManyRequests */, 'Too Many Requests'],
33
- [431 /* HttpErrorCode.RequestHeaderFieldsTooLarge */, 'Request Header Fields TooLarge'],
34
- [451 /* HttpErrorCode.UnavailableForLegalReasons */, 'Unavailable For Legal Reasons'],
35
- [500 /* HttpErrorCode.InternalServerError */, 'Internal Server Error'],
36
- [501 /* HttpErrorCode.NotImplemented */, 'Not Implemented'],
37
- [502 /* HttpErrorCode.BadGateway */, 'Bad Gateway'],
38
- [503 /* HttpErrorCode.ServiceUnavailable */, 'Service Unavailable'],
39
- [504 /* HttpErrorCode.GatewayTimeout */, 'Gateway Timeout'],
40
- [505 /* HttpErrorCode.HttpVersionNotSupported */, 'Http Version Not Supported'],
41
- [506 /* HttpErrorCode.VariantAlsoNegotiates */, 'Variant Also Negotiates'],
42
- [507 /* HttpErrorCode.InsufficientStorage */, 'Insufficient Storage'],
43
- [508 /* HttpErrorCode.LoopDetected */, 'Loop Detected'],
44
- [510 /* HttpErrorCode.NotExtended */, 'Not Extended'],
45
- [511 /* HttpErrorCode.NetworkAuthenticationRequired */, 'Network Authentication Required'],
46
- ]);
1
+ class HttpError extends Error {
2
+ constructor(statusCode, message = HttpError.defaultMessageByErrorCode.get(statusCode)) {
3
+ super(message);
4
+ this.statusCode = statusCode;
5
+ }
6
+ }
7
+ HttpError.defaultMessageByErrorCode = new Map([
8
+ [400 /* HttpErrorCode.BadRequest */, 'Bad Request'],
9
+ [401 /* HttpErrorCode.Unauthorized */, 'Unauthorized'],
10
+ [402 /* HttpErrorCode.PaymentRequired */, 'Payment Required'],
11
+ [404 /* HttpErrorCode.NotFound */, 'Page Not Found'],
12
+ [403 /* HttpErrorCode.Forbidden */, 'Access Denied'],
13
+ [405 /* HttpErrorCode.MethodNotAllowed */, 'Method Not Allowed'],
14
+ [406 /* HttpErrorCode.NotAcceptable */, 'Not Accepted'],
15
+ [407 /* HttpErrorCode.ProxyAuthenticationRequired */, 'Proxy Authentication Required'],
16
+ [408 /* HttpErrorCode.RequestTimeout */, 'Request Timeout'],
17
+ [409 /* HttpErrorCode.Conflict */, 'Conflict'],
18
+ [410 /* HttpErrorCode.Gone */, 'Gone'],
19
+ [411 /* HttpErrorCode.LengthRequired */, 'Length Required'],
20
+ [412 /* HttpErrorCode.PreconditionFailed */, 'Precondition Failed'],
21
+ [413 /* HttpErrorCode.RequestEntityTooLarge */, 'Request Entity Too Large'],
22
+ [414 /* HttpErrorCode.RequestUriTooLong */, 'Request Uri Too Long'],
23
+ [415 /* HttpErrorCode.UnsupportedMediaType */, 'Unsupported Media Type'],
24
+ [416 /* HttpErrorCode.RequestedRangeNotSatisfiable */, 'Requested Range Not Satisfiable'],
25
+ [417 /* HttpErrorCode.ExpectationFailed */, 'Expectation Failed'],
26
+ [421 /* HttpErrorCode.MisdirectedRequest */, 'Misdirected Request'],
27
+ [422 /* HttpErrorCode.UnprocessableEntity */, 'Unprocessable Entity'],
28
+ [423 /* HttpErrorCode.Locked */, 'Locked'],
29
+ [424 /* HttpErrorCode.FailedDependency */, 'Failed Dependency'],
30
+ [426 /* HttpErrorCode.UpgradeRequired */, 'Upgrade Required'],
31
+ [428 /* HttpErrorCode.PreconditionRequired */, 'Precondition Required'],
32
+ [429 /* HttpErrorCode.TooManyRequests */, 'Too Many Requests'],
33
+ [431 /* HttpErrorCode.RequestHeaderFieldsTooLarge */, 'Request Header Fields TooLarge'],
34
+ [451 /* HttpErrorCode.UnavailableForLegalReasons */, 'Unavailable For Legal Reasons'],
35
+ [500 /* HttpErrorCode.InternalServerError */, 'Internal Server Error'],
36
+ [501 /* HttpErrorCode.NotImplemented */, 'Not Implemented'],
37
+ [502 /* HttpErrorCode.BadGateway */, 'Bad Gateway'],
38
+ [503 /* HttpErrorCode.ServiceUnavailable */, 'Service Unavailable'],
39
+ [504 /* HttpErrorCode.GatewayTimeout */, 'Gateway Timeout'],
40
+ [505 /* HttpErrorCode.HttpVersionNotSupported */, 'Http Version Not Supported'],
41
+ [506 /* HttpErrorCode.VariantAlsoNegotiates */, 'Variant Also Negotiates'],
42
+ [507 /* HttpErrorCode.InsufficientStorage */, 'Insufficient Storage'],
43
+ [508 /* HttpErrorCode.LoopDetected */, 'Loop Detected'],
44
+ [510 /* HttpErrorCode.NotExtended */, 'Not Extended'],
45
+ [511 /* HttpErrorCode.NetworkAuthenticationRequired */, 'Network Authentication Required'],
46
+ ]);
47
+ export { HttpError };
@@ -1,41 +1,41 @@
1
- export declare const enum HttpErrorCode {
2
- BadRequest = 400,
3
- Unauthorized = 401,
4
- PaymentRequired = 402,
5
- Forbidden = 403,
6
- NotFound = 404,
7
- MethodNotAllowed = 405,
8
- NotAcceptable = 406,
9
- ProxyAuthenticationRequired = 407,
10
- RequestTimeout = 408,
11
- Conflict = 409,
12
- Gone = 410,
13
- LengthRequired = 411,
14
- PreconditionFailed = 412,
15
- RequestEntityTooLarge = 413,
16
- RequestUriTooLong = 414,
17
- UnsupportedMediaType = 415,
18
- RequestedRangeNotSatisfiable = 416,
19
- ExpectationFailed = 417,
20
- MisdirectedRequest = 421,
21
- UnprocessableEntity = 422,
22
- Locked = 423,
23
- FailedDependency = 424,
24
- UpgradeRequired = 426,
25
- PreconditionRequired = 428,
26
- TooManyRequests = 429,
27
- RequestHeaderFieldsTooLarge = 431,
28
- UnavailableForLegalReasons = 451,
29
- InternalServerError = 500,
30
- NotImplemented = 501,
31
- BadGateway = 502,
32
- ServiceUnavailable = 503,
33
- GatewayTimeout = 504,
34
- HttpVersionNotSupported = 505,
35
- VariantAlsoNegotiates = 506,
36
- InsufficientStorage = 507,
37
- LoopDetected = 508,
38
- NotExtended = 510,
39
- NetworkAuthenticationRequired = 511
40
- }
1
+ export declare const enum HttpErrorCode {
2
+ BadRequest = 400,
3
+ Unauthorized = 401,
4
+ PaymentRequired = 402,
5
+ Forbidden = 403,
6
+ NotFound = 404,
7
+ MethodNotAllowed = 405,
8
+ NotAcceptable = 406,
9
+ ProxyAuthenticationRequired = 407,
10
+ RequestTimeout = 408,
11
+ Conflict = 409,
12
+ Gone = 410,
13
+ LengthRequired = 411,
14
+ PreconditionFailed = 412,
15
+ RequestEntityTooLarge = 413,
16
+ RequestUriTooLong = 414,
17
+ UnsupportedMediaType = 415,
18
+ RequestedRangeNotSatisfiable = 416,
19
+ ExpectationFailed = 417,
20
+ MisdirectedRequest = 421,
21
+ UnprocessableEntity = 422,
22
+ Locked = 423,
23
+ FailedDependency = 424,
24
+ UpgradeRequired = 426,
25
+ PreconditionRequired = 428,
26
+ TooManyRequests = 429,
27
+ RequestHeaderFieldsTooLarge = 431,
28
+ UnavailableForLegalReasons = 451,
29
+ InternalServerError = 500,
30
+ NotImplemented = 501,
31
+ BadGateway = 502,
32
+ ServiceUnavailable = 503,
33
+ GatewayTimeout = 504,
34
+ HttpVersionNotSupported = 505,
35
+ VariantAlsoNegotiates = 506,
36
+ InsufficientStorage = 507,
37
+ LoopDetected = 508,
38
+ NotExtended = 510,
39
+ NetworkAuthenticationRequired = 511
40
+ }
41
41
  //# sourceMappingURL=HttpErrorCode.d.ts.map
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -1,12 +1,12 @@
1
- import { CSSResult, ReactiveController, ReactiveControllerHost } from '@a11d/lit';
2
- export declare class RootCssInjectorController implements ReactiveController {
3
- protected readonly rootStyle: CSSResult;
4
- private readonly styleElement;
5
- constructor(root: ReactiveControllerHost, rootStyle: CSSResult);
6
- hostConnected(): void;
7
- hostDisconnected(): void;
8
- }
9
- export declare class RootCssInjector {
10
- static inject(styles: CSSResult, styleElement?: HTMLStyleElement): HTMLStyleElement;
11
- }
1
+ import { CSSResult, ReactiveController, ReactiveControllerHost } from '@a11d/lit';
2
+ export declare class RootCssInjectorController implements ReactiveController {
3
+ protected readonly rootStyle: CSSResult;
4
+ private readonly styleElement;
5
+ constructor(root: ReactiveControllerHost, rootStyle: CSSResult);
6
+ hostConnected(): void;
7
+ hostDisconnected(): void;
8
+ }
9
+ export declare class RootCssInjector {
10
+ static inject(styles: CSSResult, styleElement?: HTMLStyleElement): HTMLStyleElement;
11
+ }
12
12
  //# sourceMappingURL=RootCssInjectorController.d.ts.map
@@ -1,20 +1,20 @@
1
- export class RootCssInjectorController {
2
- constructor(root, rootStyle) {
3
- this.rootStyle = rootStyle;
4
- this.styleElement = document.createElement('style');
5
- root.addController(this);
6
- }
7
- hostConnected() {
8
- RootCssInjector.inject(this.rootStyle, this.styleElement);
9
- }
10
- hostDisconnected() {
11
- this.styleElement?.remove();
12
- }
13
- }
14
- export class RootCssInjector {
15
- static inject(styles, styleElement = document.createElement('style')) {
16
- styleElement.innerHTML = styles.cssText;
17
- document.head.appendChild(styleElement);
18
- return styleElement;
19
- }
20
- }
1
+ export class RootCssInjectorController {
2
+ constructor(root, rootStyle) {
3
+ this.rootStyle = rootStyle;
4
+ this.styleElement = document.createElement('style');
5
+ root.addController(this);
6
+ }
7
+ hostConnected() {
8
+ RootCssInjector.inject(this.rootStyle, this.styleElement);
9
+ }
10
+ hostDisconnected() {
11
+ this.styleElement?.remove();
12
+ }
13
+ }
14
+ export class RootCssInjector {
15
+ static inject(styles, styleElement = document.createElement('style')) {
16
+ styleElement.innerHTML = styles.cssText;
17
+ document.head.appendChild(styleElement);
18
+ return styleElement;
19
+ }
20
+ }
@@ -1,10 +1,10 @@
1
- export declare const enum WindowOpenMode {
2
- Tab = 0,
3
- Window = 1
4
- }
5
- export declare class WindowHelper {
6
- private static readonly windowSizeReductionMultiplier;
7
- static open(path?: string, mode?: WindowOpenMode): Promise<Window>;
8
- static openAndFocus(...args: Parameters<typeof WindowHelper.open>): Promise<void>;
9
- }
1
+ export declare const enum WindowOpenMode {
2
+ Tab = 0,
3
+ Window = 1
4
+ }
5
+ export declare class WindowHelper {
6
+ private static readonly windowSizeReductionMultiplier;
7
+ static open(path?: string, mode?: WindowOpenMode): Promise<Window>;
8
+ static openAndFocus(...args: Parameters<typeof WindowHelper.open>): Promise<void>;
9
+ }
10
10
  //# sourceMappingURL=WindowHelper.d.ts.map
@@ -1,21 +1,22 @@
1
- export class WindowHelper {
2
- static open(path = window.location.pathname, mode = 0 /* WindowOpenMode.Tab */) {
3
- return new Promise((resolve, reject) => {
4
- if (window.matchMedia('(display-mode: standalone)').matches && mode === 0 /* WindowOpenMode.Tab */ && !manifest?.display_override?.includes('tabbed')) {
5
- mode = 1 /* WindowOpenMode.Window */;
6
- }
7
- const newWindow = window.open(path, undefined, mode === 0 /* WindowOpenMode.Tab */ ? '' : 'popup');
8
- if (!newWindow) {
9
- return reject(new Error('Failed to open a window, probably because the permission is denied.'));
10
- }
11
- newWindow.resizeTo(window.outerWidth * WindowHelper.windowSizeReductionMultiplier, window.outerHeight * WindowHelper.windowSizeReductionMultiplier);
12
- newWindow.moveTo(window.screenX + (window.outerWidth - newWindow.outerWidth) / 2, window.screenY + (window.outerHeight - newWindow.outerHeight) / 2);
13
- newWindow.addEventListener('Application.initialized', () => resolve(newWindow), { once: true });
14
- });
15
- }
16
- static async openAndFocus(...args) {
17
- const window = await WindowHelper.open(...args);
18
- window.focus();
19
- }
20
- }
21
- WindowHelper.windowSizeReductionMultiplier = 0.9;
1
+ class WindowHelper {
2
+ static open(path = window.location.pathname, mode = 0 /* WindowOpenMode.Tab */) {
3
+ return new Promise((resolve, reject) => {
4
+ if (window.matchMedia('(display-mode: standalone)').matches && mode === 0 /* WindowOpenMode.Tab */ && !manifest?.display_override?.includes('tabbed')) {
5
+ mode = 1 /* WindowOpenMode.Window */;
6
+ }
7
+ const newWindow = window.open(path, undefined, mode === 0 /* WindowOpenMode.Tab */ ? '' : 'popup');
8
+ if (!newWindow) {
9
+ return reject(new Error('Failed to open a window, probably because the permission is denied.'));
10
+ }
11
+ newWindow.resizeTo(window.outerWidth * WindowHelper.windowSizeReductionMultiplier, window.outerHeight * WindowHelper.windowSizeReductionMultiplier);
12
+ newWindow.moveTo(window.screenX + (window.outerWidth - newWindow.outerWidth) / 2, window.screenY + (window.outerHeight - newWindow.outerHeight) / 2);
13
+ newWindow.addEventListener('Application.initialized', () => resolve(newWindow), { once: true });
14
+ });
15
+ }
16
+ static async openAndFocus(...args) {
17
+ const window = await WindowHelper.open(...args);
18
+ window.focus();
19
+ }
20
+ }
21
+ WindowHelper.windowSizeReductionMultiplier = 0.9;
22
+ export { WindowHelper };
@@ -1,11 +1,10 @@
1
- export * from './RootCssInjectorController.js';
2
- export * from './HookSet.js';
3
- export * from './WindowHelper.js';
4
- export * from './LocalStorageEntry.js';
5
- export * from './HttpError.js';
6
- export * from './HttpErrorCode.js';
7
- export * from './querySymbolizedElement.js';
8
- export * from './queryInstanceElement.js';
9
- export * from './nonInertable.js';
10
- export * from 'ts-key-enum';
1
+ export * from './RootCssInjectorController.js';
2
+ export * from './HookSet.js';
3
+ export * from './WindowHelper.js';
4
+ export * from './HttpError.js';
5
+ export * from './HttpErrorCode.js';
6
+ export * from './querySymbolizedElement.js';
7
+ export * from './queryInstanceElement.js';
8
+ export * from './nonInertable.js';
9
+ export * from 'ts-key-enum';
11
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../utilities/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAA;AAC9C,cAAc,cAAc,CAAA;AAC5B,cAAc,mBAAmB,CAAA;AACjC,cAAc,wBAAwB,CAAA;AACtC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,oBAAoB,CAAA;AAClC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,2BAA2B,CAAA;AACzC,cAAc,mBAAmB,CAAA;AACjC,cAAc,aAAa,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../utilities/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAA;AAC9C,cAAc,cAAc,CAAA;AAC5B,cAAc,mBAAmB,CAAA;AACjC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,oBAAoB,CAAA;AAClC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,2BAA2B,CAAA;AACzC,cAAc,mBAAmB,CAAA;AACjC,cAAc,aAAa,CAAA"}
@@ -1,10 +1,9 @@
1
- export * from './RootCssInjectorController.js';
2
- export * from './HookSet.js';
3
- export * from './WindowHelper.js';
4
- export * from './LocalStorageEntry.js';
5
- export * from './HttpError.js';
6
- export * from './HttpErrorCode.js';
7
- export * from './querySymbolizedElement.js';
8
- export * from './queryInstanceElement.js';
9
- export * from './nonInertable.js';
10
- export * from 'ts-key-enum';
1
+ export * from './RootCssInjectorController.js';
2
+ export * from './HookSet.js';
3
+ export * from './WindowHelper.js';
4
+ export * from './HttpError.js';
5
+ export * from './HttpErrorCode.js';
6
+ export * from './querySymbolizedElement.js';
7
+ export * from './queryInstanceElement.js';
8
+ export * from './nonInertable.js';
9
+ export * from 'ts-key-enum';
@@ -1,3 +1,3 @@
1
- export declare const nonInertable: () => (constructor: Constructor<HTMLElement>) => void;
2
- export declare const deactivateInert: (constructor: Constructor<HTMLElement>) => void;
1
+ export declare const nonInertable: () => (constructor: Constructor<HTMLElement>) => void;
2
+ export declare const deactivateInert: (constructor: Constructor<HTMLElement>) => void;
3
3
  //# sourceMappingURL=nonInertable.d.ts.map
@@ -1,11 +1,11 @@
1
- export const nonInertable = () => (constructor) => {
2
- deactivateInert(constructor);
3
- };
4
- export const deactivateInert = (constructor) => {
5
- Object.defineProperty(constructor.prototype, 'inert', {
6
- enumerable: true,
7
- configurable: false,
8
- get: () => false,
9
- set: value => value
10
- });
11
- };
1
+ export const nonInertable = () => (constructor) => {
2
+ deactivateInert(constructor);
3
+ };
4
+ export const deactivateInert = (constructor) => {
5
+ Object.defineProperty(constructor.prototype, 'inert', {
6
+ enumerable: true,
7
+ configurable: false,
8
+ get: () => false,
9
+ set: value => value
10
+ });
11
+ };
@@ -1,3 +1,3 @@
1
- import { LitElement } from '@a11d/lit';
2
- export declare function queryInstanceElement(): (prototype: AbstractConstructor<LitElement>, propertyKey: string) => void;
1
+ import { LitElement } from '@a11d/lit';
2
+ export declare function queryInstanceElement(): (prototype: AbstractConstructor<LitElement>, propertyKey: string) => void;
3
3
  //# sourceMappingURL=queryInstanceElement.d.ts.map
@@ -1,9 +1,9 @@
1
- export function queryInstanceElement() {
2
- return (prototype, propertyKey) => {
3
- Object.defineProperty(prototype, propertyKey, {
4
- get() {
5
- return [...window.document.querySelectorAll('*')].find(element => element instanceof this);
6
- }
7
- });
8
- };
9
- }
1
+ export function queryInstanceElement() {
2
+ return (prototype, propertyKey) => {
3
+ Object.defineProperty(prototype, propertyKey, {
4
+ get() {
5
+ return [...window.document.querySelectorAll('*')].find(element => element instanceof this);
6
+ }
7
+ });
8
+ };
9
+ }
@@ -1,3 +1,3 @@
1
- import { LitElement } from '@a11d/lit';
2
- export declare function querySymbolizedElement(symbol: symbol): (prototype: LitElement, propertyKey: string) => void;
1
+ import { LitElement } from '@a11d/lit';
2
+ export declare function querySymbolizedElement(symbol: symbol): (prototype: LitElement, propertyKey: string) => void;
3
3
  //# sourceMappingURL=querySymbolizedElement.d.ts.map
@@ -1,14 +1,14 @@
1
- export function querySymbolizedElement(symbol) {
2
- return (prototype, propertyKey) => {
3
- Object.defineProperty(prototype, propertyKey, {
4
- get() {
5
- const element = [...this.renderRoot?.querySelectorAll('*') ?? []]
6
- .find(element => symbol in element.constructor && element.constructor[symbol] === true);
7
- if (!element) {
8
- throw new Error(`${this.constructor.name}'s ${propertyKey} cannot be found.`);
9
- }
10
- return element;
11
- }
12
- });
13
- };
14
- }
1
+ export function querySymbolizedElement(symbol) {
2
+ return (prototype, propertyKey) => {
3
+ Object.defineProperty(prototype, propertyKey, {
4
+ get() {
5
+ const element = [...this.renderRoot?.querySelectorAll('*') ?? []]
6
+ .find(element => symbol in element.constructor && element.constructor[symbol] === true);
7
+ if (!element) {
8
+ throw new Error(`${this.constructor.name}'s ${propertyKey} cannot be found.`);
9
+ }
10
+ return element;
11
+ }
12
+ });
13
+ };
14
+ }
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@a11d/lit-application",
3
- "version": "0.0.37",
3
+ "version": "0.0.39",
4
4
  "description": "Lit-based application shell.",
5
5
  "repository": {
6
6
  "type": "git",
7
- "url": "git+https://github.com/arshia11d/lit-application.git"
7
+ "url": "git+https://github.com/a11delavar/lit-application.git"
8
8
  },
9
9
  "keywords": [
10
10
  "web-component",
@@ -12,12 +12,12 @@
12
12
  "application",
13
13
  "shell"
14
14
  ],
15
- "author": "arshia11d",
15
+ "author": "a11delavar",
16
16
  "license": "MIT",
17
17
  "bugs": {
18
- "url": "https://github.com/arshia11d/lit-application/issues"
18
+ "url": "https://github.com/a11delavar/lit-application/issues"
19
19
  },
20
- "homepage": "https://github.com/arshia11d/lit-application#readme",
20
+ "homepage": "https://github.com/a11delavar/lit-application#readme",
21
21
  "type": "module",
22
22
  "main": "dist/index.js",
23
23
  "types": "dist/index.d.ts",
@@ -30,6 +30,7 @@
30
30
  },
31
31
  "dependencies": {
32
32
  "@a11d/lit": "x",
33
+ "@a11d/local-storage": "x",
33
34
  "@lit-labs/router": "0.x",
34
35
  "path-to-regexp": "6.x",
35
36
  "ts-key-enum": "x",
@@ -1,13 +0,0 @@
1
- import { PureEventDispatcher } from '@a11d/lit';
2
- export declare class LocalStorageEntry<T> {
3
- protected readonly name: string;
4
- protected readonly defaultValue: T;
5
- protected readonly reviver?: ((key: string, value: any) => any) | undefined;
6
- static readonly changed: PureEventDispatcher<unknown>;
7
- static readonly container: Set<LocalStorageEntry<any>>;
8
- readonly changed: PureEventDispatcher<T>;
9
- constructor(name: string, defaultValue: T, reviver?: ((key: string, value: any) => any) | undefined);
10
- get value(): T;
11
- set value(obj: T);
12
- }
13
- //# sourceMappingURL=LocalStorageEntry.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LocalStorageEntry.d.ts","sourceRoot":"","sources":["../../utilities/LocalStorageEntry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAA;AAE/C,qBAAa,iBAAiB,CAAC,CAAC;IAO9B,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM;IAC/B,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,CAAC;IAClC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,SAAQ,MAAM,SAAS,GAAG,KAAK,GAAG;IAR9D,MAAM,CAAC,QAAQ,CAAC,OAAO,+BAAqC;IAC5D,MAAM,CAAC,QAAQ,CAAC,SAAS,8BAAoC;IAE7D,QAAQ,CAAC,OAAO,yBAA+B;gBAG3B,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE,CAAC,EACf,OAAO,CAAC,SAAQ,MAAM,SAAS,GAAG,KAAK,GAAG,aAAA;IAG9D,IAAI,KAAK,IAAI,CAAC,CAYb;IAED,IAAI,KAAK,CAAC,GAAG,EAAE,CAAC,EAIf;CACD"}
@@ -1,29 +0,0 @@
1
- import { PureEventDispatcher } from '@a11d/lit';
2
- export class LocalStorageEntry {
3
- constructor(name, defaultValue, reviver) {
4
- this.name = name;
5
- this.defaultValue = defaultValue;
6
- this.reviver = reviver;
7
- this.changed = new PureEventDispatcher();
8
- LocalStorageEntry.container.add(this);
9
- }
10
- get value() {
11
- const value = window.localStorage.getItem(this.name) ?? undefined;
12
- if (value === undefined) {
13
- return this.defaultValue;
14
- }
15
- try {
16
- return JSON.parse(value, this.reviver);
17
- }
18
- catch (e) {
19
- return value;
20
- }
21
- }
22
- set value(obj) {
23
- window.localStorage.setItem(this.name, JSON.stringify(obj));
24
- this.changed.dispatch(obj);
25
- LocalStorageEntry.changed.dispatch(this);
26
- }
27
- }
28
- LocalStorageEntry.changed = new PureEventDispatcher();
29
- LocalStorageEntry.container = new Set();