@functionalcms/svelte-components 4.4.7 → 4.6.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/dist/components/integrations/EasyTools.svelte +30 -0
- package/dist/components/integrations/EasyTools.svelte.d.ts +7 -0
- package/dist/components/presentation/Carousel.svelte +2 -3
- package/dist/components/presentation/Carousel.svelte.d.ts +2 -3
- package/dist/components/presentation/ImageCompare.svelte +52 -49
- package/dist/components/presentation/ImageCompare.svelte.d.ts +47 -12
- package/dist/index.d.ts +2 -0
- package/dist/index.js +4 -2
- package/package.json +1 -1
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { browser } from "$app/environment";
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
userId: number;
|
|
6
|
+
title?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
let { userId, title = "store" }: Props = $props();
|
|
10
|
+
|
|
11
|
+
if (browser) {
|
|
12
|
+
const handle = `ec_tenant_${userId}`;
|
|
13
|
+
window.addEventListener('message', (e) => {
|
|
14
|
+
!!e.data.frameHeight &&
|
|
15
|
+
e.data.pricingUuid === handle&&
|
|
16
|
+
(document.getElementById(handle).style.height = e.data.frameHeight);
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<iframe
|
|
22
|
+
id="ec_tenant_{userId}"
|
|
23
|
+
title={title}
|
|
24
|
+
width="100%"
|
|
25
|
+
src="https://app.easy.tools/ec/{userId}"
|
|
26
|
+
allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
|
|
27
|
+
allowfullscreen
|
|
28
|
+
frameborder="0"
|
|
29
|
+
scrolling="no"
|
|
30
|
+
></iframe>
|
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
import { onMount, type Snippet } from 'svelte';
|
|
3
3
|
import emblaCarouselSvelte from 'embla-carousel-svelte';
|
|
4
4
|
import EmblaCarousel, { type EmblaOptionsType } from 'embla-carousel';
|
|
5
|
-
import type { CarouselItem } from './Carousel.ts';
|
|
6
5
|
import { cn } from '../../utils.js';
|
|
7
6
|
import Button from '../form/Button.svelte';
|
|
8
7
|
|
|
9
8
|
interface Props {
|
|
10
|
-
child: Snippet<[
|
|
11
|
-
items: Array<
|
|
9
|
+
child: Snippet<[any]>;
|
|
10
|
+
items: Array<any>;
|
|
12
11
|
next?: Snippet;
|
|
13
12
|
prev?: Snippet;
|
|
14
13
|
css?: { slide: string; container: string };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { type Snippet } from 'svelte';
|
|
2
|
-
import type { CarouselItem } from './Carousel.ts';
|
|
3
2
|
interface Props {
|
|
4
|
-
child: Snippet<[
|
|
5
|
-
items: Array<
|
|
3
|
+
child: Snippet<[any]>;
|
|
4
|
+
items: Array<any>;
|
|
6
5
|
next?: Snippet;
|
|
7
6
|
prev?: Snippet;
|
|
8
7
|
css?: {
|
|
@@ -1,36 +1,22 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
interface Props {
|
|
5
|
-
before: string;
|
|
6
|
-
after: string;
|
|
7
|
-
offset?: number;
|
|
8
|
-
overlay?: boolean;
|
|
9
|
-
sliding?: boolean;
|
|
10
|
-
contain?: boolean;
|
|
11
|
-
lazyLoad?: 'eager' | 'lazy' | undefined;
|
|
12
|
-
hideOnSlide?: boolean;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
let {
|
|
16
|
-
before,
|
|
17
|
-
after,
|
|
18
|
-
offset = 0.5,
|
|
19
|
-
overlay = true,
|
|
1
|
+
<script>
|
|
2
|
+
let hideOnSlide = true,
|
|
3
|
+
imgOffset = null,
|
|
20
4
|
sliding = false,
|
|
21
5
|
contain = false,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
6
|
+
overlay = true,
|
|
7
|
+
offset = 0.5,
|
|
8
|
+
before = "",
|
|
9
|
+
after = "",
|
|
10
|
+
lazyLoad = false,
|
|
11
|
+
img;
|
|
28
12
|
|
|
29
|
-
function resize(e
|
|
30
|
-
imgOffset = (
|
|
13
|
+
function resize(e) {
|
|
14
|
+
imgOffset = (
|
|
15
|
+
e.type === "load" ? e.target : img
|
|
16
|
+
).getBoundingClientRect();
|
|
31
17
|
}
|
|
32
18
|
|
|
33
|
-
function move(e
|
|
19
|
+
function move(e) {
|
|
34
20
|
if (sliding && imgOffset) {
|
|
35
21
|
let x = (e.touches ? e.touches[0].pageX : e.pageX) - imgOffset.left;
|
|
36
22
|
x = x < 0 ? 0 : x > w ? w : x;
|
|
@@ -38,7 +24,7 @@
|
|
|
38
24
|
}
|
|
39
25
|
}
|
|
40
26
|
|
|
41
|
-
function start(e
|
|
27
|
+
function start(e) {
|
|
42
28
|
sliding = true;
|
|
43
29
|
move(e);
|
|
44
30
|
}
|
|
@@ -47,13 +33,16 @@
|
|
|
47
33
|
sliding = false;
|
|
48
34
|
}
|
|
49
35
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
36
|
+
$: w = imgOffset && imgOffset.width;
|
|
37
|
+
$: h = imgOffset && imgOffset.height;
|
|
38
|
+
$: x = w * offset;
|
|
39
|
+
$: opacity = hideOnSlide && sliding ? 0 : 1;
|
|
40
|
+
$: style = contain
|
|
41
|
+
? `width:100%;height:100%;`
|
|
42
|
+
: `width:${w}px;height:${h}px;`;
|
|
43
|
+
$: imageLoading = lazyLoad ? "lazy" : "eager";
|
|
44
|
+
|
|
45
|
+
export { before, after, offset, overlay, contain, lazyLoad, hideOnSlide };
|
|
57
46
|
</script>
|
|
58
47
|
|
|
59
48
|
<svelte:window
|
|
@@ -64,32 +53,32 @@
|
|
|
64
53
|
on:resize={resize}
|
|
65
54
|
/>
|
|
66
55
|
|
|
67
|
-
|
|
68
|
-
<div
|
|
69
|
-
class="container"
|
|
70
|
-
{style}
|
|
71
|
-
ontouchstart={start}
|
|
72
|
-
onmousedown={start}
|
|
73
|
-
role="img"
|
|
74
|
-
aria-roledescription="image slider"
|
|
75
|
-
>
|
|
56
|
+
<div class="container" {style} on:touchstart={start} on:mousedown={start} role="img" aria-roledescription="image slider">
|
|
76
57
|
<img
|
|
77
58
|
bind:this={img}
|
|
78
|
-
loading={
|
|
59
|
+
loading={imageLoading}
|
|
79
60
|
src={after}
|
|
80
61
|
alt="after"
|
|
81
|
-
|
|
62
|
+
on:mousedown|preventDefault
|
|
63
|
+
on:load={resize}
|
|
82
64
|
{style}
|
|
83
65
|
/>
|
|
84
66
|
<img
|
|
85
|
-
loading={
|
|
67
|
+
loading={imageLoading}
|
|
86
68
|
src={before}
|
|
87
69
|
alt="before"
|
|
70
|
+
on:mousedown|preventDefault
|
|
88
71
|
style="{style}clip:rect(0, {x}px, {h}px, 0);"
|
|
89
72
|
/>
|
|
90
73
|
{#if overlay}
|
|
91
74
|
<div class="overlay" style="opacity:{opacity}"></div>
|
|
92
75
|
{/if}
|
|
76
|
+
<div class="before-label" style="opacity:{opacity}">
|
|
77
|
+
<slot name="before"></slot>
|
|
78
|
+
</div>
|
|
79
|
+
<div class="after-label" style="opacity:{opacity}">
|
|
80
|
+
<slot name="after"></slot>
|
|
81
|
+
</div>
|
|
93
82
|
<div class="handle" style="left: calc({offset * 100}% - 20px)">
|
|
94
83
|
<div class="arrow-left"></div>
|
|
95
84
|
<div class="arrow-right"></div>
|
|
@@ -122,6 +111,20 @@
|
|
|
122
111
|
transition: opacity 0.5s;
|
|
123
112
|
background: rgba(0, 0, 0, 0.5);
|
|
124
113
|
}
|
|
114
|
+
.before-label,
|
|
115
|
+
.after-label {
|
|
116
|
+
top: 0;
|
|
117
|
+
bottom: 0;
|
|
118
|
+
z-index: 25;
|
|
119
|
+
user-select: none;
|
|
120
|
+
position: absolute;
|
|
121
|
+
}
|
|
122
|
+
.before-label {
|
|
123
|
+
left: 0;
|
|
124
|
+
}
|
|
125
|
+
.after-label {
|
|
126
|
+
right: 0;
|
|
127
|
+
}
|
|
125
128
|
.container:hover > .overlay {
|
|
126
129
|
opacity: 1;
|
|
127
130
|
}
|
|
@@ -141,7 +144,7 @@
|
|
|
141
144
|
}
|
|
142
145
|
.handle:before,
|
|
143
146
|
.handle:after {
|
|
144
|
-
content:
|
|
147
|
+
content: "";
|
|
145
148
|
height: 9999px;
|
|
146
149
|
position: absolute;
|
|
147
150
|
left: calc(50% - 2px);
|
|
@@ -1,13 +1,48 @@
|
|
|
1
|
-
interface Props {
|
|
2
|
-
before: string;
|
|
3
|
-
after: string;
|
|
4
|
-
offset?: number;
|
|
5
|
-
overlay?: boolean;
|
|
6
|
-
sliding?: boolean;
|
|
7
|
-
contain?: boolean;
|
|
8
|
-
lazyLoad?: 'eager' | 'lazy' | undefined;
|
|
9
|
-
hideOnSlide?: boolean;
|
|
10
|
-
}
|
|
11
|
-
declare const ImageCompare: import("svelte").Component<Props, {}, "">;
|
|
12
|
-
type ImageCompare = ReturnType<typeof ImageCompare>;
|
|
13
1
|
export default ImageCompare;
|
|
2
|
+
type ImageCompare = SvelteComponent<{
|
|
3
|
+
overlay?: boolean | undefined;
|
|
4
|
+
before?: string | undefined;
|
|
5
|
+
after?: string | undefined;
|
|
6
|
+
offset?: number | undefined;
|
|
7
|
+
contain?: boolean | undefined;
|
|
8
|
+
lazyLoad?: boolean | undefined;
|
|
9
|
+
hideOnSlide?: boolean | undefined;
|
|
10
|
+
}, {
|
|
11
|
+
mousedown: MouseEvent;
|
|
12
|
+
} & {
|
|
13
|
+
[evt: string]: CustomEvent<any>;
|
|
14
|
+
}, {
|
|
15
|
+
before: {};
|
|
16
|
+
after: {};
|
|
17
|
+
}> & {
|
|
18
|
+
$$bindings?: string | undefined;
|
|
19
|
+
};
|
|
20
|
+
declare const ImageCompare: $$__sveltets_2_IsomorphicComponent<{
|
|
21
|
+
overlay?: boolean | undefined;
|
|
22
|
+
before?: string | undefined;
|
|
23
|
+
after?: string | undefined;
|
|
24
|
+
offset?: number | undefined;
|
|
25
|
+
contain?: boolean | undefined;
|
|
26
|
+
lazyLoad?: boolean | undefined;
|
|
27
|
+
hideOnSlide?: boolean | undefined;
|
|
28
|
+
}, {
|
|
29
|
+
mousedown: MouseEvent;
|
|
30
|
+
} & {
|
|
31
|
+
[evt: string]: CustomEvent<any>;
|
|
32
|
+
}, {
|
|
33
|
+
before: {};
|
|
34
|
+
after: {};
|
|
35
|
+
}, {}, string>;
|
|
36
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
37
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
38
|
+
$$bindings?: Bindings;
|
|
39
|
+
} & Exports;
|
|
40
|
+
(internal: unknown, props: Props & {
|
|
41
|
+
$$events?: Events;
|
|
42
|
+
$$slots?: Slots;
|
|
43
|
+
}): Exports & {
|
|
44
|
+
$set?: any;
|
|
45
|
+
$on?: any;
|
|
46
|
+
};
|
|
47
|
+
z_$$bindings?: Bindings;
|
|
48
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export { default as Carousel } from './components/presentation/Carousel.svelte';
|
|
|
17
17
|
export { default as Drawer } from './components/presentation/Drawer.svelte';
|
|
18
18
|
export { default as Disclose } from './components/presentation/Disclose.svelte';
|
|
19
19
|
export { default as EmptyState } from './components/presentation/EmptyState.svelte';
|
|
20
|
+
export { default as ImageCompare } from './components/presentation/ImageCompare.svelte';
|
|
20
21
|
export { default as ListMenu } from './components/menu/ListMenu.svelte';
|
|
21
22
|
export { default as DynamicMenu } from './components/menu/DynamicMenu.svelte';
|
|
22
23
|
export { default as HamburgerMenu } from './components/menu/HamburgerMenu.svelte';
|
|
@@ -31,3 +32,4 @@ export type { ChoiceInputOption } from './components/form/utils.ts';
|
|
|
31
32
|
export { default as AntiBot } from './components/form/AntiBot.svelte';
|
|
32
33
|
export { default as Markdown } from './components/content/Markdown.svelte';
|
|
33
34
|
export { type BlogPost, listAllPosts, importPost } from './components/blog/blog.js';
|
|
35
|
+
export { default as EasyTools } from './components/integrations/EasyTools.svelte';
|
package/dist/index.js
CHANGED
|
@@ -24,6 +24,7 @@ export { default as Carousel } from './components/presentation/Carousel.svelte';
|
|
|
24
24
|
export { default as Drawer } from './components/presentation/Drawer.svelte';
|
|
25
25
|
export { default as Disclose } from './components/presentation/Disclose.svelte';
|
|
26
26
|
export { default as EmptyState } from './components/presentation/EmptyState.svelte';
|
|
27
|
+
export { default as ImageCompare } from './components/presentation/ImageCompare.svelte';
|
|
27
28
|
/*
|
|
28
29
|
* Menu
|
|
29
30
|
*/
|
|
@@ -50,5 +51,6 @@ export { default as Markdown } from './components/content/Markdown.svelte';
|
|
|
50
51
|
*/
|
|
51
52
|
export { listAllPosts, importPost } from './components/blog/blog.js';
|
|
52
53
|
/*
|
|
53
|
-
*
|
|
54
|
-
*/
|
|
54
|
+
* Integrations
|
|
55
|
+
*/
|
|
56
|
+
export { default as EasyTools } from './components/integrations/EasyTools.svelte';
|