@mhosaic/feedback 0.21.0 → 0.23.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.
@@ -1,4 +1,4 @@
1
- import { F as FeedbackApi } from './types-CfSqqfkw.js';
1
+ import { F as FeedbackApi } from './types-CKwnZDsE.js';
2
2
  import './types-CRbb2Pp0.js';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { a as FeedbackConfig, F as FeedbackApi, R as ReportTransformer } from './types-CfSqqfkw.js';
1
+ import { a as FeedbackConfig, F as FeedbackApi, R as ReportTransformer } from './types-CKwnZDsE.js';
2
2
 
3
3
  interface InternalConfig extends FeedbackConfig {
4
4
  fetchImpl?: typeof fetch;
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export { c as createFeedback } from './index-CmHNkJsj.js';
2
- export { C as CapturedContext, F as FeedbackApi, a as FeedbackConfig, b as FeedbackEnv, c as FeedbackSeverity, d as FeedbackType, e as ReportPayload, S as SubmittedReport, U as UserIdentity } from './types-CfSqqfkw.js';
1
+ export { c as createFeedback } from './index-DHNIgEcR.js';
2
+ export { C as CapturedContext, F as FeedbackApi, a as FeedbackConfig, b as FeedbackEnv, c as FeedbackSeverity, d as FeedbackType, e as ReportPayload, S as SubmittedReport, U as UserIdentity } from './types-CKwnZDsE.js';
3
3
  import './types-CRbb2Pp0.js';
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createFeedback
3
- } from "./chunk-2I7RGRYD.mjs";
3
+ } from "./chunk-NCNRU3SR.mjs";
4
4
  import "./chunk-4QOIFIT5.mjs";
5
5
  import "./chunk-FGA63IEZ.mjs";
6
6
  export {
@@ -1,7 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ReactNode } from 'react';
3
3
  import { ErrorTrackingOptions } from '../error-tracking.js';
4
- import { a as FeedbackConfig, F as FeedbackApi } from '../types-CfSqqfkw.js';
4
+ import { a as FeedbackConfig, F as FeedbackApi } from '../types-CKwnZDsE.js';
5
5
  import '../types-CRbb2Pp0.js';
6
6
 
7
7
  interface FeedbackProviderProps extends FeedbackConfig {
package/dist/loader.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { a as FeedbackConfig, F as FeedbackApi } from './types-CfSqqfkw.js';
1
+ import { a as FeedbackConfig, F as FeedbackApi } from './types-CKwnZDsE.js';
2
2
  import { ErrorTrackingOptions } from './error-tracking.js';
3
3
  import './types-CRbb2Pp0.js';
4
4
 
package/dist/qa-meter.mjs CHANGED
@@ -223,13 +223,25 @@ var QA_METER_STYLES = `
223
223
 
224
224
  /* \u2500\u2500 Pastille (FAB circle) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
225
225
 
226
- .qa-pastille {
226
+ /* The wrap is the fixed, bottom-right anchor for the whole pastille cluster.
227
+ It MUST be a positioning context: the hover panel .qa-panel is
228
+ position:absolute and is a SIBLING of the pastille, so without a positioned
229
+ wrap it would anchor to :host (fixed, no offsets \u2014 i.e. the top-left of the
230
+ screen) instead of sitting above the FAB. The --mqa-right/--mqa-bottom knobs
231
+ (set on the host, inherited here) keep driving the on-screen position. The
232
+ fixed sitemap modal inside the wrap anchors to the viewport regardless, so
233
+ it's unaffected. */
234
+ .qa-pastille-wrap {
227
235
  position: fixed;
228
236
  right: var(--mqa-right, 1.5rem);
229
237
  bottom: var(--mqa-bottom, 1.5rem);
230
238
  z-index: var(--mqa-z-index);
231
239
  }
232
240
 
241
+ .qa-pastille {
242
+ position: relative;
243
+ }
244
+
233
245
  .qa-pastille__dot {
234
246
  width: 48px;
235
247
  height: 48px;
@@ -240,7 +252,9 @@ var QA_METER_STYLES = `
240
252
  cursor: pointer;
241
253
  box-shadow: var(--mqa-shadow);
242
254
  color: rgba(0, 0, 0, 0.5);
243
- animation: qa-heartbeat 2.4s ease-in-out infinite;
255
+ /* No idle animation \u2014 the pastille stays static until interacted with, like
256
+ the feedback FAB. (Previously pulsed on a perpetual keyframe loop.) Only
257
+ the hover transition below animates. */
244
258
  transition: transform 0.15s ease, box-shadow 0.15s ease;
245
259
  border: none;
246
260
  }
@@ -259,13 +273,6 @@ var QA_METER_STYLES = `
259
273
  :host([data-mqa-size="sm"]) .qa-pastille__dot { width: 24px; height: 24px; }
260
274
  :host([data-mqa-size="sm"]) .qa-pastille__ecg { width: 15px; height: 8px; }
261
275
 
262
- .qa-pastille__panel {
263
- position: absolute;
264
- bottom: calc(100% + 0.5rem);
265
- right: 0;
266
- z-index: var(--mqa-z-panel);
267
- }
268
-
269
276
  /* Color overrides: on colored backgrounds the ECG trace needs a dark stroke. */
270
277
  .qa-pastille__dot.qa--green,
271
278
  .qa-pastille__dot.qa--yellow,
@@ -278,13 +285,6 @@ var QA_METER_STYLES = `
278
285
  color: rgba(0, 0, 0, 0.45);
279
286
  }
280
287
 
281
- @keyframes qa-heartbeat {
282
- 0%, 100% { transform: scale(1); }
283
- 8% { transform: scale(1.1); }
284
- 16% { transform: scale(1); }
285
- 24% { transform: scale(1.06); }
286
- }
287
-
288
288
  .qa-fade-enter-active,
289
289
  .qa-fade-leave-active {
290
290
  transition: opacity 0.15s ease, transform 0.15s ease;
@@ -296,11 +296,32 @@ var QA_METER_STYLES = `
296
296
  }
297
297
 
298
298
  @media (prefers-reduced-motion: reduce) {
299
- .qa-pastille__dot { animation: none; transition: none; }
299
+ .qa-pastille__dot { transition: none; }
300
300
  }
301
301
 
302
302
  /* \u2500\u2500 Test panel \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
303
303
 
304
+ /* The hover panel anchors above the pastille inside the fixed
305
+ .qa-pastille-wrap. The ANCHOR (not the panel) is what's taken out of flow:
306
+ it MUST be absolute so the wrap shrink-wraps to the pastille dot \u2014 an in-flow
307
+ panel would stretch the wrap to 340px and either push the dot aside or (on a
308
+ tall, scrolled host page) drive a scrollbar-reflow feedback loop that makes
309
+ the FAB jump. (The donor's positioning lived on an orphaned
310
+ .qa-pastille__panel selector that matched nothing after the Vue\u2192Preact port
311
+ renamed the root to .qa-panel.)
312
+
313
+ The anchor's padding-bottom renders the 0.5rem visual gap between the dot
314
+ and the panel AS PART of the hover region, so sweeping the cursor from the
315
+ dot up onto the panel never crosses dead space \u2192 never fires the wrap's
316
+ mouseleave \u2192 no flicker. (Paired with a small close-delay in mount.tsx.) */
317
+ .qa-panel-anchor {
318
+ position: absolute;
319
+ bottom: 100%;
320
+ right: 0;
321
+ padding-bottom: 0.5rem;
322
+ z-index: var(--mqa-z-panel);
323
+ }
324
+
304
325
  .qa-panel {
305
326
  background: var(--mqa-bg);
306
327
  border-radius: var(--mqa-radius);
@@ -1428,9 +1449,7 @@ function warnBadFormatOnce() {
1428
1449
  if (warnedBadFormat) return;
1429
1450
  warnedBadFormat = true;
1430
1451
  if (typeof console !== "undefined") {
1431
- console.warn(
1432
- "[mqa] QA Meter artifact has an unsupported `format` \u2014 refusing to mount."
1433
- );
1452
+ console.warn("[mqa] QA Meter artifact has an unsupported `format` \u2014 refusing to mount.");
1434
1453
  }
1435
1454
  }
1436
1455
  var NOOP_HANDLE = {
@@ -1548,17 +1567,22 @@ function createQaMeter(options) {
1548
1567
  "div",
1549
1568
  {
1550
1569
  class: "qa-pastille-wrap",
1551
- onMouseLeave: () => {
1552
- uiHover = false;
1553
- bump();
1554
- }
1570
+ // Re-entering the wrap (the dot OR the panel above it — both live
1571
+ // inside) cancels a pending close; leaving schedules a debounced close.
1572
+ onMouseEnter: cancelHoverClose,
1573
+ onMouseLeave: scheduleHoverClose
1555
1574
  },
1556
- uiHover ? h5(TestPanel, { page: resolved.page, state: resolved.state, meta, strings }) : null,
1575
+ uiHover ? h5(
1576
+ "div",
1577
+ { class: "qa-panel-anchor" },
1578
+ h5(TestPanel, { page: resolved.page, state: resolved.state, meta, strings })
1579
+ ) : null,
1557
1580
  h5(Pastille, {
1558
1581
  color: resolved.color,
1559
1582
  state: resolved.state,
1560
1583
  strings,
1561
1584
  onHover: () => {
1585
+ cancelHoverClose();
1562
1586
  uiHover = true;
1563
1587
  onHover();
1564
1588
  bump();
@@ -1575,6 +1599,23 @@ function createQaMeter(options) {
1575
1599
  }
1576
1600
  let uiOpen = false;
1577
1601
  let uiHover = false;
1602
+ let hoverCloseTimer = null;
1603
+ const HOVER_CLOSE_MS = 140;
1604
+ function cancelHoverClose() {
1605
+ if (hoverCloseTimer !== null) {
1606
+ clearTimeout(hoverCloseTimer);
1607
+ hoverCloseTimer = null;
1608
+ }
1609
+ }
1610
+ function scheduleHoverClose() {
1611
+ cancelHoverClose();
1612
+ hoverCloseTimer = setTimeout(() => {
1613
+ hoverCloseTimer = null;
1614
+ if (disposed) return;
1615
+ uiHover = false;
1616
+ forceRender();
1617
+ }, HOVER_CLOSE_MS);
1618
+ }
1578
1619
  function mountTree() {
1579
1620
  render(h5(Container, {}), mountPoint);
1580
1621
  }
@@ -1596,6 +1637,7 @@ function createQaMeter(options) {
1596
1637
  dispose() {
1597
1638
  if (disposed) return;
1598
1639
  disposed = true;
1640
+ cancelHoverClose();
1599
1641
  render(null, mountPoint);
1600
1642
  host.remove();
1601
1643
  unpatchHistory();