@uva-glass/component-library 3.42.0 → 3.42.2

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.
@@ -113,7 +113,7 @@ function we({ editor: l }) {
113
113
  if (t[o][i].cell === e)
114
114
  return i;
115
115
  return -1;
116
- }, N = b(
116
+ }, I = b(
117
117
  (e) => {
118
118
  if (!c)
119
119
  throw new Error("TableCellResizer: Expected active cell.");
@@ -144,7 +144,7 @@ function we({ editor: l }) {
144
144
  );
145
145
  },
146
146
  [c, l]
147
- ), O = b(
147
+ ), N = b(
148
148
  (e) => {
149
149
  const t = (o) => {
150
150
  if (o.preventDefault(), o.stopPropagation(), !c)
@@ -159,24 +159,24 @@ function we({ editor: l }) {
159
159
  D(n);
160
160
  } else {
161
161
  const n = (o.clientX - i) / r;
162
- N(n);
162
+ I(n);
163
163
  }
164
164
  v(), document.removeEventListener("mouseup", t);
165
165
  }
166
166
  };
167
167
  return t;
168
168
  },
169
- [c, v, N, D]
170
- ), I = b(
169
+ [c, v, I, D]
170
+ ), O = b(
171
171
  (e) => (t) => {
172
172
  if (t.preventDefault(), t.stopPropagation(), !c)
173
173
  throw new Error("TableCellResizer: Expected active cell.");
174
174
  h.current = {
175
175
  x: t.clientX,
176
176
  y: t.clientY
177
- }, R(h.current), H(e), document.addEventListener("mouseup", O(e));
177
+ }, R(h.current), H(e), document.addEventListener("mouseup", N(e));
178
178
  },
179
- [c, O]
179
+ [c, N]
180
180
  ), P = b(() => {
181
181
  if (c) {
182
182
  const { height: e, width: t, top: o, left: i } = c.elem.getBoundingClientRect(), s = K(c.elem), r = 10, n = {
@@ -186,7 +186,8 @@ function we({ editor: l }) {
186
186
  height: `${r}px`,
187
187
  left: `${window.pageXOffset + i}px`,
188
188
  top: `${window.pageYOffset + o + e - r / B}px`,
189
- width: `${t}px`
189
+ width: `${t}px`,
190
+ zIndex: 10
190
191
  },
191
192
  right: {
192
193
  backgroundColor: "none",
@@ -194,7 +195,8 @@ function we({ editor: l }) {
194
195
  height: `${e}px`,
195
196
  left: `${window.pageXOffset + i + t - r / B}px`,
196
197
  top: `${window.pageYOffset + o}px`,
197
- width: `${r}px`
198
+ width: `${r}px`,
199
+ zIndex: 10
198
200
  }
199
201
  }, u = m.current;
200
202
  return a && w && u && (L(a) ? (n[a].left = `${window.pageXOffset + u.left}px`, n[a].top = `${window.pageYOffset + w.y / s}px`, n[a].height = "3px", n[a].width = `${u.width}px`) : (n[a].top = `${window.pageYOffset + u.top}px`, n[a].left = `${window.pageXOffset + w.x / s}px`, n[a].width = "3px", n[a].height = `${u.height}px`), n[a].backgroundColor = "#adf"), n;
@@ -212,7 +214,7 @@ function we({ editor: l }) {
212
214
  {
213
215
  className: S["table-cell-resizer__resizer"],
214
216
  style: P.right || void 0,
215
- onMouseDown: I("right")
217
+ onMouseDown: O("right")
216
218
  }
217
219
  ),
218
220
  /* @__PURE__ */ y(
@@ -220,7 +222,7 @@ function we({ editor: l }) {
220
222
  {
221
223
  className: S["table-cell-resizer__resizer"],
222
224
  style: P.bottom || void 0,
223
- onMouseDown: I("bottom")
225
+ onMouseDown: O("bottom")
224
226
  }
225
227
  )
226
228
  ] }) });
@@ -236,4 +238,4 @@ export {
236
238
  ve as T,
237
239
  fe as a
238
240
  };
239
- //# sourceMappingURL=TableCellResizerPlugin-D6jjhYoD.js.map
241
+ //# sourceMappingURL=TableCellResizerPlugin-Bao8R6Lv.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TableCellResizerPlugin-D6jjhYoD.js","sources":["../node_modules/@lexical/react/useLexicalEditable.prod.mjs","../src/components/RteEditor/Plugins/TableCellResizerPlugin/TableCellResizerPlugin.tsx"],"sourcesContent":["/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport{useLexicalComposerContext as e}from\"@lexical/react/LexicalComposerContext\";import{useLayoutEffect as n,useEffect as t,useMemo as i,useState as r,useRef as o}from\"react\";const c=\"undefined\"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?n:t;function u(e){return{initialValueFn:()=>e.isEditable(),subscribe:n=>e.registerEditableListener(n)}}function a(){return function(n){const[t]=e(),u=i((()=>n(t)),[t,n]),[a,l]=r((()=>u.initialValueFn())),d=o(a);return c((()=>{const{initialValueFn:e,subscribe:n}=u,t=e();return d.current!==t&&(d.current=t,l(t)),n((e=>{d.current=e,l(e)}))}),[u,n]),a}(u)}export{a as useLexicalEditable};\n","/* eslint-disable jsx-a11y/no-static-element-interactions */\r\n/**\r\n * Copyright (c) Meta Platforms, Inc. and affiliates.\r\n *\r\n * This source code is licensed under the MIT license found in the\r\n * LICENSE file in the root directory of this source tree.\r\n *\r\n * Modified from original to fit project needs wim jurriaans.\r\n *\r\n *\r\n */\r\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react';\r\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';\r\nimport { useLexicalEditable } from '@lexical/react/useLexicalEditable';\r\nimport {\r\n $computeTableMapSkipCellCheck,\r\n $getTableNodeFromLexicalNodeOrThrow,\r\n $getTableRowIndexFromTableCellNode,\r\n $isTableCellNode,\r\n $isTableRowNode,\r\n TableNode,\r\n getDOMCellFromTarget,\r\n getTableElement,\r\n} from '@lexical/table';\r\nimport { calculateZoomLevel } from '@lexical/utils';\r\nimport { $getNearestNodeFromDOMNode, isHTMLElement } from 'lexical';\r\nimport { createPortal } from 'react-dom';\r\n\r\nimport type { LexicalEditor } from 'lexical';\r\nimport type { TableCellNode, TableDOMCell, TableMapType, TableRowNode } from '@lexical/table';\r\nimport type { JSX, MouseEventHandler, ReactPortal } from 'react';\r\n\r\nimport styles from './TableCellResizerPlugin.module.css';\r\n\r\nimport { $createTableWrapperNode, TableWrapperNode } from 'components/RteEditor/nodes';\r\n\r\ntype MousePosition = {\r\n x: number;\r\n y: number;\r\n};\r\n\r\ntype MouseDraggingDirection = 'right' | 'bottom';\r\n\r\nconst MIN_ROW_HEIGHT = 33;\r\nconst MIN_COLUMN_WIDTH = 32;\r\nconst HALF = 2;\r\n\r\nfunction TableCellResizer({ editor }: { editor: LexicalEditor }): JSX.Element {\r\n const targetRef = useRef<HTMLElement | null>(null);\r\n const resizerRef = useRef<HTMLDivElement | null>(null);\r\n const tableRectRef = useRef<DOMRect | null>(null);\r\n\r\n const mouseStartPosRef = useRef<MousePosition | null>(null);\r\n const [mouseCurrentPos, updateMouseCurrentPos] = useState<MousePosition | null>(null);\r\n\r\n const [activeCell, updateActiveCell] = useState<TableDOMCell | null>(null);\r\n const [isMouseDown, updateIsMouseDown] = useState<boolean>(false);\r\n const [draggingDirection, updateDraggingDirection] = useState<MouseDraggingDirection | null>(null);\r\n\r\n const resetState = useCallback(() => {\r\n updateActiveCell(null);\r\n targetRef.current = null;\r\n updateDraggingDirection(null);\r\n mouseStartPosRef.current = null;\r\n tableRectRef.current = null;\r\n }, []);\r\n\r\n const isMouseDownOnEvent = (event: MouseEvent) => {\r\n return (event.buttons & 1) === 1;\r\n };\r\n\r\n useEffect(() => {\r\n return editor.registerNodeTransform(TableNode, (tableNode) => {\r\n // modification: set default column widths if not defined or table cells of imported tables has the width set\r\n if (!tableNode.getColWidths()) {\r\n const tableRows = tableNode.getChildren();\r\n const columnCount = tableNode.getColumnCount();\r\n const colWidths = new Array(columnCount).fill(undefined);\r\n\r\n const firstRow = tableRows[0] as TableRowNode;\r\n const cells = firstRow.getChildren();\r\n cells.forEach((cell, colIdx) => {\r\n const domCell = editor.getElementByKey(cell.getKey());\r\n if (domCell && domCell.style.width) {\r\n colWidths[colIdx] = parseInt(domCell.style.width, 10);\r\n domCell.style.width = '';\r\n } else {\r\n colWidths[colIdx] = MIN_COLUMN_WIDTH;\r\n }\r\n });\r\n\r\n tableNode.setColWidths(colWidths);\r\n }\r\n\r\n // modification: wrap table node in a wrapper node if there is no wrapper node present\r\n if (tableNode && !(tableNode.getParent() instanceof TableWrapperNode)) {\r\n const wrapperNode = $createTableWrapperNode();\r\n tableNode.replace(wrapperNode);\r\n wrapperNode.append(tableNode);\r\n }\r\n\r\n return tableNode;\r\n });\r\n }, [editor]);\r\n\r\n useEffect(() => {\r\n const onMouseMove = (event: MouseEvent) => {\r\n const target = event.target;\r\n if (!isHTMLElement(target)) {\r\n return;\r\n }\r\n\r\n if (draggingDirection) {\r\n updateMouseCurrentPos({\r\n x: event.clientX,\r\n y: event.clientY,\r\n });\r\n return;\r\n }\r\n updateIsMouseDown(isMouseDownOnEvent(event));\r\n if (resizerRef.current && resizerRef.current.contains(target)) {\r\n return;\r\n }\r\n\r\n if (targetRef.current !== target) {\r\n targetRef.current = target;\r\n const cell = getDOMCellFromTarget(target);\r\n\r\n if (cell && activeCell !== cell) {\r\n editor.getEditorState().read(\r\n () => {\r\n const tableCellNode = $getNearestNodeFromDOMNode(cell.elem);\r\n if (!tableCellNode) {\r\n throw new Error('TableCellResizer: Table cell node not found.');\r\n }\r\n\r\n const tableNode = $getTableNodeFromLexicalNodeOrThrow(tableCellNode);\r\n const tableElement = getTableElement(tableNode, editor.getElementByKey(tableNode.getKey()));\r\n\r\n if (!tableElement) {\r\n throw new Error('TableCellResizer: Table element not found.');\r\n }\r\n\r\n targetRef.current = target;\r\n tableRectRef.current = tableElement.getBoundingClientRect();\r\n updateActiveCell(cell);\r\n },\r\n { editor }\r\n );\r\n } else if (cell == null) {\r\n resetState();\r\n }\r\n }\r\n };\r\n\r\n const onMouseDown = () => {\r\n updateIsMouseDown(true);\r\n };\r\n\r\n const onMouseUp = () => {\r\n updateIsMouseDown(false);\r\n };\r\n\r\n const removeRootListener = editor.registerRootListener((rootElement, prevRootElement) => {\r\n prevRootElement?.removeEventListener('mousemove', onMouseMove);\r\n prevRootElement?.removeEventListener('mousedown', onMouseDown);\r\n prevRootElement?.removeEventListener('mouseup', onMouseUp);\r\n rootElement?.addEventListener('mousemove', onMouseMove);\r\n rootElement?.addEventListener('mousedown', onMouseDown);\r\n rootElement?.addEventListener('mouseup', onMouseUp);\r\n });\r\n\r\n return () => {\r\n removeRootListener();\r\n };\r\n }, [activeCell, draggingDirection, editor, resetState]);\r\n\r\n const isHeightChanging = (direction: MouseDraggingDirection) => {\r\n if (direction === 'bottom') {\r\n return true;\r\n }\r\n return false;\r\n };\r\n\r\n const updateRowHeight = useCallback(\r\n (heightChange: number) => {\r\n if (!activeCell) {\r\n throw new Error('TableCellResizer: Expected active cell.');\r\n }\r\n\r\n editor.update(\r\n () => {\r\n const tableCellNode = $getNearestNodeFromDOMNode(activeCell.elem);\r\n if (!$isTableCellNode(tableCellNode)) {\r\n throw new Error('TableCellResizer: Table cell node not found.');\r\n }\r\n\r\n const tableNode = $getTableNodeFromLexicalNodeOrThrow(tableCellNode);\r\n\r\n const tableRowIndex = $getTableRowIndexFromTableCellNode(tableCellNode) + tableCellNode.getRowSpan() - 1;\r\n\r\n const tableRows = tableNode.getChildren();\r\n\r\n if (tableRowIndex >= tableRows.length || tableRowIndex < 0) {\r\n throw new Error('Expected table cell to be inside of table row.');\r\n }\r\n\r\n const tableRow = tableRows[tableRowIndex];\r\n\r\n if (!$isTableRowNode(tableRow)) {\r\n throw new Error('Expected table row');\r\n }\r\n\r\n let height = tableRow.getHeight();\r\n if (height === undefined) {\r\n const rowCells = tableRow.getChildren<TableCellNode>();\r\n height = Math.min(...rowCells.map((cell) => getCellNodeHeight(cell, editor) ?? Infinity));\r\n }\r\n\r\n const newHeight = Math.max(height + heightChange, MIN_ROW_HEIGHT);\r\n tableRow.setHeight(newHeight);\r\n },\r\n { tag: 'skip-scroll-into-view' }\r\n );\r\n },\r\n [activeCell, editor]\r\n );\r\n\r\n const getCellNodeHeight = (cell: TableCellNode, activeEditor: LexicalEditor): number | undefined => {\r\n const domCellNode = activeEditor.getElementByKey(cell.getKey());\r\n return domCellNode?.clientHeight;\r\n };\r\n\r\n const getCellColumnIndex = (tableCellNode: TableCellNode, tableMap: TableMapType) => {\r\n for (let row = 0; row < tableMap.length; row++) {\r\n for (let column = 0; column < tableMap[row].length; column++) {\r\n if (tableMap[row][column].cell === tableCellNode) {\r\n return column;\r\n }\r\n }\r\n }\r\n return -1;\r\n };\r\n\r\n const updateColumnWidth = useCallback(\r\n (widthChange: number) => {\r\n if (!activeCell) {\r\n throw new Error('TableCellResizer: Expected active cell.');\r\n }\r\n editor.update(\r\n () => {\r\n const tableCellNode = $getNearestNodeFromDOMNode(activeCell.elem);\r\n if (!$isTableCellNode(tableCellNode)) {\r\n throw new Error('TableCellResizer: Table cell node not found.');\r\n }\r\n\r\n const tableNode = $getTableNodeFromLexicalNodeOrThrow(tableCellNode);\r\n const [tableMap] = $computeTableMapSkipCellCheck(tableNode, null, null);\r\n const columnIndex = getCellColumnIndex(tableCellNode, tableMap);\r\n if (columnIndex === undefined) {\r\n throw new Error('TableCellResizer: Table column not found.');\r\n }\r\n\r\n const colWidths = tableNode.getColWidths();\r\n if (!colWidths) {\r\n return;\r\n }\r\n const width = colWidths[columnIndex];\r\n if (width === undefined) {\r\n return;\r\n }\r\n const newColWidths = [...colWidths];\r\n const newWidth = Math.max(width + widthChange, MIN_COLUMN_WIDTH);\r\n newColWidths[columnIndex] = newWidth;\r\n tableNode.setColWidths(newColWidths);\r\n\r\n // modification: when resizing a column, also resize the next column so the table doesn't overflow\r\n if (columnIndex < tableNode.getColumnCount() - 1) {\r\n const nextColWidths = tableNode.getColWidths();\r\n if (!nextColWidths) {\r\n return;\r\n }\r\n const newNextColWidths = [...nextColWidths];\r\n const newColumnIndex = columnIndex + 1;\r\n const newNextWidth = nextColWidths[newColumnIndex];\r\n const nextWidth = Math.max(newNextWidth - widthChange, MIN_COLUMN_WIDTH);\r\n newNextColWidths[newColumnIndex] = nextWidth;\r\n tableNode.setColWidths(newNextColWidths);\r\n }\r\n },\r\n { tag: 'skip-scroll-into-view' }\r\n );\r\n },\r\n [activeCell, editor]\r\n );\r\n\r\n const mouseUpHandler = useCallback(\r\n (direction: MouseDraggingDirection) => {\r\n const handler = (event: MouseEvent) => {\r\n event.preventDefault();\r\n event.stopPropagation();\r\n\r\n if (!activeCell) {\r\n throw new Error('TableCellResizer: Expected active cell.');\r\n }\r\n\r\n if (mouseStartPosRef.current) {\r\n const { x, y } = mouseStartPosRef.current;\r\n\r\n if (activeCell === null) {\r\n return;\r\n }\r\n const zoom = calculateZoomLevel(event.target as Element);\r\n\r\n if (isHeightChanging(direction)) {\r\n const heightChange = (event.clientY - y) / zoom;\r\n updateRowHeight(heightChange);\r\n } else {\r\n const widthChange = (event.clientX - x) / zoom;\r\n updateColumnWidth(widthChange);\r\n }\r\n\r\n resetState();\r\n document.removeEventListener('mouseup', handler);\r\n }\r\n };\r\n return handler;\r\n },\r\n [activeCell, resetState, updateColumnWidth, updateRowHeight]\r\n );\r\n\r\n const toggleResize = useCallback(\r\n (direction: MouseDraggingDirection): MouseEventHandler<HTMLDivElement> =>\r\n (event) => {\r\n event.preventDefault();\r\n event.stopPropagation();\r\n\r\n if (!activeCell) {\r\n throw new Error('TableCellResizer: Expected active cell.');\r\n }\r\n\r\n mouseStartPosRef.current = {\r\n x: event.clientX,\r\n y: event.clientY,\r\n };\r\n updateMouseCurrentPos(mouseStartPosRef.current);\r\n updateDraggingDirection(direction);\r\n\r\n document.addEventListener('mouseup', mouseUpHandler(direction));\r\n },\r\n [activeCell, mouseUpHandler]\r\n );\r\n\r\n const getResizers = useCallback(() => {\r\n if (activeCell) {\r\n const { height, width, top, left } = activeCell.elem.getBoundingClientRect();\r\n const zoom = calculateZoomLevel(activeCell.elem);\r\n const zoneWidth = 10; // Pixel width of the zone where you can drag the edge\r\n const styles = {\r\n bottom: {\r\n backgroundColor: 'none',\r\n cursor: 'ns-resize',\r\n height: `${zoneWidth}px`,\r\n left: `${window.pageXOffset + left}px`,\r\n top: `${window.pageYOffset + top + height - zoneWidth / HALF}px`,\r\n width: `${width}px`,\r\n },\r\n right: {\r\n backgroundColor: 'none',\r\n cursor: 'ew-resize',\r\n height: `${height}px`,\r\n left: `${window.pageXOffset + left + width - zoneWidth / HALF}px`,\r\n top: `${window.pageYOffset + top}px`,\r\n width: `${zoneWidth}px`,\r\n },\r\n };\r\n\r\n const tableRect = tableRectRef.current;\r\n\r\n if (draggingDirection && mouseCurrentPos && tableRect) {\r\n if (isHeightChanging(draggingDirection)) {\r\n styles[draggingDirection].left = `${window.pageXOffset + tableRect.left}px`;\r\n styles[draggingDirection].top = `${window.pageYOffset + mouseCurrentPos.y / zoom}px`;\r\n styles[draggingDirection].height = '3px';\r\n styles[draggingDirection].width = `${tableRect.width}px`;\r\n } else {\r\n styles[draggingDirection].top = `${window.pageYOffset + tableRect.top}px`;\r\n styles[draggingDirection].left = `${window.pageXOffset + mouseCurrentPos.x / zoom}px`;\r\n styles[draggingDirection].width = '3px';\r\n styles[draggingDirection].height = `${tableRect.height}px`;\r\n }\r\n\r\n styles[draggingDirection].backgroundColor = '#adf';\r\n }\r\n\r\n return styles;\r\n }\r\n\r\n return {\r\n bottom: null,\r\n left: null,\r\n right: null,\r\n top: null,\r\n };\r\n }, [activeCell, draggingDirection, mouseCurrentPos]);\r\n\r\n const resizerStyles = getResizers();\r\n\r\n return (\r\n <div ref={resizerRef}>\r\n {activeCell != null && !isMouseDown && (\r\n <>\r\n <div\r\n className={styles['table-cell-resizer__resizer']}\r\n style={resizerStyles.right || undefined}\r\n onMouseDown={toggleResize('right')}\r\n />\r\n <div\r\n className={styles['table-cell-resizer__resizer']}\r\n style={resizerStyles.bottom || undefined}\r\n onMouseDown={toggleResize('bottom')}\r\n />\r\n </>\r\n )}\r\n </div>\r\n );\r\n}\r\n\r\nexport const TableCellResizerPlugin = (): null | ReactPortal => {\r\n const [editor] = useLexicalComposerContext();\r\n const isEditable = useLexicalEditable();\r\n\r\n return useMemo(\r\n () => (isEditable ? createPortal(<TableCellResizer editor={editor} />, document.body) : null),\r\n [editor, isEditable]\r\n );\r\n};\r\n"],"names":["c","n","t","u","e","a","i","l","r","d","o","MIN_ROW_HEIGHT","MIN_COLUMN_WIDTH","HALF","TableCellResizer","editor","targetRef","useRef","resizerRef","tableRectRef","mouseStartPosRef","mouseCurrentPos","updateMouseCurrentPos","useState","activeCell","updateActiveCell","isMouseDown","updateIsMouseDown","draggingDirection","updateDraggingDirection","resetState","useCallback","isMouseDownOnEvent","event","useEffect","TableNode","tableNode","tableRows","columnCount","colWidths","cell","colIdx","domCell","TableWrapperNode","wrapperNode","$createTableWrapperNode","onMouseMove","target","isHTMLElement","getDOMCellFromTarget","tableCellNode","$getNearestNodeFromDOMNode","$getTableNodeFromLexicalNodeOrThrow","tableElement","getTableElement","onMouseDown","onMouseUp","removeRootListener","rootElement","prevRootElement","isHeightChanging","direction","updateRowHeight","heightChange","$isTableCellNode","tableRowIndex","$getTableRowIndexFromTableCellNode","tableRow","$isTableRowNode","height","rowCells","getCellNodeHeight","newHeight","activeEditor","getCellColumnIndex","tableMap","row","column","updateColumnWidth","widthChange","$computeTableMapSkipCellCheck","columnIndex","width","newColWidths","newWidth","nextColWidths","newNextColWidths","newColumnIndex","newNextWidth","nextWidth","mouseUpHandler","handler","x","y","zoom","calculateZoomLevel","toggleResize","resizerStyles","top","left","zoneWidth","styles","tableRect","jsx","jsxs","Fragment","TableCellResizerPlugin","useLexicalComposerContext","isEditable","useLexicalEditable","useMemo","createPortal"],"mappings":";;;;;;;;AAQgL,MAAMA,KAAe,OAAO,SAApB,OAAqC,OAAO,aAAhB,UAAmC,OAAO,SAAS,kBAAzB,SAAuCC,IAAEC;AAAE,SAASC,GAAEC,GAAE;AAAC,SAAM,EAAC,gBAAe,MAAIA,EAAE,WAAU,GAAG,WAAU,CAAAH,MAAGG,EAAE,yBAAyBH,CAAC,EAAC;AAAC;AAAC,SAASI,KAAG;AAAC,SAAO,SAASJ,GAAE;AAAC,UAAK,CAACC,CAAC,IAAEE,EAAC,GAAGD,IAAEG,EAAG,MAAIL,EAAEC,CAAC,GAAG,CAACA,GAAED,CAAC,CAAC,GAAE,CAACI,GAAEE,CAAC,IAAEC,EAAG,MAAIL,EAAE,eAAc,CAAE,GAAGM,I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QAC/C,OAAOJ,EAAc,UAAU;AAAA,QAC/B,aAAaD,EAAa,QAAQ;AAAA,MAAA;AAAA,IAAA;AAAA,EACpC,EAAA,CACF,EAAA,CAEJ;AAEJ;AAEO,MAAMU,KAAyB,MAA0B;AAC9D,QAAM,CAAC3F,CAAM,IAAI4F,EAAA,GACXC,IAAaC,GAAA;AAEnB,SAAOC;AAAA,IACL,MAAOF,IAAaG,GAAa,gBAAAR,EAACzF,MAAiB,QAAAC,EAAA,CAAgB,GAAI,SAAS,IAAI,IAAI;AAAA,IACxF,CAACA,GAAQ6F,CAAU;AAAA,EAAA;AAEvB;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"TableCellResizerPlugin-Bao8R6Lv.js","sources":["../node_modules/@lexical/react/useLexicalEditable.prod.mjs","../src/components/RteEditor/Plugins/TableCellResizerPlugin/TableCellResizerPlugin.tsx"],"sourcesContent":["/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport{useLexicalComposerContext as e}from\"@lexical/react/LexicalComposerContext\";import{useLayoutEffect as n,useEffect as t,useMemo as i,useState as r,useRef as o}from\"react\";const c=\"undefined\"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?n:t;function u(e){return{initialValueFn:()=>e.isEditable(),subscribe:n=>e.registerEditableListener(n)}}function a(){return function(n){const[t]=e(),u=i((()=>n(t)),[t,n]),[a,l]=r((()=>u.initialValueFn())),d=o(a);return c((()=>{const{initialValueFn:e,subscribe:n}=u,t=e();return d.current!==t&&(d.current=t,l(t)),n((e=>{d.current=e,l(e)}))}),[u,n]),a}(u)}export{a as useLexicalEditable};\n","/* eslint-disable jsx-a11y/no-static-element-interactions */\r\n/**\r\n * Copyright (c) Meta Platforms, Inc. and affiliates.\r\n *\r\n * This source code is licensed under the MIT license found in the\r\n * LICENSE file in the root directory of this source tree.\r\n *\r\n * Modified from original to fit project needs wim jurriaans.\r\n *\r\n *\r\n */\r\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react';\r\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';\r\nimport { useLexicalEditable } from '@lexical/react/useLexicalEditable';\r\nimport {\r\n $computeTableMapSkipCellCheck,\r\n $getTableNodeFromLexicalNodeOrThrow,\r\n $getTableRowIndexFromTableCellNode,\r\n $isTableCellNode,\r\n $isTableRowNode,\r\n TableNode,\r\n getDOMCellFromTarget,\r\n getTableElement,\r\n} from '@lexical/table';\r\nimport { calculateZoomLevel } from '@lexical/utils';\r\nimport { $getNearestNodeFromDOMNode, isHTMLElement } from 'lexical';\r\nimport { createPortal } from 'react-dom';\r\n\r\nimport type { LexicalEditor } from 'lexical';\r\nimport type { TableCellNode, TableDOMCell, TableMapType, TableRowNode } from '@lexical/table';\r\nimport type { JSX, MouseEventHandler, ReactPortal } from 'react';\r\n\r\nimport styles from './TableCellResizerPlugin.module.css';\r\n\r\nimport { $createTableWrapperNode, TableWrapperNode } from 'components/RteEditor/nodes';\r\n\r\ntype MousePosition = {\r\n x: number;\r\n y: number;\r\n};\r\n\r\ntype MouseDraggingDirection = 'right' | 'bottom';\r\n\r\nconst MIN_ROW_HEIGHT = 33;\r\nconst MIN_COLUMN_WIDTH = 32;\r\nconst HALF = 2;\r\n\r\nfunction TableCellResizer({ editor }: { editor: LexicalEditor }): JSX.Element {\r\n const targetRef = useRef<HTMLElement | null>(null);\r\n const resizerRef = useRef<HTMLDivElement | null>(null);\r\n const tableRectRef = useRef<DOMRect | null>(null);\r\n\r\n const mouseStartPosRef = useRef<MousePosition | null>(null);\r\n const [mouseCurrentPos, updateMouseCurrentPos] = useState<MousePosition | null>(null);\r\n\r\n const [activeCell, updateActiveCell] = useState<TableDOMCell | null>(null);\r\n const [isMouseDown, updateIsMouseDown] = useState<boolean>(false);\r\n const [draggingDirection, updateDraggingDirection] = useState<MouseDraggingDirection | null>(null);\r\n\r\n const resetState = useCallback(() => {\r\n updateActiveCell(null);\r\n targetRef.current = null;\r\n updateDraggingDirection(null);\r\n mouseStartPosRef.current = null;\r\n tableRectRef.current = null;\r\n }, []);\r\n\r\n const isMouseDownOnEvent = (event: MouseEvent) => {\r\n return (event.buttons & 1) === 1;\r\n };\r\n\r\n useEffect(() => {\r\n return editor.registerNodeTransform(TableNode, (tableNode) => {\r\n // modification: set default column widths if not defined or table cells of imported tables has the width set\r\n if (!tableNode.getColWidths()) {\r\n const tableRows = tableNode.getChildren();\r\n const columnCount = tableNode.getColumnCount();\r\n const colWidths = new Array(columnCount).fill(undefined);\r\n\r\n const firstRow = tableRows[0] as TableRowNode;\r\n const cells = firstRow.getChildren();\r\n cells.forEach((cell, colIdx) => {\r\n const domCell = editor.getElementByKey(cell.getKey());\r\n if (domCell && domCell.style.width) {\r\n colWidths[colIdx] = parseInt(domCell.style.width, 10);\r\n domCell.style.width = '';\r\n } else {\r\n colWidths[colIdx] = MIN_COLUMN_WIDTH;\r\n }\r\n });\r\n\r\n tableNode.setColWidths(colWidths);\r\n }\r\n\r\n // modification: wrap table node in a wrapper node if there is no wrapper node present\r\n if (tableNode && !(tableNode.getParent() instanceof TableWrapperNode)) {\r\n const wrapperNode = $createTableWrapperNode();\r\n tableNode.replace(wrapperNode);\r\n wrapperNode.append(tableNode);\r\n }\r\n\r\n return tableNode;\r\n });\r\n }, [editor]);\r\n\r\n useEffect(() => {\r\n const onMouseMove = (event: MouseEvent) => {\r\n const target = event.target;\r\n if (!isHTMLElement(target)) {\r\n return;\r\n }\r\n\r\n if (draggingDirection) {\r\n updateMouseCurrentPos({\r\n x: event.clientX,\r\n y: event.clientY,\r\n });\r\n return;\r\n }\r\n updateIsMouseDown(isMouseDownOnEvent(event));\r\n if (resizerRef.current && resizerRef.current.contains(target)) {\r\n return;\r\n }\r\n\r\n if (targetRef.current !== target) {\r\n targetRef.current = target;\r\n const cell = getDOMCellFromTarget(target);\r\n\r\n if (cell && activeCell !== cell) {\r\n editor.getEditorState().read(\r\n () => {\r\n const tableCellNode = $getNearestNodeFromDOMNode(cell.elem);\r\n if (!tableCellNode) {\r\n throw new Error('TableCellResizer: Table cell node not found.');\r\n }\r\n\r\n const tableNode = $getTableNodeFromLexicalNodeOrThrow(tableCellNode);\r\n const tableElement = getTableElement(tableNode, editor.getElementByKey(tableNode.getKey()));\r\n\r\n if (!tableElement) {\r\n throw new Error('TableCellResizer: Table element not found.');\r\n }\r\n\r\n targetRef.current = target;\r\n tableRectRef.current = tableElement.getBoundingClientRect();\r\n updateActiveCell(cell);\r\n },\r\n { editor }\r\n );\r\n } else if (cell == null) {\r\n resetState();\r\n }\r\n }\r\n };\r\n\r\n const onMouseDown = () => {\r\n updateIsMouseDown(true);\r\n };\r\n\r\n const onMouseUp = () => {\r\n updateIsMouseDown(false);\r\n };\r\n\r\n const removeRootListener = editor.registerRootListener((rootElement, prevRootElement) => {\r\n prevRootElement?.removeEventListener('mousemove', onMouseMove);\r\n prevRootElement?.removeEventListener('mousedown', onMouseDown);\r\n prevRootElement?.removeEventListener('mouseup', onMouseUp);\r\n rootElement?.addEventListener('mousemove', onMouseMove);\r\n rootElement?.addEventListener('mousedown', onMouseDown);\r\n rootElement?.addEventListener('mouseup', onMouseUp);\r\n });\r\n\r\n return () => {\r\n removeRootListener();\r\n };\r\n }, [activeCell, draggingDirection, editor, resetState]);\r\n\r\n const isHeightChanging = (direction: MouseDraggingDirection) => {\r\n if (direction === 'bottom') {\r\n return true;\r\n }\r\n return false;\r\n };\r\n\r\n const updateRowHeight = useCallback(\r\n (heightChange: number) => {\r\n if (!activeCell) {\r\n throw new Error('TableCellResizer: Expected active cell.');\r\n }\r\n\r\n editor.update(\r\n () => {\r\n const tableCellNode = $getNearestNodeFromDOMNode(activeCell.elem);\r\n if (!$isTableCellNode(tableCellNode)) {\r\n throw new Error('TableCellResizer: Table cell node not found.');\r\n }\r\n\r\n const tableNode = $getTableNodeFromLexicalNodeOrThrow(tableCellNode);\r\n\r\n const tableRowIndex = $getTableRowIndexFromTableCellNode(tableCellNode) + tableCellNode.getRowSpan() - 1;\r\n\r\n const tableRows = tableNode.getChildren();\r\n\r\n if (tableRowIndex >= tableRows.length || tableRowIndex < 0) {\r\n throw new Error('Expected table cell to be inside of table row.');\r\n }\r\n\r\n const tableRow = tableRows[tableRowIndex];\r\n\r\n if (!$isTableRowNode(tableRow)) {\r\n throw new Error('Expected table row');\r\n }\r\n\r\n let height = tableRow.getHeight();\r\n if (height === undefined) {\r\n const rowCells = tableRow.getChildren<TableCellNode>();\r\n height = Math.min(...rowCells.map((cell) => getCellNodeHeight(cell, editor) ?? Infinity));\r\n }\r\n\r\n const newHeight = Math.max(height + heightChange, MIN_ROW_HEIGHT);\r\n tableRow.setHeight(newHeight);\r\n },\r\n { tag: 'skip-scroll-into-view' }\r\n );\r\n },\r\n [activeCell, editor]\r\n );\r\n\r\n const getCellNodeHeight = (cell: TableCellNode, activeEditor: LexicalEditor): number | undefined => {\r\n const domCellNode = activeEditor.getElementByKey(cell.getKey());\r\n return domCellNode?.clientHeight;\r\n };\r\n\r\n const getCellColumnIndex = (tableCellNode: TableCellNode, tableMap: TableMapType) => {\r\n for (let row = 0; row < tableMap.length; row++) {\r\n for (let column = 0; column < tableMap[row].length; column++) {\r\n if (tableMap[row][column].cell === tableCellNode) {\r\n return column;\r\n }\r\n }\r\n }\r\n return -1;\r\n };\r\n\r\n const updateColumnWidth = useCallback(\r\n (widthChange: number) => {\r\n if (!activeCell) {\r\n throw new Error('TableCellResizer: Expected active cell.');\r\n }\r\n editor.update(\r\n () => {\r\n const tableCellNode = $getNearestNodeFromDOMNode(activeCell.elem);\r\n if (!$isTableCellNode(tableCellNode)) {\r\n throw new Error('TableCellResizer: Table cell node not found.');\r\n }\r\n\r\n const tableNode = $getTableNodeFromLexicalNodeOrThrow(tableCellNode);\r\n const [tableMap] = $computeTableMapSkipCellCheck(tableNode, null, null);\r\n const columnIndex = getCellColumnIndex(tableCellNode, tableMap);\r\n if (columnIndex === undefined) {\r\n throw new Error('TableCellResizer: Table column not found.');\r\n }\r\n\r\n const colWidths = tableNode.getColWidths();\r\n if (!colWidths) {\r\n return;\r\n }\r\n const width = colWidths[columnIndex];\r\n if (width === undefined) {\r\n return;\r\n }\r\n const newColWidths = [...colWidths];\r\n const newWidth = Math.max(width + widthChange, MIN_COLUMN_WIDTH);\r\n newColWidths[columnIndex] = newWidth;\r\n tableNode.setColWidths(newColWidths);\r\n\r\n // modification: when resizing a column, also resize the next column so the table doesn't overflow\r\n if (columnIndex < tableNode.getColumnCount() - 1) {\r\n const nextColWidths = tableNode.getColWidths();\r\n if (!nextColWidths) {\r\n return;\r\n }\r\n const newNextColWidths = [...nextColWidths];\r\n const newColumnIndex = columnIndex + 1;\r\n const newNextWidth = nextColWidths[newColumnIndex];\r\n const nextWidth = Math.max(newNextWidth - widthChange, MIN_COLUMN_WIDTH);\r\n newNextColWidths[newColumnIndex] = nextWidth;\r\n tableNode.setColWidths(newNextColWidths);\r\n }\r\n },\r\n { tag: 'skip-scroll-into-view' }\r\n );\r\n },\r\n [activeCell, editor]\r\n );\r\n\r\n const mouseUpHandler = useCallback(\r\n (direction: MouseDraggingDirection) => {\r\n const handler = (event: MouseEvent) => {\r\n event.preventDefault();\r\n event.stopPropagation();\r\n\r\n if (!activeCell) {\r\n throw new Error('TableCellResizer: Expected active cell.');\r\n }\r\n\r\n if (mouseStartPosRef.current) {\r\n const { x, y } = mouseStartPosRef.current;\r\n\r\n if (activeCell === null) {\r\n return;\r\n }\r\n const zoom = calculateZoomLevel(event.target as Element);\r\n\r\n if (isHeightChanging(direction)) {\r\n const heightChange = (event.clientY - y) / zoom;\r\n updateRowHeight(heightChange);\r\n } else {\r\n const widthChange = (event.clientX - x) / zoom;\r\n updateColumnWidth(widthChange);\r\n }\r\n\r\n resetState();\r\n document.removeEventListener('mouseup', handler);\r\n }\r\n };\r\n return handler;\r\n },\r\n [activeCell, resetState, updateColumnWidth, updateRowHeight]\r\n );\r\n\r\n const toggleResize = useCallback(\r\n (direction: MouseDraggingDirection): MouseEventHandler<HTMLDivElement> =>\r\n (event) => {\r\n event.preventDefault();\r\n event.stopPropagation();\r\n\r\n if (!activeCell) {\r\n throw new Error('TableCellResizer: Expected active cell.');\r\n }\r\n\r\n mouseStartPosRef.current = {\r\n x: event.clientX,\r\n y: event.clientY,\r\n };\r\n updateMouseCurrentPos(mouseStartPosRef.current);\r\n updateDraggingDirection(direction);\r\n\r\n document.addEventListener('mouseup', mouseUpHandler(direction));\r\n },\r\n [activeCell, mouseUpHandler]\r\n );\r\n\r\n const getResizers = useCallback(() => {\r\n if (activeCell) {\r\n const { height, width, top, left } = activeCell.elem.getBoundingClientRect();\r\n const zoom = calculateZoomLevel(activeCell.elem);\r\n const zoneWidth = 10; // Pixel width of the zone where you can drag the edge\r\n const styles = {\r\n bottom: {\r\n backgroundColor: 'none',\r\n cursor: 'ns-resize',\r\n height: `${zoneWidth}px`,\r\n left: `${window.pageXOffset + left}px`,\r\n top: `${window.pageYOffset + top + height - zoneWidth / HALF}px`,\r\n width: `${width}px`,\r\n zIndex: 10,\r\n },\r\n right: {\r\n backgroundColor: 'none',\r\n cursor: 'ew-resize',\r\n height: `${height}px`,\r\n left: `${window.pageXOffset + left + width - zoneWidth / HALF}px`,\r\n top: `${window.pageYOffset + top}px`,\r\n width: `${zoneWidth}px`,\r\n zIndex: 10,\r\n },\r\n };\r\n\r\n const tableRect = tableRectRef.current;\r\n\r\n if (draggingDirection && mouseCurrentPos && tableRect) {\r\n if (isHeightChanging(draggingDirection)) {\r\n styles[draggingDirection].left = `${window.pageXOffset + tableRect.left}px`;\r\n styles[draggingDirection].top = `${window.pageYOffset + mouseCurrentPos.y / zoom}px`;\r\n styles[draggingDirection].height = '3px';\r\n styles[draggingDirection].width = `${tableRect.width}px`;\r\n } else {\r\n styles[draggingDirection].top = `${window.pageYOffset + tableRect.top}px`;\r\n styles[draggingDirection].left = `${window.pageXOffset + mouseCurrentPos.x / zoom}px`;\r\n styles[draggingDirection].width = '3px';\r\n styles[draggingDirection].height = `${tableRect.height}px`;\r\n }\r\n\r\n styles[draggingDirection].backgroundColor = '#adf';\r\n }\r\n\r\n return styles;\r\n }\r\n\r\n return {\r\n bottom: null,\r\n left: null,\r\n right: null,\r\n top: null,\r\n };\r\n }, [activeCell, draggingDirection, mouseCurrentPos]);\r\n\r\n const resizerStyles = getResizers();\r\n\r\n return (\r\n <div ref={resizerRef}>\r\n {activeCell != null && !isMouseDown && (\r\n <>\r\n <div\r\n className={styles['table-cell-resizer__resizer']}\r\n style={resizerStyles.right || undefined}\r\n onMouseDown={toggleResize('right')}\r\n />\r\n <div\r\n className={styles['table-cell-resizer__resizer']}\r\n style={resizerStyles.bottom || undefined}\r\n onMouseDown={toggleResize('bottom')}\r\n />\r\n </>\r\n )}\r\n </div>\r\n );\r\n}\r\n\r\nexport const TableCellResizerPlugin = (): null | ReactPortal => {\r\n const [editor] = useLexicalComposerContext();\r\n const isEditable = useLexicalEditable();\r\n\r\n return useMemo(\r\n () => (isEditable ? createPortal(<TableCellResizer editor={editor} />, document.body) : null),\r\n [editor, isEditable]\r\n );\r\n};\r\n"],"names":["c","n","t","u","e","a","i","l","r","d","o","MIN_ROW_HEIGHT","MIN_COLUMN_WIDTH","HALF","TableCellResizer","editor","targetRef","useRef","resizerRef","tableRectRef","mouseStartPosRef","mouseCurrentPos","updateMouseCurrentPos","useState","activeCell","updateActiveCell","isMouseDown","updateIsMouseDown","draggingDirection","updateDraggingDirection","resetState","useCallback","isMouseDownOnEvent","event","useEffect","TableNode","tableNode","tableRows","columnCount","colWidths","cell","colIdx","domCell","TableWrapperNode","wrapperNode","$createTableWrapperNode","onMouseMove","target","isHTMLElement","getDOMCellFromTarget","tableCellNode","$getNearestNodeFromDOMNode","$getTableNodeFromLexicalNodeOrThrow","tableElement","getTableElement","onMouseDown","onMouseUp","removeRootListener","rootElement","prevRootElement","isHeightChanging","direction","updateRowHeight","heightChange","$isTableCellNode","tableRowIndex","$getTableRowIndexFromTableCellNode","tableRow","$isTableRowNode","height","rowCells","getCellNodeHeight","newHeight","activeEditor","getCellColumnIndex","tableMap","row","column","updateColumnWidth","widthChange","$computeTableMapSkipCellCheck","columnIndex","width","newColWidths","newWidth","nextColWidths","newNextColWidths","newColumnIndex","newNextWidth","nextWidth","mouseUpHandler","handler","x","y","zoom","calculateZoomLevel","toggleResize","resizerStyles","top","left","zoneWidth","styles","tableRect","jsx","jsxs","Fragment","TableCellResizerPlugin","useLexicalComposerContext","isEditable","useLexicalEditable","useMemo","createPortal"],"mappings":";;;;;;;;AAQgL,MAAMA,KAAe,OAAO,SAApB,OAAqC,OAAO,aAAhB,UAAmC,OAAO,SAAS,kBAAzB,SAAuCC,IAAEC;AAAE,SAASC,GAAEC,GAAE;AAAC,SAAM,EAAC,gBAAe,MAAIA,EAAE,WAAU,GAAG,WAAU,CAAAH,MAAGG,EAAE,yBAAyBH,CAAC,EAAC;AAAC;AAAC,SAASI,KAAG;AAAC,SAAO,SAASJ,GAAE;AAAC,UAAK,CAACC,CAAC,IAAEE,EAAC,GAAGD,IAAEG,EAAG,MAAIL,EAAEC,CAAC,GAAG,CAACA,GAAED,CAAC,CAAC,GAAE,CAACI,GAAEE,CAAC,IAAEC,EAAG,MAAIL,EAAE,eAAc,CAAE,GAAGM,IAAEC,EAAEL,CAAC;AAAE,WAAOL,GAAG,MAAI;AAAC,YAAK,EAAC,gBAAeI,GAAE,WAAUH,EAAC,IAAEE,GAAED,IAAEE;AAAI,aAAOK,EAAE,YAAUP,MAAIO,EAAE,UAAQP,GAAEK,EAAEL,CAAC,IAAGD,EAAG,CAAAG,MAAG;AAAC,QAAAK,EAAE,UAAQL,GAAEG,EAAEH,CAAC;AAAA,MAAC,CAAC;AAAA,IAAE,GAAG,CAACD,GAAEF,CAAC,CAAC,GAAEI;AAAA,EAAC,EAAEF,EAAC;AAAC;;;GCmC/mBQ,KAAiB,IACjBC,IAAmB,IACnBC,IAAO;AAEb,SAASC,GAAiB,EAAE,QAAAC,KAAkD;AAC5E,QAAMC,IAAYC,EAA2B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/jsx-runtime";
2
2
  import "react";
3
3
  import "../../../../LexicalComposerContext.prod-DLlRM5wP.js";
4
- import { T } from "../../../../TableCellResizerPlugin-D6jjhYoD.js";
4
+ import { T } from "../../../../TableCellResizerPlugin-Bao8R6Lv.js";
5
5
  import "../../../../LexicalTable.prod-iqHmKv_G.js";
6
6
  import "../../../../LexicalUtils.prod-w0fZ_Z8S.js";
7
7
  import "../../../../Lexical.prod-C1B_JvcI.js";
@@ -1,4 +1,4 @@
1
- import { T as r } from "../../../../TableCellResizerPlugin-D6jjhYoD.js";
1
+ import { T as r } from "../../../../TableCellResizerPlugin-Bao8R6Lv.js";
2
2
  export {
3
3
  r as TableCellResizerPlugin
4
4
  };
@@ -5,7 +5,7 @@ import { LinkPlugin as g, getLinkNodeTag as m } from "./LinkPlugin/LinkPlugin.js
5
5
  import { HistoryPlugin as f } from "./HistoryPlugin/HistoryPlugin.js";
6
6
  import { T as u } from "../../../TablePlugin-cMMBdz-x.js";
7
7
  import { TableCellContextMenu as T } from "./TablePlugin/TableCellContextMenu/TableCellContextMenu.js";
8
- import { T as b } from "../../../TableCellResizerPlugin-D6jjhYoD.js";
8
+ import { T as b } from "../../../TableCellResizerPlugin-Bao8R6Lv.js";
9
9
  import { PasteHandlerPlugin as C } from "./PasteHandlerPlugin/PasteHandlerPlugin.js";
10
10
  export {
11
11
  t as BlockFormatPlugin,
@@ -2,8 +2,8 @@ import { jsx as h, jsxs as z, Fragment as Re } from "react/jsx-runtime";
2
2
  import { t as Ge, r as Ye, o as I } from "../../LexicalComposerContext.prod-DLlRM5wP.js";
3
3
  import { aK as Me, ah as F, B as Ie, P as p, aL as de, ao as H, x as j, W as Ve, s as M, _ as g, a0 as Ze, J as m, aM as Qe, af as Oe, d as et, t as Ke, aN as tt, aO as rt, R as nt, y as T, aG as ot, aP as at, aQ as st, aR as it, T as ee, aS as lt, aT as ut, a5 as ct, E as dt, M as ft, K as mt, aU as pt, aV as me, a as pe, N as gt, H as re, L as ht, a6 as ze, aW as ge, z as vt, w as Ct, u as yt, aX as he, D as Et, aY as wt, aZ as bt, a_ as _t, aF as St, Y as kt, X as xt, a$ as Nt, Z as Dt, G as Lt, C as $t, p as Tt, $ as ve, b0 as Pt, c as Rt, au as G, at as Y, b1 as Mt, b2 as It, aw as Ot, b3 as se, av as Kt, b4 as zt } from "../../Lexical.prod-C1B_JvcI.js";
4
4
  import * as ne from "react";
5
- import { useMemo as te, useLayoutEffect as J, useEffect as S, useState as O, Suspense as At, forwardRef as Ae, useCallback as Ft, useRef as Bt } from "react";
6
- import { a as Ut, T as Wt } from "../../TableCellResizerPlugin-D6jjhYoD.js";
5
+ import { useMemo as te, useLayoutEffect as J, useEffect as k, useState as O, Suspense as At, forwardRef as Ae, useCallback as Ft, useRef as Bt } from "react";
6
+ import { a as Ut, T as Wt } from "../../TableCellResizerPlugin-Bao8R6Lv.js";
7
7
  import { j as U, L as A, y as Ht, w as fe } from "../../LexicalUtils.prod-w0fZ_Z8S.js";
8
8
  import { flushSync as jt, createPortal as Jt } from "react-dom";
9
9
  import { A as Ce, F as ye, m as Xt, g as qt } from "../../LexicalClipboard.prod-Dd64YQH0.js";
@@ -13,10 +13,10 @@ import { g as Ue, k as be, v as oe, p as Vt, m as Zt } from "../../LexicalLink.p
13
13
  import { s as Qt, d as er, a as We, e as tr, w as rr, S as nr, y as He, O as or } from "../../LexicalTable.prod-iqHmKv_G.js";
14
14
  import { a as ar, w as sr, M as ir } from "../../helpers-BO6Gg9y6.js";
15
15
  import { c as lr } from "../../clsx-OuTLNxxd.js";
16
- import { exportMap as ur, isStartingWithHtmlTag as cr, mergeBoldStrongTags as dr } from "./helpers.js";
16
+ import { exportMap as ur, isStartingWithHtmlTag as cr, mergeBoldStrongTags as dr, cleanUpTable as fr } from "./helpers.js";
17
17
  import { s as R } from "../../RteEditor.module-dE9wQTC9.js";
18
- import { ToolBarPlugin as fr } from "./Plugins/ToolbarPlugin/ToolbarPlugin.js";
19
- import { useTranslation as mr } from "./hooks/useTranslation.js";
18
+ import { ToolBarPlugin as mr } from "./Plugins/ToolbarPlugin/ToolbarPlugin.js";
19
+ import { useTranslation as pr } from "./hooks/useTranslation.js";
20
20
  import "../../TablePlugin-cMMBdz-x.js";
21
21
  import "./Plugins/LinkPlugin/LinkContextMenu/LinkContextMenu.js";
22
22
  import "./hooks/components/Flyout.js";
@@ -25,7 +25,7 @@ import "../Buttons/Button.js";
25
25
  import "../Buttons/LinkButton.js";
26
26
  import "@react-aria/button";
27
27
  import "../Checkbox/Checkbox.js";
28
- import { FeedbackBox as pr } from "../FeedbackBox/FeedbackBox.js";
28
+ import { FeedbackBox as gr } from "../FeedbackBox/FeedbackBox.js";
29
29
  import "@react-aria/dialog";
30
30
  import "@react-aria/focus";
31
31
  import "@react-aria/overlays";
@@ -39,13 +39,13 @@ import "../SelectListbox/SelectListbox.js";
39
39
  import "../SelectListbox/SelectProvider.js";
40
40
  import "../Sortable/components/SortableItem.js";
41
41
  import "../../SortableProvider-l8-7ClBJ.js";
42
- import { PasteHandlerPlugin as gr } from "./Plugins/PasteHandlerPlugin/PasteHandlerPlugin.js";
43
- import { UvaTheme as hr } from "./UvaTheme/UvaTheme.js";
44
- import { EditorHeader as vr } from "./EditorHeader/EditorHeader.js";
45
- import { LanguageProvider as Cr, useLanguage as yr } from "./Providers/LanguageProvider.js";
46
- import { TableWrapperNode as Er } from "./nodes/TableWrapperNode/TableWrapperNode.js";
47
- const je = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, wr = je ? J : S, V = { tag: de };
48
- function br({ initialConfig: r, children: e }) {
42
+ import { PasteHandlerPlugin as hr } from "./Plugins/PasteHandlerPlugin/PasteHandlerPlugin.js";
43
+ import { UvaTheme as vr } from "./UvaTheme/UvaTheme.js";
44
+ import { EditorHeader as Cr } from "./EditorHeader/EditorHeader.js";
45
+ import { LanguageProvider as yr, useLanguage as Er } from "./Providers/LanguageProvider.js";
46
+ import { TableWrapperNode as wr } from "./nodes/TableWrapperNode/TableWrapperNode.js";
47
+ const je = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, br = je ? J : k, V = { tag: de };
48
+ function _r({ initialConfig: r, children: e }) {
49
49
  const t = te(() => {
50
50
  const { theme: o, namespace: a, nodes: n, onError: s, editorState: i, html: l } = r, c = Ge(null, o), u = Me({ editable: r.editable, html: l, namespace: a, nodes: n, onError: (d) => s(d, u), theme: o });
51
51
  return function(d, f) {
@@ -76,21 +76,21 @@ function br({ initialConfig: r, children: e }) {
76
76
  }
77
77
  }(u, i), [u, c];
78
78
  }, []);
79
- return wr(() => {
79
+ return br(() => {
80
80
  const o = r.editable, [a] = t;
81
81
  a.setEditable(o === void 0 || o);
82
82
  }, []), h(Ye.Provider, { value: t, children: e });
83
83
  }
84
- function _r() {
84
+ function Sr() {
85
85
  return F().getTextContent();
86
86
  }
87
- function Sr(r, e = !0) {
87
+ function kr(r, e = !0) {
88
88
  if (r) return !1;
89
- let t = _r();
89
+ let t = Sr();
90
90
  return e && (t = t.trim()), t === "";
91
91
  }
92
- function kr(r) {
93
- if (!Sr(r, !1)) return !1;
92
+ function xr(r) {
93
+ if (!kr(r, !1)) return !1;
94
94
  const e = F().getChildren(), t = e.length;
95
95
  if (t > 1) return !1;
96
96
  for (let o = 0; o < t; o++) {
@@ -108,9 +108,9 @@ function kr(r) {
108
108
  return !0;
109
109
  }
110
110
  function Je(r) {
111
- return () => kr(r);
111
+ return () => xr(r);
112
112
  }
113
- function xr(r) {
113
+ function Nr(r) {
114
114
  const e = window.location.origin, t = (o) => {
115
115
  if (o.origin !== e) return;
116
116
  const a = r.getRootElement();
@@ -162,7 +162,7 @@ function _e(r, e) {
162
162
  }
163
163
  return null;
164
164
  }
165
- const W = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, Nr = W && "documentMode" in document ? document.documentMode : null, Dr = !(!W || !("InputEvent" in window) || Nr) && "getTargetRanges" in new window.InputEvent("input"), Lr = W && /Version\/[\d.]+.*Safari/.test(navigator.userAgent), Se = W && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream, $r = W && /^(?=.*Chrome).*/i.test(navigator.userAgent), Tr = W && /AppleWebKit\/[\d.]+/.test(navigator.userAgent) && !$r, ke = et("DRAG_DROP_PASTE_FILE");
165
+ const W = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, Dr = W && "documentMode" in document ? document.documentMode : null, Lr = !(!W || !("InputEvent" in window) || Dr) && "getTargetRanges" in new window.InputEvent("input"), $r = W && /Version\/[\d.]+.*Safari/.test(navigator.userAgent), Se = W && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream, Tr = W && /^(?=.*Chrome).*/i.test(navigator.userAgent), Pr = W && /AppleWebKit\/[\d.]+/.test(navigator.userAgent) && !Tr, ke = et("DRAG_DROP_PASTE_FILE");
166
166
  function Z(r) {
167
167
  let e = null;
168
168
  if (A(r, DragEvent) ? e = r.dataTransfer : A(r, ClipboardEvent) && (e = r.clipboardData), e === null) return [!1, [], !1];
@@ -190,7 +190,7 @@ function Ne(r) {
190
190
  function ae(r) {
191
191
  for (const e of ["lowercase", "uppercase", "capitalize"]) r.hasFormat(e) && r.toggleFormat(e);
192
192
  }
193
- function Pr(r) {
193
+ function Rr(r) {
194
194
  return U(r.registerCommand(Tt, (e) => {
195
195
  const t = p();
196
196
  return !!T(t) && (t.clear(), !0);
@@ -312,7 +312,7 @@ function Pr(r) {
312
312
  const t = p();
313
313
  if (!g(t)) return !1;
314
314
  if (ae(t), e !== null) {
315
- if ((Se || Lr || Tr) && Dr) return !1;
315
+ if ((Se || $r || Pr) && Lr) return !1;
316
316
  if (e.preventDefault(), e.shiftKey) return r.dispatchCommand(me, !1);
317
317
  }
318
318
  return r.dispatchCommand(pe, void 0);
@@ -374,18 +374,18 @@ function Pr(r) {
374
374
  return g(t) && ae(t), !1;
375
375
  }, m));
376
376
  }
377
- const ie = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? J : S;
377
+ const ie = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? J : k;
378
378
  function De(r) {
379
379
  return r.getEditorState().read(Je(r.isComposing()));
380
380
  }
381
- function Rr({ contentEditable: r, placeholder: e = null, ErrorBoundary: t }) {
381
+ function Mr({ contentEditable: r, placeholder: e = null, ErrorBoundary: t }) {
382
382
  const [o] = I(), a = function(n, s) {
383
383
  const [i, l] = O(() => n.getDecorators());
384
384
  return ie(() => n.registerDecoratorListener((c) => {
385
385
  jt(() => {
386
386
  l(c);
387
387
  });
388
- }), [n]), S(() => {
388
+ }), [n]), k(() => {
389
389
  l(n.getDecorators());
390
390
  }, [n]), te(() => {
391
391
  const c = [], u = Object.keys(i);
@@ -397,10 +397,10 @@ function Rr({ contentEditable: r, placeholder: e = null, ErrorBoundary: t }) {
397
397
  }, [s, i, n]);
398
398
  }(o, t);
399
399
  return function(n) {
400
- ie(() => U(Pr(n), xr(n)), [n]);
401
- }(o), z(Re, { children: [r, h(Mr, { content: e }), a] });
400
+ ie(() => U(Rr(n), Nr(n)), [n]);
401
+ }(o), z(Re, { children: [r, h(Ir, { content: e }), a] });
402
402
  }
403
- function Mr({ content: r }) {
403
+ function Ir({ content: r }) {
404
404
  const [e] = I(), t = function(a) {
405
405
  const [n, s] = O(() => De(a));
406
406
  return ie(() => {
@@ -417,9 +417,9 @@ function Mr({ content: r }) {
417
417
  }(e), o = Ut();
418
418
  return t ? typeof r == "function" ? r(o) : r : null;
419
419
  }
420
- const Xe = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? J : S;
421
- function Ir({ editor: r, ariaActiveDescendant: e, ariaAutoComplete: t, ariaControls: o, ariaDescribedBy: a, ariaErrorMessage: n, ariaExpanded: s, ariaInvalid: i, ariaLabel: l, ariaLabelledBy: c, ariaMultiline: u, ariaOwns: d, ariaRequired: f, autoCapitalize: v, className: C, id: w, role: x = "textbox", spellCheck: y = !0, style: E, tabIndex: _, "data-testid": N, ...b }, D) {
422
- const [k, P] = O(r.isEditable()), K = Ft((L) => {
420
+ const Xe = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? J : k;
421
+ function Or({ editor: r, ariaActiveDescendant: e, ariaAutoComplete: t, ariaControls: o, ariaDescribedBy: a, ariaErrorMessage: n, ariaExpanded: s, ariaInvalid: i, ariaLabel: l, ariaLabelledBy: c, ariaMultiline: u, ariaOwns: d, ariaRequired: f, autoCapitalize: v, className: C, id: w, role: x = "textbox", spellCheck: y = !0, style: E, tabIndex: _, "data-testid": N, ...b }, D) {
422
+ const [S, P] = O(r.isEditable()), K = Ft((L) => {
423
423
  L && L.ownerDocument && L.ownerDocument.defaultView ? r.setRootElement(L) : r.setRootElement(null);
424
424
  }, [r]), B = te(() => /* @__PURE__ */ function(...L) {
425
425
  return (X) => {
@@ -430,18 +430,18 @@ function Ir({ editor: r, ariaActiveDescendant: e, ariaAutoComplete: t, ariaContr
430
430
  }(D, K), [K, D]);
431
431
  return Xe(() => (P(r.isEditable()), r.registerEditableListener((L) => {
432
432
  P(L);
433
- })), [r]), h("div", { "aria-activedescendant": k ? e : void 0, "aria-autocomplete": k ? t : "none", "aria-controls": k ? o : void 0, "aria-describedby": a, ...n != null ? { "aria-errormessage": n } : {}, "aria-expanded": k && x === "combobox" ? !!s : void 0, ...i != null ? { "aria-invalid": i } : {}, "aria-label": l, "aria-labelledby": c, "aria-multiline": u, "aria-owns": k ? d : void 0, "aria-readonly": !k || void 0, "aria-required": f, autoCapitalize: v, className: C, contentEditable: k, "data-testid": N, id: w, ref: B, role: x, spellCheck: y, style: E, tabIndex: _, ...b });
433
+ })), [r]), h("div", { "aria-activedescendant": S ? e : void 0, "aria-autocomplete": S ? t : "none", "aria-controls": S ? o : void 0, "aria-describedby": a, ...n != null ? { "aria-errormessage": n } : {}, "aria-expanded": S && x === "combobox" ? !!s : void 0, ...i != null ? { "aria-invalid": i } : {}, "aria-label": l, "aria-labelledby": c, "aria-multiline": u, "aria-owns": S ? d : void 0, "aria-readonly": !S || void 0, "aria-required": f, autoCapitalize: v, className: C, contentEditable: S, "data-testid": N, id: w, ref: B, role: x, spellCheck: y, style: E, tabIndex: _, ...b });
434
434
  }
435
- const Or = Ae(Ir);
435
+ const Kr = Ae(Or);
436
436
  function Le(r) {
437
437
  return r.getEditorState().read(Je(r.isComposing()));
438
438
  }
439
- const Kr = Ae(zr);
440
- function zr(r, e) {
439
+ const zr = Ae(Ar);
440
+ function Ar(r, e) {
441
441
  const { placeholder: t, ...o } = r, [a] = I();
442
- return z(Re, { children: [h(Or, { editor: a, ...o, ref: e }), t != null && h(Ar, { editor: a, content: t })] });
442
+ return z(Re, { children: [h(Kr, { editor: a, ...o, ref: e }), t != null && h(Fr, { editor: a, content: t })] });
443
443
  }
444
- function Ar({ content: r, editor: e }) {
444
+ function Fr({ content: r, editor: e }) {
445
445
  const t = function(s) {
446
446
  const [i, l] = O(() => Le(s));
447
447
  return Xe(() => {
@@ -467,7 +467,7 @@ function le(r, e) {
467
467
  return t.__proto__ = o, t;
468
468
  }, le(r, e);
469
469
  }
470
- var $e = { error: null }, Fr = function(r) {
470
+ var $e = { error: null }, Br = function(r) {
471
471
  var e, t;
472
472
  function o() {
473
473
  for (var n, s = arguments.length, i = new Array(s), l = 0; l < s; l++) i[l] = arguments[l];
@@ -502,31 +502,31 @@ var $e = { error: null }, Fr = function(r) {
502
502
  return this.props.children;
503
503
  }, o;
504
504
  }(ne.Component);
505
- function Br({ children: r, onError: e }) {
506
- return h(Fr, { fallback: h("div", { style: { border: "1px solid #f00", color: "#f00", padding: "8px" }, children: "An error was thrown." }), onError: e, children: r });
505
+ function Ur({ children: r, onError: e }) {
506
+ return h(Br, { fallback: h("div", { style: { border: "1px solid #f00", color: "#f00", padding: "8px" }, children: "An error was thrown." }), onError: e, children: r });
507
507
  }
508
- const Ur = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? J : S;
509
- function Wr({ ignoreHistoryMergeTagChange: r = !0, ignoreSelectionChange: e = !1, onChange: t }) {
508
+ const Wr = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? J : k;
509
+ function Hr({ ignoreHistoryMergeTagChange: r = !0, ignoreSelectionChange: e = !1, onChange: t }) {
510
510
  const [o] = I();
511
- return Ur(() => {
511
+ return Wr(() => {
512
512
  if (t) return o.registerUpdateListener(({ editorState: a, dirtyElements: n, dirtyLeaves: s, prevEditorState: i, tags: l }) => {
513
513
  e && n.size === 0 && s.size === 0 || r && l.has(de) || i.isEmpty() || t(a, o, l);
514
514
  });
515
515
  }, [o, r, e, t]), null;
516
516
  }
517
- function Hr({ hasStrictIndent: r = !1 }) {
517
+ function jr({ hasStrictIndent: r = !1 }) {
518
518
  const [e] = I();
519
- return S(() => {
519
+ return k(() => {
520
520
  if (!e.hasNodes([Fe, Be])) throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor");
521
- }, [e]), S(() => {
521
+ }, [e]), k(() => {
522
522
  if (r) return Gt(e);
523
523
  }, [e, r]), function(t) {
524
- S(() => Yt(t), [t]);
524
+ k(() => Yt(t), [t]);
525
525
  }(e), null;
526
526
  }
527
- function jr({ validateUrl: r, attributes: e }) {
527
+ function Jr({ validateUrl: r, attributes: e }) {
528
528
  const [t] = I();
529
- return S(() => {
529
+ return k(() => {
530
530
  if (!t.hasNodes([Ue])) throw new Error("LinkPlugin: LinkNode not registered on editor");
531
531
  return U(t.registerCommand(be, (o) => {
532
532
  if (o === null) return oe(o), !0;
@@ -544,9 +544,9 @@ function jr({ validateUrl: r, attributes: e }) {
544
544
  });
545
545
  }, [t, r, e]), null;
546
546
  }
547
- function Jr({ newTab: r = !0, disabled: e = !1 }) {
547
+ function Xr({ newTab: r = !0, disabled: e = !1 }) {
548
548
  const [t] = I();
549
- return S(() => {
549
+ return k(() => {
550
550
  const o = (n) => {
551
551
  const s = n.target;
552
552
  if (!Ke(s)) return;
@@ -583,20 +583,20 @@ function Jr({ newTab: r = !0, disabled: e = !1 }) {
583
583
  });
584
584
  }, [t, r, e]), null;
585
585
  }
586
- const Q = 0, ue = 1, ce = 2, $ = 0, Xr = 1, Te = 2, qr = 3, Gr = 4;
587
- function Yr(r, e, t, o, a) {
586
+ const Q = 0, ue = 1, ce = 2, $ = 0, qr = 1, Te = 2, Gr = 3, Yr = 4;
587
+ function Vr(r, e, t, o, a) {
588
588
  if (r === null || t.size === 0 && o.size === 0 && !a) return $;
589
589
  const n = e._selection, s = r._selection;
590
- if (a) return Xr;
590
+ if (a) return qr;
591
591
  if (!(g(n) && g(s) && s.isCollapsed() && n.isCollapsed())) return $;
592
592
  const i = function(y, E, _) {
593
593
  const N = y._nodeMap, b = [];
594
594
  for (const D of E) {
595
- const k = N.get(D);
596
- k !== void 0 && b.push(k);
595
+ const S = N.get(D);
596
+ S !== void 0 && b.push(S);
597
597
  }
598
- for (const [D, k] of _) {
599
- if (!k) continue;
598
+ for (const [D, S] of _) {
599
+ if (!S) continue;
600
600
  const P = N.get(D);
601
601
  P === void 0 || ze(P) || b.push(P);
602
602
  }
@@ -614,14 +614,14 @@ function Yr(r, e, t, o, a) {
614
614
  const f = n.anchor, v = s.anchor;
615
615
  if (f.key !== v.key || f.type !== "text") return $;
616
616
  const C = f.offset, w = v.offset, x = d.length - u.length;
617
- return x === 1 && w === C - 1 ? Te : x === -1 && w === C + 1 ? qr : x === -1 && w === C ? Gr : $;
617
+ return x === 1 && w === C - 1 ? Te : x === -1 && w === C + 1 ? Gr : x === -1 && w === C ? Yr : $;
618
618
  }
619
- function Vr(r, e) {
619
+ function Zr(r, e) {
620
620
  let t = Date.now(), o = $;
621
621
  return (a, n, s, i, l, c) => {
622
622
  const u = Date.now();
623
623
  if (c.has(se)) return o = $, t = u, ce;
624
- const d = Yr(a, n, i, l, r.isComposing()), f = (() => {
624
+ const d = Vr(a, n, i, l, r.isComposing()), f = (() => {
625
625
  const v = s === null || s.editor === r, C = c.has(zt);
626
626
  if (!C && v && c.has(de)) return Q;
627
627
  if (a === null) return ue;
@@ -637,8 +637,8 @@ function Vr(r, e) {
637
637
  function Pe(r) {
638
638
  r.undoStack = [], r.redoStack = [], r.current = null;
639
639
  }
640
- function Zr(r, e, t) {
641
- const o = Vr(r, t);
640
+ function Qr(r, e, t) {
641
+ const o = Zr(r, t);
642
642
  return U(r.registerCommand(Kt, () => (function(n, s) {
643
643
  const i = s.redoStack, l = s.undoStack;
644
644
  if (l.length !== 0) {
@@ -662,30 +662,30 @@ function Zr(r, e, t) {
662
662
  e.current = { editor: r, editorState: n };
663
663
  }));
664
664
  }
665
- function Qr() {
665
+ function en() {
666
666
  return { current: null, redoStack: [], undoStack: [] };
667
667
  }
668
- function en({ delay: r, externalHistoryState: e }) {
668
+ function tn({ delay: r, externalHistoryState: e }) {
669
669
  const [t] = I();
670
670
  return function(o, a, n = 1e3) {
671
- const s = te(() => a || Qr(), [a]);
672
- S(() => Zr(o, s, n), [n, o, s]);
671
+ const s = te(() => a || en(), [a]);
672
+ k(() => Qr(o, s, n), [n, o, s]);
673
673
  }(t, e, r), null;
674
674
  }
675
- function tn({ hasCellMerge: r = !0, hasCellBackgroundColor: e = !0, hasTabHandler: t = !0, hasHorizontalScroll: o = !1 }) {
675
+ function rn({ hasCellMerge: r = !0, hasCellBackgroundColor: e = !0, hasTabHandler: t = !0, hasHorizontalScroll: o = !1 }) {
676
676
  const [a] = I();
677
- return S(() => {
677
+ return k(() => {
678
678
  Qt(a) !== o && (er(a, o), a.registerNodeTransform(We, () => {
679
679
  })());
680
- }, [a, o]), S(() => tr(a), [a]), S(() => rr(a, t), [a, t]), S(() => {
680
+ }, [a, o]), k(() => tr(a), [a]), k(() => rr(a, t), [a, t]), k(() => {
681
681
  if (!r) return nr(a);
682
- }, [a, r]), S(() => {
682
+ }, [a, r]), k(() => {
683
683
  if (!e) return a.registerNodeTransform(He, (n) => {
684
684
  n.getBackgroundColor() !== null && n.setBackgroundColor(null);
685
685
  });
686
686
  }, [a, e, r]), null;
687
687
  }
688
- const qe = 200, rn = ({
688
+ const qe = 200, nn = ({
689
689
  currentLanguage: r = "NL",
690
690
  initialValue: e = "",
691
691
  placeholder: t = "",
@@ -697,19 +697,19 @@ const qe = 200, rn = ({
697
697
  maxWords: l = qe,
698
698
  onChange: c
699
699
  }) => {
700
- const { switchLanguage: u } = yr(), d = mr(), [f] = O(() => Me()), [v, C] = O(0), [w, x] = O(0), y = Bt(null), E = {
700
+ const { switchLanguage: u } = Er(), d = pr(), [f] = O(() => Me()), [v, C] = O(0), [w, x] = O(0), y = Bt(null), E = {
701
701
  html: {
702
702
  export: ur
703
703
  },
704
704
  namespace: "UvaRte",
705
705
  editor: f,
706
- theme: hr,
706
+ theme: vr,
707
707
  onError(b) {
708
708
  throw b;
709
709
  },
710
- nodes: [Fe, Be, Ue, Zt, He, or, We, Er],
710
+ nodes: [Fe, Be, Ue, Zt, He, or, We, wr],
711
711
  editorState: (b) => {
712
- const k = new DOMParser().parseFromString(e, "text/html"), P = Xt(b, k), K = F();
712
+ const S = new DOMParser().parseFromString(e, "text/html"), P = Xt(b, S), K = F();
713
713
  if (K.clear(), cr(e))
714
714
  P.forEach((B) => {
715
715
  K.append(B);
@@ -723,32 +723,32 @@ const qe = 200, rn = ({
723
723
  }
724
724
  }, _ = (b) => b.trim().length === 0 ? 0 : b.split(" ").length, N = (b, D) => {
725
725
  b.read(() => {
726
- let k = "";
727
- C(_(F().getTextContent().replace(/\s+/g, " ").trim())), k = dr(qt(D)), c(k);
726
+ let S = "";
727
+ C(_(F().getTextContent().replace(/\s+/g, " ").trim())), S = dr(qt(D)), S = fr(S), c(S);
728
728
  });
729
729
  };
730
- return S(() => {
730
+ return k(() => {
731
731
  u(r.toLocaleLowerCase());
732
- }, [r, u]), S(() => {
732
+ }, [r, u]), k(() => {
733
733
  const b = e.replace(/<br\s*\/?>|&nbsp;/gi, " ").replace(/<\/?[^>]+(>|$)|&[a-z]+;/g, "").replace(/\s+/g, " ").trim();
734
734
  C(_(b));
735
735
  }, []), /* @__PURE__ */ z("div", { className: R.editor__container, children: [
736
736
  /* @__PURE__ */ z("div", { className: R.editor__header, children: [
737
- /* @__PURE__ */ h(vr, { label: o, info: a, required: n }),
737
+ /* @__PURE__ */ h(Cr, { label: o, info: a, required: n }),
738
738
  /* @__PURE__ */ z("div", { className: R["editor__header-word-count"], children: [
739
739
  /* @__PURE__ */ h("span", { className: lr({ [R["editor__header-word-count--alert"]]: v > l }), children: v }),
740
740
  " / ",
741
741
  l
742
742
  ] })
743
743
  ] }),
744
- /* @__PURE__ */ h("div", { className: R.editor, children: /* @__PURE__ */ z(br, { initialConfig: E, children: [
745
- /* @__PURE__ */ h(fr, { editorScrollPosition: w }),
744
+ /* @__PURE__ */ h("div", { className: R.editor, children: /* @__PURE__ */ z(_r, { initialConfig: E, children: [
745
+ /* @__PURE__ */ h(mr, { editorScrollPosition: w }),
746
746
  /* @__PURE__ */ z("div", { className: R["editor__field-wrapper"], children: [
747
747
  /* @__PURE__ */ h(
748
- Rr,
748
+ Mr,
749
749
  {
750
750
  contentEditable: /* @__PURE__ */ h(
751
- Kr,
751
+ zr,
752
752
  {
753
753
  className: R.editor__field,
754
754
  "aria-label": d.common.rteAriaLabel,
@@ -763,23 +763,23 @@ const qe = 200, rn = ({
763
763
  }
764
764
  ),
765
765
  placeholder: /* @__PURE__ */ h("div", { className: R.editor__placeholder, children: t }),
766
- ErrorBoundary: Br
766
+ ErrorBoundary: Ur
767
767
  }
768
768
  ),
769
- /* @__PURE__ */ h(tn, {}),
769
+ /* @__PURE__ */ h(rn, {}),
770
770
  /* @__PURE__ */ h(Wt, {}),
771
- /* @__PURE__ */ h(en, {}),
772
- /* @__PURE__ */ h(Hr, {}),
773
- /* @__PURE__ */ h(jr, { validateUrl: ar }),
771
+ /* @__PURE__ */ h(tn, {}),
772
+ /* @__PURE__ */ h(jr, {}),
773
+ /* @__PURE__ */ h(Jr, { validateUrl: ar }),
774
774
  /* @__PURE__ */ h(sr, { matchers: ir }),
775
- /* @__PURE__ */ h(Jr, {}),
776
- /* @__PURE__ */ h(Wr, { onChange: N }),
777
- /* @__PURE__ */ h(gr, {})
775
+ /* @__PURE__ */ h(Xr, {}),
776
+ /* @__PURE__ */ h(Hr, { onChange: N }),
777
+ /* @__PURE__ */ h(hr, {})
778
778
  ] })
779
779
  ] }) }),
780
- s !== "" && /* @__PURE__ */ h(pr, { level: "error", feedback: s })
780
+ s !== "" && /* @__PURE__ */ h(gr, { level: "error", feedback: s })
781
781
  ] });
782
- }, Gn = ({
782
+ }, Yn = ({
783
783
  currentLanguage: r = "NL",
784
784
  initialValue: e = "",
785
785
  placeholder: t = "",
@@ -789,8 +789,8 @@ const qe = 200, rn = ({
789
789
  notValidatedText: s = "",
790
790
  maxWords: i = qe,
791
791
  onChange: l
792
- }) => /* @__PURE__ */ h(Cr, { children: /* @__PURE__ */ h(
793
- rn,
792
+ }) => /* @__PURE__ */ h(yr, { children: /* @__PURE__ */ h(
793
+ nn,
794
794
  {
795
795
  currentLanguage: r,
796
796
  initialValue: e,
@@ -804,7 +804,7 @@ const qe = 200, rn = ({
804
804
  }
805
805
  ) });
806
806
  export {
807
- rn as Rte,
808
- Gn as RteEditor
807
+ nn as Rte,
808
+ Yn as RteEditor
809
809
  };
810
810
  //# sourceMappingURL=RteEditor.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RteEditor.js","sources":["../../../node_modules/@lexical/react/LexicalComposer.prod.mjs","../../../node_modules/@lexical/text/LexicalText.prod.mjs","../../../node_modules/@lexical/dragon/LexicalDragon.prod.mjs","../../../node_modules/@lexical/rich-text/LexicalRichText.prod.mjs","../../../node_modules/@lexical/react/LexicalRichTextPlugin.prod.mjs","../../../node_modules/@lexical/react/LexicalContentEditable.prod.mjs","../../../node_modules/@lexical/react/LexicalErrorBoundary.prod.mjs","../../../node_modules/@lexical/react/LexicalOnChangePlugin.prod.mjs","../../../node_modules/@lexical/react/LexicalListPlugin.prod.mjs","../../../node_modules/@lexical/react/LexicalLinkPlugin.prod.mjs","../../../node_modules/@lexical/react/LexicalClickableLinkPlugin.prod.mjs","../../../node_modules/@lexical/history/LexicalHistory.prod.mjs","../../../node_modules/@lexical/react/LexicalHistoryPlugin.prod.mjs","../../../node_modules/@lexical/react/LexicalTablePlugin.prod.mjs","../../../src/components/RteEditor/RteEditor.tsx"],"sourcesContent":["/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport{createLexicalComposerContext as e,LexicalComposerContext as t}from\"@lexical/react/LexicalComposerContext\";import{createEditor as o,$getRoot as n,$createParagraphNode as i,$getSelection as r,HISTORY_MERGE_TAG as a}from\"lexical\";import{useLayoutEffect as c,useEffect as l,useMemo as d}from\"react\";import{jsx as s}from\"react/jsx-runtime\";const m=\"undefined\"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,u=m?c:l,p={tag:a};function f({initialConfig:a,children:c}){const l=d((()=>{const{theme:t,namespace:c,nodes:l,onError:d,editorState:s,html:u}=a,f=e(null,t),E=o({editable:a.editable,html:u,namespace:c,nodes:l,onError:e=>d(e,E),theme:t});return function(e,t){if(null===t)return;if(void 0===t)e.update((()=>{const t=n();if(t.isEmpty()){const o=i();t.append(o);const n=m?document.activeElement:null;(null!==r()||null!==n&&n===e.getRootElement())&&o.select()}}),p);else if(null!==t)switch(typeof t){case\"string\":{const o=e.parseEditorState(t);e.setEditorState(o,p);break}case\"object\":e.setEditorState(t,p);break;case\"function\":e.update((()=>{n().isEmpty()&&t(e)}),p)}}(E,s),[E,f]}),[]);return u((()=>{const e=a.editable,[t]=l;t.setEditable(void 0===e||e)}),[]),s(t.Provider,{value:l,children:c})}export{f as LexicalComposer};\n","/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport{$getRoot as t,$isDecoratorNode as e,$isElementNode as n,$isParagraphNode as r,$isTextNode as i,TextNode as o,$createTextNode as l}from\"lexical\";function s(){return t().getTextContent()}function f(t,e=!0){if(t)return!1;let n=s();return e&&(n=n.trim()),\"\"===n}function u(t,e){return()=>f(t,e)}function c(o){if(!f(o,!1))return!1;const l=t().getChildren(),s=l.length;if(s>1)return!1;for(let t=0;t<s;t++){const o=l[t];if(e(o))return!1;if(n(o)){if(!r(o))return!1;if(0!==o.__indent)return!1;const e=o.getChildren(),n=e.length;for(let r=0;r<n;r++){const n=e[t];if(!i(n))return!1}}}return!0}function g(t){return()=>c(t)}function a(t,e){let r=t.getFirstChild(),o=0;t:for(;null!==r;){if(n(r)){const t=r.getFirstChild();if(null!==t){r=t;continue}}else if(i(r)){const t=r.getTextContentSize();if(o+t>e)return{node:r,offset:e-o};o+=t}const t=r.getNextSibling();if(null!==t){r=t;continue}let l=r.getParent();for(;null!==l;){const t=l.getNextSibling();if(null!==t){r=t;continue t}l=l.getParent()}break}return null}function d(t,...e){const n=new URL(\"https://lexical.dev/docs/error\"),r=new URLSearchParams;r.append(\"code\",t);for(const t of e)r.append(\"v\",t);throw n.search=r.toString(),Error(`Minified Lexical error #${t}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function x(t,e,n,r){const s=t=>t instanceof n,f=t=>{const e=l(t.getTextContent());e.setFormat(t.getFormat()),t.replace(e)};return[t.registerNodeTransform(o,(t=>{if(!t.isSimpleText())return;let n,o=t.getPreviousSibling(),l=t.getTextContent(),u=t;if(i(o)){const n=o.getTextContent(),r=e(n+l);if(s(o)){if(null===r||0!==(t=>t.getLatest().__mode)(o))return void f(o);{const e=r.end-n.length;if(e>0){const r=n+l.slice(0,e);if(o.select(),o.setTextContent(r),e===l.length)t.remove();else{const n=l.slice(e);t.setTextContent(n)}return}}}else if(null===r||r.start<n.length)return}let c=0;for(;;){n=e(l);let t,g=null===n?\"\":l.slice(n.end);if(l=g,\"\"===g){const t=u.getNextSibling();if(i(t)){g=u.getTextContent()+t.getTextContent();const n=e(g);if(null===n)return void(s(t)?f(t):t.markDirty());if(0!==n.start)return}}if(null===n)return;if(0===n.start&&i(o)&&o.isTextEntity()){c+=n.end;continue}0===n.start?[t,u]=u.splitText(n.end):[,t,u]=u.splitText(n.start+c,n.end+c),void 0===t&&d(165,\"nodeToReplace\");const a=r(t);if(a.setFormat(t.getFormat()),t.replace(a),null==u)return;c=0,o=a}})),t.registerNodeTransform(n,(t=>{const n=t.getTextContent(),r=e(n);if(null===r||0!==r.start)return void f(t);if(n.length>r.end)return void t.splitText(r.end);const o=t.getPreviousSibling();i(o)&&o.isTextEntity()&&(f(o),f(t));const l=t.getNextSibling();i(l)&&l.isTextEntity()&&(f(l),s(t)&&f(t))}))]}export{c as $canShowPlaceholder,g as $canShowPlaceholderCurry,a as $findTextIntersectionFromCharacters,f as $isRootTextContentEmpty,u as $isRootTextContentEmptyCurry,s as $rootTextContent,x as registerLexicalTextEntity};\n","/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport{$getSelection as e,$isRangeSelection as t,$isTextNode as n}from\"lexical\";function o(o){const i=window.location.origin,a=a=>{if(a.origin!==i)return;const r=o.getRootElement();if(document.activeElement!==r)return;const s=a.data;if(\"string\"==typeof s){let i;try{i=JSON.parse(s)}catch(e){return}if(i&&\"nuanria_messaging\"===i.protocol&&\"request\"===i.type){const r=i.payload;if(r&&\"makeChanges\"===r.functionId){const i=r.args;if(i){const[r,s,c,g,d,f]=i;o.update((()=>{const o=e();if(t(o)){const e=o.anchor;let t=e.getNode(),i=0,f=0;if(n(t)&&r>=0&&s>=0&&(i=r,f=r+s,o.setTextNodeRange(t,i,t,f)),i===f&&\"\"===c||(o.insertRawText(c),t=e.getNode()),n(t)){i=g,f=g+d;const e=t.getTextContentSize();i=i>e?e:i,f=f>e?e:f,o.setTextNodeRange(t,i,t,f)}a.stopImmediatePropagation()}}))}}}}};return window.addEventListener(\"message\",a,!0),()=>{window.removeEventListener(\"message\",a,!0)}}export{o as registerDragonSupport};\n","/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport{$insertDataTransferForRichText as t,copyToClipboard as e}from\"@lexical/clipboard\";import{$shouldOverrideDefaultCharacterSelection as n,$moveCharacter as r}from\"@lexical/selection\";import{addClassNamesToElement as o,isHTMLElement as i,objectKlassEquals as s,mergeRegister as a,$findMatchingParent as c,$getNearestBlockElementAncestorOrThrow as u}from\"@lexical/utils\";import{createCommand as l,ElementNode as d,$createParagraphNode as m,$applyNodeReplacement as f,setNodeIndentFromDOM as g,CLICK_COMMAND as p,$getSelection as h,$isNodeSelection as C,COMMAND_PRIORITY_EDITOR as v,DELETE_CHARACTER_COMMAND as y,$isRangeSelection as D,DELETE_WORD_COMMAND as x,DELETE_LINE_COMMAND as w,CONTROLLED_TEXT_INSERTION_COMMAND as N,REMOVE_TEXT_COMMAND as E,FORMAT_TEXT_COMMAND as O,FORMAT_ELEMENT_COMMAND as T,$isElementNode as _,INSERT_LINE_BREAK_COMMAND as A,INSERT_PARAGRAPH_COMMAND as F,INSERT_TAB_COMMAND as S,$insertNodes as I,$createTabNode as P,INDENT_CONTENT_COMMAND as M,OUTDENT_CONTENT_COMMAND as b,KEY_ARROW_UP_COMMAND as K,$getAdjacentNode as k,$isDecoratorNode as J,KEY_ARROW_DOWN_COMMAND as L,KEY_ARROW_LEFT_COMMAND as R,KEY_ARROW_RIGHT_COMMAND as W,KEY_BACKSPACE_COMMAND as z,KEY_DELETE_COMMAND as q,KEY_ENTER_COMMAND as X,KEY_ESCAPE_COMMAND as Y,DROP_COMMAND as B,$getNearestNodeFromDOMNode as G,$createRangeSelection as V,$isTextNode as j,$normalizeSelection__EXPERIMENTAL as H,$setSelection as Q,DRAGSTART_COMMAND as U,DRAGOVER_COMMAND as Z,SELECT_ALL_COMMAND as $,$selectAll as tt,COPY_COMMAND as et,CUT_COMMAND as nt,PASTE_COMMAND as rt,isDOMNode as ot,isSelectionCapturedInDecoratorInput as it,KEY_SPACE_COMMAND as st,KEY_TAB_COMMAND as at,PASTE_TAG as ct,$getRoot as ut,$isRootNode as lt}from\"lexical\";function dt(t,e){if(void 0!==document.caretRangeFromPoint){const n=document.caretRangeFromPoint(t,e);return null===n?null:{node:n.startContainer,offset:n.startOffset}}if(\"undefined\"!==document.caretPositionFromPoint){const n=document.caretPositionFromPoint(t,e);return null===n?null:{node:n.offsetNode,offset:n.offset}}return null}const mt=\"undefined\"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,ft=mt&&\"documentMode\"in document?document.documentMode:null,gt=!(!mt||!(\"InputEvent\"in window)||ft)&&\"getTargetRanges\"in new window.InputEvent(\"input\"),pt=mt&&/Version\\/[\\d.]+.*Safari/.test(navigator.userAgent),ht=mt&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Ct=mt&&/^(?=.*Chrome).*/i.test(navigator.userAgent),vt=mt&&/AppleWebKit\\/[\\d.]+/.test(navigator.userAgent)&&!Ct,yt=l(\"DRAG_DROP_PASTE_FILE\");class Dt extends d{static getType(){return\"quote\"}static clone(t){return new Dt(t.__key)}createDOM(t){const e=document.createElement(\"blockquote\");return o(e,t.theme.quote),e}updateDOM(t,e){return!1}static importDOM(){return{blockquote:t=>({conversion:Tt,priority:0})}}exportDOM(t){const{element:e}=super.exportDOM(t);if(i(e)){this.isEmpty()&&e.append(document.createElement(\"br\"));const t=this.getFormatType();t&&(e.style.textAlign=t);const n=this.getDirection();n&&(e.dir=n)}return{element:e}}static importJSON(t){return xt().updateFromJSON(t)}insertNewAfter(t,e){const n=m(),r=this.getDirection();return n.setDirection(r),this.insertAfter(n,e),n}collapseAtStart(){const t=m();return this.getChildren().forEach((e=>t.append(e))),this.replace(t),!0}canMergeWhenEmpty(){return!0}}function xt(){return f(new Dt)}function wt(t){return t instanceof Dt}class Nt extends d{static getType(){return\"heading\"}static clone(t){return new Nt(t.__tag,t.__key)}constructor(t,e){super(e),this.__tag=t}getTag(){return this.__tag}setTag(t){const e=this.getWritable();return this.__tag=t,e}createDOM(t){const e=this.__tag,n=document.createElement(e),r=t.theme.heading;if(void 0!==r){const t=r[e];o(n,t)}return n}updateDOM(t,e,n){return t.__tag!==this.__tag}static importDOM(){return{h1:t=>({conversion:Ot,priority:0}),h2:t=>({conversion:Ot,priority:0}),h3:t=>({conversion:Ot,priority:0}),h4:t=>({conversion:Ot,priority:0}),h5:t=>({conversion:Ot,priority:0}),h6:t=>({conversion:Ot,priority:0}),p:t=>{const e=t.firstChild;return null!==e&&Et(e)?{conversion:()=>({node:null}),priority:3}:null},span:t=>Et(t)?{conversion:t=>({node:_t(\"h1\")}),priority:3}:null}}exportDOM(t){const{element:e}=super.exportDOM(t);if(i(e)){this.isEmpty()&&e.append(document.createElement(\"br\"));const t=this.getFormatType();t&&(e.style.textAlign=t);const n=this.getDirection();n&&(e.dir=n)}return{element:e}}static importJSON(t){return _t(t.tag).updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setTag(t.tag)}exportJSON(){return{...super.exportJSON(),tag:this.getTag()}}insertNewAfter(t,e=!0){const n=t?t.anchor.offset:0,r=this.getLastDescendant(),o=!r||t&&t.anchor.key===r.getKey()&&n===r.getTextContentSize()||!t?m():_t(this.getTag()),i=this.getDirection();if(o.setDirection(i),this.insertAfter(o,e),0===n&&!this.isEmpty()&&t){const t=m();t.select(),this.replace(t,!0)}return o}collapseAtStart(){const t=this.isEmpty()?m():_t(this.getTag());return this.getChildren().forEach((e=>t.append(e))),this.replace(t),!0}extractWithChild(){return!0}}function Et(t){return\"span\"===t.nodeName.toLowerCase()&&\"26pt\"===t.style.fontSize}function Ot(t){const e=t.nodeName.toLowerCase();let n=null;return\"h1\"!==e&&\"h2\"!==e&&\"h3\"!==e&&\"h4\"!==e&&\"h5\"!==e&&\"h6\"!==e||(n=_t(e),null!==t.style&&(g(t,n),n.setFormat(t.style.textAlign))),{node:n}}function Tt(t){const e=xt();return null!==t.style&&(e.setFormat(t.style.textAlign),g(t,e)),{node:e}}function _t(t=\"h1\"){return f(new Nt(t))}function At(t){return t instanceof Nt}function Ft(t){let e=null;if(s(t,DragEvent)?e=t.dataTransfer:s(t,ClipboardEvent)&&(e=t.clipboardData),null===e)return[!1,[],!1];const n=e.types,r=n.includes(\"Files\"),o=n.includes(\"text/html\")||n.includes(\"text/plain\");return[r,Array.from(e.files),o]}function St(t){const e=h();if(!D(e))return!1;const n=new Set,r=e.getNodes();for(let e=0;e<r.length;e++){const o=r[e],i=o.getKey();if(n.has(i))continue;const s=c(o,(t=>_(t)&&!t.isInline()));if(null===s)continue;const a=s.getKey();s.canIndent()&&!n.has(a)&&(n.add(a),t(s))}return n.size>0}function It(t){const e=G(t);return J(e)}function Pt(t){for(const e of[\"lowercase\",\"uppercase\",\"capitalize\"])t.hasFormat(e)&&t.toggleFormat(e)}function Mt(o){return a(o.registerCommand(p,(t=>{const e=h();return!!C(e)&&(e.clear(),!0)}),v),o.registerCommand(y,(t=>{const e=h();return D(e)?(e.deleteCharacter(t),!0):!!C(e)&&(e.deleteNodes(),!0)}),v),o.registerCommand(x,(t=>{const e=h();return!!D(e)&&(e.deleteWord(t),!0)}),v),o.registerCommand(w,(t=>{const e=h();return!!D(e)&&(e.deleteLine(t),!0)}),v),o.registerCommand(N,(e=>{const n=h();if(\"string\"==typeof e)null!==n&&n.insertText(e);else{if(null===n)return!1;const r=e.dataTransfer;if(null!=r)t(r,n,o);else if(D(n)){const t=e.data;return t&&n.insertText(t),!0}}return!0}),v),o.registerCommand(E,(()=>{const t=h();return!!D(t)&&(t.removeText(),!0)}),v),o.registerCommand(O,(t=>{const e=h();return!!D(e)&&(e.formatText(t),!0)}),v),o.registerCommand(T,(t=>{const e=h();if(!D(e)&&!C(e))return!1;const n=e.getNodes();for(const e of n){const n=c(e,(t=>_(t)&&!t.isInline()));null!==n&&n.setFormat(t)}return!0}),v),o.registerCommand(A,(t=>{const e=h();return!!D(e)&&(e.insertLineBreak(t),!0)}),v),o.registerCommand(F,(()=>{const t=h();return!!D(t)&&(t.insertParagraph(),!0)}),v),o.registerCommand(S,(()=>(I([P()]),!0)),v),o.registerCommand(M,(()=>St((t=>{const e=t.getIndent();t.setIndent(e+1)}))),v),o.registerCommand(b,(()=>St((t=>{const e=t.getIndent();e>0&&t.setIndent(Math.max(0,e-1))}))),v),o.registerCommand(K,(t=>{const e=h();if(C(e)){const t=e.getNodes();if(t.length>0)return t[0].selectPrevious(),!0}else if(D(e)){const n=k(e.focus,!0);if(!t.shiftKey&&J(n)&&!n.isIsolated()&&!n.isInline())return n.selectPrevious(),t.preventDefault(),!0}return!1}),v),o.registerCommand(L,(t=>{const e=h();if(C(e)){const t=e.getNodes();if(t.length>0)return t[0].selectNext(0,0),!0}else if(D(e)){if(function(t){const e=t.focus;return\"root\"===e.key&&e.offset===ut().getChildrenSize()}(e))return t.preventDefault(),!0;const n=k(e.focus,!1);if(!t.shiftKey&&J(n)&&!n.isIsolated()&&!n.isInline())return n.selectNext(),t.preventDefault(),!0}return!1}),v),o.registerCommand(R,(t=>{const e=h();if(C(e)){const n=e.getNodes();if(n.length>0)return t.preventDefault(),n[0].selectPrevious(),!0}if(!D(e))return!1;if(n(e,!0)){const n=t.shiftKey;return t.preventDefault(),r(e,n,!0),!0}return!1}),v),o.registerCommand(W,(t=>{const e=h();if(C(e)){const n=e.getNodes();if(n.length>0)return t.preventDefault(),n[0].selectNext(0,0),!0}if(!D(e))return!1;const o=t.shiftKey;return!!n(e,!1)&&(t.preventDefault(),r(e,o,!1),!0)}),v),o.registerCommand(z,(t=>{if(It(t.target))return!1;const e=h();if(D(e)){if(function(t){if(!t.isCollapsed())return!1;const{anchor:e}=t;if(0!==e.offset)return!1;const n=e.getNode();if(lt(n))return!1;const r=u(n);return r.getIndent()>0&&(r.is(n)||n.is(r.getFirstDescendant()))}(e))return t.preventDefault(),o.dispatchCommand(b,void 0);if(ht&&\"ko-KR\"===navigator.language)return!1}else if(!C(e))return!1;return t.preventDefault(),o.dispatchCommand(y,!0)}),v),o.registerCommand(q,(t=>{if(It(t.target))return!1;const e=h();return!(!D(e)&&!C(e))&&(t.preventDefault(),o.dispatchCommand(y,!1))}),v),o.registerCommand(X,(t=>{const e=h();if(!D(e))return!1;if(Pt(e),null!==t){if((ht||pt||vt)&&gt)return!1;if(t.preventDefault(),t.shiftKey)return o.dispatchCommand(A,!1)}return o.dispatchCommand(F,void 0)}),v),o.registerCommand(Y,(()=>{const t=h();return!!D(t)&&(o.blur(),!0)}),v),o.registerCommand(B,(t=>{const[,e]=Ft(t);if(e.length>0){const n=dt(t.clientX,t.clientY);if(null!==n){const{offset:t,node:r}=n,i=G(r);if(null!==i){const e=V();if(j(i))e.anchor.set(i.getKey(),t,\"text\"),e.focus.set(i.getKey(),t,\"text\");else{const t=i.getParentOrThrow().getKey(),n=i.getIndexWithinParent()+1;e.anchor.set(t,n,\"element\"),e.focus.set(t,n,\"element\")}const n=H(e);Q(n)}o.dispatchCommand(yt,e)}return t.preventDefault(),!0}const n=h();return!!D(n)}),v),o.registerCommand(U,(t=>{const[e]=Ft(t),n=h();return!(e&&!D(n))}),v),o.registerCommand(Z,(t=>{const[e]=Ft(t),n=h();if(e&&!D(n))return!1;const r=dt(t.clientX,t.clientY);if(null!==r){const e=G(r.node);J(e)&&t.preventDefault()}return!0}),v),o.registerCommand($,(()=>(tt(),!0)),v),o.registerCommand(et,(t=>(e(o,s(t,ClipboardEvent)?t:null),!0)),v),o.registerCommand(nt,(t=>(async function(t,n){await e(n,s(t,ClipboardEvent)?t:null),n.update((()=>{const t=h();D(t)?t.removeText():C(t)&&t.getNodes().forEach((t=>t.remove()))}))}(t,o),!0)),v),o.registerCommand(rt,(e=>{const[,n,r]=Ft(e);if(n.length>0&&!r)return o.dispatchCommand(yt,n),!0;if(ot(e.target)&&it(e.target))return!1;return null!==h()&&(function(e,n){e.preventDefault(),n.update((()=>{const r=h(),o=s(e,InputEvent)||s(e,KeyboardEvent)?null:e.clipboardData;null!=o&&null!==r&&t(o,r,n)}),{tag:ct})}(e,o),!0)}),v),o.registerCommand(st,(t=>{const e=h();return D(e)&&Pt(e),!1}),v),o.registerCommand(at,(t=>{const e=h();return D(e)&&Pt(e),!1}),v))}export{_t as $createHeadingNode,xt as $createQuoteNode,At as $isHeadingNode,wt as $isQuoteNode,yt as DRAG_DROP_PASTE,Nt as HeadingNode,Dt as QuoteNode,Ft as eventFiles,Mt as registerRichText};\n","/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport{useLexicalComposerContext as t}from\"@lexical/react/LexicalComposerContext\";import{useLexicalEditable as e}from\"@lexical/react/useLexicalEditable\";import{$canShowPlaceholderCurry as r}from\"@lexical/text\";import{mergeRegister as o}from\"@lexical/utils\";import{useLayoutEffect as n,useEffect as i,useState as c,useMemo as l,Suspense as a}from\"react\";import{flushSync as u,createPortal as m}from\"react-dom\";import{jsx as s,jsxs as d,Fragment as f}from\"react/jsx-runtime\";import{registerDragonSupport as p}from\"@lexical/dragon\";import{registerRichText as x}from\"@lexical/rich-text\";const g=\"undefined\"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?n:i;function E(t){return t.getEditorState().read(r(t.isComposing()))}function h({contentEditable:e,placeholder:r=null,ErrorBoundary:n}){const[E]=t(),h=function(t,e){const[r,o]=c((()=>t.getDecorators()));return g((()=>t.registerDecoratorListener((t=>{u((()=>{o(t)}))}))),[t]),i((()=>{o(t.getDecorators())}),[t]),l((()=>{const o=[],n=Object.keys(r);for(let i=0;i<n.length;i++){const c=n[i],l=s(e,{onError:e=>t._onError(e),children:s(a,{fallback:null,children:r[c]})}),u=t.getElementByKey(c);null!==u&&o.push(m(l,u,c))}return o}),[e,r,t])}(E,n);return function(t){g((()=>o(x(t),p(t))),[t])}(E),d(f,{children:[e,s(w,{content:r}),h]})}function w({content:r}){const[n]=t(),i=function(t){const[e,r]=c((()=>E(t)));return g((()=>{function e(){const e=E(t);r(e)}return e(),o(t.registerUpdateListener((()=>{e()})),t.registerEditableListener((()=>{e()})))}),[t]),e}(n),l=e();return i?\"function\"==typeof r?r(l):r:null}export{h as RichTextPlugin};\n","/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport{useLexicalComposerContext as e}from\"@lexical/react/LexicalComposerContext\";import{useLayoutEffect as t,useEffect as i,forwardRef as a,useState as r,useCallback as n,useMemo as o}from\"react\";import{jsx as l,jsxs as d,Fragment as c}from\"react/jsx-runtime\";import{$canShowPlaceholderCurry as s}from\"@lexical/text\";import{mergeRegister as u}from\"@lexical/utils\";const m=\"undefined\"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?t:i;function f({editor:e,ariaActiveDescendant:t,ariaAutoComplete:i,ariaControls:a,ariaDescribedBy:d,ariaErrorMessage:c,ariaExpanded:s,ariaInvalid:u,ariaLabel:f,ariaLabelledBy:b,ariaMultiline:p,ariaOwns:x,ariaRequired:E,autoCapitalize:v,className:w,id:y,role:C=\"textbox\",spellCheck:g=!0,style:h,tabIndex:L,\"data-testid\":D,...I},R){const[k,q]=r(e.isEditable()),z=n((t=>{t&&t.ownerDocument&&t.ownerDocument.defaultView?e.setRootElement(t):e.setRootElement(null)}),[e]),A=o((()=>function(...e){return t=>{e.forEach((e=>{\"function\"==typeof e?e(t):null!=e&&(e.current=t)}))}}(R,z)),[z,R]);return m((()=>(q(e.isEditable()),e.registerEditableListener((e=>{q(e)})))),[e]),l(\"div\",{\"aria-activedescendant\":k?t:void 0,\"aria-autocomplete\":k?i:\"none\",\"aria-controls\":k?a:void 0,\"aria-describedby\":d,...null!=c?{\"aria-errormessage\":c}:{},\"aria-expanded\":k&&\"combobox\"===C?!!s:void 0,...null!=u?{\"aria-invalid\":u}:{},\"aria-label\":f,\"aria-labelledby\":b,\"aria-multiline\":p,\"aria-owns\":k?x:void 0,\"aria-readonly\":!k||void 0,\"aria-required\":E,autoCapitalize:v,className:w,contentEditable:k,\"data-testid\":D,id:y,ref:A,role:C,spellCheck:g,style:h,tabIndex:L,...I})}const b=a(f);function p(e){return e.getEditorState().read(s(e.isComposing()))}const x=a(E);function E(t,i){const{placeholder:a,...r}=t,[n]=e();return d(c,{children:[l(b,{editor:n,...r,ref:i}),null!=a&&l(v,{editor:n,content:a})]})}function v({content:e,editor:i}){const a=function(e){const[t,i]=r((()=>p(e)));return m((()=>{function t(){const t=p(e);i(t)}return t(),u(e.registerUpdateListener((()=>{t()})),e.registerEditableListener((()=>{t()})))}),[e]),t}(i),[n,o]=r(i.isEditable());if(t((()=>(o(i.isEditable()),i.registerEditableListener((e=>{o(e)})))),[i]),!a)return null;let d=null;return\"function\"==typeof e?d=e(n):null!==e&&(d=e),null===d?null:l(\"div\",{\"aria-hidden\":!0,children:d})}export{x as ContentEditable,b as ContentEditableElement};\n","/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport*as r from\"react\";import{jsx as e}from\"react/jsx-runtime\";function t(r,e){return t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,e){return r.__proto__=e,r},t(r,e)}var o={error:null},n=function(e){var n,a;function s(){for(var r,t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a];return(r=e.call.apply(e,[this].concat(n))||this).state=o,r.resetErrorBoundary=function(){for(var e,t=arguments.length,o=new Array(t),n=0;n<t;n++)o[n]=arguments[n];null==r.props.onReset||(e=r.props).onReset.apply(e,o),r.reset()},r}a=e,(n=s).prototype=Object.create(a.prototype),n.prototype.constructor=n,t(n,a),s.getDerivedStateFromError=function(r){return{error:r}};var i=s.prototype;return i.reset=function(){this.setState(o)},i.componentDidCatch=function(r,e){var t,o;null==(t=(o=this.props).onError)||t.call(o,r,e)},i.componentDidUpdate=function(r,e){var t,o,n,a,s=this.state.error,i=this.props.resetKeys;null!==s&&null!==e.error&&(void 0===(n=r.resetKeys)&&(n=[]),void 0===(a=i)&&(a=[]),n.length!==a.length||n.some((function(r,e){return!Object.is(r,a[e])})))&&(null==(t=(o=this.props).onResetKeysChange)||t.call(o,r.resetKeys,i),this.reset())},i.render=function(){var e=this.state.error,t=this.props,o=t.fallbackRender,n=t.FallbackComponent,a=t.fallback;if(null!==e){var s={error:e,resetErrorBoundary:this.resetErrorBoundary};if(r.isValidElement(a))return a;if(\"function\"==typeof o)return o(s);if(n)return r.createElement(n,s);throw new Error(\"react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop\")}return this.props.children},s}(r.Component);function a({children:r,onError:t}){return e(n,{fallback:e(\"div\",{style:{border:\"1px solid #f00\",color:\"#f00\",padding:\"8px\"},children:\"An error was thrown.\"}),onError:t,children:r})}export{a as LexicalErrorBoundary};\n","/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport{useLexicalComposerContext as e}from\"@lexical/react/LexicalComposerContext\";import{HISTORY_MERGE_TAG as t}from\"lexical\";import{useLayoutEffect as o,useEffect as i}from\"react\";const r=\"undefined\"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?o:i;function n({ignoreHistoryMergeTagChange:o=!0,ignoreSelectionChange:i=!1,onChange:n}){const[a]=e();return r((()=>{if(n)return a.registerUpdateListener((({editorState:e,dirtyElements:r,dirtyLeaves:d,prevEditorState:s,tags:c})=>{i&&0===r.size&&0===d.size||o&&c.has(t)||s.isEmpty()||n(e,a,c)}))}),[a,o,i,n]),null}export{n as OnChangePlugin};\n","/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport{registerList as t,ListNode as r,ListItemNode as o,registerListStrictIndentTransform as e}from\"@lexical/list\";import{useLexicalComposerContext as i}from\"@lexical/react/LexicalComposerContext\";import{useEffect as n}from\"react\";function s({hasStrictIndent:s=!1}){const[c]=i();return n((()=>{if(!c.hasNodes([r,o]))throw new Error(\"ListPlugin: ListNode and/or ListItemNode not registered on editor\")}),[c]),n((()=>{if(s)return e(c)}),[c,s]),function(r){n((()=>t(r)),[r])}(c),null}export{s as ListPlugin};\n","/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport{LinkNode as t,TOGGLE_LINK_COMMAND as r,$toggleLink as e}from\"@lexical/link\";import{useLexicalComposerContext as o}from\"@lexical/react/LexicalComposerContext\";import{mergeRegister as i,objectKlassEquals as l}from\"@lexical/utils\";import{COMMAND_PRIORITY_LOW as n,PASTE_COMMAND as a,$getSelection as m,$isRangeSelection as s,$isElementNode as u}from\"lexical\";import{useEffect as d}from\"react\";function c({validateUrl:c,attributes:p}){const[f]=o();return d((()=>{if(!f.hasNodes([t]))throw new Error(\"LinkPlugin: LinkNode not registered on editor\");return i(f.registerCommand(r,(t=>{if(null===t)return e(t),!0;if(\"string\"==typeof t)return!(void 0!==c&&!c(t))&&(e(t,p),!0);{const{url:r,target:o,rel:i,title:l}=t;return e(r,{...p,rel:i,target:o,title:l}),!0}}),n),void 0!==c?f.registerCommand(a,(t=>{const e=m();if(!s(e)||e.isCollapsed()||!l(t,ClipboardEvent))return!1;if(null===t.clipboardData)return!1;const o=t.clipboardData.getData(\"text\");return!!c(o)&&(!e.getNodes().some((t=>u(t)))&&(f.dispatchCommand(r,{...p,url:o}),t.preventDefault(),!0))}),n):()=>{})}),[f,c,p]),null}export{c as LinkPlugin};\n","/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport{$isLinkNode as e}from\"@lexical/link\";import{useLexicalComposerContext as t}from\"@lexical/react/LexicalComposerContext\";import{$findMatchingParent as n,isHTMLAnchorElement as r}from\"@lexical/utils\";import{isDOMNode as l,getNearestEditorFromDOMNode as o,$getNearestNodeFromDOMNode as i,$isElementNode as u,$getSelection as a,$isRangeSelection as c}from\"lexical\";import{useEffect as s}from\"react\";function f({newTab:f=!0,disabled:m=!1}){const[p]=t();return s((()=>{const t=t=>{const s=t.target;if(!l(s))return;const d=o(s);if(null===d)return;let v=null,x=null;if(d.update((()=>{const t=i(s);if(null!==t){const l=n(t,u);if(!m)if(e(l))v=l.sanitizeUrl(l.getURL()),x=l.getTarget();else{const e=function(e,t){let n=e;for(;null!=n;){if(t(n))return n;n=n.parentNode}return null}(s,r);null!==e&&(v=e.href,x=e.target)}}})),null===v||\"\"===v)return;const g=p.getEditorState().read(a);if(c(g)&&!g.isCollapsed())return void t.preventDefault();const L=\"auxclick\"===t.type&&1===t.button;window.open(v,f||L||t.metaKey||t.ctrlKey||\"_blank\"===x?\"_blank\":\"_self\"),t.preventDefault()},s=e=>{1===e.button&&t(e)};return p.registerRootListener(((e,n)=>{null!==n&&(n.removeEventListener(\"click\",t),n.removeEventListener(\"mouseup\",s)),null!==e&&(e.addEventListener(\"click\",t),e.addEventListener(\"mouseup\",s))}))}),[p,f,m]),null}export{f as ClickableLinkPlugin};\n","/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport{mergeRegister as t}from\"@lexical/utils\";import{UNDO_COMMAND as e,COMMAND_PRIORITY_EDITOR as n,REDO_COMMAND as r,CLEAR_EDITOR_COMMAND as o,CLEAR_HISTORY_COMMAND as i,CAN_REDO_COMMAND as c,CAN_UNDO_COMMAND as s,HISTORIC_TAG as a,HISTORY_PUSH_TAG as u,HISTORY_MERGE_TAG as d,$isRangeSelection as l,$isTextNode as f,$isRootNode as p}from\"lexical\";const m=0,h=1,_=2,g=0,S=1,k=2,y=3,C=4;function x(t,e,n,r,o){if(null===t||0===n.size&&0===r.size&&!o)return g;const i=e._selection,c=t._selection;if(o)return S;if(!(l(i)&&l(c)&&c.isCollapsed()&&i.isCollapsed()))return g;const s=function(t,e,n){const r=t._nodeMap,o=[];for(const t of e){const e=r.get(t);void 0!==e&&o.push(e)}for(const[t,e]of n){if(!e)continue;const n=r.get(t);void 0===n||p(n)||o.push(n)}return o}(e,n,r);if(0===s.length)return g;if(s.length>1){const n=e._nodeMap,r=n.get(i.anchor.key),o=n.get(c.anchor.key);return r&&o&&!t._nodeMap.has(r.__key)&&f(r)&&1===r.__text.length&&1===i.anchor.offset?k:g}const a=s[0],u=t._nodeMap.get(a.__key);if(!f(u)||!f(a)||u.__mode!==a.__mode)return g;const d=u.__text,m=a.__text;if(d===m)return g;const h=i.anchor,_=c.anchor;if(h.key!==_.key||\"text\"!==h.type)return g;const x=h.offset,M=_.offset,z=m.length-d.length;return 1===z&&M===x-1?k:-1===z&&M===x+1?y:-1===z&&M===x?C:g}function M(t,e){let n=Date.now(),r=g;return(o,i,c,s,p,S)=>{const k=Date.now();if(S.has(a))return r=g,n=k,_;const y=x(o,i,s,p,t.isComposing()),C=(()=>{const a=null===c||c.editor===t,C=S.has(u);if(!C&&a&&S.has(d))return m;if(null===o)return h;const x=i._selection;if(!(s.size>0||p.size>0))return null!==x?m:_;if(!1===C&&y!==g&&y===r&&k<n+e&&a)return m;if(1===s.size){if(function(t,e,n){const r=e._nodeMap.get(t),o=n._nodeMap.get(t),i=e._selection,c=n._selection;return!(l(i)&&l(c)&&\"element\"===i.anchor.type&&\"element\"===i.focus.type&&\"text\"===c.anchor.type&&\"text\"===c.focus.type||!f(r)||!f(o)||r.__parent!==o.__parent)&&JSON.stringify(e.read((()=>r.exportJSON())))===JSON.stringify(n.read((()=>o.exportJSON())))}(Array.from(s)[0],o,i))return m}return h})();return n=k,r=y,C}}function z(t){t.undoStack=[],t.redoStack=[],t.current=null}function v(u,d,l){const f=M(u,l),p=t(u.registerCommand(e,(()=>(function(t,e){const n=e.redoStack,r=e.undoStack;if(0!==r.length){const o=e.current,i=r.pop();null!==o&&(n.push(o),t.dispatchCommand(c,!0)),0===r.length&&t.dispatchCommand(s,!1),e.current=i||null,i&&i.editor.setEditorState(i.editorState,{tag:a})}}(u,d),!0)),n),u.registerCommand(r,(()=>(function(t,e){const n=e.redoStack,r=e.undoStack;if(0!==n.length){const o=e.current;null!==o&&(r.push(o),t.dispatchCommand(s,!0));const i=n.pop();0===n.length&&t.dispatchCommand(c,!1),e.current=i||null,i&&i.editor.setEditorState(i.editorState,{tag:a})}}(u,d),!0)),n),u.registerCommand(o,(()=>(z(d),!1)),n),u.registerCommand(i,(()=>(z(d),u.dispatchCommand(c,!1),u.dispatchCommand(s,!1),!0)),n),u.registerUpdateListener((({editorState:t,prevEditorState:e,dirtyLeaves:n,dirtyElements:r,tags:o})=>{const i=d.current,a=d.redoStack,l=d.undoStack,p=null===i?null:i.editorState;if(null!==i&&t===p)return;const m=f(e,t,i,n,r,o);if(m===h)0!==a.length&&(d.redoStack=[],u.dispatchCommand(c,!1)),null!==i&&(l.push({...i}),u.dispatchCommand(s,!0));else if(m===_)return;d.current={editor:u,editorState:t}})));return p}function E(){return{current:null,redoStack:[],undoStack:[]}}export{E as createEmptyHistoryState,v as registerHistory};\n","/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport{useLexicalComposerContext as t}from\"@lexical/react/LexicalComposerContext\";import{createEmptyHistoryState as o,registerHistory as r}from\"@lexical/history\";export{createEmptyHistoryState}from\"@lexical/history\";import{useMemo as e,useEffect as i}from\"react\";function a({delay:a,externalHistoryState:c}){const[l]=t();return function(t,a,c=1e3){const l=e((()=>a||o()),[a]);i((()=>r(t,l,c)),[c,t,l])}(l,c,a),null}export{a as HistoryPlugin};\n","/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport{useLexicalComposerContext as r}from\"@lexical/react/LexicalComposerContext\";import{$isScrollableTablesActive as o,setScrollableTablesActive as e,TableNode as l,registerTablePlugin as t,registerTableSelectionObserver as a,registerTableCellUnmergeTransform as n,TableCellNode as i}from\"@lexical/table\";import{useEffect as c}from\"react\";function s({hasCellMerge:s=!0,hasCellBackgroundColor:u=!0,hasTabHandler:m=!0,hasHorizontalScroll:f=!1}){const[g]=r();return c((()=>{o(g)!==f&&(e(g,f),g.registerNodeTransform(l,(()=>{}))())}),[g,f]),c((()=>t(g)),[g]),c((()=>a(g,m)),[g,m]),c((()=>{if(!s)return n(g)}),[g,s]),c((()=>{if(!u)return g.registerNodeTransform(i,(r=>{null!==r.getBackgroundColor()&&r.setBackgroundColor(null)}))}),[g,u,s]),null}export{s as TablePlugin};\n","import { LexicalComposer } from '@lexical/react/LexicalComposer';\nimport { RichTextPlugin } from '@lexical/react/LexicalRichTextPlugin';\nimport { ContentEditable } from '@lexical/react/LexicalContentEditable';\nimport { LexicalErrorBoundary } from '@lexical/react/LexicalErrorBoundary';\nimport { OnChangePlugin } from '@lexical/react/LexicalOnChangePlugin';\nimport { $generateHtmlFromNodes, $generateNodesFromDOM } from '@lexical/html';\nimport { $createParagraphNode, $getRoot, createEditor } from 'lexical';\nimport { ListItemNode, ListNode } from '@lexical/list';\nimport { ListPlugin } from '@lexical/react/LexicalListPlugin';\nimport { LinkPlugin } from '@lexical/react/LexicalLinkPlugin';\nimport { AutoLinkNode, LinkNode } from '@lexical/link';\nimport { TableCellNode, TableNode, TableRowNode } from '@lexical/table';\nimport { AutoLinkPlugin } from '@lexical/react/LexicalAutoLinkPlugin';\nimport { ClickableLinkPlugin } from '@lexical/react/LexicalClickableLinkPlugin';\nimport { HistoryPlugin } from '@lexical/react/LexicalHistoryPlugin';\nimport { TablePlugin } from '@lexical/react/LexicalTablePlugin';\nimport { useEffect, useRef, useState } from 'react';\nimport { clsx } from 'clsx';\n\nimport type { EditorState, LexicalEditor } from 'lexical';\n\nimport { exportMap, isStartingWithHtmlTag, mergeBoldStrongTags } from './helpers';\nimport { MATCHERS, validateUrl } from './Plugins/LinkPlugin/helpers';\nimport styles from './RteEditor.module.css';\nimport { ToolBarPlugin, PasteHandlerPlugin, TableCellResizerPlugin } from './Plugins';\nimport { UvaTheme } from './UvaTheme';\nimport { EditorHeader } from './EditorHeader';\nimport { LanguageProvider, useLanguage } from './Providers/LanguageProvider';\nimport { useTranslation } from './hooks/useTranslation';\nimport { TableWrapperNode } from './nodes';\n\nimport { FeedbackBox } from 'components/FeedbackBox';\n\nexport interface RteEditorProps {\n /** current language setting for the editor labels NOT title ans label */\n currentLanguage?: 'NL' | 'EN';\n /** imported content to edit */\n initialValue?: string;\n /** placeholder text in current Language */\n placeholder?: string;\n /** label/title of the RTE in current Language */\n label?: string;\n /** explanation of the text to be filled in, in current Language */\n info?: string;\n /** 'true' the rte field mandatory */\n required?: boolean;\n /** max number of words 'allowed' but not enforced */\n maxWords?: number;\n /** max height in rem default = 20rem*/\n maxHeightInRem?: `${number}rem`;\n /** error text to display if required and field is empty */\n notValidatedText?: string;\n /** updated output */\n onChange: (content: string) => void;\n}\n\nconst DEFAULT_MAX_WORDS = 200;\n\nexport const Rte = ({\n currentLanguage = 'NL',\n initialValue = '',\n placeholder = '',\n label = '',\n info = '',\n required = false,\n notValidatedText = '',\n maxHeightInRem = '20rem',\n maxWords = DEFAULT_MAX_WORDS,\n onChange,\n}: RteEditorProps) => {\n const { switchLanguage } = useLanguage();\n const t = useTranslation();\n const [editor] = useState(() => createEditor());\n const [wordCount, setWordCount] = useState(0);\n const [scrollTopPosition, setScrollTopPosition] = useState(0);\n const editorRef = useRef<HTMLDivElement>(null);\n\n const initialConfig = {\n html: {\n export: exportMap,\n },\n namespace: 'UvaRte',\n editor,\n theme: UvaTheme,\n onError(error: Error) {\n throw error;\n },\n nodes: [ListNode, ListItemNode, LinkNode, AutoLinkNode, TableCellNode, TableRowNode, TableNode, TableWrapperNode],\n editorState: (editor: LexicalEditor) => {\n const parser = new DOMParser();\n const dom = parser.parseFromString(initialValue, 'text/html');\n const nodes = $generateNodesFromDOM(editor, dom);\n const root = $getRoot();\n root.clear();\n if (isStartingWithHtmlTag(initialValue)) {\n nodes.forEach((node) => {\n root.append(node);\n });\n } else {\n const paragraphNode = $createParagraphNode();\n nodes.forEach((node, index) => {\n if (index === 0) {\n paragraphNode.append(node);\n root.append(paragraphNode);\n } else {\n root.append(node);\n }\n });\n }\n },\n };\n\n const getWordCount = (plainText: string): number => {\n if (plainText.trim().length === 0) {\n return 0;\n } else {\n return plainText.split(' ').length;\n }\n };\n\n const handleOnChange = (editorState: EditorState, editor: LexicalEditor): void => {\n editorState.read(() => {\n let htmlContent = '';\n setWordCount(getWordCount($getRoot().getTextContent().replace(/\\s+/g, ' ').trim()));\n htmlContent = mergeBoldStrongTags($generateHtmlFromNodes(editor));\n onChange(htmlContent);\n });\n };\n\n useEffect(() => {\n switchLanguage(currentLanguage.toLocaleLowerCase());\n }, [currentLanguage, switchLanguage]);\n\n useEffect(() => {\n const strippedInitialValue = initialValue\n .replace(/<br\\s*\\/?>|&nbsp;/gi, ' ')\n .replace(/<\\/?[^>]+(>|$)|&[a-z]+;/g, '')\n .replace(/\\s+/g, ' ')\n .trim();\n setWordCount(getWordCount(strippedInitialValue));\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return (\n <div className={styles['editor__container']}>\n <div className={styles['editor__header']}>\n <EditorHeader label={label} info={info} required={required} />\n <div className={styles['editor__header-word-count']}>\n <span className={clsx({ [styles['editor__header-word-count--alert']]: wordCount > maxWords })}>\n {wordCount}\n </span>\n &nbsp;/&nbsp;{maxWords}\n </div>\n </div>\n <div className={styles['editor']}>\n <LexicalComposer initialConfig={initialConfig}>\n <ToolBarPlugin editorScrollPosition={scrollTopPosition} />\n <div className={styles['editor__field-wrapper']}>\n <RichTextPlugin\n contentEditable={\n <ContentEditable\n className={styles['editor__field']}\n aria-label={t.common.rteAriaLabel}\n aria-placeholder={placeholder}\n title={t.common.rteTitle}\n placeholder={<div className={styles['editor__placeholder']}>{placeholder}</div>}\n spellCheck={false}\n id=\"rteEditor\"\n style={{ height: `${maxHeightInRem}`, maxHeight: `${maxHeightInRem}` }}\n onScroll={(event) => setScrollTopPosition(event.currentTarget.scrollTop)}\n ref={editorRef}\n />\n }\n placeholder={<div className={styles['editor__placeholder']}>{placeholder}</div>}\n ErrorBoundary={LexicalErrorBoundary}\n />\n <TablePlugin />\n <TableCellResizerPlugin />\n <HistoryPlugin />\n <ListPlugin />\n <LinkPlugin validateUrl={validateUrl} />\n <AutoLinkPlugin matchers={MATCHERS} />\n <ClickableLinkPlugin />\n <OnChangePlugin onChange={handleOnChange} />\n <PasteHandlerPlugin />\n </div>\n </LexicalComposer>\n </div>\n {notValidatedText !== '' && <FeedbackBox level=\"error\" feedback={notValidatedText} />}\n </div>\n );\n};\n\nexport const RteEditor = ({\n currentLanguage = 'NL',\n initialValue = '',\n placeholder = '',\n label = '',\n info = '',\n required = false,\n notValidatedText = '',\n maxWords = DEFAULT_MAX_WORDS,\n onChange,\n}: RteEditorProps) => (\n <LanguageProvider>\n <Rte\n currentLanguage={currentLanguage}\n initialValue={initialValue}\n placeholder={placeholder}\n label={label}\n info={info}\n required={required}\n notValidatedText={notValidatedText}\n maxWords={maxWords}\n onChange={onChange}\n />\n </LanguageProvider>\n);\n"],"names":["m","u","c","l","p","a","f","d","t","s","e","E","o","n","i","r","g","dt","mt","ft","gt","pt","ht","Ct","vt","yt","Ft","St","h","D","_","It","G","J","Pt","Mt","C","v","y","x","w","N","O","T","A","F","S","I","P","M","b","K","k","L","ut","R","W","z","lt","q","X","Y","B","V","j","H","Q","U","Z","$","tt","et","nt","rt","ot","it","ct","st","at","DEFAULT_MAX_WORDS","Rte","currentLanguage","initialValue","placeholder","label","info","required","notValidatedText","maxHeightInRem","maxWords","onChange","switchLanguage","useLanguage","useTranslation","editor","useState","createEditor","wordCount","setWordCount","scrollTopPosition","setScrollTopPosition","editorRef","useRef","initialConfig","exportMap","UvaTheme","error","ListNode","ListItemNode","LinkNode","AutoLinkNode","TableCellNode","TableRowNode","TableNode","TableWrapperNode","dom","nodes","$generateNodesFromDOM","root","$getRoot","isStartingWithHtmlTag","node","paragraphNode","$createParagraphNode","index","getWordCount","plainText","handleOnChange","editorState","htmlContent","mergeBoldStrongTags","$generateHtmlFromNodes","useEffect","strippedInitialValue","jsxs","styles","jsx","EditorHeader","clsx","LexicalComposer","ToolBarPlugin","RichTextPlugin","ContentEditable","event","LexicalErrorBoundary","TablePlugin","TableCellResizerPlugin","HistoryPlugin","ListPlugin","LinkPlugin","validateUrl","AutoLinkPlugin","MATCHERS","ClickableLinkPlugin","OnChangePlugin","PasteHandlerPlugin","FeedbackBox","RteEditor","LanguageProvider"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQsV,MAAMA,KAAe,OAAO,SAApB,OAAqC,OAAO,aAAhB,UAAmC,OAAO,SAAS,kBAAzB,QAAuCC,KAAED,KAAEE,IAAEC,GAAEC,IAAE,EAAC,KAAIC,GAAC;AAAE,SAASC,GAAE,EAAC,eAAcD,GAAE,UAASH,EAAC,GAAE;AAAC,QAAMC,IAAEI,GAAG,MAAI;AAAC,UAAK,EAAC,OAAMC,GAAE,WAAUN,GAAE,OAAMC,GAAE,SAAQI,GAAE,aAAYE,GAAE,MAAKR,EAAC,IAAEI,GAAEC,IAAEI,GAAE,MAAKF,CAAC,GAAEG,IAAEC,GAAE,EAAC,UAASP,EAAE,UAAS,MAAKJ,GAAE,WAAUC,GAAE,OAAMC,GAAE,SAAQ,CAAAO,MAAGH,EAAEG,GAAEC,CAAC,GAAE,OAAMH,EAAC,CAAC;AAAE,WAAO,SAASE,GAAEF,GAAE;AAAC,UAAUA,MAAP;AAAgB,YAAYA,MAAT,OAAW,CAAAE,EAAE,OAAQ,MAAI;AAAC,gBAAMF,IAAEK,EAAC;AAAG,cAAGL,EAAE,QAAO,GAAG;AAAC,kBAAMI,IAAEE;AAAI,YAAAN,EAAE,OAAOI,CAAC;AAAE,kBAAMC,IAAEb,KAAE,SAAS,gBAAc;AAAK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1,2,3,4,5,6,7,8,9,10,11,12,13]}
1
+ {"version":3,"file":"RteEditor.js","sources":["../../../node_modules/@lexical/react/LexicalComposer.prod.mjs","../../../node_modules/@lexical/text/LexicalText.prod.mjs","../../../node_modules/@lexical/dragon/LexicalDragon.prod.mjs","../../../node_modules/@lexical/rich-text/LexicalRichText.prod.mjs","../../../node_modules/@lexical/react/LexicalRichTextPlugin.prod.mjs","../../../node_modules/@lexical/react/LexicalContentEditable.prod.mjs","../../../node_modules/@lexical/react/LexicalErrorBoundary.prod.mjs","../../../node_modules/@lexical/react/LexicalOnChangePlugin.prod.mjs","../../../node_modules/@lexical/react/LexicalListPlugin.prod.mjs","../../../node_modules/@lexical/react/LexicalLinkPlugin.prod.mjs","../../../node_modules/@lexical/react/LexicalClickableLinkPlugin.prod.mjs","../../../node_modules/@lexical/history/LexicalHistory.prod.mjs","../../../node_modules/@lexical/react/LexicalHistoryPlugin.prod.mjs","../../../node_modules/@lexical/react/LexicalTablePlugin.prod.mjs","../../../src/components/RteEditor/RteEditor.tsx"],"sourcesContent":["/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport{createLexicalComposerContext as e,LexicalComposerContext as t}from\"@lexical/react/LexicalComposerContext\";import{createEditor as o,$getRoot as n,$createParagraphNode as i,$getSelection as r,HISTORY_MERGE_TAG as a}from\"lexical\";import{useLayoutEffect as c,useEffect as l,useMemo as d}from\"react\";import{jsx as s}from\"react/jsx-runtime\";const m=\"undefined\"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,u=m?c:l,p={tag:a};function f({initialConfig:a,children:c}){const l=d((()=>{const{theme:t,namespace:c,nodes:l,onError:d,editorState:s,html:u}=a,f=e(null,t),E=o({editable:a.editable,html:u,namespace:c,nodes:l,onError:e=>d(e,E),theme:t});return function(e,t){if(null===t)return;if(void 0===t)e.update((()=>{const t=n();if(t.isEmpty()){const o=i();t.append(o);const n=m?document.activeElement:null;(null!==r()||null!==n&&n===e.getRootElement())&&o.select()}}),p);else if(null!==t)switch(typeof t){case\"string\":{const o=e.parseEditorState(t);e.setEditorState(o,p);break}case\"object\":e.setEditorState(t,p);break;case\"function\":e.update((()=>{n().isEmpty()&&t(e)}),p)}}(E,s),[E,f]}),[]);return u((()=>{const e=a.editable,[t]=l;t.setEditable(void 0===e||e)}),[]),s(t.Provider,{value:l,children:c})}export{f as LexicalComposer};\n","/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport{$getRoot as t,$isDecoratorNode as e,$isElementNode as n,$isParagraphNode as r,$isTextNode as i,TextNode as o,$createTextNode as l}from\"lexical\";function s(){return t().getTextContent()}function f(t,e=!0){if(t)return!1;let n=s();return e&&(n=n.trim()),\"\"===n}function u(t,e){return()=>f(t,e)}function c(o){if(!f(o,!1))return!1;const l=t().getChildren(),s=l.length;if(s>1)return!1;for(let t=0;t<s;t++){const o=l[t];if(e(o))return!1;if(n(o)){if(!r(o))return!1;if(0!==o.__indent)return!1;const e=o.getChildren(),n=e.length;for(let r=0;r<n;r++){const n=e[t];if(!i(n))return!1}}}return!0}function g(t){return()=>c(t)}function a(t,e){let r=t.getFirstChild(),o=0;t:for(;null!==r;){if(n(r)){const t=r.getFirstChild();if(null!==t){r=t;continue}}else if(i(r)){const t=r.getTextContentSize();if(o+t>e)return{node:r,offset:e-o};o+=t}const t=r.getNextSibling();if(null!==t){r=t;continue}let l=r.getParent();for(;null!==l;){const t=l.getNextSibling();if(null!==t){r=t;continue t}l=l.getParent()}break}return null}function d(t,...e){const n=new URL(\"https://lexical.dev/docs/error\"),r=new URLSearchParams;r.append(\"code\",t);for(const t of e)r.append(\"v\",t);throw n.search=r.toString(),Error(`Minified Lexical error #${t}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function x(t,e,n,r){const s=t=>t instanceof n,f=t=>{const e=l(t.getTextContent());e.setFormat(t.getFormat()),t.replace(e)};return[t.registerNodeTransform(o,(t=>{if(!t.isSimpleText())return;let n,o=t.getPreviousSibling(),l=t.getTextContent(),u=t;if(i(o)){const n=o.getTextContent(),r=e(n+l);if(s(o)){if(null===r||0!==(t=>t.getLatest().__mode)(o))return void f(o);{const e=r.end-n.length;if(e>0){const r=n+l.slice(0,e);if(o.select(),o.setTextContent(r),e===l.length)t.remove();else{const n=l.slice(e);t.setTextContent(n)}return}}}else if(null===r||r.start<n.length)return}let c=0;for(;;){n=e(l);let t,g=null===n?\"\":l.slice(n.end);if(l=g,\"\"===g){const t=u.getNextSibling();if(i(t)){g=u.getTextContent()+t.getTextContent();const n=e(g);if(null===n)return void(s(t)?f(t):t.markDirty());if(0!==n.start)return}}if(null===n)return;if(0===n.start&&i(o)&&o.isTextEntity()){c+=n.end;continue}0===n.start?[t,u]=u.splitText(n.end):[,t,u]=u.splitText(n.start+c,n.end+c),void 0===t&&d(165,\"nodeToReplace\");const a=r(t);if(a.setFormat(t.getFormat()),t.replace(a),null==u)return;c=0,o=a}})),t.registerNodeTransform(n,(t=>{const n=t.getTextContent(),r=e(n);if(null===r||0!==r.start)return void f(t);if(n.length>r.end)return void t.splitText(r.end);const o=t.getPreviousSibling();i(o)&&o.isTextEntity()&&(f(o),f(t));const l=t.getNextSibling();i(l)&&l.isTextEntity()&&(f(l),s(t)&&f(t))}))]}export{c as $canShowPlaceholder,g as $canShowPlaceholderCurry,a as $findTextIntersectionFromCharacters,f as $isRootTextContentEmpty,u as $isRootTextContentEmptyCurry,s as $rootTextContent,x as registerLexicalTextEntity};\n","/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport{$getSelection as e,$isRangeSelection as t,$isTextNode as n}from\"lexical\";function o(o){const i=window.location.origin,a=a=>{if(a.origin!==i)return;const r=o.getRootElement();if(document.activeElement!==r)return;const s=a.data;if(\"string\"==typeof s){let i;try{i=JSON.parse(s)}catch(e){return}if(i&&\"nuanria_messaging\"===i.protocol&&\"request\"===i.type){const r=i.payload;if(r&&\"makeChanges\"===r.functionId){const i=r.args;if(i){const[r,s,c,g,d,f]=i;o.update((()=>{const o=e();if(t(o)){const e=o.anchor;let t=e.getNode(),i=0,f=0;if(n(t)&&r>=0&&s>=0&&(i=r,f=r+s,o.setTextNodeRange(t,i,t,f)),i===f&&\"\"===c||(o.insertRawText(c),t=e.getNode()),n(t)){i=g,f=g+d;const e=t.getTextContentSize();i=i>e?e:i,f=f>e?e:f,o.setTextNodeRange(t,i,t,f)}a.stopImmediatePropagation()}}))}}}}};return window.addEventListener(\"message\",a,!0),()=>{window.removeEventListener(\"message\",a,!0)}}export{o as registerDragonSupport};\n","/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport{$insertDataTransferForRichText as t,copyToClipboard as e}from\"@lexical/clipboard\";import{$shouldOverrideDefaultCharacterSelection as n,$moveCharacter as r}from\"@lexical/selection\";import{addClassNamesToElement as o,isHTMLElement as i,objectKlassEquals as s,mergeRegister as a,$findMatchingParent as c,$getNearestBlockElementAncestorOrThrow as u}from\"@lexical/utils\";import{createCommand as l,ElementNode as d,$createParagraphNode as m,$applyNodeReplacement as f,setNodeIndentFromDOM as g,CLICK_COMMAND as p,$getSelection as h,$isNodeSelection as C,COMMAND_PRIORITY_EDITOR as v,DELETE_CHARACTER_COMMAND as y,$isRangeSelection as D,DELETE_WORD_COMMAND as x,DELETE_LINE_COMMAND as w,CONTROLLED_TEXT_INSERTION_COMMAND as N,REMOVE_TEXT_COMMAND as E,FORMAT_TEXT_COMMAND as O,FORMAT_ELEMENT_COMMAND as T,$isElementNode as _,INSERT_LINE_BREAK_COMMAND as A,INSERT_PARAGRAPH_COMMAND as F,INSERT_TAB_COMMAND as S,$insertNodes as I,$createTabNode as P,INDENT_CONTENT_COMMAND as M,OUTDENT_CONTENT_COMMAND as b,KEY_ARROW_UP_COMMAND as K,$getAdjacentNode as k,$isDecoratorNode as J,KEY_ARROW_DOWN_COMMAND as L,KEY_ARROW_LEFT_COMMAND as R,KEY_ARROW_RIGHT_COMMAND as W,KEY_BACKSPACE_COMMAND as z,KEY_DELETE_COMMAND as q,KEY_ENTER_COMMAND as X,KEY_ESCAPE_COMMAND as Y,DROP_COMMAND as B,$getNearestNodeFromDOMNode as G,$createRangeSelection as V,$isTextNode as j,$normalizeSelection__EXPERIMENTAL as H,$setSelection as Q,DRAGSTART_COMMAND as U,DRAGOVER_COMMAND as Z,SELECT_ALL_COMMAND as $,$selectAll as tt,COPY_COMMAND as et,CUT_COMMAND as nt,PASTE_COMMAND as rt,isDOMNode as ot,isSelectionCapturedInDecoratorInput as it,KEY_SPACE_COMMAND as st,KEY_TAB_COMMAND as at,PASTE_TAG as ct,$getRoot as ut,$isRootNode as lt}from\"lexical\";function dt(t,e){if(void 0!==document.caretRangeFromPoint){const n=document.caretRangeFromPoint(t,e);return null===n?null:{node:n.startContainer,offset:n.startOffset}}if(\"undefined\"!==document.caretPositionFromPoint){const n=document.caretPositionFromPoint(t,e);return null===n?null:{node:n.offsetNode,offset:n.offset}}return null}const mt=\"undefined\"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,ft=mt&&\"documentMode\"in document?document.documentMode:null,gt=!(!mt||!(\"InputEvent\"in window)||ft)&&\"getTargetRanges\"in new window.InputEvent(\"input\"),pt=mt&&/Version\\/[\\d.]+.*Safari/.test(navigator.userAgent),ht=mt&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Ct=mt&&/^(?=.*Chrome).*/i.test(navigator.userAgent),vt=mt&&/AppleWebKit\\/[\\d.]+/.test(navigator.userAgent)&&!Ct,yt=l(\"DRAG_DROP_PASTE_FILE\");class Dt extends d{static getType(){return\"quote\"}static clone(t){return new Dt(t.__key)}createDOM(t){const e=document.createElement(\"blockquote\");return o(e,t.theme.quote),e}updateDOM(t,e){return!1}static importDOM(){return{blockquote:t=>({conversion:Tt,priority:0})}}exportDOM(t){const{element:e}=super.exportDOM(t);if(i(e)){this.isEmpty()&&e.append(document.createElement(\"br\"));const t=this.getFormatType();t&&(e.style.textAlign=t);const n=this.getDirection();n&&(e.dir=n)}return{element:e}}static importJSON(t){return xt().updateFromJSON(t)}insertNewAfter(t,e){const n=m(),r=this.getDirection();return n.setDirection(r),this.insertAfter(n,e),n}collapseAtStart(){const t=m();return this.getChildren().forEach((e=>t.append(e))),this.replace(t),!0}canMergeWhenEmpty(){return!0}}function xt(){return f(new Dt)}function wt(t){return t instanceof Dt}class Nt extends d{static getType(){return\"heading\"}static clone(t){return new Nt(t.__tag,t.__key)}constructor(t,e){super(e),this.__tag=t}getTag(){return this.__tag}setTag(t){const e=this.getWritable();return this.__tag=t,e}createDOM(t){const e=this.__tag,n=document.createElement(e),r=t.theme.heading;if(void 0!==r){const t=r[e];o(n,t)}return n}updateDOM(t,e,n){return t.__tag!==this.__tag}static importDOM(){return{h1:t=>({conversion:Ot,priority:0}),h2:t=>({conversion:Ot,priority:0}),h3:t=>({conversion:Ot,priority:0}),h4:t=>({conversion:Ot,priority:0}),h5:t=>({conversion:Ot,priority:0}),h6:t=>({conversion:Ot,priority:0}),p:t=>{const e=t.firstChild;return null!==e&&Et(e)?{conversion:()=>({node:null}),priority:3}:null},span:t=>Et(t)?{conversion:t=>({node:_t(\"h1\")}),priority:3}:null}}exportDOM(t){const{element:e}=super.exportDOM(t);if(i(e)){this.isEmpty()&&e.append(document.createElement(\"br\"));const t=this.getFormatType();t&&(e.style.textAlign=t);const n=this.getDirection();n&&(e.dir=n)}return{element:e}}static importJSON(t){return _t(t.tag).updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setTag(t.tag)}exportJSON(){return{...super.exportJSON(),tag:this.getTag()}}insertNewAfter(t,e=!0){const n=t?t.anchor.offset:0,r=this.getLastDescendant(),o=!r||t&&t.anchor.key===r.getKey()&&n===r.getTextContentSize()||!t?m():_t(this.getTag()),i=this.getDirection();if(o.setDirection(i),this.insertAfter(o,e),0===n&&!this.isEmpty()&&t){const t=m();t.select(),this.replace(t,!0)}return o}collapseAtStart(){const t=this.isEmpty()?m():_t(this.getTag());return this.getChildren().forEach((e=>t.append(e))),this.replace(t),!0}extractWithChild(){return!0}}function Et(t){return\"span\"===t.nodeName.toLowerCase()&&\"26pt\"===t.style.fontSize}function Ot(t){const e=t.nodeName.toLowerCase();let n=null;return\"h1\"!==e&&\"h2\"!==e&&\"h3\"!==e&&\"h4\"!==e&&\"h5\"!==e&&\"h6\"!==e||(n=_t(e),null!==t.style&&(g(t,n),n.setFormat(t.style.textAlign))),{node:n}}function Tt(t){const e=xt();return null!==t.style&&(e.setFormat(t.style.textAlign),g(t,e)),{node:e}}function _t(t=\"h1\"){return f(new Nt(t))}function At(t){return t instanceof Nt}function Ft(t){let e=null;if(s(t,DragEvent)?e=t.dataTransfer:s(t,ClipboardEvent)&&(e=t.clipboardData),null===e)return[!1,[],!1];const n=e.types,r=n.includes(\"Files\"),o=n.includes(\"text/html\")||n.includes(\"text/plain\");return[r,Array.from(e.files),o]}function St(t){const e=h();if(!D(e))return!1;const n=new Set,r=e.getNodes();for(let e=0;e<r.length;e++){const o=r[e],i=o.getKey();if(n.has(i))continue;const s=c(o,(t=>_(t)&&!t.isInline()));if(null===s)continue;const a=s.getKey();s.canIndent()&&!n.has(a)&&(n.add(a),t(s))}return n.size>0}function It(t){const e=G(t);return J(e)}function Pt(t){for(const e of[\"lowercase\",\"uppercase\",\"capitalize\"])t.hasFormat(e)&&t.toggleFormat(e)}function Mt(o){return a(o.registerCommand(p,(t=>{const e=h();return!!C(e)&&(e.clear(),!0)}),v),o.registerCommand(y,(t=>{const e=h();return D(e)?(e.deleteCharacter(t),!0):!!C(e)&&(e.deleteNodes(),!0)}),v),o.registerCommand(x,(t=>{const e=h();return!!D(e)&&(e.deleteWord(t),!0)}),v),o.registerCommand(w,(t=>{const e=h();return!!D(e)&&(e.deleteLine(t),!0)}),v),o.registerCommand(N,(e=>{const n=h();if(\"string\"==typeof e)null!==n&&n.insertText(e);else{if(null===n)return!1;const r=e.dataTransfer;if(null!=r)t(r,n,o);else if(D(n)){const t=e.data;return t&&n.insertText(t),!0}}return!0}),v),o.registerCommand(E,(()=>{const t=h();return!!D(t)&&(t.removeText(),!0)}),v),o.registerCommand(O,(t=>{const e=h();return!!D(e)&&(e.formatText(t),!0)}),v),o.registerCommand(T,(t=>{const e=h();if(!D(e)&&!C(e))return!1;const n=e.getNodes();for(const e of n){const n=c(e,(t=>_(t)&&!t.isInline()));null!==n&&n.setFormat(t)}return!0}),v),o.registerCommand(A,(t=>{const e=h();return!!D(e)&&(e.insertLineBreak(t),!0)}),v),o.registerCommand(F,(()=>{const t=h();return!!D(t)&&(t.insertParagraph(),!0)}),v),o.registerCommand(S,(()=>(I([P()]),!0)),v),o.registerCommand(M,(()=>St((t=>{const e=t.getIndent();t.setIndent(e+1)}))),v),o.registerCommand(b,(()=>St((t=>{const e=t.getIndent();e>0&&t.setIndent(Math.max(0,e-1))}))),v),o.registerCommand(K,(t=>{const e=h();if(C(e)){const t=e.getNodes();if(t.length>0)return t[0].selectPrevious(),!0}else if(D(e)){const n=k(e.focus,!0);if(!t.shiftKey&&J(n)&&!n.isIsolated()&&!n.isInline())return n.selectPrevious(),t.preventDefault(),!0}return!1}),v),o.registerCommand(L,(t=>{const e=h();if(C(e)){const t=e.getNodes();if(t.length>0)return t[0].selectNext(0,0),!0}else if(D(e)){if(function(t){const e=t.focus;return\"root\"===e.key&&e.offset===ut().getChildrenSize()}(e))return t.preventDefault(),!0;const n=k(e.focus,!1);if(!t.shiftKey&&J(n)&&!n.isIsolated()&&!n.isInline())return n.selectNext(),t.preventDefault(),!0}return!1}),v),o.registerCommand(R,(t=>{const e=h();if(C(e)){const n=e.getNodes();if(n.length>0)return t.preventDefault(),n[0].selectPrevious(),!0}if(!D(e))return!1;if(n(e,!0)){const n=t.shiftKey;return t.preventDefault(),r(e,n,!0),!0}return!1}),v),o.registerCommand(W,(t=>{const e=h();if(C(e)){const n=e.getNodes();if(n.length>0)return t.preventDefault(),n[0].selectNext(0,0),!0}if(!D(e))return!1;const o=t.shiftKey;return!!n(e,!1)&&(t.preventDefault(),r(e,o,!1),!0)}),v),o.registerCommand(z,(t=>{if(It(t.target))return!1;const e=h();if(D(e)){if(function(t){if(!t.isCollapsed())return!1;const{anchor:e}=t;if(0!==e.offset)return!1;const n=e.getNode();if(lt(n))return!1;const r=u(n);return r.getIndent()>0&&(r.is(n)||n.is(r.getFirstDescendant()))}(e))return t.preventDefault(),o.dispatchCommand(b,void 0);if(ht&&\"ko-KR\"===navigator.language)return!1}else if(!C(e))return!1;return t.preventDefault(),o.dispatchCommand(y,!0)}),v),o.registerCommand(q,(t=>{if(It(t.target))return!1;const e=h();return!(!D(e)&&!C(e))&&(t.preventDefault(),o.dispatchCommand(y,!1))}),v),o.registerCommand(X,(t=>{const e=h();if(!D(e))return!1;if(Pt(e),null!==t){if((ht||pt||vt)&&gt)return!1;if(t.preventDefault(),t.shiftKey)return o.dispatchCommand(A,!1)}return o.dispatchCommand(F,void 0)}),v),o.registerCommand(Y,(()=>{const t=h();return!!D(t)&&(o.blur(),!0)}),v),o.registerCommand(B,(t=>{const[,e]=Ft(t);if(e.length>0){const n=dt(t.clientX,t.clientY);if(null!==n){const{offset:t,node:r}=n,i=G(r);if(null!==i){const e=V();if(j(i))e.anchor.set(i.getKey(),t,\"text\"),e.focus.set(i.getKey(),t,\"text\");else{const t=i.getParentOrThrow().getKey(),n=i.getIndexWithinParent()+1;e.anchor.set(t,n,\"element\"),e.focus.set(t,n,\"element\")}const n=H(e);Q(n)}o.dispatchCommand(yt,e)}return t.preventDefault(),!0}const n=h();return!!D(n)}),v),o.registerCommand(U,(t=>{const[e]=Ft(t),n=h();return!(e&&!D(n))}),v),o.registerCommand(Z,(t=>{const[e]=Ft(t),n=h();if(e&&!D(n))return!1;const r=dt(t.clientX,t.clientY);if(null!==r){const e=G(r.node);J(e)&&t.preventDefault()}return!0}),v),o.registerCommand($,(()=>(tt(),!0)),v),o.registerCommand(et,(t=>(e(o,s(t,ClipboardEvent)?t:null),!0)),v),o.registerCommand(nt,(t=>(async function(t,n){await e(n,s(t,ClipboardEvent)?t:null),n.update((()=>{const t=h();D(t)?t.removeText():C(t)&&t.getNodes().forEach((t=>t.remove()))}))}(t,o),!0)),v),o.registerCommand(rt,(e=>{const[,n,r]=Ft(e);if(n.length>0&&!r)return o.dispatchCommand(yt,n),!0;if(ot(e.target)&&it(e.target))return!1;return null!==h()&&(function(e,n){e.preventDefault(),n.update((()=>{const r=h(),o=s(e,InputEvent)||s(e,KeyboardEvent)?null:e.clipboardData;null!=o&&null!==r&&t(o,r,n)}),{tag:ct})}(e,o),!0)}),v),o.registerCommand(st,(t=>{const e=h();return D(e)&&Pt(e),!1}),v),o.registerCommand(at,(t=>{const e=h();return D(e)&&Pt(e),!1}),v))}export{_t as $createHeadingNode,xt as $createQuoteNode,At as $isHeadingNode,wt as $isQuoteNode,yt as DRAG_DROP_PASTE,Nt as HeadingNode,Dt as QuoteNode,Ft as eventFiles,Mt as registerRichText};\n","/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport{useLexicalComposerContext as t}from\"@lexical/react/LexicalComposerContext\";import{useLexicalEditable as e}from\"@lexical/react/useLexicalEditable\";import{$canShowPlaceholderCurry as r}from\"@lexical/text\";import{mergeRegister as o}from\"@lexical/utils\";import{useLayoutEffect as n,useEffect as i,useState as c,useMemo as l,Suspense as a}from\"react\";import{flushSync as u,createPortal as m}from\"react-dom\";import{jsx as s,jsxs as d,Fragment as f}from\"react/jsx-runtime\";import{registerDragonSupport as p}from\"@lexical/dragon\";import{registerRichText as x}from\"@lexical/rich-text\";const g=\"undefined\"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?n:i;function E(t){return t.getEditorState().read(r(t.isComposing()))}function h({contentEditable:e,placeholder:r=null,ErrorBoundary:n}){const[E]=t(),h=function(t,e){const[r,o]=c((()=>t.getDecorators()));return g((()=>t.registerDecoratorListener((t=>{u((()=>{o(t)}))}))),[t]),i((()=>{o(t.getDecorators())}),[t]),l((()=>{const o=[],n=Object.keys(r);for(let i=0;i<n.length;i++){const c=n[i],l=s(e,{onError:e=>t._onError(e),children:s(a,{fallback:null,children:r[c]})}),u=t.getElementByKey(c);null!==u&&o.push(m(l,u,c))}return o}),[e,r,t])}(E,n);return function(t){g((()=>o(x(t),p(t))),[t])}(E),d(f,{children:[e,s(w,{content:r}),h]})}function w({content:r}){const[n]=t(),i=function(t){const[e,r]=c((()=>E(t)));return g((()=>{function e(){const e=E(t);r(e)}return e(),o(t.registerUpdateListener((()=>{e()})),t.registerEditableListener((()=>{e()})))}),[t]),e}(n),l=e();return i?\"function\"==typeof r?r(l):r:null}export{h as RichTextPlugin};\n","/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport{useLexicalComposerContext as e}from\"@lexical/react/LexicalComposerContext\";import{useLayoutEffect as t,useEffect as i,forwardRef as a,useState as r,useCallback as n,useMemo as o}from\"react\";import{jsx as l,jsxs as d,Fragment as c}from\"react/jsx-runtime\";import{$canShowPlaceholderCurry as s}from\"@lexical/text\";import{mergeRegister as u}from\"@lexical/utils\";const m=\"undefined\"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?t:i;function f({editor:e,ariaActiveDescendant:t,ariaAutoComplete:i,ariaControls:a,ariaDescribedBy:d,ariaErrorMessage:c,ariaExpanded:s,ariaInvalid:u,ariaLabel:f,ariaLabelledBy:b,ariaMultiline:p,ariaOwns:x,ariaRequired:E,autoCapitalize:v,className:w,id:y,role:C=\"textbox\",spellCheck:g=!0,style:h,tabIndex:L,\"data-testid\":D,...I},R){const[k,q]=r(e.isEditable()),z=n((t=>{t&&t.ownerDocument&&t.ownerDocument.defaultView?e.setRootElement(t):e.setRootElement(null)}),[e]),A=o((()=>function(...e){return t=>{e.forEach((e=>{\"function\"==typeof e?e(t):null!=e&&(e.current=t)}))}}(R,z)),[z,R]);return m((()=>(q(e.isEditable()),e.registerEditableListener((e=>{q(e)})))),[e]),l(\"div\",{\"aria-activedescendant\":k?t:void 0,\"aria-autocomplete\":k?i:\"none\",\"aria-controls\":k?a:void 0,\"aria-describedby\":d,...null!=c?{\"aria-errormessage\":c}:{},\"aria-expanded\":k&&\"combobox\"===C?!!s:void 0,...null!=u?{\"aria-invalid\":u}:{},\"aria-label\":f,\"aria-labelledby\":b,\"aria-multiline\":p,\"aria-owns\":k?x:void 0,\"aria-readonly\":!k||void 0,\"aria-required\":E,autoCapitalize:v,className:w,contentEditable:k,\"data-testid\":D,id:y,ref:A,role:C,spellCheck:g,style:h,tabIndex:L,...I})}const b=a(f);function p(e){return e.getEditorState().read(s(e.isComposing()))}const x=a(E);function E(t,i){const{placeholder:a,...r}=t,[n]=e();return d(c,{children:[l(b,{editor:n,...r,ref:i}),null!=a&&l(v,{editor:n,content:a})]})}function v({content:e,editor:i}){const a=function(e){const[t,i]=r((()=>p(e)));return m((()=>{function t(){const t=p(e);i(t)}return t(),u(e.registerUpdateListener((()=>{t()})),e.registerEditableListener((()=>{t()})))}),[e]),t}(i),[n,o]=r(i.isEditable());if(t((()=>(o(i.isEditable()),i.registerEditableListener((e=>{o(e)})))),[i]),!a)return null;let d=null;return\"function\"==typeof e?d=e(n):null!==e&&(d=e),null===d?null:l(\"div\",{\"aria-hidden\":!0,children:d})}export{x as ContentEditable,b as ContentEditableElement};\n","/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport*as r from\"react\";import{jsx as e}from\"react/jsx-runtime\";function t(r,e){return t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,e){return r.__proto__=e,r},t(r,e)}var o={error:null},n=function(e){var n,a;function s(){for(var r,t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a];return(r=e.call.apply(e,[this].concat(n))||this).state=o,r.resetErrorBoundary=function(){for(var e,t=arguments.length,o=new Array(t),n=0;n<t;n++)o[n]=arguments[n];null==r.props.onReset||(e=r.props).onReset.apply(e,o),r.reset()},r}a=e,(n=s).prototype=Object.create(a.prototype),n.prototype.constructor=n,t(n,a),s.getDerivedStateFromError=function(r){return{error:r}};var i=s.prototype;return i.reset=function(){this.setState(o)},i.componentDidCatch=function(r,e){var t,o;null==(t=(o=this.props).onError)||t.call(o,r,e)},i.componentDidUpdate=function(r,e){var t,o,n,a,s=this.state.error,i=this.props.resetKeys;null!==s&&null!==e.error&&(void 0===(n=r.resetKeys)&&(n=[]),void 0===(a=i)&&(a=[]),n.length!==a.length||n.some((function(r,e){return!Object.is(r,a[e])})))&&(null==(t=(o=this.props).onResetKeysChange)||t.call(o,r.resetKeys,i),this.reset())},i.render=function(){var e=this.state.error,t=this.props,o=t.fallbackRender,n=t.FallbackComponent,a=t.fallback;if(null!==e){var s={error:e,resetErrorBoundary:this.resetErrorBoundary};if(r.isValidElement(a))return a;if(\"function\"==typeof o)return o(s);if(n)return r.createElement(n,s);throw new Error(\"react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop\")}return this.props.children},s}(r.Component);function a({children:r,onError:t}){return e(n,{fallback:e(\"div\",{style:{border:\"1px solid #f00\",color:\"#f00\",padding:\"8px\"},children:\"An error was thrown.\"}),onError:t,children:r})}export{a as LexicalErrorBoundary};\n","/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport{useLexicalComposerContext as e}from\"@lexical/react/LexicalComposerContext\";import{HISTORY_MERGE_TAG as t}from\"lexical\";import{useLayoutEffect as o,useEffect as i}from\"react\";const r=\"undefined\"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?o:i;function n({ignoreHistoryMergeTagChange:o=!0,ignoreSelectionChange:i=!1,onChange:n}){const[a]=e();return r((()=>{if(n)return a.registerUpdateListener((({editorState:e,dirtyElements:r,dirtyLeaves:d,prevEditorState:s,tags:c})=>{i&&0===r.size&&0===d.size||o&&c.has(t)||s.isEmpty()||n(e,a,c)}))}),[a,o,i,n]),null}export{n as OnChangePlugin};\n","/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport{registerList as t,ListNode as r,ListItemNode as o,registerListStrictIndentTransform as e}from\"@lexical/list\";import{useLexicalComposerContext as i}from\"@lexical/react/LexicalComposerContext\";import{useEffect as n}from\"react\";function s({hasStrictIndent:s=!1}){const[c]=i();return n((()=>{if(!c.hasNodes([r,o]))throw new Error(\"ListPlugin: ListNode and/or ListItemNode not registered on editor\")}),[c]),n((()=>{if(s)return e(c)}),[c,s]),function(r){n((()=>t(r)),[r])}(c),null}export{s as ListPlugin};\n","/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport{LinkNode as t,TOGGLE_LINK_COMMAND as r,$toggleLink as e}from\"@lexical/link\";import{useLexicalComposerContext as o}from\"@lexical/react/LexicalComposerContext\";import{mergeRegister as i,objectKlassEquals as l}from\"@lexical/utils\";import{COMMAND_PRIORITY_LOW as n,PASTE_COMMAND as a,$getSelection as m,$isRangeSelection as s,$isElementNode as u}from\"lexical\";import{useEffect as d}from\"react\";function c({validateUrl:c,attributes:p}){const[f]=o();return d((()=>{if(!f.hasNodes([t]))throw new Error(\"LinkPlugin: LinkNode not registered on editor\");return i(f.registerCommand(r,(t=>{if(null===t)return e(t),!0;if(\"string\"==typeof t)return!(void 0!==c&&!c(t))&&(e(t,p),!0);{const{url:r,target:o,rel:i,title:l}=t;return e(r,{...p,rel:i,target:o,title:l}),!0}}),n),void 0!==c?f.registerCommand(a,(t=>{const e=m();if(!s(e)||e.isCollapsed()||!l(t,ClipboardEvent))return!1;if(null===t.clipboardData)return!1;const o=t.clipboardData.getData(\"text\");return!!c(o)&&(!e.getNodes().some((t=>u(t)))&&(f.dispatchCommand(r,{...p,url:o}),t.preventDefault(),!0))}),n):()=>{})}),[f,c,p]),null}export{c as LinkPlugin};\n","/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport{$isLinkNode as e}from\"@lexical/link\";import{useLexicalComposerContext as t}from\"@lexical/react/LexicalComposerContext\";import{$findMatchingParent as n,isHTMLAnchorElement as r}from\"@lexical/utils\";import{isDOMNode as l,getNearestEditorFromDOMNode as o,$getNearestNodeFromDOMNode as i,$isElementNode as u,$getSelection as a,$isRangeSelection as c}from\"lexical\";import{useEffect as s}from\"react\";function f({newTab:f=!0,disabled:m=!1}){const[p]=t();return s((()=>{const t=t=>{const s=t.target;if(!l(s))return;const d=o(s);if(null===d)return;let v=null,x=null;if(d.update((()=>{const t=i(s);if(null!==t){const l=n(t,u);if(!m)if(e(l))v=l.sanitizeUrl(l.getURL()),x=l.getTarget();else{const e=function(e,t){let n=e;for(;null!=n;){if(t(n))return n;n=n.parentNode}return null}(s,r);null!==e&&(v=e.href,x=e.target)}}})),null===v||\"\"===v)return;const g=p.getEditorState().read(a);if(c(g)&&!g.isCollapsed())return void t.preventDefault();const L=\"auxclick\"===t.type&&1===t.button;window.open(v,f||L||t.metaKey||t.ctrlKey||\"_blank\"===x?\"_blank\":\"_self\"),t.preventDefault()},s=e=>{1===e.button&&t(e)};return p.registerRootListener(((e,n)=>{null!==n&&(n.removeEventListener(\"click\",t),n.removeEventListener(\"mouseup\",s)),null!==e&&(e.addEventListener(\"click\",t),e.addEventListener(\"mouseup\",s))}))}),[p,f,m]),null}export{f as ClickableLinkPlugin};\n","/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport{mergeRegister as t}from\"@lexical/utils\";import{UNDO_COMMAND as e,COMMAND_PRIORITY_EDITOR as n,REDO_COMMAND as r,CLEAR_EDITOR_COMMAND as o,CLEAR_HISTORY_COMMAND as i,CAN_REDO_COMMAND as c,CAN_UNDO_COMMAND as s,HISTORIC_TAG as a,HISTORY_PUSH_TAG as u,HISTORY_MERGE_TAG as d,$isRangeSelection as l,$isTextNode as f,$isRootNode as p}from\"lexical\";const m=0,h=1,_=2,g=0,S=1,k=2,y=3,C=4;function x(t,e,n,r,o){if(null===t||0===n.size&&0===r.size&&!o)return g;const i=e._selection,c=t._selection;if(o)return S;if(!(l(i)&&l(c)&&c.isCollapsed()&&i.isCollapsed()))return g;const s=function(t,e,n){const r=t._nodeMap,o=[];for(const t of e){const e=r.get(t);void 0!==e&&o.push(e)}for(const[t,e]of n){if(!e)continue;const n=r.get(t);void 0===n||p(n)||o.push(n)}return o}(e,n,r);if(0===s.length)return g;if(s.length>1){const n=e._nodeMap,r=n.get(i.anchor.key),o=n.get(c.anchor.key);return r&&o&&!t._nodeMap.has(r.__key)&&f(r)&&1===r.__text.length&&1===i.anchor.offset?k:g}const a=s[0],u=t._nodeMap.get(a.__key);if(!f(u)||!f(a)||u.__mode!==a.__mode)return g;const d=u.__text,m=a.__text;if(d===m)return g;const h=i.anchor,_=c.anchor;if(h.key!==_.key||\"text\"!==h.type)return g;const x=h.offset,M=_.offset,z=m.length-d.length;return 1===z&&M===x-1?k:-1===z&&M===x+1?y:-1===z&&M===x?C:g}function M(t,e){let n=Date.now(),r=g;return(o,i,c,s,p,S)=>{const k=Date.now();if(S.has(a))return r=g,n=k,_;const y=x(o,i,s,p,t.isComposing()),C=(()=>{const a=null===c||c.editor===t,C=S.has(u);if(!C&&a&&S.has(d))return m;if(null===o)return h;const x=i._selection;if(!(s.size>0||p.size>0))return null!==x?m:_;if(!1===C&&y!==g&&y===r&&k<n+e&&a)return m;if(1===s.size){if(function(t,e,n){const r=e._nodeMap.get(t),o=n._nodeMap.get(t),i=e._selection,c=n._selection;return!(l(i)&&l(c)&&\"element\"===i.anchor.type&&\"element\"===i.focus.type&&\"text\"===c.anchor.type&&\"text\"===c.focus.type||!f(r)||!f(o)||r.__parent!==o.__parent)&&JSON.stringify(e.read((()=>r.exportJSON())))===JSON.stringify(n.read((()=>o.exportJSON())))}(Array.from(s)[0],o,i))return m}return h})();return n=k,r=y,C}}function z(t){t.undoStack=[],t.redoStack=[],t.current=null}function v(u,d,l){const f=M(u,l),p=t(u.registerCommand(e,(()=>(function(t,e){const n=e.redoStack,r=e.undoStack;if(0!==r.length){const o=e.current,i=r.pop();null!==o&&(n.push(o),t.dispatchCommand(c,!0)),0===r.length&&t.dispatchCommand(s,!1),e.current=i||null,i&&i.editor.setEditorState(i.editorState,{tag:a})}}(u,d),!0)),n),u.registerCommand(r,(()=>(function(t,e){const n=e.redoStack,r=e.undoStack;if(0!==n.length){const o=e.current;null!==o&&(r.push(o),t.dispatchCommand(s,!0));const i=n.pop();0===n.length&&t.dispatchCommand(c,!1),e.current=i||null,i&&i.editor.setEditorState(i.editorState,{tag:a})}}(u,d),!0)),n),u.registerCommand(o,(()=>(z(d),!1)),n),u.registerCommand(i,(()=>(z(d),u.dispatchCommand(c,!1),u.dispatchCommand(s,!1),!0)),n),u.registerUpdateListener((({editorState:t,prevEditorState:e,dirtyLeaves:n,dirtyElements:r,tags:o})=>{const i=d.current,a=d.redoStack,l=d.undoStack,p=null===i?null:i.editorState;if(null!==i&&t===p)return;const m=f(e,t,i,n,r,o);if(m===h)0!==a.length&&(d.redoStack=[],u.dispatchCommand(c,!1)),null!==i&&(l.push({...i}),u.dispatchCommand(s,!0));else if(m===_)return;d.current={editor:u,editorState:t}})));return p}function E(){return{current:null,redoStack:[],undoStack:[]}}export{E as createEmptyHistoryState,v as registerHistory};\n","/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport{useLexicalComposerContext as t}from\"@lexical/react/LexicalComposerContext\";import{createEmptyHistoryState as o,registerHistory as r}from\"@lexical/history\";export{createEmptyHistoryState}from\"@lexical/history\";import{useMemo as e,useEffect as i}from\"react\";function a({delay:a,externalHistoryState:c}){const[l]=t();return function(t,a,c=1e3){const l=e((()=>a||o()),[a]);i((()=>r(t,l,c)),[c,t,l])}(l,c,a),null}export{a as HistoryPlugin};\n","/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport{useLexicalComposerContext as r}from\"@lexical/react/LexicalComposerContext\";import{$isScrollableTablesActive as o,setScrollableTablesActive as e,TableNode as l,registerTablePlugin as t,registerTableSelectionObserver as a,registerTableCellUnmergeTransform as n,TableCellNode as i}from\"@lexical/table\";import{useEffect as c}from\"react\";function s({hasCellMerge:s=!0,hasCellBackgroundColor:u=!0,hasTabHandler:m=!0,hasHorizontalScroll:f=!1}){const[g]=r();return c((()=>{o(g)!==f&&(e(g,f),g.registerNodeTransform(l,(()=>{}))())}),[g,f]),c((()=>t(g)),[g]),c((()=>a(g,m)),[g,m]),c((()=>{if(!s)return n(g)}),[g,s]),c((()=>{if(!u)return g.registerNodeTransform(i,(r=>{null!==r.getBackgroundColor()&&r.setBackgroundColor(null)}))}),[g,u,s]),null}export{s as TablePlugin};\n","import { LexicalComposer } from '@lexical/react/LexicalComposer';\nimport { RichTextPlugin } from '@lexical/react/LexicalRichTextPlugin';\nimport { ContentEditable } from '@lexical/react/LexicalContentEditable';\nimport { LexicalErrorBoundary } from '@lexical/react/LexicalErrorBoundary';\nimport { OnChangePlugin } from '@lexical/react/LexicalOnChangePlugin';\nimport { $generateHtmlFromNodes, $generateNodesFromDOM } from '@lexical/html';\nimport { $createParagraphNode, $getRoot, createEditor } from 'lexical';\nimport { ListItemNode, ListNode } from '@lexical/list';\nimport { ListPlugin } from '@lexical/react/LexicalListPlugin';\nimport { LinkPlugin } from '@lexical/react/LexicalLinkPlugin';\nimport { AutoLinkNode, LinkNode } from '@lexical/link';\nimport { TableCellNode, TableNode, TableRowNode } from '@lexical/table';\nimport { AutoLinkPlugin } from '@lexical/react/LexicalAutoLinkPlugin';\nimport { ClickableLinkPlugin } from '@lexical/react/LexicalClickableLinkPlugin';\nimport { HistoryPlugin } from '@lexical/react/LexicalHistoryPlugin';\nimport { TablePlugin } from '@lexical/react/LexicalTablePlugin';\nimport { useEffect, useRef, useState } from 'react';\nimport { clsx } from 'clsx';\n\nimport type { EditorState, LexicalEditor } from 'lexical';\n\nimport { exportMap, isStartingWithHtmlTag, mergeBoldStrongTags, cleanUpTable } from './helpers';\nimport { MATCHERS, validateUrl } from './Plugins/LinkPlugin/helpers';\nimport styles from './RteEditor.module.css';\nimport { ToolBarPlugin, PasteHandlerPlugin, TableCellResizerPlugin } from './Plugins';\nimport { UvaTheme } from './UvaTheme';\nimport { EditorHeader } from './EditorHeader';\nimport { LanguageProvider, useLanguage } from './Providers/LanguageProvider';\nimport { useTranslation } from './hooks/useTranslation';\nimport { TableWrapperNode } from './nodes';\n\nimport { FeedbackBox } from 'components/FeedbackBox';\n\nexport interface RteEditorProps {\n /** current language setting for the editor labels NOT title ans label */\n currentLanguage?: 'NL' | 'EN';\n /** imported content to edit */\n initialValue?: string;\n /** placeholder text in current Language */\n placeholder?: string;\n /** label/title of the RTE in current Language */\n label?: string;\n /** explanation of the text to be filled in, in current Language */\n info?: string;\n /** 'true' the rte field mandatory */\n required?: boolean;\n /** max number of words 'allowed' but not enforced */\n maxWords?: number;\n /** max height in rem default = 20rem*/\n maxHeightInRem?: `${number}rem`;\n /** error text to display if required and field is empty */\n notValidatedText?: string;\n /** updated output */\n onChange: (content: string) => void;\n}\n\nconst DEFAULT_MAX_WORDS = 200;\n\nexport const Rte = ({\n currentLanguage = 'NL',\n initialValue = '',\n placeholder = '',\n label = '',\n info = '',\n required = false,\n notValidatedText = '',\n maxHeightInRem = '20rem',\n maxWords = DEFAULT_MAX_WORDS,\n onChange,\n}: RteEditorProps) => {\n const { switchLanguage } = useLanguage();\n const t = useTranslation();\n const [editor] = useState(() => createEditor());\n const [wordCount, setWordCount] = useState(0);\n const [scrollTopPosition, setScrollTopPosition] = useState(0);\n const editorRef = useRef<HTMLDivElement>(null);\n\n const initialConfig = {\n html: {\n export: exportMap,\n },\n namespace: 'UvaRte',\n editor,\n theme: UvaTheme,\n onError(error: Error) {\n throw error;\n },\n nodes: [ListNode, ListItemNode, LinkNode, AutoLinkNode, TableCellNode, TableRowNode, TableNode, TableWrapperNode],\n editorState: (editor: LexicalEditor) => {\n const parser = new DOMParser();\n const dom = parser.parseFromString(initialValue, 'text/html');\n const nodes = $generateNodesFromDOM(editor, dom);\n const root = $getRoot();\n root.clear();\n if (isStartingWithHtmlTag(initialValue)) {\n nodes.forEach((node) => {\n root.append(node);\n });\n } else {\n const paragraphNode = $createParagraphNode();\n nodes.forEach((node, index) => {\n if (index === 0) {\n paragraphNode.append(node);\n root.append(paragraphNode);\n } else {\n root.append(node);\n }\n });\n }\n },\n };\n\n const getWordCount = (plainText: string): number => {\n if (plainText.trim().length === 0) {\n return 0;\n } else {\n return plainText.split(' ').length;\n }\n };\n\n const handleOnChange = (editorState: EditorState, editor: LexicalEditor): void => {\n editorState.read(() => {\n let htmlContent = '';\n setWordCount(getWordCount($getRoot().getTextContent().replace(/\\s+/g, ' ').trim()));\n htmlContent = mergeBoldStrongTags($generateHtmlFromNodes(editor));\n htmlContent = cleanUpTable(htmlContent);\n onChange(htmlContent);\n });\n };\n\n useEffect(() => {\n switchLanguage(currentLanguage.toLocaleLowerCase());\n }, [currentLanguage, switchLanguage]);\n\n useEffect(() => {\n const strippedInitialValue = initialValue\n .replace(/<br\\s*\\/?>|&nbsp;/gi, ' ')\n .replace(/<\\/?[^>]+(>|$)|&[a-z]+;/g, '')\n .replace(/\\s+/g, ' ')\n .trim();\n setWordCount(getWordCount(strippedInitialValue));\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return (\n <div className={styles['editor__container']}>\n <div className={styles['editor__header']}>\n <EditorHeader label={label} info={info} required={required} />\n <div className={styles['editor__header-word-count']}>\n <span className={clsx({ [styles['editor__header-word-count--alert']]: wordCount > maxWords })}>\n {wordCount}\n </span>\n &nbsp;/&nbsp;{maxWords}\n </div>\n </div>\n <div className={styles['editor']}>\n <LexicalComposer initialConfig={initialConfig}>\n <ToolBarPlugin editorScrollPosition={scrollTopPosition} />\n <div className={styles['editor__field-wrapper']}>\n <RichTextPlugin\n contentEditable={\n <ContentEditable\n className={styles['editor__field']}\n aria-label={t.common.rteAriaLabel}\n aria-placeholder={placeholder}\n title={t.common.rteTitle}\n placeholder={<div className={styles['editor__placeholder']}>{placeholder}</div>}\n spellCheck={false}\n id=\"rteEditor\"\n style={{ height: `${maxHeightInRem}`, maxHeight: `${maxHeightInRem}` }}\n onScroll={(event) => setScrollTopPosition(event.currentTarget.scrollTop)}\n ref={editorRef}\n />\n }\n placeholder={<div className={styles['editor__placeholder']}>{placeholder}</div>}\n ErrorBoundary={LexicalErrorBoundary}\n />\n <TablePlugin />\n <TableCellResizerPlugin />\n <HistoryPlugin />\n <ListPlugin />\n <LinkPlugin validateUrl={validateUrl} />\n <AutoLinkPlugin matchers={MATCHERS} />\n <ClickableLinkPlugin />\n <OnChangePlugin onChange={handleOnChange} />\n <PasteHandlerPlugin />\n </div>\n </LexicalComposer>\n </div>\n {notValidatedText !== '' && <FeedbackBox level=\"error\" feedback={notValidatedText} />}\n </div>\n );\n};\n\nexport const RteEditor = ({\n currentLanguage = 'NL',\n initialValue = '',\n placeholder = '',\n label = '',\n info = '',\n required = false,\n notValidatedText = '',\n maxWords = DEFAULT_MAX_WORDS,\n onChange,\n}: RteEditorProps) => (\n <LanguageProvider>\n <Rte\n currentLanguage={currentLanguage}\n initialValue={initialValue}\n placeholder={placeholder}\n label={label}\n info={info}\n required={required}\n notValidatedText={notValidatedText}\n maxWords={maxWords}\n onChange={onChange}\n />\n </LanguageProvider>\n);\n"],"names":["m","u","c","l","p","a","f","d","t","s","e","E","o","n","i","r","g","dt","mt","ft","gt","pt","ht","Ct","vt","yt","Ft","St","h","D","_","It","G","J","Pt","Mt","C","v","y","x","w","N","O","T","A","F","S","I","P","M","b","K","k","L","ut","R","W","z","lt","q","X","Y","B","V","j","H","Q","U","Z","$","tt","et","nt","rt","ot","it","ct","st","at","DEFAULT_MAX_WORDS","Rte","currentLanguage","initialValue","placeholder","label","info","required","notValidatedText","maxHeightInRem","maxWords","onChange","switchLanguage","useLanguage","useTranslation","editor","useState","createEditor","wordCount","setWordCount","scrollTopPosition","setScrollTopPosition","editorRef","useRef","initialConfig","exportMap","UvaTheme","error","ListNode","ListItemNode","LinkNode","AutoLinkNode","TableCellNode","TableRowNode","TableNode","TableWrapperNode","dom","nodes","$generateNodesFromDOM","root","$getRoot","isStartingWithHtmlTag","node","paragraphNode","$createParagraphNode","index","getWordCount","plainText","handleOnChange","editorState","htmlContent","mergeBoldStrongTags","$generateHtmlFromNodes","cleanUpTable","useEffect","strippedInitialValue","jsxs","styles","jsx","EditorHeader","clsx","LexicalComposer","ToolBarPlugin","RichTextPlugin","ContentEditable","event","LexicalErrorBoundary","TablePlugin","TableCellResizerPlugin","HistoryPlugin","ListPlugin","LinkPlugin","validateUrl","AutoLinkPlugin","MATCHERS","ClickableLinkPlugin","OnChangePlugin","PasteHandlerPlugin","FeedbackBox","RteEditor","LanguageProvider"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQsV,MAAMA,KAAe,OAAO,SAApB,OAAqC,OAAO,aAAhB,UAAmC,OAAO,SAAS,kBAAzB,QAAuCC,KAAED,KAAEE,IAAEC,GAAEC,IAAE,EAAC,KAAIC,GAAC;AAAE,SAASC,GAAE,EAAC,eAAcD,GAAE,UAASH,E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A,CACF,EAAA,CACF;AAAA,IACCrE,MAAqB,MAAM,gBAAAkD,EAACoB,MAAY,OAAM,SAAQ,UAAUtE,EAAA,CAAkB;AAAA,EAAA,GACrF;AAEJ,GAEauE,KAAY,CAAC;AAAA,EACxB,iBAAA7E,IAAkB;AAAA,EAClB,cAAAC,IAAe;AAAA,EACf,aAAAC,IAAc;AAAA,EACd,OAAAC,IAAQ;AAAA,EACR,MAAAC,IAAO;AAAA,EACP,UAAAC,IAAW;AAAA,EACX,kBAAAC,IAAmB;AAAA,EACnB,UAAAE,IAAWV;AAAA,EACX,UAAAW;AACF,wBACGqE,IAAA,EACC,UAAA,gBAAAtB;AAAA,EAACzD;AAAA,EAAA;AAAA,IACC,iBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,aAAAC;AAAA,IACA,OAAAC;AAAA,IACA,MAAAC;AAAA,IACA,UAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,UAAAE;AAAA,IACA,UAAAC;AAAA,EAAA;AACF,EAAA,CACF;","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13]}
@@ -1,6 +1,7 @@
1
1
  import { DOMExportOutput, LexicalEditor, LexicalNode } from 'lexical';
2
2
  export declare const isStartingWithHtmlTag: (str: string) => boolean;
3
3
  export declare const mergeBoldStrongTags: (html: string) => string;
4
+ export declare const cleanUpTable: (html: string) => string;
4
5
  export declare const removeStylesExportDOM: (editor: LexicalEditor, target: LexicalNode) => DOMExportOutput;
5
6
  export declare const exportMap: Map<import('lexical').KlassConstructor<typeof LexicalNode>, (editor: LexicalEditor, target: LexicalNode) => DOMExportOutput>;
6
7
  export declare const setScrollableContainers: (fn: (event: Event) => void) => void;
@@ -2,16 +2,16 @@ import { g as s } from "../../LexicalLink.prod-ldhpNY9X.js";
2
2
  import { r as n, Y as i } from "../../LexicalList.prod-7DmvPZ_J.js";
3
3
  import { ae as a, q as c } from "../../Lexical.prod-C1B_JvcI.js";
4
4
  import { a as m, O as g, y as u } from "../../LexicalTable.prod-iqHmKv_G.js";
5
- const h = (e) => /^<(b|i|u|strong|em|mark|small|del|ins|sub|sup|div|p|span|h[1-6]|a|img|table|tr|td|th|ul|ol|li|blockquote|pre|code|br)(\s+[^>]*)?>/i.test(e.trim()), y = (e) => {
6
- let r = e.replace(/<b><strong>/gi, "<strong>");
5
+ const h = (t) => /^<(b|i|u|strong|em|mark|small|del|ins|sub|sup|div|p|span|h[1-6]|a|img|table|tr|td|th|ul|ol|li|blockquote|pre|code|br)(\s+[^>]*)?>/i.test(t.trim()), v = (t) => {
6
+ let r = t.replace(/<b><strong>/gi, "<strong>");
7
7
  return r = r.replace(/<\/strong><\/b>/gi, "</strong>"), r;
8
- }, l = (e, r) => {
9
- const t = r.exportDOM(e);
10
- if (t && t.element instanceof HTMLElement)
11
- for (const o of [t.element, ...t.element.querySelectorAll('[style],[class],[dir="ltr"]')])
8
+ }, y = (t) => t.replace(/<div[^>]*>\s*(<table[\s\S]*?<\/table>)\s*<\/div>/gi, "$1").replace(/<colgroup[^>]*>[\s\S]*?<\/colgroup>/gi, ""), l = (t, r) => {
9
+ const e = r.exportDOM(t);
10
+ if (e && e.element instanceof HTMLElement)
11
+ for (const o of [e.element, ...e.element.querySelectorAll('[style],[class],[dir="ltr"]')])
12
12
  o.removeAttribute("class"), o.getAttribute("style") && (o.setAttribute("style", ""), o.removeAttribute("style")), o.getAttribute("dir") === "ltr" && o.removeAttribute("dir");
13
- return t;
14
- }, v = /* @__PURE__ */ new Map([
13
+ return e;
14
+ }, S = /* @__PURE__ */ new Map([
15
15
  [a, l],
16
16
  [c, l],
17
17
  [n, l],
@@ -20,20 +20,21 @@ const h = (e) => /^<(b|i|u|strong|em|mark|small|del|ins|sub|sup|div|p|span|h[1-6
20
20
  [g, l],
21
21
  [u, l],
22
22
  [s, l]
23
- ]), A = (e) => {
24
- document.querySelectorAll("*").forEach((t) => {
25
- t.scrollHeight > t.clientHeight && t.addEventListener("scroll", e);
23
+ ]), A = (t) => {
24
+ document.querySelectorAll("*").forEach((e) => {
25
+ e.scrollHeight > e.clientHeight && e.addEventListener("scroll", t);
26
26
  });
27
- }, S = (e) => {
28
- document.querySelectorAll("*").forEach((t) => {
29
- t.scrollHeight > t.clientHeight && t.removeEventListener("scroll", e);
27
+ }, H = (t) => {
28
+ document.querySelectorAll("*").forEach((e) => {
29
+ e.scrollHeight > e.clientHeight && e.removeEventListener("scroll", t);
30
30
  });
31
31
  };
32
32
  export {
33
- v as exportMap,
33
+ y as cleanUpTable,
34
+ S as exportMap,
34
35
  h as isStartingWithHtmlTag,
35
- y as mergeBoldStrongTags,
36
- S as removeScrollableContainers,
36
+ v as mergeBoldStrongTags,
37
+ H as removeScrollableContainers,
37
38
  l as removeStylesExportDOM,
38
39
  A as setScrollableContainers
39
40
  };
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","sources":["../../../src/components/RteEditor/helpers.ts"],"sourcesContent":["import { LinkNode } from '@lexical/link';\nimport { ListNode, ListItemNode } from '@lexical/list';\nimport { ParagraphNode, TextNode } from 'lexical';\nimport { TableCellNode, TableNode, TableRowNode } from '@lexical/table';\n\nimport type { DOMExportOutput, Klass, LexicalEditor, LexicalNode } from 'lexical';\n\nexport const isStartingWithHtmlTag = (str: string): boolean => {\n const htmlTagPattern =\n /^<(b|i|u|strong|em|mark|small|del|ins|sub|sup|div|p|span|h[1-6]|a|img|table|tr|td|th|ul|ol|li|blockquote|pre|code|br)(\\s+[^>]*)?>/i;\n return htmlTagPattern.test(str.trim());\n};\n\nexport const mergeBoldStrongTags = (html: string): string => {\n let mergedHtml = html.replace(/<b><strong>/gi, '<strong>');\n mergedHtml = mergedHtml.replace(/<\\/strong><\\/b>/gi, '</strong>');\n return mergedHtml;\n};\n\nexport const removeStylesExportDOM = (editor: LexicalEditor, target: LexicalNode): DOMExportOutput => {\n const output = target.exportDOM(editor);\n if (output && output.element instanceof HTMLElement) {\n for (const el of [output.element, ...output.element.querySelectorAll('[style],[class],[dir=\"ltr\"]')]) {\n el.removeAttribute('class');\n if (el.getAttribute('style')) {\n el.setAttribute('style', '');\n el.removeAttribute('style');\n }\n if (el.getAttribute('dir') === 'ltr') {\n el.removeAttribute('dir');\n }\n }\n }\n return output;\n};\n\nexport const exportMap = new Map<Klass<LexicalNode>, (editor: LexicalEditor, target: LexicalNode) => DOMExportOutput>([\n [ParagraphNode, removeStylesExportDOM],\n [TextNode, removeStylesExportDOM],\n [ListNode, removeStylesExportDOM],\n [ListItemNode, removeStylesExportDOM],\n [TableNode, removeStylesExportDOM],\n [TableRowNode, removeStylesExportDOM],\n [TableCellNode, removeStylesExportDOM],\n [LinkNode, removeStylesExportDOM],\n]);\n\nexport const setScrollableContainers = (fn: (event: Event) => void) => {\n const scrollableContainers = document.querySelectorAll('*');\n scrollableContainers.forEach((container) => {\n if (container.scrollHeight > container.clientHeight) {\n container.addEventListener('scroll', fn);\n }\n });\n};\n\nexport const removeScrollableContainers = (fn: (event: Event) => void) => {\n const scrollableContainers = document.querySelectorAll('*');\n scrollableContainers.forEach((container) => {\n if (container.scrollHeight > container.clientHeight) {\n container.removeEventListener('scroll', fn);\n }\n });\n};\n"],"names":["isStartingWithHtmlTag","str","mergeBoldStrongTags","html","mergedHtml","removeStylesExportDOM","editor","target","output","el","exportMap","ParagraphNode","TextNode","ListNode","ListItemNode","TableNode","TableRowNode","TableCellNode","LinkNode","setScrollableContainers","fn","container","removeScrollableContainers"],"mappings":";;;;AAOO,MAAMA,IAAwB,CAACC,MAElC,qIACoB,KAAKA,EAAI,KAAA,CAAM,GAG1BC,IAAsB,CAACC,MAAyB;AAC3D,MAAIC,IAAaD,EAAK,QAAQ,iBAAiB,UAAU;AACzD,SAAAC,IAAaA,EAAW,QAAQ,qBAAqB,WAAW,GACzDA;AACT,GAEaC,IAAwB,CAACC,GAAuBC,MAAyC;AACpG,QAAMC,IAASD,EAAO,UAAUD,CAAM;AACtC,MAAIE,KAAUA,EAAO,mBAAmB;AACtC,eAAWC,KAAM,CAACD,EAAO,SAAS,GAAGA,EAAO,QAAQ,iBAAiB,6BAA6B,CAAC;AACjG,MAAAC,EAAG,gBAAgB,OAAO,GACtBA,EAAG,aAAa,OAAO,MACzBA,EAAG,aAAa,SAAS,EAAE,GAC3BA,EAAG,gBAAgB,OAAO,IAExBA,EAAG,aAAa,KAAK,MAAM,SAC7BA,EAAG,gBAAgB,KAAK;AAI9B,SAAOD;AACT,GAEaE,wBAAgB,IAAyF;AAAA,EACpH,CAACC,GAAeN,CAAqB;AAAA,EACrC,CAACO,GAAUP,CAAqB;AAAA,EAChC,CAACQ,GAAUR,CAAqB;AAAA,EAChC,CAACS,GAAcT,CAAqB;AAAA,EACpC,CAACU,GAAWV,CAAqB;AAAA,EACjC,CAACW,GAAcX,CAAqB;AAAA,EACpC,CAACY,GAAeZ,CAAqB;AAAA,EACrC,CAACa,GAAUb,CAAqB;AAClC,CAAC,GAEYc,IAA0B,CAACC,MAA+B;AAErE,EAD6B,SAAS,iBAAiB,GAAG,EACrC,QAAQ,CAACC,MAAc;AAC1C,IAAIA,EAAU,eAAeA,EAAU,gBACrCA,EAAU,iBAAiB,UAAUD,CAAE;AAAA,EACzC,CACD;AACH,GAEaE,IAA6B,CAACF,MAA+B;AAExE,EAD6B,SAAS,iBAAiB,GAAG,EACrC,QAAQ,CAACC,MAAc;AAC1C,IAAIA,EAAU,eAAeA,EAAU,gBACrCA,EAAU,oBAAoB,UAAUD,CAAE;AAAA,EAC5C,CACD;AACH;"}
1
+ {"version":3,"file":"helpers.js","sources":["../../../src/components/RteEditor/helpers.ts"],"sourcesContent":["import { LinkNode } from '@lexical/link';\nimport { ListNode, ListItemNode } from '@lexical/list';\nimport { ParagraphNode, TextNode } from 'lexical';\nimport { TableCellNode, TableNode, TableRowNode } from '@lexical/table';\n\nimport type { DOMExportOutput, Klass, LexicalEditor, LexicalNode } from 'lexical';\n\nexport const isStartingWithHtmlTag = (str: string): boolean => {\n const htmlTagPattern =\n /^<(b|i|u|strong|em|mark|small|del|ins|sub|sup|div|p|span|h[1-6]|a|img|table|tr|td|th|ul|ol|li|blockquote|pre|code|br)(\\s+[^>]*)?>/i;\n return htmlTagPattern.test(str.trim());\n};\n\nexport const mergeBoldStrongTags = (html: string): string => {\n let mergedHtml = html.replace(/<b><strong>/gi, '<strong>');\n mergedHtml = mergedHtml.replace(/<\\/strong><\\/b>/gi, '</strong>');\n return mergedHtml;\n};\n\nexport const cleanUpTable = (html: string): string =>\n html\n .replace(/<div[^>]*>\\s*(<table[\\s\\S]*?<\\/table>)\\s*<\\/div>/gi, '$1')\n .replace(/<colgroup[^>]*>[\\s\\S]*?<\\/colgroup>/gi, '');\n\nexport const removeStylesExportDOM = (editor: LexicalEditor, target: LexicalNode): DOMExportOutput => {\n const output = target.exportDOM(editor);\n if (output && output.element instanceof HTMLElement) {\n for (const el of [output.element, ...output.element.querySelectorAll('[style],[class],[dir=\"ltr\"]')]) {\n el.removeAttribute('class');\n if (el.getAttribute('style')) {\n el.setAttribute('style', '');\n el.removeAttribute('style');\n }\n if (el.getAttribute('dir') === 'ltr') {\n el.removeAttribute('dir');\n }\n }\n }\n return output;\n};\n\nexport const exportMap = new Map<Klass<LexicalNode>, (editor: LexicalEditor, target: LexicalNode) => DOMExportOutput>([\n [ParagraphNode, removeStylesExportDOM],\n [TextNode, removeStylesExportDOM],\n [ListNode, removeStylesExportDOM],\n [ListItemNode, removeStylesExportDOM],\n [TableNode, removeStylesExportDOM],\n [TableRowNode, removeStylesExportDOM],\n [TableCellNode, removeStylesExportDOM],\n [LinkNode, removeStylesExportDOM],\n]);\n\nexport const setScrollableContainers = (fn: (event: Event) => void) => {\n const scrollableContainers = document.querySelectorAll('*');\n scrollableContainers.forEach((container) => {\n if (container.scrollHeight > container.clientHeight) {\n container.addEventListener('scroll', fn);\n }\n });\n};\n\nexport const removeScrollableContainers = (fn: (event: Event) => void) => {\n const scrollableContainers = document.querySelectorAll('*');\n scrollableContainers.forEach((container) => {\n if (container.scrollHeight > container.clientHeight) {\n container.removeEventListener('scroll', fn);\n }\n });\n};\n"],"names":["isStartingWithHtmlTag","str","mergeBoldStrongTags","html","mergedHtml","cleanUpTable","removeStylesExportDOM","editor","target","output","el","exportMap","ParagraphNode","TextNode","ListNode","ListItemNode","TableNode","TableRowNode","TableCellNode","LinkNode","setScrollableContainers","fn","container","removeScrollableContainers"],"mappings":";;;;AAOO,MAAMA,IAAwB,CAACC,MAElC,qIACoB,KAAKA,EAAI,KAAA,CAAM,GAG1BC,IAAsB,CAACC,MAAyB;AAC3D,MAAIC,IAAaD,EAAK,QAAQ,iBAAiB,UAAU;AACzD,SAAAC,IAAaA,EAAW,QAAQ,qBAAqB,WAAW,GACzDA;AACT,GAEaC,IAAe,CAACF,MAC3BA,EACG,QAAQ,sDAAsD,IAAI,EAClE,QAAQ,yCAAyC,EAAE,GAE3CG,IAAwB,CAACC,GAAuBC,MAAyC;AACpG,QAAMC,IAASD,EAAO,UAAUD,CAAM;AACtC,MAAIE,KAAUA,EAAO,mBAAmB;AACtC,eAAWC,KAAM,CAACD,EAAO,SAAS,GAAGA,EAAO,QAAQ,iBAAiB,6BAA6B,CAAC;AACjG,MAAAC,EAAG,gBAAgB,OAAO,GACtBA,EAAG,aAAa,OAAO,MACzBA,EAAG,aAAa,SAAS,EAAE,GAC3BA,EAAG,gBAAgB,OAAO,IAExBA,EAAG,aAAa,KAAK,MAAM,SAC7BA,EAAG,gBAAgB,KAAK;AAI9B,SAAOD;AACT,GAEaE,wBAAgB,IAAyF;AAAA,EACpH,CAACC,GAAeN,CAAqB;AAAA,EACrC,CAACO,GAAUP,CAAqB;AAAA,EAChC,CAACQ,GAAUR,CAAqB;AAAA,EAChC,CAACS,GAAcT,CAAqB;AAAA,EACpC,CAACU,GAAWV,CAAqB;AAAA,EACjC,CAACW,GAAcX,CAAqB;AAAA,EACpC,CAACY,GAAeZ,CAAqB;AAAA,EACrC,CAACa,GAAUb,CAAqB;AAClC,CAAC,GAEYc,IAA0B,CAACC,MAA+B;AAErE,EAD6B,SAAS,iBAAiB,GAAG,EACrC,QAAQ,CAACC,MAAc;AAC1C,IAAIA,EAAU,eAAeA,EAAU,gBACrCA,EAAU,iBAAiB,UAAUD,CAAE;AAAA,EACzC,CACD;AACH,GAEaE,IAA6B,CAACF,MAA+B;AAExE,EAD6B,SAAS,iBAAiB,GAAG,EACrC,QAAQ,CAACC,MAAc;AAC1C,IAAIA,EAAU,eAAeA,EAAU,gBACrCA,EAAU,oBAAoB,UAAUD,CAAE;AAAA,EAC5C,CACD;AACH;"}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@uva-glass/component-library",
3
3
  "author": "Team Glass - Frontend vrienden",
4
4
  "private": false,
5
- "version": "3.42.0",
5
+ "version": "3.42.2",
6
6
  "type": "module",
7
7
  "main": "dist/index.js",
8
8
  "types": "dist/index.d.ts",
@@ -73,7 +73,7 @@
73
73
  "glob": "^11.0.3",
74
74
  "husky": "^9.1.7",
75
75
  "identity-obj-proxy": "^3.0.0",
76
- "jest": "^30.1.2",
76
+ "jest": "^30.1.3",
77
77
  "jest-environment-jsdom": "^30.1.2",
78
78
  "jest-junit": "^16.0.0",
79
79
  "jsdom": "^26.1.0",