@widgetic/creator 0.4.23 → 0.4.25
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 +22 -2
- package/package.json +1 -1
package/dist/CreatorApp.svelte
CHANGED
|
@@ -447,6 +447,7 @@
|
|
|
447
447
|
if (selectedWidget?.id === targetId) {
|
|
448
448
|
selectedWidget = { ...selectedWidget, name: trimmed };
|
|
449
449
|
}
|
|
450
|
+
notifyHostWidgetName({ id: targetId, name: trimmed });
|
|
450
451
|
widgetNamesRevision += 1;
|
|
451
452
|
panelDisplayRevision += 1;
|
|
452
453
|
backfillWidgetShapeMetadata();
|
|
@@ -17359,6 +17360,24 @@ $: if (codeGenerationPrompt && selectedWidgetId && promptLoadedForWidgetId === s
|
|
|
17359
17360
|
const draftPanelState = getPanelState(draftId);
|
|
17360
17361
|
const draftName = getWidgetById(draftId)?.name
|
|
17361
17362
|
?? `ConvertedW-${Date.now()}`;
|
|
17363
|
+
let widgetName = draftName;
|
|
17364
|
+
try {
|
|
17365
|
+
const sketchForName = screenshot.startsWith('data:image/') ? screenshot : null;
|
|
17366
|
+
if (agentClient && (prompt.trim().length >= 2 || sketchForName)) {
|
|
17367
|
+
authStatus = 'Naming widget...';
|
|
17368
|
+
const suggestedName = await agentClient.suggestWidgetName(prompt, sketchForName);
|
|
17369
|
+
if (suggestedName) widgetName = suggestedName;
|
|
17370
|
+
}
|
|
17371
|
+
} catch (nameError) {
|
|
17372
|
+
console.warn('[WidgetCreator] Name suggestion before create failed:', nameError);
|
|
17373
|
+
}
|
|
17374
|
+
if (widgetName !== draftName) {
|
|
17375
|
+
announceToSite('widgetic:creator-primary-renamed', { name: widgetName });
|
|
17376
|
+
}
|
|
17377
|
+
widgets = widgets.map((widget) => widget.id === draftId ? { ...widget, name: widgetName } : widget);
|
|
17378
|
+
if (selectedWidget?.id === draftId) {
|
|
17379
|
+
selectedWidget = { ...selectedWidget, name: widgetName };
|
|
17380
|
+
}
|
|
17362
17381
|
|
|
17363
17382
|
authStatus = 'Creating widget from design...';
|
|
17364
17383
|
if (!canvasId) await ensureCanvasRowForFirstEdit();
|
|
@@ -17366,7 +17385,7 @@ $: if (codeGenerationPrompt && selectedWidgetId && promptLoadedForWidgetId === s
|
|
|
17366
17385
|
const response = await widgetsClient.createWidget(
|
|
17367
17386
|
{
|
|
17368
17387
|
newWidget: {
|
|
17369
|
-
name:
|
|
17388
|
+
name: widgetName,
|
|
17370
17389
|
type: 'widget',
|
|
17371
17390
|
// Canvas sketch snapshot is stored on the widget for future reference
|
|
17372
17391
|
content: {
|
|
@@ -17542,7 +17561,7 @@ $: if (codeGenerationPrompt && selectedWidgetId && promptLoadedForWidgetId === s
|
|
|
17542
17561
|
|
|
17543
17562
|
authStatus = 'Widget created from design.';
|
|
17544
17563
|
showToast('success', $t('creator.widget.widgetCreated'), {
|
|
17545
|
-
description: $t('creator.codegen.isReadyGenerationStarted', { name:
|
|
17564
|
+
description: $t('creator.codegen.isReadyGenerationStarted', { name: newWidget.name || widgetName })
|
|
17546
17565
|
});
|
|
17547
17566
|
return widgetId;
|
|
17548
17567
|
} catch (error) {
|
|
@@ -18263,6 +18282,7 @@ $: if (codeGenerationPrompt && selectedWidgetId && promptLoadedForWidgetId === s
|
|
|
18263
18282
|
widgetSelectionLayerTarget="floating-panels-overlay"
|
|
18264
18283
|
bind:wireframeMode={canvasWireframeMode}
|
|
18265
18284
|
advancedFeatures={canvasAdvancedFeatures}
|
|
18285
|
+
showZoomPanel={debugMode}
|
|
18266
18286
|
onReady={handleCanvasReady}
|
|
18267
18287
|
onAutoSave={handleCanvasAutoSave}
|
|
18268
18288
|
onBeforeUnmount={(json) => {
|