@spectrum-web-components/shared 0.13.3-express.0 → 0.13.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spectrum-web-components/shared",
|
|
3
|
-
"version": "0.13.3
|
|
3
|
+
"version": "0.13.3",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -42,12 +42,12 @@
|
|
|
42
42
|
"lit-html"
|
|
43
43
|
],
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@spectrum-web-components/base": "^0.5.
|
|
45
|
+
"@spectrum-web-components/base": "^0.5.1",
|
|
46
46
|
"focus-visible": "^5.1.0",
|
|
47
47
|
"tslib": "^2.0.0"
|
|
48
48
|
},
|
|
49
49
|
"types": "./src/index.d.ts",
|
|
50
50
|
"customElements": "custom-elements.json",
|
|
51
51
|
"sideEffects": false,
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "279380c6d72c0819fe224b405844af9ddcb87f8a"
|
|
53
53
|
}
|
|
@@ -9,6 +9,7 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
9
9
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
10
|
governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
|
+
/* c8 ignore next 3 */
|
|
12
13
|
export const getActiveElement = (el) => {
|
|
13
14
|
return el.getRootNode().activeElement;
|
|
14
15
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-active-element.js","sourceRoot":"","sources":["get-active-element.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,EAAQ,EAAkB,EAAE;IACzD,OAAQ,EAAE,CAAC,WAAW,EAAe,CAAC,aAAa,CAAC;AACxD,CAAC,CAAC","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 const getActiveElement = (el: Node): Element | null => {\n return (el.getRootNode() as Document).activeElement;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"get-active-element.js","sourceRoot":"","sources":["get-active-element.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AAEF,sBAAsB;AACtB,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,EAAQ,EAAkB,EAAE;IACzD,OAAQ,EAAE,CAAC,WAAW,EAAe,CAAC,aAAa,CAAC;AACxD,CAAC,CAAC","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\n/* c8 ignore next 3 */\nexport const getActiveElement = (el: Node): Element | null => {\n return (el.getRootNode() as Document).activeElement;\n};\n"]}
|
package/src/platform.js
CHANGED
|
@@ -26,13 +26,11 @@ export function isMac() {
|
|
|
26
26
|
export function isIPhone() {
|
|
27
27
|
return testPlatform(/^iPhone/);
|
|
28
28
|
}
|
|
29
|
-
/* c8 ignore next 7 */
|
|
30
29
|
export function isIPad() {
|
|
31
30
|
return (testPlatform(/^iPad/) ||
|
|
32
31
|
// iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.
|
|
33
32
|
(isMac() && navigator.maxTouchPoints > 1));
|
|
34
33
|
}
|
|
35
|
-
/* c8 ignore next 3 */
|
|
36
34
|
export function isIOS() {
|
|
37
35
|
return isIPhone() || isIPad();
|
|
38
36
|
}
|
package/src/platform.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform.js","sourceRoot":"","sources":["platform.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AAEF,SAAS,aAAa,CAAC,EAAU;IAC7B,OAAO,OAAO,MAAM,KAAK,WAAW,IAAI,MAAM,CAAC,SAAS,IAAI,IAAI;QAC5D,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC;QACrC,CAAC,CAAC,KAAK,CAAC;AAChB,CAAC;AAED,SAAS,YAAY,CAAC,EAAU;IAC5B,OAAO,OAAO,MAAM,KAAK,WAAW,IAAI,MAAM,CAAC,SAAS,IAAI,IAAI;QAC5D,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC;QACpC,CAAC,CAAC,KAAK,CAAC;AAChB,CAAC;AAED,sBAAsB;AACtB,MAAM,UAAU,KAAK;IACjB,OAAO,YAAY,CAAC,MAAM,CAAC,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,QAAQ;IACpB,OAAO,YAAY,CAAC,SAAS,CAAC,CAAC;AACnC,CAAC;AAED,
|
|
1
|
+
{"version":3,"file":"platform.js","sourceRoot":"","sources":["platform.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AAEF,SAAS,aAAa,CAAC,EAAU;IAC7B,OAAO,OAAO,MAAM,KAAK,WAAW,IAAI,MAAM,CAAC,SAAS,IAAI,IAAI;QAC5D,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC;QACrC,CAAC,CAAC,KAAK,CAAC;AAChB,CAAC;AAED,SAAS,YAAY,CAAC,EAAU;IAC5B,OAAO,OAAO,MAAM,KAAK,WAAW,IAAI,MAAM,CAAC,SAAS,IAAI,IAAI;QAC5D,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC;QACpC,CAAC,CAAC,KAAK,CAAC;AAChB,CAAC;AAED,sBAAsB;AACtB,MAAM,UAAU,KAAK;IACjB,OAAO,YAAY,CAAC,MAAM,CAAC,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,QAAQ;IACpB,OAAO,YAAY,CAAC,SAAS,CAAC,CAAC;AACnC,CAAC;AAED,MAAM,UAAU,MAAM;IAClB,OAAO,CACH,YAAY,CAAC,OAAO,CAAC;QACrB,yFAAyF;QACzF,CAAC,KAAK,EAAE,IAAI,SAAS,CAAC,cAAc,GAAG,CAAC,CAAC,CAC5C,CAAC;AACN,CAAC;AAED,MAAM,UAAU,KAAK;IACjB,OAAO,QAAQ,EAAE,IAAI,MAAM,EAAE,CAAC;AAClC,CAAC;AAED,sBAAsB;AACtB,MAAM,UAAU,aAAa;IACzB,OAAO,KAAK,EAAE,IAAI,KAAK,EAAE,CAAC;AAC9B,CAAC;AAED,sBAAsB;AACtB,MAAM,UAAU,QAAQ;IACpB,OAAO,aAAa,CAAC,aAAa,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;AACvD,CAAC;AAED,sBAAsB;AACtB,MAAM,UAAU,QAAQ;IACpB,OAAO,aAAa,CAAC,QAAQ,CAAC,CAAC;AACnC,CAAC;AAED,MAAM,UAAU,SAAS;IACrB,OAAO,aAAa,CAAC,SAAS,CAAC,CAAC;AACpC,CAAC","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\nfunction testUserAgent(re: RegExp): boolean {\n return typeof window !== 'undefined' && window.navigator != null\n ? re.test(window.navigator.userAgent)\n : false;\n}\n\nfunction testPlatform(re: RegExp): boolean {\n return typeof window !== 'undefined' && window.navigator != null\n ? re.test(window.navigator.platform)\n : false;\n}\n\n/* c8 ignore next 3 */\nexport function isMac(): boolean {\n return testPlatform(/^Mac/);\n}\n\nexport function isIPhone(): boolean {\n return testPlatform(/^iPhone/);\n}\n\nexport function isIPad(): boolean {\n return (\n testPlatform(/^iPad/) ||\n // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.\n (isMac() && navigator.maxTouchPoints > 1)\n );\n}\n\nexport function isIOS(): boolean {\n return isIPhone() || isIPad();\n}\n\n/* c8 ignore next 3 */\nexport function isAppleDevice(): boolean {\n return isMac() || isIOS();\n}\n\n/* c8 ignore next 3 */\nexport function isWebKit(): boolean {\n return testUserAgent(/AppleWebKit/) && !isChrome();\n}\n\n/* c8 ignore next 3 */\nexport function isChrome(): boolean {\n return testUserAgent(/Chrome/);\n}\n\nexport function isAndroid(): boolean {\n return testUserAgent(/Android/);\n}\n"]}
|