Skip to content

Commit

Permalink
V6 rebase (#10033)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
1 parent 37065eb commit 4a58c89
Show file tree
Hide file tree
Showing 138 changed files with 6,318 additions and 1,145 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"@octokit/rest": "^20.0.0",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "14.5.1",
"@testing-library/user-event": "14.5.2",
"@types/jest": "29.5.11",
"@types/react": "^18",
"@types/react-dom": "^18",
Expand Down
20 changes: 20 additions & 0 deletions packages/react-charts/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,26 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline

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

# 7.2.0-prerelease.10 (2024-01-15)

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

# 7.2.0-prerelease.9 (2024-01-11)

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

# 7.2.0-prerelease.8 (2023-12-11)

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

# 7.2.0-prerelease.7 (2023-11-10)

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

# 7.2.0-prerelease.6 (2023-11-03)

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

# 7.2.0-prerelease.5 (2023-10-26)

**Note:** Version bump only for package @patternfly/react-charts
Expand Down
36 changes: 18 additions & 18 deletions packages/react-charts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,25 @@
"@patternfly/react-styles": "^6.0.0-alpha.9",
"@patternfly/react-tokens": "^6.0.0-alpha.9",
"hoist-non-react-statics": "^3.3.0",
"lodash": "^4.17.19",
"lodash": "^4.17.21",
"tslib": "^2.5.0",
"victory-area": "^36.6.11",
"victory-axis": "^36.6.11",
"victory-bar": "^36.6.11",
"victory-box-plot": "^36.6.11",
"victory-chart": "^36.6.11",
"victory-core": "^36.6.11",
"victory-create-container": "^36.6.11",
"victory-cursor-container": "^36.6.11",
"victory-group": "^36.6.11",
"victory-legend": "^36.6.11",
"victory-line": "^36.6.11",
"victory-pie": "^36.6.11",
"victory-scatter": "^36.6.11",
"victory-stack": "^36.6.11",
"victory-tooltip": "^36.6.11",
"victory-voronoi-container": "^36.6.11",
"victory-zoom-container": "^36.6.11"
"victory-area": "^36.8.1",
"victory-axis": "^36.8.1",
"victory-bar": "^36.8.1",
"victory-box-plot": "^36.8.1",
"victory-chart": "^36.8.1",
"victory-core": "^36.8.1",
"victory-create-container": "^36.8.1",
"victory-cursor-container": "^36.8.1",
"victory-group": "^36.8.1",
"victory-legend": "^36.8.1",
"victory-line": "^36.8.1",
"victory-pie": "^36.8.1",
"victory-scatter": "^36.8.1",
"victory-stack": "^36.8.1",
"victory-tooltip": "^36.8.1",
"victory-voronoi-container": "^36.8.1",
"victory-zoom-container": "^36.8.1"
},
"peerDependencies": {
"react": "^17 || ^18",
Expand Down
9 changes: 3 additions & 6 deletions packages/react-charts/single-packages.config.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
{
"packageName": "@patternfly/react-charts",
"exclude": [
"dist/esm/deprecated/index.js",
"dist/esm/next/index.js"
]
}
"packageName": "@patternfly/react-charts",
"exclude": ["dist/esm/deprecated/index.js", "dist/esm/next/index.js"]
}
122 changes: 122 additions & 0 deletions packages/react-code-editor/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,128 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline

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

# [5.2.0-prerelease.49](https://github.com/patternfly/patternfly-react/compare/@patternfly/[email protected]...@patternfly/[email protected]) (2024-01-17)

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

# 5.2.0-prerelease.48 (2024-01-16)

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

# [5.2.0-prerelease.47](https://github.com/patternfly/patternfly-react/compare/@patternfly/[email protected]...@patternfly/[email protected]) (2024-01-15)

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

# [5.2.0-prerelease.46](https://github.com/patternfly/patternfly-react/compare/@patternfly/[email protected]...@patternfly/[email protected]) (2024-01-11)

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

# [5.2.0-prerelease.45](https://github.com/patternfly/patternfly-react/compare/@patternfly/[email protected]...@patternfly/[email protected]) (2024-01-10)

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

# [5.2.0-prerelease.44](https://github.com/patternfly/patternfly-react/compare/@patternfly/[email protected]...@patternfly/[email protected]) (2024-01-09)

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

# [5.2.0-prerelease.43](https://github.com/patternfly/patternfly-react/compare/@patternfly/[email protected]...@patternfly/[email protected]) (2024-01-08)

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

# [5.2.0-prerelease.42](https://github.com/patternfly/patternfly-react/compare/@patternfly/[email protected]...@patternfly/[email protected]) (2024-01-05)

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

# [5.2.0-prerelease.41](https://github.com/patternfly/patternfly-react/compare/@patternfly/[email protected]...@patternfly/[email protected]) (2024-01-05)

### Features

- **CodeEditor:** use new monaco package ([#9842](https://github.com/patternfly/patternfly-react/issues/9842)) ([54dd134](https://github.com/patternfly/patternfly-react/commit/54dd134d6c67c4fc1d7630fd1e7c718f66061342))

# [5.2.0-prerelease.40](https://github.com/patternfly/patternfly-react/compare/@patternfly/[email protected]...@patternfly/[email protected]) (2024-01-04)

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

# [5.2.0-prerelease.39](https://github.com/patternfly/patternfly-react/compare/@patternfly/[email protected]...@patternfly/[email protected]) (2024-01-03)

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

# [5.2.0-prerelease.38](https://github.com/patternfly/patternfly-react/compare/@patternfly/[email protected]...@patternfly/[email protected]) (2024-01-02)

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

# [5.2.0-prerelease.37](https://github.com/patternfly/patternfly-react/compare/@patternfly/[email protected]...@patternfly/[email protected]) (2023-12-20)

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

# [5.2.0-prerelease.36](https://github.com/patternfly/patternfly-react/compare/@patternfly/[email protected]...@patternfly/[email protected]) (2023-12-14)

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

# [5.2.0-prerelease.35](https://github.com/patternfly/patternfly-react/compare/@patternfly/[email protected]...@patternfly/[email protected]) (2023-12-11)

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

# [5.2.0-prerelease.34](https://github.com/patternfly/patternfly-react/compare/@patternfly/[email protected]...@patternfly/[email protected]) (2023-12-07)

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

# [5.2.0-prerelease.33](https://github.com/patternfly/patternfly-react/compare/@patternfly/[email protected]...@patternfly/[email protected]) (2023-12-06)

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

# [5.2.0-prerelease.32](https://github.com/patternfly/patternfly-react/compare/@patternfly/[email protected]...@patternfly/[email protected]) (2023-11-21)

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

# [5.2.0-prerelease.31](https://github.com/patternfly/patternfly-react/compare/@patternfly/[email protected]...@patternfly/[email protected]) (2023-11-17)

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

# [5.2.0-prerelease.30](https://github.com/patternfly/patternfly-react/compare/@patternfly/[email protected]...@patternfly/[email protected]) (2023-11-16)

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

# [5.2.0-prerelease.29](https://github.com/patternfly/patternfly-react/compare/@patternfly/[email protected]...@patternfly/[email protected]) (2023-11-14)

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

# [5.2.0-prerelease.28](https://github.com/patternfly/patternfly-react/compare/@patternfly/[email protected]...@patternfly/[email protected]) (2023-11-14)

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

# [5.2.0-prerelease.27](https://github.com/patternfly/patternfly-react/compare/@patternfly/[email protected]...@patternfly/[email protected]) (2023-11-14)

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

# [5.2.0-prerelease.26](https://github.com/patternfly/patternfly-react/compare/@patternfly/[email protected]...@patternfly/[email protected]) (2023-11-13)

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

# [5.2.0-prerelease.25](https://github.com/patternfly/patternfly-react/compare/@patternfly/[email protected]...@patternfly/[email protected]) (2023-11-10)

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

# [5.2.0-prerelease.24](https://github.com/patternfly/patternfly-react/compare/@patternfly/[email protected]...@patternfly/[email protected]) (2023-11-03)

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

# [5.2.0-prerelease.23](https://github.com/patternfly/patternfly-react/compare/@patternfly/[email protected]...@patternfly/[email protected]) (2023-11-03)

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

# [5.2.0-prerelease.22](https://github.com/patternfly/patternfly-react/compare/@patternfly/[email protected]...@patternfly/[email protected]) (2023-11-02)

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

# [5.2.0-prerelease.21](https://github.com/patternfly/patternfly-react/compare/@patternfly/[email protected]...@patternfly/[email protected]) (2023-11-02)

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

# [5.2.0-prerelease.20](https://github.com/patternfly/patternfly-react/compare/@patternfly/[email protected]...@patternfly/[email protected]) (2023-11-02)

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

# [5.2.0-prerelease.19](https://github.com/patternfly/patternfly-react/compare/@patternfly/[email protected]...@patternfly/[email protected]) (2023-10-30)

**Note:** Version bump only for package @patternfly/react-code-editor
Expand Down
6 changes: 3 additions & 3 deletions packages/react-code-editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@
"@patternfly/react-icons": "^6.0.0-alpha.9",
"@patternfly/react-styles": "^6.0.0-alpha.9",
"react-dropzone": "14.2.3",
"tslib": "^2.5.0"
"tslib": "^2.5.0",
"@monaco-editor/react": "^4.6.0"
},
"peerDependencies": {
"react": "^17 || ^18",
"react-dom": "^17 || ^18",
"react-monaco-editor": "^0.51.0"
"react-dom": "^17 || ^18"
},
"devDependencies": {
"rimraf": "^2.6.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
PopoverProps,
TooltipPosition
} from '@patternfly/react-core';
import MonacoEditor, { ChangeHandler, EditorDidMount } from 'react-monaco-editor';
import Editor, { Monaco } from '@monaco-editor/react';
import { editor } from 'monaco-editor/esm/vs/editor/editor.api';
import CopyIcon from '@patternfly/react-icons/dist/esm/icons/copy-icon';
import UploadIcon from '@patternfly/react-icons/dist/esm/icons/upload-icon';
Expand All @@ -26,6 +26,9 @@ import Dropzone, { FileRejection } from 'react-dropzone';
import { CodeEditorContext } from './CodeEditorUtils';
import { CodeEditorControl } from './CodeEditorControl';

export type ChangeHandler = (value: string, event: editor.IModelContentChangedEvent) => void;
export type EditorDidMount = (editor: editor.IStandaloneCodeEditor, monaco: Monaco) => void;

export interface Shortcut {
description: string;
keys: string[];
Expand Down Expand Up @@ -619,15 +622,15 @@ class CodeEditor extends React.Component<CodeEditorProps, CodeEditorState> {

const editor = (
<div className={css(styles.codeEditorCode)} ref={this.wrapperRef} tabIndex={0} dir="ltr">
<MonacoEditor
<Editor
height={height}
width={width}
language={language}
value={value}
options={options}
overrideServices={overrideServices}
onChange={this.onChange}
editorDidMount={this.editorDidMount}
onMount={this.editorDidMount}
theme={isDarkTheme ? 'vs-dark' : 'vs-light'}
/>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,46 +1,79 @@
import React from 'react';
import { render } from '@testing-library/react';
import { render, screen, act } from '@testing-library/react';
import { CodeEditor, Language } from '../CodeEditor';
import styles from '@patternfly/react-styles/css/components/CodeEditor/code-editor';
import fileUploadStyles from '@patternfly/react-styles/css/components/FileUpload/file-upload';

Object.defineProperty(window, 'matchMedia', {
writable: true,
value: jest.fn().mockImplementation((query) => ({
matches: false,
media: query,
onchange: null,
addListener: jest.fn(), // Deprecated
removeListener: jest.fn(), // Deprecated
addEventListener: jest.fn(),
removeEventListener: jest.fn(),
dispatchEvent: jest.fn()
}))
});

describe('CodeEditor', () => {
beforeAll(() => {
window.HTMLCanvasElement.prototype.getContext = () => ({}) as any;
});
jest.mock('@monaco-editor/react', () => jest.fn(() => <div data-testid="mock-editor"></div>));

test('matches snapshot without props', () => {
const { asFragment } = render(<CodeEditor />);
expect(asFragment()).toMatchSnapshot();
});
test('Matches snapshot without props', () => {
const { asFragment } = render(<CodeEditor code="test" />);
expect(asFragment()).toMatchSnapshot();
});

test('Matches snapshot with control buttons enabled', () => {
const { asFragment } = render(<CodeEditor isUploadEnabled isDownloadEnabled isCopyEnabled code="test" />);
expect(asFragment()).toMatchSnapshot();
});

test(`Renders with default classes ${styles.codeEditor}, ${styles.codeEditorMain}, ${styles.codeEditorCode}`, () => {
render(<CodeEditor />);
expect(screen.getByTestId('mock-editor').parentElement).toHaveClass(styles.codeEditorCode);
expect(screen.getByTestId('mock-editor').parentElement?.parentElement).toHaveClass(styles.codeEditorMain);
expect(screen.getByTestId('mock-editor').parentElement?.parentElement?.parentElement).toHaveClass(styles.codeEditor);
});

test('Renders custom class when className is passed', () => {
render(<CodeEditor className="custom" />);
expect(screen.getByTestId('mock-editor').parentElement?.parentElement?.parentElement).toHaveClass('custom');
});

test(`Renders with ${styles.modifiers.readOnly} when isReadOnly = true`, () => {
render(<CodeEditor isReadOnly />);
expect(screen.getByTestId('mock-editor').parentElement?.parentElement?.parentElement).toHaveClass(
styles.modifiers.readOnly
);
});

test(`Renders with ${fileUploadStyles.fileUpload} when isUploadEnabled = true`, () => {
render(<CodeEditor isUploadEnabled code="test" />);
expect(screen.getByTestId('mock-editor').parentElement?.parentElement?.parentElement).toHaveClass(
fileUploadStyles.fileUpload
);
});

test(`Renders with empty state when code = undefined`, () => {
render(<CodeEditor emptyState={<div>empty</div>} />);
expect(screen.getByText('empty')).toBeInTheDocument();
});

test(`Renders with empty state when isUploadEnabled = true and code = undefined`, () => {
render(<CodeEditor emptyState={<div>empty</div>} isUploadEnabled />);
expect(screen.getByText('empty')).toBeInTheDocument();
});

test(`Renders with language label when isLanguageLabelVisible`, () => {
render(<CodeEditor isLanguageLabelVisible language={Language.java} />);
expect(screen.getByText('JAVA')).toBeInTheDocument();
});

test(`Renders with custom controls when customControls is passed`, () => {
render(<CodeEditor customControls={<div>control</div>} />);
expect(screen.getByText('control')).toBeInTheDocument();
});

test(`Renders with custom header content when headerMainContent is passed`, () => {
render(<CodeEditor headerMainContent="header content" />);
expect(screen.getByText('header content')).toBeInTheDocument();
});

test('matches snapshot with all props', () => {
const { asFragment } = render(
<CodeEditor
isReadOnly
isDarkTheme
isLineNumbersVisible={false}
isUploadEnabled
isLanguageLabelVisible
isDownloadEnabled
isCopyEnabled
height="400px"
code={'test'}
language={Language.javascript}
/>
);
expect(asFragment()).toMatchSnapshot();
test(`Renders with shortcuts when shortcutsPopoverButtonText is passed`, () => {
render(
<CodeEditor shortcutsPopoverButtonText="shortcuts-button" shortcutsPopoverProps={{ bodyContent: 'shortcuts' }} />
);
expect(screen.getByText('shortcuts-button')).toBeInTheDocument();
act(() => {
screen.getByText('shortcuts-button').click();
});
expect(screen.getByText('shortcuts')).toBeInTheDocument();
});
Loading

0 comments on commit 4a58c89

Please sign in to comment.