@fanfare-io/fanfare-sdk-core 0.24.0 → 0.25.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.
@@ -70,9 +70,11 @@ export interface OtpVerify {
70
70
  /**
71
71
  * Marketing SMS consent, recorded only on a phone verify, against the number the
72
72
  * code just proved; ignored on an email verify. Send true only when the consumer
73
- * ticked the consent box on this step.
73
+ * explicitly agreed to the marketing offer for this attempt.
74
74
  */
75
75
  marketingSmsConsent?: boolean;
76
+ /** Exact localized marketing offer accepted for this attempt, including its policy link URLs. */
77
+ marketingSmsConsentText?: string;
76
78
  /**
77
79
  * The experience the consumer is verifying on, validated against the caller's
78
80
  * organization server-side. It records where consent was given; it does not
@@ -102,6 +102,8 @@ export interface DrawModule {
102
102
  */
103
103
  export interface Draw {
104
104
  id: string;
105
+ /** Whether loyalty points weight the randomized entry order. */
106
+ loyaltyBiasEnabled?: boolean;
105
107
  openAt?: string | null;
106
108
  closeAt?: string | null;
107
109
  timeZone: string;
@@ -24,6 +24,8 @@ export interface Experience {
24
24
  description?: string;
25
25
  /** Optional image URL suitable for experience display. */
26
26
  imageUrl?: string;
27
+ /** Merchant identity shown in the optional marketing SMS offer. */
28
+ marketingSmsMerchantName?: string;
27
29
  /** Organization-level currency code (ISO 4217), when available */
28
30
  currencyCode?: string;
29
31
  /** ISO 8601 timestamp when the experience was created. */
@@ -195,6 +197,8 @@ export interface BaseDistributionDetails {
195
197
  export interface QueueDetails extends BaseDistributionDetails {
196
198
  /** Mechanism discriminator for queue details. */
197
199
  type: "queue";
200
+ /** Whether loyalty points weight this distribution's randomized entry order. */
201
+ loyaltyBiasEnabled?: boolean;
198
202
  /** Estimated wait time in seconds, when available. */
199
203
  estimatedWaitTime?: number;
200
204
  /** Current queue length, when available. */
@@ -209,6 +213,8 @@ export interface QueueDetails extends BaseDistributionDetails {
209
213
  export interface DrawDetails extends BaseDistributionDetails {
210
214
  /** Mechanism discriminator for draw details. */
211
215
  type: "draw";
216
+ /** Whether loyalty points weight this distribution's randomized entry order. */
217
+ loyaltyBiasEnabled?: boolean;
212
218
  /** ISO 8601 timestamp when the draw is expected to run. */
213
219
  drawTime?: string;
214
220
  /** ISO 8601 timestamp when entry closes. */
@@ -15,3 +15,6 @@ export type { AppointmentDisplayState, AuctionDisplayState, DistributionDisplayS
15
15
  export { getEventBus } from './state/events';
16
16
  export { generateFingerprint, generateFingerprintSync } from './utils/fingerprint.module';
17
17
  export type { BrowserFingerprint } from './utils/fingerprint.module';
18
+ export { restoreFocus } from './utils/focus-recovery';
19
+ export { MARKETING_SMS_PRIVACY_URL, MARKETING_SMS_TERMS_URL, formatMarketingSmsConsentText, } from './utils/marketing-sms-consent';
20
+ export type { MarketingSmsCopy } from './utils/marketing-sms-consent';
package/dist/internals.js CHANGED
@@ -1 +1 @@
1
- import{readExperienceDetails as e}from"./core/internal-sdk-registry.js";import{createDomBridge as r}from"./experiences/dom-bridge.js";import{describeJourneyState as o,selectJourneyDisplay as i}from"./experiences/journey-display.js";import{SnapshotInvariantError as m,getAdmissionGrant as s,getAdmissionGrantExpiresAt as t,getDistribution as p,getGates as n,getOffers as j,getParticipation as f,getSelected as c,getSequenceId as d,getSequencePhase as a,getSequenceState as l,isGateState as u,isPreEntryJourney as x,isRoutedState as y}from"./experiences/journey.machine.js";import{getEventBus as g}from"./state/events.js";import{generateFingerprint as b,generateFingerprintSync as h}from"./utils/fingerprint.module.js";export{m as SnapshotInvariantError,r as createDomBridge,o as describeJourneyState,b as generateFingerprint,h as generateFingerprintSync,s as getAdmissionGrant,t as getAdmissionGrantExpiresAt,p as getDistribution,g as getEventBus,n as getGates,j as getOffers,f as getParticipation,c as getSelected,d as getSequenceId,a as getSequencePhase,l as getSequenceState,u as isGateState,x as isPreEntryJourney,y as isRoutedState,e as readExperienceDetails,i as selectJourneyDisplay};
1
+ import{readExperienceDetails as r}from"./core/internal-sdk-registry.js";import{createDomBridge as e}from"./experiences/dom-bridge.js";import{describeJourneyState as o,selectJourneyDisplay as s}from"./experiences/journey-display.js";import{SnapshotInvariantError as i,getAdmissionGrant as m,getAdmissionGrantExpiresAt as t,getDistribution as n,getGates as p,getOffers as f,getParticipation as j,getSelected as c,getSequenceId as u,getSequencePhase as l,getSequenceState as a,isGateState as d,isPreEntryJourney as y,isRoutedState as g}from"./experiences/journey.machine.js";import{getEventBus as x}from"./state/events.js";import{generateFingerprint as k,generateFingerprintSync as v}from"./utils/fingerprint.module.js";import{restoreFocus as b}from"./utils/focus-recovery.js";import{MARKETING_SMS_PRIVACY_URL as h,MARKETING_SMS_TERMS_URL as q,formatMarketingSmsConsentText as w}from"./utils/marketing-sms-consent.js";export{h as MARKETING_SMS_PRIVACY_URL,q as MARKETING_SMS_TERMS_URL,i as SnapshotInvariantError,e as createDomBridge,o as describeJourneyState,w as formatMarketingSmsConsentText,k as generateFingerprint,v as generateFingerprintSync,m as getAdmissionGrant,t as getAdmissionGrantExpiresAt,n as getDistribution,x as getEventBus,p as getGates,f as getOffers,j as getParticipation,c as getSelected,u as getSequenceId,l as getSequencePhase,a as getSequenceState,d as isGateState,y as isPreEntryJourney,g as isRoutedState,r as readExperienceDetails,b as restoreFocus,s as selectJourneyDisplay};
@@ -0,0 +1,2 @@
1
+ /** Restore focus lost when a native control is disabled or replaced, preserving deliberate focus moves. */
2
+ export declare function restoreFocus(target?: HTMLButtonElement | HTMLInputElement | null): void;
@@ -0,0 +1 @@
1
+ function e(e){if(!e?.isConnected||e.disabled)return;const t=e.ownerDocument,o=e.getRootNode().activeElement??t.activeElement;o&&o!==e&&o!==t.body||e.focus()}export{e as restoreFocus};
@@ -0,0 +1,13 @@
1
+ /** Shared first-party offer destinations and evidence format. */
2
+ export declare const MARKETING_SMS_TERMS_URL = "https://www.fanfare.io/terms-of-service#sms";
3
+ export declare const MARKETING_SMS_PRIVACY_URL = "https://www.fanfare.io/privacy-policy#text-messages";
4
+ export type MarketingSmsCopy = readonly [
5
+ title: string,
6
+ disclosure: string,
7
+ legalLine: string,
8
+ termsLabel: string,
9
+ privacyLabel: string,
10
+ agreeLabel: string
11
+ ];
12
+ /** Formats already-resolved displayed copy; callers freeze this only on affirmative consent. */
13
+ export declare function formatMarketingSmsConsentText([title, disclosure, legalLine, termsLabel, privacyLabel, agreeLabel,]: MarketingSmsCopy): string;
@@ -0,0 +1 @@
1
+ const t="https://www.fanfare.io/terms-of-service#sms",e="https://www.fanfare.io/privacy-policy#text-messages";function s([s,n,o,r,i,a]){return[s,n,o,`${r}: ${t}`,`${i}: ${e}`,a].join("\n")}export{e as MARKETING_SMS_PRIVACY_URL,t as MARKETING_SMS_TERMS_URL,s as formatMarketingSmsConsentText};
package/dist/version.d.ts CHANGED
@@ -2,4 +2,4 @@
2
2
  * SDK version
3
3
  * This is automatically updated during the build process
4
4
  */
5
- export declare const version = "0.24.0";
5
+ export declare const version = "0.25.0";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- const o="0.24.0";export{o as version};
1
+ const o="0.25.0";export{o as version};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fanfare-io/fanfare-sdk-core",
3
- "version": "0.24.0",
3
+ "version": "0.25.0",
4
4
  "description": "Official Fanfare Browser SDK for queue, draw, auction, and appointment experiences",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org",
@@ -114,18 +114,16 @@
114
114
  "uuid": "^14.0.0",
115
115
  "wretch": "^2.11.0",
116
116
  "zustand": "^5.0.6",
117
- "@fanfare-io/fanfare-sdk-contracts": "0.24.0"
117
+ "@fanfare-io/fanfare-sdk-contracts": "0.25.0"
118
118
  },
119
119
  "peerDependencies": {
120
120
  "valibot": "^1.1.0"
121
121
  },
122
122
  "devDependencies": {
123
- "@chromatic-com/storybook": "^5.0.1",
124
123
  "@size-limit/preset-small-lib": "^11.1.8",
125
- "@storybook/addon-docs": "^10.2.16",
126
- "@storybook/addon-onboarding": "^10.2.16",
127
- "@storybook/addon-vitest": "^10.2.16",
128
- "@storybook/react-vite": "^10.2.16",
124
+ "@storybook/addon-docs": "~10.4.6",
125
+ "@storybook/addon-vitest": "~10.4.6",
126
+ "@storybook/react-vite": "~10.4.6",
129
127
  "@types/node": "^24.1.0",
130
128
  "@types/react": "^19.1.12",
131
129
  "@types/react-dom": "^19.1.9",
@@ -142,7 +140,7 @@
142
140
  "rimraf": "^6.0.1",
143
141
  "rollup-plugin-visualizer": "^5.14.0",
144
142
  "size-limit": "^11.1.8",
145
- "storybook": "^10.2.16",
143
+ "storybook": "~10.4.6",
146
144
  "terser": "^5.46.1",
147
145
  "typescript": "^5.9.2",
148
146
  "typescript-native": "npm:typescript@^7.0.2",
@@ -152,7 +150,8 @@
152
150
  "vite-plugin-dts": "^4.5.4",
153
151
  "vite-tsconfig-paths": "^5.1.4",
154
152
  "vitest": "^5.0.0",
155
- "@fanfare-io/shared-models": "0.24.0"
153
+ "@fanfare-io/shared-models": "0.25.0",
154
+ "@fanfare-io/storybook-preset": "0.25.0"
156
155
  },
157
156
  "sideEffects": false,
158
157
  "keywords": [