@ms-cloudpack/overlay 0.3.0 → 0.5.0

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.
@@ -0,0 +1,1226 @@
1
+ // src/index.tsx
2
+ import React13 from "react";
3
+ import ReactDOM from "react-dom";
4
+
5
+ // src/components/CloudpackProvider/CloudpackProvider.tsx
6
+ import React, { createContext, useState, useContext } from "react";
7
+
8
+ // src/components/CloudpackProvider/getCookies.ts
9
+ function getCookies() {
10
+ return document.cookie.split(";").map((s8) => s8.split("=")).reduce((current, nextValue) => {
11
+ const name2 = nextValue[0]?.trim();
12
+ const value3 = decodeURIComponent(nextValue[1]?.trim());
13
+ if (name2 && value3) {
14
+ current[name2] = value3;
15
+ }
16
+ return current;
17
+ }, {});
18
+ }
19
+
20
+ // src/components/CloudpackProvider/createCloudpackClient.ts
21
+ import { createDataBus } from "@ms-cloudpack/data-bus";
22
+ function createCloudpackClient() {
23
+ const cookies = getCookies();
24
+ const bus = createDataBus();
25
+ let subCounter = 0;
26
+ const subIds = {};
27
+ bus.addProvider({
28
+ path: [],
29
+ onActivate: ({ path }) => {
30
+ const id = subCounter++;
31
+ subIds[path.join("/")] = id;
32
+ sendMessage("subscribe", { path, id });
33
+ },
34
+ onDeactivate: ({ path }) => {
35
+ const pathString = path.join("/");
36
+ const id = subIds[pathString];
37
+ delete subIds[pathString];
38
+ sendMessage("unsubscribe", { path, id });
39
+ }
40
+ });
41
+ const enqueuedMessages = [];
42
+ const sessionId = cookies["cloudpack-session-id"];
43
+ const apiUrl = cookies["cloudpack-api-url"];
44
+ let socket;
45
+ function openConnection() {
46
+ if (apiUrl && sessionId) {
47
+ const newSocket = new WebSocket(apiUrl);
48
+ newSocket.onopen = () => {
49
+ console.log("socket opened");
50
+ socket = newSocket;
51
+ socket.onmessage = onMessageReceived;
52
+ socket.onclose = () => {
53
+ socket = void 0;
54
+ };
55
+ for (const message of enqueuedMessages) {
56
+ socket.send(message);
57
+ }
58
+ enqueuedMessages.length = 0;
59
+ };
60
+ }
61
+ }
62
+ function dispose() {
63
+ if (socket) {
64
+ socket.close();
65
+ socket = void 0;
66
+ }
67
+ }
68
+ function sendMessage(type, data) {
69
+ const message = JSON.stringify({ type, data });
70
+ if (socket) {
71
+ console.log(`Sent message: ${type}`, data);
72
+ socket.send(message);
73
+ } else {
74
+ enqueuedMessages.push(message);
75
+ }
76
+ }
77
+ function onMessageReceived(message) {
78
+ const response = JSON.parse(message.data);
79
+ console.log("Received message:", response);
80
+ switch (response.type) {
81
+ case "notify": {
82
+ const { path, data } = response;
83
+ bus.publish(path, data);
84
+ break;
85
+ }
86
+ case "reload": {
87
+ window.location.reload();
88
+ break;
89
+ }
90
+ }
91
+ }
92
+ function subscribe(path, callback) {
93
+ const sessionPath = [sessionId, ...path];
94
+ return bus.subscribe(sessionPath, callback);
95
+ }
96
+ function getValue(path) {
97
+ const sessionPath = [sessionId, ...path];
98
+ return bus.getData(sessionPath);
99
+ }
100
+ function openSource(options) {
101
+ sendMessage("openSource", options);
102
+ }
103
+ function open(options) {
104
+ sendMessage("open", options);
105
+ }
106
+ function restartTasks() {
107
+ sendMessage("restartTasks", {});
108
+ }
109
+ openConnection();
110
+ return {
111
+ dispose,
112
+ getValue,
113
+ open,
114
+ openSource,
115
+ subscribe,
116
+ restartTasks
117
+ };
118
+ }
119
+
120
+ // src/components/CloudpackProvider/CloudpackProvider.tsx
121
+ var CloudpackContext = createContext(null);
122
+ function CloudpackProvider({ children }) {
123
+ const [client] = useState(createCloudpackClient);
124
+ return /* @__PURE__ */ React.createElement(CloudpackContext.Provider, {
125
+ value: client
126
+ }, children);
127
+ }
128
+ var useCloudpack = () => useContext(CloudpackContext);
129
+
130
+ // src/components/StatusOverlay/StatusOverlay.tsx
131
+ import React11, { useCallback, useState as useState6, useRef as useRef3 } from "react";
132
+
133
+ // src/components/StatusBadge/StatusBadge.tsx
134
+ import React2, { useRef } from "react";
135
+
136
+ // src/hooks/useDraggable.ts
137
+ import { useEffect, useState as useState2 } from "react";
138
+ function useDraggable(containerElementRef, dragElementRef = containerElementRef) {
139
+ const [isDragging, setIsDragging] = useState2(false);
140
+ useEffect(() => {
141
+ if (containerElementRef && dragElementRef) {
142
+ const moveTarget = containerElementRef.current;
143
+ const dragTarget = dragElementRef.current;
144
+ if (moveTarget && dragTarget) {
145
+ let originalX = 0;
146
+ let originalY = 0;
147
+ let offset = { x: 0, y: 0 };
148
+ const onPointerMove = (event) => {
149
+ moveTarget.style.transform = `translate(${offset.x + event.clientX - originalX}px, ${offset.y + event.clientY - originalY}px)`;
150
+ };
151
+ const onPointerUp = (event) => {
152
+ setIsDragging(false);
153
+ offset = {
154
+ x: offset.x + event.clientX - originalX,
155
+ y: offset.y + event.clientY - originalY
156
+ };
157
+ dragTarget.releasePointerCapture(event.pointerId);
158
+ dragTarget.removeEventListener("pointerup", onPointerUp);
159
+ dragTarget.removeEventListener("pointermove", onPointerMove);
160
+ event.preventDefault();
161
+ };
162
+ const onPointerDown = (event) => {
163
+ setIsDragging(true);
164
+ originalX = event.clientX;
165
+ originalY = event.clientY;
166
+ dragTarget.setPointerCapture(event.pointerId);
167
+ dragTarget.addEventListener("pointerup", onPointerUp);
168
+ dragTarget.addEventListener("pointermove", onPointerMove);
169
+ event.preventDefault();
170
+ };
171
+ dragTarget.addEventListener("pointerdown", onPointerDown);
172
+ return () => {
173
+ dragTarget.removeEventListener("pointerdown", onPointerDown);
174
+ dragTarget.removeEventListener("pointermove", onPointerMove);
175
+ dragTarget.removeEventListener("pointerup", onPointerUp);
176
+ };
177
+ }
178
+ }
179
+ }, [containerElementRef, dragElementRef]);
180
+ return {
181
+ isDragging
182
+ };
183
+ }
184
+
185
+ // src/components/StatusBadge/StatusBadge.module.css
186
+ var compiledModule = `.mOWPxtXY-StatusBadgemodulecssfixedOverlay {
187
+ position: fixed;
188
+ pointer-events: none;
189
+ background: transparent;
190
+ top: 0;
191
+ bottom: 0;
192
+ left: 0;
193
+ right: 0;
194
+ z-index: 99999;
195
+ overflow: hidden;
196
+ }
197
+
198
+ .mOWPxtXY-StatusBadgemodulecssgripArea {
199
+ display: flex;
200
+ flex-direction: row;
201
+ gap: 2px;
202
+ height: 100%;
203
+ width: 12px;
204
+ cursor: move;
205
+ }
206
+
207
+ .mOWPxtXY-StatusBadgemodulecssgrip {
208
+ width: 2px;
209
+ height: 100%;
210
+ background: rgba(0, 0, 0, 0.2);
211
+ }
212
+
213
+ .mOWPxtXY-StatusBadgemodulecsscontentSurface {
214
+ pointer-events: auto;
215
+ display: contents;
216
+ }
217
+
218
+ .mOWPxtXY-StatusBadgemodulecssbadge {
219
+ cursor: default;
220
+ position: absolute;
221
+ bottom: 4px;
222
+ right: 4px;
223
+ font-size: 12px;
224
+ display: inline-flex;
225
+ gap: 4px;
226
+ background: #dddddd;
227
+ box-shadow: 0 0 12px -6px rgba(0, 0, 0, 0.75);
228
+ border: 1px solid #999999;
229
+ border-radius: 4px;
230
+ height: 28px;
231
+ flex-shrink: 0;
232
+ justify-content: center;
233
+ align-items: center;
234
+ box-sizing: border-box;
235
+ padding: 2px;
236
+
237
+ transition: background-color 0.2s ease-in-out;
238
+ }
239
+
240
+ .mOWPxtXY-StatusBadgemodulecssinline {
241
+ flex-shrink: 0;
242
+ position: relative;
243
+ bottom: auto;
244
+ right: auto;
245
+ top: auto;
246
+ left: auto;
247
+ box-shadow: none;
248
+ }
249
+
250
+ .mOWPxtXY-StatusBadgemodulecssbuilding {
251
+ background: #bbb;
252
+ color: #000;
253
+ }
254
+
255
+ .mOWPxtXY-StatusBadgemodulecsssuccess {
256
+ background: #7ad17a;
257
+ color: #000;
258
+ }
259
+
260
+ .mOWPxtXY-StatusBadgemodulecsswarning {
261
+ background: #e4e68b;
262
+ color: #000;
263
+ }
264
+
265
+ .mOWPxtXY-StatusBadgemodulecsserror {
266
+ background: #ffb9b9;
267
+ color: #000;
268
+ }
269
+
270
+ .mOWPxtXY-StatusBadgemodulecssbutton {
271
+ background: inherit;
272
+ border: none;
273
+ border-radius: 3px;
274
+ display: flex;
275
+ align-self: stretch;
276
+ align-items: center;
277
+ justify-content: center;
278
+ box-sizing: border-box;
279
+ padding: 0;
280
+ margin: 0;
281
+ font-weight: inherit;
282
+ font-size: inherit;
283
+ font-family: inherit;
284
+ }
285
+
286
+ .mOWPxtXY-StatusBadgemodulecssbutton:hover {
287
+ filter: invert(0.1);
288
+ }
289
+
290
+ .mOWPxtXY-StatusBadgemodulecssvalue {
291
+ font-weight: 600;
292
+ background: rgba(255, 255, 255, 0.4);
293
+ box-shadow: 2px 2px 3px -1px rgba(0, 0, 0, 0.15) inset;
294
+ padding: 2px 8px;
295
+ border-radius: 3px;
296
+ }
297
+ `;
298
+ var s = document.createElement("style");
299
+ s.setAttribute("data-sourceFile", "src/components/StatusBadge/StatusBadge.module.css");
300
+ s.appendChild(document.createTextNode(compiledModule));
301
+ document.head.appendChild(s);
302
+ var badge = "mOWPxtXY-StatusBadgemodulecssbadge";
303
+ var building = "mOWPxtXY-StatusBadgemodulecssbuilding";
304
+ var button = "mOWPxtXY-StatusBadgemodulecssbutton";
305
+ var contentSurface = "mOWPxtXY-StatusBadgemodulecsscontentSurface";
306
+ var error = "mOWPxtXY-StatusBadgemodulecsserror";
307
+ var fixedOverlay = "mOWPxtXY-StatusBadgemodulecssfixedOverlay";
308
+ var grip = "mOWPxtXY-StatusBadgemodulecssgrip";
309
+ var gripArea = "mOWPxtXY-StatusBadgemodulecssgripArea";
310
+ var inline = "mOWPxtXY-StatusBadgemodulecssinline";
311
+ var success = "mOWPxtXY-StatusBadgemodulecsssuccess";
312
+ var value = "mOWPxtXY-StatusBadgemodulecssvalue";
313
+ var warning = "mOWPxtXY-StatusBadgemodulecsswarning";
314
+ var StatusBadge_module_default = { badge, building, button, contentSurface, error, fixedOverlay, grip, gripArea, inline, success, value, warning };
315
+
316
+ // src/components/StatusBadge/StatusBadge.tsx
317
+ import { default as cx } from "classnames";
318
+
319
+ // src/components/CloudpackProvider/useStatus.ts
320
+ import { useEffect as useEffect2, useState as useState3 } from "react";
321
+ var defaultStatus = {
322
+ status: "unknown",
323
+ remainingTasks: 0,
324
+ totalTasks: 0,
325
+ totalErrors: 0,
326
+ totalWarnings: 0
327
+ };
328
+ var useStatus = () => {
329
+ const service = useCloudpack();
330
+ const [status, setStatus] = useState3(
331
+ () => service?.getValue(["status"]) || defaultStatus
332
+ );
333
+ useEffect2(() => service?.subscribe(["status"], setStatus), [service]);
334
+ return status;
335
+ };
336
+
337
+ // src/images/open-16-filled.inline.svg
338
+ var open_16_filled_inline_default = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNNC43NSAzLjVDNC4wNTk2NCAzLjUgMy41IDQuMDU5NjQgMy41IDQuNzVWMTEuMjVDMy41IDExLjk0MDQgNC4wNTk2NCAxMi41IDQuNzUgMTIuNUgxMS4yNUMxMS45NDA0IDEyLjUgMTIuNSAxMS45NDA0IDEyLjUgMTEuMjVWOS43NUMxMi41IDkuMzM1NzkgMTIuODM1OCA5IDEzLjI1IDlDMTMuNjY0MiA5IDE0IDkuMzM1NzkgMTQgOS43NVYxMS4yNUMxNCAxMi43Njg4IDEyLjc2ODggMTQgMTEuMjUgMTRINC43NUMzLjIzMTIyIDE0IDIgMTIuNzY4OCAyIDExLjI1VjQuNzVDMiAzLjIzMTIyIDMuMjMxMjIgMiA0Ljc1IDJINi4yNUM2LjY2NDIxIDIgNyAyLjMzNTc5IDcgMi43NUM3IDMuMTY0MjEgNi42NjQyMSAzLjUgNi4yNSAzLjVINC43NVpNNy45OTk3NiAyLjc1QzcuOTk5NzYgMi4zMzU3OSA4LjMzNTU0IDIgOC43NDk3NiAySDEzLjI0OThDMTMuNjY0IDIgMTMuOTk5OCAyLjMzNTc5IDEzLjk5OTggMi43NVY3LjI1QzEzLjk5OTggNy42NjQyMSAxMy42NjQgOCAxMy4yNDk4IDhDMTIuODM1NSA4IDEyLjQ5OTggNy42NjQyMSAxMi40OTk4IDcuMjVWNC41NjA5NUw5LjI4MDA4IDcuNzgwNTZDOC45ODcxOSA4LjA3MzQ1IDguNTEyMzEgOC4wNzM0NSA4LjIxOTQyIDcuNzgwNTVDNy45MjY1MyA3LjQ4NzY2IDcuOTI2NTMgNy4wMTI3OCA4LjIxOTQzIDYuNzE5ODlMMTEuNDM5NCAzLjVIOC43NDk3NkM4LjMzNTU0IDMuNSA3Ljk5OTc2IDMuMTY0MjEgNy45OTk3NiAyLjc1WiIgZmlsbD0iIzIxMjEyMSIvPgo8L3N2Zz4K";
339
+
340
+ // src/components/StatusBadge/StatusBadge.tsx
341
+ function StatusBadge({ inline: inline2, onExpand }) {
342
+ const rootElementRef = useRef(null);
343
+ const dragElementRef = useRef(null);
344
+ const status = useStatus();
345
+ useDraggable(rootElementRef, dragElementRef);
346
+ if (status.status === "unknown") {
347
+ return null;
348
+ }
349
+ const badge2 = /* @__PURE__ */ React2.createElement("div", {
350
+ ref: inline2 ? void 0 : rootElementRef,
351
+ className: getStatusClassName(status, !!inline2)
352
+ }, !inline2 && /* @__PURE__ */ React2.createElement("div", {
353
+ ref: inline2 ? void 0 : dragElementRef,
354
+ className: StatusBadge_module_default.gripArea
355
+ }, /* @__PURE__ */ React2.createElement("div", {
356
+ className: StatusBadge_module_default.grip
357
+ }), /* @__PURE__ */ React2.createElement("div", {
358
+ className: StatusBadge_module_default.grip
359
+ })), /* @__PURE__ */ React2.createElement("button", {
360
+ className: StatusBadge_module_default.button,
361
+ onClick: onExpand
362
+ }, /* @__PURE__ */ React2.createElement("div", {
363
+ className: StatusBadge_module_default.value
364
+ }, getStatusString(status))), /* @__PURE__ */ React2.createElement("div", null, getStatsString(status)), /* @__PURE__ */ React2.createElement("button", {
365
+ className: StatusBadge_module_default.button
366
+ }, /* @__PURE__ */ React2.createElement("img", {
367
+ src: open_16_filled_inline_default,
368
+ alt: ""
369
+ })));
370
+ return inline2 ? badge2 : /* @__PURE__ */ React2.createElement("div", {
371
+ className: StatusBadge_module_default.fixedOverlay
372
+ }, /* @__PURE__ */ React2.createElement("div", {
373
+ className: StatusBadge_module_default.contentSurface
374
+ }, badge2));
375
+ }
376
+ function getStatusString(status) {
377
+ if (status.status === "pending") {
378
+ return "Running";
379
+ }
380
+ if (status.totalTasks === 0) {
381
+ return "Idle";
382
+ }
383
+ return status.totalErrors === 0 ? "Success" : "Errors";
384
+ }
385
+ function getStatusClassName(status, inline2) {
386
+ return cx(StatusBadge_module_default.badge, {
387
+ [StatusBadge_module_default.inline]: inline2,
388
+ [StatusBadge_module_default.building]: status.status === "pending",
389
+ [StatusBadge_module_default.success]: status.status === "idle" && status.totalTasks > 0 && status.totalErrors === 0 && status.totalWarnings === 0,
390
+ [StatusBadge_module_default.error]: status.status === "idle" && status.totalErrors > 0,
391
+ [StatusBadge_module_default.warning]: status.status === "idle" && status.totalErrors === 0 && status.totalWarnings > 0
392
+ });
393
+ }
394
+ function getStatsString(status) {
395
+ if (status.totalTasks === 0) {
396
+ return "";
397
+ }
398
+ return [
399
+ status.remainingTasks > 0 && `${status.remainingTasks} of ${status.totalTasks} tasks pending`,
400
+ status.remainingTasks === 0 && `${status.totalTasks} tasks completed`,
401
+ status.totalErrors === 1 && `${status.totalErrors} error`,
402
+ status.totalErrors > 1 && `${status.totalErrors} errors`,
403
+ status.totalWarnings === 1 && `${status.totalWarnings} warning`,
404
+ status.totalWarnings > 1 && `${status.totalWarnings} warnings`
405
+ ].filter(Boolean).join(", ");
406
+ }
407
+
408
+ // src/components/StatusDialog/StatusDialog.tsx
409
+ import React8 from "react";
410
+
411
+ // src/components/StatusDialog/TaskList.tsx
412
+ import React5 from "react";
413
+
414
+ // src/components/StatusDialog/TaskStatus.tsx
415
+ import React4 from "react";
416
+
417
+ // src/components/StatusDialog/TaskResultItem.tsx
418
+ import React3 from "react";
419
+
420
+ // src/components/StatusDialog/TaskResultItem.module.css
421
+ var compiledModule2 = `.mGnoEIJOyo-TaskResultItemmodulecssroot {
422
+ display: flex;
423
+ background: #f5f5f5;
424
+ }
425
+
426
+ .mGnoEIJOyo-TaskResultItemmodulecssstatusBar {
427
+ flex-shrink: 0;
428
+ border-radius: 4px;
429
+ width: 4px;
430
+ background: #aa0000;
431
+ box-shadow: 2px 0 4px 0 rgb(220 0 0 / 20%);
432
+ }
433
+
434
+ .mGnoEIJOyo-TaskResultItemmodulecsscontent {
435
+ padding: 8px;
436
+ display: flex;
437
+ flex-grow: 1;
438
+ overflow: hidden;
439
+ flex-direction: column;
440
+ }
441
+
442
+ .mGnoEIJOyo-TaskResultItemmodulecsstitleArea {
443
+ display: flex;
444
+ align-items: center;
445
+ flex-direction: row;
446
+ gap: 4px;
447
+ padding: 4px 0;
448
+ }
449
+
450
+ .mGnoEIJOyo-TaskResultItemmodulecssfile {
451
+ display: inline-flex;
452
+ margin: 0;
453
+ padding: 0;
454
+ border: none;
455
+ background: inherit;
456
+ font-family: inherit;
457
+ flex-grow: 1;
458
+ font-weight: 500;
459
+ font-size: 14px;
460
+ flex-shrink: 0;
461
+ text-decoration: none;
462
+ color: #000;
463
+ cursor: pointer;
464
+ }
465
+
466
+ .mGnoEIJOyo-TaskResultItemmodulecssfile:hover {
467
+ text-decoration: underline;
468
+ }
469
+
470
+ .mGnoEIJOyo-TaskResultItemmodulecssactionArea {
471
+ display: flex;
472
+ flex-direction: row;
473
+ gap: 8px;
474
+ flex-shrink: 0;
475
+ }
476
+
477
+ .mGnoEIJOyo-TaskResultItemmodulecsstext {
478
+ word-wrap: break-word;
479
+ color: #333;
480
+ }
481
+ `;
482
+ var s2 = document.createElement("style");
483
+ s2.setAttribute("data-sourceFile", "src/components/StatusDialog/TaskResultItem.module.css");
484
+ s2.appendChild(document.createTextNode(compiledModule2));
485
+ document.head.appendChild(s2);
486
+ var actionArea = "mGnoEIJOyo-TaskResultItemmodulecssactionArea";
487
+ var content = "mGnoEIJOyo-TaskResultItemmodulecsscontent";
488
+ var file = "mGnoEIJOyo-TaskResultItemmodulecssfile";
489
+ var root = "mGnoEIJOyo-TaskResultItemmodulecssroot";
490
+ var statusBar = "mGnoEIJOyo-TaskResultItemmodulecssstatusBar";
491
+ var text = "mGnoEIJOyo-TaskResultItemmodulecsstext";
492
+ var titleArea = "mGnoEIJOyo-TaskResultItemmodulecsstitleArea";
493
+ var TaskResultItem_module_default = { actionArea, content, file, root, statusBar, text, titleArea };
494
+
495
+ // src/components/StatusDialog/TaskResultItem.tsx
496
+ function TaskResultItem({ item, projectPath, index }) {
497
+ const service = useCloudpack();
498
+ const openSource = (ev) => {
499
+ if (item.location) {
500
+ service.openSource({
501
+ rootPath: projectPath,
502
+ relativePath: item.location?.file,
503
+ line: item.location?.line,
504
+ column: item.location?.column
505
+ });
506
+ ev.preventDefault();
507
+ }
508
+ };
509
+ const filename = item.location?.file || "(path unavailable)";
510
+ const location = ["", item.location?.line, item.location?.column].filter(Boolean).join(":");
511
+ return /* @__PURE__ */ React3.createElement("div", {
512
+ className: TaskResultItem_module_default.root
513
+ }, /* @__PURE__ */ React3.createElement("div", {
514
+ className: TaskResultItem_module_default.statusBar
515
+ }), /* @__PURE__ */ React3.createElement("div", {
516
+ className: TaskResultItem_module_default.content
517
+ }, /* @__PURE__ */ React3.createElement("div", {
518
+ className: TaskResultItem_module_default.titleArea
519
+ }, /* @__PURE__ */ React3.createElement("button", {
520
+ onClick: openSource,
521
+ className: TaskResultItem_module_default.file
522
+ }, index, ". ", filename, location && ` (${location})`, ":")), /* @__PURE__ */ React3.createElement("div", {
523
+ className: TaskResultItem_module_default.text
524
+ }, item.text), /* @__PURE__ */ React3.createElement("pre", {
525
+ className: TaskResultItem_module_default.text
526
+ }, JSON.stringify(item, null, 2))));
527
+ }
528
+
529
+ // src/components/StatusDialog/TaskStatus.module.css
530
+ var compiledModule3 = `.vweafQQjU-TaskStatusmodulecssroot {
531
+ border: 1px solid #ccc;
532
+ border-radius: 3px;
533
+ box-shadow: 0 0 12px -6px rgba(0, 0, 0, 0.25);
534
+ }
535
+
536
+ .vweafQQjU-TaskStatusmodulecssheader {
537
+ display: flex;
538
+ gap: 8px;
539
+ padding: 8px 16px;
540
+ background: #f0f0f0;
541
+ align-items: center;
542
+ line-height: 1;
543
+ }
544
+
545
+ .vweafQQjU-TaskStatusmodulecssexpandButton {
546
+ background: transparent;
547
+ border: none;
548
+ border-radius: 4px;
549
+ width: 32px;
550
+ height: 32px;
551
+ }
552
+ .vweafQQjU-TaskStatusmodulecssexpandButton:hover {
553
+ background: rgba(0, 0, 0, 0.1);
554
+ }
555
+
556
+ .vweafQQjU-TaskStatusmodulecssexpandButton:active {
557
+ background: rgba(0, 0, 0, 0.2);
558
+ }
559
+
560
+ .vweafQQjU-TaskStatusmodulecssexpandIcon {
561
+ transition: transform 0.1s ease-in-out;
562
+ }
563
+
564
+ .vweafQQjU-TaskStatusmodulecsscollapsed {
565
+ transform: rotate(-90deg);
566
+ }
567
+
568
+ .vweafQQjU-TaskStatusmodulecssfarArea {
569
+ line-height: 1;
570
+ font-size: 13px;
571
+ text-align: end;
572
+ display: flex;
573
+ align-items: baseline;
574
+ flex-direction: row;
575
+ gap: 8px;
576
+ display: flex;
577
+ flex-grow: 1;
578
+ justify-content: end;
579
+ flex-direction: row;
580
+ }
581
+
582
+ .vweafQQjU-TaskStatusmodulecsstitle {
583
+ font-size: 16px;
584
+ font-weight: 500;
585
+ color: #333;
586
+ }
587
+
588
+ .vweafQQjU-TaskStatusmodulecsssubTitle {
589
+ font-size: 13px;
590
+ }
591
+
592
+ .vweafQQjU-TaskStatusmodulecsscontent {
593
+ border-top: 1px solid #ccc;
594
+ background: #fafafa;
595
+ padding: 8px 16px;
596
+ display: flex;
597
+ flex-direction: column;
598
+ gap: 8px;
599
+ }
600
+
601
+ .vweafQQjU-TaskStatusmodulecssresultItems {
602
+ display: flex;
603
+ flex-direction: column;
604
+ gap: 8px;
605
+ }
606
+
607
+ .vweafQQjU-TaskStatusmodulecsserror {
608
+ background: #ffe9e9;
609
+ }
610
+
611
+ .vweafQQjU-TaskStatusmodulecsssuccess {
612
+ background: #e9f9e9;
613
+ }
614
+
615
+ .vweafQQjU-TaskStatusmodulecsswarning {
616
+ background: #fff9e9;
617
+ }
618
+
619
+ .vweafQQjU-TaskStatusmodulecssname {
620
+ font-size: 12px;
621
+ font-weight: 600;
622
+ text-transform: uppercase;
623
+ }
624
+
625
+ .vweafQQjU-TaskStatusmodulecssvalue {
626
+ display: flex;
627
+ flex-direction: column;
628
+ font-size: 14px;
629
+ color: #333;
630
+ }
631
+
632
+ .vweafQQjU-TaskStatusmodulecsslinkButton {
633
+ display: inline-flex;
634
+ align-items: flex-start;
635
+ text-align: start;
636
+ margin: 0;
637
+ padding: 0;
638
+ border: none;
639
+ background: inherit;
640
+ font-family: inherit;
641
+ flex-grow: 1;
642
+
643
+ font-size: 14px;
644
+ flex-shrink: 0;
645
+ text-decoration: none;
646
+ color: #000;
647
+ cursor: pointer;
648
+ }
649
+
650
+ .vweafQQjU-TaskStatusmodulecsslinkButton:hover {
651
+ text-decoration: underline;
652
+ }
653
+ `;
654
+ var s3 = document.createElement("style");
655
+ s3.setAttribute("data-sourceFile", "src/components/StatusDialog/TaskStatus.module.css");
656
+ s3.appendChild(document.createTextNode(compiledModule3));
657
+ document.head.appendChild(s3);
658
+ var collapsed = "vweafQQjU-TaskStatusmodulecsscollapsed";
659
+ var content2 = "vweafQQjU-TaskStatusmodulecsscontent";
660
+ var error2 = "vweafQQjU-TaskStatusmodulecsserror";
661
+ var expandButton = "vweafQQjU-TaskStatusmodulecssexpandButton";
662
+ var expandIcon = "vweafQQjU-TaskStatusmodulecssexpandIcon";
663
+ var farArea = "vweafQQjU-TaskStatusmodulecssfarArea";
664
+ var header = "vweafQQjU-TaskStatusmodulecssheader";
665
+ var linkButton = "vweafQQjU-TaskStatusmodulecsslinkButton";
666
+ var name = "vweafQQjU-TaskStatusmodulecssname";
667
+ var resultItems = "vweafQQjU-TaskStatusmodulecssresultItems";
668
+ var root2 = "vweafQQjU-TaskStatusmodulecssroot";
669
+ var subTitle = "vweafQQjU-TaskStatusmodulecsssubTitle";
670
+ var success2 = "vweafQQjU-TaskStatusmodulecsssuccess";
671
+ var title = "vweafQQjU-TaskStatusmodulecsstitle";
672
+ var value2 = "vweafQQjU-TaskStatusmodulecssvalue";
673
+ var warning2 = "vweafQQjU-TaskStatusmodulecsswarning";
674
+ var TaskStatus_module_default = { collapsed, content: content2, error: error2, expandButton, expandIcon, farArea, header, linkButton, name, resultItems, root: root2, subTitle, success: success2, title, value: value2, warning: warning2 };
675
+
676
+ // src/components/StatusDialog/TaskStatus.tsx
677
+ import { default as cx2 } from "classnames";
678
+
679
+ // src/images/error-24.inline.svg
680
+ var error_24_inline_default = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEyIDJDMTcuNTIyOCAyIDIyIDYuNDc3MTUgMjIgMTJDMjIgMTcuNTIyOCAxNy41MjI4IDIyIDEyIDIyQzYuNDc3MTUgMjIgMiAxNy41MjI4IDIgMTJDMiA2LjQ3NzE1IDYuNDc3MTUgMiAxMiAyWk0xNS41MzAzIDguNDY5NjdMMTUuNDQ2MiA4LjM5NzA1QzE1LjE4NTIgOC4yMDM0IDE0LjgyNyA4LjIwMTAxIDE0LjU2MzYgOC4zODk4OEwxNC40Njk3IDguNDY5NjdMMTIgMTAuOTM5TDkuNTMwMzMgOC40Njk2N0w5LjQ0NjIxIDguMzk3MDVDOS4xODUyMiA4LjIwMzQgOC44MjcwMSA4LjIwMTAxIDguNTYzNjIgOC4zODk4OEw4LjQ2OTY3IDguNDY5NjdMOC4zOTcwNSA4LjU1Mzc5QzguMjAzNCA4LjgxNDc4IDguMjAxMDEgOS4xNzI5OSA4LjM4OTg4IDkuNDM2MzhMOC40Njk2NyA5LjUzMDMzTDEwLjkzOSAxMkw4LjQ2OTY3IDE0LjQ2OTdMOC4zOTcwNSAxNC41NTM4QzguMjAzNCAxNC44MTQ4IDguMjAxMDEgMTUuMTczIDguMzg5ODggMTUuNDM2NEw4LjQ2OTY3IDE1LjUzMDNMOC41NTM3OSAxNS42MDI5QzguODE0NzggMTUuNzk2NiA5LjE3Mjk5IDE1Ljc5OSA5LjQzNjM4IDE1LjYxMDFMOS41MzAzMyAxNS41MzAzTDEyIDEzLjA2MUwxNC40Njk3IDE1LjUzMDNMMTQuNTUzOCAxNS42MDI5QzE0LjgxNDggMTUuNzk2NiAxNS4xNzMgMTUuNzk5IDE1LjQzNjQgMTUuNjEwMUwxNS41MzAzIDE1LjUzMDNMMTUuNjAyOSAxNS40NDYyQzE1Ljc5NjYgMTUuMTg1MiAxNS43OTkgMTQuODI3IDE1LjYxMDEgMTQuNTYzNkwxNS41MzAzIDE0LjQ2OTdMMTMuMDYxIDEyTDE1LjUzMDMgOS41MzAzM0wxNS42MDI5IDkuNDQ2MjFDMTUuNzk2NiA5LjE4NTIyIDE1Ljc5OSA4LjgyNzAxIDE1LjYxMDEgOC41NjM2MkwxNS41MzAzIDguNDY5NjdMMTUuNDQ2MiA4LjM5NzA1TDE1LjUzMDMgOC40Njk2N1oiIGZpbGw9IiNhYTAwMDAiLz4KPC9zdmc+Cg==";
681
+
682
+ // src/images/success-24.inline.svg
683
+ var success_24_inline_default = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEyIDJDMTcuNTIyOCAyIDIyIDYuNDc3MTUgMjIgMTJDMjIgMTcuNTIyOCAxNy41MjI4IDIyIDEyIDIyQzYuNDc3MTUgMjIgMiAxNy41MjI4IDIgMTJDMiA2LjQ3NzE1IDYuNDc3MTUgMiAxMiAyWk0xNS4yMTk3IDguOTY5NjdMMTAuNzUgMTMuNDM5M0w4Ljc4MDMzIDExLjQ2OTdDOC40ODc0NCAxMS4xNzY4IDguMDEyNTYgMTEuMTc2OCA3LjcxOTY3IDExLjQ2OTdDNy40MjY3OCAxMS43NjI2IDcuNDI2NzggMTIuMjM3NCA3LjcxOTY3IDEyLjUzMDNMMTAuMjE5NyAxNS4wMzAzQzEwLjUxMjYgMTUuMzIzMiAxMC45ODc0IDE1LjMyMzIgMTEuMjgwMyAxNS4wMzAzTDE2LjI4MDMgMTAuMDMwM0MxNi41NzMyIDkuNzM3NDQgMTYuNTczMiA5LjI2MjU2IDE2LjI4MDMgOC45Njk2N0MxNS45ODc0IDguNjc2NzggMTUuNTEyNiA4LjY3Njc4IDE1LjIxOTcgOC45Njk2N1oiIGZpbGw9IiMwMGFhMDAiLz4KPC9zdmc+Cg==";
684
+
685
+ // src/images/chevrondown-20.inline.svg
686
+ var chevrondown_20_inline_default = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTE1Ljc5NCA3LjczMjcxQzE2LjA3OTcgOC4wMzI2MyAxNi4wNjgxIDguNTA3MzcgMTUuNzY4MiA4Ljc5MzA2TDEwLjUxNzggMTMuNzk0NEMxMC4yMjgxIDE0LjA3MDMgOS43NzI4NSAxNC4wNzAzIDkuNDgzMTggMTMuNzk0NEw0LjIzMjcxIDguNzkzMDZDMy45MzI3OSA4LjUwNzM3IDMuOTIxMjUgOC4wMzI2MyA0LjIwNjk0IDcuNzMyNzFDNC40OTI2NCA3LjQzMjc5IDQuOTY3MzcgNy40MjEyNSA1LjI2NzI5IDcuNzA2OTRMMTAuMDAwNSAxMi4yMTU1TDE0LjczMzYgNy43MDY5NEMxNS4wMzM2IDcuNDIxMjUgMTUuNTA4MyA3LjQzMjc5IDE1Ljc5NCA3LjczMjcxWiIgZmlsbD0iIzIxMjEyMSIvPgo8L3N2Zz4K";
687
+
688
+ // src/components/StatusDialog/TaskStatus.tsx
689
+ function getCompletion(task) {
690
+ if (task.status === "pending") {
691
+ return "Running";
692
+ }
693
+ return [
694
+ `Completed in ${task.durationMilliseconds}ms`,
695
+ task.errors?.length && `${task.errors.length} error${task.errors.length > 1 ? "s" : ""}`,
696
+ task.warnings?.length && `${task.warnings.length} warning${task.warnings.length > 1 ? "s" : ""}`
697
+ ].filter(Boolean).join(", ");
698
+ }
699
+ function TaskStatus({ task }) {
700
+ const [isOpen, setIsOpen] = React4.useState(void 0);
701
+ const { name: name2, warnings, errors } = task;
702
+ const cloudpack = useCloudpack();
703
+ const showContent = isOpen === true || isOpen === void 0 && task.errors?.length > 0;
704
+ const open = (rootPath) => {
705
+ cloudpack.open({
706
+ rootPath
707
+ });
708
+ };
709
+ const openPackage = () => {
710
+ cloudpack.openSource({
711
+ rootPath: task.inputPath,
712
+ relativePath: "package.json",
713
+ line: 0,
714
+ column: 0
715
+ });
716
+ };
717
+ return /* @__PURE__ */ React4.createElement("div", {
718
+ className: TaskStatus_module_default.root
719
+ }, /* @__PURE__ */ React4.createElement("div", {
720
+ className: getHeaderClassName(task)
721
+ }, /* @__PURE__ */ React4.createElement("button", {
722
+ className: TaskStatus_module_default.expandButton,
723
+ onClick: () => setIsOpen(!showContent)
724
+ }, /* @__PURE__ */ React4.createElement("img", {
725
+ className: cx2(TaskStatus_module_default.expandIcon, !showContent && TaskStatus_module_default.collapsed),
726
+ src: chevrondown_20_inline_default,
727
+ alt: ""
728
+ })), errors?.length === 0 && warnings?.length === 0 && /* @__PURE__ */ React4.createElement("img", {
729
+ className: TaskStatus_module_default.errorIcon,
730
+ src: success_24_inline_default,
731
+ alt: ""
732
+ }), errors?.length > 0 && /* @__PURE__ */ React4.createElement("img", {
733
+ className: TaskStatus_module_default.errorIcon,
734
+ src: error_24_inline_default,
735
+ alt: ""
736
+ }), /* @__PURE__ */ React4.createElement("div", {
737
+ className: TaskStatus_module_default.title
738
+ }, name2), /* @__PURE__ */ React4.createElement("div", {
739
+ className: TaskStatus_module_default.farArea
740
+ }, getCompletion(task))), showContent && /* @__PURE__ */ React4.createElement("div", {
741
+ className: TaskStatus_module_default.content
742
+ }, /* @__PURE__ */ React4.createElement("div", {
743
+ className: TaskStatus_module_default.title
744
+ }, "Details"), /* @__PURE__ */ React4.createElement("div", {
745
+ className: TaskStatus_module_default.nameValueArea
746
+ }, /* @__PURE__ */ React4.createElement("div", {
747
+ className: TaskStatus_module_default.name
748
+ }, "Input path"), /* @__PURE__ */ React4.createElement("div", {
749
+ className: TaskStatus_module_default.value
750
+ }, /* @__PURE__ */ React4.createElement("button", {
751
+ className: TaskStatus_module_default.linkButton,
752
+ onClick: () => open(task.inputPath)
753
+ }, task.inputPath), /* @__PURE__ */ React4.createElement("button", {
754
+ className: TaskStatus_module_default.linkButton,
755
+ onClick: openPackage
756
+ }, "(Package.json)"))), /* @__PURE__ */ React4.createElement("div", {
757
+ className: TaskStatus_module_default.nameValueArea
758
+ }, /* @__PURE__ */ React4.createElement("div", {
759
+ className: TaskStatus_module_default.name
760
+ }, "Output path"), /* @__PURE__ */ React4.createElement("button", {
761
+ className: TaskStatus_module_default.linkButton,
762
+ onClick: () => open(task.outputPath)
763
+ }, task.outputPath)), errors?.length > 0 && /* @__PURE__ */ React4.createElement(React4.Fragment, null, /* @__PURE__ */ React4.createElement("div", {
764
+ className: TaskStatus_module_default.title
765
+ }, "Errors"), /* @__PURE__ */ React4.createElement("div", {
766
+ className: TaskStatus_module_default.resultItems
767
+ }, errors.map((error3, index) => /* @__PURE__ */ React4.createElement(TaskResultItem, {
768
+ key: index,
769
+ item: error3,
770
+ projectPath: task.inputPath,
771
+ index: index + 1
772
+ })))), warnings?.length > 0 && /* @__PURE__ */ React4.createElement(React4.Fragment, null, /* @__PURE__ */ React4.createElement("div", {
773
+ className: TaskStatus_module_default.title
774
+ }, "Warnings"), /* @__PURE__ */ React4.createElement("div", {
775
+ className: TaskStatus_module_default.resultItems
776
+ }, warnings.map((warning3, index) => /* @__PURE__ */ React4.createElement(TaskResultItem, {
777
+ key: index,
778
+ item: warning3,
779
+ projectPath: task.inputPath,
780
+ index: index + 1
781
+ }))))));
782
+ }
783
+ function getHeaderClassName(task) {
784
+ return cx2(TaskStatus_module_default.header, {
785
+ [TaskStatus_module_default.success]: task.errors?.length === 0 && task.warnings?.length === 0,
786
+ [TaskStatus_module_default.warning]: task.errors?.length === 0 && task.warnings?.length > 0,
787
+ [TaskStatus_module_default.error]: task.errors?.length > 0
788
+ });
789
+ }
790
+
791
+ // src/components/CloudpackProvider/useStatusDetails.ts
792
+ import { useEffect as useEffect3, useState as useState4 } from "react";
793
+ var useStatusDetails = () => {
794
+ const service = useCloudpack();
795
+ const [details, setDetails] = useState4({ tasks: [] });
796
+ useEffect3(() => service?.subscribe(["status-details"], setDetails), [service]);
797
+ return details;
798
+ };
799
+
800
+ // src/components/StatusDialog/TaskList.module.css
801
+ var compiledModule4 = `.lTlVbGXBQHs-TaskListmodulecssroot {
802
+ flex-grow: 1;
803
+ overflow: auto;
804
+ border-top: 1px solid #ccc;
805
+ box-sizing: border-box;
806
+ padding: 20px;
807
+ display: flex;
808
+ flex-direction: column;
809
+ gap: 8px;
810
+ }
811
+ `;
812
+ var s4 = document.createElement("style");
813
+ s4.setAttribute("data-sourceFile", "src/components/StatusDialog/TaskList.module.css");
814
+ s4.appendChild(document.createTextNode(compiledModule4));
815
+ document.head.appendChild(s4);
816
+ var root3 = "lTlVbGXBQHs-TaskListmodulecssroot";
817
+ var TaskList_module_default = { root: root3 };
818
+
819
+ // src/components/StatusDialog/TaskList.tsx
820
+ function TaskList() {
821
+ const details = useStatusDetails();
822
+ const tasks = (details.tasks || []).sort(sortTasks);
823
+ return /* @__PURE__ */ React5.createElement("div", {
824
+ className: TaskList_module_default.root
825
+ }, tasks.map((task, index) => /* @__PURE__ */ React5.createElement(TaskStatus, {
826
+ key: index,
827
+ task
828
+ })));
829
+ }
830
+ function sortTasks(a, b) {
831
+ const aStatus = a.status === "pending" ? 1 : 0;
832
+ const bStatus = b.status === "pending" ? 1 : 0;
833
+ if (aStatus !== bStatus) {
834
+ return aStatus > bStatus ? -1 : 1;
835
+ }
836
+ const aErrors = a.errors?.length || 0;
837
+ const bErrors = b.errors?.length || 0;
838
+ if (aErrors !== bErrors) {
839
+ return aErrors > bErrors ? -1 : 1;
840
+ }
841
+ return a.name < b.name ? -1 : 1;
842
+ }
843
+
844
+ // src/components/Button/Button.tsx
845
+ import React6 from "react";
846
+
847
+ // src/components/Button/Button.module.css
848
+ var compiledModule5 = `.CCnBgacfaMc-ButtonmodulecssstandardButton {
849
+ outline: transparent;
850
+ position: relative;
851
+ font-family: inherit;
852
+ font-size: 14px;
853
+ font-weight: 600;
854
+ box-sizing: border-box;
855
+ border: 1px solid rgb(138, 136, 134);
856
+ display: inline-block;
857
+ text-decoration: none;
858
+ text-align: center;
859
+ cursor: pointer;
860
+ padding: 0px 16px;
861
+ border-radius: 2px;
862
+ min-width: 80px;
863
+ height: 32px;
864
+ background-color: rgb(255, 255, 255);
865
+ color: rgb(50, 49, 48);
866
+ user-select: none;
867
+ }
868
+
869
+ .CCnBgacfaMc-ButtonmodulecssstandardButton:active {
870
+ background-color: rgb(237, 235, 233);
871
+ color: rgb(32, 31, 30);
872
+ }
873
+
874
+ .CCnBgacfaMc-ButtonmodulecssstandardButton:hover {
875
+ background-color: rgb(243, 242, 241);
876
+ color: rgb(32, 31, 30);
877
+ }
878
+
879
+ .CCnBgacfaMc-ButtonmodulecssprimaryButton {
880
+ outline: transparent;
881
+ position: relative;
882
+ font-family: inherit;
883
+ font-size: 14px;
884
+ font-weight: 600;
885
+ box-sizing: border-box;
886
+ border: 1px solid rgb(0, 120, 212);
887
+ display: inline-block;
888
+ text-decoration: none;
889
+ text-align: center;
890
+ cursor: pointer;
891
+ padding: 0px 16px;
892
+ border-radius: 2px;
893
+ min-width: 80px;
894
+ height: 32px;
895
+ background-color: rgb(0, 120, 212);
896
+ color: rgb(255, 255, 255);
897
+ user-select: none;
898
+ }
899
+
900
+ .CCnBgacfaMc-ButtonmodulecssprimaryButton:active {
901
+ background-color: rgb(0, 90, 158);
902
+ border: 1px solid rgb(0, 90, 158);
903
+ color: rgb(255, 255, 255);
904
+ }
905
+
906
+ .CCnBgacfaMc-ButtonmodulecssprimaryButton:hover {
907
+ background-color: rgb(16, 110, 190);
908
+ border: 1px solid rgb(16, 110, 190);
909
+ color: rgb(255, 255, 255);
910
+ }
911
+ `;
912
+ var s5 = document.createElement("style");
913
+ s5.setAttribute("data-sourceFile", "src/components/Button/Button.module.css");
914
+ s5.appendChild(document.createTextNode(compiledModule5));
915
+ document.head.appendChild(s5);
916
+ var primaryButton = "CCnBgacfaMc-ButtonmodulecssprimaryButton";
917
+ var standardButton = "CCnBgacfaMc-ButtonmodulecssstandardButton";
918
+ var Button_module_default = { primaryButton, standardButton };
919
+
920
+ // src/components/Button/Button.tsx
921
+ function Button(props) {
922
+ const { primary, ...other } = props;
923
+ const className = primary ? Button_module_default.primaryButton : Button_module_default.standardButton;
924
+ return /* @__PURE__ */ React6.createElement("button", {
925
+ ...other,
926
+ className,
927
+ type: "button"
928
+ });
929
+ }
930
+
931
+ // src/components/Dialog/Dialog.tsx
932
+ import { default as React7, useRef as useRef2 } from "react";
933
+
934
+ // src/components/Dialog/Dialog.module.css
935
+ var compiledModule6 = `.ggUoTSSSfk-Dialogmodulecssoverlay {
936
+ background: rgba(0, 0, 0, 0.1);
937
+ border: 1px solid black;
938
+ position: fixed;
939
+ top: 0;
940
+ left: 0;
941
+ right: 0;
942
+ bottom: 0;
943
+ display: flex;
944
+ align-items: center;
945
+ justify-content: center;
946
+ z-index: 999;
947
+ }
948
+
949
+ @keyframes fade-in {
950
+ 0% {
951
+ opacity: 0;
952
+ }
953
+ 100% {
954
+ opacity: 1;
955
+ }
956
+ }
957
+
958
+ .ggUoTSSSfk-Dialogmodulecsscommands {
959
+ display: flex;
960
+ flex-direction: row;
961
+ gap: 8px;
962
+ align-items: center;
963
+ flex-shrink: 0;
964
+ height: 40px;
965
+ padding: 0 20px;
966
+ }
967
+
968
+ .ggUoTSSSfk-Dialogmodulecssdialog {
969
+ animation: fade-in 0.1s ease-in-out;
970
+ width: 80vw;
971
+ align-self: stretch;
972
+ margin: 20px 0;
973
+ background: white;
974
+ color: #000;
975
+ box-sizing: border-box;
976
+ display: flex;
977
+ flex-direction: column;
978
+ border-top: 4px solid rgb(0, 120, 212);
979
+ border-radius: 3px;
980
+ box-shadow: rgb(0 0 0 / 22%) 0px 25.6px 57.6px 0px, rgb(0 0 0 / 18%) 0px 4.8px 14.4px 0px;
981
+ position: relative;
982
+ outline: transparent solid 3px;
983
+ }
984
+
985
+ .ggUoTSSSfk-DialogmodulecsstitleArea {
986
+ display: flex;
987
+ flex-direction: row;
988
+ align-items: center;
989
+ padding: 8px 8px 8px 20px;
990
+ gap: 8px;
991
+ }
992
+
993
+ .ggUoTSSSfk-DialogmodulecsscloseButton {
994
+ display: flex;
995
+ align-items: center;
996
+ justify-content: center;
997
+ width: 32px;
998
+ height: 32px;
999
+ margin: 0;
1000
+ padding: 0;
1001
+ background: transparent;
1002
+ border: none;
1003
+ border-radius: 4px;
1004
+ }
1005
+
1006
+ .ggUoTSSSfk-DialogmodulecsscloseButton:hover {
1007
+ background: rgba(0, 0, 0, 0.1);
1008
+ }
1009
+
1010
+ .ggUoTSSSfk-DialogmodulecsscloseButton:active {
1011
+ background: rgba(0, 0, 0, 0.2);
1012
+ }
1013
+
1014
+ .ggUoTSSSfk-Dialogmodulecsstitle {
1015
+ flex-grow: 1;
1016
+ font-size: 20px;
1017
+ font-weight: 600;
1018
+ color: rgb(0, 120, 212);
1019
+ }
1020
+ `;
1021
+ var s6 = document.createElement("style");
1022
+ s6.setAttribute("data-sourceFile", "src/components/Dialog/Dialog.module.css");
1023
+ s6.appendChild(document.createTextNode(compiledModule6));
1024
+ document.head.appendChild(s6);
1025
+ var closeButton = "ggUoTSSSfk-DialogmodulecsscloseButton";
1026
+ var commands = "ggUoTSSSfk-Dialogmodulecsscommands";
1027
+ var dialog = "ggUoTSSSfk-Dialogmodulecssdialog";
1028
+ var overlay = "ggUoTSSSfk-Dialogmodulecssoverlay";
1029
+ var title2 = "ggUoTSSSfk-Dialogmodulecsstitle";
1030
+ var titleArea2 = "ggUoTSSSfk-DialogmodulecsstitleArea";
1031
+ var Dialog_module_default = { closeButton, commands, dialog, overlay, title: title2, titleArea: titleArea2 };
1032
+
1033
+ // src/images/dismiss-16-filled.inline.svg
1034
+ var dismiss_16_filled_inline_default = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTIuMzk3MDUgMi41NTM3OUwyLjQ2OTY3IDIuNDY5NjdDMi43MzU5NCAyLjIwMzQgMy4xNTI2IDIuMTc5MiAzLjQ0NjIxIDIuMzk3MDVMMy41MzAzMyAyLjQ2OTY3TDggNi45MzlMMTIuNDY5NyAyLjQ2OTY3QzEyLjc2MjYgMi4xNzY3OCAxMy4yMzc0IDIuMTc2NzggMTMuNTMwMyAyLjQ2OTY3QzEzLjgyMzIgMi43NjI1NiAxMy44MjMyIDMuMjM3NDQgMTMuNTMwMyAzLjUzMDMzTDkuMDYxIDhMMTMuNTMwMyAxMi40Njk3QzEzLjc5NjYgMTIuNzM1OSAxMy44MjA4IDEzLjE1MjYgMTMuNjAyOSAxMy40NDYyTDEzLjUzMDMgMTMuNTMwM0MxMy4yNjQxIDEzLjc5NjYgMTIuODQ3NCAxMy44MjA4IDEyLjU1MzggMTMuNjAyOUwxMi40Njk3IDEzLjUzMDNMOCA5LjA2MUwzLjUzMDMzIDEzLjUzMDNDMy4yMzc0NCAxMy44MjMyIDIuNzYyNTYgMTMuODIzMiAyLjQ2OTY3IDEzLjUzMDNDMi4xNzY3OCAxMy4yMzc0IDIuMTc2NzggMTIuNzYyNiAyLjQ2OTY3IDEyLjQ2OTdMNi45MzkgOEwyLjQ2OTY3IDMuNTMwMzNDMi4yMDM0IDMuMjY0MDYgMi4xNzkyIDIuODQ3NCAyLjM5NzA1IDIuNTUzNzlMMi40Njk2NyAyLjQ2OTY3TDIuMzk3MDUgMi41NTM3OVoiIGZpbGw9IiMyMTIxMjEiLz4KPC9zdmc+Cg==";
1035
+
1036
+ // src/components/Dialog/Dialog.tsx
1037
+ function Dialog({ title: title3, style, draggable, onClose, commands: commands2, children }) {
1038
+ const draggableRef = useRef2(null);
1039
+ const draggableTargetRef = useRef2(null);
1040
+ const colorAccent = style === "error" ? "rgb(164, 38, 44)" : void 0;
1041
+ const cursorDraggable = draggable ? "move" : void 0;
1042
+ useDraggable(draggable ? draggableRef : void 0, draggable ? draggableTargetRef : void 0);
1043
+ return /* @__PURE__ */ React7.createElement("div", {
1044
+ className: Dialog_module_default.overlay
1045
+ }, /* @__PURE__ */ React7.createElement("div", {
1046
+ ref: draggableRef,
1047
+ className: Dialog_module_default.dialog,
1048
+ style: { borderTopColor: colorAccent }
1049
+ }, /* @__PURE__ */ React7.createElement("div", {
1050
+ className: Dialog_module_default.titleArea
1051
+ }, /* @__PURE__ */ React7.createElement("div", {
1052
+ ref: draggableTargetRef,
1053
+ className: Dialog_module_default.title,
1054
+ style: { color: colorAccent, cursor: cursorDraggable }
1055
+ }, title3), !!onClose && /* @__PURE__ */ React7.createElement("button", {
1056
+ className: Dialog_module_default.closeButton,
1057
+ onClick: onClose
1058
+ }, /* @__PURE__ */ React7.createElement("img", {
1059
+ src: dismiss_16_filled_inline_default,
1060
+ alt: ""
1061
+ }))), !!commands2 && /* @__PURE__ */ React7.createElement("div", {
1062
+ className: Dialog_module_default.commands
1063
+ }, commands2), children));
1064
+ }
1065
+
1066
+ // src/components/StatusDialog/StatusDialog.tsx
1067
+ function StatusDialog({ onClose }) {
1068
+ const cloudpack = useCloudpack();
1069
+ const restartTasks = () => {
1070
+ cloudpack.restartTasks();
1071
+ };
1072
+ return /* @__PURE__ */ React8.createElement(Dialog, {
1073
+ title: "Task results",
1074
+ draggable: true,
1075
+ onClose,
1076
+ commands: /* @__PURE__ */ React8.createElement(Button, {
1077
+ primary: true,
1078
+ onClick: restartTasks
1079
+ }, "Restart all tasks")
1080
+ }, /* @__PURE__ */ React8.createElement(TaskList, null));
1081
+ }
1082
+
1083
+ // src/components/ErrorDialog/ErrorDialog.tsx
1084
+ import { default as React10 } from "react";
1085
+
1086
+ // src/components/ErrorDialog/PathError.tsx
1087
+ import React9 from "react";
1088
+ import { default as cx3 } from "classnames";
1089
+ function PathError(props) {
1090
+ const [showContent, setshowContent] = React9.useState(false);
1091
+ const { packageName, path } = props;
1092
+ return /* @__PURE__ */ React9.createElement("div", {
1093
+ className: TaskStatus_module_default.root
1094
+ }, /* @__PURE__ */ React9.createElement("div", {
1095
+ className: cx3(TaskStatus_module_default.header, TaskStatus_module_default.error)
1096
+ }, /* @__PURE__ */ React9.createElement("button", {
1097
+ className: TaskStatus_module_default.expandButton,
1098
+ onClick: () => setshowContent(!showContent)
1099
+ }, /* @__PURE__ */ React9.createElement("img", {
1100
+ className: cx3(TaskStatus_module_default.expandIcon, !showContent && TaskStatus_module_default.collapsed),
1101
+ src: chevrondown_20_inline_default,
1102
+ alt: ""
1103
+ })), /* @__PURE__ */ React9.createElement("img", {
1104
+ className: TaskStatus_module_default.errorIcon,
1105
+ src: error_24_inline_default,
1106
+ alt: ""
1107
+ }), /* @__PURE__ */ React9.createElement("div", {
1108
+ className: TaskStatus_module_default.title
1109
+ }, `${packageName}/${path}`)), showContent && /* @__PURE__ */ React9.createElement("div", {
1110
+ className: TaskStatus_module_default.content
1111
+ }, /* @__PURE__ */ React9.createElement("div", {
1112
+ className: TaskStatus_module_default.title
1113
+ }, "Details"), /* @__PURE__ */ React9.createElement("div", {
1114
+ className: TaskStatus_module_default.nameValueArea
1115
+ }, /* @__PURE__ */ React9.createElement("div", {
1116
+ className: TaskStatus_module_default.name
1117
+ }, "Problem"), /* @__PURE__ */ React9.createElement("div", {
1118
+ className: TaskStatus_module_default.value
1119
+ }, `A deep import "${packageName}" was imported, but was unrecognized as an exported entry path.`)), /* @__PURE__ */ React9.createElement("div", {
1120
+ className: TaskStatus_module_default.nameValueArea
1121
+ }, /* @__PURE__ */ React9.createElement("div", {
1122
+ className: TaskStatus_module_default.name
1123
+ }, "Solution"), /* @__PURE__ */ React9.createElement("div", {
1124
+ className: TaskStatus_module_default.value
1125
+ }, `Remove the path from the import in your source. (Import from "${packageName}" rather than "${packageName}/${path}")`))));
1126
+ }
1127
+
1128
+ // src/components/ErrorDialog/ErrorDialog.tsx
1129
+ function ErrorDialog({ unsupported }) {
1130
+ const cloudpack = useCloudpack();
1131
+ const reload = () => {
1132
+ cloudpack.restartTasks();
1133
+ };
1134
+ return /* @__PURE__ */ React10.createElement(Dialog, {
1135
+ title: "Found unsupported paths in your project",
1136
+ style: "error",
1137
+ commands: /* @__PURE__ */ React10.createElement(Button, {
1138
+ primary: true,
1139
+ onClick: reload
1140
+ }, "Reload")
1141
+ }, /* @__PURE__ */ React10.createElement("div", {
1142
+ className: TaskList_module_default.root
1143
+ }, unsupported.map((data, index) => /* @__PURE__ */ React10.createElement(PathError, {
1144
+ ...data,
1145
+ key: index
1146
+ }))));
1147
+ }
1148
+
1149
+ // src/components/ErrorDialog/useErrorEvents.ts
1150
+ import { useEffect as useEffect4, useState as useState5 } from "react";
1151
+ var useErrorEvents = () => {
1152
+ const [events, setEvents] = useState5({ unsupported: [] });
1153
+ useEffect4(() => {
1154
+ const handleError = (event) => {
1155
+ const regex = /[Mm]odule specifier,? ['"](.*?)\/(.*?)['"]/;
1156
+ const match = event.message.match(regex);
1157
+ if (match && match.length === 3) {
1158
+ setEvents((prevEvents) => ({
1159
+ ...prevEvents,
1160
+ unsupported: [...prevEvents.unsupported, { packageName: match[1], path: match[2] }]
1161
+ }));
1162
+ }
1163
+ };
1164
+ window.uncaughtErrors = window.uncaughtErrors || { errors: [], unregister: () => void 0 };
1165
+ window.uncaughtErrors.unregister();
1166
+ window.addEventListener("error", handleError);
1167
+ for (const error3 of window.uncaughtErrors.errors) {
1168
+ handleError(error3);
1169
+ }
1170
+ }, []);
1171
+ return events;
1172
+ };
1173
+
1174
+ // src/components/StatusOverlay/StatusOverlay.tsx
1175
+ function StatusOverlay() {
1176
+ const [isExpanded, setIsExpanded] = useState6(false);
1177
+ const status = useStatus();
1178
+ const internal = useRef3();
1179
+ const { unsupported } = useErrorEvents();
1180
+ if (isExpanded === false && internal.current?.status !== "idle" && status.status === "idle" && internal.current?.totalErrors != status.totalErrors) {
1181
+ setIsExpanded(true);
1182
+ }
1183
+ internal.current = status;
1184
+ const toggleMinimized = useCallback(() => {
1185
+ console.log(`Toggling minimized state to ${!isExpanded}`);
1186
+ setIsExpanded(!isExpanded);
1187
+ }, [isExpanded, setIsExpanded]);
1188
+ return /* @__PURE__ */ React11.createElement("div", null, !!unsupported.length && /* @__PURE__ */ React11.createElement(ErrorDialog, {
1189
+ unsupported
1190
+ }), !unsupported.length && !isExpanded && /* @__PURE__ */ React11.createElement(StatusBadge, {
1191
+ onExpand: toggleMinimized
1192
+ }), !unsupported.length && isExpanded && /* @__PURE__ */ React11.createElement(StatusDialog, {
1193
+ onClose: toggleMinimized
1194
+ }));
1195
+ }
1196
+
1197
+ // src/components/ThemeProvider/ThemeProvider.tsx
1198
+ import React12 from "react";
1199
+
1200
+ // src/components/ThemeProvider/ThemeProvider.module.css
1201
+ var compiledModule7 = `.xwrpHYTQE-ThemeProvidermodulecssroot {
1202
+ font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Fira Sans',
1203
+ 'Droid Sans', 'Helvetica Neue', sans-serif;
1204
+ }
1205
+ `;
1206
+ var s7 = document.createElement("style");
1207
+ s7.setAttribute("data-sourceFile", "src/components/ThemeProvider/ThemeProvider.module.css");
1208
+ s7.appendChild(document.createTextNode(compiledModule7));
1209
+ document.head.appendChild(s7);
1210
+ var root4 = "xwrpHYTQE-ThemeProvidermodulecssroot";
1211
+ var ThemeProvider_module_default = { root: root4 };
1212
+
1213
+ // src/components/ThemeProvider/ThemeProvider.tsx
1214
+ function ThemeProvider({ children }) {
1215
+ return /* @__PURE__ */ React12.createElement("div", {
1216
+ className: ThemeProvider_module_default.root
1217
+ }, children);
1218
+ }
1219
+
1220
+ // src/index.tsx
1221
+ var rootDiv = document.createElement("div");
1222
+ ReactDOM.render(
1223
+ /* @__PURE__ */ React13.createElement(ThemeProvider, null, /* @__PURE__ */ React13.createElement(CloudpackProvider, null, /* @__PURE__ */ React13.createElement(StatusOverlay, null))),
1224
+ rootDiv
1225
+ );
1226
+ document.body.appendChild(rootDiv);