@adminide-stack/clock-tik-browser 12.0.33-alpha.0 → 12.0.34-alpha.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.
Files changed (48) hide show
  1. package/lib/pages/Home/__tests__/TourOverlay.test.d.ts +2 -0
  2. package/lib/pages/Home/__tests__/TourOverlay.test.d.ts.map +1 -0
  3. package/lib/pages/Home/__tests__/chatTour.test.d.ts +2 -0
  4. package/lib/pages/Home/__tests__/chatTour.test.d.ts.map +1 -0
  5. package/lib/pages/Home/__tests__/tourGeometry.test.d.ts +2 -0
  6. package/lib/pages/Home/__tests__/tourGeometry.test.d.ts.map +1 -0
  7. package/lib/pages/Home/chat/ChoresChat.d.ts.map +1 -1
  8. package/lib/pages/Home/chat/ChoresChat.js +25 -2
  9. package/lib/pages/Home/chat/ChoresChat.js.map +1 -1
  10. package/lib/pages/Home/chat/thread.d.ts +5 -0
  11. package/lib/pages/Home/chat/thread.d.ts.map +1 -1
  12. package/lib/pages/Home/chat/thread.js +14 -1
  13. package/lib/pages/Home/chat/thread.js.map +1 -1
  14. package/lib/pages/Home/chat/tour/ChatTour.d.ts +11 -0
  15. package/lib/pages/Home/chat/tour/ChatTour.d.ts.map +1 -0
  16. package/lib/pages/Home/chat/tour/ChatTour.js +17 -0
  17. package/lib/pages/Home/chat/tour/ChatTour.js.map +1 -0
  18. package/lib/pages/Home/chat/tour/TourDemos.d.ts +20 -0
  19. package/lib/pages/Home/chat/tour/TourDemos.d.ts.map +1 -0
  20. package/lib/pages/Home/chat/tour/TourDemos.js +165 -0
  21. package/lib/pages/Home/chat/tour/TourDemos.js.map +1 -0
  22. package/lib/pages/Home/chat/tour/TourOverlay.d.ts +14 -0
  23. package/lib/pages/Home/chat/tour/TourOverlay.d.ts.map +1 -0
  24. package/lib/pages/Home/chat/tour/TourOverlay.js +1006 -0
  25. package/lib/pages/Home/chat/tour/TourOverlay.js.map +1 -0
  26. package/lib/pages/Home/chat/tour/index.d.ts +3 -0
  27. package/lib/pages/Home/chat/tour/index.d.ts.map +1 -0
  28. package/lib/pages/Home/chat/tour/tourDom.d.ts +36 -0
  29. package/lib/pages/Home/chat/tour/tourDom.d.ts.map +1 -0
  30. package/lib/pages/Home/chat/tour/tourDom.js +81 -0
  31. package/lib/pages/Home/chat/tour/tourDom.js.map +1 -0
  32. package/lib/pages/Home/chat/tour/tourGeometry.d.ts +106 -0
  33. package/lib/pages/Home/chat/tour/tourGeometry.d.ts.map +1 -0
  34. package/lib/pages/Home/chat/tour/tourGeometry.js +348 -0
  35. package/lib/pages/Home/chat/tour/tourGeometry.js.map +1 -0
  36. package/lib/pages/Home/chat/tour/tourSteps.d.ts +45 -0
  37. package/lib/pages/Home/chat/tour/tourSteps.d.ts.map +1 -0
  38. package/lib/pages/Home/chat/tour/tourSteps.js +87 -0
  39. package/lib/pages/Home/chat/tour/tourSteps.js.map +1 -0
  40. package/lib/pages/Home/chat/tour/tourStyles.d.ts +15 -0
  41. package/lib/pages/Home/chat/tour/tourStyles.d.ts.map +1 -0
  42. package/lib/pages/Home/chat/tour/tourStyles.js +156 -0
  43. package/lib/pages/Home/chat/tour/tourStyles.js.map +1 -0
  44. package/lib/pages/Home/chat/tour/useChatTour.d.ts +17 -0
  45. package/lib/pages/Home/chat/tour/useChatTour.d.ts.map +1 -0
  46. package/lib/pages/Home/chat/tour/useChatTour.js +75 -0
  47. package/lib/pages/Home/chat/tour/useChatTour.js.map +1 -0
  48. package/package.json +2 -2
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TourOverlay.js","sources":["../../../../../src/pages/Home/chat/tour/TourOverlay.tsx"],"sourcesContent":[null],"names":["_jsx"],"mappings":"2sBA0EA,MAAM,aAAa,GAAqE,CAAA;MAClF,EAAA,aAAM;OACN,EAAA,oBAAwB;MACxB,EAAA;CACL,EAAC;AAEF,EAA4G,IAAA,EAAA,SAAA;AAC5G,EAAA,yBAA+G;MACzG,EAAA;;MAEA,EAAA,WAAM;OACN,EAAA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A,CAAA;;mBASwE,GAAA,KAAA,CAAA,CAAA,CAAA,IAAA,CAAA;0BACxC,EAAA,CAAA,YAAG,EAAA,EAAA,CAAA,OAAA,CAAA,CAAA,CAAA,CAAA,IAAA,EAAA,EAAA,CAAA,OAAA,CAAA,CAAA,CAAA,CAAA,MAAA,CAAA,EAAA,KAAA,IAAA;AACvB,QAAA,IAAA,CAAA,MAAO,SAAC,GAAA,KAAA;QACZ;AAwMZ,MAAC,GAAA,CAAA,YAAA,EAAA,CAAA,EAAA,EAAA,CAAA,OAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,KAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,3 @@
1
+ export { ChatTour, type ChatTourProps } from './ChatTour';
2
+ export { useChatTour, type ChatTourGate } from './useChatTour';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/pages/Home/chat/tour/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * The chat tour's reach into the page: finding the control a step points at, telling whether it is
3
+ * really on screen, its corner radius, and scrolling it to where it and its card both fit.
4
+ *
5
+ * As in the Yantra app's home tour (yantra-app, features/chat/tour/tourDom.ts), except that a step
6
+ * names its controls through TOUR_TARGETS (tourSteps): Clockbook's own carry a `data-tour` hook,
7
+ * and the kit chat's are found by the classes it gives them.
8
+ */
9
+ import { type Box, type Viewport } from './tourGeometry';
10
+ import { type TourTarget } from './tourSteps';
11
+ export declare function toBox(rect: DOMRectReadOnly | DOMRect): Box;
12
+ /**
13
+ * True when `el` is drawn where the window can show it: it has a size, it is not hidden (itself or
14
+ * by an ancestor - the chat hidden behind the landing), and it has not slid off the side. Below or
15
+ * above the fold still counts: the tour scrolls it in. So does transparent: the empty chat's
16
+ * welcome rises in, and one caught mid-rise is still there.
17
+ */
18
+ export declare function isShown(el: Element): boolean;
19
+ /** The first control on screen for one of `targets`, in the order given. */
20
+ export declare function findTarget(targets: readonly TourTarget[]): HTMLElement | null;
21
+ /** The control's own top-left corner radius, else `fallback` (a wrapper draws none). */
22
+ export declare function cornerRadius(el: Element, fallback: number): number;
23
+ /**
24
+ * The scroller `el` moves with, or null when nothing would move it: no scrolling ancestor, or it
25
+ * is pinned (sticky or fixed), where scrolling would only slide the page out from under the card.
26
+ */
27
+ export declare function scrollerOf(el: HTMLElement): HTMLElement | null;
28
+ /**
29
+ * How far to scroll so `ring` (the target with its padding and ring) and a `cardHeight` card under
30
+ * it both fit, without pushing the ring's top above the scroller's top edge; a ring above the view
31
+ * comes back down into it. Positive scrolls the content up.
32
+ */
33
+ export declare function scrollDelta(ring: Box, scrollArea: Box, cardHeight: number, viewport: Viewport): number;
34
+ /** Where `scroller` stops after scrolling by `delta`, within what it can scroll. */
35
+ export declare function scrollTarget(scroller: HTMLElement, delta: number): number;
36
+ //# sourceMappingURL=tourDom.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tourDom.d.ts","sourceRoot":"","sources":["../../../../../src/pages/Home/chat/tour/tourDom.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAA0B,KAAK,GAAG,EAAE,KAAK,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACjF,OAAO,EAAgB,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAE5D,wBAAgB,KAAK,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,GAAG,GAAG,CAE1D;AAED;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,EAAE,EAAE,OAAO,GAAG,OAAO,CAQ5C;AAED,4EAA4E;AAC5E,wBAAgB,UAAU,CAAC,OAAO,EAAE,SAAS,UAAU,EAAE,GAAG,WAAW,GAAG,IAAI,CAQ7E;AAED,wFAAwF;AACxF,wBAAgB,YAAY,CAAC,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAGlE;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,EAAE,EAAE,WAAW,GAAG,WAAW,GAAG,IAAI,CAQ9D;AAKD;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAOtG;AAED,oFAAoF;AACpF,wBAAgB,YAAY,CAAC,QAAQ,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAGzE"}
@@ -0,0 +1,81 @@
1
+ import {EDGE,SHEET_BELOW,GAP}from'./tourGeometry.js';import {TOUR_TARGETS}from'./tourSteps.js';/**
2
+ * The chat tour's reach into the page: finding the control a step points at, telling whether it is
3
+ * really on screen, its corner radius, and scrolling it to where it and its card both fit.
4
+ *
5
+ * As in the Yantra app's home tour (yantra-app, features/chat/tour/tourDom.ts), except that a step
6
+ * names its controls through TOUR_TARGETS (tourSteps): Clockbook's own carry a `data-tour` hook,
7
+ * and the kit chat's are found by the classes it gives them.
8
+ */
9
+ function toBox(rect) {
10
+ return {
11
+ x: rect.left,
12
+ y: rect.top,
13
+ w: rect.width,
14
+ h: rect.height
15
+ };
16
+ }
17
+ /**
18
+ * True when `el` is drawn where the window can show it: it has a size, it is not hidden (itself or
19
+ * by an ancestor - the chat hidden behind the landing), and it has not slid off the side. Below or
20
+ * above the fold still counts: the tour scrolls it in. So does transparent: the empty chat's
21
+ * welcome rises in, and one caught mid-rise is still there.
22
+ */
23
+ function isShown(el) {
24
+ const rect = el.getBoundingClientRect();
25
+ if (rect.width < 2 || rect.height < 2) return false;
26
+ if (rect.right <= 0 || rect.left >= window.innerWidth) return false;
27
+ const check = el.checkVisibility;
28
+ if (typeof check === 'function') return check.call(el, {
29
+ visibilityProperty: true
30
+ });
31
+ const style = window.getComputedStyle(el);
32
+ return style.visibility !== 'hidden' && style.display !== 'none';
33
+ }
34
+ /** The first control on screen for one of `targets`, in the order given. */
35
+ function findTarget(targets) {
36
+ for (const target of targets) {
37
+ const found = document.querySelectorAll(TOUR_TARGETS[target]);
38
+ for (const el of Array.from(found)) {
39
+ if (isShown(el)) return el;
40
+ }
41
+ }
42
+ return null;
43
+ }
44
+ /** The control's own top-left corner radius, else `fallback` (a wrapper draws none). */
45
+ function cornerRadius(el, fallback) {
46
+ const value = parseFloat(window.getComputedStyle(el).borderTopLeftRadius);
47
+ return Number.isFinite(value) && value > 0 ? value : fallback;
48
+ }
49
+ /**
50
+ * The scroller `el` moves with, or null when nothing would move it: no scrolling ancestor, or it
51
+ * is pinned (sticky or fixed), where scrolling would only slide the page out from under the card.
52
+ */
53
+ function scrollerOf(el) {
54
+ for (let node = el; node && node !== document.body; node = node.parentElement) {
55
+ const style = window.getComputedStyle(node);
56
+ if (style.position === 'sticky' || style.position === 'fixed') return null;
57
+ const scrolls = style.overflowY === 'auto' || style.overflowY === 'scroll';
58
+ if (node !== el && scrolls && node.scrollHeight > node.clientHeight + 1) return node;
59
+ }
60
+ return null;
61
+ }
62
+ /** Slack under a card scrolled into room, so a few pixels of growth do not push it to another side. */
63
+ const SCROLL_SLACK = 12;
64
+ /**
65
+ * How far to scroll so `ring` (the target with its padding and ring) and a `cardHeight` card under
66
+ * it both fit, without pushing the ring's top above the scroller's top edge; a ring above the view
67
+ * comes back down into it. Positive scrolls the content up.
68
+ */
69
+ function scrollDelta(ring, scrollArea, cardHeight, viewport) {
70
+ const top = Math.max(scrollArea.y, 0) + EDGE;
71
+ const bottom = Math.min(scrollArea.y + scrollArea.h, viewport.height) - EDGE;
72
+ if (ring.y < top) return ring.y - top;
73
+ const room = viewport.width < SHEET_BELOW ? EDGE : GAP;
74
+ const overflow = ring.y + ring.h + room + cardHeight + SCROLL_SLACK - bottom;
75
+ return overflow > 0 ? Math.min(overflow, ring.y - top) : 0;
76
+ }
77
+ /** Where `scroller` stops after scrolling by `delta`, within what it can scroll. */
78
+ function scrollTarget(scroller, delta) {
79
+ const max = Math.max(0, scroller.scrollHeight - scroller.clientHeight);
80
+ return Math.min(max, Math.max(0, scroller.scrollTop + delta));
81
+ }export{cornerRadius,findTarget,isShown,scrollDelta,scrollTarget,scrollerOf,toBox};//# sourceMappingURL=tourDom.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tourDom.js","sources":["../../../../../src/pages/Home/chat/tour/tourDom.ts"],"sourcesContent":[null],"names":[],"mappings":"+FAAA;;;;;;;AAOG;AAIG,SAAU,KAAK,CAAC,IAA+B,EAAA;SAC1C;AACX,IAAC,CAAA,EAAA,IAAA,CAAA,IAAA;AAED,IAAA,CAAA,EAAA,IAAA,CAAA,GAAA;;;;;AAKG;AACH;AACI;;AACuC;AACvC;AAAuD,gBAAa,CAAA,EAAA,EAAA;AACpE,EAAA,MAAA,IAAW,GAAA,EAAA,CAAI,qBAAqF,EAAA;MAChG,IAAA,CAAA,KAAY,GAAA,CAAA,IAAA,IAAe,CAAA,MAAA,GAAA,CAAA,EAAA,OAAA,KA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@@
1
+ /**
2
+ * The chat tour's geometry: the lit cut-out around what a step points at, where the step's card
3
+ * goes, and the dotted arrow from the card to that cut-out. Pure functions of rectangles, so the
4
+ * overlay's frame loop and the tests read the same numbers.
5
+ *
6
+ * It is the Yantra app's home tour geometry (yantra-app, features/chat/tour/tourGeometry.ts),
7
+ * unchanged: a fix in one belongs in the other.
8
+ *
9
+ * Every box is in viewport pixels (getBoundingClientRect's space): the overlay is `position:
10
+ * fixed` over the whole window.
11
+ */
12
+ export interface Point {
13
+ x: number;
14
+ y: number;
15
+ }
16
+ export interface Box {
17
+ x: number;
18
+ y: number;
19
+ w: number;
20
+ h: number;
21
+ }
22
+ export interface Size {
23
+ w: number;
24
+ h: number;
25
+ }
26
+ export interface Viewport {
27
+ width: number;
28
+ height: number;
29
+ }
30
+ /** The side of its target a card sits on. */
31
+ export type Side = 'top' | 'bottom' | 'left' | 'right';
32
+ /** Where a card goes: its top-left corner and the side of the target it sits on. */
33
+ export interface CardSpot {
34
+ side: Side;
35
+ x: number;
36
+ y: number;
37
+ /** True when it sits whole on a side of its target, with room for the arrow. */
38
+ fits: boolean;
39
+ /** True when it sits inside a large target instead: no arrow, the ring frames both. */
40
+ inside: boolean;
41
+ }
42
+ /** The dotted arrow from a card to its target. */
43
+ export interface Arrow {
44
+ /** The dotted shaft: a curve from the card's edge to just short of the ring. */
45
+ shaft: string;
46
+ /** The solid chevron at the target end. */
47
+ head: string;
48
+ /** The shaft's length, to draw it on. */
49
+ length: number;
50
+ /** Where it leaves the card (its anchor dot) and where it points. */
51
+ tail: Point;
52
+ tip: Point;
53
+ }
54
+ /** Cards, rings and arrows keep this far inside the window. */
55
+ export declare const EDGE = 16;
56
+ /** The room between a ring and its card: what the guide and its arrow sit in. */
57
+ export declare const GAP = 88;
58
+ /** Below this width a card is a sheet across the window, on whichever half its target leaves free. */
59
+ export declare const SHEET_BELOW = 640;
60
+ /** How far the dashed ring stands off the lit cut-out, so it sits on the dimmed page. */
61
+ export declare const RING_OFFSET = 5;
62
+ export declare function clamp(value: number, min: number, max: number): number;
63
+ /** The lit cut-out around a target: the element plus `pad`, kept on screen with room for its ring. */
64
+ export declare function cutoutBox(rect: Box, pad: number, viewport: Viewport): Box;
65
+ /** `box` grown by `by` on every side. */
66
+ export declare function grow(box: Box, by: number): Box;
67
+ /** The largest corner radius up to `radius` that `box` can draw. */
68
+ export declare function fitRadius(radius: number, box: Box): number;
69
+ /** A card of `card` size in the middle of the window (the welcome, which points at nothing). */
70
+ export declare function centreCard(card: Size, viewport: Viewport): CardSpot;
71
+ /**
72
+ * Where a card goes: on the first side in `prefer` where it fits whole, a `GAP` off its target so
73
+ * the arrow has room; failing that, the roomiest side, pulled on screen. On a phone it is a sheet
74
+ * across the window, on the half its target leaves free.
75
+ */
76
+ export declare function placeCard(target: Box, card: Size, viewport: Viewport, prefer?: readonly Side[]): CardSpot;
77
+ /** A rounded rectangle as one closed path, clockwise from its top-left corner. */
78
+ export declare function roundedRectPath(box: Box, radius: number): string;
79
+ /**
80
+ * The veil's outline for `clip-path: path(evenodd, …)`: the whole window, less a rounded hole at
81
+ * `hole` - the frost covers everything but the control being shown. No hole while `hole` has no
82
+ * size (the welcome).
83
+ */
84
+ export declare function veilPath(hole: Box, radius: number, viewport: Viewport): string;
85
+ /** A quadratic curve's length, by walking it in short straight steps. */
86
+ export declare function curveLength(start: Point, control: Point, end: Point, steps?: number): number;
87
+ /**
88
+ * The hand-drawn arrow from a card on `side` of its target to the target's ring: it leaves the
89
+ * middle of the card's facing edge, lands near the middle of the ring (a little toward the card),
90
+ * and bows into an arc that bulges away from the card. Null when the card is too close to (or on
91
+ * top of) the ring for an arrow to say anything.
92
+ */
93
+ export declare function arrowBetween(card: Box, ring: Box, side: Side, viewport: Viewport): Arrow | null;
94
+ /** A value with momentum, for the frame loop's glides. */
95
+ export interface Spring {
96
+ value: number;
97
+ velocity: number;
98
+ }
99
+ /**
100
+ * `spring` one frame on, pulled toward `goal` by a damped spring: `omega` sets how fast (rad/s),
101
+ * `zeta` how much it overshoots (1 = none). Sub-stepped so a dropped frame cannot blow it up.
102
+ */
103
+ export declare function stepSpring(spring: Spring, goal: number, dt: number, omega: number, zeta: number): Spring;
104
+ /** Ease-out for drawing the arrow on: quick off the card, gentle into the target. */
105
+ export declare function easeOutCubic(t: number): number;
106
+ //# sourceMappingURL=tourGeometry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tourGeometry.d.ts","sourceRoot":"","sources":["../../../../../src/pages/Home/chat/tour/tourGeometry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,MAAM,WAAW,KAAK;IAClB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,GAAG;IAChB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,IAAI;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,QAAQ;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAClB;AAED,6CAA6C;AAC7C,MAAM,MAAM,IAAI,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;AAEvD,oFAAoF;AACpF,MAAM,WAAW,QAAQ;IACrB,IAAI,EAAE,IAAI,CAAC;IACX,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,gFAAgF;IAChF,IAAI,EAAE,OAAO,CAAC;IACd,uFAAuF;IACvF,MAAM,EAAE,OAAO,CAAC;CACnB;AAED,kDAAkD;AAClD,MAAM,WAAW,KAAK;IAClB,gFAAgF;IAChF,KAAK,EAAE,MAAM,CAAC;IACd,2CAA2C;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,yCAAyC;IACzC,MAA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MAAM,CAI9E;AAgBD,yEAAyE;AACzE,wBAAgB,WAAW,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,SAAK,GAAG,MAAM,CAcxF;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,GAAG,KAAK,GAAG,IAAI,CAwD/F;AAED,0DAA0D;AAC1D,MAAM,WAAW,MAAM;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CASxG;AAED,qFAAqF;AACrF,wBAAgB,YAAY,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAG9C"}
@@ -0,0 +1,348 @@
1
+ /**
2
+ * The chat tour's geometry: the lit cut-out around what a step points at, where the step's card
3
+ * goes, and the dotted arrow from the card to that cut-out. Pure functions of rectangles, so the
4
+ * overlay's frame loop and the tests read the same numbers.
5
+ *
6
+ * It is the Yantra app's home tour geometry (yantra-app, features/chat/tour/tourGeometry.ts),
7
+ * unchanged: a fix in one belongs in the other.
8
+ *
9
+ * Every box is in viewport pixels (getBoundingClientRect's space): the overlay is `position:
10
+ * fixed` over the whole window.
11
+ */
12
+ /** Cards, rings and arrows keep this far inside the window. */
13
+ const EDGE = 16;
14
+ /** The room between a ring and its card: what the guide and its arrow sit in. */
15
+ const GAP = 88;
16
+ /** Below this width a card is a sheet across the window, on whichever half its target leaves free. */
17
+ const SHEET_BELOW = 640;
18
+ /** How far the dashed ring stands off the lit cut-out, so it sits on the dimmed page. */
19
+ const RING_OFFSET = 5;
20
+ const DEFAULT_SIDES = ['bottom', 'top', 'right', 'left'];
21
+ /** The furthest a card leans off a wide control's middle (see placeCard). */
22
+ const MAX_LEAN = 120;
23
+ /** How far the arrowhead stops short of the ring, and the shaft starts off the card. */
24
+ const TIP_GAP = 7;
25
+ const TAIL_GAP = 6;
26
+ /** The shaft leaves the card inside its rounded corners. */
27
+ const CARD_INSET = 30;
28
+ /** Shorter than this, the card is on top of its target: no arrow. */
29
+ const MIN_ARROW = 26;
30
+ const WING = 11;
31
+ const WING_SPREAD = 0.5;
32
+ function clamp(value, min, max) {
33
+ // A range too small to hold anything (a card wider than the window) centres instead.
34
+ if (max < min) return (min + max) / 2;
35
+ return Math.min(max, Math.max(min, value));
36
+ }
37
+ function distance(a, b) {
38
+ return Math.hypot(a.x - b.x, a.y - b.y);
39
+ }
40
+ /** One decimal: short path strings that still draw smoothly. */
41
+ function px(value) {
42
+ return Math.round(value * 10) / 10;
43
+ }
44
+ /** The lit cut-out around a target: the element plus `pad`, kept on screen with room for its ring. */
45
+ function cutoutBox(rect, pad, viewport) {
46
+ const inset = RING_OFFSET + 2;
47
+ const left = Math.max(rect.x - pad, inset);
48
+ const top = Math.max(rect.y - pad, inset);
49
+ const right = Math.min(rect.x + rect.w + pad, viewport.width - inset);
50
+ const bottom = Math.min(rect.y + rect.h + pad, viewport.height - inset);
51
+ return {
52
+ x: left,
53
+ y: top,
54
+ w: Math.max(0, right - left),
55
+ h: Math.max(0, bottom - top)
56
+ };
57
+ }
58
+ /** `box` grown by `by` on every side. */
59
+ function grow(box, by) {
60
+ return {
61
+ x: box.x - by,
62
+ y: box.y - by,
63
+ w: box.w + by * 2,
64
+ h: box.h + by * 2
65
+ };
66
+ }
67
+ /** The largest corner radius up to `radius` that `box` can draw. */
68
+ function fitRadius(radius, box) {
69
+ return Math.max(0, Math.min(radius, box.w / 2, box.h / 2));
70
+ }
71
+ /** A card of `card` size in the middle of the window (the welcome, which points at nothing). */
72
+ function centreCard(card, viewport) {
73
+ return {
74
+ side: 'bottom',
75
+ x: clamp((viewport.width - card.w) / 2, EDGE, viewport.width - EDGE - card.w),
76
+ y: clamp((viewport.height - card.h) / 2, EDGE, viewport.height - EDGE - card.h),
77
+ fits: true,
78
+ inside: false
79
+ };
80
+ }
81
+ /**
82
+ * Where a card goes: on the first side in `prefer` where it fits whole, a `GAP` off its target so
83
+ * the arrow has room; failing that, the roomiest side, pulled on screen. On a phone it is a sheet
84
+ * across the window, on the half its target leaves free.
85
+ */
86
+ function placeCard(target, card, viewport, prefer = DEFAULT_SIDES) {
87
+ const {
88
+ width,
89
+ height
90
+ } = viewport;
91
+ const centreX = target.x + target.w / 2;
92
+ const centreY = target.y + target.h / 2;
93
+ if (width < SHEET_BELOW) {
94
+ // The sheet has room when it clears the target with a little to spare.
95
+ if (centreY > height / 2) {
96
+ return {
97
+ side: 'top',
98
+ x: EDGE,
99
+ y: EDGE,
100
+ fits: EDGE + card.h + EDGE / 2 <= target.y,
101
+ inside: false
102
+ };
103
+ }
104
+ const y = height - EDGE - card.h;
105
+ return {
106
+ side: 'bottom',
107
+ x: EDGE,
108
+ y,
109
+ fits: target.y + target.h + EDGE / 2 <= y,
110
+ inside: false
111
+ };
112
+ }
113
+ // Under or over a control wider than the card, the card leans toward the middle of the window,
114
+ // so its arrow sweeps across in an arc instead of dropping straight down, and the control's
115
+ // own middle stays in view.
116
+ const lean = target.w > card.w ? Math.min((target.w - card.w) * 0.25, MAX_LEAN) * (centreX > width / 2 ? -1 : 1) : 0;
117
+ const alongX = clamp(centreX + lean - card.w / 2, EDGE, width - EDGE - card.w);
118
+ const alongY = clamp(centreY - card.h / 2, EDGE, height - EDGE - card.h);
119
+ const spots = {
120
+ bottom: {
121
+ side: 'bottom',
122
+ x: alongX,
123
+ y: target.y + target.h + GAP,
124
+ fits: true,
125
+ inside: false
126
+ },
127
+ top: {
128
+ side: 'top',
129
+ x: alongX,
130
+ y: target.y - GAP - card.h,
131
+ fits: true,
132
+ inside: false
133
+ },
134
+ right: {
135
+ side: 'right',
136
+ x: target.x + target.w + GAP,
137
+ y: alongY,
138
+ fits: true,
139
+ inside: false
140
+ },
141
+ left: {
142
+ side: 'left',
143
+ x: target.x - GAP - card.w,
144
+ y: alongY,
145
+ fits: true,
146
+ inside: false
147
+ }
148
+ };
149
+ const fits = ({
150
+ x,
151
+ y
152
+ }) => x >= EDGE - 0.5 && y >= EDGE - 0.5 && x + card.w <= width - EDGE + 0.5 && y + card.h <= height - EDGE + 0.5;
153
+ for (const side of prefer) {
154
+ if (fits(spots[side])) return spots[side];
155
+ }
156
+ // A target big enough to hold the card (a whole section) takes it in its lower right corner,
157
+ // inside the ring, rather than having it shoved over its edge.
158
+ const visibleBottom = Math.min(target.y + target.h, height - EDGE);
159
+ if (target.w >= card.w + EDGE * 2 && visibleBottom - Math.max(target.y, EDGE) >= card.h + EDGE * 2) {
160
+ return {
161
+ side: 'bottom',
162
+ x: clamp(target.x + target.w - EDGE - card.w, EDGE, width - EDGE - card.w),
163
+ y: visibleBottom - EDGE - card.h,
164
+ fits: false,
165
+ inside: true
166
+ };
167
+ }
168
+ // Nothing fits whole: the side that came closest, pulled on screen (ties go to `prefer`'s
169
+ // order). It may cover the target's edge, and then the arrow is too short to draw.
170
+ const shortfall = {
171
+ bottom: height - EDGE - (target.y + target.h + GAP + card.h),
172
+ top: target.y - GAP - card.h - EDGE,
173
+ right: width - EDGE - (target.x + target.w + GAP + card.w),
174
+ left: target.x - GAP - card.w - EDGE
175
+ };
176
+ const order = [...prefer, ...DEFAULT_SIDES.filter(side => !prefer.includes(side))];
177
+ const roomiest = order.reduce((best, side) => shortfall[side] > shortfall[best] ? side : best);
178
+ const spot = spots[roomiest];
179
+ return {
180
+ side: roomiest,
181
+ x: clamp(spot.x, EDGE, width - EDGE - card.w),
182
+ y: clamp(spot.y, EDGE, height - EDGE - card.h),
183
+ fits: false,
184
+ inside: false
185
+ };
186
+ }
187
+ /** A rounded rectangle as one closed path, clockwise from its top-left corner. */
188
+ function roundedRectPath(box, radius) {
189
+ const r = px(fitRadius(radius, box));
190
+ const left = px(box.x);
191
+ const top = px(box.y);
192
+ const right = px(box.x + box.w);
193
+ const bottom = px(box.y + box.h);
194
+ return `M${px(left + r)} ${top}H${px(right - r)}A${r} ${r} 0 0 1 ${right} ${px(top + r)}` + `V${px(bottom - r)}A${r} ${r} 0 0 1 ${px(right - r)} ${bottom}H${px(left + r)}` + `A${r} ${r} 0 0 1 ${left} ${px(bottom - r)}V${px(top + r)}A${r} ${r} 0 0 1 ${px(left + r)} ${top}Z`;
195
+ }
196
+ /**
197
+ * The veil's outline for `clip-path: path(evenodd, …)`: the whole window, less a rounded hole at
198
+ * `hole` - the frost covers everything but the control being shown. No hole while `hole` has no
199
+ * size (the welcome).
200
+ */
201
+ function veilPath(hole, radius, viewport) {
202
+ const outer = `M0 0H${px(viewport.width)}V${px(viewport.height)}H0Z`;
203
+ if (hole.w < 1 || hole.h < 1) return outer;
204
+ return `${outer}${roundedRectPath(hole, radius)}`;
205
+ }
206
+ /** True when the shaft runs from the card toward the target, not back across it. */
207
+ function pointsAtTarget(side, start, end) {
208
+ switch (side) {
209
+ case 'bottom':
210
+ return start.y - end.y >= MIN_ARROW / 2;
211
+ case 'top':
212
+ return end.y - start.y >= MIN_ARROW / 2;
213
+ case 'right':
214
+ return start.x - end.x >= MIN_ARROW / 2;
215
+ default:
216
+ return end.x - start.x >= MIN_ARROW / 2;
217
+ }
218
+ }
219
+ /** A quadratic curve's length, by walking it in short straight steps. */
220
+ function curveLength(start, control, end, steps = 24) {
221
+ let length = 0;
222
+ let previous = start;
223
+ for (let i = 1; i <= steps; i++) {
224
+ const t = i / steps;
225
+ const u = 1 - t;
226
+ const point = {
227
+ x: u * u * start.x + 2 * u * t * control.x + t * t * end.x,
228
+ y: u * u * start.y + 2 * u * t * control.y + t * t * end.y
229
+ };
230
+ length += distance(previous, point);
231
+ previous = point;
232
+ }
233
+ return length;
234
+ }
235
+ /**
236
+ * The hand-drawn arrow from a card on `side` of its target to the target's ring: it leaves the
237
+ * middle of the card's facing edge, lands near the middle of the ring (a little toward the card),
238
+ * and bows into an arc that bulges away from the card. Null when the card is too close to (or on
239
+ * top of) the ring for an arrow to say anything.
240
+ */
241
+ function arrowBetween(card, ring, side, viewport) {
242
+ let start;
243
+ let end;
244
+ if (side === 'top' || side === 'bottom') {
245
+ const ringMid = ring.x + ring.w / 2;
246
+ const sx = clamp(card.x + card.w / 2, card.x + CARD_INSET, card.x + card.w - CARD_INSET);
247
+ const ex = clamp(ringMid + (sx - ringMid) * 0.2, ring.x + 12, ring.x + ring.w - 12);
248
+ start = {
249
+ x: sx,
250
+ y: side === 'bottom' ? card.y - TAIL_GAP : card.y + card.h + TAIL_GAP
251
+ };
252
+ end = {
253
+ x: ex,
254
+ y: side === 'bottom' ? ring.y + ring.h + TIP_GAP : ring.y - TIP_GAP
255
+ };
256
+ } else {
257
+ const ringMid = ring.y + ring.h / 2;
258
+ const sy = clamp(card.y + card.h / 2, card.y + CARD_INSET, card.y + card.h - CARD_INSET);
259
+ const ey = clamp(ringMid + (sy - ringMid) * 0.2, ring.y + 10, ring.y + ring.h - 10);
260
+ start = {
261
+ x: side === 'right' ? card.x - TAIL_GAP : card.x + card.w + TAIL_GAP,
262
+ y: sy
263
+ };
264
+ end = {
265
+ x: side === 'right' ? ring.x + ring.w + TIP_GAP : ring.x - TIP_GAP,
266
+ y: ey
267
+ };
268
+ }
269
+ const dx = end.x - start.x;
270
+ const dy = end.y - start.y;
271
+ const chord = Math.hypot(dx, dy);
272
+ if (chord < MIN_ARROW || !pointsAtTarget(side, start, end)) return null;
273
+ // Bulge away from the card's middle; square-on (the card centred on the line), toward the
274
+ // middle of the window, so the arc never swings off screen.
275
+ const normal = {
276
+ x: -dy / chord,
277
+ y: dx / chord
278
+ };
279
+ const bow = clamp(chord * 0.28, 14, 60);
280
+ const mid = {
281
+ x: (start.x + end.x) / 2,
282
+ y: (start.y + end.y) / 2
283
+ };
284
+ const cardMid = {
285
+ x: card.x + card.w / 2,
286
+ y: card.y + card.h / 2
287
+ };
288
+ const lean = normal.x * (cardMid.x - mid.x) + normal.y * (cardMid.y - mid.y);
289
+ let sign;
290
+ if (Math.abs(lean) > 4) {
291
+ sign = lean > 0 ? -1 : 1;
292
+ } else {
293
+ const toScreenMid = normal.x * (viewport.width / 2 - mid.x) + normal.y * (viewport.height / 2 - mid.y);
294
+ sign = toScreenMid >= 0 ? 1 : -1;
295
+ }
296
+ const control = {
297
+ x: mid.x + normal.x * bow * sign,
298
+ y: mid.y + normal.y * bow * sign
299
+ };
300
+ // The chevron follows the curve's last direction (control point to tip).
301
+ const tx = end.x - control.x;
302
+ const ty = end.y - control.y;
303
+ const tl = Math.hypot(tx, ty) || 1;
304
+ const ux = tx / tl;
305
+ const uy = ty / tl;
306
+ const cos = Math.cos(WING_SPREAD);
307
+ const sin = Math.sin(WING_SPREAD);
308
+ const left = {
309
+ x: end.x - (ux * cos - uy * sin) * WING,
310
+ y: end.y - (ux * sin + uy * cos) * WING
311
+ };
312
+ const right = {
313
+ x: end.x - (ux * cos + uy * sin) * WING,
314
+ y: end.y - (-ux * sin + uy * cos) * WING
315
+ };
316
+ return {
317
+ shaft: `M${px(start.x)} ${px(start.y)}Q${px(control.x)} ${px(control.y)} ${px(end.x)} ${px(end.y)}`,
318
+ head: `M${px(left.x)} ${px(left.y)}L${px(end.x)} ${px(end.y)}L${px(right.x)} ${px(right.y)}`,
319
+ length: curveLength(start, control, end),
320
+ tail: start,
321
+ tip: end
322
+ };
323
+ }
324
+ /**
325
+ * `spring` one frame on, pulled toward `goal` by a damped spring: `omega` sets how fast (rad/s),
326
+ * `zeta` how much it overshoots (1 = none). Sub-stepped so a dropped frame cannot blow it up.
327
+ */
328
+ function stepSpring(spring, goal, dt, omega, zeta) {
329
+ const steps = Math.max(1, Math.ceil(dt / (1 / 120)));
330
+ const h = dt / steps;
331
+ let {
332
+ value,
333
+ velocity
334
+ } = spring;
335
+ for (let i = 0; i < steps; i++) {
336
+ velocity += (-omega * omega * (value - goal) - 2 * zeta * omega * velocity) * h;
337
+ value += velocity * h;
338
+ }
339
+ return {
340
+ value,
341
+ velocity
342
+ };
343
+ }
344
+ /** Ease-out for drawing the arrow on: quick off the card, gentle into the target. */
345
+ function easeOutCubic(t) {
346
+ const u = 1 - clamp(t, 0, 1);
347
+ return 1 - u * u * u;
348
+ }export{EDGE,GAP,RING_OFFSET,SHEET_BELOW,arrowBetween,centreCard,clamp,curveLength,cutoutBox,easeOutCubic,fitRadius,grow,placeCard,roundedRectPath,stepSpring,veilPath};//# sourceMappingURL=tourGeometry.js.map