@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
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* The File Browser of the editor, laid over the props panel: the white surface of the panel, a header with the title
|
|
4
|
+
* and the X that closes it (at the end, centred in the height of the header, as in Figma), and the File Browser under
|
|
5
|
+
* it. Every control that picks a file (a file, an image, a vector) opens its browser through this, so they look and
|
|
6
|
+
* behave the same.
|
|
7
|
+
*
|
|
8
|
+
* The control fixes the type of file (`fileFilter`): the browser then draws no "Filter by" (the user cannot change the
|
|
9
|
+
* type) and the upload takes only that type. `fileFilter="all"` (any file) keeps the filter.
|
|
10
|
+
*/
|
|
11
|
+
import { onMount } from 'svelte';
|
|
12
|
+
import { get } from 'svelte/store';
|
|
13
|
+
import { Portal } from '@widgetic/design-system/components';
|
|
14
|
+
import { modalState } from '@widgetic/design-system/components/modals/modalStore';
|
|
15
|
+
import { FileBrowser } from '@widgetic/file-browser';
|
|
16
|
+
import { IconX } from '@widgetic/design-system/icons';
|
|
17
|
+
import { useEditorMediaLibrary } from '../../../mediaLibraryContext';
|
|
18
|
+
import { useEditorLanguage } from '../../../i18n/language';
|
|
19
|
+
import { shouldCloseFileBrowserOverlayOnEscape } from './fileBrowserOverlayEscape';
|
|
20
|
+
|
|
21
|
+
/** Where the overlay is drawn: the panel's own host (it then fills the panel), or any other element or id (a dialog). */
|
|
22
|
+
export let portalTarget: string | HTMLElement = 'portal-element';
|
|
23
|
+
/** The type of file the control takes: it decides what the browser lists, offers to filter by, and accepts as upload. */
|
|
24
|
+
export let fileFilter: 'all' | 'image' | 'video' | 'audio' | 'document' | 'font' | 'svg' = 'all';
|
|
25
|
+
/**
|
|
26
|
+
* localStorage scope for folder memory (must match `WIDGETIC_EDITOR_FILE_PICKER_INSTANCE_ID` in file-browser).
|
|
27
|
+
* All file fields share one remembered folder.
|
|
28
|
+
*/
|
|
29
|
+
export let instanceId: string = 'widgetic-editor-file-picker';
|
|
30
|
+
/** The file the control has now: the browser keeps "use" disabled until a different one is picked. */
|
|
31
|
+
export let activeFileId: string | null = null;
|
|
32
|
+
/** The text of the button that hands the picked file to the control. */
|
|
33
|
+
export let addToEditorLabel: string | undefined = undefined;
|
|
34
|
+
/** Called when the user closes the browser without picking (the X, or a click outside when it is a dialog). */
|
|
35
|
+
export let onClose: () => void = () => {};
|
|
36
|
+
|
|
37
|
+
// The media library the editor was given (a partner's own storage, for instance), read through a getter because it
|
|
38
|
+
// reaches this component through context.
|
|
39
|
+
const getEditorMediaLibrary = useEditorMediaLibrary();
|
|
40
|
+
// The words of the editor in the language of the page, and the share of them that belongs to the File Browser inside it.
|
|
41
|
+
const { t, fileBrowser: fileBrowserLanguage } = useEditorLanguage();
|
|
42
|
+
|
|
43
|
+
/** Full-panel overlay when portaled to the props editor panel (not the document body). */
|
|
44
|
+
$: fillEditorPanel =
|
|
45
|
+
portalTarget === 'props-editor-file-browser-portal' ||
|
|
46
|
+
(portalTarget instanceof HTMLElement && portalTarget.id === 'props-editor-file-browser-portal');
|
|
47
|
+
/** The type is fixed by the control, so there is nothing to filter by; only "any file" can still be narrowed down. */
|
|
48
|
+
$: showFilters = fileFilter === 'all';
|
|
49
|
+
/** Flat host libraries have no folders; partner pages must not use our localStorage keys. */
|
|
50
|
+
const rememberEditorFolder = getEditorMediaLibrary() == null;
|
|
51
|
+
|
|
52
|
+
/** The top-most dialog when this overlay opened: a dialog with a higher generation was opened inside the browser. */
|
|
53
|
+
const generationWhenOverlayOpened = get(modalState).generation ?? 0;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Escape closes the overlay like any other modal, unless something above it owns the key: a dialog the browser
|
|
57
|
+
* opened (the preview, rename, new folder, move, delete) or a menu or dropdown that already handled it. Those close
|
|
58
|
+
* first; the next Escape closes the overlay. See fileBrowserOverlayEscape.ts for why the modal store is read here.
|
|
59
|
+
*/
|
|
60
|
+
function handleOverlayEscape(event: KeyboardEvent) {
|
|
61
|
+
try {
|
|
62
|
+
const currentModalState = get(modalState);
|
|
63
|
+
const shouldClose = shouldCloseFileBrowserOverlayOnEscape({
|
|
64
|
+
key: event.key,
|
|
65
|
+
defaultPrevented: event.defaultPrevented,
|
|
66
|
+
modalOpen: currentModalState.isOpen,
|
|
67
|
+
modalGeneration: currentModalState.generation ?? 0,
|
|
68
|
+
generationWhenOverlayOpened
|
|
69
|
+
});
|
|
70
|
+
if (!shouldClose) return;
|
|
71
|
+
event.preventDefault();
|
|
72
|
+
event.stopPropagation();
|
|
73
|
+
onClose();
|
|
74
|
+
} catch (error) {
|
|
75
|
+
console.error('[EditorFileBrowserOverlay] Escape handler failed', error);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
onMount(() => {
|
|
80
|
+
window.addEventListener('keydown', handleOverlayEscape);
|
|
81
|
+
return () => window.removeEventListener('keydown', handleOverlayEscape);
|
|
82
|
+
});
|
|
83
|
+
</script>
|
|
84
|
+
|
|
85
|
+
<Portal target={portalTarget}>
|
|
86
|
+
<!-- Embedded in the props panel: neutral surface only (no dark scrim). Standalone portal: transparent overlay. -->
|
|
87
|
+
<div
|
|
88
|
+
class="editor-file-browser-overlay pointer-events-auto absolute inset-0 z-[999999] flex flex-col overflow-hidden p-0 {fillEditorPanel
|
|
89
|
+
? 'bg-background'
|
|
90
|
+
: 'bg-transparent'}"
|
|
91
|
+
>
|
|
92
|
+
{#if !fillEditorPanel}
|
|
93
|
+
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
|
94
|
+
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
95
|
+
<div class="editor-file-browser-backdrop absolute inset-0 bg-transparent" on:click={onClose}></div>
|
|
96
|
+
{/if}
|
|
97
|
+
|
|
98
|
+
<div
|
|
99
|
+
class="editor-file-browser-dialog editor-file-browser-dialog-animate relative z-[999999] flex min-h-0 w-full flex-col overflow-hidden border border-border bg-background"
|
|
100
|
+
class:absolute={fillEditorPanel}
|
|
101
|
+
class:inset-0={fillEditorPanel}
|
|
102
|
+
class:h-full={fillEditorPanel}
|
|
103
|
+
class:max-w-none={fillEditorPanel}
|
|
104
|
+
class:rounded-none={fillEditorPanel}
|
|
105
|
+
class:shadow-none={fillEditorPanel}
|
|
106
|
+
class:border-0={fillEditorPanel}
|
|
107
|
+
class:max-w-[520px]={!fillEditorPanel}
|
|
108
|
+
class:flex-1={!fillEditorPanel}
|
|
109
|
+
class:min-h-[550px]={fillEditorPanel}
|
|
110
|
+
class:self-center={!fillEditorPanel}
|
|
111
|
+
class:mx-auto={!fillEditorPanel}
|
|
112
|
+
class:rounded-xl={!fillEditorPanel}
|
|
113
|
+
class:shadow-md={!fillEditorPanel}
|
|
114
|
+
>
|
|
115
|
+
<div
|
|
116
|
+
class="editor-file-browser-header relative flex h-[47px] shrink-0 items-center border-b border-border ps-4 pe-12"
|
|
117
|
+
>
|
|
118
|
+
<span class="text-body-medium text-foreground">{$t('editor.file.dialogTitle')}</span>
|
|
119
|
+
<!-- Figma: the X is a 24px button 12px from the end, centred in the height of the header -->
|
|
120
|
+
<button
|
|
121
|
+
type="button"
|
|
122
|
+
class="editor-file-browser-close press-feedback absolute top-1/2 end-3 flex size-6 -translate-y-1/2 items-center justify-center rounded-lg p-0 transition-colors duration-fast hover:bg-accent focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring"
|
|
123
|
+
on:click={onClose}
|
|
124
|
+
aria-label={$t('editor.file.closeDialog')}
|
|
125
|
+
>
|
|
126
|
+
<IconX class="size-4 stroke-2" />
|
|
127
|
+
</button>
|
|
128
|
+
</div>
|
|
129
|
+
|
|
130
|
+
<div class="editor-file-browser-body flex min-h-0 flex-1 flex-col overflow-hidden">
|
|
131
|
+
<!-- With a host media library (flat list) we remember nothing in localStorage. With Widgetic folders we
|
|
132
|
+
remember only the folder path (`rememberFolder`), never filter/sort — the control fixes the file type. -->
|
|
133
|
+
<FileBrowser
|
|
134
|
+
class="h-full min-h-0 flex-1"
|
|
135
|
+
{instanceId}
|
|
136
|
+
initialFilter={fileFilter}
|
|
137
|
+
restrictUpload={fileFilter !== 'all'}
|
|
138
|
+
{showFilters}
|
|
139
|
+
showSorting={false}
|
|
140
|
+
useDemoContent={false}
|
|
141
|
+
mediaLibrary={getEditorMediaLibrary()}
|
|
142
|
+
persistHistory={false}
|
|
143
|
+
rememberFolder={rememberEditorFolder}
|
|
144
|
+
allowSelecting={true}
|
|
145
|
+
showAddToEditor={true}
|
|
146
|
+
maxSelections={1}
|
|
147
|
+
{activeFileId}
|
|
148
|
+
{addToEditorLabel}
|
|
149
|
+
locale={$fileBrowserLanguage.locale ?? undefined}
|
|
150
|
+
messages={$fileBrowserLanguage.messages ?? null}
|
|
151
|
+
on:select
|
|
152
|
+
/>
|
|
153
|
+
</div>
|
|
154
|
+
</div>
|
|
155
|
+
</div>
|
|
156
|
+
</Portal>
|
|
157
|
+
|
|
158
|
+
<style>
|
|
159
|
+
.editor-file-browser-dialog-animate {
|
|
160
|
+
transform-origin: center center;
|
|
161
|
+
animation: editor-file-browser-scale-in 0.22s cubic-bezier(0.4, 0, 0.2, 1);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
@keyframes editor-file-browser-scale-in {
|
|
165
|
+
from {
|
|
166
|
+
transform: scale(0.94);
|
|
167
|
+
opacity: 0;
|
|
168
|
+
}
|
|
169
|
+
to {
|
|
170
|
+
transform: scale(1);
|
|
171
|
+
opacity: 1;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
</style>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: Props & {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
11
|
+
};
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
13
|
+
}
|
|
14
|
+
declare const EditorFileBrowserOverlay: $$__sveltets_2_IsomorphicComponent<{
|
|
15
|
+
/** Where the overlay is drawn: the panel's own host (it then fills the panel), or any other element or id (a dialog). */ portalTarget?: string | HTMLElement;
|
|
16
|
+
/** The type of file the control takes: it decides what the browser lists, offers to filter by, and accepts as upload. */ fileFilter?: "all" | "image" | "video" | "audio" | "document" | "font" | "svg";
|
|
17
|
+
/**
|
|
18
|
+
* localStorage scope for folder memory (must match `WIDGETIC_EDITOR_FILE_PICKER_INSTANCE_ID` in file-browser).
|
|
19
|
+
* All file fields share one remembered folder.
|
|
20
|
+
*/ instanceId?: string;
|
|
21
|
+
/** The file the control has now: the browser keeps "use" disabled until a different one is picked. */ activeFileId?: string | null;
|
|
22
|
+
/** The text of the button that hands the picked file to the control. */ addToEditorLabel?: string | undefined;
|
|
23
|
+
/** Called when the user closes the browser without picking (the X, or a click outside when it is a dialog). */ onClose?: () => void;
|
|
24
|
+
}, {
|
|
25
|
+
select: CustomEvent<any>;
|
|
26
|
+
} & {
|
|
27
|
+
[evt: string]: CustomEvent<any>;
|
|
28
|
+
}, {}, {}, string>;
|
|
29
|
+
type EditorFileBrowserOverlay = InstanceType<typeof EditorFileBrowserOverlay>;
|
|
30
|
+
export default EditorFileBrowserOverlay;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { FilePreview, type FileSystemItem } from '@widgetic/file-browser';
|
|
3
|
+
import { Portal } from '@widgetic/design-system/components';
|
|
4
|
+
|
|
5
|
+
/** Portal host id or element (same as the file browser overlay). */
|
|
6
|
+
export let portalTarget: string | HTMLElement = 'portal-element';
|
|
7
|
+
export let file: FileSystemItem;
|
|
8
|
+
export let open = true;
|
|
9
|
+
export let onClose: () => void = () => {};
|
|
10
|
+
|
|
11
|
+
function handleClose() {
|
|
12
|
+
open = false;
|
|
13
|
+
onClose();
|
|
14
|
+
}
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
{#if open}
|
|
18
|
+
<Portal target={portalTarget}>
|
|
19
|
+
<div
|
|
20
|
+
class="editor-selected-file-preview-host pointer-events-none absolute inset-0 z-[10000000] flex items-center justify-center p-6"
|
|
21
|
+
>
|
|
22
|
+
<div class="pointer-events-auto max-h-full max-w-full">
|
|
23
|
+
<FilePreview
|
|
24
|
+
{file}
|
|
25
|
+
{open}
|
|
26
|
+
allowSelecting={false}
|
|
27
|
+
currentFiles={[file]}
|
|
28
|
+
target="editor-selected-file-preview"
|
|
29
|
+
on:close={handleClose}
|
|
30
|
+
/>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
</Portal>
|
|
34
|
+
{/if}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type FileSystemItem } from '@widgetic/file-browser';
|
|
2
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
3
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
4
|
+
$$bindings?: Bindings;
|
|
5
|
+
} & Exports;
|
|
6
|
+
(internal: unknown, props: Props & {
|
|
7
|
+
$$events?: Events;
|
|
8
|
+
$$slots?: Slots;
|
|
9
|
+
}): Exports & {
|
|
10
|
+
$set?: any;
|
|
11
|
+
$on?: any;
|
|
12
|
+
};
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
14
|
+
}
|
|
15
|
+
declare const EditorSelectedFilePreviewOverlay: $$__sveltets_2_IsomorphicComponent<{
|
|
16
|
+
/** Portal host id or element (same as the file browser overlay). */ portalTarget?: string | HTMLElement;
|
|
17
|
+
file: FileSystemItem;
|
|
18
|
+
open?: boolean;
|
|
19
|
+
onClose?: () => void;
|
|
20
|
+
}, {
|
|
21
|
+
[evt: string]: CustomEvent<any>;
|
|
22
|
+
}, {}, {}, string>;
|
|
23
|
+
type EditorSelectedFilePreviewOverlay = InstanceType<typeof EditorSelectedFilePreviewOverlay>;
|
|
24
|
+
export default EditorSelectedFilePreviewOverlay;
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
tabindex="-1"
|
|
115
115
|
>
|
|
116
116
|
<IconCheck
|
|
117
|
-
class="size-4 shrink-0 stroke-
|
|
117
|
+
class="size-4 shrink-0 stroke-2 {selected
|
|
118
118
|
? 'text-foreground opacity-100'
|
|
119
119
|
: 'opacity-0'}"
|
|
120
120
|
/>
|
|
@@ -135,7 +135,7 @@
|
|
|
135
135
|
tabindex="-1"
|
|
136
136
|
>
|
|
137
137
|
<IconCheck
|
|
138
|
-
class="size-4 shrink-0 stroke-
|
|
138
|
+
class="size-4 shrink-0 stroke-2 {selected
|
|
139
139
|
? 'text-foreground opacity-100'
|
|
140
140
|
: 'opacity-0'}"
|
|
141
141
|
/>
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
tabindex="-1"
|
|
61
61
|
>
|
|
62
62
|
<IconCheck
|
|
63
|
-
class="size-4 shrink-0 stroke-
|
|
63
|
+
class="size-4 shrink-0 stroke-2 {selected
|
|
64
64
|
? 'text-foreground opacity-100'
|
|
65
65
|
: 'opacity-0'}"
|
|
66
66
|
/>
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
onItemDelete(item, e);
|
|
83
83
|
}}
|
|
84
84
|
>
|
|
85
|
-
<IconTrash class="size-4 stroke-
|
|
85
|
+
<IconTrash class="size-4 stroke-2" />
|
|
86
86
|
</IconButton>
|
|
87
87
|
{/if}
|
|
88
88
|
</div>
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
tabindex="-1"
|
|
101
101
|
>
|
|
102
102
|
<IconCheck
|
|
103
|
-
class="size-4 shrink-0 stroke-
|
|
103
|
+
class="size-4 shrink-0 stroke-2 {selected
|
|
104
104
|
? 'text-foreground opacity-100'
|
|
105
105
|
: 'opacity-0'}"
|
|
106
106
|
/>
|
|
@@ -122,7 +122,7 @@
|
|
|
122
122
|
onItemDelete(item, e);
|
|
123
123
|
}}
|
|
124
124
|
>
|
|
125
|
-
<IconTrash class="size-4 stroke-
|
|
125
|
+
<IconTrash class="size-4 stroke-2" />
|
|
126
126
|
</IconButton>
|
|
127
127
|
{/if}
|
|
128
128
|
</div>
|
|
@@ -168,7 +168,7 @@
|
|
|
168
168
|
onItemDelete(item, e);
|
|
169
169
|
}}
|
|
170
170
|
>
|
|
171
|
-
<IconTrash class="size-3 stroke-[
|
|
171
|
+
<IconTrash class="size-3 stroke-[2.667]" />
|
|
172
172
|
</IconButton>
|
|
173
173
|
{/if}
|
|
174
174
|
</div>
|
|
@@ -205,7 +205,7 @@
|
|
|
205
205
|
onItemDelete(item, e);
|
|
206
206
|
}}
|
|
207
207
|
>
|
|
208
|
-
<IconTrash class="size-3 stroke-[
|
|
208
|
+
<IconTrash class="size-3 stroke-[2.667]" />
|
|
209
209
|
</IconButton>
|
|
210
210
|
{/if}
|
|
211
211
|
</div>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared surface + embedded input classes for input controllers whose text is editable.
|
|
3
|
+
* Hover and focus rings live on the outer surface; the inner control stays visually neutral.
|
|
4
|
+
*/
|
|
5
|
+
/** Default horizontal padding for a single-line editable field (matches Figma IC Number / Text). */
|
|
6
|
+
export declare const editableFieldSurfacePadding = "px-3";
|
|
7
|
+
/**
|
|
8
|
+
* Outer control surface: full-box hover, focus-within ring, soft accent fill.
|
|
9
|
+
* Pass extra layout classes (gap, pe-2, min-h-9, etc.) via `class` on the same element.
|
|
10
|
+
*/
|
|
11
|
+
export declare const editableFieldSurfaceClass = "flex h-9 w-full min-w-0 items-center rounded-lg bg-accent transition-colors duration-fast hover:bg-accent-hover focus-within:outline-hidden focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2 focus-within:ring-offset-background disabled:pointer-events-none disabled:opacity-50";
|
|
12
|
+
/**
|
|
13
|
+
* DS `Input` (and similar) embedded inside {@link editableFieldSurfaceClass}: no inner hover pill.
|
|
14
|
+
*/
|
|
15
|
+
export declare const embeddedInputClass = "h-full w-full min-w-0 border-0 bg-transparent px-0 text-body text-foreground shadow-none placeholder:text-muted-foreground hover:bg-transparent focus-visible:ring-0 focus-visible:ring-offset-0";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared surface + embedded input classes for input controllers whose text is editable.
|
|
3
|
+
* Hover and focus rings live on the outer surface; the inner control stays visually neutral.
|
|
4
|
+
*/
|
|
5
|
+
/** Default horizontal padding for a single-line editable field (matches Figma IC Number / Text). */
|
|
6
|
+
export const editableFieldSurfacePadding = 'px-3';
|
|
7
|
+
/**
|
|
8
|
+
* Outer control surface: full-box hover, focus-within ring, soft accent fill.
|
|
9
|
+
* Pass extra layout classes (gap, pe-2, min-h-9, etc.) via `class` on the same element.
|
|
10
|
+
*/
|
|
11
|
+
export const editableFieldSurfaceClass = `flex h-9 w-full min-w-0 items-center rounded-lg bg-accent transition-colors duration-fast hover:bg-accent-hover focus-within:outline-hidden focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2 focus-within:ring-offset-background disabled:pointer-events-none disabled:opacity-50`;
|
|
12
|
+
/**
|
|
13
|
+
* DS `Input` (and similar) embedded inside {@link editableFieldSurfaceClass}: no inner hover pill.
|
|
14
|
+
*/
|
|
15
|
+
export const embeddedInputClass = 'h-full w-full min-w-0 border-0 bg-transparent px-0 text-body text-foreground shadow-none placeholder:text-muted-foreground hover:bg-transparent focus-visible:ring-0 focus-visible:ring-offset-0';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Escape and the editor's File Browser overlay: Escape closes the top-most thing, like it does for any other modal.
|
|
3
|
+
*
|
|
4
|
+
* What can sit above the overlay while it is open:
|
|
5
|
+
* - a dialog of the design system that the File Browser opened (the preview of a file, rename, new folder, move,
|
|
6
|
+
* delete). It closes itself on Escape, but it registers its key listener after the overlay did, so the overlay is
|
|
7
|
+
* asked first and has to look at the modal store instead of waiting for the dialog to handle the key;
|
|
8
|
+
* - a menu, a dropdown or a search that already took the key: they mark it as handled before it reaches the window.
|
|
9
|
+
*
|
|
10
|
+
* Only when nothing above the overlay owns the key does the overlay close.
|
|
11
|
+
*/
|
|
12
|
+
export interface FileBrowserOverlayEscapeContext {
|
|
13
|
+
/** `event.key` of the key press. */
|
|
14
|
+
key: string;
|
|
15
|
+
/** `event.defaultPrevented`: an inner control already handled the key. */
|
|
16
|
+
defaultPrevented: boolean;
|
|
17
|
+
/** Whether a design-system modal is open now. */
|
|
18
|
+
modalOpen: boolean;
|
|
19
|
+
/** The generation of the top-most open modal now (0 when none is open). */
|
|
20
|
+
modalGeneration: number;
|
|
21
|
+
/**
|
|
22
|
+
* The generation of the top-most open modal when the overlay opened (0 when none was open). Generations only grow,
|
|
23
|
+
* so a modal with a higher number was opened inside the browser and is above the overlay; a modal with the same
|
|
24
|
+
* number was already there when the overlay opened and is below it.
|
|
25
|
+
*/
|
|
26
|
+
generationWhenOverlayOpened: number;
|
|
27
|
+
}
|
|
28
|
+
/** True when this Escape should close the overlay (nothing above the overlay handles it). */
|
|
29
|
+
export declare function shouldCloseFileBrowserOverlayOnEscape(context: FileBrowserOverlayEscapeContext): boolean;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Escape and the editor's File Browser overlay: Escape closes the top-most thing, like it does for any other modal.
|
|
3
|
+
*
|
|
4
|
+
* What can sit above the overlay while it is open:
|
|
5
|
+
* - a dialog of the design system that the File Browser opened (the preview of a file, rename, new folder, move,
|
|
6
|
+
* delete). It closes itself on Escape, but it registers its key listener after the overlay did, so the overlay is
|
|
7
|
+
* asked first and has to look at the modal store instead of waiting for the dialog to handle the key;
|
|
8
|
+
* - a menu, a dropdown or a search that already took the key: they mark it as handled before it reaches the window.
|
|
9
|
+
*
|
|
10
|
+
* Only when nothing above the overlay owns the key does the overlay close.
|
|
11
|
+
*/
|
|
12
|
+
/** True when this Escape should close the overlay (nothing above the overlay handles it). */
|
|
13
|
+
export function shouldCloseFileBrowserOverlayOnEscape(context) {
|
|
14
|
+
if (context.key !== 'Escape')
|
|
15
|
+
return false;
|
|
16
|
+
if (context.defaultPrevented)
|
|
17
|
+
return false;
|
|
18
|
+
if (context.modalOpen && context.modalGeneration > context.generationWhenOverlayOpened)
|
|
19
|
+
return false;
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
@@ -7,3 +7,4 @@
|
|
|
7
7
|
// Export shared components
|
|
8
8
|
export { default as RecentItemsSection } from './RecentItemsSection.svelte';
|
|
9
9
|
export { default as ItemGrid } from './ItemGrid.svelte';
|
|
10
|
+
export { editableFieldSurfaceClass, editableFieldSurfacePadding, embeddedInputClass } from './editableFieldClasses';
|
|
@@ -1,23 +1,55 @@
|
|
|
1
1
|
<!-- Figma Calendar 210:3967 / Calendar Day 210:3450 — editor panel calendar sizing. -->
|
|
2
|
+
<!--
|
|
3
|
+
The rules name the attributes Bits UI writes on the calendar: `data-calendar-*` on the single calendar,
|
|
4
|
+
`data-range-calendar-*` on the range calendar, and `data-bits-day` on the day of both.
|
|
5
|
+
A rule written for an attribute that is not in the DOM does nothing, and then the cells keep the 36px of the design
|
|
6
|
+
system and seven of them (252px) do not fit the 224px the Figma popover leaves for them.
|
|
7
|
+
-->
|
|
2
8
|
<style>
|
|
9
|
+
:global(.calendar-editor-fit [data-calendar-grid-row]),
|
|
10
|
+
:global(.calendar-editor-fit [data-range-calendar-grid-row]) {
|
|
11
|
+
display: flex;
|
|
12
|
+
width: 100%;
|
|
13
|
+
justify-content: space-between;
|
|
14
|
+
gap: 0;
|
|
15
|
+
box-sizing: border-box;
|
|
16
|
+
max-width: 14rem;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
:global(.calendar-editor-fit [data-calendar-head-cell]),
|
|
20
|
+
:global(.calendar-editor-fit [data-calendar-cell]),
|
|
21
|
+
:global(.calendar-editor-fit [data-range-calendar-head-cell]),
|
|
22
|
+
:global(.calendar-editor-fit [data-range-calendar-cell]) {
|
|
23
|
+
height: 2rem !important;
|
|
24
|
+
width: 2rem !important;
|
|
25
|
+
min-height: 2rem !important;
|
|
26
|
+
min-width: 2rem !important;
|
|
27
|
+
max-height: 2rem !important;
|
|
28
|
+
max-width: 2rem !important;
|
|
29
|
+
flex: 0 0 2rem;
|
|
30
|
+
padding: 0;
|
|
31
|
+
}
|
|
32
|
+
|
|
3
33
|
:global(.calendar-editor-fit [data-bits-day]) {
|
|
4
|
-
height: 2rem;
|
|
5
|
-
width: 2rem;
|
|
6
|
-
min-height: 2rem;
|
|
7
|
-
min-width: 2rem;
|
|
34
|
+
height: 2rem !important;
|
|
35
|
+
width: 2rem !important;
|
|
36
|
+
min-height: 2rem !important;
|
|
37
|
+
min-width: 2rem !important;
|
|
38
|
+
max-height: 2rem !important;
|
|
39
|
+
max-width: 2rem !important;
|
|
8
40
|
border-radius: var(--radius-lg);
|
|
9
41
|
font-size: inherit;
|
|
10
42
|
line-height: inherit;
|
|
11
43
|
}
|
|
12
44
|
|
|
13
|
-
:global(.calendar-editor-fit [data-
|
|
14
|
-
:global(.calendar-editor-fit
|
|
15
|
-
height: 1.5rem;
|
|
16
|
-
|
|
45
|
+
:global(.calendar-editor-fit [data-calendar-head-cell]),
|
|
46
|
+
:global(.calendar-editor-fit [data-range-calendar-head-cell]) {
|
|
47
|
+
height: 1.5rem !important;
|
|
48
|
+
min-height: 1.5rem !important;
|
|
49
|
+
max-height: 1.5rem !important;
|
|
17
50
|
font-weight: 500;
|
|
18
51
|
}
|
|
19
52
|
|
|
20
|
-
:global(.calendar-editor-fit [data-bits-calendar-row]),
|
|
21
53
|
:global(.calendar-editor-fit .mt-2.w-full) {
|
|
22
54
|
margin-top: 0.25rem;
|
|
23
55
|
}
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
* to read and embed the document, which takes longer than any other call, so it has a limit of its own.
|
|
24
24
|
*/
|
|
25
25
|
import { type JsonRecord } from './compositionHelpers.js';
|
|
26
|
+
import type { ContentFromFilesApiResult } from '../contentBulkDrop/types.js';
|
|
26
27
|
import { type KnowledgeDocument, type KnowledgeFileInput, type KnowledgeListing, type KnowledgeTextInput } from './knowledgeDocuments.js';
|
|
27
28
|
/** Why the token is being asked for. `expired` means the API just refused the previous one. */
|
|
28
29
|
export type TokenReason = 'initial' | 'expired';
|
|
@@ -73,6 +74,11 @@ export interface SaveCompositionOptions extends CompositionRequestOptions {
|
|
|
73
74
|
* `content`. Left out, the save is made without the check.
|
|
74
75
|
*/
|
|
75
76
|
ifMatchVersion?: number;
|
|
77
|
+
/**
|
|
78
|
+
* Lets the request finish after the page is gone (`fetch` `keepalive`): for a tab close or hide, when the body is
|
|
79
|
+
* small enough (under 64 KB in the browser).
|
|
80
|
+
*/
|
|
81
|
+
keepalive?: boolean;
|
|
76
82
|
}
|
|
77
83
|
/**
|
|
78
84
|
* What the API says about who is editing a composition (`/edit-leases/composition/{id}`): the answer to asking to edit,
|
|
@@ -166,6 +172,16 @@ export interface CompositionApi {
|
|
|
166
172
|
peekEditLease(compositionId: string, options?: CompositionRequestOptions): Promise<EditLeaseAnswer>;
|
|
167
173
|
/** Gives up this tab's claim (nothing happens when it holds none, or somebody else does now). */
|
|
168
174
|
releaseEditLease(compositionId: string, sessionId: string, options?: ReleaseEditLeaseOptions): Promise<void>;
|
|
175
|
+
/** Plans how library files map onto the content list (bulk drop). */
|
|
176
|
+
planContentFromFiles(compositionId: string, body: {
|
|
177
|
+
files: Array<{
|
|
178
|
+
name: string;
|
|
179
|
+
mimeType: string;
|
|
180
|
+
sizeBytes?: number;
|
|
181
|
+
mediaId?: string;
|
|
182
|
+
}>;
|
|
183
|
+
apply?: boolean;
|
|
184
|
+
}, options?: CompositionRequestOptions): Promise<ContentFromFilesApiResult>;
|
|
169
185
|
/** The documents the widget's AI answers from (AI Answers), and how much of the knowledge base they use. */
|
|
170
186
|
listKnowledgeDocuments(compositionId: string, options?: CompositionRequestOptions): Promise<KnowledgeListing>;
|
|
171
187
|
/**
|
|
@@ -404,7 +404,8 @@ export function createCompositionApi(options) {
|
|
|
404
404
|
signal: saveOptions.signal,
|
|
405
405
|
idempotencyKey,
|
|
406
406
|
// Quoted, the way the API writes the ETag of a composition.
|
|
407
|
-
ifMatch: ifMatchVersion === undefined ? undefined : `"${ifMatchVersion}"
|
|
407
|
+
ifMatch: ifMatchVersion === undefined ? undefined : `"${ifMatchVersion}"`,
|
|
408
|
+
keepalive: saveOptions.keepalive
|
|
408
409
|
});
|
|
409
410
|
return isRecord(record) ? record : {};
|
|
410
411
|
},
|
|
@@ -468,6 +469,20 @@ export function createCompositionApi(options) {
|
|
|
468
469
|
},
|
|
469
470
|
async removeKnowledgeDocument(compositionId, documentId, requestOptions = {}) {
|
|
470
471
|
await request('DELETE', knowledgePath(compositionId, `/documents/${encodeURIComponent(checkedDocumentId(documentId))}`), requestOptions);
|
|
472
|
+
},
|
|
473
|
+
async planContentFromFiles(compositionId, body, requestOptions = {}) {
|
|
474
|
+
const answer = await request('POST', compositionPath(compositionId, '/content-items/from-files'), { body, signal: requestOptions.signal });
|
|
475
|
+
if (!isRecord(answer))
|
|
476
|
+
throw invalidResponse('The API gave no bulk drop plan.');
|
|
477
|
+
const plan = answer.plan;
|
|
478
|
+
if (!isRecord(plan) || !Array.isArray(plan.items) || !isRecord(plan.summary)) {
|
|
479
|
+
throw invalidResponse('The API gave an invalid bulk drop plan.');
|
|
480
|
+
}
|
|
481
|
+
return {
|
|
482
|
+
plan,
|
|
483
|
+
applied: answer.applied === true,
|
|
484
|
+
...(isRecord(answer.content) ? { content: answer.content } : {})
|
|
485
|
+
};
|
|
471
486
|
}
|
|
472
487
|
};
|
|
473
488
|
}
|
|
@@ -44,6 +44,14 @@ import type { Translate } from '@widgetic/design-system/i18n';
|
|
|
44
44
|
import type { EditorMessageKey } from '../i18n/messages.js';
|
|
45
45
|
import type { CompositionApi } from './compositionApi.js';
|
|
46
46
|
import { type JsonRecord } from './compositionHelpers.js';
|
|
47
|
+
import { type CompositionEditorShellStore } from './compositionEditorSchemaCache.js';
|
|
48
|
+
import { type DraftJournal, type DraftJournalOptions } from '../drafts/draftJournal.js';
|
|
49
|
+
import { type CompositionDraftPayload } from '../drafts/compositionDraft.js';
|
|
50
|
+
/** Called when a local draft is applied on top of the server copy after load. */
|
|
51
|
+
export interface DraftRestoredInfo {
|
|
52
|
+
key: string;
|
|
53
|
+
savedAtMs: number;
|
|
54
|
+
}
|
|
47
55
|
/** Time to wait after the last edit before saving by itself. */
|
|
48
56
|
export declare const DEFAULT_AUTOSAVE_DELAY_MS = 2500;
|
|
49
57
|
/** How long to wait before trying an autosave again after it failed for a reason that may pass: first, second, third time. */
|
|
@@ -210,6 +218,22 @@ export interface CompositionEditorOptions {
|
|
|
210
218
|
* with the composition (the partner owns embed size elsewhere).
|
|
211
219
|
*/
|
|
212
220
|
lockPreviewSize?: boolean;
|
|
221
|
+
/** Locale for schema-cache keys and shell restore (default `en`). */
|
|
222
|
+
locale?: string;
|
|
223
|
+
/** Cache owner id; falls back to `@widgetic/cache-layer` `getCacheOwner()`. */
|
|
224
|
+
cacheOwnerId?: string | null;
|
|
225
|
+
/**
|
|
226
|
+
* Where the schemas and values of the last load are kept, to be shown at once the next time this composition is
|
|
227
|
+
* opened (the answer of the network replaces them). Without it: the Dexie cache of the cache owner, and no cache
|
|
228
|
+
* at all while there is no owner. `null` turns the cache off.
|
|
229
|
+
*/
|
|
230
|
+
shellStore?: CompositionEditorShellStore | null;
|
|
231
|
+
/** When a crash/refresh draft is applied after load (host may show a short toast). */
|
|
232
|
+
onDraftRestored?: (info: DraftRestoredInfo) => void;
|
|
233
|
+
/** When `null`, draft persistence is off. Default: journal backed by `localStorage` in the browser. */
|
|
234
|
+
draftJournal?: DraftJournal<CompositionDraftPayload> | null;
|
|
235
|
+
/** Options for the default journal when `draftJournal` is not passed. */
|
|
236
|
+
draftJournalOptions?: DraftJournalOptions;
|
|
213
237
|
}
|
|
214
238
|
/** What went wrong, from whatever was thrown. */
|
|
215
239
|
export declare function describeFailure(error: unknown): EditorFailure;
|
|
@@ -255,6 +279,12 @@ export declare class CompositionEditorController {
|
|
|
255
279
|
private loadPromise;
|
|
256
280
|
private savePromise;
|
|
257
281
|
private disposed;
|
|
282
|
+
private readonly draftJournal;
|
|
283
|
+
private readonly onDraftRestored?;
|
|
284
|
+
private draftBaseRevision;
|
|
285
|
+
private lastJournaledPayload;
|
|
286
|
+
private leaveFlushDisposer;
|
|
287
|
+
private leaveSaveIdempotencyKey;
|
|
258
288
|
constructor(options: CompositionEditorOptions);
|
|
259
289
|
/** The state now. It is never changed in place: a change makes a new object. */
|
|
260
290
|
getState(): CompositionEditorState;
|
|
@@ -264,6 +294,17 @@ export declare class CompositionEditorController {
|
|
|
264
294
|
onEvent(listener: (event: CompositionEditorEvent) => void): () => void;
|
|
265
295
|
/** Loads the composition, its preview address and its schemas. Asking again while it loads waits for the same load. */
|
|
266
296
|
load(): Promise<void>;
|
|
297
|
+
private cacheLocale;
|
|
298
|
+
/** The store the last load is kept in: the one the host passed, else the cache owner's Dexie cache (none without an owner). */
|
|
299
|
+
private shellStore;
|
|
300
|
+
/**
|
|
301
|
+
* Shows what the last load of this composition kept (its schemas and values) while the new load is on its way, so
|
|
302
|
+
* the editor is there at once instead of a loading state. For a first paint only: with schemas on the screen already
|
|
303
|
+
* (a reload after a conflict) the screen keeps what it has. And only while the network has not answered: its answer
|
|
304
|
+
* is the fresher one, however late the cache is read. Returns whether it painted.
|
|
305
|
+
*/
|
|
306
|
+
private trySeedFromSchemaCache;
|
|
307
|
+
private persistSchemaCacheFromState;
|
|
267
308
|
private runLoad;
|
|
268
309
|
private failLoad;
|
|
269
310
|
/**
|
|
@@ -368,6 +409,11 @@ export declare class CompositionEditorController {
|
|
|
368
409
|
private clearAutosaveTimer;
|
|
369
410
|
/** Stops everything: timers, requests on their way, and any answer that arrives later. Unsaved edits are lost; `flush()` first to keep them. */
|
|
370
411
|
dispose(): void;
|
|
412
|
+
private journalDraftFromState;
|
|
413
|
+
private flushDraftJournalNow;
|
|
414
|
+
private tryKeepaliveSaveOnLeave;
|
|
415
|
+
private tryApplyDraftAfterLoad;
|
|
416
|
+
private noteDraftAfterSuccessfulSave;
|
|
371
417
|
/** Makes the next state out of the changes, tells the watchers, and says when the unsaved flag turned over. */
|
|
372
418
|
private patch;
|
|
373
419
|
private emit;
|