@mcp-b/wc-support 0.2.0
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/LICENSE +21 -0
- package/dist/base/sigvelo-element.d.ts +80 -0
- package/dist/base/sigvelo-element.d.ts.map +1 -0
- package/dist/base/sigvelo-element.js +147 -0
- package/dist/base/sigvelo-element.js.map +1 -0
- package/dist/cem-plugins/type-references.d.ts +64 -0
- package/dist/cem-plugins/type-references.d.ts.map +1 -0
- package/dist/cem-plugins/type-references.js +242 -0
- package/dist/cem-plugins/type-references.js.map +1 -0
- package/dist/events/activate.d.ts +25 -0
- package/dist/events/activate.d.ts.map +1 -0
- package/dist/events/activate.js +25 -0
- package/dist/events/activate.js.map +1 -0
- package/dist/events/animation.d.ts +10 -0
- package/dist/events/animation.d.ts.map +1 -0
- package/dist/events/animation.js +7 -0
- package/dist/events/animation.js.map +1 -0
- package/dist/events/content.d.ts +15 -0
- package/dist/events/content.d.ts.map +1 -0
- package/dist/events/content.js +8 -0
- package/dist/events/content.js.map +1 -0
- package/dist/events/copy.d.ts +25 -0
- package/dist/events/copy.d.ts.map +1 -0
- package/dist/events/copy.js +15 -0
- package/dist/events/copy.js.map +1 -0
- package/dist/events/expand-collapse.d.ts +38 -0
- package/dist/events/expand-collapse.d.ts.map +1 -0
- package/dist/events/expand-collapse.js +37 -0
- package/dist/events/expand-collapse.js.map +1 -0
- package/dist/events/filter.d.ts +13 -0
- package/dist/events/filter.d.ts.map +1 -0
- package/dist/events/filter.js +12 -0
- package/dist/events/filter.js.map +1 -0
- package/dist/events/flip.d.ts +15 -0
- package/dist/events/flip.d.ts.map +1 -0
- package/dist/events/flip.js +13 -0
- package/dist/events/flip.js.map +1 -0
- package/dist/events/form.d.ts +29 -0
- package/dist/events/form.d.ts.map +1 -0
- package/dist/events/form.js +31 -0
- package/dist/events/form.js.map +1 -0
- package/dist/events/include.d.ts +28 -0
- package/dist/events/include.d.ts.map +1 -0
- package/dist/events/include.js +15 -0
- package/dist/events/include.js.map +1 -0
- package/dist/events/index.d.ts +23 -0
- package/dist/events/index.d.ts.map +1 -0
- package/dist/events/index.js +23 -0
- package/dist/events/index.js.map +1 -0
- package/dist/events/intersect.d.ts +15 -0
- package/dist/events/intersect.d.ts.map +1 -0
- package/dist/events/intersect.js +8 -0
- package/dist/events/intersect.js.map +1 -0
- package/dist/events/item.d.ts +18 -0
- package/dist/events/item.d.ts.map +1 -0
- package/dist/events/item.js +13 -0
- package/dist/events/item.js.map +1 -0
- package/dist/events/load.d.ts +25 -0
- package/dist/events/load.d.ts.map +1 -0
- package/dist/events/load.js +24 -0
- package/dist/events/load.js.map +1 -0
- package/dist/events/mutation.d.ts +15 -0
- package/dist/events/mutation.d.ts.map +1 -0
- package/dist/events/mutation.js +8 -0
- package/dist/events/mutation.js.map +1 -0
- package/dist/events/open-close.d.ts +38 -0
- package/dist/events/open-close.d.ts.map +1 -0
- package/dist/events/open-close.js +33 -0
- package/dist/events/open-close.js.map +1 -0
- package/dist/events/page.d.ts +24 -0
- package/dist/events/page.d.ts.map +1 -0
- package/dist/events/page.js +17 -0
- package/dist/events/page.js.map +1 -0
- package/dist/events/progress.d.ts +15 -0
- package/dist/events/progress.d.ts.map +1 -0
- package/dist/events/progress.js +8 -0
- package/dist/events/progress.js.map +1 -0
- package/dist/events/resize.d.ts +15 -0
- package/dist/events/resize.d.ts.map +1 -0
- package/dist/events/resize.js +8 -0
- package/dist/events/resize.js.map +1 -0
- package/dist/events/row.d.ts +19 -0
- package/dist/events/row.d.ts.map +1 -0
- package/dist/events/row.js +8 -0
- package/dist/events/row.js.map +1 -0
- package/dist/events/select.d.ts +16 -0
- package/dist/events/select.d.ts.map +1 -0
- package/dist/events/select.js +8 -0
- package/dist/events/select.js.map +1 -0
- package/dist/events/tabs.d.ts +32 -0
- package/dist/events/tabs.d.ts.map +1 -0
- package/dist/events/tabs.js +21 -0
- package/dist/events/tabs.js.map +1 -0
- package/dist/events/time.d.ts +15 -0
- package/dist/events/time.d.ts.map +1 -0
- package/dist/events/time.js +13 -0
- package/dist/events/time.js.map +1 -0
- package/dist/events/transition.d.ts +10 -0
- package/dist/events/transition.d.ts.map +1 -0
- package/dist/events/transition.js +7 -0
- package/dist/events/transition.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/prefix.d.ts +16 -0
- package/dist/prefix.d.ts.map +1 -0
- package/dist/prefix.js +22 -0
- package/dist/prefix.js.map +1 -0
- package/dist/styles/form-control.styles.d.ts +9 -0
- package/dist/styles/form-control.styles.d.ts.map +1 -0
- package/dist/styles/form-control.styles.js +337 -0
- package/dist/styles/form-control.styles.js.map +1 -0
- package/dist/styles/host.styles.d.ts +4 -0
- package/dist/styles/host.styles.d.ts.map +1 -0
- package/dist/styles/host.styles.js +33 -0
- package/dist/styles/host.styles.js.map +1 -0
- package/dist/utilities/active-element.d.ts +7 -0
- package/dist/utilities/active-element.d.ts.map +1 -0
- package/dist/utilities/active-element.js +16 -0
- package/dist/utilities/active-element.js.map +1 -0
- package/dist/utilities/animate.d.ts +25 -0
- package/dist/utilities/animate.d.ts.map +1 -0
- package/dist/utilities/animate.js +58 -0
- package/dist/utilities/animate.js.map +1 -0
- package/dist/utilities/defined.d.ts +37 -0
- package/dist/utilities/defined.d.ts.map +1 -0
- package/dist/utilities/defined.js +42 -0
- package/dist/utilities/defined.js.map +1 -0
- package/dist/utilities/drag.d.ts +45 -0
- package/dist/utilities/drag.d.ts.map +1 -0
- package/dist/utilities/drag.js +106 -0
- package/dist/utilities/drag.js.map +1 -0
- package/dist/utilities/html.d.ts +5 -0
- package/dist/utilities/html.d.ts.map +1 -0
- package/dist/utilities/html.js +41 -0
- package/dist/utilities/html.js.map +1 -0
- package/dist/utilities/icon-library.d.ts +28 -0
- package/dist/utilities/icon-library.d.ts.map +1 -0
- package/dist/utilities/icon-library.js +36 -0
- package/dist/utilities/icon-library.js.map +1 -0
- package/dist/utilities/index.d.ts +16 -0
- package/dist/utilities/index.d.ts.map +1 -0
- package/dist/utilities/index.js +16 -0
- package/dist/utilities/index.js.map +1 -0
- package/dist/utilities/library.d.ts +19 -0
- package/dist/utilities/library.d.ts.map +1 -0
- package/dist/utilities/library.js +45 -0
- package/dist/utilities/library.js.map +1 -0
- package/dist/utilities/loader.d.ts +36 -0
- package/dist/utilities/loader.d.ts.map +1 -0
- package/dist/utilities/loader.js +139 -0
- package/dist/utilities/loader.js.map +1 -0
- package/dist/utilities/localize.d.ts +62 -0
- package/dist/utilities/localize.d.ts.map +1 -0
- package/dist/utilities/localize.js +128 -0
- package/dist/utilities/localize.js.map +1 -0
- package/dist/utilities/long-press.d.ts +67 -0
- package/dist/utilities/long-press.d.ts.map +1 -0
- package/dist/utilities/long-press.js +125 -0
- package/dist/utilities/long-press.js.map +1 -0
- package/dist/utilities/math.d.ts +9 -0
- package/dist/utilities/math.d.ts.map +1 -0
- package/dist/utilities/math.js +25 -0
- package/dist/utilities/math.js.map +1 -0
- package/dist/utilities/parse.d.ts +5 -0
- package/dist/utilities/parse.d.ts.map +1 -0
- package/dist/utilities/parse.js +10 -0
- package/dist/utilities/parse.js.map +1 -0
- package/dist/utilities/platform.d.ts +10 -0
- package/dist/utilities/platform.d.ts.map +1 -0
- package/dist/utilities/platform.js +30 -0
- package/dist/utilities/platform.js.map +1 -0
- package/dist/utilities/scroll.d.ts +8 -0
- package/dist/utilities/scroll.d.ts.map +1 -0
- package/dist/utilities/scroll.js +33 -0
- package/dist/utilities/scroll.js.map +1 -0
- package/dist/utilities/search.d.ts +20 -0
- package/dist/utilities/search.d.ts.map +1 -0
- package/dist/utilities/search.js +110 -0
- package/dist/utilities/search.js.map +1 -0
- package/package.json +77 -0
- package/src/themes/sigvelo.css +28 -0
- package/src/themes/utilities.css +115 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 MCP-B contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { TemplateResult } from "lit";
|
|
2
|
+
import { LitElement } from "lit";
|
|
3
|
+
/** The base class for all Sigvelo components */
|
|
4
|
+
export declare class SigveloElement extends LitElement {
|
|
5
|
+
static formAssociated: boolean;
|
|
6
|
+
static shadowRootOptions: ShadowRootInit;
|
|
7
|
+
/**
|
|
8
|
+
* Enables slot detection for a component. When enabled, named slots that have content will be automatically detected
|
|
9
|
+
* and their names will be added to a Set in the reactive `this.slots` property.
|
|
10
|
+
*/
|
|
11
|
+
static observeSlots: boolean;
|
|
12
|
+
protected internals: ElementInternals;
|
|
13
|
+
shadowRoot: ShadowRoot;
|
|
14
|
+
/**
|
|
15
|
+
* @internal A Set containing all named slots that are currently populated with content. For performance reasons, this
|
|
16
|
+
* will only be set when the static `observeSlots` property is enabled on the component.
|
|
17
|
+
*/
|
|
18
|
+
slotsWithContent: Set<string>;
|
|
19
|
+
dir: string;
|
|
20
|
+
lang: string;
|
|
21
|
+
constructor();
|
|
22
|
+
connectedCallback(): void;
|
|
23
|
+
/**
|
|
24
|
+
* Updates the slotsWithContent Set with currently populated slots
|
|
25
|
+
*/
|
|
26
|
+
private updateSlotsWithContent;
|
|
27
|
+
/** @internal */
|
|
28
|
+
customStates: {
|
|
29
|
+
/** Adds or removes the specified custom state. */
|
|
30
|
+
set: (customState: string, active: boolean) => void;
|
|
31
|
+
/** Determines whether or not the element currently has the specified state. */
|
|
32
|
+
has: (customState: string) => boolean;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Used in templates to conditionally render a slot when it has content. When it doesn't have content, a hidden slot
|
|
36
|
+
* of the same name is rendered instead to ensure the `slotchange` event continues to fire.
|
|
37
|
+
*/
|
|
38
|
+
protected whenSlotted(name: string, content: TemplateResult, options?: Partial<WhenSlottedOptions>): TemplateResult;
|
|
39
|
+
}
|
|
40
|
+
interface WhenSlottedOptions {
|
|
41
|
+
/**
|
|
42
|
+
* When true, the slot will be rendered even if nothing is slotted in. Useful for showing the slot when, for example,
|
|
43
|
+
* nothing is slotted in but a corresponding value is provided through a property.
|
|
44
|
+
*/
|
|
45
|
+
force: boolean;
|
|
46
|
+
}
|
|
47
|
+
/** The base class for all Sigvelo form controls. */
|
|
48
|
+
export declare abstract class SigveloFormControlElement extends SigveloElement {
|
|
49
|
+
static formAssociated: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* For form controls, components must implement this and set it to the element that should receive focus when
|
|
52
|
+
* reporting validation errors.
|
|
53
|
+
*/
|
|
54
|
+
protected abstract get focusableAnchor(): HTMLElement;
|
|
55
|
+
/** For form-associated elements, this returns the current validity state of the control. */
|
|
56
|
+
get validity(): ValidityState | undefined;
|
|
57
|
+
/** Gets the form control's current validation message or an empty string when the form control is valid. */
|
|
58
|
+
get validationMessage(): string;
|
|
59
|
+
/**
|
|
60
|
+
* Checks if the form control has any restraints and whether it satisfies them. If invalid, `false` will be returned
|
|
61
|
+
* and the `invalid` event will be dispatched. If valid, `true` will be returned.
|
|
62
|
+
*/
|
|
63
|
+
checkValidity(): boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Sets a custom validation message for the form control. If this message is not an empty string, then the form
|
|
66
|
+
* control is considered invalid and the specified message will be displayed to the user when reporting validity.
|
|
67
|
+
* Setting an empty string clears the custom validity state.
|
|
68
|
+
*/
|
|
69
|
+
setCustomValidity(message: string): void;
|
|
70
|
+
/** Returns the current custom validation message or an empty string if no custom error is set. */
|
|
71
|
+
protected getCustomValidity(): string;
|
|
72
|
+
/**
|
|
73
|
+
* Checks if the form control has any restraints and whether it satisfies them. If invalid, `false` will be returned
|
|
74
|
+
* and the `invalid` event will be dispatched. In addition, the problem will be reported to the user. If valid, `true`
|
|
75
|
+
* will be returned.
|
|
76
|
+
*/
|
|
77
|
+
reportValidity(): boolean;
|
|
78
|
+
}
|
|
79
|
+
export {};
|
|
80
|
+
//# sourceMappingURL=sigvelo-element.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sigvelo-element.d.ts","sourceRoot":"","sources":["../../src/base/sigvelo-element.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAQ,MAAM,KAAK,CAAC;AAIvC,gDAAgD;AAChD,qBAAa,cAAe,SAAQ,UAAU;IAC5C,MAAM,CAAC,cAAc,UAAS;IAC9B,MAAM,CAAC,iBAAiB,EAAE,cAAc,CAGtC;IAEF;;;OAGG;IACH,MAAM,CAAC,YAAY,UAAS;IAE5B,SAAS,CAAC,SAAS,EAAE,gBAAgB,CAAC;IAC/B,UAAU,EAAE,UAAU,CAAC;IAE9B;;;OAGG;IACM,gBAAgB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAa;IAGvC,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;;IAOzB,iBAAiB;IAsBjB;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAY9B,gBAAgB;IACT,YAAY;QACjB,kDAAkD;2BAC/B,MAAM,UAAU,OAAO;QAQ1C,+EAA+E;2BAC5D,MAAM;MAGzB;IAEF;;;OAGG;IACH,SAAS,CAAC,WAAW,CACnB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,cAAc,EACvB,OAAO,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC;CAWxC;AAED,UAAU,kBAAkB;IAC1B;;;OAGG;IACH,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,oDAAoD;AACpD,8BAAsB,yBAA0B,SAAQ,cAAc;IACpE,MAAM,CAAC,cAAc,UAAQ;IAE7B;;;OAGG;IACH,SAAS,CAAC,QAAQ,KAAK,eAAe,IAAI,WAAW,CAAC;IAEtD,4FAA4F;IAC5F,IAAW,QAAQ,8BAGlB;IAED,4GAA4G;IAC5G,IAAW,iBAAiB,WAE3B;IAED;;;OAGG;IACI,aAAa;IAIpB;;;;OAIG;IACI,iBAAiB,CAAC,OAAO,EAAE,MAAM;IAoBxC,kGAAkG;IAClG,SAAS,CAAC,iBAAiB,IAAI,MAAM;IAIrC;;;;OAIG;IACI,cAAc;CAGtB"}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { LitElement, html } from "lit";
|
|
8
|
+
import { property, state } from "lit/decorators.js";
|
|
9
|
+
import { stripElementPrefix } from "../prefix.js";
|
|
10
|
+
/** The base class for all Sigvelo components */
|
|
11
|
+
export class SigveloElement extends LitElement {
|
|
12
|
+
constructor() {
|
|
13
|
+
super();
|
|
14
|
+
/**
|
|
15
|
+
* @internal A Set containing all named slots that are currently populated with content. For performance reasons, this
|
|
16
|
+
* will only be set when the static `observeSlots` property is enabled on the component.
|
|
17
|
+
*/
|
|
18
|
+
this.slotsWithContent = new Set();
|
|
19
|
+
/** @internal */
|
|
20
|
+
this.customStates = {
|
|
21
|
+
/** Adds or removes the specified custom state. */
|
|
22
|
+
set: (customState, active) => {
|
|
23
|
+
if (active) {
|
|
24
|
+
this.internals.states.add(customState);
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
this.internals.states.delete(customState);
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
/** Determines whether or not the element currently has the specified state. */
|
|
31
|
+
has: (customState) => {
|
|
32
|
+
return this.internals.states.has(customState);
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
this.internals = this.attachInternals();
|
|
36
|
+
}
|
|
37
|
+
connectedCallback() {
|
|
38
|
+
super.connectedCallback();
|
|
39
|
+
const constructor = this.constructor;
|
|
40
|
+
// If enabled, observe slots up front to prevent extra renders
|
|
41
|
+
if (constructor.observeSlots) {
|
|
42
|
+
this.updateSlotsWithContent();
|
|
43
|
+
// Observe slot changes
|
|
44
|
+
this.shadowRoot.addEventListener("slotchange", () => {
|
|
45
|
+
this.updateSlotsWithContent();
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
// Represent with a link to the docs for curious devs
|
|
49
|
+
this.shadowRoot.prepend(document.createComment(` Sigvelo · https://design-system.sigvelo.com/docs/components/${stripElementPrefix(this.localName)} `));
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Updates the slotsWithContent Set with currently populated slots
|
|
53
|
+
*/
|
|
54
|
+
updateSlotsWithContent() {
|
|
55
|
+
const newSlots = new Set([...this.querySelectorAll(":scope > [slot]")].map((el) => el.slot));
|
|
56
|
+
// Only trigger an update if the slots have actually changed
|
|
57
|
+
if (JSON.stringify([...newSlots].toSorted()) !==
|
|
58
|
+
JSON.stringify([...this.slotsWithContent].toSorted())) {
|
|
59
|
+
this.slotsWithContent = newSlots;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Used in templates to conditionally render a slot when it has content. When it doesn't have content, a hidden slot
|
|
64
|
+
* of the same name is rendered instead to ensure the `slotchange` event continues to fire.
|
|
65
|
+
*/
|
|
66
|
+
whenSlotted(name, content, options) {
|
|
67
|
+
const opts = {
|
|
68
|
+
force: false,
|
|
69
|
+
...options,
|
|
70
|
+
};
|
|
71
|
+
return this.slotsWithContent.has(name) || opts.force
|
|
72
|
+
? content
|
|
73
|
+
: html `<slot name="${name}" hidden></slot>`;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
SigveloElement.formAssociated = false;
|
|
77
|
+
SigveloElement.shadowRootOptions = {
|
|
78
|
+
...LitElement.shadowRootOptions,
|
|
79
|
+
serializable: true,
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* Enables slot detection for a component. When enabled, named slots that have content will be automatically detected
|
|
83
|
+
* and their names will be added to a Set in the reactive `this.slots` property.
|
|
84
|
+
*/
|
|
85
|
+
SigveloElement.observeSlots = false;
|
|
86
|
+
__decorate([
|
|
87
|
+
state()
|
|
88
|
+
], SigveloElement.prototype, "slotsWithContent", void 0);
|
|
89
|
+
__decorate([
|
|
90
|
+
property()
|
|
91
|
+
], SigveloElement.prototype, "dir", void 0);
|
|
92
|
+
__decorate([
|
|
93
|
+
property()
|
|
94
|
+
], SigveloElement.prototype, "lang", void 0);
|
|
95
|
+
/** The base class for all Sigvelo form controls. */
|
|
96
|
+
export class SigveloFormControlElement extends SigveloElement {
|
|
97
|
+
/** For form-associated elements, this returns the current validity state of the control. */
|
|
98
|
+
get validity() {
|
|
99
|
+
const constructor = this.constructor;
|
|
100
|
+
return constructor.formAssociated ? this.internals.validity : undefined;
|
|
101
|
+
}
|
|
102
|
+
/** Gets the form control's current validation message or an empty string when the form control is valid. */
|
|
103
|
+
get validationMessage() {
|
|
104
|
+
return this.internals.validationMessage;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Checks if the form control has any restraints and whether it satisfies them. If invalid, `false` will be returned
|
|
108
|
+
* and the `invalid` event will be dispatched. If valid, `true` will be returned.
|
|
109
|
+
*/
|
|
110
|
+
checkValidity() {
|
|
111
|
+
return this.internals.checkValidity();
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Sets a custom validation message for the form control. If this message is not an empty string, then the form
|
|
115
|
+
* control is considered invalid and the specified message will be displayed to the user when reporting validity.
|
|
116
|
+
* Setting an empty string clears the custom validity state.
|
|
117
|
+
*/
|
|
118
|
+
setCustomValidity(message) {
|
|
119
|
+
// If the user calls this immediately after `customElements.whenDefined()`, the template won't have rendered. In
|
|
120
|
+
// that case, we'll set it as soon as the first update completes.
|
|
121
|
+
if (!this.hasUpdated) {
|
|
122
|
+
this.updateComplete.then(() => this.setCustomValidity(message));
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
if (this.focusableAnchor) {
|
|
126
|
+
this.internals.setValidity({ customError: message !== "" }, message, this.focusableAnchor);
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
console.error(`No "focusableAnchor" getter is set on ${this.tagName}. This will prevent validation from working properly.`, this);
|
|
130
|
+
}
|
|
131
|
+
this.requestUpdate();
|
|
132
|
+
}
|
|
133
|
+
/** Returns the current custom validation message or an empty string if no custom error is set. */
|
|
134
|
+
getCustomValidity() {
|
|
135
|
+
return this.internals.validity.customError ? this.internals.validationMessage : "";
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Checks if the form control has any restraints and whether it satisfies them. If invalid, `false` will be returned
|
|
139
|
+
* and the `invalid` event will be dispatched. In addition, the problem will be reported to the user. If valid, `true`
|
|
140
|
+
* will be returned.
|
|
141
|
+
*/
|
|
142
|
+
reportValidity() {
|
|
143
|
+
return this.internals.reportValidity();
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
SigveloFormControlElement.formAssociated = true;
|
|
147
|
+
//# sourceMappingURL=sigvelo-element.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sigvelo-element.js","sourceRoot":"","sources":["../../src/base/sigvelo-element.ts"],"names":[],"mappings":";;;;;;AACA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAElD,gDAAgD;AAChD,MAAM,OAAO,cAAe,SAAQ,UAAU;IA0B5C;QACE,KAAK,EAAE,CAAC;QAXV;;;WAGG;QACM,qBAAgB,GAAgB,IAAI,GAAG,EAAE,CAAC;QAgDnD,gBAAgB;QACT,iBAAY,GAAG;YACpB,kDAAkD;YAClD,GAAG,EAAE,CAAC,WAAmB,EAAE,MAAe,EAAE,EAAE;gBAC5C,IAAI,MAAM,EAAE,CAAC;oBACX,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;gBACzC,CAAC;qBAAM,CAAC;oBACN,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;gBAC5C,CAAC;YACH,CAAC;YAED,+EAA+E;YAC/E,GAAG,EAAE,CAAC,WAAmB,EAAE,EAAE;gBAC3B,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,C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AAC,eAAe,EAAE,CAAC;YACzB,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE,WAAW,EAAE,OAAO,KAAK,EAAE,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;QAC7F,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,KAAK,CACX,yCAAyC,IAAI,CAAC,OAAO,uDAAuD,EAC5G,IAAI,CACL,CAAC;QACJ,CAAC;QAED,IAAI,CAAC,aAAa,EAAE,CAAC;IACvB,CAAC;IAED,kGAAkG;IACxF,iBAAiB;QACzB,OAAO,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,CAAC;IACrF,CAAC;IAED;;;;OAIG;IACI,cAAc;QACnB,OAAO,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE,CAAC;IACzC,CAAC;;AAhEM,wCAAc,GAAG,IAAI,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CEM Analyzer Plugin: Type References
|
|
3
|
+
*
|
|
4
|
+
* Walks every `type.text` field in the Custom Elements Manifest and populates
|
|
5
|
+
* the `type.references` array per the CEM spec. Each reference includes:
|
|
6
|
+
* - name: The type identifier
|
|
7
|
+
* - package: The npm package it originates from (omitted if local)
|
|
8
|
+
* - module: The module path within that package
|
|
9
|
+
* - start: Character offset in type.text where the name begins
|
|
10
|
+
* - end: Character offset in type.text where the name ends
|
|
11
|
+
*
|
|
12
|
+
* The docs generator then maps each reference to a URL via a registry.
|
|
13
|
+
*/
|
|
14
|
+
import type ts from "typescript";
|
|
15
|
+
interface TypeInfo {
|
|
16
|
+
text: string;
|
|
17
|
+
references?: TypeReference[];
|
|
18
|
+
}
|
|
19
|
+
interface TypeReference {
|
|
20
|
+
name: string;
|
|
21
|
+
package?: string;
|
|
22
|
+
module?: string;
|
|
23
|
+
start: number;
|
|
24
|
+
end: number;
|
|
25
|
+
}
|
|
26
|
+
interface CemDeclaration {
|
|
27
|
+
name?: string;
|
|
28
|
+
type?: TypeInfo;
|
|
29
|
+
members?: CemDeclaration[];
|
|
30
|
+
parameters?: CemDeclaration[];
|
|
31
|
+
events?: CemDeclaration[];
|
|
32
|
+
attributes?: CemDeclaration[];
|
|
33
|
+
slots?: CemDeclaration[];
|
|
34
|
+
cssParts?: CemDeclaration[];
|
|
35
|
+
cssProperties?: CemDeclaration[];
|
|
36
|
+
[key: string]: unknown;
|
|
37
|
+
}
|
|
38
|
+
interface CemModule {
|
|
39
|
+
path: string;
|
|
40
|
+
declarations?: CemDeclaration[];
|
|
41
|
+
exports?: Array<{
|
|
42
|
+
declaration?: {
|
|
43
|
+
name?: string;
|
|
44
|
+
};
|
|
45
|
+
}>;
|
|
46
|
+
}
|
|
47
|
+
interface CemManifest {
|
|
48
|
+
modules?: CemModule[];
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Create the CEM type-references plugin.
|
|
52
|
+
*/
|
|
53
|
+
export declare function typeReferencesPlugin(): {
|
|
54
|
+
name: string;
|
|
55
|
+
analyzePhase({ ts: analyzeTs, node }: {
|
|
56
|
+
ts: typeof ts;
|
|
57
|
+
node: ts.Node;
|
|
58
|
+
}): void;
|
|
59
|
+
packageLinkPhase({ customElementsManifest }: {
|
|
60
|
+
customElementsManifest: CemManifest;
|
|
61
|
+
}): void;
|
|
62
|
+
};
|
|
63
|
+
export {};
|
|
64
|
+
//# sourceMappingURL=type-references.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type-references.d.ts","sourceRoot":"","sources":["../../src/cem-plugins/type-references.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAMjC,UAAU,QAAQ;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,aAAa,EAAE,CAAC;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ifest and populates
|
|
5
|
+
* the `type.references` array per the CEM spec. Each reference includes:
|
|
6
|
+
* - name: The type identifier
|
|
7
|
+
* - package: The npm package it originates from (omitted if local)
|
|
8
|
+
* - module: The module path within that package
|
|
9
|
+
* - start: Character offset in type.text where the name begins
|
|
10
|
+
* - end: Character offset in type.text where the name ends
|
|
11
|
+
*
|
|
12
|
+
* The docs generator then maps each reference to a URL via a registry.
|
|
13
|
+
*/
|
|
14
|
+
// ---------------------------------------------------------------------------
|
|
15
|
+
// Constants
|
|
16
|
+
// ---------------------------------------------------------------------------
|
|
17
|
+
/** DOM/Web API globals that exist without imports. */
|
|
18
|
+
const DOM_GLOBALS = new Set([
|
|
19
|
+
"HTMLElement",
|
|
20
|
+
"HTMLDivElement",
|
|
21
|
+
"HTMLButtonElement",
|
|
22
|
+
"HTMLInputElement",
|
|
23
|
+
"HTMLTextAreaElement",
|
|
24
|
+
"HTMLSelectElement",
|
|
25
|
+
"HTMLAnchorElement",
|
|
26
|
+
"HTMLDialogElement",
|
|
27
|
+
"HTMLSlotElement",
|
|
28
|
+
"HTMLLabelElement",
|
|
29
|
+
"HTMLIFrameElement",
|
|
30
|
+
"HTMLTemplateElement",
|
|
31
|
+
"HTMLScriptElement",
|
|
32
|
+
"Element",
|
|
33
|
+
"ElementInternals",
|
|
34
|
+
"DOMRect",
|
|
35
|
+
"Document",
|
|
36
|
+
"File",
|
|
37
|
+
"Event",
|
|
38
|
+
"CustomEvent",
|
|
39
|
+
"MouseEvent",
|
|
40
|
+
"KeyboardEvent",
|
|
41
|
+
"FocusEvent",
|
|
42
|
+
"PointerEvent",
|
|
43
|
+
"DragEvent",
|
|
44
|
+
"MessageEvent",
|
|
45
|
+
"FocusOptions",
|
|
46
|
+
"MutationObserver",
|
|
47
|
+
"ResizeObserver",
|
|
48
|
+
"IntersectionObserver",
|
|
49
|
+
"SVGSVGElement",
|
|
50
|
+
"Date",
|
|
51
|
+
"ClipboardItem",
|
|
52
|
+
"Window",
|
|
53
|
+
"RequestMode",
|
|
54
|
+
"ScrollBehavior",
|
|
55
|
+
"ScrollToOptions",
|
|
56
|
+
]);
|
|
57
|
+
/** Primitives and built-ins that should never get a reference link. */
|
|
58
|
+
const SKIP_TYPES = new Set([
|
|
59
|
+
"string",
|
|
60
|
+
"number",
|
|
61
|
+
"boolean",
|
|
62
|
+
"void",
|
|
63
|
+
"undefined",
|
|
64
|
+
"null",
|
|
65
|
+
"never",
|
|
66
|
+
"any",
|
|
67
|
+
"unknown",
|
|
68
|
+
"object",
|
|
69
|
+
"symbol",
|
|
70
|
+
"bigint",
|
|
71
|
+
"Array",
|
|
72
|
+
"Promise",
|
|
73
|
+
"Record",
|
|
74
|
+
"Map",
|
|
75
|
+
"Set",
|
|
76
|
+
"Partial",
|
|
77
|
+
"ReturnType",
|
|
78
|
+
"Omit",
|
|
79
|
+
"Pick",
|
|
80
|
+
"Exclude",
|
|
81
|
+
"Extract",
|
|
82
|
+
"Required",
|
|
83
|
+
"Readonly",
|
|
84
|
+
]);
|
|
85
|
+
/**
|
|
86
|
+
* Matches identifiers that look like type names (PascalCase or known patterns).
|
|
87
|
+
* Skips string literals in single quotes and typeof operands.
|
|
88
|
+
*/
|
|
89
|
+
const TYPE_IDENT_RE = /(?<!')(?<!\w)([A-Z][A-Za-z0-9]*(?:\.[A-Z][A-Za-z0-9]*)?)(?!\w)(?!')/g;
|
|
90
|
+
// ---------------------------------------------------------------------------
|
|
91
|
+
// Helpers
|
|
92
|
+
// ---------------------------------------------------------------------------
|
|
93
|
+
/**
|
|
94
|
+
* Extract the npm package name from an import specifier.
|
|
95
|
+
* Handles scoped packages: "@foo/bar/baz" -> "@foo/bar"
|
|
96
|
+
*/
|
|
97
|
+
function extractPackageName(specifier) {
|
|
98
|
+
if (specifier.startsWith("@")) {
|
|
99
|
+
const parts = specifier.split("/");
|
|
100
|
+
return parts.slice(0, 2).join("/");
|
|
101
|
+
}
|
|
102
|
+
return specifier.split("/")[0];
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Resolve a type identifier to its source package and module.
|
|
106
|
+
*/
|
|
107
|
+
function resolveType(name, localTypeMap, importMap) {
|
|
108
|
+
if (importMap.has(name)) {
|
|
109
|
+
return { name, ...importMap.get(name) };
|
|
110
|
+
}
|
|
111
|
+
if (localTypeMap.has(name)) {
|
|
112
|
+
return { name, ...localTypeMap.get(name) };
|
|
113
|
+
}
|
|
114
|
+
if (DOM_GLOBALS.has(name)) {
|
|
115
|
+
return { name, package: "dom" };
|
|
116
|
+
}
|
|
117
|
+
return null;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Build a map of type name -> source from the manifest's own declarations.
|
|
121
|
+
*/
|
|
122
|
+
function buildLocalTypeMap(manifest) {
|
|
123
|
+
const map = new Map();
|
|
124
|
+
for (const mod of manifest.modules ?? []) {
|
|
125
|
+
for (const decl of mod.declarations ?? []) {
|
|
126
|
+
if (decl.name) {
|
|
127
|
+
map.set(decl.name, { module: mod.path });
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
for (const exp of mod.exports ?? []) {
|
|
131
|
+
if (exp.declaration?.name) {
|
|
132
|
+
map.set(exp.declaration.name, { module: mod.path });
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
return map;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Add `type.references` to every type field in the given object tree.
|
|
140
|
+
*/
|
|
141
|
+
function addReferences(obj, localTypeMap, importMap) {
|
|
142
|
+
if (!obj || typeof obj !== "object")
|
|
143
|
+
return;
|
|
144
|
+
if (Array.isArray(obj)) {
|
|
145
|
+
for (const item of obj) {
|
|
146
|
+
addReferences(item, localTypeMap, importMap);
|
|
147
|
+
}
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
const record = obj;
|
|
151
|
+
// Process type fields
|
|
152
|
+
const typeField = record["type"];
|
|
153
|
+
if (typeField && typeof typeField === "object" && typeof typeField.text === "string") {
|
|
154
|
+
const text = typeField.text;
|
|
155
|
+
const references = [];
|
|
156
|
+
TYPE_IDENT_RE.lastIndex = 0;
|
|
157
|
+
let match;
|
|
158
|
+
while ((match = TYPE_IDENT_RE.exec(text)) !== null) {
|
|
159
|
+
const name = match[1];
|
|
160
|
+
if (SKIP_TYPES.has(name))
|
|
161
|
+
continue;
|
|
162
|
+
const resolved = resolveType(name, localTypeMap, importMap);
|
|
163
|
+
if (!resolved)
|
|
164
|
+
continue;
|
|
165
|
+
references.push({
|
|
166
|
+
name: resolved.name,
|
|
167
|
+
...(resolved.package ? { package: resolved.package } : {}),
|
|
168
|
+
...(resolved.module ? { module: resolved.module } : {}),
|
|
169
|
+
start: match.index,
|
|
170
|
+
end: match.index + name.length,
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
if (references.length > 0) {
|
|
174
|
+
typeField.references = references;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
// Recurse into child properties
|
|
178
|
+
for (const value of Object.values(record)) {
|
|
179
|
+
addReferences(value, localTypeMap, importMap);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
// ---------------------------------------------------------------------------
|
|
183
|
+
// Plugin
|
|
184
|
+
// ---------------------------------------------------------------------------
|
|
185
|
+
/**
|
|
186
|
+
* Create the CEM type-references plugin.
|
|
187
|
+
*/
|
|
188
|
+
export function typeReferencesPlugin() {
|
|
189
|
+
let importMap = new Map();
|
|
190
|
+
return {
|
|
191
|
+
name: "type-references",
|
|
192
|
+
analyzePhase({ ts: analyzeTs, node }) {
|
|
193
|
+
const tsModule = analyzeTs;
|
|
194
|
+
if (!tsModule || !node)
|
|
195
|
+
return;
|
|
196
|
+
if (!tsModule.isSourceFile(node))
|
|
197
|
+
return;
|
|
198
|
+
for (const stmt of node.statements) {
|
|
199
|
+
if (tsModule.isImportDeclaration(stmt)) {
|
|
200
|
+
const specifier = stmt.moduleSpecifier?.text;
|
|
201
|
+
if (!specifier)
|
|
202
|
+
continue;
|
|
203
|
+
const isExternal = !specifier.startsWith(".");
|
|
204
|
+
const pkg = isExternal ? extractPackageName(specifier) : undefined;
|
|
205
|
+
const mod = isExternal ? specifier : undefined;
|
|
206
|
+
const clause = stmt.importClause;
|
|
207
|
+
if (!clause)
|
|
208
|
+
continue;
|
|
209
|
+
if (clause.name) {
|
|
210
|
+
importMap.set(clause.name.text, { package: pkg, module: mod });
|
|
211
|
+
}
|
|
212
|
+
if (clause.namedBindings && tsModule.isNamedImports(clause.namedBindings)) {
|
|
213
|
+
for (const el of clause.namedBindings.elements) {
|
|
214
|
+
importMap.set(el.name.text, { package: pkg, module: mod });
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
if (clause.namedBindings && tsModule.isNamespaceImport(clause.namedBindings)) {
|
|
218
|
+
importMap.set(clause.namedBindings.name.text, { package: pkg, module: mod });
|
|
219
|
+
}
|
|
220
|
+
continue;
|
|
221
|
+
}
|
|
222
|
+
if (tsModule.isInterfaceDeclaration(stmt) || tsModule.isTypeAliasDeclaration(stmt)) {
|
|
223
|
+
const name = stmt.name?.text;
|
|
224
|
+
if (name && !importMap.has(name)) {
|
|
225
|
+
importMap.set(name, {});
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
},
|
|
230
|
+
packageLinkPhase({ customElementsManifest }) {
|
|
231
|
+
const localTypeMap = buildLocalTypeMap(customElementsManifest);
|
|
232
|
+
for (const mod of customElementsManifest.modules ?? []) {
|
|
233
|
+
for (const decl of mod.declarations ?? []) {
|
|
234
|
+
addReferences(decl, localTypeMap, importMap);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
// Reset for next run (watch mode)
|
|
238
|
+
importMap = new Map();
|
|
239
|
+
},
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
//# sourceMappingURL=type-references.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type-references.js","sourceRoot":"","sources":["../../src/cem-plugins/type-references.ts"],"names":[],"mappings":"AAAA;;;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CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;oBAC/E,CAAC;oBAED,SAAS;gBACX,CAAC;gBAED,IAAI,QAAQ,CAAC,sBAAsB,CAAC,IAAI,CAAC,IAAI,QAAQ,CAAC,sBAAsB,CAAC,IAAI,CAAC,EAAE,CAAC;oBACnF,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC;oBAC7B,IAAI,IAAI,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;wBACjC,SAAS,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;oBAC1B,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;QAED,gBAAgB,CAAC,EAAE,sBAAsB,EAA2C;YAClF,MAAM,YAAY,GAAG,iBAAiB,CAAC,sBAAsB,CAAC,CAAC;YAE/D,KAAK,MAAM,GAAG,IAAI,sBAAsB,CAAC,OAAO,IAAI,EAAE,EAAE,CAAC;gBACvD,KAAK,MAAM,IAAI,IAAI,GAAG,CAAC,YAAY,IAAI,EAAE,EAAE,CAAC;oBAC1C,aAAa,CAAC,IAAI,EAAE,YAAY,EAAE,SAAS,CAAC,CAAC;gBAC/C,CAAC;YACH,CAAC;YAED,kCAAkC;YAClC,SAAS,GAAG,IAAI,GAAG,EAAE,CAAC;QACxB,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** Emitted when an activation occurs. Canceling the event will prevent activation. */
|
|
2
|
+
export declare class SigveloBeforeActivateEvent extends Event {
|
|
3
|
+
constructor();
|
|
4
|
+
}
|
|
5
|
+
/** Emitted immediately after an activation occurs. */
|
|
6
|
+
export declare class SigveloActivateEvent extends Event {
|
|
7
|
+
constructor();
|
|
8
|
+
}
|
|
9
|
+
/** Emitted when a deactivation occurs. Canceling the event will prevent deactivation. */
|
|
10
|
+
export declare class SigveloBeforeDeactivateEvent extends Event {
|
|
11
|
+
constructor();
|
|
12
|
+
}
|
|
13
|
+
/** Emitted immediately after an activation occurs. */
|
|
14
|
+
export declare class SigveloDeactivateEvent extends Event {
|
|
15
|
+
constructor();
|
|
16
|
+
}
|
|
17
|
+
declare global {
|
|
18
|
+
interface GlobalEventHandlersEventMap {
|
|
19
|
+
"sigvelo-before-activate": SigveloBeforeActivateEvent;
|
|
20
|
+
"sigvelo-activate": SigveloActivateEvent;
|
|
21
|
+
"sigvelo-before-deactivate": SigveloBeforeActivateEvent;
|
|
22
|
+
"sigvelo-deactivate": SigveloDeactivateEvent;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=activate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activate.d.ts","sourceRoot":"","sources":["../../src/events/activate.ts"],"names":[],"mappings":"AAAA,sFAAsF;AACtF,qBAAa,0BAA2B,SAAQ,KAAK;;CAIpD;AAED,sDAAsD;AACtD,qBAAa,oBAAqB,SAAQ,KAAK;;CAI9C;AAED,yFAAyF;AACzF,qBAAa,4BAA6B,SAAQ,KAAK;;CAItD;AAED,sDAAsD;AACtD,qBAAa,sBAAuB,SAAQ,KAAK;;CAIhD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,2BAA2B;QACnC,yBAAyB,EAAE,0BAA0B,CAAC;QACtD,kBAAkB,EAAE,oBAAoB,CAAC;QACzC,2BAA2B,EAAE,0BAA0B,CAAC;QACxD,oBAAoB,EAAE,sBAAsB,CAAC;KAC9C;CACF"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** Emitted when an activation occurs. Canceling the event will prevent activation. */
|
|
2
|
+
export class SigveloBeforeActivateEvent extends Event {
|
|
3
|
+
constructor() {
|
|
4
|
+
super("sigvelo-before-activate", { bubbles: false, cancelable: true, composed: true });
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
/** Emitted immediately after an activation occurs. */
|
|
8
|
+
export class SigveloActivateEvent extends Event {
|
|
9
|
+
constructor() {
|
|
10
|
+
super("sigvelo-activate", { bubbles: false, cancelable: false, composed: true });
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
/** Emitted when a deactivation occurs. Canceling the event will prevent deactivation. */
|
|
14
|
+
export class SigveloBeforeDeactivateEvent extends Event {
|
|
15
|
+
constructor() {
|
|
16
|
+
super("sigvelo-before-deactivate", { bubbles: false, cancelable: true, composed: true });
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
/** Emitted immediately after an activation occurs. */
|
|
20
|
+
export class SigveloDeactivateEvent extends Event {
|
|
21
|
+
constructor() {
|
|
22
|
+
super("sigvelo-deactivate", { bubbles: false, cancelable: false, composed: true });
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=activate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activate.js","sourceRoot":"","sources":["../../src/events/activate.ts"],"names":[],"mappings":"AAAA,sFAAsF;AACtF,MAAM,OAAO,0BAA2B,SAAQ,KAAK;IACnD;QACE,KAAK,CAAC,yBAAyB,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;IACzF,CAAC;CACF;AAED,sDAAsD;AACtD,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IAC7C;QACE,KAAK,CAAC,kBAAkB,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;IACnF,CAAC;CACF;AAED,yFAAyF;AACzF,MAAM,OAAO,4BAA6B,SAAQ,KAAK;IACrD;QACE,KAAK,CAAC,2BAA2B,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;IAC3F,CAAC;CACF;AAED,sDAAsD;AACtD,MAAM,OAAO,sBAAuB,SAAQ,KAAK;IAC/C;QACE,KAAK,CAAC,oBAAoB,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;IACrF,CAAC;CACF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Emitted when an animation such as typing or ticking completes. */
|
|
2
|
+
export declare class SigveloAnimationComplete extends Event {
|
|
3
|
+
constructor();
|
|
4
|
+
}
|
|
5
|
+
declare global {
|
|
6
|
+
interface GlobalEventHandlersEventMap {
|
|
7
|
+
"sigvelo-animation-complete": SigveloAnimationComplete;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=animation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"animation.d.ts","sourceRoot":"","sources":["../../src/events/animation.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,qBAAa,wBAAyB,SAAQ,KAAK;;CAIlD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,2BAA2B;QACnC,4BAA4B,EAAE,wBAAwB,CAAC;KACxD;CACF"}
|