@cntrl-site/sdk-nextjs 1.9.15 → 1.9.17-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.
@@ -309,11 +309,12 @@ class InteractionsRegistry {
309
309
  const timestamp = Date.now();
310
310
  for (const interaction of this.interactions) {
311
311
  const currentStateId = this.getCurrentStateByInteractionId(interaction.id);
312
+ const hasInteractionScrollBasedTrigger = interaction.triggers.find((tr) => tr.type === 'item-scroll-position' || tr.type === 'scroll-position') !== undefined;
312
313
  const matchingTrigger = interaction.triggers.find((trigger) => 'triggerEvent' in trigger
313
314
  && trigger.itemId === itemId
314
315
  && trigger.from === currentStateId
315
316
  && trigger.triggerEvent === triggerType);
316
- if (!matchingTrigger)
317
+ if (!matchingTrigger || hasInteractionScrollBasedTrigger)
317
318
  continue;
318
319
  const activeStateId = this.getActiveInteractionState(interaction.id);
319
320
  const isNewStateActive = matchingTrigger.to === activeStateId;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cntrl-site/sdk-nextjs",
3
- "version": "1.9.15",
3
+ "version": "1.9.17-0",
4
4
  "description": "SDK for Next.js",
5
5
  "author": "arsen@momdesign.nyc",
6
6
  "license": "MIT",
@@ -32,7 +32,7 @@
32
32
  "@cntrl-site/color": "^1.0.0",
33
33
  "@cntrl-site/components": "^0.0.3",
34
34
  "@cntrl-site/effects": "^1.4.0",
35
- "@cntrl-site/sdk": "^1.25.1-2",
35
+ "@cntrl-site/sdk": "^1.25.1",
36
36
  "@types/vimeo__player": "^2.18.0",
37
37
  "@vimeo/player": "^2.25.0",
38
38
  "html-react-parser": "^3.0.1",
@@ -314,13 +314,14 @@ export class InteractionsRegistry implements InteractionsRegistryPort {
314
314
  const timestamp = Date.now();
315
315
  for (const interaction of this.interactions) {
316
316
  const currentStateId = this.getCurrentStateByInteractionId(interaction.id);
317
+ const hasInteractionScrollBasedTrigger = interaction.triggers.find((tr) => tr.type === 'item-scroll-position' || tr.type === 'scroll-position') !== undefined;
317
318
  const matchingTrigger = interaction.triggers.find((trigger) =>
318
319
  'triggerEvent' in trigger
319
320
  && trigger.itemId === itemId
320
321
  && trigger.from === currentStateId
321
322
  && trigger.triggerEvent === triggerType
322
323
  );
323
- if (!matchingTrigger) continue;
324
+ if (!matchingTrigger || hasInteractionScrollBasedTrigger) continue;
324
325
  const activeStateId = this.getActiveInteractionState(interaction.id);
325
326
  const isNewStateActive = matchingTrigger.to === activeStateId;
326
327
  this.setCurrentStateForInteraction(interaction.id, matchingTrigger.to);