helldots 0.7.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +96 -0
- package/dist/helldots.esm.js +6 -6
- package/dist/helldots.esm.js.map +4 -4
- package/dist/helldots.umd.js +12 -12
- package/dist/index.d.ts +62 -0
- package/package.json +3 -2
package/dist/index.d.ts
CHANGED
|
@@ -323,6 +323,68 @@ export interface CommentOverlayOptions {
|
|
|
323
323
|
* font or adding `crossorigin` to the `<link>`.
|
|
324
324
|
*/
|
|
325
325
|
embedCrossOriginFonts?: boolean;
|
|
326
|
+
/**
|
|
327
|
+
* Narrows the screenshot renderer's computed-style enumeration to a
|
|
328
|
+
* curated allow-list instead of every property the browser exposes.
|
|
329
|
+
*
|
|
330
|
+
* The enumeration IS the render: it is ~91% of a capture's cost and it
|
|
331
|
+
* scales with element count, so on a page with a few thousand live nodes
|
|
332
|
+
* it is the difference between a capture that finishes and one that
|
|
333
|
+
* visibly stalls. Measured at ~2.7x off that phase.
|
|
334
|
+
*
|
|
335
|
+
* Off by default because the list is a fidelity contract, and no list can
|
|
336
|
+
* be complete for a page this library has never seen: a property it does
|
|
337
|
+
* not name is simply absent from the image. Turn it on for a heavy page,
|
|
338
|
+
* then look at a capture before trusting it — and report anything that
|
|
339
|
+
* comes out wrong, since the fix is one more entry in the list.
|
|
340
|
+
*/
|
|
341
|
+
fastCapture?: boolean;
|
|
342
|
+
/**
|
|
343
|
+
* Renders embedded documents as blank instead of cloning their contents.
|
|
344
|
+
*
|
|
345
|
+
* An iframe's cost is invisible from the outside: the renderer walks into
|
|
346
|
+
* a same-origin frame and clones its whole document, so a page reporting
|
|
347
|
+
* 242 elements can be a capture of 9 245. Measured at 2374 ms against
|
|
348
|
+
* 82 ms on one 9 000-node embedded frame.
|
|
349
|
+
*
|
|
350
|
+
* The `<iframe>` element itself is kept — its box, its border and the
|
|
351
|
+
* space it occupies. Removing the element instead would slide everything
|
|
352
|
+
* below it up by the frame's height and misalign the crop.
|
|
353
|
+
*
|
|
354
|
+
* Nothing to gain on a cross-origin frame: the renderer cannot read it,
|
|
355
|
+
* so it is already blank in the output (it does not stall or wait on it
|
|
356
|
+
* either). This is for same-origin frames, where the trade is real —
|
|
357
|
+
* their content is what you lose.
|
|
358
|
+
*/
|
|
359
|
+
skipIframeContent?: boolean;
|
|
360
|
+
/**
|
|
361
|
+
* Milliseconds a single remote asset may hold a capture up.
|
|
362
|
+
*
|
|
363
|
+
* The renderer re-fetches the page's images, fonts and `@import`s so it can
|
|
364
|
+
* inline them, and gives each one an `AbortController` set to 30 000 ms by
|
|
365
|
+
* default. A URL that never answers stalls the capture until that fires —
|
|
366
|
+
* the capture still succeeds, with that asset replaced by a transparent
|
|
367
|
+
* placeholder, but it waits first.
|
|
368
|
+
*
|
|
369
|
+
* The wait is **bounded, not multiplied**: measured at the same ~2x the
|
|
370
|
+
* timeout whether one asset is dead or ten, because they are waited on
|
|
371
|
+
* concurrently. It is 2x rather than 1x because this one number drives two
|
|
372
|
+
* waits in sequence on the same asset — first for the image already on the
|
|
373
|
+
* page to finish loading, then for the fetch that inlines it. Budget
|
|
374
|
+
* accordingly: 5000 here means roughly ten seconds.
|
|
375
|
+
*
|
|
376
|
+
* Left at the renderer's default because lowering it trades a slow capture
|
|
377
|
+
* for a silently incomplete one: an asset that was merely slow, rather than
|
|
378
|
+
* dead, is dropped and leaves a hole in the image with nothing to say so.
|
|
379
|
+
* Set it only if you have measured your own page and decided which way you
|
|
380
|
+
* want that to fail.
|
|
381
|
+
*
|
|
382
|
+
* Only a finite positive number is honoured. The two values a host would
|
|
383
|
+
* reach for to mean "no deadline" both do the opposite and are ignored: the
|
|
384
|
+
* renderer reads 0 as "never give up", and `Infinity` is coerced by
|
|
385
|
+
* `setTimeout` to 0, aborting every asset immediately.
|
|
386
|
+
*/
|
|
387
|
+
captureTimeout?: number;
|
|
326
388
|
/**
|
|
327
389
|
* Identity used as the author of new comments and replies.
|
|
328
390
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "helldots",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Drop-in comment overlay for web apps — click anywhere to leave a comment anchored to that element, with an automatic screenshot and environment capture",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"comments",
|
|
@@ -68,12 +68,13 @@
|
|
|
68
68
|
"eslint-config-prettier": "^10.1.8",
|
|
69
69
|
"globals": "^17.7.0",
|
|
70
70
|
"jsdom": "^29.1.1",
|
|
71
|
+
"modern-screenshot": "^4.7.0",
|
|
71
72
|
"nanoid": "^6.0.1",
|
|
72
73
|
"prettier": "^3.9.4",
|
|
73
74
|
"typescript": "^6.0.3",
|
|
74
75
|
"vitest": "^4.1.9"
|
|
75
76
|
},
|
|
76
|
-
"
|
|
77
|
+
"peerDependencies": {
|
|
77
78
|
"modern-screenshot": "^4.7.0"
|
|
78
79
|
}
|
|
79
80
|
}
|