@procore/text-editor 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.jest/ckeditorMock.js +1 -0
- package/.jest/setupTests.js +1 -2
- package/CHANGELOG.md +9 -0
- package/README.md +15 -0
- package/dist/TextEditor/CKTextEditor.js +7 -3
- package/dist/TextEditor/CKTextEditor.js.map +1 -1
- package/dist/TextEditor/TextEditor.styles.js +6 -6
- package/dist/TextEditor/TextEditor.styles.js.map +1 -1
- package/dist/TextEditor/TextEditor.types.d.ts +28 -8
- package/dist/TextEditor/TextEditor.types.js.map +1 -1
- package/dist/TextEditor/TinyMCETextEditor.js +2 -1
- package/dist/TextEditor/TinyMCETextEditor.js.map +1 -1
- package/dist/TextEditor/plugins/ProcoreImageUploadPlugin/ProcoreImageUploadPlugin.d.ts +6 -0
- package/dist/TextEditor/plugins/ProcoreImageUploadPlugin/ProcoreImageUploadPlugin.js +114 -14
- package/dist/TextEditor/plugins/ProcoreImageUploadPlugin/ProcoreImageUploadPlugin.js.map +1 -1
- package/dist/TextEditor/utils/config.js +3 -3
- package/dist/TextEditor/utils/config.js.map +1 -1
- package/dist/TextEditor/utils/richTextEditorHandlers.d.ts +4 -1
- package/dist/TextEditor/utils/richTextEditorHandlers.js +79 -21
- package/dist/TextEditor/utils/richTextEditorHandlers.js.map +1 -1
- package/dist/TextEditorOutput/TextEditorOutput.styles.js +2 -2
- package/dist/TextEditorOutput/TextEditorOutput.styles.js.map +1 -1
- package/dist/_typedoc/TextEditor/TextEditor.types.json +323 -49
- package/dist/_typedoc/TextEditor/TextEditorProvider.types.json +2 -2
- package/dist/_typedoc/TextEditorOutput/TextEditorOutput.types.json +3 -3
- package/dist/_typedoc/deprecations.json +1 -1
- package/dist/locales/en.json +1 -0
- package/package.json +7 -7
package/.jest/ckeditorMock.js
CHANGED
|
@@ -50,6 +50,7 @@ module.exports = {
|
|
|
50
50
|
ImageCaption: class extends MockPlugin {},
|
|
51
51
|
ImageInsert: class extends MockPlugin {},
|
|
52
52
|
ImageResize: class extends MockPlugin {},
|
|
53
|
+
ImageStyle: class extends MockPlugin {},
|
|
53
54
|
ImageTextAlternative: class extends MockPlugin {},
|
|
54
55
|
ImageToolbar: class extends MockPlugin {},
|
|
55
56
|
ImageUpload: class extends MockPlugin {},
|
package/.jest/setupTests.js
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @procore/text-editor
|
|
2
2
|
|
|
3
|
+
## 1.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 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)
|
|
8
|
+
- Images support text wrap via CKEditor ImageStyle (inline / wrap text / break text).
|
|
9
|
+
- New `extendable` prop: with `rows`, the editor starts at the rows height and grows with content instead of scrolling (CKEditor and TinyMCE)
|
|
10
|
+
- Images copied from external websites ("Copy Image") now upload the clipboard image bytes instead of pasting an external URL that the backend strips
|
|
11
|
+
|
|
3
12
|
## 1.1.0
|
|
4
13
|
|
|
5
14
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -91,6 +91,17 @@ storage, then finalizes it through
|
|
|
91
91
|
Rails stores the finalized upload as a standalone Prostore file and returns its
|
|
92
92
|
`prostore_file_id` plus a permanent, publicly fetchable URL.
|
|
93
93
|
|
|
94
|
+
While an image is uploading, CKEditor shows the image placeholder with a
|
|
95
|
+
progress bar on top of it. The direct-to-storage request is sent with
|
|
96
|
+
`XMLHttpRequest` so real upload progress events drive the bar (`fetch` cannot
|
|
97
|
+
report request upload progress). No consumer wiring is needed — the bar appears
|
|
98
|
+
automatically wherever image uploads are enabled.
|
|
99
|
+
|
|
100
|
+
Images copied from other websites ("Copy Image" in the browser) are uploaded
|
|
101
|
+
from the image bytes the browser places on the clipboard, instead of pasting a
|
|
102
|
+
link to the external site (external image URLs are stripped by the backend).
|
|
103
|
+
Rich pastes that mix text and images keep the default clipboard behavior.
|
|
104
|
+
|
|
94
105
|
The `toolName` value is sent as `tool_name` with the finalize request and is
|
|
95
106
|
used by Rails for file attribution and audit metadata. It must match a known
|
|
96
107
|
Procore tool name.
|
|
@@ -125,6 +136,7 @@ app, email, or PDF layouts.
|
|
|
125
136
|
| `onAfterDestroy` | `() => void` | — | Fired after editor is destroyed |
|
|
126
137
|
| `placeholder` | `string` | — | Placeholder text shown when editor is empty |
|
|
127
138
|
| `rows` | `number` | — | Fixed height in rows. Omit for auto-grow |
|
|
139
|
+
| `extendable` | `boolean` | `false` | With `rows`: height becomes a minimum — editor grows with content past it. No effect without `rows` |
|
|
128
140
|
| `disabled` | `boolean` | `false` | Disables the editor |
|
|
129
141
|
| `readonly` | `boolean` | `false` | Renders content as read-only output |
|
|
130
142
|
| `error` | `boolean` | `false` | Applies error styling |
|
|
@@ -145,6 +157,9 @@ Use `rows` to set a fixed editor height. Omit it for auto-grow (default).
|
|
|
145
157
|
// Fixed height — 3 rows tall, scrolls when content overflows
|
|
146
158
|
<TextEditor rows={3} value={value} onChange={setValue} />
|
|
147
159
|
|
|
160
|
+
// Minimum height — starts 3 rows tall, grows with content beyond that
|
|
161
|
+
<TextEditor rows={3} extendable value={value} onChange={setValue} />
|
|
162
|
+
|
|
148
163
|
// Auto-grow — expands with content
|
|
149
164
|
<TextEditor value={value} onChange={setValue} />
|
|
150
165
|
```
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
var _excluded = ["disabled", "error", "readonly", "value", "initialValue", "onChange", "onInit", "onBlur", "onKeyDown", "locale", "onDirty", "companyId", "projectId", "toolName", "placeholder", "rows"];
|
|
2
|
+
var _excluded = ["disabled", "error", "readonly", "value", "initialValue", "onChange", "onInit", "onBlur", "onKeyDown", "locale", "onDirty", "companyId", "projectId", "toolName", "placeholder", "rows", "extendable"];
|
|
3
3
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
5
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
@@ -49,6 +49,7 @@ export var CKTextEditor = function CKTextEditor(props) {
|
|
|
49
49
|
toolName = props.toolName,
|
|
50
50
|
placeholder = props.placeholder,
|
|
51
51
|
rows = props.rows,
|
|
52
|
+
extendable = props.extendable,
|
|
52
53
|
restProps = _objectWithoutProperties(props, _excluded);
|
|
53
54
|
var ariaLabel = props['aria-label'];
|
|
54
55
|
var ariaDescription = props['aria-description'];
|
|
@@ -157,7 +158,8 @@ export var CKTextEditor = function CKTextEditor(props) {
|
|
|
157
158
|
var handlerOptions = {
|
|
158
159
|
companyId: companyId,
|
|
159
160
|
projectId: projectId,
|
|
160
|
-
toolName: toolName
|
|
161
|
+
toolName: toolName,
|
|
162
|
+
i18n: i18n
|
|
161
163
|
};
|
|
162
164
|
var upload = richTextEditorUploadHandler(handlerOptions);
|
|
163
165
|
return {
|
|
@@ -250,7 +252,9 @@ export var CKTextEditor = function CKTextEditor(props) {
|
|
|
250
252
|
var rowHeight = 22;
|
|
251
253
|
var editorHeight = rows * rowHeight + baseHeight;
|
|
252
254
|
writer.setStyle('min-height', "".concat(editorHeight, "px"), viewEditableRoot);
|
|
253
|
-
|
|
255
|
+
if (!extendable) {
|
|
256
|
+
writer.setStyle('max-height', "".concat(editorHeight, "px"), viewEditableRoot);
|
|
257
|
+
}
|
|
254
258
|
}
|
|
255
259
|
}
|
|
256
260
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CKTextEditor.js","names":["CKEditor","useToastAlertContext","ClassicEditor","FileRepository","React","Toast","useI18nContext","useZIndexContext","TextEditorOutput","sanitizeTextEditorHtml","debounce","useStickyToolbar","GlobalEditorStyles","StyledImageUploadWarningToast","StyledImageUploadWarningToastIcon","StyledTextEditor","TextEditorContext","TextEditorTheme","useCKEditorCss","useCKEditorFocusScope","useTabAsNavigation","addButtonDataAttributes","getDefaultConfig","richTextEditorUploadHandler","DEBOUNCE_MS","CKTextEditor","props","disabled","error","readonly","value","initialValue","onChange","onInit","onBlur","onKeyDown","propLocale","locale","onDirty","companyId","projectId","toolName","placeholder","rows","restProps","_objectWithoutProperties","_excluded","ariaLabel","ariaDescription","_useCKEditorCss","cssLoading","isLoading","editorRef","useRef","editorInstanceRef","initialValueRef","lastExternalValueRef","keyDownListenerRef","_React$useState","useState","_React$useState2","_slicedToArray","isDirtyState","setIsDirtyState","_React$useState3","_React$useState4","isEditorReady","setIsEditorReady","i18n","_useToastAlertContext","showToast","contextLocale","showImageUploadWarning","useCallback","message","custom","_ref","toastDismissProps","createElement","alignItems","padding","size","Text","Dismiss","_extends","t","useEffect","undefined","current","editor","editing","view","document","isFocused","getData","data","set","off","change","writer","viewEditableRoot","getRoot","setAttribute","removeAttribute","_useZIndexContext","zIndex","_React$useContext","useContext","features","enableStickyToolbar","stickyToolbar","enableTabAsNavigation","tabAsNavigation","imageUploadHandlers","useMemo","handlerOptions","upload","onError","onWarning","mergedConfig","defaultConfig","imageUpload","label","root","_objectSpread","bindKeyDownHandler","editorElement","keyDownListener","_event","domEvent","key","stopPropagation","on","debouncedChange","isDirty","trim","hasPendingUploads","hasPendingImageUploads","handleChange","handleReady","_ref2","sanitizedValue","baseHeight","rowHeight","editorHeight","setStyle","concat","handleBlur","event","flush","enabled","_useTabAsNavigation","config","editorKey","ref","$ready","onReady","_fileRepository$loade","fileRepository","plugins","get","Array","from","loaders","some","loader","includes","String","status","_error"],"sources":["../../src/TextEditor/CKTextEditor.tsx"],"sourcesContent":["import { CKEditor } from '@ckeditor/ckeditor5-react'\nimport { useToastAlertContext } from '@procore/toast-alert'\nimport { ClassicEditor, FileRepository, type EventInfo } from 'ckeditor5'\nimport React from 'react'\n\nimport { Toast, useI18nContext, useZIndexContext } from '@procore/core-react'\nimport { TextEditorOutput } from '../TextEditorOutput'\nimport { sanitizeTextEditorHtml } from '../TextEditorOutput/TextEditorOutput.utils'\nimport { debounce } from '../utils/debounce'\nimport { useStickyToolbar } from './StickyToolbar'\nimport {\n GlobalEditorStyles,\n StyledImageUploadWarningToast,\n StyledImageUploadWarningToastIcon,\n StyledTextEditor,\n} from './TextEditor.styles'\nimport type { KeyDownListener, TextEditorProps } from './TextEditor.types'\nimport { TextEditorContext } from './TextEditorProvider'\nimport { TextEditorTheme } from './textEditorTheming'\nimport { useCKEditorCss } from './useCKEditorCss'\nimport { useCKEditorFocusScope } from './useCKEditorFocusScope'\nimport { useTabAsNavigation } from './useTabAsNavigation'\nimport { addButtonDataAttributes, getDefaultConfig } from './utils'\nimport { richTextEditorUploadHandler } from './utils/richTextEditorHandlers'\n\nconst DEBOUNCE_MS = 300\n\nexport const CKTextEditor = (props: Readonly<TextEditorProps>) => {\n const {\n disabled,\n error,\n readonly,\n value,\n initialValue,\n onChange,\n onInit,\n onBlur,\n onKeyDown,\n locale: propLocale,\n onDirty,\n companyId,\n projectId,\n toolName,\n placeholder,\n rows,\n ...restProps\n } = props\n const ariaLabel = props['aria-label']\n const ariaDescription = props['aria-description']\n const { isLoading: cssLoading } = useCKEditorCss()\n useCKEditorFocusScope()\n\n const editorRef = React.useRef<HTMLDivElement>(null)\n const editorInstanceRef = React.useRef<ClassicEditor | null>(null)\n const initialValueRef = React.useRef<string>(\n sanitizeTextEditorHtml(value || initialValue || '')\n )\n const lastExternalValueRef = React.useRef<string>(\n sanitizeTextEditorHtml(value || initialValue || '')\n )\n const keyDownListenerRef = React.useRef<KeyDownListener | null>(null)\n const [isDirtyState, setIsDirtyState] = React.useState(false)\n const [isEditorReady, setIsEditorReady] = React.useState(false)\n const i18n = useI18nContext()\n const { showToast } = useToastAlertContext()\n const { locale: contextLocale } = i18n\n const locale = propLocale || contextLocale\n\n const showImageUploadWarning = React.useCallback(\n (message: string) => {\n showToast.custom(({ toastDismissProps }) => (\n <StyledImageUploadWarningToast alignItems=\"center\" padding=\"md xl\">\n <StyledImageUploadWarningToastIcon size=\"lg\" />\n <Toast.Text>{message}</Toast.Text>\n <Toast.Dismiss\n aria-label={i18n.t('textEditor.imageUpload.dismissWarning')}\n {...toastDismissProps}\n />\n </StyledImageUploadWarningToast>\n ))\n },\n [i18n, showToast]\n )\n\n React.useEffect(() => {\n if (value !== undefined) {\n lastExternalValueRef.current = sanitizeTextEditorHtml(value)\n }\n }, [value])\n\n React.useEffect(() => {\n const editor = editorInstanceRef.current\n if (!isEditorReady || !editor || value === undefined) return\n if (editor.editing.view.document.isFocused) return\n if (value === editor.getData()) return\n\n editor.data.set(sanitizeTextEditorHtml(value))\n }, [value, isEditorReady])\n\n // Cleanup keydown listener on unmount\n React.useEffect(() => {\n return () => {\n if (keyDownListenerRef.current && editorInstanceRef.current) {\n editorInstanceRef.current.editing.view.document.off(\n 'keydown',\n keyDownListenerRef.current\n )\n keyDownListenerRef.current = null\n }\n }\n }, [])\n\n // Update aria-label when ariaLabel prop changes\n React.useEffect(() => {\n if (!isEditorReady || !editorInstanceRef.current) {\n return\n }\n\n const editor = editorInstanceRef.current\n editor.editing.view.change((writer) => {\n const viewEditableRoot = editor.editing.view.document.getRoot()\n if (viewEditableRoot) {\n if (ariaLabel) {\n writer.setAttribute('aria-label', ariaLabel, viewEditableRoot)\n } else {\n writer.removeAttribute('aria-label', viewEditableRoot)\n }\n }\n })\n }, [ariaLabel, isEditorReady])\n\n // Update aria-description when ariaDescription prop changes\n React.useEffect(() => {\n if (!isEditorReady || !editorInstanceRef.current) {\n return\n }\n\n const editor = editorInstanceRef.current\n editor.editing.view.change((writer) => {\n const viewEditableRoot = editor.editing.view.document.getRoot()\n if (viewEditableRoot) {\n if (ariaDescription) {\n writer.setAttribute(\n 'aria-description',\n ariaDescription,\n viewEditableRoot\n )\n } else {\n writer.removeAttribute('aria-description', viewEditableRoot)\n }\n }\n })\n }, [ariaDescription, isEditorReady])\n\n const { value: zIndex } = useZIndexContext()\n\n const { features } = React.useContext(TextEditorContext)\n const enableStickyToolbar = !!features?.stickyToolbar\n const enableTabAsNavigation = !!features?.tabAsNavigation\n\n const imageUploadHandlers = React.useMemo(() => {\n if (companyId === undefined || toolName === undefined) {\n return undefined\n }\n\n const handlerOptions = {\n companyId,\n projectId,\n toolName,\n }\n\n const upload = richTextEditorUploadHandler(handlerOptions)\n\n return {\n upload,\n i18n,\n onError: showToast.error,\n onWarning: showImageUploadWarning,\n }\n }, [\n companyId,\n i18n,\n projectId,\n showImageUploadWarning,\n showToast.error,\n toolName,\n ])\n\n const mergedConfig = React.useMemo(() => {\n const defaultConfig = getDefaultConfig(locale, {\n imageUpload: imageUploadHandlers,\n })\n\n // Set accessible label for the editable area if provided\n // This is used by screen readers to announce the editor's purpose\n if (ariaLabel) {\n defaultConfig.label = ariaLabel\n }\n\n if (placeholder) {\n defaultConfig.root = { ...defaultConfig.root, placeholder }\n }\n\n return defaultConfig\n }, [ariaLabel, imageUploadHandlers, locale, placeholder])\n\n const bindKeyDownHandler = React.useCallback(\n (editor: ClassicEditor) => {\n const editorElement = editor.editing.view.document.getRoot()\n if (!editorElement) {\n return\n }\n\n // Remove existing keydown listener\n if (keyDownListenerRef.current) {\n editor.editing.view.document.off('keydown', keyDownListenerRef.current)\n }\n\n // Create and store the new listener\n const keyDownListener = (\n _event: EventInfo,\n data: { domEvent: Event }\n ) => {\n const domEvent = data.domEvent as KeyboardEvent\n // Prevent Enter from propagating to parent forms so the\n // editor can handle newlines without accidentally submitting.\n if (domEvent.key === 'Enter') {\n domEvent.stopPropagation()\n }\n\n onKeyDown?.(domEvent, editor)\n }\n\n keyDownListenerRef.current = keyDownListener\n\n // Add the keydown listener\n editor.editing.view.document.on('keydown', keyDownListener)\n },\n [onKeyDown]\n )\n\n const debouncedChange = React.useRef(\n debounce((_event: EventInfo<string, unknown>, editor: ClassicEditor) => {\n const data = editor.getData()\n const isDirty = data !== lastExternalValueRef.current.trim()\n const hasPendingUploads = hasPendingImageUploads(editor)\n\n if (isDirty && !isDirtyState) {\n setIsDirtyState(true)\n onDirty?.()\n }\n\n if (hasPendingUploads) {\n return\n }\n\n onChange?.(data, isDirty)\n }, DEBOUNCE_MS)\n ).current\n\n const handleChange = debouncedChange\n\n const handleReady = (editor: ClassicEditor) => {\n addButtonDataAttributes(editor)\n editorInstanceRef.current = editor\n setIsEditorReady(true)\n const sanitizedValue = sanitizeTextEditorHtml(value ?? initialValue ?? '')\n if (sanitizedValue !== editor.getData()) {\n editor.data.set(sanitizedValue)\n }\n\n // Set aria-label and aria-description on the editable area if provided\n // These provide accessible context to screen reader users\n editor.editing.view.change((writer) => {\n const viewEditableRoot = editor.editing.view.document.getRoot()\n if (viewEditableRoot) {\n if (ariaLabel) {\n writer.setAttribute('aria-label', ariaLabel, viewEditableRoot)\n }\n if (ariaDescription) {\n writer.setAttribute(\n 'aria-description',\n ariaDescription,\n viewEditableRoot\n )\n }\n if (rows !== undefined) {\n const baseHeight = 35\n const rowHeight = 22\n const editorHeight = rows * rowHeight + baseHeight\n writer.setStyle('min-height', `${editorHeight}px`, viewEditableRoot)\n writer.setStyle('max-height', `${editorHeight}px`, viewEditableRoot)\n }\n }\n })\n\n // Bind keydown handler when editor is ready\n bindKeyDownHandler(editor)\n\n onInit?.(editor)\n }\n\n const handleBlur = (\n event: EventInfo<string, unknown>,\n editor: ClassicEditor\n ) => {\n debouncedChange.flush()\n onBlur?.(event, editor)\n }\n\n useStickyToolbar({\n enabled: enableStickyToolbar,\n editor: isEditorReady ? editorInstanceRef.current : null,\n editorRef,\n cssLoading,\n })\n\n const { config } = useTabAsNavigation({\n config: mergedConfig,\n enabled: enableTabAsNavigation,\n editor: isEditorReady ? editorInstanceRef.current : null,\n })\n\n const editorKey = `${locale}-${enableTabAsNavigation}`\n\n if (cssLoading) {\n return null\n }\n\n if (readonly) {\n return (\n <TextEditorOutput\n value={value}\n aria-label={ariaLabel}\n aria-description={ariaDescription}\n />\n )\n }\n\n return (\n <StyledTextEditor\n ref={editorRef}\n key={editorKey}\n error={error}\n $ready={isEditorReady}\n aria-invalid={error ? 'true' : 'false'}\n >\n <GlobalEditorStyles zIndex={zIndex + 1} />\n <TextEditorTheme />\n <CKEditor\n {...restProps}\n editor={ClassicEditor}\n config={config}\n disabled={disabled}\n data={initialValueRef.current}\n onChange={handleChange}\n onReady={handleReady}\n onBlur={handleBlur}\n />\n </StyledTextEditor>\n )\n}\n\nfunction hasPendingImageUploads(editor: ClassicEditor) {\n try {\n const fileRepository = editor.plugins.get(FileRepository) as {\n loaders?: Iterable<{ status?: string }>\n }\n\n return Array.from(fileRepository.loaders ?? []).some((loader) =>\n ['reading', 'uploading'].includes(String(loader.status))\n )\n } catch (_error) {\n return false\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,SAASA,QAAQ,QAAQ,2BAA2B;AACpD,SAASC,oBAAoB,QAAQ,sBAAsB;AAC3D,SAASC,aAAa,EAAEC,cAAc,QAAwB,WAAW;AACzE,OAAOC,KAAK,MAAM,OAAO;AAEzB,SAASC,KAAK,EAAEC,cAAc,EAAEC,gBAAgB,QAAQ,qBAAqB;AAC7E,SAASC,gBAAgB,QAAQ,qB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eACnBb,KAAA,CAAA0E,aAAA,CAAC9E,QAAQ,EAAAoF,QAAA,KACHxC,SAAS;IACb6C,MAAM,EAAEvF,aAAc;IACtBsJ,MAAM,EAAEA,MAAO;IACf7H,QAAQ,EAAEA,QAAS;IACnBoE,IAAI,EAAExC,eAAe,CAACiC,OAAQ;IAC9BxD,QAAQ,EAAE0G,YAAa;IACvBkB,OAAO,EAAEjB,WAAY;IACrBzG,MAAM,EAAEiH;EAAW,EACpB,CACe,CAAC;AAEvB,CAAC;AAED,SAASV,sBAAsBA,CAAChD,MAAqB,EAAE;EACrD,IAAI;IAAA,IAAAoE,qBAAA;IACF,IAAMC,cAAc,GAAGrE,MAAM,CAACsE,OAAO,CAACC,GAAG,CAAC7J,cAAc,CAEvD;IAED,OAAO8J,KAAK,CAACC,IAAI,EAAAL,qBAAA,GAACC,cAAc,CAACK,OAAO,cAAAN,qBAAA,cAAAA,qBAAA,GAAI,EAAE,CAAC,CAACO,IAAI,CAAC,UAACC,MAAM;MAAA,OAC1D,CAAC,SAAS,EAAE,WAAW,CAAC,CAACC,QAAQ,CAACC,MAAM,CAACF,MAAM,CAACG,MAAM,CAAC,CAAC;IAAA,CAC1D,CAAC;EACH,CAAC,CAAC,OAAOC,MAAM,EAAE;IACf,OAAO,KAAK;EACd;AACF","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"CKTextEditor.js","names":["CKEditor","useToastAlertContext","ClassicEditor","FileRepository","React","Toast","useI18nContext","useZIndexContext","TextEditorOutput","sanitizeTextEditorHtml","debounce","useStickyToolbar","GlobalEditorStyles","StyledImageUploadWarningToast","StyledImageUploadWarningToastIcon","StyledTextEditor","TextEditorContext","TextEditorTheme","useCKEditorCss","useCKEditorFocusScope","useTabAsNavigation","addButtonDataAttributes","getDefaultConfig","richTextEditorUploadHandler","DEBOUNCE_MS","CKTextEditor","props","disabled","error","readonly","value","initialValue","onChange","onInit","onBlur","onKeyDown","propLocale","locale","onDirty","companyId","projectId","toolName","placeholder","rows","extendable","restProps","_objectWithoutProperties","_excluded","ariaLabel","ariaDescription","_useCKEditorCss","cssLoading","isLoading","editorRef","useRef","editorInstanceRef","initialValueRef","lastExternalValueRef","keyDownListenerRef","_React$useState","useState","_React$useState2","_slicedToArray","isDirtyState","setIsDirtyState","_React$useState3","_React$useState4","isEditorReady","setIsEditorReady","i18n","_useToastAlertContext","showToast","contextLocale","showImageUploadWarning","useCallback","message","custom","_ref","toastDismissProps","createElement","alignItems","padding","size","Text","Dismiss","_extends","t","useEffect","undefined","current","editor","editing","view","document","isFocused","getData","data","set","off","change","writer","viewEditableRoot","getRoot","setAttribute","removeAttribute","_useZIndexContext","zIndex","_React$useContext","useContext","features","enableStickyToolbar","stickyToolbar","enableTabAsNavigation","tabAsNavigation","imageUploadHandlers","useMemo","handlerOptions","upload","onError","onWarning","mergedConfig","defaultConfig","imageUpload","label","root","_objectSpread","bindKeyDownHandler","editorElement","keyDownListener","_event","domEvent","key","stopPropagation","on","debouncedChange","isDirty","trim","hasPendingUploads","hasPendingImageUploads","handleChange","handleReady","_ref2","sanitizedValue","baseHeight","rowHeight","editorHeight","setStyle","concat","handleBlur","event","flush","enabled","_useTabAsNavigation","config","editorKey","ref","$ready","onReady","_fileRepository$loade","fileRepository","plugins","get","Array","from","loaders","some","loader","includes","String","status","_error"],"sources":["../../src/TextEditor/CKTextEditor.tsx"],"sourcesContent":["import { CKEditor } from '@ckeditor/ckeditor5-react'\nimport { useToastAlertContext } from '@procore/toast-alert'\nimport { ClassicEditor, FileRepository, type EventInfo } from 'ckeditor5'\nimport React from 'react'\n\nimport { Toast, useI18nContext, useZIndexContext } from '@procore/core-react'\nimport { TextEditorOutput } from '../TextEditorOutput'\nimport { sanitizeTextEditorHtml } from '../TextEditorOutput/TextEditorOutput.utils'\nimport { debounce } from '../utils/debounce'\nimport { useStickyToolbar } from './StickyToolbar'\nimport {\n GlobalEditorStyles,\n StyledImageUploadWarningToast,\n StyledImageUploadWarningToastIcon,\n StyledTextEditor,\n} from './TextEditor.styles'\nimport type { KeyDownListener, TextEditorProps } from './TextEditor.types'\nimport { TextEditorContext } from './TextEditorProvider'\nimport { TextEditorTheme } from './textEditorTheming'\nimport { useCKEditorCss } from './useCKEditorCss'\nimport { useCKEditorFocusScope } from './useCKEditorFocusScope'\nimport { useTabAsNavigation } from './useTabAsNavigation'\nimport { addButtonDataAttributes, getDefaultConfig } from './utils'\nimport { richTextEditorUploadHandler } from './utils/richTextEditorHandlers'\n\nconst DEBOUNCE_MS = 300\n\nexport const CKTextEditor = (props: Readonly<TextEditorProps>) => {\n const {\n disabled,\n error,\n readonly,\n value,\n initialValue,\n onChange,\n onInit,\n onBlur,\n onKeyDown,\n locale: propLocale,\n onDirty,\n companyId,\n projectId,\n toolName,\n placeholder,\n rows,\n extendable,\n ...restProps\n } = props\n const ariaLabel = props['aria-label']\n const ariaDescription = props['aria-description']\n const { isLoading: cssLoading } = useCKEditorCss()\n useCKEditorFocusScope()\n\n const editorRef = React.useRef<HTMLDivElement>(null)\n const editorInstanceRef = React.useRef<ClassicEditor | null>(null)\n const initialValueRef = React.useRef<string>(\n sanitizeTextEditorHtml(value || initialValue || '')\n )\n const lastExternalValueRef = React.useRef<string>(\n sanitizeTextEditorHtml(value || initialValue || '')\n )\n const keyDownListenerRef = React.useRef<KeyDownListener | null>(null)\n const [isDirtyState, setIsDirtyState] = React.useState(false)\n const [isEditorReady, setIsEditorReady] = React.useState(false)\n const i18n = useI18nContext()\n const { showToast } = useToastAlertContext()\n const { locale: contextLocale } = i18n\n const locale = propLocale || contextLocale\n\n const showImageUploadWarning = React.useCallback(\n (message: string) => {\n showToast.custom(({ toastDismissProps }) => (\n <StyledImageUploadWarningToast alignItems=\"center\" padding=\"md xl\">\n <StyledImageUploadWarningToastIcon size=\"lg\" />\n <Toast.Text>{message}</Toast.Text>\n <Toast.Dismiss\n aria-label={i18n.t('textEditor.imageUpload.dismissWarning')}\n {...toastDismissProps}\n />\n </StyledImageUploadWarningToast>\n ))\n },\n [i18n, showToast]\n )\n\n React.useEffect(() => {\n if (value !== undefined) {\n lastExternalValueRef.current = sanitizeTextEditorHtml(value)\n }\n }, [value])\n\n React.useEffect(() => {\n const editor = editorInstanceRef.current\n if (!isEditorReady || !editor || value === undefined) return\n if (editor.editing.view.document.isFocused) return\n if (value === editor.getData()) return\n\n editor.data.set(sanitizeTextEditorHtml(value))\n }, [value, isEditorReady])\n\n // Cleanup keydown listener on unmount\n React.useEffect(() => {\n return () => {\n if (keyDownListenerRef.current && editorInstanceRef.current) {\n editorInstanceRef.current.editing.view.document.off(\n 'keydown',\n keyDownListenerRef.current\n )\n keyDownListenerRef.current = null\n }\n }\n }, [])\n\n // Update aria-label when ariaLabel prop changes\n React.useEffect(() => {\n if (!isEditorReady || !editorInstanceRef.current) {\n return\n }\n\n const editor = editorInstanceRef.current\n editor.editing.view.change((writer) => {\n const viewEditableRoot = editor.editing.view.document.getRoot()\n if (viewEditableRoot) {\n if (ariaLabel) {\n writer.setAttribute('aria-label', ariaLabel, viewEditableRoot)\n } else {\n writer.removeAttribute('aria-label', viewEditableRoot)\n }\n }\n })\n }, [ariaLabel, isEditorReady])\n\n // Update aria-description when ariaDescription prop changes\n React.useEffect(() => {\n if (!isEditorReady || !editorInstanceRef.current) {\n return\n }\n\n const editor = editorInstanceRef.current\n editor.editing.view.change((writer) => {\n const viewEditableRoot = editor.editing.view.document.getRoot()\n if (viewEditableRoot) {\n if (ariaDescription) {\n writer.setAttribute(\n 'aria-description',\n ariaDescription,\n viewEditableRoot\n )\n } else {\n writer.removeAttribute('aria-description', viewEditableRoot)\n }\n }\n })\n }, [ariaDescription, isEditorReady])\n\n const { value: zIndex } = useZIndexContext()\n\n const { features } = React.useContext(TextEditorContext)\n const enableStickyToolbar = !!features?.stickyToolbar\n const enableTabAsNavigation = !!features?.tabAsNavigation\n\n const imageUploadHandlers = React.useMemo(() => {\n if (companyId === undefined || toolName === undefined) {\n return undefined\n }\n\n const handlerOptions = {\n companyId,\n projectId,\n toolName,\n i18n,\n }\n\n const upload = richTextEditorUploadHandler(handlerOptions)\n\n return {\n upload,\n i18n,\n onError: showToast.error,\n onWarning: showImageUploadWarning,\n }\n }, [\n companyId,\n i18n,\n projectId,\n showImageUploadWarning,\n showToast.error,\n toolName,\n ])\n\n const mergedConfig = React.useMemo(() => {\n const defaultConfig = getDefaultConfig(locale, {\n imageUpload: imageUploadHandlers,\n })\n\n // Set accessible label for the editable area if provided\n // This is used by screen readers to announce the editor's purpose\n if (ariaLabel) {\n defaultConfig.label = ariaLabel\n }\n\n if (placeholder) {\n defaultConfig.root = { ...defaultConfig.root, placeholder }\n }\n\n return defaultConfig\n }, [ariaLabel, imageUploadHandlers, locale, placeholder])\n\n const bindKeyDownHandler = React.useCallback(\n (editor: ClassicEditor) => {\n const editorElement = editor.editing.view.document.getRoot()\n if (!editorElement) {\n return\n }\n\n // Remove existing keydown listener\n if (keyDownListenerRef.current) {\n editor.editing.view.document.off('keydown', keyDownListenerRef.current)\n }\n\n // Create and store the new listener\n const keyDownListener = (\n _event: EventInfo,\n data: { domEvent: Event }\n ) => {\n const domEvent = data.domEvent as KeyboardEvent\n // Prevent Enter from propagating to parent forms so the\n // editor can handle newlines without accidentally submitting.\n if (domEvent.key === 'Enter') {\n domEvent.stopPropagation()\n }\n\n onKeyDown?.(domEvent, editor)\n }\n\n keyDownListenerRef.current = keyDownListener\n\n // Add the keydown listener\n editor.editing.view.document.on('keydown', keyDownListener)\n },\n [onKeyDown]\n )\n\n const debouncedChange = React.useRef(\n debounce((_event: EventInfo<string, unknown>, editor: ClassicEditor) => {\n const data = editor.getData()\n const isDirty = data !== lastExternalValueRef.current.trim()\n const hasPendingUploads = hasPendingImageUploads(editor)\n\n if (isDirty && !isDirtyState) {\n setIsDirtyState(true)\n onDirty?.()\n }\n\n if (hasPendingUploads) {\n return\n }\n\n onChange?.(data, isDirty)\n }, DEBOUNCE_MS)\n ).current\n\n const handleChange = debouncedChange\n\n const handleReady = (editor: ClassicEditor) => {\n addButtonDataAttributes(editor)\n editorInstanceRef.current = editor\n setIsEditorReady(true)\n const sanitizedValue = sanitizeTextEditorHtml(value ?? initialValue ?? '')\n if (sanitizedValue !== editor.getData()) {\n editor.data.set(sanitizedValue)\n }\n\n // Set aria-label and aria-description on the editable area if provided\n // These provide accessible context to screen reader users\n editor.editing.view.change((writer) => {\n const viewEditableRoot = editor.editing.view.document.getRoot()\n if (viewEditableRoot) {\n if (ariaLabel) {\n writer.setAttribute('aria-label', ariaLabel, viewEditableRoot)\n }\n if (ariaDescription) {\n writer.setAttribute(\n 'aria-description',\n ariaDescription,\n viewEditableRoot\n )\n }\n if (rows !== undefined) {\n const baseHeight = 35\n const rowHeight = 22\n const editorHeight = rows * rowHeight + baseHeight\n writer.setStyle('min-height', `${editorHeight}px`, viewEditableRoot)\n\n if (!extendable) {\n writer.setStyle('max-height', `${editorHeight}px`, viewEditableRoot)\n }\n }\n }\n })\n\n // Bind keydown handler when editor is ready\n bindKeyDownHandler(editor)\n\n onInit?.(editor)\n }\n\n const handleBlur = (\n event: EventInfo<string, unknown>,\n editor: ClassicEditor\n ) => {\n debouncedChange.flush()\n onBlur?.(event, editor)\n }\n\n useStickyToolbar({\n enabled: enableStickyToolbar,\n editor: isEditorReady ? editorInstanceRef.current : null,\n editorRef,\n cssLoading,\n })\n\n const { config } = useTabAsNavigation({\n config: mergedConfig,\n enabled: enableTabAsNavigation,\n editor: isEditorReady ? editorInstanceRef.current : null,\n })\n\n const editorKey = `${locale}-${enableTabAsNavigation}`\n\n if (cssLoading) {\n return null\n }\n\n if (readonly) {\n return (\n <TextEditorOutput\n value={value}\n aria-label={ariaLabel}\n aria-description={ariaDescription}\n />\n )\n }\n\n return (\n <StyledTextEditor\n ref={editorRef}\n key={editorKey}\n error={error}\n $ready={isEditorReady}\n aria-invalid={error ? 'true' : 'false'}\n >\n <GlobalEditorStyles zIndex={zIndex + 1} />\n <TextEditorTheme />\n <CKEditor\n {...restProps}\n editor={ClassicEditor}\n config={config}\n disabled={disabled}\n data={initialValueRef.current}\n onChange={handleChange}\n onReady={handleReady}\n onBlur={handleBlur}\n />\n </StyledTextEditor>\n )\n}\n\nfunction hasPendingImageUploads(editor: ClassicEditor) {\n try {\n const fileRepository = editor.plugins.get(FileRepository) as {\n loaders?: Iterable<{ status?: string }>\n }\n\n return Array.from(fileRepository.loaders ?? []).some((loader) =>\n ['reading', 'uploading'].includes(String(loader.status))\n )\n } catch (_error) {\n return false\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,SAASA,QAAQ,QAAQ,2BAA2B;AACpD,SAASC,oBAAoB,QAAQ,sBAAsB;AAC3D,SAASC,aAAa,EAAEC,cAAc,QAAwB,WAAW;AACzE,OAAOC,KAAK,MAAM,OAAO;AAEzB,SAASC,KAAK,EAAEC,cAAc,EAAEC,gBAAgB,QAAQ,qBAAqB;AAC7E,SAASC,gBAAgB,QAAQ,qBAAqB;AACtD,SAASC,sBAAsB,QAAQ,4CAA4C;AACnF,SAASC,QAAQ,QAAQ,mBAAmB;AAC5C,SAASC,gBAAgB,QAAQ,iBAAiB;AAClD,SACEC,kBAAkB,EAClBC,6BAA6B,EAC7BC,iCAAiC,EACjCC,gBAAgB,QACX,qBAAqB;AAE5B,SAASC,iBAAiB,QAAQ,sBAAsB;AACxD,SAASC,eAAe,QAAQ,qBAAqB;AACrD,SAASC,cAAc,QAAQ,kBAAkB;AACjD,SAASC,qBAAqB,QAAQ,yBAAyB;AAC/D,SAASC,kBAAkB,QAAQ,sBAAsB;AACzD,SAASC,uBAAuB,EAAEC,gBAAgB,QAAQ,SAAS;AACnE,SAASC,2BAA2B,QAAQ,gCAAgC;AAE5E,IAAMC,WAAW,GAAG,GAAG;AAEvB,OAAO,IAAMC,YAAY,GAAG,SAAfA,YAAYA,CAAIC,KAAgC,EAAK;EAChE,IACEC,QAAQ,GAkBND,KAAK,CAlBPC,QAAQ;IACRC,KAAK,GAiBHF,KAAK,CAjBPE,KAAK;IACLC,QAAQ,GAgBNH,KAAK,CAhBPG,QA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E,CAAC,CAACO,IAAI,CAAC,UAACC,MAAM;MAAA,OAC1D,CAAC,SAAS,EAAE,WAAW,CAAC,CAACC,QAAQ,CAACC,MAAM,CAACF,MAAM,CAACG,MAAM,CAAC,CAAC;IAAA,CAC1D,CAAC;EACH,CAAC,CAAC,OAAOC,MAAM,EAAE;IACf,OAAO,KAAK;EACd;AACF","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Info } from '@procore/core-icons';
|
|
2
2
|
import { borderRadius, colors, Flex, Typography } from '@procore/core-react';
|
|
3
3
|
import styled, { createGlobalStyle } from 'styled-components';
|
|
4
|
-
export var GlobalEditorStyles = /*#__PURE__*/createGlobalStyle([":root{--ck-z-default:", ";--ck-z-modal:", ";--ck-z-dialog:", ";}.ck-body-wrapper{--ck-z-default:", ";--ck-z-modal:", ";--ck-z-dialog:", ";}.ck-balloon-panel{z-index:", " !important;}.ck-dropdown__panel{z-index:", " !important;}.ck.ck-toolbar_grouping{container-type:inline-size;}.ck.ck-toolbar__grouped-dropdown > .ck-dropdown__panel{max-width:100cqw !important;z-index:", " !important;}.ck.ck-toolbar__grouped-dropdown > .ck-dropdown__panel .ck-toolbar__items{flex-wrap:wrap !important;}.ck-content{padding:16px 28px !important;--ck-content-font-family:Inter,'Noto Sans JP','Noto Sans KR','Noto Sans SC','Noto Sans TC',sans-serif;--ck-content-font-size:14px;--ck-content-word-break:break-word;--ck-content-overflow-wrap:break-word;--ck-content-line-height:1.4;overflow-x:auto;p{margin-top:0 !important;margin-bottom:0 !important;}img{max-width:100%;height:auto;}}[data-id=\"modal\"] .ck-sticky-panel__content_sticky{top:var(--modal-header-height,84px) !important;}"], function (_ref) {
|
|
4
|
+
export var GlobalEditorStyles = /*#__PURE__*/createGlobalStyle([":root{--ck-z-default:", ";--ck-z-modal:", ";--ck-z-dialog:", ";}.ck-body-wrapper{--ck-z-default:", ";--ck-z-modal:", ";--ck-z-dialog:", ";}.ck-balloon-panel{z-index:", " !important;}.ck-dropdown__panel{z-index:", " !important;}.ck.ck-toolbar_grouping{container-type:inline-size;}.ck.ck-toolbar__grouped-dropdown > .ck-dropdown__panel{max-width:100cqw !important;z-index:", " !important;}.ck.ck-toolbar__grouped-dropdown > .ck-dropdown__panel .ck-toolbar__items{flex-wrap:wrap !important;}.ck-content{padding:16px 28px !important;--ck-content-font-family:Inter,'Noto Sans JP','Noto Sans KR','Noto Sans SC','Noto Sans TC',sans-serif;--ck-content-font-size:14px;--ck-content-word-break:break-word;--ck-content-overflow-wrap:break-word;--ck-content-line-height:1.4;overflow-x:auto;p{margin-top:0 !important;margin-bottom:0 !important;}img{max-width:100%;height:auto;}}[data-id=\"modal\"] .ck-sticky-panel__content_sticky{top:var(--modal-header-height,84px) !important;}.ck.ck-editor__editable .image.ck-appear,.ck.ck-editor__editable .image-inline.ck-appear{img{opacity:0.70;transition:filter 0.2s ease-out,opacity 0.2s ease-out;}&::before{content:'';position:absolute;top:16px;left:16px;right:16px;height:8px;border-radius:4px;background:", ";box-shadow:0 1px 4px rgba(0,0,0,0.25);z-index:1;}}.ck.ck-editor__editable .image .ck-progress-bar,.ck.ck-editor__editable .image-inline .ck-progress-bar{top:16px !important;height:8px !important;clip-path:inset(0 16px 0 16px round 4px);min-width:40px;background:", " !important;z-index:2;transition:width 0.15s ease-out !important;}"], function (_ref) {
|
|
5
5
|
var zIndex = _ref.zIndex;
|
|
6
6
|
return zIndex;
|
|
7
7
|
}, function (_ref2) {
|
|
@@ -28,10 +28,10 @@ export var GlobalEditorStyles = /*#__PURE__*/createGlobalStyle([":root{--ck-z-de
|
|
|
28
28
|
}, function (_ref9) {
|
|
29
29
|
var zIndex = _ref9.zIndex;
|
|
30
30
|
return zIndex + 1000;
|
|
31
|
-
});
|
|
31
|
+
}, colors.white, colors.blue45);
|
|
32
32
|
export var StyledTextEditor = /*#__PURE__*/styled.div.withConfig({
|
|
33
33
|
displayName: "StyledTextEditor",
|
|
34
|
-
componentId: "text-editor-
|
|
34
|
+
componentId: "text-editor-1_2_0__sc-iim79x-0"
|
|
35
35
|
})([".ck.ck-editor{opacity:", ";}", ""], function (_ref0) {
|
|
36
36
|
var $ready = _ref0.$ready;
|
|
37
37
|
return $ready ? 1 : 0;
|
|
@@ -41,14 +41,14 @@ export var StyledTextEditor = /*#__PURE__*/styled.div.withConfig({
|
|
|
41
41
|
});
|
|
42
42
|
export var StyledImageUploadWarningToast = /*#__PURE__*/styled(Flex).withConfig({
|
|
43
43
|
displayName: "StyledImageUploadWarningToast",
|
|
44
|
-
componentId: "text-editor-
|
|
44
|
+
componentId: "text-editor-1_2_0__sc-iim79x-1"
|
|
45
45
|
})(["background-color:", ";border-radius:", "px;box-shadow:0px 8px 32px -4px hsla(200,10%,15%,0.64);color:", ";min-height:48px;width:550px;"], colors.blue40, borderRadius.md, colors.white);
|
|
46
46
|
export var StyledImageUploadWarningToastIcon = /*#__PURE__*/styled(Info).withConfig({
|
|
47
47
|
displayName: "StyledImageUploadWarningToastIcon",
|
|
48
|
-
componentId: "text-editor-
|
|
48
|
+
componentId: "text-editor-1_2_0__sc-iim79x-2"
|
|
49
49
|
})(["color:", ";"], colors.white);
|
|
50
50
|
export var StyledReadOnlyValue = /*#__PURE__*/styled(Typography).withConfig({
|
|
51
51
|
displayName: "StyledReadOnlyValue",
|
|
52
|
-
componentId: "text-editor-
|
|
52
|
+
componentId: "text-editor-1_2_0__sc-iim79x-3"
|
|
53
53
|
})(["overflow-wrap:anywhere;margin-block-start:0 !important;user-select:text;table{border-width:revert-layer;border-style:solid;border-color:", ";overflow-wrap:break-word;}td,tr,th,tbody{border-width:revert-layer;border-style:inherit;border-color:inherit;}p{line-height:normal;}"], colors.gray60);
|
|
54
54
|
//# sourceMappingURL=TextEditor.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextEditor.styles.js","names":["Info","borderRadius","colors","Flex","Typography","styled","createGlobalStyle","GlobalEditorStyles","_ref","zIndex","_ref2","_ref3","_ref4","_ref5","_ref6","_ref7","_ref8","_ref9","StyledTextEditor","div","withConfig","displayName","componentId","_ref0","$ready","_ref1","error","concat","red50","StyledImageUploadWarningToast","blue40","md","
|
|
1
|
+
{"version":3,"file":"TextEditor.styles.js","names":["Info","borderRadius","colors","Flex","Typography","styled","createGlobalStyle","GlobalEditorStyles","_ref","zIndex","_ref2","_ref3","_ref4","_ref5","_ref6","_ref7","_ref8","_ref9","white","blue45","StyledTextEditor","div","withConfig","displayName","componentId","_ref0","$ready","_ref1","error","concat","red50","StyledImageUploadWarningToast","blue40","md","StyledImageUploadWarningToastIcon","StyledReadOnlyValue","gray60"],"sources":["../../src/TextEditor/TextEditor.styles.ts"],"sourcesContent":["import { Info } from '@procore/core-icons'\nimport { borderRadius, colors, Flex, Typography } from '@procore/core-react'\nimport styled, { createGlobalStyle } from 'styled-components'\n\nexport const GlobalEditorStyles = createGlobalStyle<{\n zIndex: number\n}>`\n :root {\n --ck-z-default: ${({ zIndex }) => zIndex};\n --ck-z-modal: ${({ zIndex }) => zIndex + 999};\n --ck-z-dialog: ${({ zIndex }) => zIndex + 1000};\n }\n \n .ck-body-wrapper {\n --ck-z-default: ${({ zIndex }) => zIndex};\n --ck-z-modal: ${({ zIndex }) => zIndex + 999};\n --ck-z-dialog: ${({ zIndex }) => zIndex + 1000};\n }\n \n .ck-balloon-panel {\n z-index: ${({ zIndex }) => zIndex + 1000} !important;\n }\n\n .ck-dropdown__panel {\n z-index: ${({ zIndex }) => zIndex + 1000} !important;\n }\n\n .ck.ck-toolbar_grouping {\n container-type: inline-size;\n }\n\n .ck.ck-toolbar__grouped-dropdown > .ck-dropdown__panel {\n max-width: 100cqw !important;\n z-index: ${({ zIndex }) => zIndex + 1000} !important;\n }\n\n .ck.ck-toolbar__grouped-dropdown > .ck-dropdown__panel .ck-toolbar__items {\n flex-wrap: wrap !important;\n }\n\n .ck-content {\n padding: 16px 28px !important;\n --ck-content-font-family: Inter, 'Noto Sans JP', 'Noto Sans KR', 'Noto Sans SC', 'Noto Sans TC', sans-serif;\n --ck-content-font-size: 14px;\n --ck-content-word-break: break-word;\n --ck-content-overflow-wrap: break-word;\n --ck-content-line-height: 1.4;\n overflow-x: auto;\n\n p {\n margin-top: 0 !important;\n margin-bottom: 0 !important;\n }\n\n img {\n max-width: 100%;\n height: auto;\n }\n }\n\n [data-id=\"modal\"] .ck-sticky-panel__content_sticky {\n top: var(--modal-header-height, 84px) !important;\n }\n\n /* Upload progress: gray the image out and show a blue bar on a white\n track inset inside the image while uploading (.ck-appear is removed\n when done). */\n .ck.ck-editor__editable .image.ck-appear,\n .ck.ck-editor__editable .image-inline.ck-appear {\n img {\n opacity: 0.70;\n transition: filter 0.2s ease-out, opacity 0.2s ease-out;\n }\n\n &::before {\n content: '';\n position: absolute;\n top: 16px;\n left: 16px;\n right: 16px;\n height: 8px;\n border-radius: 4px;\n background: ${colors.white};\n box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);\n z-index: 1;\n }\n }\n\n .ck.ck-editor__editable .image .ck-progress-bar,\n .ck.ck-editor__editable .image-inline .ck-progress-bar {\n top: 16px !important;\n height: 8px !important;\n clip-path: inset(0 16px 0 16px round 4px);\n min-width: 40px;\n background: ${colors.blue45} !important;\n z-index: 2;\n transition: width 0.15s ease-out !important;\n }\n`\n\nexport const StyledTextEditor = styled.div<{\n error?: boolean\n $ready?: boolean\n}>`\n .ck.ck-editor {\n opacity: ${({ $ready }) => ($ready ? 1 : 0)};\n }\n\n ${({ error }) =>\n error &&\n `\n .ck-sticky-panel__content {\n border-top-color: ${colors.red50} !important;\n border-left-color: ${colors.red50} !important;\n border-right-color: ${colors.red50} !important;\n }\n\n .ck-editor__editable {\n border-left-color: ${colors.red50} !important;\n border-right-color: ${colors.red50} !important;\n border-bottom-color: ${colors.red50} !important;\n }\n `}\n`\n\nexport const StyledImageUploadWarningToast = styled(Flex)`\n background-color: ${colors.blue40};\n border-radius: ${borderRadius.md}px;\n box-shadow: 0px 8px 32px -4px hsla(200, 10%, 15%, 0.64);\n color: ${colors.white};\n min-height: 48px;\n width: 550px;\n`\n\nexport const StyledImageUploadWarningToastIcon = styled(Info)`\n color: ${colors.white};\n`\n\nexport const StyledReadOnlyValue = styled(Typography)`\n overflow-wrap: anywhere;\n margin-block-start: 0 !important;\n user-select: text;\n\n table {\n border-width: revert-layer;\n border-style: solid;\n border-color: ${colors.gray60};\n overflow-wrap: break-word;\n }\n\n td,\n tr,\n th,\n tbody {\n border-width: revert-layer;\n border-style: inherit;\n border-color: inherit;\n }\n\n p {\n line-height: normal;\n }\n`\n"],"mappings":"AAAA,SAASA,IAAI,QAAQ,qBAAqB;AAC1C,SAASC,YAAY,EAAEC,MAAM,EAAEC,IAAI,EAAEC,UAAU,QAAQ,qBAAqB;AAC5E,OAAOC,MAAM,IAAIC,iBAAiB,QAAQ,mBAAmB;AAE7D,OAAO,IAAMC,kBAAkB,gBAAGD,iBAAiB,2iDAI7B,UAAAE,IAAA;EAAA,IAAGC,MAAM,GAAAD,IAAA,CAANC,MAAM;EAAA,OAAOA,MAAM;AAAA,GACxB,UAAAC,KAAA;EAAA,IAAGD,MAAM,GAAAC,KAAA,CAAND,MAAM;EAAA,OAAOA,MAAM,GAAG,GAAG;AAAA,GAC3B,UAAAE,KAAA;EAAA,IAAGF,MAAM,GAAAE,KAAA,CAANF,MAAM;EAAA,OAAOA,MAAM,GAAG,IAAI;AAAA,GAI5B,UAAAG,KAAA;EAAA,IAAGH,MAAM,GAAAG,KAAA,CAANH,MAAM;EAAA,OAAOA,MAAM;AAAA,GACxB,UAAAI,KAAA;EAAA,IAAGJ,MAAM,GAAAI,KAAA,CAANJ,MAAM;EAAA,OAAOA,MAAM,GAAG,GAAG;AAAA,GAC3B,UAAAK,KAAA;EAAA,IAAGL,MAAM,GAAAK,KAAA,CAANL,MAAM;EAAA,OAAOA,MAAM,GAAG,IAAI;AAAA,GAInC,UAAAM,KAAA;EAAA,IAAGN,MAAM,GAAAM,KAAA,CAANN,MAAM;EAAA,OAAOA,MAAM,GAAG,I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B,gBAAG9B,MAAM,CAACD,UAAU,CAAC,CAAAkB,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,0RAQjCtB,MAAM,CAACkC,MAAM,CAgBhC","ignoreList":[]}
|
|
@@ -52,7 +52,33 @@ export interface TextEditorImageUploadOptions {
|
|
|
52
52
|
*/
|
|
53
53
|
toolName?: string;
|
|
54
54
|
}
|
|
55
|
-
|
|
55
|
+
/**
|
|
56
|
+
* Height behavior. `extendable` is only accepted together with `rows`:
|
|
57
|
+
* without `rows` the editor always auto-grows, so `extendable` would be
|
|
58
|
+
* meaningless and is rejected at the type level.
|
|
59
|
+
*/
|
|
60
|
+
export type TextEditorHeightProps = {
|
|
61
|
+
/**
|
|
62
|
+
* Number of rows to control the editor height. When set, the editor
|
|
63
|
+
* height is fixed. When omitted, the editor grows with content.
|
|
64
|
+
*
|
|
65
|
+
* @since 1.0.0
|
|
66
|
+
*/
|
|
67
|
+
rows: number;
|
|
68
|
+
/**
|
|
69
|
+
* When true, the `rows` height acts as a minimum instead of a fixed
|
|
70
|
+
* size: the editor starts at that height and grows with content beyond
|
|
71
|
+
* it. When false or omitted, the `rows` height is fixed and overflowing
|
|
72
|
+
* content scrolls.
|
|
73
|
+
*
|
|
74
|
+
* @since 1.1.0
|
|
75
|
+
*/
|
|
76
|
+
extendable?: boolean;
|
|
77
|
+
} | {
|
|
78
|
+
rows?: never;
|
|
79
|
+
extendable?: never;
|
|
80
|
+
};
|
|
81
|
+
export interface TextEditorBaseProps extends TextEditorImageUploadOptions {
|
|
56
82
|
/**
|
|
57
83
|
* Unique identifier for the editor
|
|
58
84
|
*
|
|
@@ -185,13 +211,6 @@ export interface TextEditorProps extends TextEditorImageUploadOptions {
|
|
|
185
211
|
* @since 1.0.0
|
|
186
212
|
*/
|
|
187
213
|
init?: CoreTextEditorProps['init'];
|
|
188
|
-
/**
|
|
189
|
-
* Number of rows to control the editor height. When set, the editor height
|
|
190
|
-
* is fixed. When omitted, the editor grows with content.
|
|
191
|
-
*
|
|
192
|
-
* @since 1.0.0
|
|
193
|
-
*/
|
|
194
|
-
rows?: number;
|
|
195
214
|
/**
|
|
196
215
|
* Opt in to CKEditor immediately, bypassing the gradual feature flag rollout.
|
|
197
216
|
* Use this only when you explicitly want to ignore the rollout schedule.
|
|
@@ -201,6 +220,7 @@ export interface TextEditorProps extends TextEditorImageUploadOptions {
|
|
|
201
220
|
*/
|
|
202
221
|
enforceCKEditor?: true;
|
|
203
222
|
}
|
|
223
|
+
export type TextEditorProps = TextEditorBaseProps & TextEditorHeightProps;
|
|
204
224
|
export type KeyDownListener = (event: EventInfo, data: {
|
|
205
225
|
domEvent: Event;
|
|
206
226
|
}) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextEditor.types.js","names":[],"sources":["../../src/TextEditor/TextEditor.types.ts"],"sourcesContent":["import type { I18njs } from '@procore/core-i18n-js'\nimport type { TextEditorProps as CoreTextEditorProps } from '@procore/core-react'\nimport type { Locale } from '@procore/globalization-toolkit'\nimport type { ClassicEditor, EventInfo } from 'ckeditor5'\n\nexport interface TextEditorImageUploadResult {\n urls: {\n default: string\n }\n /**\n * Durable ProstoreFile id. The text editor embeds this ID in saved markup to\n * mark the image as a first-party upload (backend email/PDF sanitizers rely on\n * it). The persisted URL is a permanent, publicly fetchable Prostore URL, so\n * it renders as-is in the app, emails, and exports.\n *\n * @since 0.6.0\n */\n prostoreFileId: number | string\n width?: number\n height?: number\n}\n\nexport interface TextEditorImageUploadHandlers {\n /**\n * Uploads the selected image and returns durable backend-approved image URLs.\n *\n * @since 0.4.2\n */\n upload: (\n file: File,\n context: { signal: AbortSignal },\n callbacks: { onProgress?: (uploaded: number, total?: number) => void }\n ) => Promise<TextEditorImageUploadResult>\n i18n: Pick<I18njs, 't'>\n onError?: (message: string) => void\n onWarning?: (message: string) => void\n}\n\nexport interface TextEditorImageUploadOptions {\n /**\n * Required to enable image uploads. When omitted, the editor renders without\n * the Procore image-upload plugin.\n *\n * @since 0.5.0\n */\n companyId?: number | string\n projectId?: number | string\n /**\n * Identifier of the tool hosting the editor (e.g. `rfis`, `submittal_log`).\n * Required to enable image uploads: it is sent with each upload for\n * attribution/audit and is validated by the backend against known tools.\n * When omitted, the editor renders without the Procore image-upload plugin.\n *\n * @since 0.7.0\n */\n toolName?: string\n}\n\nexport interface
|
|
1
|
+
{"version":3,"file":"TextEditor.types.js","names":[],"sources":["../../src/TextEditor/TextEditor.types.ts"],"sourcesContent":["import type { I18njs } from '@procore/core-i18n-js'\nimport type { TextEditorProps as CoreTextEditorProps } from '@procore/core-react'\nimport type { Locale } from '@procore/globalization-toolkit'\nimport type { ClassicEditor, EventInfo } from 'ckeditor5'\n\nexport interface TextEditorImageUploadResult {\n urls: {\n default: string\n }\n /**\n * Durable ProstoreFile id. The text editor embeds this ID in saved markup to\n * mark the image as a first-party upload (backend email/PDF sanitizers rely on\n * it). The persisted URL is a permanent, publicly fetchable Prostore URL, so\n * it renders as-is in the app, emails, and exports.\n *\n * @since 0.6.0\n */\n prostoreFileId: number | string\n width?: number\n height?: number\n}\n\nexport interface TextEditorImageUploadHandlers {\n /**\n * Uploads the selected image and returns durable backend-approved image URLs.\n *\n * @since 0.4.2\n */\n upload: (\n file: File,\n context: { signal: AbortSignal },\n callbacks: { onProgress?: (uploaded: number, total?: number) => void }\n ) => Promise<TextEditorImageUploadResult>\n i18n: Pick<I18njs, 't'>\n onError?: (message: string) => void\n onWarning?: (message: string) => void\n}\n\nexport interface TextEditorImageUploadOptions {\n /**\n * Required to enable image uploads. When omitted, the editor renders without\n * the Procore image-upload plugin.\n *\n * @since 0.5.0\n */\n companyId?: number | string\n projectId?: number | string\n /**\n * Identifier of the tool hosting the editor (e.g. `rfis`, `submittal_log`).\n * Required to enable image uploads: it is sent with each upload for\n * attribution/audit and is validated by the backend against known tools.\n * When omitted, the editor renders without the Procore image-upload plugin.\n *\n * @since 0.7.0\n */\n toolName?: string\n}\n\n/**\n * Height behavior. `extendable` is only accepted together with `rows`:\n * without `rows` the editor always auto-grows, so `extendable` would be\n * meaningless and is rejected at the type level.\n */\nexport type TextEditorHeightProps =\n | {\n /**\n * Number of rows to control the editor height. When set, the editor\n * height is fixed. When omitted, the editor grows with content.\n *\n * @since 1.0.0\n */\n rows: number\n\n /**\n * When true, the `rows` height acts as a minimum instead of a fixed\n * size: the editor starts at that height and grows with content beyond\n * it. When false or omitted, the `rows` height is fixed and overflowing\n * content scrolls.\n *\n * @since 1.1.0\n */\n extendable?: boolean\n }\n | {\n rows?: never\n extendable?: never\n }\n\nexport interface TextEditorBaseProps extends TextEditorImageUploadOptions {\n /**\n * Unique identifier for the editor\n *\n * @since 0.0.1\n */\n id?: string\n\n /**\n * Initial value of the editor\n *\n * @deprecated `initialValue` has been deprecated and will be removed in a future version.\n * Please use the `value` prop instead\n * @deprecatedSince 0.0.1\n * @since 0.0.1\n */\n initialValue?: string\n\n /**\n * The current value of the editor\n *\n * @since 0.0.1\n */\n value?: string\n\n /**\n * Indicates if the editor is disabled\n *\n * @since 0.0.1\n */\n disabled?: boolean\n\n /**\n * Indicates if the editor is in an error state\n *\n * @since 0.0.1\n */\n error?: boolean\n\n /**\n * Indicates if the editor is in readonly mode.\n * When true, renders the content using TextEditorOutput instead of the editable editor.\n *\n * @since 0.2.0\n */\n readonly?: boolean\n\n /**\n * Accessible label for the editor's editable area. This text will be\n * announced by screen readers when the user focuses the editor. It should\n * match or include the visible label associated with this editor field.\n * If not provided, screen readers will announce a generic \"Rich Text Editor\" message.\n *\n * @since 0.1.0\n */\n 'aria-label'?: string\n\n /**\n * Accessible description for the editor's editable area.\n * This text provides additional context to screen reader users. It will be\n * announced after the label when the user focuses the editor.\n *\n * @since 0.1.0\n */\n 'aria-description'?: string\n\n /**\n * Locale which will be used for localization. Can be passed directly or\n * set by wrapping components in I18n provider.\n * @since 0.0.1\n */\n locale?: Locale\n\n /**\n * Callback fired when the editor content changes\n *\n * @param value - The current content of the editor\n * @param isDirty - Whether the content differs from the initial value\n * @since 0.0.1\n */\n onChange?: (value: string, isDirty?: boolean) => void\n\n /**\n * Callback fired when the editor gains focus\n *\n * @since 0.0.1\n */\n onFocus?: (event: EventInfo, editor: ClassicEditor) => void\n\n /**\n * Callback fired when the editor loses focus\n *\n * @since 0.0.1\n */\n onBlur?: (event: EventInfo, editor: ClassicEditor) => void\n\n /**\n * Callback fired when an error occurs in the editor\n *\n * @since 0.0.1\n */\n onError?: (\n error: Error,\n details: {\n phase: 'initialization' | 'runtime'\n willEditorRestart?: boolean\n }\n ) => void\n\n /**\n * Callback fired when the editor is ready\n *\n * @since 0.0.1\n */\n onInit?: (editor: ClassicEditor) => void\n\n /**\n * Callback fired after the editor instance is destroyed\n *\n * @since 0.0.1\n */\n onAfterDestroy?: () => void\n\n /**\n * Callback fired when the editor becomes dirty (content differs from initial value)\n *\n * @since 0.0.1\n */\n onDirty?: () => void\n\n /**\n * Callback fired when a key is pressed in the editor\n *\n * @param event - The keyboard event\n * @param editor - The CKEditor instance\n * @since 0.0.1\n */\n onKeyDown?: (event: KeyboardEvent, editor: ClassicEditor) => void\n\n /**\n * Placeholder text shown when the editor is empty\n *\n * @since 1.0.0\n */\n placeholder?: string\n\n /**\n * TinyMCE init configuration. Merged with internal defaults; use this to\n * pass custom content_style, paste hooks, or other TinyMCE-specific options.\n * Has no effect when CKEditor is active.\n *\n * @since 1.0.0\n */\n init?: CoreTextEditorProps['init']\n\n /**\n * Opt in to CKEditor immediately, bypassing the gradual feature flag rollout.\n * Use this only when you explicitly want to ignore the rollout schedule.\n * When enabled, the LaunchDarkly flag is bypassed and CKEditor is rendered directly.\n *\n * @since 1.0.0\n */\n enforceCKEditor?: true\n}\n\nexport type TextEditorProps = TextEditorBaseProps & TextEditorHeightProps\n\nexport type KeyDownListener = (\n event: EventInfo,\n data: { domEvent: Event }\n) => void\n"],"mappings":"","ignoreList":[]}
|
|
@@ -22,6 +22,7 @@ export var TinyMCETextEditor = function TinyMCETextEditor(props) {
|
|
|
22
22
|
readonly = props.readonly,
|
|
23
23
|
placeholder = props.placeholder,
|
|
24
24
|
rows = props.rows,
|
|
25
|
+
extendable = props.extendable,
|
|
25
26
|
onChange = props.onChange,
|
|
26
27
|
onBlur = props.onBlur,
|
|
27
28
|
onFocus = props.onFocus,
|
|
@@ -51,7 +52,7 @@ export var TinyMCETextEditor = function TinyMCETextEditor(props) {
|
|
|
51
52
|
init: _objectSpread({
|
|
52
53
|
contextmenu: false,
|
|
53
54
|
min_height: height,
|
|
54
|
-
max_height: height,
|
|
55
|
+
max_height: extendable ? undefined : height,
|
|
55
56
|
placeholder: placeholder
|
|
56
57
|
}, init),
|
|
57
58
|
onChange: onChange,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TinyMCETextEditor.js","names":["TextEditor","TinyMCEEditor","tinyMCE","React","useMemo","sanitizeTextEditorHtml","StyledReadOnlyValue","TinyMCETextEditor","props","id","value","disabled","error","readonly","placeholder","rows","onChange","onBlur","onFocus","onKeyDown","init","baseHeight","rowHeight","height","undefined","sanitizedValue","createElement","dangerouslySetInnerHTML","__html","textareaName","plugins","concat","_toConsumableArray","defaultPlugins","_objectSpread","contextmenu","min_height","max_height"],"sources":["../../src/TextEditor/TinyMCETextEditor.tsx"],"sourcesContent":["import { TextEditor as TinyMCEEditor, tinyMCE } from '@procore/core-react'\nimport React, { useMemo } from 'react'\nimport { sanitizeTextEditorHtml } from '../TextEditorOutput/TextEditorOutput.utils'\nimport { StyledReadOnlyValue } from './TextEditor.styles'\nimport type { TextEditorProps } from './TextEditor.types'\n\nexport const TinyMCETextEditor = (props: TextEditorProps) => {\n const {\n id,\n value,\n disabled,\n error,\n readonly,\n placeholder,\n rows,\n onChange,\n onBlur,\n onFocus,\n onKeyDown,\n init,\n } = props\n\n const baseHeight = 74\n const rowHeight = 22\n const height = rows === undefined ? undefined : rows * rowHeight + baseHeight\n\n const sanitizedValue = useMemo(\n () => sanitizeTextEditorHtml(value || '') || '--',\n [value]\n )\n\n if (readonly) {\n return (\n <StyledReadOnlyValue>\n <div dangerouslySetInnerHTML={{ __html: sanitizedValue }} />\n </StyledReadOnlyValue>\n )\n }\n\n return (\n <TinyMCEEditor\n id={id}\n value={value}\n disabled={disabled}\n error={error}\n aria-label={props['aria-label']}\n textareaName={props['aria-label']}\n plugins={[...tinyMCE.defaultPlugins, 'link', 'table']}\n init={{\n contextmenu: false,\n min_height: height,\n max_height: height,\n placeholder,\n ...init,\n }}\n onChange={onChange}\n onBlur={onBlur as React.ComponentProps<typeof TinyMCEEditor>['onBlur']}\n onFocus={onFocus as React.ComponentProps<typeof TinyMCEEditor>['onFocus']}\n onKeyDown={\n onKeyDown as React.ComponentProps<typeof TinyMCEEditor>['onKeyDown']\n }\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;AAAA,SAASA,UAAU,IAAIC,aAAa,EAAEC,OAAO,QAAQ,qBAAqB;AAC1E,OAAOC,KAAK,IAAIC,OAAO,QAAQ,OAAO;AACtC,SAASC,sBAAsB,QAAQ,4CAA4C;AACnF,SAASC,mBAAmB,QAAQ,qBAAqB;AAGzD,OAAO,IAAMC,iBAAiB,GAAG,SAApBA,iBAAiBA,CAAIC,KAAsB,EAAK;EAC3D,IACEC,EAAE,
|
|
1
|
+
{"version":3,"file":"TinyMCETextEditor.js","names":["TextEditor","TinyMCEEditor","tinyMCE","React","useMemo","sanitizeTextEditorHtml","StyledReadOnlyValue","TinyMCETextEditor","props","id","value","disabled","error","readonly","placeholder","rows","extendable","onChange","onBlur","onFocus","onKeyDown","init","baseHeight","rowHeight","height","undefined","sanitizedValue","createElement","dangerouslySetInnerHTML","__html","textareaName","plugins","concat","_toConsumableArray","defaultPlugins","_objectSpread","contextmenu","min_height","max_height"],"sources":["../../src/TextEditor/TinyMCETextEditor.tsx"],"sourcesContent":["import { TextEditor as TinyMCEEditor, tinyMCE } from '@procore/core-react'\nimport React, { useMemo } from 'react'\nimport { sanitizeTextEditorHtml } from '../TextEditorOutput/TextEditorOutput.utils'\nimport { StyledReadOnlyValue } from './TextEditor.styles'\nimport type { TextEditorProps } from './TextEditor.types'\n\nexport const TinyMCETextEditor = (props: TextEditorProps) => {\n const {\n id,\n value,\n disabled,\n error,\n readonly,\n placeholder,\n rows,\n extendable,\n onChange,\n onBlur,\n onFocus,\n onKeyDown,\n init,\n } = props\n\n const baseHeight = 74\n const rowHeight = 22\n const height = rows === undefined ? undefined : rows * rowHeight + baseHeight\n\n const sanitizedValue = useMemo(\n () => sanitizeTextEditorHtml(value || '') || '--',\n [value]\n )\n\n if (readonly) {\n return (\n <StyledReadOnlyValue>\n <div dangerouslySetInnerHTML={{ __html: sanitizedValue }} />\n </StyledReadOnlyValue>\n )\n }\n\n return (\n <TinyMCEEditor\n id={id}\n value={value}\n disabled={disabled}\n error={error}\n aria-label={props['aria-label']}\n textareaName={props['aria-label']}\n plugins={[...tinyMCE.defaultPlugins, 'link', 'table']}\n init={{\n contextmenu: false,\n min_height: height,\n max_height: extendable ? undefined : height,\n placeholder,\n ...init,\n }}\n onChange={onChange}\n onBlur={onBlur as React.ComponentProps<typeof TinyMCEEditor>['onBlur']}\n onFocus={onFocus as React.ComponentProps<typeof TinyMCEEditor>['onFocus']}\n onKeyDown={\n onKeyDown as React.ComponentProps<typeof TinyMCEEditor>['onKeyDown']\n }\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;AAAA,SAASA,UAAU,IAAIC,aAAa,EAAEC,OAAO,QAAQ,qBAAqB;AAC1E,OAAOC,KAAK,IAAIC,OAAO,QAAQ,OAAO;AACtC,SAASC,sBAAsB,QAAQ,4CAA4C;AACnF,SAASC,mBAAmB,QAAQ,qBAAqB;AAGzD,OAAO,IAAMC,iBAAiB,GAAG,SAApBA,iBAAiBA,CAAIC,KAAsB,EAAK;EAC3D,IACEC,EAAE,GAaAD,KAAK,CAbPC,EAAE;IACFC,KAAK,GAYHF,KAAK,CAZPE,KAAK;IACLC,QAAQ,GAWNH,KAAK,CAXPG,QAAQ;IACRC,KAAK,GAUHJ,KAAK,CAVPI,KAAK;IACL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AEb,MAAM;MAClBc,UAAU,EAAEtB,UAAU,GAAGS,SAAS,GAAGD,MAAM;MAC3CV,WAAW,EAAXA;IAAW,GACRO,IAAI,CACP;IACFJ,QAAQ,EAAEA,QAAS;IACnBC,MAAM,EAAEA,MAA+D;IACvEC,OAAO,EAAEA,OAAiE;IAC1EC,SAAS,EACPA;EACD,CACF,CAAC;AAEN,CAAC","ignoreList":[]}
|
|
@@ -38,6 +38,12 @@ export declare class ProcoreImageUploadPlugin extends Plugin {
|
|
|
38
38
|
static get pluginName(): string;
|
|
39
39
|
static get requires(): (typeof FileRepository | typeof ImageUploadEditing)[];
|
|
40
40
|
init(): void;
|
|
41
|
+
/**
|
|
42
|
+
* "Copy Image" puts both the image bytes and HTML with the external URL on
|
|
43
|
+
* the clipboard. CKEditor prefers the HTML, but the backend strips external
|
|
44
|
+
* image URLs — so upload the bytes instead.
|
|
45
|
+
*/
|
|
46
|
+
private configurePastedImageFileOverExternalHtml;
|
|
41
47
|
private configureUploadAdapter;
|
|
42
48
|
private configureProstoreFileIdConversion;
|
|
43
49
|
private configurePastedImageLimit;
|