@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/README.md CHANGED
@@ -20,7 +20,7 @@ We currently do not have a boilerplate app for the Web SDK. [Contact us](mailto:
20
20
 
21
21
  The current version of the Atomic Web SDK is `25.4.1`, and is hosted on our CDN at `https://downloads.atomic.io/web-sdk/release/25.4.1/sdk.js`.
22
22
 
23
- he Web SDK also offers a bundle variant which does not include the font used for icons in action cards. Instead this font is fetched via CDN as required, allowing the size of your initial bundle loaded by the browser to be smaller. Both variations function identically in all other respects.
23
+ The Web SDK also offers a bundle variant which does not include the font used for icons in action cards. Instead this font is fetched via CDN as required, allowing the size of your initial bundle loaded by the browser to be smaller. Both variations function identically in all other respects.
24
24
  This variant is hosted on our CDN at `https://downloads.atomic.io/web-sdk/release/25.4.1/sdk-cdn-icons.js`.
25
25
 
26
26
  To integrate it, add the script for your chosen variant as a source to your web page:
@@ -158,7 +158,7 @@ const instance = AtomicSDK.launch({...})
158
158
 
159
159
  ## Displaying a stream container
160
160
 
161
- This section applies to all types of container. Containers can be created using the `launch` method (launcher view) , the `embed` method (standalone vertical and horizontal containers), or the `singleCard` method (single card view).
161
+ This section applies to all types of container. Containers can be created using the `launch` method (launcher view) , the `embed` method (standalone vertical and horizontal containers), the `singleCard` method (single card view), or the `modalStreamContainer` method (modal container).
162
162
  Specifics and code examples for each type of container are explained in more detail in their dedicated sections below.
163
163
 
164
164
  Before displaying a stream container, you must initialize the SDK by calling the `initialise` method:
@@ -181,7 +181,7 @@ Some configuration options are common for all types of container, other options
181
181
 
182
182
  A selection of UI elements can be customized within stream containers (this customization does **not apply to single card views**, with the exception of `toastConfig`). These are configured using the `enabledUiElements` property on a stream container configuration object:
183
183
 
184
- - `cardListToast` - defaults to `true`. Set to `false` to turn off toast messages on the card list.
184
+ - `cardListToast` - defaults to `true`. Set to `false` to turn off toast messages.
185
185
  - `customToastContainer` - defaults to `false`. Set to `true` to use an [alternative toast message presentation](https://documentation.atomic.io/sdks/web#custom-toast-message-positioning) for standalone or launcher stream containers which allows you to reposition the toast message.
186
186
  - `toastConfig` - an optional configuration object to customize the toast messages displayed by the SDK.
187
187
  - `timeout`: optionally supply a number that sets how long the toast message should be displayed for in milliseconds.
@@ -235,6 +235,8 @@ AtomicSDK.launch({
235
235
 
236
236
  #### Functionality
237
237
 
238
+ ##### Runtime variables
239
+
238
240
  - `onRuntimeVariablesRequested`: an optional property that can be used on the configuration object to allow your app to resolve runtime variables. If this callback is not implemented, runtime variables will fall back to their default values, as defined in the Atomic Workbench.
239
241
  - `runtimeVariableResolutionTimeout` defaults to 5 seconds (5000 ms) if not provided.
240
242
 
@@ -318,7 +320,7 @@ AtomicSDK.launch({
318
320
 
319
321
  #### Displaying a custom header
320
322
 
321
- The Web SDK supports displaying a custom header above your card feed for stream containers created using the `launch` or `embed` methods. It has no effect for `singleCard` stream containers.
323
+ The Web SDK supports displaying a custom header above your card feed for stream containers created using the `launch` or `embed` methods. It has no effect for `singleCard` or `modalStreamContainer` containers.
322
324
 
323
325
  The custom header is supplied as an HTML string to the `customContainerHeader` property of the [customized UI elements](https://documentation.atomic.io/sdks/web#style-and-presentation). Styles should be applied inline to the HTML elements. Do not attempt to reference classes or other styling from your host application stylesheets because these will not be applied.
324
326
 
@@ -343,21 +345,23 @@ You can enforce a minimum height for the cards displayed in your stream containe
343
345
 
344
346
  ```js
345
347
  AtomicSDK.launch({
348
+ streamContainerId: "1234",
346
349
  ...
347
- features: {
348
- ...
349
- cardMinimumHeight: 250 // Replace 250 with your desired minimum height
350
- }
350
+ cardMinimumHeight: 250 // Replace 250 with your desired minimum height
351
351
  });
352
352
  ```
353
353
 
354
354
  The minimum height is specified in pixels.
355
355
 
356
+ #### Card maximum width
357
+
358
+ You can enforce a maximum width for cards displayed in the modal stream container variant. See [displaying a modal stream container](https://documentation.atomic.io/sdks/web#modal-stream-container) for more information.
359
+
356
360
  #### Single card container toast messages
357
361
 
358
- Toast messages will now be displayed for the single card stream container. The toast messages are enabled by default, as they are for the other stream container variants. The single card toast message can be configured (or disabled) in the same way as they can for the other stream container variants, see the [style and presentation](https://documentation.atomic.io/sdks/web#style-and-presentation) section of the Web SDK for details on how to do this.
362
+ The single card and modal container toast message can be configured (or disabled) in the same way as they can for the other stream container variants, see the [style and presentation](https://documentation.atomic.io/sdks/web#style-and-presentation) section of the Web SDK for details on how to do this.
359
363
 
360
- The default position of single card toast notifications is in the centre at the bottom of the viewport and with a maximum width of 500px. The SDK exposes a class (`toast-container`) on the iframe containing the toast messages which can be used to apply your own styling should you wish to do so. See the CSS code snippet below for an example of how to reposition single card toasts to the bottom right of the viewport and with a smaller width, if your embed element id was `host-embed-element`.
364
+ The default position of these toast notifications is in the centre at the bottom of the viewport and with a maximum width of 500px. The SDK exposes a class (`toast-container`) on the iframe containing the toast messages which can be used to apply your own styling should you wish to do so. See the CSS code snippet below for an example of how to reposition the toasts to the bottom right of the viewport and with a smaller width, if your embed element id was `host-embed-element`.
361
365
 
362
366
  ```css
363
367
  #host-embed-element iframe.toast-container {
@@ -370,8 +374,6 @@ The default position of single card toast notifications is in the centre at the
370
374
 
371
375
  #### Reposition launcher or standalone (vertical & horizontal) stream container toast messages
372
376
 
373
- _(introduced in 23.4.2)_
374
-
375
377
  You have the ability customize the positioning of toast messages displayed by the standalone or launcher stream container variants if you wish. To do so set the `customToastContainer` option to true [style and presentation](https://documentation.atomic.io/sdks/web#style-and-presentation)
376
378
 
377
379
  Once you have done so the toast position will default to the centre at the bottom of the viewport and with a maximum width of 500px, the same as for [single card toasts](https://documentation.atomic.io/sdks/web#single-card-toasts). In the same manner as for single card toasts you can use the `toast-container` class to reposition the iframe containing the toast messages.
@@ -424,7 +426,7 @@ When creating a stream container in the launcher mode you can supply an optional
424
426
  ...
425
427
  onLauncherToggled: isOpen => {
426
428
  if (isOpen) {
427
- console.log('the launcher is has been opened')
429
+ console.log('the launcher has been opened')
428
430
  } else {
429
431
  console.log('the launcher has been closed')
430
432
  }
@@ -533,15 +535,13 @@ When creating a stream container with the `embed` method, pass a configuration o
533
535
  AtomicSDK.embed({
534
536
  streamContainerId: "1234",
535
537
  ...
536
- features: {
537
- horizontalContainerConfig: {
538
- enabled: true,
539
- cardWidth: 400,
540
- emptyStyle: "standard",
541
- headerAlignment: "center",
542
- scrollMode: "snap",
543
- lastCardAlignment: "left"
544
- }
538
+ horizontalContainerConfig: {
539
+ enabled: true,
540
+ cardWidth: 400,
541
+ emptyStyle: "standard",
542
+ headerAlignment: "center",
543
+ scrollMode: "snap",
544
+ lastCardAlignment: "left"
545
545
  }
546
546
  })
547
547
  ```
@@ -569,9 +569,88 @@ This object allows you to configure the horizontal stream container via the foll
569
569
  - `left`: Default value. The last card is aligned to the left of the container.
570
570
  - `center`: The last card is aligned in the middle of the container.
571
571
 
572
- ## API-driven card containers
572
+ ## Displaying a modal stream container
573
+
574
+ The modal stream container variant presents cards in a fullscreen takeover. It remains hidden until cards are delivered, at which point they are displayed one at a time in a modal over the host app’s content.
575
+
576
+ The modal cannot be manually dismissed. Once all cards in the container have been actioned (e.g. submitted, dismissed, or snoozed), the container is automatically hidden again.
577
+
578
+ The following illustrates initializing a modal stream container with example configuration options:
579
+
580
+ ```html
581
+ <html>
582
+ ...
583
+ <body>
584
+ <!--Installation-->
585
+ <script src="https://downloads.atomic.io/web-sdk/release/25.4.1/sdk.js"></script>
586
+
587
+ <script>
588
+ AtomicSDK.initialise('<apiHost>', '<apiKey>', '<environmentId>')
589
+ AtomicSDK.setSessionDelegate(() => {
590
+ return Promise.resolve('<authToken>')
591
+ })
592
+
593
+ AtomicSDK.modalStreamContainer({
594
+ streamContainerId: '1234',
595
+ cardMaximumWidth: 400, // a pixel value
596
+ cardHorizontalAlignment: 'center',
597
+ modalContainerPositioning: 'center',
598
+ modalContainerVerticalPadding: 50, // a pixel value
599
+ onModalStreamToggled: isOpen => {
600
+ if (isOpen) {
601
+ console.log('the modal has been opened')
602
+ } else {
603
+ console.log('the modal has been closed')
604
+ }
605
+ }
606
+ })
607
+ </script>
608
+ </body>
609
+ </html>
610
+ ```
611
+
612
+ ### Modal stream container behavior
613
+
614
+ - Only one modal stream container can be present at a time. Attempts to initialize more than one modal stream container will be ignored.
615
+ - The fullscreen container is displayed automatically when cards are available in the assigned stream container.
616
+ - Only the first card is displayed at any given time, following the same rules as the single card container.
617
+ - The container is automatically hidden when all cards have been actioned or cleared.
618
+ - If log out is called while the container is visible, it closes immediately.
619
+ - The container becomes scrollable when the card content exceeds the viewport height.
620
+ - Clicking the background does nothing - dismissal can only occur through normal card actions.
621
+ - Card subviews are rendered in place of the card content when navigated to.
622
+
623
+ ### Theming and layout
624
+
625
+ Alignment properties of the modal stream container are controlled via the `modalContainerPositioning` & `cardHorizontalAlignment` configuration properties.
626
+
627
+ `modalContainerPositioning` controls vertical alignment and can be either `top`, `center` or `bottom`. When configured for 'top' or 'bottom' the `modalContainerVerticalPadding` configuration property (a number value in pixels)
628
+ will dictate whether any padding should be applied between the card and the top/bottom edge of the viewport. If `modalContainerVerticalPadding` is omitted, vertical spacing is determined by the stream container padding defined in the container theme.
629
+ Horizontal padding is always controlled by the container theme.
630
+
631
+ `cardHorizontalAlignment` controls the horizontal alignment and can be either `leading`, `center` or `trailing`.
632
+
633
+ The background applied behind the card within the modal stream container can be configured via the [stream container theme](https://documentation.atomic.io/guide/configuration/themes#modal-container). If no background color configuration is applied, the modal background defaults to `rgba(0, 0, 0, 0.5)`.
573
634
 
574
- _(introduced in 23.4.0)_
635
+ ### Responding to the modal opening or closing
636
+
637
+ When creating the modal stream container you can supply an optional callback that will be invoked whenever the stream container is opened or closed. To use this callback set it on the `onModalStreamToggled` property of the configuration object supplied to the `AtomicSDK.modalStreamContainer(config)` method. The function you provide is called with a single boolean argument indicating whether the modal has just been opened (true) or closed (false). The code sample below shows how to set this callback.
638
+
639
+ ```js
640
+ AtomicSDK.modalStreamContainer({
641
+ streamContainerId: '1234',
642
+ ...
643
+ onModalStreamToggled: isOpen => {
644
+ if (isOpen) {
645
+ console.log('the modal has been opened')
646
+ } else {
647
+ console.log('the modal has been closed')
648
+ }
649
+ }
650
+ })
651
+ ```
652
+
653
+ ## API-driven card containers
575
654
 
576
655
  The SDK provides the ability to create an "API-driven" card container that can be used for observing a stream container without rendering any UI. This is done using the SDK method `AtomicSDK.observableStreamContainer` which accepts a configuration object that has a subset of the properties accepted by the other stream container variants:
577
656
 
@@ -681,8 +760,6 @@ const observableContainer = AtomicSDK.observeStreamContainer({
681
760
 
682
761
  ## API-driven card actions
683
762
 
684
- _(introduced in 23.4.0)_
685
-
686
763
  The SDK provides the ability to execute card actions through pure SDK API. The currently supported actions are: dismiss, submit, and snooze. To execute these card actions, call the `AtomicSDK.onCardAction` method with the target stream container and card instance ID then call the appropriate card action method from the object that is returned:
687
764
 
688
765
  ### Dismissing a card
@@ -723,7 +800,7 @@ AtomicSDK.onCardAction('stream-container-id', 'card-id').snooze(
723
800
 
724
801
  ### Submitting a card
725
802
 
726
- Atomic cards now include button names when they are submitted. The name will be added to analytics to enable referencing the triggering button in an Action Flow. Resulting from this change as of version `24.2.0` the `submitButtonName` parameter must be supplied when performing an API-driven card submission.
803
+ Atomic cards include button names when they are submitted. The name will be added to analytics to enable referencing the triggering button in an Action Flow. To facilitate this, the `submitButtonName` parameter must be supplied when performing an API-driven card submission.
727
804
 
728
805
  Call the `submit` method with `onActionSuccess`, `onActionFailed` parameters, these are functions to be invoked on success or failure of the dismiss action. Also supply a `submitButtonName` parameter which is the button "name" attribute obtained from the card data. Optionally a fourth parameter may be supplied for the response object that you wish to submit with the card. This object can only contain values with are strings, numbers or booleans.
729
806
 
@@ -786,15 +863,13 @@ instance.setOpen(true);
786
863
 
787
864
  If you have a single card, horizontal or vertical stream container that is selectively displayed to the user (such as one that is hidden inside of a notification drawer) you need to inform the SDK when this stream container is "open" and viewable by the user. This is important so that analytics events such as `stream-displayed` & `card-displayed` are correctly dispatched. Failing to do so will result in an incorrect count of seen and unread cards, as described in the [retrieving the count of cards section](https://documentation.atomic.io/sdks/web#retrieving-the-count-of-active-and-unseen-cards) of this guide.
788
865
 
789
- Use the `controlledContainerOpenState` feature flag in the configuration object when initialising your stream container. This ensures that your container will be initialised in the "closed" state. After initialisation of the container, it is then the responsibility of the host app to call the `setOpen` method on the stream container instance when the stream container is being displayed to or hidden from the user:
866
+ Enable `controlledContainerOpenState` the configuration object when initializing your stream container. This ensures that your container will be initialized in the "closed" state. After initialization of the container, it is then the responsibility of the host app to call the `setOpen` method on the stream container instance when the stream container is being displayed to or hidden from the user:
790
867
 
791
868
  ```js
792
869
  const instance = AtomicSDK.embed({
793
870
  streamContainerId: "1234",
794
871
  ...
795
- features: {
796
- controlledContainerOpenState: true
797
- }
872
+ controlledContainerOpenState: true
798
873
  });
799
874
 
800
875
  // when the host app has displayed the container to the user call
@@ -883,19 +958,34 @@ instance.streamFilters.addCardCreatedFilter().greaterThan('2020-02-15T00:00:00.0
883
958
  instance.streamFilters.apply()
884
959
  ```
885
960
 
961
+ This example shows how you can filter on an attribute within the payload of a submit button on the top-level of a card. This example assumes the submit button is always the first item in the card button group.
962
+
963
+ ```js
964
+ const instance = AtomicSDK.launch({
965
+ ...
966
+ })
967
+
968
+ instance
969
+ .addCardContentFilter('actions.0.attributes.values.targetPage')
970
+ .isIncludedIn(window.location.pathname)
971
+ instance.streamFilters.apply()
972
+ ```
973
+
886
974
  ### Filter values
887
975
 
888
976
  The filter value is used to filter cards in a stream container. The table below summarises the different card attributes that can be filtered on, as well as the permitted data type for that filter and the filter operators that can be applied to it.
889
977
 
890
- | Card attribute | Description | Filter function | Value type | Permitted operators |
891
- | -------------------------- | ---------------------------------------------------------------------------------- | ------------------------------------------- | ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
892
- | Priority | Card priority defined in Workbench, Card -> Delivery | `streamFilters.addCardPriorityFilter()` | number between 1 & 10 inclusive | `equals`<br/>`notEqualTo`<br/>`greaterThan`<br/>`greaterThanOrEqualTo`<br/>`lessThan`<br/>`lessThanOrEqualTo`<br/>`in`<br/>`notIn`<br/>`between` |
893
- | Card template ID | The template ID of a card, see below for how to get it | `streamFilters.addCardTemplateIdFilter()` | string | `equals`<br/>`notEqualTo`<br/>`in`<br/>`notIn` |
894
- | Card template name | The template name of a card | `streamFilters.addCardTemplateNameFilter()` | string | `equals`<br/>`notEqualTo`<br/>`in`<br/>`notIn` |
895
- | Card template created date | The date time when a card template is created | `streamFilters.addCardCreatedFilter()` | ISO date string | `equals`<br/>`notEqualTo`<br/>`greaterThan`<br/>`greaterThanOrEqualTo`<br/>`lessThan`<br/>`lessThanOrEqualTo` |
896
- | Custom variable | The default value for variables defined for a card in Workbench, Card -> Variables | `streamFilters.addVariableFilter()` | multiple | `equals`<br/>`notEqualTo`<br/>`greaterThan`<br/>`greaterThanOrEqualTo`<br/>`lessThan`<br/>`lessThanOrEqualTo`<br/>`in`<br/>`notIn`<br/>`between` |
897
- | Payload variable | The value for variables as defined in API event payload | `streamFilters.addPayloadVariableFilter()` | multiple | `equals`<br/>`notEqualTo`<br/>`greaterThan`<br/>`greaterThanOrEqualTo`<br/>`lessThan`<br/>`lessThanOrEqualTo`<br/>`in`<br/>`notIn`<br/>`between` |
898
- | Payload metadata | The value for metadata as defined in API event payload | `streamFilters.addPayloadMetadataFilter()` | multiple | `equals`<br/>`notEqualTo`<br/>`greaterThan`<br/>`greaterThanOrEqualTo`<br/>`lessThan`<br/>`lessThanOrEqualTo`<br/>`in`<br/>`notIn`<br/>`between` |
978
+ | Card attribute | Description | Filter function | Value type | Permitted operators |
979
+ | -------------------------- | ---------------------------------------------------------------------------------- | ------------------------------------------- | ------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
980
+ | Priority | Card priority defined in Workbench, Card -> Delivery | `streamFilters.addCardPriorityFilter()` | number between 1 & 10 inclusive | `equals`<br/>`notEqualTo`<br/>`greaterThan`<br/>`greaterThanOrEqualTo`<br/>`lessThan`<br/>`lessThanOrEqualTo`<br/>`in`<br/>`notIn`<br/>`between` |
981
+ | Card template ID | The template ID of a card, see below for how to get it | `streamFilters.addCardTemplateIdFilter()` | string | `equals`<br/>`notEqualTo`<br/>`in`<br/>`notIn`<br/>`includes`<br/>`excludes`<br/>`isIncludedIn`<br/>`isExcludedFrom` |
982
+ | Card template name | The template name of a card | `streamFilters.addCardTemplateNameFilter()` | string | `equals`<br/>`notEqualTo`<br/>`in`<br/>`notIn`<br/>`includes`<br/>`excludes`<br/>`isIncludedIn`<br/>`isExcludedFrom` |
983
+ | Card template created date | The date time when a card template is created | `streamFilters.addCardCreatedFilter()` | ISO date string | `equals`<br/>`notEqualTo`<br/>`greaterThan`<br/>`greaterThanOrEqualTo`<br/>`lessThan`<br/>`lessThanOrEqualTo` |
984
+ | Custom variable | The default value for variables defined for a card in Workbench, Card -> Variables | `streamFilters.addVariableFilter()` | multiple | `equals`<br/>`notEqualTo`<br/>`greaterThan`<br/>`greaterThanOrEqualTo`<br/>`lessThan`<br/>`lessThanOrEqualTo`<br/>`in`<br/>`notIn`<br/>`between`<br/>`includes`<br/>`excludes`<br/>`isIncludedIn`<br/>`isExcludedFrom` |
985
+ | Payload variable | The value for variables as defined in API event payload | `streamFilters.addPayloadVariableFilter()` | multiple | `equals`<br/>`notEqualTo`<br/>`greaterThan`<br/>`greaterThanOrEqualTo`<br/>`lessThan`<br/>`lessThanOrEqualTo`<br/>`in`<br/>`notIn`<br/>`between`<br/>`includes`<br/>`excludes`<br/>`isIncludedIn`<br/>`isExcludedFrom` |
986
+ | Payload metadata | The value for metadata as defined in API event payload | `streamFilters.addPayloadMetadataFilter()` | multiple | `equals`<br/>`notEqualTo`<br/>`greaterThan`<br/>`greaterThanOrEqualTo`<br/>`lessThan`<br/>`lessThanOrEqualTo`<br/>`in`<br/>`notIn`<br/>`between`<br/>`includes`<br/>`excludes`<br/>`isIncludedIn`<br/>`isExcludedFrom` |
987
+ | Top-level card content | The value for content in the top-level of the card | `streamFilters.addCardContentFilter()` | multiple | `equals`<br/>`notEqualTo`<br/>`greaterThan`<br/>`greaterThanOrEqualTo`<br/>`lessThan`<br/>`lessThanOrEqualTo`<br/>`in`<br/>`notIn`<br/>`between`<br/>`includes`<br/>`excludes`<br/>`isIncludedIn`<br/>`isExcludedFrom` |
988
+ | Subview card content | The value for content in a card subview | `streamFilters.addSubviewContentFilter()` | multiple | `equals`<br/>`notEqualTo`<br/>`greaterThan`<br/>`greaterThanOrEqualTo`<br/>`lessThan`<br/>`lessThanOrEqualTo`<br/>`in`<br/>`notIn`<br/>`between`<br/>`includes`<br/>`excludes`<br/>`isIncludedIn`<br/>`isExcludedFrom` |
899
989
 
900
990
  **Note:** It's important to specify the right value type when referencing custom variables for filter value. There are five types of variables in the Workbench, currently four are supported: String, Number, Date and Boolean.<br />
901
991
 
@@ -939,9 +1029,6 @@ instance.streamFilters.clearFilters()
939
1029
 
940
1030
  ## Image linking
941
1031
 
942
- _(introduced in 24.1.0)_
943
- _This is a beta feature in the Atomic Workbench_
944
-
945
1032
  Image elements can be used to trigger a navigation action. In the Atomic Workbench you can configure the behavior of the link to trigger a subview navigation, open a URL or to send a payload to your app. For information on how to handle the image link payload see [custom action payloads on image links](https://documentation.atomic.io/sdks/web#supporting-custom-action-payloads-on-image-links)
946
1033
 
947
1034
  ## Custom action payloads
@@ -1013,7 +1100,7 @@ Configuration of card voting from within the workbench provides further customiz
1013
1100
 
1014
1101
  Whether enabled in the workbench, or in the SDK configuration, the default wording of card voting options can be configured. See the [custom strings](#custom-strings) section of this guide if you want to change the default wording.
1015
1102
 
1016
- ### Configuring card voting within the SDK
1103
+ ### Configuring card voting within the SDK (deprecated)
1017
1104
 
1018
1105
  The following describes how card voting appears when configured via the SDK feature configuration:
1019
1106
 
@@ -1556,7 +1643,7 @@ There are two options you can customize for the focus ring color:
1556
1643
 
1557
1644
  If you use runtime variables on a card, you can optionally choose to send the resolved values of any runtime variables back to the Atomic Platform as an analytics event. This per-card analytics event - `runtime-vars-updated` - contains the values of runtime variables rendered in the card and seen by the end user. Therefore, you should not enable this feature if your runtime variables contain sensitive data that you do not wish to store on the Atomic Platform.
1558
1645
 
1559
- To enable this feature, set the `features.runtimeVariableAnalytics` flag on your configuration object to `true`:
1646
+ To enable this feature, set the `features.runtimeVariableAnalytics` flag on your stream container configuration object to `true`:
1560
1647
 
1561
1648
  ```javascript
1562
1649
  AtomicSDK.launch({
@@ -1722,7 +1809,7 @@ AtomicSDK.updateUser(userUpdateObject)
1722
1809
 
1723
1810
  ## File Upload
1724
1811
 
1725
- _This is currently a preview feature in the Workbench_
1812
+ _This is currently a beta feature in the Workbench_
1726
1813
 
1727
1814
  ### Card & feed overlay during file upload
1728
1815
 
@@ -1791,10 +1878,6 @@ Currently, no event is generated to indicate when a user cancels an upload. We w
1791
1878
 
1792
1879
  ## Custom icons
1793
1880
 
1794
- _(introduced in 24.2.0)_
1795
-
1796
- _This is currently a beta feature in the Atomic Workbench._
1797
-
1798
1881
  The SDK now supports the use of custom icons in card elements. When you are editing a card in the card template editor of the Workbench you will notice that for card elements that support it the [properties panel](https://documentation.atomic.io/guide/cards/creating#properties-panel-right) will show an "Include icon" option. From this location you can select an icon to use, either from the Media Library or Font Awesome.
1799
1882
 
1800
1883
  Choosing to use an icon from the Media Library you have the ability to provide an SVG format icon and an optional fallback icon to be used in case the SVG fails to load. The "Select icon" dropdown will present any SVG format assets in your media library which can be used as a custom icon. To add an icon for use you can press the "Open Media Library" button at the bottom of the dropdown.
@@ -1822,11 +1905,7 @@ If the provided SVG image fails to load due to a broken URL or network issues th
1822
1905
  1. The fallback FontAwesome icon is used if it is set in Atomic Workbench for this custom icon.
1823
1906
  2. Otherwise, a default placeholder image is displayed.
1824
1907
 
1825
- ## Image things
1826
-
1827
- _(introduced in 24.2.0)_
1828
-
1829
- _This is currently a beta feature in the Atomic Workbench._
1908
+ ## Multiple display heights
1830
1909
 
1831
1910
  In the Atomic Workbench you can now specify the display height for banner and inline media components. The height of inline image and video elements, along with banner image and video elements, may be specified as one of four different display heights. These are;
1832
1911
 
@@ -1837,6 +1916,76 @@ In the Atomic Workbench you can now specify the display height for banner and in
1837
1916
 
1838
1917
  When using these new layouts be mindful that customers using older versions of the SDK will default to the "Tall" layout.
1839
1918
 
1919
+ ## File Upload
1920
+
1921
+ _This is currently a beta feature in the Workbench_
1922
+
1923
+ _Uploaded images are processed and scanned during upload. AVIF, HEIC and HEIF file formats are automatically converted to JPG during this process._
1924
+
1925
+ ### Card & feed overlay during file upload
1926
+
1927
+ The file upload process will commence when a user attempts to submit a card that has files attached. While the file upload is in progress the card (or card subview when submitting from a subview) will be replaced with an overlay to prevent user interaction while this takes place. This overlay displays a loading indicator, a message indicating what is taking place, and a button that may be used to cancel the file upload.
1928
+
1929
+ If the card is within a launcher, vertical or horizontal stream container variant, any other cards within the feed will be covered by a scrim while the upload is in progress, to prevent user interaction with other cards in the feed and visually indicate that the upload has not finished.
1930
+
1931
+ #### Single card & Horizontal stream container overlay
1932
+
1933
+ The modal iframe, used to present subviews in the single card & horizontal stream containers, has an 'uploading-files' class added to the iframe element while there is a file upload in progress. This can be used to trigger any UI you may wish to display in your application while the file upload is in progress.
1934
+
1935
+ The following code snippet is an example of how you could detect this:
1936
+
1937
+ ```js
1938
+ // An observer to observe changes in the modal subview iframe class list
1939
+ const observer = new MutationObserver(mutations => {
1940
+ mutations.forEach(mutation => {
1941
+ if (mutation.target.classList.contains('uploading-files')) {
1942
+ // Uploading has commenced, modify UI as required
1943
+ } else {
1944
+ // Uploading has finished, modify UI as required
1945
+ }
1946
+ })
1947
+ })
1948
+
1949
+ // Observe changes in the relevant modal subview, in this case one that
1950
+ // has been embedded inside of a host element with the ID "embed-container".
1951
+ observer.observe(document.querySelector('#embed-container>.modal-subview'), {
1952
+ attributeFilter: ['class']
1953
+ })
1954
+ ```
1955
+
1956
+ ### Custom strings
1957
+
1958
+ The card overlay message & cancel button label text can be customized using the [custom strings](https://documentation.atomic.io/sdks/web#custom-strings) feature of the SDK. If you wish to change the text used you would supply a value for the `processingStateMessage` and/or the `processingStateCancelButtonTitle` for the stream container(s) that you wanted to customize this for.
1959
+
1960
+ ### Toast message
1961
+
1962
+ If a file upload fails to successfully complete the user will be displayed a toast message indicating this and providing the option to retry. By default the text of this message will be "Couldn't upload file(s)", if you wish to customize this you may do so via the [toast config](https://documentation.atomic.io/sdks/web#style-and-presentation) configuration object for the stream container, setting a value for the `fileUploadFailed` toast message.
1963
+
1964
+ ### SDK events
1965
+
1966
+ There are new events that are emitted during the file upload process. When a user attempts to submit a card that has files attached, the file upload process will commence and these events can be used to track its progression:
1967
+
1968
+ - `user-file-uploads-started`, emitted once the file upload process has started.
1969
+ - `user-file-uploads-completed`, emitted once the file upload process has completed, with all files having been successfully uploaded.
1970
+ - `user-file-uploads-failed`, emitted once the file upload process has completed or been cancelled, with one or more files having failed to upload.
1971
+
1972
+ These events can be observed using the [SDK event observer](https://documentation.atomic.io/sdks/web#sdk-event-observer). The details for the relevant files are found in the `properties` of the event object, keyed by the form field they were submitted, for example:
1973
+
1974
+ ```js
1975
+ {
1976
+ eventName: "user-file-uploads-completed",
1977
+ ...
1978
+ properties: {
1979
+ upload_fieldname: {
1980
+ filename: "filename_in_S3_bucket.png",
1981
+ targetBucketId: "S3_bucket_id"
1982
+ }
1983
+ }
1984
+ }
1985
+ ```
1986
+
1987
+ _Currently, no event is generated to indicate when a user cancels an upload. We will add a corresponding SDK event in upcoming versions._
1988
+
1840
1989
  ## Cordova/Capacitor
1841
1990
 
1842
1991
  The Atomic Web SDK also supports use within Cordova and Capacitor apps.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atomic.io/action-cards-web-sdk-cdn-icons",
3
- "version": "25.2.2",
3
+ "version": "25.3.1",
4
4
  "description": "The Atomic Web SDK",
5
5
  "main": "public/sdk.js",
6
6
  "typings": "public/sdk.d.ts",
@@ -39,7 +39,7 @@
39
39
  "@babel/preset-react": "^7.9.4",
40
40
  "@babel/preset-typescript": "^7.9.0",
41
41
  "@microsoft/api-extractor": "^7.19.5",
42
- "@playwright/test": "^1.38.0",
42
+ "@playwright/test": "^1.55.0",
43
43
  "@popa-marius/pushstate-server": "3.1.2",
44
44
  "@types/css-font-loading-module": "^0.0.13",
45
45
  "@types/jest": "^26.0.4",
@@ -55,7 +55,7 @@
55
55
  "enzyme-adapter-preact-pure": "^4.1.0",
56
56
  "focus-visible": "^5.2.0",
57
57
  "jest": "^26.0.4",
58
- "playwright": "^1.38.0",
58
+ "playwright": "^1.55.0",
59
59
  "preact": "10.4.1",
60
60
  "prettier": "3.2.5",
61
61
  "react": "^18.2.0",
@@ -64,7 +64,7 @@
64
64
  "terser-webpack-plugin": "^5.3.10",
65
65
  "to-string-loader": "^1.2.0",
66
66
  "ts-loader": "^9.5.1",
67
- "typescript": "^3.8.3",
67
+ "typescript": "^5.9.2",
68
68
  "url-loader": "^4.1.1",
69
69
  "webpack": "^5.90.0",
70
70
  "webpack-cli": "^5.1.4",
@@ -1,4 +1,4 @@
1
- The Atomic Web SDK (25.2.2) uses the following open sources libraries:
1
+ The Atomic Web SDK (25.3.1) uses the following open sources libraries:
2
2
 
3
3
  -----------------------
4
4