@atomic.io/action-cards-web-sdk-cdn-icons 25.2.2 → 25.3.1

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/public/sdk.d.ts CHANGED
@@ -1,5 +1,3 @@
1
- /// <reference types="preact" />
2
-
3
1
  import { SDKCardEvent as SDKCardEvent_2 } from 'src/lib/sdk-event';
4
2
 
5
3
  export declare class AACHeadlessStreamContainer {
@@ -21,7 +19,7 @@ export declare class AACHeadlessStreamContainer {
21
19
  */
22
20
  stop(): void;
23
21
  tokenProvider: {
24
- requestToken: () => Promise<string | undefined>;
22
+ requestToken: () => Promise<AuthToken>;
25
23
  };
26
24
  /**
27
25
  * Polls the Atomic platform for card feed updates
@@ -82,9 +80,9 @@ export declare class AACStreamContainer {
82
80
  private launchButtonIconContainer?;
83
81
  private launcher?;
84
82
  private resizeObserver?;
85
- readonly resolvedConfiguration: SDKConfiguration;
83
+ readonly resolvedConfiguration: SDKConfiguration & InternalConfiguration;
86
84
  readonly instanceId: string;
87
- streamFilters: any;
85
+ streamFilters: StreamFilter;
88
86
  private config;
89
87
  private analyticsQueue;
90
88
  constructor(config: SDKConfiguration, internalConfig: InternalConfiguration, embedMode: EmbedMode, analyticsQueue: AnalyticsQueue, hostElement?: HTMLElement);
@@ -134,12 +132,21 @@ export declare interface AnalyticsEventProperties {
134
132
  export declare type AnalyticsEventType = 'standard' | 'custom' | 'sdk-initialized';
135
133
 
136
134
  export declare class AnalyticsQueue {
137
- private eventQueue;
135
+ private authenticatedEventQueue?;
136
+ private unauthenticatedEventQueue;
138
137
  private flushTimeout;
139
138
  private flushPromise;
140
- constructor();
139
+ private authTokenProvider;
140
+ private tokenUserIdAttribute?;
141
+ constructor(authTokenProvider: AuthTokenProvider);
142
+ private getKeyForAuthenticatedQueue;
143
+ initializeAuthenticatedQueue(userId: string, tokenUserIdAttribute?: string): void;
141
144
  createEventPayload(eventData: AugmentedAnalyticsEvent | CustomAnalyticsEventData | SDKInitializedEventData, eventType: AnalyticsEventType): QueuedAnalyticsEvent | null;
142
- enqueue(eventData: AugmentedAnalyticsEvent | CustomAnalyticsEventData | SDKInitializedEventData, eventType?: AnalyticsEventType): QueuedAnalyticsEvent | null;
145
+ enqueue(eventData: AugmentedAnalyticsEvent | CustomAnalyticsEventData | SDKInitializedEventData, eventType?: AnalyticsEventType, eventQueue?: 'authenticated' | 'unauthenticated'): Promise<QueuedAnalyticsEvent | null>;
146
+ /**
147
+ * Removes events from the queue that have been processed by the platform after being sent over the WebSocket.
148
+ * @param eventIds IDs of events to remove from the queue.
149
+ */
143
150
  removeProcessedEvents(eventIds: string[]): void;
144
151
  private performFlush;
145
152
  flush(): Promise<void>;
@@ -153,6 +160,7 @@ export declare interface AnalyticsSDKContext {
153
160
  }
154
161
 
155
162
  export declare interface AnalyticsStreamContext {
163
+ displayMode?: StreamDisplayMode;
156
164
  streamLength: number;
157
165
  streamLengthVisible: number;
158
166
  cardPositionInStream: number;
@@ -219,6 +227,7 @@ declare class AtomicSDK {
219
227
  [instanceId: string]: {
220
228
  sendMessageToIframe: (message: any) => void;
221
229
  logout: () => void;
230
+ embedMode: EmbedMode;
222
231
  };
223
232
  };
224
233
  static containersBroadcastChannel: ContainerBroadcastChannel | undefined;
@@ -258,6 +267,16 @@ declare class AtomicSDK {
258
267
  */
259
268
  static embed(hostElement: HTMLElement, config: SDKConfiguration, autosize?: Boolean): AACStreamContainer;
260
269
  static singleCard(hostElement: HTMLElement, config: SDKConfiguration): AACStreamContainer;
270
+ /**
271
+ * Instantiate a modal stream container that can be used to display a card feed in a modal dialog.
272
+ * In this mode, the stream will open in a modal dialog over the top of the current page when cards are present.
273
+ * Only one instance of a modal stream container can be created at a time.
274
+ *
275
+ * @param config Configuration for this stream container.
276
+ * @return An `AACStreamContainer` instance, which allows you to perform actions on the stream container after
277
+ * creation.
278
+ */
279
+ static modalStreamContainer(config: SDKConfiguration): void | AACStreamContainer;
261
280
  /**
262
281
  * Create a stream container instance that can be used to observe the card feed, it will not render any UI.
263
282
  *
@@ -403,7 +422,7 @@ declare class AtomicSDK {
403
422
  * @param submitButtonName a string identifying the submit button pressed, this should be taken from the `name` attribute from the button node
404
423
  * @param response an optional object containing response values for the card. Keys must be strings and values must be strings, numbers or booleans
405
424
  */
406
- submit: (onActionSuccess: () => void, onActionFailed: (error: Error) => void, submitButtonName: string, response?: CardResponse | undefined) => Promise<void>;
425
+ submit: (onActionSuccess: () => void, onActionFailed: (error: Error) => void, submitButtonName: string, response?: CardResponse) => Promise<void>;
407
426
  };
408
427
  /**
409
428
  * Call this method each time the logged in user changes.
@@ -500,6 +519,7 @@ export declare interface AugmentedAnalyticsEvent extends AnalyticsEvent {
500
519
  timestamp: Date;
501
520
  containerId?: string;
502
521
  containerIds?: Array<string>;
522
+ displayMode?: StreamDisplayMode;
503
523
  streamLength?: number;
504
524
  streamLengthVisible?: number;
505
525
  streamCardPosition?: number;
@@ -510,6 +530,10 @@ export declare type AuthToken = string | undefined;
510
530
 
511
531
  export declare type AuthTokenCallback = () => Promise<AuthToken>;
512
532
 
533
+ export declare interface AuthTokenProvider {
534
+ requestToken: AuthTokenCallback;
535
+ }
536
+
513
537
  export declare type BroadcastChannelMessage = MessageEvent & {
514
538
  data: {
515
539
  type: CHANNEL_MESSAGE_TYPE;
@@ -598,7 +622,7 @@ export declare interface CardsAPIResponse {
598
622
 
599
623
  export declare type CardViewState = 'topview' | 'subview';
600
624
 
601
- declare type CardVotingActionType = CardActionType & {
625
+ export declare type CardVotingActionType = CardActionType & {
602
626
  feedback?: boolean;
603
627
  feedbackLabel?: string;
604
628
  };
@@ -699,7 +723,7 @@ export declare interface DeviceInfo {
699
723
  * and is designed to supplement the single card view.
700
724
  * 6. toast: The iframe is rendering a toast iframe, this
701
725
  */
702
- export declare type EmbedMode = 'launcher' | 'standalone' | 'preview' | 'single-card' | 'modal-subview' | 'toast' | 'headless';
726
+ export declare type EmbedMode = 'launcher' | 'standalone' | 'preview' | 'single-card' | 'modal-stream' | 'modal-subview' | 'toast' | 'headless';
703
727
 
704
728
  export declare interface EventData {
705
729
  name: string;
@@ -727,8 +751,23 @@ export declare interface FeatureFlags {
727
751
  * Use the card voting menu configuration in the atomic workbench instead https://documentation.atomic.io/guide/cards/behaviour#card-voting
728
752
  */
729
753
  cardVoting?: VotingOptions;
754
+ /**
755
+ * @deprecated
756
+ * This feature configuration is deprecated and will be removed in a future version of the SDK.
757
+ * Use the card minimum height property on the stream container configuration instead https://documentation.atomic.io/sdks/web#card-minimum-height
758
+ */
730
759
  cardMinimumHeight?: number;
760
+ /**
761
+ * @deprecated
762
+ * This feature configuration is deprecated and will be removed in a future version of the SDK.
763
+ * Use the horizontal container configuration property on the stream container configuration instead https://documentation.atomic.io/sdks/web#displaying-a-horizontal-stream-container
764
+ */
731
765
  horizontalContainerConfig?: HorizontalContainerConfig;
766
+ /**
767
+ * @deprecated
768
+ * This feature configuration is deprecated and will be removed in a future version of the SDK.
769
+ * Use the controlled container open state property on the stream container configuration instead https://documentation.atomic.io/sdks/web#manually-controlling-other-stream-container-variants
770
+ */
732
771
  controlledContainerOpenState?: boolean;
733
772
  }
734
773
 
@@ -867,6 +906,8 @@ export declare interface MinLengthValidationAttributes extends ValidationAttribu
867
906
  minimumLength: number;
868
907
  }
869
908
 
909
+ export declare const MODAL_STREAM_EMBED_ID = "atomic-sdk-modal-stream-embed";
910
+
870
911
  export declare type NativePlatform = 'iOS' | 'Android';
871
912
 
872
913
  export declare type NotifyDays = {
@@ -1016,11 +1057,19 @@ export declare interface SDKConfiguration {
1016
1057
  onSizeChanged?: (width: number, height: number) => void;
1017
1058
  onCardEvent?: (event: CardEvent) => void;
1018
1059
  onLauncherToggled?: (open?: boolean) => void;
1060
+ onModalStreamToggled?: (open?: boolean) => void;
1019
1061
  customStrings?: CustomStrings;
1020
1062
  enabledUiElements?: UIElements;
1021
1063
  features?: FeatureFlags;
1022
1064
  firstLoadStyles?: FirstLoadStyles;
1023
1065
  interfaceStyle?: InterfaceStyle;
1066
+ controlledContainerOpenState?: boolean;
1067
+ cardMinimumHeight?: number;
1068
+ cardMaximumWidth?: number;
1069
+ horizontalContainerConfig?: HorizontalContainerConfig;
1070
+ modalContainerPositioning?: 'top' | 'center' | 'bottom';
1071
+ modalContainerVerticalPadding?: number;
1072
+ cardHorizontalAlignment?: 'leading' | 'center' | 'trailing';
1024
1073
  }
1025
1074
 
1026
1075
  export declare type SDKEvent = SDKCardCompletedEvent | SDKCardDismissedEvent | SDKCardSnoozedEvent | SDKFeedEvent | SDKCardDisplayedEvent | SDKCardVotedUpEvent | SDKCardVotedDownEvent | SDKRuntimeVarsUpdatedEvent | SDKStreamDisplayedEvent | SDKRedirectedEvent | SDKSnoozeOptionsDisplayedEvent | SDKSnoozeOptionsCanceledEvent | SDKSubviewDisplayedEvent | SDKSubviewExitedEvent | SDKVideoPlayedEvent | SDKVideoCompletedEvent | SDKInitEvent | SDKRequestFailedEvent | SDKNotificationReceivedEvent | SDKUserFileUploadsStartedEvent | SDKUserFileUploadsCompletedEvent | SDKUserFileUploadsFailedEvent;
@@ -1226,6 +1275,16 @@ export declare interface StandardAnalyticsEvent {
1226
1275
  cardContext: AnalyticsCardContext;
1227
1276
  }
1228
1277
 
1278
+ declare const STREAM_DISPLAY_MODES: {
1279
+ readonly stream: "stream";
1280
+ readonly single: "single";
1281
+ readonly launcher: "launcher";
1282
+ readonly horizontal: "horizontal";
1283
+ readonly modal: "modal";
1284
+ };
1285
+
1286
+ export declare type StreamDisplayMode = (typeof STREAM_DISPLAY_MODES)[keyof typeof STREAM_DISPLAY_MODES];
1287
+
1229
1288
  export declare class StreamFilter {
1230
1289
  private filters;
1231
1290
  private onApplyFilter;
@@ -1233,11 +1292,13 @@ export declare class StreamFilter {
1233
1292
  constructor(onApplyFilter: () => void, onClearFilter: () => void);
1234
1293
  addVariableFilter: (key: string) => Operators<any>;
1235
1294
  addPayloadVariableFilter: (key: string) => Operators<any>;
1295
+ addCardContentFilter: (key: string) => Operators<any>;
1296
+ addSubviewContentFilter: (key: string) => Operators<any>;
1236
1297
  addPayloadMetadataFilter: (key: string) => Operators<any>;
1237
- variableFilter: (namespace: string, key: string, callingFunctionName: string, propertyType?: string) => Operators<any>;
1238
- addCardTemplateIdFilter: () => Pick<Operators<string>, "equals" | "in" | "notEqualTo" | "notIn">;
1239
- addCardTemplateNameFilter: () => Pick<Operators<string>, "equals" | "in" | "notEqualTo" | "notIn">;
1240
- addCardCreatedFilter: () => Pick<Operators<string | Date>, "greaterThan" | "greaterThanOrEqualTo" | "lessThan" | "lessThanOrEqualTo" | "equals" | "notEqualTo">;
1298
+ genericFilter: (namespace: string, key: string, callingFunctionName: string, propertyType?: string) => Operators<any>;
1299
+ addCardTemplateIdFilter: () => Omit<Operators<string>, "greaterThan" | "greaterThanOrEqualTo" | "lessThan" | "lessThanOrEqualTo" | "between">;
1300
+ addCardTemplateNameFilter: () => Omit<Operators<string>, "greaterThan" | "greaterThanOrEqualTo" | "lessThan" | "lessThanOrEqualTo" | "between">;
1301
+ addCardCreatedFilter: () => Omit<Operators<string | Date>, "in" | "notIn" | "between">;
1241
1302
  addCardPriorityFilter: () => Operators<PriorityFilterValue>;
1242
1303
  clearFilters: () => void;
1243
1304
  apply: () => void;