@ms-cloudpack/overlay 0.11.0 → 0.11.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.json CHANGED
@@ -2,7 +2,45 @@
2
2
  "name": "@ms-cloudpack/overlay",
3
3
  "entries": [
4
4
  {
5
- "date": "Thu, 01 Dec 2022 08:10:30 GMT",
5
+ "date": "Sun, 04 Dec 2022 08:11:24 GMT",
6
+ "tag": "@ms-cloudpack/overlay_v0.11.2",
7
+ "version": "0.11.2",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "elcraig@microsoft.com",
12
+ "package": "@ms-cloudpack/overlay",
13
+ "commit": "7672998c2474fc5f82ce6c9055092a41d2675172",
14
+ "comment": "Fix dragging the status badge"
15
+ }
16
+ ]
17
+ }
18
+ },
19
+ {
20
+ "date": "Sat, 03 Dec 2022 08:10:45 GMT",
21
+ "tag": "@ms-cloudpack/overlay_v0.11.1",
22
+ "version": "0.11.1",
23
+ "comments": {
24
+ "none": [
25
+ {
26
+ "author": "dake.3601@gmail.com",
27
+ "package": "@ms-cloudpack/overlay",
28
+ "commit": "9fae6cbdb788baac8236abc9eb44eb1d3296b7e0",
29
+ "comment": "Updated beachball config to disallow major bumps"
30
+ }
31
+ ],
32
+ "patch": [
33
+ {
34
+ "author": "elcraig@microsoft.com",
35
+ "package": "@ms-cloudpack/overlay",
36
+ "commit": "d22dff84546bf87d94a59fac03695df0ce231de9",
37
+ "comment": "Minor React pattern fixes and status badge styling improvements"
38
+ }
39
+ ]
40
+ }
41
+ },
42
+ {
43
+ "date": "Thu, 01 Dec 2022 08:10:47 GMT",
6
44
  "tag": "@ms-cloudpack/overlay_v0.11.0",
7
45
  "version": "0.11.0",
8
46
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,28 @@
1
1
  # Change Log - @ms-cloudpack/overlay
2
2
 
3
- This log was last generated on Thu, 01 Dec 2022 08:10:30 GMT and should not be manually modified.
3
+ This log was last generated on Sun, 04 Dec 2022 08:11:24 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 0.11.2
8
+
9
+ Sun, 04 Dec 2022 08:11:24 GMT
10
+
11
+ ### Patches
12
+
13
+ - Fix dragging the status badge (elcraig@microsoft.com)
14
+
15
+ ## 0.11.1
16
+
17
+ Sat, 03 Dec 2022 08:10:45 GMT
18
+
19
+ ### Patches
20
+
21
+ - Minor React pattern fixes and status badge styling improvements (elcraig@microsoft.com)
22
+
7
23
  ## 0.11.0
8
24
 
9
- Thu, 01 Dec 2022 08:10:30 GMT
25
+ Thu, 01 Dec 2022 08:10:47 GMT
10
26
 
11
27
  ### Minor changes
12
28
 
package/dist/lib/index.js CHANGED
@@ -187,48 +187,48 @@ import React2, { useRef } from "react";
187
187
 
188
188
  // src/hooks/useDraggable.ts
189
189
  import { useEffect, useState as useState2 } from "react";
190
- function useDraggable(containerElementRef, dragElementRef = containerElementRef) {
190
+ function useDraggable(options) {
191
+ const { enabled, containerElementRef, dragElementRef } = options;
191
192
  const [isDragging, setIsDragging] = useState2(false);
192
193
  useEffect(() => {
193
- if (containerElementRef && dragElementRef) {
194
- const moveTarget = containerElementRef.current;
195
- const dragTarget = dragElementRef.current;
196
- if (moveTarget && dragTarget) {
197
- let originalX = 0;
198
- let originalY = 0;
199
- let offset = { x: 0, y: 0 };
200
- const onPointerMove = (event) => {
201
- moveTarget.style.transform = `translate(${offset.x + event.clientX - originalX}px, ${offset.y + event.clientY - originalY}px)`;
202
- };
203
- const onPointerUp = (event) => {
204
- setIsDragging(false);
205
- offset = {
206
- x: offset.x + event.clientX - originalX,
207
- y: offset.y + event.clientY - originalY
208
- };
209
- dragTarget.releasePointerCapture(event.pointerId);
210
- dragTarget.removeEventListener("pointerup", onPointerUp);
211
- dragTarget.removeEventListener("pointermove", onPointerMove);
212
- event.preventDefault();
213
- };
214
- const onPointerDown = (event) => {
215
- setIsDragging(true);
216
- originalX = event.clientX;
217
- originalY = event.clientY;
218
- dragTarget.setPointerCapture(event.pointerId);
219
- dragTarget.addEventListener("pointerup", onPointerUp);
220
- dragTarget.addEventListener("pointermove", onPointerMove);
221
- event.preventDefault();
222
- };
223
- dragTarget.addEventListener("pointerdown", onPointerDown);
224
- return () => {
225
- dragTarget.removeEventListener("pointerdown", onPointerDown);
226
- dragTarget.removeEventListener("pointermove", onPointerMove);
227
- dragTarget.removeEventListener("pointerup", onPointerUp);
228
- };
229
- }
194
+ const moveTarget = containerElementRef?.current;
195
+ const dragTarget = dragElementRef?.current;
196
+ if (!enabled || !moveTarget || !dragTarget) {
197
+ return;
230
198
  }
231
- }, [containerElementRef, dragElementRef]);
199
+ let originalX = 0;
200
+ let originalY = 0;
201
+ let offset = { x: 0, y: 0 };
202
+ const onPointerMove = (event) => {
203
+ moveTarget.style.transform = `translate(${offset.x + event.clientX - originalX}px, ${offset.y + event.clientY - originalY}px)`;
204
+ };
205
+ const onPointerUp = (event) => {
206
+ setIsDragging(false);
207
+ offset = {
208
+ x: offset.x + event.clientX - originalX,
209
+ y: offset.y + event.clientY - originalY
210
+ };
211
+ dragTarget.releasePointerCapture(event.pointerId);
212
+ dragTarget.removeEventListener("pointerup", onPointerUp);
213
+ dragTarget.removeEventListener("pointermove", onPointerMove);
214
+ event.preventDefault();
215
+ };
216
+ const onPointerDown = (event) => {
217
+ setIsDragging(true);
218
+ originalX = event.clientX;
219
+ originalY = event.clientY;
220
+ dragTarget.setPointerCapture(event.pointerId);
221
+ dragTarget.addEventListener("pointerup", onPointerUp);
222
+ dragTarget.addEventListener("pointermove", onPointerMove);
223
+ event.preventDefault();
224
+ };
225
+ dragTarget.addEventListener("pointerdown", onPointerDown);
226
+ return () => {
227
+ dragTarget.removeEventListener("pointerdown", onPointerDown);
228
+ dragTarget.removeEventListener("pointermove", onPointerMove);
229
+ dragTarget.removeEventListener("pointerup", onPointerUp);
230
+ };
231
+ }, [enabled, containerElementRef, dragElementRef]);
232
232
  return {
233
233
  isDragging
234
234
  };
@@ -254,6 +254,7 @@ var compiledModule = `.mOWPxtXY-StatusBadgemodulecssfixedOverlay {
254
254
  height: 100%;
255
255
  width: 12px;
256
256
  cursor: move;
257
+ margin-right: -4px;
257
258
  }
258
259
 
259
260
  .mOWPxtXY-StatusBadgemodulecssgrip {
@@ -268,13 +269,12 @@ var compiledModule = `.mOWPxtXY-StatusBadgemodulecssfixedOverlay {
268
269
  }
269
270
 
270
271
  .mOWPxtXY-StatusBadgemodulecssbadge {
271
- cursor: default;
272
272
  position: absolute;
273
273
  bottom: 4px;
274
274
  right: 4px;
275
275
  font-size: 12px;
276
276
  display: inline-flex;
277
- gap: 4px;
277
+ gap: 8px;
278
278
  background: #dddddd;
279
279
  box-shadow: 0 0 12px -6px rgba(0, 0, 0, 0.75);
280
280
  border: 1px solid #999999;
@@ -284,7 +284,8 @@ var compiledModule = `.mOWPxtXY-StatusBadgemodulecssfixedOverlay {
284
284
  justify-content: center;
285
285
  align-items: center;
286
286
  box-sizing: border-box;
287
- padding: 2px;
287
+ padding: 3px;
288
+ padding-right: 8px;
288
289
 
289
290
  transition: background-color 0.2s ease-in-out;
290
291
  }
@@ -297,6 +298,7 @@ var compiledModule = `.mOWPxtXY-StatusBadgemodulecssfixedOverlay {
297
298
  top: auto;
298
299
  left: auto;
299
300
  box-shadow: none;
301
+ padding-left: 8px;
300
302
  }
301
303
 
302
304
  .mOWPxtXY-StatusBadgemodulecssbuilding {
@@ -320,6 +322,7 @@ var compiledModule = `.mOWPxtXY-StatusBadgemodulecssfixedOverlay {
320
322
  }
321
323
 
322
324
  .mOWPxtXY-StatusBadgemodulecssbutton {
325
+ cursor: pointer;
323
326
  background: inherit;
324
327
  border: none;
325
328
  border-radius: 3px;
@@ -391,15 +394,20 @@ function StatusBadge({ inline: inline2, onExpand }) {
391
394
  const rootElementRef = useRef(null);
392
395
  const dragElementRef = useRef(null);
393
396
  const status = useStatus();
394
- useDraggable(rootElementRef, dragElementRef);
395
- if (status.status === "unknown") {
397
+ const shouldRender = status.status !== "unknown";
398
+ useDraggable({
399
+ enabled: shouldRender && !inline2,
400
+ containerElementRef: rootElementRef,
401
+ dragElementRef
402
+ });
403
+ if (!shouldRender) {
396
404
  return null;
397
405
  }
398
406
  const badge2 = /* @__PURE__ */ React2.createElement("div", {
399
- ref: inline2 ? void 0 : rootElementRef,
407
+ ref: rootElementRef,
400
408
  className: getStatusClassName(status, !!inline2)
401
409
  }, !inline2 && /* @__PURE__ */ React2.createElement("div", {
402
- ref: inline2 ? void 0 : dragElementRef,
410
+ ref: dragElementRef,
403
411
  className: StatusBadge_module_default.gripArea
404
412
  }, /* @__PURE__ */ React2.createElement("div", {
405
413
  className: StatusBadge_module_default.grip
@@ -427,26 +435,26 @@ function getStatusString(status) {
427
435
  }
428
436
  return status.totalErrors === 0 ? "Success" : "Errors";
429
437
  }
430
- function getStatusClassName(status, inline2) {
438
+ function getStatusClassName({ status, totalTasks, totalErrors, totalWarnings }, inline2) {
431
439
  return cx(StatusBadge_module_default.badge, {
432
440
  [StatusBadge_module_default.inline]: inline2,
433
- [StatusBadge_module_default.building]: status.status === "pending",
434
- [StatusBadge_module_default.success]: status.status === "idle" && status.totalTasks > 0 && status.totalErrors === 0 && status.totalWarnings === 0,
435
- [StatusBadge_module_default.error]: status.status === "idle" && status.totalErrors > 0,
436
- [StatusBadge_module_default.warning]: status.status === "idle" && status.totalErrors === 0 && status.totalWarnings > 0
441
+ [StatusBadge_module_default.building]: status === "pending",
442
+ [StatusBadge_module_default.success]: status === "idle" && totalTasks > 0 && totalErrors === 0 && totalWarnings === 0,
443
+ [StatusBadge_module_default.error]: status === "idle" && totalErrors > 0,
444
+ [StatusBadge_module_default.warning]: status === "idle" && totalErrors === 0 && totalWarnings > 0
437
445
  });
438
446
  }
439
- function getStatsString(status) {
440
- if (status.totalTasks === 0) {
447
+ function getStatsString({ totalTasks, remainingTasks, totalErrors, totalWarnings }) {
448
+ if (totalTasks === 0) {
441
449
  return "";
442
450
  }
443
451
  return [
444
- status.remainingTasks > 0 && `${status.remainingTasks} of ${status.totalTasks} tasks pending`,
445
- status.remainingTasks === 0 && `${status.totalTasks} tasks completed`,
446
- status.totalErrors === 1 && `${status.totalErrors} error`,
447
- status.totalErrors > 1 && `${status.totalErrors} errors`,
448
- status.totalWarnings === 1 && `${status.totalWarnings} warning`,
449
- status.totalWarnings > 1 && `${status.totalWarnings} warnings`
452
+ remainingTasks > 0 && `${remainingTasks} of ${totalTasks} tasks pending`,
453
+ remainingTasks === 0 && `${totalTasks} tasks completed`,
454
+ totalErrors === 1 && `${totalErrors} error`,
455
+ totalErrors > 1 && `${totalErrors} errors`,
456
+ totalWarnings === 1 && `${totalWarnings} warning`,
457
+ totalWarnings > 1 && `${totalWarnings} warnings`
450
458
  ].filter(Boolean).join(", ");
451
459
  }
452
460
 
@@ -1112,7 +1120,11 @@ function Dialog({ title: title3, style, draggable, onClose, commands: commands3,
1112
1120
  const draggableTargetRef = useRef2(null);
1113
1121
  const colorAccent = style === "error" ? "rgb(164, 38, 44)" : void 0;
1114
1122
  const cursorDraggable = draggable ? "move" : void 0;
1115
- useDraggable(draggable ? draggableRef : void 0, draggable ? draggableTargetRef : void 0);
1123
+ useDraggable({
1124
+ enabled: !!draggable,
1125
+ containerElementRef: draggableRef,
1126
+ dragElementRef: draggableTargetRef
1127
+ });
1116
1128
  return /* @__PURE__ */ React7.createElement("div", {
1117
1129
  className: Dialog_module_default.overlay
1118
1130
  }, /* @__PURE__ */ React7.createElement("div", {
@@ -1125,14 +1137,14 @@ function Dialog({ title: title3, style, draggable, onClose, commands: commands3,
1125
1137
  ref: draggableTargetRef,
1126
1138
  className: Dialog_module_default.title,
1127
1139
  style: { color: colorAccent, cursor: cursorDraggable }
1128
- }, title3), !!onClose && /* @__PURE__ */ React7.createElement("button", {
1140
+ }, title3), onClose && /* @__PURE__ */ React7.createElement("button", {
1129
1141
  className: Dialog_module_default.closeButton,
1130
1142
  onClick: onClose,
1131
1143
  "aria-label": "Minimize overlay"
1132
1144
  }, /* @__PURE__ */ React7.createElement("img", {
1133
1145
  src: dismiss_16_filled_inline_default,
1134
- alt: "Close icon"
1135
- }))), !!commands3 && /* @__PURE__ */ React7.createElement("div", {
1146
+ alt: ""
1147
+ }))), commands3 && /* @__PURE__ */ React7.createElement("div", {
1136
1148
  className: Dialog_module_default.commands
1137
1149
  }, ...commands3), children));
1138
1150
  }
@@ -1349,23 +1361,25 @@ var useErrorEvents = () => {
1349
1361
  function StatusOverlay() {
1350
1362
  const [isExpanded, setIsExpanded] = useState6(false);
1351
1363
  const status = useStatus();
1352
- const internal = useRef3();
1364
+ const prevStatus = useRef3();
1353
1365
  const { unsupported } = useErrorEvents();
1354
- if (isExpanded === false && internal.current?.status !== "idle" && status.status === "idle" && internal.current?.totalErrors != status.totalErrors) {
1355
- setIsExpanded(true);
1356
- }
1357
- internal.current = status;
1366
+ React12.useEffect(() => {
1367
+ if (!isExpanded && prevStatus.current?.status !== "idle" && status.status === "idle" && (prevStatus.current?.totalErrors || 0) !== (status.totalErrors || 0)) {
1368
+ setIsExpanded(true);
1369
+ }
1370
+ prevStatus.current = status;
1371
+ }, [status, isExpanded]);
1358
1372
  const toggleMinimized = useCallback2(() => {
1359
1373
  console.log(`Toggling minimized state to ${!isExpanded}`);
1360
1374
  setIsExpanded(!isExpanded);
1361
- }, [isExpanded, setIsExpanded]);
1362
- return /* @__PURE__ */ React12.createElement("div", null, !!unsupported.length && /* @__PURE__ */ React12.createElement(ErrorDialog, {
1375
+ }, [isExpanded]);
1376
+ return unsupported.length ? /* @__PURE__ */ React12.createElement(ErrorDialog, {
1363
1377
  unsupported
1364
- }), !unsupported.length && !isExpanded && /* @__PURE__ */ React12.createElement(StatusBadge, {
1365
- onExpand: toggleMinimized
1366
- }), !unsupported.length && isExpanded && /* @__PURE__ */ React12.createElement(StatusDialog, {
1378
+ }) : isExpanded ? /* @__PURE__ */ React12.createElement(StatusDialog, {
1367
1379
  onClose: toggleMinimized
1368
- }));
1380
+ }) : /* @__PURE__ */ React12.createElement(StatusBadge, {
1381
+ onExpand: toggleMinimized
1382
+ });
1369
1383
  }
1370
1384
 
1371
1385
  // src/components/ThemeProvider/ThemeProvider.tsx
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "type": "buildStatus",
3
- "buildId": "d151bd63-77c2-44ad-9778-d8bd802fde98",
3
+ "buildId": "2e17f0c7-5f64-4c0a-b47e-57d7fa2affe7",
4
4
  "buildStatus": "complete",
5
5
  "internalError": null,
6
6
  "warnings": [],
@@ -8,5 +8,5 @@
8
8
  "outputFilePaths": [
9
9
  "/home/runner/work/cloudpack/cloudpack/packages/overlay/dist/lib/index.js"
10
10
  ],
11
- "metafile": "{\n \"inputs\": {\n \"src/components/CloudpackProvider/getCookies.ts\": {\n \"bytes\": 452,\n \"imports\": []\n },\n \"src/components/CloudpackProvider/createCloudpackClient.ts\": {\n \"bytes\": 6293,\n \"imports\": [\n {\n \"path\": \"src/components/CloudpackProvider/getCookies.ts\",\n \"kind\": \"import-statement\"\n }\n ]\n },\n \"src/components/CloudpackProvider/CloudpackProvider.tsx\": {\n \"bytes\": 552,\n \"imports\": [\n {\n \"path\": \"src/components/CloudpackProvider/createCloudpackClient.ts\",\n \"kind\": \"import-statement\"\n }\n ]\n },\n \"src/hooks/useDraggable.ts\": {\n \"bytes\": 2050,\n \"imports\": []\n },\n \"src/components/StatusBadge/StatusBadge.module.css\": {\n \"bytes\": 3405,\n \"imports\": []\n },\n \"src/components/CloudpackProvider/useStatus.ts\": {\n \"bytes\": 866,\n \"imports\": [\n {\n \"path\": \"src/components/CloudpackProvider/CloudpackProvider.tsx\",\n \"kind\": \"import-statement\"\n }\n ]\n },\n \"src/components/StatusBadge/StatusBadge.tsx\": {\n \"bytes\": 2733,\n \"imports\": [\n {\n \"path\": \"src/hooks/useDraggable.ts\",\n \"kind\": \"import-statement\"\n },\n {\n \"path\": \"src/components/StatusBadge/StatusBadge.module.css\",\n \"kind\": \"import-statement\"\n },\n {\n \"path\": \"src/components/CloudpackProvider/useStatus.ts\",\n \"kind\": \"import-statement\"\n }\n ]\n },\n \"src/components/StatusDialog/TaskResultItem.module.css\": {\n \"bytes\": 2067,\n \"imports\": []\n },\n \"src/components/StatusDialog/TaskResultItem.tsx\": {\n \"bytes\": 1433,\n \"imports\": [\n {\n \"path\": \"src/components/CloudpackProvider/CloudpackProvider.tsx\",\n \"kind\": \"import-statement\"\n },\n {\n \"path\": \"src/components/StatusDialog/TaskResultItem.module.css\",\n \"kind\": \"import-statement\"\n }\n ]\n },\n \"src/components/StatusDialog/TaskStatus.module.css\": {\n \"bytes\": 4179,\n \"imports\": []\n },\n \"src/images/error-24.inline.svg\": {\n \"bytes\": 1024,\n \"imports\": []\n },\n \"src/images/success-24.inline.svg\": {\n \"bytes\": 562,\n \"imports\": []\n },\n \"src/images/chevrondown-20.inline.svg\": {\n \"bytes\": 450,\n \"imports\": []\n },\n \"src/components/Button/Button.module.css\": {\n \"bytes\": 2263,\n \"imports\": []\n },\n \"src/components/Button/Button.tsx\": {\n \"bytes\": 360,\n \"imports\": [\n {\n \"path\": \"src/components/Button/Button.module.css\",\n \"kind\": \"import-statement\"\n }\n ]\n },\n \"src/components/StatusDialog/TaskStatus.tsx\": {\n \"bytes\": 4795,\n \"imports\": [\n {\n \"path\": \"src/components/StatusDialog/TaskResultItem.tsx\",\n \"kind\": \"import-statement\"\n },\n {\n \"path\": \"src/components/StatusDialog/TaskStatus.module.css\",\n \"kind\": \"import-statement\"\n },\n {\n \"path\": \"src/images/error-24.inline.svg\",\n \"kind\": \"import-statement\"\n },\n {\n \"path\": \"src/images/success-24.inline.svg\",\n \"kind\": \"import-statement\"\n },\n {\n \"path\": \"src/images/chevrondown-20.inline.svg\",\n \"kind\": \"import-statement\"\n },\n {\n \"path\": \"src/components/CloudpackProvider/CloudpackProvider.tsx\",\n \"kind\": \"import-statement\"\n },\n {\n \"path\": \"src/components/Button/Button.tsx\",\n \"kind\": \"import-statement\"\n }\n ]\n },\n \"src/components/CloudpackProvider/useStatusDetails.ts\": {\n \"bytes\": 858,\n \"imports\": [\n {\n \"path\": \"src/components/CloudpackProvider/CloudpackProvider.tsx\",\n \"kind\": \"import-statement\"\n }\n ]\n },\n \"src/components/StatusDialog/TaskList.module.css\": {\n \"bytes\": 615,\n \"imports\": []\n },\n \"src/components/StatusDialog/TaskList.tsx\": {\n \"bytes\": 1204,\n \"imports\": [\n {\n \"path\": \"src/components/StatusDialog/TaskStatus.tsx\",\n \"kind\": \"import-statement\"\n },\n {\n \"path\": \"src/components/CloudpackProvider/useStatusDetails.ts\",\n \"kind\": \"import-statement\"\n },\n {\n \"path\": \"src/components/StatusDialog/TaskList.module.css\",\n \"kind\": \"import-statement\"\n }\n ]\n },\n \"src/components/Dialog/Dialog.module.css\": {\n \"bytes\": 2454,\n \"imports\": []\n },\n \"src/images/dismiss-16-filled.inline.svg\": {\n \"bytes\": 718,\n \"imports\": []\n },\n \"src/components/Dialog/Dialog.tsx\": {\n \"bytes\": 1672,\n \"imports\": [\n {\n \"path\": \"src/components/Dialog/Dialog.module.css\",\n \"kind\": \"import-statement\"\n },\n {\n \"path\": \"src/hooks/useDraggable.ts\",\n \"kind\": \"import-statement\"\n },\n {\n \"path\": \"src/images/dismiss-16-filled.inline.svg\",\n \"kind\": \"import-statement\"\n }\n ]\n },\n \"src/components/StatusDialog/Searchbox.module.css\": {\n \"bytes\": 862,\n \"imports\": []\n },\n \"src/components/StatusDialog/Searchbox.tsx\": {\n \"bytes\": 452,\n \"imports\": [\n {\n \"path\": \"src/components/StatusDialog/Searchbox.module.css\",\n \"kind\": \"import-statement\"\n }\n ]\n },\n \"src/components/StatusDialog/StatusDialog.tsx\": {\n \"bytes\": 1134,\n \"imports\": [\n {\n \"path\": \"src/components/StatusDialog/TaskList.tsx\",\n \"kind\": \"import-statement\"\n },\n {\n \"path\": \"src/components/CloudpackProvider/CloudpackProvider.tsx\",\n \"kind\": \"import-statement\"\n },\n {\n \"path\": \"src/components/Button/Button.tsx\",\n \"kind\": \"import-statement\"\n },\n {\n \"path\": \"src/components/Dialog/Dialog.tsx\",\n \"kind\": \"import-statement\"\n },\n {\n \"path\": \"src/components/StatusDialog/Searchbox.tsx\",\n \"kind\": \"import-statement\"\n }\n ]\n },\n \"src/components/ErrorDialog/PathError.tsx\": {\n \"bytes\": 2731,\n \"imports\": [\n {\n \"path\": \"src/components/StatusDialog/TaskStatus.module.css\",\n \"kind\": \"import-statement\"\n },\n {\n \"path\": \"src/images/error-24.inline.svg\",\n \"kind\": \"import-statement\"\n },\n {\n \"path\": \"src/images/chevrondown-20.inline.svg\",\n \"kind\": \"import-statement\"\n },\n {\n \"path\": \"src/components/Button/Button.tsx\",\n \"kind\": \"import-statement\"\n },\n {\n \"path\": \"src/components/CloudpackProvider/CloudpackProvider.tsx\",\n \"kind\": \"import-statement\"\n }\n ]\n },\n \"src/components/ErrorDialog/ErrorDialog.tsx\": {\n \"bytes\": 1021,\n \"imports\": [\n {\n \"path\": \"src/components/Button/Button.tsx\",\n \"kind\": \"import-statement\"\n },\n {\n \"path\": \"src/components/CloudpackProvider/CloudpackProvider.tsx\",\n \"kind\": \"import-statement\"\n },\n {\n \"path\": \"src/components/ErrorDialog/PathError.tsx\",\n \"kind\": \"import-statement\"\n },\n {\n \"path\": \"src/components/StatusDialog/TaskList.module.css\",\n \"kind\": \"import-statement\"\n },\n {\n \"path\": \"src/components/Dialog/Dialog.tsx\",\n \"kind\": \"import-statement\"\n }\n ]\n },\n \"src/components/ErrorDialog/useErrorEvents.ts\": {\n \"bytes\": 3264,\n \"imports\": [\n {\n \"path\": \"src/components/CloudpackProvider/CloudpackProvider.tsx\",\n \"kind\": \"import-statement\"\n }\n ]\n },\n \"src/components/StatusOverlay/StatusOverlay.tsx\": {\n \"bytes\": 1437,\n \"imports\": [\n {\n \"path\": \"src/components/StatusBadge/StatusBadge.tsx\",\n \"kind\": \"import-statement\"\n },\n {\n \"path\": \"src/components/StatusDialog/StatusDialog.tsx\",\n \"kind\": \"import-statement\"\n },\n {\n \"path\": \"src/components/CloudpackProvider/useStatus.ts\",\n \"kind\": \"import-statement\"\n },\n {\n \"path\": \"src/components/ErrorDialog/ErrorDialog.tsx\",\n \"kind\": \"import-statement\"\n },\n {\n \"path\": \"src/components/ErrorDialog/useErrorEvents.ts\",\n \"kind\": \"import-statement\"\n }\n ]\n },\n \"src/components/ThemeProvider/ThemeProvider.module.css\": {\n \"bytes\": 630,\n \"imports\": []\n },\n \"src/components/ThemeProvider/ThemeProvider.tsx\": {\n \"bytes\": 210,\n \"imports\": [\n {\n \"path\": \"src/components/ThemeProvider/ThemeProvider.module.css\",\n \"kind\": \"import-statement\"\n }\n ]\n },\n \"src/index.tsx\": {\n \"bytes\": 532,\n \"imports\": [\n {\n \"path\": \"src/components/CloudpackProvider/CloudpackProvider.tsx\",\n \"kind\": \"import-statement\"\n },\n {\n \"path\": \"src/components/StatusOverlay/StatusOverlay.tsx\",\n \"kind\": \"import-statement\"\n },\n {\n \"path\": \"src/components/ThemeProvider/ThemeProvider.tsx\",\n \"kind\": \"import-statement\"\n }\n ]\n }\n },\n \"outputs\": {\n \"dist/lib/index.js\": {\n \"imports\": [],\n \"exports\": [],\n \"entryPoint\": \"src/index.tsx\",\n \"inputs\": {\n \"src/index.tsx\": {\n \"bytesInOutput\": 360\n },\n \"src/components/CloudpackProvider/CloudpackProvider.tsx\": {\n \"bytesInOutput\": 372\n },\n \"src/components/CloudpackProvider/getCookies.ts\": {\n \"bytesInOutput\": 317\n },\n \"src/components/CloudpackProvider/createCloudpackClient.ts\": {\n \"bytesInOutput\": 4112\n },\n \"src/components/StatusOverlay/StatusOverlay.tsx\": {\n \"bytesInOutput\": 1093\n },\n \"src/components/StatusBadge/StatusBadge.tsx\": {\n \"bytesInOutput\": 2863\n },\n \"src/hooks/useDraggable.ts\": {\n \"bytesInOutput\": 1937\n },\n \"src/components/StatusBadge/StatusBadge.module.css\": {\n \"bytesInOutput\": 3118\n },\n \"src/components/CloudpackProvider/useStatus.ts\": {\n \"bytesInOutput\": 448\n },\n \"src/components/StatusDialog/StatusDialog.tsx\": {\n \"bytesInOutput\": 876\n },\n \"src/components/StatusDialog/TaskList.tsx\": {\n \"bytesInOutput\": 898\n },\n \"src/components/StatusDialog/TaskStatus.tsx\": {\n \"bytesInOutput\": 5172\n },\n \"src/components/StatusDialog/TaskResultItem.tsx\": {\n \"bytesInOutput\": 1421\n },\n \"src/components/StatusDialog/TaskResultItem.module.css\": {\n \"bytesInOutput\": 1881\n },\n \"src/components/StatusDialog/TaskStatus.module.css\": {\n \"bytesInOutput\": 3889\n },\n \"src/images/error-24.inline.svg\": {\n \"bytesInOutput\": 1428\n },\n \"src/images/success-24.inline.svg\": {\n \"bytesInOutput\": 814\n },\n \"src/images/chevrondown-20.inline.svg\": {\n \"bytesInOutput\": 666\n },\n \"src/components/Button/Button.tsx\": {\n \"bytesInOutput\": 312\n },\n \"src/components/Button/Button.module.css\": {\n \"bytesInOutput\": 2117\n },\n \"src/components/CloudpackProvider/useStatusDetails.ts\": {\n \"bytesInOutput\": 299\n },\n \"src/components/StatusDialog/TaskList.module.css\": {\n \"bytesInOutput\": 541\n },\n \"src/components/Dialog/Dialog.tsx\": {\n \"bytesInOutput\": 1450\n },\n \"src/components/Dialog/Dialog.module.css\": {\n \"bytesInOutput\": 2292\n },\n \"src/images/dismiss-16-filled.inline.svg\": {\n \"bytesInOutput\": 1029\n },\n \"src/components/StatusDialog/Searchbox.tsx\": {\n \"bytesInOutput\": 362\n },\n \"src/components/StatusDialog/Searchbox.module.css\": {\n \"bytesInOutput\": 771\n },\n \"src/components/ErrorDialog/ErrorDialog.tsx\": {\n \"bytesInOutput\": 709\n },\n \"src/components/ErrorDialog/PathError.tsx\": {\n \"bytesInOutput\": 3043\n },\n \"src/components/ErrorDialog/useErrorEvents.ts\": {\n \"bytesInOutput\": 2092\n },\n \"src/components/ThemeProvider/ThemeProvider.tsx\": {\n \"bytesInOutput\": 191\n },\n \"src/components/ThemeProvider/ThemeProvider.module.css\": {\n \"bytesInOutput\": 561\n }\n },\n \"bytes\": 49615\n }\n }\n}\n"
11
+ "metafile": "{\n \"inputs\": {\n \"src/components/CloudpackProvider/getCookies.ts\": {\n \"bytes\": 452,\n \"imports\": []\n },\n \"src/components/CloudpackProvider/createCloudpackClient.ts\": {\n \"bytes\": 6293,\n \"imports\": [\n {\n \"path\": \"src/components/CloudpackProvider/getCookies.ts\",\n \"kind\": \"import-statement\"\n }\n ]\n },\n \"src/components/CloudpackProvider/CloudpackProvider.tsx\": {\n \"bytes\": 552,\n \"imports\": [\n {\n \"path\": \"src/components/CloudpackProvider/createCloudpackClient.ts\",\n \"kind\": \"import-statement\"\n }\n ]\n },\n \"src/hooks/useDraggable.ts\": {\n \"bytes\": 2353,\n \"imports\": []\n },\n \"src/components/StatusBadge/StatusBadge.module.css\": {\n \"bytes\": 3473,\n \"imports\": []\n },\n \"src/components/CloudpackProvider/useStatus.ts\": {\n \"bytes\": 866,\n \"imports\": [\n {\n \"path\": \"src/components/CloudpackProvider/CloudpackProvider.tsx\",\n \"kind\": \"import-statement\"\n }\n ]\n },\n \"src/components/StatusBadge/StatusBadge.tsx\": {\n \"bytes\": 2875,\n \"imports\": [\n {\n \"path\": \"src/hooks/useDraggable.ts\",\n \"kind\": \"import-statement\"\n },\n {\n \"path\": \"src/components/StatusBadge/StatusBadge.module.css\",\n \"kind\": \"import-statement\"\n },\n {\n \"path\": \"src/components/CloudpackProvider/useStatus.ts\",\n \"kind\": \"import-statement\"\n }\n ]\n },\n \"src/components/StatusDialog/TaskResultItem.module.css\": {\n \"bytes\": 2067,\n \"imports\": []\n },\n \"src/components/StatusDialog/TaskResultItem.tsx\": {\n \"bytes\": 1433,\n \"imports\": [\n {\n \"path\": \"src/components/CloudpackProvider/CloudpackProvider.tsx\",\n \"kind\": \"import-statement\"\n },\n {\n \"path\": \"src/components/StatusDialog/TaskResultItem.module.css\",\n \"kind\": \"import-statement\"\n }\n ]\n },\n \"src/components/StatusDialog/TaskStatus.module.css\": {\n \"bytes\": 4179,\n \"imports\": []\n },\n \"src/images/error-24.inline.svg\": {\n \"bytes\": 1024,\n \"imports\": []\n },\n \"src/images/success-24.inline.svg\": {\n \"bytes\": 562,\n \"imports\": []\n },\n \"src/images/chevrondown-20.inline.svg\": {\n \"bytes\": 450,\n \"imports\": []\n },\n \"src/components/Button/Button.module.css\": {\n \"bytes\": 2263,\n \"imports\": []\n },\n \"src/components/Button/Button.tsx\": {\n \"bytes\": 360,\n \"imports\": [\n {\n \"path\": \"src/components/Button/Button.module.css\",\n \"kind\": \"import-statement\"\n }\n ]\n },\n \"src/components/StatusDialog/TaskStatus.tsx\": {\n \"bytes\": 4795,\n \"imports\": [\n {\n \"path\": \"src/components/StatusDialog/TaskResultItem.tsx\",\n \"kind\": \"import-statement\"\n },\n {\n \"path\": \"src/components/StatusDialog/TaskStatus.module.css\",\n \"kind\": \"import-statement\"\n },\n {\n \"path\": \"src/images/error-24.inline.svg\",\n \"kind\": \"import-statement\"\n },\n {\n \"path\": \"src/images/success-24.inline.svg\",\n \"kind\": \"import-statement\"\n },\n {\n \"path\": \"src/images/chevrondown-20.inline.svg\",\n \"kind\": \"import-statement\"\n },\n {\n \"path\": \"src/components/CloudpackProvider/CloudpackProvider.tsx\",\n \"kind\": \"import-statement\"\n },\n {\n \"path\": \"src/components/Button/Button.tsx\",\n \"kind\": \"import-statement\"\n }\n ]\n },\n \"src/components/CloudpackProvider/useStatusDetails.ts\": {\n \"bytes\": 858,\n \"imports\": [\n {\n \"path\": \"src/components/CloudpackProvider/CloudpackProvider.tsx\",\n \"kind\": \"import-statement\"\n }\n ]\n },\n \"src/components/StatusDialog/TaskList.module.css\": {\n \"bytes\": 615,\n \"imports\": []\n },\n \"src/components/StatusDialog/TaskList.tsx\": {\n \"bytes\": 1204,\n \"imports\": [\n {\n \"path\": \"src/components/StatusDialog/TaskStatus.tsx\",\n \"kind\": \"import-statement\"\n },\n {\n \"path\": \"src/components/CloudpackProvider/useStatusDetails.ts\",\n \"kind\": \"import-statement\"\n },\n {\n \"path\": \"src/components/StatusDialog/TaskList.module.css\",\n \"kind\": \"import-statement\"\n }\n ]\n },\n \"src/components/Dialog/Dialog.module.css\": {\n \"bytes\": 2454,\n \"imports\": []\n },\n \"src/images/dismiss-16-filled.inline.svg\": {\n \"bytes\": 718,\n \"imports\": []\n },\n \"src/components/Dialog/Dialog.tsx\": {\n \"bytes\": 1710,\n \"imports\": [\n {\n \"path\": \"src/components/Dialog/Dialog.module.css\",\n \"kind\": \"import-statement\"\n },\n {\n \"path\": \"src/hooks/useDraggable.ts\",\n \"kind\": \"import-statement\"\n },\n {\n \"path\": \"src/images/dismiss-16-filled.inline.svg\",\n \"kind\": \"import-statement\"\n }\n ]\n },\n \"src/components/StatusDialog/Searchbox.module.css\": {\n \"bytes\": 862,\n \"imports\": []\n },\n \"src/components/StatusDialog/Searchbox.tsx\": {\n \"bytes\": 452,\n \"imports\": [\n {\n \"path\": \"src/components/StatusDialog/Searchbox.module.css\",\n \"kind\": \"import-statement\"\n }\n ]\n },\n \"src/components/StatusDialog/StatusDialog.tsx\": {\n \"bytes\": 1134,\n \"imports\": [\n {\n \"path\": \"src/components/StatusDialog/TaskList.tsx\",\n \"kind\": \"import-statement\"\n },\n {\n \"path\": \"src/components/CloudpackProvider/CloudpackProvider.tsx\",\n \"kind\": \"import-statement\"\n },\n {\n \"path\": \"src/components/Button/Button.tsx\",\n \"kind\": \"import-statement\"\n },\n {\n \"path\": \"src/components/Dialog/Dialog.tsx\",\n \"kind\": \"import-statement\"\n },\n {\n \"path\": \"src/components/StatusDialog/Searchbox.tsx\",\n \"kind\": \"import-statement\"\n }\n ]\n },\n \"src/components/ErrorDialog/PathError.tsx\": {\n \"bytes\": 2731,\n \"imports\": [\n {\n \"path\": \"src/components/StatusDialog/TaskStatus.module.css\",\n \"kind\": \"import-statement\"\n },\n {\n \"path\": \"src/images/error-24.inline.svg\",\n \"kind\": \"import-statement\"\n },\n {\n \"path\": \"src/images/chevrondown-20.inline.svg\",\n \"kind\": \"import-statement\"\n },\n {\n \"path\": \"src/components/Button/Button.tsx\",\n \"kind\": \"import-statement\"\n },\n {\n \"path\": \"src/components/CloudpackProvider/CloudpackProvider.tsx\",\n \"kind\": \"import-statement\"\n }\n ]\n },\n \"src/components/ErrorDialog/ErrorDialog.tsx\": {\n \"bytes\": 1021,\n \"imports\": [\n {\n \"path\": \"src/components/Button/Button.tsx\",\n \"kind\": \"import-statement\"\n },\n {\n \"path\": \"src/components/CloudpackProvider/CloudpackProvider.tsx\",\n \"kind\": \"import-statement\"\n },\n {\n \"path\": \"src/components/ErrorDialog/PathError.tsx\",\n \"kind\": \"import-statement\"\n },\n {\n \"path\": \"src/components/StatusDialog/TaskList.module.css\",\n \"kind\": \"import-statement\"\n },\n {\n \"path\": \"src/components/Dialog/Dialog.tsx\",\n \"kind\": \"import-statement\"\n }\n ]\n },\n \"src/components/ErrorDialog/useErrorEvents.ts\": {\n \"bytes\": 3264,\n \"imports\": [\n {\n \"path\": \"src/components/CloudpackProvider/CloudpackProvider.tsx\",\n \"kind\": \"import-statement\"\n }\n ]\n },\n \"src/components/StatusOverlay/StatusOverlay.tsx\": {\n \"bytes\": 1426,\n \"imports\": [\n {\n \"path\": \"src/components/StatusBadge/StatusBadge.tsx\",\n \"kind\": \"import-statement\"\n },\n {\n \"path\": \"src/components/StatusDialog/StatusDialog.tsx\",\n \"kind\": \"import-statement\"\n },\n {\n \"path\": \"src/components/CloudpackProvider/useStatus.ts\",\n \"kind\": \"import-statement\"\n },\n {\n \"path\": \"src/components/ErrorDialog/ErrorDialog.tsx\",\n \"kind\": \"import-statement\"\n },\n {\n \"path\": \"src/components/ErrorDialog/useErrorEvents.ts\",\n \"kind\": \"import-statement\"\n }\n ]\n },\n \"src/components/ThemeProvider/ThemeProvider.module.css\": {\n \"bytes\": 630,\n \"imports\": []\n },\n \"src/components/ThemeProvider/ThemeProvider.tsx\": {\n \"bytes\": 210,\n \"imports\": [\n {\n \"path\": \"src/components/ThemeProvider/ThemeProvider.module.css\",\n \"kind\": \"import-statement\"\n }\n ]\n },\n \"src/index.tsx\": {\n \"bytes\": 532,\n \"imports\": [\n {\n \"path\": \"src/components/CloudpackProvider/CloudpackProvider.tsx\",\n \"kind\": \"import-statement\"\n },\n {\n \"path\": \"src/components/StatusOverlay/StatusOverlay.tsx\",\n \"kind\": \"import-statement\"\n },\n {\n \"path\": \"src/components/ThemeProvider/ThemeProvider.tsx\",\n \"kind\": \"import-statement\"\n }\n ]\n }\n },\n \"outputs\": {\n \"dist/lib/index.js\": {\n \"imports\": [],\n \"exports\": [],\n \"entryPoint\": \"src/index.tsx\",\n \"inputs\": {\n \"src/index.tsx\": {\n \"bytesInOutput\": 360\n },\n \"src/components/CloudpackProvider/CloudpackProvider.tsx\": {\n \"bytesInOutput\": 372\n },\n \"src/components/CloudpackProvider/getCookies.ts\": {\n \"bytesInOutput\": 317\n },\n \"src/components/CloudpackProvider/createCloudpackClient.ts\": {\n \"bytesInOutput\": 4112\n },\n \"src/components/StatusOverlay/StatusOverlay.tsx\": {\n \"bytesInOutput\": 1041\n },\n \"src/components/StatusBadge/StatusBadge.tsx\": {\n \"bytesInOutput\": 2865\n },\n \"src/hooks/useDraggable.ts\": {\n \"bytesInOutput\": 1803\n },\n \"src/components/StatusBadge/StatusBadge.module.css\": {\n \"bytesInOutput\": 3183\n },\n \"src/components/CloudpackProvider/useStatus.ts\": {\n \"bytesInOutput\": 448\n },\n \"src/components/StatusDialog/StatusDialog.tsx\": {\n \"bytesInOutput\": 876\n },\n \"src/components/StatusDialog/TaskList.tsx\": {\n \"bytesInOutput\": 898\n },\n \"src/components/StatusDialog/TaskStatus.tsx\": {\n \"bytesInOutput\": 5172\n },\n \"src/components/StatusDialog/TaskResultItem.tsx\": {\n \"bytesInOutput\": 1421\n },\n \"src/components/StatusDialog/TaskResultItem.module.css\": {\n \"bytesInOutput\": 1881\n },\n \"src/components/StatusDialog/TaskStatus.module.css\": {\n \"bytesInOutput\": 3889\n },\n \"src/images/error-24.inline.svg\": {\n \"bytesInOutput\": 1428\n },\n \"src/images/success-24.inline.svg\": {\n \"bytesInOutput\": 814\n },\n \"src/images/chevrondown-20.inline.svg\": {\n \"bytesInOutput\": 666\n },\n \"src/components/Button/Button.tsx\": {\n \"bytesInOutput\": 312\n },\n \"src/components/Button/Button.module.css\": {\n \"bytesInOutput\": 2117\n },\n \"src/components/CloudpackProvider/useStatusDetails.ts\": {\n \"bytesInOutput\": 299\n },\n \"src/components/StatusDialog/TaskList.module.css\": {\n \"bytesInOutput\": 541\n },\n \"src/components/Dialog/Dialog.tsx\": {\n \"bytesInOutput\": 1471\n },\n \"src/components/Dialog/Dialog.module.css\": {\n \"bytesInOutput\": 2292\n },\n \"src/images/dismiss-16-filled.inline.svg\": {\n \"bytesInOutput\": 1029\n },\n \"src/components/StatusDialog/Searchbox.tsx\": {\n \"bytesInOutput\": 362\n },\n \"src/components/StatusDialog/Searchbox.module.css\": {\n \"bytesInOutput\": 771\n },\n \"src/components/ErrorDialog/ErrorDialog.tsx\": {\n \"bytesInOutput\": 709\n },\n \"src/components/ErrorDialog/PathError.tsx\": {\n \"bytesInOutput\": 3043\n },\n \"src/components/ErrorDialog/useErrorEvents.ts\": {\n \"bytesInOutput\": 2092\n },\n \"src/components/ThemeProvider/ThemeProvider.tsx\": {\n \"bytesInOutput\": 191\n },\n \"src/components/ThemeProvider/ThemeProvider.module.css\": {\n \"bytesInOutput\": 561\n }\n },\n \"bytes\": 49517\n }\n }\n}\n"
12
12
  }
@@ -3,8 +3,6 @@ export interface DialogProps {
3
3
  title: string;
4
4
  style?: 'default' | 'error';
5
5
  draggable?: boolean;
6
- searchFilter?: string;
7
- handleSearchChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
8
6
  onClose?: () => void;
9
7
  commands?: React.ReactNode[];
10
8
  children: React.ReactNode;
@@ -7,14 +7,18 @@ export function Dialog({ title, style, draggable, onClose, commands, children })
7
7
  const draggableTargetRef = useRef(null);
8
8
  const colorAccent = style === 'error' ? 'rgb(164, 38, 44)' : undefined;
9
9
  const cursorDraggable = draggable ? 'move' : undefined;
10
- useDraggable(draggable ? draggableRef : undefined, draggable ? draggableTargetRef : undefined);
10
+ useDraggable({
11
+ enabled: !!draggable,
12
+ containerElementRef: draggableRef,
13
+ dragElementRef: draggableTargetRef,
14
+ });
11
15
  return (React.createElement("div", { className: styles.overlay },
12
16
  React.createElement("div", { ref: draggableRef, className: styles.dialog, style: { borderTopColor: colorAccent } },
13
17
  React.createElement("div", { className: styles.titleArea },
14
18
  React.createElement("div", { ref: draggableTargetRef, className: styles.title, style: { color: colorAccent, cursor: cursorDraggable } }, title),
15
- !!onClose && (React.createElement("button", { className: styles.closeButton, onClick: onClose, "aria-label": "Minimize overlay" },
16
- React.createElement("img", { src: CloseIcon, alt: "Close icon" })))),
17
- !!commands && React.createElement("div", { className: styles.commands }, ...commands),
19
+ onClose && (React.createElement("button", { className: styles.closeButton, onClick: onClose, "aria-label": "Minimize overlay" },
20
+ React.createElement("img", { src: CloseIcon, alt: "" })))),
21
+ commands && React.createElement("div", { className: styles.commands }, ...commands),
18
22
  children)));
19
23
  }
20
24
  //# sourceMappingURL=Dialog.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Dialog.js","sourceRoot":"","sources":["../../../src/components/Dialog/Dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,MAAM,MAAM,qBAAqB,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,SAAS,MAAM,2CAA2C,CAAC;AAalE,MAAM,UAAU,MAAM,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAe;IAC1F,MAAM,YAAY,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;IAClC,MAAM,kBAAkB,GAAG,MAAM,CAAC,IAAI,CAAC,CA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,OAAM,QAAQ,CAAO;YAChE,QAAQ,CACL,CACF,CACP,CAAC;AACJ,CAAC"}
@@ -7,12 +7,19 @@ export function StatusBadge({ inline, onExpand }) {
7
7
  const rootElementRef = useRef(null);
8
8
  const dragElementRef = useRef(null);
9
9
  const status = useStatus();
10
- useDraggable(rootElementRef, dragElementRef);
11
- if (status.status === 'unknown') {
10
+ const shouldRender = status.status !== 'unknown';
11
+ useDraggable({
12
+ // If we're not yet able to render, don't enable dragging yet.
13
+ // Otherwise the event handlers won't be attached when the component renders.
14
+ enabled: shouldRender && !inline,
15
+ containerElementRef: rootElementRef,
16
+ dragElementRef,
17
+ });
18
+ if (!shouldRender) {
12
19
  return null;
13
20
  }
14
- const badge = (React.createElement("div", { ref: inline ? undefined : rootElementRef, className: getStatusClassName(status, !!inline) },
15
- !inline && (React.createElement("div", { ref: inline ? undefined : dragElementRef, className: styles.gripArea },
21
+ const badge = (React.createElement("div", { ref: rootElementRef, className: getStatusClassName(status, !!inline) },
22
+ !inline && (React.createElement("div", { ref: dragElementRef, className: styles.gripArea },
16
23
  React.createElement("div", { className: styles.grip }),
17
24
  React.createElement("div", { className: styles.grip }))),
18
25
  React.createElement("button", { className: styles.button, onClick: onExpand, "aria-label": "Expand overlay" },
@@ -30,26 +37,26 @@ function getStatusString(status) {
30
37
  }
31
38
  return status.totalErrors === 0 ? 'Success' : 'Errors';
32
39
  }
33
- function getStatusClassName(status, inline) {
40
+ function getStatusClassName({ status, totalTasks, totalErrors, totalWarnings }, inline) {
34
41
  return cx(styles.badge, {
35
42
  [styles.inline]: inline,
36
- [styles.building]: status.status === 'pending',
37
- [styles.success]: status.status === 'idle' && status.totalTasks > 0 && status.totalErrors === 0 && status.totalWarnings === 0,
38
- [styles.error]: status.status === 'idle' && status.totalErrors > 0,
39
- [styles.warning]: status.status === 'idle' && status.totalErrors === 0 && status.totalWarnings > 0,
43
+ [styles.building]: status === 'pending',
44
+ [styles.success]: status === 'idle' && totalTasks > 0 && totalErrors === 0 && totalWarnings === 0,
45
+ [styles.error]: status === 'idle' && totalErrors > 0,
46
+ [styles.warning]: status === 'idle' && totalErrors === 0 && totalWarnings > 0,
40
47
  });
41
48
  }
42
- function getStatsString(status) {
43
- if (status.totalTasks === 0) {
49
+ function getStatsString({ totalTasks, remainingTasks, totalErrors, totalWarnings }) {
50
+ if (totalTasks === 0) {
44
51
  return '';
45
52
  }
46
53
  return [
47
- status.remainingTasks > 0 && `${status.remainingTasks} of ${status.totalTasks} tasks pending`,
48
- status.remainingTasks === 0 && `${status.totalTasks} tasks completed`,
49
- status.totalErrors === 1 && `${status.totalErrors} error`,
50
- status.totalErrors > 1 && `${status.totalErrors} errors`,
51
- status.totalWarnings === 1 && `${status.totalWarnings} warning`,
52
- status.totalWarnings > 1 && `${status.totalWarnings} warnings`,
54
+ remainingTasks > 0 && `${remainingTasks} of ${totalTasks} tasks pending`,
55
+ remainingTasks === 0 && `${totalTasks} tasks completed`,
56
+ totalErrors === 1 && `${totalErrors} error`,
57
+ totalErrors > 1 && `${totalErrors} errors`,
58
+ totalWarnings === 1 && `${totalWarnings} warning`,
59
+ totalWarnings > 1 && `${totalWarnings} warnings`,
53
60
  ]
54
61
  .filter(Boolean)
55
62
  .join(', ');
@@ -1 +1 @@
1
- {"version":3,"file":"StatusBadge.js","sourceRoot":"","sources":["../../../src/components/StatusBadge/StatusBadge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,MAAM,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,OAAO,IAAI,EAAE,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAwB,MAAM,mCAAmC,CAAC;AAOpF,MAAM,UAAU,WAAW,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAoB;IAChE,MAAM,cAAc,GAAG,MAAM,CAAiB,IAAI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M,KAAK,MAAM,IAAI,UAAU,GAAG,CAAC,IAAI,WAAW,KAAK,CAAC,IAAI,aAAa,KAAK,CAAC;QACjG,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,MAAM,KAAK,MAAM,IAAI,WAAW,GAAG,CAAC;QACpD,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,MAAM,KAAK,MAAM,IAAI,WAAW,KAAK,CAAC,IAAI,aAAa,GAAG,CAAC;KAC9E,CAAC,CAAC;AACL,CAAC;AAED,SAAS,cAAc,CAAC,EAAE,UAAU,EAAE,cAAc,EAAE,WAAW,EAAE,aAAa,EAAmB;IACjG,IAAI,UAAU,KAAK,CAAC,EAAE;QACpB,OAAO,EAAE,CAAC;KACX;IAED,OAAO;QACL,cAAc,GAAG,CAAC,IAAI,GAAG,cAAc,OAAO,UAAU,gBAAgB;QACxE,cAAc,KAAK,CAAC,IAAI,GAAG,UAAU,kBAAkB;QACvD,WAAW,KAAK,CAAC,IAAI,GAAG,WAAW,QAAQ;QAC3C,WAAW,GAAG,CAAC,IAAI,GAAG,WAAW,SAAS;QAC1C,aAAa,KAAK,CAAC,IAAI,GAAG,aAAa,UAAU;QACjD,aAAa,GAAG,CAAC,IAAI,GAAG,aAAa,WAAW;KACjD;SACE,MAAM,CAAC,OAAO,CAAC;SACf,IAAI,CAAC,IAAI,CAAC,CAAC;AAChB,CAAC"}
@@ -7,24 +7,23 @@ import { useErrorEvents } from '../ErrorDialog/useErrorEvents.js';
7
7
  export function StatusOverlay() {
8
8
  const [isExpanded, setIsExpanded] = useState(false);
9
9
  const status = useStatus();
10
- const internal = useRef();
10
+ const prevStatus = useRef();
11
11
  const { unsupported } = useErrorEvents();
12
12
  // If we haven't set a specific state and we become idle,
13
13
  // pop open the details if there are errors.
14
- if (isExpanded === false &&
15
- internal.current?.status !== 'idle' &&
16
- status.status === 'idle' &&
17
- internal.current?.totalErrors != status.totalErrors) {
18
- setIsExpanded(true);
19
- }
20
- internal.current = status;
14
+ React.useEffect(() => {
15
+ if (!isExpanded &&
16
+ prevStatus.current?.status !== 'idle' &&
17
+ status.status === 'idle' &&
18
+ (prevStatus.current?.totalErrors || 0) !== (status.totalErrors || 0)) {
19
+ setIsExpanded(true);
20
+ }
21
+ prevStatus.current = status;
22
+ }, [status, isExpanded]);
21
23
  const toggleMinimized = useCallback(() => {
22
24
  console.log(`Toggling minimized state to ${!isExpanded}`);
23
25
  setIsExpanded(!isExpanded);
24
- }, [isExpanded, setIsExpanded]);
25
- return (React.createElement("div", null,
26
- !!unsupported.length && React.createElement(ErrorDialog, { unsupported: unsupported }),
27
- !unsupported.length && !isExpanded && React.createElement(StatusBadge, { onExpand: toggleMinimized }),
28
- !unsupported.length && isExpanded && React.createElement(StatusDialog, { onClose: toggleMinimized })));
26
+ }, [isExpanded]);
27
+ return unsupported.length ? (React.createElement(ErrorDialog, { unsupported: unsupported })) : isExpanded ? (React.createElement(StatusDialog, { onClose: toggleMinimized })) : (React.createElement(StatusBadge, { onExpand: toggleMinimized }));
29
28
  }
30
29
  //# sourceMappingURL=StatusOverlay.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"StatusOverlay.js","sourceRoot":"","sources":["../../../src/components/StatusOverlay/StatusOverlay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAwB,MAAM,mCAAmC,CAAC;AACpF,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAElE,MAAM,UAAU,aAAa;IAC3B,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAU,KAAK,CAAC,CAAC;IAC7D,MAAM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,YAAY,IAAC,OAAO,EAAE,eAAe,GAAI,CAC3C,CAAC,CAAC,CAAC,CACF,oBAAC,WAAW,IAAC,QAAQ,EAAE,eAAe,GAAI,CAC3C,CAAC;AACJ,CAAC"}
@@ -1,4 +1,16 @@
1
1
  import { type RefObject } from 'react';
2
- export declare function useDraggable(containerElementRef?: RefObject<HTMLElement>, dragElementRef?: RefObject<HTMLElement> | undefined): {
2
+ /**
3
+ * Make an element draggable. Note that changing `enabled` or passing different ref objects
4
+ * will trigger reconfiguring the event handlers, but changing `.current` will not.
5
+ * @returns Whether the element is currently being dragged
6
+ */
7
+ export declare function useDraggable(options: {
8
+ /** Whether to enable dragging */
9
+ enabled: boolean;
10
+ /** Element that should be draggable */
11
+ containerElementRef: RefObject<HTMLElement>;
12
+ /** The drag handle element */
13
+ dragElementRef: RefObject<HTMLElement>;
14
+ }): {
3
15
  isDragging: boolean;
4
16
  };
@@ -1,46 +1,51 @@
1
1
  import { useEffect, useState } from 'react';
2
- export function useDraggable(containerElementRef, dragElementRef = containerElementRef) {
2
+ /**
3
+ * Make an element draggable. Note that changing `enabled` or passing different ref objects
4
+ * will trigger reconfiguring the event handlers, but changing `.current` will not.
5
+ * @returns Whether the element is currently being dragged
6
+ */
7
+ export function useDraggable(options) {
8
+ const { enabled, containerElementRef, dragElementRef } = options;
3
9
  const [isDragging, setIsDragging] = useState(false);
4
10
  useEffect(() => {
5
- if (containerElementRef && dragElementRef) {
6
- const moveTarget = containerElementRef.current;
7
- const dragTarget = dragElementRef.current;
8
- if (moveTarget && dragTarget) {
9
- let originalX = 0;
10
- let originalY = 0;
11
- let offset = { x: 0, y: 0 };
12
- const onPointerMove = (event) => {
13
- moveTarget.style.transform = `translate(${offset.x + event.clientX - originalX}px, ${offset.y + event.clientY - originalY}px)`;
14
- };
15
- const onPointerUp = (event) => {
16
- setIsDragging(false);
17
- offset = {
18
- x: offset.x + event.clientX - originalX,
19
- y: offset.y + event.clientY - originalY,
20
- };
21
- dragTarget.releasePointerCapture(event.pointerId);
22
- dragTarget.removeEventListener('pointerup', onPointerUp);
23
- dragTarget.removeEventListener('pointermove', onPointerMove);
24
- event.preventDefault();
25
- };
26
- const onPointerDown = (event) => {
27
- setIsDragging(true);
28
- originalX = event.clientX;
29
- originalY = event.clientY;
30
- dragTarget.setPointerCapture(event.pointerId);
31
- dragTarget.addEventListener('pointerup', onPointerUp);
32
- dragTarget.addEventListener('pointermove', onPointerMove);
33
- event.preventDefault();
34
- };
35
- dragTarget.addEventListener('pointerdown', onPointerDown);
36
- return () => {
37
- dragTarget.removeEventListener('pointerdown', onPointerDown);
38
- dragTarget.removeEventListener('pointermove', onPointerMove);
39
- dragTarget.removeEventListener('pointerup', onPointerUp);
40
- };
41
- }
11
+ const moveTarget = containerElementRef?.current;
12
+ const dragTarget = dragElementRef?.current;
13
+ if (!enabled || !moveTarget || !dragTarget) {
14
+ return;
42
15
  }
43
- }, [containerElementRef, dragElementRef]);
16
+ let originalX = 0;
17
+ let originalY = 0;
18
+ let offset = { x: 0, y: 0 };
19
+ const onPointerMove = (event) => {
20
+ moveTarget.style.transform = `translate(${offset.x + event.clientX - originalX}px, ${offset.y + event.clientY - originalY}px)`;
21
+ };
22
+ const onPointerUp = (event) => {
23
+ setIsDragging(false);
24
+ offset = {
25
+ x: offset.x + event.clientX - originalX,
26
+ y: offset.y + event.clientY - originalY,
27
+ };
28
+ dragTarget.releasePointerCapture(event.pointerId);
29
+ dragTarget.removeEventListener('pointerup', onPointerUp);
30
+ dragTarget.removeEventListener('pointermove', onPointerMove);
31
+ event.preventDefault();
32
+ };
33
+ const onPointerDown = (event) => {
34
+ setIsDragging(true);
35
+ originalX = event.clientX;
36
+ originalY = event.clientY;
37
+ dragTarget.setPointerCapture(event.pointerId);
38
+ dragTarget.addEventListener('pointerup', onPointerUp);
39
+ dragTarget.addEventListener('pointermove', onPointerMove);
40
+ event.preventDefault();
41
+ };
42
+ dragTarget.addEventListener('pointerdown', onPointerDown);
43
+ return () => {
44
+ dragTarget.removeEventListener('pointerdown', onPointerDown);
45
+ dragTarget.removeEventListener('pointermove', onPointerMove);
46
+ dragTarget.removeEventListener('pointerup', onPointerUp);
47
+ };
48
+ }, [enabled, containerElementRef, dragElementRef]);
44
49
  return {
45
50
  isDragging,
46
51
  };
@@ -1 +1 @@
1
- {"version":3,"file":"useDraggable.js","sourceRoot":"","sources":["../../src/hooks/useDraggable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE5D,MAAM,UAAU,YAAY,CAAC,mBAA4C,EAAE,cAAc,GAAG,mBAAmB;IAC7G,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAEpD,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,mBAAmB,IAAI,cAAc,EAAE;YACzC,MAAM,UAAU,GAAG,mBAAmB,CAAC,OAAO,CAAC;YAC/C,MAAM,UAAU,GAAG,cAAc,CAAC,OAAO,CAAC;YAE1C,IAAI,UAAU,IAAI,UAAU,EAAE;gBAC5B,IAAI,SAAS,GAAG,CAAC,CAAC;gBAClB,IAAI,SAAS,GAAG,CAAC,CAAC;gBAClB,IAAI,MAAM,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;gBAE5B,MAAM,aAAa,GAAG,CAAC,KAAmB,EAAE,EAAE;oBAC5C,UAAU,CAAC,KAAK,CAAC,SAAS,GAAG,aAAa,MAAM,CAAC,CAAC,GAAG,KAAK,CAAC,OAAO,GAAG,SAAS,OAC5E,MAAM,CAAC,CAAC,GAAG,KAAK,CAAC,OAAO,GAAG,SAC7B,KAAK,CAAC;gBACR,CAAC,CAAC;gBAEF,MAAM,WAAW,GAAG,CAAC,KAAmB,EAAE,EAAE;oBAC1C,aAAa,CAAC,KAAK,CAAC,CAAC;oBACrB,MAAM,GAAG;wBACP,CAAC,EAAE,MAAM,CAAC,CAAC,G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qBAAqB,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;YAClD,UAAU,CAAC,mBAAmB,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;YACzD,UAAU,CAAC,mBAAmB,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;YAE7D,KAAK,CAAC,cAAc,EAAE,CAAC;QACzB,CAAC,CAAC;QAEF,MAAM,aAAa,GAAG,CAAC,KAAmB,EAAE,EAAE;YAC5C,aAAa,CAAC,IAAI,CAAC,CAAC;YACpB,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC;YAC1B,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC;YAC1B,UAAU,CAAC,iBAAiB,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;YAC9C,UAAU,CAAC,gBAAgB,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;YACtD,UAAU,CAAC,gBAAgB,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;YAC1D,KAAK,CAAC,cAAc,EAAE,CAAC;QACzB,CAAC,CAAC;QAEF,UAAU,CAAC,gBAAgB,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;QAE1D,OAAO,GAAG,EAAE;YACV,UAAU,CAAC,mBAAmB,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;YAC7D,UAAU,CAAC,mBAAmB,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;YAC7D,UAAU,CAAC,mBAAmB,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;QAC3D,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,OAAO,EAAE,mBAAmB,EAAE,cAAc,CAAC,CAAC,CAAC;IAEnD,OAAO;QACL,UAAU;KACX,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ms-cloudpack/overlay",
3
- "version": "0.11.0",
3
+ "version": "0.11.2",
4
4
  "description": "The Cloudpack overlay ux.",
5
5
  "license": "MIT",
6
6
  "types": "./lib/index.d.ts",
@@ -37,5 +37,10 @@
37
37
  "files": [
38
38
  "/lib",
39
39
  "/dist"
40
- ]
40
+ ],
41
+ "beachball": {
42
+ "disallowedChangeTypes": [
43
+ "major"
44
+ ]
45
+ }
41
46
  }