@oxvo/ai-live-assist 7.5.31 → 7.5.32
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/cjs/AiLiveAssist.d.ts +1 -1
- package/cjs/framerBadgePlacement.d.ts +20 -0
- package/cjs/framerBadgePlacement.js +177 -0
- package/cjs/guideMeasurement.d.ts +1 -1
- package/cjs/guideMeasurement.js +1 -1
- package/cjs/liveControlChannel.d.ts +1 -1
- package/cjs/ui.d.ts +1 -0
- package/cjs/ui.js +9 -2
- package/cjs/version.d.ts +1 -1
- package/cjs/version.js +1 -1
- package/lib/AiLiveAssist.d.ts +1 -1
- package/lib/framerBadgePlacement.d.ts +20 -0
- package/lib/framerBadgePlacement.js +173 -0
- package/lib/guideMeasurement.d.ts +1 -1
- package/lib/guideMeasurement.js +1 -1
- package/lib/liveControlChannel.d.ts +1 -1
- package/lib/ui.d.ts +1 -0
- package/lib/ui.js +9 -2
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +1 -1
package/cjs/AiLiveAssist.d.ts
CHANGED
|
@@ -34,7 +34,7 @@ export declare const normalizeAiGuideOpenInput: (input?: AiGuideOpenInput) => Re
|
|
|
34
34
|
export declare const resolveAiGuideProtocolVersion: (bootstrap: Pick<BootstrapConfig, "experienceMode" | "minimumProtocolVersion" | "protocol">) => 1 | 2;
|
|
35
35
|
export default class AiLiveAssist {
|
|
36
36
|
private readonly options;
|
|
37
|
-
readonly version = "7.5.
|
|
37
|
+
readonly version = "7.5.32";
|
|
38
38
|
private readonly host;
|
|
39
39
|
private readonly guideAdmission;
|
|
40
40
|
private readonly standaloneAdmissionPending;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** Keep Guide launchers clear of Framer's visible attribution link. */
|
|
2
|
+
export declare class FramerBadgePlacement {
|
|
3
|
+
private readonly host;
|
|
4
|
+
private readonly intro;
|
|
5
|
+
private readonly panel;
|
|
6
|
+
private frame;
|
|
7
|
+
private offset;
|
|
8
|
+
private panelOffset;
|
|
9
|
+
private destroyed;
|
|
10
|
+
private badge;
|
|
11
|
+
private badgeLink;
|
|
12
|
+
private documentObserver;
|
|
13
|
+
private badgeObserver;
|
|
14
|
+
private introObserver;
|
|
15
|
+
private resizeObserver;
|
|
16
|
+
constructor(host: HTMLElement, intro: HTMLElement, panel: HTMLElement);
|
|
17
|
+
schedule: () => void;
|
|
18
|
+
private sync;
|
|
19
|
+
destroy(): void;
|
|
20
|
+
}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FramerBadgePlacement = void 0;
|
|
4
|
+
const BADGE_ID = "__framer-badge-container";
|
|
5
|
+
const BADGE_GAP = 8;
|
|
6
|
+
const OFFSET_PROPERTY = "--intro-badge-bottom-offset";
|
|
7
|
+
const PANEL_OFFSET_PROPERTY = "--panel-badge-bottom-offset";
|
|
8
|
+
const SURFACES = ".intro-composer-frame, .status-card, .legal-trigger, .recording-consent";
|
|
9
|
+
/** Keep Guide launchers clear of Framer's visible attribution link. */
|
|
10
|
+
class FramerBadgePlacement {
|
|
11
|
+
constructor(host, intro, panel) {
|
|
12
|
+
this.host = host;
|
|
13
|
+
this.intro = intro;
|
|
14
|
+
this.panel = panel;
|
|
15
|
+
this.frame = null;
|
|
16
|
+
this.offset = 0;
|
|
17
|
+
this.panelOffset = 0;
|
|
18
|
+
this.destroyed = false;
|
|
19
|
+
this.badge = null;
|
|
20
|
+
this.badgeLink = null;
|
|
21
|
+
this.documentObserver = null;
|
|
22
|
+
this.badgeObserver = null;
|
|
23
|
+
this.introObserver = null;
|
|
24
|
+
this.resizeObserver = null;
|
|
25
|
+
this.schedule = () => {
|
|
26
|
+
if (this.destroyed || !this.documentObserver || this.frame !== null)
|
|
27
|
+
return;
|
|
28
|
+
this.frame = requestAnimationFrame(() => {
|
|
29
|
+
this.frame = null;
|
|
30
|
+
this.sync();
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
// Other platforms need neither a page observer nor a different placement.
|
|
34
|
+
if (!document.getElementById(BADGE_ID) &&
|
|
35
|
+
!document.querySelector('meta[name="generator"][content^="Framer"]')) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
this.documentObserver = new MutationObserver(this.schedule);
|
|
39
|
+
this.documentObserver.observe(document.documentElement, {
|
|
40
|
+
childList: true,
|
|
41
|
+
subtree: true,
|
|
42
|
+
});
|
|
43
|
+
this.introObserver = new MutationObserver(this.schedule);
|
|
44
|
+
this.introObserver.observe(intro, {
|
|
45
|
+
attributes: true,
|
|
46
|
+
subtree: true,
|
|
47
|
+
attributeFilter: ["hidden", "data-anchor", "data-minimized"],
|
|
48
|
+
});
|
|
49
|
+
this.introObserver.observe(panel, {
|
|
50
|
+
attributes: true,
|
|
51
|
+
attributeFilter: ["class", "style", "hidden", "data-anchor"],
|
|
52
|
+
});
|
|
53
|
+
if (typeof ResizeObserver === "function") {
|
|
54
|
+
this.resizeObserver = new ResizeObserver(this.schedule);
|
|
55
|
+
this.resizeObserver.observe(intro);
|
|
56
|
+
this.resizeObserver.observe(panel);
|
|
57
|
+
intro.querySelectorAll(SURFACES).forEach((surface) => {
|
|
58
|
+
this.resizeObserver.observe(surface);
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
window.addEventListener("resize", this.schedule, { passive: true });
|
|
62
|
+
window.addEventListener("scroll", this.schedule, { passive: true });
|
|
63
|
+
window.visualViewport?.addEventListener("resize", this.schedule);
|
|
64
|
+
window.visualViewport?.addEventListener("scroll", this.schedule);
|
|
65
|
+
this.sync();
|
|
66
|
+
}
|
|
67
|
+
sync() {
|
|
68
|
+
const badge = document.getElementById(BADGE_ID);
|
|
69
|
+
if (badge !== this.badge) {
|
|
70
|
+
if (this.badge) {
|
|
71
|
+
this.resizeObserver?.unobserve(this.badge);
|
|
72
|
+
this.badge.removeEventListener("transitionend", this.schedule);
|
|
73
|
+
this.badge.removeEventListener("animationend", this.schedule);
|
|
74
|
+
}
|
|
75
|
+
this.badgeObserver?.disconnect();
|
|
76
|
+
this.badge = badge;
|
|
77
|
+
if (badge) {
|
|
78
|
+
badge.addEventListener("transitionend", this.schedule);
|
|
79
|
+
badge.addEventListener("animationend", this.schedule);
|
|
80
|
+
this.resizeObserver?.observe(badge);
|
|
81
|
+
this.badgeObserver = new MutationObserver(this.schedule);
|
|
82
|
+
this.badgeObserver.observe(badge, {
|
|
83
|
+
attributes: true,
|
|
84
|
+
subtree: true,
|
|
85
|
+
attributeFilter: ["class", "style", "hidden"],
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
// The container spans the whole viewport; only its link is an obstacle.
|
|
90
|
+
const link = badge?.querySelector("a[href]") ?? null;
|
|
91
|
+
if (link !== this.badgeLink) {
|
|
92
|
+
if (this.badgeLink)
|
|
93
|
+
this.resizeObserver?.unobserve(this.badgeLink);
|
|
94
|
+
this.badgeLink = link ?? null;
|
|
95
|
+
if (link)
|
|
96
|
+
this.resizeObserver?.observe(link);
|
|
97
|
+
}
|
|
98
|
+
let nextOffset = 0;
|
|
99
|
+
let nextPanelOffset = 0;
|
|
100
|
+
if (link) {
|
|
101
|
+
const style = getComputedStyle(link);
|
|
102
|
+
let transparent = false;
|
|
103
|
+
for (let element = link; element; element = element.parentElement) {
|
|
104
|
+
if (getComputedStyle(element).opacity === "0") {
|
|
105
|
+
transparent = true;
|
|
106
|
+
break;
|
|
107
|
+
}
|
|
108
|
+
if (element === badge)
|
|
109
|
+
break;
|
|
110
|
+
}
|
|
111
|
+
const obstacle = link.getBoundingClientRect();
|
|
112
|
+
if (!transparent &&
|
|
113
|
+
style.visibility !== "hidden" &&
|
|
114
|
+
style.display !== "none" &&
|
|
115
|
+
obstacle.width > 0 &&
|
|
116
|
+
obstacle.height > 0 &&
|
|
117
|
+
obstacle.bottom > 0 &&
|
|
118
|
+
obstacle.top < window.innerHeight &&
|
|
119
|
+
obstacle.right > 0 &&
|
|
120
|
+
obstacle.left < window.innerWidth) {
|
|
121
|
+
const requiredOffset = (surfaces, offset) => {
|
|
122
|
+
let result = 0;
|
|
123
|
+
for (const surface of surfaces) {
|
|
124
|
+
const rect = surface.getBoundingClientRect();
|
|
125
|
+
// Undo our previous shift when measuring, so repeated updates do not
|
|
126
|
+
// accumulate offsets or bounce between the shifted and base positions.
|
|
127
|
+
const top = rect.top + offset;
|
|
128
|
+
const bottom = rect.bottom + offset;
|
|
129
|
+
if (rect.width > 0 &&
|
|
130
|
+
rect.height > 0 &&
|
|
131
|
+
rect.left < obstacle.right + BADGE_GAP &&
|
|
132
|
+
rect.right > obstacle.left - BADGE_GAP &&
|
|
133
|
+
top < obstacle.bottom + BADGE_GAP &&
|
|
134
|
+
bottom > obstacle.top - BADGE_GAP) {
|
|
135
|
+
result = Math.max(result, Math.ceil(bottom - obstacle.top + BADGE_GAP));
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
return result;
|
|
139
|
+
};
|
|
140
|
+
if (!this.intro.hidden) {
|
|
141
|
+
nextOffset = requiredOffset(this.intro.querySelectorAll(SURFACES), this.offset);
|
|
142
|
+
}
|
|
143
|
+
// Keep explicitly dragged panels where the visitor put them. Expanded
|
|
144
|
+
// panels, including the mobile full-screen dialog, retain their layout.
|
|
145
|
+
if (this.panel.classList.contains("compact") && !this.panel.style.top) {
|
|
146
|
+
nextPanelOffset = requiredOffset([this.panel], this.panelOffset);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
if (nextOffset !== this.offset) {
|
|
151
|
+
this.offset = nextOffset;
|
|
152
|
+
this.host.style.setProperty(OFFSET_PROPERTY, `${nextOffset}px`);
|
|
153
|
+
}
|
|
154
|
+
if (nextPanelOffset !== this.panelOffset) {
|
|
155
|
+
this.panelOffset = nextPanelOffset;
|
|
156
|
+
this.host.style.setProperty(PANEL_OFFSET_PROPERTY, `${nextPanelOffset}px`);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
destroy() {
|
|
160
|
+
this.destroyed = true;
|
|
161
|
+
if (this.frame !== null)
|
|
162
|
+
cancelAnimationFrame(this.frame);
|
|
163
|
+
this.documentObserver?.disconnect();
|
|
164
|
+
this.badgeObserver?.disconnect();
|
|
165
|
+
this.badge?.removeEventListener("transitionend", this.schedule);
|
|
166
|
+
this.badge?.removeEventListener("animationend", this.schedule);
|
|
167
|
+
this.introObserver?.disconnect();
|
|
168
|
+
this.resizeObserver?.disconnect();
|
|
169
|
+
window.removeEventListener("resize", this.schedule);
|
|
170
|
+
window.removeEventListener("scroll", this.schedule);
|
|
171
|
+
window.visualViewport?.removeEventListener("resize", this.schedule);
|
|
172
|
+
window.visualViewport?.removeEventListener("scroll", this.schedule);
|
|
173
|
+
this.host.style.removeProperty(OFFSET_PROPERTY);
|
|
174
|
+
this.host.style.removeProperty(PANEL_OFFSET_PROPERTY);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
exports.FramerBadgePlacement = FramerBadgePlacement;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { GuideMeasurementBridge, GuideMeasurementIntent } from './guideTypes.js';
|
|
2
|
-
export declare const GUIDE_MEASUREMENT_CLIENT_VERSION = "7.5.
|
|
2
|
+
export declare const GUIDE_MEASUREMENT_CLIENT_VERSION = "7.5.32";
|
|
3
3
|
export declare function isGuideMeasurementIntent(value: unknown): value is GuideMeasurementIntent;
|
|
4
4
|
/** The managed analytics owner supplies possession; this check grants no authority. */
|
|
5
5
|
export declare function currentGuideMeasurementBridge(value: unknown): value is GuideMeasurementBridge;
|
package/cjs/guideMeasurement.js
CHANGED
|
@@ -4,7 +4,7 @@ exports.GUIDE_MEASUREMENT_CLIENT_VERSION = void 0;
|
|
|
4
4
|
exports.isGuideMeasurementIntent = isGuideMeasurementIntent;
|
|
5
5
|
exports.currentGuideMeasurementBridge = currentGuideMeasurementBridge;
|
|
6
6
|
exports.prepareGuideMeasurementBridge = prepareGuideMeasurementBridge;
|
|
7
|
-
exports.GUIDE_MEASUREMENT_CLIENT_VERSION = '7.5.
|
|
7
|
+
exports.GUIDE_MEASUREMENT_CLIENT_VERSION = '7.5.32';
|
|
8
8
|
function isGuideMeasurementIntent(value) {
|
|
9
9
|
if (!value || typeof value !== 'object' || Array.isArray(value))
|
|
10
10
|
return false;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type MerchantPreviewRuntimePolicy } from './merchantPreviewOrigins.js';
|
|
2
2
|
import { type LiveDuplexMediaOptions, type LiveDuplexMediaDependencies } from './liveDuplexMedia.js';
|
|
3
3
|
import { type CommerceBootstrap, type CommerceContext, type CommerceCartSelection, type CommerceProduct, type CommerceContextClear, type LiveCommerceCatalog, type LiveCommerceDisplayed } from './commerce/contracts.js';
|
|
4
|
-
export declare const LIVE_CONTROL_CLIENT_VERSION = "7.5.
|
|
4
|
+
export declare const LIVE_CONTROL_CLIENT_VERSION = "7.5.32";
|
|
5
5
|
export declare const LIVE_CONTROL_CLIENT_CAPABILITIES: readonly ["live_duplex_v1", "live_local_wake_v1", "live_fragment_captions_v1"];
|
|
6
6
|
declare const phases: readonly ["voice_off", "local_listening", "wake_buffering", "starting", "active", "tentative_idle", "closing", "uncertain", "muted", "suspended", "budget_blocked", "ended"];
|
|
7
7
|
export type LiveControlState = {
|
package/cjs/ui.d.ts
CHANGED
|
@@ -192,6 +192,7 @@ export declare class WidgetView {
|
|
|
192
192
|
private introFocusScrollGuard;
|
|
193
193
|
private introFocusScrollGuardTimer;
|
|
194
194
|
private introViewportFrame;
|
|
195
|
+
private framerBadgePlacement;
|
|
195
196
|
private panelTransitionTimers;
|
|
196
197
|
private panelTransitionSettlers;
|
|
197
198
|
private companionTransferRestoreExpanded;
|
package/cjs/ui.js
CHANGED
|
@@ -4,6 +4,7 @@ exports.WidgetView = void 0;
|
|
|
4
4
|
const lucide_1 = require("lucide");
|
|
5
5
|
const avatarUrl_js_1 = require("./avatarUrl.js");
|
|
6
6
|
const dialogFocusScope_js_1 = require("./dialogFocusScope.js");
|
|
7
|
+
const framerBadgePlacement_js_1 = require("./framerBadgePlacement.js");
|
|
7
8
|
const shoppingNotes_js_1 = require("./commerce/shoppingNotes.js");
|
|
8
9
|
const shoppingNotesView_js_1 = require("./commerce/shoppingNotesView.js");
|
|
9
10
|
const ctaOffer_js_1 = require("./ctaOffer.js");
|
|
@@ -1033,6 +1034,7 @@ const style = `
|
|
|
1033
1034
|
:host([data-theme="dark"]) .panel.open:not(.compact) .close:hover {
|
|
1034
1035
|
background: var(--mode-active-background);
|
|
1035
1036
|
}
|
|
1037
|
+
.panel.compact { margin-bottom: var(--panel-badge-bottom-offset, 0px); }
|
|
1036
1038
|
.panel.active-session.compact .brand-mark {
|
|
1037
1039
|
width: 42px;
|
|
1038
1040
|
height: 42px;
|
|
@@ -1501,7 +1503,7 @@ const style = `
|
|
|
1501
1503
|
}
|
|
1502
1504
|
.intro,
|
|
1503
1505
|
.intro[data-minimized="true"] {
|
|
1504
|
-
bottom: calc(max(20px, env(safe-area-inset-bottom)) + var(--intro-visual-bottom-offset, 0px));
|
|
1506
|
+
bottom: calc(max(20px, env(safe-area-inset-bottom)) + var(--intro-visual-bottom-offset, 0px) + var(--intro-badge-bottom-offset, 0px));
|
|
1505
1507
|
}
|
|
1506
1508
|
.intro[data-anchor="left"] {
|
|
1507
1509
|
inset-inline-start: 20px;
|
|
@@ -4167,7 +4169,7 @@ const style = `
|
|
|
4167
4169
|
.intro-voice { padding-inline: 8px; }
|
|
4168
4170
|
.intro,
|
|
4169
4171
|
.intro[data-minimized="true"] {
|
|
4170
|
-
bottom: calc(max(8px, env(safe-area-inset-bottom)) + var(--intro-visual-bottom-offset, 0px)) !important;
|
|
4172
|
+
bottom: calc(max(8px, env(safe-area-inset-bottom)) + var(--intro-visual-bottom-offset, 0px) + var(--intro-badge-bottom-offset, 0px)) !important;
|
|
4171
4173
|
}
|
|
4172
4174
|
.panel.open:not(.compact) {
|
|
4173
4175
|
inset: 0 !important;
|
|
@@ -4433,6 +4435,7 @@ class WidgetView {
|
|
|
4433
4435
|
this.introFocusScrollGuard = null;
|
|
4434
4436
|
this.introFocusScrollGuardTimer = null;
|
|
4435
4437
|
this.introViewportFrame = null;
|
|
4438
|
+
this.framerBadgePlacement = null;
|
|
4436
4439
|
this.panelTransitionTimers = new Set();
|
|
4437
4440
|
this.panelTransitionSettlers = new Set();
|
|
4438
4441
|
this.companionTransferRestoreExpanded = false;
|
|
@@ -4914,6 +4917,7 @@ class WidgetView {
|
|
|
4914
4917
|
this.disablePreviewNavigation();
|
|
4915
4918
|
this.syncEffectMotion();
|
|
4916
4919
|
this.syncSurfaceEffectOwner();
|
|
4920
|
+
this.framerBadgePlacement = new framerBadgePlacement_js_1.FramerBadgePlacement(this.host, this.intro, this.panel);
|
|
4917
4921
|
}
|
|
4918
4922
|
setRemoteStream(stream) {
|
|
4919
4923
|
if (this.destroyed || this.audio.srcObject === stream)
|
|
@@ -8445,6 +8449,8 @@ class WidgetView {
|
|
|
8445
8449
|
if (this.destroyed)
|
|
8446
8450
|
return;
|
|
8447
8451
|
this.destroyed = true;
|
|
8452
|
+
this.framerBadgePlacement?.destroy();
|
|
8453
|
+
this.framerBadgePlacement = null;
|
|
8448
8454
|
window.removeEventListener("resize", this.onResize);
|
|
8449
8455
|
window.removeEventListener("scroll", this.onHighlightViewportGeometryChange);
|
|
8450
8456
|
window.removeEventListener("scroll", this.onIntroFocusHostScroll);
|
|
@@ -9732,6 +9738,7 @@ class WidgetView {
|
|
|
9732
9738
|
? Math.min(Math.max(0, layoutHeight - visualBottom), layoutHeight * 0.75)
|
|
9733
9739
|
: 0;
|
|
9734
9740
|
this.host.style.setProperty("--intro-visual-bottom-offset", `${Math.round(occludedBottom)}px`);
|
|
9741
|
+
this.framerBadgePlacement?.schedule();
|
|
9735
9742
|
}
|
|
9736
9743
|
focusIntroControl(mode) {
|
|
9737
9744
|
const input = this.require('[data-role="intro-text-input"]');
|
package/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "7.5.
|
|
1
|
+
export declare const VERSION = "7.5.32";
|
package/cjs/version.js
CHANGED
package/lib/AiLiveAssist.d.ts
CHANGED
|
@@ -34,7 +34,7 @@ export declare const normalizeAiGuideOpenInput: (input?: AiGuideOpenInput) => Re
|
|
|
34
34
|
export declare const resolveAiGuideProtocolVersion: (bootstrap: Pick<BootstrapConfig, "experienceMode" | "minimumProtocolVersion" | "protocol">) => 1 | 2;
|
|
35
35
|
export default class AiLiveAssist {
|
|
36
36
|
private readonly options;
|
|
37
|
-
readonly version = "7.5.
|
|
37
|
+
readonly version = "7.5.32";
|
|
38
38
|
private readonly host;
|
|
39
39
|
private readonly guideAdmission;
|
|
40
40
|
private readonly standaloneAdmissionPending;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** Keep Guide launchers clear of Framer's visible attribution link. */
|
|
2
|
+
export declare class FramerBadgePlacement {
|
|
3
|
+
private readonly host;
|
|
4
|
+
private readonly intro;
|
|
5
|
+
private readonly panel;
|
|
6
|
+
private frame;
|
|
7
|
+
private offset;
|
|
8
|
+
private panelOffset;
|
|
9
|
+
private destroyed;
|
|
10
|
+
private badge;
|
|
11
|
+
private badgeLink;
|
|
12
|
+
private documentObserver;
|
|
13
|
+
private badgeObserver;
|
|
14
|
+
private introObserver;
|
|
15
|
+
private resizeObserver;
|
|
16
|
+
constructor(host: HTMLElement, intro: HTMLElement, panel: HTMLElement);
|
|
17
|
+
schedule: () => void;
|
|
18
|
+
private sync;
|
|
19
|
+
destroy(): void;
|
|
20
|
+
}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
const BADGE_ID = "__framer-badge-container";
|
|
2
|
+
const BADGE_GAP = 8;
|
|
3
|
+
const OFFSET_PROPERTY = "--intro-badge-bottom-offset";
|
|
4
|
+
const PANEL_OFFSET_PROPERTY = "--panel-badge-bottom-offset";
|
|
5
|
+
const SURFACES = ".intro-composer-frame, .status-card, .legal-trigger, .recording-consent";
|
|
6
|
+
/** Keep Guide launchers clear of Framer's visible attribution link. */
|
|
7
|
+
export class FramerBadgePlacement {
|
|
8
|
+
constructor(host, intro, panel) {
|
|
9
|
+
this.host = host;
|
|
10
|
+
this.intro = intro;
|
|
11
|
+
this.panel = panel;
|
|
12
|
+
this.frame = null;
|
|
13
|
+
this.offset = 0;
|
|
14
|
+
this.panelOffset = 0;
|
|
15
|
+
this.destroyed = false;
|
|
16
|
+
this.badge = null;
|
|
17
|
+
this.badgeLink = null;
|
|
18
|
+
this.documentObserver = null;
|
|
19
|
+
this.badgeObserver = null;
|
|
20
|
+
this.introObserver = null;
|
|
21
|
+
this.resizeObserver = null;
|
|
22
|
+
this.schedule = () => {
|
|
23
|
+
if (this.destroyed || !this.documentObserver || this.frame !== null)
|
|
24
|
+
return;
|
|
25
|
+
this.frame = requestAnimationFrame(() => {
|
|
26
|
+
this.frame = null;
|
|
27
|
+
this.sync();
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
// Other platforms need neither a page observer nor a different placement.
|
|
31
|
+
if (!document.getElementById(BADGE_ID) &&
|
|
32
|
+
!document.querySelector('meta[name="generator"][content^="Framer"]')) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
this.documentObserver = new MutationObserver(this.schedule);
|
|
36
|
+
this.documentObserver.observe(document.documentElement, {
|
|
37
|
+
childList: true,
|
|
38
|
+
subtree: true,
|
|
39
|
+
});
|
|
40
|
+
this.introObserver = new MutationObserver(this.schedule);
|
|
41
|
+
this.introObserver.observe(intro, {
|
|
42
|
+
attributes: true,
|
|
43
|
+
subtree: true,
|
|
44
|
+
attributeFilter: ["hidden", "data-anchor", "data-minimized"],
|
|
45
|
+
});
|
|
46
|
+
this.introObserver.observe(panel, {
|
|
47
|
+
attributes: true,
|
|
48
|
+
attributeFilter: ["class", "style", "hidden", "data-anchor"],
|
|
49
|
+
});
|
|
50
|
+
if (typeof ResizeObserver === "function") {
|
|
51
|
+
this.resizeObserver = new ResizeObserver(this.schedule);
|
|
52
|
+
this.resizeObserver.observe(intro);
|
|
53
|
+
this.resizeObserver.observe(panel);
|
|
54
|
+
intro.querySelectorAll(SURFACES).forEach((surface) => {
|
|
55
|
+
this.resizeObserver.observe(surface);
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
window.addEventListener("resize", this.schedule, { passive: true });
|
|
59
|
+
window.addEventListener("scroll", this.schedule, { passive: true });
|
|
60
|
+
window.visualViewport?.addEventListener("resize", this.schedule);
|
|
61
|
+
window.visualViewport?.addEventListener("scroll", this.schedule);
|
|
62
|
+
this.sync();
|
|
63
|
+
}
|
|
64
|
+
sync() {
|
|
65
|
+
const badge = document.getElementById(BADGE_ID);
|
|
66
|
+
if (badge !== this.badge) {
|
|
67
|
+
if (this.badge) {
|
|
68
|
+
this.resizeObserver?.unobserve(this.badge);
|
|
69
|
+
this.badge.removeEventListener("transitionend", this.schedule);
|
|
70
|
+
this.badge.removeEventListener("animationend", this.schedule);
|
|
71
|
+
}
|
|
72
|
+
this.badgeObserver?.disconnect();
|
|
73
|
+
this.badge = badge;
|
|
74
|
+
if (badge) {
|
|
75
|
+
badge.addEventListener("transitionend", this.schedule);
|
|
76
|
+
badge.addEventListener("animationend", this.schedule);
|
|
77
|
+
this.resizeObserver?.observe(badge);
|
|
78
|
+
this.badgeObserver = new MutationObserver(this.schedule);
|
|
79
|
+
this.badgeObserver.observe(badge, {
|
|
80
|
+
attributes: true,
|
|
81
|
+
subtree: true,
|
|
82
|
+
attributeFilter: ["class", "style", "hidden"],
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
// The container spans the whole viewport; only its link is an obstacle.
|
|
87
|
+
const link = badge?.querySelector("a[href]") ?? null;
|
|
88
|
+
if (link !== this.badgeLink) {
|
|
89
|
+
if (this.badgeLink)
|
|
90
|
+
this.resizeObserver?.unobserve(this.badgeLink);
|
|
91
|
+
this.badgeLink = link ?? null;
|
|
92
|
+
if (link)
|
|
93
|
+
this.resizeObserver?.observe(link);
|
|
94
|
+
}
|
|
95
|
+
let nextOffset = 0;
|
|
96
|
+
let nextPanelOffset = 0;
|
|
97
|
+
if (link) {
|
|
98
|
+
const style = getComputedStyle(link);
|
|
99
|
+
let transparent = false;
|
|
100
|
+
for (let element = link; element; element = element.parentElement) {
|
|
101
|
+
if (getComputedStyle(element).opacity === "0") {
|
|
102
|
+
transparent = true;
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
if (element === badge)
|
|
106
|
+
break;
|
|
107
|
+
}
|
|
108
|
+
const obstacle = link.getBoundingClientRect();
|
|
109
|
+
if (!transparent &&
|
|
110
|
+
style.visibility !== "hidden" &&
|
|
111
|
+
style.display !== "none" &&
|
|
112
|
+
obstacle.width > 0 &&
|
|
113
|
+
obstacle.height > 0 &&
|
|
114
|
+
obstacle.bottom > 0 &&
|
|
115
|
+
obstacle.top < window.innerHeight &&
|
|
116
|
+
obstacle.right > 0 &&
|
|
117
|
+
obstacle.left < window.innerWidth) {
|
|
118
|
+
const requiredOffset = (surfaces, offset) => {
|
|
119
|
+
let result = 0;
|
|
120
|
+
for (const surface of surfaces) {
|
|
121
|
+
const rect = surface.getBoundingClientRect();
|
|
122
|
+
// Undo our previous shift when measuring, so repeated updates do not
|
|
123
|
+
// accumulate offsets or bounce between the shifted and base positions.
|
|
124
|
+
const top = rect.top + offset;
|
|
125
|
+
const bottom = rect.bottom + offset;
|
|
126
|
+
if (rect.width > 0 &&
|
|
127
|
+
rect.height > 0 &&
|
|
128
|
+
rect.left < obstacle.right + BADGE_GAP &&
|
|
129
|
+
rect.right > obstacle.left - BADGE_GAP &&
|
|
130
|
+
top < obstacle.bottom + BADGE_GAP &&
|
|
131
|
+
bottom > obstacle.top - BADGE_GAP) {
|
|
132
|
+
result = Math.max(result, Math.ceil(bottom - obstacle.top + BADGE_GAP));
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
return result;
|
|
136
|
+
};
|
|
137
|
+
if (!this.intro.hidden) {
|
|
138
|
+
nextOffset = requiredOffset(this.intro.querySelectorAll(SURFACES), this.offset);
|
|
139
|
+
}
|
|
140
|
+
// Keep explicitly dragged panels where the visitor put them. Expanded
|
|
141
|
+
// panels, including the mobile full-screen dialog, retain their layout.
|
|
142
|
+
if (this.panel.classList.contains("compact") && !this.panel.style.top) {
|
|
143
|
+
nextPanelOffset = requiredOffset([this.panel], this.panelOffset);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
if (nextOffset !== this.offset) {
|
|
148
|
+
this.offset = nextOffset;
|
|
149
|
+
this.host.style.setProperty(OFFSET_PROPERTY, `${nextOffset}px`);
|
|
150
|
+
}
|
|
151
|
+
if (nextPanelOffset !== this.panelOffset) {
|
|
152
|
+
this.panelOffset = nextPanelOffset;
|
|
153
|
+
this.host.style.setProperty(PANEL_OFFSET_PROPERTY, `${nextPanelOffset}px`);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
destroy() {
|
|
157
|
+
this.destroyed = true;
|
|
158
|
+
if (this.frame !== null)
|
|
159
|
+
cancelAnimationFrame(this.frame);
|
|
160
|
+
this.documentObserver?.disconnect();
|
|
161
|
+
this.badgeObserver?.disconnect();
|
|
162
|
+
this.badge?.removeEventListener("transitionend", this.schedule);
|
|
163
|
+
this.badge?.removeEventListener("animationend", this.schedule);
|
|
164
|
+
this.introObserver?.disconnect();
|
|
165
|
+
this.resizeObserver?.disconnect();
|
|
166
|
+
window.removeEventListener("resize", this.schedule);
|
|
167
|
+
window.removeEventListener("scroll", this.schedule);
|
|
168
|
+
window.visualViewport?.removeEventListener("resize", this.schedule);
|
|
169
|
+
window.visualViewport?.removeEventListener("scroll", this.schedule);
|
|
170
|
+
this.host.style.removeProperty(OFFSET_PROPERTY);
|
|
171
|
+
this.host.style.removeProperty(PANEL_OFFSET_PROPERTY);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { GuideMeasurementBridge, GuideMeasurementIntent } from './guideTypes.js';
|
|
2
|
-
export declare const GUIDE_MEASUREMENT_CLIENT_VERSION = "7.5.
|
|
2
|
+
export declare const GUIDE_MEASUREMENT_CLIENT_VERSION = "7.5.32";
|
|
3
3
|
export declare function isGuideMeasurementIntent(value: unknown): value is GuideMeasurementIntent;
|
|
4
4
|
/** The managed analytics owner supplies possession; this check grants no authority. */
|
|
5
5
|
export declare function currentGuideMeasurementBridge(value: unknown): value is GuideMeasurementBridge;
|
package/lib/guideMeasurement.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type MerchantPreviewRuntimePolicy } from './merchantPreviewOrigins.js';
|
|
2
2
|
import { type LiveDuplexMediaOptions, type LiveDuplexMediaDependencies } from './liveDuplexMedia.js';
|
|
3
3
|
import { type CommerceBootstrap, type CommerceContext, type CommerceCartSelection, type CommerceProduct, type CommerceContextClear, type LiveCommerceCatalog, type LiveCommerceDisplayed } from './commerce/contracts.js';
|
|
4
|
-
export declare const LIVE_CONTROL_CLIENT_VERSION = "7.5.
|
|
4
|
+
export declare const LIVE_CONTROL_CLIENT_VERSION = "7.5.32";
|
|
5
5
|
export declare const LIVE_CONTROL_CLIENT_CAPABILITIES: readonly ["live_duplex_v1", "live_local_wake_v1", "live_fragment_captions_v1"];
|
|
6
6
|
declare const phases: readonly ["voice_off", "local_listening", "wake_buffering", "starting", "active", "tentative_idle", "closing", "uncertain", "muted", "suspended", "budget_blocked", "ended"];
|
|
7
7
|
export type LiveControlState = {
|
package/lib/ui.d.ts
CHANGED
|
@@ -192,6 +192,7 @@ export declare class WidgetView {
|
|
|
192
192
|
private introFocusScrollGuard;
|
|
193
193
|
private introFocusScrollGuardTimer;
|
|
194
194
|
private introViewportFrame;
|
|
195
|
+
private framerBadgePlacement;
|
|
195
196
|
private panelTransitionTimers;
|
|
196
197
|
private panelTransitionSettlers;
|
|
197
198
|
private companionTransferRestoreExpanded;
|
package/lib/ui.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { AudioLines, Captions, CaptionsOff, CircleStop, Eye, EyeOff, Grid2X2Plus, Hand, Maximize2, MessageSquareText, Mic, MicOff, Minus, Minimize2, Pause, Play, RotateCcw, Send, ShieldCheck, ShieldOff, UserRound, X, createElement as createLucideElement, } from "lucide";
|
|
2
2
|
import { normalizeAvatarUrl } from "./avatarUrl.js";
|
|
3
3
|
import { DialogFocusScope } from "./dialogFocusScope.js";
|
|
4
|
+
import { FramerBadgePlacement } from "./framerBadgePlacement.js";
|
|
4
5
|
import { createShoppingNotesScope } from "./commerce/shoppingNotes.js";
|
|
5
6
|
import { ShoppingNotesView, SHOPPING_NOTES_STYLES } from "./commerce/shoppingNotesView.js";
|
|
6
7
|
import { CtaOfferCard, CTA_OFFER_STYLES, parseCtaOffer } from "./ctaOffer.js";
|
|
@@ -1030,6 +1031,7 @@ const style = `
|
|
|
1030
1031
|
:host([data-theme="dark"]) .panel.open:not(.compact) .close:hover {
|
|
1031
1032
|
background: var(--mode-active-background);
|
|
1032
1033
|
}
|
|
1034
|
+
.panel.compact { margin-bottom: var(--panel-badge-bottom-offset, 0px); }
|
|
1033
1035
|
.panel.active-session.compact .brand-mark {
|
|
1034
1036
|
width: 42px;
|
|
1035
1037
|
height: 42px;
|
|
@@ -1498,7 +1500,7 @@ const style = `
|
|
|
1498
1500
|
}
|
|
1499
1501
|
.intro,
|
|
1500
1502
|
.intro[data-minimized="true"] {
|
|
1501
|
-
bottom: calc(max(20px, env(safe-area-inset-bottom)) + var(--intro-visual-bottom-offset, 0px));
|
|
1503
|
+
bottom: calc(max(20px, env(safe-area-inset-bottom)) + var(--intro-visual-bottom-offset, 0px) + var(--intro-badge-bottom-offset, 0px));
|
|
1502
1504
|
}
|
|
1503
1505
|
.intro[data-anchor="left"] {
|
|
1504
1506
|
inset-inline-start: 20px;
|
|
@@ -4164,7 +4166,7 @@ const style = `
|
|
|
4164
4166
|
.intro-voice { padding-inline: 8px; }
|
|
4165
4167
|
.intro,
|
|
4166
4168
|
.intro[data-minimized="true"] {
|
|
4167
|
-
bottom: calc(max(8px, env(safe-area-inset-bottom)) + var(--intro-visual-bottom-offset, 0px)) !important;
|
|
4169
|
+
bottom: calc(max(8px, env(safe-area-inset-bottom)) + var(--intro-visual-bottom-offset, 0px) + var(--intro-badge-bottom-offset, 0px)) !important;
|
|
4168
4170
|
}
|
|
4169
4171
|
.panel.open:not(.compact) {
|
|
4170
4172
|
inset: 0 !important;
|
|
@@ -4430,6 +4432,7 @@ export class WidgetView {
|
|
|
4430
4432
|
this.introFocusScrollGuard = null;
|
|
4431
4433
|
this.introFocusScrollGuardTimer = null;
|
|
4432
4434
|
this.introViewportFrame = null;
|
|
4435
|
+
this.framerBadgePlacement = null;
|
|
4433
4436
|
this.panelTransitionTimers = new Set();
|
|
4434
4437
|
this.panelTransitionSettlers = new Set();
|
|
4435
4438
|
this.companionTransferRestoreExpanded = false;
|
|
@@ -4911,6 +4914,7 @@ export class WidgetView {
|
|
|
4911
4914
|
this.disablePreviewNavigation();
|
|
4912
4915
|
this.syncEffectMotion();
|
|
4913
4916
|
this.syncSurfaceEffectOwner();
|
|
4917
|
+
this.framerBadgePlacement = new FramerBadgePlacement(this.host, this.intro, this.panel);
|
|
4914
4918
|
}
|
|
4915
4919
|
setRemoteStream(stream) {
|
|
4916
4920
|
if (this.destroyed || this.audio.srcObject === stream)
|
|
@@ -8442,6 +8446,8 @@ export class WidgetView {
|
|
|
8442
8446
|
if (this.destroyed)
|
|
8443
8447
|
return;
|
|
8444
8448
|
this.destroyed = true;
|
|
8449
|
+
this.framerBadgePlacement?.destroy();
|
|
8450
|
+
this.framerBadgePlacement = null;
|
|
8445
8451
|
window.removeEventListener("resize", this.onResize);
|
|
8446
8452
|
window.removeEventListener("scroll", this.onHighlightViewportGeometryChange);
|
|
8447
8453
|
window.removeEventListener("scroll", this.onIntroFocusHostScroll);
|
|
@@ -9729,6 +9735,7 @@ export class WidgetView {
|
|
|
9729
9735
|
? Math.min(Math.max(0, layoutHeight - visualBottom), layoutHeight * 0.75)
|
|
9730
9736
|
: 0;
|
|
9731
9737
|
this.host.style.setProperty("--intro-visual-bottom-offset", `${Math.round(occludedBottom)}px`);
|
|
9738
|
+
this.framerBadgePlacement?.schedule();
|
|
9732
9739
|
}
|
|
9733
9740
|
focusIntroControl(mode) {
|
|
9734
9741
|
const input = this.require('[data-role="intro-text-input"]');
|
package/lib/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "7.5.
|
|
1
|
+
export declare const VERSION = "7.5.32";
|
package/lib/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '7.5.
|
|
1
|
+
export const VERSION = '7.5.32';
|