@neovici/cosmoz-utils 6.17.0 → 6.17.2

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/dist/array.d.ts CHANGED
@@ -3,6 +3,6 @@ export declare function array(arr: null): [];
3
3
  export declare function array<T>(arr?: T | T[]): T[];
4
4
  export declare function array<T>(arr: Iterable<T>): T[];
5
5
  export declare function array<T = unknown>(arr: T): T[];
6
- export declare const without: <E, L = E>(exclude: E | E[], predicate?: <T extends E | L>(value: T) => unknown) => <T_1 extends L = L>(list: T_1 | T_1[]) => T_1[];
6
+ export declare const without: <E, L = E>(exclude: E | E[], predicate?: <T extends E | L>(value: T) => unknown) => <T extends L = L>(list: T | T[]) => T[];
7
7
  export declare const chunk: <T>(list: T[], size: number) => T[][];
8
8
  export declare const intersect: <T>(list: T[][]) => T[];
@@ -3,11 +3,10 @@
3
3
  * Copyright 2017 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
5
5
  */
6
- /* eslint-disable import/group-exports */
7
6
  import { noChange } from 'lit-html';
8
- import { directive } from 'lit-html/directive.js';
9
- import { isPrimitive } from 'lit-html/directive-helpers.js';
10
7
  import { AsyncDirective } from 'lit-html/async-directive.js';
8
+ import { isPrimitive } from 'lit-html/directive-helpers.js';
9
+ import { directive } from 'lit-html/directive.js';
11
10
  class PseudoWeakRef {
12
11
  _ref;
13
12
  constructor(ref) {
@@ -1,4 +1,4 @@
1
- import { BaseScheduler, GenericRenderer, ComponentOrVirtualComponent } from '@pionjs/pion';
1
+ import { BaseScheduler, ComponentOrVirtualComponent, GenericRenderer } from '@pionjs/pion';
2
2
  import { ChildPart } from 'lit-html';
3
3
  import { Rec } from './object';
4
4
  export type Constructor<T> = new (...args: any[]) => T;
@@ -27,18 +27,19 @@ interface PElement extends HTMLElement {
27
27
  */
28
28
  export declare const hauntedPolymer: (outputPath: string | Hook, hook?: Hook) => (base: Constructor<PElement>) => {
29
29
  new (): {
30
- _scheduler: Scheduler<object, HTMLElement | ChildPart, () => void, any, (result: unknown) => void>;
30
+ _scheduler: Scheduler<object, HTMLElement | ChildPart, () => void, /*elided*/ any, (result: unknown) => void>;
31
31
  connectedCallback(): void;
32
32
  disconnectedCallback(): void;
33
33
  _propertiesChanged<P extends Obj, C extends Obj, O>(currentProps: P, changedProps: C, oldProps: O): void;
34
- _onlyHauntedPropertiesChanged<C_1 extends Obj>(changedProps: C_1): boolean;
34
+ _onlyHauntedPropertiesChanged<C extends Obj>(changedProps: C): boolean;
35
35
  renderLitTo(part: ChildPart | (() => ChildPart), outlet: HTMLElement): void;
36
36
  set<T>(path: string, value: T): void;
37
- setProperties<T_1>(props: T_1): void;
37
+ setProperties<T>(props: T): void;
38
38
  _hauntedUpdateFrameHandle: ReturnType<typeof requestAnimationFrame>;
39
39
  accessKey: string;
40
40
  readonly accessKeyLabel: string;
41
41
  autocapitalize: string;
42
+ autocorrect: boolean;
42
43
  dir: string;
43
44
  draggable: boolean;
44
45
  hidden: boolean;
@@ -55,30 +56,35 @@ export declare const hauntedPolymer: (outputPath: string | Hook, hook?: Hook) =>
55
56
  spellcheck: boolean;
56
57
  title: string;
57
58
  translate: boolean;
59
+ writingSuggestions: string;
58
60
  attachInternals(): ElementInternals;
59
61
  click(): void;
60
62
  hidePopover(): void;
61
63
  showPopover(): void;
62
- togglePopover(force?: boolean | undefined): void;
63
- addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions | undefined): void;
64
- addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions | undefined): void;
65
- removeEventListener<K_1 extends keyof HTMLElementEventMap>(type: K_1, listener: (this: HTMLElement, ev: HTMLElementEventMap[K_1]) => any, options?: boolean | EventListenerOptions | undefined): void;
66
- removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions | undefined): void;
64
+ togglePopover(options?: boolean): boolean;
65
+ addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
66
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
67
+ removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
68
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
67
69
  readonly attributes: NamedNodeMap;
68
- readonly classList: DOMTokenList;
70
+ get classList(): DOMTokenList;
71
+ set classList(value: string);
69
72
  className: string;
70
73
  readonly clientHeight: number;
71
74
  readonly clientLeft: number;
72
75
  readonly clientTop: number;
73
76
  readonly clientWidth: number;
77
+ readonly currentCSSZoom: number;
74
78
  id: string;
79
+ innerHTML: string;
75
80
  readonly localName: string;
76
81
  readonly namespaceURI: string | null;
77
82
  onfullscreenchange: ((this: Element, ev: Event) => any) | null;
78
83
  onfullscreenerror: ((this: Element, ev: Event) => any) | null;
79
84
  outerHTML: string;
80
85
  readonly ownerDocument: Document;
81
- readonly part: DOMTokenList;
86
+ get part(): DOMTokenList;
87
+ set part(value: string);
82
88
  readonly prefix: string | null;
83
89
  readonly scrollHeight: number;
84
90
  scrollLeft: number;
@@ -88,10 +94,10 @@ export declare const hauntedPolymer: (outputPath: string | Hook, hook?: Hook) =>
88
94
  slot: string;
89
95
  readonly tagName: string;
90
96
  attachShadow(init: ShadowRootInit): ShadowRoot;
91
- checkVisibility(options?: CheckVisibilityOptions | undefined): boolean;
92
- closest<K_2 extends keyof HTMLElementTagNameMap>(selector: K_2): HTMLElementTagNameMap[K_2] | null;
93
- closest<K_3 extends keyof SVGElementTagNameMap>(selector: K_3): SVGElementTagNameMap[K_3] | null;
94
- closest<K_4 extends keyof MathMLElementTagNameMap>(selector: K_4): MathMLElementTagNameMap[K_4] | null;
97
+ checkVisibility(options?: CheckVisibilityOptions): boolean;
98
+ closest<K extends keyof HTMLElementTagNameMap>(selector: K): HTMLElementTagNameMap[K] | null;
99
+ closest<K extends keyof SVGElementTagNameMap>(selector: K): SVGElementTagNameMap[K] | null;
100
+ closest<K extends keyof MathMLElementTagNameMap>(selector: K): MathMLElementTagNameMap[K] | null;
95
101
  closest<E extends Element = Element>(selectors: string): E | null;
96
102
  computedStyleMap(): StylePropertyMapReadOnly;
97
103
  getAttribute(qualifiedName: string): string | null;
@@ -102,43 +108,47 @@ export declare const hauntedPolymer: (outputPath: string | Hook, hook?: Hook) =>
102
108
  getBoundingClientRect(): DOMRect;
103
109
  getClientRects(): DOMRectList;
104
110
  getElementsByClassName(classNames: string): HTMLCollectionOf<Element>;
105
- getElementsByTagName<K_5 extends keyof HTMLElementTagNameMap>(qualifiedName: K_5): HTMLCollectionOf<HTMLElementTagNameMap[K_5]>;
106
- getElementsByTagName<K_6 extends keyof SVGElementTagNameMap>(qualifiedName: K_6): HTMLCollectionOf<SVGElementTagNameMap[K_6]>;
107
- getElementsByTagName<K_7 extends keyof MathMLElementTagNameMap>(qualifiedName: K_7): HTMLCollectionOf<MathMLElementTagNameMap[K_7]>;
108
- getElementsByTagName<K_8 extends keyof HTMLElementDeprecatedTagNameMap>(qualifiedName: K_8): HTMLCollectionOf<HTMLElementDeprecatedTagNameMap[K_8]>;
111
+ getElementsByTagName<K extends keyof HTMLElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<HTMLElementTagNameMap[K]>;
112
+ getElementsByTagName<K extends keyof SVGElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<SVGElementTagNameMap[K]>;
113
+ getElementsByTagName<K extends keyof MathMLElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<MathMLElementTagNameMap[K]>;
114
+ getElementsByTagName<K extends keyof HTMLElementDeprecatedTagNameMap>(qualifiedName: K): HTMLCollectionOf<HTMLElementDeprecatedTagNameMap[K]>;
109
115
  getElementsByTagName(qualifiedName: string): HTMLCollectionOf<Element>;
110
116
  getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf<HTMLElement>;
111
117
  getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf<SVGElement>;
112
118
  getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1998/Math/MathML", localName: string): HTMLCollectionOf<MathMLElement>;
113
119
  getElementsByTagNameNS(namespace: string | null, localName: string): HTMLCollectionOf<Element>;
120
+ getHTML(options?: GetHTMLOptions): string;
114
121
  hasAttribute(qualifiedName: string): boolean;
115
122
  hasAttributeNS(namespace: string | null, localName: string): boolean;
116
123
  hasAttributes(): boolean;
117
124
  hasPointerCapture(pointerId: number): boolean;
118
125
  insertAdjacentElement(where: InsertPosition, element: Element): Element | null;
119
- insertAdjacentHTML(position: InsertPosition, text: string): void;
126
+ insertAdjacentHTML(position: InsertPosition, string: string): void;
120
127
  insertAdjacentText(where: InsertPosition, data: string): void;
121
128
  matches(selectors: string): boolean;
122
129
  releasePointerCapture(pointerId: number): void;
123
130
  removeAttribute(qualifiedName: string): void;
124
131
  removeAttributeNS(namespace: string | null, localName: string): void;
125
132
  removeAttributeNode(attr: Attr): Attr;
126
- requestFullscreen(options?: FullscreenOptions | undefined): Promise<void>;
127
- requestPointerLock(): void;
128
- scroll(options?: ScrollToOptions | undefined): void;
133
+ requestFullscreen(options?: FullscreenOptions): Promise<void>;
134
+ requestPointerLock(options?: PointerLockOptions): Promise<void>;
135
+ scroll(options?: ScrollToOptions): void;
129
136
  scroll(x: number, y: number): void;
130
- scrollBy(options?: ScrollToOptions | undefined): void;
137
+ scrollBy(options?: ScrollToOptions): void;
131
138
  scrollBy(x: number, y: number): void;
132
- scrollIntoView(arg?: boolean | ScrollIntoViewOptions | undefined): void;
133
- scrollTo(options?: ScrollToOptions | undefined): void;
139
+ scrollIntoView(arg?: boolean | ScrollIntoViewOptions): void;
140
+ scrollTo(options?: ScrollToOptions): void;
134
141
  scrollTo(x: number, y: number): void;
135
142
  setAttribute(qualifiedName: string, value: string): void;
136
143
  setAttributeNS(namespace: string | null, qualifiedName: string, value: string): void;
137
144
  setAttributeNode(attr: Attr): Attr | null;
138
145
  setAttributeNodeNS(attr: Attr): Attr | null;
146
+ setHTMLUnsafe(html: string): void;
139
147
  setPointerCapture(pointerId: number): void;
140
- toggleAttribute(qualifiedName: string, force?: boolean | undefined): boolean;
148
+ toggleAttribute(qualifiedName: string, force?: boolean): boolean;
141
149
  webkitMatchesSelector(selectors: string): boolean;
150
+ get textContent(): string;
151
+ set textContent(value: string | null);
142
152
  readonly baseURI: string;
143
153
  readonly childNodes: NodeListOf<ChildNode>;
144
154
  readonly firstChild: ChildNode | null;
@@ -151,22 +161,21 @@ export declare const hauntedPolymer: (outputPath: string | Hook, hook?: Hook) =>
151
161
  readonly parentElement: HTMLElement | null;
152
162
  readonly parentNode: ParentNode | null;
153
163
  readonly previousSibling: ChildNode | null;
154
- textContent: string | null;
155
- appendChild<T_2 extends Node>(node: T_2): T_2;
156
- cloneNode(deep?: boolean | undefined): Node;
164
+ appendChild<T extends Node>(node: T): T;
165
+ cloneNode(subtree?: boolean): Node;
157
166
  compareDocumentPosition(other: Node): number;
158
167
  contains(other: Node | null): boolean;
159
- getRootNode(options?: GetRootNodeOptions | undefined): Node;
168
+ getRootNode(options?: GetRootNodeOptions): Node;
160
169
  hasChildNodes(): boolean;
161
- insertBefore<T_3 extends Node>(node: T_3, child: Node | null): T_3;
170
+ insertBefore<T extends Node>(node: T, child: Node | null): T;
162
171
  isDefaultNamespace(namespace: string | null): boolean;
163
172
  isEqualNode(otherNode: Node | null): boolean;
164
173
  isSameNode(otherNode: Node | null): boolean;
165
174
  lookupNamespaceURI(prefix: string | null): string | null;
166
175
  lookupPrefix(namespace: string | null): string | null;
167
176
  normalize(): void;
168
- removeChild<T_4 extends Node>(child: T_4): T_4;
169
- replaceChild<T_5 extends Node>(node: Node, child: T_5): T_5;
177
+ removeChild<T extends Node>(child: T): T;
178
+ replaceChild<T extends Node>(node: Node, child: T): T;
170
179
  readonly ELEMENT_NODE: 1;
171
180
  readonly ATTRIBUTE_NODE: 2;
172
181
  readonly TEXT_NODE: 3;
@@ -186,35 +195,49 @@ export declare const hauntedPolymer: (outputPath: string | Hook, hook?: Hook) =>
186
195
  readonly DOCUMENT_POSITION_CONTAINED_BY: 16;
187
196
  readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: 32;
188
197
  dispatchEvent(event: Event): boolean;
198
+ ariaActiveDescendantElement: Element | null;
189
199
  ariaAtomic: string | null;
190
200
  ariaAutoComplete: string | null;
201
+ ariaBrailleLabel: string | null;
202
+ ariaBrailleRoleDescription: string | null;
191
203
  ariaBusy: string | null;
192
204
  ariaChecked: string | null;
193
205
  ariaColCount: string | null;
194
206
  ariaColIndex: string | null;
207
+ ariaColIndexText: string | null;
195
208
  ariaColSpan: string | null;
209
+ ariaControlsElements: ReadonlyArray<Element> | null;
196
210
  ariaCurrent: string | null;
211
+ ariaDescribedByElements: ReadonlyArray<Element> | null;
212
+ ariaDescription: string | null;
213
+ ariaDetailsElements: ReadonlyArray<Element> | null;
197
214
  ariaDisabled: string | null;
215
+ ariaErrorMessageElements: ReadonlyArray<Element> | null;
198
216
  ariaExpanded: string | null;
217
+ ariaFlowToElements: ReadonlyArray<Element> | null;
199
218
  ariaHasPopup: string | null;
200
219
  ariaHidden: string | null;
201
220
  ariaInvalid: string | null;
202
221
  ariaKeyShortcuts: string | null;
203
222
  ariaLabel: string | null;
223
+ ariaLabelledByElements: ReadonlyArray<Element> | null;
204
224
  ariaLevel: string | null;
205
225
  ariaLive: string | null;
206
226
  ariaModal: string | null;
207
227
  ariaMultiLine: string | null;
208
228
  ariaMultiSelectable: string | null;
209
229
  ariaOrientation: string | null;
230
+ ariaOwnsElements: ReadonlyArray<Element> | null;
210
231
  ariaPlaceholder: string | null;
211
232
  ariaPosInSet: string | null;
212
233
  ariaPressed: string | null;
213
234
  ariaReadOnly: string | null;
235
+ ariaRelevant: string | null;
214
236
  ariaRequired: string | null;
215
237
  ariaRoleDescription: string | null;
216
238
  ariaRowCount: string | null;
217
239
  ariaRowIndex: string | null;
240
+ ariaRowIndexText: string | null;
218
241
  ariaRowSpan: string | null;
219
242
  ariaSelected: string | null;
220
243
  ariaSetSize: string | null;
@@ -224,35 +247,35 @@ export declare const hauntedPolymer: (outputPath: string | Hook, hook?: Hook) =>
224
247
  ariaValueNow: string | null;
225
248
  ariaValueText: string | null;
226
249
  role: string | null;
227
- animate(keyframes: PropertyIndexedKeyframes | Keyframe[] | null, options?: number | KeyframeAnimationOptions | undefined): Animation;
228
- getAnimations(options?: GetAnimationsOptions | undefined): Animation[];
229
- after(...nodes: (string | Node)[]): void;
230
- before(...nodes: (string | Node)[]): void;
250
+ animate(keyframes: Keyframe[] | PropertyIndexedKeyframes | null, options?: number | KeyframeAnimationOptions): Animation;
251
+ getAnimations(options?: GetAnimationsOptions): Animation[];
252
+ after(...nodes: (Node | string)[]): void;
253
+ before(...nodes: (Node | string)[]): void;
231
254
  remove(): void;
232
- replaceWith(...nodes: (string | Node)[]): void;
233
- innerHTML: string;
255
+ replaceWith(...nodes: (Node | string)[]): void;
234
256
  readonly nextElementSibling: Element | null;
235
257
  readonly previousElementSibling: Element | null;
236
258
  readonly childElementCount: number;
237
259
  readonly children: HTMLCollection;
238
260
  readonly firstElementChild: Element | null;
239
261
  readonly lastElementChild: Element | null;
240
- append(...nodes: (string | Node)[]): void;
241
- prepend(...nodes: (string | Node)[]): void;
242
- querySelector<K_9 extends keyof HTMLElementTagNameMap>(selectors: K_9): HTMLElementTagNameMap[K_9] | null;
243
- querySelector<K_10 extends keyof SVGElementTagNameMap>(selectors: K_10): SVGElementTagNameMap[K_10] | null;
244
- querySelector<K_11 extends keyof MathMLElementTagNameMap>(selectors: K_11): MathMLElementTagNameMap[K_11] | null;
245
- querySelector<K_12 extends keyof HTMLElementDeprecatedTagNameMap>(selectors: K_12): HTMLElementDeprecatedTagNameMap[K_12] | null;
246
- querySelector<E_1 extends Element = Element>(selectors: string): E_1 | null;
247
- querySelectorAll<K_13 extends keyof HTMLElementTagNameMap>(selectors: K_13): NodeListOf<HTMLElementTagNameMap[K_13]>;
248
- querySelectorAll<K_14 extends keyof SVGElementTagNameMap>(selectors: K_14): NodeListOf<SVGElementTagNameMap[K_14]>;
249
- querySelectorAll<K_15 extends keyof MathMLElementTagNameMap>(selectors: K_15): NodeListOf<MathMLElementTagNameMap[K_15]>;
250
- querySelectorAll<K_16 extends keyof HTMLElementDeprecatedTagNameMap>(selectors: K_16): NodeListOf<HTMLElementDeprecatedTagNameMap[K_16]>;
251
- querySelectorAll<E_2 extends Element = Element>(selectors: string): NodeListOf<E_2>;
252
- replaceChildren(...nodes: (string | Node)[]): void;
262
+ append(...nodes: (Node | string)[]): void;
263
+ prepend(...nodes: (Node | string)[]): void;
264
+ querySelector<K extends keyof HTMLElementTagNameMap>(selectors: K): HTMLElementTagNameMap[K] | null;
265
+ querySelector<K extends keyof SVGElementTagNameMap>(selectors: K): SVGElementTagNameMap[K] | null;
266
+ querySelector<K extends keyof MathMLElementTagNameMap>(selectors: K): MathMLElementTagNameMap[K] | null;
267
+ querySelector<K extends keyof HTMLElementDeprecatedTagNameMap>(selectors: K): HTMLElementDeprecatedTagNameMap[K] | null;
268
+ querySelector<E extends Element = Element>(selectors: string): E | null;
269
+ querySelectorAll<K extends keyof HTMLElementTagNameMap>(selectors: K): NodeListOf<HTMLElementTagNameMap[K]>;
270
+ querySelectorAll<K extends keyof SVGElementTagNameMap>(selectors: K): NodeListOf<SVGElementTagNameMap[K]>;
271
+ querySelectorAll<K extends keyof MathMLElementTagNameMap>(selectors: K): NodeListOf<MathMLElementTagNameMap[K]>;
272
+ querySelectorAll<K extends keyof HTMLElementDeprecatedTagNameMap>(selectors: K): NodeListOf<HTMLElementDeprecatedTagNameMap[K]>;
273
+ querySelectorAll<E extends Element = Element>(selectors: string): NodeListOf<E>;
274
+ replaceChildren(...nodes: (Node | string)[]): void;
253
275
  readonly assignedSlot: HTMLSlotElement | null;
254
276
  readonly attributeStyleMap: StylePropertyMap;
255
- readonly style: CSSStyleDeclaration;
277
+ get style(): CSSStyleDeclaration;
278
+ set style(cssText: string);
256
279
  contentEditable: string;
257
280
  enterKeyHint: string;
258
281
  inputMode: string;
@@ -262,16 +285,20 @@ export declare const hauntedPolymer: (outputPath: string | Hook, hook?: Hook) =>
262
285
  onanimationend: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
263
286
  onanimationiteration: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
264
287
  onanimationstart: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
265
- onauxclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
288
+ onauxclick: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
266
289
  onbeforeinput: ((this: GlobalEventHandlers, ev: InputEvent) => any) | null;
290
+ onbeforematch: ((this: GlobalEventHandlers, ev: Event) => any) | null;
291
+ onbeforetoggle: ((this: GlobalEventHandlers, ev: ToggleEvent) => any) | null;
267
292
  onblur: ((this: GlobalEventHandlers, ev: FocusEvent) => any) | null;
268
293
  oncancel: ((this: GlobalEventHandlers, ev: Event) => any) | null;
269
294
  oncanplay: ((this: GlobalEventHandlers, ev: Event) => any) | null;
270
295
  oncanplaythrough: ((this: GlobalEventHandlers, ev: Event) => any) | null;
271
296
  onchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
272
- onclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
297
+ onclick: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
273
298
  onclose: ((this: GlobalEventHandlers, ev: Event) => any) | null;
274
- oncontextmenu: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
299
+ oncontextlost: ((this: GlobalEventHandlers, ev: Event) => any) | null;
300
+ oncontextmenu: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
301
+ oncontextrestored: ((this: GlobalEventHandlers, ev: Event) => any) | null;
275
302
  oncopy: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null;
276
303
  oncuechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
277
304
  oncut: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null;
@@ -318,8 +345,9 @@ export declare const hauntedPolymer: (outputPath: string | Hook, hook?: Hook) =>
318
345
  onpointermove: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
319
346
  onpointerout: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
320
347
  onpointerover: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
348
+ onpointerrawupdate: ((this: GlobalEventHandlers, ev: Event) => any) | null;
321
349
  onpointerup: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
322
- onprogress: ((this: GlobalEventHandlers, ev: ProgressEvent<EventTarget>) => any) | null;
350
+ onprogress: ((this: GlobalEventHandlers, ev: ProgressEvent) => any) | null;
323
351
  onratechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
324
352
  onreset: ((this: GlobalEventHandlers, ev: Event) => any) | null;
325
353
  onresize: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null;
@@ -336,7 +364,7 @@ export declare const hauntedPolymer: (outputPath: string | Hook, hook?: Hook) =>
336
364
  onsubmit: ((this: GlobalEventHandlers, ev: SubmitEvent) => any) | null;
337
365
  onsuspend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
338
366
  ontimeupdate: ((this: GlobalEventHandlers, ev: Event) => any) | null;
339
- ontoggle: ((this: GlobalEventHandlers, ev: Event) => any) | null;
367
+ ontoggle: ((this: GlobalEventHandlers, ev: ToggleEvent) => any) | null;
340
368
  ontouchcancel?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
341
369
  ontouchend?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
342
370
  ontouchmove?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
@@ -354,10 +382,10 @@ export declare const hauntedPolymer: (outputPath: string | Hook, hook?: Hook) =>
354
382
  onwheel: ((this: GlobalEventHandlers, ev: WheelEvent) => any) | null;
355
383
  autofocus: boolean;
356
384
  readonly dataset: DOMStringMap;
357
- nonce?: string | undefined;
385
+ nonce?: string;
358
386
  tabIndex: number;
359
387
  blur(): void;
360
- focus(options?: FocusOptions | undefined): void;
388
+ focus(options?: FocusOptions): void;
361
389
  };
362
390
  };
363
391
  export {};
@@ -16,9 +16,7 @@ class Scheduler extends BaseScheduler {
16
16
  * @param {Function} hook A haunted hook
17
17
  * @returns {Function} The mixin
18
18
  */
19
- export const hauntedPolymer =
20
- // eslint-disable-next-line max-lines-per-function
21
- (outputPath, hook) => (base) => {
19
+ export const hauntedPolymer = (outputPath, hook) => (base) => {
22
20
  const hasOutputPath = hook !== undefined, _hook = hasOutputPath ? hook : outputPath;
23
21
  // TODO: drop outputPath support after all usages are fixed.
24
22
  if (hasOutputPath) {
@@ -34,8 +32,7 @@ export const hauntedPolymer =
34
32
  this, // using the element as state host
35
33
  (result) => hasOutputPath
36
34
  ? this.set(outputPath, result)
37
- : this.setProperties(result) // and update the output path with the results
38
- );
35
+ : this.setProperties(result));
39
36
  }
40
37
  connectedCallback() {
41
38
  super.connectedCallback();
@@ -2,7 +2,7 @@ export declare const applyMove: <T>(list: T[], from: number, to: number) => T[];
2
2
  interface Opts {
3
3
  prefix?: string;
4
4
  }
5
- export declare const useDragItems: (onMove?: ((from: number, to: number) => void) | undefined, { prefix }?: Opts) => {
5
+ export declare const useDragItems: (onMove?: (from: number, to: number) => void, { prefix }?: Opts) => {
6
6
  onDown: (e: MouseEvent) => void;
7
7
  onDragStart: (e: DragEvent) => void;
8
8
  onDragEnter: (e: DragEvent) => void;
@@ -14,7 +14,7 @@ export const useKeybindings = (bindings) => {
14
14
  if (focusIsInEditableArea())
15
15
  return;
16
16
  const [, activities] = binding;
17
- const handlers = activities.flatMap((activity) => meta[activity]);
17
+ const handlers = activities.flatMap((activity) => meta[activity] ?? []);
18
18
  if (handlers.length === 0)
19
19
  return;
20
20
  // find first actionable handler
@@ -3,7 +3,7 @@ export const isInteractive = (el) => {
3
3
  if (el == null)
4
4
  return false;
5
5
  const bounds = el.getBoundingClientRect(), root = el.getRootNode(), topEl = root.elementFromPoint(bounds.x + bounds.width / 2, bounds.y + bounds.height / 2);
6
- return el === topEl;
6
+ return topEl != null && (el === topEl || el.contains(topEl));
7
7
  };
8
8
  const getActiveElement = (root = document) => {
9
9
  const activeEl = root.activeElement;
package/dist/object.d.ts CHANGED
@@ -3,10 +3,10 @@ export type Rec<K extends PropertyKey = PropertyKey, V = any> = Record<K, V>;
3
3
  export declare function prop(): typeof identity;
4
4
  export declare function prop(a: '' | null | false | undefined | 0): typeof identity;
5
5
  export declare function prop<K extends PropertyKey>(key?: K): <O>(obj: O) => K extends keyof O ? O[K] : undefined;
6
- export declare const strProp: <K extends PropertyKey>(key?: K | undefined) => <O>(o: O) => string;
6
+ export declare const strProp: <K extends PropertyKey>(key?: K) => <O>(o: O) => string;
7
7
  export declare const transform: <K extends string, V, RK extends PropertyKey, RV>(obj: Record<K, V>, trans: (entries: [Extract<K, string>, V][]) => Iterable<readonly [RK, RV]>) => { [key in RK]: RV; };
8
- export declare const omit: <const K extends readonly PropertyKey[]>(keys: K) => <const T extends Rec<PropertyKey, any>>(obj: T) => Omit<T, K[number]>;
9
- export declare const props: <K extends PropertyKey>(keys: K[]) => <T extends Rec<PropertyKey, any>>(obj: T) => { [key in K & keyof T]: T[key]; };
8
+ export declare const omit: <const K extends readonly PropertyKey[]>(keys: K) => <const T extends Rec>(obj: T) => Omit<T, K[number]>;
9
+ export declare const props: <K extends PropertyKey>(keys: K[]) => <T extends Rec>(obj: T) => { [key in K & keyof T]: T[key]; };
10
10
  type Merge<T1, T2> = {
11
11
  [key in Exclude<keyof T1, keyof T2>]: T1[key];
12
12
  } & {
package/dist/object.js CHANGED
@@ -1,4 +1,3 @@
1
- /* eslint-disable no-use-before-define, import/group-exports */
2
1
  import { identity } from './function';
3
2
  export function prop(key) {
4
3
  if (!key) {
package/dist/promise.d.ts CHANGED
@@ -5,7 +5,7 @@ export declare class ManagedPromise<T> extends Promise<T> {
5
5
  }
6
6
  export declare const timeout$: (ms?: number) => Promise<unknown>;
7
7
  type Predicate<T extends Event> = (e: T) => boolean;
8
- export declare const event$: <E extends Event, P extends Predicate<E> = Predicate<E>>(target: EventTarget, type: string, predicate?: P | undefined, timeout?: number) => Promise<E>;
8
+ export declare const event$: <E extends Event, P extends Predicate<E> = Predicate<E>>(target: EventTarget, type: string, predicate?: P, timeout?: number) => Promise<E>;
9
9
  export declare const limit$: <T extends unknown[], P>(fn: (...args: T) => PromiseLike<P>, limit: number) => (...args: T) => Promise<P>;
10
10
  export declare const debounce$: <T extends unknown[], P>(fn: (...args: T) => P | PromiseLike<P>, ms?: number) => (...args: T) => Promise<P>;
11
11
  export declare const log$: <T extends unknown[], P>(fn: (...args: T) => PromiseLike<P>) => (...args: T) => PromiseLike<P>;
package/package.json CHANGED
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "name": "@neovici/cosmoz-utils",
3
- "version": "6.17.0",
3
+ "version": "6.17.2",
4
4
  "description": "Date, money and template management functions commonly needed in Cosmoz views.",
5
5
  "keywords": [
6
6
  "polymer",
7
7
  "web-components"
8
8
  ],
9
- "homepage": "https://github.com/neovici/cosmoz-utils#readme",
9
+ "homepage": "https://github.com/Neovici/cosmoz-utils#readme",
10
10
  "bugs": {
11
- "url": "https://github.com/neovici/cosmoz-utils/issues"
11
+ "url": "https://github.com/Neovici/cosmoz-utils/issues"
12
12
  },
13
13
  "repository": {
14
14
  "type": "git",
15
- "url": "git+https://github.com/neovici/cosmoz-utils.git"
15
+ "url": "git+https://github.com/Neovici/cosmoz-utils.git"
16
16
  },
17
17
  "license": "Apache-2.0",
18
18
  "author": "Neovici Development",
@@ -25,6 +25,7 @@
25
25
  ],
26
26
  "scripts": {
27
27
  "lint": "tsc && eslint --cache .",
28
+ "check:duplicates": "check-duplicate-components",
28
29
  "build": "tsc -p tsconfig.build.json",
29
30
  "start": "wds",
30
31
  "test": "wtr --coverage",
@@ -73,15 +74,16 @@
73
74
  "devDependencies": {
74
75
  "@commitlint/cli": "^19.0.0",
75
76
  "@commitlint/config-conventional": "^19.0.0",
76
- "@neovici/cfg": "^1.15.1",
77
+ "@neovici/cfg": "^2.8.0",
77
78
  "@open-wc/testing": "^4.0.0",
78
79
  "@polymer/polymer": "^3.3.1",
79
80
  "@semantic-release/changelog": "^6.0.0",
80
81
  "@semantic-release/git": "^10.0.0",
81
82
  "@types/mocha": "^10.0.3",
82
83
  "husky": "^8.0.0",
84
+ "lint-staged": "^16.2.7",
83
85
  "lit-html": "^2.0.0 || ^3.0.0",
84
- "semantic-release": "^24.0.0",
86
+ "semantic-release": "^25.0.2",
85
87
  "sinon": "^19.0.0"
86
88
  }
87
89
  }