@widgetic/file-browser 0.5.39 → 0.5.41

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.
Files changed (65) hide show
  1. package/dist/components/FolderTree.svelte +1 -1
  2. package/dist/components/FolderTree.svelte.d.ts +6 -2
  3. package/dist/components/core/Dropzone.svelte +147 -109
  4. package/dist/components/core/FileBrowser.svelte +128 -99
  5. package/dist/components/core/FileBrowser.svelte.d.ts +5 -1
  6. package/dist/components/core/FileUploader.svelte +80 -51
  7. package/dist/components/core/Header.svelte +1 -1
  8. package/dist/components/core/RecentFiles.svelte +23 -11
  9. package/dist/components/core/RecentFiles.svelte.d.ts +1 -0
  10. package/dist/components/core/SearchDropdown.svelte +125 -27
  11. package/dist/components/core/UploadPanel.svelte +2 -2
  12. package/dist/components/core/UploadRow.svelte +5 -5
  13. package/dist/components/items/FileItem.svelte +13 -3
  14. package/dist/components/items/FolderItem.svelte +8 -1
  15. package/dist/components/modals/MoveDialog.svelte +1 -1
  16. package/dist/components/modals/SelectedFilesModal.svelte +2 -2
  17. package/dist/components/modals/index.d.ts +0 -1
  18. package/dist/components/modals/index.js +0 -1
  19. package/dist/components/previews/FilePreview.svelte +198 -31
  20. package/dist/components/previews/FilePreview.svelte.d.ts +1 -0
  21. package/dist/components/previews/ImagePreview.svelte +60 -31
  22. package/dist/components/previews/ImagePreview.svelte.d.ts +3 -0
  23. package/dist/components/previews/PreviewHeaderBar.svelte +34 -26
  24. package/dist/components/previews/PreviewHeaderBar.svelte.d.ts +2 -0
  25. package/dist/components/previews/TextPreview.svelte +1 -1
  26. package/dist/components/previews/VideoPlayer.svelte +4 -4
  27. package/dist/components/ui/ControlToolbar.svelte +10 -10
  28. package/dist/components/ui/DragSelect.svelte +85 -67
  29. package/dist/components/ui/DragSelect.svelte.d.ts +1 -0
  30. package/dist/components/ui/DropdownMenu.svelte +5 -5
  31. package/dist/components/ui/FileIcon.svelte +2 -2
  32. package/dist/data/demoContent.json +13 -11
  33. package/dist/i18n/messages.d.ts +0 -1
  34. package/dist/i18n/messages.js +0 -1
  35. package/dist/stores/fileStore.d.ts +2 -2
  36. package/dist/stores/navigationStore.d.ts +6 -1
  37. package/dist/stores/navigationStore.js +40 -67
  38. package/dist/stores/persistentSelectStore.d.ts +1 -1
  39. package/dist/utils/escapeSelectionAction.d.ts +18 -0
  40. package/dist/utils/escapeSelectionAction.js +18 -0
  41. package/dist/utils/imagePreviewCache.d.ts +16 -0
  42. package/dist/utils/imagePreviewCache.js +78 -0
  43. package/dist/utils/imagePreviewVisualState.d.ts +19 -0
  44. package/dist/utils/imagePreviewVisualState.js +22 -0
  45. package/dist/utils/menuKeydownBubble.d.ts +9 -0
  46. package/dist/utils/menuKeydownBubble.js +11 -0
  47. package/dist/utils/previewNavigation.d.ts +4 -0
  48. package/dist/utils/previewNavigation.js +17 -0
  49. package/dist/utils/recentFiles.d.ts +6 -0
  50. package/dist/utils/recentFiles.js +21 -0
  51. package/dist/utils/recentFilesLimit.d.ts +8 -0
  52. package/dist/utils/recentFilesLimit.js +17 -0
  53. package/dist/utils/searchEscapeAction.d.ts +10 -0
  54. package/dist/utils/searchEscapeAction.js +12 -0
  55. package/dist/utils/searchItems.d.ts +2 -4
  56. package/dist/utils/searchItems.js +12 -5
  57. package/dist/utils/searchNavigation.d.ts +12 -0
  58. package/dist/utils/searchNavigation.js +42 -0
  59. package/dist/utils/uploadDisplayProgress.d.ts +4 -0
  60. package/dist/utils/uploadDisplayProgress.js +9 -0
  61. package/dist/utils/uploadPanelProgress.d.ts +5 -0
  62. package/dist/utils/uploadPanelProgress.js +17 -0
  63. package/package.json +1 -1
  64. package/dist/components/modals/SearchModal.svelte +0 -296
  65. package/dist/components/modals/SearchModal.svelte.d.ts +0 -27
@@ -16,9 +16,13 @@
16
16
  export let meta = '';
17
17
  export let showMeta = true;
18
18
  export let allowSelecting = false;
19
+ /** When true, the preview shows the picker Select control (editor embed mode). */
20
+ export let showSelectInPreview = false;
19
21
  export let isSelected = false;
20
22
  export let canGoPrevious = false;
21
23
  export let canGoNext = false;
24
+ /** When false, previous/next controls are not shown (single item in folder). */
25
+ export let showNavigation = true;
22
26
  // What a screen reader says for the close button
23
27
  export let closeLabel = '';
24
28
  </script>
@@ -35,36 +39,40 @@
35
39
  {/if}
36
40
  </div>
37
41
 
38
- {#if allowSelecting}
42
+ {#if allowSelecting && (showNavigation || showSelectInPreview)}
39
43
  <div class="flex shrink-0 items-center gap-1">
40
- <IconButton
41
- variant="ghost"
42
- label={$t('preview.previousFile')}
43
- disabled={!canGoPrevious}
44
- onclick={() => dispatch('previous')}
45
- >
46
- <IconChevronLeft class="size-4 stroke-[1.333] rtl:rotate-180" />
47
- </IconButton>
48
- <IconButton
49
- variant="ghost"
50
- label={$t('preview.nextFile')}
51
- disabled={!canGoNext}
52
- onclick={() => dispatch('next')}
53
- >
54
- <IconChevronRight class="size-4 stroke-[1.333] rtl:rotate-180" />
55
- </IconButton>
56
- <Button
57
- variant="outline"
58
- size="sm"
59
- class="press-feedback"
60
- onclick={() => dispatch('select')}
61
- >
62
- {isSelected ? $t('action.selected') : $t('action.select')}
63
- </Button>
44
+ {#if showNavigation}
45
+ <IconButton
46
+ variant="ghost"
47
+ label={$t('preview.previousFile')}
48
+ disabled={!canGoPrevious}
49
+ onclick={() => dispatch('previous')}
50
+ >
51
+ <IconChevronLeft class="size-4 stroke-2 rtl:rotate-180" />
52
+ </IconButton>
53
+ <IconButton
54
+ variant="ghost"
55
+ label={$t('preview.nextFile')}
56
+ disabled={!canGoNext}
57
+ onclick={() => dispatch('next')}
58
+ >
59
+ <IconChevronRight class="size-4 stroke-2 rtl:rotate-180" />
60
+ </IconButton>
61
+ {/if}
62
+ {#if showSelectInPreview}
63
+ <Button
64
+ variant="outline"
65
+ size="sm"
66
+ class="press-feedback"
67
+ onclick={() => dispatch('select')}
68
+ >
69
+ {isSelected ? $t('action.selected') : $t('action.select')}
70
+ </Button>
71
+ {/if}
64
72
  </div>
65
73
  {/if}
66
74
 
67
75
  <IconButton variant="ghost" label={closeLabel} onclick={() => dispatch('close')}>
68
- <IconX class="size-4 stroke-[1.333]" />
76
+ <IconX class="size-4 stroke-2" />
69
77
  </IconButton>
70
78
  </div>
@@ -16,9 +16,11 @@ declare const PreviewHeaderBar: $$__sveltets_2_IsomorphicComponent<{
16
16
  meta?: string;
17
17
  showMeta?: boolean;
18
18
  allowSelecting?: boolean;
19
+ /** When true, the preview shows the picker Select control (editor embed mode). */ showSelectInPreview?: boolean;
19
20
  isSelected?: boolean;
20
21
  canGoPrevious?: boolean;
21
22
  canGoNext?: boolean;
23
+ /** When false, previous/next controls are not shown (single item in folder). */ showNavigation?: boolean;
22
24
  closeLabel?: string;
23
25
  }, {
24
26
  previous: CustomEvent<void>;
@@ -65,7 +65,7 @@
65
65
  <div class="text-preview-container w-full" style="max-height: {scrolledAreaMaxHeight}px">
66
66
  {#if isLoading}
67
67
  <div class="flex min-h-[16rem] items-center justify-center gap-3 text-caption text-muted-foreground">
68
- <IconLoader2 class="size-5 animate-spin stroke-[1.333] motion-reduce:animate-none" />
68
+ <IconLoader2 class="size-5 animate-spin stroke-[1.6] motion-reduce:animate-none" />
69
69
  {$t('preview.loading')}
70
70
  </div>
71
71
  {:else if loadFailed}
@@ -196,9 +196,9 @@
196
196
  onclick={togglePlay}
197
197
  >
198
198
  {#if isPlaying}
199
- <IconPlayerPause class="size-4 stroke-[1.333]" />
199
+ <IconPlayerPause class="size-4 stroke-2" />
200
200
  {:else}
201
- <IconPlayerPlay class="size-4 stroke-[1.333]" />
201
+ <IconPlayerPlay class="size-4 stroke-2" />
202
202
  {/if}
203
203
  </IconButton>
204
204
 
@@ -237,9 +237,9 @@
237
237
  onclick={toggleMute}
238
238
  >
239
239
  {#if isMuted}
240
- <IconVolumeOff class="size-4 stroke-[1.333]" />
240
+ <IconVolumeOff class="size-4 stroke-2" />
241
241
  {:else}
242
- <IconVolume class="size-4 stroke-[1.333]" />
242
+ <IconVolume class="size-4 stroke-2" />
243
243
  {/if}
244
244
  </IconButton>
245
245
  </div>
@@ -93,7 +93,7 @@
93
93
  label={$t('action.clearItems')}
94
94
  onclick={handleClearItems}
95
95
  >
96
- <IconX class="size-4 stroke-[1.333]" aria-hidden="true" />
96
+ <IconX class="size-4 stroke-2" aria-hidden="true" />
97
97
  </IconButton>
98
98
  </div>
99
99
 
@@ -103,11 +103,11 @@
103
103
  {#if capabilities.rename}
104
104
  {#if compact}
105
105
  <IconButton variant="ghost" size="default" label={$t('action.rename')} onclick={handleRename}>
106
- <IconPencil class="size-4 stroke-[1.333]" aria-hidden="true" />
106
+ <IconPencil class="size-4 stroke-2" aria-hidden="true" />
107
107
  </IconButton>
108
108
  {:else}
109
109
  <Button variant="ghost" size="sm" onclick={handleRename} aria-label={$t('action.rename')}>
110
- <IconPencil class="size-4 shrink-0 stroke-[1.333]" aria-hidden="true" />
110
+ <IconPencil class="size-4 shrink-0 stroke-2" aria-hidden="true" />
111
111
  {$t('action.rename')}
112
112
  </Button>
113
113
  {/if}
@@ -115,11 +115,11 @@
115
115
  {#if capabilities.download}
116
116
  {#if compact}
117
117
  <IconButton variant="ghost" size="default" label={$t('action.download')} onclick={handleDownload}>
118
- <IconDownload class="size-4 stroke-[1.333]" aria-hidden="true" />
118
+ <IconDownload class="size-4 stroke-2" aria-hidden="true" />
119
119
  </IconButton>
120
120
  {:else}
121
121
  <Button variant="ghost" size="sm" onclick={handleDownload} aria-label={$t('action.download')}>
122
- <IconDownload class="size-4 shrink-0 stroke-[1.333]" aria-hidden="true" />
122
+ <IconDownload class="size-4 shrink-0 stroke-2" aria-hidden="true" />
123
123
  {$t('action.download')}
124
124
  </Button>
125
125
  {/if}
@@ -134,7 +134,7 @@
134
134
  label={isSingle ? $t('action.move') : $t('toolbar.moveMany', { count: selectedFiles.length })}
135
135
  onclick={handleMove}
136
136
  >
137
- <IconArrowsMove class="size-4 stroke-[1.333]" aria-hidden="true" />
137
+ <IconArrowsMove class="size-4 stroke-2" aria-hidden="true" />
138
138
  </IconButton>
139
139
  {:else}
140
140
  <Button
@@ -143,7 +143,7 @@
143
143
  onclick={handleMove}
144
144
  aria-label={isSingle ? $t('action.move') : $t('toolbar.moveMany', { count: selectedFiles.length })}
145
145
  >
146
- <IconArrowsMove class="size-4 shrink-0 stroke-[1.333] rtl:-scale-x-100" aria-hidden="true" />
146
+ <IconArrowsMove class="size-4 shrink-0 stroke-2 rtl:-scale-x-100" aria-hidden="true" />
147
147
  {isSingle ? $t('action.move') : $t('toolbar.moveMany', { count: selectedFiles.length })}
148
148
  </Button>
149
149
  {/if}
@@ -158,7 +158,7 @@
158
158
  onclick={handleDelete}
159
159
  class="text-destructive hover:text-destructive"
160
160
  >
161
- <IconTrash class="size-4 stroke-[1.333]" aria-hidden="true" />
161
+ <IconTrash class="size-4 stroke-2" aria-hidden="true" />
162
162
  </IconButton>
163
163
  {:else}
164
164
  <Button
@@ -168,7 +168,7 @@
168
168
  onclick={handleDelete}
169
169
  aria-label={isSingle ? $t('action.delete') : $t('toolbar.deleteMany', { count: selectedFiles.length })}
170
170
  >
171
- <IconTrash class="size-4 shrink-0 stroke-[1.333]" aria-hidden="true" />
171
+ <IconTrash class="size-4 shrink-0 stroke-2" aria-hidden="true" />
172
172
  {isSingle ? $t('action.delete') : $t('toolbar.deleteMany', { count: selectedFiles.length })}
173
173
  </Button>
174
174
  {/if}
@@ -182,7 +182,7 @@
182
182
  aria-label={confirmAddLabel}
183
183
  disabled={confirmAddDisabled}
184
184
  >
185
- <IconCheck class="size-4 shrink-0 stroke-[1.333]" aria-hidden="true" />
185
+ <IconCheck class="size-4 shrink-0 stroke-2" aria-hidden="true" />
186
186
  {confirmAddLabel}
187
187
  </Button>
188
188
  {/if}
@@ -18,11 +18,17 @@
18
18
 
19
19
  let selectionBox: HTMLDivElement;
20
20
  let isDragging = false;
21
+ /** Parent reads whether a rubber-band drag is active (Escape cancels the drag, not the selection). */
22
+ export let dragBandActive = false;
23
+ $: dragBandActive = isDragging;
21
24
  let startX = 0;
22
25
  let startY = 0;
23
26
  let currentX = 0;
24
27
  let currentY = 0;
25
28
  let scrollStartY = 0;
29
+ /** Where the pointer is in the viewport: the auto-scroll reads it while the pointer rests and the list moves under it. */
30
+ let lastPointerClientX = 0;
31
+ let lastPointerClientY = 0;
26
32
  let autoScrollInterval: number | null = null;
27
33
  let selectedItemIds = new Set<string>();
28
34
  let cleanup: (() => void) | null = null;
@@ -47,6 +53,12 @@
47
53
  return element.getAttribute('data-selected') === 'true';
48
54
  }
49
55
 
56
+ function clearDragHoverMarkup(element: Element) {
57
+ element.classList.remove('hover-effect');
58
+ element.classList.remove('recent-file-selected');
59
+ element.removeAttribute('data-drag-hover');
60
+ }
61
+
50
62
  function cacheItems() {
51
63
  if (!container) return;
52
64
  const alreadySelectedInStore = persistentSelectStore.getSelected(currentFilter);
@@ -119,6 +131,7 @@
119
131
 
120
132
  function handleKeyDown(e: KeyboardEvent) {
121
133
  if (e.key === 'Escape' && isDragging) {
134
+ e.stopPropagation();
122
135
  mouseIsDown = false;
123
136
  isDragging = false;
124
137
 
@@ -128,9 +141,7 @@
128
141
 
129
142
  stopAutoScroll();
130
143
 
131
- container.querySelectorAll('.hover-effect').forEach(element => {
132
- element.classList.remove('hover-effect');
133
- });
144
+ container.querySelectorAll('.hover-effect').forEach(clearDragHoverMarkup);
134
145
 
135
146
  hasMovedEnough = false;
136
147
  startItemId = null;
@@ -209,15 +220,17 @@
209
220
  .filter((id): id is string => id !== null)
210
221
  );
211
222
 
212
- scrollStartY = container.scrollTop || 0;
213
-
214
- const scrollRect = scrollContainer?.getBoundingClientRect() || container.getBoundingClientRect();
215
-
216
- startX = e.clientX - scrollRect.left;
217
- startY = e.clientY - scrollRect.top;
223
+ scrollStartY = getScrollableElement()?.scrollTop || container.scrollTop || 0;
224
+
225
+ const containerRect = container.getBoundingClientRect();
226
+
227
+ startX = e.clientX - containerRect.left;
228
+ startY = e.clientY - containerRect.top;
218
229
 
219
230
  currentX = startX;
220
231
  currentY = startY;
232
+ lastPointerClientX = e.clientX;
233
+ lastPointerClientY = e.clientY;
221
234
  };
222
235
 
223
236
  const handleMouseMove = (e: MouseEvent) => {
@@ -230,10 +243,12 @@
230
243
  e.preventDefault();
231
244
  e.stopPropagation();
232
245
 
233
- const scrollRect = scrollContainer?.getBoundingClientRect() || container.getBoundingClientRect();
234
-
235
- currentX = e.clientX - scrollRect.left;
236
- currentY = e.clientY - scrollRect.top;
246
+ const containerRect = container.getBoundingClientRect();
247
+
248
+ currentX = e.clientX - containerRect.left;
249
+ currentY = e.clientY - containerRect.top;
250
+ lastPointerClientX = e.clientX;
251
+ lastPointerClientY = e.clientY;
237
252
 
238
253
  if (scrollContainer) {
239
254
  const bounds = scrollContainer.getBoundingClientRect();
@@ -317,10 +332,7 @@
317
332
  resetSelectionBox();
318
333
  stopAutoScroll();
319
334
 
320
- container.querySelectorAll('.hover-effect').forEach(element => {
321
- element.classList.remove('hover-effect');
322
- element.classList.remove('recent-file-selected');
323
- });
335
+ container.querySelectorAll('.hover-effect').forEach(clearDragHoverMarkup);
324
336
 
325
337
  hasMovedEnough = false;
326
338
  startItemId = null;
@@ -403,15 +415,14 @@
403
415
  });
404
416
  }
405
417
 
406
- container.querySelectorAll('.hover-effect').forEach(element => {
407
- element.classList.remove('hover-effect');
408
-
418
+ container.querySelectorAll('.hover-effect').forEach((element) => {
409
419
  const itemId = element.getAttribute('data-item-id');
410
- const isAlreadySelected = isItemSelectedInDom(element as HTMLElement) ||
411
- (itemId && alreadySelectedInStore.includes(itemId));
412
-
413
- if (!isAlreadySelected) {
414
- element.classList.remove('recent-file-selected');
420
+ const isAlreadySelected =
421
+ isItemSelectedInDom(element as HTMLElement) ||
422
+ (itemId != null && alreadySelectedInStore.includes(itemId));
423
+ clearDragHoverMarkup(element);
424
+ if (isAlreadySelected && element instanceof HTMLElement) {
425
+ element.setAttribute('data-selected', 'true');
415
426
  }
416
427
  });
417
428
 
@@ -478,19 +489,13 @@
478
489
  let width = Math.abs(currentX - startX);
479
490
  let height = Math.abs(currentY - startY);
480
491
 
481
- if (scrollContainer) {
482
- const scrollRect = scrollContainer.getBoundingClientRect();
483
-
484
- const scrollLeft = 0;
485
- const scrollTop = 0;
486
- const scrollRight = scrollRect.width;
487
- const scrollBottom = scrollRect.height;
488
-
489
- left = Math.max(left, scrollLeft);
490
- top = Math.max(top, scrollTop);
491
- width = Math.min(width, scrollRight - left);
492
- height = Math.min(height, scrollBottom - top);
493
- }
492
+ // Clamp within the content container (grid + recent), not only the scroll viewport.
493
+ const maxWidth = container.clientWidth;
494
+ const maxHeight = container.clientHeight;
495
+ left = Math.max(left, 0);
496
+ top = Math.max(top, 0);
497
+ width = Math.min(width, maxWidth - left);
498
+ height = Math.min(height, maxHeight - top);
494
499
 
495
500
  selectionBox.style.display = 'block';
496
501
  // rtl-ok: rubber-band box between two pointer positions in the scroll container's coordinate space
@@ -525,50 +530,73 @@
525
530
  const isMarked = intersectsSelection || item.isSelectedInStore || item.isSelectedInDom;
526
531
 
527
532
  if (isMarked) {
528
- if (!selectedItemIds.has(item.id)) {
533
+ if (!item.element.classList.contains('hover-effect')) {
529
534
  selectedItemIds.add(item.id);
530
535
  item.element.classList.add('hover-effect');
536
+ item.element.setAttribute('data-drag-hover', 'true');
531
537
  if (item.isInRecentFiles) {
532
538
  item.element.classList.add('recent-file-selected');
533
539
  }
534
540
  }
535
- } else {
536
- if (!initiallySelectedItems.has(item.id) && !item.isSelectedInStore && !item.isSelectedInDom) {
537
- if (selectedItemIds.has(item.id)) {
538
- selectedItemIds.delete(item.id);
539
- item.element.classList.remove('hover-effect');
540
- item.element.classList.remove('recent-file-selected');
541
- }
541
+ } else if (
542
+ !initiallySelectedItems.has(item.id) &&
543
+ !item.isSelectedInStore &&
544
+ !item.isSelectedInDom
545
+ ) {
546
+ if (item.element.classList.contains('hover-effect')) {
547
+ selectedItemIds.delete(item.id);
548
+ clearDragHoverMarkup(item.element);
542
549
  }
543
550
  }
544
551
  }
545
552
  }
546
553
 
554
+ /**
555
+ * The element that really scrolls. `scrollContainer` is the root of the scroll area, which never scrolls itself:
556
+ * the list moves inside the viewport element in it, so writing `scrollTop` on the root did nothing and the drag
557
+ * could not reach files below the fold (the recent files) at all.
558
+ */
559
+ function getScrollableElement(): HTMLElement | null {
560
+ if (!scrollContainer) return null;
561
+ return scrollContainer.querySelector<HTMLElement>('[data-scroll-area-viewport]') ?? scrollContainer;
562
+ }
563
+
547
564
  function startAutoScroll() {
548
565
  if (!scrollContainer) return;
549
566
 
550
- stopAutoScroll();
567
+ // Already running: it reads the pointer from lastPointerClientX/Y on every tick, so every pointer move restarting
568
+ // it only kept it from ever firing while the pointer moved.
569
+ if (autoScrollInterval !== null) return;
551
570
 
552
571
  autoScrollInterval = window.setInterval(() => {
553
- if (!isDragging || !scrollContainer || !container) return;
572
+ const scrollableElement = getScrollableElement();
573
+ if (!isDragging || !scrollContainer || !scrollableElement || !container) return;
554
574
 
555
- const containerRect = scrollContainer.getBoundingClientRect();
556
- const mouseY = currentY + container.getBoundingClientRect().top - (scrollContainer?.scrollTop || 0);
557
-
558
- const distanceFromTop = mouseY - containerRect.top;
559
- const distanceFromBottom = containerRect.bottom - mouseY;
575
+ // The pointer is read in the viewport (where the user holds it), not rebuilt from the box coordinates: those move
576
+ // with the content, so after the first few steps of scrolling they put the pointer in the wrong place and the
577
+ // list stopped scrolling long before the recent files were reached.
578
+ const scrollRect = scrollContainer.getBoundingClientRect();
579
+ const distanceFromTop = lastPointerClientY - scrollRect.top;
580
+ const distanceFromBottom = scrollRect.bottom - lastPointerClientY;
560
581
 
561
582
  let scrolled = false;
562
583
 
563
584
  if (distanceFromTop < SCROLL_THRESHOLD) {
564
- scrollContainer.scrollTop -= SCROLL_SPEED;
565
- scrolled = true;
585
+ const previousScrollTop = scrollableElement.scrollTop;
586
+ scrollableElement.scrollTop -= SCROLL_SPEED;
587
+ scrolled = scrollableElement.scrollTop !== previousScrollTop;
566
588
  } else if (distanceFromBottom < SCROLL_THRESHOLD) {
567
- scrollContainer.scrollTop += SCROLL_SPEED;
568
- scrolled = true;
589
+ const previousScrollTop = scrollableElement.scrollTop;
590
+ scrollableElement.scrollTop += SCROLL_SPEED;
591
+ scrolled = scrollableElement.scrollTop !== previousScrollTop;
569
592
  }
570
593
 
571
594
  if (scrolled) {
595
+ // The content moved under a resting pointer: the box grows to where the pointer now is in the content.
596
+ const containerRect = container.getBoundingClientRect();
597
+ currentX = lastPointerClientX - containerRect.left;
598
+ currentY = lastPointerClientY - containerRect.top;
599
+ updateSelectionBox();
572
600
  cacheItems();
573
601
  checkIntersections();
574
602
  }
@@ -592,16 +620,6 @@
592
620
  {/if}
593
621
 
594
622
  <style>
595
- :global(.hover-effect > *) {
596
- background-color: var(--accent) !important;
597
- border-radius: var(--radius-xl) !important;
598
- }
599
-
600
- :global(.recent-file-selected.hover-effect > *) {
601
- background-color: var(--brand-subtle) !important;
602
- box-shadow: inset 0 0 0 1px var(--brand) !important;
603
- }
604
-
605
623
  :global(.modal-content-inner-container),
606
624
  :global(.base-modal-portal),
607
625
  :global(.modal-content-root-container),
@@ -19,6 +19,7 @@ declare const DragSelect: $$__sveltets_2_IsomorphicComponent<{
19
19
  items?: FileSystemItem[];
20
20
  scrollContainer?: HTMLElement | null;
21
21
  currentFilter?: FileFilterType;
22
+ /** Parent reads whether a rubber-band drag is active (Escape cancels the drag, not the selection). */ dragBandActive?: boolean;
22
23
  }, {
23
24
  select: CustomEvent<{
24
25
  added: FileSystemItem[];
@@ -50,25 +50,25 @@
50
50
  <div class="dropdown-wrapper relative">
51
51
  <DropdownMenu.Root>
52
52
  <DropdownMenu.Trigger class={triggerClass} aria-label={$t('menu.open')}>
53
- <IconDots class="size-4 stroke-[1.333]" aria-hidden="true" />
53
+ <IconDots class="size-4 stroke-2" aria-hidden="true" />
54
54
  <span class="sr-only">{$t('menu.moreOptions')}</span>
55
55
  </DropdownMenu.Trigger>
56
56
  <DropdownMenu.Content class="more-options-content w-[200px]" align="end" sideOffset={4}>
57
57
  {#if canRename}
58
58
  <DropdownMenu.Item onclick={() => handleAction('rename')}>
59
- <IconPencil class="stroke-[1.333]" />
59
+ <IconPencil class="stroke-2" />
60
60
  {$t('action.rename')}
61
61
  </DropdownMenu.Item>
62
62
  {/if}
63
63
  {#if canDownload}
64
64
  <DropdownMenu.Item onclick={() => handleAction('download')}>
65
- <IconDownload class="stroke-[1.333]" />
65
+ <IconDownload class="stroke-2" />
66
66
  {$t('action.download')}
67
67
  </DropdownMenu.Item>
68
68
  {/if}
69
69
  {#if canMove}
70
70
  <DropdownMenu.Item onclick={() => handleAction('move')}>
71
- <IconArrowsMove class="stroke-[1.333]" />
71
+ <IconArrowsMove class="stroke-2" />
72
72
  {$t('action.move')}
73
73
  </DropdownMenu.Item>
74
74
  {/if}
@@ -80,7 +80,7 @@
80
80
  class="text-destructive data-highlighted:text-destructive"
81
81
  onclick={() => handleAction('delete')}
82
82
  >
83
- <IconTrash class="stroke-[1.333]" />
83
+ <IconTrash class="stroke-2" />
84
84
  {$t('action.delete')}
85
85
  </DropdownMenu.Item>
86
86
  {/if}
@@ -83,8 +83,8 @@
83
83
  const SQUARE_CLASSES = { lg: 'size-12', md: 'size-10', sm: 'size-8' } as const;
84
84
  const ICON_CLASSES = {
85
85
  lg: 'size-5 stroke-[1.667]',
86
- md: 'size-4 stroke-[1.333]',
87
- sm: 'size-4 stroke-[1.333]'
86
+ md: 'size-4 stroke-2',
87
+ sm: 'size-4 stroke-2'
88
88
  } as const;
89
89
  const GLYPH_CLASSES = {
90
90
  lg: 'text-heading-page',
@@ -477,13 +477,15 @@
477
477
  },
478
478
  {
479
479
  "id": "file_pqr844",
480
- "name": "celebration.mp4",
480
+ "name": "image 30.jpg",
481
481
  "type": "file",
482
- "size": 150000000,
482
+ "size": 2400000,
483
+ "width": 1024,
484
+ "height": 683,
483
485
  "modified": "2023-09-24T16:30:00Z",
484
- "url": "video/video-file.mp4",
485
- "thumbnail": "video/video-file.png",
486
- "hash": "AE F7 09 06 80 A6 F9 6B 8B 88 76 AE 77 72 76 98 76 99 AE 8D D0 A9 08"
486
+ "url": "image/image 30.jpg",
487
+ "thumbnail": "thumbnail/image 30.jpg",
488
+ "hash": "C4 B7 05 05 80 F5 1A C7 7E 76 89 83 83 8C A6 86 05 71 7A 12 F8"
487
489
  },
488
490
  {
489
491
  "id": "folder_stu910",
@@ -1156,15 +1158,15 @@
1156
1158
  },
1157
1159
  {
1158
1160
  "id": "file_stu364",
1159
- "name": "image 28.jpg",
1161
+ "name": "image 29.jpg",
1160
1162
  "type": "file",
1161
- "size": 3150000,
1163
+ "size": 3050000,
1162
1164
  "width": 1024,
1163
1165
  "height": 683,
1164
- "modified": "2024-09-27T11:45:00Z",
1165
- "url": "image/image 28.jpg",
1166
- "thumbnail": "thumbnail/image 28.jpg",
1167
- "hash": "55 38 06 15 86 72 96 58 9F 56 A5 49 B7 C6 46 94 FA 9B BC AF C9"
1166
+ "modified": "2024-09-27T11:50:00Z",
1167
+ "url": "image/image 29.jpg",
1168
+ "thumbnail": "thumbnail/image 29.jpg",
1169
+ "hash": "E2 B7 05 05 80 F5 1A C7 7E 76 89 83 83 8C A6 86 05 71 7A 12 F9"
1168
1170
  }
1169
1171
  ]
1170
1172
  }
@@ -230,7 +230,6 @@ export declare const FILE_BROWSER_MESSAGES: {
230
230
  readonly 'selectedFiles.count': "{count, plural, one {# file selected} other {# files selected}}";
231
231
  readonly 'selectedFiles.confirmMany': "{count, plural, one {Use # file} other {Use # files}}";
232
232
  readonly 'selectedFiles.remove': "Remove from selection";
233
- readonly 'searchModal.placeholder': "Search files and folders…";
234
233
  readonly 'searchModal.jumpToFolder': "Jump to folder";
235
234
  readonly 'searchModal.empty': "No files found";
236
235
  readonly 'searchModal.clearQuery': "Clear search";
@@ -242,7 +242,6 @@ export const FILE_BROWSER_MESSAGES = {
242
242
  'selectedFiles.confirmMany': '{count, plural, one {Use # file} other {Use # files}}',
243
243
  'selectedFiles.remove': 'Remove from selection',
244
244
  // ===== Search window =====
245
- 'searchModal.placeholder': 'Search files and folders…',
246
245
  'searchModal.jumpToFolder': 'Jump to folder',
247
246
  'searchModal.empty': 'No files found',
248
247
  'searchModal.clearQuery': 'Clear search',
@@ -5,7 +5,7 @@ export declare const fileStore: {
5
5
  update: (this: void, updater: import("svelte/store").Updater<FileSystemRoot>) => void;
6
6
  };
7
7
  export declare const currentFolder: import("svelte/store").Writable<string[]>;
8
- export declare const sortCriteria: import("svelte/store").Writable<"name" | "date" | "size">;
8
+ export declare const sortCriteria: import("svelte/store").Writable<"name" | "size" | "date">;
9
9
  export declare const sortDirection: import("svelte/store").Writable<"desc" | "asc">;
10
10
  export declare const selectedFiles: import("svelte/store").Writable<FileSystemItem[]>;
11
11
  export declare const fileFilter: import("svelte/store").Writable<string[]>;
@@ -13,7 +13,7 @@ export declare const fileFilter: import("svelte/store").Writable<string[]>;
13
13
  * Derived store that automatically sorts files based on criteria
14
14
  * Maintains folder priority (folders always appear before files)
15
15
  */
16
- export declare const sortedFiles: import("svelte/store").Readable<any>;
16
+ export declare const sortedFiles: import("svelte/store").Readable<FileSystemRoot>;
17
17
  /**
18
18
  * Initializes or updates the file store with new data
19
19
  * Includes validation and error handling
@@ -1,5 +1,5 @@
1
1
  import { currentFolder } from './fileStore';
2
- export declare const currentPathNames: import("svelte/store").Readable<any>;
2
+ export declare const currentPathNames: import("svelte/store").Readable<string[]>;
3
3
  export { currentFolder };
4
4
  export declare const navigationActions: import("svelte/store").Writable<{
5
5
  navigateToPath: (path: string[]) => void;
@@ -11,6 +11,11 @@ export type NavigationState = {
11
11
  currentIndex: number;
12
12
  };
13
13
  export declare function getStorageKey(instanceId?: string): string;
14
+ /** Shared localStorage id for file pickers inside the Widgetic editor (folder path only, not filter/sort). */
15
+ export declare const WIDGETIC_EDITOR_FILE_PICKER_INSTANCE_ID = "widgetic-editor-file-picker";
16
+ /** Toggles whether this instance may write its folder path to localStorage (set from FileBrowser props). */
17
+ export declare function setPersistFolderPath(instanceId: string, enabled: boolean): void;
18
+ export declare function shouldPersistFolderPath(instanceId: string): boolean;
14
19
  declare function createNavigationStore(instanceId?: string): {
15
20
  subscribe: (this: void, run: import("svelte/store").Subscriber<NavigationState>, invalidate?: () => void) => import("svelte/store").Unsubscriber;
16
21
  navigateToFolder: (newPath: string[], forceNavigation?: boolean) => void;