@guidelytech/react-native 0.11.0 → 0.12.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 +5 -1
- package/dist/index.cjs +165 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +43 -28
- package/dist/index.d.ts +43 -28
- package/dist/index.js +182 -37
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -204,7 +204,11 @@ guidely.closeMessenger();
|
|
|
204
204
|
useGuidelyEvent("conversation:message", ({ message }) => console.log(message.body));
|
|
205
205
|
```
|
|
206
206
|
|
|
207
|
-
|
|
207
|
+
Users can drag the bubble out of the way (e.g. off your map controls): it snaps to the nearer side
|
|
208
|
+
edge at the height they drop it, never lower than its default spot (so it stays clear of tab bars),
|
|
209
|
+
and the device remembers it across launches (only for the app session without `storage`). A tap
|
|
210
|
+
still opens the messenger. `showMessengerLauncher={false}` hides the bubble so you can open the
|
|
211
|
+
messenger from your own UI.
|
|
208
212
|
`openResourceCenter()` opens the Help tab while the messenger is on, and `reset()` forgets the
|
|
209
213
|
install's conversations.
|
|
210
214
|
|
package/dist/index.cjs
CHANGED
|
@@ -160,7 +160,7 @@ function FlagsProvider({ children, client: external, payload, ...options }) {
|
|
|
160
160
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FlagsContext.Provider, { value, children });
|
|
161
161
|
}
|
|
162
162
|
|
|
163
|
-
// ../shared/dist/chunk-
|
|
163
|
+
// ../shared/dist/chunk-XJXXVV3C.js
|
|
164
164
|
function fnv1a(input) {
|
|
165
165
|
let h = 2166136261;
|
|
166
166
|
for (let i = 0; i < input.length; i++) {
|
|
@@ -470,7 +470,7 @@ function sanitizeProperties(props) {
|
|
|
470
470
|
}
|
|
471
471
|
return out;
|
|
472
472
|
}
|
|
473
|
-
var SOURCEMAP_MAX_FILE_BYTES =
|
|
473
|
+
var SOURCEMAP_MAX_FILE_BYTES = 100 * 1024 * 1024;
|
|
474
474
|
var MAX_COMPLAINT_ATTACHMENT_BYTES = 2 * 1024 * 1024;
|
|
475
475
|
var MEDIA_IMAGE_MAX_BYTES = 10 * 1024 * 1024;
|
|
476
476
|
var MEDIA_VIDEO_MAX_BYTES = 200 * 1024 * 1024;
|
|
@@ -765,7 +765,7 @@ function localizeResourceCenter(rc, requested, defaultLocale = DEFAULT_LOCALE) {
|
|
|
765
765
|
};
|
|
766
766
|
}
|
|
767
767
|
|
|
768
|
-
// ../sdk-core/dist/chunk-
|
|
768
|
+
// ../sdk-core/dist/chunk-XML74K2P.js
|
|
769
769
|
var __defProp2 = Object.defineProperty;
|
|
770
770
|
var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
771
771
|
var __publicField2 = (obj, key, value) => __defNormalProp2(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
@@ -1074,10 +1074,12 @@ var KEYS = {
|
|
|
1074
1074
|
/** Messenger conversations this browser can read: [{ id, token }]. */
|
|
1075
1075
|
conversations: (key) => `guidely:conversations:${key}`,
|
|
1076
1076
|
/** Announcement ids opened in the messenger's News tab. */
|
|
1077
|
-
newsSeen: (key) => `guidely:news:${key}
|
|
1077
|
+
newsSeen: (key) => `guidely:news:${key}`,
|
|
1078
|
+
/** Where the visitor dragged the messenger launcher ({ side, y }). */
|
|
1079
|
+
launcher: (key) => `guidely:launcher:${key}`
|
|
1078
1080
|
};
|
|
1079
1081
|
|
|
1080
|
-
// ../sdk-core/dist/chunk-
|
|
1082
|
+
// ../sdk-core/dist/chunk-2E2YUQAG.js
|
|
1081
1083
|
var EventQueue = class {
|
|
1082
1084
|
constructor(opts) {
|
|
1083
1085
|
__publicField2(this, "opts", opts);
|
|
@@ -1387,6 +1389,49 @@ function dismissedAfterMerge(local, server) {
|
|
|
1387
1389
|
// src/core/client.ts
|
|
1388
1390
|
var import_flags2 = require("@guidelytech/flags");
|
|
1389
1391
|
|
|
1392
|
+
// src/core/launcherPlacement.ts
|
|
1393
|
+
var LAUNCHER_PLACEMENT_KEY = "guidely:messenger.launcher";
|
|
1394
|
+
var LAUNCHER_MARGIN = 16;
|
|
1395
|
+
var LAUNCHER_DRAG_THRESHOLD = 8;
|
|
1396
|
+
var clamp2 = (v, min, max) => Math.min(max, Math.max(min, v));
|
|
1397
|
+
function sideX(f, side) {
|
|
1398
|
+
return side === "left" ? f.insets.left + LAUNCHER_MARGIN : f.width - f.insets.right - LAUNCHER_MARGIN - f.size;
|
|
1399
|
+
}
|
|
1400
|
+
function verticalRange(f) {
|
|
1401
|
+
const max = f.height - f.defaultBottom - f.size;
|
|
1402
|
+
return { min: Math.min(max, f.insets.top + LAUNCHER_MARGIN), max };
|
|
1403
|
+
}
|
|
1404
|
+
function clampToSafeArea(f, p) {
|
|
1405
|
+
const left = f.insets.left + LAUNCHER_MARGIN;
|
|
1406
|
+
const top = f.insets.top + LAUNCHER_MARGIN;
|
|
1407
|
+
return {
|
|
1408
|
+
x: clamp2(p.x, left, Math.max(left, f.width - f.insets.right - LAUNCHER_MARGIN - f.size)),
|
|
1409
|
+
y: clamp2(p.y, top, Math.max(top, f.height - f.insets.bottom - LAUNCHER_MARGIN - f.size))
|
|
1410
|
+
};
|
|
1411
|
+
}
|
|
1412
|
+
function snapPlacement(f, p) {
|
|
1413
|
+
const { min, max } = verticalRange(f);
|
|
1414
|
+
const side = p.x + f.size / 2 < f.width / 2 ? "left" : "right";
|
|
1415
|
+
return { side, fraction: max > min ? (max - clamp2(p.y, min, max)) / (max - min) : 0 };
|
|
1416
|
+
}
|
|
1417
|
+
function placementPoint(f, placement) {
|
|
1418
|
+
const { min, max } = verticalRange(f);
|
|
1419
|
+
return { x: sideX(f, placement.side), y: max - clamp2(placement.fraction, 0, 1) * (max - min) };
|
|
1420
|
+
}
|
|
1421
|
+
function parsePlacement(raw) {
|
|
1422
|
+
if (!raw) return null;
|
|
1423
|
+
try {
|
|
1424
|
+
const v = JSON.parse(raw);
|
|
1425
|
+
if (!v || typeof v !== "object" || v.side !== "left" && v.side !== "right" || typeof v.fraction !== "number" || !Number.isFinite(v.fraction)) return null;
|
|
1426
|
+
return { side: v.side, fraction: clamp2(v.fraction, 0, 1) };
|
|
1427
|
+
} catch {
|
|
1428
|
+
return null;
|
|
1429
|
+
}
|
|
1430
|
+
}
|
|
1431
|
+
function serializePlacement(p) {
|
|
1432
|
+
return JSON.stringify({ side: p.side, fraction: Math.round(clamp2(p.fraction, 0, 1) * 1e4) / 1e4 });
|
|
1433
|
+
}
|
|
1434
|
+
|
|
1390
1435
|
// src/core/autocapture.ts
|
|
1391
1436
|
var TAP_SLOP = 10;
|
|
1392
1437
|
var TAP_MAX_MS = 1e3;
|
|
@@ -2500,7 +2545,7 @@ var PersistentStore = class {
|
|
|
2500
2545
|
|
|
2501
2546
|
// src/core/client.ts
|
|
2502
2547
|
var SDK_NAME = "@guidelytech/react-native";
|
|
2503
|
-
var SDK_VERSION = "0.
|
|
2548
|
+
var SDK_VERSION = "0.12.0";
|
|
2504
2549
|
var DEFAULT_API_URL = "https://guidelytech.com";
|
|
2505
2550
|
var PAGE_SCOPED = /* @__PURE__ */ new Set(["page_load", "url_match", "element_click", "element_visible", "delay"]);
|
|
2506
2551
|
var CACHED_START_MS = 1500;
|
|
@@ -2666,7 +2711,7 @@ var GuidelyClient = class {
|
|
|
2666
2711
|
async bootstrap() {
|
|
2667
2712
|
const key = this.options.projectId;
|
|
2668
2713
|
try {
|
|
2669
|
-
await this.store.hydrate([KEYS.anon, KEYS.seen, KEYS.session, KEYS.config(key), KEYS.etag(key), KEYS.state(key), KEYS.user(key), KEYS.queue(key), KEYS.outbox(key), KEYS.conversations(key), appVersionKey(key)]);
|
|
2714
|
+
await this.store.hydrate([KEYS.anon, KEYS.seen, KEYS.session, KEYS.config(key), KEYS.etag(key), KEYS.state(key), KEYS.user(key), KEYS.queue(key), KEYS.outbox(key), KEYS.conversations(key), appVersionKey(key), LAUNCHER_PLACEMENT_KEY]);
|
|
2670
2715
|
if (this.destroyed) return;
|
|
2671
2716
|
this.anonymousId = this.store.get(KEYS.anon) || "";
|
|
2672
2717
|
this.hadIdentity = !!this.anonymousId;
|
|
@@ -3027,7 +3072,7 @@ var GuidelyClient = class {
|
|
|
3027
3072
|
if (changed) {
|
|
3028
3073
|
this.screenStartedAt = Date.now();
|
|
3029
3074
|
this.screenLeft = this.backgroundedAt !== null;
|
|
3030
|
-
if (this.pageviewsOn()) this.enqueue("page_view", { properties: { ...properties, path: url, screen: name,
|
|
3075
|
+
if (this.pageviewsOn()) this.enqueue("page_view", { properties: { ...properties, path: url, screen: name, ...this.deviceProperties() } });
|
|
3031
3076
|
}
|
|
3032
3077
|
this.completeChecklistTasksBy("url_visited", url);
|
|
3033
3078
|
this.active?.controller.resume();
|
|
@@ -3192,7 +3237,7 @@ var GuidelyClient = class {
|
|
|
3192
3237
|
if (this.screenName && this.screenLeft) {
|
|
3193
3238
|
this.screenStartedAt = Date.now();
|
|
3194
3239
|
this.screenLeft = false;
|
|
3195
|
-
if (this.pageviewsOn() && this.autocaptureOn("pageLeave")) this.enqueue("page_view", { properties: { path: this.currentUrl(), screen: this.screenName,
|
|
3240
|
+
if (this.pageviewsOn() && this.autocaptureOn("pageLeave")) this.enqueue("page_view", { properties: { path: this.currentUrl(), screen: this.screenName, ...this.deviceProperties(), resumed: true } });
|
|
3196
3241
|
}
|
|
3197
3242
|
} catch (err) {
|
|
3198
3243
|
this.reportError(err);
|
|
@@ -3954,6 +3999,14 @@ var GuidelyClient = class {
|
|
|
3954
3999
|
getMessenger() {
|
|
3955
4000
|
return this.messenger;
|
|
3956
4001
|
}
|
|
4002
|
+
/** Where the visitor dragged the messenger bubble on this device, or null to use the configured spot. */
|
|
4003
|
+
getMessengerLauncherPlacement() {
|
|
4004
|
+
return parsePlacement(this.store.get(LAUNCHER_PLACEMENT_KEY));
|
|
4005
|
+
}
|
|
4006
|
+
/** Remembers the bubble's spot on this device (in memory only when no `storage` was passed). */
|
|
4007
|
+
setMessengerLauncherPlacement(placement) {
|
|
4008
|
+
this.store.set(LAUNCHER_PLACEMENT_KEY, serializePlacement(placement));
|
|
4009
|
+
}
|
|
3957
4010
|
/** Opens the Scout messenger, optionally on a tab. No-op when Scout is off for this platform. */
|
|
3958
4011
|
openMessenger(tab) {
|
|
3959
4012
|
this.whenHydrated(() => this.messenger?.open(tab));
|
|
@@ -3984,6 +4037,11 @@ var GuidelyClient = class {
|
|
|
3984
4037
|
onFlagsChange(cb) {
|
|
3985
4038
|
return this.flags.subscribe(cb);
|
|
3986
4039
|
}
|
|
4040
|
+
/** Device facts on every screen view, read by the Pages devices / browsers breakdowns. */
|
|
4041
|
+
deviceProperties() {
|
|
4042
|
+
const d = this.bridge.device;
|
|
4043
|
+
return { platform: d.platform, deviceType: d.deviceType, os: d.platform };
|
|
4044
|
+
}
|
|
3987
4045
|
/** Attributes flags are evaluated with: identity, traits, account, audiences, screen and device. */
|
|
3988
4046
|
flagContext() {
|
|
3989
4047
|
const d = this.bridge.device;
|
|
@@ -4812,14 +4870,89 @@ function ago(iso) {
|
|
|
4812
4870
|
if (s < 86400) return `${Math.floor(s / 3600)}h`;
|
|
4813
4871
|
return `${Math.floor(s / 86400)}d`;
|
|
4814
4872
|
}
|
|
4815
|
-
|
|
4873
|
+
var LAUNCHER_SIZE = 54;
|
|
4874
|
+
function useReduceMotion() {
|
|
4875
|
+
const [on, setOn] = (0, import_react3.useState)(false);
|
|
4876
|
+
(0, import_react3.useEffect)(() => {
|
|
4877
|
+
let live = true;
|
|
4878
|
+
import_react_native5.AccessibilityInfo.isReduceMotionEnabled?.().then((v) => live && setOn(v)).catch(() => {
|
|
4879
|
+
});
|
|
4880
|
+
const sub = import_react_native5.AccessibilityInfo.addEventListener?.("reduceMotionChanged", setOn);
|
|
4881
|
+
return () => {
|
|
4882
|
+
live = false;
|
|
4883
|
+
sub?.remove();
|
|
4884
|
+
};
|
|
4885
|
+
}, []);
|
|
4886
|
+
return on;
|
|
4887
|
+
}
|
|
4888
|
+
function MessengerLauncher({ store, client, palette: p, style, frame, defaultSide }) {
|
|
4816
4889
|
const snap = useMessenger(store);
|
|
4890
|
+
const reduceMotion = useReduceMotion();
|
|
4891
|
+
const [placement, setPlacement] = (0, import_react3.useState)(() => client.getMessengerLauncherPlacement());
|
|
4892
|
+
const pan = (0, import_react3.useRef)(new import_react_native5.Animated.ValueXY()).current;
|
|
4893
|
+
const offset = (0, import_react3.useRef)({ x: 0, y: 0 });
|
|
4894
|
+
const dragging = (0, import_react3.useRef)(false);
|
|
4895
|
+
const live = (0, import_react3.useRef)({ frame, defaultSide, reduceMotion });
|
|
4896
|
+
live.current = { frame, defaultSide, reduceMotion };
|
|
4897
|
+
const { width, height, size, defaultBottom } = frame;
|
|
4898
|
+
const { top, bottom, left, right } = frame.insets;
|
|
4899
|
+
(0, import_react3.useLayoutEffect)(() => {
|
|
4900
|
+
if (dragging.current) return;
|
|
4901
|
+
const f = live.current.frame;
|
|
4902
|
+
const anchor = placementPoint(f, { side: defaultSide, fraction: 0 });
|
|
4903
|
+
const at = placement ? placementPoint(f, placement) : anchor;
|
|
4904
|
+
offset.current = { x: at.x - anchor.x, y: at.y - anchor.y };
|
|
4905
|
+
pan.setValue(offset.current);
|
|
4906
|
+
}, [pan, placement, defaultSide, width, height, size, defaultBottom, top, bottom, left, right]);
|
|
4907
|
+
const responder = (0, import_react3.useMemo)(() => {
|
|
4908
|
+
const moved = (g) => Math.hypot(g.dx, g.dy) > LAUNCHER_DRAG_THRESHOLD;
|
|
4909
|
+
const anchor = () => placementPoint(live.current.frame, { side: live.current.defaultSide, fraction: 0 });
|
|
4910
|
+
let start = { x: 0, y: 0 };
|
|
4911
|
+
const follow = (g) => {
|
|
4912
|
+
const a = anchor();
|
|
4913
|
+
const at = clampToSafeArea(live.current.frame, { x: a.x + start.x + g.dx, y: a.y + start.y + g.dy });
|
|
4914
|
+
return { x: at.x - a.x, y: at.y - a.y };
|
|
4915
|
+
};
|
|
4916
|
+
const drop = (g) => {
|
|
4917
|
+
const a = anchor();
|
|
4918
|
+
const d = follow(g);
|
|
4919
|
+
const next = snapPlacement(live.current.frame, { x: a.x + d.x, y: a.y + d.y });
|
|
4920
|
+
const at = placementPoint(live.current.frame, next);
|
|
4921
|
+
const to = { x: at.x - a.x, y: at.y - a.y };
|
|
4922
|
+
offset.current = to;
|
|
4923
|
+
client.setMessengerLauncherPlacement(next);
|
|
4924
|
+
const done = ({ finished }) => {
|
|
4925
|
+
if (finished) dragging.current = false;
|
|
4926
|
+
setPlacement(next);
|
|
4927
|
+
};
|
|
4928
|
+
if (live.current.reduceMotion) {
|
|
4929
|
+
pan.setValue(to);
|
|
4930
|
+
done({ finished: true });
|
|
4931
|
+
} else import_react_native5.Animated.timing(pan, { toValue: to, duration: 300, easing: import_react_native5.Easing.out(import_react_native5.Easing.cubic), useNativeDriver: true }).start(done);
|
|
4932
|
+
};
|
|
4933
|
+
return import_react_native5.PanResponder.create({
|
|
4934
|
+
// Taps stay with the Pressable; only a real drag is taken (which cancels its press).
|
|
4935
|
+
onMoveShouldSetPanResponderCapture: (_, g) => moved(g),
|
|
4936
|
+
onMoveShouldSetPanResponder: (_, g) => moved(g),
|
|
4937
|
+
onPanResponderGrant: () => {
|
|
4938
|
+
dragging.current = true;
|
|
4939
|
+
start = offset.current;
|
|
4940
|
+
pan.stopAnimation((v) => {
|
|
4941
|
+
if (Number.isFinite(v?.x) && Number.isFinite(v?.y)) start = v;
|
|
4942
|
+
});
|
|
4943
|
+
},
|
|
4944
|
+
onPanResponderMove: (_, g) => pan.setValue(follow(g)),
|
|
4945
|
+
onPanResponderRelease: (_, g) => drop(g),
|
|
4946
|
+
onPanResponderTerminate: (_, g) => drop(g),
|
|
4947
|
+
onPanResponderTerminationRequest: () => false
|
|
4948
|
+
});
|
|
4949
|
+
}, [client, pan]);
|
|
4817
4950
|
if (snap.open) return null;
|
|
4818
4951
|
const label = snap.unread ? `Open ${snap.config.name}, ${snap.unread} unread` : `Open ${snap.config.name}`;
|
|
4819
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react_native5.Pressable, { accessibilityRole: "button", accessibilityLabel: label, onPress: () => store.open(), style: ({ pressed }) => [styles4.launcher,
|
|
4952
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react_native5.Animated.View, { ...responder.panHandlers, style: [styles4.launcherWrap, style, { transform: pan.getTranslateTransform() }], children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react_native5.Pressable, { accessibilityRole: "button", accessibilityLabel: label, onPress: () => !dragging.current && store.open(), style: ({ pressed }) => [styles4.launcher, { backgroundColor: p.primary, opacity: pressed ? 0.85 : 1 }], children: [
|
|
4820
4953
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react_native5.Text, { style: [styles4.launcherIcon, { color: p.onPrimary }], children: "\u{1F4AC}" }),
|
|
4821
4954
|
snap.unread ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react_native5.View, { style: styles4.badge, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react_native5.Text, { style: styles4.badgeText, children: snap.unread }) }) : null
|
|
4822
|
-
] });
|
|
4955
|
+
] }) });
|
|
4823
4956
|
}
|
|
4824
4957
|
function MessengerSheet({ store, client, palette: p, topInset, bottomInset }) {
|
|
4825
4958
|
const snap = useMessenger(store);
|
|
@@ -5064,7 +5197,8 @@ function Article({ article, palette: p, client }) {
|
|
|
5064
5197
|
}
|
|
5065
5198
|
var styles4 = import_react_native5.StyleSheet.create({
|
|
5066
5199
|
flex: { flex: 1 },
|
|
5067
|
-
|
|
5200
|
+
launcherWrap: { position: "absolute", width: LAUNCHER_SIZE, height: LAUNCHER_SIZE, elevation: 8 },
|
|
5201
|
+
launcher: { width: LAUNCHER_SIZE, height: LAUNCHER_SIZE, borderRadius: 27, alignItems: "center", justifyContent: "center", elevation: 8, shadowColor: "#000", shadowOpacity: 0.22, shadowRadius: 12, shadowOffset: { width: 0, height: 4 } },
|
|
5068
5202
|
launcherIcon: { fontSize: 24 },
|
|
5069
5203
|
badge: { position: "absolute", top: -2, right: -2, minWidth: 20, height: 20, borderRadius: 10, backgroundColor: "#dc2626", alignItems: "center", justifyContent: "center", paddingHorizontal: 5, borderWidth: 2, borderColor: "#ffffff" },
|
|
5070
5204
|
badgeText: { color: "#ffffff", fontSize: 11, fontWeight: "800" },
|
|
@@ -5297,20 +5431,20 @@ function positionCard(target, size, viewport, insets, placement, offset) {
|
|
|
5297
5431
|
const order = rawSide === "auto" ? ["bottom", "top"] : [rawSide, opposite[rawSide], "bottom", "top"];
|
|
5298
5432
|
const space = { top: target.y - insets.top, bottom: viewport.height - insets.bottom - (target.y + target.height) };
|
|
5299
5433
|
const side = order.find(fits) ?? (space.bottom >= space.top ? "bottom" : "top");
|
|
5300
|
-
const
|
|
5434
|
+
const clamp3 = (v, min, max) => Math.max(min, Math.min(max, v));
|
|
5301
5435
|
if (side === "top" || side === "bottom") {
|
|
5302
5436
|
const cx = target.x + target.width / 2;
|
|
5303
5437
|
let x2 = align === "start" ? target.x : align === "end" ? target.x + target.width - size.width : cx - size.width / 2;
|
|
5304
|
-
x2 =
|
|
5438
|
+
x2 = clamp3(x2, insets.left + MARGIN, Math.max(insets.left + MARGIN, viewport.width - insets.right - MARGIN - size.width));
|
|
5305
5439
|
let y2 = side === "bottom" ? target.y + target.height + offset : target.y - offset - size.height;
|
|
5306
|
-
y2 =
|
|
5307
|
-
return { x: x2, y: y2, side, arrow:
|
|
5440
|
+
y2 = clamp3(y2, insets.top + MARGIN, Math.max(insets.top + MARGIN, viewport.height - insets.bottom - MARGIN - size.height));
|
|
5441
|
+
return { x: x2, y: y2, side, arrow: clamp3(cx - x2, ARROW_INSET, size.width - ARROW_INSET) };
|
|
5308
5442
|
}
|
|
5309
5443
|
const cy = target.y + target.height / 2;
|
|
5310
5444
|
let y = align === "start" ? target.y : align === "end" ? target.y + target.height - size.height : cy - size.height / 2;
|
|
5311
|
-
y =
|
|
5445
|
+
y = clamp3(y, insets.top + MARGIN, Math.max(insets.top + MARGIN, viewport.height - insets.bottom - MARGIN - size.height));
|
|
5312
5446
|
const x = side === "right" ? target.x + target.width + offset : target.x - offset - size.width;
|
|
5313
|
-
return { x, y, side, arrow:
|
|
5447
|
+
return { x, y, side, arrow: clamp3(cy - y, ARROW_INSET, size.height - ARROW_INSET) };
|
|
5314
5448
|
}
|
|
5315
5449
|
|
|
5316
5450
|
// src/ui/StepCard.tsx
|
|
@@ -5926,6 +6060,7 @@ function GuidelyOverlay({ client, insets: insetsProp, launcherOffset }) {
|
|
|
5926
6060
|
const unread = showRcLauncher ? client.getUnreadAnnouncements() : 0;
|
|
5927
6061
|
const messengerLeft = messenger?.getSnapshot().config.launcher.position === "bottom-left";
|
|
5928
6062
|
const checklistOnSameSide = ui.checklists.some((c) => c.guide.config.checklist?.position === "bottom-left" === messengerLeft) && client.options.showChecklistLauncher !== false;
|
|
6063
|
+
const messengerBottom = insets.bottom + launcherOffset + (checklistOnSameSide ? 56 : 0);
|
|
5929
6064
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react_native10.View, { ref, collapsable: false, pointerEvents: "box-none", style: import_react_native10.StyleSheet.absoluteFill, onLayout: measureOrigin, children: [
|
|
5930
6065
|
ui.checklists.map((c) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Checklist, { view: c, client, palette: palette(client.themeFor(c.guide), scheme), geometry, showLauncher: client.options.showChecklistLauncher !== false, launcherBottom: launcherOffset }, c.guide.id)),
|
|
5931
6066
|
showRcLauncher ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
@@ -5941,7 +6076,17 @@ function GuidelyOverlay({ client, insets: insetsProp, launcherOffset }) {
|
|
|
5941
6076
|
]
|
|
5942
6077
|
}
|
|
5943
6078
|
) : null,
|
|
5944
|
-
messenger && client.options.showMessengerLauncher !== false ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
6079
|
+
messenger && client.options.showMessengerLauncher !== false ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
6080
|
+
MessengerLauncher,
|
|
6081
|
+
{
|
|
6082
|
+
store: messenger,
|
|
6083
|
+
client,
|
|
6084
|
+
palette: basePalette,
|
|
6085
|
+
style: [messengerLeft ? { left: insets.left + 16 } : { right: insets.right + 16 }, { bottom: messengerBottom }],
|
|
6086
|
+
frame: { width, height, insets, size: LAUNCHER_SIZE, defaultBottom: messengerBottom },
|
|
6087
|
+
defaultSide: messengerLeft ? "left" : "right"
|
|
6088
|
+
}
|
|
6089
|
+
) : null,
|
|
5945
6090
|
ui.survey ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Survey, { view: ui.survey, client, palette: palette(client.themeFor(ui.survey.guide), scheme), geometry }) : null,
|
|
5946
6091
|
ui.steps.map((s) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(StepLayer, { view: s, client, palette: palette(client.themeFor(s.guide), scheme, s.guide.config.appearance), geometry }, s.key)),
|
|
5947
6092
|
messenger ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(MessengerSheet, { store: messenger, client, palette: basePalette, topInset: insets.top, bottomInset: insets.bottom }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ResourceCenter, { client, palette: basePalette, open: ui.resourceCenterOpen, topInset: insets.top, bottomInset: insets.bottom })
|