@widgetic/creator 0.4.35 → 0.4.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/CreatorApp.svelte +222 -44
- package/dist/components/BrandKitPanel.svelte +585 -0
- package/dist/components/BrandKitPanel.svelte.d.ts +34 -0
- package/dist/components/FileUrlSourceControl.svelte.d.ts +1 -1
- package/dist/components/VersionDropdownRow.svelte +1 -19
- package/dist/components/WidgetDetails.svelte +5 -2
- package/dist/components/WidgetDetails.svelte.d.ts +1 -1
- package/dist/components/WidgetElementSelector.svelte +149 -33
- package/dist/components/WidgetElementSelector.svelte.d.ts +1 -0
- package/dist/components/WidgetShapeLivePreviews.svelte +9 -2
- package/dist/components/WidgetShapeLivePreviews.svelte.d.ts +4 -0
- package/dist/generation/brandKitForRequest.d.ts +17 -0
- package/dist/generation/brandKitForRequest.js +18 -1
- package/dist/i18n/language.d.ts +171 -5
- package/dist/i18n/messages.d.ts +27 -1
- package/dist/i18n/messages.js +27 -1
- package/dist/i18n/statusText.js +4 -0
- package/dist/pageHelpers.d.ts +2 -0
- package/dist/pageHelpers.js +10 -0
- package/dist/stores/websocketStore.d.ts +9 -0
- package/dist/stores/websocketStore.js +20 -0
- package/dist/utils/generationSharing.d.ts +1 -1
- package/dist/utils/generationSharing.js +1 -1
- package/dist/utils/widgetElementSelector.d.ts +6 -0
- package/dist/utils/widgetElementSelector.js +23 -0
- package/package.json +3 -3
- package/dist/components/GenerationOptionsPanel.svelte +0 -216
- package/dist/components/GenerationOptionsPanel.svelte.d.ts +0 -21
package/dist/CreatorApp.svelte
CHANGED
|
@@ -31,13 +31,13 @@
|
|
|
31
31
|
import type {
|
|
32
32
|
Middleware,
|
|
33
33
|
GenerateCodeRequest,
|
|
34
|
-
|
|
34
|
+
ListLlmModels200ResponseModelsInner
|
|
35
35
|
} from '@widgetic/api-sdk';
|
|
36
36
|
import { parseVersionPreviewError } from './utils/versionPreviewError.js';
|
|
37
37
|
import { widgetBuilderRequestInit } from './utils/widgetBuilderRequest.js';
|
|
38
38
|
import { gzipRequestBodyMiddleware } from './utils/gzipRequestMiddleware.js';
|
|
39
39
|
import type { SelectedWidgetElementReference } from './utils/widgetElementSelector.js';
|
|
40
|
-
import
|
|
40
|
+
import BrandKitPanel from './components/BrandKitPanel.svelte';
|
|
41
41
|
import { brandKitForRequest } from './generation/brandKitForRequest.js';
|
|
42
42
|
|
|
43
43
|
/**
|
|
@@ -149,6 +149,7 @@
|
|
|
149
149
|
|
|
150
150
|
import {
|
|
151
151
|
normalizeErrorMessage,
|
|
152
|
+
codegenFailureChatLine,
|
|
152
153
|
toErrorMessage,
|
|
153
154
|
deriveApiErrorMessage,
|
|
154
155
|
extractDetailsMessage,
|
|
@@ -769,7 +770,7 @@
|
|
|
769
770
|
// An account matter: a visitor of a partner has no trial and no balance of their own to show.
|
|
770
771
|
if (!usersClient || !mayShowAccountBilling()) return;
|
|
771
772
|
try {
|
|
772
|
-
const accepted = await usersClient.
|
|
773
|
+
const accepted = await usersClient.getPersonalBillingRaw();
|
|
773
774
|
const body = await accepted.raw.json();
|
|
774
775
|
const data = (body && typeof body === 'object' && 'data' in body ? body.data : body) as {
|
|
775
776
|
trialActive?: boolean;
|
|
@@ -1516,6 +1517,13 @@
|
|
|
1516
1517
|
let widgetLanguage: 'svelte' | 'react' = 'react';
|
|
1517
1518
|
let librariesEnabled = false;
|
|
1518
1519
|
let generationLibraries: string[] = [];
|
|
1520
|
+
let brandKitEnabled = false;
|
|
1521
|
+
let brandPrimary = '#314F2F';
|
|
1522
|
+
let brandSecondary = '#7BA668';
|
|
1523
|
+
let brandTitle = '#0F2010';
|
|
1524
|
+
let brandSub = '#5C6B58';
|
|
1525
|
+
let brandFonts: string[] = ['Inter'];
|
|
1526
|
+
let fontUploads: { name: string; content: string; encoding: string }[] = [];
|
|
1519
1527
|
let libraryGitUrl = '';
|
|
1520
1528
|
let libraryFileName = '';
|
|
1521
1529
|
let libraryUploads: { name: string; content: string; encoding: string }[] = [];
|
|
@@ -1725,6 +1733,15 @@
|
|
|
1725
1733
|
panelDisplayRevision += 1;
|
|
1726
1734
|
}
|
|
1727
1735
|
|
|
1736
|
+
function handleUpdateWidgetElementNote(widgetId: string, elementId: string, note: string): void {
|
|
1737
|
+
if (!widgetId || !elementId) return;
|
|
1738
|
+
const existing = selectedElementsByWidgetId[widgetId] ?? [];
|
|
1739
|
+
selectedElementsByWidgetId = {
|
|
1740
|
+
...selectedElementsByWidgetId,
|
|
1741
|
+
[widgetId]: existing.map((item) => (item.id === elementId ? { ...item, note } : item)),
|
|
1742
|
+
};
|
|
1743
|
+
}
|
|
1744
|
+
|
|
1728
1745
|
function handleClearWidgetSelectedElements(widgetId: string): void {
|
|
1729
1746
|
if (!widgetId) return;
|
|
1730
1747
|
const { [widgetId]: _cleared, ...rest } = selectedElementsByWidgetId;
|
|
@@ -2005,9 +2022,7 @@
|
|
|
2005
2022
|
|
|
2006
2023
|
function pushCodegenFailureToChat(widgetId: string, errorText: string) {
|
|
2007
2024
|
const panelChat = getChatMethodsForWidget(widgetId);
|
|
2008
|
-
const content =
|
|
2009
|
-
? errorText
|
|
2010
|
-
: `Code generation failed: ${errorText}`;
|
|
2025
|
+
const content = codegenFailureChatLine(errorText);
|
|
2011
2026
|
panelChat?.addAssistantMessage?.(content);
|
|
2012
2027
|
// console.log('[Chat] Codegen failure bubble:', content.slice(0, 160));
|
|
2013
2028
|
}
|
|
@@ -3480,6 +3495,9 @@
|
|
|
3480
3495
|
}
|
|
3481
3496
|
}
|
|
3482
3497
|
|
|
3498
|
+
/** One restore at a time. A second click while GitLab is still answering used to be told a generation was running. */
|
|
3499
|
+
let _restoreCheckpointInFlight = false;
|
|
3500
|
+
|
|
3483
3501
|
/** Restore conversation to a checkpoint message via backend (deletes messages + git rollback) */
|
|
3484
3502
|
async function handleRestoreCheckpoint(
|
|
3485
3503
|
conversationId: string,
|
|
@@ -3489,6 +3507,14 @@
|
|
|
3489
3507
|
// The widget whose code the restore puts back, as the panel looks at it when the request is made (the person may look at
|
|
3490
3508
|
// another panel while it runs).
|
|
3491
3509
|
const widgetIdAtRestore = restoreWidgetId || focusedPanelWidgetId || selectedWidgetId || null;
|
|
3510
|
+
if (_restoreCheckpointInFlight) {
|
|
3511
|
+
showToast('warning', $t('creator.version.failedToRestoreCheckpoint'), {
|
|
3512
|
+
description: $t('creator.version.restoreAlreadyRunning'),
|
|
3513
|
+
duration: 6000,
|
|
3514
|
+
});
|
|
3515
|
+
return null;
|
|
3516
|
+
}
|
|
3517
|
+
_restoreCheckpointInFlight = true;
|
|
3492
3518
|
try {
|
|
3493
3519
|
if (!messagesClient) {
|
|
3494
3520
|
console.warn('[Chat→Backend] messagesClient not initialized');
|
|
@@ -3538,6 +3564,7 @@
|
|
|
3538
3564
|
// Version 1 is the board before a generation replaced the drawing.
|
|
3539
3565
|
// Later versions put that generation's code back on the shape.
|
|
3540
3566
|
const restoreSketch = !targetCommit || restoredVersion === 1;
|
|
3567
|
+
sketchToolbarAfterRestore = restoreSketch;
|
|
3541
3568
|
if (panelWidgetId && restoreSketch) {
|
|
3542
3569
|
const sketchFromWidget = (getWidgetById(panelWidgetId) as { content?: { sketchCanvasJson?: string } } | null)?.content?.sketchCanvasJson;
|
|
3543
3570
|
const sketch = sketchSnapshotsByWidgetId.get(panelWidgetId) || sketchFromWidget;
|
|
@@ -3634,6 +3661,15 @@
|
|
|
3634
3661
|
_isRestoringCheckpoint = false;
|
|
3635
3662
|
};
|
|
3636
3663
|
void scheduleBuildRetry();
|
|
3664
|
+
} else if (gitRollback && gitRollback.success === false) {
|
|
3665
|
+
const rollbackError = String(gitRollback.error || '').trim();
|
|
3666
|
+
const gitlabLimited = /429|too many requests|rate limit/i.test(rollbackError);
|
|
3667
|
+
console.warn('[Restore] The code was not rolled back', { widgetId: panelWidgetId, rollbackError });
|
|
3668
|
+
showToast('warning', gitlabLimited ? $t('creator.general.rateLimited') : $t('creator.version.failedToRestoreCheckpoint'), {
|
|
3669
|
+
description: rollbackError || $t('creator.version.codeWasNotRolledBack'),
|
|
3670
|
+
duration: 9000,
|
|
3671
|
+
});
|
|
3672
|
+
return null;
|
|
3637
3673
|
} else {
|
|
3638
3674
|
console.warn('[Chat→Backend] Git rollback not detected in response, refreshing preview anyway...');
|
|
3639
3675
|
showToast('warning', $t('creator.version.restoreCompletedWithWarnings'), {
|
|
@@ -3668,6 +3704,8 @@
|
|
|
3668
3704
|
description: error instanceof Error ? error.message : $t('creator.general.unknownError'),
|
|
3669
3705
|
});
|
|
3670
3706
|
return null;
|
|
3707
|
+
} finally {
|
|
3708
|
+
_restoreCheckpointInFlight = false;
|
|
3671
3709
|
}
|
|
3672
3710
|
}
|
|
3673
3711
|
|
|
@@ -3760,6 +3798,9 @@
|
|
|
3760
3798
|
if (!selectedId?.startsWith('v:')) return null;
|
|
3761
3799
|
const version = Number(selectedId.slice(2));
|
|
3762
3800
|
if (!Number.isFinite(version)) return null;
|
|
3801
|
+
// Restore already put this version on the board. Its commit is a new sha, so it does not match the history row.
|
|
3802
|
+
// Asking GitLab to roll back again only reads the trees and can 429.
|
|
3803
|
+
if (restoredViewingVersionByWidgetId[widgetId] === version) return null;
|
|
3763
3804
|
const record = getShapePublishHistory(widgetId).find((row) => Number(row.version) === version);
|
|
3764
3805
|
const sha = String(record?.commitSha ?? record?.commit_sha ?? '').trim();
|
|
3765
3806
|
if (!/^[0-9a-f]{7,40}$/i.test(sha)) return null;
|
|
@@ -5902,13 +5943,13 @@
|
|
|
5902
5943
|
try {
|
|
5903
5944
|
// Use AgentApi from SDK - no need for manual fetch
|
|
5904
5945
|
// Clients are initialized once via initializeAuthenticatedClients() after login
|
|
5905
|
-
const response = await agentClient.
|
|
5946
|
+
const response = await agentClient.listLlmModels();
|
|
5906
5947
|
// console.log('[WidgetCreator] Models API response:', response);
|
|
5907
5948
|
|
|
5908
5949
|
// SDK returns { success, models } directly (not nested under data)
|
|
5909
5950
|
if (response.success && Array.isArray(response.models)) {
|
|
5910
5951
|
// Transform API response to match our interface
|
|
5911
|
-
availableModels = response.models.map((m:
|
|
5952
|
+
availableModels = response.models.map((m: ListLlmModels200ResponseModelsInner) => ({
|
|
5912
5953
|
id: m.id ?? '',
|
|
5913
5954
|
name: m.displayName ?? '',
|
|
5914
5955
|
provider: (m.provider ?? '').charAt(0).toUpperCase() + (m.provider ?? '').slice(1), // Capitalize provider
|
|
@@ -6030,6 +6071,7 @@
|
|
|
6030
6071
|
function toggleDebugMode() {
|
|
6031
6072
|
if (!debugModeAvailable) return;
|
|
6032
6073
|
debugMode = !debugMode;
|
|
6074
|
+
if (!debugMode) brandKitEnabled = false;
|
|
6033
6075
|
try {
|
|
6034
6076
|
creatorStorage.setItem('widgetic:site-debug-on', debugMode ? '1' : '0');
|
|
6035
6077
|
} catch (err) {
|
|
@@ -6050,7 +6092,26 @@
|
|
|
6050
6092
|
let canvasWireframeMode = true;
|
|
6051
6093
|
/** Extra canvas chrome — default off. Not tied to debugMode. */
|
|
6052
6094
|
let canvasAdvancedFeatures = !!initialAdvancedFeatures;
|
|
6095
|
+
/**
|
|
6096
|
+
* More than one widget on this canvas. There is no env switch for it.
|
|
6097
|
+
* The Advanced button turns it on and off with the rest of the advanced chrome.
|
|
6098
|
+
*/
|
|
6099
|
+
let multipleWidgetsAllowed = !!initialAdvancedFeatures;
|
|
6053
6100
|
let canvasPrimaryWidgetId: string | null = null;
|
|
6101
|
+
/** Restore Checkpoint back to the sketch brings the drawing tools back until the next generation. */
|
|
6102
|
+
let sketchToolbarAfterRestore = false;
|
|
6103
|
+
|
|
6104
|
+
function primaryWidgetHasGeneratedCode(): boolean {
|
|
6105
|
+
if (!canvasPrimaryWidgetId || isDraftConvertId(canvasPrimaryWidgetId)) return false;
|
|
6106
|
+
const panel = getPanelState(canvasPrimaryWidgetId);
|
|
6107
|
+
return !!(panel.hasGeneratedCode || panel.lastCommitId || panel.lastPublishedVersion != null);
|
|
6108
|
+
}
|
|
6109
|
+
|
|
6110
|
+
$: showDrawingTools = sketchToolbarAfterRestore || !(
|
|
6111
|
+
panelDisplayRevision >= 0
|
|
6112
|
+
&& !!canvasPrimaryWidgetId
|
|
6113
|
+
&& primaryWidgetHasGeneratedCode()
|
|
6114
|
+
);
|
|
6054
6115
|
|
|
6055
6116
|
function emitCreatorWireframeChanged() {
|
|
6056
6117
|
announceToSite(CREATOR_WIREFRAME_CHANGED_EVENT, { wireframeMode: canvasWireframeMode });
|
|
@@ -6068,6 +6129,7 @@
|
|
|
6068
6129
|
|
|
6069
6130
|
function handleHostToggleAdvancedEvent() {
|
|
6070
6131
|
canvasAdvancedFeatures = !canvasAdvancedFeatures;
|
|
6132
|
+
multipleWidgetsAllowed = canvasAdvancedFeatures;
|
|
6071
6133
|
emitCreatorAdvancedChanged();
|
|
6072
6134
|
console.log('[CreatorApp] Advanced', canvasAdvancedFeatures ? 'ON' : 'OFF',
|
|
6073
6135
|
'— composition steps', canvasAdvancedFeatures ? 'visible' : 'hidden');
|
|
@@ -6101,6 +6163,10 @@
|
|
|
6101
6163
|
}
|
|
6102
6164
|
|
|
6103
6165
|
async function handleHostDuplicateWidgetEvent(): Promise<void> {
|
|
6166
|
+
if (simpleCanvasHasItsWidget()) {
|
|
6167
|
+
showToast('info', $t('creator.widget.oneWidgetAlready'));
|
|
6168
|
+
return;
|
|
6169
|
+
}
|
|
6104
6170
|
const widgetId = canvasPrimaryWidgetId || resolveHostTargetWidgetId();
|
|
6105
6171
|
if (!widgetId || isDraftConvertId(widgetId)) {
|
|
6106
6172
|
showToast('warning', $t('creator.widget.selectAWidgetFirst'), {
|
|
@@ -6659,7 +6725,7 @@
|
|
|
6659
6725
|
try {
|
|
6660
6726
|
let snapshot: OperationSnapshot | null = null;
|
|
6661
6727
|
try {
|
|
6662
|
-
const answer = await client.
|
|
6728
|
+
const answer = await client.getOperationRaw({ id: operationId });
|
|
6663
6729
|
snapshot = readOperationBody(await answer.raw.json());
|
|
6664
6730
|
} catch (error) {
|
|
6665
6731
|
const httpStatus = httpStatusOfFailure(error);
|
|
@@ -8130,7 +8196,13 @@
|
|
|
8130
8196
|
}
|
|
8131
8197
|
|
|
8132
8198
|
const linked = canvasRef.getLinkedWidgetIds?.() ?? new Set<string>();
|
|
8133
|
-
|
|
8199
|
+
let missing = sortWidgetSummaries(widgets.filter((w) => w.id && !linked.has(w.id))).reverse();
|
|
8200
|
+
if (embedded && !multipleWidgetsAllowed) {
|
|
8201
|
+
const primaryId = (canvasPrimaryWidgetId || '').trim();
|
|
8202
|
+
missing = primaryId
|
|
8203
|
+
? missing.filter((widget) => widget.id === primaryId)
|
|
8204
|
+
: [];
|
|
8205
|
+
}
|
|
8134
8206
|
if (missing.length === 0) return 0;
|
|
8135
8207
|
|
|
8136
8208
|
// console.log('[CanvasDebug] Restoring', missing.length, 'widget shapes from canvas_id list');
|
|
@@ -8995,7 +9067,7 @@
|
|
|
8995
9067
|
async function fetchRepoHeadCommitSha(widgetId: string): Promise<string | null> {
|
|
8996
9068
|
if (!widgetId || !agentClient) return null;
|
|
8997
9069
|
try {
|
|
8998
|
-
const json = await agentClient.
|
|
9070
|
+
const json = await agentClient.getWidgetRepositoryHead({ widgetId });
|
|
8999
9071
|
const repoHeadEnvelope = json as unknown as {
|
|
9000
9072
|
data?: { repoHeadCommitSha?: string | null; repo_head_commit_sha?: string | null };
|
|
9001
9073
|
repoHeadCommitSha?: string | null;
|
|
@@ -9297,6 +9369,10 @@
|
|
|
9297
9369
|
|
|
9298
9370
|
|
|
9299
9371
|
async function createNewWidgetRecord() {
|
|
9372
|
+
if (simpleCanvasHasItsWidget()) {
|
|
9373
|
+
showToast('info', $t('creator.widget.oneWidgetAlready'));
|
|
9374
|
+
return;
|
|
9375
|
+
}
|
|
9300
9376
|
if (!$userSession.user || !hasValidToken) {
|
|
9301
9377
|
authStatus = 'Please login first.';
|
|
9302
9378
|
return;
|
|
@@ -9409,7 +9485,7 @@
|
|
|
9409
9485
|
try {
|
|
9410
9486
|
// The API wraps the operation in `{ success, data }`, which the generated client reads as an operation
|
|
9411
9487
|
// with every field empty (a poll could then never see the end): the raw answer is read instead.
|
|
9412
|
-
const answer = await operationsClient.
|
|
9488
|
+
const answer = await operationsClient.getOperationRaw(
|
|
9413
9489
|
{ id: operationId },
|
|
9414
9490
|
{ signal: pollAbortController.signal }
|
|
9415
9491
|
);
|
|
@@ -10797,6 +10873,9 @@ Requirements:
|
|
|
10797
10873
|
generationOperationByWidgetId.delete(generationWidgetId);
|
|
10798
10874
|
|
|
10799
10875
|
generatingWidgetIds = { ...generatingWidgetIds, [generationWidgetId]: true };
|
|
10876
|
+
// The preview address does not change between builds. Without this, the next build
|
|
10877
|
+
// is treated as the one already on the shape, and the shape keeps the previous document.
|
|
10878
|
+
lastRunningPreviewKey = '';
|
|
10800
10879
|
if (previewUnblockedByWidgetId[generationWidgetId]) {
|
|
10801
10880
|
const { [generationWidgetId]: _dropPreview, ...restPreview } = previewUnblockedByWidgetId;
|
|
10802
10881
|
previewUnblockedByWidgetId = restPreview;
|
|
@@ -10807,11 +10886,8 @@ Requirements:
|
|
|
10807
10886
|
cancelQuietScreenshots();
|
|
10808
10887
|
cancelIdleThumbnailPersist();
|
|
10809
10888
|
widgetShapeLivePreviewsRef?.cancelReloads?.();
|
|
10810
|
-
|
|
10811
|
-
|
|
10812
|
-
widgetShapeLivePreviewsRef?.requestReload?.(generationWidgetId, { immediate: true });
|
|
10813
|
-
void getWidgetDetailsRef(generationWidgetId)?.refreshPreview?.();
|
|
10814
|
-
}
|
|
10889
|
+
// The preview stays on the current widget until a build actually lands.
|
|
10890
|
+
// Reloading here only flashed the same frame at the moment of Send.
|
|
10815
10891
|
holdPublishForGeneration(generationWidgetId);
|
|
10816
10892
|
if (restoredViewingVersionByWidgetId[generationWidgetId] != null) {
|
|
10817
10893
|
const { [generationWidgetId]: _droppedRestore, ...restRestored } = restoredViewingVersionByWidgetId;
|
|
@@ -11054,7 +11130,7 @@ Requirements:
|
|
|
11054
11130
|
if (signal.aborted) return;
|
|
11055
11131
|
// The generated client types this call as void and drops the 202 body.
|
|
11056
11132
|
// Read the raw JSON so operationId and the intent-gate payload survive.
|
|
11057
|
-
const accepted = await agentClient.
|
|
11133
|
+
const accepted = await agentClient.generateCodeRaw({
|
|
11058
11134
|
generateCodeRequest: {
|
|
11059
11135
|
repositoryId: repoId,
|
|
11060
11136
|
prompt: options.promptForModel || prompt,
|
|
@@ -11079,6 +11155,15 @@ Requirements:
|
|
|
11079
11155
|
debugMode,
|
|
11080
11156
|
libraries: generationLibraries,
|
|
11081
11157
|
libraryUploads,
|
|
11158
|
+
brandKitEnabled,
|
|
11159
|
+
colors: {
|
|
11160
|
+
primary: brandPrimary,
|
|
11161
|
+
secondary: brandSecondary,
|
|
11162
|
+
title: brandTitle,
|
|
11163
|
+
sub: brandSub,
|
|
11164
|
+
},
|
|
11165
|
+
fonts: brandFonts,
|
|
11166
|
+
fontUploads,
|
|
11082
11167
|
}),
|
|
11083
11168
|
...(options.selectedElements && options.selectedElements.length > 0
|
|
11084
11169
|
? {
|
|
@@ -11087,7 +11172,9 @@ Requirements:
|
|
|
11087
11172
|
selector: el.selector,
|
|
11088
11173
|
idAttr: el.idAttr,
|
|
11089
11174
|
classList: el.classList,
|
|
11090
|
-
textSnippet: el.textSnippet,
|
|
11175
|
+
textSnippet: [el.textSnippet, el.note?.trim() ? `Note: ${el.note.trim()}` : '']
|
|
11176
|
+
.filter(Boolean)
|
|
11177
|
+
.join(' — ') || undefined,
|
|
11091
11178
|
dataContent: el.dataContent,
|
|
11092
11179
|
parentTag: el.parentTag,
|
|
11093
11180
|
outerHtmlSnippet: el.outerHtmlSnippet,
|
|
@@ -11329,7 +11416,8 @@ Requirements:
|
|
|
11329
11416
|
});
|
|
11330
11417
|
clearActiveOperationId(generationWidgetId);
|
|
11331
11418
|
|
|
11332
|
-
const
|
|
11419
|
+
const isGitlabLimit = /gitlab rate limit|gitlab refused the (save|rollback)|last status code:\s*429/i.test(errorMsg);
|
|
11420
|
+
const isServiceError = isGitlabLimit || errorMsg.includes('temporarily unavailable') ||
|
|
11333
11421
|
errorMsg.includes('Our team has been notified') ||
|
|
11334
11422
|
errorMsg.includes('Too many generation requests');
|
|
11335
11423
|
const isSvelteSyntaxError = errorMsg.includes('Svelte') ||
|
|
@@ -11348,7 +11436,7 @@ Requirements:
|
|
|
11348
11436
|
? $t('creator.codegen.aiGeneratedInvalidSvelteSyntax')
|
|
11349
11437
|
: errorMsg;
|
|
11350
11438
|
|
|
11351
|
-
showToast('error', isServiceError ? $t('creator.general.serviceTemporarilyUnavailable') : $t('creator.status.failed'), {
|
|
11439
|
+
showToast('error', isGitlabLimit ? $t('creator.general.rateLimited') : isServiceError ? $t('creator.general.serviceTemporarilyUnavailable') : $t('creator.status.failed'), {
|
|
11352
11440
|
description: toastDescription,
|
|
11353
11441
|
duration: isServiceError ? 10000 : 8000
|
|
11354
11442
|
});
|
|
@@ -11594,6 +11682,7 @@ Requirements:
|
|
|
11594
11682
|
const shownFailure = [completedPreviewBuildErr, !completedCommitSha ? unsavedText : null]
|
|
11595
11683
|
.filter((part): part is string => !!part)
|
|
11596
11684
|
.join('\n');
|
|
11685
|
+
sketchToolbarAfterRestore = false;
|
|
11597
11686
|
patchCodegenUiState(generationWidgetId, {
|
|
11598
11687
|
hasGeneratedCode: true,
|
|
11599
11688
|
...(completedCommitSha ? { lastCommitId: completedCommitSha } : {}),
|
|
@@ -11925,13 +12014,8 @@ Requirements:
|
|
|
11925
12014
|
// Update global flag: true only if the CURRENT widget is still generating
|
|
11926
12015
|
isGeneratingCode = !!(focusedPanelWidgetId && generatingWidgetIds[focusedPanelWidgetId]);
|
|
11927
12016
|
setCrossTabGenerating(false, generationWidgetId);
|
|
11928
|
-
// A finished run already loads the new preview
|
|
11929
|
-
//
|
|
11930
|
-
if (getPanelState(generationWidgetId).lastGenerationFailed) {
|
|
11931
|
-
void tick().then(() => {
|
|
11932
|
-
widgetShapeLivePreviewsRef?.requestReload?.(generationWidgetId, { immediate: true });
|
|
11933
|
-
});
|
|
11934
|
-
}
|
|
12017
|
+
// A finished run already loads the new preview when the worker build lands.
|
|
12018
|
+
// A failed run kept the previous frame, so reloading it only flashes the same picture.
|
|
11935
12019
|
// The API refused this run and the widget is free of it now: follow the person's own generation, or catch up with the
|
|
11936
12020
|
// newer code that was saved. (Not awaited: a followed run can take minutes, and the queue behind this one must not wait.)
|
|
11937
12021
|
if (afterRefusal) {
|
|
@@ -12201,14 +12285,14 @@ Requirements:
|
|
|
12201
12285
|
|
|
12202
12286
|
publishWidgetStatus = $t('creator.publish.publishingViaWidgetBuilder');
|
|
12203
12287
|
|
|
12204
|
-
const publishData = await agentClient.
|
|
12288
|
+
const publishData = await agentClient.publishBuiltWidget({
|
|
12205
12289
|
widgetId: capturedWidgetId,
|
|
12206
|
-
|
|
12290
|
+
publishBuiltWidgetRequest: {
|
|
12207
12291
|
commitSha: commitShaForPublish || undefined,
|
|
12208
12292
|
// Publishing a Draft the user chose: the server rebuilds from that
|
|
12209
12293
|
// version's commit and stamps it Live instead of minting a new one.
|
|
12210
12294
|
version: targetVersion ?? undefined
|
|
12211
|
-
} as unknown as Parameters<typeof agentClient.
|
|
12295
|
+
} as unknown as Parameters<typeof agentClient.publishBuiltWidget>[0]['publishBuiltWidgetRequest']
|
|
12212
12296
|
}, widgetBuilderRequestInit(widgetBuilderPreviewBaseUrl()));
|
|
12213
12297
|
// console.log('[Publish] Widget Builder publish completed:', publishData);
|
|
12214
12298
|
|
|
@@ -12308,6 +12392,7 @@ Requirements:
|
|
|
12308
12392
|
codeGenerationStatus,
|
|
12309
12393
|
agentHarnessOutput,
|
|
12310
12394
|
dynamicWorkerPreviewStatus,
|
|
12395
|
+
deferredVersionRecorded,
|
|
12311
12396
|
setAuthToken as setWsAuthToken,
|
|
12312
12397
|
setWebsocketApiUrl,
|
|
12313
12398
|
resetRealtimeState
|
|
@@ -14004,10 +14089,9 @@ Requirements:
|
|
|
14004
14089
|
const ps = getPanelDisplayState(widgetId);
|
|
14005
14090
|
const liveVersion =
|
|
14006
14091
|
ps.lastPublishedVersion ?? resolvePublishedVersionFromWidget(getWidgetById(widgetId));
|
|
14007
|
-
//
|
|
14008
|
-
// them correctly on its own; sorting by time is a stable tiebreak.
|
|
14092
|
+
// Oldest first, same as the chat: the first version is the top row, the latest is the bottom.
|
|
14009
14093
|
const history = [...getShapePublishHistory(widgetId)].sort(
|
|
14010
|
-
(a, b) => Number(
|
|
14094
|
+
(a, b) => Number(a.version) - Number(b.version),
|
|
14011
14095
|
);
|
|
14012
14096
|
const options: Array<{
|
|
14013
14097
|
id: string;
|
|
@@ -14143,6 +14227,8 @@ Requirements:
|
|
|
14143
14227
|
// draft/restore look like the last publish even when git had moved.
|
|
14144
14228
|
if (versionId.startsWith('v:')) {
|
|
14145
14229
|
const version = Number(versionId.slice(2));
|
|
14230
|
+
// Leaving the sketch. The drawing tools stay only while version 1 is the board.
|
|
14231
|
+
if (version !== 1) sketchToolbarAfterRestore = false;
|
|
14146
14232
|
const record = getShapePublishHistory(widgetId).find((row) => Number(row.version) === version);
|
|
14147
14233
|
const isPublished = !!(record?.publishedAt ?? record?.published_at);
|
|
14148
14234
|
const newestDraft = getNewestDraftVersionId(widgetId);
|
|
@@ -15938,6 +16024,30 @@ $: if ($dynamicWorkerPreviewStatus.widgetId && $dynamicWorkerPreviewStatus.previ
|
|
|
15938
16024
|
}
|
|
15939
16025
|
}
|
|
15940
16026
|
|
|
16027
|
+
// A 429 left the preview up and the version menu empty. When GitLab accepts the same commit, the version lands here.
|
|
16028
|
+
let lastDeferredVersionEventKey: string | null = null;
|
|
16029
|
+
$: if ($deferredVersionRecorded.widgetId && $deferredVersionRecorded.commitId) {
|
|
16030
|
+
const deferredWidgetId = $deferredVersionRecorded.widgetId;
|
|
16031
|
+
const deferredCommitId = $deferredVersionRecorded.commitId;
|
|
16032
|
+
const deferredEventKey = `${deferredWidgetId}:${deferredCommitId}:${$deferredVersionRecorded.timestamp ?? ''}`;
|
|
16033
|
+
if (deferredEventKey !== lastDeferredVersionEventKey) {
|
|
16034
|
+
lastDeferredVersionEventKey = deferredEventKey;
|
|
16035
|
+
const deferredVersion = $deferredVersionRecorded.version;
|
|
16036
|
+
const deferredTitle = $deferredVersionRecorded.commitTitle;
|
|
16037
|
+
setTimeout(() => {
|
|
16038
|
+
console.log('[CreatorApp] Version recorded after GitLab accepted the save', deferredWidgetId.substring(0, 8), deferredVersion);
|
|
16039
|
+
patchCodegenUiState(deferredWidgetId, {
|
|
16040
|
+
lastCommitId: deferredCommitId,
|
|
16041
|
+
lastGenerationFailed: false,
|
|
16042
|
+
lastGenerationError: null,
|
|
16043
|
+
generateCodeStatus: deferredVersion ? `Version ${deferredVersion} saved` : 'Version saved',
|
|
16044
|
+
});
|
|
16045
|
+
stampCodegenTitleIntoPanelHistory(deferredWidgetId, deferredCommitId, deferredTitle);
|
|
16046
|
+
void loadPublishHistoryForPanel(deferredWidgetId, { silent: true, fresh: true });
|
|
16047
|
+
}, 0);
|
|
16048
|
+
}
|
|
16049
|
+
}
|
|
16050
|
+
|
|
15941
16051
|
// ===================== Publish History =====================
|
|
15942
16052
|
|
|
15943
16053
|
/**
|
|
@@ -17163,6 +17273,7 @@ $: if (codeGenerationPrompt && selectedWidgetId && promptLoadedForWidgetId === s
|
|
|
17163
17273
|
? widgetIdsOnCanvas
|
|
17164
17274
|
: [...(canvasRef?.getLinkedWidgetIds?.() ?? [])];
|
|
17165
17275
|
const primaryId = await hydrateCanvasPrimaryWidget(linkedIds);
|
|
17276
|
+
await lockSimpleCanvasToOneWidget(primaryId);
|
|
17166
17277
|
applyPrimarySelectionOnCanvas(primaryId);
|
|
17167
17278
|
requestAnimationFrame(() => {
|
|
17168
17279
|
setTimeout(() => applyPrimarySelectionOnCanvas(primaryId), 80);
|
|
@@ -17653,6 +17764,10 @@ $: if (codeGenerationPrompt && selectedWidgetId && promptLoadedForWidgetId === s
|
|
|
17653
17764
|
showToast('error', $t('creator.session.pleaseLoginFirst'));
|
|
17654
17765
|
return;
|
|
17655
17766
|
}
|
|
17767
|
+
if (simpleCanvasHasItsWidget()) {
|
|
17768
|
+
showToast('info', $t('creator.widget.oneWidgetAlready'));
|
|
17769
|
+
return;
|
|
17770
|
+
}
|
|
17656
17771
|
if (isWidgetOperationInProgress) {
|
|
17657
17772
|
console.warn('[WidgetCreator] Another widget operation in progress, skipping convert');
|
|
17658
17773
|
showToast('warning', $t('creator.general.pleaseWaitForTheCurrent'));
|
|
@@ -17782,6 +17897,11 @@ $: if (codeGenerationPrompt && selectedWidgetId && promptLoadedForWidgetId === s
|
|
|
17782
17897
|
*/
|
|
17783
17898
|
async function finalizeDraftConversion(draftId: string, prompt: string, extraImageUrls: string[] = []): Promise<string | null> {
|
|
17784
17899
|
if (!draftId.startsWith(DRAFT_CONVERT_ID_PREFIX)) return null;
|
|
17900
|
+
if (simpleCanvasHasItsWidget()) {
|
|
17901
|
+
showToast('info', $t('creator.widget.oneWidgetAlready'));
|
|
17902
|
+
console.warn('[CreatorApp] Simple canvas already has a widget — not creating another');
|
|
17903
|
+
return null;
|
|
17904
|
+
}
|
|
17785
17905
|
if (finalizingDraftConversions.has(draftId)) return null;
|
|
17786
17906
|
finalizingDraftConversions.add(draftId);
|
|
17787
17907
|
// Keep Widget Details open while the canvas sketch is replaced (selection
|
|
@@ -17800,8 +17920,8 @@ $: if (codeGenerationPrompt && selectedWidgetId && promptLoadedForWidgetId === s
|
|
|
17800
17920
|
// (Not in a partner's page: the gateway refuses a session this route, and the draft's name does as well.)
|
|
17801
17921
|
if (agentClient && maySuggestWidgetName() && (prompt.trim().length >= 2 || sketchForName)) {
|
|
17802
17922
|
authStatus = 'Naming widget...';
|
|
17803
|
-
const suggestedNameReply = await agentClient.
|
|
17804
|
-
|
|
17923
|
+
const suggestedNameReply = await agentClient.suggestWidgetName({
|
|
17924
|
+
suggestWidgetNameRequest: { prompt, ...(sketchForName ? { image: sketchForName } : {}) },
|
|
17805
17925
|
});
|
|
17806
17926
|
const suggestedName = typeof suggestedNameReply?.name === 'string' ? suggestedNameReply.name.trim() : '';
|
|
17807
17927
|
if (suggestedName) widgetName = suggestedName;
|
|
@@ -18012,6 +18132,35 @@ $: if (codeGenerationPrompt && selectedWidgetId && promptLoadedForWidgetId === s
|
|
|
18012
18132
|
}
|
|
18013
18133
|
}
|
|
18014
18134
|
|
|
18135
|
+
/** Advanced off: the canvas already has its one widget, so another must not be created. */
|
|
18136
|
+
function simpleCanvasHasItsWidget(): boolean {
|
|
18137
|
+
if (!embedded || multipleWidgetsAllowed) return false;
|
|
18138
|
+
const primaryId = (canvasPrimaryWidgetId || '').trim();
|
|
18139
|
+
return !!primaryId && !isDraftConvertId(primaryId);
|
|
18140
|
+
}
|
|
18141
|
+
|
|
18142
|
+
/**
|
|
18143
|
+
* Simple canvas: leave the primary widget's shape, drop the others, and place
|
|
18144
|
+
* the primary when the board is still showing a different widget.
|
|
18145
|
+
*/
|
|
18146
|
+
async function lockSimpleCanvasToOneWidget(primaryId: string | null): Promise<void> {
|
|
18147
|
+
if (!embedded || multipleWidgetsAllowed || !canvasRef || !primaryId) return;
|
|
18148
|
+
const removed = canvasRef.keepOnlyWidgetShape?.(primaryId) ?? 0;
|
|
18149
|
+
const linked = canvasRef.getLinkedWidgetIds?.() ?? new Set<string>();
|
|
18150
|
+
let placed = false;
|
|
18151
|
+
if (!linked.has(primaryId)) {
|
|
18152
|
+
const widget = getWidgetById(primaryId) as { name?: string; thumbnailUrl?: string | null; thumbnail_url?: string | null } | null;
|
|
18153
|
+
const preview = widget?.thumbnailUrl ?? widget?.thumbnail_url ?? null;
|
|
18154
|
+
canvasRef.addWidgetShape?.(primaryId, widget?.name, 0, 1, preview);
|
|
18155
|
+
placed = true;
|
|
18156
|
+
console.log('[CreatorApp] Simple canvas placed the one widget', primaryId.slice(0, 8));
|
|
18157
|
+
}
|
|
18158
|
+
if (removed > 0 || placed) {
|
|
18159
|
+
canvasRef.saveNow?.();
|
|
18160
|
+
syncWidgetShapeLivePreviews();
|
|
18161
|
+
}
|
|
18162
|
+
}
|
|
18163
|
+
|
|
18015
18164
|
/** Draft panel id helper — true when the id is a synthetic convert draft. */
|
|
18016
18165
|
function isDraftConvertId(widgetId: string | null | undefined): boolean {
|
|
18017
18166
|
return !!widgetId && widgetId.startsWith(DRAFT_CONVERT_ID_PREFIX);
|
|
@@ -18160,7 +18309,7 @@ $: if (codeGenerationPrompt && selectedWidgetId && promptLoadedForWidgetId === s
|
|
|
18160
18309
|
if (existingRepoId && verifiedRepositoryIds.has(existingRepoId)) {
|
|
18161
18310
|
// Repo was verified earlier in the session; ping GET /repositories/{repoId}
|
|
18162
18311
|
// in the background so the backend's GitService file/diff caches are hot.
|
|
18163
|
-
void agentClient.
|
|
18312
|
+
void agentClient.getRepository({ repoId: existingRepoId }).catch(() => {});
|
|
18164
18313
|
} else {
|
|
18165
18314
|
await ensureWidgetRepository(widget, { silent: true });
|
|
18166
18315
|
}
|
|
@@ -18219,7 +18368,7 @@ $: if (codeGenerationPrompt && selectedWidgetId && promptLoadedForWidgetId === s
|
|
|
18219
18368
|
if (!repoId) return false;
|
|
18220
18369
|
try {
|
|
18221
18370
|
// get the repository details from the database
|
|
18222
|
-
const repoDetails = await agentClient.
|
|
18371
|
+
const repoDetails = await agentClient.getRepository({ repoId });
|
|
18223
18372
|
|
|
18224
18373
|
if (!repoDetails?.id) {
|
|
18225
18374
|
verifiedRepositoryIds.delete(repoId);
|
|
@@ -18265,7 +18414,7 @@ $: if (codeGenerationPrompt && selectedWidgetId && promptLoadedForWidgetId === s
|
|
|
18265
18414
|
});
|
|
18266
18415
|
applySiteSessionToCreator();
|
|
18267
18416
|
try {
|
|
18268
|
-
const retryDetails = await agentClient.
|
|
18417
|
+
const retryDetails = await agentClient.getRepository({ repoId });
|
|
18269
18418
|
if (retryDetails?.id) {
|
|
18270
18419
|
verifiedRepositoryIds.add(repoId);
|
|
18271
18420
|
return true;
|
|
@@ -18325,7 +18474,7 @@ $: if (codeGenerationPrompt && selectedWidgetId && promptLoadedForWidgetId === s
|
|
|
18325
18474
|
try {
|
|
18326
18475
|
// console.log('Widget Creator: Creating repository for widget:', widget);
|
|
18327
18476
|
const timestamp = new Date().toISOString().slice(0, 19).replace(/:/g, '-');
|
|
18328
|
-
const response = await agentClient.
|
|
18477
|
+
const response = await agentClient.createRepository({
|
|
18329
18478
|
initRepoRequest: {
|
|
18330
18479
|
name: `Widget Project ${timestamp}`,
|
|
18331
18480
|
widgetId: widget.id
|
|
@@ -18741,6 +18890,25 @@ $: if (codeGenerationPrompt && selectedWidgetId && promptLoadedForWidgetId === s
|
|
|
18741
18890
|
void captureListThumbnail(widgetId, true);
|
|
18742
18891
|
}}
|
|
18743
18892
|
onSetPrimaryWidget={handleSetPrimaryWidget}
|
|
18893
|
+
showElementSelector={!!canvasPrimaryWidgetId && !isDraftConvertId(canvasPrimaryWidgetId)}
|
|
18894
|
+
showDrawingTools={showDrawingTools}
|
|
18895
|
+
elementSelectorActive={!!(canvasPrimaryWidgetId && selectorEnabledByWidgetId[canvasPrimaryWidgetId])}
|
|
18896
|
+
selectorGuide={{
|
|
18897
|
+
click: $t('creator.elementSelector.clickPartToReference'),
|
|
18898
|
+
parentChild: $t('creator.elementSelector.parentChild'),
|
|
18899
|
+
hold: $t('creator.elementSelector.hold'),
|
|
18900
|
+
cmd: $t('creator.elementSelector.cmdCtrl'),
|
|
18901
|
+
interact: $t('creator.elementSelector.toInteract'),
|
|
18902
|
+
esc: $t('creator.elementSelector.esc'),
|
|
18903
|
+
done: $t('creator.elementSelector.done'),
|
|
18904
|
+
}}
|
|
18905
|
+
onToggleElementSelector={() => {
|
|
18906
|
+
if (!canvasPrimaryWidgetId || isDraftConvertId(canvasPrimaryWidgetId)) return;
|
|
18907
|
+
handleToggleWidgetSelector(
|
|
18908
|
+
canvasPrimaryWidgetId,
|
|
18909
|
+
!selectorEnabledByWidgetId[canvasPrimaryWidgetId],
|
|
18910
|
+
);
|
|
18911
|
+
}}
|
|
18744
18912
|
onAfterRender={syncWidgetShapeLivePreviews}
|
|
18745
18913
|
getWidgetName={getWidgetNameById}
|
|
18746
18914
|
widgetNameRevision={widgetNamesRevision}
|
|
@@ -18820,9 +18988,11 @@ $: if (codeGenerationPrompt && selectedWidgetId && promptLoadedForWidgetId === s
|
|
|
18820
18988
|
isGenerating={isAnyWidgetGenerating()}
|
|
18821
18989
|
onLiveFrameShown={noteShapePreviewShown}
|
|
18822
18990
|
resolveSelectorEnabled={(widgetId) => !!selectorEnabledByWidgetId[widgetId]}
|
|
18991
|
+
showUnderShapeSelectorHint={false}
|
|
18823
18992
|
resolveSelectedElements={(widgetId) => selectedElementsByWidgetId[widgetId] ?? []}
|
|
18824
18993
|
onSelectWidgetElement={(widgetId, element) => handleSelectWidgetElement(widgetId, element)}
|
|
18825
18994
|
onRemoveWidgetElement={(widgetId, elementId) => handleRemoveWidgetElement(widgetId, elementId)}
|
|
18995
|
+
onUpdateWidgetElementNote={(widgetId, elementId, note) => handleUpdateWidgetElementNote(widgetId, elementId, note)}
|
|
18826
18996
|
onCloseWidgetSelector={(widgetId) => {
|
|
18827
18997
|
handleToggleWidgetSelector(widgetId, false);
|
|
18828
18998
|
canvasRef?.setWidgetShapeBodyDragAllowed?.(widgetId, false);
|
|
@@ -19536,7 +19706,7 @@ $: if (codeGenerationPrompt && selectedWidgetId && promptLoadedForWidgetId === s
|
|
|
19536
19706
|
runPublishForPanel(panelWidgetId, Number(viewingVersion));
|
|
19537
19707
|
}}
|
|
19538
19708
|
disabled={!canPublishDraftVersionForPanel(panelWidgetId, viewingVersion) || getPublishGateForPanel(panelWidgetId, Number(viewingVersion)).disabled}
|
|
19539
|
-
title={$t('creator.
|
|
19709
|
+
title={$t('creator.livePreviews.publishThisDraft')}
|
|
19540
19710
|
class="wc-version-publish-btn shrink-0 inline-flex items-center justify-center min-w-[4.75rem] w-[4.75rem] text-[10px] font-semibold uppercase tracking-wide px-1.5 py-0.5 rounded border border-emerald-600 bg-emerald-600 text-white hover:bg-emerald-700 disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer"
|
|
19541
19711
|
>
|
|
19542
19712
|
{isPublishing && publishingWidgetId === panelWidgetId ? '...' : $t('creator.common.publish')}
|
|
@@ -19582,7 +19752,7 @@ $: if (codeGenerationPrompt && selectedWidgetId && promptLoadedForWidgetId === s
|
|
|
19582
19752
|
class="wc-version-history-scroll flex flex-col gap-1 overflow-x-hidden {hasChatScroll ? 'overflow-y-auto' : 'overflow-y-visible'}"
|
|
19583
19753
|
style="{hasChatScroll ? 'max-height: 185px; margin-inline-end: -4px; padding-inline-end: 4px;' : 'max-height: none;'} scrollbar-width: thin; scrollbar-color: rgba(0,0,0,0.2) transparent;"
|
|
19584
19754
|
>
|
|
19585
|
-
{#each ps.publishHistory as record (record.id)}
|
|
19755
|
+
{#each [...ps.publishHistory].sort((a, b) => Number(a.version) - Number(b.version)) as record (record.id)}
|
|
19586
19756
|
{@const rowVersion = Number(record.version)}
|
|
19587
19757
|
{@const rowIsDraft = !(record.publishedAt ?? record.published_at)}
|
|
19588
19758
|
{@const rowIsViewing = rowVersion === Number(viewingVersion)}
|
|
@@ -19781,9 +19951,17 @@ $: if (codeGenerationPrompt && selectedWidgetId && promptLoadedForWidgetId === s
|
|
|
19781
19951
|
/>
|
|
19782
19952
|
{/snippet}
|
|
19783
19953
|
{#snippet generationOptionChecks()}
|
|
19784
|
-
<
|
|
19954
|
+
<BrandKitPanel
|
|
19785
19955
|
part="checks"
|
|
19786
19956
|
showPresetLibraries={debugMode}
|
|
19957
|
+
showBrandKit={debugMode}
|
|
19958
|
+
bind:brandKitEnabled
|
|
19959
|
+
bind:primary={brandPrimary}
|
|
19960
|
+
bind:secondary={brandSecondary}
|
|
19961
|
+
bind:title={brandTitle}
|
|
19962
|
+
bind:sub={brandSub}
|
|
19963
|
+
bind:fonts={brandFonts}
|
|
19964
|
+
bind:fontUploads
|
|
19787
19965
|
bind:librariesEnabled
|
|
19788
19966
|
bind:libraries={generationLibraries}
|
|
19789
19967
|
bind:libraryGitUrl
|
|
@@ -19833,7 +20011,7 @@ $: if (codeGenerationPrompt && selectedWidgetId && promptLoadedForWidgetId === s
|
|
|
19833
20011
|
versionLabelByPrompt={versionPromptLabelsByWidgetId[panelWidgetId] ?? emptyVersionLabels}
|
|
19834
20012
|
versionTimeline={versionTimelineByWidgetId[panelWidgetId] ?? emptyVersionTimeline}
|
|
19835
20013
|
viewingVersion={viewingVersionByWidgetId[panelWidgetId] ?? null}
|
|
19836
|
-
showSelector={
|
|
20014
|
+
showSelector={false}
|
|
19837
20015
|
isSelectorActive={!!selectorEnabledByWidgetId[panelWidgetId]}
|
|
19838
20016
|
selectedElements={selectedElementsByWidgetId[panelWidgetId] ?? []}
|
|
19839
20017
|
onToggleSelector={(active) => handleToggleWidgetSelector(panelWidgetId, active)}
|