@widgetic/creator 0.4.32 → 0.4.34

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.
@@ -192,6 +192,14 @@
192
192
  type OperationSnapshot
193
193
  } from './utils/generationSharing.js';
194
194
  import { failureNoticeChanges } from './utils/failureNotice.js';
195
+ import { generationVersionAndDocumentFields } from './utils/generationRequestFields.js';
196
+ import {
197
+ generationRefusalText,
198
+ headCommitForComparison,
199
+ operationToFollow,
200
+ readTeamEditingRefusalOf,
201
+ restoreRefusalText
202
+ } from './utils/teamEditingRefusals.js';
195
203
  import { generateEmbedCode, EMBED_FORMATS, type EmbedFormat } from './utils/embedCode.js';
196
204
 
197
205
  function openEmbedTestPage(href: string) {
@@ -216,6 +224,7 @@
216
224
  setHostHandlers,
217
225
  mayUseAddressBar,
218
226
  mayShowAccountBilling,
227
+ maySuggestWidgetName,
219
228
  mayListenToSiteEvents,
220
229
  announceToSite,
221
230
  eventIsFromCreator,
@@ -3509,16 +3518,23 @@
3509
3518
  checkpointMessageId: string,
3510
3519
  restoreWidgetId?: string | null,
3511
3520
  ): Promise<any> {
3521
+ // The widget whose code the restore puts back, as the panel looks at it when the request is made (the person may look at
3522
+ // another panel while it runs).
3523
+ const widgetIdAtRestore = restoreWidgetId || focusedPanelWidgetId || selectedWidgetId || null;
3512
3524
  try {
3513
3525
  if (!messagesClient) {
3514
3526
  console.warn('[Chat→Backend] messagesClient not initialized');
3515
3527
  return null;
3516
3528
  }
3529
+ // The head the person is looking at. The API refuses the restore, before it deletes a message, when newer code was saved
3530
+ // since (a teammate, another window): rolling back over it would lose it.
3531
+ const expectedHeadSha = widgetIdAtRestore ? shownHeadCommitSha(widgetIdAtRestore) : null;
3517
3532
  const response = await messagesClient.restoreCheckpointRaw({
3518
3533
  conversationId,
3519
3534
  restoreCheckpointRequest: {
3520
3535
  conversationId,
3521
3536
  checkpointMessageId,
3537
+ ...(expectedHeadSha ? { expectedHeadSha } : {}),
3522
3538
  }
3523
3539
  }, widgetBuilderRequestInit(widgetBuilderPreviewBaseUrl()));
3524
3540
  const json = await response.raw.json();
@@ -3668,6 +3684,17 @@
3668
3684
  }
3669
3685
  return data;
3670
3686
  } catch (error) {
3687
+ // The API turns a restore away before it deletes a message or touches a file: while a generation runs (it would commit
3688
+ // over the restored code), after newer code was saved since the person looked, or when it cannot read the head to
3689
+ // compare. The chat and the code are as they were.
3690
+ const refusal = await readTeamEditingRefusalOf(error);
3691
+ const refusalText = restoreRefusalText(refusal, $t);
3692
+ if (refusalText) {
3693
+ console.warn('[Restore] The API refused the restore; nothing was restored', { widgetId: widgetIdAtRestore?.substring(0, 8), refusal });
3694
+ showToast('warning', $t('creator.version.failedToRestoreCheckpoint'), { description: refusalText, duration: 9000 });
3695
+ if (refusal.kind === 'repository_head_changed' && widgetIdAtRestore) void catchUpAfterNewerCode(widgetIdAtRestore);
3696
+ return null;
3697
+ }
3671
3698
  console.error('[Chat→Backend] Failed to restore checkpoint:', error);
3672
3699
  showToast('error', $t('creator.version.failedToRestoreCheckpoint'), {
3673
3700
  description: error instanceof Error ? error.message : $t('creator.general.unknownError'),
@@ -3786,6 +3813,32 @@
3786
3813
  return normalizedA.startsWith(normalizedB.slice(0, 7)) || normalizedB.startsWith(normalizedA.slice(0, 7));
3787
3814
  }
3788
3815
 
3816
+ /**
3817
+ * The head of a widget's code as this panel shows it: the commit the last generation, restore or head probe left in the panel
3818
+ * (or the one this browser kept for the widget). It is the head the person has seen, so a request that names it as
3819
+ * `expectedHeadSha` is refused by the API, before anything is charged, deleted or written, when newer code was saved since
3820
+ * (a teammate, another window). Null when the creator knows no head, or one the API would not accept: then nothing is
3821
+ * compared and the request goes as it always did.
3822
+ */
3823
+ function shownHeadCommitSha(widgetId: string): string | null {
3824
+ return headCommitForComparison(getPanelDisplayState(widgetId).lastCommitId ?? loadCommitIdForWidget(widgetId));
3825
+ }
3826
+
3827
+ /**
3828
+ * Puts the words of a request the API refused back into the chat's message box, so the person can send it again without typing
3829
+ * it again. Only a request that was typed in the chat, and only into an empty box: what the person has typed since stays.
3830
+ */
3831
+ function giveRefusedPromptBack(widgetId: string, refusedPrompt: string): void {
3832
+ try {
3833
+ const panelChat = getChatMethodsForWidget(widgetId);
3834
+ if (!panelChat?.setDraftText || refusedPrompt.trim() === '') return;
3835
+ if ((panelChat.getDraftText?.() ?? '').trim() !== '') return;
3836
+ panelChat.setDraftText(refusedPrompt);
3837
+ } catch (error) {
3838
+ console.warn('[TeamEditing] Could not put the refused request back into the message box', { widgetId, error });
3839
+ }
3840
+ }
3841
+
3789
3842
  function formatCommitShaShort(sha: string | null | undefined): string {
3790
3843
  const normalized = normalizeCommitSha(sha);
3791
3844
  return normalized ? normalized.slice(0, 8) : '—';
@@ -6610,7 +6663,9 @@
6610
6663
  /** This tab's own Stop came after the job had ended: shows how it ended. */
6611
6664
  | 'stop-too-late'
6612
6665
  /** This tab's own Stop could not reach the server: the job may still be running. */
6613
- | 'stop-failed';
6666
+ | 'stop-failed'
6667
+ /** The API refused this tab's request because the person's own generation (another window, another device) is running: the refusal named it. */
6668
+ | 'refused';
6614
6669
 
6615
6670
  /** Forgets the id this browser kept for the widget, when it is this operation's (the id of a newer generation stays). */
6616
6671
  async function forgetStoredOperationId(widgetId: string, operationId: string): Promise<void> {
@@ -6660,7 +6715,8 @@
6660
6715
  // It ended before this tab asked (the tab was away, or the stop came too late): show how it ended. A stop that
6661
6716
  // did go through, whose answer was lost on the way, is on the screen already.
6662
6717
  if (origin === 'stop-failed' && snapshot.status === 'cancelled') return;
6663
- await finishFollowedGeneration(widgetId, operationId, snapshot, origin === 'stored' || origin === 'stop-too-late');
6718
+ // A refused request is waiting for news too: the run it was refused for ended in the meantime, so say how it ended
6719
+ await finishFollowedGeneration(widgetId, operationId, snapshot, origin === 'stored' || origin === 'stop-too-late' || origin === 'refused');
6664
6720
  return;
6665
6721
  }
6666
6722
 
@@ -6694,7 +6750,8 @@
6694
6750
  void getChatMethodsForWidget(widgetId)?.reloadConversationMessages?.();
6695
6751
  // This tab learned of it from the browser's own store: the other tabs may not know of it yet
6696
6752
  if (origin === 'stored') generationChannel?.announceStarted(widgetId, operationId);
6697
- if (widgetId === focusedPanelWidgetId && origin !== 'stop-failed') {
6753
+ // (A refused request has been told already, in the words of its refusal)
6754
+ if (widgetId === focusedPanelWidgetId && origin !== 'stop-failed' && origin !== 'refused') {
6698
6755
  showToast('info', $t('creator.codegen.generationInProgress'), {
6699
6756
  description: $t('creator.codegen.reconnectedToAnActiveCode'),
6700
6757
  duration: 4000
@@ -6854,6 +6911,24 @@
6854
6911
  }
6855
6912
  }
6856
6913
 
6914
+ /**
6915
+ * Brings what the panel knows of a widget's code up to date after the API said that newer code was saved than the person had
6916
+ * seen (a teammate saved, or another window generated): the head the panel names, the version menu and the conversation, read
6917
+ * from the server again. The preview stays as it is: the person looks at the newer code by choosing its version, and the next
6918
+ * request they send names the head they have now.
6919
+ */
6920
+ async function catchUpAfterNewerCode(widgetId: string): Promise<void> {
6921
+ try {
6922
+ await reconcileWidgetHeadCommit(widgetId);
6923
+ const { [widgetId]: _resolved, ...restResolved } = shapeHistoryResolvedByWidgetId;
6924
+ shapeHistoryResolvedByWidgetId = restResolved;
6925
+ await loadPublishHistoryForPanel(widgetId, { silent: true, fresh: true });
6926
+ await getChatMethodsForWidget(widgetId)?.reloadConversationMessages?.();
6927
+ } catch (error) {
6928
+ console.warn('[TeamEditing] Could not bring the widget up to date after newer code was saved', { widgetId, error });
6929
+ }
6930
+ }
6931
+
6857
6932
  /** Follows the generation whose id this browser kept for the widget, when it has one (see `GenerationFollowOrigin`). */
6858
6933
  async function followStoredGeneration(widgetId: string): Promise<void> {
6859
6934
  try {
@@ -10836,6 +10911,11 @@ Requirements:
10836
10911
 
10837
10912
  // console.log('Widget Creator: Starting code generation for widget:', generationWidgetId);
10838
10913
 
10914
+ // What to do once this run has let go of the widget, after the API refused it: follow the person's own generation that holds
10915
+ // the widget, or catch up with the newer code that was saved. It waits for the cleanup in `finally`, because a widget that
10916
+ // still counts as generating in this tab is not followed.
10917
+ let afterRefusal: (() => void) | null = null;
10918
+
10839
10919
  try {
10840
10920
  const generationWidget =
10841
10921
  getWidgetById(generationWidgetId) ||
@@ -11018,6 +11098,17 @@ Requirements:
11018
11098
  ? undefined
11019
11099
  : resolvePlannerModelIdForGeneration(prompt, coderModelForRequest);
11020
11100
  const runtimeLogsForRequest = collectRuntimeLogsForCodegen(generationWidgetId);
11101
+ // The version the person chose to build on, when it is not the head, and the head they chose it on: the API refuses the
11102
+ // request, before it charges anything, when newer code was saved since (a teammate, another window).
11103
+ // Every kind of token sends them, the token of an editor session (a partner's customer) as well: the gateway's door
11104
+ // lists these fields and the text documents. See utils/generationRequestFields.ts.
11105
+ const chosenBaseCommitSha = options.compileFixOnly ? null : generationBaseCommitSha(generationWidgetId);
11106
+ const headTheVersionWasChosenOn = chosenBaseCommitSha ? shownHeadCommitSha(generationWidgetId) : null;
11107
+ const versionAndDocumentFields = generationVersionAndDocumentFields({
11108
+ baseCommitSha: chosenBaseCommitSha,
11109
+ expectedHeadSha: headTheVersionWasChosenOn,
11110
+ textDocuments: options.forkUserMessage ? undefined : options.textDocuments,
11111
+ });
11021
11112
  // Stopped, or replaced, while the request was being prepared: no job is started for a run nobody waits for
11022
11113
  if (signal.aborted) return;
11023
11114
  // The generated client types this call as void and drops the 202 body.
@@ -11035,9 +11126,9 @@ Requirements:
11035
11126
  : undefined,
11036
11127
  images: imagesToSend,
11037
11128
  attachmentIds: attachmentIdsToSend,
11038
- textDocuments: options.forkUserMessage ? undefined : options.textDocuments,
11129
+ // The text documents, the version to build on and the head it was chosen on: only the ones with something to say
11130
+ ...versionAndDocumentFields,
11039
11131
  runtimeLogs: runtimeLogsForRequest,
11040
- ...(options.compileFixOnly ? {} : { baseCommitSha: generationBaseCommitSha(generationWidgetId) }),
11041
11132
  compileFixOnly: options.compileFixOnly === true,
11042
11133
  skipIntentGate: options.skipIntentGate === true,
11043
11134
  chipIntent: options.chipIntent,
@@ -11753,14 +11844,36 @@ Requirements:
11753
11844
  // Handle concurrent generation conflict (409) — SDK throws ResponseError with .response (native Response)
11754
11845
  const httpStatus = error?.response?.status;
11755
11846
  if (httpStatus === 409) {
11756
- console.warn('Widget Creator: Code generation rejected — already in progress');
11847
+ // The API turned the request away before it charged anything, for one of two reasons it says in the answer: a run holds
11848
+ // the widget's code (the person's own in another window, or a teammate's), or the version to build on was chosen on
11849
+ // code that is no longer the newest. A 409 that says neither keeps the words it always had.
11850
+ const refusal = await readTeamEditingRefusalOf(error);
11851
+ console.warn('Widget Creator: Code generation refused (409)', { widgetId: generationWidgetId.substring(0, 8), refusal });
11852
+ if (options.fromChat && refusal.kind !== 'other') giveRefusedPromptBack(generationWidgetId, prompt);
11853
+
11854
+ if (refusal.kind === 'repository_head_changed') {
11855
+ patchCodegenUiState(generationWidgetId, { generateCodeStatus: 'Ready' });
11856
+ showToast('warning', $t('creator.codegen.newerCodeWasSaved'), {
11857
+ description: $t('creator.codegen.chosenVersionIsOutOfDate'),
11858
+ duration: 10000
11859
+ });
11860
+ afterRefusal = () => void catchUpAfterNewerCode(generationWidgetId);
11861
+ return;
11862
+ }
11863
+
11757
11864
  patchCodegenUiState(generationWidgetId, {
11758
11865
  generateCodeStatus: '⚠️ A code generation is already running. Please wait for it to finish.',
11759
11866
  });
11760
11867
  showToast('warning', $t('creator.codegen.generationAlreadyInProgress'), {
11761
- description: $t('creator.codegen.anotherCodeGenerationIsAlready'),
11762
- duration: 5000
11868
+ description:
11869
+ refusal.kind === 'generation_in_progress'
11870
+ ? generationRefusalText(refusal, $t, get(languageTag))
11871
+ : $t('creator.codegen.anotherCodeGenerationIsAlready'),
11872
+ duration: refusal.kind === 'generation_in_progress' ? 9000 : 5000
11763
11873
  });
11874
+ // The person's own run is followed (its progress shows in the widget, as in any tab that began it), once this run has let go
11875
+ const runToFollow = operationToFollow(refusal);
11876
+ if (runToFollow) afterRefusal = () => void followGeneration(generationWidgetId, runToFollow, 'refused');
11764
11877
  return;
11765
11878
  }
11766
11879
 
@@ -11873,6 +11986,13 @@ Requirements:
11873
11986
  widgetShapeLivePreviewsRef?.requestReload?.(generationWidgetId, { immediate: true });
11874
11987
  });
11875
11988
  }
11989
+ // The API refused this run and the widget is free of it now: follow the person's own generation, or catch up with the
11990
+ // newer code that was saved. (Not awaited: a followed run can take minutes, and the queue behind this one must not wait.)
11991
+ if (afterRefusal) {
11992
+ const actAfterRefusal = afterRefusal;
11993
+ afterRefusal = null;
11994
+ actAfterRefusal();
11995
+ }
11876
11996
  }
11877
11997
  }
11878
11998
  }
@@ -17731,7 +17851,8 @@ $: if (codeGenerationPrompt && selectedWidgetId && promptLoadedForWidgetId === s
17731
17851
  let widgetName = draftName;
17732
17852
  try {
17733
17853
  const sketchForName = screenshot.startsWith('data:image/') ? screenshot : null;
17734
- if (agentClient && (prompt.trim().length >= 2 || sketchForName)) {
17854
+ // (Not in a partner's page: the gateway refuses a session this route, and the draft's name does as well.)
17855
+ if (agentClient && maySuggestWidgetName() && (prompt.trim().length >= 2 || sketchForName)) {
17735
17856
  authStatus = 'Naming widget...';
17736
17857
  const suggestedNameReply = await agentClient.agentWidgetNamePost({
17737
17858
  agentWidgetNamePostRequest: { prompt, ...(sketchForName ? { image: sketchForName } : {}) },
@@ -28,6 +28,6 @@ interface Props {
28
28
  language?: string;
29
29
  languageLocked?: boolean;
30
30
  }
31
- declare const BrandKitPanel: import("svelte").Component<Props, {}, "sub" | "title" | "brandKitEnabled" | "librariesEnabled" | "primary" | "secondary" | "fonts" | "libraries" | "libraryGitUrl" | "libraryFileName" | "libraryUploads" | "fontUploads" | "language">;
31
+ declare const BrandKitPanel: import("svelte").Component<Props, {}, "brandKitEnabled" | "librariesEnabled" | "primary" | "secondary" | "title" | "sub" | "fonts" | "libraries" | "libraryGitUrl" | "libraryFileName" | "libraryUploads" | "fontUploads" | "language">;
32
32
  type BrandKitPanel = ReturnType<typeof BrandKitPanel>;
33
33
  export default BrandKitPanel;
@@ -10,6 +10,6 @@ interface Props {
10
10
  urlPlaceholder?: string;
11
11
  accept?: string;
12
12
  }
13
- declare const FileUrlSourceControl: import("svelte").Component<Props, {}, "url" | "fileName" | "fileContent" | "fileEncoding">;
13
+ declare const FileUrlSourceControl: import("svelte").Component<Props, {}, "fileName" | "fileContent" | "fileEncoding" | "url">;
14
14
  type FileUrlSourceControl = ReturnType<typeof FileUrlSourceControl>;
15
15
  export default FileUrlSourceControl;
@@ -100,7 +100,7 @@ declare const WidgetDetails: $$__sveltets_2_IsomorphicComponent<{
100
100
  /** Stacking order when multiple Widget Details panels are open. */ panelZIndex?: number;
101
101
  /** Cascade offset index (0 = centered, 1+ = shifted down-right). */ panelCascadeIndex?: number;
102
102
  /** False when another panel has keyboard/chat focus. */ isFocusedPanel?: boolean;
103
- currentStep?: "embed" | "create" | "edit";
103
+ currentStep?: "create" | "edit" | "embed";
104
104
  /**
105
105
  * Canvas Creator is code-only (chat + preview). Edit/Embed header steps stay
106
106
  * off until composition editing lives on /composition. Keep the Edit/Embed
@@ -93,6 +93,13 @@ export declare function mayUseAddressBar(): boolean;
93
93
  export declare function mayUseRealtimeSocket(): boolean;
94
94
  /** Whether the creator may ask for the account's trial and credit counter (an account matter, not a visitor's). */
95
95
  export declare function mayShowAccountBilling(): boolean;
96
+ /**
97
+ * Whether the creator may ask the API for a title for the widget it is about to make from a sketch (`POST
98
+ * /agent/widget-name`). That route is not on the gateway's allow-list for a partner's visitor (a title is asked before the
99
+ * widget exists, so there is no widget of theirs to check the request against), so every ask would be refused. In a
100
+ * partner's page the creator does not ask, and the widget keeps the name of its draft.
101
+ */
102
+ export declare function maySuggestWidgetName(): boolean;
96
103
  /** Whether the creator may take part in the page-wide `widgetic:*` events it exchanges with the Widgetic site's own page chrome. */
97
104
  export declare function mayListenToSiteEvents(): boolean;
98
105
  /**
@@ -99,6 +99,15 @@ export function mayUseRealtimeSocket() {
99
99
  export function mayShowAccountBilling() {
100
100
  return !state.partnerMode;
101
101
  }
102
+ /**
103
+ * Whether the creator may ask the API for a title for the widget it is about to make from a sketch (`POST
104
+ * /agent/widget-name`). That route is not on the gateway's allow-list for a partner's visitor (a title is asked before the
105
+ * widget exists, so there is no widget of theirs to check the request against), so every ask would be refused. In a
106
+ * partner's page the creator does not ask, and the widget keeps the name of its draft.
107
+ */
108
+ export function maySuggestWidgetName() {
109
+ return !state.partnerMode;
110
+ }
102
111
  /** Whether the creator may take part in the page-wide `widgetic:*` events it exchanges with the Widgetic site's own page chrome. */
103
112
  export function mayListenToSiteEvents() {
104
113
  return !state.partnerMode;
@@ -12,3 +12,8 @@ export declare function embedFormatLabel(format: EmbedFormat, t: Translate<Creat
12
12
  * clock. A date that is not a date is written as a dash.
13
13
  */
14
14
  export declare function versionDateText(when: Date, locale: string): string;
15
+ /**
16
+ * The time of day, as the sentences that say "since 10:00" show it: hours and minutes on a 24 hour clock, written the way
17
+ * `locale` writes them, on the visitor's own clock. A date that is not a date is written as a dash.
18
+ */
19
+ export declare function clockTimeText(when: Date, locale: string): string;
@@ -37,3 +37,19 @@ export function versionDateText(when, locale) {
37
37
  // English puts a comma between the date and the time ("10/01/2026, 10:00"); the lists have always read "10/01/2026 10:00".
38
38
  return written.replace(', ', ' ');
39
39
  }
40
+ /**
41
+ * The time of day, as the sentences that say "since 10:00" show it: hours and minutes on a 24 hour clock, written the way
42
+ * `locale` writes them, on the visitor's own clock. A date that is not a date is written as a dash.
43
+ */
44
+ export function clockTimeText(when, locale) {
45
+ if (!(when instanceof Date) || Number.isNaN(when.getTime()))
46
+ return '—';
47
+ const options = { hour: '2-digit', minute: '2-digit', hourCycle: 'h23' };
48
+ try {
49
+ return new Intl.DateTimeFormat(locale, options).format(when);
50
+ }
51
+ catch {
52
+ // A tag this browser cannot use (the language kit has already settled on one it can, so this is only a guard): English.
53
+ return new Intl.DateTimeFormat('en', options).format(when);
54
+ }
55
+ }
@@ -220,6 +220,11 @@ export declare const CREATOR_CATALOGS: {
220
220
  readonly 'creator.codegen.codeSavedPreviewIsLoading': "Code saved. Preview is loading.";
221
221
  readonly 'creator.codegen.generationAlreadyInProgress': "Generation already in progress";
222
222
  readonly 'creator.codegen.anotherCodeGenerationIsAlready': "Another code generation is already running. Wait for it to finish or cancel it first.";
223
+ readonly 'creator.codegen.teammateIsGeneratingSince': "A teammate has been generating in this widget since {time}. Your request was not sent: send it again when that generation has finished.";
224
+ readonly 'creator.codegen.generationRunningInTheWidget': "Another generation is already running in this widget. Your request was not sent: send it again when it has finished.";
225
+ readonly 'creator.codegen.yourGenerationRunsElsewhere': "You already have a generation running in this widget, in another window or app. Your request was not sent: send it again when it has finished.";
226
+ readonly 'creator.codegen.newerCodeWasSaved': "Newer code was saved";
227
+ readonly 'creator.codegen.chosenVersionIsOutOfDate': "The widget changed after you chose that version, so nothing was generated. Check the version list, choose the version again, then send your request.";
223
228
  readonly 'creator.codegen.codeGenerationError': "Code generation error";
224
229
  readonly 'creator.codegen.imagePastedToPrompt': "Image pasted to prompt";
225
230
  readonly 'creator.codegen.codeGenerationInProgressWait': "Code generation in progress — wait until it finishes.";
@@ -242,7 +247,6 @@ export declare const CREATOR_CATALOGS: {
242
247
  readonly 'creator.codegen.repositoryCreatedButNotPersisted': "Repository created but not persisted";
243
248
  readonly 'creator.codegen.repositoryExistsButFailedTo': "Repository exists but failed to sync with widget record. Try generating code to resync.";
244
249
  readonly 'creator.codegen.repositoryReadyForUse': "Repository {id}… ready for use.";
245
- readonly 'creator.codegen.generationFailed': "Generation Failed";
246
250
  readonly 'creator.codegen.previewBuilderIsUnavailable': "Preview builder is unavailable";
247
251
  readonly 'creator.codegen.theWidgetCodeWasSaved': "The widget code was saved, but the preview service could not compile it. This is not a Svelte syntax error. Go back to Create and use Rebuild.";
248
252
  readonly 'creator.codegen.rebuildInCreate': "🔄 Rebuild in Create";
@@ -276,6 +280,9 @@ export declare const CREATOR_CATALOGS: {
276
280
  readonly 'creator.version.checkpointRestored': "Checkpoint restored";
277
281
  readonly 'creator.version.restoreCompletedWithWarnings': "Restore completed with warnings";
278
282
  readonly 'creator.version.failedToRestoreCheckpoint': "Failed to restore checkpoint";
283
+ readonly 'creator.version.restoreRefusedWhileGenerating': "Nothing was restored because a generation is running in this widget. Try again when it has finished.";
284
+ readonly 'creator.version.restoreRefusedNewerCode': "Nothing was restored because newer code was saved after this checkpoint was shown. Check the version list, then restore again if you still want this checkpoint.";
285
+ readonly 'creator.version.restoreRefusedLatestCodeUnknown': "Nothing was restored because the latest code could not be checked. Try again in a moment.";
279
286
  readonly 'creator.version.versionIsNowLive': "Version {version} is now live.";
280
287
  readonly 'creator.version.version': "Version {version}";
281
288
  readonly 'creator.version.theSelectedDraftVersionWas': "The selected draft version was not found.";
@@ -581,7 +588,6 @@ export declare const CREATOR_CATALOGS: {
581
588
  readonly 'chat.messages.restore': "Restore Checkpoint";
582
589
  readonly 'chat.messages.restoreTitle': "Restore widget code to this prompt's commit";
583
590
  readonly 'chat.messages.alreadyHead': "This checkpoint is already HEAD";
584
- readonly 'chat.messages.showSuggestions': "Show suggestions";
585
591
  readonly 'chat.messages.version': "Version {number}";
586
592
  readonly 'chat.messages.restoredFrom': "Restored from {label}";
587
593
  readonly 'chat.messages.previousVersion': "a previous version";
@@ -692,7 +698,6 @@ export declare const CREATOR_CATALOGS: {
692
698
  readonly 'canvas.state.loading': "Loading canvas\u2026";
693
699
  readonly 'canvas.state.initFailed': "Canvas failed to initialize.";
694
700
  readonly 'canvas.error.imageFromUrl': "Failed to load image from URL. Make sure the URL is correct and allows cross-origin requests.";
695
- readonly 'canvas.defaults.text': "Hello World!";
696
701
  readonly 'canvas.defaults.textBox': "Type here";
697
702
  readonly 'canvas.defaults.frameLabel': "Frame";
698
703
  readonly 'canvas.defaults.untitledFrame': "Untitled Frame";
@@ -811,6 +816,7 @@ export declare const CREATOR_CATALOGS: {
811
816
  readonly 'canvas.zoom.gridLabel': "Toggle grid";
812
817
  readonly 'canvas.zoom.panTitle': "Hand / Pan [H]";
813
818
  readonly 'canvas.zoom.panLabel': "Hand / pan tool";
819
+ readonly 'canvas.zoom.panBanner': "Dragging the canvas";
814
820
  readonly 'canvas.zoom.outTitle': "Zoom Out [Ctrl/Cmd] + [\u2212]";
815
821
  readonly 'canvas.zoom.outLabel': "Zoom out";
816
822
  readonly 'canvas.zoom.inTitle': "Zoom In [Ctrl/Cmd] + [+]";
@@ -952,4 +958,4 @@ export declare const useCreatorLanguage: () => import("@widgetic/design-system/i
952
958
  * The English `t` of the creator, for code that has no component around it. The screens of the creator get their words, in
953
959
  * the page's language, from `useCreatorLanguage`.
954
960
  */
955
- 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.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.publishChanges" | "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.generationCompletePreviewReady" | "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">;
961
+ 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.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.teammateIsGeneratingSince" | "creator.codegen.generationRunningInTheWidget" | "creator.codegen.yourGenerationRunsElsewhere" | "creator.codegen.newerCodeWasSaved" | "creator.codegen.chosenVersionIsOutOfDate" | "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.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.restoreRefusedWhileGenerating" | "creator.version.restoreRefusedNewerCode" | "creator.version.restoreRefusedLatestCodeUnknown" | "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.publishChanges" | "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.generationCompletePreviewReady" | "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">;
@@ -216,6 +216,11 @@ export declare const CREATOR_MESSAGES: {
216
216
  readonly 'creator.codegen.codeSavedPreviewIsLoading': "Code saved. Preview is loading.";
217
217
  readonly 'creator.codegen.generationAlreadyInProgress': "Generation already in progress";
218
218
  readonly 'creator.codegen.anotherCodeGenerationIsAlready': "Another code generation is already running. Wait for it to finish or cancel it first.";
219
+ readonly 'creator.codegen.teammateIsGeneratingSince': "A teammate has been generating in this widget since {time}. Your request was not sent: send it again when that generation has finished.";
220
+ readonly 'creator.codegen.generationRunningInTheWidget': "Another generation is already running in this widget. Your request was not sent: send it again when it has finished.";
221
+ readonly 'creator.codegen.yourGenerationRunsElsewhere': "You already have a generation running in this widget, in another window or app. Your request was not sent: send it again when it has finished.";
222
+ readonly 'creator.codegen.newerCodeWasSaved': "Newer code was saved";
223
+ readonly 'creator.codegen.chosenVersionIsOutOfDate': "The widget changed after you chose that version, so nothing was generated. Check the version list, choose the version again, then send your request.";
219
224
  readonly 'creator.codegen.codeGenerationError': "Code generation error";
220
225
  readonly 'creator.codegen.imagePastedToPrompt': "Image pasted to prompt";
221
226
  readonly 'creator.codegen.codeGenerationInProgressWait': "Code generation in progress — wait until it finishes.";
@@ -238,7 +243,6 @@ export declare const CREATOR_MESSAGES: {
238
243
  readonly 'creator.codegen.repositoryCreatedButNotPersisted': "Repository created but not persisted";
239
244
  readonly 'creator.codegen.repositoryExistsButFailedTo': "Repository exists but failed to sync with widget record. Try generating code to resync.";
240
245
  readonly 'creator.codegen.repositoryReadyForUse': "Repository {id}… ready for use.";
241
- readonly 'creator.codegen.generationFailed': "Generation Failed";
242
246
  readonly 'creator.codegen.previewBuilderIsUnavailable': "Preview builder is unavailable";
243
247
  readonly 'creator.codegen.theWidgetCodeWasSaved': "The widget code was saved, but the preview service could not compile it. This is not a Svelte syntax error. Go back to Create and use Rebuild.";
244
248
  readonly 'creator.codegen.rebuildInCreate': "🔄 Rebuild in Create";
@@ -272,6 +276,9 @@ export declare const CREATOR_MESSAGES: {
272
276
  readonly 'creator.version.checkpointRestored': "Checkpoint restored";
273
277
  readonly 'creator.version.restoreCompletedWithWarnings': "Restore completed with warnings";
274
278
  readonly 'creator.version.failedToRestoreCheckpoint': "Failed to restore checkpoint";
279
+ readonly 'creator.version.restoreRefusedWhileGenerating': "Nothing was restored because a generation is running in this widget. Try again when it has finished.";
280
+ readonly 'creator.version.restoreRefusedNewerCode': "Nothing was restored because newer code was saved after this checkpoint was shown. Check the version list, then restore again if you still want this checkpoint.";
281
+ readonly 'creator.version.restoreRefusedLatestCodeUnknown': "Nothing was restored because the latest code could not be checked. Try again in a moment.";
275
282
  readonly 'creator.version.versionIsNowLive': "Version {version} is now live.";
276
283
  readonly 'creator.version.version': "Version {version}";
277
284
  readonly 'creator.version.theSelectedDraftVersionWas': "The selected draft version was not found.";
@@ -223,6 +223,12 @@ export const CREATOR_MESSAGES = {
223
223
  'creator.codegen.codeSavedPreviewIsLoading': 'Code saved. Preview is loading.',
224
224
  'creator.codegen.generationAlreadyInProgress': 'Generation already in progress',
225
225
  'creator.codegen.anotherCodeGenerationIsAlready': 'Another code generation is already running. Wait for it to finish or cancel it first.',
226
+ // A generation the API refused because a run holds the widget's code, or because newer code was saved after the person looked
227
+ 'creator.codegen.teammateIsGeneratingSince': 'A teammate has been generating in this widget since {time}. Your request was not sent: send it again when that generation has finished.',
228
+ 'creator.codegen.generationRunningInTheWidget': 'Another generation is already running in this widget. Your request was not sent: send it again when it has finished.',
229
+ 'creator.codegen.yourGenerationRunsElsewhere': 'You already have a generation running in this widget, in another window or app. Your request was not sent: send it again when it has finished.',
230
+ 'creator.codegen.newerCodeWasSaved': 'Newer code was saved',
231
+ 'creator.codegen.chosenVersionIsOutOfDate': 'The widget changed after you chose that version, so nothing was generated. Check the version list, choose the version again, then send your request.',
226
232
  'creator.codegen.codeGenerationError': 'Code generation error',
227
233
  'creator.codegen.imagePastedToPrompt': 'Image pasted to prompt',
228
234
  'creator.codegen.codeGenerationInProgressWait': 'Code generation in progress — wait until it finishes.',
@@ -245,7 +251,6 @@ export const CREATOR_MESSAGES = {
245
251
  'creator.codegen.repositoryCreatedButNotPersisted': 'Repository created but not persisted',
246
252
  'creator.codegen.repositoryExistsButFailedTo': 'Repository exists but failed to sync with widget record. Try generating code to resync.',
247
253
  'creator.codegen.repositoryReadyForUse': 'Repository {id}… ready for use.',
248
- 'creator.codegen.generationFailed': 'Generation Failed',
249
254
  'creator.codegen.previewBuilderIsUnavailable': 'Preview builder is unavailable',
250
255
  'creator.codegen.theWidgetCodeWasSaved': 'The widget code was saved, but the preview service could not compile it. This is not a Svelte syntax error. Go back to Create and use Rebuild.',
251
256
  'creator.codegen.rebuildInCreate': '🔄 Rebuild in Create',
@@ -281,6 +286,10 @@ export const CREATOR_MESSAGES = {
281
286
  'creator.version.checkpointRestored': 'Checkpoint restored',
282
287
  'creator.version.restoreCompletedWithWarnings': 'Restore completed with warnings',
283
288
  'creator.version.failedToRestoreCheckpoint': 'Failed to restore checkpoint',
289
+ // A restore the API refused before it deleted a message or touched a file (the toast's title is the line above)
290
+ 'creator.version.restoreRefusedWhileGenerating': 'Nothing was restored because a generation is running in this widget. Try again when it has finished.',
291
+ 'creator.version.restoreRefusedNewerCode': 'Nothing was restored because newer code was saved after this checkpoint was shown. Check the version list, then restore again if you still want this checkpoint.',
292
+ 'creator.version.restoreRefusedLatestCodeUnknown': 'Nothing was restored because the latest code could not be checked. Try again in a moment.',
284
293
  'creator.version.versionIsNowLive': 'Version {version} is now live.',
285
294
  'creator.version.version': 'Version {version}',
286
295
  'creator.version.theSelectedDraftVersionWas': 'The selected draft version was not found.',
@@ -0,0 +1,44 @@
1
+ /**
2
+ * The three fields of a generation request (`POST /agent/code/generate`) that a request carries only when there is something
3
+ * to say.
4
+ *
5
+ * - `baseCommitSha`: the older version the person chose to build on, when it is not the head of the code.
6
+ * - `expectedHeadSha`: the head they chose that version on, so the API can refuse the request, before it charges anything,
7
+ * when newer code was saved since (a teammate, another window).
8
+ * - `textDocuments`: the words of the Markdown and text files attached to the message.
9
+ *
10
+ * Two things about how they travel, which the generated API client made visible when it was regenerated (1.0.46):
11
+ *
12
+ * 1. A field that is there with `null` is a field. The client writes `baseCommitSha: null` into the body when it is given
13
+ * `null`, so a field with nothing to say is left out, not sent empty. (The gateway's door for an editor session judges the
14
+ * names of the body's keys and not their values, so a `null` would be a field there too; and the request stays as small as
15
+ * it was for the clients that did not know the field.)
16
+ * 2. Every kind of token sends them: a person's login, a Shopify store's session and, since 0.4.34, the token of an editor
17
+ * session (a partner's customer). Until then the gateway's list of what an editor session may send in a generation did not
18
+ * have the three, the whole request was refused (`403 EDITOR_SESSION_FIELD_NOT_ALLOWED`), and the creator left them out
19
+ * for a session's token, so a partner's customer built on the latest code from the message alone. The list has them now
20
+ * (`CREATOR_FIELDS.codeGenerate` of the gateway's `editorSessionSurfaces.ts`), which is why this creator needs a gateway
21
+ * that has them, and why the gateway is released before it.
22
+ *
23
+ * It is plain TypeScript with no Svelte in it, so a test can hold it to both.
24
+ */
25
+ /** What the creator knows when it builds a generation request. */
26
+ export interface GenerationVersionAndDocumentInput<TextDocument> {
27
+ /** The version the person chose to build on, when it is not the head; null or undefined when they build on the head. */
28
+ baseCommitSha: string | null | undefined;
29
+ /** The head they chose that version on; null or undefined when the creator knows no head it could name. */
30
+ expectedHeadSha: string | null | undefined;
31
+ /** The words of the text documents attached to the message. */
32
+ textDocuments: readonly TextDocument[] | undefined;
33
+ }
34
+ /** The fields of the generation request that are there only when there is something to say. */
35
+ export interface GenerationVersionAndDocumentFields<TextDocument> {
36
+ baseCommitSha?: string;
37
+ expectedHeadSha?: string;
38
+ textDocuments?: TextDocument[];
39
+ }
40
+ /**
41
+ * The fields to add to a generation request: only the ones that have something to say. The head to compare with goes only
42
+ * with a chosen version (it is the head that version was chosen on).
43
+ */
44
+ export declare function generationVersionAndDocumentFields<TextDocument>(input: GenerationVersionAndDocumentInput<TextDocument>): GenerationVersionAndDocumentFields<TextDocument>;
@@ -0,0 +1,40 @@
1
+ /**
2
+ * The three fields of a generation request (`POST /agent/code/generate`) that a request carries only when there is something
3
+ * to say.
4
+ *
5
+ * - `baseCommitSha`: the older version the person chose to build on, when it is not the head of the code.
6
+ * - `expectedHeadSha`: the head they chose that version on, so the API can refuse the request, before it charges anything,
7
+ * when newer code was saved since (a teammate, another window).
8
+ * - `textDocuments`: the words of the Markdown and text files attached to the message.
9
+ *
10
+ * Two things about how they travel, which the generated API client made visible when it was regenerated (1.0.46):
11
+ *
12
+ * 1. A field that is there with `null` is a field. The client writes `baseCommitSha: null` into the body when it is given
13
+ * `null`, so a field with nothing to say is left out, not sent empty. (The gateway's door for an editor session judges the
14
+ * names of the body's keys and not their values, so a `null` would be a field there too; and the request stays as small as
15
+ * it was for the clients that did not know the field.)
16
+ * 2. Every kind of token sends them: a person's login, a Shopify store's session and, since 0.4.34, the token of an editor
17
+ * session (a partner's customer). Until then the gateway's list of what an editor session may send in a generation did not
18
+ * have the three, the whole request was refused (`403 EDITOR_SESSION_FIELD_NOT_ALLOWED`), and the creator left them out
19
+ * for a session's token, so a partner's customer built on the latest code from the message alone. The list has them now
20
+ * (`CREATOR_FIELDS.codeGenerate` of the gateway's `editorSessionSurfaces.ts`), which is why this creator needs a gateway
21
+ * that has them, and why the gateway is released before it.
22
+ *
23
+ * It is plain TypeScript with no Svelte in it, so a test can hold it to both.
24
+ */
25
+ /**
26
+ * The fields to add to a generation request: only the ones that have something to say. The head to compare with goes only
27
+ * with a chosen version (it is the head that version was chosen on).
28
+ */
29
+ export function generationVersionAndDocumentFields(input) {
30
+ const fields = {};
31
+ if (input.baseCommitSha) {
32
+ fields.baseCommitSha = input.baseCommitSha;
33
+ if (input.expectedHeadSha)
34
+ fields.expectedHeadSha = input.expectedHeadSha;
35
+ }
36
+ if (input.textDocuments && input.textDocuments.length > 0) {
37
+ fields.textDocuments = [...input.textDocuments];
38
+ }
39
+ return fields;
40
+ }
@@ -0,0 +1,74 @@
1
+ import type { Translate } from '@widgetic/design-system/i18n';
2
+ import type { CreatorMessageKey } from '../i18n/messages.js';
3
+ /**
4
+ * What the API says when it turns a request away because of what somebody else is doing in the same widget.
5
+ *
6
+ * A widget's code has one author at a time. While a generation runs, a second generation and a restore of a checkpoint are
7
+ * refused with `409 BUSINESS_STATE_CONFLICT` and `error.details.reason: 'generation_in_progress'`: `heldBy` says whether the
8
+ * run is the caller's own (`'you'`: another window, another device, an app) or somebody else's (`'another_member'`), and
9
+ * never a name; `startedAt` says since when; `operationId`, given only to the person who started the run, is the run to
10
+ * follow. A generation of a chosen older version, and a restore of a checkpoint, can say which head of the code the person
11
+ * saw (`expectedHeadSha`); newer code saved since is refused with `409` and `details.reason: 'repository_head_changed'`
12
+ * (`expectedHeadSha`, `currentHeadSha`) before anything is charged, deleted or written. A restore that cannot read the head
13
+ * it was asked to compare with is `503 SERVICE_UNAVAILABLE`: a head that cannot be read is no confirmation.
14
+ *
15
+ * This reads those answers, and says what each means in the visitor's words. It is plain TypeScript with no Svelte in it,
16
+ * so a test can hold it to the shapes the API gives (the gateway's `generationLockRoutes.test.ts` and
17
+ * `restoreCheckpointRoute.test.ts` are the other half of that agreement).
18
+ */
19
+ /** Who holds the widget's code, as far as the API says. The API never names a person, so neither does the creator. */
20
+ export type GenerationHolder = 'you' | 'another_member' | 'unknown';
21
+ /** A run holds the widget's code. */
22
+ export interface GenerationInProgressRefusal {
23
+ kind: 'generation_in_progress';
24
+ heldBy: GenerationHolder;
25
+ /** When the run that holds the widget began, when the API said. */
26
+ startedAt: Date | null;
27
+ /** The run to follow. The API gives it only to the person who started the run, and only when it knows it. */
28
+ operationId: string | null;
29
+ }
30
+ /** Newer code was saved after the person looked at the head the request names. */
31
+ export interface RepositoryHeadChangedRefusal {
32
+ kind: 'repository_head_changed';
33
+ /** The head the person saw, when the API repeated it. */
34
+ expectedHeadSha: string | null;
35
+ /** The head now, when the API said. */
36
+ currentHeadSha: string | null;
37
+ }
38
+ /** What a refused request comes to. `other` is anything this file does not know: the caller keeps what it did before. */
39
+ export type TeamEditingRefusal = GenerationInProgressRefusal | RepositoryHeadChangedRefusal
40
+ /** The restore could not read the head of the code to compare it with the one the person saw (503): nothing was restored. */
41
+ | {
42
+ kind: 'latest_code_unreadable';
43
+ } | {
44
+ kind: 'other';
45
+ };
46
+ /**
47
+ * Reads an answer the API gave: its HTTP status, and its JSON body (`{ success: false, error: { code, message, details } }`).
48
+ * Anything that is not one of the refusals above is `other`; a body that is not the gateway's (a proxy's page, nothing at all)
49
+ * is `other` too, whatever the status.
50
+ */
51
+ export declare function readTeamEditingRefusal(status: number | undefined, body: unknown): TeamEditingRefusal;
52
+ /**
53
+ * Reads what the generated client threw (`ResponseError`, with the native `Response` on it). The body is read from a copy, so
54
+ * whoever else reads the answer (the page's limit reporter, the creator's own message) still can. A failure that is not an
55
+ * answer of the API (the network, an abort) is `other`.
56
+ */
57
+ export declare function readTeamEditingRefusalOf(error: unknown): Promise<TeamEditingRefusal>;
58
+ /**
59
+ * The operation of the person's own generation that a refusal points at, or null when there is none to follow: the API gives
60
+ * an operation id only to the person who started the run, and only when it knows the run.
61
+ */
62
+ export declare function operationToFollow(refusal: TeamEditingRefusal): string | null;
63
+ /**
64
+ * What a visitor reads when a generation they asked for was refused because a run holds the widget. Who holds it is told as far as
65
+ * the API told it: a teammate (with the time the run began), the person's own other window or app, or just "another generation".
66
+ */
67
+ export declare function generationRefusalText(refusal: GenerationInProgressRefusal, t: Translate<CreatorMessageKey>, locale: string): string;
68
+ /**
69
+ * What a visitor reads when a restore of a checkpoint was refused before anything was deleted. `other` has no text here: a
70
+ * refusal this file does not know is shown the way every other failure of the restore is.
71
+ */
72
+ export declare function restoreRefusalText(refusal: TeamEditingRefusal, t: Translate<CreatorMessageKey>): string | null;
73
+ /** The head of the code, when it is one the API accepts as `expectedHeadSha` (7 to 40 hexadecimal digits); otherwise null, and nothing is compared. */
74
+ export declare function headCommitForComparison(sha: string | null | undefined): string | null;
@@ -0,0 +1,102 @@
1
+ import { clockTimeText } from '../i18n/labels.js';
2
+ import { httpStatusOfFailure } from './generationSharing.js';
3
+ const KNOWN_HOLDERS = ['you', 'another_member', 'unknown'];
4
+ /** The id of an operation as the API writes it in a path: no space, slash or query in it. */
5
+ const OPERATION_ID_PATTERN = /^[A-Za-z0-9._-]{1,128}$/;
6
+ /** A commit id as the API writes it: 7 to 40 hexadecimal digits. */
7
+ const COMMIT_ID_PATTERN = /^[0-9a-f]{7,40}$/i;
8
+ const asRecord = (value) => value !== null && typeof value === 'object' && !Array.isArray(value) ? value : null;
9
+ /**
10
+ * Reads an answer the API gave: its HTTP status, and its JSON body (`{ success: false, error: { code, message, details } }`).
11
+ * Anything that is not one of the refusals above is `other`; a body that is not the gateway's (a proxy's page, nothing at all)
12
+ * is `other` too, whatever the status.
13
+ */
14
+ export function readTeamEditingRefusal(status, body) {
15
+ const root = asRecord(body);
16
+ const error = asRecord(root?.error) ?? root;
17
+ if (status === 503) {
18
+ return error?.code === 'SERVICE_UNAVAILABLE' ? { kind: 'latest_code_unreadable' } : { kind: 'other' };
19
+ }
20
+ if (status !== 409)
21
+ return { kind: 'other' };
22
+ const details = asRecord(error?.details);
23
+ if (details?.reason === 'generation_in_progress') {
24
+ const heldBy = KNOWN_HOLDERS.find((holder) => holder === details.heldBy) ?? 'unknown';
25
+ const startedAtMs = typeof details.startedAt === 'string' ? Date.parse(details.startedAt) : Number.NaN;
26
+ const operationId = typeof details.operationId === 'string' && OPERATION_ID_PATTERN.test(details.operationId) ? details.operationId : null;
27
+ return {
28
+ kind: 'generation_in_progress',
29
+ heldBy,
30
+ startedAt: Number.isFinite(startedAtMs) ? new Date(startedAtMs) : null,
31
+ operationId,
32
+ };
33
+ }
34
+ if (details?.reason === 'repository_head_changed') {
35
+ const commitIdOf = (value) => (typeof value === 'string' && COMMIT_ID_PATTERN.test(value) ? value : null);
36
+ return {
37
+ kind: 'repository_head_changed',
38
+ expectedHeadSha: commitIdOf(details.expectedHeadSha),
39
+ currentHeadSha: commitIdOf(details.currentHeadSha),
40
+ };
41
+ }
42
+ return { kind: 'other' };
43
+ }
44
+ /**
45
+ * Reads what the generated client threw (`ResponseError`, with the native `Response` on it). The body is read from a copy, so
46
+ * whoever else reads the answer (the page's limit reporter, the creator's own message) still can. A failure that is not an
47
+ * answer of the API (the network, an abort) is `other`.
48
+ */
49
+ export async function readTeamEditingRefusalOf(error) {
50
+ const status = httpStatusOfFailure(error);
51
+ if (status !== 409 && status !== 503)
52
+ return { kind: 'other' };
53
+ const response = error?.response;
54
+ let body = null;
55
+ try {
56
+ body = await response?.clone().json();
57
+ }
58
+ catch {
59
+ // Not JSON, or already read: the status alone says what it can, and a 409 that says nothing more is `other`.
60
+ }
61
+ return readTeamEditingRefusal(status, body);
62
+ }
63
+ /**
64
+ * The operation of the person's own generation that a refusal points at, or null when there is none to follow: the API gives
65
+ * an operation id only to the person who started the run, and only when it knows the run.
66
+ */
67
+ export function operationToFollow(refusal) {
68
+ return refusal.kind === 'generation_in_progress' && refusal.heldBy === 'you' ? refusal.operationId : null;
69
+ }
70
+ /**
71
+ * What a visitor reads when a generation they asked for was refused because a run holds the widget. Who holds it is told as far as
72
+ * the API told it: a teammate (with the time the run began), the person's own other window or app, or just "another generation".
73
+ */
74
+ export function generationRefusalText(refusal, t, locale) {
75
+ if (refusal.heldBy === 'you')
76
+ return t('creator.codegen.yourGenerationRunsElsewhere');
77
+ if (refusal.heldBy === 'another_member' && refusal.startedAt) {
78
+ return t('creator.codegen.teammateIsGeneratingSince', { time: clockTimeText(refusal.startedAt, locale) });
79
+ }
80
+ return t('creator.codegen.generationRunningInTheWidget');
81
+ }
82
+ /**
83
+ * What a visitor reads when a restore of a checkpoint was refused before anything was deleted. `other` has no text here: a
84
+ * refusal this file does not know is shown the way every other failure of the restore is.
85
+ */
86
+ export function restoreRefusalText(refusal, t) {
87
+ switch (refusal.kind) {
88
+ case 'generation_in_progress':
89
+ return t('creator.version.restoreRefusedWhileGenerating');
90
+ case 'repository_head_changed':
91
+ return t('creator.version.restoreRefusedNewerCode');
92
+ case 'latest_code_unreadable':
93
+ return t('creator.version.restoreRefusedLatestCodeUnknown');
94
+ default:
95
+ return null;
96
+ }
97
+ }
98
+ /** The head of the code, when it is one the API accepts as `expectedHeadSha` (7 to 40 hexadecimal digits); otherwise null, and nothing is compared. */
99
+ export function headCommitForComparison(sha) {
100
+ const trimmed = typeof sha === 'string' ? sha.trim() : '';
101
+ return COMMIT_ID_PATTERN.test(trimmed) ? trimmed : null;
102
+ }
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@widgetic/creator",
3
- "version": "0.4.32",
3
+ "version": "0.4.34",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "type": "module",
6
6
  "peerDependencies": {
7
7
  "@sveltejs/kit": "^2.20.0",
8
- "@widgetic/api-sdk": "^1.0.23",
8
+ "@widgetic/api-sdk": "^1.0.46",
9
9
  "@widgetic/cache-layer": "^0.1.2",
10
10
  "@widgetic/canvas": "^0.5.27",
11
11
  "@widgetic/chat": "^0.1.17",
@@ -72,7 +72,7 @@
72
72
  "@tailwindcss/postcss": "^4.1.4",
73
73
  "@tailwindcss/typography": "^0.5.15",
74
74
  "@types/node": "26.4.0",
75
- "@widgetic/api-sdk": "^1.0.23",
75
+ "@widgetic/api-sdk": "^1.0.46",
76
76
  "@widgetic/cache-layer": "^0.1.2",
77
77
  "@widgetic/canvas": "^0.5.27",
78
78
  "@widgetic/chat": "^0.1.17",