@percy/report 1.0.2 → 1.0.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.
@@ -171,11 +171,15 @@
171
171
  </head>
172
172
 
173
173
  <body>
174
- <script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>
175
- <!-- Load React. -->
176
- <!-- Note: when deploying, replace "development.js" with "production.min.js". -->
177
- <script src="https://unpkg.com/react@16/umd/react.development.js" crossorigin></script>
178
- <script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js" crossorigin></script>
174
+ <script>
175
+ <%- babel %>
176
+ </script>
177
+ <script>
178
+ <%- react %>
179
+ </script>
180
+ <script>
181
+ <%- reactdom %>
182
+ </script>
179
183
 
180
184
  <main id="root"></main>
181
185
 
@@ -197,7 +201,7 @@
197
201
  let diffRatios = current.comparisons.map((c) => Number(c['diff-percentage']))
198
202
  current['diff-ratios'] = diffRatios;
199
203
  current['max-diff'] = Math.max(...diffRatios);
200
- const isChanged = diffRatios.some((d) => d > 0)
204
+ const isChanged = current.comparisons.some((c)=>c.images && (c.images.diff || !c.images.base))
201
205
  if (isChanged) {
202
206
  map.changed.push(current)
203
207
  } else {
@@ -239,7 +243,7 @@
239
243
  const Picker = function (props) {
240
244
  React.useEffect(() => {
241
245
  if (props.items.length > 0 && !props.items.includes(props.value)) {
242
- props.onChange(props.items.at(0))
246
+ props.onChange(props.items[0])
243
247
  }
244
248
  }, [props])
245
249
  if (!props.items || props.items.length == 0) {
@@ -281,7 +285,7 @@
281
285
  const [loadingDIFF, SetLoadingDiff] = React.useState(false)
282
286
  const headImage = React.useRef()
283
287
  const diffImage = React.useRef()
284
- const loading = loadingDIFF || loadingHead
288
+ const loading = loadingHead
285
289
  React.useEffect(() => {
286
290
  setTimeout(() => {
287
291
  SetLoadingHead(headImage.current ? !headImage.current.complete : true)
@@ -310,13 +314,13 @@
310
314
 
311
315
  function App() {
312
316
  const [filters, SetFilters] = React.useState(() => {
313
- const snapshot = BuildData.details.at(0)
314
- const comparison = snapshot && snapshot.comparisons.at(0)
317
+ const snapshot = BuildData.details[0]
318
+ const comparison = snapshot && snapshot.comparisons[0]
315
319
  return {
316
320
  snapshots: 'changed',
317
321
  diffThreshold: 0,
318
322
  search: '',
319
- activeSnapshot: snapshot ? BuildData.details.at(0).name : '',
323
+ activeSnapshot: snapshot ? BuildData.details[0].name : '',
320
324
  activeBrowser: comparison ? comparison.browser : null,
321
325
  activeWidth: comparison ? comparison.width : null,
322
326
  activeDevice: comparison ? comparison.device : null
@@ -400,7 +404,7 @@
400
404
  }
401
405
  const PrevSnapshot = () => {
402
406
  if (activeSnapshot && activeSnapshot.index > 0) {
403
- SetFilter({ activeSnapshot: snapshots.at(activeSnapshot.index - 1).name })
407
+ SetFilter({ activeSnapshot: snapshots[activeSnapshot.index - 1].name })
404
408
  }
405
409
  }
406
410
  const getImage = (comp, kind) => {
@@ -448,14 +452,6 @@
448
452
  <p className="text-start flex-1 capitalize">Unreviewed Snapshots</p>
449
453
  <p >{BuildData['unreviewedScreenshots']}</p>
450
454
  </div>
451
- <div className={`flex p-1 rounded`}>
452
- <p className="text-start flex-1 capitalize">Total Screenshots</p>
453
- <p >{BuildData['totalScreenshots']}</p>
454
- </div>
455
- <div className={`flex p-1 rounded`}>
456
- <p className="text-start flex-1 capitalize">Unreviewed Screenshots</p>
457
- <p >{BuildData['unreviewedSnapshots']}</p>
458
- </div>
459
455
  </div>
460
456
  </div>
461
457
  <div id="thumbnails" className="p-2">