@spectrum-web-components/base 0.0.0-20241209155954

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 (59) hide show
  1. package/README.md +45 -0
  2. package/package.json +123 -0
  3. package/src/Base.d.ts +17 -0
  4. package/src/Base.dev.js +174 -0
  5. package/src/Base.dev.js.map +7 -0
  6. package/src/Base.js +2 -0
  7. package/src/Base.js.map +7 -0
  8. package/src/async-directive.d.ts +1 -0
  9. package/src/async-directive.dev.js +3 -0
  10. package/src/async-directive.dev.js.map +7 -0
  11. package/src/async-directive.js +2 -0
  12. package/src/async-directive.js.map +7 -0
  13. package/src/condition-attribute-with-id.d.ts +2 -0
  14. package/src/condition-attribute-with-id.dev.js +27 -0
  15. package/src/condition-attribute-with-id.dev.js.map +7 -0
  16. package/src/condition-attribute-with-id.js +2 -0
  17. package/src/condition-attribute-with-id.js.map +7 -0
  18. package/src/decorators.d.ts +1 -0
  19. package/src/decorators.dev.js +3 -0
  20. package/src/decorators.dev.js.map +7 -0
  21. package/src/decorators.js +2 -0
  22. package/src/decorators.js.map +7 -0
  23. package/src/define-element.d.ts +5 -0
  24. package/src/define-element.dev.js +14 -0
  25. package/src/define-element.dev.js.map +7 -0
  26. package/src/define-element.js +2 -0
  27. package/src/define-element.js.map +7 -0
  28. package/src/directive.d.ts +1 -0
  29. package/src/directive.dev.js +3 -0
  30. package/src/directive.dev.js.map +7 -0
  31. package/src/directive.js +2 -0
  32. package/src/directive.js.map +7 -0
  33. package/src/directives.d.ts +12 -0
  34. package/src/directives.dev.js +12 -0
  35. package/src/directives.dev.js.map +7 -0
  36. package/src/directives.js +2 -0
  37. package/src/directives.js.map +7 -0
  38. package/src/html.d.ts +1 -0
  39. package/src/html.dev.js +3 -0
  40. package/src/html.dev.js.map +7 -0
  41. package/src/html.js +2 -0
  42. package/src/html.js.map +7 -0
  43. package/src/index.d.ts +3 -0
  44. package/src/index.dev.js +5 -0
  45. package/src/index.dev.js.map +7 -0
  46. package/src/index.js +2 -0
  47. package/src/index.js.map +7 -0
  48. package/src/sizedMixin.d.ts +17 -0
  49. package/src/sizedMixin.dev.js +61 -0
  50. package/src/sizedMixin.dev.js.map +7 -0
  51. package/src/sizedMixin.js +2 -0
  52. package/src/sizedMixin.js.map +7 -0
  53. package/src/streaming-listener.d.ts +48 -0
  54. package/src/streaming-listener.dev.js +133 -0
  55. package/src/streaming-listener.dev.js.map +7 -0
  56. package/src/streaming-listener.js +2 -0
  57. package/src/streaming-listener.js.map +7 -0
  58. package/src/version.d.ts +12 -0
  59. package/src/version.js +2 -0
package/README.md ADDED
@@ -0,0 +1,45 @@
1
+ ## Description
2
+
3
+ The `SpectrumElement` base class as created by mixing `SpectrumMixin` onto `LitElement` adopts `dir` values from the `document` at connection time with a fallback to `lrt`. In a TypeScript context, it also enforces the presence of `this.shadowRoot` on extending components.
4
+
5
+ ### Usage
6
+
7
+ [![See it on NPM!](https://img.shields.io/npm/v/@spectrum-web-components/base?style=for-the-badge)](https://www.npmjs.com/package/@spectrum-web-components/base)
8
+ [![How big is this package in your project?](https://img.shields.io/bundlephobia/minzip/@spectrum-web-components/base?style=for-the-badge)](https://bundlephobia.com/result?p=@spectrum-web-components/base)
9
+
10
+ ```
11
+ yarn add @spectrum-web-components/base
12
+ ```
13
+
14
+ When looking to leverage the `SpectrumElement` base class as a type and/or for extension purposes, do so via:
15
+
16
+ ```
17
+ import { SpectrumElement } from '@spectrum-web-components/base';
18
+
19
+ export MyElement extends SpectrumElement {}
20
+
21
+ ```
22
+
23
+ Similarly the `SpectrumMixin` class factory mixin is available via:
24
+
25
+ ```
26
+ import { SpectrumMixin } from '@spectrum-web-components/base';
27
+
28
+ export MyElement extends SpectrumMixin(HTMLElement) {}
29
+ ```
30
+
31
+ ### Features
32
+
33
+ #### `dir` management
34
+
35
+ With powerful CSS selectors like `:host(:dir(rtl))` and `:host-content([dir=rtl])` not yet enjoying cross-browser support, reliably delivering content in both "left to right" and "right to left" while relying on Shadow DOM means certain trade offs need to be made. While every custom element build from `SpectrumMixin` could have its `dir` attribute applied to manage this, doing so is not only a pain for apply, it's a pain to maintain over time. To support the flexibility to deliver content in both of these directions, elements built from `SpectrumMixin` will observe the `dir` attribute of either the `document` or a containing `sp-theme`. This will allow your sites and applications to manage content direction in a single place while also opening the possibility of having multiple content directions on the same page by scoping those content sections with `sp-theme` elements.
36
+
37
+ Placing a `dir` attribute on an element built from `SpectrumMixin` before attaching it to the DOM will prevent it from resolving the text direction value to a parent `sp-theme` or `document` element. Elements applied to the page in this way will also NOT participate in observing any such elements, so their `dir` values will remain as initialized regardless of changes in other parts of your documents. If you choose to leverage this, be aware that any child (in both light DOM and shadow DOM) of this element will need to have a `dir` attribute applied as well if you do not want it resolving to a parent `sp-theme` or `document` element itself. In this way, it is likely that you would benefit from leveraging an `sp-theme` element to create scope in your document for managing this custom content direction section of your page.
38
+
39
+ #### `isLTR`
40
+
41
+ While CSS offers many powerful solutions for styling content in various directions, sometimes JS functionality depends on the specific of that direction. Elements built from `SpectrumMixin` have the `this.isLTR` getter that will resolve to `true` when `dir === 'ltr'`.
42
+
43
+ #### public shadowRoot!: ShadowRoot;
44
+
45
+ Elements built from `SpectrumMixin` assume that you will be using shadow DOM in the resulting custom element. To simplify TypeScript usage the presence of `this.shadowRoot` is asserted as non-null so that you have direct access to it without extended type checking.
package/package.json ADDED
@@ -0,0 +1,123 @@
1
+ {
2
+ "name": "@spectrum-web-components/base",
3
+ "version": "0.0.0-20241209155954",
4
+ "publishConfig": {
5
+ "access": "public"
6
+ },
7
+ "description": "",
8
+ "license": "Apache-2.0",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/adobe/spectrum-web-components.git",
12
+ "directory": "tools/base"
13
+ },
14
+ "author": "",
15
+ "homepage": "https://opensource.adobe.com/spectrum-web-components/tools/base",
16
+ "bugs": {
17
+ "url": "https://github.com/adobe/spectrum-web-components/issues"
18
+ },
19
+ "main": "./src/index.js",
20
+ "module": "./src/index.js",
21
+ "type": "module",
22
+ "exports": {
23
+ ".": {
24
+ "development": "./src/index.dev.js",
25
+ "default": "./src/index.js"
26
+ },
27
+ "./package.json": "./package.json",
28
+ "./src/Base.js": {
29
+ "development": "./src/Base.dev.js",
30
+ "default": "./src/Base.js"
31
+ },
32
+ "./src/async-directive.js": {
33
+ "development": "./src/async-directive.dev.js",
34
+ "default": "./src/async-directive.js"
35
+ },
36
+ "./src/condition-attribute-with-id.js": {
37
+ "development": "./src/condition-attribute-with-id.dev.js",
38
+ "default": "./src/condition-attribute-with-id.js"
39
+ },
40
+ "./src/decorators.js": {
41
+ "development": "./src/decorators.dev.js",
42
+ "default": "./src/decorators.js"
43
+ },
44
+ "./src/define-element.js": {
45
+ "development": "./src/define-element.dev.js",
46
+ "default": "./src/define-element.js"
47
+ },
48
+ "./src/directive.js": {
49
+ "development": "./src/directive.dev.js",
50
+ "default": "./src/directive.js"
51
+ },
52
+ "./src/directives.js": {
53
+ "development": "./src/directives.dev.js",
54
+ "default": "./src/directives.js"
55
+ },
56
+ "./src/html.js": {
57
+ "development": "./src/html.dev.js",
58
+ "default": "./src/html.js"
59
+ },
60
+ "./src/index.js": {
61
+ "development": "./src/index.dev.js",
62
+ "default": "./src/index.js"
63
+ },
64
+ "./src/sizedMixin.js": {
65
+ "development": "./src/sizedMixin.dev.js",
66
+ "default": "./src/sizedMixin.js"
67
+ },
68
+ "./src/streaming-listener.js": {
69
+ "development": "./src/streaming-listener.dev.js",
70
+ "default": "./src/streaming-listener.js"
71
+ },
72
+ "./src/version.js": "./src/version.js",
73
+ "./condition-attribute-with-id.js": {
74
+ "development": "./condition-attribute-with-id.dev.js",
75
+ "default": "./condition-attribute-with-id.js"
76
+ },
77
+ "./decorators.js": {
78
+ "development": "./decorators.dev.js",
79
+ "default": "./decorators.js"
80
+ },
81
+ "./directives.js": {
82
+ "development": "./directives.dev.js",
83
+ "default": "./directives.js"
84
+ },
85
+ "./directive.js": {
86
+ "development": "./directive.dev.js",
87
+ "default": "./directive.js"
88
+ },
89
+ "./html.js": {
90
+ "development": "./html.dev.js",
91
+ "default": "./html.js"
92
+ },
93
+ "./streaming-listener.js": {
94
+ "development": "./streaming-listener.dev.js",
95
+ "default": "./streaming-listener.js"
96
+ }
97
+ },
98
+ "scripts": {
99
+ "test": "karma start --coverage"
100
+ },
101
+ "files": [
102
+ "**/*.d.ts",
103
+ "**/*.js",
104
+ "**/*.js.map",
105
+ "custom-elements.json",
106
+ "!stories/",
107
+ "!test/"
108
+ ],
109
+ "keywords": [
110
+ "spectrum css",
111
+ "web components",
112
+ "lit-element",
113
+ "lit-html"
114
+ ],
115
+ "dependencies": {
116
+ "lit": "^2.5.0 || ^3.1.3"
117
+ },
118
+ "types": "./src/index.d.ts",
119
+ "customElements": "custom-elements.json",
120
+ "sideEffects": [
121
+ "./**/*.dev.js"
122
+ ]
123
+ }
package/src/Base.d.ts ADDED
@@ -0,0 +1,17 @@
1
+ import { LitElement, ReactiveElement } from 'lit';
2
+ type Constructor<T = Record<string, unknown>> = {
3
+ new (...args: any[]): T;
4
+ prototype: T;
5
+ };
6
+ export interface SpectrumInterface {
7
+ shadowRoot: ShadowRoot;
8
+ isLTR: boolean;
9
+ hasVisibleFocusInTree(): boolean;
10
+ dir: 'ltr' | 'rtl';
11
+ }
12
+ export declare function SpectrumMixin<T extends Constructor<ReactiveElement>>(constructor: T): T & Constructor<SpectrumInterface>;
13
+ declare const SpectrumElement_base: typeof LitElement & Constructor<SpectrumInterface>;
14
+ export declare class SpectrumElement extends SpectrumElement_base {
15
+ static VERSION: string;
16
+ }
17
+ export {};
@@ -0,0 +1,174 @@
1
+ "use strict";
2
+ var _a, _b, _c;
3
+ import { LitElement } from "lit";
4
+ import { version } from "@spectrum-web-components/base/src/version.js";
5
+ const observedForElements = /* @__PURE__ */ new Set();
6
+ const updateRTL = () => {
7
+ const dir = document.documentElement.dir === "rtl" ? document.documentElement.dir : "ltr";
8
+ observedForElements.forEach((el) => {
9
+ el.setAttribute("dir", dir);
10
+ });
11
+ };
12
+ const rtlObserver = new MutationObserver(updateRTL);
13
+ rtlObserver.observe(document.documentElement, {
14
+ attributes: true,
15
+ attributeFilter: ["dir"]
16
+ });
17
+ const canManageContentDirection = (el) => typeof el.startManagingContentDirection !== "undefined" || el.tagName === "SP-THEME";
18
+ export function SpectrumMixin(constructor) {
19
+ class SpectrumMixinElement extends constructor {
20
+ /**
21
+ * @private
22
+ */
23
+ get isLTR() {
24
+ return this.dir === "ltr";
25
+ }
26
+ hasVisibleFocusInTree() {
27
+ const getAncestors = (root = document) => {
28
+ var _a2;
29
+ let currentNode = root.activeElement;
30
+ while ((currentNode == null ? void 0 : currentNode.shadowRoot) && currentNode.shadowRoot.activeElement) {
31
+ currentNode = currentNode.shadowRoot.activeElement;
32
+ }
33
+ const ancestors = currentNode ? [currentNode] : [];
34
+ while (currentNode) {
35
+ const ancestor = currentNode.assignedSlot || currentNode.parentElement || ((_a2 = currentNode.getRootNode()) == null ? void 0 : _a2.host);
36
+ if (ancestor) {
37
+ ancestors.push(ancestor);
38
+ }
39
+ currentNode = ancestor;
40
+ }
41
+ return ancestors;
42
+ };
43
+ const activeElement = getAncestors(
44
+ this.getRootNode()
45
+ )[0];
46
+ if (!activeElement) {
47
+ return false;
48
+ }
49
+ try {
50
+ return activeElement.matches(":focus-visible") || activeElement.matches(".focus-visible");
51
+ } catch (error) {
52
+ return activeElement.matches(".focus-visible");
53
+ }
54
+ }
55
+ connectedCallback() {
56
+ if (!this.hasAttribute("dir")) {
57
+ let dirParent = this.assignedSlot || this.parentNode;
58
+ while (dirParent !== document.documentElement && !canManageContentDirection(
59
+ dirParent
60
+ )) {
61
+ dirParent = dirParent.assignedSlot || // step into the shadow DOM of the parent of a slotted node
62
+ dirParent.parentNode || // DOM Element detected
63
+ dirParent.host;
64
+ }
65
+ this.dir = dirParent.dir === "rtl" ? dirParent.dir : this.dir || "ltr";
66
+ if (dirParent === document.documentElement) {
67
+ observedForElements.add(this);
68
+ } else {
69
+ const { localName } = dirParent;
70
+ if (localName.search("-") > -1 && !customElements.get(localName)) {
71
+ customElements.whenDefined(localName).then(() => {
72
+ dirParent.startManagingContentDirection(this);
73
+ });
74
+ } else {
75
+ dirParent.startManagingContentDirection(
76
+ this
77
+ );
78
+ }
79
+ }
80
+ this._dirParent = dirParent;
81
+ }
82
+ super.connectedCallback();
83
+ }
84
+ disconnectedCallback() {
85
+ super.disconnectedCallback();
86
+ if (this._dirParent) {
87
+ if (this._dirParent === document.documentElement) {
88
+ observedForElements.delete(this);
89
+ } else {
90
+ this._dirParent.stopManagingContentDirection(
91
+ this
92
+ );
93
+ }
94
+ this.removeAttribute("dir");
95
+ }
96
+ }
97
+ }
98
+ return SpectrumMixinElement;
99
+ }
100
+ export class SpectrumElement extends SpectrumMixin(LitElement) {
101
+ }
102
+ SpectrumElement.VERSION = version;
103
+ if (true) {
104
+ const ignoreWarningTypes = {
105
+ default: false,
106
+ accessibility: false,
107
+ api: false
108
+ };
109
+ const ignoreWarningLevels = {
110
+ default: false,
111
+ low: false,
112
+ medium: false,
113
+ high: false,
114
+ deprecation: false
115
+ };
116
+ window.__swc = {
117
+ ...window.__swc,
118
+ ignoreWarningLocalNames: {
119
+ /* c8 ignore next 1 */
120
+ ...((_a = window.__swc) == null ? void 0 : _a.ignoreWarningLocalNames) || {}
121
+ },
122
+ ignoreWarningTypes: {
123
+ ...ignoreWarningTypes,
124
+ /* c8 ignore next 1 */
125
+ ...((_b = window.__swc) == null ? void 0 : _b.ignoreWarningTypes) || {}
126
+ },
127
+ ignoreWarningLevels: {
128
+ ...ignoreWarningLevels,
129
+ /* c8 ignore next 1 */
130
+ ...((_c = window.__swc) == null ? void 0 : _c.ignoreWarningLevels) || {}
131
+ },
132
+ issuedWarnings: /* @__PURE__ */ new Set(),
133
+ warn: (element, message, url, { type = "api", level = "default", issues } = {}) => {
134
+ const { localName = "base" } = element || {};
135
+ const id = `${localName}:${type}:${level}`;
136
+ if (!window.__swc.verbose && window.__swc.issuedWarnings.has(id))
137
+ return;
138
+ if (window.__swc.ignoreWarningLocalNames[localName]) return;
139
+ if (window.__swc.ignoreWarningTypes[type]) return;
140
+ if (window.__swc.ignoreWarningLevels[level]) return;
141
+ window.__swc.issuedWarnings.add(id);
142
+ let listedIssues = "";
143
+ if (issues && issues.length) {
144
+ issues.unshift("");
145
+ listedIssues = issues.join("\n - ") + "\n";
146
+ }
147
+ const intro = level === "deprecation" ? "DEPRECATION NOTICE: " : "";
148
+ const inspectElement = element ? "\nInspect this issue in the follow element:" : "";
149
+ const displayURL = (element ? "\n\n" : "\n") + url + "\n";
150
+ const messages = [];
151
+ messages.push(
152
+ intro + message + "\n" + listedIssues + inspectElement
153
+ );
154
+ if (element) {
155
+ messages.push(element);
156
+ }
157
+ messages.push(displayURL, {
158
+ data: {
159
+ localName,
160
+ type,
161
+ level
162
+ }
163
+ });
164
+ console.warn(...messages);
165
+ }
166
+ };
167
+ window.__swc.warn(
168
+ void 0,
169
+ "Spectrum Web Components is in dev mode. Not recommended for production!",
170
+ "https://opensource.adobe.com/spectrum-web-components/dev-mode/",
171
+ { type: "default" }
172
+ );
173
+ }
174
+ //# sourceMappingURL=Base.dev.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["Base.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport { LitElement, ReactiveElement } from 'lit';\nimport { version } from '@spectrum-web-components/base/src/version.js';\ntype ThemeRoot = HTMLElement & {\n startManagingContentDirection: (el: HTMLElement) => void;\n stopManagingContentDirection: (el: HTMLElement) => void;\n};\n\ntype Constructor<T = Record<string, unknown>> = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n new (...args: any[]): T;\n prototype: T;\n};\n\nexport interface SpectrumInterface {\n shadowRoot: ShadowRoot;\n isLTR: boolean;\n hasVisibleFocusInTree(): boolean;\n dir: 'ltr' | 'rtl';\n}\n\nconst observedForElements: Set<HTMLElement> = new Set();\n\nconst updateRTL = (): void => {\n const dir =\n document.documentElement.dir === 'rtl'\n ? document.documentElement.dir\n : 'ltr';\n observedForElements.forEach((el) => {\n el.setAttribute('dir', dir);\n });\n};\n\nconst rtlObserver = new MutationObserver(updateRTL);\n\nrtlObserver.observe(document.documentElement, {\n attributes: true,\n attributeFilter: ['dir'],\n});\n\ntype ContentDirectionManager = HTMLElement & {\n startManagingContentDirection?(): void;\n};\n\nconst canManageContentDirection = (el: ContentDirectionManager): boolean =>\n typeof el.startManagingContentDirection !== 'undefined' ||\n el.tagName === 'SP-THEME';\n\nexport function SpectrumMixin<T extends Constructor<ReactiveElement>>(\n constructor: T\n): T & Constructor<SpectrumInterface> {\n class SpectrumMixinElement extends constructor {\n /**\n * @private\n */\n public override shadowRoot!: ShadowRoot;\n private _dirParent?: HTMLElement;\n\n /**\n * @private\n */\n public override dir!: 'ltr' | 'rtl';\n\n /**\n * @private\n */\n public get isLTR(): boolean {\n return this.dir === 'ltr';\n }\n\n public hasVisibleFocusInTree(): boolean {\n const getAncestors = (root: Document = document): HTMLElement[] => {\n // eslint-disable-next-line @spectrum-web-components/document-active-element\n let currentNode = root.activeElement as HTMLElement;\n while (\n currentNode?.shadowRoot &&\n currentNode.shadowRoot.activeElement\n ) {\n currentNode = currentNode.shadowRoot\n .activeElement as HTMLElement;\n }\n const ancestors: HTMLElement[] = currentNode\n ? [currentNode]\n : [];\n while (currentNode) {\n const ancestor =\n currentNode.assignedSlot ||\n currentNode.parentElement ||\n (currentNode.getRootNode() as ShadowRoot)?.host;\n if (ancestor) {\n ancestors.push(ancestor as HTMLElement);\n }\n currentNode = ancestor as HTMLElement;\n }\n return ancestors;\n };\n const activeElement = getAncestors(\n this.getRootNode() as Document\n )[0];\n if (!activeElement) {\n return false;\n }\n // Browsers without support for the `:focus-visible`\n // selector will throw on the following test (Safari, older things).\n // Some won't throw, but will be focusing item rather than the menu and\n // will rely on the polyfill to know whether focus is \"visible\" or not.\n try {\n return (\n activeElement.matches(':focus-visible') ||\n activeElement.matches('.focus-visible')\n );\n /* c8 ignore next 3 */\n } catch (error) {\n return activeElement.matches('.focus-visible');\n }\n }\n\n public override connectedCallback(): void {\n if (!this.hasAttribute('dir')) {\n let dirParent = ((this as HTMLElement).assignedSlot ||\n this.parentNode) as HTMLElement;\n while (\n dirParent !== document.documentElement &&\n !canManageContentDirection(\n dirParent as ContentDirectionManager\n )\n ) {\n dirParent = ((dirParent as HTMLElement).assignedSlot || // step into the shadow DOM of the parent of a slotted node\n dirParent.parentNode || // DOM Element detected\n (dirParent as unknown as ShadowRoot)\n .host) as HTMLElement;\n }\n this.dir =\n dirParent.dir === 'rtl' ? dirParent.dir : this.dir || 'ltr';\n if (dirParent === document.documentElement) {\n observedForElements.add(this);\n } else {\n const { localName } = dirParent;\n if (\n localName.search('-') > -1 &&\n !customElements.get(localName)\n ) {\n /* c8 ignore next 5 */\n customElements.whenDefined(localName).then(() => {\n (\n dirParent as ThemeRoot\n ).startManagingContentDirection(this);\n });\n } else {\n (dirParent as ThemeRoot).startManagingContentDirection(\n this\n );\n }\n }\n this._dirParent = dirParent as HTMLElement;\n }\n super.connectedCallback();\n }\n\n public override disconnectedCallback(): void {\n super.disconnectedCallback();\n if (this._dirParent) {\n if (this._dirParent === document.documentElement) {\n observedForElements.delete(this);\n } else {\n (this._dirParent as ThemeRoot).stopManagingContentDirection(\n this\n );\n }\n this.removeAttribute('dir');\n }\n }\n }\n return SpectrumMixinElement;\n}\n\nexport class SpectrumElement extends SpectrumMixin(LitElement) {\n static VERSION = version;\n}\n\nif (window.__swc.DEBUG) {\n const ignoreWarningTypes = {\n default: false,\n accessibility: false,\n api: false,\n };\n const ignoreWarningLevels = {\n default: false,\n low: false,\n medium: false,\n high: false,\n deprecation: false,\n };\n window.__swc = {\n ...window.__swc,\n ignoreWarningLocalNames: {\n /* c8 ignore next 1 */\n ...(window.__swc?.ignoreWarningLocalNames || {}),\n },\n ignoreWarningTypes: {\n ...ignoreWarningTypes,\n /* c8 ignore next 1 */\n ...(window.__swc?.ignoreWarningTypes || {}),\n },\n ignoreWarningLevels: {\n ...ignoreWarningLevels,\n /* c8 ignore next 1 */\n ...(window.__swc?.ignoreWarningLevels || {}),\n },\n issuedWarnings: new Set(),\n warn: (\n element,\n message,\n url,\n { type = 'api', level = 'default', issues } = {}\n ): void => {\n const { localName = 'base' } = element || {};\n const id = `${localName}:${type}:${level}` as BrandedSWCWarningID;\n if (!window.__swc.verbose && window.__swc.issuedWarnings.has(id))\n return;\n /* c8 ignore next 3 */\n if (window.__swc.ignoreWarningLocalNames[localName]) return;\n if (window.__swc.ignoreWarningTypes[type]) return;\n if (window.__swc.ignoreWarningLevels[level]) return;\n window.__swc.issuedWarnings.add(id);\n let listedIssues = '';\n if (issues && issues.length) {\n issues.unshift('');\n listedIssues = issues.join('\\n - ') + '\\n';\n }\n const intro = level === 'deprecation' ? 'DEPRECATION NOTICE: ' : '';\n const inspectElement = element\n ? '\\nInspect this issue in the follow element:'\n : '';\n const displayURL = (element ? '\\n\\n' : '\\n') + url + '\\n';\n const messages: unknown[] = [];\n messages.push(\n intro + message + '\\n' + listedIssues + inspectElement\n );\n if (element) {\n messages.push(element);\n }\n messages.push(displayURL, {\n data: {\n localName,\n type,\n level,\n },\n });\n console.warn(...messages);\n },\n };\n\n window.__swc.warn(\n undefined,\n 'Spectrum Web Components is in dev mode. Not recommended for production!',\n 'https://opensource.adobe.com/spectrum-web-components/dev-mode/',\n { type: 'default' }\n );\n}\n"],
5
+ "mappings": ";AAAA;AAYA,SAAS,kBAAmC;AAC5C,SAAS,eAAe;AAmBxB,MAAM,sBAAwC,oBA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BAAS,KAAK,OAAO;AAAA,MACzB;AACA,eAAS,KAAK,YAAY;AAAA,QACtB,MAAM;AAAA,UACF;AAAA,UACA;AAAA,UACA;AAAA,QACJ;AAAA,MACJ,CAAC;AACD,cAAQ,KAAK,GAAG,QAAQ;AAAA,IAC5B;AAAA,EACJ;AAEA,SAAO,MAAM;AAAA,IACT;AAAA,IACA;AAAA,IACA;AAAA,IACA,EAAE,MAAM,UAAU;AAAA,EACtB;AACJ;",
6
+ "names": ["_a"]
7
+ }
package/src/Base.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";import{LitElement as m}from"lit";import{version as u}from"@spectrum-web-components/base/src/version.js";const c=new Set,g=()=>{const s=document.documentElement.dir==="rtl"?document.documentElement.dir:"ltr";c.forEach(o=>{o.setAttribute("dir",s)})},w=new MutationObserver(g);w.observe(document.documentElement,{attributes:!0,attributeFilter:["dir"]});const p=s=>typeof s.startManagingContentDirection!="undefined"||s.tagName==="SP-THEME";export function SpectrumMixin(s){class o extends s{get isLTR(){return this.dir==="ltr"}hasVisibleFocusInTree(){const n=((r=document)=>{var l;let t=r.activeElement;for(;t!=null&&t.shadowRoot&&t.shadowRoot.activeElement;)t=t.shadowRoot.activeElement;const a=t?[t]:[];for(;t;){const i=t.assignedSlot||t.parentElement||((l=t.getRootNode())==null?void 0:l.host);i&&a.push(i),t=i}return a})(this.getRootNode())[0];if(!n)return!1;try{return n.matches(":focus-visible")||n.matches(".focus-visible")}catch(r){return n.matches(".focus-visible")}}connectedCallback(){if(!this.hasAttribute("dir")){let e=this.assignedSlot||this.parentNode;for(;e!==document.documentElement&&!p(e);)e=e.assignedSlot||e.parentNode||e.host;if(this.dir=e.dir==="rtl"?e.dir:this.dir||"ltr",e===document.documentElement)c.add(this);else{const{localName:n}=e;n.search("-")>-1&&!customElements.get(n)?customElements.whenDefined(n).then(()=>{e.startManagingContentDirection(this)}):e.startManagingContentDirection(this)}this._dirParent=e}super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback(),this._dirParent&&(this._dirParent===document.documentElement?c.delete(this):this._dirParent.stopManagingContentDirection(this),this.removeAttribute("dir"))}}return o}export class SpectrumElement extends SpectrumMixin(m){}SpectrumElement.VERSION=u;
2
+ //# sourceMappingURL=Base.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["Base.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport { LitElement, ReactiveElement } from 'lit';\nimport { version } from '@spectrum-web-components/base/src/version.js';\ntype ThemeRoot = HTMLElement & {\n startManagingContentDirection: (el: HTMLElement) => void;\n stopManagingContentDirection: (el: HTMLElement) => void;\n};\n\ntype Constructor<T = Record<string, unknown>> = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n new (...args: any[]): T;\n prototype: T;\n};\n\nexport interface SpectrumInterface {\n shadowRoot: ShadowRoot;\n isLTR: boolean;\n hasVisibleFocusInTree(): boolean;\n dir: 'ltr' | 'rtl';\n}\n\nconst observedForElements: Set<HTMLElement> = new Set();\n\nconst updateRTL = (): void => {\n const dir =\n document.documentElement.dir === 'rtl'\n ? document.documentElement.dir\n : 'ltr';\n observedForElements.forEach((el) => {\n el.setAttribute('dir', dir);\n });\n};\n\nconst rtlObserver = new MutationObserver(updateRTL);\n\nrtlObserver.observe(document.documentElement, {\n attributes: true,\n attributeFilter: ['dir'],\n});\n\ntype ContentDirectionManager = HTMLElement & {\n startManagingContentDirection?(): void;\n};\n\nconst canManageContentDirection = (el: ContentDirectionManager): boolean =>\n typeof el.startManagingContentDirection !== 'undefined' ||\n el.tagName === 'SP-THEME';\n\nexport function SpectrumMixin<T extends Constructor<ReactiveElement>>(\n constructor: T\n): T & Constructor<SpectrumInterface> {\n class SpectrumMixinElement extends constructor {\n /**\n * @private\n */\n public override shadowRoot!: ShadowRoot;\n private _dirParent?: HTMLElement;\n\n /**\n * @private\n */\n public override dir!: 'ltr' | 'rtl';\n\n /**\n * @private\n */\n public get isLTR(): boolean {\n return this.dir === 'ltr';\n }\n\n public hasVisibleFocusInTree(): boolean {\n const getAncestors = (root: Document = document): HTMLElement[] => {\n // eslint-disable-next-line @spectrum-web-components/document-active-element\n let currentNode = root.activeElement as HTMLElement;\n while (\n currentNode?.shadowRoot &&\n currentNode.shadowRoot.activeElement\n ) {\n currentNode = currentNode.shadowRoot\n .activeElement as HTMLElement;\n }\n const ancestors: HTMLElement[] = currentNode\n ? [currentNode]\n : [];\n while (currentNode) {\n const ancestor =\n currentNode.assignedSlot ||\n currentNode.parentElement ||\n (currentNode.getRootNode() as ShadowRoot)?.host;\n if (ancestor) {\n ancestors.push(ancestor as HTMLElement);\n }\n currentNode = ancestor as HTMLElement;\n }\n return ancestors;\n };\n const activeElement = getAncestors(\n this.getRootNode() as Document\n )[0];\n if (!activeElement) {\n return false;\n }\n // Browsers without support for the `:focus-visible`\n // selector will throw on the following test (Safari, older things).\n // Some won't throw, but will be focusing item rather than the menu and\n // will rely on the polyfill to know whether focus is \"visible\" or not.\n try {\n return (\n activeElement.matches(':focus-visible') ||\n activeElement.matches('.focus-visible')\n );\n /* c8 ignore next 3 */\n } catch (error) {\n return activeElement.matches('.focus-visible');\n }\n }\n\n public override connectedCallback(): void {\n if (!this.hasAttribute('dir')) {\n let dirParent = ((this as HTMLElement).assignedSlot ||\n this.parentNode) as HTMLElement;\n while (\n dirParent !== document.documentElement &&\n !canManageContentDirection(\n dirParent as ContentDirectionManager\n )\n ) {\n dirParent = ((dirParent as HTMLElement).assignedSlot || // step into the shadow DOM of the parent of a slotted node\n dirParent.parentNode || // DOM Element detected\n (dirParent as unknown as ShadowRoot)\n .host) as HTMLElement;\n }\n this.dir =\n dirParent.dir === 'rtl' ? dirParent.dir : this.dir || 'ltr';\n if (dirParent === document.documentElement) {\n observedForElements.add(this);\n } else {\n const { localName } = dirParent;\n if (\n localName.search('-') > -1 &&\n !customElements.get(localName)\n ) {\n /* c8 ignore next 5 */\n customElements.whenDefined(localName).then(() => {\n (\n dirParent as ThemeRoot\n ).startManagingContentDirection(this);\n });\n } else {\n (dirParent as ThemeRoot).startManagingContentDirection(\n this\n );\n }\n }\n this._dirParent = dirParent as HTMLElement;\n }\n super.connectedCallback();\n }\n\n public override disconnectedCallback(): void {\n super.disconnectedCallback();\n if (this._dirParent) {\n if (this._dirParent === document.documentElement) {\n observedForElements.delete(this);\n } else {\n (this._dirParent as ThemeRoot).stopManagingContentDirection(\n this\n );\n }\n this.removeAttribute('dir');\n }\n }\n }\n return SpectrumMixinElement;\n}\n\nexport class SpectrumElement extends SpectrumMixin(LitElement) {\n static VERSION = version;\n}\n\nif (window.__swc.DEBUG) {\n const ignoreWarningTypes = {\n default: false,\n accessibility: false,\n api: false,\n };\n const ignoreWarningLevels = {\n default: false,\n low: false,\n medium: false,\n high: false,\n deprecation: false,\n };\n window.__swc = {\n ...window.__swc,\n ignoreWarningLocalNames: {\n /* c8 ignore next 1 */\n ...(window.__swc?.ignoreWarningLocalNames || {}),\n },\n ignoreWarningTypes: {\n ...ignoreWarningTypes,\n /* c8 ignore next 1 */\n ...(window.__swc?.ignoreWarningTypes || {}),\n },\n ignoreWarningLevels: {\n ...ignoreWarningLevels,\n /* c8 ignore next 1 */\n ...(window.__swc?.ignoreWarningLevels || {}),\n },\n issuedWarnings: new Set(),\n warn: (\n element,\n message,\n url,\n { type = 'api', level = 'default', issues } = {}\n ): void => {\n const { localName = 'base' } = element || {};\n const id = `${localName}:${type}:${level}` as BrandedSWCWarningID;\n if (!window.__swc.verbose && window.__swc.issuedWarnings.has(id))\n return;\n /* c8 ignore next 3 */\n if (window.__swc.ignoreWarningLocalNames[localName]) return;\n if (window.__swc.ignoreWarningTypes[type]) return;\n if (window.__swc.ignoreWarningLevels[level]) return;\n window.__swc.issuedWarnings.add(id);\n let listedIssues = '';\n if (issues && issues.length) {\n issues.unshift('');\n listedIssues = issues.join('\\n - ') + '\\n';\n }\n const intro = level === 'deprecation' ? 'DEPRECATION NOTICE: ' : '';\n const inspectElement = element\n ? '\\nInspect this issue in the follow element:'\n : '';\n const displayURL = (element ? '\\n\\n' : '\\n') + url + '\\n';\n const messages: unknown[] = [];\n messages.push(\n intro + message + '\\n' + listedIssues + inspectElement\n );\n if (element) {\n messages.push(element);\n }\n messages.push(displayURL, {\n data: {\n localName,\n type,\n level,\n },\n });\n console.warn(...messages);\n },\n };\n\n window.__swc.warn(\n undefined,\n 'Spectrum Web Components is in dev mode. Not recommended for production!',\n 'https://opensource.adobe.com/spectrum-web-components/dev-mode/',\n { type: 'default' }\n );\n}\n"],
5
+ "mappings": "aAYA,OAAS,cAAAA,MAAmC,MAC5C,OAAS,WAAAC,MAAe,+CAmBxB,MAAMC,EAAwC,IAAI,IAE5CC,EAAY,IAAY,CAC1B,MAAMC,EACF,SAAS,gBAAgB,MAAQ,MAC3B,SAAS,gBAAgB,IACzB,MACVF,EAAoB,QAASG,GAAO,CAChCA,EAAG,aAAa,MAAOD,CAAG,CAC9B,CAAC,CACL,EAEME,EAAc,IAAI,iBAAiBH,CAAS,EAElDG,EAAY,QAAQ,SAAS,gBAAiB,CAC1C,WAAY,GACZ,gBAAiB,CAAC,KAAK,CAC3B,CAAC,EAMD,MAAMC,EAA6BF,GAC/B,OAAOA,EAAG,+BAAkC,aAC5CA,EAAG,UAAY,WAEZ,gBAAS,cACZG,EACkC,CAClC,MAAMC,UAA6BD,CAAY,CAe3C,IAAW,OAAiB,CACxB,OAAO,KAAK,MAAQ,KACxB,CAEO,uBAAiC,CA0BpC,MAAME,GAzBe,CAACC,EAAiB,WAA4B,CAlF/E,IAAAC,EAoFgB,IAAIC,EAAcF,EA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,KAAK,gBAAgB,KAAK,EAElC,CACJ,CACA,OAAOO,CACX,CAEO,aAAM,wBAAwB,cAAcT,CAAU,CAAE,CAE/D,CAFa,gBACF,QAAUC",
6
+ "names": ["LitElement", "version", "observedForElements", "updateRTL", "dir", "el", "rtlObserver", "canManageContentDirection", "constructor", "SpectrumMixinElement", "activeElement", "root", "_a", "currentNode", "ancestors", "ancestor", "error", "dirParent", "localName"]
7
+ }
@@ -0,0 +1 @@
1
+ export * from 'lit/async-directive.js';
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ export * from "lit/async-directive.js";
3
+ //# sourceMappingURL=async-directive.dev.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["async-directive.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nexport * from 'lit/async-directive.js';\n"],
5
+ "mappings": ";AAYA,cAAc;",
6
+ "names": []
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";export*from"lit/async-directive.js";
2
+ //# sourceMappingURL=async-directive.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["async-directive.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nexport * from 'lit/async-directive.js';\n"],
5
+ "mappings": "aAYA,WAAc",
6
+ "names": []
7
+ }
@@ -0,0 +1,2 @@
1
+ export declare function conditionAttributeWithoutId(el: HTMLElement, attribute: string, ids: string[]): void;
2
+ export declare function conditionAttributeWithId(el: HTMLElement, attribute: string, id: string | string[]): () => void;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ export function conditionAttributeWithoutId(el, attribute, ids) {
3
+ const ariaDescribedby = el.getAttribute(attribute);
4
+ let descriptors = ariaDescribedby ? ariaDescribedby.split(/\s+/) : [];
5
+ descriptors = descriptors.filter(
6
+ (descriptor) => !ids.find((id) => descriptor === id)
7
+ );
8
+ if (descriptors.length) {
9
+ el.setAttribute(attribute, descriptors.join(" "));
10
+ } else {
11
+ el.removeAttribute(attribute);
12
+ }
13
+ }
14
+ export function conditionAttributeWithId(el, attribute, id) {
15
+ const ids = Array.isArray(id) ? id : [id];
16
+ const ariaDescribedby = el.getAttribute(attribute);
17
+ const descriptors = ariaDescribedby ? ariaDescribedby.split(/\s+/) : [];
18
+ const hadIds = ids.every((id2) => descriptors.indexOf(id2) > -1);
19
+ if (hadIds)
20
+ return () => {
21
+ return;
22
+ };
23
+ descriptors.push(...ids);
24
+ el.setAttribute(attribute, descriptors.join(" "));
25
+ return () => conditionAttributeWithoutId(el, attribute, ids);
26
+ }
27
+ //# sourceMappingURL=condition-attribute-with-id.dev.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["condition-attribute-with-id.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nexport function conditionAttributeWithoutId(\n el: HTMLElement,\n attribute: string,\n ids: string[]\n): void {\n const ariaDescribedby = el.getAttribute(attribute);\n let descriptors = ariaDescribedby ? ariaDescribedby.split(/\\s+/) : [];\n descriptors = descriptors.filter(\n (descriptor) => !ids.find((id) => descriptor === id)\n );\n if (descriptors.length) {\n el.setAttribute(attribute, descriptors.join(' '));\n } else {\n el.removeAttribute(attribute);\n }\n}\n\nexport function conditionAttributeWithId(\n el: HTMLElement,\n attribute: string,\n id: string | string[]\n): () => void {\n const ids = Array.isArray(id) ? id : [id];\n const ariaDescribedby = el.getAttribute(attribute);\n const descriptors = ariaDescribedby ? ariaDescribedby.split(/\\s+/) : [];\n const hadIds = ids.every((id) => descriptors.indexOf(id) > -1);\n if (hadIds)\n /* c8 ignore next 3 */\n return (): void => {\n return;\n };\n descriptors.push(...ids);\n el.setAttribute(attribute, descriptors.join(' '));\n return () => conditionAttributeWithoutId(el, attribute, ids);\n}\n"],
5
+ "mappings": ";AAYO,gBAAS,4BACZ,IACA,WACA,KACI;AACJ,QAAM,kBAAkB,GAAG,aAAa,SAAS;AACjD,MAAI,cAAc,kBAAkB,gBAAgB,MAAM,KAAK,IAAI,CAAC;AACpE,gBAAc,YAAY;AAAA,IACtB,CAAC,eAAe,CAAC,IAAI,KAAK,CAAC,OAAO,eAAe,EAAE;AAAA,EACvD;AACA,MAAI,YAAY,QAAQ;AACpB,OAAG,aAAa,WAAW,YAAY,KAAK,GAAG,CAAC;AAAA,EACpD,OAAO;AACH,OAAG,gBAAgB,SAAS;AAAA,EAChC;AACJ;AAEO,gBAAS,yBACZ,IACA,WACA,IACU;AACV,QAAM,MAAM,MAAM,QAAQ,EAAE,IAAI,KAAK,CAAC,EAAE;AACxC,QAAM,kBAAkB,GAAG,aAAa,SAAS;AACjD,QAAM,cAAc,kBAAkB,gBAAgB,MAAM,KAAK,IAAI,CAAC;AACtE,QAAM,SAAS,IAAI,MAAM,CAACA,QAAO,YAAY,QAAQA,GAAE,IAAI,EAAE;AAC7D,MAAI;AAEA,WAAO,MAAY;AACf;AAAA,IACJ;AACJ,cAAY,KAAK,GAAG,GAAG;AACvB,KAAG,aAAa,WAAW,YAAY,KAAK,GAAG,CAAC;AAChD,SAAO,MAAM,4BAA4B,IAAI,WAAW,GAAG;AAC/D;",
6
+ "names": ["id"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";export function conditionAttributeWithoutId(t,i,n){const e=t.getAttribute(i);let r=e?e.split(/\s+/):[];r=r.filter(s=>!n.find(o=>s===o)),r.length?t.setAttribute(i,r.join(" ")):t.removeAttribute(i)}export function conditionAttributeWithId(t,i,n){const e=Array.isArray(n)?n:[n],r=t.getAttribute(i),s=r?r.split(/\s+/):[];return e.every(d=>s.indexOf(d)>-1)?()=>{}:(s.push(...e),t.setAttribute(i,s.join(" ")),()=>conditionAttributeWithoutId(t,i,e))}
2
+ //# sourceMappingURL=condition-attribute-with-id.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["condition-attribute-with-id.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nexport function conditionAttributeWithoutId(\n el: HTMLElement,\n attribute: string,\n ids: string[]\n): void {\n const ariaDescribedby = el.getAttribute(attribute);\n let descriptors = ariaDescribedby ? ariaDescribedby.split(/\\s+/) : [];\n descriptors = descriptors.filter(\n (descriptor) => !ids.find((id) => descriptor === id)\n );\n if (descriptors.length) {\n el.setAttribute(attribute, descriptors.join(' '));\n } else {\n el.removeAttribute(attribute);\n }\n}\n\nexport function conditionAttributeWithId(\n el: HTMLElement,\n attribute: string,\n id: string | string[]\n): () => void {\n const ids = Array.isArray(id) ? id : [id];\n const ariaDescribedby = el.getAttribute(attribute);\n const descriptors = ariaDescribedby ? ariaDescribedby.split(/\\s+/) : [];\n const hadIds = ids.every((id) => descriptors.indexOf(id) > -1);\n if (hadIds)\n /* c8 ignore next 3 */\n return (): void => {\n return;\n };\n descriptors.push(...ids);\n el.setAttribute(attribute, descriptors.join(' '));\n return () => conditionAttributeWithoutId(el, attribute, ids);\n}\n"],
5
+ "mappings": "aAYO,gBAAS,4BACZA,EACAC,EACAC,EACI,CACJ,MAAMC,EAAkBH,EAAG,aAAaC,CAAS,EACjD,IAAIG,EAAcD,EAAkBA,EAAgB,MAAM,KAAK,EAAI,CAAC,EACpEC,EAAcA,EAAY,OACrBC,GAAe,CAACH,EAAI,KAAMI,GAAOD,IAAeC,CAAE,CACvD,EACIF,EAAY,OACZJ,EAAG,aAAaC,EAAWG,EAAY,KAAK,GAAG,CAAC,EAEhDJ,EAAG,gBAAgBC,CAAS,CAEpC,CAEO,gBAAS,yBACZD,EACAC,EACAK,EACU,CACV,MAAMJ,EAAM,MAAM,QAAQI,CAAE,EAAIA,EAAK,CAACA,CAAE,EAClCH,EAAkBH,EAAG,aAAaC,CAAS,EAC3CG,EAAcD,EAAkBA,EAAgB,MAAM,KAAK,EAAI,CAAC,EAEtE,OADeD,EAAI,MAAOI,GAAOF,EAAY,QAAQE,CAAE,EAAI,EAAE,EAGlD,IAAY,CAEnB,GACJF,EAAY,KAAK,GAAGF,CAAG,EACvBF,EAAG,aAAaC,EAAWG,EAAY,KAAK,GAAG,CAAC,EACzC,IAAM,4BAA4BJ,EAAIC,EAAWC,CAAG,EAC/D",
6
+ "names": ["el", "attribute", "ids", "ariaDescribedby", "descriptors", "descriptor", "id"]
7
+ }
@@ -0,0 +1 @@
1
+ export * from 'lit/decorators.js';
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ export * from "lit/decorators.js";
3
+ //# sourceMappingURL=decorators.dev.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["decorators.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nexport * from 'lit/decorators.js';\n"],
5
+ "mappings": ";AAYA,cAAc;",
6
+ "names": []
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";export*from"lit/decorators.js";
2
+ //# sourceMappingURL=decorators.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["decorators.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nexport * from 'lit/decorators.js';\n"],
5
+ "mappings": "aAYA,WAAc",
6
+ "names": []
7
+ }
@@ -0,0 +1,5 @@
1
+ interface CustomElementConstructor {
2
+ new (...params: unknown[]): HTMLElement;
3
+ }
4
+ export declare function defineElement(name: string, constructor: CustomElementConstructor): void;
5
+ export {};
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ export function defineElement(name, constructor) {
3
+ if (window.__swc && true) {
4
+ if (customElements.get(name)) {
5
+ window.__swc.warn(
6
+ void 0,
7
+ `Attempted to redefine <${name}>. This usually indicates that multiple versions of the same web component were loaded onto a single page.`,
8
+ "https://opensource.adobe.com/spectrum-web-components/registry-conflicts"
9
+ );
10
+ }
11
+ }
12
+ customElements.define(name, constructor);
13
+ }
14
+ //# sourceMappingURL=define-element.dev.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["define-element.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\ninterface CustomElementConstructor {\n new (...params: unknown[]): HTMLElement;\n}\n\nexport function defineElement(\n name: string,\n constructor: CustomElementConstructor\n): void {\n if (window.__swc && window.__swc.DEBUG) {\n if (customElements.get(name)) {\n window.__swc.warn(\n undefined,\n `Attempted to redefine <${name}>. This usually indicates that multiple versions of the same web component were loaded onto a single page.`,\n 'https://opensource.adobe.com/spectrum-web-components/registry-conflicts'\n );\n }\n }\n customElements.define(name, constructor);\n}\n"],
5
+ "mappings": ";AAgBO,gBAAS,cACZ,MACA,aACI;AACJ,MAAI,OAAO,SAAS,MAAoB;AACpC,QAAI,eAAe,IAAI,IAAI,GAAG;AAC1B,aAAO,MAAM;AAAA,QACT;AAAA,QACA,0BAA0B,IAAI;AAAA,QAC9B;AAAA,MACJ;AAAA,IACJ;AAAA,EACJ;AACA,iBAAe,OAAO,MAAM,WAAW;AAC3C;",
6
+ "names": []
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";export function defineElement(e,n){window.__swc,customElements.define(e,n)}
2
+ //# sourceMappingURL=define-element.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["define-element.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\ninterface CustomElementConstructor {\n new (...params: unknown[]): HTMLElement;\n}\n\nexport function defineElement(\n name: string,\n constructor: CustomElementConstructor\n): void {\n if (window.__swc && window.__swc.DEBUG) {\n if (customElements.get(name)) {\n window.__swc.warn(\n undefined,\n `Attempted to redefine <${name}>. This usually indicates that multiple versions of the same web component were loaded onto a single page.`,\n 'https://opensource.adobe.com/spectrum-web-components/registry-conflicts'\n );\n }\n }\n customElements.define(name, constructor);\n}\n"],
5
+ "mappings": "aAgBO,gBAAS,cACZA,EACAC,EACI,CACA,OAAO,MASX,eAAe,OAAOD,EAAMC,CAAW,CAC3C",
6
+ "names": ["name", "constructor"]
7
+ }
@@ -0,0 +1 @@
1
+ export * from 'lit/directive.js';
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ export * from "lit/directive.js";
3
+ //# sourceMappingURL=directive.dev.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["directive.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nexport * from 'lit/directive.js';\n"],
5
+ "mappings": ";AAYA,cAAc;",
6
+ "names": []
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";export*from"lit/directive.js";
2
+ //# sourceMappingURL=directive.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["directive.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nexport * from 'lit/directive.js';\n"],
5
+ "mappings": "aAYA,WAAc",
6
+ "names": []
7
+ }
@@ -0,0 +1,12 @@
1
+ export { ifDefined } from 'lit/directives/if-defined.js';
2
+ export { repeat } from 'lit/directives/repeat.js';
3
+ export { classMap } from 'lit/directives/class-map.js';
4
+ export { styleMap } from 'lit/directives/style-map.js';
5
+ export type { StyleInfo } from 'lit/directives/style-map.js';
6
+ export { until } from 'lit/directives/until.js';
7
+ export { live } from 'lit/directives/live.js';
8
+ export { when } from 'lit/directives/when.js';
9
+ export { join } from 'lit/directives/join.js';
10
+ export { unsafeHTML } from 'lit/directives/unsafe-html.js';
11
+ export type { Ref } from 'lit/directives/ref.js';
12
+ export { createRef, ref } from 'lit/directives/ref.js';
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ export { ifDefined } from "lit/directives/if-defined.js";
3
+ export { repeat } from "lit/directives/repeat.js";
4
+ export { classMap } from "lit/directives/class-map.js";
5
+ export { styleMap } from "lit/directives/style-map.js";
6
+ export { until } from "lit/directives/until.js";
7
+ export { live } from "lit/directives/live.js";
8
+ export { when } from "lit/directives/when.js";
9
+ export { join } from "lit/directives/join.js";
10
+ export { unsafeHTML } from "lit/directives/unsafe-html.js";
11
+ export { createRef, ref } from "lit/directives/ref.js";
12
+ //# sourceMappingURL=directives.dev.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["directives.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nexport { ifDefined } from 'lit/directives/if-defined.js';\nexport { repeat } from 'lit/directives/repeat.js';\nexport { classMap } from 'lit/directives/class-map.js';\nexport { styleMap } from 'lit/directives/style-map.js';\nexport type { StyleInfo } from 'lit/directives/style-map.js';\nexport { until } from 'lit/directives/until.js';\nexport { live } from 'lit/directives/live.js';\nexport { when } from 'lit/directives/when.js';\nexport { join } from 'lit/directives/join.js';\nexport { unsafeHTML } from 'lit/directives/unsafe-html.js';\nexport type { Ref } from 'lit/directives/ref.js';\nexport { createRef, ref } from 'lit/directives/ref.js';\n"],
5
+ "mappings": ";AAYA,SAAS,iBAAiB;AAC1B,SAAS,cAAc;AACvB,SAAS,gBAAgB;AACzB,SAAS,gBAAgB;AAEzB,SAAS,aAAa;AACtB,SAAS,YAAY;AACrB,SAAS,YAAY;AACrB,SAAS,YAAY;AACrB,SAAS,kBAAkB;AAE3B,SAAS,WAAW,WAAW;",
6
+ "names": []
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";export{ifDefined}from"lit/directives/if-defined.js";export{repeat}from"lit/directives/repeat.js";export{classMap}from"lit/directives/class-map.js";export{styleMap}from"lit/directives/style-map.js";export{until}from"lit/directives/until.js";export{live}from"lit/directives/live.js";export{when}from"lit/directives/when.js";export{join}from"lit/directives/join.js";export{unsafeHTML}from"lit/directives/unsafe-html.js";export{createRef,ref}from"lit/directives/ref.js";
2
+ //# sourceMappingURL=directives.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["directives.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nexport { ifDefined } from 'lit/directives/if-defined.js';\nexport { repeat } from 'lit/directives/repeat.js';\nexport { classMap } from 'lit/directives/class-map.js';\nexport { styleMap } from 'lit/directives/style-map.js';\nexport type { StyleInfo } from 'lit/directives/style-map.js';\nexport { until } from 'lit/directives/until.js';\nexport { live } from 'lit/directives/live.js';\nexport { when } from 'lit/directives/when.js';\nexport { join } from 'lit/directives/join.js';\nexport { unsafeHTML } from 'lit/directives/unsafe-html.js';\nexport type { Ref } from 'lit/directives/ref.js';\nexport { createRef, ref } from 'lit/directives/ref.js';\n"],
5
+ "mappings": "aAYA,OAAS,cAAiB,+BAC1B,OAAS,WAAc,2BACvB,OAAS,aAAgB,8BACzB,OAAS,aAAgB,8BAEzB,OAAS,UAAa,0BACtB,OAAS,SAAY,yBACrB,OAAS,SAAY,yBACrB,OAAS,SAAY,yBACrB,OAAS,eAAkB,gCAE3B,OAAS,UAAW,QAAW",
6
+ "names": []
7
+ }
package/src/html.d.ts ADDED
@@ -0,0 +1 @@
1
+ export { nothing, render } from 'lit/html.js';
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ export { nothing, render } from "lit/html.js";
3
+ //# sourceMappingURL=html.dev.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["html.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nexport { nothing, render } from 'lit/html.js';\n"],
5
+ "mappings": ";AAYA,SAAS,SAAS,cAAc;",
6
+ "names": []
7
+ }
package/src/html.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";export{nothing,render}from"lit/html.js";
2
+ //# sourceMappingURL=html.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["html.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nexport { nothing, render } from 'lit/html.js';\n"],
5
+ "mappings": "aAYA,OAAS,QAAS,WAAc",
6
+ "names": []
7
+ }
package/src/index.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ export * from './Base.js';
2
+ export * from './sizedMixin.js';
3
+ export * from 'lit';
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ export * from "./Base.dev.js";
3
+ export * from "./sizedMixin.dev.js";
4
+ export * from "lit";
5
+ //# sourceMappingURL=index.dev.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["index.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nexport * from './Base.dev.js'\nexport * from './sizedMixin.dev.js'\nexport * from 'lit';\n"],
5
+ "mappings": ";AAYA,cAAc;AACd,cAAc;AACd,cAAc;",
6
+ "names": []
7
+ }
package/src/index.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";export*from"./Base.js";export*from"./sizedMixin.js";export*from"lit";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["index.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nexport * from './Base.js';\nexport * from './sizedMixin.js';\nexport * from 'lit';\n"],
5
+ "mappings": "aAYA,WAAc,YACd,WAAc,kBACd,WAAc",
6
+ "names": []
7
+ }
@@ -0,0 +1,17 @@
1
+ import { ReactiveElement } from 'lit';
2
+ type Constructor<T = Record<string, unknown>> = {
3
+ new (...args: any[]): T;
4
+ prototype: T;
5
+ };
6
+ export type ElementSize = 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl';
7
+ export declare const ElementSizes: Record<string, ElementSize>;
8
+ export type DefaultElementSize = Exclude<ElementSize, 'xxs' | 'xs' | 'xxl'>;
9
+ export interface SizedElementInterface {
10
+ size: ElementSize;
11
+ }
12
+ export declare function SizedMixin<T extends Constructor<ReactiveElement>>(constructor: T, { validSizes, noDefaultSize, defaultSize, }?: {
13
+ validSizes?: ElementSize[];
14
+ noDefaultSize?: boolean;
15
+ defaultSize?: ElementSize;
16
+ }): T & Constructor<SizedElementInterface>;
17
+ export {};
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __decorateClass = (decorators, target, key, kind) => {
5
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
6
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
7
+ if (decorator = decorators[i])
8
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
9
+ if (kind && result) __defProp(target, key, result);
10
+ return result;
11
+ };
12
+ import { property } from "lit/decorators.js";
13
+ export const ElementSizes = {
14
+ xxs: "xxs",
15
+ xs: "xs",
16
+ s: "s",
17
+ m: "m",
18
+ l: "l",
19
+ xl: "xl",
20
+ xxl: "xxl"
21
+ };
22
+ export function SizedMixin(constructor, {
23
+ validSizes = ["s", "m", "l", "xl"],
24
+ noDefaultSize,
25
+ defaultSize = "m"
26
+ } = {}) {
27
+ class SizedElement extends constructor {
28
+ constructor() {
29
+ super(...arguments);
30
+ this._size = defaultSize;
31
+ }
32
+ get size() {
33
+ return this._size || defaultSize;
34
+ }
35
+ set size(value) {
36
+ const fallbackSize = noDefaultSize ? null : defaultSize;
37
+ const size = value ? value.toLocaleLowerCase() : value;
38
+ const validSize = validSizes.includes(size) ? size : fallbackSize;
39
+ if (validSize) {
40
+ this.setAttribute("size", validSize);
41
+ }
42
+ if (this._size === validSize) {
43
+ return;
44
+ }
45
+ const oldSize = this._size;
46
+ this._size = validSize;
47
+ this.requestUpdate("size", oldSize);
48
+ }
49
+ update(changes) {
50
+ if (!this.hasAttribute("size") && !noDefaultSize) {
51
+ this.setAttribute("size", this.size);
52
+ }
53
+ super.update(changes);
54
+ }
55
+ }
56
+ __decorateClass([
57
+ property({ type: String })
58
+ ], SizedElement.prototype, "size", 1);
59
+ return SizedElement;
60
+ }
61
+ //# sourceMappingURL=sizedMixin.dev.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["sizedMixin.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { PropertyValues, ReactiveElement } from 'lit';\nimport { property } from 'lit/decorators.js';\n\ntype Constructor<T = Record<string, unknown>> = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n new (...args: any[]): T;\n prototype: T;\n};\n\nexport type ElementSize = 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl';\nexport const ElementSizes: Record<string, ElementSize> = {\n xxs: 'xxs',\n xs: 'xs',\n s: 's',\n m: 'm',\n l: 'l',\n xl: 'xl',\n xxl: 'xxl',\n};\nexport type DefaultElementSize = Exclude<ElementSize, 'xxs' | 'xs' | 'xxl'>;\n\nexport interface SizedElementInterface {\n size: ElementSize;\n}\n\nexport function SizedMixin<T extends Constructor<ReactiveElement>>(\n constructor: T,\n {\n validSizes = ['s', 'm', 'l', 'xl'],\n noDefaultSize,\n defaultSize = 'm',\n }: {\n validSizes?: ElementSize[];\n noDefaultSize?: boolean;\n defaultSize?: ElementSize;\n } = {}\n): T & Constructor<SizedElementInterface> {\n class SizedElement extends constructor {\n @property({ type: String })\n public get size(): ElementSize {\n return this._size || defaultSize;\n }\n\n public set size(value: ElementSize) {\n const fallbackSize = noDefaultSize ? null : defaultSize;\n const size = (\n value ? value.toLocaleLowerCase() : value\n ) as ElementSize;\n const validSize = (\n validSizes.includes(size) ? size : fallbackSize\n ) as ElementSize;\n if (validSize) {\n this.setAttribute('size', validSize);\n }\n if (this._size === validSize) {\n return;\n }\n const oldSize = this._size;\n this._size = validSize;\n this.requestUpdate('size', oldSize);\n }\n\n private _size: ElementSize | null = defaultSize;\n\n protected override update(changes: PropertyValues): void {\n if (!this.hasAttribute('size') && !noDefaultSize) {\n this.setAttribute('size', this.size);\n }\n super.update(changes);\n }\n }\n return SizedElement;\n}\n"],
5
+ "mappings": ";;;;;;;;;;;AAYA,SAAS,gBAAgB;AASlB,aAAM,eAA4C;AAAA,EACrD,KAAK;AAAA,EACL,IAAI;AAAA,EACJ,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,IAAI;AAAA,EACJ,KAAK;AACT;AAOO,gBAAS,WACZ,aACA;AAAA,EACI,aAAa,CAAC,KAAK,KAAK,KAAK,IAAI;AAAA,EACjC;AAAA,EACA,cAAc;AAClB,IAII,CAAC,GACiC;AAAA,EACtC,MAAM,qBAAqB,YAAY;AAAA,IAAvC;AAAA;AAyBI,WAAQ,QAA4B;AAAA;AAAA,IAvBpC,IAAW,OAAoB;AAC3B,aAAO,KAAK,SAAS;AAAA,IACzB;AAAA,IAEA,IAAW,KAAK,OAAoB;AAChC,YAAM,eAAe,gBAAgB,OAAO;AAC5C,YAAM,OACF,QAAQ,MAAM,kBAAkB,IAAI;AAExC,YAAM,YACF,WAAW,SAAS,IAAI,IAAI,OAAO;AAEvC,UAAI,WAAW;AACX,aAAK,aAAa,QAAQ,SAAS;AAAA,MACvC;AACA,UAAI,KAAK,UAAU,WAAW;AAC1B;AAAA,MACJ;AACA,YAAM,UAAU,KAAK;AACrB,WAAK,QAAQ;AACb,WAAK,cAAc,QAAQ,OAAO;AAAA,IACtC;AAAA,IAImB,OAAO,SAA+B;AACrD,UAAI,CAAC,KAAK,aAAa,MAAM,KAAK,CAAC,eAAe;AAC9C,aAAK,aAAa,QAAQ,KAAK,IAAI;AAAA,MACvC;AACA,YAAM,OAAO,OAAO;AAAA,IACxB;AAAA,EACJ;AA/Be;AAAA,IADV,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,KADxB,aAES;AAgCf,SAAO;AACX;",
6
+ "names": []
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var a=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var m=(r,i,s,t)=>{for(var e=t>1?void 0:t?u(i,s):i,l=r.length-1,o;l>=0;l--)(o=r[l])&&(e=(t?o(i,s,e):o(e))||e);return t&&e&&a(i,s,e),e};import{property as S}from"lit/decorators.js";export const ElementSizes={xxs:"xxs",xs:"xs",s:"s",m:"m",l:"l",xl:"xl",xxl:"xxl"};export function SizedMixin(r,{validSizes:i=["s","m","l","xl"],noDefaultSize:s,defaultSize:t="m"}={}){class e extends r{constructor(){super(...arguments);this._size=t}get size(){return this._size||t}set size(n){const p=s?null:t,z=n&&n.toLocaleLowerCase(),x=i.includes(z)?z:p;if(x&&this.setAttribute("size",x),this._size===x)return;const c=this._size;this._size=x,this.requestUpdate("size",c)}update(n){!this.hasAttribute("size")&&!s&&this.setAttribute("size",this.size),super.update(n)}}return m([S({type:String})],e.prototype,"size",1),e}
2
+ //# sourceMappingURL=sizedMixin.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["sizedMixin.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { PropertyValues, ReactiveElement } from 'lit';\nimport { property } from 'lit/decorators.js';\n\ntype Constructor<T = Record<string, unknown>> = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n new (...args: any[]): T;\n prototype: T;\n};\n\nexport type ElementSize = 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl';\nexport const ElementSizes: Record<string, ElementSize> = {\n xxs: 'xxs',\n xs: 'xs',\n s: 's',\n m: 'm',\n l: 'l',\n xl: 'xl',\n xxl: 'xxl',\n};\nexport type DefaultElementSize = Exclude<ElementSize, 'xxs' | 'xs' | 'xxl'>;\n\nexport interface SizedElementInterface {\n size: ElementSize;\n}\n\nexport function SizedMixin<T extends Constructor<ReactiveElement>>(\n constructor: T,\n {\n validSizes = ['s', 'm', 'l', 'xl'],\n noDefaultSize,\n defaultSize = 'm',\n }: {\n validSizes?: ElementSize[];\n noDefaultSize?: boolean;\n defaultSize?: ElementSize;\n } = {}\n): T & Constructor<SizedElementInterface> {\n class SizedElement extends constructor {\n @property({ type: String })\n public get size(): ElementSize {\n return this._size || defaultSize;\n }\n\n public set size(value: ElementSize) {\n const fallbackSize = noDefaultSize ? null : defaultSize;\n const size = (\n value ? value.toLocaleLowerCase() : value\n ) as ElementSize;\n const validSize = (\n validSizes.includes(size) ? size : fallbackSize\n ) as ElementSize;\n if (validSize) {\n this.setAttribute('size', validSize);\n }\n if (this._size === validSize) {\n return;\n }\n const oldSize = this._size;\n this._size = validSize;\n this.requestUpdate('size', oldSize);\n }\n\n private _size: ElementSize | null = defaultSize;\n\n protected override update(changes: PropertyValues): void {\n if (!this.hasAttribute('size') && !noDefaultSize) {\n this.setAttribute('size', this.size);\n }\n super.update(changes);\n }\n }\n return SizedElement;\n}\n"],
5
+ "mappings": "qNAYA,OAAS,YAAAA,MAAgB,oBASlB,aAAM,aAA4C,CACrD,IAAK,MACL,GAAI,KACJ,EAAG,IACH,EAAG,IACH,EAAG,IACH,GAAI,KACJ,IAAK,KACT,EAOO,gBAAS,WACZC,EACA,CACI,WAAAC,EAAa,CAAC,IAAK,IAAK,IAAK,IAAI,EACjC,cAAAC,EACA,YAAAC,EAAc,GAClB,EAII,CAAC,EACiC,CACtC,MAAMC,UAAqBJ,CAAY,CAAvC,kCAyBI,KAAQ,MAA4BG,EAvBpC,IAAW,MAAoB,CAC3B,OAAO,KAAK,OAASA,CACzB,CAEA,IAAW,KAAKE,EAAoB,CAChC,MAAMC,EAAeJ,EAAgB,KAAOC,EACtCI,EACFF,GAAQA,EAAM,kBAAkB,EAE9BG,EACFP,EAAW,SAASM,CAAI,EAAIA,EAAOD,EAKvC,GAHIE,GACA,KAAK,aAAa,OAAQA,CAAS,EAEnC,KAAK,QAAUA,EACf,OAEJ,MAAMC,EAAU,KAAK,MACrB,KAAK,MAAQD,EACb,KAAK,cAAc,OAAQC,CAAO,CACtC,CAImB,OAAOC,EAA+B,CACjD,CAAC,KAAK,aAAa,MAAM,GAAK,CAACR,GAC/B,KAAK,aAAa,OAAQ,KAAK,IAAI,EAEvC,MAAM,OAAOQ,CAAO,CACxB,CACJ,CA/Be,OAAAC,EAAA,CADVZ,EAAS,CAAE,KAAM,MAAO,CAAC,GADxBK,EAES,oBAgCRA,CACX",
6
+ "names": ["property", "constructor", "validSizes", "noDefaultSize", "defaultSize", "SizedElement", "value", "fallbackSize", "size", "validSize", "oldSize", "changes", "__decorateClass"]
7
+ }
@@ -0,0 +1,48 @@
1
+ import { nothing, Part } from 'lit';
2
+ import { AsyncDirective } from 'lit/async-directive.js';
3
+ import type { DirectiveResult } from 'lit/directive.js';
4
+ type ListenerConfig = [string | string[], (event?: any) => void];
5
+ type ListenerConfigGroup = {
6
+ start: ListenerConfig;
7
+ end: ListenerConfig;
8
+ streamInside?: ListenerConfig;
9
+ streamOutside?: ListenerConfig;
10
+ };
11
+ /**
12
+ * Performantly manage listening to event in a series, like:
13
+ * - `input[type="range"]`: input, input, etc. => change
14
+ * - `sp-color-area`: pointerdown => pointermove, pointermove, etc. => pointerup
15
+ * Lazily bind events to the specific part of the series while
16
+ * throttling streamed events to 1/frame.
17
+ */
18
+ declare class StreamingListenerDirective extends AsyncDirective {
19
+ host: EventTarget | Record<string, unknown> | Element;
20
+ element: Element;
21
+ start: ListenerConfig;
22
+ streamInside: ListenerConfig;
23
+ end: ListenerConfig;
24
+ streamOutside: ListenerConfig;
25
+ state: 'off' | 'on';
26
+ stream?: number;
27
+ render(_configGroup: ListenerConfigGroup): typeof nothing;
28
+ update(part: Part, [{ start, end, streamInside, streamOutside, },]: Parameters<this['render']>): void;
29
+ addListeners(state?: 'on' | 'off'): void;
30
+ callHandler(value: (event: Event) => void | EventListenerObject, event: Event): void;
31
+ handleStream(value: (event: Event) => void | EventListenerObject, event: Event): void;
32
+ clearStream(): void;
33
+ handleStart: (event: Event) => void;
34
+ handleInside: (event: Event) => void;
35
+ handleEnd: (event: Event) => void;
36
+ handleOutside: (event: Event) => void;
37
+ addListener(type: string | string[], fn: (event: Event) => void): void;
38
+ removeListener(type: string | string[], fn: (event: Event) => void): void;
39
+ removeListeners(): void;
40
+ disconnected(): void;
41
+ reconnected(): void;
42
+ }
43
+ export declare const streamingListener: (_configGroup: ListenerConfigGroup) => DirectiveResult<typeof StreamingListenerDirective>;
44
+ /**
45
+ * The type of the class that powers this directive. Necessary for naming the
46
+ * directive's return type.
47
+ */
48
+ export type { StreamingListenerDirective };
@@ -0,0 +1,133 @@
1
+ "use strict";
2
+ import { nothing } from "lit";
3
+ import { AsyncDirective, directive } from "lit/async-directive.js";
4
+ const defaultListener = [
5
+ "",
6
+ () => {
7
+ return;
8
+ }
9
+ ];
10
+ class StreamingListenerDirective extends AsyncDirective {
11
+ constructor() {
12
+ super(...arguments);
13
+ this.start = defaultListener;
14
+ this.streamInside = defaultListener;
15
+ this.end = defaultListener;
16
+ this.streamOutside = defaultListener;
17
+ this.state = "off";
18
+ this.handleStart = (event) => {
19
+ this.clearStream();
20
+ this.callHandler(this.start[1], event);
21
+ if (event.defaultPrevented) {
22
+ return;
23
+ }
24
+ this.removeListeners();
25
+ this.addListeners("on");
26
+ };
27
+ this.handleInside = (event) => {
28
+ this.handleStream(this.streamInside[1], event);
29
+ };
30
+ this.handleEnd = (event) => {
31
+ this.clearStream();
32
+ this.callHandler(this.end[1], event);
33
+ this.removeListeners();
34
+ this.addListeners("off");
35
+ };
36
+ /* c8 ignore next 3 */
37
+ this.handleOutside = (event) => {
38
+ this.handleStream(this.streamOutside[1], event);
39
+ };
40
+ }
41
+ /* c8 ignore next 4 */
42
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
43
+ render(_configGroup) {
44
+ return nothing;
45
+ }
46
+ update(part, [
47
+ {
48
+ start,
49
+ end,
50
+ streamInside = defaultListener,
51
+ streamOutside = defaultListener
52
+ }
53
+ ]) {
54
+ var _a;
55
+ if (this.element !== part.element) {
56
+ this.element = part.element;
57
+ this.removeListeners();
58
+ }
59
+ this.host = ((_a = part.options) == null ? void 0 : _a.host) || this.element;
60
+ this.start = start;
61
+ this.end = end;
62
+ this.streamInside = streamInside;
63
+ this.streamOutside = streamOutside;
64
+ this.addListeners();
65
+ }
66
+ addListeners(state) {
67
+ this.state = state || this.state;
68
+ if (this.state === "off") {
69
+ this.addListener(this.streamOutside[0], this.handleOutside);
70
+ this.addListener(this.start[0], this.handleStart);
71
+ } else if (this.state === "on") {
72
+ this.addListener(this.streamInside[0], this.handleInside);
73
+ this.addListener(this.end[0], this.handleEnd);
74
+ }
75
+ }
76
+ callHandler(value, event) {
77
+ if (typeof value === "function") {
78
+ value.call(this.host, event);
79
+ } else {
80
+ value.handleEvent(event);
81
+ }
82
+ }
83
+ handleStream(value, event) {
84
+ if (this.stream) {
85
+ return;
86
+ }
87
+ this.callHandler(value, event);
88
+ this.stream = requestAnimationFrame(() => {
89
+ this.stream = void 0;
90
+ });
91
+ }
92
+ clearStream() {
93
+ if (this.stream != null) {
94
+ cancelAnimationFrame(this.stream);
95
+ this.stream = void 0;
96
+ }
97
+ }
98
+ addListener(type, fn) {
99
+ if (Array.isArray(type)) {
100
+ type.map((eventName) => {
101
+ this.element.addEventListener(eventName, fn);
102
+ });
103
+ } else {
104
+ this.element.addEventListener(type, fn);
105
+ }
106
+ }
107
+ removeListener(type, fn) {
108
+ if (Array.isArray(type)) {
109
+ type.map((eventName) => {
110
+ this.element.removeEventListener(eventName, fn);
111
+ });
112
+ } else {
113
+ this.element.removeEventListener(type, fn);
114
+ }
115
+ }
116
+ removeListeners() {
117
+ this.removeListener(this.start[0], this.handleStart);
118
+ this.removeListener(this.streamInside[0], this.handleInside);
119
+ this.removeListener(this.end[0], this.handleEnd);
120
+ this.removeListener(this.streamOutside[0], this.handleOutside);
121
+ }
122
+ disconnected() {
123
+ this.removeListeners();
124
+ }
125
+ /* c8 ignore next 3 */
126
+ reconnected() {
127
+ this.addListeners();
128
+ }
129
+ }
130
+ export const streamingListener = directive(
131
+ StreamingListenerDirective
132
+ );
133
+ //# sourceMappingURL=streaming-listener.dev.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["streaming-listener.ts"],
4
+ "sourcesContent": ["/* eslint-disable @typescript-eslint/no-explicit-any */\n/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { ElementPart, nothing, Part } from 'lit';\nimport { AsyncDirective, directive } from 'lit/async-directive.js';\nimport type { DirectiveResult } from 'lit/directive.js';\n\ntype ListenerConfig = [string | string[], (event?: any) => void];\ntype ListenerConfigGroup = {\n start: ListenerConfig;\n end: ListenerConfig;\n streamInside?: ListenerConfig;\n streamOutside?: ListenerConfig;\n};\n\n/* c8 ignore next 6 */\nconst defaultListener: ListenerConfig = [\n '',\n (): void => {\n return;\n },\n];\n\n/**\n * Performantly manage listening to event in a series, like:\n * - `input[type=\"range\"]`: input, input, etc. => change\n * - `sp-color-area`: pointerdown => pointermove, pointermove, etc. => pointerup\n * Lazily bind events to the specific part of the series while\n * throttling streamed events to 1/frame.\n */\nclass StreamingListenerDirective extends AsyncDirective {\n host!: EventTarget | Record<string, unknown> | Element;\n element!: Element;\n\n start: ListenerConfig = defaultListener;\n streamInside: ListenerConfig = defaultListener;\n end: ListenerConfig = defaultListener;\n streamOutside: ListenerConfig = defaultListener;\n\n state: 'off' | 'on' = 'off';\n // Animation frame that will unlock the next \"stream\" event if/when it is dispatched.\n stream?: number;\n\n /* c8 ignore next 4 */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n render(_configGroup: ListenerConfigGroup): typeof nothing {\n return nothing;\n }\n\n override update(\n part: Part,\n [\n {\n start,\n end,\n streamInside = defaultListener,\n streamOutside = defaultListener,\n },\n ]: Parameters<this['render']>\n ): void {\n if (this.element !== (part as ElementPart).element) {\n this.element = (part as ElementPart).element;\n this.removeListeners();\n }\n this.host =\n (part.options?.host as Record<string, unknown>) || this.element;\n this.start = start;\n this.end = end;\n this.streamInside = streamInside;\n this.streamOutside = streamOutside;\n this.addListeners();\n }\n\n addListeners(state?: 'on' | 'off'): void {\n this.state = state || this.state;\n if (this.state === 'off') {\n this.addListener(this.streamOutside[0], this.handleOutside);\n this.addListener(this.start[0], this.handleStart);\n } else if (this.state === 'on') {\n this.addListener(this.streamInside[0], this.handleInside);\n this.addListener(this.end[0], this.handleEnd);\n }\n }\n\n callHandler(\n value: (event: Event) => void | EventListenerObject,\n event: Event\n ): void {\n if (typeof value === 'function') {\n (value as (event: Event) => void).call(this.host, event);\n } else {\n (value as EventListenerObject).handleEvent(event);\n }\n }\n\n handleStream(\n value: (event: Event) => void | EventListenerObject,\n event: Event\n ): void {\n if (this.stream) {\n return;\n }\n this.callHandler(value, event);\n this.stream = requestAnimationFrame(() => {\n this.stream = undefined;\n });\n }\n\n clearStream(): void {\n if (this.stream != null) {\n // Ensure steam events NEVER go after a start or event event.\n cancelAnimationFrame(this.stream);\n this.stream = undefined;\n }\n }\n\n handleStart = (event: Event): void => {\n this.clearStream();\n this.callHandler(this.start[1], event);\n if (event.defaultPrevented) {\n return;\n }\n this.removeListeners();\n this.addListeners('on');\n };\n\n handleInside = (event: Event): void => {\n this.handleStream(this.streamInside[1], event);\n };\n\n handleEnd = (event: Event): void => {\n this.clearStream();\n this.callHandler(this.end[1], event);\n this.removeListeners();\n this.addListeners('off');\n };\n\n /* c8 ignore next 3 */\n handleOutside = (event: Event): void => {\n this.handleStream(this.streamOutside[1], event);\n };\n\n addListener(type: string | string[], fn: (event: Event) => void): void {\n if (Array.isArray(type)) {\n type.map((eventName) => {\n this.element.addEventListener(eventName, fn);\n });\n } else {\n this.element.addEventListener(type, fn);\n }\n }\n\n removeListener(type: string | string[], fn: (event: Event) => void): void {\n if (Array.isArray(type)) {\n type.map((eventName) => {\n this.element.removeEventListener(eventName, fn);\n });\n } else {\n this.element.removeEventListener(type, fn);\n }\n }\n\n removeListeners(): void {\n this.removeListener(this.start[0], this.handleStart);\n this.removeListener(this.streamInside[0], this.handleInside);\n this.removeListener(this.end[0], this.handleEnd);\n this.removeListener(this.streamOutside[0], this.handleOutside);\n }\n\n override disconnected(): void {\n this.removeListeners();\n }\n\n /* c8 ignore next 3 */\n override reconnected(): void {\n this.addListeners();\n }\n}\n\nexport const streamingListener: (\n _configGroup: ListenerConfigGroup\n) => DirectiveResult<typeof StreamingListenerDirective> = directive(\n StreamingListenerDirective\n);\n\n/**\n * The type of the class that powers this directive. Necessary for naming the\n * directive's return type.\n */\nexport type { StreamingListenerDirective };\n"],
5
+ "mappings": ";AAYA,SAAsB,eAAqB;AAC3C,SAAS,gBAAgB,iBAAiB;AAY1C,MAAM,kBAAkC;AAAA,EACpC;AAAA,EACA,MAAY;A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AAK,MAAM,CAAC,GAAG,KAAK,WAAW;AACnD,SAAK,eAAe,KAAK,aAAa,CAAC,GAAG,KAAK,YAAY;AAC3D,SAAK,eAAe,KAAK,IAAI,CAAC,GAAG,KAAK,SAAS;AAC/C,SAAK,eAAe,KAAK,cAAc,CAAC,GAAG,KAAK,aAAa;AAAA,EACjE;AAAA,EAES,eAAqB;AAC1B,SAAK,gBAAgB;AAAA,EACzB;AAAA;AAAA,EAGS,cAAoB;AACzB,SAAK,aAAa;AAAA,EACtB;AACJ;AAEO,aAAM,oBAE6C;AAAA,EACtD;AACJ;",
6
+ "names": []
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";import{nothing as a}from"lit";import{AsyncDirective as o,directive as h}from"lit/async-directive.js";const i=["",()=>{}];class m extends o{constructor(){super(...arguments);this.start=i;this.streamInside=i;this.end=i;this.streamOutside=i;this.state="off";this.handleStart=e=>{this.clearStream(),this.callHandler(this.start[1],e),!e.defaultPrevented&&(this.removeListeners(),this.addListeners("on"))};this.handleInside=e=>{this.handleStream(this.streamInside[1],e)};this.handleEnd=e=>{this.clearStream(),this.callHandler(this.end[1],e),this.removeListeners(),this.addListeners("off")};this.handleOutside=e=>{this.handleStream(this.streamOutside[1],e)}}render(e){return a}update(e,[{start:t,end:s,streamInside:r=i,streamOutside:d=i}]){var n;this.element!==e.element&&(this.element=e.element,this.removeListeners()),this.host=((n=e.options)==null?void 0:n.host)||this.element,this.start=t,this.end=s,this.streamInside=r,this.streamOutside=d,this.addListeners()}addListeners(e){this.state=e||this.state,this.state==="off"?(this.addListener(this.streamOutside[0],this.handleOutside),this.addListener(this.start[0],this.handleStart)):this.state==="on"&&(this.addListener(this.streamInside[0],this.handleInside),this.addListener(this.end[0],this.handleEnd))}callHandler(e,t){typeof e=="function"?e.call(this.host,t):e.handleEvent(t)}handleStream(e,t){this.stream||(this.callHandler(e,t),this.stream=requestAnimationFrame(()=>{this.stream=void 0}))}clearStream(){this.stream!=null&&(cancelAnimationFrame(this.stream),this.stream=void 0)}addListener(e,t){Array.isArray(e)?e.map(s=>{this.element.addEventListener(s,t)}):this.element.addEventListener(e,t)}removeListener(e,t){Array.isArray(e)?e.map(s=>{this.element.removeEventListener(s,t)}):this.element.removeEventListener(e,t)}removeListeners(){this.removeListener(this.start[0],this.handleStart),this.removeListener(this.streamInside[0],this.handleInside),this.removeListener(this.end[0],this.handleEnd),this.removeListener(this.streamOutside[0],this.handleOutside)}disconnected(){this.removeListeners()}reconnected(){this.addListeners()}}export const streamingListener=h(m);
2
+ //# sourceMappingURL=streaming-listener.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["streaming-listener.ts"],
4
+ "sourcesContent": ["/* eslint-disable @typescript-eslint/no-explicit-any */\n/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { ElementPart, nothing, Part } from 'lit';\nimport { AsyncDirective, directive } from 'lit/async-directive.js';\nimport type { DirectiveResult } from 'lit/directive.js';\n\ntype ListenerConfig = [string | string[], (event?: any) => void];\ntype ListenerConfigGroup = {\n start: ListenerConfig;\n end: ListenerConfig;\n streamInside?: ListenerConfig;\n streamOutside?: ListenerConfig;\n};\n\n/* c8 ignore next 6 */\nconst defaultListener: ListenerConfig = [\n '',\n (): void => {\n return;\n },\n];\n\n/**\n * Performantly manage listening to event in a series, like:\n * - `input[type=\"range\"]`: input, input, etc. => change\n * - `sp-color-area`: pointerdown => pointermove, pointermove, etc. => pointerup\n * Lazily bind events to the specific part of the series while\n * throttling streamed events to 1/frame.\n */\nclass StreamingListenerDirective extends AsyncDirective {\n host!: EventTarget | Record<string, unknown> | Element;\n element!: Element;\n\n start: ListenerConfig = defaultListener;\n streamInside: ListenerConfig = defaultListener;\n end: ListenerConfig = defaultListener;\n streamOutside: ListenerConfig = defaultListener;\n\n state: 'off' | 'on' = 'off';\n // Animation frame that will unlock the next \"stream\" event if/when it is dispatched.\n stream?: number;\n\n /* c8 ignore next 4 */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n render(_configGroup: ListenerConfigGroup): typeof nothing {\n return nothing;\n }\n\n override update(\n part: Part,\n [\n {\n start,\n end,\n streamInside = defaultListener,\n streamOutside = defaultListener,\n },\n ]: Parameters<this['render']>\n ): void {\n if (this.element !== (part as ElementPart).element) {\n this.element = (part as ElementPart).element;\n this.removeListeners();\n }\n this.host =\n (part.options?.host as Record<string, unknown>) || this.element;\n this.start = start;\n this.end = end;\n this.streamInside = streamInside;\n this.streamOutside = streamOutside;\n this.addListeners();\n }\n\n addListeners(state?: 'on' | 'off'): void {\n this.state = state || this.state;\n if (this.state === 'off') {\n this.addListener(this.streamOutside[0], this.handleOutside);\n this.addListener(this.start[0], this.handleStart);\n } else if (this.state === 'on') {\n this.addListener(this.streamInside[0], this.handleInside);\n this.addListener(this.end[0], this.handleEnd);\n }\n }\n\n callHandler(\n value: (event: Event) => void | EventListenerObject,\n event: Event\n ): void {\n if (typeof value === 'function') {\n (value as (event: Event) => void).call(this.host, event);\n } else {\n (value as EventListenerObject).handleEvent(event);\n }\n }\n\n handleStream(\n value: (event: Event) => void | EventListenerObject,\n event: Event\n ): void {\n if (this.stream) {\n return;\n }\n this.callHandler(value, event);\n this.stream = requestAnimationFrame(() => {\n this.stream = undefined;\n });\n }\n\n clearStream(): void {\n if (this.stream != null) {\n // Ensure steam events NEVER go after a start or event event.\n cancelAnimationFrame(this.stream);\n this.stream = undefined;\n }\n }\n\n handleStart = (event: Event): void => {\n this.clearStream();\n this.callHandler(this.start[1], event);\n if (event.defaultPrevented) {\n return;\n }\n this.removeListeners();\n this.addListeners('on');\n };\n\n handleInside = (event: Event): void => {\n this.handleStream(this.streamInside[1], event);\n };\n\n handleEnd = (event: Event): void => {\n this.clearStream();\n this.callHandler(this.end[1], event);\n this.removeListeners();\n this.addListeners('off');\n };\n\n /* c8 ignore next 3 */\n handleOutside = (event: Event): void => {\n this.handleStream(this.streamOutside[1], event);\n };\n\n addListener(type: string | string[], fn: (event: Event) => void): void {\n if (Array.isArray(type)) {\n type.map((eventName) => {\n this.element.addEventListener(eventName, fn);\n });\n } else {\n this.element.addEventListener(type, fn);\n }\n }\n\n removeListener(type: string | string[], fn: (event: Event) => void): void {\n if (Array.isArray(type)) {\n type.map((eventName) => {\n this.element.removeEventListener(eventName, fn);\n });\n } else {\n this.element.removeEventListener(type, fn);\n }\n }\n\n removeListeners(): void {\n this.removeListener(this.start[0], this.handleStart);\n this.removeListener(this.streamInside[0], this.handleInside);\n this.removeListener(this.end[0], this.handleEnd);\n this.removeListener(this.streamOutside[0], this.handleOutside);\n }\n\n override disconnected(): void {\n this.removeListeners();\n }\n\n /* c8 ignore next 3 */\n override reconnected(): void {\n this.addListeners();\n }\n}\n\nexport const streamingListener: (\n _configGroup: ListenerConfigGroup\n) => DirectiveResult<typeof StreamingListenerDirective> = directive(\n StreamingListenerDirective\n);\n\n/**\n * The type of the class that powers this directive. Necessary for naming the\n * directive's return type.\n */\nexport type { StreamingListenerDirective };\n"],
5
+ "mappings": "aAYA,OAAsB,WAAAA,MAAqB,MAC3C,OAAS,kBAAAC,EAAgB,aAAAC,MAAiB,yBAY1C,MAAMC,EAAkC,CACpC,GACA,IAAY,CAEZ,CACJ,EASA,MAAMC,UAAmCH,CAAe,CAAxD,kCAII,WAAwBE,EACxB,kBAA+BA,EAC/B,SAAsBA,EACtB,mBAAgCA,EAEhC,WAAsB,MA6EtB,iBAAeE,GAAuB,CAClC,KAAK,YAAY,EACjB,KAAK,YAAY,KAAK,MAAM,CAAC,EAAGA,CAAK,EACjC,CAAAA,EAAM,mBAGV,KAAK,gBAAgB,EACrB,KAAK,a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IAAM,CACtC,KAAK,OAAS,MAClB,CAAC,EACL,CAEA,aAAoB,CACZ,KAAK,QAAU,OAEf,qBAAqB,KAAK,MAAM,EAChC,KAAK,OAAS,OAEtB,CA4BA,YAAYU,EAAyBC,EAAkC,CAC/D,MAAM,QAAQD,CAAI,EAClBA,EAAK,IAAKE,GAAc,CACpB,KAAK,QAAQ,iBAAiBA,EAAWD,CAAE,CAC/C,CAAC,EAED,KAAK,QAAQ,iBAAiBD,EAAMC,CAAE,CAE9C,CAEA,eAAeD,EAAyBC,EAAkC,CAClE,MAAM,QAAQD,CAAI,EAClBA,EAAK,IAAKE,GAAc,CACpB,KAAK,QAAQ,oBAAoBA,EAAWD,CAAE,CAClD,CAAC,EAED,KAAK,QAAQ,oBAAoBD,EAAMC,CAAE,CAEjD,CAEA,iBAAwB,CACpB,KAAK,eAAe,KAAK,MAAM,CAAC,EAAG,KAAK,WAAW,EACnD,KAAK,eAAe,KAAK,aAAa,CAAC,EAAG,KAAK,YAAY,EAC3D,KAAK,eAAe,KAAK,IAAI,CAAC,EAAG,KAAK,SAAS,EAC/C,KAAK,eAAe,KAAK,cAAc,CAAC,EAAG,KAAK,aAAa,CACjE,CAES,cAAqB,CAC1B,KAAK,gBAAgB,CACzB,CAGS,aAAoB,CACzB,KAAK,aAAa,CACtB,CACJ,CAEO,aAAM,kBAE6Cd,EACtDE,CACJ",
6
+ "names": ["nothing", "AsyncDirective", "directive", "defaultListener", "StreamingListenerDirective", "event", "_configGroup", "part", "start", "end", "streamInside", "streamOutside", "_a", "state", "value", "type", "fn", "eventName"]
7
+ }
@@ -0,0 +1,12 @@
1
+ /*
2
+ Copyright 2023 Adobe. All rights reserved.
3
+ This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License. You may obtain a copy
5
+ of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+
7
+ Unless required by applicable law or agreed to in writing, software distributed under
8
+ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ OF ANY KIND, either express or implied. See the License for the specific language
10
+ governing permissions and limitations under the License.
11
+ */
12
+ export declare const version: string;
package/src/version.js ADDED
@@ -0,0 +1,2 @@
1
+ // Generated by genversion.
2
+ export const version = '1.0.1';