@olomonhelpdesk2/helpdesk 0.1.9 → 0.1.10

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.
@@ -154,7 +154,20 @@ var CAPTURE_CONTRACT = {
154
154
  /**
155
155
  * Injected before every shot. Necessary, not sufficient — see above.
156
156
  */
157
- motionOff: "*,*::before,*::after{animation:none!important;transition:none!important;caret-color:transparent!important}"
157
+ motionOff: "*,*::before,*::after{animation:none!important;transition:none!important;caret-color:transparent!important}",
158
+ /**
159
+ * What an app uses to leave its own floating widgets out of the pictures.
160
+ *
161
+ * A feedback button or a chat launcher sits on top of the product on every
162
+ * screen, and an article about the product should show only the product. The
163
+ * capture sets `marker` on `<html>` of every page it photographs, so an app
164
+ * can style a widget away under `html[data-helpdesk-capture]`, and it removes
165
+ * any element carrying `hide` itself. Removed before the screen is read, so
166
+ * what is not in the picture is not asked about either.
167
+ */
168
+ marker: "data-helpdesk-capture",
169
+ hide: "data-helpdesk-hide",
170
+ hideOff: "[data-helpdesk-hide]{display:none!important}"
158
171
  };
159
172
  var VISUAL_STABILITY = {
160
173
  /** Gap between comparison frames. Short enough to be cheap, long enough to differ. */
@@ -2077,6 +2090,8 @@ async function playwrightBrowser(options = {}) {
2077
2090
  const response = await page.goto(url, { waitUntil: "networkidle", timeout: 3e4 });
2078
2091
  status = response?.status();
2079
2092
  await page.addStyleTag({ content: CAPTURE_CONTRACT.motionOff }).catch(() => void 0);
2093
+ await page.addStyleTag({ content: CAPTURE_CONTRACT.hideOff }).catch(() => void 0);
2094
+ await page.evaluate((name) => document.documentElement.setAttribute(name, ""), CAPTURE_CONTRACT.marker).catch(() => void 0);
2080
2095
  await page.evaluate(() => document.fonts?.ready).catch(() => void 0);
2081
2096
  },
2082
2097
  async text() {
@@ -3193,7 +3208,8 @@ function buildStoryboard(options) {
3193
3208
  const beneath = options.routes.filter(
3194
3209
  (route) => !covered.has(route.path) && !route.skipped && [...covered].some((base) => base !== "/" && route.path.startsWith(`${base}/`))
3195
3210
  );
3196
- const ordered = [...covered].map((path3) => byPath.get(path3)).filter((route) => Boolean(route) && !route.skipped).sort((a, b) => a.path.length - b.path.length).concat(beneath.sort((a, b) => a.path.length - b.path.length));
3211
+ const own = [...covered].map((path3) => byPath.get(path3)).filter((route) => Boolean(route) && !route.skipped);
3212
+ const ordered = options.inOrder ? own : own.sort((a, b) => a.path.length - b.path.length).concat(beneath.sort((a, b) => a.path.length - b.path.length));
3197
3213
  const limit = options.maxSteps ?? 5;
3198
3214
  const steps = ordered.slice(0, limit).map((route, index) => ({
3199
3215
  route: route.path,
package/helpdesk-seed.mjs CHANGED
@@ -1002,7 +1002,20 @@ var CAPTURE_CONTRACT = {
1002
1002
  /**
1003
1003
  * Injected before every shot. Necessary, not sufficient — see above.
1004
1004
  */
1005
- motionOff: "*,*::before,*::after{animation:none!important;transition:none!important;caret-color:transparent!important}"
1005
+ motionOff: "*,*::before,*::after{animation:none!important;transition:none!important;caret-color:transparent!important}",
1006
+ /**
1007
+ * What an app uses to leave its own floating widgets out of the pictures.
1008
+ *
1009
+ * A feedback button or a chat launcher sits on top of the product on every
1010
+ * screen, and an article about the product should show only the product. The
1011
+ * capture sets `marker` on `<html>` of every page it photographs, so an app
1012
+ * can style a widget away under `html[data-helpdesk-capture]`, and it removes
1013
+ * any element carrying `hide` itself. Removed before the screen is read, so
1014
+ * what is not in the picture is not asked about either.
1015
+ */
1016
+ marker: "data-helpdesk-capture",
1017
+ hide: "data-helpdesk-hide",
1018
+ hideOff: "[data-helpdesk-hide]{display:none!important}"
1006
1019
  };
1007
1020
  var RECORDING_MISS_STATUS = 599;
1008
1021
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@olomonhelpdesk2/helpdesk",
3
- "version": "0.1.9",
3
+ "version": "0.1.10",
4
4
  "description": "Reads a product's screens, plans its help articles, and photographs them.",
5
5
  "type": "module",
6
6
  "engines": {