@widgetic/creator 0.4.49 → 0.4.51
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 +453 -86
- package/dist/CreatorApp.svelte.d.ts +7 -0
- package/dist/agentMascotWarmUp.d.ts +29 -0
- package/dist/agentMascotWarmUp.js +33 -0
- package/dist/agentSound.d.ts +28 -0
- package/dist/agentSound.js +47 -0
- package/dist/chatPeople.d.ts +19 -0
- package/dist/chatPeople.js +44 -0
- package/dist/components/BrandKitPanel.svelte.d.ts +1 -1
- package/dist/components/FileUrlSourceControl.svelte.d.ts +1 -1
- package/dist/components/WidgetDetails.svelte +4 -1
- package/dist/components/WidgetDetails.svelte.d.ts +1 -1
- package/dist/components/WidgetShapeLivePreviews.svelte +1 -1
- package/dist/creator-types.d.ts +24 -0
- package/dist/host/creatorHost.d.ts +5 -0
- package/dist/host/creatorHost.js +5 -0
- package/dist/i18n/language.d.ts +31 -24
- package/dist/i18n/messages.d.ts +7 -9
- package/dist/i18n/messages.js +7 -9
- package/dist/mergeBatchWidgetOntoListRecord.d.ts +16 -0
- package/dist/mergeBatchWidgetOntoListRecord.js +32 -0
- package/dist/sketchBarState.d.ts +10 -3
- package/dist/sketchBarState.js +26 -6
- package/dist/sketchBoardAfterDelete.d.ts +34 -0
- package/dist/sketchBoardAfterDelete.js +20 -0
- package/dist/sketchBoardStatusChip.d.ts +15 -0
- package/dist/sketchBoardStatusChip.js +17 -0
- package/dist/sketchToolbarMode.d.ts +13 -0
- package/dist/sketchToolbarMode.js +13 -0
- package/dist/syncSiteAuth.js +7 -2
- package/package.json +8 -5
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a one-widget sketch canvas shows after the card of its widget leaves the board (Delete widget, item 21) and when it comes back
|
|
3
|
+
* (Undo). Everything the canvas draws around the board — the name in the bar, the "ready" chip, the selector bar in place of the
|
|
4
|
+
* drawing tools, the widget's chat — follows the primary widget id, so the id has to follow the card.
|
|
5
|
+
*/
|
|
6
|
+
/** Decides, after the board changed, how the primary widget id has to move for the widget the person deleted. */
|
|
7
|
+
export function stepAfterBoardChange(input) {
|
|
8
|
+
const deletedWidgetId = (input.deletedWidgetId ?? '').trim();
|
|
9
|
+
if (!deletedWidgetId)
|
|
10
|
+
return { kind: 'keep' };
|
|
11
|
+
const primaryWidgetId = (input.primaryWidgetId ?? '').trim();
|
|
12
|
+
if (primaryWidgetId && primaryWidgetId !== deletedWidgetId)
|
|
13
|
+
return { kind: 'forget' };
|
|
14
|
+
const cardIsOnBoard = input.linkedWidgetIds.has(deletedWidgetId);
|
|
15
|
+
if (cardIsOnBoard && !primaryWidgetId)
|
|
16
|
+
return { kind: 'restore', widgetId: deletedWidgetId };
|
|
17
|
+
if (!cardIsOnBoard && primaryWidgetId === deletedWidgetId)
|
|
18
|
+
return { kind: 'clear', widgetId: deletedWidgetId };
|
|
19
|
+
return { kind: 'keep' };
|
|
20
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Figma Generation Chip on the sketch canvas (520:586): Generating / Ready / Failed while the widget builds.
|
|
3
|
+
*/
|
|
4
|
+
export type SketchBoardStatusChipVariant = 'generating' | 'ready' | 'failed';
|
|
5
|
+
export type SketchBoardStatusChipState = {
|
|
6
|
+
variant: SketchBoardStatusChipVariant;
|
|
7
|
+
showAction: boolean;
|
|
8
|
+
} | null;
|
|
9
|
+
export declare function resolveSketchBoardStatusChip(input: {
|
|
10
|
+
embedded: boolean;
|
|
11
|
+
generating: boolean;
|
|
12
|
+
failed: boolean;
|
|
13
|
+
hasGeneratedCode: boolean;
|
|
14
|
+
showsLive: boolean;
|
|
15
|
+
}): SketchBoardStatusChipState;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Figma Generation Chip on the sketch canvas (520:586): Generating / Ready / Failed while the widget builds.
|
|
3
|
+
*/
|
|
4
|
+
export function resolveSketchBoardStatusChip(input) {
|
|
5
|
+
if (!input.embedded)
|
|
6
|
+
return null;
|
|
7
|
+
if (input.generating) {
|
|
8
|
+
return { variant: 'generating', showAction: true };
|
|
9
|
+
}
|
|
10
|
+
if (input.failed) {
|
|
11
|
+
return { variant: 'failed', showAction: true };
|
|
12
|
+
}
|
|
13
|
+
if (input.hasGeneratedCode && !input.showsLive) {
|
|
14
|
+
return { variant: 'ready', showAction: false };
|
|
15
|
+
}
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* When the sketch embed swaps the drawing toolbar for the element selector bar (item 20).
|
|
3
|
+
*/
|
|
4
|
+
export type SketchToolbarModeInput = {
|
|
5
|
+
/** Widget has a successful build artifact (commit, generated code, or published version). */
|
|
6
|
+
hasBuiltArtifact: boolean;
|
|
7
|
+
/** Code generation is in progress for the primary widget. */
|
|
8
|
+
generating: boolean;
|
|
9
|
+
/** Last generation failed (panel or widget flags). */
|
|
10
|
+
generationFailed: boolean;
|
|
11
|
+
};
|
|
12
|
+
/** True when the selector bar should replace the drawing tools (success only). */
|
|
13
|
+
export declare function shouldHideDrawingToolbarForSelector(input: SketchToolbarModeInput): boolean;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* When the sketch embed swaps the drawing toolbar for the element selector bar (item 20).
|
|
3
|
+
*/
|
|
4
|
+
/** True when the selector bar should replace the drawing tools (success only). */
|
|
5
|
+
export function shouldHideDrawingToolbarForSelector(input) {
|
|
6
|
+
if (!input.hasBuiltArtifact)
|
|
7
|
+
return false;
|
|
8
|
+
if (input.generating)
|
|
9
|
+
return false;
|
|
10
|
+
if (input.generationFailed)
|
|
11
|
+
return false;
|
|
12
|
+
return true;
|
|
13
|
+
}
|
package/dist/syncSiteAuth.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { decodeJWT } from './pageHelpers';
|
|
2
2
|
import { setSession } from './stores/userSession';
|
|
3
3
|
import { syncLocalCacheOwner } from './localCacheGate.js';
|
|
4
|
+
import { SIGNED_IN_FALLBACK_NAME } from './host/creatorHost.js';
|
|
4
5
|
const SITE_SESSION_REQUEST_EVENT = 'widgetic:request-site-session';
|
|
5
6
|
function requestInMemorySiteSession() {
|
|
6
7
|
if (typeof window === 'undefined' || typeof window.dispatchEvent !== 'function') {
|
|
@@ -84,11 +85,15 @@ export function syncSessionFromSiteAuth() {
|
|
|
84
85
|
decoded.user_metadata?.full_name ||
|
|
85
86
|
decoded.name ||
|
|
86
87
|
session?.user?.name ||
|
|
87
|
-
|
|
88
|
+
SIGNED_IN_FALLBACK_NAME,
|
|
88
89
|
role: decoded.role || 'user',
|
|
89
90
|
avatar: decoded.user_metadata?.avatar_url || decoded.user_metadata?.picture
|
|
90
91
|
}
|
|
91
|
-
: session?.user || {
|
|
92
|
+
: session?.user || {
|
|
93
|
+
id: 'site-user',
|
|
94
|
+
email: 'user@widgetic.com',
|
|
95
|
+
name: SIGNED_IN_FALLBACK_NAME
|
|
96
|
+
};
|
|
92
97
|
// setSession → syncLocalCacheOwner when enableLocalCache is on
|
|
93
98
|
setSession(user, token);
|
|
94
99
|
// console.log('[CreatorApp] Session synced from site auth');
|
package/package.json
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@widgetic/creator",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.51",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"peerDependencies": {
|
|
7
7
|
"@sveltejs/kit": "^2.20.0",
|
|
8
8
|
"@widgetic/api-sdk": "^2.0.0",
|
|
9
|
+
"@widgetic/brand": "^0.1.1",
|
|
9
10
|
"@widgetic/cache-layer": "^0.1.2",
|
|
10
11
|
"@widgetic/canvas": "^0.5.39",
|
|
11
|
-
"@widgetic/chat": "^0.1.
|
|
12
|
-
"@widgetic/design-system": "^0.5.
|
|
12
|
+
"@widgetic/chat": "^0.1.40",
|
|
13
|
+
"@widgetic/design-system": "^0.5.39",
|
|
13
14
|
"@widgetic/editor": "^4.1.3",
|
|
14
15
|
"@widgetic/file-browser": "^0.5.25",
|
|
15
16
|
"svelte": "^5.25.0"
|
|
@@ -73,10 +74,11 @@
|
|
|
73
74
|
"@tailwindcss/typography": "^0.5.15",
|
|
74
75
|
"@types/node": "26.4.0",
|
|
75
76
|
"@widgetic/api-sdk": "^2.0.0",
|
|
77
|
+
"@widgetic/brand": "^0.1.1",
|
|
76
78
|
"@widgetic/cache-layer": "^0.1.2",
|
|
77
79
|
"@widgetic/canvas": "^0.5.39",
|
|
78
|
-
"@widgetic/chat": "^0.1.
|
|
79
|
-
"@widgetic/design-system": "^0.5.
|
|
80
|
+
"@widgetic/chat": "^0.1.40",
|
|
81
|
+
"@widgetic/design-system": "^0.5.39",
|
|
80
82
|
"@widgetic/dev-tools": "^0.3.0",
|
|
81
83
|
"@widgetic/editor": "^4.1.3",
|
|
82
84
|
"@widgetic/file-browser": "^0.5.25",
|
|
@@ -96,6 +98,7 @@
|
|
|
96
98
|
"tailwindcss": "^4.1.4",
|
|
97
99
|
"tailwindcss-animate": "^1.0.7",
|
|
98
100
|
"terser": "^5.46.0",
|
|
101
|
+
"three": "^0.174.0",
|
|
99
102
|
"ts-node": "^10.9.2",
|
|
100
103
|
"typescript": "^5.8.3",
|
|
101
104
|
"typescript-eslint": "^8.20.0",
|