@plaidev/karte-action-sdk 1.1.159-28012858.21df2a3f → 1.1.159-28012903.068ffccf

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.
@@ -3992,6 +3992,8 @@ function create_fragment$r(ctx) {
3992
3992
  };
3993
3993
  }
3994
3994
 
3995
+ const GRID_ITEM_CONTEXT_KEY = 'GRID_ITEM';
3996
+
3995
3997
  function instance$r($$self, $$props, $$invalidate) {
3996
3998
  let _style;
3997
3999
  let { $$slots: slots = {}, $$scope } = $$props;
@@ -4002,6 +4004,7 @@ function instance$r($$self, $$props, $$invalidate) {
4002
4004
  let { z } = $$props;
4003
4005
  let { background = 'transparent' } = $$props;
4004
4006
  let { gridItemId } = $$props;
4007
+ setContext(GRID_ITEM_CONTEXT_KEY, { gridItemId });
4005
4008
 
4006
4009
  onMount$1(() => {
4007
4010
  setMaximumZindex(z);
@@ -7359,12 +7362,12 @@ function add_css$a(target) {
7359
7362
 
7360
7363
  function get_each_context(ctx, list, i) {
7361
7364
  const child_ctx = ctx.slice();
7362
- child_ctx[58] = list[i];
7363
- child_ctx[60] = i;
7365
+ child_ctx[61] = list[i];
7366
+ child_ctx[63] = i;
7364
7367
  return child_ctx;
7365
7368
  }
7366
7369
 
7367
- // (357:2) {#if isVisiblePrevButton}
7370
+ // (371:2) {#if isVisiblePrevButton}
7368
7371
  function create_if_block_1(ctx) {
7369
7372
  let div1;
7370
7373
  let div0;
@@ -7432,7 +7435,7 @@ function create_if_block_1(ctx) {
7432
7435
  };
7433
7436
  }
7434
7437
 
7435
- // (366:2) {#if isVisibleNextButton}
7438
+ // (380:2) {#if isVisibleNextButton}
7436
7439
  function create_if_block$1(ctx) {
7437
7440
  let div1;
7438
7441
  let div0;
@@ -7500,7 +7503,7 @@ function create_if_block$1(ctx) {
7500
7503
  };
7501
7504
  }
7502
7505
 
7503
- // (379:4) {#each items as _, i}
7506
+ // (393:4) {#each items as _, i}
7504
7507
  function create_each_block(ctx) {
7505
7508
  let div1;
7506
7509
  let div0;
@@ -7510,7 +7513,7 @@ function create_each_block(ctx) {
7510
7513
  let dispose;
7511
7514
 
7512
7515
  function click_handler() {
7513
- return /*click_handler*/ ctx[35](/*i*/ ctx[60]);
7516
+ return /*click_handler*/ ctx[35](/*i*/ ctx[63]);
7514
7517
  }
7515
7518
 
7516
7519
  return {
@@ -7531,7 +7534,7 @@ function create_each_block(ctx) {
7531
7534
  },
7532
7535
  h() {
7533
7536
  attr(div0, "class", "navigation-item-inner circle svelte-1wlcw5a");
7534
- attr(div0, "style", div0_style_value = /*getNavigationItemInnerStyle*/ ctx[5](/*i*/ ctx[60]));
7537
+ attr(div0, "style", div0_style_value = /*getNavigationItemInnerStyle*/ ctx[5](/*i*/ ctx[63]));
7535
7538
  attr(div1, "class", "navigation-item svelte-1wlcw5a");
7536
7539
  attr(div1, "style", /*navigationItemStyle*/ ctx[6]);
7537
7540
  },
@@ -7548,7 +7551,7 @@ function create_each_block(ctx) {
7548
7551
  p(new_ctx, dirty) {
7549
7552
  ctx = new_ctx;
7550
7553
 
7551
- if (dirty[0] & /*getNavigationItemInnerStyle*/ 32 && div0_style_value !== (div0_style_value = /*getNavigationItemInnerStyle*/ ctx[5](/*i*/ ctx[60]))) {
7554
+ if (dirty[0] & /*getNavigationItemInnerStyle*/ 32 && div0_style_value !== (div0_style_value = /*getNavigationItemInnerStyle*/ ctx[5](/*i*/ ctx[63]))) {
7552
7555
  attr(div0, "style", div0_style_value);
7553
7556
  }
7554
7557
 
@@ -7850,6 +7853,8 @@ function instance$b($$self, $$props, $$invalidate) {
7850
7853
  }
7851
7854
  });
7852
7855
 
7856
+ const { gridItemId } = getContext(GRID_ITEM_CONTEXT_KEY);
7857
+ const CHANGE_SLIDE_EVENT_NAME = `CHANGE_SLIDE_${gridItemId}`;
7853
7858
  let containerElement;
7854
7859
  let slideElement;
7855
7860
  let containerWidth;
@@ -8051,6 +8056,20 @@ function instance$b($$self, $$props, $$invalidate) {
8051
8056
  };
8052
8057
  });
8053
8058
 
8059
+ function handleChangeSlide(e) {
8060
+ const index = e.detail.index;
8061
+
8062
+ if (index >= 0) {
8063
+ set(index);
8064
+ }
8065
+ }
8066
+
8067
+ window.addEventListener(CHANGE_SLIDE_EVENT_NAME, handleChangeSlide);
8068
+
8069
+ onDestroy$1(() => {
8070
+ window.removeEventListener(CHANGE_SLIDE_EVENT_NAME, handleChangeSlide);
8071
+ });
8072
+
8054
8073
  async function prev() {
8055
8074
  cancelTransition();
8056
8075
  await fixSlidePosition();
@@ -8104,7 +8123,7 @@ function instance$b($$self, $$props, $$invalidate) {
8104
8123
  }
8105
8124
 
8106
8125
  if ($$self.$$.dirty[0] & /*transitioning*/ 536870912) {
8107
- $$invalidate(13, slideClass = ['slide', transitioning ? 'transition' : ''].join(' '));
8126
+ $$invalidate(13, slideClass = ['slide', ''].join(' '));
8108
8127
  }
8109
8128
 
8110
8129
  if ($$self.$$.dirty[0] & /*items, loop*/ 262146) {
@@ -8230,7 +8249,7 @@ class Slide extends SvelteComponent {
8230
8249
  navigationEdgePosition: 26
8231
8250
  },
8232
8251
  add_css$a,
8233
- [-1, -1]
8252
+ [-1, -1, -1]
8234
8253
  );
8235
8254
  }
8236
8255
  }
@@ -8364,7 +8383,7 @@ function instance$a($$self, $$props, $$invalidate) {
8364
8383
  unregisterItem(id);
8365
8384
  });
8366
8385
 
8367
- let { _style = 'cursor: ' } = $$props;
8386
+ let { _style = 'cursor: default;' } = $$props;
8368
8387
  let itemWidth = null;
8369
8388
  let itemTransform = 0;
8370
8389
 
package/dist/index.es.js CHANGED
@@ -3919,6 +3919,8 @@ function create_fragment$r(ctx) {
3919
3919
  };
3920
3920
  }
3921
3921
 
3922
+ const GRID_ITEM_CONTEXT_KEY = 'GRID_ITEM';
3923
+
3922
3924
  function instance$r($$self, $$props, $$invalidate) {
3923
3925
  let _style;
3924
3926
  let { $$slots: slots = {}, $$scope } = $$props;
@@ -3929,6 +3931,7 @@ function instance$r($$self, $$props, $$invalidate) {
3929
3931
  let { z } = $$props;
3930
3932
  let { background = 'transparent' } = $$props;
3931
3933
  let { gridItemId } = $$props;
3934
+ setContext(GRID_ITEM_CONTEXT_KEY, { gridItemId });
3932
3935
 
3933
3936
  onMount$1(() => {
3934
3937
  setMaximumZindex(z);
@@ -6947,12 +6950,12 @@ function add_css$a(target) {
6947
6950
 
6948
6951
  function get_each_context(ctx, list, i) {
6949
6952
  const child_ctx = ctx.slice();
6950
- child_ctx[58] = list[i];
6951
- child_ctx[60] = i;
6953
+ child_ctx[61] = list[i];
6954
+ child_ctx[63] = i;
6952
6955
  return child_ctx;
6953
6956
  }
6954
6957
 
6955
- // (357:2) {#if isVisiblePrevButton}
6958
+ // (371:2) {#if isVisiblePrevButton}
6956
6959
  function create_if_block_1(ctx) {
6957
6960
  let div1;
6958
6961
  let div0;
@@ -7003,7 +7006,7 @@ function create_if_block_1(ctx) {
7003
7006
  };
7004
7007
  }
7005
7008
 
7006
- // (366:2) {#if isVisibleNextButton}
7009
+ // (380:2) {#if isVisibleNextButton}
7007
7010
  function create_if_block$1(ctx) {
7008
7011
  let div1;
7009
7012
  let div0;
@@ -7054,7 +7057,7 @@ function create_if_block$1(ctx) {
7054
7057
  };
7055
7058
  }
7056
7059
 
7057
- // (379:4) {#each items as _, i}
7060
+ // (393:4) {#each items as _, i}
7058
7061
  function create_each_block(ctx) {
7059
7062
  let div1;
7060
7063
  let div0;
@@ -7064,7 +7067,7 @@ function create_each_block(ctx) {
7064
7067
  let dispose;
7065
7068
 
7066
7069
  function click_handler() {
7067
- return /*click_handler*/ ctx[35](/*i*/ ctx[60]);
7070
+ return /*click_handler*/ ctx[35](/*i*/ ctx[63]);
7068
7071
  }
7069
7072
 
7070
7073
  return {
@@ -7073,7 +7076,7 @@ function create_each_block(ctx) {
7073
7076
  div0 = element("div");
7074
7077
  t = space();
7075
7078
  attr(div0, "class", "navigation-item-inner circle svelte-1wlcw5a");
7076
- attr(div0, "style", div0_style_value = /*getNavigationItemInnerStyle*/ ctx[5](/*i*/ ctx[60]));
7079
+ attr(div0, "style", div0_style_value = /*getNavigationItemInnerStyle*/ ctx[5](/*i*/ ctx[63]));
7077
7080
  attr(div1, "class", "navigation-item svelte-1wlcw5a");
7078
7081
  attr(div1, "style", /*navigationItemStyle*/ ctx[6]);
7079
7082
  },
@@ -7090,7 +7093,7 @@ function create_each_block(ctx) {
7090
7093
  p(new_ctx, dirty) {
7091
7094
  ctx = new_ctx;
7092
7095
 
7093
- if (dirty[0] & /*getNavigationItemInnerStyle*/ 32 && div0_style_value !== (div0_style_value = /*getNavigationItemInnerStyle*/ ctx[5](/*i*/ ctx[60]))) {
7096
+ if (dirty[0] & /*getNavigationItemInnerStyle*/ 32 && div0_style_value !== (div0_style_value = /*getNavigationItemInnerStyle*/ ctx[5](/*i*/ ctx[63]))) {
7094
7097
  attr(div0, "style", div0_style_value);
7095
7098
  }
7096
7099
 
@@ -7363,6 +7366,8 @@ function instance$b($$self, $$props, $$invalidate) {
7363
7366
  }
7364
7367
  });
7365
7368
 
7369
+ const { gridItemId } = getContext(GRID_ITEM_CONTEXT_KEY);
7370
+ const CHANGE_SLIDE_EVENT_NAME = `CHANGE_SLIDE_${gridItemId}`;
7366
7371
  let containerElement;
7367
7372
  let slideElement;
7368
7373
  let containerWidth;
@@ -7564,6 +7569,20 @@ function instance$b($$self, $$props, $$invalidate) {
7564
7569
  };
7565
7570
  });
7566
7571
 
7572
+ function handleChangeSlide(e) {
7573
+ const index = e.detail.index;
7574
+
7575
+ if (index >= 0) {
7576
+ set(index);
7577
+ }
7578
+ }
7579
+
7580
+ window.addEventListener(CHANGE_SLIDE_EVENT_NAME, handleChangeSlide);
7581
+
7582
+ onDestroy$1(() => {
7583
+ window.removeEventListener(CHANGE_SLIDE_EVENT_NAME, handleChangeSlide);
7584
+ });
7585
+
7567
7586
  async function prev() {
7568
7587
  cancelTransition();
7569
7588
  await fixSlidePosition();
@@ -7743,7 +7762,7 @@ class Slide extends SvelteComponent {
7743
7762
  navigationEdgePosition: 26
7744
7763
  },
7745
7764
  add_css$a,
7746
- [-1, -1]
7765
+ [-1, -1, -1]
7747
7766
  );
7748
7767
  }
7749
7768
  }
@@ -7864,7 +7883,7 @@ function instance$a($$self, $$props, $$invalidate) {
7864
7883
  unregisterItem(id);
7865
7884
  });
7866
7885
 
7867
- let { _style = 'cursor: ' } = $$props;
7886
+ let { _style = 'cursor: default;' } = $$props;
7868
7887
  let itemWidth = null;
7869
7888
  let itemTransform = 0;
7870
7889
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plaidev/karte-action-sdk",
3
- "version": "1.1.159-28012858.21df2a3f",
3
+ "version": "1.1.159-28012903.068ffccf",
4
4
  "author": "Plaid Inc.",
5
5
  "license": "Apache-2.0",
6
6
  "module": "./dist/index.es.js",