@percy/core 1.26.2 → 1.26.3-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api.js +8 -7
- package/dist/browser.js +13 -5
- package/dist/discovery.js +37 -32
- package/dist/install.js +3 -2
- package/dist/network.js +78 -33
- package/dist/page.js +23 -17
- package/dist/percy.js +55 -45
- package/dist/queue.js +32 -28
- package/dist/server.js +18 -11
- package/dist/session.js +2 -1
- package/dist/snapshot.js +69 -59
- package/dist/utils.js +12 -10
- package/package.json +11 -8
package/dist/utils.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
4
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
5
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
1
6
|
import EventEmitter from 'events';
|
|
2
7
|
import { sha256hash } from '@percy/client/utils';
|
|
3
8
|
export { request, getPackageJSON, hostnameMatches } from '@percy/client/utils';
|
|
@@ -22,13 +27,12 @@ export function normalizeURL(url) {
|
|
|
22
27
|
// Creates a local resource object containing the resource URL, mimetype, content, sha, and any
|
|
23
28
|
// other additional resources attributes.
|
|
24
29
|
export function createResource(url, content, mimetype, attrs) {
|
|
25
|
-
return {
|
|
26
|
-
...attrs,
|
|
30
|
+
return _objectSpread(_objectSpread({}, attrs), {}, {
|
|
27
31
|
sha: sha256hash(content),
|
|
28
32
|
mimetype,
|
|
29
33
|
content,
|
|
30
34
|
url
|
|
31
|
-
};
|
|
35
|
+
});
|
|
32
36
|
}
|
|
33
37
|
|
|
34
38
|
// Creates a root resource object with an additional `root: true` property. The URL is normalized
|
|
@@ -108,10 +112,9 @@ export class AbortController {
|
|
|
108
112
|
// Similar to DOMException[AbortError] but accepts additional properties
|
|
109
113
|
export class AbortError extends Error {
|
|
110
114
|
constructor(msg = 'This operation was aborted', props) {
|
|
111
|
-
Object.assign(super(msg), {
|
|
112
|
-
name: 'AbortError'
|
|
113
|
-
|
|
114
|
-
});
|
|
115
|
+
Object.assign(super(msg), _objectSpread({
|
|
116
|
+
name: 'AbortError'
|
|
117
|
+
}, props));
|
|
115
118
|
}
|
|
116
119
|
}
|
|
117
120
|
|
|
@@ -214,10 +217,9 @@ async function scrollToBottom(options, onScroll) {
|
|
|
214
217
|
let size = () => Math.ceil(document.body.scrollHeight / window.innerHeight);
|
|
215
218
|
for (let s, i = 1; i < (s = size()); i++) {
|
|
216
219
|
var _onScroll;
|
|
217
|
-
window.scrollTo({
|
|
218
|
-
...options,
|
|
220
|
+
window.scrollTo(_objectSpread(_objectSpread({}, options), {}, {
|
|
219
221
|
top: window.innerHeight * i
|
|
220
|
-
});
|
|
222
|
+
}));
|
|
221
223
|
await ((_onScroll = onScroll) === null || _onScroll === void 0 ? void 0 : _onScroll(i, s));
|
|
222
224
|
}
|
|
223
225
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@percy/core",
|
|
3
|
-
"version": "1.26.
|
|
3
|
+
"version": "1.26.3-alpha.4",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
},
|
|
10
10
|
"publishConfig": {
|
|
11
11
|
"access": "public",
|
|
12
|
-
"tag": "
|
|
12
|
+
"tag": "alpha"
|
|
13
13
|
},
|
|
14
14
|
"engines": {
|
|
15
15
|
"node": ">=14"
|
|
@@ -24,7 +24,10 @@
|
|
|
24
24
|
"types": "./types/index.d.ts",
|
|
25
25
|
"type": "module",
|
|
26
26
|
"exports": {
|
|
27
|
-
".":
|
|
27
|
+
".": {
|
|
28
|
+
"types": "./types/index.d.ts",
|
|
29
|
+
"default": "./dist/index.js"
|
|
30
|
+
},
|
|
28
31
|
"./utils": "./dist/utils.js",
|
|
29
32
|
"./config": "./dist/config.js",
|
|
30
33
|
"./install": "./dist/install.js",
|
|
@@ -40,10 +43,10 @@
|
|
|
40
43
|
"test:types": "tsd"
|
|
41
44
|
},
|
|
42
45
|
"dependencies": {
|
|
43
|
-
"@percy/client": "1.26.
|
|
44
|
-
"@percy/config": "1.26.
|
|
45
|
-
"@percy/dom": "1.26.
|
|
46
|
-
"@percy/logger": "1.26.
|
|
46
|
+
"@percy/client": "1.26.3-alpha.4",
|
|
47
|
+
"@percy/config": "1.26.3-alpha.4",
|
|
48
|
+
"@percy/dom": "1.26.3-alpha.4",
|
|
49
|
+
"@percy/logger": "1.26.3-alpha.4",
|
|
47
50
|
"content-disposition": "^0.5.4",
|
|
48
51
|
"cross-spawn": "^7.0.3",
|
|
49
52
|
"extract-zip": "^2.0.1",
|
|
@@ -54,5 +57,5 @@
|
|
|
54
57
|
"rimraf": "^3.0.2",
|
|
55
58
|
"ws": "^8.0.0"
|
|
56
59
|
},
|
|
57
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "d89ab97b8d5169eafd3eb42bdbbef41a2ac624ba"
|
|
58
61
|
}
|