@dosgato/dialog 1.3.6 → 1.3.8

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.
@@ -346,11 +346,10 @@
346
346
  display: flex;
347
347
  align-items: flex-start;
348
348
  gap: 1em;
349
- padding: 1em;
350
349
  }
351
350
 
352
351
  .asset-chooser-container .preview-container {
353
- width: 20%;
352
+ width: 30%;
354
353
  }
355
354
 
356
355
  .asset-chooser-container .preview-container :global(.dialog-chooser-thumbnail) {
@@ -368,6 +367,7 @@
368
367
  flex: 1;
369
368
  border: 1px solid var(--dg-dialog-header-bg, #ddd);
370
369
  border-radius: 4px;
370
+ font-size: 0.9em;
371
371
  }
372
372
 
373
373
  .asset-chooser-container .detail-container .file-name {
@@ -23,6 +23,8 @@
23
23
 
24
24
  $: isImage = selectedAsset?.image !== undefined
25
25
 
26
+ $: useTabs = (isImage && altTextPath) || showMetadata
27
+
26
28
  $: tabs = [
27
29
  ...(isImage && altTextPath ? [{ id: `${id}-alttext`, label: 'Alternate Text' }] : []),
28
30
  { id: `${id}-details`, label: 'Asset Details' },
@@ -69,35 +71,37 @@
69
71
  }
70
72
  </script>
71
73
 
72
- <ul bind:this={tabListEl} class="tabs" role="tablist">
73
- {#each tabs as tab, idx}
74
- <li
75
- id="{tab.id}-tab"
76
- class="tab {activeTab === tab.id ? 'active' : ''}"
77
- role="tab"
78
- aria-selected={activeTab === tab.id}
79
- aria-controls={tab.id}
80
- tabindex={focusedTabIdx === idx ? 0 : -1}
81
- data-tab-asset
82
- on:click={() => selectTab(tab.id)}
83
- on:keydown={(e) => onTabKeydown(e, idx)}
84
- on:focus={() => { focusedTabIdx = idx }}
85
- >
86
- <span>{tab.label}</span>
87
- </li>
88
- {/each}
89
- </ul>
74
+ {#if useTabs}
75
+ <ul bind:this={tabListEl} class="tabs" role="tablist">
76
+ {#each tabs as tab, idx}
77
+ <li
78
+ id="{tab.id}-tab"
79
+ class="tab {activeTab === tab.id ? 'active' : ''}"
80
+ role="tab"
81
+ aria-selected={activeTab === tab.id}
82
+ aria-controls={tab.id}
83
+ tabindex={focusedTabIdx === idx ? 0 : -1}
84
+ data-tab-asset
85
+ on:click={() => selectTab(tab.id)}
86
+ on:keydown={(e) => onTabKeydown(e, idx)}
87
+ on:focus={() => { focusedTabIdx = idx }}
88
+ >
89
+ <span>{tab.label}</span>
90
+ </li>
91
+ {/each}
92
+ </ul>
90
93
 
91
- {#if activeTab === `${id}-alttext`}
92
- <div id={`${id}-alttext`} class="tab-content" role="tabpanel" aria-labelledby="{id}-alttext-tab">
93
- {#if altTextPath}<FieldTextArea required={altTextRequired} path={altTextPath} label="Alt. Text" helptext="Describes the asset for visually-impaired users and search engines."/>{/if}
94
- </div>
94
+ {#if activeTab === `${id}-alttext`}
95
+ <div id={`${id}-alttext`} class="tab-content" role="tabpanel" aria-labelledby="{id}-alttext-tab">
96
+ {#if altTextPath}<FieldTextArea required={altTextRequired} path={altTextPath} label="Alt. Text" helptext="Describes the asset for visually-impaired users and search engines."/>{/if}
97
+ </div>
98
+ {/if}
95
99
  {/if}
96
- {#if activeTab === `${id}-details`}
100
+ {#if activeTab === `${id}-details` || !useTabs}
97
101
  <div id={`${id}-details`} class="tab-content" role="tabpanel" aria-labelledby="{id}-details-tab">
98
102
  <div class="details">
99
103
  <div class="path">
100
- <span class="chooser-label">Assets Path:</span>
104
+ <span class="chooser-label">Path:</span>
101
105
  <span class="chooser-data">{selectedAsset.path}</span>
102
106
  </div>
103
107
  {#if selectedAsset.image}
@@ -105,7 +105,7 @@
105
105
  {/if}
106
106
  </section>
107
107
  <ChooserPreview {thumbnailExpanded} {previewId} {store} on:thumbnailsizechange={() => { thumbnailExpanded = !thumbnailExpanded }}/>
108
- {#if showAltTextOption && $preview && $preview.type === 'asset' && $preview.image}
108
+ {#if showAltTextOption}
109
109
  <section class="alt-text-options">
110
110
  <label>
111
111
  <input bind:this={altTextCheckbox} type="checkbox" />
@@ -129,7 +129,7 @@
129
129
  <style>
130
130
  .dialog-chooser-window {
131
131
  position: relative;
132
- height: 80vh;
132
+ height: 75vh;
133
133
  display: flex;
134
134
  flex-wrap: wrap;
135
135
  align-items: stretch;
@@ -139,7 +139,7 @@
139
139
  container-name: dosgato-dialog-chooser-window
140
140
  }
141
141
  .dialog-chooser-window.no-controls {
142
- height: 85vh;
142
+ height: 80vh;
143
143
  }
144
144
  .dialog-chooser-window * {
145
145
  box-sizing: border-box;
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": "1.3.6",
4
+ "version": "1.3.8",
5
5
  "scripts": {
6
6
  "prepublishOnly": "svelte-package",
7
7
  "dev": "vite dev --force",