@widgetic/creator 0.4.24 → 0.4.27
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/CreatorApp.svelte +82 -14
- package/dist/CreatorApp.svelte.d.ts +1 -0
- package/dist/components/WidgetDetails.svelte +3 -2
- package/dist/creator-types.d.ts +5 -0
- package/dist/i18n/language.d.ts +151 -3
- package/dist/i18n/messages.d.ts +8 -0
- package/dist/i18n/messages.js +8 -0
- package/dist/i18n/statusText.js +7 -0
- package/dist/utils/codegenAttachments.d.ts +72 -0
- package/dist/utils/codegenAttachments.js +121 -0
- package/dist/utils/widgetElementSelector.d.ts +5 -1
- package/dist/utils/widgetElementSelector.js +5 -1
- package/package.json +1 -1
package/dist/CreatorApp.svelte
CHANGED
|
@@ -172,6 +172,13 @@
|
|
|
172
172
|
import { persistWidgetThumbnail } from './utils/persistWidgetThumbnail.js';
|
|
173
173
|
import { nativeScrollbarPadding } from './utils/nativeScrollbarPadding.js';
|
|
174
174
|
import { pinScrollToBottom } from './utils/pinScrollToBottom.js';
|
|
175
|
+
import {
|
|
176
|
+
isSentByUploadId,
|
|
177
|
+
joinNames,
|
|
178
|
+
readTextDocumentAttachments,
|
|
179
|
+
unreadableAttachmentNames,
|
|
180
|
+
type TextDocumentForRequest
|
|
181
|
+
} from './utils/codegenAttachments.js';
|
|
175
182
|
import { installFreezeWatchdog, measureSync } from './utils/freezeWatchdog.js';
|
|
176
183
|
import { streamOperationUpdates } from './utils/operationStream.js';
|
|
177
184
|
import {
|
|
@@ -241,6 +248,10 @@
|
|
|
241
248
|
export let initialStep: CreatorAppProps['initialStep'] = null;
|
|
242
249
|
export let forceCreateNewWidget: CreatorAppProps['forceCreateNewWidget'] = false;
|
|
243
250
|
export let initialSketchName: CreatorAppProps['initialSketchName'] = null;
|
|
251
|
+
/** Words to put in the chat input of a new widget, once (never sent by the creator itself). */
|
|
252
|
+
export let initialPrompt: CreatorAppProps['initialPrompt'] = null;
|
|
253
|
+
/** The initial prompt was put in the input; later draft restores leave the person's own text alone. */
|
|
254
|
+
let appliedInitialPrompt = false;
|
|
244
255
|
export let apiUrl: CreatorAppProps['apiUrl'] = null;
|
|
245
256
|
export let widgetBuilderUrl: CreatorAppProps['widgetBuilderUrl'] = null;
|
|
246
257
|
export let initialDebugMode: CreatorAppProps['initialDebugMode'] = undefined;
|
|
@@ -480,7 +491,7 @@
|
|
|
480
491
|
const generatingMark = targetId ? !!generatingWidgetIds[targetId] : false;
|
|
481
492
|
const gate = targetId ? getPublishGateForPanel(targetId) : null;
|
|
482
493
|
const canPublish = !!gate && !gate.disabled;
|
|
483
|
-
const label = gate?.label || '
|
|
494
|
+
const label = gate?.label || $t('creator.common.publish');
|
|
484
495
|
const signature = `${targetId}:${canPublish}:${label}:${panelDisplayRevision}:${isPublishing}:${generatingMark}`;
|
|
485
496
|
if (signature !== lastAnnouncedPublishState) {
|
|
486
497
|
lastAnnouncedPublishState = signature;
|
|
@@ -1808,15 +1819,24 @@
|
|
|
1808
1819
|
fileName: string;
|
|
1809
1820
|
}): boolean => {
|
|
1810
1821
|
if (!attachment.uploadId) return false;
|
|
1811
|
-
|
|
1812
|
-
if (
|
|
1813
|
-
attachment.fileType === 'text/csv' ||
|
|
1814
|
-
attachment.fileName?.toLowerCase().endsWith('.csv')
|
|
1815
|
-
) {
|
|
1816
|
-
return true;
|
|
1817
|
-
}
|
|
1818
|
-
return false;
|
|
1822
|
+
return isSentByUploadId(attachment);
|
|
1819
1823
|
};
|
|
1824
|
+
// The builder reads pictures, CSV files, and Markdown and text files (their words travel in the request). Any other
|
|
1825
|
+
// file (a PDF, a sound) is kept with the message but never reaches the builder, so say so instead of letting the person
|
|
1826
|
+
// believe it was read. A text file that could not be read (too large, empty, not text) is named the same way.
|
|
1827
|
+
const textReading = await readTextDocumentAttachments(attachments || []);
|
|
1828
|
+
const unreadableNames = [
|
|
1829
|
+
unreadableAttachmentNames(attachments || []),
|
|
1830
|
+
joinNames(textReading.unreadableNames)
|
|
1831
|
+
]
|
|
1832
|
+
.filter(Boolean)
|
|
1833
|
+
.join(', ');
|
|
1834
|
+
if (unreadableNames) {
|
|
1835
|
+
showToast('warning', $t('creator.codegen.unreadableAttachmentsTitle'), {
|
|
1836
|
+
description: $t('creator.codegen.unreadableAttachments', { names: unreadableNames }),
|
|
1837
|
+
duration: 10000,
|
|
1838
|
+
});
|
|
1839
|
+
}
|
|
1820
1840
|
const cdnUploadIds = (attachments || [])
|
|
1821
1841
|
.filter(isCodegenUploadAttachment)
|
|
1822
1842
|
.map((attachment) => attachment.uploadId)
|
|
@@ -1953,6 +1973,7 @@
|
|
|
1953
1973
|
fromChat: true,
|
|
1954
1974
|
widgetId: codegenWidgetId,
|
|
1955
1975
|
attachmentIds: cdnUploadIds.length > 0 ? cdnUploadIds : undefined,
|
|
1976
|
+
textDocuments: textReading.documents.length > 0 ? textReading.documents : undefined,
|
|
1956
1977
|
promptImagesOverride: effectivePromptImages.length > 0 ? effectivePromptImages : undefined,
|
|
1957
1978
|
persistFileAttachments: persistFileAttachments.length > 0 ? persistFileAttachments : undefined,
|
|
1958
1979
|
skipIntentGate: sendOptions?.skipIntentGate === true,
|
|
@@ -3216,6 +3237,22 @@
|
|
|
3216
3237
|
}
|
|
3217
3238
|
}
|
|
3218
3239
|
|
|
3240
|
+
/**
|
|
3241
|
+
* An attachment as the chat reads it (snake_case) and as the generated client writes it (camelCase). Both spellings are
|
|
3242
|
+
* filled, so the chat keeps what it reads and the client has the names its model asks for (`fileType` is required).
|
|
3243
|
+
*/
|
|
3244
|
+
type ApiAttachment = {
|
|
3245
|
+
url: string;
|
|
3246
|
+
file_type: string;
|
|
3247
|
+
file_name?: string;
|
|
3248
|
+
file_size?: number;
|
|
3249
|
+
display_order?: number;
|
|
3250
|
+
fileType: string;
|
|
3251
|
+
fileName?: string;
|
|
3252
|
+
fileSize?: number;
|
|
3253
|
+
displayOrder?: number;
|
|
3254
|
+
};
|
|
3255
|
+
|
|
3219
3256
|
/** Map chat attachments to API items. Inline data/blob files are uploaded to user storage (CDN URL). */
|
|
3220
3257
|
function chatAttachmentForSdk(item: {
|
|
3221
3258
|
url: string;
|
|
@@ -3223,7 +3260,7 @@
|
|
|
3223
3260
|
file_name?: string;
|
|
3224
3261
|
file_size?: number;
|
|
3225
3262
|
display_order?: number;
|
|
3226
|
-
}) {
|
|
3263
|
+
}): ApiAttachment {
|
|
3227
3264
|
// The generated client writes camelCase only. Snake_case size is dropped,
|
|
3228
3265
|
// the row insert then fails, and the picture is saved as text alone.
|
|
3229
3266
|
const fileSize = typeof item.file_size === 'number' && item.file_size > 0
|
|
@@ -3252,9 +3289,9 @@
|
|
|
3252
3289
|
display_order?: number;
|
|
3253
3290
|
}>,
|
|
3254
3291
|
persistWidgetId?: string | null,
|
|
3255
|
-
): Promise<
|
|
3292
|
+
): Promise<ApiAttachment[]> {
|
|
3256
3293
|
if (!attachments?.length) return [];
|
|
3257
|
-
const items:
|
|
3294
|
+
const items: ApiAttachment[] = [];
|
|
3258
3295
|
for (let i = 0; i < attachments.length; i++) {
|
|
3259
3296
|
const att = attachments[i];
|
|
3260
3297
|
let url = att.url || '';
|
|
@@ -9700,6 +9737,11 @@
|
|
|
9700
9737
|
if (promptImages.length > 0) {
|
|
9701
9738
|
chatMethods.restoreAttachmentsFromDataUrls?.(promptImages);
|
|
9702
9739
|
}
|
|
9740
|
+
} else if (!appliedInitialPrompt && typeof initialPrompt === 'string' && initialPrompt.trim()) {
|
|
9741
|
+
// The host opened a new widget with words already in the chat (a Figma link from the Design page):
|
|
9742
|
+
// put them in the input once, for the person to read and send. Never sent by the creator itself.
|
|
9743
|
+
appliedInitialPrompt = true;
|
|
9744
|
+
chatMethods.setDraftText?.(initialPrompt.trim());
|
|
9703
9745
|
} else {
|
|
9704
9746
|
// Do not rehydrate old reference images into the chat input unless
|
|
9705
9747
|
// they belong to an actual unsent draft. Sent/deleted attachments
|
|
@@ -10283,6 +10325,8 @@ Requirements:
|
|
|
10283
10325
|
forceRecreateRepo?: boolean;
|
|
10284
10326
|
/** CDN upload row IDs captured before chat clearDraft. */
|
|
10285
10327
|
attachmentIds?: string[];
|
|
10328
|
+
/** Markdown and text files read in the browser before chat clearDraft: the name and the words. */
|
|
10329
|
+
textDocuments?: TextDocumentForRequest[];
|
|
10286
10330
|
/** Image URLs / data URLs captured before chat clearDraft. */
|
|
10287
10331
|
promptImagesOverride?: string[];
|
|
10288
10332
|
/** Skip the server's intent gate — the clarification card's explicit "generate anyway" choice. */
|
|
@@ -10391,6 +10435,7 @@ Requirements:
|
|
|
10391
10435
|
compileFixOnly: options.compileFixOnly,
|
|
10392
10436
|
forceRecreateRepo: options.forceRecreateRepo,
|
|
10393
10437
|
attachmentIds: options.attachmentIds,
|
|
10438
|
+
textDocuments: options.textDocuments,
|
|
10394
10439
|
promptImagesOverride: options.promptImagesOverride,
|
|
10395
10440
|
persistFileAttachments: options.persistFileAttachments,
|
|
10396
10441
|
skipIntentGate: options.skipIntentGate,
|
|
@@ -10590,6 +10635,7 @@ Requirements:
|
|
|
10590
10635
|
compileFixOnly?: boolean;
|
|
10591
10636
|
forceRecreateRepo?: boolean;
|
|
10592
10637
|
attachmentIds?: string[];
|
|
10638
|
+
textDocuments?: TextDocumentForRequest[];
|
|
10593
10639
|
promptImagesOverride?: string[];
|
|
10594
10640
|
/** Skip the server's intent gate — the clarification card's explicit "generate anyway" choice. */
|
|
10595
10641
|
skipIntentGate?: boolean;
|
|
@@ -10880,6 +10926,7 @@ Requirements:
|
|
|
10880
10926
|
: undefined,
|
|
10881
10927
|
images: imagesToSend,
|
|
10882
10928
|
attachmentIds: attachmentIdsToSend,
|
|
10929
|
+
textDocuments: options.forkUserMessage ? undefined : options.textDocuments,
|
|
10883
10930
|
runtimeLogs: runtimeLogsForRequest,
|
|
10884
10931
|
...(options.compileFixOnly ? {} : { baseCommitSha: generationBaseCommitSha(generationWidgetId) }),
|
|
10885
10932
|
compileFixOnly: options.compileFixOnly === true,
|
|
@@ -17360,6 +17407,27 @@ $: if (codeGenerationPrompt && selectedWidgetId && promptLoadedForWidgetId === s
|
|
|
17360
17407
|
const draftPanelState = getPanelState(draftId);
|
|
17361
17408
|
const draftName = getWidgetById(draftId)?.name
|
|
17362
17409
|
?? `ConvertedW-${Date.now()}`;
|
|
17410
|
+
let widgetName = draftName;
|
|
17411
|
+
try {
|
|
17412
|
+
const sketchForName = screenshot.startsWith('data:image/') ? screenshot : null;
|
|
17413
|
+
if (agentClient && (prompt.trim().length >= 2 || sketchForName)) {
|
|
17414
|
+
authStatus = 'Naming widget...';
|
|
17415
|
+
const suggestedNameReply = await agentClient.agentWidgetNamePost({
|
|
17416
|
+
agentWidgetNamePostRequest: { prompt, ...(sketchForName ? { image: sketchForName } : {}) },
|
|
17417
|
+
});
|
|
17418
|
+
const suggestedName = typeof suggestedNameReply?.name === 'string' ? suggestedNameReply.name.trim() : '';
|
|
17419
|
+
if (suggestedName) widgetName = suggestedName;
|
|
17420
|
+
}
|
|
17421
|
+
} catch (nameError) {
|
|
17422
|
+
console.warn('[WidgetCreator] Name suggestion before create failed:', nameError);
|
|
17423
|
+
}
|
|
17424
|
+
if (widgetName !== draftName) {
|
|
17425
|
+
announceToSite('widgetic:creator-primary-renamed', { name: widgetName });
|
|
17426
|
+
}
|
|
17427
|
+
widgets = widgets.map((widget) => widget.id === draftId ? { ...widget, name: widgetName } : widget);
|
|
17428
|
+
if (selectedWidget?.id === draftId) {
|
|
17429
|
+
selectedWidget = { ...selectedWidget, name: widgetName };
|
|
17430
|
+
}
|
|
17363
17431
|
|
|
17364
17432
|
authStatus = 'Creating widget from design...';
|
|
17365
17433
|
if (!canvasId) await ensureCanvasRowForFirstEdit();
|
|
@@ -17367,7 +17435,7 @@ $: if (codeGenerationPrompt && selectedWidgetId && promptLoadedForWidgetId === s
|
|
|
17367
17435
|
const response = await widgetsClient.createWidget(
|
|
17368
17436
|
{
|
|
17369
17437
|
newWidget: {
|
|
17370
|
-
name:
|
|
17438
|
+
name: widgetName,
|
|
17371
17439
|
type: 'widget',
|
|
17372
17440
|
// Canvas sketch snapshot is stored on the widget for future reference
|
|
17373
17441
|
content: {
|
|
@@ -17543,7 +17611,7 @@ $: if (codeGenerationPrompt && selectedWidgetId && promptLoadedForWidgetId === s
|
|
|
17543
17611
|
|
|
17544
17612
|
authStatus = 'Widget created from design.';
|
|
17545
17613
|
showToast('success', $t('creator.widget.widgetCreated'), {
|
|
17546
|
-
description: $t('creator.codegen.isReadyGenerationStarted', { name:
|
|
17614
|
+
description: $t('creator.codegen.isReadyGenerationStarted', { name: newWidget.name || widgetName })
|
|
17547
17615
|
});
|
|
17548
17616
|
return widgetId;
|
|
17549
17617
|
} catch (error) {
|
|
@@ -23,6 +23,7 @@ declare const CreatorApp: $$__sveltets_2_IsomorphicComponent<{
|
|
|
23
23
|
initialStep?: CreatorAppProps["initialStep"];
|
|
24
24
|
forceCreateNewWidget?: CreatorAppProps["forceCreateNewWidget"];
|
|
25
25
|
initialSketchName?: CreatorAppProps["initialSketchName"];
|
|
26
|
+
/** Words to put in the chat input of a new widget, once (never sent by the creator itself). */ initialPrompt?: CreatorAppProps["initialPrompt"];
|
|
26
27
|
apiUrl?: CreatorAppProps["apiUrl"];
|
|
27
28
|
widgetBuilderUrl?: CreatorAppProps["widgetBuilderUrl"];
|
|
28
29
|
initialDebugMode?: CreatorAppProps["initialDebugMode"];
|
|
@@ -942,7 +942,8 @@
|
|
|
942
942
|
const source = event.source;
|
|
943
943
|
if (!source || !selectedWidgetId) return false;
|
|
944
944
|
if (previewIframe?.contentWindow && source === previewIframe.contentWindow) return true;
|
|
945
|
-
|
|
945
|
+
// The iframes of this creator are in the tree this panel is in (a shadow root on a partner's page, the document elsewhere)
|
|
946
|
+
const root = getCreatorShadowRoot(contentContainerEl ?? previewAreaEl) ?? document;
|
|
946
947
|
const frames = root.querySelectorAll('iframe[data-widget-id]');
|
|
947
948
|
for (const frame of frames) {
|
|
948
949
|
if (!(frame instanceof HTMLIFrameElement)) continue;
|
|
@@ -3604,7 +3605,7 @@
|
|
|
3604
3605
|
{#if selectedWidgetId}
|
|
3605
3606
|
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
|
3606
3607
|
<div
|
|
3607
|
-
class="widget-details-floating-shell pointer-events-none overflow-visible {showWidgetDetails ? '' : 'hidden'} {dockRight ? 'widget-details-dock-right absolute inset-y-0
|
|
3608
|
+
class="widget-details-floating-shell pointer-events-none overflow-visible {showWidgetDetails ? '' : 'hidden'} {dockRight ? 'widget-details-dock-right absolute inset-y-0 end-0 h-full' : 'fixed'}"
|
|
3608
3609
|
style={dockRight
|
|
3609
3610
|
? `width: ${consoleColumnOpen ? CONSOLE_COLUMN_PANEL_WIDTH : 480}px; z-index: ${panelZIndex};`
|
|
3610
3611
|
: `left: ${detailsPanelX}px; /* rtl-ok: the panel is put in pixels from the left edge of the screen, beside its shape, and dragged there */ top: ${detailsPanelY}px; width: ${detailsPanelWidth}px; z-index: ${panelZIndex}; height: ${detailsPanelHeight ? detailsPanelHeight + 'px' : `calc(100vh - ${detailsPanelTopOffset + detailsPanelBottomMargin}px)`};`}
|
package/dist/creator-types.d.ts
CHANGED
|
@@ -134,6 +134,11 @@ export interface CreatorAppProps {
|
|
|
134
134
|
forceCreateNewWidget?: boolean;
|
|
135
135
|
/** Name the project list already chose, shown before this canvas is saved. */
|
|
136
136
|
initialSketchName?: string | null;
|
|
137
|
+
/**
|
|
138
|
+
* Words to put in the chat input of a new widget, once, for the person to read and send (the site's Design page opens
|
|
139
|
+
* a widget with a pasted Figma link this way). Ignored when the widget has a draft of its own.
|
|
140
|
+
*/
|
|
141
|
+
initialPrompt?: string | null;
|
|
137
142
|
/** When true, hides auth screen + top bar; syncs session from site localStorage */
|
|
138
143
|
embedded?: boolean;
|
|
139
144
|
/**
|
package/dist/i18n/language.d.ts
CHANGED
|
@@ -181,6 +181,8 @@ export declare const CREATOR_CATALOGS: {
|
|
|
181
181
|
readonly 'creator.codegen.referenceImages': "Reference Images ({count})";
|
|
182
182
|
readonly 'creator.codegen.referenceNumber': "Reference {number}";
|
|
183
183
|
readonly 'creator.codegen.missingReferenceImage': "Missing reference image";
|
|
184
|
+
readonly 'creator.codegen.unreadableAttachmentsTitle': "Some attached files were not used";
|
|
185
|
+
readonly 'creator.codegen.unreadableAttachments': "The builder reads images, CSV files and Markdown or text files. It did not read: {names}. Paste the text into your message instead.";
|
|
184
186
|
readonly 'creator.codegen.missingImageError': "Your prompt mentions an attached image, but there is no attachment in the chat. Use the Upload button.";
|
|
185
187
|
readonly 'creator.codegen.visionModelNote': "With attached images a vision model is used automatically — the same one the server uses.";
|
|
186
188
|
readonly 'creator.codegen.noImageTitle': "Generating without an image";
|
|
@@ -362,6 +364,11 @@ export declare const CREATOR_CATALOGS: {
|
|
|
362
364
|
readonly 'creator.status.savedBuildingPreview': "Code saved — building preview…";
|
|
363
365
|
readonly 'creator.status.savedLoadingPreview': "Code saved — loading preview…";
|
|
364
366
|
readonly 'creator.status.savedPreviewRebuilt': "Code saved — preview rebuilt from saved code.";
|
|
367
|
+
readonly 'creator.status.alreadySavedCompilingPreview': "Code already saved — compiling preview…";
|
|
368
|
+
readonly 'creator.status.alreadySavedShaCompilingPreview': "Code already saved ({sha}) — compiling preview…";
|
|
369
|
+
readonly 'creator.status.alreadySavedPreviewFailed': "Code already saved — preview failed.";
|
|
370
|
+
readonly 'creator.status.alreadySavedShaPreviewFailed': "Code already saved ({sha}) — preview failed.";
|
|
371
|
+
readonly 'creator.status.previewReady': "Preview ready";
|
|
365
372
|
readonly 'creator.status.alreadyRunning': "A code generation is already running. Please wait for it to finish.";
|
|
366
373
|
readonly 'creator.status.needsRefresh': "This app needs a refresh to continue.";
|
|
367
374
|
readonly 'creator.status.limitReached': "Limit reached for now. Please try again later.";
|
|
@@ -409,6 +416,7 @@ export declare const CREATOR_CATALOGS: {
|
|
|
409
416
|
readonly 'creator.error.couldNotFetchThePreview': "Could not fetch the preview URL. The Worker may be unavailable.";
|
|
410
417
|
readonly 'creator.error.widgetPreviewRuntimeErrorHttp': "Widget preview runtime error (HTTP 500)";
|
|
411
418
|
readonly 'creator.error.previewBuildFailed': "Preview build failed.";
|
|
419
|
+
readonly 'creator.error.savedCodeCouldNotBeCompiled': "The saved code could not be compiled into a preview.";
|
|
412
420
|
readonly 'creator.error.couldNotReachThePreview': "Could not reach the preview builder. Try Rebuild.";
|
|
413
421
|
readonly 'creator.error.previewRebuildIsUnavailableIn': "Preview rebuild is unavailable in this session. Try Rebuild or reload the page.";
|
|
414
422
|
readonly 'creator.error.previewBuilderIsUnavailableThe': "Preview builder is unavailable. The widget code was saved — use Rebuild to compile it.";
|
|
@@ -537,8 +545,148 @@ export declare const CREATOR_CATALOGS: {
|
|
|
537
545
|
readonly 'creator.elementSelector.esc': "Esc";
|
|
538
546
|
readonly 'creator.elementSelector.done': "done";
|
|
539
547
|
};
|
|
540
|
-
readonly editor:
|
|
541
|
-
readonly chat:
|
|
548
|
+
readonly editor: Readonly<Record<string, string>>;
|
|
549
|
+
readonly chat: {
|
|
550
|
+
readonly 'chat.contextType.frame': "frame";
|
|
551
|
+
readonly 'chat.contextType.text': "text";
|
|
552
|
+
readonly 'chat.contextType.image': "image";
|
|
553
|
+
readonly 'chat.contextType.document': "document";
|
|
554
|
+
readonly 'chat.contextType.canvas': "canvas";
|
|
555
|
+
readonly 'chat.header.typeChat': "{type} chat";
|
|
556
|
+
readonly 'chat.header.switchConversation': "Switch conversation";
|
|
557
|
+
readonly 'chat.header.conversations': "Conversations";
|
|
558
|
+
readonly 'chat.header.new': "New";
|
|
559
|
+
readonly 'chat.header.untitled': "Untitled";
|
|
560
|
+
readonly 'chat.header.newConversationTitle': "New conversation";
|
|
561
|
+
readonly 'chat.header.newConversation': "Start new conversation";
|
|
562
|
+
readonly 'chat.header.close': "Close chat";
|
|
563
|
+
readonly 'chat.contextPreview.expand': "Expand {name} chat context";
|
|
564
|
+
readonly 'chat.conversation.defaultTitle': "Chat about {name}";
|
|
565
|
+
readonly 'chat.messages.startTitle': "Start a conversation";
|
|
566
|
+
readonly 'chat.messages.startHint': "Ask a question about your {type} to get started.";
|
|
567
|
+
readonly 'chat.messages.loadingHistory': "Loading chat history...";
|
|
568
|
+
readonly 'chat.messages.thinking': "Assistant is thinking...";
|
|
569
|
+
readonly 'chat.messages.viewing': "You are here";
|
|
570
|
+
readonly 'chat.messages.viewingTitle': "This is the version you are looking at";
|
|
571
|
+
readonly 'chat.messages.attachmentMissingTitle': "Attachment not available";
|
|
572
|
+
readonly 'chat.messages.attachmentMissingLabel': "Missing file attachment";
|
|
573
|
+
readonly 'chat.messages.attachmentMissingCaption': "Attachment not saved. Re-attach with Upload, then Retry.";
|
|
574
|
+
readonly 'chat.messages.retry': "Retry";
|
|
575
|
+
readonly 'chat.messages.retryPromptTitle': "Run this prompt again as its own message. The sketch stays with the model, not on the bubble.";
|
|
576
|
+
readonly 'chat.messages.retryLastTitle': "Retry the last user prompt (same generation request)";
|
|
577
|
+
readonly 'chat.messages.upgrade': "Upgrade";
|
|
578
|
+
readonly 'chat.messages.upgradeTitle': "Open plans and billing";
|
|
579
|
+
readonly 'chat.messages.commitId': "(commit id: {id})";
|
|
580
|
+
readonly 'chat.messages.restore': "Restore Checkpoint";
|
|
581
|
+
readonly 'chat.messages.restoreTitle': "Restore widget code to this prompt's commit";
|
|
582
|
+
readonly 'chat.messages.alreadyHead': "This checkpoint is already HEAD";
|
|
583
|
+
readonly 'chat.messages.showSuggestions': "Show suggestions";
|
|
584
|
+
readonly 'chat.messages.version': "Version {number}";
|
|
585
|
+
readonly 'chat.messages.restoredFrom': "Restored from {label}";
|
|
586
|
+
readonly 'chat.messages.previousVersion': "a previous version";
|
|
587
|
+
readonly 'chat.suggestions.title.frame': "Suggested actions for this widget";
|
|
588
|
+
readonly 'chat.suggestions.title.text': "Suggested text improvements";
|
|
589
|
+
readonly 'chat.suggestions.title.image': "Suggested image analysis";
|
|
590
|
+
readonly 'chat.suggestions.title.document': "Suggested document actions";
|
|
591
|
+
readonly 'chat.suggestions.title.other': "Suggested questions";
|
|
592
|
+
readonly 'chat.suggestions.hide': "Hide suggestions";
|
|
593
|
+
readonly 'chat.suggestions.frame.generateCode': "Generate code from this design";
|
|
594
|
+
readonly 'chat.suggestions.frame.improveLayout': "Suggest improvements for this layout";
|
|
595
|
+
readonly 'chat.suggestions.frame.addInteractivity': "Add interactive functionality";
|
|
596
|
+
readonly 'chat.suggestions.frame.makeResponsive': "Make this responsive for mobile";
|
|
597
|
+
readonly 'chat.suggestions.frame.addAnimations': "Add animations and transitions";
|
|
598
|
+
readonly 'chat.suggestions.text.improveWriting': "Help improve this writing";
|
|
599
|
+
readonly 'chat.suggestions.text.checkGrammar': "Check grammar and style";
|
|
600
|
+
readonly 'chat.suggestions.text.alternativePhrasing': "Suggest alternative phrasing";
|
|
601
|
+
readonly 'chat.suggestions.text.summarize': "Summarize this content";
|
|
602
|
+
readonly 'chat.suggestions.text.expand': "Expand on this topic";
|
|
603
|
+
readonly 'chat.suggestions.image.describe': "Describe what you see in this image";
|
|
604
|
+
readonly 'chat.suggestions.image.altText': "Generate alt text for accessibility";
|
|
605
|
+
readonly 'chat.suggestions.image.improveDesign': "Suggest design improvements";
|
|
606
|
+
readonly 'chat.suggestions.image.toCode': "Convert image to code";
|
|
607
|
+
readonly 'chat.suggestions.image.extractText': "Extract text from this image";
|
|
608
|
+
readonly 'chat.suggestions.document.summarize': "Summarize this document";
|
|
609
|
+
readonly 'chat.suggestions.document.keyPoints': "Extract key points";
|
|
610
|
+
readonly 'chat.suggestions.document.checkErrors': "Check for errors or inconsistencies";
|
|
611
|
+
readonly 'chat.suggestions.document.improve': "Suggest improvements";
|
|
612
|
+
readonly 'chat.suggestions.document.outline': "Create an outline";
|
|
613
|
+
readonly 'chat.suggestions.other.ask': "Ask a question about this content";
|
|
614
|
+
readonly 'chat.suggestions.other.improve': "Get suggestions for improvement";
|
|
615
|
+
readonly 'chat.suggestions.other.explain': "Explain what you see here";
|
|
616
|
+
readonly 'chat.suggestions.other.understand': "Help me understand this better";
|
|
617
|
+
readonly 'chat.suggestions.other.options': "What can I do with this?";
|
|
618
|
+
readonly 'chat.input.placeholder': "Type your message...";
|
|
619
|
+
readonly 'chat.input.stop': "Stop generation";
|
|
620
|
+
readonly 'chat.input.sending': "Sending message...";
|
|
621
|
+
readonly 'chat.input.send': "Send message";
|
|
622
|
+
readonly 'chat.actions.screenshot': "Screenshot";
|
|
623
|
+
readonly 'chat.actions.screenshotTitle': "Take Screenshot";
|
|
624
|
+
readonly 'chat.actions.screenshotLabel': "Take screenshot of current content";
|
|
625
|
+
readonly 'chat.actions.record': "Record";
|
|
626
|
+
readonly 'chat.actions.stop': "Stop";
|
|
627
|
+
readonly 'chat.actions.startRecordingTitle': "Start Recording";
|
|
628
|
+
readonly 'chat.actions.stopRecordingTitle': "Stop Recording";
|
|
629
|
+
readonly 'chat.actions.startRecordingLabel': "Start recording";
|
|
630
|
+
readonly 'chat.actions.stopRecordingLabel': "Stop recording";
|
|
631
|
+
readonly 'chat.actions.upload': "Upload";
|
|
632
|
+
readonly 'chat.actions.uploadTitle': "Upload File";
|
|
633
|
+
readonly 'chat.actions.uploadLabel': "Upload file";
|
|
634
|
+
readonly 'chat.actions.selector': "Selector";
|
|
635
|
+
readonly 'chat.actions.selectorTitle': "Select a specific part of the widget to reference in chat";
|
|
636
|
+
readonly 'chat.actions.selectorActiveTitle': "Disable widget element selector";
|
|
637
|
+
readonly 'chat.actions.selectorLabel': "Toggle widget element selector";
|
|
638
|
+
readonly 'chat.selector.removeElement': "Remove selected element";
|
|
639
|
+
readonly 'chat.selector.clearAll': "Clear all";
|
|
640
|
+
readonly 'chat.actions.complete': "Complete";
|
|
641
|
+
readonly 'chat.actions.completed': "Completed";
|
|
642
|
+
readonly 'chat.actions.markCompleteTitle': "Mark this chat as done. You can still send messages and iterate on the widget.";
|
|
643
|
+
readonly 'chat.actions.markActiveTitle': "Mark as Active \u2014 you can keep iterating either way";
|
|
644
|
+
readonly 'chat.actions.markCompleteLabel': "Mark conversation as complete";
|
|
645
|
+
readonly 'chat.actions.markActiveLabel': "Mark conversation as active";
|
|
646
|
+
readonly 'chat.resize.label': "Resize messages area";
|
|
647
|
+
readonly 'chat.resize.title': "Drag to resize messages area";
|
|
648
|
+
readonly 'chat.attachment.alt': "Attachment";
|
|
649
|
+
readonly 'chat.attachment.untitled': "Untitled";
|
|
650
|
+
readonly 'chat.attachment.fileFallback': "File";
|
|
651
|
+
readonly 'chat.attachment.namelessAlt': "attachment";
|
|
652
|
+
readonly 'chat.attachment.previewAlt': "Attachment preview";
|
|
653
|
+
readonly 'chat.attachment.pdfTitle': "PDF Document";
|
|
654
|
+
readonly 'chat.attachment.noVideo': "Your browser does not support video playback.";
|
|
655
|
+
readonly 'chat.attachment.view': "Click to view {name}";
|
|
656
|
+
readonly 'chat.attachment.viewFile': "Click to view file";
|
|
657
|
+
readonly 'chat.attachment.more': "{count, plural, one {+# more file} other {+# more files}}";
|
|
658
|
+
readonly 'chat.attachment.remove': "Remove attachment";
|
|
659
|
+
readonly 'chat.attachment.close': "Close";
|
|
660
|
+
readonly 'chat.size.bytes': "{size} B";
|
|
661
|
+
readonly 'chat.size.kb': "{size} KB";
|
|
662
|
+
readonly 'chat.size.mb': "{size} MB";
|
|
663
|
+
readonly 'chat.size.gb': "{size} GB";
|
|
664
|
+
readonly 'chat.code.copy': "Copy";
|
|
665
|
+
readonly 'chat.code.copyTitle': "Copy code";
|
|
666
|
+
readonly 'chat.code.copied': "Copied!";
|
|
667
|
+
readonly 'chat.status.active': "Active";
|
|
668
|
+
readonly 'chat.status.completed': "Completed";
|
|
669
|
+
readonly 'chat.status.processing': "Processing...";
|
|
670
|
+
readonly 'chat.status.error': "Error";
|
|
671
|
+
readonly 'chat.status.messageCount': "{count, plural, one {(# message)} other {(# messages)}}";
|
|
672
|
+
readonly 'chat.error.dismiss': "Dismiss";
|
|
673
|
+
readonly 'chat.error.retryLoad': "Retry load history";
|
|
674
|
+
readonly 'chat.error.loadHistory': "Could not load chat history.";
|
|
675
|
+
readonly 'chat.error.initialize': "Failed to initialize chat. Please try again.";
|
|
676
|
+
readonly 'chat.error.loadConversations': "Failed to load conversations.";
|
|
677
|
+
readonly 'chat.error.loadConversation': "Failed to load conversation.";
|
|
678
|
+
readonly 'chat.error.sendMessage': "Failed to send message. Please try again.";
|
|
679
|
+
readonly 'chat.error.sendSuggestion': "Failed to send the selected suggestion. Please try again.";
|
|
680
|
+
readonly 'chat.error.screenshotUnavailable': "Screenshot capture failed \u2014 no preview available.";
|
|
681
|
+
readonly 'chat.error.screenshotFailed': "Failed to capture screenshot";
|
|
682
|
+
readonly 'chat.error.screenshotActionFailed': "Screenshot action failed. Please try again.";
|
|
683
|
+
readonly 'chat.error.recordingStartFailed': "Failed to start recording";
|
|
684
|
+
readonly 'chat.error.recordingStopFailed': "Failed to stop recording";
|
|
685
|
+
readonly 'chat.error.recordingActionFailed': "Recording action failed. Please try again.";
|
|
686
|
+
readonly 'chat.error.actionFailed': "The action failed. Please try again.";
|
|
687
|
+
readonly 'chat.error.statusUpdateFailed': "Failed to update conversation status";
|
|
688
|
+
readonly 'chat.error.restoreFailed': "Failed to restore checkpoint. Please try again.";
|
|
689
|
+
};
|
|
542
690
|
readonly canvas: {
|
|
543
691
|
readonly 'canvas.state.loading': "Loading canvas\u2026";
|
|
544
692
|
readonly 'canvas.state.initFailed': "Canvas failed to initialize.";
|
|
@@ -803,4 +951,4 @@ export declare const useCreatorLanguage: () => import("@widgetic/design-system/i
|
|
|
803
951
|
* The English `t` of the creator, for code that has no component around it. The screens of the creator get their words, in
|
|
804
952
|
* the page's language, from `useCreatorLanguage`.
|
|
805
953
|
*/
|
|
806
|
-
export declare const translateEnglish: import("@widgetic/design-system/i18n").Translate<"creator.common.close" | "creator.common.new" | "creator.common.doubleClickToRename" | "creator.common.thisAppNeedsARefresh" | "creator.common.reload" | "creator.common.publish" | "creator.common.switchVersion" | "creator.common.live" | "creator.common.buildThisDraftVersionAnd" | "creator.common.setLive" | "creator.common.retry" | "creator.common.delete" | "creator.common.draft" | "creator.common.loading" | "creator.general.unknownError" | "creator.general.couldNotLoadUploadedImage" | "creator.general.tryUploadingTheImageAgain" | "creator.general.uploadFailed" | "creator.general.couldNotUpdateConversationStatus" | "creator.general.changeUndone" | "creator.general.failedToLoadEditorSettings" | "creator.general.setTo" | "creator.general.failedToUpdate" | "creator.general.failedToSaveDimensions" | "creator.general.nothingToSave" | "creator.general.serviceTemporarilyUnavailable" | "creator.general.retryingWhenTheApiIs" | "creator.general.invalidFileType" | "creator.general.pleaseSelectAnImageFile" | "creator.general.imageTooLarge" | "creator.general.maximumImageSizeIsMb" | "creator.general.tooManyImages" | "creator.general.maximumImagesAllowedRemoveAn" | "creator.general.failedToProcessImage" | "creator.general.couldNotReadTheImage" | "creator.general.imagePasted" | "creator.general.screenshotCaptureFailed" | "creator.general.missingOperationId" | "creator.general.switchToThatPanelTo" | "creator.general.limitReached" | "creator.general.rateLimited" | "creator.general.theApiRateLimitWas" | "creator.general.liveV" | "creator.general.anUnexpectedErrorOccurredPlease" | "creator.general.latestCommitIsAlreadyLive" | "creator.general.theServerRefusedTheRename" | "creator.general.checkYourConnectionAndTry" | "creator.general.unableToReachTheApi" | "creator.general.pleaseWaitForTheCurrent" | "creator.general.created" | "creator.general.saveBlocked" | "creator.general.keptALocalCopyCheck" | "creator.general.apiClientUnavailable" | "creator.general.screenshotCouldNotBeCaptured" | "creator.general.fixTheSelectionZoomOut" | "creator.general.checkConsoleForDetails" | "creator.general.retryLoad" | "creator.general.dismiss" | "creator.general.saving" | "creator.general.saved" | "creator.general.saveError" | "creator.general.loadingHistory" | "creator.general.upgrade" | "creator.general.fixInCreate" | "creator.general.save" | "creator.general.cancel" | "creator.general.noEditableSettingsAvailableYet" | "creator.general.dimensions" | "creator.general.w" | "creator.general.h" | "creator.general.px" | "creator.general.copy" | "creator.general.testPage" | "creator.general.zoomedReference" | "creator.general.keepInDatabase" | "creator.general.deleteFromDatabase" | "creator.general.checkingWhatWillBeDeleted" | "creator.general.describeWhatYouWant" | "creator.session.endedStartAgain" | "creator.session.canvasCannotOpen" | "creator.session.sessionEnded" | "creator.session.sessionExpiredSignInAgain" | "creator.session.sessionExpired" | "creator.session.authenticationExpired" | "creator.session.pleaseLoginAgainToContinue" | "creator.session.signInAgainToPublish" | "creator.session.loginRequiredToDuplicateWidget" | "creator.session.pleaseLoginFirst" | "creator.session.authenticationRequired" | "creator.session.pleaseLoginBeforeCreatingA" | "creator.session.thisWidgetReferencesARepository" | "creator.session.signInAgainThenRetry" | "creator.widget.notFound" | "creator.widget.fallbackName" | "creator.widget.noWidgetSelected" | "creator.widget.shapeRemoved" | "creator.widget.widgetKeptInDatabase" | "creator.widget.widgetDeletedFromDatabase" | "creator.widget.widgetWasAlreadyDeleted" | "creator.widget.failedToDeleteWidgetFrom" | "creator.widget.selectAWidgetFirst" | "creator.widget.duplicateFromTheHeaderCopies" | "creator.widget.failedToLoadWidgets" | "creator.widget.couldNotRestoreShapesYet" | "creator.widget.widgetRenamedTo" | "creator.widget.failedToRenameWidget" | "creator.widget.capturingWidgetScreenshot" | "creator.widget.widgetsApiClientIsNot" | "creator.widget.unlinkedWidgetShape" | "creator.widget.duplicatingWidget" | "creator.widget.failedToDuplicateWidget" | "creator.widget.widgetDuplicated" | "creator.widget.widgetKeptInDatabase2" | "creator.widget.youCanKeepEditingWidgets" | "creator.widget.widgetDraftCreated" | "creator.widget.failedToPrepareWidgetDraft" | "creator.widget.failedToCreateWidgetFrom" | "creator.widget.widgetCreatedButNoId" | "creator.widget.widgetCreated" | "creator.widget.failedToFinalizeWidgetConversion" | "creator.widget.repoIdToDeleteUse" | "creator.widget.restoreShapes" | "creator.widget.directWidgetUrl" | "creator.widget.deleteWidgetShape" | "creator.widget.theseWidgetsBelongToMore" | "creator.canvas.appearsEmptyButWidgets" | "creator.canvas.restoredShapes" | "creator.canvas.removedTheLeftoverShapeFrom" | "creator.canvas.clickAWidgetOnThe" | "creator.canvas.canvasIsNotReadyYet" | "creator.canvas.failedToLoadCanvases" | "creator.canvas.couldNotDeleteThisCanvas" | "creator.canvas.noCanvasIdCannotLoad" | "creator.canvas.canvasMayStillBeLoading" | "creator.canvas.widgetPreviewUpdatedOnCanvas" | "creator.canvas.widgetCanvasAndRepositoryAre" | "creator.canvas.canvasIsRequiredBeforePublishing" | "creator.canvas.thisShapePointsToA" | "creator.canvas.shapeRemovedFromCanvas" | "creator.canvas.canvasIsTakingLongerThan" | "creator.canvas.canvasShapesFailedToRender" | "creator.canvas.failedToLoadCanvasFrom" | "creator.canvas.canvasLoadFailedCheckSupabase" | "creator.canvas.apiMayBeThrottledOr" | "creator.canvas.canvasSnapshotLookedEmptyRefresh" | "creator.canvas.canvasSaved" | "creator.canvas.sketchRestored" | "creator.canvas.canvasSaveFailed" | "creator.canvas.canvasSavedLocally" | "creator.canvas.noCanvasIdYet" | "creator.canvas.canvasUnavailable" | "creator.canvas.canvasShapesFailedToLoad" | "creator.canvas.shapeDataMayBeMissing" | "creator.canvas.deleteCanvas" | "creator.composition.compositionCreated" | "creator.composition.failedToCreateComposition" | "creator.composition.compositionSaved" | "creator.composition.compositionRenamed" | "creator.composition.failedToRenameComposition" | "creator.composition.compositionDeleted" | "creator.composition.failedToDeleteComposition" | "creator.composition.fixTheSyntaxErrorIn" | "creator.composition.compositions" | "creator.composition.selectComposition" | "creator.composition.deleteThisComposition" | "creator.composition.webComponentFormatRequiresA" | "creator.composition.compositionUrl" | "creator.codegen.referenceImages" | "creator.codegen.referenceNumber" | "creator.codegen.missingReferenceImage" | "creator.codegen.missingImageError" | "creator.codegen.visionModelNote" | "creator.codegen.noImageTitle" | "creator.codegen.repositoryCreated" | "creator.codegen.failedToCreateRepository" | "creator.codegen.noVisionNote" | "creator.codegen.codeRevertedToCommitRefreshing" | "creator.codegen.widgetCodeAtCommitRefreshing" | "creator.codegen.gitRollbackMayNotHave" | "creator.codegen.codeGenerationCompleted" | "creator.codegen.generationInProgress" | "creator.codegen.reconnectedToAnActiveCode" | "creator.codegen.codeSavedToGitlabAnd" | "creator.codegen.generationStopped" | "creator.codegen.codeGenerationWasCancelledYou" | "creator.codegen.couldNotStopGeneration" | "creator.codegen.generationMayStillBeRunning" | "creator.codegen.imageAddedToYourPrompt" | "creator.codegen.generateCodeFirstToCapture" | "creator.codegen.previewIsMissingTheCapture" | "creator.codegen.promptTooShort" | "creator.codegen.pleaseProvideAPromptWith" | "creator.codegen.mockCodeGenerated" | "creator.codegen.thisIsASimulationNo" | "creator.codegen.missingRepository" | "creator.codegen.coderVision" | "creator.codegen.answeredWithoutGenerating" | "creator.codegen.noGenerationStarted" | "creator.codegen.cannotTrackCodeGenerationProgress" | "creator.codegen.aiGeneratedInvalidSvelteSyntax" | "creator.codegen.codeSavedRebuildingPreview" | "creator.codegen.codeWasNotSaved" | "creator.codegen.codeWasNotSavedToTheRepository" | "creator.codegen.retrySavesItAndRecordsAVersion" | "creator.codegen.generationCompleted" | "creator.codegen.codeSavedPreviewIsLoading" | "creator.codegen.generationAlreadyInProgress" | "creator.codegen.anotherCodeGenerationIsAlready" | "creator.codegen.codeGenerationError" | "creator.codegen.imagePastedToPrompt" | "creator.codegen.codeGenerationInProgressWait" | "creator.codegen.repositoryMissingUseRebuildCode" | "creator.codegen.buildFailedCheckLogsFor" | "creator.codegen.createdWithExistingCode" | "creator.codegen.editTheSketchFreelySending" | "creator.codegen.isReadyGenerationStarted" | "creator.codegen.repositoryIsNowLinkedTo" | "creator.codegen.repositoryExists" | "creator.codegen.repositoryOwnedByAnotherAccount" | "creator.codegen.repositoryFound" | "creator.codegen.linkedToRepository" | "creator.codegen.repositoryReferenceInvalid" | "creator.codegen.supabaseDoesNotHaveThis" | "creator.codegen.unableToVerifyRepositoryStatus" | "creator.codegen.repositoryVerificationFailed" | "creator.codegen.repositoryCreationFailed" | "creator.codegen.couldNotDetermineRepositoryId" | "creator.codegen.repositoryCreatedButNotPersisted" | "creator.codegen.repositoryExistsButFailedTo" | "creator.codegen.repositoryReadyForUse" | "creator.codegen.generationFailed" | "creator.codegen.previewBuilderIsUnavailable" | "creator.codegen.theWidgetCodeWasSaved" | "creator.codegen.rebuildInCreate" | "creator.codegen.codeDoesNotCompile" | "creator.codegen.latestCodeDoesNotCompile" | "creator.codegen.generateCodeFirstToCustomize" | "creator.codegen.noWidgetCodeYet" | "creator.codegen.goToStep1Create" | "creator.codegen.confirmCodeGeneration" | "creator.codegen.reviewThePromptAndReference" | "creator.codegen.describeTheWidgetYouWant" | "creator.codegen.prompt" | "creator.codegen.editPromptFirst" | "creator.codegen.generateNow" | "creator.preview.newerThanLive" | "creator.preview.mayShowLive" | "creator.preview.rebuilt" | "creator.preview.versionHasCodeError" | "creator.preview.versionCouldNotLoad" | "creator.preview.versionHourlyLimit" | "creator.preview.recompiledIn" | "creator.preview.commitRefreshed" | "creator.preview.noValidPreviewAvailable" | "creator.preview.theWidgetDidNotRespond" | "creator.preview.captureErrorRefreshThePreview" | "creator.preview.imageWaitsForGeneration" | "creator.preview.savingImage" | "creator.preview.imageSaved" | "creator.preview.couldNotSaveImage" | "creator.preview.imageNotReturned" | "creator.version.checkpointRestored" | "creator.version.restoreCompletedWithWarnings" | "creator.version.failedToRestoreCheckpoint" | "creator.version.versionIsNowLive" | "creator.version.version" | "creator.version.theSelectedDraftVersionWas" | "creator.version.thisIsADraftVersion" | "creator.version.thisVersionIsNowWhat" | "creator.version.versionRenamed" | "creator.version.versionTitleCleared" | "creator.version.couldNotRenameTheVersion" | "creator.version.closeVersionHistory" | "creator.publish.cannotPublish" | "creator.publish.noEditableSettingsFoundGenerate" | "creator.publish.publishingViaWidgetBuilder" | "creator.publish.widgetPublished" | "creator.publish.publishedAutomaticallyAfterCodeGeneration" | "creator.publish.publishFailed" | "creator.publish.publishing" | "creator.publish.publishingInProgress" | "creator.publish.anotherWidgetIsPublishingWait" | "creator.publish.publishIsRunningInAnother" | "creator.publish.thisVersionIsAlreadyPublished" | "creator.publish.thisDraftHasNoRecorded" | "creator.publish.generateWidgetCodeBeforePublishing" | "creator.publish.publishWidget" | "creator.publish.noNewVersionToPublish" | "creator.publish.publishNewV" | "creator.publish.generateOrRebuildSoWe" | "creator.publish.cannotPublishYet" | "creator.publish.publishedVSuccessfully" | "creator.publish.published" | "creator.publish.widgetPublishFailed" | "creator.publish.failedToLoadPublishHistory" | "creator.publish.pressPublishToMakeThe" | "creator.publish.failedToSetLiveVersion" | "creator.publish.publishTheLatestGeneratedCode" | "creator.publish.liveGenerateNewCodeTo" | "creator.publish.publishThisVersionSoVisitors" | "creator.publish.noHistoryRecordsYetGenerate" | "creator.publish.retryPublish" | "creator.publish.notPublishedYet" | "creator.publish.generateOnCreatePreviewThe" | "creator.publish.widgetNotPublishedYet" | "creator.publish.publishYourWidgetFromThe" | "creator.publish.publishYourWidgetFromTheCreate" | "creator.embed.codeTitle" | "creator.embed.formatIframe" | "creator.embed.formatWebComponent" | "creator.embed.copied" | "creator.embed.versionIsLiveAndReady" | "creator.embed.embedYourWidget" | "creator.embed.setDimensionsAndCopyThe" | "creator.embed.embedWidth" | "creator.embed.embedHeight" | "creator.embed.copyEmbedCode" | "creator.embed.embedFormat" | "creator.dialog.removeShape" | "creator.dialog.alsoDeleteWidget" | "creator.dialog.deleteCanvas" | "creator.dialog.alsoDeleteWidgets" | "creator.status.label" | "creator.status.preparingCodeGeneration" | "creator.status.ready" | "creator.status.completedPreviewReady" | "creator.status.completedAutoSaving" | "creator.status.completedSaved" | "creator.status.completedChangesSaved" | "creator.status.failed" | "creator.status.stoppedByUser" | "creator.status.fixingCompilationErrors" | "creator.status.generatingMockCode" | "creator.status.mockCodeComplete" | "creator.status.processingQueuedRequest" | "creator.status.sessionExpired" | "creator.status.repositoryRequired" | "creator.status.runningQueued" | "creator.status.repositoryReady" | "creator.status.answeredFromDetails" | "creator.status.needMoreDetail" | "creator.status.noGenerationNeeded" | "creator.status.authenticationExpired" | "creator.status.noOperationId" | "creator.status.processingQueued" | "creator.status.inProgress" | "creator.status.generating" | "creator.status.generatingProgress" | "creator.status.savedBuildingPreview" | "creator.status.savedLoadingPreview" | "creator.status.savedPreviewRebuilt" | "creator.status.alreadyRunning" | "creator.status.needsRefresh" | "creator.status.limitReached" | "creator.status.rateLimited" | "creator.status.failedWithReason" | "creator.status.reconnected" | "creator.conversation.version" | "creator.conversation.previousVersion" | "creator.conversation.restoredFromCommit" | "creator.conversation.completedCommitPreviewLoading" | "creator.conversation.completedCommitPreviewReady" | "creator.conversation.completedPreviewLoading" | "creator.conversation.codeSavedShaBuilding" | "creator.conversation.codeSavedShaLoading" | "creator.conversation.codeSavedShaRebuilt" | "creator.conversation.codeSavedCommitPreviewFailed" | "creator.conversation.stoppedRetryPrompt" | "creator.conversation.previewRecompiled" | "creator.conversation.previewRecompiledCommitPart" | "creator.conversation.previewRecompiledDurationPart" | "creator.conversation.alreadyDoneWithCommit" | "creator.conversation.alreadyDone" | "creator.conversation.alreadyDoneFilesSuffix" | "creator.conversation.convert" | "creator.conversation.widgetConversion" | "creator.error.generationFailedWhileYouWere" | "creator.error.generationTrackingLost" | "creator.error.unableToResolveRepositoryFor" | "creator.error.authenticationExpiredPleaseLoginAgain" | "creator.error.cannotTrackCodeGenerationProgress" | "creator.error.usageLimitExceeded" | "creator.error.tooManyRequestsPleaseTry" | "creator.error.codeGenerationFailed" | "creator.error.widgetBuilderIsNotReachable" | "creator.error.buildRequestFailed" | "creator.error.notAuthenticated" | "creator.error.apiClientIsNotConfigured" | "creator.error.publishedVersionIsNotAvailable" | "creator.error.failedToCompileWidgetCode" | "creator.error.previewNotReadyYetClick" | "creator.error.previewNotReadyYetClickRebuild" | "creator.error.previewLoadedButTheWidget" | "creator.error.previewTimedOutTheDev" | "creator.error.couldNotOpenPreviewUrl" | "creator.error.couldNotFetchThePreview" | "creator.error.widgetPreviewRuntimeErrorHttp" | "creator.error.previewBuildFailed" | "creator.error.couldNotReachThePreview" | "creator.error.previewRebuildIsUnavailableIn" | "creator.error.previewBuilderIsUnavailableThe" | "creator.error.previewBuilderReturnedAnUnexpected" | "creator.error.anUnknownErrorOccurred" | "creator.error.couldNotReachTheServer" | "creator.error.buildFailed" | "creator.details.fixThePromptOrAttachments" | "creator.details.codeGenerationWillStartShortly" | "creator.details.saveWillExecuteShortly" | "creator.details.codeGenerationQueued" | "creator.details.saveQueued" | "creator.details.closeWidgetDetails" | "creator.details.widgetDraft" | "creator.details.createWidgetCode" | "creator.details.create" | "creator.details.editComposition" | "creator.details.publishTheWidgetToEdit" | "creator.details.edit" | "creator.details.embedThePublishedWidget" | "creator.details.publishTheWidgetToGet" | "creator.details.embed" | "creator.details.openLivePreview" | "creator.details.closeLivePreview" | "creator.details.showLivePreview" | "creator.details.preview" | "creator.details.dragToResizeChatPreview" | "creator.details.livePreview" | "creator.details.recompileWidgetCodeForPreview" | "creator.details.rebuilding" | "creator.details.rebuild" | "creator.details.clickToFocusThisWidget" | "creator.details.livePreviewBelow" | "creator.details.generatingCode" | "creator.details.loadingPreview" | "creator.details.sketchDraft" | "creator.details.yourSketchIsStillOn" | "creator.details.sendThePromptInChat" | "creator.details.preparingWidget" | "creator.details.settingUpRepository" | "creator.details.widgetHasNoRepository" | "creator.details.repositoryCreationFailedPreviouslyClick" | "creator.details.createRepository" | "creator.details.noCodeYet" | "creator.details.writeAPromptAndGenerate" | "creator.details.generateNow" | "creator.details.previewUnavailable" | "creator.details.rebuildCode" | "creator.details.fixCompileError" | "creator.details.retryBuild" | "creator.details.retry" | "creator.details.buildingPreview" | "creator.details.compilingWidgetCode" | "creator.details.previewWillAppearAfterCode" | "creator.details.resizePanel" | "creator.details.resizeWidth" | "creator.details.resizeHeight" | "creator.brandKit.addFont" | "creator.brandKit.fontLabel" | "creator.brandKit.brandKit" | "creator.brandKit.languageIsFixedAfterThe" | "creator.brandKit.selectLanguage" | "creator.brandKit.libraries" | "creator.brandKit.addLibrary" | "creator.brandKit.uploadLibrary" | "creator.brandKit.removeLibrary" | "creator.brandKit.replacesTheWidgeticPaletteFor" | "creator.brandKit.colorPalette" | "creator.brandKit.primary" | "creator.brandKit.secondary" | "creator.brandKit.title" | "creator.brandKit.sub" | "creator.brandKit.fonts" | "creator.brandKit.font" | "creator.brandKit.removeFont" | "creator.brandKit.uploadFonts" | "creator.brandKit.uploadAFontFileOr" | "creator.brandKit.urlArchiveWoff2TtfOtf" | "creator.brandKit.removeUploadedFont" | "creator.brandKit.icons" | "creator.brandKit.addIconLibrary" | "creator.brandKit.removeIconLibrary" | "creator.brandKit.uploadCustomLibraryTooltip" | "creator.brandKit.uploadIconLibraryTooltip" | "creator.brandKit.urlLibraries" | "creator.brandKit.urlIcons" | "creator.livePreviews.dragWidget" | "creator.livePreviews.primaryWidget" | "creator.livePreviews.setPrimary" | "creator.livePreviews.publishLatest" | "creator.livePreviews.currentlyLive" | "creator.livePreviews.makeThisVersionLive" | "creator.livePreviews.publishThisDraft" | "creator.livePreviews.noCommitToPublish" | "creator.livePreviews.currentVersion" | "creator.livePreviews.editMode" | "creator.livePreviews.refreshPreview" | "creator.livePreviews.refresh" | "creator.livePreviews.openChat" | "creator.livePreviews.chat" | "creator.livePreviews.liveWidgetPreview" | "creator.livePreviews.building" | "creator.versions.addTitle" | "creator.versions.renameVersion" | "creator.versions.addVersionTitle" | "creator.versions.addATitleForThis" | "creator.versions.notPublishedPreviewOnly" | "creator.versions.live" | "creator.selector.select" | "creator.selector.doubleClickToRename" | "creator.selector.toggleList" | "creator.selector.noItemsFound" | "creator.name.unnamed" | "creator.name.saveName" | "creator.name.renameWidget" | "creator.designEdit.shownAsAppliedTheseControls" | "creator.designEdit.notAvailableInThisWidget" | "creator.fileSource.uploadFile" | "creator.fileSource.url" | "creator.elementSelector.removeSelectedElement" | "creator.elementSelector.clickPartToReference" | "creator.elementSelector.parentChild" | "creator.elementSelector.hold" | "creator.elementSelector.cmdCtrl" | "creator.elementSelector.toInteract" | "creator.elementSelector.esc" | "creator.elementSelector.done">;
|
|
954
|
+
export declare const translateEnglish: import("@widgetic/design-system/i18n").Translate<"creator.common.close" | "creator.common.new" | "creator.common.doubleClickToRename" | "creator.common.thisAppNeedsARefresh" | "creator.common.reload" | "creator.common.publish" | "creator.common.switchVersion" | "creator.common.live" | "creator.common.buildThisDraftVersionAnd" | "creator.common.setLive" | "creator.common.retry" | "creator.common.delete" | "creator.common.draft" | "creator.common.loading" | "creator.general.unknownError" | "creator.general.couldNotLoadUploadedImage" | "creator.general.tryUploadingTheImageAgain" | "creator.general.uploadFailed" | "creator.general.couldNotUpdateConversationStatus" | "creator.general.changeUndone" | "creator.general.failedToLoadEditorSettings" | "creator.general.setTo" | "creator.general.failedToUpdate" | "creator.general.failedToSaveDimensions" | "creator.general.nothingToSave" | "creator.general.serviceTemporarilyUnavailable" | "creator.general.retryingWhenTheApiIs" | "creator.general.invalidFileType" | "creator.general.pleaseSelectAnImageFile" | "creator.general.imageTooLarge" | "creator.general.maximumImageSizeIsMb" | "creator.general.tooManyImages" | "creator.general.maximumImagesAllowedRemoveAn" | "creator.general.failedToProcessImage" | "creator.general.couldNotReadTheImage" | "creator.general.imagePasted" | "creator.general.screenshotCaptureFailed" | "creator.general.missingOperationId" | "creator.general.switchToThatPanelTo" | "creator.general.limitReached" | "creator.general.rateLimited" | "creator.general.theApiRateLimitWas" | "creator.general.liveV" | "creator.general.anUnexpectedErrorOccurredPlease" | "creator.general.latestCommitIsAlreadyLive" | "creator.general.theServerRefusedTheRename" | "creator.general.checkYourConnectionAndTry" | "creator.general.unableToReachTheApi" | "creator.general.pleaseWaitForTheCurrent" | "creator.general.created" | "creator.general.saveBlocked" | "creator.general.keptALocalCopyCheck" | "creator.general.apiClientUnavailable" | "creator.general.screenshotCouldNotBeCaptured" | "creator.general.fixTheSelectionZoomOut" | "creator.general.checkConsoleForDetails" | "creator.general.retryLoad" | "creator.general.dismiss" | "creator.general.saving" | "creator.general.saved" | "creator.general.saveError" | "creator.general.loadingHistory" | "creator.general.upgrade" | "creator.general.fixInCreate" | "creator.general.save" | "creator.general.cancel" | "creator.general.noEditableSettingsAvailableYet" | "creator.general.dimensions" | "creator.general.w" | "creator.general.h" | "creator.general.px" | "creator.general.copy" | "creator.general.testPage" | "creator.general.zoomedReference" | "creator.general.keepInDatabase" | "creator.general.deleteFromDatabase" | "creator.general.checkingWhatWillBeDeleted" | "creator.general.describeWhatYouWant" | "creator.session.endedStartAgain" | "creator.session.canvasCannotOpen" | "creator.session.sessionEnded" | "creator.session.sessionExpiredSignInAgain" | "creator.session.sessionExpired" | "creator.session.authenticationExpired" | "creator.session.pleaseLoginAgainToContinue" | "creator.session.signInAgainToPublish" | "creator.session.loginRequiredToDuplicateWidget" | "creator.session.pleaseLoginFirst" | "creator.session.authenticationRequired" | "creator.session.pleaseLoginBeforeCreatingA" | "creator.session.thisWidgetReferencesARepository" | "creator.session.signInAgainThenRetry" | "creator.widget.notFound" | "creator.widget.fallbackName" | "creator.widget.noWidgetSelected" | "creator.widget.shapeRemoved" | "creator.widget.widgetKeptInDatabase" | "creator.widget.widgetDeletedFromDatabase" | "creator.widget.widgetWasAlreadyDeleted" | "creator.widget.failedToDeleteWidgetFrom" | "creator.widget.selectAWidgetFirst" | "creator.widget.duplicateFromTheHeaderCopies" | "creator.widget.failedToLoadWidgets" | "creator.widget.couldNotRestoreShapesYet" | "creator.widget.widgetRenamedTo" | "creator.widget.failedToRenameWidget" | "creator.widget.capturingWidgetScreenshot" | "creator.widget.widgetsApiClientIsNot" | "creator.widget.unlinkedWidgetShape" | "creator.widget.duplicatingWidget" | "creator.widget.failedToDuplicateWidget" | "creator.widget.widgetDuplicated" | "creator.widget.widgetKeptInDatabase2" | "creator.widget.youCanKeepEditingWidgets" | "creator.widget.widgetDraftCreated" | "creator.widget.failedToPrepareWidgetDraft" | "creator.widget.failedToCreateWidgetFrom" | "creator.widget.widgetCreatedButNoId" | "creator.widget.widgetCreated" | "creator.widget.failedToFinalizeWidgetConversion" | "creator.widget.repoIdToDeleteUse" | "creator.widget.restoreShapes" | "creator.widget.directWidgetUrl" | "creator.widget.deleteWidgetShape" | "creator.widget.theseWidgetsBelongToMore" | "creator.canvas.appearsEmptyButWidgets" | "creator.canvas.restoredShapes" | "creator.canvas.removedTheLeftoverShapeFrom" | "creator.canvas.clickAWidgetOnThe" | "creator.canvas.canvasIsNotReadyYet" | "creator.canvas.failedToLoadCanvases" | "creator.canvas.couldNotDeleteThisCanvas" | "creator.canvas.noCanvasIdCannotLoad" | "creator.canvas.canvasMayStillBeLoading" | "creator.canvas.widgetPreviewUpdatedOnCanvas" | "creator.canvas.widgetCanvasAndRepositoryAre" | "creator.canvas.canvasIsRequiredBeforePublishing" | "creator.canvas.thisShapePointsToA" | "creator.canvas.shapeRemovedFromCanvas" | "creator.canvas.canvasIsTakingLongerThan" | "creator.canvas.canvasShapesFailedToRender" | "creator.canvas.failedToLoadCanvasFrom" | "creator.canvas.canvasLoadFailedCheckSupabase" | "creator.canvas.apiMayBeThrottledOr" | "creator.canvas.canvasSnapshotLookedEmptyRefresh" | "creator.canvas.canvasSaved" | "creator.canvas.sketchRestored" | "creator.canvas.canvasSaveFailed" | "creator.canvas.canvasSavedLocally" | "creator.canvas.noCanvasIdYet" | "creator.canvas.canvasUnavailable" | "creator.canvas.canvasShapesFailedToLoad" | "creator.canvas.shapeDataMayBeMissing" | "creator.canvas.deleteCanvas" | "creator.composition.compositionCreated" | "creator.composition.failedToCreateComposition" | "creator.composition.compositionSaved" | "creator.composition.compositionRenamed" | "creator.composition.failedToRenameComposition" | "creator.composition.compositionDeleted" | "creator.composition.failedToDeleteComposition" | "creator.composition.fixTheSyntaxErrorIn" | "creator.composition.compositions" | "creator.composition.selectComposition" | "creator.composition.deleteThisComposition" | "creator.composition.webComponentFormatRequiresA" | "creator.composition.compositionUrl" | "creator.codegen.referenceImages" | "creator.codegen.referenceNumber" | "creator.codegen.missingReferenceImage" | "creator.codegen.unreadableAttachmentsTitle" | "creator.codegen.unreadableAttachments" | "creator.codegen.missingImageError" | "creator.codegen.visionModelNote" | "creator.codegen.noImageTitle" | "creator.codegen.repositoryCreated" | "creator.codegen.failedToCreateRepository" | "creator.codegen.noVisionNote" | "creator.codegen.codeRevertedToCommitRefreshing" | "creator.codegen.widgetCodeAtCommitRefreshing" | "creator.codegen.gitRollbackMayNotHave" | "creator.codegen.codeGenerationCompleted" | "creator.codegen.generationInProgress" | "creator.codegen.reconnectedToAnActiveCode" | "creator.codegen.codeSavedToGitlabAnd" | "creator.codegen.generationStopped" | "creator.codegen.codeGenerationWasCancelledYou" | "creator.codegen.couldNotStopGeneration" | "creator.codegen.generationMayStillBeRunning" | "creator.codegen.imageAddedToYourPrompt" | "creator.codegen.generateCodeFirstToCapture" | "creator.codegen.previewIsMissingTheCapture" | "creator.codegen.promptTooShort" | "creator.codegen.pleaseProvideAPromptWith" | "creator.codegen.mockCodeGenerated" | "creator.codegen.thisIsASimulationNo" | "creator.codegen.missingRepository" | "creator.codegen.coderVision" | "creator.codegen.answeredWithoutGenerating" | "creator.codegen.noGenerationStarted" | "creator.codegen.cannotTrackCodeGenerationProgress" | "creator.codegen.aiGeneratedInvalidSvelteSyntax" | "creator.codegen.codeSavedRebuildingPreview" | "creator.codegen.codeWasNotSaved" | "creator.codegen.codeWasNotSavedToTheRepository" | "creator.codegen.retrySavesItAndRecordsAVersion" | "creator.codegen.generationCompleted" | "creator.codegen.codeSavedPreviewIsLoading" | "creator.codegen.generationAlreadyInProgress" | "creator.codegen.anotherCodeGenerationIsAlready" | "creator.codegen.codeGenerationError" | "creator.codegen.imagePastedToPrompt" | "creator.codegen.codeGenerationInProgressWait" | "creator.codegen.repositoryMissingUseRebuildCode" | "creator.codegen.buildFailedCheckLogsFor" | "creator.codegen.createdWithExistingCode" | "creator.codegen.editTheSketchFreelySending" | "creator.codegen.isReadyGenerationStarted" | "creator.codegen.repositoryIsNowLinkedTo" | "creator.codegen.repositoryExists" | "creator.codegen.repositoryOwnedByAnotherAccount" | "creator.codegen.repositoryFound" | "creator.codegen.linkedToRepository" | "creator.codegen.repositoryReferenceInvalid" | "creator.codegen.supabaseDoesNotHaveThis" | "creator.codegen.unableToVerifyRepositoryStatus" | "creator.codegen.repositoryVerificationFailed" | "creator.codegen.repositoryCreationFailed" | "creator.codegen.couldNotDetermineRepositoryId" | "creator.codegen.repositoryCreatedButNotPersisted" | "creator.codegen.repositoryExistsButFailedTo" | "creator.codegen.repositoryReadyForUse" | "creator.codegen.generationFailed" | "creator.codegen.previewBuilderIsUnavailable" | "creator.codegen.theWidgetCodeWasSaved" | "creator.codegen.rebuildInCreate" | "creator.codegen.codeDoesNotCompile" | "creator.codegen.latestCodeDoesNotCompile" | "creator.codegen.generateCodeFirstToCustomize" | "creator.codegen.noWidgetCodeYet" | "creator.codegen.goToStep1Create" | "creator.codegen.confirmCodeGeneration" | "creator.codegen.reviewThePromptAndReference" | "creator.codegen.describeTheWidgetYouWant" | "creator.codegen.prompt" | "creator.codegen.editPromptFirst" | "creator.codegen.generateNow" | "creator.preview.newerThanLive" | "creator.preview.mayShowLive" | "creator.preview.rebuilt" | "creator.preview.versionHasCodeError" | "creator.preview.versionCouldNotLoad" | "creator.preview.versionHourlyLimit" | "creator.preview.recompiledIn" | "creator.preview.commitRefreshed" | "creator.preview.noValidPreviewAvailable" | "creator.preview.theWidgetDidNotRespond" | "creator.preview.captureErrorRefreshThePreview" | "creator.preview.imageWaitsForGeneration" | "creator.preview.savingImage" | "creator.preview.imageSaved" | "creator.preview.couldNotSaveImage" | "creator.preview.imageNotReturned" | "creator.version.checkpointRestored" | "creator.version.restoreCompletedWithWarnings" | "creator.version.failedToRestoreCheckpoint" | "creator.version.versionIsNowLive" | "creator.version.version" | "creator.version.theSelectedDraftVersionWas" | "creator.version.thisIsADraftVersion" | "creator.version.thisVersionIsNowWhat" | "creator.version.versionRenamed" | "creator.version.versionTitleCleared" | "creator.version.couldNotRenameTheVersion" | "creator.version.closeVersionHistory" | "creator.publish.cannotPublish" | "creator.publish.noEditableSettingsFoundGenerate" | "creator.publish.publishingViaWidgetBuilder" | "creator.publish.widgetPublished" | "creator.publish.publishedAutomaticallyAfterCodeGeneration" | "creator.publish.publishFailed" | "creator.publish.publishing" | "creator.publish.publishingInProgress" | "creator.publish.anotherWidgetIsPublishingWait" | "creator.publish.publishIsRunningInAnother" | "creator.publish.thisVersionIsAlreadyPublished" | "creator.publish.thisDraftHasNoRecorded" | "creator.publish.generateWidgetCodeBeforePublishing" | "creator.publish.publishWidget" | "creator.publish.noNewVersionToPublish" | "creator.publish.publishNewV" | "creator.publish.generateOrRebuildSoWe" | "creator.publish.cannotPublishYet" | "creator.publish.publishedVSuccessfully" | "creator.publish.published" | "creator.publish.widgetPublishFailed" | "creator.publish.failedToLoadPublishHistory" | "creator.publish.pressPublishToMakeThe" | "creator.publish.failedToSetLiveVersion" | "creator.publish.publishTheLatestGeneratedCode" | "creator.publish.liveGenerateNewCodeTo" | "creator.publish.publishThisVersionSoVisitors" | "creator.publish.noHistoryRecordsYetGenerate" | "creator.publish.retryPublish" | "creator.publish.notPublishedYet" | "creator.publish.generateOnCreatePreviewThe" | "creator.publish.widgetNotPublishedYet" | "creator.publish.publishYourWidgetFromThe" | "creator.publish.publishYourWidgetFromTheCreate" | "creator.embed.codeTitle" | "creator.embed.formatIframe" | "creator.embed.formatWebComponent" | "creator.embed.copied" | "creator.embed.versionIsLiveAndReady" | "creator.embed.embedYourWidget" | "creator.embed.setDimensionsAndCopyThe" | "creator.embed.embedWidth" | "creator.embed.embedHeight" | "creator.embed.copyEmbedCode" | "creator.embed.embedFormat" | "creator.dialog.removeShape" | "creator.dialog.alsoDeleteWidget" | "creator.dialog.deleteCanvas" | "creator.dialog.alsoDeleteWidgets" | "creator.status.label" | "creator.status.preparingCodeGeneration" | "creator.status.ready" | "creator.status.completedPreviewReady" | "creator.status.completedAutoSaving" | "creator.status.completedSaved" | "creator.status.completedChangesSaved" | "creator.status.failed" | "creator.status.stoppedByUser" | "creator.status.fixingCompilationErrors" | "creator.status.generatingMockCode" | "creator.status.mockCodeComplete" | "creator.status.processingQueuedRequest" | "creator.status.sessionExpired" | "creator.status.repositoryRequired" | "creator.status.runningQueued" | "creator.status.repositoryReady" | "creator.status.answeredFromDetails" | "creator.status.needMoreDetail" | "creator.status.noGenerationNeeded" | "creator.status.authenticationExpired" | "creator.status.noOperationId" | "creator.status.processingQueued" | "creator.status.inProgress" | "creator.status.generating" | "creator.status.generatingProgress" | "creator.status.savedBuildingPreview" | "creator.status.savedLoadingPreview" | "creator.status.savedPreviewRebuilt" | "creator.status.alreadySavedCompilingPreview" | "creator.status.alreadySavedShaCompilingPreview" | "creator.status.alreadySavedPreviewFailed" | "creator.status.alreadySavedShaPreviewFailed" | "creator.status.previewReady" | "creator.status.alreadyRunning" | "creator.status.needsRefresh" | "creator.status.limitReached" | "creator.status.rateLimited" | "creator.status.failedWithReason" | "creator.status.reconnected" | "creator.conversation.version" | "creator.conversation.previousVersion" | "creator.conversation.restoredFromCommit" | "creator.conversation.completedCommitPreviewLoading" | "creator.conversation.completedCommitPreviewReady" | "creator.conversation.completedPreviewLoading" | "creator.conversation.codeSavedShaBuilding" | "creator.conversation.codeSavedShaLoading" | "creator.conversation.codeSavedShaRebuilt" | "creator.conversation.codeSavedCommitPreviewFailed" | "creator.conversation.stoppedRetryPrompt" | "creator.conversation.previewRecompiled" | "creator.conversation.previewRecompiledCommitPart" | "creator.conversation.previewRecompiledDurationPart" | "creator.conversation.alreadyDoneWithCommit" | "creator.conversation.alreadyDone" | "creator.conversation.alreadyDoneFilesSuffix" | "creator.conversation.convert" | "creator.conversation.widgetConversion" | "creator.error.generationFailedWhileYouWere" | "creator.error.generationTrackingLost" | "creator.error.unableToResolveRepositoryFor" | "creator.error.authenticationExpiredPleaseLoginAgain" | "creator.error.cannotTrackCodeGenerationProgress" | "creator.error.usageLimitExceeded" | "creator.error.tooManyRequestsPleaseTry" | "creator.error.codeGenerationFailed" | "creator.error.widgetBuilderIsNotReachable" | "creator.error.buildRequestFailed" | "creator.error.notAuthenticated" | "creator.error.apiClientIsNotConfigured" | "creator.error.publishedVersionIsNotAvailable" | "creator.error.failedToCompileWidgetCode" | "creator.error.previewNotReadyYetClick" | "creator.error.previewNotReadyYetClickRebuild" | "creator.error.previewLoadedButTheWidget" | "creator.error.previewTimedOutTheDev" | "creator.error.couldNotOpenPreviewUrl" | "creator.error.couldNotFetchThePreview" | "creator.error.widgetPreviewRuntimeErrorHttp" | "creator.error.previewBuildFailed" | "creator.error.savedCodeCouldNotBeCompiled" | "creator.error.couldNotReachThePreview" | "creator.error.previewRebuildIsUnavailableIn" | "creator.error.previewBuilderIsUnavailableThe" | "creator.error.previewBuilderReturnedAnUnexpected" | "creator.error.anUnknownErrorOccurred" | "creator.error.couldNotReachTheServer" | "creator.error.buildFailed" | "creator.details.fixThePromptOrAttachments" | "creator.details.codeGenerationWillStartShortly" | "creator.details.saveWillExecuteShortly" | "creator.details.codeGenerationQueued" | "creator.details.saveQueued" | "creator.details.closeWidgetDetails" | "creator.details.widgetDraft" | "creator.details.createWidgetCode" | "creator.details.create" | "creator.details.editComposition" | "creator.details.publishTheWidgetToEdit" | "creator.details.edit" | "creator.details.embedThePublishedWidget" | "creator.details.publishTheWidgetToGet" | "creator.details.embed" | "creator.details.openLivePreview" | "creator.details.closeLivePreview" | "creator.details.showLivePreview" | "creator.details.preview" | "creator.details.dragToResizeChatPreview" | "creator.details.livePreview" | "creator.details.recompileWidgetCodeForPreview" | "creator.details.rebuilding" | "creator.details.rebuild" | "creator.details.clickToFocusThisWidget" | "creator.details.livePreviewBelow" | "creator.details.generatingCode" | "creator.details.loadingPreview" | "creator.details.sketchDraft" | "creator.details.yourSketchIsStillOn" | "creator.details.sendThePromptInChat" | "creator.details.preparingWidget" | "creator.details.settingUpRepository" | "creator.details.widgetHasNoRepository" | "creator.details.repositoryCreationFailedPreviouslyClick" | "creator.details.createRepository" | "creator.details.noCodeYet" | "creator.details.writeAPromptAndGenerate" | "creator.details.generateNow" | "creator.details.previewUnavailable" | "creator.details.rebuildCode" | "creator.details.fixCompileError" | "creator.details.retryBuild" | "creator.details.retry" | "creator.details.buildingPreview" | "creator.details.compilingWidgetCode" | "creator.details.previewWillAppearAfterCode" | "creator.details.resizePanel" | "creator.details.resizeWidth" | "creator.details.resizeHeight" | "creator.brandKit.addFont" | "creator.brandKit.fontLabel" | "creator.brandKit.brandKit" | "creator.brandKit.languageIsFixedAfterThe" | "creator.brandKit.selectLanguage" | "creator.brandKit.libraries" | "creator.brandKit.addLibrary" | "creator.brandKit.uploadLibrary" | "creator.brandKit.removeLibrary" | "creator.brandKit.replacesTheWidgeticPaletteFor" | "creator.brandKit.colorPalette" | "creator.brandKit.primary" | "creator.brandKit.secondary" | "creator.brandKit.title" | "creator.brandKit.sub" | "creator.brandKit.fonts" | "creator.brandKit.font" | "creator.brandKit.removeFont" | "creator.brandKit.uploadFonts" | "creator.brandKit.uploadAFontFileOr" | "creator.brandKit.urlArchiveWoff2TtfOtf" | "creator.brandKit.removeUploadedFont" | "creator.brandKit.icons" | "creator.brandKit.addIconLibrary" | "creator.brandKit.removeIconLibrary" | "creator.brandKit.uploadCustomLibraryTooltip" | "creator.brandKit.uploadIconLibraryTooltip" | "creator.brandKit.urlLibraries" | "creator.brandKit.urlIcons" | "creator.livePreviews.dragWidget" | "creator.livePreviews.primaryWidget" | "creator.livePreviews.setPrimary" | "creator.livePreviews.publishLatest" | "creator.livePreviews.currentlyLive" | "creator.livePreviews.makeThisVersionLive" | "creator.livePreviews.publishThisDraft" | "creator.livePreviews.noCommitToPublish" | "creator.livePreviews.currentVersion" | "creator.livePreviews.editMode" | "creator.livePreviews.refreshPreview" | "creator.livePreviews.refresh" | "creator.livePreviews.openChat" | "creator.livePreviews.chat" | "creator.livePreviews.liveWidgetPreview" | "creator.livePreviews.building" | "creator.versions.addTitle" | "creator.versions.renameVersion" | "creator.versions.addVersionTitle" | "creator.versions.addATitleForThis" | "creator.versions.notPublishedPreviewOnly" | "creator.versions.live" | "creator.selector.select" | "creator.selector.doubleClickToRename" | "creator.selector.toggleList" | "creator.selector.noItemsFound" | "creator.name.unnamed" | "creator.name.saveName" | "creator.name.renameWidget" | "creator.designEdit.shownAsAppliedTheseControls" | "creator.designEdit.notAvailableInThisWidget" | "creator.fileSource.uploadFile" | "creator.fileSource.url" | "creator.elementSelector.removeSelectedElement" | "creator.elementSelector.clickPartToReference" | "creator.elementSelector.parentChild" | "creator.elementSelector.hold" | "creator.elementSelector.cmdCtrl" | "creator.elementSelector.toInteract" | "creator.elementSelector.esc" | "creator.elementSelector.done">;
|
package/dist/i18n/messages.d.ts
CHANGED
|
@@ -177,6 +177,8 @@ export declare const CREATOR_MESSAGES: {
|
|
|
177
177
|
readonly 'creator.codegen.referenceImages': "Reference Images ({count})";
|
|
178
178
|
readonly 'creator.codegen.referenceNumber': "Reference {number}";
|
|
179
179
|
readonly 'creator.codegen.missingReferenceImage': "Missing reference image";
|
|
180
|
+
readonly 'creator.codegen.unreadableAttachmentsTitle': "Some attached files were not used";
|
|
181
|
+
readonly 'creator.codegen.unreadableAttachments': "The builder reads images, CSV files and Markdown or text files. It did not read: {names}. Paste the text into your message instead.";
|
|
180
182
|
readonly 'creator.codegen.missingImageError': "Your prompt mentions an attached image, but there is no attachment in the chat. Use the Upload button.";
|
|
181
183
|
readonly 'creator.codegen.visionModelNote': "With attached images a vision model is used automatically — the same one the server uses.";
|
|
182
184
|
readonly 'creator.codegen.noImageTitle': "Generating without an image";
|
|
@@ -358,6 +360,11 @@ export declare const CREATOR_MESSAGES: {
|
|
|
358
360
|
readonly 'creator.status.savedBuildingPreview': "Code saved — building preview…";
|
|
359
361
|
readonly 'creator.status.savedLoadingPreview': "Code saved — loading preview…";
|
|
360
362
|
readonly 'creator.status.savedPreviewRebuilt': "Code saved — preview rebuilt from saved code.";
|
|
363
|
+
readonly 'creator.status.alreadySavedCompilingPreview': "Code already saved — compiling preview…";
|
|
364
|
+
readonly 'creator.status.alreadySavedShaCompilingPreview': "Code already saved ({sha}) — compiling preview…";
|
|
365
|
+
readonly 'creator.status.alreadySavedPreviewFailed': "Code already saved — preview failed.";
|
|
366
|
+
readonly 'creator.status.alreadySavedShaPreviewFailed': "Code already saved ({sha}) — preview failed.";
|
|
367
|
+
readonly 'creator.status.previewReady': "Preview ready";
|
|
361
368
|
readonly 'creator.status.alreadyRunning': "A code generation is already running. Please wait for it to finish.";
|
|
362
369
|
readonly 'creator.status.needsRefresh': "This app needs a refresh to continue.";
|
|
363
370
|
readonly 'creator.status.limitReached': "Limit reached for now. Please try again later.";
|
|
@@ -405,6 +412,7 @@ export declare const CREATOR_MESSAGES: {
|
|
|
405
412
|
readonly 'creator.error.couldNotFetchThePreview': "Could not fetch the preview URL. The Worker may be unavailable.";
|
|
406
413
|
readonly 'creator.error.widgetPreviewRuntimeErrorHttp': "Widget preview runtime error (HTTP 500)";
|
|
407
414
|
readonly 'creator.error.previewBuildFailed': "Preview build failed.";
|
|
415
|
+
readonly 'creator.error.savedCodeCouldNotBeCompiled': "The saved code could not be compiled into a preview.";
|
|
408
416
|
readonly 'creator.error.couldNotReachThePreview': "Could not reach the preview builder. Try Rebuild.";
|
|
409
417
|
readonly 'creator.error.previewRebuildIsUnavailableIn': "Preview rebuild is unavailable in this session. Try Rebuild or reload the page.";
|
|
410
418
|
readonly 'creator.error.previewBuilderIsUnavailableThe': "Preview builder is unavailable. The widget code was saved — use Rebuild to compile it.";
|
package/dist/i18n/messages.js
CHANGED
|
@@ -184,6 +184,8 @@ export const CREATOR_MESSAGES = {
|
|
|
184
184
|
'creator.codegen.referenceImages': 'Reference Images ({count})',
|
|
185
185
|
'creator.codegen.referenceNumber': 'Reference {number}',
|
|
186
186
|
'creator.codegen.missingReferenceImage': 'Missing reference image',
|
|
187
|
+
'creator.codegen.unreadableAttachmentsTitle': 'Some attached files were not used',
|
|
188
|
+
'creator.codegen.unreadableAttachments': 'The builder reads images, CSV files and Markdown or text files. It did not read: {names}. Paste the text into your message instead.',
|
|
187
189
|
'creator.codegen.missingImageError': 'Your prompt mentions an attached image, but there is no attachment in the chat. Use the Upload button.',
|
|
188
190
|
'creator.codegen.visionModelNote': 'With attached images a vision model is used automatically — the same one the server uses.',
|
|
189
191
|
'creator.codegen.noImageTitle': 'Generating without an image',
|
|
@@ -371,6 +373,11 @@ export const CREATOR_MESSAGES = {
|
|
|
371
373
|
'creator.status.savedBuildingPreview': 'Code saved — building preview…',
|
|
372
374
|
'creator.status.savedLoadingPreview': 'Code saved — loading preview…',
|
|
373
375
|
'creator.status.savedPreviewRebuilt': 'Code saved — preview rebuilt from saved code.',
|
|
376
|
+
'creator.status.alreadySavedCompilingPreview': 'Code already saved — compiling preview…',
|
|
377
|
+
'creator.status.alreadySavedShaCompilingPreview': 'Code already saved ({sha}) — compiling preview…',
|
|
378
|
+
'creator.status.alreadySavedPreviewFailed': 'Code already saved — preview failed.',
|
|
379
|
+
'creator.status.alreadySavedShaPreviewFailed': 'Code already saved ({sha}) — preview failed.',
|
|
380
|
+
'creator.status.previewReady': 'Preview ready',
|
|
374
381
|
'creator.status.alreadyRunning': 'A code generation is already running. Please wait for it to finish.',
|
|
375
382
|
'creator.status.needsRefresh': 'This app needs a refresh to continue.',
|
|
376
383
|
'creator.status.limitReached': 'Limit reached for now. Please try again later.',
|
|
@@ -420,6 +427,7 @@ export const CREATOR_MESSAGES = {
|
|
|
420
427
|
'creator.error.couldNotFetchThePreview': 'Could not fetch the preview URL. The Worker may be unavailable.',
|
|
421
428
|
'creator.error.widgetPreviewRuntimeErrorHttp': 'Widget preview runtime error (HTTP 500)',
|
|
422
429
|
'creator.error.previewBuildFailed': 'Preview build failed.',
|
|
430
|
+
'creator.error.savedCodeCouldNotBeCompiled': 'The saved code could not be compiled into a preview.',
|
|
423
431
|
'creator.error.couldNotReachThePreview': 'Could not reach the preview builder. Try Rebuild.',
|
|
424
432
|
'creator.error.previewRebuildIsUnavailableIn': 'Preview rebuild is unavailable in this session. Try Rebuild or reload the page.',
|
|
425
433
|
'creator.error.previewBuilderIsUnavailableThe': 'Preview builder is unavailable. The widget code was saved — use Rebuild to compile it.',
|
package/dist/i18n/statusText.js
CHANGED
|
@@ -33,6 +33,10 @@ const KNOWN_TEXTS = new Map([
|
|
|
33
33
|
['Code saved — building preview…', (t) => t('creator.status.savedBuildingPreview')],
|
|
34
34
|
['Code saved — loading preview…', (t) => t('creator.status.savedLoadingPreview')],
|
|
35
35
|
['Code saved — preview rebuilt from saved code.', (t) => t('creator.status.savedPreviewRebuilt')],
|
|
36
|
+
['Code already saved — compiling preview…', (t) => t('creator.status.alreadySavedCompilingPreview')],
|
|
37
|
+
['Code already saved — preview failed.', (t) => t('creator.status.alreadySavedPreviewFailed')],
|
|
38
|
+
['The saved code could not be compiled into a preview.', (t) => t('creator.error.savedCodeCouldNotBeCompiled')],
|
|
39
|
+
['Preview ready', (t) => t('creator.status.previewReady')],
|
|
36
40
|
['A code generation is already running. Please wait for it to finish.', (t) => t('creator.status.alreadyRunning')],
|
|
37
41
|
['This app needs a refresh to continue.', (t) => t('creator.status.needsRefresh')],
|
|
38
42
|
['Limit reached for now. Please try again later.', (t) => t('creator.status.limitReached')],
|
|
@@ -73,6 +77,9 @@ const KNOWN_PATTERNS = [
|
|
|
73
77
|
{ pattern: /^Code generation failed: ([\s\S]+)$/, say: (found, t) => t('creator.status.failedWithReason', { reason: sayKnown(found[1], t) ?? found[1] }) },
|
|
74
78
|
{ pattern: /^Reconnected — code generation in progress\.\.\. (\d+)%$/, say: (found, t) => t('creator.status.reconnected', { progress: found[1] }) },
|
|
75
79
|
{ pattern: /^Generating code\.\.\. \((\d+)%\)$/, say: (found, t) => t('creator.status.generatingProgress', { progress: found[1] }) },
|
|
80
|
+
// The same two "already saved" lines with the commit the creator names in them
|
|
81
|
+
{ pattern: /^Code already saved \(([a-f0-9]{7,8})\) — compiling preview…$/, say: (found, t) => t('creator.status.alreadySavedShaCompilingPreview', { sha: found[1] }) },
|
|
82
|
+
{ pattern: /^Code already saved \(([a-f0-9]{7,8})\) — preview failed\.$/, say: (found, t) => t('creator.status.alreadySavedShaPreviewFailed', { sha: found[1] }) },
|
|
76
83
|
];
|
|
77
84
|
/** How a version name reads in a line the chat saved in English ("Version 4", "a previous version"). */
|
|
78
85
|
function sayVersionNameInConversation(name, t) {
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which attached files the widget builder can use, and which it cannot.
|
|
3
|
+
*
|
|
4
|
+
* The chat takes any file (a Markdown note, a PDF, a text file, a sound), but the builder reads three kinds: pictures,
|
|
5
|
+
* which it looks at, CSV files, which it reads for their columns and rows, and Markdown and text files, whose words
|
|
6
|
+
* go into the prompt as the person's own brief. Anything else used to travel with the message and be dropped without
|
|
7
|
+
* a word, so the person believed the builder had read it. `unreadableAttachmentNames` is what lets the creator say so.
|
|
8
|
+
*
|
|
9
|
+
* Pure: no DOM, no network (reading a text file takes the reader as a parameter).
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* What the gateway takes of text documents (`TEXT_DOCUMENT_CONFIG` in the gateway's constants). The gateway cuts and
|
|
13
|
+
* checks again; these bounds only keep a request from carrying a file the gateway would refuse whole.
|
|
14
|
+
*/
|
|
15
|
+
export declare const TEXT_DOCUMENT_LIMITS: {
|
|
16
|
+
readonly maxDocuments: 3;
|
|
17
|
+
readonly maxCharactersPerDocument: 40000;
|
|
18
|
+
/** A larger file is not read at all: it is not a brief. */
|
|
19
|
+
readonly maxBytesPerDocument: number;
|
|
20
|
+
};
|
|
21
|
+
/** What the creator knows of one attached file. */
|
|
22
|
+
export interface AttachedFileInfo {
|
|
23
|
+
fileType?: string | null;
|
|
24
|
+
fileName?: string | null;
|
|
25
|
+
}
|
|
26
|
+
/** A CSV by its type or, because browsers name it many ways, by its name. */
|
|
27
|
+
export declare function isCsvFile({ fileType, fileName }: AttachedFileInfo): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* A Markdown or text file, by name or by type. A CSV is not one even when a browser calls it text/plain: it is read for
|
|
30
|
+
* its columns and rows.
|
|
31
|
+
*/
|
|
32
|
+
export declare function isTextDocumentFile(file: AttachedFileInfo): boolean;
|
|
33
|
+
/** Whether the builder reads this file: a picture, a CSV, or a Markdown or text file. */
|
|
34
|
+
export declare function isReadableByBuilder(file: AttachedFileInfo): boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Whether the file is sent to the gateway by its upload id (pictures and CSV files, which the gateway fetches). A text
|
|
37
|
+
* document is not: its words are read here and travel in the request.
|
|
38
|
+
*/
|
|
39
|
+
export declare function isSentByUploadId(file: AttachedFileInfo): boolean;
|
|
40
|
+
/** One text document as the generate request carries it. */
|
|
41
|
+
export interface TextDocumentForRequest {
|
|
42
|
+
name: string;
|
|
43
|
+
text: string;
|
|
44
|
+
}
|
|
45
|
+
/** What reading the attached text documents gave: the documents, and the names of the files that could not be read. */
|
|
46
|
+
export interface TextDocumentReading {
|
|
47
|
+
documents: TextDocumentForRequest[];
|
|
48
|
+
unreadableNames: string[];
|
|
49
|
+
}
|
|
50
|
+
/** A file the creator can read the words of. */
|
|
51
|
+
export interface ReadableAttachment extends AttachedFileInfo {
|
|
52
|
+
file?: {
|
|
53
|
+
size?: number;
|
|
54
|
+
text(): Promise<string>;
|
|
55
|
+
} | null;
|
|
56
|
+
fileSize?: number | null;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Reads the Markdown and text files among the attachments. The first few are read, each cut at a line break to the
|
|
60
|
+
* character bound; a file that is too large, empty, binary, or that the browser cannot read is named in
|
|
61
|
+
* `unreadableNames` so the person is told, rather than sent without its words.
|
|
62
|
+
*/
|
|
63
|
+
export declare function readTextDocumentAttachments(attachments: readonly ReadableAttachment[]): Promise<TextDocumentReading>;
|
|
64
|
+
/** The text cut to at most `limit` characters, at the last line break before the limit when there is one. */
|
|
65
|
+
export declare function cutAtLineBreak(text: string, limit: number): string;
|
|
66
|
+
/**
|
|
67
|
+
* The names of the attached files the builder cannot use, as one sentence fragment ("notes.md, brief.pdf"), or an
|
|
68
|
+
* empty string when it can use all of them.
|
|
69
|
+
*/
|
|
70
|
+
export declare function unreadableAttachmentNames(files: readonly AttachedFileInfo[]): string;
|
|
71
|
+
/** A list of names as one sentence fragment, the rest counted. */
|
|
72
|
+
export declare function joinNames(names: readonly string[]): string;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which attached files the widget builder can use, and which it cannot.
|
|
3
|
+
*
|
|
4
|
+
* The chat takes any file (a Markdown note, a PDF, a text file, a sound), but the builder reads three kinds: pictures,
|
|
5
|
+
* which it looks at, CSV files, which it reads for their columns and rows, and Markdown and text files, whose words
|
|
6
|
+
* go into the prompt as the person's own brief. Anything else used to travel with the message and be dropped without
|
|
7
|
+
* a word, so the person believed the builder had read it. `unreadableAttachmentNames` is what lets the creator say so.
|
|
8
|
+
*
|
|
9
|
+
* Pure: no DOM, no network (reading a text file takes the reader as a parameter).
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* What the gateway takes of text documents (`TEXT_DOCUMENT_CONFIG` in the gateway's constants). The gateway cuts and
|
|
13
|
+
* checks again; these bounds only keep a request from carrying a file the gateway would refuse whole.
|
|
14
|
+
*/
|
|
15
|
+
export const TEXT_DOCUMENT_LIMITS = {
|
|
16
|
+
maxDocuments: 3,
|
|
17
|
+
maxCharactersPerDocument: 40_000,
|
|
18
|
+
/** A larger file is not read at all: it is not a brief. */
|
|
19
|
+
maxBytesPerDocument: 256 * 1024
|
|
20
|
+
};
|
|
21
|
+
const TEXT_DOCUMENT_EXTENSIONS = ['.md', '.markdown', '.mdx', '.txt', '.text'];
|
|
22
|
+
const TEXT_DOCUMENT_MEDIA_TYPES = ['text/markdown', 'text/x-markdown', 'text/plain'];
|
|
23
|
+
/** A CSV by its type or, because browsers name it many ways, by its name. */
|
|
24
|
+
export function isCsvFile({ fileType, fileName }) {
|
|
25
|
+
return fileType === 'text/csv' || Boolean(fileName && fileName.toLowerCase().endsWith('.csv'));
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* A Markdown or text file, by name or by type. A CSV is not one even when a browser calls it text/plain: it is read for
|
|
29
|
+
* its columns and rows.
|
|
30
|
+
*/
|
|
31
|
+
export function isTextDocumentFile(file) {
|
|
32
|
+
if (isCsvFile(file) || file.fileType === 'text/csv')
|
|
33
|
+
return false;
|
|
34
|
+
const name = (file.fileName ?? '').toLowerCase();
|
|
35
|
+
if (TEXT_DOCUMENT_EXTENSIONS.some((extension) => name.endsWith(extension)))
|
|
36
|
+
return true;
|
|
37
|
+
const type = (file.fileType ?? '').split(';')[0]?.trim().toLowerCase() ?? '';
|
|
38
|
+
return TEXT_DOCUMENT_MEDIA_TYPES.includes(type);
|
|
39
|
+
}
|
|
40
|
+
/** Whether the builder reads this file: a picture, a CSV, or a Markdown or text file. */
|
|
41
|
+
export function isReadableByBuilder(file) {
|
|
42
|
+
return (Boolean(file.fileType && file.fileType.startsWith('image/')) ||
|
|
43
|
+
isCsvFile(file) ||
|
|
44
|
+
isTextDocumentFile(file));
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Whether the file is sent to the gateway by its upload id (pictures and CSV files, which the gateway fetches). A text
|
|
48
|
+
* document is not: its words are read here and travel in the request.
|
|
49
|
+
*/
|
|
50
|
+
export function isSentByUploadId(file) {
|
|
51
|
+
return isReadableByBuilder(file) && !isTextDocumentFile(file);
|
|
52
|
+
}
|
|
53
|
+
/** Text with control characters other than line breaks and tabs, or the replacement character, is not a text file. */
|
|
54
|
+
function looksLikeText(text) {
|
|
55
|
+
// eslint-disable-next-line no-control-regex
|
|
56
|
+
return !/[\u0000-\u0008\u000E-\u001F\uFFFD]/.test(text);
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Reads the Markdown and text files among the attachments. The first few are read, each cut at a line break to the
|
|
60
|
+
* character bound; a file that is too large, empty, binary, or that the browser cannot read is named in
|
|
61
|
+
* `unreadableNames` so the person is told, rather than sent without its words.
|
|
62
|
+
*/
|
|
63
|
+
export async function readTextDocumentAttachments(attachments) {
|
|
64
|
+
const documents = [];
|
|
65
|
+
const unreadableNames = [];
|
|
66
|
+
for (const attachment of attachments) {
|
|
67
|
+
if (!isTextDocumentFile(attachment))
|
|
68
|
+
continue;
|
|
69
|
+
const name = attachment.fileName?.trim() || 'a file';
|
|
70
|
+
if (documents.length >= TEXT_DOCUMENT_LIMITS.maxDocuments) {
|
|
71
|
+
unreadableNames.push(name);
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
const size = attachment.file?.size ?? attachment.fileSize ?? 0;
|
|
75
|
+
if (!attachment.file || size > TEXT_DOCUMENT_LIMITS.maxBytesPerDocument) {
|
|
76
|
+
unreadableNames.push(name);
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
try {
|
|
80
|
+
const raw = (await attachment.file.text()).replace(/^\uFEFF/, '').replace(/\r\n?/g, '\n');
|
|
81
|
+
if (!raw.trim() || !looksLikeText(raw)) {
|
|
82
|
+
unreadableNames.push(name);
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
documents.push({
|
|
86
|
+
name,
|
|
87
|
+
text: cutAtLineBreak(raw, TEXT_DOCUMENT_LIMITS.maxCharactersPerDocument)
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
catch (error) {
|
|
91
|
+
console.warn('[codegenAttachments] Could not read a text attachment', { name, error });
|
|
92
|
+
unreadableNames.push(name);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return { documents, unreadableNames };
|
|
96
|
+
}
|
|
97
|
+
/** The text cut to at most `limit` characters, at the last line break before the limit when there is one. */
|
|
98
|
+
export function cutAtLineBreak(text, limit) {
|
|
99
|
+
if (text.length <= limit)
|
|
100
|
+
return text;
|
|
101
|
+
const cut = text.slice(0, limit);
|
|
102
|
+
const lastBreak = cut.lastIndexOf('\n');
|
|
103
|
+
return (lastBreak > limit / 2 ? cut.slice(0, lastBreak) : cut).trimEnd();
|
|
104
|
+
}
|
|
105
|
+
/** Longest list of names put in a message; the rest is counted. */
|
|
106
|
+
const MAX_NAMES_SHOWN = 3;
|
|
107
|
+
/**
|
|
108
|
+
* The names of the attached files the builder cannot use, as one sentence fragment ("notes.md, brief.pdf"), or an
|
|
109
|
+
* empty string when it can use all of them.
|
|
110
|
+
*/
|
|
111
|
+
export function unreadableAttachmentNames(files) {
|
|
112
|
+
return joinNames(files
|
|
113
|
+
.filter((file) => !isReadableByBuilder(file))
|
|
114
|
+
.map((file) => file.fileName?.trim() || 'a file'));
|
|
115
|
+
}
|
|
116
|
+
/** A list of names as one sentence fragment, the rest counted. */
|
|
117
|
+
export function joinNames(names) {
|
|
118
|
+
if (names.length <= MAX_NAMES_SHOWN)
|
|
119
|
+
return names.join(', ');
|
|
120
|
+
return `${names.slice(0, MAX_NAMES_SHOWN).join(', ')} and ${names.length - MAX_NAMES_SHOWN} more`;
|
|
121
|
+
}
|
|
@@ -44,7 +44,11 @@ export interface SelectedWidgetElementReference {
|
|
|
44
44
|
/** Compact human-readable label (`<em> · to shared company work.`) */
|
|
45
45
|
label: string;
|
|
46
46
|
}
|
|
47
|
-
|
|
47
|
+
/**
|
|
48
|
+
* Whether the element may be picked. A plain boolean on purpose: a type guard (`element is Element`) would make the
|
|
49
|
+
* compiler read `!isPickableElement(next)` as "next is not an element at all" and type it `never` in `parentToPick`.
|
|
50
|
+
*/
|
|
51
|
+
export declare function isPickableElement(element: Element | null): boolean;
|
|
48
52
|
/**
|
|
49
53
|
* Climb out of SVG internals (`<path>`, `<g>`, `<use>`, `<circle>`) so hovering an icon
|
|
50
54
|
* selects the `<svg>` root rather than a single vector path, matching Chrome Extension `pickTarget`.
|
|
@@ -10,6 +10,10 @@
|
|
|
10
10
|
const NEVER_PICKED = new Set(['html', 'body', 'head', 'script', 'style', 'link', 'meta']);
|
|
11
11
|
const SVG_NS = 'http://www.w3.org/2000/svg';
|
|
12
12
|
const MAX_SHADOW_DEPTH = 24;
|
|
13
|
+
/**
|
|
14
|
+
* Whether the element may be picked. A plain boolean on purpose: a type guard (`element is Element`) would make the
|
|
15
|
+
* compiler read `!isPickableElement(next)` as "next is not an element at all" and type it `never` in `parentToPick`.
|
|
16
|
+
*/
|
|
13
17
|
export function isPickableElement(element) {
|
|
14
18
|
if (!element || !element.tagName)
|
|
15
19
|
return false;
|
|
@@ -29,7 +33,7 @@ export function pickTarget(element) {
|
|
|
29
33
|
break;
|
|
30
34
|
node = node.parentElement;
|
|
31
35
|
}
|
|
32
|
-
return isPickableElement(node) ? node : null;
|
|
36
|
+
return node !== null && isPickableElement(node) ? node : null;
|
|
33
37
|
}
|
|
34
38
|
/**
|
|
35
39
|
* Walk up one pickable ancestor, crossing ShadowRoot boundaries if needed,
|