@widgetic/editor 4.1.17 → 4.1.19
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/PreviewChromeControls.svelte +2 -2
- package/dist/components/WidgetPreview.svelte +79 -16
- package/dist/components/editors/CompositionEditorApp.svelte +71 -35
- package/dist/components/editors/CompositionEditorApp.svelte.d.ts +3 -1
- package/dist/components/editors/ContentTabBulkDrop.svelte +268 -0
- package/dist/components/editors/ContentTabBulkDrop.svelte.d.ts +37 -0
- package/dist/components/editors/EmbedAssistantPanel.svelte +303 -0
- package/dist/components/editors/EmbedAssistantPanel.svelte.d.ts +29 -0
- package/dist/components/editors/EmbedEditor.svelte +221 -15
- package/dist/components/editors/EmbedEditor.svelte.d.ts +31 -3
- package/dist/components/editors/PropsEditor.svelte +326 -37
- package/dist/components/editors/PropsEditor.svelte.d.ts +11 -0
- package/dist/components/editors/propsEditorContentStateFlatten.d.ts +12 -0
- package/dist/components/editors/propsEditorContentStateFlatten.js +40 -0
- package/dist/components/ic/AngleInputController.svelte +9 -5
- package/dist/components/ic/BrowserInputController.svelte +208 -132
- package/dist/components/ic/BrowserInputController.svelte.d.ts +2 -0
- package/dist/components/ic/CheckboxInputController.svelte +11 -0
- package/dist/components/ic/ColorPickerInputController.svelte +122 -49
- package/dist/components/ic/DatePickerInputController.svelte +23 -13
- package/dist/components/ic/FixedPositionInputController.svelte +1 -1
- package/dist/components/ic/FontInputController.svelte +48 -47
- package/dist/components/ic/InputControllerHeader.svelte +5 -4
- package/dist/components/ic/KnowledgeDocumentsInputController.svelte +20 -7
- package/dist/components/ic/NumberControls.svelte +163 -35
- package/dist/components/ic/PositionInputController.svelte +24 -15
- package/dist/components/ic/RadioGroupInputController.svelte +11 -0
- package/dist/components/ic/RangeCalendarInputController.svelte +73 -28
- package/dist/components/ic/RoundedCornersInputController.svelte +2 -2
- package/dist/components/ic/SliderInputController.svelte +11 -4
- package/dist/components/ic/TextAreaInputController.svelte +620 -327
- package/dist/components/ic/TextAreaPreviewInputController.svelte +53 -64
- package/dist/components/ic/TextInputController.svelte +15 -2
- package/dist/components/ic/TimeInputController.svelte +1 -1
- package/dist/components/ic/VectorInputController.svelte +152 -20
- package/dist/components/ic/numberControlsValueArea.d.ts +29 -0
- package/dist/components/ic/numberControlsValueArea.js +51 -0
- package/dist/components/ic/optionGroupCardPointerDown.d.ts +9 -0
- package/dist/components/ic/optionGroupCardPointerDown.js +20 -0
- package/dist/components/ic/shared/DropdownChevron.svelte +2 -2
- package/dist/components/ic/shared/DropdownChevron.svelte.d.ts +1 -1
- package/dist/components/ic/shared/EditorFileBrowserOverlay.svelte +174 -0
- package/dist/components/ic/shared/EditorFileBrowserOverlay.svelte.d.ts +30 -0
- package/dist/components/ic/shared/EditorSelectedFilePreviewOverlay.svelte +34 -0
- package/dist/components/ic/shared/EditorSelectedFilePreviewOverlay.svelte.d.ts +24 -0
- package/dist/components/ic/shared/ItemGrid.svelte +2 -2
- package/dist/components/ic/shared/RecentItemsSection.svelte +6 -6
- package/dist/components/ic/shared/editableFieldClasses.d.ts +15 -0
- package/dist/components/ic/shared/editableFieldClasses.js +15 -0
- package/dist/components/ic/shared/fileBrowserOverlayEscape.d.ts +29 -0
- package/dist/components/ic/shared/fileBrowserOverlayEscape.js +21 -0
- package/dist/components/ic/shared/index.d.ts +1 -0
- package/dist/components/ic/shared/index.js +1 -0
- package/dist/components/ui/calendar-editor-fit/EditorCalendarStyles.svelte +41 -9
- package/dist/composition/compositionApi.d.ts +16 -0
- package/dist/composition/compositionApi.js +16 -1
- package/dist/composition/compositionEditorController.d.ts +46 -0
- package/dist/composition/compositionEditorController.js +277 -5
- package/dist/composition/compositionEditorSchemaCache.d.ts +35 -0
- package/dist/composition/compositionEditorSchemaCache.js +82 -0
- package/dist/contentBulkDrop/applyContentPlan.d.ts +18 -0
- package/dist/contentBulkDrop/applyContentPlan.js +55 -0
- package/dist/contentBulkDrop/bulkDropSummary.d.ts +4 -0
- package/dist/contentBulkDrop/bulkDropSummary.js +12 -0
- package/dist/contentBulkDrop/dragIntent.d.ts +7 -0
- package/dist/contentBulkDrop/dragIntent.js +24 -0
- package/dist/contentBulkDrop/filterDropFiles.d.ts +2 -0
- package/dist/contentBulkDrop/filterDropFiles.js +21 -0
- package/dist/contentBulkDrop/formatFileSize.d.ts +2 -0
- package/dist/contentBulkDrop/formatFileSize.js +13 -0
- package/dist/contentBulkDrop/types.d.ts +34 -0
- package/dist/contentBulkDrop/types.js +1 -0
- package/dist/contentBulkDrop/uploadQueue.d.ts +41 -0
- package/dist/contentBulkDrop/uploadQueue.js +114 -0
- package/dist/drafts/compositionDraft.d.ts +65 -0
- package/dist/drafts/compositionDraft.js +136 -0
- package/dist/drafts/compositionEditorViewState.d.ts +9 -0
- package/dist/drafts/compositionEditorViewState.js +33 -0
- package/dist/drafts/draftJournal.d.ts +59 -0
- package/dist/drafts/draftJournal.js +261 -0
- package/dist/embed/__fixtures__/gatewayGeneratedEmbedCodes.json +25 -0
- package/dist/embed/__fixtures__/generatedEmbedCodes.json +320 -0
- package/dist/embed/parseCompositionEmbedCode.d.ts +21 -0
- package/dist/embed/parseCompositionEmbedCode.js +376 -0
- package/dist/embedAssistant/embedAssistantEvents.d.ts +22 -0
- package/dist/embedAssistant/embedAssistantEvents.js +39 -0
- package/dist/embedAssistant/embedAssistantStream.d.ts +30 -0
- package/dist/embedAssistant/embedAssistantStream.js +125 -0
- package/dist/embedAssistant/highlightTiming.d.ts +1 -0
- package/dist/embedAssistant/highlightTiming.js +6 -0
- package/dist/embedAssistant/types.d.ts +27 -0
- package/dist/embedAssistant/types.js +1 -0
- package/dist/i18n/labels.js +8 -4
- package/dist/i18n/language.d.ts +297 -3
- package/dist/i18n/messages.d.ts +38 -1
- package/dist/i18n/messages.js +40 -1
- package/dist/i18n/translate.d.ts +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +2 -0
- package/dist/utils/FontManager.d.ts +2 -0
- package/dist/utils/FontManager.js +16 -1
- package/dist/utils/angleMath.d.ts +2 -0
- package/dist/utils/angleMath.js +6 -0
- package/dist/utils/isEditableEventTarget.d.ts +5 -0
- package/dist/utils/isEditableEventTarget.js +25 -0
- package/dist/utils/linkUrlValidation.d.ts +17 -0
- package/dist/utils/linkUrlValidation.js +120 -0
- package/dist/utils/mediaFileValue.d.ts +12 -0
- package/dist/utils/mediaFileValue.js +24 -0
- package/dist/utils/placeRichTextCaretAtDocumentEnd.d.ts +11 -0
- package/dist/utils/placeRichTextCaretAtDocumentEnd.js +26 -0
- package/package.json +6 -6
|
@@ -2,6 +2,7 @@ import type { ContentSchemaView, DesignSchemaView } from '../../schemaViews.js';
|
|
|
2
2
|
import { type PartnerPickFileFn } from '../../pickFileContext';
|
|
3
3
|
import { type StoreFileUrlFn } from '../../fileStorageUrlContext';
|
|
4
4
|
import type { MediaLibraryProvider } from '@widgetic/file-browser';
|
|
5
|
+
import type { ContentFromFilesPlan } from '../../contentBulkDrop/types.js';
|
|
5
6
|
/**
|
|
6
7
|
* STYLES from Widgetic Design System
|
|
7
8
|
* Note: props-editor.css global rules (body, *) moved to app.css (standalone only).
|
|
@@ -41,6 +42,7 @@ declare const PropsEditor: $$__sveltets_2_IsomorphicComponent<{
|
|
|
41
42
|
/** True when local edits are not yet persisted. */ saveDirty?: boolean;
|
|
42
43
|
/** True while a save request is in flight. */ saveSaving?: boolean;
|
|
43
44
|
/** Optional content below the shared toolbar, before property fields. */ headerContent?: any;
|
|
45
|
+
/** Bottom padding inside the scroll area (the embed editor, which has no controls below the list, uses 16px / `pb-4`). */ scrollAreaBottomPaddingClass?: string;
|
|
44
46
|
headerClass?: string;
|
|
45
47
|
dragHandleClass?: string;
|
|
46
48
|
title?: string | undefined;
|
|
@@ -48,14 +50,23 @@ declare const PropsEditor: $$__sveltets_2_IsomorphicComponent<{
|
|
|
48
50
|
/** Optional layout wrapper moved by this editor's built-in drag and position API. */ positionTarget?: any;
|
|
49
51
|
initialDesignValues?: Record<string, any>;
|
|
50
52
|
initialContentValues?: Record<string, any>;
|
|
53
|
+
/** Property ids to flash briefly when the embed assistant applies options. */ flashPropertyIds?: string[];
|
|
51
54
|
/**
|
|
52
55
|
* Where the file controls (images, video, audio, documents) get their files from. Without it they show the
|
|
53
56
|
* Widgetic account's uploads, as they always have (configured with `setFileBrowserUploadConfig`). With a
|
|
54
57
|
* `MediaLibraryProvider` they list, upload, rename and delete through its functions instead, so a partner's own
|
|
55
58
|
* storage (a CMS, an S3 bucket, a DAM) can be used with no Widgetic storage at all.
|
|
56
59
|
*/ mediaLibrary?: MediaLibraryProvider | undefined;
|
|
60
|
+
/** Calls POST /compositions/:id/content-items/from-files (plan only). Wired by CompositionEditorApp. */ requestContentFromFilesPlan?: ((files: Array<{
|
|
61
|
+
name: string;
|
|
62
|
+
mimeType: string;
|
|
63
|
+
sizeBytes?: number;
|
|
64
|
+
mediaId: string;
|
|
65
|
+
}>) => Promise<ContentFromFilesPlan>) | undefined;
|
|
57
66
|
/** When given, file fields call this instead of opening the built-in File Browser. */ pickFile?: PartnerPickFileFn | undefined;
|
|
58
67
|
/** When given, resolves the url stored with a picked file (partner `mediaLibrary.urlResolver`). */ storeFileUrl?: StoreFileUrlFn | undefined;
|
|
68
|
+
/** When set (composition id), tab, scroll, accordions and open content cards persist in sessionStorage. */ viewStatePersistenceKey?: string | undefined;
|
|
69
|
+
/** Device preview mode, stored with the props-panel view state by the composition editor shell. */ persistedDeviceView?: "desktop" | "mobile";
|
|
59
70
|
updateDesignValue?: (propertyId: string, value: any) => void;
|
|
60
71
|
setPosition?: (left: number, top: number) => void;
|
|
61
72
|
getPosition?: () => {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ContentSchemaView } from '../../schemaViews.js';
|
|
2
|
+
export type ContentStateValue = string | number | boolean | Record<string, unknown> | null;
|
|
3
|
+
/** True for the flat `itemId__prop` keys the input controllers of a content item read and write. */
|
|
4
|
+
export declare function isItemFieldStateKey(stateKey: string): boolean;
|
|
5
|
+
/**
|
|
6
|
+
* Maps parent `initialContentValues` (with nested `items`) into flat `itemId__prop` state keys
|
|
7
|
+
* used by input controllers inside PropsEditor.
|
|
8
|
+
*
|
|
9
|
+
* `transformItemValue` runs on every item field value on its way into the flat map (the editor passes the one that
|
|
10
|
+
* rebuilds a full file reference from what the parent echoes back).
|
|
11
|
+
*/
|
|
12
|
+
export declare function flattenContentStateFromParent(initial: Record<string, ContentStateValue> | undefined, schema: ContentSchemaView | undefined, transformItemValue?: (value: ContentStateValue) => ContentStateValue): Record<string, ContentStateValue>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/** Separator between an item id and a property id in the flat state keys (`itemId__prop`). */
|
|
2
|
+
const ITEM_FIELD_KEY_SEPARATOR = '__';
|
|
3
|
+
/** True for the flat `itemId__prop` keys the input controllers of a content item read and write. */
|
|
4
|
+
export function isItemFieldStateKey(stateKey) {
|
|
5
|
+
return stateKey.includes(ITEM_FIELD_KEY_SEPARATOR);
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Maps parent `initialContentValues` (with nested `items`) into flat `itemId__prop` state keys
|
|
9
|
+
* used by input controllers inside PropsEditor.
|
|
10
|
+
*
|
|
11
|
+
* `transformItemValue` runs on every item field value on its way into the flat map (the editor passes the one that
|
|
12
|
+
* rebuilds a full file reference from what the parent echoes back).
|
|
13
|
+
*/
|
|
14
|
+
export function flattenContentStateFromParent(initial, schema, transformItemValue = (value) => value) {
|
|
15
|
+
const flat = {};
|
|
16
|
+
if (!initial || typeof initial !== 'object')
|
|
17
|
+
return flat;
|
|
18
|
+
for (const [key, value] of Object.entries(initial)) {
|
|
19
|
+
if (key === 'items' || key === 'contentItemsSnapshot')
|
|
20
|
+
continue;
|
|
21
|
+
flat[key] = value;
|
|
22
|
+
}
|
|
23
|
+
const items = initial.items;
|
|
24
|
+
if (items && Array.isArray(schema?.contentItems)) {
|
|
25
|
+
for (const item of schema.contentItems) {
|
|
26
|
+
const itemValues = items[item.id];
|
|
27
|
+
if (!itemValues)
|
|
28
|
+
continue;
|
|
29
|
+
for (const prop of item.properties || []) {
|
|
30
|
+
const propKey = prop.id || prop.name;
|
|
31
|
+
if (propKey == null)
|
|
32
|
+
continue;
|
|
33
|
+
if (itemValues[propKey] !== undefined) {
|
|
34
|
+
flat[`${item.id}${ITEM_FIELD_KEY_SEPARATOR}${propKey}`] = transformItemValue(itemValues[propKey]);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return flat;
|
|
40
|
+
}
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
import { onDestroy } from 'svelte';
|
|
25
25
|
import InputControllerRow from './InputControllerRow.svelte';
|
|
26
26
|
import NumberControls from './NumberControls.svelte';
|
|
27
|
+
import { normalizeAngleDegrees } from '../../utils/angleMath';
|
|
27
28
|
|
|
28
29
|
export let label: AngleInputControllerProps['label'];
|
|
29
30
|
export let value: AngleInputControllerProps['value'] = 0;
|
|
@@ -40,9 +41,12 @@
|
|
|
40
41
|
let startValue = 0;
|
|
41
42
|
|
|
42
43
|
// Configuration with defaults
|
|
43
|
-
$: min = config.min
|
|
44
|
-
$: max = config.max
|
|
45
|
-
$: step = config.step
|
|
44
|
+
$: min = config.min ?? 0;
|
|
45
|
+
$: max = config.max ?? 360;
|
|
46
|
+
$: step = config.step ?? 1;
|
|
47
|
+
|
|
48
|
+
/** Needle rotation must treat 0° as valid (never skip with falsy checks). */
|
|
49
|
+
$: displayAngleDegrees = normalizeAngleDegrees(value);
|
|
46
50
|
|
|
47
51
|
// Keep input value in sync with value prop
|
|
48
52
|
$: {
|
|
@@ -181,14 +185,14 @@
|
|
|
181
185
|
<!-- Sized in scoped CSS: with only w-0.5 + bg-primary, measure.mjs reported background transparent until width/height are explicit. -->
|
|
182
186
|
<div
|
|
183
187
|
class="angle-dial-needle pointer-events-none absolute top-1/2 start-1/2 origin-bottom bg-primary"
|
|
184
|
-
style="transform: translate(-50%, -100%) rotate({
|
|
188
|
+
style="transform: translate(-50%, -100%) rotate({displayAngleDegrees}deg)"
|
|
185
189
|
></div>
|
|
186
190
|
</div>
|
|
187
191
|
|
|
188
192
|
<NumberControls
|
|
189
193
|
class="min-w-0 flex-1"
|
|
190
194
|
surfacePaddingClass="pe-1.5"
|
|
191
|
-
|
|
195
|
+
bind:value
|
|
192
196
|
{onChange}
|
|
193
197
|
{min}
|
|
194
198
|
{max}
|
|
@@ -5,7 +5,9 @@
|
|
|
5
5
|
id: string;
|
|
6
6
|
file: string;
|
|
7
7
|
url: string;
|
|
8
|
-
hash?: string;
|
|
8
|
+
hash?: string;
|
|
9
|
+
thumbnail?: string;
|
|
10
|
+
mimeType?: string;
|
|
9
11
|
}
|
|
10
12
|
|
|
11
13
|
/** Declared props contract — export lets below are annotated from it so the
|
|
@@ -32,13 +34,9 @@
|
|
|
32
34
|
import { onDestroy, tick } from 'svelte';
|
|
33
35
|
|
|
34
36
|
// Shadcn UI Components
|
|
35
|
-
import {
|
|
37
|
+
import { Tooltip, showToast } from '@widgetic/design-system/components';
|
|
36
38
|
import { ThumbHashImage } from '@widgetic/design-system/components';
|
|
37
|
-
import {
|
|
38
|
-
FileBrowser,
|
|
39
|
-
setFileBrowserUploadConfig,
|
|
40
|
-
persistentSelectStore
|
|
41
|
-
} from '@widgetic/file-browser';
|
|
39
|
+
import { setFileBrowserUploadConfig, persistentSelectStore } from '@widgetic/file-browser';
|
|
42
40
|
import { useEditorMediaLibrary } from '../../mediaLibraryContext';
|
|
43
41
|
import { useEditorPickFile, type PartnerPickFile } from '../../pickFileContext';
|
|
44
42
|
import { useEditorStoreFileUrl } from '../../fileStorageUrlContext';
|
|
@@ -56,8 +54,13 @@
|
|
|
56
54
|
} from '@widgetic/design-system/icons';
|
|
57
55
|
import MediaManager from '../../utils/MediaManager';
|
|
58
56
|
import { queryInTreeOf } from '../../utils/shadowDom';
|
|
57
|
+
import { filesFromDataTransfer } from '../../contentBulkDrop/filterDropFiles.js';
|
|
58
|
+
import { dragCarriesFiles } from '../../contentBulkDrop/dragIntent.js';
|
|
59
59
|
|
|
60
60
|
import InputControllerRow from './InputControllerRow.svelte';
|
|
61
|
+
import EditorFileBrowserOverlay from './shared/EditorFileBrowserOverlay.svelte';
|
|
62
|
+
import EditorSelectedFilePreviewOverlay from './shared/EditorSelectedFilePreviewOverlay.svelte';
|
|
63
|
+
import type { FileSystemItem } from '@widgetic/file-browser';
|
|
61
64
|
|
|
62
65
|
// Component props with default values
|
|
63
66
|
export let header: BrowserInputControllerProps['header'] = undefined;
|
|
@@ -66,10 +69,6 @@
|
|
|
66
69
|
export let onChange: BrowserInputControllerProps['onChange'] = () => {};
|
|
67
70
|
export let portalTarget: BrowserInputControllerProps['portalTarget'] = 'portal-element';
|
|
68
71
|
|
|
69
|
-
/** Full-panel overlay when portaled to props-editor panel (not document body). */
|
|
70
|
-
$: fillEditorPanel =
|
|
71
|
-
portalTarget === 'props-editor-file-browser-portal' ||
|
|
72
|
-
(portalTarget instanceof HTMLElement && portalTarget.id === 'props-editor-file-browser-portal');
|
|
73
72
|
export let config: BrowserInputControllerProps['config'] = {};
|
|
74
73
|
|
|
75
74
|
// The media library the editor above was given (a partner's own storage, for instance), read through a getter
|
|
@@ -78,9 +77,11 @@
|
|
|
78
77
|
const getEditorPickFile = useEditorPickFile();
|
|
79
78
|
const getEditorStoreFileUrl = useEditorStoreFileUrl();
|
|
80
79
|
let pickAbortController: AbortController | null = null;
|
|
80
|
+
let fieldFileDragDepth = 0;
|
|
81
|
+
let fieldFileDragActive = false;
|
|
81
82
|
|
|
82
|
-
// The words of the editor in the language of the page
|
|
83
|
-
const { t
|
|
83
|
+
// The words of the editor in the language of the page
|
|
84
|
+
const { t } = useEditorLanguage();
|
|
84
85
|
|
|
85
86
|
// Extract allowed file types from config or default to all files
|
|
86
87
|
const fileTypes = config.fileTypes || ['*'];
|
|
@@ -97,6 +98,8 @@
|
|
|
97
98
|
let isChecking = true;
|
|
98
99
|
let hasError = false;
|
|
99
100
|
let isFileBrowserOpen = false;
|
|
101
|
+
let isSelectedFilePreviewOpen = false;
|
|
102
|
+
let selectedPreviewRestoreFocus: HTMLElement | null = null;
|
|
100
103
|
|
|
101
104
|
let mouseX = 0;
|
|
102
105
|
let mouseY = 0;
|
|
@@ -161,17 +164,92 @@
|
|
|
161
164
|
* @param path - File path to analyze
|
|
162
165
|
* @returns File type category or 'unknown'
|
|
163
166
|
*/
|
|
167
|
+
function extensionFromPath(path: string): string {
|
|
168
|
+
const withoutQuery = path.split('?')[0] || path;
|
|
169
|
+
const fileSegment = withoutQuery.split('/').pop() || withoutQuery;
|
|
170
|
+
const dot = fileSegment.lastIndexOf('.');
|
|
171
|
+
return dot >= 0 ? fileSegment.slice(dot + 1).toLowerCase() : '';
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
function getFileTypeFromExtension(
|
|
175
|
+
extension: string
|
|
176
|
+
): 'image' | 'video' | 'audio' | 'document' | 'unknown' {
|
|
177
|
+
if (['jpg', 'jpeg', 'png', 'gif', 'webp', 'svg', 'avif', 'heic', 'heif'].includes(extension)) {
|
|
178
|
+
return 'image';
|
|
179
|
+
}
|
|
180
|
+
if (['mp4', 'webm', 'ogg', 'mov'].includes(extension)) return 'video';
|
|
181
|
+
if (['mp3', 'wav', 'ogg', 'aac', 'm4a'].includes(extension)) return 'audio';
|
|
182
|
+
if (['pdf', 'doc', 'docx', 'txt', 'md', 'csv'].includes(extension)) return 'document';
|
|
183
|
+
return 'unknown';
|
|
184
|
+
}
|
|
185
|
+
|
|
164
186
|
function getFileType(
|
|
165
187
|
path: string | null | undefined
|
|
166
188
|
): 'image' | 'video' | 'audio' | 'document' | 'unknown' {
|
|
167
189
|
if (!path || typeof path !== 'string') return 'unknown';
|
|
190
|
+
return getFileTypeFromExtension(extensionFromPath(path));
|
|
191
|
+
}
|
|
168
192
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
if (
|
|
173
|
-
if (
|
|
174
|
-
|
|
193
|
+
function resolveMediaKind(
|
|
194
|
+
fileValue: string | FileValue | null | undefined
|
|
195
|
+
): 'image' | 'video' | 'audio' | 'document' | 'unknown' {
|
|
196
|
+
if (!fileValue) return 'unknown';
|
|
197
|
+
if (typeof fileValue === 'object' && fileValue.mimeType) {
|
|
198
|
+
const mime = fileValue.mimeType.toLowerCase();
|
|
199
|
+
if (mime.startsWith('image/')) return 'image';
|
|
200
|
+
if (mime.startsWith('video/')) return 'video';
|
|
201
|
+
if (mime.startsWith('audio/')) return 'audio';
|
|
202
|
+
if (mime === 'application/pdf' || mime.startsWith('text/')) return 'document';
|
|
203
|
+
}
|
|
204
|
+
const name = typeof fileValue === 'object' ? fileValue.file || fileValue.url : fileValue;
|
|
205
|
+
const fromName = getFileType(name);
|
|
206
|
+
if (fromName !== 'unknown') return fromName;
|
|
207
|
+
return getFileType(getPreviewUrl(fileValue));
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
function thumbnailDisplayUrl(fileValue: string | FileValue | null | undefined): string {
|
|
211
|
+
if (!fileValue) return '';
|
|
212
|
+
if (typeof fileValue === 'object' && fileValue.thumbnail) return fileValue.thumbnail;
|
|
213
|
+
return getPreviewUrl(fileValue);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
function valueAsPreviewItem(fileValue: FileValue): FileSystemItem {
|
|
217
|
+
return {
|
|
218
|
+
id: fileValue.id,
|
|
219
|
+
name: fileValue.file,
|
|
220
|
+
type: 'file',
|
|
221
|
+
url: fileValue.url,
|
|
222
|
+
thumbnail: fileValue.thumbnail,
|
|
223
|
+
hash: fileValue.hash,
|
|
224
|
+
mimeType: fileValue.mimeType
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
function openSelectedFilePreview(trigger: HTMLElement) {
|
|
229
|
+
if (!value || typeof value !== 'object') return;
|
|
230
|
+
selectedPreviewRestoreFocus = trigger;
|
|
231
|
+
isSelectedFilePreviewOpen = true;
|
|
232
|
+
setPortalHostInteractive(true);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
function closeSelectedFilePreview() {
|
|
236
|
+
isSelectedFilePreviewOpen = false;
|
|
237
|
+
if (!isFileBrowserOpen) setPortalHostInteractive(false);
|
|
238
|
+
const restoreTarget = selectedPreviewRestoreFocus;
|
|
239
|
+
selectedPreviewRestoreFocus = null;
|
|
240
|
+
void tick().then(() => restoreTarget?.focus());
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
function handleThumbnailClick(event: MouseEvent) {
|
|
244
|
+
event.stopPropagation();
|
|
245
|
+
openSelectedFilePreview(event.currentTarget as HTMLElement);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
function handleThumbnailKeydown(event: KeyboardEvent) {
|
|
249
|
+
if (event.key !== 'Enter' && event.key !== ' ') return;
|
|
250
|
+
event.preventDefault();
|
|
251
|
+
event.stopPropagation();
|
|
252
|
+
openSelectedFilePreview(event.currentTarget as HTMLElement);
|
|
175
253
|
}
|
|
176
254
|
|
|
177
255
|
/** Only embedded iframe mode (URL params) sets upload config here; standalone uses parent +page sync. */
|
|
@@ -236,7 +314,9 @@
|
|
|
236
314
|
id: selectedFile.id,
|
|
237
315
|
file: selectedFile.name || '',
|
|
238
316
|
url,
|
|
239
|
-
hash: selectedFile.hash
|
|
317
|
+
hash: selectedFile.hash,
|
|
318
|
+
thumbnail: selectedFile.thumbnail,
|
|
319
|
+
mimeType: selectedFile.mimeType
|
|
240
320
|
};
|
|
241
321
|
value = nextValue;
|
|
242
322
|
onChange(nextValue);
|
|
@@ -303,7 +383,9 @@
|
|
|
303
383
|
id: selectedFile.id,
|
|
304
384
|
name: selectedFile.name || selectedFile.file || '',
|
|
305
385
|
url: selectedFile.url,
|
|
306
|
-
hash: selectedFile.hash
|
|
386
|
+
hash: selectedFile.hash,
|
|
387
|
+
thumbnail: selectedFile.thumbnail,
|
|
388
|
+
mimeType: (selectedFile as { mimeType?: string }).mimeType
|
|
307
389
|
});
|
|
308
390
|
closeFileBrowser();
|
|
309
391
|
} catch (error) {
|
|
@@ -416,6 +498,8 @@
|
|
|
416
498
|
// Update the reactive statement to use trimString
|
|
417
499
|
$: displayLabel = value ? trimString(getFileName(value)) : header?.label || label;
|
|
418
500
|
$: previewUrl = getPreviewUrl(value);
|
|
501
|
+
$: thumbnailUrl = thumbnailDisplayUrl(value);
|
|
502
|
+
$: mediaKind = resolveMediaKind(value);
|
|
419
503
|
|
|
420
504
|
// Add hash extraction helper
|
|
421
505
|
function getThumbHash(value: string | FileValue | null | undefined): string | undefined {
|
|
@@ -557,6 +641,66 @@
|
|
|
557
641
|
if (target.closest('.browser-ic-clear-btn')) return;
|
|
558
642
|
openFileBrowser();
|
|
559
643
|
}
|
|
644
|
+
|
|
645
|
+
function handleFieldFileDragEnter(event: DragEvent) {
|
|
646
|
+
if (!dragCarriesFiles(event.dataTransfer)) return;
|
|
647
|
+
event.preventDefault();
|
|
648
|
+
event.stopPropagation();
|
|
649
|
+
fieldFileDragDepth += 1;
|
|
650
|
+
fieldFileDragActive = true;
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
function handleFieldFileDragOver(event: DragEvent) {
|
|
654
|
+
if (!dragCarriesFiles(event.dataTransfer)) return;
|
|
655
|
+
event.preventDefault();
|
|
656
|
+
event.stopPropagation();
|
|
657
|
+
if (event.dataTransfer) event.dataTransfer.dropEffect = 'copy';
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
function handleFieldFileDragLeave(event: DragEvent) {
|
|
661
|
+
if (!dragCarriesFiles(event.dataTransfer)) return;
|
|
662
|
+
fieldFileDragDepth = Math.max(0, fieldFileDragDepth - 1);
|
|
663
|
+
if (fieldFileDragDepth === 0) fieldFileDragActive = false;
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
async function handleFieldFileDrop(event: DragEvent) {
|
|
667
|
+
if (!dragCarriesFiles(event.dataTransfer)) return;
|
|
668
|
+
event.preventDefault();
|
|
669
|
+
event.stopPropagation();
|
|
670
|
+
fieldFileDragDepth = 0;
|
|
671
|
+
fieldFileDragActive = false;
|
|
672
|
+
const files = filesFromDataTransfer(event.dataTransfer);
|
|
673
|
+
const file = files[0];
|
|
674
|
+
if (!file) return;
|
|
675
|
+
const library = getEditorMediaLibrary();
|
|
676
|
+
if (!library?.upload) {
|
|
677
|
+
showToast('error', $t('editor.file.pickFailed'));
|
|
678
|
+
return;
|
|
679
|
+
}
|
|
680
|
+
pickAbortController?.abort();
|
|
681
|
+
pickAbortController = new AbortController();
|
|
682
|
+
const { signal } = pickAbortController;
|
|
683
|
+
try {
|
|
684
|
+
const uploaded = await library.upload({
|
|
685
|
+
file,
|
|
686
|
+
onProgress: () => {},
|
|
687
|
+
signal
|
|
688
|
+
});
|
|
689
|
+
if (signal.aborted) return;
|
|
690
|
+
await applyPickedFile({
|
|
691
|
+
id: uploaded.id,
|
|
692
|
+
name: uploaded.name,
|
|
693
|
+
url: uploaded.url,
|
|
694
|
+
hash: uploaded.hash,
|
|
695
|
+
thumbnail: uploaded.thumbnail,
|
|
696
|
+
mimeType: uploaded.mimeType
|
|
697
|
+
});
|
|
698
|
+
} catch (error) {
|
|
699
|
+
if (signal.aborted) return;
|
|
700
|
+
console.warn('[BrowserInputController] file drop upload failed:', error);
|
|
701
|
+
showToast('error', $t('editor.file.pickFailed'));
|
|
702
|
+
}
|
|
703
|
+
}
|
|
560
704
|
</script>
|
|
561
705
|
|
|
562
706
|
<!-- IC Browser row: 185×36, one horizontal line (text → thumbnail → remove, or placeholder → browse). -->
|
|
@@ -568,9 +712,14 @@
|
|
|
568
712
|
class="browser-input-controller-field flex h-9 w-full min-w-0 cursor-pointer items-center gap-2 rounded-lg bg-accent ps-3 pe-1 transition-colors duration-fast hover:bg-accent-hover focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background {hasError &&
|
|
569
713
|
previewUrl
|
|
570
714
|
? 'border border-destructive'
|
|
571
|
-
: ''}"
|
|
715
|
+
: ''} {fieldFileDragActive ? 'ring-2 ring-primary ring-inset' : ''}"
|
|
716
|
+
data-content-field-file-drop
|
|
572
717
|
on:click={handleControllerClick}
|
|
573
718
|
on:keydown={(e) => e.key === 'Enter' && openFileBrowser()}
|
|
719
|
+
on:dragenter={handleFieldFileDragEnter}
|
|
720
|
+
on:dragover={handleFieldFileDragOver}
|
|
721
|
+
on:dragleave={handleFieldFileDragLeave}
|
|
722
|
+
on:drop={handleFieldFileDrop}
|
|
574
723
|
role="button"
|
|
575
724
|
tabindex={0}
|
|
576
725
|
>
|
|
@@ -589,18 +738,18 @@
|
|
|
589
738
|
<div class="size-7 shrink-0 animate-pulse rounded-lg bg-muted"></div>
|
|
590
739
|
{:else if previewUrl && !hasError}
|
|
591
740
|
<!-- File preview content (28×28 thumbnail) -->
|
|
592
|
-
{#if
|
|
593
|
-
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
|
741
|
+
{#if mediaKind === 'image'}
|
|
594
742
|
<div
|
|
595
743
|
class="browser-input-controller-thumbnail size-7 shrink-0 overflow-hidden rounded-lg border border-border bg-background"
|
|
596
|
-
on:click
|
|
744
|
+
on:click={handleThumbnailClick}
|
|
745
|
+
on:keydown={handleThumbnailKeydown}
|
|
597
746
|
role="button"
|
|
598
747
|
tabindex={0}
|
|
599
748
|
>
|
|
600
749
|
{#if thumbHash}
|
|
601
750
|
<div on:error={() => (hasError = true)}>
|
|
602
751
|
<ThumbHashImage
|
|
603
|
-
src={
|
|
752
|
+
src={thumbnailUrl || previewUrl}
|
|
604
753
|
alt={displayLabel || ''}
|
|
605
754
|
thumbhash={thumbHash}
|
|
606
755
|
class_="size-full object-cover"
|
|
@@ -608,14 +757,14 @@
|
|
|
608
757
|
</div>
|
|
609
758
|
{:else}
|
|
610
759
|
<img
|
|
611
|
-
src={previewUrl}
|
|
760
|
+
src={thumbnailUrl || previewUrl}
|
|
612
761
|
alt={displayLabel || ''}
|
|
613
762
|
class="size-full object-cover"
|
|
614
763
|
on:error={() => (hasError = true)}
|
|
615
764
|
/>
|
|
616
765
|
{/if}
|
|
617
766
|
</div>
|
|
618
|
-
{:else if
|
|
767
|
+
{:else if mediaKind === 'video'}
|
|
619
768
|
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
|
620
769
|
<div
|
|
621
770
|
class="browser-input-controller-thumbnail relative flex size-7 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-border bg-background"
|
|
@@ -625,7 +774,7 @@
|
|
|
625
774
|
aria-label={isPlaying ? $t('editor.file.pause') : $t('editor.file.play')}
|
|
626
775
|
>
|
|
627
776
|
{#if !isPlaying}
|
|
628
|
-
<IconVideo class="size-4 stroke-
|
|
777
|
+
<IconVideo class="size-4 stroke-2 text-muted-foreground" />
|
|
629
778
|
{/if}
|
|
630
779
|
<!-- The video plays inside the tile (it is see-through while paused, the camera icon shows) -->
|
|
631
780
|
<!-- svelte-ignore a11y-media-has-caption -->
|
|
@@ -645,11 +794,11 @@
|
|
|
645
794
|
class="absolute inset-0 flex items-center justify-center bg-transparent opacity-0 transition-opacity duration-fast hover:bg-foreground/40 hover:opacity-100"
|
|
646
795
|
aria-hidden="true"
|
|
647
796
|
>
|
|
648
|
-
<IconPlayerPause class="size-4 stroke-
|
|
797
|
+
<IconPlayerPause class="size-4 stroke-2 text-primary-foreground" />
|
|
649
798
|
</span>
|
|
650
799
|
{/if}
|
|
651
800
|
</div>
|
|
652
|
-
{:else if
|
|
801
|
+
{:else if mediaKind === 'audio'}
|
|
653
802
|
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
|
654
803
|
<div
|
|
655
804
|
class="browser-input-controller-thumbnail relative flex size-7 shrink-0 items-center justify-center rounded-lg border border-border bg-background"
|
|
@@ -660,9 +809,9 @@
|
|
|
660
809
|
>
|
|
661
810
|
<!-- While the sound plays the tile shows a pause icon, so the state is seen as well as heard -->
|
|
662
811
|
{#if isPlaying}
|
|
663
|
-
<IconPlayerPause class="size-4 stroke-
|
|
812
|
+
<IconPlayerPause class="size-4 stroke-2 text-foreground" />
|
|
664
813
|
{:else}
|
|
665
|
-
<IconMusic class="size-4 stroke-
|
|
814
|
+
<IconMusic class="size-4 stroke-2 text-muted-foreground" />
|
|
666
815
|
{/if}
|
|
667
816
|
<!-- Audio element hidden but needed for playback -->
|
|
668
817
|
<!-- svelte-ignore a11y-media-has-caption -->
|
|
@@ -675,21 +824,21 @@
|
|
|
675
824
|
<track kind="captions" />
|
|
676
825
|
</audio>
|
|
677
826
|
</div>
|
|
678
|
-
{:else if
|
|
679
|
-
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
|
827
|
+
{:else if mediaKind === 'document'}
|
|
680
828
|
<div
|
|
681
829
|
class="browser-input-controller-thumbnail flex size-7 shrink-0 items-center justify-center rounded-lg border border-border bg-background"
|
|
682
|
-
on:click
|
|
830
|
+
on:click={handleThumbnailClick}
|
|
831
|
+
on:keydown={handleThumbnailKeydown}
|
|
683
832
|
role="button"
|
|
684
833
|
tabindex={0}
|
|
685
834
|
>
|
|
686
|
-
<IconFileText class="size-4 stroke-
|
|
835
|
+
<IconFileText class="size-4 stroke-2 text-muted-foreground" />
|
|
687
836
|
</div>
|
|
688
837
|
{:else}
|
|
689
838
|
<div
|
|
690
839
|
class="browser-input-controller-thumbnail flex size-7 shrink-0 items-center justify-center rounded-lg border border-border bg-background"
|
|
691
840
|
>
|
|
692
|
-
<IconFolderOpen class="size-4 stroke-
|
|
841
|
+
<IconFolderOpen class="size-4 stroke-2 text-muted-foreground" />
|
|
693
842
|
</div>
|
|
694
843
|
{/if}
|
|
695
844
|
{:else if previewUrl && hasError}
|
|
@@ -698,13 +847,13 @@
|
|
|
698
847
|
class="browser-input-controller-thumbnail flex size-7 shrink-0 items-center justify-center rounded-lg border border-destructive bg-background"
|
|
699
848
|
aria-label={$t('editor.file.notFound')}
|
|
700
849
|
>
|
|
701
|
-
<IconAlertTriangle class="size-4 stroke-
|
|
850
|
+
<IconAlertTriangle class="size-4 stroke-2 text-destructive" />
|
|
702
851
|
</div>
|
|
703
852
|
{:else}
|
|
704
853
|
<div
|
|
705
854
|
class="browser-input-controller-thumbnail flex size-7 shrink-0 items-center justify-center rounded-lg border border-border bg-background"
|
|
706
855
|
>
|
|
707
|
-
<IconFolderOpen class="size-4 stroke-
|
|
856
|
+
<IconFolderOpen class="size-4 stroke-2 text-muted-foreground" />
|
|
708
857
|
</div>
|
|
709
858
|
{/if}
|
|
710
859
|
|
|
@@ -715,7 +864,7 @@
|
|
|
715
864
|
on:click|stopPropagation={handleContentRemoval}
|
|
716
865
|
aria-label={$t('editor.file.clear')}
|
|
717
866
|
>
|
|
718
|
-
<IconX class="size-4 stroke-
|
|
867
|
+
<IconX class="size-4 stroke-2 text-muted-foreground" />
|
|
719
868
|
</button>
|
|
720
869
|
{:else if isChecking}
|
|
721
870
|
<div class="ms-auto size-7 shrink-0 animate-pulse rounded-lg bg-muted"></div>
|
|
@@ -727,102 +876,29 @@
|
|
|
727
876
|
on:click|stopPropagation={openFileBrowser}
|
|
728
877
|
aria-label={$t('editor.file.emptyFolder')}
|
|
729
878
|
>
|
|
730
|
-
<IconFolderOpen class="size-4 stroke-
|
|
879
|
+
<IconFolderOpen class="size-4 stroke-2 text-muted-foreground" />
|
|
731
880
|
</button>
|
|
732
881
|
{/if}
|
|
733
882
|
</div>
|
|
734
883
|
</InputControllerRow>
|
|
735
884
|
</div>
|
|
736
885
|
|
|
737
|
-
{#if
|
|
738
|
-
<
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
744
|
-
<div
|
|
745
|
-
class="browser-input-file-browser-backdrop absolute inset-0"
|
|
746
|
-
on:click={closeFileBrowser}
|
|
747
|
-
></div>
|
|
748
|
-
|
|
749
|
-
<div
|
|
750
|
-
class="browser-input-file-browser-dialog browser-input-file-browser-dialog-animate relative z-[999999] flex min-h-0 w-full flex-col overflow-hidden border border-border bg-background"
|
|
751
|
-
class:absolute={fillEditorPanel}
|
|
752
|
-
class:inset-0={fillEditorPanel}
|
|
753
|
-
class:h-full={fillEditorPanel}
|
|
754
|
-
class:max-w-none={fillEditorPanel}
|
|
755
|
-
class:rounded-none={fillEditorPanel}
|
|
756
|
-
class:shadow-none={fillEditorPanel}
|
|
757
|
-
class:max-w-[520px]={!fillEditorPanel}
|
|
758
|
-
class:flex-1={!fillEditorPanel}
|
|
759
|
-
class:min-h-[550px]={fillEditorPanel}
|
|
760
|
-
class:self-center={!fillEditorPanel}
|
|
761
|
-
class:mx-auto={!fillEditorPanel}
|
|
762
|
-
class:rounded-xl={!fillEditorPanel}
|
|
763
|
-
>
|
|
764
|
-
<div
|
|
765
|
-
class="browser-input-file-browser-header relative flex h-12 shrink-0 items-center border-b border-border ps-4 pe-8"
|
|
766
|
-
>
|
|
767
|
-
<span class="text-body-medium text-foreground">{$t('editor.file.dialogTitle')}</span>
|
|
768
|
-
<button
|
|
769
|
-
type="button"
|
|
770
|
-
class="browser-input-file-browser-close inline-flex h-6 w-6 items-center justify-center p-0"
|
|
771
|
-
style="position:absolute;top:4px;inset-inline-end:4px;"
|
|
772
|
-
on:click={closeFileBrowser}
|
|
773
|
-
aria-label={$t('editor.file.closeDialog')}
|
|
774
|
-
>
|
|
775
|
-
<IconX class="size-4 stroke-[1.333]" />
|
|
776
|
-
</button>
|
|
777
|
-
</div>
|
|
778
|
-
|
|
779
|
-
<div class="browser-input-file-browser-body flex min-h-0 flex-1 flex-col overflow-hidden">
|
|
780
|
-
<!-- With a media library the File Browser keeps nothing about this visit (the filter it was left on, the
|
|
781
|
-
folder it was left in) in the page's localStorage: that storage belongs to the page this editor sits in,
|
|
782
|
-
which can be a partner's. Without one (the Widgetic site) it remembers them, as it always did. -->
|
|
783
|
-
<FileBrowser
|
|
784
|
-
class="h-full min-h-0 flex-1"
|
|
785
|
-
instanceId={`props-editor-browser-input-${fileBrowserFilter}`}
|
|
786
|
-
initialFilter={fileBrowserFilter}
|
|
787
|
-
restrictUpload={fileBrowserRestrictUpload}
|
|
788
|
-
useDemoContent={false}
|
|
789
|
-
mediaLibrary={getEditorMediaLibrary()}
|
|
790
|
-
persistHistory={!getEditorMediaLibrary()}
|
|
791
|
-
allowSelecting={true}
|
|
792
|
-
showAddToEditor={true}
|
|
793
|
-
maxSelections={1}
|
|
794
|
-
activeFileId={getCurrentFileId()}
|
|
795
|
-
addToEditorLabel={fileBrowserAddToEditorLabelSingular}
|
|
796
|
-
locale={$fileBrowserLanguage.locale ?? undefined}
|
|
797
|
-
messages={$fileBrowserLanguage.messages ?? null}
|
|
798
|
-
on:select={handleFileBrowserSelect}
|
|
799
|
-
/>
|
|
800
|
-
</div>
|
|
801
|
-
</div>
|
|
802
|
-
</div>
|
|
803
|
-
</Portal>
|
|
886
|
+
{#if isSelectedFilePreviewOpen && typeof value === 'object' && value}
|
|
887
|
+
<EditorSelectedFilePreviewOverlay
|
|
888
|
+
{portalTarget}
|
|
889
|
+
file={valueAsPreviewItem(value)}
|
|
890
|
+
onClose={closeSelectedFilePreview}
|
|
891
|
+
/>
|
|
804
892
|
{/if}
|
|
805
893
|
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
@keyframes browser-input-fb-scale-in {
|
|
819
|
-
from {
|
|
820
|
-
transform: scale(0.94);
|
|
821
|
-
opacity: 0;
|
|
822
|
-
}
|
|
823
|
-
to {
|
|
824
|
-
transform: scale(1);
|
|
825
|
-
opacity: 1;
|
|
826
|
-
}
|
|
827
|
-
}
|
|
828
|
-
</style>
|
|
894
|
+
{#if isFileBrowserOpen}
|
|
895
|
+
<!-- The browser of the editor (shared with the other file fields); the type of file is fixed by this field. -->
|
|
896
|
+
<EditorFileBrowserOverlay
|
|
897
|
+
{portalTarget}
|
|
898
|
+
fileFilter={fileBrowserFilter}
|
|
899
|
+
activeFileId={getCurrentFileId()}
|
|
900
|
+
addToEditorLabel={fileBrowserAddToEditorLabelSingular}
|
|
901
|
+
onClose={closeFileBrowser}
|
|
902
|
+
on:select={handleFileBrowserSelect}
|
|
903
|
+
/>
|
|
904
|
+
{/if}
|