@plaidev/karte-action-sdk 1.1.268-29089806.0ded74d0 → 1.1.268-29090020.0f31d4b5

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.
@@ -17452,17 +17452,17 @@ const LAYOUT_JUSTIFY = ['flex-start', 'center', 'flex-end', 'space-between'];
17452
17452
  /* src/components-flex/slider/Slider.svelte generated by Svelte v3.53.1 */
17453
17453
 
17454
17454
  function add_css$f(target) {
17455
- append_styles(target, "svelte-1slel1d", ".slider-list.svelte-1slel1d{-webkit-user-drag:none;margin:0;padding:0;list-style:none}");
17455
+ append_styles(target, "svelte-wwv1o", ".slider.svelte-wwv1o{width:100%;overflow:hidden;overscroll-behavior:contain;touch-action:pan-y}.slider-container.svelte-wwv1o{width:100%;overflow:hidden;overscroll-behavior:contain;touch-action:pan-y}.slider-list.svelte-wwv1o{-webkit-user-drag:none;margin:0;padding:0;list-style:none;will-change:transform}");
17456
17456
  }
17457
17457
 
17458
17458
  function get_each_context$1(ctx, list, i) {
17459
17459
  const child_ctx = ctx.slice();
17460
- child_ctx[33] = list[i];
17461
- child_ctx[35] = i;
17460
+ child_ctx[36] = list[i];
17461
+ child_ctx[38] = i;
17462
17462
  return child_ctx;
17463
17463
  }
17464
17464
 
17465
- // (188:4) {#each indicators ?? [] as indicator, i}
17465
+ // (192:4) {#each indicators ?? [] as indicator, i}
17466
17466
  function create_each_block$1(ctx) {
17467
17467
  let button;
17468
17468
  let i_1;
@@ -17472,7 +17472,7 @@ function create_each_block$1(ctx) {
17472
17472
  let dispose;
17473
17473
 
17474
17474
  function click_handler() {
17475
- return /*click_handler*/ ctx[21](/*i*/ ctx[35]);
17475
+ return /*click_handler*/ ctx[22](/*i*/ ctx[38]);
17476
17476
  }
17477
17477
 
17478
17478
  return {
@@ -17493,9 +17493,9 @@ function create_each_block$1(ctx) {
17493
17493
  },
17494
17494
  h() {
17495
17495
  attr(i_1, "style", i_1_style_value = objToStyle({
17496
- .../*indicatorItemStyle*/ ctx[3],
17496
+ .../*indicatorItemStyle*/ ctx[4],
17497
17497
  ...{
17498
- background: /*indicator*/ ctx[33].isActive ? '#555555' : '#AAAAAA'
17498
+ background: /*indicator*/ ctx[36].isActive ? '#555555' : '#AAAAAA'
17499
17499
  }
17500
17500
  }));
17501
17501
 
@@ -17518,10 +17518,10 @@ function create_each_block$1(ctx) {
17518
17518
  p(new_ctx, dirty) {
17519
17519
  ctx = new_ctx;
17520
17520
 
17521
- if (dirty[0] & /*indicatorItemStyle, indicators*/ 136 && i_1_style_value !== (i_1_style_value = objToStyle({
17522
- .../*indicatorItemStyle*/ ctx[3],
17521
+ if (dirty[0] & /*indicatorItemStyle, indicators*/ 144 && i_1_style_value !== (i_1_style_value = objToStyle({
17522
+ .../*indicatorItemStyle*/ ctx[4],
17523
17523
  ...{
17524
- background: /*indicator*/ ctx[33].isActive ? '#555555' : '#AAAAAA'
17524
+ background: /*indicator*/ ctx[36].isActive ? '#555555' : '#AAAAAA'
17525
17525
  }
17526
17526
  }))) {
17527
17527
  attr(i_1, "style", i_1_style_value);
@@ -17536,11 +17536,12 @@ function create_each_block$1(ctx) {
17536
17536
  }
17537
17537
 
17538
17538
  function create_fragment$j(ctx) {
17539
- let div1;
17539
+ let div2;
17540
+ let div0;
17540
17541
  let ul;
17541
17542
  let ul_style_value;
17542
17543
  let t;
17543
- let div0;
17544
+ let div1;
17544
17545
  let current;
17545
17546
  let mounted;
17546
17547
  let dispose;
@@ -17555,11 +17556,12 @@ function create_fragment$j(ctx) {
17555
17556
 
17556
17557
  return {
17557
17558
  c() {
17558
- div1 = element("div");
17559
+ div2 = element("div");
17560
+ div0 = element("div");
17559
17561
  ul = element("ul");
17560
17562
  if (default_slot) default_slot.c();
17561
17563
  t = space();
17562
- div0 = element("div");
17564
+ div1 = element("div");
17563
17565
 
17564
17566
  for (let i = 0; i < each_blocks.length; i += 1) {
17565
17567
  each_blocks[i].c();
@@ -17568,59 +17570,59 @@ function create_fragment$j(ctx) {
17568
17570
  this.h();
17569
17571
  },
17570
17572
  l(nodes) {
17571
- div1 = claim_element(nodes, "DIV", {
17572
- "data-layer-id": true,
17573
- style: true,
17574
- class: true
17575
- });
17576
-
17577
- var div1_nodes = children(div1);
17578
- ul = claim_element(div1_nodes, "UL", { class: true, style: true });
17573
+ div2 = claim_element(nodes, "DIV", { "data-layer-id": true, class: true });
17574
+ var div2_nodes = children(div2);
17575
+ div0 = claim_element(div2_nodes, "DIV", { class: true });
17576
+ var div0_nodes = children(div0);
17577
+ ul = claim_element(div0_nodes, "UL", { class: true, style: true });
17579
17578
  var ul_nodes = children(ul);
17580
17579
  if (default_slot) default_slot.l(ul_nodes);
17581
17580
  ul_nodes.forEach(detach);
17582
- t = claim_space(div1_nodes);
17583
- div0 = claim_element(div1_nodes, "DIV", { style: true });
17584
- var div0_nodes = children(div0);
17581
+ div0_nodes.forEach(detach);
17582
+ t = claim_space(div2_nodes);
17583
+ div1 = claim_element(div2_nodes, "DIV", { style: true });
17584
+ var div1_nodes = children(div1);
17585
17585
 
17586
17586
  for (let i = 0; i < each_blocks.length; i += 1) {
17587
- each_blocks[i].l(div0_nodes);
17587
+ each_blocks[i].l(div1_nodes);
17588
17588
  }
17589
17589
 
17590
- div0_nodes.forEach(detach);
17591
17590
  div1_nodes.forEach(detach);
17591
+ div2_nodes.forEach(detach);
17592
17592
  this.h();
17593
17593
  },
17594
17594
  h() {
17595
- attr(ul, "class", "slider-list svelte-1slel1d");
17596
- attr(ul, "style", ul_style_value = [/*containerStyle*/ ctx[5], /*overrideStyle*/ ctx[1]].join(' '));
17597
- attr(div0, "style", /*indicatorListStyle*/ ctx[4]);
17598
- attr(div1, "data-layer-id", /*layerId*/ ctx[0]);
17599
- attr(div1, "style", /*style*/ ctx[6]);
17600
- attr(div1, "class", "slider svelte-1slel1d");
17595
+ attr(ul, "class", "slider-list svelte-wwv1o");
17596
+ attr(ul, "style", ul_style_value = [/*containerStyle*/ ctx[6], /*overrideStyle*/ ctx[1]].join(' '));
17597
+ attr(div0, "class", "slider-container svelte-wwv1o");
17598
+ attr(div1, "style", /*indicatorListStyle*/ ctx[5]);
17599
+ attr(div2, "data-layer-id", /*layerId*/ ctx[0]);
17600
+ attr(div2, "class", "slider svelte-wwv1o");
17601
17601
  },
17602
17602
  m(target, anchor) {
17603
- insert_hydration(target, div1, anchor);
17604
- append_hydration(div1, ul);
17603
+ insert_hydration(target, div2, anchor);
17604
+ append_hydration(div2, div0);
17605
+ append_hydration(div0, ul);
17605
17606
 
17606
17607
  if (default_slot) {
17607
17608
  default_slot.m(ul, null);
17608
17609
  }
17609
17610
 
17610
17611
  /*ul_binding*/ ctx[20](ul);
17611
- append_hydration(div1, t);
17612
- append_hydration(div1, div0);
17612
+ /*div0_binding*/ ctx[21](div0);
17613
+ append_hydration(div2, t);
17614
+ append_hydration(div2, div1);
17613
17615
 
17614
17616
  for (let i = 0; i < each_blocks.length; i += 1) {
17615
- each_blocks[i].m(div0, null);
17617
+ each_blocks[i].m(div1, null);
17616
17618
  }
17617
17619
 
17618
17620
  current = true;
17619
17621
 
17620
17622
  if (!mounted) {
17621
17623
  dispose = [
17622
- listen(ul, "mousedown", /*handleMousedown*/ ctx[10]),
17623
- listen(ul, "touchstart", /*handleTouchstart*/ ctx[9])
17624
+ listen(div0, "mousedown", /*handleMousedown*/ ctx[10]),
17625
+ listen(div0, "touchstart", /*handleTouchstart*/ ctx[9])
17624
17626
  ];
17625
17627
 
17626
17628
  mounted = true;
@@ -17642,11 +17644,11 @@ function create_fragment$j(ctx) {
17642
17644
  }
17643
17645
  }
17644
17646
 
17645
- if (!current || dirty[0] & /*containerStyle, overrideStyle*/ 34 && ul_style_value !== (ul_style_value = [/*containerStyle*/ ctx[5], /*overrideStyle*/ ctx[1]].join(' '))) {
17647
+ if (!current || dirty[0] & /*containerStyle, overrideStyle*/ 66 && ul_style_value !== (ul_style_value = [/*containerStyle*/ ctx[6], /*overrideStyle*/ ctx[1]].join(' '))) {
17646
17648
  attr(ul, "style", ul_style_value);
17647
17649
  }
17648
17650
 
17649
- if (dirty[0] & /*handleClickIndicator, indicatorItemStyle, indicators*/ 392) {
17651
+ if (dirty[0] & /*handleClickIndicator, indicatorItemStyle, indicators*/ 400) {
17650
17652
  each_value = /*indicators*/ ctx[7] ?? [];
17651
17653
  let i;
17652
17654
 
@@ -17658,7 +17660,7 @@ function create_fragment$j(ctx) {
17658
17660
  } else {
17659
17661
  each_blocks[i] = create_each_block$1(child_ctx);
17660
17662
  each_blocks[i].c();
17661
- each_blocks[i].m(div0, null);
17663
+ each_blocks[i].m(div1, null);
17662
17664
  }
17663
17665
  }
17664
17666
 
@@ -17669,16 +17671,12 @@ function create_fragment$j(ctx) {
17669
17671
  each_blocks.length = each_value.length;
17670
17672
  }
17671
17673
 
17672
- if (!current || dirty[0] & /*indicatorListStyle*/ 16) {
17673
- attr(div0, "style", /*indicatorListStyle*/ ctx[4]);
17674
+ if (!current || dirty[0] & /*indicatorListStyle*/ 32) {
17675
+ attr(div1, "style", /*indicatorListStyle*/ ctx[5]);
17674
17676
  }
17675
17677
 
17676
17678
  if (!current || dirty[0] & /*layerId*/ 1) {
17677
- attr(div1, "data-layer-id", /*layerId*/ ctx[0]);
17678
- }
17679
-
17680
- if (!current || dirty[0] & /*style*/ 64) {
17681
- attr(div1, "style", /*style*/ ctx[6]);
17679
+ attr(div2, "data-layer-id", /*layerId*/ ctx[0]);
17682
17680
  }
17683
17681
  },
17684
17682
  i(local) {
@@ -17691,9 +17689,10 @@ function create_fragment$j(ctx) {
17691
17689
  current = false;
17692
17690
  },
17693
17691
  d(detaching) {
17694
- if (detaching) detach(div1);
17692
+ if (detaching) detach(div2);
17695
17693
  if (default_slot) default_slot.d(detaching);
17696
17694
  /*ul_binding*/ ctx[20](null);
17695
+ /*div0_binding*/ ctx[21](null);
17697
17696
  destroy_each(each_blocks, detaching);
17698
17697
  mounted = false;
17699
17698
  run_all(dispose);
@@ -17701,10 +17700,11 @@ function create_fragment$j(ctx) {
17701
17700
  };
17702
17701
  }
17703
17702
 
17703
+ const THROTTLE = 16;
17704
+
17704
17705
  function instance$j($$self, $$props, $$invalidate) {
17705
17706
  let indicators;
17706
17707
  let itemWidthPercentage;
17707
- let style;
17708
17708
  let baseContainerStyle;
17709
17709
  let containerStyle;
17710
17710
  let indicatorListStyle;
@@ -17714,6 +17714,7 @@ function instance$j($$self, $$props, $$invalidate) {
17714
17714
  let { props } = $$props;
17715
17715
  let { overrideStyle } = $$props;
17716
17716
  useInjectCustomizeCss(props);
17717
+ let containerElement;
17717
17718
  let slotElement;
17718
17719
  let currentIndex = 0;
17719
17720
  let isDragging = false;
@@ -17721,7 +17722,7 @@ function instance$j($$self, $$props, $$invalidate) {
17721
17722
  let movedX = null;
17722
17723
  let childCount = 0;
17723
17724
  let transformX;
17724
- console.log('transformX', transformX);
17725
+ let lastFrame = 0;
17725
17726
 
17726
17727
  const computeTransformX = (index, itemCount, movedX, itemWidthPercentage, gap) => {
17727
17728
  if (index === 0) return;
@@ -17737,7 +17738,7 @@ function instance$j($$self, $$props, $$invalidate) {
17737
17738
  }
17738
17739
 
17739
17740
  const moved = movedX ? ` + ${-movedX}px` : '';
17740
- return `translateX(calc(-${result}% - ${gap * index}px${moved}))`;
17741
+ return `translate3d(calc(-${result}% - ${gap * index}px${moved}), 0, 0)`;
17741
17742
  };
17742
17743
 
17743
17744
  const handleClickIndicator = index => {
@@ -17753,8 +17754,6 @@ function instance$j($$self, $$props, $$invalidate) {
17753
17754
  };
17754
17755
 
17755
17756
  const toNext = () => {
17756
- console.log('toNext');
17757
-
17758
17757
  if (currentIndex < childCount - 1) {
17759
17758
  $$invalidate(12, currentIndex = currentIndex + 1);
17760
17759
  } else if (props.loop) {
@@ -17771,20 +17770,32 @@ function instance$j($$self, $$props, $$invalidate) {
17771
17770
  };
17772
17771
 
17773
17772
  const handleClick = e => {
17774
- if (isDragging) {
17773
+ const isParentContainer = el => {
17774
+ if (!el) return false;
17775
+ return el === containerElement || isParentContainer(el.parentElement);
17776
+ };
17777
+
17778
+ if (isParentContainer(e.target) && isDragging) {
17775
17779
  e.preventDefault();
17776
17780
  e.stopPropagation();
17777
17781
  }
17778
17782
  };
17779
17783
 
17780
- const handleTouchmove = e => {
17781
- $$invalidate(13, movedX = startX - e.touches[0].clientX);
17784
+ const move = moved => {
17785
+ $$invalidate(13, movedX = moved);
17782
17786
 
17783
- if (movedX > 10 || movedX < -10) {
17787
+ if ((moved > 10 || moved < -10) && !isDragging) {
17784
17788
  isDragging = true;
17785
17789
  }
17786
17790
  };
17787
17791
 
17792
+ const handleTouchmove = e => {
17793
+ const now = performance.now();
17794
+ if (now - lastFrame < THROTTLE) return;
17795
+ move(startX - e.touches[0].clientX);
17796
+ lastFrame = now;
17797
+ };
17798
+
17788
17799
  const handleTouchend = () => {
17789
17800
  if (movedX >= 32) {
17790
17801
  toNext();
@@ -17802,16 +17813,12 @@ function instance$j($$self, $$props, $$invalidate) {
17802
17813
  startX = e.touches[0].clientX;
17803
17814
  isDragging = false;
17804
17815
  document.addEventListener('touchmove', handleTouchmove, { passive: true });
17805
- document.addEventListener('touchend', handleTouchend, { passive: true });
17806
- document.addEventListener('click', handleClick, { capture: true });
17816
+ document.addEventListener('touchend', handleTouchend, { passive: false });
17817
+ document.addEventListener('click', handleClick);
17807
17818
  };
17808
17819
 
17809
17820
  const handleMousemove = e => {
17810
- $$invalidate(13, movedX = startX - e.clientX);
17811
-
17812
- if (movedX > 10 || movedX < -10) {
17813
- isDragging = true;
17814
- }
17821
+ move(startX - e.clientX);
17815
17822
  };
17816
17823
 
17817
17824
  const handleMouseup = e => {
@@ -17824,7 +17831,6 @@ function instance$j($$self, $$props, $$invalidate) {
17824
17831
  $$invalidate(13, movedX = null);
17825
17832
 
17826
17833
  if (isDragging) {
17827
- e.preventDefault();
17828
17834
  e.stopPropagation();
17829
17835
  }
17830
17836
 
@@ -17843,8 +17849,6 @@ function instance$j($$self, $$props, $$invalidate) {
17843
17849
 
17844
17850
  onMount$1(() => {
17845
17851
  setChildCount();
17846
-
17847
- // const childCountTimer = setInterval(setChildCount, 300);
17848
17852
  let autoSlideTimer;
17849
17853
 
17850
17854
  if (props.auto) {
@@ -17857,7 +17861,6 @@ function instance$j($$self, $$props, $$invalidate) {
17857
17861
  }
17858
17862
 
17859
17863
  return () => {
17860
- // clearInterval(childCountTimer)
17861
17864
  if (autoSlideTimer) clearInterval(autoSlideTimer);
17862
17865
  };
17863
17866
  });
@@ -17869,6 +17872,13 @@ function instance$j($$self, $$props, $$invalidate) {
17869
17872
  });
17870
17873
  }
17871
17874
 
17875
+ function div0_binding($$value) {
17876
+ binding_callbacks[$$value ? 'unshift' : 'push'](() => {
17877
+ containerElement = $$value;
17878
+ $$invalidate(3, containerElement);
17879
+ });
17880
+ }
17881
+
17872
17882
  const click_handler = i => handleClickIndicator(i);
17873
17883
 
17874
17884
  $$self.$$set = $$props => {
@@ -17912,39 +17922,38 @@ function instance$j($$self, $$props, $$invalidate) {
17912
17922
  }
17913
17923
 
17914
17924
  if ($$self.$$.dirty[0] & /*baseContainerStyle, transformX*/ 98304) {
17915
- $$invalidate(5, containerStyle = objToStyle({
17925
+ $$invalidate(6, containerStyle = objToStyle({
17916
17926
  ...baseContainerStyle,
17917
17927
  transform: transformX
17918
17928
  }));
17919
17929
  }
17920
17930
  };
17921
17931
 
17922
- $$invalidate(6, style = objToStyle({ overflow: 'hidden', width: '100%' }));
17923
-
17924
- $$invalidate(4, indicatorListStyle = objToStyle({
17932
+ $$invalidate(5, indicatorListStyle = objToStyle({
17925
17933
  display: 'flex',
17926
17934
  justifyContent: 'center',
17927
17935
  gap: '4px',
17928
17936
  marginTop: '12px'
17929
17937
  }));
17930
17938
 
17931
- $$invalidate(3, indicatorItemStyle = {
17939
+ $$invalidate(4, indicatorItemStyle = {
17932
17940
  width: '8px',
17933
17941
  height: '8px',
17934
17942
  borderRadius: '100%',
17935
17943
  display: 'block',
17936
17944
  background: '#AAAAAA',
17937
- border: 0
17945
+ border: 0,
17946
+ cursor: 'pointer'
17938
17947
  });
17939
17948
 
17940
17949
  return [
17941
17950
  layerId,
17942
17951
  overrideStyle,
17943
17952
  slotElement,
17953
+ containerElement,
17944
17954
  indicatorItemStyle,
17945
17955
  indicatorListStyle,
17946
17956
  containerStyle,
17947
- style,
17948
17957
  indicators,
17949
17958
  handleClickIndicator,
17950
17959
  handleTouchstart,
@@ -17959,6 +17968,7 @@ function instance$j($$self, $$props, $$invalidate) {
17959
17968
  $$scope,
17960
17969
  slots,
17961
17970
  ul_binding,
17971
+ div0_binding,
17962
17972
  click_handler
17963
17973
  ];
17964
17974
  }