@plaidev/karte-action-sdk 1.1.268-29089896.0dceea5e → 1.1.268-29092453.64ab24dc
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/dist/hydrate/index.es.d.ts +4 -4
- package/dist/hydrate/index.es.js +100 -81
- package/dist/index.es.d.ts +4 -4
- package/dist/index.es.js +100 -81
- package/dist/svelte5/hydrate/index.es.d.ts +4 -4
- package/dist/svelte5/hydrate/index.es.js +38 -30
- package/dist/svelte5/index.es.d.ts +4 -4
- package/dist/svelte5/index.es.js +38 -30
- package/dist/svelte5/index.front2.es.js +38 -30
- package/package.json +2 -2
package/dist/svelte5/index.es.js
CHANGED
@@ -5430,11 +5430,11 @@ const LAYOUT_ALIGN = ['flex-start', 'center', 'flex-end', 'stretch'];
|
|
5430
5430
|
const LAYOUT_JUSTIFY = ['flex-start', 'center', 'flex-end', 'space-between'];
|
5431
5431
|
|
5432
5432
|
var root_1$2 = $.template(`<button><i></i></button>`);
|
5433
|
-
var root$d = $.template(`<div class="slider svelte-
|
5433
|
+
var root$d = $.template(`<div class="slider svelte-wwv1o"><div class="slider-container svelte-wwv1o"><ul class="slider-list svelte-wwv1o"><!></ul></div> <div></div></div>`);
|
5434
5434
|
|
5435
5435
|
const $$css$e = {
|
5436
|
-
hash: 'svelte-
|
5437
|
-
code: '.slider.svelte-
|
5436
|
+
hash: 'svelte-wwv1o',
|
5437
|
+
code: '.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;}'
|
5438
5438
|
};
|
5439
5439
|
|
5440
5440
|
function Slider($$anchor, $$props) {
|
@@ -5453,6 +5453,7 @@ function Slider($$anchor, $$props) {
|
|
5453
5453
|
|
5454
5454
|
useInjectCustomizeCss(props());
|
5455
5455
|
|
5456
|
+
let containerElement = $.mutable_state();
|
5456
5457
|
let slotElement = $.mutable_state();
|
5457
5458
|
let currentIndex = $.mutable_state(0);
|
5458
5459
|
let isDragging = false;
|
@@ -5460,8 +5461,8 @@ function Slider($$anchor, $$props) {
|
|
5460
5461
|
let movedX = $.mutable_state(null);
|
5461
5462
|
let childCount = $.mutable_state(0);
|
5462
5463
|
let transformX = $.mutable_state();
|
5463
|
-
|
5464
|
-
|
5464
|
+
let lastFrame = 0;
|
5465
|
+
const THROTTLE = 16;
|
5465
5466
|
|
5466
5467
|
const computeTransformX = (
|
5467
5468
|
index,
|
@@ -5485,7 +5486,7 @@ function Slider($$anchor, $$props) {
|
|
5485
5486
|
|
5486
5487
|
const moved = movedX ? ` + ${-movedX}px` : '';
|
5487
5488
|
|
5488
|
-
return `
|
5489
|
+
return `translate3d(calc(-${result}% - ${gap * index}px${moved}), 0, 0)`;
|
5489
5490
|
};
|
5490
5491
|
|
5491
5492
|
const handleClickIndicator = (index) => {
|
@@ -5501,8 +5502,6 @@ function Slider($$anchor, $$props) {
|
|
5501
5502
|
};
|
5502
5503
|
|
5503
5504
|
const toNext = () => {
|
5504
|
-
console.log('toNext');
|
5505
|
-
|
5506
5505
|
if ($.get(currentIndex) < $.get(childCount) - 1) {
|
5507
5506
|
$.set(currentIndex, $.get(currentIndex) + 1);
|
5508
5507
|
} else if (props().loop) {
|
@@ -5519,20 +5518,33 @@ function Slider($$anchor, $$props) {
|
|
5519
5518
|
};
|
5520
5519
|
|
5521
5520
|
const handleClick = (e) => {
|
5522
|
-
|
5521
|
+
const isParentContainer = (el) => {
|
5522
|
+
if (!el) return false;
|
5523
|
+
return el === $.get(containerElement) || isParentContainer(el.parentElement);
|
5524
|
+
};
|
5525
|
+
|
5526
|
+
if (isParentContainer(e.target) && isDragging) {
|
5523
5527
|
e.preventDefault();
|
5524
5528
|
e.stopPropagation();
|
5525
5529
|
}
|
5526
5530
|
};
|
5527
5531
|
|
5528
|
-
const
|
5529
|
-
$.set(movedX,
|
5532
|
+
const move = (moved) => {
|
5533
|
+
$.set(movedX, moved);
|
5530
5534
|
|
5531
|
-
if (
|
5535
|
+
if ((moved > 10 || moved < -10) && !isDragging) {
|
5532
5536
|
isDragging = true;
|
5533
5537
|
}
|
5534
5538
|
};
|
5535
5539
|
|
5540
|
+
const handleTouchmove = (e) => {
|
5541
|
+
const now = performance.now();
|
5542
|
+
|
5543
|
+
if (now - lastFrame < THROTTLE) return;
|
5544
|
+
move(startX - e.touches[0].clientX);
|
5545
|
+
lastFrame = now;
|
5546
|
+
};
|
5547
|
+
|
5536
5548
|
const handleTouchend = () => {
|
5537
5549
|
if ($.get(movedX) >= 32) {
|
5538
5550
|
toNext();
|
@@ -5550,16 +5562,12 @@ function Slider($$anchor, $$props) {
|
|
5550
5562
|
startX = e.touches[0].clientX;
|
5551
5563
|
isDragging = false;
|
5552
5564
|
document.addEventListener('touchmove', handleTouchmove, { passive: true });
|
5553
|
-
document.addEventListener('touchend', handleTouchend, { passive:
|
5554
|
-
document.addEventListener('click', handleClick
|
5565
|
+
document.addEventListener('touchend', handleTouchend, { passive: false });
|
5566
|
+
document.addEventListener('click', handleClick);
|
5555
5567
|
};
|
5556
5568
|
|
5557
5569
|
const handleMousemove = (e) => {
|
5558
|
-
|
5559
|
-
|
5560
|
-
if ($.get(movedX) > 10 || $.get(movedX) < -10) {
|
5561
|
-
isDragging = true;
|
5562
|
-
}
|
5570
|
+
move(startX - e.clientX);
|
5563
5571
|
};
|
5564
5572
|
|
5565
5573
|
const handleMouseup = (e) => {
|
@@ -5572,7 +5580,6 @@ function Slider($$anchor, $$props) {
|
|
5572
5580
|
$.set(movedX, null);
|
5573
5581
|
|
5574
5582
|
if (isDragging) {
|
5575
|
-
// e.preventDefault()
|
5576
5583
|
e.stopPropagation();
|
5577
5584
|
}
|
5578
5585
|
|
@@ -5604,7 +5611,6 @@ function Slider($$anchor, $$props) {
|
|
5604
5611
|
}
|
5605
5612
|
|
5606
5613
|
return () => {
|
5607
|
-
// clearInterval(childCountTimer)
|
5608
5614
|
if (autoSlideTimer) clearInterval(autoSlideTimer);
|
5609
5615
|
};
|
5610
5616
|
});
|
@@ -5695,7 +5701,8 @@ function Slider($$anchor, $$props) {
|
|
5695
5701
|
borderRadius: '100%',
|
5696
5702
|
display: 'block',
|
5697
5703
|
background: '#AAAAAA',
|
5698
|
-
border: 0
|
5704
|
+
border: 0,
|
5705
|
+
cursor: 'pointer'
|
5699
5706
|
});
|
5700
5707
|
});
|
5701
5708
|
|
@@ -5711,6 +5718,7 @@ function Slider($$anchor, $$props) {
|
|
5711
5718
|
$.reset(ul);
|
5712
5719
|
$.bind_this(ul, ($$value) => $.set(slotElement, $$value), () => $.get(slotElement));
|
5713
5720
|
$.reset(div_1);
|
5721
|
+
$.bind_this(div_1, ($$value) => $.set(containerElement, $$value), () => $.get(containerElement));
|
5714
5722
|
|
5715
5723
|
var div_2 = $.sibling(div_1, 2);
|
5716
5724
|
|
@@ -7369,10 +7377,10 @@ function CountDown($$anchor, $$props) {
|
|
7369
7377
|
const diffSec = Math.floor(ms / 1000) % 60;
|
7370
7378
|
|
7371
7379
|
return {
|
7372
|
-
day: diffDay
|
7373
|
-
hour: diffHour
|
7374
|
-
min: diffMin
|
7375
|
-
sec: diffSec
|
7380
|
+
day: diffDay,
|
7381
|
+
hour: diffHour,
|
7382
|
+
min: diffMin,
|
7383
|
+
sec: diffSec
|
7376
7384
|
};
|
7377
7385
|
}
|
7378
7386
|
|
@@ -7550,16 +7558,16 @@ function CountDownValue($$anchor, $$props) {
|
|
7550
7558
|
const { day, hour, min, sec } = $countdownStore();
|
7551
7559
|
|
7552
7560
|
switch (props().type) {
|
7553
|
-
case
|
7561
|
+
case 'day':
|
7554
7562
|
return day?.toString().padStart(2, '0') ?? '';
|
7555
7563
|
|
7556
|
-
case
|
7564
|
+
case 'hour':
|
7557
7565
|
return hour?.toString().padStart(2, '0') ?? '';
|
7558
7566
|
|
7559
|
-
case
|
7567
|
+
case 'minute':
|
7560
7568
|
return min?.toString().padStart(2, '0') ?? '';
|
7561
7569
|
|
7562
|
-
case
|
7570
|
+
case 'second':
|
7563
7571
|
return sec?.toString().padStart(2, '0') ?? '';
|
7564
7572
|
|
7565
7573
|
default:
|
@@ -5430,11 +5430,11 @@ const LAYOUT_ALIGN = ['flex-start', 'center', 'flex-end', 'stretch'];
|
|
5430
5430
|
const LAYOUT_JUSTIFY = ['flex-start', 'center', 'flex-end', 'space-between'];
|
5431
5431
|
|
5432
5432
|
var root_1$2 = $.template(`<button><i></i></button>`);
|
5433
|
-
var root$d = $.template(`<div class="slider svelte-
|
5433
|
+
var root$d = $.template(`<div class="slider svelte-wwv1o"><div class="slider-container svelte-wwv1o"><ul class="slider-list svelte-wwv1o"><!></ul></div> <div></div></div>`);
|
5434
5434
|
|
5435
5435
|
const $$css$e = {
|
5436
|
-
hash: 'svelte-
|
5437
|
-
code: '.slider.svelte-
|
5436
|
+
hash: 'svelte-wwv1o',
|
5437
|
+
code: '.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;}'
|
5438
5438
|
};
|
5439
5439
|
|
5440
5440
|
function Slider($$anchor, $$props) {
|
@@ -5453,6 +5453,7 @@ function Slider($$anchor, $$props) {
|
|
5453
5453
|
|
5454
5454
|
useInjectCustomizeCss(props());
|
5455
5455
|
|
5456
|
+
let containerElement = $.mutable_state();
|
5456
5457
|
let slotElement = $.mutable_state();
|
5457
5458
|
let currentIndex = $.mutable_state(0);
|
5458
5459
|
let isDragging = false;
|
@@ -5460,8 +5461,8 @@ function Slider($$anchor, $$props) {
|
|
5460
5461
|
let movedX = $.mutable_state(null);
|
5461
5462
|
let childCount = $.mutable_state(0);
|
5462
5463
|
let transformX = $.mutable_state();
|
5463
|
-
|
5464
|
-
|
5464
|
+
let lastFrame = 0;
|
5465
|
+
const THROTTLE = 16;
|
5465
5466
|
|
5466
5467
|
const computeTransformX = (
|
5467
5468
|
index,
|
@@ -5485,7 +5486,7 @@ function Slider($$anchor, $$props) {
|
|
5485
5486
|
|
5486
5487
|
const moved = movedX ? ` + ${-movedX}px` : '';
|
5487
5488
|
|
5488
|
-
return `
|
5489
|
+
return `translate3d(calc(-${result}% - ${gap * index}px${moved}), 0, 0)`;
|
5489
5490
|
};
|
5490
5491
|
|
5491
5492
|
const handleClickIndicator = (index) => {
|
@@ -5501,8 +5502,6 @@ function Slider($$anchor, $$props) {
|
|
5501
5502
|
};
|
5502
5503
|
|
5503
5504
|
const toNext = () => {
|
5504
|
-
console.log('toNext');
|
5505
|
-
|
5506
5505
|
if ($.get(currentIndex) < $.get(childCount) - 1) {
|
5507
5506
|
$.set(currentIndex, $.get(currentIndex) + 1);
|
5508
5507
|
} else if (props().loop) {
|
@@ -5519,20 +5518,33 @@ function Slider($$anchor, $$props) {
|
|
5519
5518
|
};
|
5520
5519
|
|
5521
5520
|
const handleClick = (e) => {
|
5522
|
-
|
5521
|
+
const isParentContainer = (el) => {
|
5522
|
+
if (!el) return false;
|
5523
|
+
return el === $.get(containerElement) || isParentContainer(el.parentElement);
|
5524
|
+
};
|
5525
|
+
|
5526
|
+
if (isParentContainer(e.target) && isDragging) {
|
5523
5527
|
e.preventDefault();
|
5524
5528
|
e.stopPropagation();
|
5525
5529
|
}
|
5526
5530
|
};
|
5527
5531
|
|
5528
|
-
const
|
5529
|
-
$.set(movedX,
|
5532
|
+
const move = (moved) => {
|
5533
|
+
$.set(movedX, moved);
|
5530
5534
|
|
5531
|
-
if (
|
5535
|
+
if ((moved > 10 || moved < -10) && !isDragging) {
|
5532
5536
|
isDragging = true;
|
5533
5537
|
}
|
5534
5538
|
};
|
5535
5539
|
|
5540
|
+
const handleTouchmove = (e) => {
|
5541
|
+
const now = performance.now();
|
5542
|
+
|
5543
|
+
if (now - lastFrame < THROTTLE) return;
|
5544
|
+
move(startX - e.touches[0].clientX);
|
5545
|
+
lastFrame = now;
|
5546
|
+
};
|
5547
|
+
|
5536
5548
|
const handleTouchend = () => {
|
5537
5549
|
if ($.get(movedX) >= 32) {
|
5538
5550
|
toNext();
|
@@ -5550,16 +5562,12 @@ function Slider($$anchor, $$props) {
|
|
5550
5562
|
startX = e.touches[0].clientX;
|
5551
5563
|
isDragging = false;
|
5552
5564
|
document.addEventListener('touchmove', handleTouchmove, { passive: true });
|
5553
|
-
document.addEventListener('touchend', handleTouchend, { passive:
|
5554
|
-
document.addEventListener('click', handleClick
|
5565
|
+
document.addEventListener('touchend', handleTouchend, { passive: false });
|
5566
|
+
document.addEventListener('click', handleClick);
|
5555
5567
|
};
|
5556
5568
|
|
5557
5569
|
const handleMousemove = (e) => {
|
5558
|
-
|
5559
|
-
|
5560
|
-
if ($.get(movedX) > 10 || $.get(movedX) < -10) {
|
5561
|
-
isDragging = true;
|
5562
|
-
}
|
5570
|
+
move(startX - e.clientX);
|
5563
5571
|
};
|
5564
5572
|
|
5565
5573
|
const handleMouseup = (e) => {
|
@@ -5572,7 +5580,6 @@ function Slider($$anchor, $$props) {
|
|
5572
5580
|
$.set(movedX, null);
|
5573
5581
|
|
5574
5582
|
if (isDragging) {
|
5575
|
-
// e.preventDefault()
|
5576
5583
|
e.stopPropagation();
|
5577
5584
|
}
|
5578
5585
|
|
@@ -5604,7 +5611,6 @@ function Slider($$anchor, $$props) {
|
|
5604
5611
|
}
|
5605
5612
|
|
5606
5613
|
return () => {
|
5607
|
-
// clearInterval(childCountTimer)
|
5608
5614
|
if (autoSlideTimer) clearInterval(autoSlideTimer);
|
5609
5615
|
};
|
5610
5616
|
});
|
@@ -5695,7 +5701,8 @@ function Slider($$anchor, $$props) {
|
|
5695
5701
|
borderRadius: '100%',
|
5696
5702
|
display: 'block',
|
5697
5703
|
background: '#AAAAAA',
|
5698
|
-
border: 0
|
5704
|
+
border: 0,
|
5705
|
+
cursor: 'pointer'
|
5699
5706
|
});
|
5700
5707
|
});
|
5701
5708
|
|
@@ -5711,6 +5718,7 @@ function Slider($$anchor, $$props) {
|
|
5711
5718
|
$.reset(ul);
|
5712
5719
|
$.bind_this(ul, ($$value) => $.set(slotElement, $$value), () => $.get(slotElement));
|
5713
5720
|
$.reset(div_1);
|
5721
|
+
$.bind_this(div_1, ($$value) => $.set(containerElement, $$value), () => $.get(containerElement));
|
5714
5722
|
|
5715
5723
|
var div_2 = $.sibling(div_1, 2);
|
5716
5724
|
|
@@ -7369,10 +7377,10 @@ function CountDown($$anchor, $$props) {
|
|
7369
7377
|
const diffSec = Math.floor(ms / 1000) % 60;
|
7370
7378
|
|
7371
7379
|
return {
|
7372
|
-
day: diffDay
|
7373
|
-
hour: diffHour
|
7374
|
-
min: diffMin
|
7375
|
-
sec: diffSec
|
7380
|
+
day: diffDay,
|
7381
|
+
hour: diffHour,
|
7382
|
+
min: diffMin,
|
7383
|
+
sec: diffSec
|
7376
7384
|
};
|
7377
7385
|
}
|
7378
7386
|
|
@@ -7550,16 +7558,16 @@ function CountDownValue($$anchor, $$props) {
|
|
7550
7558
|
const { day, hour, min, sec } = $countdownStore();
|
7551
7559
|
|
7552
7560
|
switch (props().type) {
|
7553
|
-
case
|
7561
|
+
case 'day':
|
7554
7562
|
return day?.toString().padStart(2, '0') ?? '';
|
7555
7563
|
|
7556
|
-
case
|
7564
|
+
case 'hour':
|
7557
7565
|
return hour?.toString().padStart(2, '0') ?? '';
|
7558
7566
|
|
7559
|
-
case
|
7567
|
+
case 'minute':
|
7560
7568
|
return min?.toString().padStart(2, '0') ?? '';
|
7561
7569
|
|
7562
|
-
case
|
7570
|
+
case 'second':
|
7563
7571
|
return sec?.toString().padStart(2, '0') ?? '';
|
7564
7572
|
|
7565
7573
|
default:
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@plaidev/karte-action-sdk",
|
3
|
-
"version": "1.1.268-
|
3
|
+
"version": "1.1.268-29092453.64ab24dc",
|
4
4
|
"author": "Plaid Inc.",
|
5
5
|
"license": "Apache-2.0",
|
6
6
|
"module": "./dist/index.es.js",
|
@@ -154,7 +154,7 @@
|
|
154
154
|
"docs:preview": "vitepress preview docs",
|
155
155
|
"docs:gen": "api-documenter markdown --input-folder ./meta --output-folder ./temp/markdown && mv ./temp/markdown/* ./docs",
|
156
156
|
"check:svelte": "svelte-check --tsconfig ./tsconfig.json",
|
157
|
-
"
|
157
|
+
"typecheck": "tsc --noEmit",
|
158
158
|
"test": "vitest run test",
|
159
159
|
"test:watch": "vitest test",
|
160
160
|
"test:ui": "vitest test --ui",
|