@dosgato/dialog 0.0.36 → 0.0.37
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/chooser/Chooser.svelte
CHANGED
|
@@ -100,7 +100,7 @@ onMount(async () => {
|
|
|
100
100
|
</section>
|
|
101
101
|
<section class="dialog-chooser-preview" tabindex="-1">
|
|
102
102
|
{#if $preview}
|
|
103
|
-
<Thumbnail item={$preview} />
|
|
103
|
+
<Thumbnail item={$preview} larger />
|
|
104
104
|
<Details item={$preview}>
|
|
105
105
|
{#if $preview.type === 'folder'}
|
|
106
106
|
<li>{$selected?.children?.length ?? 0} sub-items</li>
|
package/chooser/ChooserAPI.d.ts
CHANGED
package/chooser/Thumbnail.svelte
CHANGED
|
@@ -3,12 +3,13 @@ import fileLinkOutline from '@iconify-icons/mdi/file-link-outline.js';
|
|
|
3
3
|
import FileIcon from '../FileIcon.svelte';
|
|
4
4
|
import Icon from '../Icon.svelte';
|
|
5
5
|
export let item;
|
|
6
|
+
export let larger = false;
|
|
6
7
|
</script>
|
|
7
8
|
|
|
8
9
|
<div class="dialog-chooser-thumbnail">
|
|
9
10
|
{#if item.type === 'asset'}
|
|
10
11
|
{#if item.image}
|
|
11
|
-
<img src={item.image.thumbnailUrl} alt="" />
|
|
12
|
+
<img src={(larger ? item.image.thumbnailUrl : item.image.previewUrl) ?? item.image.thumbnailUrl ?? item.url} alt="" />
|
|
12
13
|
{:else}
|
|
13
14
|
<FileIcon mime={item.mime} width='5em' />
|
|
14
15
|
{/if}
|
|
@@ -39,7 +39,7 @@ let container;
|
|
|
39
39
|
function onMouseDown(e) {
|
|
40
40
|
if (!updateRect())
|
|
41
41
|
return;
|
|
42
|
-
if (e instanceof TouchEvent && e.touches.length > 1)
|
|
42
|
+
if (window.TouchEvent && TouchEvent && e instanceof TouchEvent && e.touches.length > 1)
|
|
43
43
|
return;
|
|
44
44
|
const clientX = e instanceof MouseEvent ? e.clientX : e.touches[0].clientX;
|
|
45
45
|
const clientY = e instanceof MouseEvent ? e.clientY : e.touches[0].clientY;
|
|
@@ -51,7 +51,7 @@ function onMouseDown(e) {
|
|
|
51
51
|
function onMouseMove(e) {
|
|
52
52
|
if (!updateRect())
|
|
53
53
|
return;
|
|
54
|
-
if (e instanceof TouchEvent && e.touches.length > 1)
|
|
54
|
+
if (window.TouchEvent && e instanceof TouchEvent && e.touches.length > 1)
|
|
55
55
|
return;
|
|
56
56
|
const clientX = e instanceof MouseEvent ? e.clientX : e.touches[0].clientX;
|
|
57
57
|
const clientY = e instanceof MouseEvent ? e.clientY : e.touches[0].clientY;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dosgato/dialog",
|
|
3
3
|
"description": "A component library for building forms that edit a JSON document.",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.37",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@txstate-mws/svelte-components": "^1.3.7",
|
|
7
7
|
"@txstate-mws/svelte-forms": "^1.3.4",
|