@ms-cloudpack/overlay 0.19.91 → 0.19.92
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/NOTICE.txt +1 -1
- package/dist/browser-esm/3.chunk.js +1 -1
- package/dist/browser-esm/475.chunk.js +1 -1
- package/dist/browser-esm/598.chunk.js +1 -1
- package/dist/browser-esm/lib/index.js +1 -1
- package/dist/browser-esm/lib/index.js.map +1 -1
- package/lib/components/Dialog/Dialog.js +1 -5
- package/lib/components/Dialog/Dialog.js.map +1 -1
- package/lib/components/StatusDialog/TaskResultItem.js +1 -3
- package/lib/components/StatusDialog/TaskResultItem.js.map +1 -1
- package/package.json +3 -3
|
@@ -24,10 +24,6 @@ export const Dialog = (props) => {
|
|
|
24
24
|
containerElementRef: dialogRootRef,
|
|
25
25
|
dragElementRef: titleRef,
|
|
26
26
|
});
|
|
27
|
-
return (
|
|
28
|
-
// The overlay must be outside FocusOn so that clicking on it will close the dialog
|
|
29
|
-
_jsx("div", { className: styles.overlay, children: _jsx(FocusOn, { className: styles.focusOn, onClickOutside: onClose, onEscapeKey: onClose, onActivation: () => titleRef.current?.focus(), children: _jsxs("div", { id: id, ref: dialogRootRef, class: cx(styles.dialog, style === 'error' && styles.error), role: "dialog", "aria-modal": true, "aria-labelledby": elementIds.dialogTitle, children: [_jsxs("div", { class: styles.titleArea, children: [_jsx("h2", { ref: titleRef, id: elementIds.dialogTitle, class: cx(styles.title, draggable && styles.draggable), tabIndex: -1, children: title }), onClose && (
|
|
30
|
-
// a close icon is common/universal enough that it doesn't need hover text
|
|
31
|
-
_jsx(Button, { variant: "iconOnly", onClick: onClose, "aria-label": "Close", children: _jsx(Dismiss16, {}) }))] }), commands && _jsx("div", { class: styles.commands, children: commands }), _jsx("div", { class: styles.content, children: children })] }) }) }));
|
|
27
|
+
return (_jsx("div", { className: styles.overlay, children: _jsx(FocusOn, { className: styles.focusOn, onClickOutside: onClose, onEscapeKey: onClose, onActivation: () => titleRef.current?.focus(), children: _jsxs("div", { id: id, ref: dialogRootRef, class: cx(styles.dialog, style === 'error' && styles.error), role: "dialog", "aria-modal": true, "aria-labelledby": elementIds.dialogTitle, children: [_jsxs("div", { class: styles.titleArea, children: [_jsx("h2", { ref: titleRef, id: elementIds.dialogTitle, class: cx(styles.title, draggable && styles.draggable), tabIndex: -1, children: title }), onClose && (_jsx(Button, { variant: "iconOnly", onClick: onClose, "aria-label": "Close", children: _jsx(Dismiss16, {}) }))] }), commands && _jsx("div", { class: styles.commands, children: commands }), _jsx("div", { class: styles.content, children: children })] }) }) }));
|
|
32
28
|
};
|
|
33
29
|
//# sourceMappingURL=Dialog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.js","sourceRoot":"","sources":["../../../src/components/Dialog/Dialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,MAAM,MAAM,qBAAqB,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,8BAA8B;AAC9B,MAAM,OAAO,GAAG,QAEf,CAAC;AAYF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,MAAM,GAAmC,CAAC,KAAK,EAAE,EAAE;IAC9D,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAC3E,MAAM,aAAa,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAC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,IACN,SAAS,EAAE,MAAM,CAAC,OAAO,EACzB,cAAc,EAAE,OAAO,EACvB,WAAW,EAAE,OAAO,EACpB,YAAY,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,OAAO,EAAE,KAAK,EAAE,YAE7C,eACE,EAAE,EAAE,EAAE,EACN,GAAG,EAAE,aAAa,EAClB,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,KAAK,OAAO,IAAI,MAAM,CAAC,KAAK,CAAC,EAC3D,IAAI,EAAC,QAAQ,yCAEI,UAAU,CAAC,WAAW,aAEvC,eAAK,KAAK,EAAE,MAAM,CAAC,SAAS,aAC1B,aACE,GAAG,EAAE,QAAQ,EACb,EAAE,EAAE,UAAU,CAAC,WAAW,EAC1B,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE,SAAS,IAAI,MAAM,CAAC,SAAS,CAAC,EACtD,QAAQ,EAAE,CAAC,CAAC,YAEX,KAAK,GACH,EACJ,OAAO,IAAI,CAEV,KAAC,MAAM,IAAC,OAAO,EAAC,UAAU,EAAC,OAAO,EAAE,OAAO,gBAAa,OAAO,YAC7D,KAAC,SAAS,KAAG,GACN,CACV,IACG,EACL,QAAQ,IAAI,cAAK,KAAK,EAAE,MAAM,CAAC,QAAQ,YAAG,QAAQ,GAAO,EAC1D,cAAK,KAAK,EAAE,MAAM,CAAC,OAAO,YAAG,QAAQ,GAAO,IACxC,GACE,GACN,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import cx from 'classnames';\nimport type { ComponentChildren, FunctionComponent, ComponentProps } from 'preact';\nimport { useRef } from 'preact/hooks';\nimport { FocusOn as _FocusOn } from 'react-focus-on';\nimport styles from './Dialog.module.css';\nimport { useDraggable } from '../../hooks/useDraggable.js';\nimport { Button } from '../Button/Button.js';\nimport { elementIds } from '../../constants.js';\nimport { Dismiss16 } from '../icons/Dismiss16.js';\n\n// Re-type children for preact\nconst FocusOn = _FocusOn as FunctionComponent<\n Omit<ComponentProps<typeof _FocusOn>, 'children'> & { children: ComponentChildren }\n>;\n\nexport interface DialogProps {\n title: string;\n id: string;\n style?: 'default' | 'error';\n draggable?: boolean;\n onClose?: () => void;\n commands?: ComponentChildren;\n children: ComponentChildren;\n}\n\n/**\n * Dialog component which takes title and commands as props and content as children.\n *\n * If multiple children are provided, they'll be styled with a flex column layout with gaps.\n * To prevent this behavior, wrap the children in a single div.\n */\nexport const Dialog: FunctionComponent<DialogProps> = (props) => {\n const { title, id, style, draggable, onClose, commands, children } = props;\n const dialogRootRef = useRef<HTMLDivElement>(null);\n const titleRef = useRef<HTMLDivElement>(null);\n\n useDraggable({\n enabled: !!draggable,\n containerElementRef: dialogRootRef,\n dragElementRef: titleRef,\n });\n\n return (\n // The overlay must be outside FocusOn so that clicking on it will close the dialog\n <div className={styles.overlay}>\n <FocusOn\n className={styles.focusOn}\n onClickOutside={onClose}\n onEscapeKey={onClose}\n onActivation={() => titleRef.current?.focus()}\n >\n <div\n id={id}\n ref={dialogRootRef}\n class={cx(styles.dialog, style === 'error' && styles.error)}\n role=\"dialog\"\n aria-modal\n aria-labelledby={elementIds.dialogTitle}\n >\n <div class={styles.titleArea}>\n <h2\n ref={titleRef}\n id={elementIds.dialogTitle}\n class={cx(styles.title, draggable && styles.draggable)}\n tabIndex={-1}\n >\n {title}\n </h2>\n {onClose && (\n // a close icon is common/universal enough that it doesn't need hover text\n <Button variant=\"iconOnly\" onClick={onClose} aria-label=\"Close\">\n <Dismiss16 />\n </Button>\n )}\n </div>\n {commands && <div class={styles.commands}>{commands}</div>}\n <div class={styles.content}>{children}</div>\n </div>\n </FocusOn>\n </div>\n );\n};\n"]}
|
|
@@ -18,9 +18,7 @@ export const TaskResultItem = (props) => {
|
|
|
18
18
|
// or some internal of cloudpack, and since the user might not know about the different bundlers
|
|
19
19
|
// and certainly doesn't know about cloudpack internals, a bit of context is helpful.
|
|
20
20
|
const friendlySource = bundlerNames.includes(item.source) ? `${item.source} bundler` : `cloudpack ${item.source}`;
|
|
21
|
-
return (_jsxs("div", { class: styles.root, children: [_jsx("div", { class: cx(styles.statusBar, type === 'warning' && styles.warning) }), _jsxs("div", { class: styles.content, children: [_jsxs("div", { class: styles.titleArea, children: [index + 1, ". ", _jsx(ItemLocation, { loc: loc, inputPath: inputPath }), " (via: ", friendlySource, ")"] }), _jsx("pre", { class: styles.text, children: stripAnsi(item.text) }), notes.length > 0 && (
|
|
22
|
-
// Formatting here might not be ideal, but messages very rarely have notes
|
|
23
|
-
_jsxs("details", { children: [_jsx("summary", { children: "Expand for more details" }), _jsx("ul", { children: notes.map((note, i) => (_jsxs("li", { children: [note.location && (_jsxs(_Fragment, { children: [_jsx(ItemLocation, { loc: note.location, inputPath: inputPath }), _jsx("br", {})] })), note.text && _jsx("pre", { class: styles.text, children: stripAnsi(note.text) })] }, i))) })] }))] })] }));
|
|
21
|
+
return (_jsxs("div", { class: styles.root, children: [_jsx("div", { class: cx(styles.statusBar, type === 'warning' && styles.warning) }), _jsxs("div", { class: styles.content, children: [_jsxs("div", { class: styles.titleArea, children: [index + 1, ". ", _jsx(ItemLocation, { loc: loc, inputPath: inputPath }), " (via: ", friendlySource, ")"] }), _jsx("pre", { class: styles.text, children: stripAnsi(item.text) }), notes.length > 0 && (_jsxs("details", { children: [_jsx("summary", { children: "Expand for more details" }), _jsx("ul", { children: notes.map((note, i) => (_jsxs("li", { children: [note.location && (_jsxs(_Fragment, { children: [_jsx(ItemLocation, { loc: note.location, inputPath: inputPath }), _jsx("br", {})] })), note.text && _jsx("pre", { class: styles.text, children: stripAnsi(note.text) })] }, i))) })] }))] })] }));
|
|
24
22
|
};
|
|
25
23
|
/**
|
|
26
24
|
* Remove ANSI codes from a string. (This is duplicated from `task-reporter` to avoid needing
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TaskResultItem.js","sourceRoot":"","sources":["../../../src/components/StatusDialog/TaskResultItem.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,MAAM,YAA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,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,EAAE,CAAC;QAC9C,OAAO,cAAc,CAAC;IACxB,CAAC;IAED,MAAM,UAAU,GAAG,GAAS,EAAE;QAC5B,IAAI,CAAC,SAAS;YAAE,OAAO;QACvB,KAAK,SAAS,CAAC,cAAc,CAAC,MAAM,CAAC;YACnC,QAAQ,EAAE,SAAS;YACnB,YAAY,EAAE,GAAG,CAAC,IAAI;YACtB,IAAI,EAAE,GAAG,CAAC,IAAI;YACd,MAAM,EAAE,GAAG,CAAC,MAAM;SACnB,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,OAAO,CACL,KAAC,MAAM,IAAC,OAAO,EAAC,MAAM,EAAC,OAAO,EAAE,UAAU,YACvC,cAAc,GACR,CACV,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import type { BundleMessage, BundleMessageLocation } from '@ms-cloudpack/common-types';\nimport type { FunctionComponent } from 'preact';\nimport cx from 'classnames';\nimport { useCloudpack } from '../CloudpackProvider/CloudpackProvider.js';\nimport styles from './TaskResultItem.module.css';\nimport { Button } from '../Button/Button.js';\n\nexport interface TaskResultItemProps {\n item: BundleMessage;\n inputPath: string | undefined;\n /** 0-based index (will be adjusted for display) */\n index: number;\n type: 'error' | 'warning';\n}\n\n/**\n * Current and possible future bundler names, just to help with a friendlier error message\n * (we can't access the authoritative list from the bundler package here)\n */\nconst bundlerNames = ['ori', 'rollup', 'webpack', 'rspack', 'esbuild'];\n\n/**\n * Error or warning item in the details of a task/bundle result.\n */\nexport const TaskResultItem: FunctionComponent<TaskResultItemProps> = (props) => {\n const { item, inputPath, index, type } = props;\n const { location: loc, notes = [] } = item;\n\n // Update the message source to be more user-friendly. Usually it's either a bundler name,\n // or some internal of cloudpack, and since the user might not know about the different bundlers\n // and certainly doesn't know about cloudpack internals, a bit of context is helpful.\n const friendlySource = bundlerNames.includes(item.source) ? `${item.source} bundler` : `cloudpack ${item.source}`;\n\n return (\n <div class={styles.root}>\n <div class={cx(styles.statusBar, type === 'warning' && styles.warning)}></div>\n <div class={styles.content}>\n <div class={styles.titleArea}>\n {index + 1}. <ItemLocation loc={loc} inputPath={inputPath} /> (via: {friendlySource})\n </div>\n <pre class={styles.text}>{stripAnsi(item.text)}</pre>\n {notes.length > 0 && (\n // Formatting here might not be ideal, but messages very rarely have notes\n <details>\n <summary>Expand for more details</summary>\n <ul>\n {notes.map((note, i) => (\n <li key={i}>\n {note.location && (\n <>\n <ItemLocation loc={note.location} inputPath={inputPath} />\n <br />\n </>\n )}\n {note.text && <pre class={styles.text}>{stripAnsi(note.text)}</pre>}\n </li>\n ))}\n </ul>\n </details>\n )}\n </div>\n </div>\n );\n};\n\n/**\n * Remove ANSI codes from a string. (This is duplicated from `task-reporter` to avoid needing\n * browser support in that package, since the implementation is trivial.)\n */\nfunction stripAnsi(text: string): string {\n // eslint-disable-next-line no-control-regex -- supposed to match a control character\n return text.replace(/\\x1b\\[[\\d;]+(m|[AKB]\\b)/g, '');\n}\n\n/**\n * Return a link-button to open the source file, or a placeholder if the location is undefined.\n */\nconst ItemLocation: FunctionComponent<{ loc: BundleMessageLocation | undefined; inputPath: string | undefined }> = (\n props,\n) => {\n const { loc, inputPath } = props;\n const cloudpack = useCloudpack();\n\n if (!loc) {\n return '(path unavailable)';\n }\n\n const locationString = [loc.file, loc.line, loc.column].filter((val) => val !== undefined).join(':');\n // Don't make it clickable if we don't know the root path, or if the file path contains\n // webpack loader stuff. A real example:\n // ../../node_modules/.store/css-loader-virtual-bfb2cc7933/package/dist/cjs.js??ruleSet[1].rules[5].oneOf[0].use[1]!../../node_modules/.store/sass-loader-virtual-65ccb5bf2d/package/dist/cjs.js!./src/cssTest/example4.global.scss\n if (!inputPath || /[?!]/.test(locationString)) {\n return locationString;\n }\n\n const openSource = (): void => {\n if (!inputPath) return;\n void cloudpack.openCodeEditor.mutate({\n rootPath: inputPath,\n relativePath: loc.file,\n line: loc.line,\n column: loc.column,\n });\n };\n\n return (\n <Button variant=\"link\" onClick={openSource}>\n {locationString}\n </Button>\n );\n};\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ms-cloudpack/overlay",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.92",
|
|
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.67.
|
|
32
|
+
"@ms-cloudpack/api-server": "^0.67.10",
|
|
33
33
|
"@ms-cloudpack/common-types": "^0.34.5",
|
|
34
34
|
"@ms-cloudpack/common-types-browser": "^0.6.11",
|
|
35
35
|
"@ms-cloudpack/eslint-plugin-internal": "^0.0.1",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@ms-cloudpack/scripts": "^0.0.1",
|
|
38
38
|
"@types/react-refresh": "^0.14.0",
|
|
39
39
|
"classnames": "2.5.1",
|
|
40
|
-
"preact": "10.29.
|
|
40
|
+
"preact": "10.29.7",
|
|
41
41
|
"react": "npm:@preact/compat@18.3.2",
|
|
42
42
|
"react-focus-on": "3.10.2",
|
|
43
43
|
"react-refresh": "patch:react-refresh@npm%3A0.18.0#~/.yarn/patches/react-refresh-npm-0.18.0-5576c3f4a3.patch"
|