Skip to content

Commit 4a58c89

Browse files
tlabajmcokerpatternfly-buildjpuzz0adamviktora
authored
V6 rebase (#10033)
* fix(RTL): added right-to-left page demo (#9694) * chore(release): releasing packages [ci skip] - @patternfly/[email protected] - @patternfly/[email protected] - @patternfly/[email protected] - [email protected] - @patternfly/[email protected] * fix(Wizard): onStepChange - skip isDisabled & isHidden (#9748) * fix(Text input): Added aria-expanded (#9705) * fix(Text input): Added aria-expanded * add interface * updates from review * fix(Notification Drawer): Added screen reader text for notification drawer item read state (#9569) * fix(Notification Drawer): Added screen reader text for notification drawer item read state * fix snapshot * Update prop description * add aria-live * update snapshots * feat(Wizard): ability to add props to WizardFooter buttons (#9709) * feat: ability to add props to WizardFooter buttons * fix(WizardFooter): null check * fix(Wizard): simpler design of adding footer buttons props * test(Wizard): can add props to footer buttons * docs(WizardFooter): move comment so docs have correct description * refactor(WizardFooter): move FooterButtonProps to types file * chore(Divider): update tests to new standards (#9714) * chore(Divider): update tests to new standards * changes from PR review * chore(release): releasing packages [ci skip] - @patternfly/[email protected] - @patternfly/[email protected] - @patternfly/[email protected] - [email protected] - @patternfly/[email protected] * fix(TreeView): define button type (#9770) * bug(build): fixed built ESM files importing CJS files from react-styles (#9347) * bug(build): fixed built ESM files importing CJS files from react-styles * edited yarn.lock to invalidate deps cache in GH actions * excluded file extensions from react-styles path transform in ESM build * updated jest config to transform .mjs files * updated pr action to invalidate deps cache if package files added/edited * chore(deps): Add ts-node to support executing typescript files directly * chore(release): releasing packages [ci skip] - @patternfly/[email protected] - @patternfly/[email protected] - @patternfly/[email protected] - [email protected] - @patternfly/[email protected] - [email protected] * chore(deps): update dependency @patternfly/patternfly to v5.2.0-prerelease.4 (#9780) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(release): releasing packages [ci skip] - @patternfly/[email protected] - @patternfly/[email protected] - @patternfly/[email protected] - @patternfly/[email protected] - @patternfly/[email protected] - [email protected] - @patternfly/[email protected] - @patternfly/[email protected] - @patternfly/[email protected] * feat(Datalist): implement full page Basic demo to match HTML #9048 (#9087) * feat(Datalist): implement full page Basic demo to match HTML #9048 * fix syntax error * comments applied * comments applied * comments applied * comments applied * \xa0 comments applied * move key per review comments * address PR comments * revert change to package.json * Converted basic demo to TS --------- Co-authored-by: nicolethoen <[email protected]> Co-authored-by: Eric Olkowski <[email protected]> * fix(ClipboardCopy): kepp caret position (#9772) * chore(release): releasing packages [ci skip] - @patternfly/[email protected] - @patternfly/[email protected] - @patternfly/[email protected] - [email protected] - @patternfly/[email protected] * chore(deps): update devdependencies (#9757) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update dependency @patternfly/patternfly to v5.2.0-prerelease.5 (#9806) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update devdependencies (#9800) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(release): releasing packages [ci skip] - @patternfly/[email protected] - @patternfly/[email protected] - @patternfly/[email protected] - @patternfly/[email protected] - @patternfly/[email protected] - [email protected] - @patternfly/[email protected] - @patternfly/[email protected] - @patternfly/[email protected] * fix(DatePicker): updated logic for parsing and focus management (#9794) * chore(release): releasing packages [ci skip] - @patternfly/[email protected] - @patternfly/[email protected] - @patternfly/[email protected] - [email protected] - @patternfly/[email protected] * chore(PrimaryDetail): convert demos to TS (#9787) * chore(release): releasing packages [ci skip] - @patternfly/[email protected] - @patternfly/[email protected] - @patternfly/[email protected] - [email protected] - @patternfly/[email protected] * chore(misc): clean up instances of Array.apply (#9798) * clean up instances of Array.apply * rename item to value * chore(release): releasing packages [ci skip] - @patternfly/[email protected] - @patternfly/[email protected] - @patternfly/[email protected] - @patternfly/[email protected] - [email protected] - @patternfly/[email protected] * chore(eslint): Added React Testing Library linter plugin (#9805) * chore(release): releasing packages [ci skip] - @patternfly/[email protected] - @patternfly/[email protected] - @patternfly/[email protected] - @patternfly/[email protected] - [email protected] - @patternfly/[email protected] * chore(DataList): update tests (#9672) * add spread prop test, update test * chore(DataList): update tests * fix merge error * break out into separate files, pr feedback * updates * fix some example ids * minor test updates * revert action change * bug(ClipboardCopy): change children type to string (#9743) * bug(ClipboardCopy): change children type to string Signed-off-by: gitdallas <[email protected]> * fix clipboardcopyexpanded to work with string children Signed-off-by: gitdallas <[email protected]> * refactor a bit * fix bad rebase --------- Signed-off-by: gitdallas <[email protected]> * chore(deps): update devdependencies (#9817) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix Search Input - composable advanced search demo (#9484) * Search Input - composable advanced search fix date * remove isFill from datePicker * docs(custom menu): add example with search input inline filtering (#9687) * docs(custom menu): add example with search input inline filtering * refactor(demo menu): rename to InlineSearchFilterMenuDemo * chore(HelperText): update tests (#9761) * chore(HelperText): update tests * break out helpertextitem tests, update tests * updates * fix lint * fix(Chip): update tooltip vis when chip updates (#9819) * fix(Chip): enable tooltip when chip updates * fix casting * chore(DescriptionList): update tests (#9753) * chore(DescriptionList): update tests * break out tests, pr feedback * updates * add autofit width mod test * chore(release): releasing packages [ci skip] - @patternfly/[email protected] - @patternfly/[email protected] - @patternfly/[email protected] - [email protected] - @patternfly/[email protected] * chore(TreeView): updated tests (#9773) * chore(TreeView): updated tests * Added tests for TreeViewListItem * Added tests for TreeViewRoot and TreeView * Updated snapshots and queries * chore(Table) convert demos to ts (#9621) * chore(table) convert to TS chore(DashboardWrapper) convert to TS chore(Table) convert demos to TS delete superfluous dashboard components declare as ts files remove duplicate ids fix import errors, WIP build errors sync toolbar demo with main * update import paths * fix more import paths * try import from dist/esm * fix build * convert remaining table demos to ts, WIP draggable logic * revert col management with draggable to previous dnd implementation * align file names with demo names, cleanup types, fix TS errors in demo files * update fileNames in table.md * PR feedback from Eric * fix category dropdown * fix demos, remove table actions that do not support main purpose of column management demos * add fix for a11y tests as suggested by Eric * update toolbar snap * add param type to labelText --------- Co-authored-by: Jenny <[email protected]> * chore(release): releasing packages [ci skip] - @patternfly/[email protected] - @patternfly/[email protected] - @patternfly/[email protected] - [email protected] - @patternfly/[email protected] * chore(deps): update devdependencies (#9829) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * docs(select): Adds documentation to React examples. (#9536) * fix conflicts * docs(select): Adds documentation for React examples. * Adds content to new select React examples. * Updates typeahead with create example. * Clarify mult typeahead with create content. * Finalizing wording. * Updates content from review. --------- Co-authored-by: nicolethoen <[email protected]> * chore(release): releasing packages [ci skip] - @patternfly/[email protected] - @patternfly/[email protected] - @patternfly/[email protected] - [email protected] - @patternfly/[email protected] * chore(deps): update devdependencies (#9833) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update devdependencies (#9837) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix link to patternfly community contributors document (#9840) * chore(deps): update devdependencies (#9846) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(Table): make tooltip prop consistent (#9803) * fix(Table): make tooltip prop consistent * make tooltip ReactNode and add tooltipProps to Th * add prop to useEffect * fix logic for keyboard focus * fix useeffect * chore(DataList): convert data list react demo to TS (#9818) * convert data list react demo to TS * update function component name to match file * fix(AlertGroupDemo): crashed when adding default alerts (#9826) * chore(release): releasing packages [ci skip] - @patternfly/[email protected] - @patternfly/[email protected] - @patternfly/[email protected] - [email protected] - @patternfly/[email protected] * chore(deps): update dependency @types/jest to v29.5.11 (#9854) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update Popover returnFocusOnDeactivate prop (#9865) Closes #9863 * chore(release): releasing packages [ci skip] - @patternfly/[email protected] - @patternfly/[email protected] - @patternfly/[email protected] - [email protected] - @patternfly/[email protected] * chore(deps): update dependency @patternfly/patternfly to v5.2.0-prerelease.7 (#9867) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(release): releasing packages [ci skip] - @patternfly/[email protected] - @patternfly/[email protected] - @patternfly/[email protected] - @patternfly/[email protected] - @patternfly/[email protected] - [email protected] - @patternfly/[email protected] - @patternfly/[email protected] - @patternfly/[email protected] * chore(deps): update devdependencies (#9873) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(MenuItem): Add download to MenuItem (#9892) * chore(release): releasing packages [ci skip] - @patternfly/[email protected] - @patternfly/[email protected] - @patternfly/[email protected] - @patternfly/[email protected] - [email protected] - @patternfly/[email protected] * feat(Accordion): added toggle alignment functionality (#9877) * feat(Accordion): added toggle alignment functionality * Updated prop name and description * chore(release): releasing packages [ci skip] - @patternfly/[email protected] - @patternfly/[email protected] - @patternfly/[email protected] - [email protected] - @patternfly/[email protected] * chore(deps): update devdependencies (#9885) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore: add primary button with icon to button docs (#9871) * chore(release): releasing packages [ci skip] - @patternfly/[email protected] - @patternfly/[email protected] - @patternfly/[email protected] - [email protected] - @patternfly/[email protected] * fix(Chip): prevented duplicate ID being applied (#9886) * fix(Chip): prevented duplicate ID being applied * Updated snapshot * Updated integration test selector * chore(release): releasing packages [ci skip] - @patternfly/[email protected] - @patternfly/[email protected] - @patternfly/[email protected] - @patternfly/[email protected] - [email protected] - @patternfly/[email protected] * chore(expandablesection): Added a demo to show how to use expandable section to create an expandable text component. (#9887) * chore(expandablesection): Added a demo to show how to use expandable section to create an expandable text component. * Update packages/react-core/src/demos/ExpandableSection/ExpandableSection.md Co-authored-by: Erin Donehoo <[email protected]> * Update packages/react-core/src/demos/ExpandableSection/ExpandableSection.md Co-authored-by: Erin Donehoo <[email protected]> * Update packages/react-core/src/demos/ExpandableSection/ExpandableSection.md Co-authored-by: Erin Donehoo <[email protected]> --------- Co-authored-by: Erin Donehoo <[email protected]> Co-authored-by: Titani Labaj <[email protected]> * chore(release): releasing packages [ci skip] - @patternfly/[email protected] - @patternfly/[email protected] - @patternfly/[email protected] - [email protected] - @patternfly/[email protected] * feat(CodeEditor): use new monaco package (#9842) * feat(CodeEditor): use new monaco package * remove commented code * fix integration * update tests and mock out editor * move to direct dependency * chore(release): releasing packages [ci skip] - @patternfly/[email protected] - @patternfly/[email protected] - @patternfly/[email protected] * feat(Modal next): Introduce a next composable Modal (#9852) * feat(Modal next): Introduce a next composble Modal * upodate for failing tests * add integration test * updates from review * updates from Erin's comments * Updates from comments * chore(build): Fix lint issues (#9938) * chore(release): releasing packages [ci skip] - @patternfly/[email protected] - @patternfly/[email protected] - @patternfly/[email protected] - @patternfly/[email protected] - [email protected] - @patternfly/[email protected] * feat(DragDrop): new drag drop styling fixes (#9784) * feat(DragDrop): introduce new package and deprecate old implementation * refactor a bunch * style fixes * fix lint errors * fix lint * update snap * update duallistselector example, try exporting interface from separate file * bump versions in dragdrop for mismatch * fix versions * pr feedback * fix versions after merge * version update after rebase * update md * move into next folder for docgen * update version after rebase * update ver after rebase * update ver after rebase * update ver after rebase * remove unused prop, update wording * move some examples to demos * update ver after rebase * update new demos text * update wording p1 * update wording p2 * update wording p3 * update wording p4 * fix links * remove beta flags since page is beta * update ver after rebase --------- Co-authored-by: nicolethoen <[email protected]> * chore(release): releasing packages [ci skip] - @patternfly/[email protected] - @patternfly/[email protected] - @patternfly/[email protected] - @patternfly/[email protected] - [email protected] - @patternfly/[email protected] * Add support for isLabelWrapped and component in Checkbox / Radio (#9830) * feat(Checkbox): add support for isLabelWrapped and isLabelBeforeButton * feat(Radio): add support for component * refactor(Radio/Checkbox): check isLabelBeforeButton only once * feat(Radio/Checkbox): add support for component === "label" behaving the same as isLabelWrapped * docs(Radio/Checkbox): update props description * test(Checkbox): add unit tests * test(Checkbox): unit test * test(Radio): unit tests * chore(build): Fix lint errors (#9950) * chore(release): releasing packages [ci skip] - @patternfly/[email protected] - @patternfly/[email protected] - @patternfly/[email protected] - @patternfly/[email protected] - [email protected] - @patternfly/[email protected] * chore(deps): update devdependencies (#9932) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(Popover): doc click event (#9952) * chore(release): releasing packages [ci skip] - @patternfly/[email protected] - @patternfly/[email protected] - @patternfly/[email protected] - @patternfly/[email protected] - [email protected] - @patternfly/[email protected] * Update react-core dist/dynamic to include exported styles (#9939) * chore(release): releasing packages [ci skip] - @patternfly/[email protected] - @patternfly/[email protected] - @patternfly/[email protected] - @patternfly/[email protected] - @patternfly/[email protected] - @patternfly/[email protected] - [email protected] - @patternfly/[email protected] * chore(deps): update devdependencies (#9955) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * FileUploadField fix to set name attribute on input element (#9941) * FileUploadField name attribute fix * update snapshots * prevent breaking change --------- Co-authored-by: nicolethoen <[email protected]> * chore(release): releasing packages [ci skip] - @patternfly/[email protected] - @patternfly/[email protected] - @patternfly/[email protected] - @patternfly/[email protected] - [email protected] - @patternfly/[email protected] * chore(deps): update devdependencies (#9967) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update Victory dependencies (#9963) * feat(charts): Victory dependency update Closes #9960 * chore(charts): update lodash dependency * chore(release): releasing packages [ci skip] - @patternfly/[email protected] - @patternfly/[email protected] * fix(Clipboard copy): Fixed regression with updating main content when expanded (#9975) * chore(release): releasing packages [ci skip] - @patternfly/[email protected] - @patternfly/[email protected] - @patternfly/[email protected] - @patternfly/[email protected] - [email protected] - @patternfly/[email protected] * fix(ClipboardCopy): update main content on children change when expanded (#10015) * chore(release): releasing packages [ci skip] - @patternfly/[email protected] - @patternfly/[email protected] - @patternfly/[email protected] - @patternfly/[email protected] - [email protected] - @patternfly/[email protected] * feat(DragDrop): fix import warning (#10023) * chore(release): releasing packages [ci skip] - @patternfly/[email protected] - @patternfly/[email protected] * fix accoridan examples * updates to fix docs * bump docs-framework version --------- Signed-off-by: gitdallas <[email protected]> Co-authored-by: Michael Coker <[email protected]> Co-authored-by: patternfly-build <[email protected]> Co-authored-by: Jeff Puzzo <[email protected]> Co-authored-by: adamviktora <[email protected]> Co-authored-by: Mark Franceschelli <[email protected]> Co-authored-by: kmcfaul <[email protected]> Co-authored-by: Austin Sullivan <[email protected]> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Kells512 <[email protected]> Co-authored-by: nicolethoen <[email protected]> Co-authored-by: Eric Olkowski <[email protected]> Co-authored-by: Eric Olkowski <[email protected]> Co-authored-by: Jenny <[email protected]> Co-authored-by: Dallas <[email protected]> Co-authored-by: Maria <[email protected]> Co-authored-by: Dominik Petřík <[email protected]> Co-authored-by: Erin Donehoo <[email protected]> Co-authored-by: Yurith Rubio <[email protected]> Co-authored-by: Joachim Schuler <[email protected]> Co-authored-by: Robb Hamilton <[email protected]> Co-authored-by: Donald Labaj <[email protected]> Co-authored-by: Vojtech Szocs <[email protected]> Co-authored-by: James Talton <[email protected]> Co-authored-by: Dan Labrecque <[email protected]> Co-authored-by: Titani <[email protected]>
1 parent 37065eb commit 4a58c89

File tree

138 files changed

+6318
-1145
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

138 files changed

+6318
-1145
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"@octokit/rest": "^20.0.0",
3838
"@testing-library/jest-dom": "^5.16.5",
3939
"@testing-library/react": "^13.4.0",
40-
"@testing-library/user-event": "14.5.1",
40+
"@testing-library/user-event": "14.5.2",
4141
"@types/jest": "29.5.11",
4242
"@types/react": "^18",
4343
"@types/react-dom": "^18",

packages/react-charts/CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,26 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
7373

7474
**Note:** Version bump only for package @patternfly/react-charts
7575

76+
# 7.2.0-prerelease.10 (2024-01-15)
77+
78+
**Note:** Version bump only for package @patternfly/react-charts
79+
80+
# 7.2.0-prerelease.9 (2024-01-11)
81+
82+
**Note:** Version bump only for package @patternfly/react-charts
83+
84+
# 7.2.0-prerelease.8 (2023-12-11)
85+
86+
**Note:** Version bump only for package @patternfly/react-charts
87+
88+
# 7.2.0-prerelease.7 (2023-11-10)
89+
90+
**Note:** Version bump only for package @patternfly/react-charts
91+
92+
# 7.2.0-prerelease.6 (2023-11-03)
93+
94+
**Note:** Version bump only for package @patternfly/react-charts
95+
7696
# 7.2.0-prerelease.5 (2023-10-26)
7797

7898
**Note:** Version bump only for package @patternfly/react-charts

packages/react-charts/package.json

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -32,25 +32,25 @@
3232
"@patternfly/react-styles": "^6.0.0-alpha.9",
3333
"@patternfly/react-tokens": "^6.0.0-alpha.9",
3434
"hoist-non-react-statics": "^3.3.0",
35-
"lodash": "^4.17.19",
35+
"lodash": "^4.17.21",
3636
"tslib": "^2.5.0",
37-
"victory-area": "^36.6.11",
38-
"victory-axis": "^36.6.11",
39-
"victory-bar": "^36.6.11",
40-
"victory-box-plot": "^36.6.11",
41-
"victory-chart": "^36.6.11",
42-
"victory-core": "^36.6.11",
43-
"victory-create-container": "^36.6.11",
44-
"victory-cursor-container": "^36.6.11",
45-
"victory-group": "^36.6.11",
46-
"victory-legend": "^36.6.11",
47-
"victory-line": "^36.6.11",
48-
"victory-pie": "^36.6.11",
49-
"victory-scatter": "^36.6.11",
50-
"victory-stack": "^36.6.11",
51-
"victory-tooltip": "^36.6.11",
52-
"victory-voronoi-container": "^36.6.11",
53-
"victory-zoom-container": "^36.6.11"
37+
"victory-area": "^36.8.1",
38+
"victory-axis": "^36.8.1",
39+
"victory-bar": "^36.8.1",
40+
"victory-box-plot": "^36.8.1",
41+
"victory-chart": "^36.8.1",
42+
"victory-core": "^36.8.1",
43+
"victory-create-container": "^36.8.1",
44+
"victory-cursor-container": "^36.8.1",
45+
"victory-group": "^36.8.1",
46+
"victory-legend": "^36.8.1",
47+
"victory-line": "^36.8.1",
48+
"victory-pie": "^36.8.1",
49+
"victory-scatter": "^36.8.1",
50+
"victory-stack": "^36.8.1",
51+
"victory-tooltip": "^36.8.1",
52+
"victory-voronoi-container": "^36.8.1",
53+
"victory-zoom-container": "^36.8.1"
5454
},
5555
"peerDependencies": {
5656
"react": "^17 || ^18",
Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
{
2-
"packageName": "@patternfly/react-charts",
3-
"exclude": [
4-
"dist/esm/deprecated/index.js",
5-
"dist/esm/next/index.js"
6-
]
7-
}
2+
"packageName": "@patternfly/react-charts",
3+
"exclude": ["dist/esm/deprecated/index.js", "dist/esm/next/index.js"]
4+
}

packages/react-code-editor/CHANGELOG.md

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,128 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
237237

238238
**Note:** Version bump only for package @patternfly/react-code-editor
239239

240+
# [5.2.0-prerelease.49](https://github.com/patternfly/patternfly-react/compare/@patternfly/[email protected]...@patternfly/[email protected]) (2024-01-17)
241+
242+
**Note:** Version bump only for package @patternfly/react-code-editor
243+
244+
# 5.2.0-prerelease.48 (2024-01-16)
245+
246+
**Note:** Version bump only for package @patternfly/react-code-editor
247+
248+
# [5.2.0-prerelease.47](https://github.com/patternfly/patternfly-react/compare/@patternfly/[email protected]...@patternfly/[email protected]) (2024-01-15)
249+
250+
**Note:** Version bump only for package @patternfly/react-code-editor
251+
252+
# [5.2.0-prerelease.46](https://github.com/patternfly/patternfly-react/compare/@patternfly/[email protected]...@patternfly/[email protected]) (2024-01-11)
253+
254+
**Note:** Version bump only for package @patternfly/react-code-editor
255+
256+
# [5.2.0-prerelease.45](https://github.com/patternfly/patternfly-react/compare/@patternfly/[email protected]...@patternfly/[email protected]) (2024-01-10)
257+
258+
**Note:** Version bump only for package @patternfly/react-code-editor
259+
260+
# [5.2.0-prerelease.44](https://github.com/patternfly/patternfly-react/compare/@patternfly/[email protected]...@patternfly/[email protected]) (2024-01-09)
261+
262+
**Note:** Version bump only for package @patternfly/react-code-editor
263+
264+
# [5.2.0-prerelease.43](https://github.com/patternfly/patternfly-react/compare/@patternfly/[email protected]...@patternfly/[email protected]) (2024-01-08)
265+
266+
**Note:** Version bump only for package @patternfly/react-code-editor
267+
268+
# [5.2.0-prerelease.42](https://github.com/patternfly/patternfly-react/compare/@patternfly/[email protected]...@patternfly/[email protected]) (2024-01-05)
269+
270+
**Note:** Version bump only for package @patternfly/react-code-editor
271+
272+
# [5.2.0-prerelease.41](https://github.com/patternfly/patternfly-react/compare/@patternfly/[email protected]...@patternfly/[email protected]) (2024-01-05)
273+
274+
### Features
275+
276+
- **CodeEditor:** use new monaco package ([#9842](https://github.com/patternfly/patternfly-react/issues/9842)) ([54dd134](https://github.com/patternfly/patternfly-react/commit/54dd134d6c67c4fc1d7630fd1e7c718f66061342))
277+
278+
# [5.2.0-prerelease.40](https://github.com/patternfly/patternfly-react/compare/@patternfly/[email protected]...@patternfly/[email protected]) (2024-01-04)
279+
280+
**Note:** Version bump only for package @patternfly/react-code-editor
281+
282+
# [5.2.0-prerelease.39](https://github.com/patternfly/patternfly-react/compare/@patternfly/[email protected]...@patternfly/[email protected]) (2024-01-03)
283+
284+
**Note:** Version bump only for package @patternfly/react-code-editor
285+
286+
# [5.2.0-prerelease.38](https://github.com/patternfly/patternfly-react/compare/@patternfly/[email protected]...@patternfly/[email protected]) (2024-01-02)
287+
288+
**Note:** Version bump only for package @patternfly/react-code-editor
289+
290+
# [5.2.0-prerelease.37](https://github.com/patternfly/patternfly-react/compare/@patternfly/[email protected]...@patternfly/[email protected]) (2023-12-20)
291+
292+
**Note:** Version bump only for package @patternfly/react-code-editor
293+
294+
# [5.2.0-prerelease.36](https://github.com/patternfly/patternfly-react/compare/@patternfly/[email protected]...@patternfly/[email protected]) (2023-12-14)
295+
296+
**Note:** Version bump only for package @patternfly/react-code-editor
297+
298+
# [5.2.0-prerelease.35](https://github.com/patternfly/patternfly-react/compare/@patternfly/[email protected]...@patternfly/[email protected]) (2023-12-11)
299+
300+
**Note:** Version bump only for package @patternfly/react-code-editor
301+
302+
# [5.2.0-prerelease.34](https://github.com/patternfly/patternfly-react/compare/@patternfly/[email protected]...@patternfly/[email protected]) (2023-12-07)
303+
304+
**Note:** Version bump only for package @patternfly/react-code-editor
305+
306+
# [5.2.0-prerelease.33](https://github.com/patternfly/patternfly-react/compare/@patternfly/[email protected]...@patternfly/[email protected]) (2023-12-06)
307+
308+
**Note:** Version bump only for package @patternfly/react-code-editor
309+
310+
# [5.2.0-prerelease.32](https://github.com/patternfly/patternfly-react/compare/@patternfly/[email protected]...@patternfly/[email protected]) (2023-11-21)
311+
312+
**Note:** Version bump only for package @patternfly/react-code-editor
313+
314+
# [5.2.0-prerelease.31](https://github.com/patternfly/patternfly-react/compare/@patternfly/[email protected]...@patternfly/[email protected]) (2023-11-17)
315+
316+
**Note:** Version bump only for package @patternfly/react-code-editor
317+
318+
# [5.2.0-prerelease.30](https://github.com/patternfly/patternfly-react/compare/@patternfly/[email protected]...@patternfly/[email protected]) (2023-11-16)
319+
320+
**Note:** Version bump only for package @patternfly/react-code-editor
321+
322+
# [5.2.0-prerelease.29](https://github.com/patternfly/patternfly-react/compare/@patternfly/[email protected]...@patternfly/[email protected]) (2023-11-14)
323+
324+
**Note:** Version bump only for package @patternfly/react-code-editor
325+
326+
# [5.2.0-prerelease.28](https://github.com/patternfly/patternfly-react/compare/@patternfly/[email protected]...@patternfly/[email protected]) (2023-11-14)
327+
328+
**Note:** Version bump only for package @patternfly/react-code-editor
329+
330+
# [5.2.0-prerelease.27](https://github.com/patternfly/patternfly-react/compare/@patternfly/[email protected]...@patternfly/[email protected]) (2023-11-14)
331+
332+
**Note:** Version bump only for package @patternfly/react-code-editor
333+
334+
# [5.2.0-prerelease.26](https://github.com/patternfly/patternfly-react/compare/@patternfly/[email protected]...@patternfly/[email protected]) (2023-11-13)
335+
336+
**Note:** Version bump only for package @patternfly/react-code-editor
337+
338+
# [5.2.0-prerelease.25](https://github.com/patternfly/patternfly-react/compare/@patternfly/[email protected]...@patternfly/[email protected]) (2023-11-10)
339+
340+
**Note:** Version bump only for package @patternfly/react-code-editor
341+
342+
# [5.2.0-prerelease.24](https://github.com/patternfly/patternfly-react/compare/@patternfly/[email protected]...@patternfly/[email protected]) (2023-11-03)
343+
344+
**Note:** Version bump only for package @patternfly/react-code-editor
345+
346+
# [5.2.0-prerelease.23](https://github.com/patternfly/patternfly-react/compare/@patternfly/[email protected]...@patternfly/[email protected]) (2023-11-03)
347+
348+
**Note:** Version bump only for package @patternfly/react-code-editor
349+
350+
# [5.2.0-prerelease.22](https://github.com/patternfly/patternfly-react/compare/@patternfly/[email protected]...@patternfly/[email protected]) (2023-11-02)
351+
352+
**Note:** Version bump only for package @patternfly/react-code-editor
353+
354+
# [5.2.0-prerelease.21](https://github.com/patternfly/patternfly-react/compare/@patternfly/[email protected]...@patternfly/[email protected]) (2023-11-02)
355+
356+
**Note:** Version bump only for package @patternfly/react-code-editor
357+
358+
# [5.2.0-prerelease.20](https://github.com/patternfly/patternfly-react/compare/@patternfly/[email protected]...@patternfly/[email protected]) (2023-11-02)
359+
360+
**Note:** Version bump only for package @patternfly/react-code-editor
361+
240362
# [5.2.0-prerelease.19](https://github.com/patternfly/patternfly-react/compare/@patternfly/[email protected]...@patternfly/[email protected]) (2023-10-30)
241363

242364
**Note:** Version bump only for package @patternfly/react-code-editor

packages/react-code-editor/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@
3434
"@patternfly/react-icons": "^6.0.0-alpha.9",
3535
"@patternfly/react-styles": "^6.0.0-alpha.9",
3636
"react-dropzone": "14.2.3",
37-
"tslib": "^2.5.0"
37+
"tslib": "^2.5.0",
38+
"@monaco-editor/react": "^4.6.0"
3839
},
3940
"peerDependencies": {
4041
"react": "^17 || ^18",
41-
"react-dom": "^17 || ^18",
42-
"react-monaco-editor": "^0.51.0"
42+
"react-dom": "^17 || ^18"
4343
},
4444
"devDependencies": {
4545
"rimraf": "^2.6.2",

packages/react-code-editor/src/components/CodeEditor/CodeEditor.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
PopoverProps,
1616
TooltipPosition
1717
} from '@patternfly/react-core';
18-
import MonacoEditor, { ChangeHandler, EditorDidMount } from 'react-monaco-editor';
18+
import Editor, { Monaco } from '@monaco-editor/react';
1919
import { editor } from 'monaco-editor/esm/vs/editor/editor.api';
2020
import CopyIcon from '@patternfly/react-icons/dist/esm/icons/copy-icon';
2121
import UploadIcon from '@patternfly/react-icons/dist/esm/icons/upload-icon';
@@ -26,6 +26,9 @@ import Dropzone, { FileRejection } from 'react-dropzone';
2626
import { CodeEditorContext } from './CodeEditorUtils';
2727
import { CodeEditorControl } from './CodeEditorControl';
2828

29+
export type ChangeHandler = (value: string, event: editor.IModelContentChangedEvent) => void;
30+
export type EditorDidMount = (editor: editor.IStandaloneCodeEditor, monaco: Monaco) => void;
31+
2932
export interface Shortcut {
3033
description: string;
3134
keys: string[];
@@ -619,15 +622,15 @@ class CodeEditor extends React.Component<CodeEditorProps, CodeEditorState> {
619622

620623
const editor = (
621624
<div className={css(styles.codeEditorCode)} ref={this.wrapperRef} tabIndex={0} dir="ltr">
622-
<MonacoEditor
625+
<Editor
623626
height={height}
624627
width={width}
625628
language={language}
626629
value={value}
627630
options={options}
628631
overrideServices={overrideServices}
629632
onChange={this.onChange}
630-
editorDidMount={this.editorDidMount}
633+
onMount={this.editorDidMount}
631634
theme={isDarkTheme ? 'vs-dark' : 'vs-light'}
632635
/>
633636
</div>
Lines changed: 72 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,79 @@
11
import React from 'react';
2-
import { render } from '@testing-library/react';
2+
import { render, screen, act } from '@testing-library/react';
33
import { CodeEditor, Language } from '../CodeEditor';
4+
import styles from '@patternfly/react-styles/css/components/CodeEditor/code-editor';
5+
import fileUploadStyles from '@patternfly/react-styles/css/components/FileUpload/file-upload';
46

5-
Object.defineProperty(window, 'matchMedia', {
6-
writable: true,
7-
value: jest.fn().mockImplementation((query) => ({
8-
matches: false,
9-
media: query,
10-
onchange: null,
11-
addListener: jest.fn(), // Deprecated
12-
removeListener: jest.fn(), // Deprecated
13-
addEventListener: jest.fn(),
14-
removeEventListener: jest.fn(),
15-
dispatchEvent: jest.fn()
16-
}))
17-
});
18-
19-
describe('CodeEditor', () => {
20-
beforeAll(() => {
21-
window.HTMLCanvasElement.prototype.getContext = () => ({}) as any;
22-
});
7+
jest.mock('@monaco-editor/react', () => jest.fn(() => <div data-testid="mock-editor"></div>));
238

24-
test('matches snapshot without props', () => {
25-
const { asFragment } = render(<CodeEditor />);
26-
expect(asFragment()).toMatchSnapshot();
27-
});
9+
test('Matches snapshot without props', () => {
10+
const { asFragment } = render(<CodeEditor code="test" />);
11+
expect(asFragment()).toMatchSnapshot();
12+
});
13+
14+
test('Matches snapshot with control buttons enabled', () => {
15+
const { asFragment } = render(<CodeEditor isUploadEnabled isDownloadEnabled isCopyEnabled code="test" />);
16+
expect(asFragment()).toMatchSnapshot();
17+
});
18+
19+
test(`Renders with default classes ${styles.codeEditor}, ${styles.codeEditorMain}, ${styles.codeEditorCode}`, () => {
20+
render(<CodeEditor />);
21+
expect(screen.getByTestId('mock-editor').parentElement).toHaveClass(styles.codeEditorCode);
22+
expect(screen.getByTestId('mock-editor').parentElement?.parentElement).toHaveClass(styles.codeEditorMain);
23+
expect(screen.getByTestId('mock-editor').parentElement?.parentElement?.parentElement).toHaveClass(styles.codeEditor);
24+
});
25+
26+
test('Renders custom class when className is passed', () => {
27+
render(<CodeEditor className="custom" />);
28+
expect(screen.getByTestId('mock-editor').parentElement?.parentElement?.parentElement).toHaveClass('custom');
29+
});
30+
31+
test(`Renders with ${styles.modifiers.readOnly} when isReadOnly = true`, () => {
32+
render(<CodeEditor isReadOnly />);
33+
expect(screen.getByTestId('mock-editor').parentElement?.parentElement?.parentElement).toHaveClass(
34+
styles.modifiers.readOnly
35+
);
36+
});
37+
38+
test(`Renders with ${fileUploadStyles.fileUpload} when isUploadEnabled = true`, () => {
39+
render(<CodeEditor isUploadEnabled code="test" />);
40+
expect(screen.getByTestId('mock-editor').parentElement?.parentElement?.parentElement).toHaveClass(
41+
fileUploadStyles.fileUpload
42+
);
43+
});
44+
45+
test(`Renders with empty state when code = undefined`, () => {
46+
render(<CodeEditor emptyState={<div>empty</div>} />);
47+
expect(screen.getByText('empty')).toBeInTheDocument();
48+
});
49+
50+
test(`Renders with empty state when isUploadEnabled = true and code = undefined`, () => {
51+
render(<CodeEditor emptyState={<div>empty</div>} isUploadEnabled />);
52+
expect(screen.getByText('empty')).toBeInTheDocument();
53+
});
54+
55+
test(`Renders with language label when isLanguageLabelVisible`, () => {
56+
render(<CodeEditor isLanguageLabelVisible language={Language.java} />);
57+
expect(screen.getByText('JAVA')).toBeInTheDocument();
58+
});
59+
60+
test(`Renders with custom controls when customControls is passed`, () => {
61+
render(<CodeEditor customControls={<div>control</div>} />);
62+
expect(screen.getByText('control')).toBeInTheDocument();
63+
});
64+
65+
test(`Renders with custom header content when headerMainContent is passed`, () => {
66+
render(<CodeEditor headerMainContent="header content" />);
67+
expect(screen.getByText('header content')).toBeInTheDocument();
68+
});
2869

29-
test('matches snapshot with all props', () => {
30-
const { asFragment } = render(
31-
<CodeEditor
32-
isReadOnly
33-
isDarkTheme
34-
isLineNumbersVisible={false}
35-
isUploadEnabled
36-
isLanguageLabelVisible
37-
isDownloadEnabled
38-
isCopyEnabled
39-
height="400px"
40-
code={'test'}
41-
language={Language.javascript}
42-
/>
43-
);
44-
expect(asFragment()).toMatchSnapshot();
70+
test(`Renders with shortcuts when shortcutsPopoverButtonText is passed`, () => {
71+
render(
72+
<CodeEditor shortcutsPopoverButtonText="shortcuts-button" shortcutsPopoverProps={{ bodyContent: 'shortcuts' }} />
73+
);
74+
expect(screen.getByText('shortcuts-button')).toBeInTheDocument();
75+
act(() => {
76+
screen.getByText('shortcuts-button').click();
4577
});
78+
expect(screen.getByText('shortcuts')).toBeInTheDocument();
4679
});

0 commit comments

Comments
 (0)