@procore/text-editor 0.0.1 → 0.0.3

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.
Files changed (73) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/codemod/__fixtures__/hammer.config.mjs +7 -0
  3. package/codemod/__fixtures__/procore.config.js +7 -0
  4. package/codemod/__fixtures__/procore.config.ternary.js +18 -0
  5. package/codemod/text-editor-migrate.js +383 -3
  6. package/codemod/text-editor-migrate.test.js +86 -0
  7. package/dist/{src/TextEditor → TextEditor}/TextEditor.d.ts +1 -1
  8. package/dist/TextEditor/TextEditor.js +2 -12
  9. package/dist/TextEditor/TextEditor.js.map +1 -1
  10. package/dist/TextEditor/TextEditor.styles.js +1 -1
  11. package/dist/{src/TextEditor → TextEditor}/TextEditor.types.d.ts +0 -38
  12. package/dist/TextEditor/TextEditor.types.js.map +1 -1
  13. package/dist/TextEditor/TextEditorProvider.js +1 -1
  14. package/dist/TextEditor/TextEditorProvider.js.map +1 -1
  15. package/dist/TextEditor/plugins/TabSpacesPlugin/TabSpacesPlugin.js +2 -0
  16. package/dist/TextEditor/plugins/TabSpacesPlugin/TabSpacesPlugin.js.map +1 -1
  17. package/dist/TextEditor/useTabAsNavigation.js +2 -1
  18. package/dist/TextEditor/useTabAsNavigation.js.map +1 -1
  19. package/dist/TextEditor/utils/config.js +5 -2
  20. package/dist/TextEditor/utils/config.js.map +1 -1
  21. package/dist/TextEditorOutput/TextEditorOutput.styles.js +1 -1
  22. package/dist/_typedoc/TextEditor/TextEditor.types.json +16 -68
  23. package/dist/_typedoc/TextEditor/TextEditorProvider.types.json +2 -2
  24. package/dist/_typedoc/TextEditorOutput/TextEditorOutput.types.json +3 -3
  25. package/dist/_typedoc/deprecations.json +1 -1
  26. package/package.json +12 -16
  27. package/dist/codemod/__fixtures__/src/components/ComplexEditor.d.ts +0 -2
  28. package/dist/codemod/__fixtures__/src/components/FormWithRichText.d.ts +0 -2
  29. package/dist/codemod/__fixtures__/src/components/MultilineFormRichText.d.ts +0 -2
  30. package/dist/codemod/__fixtures__/src/components/NoTextEditor.d.ts +0 -2
  31. package/dist/codemod/__fixtures__/src/components/ReadOnlyRichText.d.ts +0 -2
  32. package/dist/codemod/__fixtures__/src/components/SimpleEditor.d.ts +0 -2
  33. package/dist/codemod/__fixtures__/src/components/TypeImportEditor.d.ts +0 -2
  34. /package/dist/{src/TextEditor → TextEditor}/EditorError.d.ts +0 -0
  35. /package/dist/{src/TextEditor → TextEditor}/StickyToolbar/index.d.ts +0 -0
  36. /package/dist/{src/TextEditor → TextEditor}/StickyToolbar/useStickyToolbar.d.ts +0 -0
  37. /package/dist/{src/TextEditor → TextEditor}/StickyToolbar/useStickyToolbar.types.d.ts +0 -0
  38. /package/dist/{src/TextEditor → TextEditor}/TextEditor.styles.d.ts +0 -0
  39. /package/dist/{src/TextEditor → TextEditor}/TextEditorProvider.d.ts +0 -0
  40. /package/dist/{src/TextEditor → TextEditor}/TextEditorProvider.types.d.ts +0 -0
  41. /package/dist/{src/TextEditor → TextEditor}/index.d.ts +0 -0
  42. /package/dist/{src/TextEditor → TextEditor}/license_key.d.ts +0 -0
  43. /package/dist/{src/TextEditor → TextEditor}/plugins/CutPlugin/CutCommand.d.ts +0 -0
  44. /package/dist/{src/TextEditor → TextEditor}/plugins/CutPlugin/CutPlugin.d.ts +0 -0
  45. /package/dist/{src/TextEditor → TextEditor}/plugins/CutPlugin/index.d.ts +0 -0
  46. /package/dist/{src/TextEditor → TextEditor}/plugins/IndentPaddingToMarginPlugin/IndentPaddingToMarginPlugin.d.ts +0 -0
  47. /package/dist/{src/TextEditor → TextEditor}/plugins/IndentPaddingToMarginPlugin/index.d.ts +0 -0
  48. /package/dist/{src/TextEditor → TextEditor}/plugins/PasteAsTextPlugin/PasteAsTextCommand.d.ts +0 -0
  49. /package/dist/{src/TextEditor → TextEditor}/plugins/PasteAsTextPlugin/PasteAsTextPlugin.d.ts +0 -0
  50. /package/dist/{src/TextEditor → TextEditor}/plugins/PasteAsTextPlugin/index.d.ts +0 -0
  51. /package/dist/{src/TextEditor → TextEditor}/plugins/PastePlugin/PasteCommand.d.ts +0 -0
  52. /package/dist/{src/TextEditor → TextEditor}/plugins/PastePlugin/PastePlugin.d.ts +0 -0
  53. /package/dist/{src/TextEditor → TextEditor}/plugins/PastePlugin/index.d.ts +0 -0
  54. /package/dist/{src/TextEditor → TextEditor}/plugins/TabSpacesPlugin/TabSpacesPlugin.d.ts +0 -0
  55. /package/dist/{src/TextEditor → TextEditor}/plugins/TabSpacesPlugin/index.d.ts +0 -0
  56. /package/dist/{src/TextEditor → TextEditor}/textEditorTheming/icons.d.ts +0 -0
  57. /package/dist/{src/TextEditor → TextEditor}/textEditorTheming/index.d.ts +0 -0
  58. /package/dist/{src/TextEditor → TextEditor}/textEditorTheming/textEditorTheming.styles.d.ts +0 -0
  59. /package/dist/{src/TextEditor → TextEditor}/useCKEditorCss.d.ts +0 -0
  60. /package/dist/{src/TextEditor → TextEditor}/useTabAsNavigation.d.ts +0 -0
  61. /package/dist/{src/TextEditor → TextEditor}/utils/config.d.ts +0 -0
  62. /package/dist/{src/TextEditor → TextEditor}/utils/index.d.ts +0 -0
  63. /package/dist/{src/TextEditor → TextEditor}/utils/locale.d.ts +0 -0
  64. /package/dist/{src/TextEditor → TextEditor}/utils/plugins.d.ts +0 -0
  65. /package/dist/{src/TextEditorOutput → TextEditorOutput}/TextEditorOutput.d.ts +0 -0
  66. /package/dist/{src/TextEditorOutput → TextEditorOutput}/TextEditorOutput.styles.d.ts +0 -0
  67. /package/dist/{src/TextEditorOutput → TextEditorOutput}/TextEditorOutput.types.d.ts +0 -0
  68. /package/dist/{src/TextEditorOutput → TextEditorOutput}/TextEditorOutput.utils.d.ts +0 -0
  69. /package/dist/{src/TextEditorOutput → TextEditorOutput}/index.d.ts +0 -0
  70. /package/dist/{src/_storyHelpers → _storyHelpers}/constants.d.ts +0 -0
  71. /package/dist/{src/_utils → _utils}/propsTypedoc.d.ts +0 -0
  72. /package/dist/{src/index.d.ts → index.d.ts} +0 -0
  73. /package/dist/{src/stories → stories}/util.d.ts +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"TextEditor.js","names":["CKEditor","ClassicEditor","React","UNSAFE_useOverridableFocusScope","useI18nContext","useZIndexContext","useStickyToolbar","GlobalEditorStyles","StyledTextEditor","TextEditorContext","TextEditorTheme","useCKEditorCss","useTabAsNavigation","addButtonDataAttributes","addPluginsFromStringArray","getDefaultConfig","TextEditor","_ref","disabled","error","value","initialValue","onChange","onInit","onBlur","onKeyDown","externalConfig","config","stringPlugins","plugins","propLocale","locale","onDirty","_tinyMCE","tinyMCE","_init","init","_onEditorChange","onEditorChange","_onFocusOut","onFocusOut","restProps","_objectWithoutProperties","_excluded","_useCKEditorCss","cssLoading","isLoading","editorRef","useRef","editorInstanceRef","initialValueRef","keyDownListenerRef","_React$useState","useState","_React$useState2","_slicedToArray","isDirtyState","setIsDirtyState","_React$useState3","_React$useState4","isEditorReady","setIsEditorReady","_useI18nContext","contextLocale","useEffect","undefined","current","editing","view","document","off","_useZIndexContext","zIndex","_React$useContext","useContext","features","enableStickyToolbar","stickyToolbar","enableTabAsNavigation","tabAsNavigation","mergedConfig","useMemo","defaultConfig","configWithPlugins","length","externalResult","finalConfig","_objectSpread","focusScope","setProps","contain","bindKeyDownHandler","useCallback","editor","editorElement","getRoot","keyDownListener","_event","data","domEvent","on","handleChange","getData","isDirty","handleReady","setData","handleBlur","event","enabled","_useTabAsNavigation","editorKey","concat","createElement","ref","key","_extends","onReady"],"sources":["../../src/TextEditor/TextEditor.tsx"],"sourcesContent":["import { CKEditor } from '@ckeditor/ckeditor5-react'\nimport type { EditorConfig } from 'ckeditor5'\nimport { ClassicEditor, type EventInfo } from 'ckeditor5'\nimport React from 'react'\n\nimport {\n UNSAFE_useOverridableFocusScope,\n useI18nContext,\n useZIndexContext,\n} from '@procore/core-react'\nimport { useStickyToolbar } from './StickyToolbar'\nimport { GlobalEditorStyles, StyledTextEditor } from './TextEditor.styles'\nimport type { KeyDownListener, TextEditorProps } from './TextEditor.types'\nimport { TextEditorContext } from './TextEditorProvider'\nimport { TextEditorTheme } from './textEditorTheming'\nimport { useCKEditorCss } from './useCKEditorCss'\nimport { useTabAsNavigation } from './useTabAsNavigation'\nimport {\n addButtonDataAttributes,\n addPluginsFromStringArray,\n getDefaultConfig,\n} from './utils'\n\n/**\n * To ensure your Jest tests work with the CKEditor implementation, wrap your Jest configuration with `textEditorJestConfig`:\n *\n * @example\n *\n * // Using Jest config file\n *\n * const { textEditorJestConfig } = require('@procore/text-editor/jestConfig')\n *\n * module.exports = textEditorJestConfig({\n * // Your existing Jest config\n * })\n *\n * @example\n *\n * // Using Hammer\n *\n * import { textEditorJestConfig } from '@procore/text-editor/jestConfig'\n *\n * export default {\n * testJest: (defaultConfig) =>\n * textEditorJestConfig({\n * ...defaultConfig,\n * // Your existing Jest config\n * }),\n * }\n *\n * @example\n *\n * // Using Core Scripts\n *\n * const { textEditorJestConfig } = require('@procore/text-editor/jestConfig')\n *\n * module.exports = () => ({\n * jestOverride: (defaultConfig) =>\n * textEditorJestConfig({\n * ...defaultConfig,\n * // Your existing Jest config\n * }),\n * })\n */\nexport function TextEditor({\n disabled,\n error,\n value,\n initialValue,\n onChange,\n onInit,\n onBlur,\n onKeyDown,\n config: externalConfig,\n plugins: stringPlugins,\n locale: propLocale,\n onDirty,\n // Deprecated TinyMCE props - no-op for backward compatibility\n tinyMCE: _tinyMCE,\n init: _init,\n onEditorChange: _onEditorChange,\n onFocusOut: _onFocusOut,\n ...restProps\n}: TextEditorProps) {\n const { isLoading: cssLoading } = useCKEditorCss()\n\n const editorRef = React.useRef<HTMLDivElement>(null)\n const editorInstanceRef = React.useRef<ClassicEditor | null>(null)\n const initialValueRef = React.useRef<string>(value || initialValue || '')\n const keyDownListenerRef = React.useRef<KeyDownListener | null>(null)\n const [isDirtyState, setIsDirtyState] = React.useState(false)\n const [isEditorReady, setIsEditorReady] = React.useState(false)\n const { locale: contextLocale } = useI18nContext()\n const locale = propLocale || contextLocale\n\n React.useEffect(() => {\n if (value !== undefined) {\n initialValueRef.current = value\n }\n }, [value])\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 const { value: zIndex } = useZIndexContext()\n\n const { features } = React.useContext(TextEditorContext)\n const enableStickyToolbar = !!features?.stickyToolbar\n const enableTabAsNavigation = !!features?.tabAsNavigation\n\n const mergedConfig = React.useMemo(() => {\n const defaultConfig = getDefaultConfig(locale)\n\n // Handle string plugins for backward compatibility\n const configWithPlugins = stringPlugins?.length\n ? addPluginsFromStringArray(defaultConfig, stringPlugins)\n : defaultConfig\n\n // Apply any external CKEditor config overrides provided by the consumer\n const externalResult =\n typeof externalConfig === 'function'\n ? externalConfig(configWithPlugins)\n : undefined\n // Merge default config (with plugins) and consumer overrides\n let finalConfig: EditorConfig = {\n ...configWithPlugins,\n ...(externalResult ?? {}),\n }\n\n return finalConfig\n }, [externalConfig, locale, stringPlugins])\n\n const focusScope = UNSAFE_useOverridableFocusScope()\n React.useEffect(() => {\n focusScope.setProps({ contain: false })\n }, [focusScope])\n\n const bindKeyDownHandler = React.useCallback(\n (editor: ClassicEditor) => {\n if (!onKeyDown) {\n return\n }\n\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 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 handleChange = (\n _event: EventInfo<string, unknown>,\n editor: ClassicEditor\n ) => {\n const data = editor.getData()\n const isDirty = data !== initialValueRef.current\n\n // Call onDirty only on first content modification\n if (isDirty && !isDirtyState) {\n setIsDirtyState(true)\n onDirty?.()\n }\n\n onChange?.(data, isDirty)\n }\n\n const handleReady = (editor: ClassicEditor) => {\n addButtonDataAttributes(editor)\n editorInstanceRef.current = editor\n setIsEditorReady(true)\n\n if (initialValue) {\n editor.setData(initialValue)\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 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 return (\n <StyledTextEditor ref={editorRef} key={editorKey} error={error}>\n <GlobalEditorStyles zIndex={zIndex + 1} />\n <TextEditorTheme />\n <CKEditor\n {...restProps}\n editor={ClassicEditor}\n config={config}\n disabled={disabled}\n data={value}\n onChange={handleChange}\n onReady={handleReady}\n onBlur={handleBlur}\n />\n </StyledTextEditor>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,SAASA,QAAQ,QAAQ,2BAA2B;AAEpD,SAASC,aAAa,QAAwB,WAAW;AACzD,OAAOC,KAAK,MAAM,OAAO;AAEzB,SACEC,+BAA+B,EAC/BC,cAAc,EACdC,gBAAgB,QACX,qBAAqB;AAC5B,SAASC,gBAAgB,QAAQ,iBAAiB;AAClD,SAASC,kBAAkB,EAAEC,gBAAgB,QAAQ,qBAAqB;AAE1E,SAASC,iBAAiB,QAAQ,sBAAsB;AACxD,SAASC,eAAe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,MAAM,EAAEA,MAAM,GAAG;EAAE,CAAE,CAAC,eAC1CtE,KAAA,CAAA8G,aAAA,CAACtG,eAAe,MAAE,CAAC,eACnBR,KAAA,CAAA8G,aAAA,CAAChH,QAAQ,EAAAmH,QAAA,KACH1E,SAAS;IACboD,MAAM,EAAE5F,aAAc;IACtB0B,MAAM,EAAEA,MAAO;IACfT,QAAQ,EAAEA,QAAS;IACnBgF,IAAI,EAAE9E,KAAM;IACZE,QAAQ,EAAE+E,YAAa;IACvBe,OAAO,EAAEZ,WAAY;IACrBhF,MAAM,EAAEkF;EAAW,EACpB,CACe,CAAC;AAEvB"}
1
+ {"version":3,"file":"TextEditor.js","names":["CKEditor","ClassicEditor","React","useI18nContext","useZIndexContext","useStickyToolbar","GlobalEditorStyles","StyledTextEditor","TextEditorContext","TextEditorTheme","useCKEditorCss","useTabAsNavigation","addButtonDataAttributes","addPluginsFromStringArray","getDefaultConfig","TextEditor","_ref","disabled","error","value","initialValue","onChange","onInit","onBlur","onKeyDown","externalConfig","config","stringPlugins","plugins","propLocale","locale","onDirty","restProps","_objectWithoutProperties","_excluded","_useCKEditorCss","cssLoading","isLoading","editorRef","useRef","editorInstanceRef","initialValueRef","keyDownListenerRef","_React$useState","useState","_React$useState2","_slicedToArray","isDirtyState","setIsDirtyState","_React$useState3","_React$useState4","isEditorReady","setIsEditorReady","_useI18nContext","contextLocale","useEffect","undefined","current","editing","view","document","off","_useZIndexContext","zIndex","_React$useContext","useContext","features","enableStickyToolbar","stickyToolbar","enableTabAsNavigation","tabAsNavigation","mergedConfig","useMemo","defaultConfig","configWithPlugins","length","externalResult","finalConfig","_objectSpread","bindKeyDownHandler","useCallback","editor","editorElement","getRoot","keyDownListener","_event","data","domEvent","on","handleChange","getData","isDirty","handleReady","setData","handleBlur","event","enabled","_useTabAsNavigation","editorKey","concat","createElement","ref","key","_extends","onReady"],"sources":["../../src/TextEditor/TextEditor.tsx"],"sourcesContent":["import { CKEditor } from '@ckeditor/ckeditor5-react'\nimport type { EditorConfig } from 'ckeditor5'\nimport { ClassicEditor, type EventInfo } from 'ckeditor5'\nimport React from 'react'\n\nimport { useI18nContext, useZIndexContext } from '@procore/core-react'\nimport { useStickyToolbar } from './StickyToolbar'\nimport { GlobalEditorStyles, StyledTextEditor } from './TextEditor.styles'\nimport type { KeyDownListener, TextEditorProps } from './TextEditor.types'\nimport { TextEditorContext } from './TextEditorProvider'\nimport { TextEditorTheme } from './textEditorTheming'\nimport { useCKEditorCss } from './useCKEditorCss'\nimport { useTabAsNavigation } from './useTabAsNavigation'\nimport {\n addButtonDataAttributes,\n addPluginsFromStringArray,\n getDefaultConfig,\n} from './utils'\n\n/**\n * To ensure your Jest tests work with the CKEditor implementation, wrap your Jest configuration with `textEditorJestConfig`:\n *\n * @example\n *\n * // Using Jest config file\n *\n * const { textEditorJestConfig } = require('@procore/text-editor/jestConfig')\n *\n * module.exports = textEditorJestConfig({\n * // Your existing Jest config\n * })\n *\n * @example\n *\n * // Using Hammer\n *\n * import { textEditorJestConfig } from '@procore/text-editor/jestConfig'\n *\n * export default {\n * testJest: (defaultConfig) =>\n * textEditorJestConfig({\n * ...defaultConfig,\n * // Your existing Jest config\n * }),\n * }\n *\n * @example\n *\n * // Using Core Scripts\n *\n * const { textEditorJestConfig } = require('@procore/text-editor/jestConfig')\n *\n * module.exports = () => ({\n * jestOverride: (defaultConfig) =>\n * textEditorJestConfig({\n * ...defaultConfig,\n * // Your existing Jest config\n * }),\n * })\n */\nexport function TextEditor({\n disabled,\n error,\n value,\n initialValue,\n onChange,\n onInit,\n onBlur,\n onKeyDown,\n config: externalConfig,\n plugins: stringPlugins,\n locale: propLocale,\n onDirty,\n ...restProps\n}: TextEditorProps) {\n const { isLoading: cssLoading } = useCKEditorCss()\n\n const editorRef = React.useRef<HTMLDivElement>(null)\n const editorInstanceRef = React.useRef<ClassicEditor | null>(null)\n const initialValueRef = React.useRef<string>(value || initialValue || '')\n const keyDownListenerRef = React.useRef<KeyDownListener | null>(null)\n const [isDirtyState, setIsDirtyState] = React.useState(false)\n const [isEditorReady, setIsEditorReady] = React.useState(false)\n const { locale: contextLocale } = useI18nContext()\n const locale = propLocale || contextLocale\n\n React.useEffect(() => {\n if (value !== undefined) {\n initialValueRef.current = value\n }\n }, [value])\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 const { value: zIndex } = useZIndexContext()\n\n const { features } = React.useContext(TextEditorContext)\n const enableStickyToolbar = !!features?.stickyToolbar\n const enableTabAsNavigation = !!features?.tabAsNavigation\n\n const mergedConfig = React.useMemo(() => {\n const defaultConfig = getDefaultConfig(locale)\n\n // Handle string plugins for backward compatibility\n const configWithPlugins = stringPlugins?.length\n ? addPluginsFromStringArray(defaultConfig, stringPlugins)\n : defaultConfig\n\n // Apply any external CKEditor config overrides provided by the consumer\n const externalResult =\n typeof externalConfig === 'function'\n ? externalConfig(configWithPlugins)\n : undefined\n // Merge default config (with plugins) and consumer overrides\n let finalConfig: EditorConfig = {\n ...configWithPlugins,\n ...(externalResult ?? {}),\n }\n\n return finalConfig\n }, [externalConfig, locale, stringPlugins])\n\n const bindKeyDownHandler = React.useCallback(\n (editor: ClassicEditor) => {\n if (!onKeyDown) {\n return\n }\n\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 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 handleChange = (\n _event: EventInfo<string, unknown>,\n editor: ClassicEditor\n ) => {\n const data = editor.getData()\n const isDirty = data !== initialValueRef.current\n\n // Call onDirty only on first content modification\n if (isDirty && !isDirtyState) {\n setIsDirtyState(true)\n onDirty?.()\n }\n\n onChange?.(data, isDirty)\n }\n\n const handleReady = (editor: ClassicEditor) => {\n addButtonDataAttributes(editor)\n editorInstanceRef.current = editor\n setIsEditorReady(true)\n\n if (initialValue) {\n editor.setData(initialValue)\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 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 return (\n <StyledTextEditor ref={editorRef} key={editorKey} error={error}>\n <GlobalEditorStyles zIndex={zIndex + 1} />\n <TextEditorTheme />\n <CKEditor\n {...restProps}\n editor={ClassicEditor}\n config={config}\n disabled={disabled}\n data={value}\n onChange={handleChange}\n onReady={handleReady}\n onBlur={handleBlur}\n />\n </StyledTextEditor>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,SAASA,QAAQ,QAAQ,2BAA2B;AAEpD,SAASC,aAAa,QAAwB,WAAW;AACzD,OAAOC,KAAK,MAAM,OAAO;AAEzB,SAASC,cAAc,EAAEC,gBAAgB,QAAQ,qBAAqB;AACtE,SAASC,gBAAgB,QAAQ,iBAAiB;AAClD,SAASC,kBAAkB,EAAEC,gBAAgB,QAAQ,qBAAqB;AAE1E,SAASC,iBAAiB,QAAQ,sBAAsB;AACxD,SAASC,eAAe,QAAQ,qBAAqB;AACrD,SAASC,cAAc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obalEditorStyles = /*#__PURE__*/createGlobalStyle([":root{--ck-z-de
18
18
  });
19
19
  export var StyledTextEditor = /*#__PURE__*/styled.div.withConfig({
20
20
  displayName: "StyledTextEditor",
21
- componentId: "text-editor-0_0_1__sc-iim79x-0"
21
+ componentId: "text-editor-0_0_3__sc-iim79x-0"
22
22
  })(["", ""], function (_ref6) {
23
23
  var error = _ref6.error;
24
24
  return error && "\n .ck-sticky-panel__content {\n border-top-color: ".concat(colors.red50, " !important;\n border-left-color: ").concat(colors.red50, " !important;\n border-right-color: ").concat(colors.red50, " !important;\n }\n\n .ck-editor__editable {\n border-left-color: ").concat(colors.red50, " !important;\n border-right-color: ").concat(colors.red50, " !important;\n border-bottom-color: ").concat(colors.red50, " !important;\n }\n ");
@@ -111,44 +111,6 @@ export interface TextEditorProps {
111
111
  * @since 12.29.0
112
112
  */
113
113
  onKeyDown?: (event: KeyboardEvent, editor: ClassicEditor) => void;
114
- /**
115
- * If you experience problems with the new editor implementation, you can use this to **temporarily** switch back to legacy version while you report the issue.
116
- *
117
- * @deprecated This property will be removed in a future version. TinyMCE support has been removed.
118
- * @since 10.19.0
119
- */
120
- tinyMCE?: boolean;
121
- /**
122
- * Config for when the editor is initialized. **Changes after the editor has initialized are ignored.**
123
- *
124
- * @link [TinyMCE React Init](https://www.tiny.cloud/docs/integrations/react/#init)
125
- * @unsupported Use at your own risk. DST makes no guarantees about this API,
126
- * and is subject to removal at any point without warning or deprecation.
127
- * @deprecated `init` has been deprecated and will be removed in a future version. TinyMCE support has been removed.
128
- * @since 10.19.0
129
- */
130
- init?: any;
131
- /**
132
- * Callback fired when the editor content changes
133
- *
134
- * @deprecated `onEditorChange` has been deprecated and will be removed in a future version. TinyMCE support has been removed. Use `onChange` instead.
135
- * @since 10.19.0
136
- */
137
- onEditorChange?: (value: string) => void;
138
- /**
139
- * Callback fired when the editor gains focus
140
- *
141
- * @deprecated `onFocusIn` has been deprecated and will be removed in a future version. TinyMCE support has been removed. Use `onFocus` instead.
142
- * @since 10.19.0
143
- */
144
- onFocusIn?: (...args: any[]) => void;
145
- /**
146
- * Callback fired when the editor loses focus
147
- *
148
- * @deprecated `onFocusOut` has been deprecated and will be removed in a future version. TinyMCE support has been removed. Use `onBlur` instead.
149
- * @since 10.19.0
150
- */
151
- onFocusOut?: (...args: any[]) => void;
152
114
  }
153
115
  export declare type KeyDownListener = (event: EventInfo, data: {
154
116
  domEvent: Event;
@@ -1 +1 @@
1
- {"version":3,"file":"TextEditor.types.js","names":[],"sources":["../../src/TextEditor/TextEditor.types.ts"],"sourcesContent":["import type { Locale } from '@procore/core-react'\nimport type { ClassicEditor, EditorConfig, EventInfo } from 'ckeditor5'\n\nexport interface TextEditorProps {\n /**\n * Unique identifier for the editor\n *\n * @since 10.19.0\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 10.20.0\n * @since 10.19.0\n */\n initialValue?: string\n\n /**\n * The current value of the editor\n *\n * @since 10.19.0\n */\n value?: string\n\n /**\n * Indicates if the editor is disabled\n *\n * @since 10.19.0\n */\n disabled?: boolean\n\n /**\n * Indicates if the editor is in an error state\n *\n * @since 10.19.0\n */\n error?: boolean\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 10.19.0\n */\n locale?: Locale\n\n /**\n * Array of plugin names to add to the editor in addition to the defaults.\n * This provides backward compatibility with the deprecated TinyMCE version of the editor.\n * Supports plugin names like 'link', 'image', 'table', etc.\n *\n * @since 12.26.0\n */\n plugins?: string[]\n\n /**\n * Configuration function for customizing the editor\n *\n * @param defaultConfig - The default CKEditor configuration\n * @returns Customized configuration object\n * @since 12.26.0\n */\n config?: (defaultConfig: EditorConfig) => EditorConfig\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 10.19.0\n */\n onChange?: (value: string, isDirty?: boolean) => void\n\n /**\n * Callback fired when the editor gains focus\n *\n * @since 10.19.0\n */\n onFocus?: (event: EventInfo, editor: ClassicEditor) => void\n\n /**\n * Callback fired when the editor loses focus\n *\n * @since 10.19.0\n */\n onBlur?: (event: EventInfo, editor: ClassicEditor) => void\n\n /**\n * Callback fired when an error occurs in the editor\n *\n * @since 10.19.0\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 10.19.0\n */\n onInit?: (editor: ClassicEditor) => void\n\n /**\n * Callback fired after the editor instance is destroyed\n *\n * @since 10.19.0\n */\n onAfterDestroy?: () => void\n\n /**\n * Callback fired when the editor becomes dirty (content differs from initial value)\n *\n * @since 12.26.0\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 12.29.0\n */\n onKeyDown?: (event: KeyboardEvent, editor: ClassicEditor) => void\n\n //--- Deprecated TinyMCE-specific props\n\n /**\n * If you experience problems with the new editor implementation, you can use this to **temporarily** switch back to legacy version while you report the issue.\n *\n * @deprecated This property will be removed in a future version. TinyMCE support has been removed.\n * @since 10.19.0\n */\n tinyMCE?: boolean\n\n /**\n * Config for when the editor is initialized. **Changes after the editor has initialized are ignored.**\n *\n * @link [TinyMCE React Init](https://www.tiny.cloud/docs/integrations/react/#init)\n * @unsupported Use at your own risk. DST makes no guarantees about this API,\n * and is subject to removal at any point without warning or deprecation.\n * @deprecated `init` has been deprecated and will be removed in a future version. TinyMCE support has been removed.\n * @since 10.19.0\n */\n init?: any\n\n /**\n * Callback fired when the editor content changes\n *\n * @deprecated `onEditorChange` has been deprecated and will be removed in a future version. TinyMCE support has been removed. Use `onChange` instead.\n * @since 10.19.0\n */\n onEditorChange?: (value: string) => void\n\n /**\n * Callback fired when the editor gains focus\n *\n * @deprecated `onFocusIn` has been deprecated and will be removed in a future version. TinyMCE support has been removed. Use `onFocus` instead.\n * @since 10.19.0\n */\n onFocusIn?: (...args: any[]) => void\n\n /**\n * Callback fired when the editor loses focus\n *\n * @deprecated `onFocusOut` has been deprecated and will be removed in a future version. TinyMCE support has been removed. Use `onBlur` instead.\n * @since 10.19.0\n */\n onFocusOut?: (...args: any[]) => void\n}\n\nexport type KeyDownListener = (\n event: EventInfo,\n data: { domEvent: Event }\n) => void\n"],"mappings":""}
1
+ {"version":3,"file":"TextEditor.types.js","names":[],"sources":["../../src/TextEditor/TextEditor.types.ts"],"sourcesContent":["import type { Locale } from '@procore/core-react'\nimport type { ClassicEditor, EditorConfig, EventInfo } from 'ckeditor5'\n\nexport interface TextEditorProps {\n /**\n * Unique identifier for the editor\n *\n * @since 10.19.0\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 10.20.0\n * @since 10.19.0\n */\n initialValue?: string\n\n /**\n * The current value of the editor\n *\n * @since 10.19.0\n */\n value?: string\n\n /**\n * Indicates if the editor is disabled\n *\n * @since 10.19.0\n */\n disabled?: boolean\n\n /**\n * Indicates if the editor is in an error state\n *\n * @since 10.19.0\n */\n error?: boolean\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 10.19.0\n */\n locale?: Locale\n\n /**\n * Array of plugin names to add to the editor in addition to the defaults.\n * This provides backward compatibility with the deprecated TinyMCE version of the editor.\n * Supports plugin names like 'link', 'image', 'table', etc.\n *\n * @since 12.26.0\n */\n plugins?: string[]\n\n /**\n * Configuration function for customizing the editor\n *\n * @param defaultConfig - The default CKEditor configuration\n * @returns Customized configuration object\n * @since 12.26.0\n */\n config?: (defaultConfig: EditorConfig) => EditorConfig\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 10.19.0\n */\n onChange?: (value: string, isDirty?: boolean) => void\n\n /**\n * Callback fired when the editor gains focus\n *\n * @since 10.19.0\n */\n onFocus?: (event: EventInfo, editor: ClassicEditor) => void\n\n /**\n * Callback fired when the editor loses focus\n *\n * @since 10.19.0\n */\n onBlur?: (event: EventInfo, editor: ClassicEditor) => void\n\n /**\n * Callback fired when an error occurs in the editor\n *\n * @since 10.19.0\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 10.19.0\n */\n onInit?: (editor: ClassicEditor) => void\n\n /**\n * Callback fired after the editor instance is destroyed\n *\n * @since 10.19.0\n */\n onAfterDestroy?: () => void\n\n /**\n * Callback fired when the editor becomes dirty (content differs from initial value)\n *\n * @since 12.26.0\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 12.29.0\n */\n onKeyDown?: (event: KeyboardEvent, editor: ClassicEditor) => void\n}\n\nexport type KeyDownListener = (\n event: EventInfo,\n data: { domEvent: Event }\n) => void\n"],"mappings":""}
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  export var TextEditorContext = /*#__PURE__*/React.createContext({
3
3
  features: {
4
- tabAsNavigation: undefined,
4
+ tabAsNavigation: true,
5
5
  stickyToolbar: undefined
6
6
  }
7
7
  });
@@ -1 +1 @@
1
- {"version":3,"file":"TextEditorProvider.js","names":["React","TextEditorContext","createContext","features","tabAsNavigation","undefined","stickyToolbar","TextEditorProvider","_ref","children","createElement","Provider","value"],"sources":["../../src/TextEditor/TextEditorProvider.tsx"],"sourcesContent":["import React from 'react'\nimport type { TextEditorProviderProps } from './TextEditorProvider.types'\n\nexport const TextEditorContext = React.createContext<\n Omit<TextEditorProviderProps, 'children'>\n>({\n features: {\n tabAsNavigation: undefined,\n stickyToolbar: undefined,\n },\n})\n\nexport function TextEditorProvider({\n children,\n features,\n}: TextEditorProviderProps) {\n return (\n <TextEditorContext.Provider value={{ features }}>\n {children}\n </TextEditorContext.Provider>\n )\n}\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAGzB,OAAO,IAAMC,iBAAiB,gBAAGD,KAAK,CAACE,aAAa,CAElD;EACAC,QAAQ,EAAE;IACRC,eAAe,EAAEC,SAAS;IAC1BC,aAAa,EAAED;EACjB;AACF,CAAC,CAAC;AAEF,OAAO,SAASE,kBAAkBA,CAAAC,IAAA,EAGN;EAAA,IAF1BC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IACRN,QAAQ,GAAAK,IAAA,CAARL,QAAQ;EAER,oBACEH,KAAA,CAAAU,aAAA,CAACT,iBAAiB,CAACU,QAAQ;IAACC,KAAK,EAAE;MAAET,QAAQ,EAARA;IAAS;EAAE,GAC7CM,QACyB,CAAC;AAEjC"}
1
+ {"version":3,"file":"TextEditorProvider.js","names":["React","TextEditorContext","createContext","features","tabAsNavigation","stickyToolbar","undefined","TextEditorProvider","_ref","children","createElement","Provider","value"],"sources":["../../src/TextEditor/TextEditorProvider.tsx"],"sourcesContent":["import React from 'react'\nimport type { TextEditorProviderProps } from './TextEditorProvider.types'\n\nexport const TextEditorContext = React.createContext<\n Omit<TextEditorProviderProps, 'children'>\n>({\n features: {\n tabAsNavigation: true,\n stickyToolbar: undefined,\n },\n})\n\nexport function TextEditorProvider({\n children,\n features,\n}: TextEditorProviderProps) {\n return (\n <TextEditorContext.Provider value={{ features }}>\n {children}\n </TextEditorContext.Provider>\n )\n}\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAGzB,OAAO,IAAMC,iBAAiB,gBAAGD,KAAK,CAACE,aAAa,CAElD;EACAC,QAAQ,EAAE;IACRC,eAAe,EAAE,IAAI;IACrBC,aAAa,EAAEC;EACjB;AACF,CAAC,CAAC;AAEF,OAAO,SAASC,kBAAkBA,CAAAC,IAAA,EAGN;EAAA,IAF1BC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IACRN,QAAQ,GAAAK,IAAA,CAARL,QAAQ;EAER,oBACEH,KAAA,CAAAU,aAAA,CAACT,iBAAiB,CAACU,QAAQ;IAACC,KAAK,EAAE;MAAET,QAAQ,EAARA;IAAS;EAAE,GAC7CM,QACyB,CAAC;AAEjC"}
@@ -12,6 +12,8 @@ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? O
12
12
  function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
13
13
  function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
14
14
  import { Plugin, toWidget, viewToModelPositionOutsideModelElement, Widget } from 'ckeditor5';
15
+
16
+ // TODO - delete
15
17
  export var TabSpacesPlugin = /*#__PURE__*/function (_Plugin) {
16
18
  function TabSpacesPlugin() {
17
19
  _classCallCheck(this, TabSpacesPlugin);
@@ -1 +1 @@
1
- {"version":3,"file":"TabSpacesPlugin.js","names":["Plugin","toWidget","viewToModelPositionOutsideModelElement","Widget","TabSpacesPlugin","_Plugin","_classCallCheck","_callSuper","arguments","_inherits","_createClass","key","value","init","editor","model","doc","document","schema","register","allowWhere","isInline","isObject","editing","mapper","on","viewElement","hasClass","conversion","elementToElement","view","modelItem","_ref","viewWriter","writer","span","createContainerElement","contenteditable","insert","createPositionAt","createText","label","_ref2","name","classes","keystrokes","set","evtData","cancel","change","tab","createElement","insertContent","selection","get"],"sources":["../../../../src/TextEditor/plugins/TabSpacesPlugin/TabSpacesPlugin.ts"],"sourcesContent":["import type { Editor } from 'ckeditor5'\nimport {\n Plugin,\n toWidget,\n viewToModelPositionOutsideModelElement,\n Widget,\n} from 'ckeditor5'\n\nexport class TabSpacesPlugin extends Plugin {\n static get requires() {\n return [Widget]\n }\n\n static get pluginName() {\n return 'TabSpacesPlugin'\n }\n\n init(): void {\n const editor = this.editor as Editor\n const model = editor.model\n const doc = model.document\n\n model.schema.register('tab', {\n allowWhere: '$text',\n isInline: true,\n isObject: true,\n })\n\n editor.editing.mapper.on(\n 'viewToModelPosition',\n viewToModelPositionOutsideModelElement(model, (viewElement) =>\n viewElement.hasClass('ck-tab')\n )\n )\n\n editor.conversion.for('editingDowncast').elementToElement({\n model: 'tab',\n view: (modelItem, { writer: viewWriter }) => {\n const span = viewWriter.createContainerElement('span', {\n class: 'ck-tab',\n contenteditable: 'false',\n })\n viewWriter.insert(\n viewWriter.createPositionAt(span, 0),\n viewWriter.createText('\\u00A0\\u00A0\\u00A0')\n )\n\n return toWidget(span, viewWriter, { label: 'tab spaces' })\n },\n })\n\n editor.conversion.for('dataDowncast').elementToElement({\n model: 'tab',\n view: (modelItem, { writer: viewWriter }) => {\n const span = viewWriter.createContainerElement('span', {\n class: 'ck-tab',\n })\n viewWriter.insert(\n viewWriter.createPositionAt(span, 0),\n viewWriter.createText('\\u00A0\\u00A0\\u00A0')\n )\n return span\n },\n })\n\n editor.conversion.for('upcast').elementToElement({\n view: {\n name: 'span',\n classes: 'ck-tab',\n },\n model: 'tab',\n })\n\n editor.keystrokes.set('Tab', (evtData, cancel) => {\n model.change((writer) => {\n const tab = writer.createElement('tab')\n model.insertContent(tab, doc.selection)\n })\n cancel()\n })\n }\n}\n"],"mappings":";;;;;;;;;;;;;AACA,SACEA,MAAM,EACNC,QAAQ,EACRC,sCAAsC,EACtCC,MAAM,QACD,WAAW;AAElB,WAAaC,eAAe,0BAAAC,OAAA;EAAA,SAAAD,gBAAA;IAAAE,eAAA,OAAAF,eAAA;IAAA,OAAAG,UAAA,OAAAH,eAAA,EAAAI,SAAA;EAAA;EAAAC,SAAA,CAAAL,eAAA,EAAAC,OAAA;EAAA,OAAAK,YAAA,CAAAN,eAAA;IAAAO,GAAA;IAAAC,KAAA,EAS1B,SAAAC,IAAIA,CAAA,EAAS;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AAAS,KAAA,CAAlBR,MAAM;UACxB,IAAMC,IAAI,GAAGF,UAAU,CAACG,sBAAsB,CAAC,MAAM,EAAE;YACrD,SAAO;UACT,CAAC,CAAC;UACFH,UAAU,CAACK,MAAM,CACfL,UAAU,CAACM,gBAAgB,CAACJ,IAAI,EAAE,CAAC,CAAC,EACpCF,UAAU,CAACO,UAAU,CAAC,cAAoB,CAC5C,CAAC;UACD,OAAOL,IAAI;QACb;MACF,CAAC,CAAC;MAEFrB,MAAM,CAACc,UAAU,OAAI,CAAC,QAAQ,CAAC,CAACC,gBAAgB,CAAC;QAC/CC,IAAI,EAAE;UACJa,IAAI,EAAE,MAAM;UACZC,OAAO,EAAE;QACX,CAAC;QACD7B,KAAK,EAAE;MACT,CAAC,CAAC;MAEFD,MAAM,CAAC+B,UAAU,CAACC,GAAG,CAAC,KAAK,EAAE,UAACC,OAAO,EAAEC,MAAM,EAAK;QAChDjC,KAAK,CAACkC,MAAM,CAAC,UAACf,MAAM,EAAK;UACvB,IAAMgB,GAAG,GAAGhB,MAAM,CAACiB,aAAa,CAAC,KAAK,CAAC;UACvCpC,KAAK,CAACqC,aAAa,CAACF,GAAG,EAAElC,GAAG,CAACqC,SAAS,CAAC;QACzC,CAAC,CAAC;QACFL,MAAM,CAAC,CAAC;MACV,CAAC,CAAC;IACJ;EAAC;IAAArC,GAAA;IAAA2C,GAAA,EAvED,SAAAA,IAAA,EAAsB;MACpB,OAAO,CAACnD,MAAM,CAAC;IACjB;EAAC;IAAAQ,GAAA;IAAA2C,GAAA,EAED,SAAAA,IAAA,EAAwB;MACtB,OAAO,iBAAiB;IAC1B;EAAC;AAAA,EAPkCtD,MAAM"}
1
+ {"version":3,"file":"TabSpacesPlugin.js","names":["Plugin","toWidget","viewToModelPositionOutsideModelElement","Widget","TabSpacesPlugin","_Plugin","_classCallCheck","_callSuper","arguments","_inherits","_createClass","key","value","init","editor","model","doc","document","schema","register","allowWhere","isInline","isObject","editing","mapper","on","viewElement","hasClass","conversion","elementToElement","view","modelItem","_ref","viewWriter","writer","span","createContainerElement","contenteditable","insert","createPositionAt","createText","label","_ref2","name","classes","keystrokes","set","evtData","cancel","change","tab","createElement","insertContent","selection","get"],"sources":["../../../../src/TextEditor/plugins/TabSpacesPlugin/TabSpacesPlugin.ts"],"sourcesContent":["import type { Editor } from 'ckeditor5'\nimport {\n Plugin,\n toWidget,\n viewToModelPositionOutsideModelElement,\n Widget,\n} from 'ckeditor5'\n\n// TODO - delete\nexport class TabSpacesPlugin extends Plugin {\n static get requires() {\n return [Widget]\n }\n\n static get pluginName() {\n return 'TabSpacesPlugin'\n }\n\n init(): void {\n const editor = this.editor as Editor\n const model = editor.model\n const doc = model.document\n\n model.schema.register('tab', {\n allowWhere: '$text',\n isInline: true,\n isObject: true,\n })\n\n editor.editing.mapper.on(\n 'viewToModelPosition',\n viewToModelPositionOutsideModelElement(model, (viewElement) =>\n viewElement.hasClass('ck-tab')\n )\n )\n\n editor.conversion.for('editingDowncast').elementToElement({\n model: 'tab',\n view: (modelItem, { writer: viewWriter }) => {\n const span = viewWriter.createContainerElement('span', {\n class: 'ck-tab',\n contenteditable: 'false',\n })\n viewWriter.insert(\n viewWriter.createPositionAt(span, 0),\n viewWriter.createText('\\u00A0\\u00A0\\u00A0')\n )\n\n return toWidget(span, viewWriter, { label: 'tab spaces' })\n },\n })\n\n editor.conversion.for('dataDowncast').elementToElement({\n model: 'tab',\n view: (modelItem, { writer: viewWriter }) => {\n const span = viewWriter.createContainerElement('span', {\n class: 'ck-tab',\n })\n viewWriter.insert(\n viewWriter.createPositionAt(span, 0),\n viewWriter.createText('\\u00A0\\u00A0\\u00A0')\n )\n return span\n },\n })\n\n editor.conversion.for('upcast').elementToElement({\n view: {\n name: 'span',\n classes: 'ck-tab',\n },\n model: 'tab',\n })\n\n editor.keystrokes.set('Tab', (evtData, cancel) => {\n model.change((writer) => {\n const tab = writer.createElement('tab')\n model.insertContent(tab, doc.selection)\n })\n cancel()\n })\n }\n}\n"],"mappings":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B;MACpB,OAAO,CAACnD,MAAM,CAAC;IACjB;EAAC;IAAAQ,GAAA;IAAA2C,GAAA,EAED,SAAAA,IAAA,EAAwB;MACtB,OAAO,iBAAiB;IAC1B;EAAC;AAAA,EAPkCtD,MAAM"}
@@ -5,6 +5,7 @@ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object
5
5
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
6
6
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
7
  import React from 'react';
8
+ // TODO - delete
8
9
  export var useTabAsNavigation = function useTabAsNavigation(_ref) {
9
10
  var enabled = _ref.enabled,
10
11
  config = _ref.config,
@@ -16,7 +17,7 @@ export var useTabAsNavigation = function useTabAsNavigation(_ref) {
16
17
 
17
18
  // Remove TabSpacesPlugin when tabAsNavigation is enabled
18
19
  var filteredPlugins = config.plugins.filter(function (plugin) {
19
- return typeof plugin === 'string' ? plugin !== 'TabSpacesPlugin' : plugin.pluginName !== 'TabSpacesPlugin';
20
+ return typeof plugin === 'string' ? plugin !== 'TabSpacesPlugin' : (plugin === null || plugin === void 0 ? void 0 : plugin.pluginName) !== 'TabSpacesPlugin';
20
21
  });
21
22
  return _objectSpread(_objectSpread({}, config), {}, {
22
23
  plugins: filteredPlugins
@@ -1 +1 @@
1
- {"version":3,"file":"useTabAsNavigation.js","names":["React","useTabAsNavigation","_ref","enabled","config","editor","enhancedConfig","useMemo","plugins","filteredPlugins","filter","plugin","pluginName","_objectSpread"],"sources":["../../src/TextEditor/useTabAsNavigation.ts"],"sourcesContent":["import type { ClassicEditor, EditorConfig } from 'ckeditor5'\nimport React from 'react'\n\ninterface UseTabAsNavigationProps {\n enabled: boolean\n config: EditorConfig\n editor: ClassicEditor | null\n}\n\ninterface UseTabAsNavigationReturn {\n config: EditorConfig\n}\n\nexport const useTabAsNavigation = ({\n enabled,\n config,\n editor,\n}: UseTabAsNavigationProps): UseTabAsNavigationReturn => {\n const enhancedConfig = React.useMemo(() => {\n if (!enabled || !config.plugins) {\n return config\n }\n\n // Remove TabSpacesPlugin when tabAsNavigation is enabled\n const filteredPlugins = config.plugins.filter((plugin) => {\n return typeof plugin === 'string'\n ? plugin !== 'TabSpacesPlugin'\n : plugin.pluginName !== 'TabSpacesPlugin'\n })\n\n return {\n ...config,\n plugins: filteredPlugins,\n }\n }, [enabled, config])\n\n return { config: enhancedConfig }\n}\n"],"mappings":";;;;;;AACA,OAAOA,KAAK,MAAM,OAAO;AAYzB,OAAO,IAAMC,kBAAkB,GAAG,SAArBA,kBAAkBA,CAAAC,IAAA,EAI0B;EAAA,IAHvDC,OAAO,GAAAD,IAAA,CAAPC,OAAO;IACPC,MAAM,GAAAF,IAAA,CAANE,MAAM;IACNC,MAAM,GAAAH,IAAA,CAANG,MAAM;EAEN,IAAMC,cAAc,GAAGN,KAAK,CAACO,OAAO,CAAC,YAAM;IACzC,IAAI,CAACJ,OAAO,IAAI,CAACC,MAAM,CAACI,OAAO,EAAE;MAC/B,OAAOJ,MAAM;IACf;;IAEA;IACA,IAAMK,eAAe,GAAGL,MAAM,CAACI,OAAO,CAACE,MAAM,CAAC,UAACC,MAAM,EAAK;MACxD,OAAO,OAAOA,MAAM,KAAK,QAAQ,GAC7BA,MAAM,KAAK,iBAAiB,GAC5BA,MAAM,CAACC,UAAU,KAAK,iBAAiB;IAC7C,CAAC,CAAC;IAEF,OAAAC,aAAA,CAAAA,aAAA,KACKT,MAAM;MACTI,OAAO,EAAEC;IAAe;EAE5B,CAAC,EAAE,CAACN,OAAO,EAAEC,MAAM,CAAC,CAAC;EAErB,OAAO;IAAEA,MAAM,EAAEE;EAAe,CAAC;AACnC,CAAC"}
1
+ {"version":3,"file":"useTabAsNavigation.js","names":["React","useTabAsNavigation","_ref","enabled","config","editor","enhancedConfig","useMemo","plugins","filteredPlugins","filter","plugin","pluginName","_objectSpread"],"sources":["../../src/TextEditor/useTabAsNavigation.ts"],"sourcesContent":["import type { ClassicEditor, EditorConfig } from 'ckeditor5'\nimport React from 'react'\n\ninterface UseTabAsNavigationProps {\n enabled: boolean\n config: EditorConfig\n editor: ClassicEditor | null\n}\n\ninterface UseTabAsNavigationReturn {\n config: EditorConfig\n}\n\n// TODO - delete\nexport const useTabAsNavigation = ({\n enabled,\n config,\n editor,\n}: UseTabAsNavigationProps): UseTabAsNavigationReturn => {\n const enhancedConfig = React.useMemo(() => {\n if (!enabled || !config.plugins) {\n return config\n }\n\n // Remove TabSpacesPlugin when tabAsNavigation is enabled\n const filteredPlugins = config.plugins.filter((plugin) => {\n return typeof plugin === 'string'\n ? plugin !== 'TabSpacesPlugin'\n : plugin?.pluginName !== 'TabSpacesPlugin'\n })\n\n return {\n ...config,\n plugins: filteredPlugins,\n }\n }, [enabled, config])\n\n return { config: enhancedConfig }\n}\n"],"mappings":";;;;;;AACA,OAAOA,KAAK,MAAM,OAAO;AAYzB;AACA,OAAO,IAAMC,kBAAkB,GAAG,SAArBA,kBAAkBA,CAAAC,IAAA,EAI0B;EAAA,IAHvDC,OAAO,GAAAD,IAAA,CAAPC,OAAO;IACPC,MAAM,GAAAF,IAAA,CAANE,MAAM;IACNC,MAAM,GAAAH,IAAA,CAANG,MAAM;EAEN,IAAMC,cAAc,GAAGN,KAAK,CAACO,OAAO,CAAC,YAAM;IACzC,IAAI,CAACJ,OAAO,IAAI,CAACC,MAAM,CAACI,OAAO,EAAE;MAC/B,OAAOJ,MAAM;IACf;;IAEA;IACA,IAAMK,eAAe,GAAGL,MAAM,CAACI,OAAO,CAACE,MAAM,CAAC,UAACC,MAAM,EAAK;MACxD,OAAO,OAAOA,MAAM,KAAK,QAAQ,GAC7BA,MAAM,KAAK,iBAAiB,GAC5B,CAAAA,MAAM,aAANA,MAAM,uBAANA,MAAM,CAAEC,UAAU,MAAK,iBAAiB;IAC9C,CAAC,CAAC;IAEF,OAAAC,aAAA,CAAAA,aAAA,KACKT,MAAM;MACTI,OAAO,EAAEC;IAAe;EAE5B,CAAC,EAAE,CAACN,OAAO,EAAEC,MAAM,CAAC,CAAC;EAErB,OAAO;IAAEA,MAAM,EAAEE;EAAe,CAAC;AACnC,CAAC"}
@@ -57,7 +57,9 @@ export var getDefaultConfig = function getDefaultConfig() {
57
57
  licenseKey: CK_EDITOR_LICENSE_KEY,
58
58
  language: getValidEditorLocale(locale),
59
59
  translations: [getEditorTranslation(locale)],
60
- plugins: [Alignment, AutoLink, Bold, Clipboard, Essentials, FontBackgroundColor, FontColor, FontSize, GeneralHtmlSupport, Indent, IndentBlock, Italic, Link, List, ListProperties, Paragraph, Strikethrough, Table, TableCaption, TableCellProperties, TableColumnResize, TableProperties, TableToolbar, Underline, Image, ImageInsert, ImageToolbar, CutPlugin, PastePlugin, PasteAsTextPlugin, IndentPaddingToMarginPlugin, TabSpacesPlugin],
60
+ plugins: [Alignment, AutoLink, Bold, Clipboard, Essentials, FontBackgroundColor, FontColor, FontSize, GeneralHtmlSupport, Indent, IndentBlock, Italic, Link, List, ListProperties, Paragraph, Strikethrough, Table, TableCaption, TableCellProperties, TableColumnResize, TableProperties, TableToolbar, Underline, Image, ImageInsert, ImageToolbar, CutPlugin, PastePlugin, PasteAsTextPlugin, IndentPaddingToMarginPlugin, TabSpacesPlugin // TODO - delete
61
+ ],
62
+
61
63
  toolbar: ['bold', 'italic', 'underline', 'strikethrough', '|', 'alignment:left', 'alignment:center', 'alignment:right', '|', 'bulletedList', 'numberedList', '|', 'outdent', 'indent', '|', 'cut', 'paste', 'pasteAsText', '|', 'fontSize', '|', 'fontColor', 'fontBackgroundColor', '|', 'undo', 'redo'],
62
64
  fontSize: {
63
65
  options: [{
@@ -114,7 +116,8 @@ export var getDefaultConfig = function getDefaultConfig() {
114
116
  image: {
115
117
  insert: {
116
118
  integrations: ['insertImageViaUrl']
117
- }
119
+ },
120
+ toolbar: ['imageTextAlternative']
118
121
  },
119
122
  table: {
120
123
  contentToolbar: ['tableColumn', 'tableRow', 'mergeTableCells', 'tableProperties', 'tableCellProperties'],
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","names":["Alignment","AutoLink","Bold","Clipboard","Essentials","FontBackgroundColor","FontColor","FontSize","GeneralHtmlSupport","Image","ImageInsert","ImageToolbar","Indent","IndentBlock","Italic","Link","List","ListProperties","Paragraph","Strikethrough","Table","TableCaption","TableCellProperties","TableColumnResize","TableProperties","TableToolbar","Underline","CK_EDITOR_LICENSE_KEY","CutPlugin","IndentPaddingToMarginPlugin","PasteAsTextPlugin","PastePlugin","TabSpacesPlugin","getEditorTranslation","getValidEditorLocale","TEXT_COLOR_PALETTE","color","getDefaultConfig","locale","arguments","length","undefined","licenseKey","language","translations","plugins","toolbar","fontSize","options","title","model","supportAllValues","fontColor","colors","fontBackgroundColor","indentBlock","offset","unit","htmlSupport","allow","name","styles","list","properties","useAttribute","startIndex","reversed","image","insert","integrations","table","contentToolbar","tableProperties","borderColors","backgroundColors","tableCellProperties","addButtonDataAttributes","editor","applyAttributes","toolbarElement","ui","view","element","toolbarChildren","Array","from","querySelectorAll","moreDropdownButtons","allToolbarElements","concat","toolbarItems","config","get","elementIndex","forEach","itemName","classList","contains","setAttribute","observer","MutationObserver","observe","childList","subtree","on","disconnect"],"sources":["../../../src/TextEditor/utils/config.ts"],"sourcesContent":["import type { ClassicEditor, EditorConfig } from 'ckeditor5'\nimport {\n Alignment,\n AutoLink,\n Bold,\n Clipboard,\n Essentials,\n FontBackgroundColor,\n FontColor,\n FontSize,\n GeneralHtmlSupport,\n Image,\n ImageInsert,\n ImageToolbar,\n Indent,\n IndentBlock,\n Italic,\n Link,\n List,\n ListProperties,\n Paragraph,\n Strikethrough,\n Table,\n TableCaption,\n TableCellProperties,\n TableColumnResize,\n TableProperties,\n TableToolbar,\n Underline,\n} from 'ckeditor5'\n\nimport { CK_EDITOR_LICENSE_KEY } from '../license_key'\nimport { CutPlugin } from '../plugins/CutPlugin'\nimport { IndentPaddingToMarginPlugin } from '../plugins/IndentPaddingToMarginPlugin'\nimport { PasteAsTextPlugin } from '../plugins/PasteAsTextPlugin'\nimport { PastePlugin } from '../plugins/PastePlugin'\nimport { TabSpacesPlugin } from '../plugins/TabSpacesPlugin'\nimport { getEditorTranslation, getValidEditorLocale } from './locale'\n\nconst TEXT_COLOR_PALETTE = [\n { color: '#BFEDD2' },\n { color: '#FBEEB8' },\n { color: '#F8CAC6' },\n { color: '#ECCAFA' },\n { color: '#C2E0F4' },\n { color: '#2DC26B' },\n { color: '#F1C40F' },\n { color: '#E03E2D' },\n { color: '#B96AD9' },\n { color: '#3598DB' },\n { color: '#169179' },\n { color: '#E67E23' },\n { color: '#BA372A' },\n { color: '#843FA1' },\n { color: '#236FA1' },\n { color: '#ECF0F1' },\n { color: '#CED4D9' },\n { color: '#95A5A6' },\n { color: '#7E8C8D' },\n { color: '#34495E' },\n { color: '#000000' },\n { color: '#FFFFFF' },\n]\n\nexport const getDefaultConfig = (locale: string = 'en'): EditorConfig => ({\n licenseKey: CK_EDITOR_LICENSE_KEY,\n language: getValidEditorLocale(locale),\n translations: [getEditorTranslation(locale)],\n plugins: [\n Alignment,\n AutoLink,\n Bold,\n Clipboard,\n Essentials,\n FontBackgroundColor,\n FontColor,\n FontSize,\n GeneralHtmlSupport,\n Indent,\n IndentBlock,\n Italic,\n Link,\n List,\n ListProperties,\n Paragraph,\n Strikethrough,\n Table,\n TableCaption,\n TableCellProperties,\n TableColumnResize,\n TableProperties,\n TableToolbar,\n Underline,\n Image,\n ImageInsert,\n ImageToolbar,\n CutPlugin,\n PastePlugin,\n PasteAsTextPlugin,\n IndentPaddingToMarginPlugin,\n TabSpacesPlugin,\n ],\n toolbar: [\n 'bold',\n 'italic',\n 'underline',\n 'strikethrough',\n '|',\n 'alignment:left',\n 'alignment:center',\n 'alignment:right',\n '|',\n 'bulletedList',\n 'numberedList',\n '|',\n 'outdent',\n 'indent',\n '|',\n 'cut',\n 'paste',\n 'pasteAsText',\n '|',\n 'fontSize',\n '|',\n 'fontColor',\n 'fontBackgroundColor',\n '|',\n 'undo',\n 'redo',\n ],\n fontSize: {\n options: [\n { title: '8pt', model: '8px' },\n { title: '10pt', model: '10px' },\n { title: '12pt', model: '12px' },\n { title: '14pt', model: '14px' },\n { title: '18pt', model: '18px' },\n { title: '24pt', model: '24px' },\n { title: '36pt', model: '36px' },\n ],\n supportAllValues: true,\n },\n fontColor: {\n colors: TEXT_COLOR_PALETTE,\n },\n fontBackgroundColor: {\n colors: TEXT_COLOR_PALETTE,\n },\n indentBlock: {\n offset: 40,\n unit: 'px',\n },\n htmlSupport: {\n allow: [\n {\n name: 'p',\n styles: {\n 'margin-left': true,\n },\n },\n ],\n },\n list: {\n properties: {\n styles: {\n useAttribute: true,\n },\n startIndex: true,\n reversed: true,\n },\n },\n image: {\n insert: {\n integrations: ['insertImageViaUrl'],\n },\n },\n table: {\n contentToolbar: [\n 'tableColumn',\n 'tableRow',\n 'mergeTableCells',\n 'tableProperties',\n 'tableCellProperties',\n ],\n tableProperties: {\n borderColors: TEXT_COLOR_PALETTE,\n backgroundColors: TEXT_COLOR_PALETTE,\n },\n tableCellProperties: {\n borderColors: TEXT_COLOR_PALETTE,\n backgroundColors: TEXT_COLOR_PALETTE,\n },\n },\n})\n\n// Add stable data attributes to toolbar buttons for the styling (or testing) purposes\nexport const addButtonDataAttributes = (editor: ClassicEditor) => {\n const applyAttributes = () => {\n const toolbarElement = editor.ui.view.toolbar.element\n if (!toolbarElement) {\n return\n }\n\n // Get buttons in the main toolbar\n const toolbarChildren = Array.from(\n toolbarElement.querySelectorAll('.ck-toolbar__items > *')\n )\n\n // Get buttons hidden in \"more\" dropdown\n const moreDropdownButtons = Array.from(\n toolbarElement.querySelectorAll('.ck-dropdown__panel .ck-list .ck-button')\n )\n\n const allToolbarElements = [...toolbarChildren, ...moreDropdownButtons]\n\n // Create mapping based on toolbar configuration order\n const toolbarItems = (editor.config.get('toolbar') || []) as string[]\n let elementIndex = 0\n\n toolbarItems.forEach((itemName) => {\n const element = allToolbarElements[elementIndex]\n if (\n itemName !== '|' &&\n element &&\n !element.classList.contains('ck-toolbar__separator')\n ) {\n // Use the toolbar item name as the stable identifier\n element.setAttribute('data-cke-command', itemName)\n }\n elementIndex++\n })\n }\n\n // Apply attributes initially\n applyAttributes()\n\n // Re-apply when dropdown menus are opened (buttons get created dynamically)\n const toolbarElement = editor.ui.view.toolbar.element\n if (toolbarElement) {\n const observer = new MutationObserver(() => {\n applyAttributes()\n })\n observer.observe(toolbarElement, {\n childList: true,\n subtree: true,\n })\n editor.on('destroy', () => {\n observer.disconnect()\n })\n }\n}\n"],"mappings":"AACA,SACEA,SAAS,EACTC,QAAQ,EACRC,IAAI,EACJC,SAAS,EACTC,UAAU,EACVC,mBAAmB,EACnBC,SAAS,EACTC,QAAQ,EACRC,kBAAkB,EAClBC,KAAK,EACLC,WAAW,EACXC,YAAY,EACZC,MAAM,EACNC,WAAW,EACXC,MAAM,EACNC,IAAI,EACJC,IAAI,EACJC,cAAc,EACdC,SAAS,EACTC,aAAa,EACbC,KAAK,EACLC,YAAY,EACZC,mBAAmB,EACnBC,iBAAiB,EACjBC,eAAe,EACfC,YAAY,EACZC,SAAS,QACJ,WAAW;AAElB,SAASC,qBAAqB,QAAQ,gBAAgB;AACtD,SAASC,SAAS,QAAQ,sBAAsB;AAChD,SAASC,2BAA2B,QAAQ,wCAAwC;AACpF,SAASC,iBAAiB,QAAQ,8BAA8B;AAChE,SAASC,WAAW,QAAQ,wBAAwB;AACpD,SAASC,eAAe,QAAQ,4BAA4B;AAC5D,SAASC,oBAAoB,EAAEC,oBAAoB,QAAQ,UAAU;AAErE,IAAMC,kBAAkB,GAAG,CACzB;EAAEC,KAAK,EAAE;AAAU,CAAC,EACpB;EAAEA,KAAK,EAAE;AAAU,CAAC,EACpB;EAAEA,KAAK,EAAE;AAAU,CAAC,EACpB;E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AM,CAACC,GAAG,CAAC,SAAS,CAAC,IAAI,EAAe;IACrE,IAAIC,YAAY,GAAG,CAAC;IAEpBH,YAAY,CAACI,OAAO,CAAC,UAACC,QAAQ,EAAK;MACjC,IAAMb,OAAO,GAAGM,kBAAkB,CAACK,YAAY,CAAC;MAChD,IACEE,QAAQ,KAAK,GAAG,IAChBb,OAAO,IACP,CAACA,OAAO,CAACc,SAAS,CAACC,QAAQ,CAAC,uBAAuB,CAAC,EACpD;QACA;QACAf,OAAO,CAACgB,YAAY,CAAC,kBAAkB,EAAEH,QAAQ,CAAC;MACpD;MACAF,YAAY,EAAE;IAChB,CAAC,CAAC;EACJ,CAAC;;EAED;EACAf,eAAe,CAAC,CAAC;;EAEjB;EACA,IAAMC,cAAc,GAAGF,MAAM,CAACG,EAAE,CAACC,IAAI,CAACnC,OAAO,CAACoC,OAAO;EACrD,IAAIH,cAAc,EAAE;IAClB,IAAMoB,QAAQ,GAAG,IAAIC,gBAAgB,CAAC,YAAM;MAC1CtB,eAAe,CAAC,CAAC;IACnB,CAAC,CAAC;IACFqB,QAAQ,CAACE,OAAO,CAACtB,cAAc,EAAE;MAC/BuB,SAAS,EAAE,IAAI;MACfC,OAAO,EAAE;IACX,CAAC,CAAC;IACF1B,MAAM,CAAC2B,EAAE,CAAC,SAAS,EAAE,YAAM;MACzBL,QAAQ,CAACM,UAAU,CAAC,CAAC;IACvB,CAAC,CAAC;EACJ;AACF,CAAC"}
1
+ {"version":3,"file":"config.js","names":["Alignment","AutoLink","Bold","Clipboard","Essentials","FontBackgroundColor","FontColor","FontSize","GeneralHtmlSupport","Image","ImageInsert","ImageToolbar","Indent","IndentBlock","Italic","Link","List","ListProperties","Paragraph","Strikethrough","Table","TableCaption","TableCellProperties","TableColumnResize","TableProperties","TableToolbar","Underline","CK_EDITOR_LICENSE_KEY","CutPlugin","IndentPaddingToMarginPlugin","PasteAsTextPlugin","PastePlugin","TabSpacesPlugin","getEditorTranslation","getValidEditorLocale","TEXT_COLOR_PALETTE","color","getDefaultConfig","locale","arguments","length","undefined","licenseKey","language","translations","plugins","toolbar","fontSize","options","title","model","supportAllValues","fontColor","colors","fontBackgroundColor","indentBlock","offset","unit","htmlSupport","allow","name","styles","list","properties","useAttribute","startIndex","reversed","image","insert","integrations","table","contentToolbar","tableProperties","borderColors","backgroundColors","tableCellProperties","addButtonDataAttributes","editor","applyAttributes","toolbarElement","ui","view","element","toolbarChildren","Array","from","querySelectorAll","moreDropdownButtons","allToolbarElements","concat","toolbarItems","config","get","elementIndex","forEach","itemName","classList","contains","setAttribute","observer","MutationObserver","observe","childList","subtree","on","disconnect"],"sources":["../../../src/TextEditor/utils/config.ts"],"sourcesContent":["import type { ClassicEditor, EditorConfig } from 'ckeditor5'\nimport {\n Alignment,\n AutoLink,\n Bold,\n Clipboard,\n Essentials,\n FontBackgroundColor,\n FontColor,\n FontSize,\n GeneralHtmlSupport,\n Image,\n ImageInsert,\n ImageToolbar,\n Indent,\n IndentBlock,\n Italic,\n Link,\n List,\n ListProperties,\n Paragraph,\n Strikethrough,\n Table,\n TableCaption,\n TableCellProperties,\n TableColumnResize,\n TableProperties,\n TableToolbar,\n Underline,\n} from 'ckeditor5'\n\nimport { CK_EDITOR_LICENSE_KEY } from '../license_key'\nimport { CutPlugin } from '../plugins/CutPlugin'\nimport { IndentPaddingToMarginPlugin } from '../plugins/IndentPaddingToMarginPlugin'\nimport { PasteAsTextPlugin } from '../plugins/PasteAsTextPlugin'\nimport { PastePlugin } from '../plugins/PastePlugin'\nimport { TabSpacesPlugin } from '../plugins/TabSpacesPlugin'\nimport { getEditorTranslation, getValidEditorLocale } from './locale'\n\nconst TEXT_COLOR_PALETTE = [\n { color: '#BFEDD2' },\n { color: '#FBEEB8' },\n { color: '#F8CAC6' },\n { color: '#ECCAFA' },\n { color: '#C2E0F4' },\n { color: '#2DC26B' },\n { color: '#F1C40F' },\n { color: '#E03E2D' },\n { color: '#B96AD9' },\n { color: '#3598DB' },\n { color: '#169179' },\n { color: '#E67E23' },\n { color: '#BA372A' },\n { color: '#843FA1' },\n { color: '#236FA1' },\n { color: '#ECF0F1' },\n { color: '#CED4D9' },\n { color: '#95A5A6' },\n { color: '#7E8C8D' },\n { color: '#34495E' },\n { color: '#000000' },\n { color: '#FFFFFF' },\n]\n\nexport const getDefaultConfig = (locale: string = 'en'): EditorConfig => ({\n licenseKey: CK_EDITOR_LICENSE_KEY,\n language: getValidEditorLocale(locale),\n translations: [getEditorTranslation(locale)],\n plugins: [\n Alignment,\n AutoLink,\n Bold,\n Clipboard,\n Essentials,\n FontBackgroundColor,\n FontColor,\n FontSize,\n GeneralHtmlSupport,\n Indent,\n IndentBlock,\n Italic,\n Link,\n List,\n ListProperties,\n Paragraph,\n Strikethrough,\n Table,\n TableCaption,\n TableCellProperties,\n TableColumnResize,\n TableProperties,\n TableToolbar,\n Underline,\n Image,\n ImageInsert,\n ImageToolbar,\n CutPlugin,\n PastePlugin,\n PasteAsTextPlugin,\n IndentPaddingToMarginPlugin,\n TabSpacesPlugin, // TODO - delete\n ],\n toolbar: [\n 'bold',\n 'italic',\n 'underline',\n 'strikethrough',\n '|',\n 'alignment:left',\n 'alignment:center',\n 'alignment:right',\n '|',\n 'bulletedList',\n 'numberedList',\n '|',\n 'outdent',\n 'indent',\n '|',\n 'cut',\n 'paste',\n 'pasteAsText',\n '|',\n 'fontSize',\n '|',\n 'fontColor',\n 'fontBackgroundColor',\n '|',\n 'undo',\n 'redo',\n ],\n fontSize: {\n options: [\n { title: '8pt', model: '8px' },\n { title: '10pt', model: '10px' },\n { title: '12pt', model: '12px' },\n { title: '14pt', model: '14px' },\n { title: '18pt', model: '18px' },\n { title: '24pt', model: '24px' },\n { title: '36pt', model: '36px' },\n ],\n supportAllValues: true,\n },\n fontColor: {\n colors: TEXT_COLOR_PALETTE,\n },\n fontBackgroundColor: {\n colors: TEXT_COLOR_PALETTE,\n },\n indentBlock: {\n offset: 40,\n unit: 'px',\n },\n htmlSupport: {\n allow: [\n {\n name: 'p',\n styles: {\n 'margin-left': true,\n },\n },\n ],\n },\n list: {\n properties: {\n styles: {\n useAttribute: true,\n },\n startIndex: true,\n reversed: true,\n },\n },\n image: {\n insert: {\n integrations: ['insertImageViaUrl'],\n },\n toolbar: ['imageTextAlternative'],\n },\n table: {\n contentToolbar: [\n 'tableColumn',\n 'tableRow',\n 'mergeTableCells',\n 'tableProperties',\n 'tableCellProperties',\n ],\n tableProperties: {\n borderColors: TEXT_COLOR_PALETTE,\n backgroundColors: TEXT_COLOR_PALETTE,\n },\n tableCellProperties: {\n borderColors: TEXT_COLOR_PALETTE,\n backgroundColors: TEXT_COLOR_PALETTE,\n },\n },\n})\n\n// Add stable data attributes to toolbar buttons for the styling (or testing) purposes\nexport const addButtonDataAttributes = (editor: ClassicEditor) => {\n const applyAttributes = () => {\n const toolbarElement = editor.ui.view.toolbar.element\n if (!toolbarElement) {\n return\n }\n\n // Get buttons in the main toolbar\n const toolbarChildren = Array.from(\n toolbarElement.querySelectorAll('.ck-toolbar__items > *')\n )\n\n // Get buttons hidden in \"more\" dropdown\n const moreDropdownButtons = Array.from(\n toolbarElement.querySelectorAll('.ck-dropdown__panel .ck-list .ck-button')\n )\n\n const allToolbarElements = [...toolbarChildren, ...moreDropdownButtons]\n\n // Create mapping based on toolbar configuration order\n const toolbarItems = (editor.config.get('toolbar') || []) as string[]\n let elementIndex = 0\n\n toolbarItems.forEach((itemName) => {\n const element = allToolbarElements[elementIndex]\n if (\n itemName !== '|' &&\n element &&\n !element.classList.contains('ck-toolbar__separator')\n ) {\n // Use the toolbar item name as the stable identifier\n element.setAttribute('data-cke-command', itemName)\n }\n elementIndex++\n })\n }\n\n // Apply attributes initially\n applyAttributes()\n\n // Re-apply when dropdown menus are opened (buttons get created dynamically)\n const toolbarElement = editor.ui.view.toolbar.element\n if (toolbarElement) {\n const observer = new MutationObserver(() => {\n applyAttributes()\n })\n observer.observe(toolbarElement, {\n childList: true,\n subtree: true,\n })\n editor.on('destroy', () => {\n observer.disconnect()\n })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AC,CAAC;EACJ,CAAC;;EAED;EACAf,eAAe,CAAC,CAAC;;EAEjB;EACA,IAAMC,cAAc,GAAGF,MAAM,CAACG,EAAE,CAACC,IAAI,CAACnC,OAAO,CAACoC,OAAO;EACrD,IAAIH,cAAc,EAAE;IAClB,IAAMoB,QAAQ,GAAG,IAAIC,gBAAgB,CAAC,YAAM;MAC1CtB,eAAe,CAAC,CAAC;IACnB,CAAC,CAAC;IACFqB,QAAQ,CAACE,OAAO,CAACtB,cAAc,EAAE;MAC/BuB,SAAS,EAAE,IAAI;MACfC,OAAO,EAAE;IACX,CAAC,CAAC;IACF1B,MAAM,CAAC2B,EAAE,CAAC,SAAS,EAAE,YAAM;MACzBL,QAAQ,CAACM,UAAU,CAAC,CAAC;IACvB,CAAC,CAAC;EACJ;AACF,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import styled from 'styled-components';
2
2
  export var StyledEditor = /*#__PURE__*/styled.div.withConfig({
3
3
  displayName: "StyledEditor",
4
- componentId: "text-editor-0_0_1__sc-1oujb2g-0"
4
+ componentId: "text-editor-0_0_3__sc-1oujb2g-0"
5
5
  })([".ck-editor__top{height:0 !important;}.ck-content{border:none !important;padding:0 !important;p{margin:0;}table,img{margin-left:auto;margin-right:auto;}img{display:block;}table{border:1px double #b3b3b3;border-collapse:collapse;border-spacing:0;th{text-align:left;}& > thead,& > tbody{& > tr > td,& > tr > th{border:1px solid #bfbfbf;min-width:2em;padding:0.4em;}& > tr > th{background:rgba(0,0,0,0.05);font-weight:700;}}}}"]);
6
6
  //# sourceMappingURL=TextEditorOutput.styles.js.map
@@ -10,7 +10,7 @@
10
10
  "description": "Indicates if the editor is disabled",
11
11
  "descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>Indicates if the editor is disabled</p>\n</div><dl class=\"tsd-comment-tags\"><dt>since</dt><dd><p>10.19.0</p>\n</dd></dl></div>",
12
12
  "sourceFile": "TextEditor/TextEditor.types.ts",
13
- "sourceUrl": "https://github.com/procore/core/blob/d7acf0a/packages/text-editor/src/TextEditor/TextEditor.types.ts#L34"
13
+ "sourceUrl": "https://github.com/procore/core/blob/672f459/packages/text-editor/src/TextEditor/TextEditor.types.ts#L34"
14
14
  },
15
15
  {
16
16
  "name": "error",
@@ -20,7 +20,7 @@
20
20
  "description": "Indicates if the editor is in an error state",
21
21
  "descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>Indicates if the editor is in an error state</p>\n</div><dl class=\"tsd-comment-tags\"><dt>since</dt><dd><p>10.19.0</p>\n</dd></dl></div>",
22
22
  "sourceFile": "TextEditor/TextEditor.types.ts",
23
- "sourceUrl": "https://github.com/procore/core/blob/d7acf0a/packages/text-editor/src/TextEditor/TextEditor.types.ts#L41"
23
+ "sourceUrl": "https://github.com/procore/core/blob/672f459/packages/text-editor/src/TextEditor/TextEditor.types.ts#L41"
24
24
  },
25
25
  {
26
26
  "name": "id",
@@ -30,18 +30,7 @@
30
30
  "description": "Unique identifier for the editor",
31
31
  "descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>Unique identifier for the editor</p>\n</div><dl class=\"tsd-comment-tags\"><dt>since</dt><dd><p>10.19.0</p>\n</dd></dl></div>",
32
32
  "sourceFile": "TextEditor/TextEditor.types.ts",
33
- "sourceUrl": "https://github.com/procore/core/blob/d7acf0a/packages/text-editor/src/TextEditor/TextEditor.types.ts#L10"
34
- },
35
- {
36
- "name": "init",
37
- "required": false,
38
- "type": "<span class=\"tsd-signature-type\">any</span>",
39
- "typeDetail": "<span class=\"tsd-signature-type\">any</span>",
40
- "description": "Config for when the editor is initialized. **Changes after the editor has initialized are ignored.**",
41
- "descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>Config for when the editor is initialized. <strong>Changes after the editor has initialized are ignored.</strong></p>\n</div><dl class=\"tsd-comment-tags\"><dt>link</dt><dd><p><a href=\"https://www.tiny.cloud/docs/integrations/react/#init\">TinyMCE React Init</a></p>\n</dd><dt>unsupported</dt><dd><p>Use at your own risk. DST makes no guarantees about this API,\nand is subject to removal at any point without warning or deprecation.</p>\n</dd><dt>deprecated</dt><dd><p><code>init</code> has been deprecated and will be removed in a future version. TinyMCE support has been removed.</p>\n</dd><dt>since</dt><dd><p>10.19.0</p>\n</dd></dl></div>",
42
- "deprecated": "`init` has been deprecated and will be removed in a future version. TinyMCE support has been removed.",
43
- "sourceFile": "TextEditor/TextEditor.types.ts",
44
- "sourceUrl": "https://github.com/procore/core/blob/d7acf0a/packages/text-editor/src/TextEditor/TextEditor.types.ts#L153"
33
+ "sourceUrl": "https://github.com/procore/core/blob/672f459/packages/text-editor/src/TextEditor/TextEditor.types.ts#L10"
45
34
  },
46
35
  {
47
36
  "name": "initialValue",
@@ -53,7 +42,7 @@
53
42
  "deprecated": "`initialValue` has been deprecated and will be removed in a future version.\nPlease use the `value` prop instead",
54
43
  "deprecatedSince": "10.20.0",
55
44
  "sourceFile": "TextEditor/TextEditor.types.ts",
56
- "sourceUrl": "https://github.com/procore/core/blob/d7acf0a/packages/text-editor/src/TextEditor/TextEditor.types.ts#L20"
45
+ "sourceUrl": "https://github.com/procore/core/blob/672f459/packages/text-editor/src/TextEditor/TextEditor.types.ts#L20"
57
46
  },
58
47
  {
59
48
  "name": "locale",
@@ -63,7 +52,7 @@
63
52
  "description": "Locale which will be used for localization. Can be passed directly or\nset by wrapping components in I18n provider.",
64
53
  "descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>Locale which will be used for localization. Can be passed directly or\nset by wrapping components in I18n provider.</p>\n</div><dl class=\"tsd-comment-tags\"><dt>since</dt><dd><p>10.19.0</p>\n</dd></dl></div>",
65
54
  "sourceFile": "TextEditor/TextEditor.types.ts",
66
- "sourceUrl": "https://github.com/procore/core/blob/d7acf0a/packages/text-editor/src/TextEditor/TextEditor.types.ts#L48"
55
+ "sourceUrl": "https://github.com/procore/core/blob/672f459/packages/text-editor/src/TextEditor/TextEditor.types.ts#L48"
67
56
  },
68
57
  {
69
58
  "name": "plugins",
@@ -73,18 +62,7 @@
73
62
  "description": "Array of plugin names to add to the editor in addition to the defaults.\nThis provides backward compatibility with the deprecated TinyMCE version of the editor.\nSupports plugin names like 'link', 'image', 'table', etc.",
74
63
  "descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>Array of plugin names to add to the editor in addition to the defaults.\nThis provides backward compatibility with the deprecated TinyMCE version of the editor.\nSupports plugin names like &#39;link&#39;, &#39;image&#39;, &#39;table&#39;, etc.</p>\n</div><dl class=\"tsd-comment-tags\"><dt>since</dt><dd><p>12.26.0</p>\n</dd></dl></div>",
75
64
  "sourceFile": "TextEditor/TextEditor.types.ts",
76
- "sourceUrl": "https://github.com/procore/core/blob/d7acf0a/packages/text-editor/src/TextEditor/TextEditor.types.ts#L57"
77
- },
78
- {
79
- "name": "tinyMCE",
80
- "required": false,
81
- "type": "<span class=\"tsd-signature-type\">boolean</span>",
82
- "typeDetail": "<span class=\"tsd-signature-type\">boolean</span>",
83
- "description": "If you experience problems with the new editor implementation, you can use this to **temporarily** switch back to legacy version while you report the issue.",
84
- "descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>If you experience problems with the new editor implementation, you can use this to <strong>temporarily</strong> switch back to legacy version while you report the issue.</p>\n</div><dl class=\"tsd-comment-tags\"><dt>deprecated</dt><dd><p>This property will be removed in a future version. TinyMCE support has been removed.</p>\n</dd><dt>since</dt><dd><p>10.19.0</p>\n</dd></dl></div>",
85
- "deprecated": "This property will be removed in a future version. TinyMCE support has been removed.",
86
- "sourceFile": "TextEditor/TextEditor.types.ts",
87
- "sourceUrl": "https://github.com/procore/core/blob/d7acf0a/packages/text-editor/src/TextEditor/TextEditor.types.ts#L142"
65
+ "sourceUrl": "https://github.com/procore/core/blob/672f459/packages/text-editor/src/TextEditor/TextEditor.types.ts#L57"
88
66
  },
89
67
  {
90
68
  "name": "value",
@@ -94,7 +72,7 @@
94
72
  "description": "The current value of the editor",
95
73
  "descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>The current value of the editor</p>\n</div><dl class=\"tsd-comment-tags\"><dt>since</dt><dd><p>10.19.0</p>\n</dd></dl></div>",
96
74
  "sourceFile": "TextEditor/TextEditor.types.ts",
97
- "sourceUrl": "https://github.com/procore/core/blob/d7acf0a/packages/text-editor/src/TextEditor/TextEditor.types.ts#L27"
75
+ "sourceUrl": "https://github.com/procore/core/blob/672f459/packages/text-editor/src/TextEditor/TextEditor.types.ts#L27"
98
76
  },
99
77
  {
100
78
  "name": "config",
@@ -104,7 +82,7 @@
104
82
  "description": "Configuration function for customizing the editor",
105
83
  "descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>Configuration function for customizing the editor</p>\n</div><dl class=\"tsd-comment-tags\"><dt>since</dt><dd><p>12.26.0</p>\n</dd></dl></div>",
106
84
  "sourceFile": "TextEditor/TextEditor.types.ts",
107
- "sourceUrl": "https://github.com/procore/core/blob/d7acf0a/packages/text-editor/src/TextEditor/TextEditor.types.ts#L66"
85
+ "sourceUrl": "https://github.com/procore/core/blob/672f459/packages/text-editor/src/TextEditor/TextEditor.types.ts#L66"
108
86
  },
109
87
  {
110
88
  "name": "onAfterDestroy",
@@ -114,7 +92,7 @@
114
92
  "description": "Callback fired after the editor instance is destroyed",
115
93
  "descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>Callback fired after the editor instance is destroyed</p>\n</div><dl class=\"tsd-comment-tags\"><dt>since</dt><dd><p>10.19.0</p>\n</dd></dl></div>",
116
94
  "sourceFile": "TextEditor/TextEditor.types.ts",
117
- "sourceUrl": "https://github.com/procore/core/blob/d7acf0a/packages/text-editor/src/TextEditor/TextEditor.types.ts#L116"
95
+ "sourceUrl": "https://github.com/procore/core/blob/672f459/packages/text-editor/src/TextEditor/TextEditor.types.ts#L116"
118
96
  },
119
97
  {
120
98
  "name": "onBlur",
@@ -124,7 +102,7 @@
124
102
  "description": "Callback fired when the editor loses focus",
125
103
  "descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>Callback fired when the editor loses focus</p>\n</div><dl class=\"tsd-comment-tags\"><dt>since</dt><dd><p>10.19.0</p>\n</dd></dl></div>",
126
104
  "sourceFile": "TextEditor/TextEditor.types.ts",
127
- "sourceUrl": "https://github.com/procore/core/blob/d7acf0a/packages/text-editor/src/TextEditor/TextEditor.types.ts#L89"
105
+ "sourceUrl": "https://github.com/procore/core/blob/672f459/packages/text-editor/src/TextEditor/TextEditor.types.ts#L89"
128
106
  },
129
107
  {
130
108
  "name": "onChange",
@@ -134,7 +112,7 @@
134
112
  "description": "Callback fired when the editor content changes",
135
113
  "descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>Callback fired when the editor content changes</p>\n</div><dl class=\"tsd-comment-tags\"><dt>since</dt><dd><p>10.19.0</p>\n</dd></dl></div>",
136
114
  "sourceFile": "TextEditor/TextEditor.types.ts",
137
- "sourceUrl": "https://github.com/procore/core/blob/d7acf0a/packages/text-editor/src/TextEditor/TextEditor.types.ts#L75"
115
+ "sourceUrl": "https://github.com/procore/core/blob/672f459/packages/text-editor/src/TextEditor/TextEditor.types.ts#L75"
138
116
  },
139
117
  {
140
118
  "name": "onDirty",
@@ -144,17 +122,7 @@
144
122
  "description": "Callback fired when the editor becomes dirty (content differs from initial value)",
145
123
  "descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>Callback fired when the editor becomes dirty (content differs from initial value)</p>\n</div><dl class=\"tsd-comment-tags\"><dt>since</dt><dd><p>12.26.0</p>\n</dd></dl></div>",
146
124
  "sourceFile": "TextEditor/TextEditor.types.ts",
147
- "sourceUrl": "https://github.com/procore/core/blob/d7acf0a/packages/text-editor/src/TextEditor/TextEditor.types.ts#L123"
148
- },
149
- {
150
- "name": "onEditorChange",
151
- "required": false,
152
- "type": "Function",
153
- "typeDetail": "on<wbr/>Editor<wbr/>Change<span class=\"tsd-signature-symbol\">(</span>value<span class=\"tsd-signature-symbol\">: </span><span class=\"tsd-signature-type\">string</span><span class=\"tsd-signature-symbol\">)</span><span class=\"tsd-signature-symbol\">: </span><span class=\"tsd-signature-type\">void</span>",
154
- "description": "Callback fired when the editor content changes",
155
- "descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>Callback fired when the editor content changes</p>\n</div><dl class=\"tsd-comment-tags\"><dt>deprecated</dt><dd><p><code>onEditorChange</code> has been deprecated and will be removed in a future version. TinyMCE support has been removed. Use <code>onChange</code> instead.</p>\n</dd><dt>since</dt><dd><p>10.19.0</p>\n</dd></dl></div>",
156
- "sourceFile": "TextEditor/TextEditor.types.ts",
157
- "sourceUrl": "https://github.com/procore/core/blob/d7acf0a/packages/text-editor/src/TextEditor/TextEditor.types.ts#L161"
125
+ "sourceUrl": "https://github.com/procore/core/blob/672f459/packages/text-editor/src/TextEditor/TextEditor.types.ts#L123"
158
126
  },
159
127
  {
160
128
  "name": "onError",
@@ -164,7 +132,7 @@
164
132
  "description": "Callback fired when an error occurs in the editor",
165
133
  "descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>Callback fired when an error occurs in the editor</p>\n</div><dl class=\"tsd-comment-tags\"><dt>since</dt><dd><p>10.19.0</p>\n</dd></dl></div>",
166
134
  "sourceFile": "TextEditor/TextEditor.types.ts",
167
- "sourceUrl": "https://github.com/procore/core/blob/d7acf0a/packages/text-editor/src/TextEditor/TextEditor.types.ts#L96"
135
+ "sourceUrl": "https://github.com/procore/core/blob/672f459/packages/text-editor/src/TextEditor/TextEditor.types.ts#L96"
168
136
  },
169
137
  {
170
138
  "name": "onFocus",
@@ -174,27 +142,7 @@
174
142
  "description": "Callback fired when the editor gains focus",
175
143
  "descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>Callback fired when the editor gains focus</p>\n</div><dl class=\"tsd-comment-tags\"><dt>since</dt><dd><p>10.19.0</p>\n</dd></dl></div>",
176
144
  "sourceFile": "TextEditor/TextEditor.types.ts",
177
- "sourceUrl": "https://github.com/procore/core/blob/d7acf0a/packages/text-editor/src/TextEditor/TextEditor.types.ts#L82"
178
- },
179
- {
180
- "name": "onFocusIn",
181
- "required": false,
182
- "type": "Function",
183
- "typeDetail": "on<wbr/>Focus<wbr/>In<span class=\"tsd-signature-symbol\">(</span><span class=\"tsd-signature-symbol\">...</span>args<span class=\"tsd-signature-symbol\">: </span><span class=\"tsd-signature-type\">any</span><span class=\"tsd-signature-symbol\">[]</span><span class=\"tsd-signature-symbol\">)</span><span class=\"tsd-signature-symbol\">: </span><span class=\"tsd-signature-type\">void</span>",
184
- "description": "Callback fired when the editor gains focus",
185
- "descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>Callback fired when the editor gains focus</p>\n</div><dl class=\"tsd-comment-tags\"><dt>deprecated</dt><dd><p><code>onFocusIn</code> has been deprecated and will be removed in a future version. TinyMCE support has been removed. Use <code>onFocus</code> instead.</p>\n</dd><dt>since</dt><dd><p>10.19.0</p>\n</dd></dl></div>",
186
- "sourceFile": "TextEditor/TextEditor.types.ts",
187
- "sourceUrl": "https://github.com/procore/core/blob/d7acf0a/packages/text-editor/src/TextEditor/TextEditor.types.ts#L169"
188
- },
189
- {
190
- "name": "onFocusOut",
191
- "required": false,
192
- "type": "Function",
193
- "typeDetail": "on<wbr/>Focus<wbr/>Out<span class=\"tsd-signature-symbol\">(</span><span class=\"tsd-signature-symbol\">...</span>args<span class=\"tsd-signature-symbol\">: </span><span class=\"tsd-signature-type\">any</span><span class=\"tsd-signature-symbol\">[]</span><span class=\"tsd-signature-symbol\">)</span><span class=\"tsd-signature-symbol\">: </span><span class=\"tsd-signature-type\">void</span>",
194
- "description": "Callback fired when the editor loses focus",
195
- "descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>Callback fired when the editor loses focus</p>\n</div><dl class=\"tsd-comment-tags\"><dt>deprecated</dt><dd><p><code>onFocusOut</code> has been deprecated and will be removed in a future version. TinyMCE support has been removed. Use <code>onBlur</code> instead.</p>\n</dd><dt>since</dt><dd><p>10.19.0</p>\n</dd></dl></div>",
196
- "sourceFile": "TextEditor/TextEditor.types.ts",
197
- "sourceUrl": "https://github.com/procore/core/blob/d7acf0a/packages/text-editor/src/TextEditor/TextEditor.types.ts#L177"
145
+ "sourceUrl": "https://github.com/procore/core/blob/672f459/packages/text-editor/src/TextEditor/TextEditor.types.ts#L82"
198
146
  },
199
147
  {
200
148
  "name": "onInit",
@@ -204,7 +152,7 @@
204
152
  "description": "Callback fired when the editor is ready",
205
153
  "descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>Callback fired when the editor is ready</p>\n</div><dl class=\"tsd-comment-tags\"><dt>since</dt><dd><p>10.19.0</p>\n</dd></dl></div>",
206
154
  "sourceFile": "TextEditor/TextEditor.types.ts",
207
- "sourceUrl": "https://github.com/procore/core/blob/d7acf0a/packages/text-editor/src/TextEditor/TextEditor.types.ts#L109"
155
+ "sourceUrl": "https://github.com/procore/core/blob/672f459/packages/text-editor/src/TextEditor/TextEditor.types.ts#L109"
208
156
  },
209
157
  {
210
158
  "name": "onKeyDown",
@@ -214,7 +162,7 @@
214
162
  "description": "Callback fired when a key is pressed in the editor",
215
163
  "descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>Callback fired when a key is pressed in the editor</p>\n</div><dl class=\"tsd-comment-tags\"><dt>since</dt><dd><p>12.29.0</p>\n</dd></dl></div>",
216
164
  "sourceFile": "TextEditor/TextEditor.types.ts",
217
- "sourceUrl": "https://github.com/procore/core/blob/d7acf0a/packages/text-editor/src/TextEditor/TextEditor.types.ts#L132"
165
+ "sourceUrl": "https://github.com/procore/core/blob/672f459/packages/text-editor/src/TextEditor/TextEditor.types.ts#L132"
218
166
  }
219
167
  ],
220
168
  "description": ""
@@ -10,7 +10,7 @@
10
10
  "description": "",
11
11
  "descriptionHtml": "",
12
12
  "sourceFile": "TextEditor/TextEditorProvider.types.ts",
13
- "sourceUrl": "https://github.com/procore/core/blob/d7acf0a/packages/text-editor/src/TextEditor/TextEditorProvider.types.ts#L9"
13
+ "sourceUrl": "https://github.com/procore/core/blob/672f459/packages/text-editor/src/TextEditor/TextEditorProvider.types.ts#L9"
14
14
  },
15
15
  {
16
16
  "name": "features",
@@ -20,7 +20,7 @@
20
20
  "description": "- `stickyToolbar` - Have the editor toolbar stick to the top when content is longer than the page length.\n- `tabAsNavigation` - Have `Tab` key exit the editor. Support `Alt`/`Opt` + `Tab` as triple space indent.",
21
21
  "descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<ul>\n<li><code>stickyToolbar</code> - Have the editor toolbar stick to the top when content is longer than the page length.</li>\n<li><code>tabAsNavigation</code> - Have <code>Tab</code> key exit the editor. Support <code>Alt</code>/<code>Opt</code> + <code>Tab</code> as triple space indent.</li>\n</ul>\n</div></div>",
22
22
  "sourceFile": "TextEditor/TextEditorProvider.types.ts",
23
- "sourceUrl": "https://github.com/procore/core/blob/d7acf0a/packages/text-editor/src/TextEditor/TextEditorProvider.types.ts#L14"
23
+ "sourceUrl": "https://github.com/procore/core/blob/672f459/packages/text-editor/src/TextEditor/TextEditorProvider.types.ts#L14"
24
24
  }
25
25
  ],
26
26
  "description": ""