# @procore/text-editor

## 1.2.0

### Minor Changes

- ff8c490: - Image uploads now show progress bar: the photo grays out and a rounded bar tracks real upload progress (storage upload switched from fetch to XMLHttpRequest to stream progress events)
  - Images support text wrap via CKEditor ImageStyle (inline / wrap text / break text).
  - New `extendable` prop: with `rows`, the editor starts at the rows height and grows with content instead of scrolling (CKEditor and TinyMCE)
  - Images copied from external websites ("Copy Image") now upload the clipboard image bytes instead of pasting an external URL that the backend strips

## 1.1.0

### Minor Changes

- a78988d: Add an "Open in a new tab" option to CKEditor links. When enabled in the link "Link properties" panel, the link is saved with `target="_blank"` and `rel="noopener noreferrer"`. Also set a default `https://` protocol so links typed without a scheme (for example `www.example.com`) are not treated as relative URLs.

### Patch Changes

- 9dcbd9d: Add PasteFromOffice plugin to CKEditor config
- 6e916ea: Import `add` from `ckeditor5` instead of `@ckeditor/ckeditor5-utils` which not a declared dependency — it only worked through hoisting and could cause duplicate CKEditor modules.
- e4fb2ba: Mock `@ckeditor/ckeditor5-utils` in the package's Jest setup to avoid the `ckeditor-duplicated-modules` error.
  - `locale.ts` imports `add` from `@ckeditor/ckeditor5-utils` to register the custom Cut/Paste/Paste-as-Text command labels on the global `window.CKEDITOR_TRANSLATIONS` store. Under Jest, the unmocked root import loaded ckeditor5-utils' version guard as a separate instance and threw `ckeditor-duplicated-modules`.
  - The package's Jest config now maps `^@ckeditor/ckeditor5-utils # @procore/text-editor` to a local mock that keeps every real export and only stubs `add` (whose sole purpose at import time is a translation side effect that isn't needed under test). Runtime behavior is unchanged.
- Updated dependencies

## 1.0.1

### Patch Changes

- 0553e49: Fix rich-text table rendering and align write mode and read mode:
  - Oversized tables now scroll the editor horizontally instead of stretching the page.
  - Output tables match the editor's content width and centered alignment (the `table` figure class is preserved through sanitization).
  - Long cell content wraps instead of forcing the table wider.
  - Sanitize the editor value on input in write mode, mirroring the existing output sanitization.
- Updated dependencies [a0ab8c9]
- Updated dependencies [8fb364a]
- Updated dependencies [d8940ff]
- Updated dependencies [651f78c]
- Updated dependencies [7e53f92]

## 1.0.0

### Major Changes

- de1d5b3: - **Breaking**: Default renderer changed from CKEditor to TinyMCE. CKEditor activates via LaunchDarkly flag `pmqs-ck-editor-enabled` or `enforceCKEditor` prop.

  ### New Props

  | Prop              | Description                                                                                                    |
  | ----------------- | -------------------------------------------------------------------------------------------------------------- |
  | `enforceCKEditor` | Force CKEditor regardless of flag                                                                              |
  | `rows`            | Fixed height in rows; omit for auto-grow                                                                       |
  | `placeholder`     | Placeholder text for empty editor                                                                              |
  | `init`            | TinyMCE-only init config merged with internal defaults; consumer values win. No effect when CKEditor is active |

### Minor Changes

- 0a850ec: Add image upload support backed by standard [Uploads API](https://developers.procore.com/reference/rest/uploads?version=1.1) staging and standalone Prostore files. Uploaded images embed a permanent, publicly fetchable URL plus a `data-rich-text-editor-file-id` marker directly into the saved HTML so content renders as-is in the app, emails, and exports. Images are clamped to their container width (`max-width: 100%`) and limited to 20 per editor value to protect email and PDF layouts.

## 0.5.1

### Patch Changes

- ffcbad8: chore: don't assign `this` to a variable sonar lint failure
- bee0d43: Fix tables pasted from spreadsheets (Excel / Google Sheets) rendering collapsed by normalizing invalid zero/NaN figure widths during the clipboard paste pipeline.
- Updated dependencies [f0bb16b]
- Updated dependencies [195f0ba]
- Updated dependencies [0b792e4]
  - @procore/core-react@12.50.1

## 0.5.0

### Minor Changes

- e81ec86: Debounce the `onChange` callback internally (flushing pending edits on blur) to fix typing and pointer lag caused by expensive work running on every keystroke.

### Patch Changes

- 4ff6292: - Fix text overflowing editor and output containers (word-break, overflow-wrap)
  - Prevent showing editor until fully initialized (opacity gate on ready state)
- Updated dependencies [8da8b1d]
- Updated dependencies [ce61ed8]
  - @procore/core-react@12.49.1

## 0.4.2

### Patch Changes

- 05247ae: Upgraded CKEditor to the latest version
  - Fix toolbar icons not rendering due to CSS specificity conflicts with CKEditor's internal styles
  - Fix focus trap blocking CKEditor floating UI (dialogs, balloon panels) inside Modals and Tearsheets
- 05247ae: Improve TextEditor toolbar hover and focus-visible styles
- Updated dependencies

## 0.4.1

### Patch Changes

- 2e09db0: Increase contrast of input field borders in `TextEditor` link dialog
- Updated dependencies

## 0.4.0

### Minor Changes

- 5e18bea: Breaking - Added the MultiLevelList plugin from ckeditor5-premium-features peerDep to the editor configuration, enabling multi-level/nested list support. Apps must install it as a singleton dependency.

## 0.3.2

### Patch Changes

- ff71188: Updated CKEditor license keys after renewal
- Updated dependencies [ae28df6]
- Updated dependencies [e3601e1]
- Updated dependencies [aaf9541]
- Updated dependencies [9a06acb]
  - @procore/core-react@12.46.0

## 0.3.1

### Patch Changes

- bd6b880: Override CKEditor's default font family and font size to align with Procore's core design system (Inter / 14px).
- Updated dependencies

## 0.3.0

### Minor Changes

- a1b9bb9: Increase ckeditor5 peerDep from 46 to 47.6.1 for security vuln

## 0.2.1

### Patch Changes

- 2112573: Ensure CKEditor toolbar dropdown panels appear above Tearsheet overlay
- df6a052: Fix list style type selections being ignored in CKEditor ListProperties
- Updated dependencies [e1d693b]
- Updated dependencies [ca101fc]
- Updated dependencies [ca101fc]
- Updated dependencies [818727f]
- Updated dependencies [bf0532b]
- Updated dependencies [5a33cc0]
- Updated dependencies [6a06559]
- Updated dependencies [ce03cf7]
- Updated dependencies [d4652e3]
- Updated dependencies [2cd5b75]
- Updated dependencies [9122889]
- Updated dependencies [d49f826]
- Updated dependencies [19853ef]
  - @procore/core-react@12.43.0
  - @procore/core-icons@12.15.0

## 0.2.0

### Minor Changes

- ffdc97f: - Add optional `readonly` prop to display content in read-only mode.
  - Remove Accessibility icons from the toolbar.
  - Expose `DebouncedTextEditor` component for debounced value updates.

## 0.1.0

### Minor Changes

- New toolbar defaults. Remove `plugins` and `config` props to rely on the TextEditor package's default internal configuration.
- Add Enter key `stopPropagation` to prevent form submission when pressing Enter in the editor.

## 0.0.3

### Patch Changes

- 4656bce: Default provider TAB key as navigation to remove keyboard trap

## 0.0.2

### Patch Changes

- 7d01b54: Fix some types and remove legacy tinymce no-ops and focus.

## 0.0.1

### Patch Changes

- f95beb2: Initial release of a separate TextEditor package, extracted from core-react.
