@widgetic/creator 0.3.49 → 0.3.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.
@@ -147,12 +147,22 @@ declare const WidgetDetails: $$__sveltets_2_IsomorphicComponent<{
147
147
  startTokenAutoRefreshPublic?: () => void;
148
148
  fetchDirectPreviewUrlPublic?: () => Promise<string | null>;
149
149
  centerDetailsPanel?: () => void;
150
+ keepPanelInViewport?: () => void;
151
+ positionBesideShape?: (shapeRect: {
152
+ left: number;
153
+ top: number;
154
+ width: number;
155
+ height: number;
156
+ viewportLeft: number;
157
+ viewportTop: number;
158
+ viewportWidth: number;
159
+ viewportHeight: number;
160
+ } | null) => void;
150
161
  openWidgetDetails?: () => void;
151
162
  closeWidgetDetails?: (options?: {
152
163
  silent?: boolean;
153
164
  }) => void;
154
165
  }, {
155
- widgetRename: CustomEvent<any>;
156
166
  fixErrors: CustomEvent<any>;
157
167
  retryRepository: CustomEvent<any>;
158
168
  generateNow: CustomEvent<any>;
@@ -226,6 +236,17 @@ declare const WidgetDetails: $$__sveltets_2_IsomorphicComponent<{
226
236
  startTokenAutoRefreshPublic: () => void;
227
237
  fetchDirectPreviewUrlPublic: () => Promise<string | null>;
228
238
  centerDetailsPanel: () => void;
239
+ keepPanelInViewport: () => void;
240
+ positionBesideShape: (shapeRect: {
241
+ left: number;
242
+ top: number;
243
+ width: number;
244
+ height: number;
245
+ viewportLeft: number;
246
+ viewportTop: number;
247
+ viewportWidth: number;
248
+ viewportHeight: number;
249
+ } | null) => void;
229
250
  openWidgetDetails: () => void;
230
251
  closeWidgetDetails: (options?: {
231
252
  silent?: boolean;
@@ -32,6 +32,12 @@ export interface CreatorAppProps {
32
32
  * Omit for standalone widget-creator (falls back to VITE_DEBUG_MODE / dev).
33
33
  */
34
34
  initialDebugMode?: boolean;
35
+ /**
36
+ * Extra canvas tools (undo/frame/image/library, zoom 1:1/fit/shortcuts).
37
+ * Independent of debugMode — Debug is staging-only UI.
38
+ * Site owns the header toggle; embed uses CustomEvent after mount.
39
+ */
40
+ initialAdvancedFeatures?: boolean;
35
41
  /**
36
42
  * Host-controlled default coder model id (e.g. `deepseek-v4-flash`).
37
43
  * Site reads its own env and passes this — no creator-app.js rebuild, no API-gateway default for the UI.
@@ -19,6 +19,10 @@ export function streamOperationUpdates(operationId, options) {
19
19
  let abortController = null;
20
20
  let reader = null;
21
21
  const cleanup = () => {
22
+ if (watchdogTimer) {
23
+ clearTimeout(watchdogTimer);
24
+ watchdogTimer = null;
25
+ }
22
26
  try {
23
27
  reader?.cancel();
24
28
  }
@@ -42,6 +46,18 @@ export function streamOperationUpdates(operationId, options) {
42
46
  else
43
47
  reject(value);
44
48
  };
49
+ // Watchdog: if no frame arrives for a while (proxy dropped the stream,
50
+ // server stalled), give up on SSE and let the caller fall back to
51
+ // polling GET /operations/:id — the terminal event then always lands.
52
+ const WATCHDOG_TIMEOUT_MS = 45000;
53
+ let watchdogTimer = null;
54
+ const armWatchdog = () => {
55
+ if (watchdogTimer)
56
+ clearTimeout(watchdogTimer);
57
+ watchdogTimer = setTimeout(() => {
58
+ settle('reject', new Error('Operation stream idle — falling back to polling'));
59
+ }, WATCHDOG_TIMEOUT_MS);
60
+ };
45
61
  const run = async () => {
46
62
  abortController = new AbortController();
47
63
  // Propagate caller aborts into the fetch request.
@@ -68,12 +84,15 @@ export function streamOperationUpdates(operationId, options) {
68
84
  reader = response.body.getReader();
69
85
  const decoder = new TextDecoder();
70
86
  let buffer = '';
87
+ armWatchdog();
71
88
  while (true) {
72
89
  const { done, value } = await reader.read();
73
90
  if (done)
74
91
  break;
92
+ armWatchdog();
75
93
  buffer += decoder.decode(value, { stream: true });
76
- // SSE frames are `data: {...}\n\n`
94
+ // SSE frames are `data: {...}\n\n`; keepalive comment frames carry
95
+ // no data line and are skipped.
77
96
  let frameEnd = buffer.indexOf('\n\n');
78
97
  while (frameEnd !== -1) {
79
98
  const frame = buffer.slice(0, frameEnd);
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "@widgetic/creator",
3
- "version": "0.3.49",
3
+ "version": "0.3.51",
4
4
  "type": "module",
5
5
  "peerDependencies": {
6
6
  "@sveltejs/kit": "^2.20.0",
7
7
  "svelte": "^5.25.0",
8
- "@widgetic/api-sdk": "*",
9
- "@widgetic/canvas": "^0.5.3",
10
- "@widgetic/cache-layer": "^0.1.1",
11
- "@widgetic/chat": "^0.1.3",
12
- "@widgetic/design-system": ">=0.3.0",
13
- "@widgetic/editor": "^4.0.0",
14
- "@widgetic/file-browser": "^0.5.16"
8
+ "@widgetic/api-sdk": "^1.0.10",
9
+ "@widgetic/canvas": "^0.5.4",
10
+ "@widgetic/cache-layer": "^0.1.2",
11
+ "@widgetic/chat": "^0.1.4",
12
+ "@widgetic/design-system": "^0.5.8",
13
+ "@widgetic/editor": "^4.0.1",
14
+ "@widgetic/file-browser": "^0.5.17"
15
15
  },
16
16
  "svelte": "./dist/index.js",
17
17
  "module": "./dist/index.js",
@@ -89,13 +89,13 @@
89
89
  "vite": "^6.2.6",
90
90
  "vite-imagetools": "^7.0.4",
91
91
  "vitest": "^2.0.0",
92
- "@widgetic/api-sdk": "*",
93
- "@widgetic/canvas": "^0.5.3",
94
- "@widgetic/cache-layer": "^0.1.1",
95
- "@widgetic/chat": "^0.1.3",
96
- "@widgetic/design-system": ">=0.3.0",
97
- "@widgetic/editor": "^4.0.0",
98
- "@widgetic/file-browser": "^0.5.16"
92
+ "@widgetic/api-sdk": "^1.0.10",
93
+ "@widgetic/canvas": "^0.5.4",
94
+ "@widgetic/cache-layer": "^0.1.2",
95
+ "@widgetic/chat": "^0.1.4",
96
+ "@widgetic/design-system": "^0.5.8",
97
+ "@widgetic/editor": "^4.0.1",
98
+ "@widgetic/file-browser": "^0.5.17"
99
99
  },
100
100
  "dependencies": {
101
101
  "@codesandbox/sandpack-react": "^2.19.9",