-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* copy all files from paragraph to use as the basis for the rich text component. * update icons for rich text component * resolve conflicts * wip on text formatting * get ready for setvalue * Refactor rich text handling in form components Updated RichTextPatternEdit to sync editor content with form state. Improved FormSummary rendering and enhanced form context with setValue function. * code formatting * add custom toolbar modules * formatting * add types to handlechange * add small format * pare down editor features * hidden field to mirror editor contents * install react-quill and increaes concurrency * fix type * remove logging * remove logging * remove logging * allow br tag in editor * formatting and label updates * swap quill for tiptap * fix build error with failing checks in form package * Rename and update RichTextPatternEdit components * Refactor editor button actions into a reusable array Consolidated individual editor button action handlers into a reusable editorActions array. This refactor simplifies the button creation process and enhances maintainability by reducing repeated code. * Add tests for lists * Dry out test a little * dry out test even more. * code formatting * Add CSS styles for RichText components Introduced new CSS modules to standardize the margin behavior of list items within RichText components. Updated the corresponding JSX files to apply these styles for consistent appearance. * Remove react-quill * remove prop from type for rich text * use patternvalue instead of string to correct typing issue * update styles of texteditor * exclude test that relies on browser feature from vitest runner * cleanup vitest config * remove save on blur for rich-text fields * change button type * remove top margin from editor content first child * add focus to editor when initialized * fix css selector * remove richtext check onblur * remove dbs from git * update form handling submission Check for rich text handler in the form blur event. Manage editor saving onChange * Add debounce for improved performance in RichTextPatternEdit Implemented debounce to optimize editor updates and prevent unnecessary re-renders. Memoized toolbar component. * Add optional validation rule to form fields Updated the form field registration to accept optional validation rules through the `register` method. * Add optional validation rule to form fields Updated the form field registration to accept optional validation rules through the `register` method. * add adr * Refactor MenuBar for enhanced editor functionality Remove `React.memo` from `MenuBar` component and add more fine-grained control with `disabled` property for button actions. Introduce new heading levels and update related stories to reflect these changes. * add types and style editor for long blocks of text. Adds new styles, change default heading hierarchy, and update tests * turn off spellcheck. squigglies were problematic for long documents. * match styles from edit view to preview. * move label * use vitest browser and install deps * update test config to try running browser tests in CI * install playwright browsers in ci * install dependencies * update install command * fix failing tests in e2e * formatting code * update test commands for watch and dev scenarios * update documentation * add aria-live for contents that change with soft nav * added css file extensions to prettier config * update deprecated command * Rich Text Component Toolbar buttons & API updates (#300) * pull latest from rich text branch and clean up * ignore cdktf type errors * install tf providers to pass typecheck --------- Co-authored-by: Daniel Naab <[email protected]> Co-authored-by: Jim Moffet <[email protected]>
- Loading branch information
1 parent
13b5d2f
commit 6b53414
Showing
49 changed files
with
3,392 additions
and
2,400 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,3 +16,4 @@ packages/form-service | |
/e2e/playwright-report/ | ||
/e2e/blob-report/ | ||
/e2e/playwright/.cache/ | ||
__screenshots__/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
dist/ | ||
*.db |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
dist/ | ||
*.db |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# 12. Rich Text Editor | ||
|
||
Date: 2024-08-12 | ||
|
||
## Status | ||
|
||
Approved | ||
|
||
## Context | ||
|
||
In user testing, there was an expressed interest to be able to apply a limited set of rich text formatting to imported forms and new builds from scratch. | ||
|
||
## Decision | ||
|
||
TipTap was selected to provide the rich text formatting features after evaluating several alternatives (QuillJS, Prose, TinyMCE). | ||
|
||
Quill was originally installed, but there was a known issue in being able to execute a line break inside a bulleted list, which caused an issue with reformatting imported text when it was edited for the first time. TipTap was installed as an alternative. | ||
|
||
## Consequences | ||
|
||
TipTap is a popular package that works outside the React ecosystem, so it is portable if there is ever a need to move to a different JS framework. The plugin does operate on a freemium model with the subset of features being free with additional, more advanced features having a cost. However, based on the features we use at the time of this ADR, the free features are robust enough to current requirements as well as the most likely requirements in the future. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
packages/design/src/Form/components/PageSet/PageMenu/pageMenuStyles.module.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
.sideNavWrapper { | ||
top: 6rem; | ||
top: 6rem; | ||
} | ||
|
||
.sideNav a:not(.usa-button):not(.usa-current) { | ||
color: #005ea2; | ||
color: #005ea2; | ||
} | ||
|
||
.sideNav a:not(.usa-button):hover { | ||
background-color: #d9e8f6; | ||
background-color: #d9e8f6; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import React from 'react'; | ||
|
||
import { type RichTextProps } from '@atj/forms'; | ||
import { type PatternComponent } from '../../../Form/index.js'; | ||
import styles from './richTextStyles.module.css'; | ||
|
||
const FormSummary: PatternComponent<RichTextProps> = props => { | ||
return ( | ||
<div className={`${styles.richTextEditorWrapper}`}> | ||
<div dangerouslySetInnerHTML={{ __html: props.text }} /> | ||
</div> | ||
); | ||
}; | ||
export default FormSummary; |
6 changes: 6 additions & 0 deletions
6
packages/design/src/Form/components/RichText/richTextStyles.module.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.richTextEditorWrapper li > p { | ||
margin-top: 0; | ||
margin-bottom: 0; | ||
padding-top: 0; | ||
padding-bottom: 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
packages/design/src/FormManager/FormDocumentImport/DocumentImporter/DocumentImporter.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/** | ||
* @vitest-environment jsdom | ||
*/ | ||
import { describeStories } from '../../../test-helper'; | ||
import meta, * as stories from './DocumentImporter.stories'; | ||
import { describeStories } from '../../../test-helper.js'; | ||
import meta, * as stories from './DocumentImporter.stories.js'; | ||
|
||
describeStories(meta, stories); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.