Skip to content

Commit

Permalink
Merge pull request #74 from patternfly/v6-beta
Browse files Browse the repository at this point in the history
feat(beta): Updated to latest react and core patternfly beta.  Also merged main and added corepack support.
  • Loading branch information
dlabaj authored Jul 31, 2024
2 parents ba586de + acf54a2 commit 24b9f41
Show file tree
Hide file tree
Showing 9 changed files with 117 additions and 86 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# React Log Viewer

Live docs available on [patternfly.org](https://www.patternfly.org/v4/extensions/log-viewer)

Live docs available on [patternfly.org](https://www.patternfly.org/extensions/log-viewer)
To run the documentation locally, clone this repo and run:
```bash
yarn install && yarn build && yarn start
Expand Down
29 changes: 15 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,15 @@
"serve:a11y": "yarn workspace @patternfly/react-log-viewer serve:a11y"
},
"devDependencies": {
"react": "^18",
"react-dom": "^18",
"typescript": "^4.7.4",
"@babel/core": "^7.19.6",
"@babel/preset-env": "^7.19.4",
"@babel/preset-react": "^7.18.6",
"@babel/preset-flow": "^7.18.6",
"@babel/preset-typescript": "^7.18.6",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "14.4.3",
"@testing-library/jest-dom": "5.16.5",
"@testing-library/dom": "9.0.0",
"@typescript-eslint/eslint-plugin": "^5.42.0",
"@typescript-eslint/parser": "^5.42.0",
"@types/react": "^18",
Expand All @@ -43,18 +49,13 @@
"prettier": "2.7.1",
"jest": "^29.2.2",
"babel-jest": "^29.2.2",
"@babel/core": "^7.19.6",
"@babel/preset-env": "^7.19.4",
"@babel/preset-react": "^7.18.6",
"@babel/preset-flow": "^7.18.6",
"@babel/preset-typescript": "^7.18.6",
"@testing-library/react":"^13.4.0",
"@testing-library/user-event": "14.4.3",
"@testing-library/jest-dom":"5.16.5",
"@testing-library/dom": "9.0.0",
"jest-environment-jsdom": "^29.2.2",
"jest-canvas-mock": "^2.4.0",
"react": "^18",
"react-dom": "^18",
"rimraf": "^2.6.2",
"serve": "^14.1.2",
"rimraf": "^2.6.2"
}
"typescript": "^4.7.4"
},
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}
14 changes: 7 additions & 7 deletions packages/module/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,21 @@
},
"homepage": "https://github.com/patternfly/react-log-viewer#readme",
"dependencies": {
"@patternfly/react-core": "^6.0.0-alpha.61",
"@patternfly/react-icons": "^6.0.0-alpha.23",
"@patternfly/react-styles": "^6.0.0-alpha.23",
"@patternfly/react-core": "^6.0.0-alpha.94",
"@patternfly/react-icons": "^6.0.0-alpha.34",
"@patternfly/react-styles": "^6.0.0-alpha.33",
"memoize-one": "^5.1.0"
},
"peerDependencies": {
"react": "^17 || ^18",
"react-dom": "^17 || ^18"
},
"devDependencies": {
"@patternfly/documentation-framework": "^6.0.0-alpha.41",
"@patternfly/patternfly": "6.0.0-alpha.139",
"@patternfly/react-table": "^6.0.0-alpha.61",
"@patternfly/documentation-framework": "^6.0.0-alpha.69",
"@patternfly/patternfly": "6.0.0-alpha.205",
"@patternfly/react-table": "^6.0.0-alpha.95",
"@patternfly/patternfly-a11y": "^4.3.1",
"@patternfly/react-code-editor": "6.0.0-alpha.61",
"@patternfly/react-code-editor": "6.0.0-alpha.94",
"resize-observer-polyfill": "^1.5.1",
"tslib": "^2.0.0",
"react-monaco-editor": "^0.51.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,32 @@ const ComplexToolbarLogViewer = () => {
}
}, [isPaused, buffer]);

const onExpandClick = (_event) => {
// Listening escape key on full screen mode.
React.useEffect(() => {
const handleFullscreenChange = () => {
const isFullscreen =
document.fullscreenElement ||
document.mozFullScreenElement ||
document.webkitFullscreenElement ||
document.msFullscreenElement;

setIsFullScreen(!!isFullscreen);
};

document.addEventListener('fullscreenchange', handleFullscreenChange);
document.addEventListener('mozfullscreenchange', handleFullscreenChange);
document.addEventListener('webkitfullscreenchange', handleFullscreenChange);
document.addEventListener('msfullscreenchange', handleFullscreenChange);

return () => {
document.removeEventListener('fullscreenchange', handleFullscreenChange);
document.removeEventListener('mozfullscreenchange', handleFullscreenChange);
document.removeEventListener('webkitfullscreenchange', handleFullscreenChange);
document.removeEventListener('msfullscreenchange', handleFullscreenChange);
};
}, []);

const onExpandClick = _event => {
const element = document.querySelector('#complex-toolbar-demo');

if (!isFullScreen) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const Component = () => (
</strong>
{` is a preconfigured component that gives you the option to visualize your log content. Log viewer renders log output in real time in a clear and structured way.`}
</p>
<AutoLinkHeader {...{"id":"light-theme-log-viewer","size":"h2","className":"ws-title ws-h2"}}>
<AutoLinkHeader {...{"id":"light-theme-log-viewer","headingLevel":"h2","className":"ws-title ws-h2"}}>
{`Light theme log viewer`}
</AutoLinkHeader>
<img src={srcImport0} width={srcImport0.width} height={srcImport0.height} {...{"alt":"Log Viewer","className":"ws-img "}}>
Expand Down Expand Up @@ -88,7 +88,7 @@ const Component = () => (
{` Expand log viewer to full screen.`}
</li>
</ol>
<AutoLinkHeader {...{"id":"dark-theme-log-viewer","size":"h2","className":"ws-title ws-h2"}}>
<AutoLinkHeader {...{"id":"dark-theme-log-viewer","headingLevel":"h2","className":"ws-title ws-h2"}}>
{`Dark theme log viewer`}
</AutoLinkHeader>
<p {...{"className":"pf-v6-c-content--p ws-p "}}>
Expand All @@ -97,7 +97,7 @@ available. All log viewer functionality remains the same whether a light or dark
</p>
<img src={srcImport1} width={srcImport1.width} height={srcImport1.height} {...{"alt":"Dark theme log viewer","className":"ws-img "}}>
</img>
<AutoLinkHeader {...{"id":"usability","size":"h2","className":"ws-title ws-h2"}}>
<AutoLinkHeader {...{"id":"usability","headingLevel":"h2","className":"ws-title ws-h2"}}>
{`Usability`}
</AutoLinkHeader>
<p {...{"className":"pf-v6-c-content--p ws-p "}}>
Expand All @@ -117,26 +117,26 @@ available. All log viewer functionality remains the same whether a light or dark
{`The user shares files frequently with other users or teams.`}
</li>
</ul>
<AutoLinkHeader {...{"id":"log-viewer-functionality","size":"h2","className":"ws-title ws-h2"}}>
<AutoLinkHeader {...{"id":"log-viewer-functionality","headingLevel":"h2","className":"ws-title ws-h2"}}>
{`Log viewer functionality`}
</AutoLinkHeader>
<AutoLinkHeader {...{"id":"with-popover","size":"h3","className":"ws-title ws-h3"}}>
<AutoLinkHeader {...{"id":"with-popover","headingLevel":"h3","className":"ws-title ws-h3"}}>
{`With popover`}
</AutoLinkHeader>
<p {...{"className":"pf-v6-c-content--p ws-p "}}>
{`The clear log button opens up a popover with further options, to prevent a user from accidentally clearing their log content.`}
</p>
<img src={srcImport2} width={srcImport2.width} height={srcImport2.height} {...{"alt":"Clear this log popover open on a Log viewer","className":"ws-img "}}>
</img>
<AutoLinkHeader {...{"id":"with-dropdown-drilldown-and-search-expanded","size":"h3","className":"ws-title ws-h3"}}>
<AutoLinkHeader {...{"id":"with-dropdown-drilldown-and-search-expanded","headingLevel":"h3","className":"ws-title ws-h3"}}>
{`With dropdown, drilldown, and search expanded`}
</AutoLinkHeader>
<p {...{"className":"pf-v6-c-content--p ws-p "}}>
{`The cog icon in the log viewer toolbar allows you to store content options such as timestamps or line numbers for better orientation within the log viewer.`}
</p>
<img src={srcImport3} width={srcImport3.width} height={srcImport3.height} {...{"alt":"Cog options open on a Log viewer","className":"ws-img "}}>
</img>
<AutoLinkHeader {...{"id":"with-search-results","size":"h3","className":"ws-title ws-h3"}}>
<AutoLinkHeader {...{"id":"with-search-results","headingLevel":"h3","className":"ws-title ws-h3"}}>
{`With search results`}
</AutoLinkHeader>
<p {...{"className":"pf-v6-c-content--p ws-p "}}>
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ pageData.examples = {

const Component = () => (
<React.Fragment>
<AutoLinkHeader {...{"id":"examples","size":"h2","className":"ws-title ws-h2"}}>
<AutoLinkHeader {...{"id":"examples","headingLevel":"h2","className":"ws-title ws-h2"}}>
{`Examples`}
</AutoLinkHeader>
{React.createElement(pageData.examples["Basic"])}
Expand Down
2 changes: 1 addition & 1 deletion packages/module/src/LogViewer/LogViewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { VariableSizeList as List, areEqual } from '../react-window';
import styles from './css/log-viewer';
import AnsiUp from '../ansi_up/ansi_up';

interface LogViewerProps {
export interface LogViewerProps {
/** String or String Array data being sent by the consumer*/
data?: string | string[];
/** Consumer may turn off the visibility on the toolbar */
Expand Down
109 changes: 57 additions & 52 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2388,27 +2388,27 @@
"@nodelib/fs.scandir" "2.1.5"
fastq "^1.6.0"

"@patternfly/ast-helpers@^1.4.0-alpha.31":
version "1.4.0-alpha.31"
resolved "https://registry.yarnpkg.com/@patternfly/ast-helpers/-/ast-helpers-1.4.0-alpha.31.tgz#d3fa479a4a4579f49848a9db7826d65ef53dc2aa"
integrity sha512-/UsMH+OTnAP4g6Tmytj6fQ4Zgp88kMQ5Q9KZdVMiXoObN3lJiBcIrg6RrwFEej5OHx+7HA+HF/lRVm8yIMuk0g==
"@patternfly/ast-helpers@^1.4.0-alpha.58":
version "1.19.0"
resolved "https://registry.yarnpkg.com/@patternfly/ast-helpers/-/ast-helpers-1.19.0.tgz#f3eecafb2e04d73b48de2a0142b18e3fc5e230de"
integrity sha512-osD5y+q7+oO6l4GCB8MnOjBLvyRZLyHk3L3XhEGwd+HxRf1YxE/NWhSP0ATuByU7xxpCXas7OaW3fKe/KgeneA==
dependencies:
acorn "^8.4.1"
acorn-class-fields "^1.0.0"
acorn-jsx "^5.3.2"
acorn-static-class-features "^1.0.0"
astring "^1.7.5"

"@patternfly/documentation-framework@^6.0.0-alpha.41":
version "6.0.0-alpha.42"
resolved "https://registry.yarnpkg.com/@patternfly/documentation-framework/-/documentation-framework-6.0.0-alpha.42.tgz#7220bcd2c6c23c3fb641c9c534da23f32da99573"
integrity sha512-S1Fi/tHYk2dzr+lYmY090x130TR2x2NErf2J9oE0WCZudpfVRK9XyODS2cyy7bUIVkgE5A8W05Ist79RgHJXlA==
"@patternfly/documentation-framework@^6.0.0-alpha.69":
version "6.0.0-alpha.69"
resolved "https://registry.yarnpkg.com/@patternfly/documentation-framework/-/documentation-framework-6.0.0-alpha.69.tgz#d411dd03107cf0ea7635531cc1fec9fa8b82a868"
integrity sha512-Qr28SSTzjNOy2BJSaJvBQYb9JOjuxFv49u7j4kGlY6BgMNUJoHYnGdTOVLBZgl1uvXfLhxRgkHBc4h5/smCFWQ==
dependencies:
"@babel/core" "^7.24.3"
"@babel/preset-env" "^7.24.3"
"@babel/preset-react" "^7.24.1"
"@mdx-js/util" "1.6.16"
"@patternfly/ast-helpers" "^1.4.0-alpha.31"
"@patternfly/ast-helpers" "^1.4.0-alpha.58"
"@reach/router" "npm:@gatsbyjs/[email protected]"
autoprefixer "9.8.6"
babel-loader "^9.1.3"
Expand Down Expand Up @@ -2481,61 +2481,61 @@
puppeteer-cluster "^0.23.0"
xmldoc "^1.1.2"

"@patternfly/[email protected].139":
version "6.0.0-alpha.139"
resolved "https://registry.yarnpkg.com/@patternfly/patternfly/-/patternfly-6.0.0-alpha.139.tgz#417d6d3cf5e923a9cff28c99ecd8a3489fa935ff"
integrity sha512-RfM0pvIhWwaSzobKh/mjkTqYMnAdeOqC1wH9zg9zTab9GyUQdeGkRkd9gpDEQhuuN/bhNpO03W6jpaqauxfpmA==
"@patternfly/[email protected].205":
version "6.0.0-alpha.205"
resolved "https://registry.yarnpkg.com/@patternfly/patternfly/-/patternfly-6.0.0-alpha.205.tgz#9974f712ee69b28ec6851c6240e52c2d99969f9c"
integrity sha512-rzatApP3YpiYOHamDm+RhQpnep2AAhVodVRr3lyg6X5naiSSbPXXGWm7ShhUfftzwW4G1le1Uy0ZlM05rtQHWg==

"@patternfly/[email protected].61":
version "6.0.0-alpha.61"
resolved "https://registry.yarnpkg.com/@patternfly/react-code-editor/-/react-code-editor-6.0.0-alpha.61.tgz#b092198346516c4149aa7a9df7d65fed6d2f7bc8"
integrity sha512-dfML9T6SYNzPrLNlSqlAc3pTW1+GqYagJowLo5U+6Qea0OuLJ91+SiAiIuX1R2VTwSjEvPkgzhUonMgKkuNm+A==
"@patternfly/[email protected].94":
version "6.0.0-alpha.94"
resolved "https://registry.yarnpkg.com/@patternfly/react-code-editor/-/react-code-editor-6.0.0-alpha.94.tgz#a462ab4194f1434aa291dc2d32c802cd06cac29e"
integrity sha512-df0re3F6nscVDbq8gQF9+7pxJSQzMDfPHfmuz6lHi6oQbsyvOXn2YTgv8nMQXFtyt2XmrK5nf3Zfj4ctCv6ZeA==
dependencies:
"@monaco-editor/react" "^4.6.0"
"@patternfly/react-core" "^6.0.0-alpha.61"
"@patternfly/react-icons" "^6.0.0-alpha.23"
"@patternfly/react-styles" "^6.0.0-alpha.23"
"@patternfly/react-core" "^6.0.0-alpha.94"
"@patternfly/react-icons" "^6.0.0-alpha.34"
"@patternfly/react-styles" "^6.0.0-alpha.33"
react-dropzone "14.2.3"
tslib "^2.6.2"

"@patternfly/react-core@^6.0.0-alpha.61":
version "6.0.0-alpha.61"
resolved "https://registry.yarnpkg.com/@patternfly/react-core/-/react-core-6.0.0-alpha.61.tgz#b31305d477294a0a82960a51224336aaee34470f"
integrity sha512-rQ1xPXRpSYktFYEQ7pywWf/GconQhA+RNYd+aVAMIR6JnSDG/9Ws5yFKIHAlHROXtjLJIHgz8TmFSBM1aW0AkQ==
"@patternfly/react-core@^6.0.0-alpha.94":
version "6.0.0-alpha.94"
resolved "https://registry.yarnpkg.com/@patternfly/react-core/-/react-core-6.0.0-alpha.94.tgz#60f8811ca5ac084ae6aff87d5fe0c6e47135a7b9"
integrity sha512-E2/ulZKhMB8QHUXbonnm5Mqtbw7TW2AyfsMHHeV4RW0nn7HccZ6G+YEjo7i4ThTCdmBqU26e57tS0VUHVmYdww==
dependencies:
"@patternfly/react-icons" "^6.0.0-alpha.23"
"@patternfly/react-styles" "^6.0.0-alpha.23"
"@patternfly/react-tokens" "^6.0.0-alpha.23"
"@patternfly/react-icons" "^6.0.0-alpha.34"
"@patternfly/react-styles" "^6.0.0-alpha.33"
"@patternfly/react-tokens" "^6.0.0-alpha.33"
focus-trap "7.5.4"
react-dropzone "^14.2.3"
tslib "^2.6.2"

"@patternfly/react-icons@^6.0.0-alpha.23":
version "6.0.0-alpha.23"
resolved "https://registry.yarnpkg.com/@patternfly/react-icons/-/react-icons-6.0.0-alpha.23.tgz#3903733fb82113b41bff0669232b90e1277ed35a"
integrity sha512-OfKHrS2ZSmu9fMEBKQ2t6ZeJ/uw1y7pobxATWn08NHJvscAceiN5a76VET2+kLrHYXCpK/EYjgpTlXNmm0hZKw==

"@patternfly/react-styles@^6.0.0-alpha.23":
version "6.0.0-alpha.23"
resolved "https://registry.yarnpkg.com/@patternfly/react-styles/-/react-styles-6.0.0-alpha.23.tgz#b4bf2fefe5a2039a466c78888475c9c533ae8f70"
integrity sha512-N8HuDF68rFRJkWVoCDSUauiOrnjcLHUFrGJGaxnjynzee+GbpHf22NS9E9xmc25CDDzICMrU/SvthocxzQowKA==

"@patternfly/react-table@^6.0.0-alpha.61":
version "6.0.0-alpha.61"
resolved "https://registry.yarnpkg.com/@patternfly/react-table/-/react-table-6.0.0-alpha.61.tgz#4a6cfa66458236baf048b53609ac42b544934a2e"
integrity sha512-bA5rBKzuip4DPd3u9oJIlR0IrCCn+aeHwk7k1fWpFd/IbFRMkrHZQIXOOD48IARxUDjvP26BWqMbxFxLdN7Fww==
dependencies:
"@patternfly/react-core" "^6.0.0-alpha.61"
"@patternfly/react-icons" "^6.0.0-alpha.23"
"@patternfly/react-styles" "^6.0.0-alpha.23"
"@patternfly/react-tokens" "^6.0.0-alpha.23"
lodash "^4.17.19"
tslib "^2.6.2"
"@patternfly/react-icons@^6.0.0-alpha.34":
version "6.0.0-alpha.34"
resolved "https://registry.yarnpkg.com/@patternfly/react-icons/-/react-icons-6.0.0-alpha.34.tgz#4066d5bb4f66cf461aab9554d86968e0964d6ae2"
integrity sha512-YApbSfIEevWhTila9OzG6RHmbu/f+08XCUiNjTri2ZY54flvX/+GZDdt6gLzS+JQlysA6MCtzRxLgWAKh27Uew==

"@patternfly/react-styles@^6.0.0-alpha.33":
version "6.0.0-alpha.33"
resolved "https://registry.yarnpkg.com/@patternfly/react-styles/-/react-styles-6.0.0-alpha.33.tgz#6f1035e7b3ac332cc923b618db2caf5a38793ff5"
integrity sha512-YWKYugsoMw4IdLm02d0d5gKM4RKIhF3n2DlomJ6crNQfnpb9jQhA9Zixj35LiHUrQRre97W5VA4UfSGM5zZk5w==

"@patternfly/react-table@^6.0.0-alpha.95":
version "6.0.0-alpha.95"
resolved "https://registry.yarnpkg.com/@patternfly/react-table/-/react-table-6.0.0-alpha.95.tgz#f49568c69aafb89adb1e0fb6513e7eceebceb29d"
integrity sha512-fVq4iNojcrB4G212LNeLfCwYXWTotLPbD60+s85HkIsuaFLHM2mEToAebUm1RpYgVjO1mFq95wt/8WvSmVPzgQ==
dependencies:
"@patternfly/react-core" "^6.0.0-alpha.94"
"@patternfly/react-icons" "^6.0.0-alpha.34"
"@patternfly/react-styles" "^6.0.0-alpha.33"
"@patternfly/react-tokens" "^6.0.0-alpha.33"
lodash "^4.17.21"
tslib "^2.6.3"

"@patternfly/react-tokens@^6.0.0-alpha.23":
version "6.0.0-alpha.23"
resolved "https://registry.yarnpkg.com/@patternfly/react-tokens/-/react-tokens-6.0.0-alpha.23.tgz#ee3f5da222bf52b75d9c3f578be5885eff745ef6"
integrity sha512-YaHFiY1vxDI8rpBHY5qt6FbZV2onnvWwbxQseCN2UxDeLx2pb54ZN/sutUnie6FUm3cyKFaTwYS2zDGHZYmeMg==
"@patternfly/react-tokens@^6.0.0-alpha.33":
version "6.0.0-alpha.33"
resolved "https://registry.yarnpkg.com/@patternfly/react-tokens/-/react-tokens-6.0.0-alpha.33.tgz#a207f74dbad7943b0ac18d5abb5885bcbff1cebc"
integrity sha512-77hzWw2ODIBFFHUF+Vf3NseBEAyddWIakqZNqLc2TSoWFUOEpTd1DBtb1qb5RV3uMzKHdOtHNIh17P0Unz41KA==

"@polka/url@^1.0.0-next.20":
version "1.0.0-next.21"
Expand Down Expand Up @@ -11038,6 +11038,11 @@ tslib@^2.6.2:
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae"
integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==

tslib@^2.6.3:
version "2.6.3"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.3.tgz#0438f810ad7a9edcde7a241c3d80db693c8cbfe0"
integrity sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==

tsutils@^3.21.0:
version "3.21.0"
resolved "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz"
Expand Down

0 comments on commit 24b9f41

Please sign in to comment.