@ms-cloudpack/overlay 0.17.12 → 0.17.13

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.
@@ -1,74 +1,22 @@
1
+ import {
2
+ CloudpackProvider,
3
+ useCloudpack,
4
+ useDraggable
5
+ } from "../chunks/js/chunk-7KHMDJ6G.js";
1
6
  import {
2
7
  cookieNames,
3
8
  elementIds
4
9
  } from "../chunks/js/chunk-PDWQRLCD.js";
5
10
 
6
11
  // packages/overlay/src/index.tsx
7
- import React15 from "react";
12
+ import React5 from "react";
8
13
  import ReactDOM from "react-dom";
9
14
 
10
- // packages/overlay/src/components/CloudpackProvider/CloudpackProvider.tsx
11
- import React, { createContext, useContext } from "react";
12
- var CloudpackContext = createContext(null);
13
- function CloudpackProvider({ client, children }) {
14
- return /* @__PURE__ */ React.createElement(CloudpackContext.Provider, { value: client }, children);
15
- }
16
- var useCloudpack = () => useContext(CloudpackContext);
17
-
18
15
  // packages/overlay/src/components/StatusOverlay/StatusOverlay.tsx
19
- import React13, { useCallback as useCallback3, useState as useState6, useRef as useRef3 } from "react";
16
+ import React3, { useCallback as useCallback2, useState as useState4, useRef as useRef2 } from "react";
20
17
 
21
18
  // packages/overlay/src/components/StatusBadge/StatusBadge.tsx
22
- import React2, { useCallback, useRef, useState as useState3 } from "react";
23
-
24
- // packages/overlay/src/hooks/useDraggable.ts
25
- import { useEffect, useState } from "react";
26
- function useDraggable(options) {
27
- const { enabled, containerElementRef, dragElementRef } = options;
28
- const [isDragging, setIsDragging] = useState(false);
29
- useEffect(() => {
30
- const moveTarget = containerElementRef?.current;
31
- const dragTarget = dragElementRef?.current;
32
- if (!enabled || !moveTarget || !dragTarget) {
33
- return;
34
- }
35
- let originalX = 0;
36
- let originalY = 0;
37
- let offset = { x: 0, y: 0 };
38
- const onPointerMove = (event) => {
39
- moveTarget.style.transform = `translate(${offset.x + event.clientX - originalX}px, ${offset.y + event.clientY - originalY}px)`;
40
- };
41
- const onPointerUp = (event) => {
42
- setIsDragging(false);
43
- offset = {
44
- x: offset.x + event.clientX - originalX,
45
- y: offset.y + event.clientY - originalY
46
- };
47
- dragTarget.releasePointerCapture(event.pointerId);
48
- dragTarget.removeEventListener("pointerup", onPointerUp);
49
- dragTarget.removeEventListener("pointermove", onPointerMove);
50
- event.preventDefault();
51
- };
52
- const onPointerDown = (event) => {
53
- setIsDragging(true);
54
- originalX = event.clientX;
55
- originalY = event.clientY;
56
- dragTarget.setPointerCapture(event.pointerId);
57
- dragTarget.addEventListener("pointerup", onPointerUp);
58
- dragTarget.addEventListener("pointermove", onPointerMove);
59
- event.preventDefault();
60
- };
61
- dragTarget.addEventListener("pointerdown", onPointerDown);
62
- return () => {
63
- dragTarget.removeEventListener("pointerdown", onPointerDown);
64
- dragTarget.removeEventListener("pointermove", onPointerMove);
65
- dragTarget.removeEventListener("pointerup", onPointerUp);
66
- };
67
- }, [enabled, containerElementRef, dragElementRef]);
68
- return {
69
- isDragging
70
- };
71
- }
19
+ import React, { useCallback, useRef, useState as useState2 } from "react";
72
20
 
73
21
  // packages/overlay/src/components/StatusBadge/StatusBadge.module.css
74
22
  var compiledModule = `.uHuWYf-StatusBadgemodule--fixedOverlay {
@@ -227,7 +175,7 @@ var StatusBadge_default = { badge, building, button, chevron, collapsed, content
227
175
  import { default as cx } from "classnames";
228
176
 
229
177
  // packages/overlay/src/components/CloudpackProvider/useStatus.ts
230
- import { useEffect as useEffect2, useState as useState2 } from "react";
178
+ import { useEffect, useState } from "react";
231
179
  import { taskStatsSource } from "@ms-cloudpack/api-server/browser";
232
180
  var defaultStatus = {
233
181
  status: "unknown",
@@ -238,8 +186,8 @@ var defaultStatus = {
238
186
  };
239
187
  var useStatus = () => {
240
188
  const cloudpack = useCloudpack();
241
- const [status, setStatus] = useState2(defaultStatus);
242
- useEffect2(() => {
189
+ const [status, setStatus] = useState(defaultStatus);
190
+ useEffect(() => {
243
191
  const subscription = cloudpack?.onDataChanged.subscribe(taskStatsSource, {
244
192
  onData: (data) => {
245
193
  setStatus(data);
@@ -258,7 +206,7 @@ function StatusBadge({ inline: inline2, onExpand, pageLoadTime }) {
258
206
  const rootElementRef = useRef(null);
259
207
  const dragElementRef = useRef(null);
260
208
  const status = useStatus();
261
- const [isCollapsed, setIsCollapsed] = useState3(!!localStorage.getItem(badgeStatusKey));
209
+ const [isCollapsed, setIsCollapsed] = useState2(!!localStorage.getItem(badgeStatusKey));
262
210
  const shouldRender = status.status !== "unknown";
263
211
  const toggleBadgeVisibility = useCallback(() => {
264
212
  const newCollapsedState = !isCollapsed;
@@ -276,22 +224,22 @@ function StatusBadge({ inline: inline2, onExpand, pageLoadTime }) {
276
224
  if (!shouldRender) {
277
225
  return null;
278
226
  }
279
- const metric2 = pageLoadTime ? /* @__PURE__ */ React2.createElement("span", { className: StatusBadge_default.metric, title: "Page Load Time" }, "in ", pageLoadTime.toFixed(2), " ms") : null;
227
+ const metric2 = pageLoadTime ? /* @__PURE__ */ React.createElement("span", { className: StatusBadge_default.metric, title: "Page Load Time" }, "in ", pageLoadTime.toFixed(2), " ms") : null;
280
228
  const leftChevron = "\xAB";
281
229
  const rightChevron = "\xBB";
282
- const badge2 = /* @__PURE__ */ React2.createElement(
230
+ const badge2 = /* @__PURE__ */ React.createElement(
283
231
  "div",
284
232
  {
285
233
  id: elementIds.statusBadgeRoot,
286
234
  ref: rootElementRef,
287
235
  className: `${getStatusClassName(status, !!inline2)} ${getCollapsedClassName(isCollapsed)}`
288
236
  },
289
- !inline2 && /* @__PURE__ */ React2.createElement("div", { ref: dragElementRef, className: StatusBadge_default.gripArea }, /* @__PURE__ */ React2.createElement("div", { className: StatusBadge_default.grip }), /* @__PURE__ */ React2.createElement("div", { className: StatusBadge_default.grip })),
290
- /* @__PURE__ */ React2.createElement("button", { className: StatusBadge_default.button, onClick: onExpand, "aria-label": "Expand overlay" }, /* @__PURE__ */ React2.createElement("div", { className: StatusBadge_default.value }, getStatusString(status))),
291
- /* @__PURE__ */ React2.createElement("div", null, getStatsString(status), metric2),
292
- /* @__PURE__ */ React2.createElement("button", { className: `${StatusBadge_default.button} ${StatusBadge_default.chevron}`, onClick: toggleBadgeVisibility }, isCollapsed ? leftChevron : rightChevron)
237
+ !inline2 && /* @__PURE__ */ React.createElement("div", { ref: dragElementRef, className: StatusBadge_default.gripArea }, /* @__PURE__ */ React.createElement("div", { className: StatusBadge_default.grip }), /* @__PURE__ */ React.createElement("div", { className: StatusBadge_default.grip })),
238
+ /* @__PURE__ */ React.createElement("button", { className: StatusBadge_default.button, onClick: onExpand, "aria-label": "Expand overlay" }, /* @__PURE__ */ React.createElement("div", { className: StatusBadge_default.value }, getStatusString(status))),
239
+ /* @__PURE__ */ React.createElement("div", null, getStatsString(status), metric2),
240
+ /* @__PURE__ */ React.createElement("button", { className: `${StatusBadge_default.button} ${StatusBadge_default.chevron}`, onClick: toggleBadgeVisibility }, isCollapsed ? leftChevron : rightChevron)
293
241
  );
294
- return inline2 ? badge2 : /* @__PURE__ */ React2.createElement("div", { className: StatusBadge_default.fixedOverlay }, /* @__PURE__ */ React2.createElement("div", { className: StatusBadge_default.contentSurface }, badge2));
242
+ return inline2 ? badge2 : /* @__PURE__ */ React.createElement("div", { className: StatusBadge_default.fixedOverlay }, /* @__PURE__ */ React.createElement("div", { className: StatusBadge_default.contentSurface }, badge2));
295
243
  }
296
244
  function getStatusString(status) {
297
245
  if (status.status === "pending") {
@@ -330,761 +278,8 @@ function getStatsString({ totalTasks, remainingTasks, totalErrors, totalWarnings
330
278
  ].filter(Boolean).join(", ");
331
279
  }
332
280
 
333
- // packages/overlay/src/components/StatusDialog/StatusDialog.tsx
334
- import React9, { useCallback as useCallback2 } from "react";
335
-
336
- // packages/overlay/src/components/StatusDialog/TaskList.tsx
337
- import React6 from "react";
338
-
339
- // packages/overlay/src/components/StatusDialog/TaskStatus.tsx
340
- import React5 from "react";
341
-
342
- // packages/overlay/src/components/StatusDialog/TaskResultItem.tsx
343
- import React3 from "react";
344
-
345
- // packages/overlay/src/components/StatusDialog/TaskResultItem.module.css
346
- var compiledModule2 = `.FSsdmcQ-TaskResultItemmodule--root {
347
- display: flex;
348
- background: #f5f5f5;
349
- }
350
-
351
- .FSsdmcQ-TaskResultItemmodule--statusBar {
352
- flex-shrink: 0;
353
- border-radius: 4px;
354
- width: 4px;
355
- background: #aa0000;
356
- box-shadow: 2px 0 4px 0 rgb(220 0 0 / 20%);
357
- }
358
-
359
- .FSsdmcQ-TaskResultItemmodule--content {
360
- padding: 8px;
361
- display: flex;
362
- flex-grow: 1;
363
- overflow: hidden;
364
- flex-direction: column;
365
- }
366
-
367
- .FSsdmcQ-TaskResultItemmodule--titleArea {
368
- display: flex;
369
- align-items: center;
370
- flex-direction: row;
371
- gap: 4px;
372
- padding: 4px 0;
373
- }
374
-
375
- .FSsdmcQ-TaskResultItemmodule--file {
376
- display: inline-flex;
377
- margin: 0;
378
- padding: 0;
379
- border: none;
380
- background: inherit;
381
- font-family: inherit;
382
- flex-grow: 1;
383
- font-weight: 500;
384
- font-size: 14px;
385
- flex-shrink: 0;
386
- text-decoration: none;
387
- color: #000;
388
- cursor: pointer;
389
- }
390
-
391
- .FSsdmcQ-TaskResultItemmodule--file:hover {
392
- text-decoration: underline;
393
- }
394
-
395
- .FSsdmcQ-TaskResultItemmodule--actionArea {
396
- display: flex;
397
- flex-direction: row;
398
- gap: 8px;
399
- flex-shrink: 0;
400
- }
401
-
402
- .FSsdmcQ-TaskResultItemmodule--text {
403
- word-wrap: break-word;
404
- color: #333;
405
- }
406
- `;
407
- var s2 = document.createElement("style");
408
- s2.setAttribute("data-sourceFile", "packages/overlay/src/components/StatusDialog/TaskResultItem.module.css");
409
- s2.appendChild(document.createTextNode(compiledModule2));
410
- document.head.appendChild(s2);
411
- var actionArea = "FSsdmcQ-TaskResultItemmodule--actionArea";
412
- var content = "FSsdmcQ-TaskResultItemmodule--content";
413
- var file = "FSsdmcQ-TaskResultItemmodule--file";
414
- var root = "FSsdmcQ-TaskResultItemmodule--root";
415
- var statusBar = "FSsdmcQ-TaskResultItemmodule--statusBar";
416
- var text = "FSsdmcQ-TaskResultItemmodule--text";
417
- var titleArea = "FSsdmcQ-TaskResultItemmodule--titleArea";
418
- var TaskResultItem_default = { actionArea, content, file, root, statusBar, text, titleArea };
419
-
420
- // packages/overlay/src/components/StatusDialog/TaskResultItem.tsx
421
- function TaskResultItem({ item, projectPath, index }) {
422
- const cloudpack = useCloudpack();
423
- const openSource = (ev) => {
424
- if (item.location) {
425
- void cloudpack.openCodeEditor.mutate({
426
- rootPath: projectPath,
427
- relativePath: item.location?.file,
428
- line: item.location?.line,
429
- column: item.location?.column
430
- });
431
- ev.preventDefault();
432
- }
433
- };
434
- const location = [item.location?.file || "(path unavailable)", item.location?.line, item.location?.column].filter(Boolean).join(":");
435
- return /* @__PURE__ */ React3.createElement("div", { className: TaskResultItem_default.root }, /* @__PURE__ */ React3.createElement("div", { className: TaskResultItem_default.statusBar }), /* @__PURE__ */ React3.createElement("div", { className: TaskResultItem_default.content }, /* @__PURE__ */ React3.createElement("div", { className: TaskResultItem_default.titleArea }, /* @__PURE__ */ React3.createElement("button", { onClick: openSource, className: TaskResultItem_default.file }, index, ". ", location)), /* @__PURE__ */ React3.createElement("div", { className: TaskResultItem_default.text }, "[", item.source, "] ", item.text), /* @__PURE__ */ React3.createElement("pre", { className: TaskResultItem_default.text }, JSON.stringify(item, null, 2))));
436
- }
437
-
438
- // packages/overlay/src/components/StatusDialog/TaskStatus.module.css
439
- var compiledModule3 = `.WGSBzu-TaskStatusmodule--root {
440
- border: 1px solid #ccc;
441
- border-radius: 3px;
442
- box-shadow: 0 0 12px -6px rgba(0, 0, 0, 0.25);
443
- }
444
-
445
- .WGSBzu-TaskStatusmodule--header {
446
- display: flex;
447
- gap: 8px;
448
- padding: 8px 16px;
449
- background: #f0f0f0;
450
- align-items: center;
451
- line-height: 1;
452
- }
453
-
454
- .WGSBzu-TaskStatusmodule--commands {
455
- display: flex;
456
- flex-direction: row;
457
- gap: 8px;
458
- align-items: center;
459
- flex-shrink: 0;
460
- height: 40px;
461
- padding: 0 16px;
462
- }
463
-
464
- .WGSBzu-TaskStatusmodule--expandButton {
465
- background: transparent;
466
- border: none;
467
- border-radius: 4px;
468
- width: 32px;
469
- height: 32px;
470
- }
471
- .WGSBzu-TaskStatusmodule--expandButton:hover {
472
- background: rgba(0, 0, 0, 0.1);
473
- }
474
-
475
- .WGSBzu-TaskStatusmodule--expandButton:active {
476
- background: rgba(0, 0, 0, 0.2);
477
- }
478
-
479
- .WGSBzu-TaskStatusmodule--expandIcon {
480
- transition: transform 0.1s ease-in-out;
481
- }
482
-
483
- .WGSBzu-TaskStatusmodule--collapsed {
484
- transform: rotate(-90deg);
485
- }
486
-
487
- .WGSBzu-TaskStatusmodule--farArea {
488
- line-height: 1;
489
- font-size: 13px;
490
- text-align: end;
491
- display: flex;
492
- align-items: baseline;
493
- flex-direction: row;
494
- gap: 8px;
495
- display: flex;
496
- flex-grow: 1;
497
- justify-content: end;
498
- flex-direction: row;
499
- }
500
-
501
- .WGSBzu-TaskStatusmodule--title {
502
- font-size: 16px;
503
- font-weight: 500;
504
- color: #333;
505
- }
506
-
507
- .WGSBzu-TaskStatusmodule--subTitle {
508
- font-size: 13px;
509
- }
510
-
511
- .WGSBzu-TaskStatusmodule--content {
512
- border-top: 1px solid #ccc;
513
- background: #fafafa;
514
- padding: 8px 16px;
515
- display: flex;
516
- flex-direction: column;
517
- gap: 8px;
518
- }
519
-
520
- .WGSBzu-TaskStatusmodule--resultItems {
521
- display: flex;
522
- flex-direction: column;
523
- gap: 8px;
524
- }
525
-
526
- .WGSBzu-TaskStatusmodule--error {
527
- background: #ffe9e9;
528
- }
529
-
530
- .WGSBzu-TaskStatusmodule--success {
531
- background: #e9f9e9;
532
- }
533
-
534
- .WGSBzu-TaskStatusmodule--warning {
535
- background: #fff9e9;
536
- }
537
-
538
- .WGSBzu-TaskStatusmodule--name {
539
- font-size: 12px;
540
- font-weight: 600;
541
- text-transform: uppercase;
542
- }
543
-
544
- .WGSBzu-TaskStatusmodule--value {
545
- display: flex;
546
- flex-direction: column;
547
- font-size: 14px;
548
- color: #333;
549
- }
550
-
551
- .WGSBzu-TaskStatusmodule--linkButton {
552
- display: inline-flex;
553
- align-items: flex-start;
554
- text-align: start;
555
- margin: 0;
556
- padding: 0;
557
- border: none;
558
- background: inherit;
559
- font-family: inherit;
560
- flex-grow: 1;
561
-
562
- font-size: 14px;
563
- flex-shrink: 0;
564
- text-decoration: none;
565
- color: #000;
566
- cursor: pointer;
567
- }
568
-
569
- .WGSBzu-TaskStatusmodule--linkButton:hover {
570
- text-decoration: underline;
571
- }
572
- `;
573
- var s3 = document.createElement("style");
574
- s3.setAttribute("data-sourceFile", "packages/overlay/src/components/StatusDialog/TaskStatus.module.css");
575
- s3.appendChild(document.createTextNode(compiledModule3));
576
- document.head.appendChild(s3);
577
- var collapsed2 = "WGSBzu-TaskStatusmodule--collapsed";
578
- var commands = "WGSBzu-TaskStatusmodule--commands";
579
- var content2 = "WGSBzu-TaskStatusmodule--content";
580
- var error2 = "WGSBzu-TaskStatusmodule--error";
581
- var expandButton = "WGSBzu-TaskStatusmodule--expandButton";
582
- var expandIcon = "WGSBzu-TaskStatusmodule--expandIcon";
583
- var farArea = "WGSBzu-TaskStatusmodule--farArea";
584
- var header = "WGSBzu-TaskStatusmodule--header";
585
- var linkButton = "WGSBzu-TaskStatusmodule--linkButton";
586
- var name = "WGSBzu-TaskStatusmodule--name";
587
- var resultItems = "WGSBzu-TaskStatusmodule--resultItems";
588
- var root2 = "WGSBzu-TaskStatusmodule--root";
589
- var subTitle = "WGSBzu-TaskStatusmodule--subTitle";
590
- var success2 = "WGSBzu-TaskStatusmodule--success";
591
- var title = "WGSBzu-TaskStatusmodule--title";
592
- var value2 = "WGSBzu-TaskStatusmodule--value";
593
- var warning2 = "WGSBzu-TaskStatusmodule--warning";
594
- var TaskStatus_default = { collapsed: collapsed2, commands, content: content2, error: error2, expandButton, expandIcon, farArea, header, linkButton, name, resultItems, root: root2, subTitle, success: success2, title, value: value2, warning: warning2 };
595
-
596
- // packages/overlay/src/components/StatusDialog/TaskStatus.tsx
597
- import { default as cx2 } from "classnames";
598
-
599
- // packages/overlay/src/images/error-24.inline.svg
600
- var error_24_inline_default = 'data:image/svg+xml,<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">%0A<path d="M12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2ZM15.5303 8.46967L15.4462 8.39705C15.1852 8.2034 14.827 8.20101 14.5636 8.38988L14.4697 8.46967L12 10.939L9.53033 8.46967L9.44621 8.39705C9.18522 8.2034 8.82701 8.20101 8.56362 8.38988L8.46967 8.46967L8.39705 8.55379C8.2034 8.81478 8.20101 9.17299 8.38988 9.43638L8.46967 9.53033L10.939 12L8.46967 14.4697L8.39705 14.5538C8.2034 14.8148 8.20101 15.173 8.38988 15.4364L8.46967 15.5303L8.55379 15.6029C8.81478 15.7966 9.17299 15.799 9.43638 15.6101L9.53033 15.5303L12 13.061L14.4697 15.5303L14.5538 15.6029C14.8148 15.7966 15.173 15.799 15.4364 15.6101L15.5303 15.5303L15.6029 15.4462C15.7966 15.1852 15.799 14.827 15.6101 14.5636L15.5303 14.4697L13.061 12L15.5303 9.53033L15.6029 9.44621C15.7966 9.18522 15.799 8.82701 15.6101 8.56362L15.5303 8.46967L15.4462 8.39705L15.5303 8.46967Z" fill="%23aa0000"/>%0A</svg>%0A';
601
-
602
- // packages/overlay/src/images/success-24.inline.svg
603
- var success_24_inline_default = 'data:image/svg+xml,<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">%0A<path d="M12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2ZM15.2197 8.96967L10.75 13.4393L8.78033 11.4697C8.48744 11.1768 8.01256 11.1768 7.71967 11.4697C7.42678 11.7626 7.42678 12.2374 7.71967 12.5303L10.2197 15.0303C10.5126 15.3232 10.9874 15.3232 11.2803 15.0303L16.2803 10.0303C16.5732 9.73744 16.5732 9.26256 16.2803 8.96967C15.9874 8.67678 15.5126 8.67678 15.2197 8.96967Z" fill="%2300aa00"/>%0A</svg>%0A';
604
-
605
- // packages/overlay/src/images/chevrondown-20.inline.svg
606
- var chevrondown_20_inline_default = 'data:image/svg+xml,<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">%0A<path d="M15.794 7.73271C16.0797 8.03263 16.0681 8.50737 15.7682 8.79306L10.5178 13.7944C10.2281 14.0703 9.77285 14.0703 9.48318 13.7944L4.23271 8.79306C3.93279 8.50737 3.92125 8.03263 4.20694 7.73271C4.49264 7.43279 4.96737 7.42125 5.26729 7.70694L10.0005 12.2155L14.7336 7.70694C15.0336 7.42125 15.5083 7.43279 15.794 7.73271Z" fill="%23212121"/>%0A</svg>%0A';
607
-
608
- // packages/overlay/src/components/Button/Button.tsx
609
- import React4 from "react";
610
-
611
- // packages/overlay/src/components/Button/Button.module.css
612
- var compiledModule4 = `.RpmxvThK-Buttonmodule--standardButton {
613
- outline: transparent;
614
- position: relative;
615
- font-family: inherit;
616
- font-size: 14px;
617
- font-weight: 600;
618
- box-sizing: border-box;
619
- border: 1px solid rgb(138, 136, 134);
620
- display: inline-block;
621
- text-decoration: none;
622
- text-align: center;
623
- cursor: pointer;
624
- padding: 0px 16px;
625
- border-radius: 2px;
626
- min-width: 80px;
627
- height: 32px;
628
- background-color: rgb(255, 255, 255);
629
- color: rgb(50, 49, 48);
630
- user-select: none;
631
- }
632
-
633
- .RpmxvThK-Buttonmodule--standardButton:active {
634
- background-color: rgb(237, 235, 233);
635
- color: rgb(32, 31, 30);
636
- }
637
-
638
- .RpmxvThK-Buttonmodule--standardButton:hover {
639
- background-color: rgb(243, 242, 241);
640
- color: rgb(32, 31, 30);
641
- }
642
-
643
- .RpmxvThK-Buttonmodule--standardButton:focus {
644
- border: 3px solid rgb(0, 0, 0);
645
- }
646
-
647
- .RpmxvThK-Buttonmodule--primaryButton {
648
- outline: transparent;
649
- position: relative;
650
- font-family: inherit;
651
- font-size: 14px;
652
- font-weight: 600;
653
- box-sizing: border-box;
654
- border: 1px solid rgb(0, 120, 212);
655
- display: inline-block;
656
- text-decoration: none;
657
- text-align: center;
658
- cursor: pointer;
659
- padding: 0px 16px;
660
- border-radius: 2px;
661
- min-width: 80px;
662
- height: 32px;
663
- background-color: rgb(0, 120, 212);
664
- color: rgb(255, 255, 255);
665
- user-select: none;
666
- }
667
-
668
- .RpmxvThK-Buttonmodule--primaryButton:active {
669
- background-color: rgb(0, 90, 158);
670
- border: 1px solid rgb(0, 90, 158);
671
- color: rgb(255, 255, 255);
672
- }
673
-
674
- .RpmxvThK-Buttonmodule--primaryButton:hover {
675
- background-color: rgb(16, 110, 190);
676
- border: 1px solid rgb(16, 110, 190);
677
- color: rgb(255, 255, 255);
678
- }
679
-
680
- .RpmxvThK-Buttonmodule--primaryButton:focus {
681
- border: 3px solid rgb(0, 0, 0);
682
- }
683
- `;
684
- var s4 = document.createElement("style");
685
- s4.setAttribute("data-sourceFile", "packages/overlay/src/components/Button/Button.module.css");
686
- s4.appendChild(document.createTextNode(compiledModule4));
687
- document.head.appendChild(s4);
688
- var primaryButton = "RpmxvThK-Buttonmodule--primaryButton";
689
- var standardButton = "RpmxvThK-Buttonmodule--standardButton";
690
- var Button_default = { primaryButton, standardButton };
691
-
692
- // packages/overlay/src/components/Button/Button.tsx
693
- function Button(props) {
694
- const { primary, ...other } = props;
695
- const className = primary ? Button_default.primaryButton : Button_default.standardButton;
696
- return /* @__PURE__ */ React4.createElement("button", { ...other, className, type: "button" });
697
- }
698
-
699
- // packages/overlay/src/components/StatusDialog/TaskStatus.tsx
700
- function getCompletion(task) {
701
- if (task.status === "pending") {
702
- return "Running";
703
- }
704
- return [
705
- `Completed in ${task.durationMilliseconds}ms`,
706
- task.errors?.length && `${task.errors.length} error${task.errors.length > 1 ? "s" : ""}`,
707
- task.warnings?.length && `${task.warnings.length} warning${task.warnings.length > 1 ? "s" : ""}`
708
- ].filter(Boolean).join(", ");
709
- }
710
- function TaskStatus({ task }) {
711
- const [isOpen, setIsOpen] = React5.useState(void 0);
712
- const { name: name2, warnings = [], errors = [] } = task;
713
- const cloudpack = useCloudpack();
714
- const showContent = isOpen === true || isOpen === void 0 && errors?.length > 0;
715
- const { inputPath, outputPath } = task;
716
- const open = (rootPath) => {
717
- void cloudpack.openFilePath.mutate({
718
- rootPath
719
- });
720
- };
721
- const openPackage = () => {
722
- if (!inputPath) {
723
- console.error("No input path for task", task);
724
- return;
725
- }
726
- void cloudpack.openCodeEditor.mutate({
727
- rootPath: inputPath,
728
- relativePath: "package.json"
729
- });
730
- };
731
- const restartTask = () => {
732
- if (!inputPath) {
733
- console.error("No input path for task", task);
734
- return;
735
- }
736
- void cloudpack.restartTask.mutate({ id: task.id, inputPath });
737
- };
738
- return /* @__PURE__ */ React5.createElement("div", { className: TaskStatus_default.root }, /* @__PURE__ */ React5.createElement("div", { className: getHeaderClassName(task) }, /* @__PURE__ */ React5.createElement(
739
- "button",
740
- {
741
- className: TaskStatus_default.expandButton,
742
- onClick: () => setIsOpen(!showContent),
743
- "aria-label": showContent ? `Minimize ${name2}` : `Expand ${name2}`
744
- },
745
- /* @__PURE__ */ React5.createElement(
746
- "img",
747
- {
748
- className: cx2(TaskStatus_default.expandIcon, !showContent && TaskStatus_default.collapsed),
749
- src: chevrondown_20_inline_default,
750
- alt: "Chevron down icon"
751
- }
752
- )
753
- ), errors?.length === 0 && warnings?.length === 0 && /* @__PURE__ */ React5.createElement("img", { className: TaskStatus_default.errorIcon, src: success_24_inline_default, alt: "Success icon" }), errors?.length > 0 && /* @__PURE__ */ React5.createElement("img", { className: TaskStatus_default.errorIcon, src: error_24_inline_default, alt: "Error icon" }), /* @__PURE__ */ React5.createElement("div", { className: TaskStatus_default.title }, name2), /* @__PURE__ */ React5.createElement("div", { className: TaskStatus_default.farArea }, getCompletion(task))), showContent && (inputPath ? /* @__PURE__ */ React5.createElement(React5.Fragment, null, /* @__PURE__ */ React5.createElement("div", { className: TaskStatus_default.commands }, /* @__PURE__ */ React5.createElement(Button, { onClick: restartTask }, "Restart task")), /* @__PURE__ */ React5.createElement("div", { className: TaskStatus_default.content }, /* @__PURE__ */ React5.createElement("div", { className: TaskStatus_default.title }, "Details"), /* @__PURE__ */ React5.createElement("div", { className: TaskStatus_default.nameValueArea }, /* @__PURE__ */ React5.createElement("div", { className: TaskStatus_default.name }, "Input path"), /* @__PURE__ */ React5.createElement("div", { className: TaskStatus_default.value }, /* @__PURE__ */ React5.createElement("button", { className: TaskStatus_default.linkButton, onClick: () => open(inputPath) }, task.inputPath), /* @__PURE__ */ React5.createElement("button", { className: TaskStatus_default.linkButton, onClick: openPackage }, "(Package.json)"))), outputPath && /* @__PURE__ */ React5.createElement("div", { className: TaskStatus_default.nameValueArea }, /* @__PURE__ */ React5.createElement("div", { className: TaskStatus_default.name }, "Output path"), /* @__PURE__ */ React5.createElement("button", { className: TaskStatus_default.linkButton, onClick: () => open(outputPath) }, outputPath)), errors?.length > 0 && /* @__PURE__ */ React5.createElement(React5.Fragment, null, /* @__PURE__ */ React5.createElement("div", { className: TaskStatus_default.title }, "Errors"), /* @__PURE__ */ React5.createElement("div", { className: TaskStatus_default.resultItems }, errors.map((error3, index) => /* @__PURE__ */ React5.createElement(TaskResultItem, { key: index, item: error3, projectPath: inputPath, index: index + 1 })))), warnings?.length > 0 && /* @__PURE__ */ React5.createElement(React5.Fragment, null, /* @__PURE__ */ React5.createElement("div", { className: TaskStatus_default.title }, "Warnings"), /* @__PURE__ */ React5.createElement("div", { className: TaskStatus_default.resultItems }, warnings.map((warning3, index) => /* @__PURE__ */ React5.createElement(TaskResultItem, { key: index, item: warning3, projectPath: inputPath, index: index + 1 })))))) : /* @__PURE__ */ React5.createElement("div", { className: TaskStatus_default.content }, "No input path found for task. This is a Cloudpack bug. Please report it.")));
754
- }
755
- function getHeaderClassName(task) {
756
- const { errors = [], warnings = [] } = task;
757
- return cx2(TaskStatus_default.header, {
758
- [TaskStatus_default.success]: errors?.length === 0 && warnings?.length === 0,
759
- [TaskStatus_default.warning]: errors?.length === 0 && warnings?.length > 0,
760
- [TaskStatus_default.error]: errors?.length > 0
761
- });
762
- }
763
-
764
- // packages/overlay/src/components/CloudpackProvider/useStatusDetails.ts
765
- import { useEffect as useEffect3, useState as useState4 } from "react";
766
- import { taskListSource } from "@ms-cloudpack/api-server/browser";
767
- var useStatusDetails = () => {
768
- const cloudpack = useCloudpack();
769
- const [details, setDetails] = useState4({ tasks: [] });
770
- useEffect3(() => {
771
- const subscription = cloudpack?.onDataChanged.subscribe(taskListSource, {
772
- onData: (data) => {
773
- setDetails(data);
774
- }
775
- });
776
- return () => {
777
- subscription.unsubscribe();
778
- };
779
- }, [cloudpack]);
780
- return details;
781
- };
782
-
783
- // packages/overlay/src/components/StatusDialog/TaskList.module.css
784
- var compiledModule5 = `.ZnVPBoZ-TaskListmodule--root {
785
- flex-grow: 1;
786
- overflow: auto;
787
- border-top: 1px solid #ccc;
788
- box-sizing: border-box;
789
- padding: 20px;
790
- display: flex;
791
- flex-direction: column;
792
- gap: 8px;
793
- }
794
- `;
795
- var s5 = document.createElement("style");
796
- s5.setAttribute("data-sourceFile", "packages/overlay/src/components/StatusDialog/TaskList.module.css");
797
- s5.appendChild(document.createTextNode(compiledModule5));
798
- document.head.appendChild(s5);
799
- var root3 = "ZnVPBoZ-TaskListmodule--root";
800
- var TaskList_default = { root: root3 };
801
-
802
- // packages/overlay/src/components/StatusDialog/TaskList.tsx
803
- function TaskList({ searchFilter, issuesOnly }) {
804
- const details = useStatusDetails();
805
- const tasks = (details.tasks || []).sort(sortTasks);
806
- let filteredTasks = tasks;
807
- if (searchFilter) {
808
- searchFilter = searchFilter.toLowerCase();
809
- filteredTasks = filteredTasks.filter(({ name: name2 }) => searchFilter && name2?.toLowerCase().includes(searchFilter));
810
- }
811
- if (issuesOnly) {
812
- filteredTasks = filteredTasks.filter(({ errors, warnings }) => errors?.length || warnings?.length);
813
- }
814
- return /* @__PURE__ */ React6.createElement("div", { className: TaskList_default.root }, filteredTasks.map((task) => /* @__PURE__ */ React6.createElement(TaskStatus, { key: task.name, task })));
815
- }
816
- function sortTasks(a, b) {
817
- const aStatus = a.status === "pending" ? 1 : 0;
818
- const bStatus = b.status === "pending" ? 1 : 0;
819
- if (aStatus !== bStatus) {
820
- return aStatus > bStatus ? -1 : 1;
821
- }
822
- const aErrors = a.errors?.length || 0;
823
- const bErrors = b.errors?.length || 0;
824
- if (aErrors !== bErrors) {
825
- return aErrors > bErrors ? -1 : 1;
826
- }
827
- if (a.name === void 0 && b.name === void 0) {
828
- return a.id < b.id ? -1 : 1;
829
- } else if (a.name === void 0) {
830
- return 1;
831
- } else if (b.name === void 0) {
832
- return -1;
833
- }
834
- return a.name < b.name ? -1 : 1;
835
- }
836
-
837
- // packages/overlay/src/components/Dialog/Dialog.tsx
838
- import { default as React7, useRef as useRef2 } from "react";
839
-
840
- // packages/overlay/src/components/Dialog/Dialog.module.css
841
- var compiledModule6 = `.XZLLsVjN-Dialogmodule--overlay {
842
- background: rgba(0, 0, 0, 0.1);
843
- border: 1px solid black;
844
- position: fixed;
845
- top: 0;
846
- left: 0;
847
- right: 0;
848
- bottom: 0;
849
- display: flex;
850
- align-items: center;
851
- justify-content: center;
852
- z-index: 999;
853
- }
854
-
855
- @keyframes fade-in {
856
- 0% {
857
- opacity: 0;
858
- }
859
- 100% {
860
- opacity: 1;
861
- }
862
- }
863
-
864
- .XZLLsVjN-Dialogmodule--commands {
865
- display: flex;
866
- flex-direction: row;
867
- gap: 8px;
868
- align-items: center;
869
- flex-shrink: 0;
870
- height: 40px;
871
- padding: 0 20px;
872
- }
873
-
874
- .XZLLsVjN-Dialogmodule--dialog {
875
- animation: fade-in 0.1s ease-in-out;
876
- width: 80vw;
877
- align-self: stretch;
878
- margin: 20px 0;
879
- background: white;
880
- color: #000;
881
- box-sizing: border-box;
882
- display: flex;
883
- flex-direction: column;
884
- border-top: 4px solid rgb(0, 120, 212);
885
- border-radius: 3px;
886
- box-shadow:
887
- rgb(0 0 0 / 22%) 0px 25.6px 57.6px 0px,
888
- rgb(0 0 0 / 18%) 0px 4.8px 14.4px 0px;
889
- position: relative;
890
- outline: transparent solid 3px;
891
- }
892
-
893
- .XZLLsVjN-Dialogmodule--titleArea {
894
- display: flex;
895
- flex-direction: row;
896
- align-items: center;
897
- padding: 8px 8px 8px 20px;
898
- gap: 8px;
899
- }
900
-
901
- .XZLLsVjN-Dialogmodule--closeButton {
902
- display: flex;
903
- align-items: center;
904
- justify-content: center;
905
- width: 32px;
906
- height: 32px;
907
- margin: 0;
908
- padding: 0;
909
- background: transparent;
910
- border: none;
911
- border-radius: 4px;
912
- }
913
-
914
- .XZLLsVjN-Dialogmodule--closeButton:hover {
915
- background: rgba(0, 0, 0, 0.1);
916
- }
917
-
918
- .XZLLsVjN-Dialogmodule--closeButton:active {
919
- background: rgba(0, 0, 0, 0.2);
920
- }
921
-
922
- .XZLLsVjN-Dialogmodule--title {
923
- flex-grow: 1;
924
- font-size: 20px;
925
- font-weight: 600;
926
- color: rgb(0, 120, 212);
927
- }
928
- `;
929
- var s6 = document.createElement("style");
930
- s6.setAttribute("data-sourceFile", "packages/overlay/src/components/Dialog/Dialog.module.css");
931
- s6.appendChild(document.createTextNode(compiledModule6));
932
- document.head.appendChild(s6);
933
- var closeButton = "XZLLsVjN-Dialogmodule--closeButton";
934
- var commands2 = "XZLLsVjN-Dialogmodule--commands";
935
- var dialog = "XZLLsVjN-Dialogmodule--dialog";
936
- var overlay = "XZLLsVjN-Dialogmodule--overlay";
937
- var title2 = "XZLLsVjN-Dialogmodule--title";
938
- var titleArea2 = "XZLLsVjN-Dialogmodule--titleArea";
939
- var Dialog_default = { closeButton, commands: commands2, dialog, overlay, title: title2, titleArea: titleArea2 };
940
-
941
- // packages/overlay/src/images/dismiss-16-filled.inline.svg
942
- var dismiss_16_filled_inline_default = 'data:image/svg+xml,<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">%0A<path d="M2.39705 2.55379L2.46967 2.46967C2.73594 2.2034 3.1526 2.1792 3.44621 2.39705L3.53033 2.46967L8 6.939L12.4697 2.46967C12.7626 2.17678 13.2374 2.17678 13.5303 2.46967C13.8232 2.76256 13.8232 3.23744 13.5303 3.53033L9.061 8L13.5303 12.4697C13.7966 12.7359 13.8208 13.1526 13.6029 13.4462L13.5303 13.5303C13.2641 13.7966 12.8474 13.8208 12.5538 13.6029L12.4697 13.5303L8 9.061L3.53033 13.5303C3.23744 13.8232 2.76256 13.8232 2.46967 13.5303C2.17678 13.2374 2.17678 12.7626 2.46967 12.4697L6.939 8L2.46967 3.53033C2.2034 3.26406 2.1792 2.8474 2.39705 2.55379L2.46967 2.46967L2.39705 2.55379Z" fill="%23212121"/>%0A</svg>%0A';
943
-
944
- // packages/overlay/src/components/Dialog/Dialog.tsx
945
- function Dialog({ title: title3, id, style, draggable, onClose, commands: commands3, children }) {
946
- const draggableRef = useRef2(null);
947
- const draggableTargetRef = useRef2(null);
948
- const colorAccent = style === "error" ? "rgb(164, 38, 44)" : void 0;
949
- const cursorDraggable = draggable ? "move" : void 0;
950
- useDraggable({
951
- enabled: !!draggable,
952
- containerElementRef: draggableRef,
953
- dragElementRef: draggableTargetRef
954
- });
955
- return /* @__PURE__ */ React7.createElement("div", { id, className: Dialog_default.overlay }, /* @__PURE__ */ React7.createElement("div", { ref: draggableRef, className: Dialog_default.dialog, style: { borderTopColor: colorAccent } }, /* @__PURE__ */ React7.createElement("div", { className: Dialog_default.titleArea }, /* @__PURE__ */ React7.createElement(
956
- "div",
957
- {
958
- ref: draggableTargetRef,
959
- className: Dialog_default.title,
960
- style: { color: colorAccent, cursor: cursorDraggable }
961
- },
962
- title3
963
- ), onClose && /* @__PURE__ */ React7.createElement("button", { className: Dialog_default.closeButton, onClick: onClose, "aria-label": "Minimize overlay" }, /* @__PURE__ */ React7.createElement("img", { src: dismiss_16_filled_inline_default, alt: "" }))), commands3 && /* @__PURE__ */ React7.createElement("div", { className: Dialog_default.commands }, ...commands3), children));
964
- }
965
-
966
- // packages/overlay/src/components/StatusDialog/Searchbox.tsx
967
- import React8 from "react";
968
-
969
- // packages/overlay/src/components/StatusDialog/Searchbox.module.css
970
- var compiledModule7 = `.aJeqJtva-Searchboxmodule--searchbox {
971
- position: absolute;
972
- font-size: 14px;
973
- font-weight: 400;
974
- box-shadow: none;
975
- padding: 0px 4px;
976
- box-sizing: border-box;
977
- color: rgb(50, 49, 48);
978
- background-color: rgb(255, 255, 255);
979
- display: flex;
980
- flex-flow: row nowrap;
981
- align-items: stretch;
982
- border-radius: 2px;
983
- border: 1px solid rgb(96, 94, 92);
984
- height: 32px;
985
- min-width: 160px;
986
- top: 52px;
987
- right: 20px;
988
- }
989
- `;
990
- var s7 = document.createElement("style");
991
- s7.setAttribute("data-sourceFile", "packages/overlay/src/components/StatusDialog/Searchbox.module.css");
992
- s7.appendChild(document.createTextNode(compiledModule7));
993
- document.head.appendChild(s7);
994
- var searchbox = "aJeqJtva-Searchboxmodule--searchbox";
995
- var Searchbox_default = { searchbox };
996
-
997
- // packages/overlay/src/components/StatusDialog/Searchbox.tsx
998
- function Searchbox({ value: value3, onChange }) {
999
- return /* @__PURE__ */ React8.createElement(React8.Fragment, null, typeof value3 === "string" && /* @__PURE__ */ React8.createElement("input", { type: "text", placeholder: "Search", className: Searchbox_default.searchbox, onChange, value: value3 }));
1000
- }
1001
-
1002
- // packages/overlay/src/components/StatusDialog/StatusDialog.tsx
1003
- function StatusDialog({ onClose }) {
1004
- const cloudpack = useCloudpack();
1005
- const [searchFilter, setSearchFilter] = React9.useState("");
1006
- const [issuesOnly, setIssuesOnly] = React9.useState(false);
1007
- const handleSearchChange = useCallback2((event) => {
1008
- event.preventDefault();
1009
- setSearchFilter(event.target.value);
1010
- }, []);
1011
- const restartAllTasks = () => {
1012
- void cloudpack.restartAllTasks.mutate();
1013
- };
1014
- const toggleIssuesOnly = () => setIssuesOnly((value3) => !value3);
1015
- return /* @__PURE__ */ React9.createElement(
1016
- Dialog,
1017
- {
1018
- title: "Task results",
1019
- id: elementIds.statusDialogRoot,
1020
- draggable: true,
1021
- onClose,
1022
- commands: [
1023
- /* @__PURE__ */ React9.createElement(Button, { primary: true, onClick: restartAllTasks, key: "restart" }, "Restart all tasks"),
1024
- /* @__PURE__ */ React9.createElement(Button, { onClick: toggleIssuesOnly, key: "issues" }, issuesOnly ? "Show all tasks" : "Show tasks with issues")
1025
- ]
1026
- },
1027
- /* @__PURE__ */ React9.createElement(Searchbox, { value: searchFilter, onChange: handleSearchChange }),
1028
- /* @__PURE__ */ React9.createElement(TaskList, { searchFilter, issuesOnly })
1029
- );
1030
- }
1031
-
1032
- // packages/overlay/src/components/ErrorDialog/ErrorDialog.tsx
1033
- import { default as React11 } from "react";
1034
-
1035
- // packages/overlay/src/components/ErrorDialog/PathError.tsx
1036
- import React10 from "react";
1037
- import { default as cx3 } from "classnames";
1038
- function PathError(props) {
1039
- const [showContent, setshowContent] = React10.useState(false);
1040
- const { packageName, importPath, issuerUrl, fixable } = props;
1041
- const cloudpack = useCloudpack();
1042
- const editConfig = () => {
1043
- void cloudpack.openConfigEditor.mutate();
1044
- };
1045
- const addOverride = () => {
1046
- void cloudpack.addPackageOverride.mutate({ packageName, importPath, issuerUrl });
1047
- };
1048
- return /* @__PURE__ */ React10.createElement("div", { className: TaskStatus_default.root }, /* @__PURE__ */ React10.createElement("div", { className: cx3(TaskStatus_default.header, TaskStatus_default.error) }, /* @__PURE__ */ React10.createElement(
1049
- "button",
1050
- {
1051
- className: TaskStatus_default.expandButton,
1052
- onClick: () => setshowContent(!showContent),
1053
- "aria-label": showContent ? `Minimize ${packageName}/${importPath}` : `Expand ${packageName}/${importPath}`
1054
- },
1055
- /* @__PURE__ */ React10.createElement(
1056
- "img",
1057
- {
1058
- className: cx3(TaskStatus_default.expandIcon, !showContent && TaskStatus_default.collapsed),
1059
- src: chevrondown_20_inline_default,
1060
- alt: "Chevron down icon"
1061
- }
1062
- )
1063
- ), /* @__PURE__ */ React10.createElement("img", { className: TaskStatus_default.errorIcon, src: error_24_inline_default, alt: "Error icon" }), /* @__PURE__ */ React10.createElement("div", { className: TaskStatus_default.title }, `${packageName}/${importPath}`)), showContent && /* @__PURE__ */ React10.createElement(React10.Fragment, null, /* @__PURE__ */ React10.createElement("div", { className: TaskStatus_default.commands }, fixable && /* @__PURE__ */ React10.createElement(Button, { onClick: addOverride }, "Add override"), /* @__PURE__ */ React10.createElement(Button, { onClick: editConfig }, "Edit config file")), /* @__PURE__ */ React10.createElement("div", { className: TaskStatus_default.content }, /* @__PURE__ */ React10.createElement("div", { className: TaskStatus_default.title }, "Details"), /* @__PURE__ */ React10.createElement("div", { className: TaskStatus_default.nameValueArea }, /* @__PURE__ */ React10.createElement("div", { className: TaskStatus_default.name }, "Problem"), /* @__PURE__ */ React10.createElement("div", { className: TaskStatus_default.value }, importPath === "." ? `An unrecognized package "${packageName}" was imported.` : `Path "${importPath}" was imported from package "${packageName}" but was not recognized as an exported path.`)), /* @__PURE__ */ React10.createElement("div", { className: TaskStatus_default.nameValueArea }, /* @__PURE__ */ React10.createElement("div", { className: TaskStatus_default.name }, "Solution"), /* @__PURE__ */ React10.createElement("div", { className: TaskStatus_default.value }, fixable ? `Remove the path from the import in your source. (Import from "${packageName}" rather than "${packageName}/${importPath}")` : importPath === "." ? `Make sure the package name is valid.` : `Import not found on package. Make sure the import path is valid.`)))));
1064
- }
1065
-
1066
- // packages/overlay/src/components/ErrorDialog/ErrorDialog.tsx
1067
- function ErrorDialog({ unsupported }) {
1068
- const cloudpack = useCloudpack();
1069
- const reload = () => {
1070
- void cloudpack.restartAllTasks.mutate();
1071
- };
1072
- return /* @__PURE__ */ React11.createElement(
1073
- Dialog,
1074
- {
1075
- title: "Found unsupported paths in your project",
1076
- id: elementIds.errorDialogRoot,
1077
- style: "error",
1078
- commands: [
1079
- /* @__PURE__ */ React11.createElement(Button, { primary: true, onClick: reload, key: "1" }, "Restart all tasks")
1080
- ]
1081
- },
1082
- /* @__PURE__ */ React11.createElement("div", { className: TaskList_default.root }, unsupported.map((data, index) => /* @__PURE__ */ React11.createElement(PathError, { ...data, key: index })))
1083
- );
1084
- }
1085
-
1086
281
  // packages/overlay/src/components/ErrorDialog/useErrorEvents.ts
1087
- import { useEffect as useEffect4, useState as useState5 } from "react";
282
+ import { useEffect as useEffect2, useState as useState3 } from "react";
1088
283
  import { parseImportString } from "@ms-cloudpack/path-string-parsing";
1089
284
  import { errorEntrySource } from "@ms-cloudpack/api-server/browser";
1090
285
  var reasonIsRecord = (event) => {
@@ -1094,9 +289,9 @@ var hasMessage = (event) => {
1094
289
  return reasonIsRecord(event) && typeof event.reason.message === "string";
1095
290
  };
1096
291
  var useErrorEvents = () => {
1097
- const [errorEvents, setErrorEvents] = useState5({ unsupported: [] });
292
+ const [errorEvents, setErrorEvents] = useState3({ unsupported: [] });
1098
293
  const cloudpack = useCloudpack();
1099
- useEffect4(() => {
294
+ useEffect2(() => {
1100
295
  const handleUnsupportedError = (message, issuerUrl) => {
1101
296
  const errorRegex = /[Mm]odule specifier,? ['"](.*?)['"]/;
1102
297
  const match = message.match(errorRegex);
@@ -1127,14 +322,14 @@ var useErrorEvents = () => {
1127
322
  window.addEventListener("error", (event) => {
1128
323
  handleUnsupportedError(event.message, event.filename);
1129
324
  });
1130
- for (const error3 of pageErrors.uncaughtErrors) {
1131
- handleUnsupportedError(error3.message, error3.filename);
325
+ for (const error2 of pageErrors.uncaughtErrors) {
326
+ handleUnsupportedError(error2.message, error2.filename);
1132
327
  }
1133
328
  window.addEventListener("unhandledrejection", (event) => {
1134
329
  hasMessage(event) && handleUnsupportedError(event.reason.message);
1135
330
  });
1136
- for (const error3 of pageErrors.uncaughtRejections) {
1137
- hasMessage(error3) && handleUnsupportedError(error3.reason.message);
331
+ for (const error2 of pageErrors.uncaughtRejections) {
332
+ hasMessage(error2) && handleUnsupportedError(error2.reason.message);
1138
333
  }
1139
334
  return () => {
1140
335
  subscription.unsubscribe();
@@ -1144,11 +339,11 @@ var useErrorEvents = () => {
1144
339
  };
1145
340
 
1146
341
  // packages/overlay/src/hooks/usePageLoadTimeReporter.ts
1147
- import React12 from "react";
342
+ import React2 from "react";
1148
343
  function usePageLoadTimeReporter() {
1149
- const [pageLoadTime, setPageLoadTime] = React12.useState();
344
+ const [pageLoadTime, setPageLoadTime] = React2.useState();
1150
345
  const cloudpack = useCloudpack();
1151
- React12.useEffect(() => {
346
+ React2.useEffect(() => {
1152
347
  async function reportPageLoadTime() {
1153
348
  const { getPageLoadTime, getBrowserCacheRatio } = window.__cloudpack;
1154
349
  const newPageLoadTime = await getPageLoadTime();
@@ -1162,30 +357,33 @@ function usePageLoadTimeReporter() {
1162
357
  }
1163
358
 
1164
359
  // packages/overlay/src/components/StatusOverlay/StatusOverlay.tsx
360
+ var StatusDialog = React3.lazy(() => import("../chunks/js/StatusDialog-J6LM3XZZ.js"));
361
+ var ErrorDialog = React3.lazy(() => import("../chunks/js/ErrorDialog-744DEKEI.js"));
1165
362
  function StatusOverlay() {
1166
363
  const pageLoadTime = usePageLoadTimeReporter();
1167
- const [isExpanded, setIsExpanded] = useState6(false);
364
+ const [isExpanded, setIsExpanded] = useState4(false);
1168
365
  const status = useStatus();
1169
- const prevStatus = useRef3();
366
+ const prevStatus = useRef2();
1170
367
  const { unsupported } = useErrorEvents();
1171
- React13.useEffect(() => {
368
+ React3.useEffect(() => {
1172
369
  if (!isExpanded && prevStatus.current?.status !== "idle" && status.status === "idle" && (prevStatus.current?.totalErrors || 0) !== (status.totalErrors || 0)) {
1173
370
  setIsExpanded(true);
1174
371
  }
1175
372
  prevStatus.current = status;
1176
373
  }, [status, isExpanded]);
1177
- const toggleMinimized = useCallback3(() => {
374
+ const toggleMinimized = useCallback2(() => {
1178
375
  console.log(`Toggling minimized state to ${!isExpanded}`);
1179
376
  setIsExpanded(!isExpanded);
1180
377
  }, [isExpanded]);
1181
- return unsupported.length ? /* @__PURE__ */ React13.createElement(ErrorDialog, { unsupported }) : isExpanded ? /* @__PURE__ */ React13.createElement(StatusDialog, { onClose: toggleMinimized }) : /* @__PURE__ */ React13.createElement(StatusBadge, { onExpand: toggleMinimized, pageLoadTime });
378
+ const result = unsupported.length ? /* @__PURE__ */ React3.createElement(ErrorDialog, { unsupported }) : isExpanded ? /* @__PURE__ */ React3.createElement(StatusDialog, { onClose: toggleMinimized }) : /* @__PURE__ */ React3.createElement(StatusBadge, { onExpand: toggleMinimized, pageLoadTime });
379
+ return /* @__PURE__ */ React3.createElement(React3.Suspense, { fallback: null }, result);
1182
380
  }
1183
381
 
1184
382
  // packages/overlay/src/components/ThemeProvider/ThemeProvider.tsx
1185
- import React14 from "react";
383
+ import React4 from "react";
1186
384
 
1187
385
  // packages/overlay/src/components/ThemeProvider/ThemeProvider.module.css
1188
- var compiledModule8 = `.ASWLkl-ThemeProvidermodule--root {
386
+ var compiledModule2 = `.ASWLkl-ThemeProvidermodule--root {
1189
387
  font-family:
1190
388
  Inter,
1191
389
  -apple-system,
@@ -1201,16 +399,16 @@ var compiledModule8 = `.ASWLkl-ThemeProvidermodule--root {
1201
399
  sans-serif;
1202
400
  }
1203
401
  `;
1204
- var s8 = document.createElement("style");
1205
- s8.setAttribute("data-sourceFile", "packages/overlay/src/components/ThemeProvider/ThemeProvider.module.css");
1206
- s8.appendChild(document.createTextNode(compiledModule8));
1207
- document.head.appendChild(s8);
1208
- var root4 = "ASWLkl-ThemeProvidermodule--root";
1209
- var ThemeProvider_default = { root: root4 };
402
+ var s2 = document.createElement("style");
403
+ s2.setAttribute("data-sourceFile", "packages/overlay/src/components/ThemeProvider/ThemeProvider.module.css");
404
+ s2.appendChild(document.createTextNode(compiledModule2));
405
+ document.head.appendChild(s2);
406
+ var root = "ASWLkl-ThemeProvidermodule--root";
407
+ var ThemeProvider_default = { root };
1210
408
 
1211
409
  // packages/overlay/src/components/ThemeProvider/ThemeProvider.tsx
1212
410
  function ThemeProvider({ children }) {
1213
- return /* @__PURE__ */ React14.createElement("div", { className: ThemeProvider_default.root }, children);
411
+ return /* @__PURE__ */ React4.createElement("div", { className: ThemeProvider_default.root }, children);
1214
412
  }
1215
413
 
1216
414
  // packages/overlay/src/index.tsx
@@ -1218,11 +416,11 @@ import { createCloudpackClient, reloadCountSource } from "@ms-cloudpack/api-serv
1218
416
 
1219
417
  // packages/overlay/src/components/CloudpackProvider/getCookies.ts
1220
418
  function getCookies() {
1221
- return document.cookie.split(";").map((s9) => s9.split("=")).reduce((current, nextValue) => {
1222
- const name2 = nextValue[0]?.trim();
1223
- const value3 = decodeURIComponent(nextValue[1]?.trim());
1224
- if (name2 && value3) {
1225
- current[name2] = value3;
419
+ return document.cookie.split(";").map((s3) => s3.split("=")).reduce((current, nextValue) => {
420
+ const name = nextValue[0]?.trim();
421
+ const value2 = decodeURIComponent(nextValue[1]?.trim());
422
+ if (name && value2) {
423
+ current[name] = value2;
1226
424
  }
1227
425
  return current;
1228
426
  }, {});
@@ -1248,7 +446,7 @@ async function start() {
1248
446
  const rootDiv = document.createElement("div");
1249
447
  rootDiv.id = elementIds.root;
1250
448
  ReactDOM.render(
1251
- /* @__PURE__ */ React15.createElement(ThemeProvider, null, /* @__PURE__ */ React15.createElement(CloudpackProvider, { client }, /* @__PURE__ */ React15.createElement(StatusOverlay, null))),
449
+ /* @__PURE__ */ React5.createElement(ThemeProvider, null, /* @__PURE__ */ React5.createElement(CloudpackProvider, { client }, /* @__PURE__ */ React5.createElement(StatusOverlay, null))),
1252
450
  rootDiv
1253
451
  );
1254
452
  document.body.appendChild(rootDiv);