@ms-cloudpack/overlay 0.19.53 → 0.19.54

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.
@@ -11,7 +11,7 @@ export const Overlay = () => {
11
11
  const pageLoadTimeReport = usePageLoadTimeReporter();
12
12
  const [isDialogOpen, setIsDialogOpen] = useState(false);
13
13
  const stats = useTaskStats();
14
- const prevStats = useRef();
14
+ const prevStatsRef = useRef();
15
15
  const { unsupported } = useErrorEvents();
16
16
  // Note: index.tsx handles the 'never' case (doesn't render anything)
17
17
  const showOverlay = window.__cloudpack?.pageSessionContext?.showOverlay || 'always';
@@ -19,12 +19,12 @@ export const Overlay = () => {
19
19
  // pop open the details if there are errors.
20
20
  useEffect(() => {
21
21
  if (!isDialogOpen &&
22
- prevStats.current?.status !== 'idle' &&
22
+ prevStatsRef.current?.status !== 'idle' &&
23
23
  stats.status === 'idle' &&
24
- (prevStats.current?.totalErrors || 0) !== (stats.totalErrors || 0)) {
24
+ (prevStatsRef.current?.totalErrors || 0) !== (stats.totalErrors || 0)) {
25
25
  setIsDialogOpen(true);
26
26
  }
27
- prevStats.current = stats;
27
+ prevStatsRef.current = stats;
28
28
  }, [stats, isDialogOpen]);
29
29
  const result = unsupported.length ? (_jsx(ErrorDialog, { unsupported: unsupported })) : stats.totalErrors || showOverlay !== 'errors-only' ? (_jsxs(_Fragment, { children: [isDialogOpen && _jsx(StatusDialog, { onClose: () => setIsDialogOpen(false) }), _jsx(StatusBadge, { onOpenDialog: () => setIsDialogOpen(true), pageLoadTimeReport: pageLoadTimeReport })] })) : null;
30
30
  return _jsx(Suspense, { fallback: null, children: result });
@@ -1 +1 @@
1
- {"version":3,"file":"Overlay.js","sourceRoot":"","sources":["../../../src/components/Overlay/Overlay.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,E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AAC,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC;IAE1B,MAAM,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,CAClC,KAAC,WAAW,IAAC,WAAW,EAAE,WAAW,GAAI,CAC1C,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,IAAI,WAAW,KAAK,aAAa,CAAC,CAAC,CAAC,CACvD,8BACG,YAAY,IAAI,KAAC,YAAY,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,KAAK,CAAC,GAAI,EACxE,KAAC,WAAW,IAAC,YAAY,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,kBAAkB,EAAE,kBAAkB,GAAI,IACjG,CACJ,CAAC,CAAC,CAAC,IAAI,CAAC;IAET,OAAO,KAAC,QAAQ,IAAC,QAAQ,EAAE,IAAI,YAAG,MAAM,GAAY,CAAC;AACvD,CAAC,CAAC","sourcesContent":["import type { FunctionComponent } from 'preact';\nimport { lazy, Suspense } from 'preact/compat';\nimport { useState, useRef, useEffect } from 'preact/hooks';\nimport { StatusBadge } from '../StatusBadge/StatusBadge.js';\nimport { useTaskStats } from '../CloudpackProvider/useTaskStats.js';\nimport { useErrorEvents } from '../ErrorDialog/useErrorEvents.js';\nimport { usePageLoadTimeReporter } from '../../hooks/usePageLoadTimeReporter.js';\nimport type { TaskStats } from '@ms-cloudpack/api-server/browser';\n\nconst StatusDialog = lazy(() => import('../StatusDialog/StatusDialog.js'));\nconst ErrorDialog = lazy(() => import('../ErrorDialog/ErrorDialog.js'));\n\nexport const Overlay: FunctionComponent = () => {\n const pageLoadTimeReport = usePageLoadTimeReporter();\n const [isDialogOpen, setIsDialogOpen] = useState<boolean>(false);\n const stats = useTaskStats();\n const prevStats = useRef<TaskStats | undefined>();\n const { unsupported } = useErrorEvents();\n // Note: index.tsx handles the 'never' case (doesn't render anything)\n const showOverlay = window.__cloudpack?.pageSessionContext?.showOverlay || 'always';\n\n // If we haven't set a specific state and we become idle,\n // pop open the details if there are errors.\n useEffect(() => {\n if (\n !isDialogOpen &&\n prevStats.current?.status !== 'idle' &&\n stats.status === 'idle' &&\n (prevStats.current?.totalErrors || 0) !== (stats.totalErrors || 0)\n ) {\n setIsDialogOpen(true);\n }\n prevStats.current = stats;\n }, [stats, isDialogOpen]);\n\n const result = unsupported.length ? (\n <ErrorDialog unsupported={unsupported} />\n ) : stats.totalErrors || showOverlay !== 'errors-only' ? (\n <>\n {isDialogOpen && <StatusDialog onClose={() => setIsDialogOpen(false)} />}\n <StatusBadge onOpenDialog={() => setIsDialogOpen(true)} pageLoadTimeReport={pageLoadTimeReport} />\n </>\n ) : null;\n\n return <Suspense fallback={null}>{result}</Suspense>;\n};\n"]}
1
+ {"version":3,"file":"Overlay.js","sourceRoot":"","sources":["../../../src/components/Overlay/Overlay.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AAGjF,MAAM,YAAY,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,iCAAiC,CAAC,CAAC,CAAC;AAC3E,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,+BAA+B,CAAC,CAAC,CAAC;AAExE,MAAM,CAAC,MAAM,OAAO,GAAsB,GAAG,EAAE;IAC7C,MAAM,kBAAkB,GAAG,uBAAuB,EAAE,CAAC;IACrD,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAU,KA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CAAC","sourcesContent":["import type { FunctionComponent } from 'preact';\nimport { lazy, Suspense } from 'preact/compat';\nimport { useState, useRef, useEffect } from 'preact/hooks';\nimport { StatusBadge } from '../StatusBadge/StatusBadge.js';\nimport { useTaskStats } from '../CloudpackProvider/useTaskStats.js';\nimport { useErrorEvents } from '../ErrorDialog/useErrorEvents.js';\nimport { usePageLoadTimeReporter } from '../../hooks/usePageLoadTimeReporter.js';\nimport type { TaskStats } from '@ms-cloudpack/api-server/browser';\n\nconst StatusDialog = lazy(() => import('../StatusDialog/StatusDialog.js'));\nconst ErrorDialog = lazy(() => import('../ErrorDialog/ErrorDialog.js'));\n\nexport const Overlay: FunctionComponent = () => {\n const pageLoadTimeReport = usePageLoadTimeReporter();\n const [isDialogOpen, setIsDialogOpen] = useState<boolean>(false);\n const stats = useTaskStats();\n const prevStatsRef = useRef<TaskStats | undefined>();\n const { unsupported } = useErrorEvents();\n // Note: index.tsx handles the 'never' case (doesn't render anything)\n const showOverlay = window.__cloudpack?.pageSessionContext?.showOverlay || 'always';\n\n // If we haven't set a specific state and we become idle,\n // pop open the details if there are errors.\n useEffect(() => {\n if (\n !isDialogOpen &&\n prevStatsRef.current?.status !== 'idle' &&\n stats.status === 'idle' &&\n (prevStatsRef.current?.totalErrors || 0) !== (stats.totalErrors || 0)\n ) {\n setIsDialogOpen(true);\n }\n prevStatsRef.current = stats;\n }, [stats, isDialogOpen]);\n\n const result = unsupported.length ? (\n <ErrorDialog unsupported={unsupported} />\n ) : stats.totalErrors || showOverlay !== 'errors-only' ? (\n <>\n {isDialogOpen && <StatusDialog onClose={() => setIsDialogOpen(false)} />}\n <StatusBadge onOpenDialog={() => setIsDialogOpen(true)} pageLoadTimeReport={pageLoadTimeReport} />\n </>\n ) : null;\n\n return <Suspense fallback={null}>{result}</Suspense>;\n};\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ms-cloudpack/overlay",
3
- "version": "0.19.53",
3
+ "version": "0.19.54",
4
4
  "description": "The Cloudpack overlay UX",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -29,7 +29,7 @@
29
29
  "prepack": "cp .npmignore dist/.npmignore"
30
30
  },
31
31
  "devDependencies": {
32
- "@ms-cloudpack/api-server": "^0.65.11",
32
+ "@ms-cloudpack/api-server": "^0.65.12",
33
33
  "@ms-cloudpack/common-types": "^0.33.1",
34
34
  "@ms-cloudpack/common-types-browser": "^0.6.4",
35
35
  "@ms-cloudpack/eslint-plugin-internal": "^0.0.1",