@widgetic/file-browser 0.5.34 → 0.5.35

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.
@@ -2803,8 +2803,9 @@ mainGridClass="app-main-grid"
2803
2803
  <Tooltip.Portal>
2804
2804
  <Tooltip.Content
2805
2805
  side="top"
2806
+ align="end"
2806
2807
  sideOffset={8}
2807
- class="sort-order-tooltip !bg-[hsl(var(--deep-forest-green))] !text-white z-[99999] border-0"
2808
+ class="sort-order-tooltip whitespace-pre-line text-center !bg-[hsl(var(--deep-forest-green))] !text-white z-[99999] border-0"
2808
2809
  >
2809
2810
  {$sortDirection === 'asc' ? $t('sort.orderDescending') : $t('sort.orderAscending')}
2810
2811
  </Tooltip.Content>
@@ -131,9 +131,17 @@
131
131
  </div>
132
132
  </Tooltip.Trigger>
133
133
  {#if showSelectedFilesTooltip}
134
- <Tooltip.Content side="bottom" sideOffset={6} class="bg-[hsl(var(--dark))] text-white caption px-2 py-1 rounded-md z-[200000]">
135
- {$t('selectedFiles.title')}
136
- </Tooltip.Content>
134
+ <!-- Portaled out of the header: the library box clips a tip that hangs past its right edge. -->
135
+ <Tooltip.Portal>
136
+ <Tooltip.Content
137
+ side="bottom"
138
+ align="end"
139
+ sideOffset={6}
140
+ class="selected-files-tooltip bg-[hsl(var(--dark))] text-white caption px-2 py-1 rounded-md z-[200000]"
141
+ >
142
+ {$t('selectedFiles.title')}
143
+ </Tooltip.Content>
144
+ </Tooltip.Portal>
137
145
  {/if}
138
146
  </Tooltip.Root>
139
147
  </Tooltip.Provider>
@@ -54,8 +54,15 @@
54
54
 
55
55
  // The preview sits in the file browser, not in the whole window. Measuring the window first
56
56
  // paints the card at the site's width, then the portal shrinks it to this box.
57
+ // The preview is portaled into the library. In the CDN module that library sits in a shadow root,
58
+ // which document.querySelector cannot see, so a measure from the window sizes the picture too tall
59
+ // and the library box cuts the bottom off.
60
+ let measureFrom: HTMLElement | undefined;
61
+
57
62
  function hostFrame() {
58
- const host = document.querySelector(`.${target}`) || document.querySelector('.file-browser-module');
63
+ const rootNode = measureFrom?.getRootNode();
64
+ const scope = rootNode instanceof ShadowRoot ? rootNode : document;
65
+ const host = scope.querySelector(`.${target}`) || scope.querySelector('.file-browser-module');
59
66
  const width = host instanceof HTMLElement && host.clientWidth > 0 ? host.clientWidth : window.innerWidth;
60
67
  const height = host instanceof HTMLElement && host.clientHeight > 0 ? host.clientHeight : window.innerHeight;
61
68
  return { width, height };
@@ -417,6 +424,7 @@
417
424
  on:spaceKey={() => dispatch('select', file)}
418
425
  >
419
426
  <!-- Preview Content Area -->
427
+ <div bind:this={measureFrom} style="display: contents">
420
428
  {#if !hasValidUrl || $missingFiles.has(file.id)}
421
429
  <ErrorPreview />
422
430
  {:else if fileType === 'font'}
@@ -499,6 +507,7 @@
499
507
 
500
508
  <!-- File Metadata Display -->
501
509
  <!-- <FileMetadata {file} /> -->
510
+ </div>
502
511
  </BaseModal>
503
512
 
504
513
  <style>
@@ -54,8 +54,8 @@ export declare const FILE_BROWSER_MESSAGES: {
54
54
  readonly 'filterOption.font': "Fonts";
55
55
  readonly 'filterOption.svg': "SVG";
56
56
  readonly 'sort.by': "Sort by";
57
- readonly 'sort.orderAscending': "Click to order Ascending";
58
- readonly 'sort.orderDescending': "Click to order Descending";
57
+ readonly 'sort.orderAscending': "Click to order\nAscending";
58
+ readonly 'sort.orderDescending': "Click to order\nDescending";
59
59
  readonly 'sort.name': "Name";
60
60
  readonly 'sort.date': "Date";
61
61
  readonly 'sort.size': "Size";
@@ -56,8 +56,8 @@ export const FILE_BROWSER_MESSAGES = {
56
56
  'filterOption.font': 'Fonts',
57
57
  'filterOption.svg': 'SVG',
58
58
  'sort.by': 'Sort by',
59
- 'sort.orderAscending': 'Click to order Ascending',
60
- 'sort.orderDescending': 'Click to order Descending',
59
+ 'sort.orderAscending': 'Click to order\nAscending',
60
+ 'sort.orderDescending': 'Click to order\nDescending',
61
61
  'sort.name': 'Name',
62
62
  'sort.date': 'Date',
63
63
  'sort.size': 'Size',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@widgetic/file-browser",
3
- "version": "0.5.34",
3
+ "version": "0.5.35",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "type": "module",
6
6
  "repository": {