@oxvo/ai-live-assist 7.5.19 → 7.5.21
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 +8 -1
- package/cjs/AiLiveAssist.js +113 -8
- package/cjs/client.d.ts +5 -3
- package/cjs/client.js +44 -5
- package/cjs/commerce/cartContracts.d.ts +158 -0
- package/cjs/commerce/cartContracts.js +228 -0
- package/cjs/commerce/cartSession.d.ts +86 -0
- package/cjs/commerce/cartSession.js +475 -0
- package/cjs/commerce/contracts.d.ts +152 -0
- package/cjs/commerce/contracts.js +322 -0
- package/cjs/commerce/pageContext.d.ts +50 -0
- package/cjs/commerce/pageContext.js +173 -0
- package/cjs/commerce/productPanel.d.ts +65 -0
- package/cjs/commerce/productPanel.js +662 -0
- package/cjs/commerce/realtimeCommerce.d.ts +73 -0
- package/cjs/commerce/realtimeCommerce.js +342 -0
- package/cjs/commerce/shopifyCart.d.ts +130 -0
- package/cjs/commerce/shopifyCart.js +1135 -0
- package/cjs/commerce/shopifyCartPresentation.d.ts +12 -0
- package/cjs/commerce/shopifyCartPresentation.js +379 -0
- package/cjs/commerce/shoppingNotes.d.ts +61 -0
- package/cjs/commerce/shoppingNotes.js +313 -0
- package/cjs/commerce/shoppingNotesView.d.ts +46 -0
- package/cjs/commerce/shoppingNotesView.js +269 -0
- package/cjs/control.d.ts +9 -1
- package/cjs/control.js +51 -1
- package/cjs/guideAdmission.d.ts +5 -2
- package/cjs/guideAdmission.js +21 -2
- package/cjs/guideInstaller.js +1 -1
- package/cjs/guideMeasurement.d.ts +5 -0
- package/cjs/guideMeasurement.js +29 -0
- package/cjs/guideSubjectStore.js +2 -0
- package/cjs/guideTypes.d.ts +18 -0
- package/cjs/liveControlChannel.d.ts +43 -1
- package/cjs/liveControlChannel.js +166 -14
- package/cjs/liveGuideAdmission.d.ts +3 -2
- package/cjs/liveGuideAdmission.js +10 -2
- package/cjs/liveGuideWidget.d.ts +18 -0
- package/cjs/liveGuideWidget.js +228 -23
- package/cjs/locales/resources.js +2240 -0
- package/cjs/messages.js +56 -0
- package/cjs/tabLock.d.ts +2 -0
- package/cjs/tabLock.js +11 -1
- package/cjs/types.d.ts +6 -2
- package/cjs/types.js +56 -0
- package/cjs/ui.d.ts +37 -0
- package/cjs/ui.js +261 -9
- package/cjs/version.d.ts +1 -1
- package/cjs/version.js +1 -1
- package/lib/AiLiveAssist.d.ts +8 -1
- package/lib/AiLiveAssist.js +113 -8
- package/lib/client.d.ts +5 -3
- package/lib/client.js +44 -5
- package/lib/commerce/cartContracts.d.ts +158 -0
- package/lib/commerce/cartContracts.js +221 -0
- package/lib/commerce/cartSession.d.ts +86 -0
- package/lib/commerce/cartSession.js +471 -0
- package/lib/commerce/contracts.d.ts +152 -0
- package/lib/commerce/contracts.js +300 -0
- package/lib/commerce/pageContext.d.ts +50 -0
- package/lib/commerce/pageContext.js +168 -0
- package/lib/commerce/productPanel.d.ts +65 -0
- package/lib/commerce/productPanel.js +657 -0
- package/lib/commerce/realtimeCommerce.d.ts +73 -0
- package/lib/commerce/realtimeCommerce.js +337 -0
- package/lib/commerce/shopifyCart.d.ts +130 -0
- package/lib/commerce/shopifyCart.js +1130 -0
- package/lib/commerce/shopifyCartPresentation.d.ts +12 -0
- package/lib/commerce/shopifyCartPresentation.js +376 -0
- package/lib/commerce/shoppingNotes.d.ts +61 -0
- package/lib/commerce/shoppingNotes.js +307 -0
- package/lib/commerce/shoppingNotesView.d.ts +46 -0
- package/lib/commerce/shoppingNotesView.js +265 -0
- package/lib/control.d.ts +9 -1
- package/lib/control.js +51 -1
- package/lib/guideAdmission.d.ts +5 -2
- package/lib/guideAdmission.js +21 -2
- package/lib/guideInstaller.js +1 -1
- package/lib/guideMeasurement.d.ts +5 -0
- package/lib/guideMeasurement.js +24 -0
- package/lib/guideSubjectStore.js +2 -0
- package/lib/guideTypes.d.ts +18 -0
- package/lib/liveControlChannel.d.ts +43 -1
- package/lib/liveControlChannel.js +166 -14
- package/lib/liveGuideAdmission.d.ts +3 -2
- package/lib/liveGuideAdmission.js +10 -2
- package/lib/liveGuideWidget.d.ts +18 -0
- package/lib/liveGuideWidget.js +228 -23
- package/lib/locales/resources.js +2240 -0
- package/lib/messages.js +56 -0
- package/lib/tabLock.d.ts +2 -0
- package/lib/tabLock.js +11 -1
- package/lib/types.d.ts +6 -2
- package/lib/types.js +56 -0
- package/lib/ui.d.ts +37 -0
- package/lib/ui.js +261 -9
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +1 -1
package/lib/messages.js
CHANGED
|
@@ -1,4 +1,60 @@
|
|
|
1
1
|
export const defaultMessages = {
|
|
2
|
+
commerceTitle: "Products for you",
|
|
3
|
+
commerceBestSelling: "Store best-selling order",
|
|
4
|
+
commerceRelevant: "Matches from the store catalog",
|
|
5
|
+
commercePriceOrder: "Price: low to high",
|
|
6
|
+
commerceCatalogOrder: "From the store catalog",
|
|
7
|
+
commerceEmpty: "No products matched. Try another need, option or budget.",
|
|
8
|
+
commerceLoading: "Checking products and options…",
|
|
9
|
+
commerceError: "Product details could not be refreshed. Please try again.",
|
|
10
|
+
commerceExpired: "These details may have changed. Refresh before choosing a product.",
|
|
11
|
+
commerceRefresh: "Refresh products",
|
|
12
|
+
commerceChoose: "Choose {option}",
|
|
13
|
+
commerceOptions: "Check selected options",
|
|
14
|
+
commerceMoreOptions: "See all options on the product page",
|
|
15
|
+
commerceAvailable: "Available when checked",
|
|
16
|
+
commerceUnavailable: "Currently unavailable",
|
|
17
|
+
commerceUnknown: "Choose options for price and availability",
|
|
18
|
+
commerceView: "View product",
|
|
19
|
+
commerceCompare: "Compare selected",
|
|
20
|
+
commerceCompareSelect: "Compare {product}",
|
|
21
|
+
commerceBack: "Back to products",
|
|
22
|
+
commerceAdd: "Add to cart",
|
|
23
|
+
commerceQuantity: "Quantity",
|
|
24
|
+
commerceSubscription: "Choose your purchase plan on the product page",
|
|
25
|
+
commerceCartAdded: "Added to your cart",
|
|
26
|
+
commerceCartPartial: "Only part of the requested quantity was added. Review your cart before continuing.",
|
|
27
|
+
commerceCartUnavailable: "This item could not be added. Review the product or your cart before continuing.",
|
|
28
|
+
commerceCartCount: "Items in your cart: {count}",
|
|
29
|
+
commerceCartConsent: "Allow additions to my cart",
|
|
30
|
+
commerceCartConsentDescription: "The Guide can add items you choose in this conversation. You control checkout.",
|
|
31
|
+
commerceViewCart: "View cart",
|
|
32
|
+
commerceKeepShopping: "Keep shopping",
|
|
33
|
+
commerceUndo: "Undo this addition",
|
|
34
|
+
commerceCartChanged: "Your cart changed. Review it before continuing.",
|
|
35
|
+
commerceCartUncertain: "The cart response was interrupted. Check your cart before adding again.",
|
|
36
|
+
commerceCartChecking: "Checking your cart…",
|
|
37
|
+
commerceCartRecheck: "Check cart again",
|
|
38
|
+
shoppingNotesTitle: "Shopping notes",
|
|
39
|
+
shoppingNotesReview: "Review shopping notes",
|
|
40
|
+
shoppingNotesSaveItem: "Save item",
|
|
41
|
+
shoppingNotesDescription: "Keep your notes and up to 3 chosen items in this tab for 30 minutes. Notes are only shared when you choose Start a new chat.",
|
|
42
|
+
shoppingNotesNeeds: "What would you like to remember?",
|
|
43
|
+
shoppingNotesSave: "Save notes",
|
|
44
|
+
shoppingNotesClear: "Clear notes",
|
|
45
|
+
shoppingNotesRemove: "Remove {product}",
|
|
46
|
+
shoppingNotesStart: "Start a new chat",
|
|
47
|
+
shoppingNotesSaved: "Shopping notes saved.",
|
|
48
|
+
shoppingNotesCleared: "Shopping notes cleared.",
|
|
49
|
+
shoppingNotesStorageError: "Shopping notes could not be saved or cleared on this device. Try again.",
|
|
50
|
+
shoppingNotesTooLarge: "Shorten your notes or remove an item, then try again.",
|
|
51
|
+
shoppingNotesTooMany: "You can save up to 3 items. Remove one before saving another.",
|
|
52
|
+
shoppingNotesEmpty: "Write a note or save an item first.",
|
|
53
|
+
shoppingNotesStartFailed: "A new chat could not start. Your notes are still here.",
|
|
54
|
+
shoppingNotesExpired: "These shopping notes expired. Save them again before starting a chat.",
|
|
55
|
+
shoppingNotesInvalid: "Some shopping notes are not valid. Edit them and try again.",
|
|
56
|
+
shoppingNotesItem: "Saved item",
|
|
57
|
+
commerceClose: "Close products",
|
|
2
58
|
ctaDismiss: "Dismiss suggestion",
|
|
3
59
|
ctaNewTab: "Opens in a new tab",
|
|
4
60
|
ctaAvailable: "An optional next step is available.",
|
package/lib/tabLock.d.ts
CHANGED
|
@@ -4,6 +4,8 @@ export type TabTransferAuthority = {
|
|
|
4
4
|
revision: number;
|
|
5
5
|
};
|
|
6
6
|
export type TabHandoffLifecycle = {
|
|
7
|
+
/** Capture owned cleanup synchronously before a real navigation releases it. */
|
|
8
|
+
onBeforePageHideRelease?: (event: PageTransitionEvent) => void;
|
|
7
9
|
onCommitting?: (payload: unknown, authority: TabTransferAuthority) => boolean | void;
|
|
8
10
|
onCommitted?: (payload: unknown, authority: TabTransferAuthority) => void;
|
|
9
11
|
onRelinquished?: (payload: unknown, authority: TabTransferAuthority) => void;
|
package/lib/tabLock.js
CHANGED
|
@@ -108,8 +108,18 @@ export class TabActivityLock {
|
|
|
108
108
|
this.reportOtherTab();
|
|
109
109
|
};
|
|
110
110
|
this.onPageHide = (event) => {
|
|
111
|
-
if (
|
|
111
|
+
if (event.persisted)
|
|
112
|
+
return;
|
|
113
|
+
try {
|
|
114
|
+
if (this.ownsActivity())
|
|
115
|
+
this.lifecycle.onBeforePageHideRelease?.(event);
|
|
116
|
+
}
|
|
117
|
+
catch {
|
|
118
|
+
// Cleanup failure must not strand the departing page's activity lock.
|
|
119
|
+
}
|
|
120
|
+
finally {
|
|
112
121
|
this.release();
|
|
122
|
+
}
|
|
113
123
|
};
|
|
114
124
|
this.onMessage = (event) => {
|
|
115
125
|
const value = event.data;
|
package/lib/types.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import type { CommerceBootstrap } from "./commerce/contracts.js";
|
|
2
|
+
export type ConsentScope = "ai_disclosure" | "text" | "microphone" | "page_context" | "browser_control" | "commerce_cart" | "visual_context" | "handoff_context" | "retained_transcript" | "session_recording" | "presentation_guidance";
|
|
2
3
|
export type ExperienceMode = "standard" | "voice_presence";
|
|
3
4
|
export type CapabilityTier = "standard" | "reduced_motion" | "low_power" | "static";
|
|
4
5
|
export type VoicePresenceConfig = {
|
|
@@ -149,6 +150,7 @@ export type CtaResult = {
|
|
|
149
150
|
outcome: "clicked" | "dismissed";
|
|
150
151
|
};
|
|
151
152
|
export type BootstrapConfig = {
|
|
153
|
+
commerce?: CommerceBootstrap;
|
|
152
154
|
schemaVersion: 1 | 3;
|
|
153
155
|
providerProtocol?: "live";
|
|
154
156
|
providerModel?: "gpt-live-1";
|
|
@@ -180,6 +182,8 @@ export type BootstrapConfig = {
|
|
|
180
182
|
ctaOffer?: boolean;
|
|
181
183
|
pageContext: boolean;
|
|
182
184
|
browserControl: boolean;
|
|
185
|
+
commerceCart?: boolean;
|
|
186
|
+
guideMeasurementV1?: true;
|
|
183
187
|
pageAssistance?: boolean;
|
|
184
188
|
statefulButtonActionProof?: boolean;
|
|
185
189
|
visualContext: boolean;
|
|
@@ -482,7 +486,7 @@ export type PresentationTarget = {
|
|
|
482
486
|
rect: DOMRectReadOnly;
|
|
483
487
|
safe: boolean;
|
|
484
488
|
};
|
|
485
|
-
export declare const WIDGET_MESSAGE_KEYS: readonly ["ctaDismiss", "ctaNewTab", "ctaAvailable", "ctaPreviewMessage", "launcher", "introTitle", "conversationStarters", "disclosure", "requiredConsent", "consentAgreement", "pageAssistanceTitle", "pageAssistanceAlways", "pageAssistanceAgreement", "pageAssistanceAgreementConnector", "pageAssistanceAgreementTerminator", "pageAssistanceAppliesTo", "pageAssistanceAllow", "pageAssistanceNotNow", "pageAssistanceRevoke", "legalDetails", "legalTitle", "legalClose", "termsOfService", "microphoneConsent", "pageConsent", "controlConsent", "visualConsent", "visualRequest", "shareVisual", "declineVisual", "visualShared", "visualUnavailable", "pauseVisual", "resumeVisual", "handoffConsent", "handoffContextShare", "handoffContextNotNow", "retentionConsent", "recordingConsent", "recordingConsentDescription", "startText", "startVoice", "connecting", "listening", "thinking", "speaking", "voiceAssistantAnnouncement", "voiceUserAnnouncement", "ready", "paused", "reconnecting", "ending", "handoffEnding", "endRetry", "end", "restart", "close", "minimize", "maximize", "activeCall", "sessionDuration", "sessionControls", "movePanel", "mute", "muted", "unmute", "interrupt", "usePushToTalk", "useAutomaticTurns", "automaticTurnsUnavailable", "startSpeaking", "sendVoiceTurn", "preparingMicrophone", "cancelVoiceStart", "microphoneUnavailable", "voiceUnavailable", "voiceConsentRequired", "startVoiceHint", "repeatWhenMicrophoneReady", "audioMonitoringPaused", "taskContextLimit", "pauseActions", "resumeActions", "captionsOn", "captionsOff", "textOnly", "modeSwitch", "chatMode", "voiceMode", "stopVoice", "send", "messagePlaceholder", "requestHuman", "support", "supportReply", "viewSupport", "continueWithFullAssist", "requestHumanFallback", "approve", "decline", "actionRequest", "actionRunning", "actionVerified", "actionFailed", "actionVerificationExpired", "limitReached", "ended", "idleEnded", "feedbackQuestion", "resolved", "partiallyResolved", "notResolved", "submitFeedback", "error", "retry", "activeElsewhere", "visitorLimitReached", "visitorCooldown", "visitorAlreadyActive", "safetyBoundary", "privacyPolicy", "moreControls", "emptyConversation", "audioPaused", "humanConnected", "humanConnecting", "humanUnavailable", "textMode", "reconnectFailed", "connectedTool", "approvedService", "approvedToolEffect"];
|
|
489
|
+
export declare const WIDGET_MESSAGE_KEYS: readonly ["commerceTitle", "commerceBestSelling", "commerceRelevant", "commercePriceOrder", "commerceCatalogOrder", "commerceEmpty", "commerceLoading", "commerceError", "commerceExpired", "commerceRefresh", "commerceChoose", "commerceOptions", "commerceMoreOptions", "commerceAvailable", "commerceUnavailable", "commerceUnknown", "commerceView", "commerceCompare", "commerceCompareSelect", "commerceBack", "commerceAdd", "commerceQuantity", "commerceSubscription", "commerceCartAdded", "commerceCartPartial", "commerceCartUnavailable", "commerceCartCount", "commerceCartConsent", "commerceCartConsentDescription", "commerceViewCart", "commerceKeepShopping", "commerceUndo", "commerceCartChanged", "commerceCartUncertain", "commerceCartChecking", "commerceCartRecheck", "commerceClose", "shoppingNotesTitle", "shoppingNotesReview", "shoppingNotesSaveItem", "shoppingNotesDescription", "shoppingNotesNeeds", "shoppingNotesSave", "shoppingNotesClear", "shoppingNotesRemove", "shoppingNotesStart", "shoppingNotesSaved", "shoppingNotesCleared", "shoppingNotesStorageError", "shoppingNotesTooLarge", "shoppingNotesTooMany", "shoppingNotesEmpty", "shoppingNotesStartFailed", "shoppingNotesExpired", "shoppingNotesInvalid", "shoppingNotesItem", "ctaDismiss", "ctaNewTab", "ctaAvailable", "ctaPreviewMessage", "launcher", "introTitle", "conversationStarters", "disclosure", "requiredConsent", "consentAgreement", "pageAssistanceTitle", "pageAssistanceAlways", "pageAssistanceAgreement", "pageAssistanceAgreementConnector", "pageAssistanceAgreementTerminator", "pageAssistanceAppliesTo", "pageAssistanceAllow", "pageAssistanceNotNow", "pageAssistanceRevoke", "legalDetails", "legalTitle", "legalClose", "termsOfService", "microphoneConsent", "pageConsent", "controlConsent", "visualConsent", "visualRequest", "shareVisual", "declineVisual", "visualShared", "visualUnavailable", "pauseVisual", "resumeVisual", "handoffConsent", "handoffContextShare", "handoffContextNotNow", "retentionConsent", "recordingConsent", "recordingConsentDescription", "startText", "startVoice", "connecting", "listening", "thinking", "speaking", "voiceAssistantAnnouncement", "voiceUserAnnouncement", "ready", "paused", "reconnecting", "ending", "handoffEnding", "endRetry", "end", "restart", "close", "minimize", "maximize", "activeCall", "sessionDuration", "sessionControls", "movePanel", "mute", "muted", "unmute", "interrupt", "usePushToTalk", "useAutomaticTurns", "automaticTurnsUnavailable", "startSpeaking", "sendVoiceTurn", "preparingMicrophone", "cancelVoiceStart", "microphoneUnavailable", "voiceUnavailable", "voiceConsentRequired", "startVoiceHint", "repeatWhenMicrophoneReady", "audioMonitoringPaused", "taskContextLimit", "pauseActions", "resumeActions", "captionsOn", "captionsOff", "textOnly", "modeSwitch", "chatMode", "voiceMode", "stopVoice", "send", "messagePlaceholder", "requestHuman", "support", "supportReply", "viewSupport", "continueWithFullAssist", "requestHumanFallback", "approve", "decline", "actionRequest", "actionRunning", "actionVerified", "actionFailed", "actionVerificationExpired", "limitReached", "ended", "idleEnded", "feedbackQuestion", "resolved", "partiallyResolved", "notResolved", "submitFeedback", "error", "retry", "activeElsewhere", "visitorLimitReached", "visitorCooldown", "visitorAlreadyActive", "safetyBoundary", "privacyPolicy", "moreControls", "emptyConversation", "audioPaused", "humanConnected", "humanConnecting", "humanUnavailable", "textMode", "reconnectFailed", "connectedTool", "approvedService", "approvedToolEffect"];
|
|
486
490
|
export type WidgetMessageKey = (typeof WIDGET_MESSAGE_KEYS)[number];
|
|
487
491
|
export type PluginOptions = {
|
|
488
492
|
enabled?: boolean;
|
package/lib/types.js
CHANGED
|
@@ -1,4 +1,60 @@
|
|
|
1
1
|
export const WIDGET_MESSAGE_KEYS = [
|
|
2
|
+
"commerceTitle",
|
|
3
|
+
"commerceBestSelling",
|
|
4
|
+
"commerceRelevant",
|
|
5
|
+
"commercePriceOrder",
|
|
6
|
+
"commerceCatalogOrder",
|
|
7
|
+
"commerceEmpty",
|
|
8
|
+
"commerceLoading",
|
|
9
|
+
"commerceError",
|
|
10
|
+
"commerceExpired",
|
|
11
|
+
"commerceRefresh",
|
|
12
|
+
"commerceChoose",
|
|
13
|
+
"commerceOptions",
|
|
14
|
+
"commerceMoreOptions",
|
|
15
|
+
"commerceAvailable",
|
|
16
|
+
"commerceUnavailable",
|
|
17
|
+
"commerceUnknown",
|
|
18
|
+
"commerceView",
|
|
19
|
+
"commerceCompare",
|
|
20
|
+
"commerceCompareSelect",
|
|
21
|
+
"commerceBack",
|
|
22
|
+
"commerceAdd",
|
|
23
|
+
"commerceQuantity",
|
|
24
|
+
"commerceSubscription",
|
|
25
|
+
"commerceCartAdded",
|
|
26
|
+
"commerceCartPartial",
|
|
27
|
+
"commerceCartUnavailable",
|
|
28
|
+
"commerceCartCount",
|
|
29
|
+
"commerceCartConsent",
|
|
30
|
+
"commerceCartConsentDescription",
|
|
31
|
+
"commerceViewCart",
|
|
32
|
+
"commerceKeepShopping",
|
|
33
|
+
"commerceUndo",
|
|
34
|
+
"commerceCartChanged",
|
|
35
|
+
"commerceCartUncertain",
|
|
36
|
+
"commerceCartChecking",
|
|
37
|
+
"commerceCartRecheck",
|
|
38
|
+
"commerceClose",
|
|
39
|
+
"shoppingNotesTitle",
|
|
40
|
+
"shoppingNotesReview",
|
|
41
|
+
"shoppingNotesSaveItem",
|
|
42
|
+
"shoppingNotesDescription",
|
|
43
|
+
"shoppingNotesNeeds",
|
|
44
|
+
"shoppingNotesSave",
|
|
45
|
+
"shoppingNotesClear",
|
|
46
|
+
"shoppingNotesRemove",
|
|
47
|
+
"shoppingNotesStart",
|
|
48
|
+
"shoppingNotesSaved",
|
|
49
|
+
"shoppingNotesCleared",
|
|
50
|
+
"shoppingNotesStorageError",
|
|
51
|
+
"shoppingNotesTooLarge",
|
|
52
|
+
"shoppingNotesTooMany",
|
|
53
|
+
"shoppingNotesEmpty",
|
|
54
|
+
"shoppingNotesStartFailed",
|
|
55
|
+
"shoppingNotesExpired",
|
|
56
|
+
"shoppingNotesInvalid",
|
|
57
|
+
"shoppingNotesItem",
|
|
2
58
|
"ctaDismiss",
|
|
3
59
|
"ctaNewTab",
|
|
4
60
|
"ctaAvailable",
|
package/lib/ui.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { type CommerceProductPanelCallbacks, type CommerceAddHandler, type CommerceCanAdd } from "./commerce/productPanel.js";
|
|
2
|
+
import { type CommerceCatalog, type CommerceMarket, type CommerceOption, type CommerceStore } from "./commerce/contracts.js";
|
|
3
|
+
import type { ShopifyCartOutcome } from "./commerce/shopifyCart.js";
|
|
1
4
|
import type { AssistMode, BootstrapConfig, CapabilityTier, ConsentScope, CtaOffer, CtaResult, HandoffContextRequest, HandoffContextStatus, PageAssistanceDecision, PageAssistanceRequest, VisualContextRequest, WidgetActivity, WidgetMessageKey } from "./types.js";
|
|
2
5
|
type Confirmation = {
|
|
3
6
|
actionId: string;
|
|
@@ -7,6 +10,22 @@ type Confirmation = {
|
|
|
7
10
|
reason: string;
|
|
8
11
|
expectedEffect: string;
|
|
9
12
|
expiresAt: string;
|
|
13
|
+
/** A commerce decision has its own authenticated wire lifecycle. */
|
|
14
|
+
onDecision?: (approved: boolean) => void;
|
|
15
|
+
};
|
|
16
|
+
export type CommerceCartConfirmationView = {
|
|
17
|
+
operationId: string;
|
|
18
|
+
proposalChecksum: string;
|
|
19
|
+
title: string;
|
|
20
|
+
selectedOptions: CommerceOption[];
|
|
21
|
+
quantity: number;
|
|
22
|
+
unitPrice: {
|
|
23
|
+
amount: string;
|
|
24
|
+
currency: string;
|
|
25
|
+
};
|
|
26
|
+
market: CommerceMarket;
|
|
27
|
+
store: CommerceStore;
|
|
28
|
+
expiresAt: string;
|
|
10
29
|
};
|
|
11
30
|
export type WidgetCallbacks = {
|
|
12
31
|
onRecordingConsent?: (allowed: boolean) => void;
|
|
@@ -50,6 +69,9 @@ export type WidgetViewOptions = {
|
|
|
50
69
|
};
|
|
51
70
|
export declare class WidgetView {
|
|
52
71
|
private readonly callbacks;
|
|
72
|
+
private shoppingNotes;
|
|
73
|
+
private commercePanel;
|
|
74
|
+
private commerceCartStatus;
|
|
53
75
|
private ctaCard;
|
|
54
76
|
private ctaSlot;
|
|
55
77
|
private host;
|
|
@@ -80,6 +102,7 @@ export declare class WidgetView {
|
|
|
80
102
|
private playbackAttempt;
|
|
81
103
|
private destroyed;
|
|
82
104
|
private recordingConsent;
|
|
105
|
+
private commerceCartConsent;
|
|
83
106
|
private mediaPlaybackActive;
|
|
84
107
|
private remoteAudioContext;
|
|
85
108
|
private remoteAudioContextStateListener;
|
|
@@ -250,6 +273,18 @@ export declare class WidgetView {
|
|
|
250
273
|
private onEffectVisibilityChange;
|
|
251
274
|
private onReducedMotionChange;
|
|
252
275
|
message(key: WidgetMessageKey): string;
|
|
276
|
+
setCommerceCatalog(catalog: CommerceCatalog, callbacks: CommerceProductPanelCallbacks): void;
|
|
277
|
+
clearCommerceCatalog(): void;
|
|
278
|
+
private configureShoppingNotes;
|
|
279
|
+
private syncShoppingNotesEntry;
|
|
280
|
+
private openShoppingNotes;
|
|
281
|
+
setCommerceBusy(busy: boolean): void;
|
|
282
|
+
setCommerceError(): void;
|
|
283
|
+
setCommerceCartActionHandler(handler: CommerceAddHandler | null, canAdd?: CommerceCanAdd): void;
|
|
284
|
+
showCommerceCartConfirmation(value: CommerceCartConfirmationView, onDecision: (approved: boolean) => void): void;
|
|
285
|
+
clearCommerceCartConfirmation(operationId?: string): void;
|
|
286
|
+
setCommerceCartStatus(outcome: ShopifyCartOutcome, cartUrl: string, onCheck?: () => void | Promise<void>): void;
|
|
287
|
+
clearCommerceCartStatus(): void;
|
|
253
288
|
setAdvancedSessionControlsVisible(visible: boolean): void;
|
|
254
289
|
open(mode?: AssistMode): void;
|
|
255
290
|
restartSession(): boolean;
|
|
@@ -390,6 +425,8 @@ export declare class WidgetView {
|
|
|
390
425
|
private recordingConsentOffered;
|
|
391
426
|
setRecordingConsent(allowed: boolean): void;
|
|
392
427
|
private renderRecordingConsent;
|
|
428
|
+
private commerceCartConsentOffered;
|
|
429
|
+
private renderCommerceCartConsent;
|
|
393
430
|
private renderLegalScopes;
|
|
394
431
|
private start;
|
|
395
432
|
private submitIntroQuestion;
|