@uva-glass/component-library 1.59.0 → 1.59.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Sortable.module-DDhRFD1T.js +23 -0
- package/dist/Sortable.module-DDhRFD1T.js.map +1 -0
- package/dist/{SortableProvider-i4PDjRS_.js → SortableProvider-BUsvniX7.js} +2 -2
- package/dist/{SortableProvider-i4PDjRS_.js.map → SortableProvider-BUsvniX7.js.map} +1 -1
- package/dist/{TablePlugin-1L5UZfDH.js → TablePlugin-Cj6IBz2k.js} +2 -2
- package/dist/{TablePlugin-1L5UZfDH.js.map → TablePlugin-Cj6IBz2k.js.map} +1 -1
- package/dist/assets/Sortable.css +1 -1
- package/dist/components/CheckboxTree/CheckboxTree.js +2 -2
- package/dist/components/InputField/InputField.stories.js +2 -2
- package/dist/components/MultiSelect/MultiSelect.js +1 -1
- package/dist/components/MultiSelect/MultiSelect.stories.js +1 -1
- package/dist/components/MultiSelect/components/MultiSelectHeader.js +2 -2
- package/dist/components/MultiSelect/index.js +1 -1
- package/dist/components/ProgrammeCard/ProgrammeCard.stories.js +2 -2
- package/dist/components/RteEditor/EditorHeader/EditorHeader.js +2 -2
- package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.js +2 -2
- package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkFrom.js +2 -2
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js +2 -2
- package/dist/components/RteEditor/Plugins/TablePlugin/AddTableFrom.js +2 -2
- package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.js +2 -2
- package/dist/components/RteEditor/Plugins/TablePlugin/index.js +1 -1
- package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js +1 -1
- package/dist/components/RteEditor/Plugins/index.js +1 -1
- package/dist/components/RteEditor/RteEditor.js +2 -2
- package/dist/components/Sortable/Sortable.js +1 -1
- package/dist/components/Sortable/SortableProvider.js +1 -1
- package/dist/components/Sortable/components/SortableContainer.js +2 -2
- package/dist/components/Sortable/components/SortableHandle.js +1 -1
- package/dist/components/Sortable/components/SortableItem.js +2 -2
- package/dist/components/index.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/Sortable.module-uk_YuFs1.js +0 -24
- package/dist/Sortable.module-uk_YuFs1.js.map +0 -1
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import './assets/Sortable.css';const _ = "_sortable__wrapper_pdpg0_1", t = "_sortable__container_pdpg0_13", e = "_sortable__handle_pdpg0_149", r = {
|
|
2
|
+
sortable__wrapper: _,
|
|
3
|
+
"sortable__wrapper--scrollable": "_sortable__wrapper--scrollable_pdpg0_5",
|
|
4
|
+
sortable__container: t,
|
|
5
|
+
"sortable__drop-target": "_sortable__drop-target_pdpg0_25",
|
|
6
|
+
"sortable__sort-item": "_sortable__sort-item_pdpg0_56",
|
|
7
|
+
"sortable__sort-item--ghost": "_sortable__sort-item--ghost_pdpg0_72",
|
|
8
|
+
"sortable__sort-item__handle": "_sortable__sort-item__handle_pdpg0_83",
|
|
9
|
+
"sortable__sort-item__button-container": "_sortable__sort-item__button-container_pdpg0_93",
|
|
10
|
+
"sortable__sort-item__handle--icon": "_sortable__sort-item__handle--icon_pdpg0_112",
|
|
11
|
+
"sortable__sort-item__handle--up": "_sortable__sort-item__handle--up_pdpg0_119",
|
|
12
|
+
"sortable__sort-item__handle--down": "_sortable__sort-item__handle--down_pdpg0_120",
|
|
13
|
+
"sortable__sort-item--dragging": "_sortable__sort-item--dragging_pdpg0_131",
|
|
14
|
+
"sortable__sort-item__contents": "_sortable__sort-item__contents_pdpg0_135",
|
|
15
|
+
"sortable__sort-item__contents--handle-right": "_sortable__sort-item__contents--handle-right_pdpg0_144",
|
|
16
|
+
sortable__handle: e,
|
|
17
|
+
"sortable__handle--right": "_sortable__handle--right_pdpg0_155",
|
|
18
|
+
"sortable__visually-hidden": "_sortable__visually-hidden_pdpg0_173"
|
|
19
|
+
};
|
|
20
|
+
export {
|
|
21
|
+
r as s
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=Sortable.module-DDhRFD1T.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Sortable.module-DDhRFD1T.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;"}
|
|
@@ -2,7 +2,7 @@ import { jsx as f } from "react/jsx-runtime";
|
|
|
2
2
|
import { useRef as b, useEffect as w, cloneElement as R, createContext as O, useReducer as A, useContext as L, Children as _ } from "react";
|
|
3
3
|
import { sortableReducer as j, initialState as q } from "./components/Sortable/sortableReducer.js";
|
|
4
4
|
import { c as N } from "./clsx-OuTLNxxd.js";
|
|
5
|
-
import { s as u } from "./Sortable.module-
|
|
5
|
+
import { s as u } from "./Sortable.module-DDhRFD1T.js";
|
|
6
6
|
import { setDraggingSource as B, setDraggingTarget as H, moveToPosition as X, clearDraggingTarget as Y, clearDraggingSource as k, drop as z, dragStart as F, dragEnd as G, reset as J, setClone as K } from "./components/Sortable/actions.js";
|
|
7
7
|
function M({ scrollable: i, onSort: a }) {
|
|
8
8
|
const { clone: n, draggingTarget: p, drop: x, sortableItems: D, setDraggingTarget: o, reset: S, indices: s } = U(), l = b(null), c = b(null), d = b(s);
|
|
@@ -149,4 +149,4 @@ export {
|
|
|
149
149
|
M as a,
|
|
150
150
|
U as u
|
|
151
151
|
};
|
|
152
|
-
//# sourceMappingURL=SortableProvider-
|
|
152
|
+
//# sourceMappingURL=SortableProvider-BUsvniX7.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SortableProvider-i4PDjRS_.js","sources":["../src/components/Sortable/components/SortableContainer.tsx","../src/components/Sortable/SortableProvider.tsx"],"sourcesContent":["import { cloneElement, useEffect, useRef } from 'react';\nimport { clsx } from 'clsx';\n\nimport type { DragEvent } from 'react';\n\nimport styles from 'components/Sortable/Sortable.module.css';\nimport { useSortable } from 'components/Sortable/SortableProvider';\n\nexport type OnSort = (indices: number[]) => void;\n\ninterface SortableContainerProps {\n scrollable?: boolean;\n onSort?: OnSort;\n}\n\nexport function SortableContainer({ scrollable, onSort }: SortableContainerProps) {\n const { clone, draggingTarget, drop, sortableItems, setDraggingTarget, reset, indices } = useSortable();\n const containerRef = useRef<HTMLUListElement>(null);\n const wrapperRef = useRef<HTMLDivElement>(null);\n const indicesRef = useRef<number[]>(indices);\n\n function getTargetIndex(event: DragEvent<HTMLLIElement>) {\n const sortableContainer = containerRef.current;\n\n if (!sortableContainer?.hasChildNodes()) return;\n\n const listItemNode = event.currentTarget;\n const childNodes = Array.from(sortableContainer.childNodes);\n const targetIndex = childNodes.findIndex((node) => node.isEqualNode(listItemNode));\n\n return targetIndex;\n }\n\n function handleDrop(event: DragEvent<HTMLLIElement>) {\n const targetIndex = getTargetIndex(event);\n\n if (targetIndex === undefined) return;\n\n if (clone && wrapperRef.current) wrapperRef.current.removeChild(clone);\n\n drop(targetIndex);\n }\n\n function handleDragOver(event: DragEvent<HTMLLIElement>) {\n // Prevent default to allow drop\n event.preventDefault();\n event.dataTransfer.dropEffect = 'move';\n\n if (clone) {\n const { clientX, clientY } = event;\n const { x, y, width, height } = event.currentTarget.getBoundingClientRect();\n // eslint-disable-next-line @typescript-eslint/no-magic-numbers\n const grabPosition = height / 2 - (clientY - y);\n\n // lock drag image movement to x-axis and mouse pointer\n clone.setAttribute(\n 'style',\n `\n left: ${clientX - (clientX - x)}px;\n top: ${y - grabPosition}px;\n height: ${height}px;\n width: ${width}px;\n visibility: visible;\n `\n );\n }\n\n const targetIndex = getTargetIndex(event);\n\n if (targetIndex === undefined || targetIndex === draggingTarget) return;\n\n setDraggingTarget(targetIndex);\n }\n\n function handleContainerDragLeave(event: DragEvent<HTMLUListElement>) {\n const { relatedTarget } = event;\n\n const within = relatedTarget !== null && containerRef.current?.contains(relatedTarget as Node);\n\n if (!within) {\n reset();\n\n if (clone) {\n clone.setAttribute('style', 'visibility: hidden;');\n }\n }\n }\n\n useEffect(() => {\n if (!clone || !wrapperRef.current) return;\n\n wrapperRef.current.appendChild(clone);\n\n return function () {\n clone.remove();\n };\n }, [clone]);\n\n useEffect(() => {\n if (!onSort) return;\n\n if (indices.valueOf() !== indicesRef.current.valueOf()) {\n onSort(indices);\n\n indicesRef.current = indices;\n }\n }, [indices, indicesRef, onSort]);\n\n return (\n <div\n className={clsx(styles['sortable__wrapper'], { [styles['sortable__wrapper--scrollable']]: scrollable })}\n ref={wrapperRef}\n >\n <ul\n className={clsx(styles['sortable__container'], {\n [styles['sortable__container--drag-over']]: clone !== undefined,\n })}\n onDragLeave={handleContainerDragLeave}\n ref={containerRef}\n role=\"presentation\"\n >\n {sortableItems.map((child, index) => (\n <li\n className={styles['sortable__drop-target']}\n draggable={false}\n key={index}\n onDragOver={handleDragOver}\n onDrop={handleDrop}\n role=\"presentation\"\n >\n {cloneElement(child, { index })}\n </li>\n ))}\n </ul>\n </div>\n );\n}\n","import { Children, createContext, useContext, useReducer, useRef } from 'react';\n\nimport type { ReactElement } from 'react';\nimport type { SortableStateType } from './sortableReducer';\n\nimport { sortableReducer, initialState } from './sortableReducer';\nimport { SortableContainer } from './components/SortableContainer';\nimport * as actions from './actions';\n\ntype SortableContextType = {\n clearDraggingSource: () => void;\n clearDraggingTarget: () => void;\n dragEnd: () => void;\n dragStart: (index: number) => void;\n drop: (index: number) => void;\n moveToPosition: (index: number) => void;\n reset: () => void;\n setClone: (node: Element) => void;\n setDraggingSource: (index: number) => void;\n setDraggingTarget: (index: number) => void;\n};\n\nconst SortableContext = createContext<(SortableContextType & SortableStateType) | undefined>(undefined);\n\ninterface Props {\n children: SortableStateType['sortableItems'];\n items: ReactElement[] | string[];\n scrollable?: boolean;\n onSort?: (items: (string | ReactElement)[]) => void;\n}\n\nconst init = (children: Props['children']): SortableStateType => ({\n ...initialState,\n indices: Children.map(children, ({ props }) => props.index),\n maxIndex: Children.count(children) - 1,\n sortableItems: children,\n});\n\nexport function SortableProvider({ children, items, scrollable, onSort }: Props) {\n const persistentItems = useRef(items);\n\n const [state, dispatch] = useReducer(sortableReducer, children, init);\n\n function setDraggingSource(index: number) {\n dispatch(actions.setDraggingSource(index));\n }\n\n function setDraggingTarget(index: number) {\n dispatch(actions.setDraggingTarget(index));\n }\n\n function moveToPosition(index: number) {\n dispatch(actions.moveToPosition(index));\n }\n\n function clearDraggingTarget() {\n dispatch(actions.clearDraggingTarget());\n }\n\n function clearDraggingSource() {\n dispatch(actions.clearDraggingSource());\n }\n\n function drop(index: number) {\n dispatch(actions.drop(index));\n }\n\n function dragStart(index: number) {\n dispatch(actions.dragStart(index));\n }\n\n function dragEnd() {\n dispatch(actions.dragEnd());\n }\n\n function reset() {\n dispatch(actions.reset());\n }\n\n function setClone(node: Element) {\n dispatch(actions.setClone(node));\n }\n\n function onHandleSort(sortedIndices: number[]) {\n const sortedItems = sortedIndices.map((index) => persistentItems.current[index]);\n onSort && onSort(sortedItems);\n }\n\n return (\n <SortableContext.Provider\n value={{\n ...state,\n clearDraggingSource,\n clearDraggingTarget,\n dragEnd,\n dragStart,\n drop,\n moveToPosition,\n reset,\n setClone,\n setDraggingSource,\n setDraggingTarget,\n }}\n >\n <SortableContainer scrollable={scrollable} onSort={onHandleSort} />\n </SortableContext.Provider>\n );\n}\n\nexport function useSortable() {\n const context = useContext(SortableContext);\n\n if (context === undefined) {\n throw new Error('useSortable must be used within a SortableProvider');\n }\n\n return context;\n}\n"],"names":["SortableContainer","scrollable","onSort","clone","draggingTarget","drop","sortableItems","setDraggingTarget","reset","indices","useSortable","containerRef","useRef","wrapperRef","indicesRef","getTargetIndex","event","sortableContainer","listItemNode","node","handleDrop","targetIndex","handleDragOver","clientX","clientY","x","y","width","height","grabPosition","handleContainerDragLeave","relatedTarget","_a","useEffect","jsx","clsx","styles","child","index","cloneElement","SortableContext","createContext","init","children","initialState","Children","props","SortableProvider","items","persistentItems","state","dispatch","useReducer","sortableReducer","setDraggingSource","actions.setDraggingSource","actions.setDraggingTarget","moveToPosition","actions.moveToPosition","clearDraggingTarget","actions.clearDraggingTarget","clearDraggingSource","actions.clearDraggingSource","actions.drop","dragStart","actions.dragStart","dragEnd","actions.dragEnd","actions.reset","setClone","actions.setClone","onHandleSort","sortedIndices","sortedItems","context","useContext"],"mappings":";;;;;;AAeO,SAASA,EAAkB,EAAE,YAAAC,GAAY,QAAAC,KAAkC;AAC1E,QAAA,EAAE,OAAAC,GAAO,gBAAAC,GAAgB,MAAAC,GAAM,eAAAC,GAAe,mBAAAC,GAAmB,OAAAC,GAAO,SAAAC,MAAYC,KACpFC,IAAeC,EAAyB,IAAI,GAC5CC,IAAaD,EAAuB,IAAI,GACxCE,IAAaF,EAAiBH,CAAO;AAE3C,WAASM,EAAeC,GAAiC;AACvD,UAAMC,IAAoBN,EAAa;AAEnC,QAAA,EAACM,KAAA,QAAAA,EAAmB,iBAAiB;AAEzC,UAAMC,IAAeF,EAAM;AAIpB,WAHY,MAAM,KAAKC,EAAkB,UAAU,EAC3B,UAAU,CAACE,MAASA,EAAK,YAAYD,CAAY,CAAC;AAAA,EAGnF;AAEA,WAASE,EAAWJ,GAAiC;AAC7C,UAAAK,IAAcN,EAAeC,CAAK;AAExC,IAAIK,MAAgB,WAEhBlB,KAASU,EAAW,WAAoBA,EAAA,QAAQ,YAAYV,CAAK,GAErEE,EAAKgB,CAAW;AAAA,EAClB;AAEA,WAASC,EAAeN,GAAiC;AAKvD,QAHAA,EAAM,eAAe,GACrBA,EAAM,aAAa,aAAa,QAE5Bb,GAAO;AACH,YAAA,EAAE,SAAAoB,GAAS,SAAAC,EAAY,IAAAR,GACvB,EAAE,GAAAS,GAAG,GAAAC,GAAG,OAAAC,GAAO,QAAAC,MAAWZ,EAAM,cAAc,yBAE9Ca,IAAeD,IAAS,KAAKJ,IAAUE;AAGvC,MAAAvB,EAAA;AAAA,QACJ;AAAA,QACA;AAAA,gBACQoB,KAAWA,IAAUE,EAAE;AAAA,eACxBC,IAAIG,CAAY;AAAA,kBACbD,CAAM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AS3D,IAAQ;AACN,IAAA2C,EAAAiB,GAAe;AAAA,EAC1B;AAEA,WAASC,EAASlD,GAAe;AACtB,IAAAgC,EAAAmB,EAAiBnD,CAAI,CAAC;AAAA,EACjC;AAEA,WAASoD,EAAaC,GAAyB;AACvC,UAAAC,IAAcD,EAAc,IAAI,CAAClC,MAAUW,EAAgB,QAAQX,CAAK,CAAC;AAC/E,IAAApC,KAAUA,EAAOuE,CAAW;AAAA,EAC9B;AAGE,SAAA,gBAAAvC;AAAA,IAACM,EAAgB;AAAA,IAAhB;AAAA,MACC,OAAO;AAAA,QACL,GAAGU;AAAA,QAAA,qBACHW;AAAAA,QAAA,qBACAF;AAAAA,QAAA,SACAO;AAAAA,QAAA,WACAF;AAAAA,QAAA,MACA3D;AAAAA,QAAA,gBACAoD;AAAAA,QAAA,OACAjD;AAAAA,QAAA,UACA6D;AAAAA,QAAA,mBACAf;AAAAA,QAAA,mBACA/C;AAAAA,MACF;AAAA,MAEA,UAAC,gBAAA2B,EAAAlC,GAAA,EAAkB,YAAAC,GAAwB,QAAQsE,GAAc;AAAA,IAAA;AAAA,EAAA;AAGvE;AAEO,SAAS7D,IAAc;AACtB,QAAAgE,IAAUC,EAAWnC,CAAe;AAE1C,MAAIkC,MAAY;AACR,UAAA,IAAI,MAAM,oDAAoD;AAG/D,SAAAA;AACT;"}
|
|
1
|
+
{"version":3,"file":"SortableProvider-BUsvniX7.js","sources":["../src/components/Sortable/components/SortableContainer.tsx","../src/components/Sortable/SortableProvider.tsx"],"sourcesContent":["import { cloneElement, useEffect, useRef } from 'react';\nimport { clsx } from 'clsx';\n\nimport type { DragEvent } from 'react';\n\nimport styles from 'components/Sortable/Sortable.module.css';\nimport { useSortable } from 'components/Sortable/SortableProvider';\n\nexport type OnSort = (indices: number[]) => void;\n\ninterface SortableContainerProps {\n scrollable?: boolean;\n onSort?: OnSort;\n}\n\nexport function SortableContainer({ scrollable, onSort }: SortableContainerProps) {\n const { clone, draggingTarget, drop, sortableItems, setDraggingTarget, reset, indices } = useSortable();\n const containerRef = useRef<HTMLUListElement>(null);\n const wrapperRef = useRef<HTMLDivElement>(null);\n const indicesRef = useRef<number[]>(indices);\n\n function getTargetIndex(event: DragEvent<HTMLLIElement>) {\n const sortableContainer = containerRef.current;\n\n if (!sortableContainer?.hasChildNodes()) return;\n\n const listItemNode = event.currentTarget;\n const childNodes = Array.from(sortableContainer.childNodes);\n const targetIndex = childNodes.findIndex((node) => node.isEqualNode(listItemNode));\n\n return targetIndex;\n }\n\n function handleDrop(event: DragEvent<HTMLLIElement>) {\n const targetIndex = getTargetIndex(event);\n\n if (targetIndex === undefined) return;\n\n if (clone && wrapperRef.current) wrapperRef.current.removeChild(clone);\n\n drop(targetIndex);\n }\n\n function handleDragOver(event: DragEvent<HTMLLIElement>) {\n // Prevent default to allow drop\n event.preventDefault();\n event.dataTransfer.dropEffect = 'move';\n\n if (clone) {\n const { clientX, clientY } = event;\n const { x, y, width, height } = event.currentTarget.getBoundingClientRect();\n // eslint-disable-next-line @typescript-eslint/no-magic-numbers\n const grabPosition = height / 2 - (clientY - y);\n\n // lock drag image movement to x-axis and mouse pointer\n clone.setAttribute(\n 'style',\n `\n left: ${clientX - (clientX - x)}px;\n top: ${y - grabPosition}px;\n height: ${height}px;\n width: ${width}px;\n visibility: visible;\n `\n );\n }\n\n const targetIndex = getTargetIndex(event);\n\n if (targetIndex === undefined || targetIndex === draggingTarget) return;\n\n setDraggingTarget(targetIndex);\n }\n\n function handleContainerDragLeave(event: DragEvent<HTMLUListElement>) {\n const { relatedTarget } = event;\n\n const within = relatedTarget !== null && containerRef.current?.contains(relatedTarget as Node);\n\n if (!within) {\n reset();\n\n if (clone) {\n clone.setAttribute('style', 'visibility: hidden;');\n }\n }\n }\n\n useEffect(() => {\n if (!clone || !wrapperRef.current) return;\n\n wrapperRef.current.appendChild(clone);\n\n return function () {\n clone.remove();\n };\n }, [clone]);\n\n useEffect(() => {\n if (!onSort) return;\n\n if (indices.valueOf() !== indicesRef.current.valueOf()) {\n onSort(indices);\n\n indicesRef.current = indices;\n }\n }, [indices, indicesRef, onSort]);\n\n return (\n <div\n className={clsx(styles['sortable__wrapper'], { [styles['sortable__wrapper--scrollable']]: scrollable })}\n ref={wrapperRef}\n >\n <ul\n className={clsx(styles['sortable__container'], {\n [styles['sortable__container--drag-over']]: clone !== undefined,\n })}\n onDragLeave={handleContainerDragLeave}\n ref={containerRef}\n role=\"presentation\"\n >\n {sortableItems.map((child, index) => (\n <li\n className={styles['sortable__drop-target']}\n draggable={false}\n key={index}\n onDragOver={handleDragOver}\n onDrop={handleDrop}\n role=\"presentation\"\n >\n {cloneElement(child, { index })}\n </li>\n ))}\n </ul>\n </div>\n );\n}\n","import { Children, createContext, useContext, useReducer, useRef } from 'react';\n\nimport type { ReactElement } from 'react';\nimport type { SortableStateType } from './sortableReducer';\n\nimport { sortableReducer, initialState } from './sortableReducer';\nimport { SortableContainer } from './components/SortableContainer';\nimport * as actions from './actions';\n\ntype SortableContextType = {\n clearDraggingSource: () => void;\n clearDraggingTarget: () => void;\n dragEnd: () => void;\n dragStart: (index: number) => void;\n drop: (index: number) => void;\n moveToPosition: (index: number) => void;\n reset: () => void;\n setClone: (node: Element) => void;\n setDraggingSource: (index: number) => void;\n setDraggingTarget: (index: number) => void;\n};\n\nconst SortableContext = createContext<(SortableContextType & SortableStateType) | undefined>(undefined);\n\ninterface Props {\n children: SortableStateType['sortableItems'];\n items: ReactElement[] | string[];\n scrollable?: boolean;\n onSort?: (items: (string | ReactElement)[]) => void;\n}\n\nconst init = (children: Props['children']): SortableStateType => ({\n ...initialState,\n indices: Children.map(children, ({ props }) => props.index),\n maxIndex: Children.count(children) - 1,\n sortableItems: children,\n});\n\nexport function SortableProvider({ children, items, scrollable, onSort }: Props) {\n const persistentItems = useRef(items);\n\n const [state, dispatch] = useReducer(sortableReducer, children, init);\n\n function setDraggingSource(index: number) {\n dispatch(actions.setDraggingSource(index));\n }\n\n function setDraggingTarget(index: number) {\n dispatch(actions.setDraggingTarget(index));\n }\n\n function moveToPosition(index: number) {\n dispatch(actions.moveToPosition(index));\n }\n\n function clearDraggingTarget() {\n dispatch(actions.clearDraggingTarget());\n }\n\n function clearDraggingSource() {\n dispatch(actions.clearDraggingSource());\n }\n\n function drop(index: number) {\n dispatch(actions.drop(index));\n }\n\n function dragStart(index: number) {\n dispatch(actions.dragStart(index));\n }\n\n function dragEnd() {\n dispatch(actions.dragEnd());\n }\n\n function reset() {\n dispatch(actions.reset());\n }\n\n function setClone(node: Element) {\n dispatch(actions.setClone(node));\n }\n\n function onHandleSort(sortedIndices: number[]) {\n const sortedItems = sortedIndices.map((index) => persistentItems.current[index]);\n onSort && onSort(sortedItems);\n }\n\n return (\n <SortableContext.Provider\n value={{\n ...state,\n clearDraggingSource,\n clearDraggingTarget,\n dragEnd,\n dragStart,\n drop,\n moveToPosition,\n reset,\n setClone,\n setDraggingSource,\n setDraggingTarget,\n }}\n >\n <SortableContainer scrollable={scrollable} onSort={onHandleSort} />\n </SortableContext.Provider>\n );\n}\n\nexport function useSortable() {\n const context = useContext(SortableContext);\n\n if (context === undefined) {\n throw new Error('useSortable must be used within a SortableProvider');\n }\n\n return context;\n}\n"],"names":["SortableContainer","scrollable","onSort","clone","draggingTarget","drop","sortableItems","setDraggingTarget","reset","indices","useSortable","containerRef","useRef","wrapperRef","indicesRef","getTargetIndex","event","sortableContainer","listItemNode","node","handleDrop","targetIndex","handleDragOver","clientX","clientY","x","y","width","height","grabPosition","handleContainerDragLeave","relatedTarget","_a","useEffect","jsx","clsx","styles","child","index","cloneElement","SortableContext","createContext","init","children","initialState","Children","props","SortableProvider","items","persistentItems","state","dispatch","useReducer","sortableReducer","setDraggingSource","actions.setDraggingSource","actions.setDraggingTarget","moveToPosition","actions.moveToPosition","clearDraggingTarget","actions.clearDraggingTarget","clearDraggingSource","actions.clearDraggingSource","actions.drop","dragStart","actions.dragStart","dragEnd","actions.dragEnd","actions.reset","setClone","actions.setClone","onHandleSort","sortedIndices","sortedIt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,GAAyB;AACvC,UAAAC,IAAcD,EAAc,IAAI,CAAClC,MAAUW,EAAgB,QAAQX,CAAK,CAAC;AAC/E,IAAApC,KAAUA,EAAOuE,CAAW;AAAA,EAC9B;AAGE,SAAA,gBAAAvC;AAAA,IAACM,EAAgB;AAAA,IAAhB;AAAA,MACC,OAAO;AAAA,QACL,GAAGU;AAAA,QAAA,qBACHW;AAAAA,QAAA,qBACAF;AAAAA,QAAA,SACAO;AAAAA,QAAA,WACAF;AAAAA,QAAA,MACA3D;AAAAA,QAAA,gBACAoD;AAAAA,QAAA,OACAjD;AAAAA,QAAA,UACA6D;AAAAA,QAAA,mBACAf;AAAAA,QAAA,mBACA/C;AAAAA,MACF;AAAA,MAEA,UAAC,gBAAA2B,EAAAlC,GAAA,EAAkB,YAAAC,GAAwB,QAAQsE,GAAc;AAAA,IAAA;AAAA,EAAA;AAGvE;AAEO,SAAS7D,IAAc;AACtB,QAAAgE,IAAUC,EAAWnC,CAAe;AAE1C,MAAIkC,MAAY;AACR,UAAA,IAAI,MAAM,oDAAoD;AAG/D,SAAAA;AACT;"}
|
|
@@ -30,7 +30,7 @@ import "./components/RteEditor/Providers/LanguageProvider.js";
|
|
|
30
30
|
import "./components/SelectListbox/SelectListbox.js";
|
|
31
31
|
import "./components/SelectListbox/SelectProvider.js";
|
|
32
32
|
import "./components/Sortable/components/SortableItem.js";
|
|
33
|
-
import "./SortableProvider-
|
|
33
|
+
import "./SortableProvider-BUsvniX7.js";
|
|
34
34
|
import { useTranslation as A } from "./components/RteEditor/hooks/useTranslation.js";
|
|
35
35
|
import './assets/TablePlugin.css';function se({ label: p, clearTrigger: d, onClear: s }) {
|
|
36
36
|
return /* @__PURE__ */ m("header", { className: F["multi-select__header"], children: [
|
|
@@ -246,4 +246,4 @@ export {
|
|
|
246
246
|
se as a,
|
|
247
247
|
de as b
|
|
248
248
|
};
|
|
249
|
-
//# sourceMappingURL=TablePlugin-
|
|
249
|
+
//# sourceMappingURL=TablePlugin-Cj6IBz2k.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TablePlugin-1L5UZfDH.js","sources":["../src/components/MultiSelect/components/MultiSelectHeader.tsx","../src/components/MultiSelect/MultiSelect.tsx","../src/components/RteEditor/Plugins/LinkPlugin/AddLinkFrom.tsx","../src/components/RteEditor/Plugins/TablePlugin/AddTableFrom.tsx","../src/components/RteEditor/Plugins/TablePlugin/TablePlugin.tsx"],"sourcesContent":["import styles from 'components/MultiSelect/MultiSelect.module.css';\nimport { Label } from 'components/Label';\nimport { Button } from 'components';\n\nexport interface MultiSelectHeaderProps {\n label: string;\n clearTrigger?: string;\n onClear?: () => void;\n}\n\nexport function MultiSelectHeader({ label, clearTrigger, onClear }: MultiSelectHeaderProps) {\n return (\n <header className={styles['multi-select__header']}>\n <Label htmlFor=\"multi-select-list\">{label}</Label>\n {clearTrigger && (\n <Button variant={'blank'} onClick={onClear}>\n {clearTrigger}\n </Button>\n )}\n </header>\n );\n}\n","import clsx from 'clsx';\n\nimport type { PropsWithChildren, ReactNode } from 'react';\n\nimport styles from './MultiSelect.module.css';\n\nimport { MultiSelectItem } from 'components/MultiSelect/components/MultiSelectItem';\nimport { MultiSelectHeader } from 'components/MultiSelect/components/MultiSelectHeader';\n\nexport interface MultiSelectProps {\n /** `true` if the container should scroll on overflow; otherwise, `false` to resize the container to its contents. The default is `true`. */\n scrollable?: boolean;\n /** `true` to disable the border around the container; otherwise, `false`. The default is `false`. */\n noBorder?: boolean;\n /** The header contents. */\n header?: ReactNode;\n}\n\n/** Represents a component to list a number of checkboxes. */\nexport const MultiSelect = ({ scrollable = true, noBorder, header, children }: PropsWithChildren<MultiSelectProps>) => (\n <>\n {header}\n <div\n className={clsx(styles['multi-select'], {\n [styles['multi-select--no-border']]: noBorder,\n })}\n >\n <ul\n className={clsx(styles['multi-select__list'], {\n [styles['multi-select__list--scrollable']]: scrollable,\n })}\n id=\"multi-select-list\"\n >\n {children}\n </ul>\n </div>\n </>\n);\n\nMultiSelect.MultiSelectHeader = MultiSelectHeader;\nMultiSelect.MultiSelectItem = MultiSelectItem;\n","import { useState, forwardRef, useImperativeHandle, useRef } from 'react';\n\nimport type { ChangeEvent } from 'react';\nimport type { LinkType } from 'components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin';\n\nimport { validateUrlWithProtocol } from './helpers';\nimport styles from './AddLinkForm.module.css';\n\nimport { Button, Checkbox, FeedbackBox, FormField, InputField, Label } from 'components';\nimport { useTranslation } from 'components/RteEditor/hooks/useTranslation';\n\ninterface AddLinkFormProps {\n onCloseHandler: () => void;\n onSaveHandler: (url: string, target: string) => void;\n onRemoveHandler?: () => void;\n isLink: LinkType;\n}\n\nexport interface addLinkFormMethods {\n clearForm: () => void;\n focusFirstField: () => void;\n setDefaults: (url: string, target: boolean) => void;\n}\n\nexport const AddLinkForm = forwardRef(\n (\n {\n onCloseHandler,\n onSaveHandler,\n onRemoveHandler,\n isLink = { active: false, url: '', target: '_self' },\n }: AddLinkFormProps,\n ref\n ): JSX.Element => {\n const t = useTranslation();\n const [target, setTarget] = useState<boolean>(isLink.target === '_blank');\n const [url, setUrl] = useState<string>(isLink.url);\n const [urlError, setUrlError] = useState<string | null>(null);\n const firstField = useRef<HTMLInputElement>(null);\n\n const handleUrl = (event: ChangeEvent<HTMLInputElement>) => {\n setUrl(event.target.value);\n };\n\n const handleTargetChange = () => {\n setTarget((prev) => !prev);\n };\n\n const validateUrl = (url: string): boolean => {\n if ((!url && url.trim() === '') || validateUrlWithProtocol(url) === false) {\n setUrlError(t.errortext.urlNotValid);\n return false;\n }\n setUrlError(null);\n return true;\n };\n\n const handleSave = () => {\n if (!validateUrl(url)) {\n return;\n }\n onSaveHandler(url, target ? '_blank' : '_self');\n resetForm();\n };\n\n const handleClose = () => {\n onCloseHandler();\n resetForm();\n };\n\n const resetForm = () => {\n setUrl('');\n setUrlError(null);\n };\n\n const handleRemoveHandler = () => {\n if (onRemoveHandler) {\n onRemoveHandler();\n resetForm();\n }\n };\n\n const setDefaults = (url: string, target: boolean) => {\n setUrl(url);\n setTarget(target);\n };\n\n const focusFirstField = () => {\n if (firstField.current) {\n firstField.current.focus();\n }\n };\n\n useImperativeHandle(ref, () => ({\n clearForm: resetForm,\n focusFirstField,\n setDefaults,\n }));\n\n return (\n <div className={styles['linkform']}>\n <FormField className={styles['linkform__input-field']}>\n <Label htmlFor=\"linkUrl\">{t.links.linkLabel}</Label>\n <InputField\n id=\"linkUrl\"\n placeholder=\"http(s)://\"\n value={url ? url : ''}\n onChange={(event) => handleUrl(event)}\n onFocus={() => setUrlError(null)}\n ref={firstField}\n />\n {urlError && <FeedbackBox level=\"error\" feedback={urlError} />}\n </FormField>\n <FormField inline>\n <Checkbox id=\"linkTarget\" onChange={handleTargetChange} checked={target} />\n <Label htmlFor=\"linkTarget\">{t.links.linkTarget}</Label>\n </FormField>\n <div className={styles['linkform__footer']}>\n <Button variant={'secondary'} onClick={handleClose}>\n {t.common.cancel}\n </Button>\n {url && (\n <Button variant={'secondary'} onClick={handleRemoveHandler}>\n {t.links.deleteLink}\n </Button>\n )}\n <Button variant={'primary'} onClick={handleSave}>\n {url ? t.links.changeLink : t.links.addLink}\n </Button>\n </div>\n </div>\n );\n }\n);\n","import { useState, forwardRef, useImperativeHandle, useRef } from 'react';\n\nimport type { ChangeEvent } from 'react';\n\nimport styles from './AddTableFrom.module.css';\n\nimport { Button, FormField, InputField, Label } from 'components';\nimport { useTranslation } from 'components/RteEditor/hooks/useTranslation';\n\ninterface AddTableFormProps {\n onCloseHandler: () => void;\n onSaveHandler: (nrfOfRows: number, nrOfColumns: number) => void;\n}\n\nexport interface addTableForm {\n clearForm: () => void;\n focusFirstField: () => void;\n}\n\nexport const AddTableForm = forwardRef(({ onCloseHandler, onSaveHandler }: AddTableFormProps, ref) => {\n const t = useTranslation();\n const [rowCount, setRowCount] = useState<number>();\n const [columnCount, setColumnCount] = useState<number>();\n const firstField = useRef<HTMLInputElement>(null);\n\n const handleDimentionChange = (event: ChangeEvent<HTMLInputElement>, type: string) => {\n const value = event.target.value;\n type === 'row' ? setRowCount(parseInt(value)) : setColumnCount(parseInt(value));\n };\n\n const handleSave = () => {\n if (rowCount !== undefined && columnCount !== undefined) {\n onSaveHandler(rowCount, columnCount);\n resetForm();\n }\n };\n\n const handleClose = () => {\n onCloseHandler();\n resetForm();\n };\n\n const resetForm = () => {\n setRowCount(undefined);\n setColumnCount(undefined);\n };\n\n useImperativeHandle(ref, () => ({\n clearForm: resetForm,\n focusFirstField: () => firstField.current?.focus(),\n }));\n\n return (\n <div className={styles['tableform']}>\n <FormField className={styles['tableform__input-field']}>\n <Label htmlFor=\"nrOfRows\">{t.table.nrofRows}</Label>\n <InputField\n id=\"nrOfRows\"\n placeholder={t.table.nrofRowsPlaceholder}\n value={rowCount ? rowCount : ''}\n onChange={(event) => handleDimentionChange(event, 'row')}\n ref={firstField}\n />\n </FormField>\n <FormField className={styles['tableform__input-field']}>\n <Label htmlFor=\"nrOfColumns\">{t.table.nrofColumns}</Label>\n <InputField\n id=\"nrOfColumns\"\n placeholder={t.table.nrofColumnsPlaceholder}\n value={columnCount ? columnCount : ''}\n onChange={(event) => handleDimentionChange(event, 'column')}\n />\n </FormField>\n <div className={styles['tableform__footer']}>\n <Button variant={'secondary'} onClick={handleClose}>\n {t.common.cancel}\n </Button>\n <Button variant={'primary'} onClick={handleSave} disabled={!rowCount || !columnCount}>\n {t.common.add}\n </Button>\n </div>\n </div>\n );\n});\n","import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';\nimport clsx from 'clsx';\nimport { $isTableCellNode } from '@lexical/table';\nimport { $getSelection, $isRangeSelection, $getRoot } from 'lexical';\nimport { useRef, useEffect, useImperativeHandle, forwardRef } from 'react';\n\nimport type { TextNode, ElementNode } from 'lexical';\nimport type { addTableForm } from './AddTableFrom';\nimport type { Actions } from './TableCellContextMenu';\n\nimport { AddTableForm } from './AddTableFrom';\nimport { createTable, deleteColumn, deleteRow, deleteTable, insertColumn, insertRow } from './helpers';\n\nimport { useFlyout } from 'components/RteEditor/hooks/useFlyout';\nimport { Icon } from 'components';\nimport styles from 'components/RteEditor/RteEditor.module.css';\n\nconst PREVENT_OPEN_DELAY = 200;\n\ninterface TablePluginProps {\n isActive: boolean;\n}\n\nexport interface TableMutation {\n mutateTable: (type: Actions) => void;\n}\n\nexport const TablePlugin = forwardRef(({ isActive }: TablePluginProps, ref): JSX.Element => {\n const [editor] = useLexicalComposerContext();\n const { flyout, showFlyout, closeFlyout, isVisible } = useFlyout();\n const addTableForm = useRef<addTableForm>();\n const buttonRef = useRef<HTMLButtonElement>(null);\n const preventOpen = useRef(false);\n\n const insertTable = (nrOfRows: number, nrOfColumns: number) => {\n editor.update(() => {\n const selection = $getSelection();\n const tableNode = createTable(nrOfRows, nrOfColumns);\n if ($isRangeSelection(selection)) {\n selection.insertNodes([tableNode]);\n } else {\n $getRoot().append(tableNode);\n }\n const firstDescendant = tableNode.getFirstDescendant();\n if (firstDescendant) {\n (firstDescendant as TextNode).select();\n }\n });\n\n closeFlyout();\n };\n\n const mutateTable = (action: Actions) => {\n editor.update(() => {\n const selection = $getSelection();\n if ($isRangeSelection(selection)) {\n const anchorNode = selection.anchor.getNode();\n let currentNode: TextNode | ElementNode | null = anchorNode;\n\n while (currentNode !== null) {\n if ($isRangeSelection(selection)) {\n if ($isTableCellNode(currentNode)) {\n switch (action) {\n case 'insertRowAbove':\n case 'insertRowBelow':\n insertRow(currentNode, action);\n break;\n case 'deleteRow':\n deleteRow(currentNode);\n break;\n case 'insertColumnLeft':\n case 'insertColumnRight':\n insertColumn(currentNode, action);\n break;\n case 'deleteColumn':\n deleteColumn(currentNode);\n break;\n case 'deleteTable':\n deleteTable(currentNode);\n break;\n }\n }\n }\n currentNode = currentNode.getParent();\n }\n }\n });\n };\n\n const flyoutOptions = {\n children: (\n <AddTableForm\n onCloseHandler={closeFlyout}\n onSaveHandler={(rows, columns) => insertTable(rows, columns)}\n ref={addTableForm}\n />\n ),\n };\n\n useEffect(() => {\n if (!isVisible) {\n addTableForm.current?.clearForm();\n setTimeout(() => (preventOpen.current = false), PREVENT_OPEN_DELAY);\n } else {\n preventOpen.current = true;\n addTableForm.current?.focusFirstField();\n }\n }, [addTableForm, isVisible]);\n\n useImperativeHandle(ref, () => ({\n mutateTable,\n }));\n\n return (\n <div className={styles['editor__toolbar-button-group']}>\n <div className={styles['editor__toolbar-button-flyoutwrapper']}>\n <button\n onClick={() => !preventOpen.current && showFlyout(flyoutOptions)}\n className={clsx(styles['editor__toolbar-button'], isActive && styles[`editor__toolbar-button--active`])}\n aria-label={`Table`}\n ref={buttonRef}\n >\n <Icon name=\"Table\" size={24} />\n </button>\n {flyout}\n </div>\n </div>\n );\n});\n"],"names":["MultiSelectHeader","label","clearTrigger","onClear","jsxs","styles","jsx","Label","Button","MultiSelect","scrollable","noBorder","header","children","Fragment","clsx","MultiSelectItem","AddLinkForm","forwardRef","onCloseHandler","onSaveHandler","onRemoveHandler","isLink","ref","t","useTranslation","target","setTarget","useState","url","setUrl","urlError","setUrlError","firstField","useRef","handleUrl","event","handleTargetChange","prev","validateUrl","validateUrlWithProtocol","handleSave","resetForm","handleClose","handleRemoveHandler","setDefaults","focusFirstField","useImperativeHandle","FormField","InputField","FeedbackBox","Checkbox","AddTableForm","rowCount","setRowCount","columnCount","setColumnCount","handleDimentionChange","type","value","_a","PREVENT_OPEN_DELAY","TablePlugin","isActive","editor","useLexicalComposerContext","flyout","showFlyout","closeFlyout","isVisible","useFlyout","addTableForm","buttonRef","preventOpen","insertTable","nrOfRows","nrOfColumns","selection","$getSelection","tableNode","createTable","$isRangeSelection","$getRoot","firstDescendant","mutateTable","action","currentNode","$isTableCellNode","insertRow","deleteRow","insertColumn","deleteColumn","deleteTable","flyoutOptions","rows","columns","useEffect","_b","Icon"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUO,SAASA,GAAkB,EAAE,OAAAC,GAAO,cAAAC,GAAc,SAAAC,KAAmC;AAC1F,SACG,gBA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AAA,EACF,CAAA;AAEJ,CAAC;"}
|
|
1
|
+
{"version":3,"file":"TablePlugin-Cj6IBz2k.js","sources":["../src/components/MultiSelect/components/MultiSelectHeader.tsx","../src/components/MultiSelect/MultiSelect.tsx","../src/components/RteEditor/Plugins/LinkPlugin/AddLinkFrom.tsx","../src/components/RteEditor/Plugins/TablePlugin/AddTableFrom.tsx","../src/components/RteEditor/Plugins/TablePlugin/TablePlugin.tsx"],"sourcesContent":["import styles from 'components/MultiSelect/MultiSelect.module.css';\nimport { Label } from 'components/Label';\nimport { Button } from 'components';\n\nexport interface MultiSelectHeaderProps {\n label: string;\n clearTrigger?: string;\n onClear?: () => void;\n}\n\nexport function MultiSelectHeader({ label, clearTrigger, onClear }: MultiSelectHeaderProps) {\n return (\n <header className={styles['multi-select__header']}>\n <Label htmlFor=\"multi-select-list\">{label}</Label>\n {clearTrigger && (\n <Button variant={'blank'} onClick={onClear}>\n {clearTrigger}\n </Button>\n )}\n </header>\n );\n}\n","import clsx from 'clsx';\n\nimport type { PropsWithChildren, ReactNode } from 'react';\n\nimport styles from './MultiSelect.module.css';\n\nimport { MultiSelectItem } from 'components/MultiSelect/components/MultiSelectItem';\nimport { MultiSelectHeader } from 'components/MultiSelect/components/MultiSelectHeader';\n\nexport interface MultiSelectProps {\n /** `true` if the container should scroll on overflow; otherwise, `false` to resize the container to its contents. The default is `true`. */\n scrollable?: boolean;\n /** `true` to disable the border around the container; otherwise, `false`. The default is `false`. */\n noBorder?: boolean;\n /** The header contents. */\n header?: ReactNode;\n}\n\n/** Represents a component to list a number of checkboxes. */\nexport const MultiSelect = ({ scrollable = true, noBorder, header, children }: PropsWithChildren<MultiSelectProps>) => (\n <>\n {header}\n <div\n className={clsx(styles['multi-select'], {\n [styles['multi-select--no-border']]: noBorder,\n })}\n >\n <ul\n className={clsx(styles['multi-select__list'], {\n [styles['multi-select__list--scrollable']]: scrollable,\n })}\n id=\"multi-select-list\"\n >\n {children}\n </ul>\n </div>\n </>\n);\n\nMultiSelect.MultiSelectHeader = MultiSelectHeader;\nMultiSelect.MultiSelectItem = MultiSelectItem;\n","import { useState, forwardRef, useImperativeHandle, useRef } from 'react';\n\nimport type { ChangeEvent } from 'react';\nimport type { LinkType } from 'components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin';\n\nimport { validateUrlWithProtocol } from './helpers';\nimport styles from './AddLinkForm.module.css';\n\nimport { Button, Checkbox, FeedbackBox, FormField, InputField, Label } from 'components';\nimport { useTranslation } from 'components/RteEditor/hooks/useTranslation';\n\ninterface AddLinkFormProps {\n onCloseHandler: () => void;\n onSaveHandler: (url: string, target: string) => void;\n onRemoveHandler?: () => void;\n isLink: LinkType;\n}\n\nexport interface addLinkFormMethods {\n clearForm: () => void;\n focusFirstField: () => void;\n setDefaults: (url: string, target: boolean) => void;\n}\n\nexport const AddLinkForm = forwardRef(\n (\n {\n onCloseHandler,\n onSaveHandler,\n onRemoveHandler,\n isLink = { active: false, url: '', target: '_self' },\n }: AddLinkFormProps,\n ref\n ): JSX.Element => {\n const t = useTranslation();\n const [target, setTarget] = useState<boolean>(isLink.target === '_blank');\n const [url, setUrl] = useState<string>(isLink.url);\n const [urlError, setUrlError] = useState<string | null>(null);\n const firstField = useRef<HTMLInputElement>(null);\n\n const handleUrl = (event: ChangeEvent<HTMLInputElement>) => {\n setUrl(event.target.value);\n };\n\n const handleTargetChange = () => {\n setTarget((prev) => !prev);\n };\n\n const validateUrl = (url: string): boolean => {\n if ((!url && url.trim() === '') || validateUrlWithProtocol(url) === false) {\n setUrlError(t.errortext.urlNotValid);\n return false;\n }\n setUrlError(null);\n return true;\n };\n\n const handleSave = () => {\n if (!validateUrl(url)) {\n return;\n }\n onSaveHandler(url, target ? '_blank' : '_self');\n resetForm();\n };\n\n const handleClose = () => {\n onCloseHandler();\n resetForm();\n };\n\n const resetForm = () => {\n setUrl('');\n setUrlError(null);\n };\n\n const handleRemoveHandler = () => {\n if (onRemoveHandler) {\n onRemoveHandler();\n resetForm();\n }\n };\n\n const setDefaults = (url: string, target: boolean) => {\n setUrl(url);\n setTarget(target);\n };\n\n const focusFirstField = () => {\n if (firstField.current) {\n firstField.current.focus();\n }\n };\n\n useImperativeHandle(ref, () => ({\n clearForm: resetForm,\n focusFirstField,\n setDefaults,\n }));\n\n return (\n <div className={styles['linkform']}>\n <FormField className={styles['linkform__input-field']}>\n <Label htmlFor=\"linkUrl\">{t.links.linkLabel}</Label>\n <InputField\n id=\"linkUrl\"\n placeholder=\"http(s)://\"\n value={url ? url : ''}\n onChange={(event) => handleUrl(event)}\n onFocus={() => setUrlError(null)}\n ref={firstField}\n />\n {urlError && <FeedbackBox level=\"error\" feedback={urlError} />}\n </FormField>\n <FormField inline>\n <Checkbox id=\"linkTarget\" onChange={handleTargetChange} checked={target} />\n <Label htmlFor=\"linkTarget\">{t.links.linkTarget}</Label>\n </FormField>\n <div className={styles['linkform__footer']}>\n <Button variant={'secondary'} onClick={handleClose}>\n {t.common.cancel}\n </Button>\n {url && (\n <Button variant={'secondary'} onClick={handleRemoveHandler}>\n {t.links.deleteLink}\n </Button>\n )}\n <Button variant={'primary'} onClick={handleSave}>\n {url ? t.links.changeLink : t.links.addLink}\n </Button>\n </div>\n </div>\n );\n }\n);\n","import { useState, forwardRef, useImperativeHandle, useRef } from 'react';\n\nimport type { ChangeEvent } from 'react';\n\nimport styles from './AddTableFrom.module.css';\n\nimport { Button, FormField, InputField, Label } from 'components';\nimport { useTranslation } from 'components/RteEditor/hooks/useTranslation';\n\ninterface AddTableFormProps {\n onCloseHandler: () => void;\n onSaveHandler: (nrfOfRows: number, nrOfColumns: number) => void;\n}\n\nexport interface addTableForm {\n clearForm: () => void;\n focusFirstField: () => void;\n}\n\nexport const AddTableForm = forwardRef(({ onCloseHandler, onSaveHandler }: AddTableFormProps, ref) => {\n const t = useTranslation();\n const [rowCount, setRowCount] = useState<number>();\n const [columnCount, setColumnCount] = useState<number>();\n const firstField = useRef<HTMLInputElement>(null);\n\n const handleDimentionChange = (event: ChangeEvent<HTMLInputElement>, type: string) => {\n const value = event.target.value;\n type === 'row' ? setRowCount(parseInt(value)) : setColumnCount(parseInt(value));\n };\n\n const handleSave = () => {\n if (rowCount !== undefined && columnCount !== undefined) {\n onSaveHandler(rowCount, columnCount);\n resetForm();\n }\n };\n\n const handleClose = () => {\n onCloseHandler();\n resetForm();\n };\n\n const resetForm = () => {\n setRowCount(undefined);\n setColumnCount(undefined);\n };\n\n useImperativeHandle(ref, () => ({\n clearForm: resetForm,\n focusFirstField: () => firstField.current?.focus(),\n }));\n\n return (\n <div className={styles['tableform']}>\n <FormField className={styles['tableform__input-field']}>\n <Label htmlFor=\"nrOfRows\">{t.table.nrofRows}</Label>\n <InputField\n id=\"nrOfRows\"\n placeholder={t.table.nrofRowsPlaceholder}\n value={rowCount ? rowCount : ''}\n onChange={(event) => handleDimentionChange(event, 'row')}\n ref={firstField}\n />\n </FormField>\n <FormField className={styles['tableform__input-field']}>\n <Label htmlFor=\"nrOfColumns\">{t.table.nrofColumns}</Label>\n <InputField\n id=\"nrOfColumns\"\n placeholder={t.table.nrofColumnsPlaceholder}\n value={columnCount ? columnCount : ''}\n onChange={(event) => handleDimentionChange(event, 'column')}\n />\n </FormField>\n <div className={styles['tableform__footer']}>\n <Button variant={'secondary'} onClick={handleClose}>\n {t.common.cancel}\n </Button>\n <Button variant={'primary'} onClick={handleSave} disabled={!rowCount || !columnCount}>\n {t.common.add}\n </Button>\n </div>\n </div>\n );\n});\n","import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';\nimport clsx from 'clsx';\nimport { $isTableCellNode } from '@lexical/table';\nimport { $getSelection, $isRangeSelection, $getRoot } from 'lexical';\nimport { useRef, useEffect, useImperativeHandle, forwardRef } from 'react';\n\nimport type { TextNode, ElementNode } from 'lexical';\nimport type { addTableForm } from './AddTableFrom';\nimport type { Actions } from './TableCellContextMenu';\n\nimport { AddTableForm } from './AddTableFrom';\nimport { createTable, deleteColumn, deleteRow, deleteTable, insertColumn, insertRow } from './helpers';\n\nimport { useFlyout } from 'components/RteEditor/hooks/useFlyout';\nimport { Icon } from 'components';\nimport styles from 'components/RteEditor/RteEditor.module.css';\n\nconst PREVENT_OPEN_DELAY = 200;\n\ninterface TablePluginProps {\n isActive: boolean;\n}\n\nexport interface TableMutation {\n mutateTable: (type: Actions) => void;\n}\n\nexport const TablePlugin = forwardRef(({ isActive }: TablePluginProps, ref): JSX.Element => {\n const [editor] = useLexicalComposerContext();\n const { flyout, showFlyout, closeFlyout, isVisible } = useFlyout();\n const addTableForm = useRef<addTableForm>();\n const buttonRef = useRef<HTMLButtonElement>(null);\n const preventOpen = useRef(false);\n\n const insertTable = (nrOfRows: number, nrOfColumns: number) => {\n editor.update(() => {\n const selection = $getSelection();\n const tableNode = createTable(nrOfRows, nrOfColumns);\n if ($isRangeSelection(selection)) {\n selection.insertNodes([tableNode]);\n } else {\n $getRoot().append(tableNode);\n }\n const firstDescendant = tableNode.getFirstDescendant();\n if (firstDescendant) {\n (firstDescendant as TextNode).select();\n }\n });\n\n closeFlyout();\n };\n\n const mutateTable = (action: Actions) => {\n editor.update(() => {\n const selection = $getSelection();\n if ($isRangeSelection(selection)) {\n const anchorNode = selection.anchor.getNode();\n let currentNode: TextNode | ElementNode | null = anchorNode;\n\n while (currentNode !== null) {\n if ($isRangeSelection(selection)) {\n if ($isTableCellNode(currentNode)) {\n switch (action) {\n case 'insertRowAbove':\n case 'insertRowBelow':\n insertRow(currentNode, action);\n break;\n case 'deleteRow':\n deleteRow(currentNode);\n break;\n case 'insertColumnLeft':\n case 'insertColumnRight':\n insertColumn(currentNode, action);\n break;\n case 'deleteColumn':\n deleteColumn(currentNode);\n break;\n case 'deleteTable':\n deleteTable(currentNode);\n break;\n }\n }\n }\n currentNode = currentNode.getParent();\n }\n }\n });\n };\n\n const flyoutOptions = {\n children: (\n <AddTableForm\n onCloseHandler={closeFlyout}\n onSaveHandler={(rows, columns) => insertTable(rows, columns)}\n ref={addTableForm}\n />\n ),\n };\n\n useEffect(() => {\n if (!isVisible) {\n addTableForm.current?.clearForm();\n setTimeout(() => (preventOpen.current = false), PREVENT_OPEN_DELAY);\n } else {\n preventOpen.current = true;\n addTableForm.current?.focusFirstField();\n }\n }, [addTableForm, isVisible]);\n\n useImperativeHandle(ref, () => ({\n mutateTable,\n }));\n\n return (\n <div className={styles['editor__toolbar-button-group']}>\n <div className={styles['editor__toolbar-button-flyoutwrapper']}>\n <button\n onClick={() => !preventOpen.current && showFlyout(flyoutOptions)}\n className={clsx(styles['editor__toolbar-button'], isActive && styles[`editor__toolbar-button--active`])}\n aria-label={`Table`}\n ref={buttonRef}\n >\n <Icon name=\"Table\" size={24} />\n </button>\n {flyout}\n </div>\n </div>\n );\n});\n"],"names":["MultiSelectHeader","label","clearTrigger","onClear","jsxs","styles","jsx","Label","Button","MultiSelect","scrollable","noBorder","header","children","Fragment","clsx","MultiSelectItem","AddLinkForm","forwardRef","onCloseHandler","onSaveHandler","onRemoveHandler","isLink","ref","t","useTranslation","target","setTarget","useState","url","setUrl","urlError","setUrlError","firstField","useRef","handleUrl","event","handleTargetChange","prev","validateUrl","validateUrlWithProtocol","handleSave","resetForm","handleClose","handleRemoveHandler","setDefaults","focusFirstField","useImperativeHandle","FormField","InputField","FeedbackBox","Checkbox","AddTableForm","rowCount","setRowCount","columnCount","setColumnCount","handleDimentionChange","type","value","_a","PREVENT_OPEN_DELAY","TablePlugin","isActive","editor","useLexicalComposerContext","flyout","showFlyout","closeFlyout","isVisible","useFlyout","addTableForm","buttonRef","preventOpen","insertTable","nrOfRows","nrOfColumns","selection","$getSelection","tableNode","createTable","$isRangeSelection","$getRoot","firstDescendant","mutateTable","action","currentNode","$isTableCellNode","insertRow","deleteRow","insertColumn","deleteColumn","deleteTable","flyoutOptions","rows","columns","useEffect","_b","Icon"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUO,SAASA,GAAkB,EAAE,OAAAC,GAAO,cAAAC,GAAc,SAAAC,KAAmC;AAC1F,SACG,g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,CAAA,EACF,CAAA;AAEJ,CAAC;"}
|
package/dist/assets/Sortable.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._sortable__wrapper_pdpg0_1{position:relative}._sortable__wrapper--scrollable_pdpg0_5{border-bottom:1px solid var(--color-pattens-blue);border-top:1px solid var(--color-pattens-blue);margin-bottom:1rem;max-height:21rem;overflow-y:auto}._sortable__container_pdpg0_13{--item-min-height: 3.75rem;counter-reset:container;display:flex;flex-direction:column;gap:1rem;list-style:none;margin:1rem 1rem 1rem 0;padding:0}._sortable__drop-target_pdpg0_25{display:flex;gap:1rem;min-height:var(--item-min-height);position:relative}._sortable__drop-target_pdpg0_25:before{align-items:center;content:counter(container);counter-increment:container;display:flex;opacity:1;position:relative;transition:opacity .25s}._sortable__drop-target_pdpg0_25:after{content:"";display:block;height:1px;left:0;position:absolute;width:100%;z-index:1}._sortable__drop-target_pdpg0_25:last-child:after{display:inline}._sortable__sort-item_pdpg0_56{align-items:center;background-color:var(--color-grey-50);border-radius:.5rem;display:flex;gap:1rem;min-height:var(--item-min-height);position:relative;width:100%;z-index:0}._sortable__sort-item_pdpg0_56:focus{z-index:2}._sortable__sort-item--ghost_pdpg0_72{margin:0 1rem;opacity:.5;padding:.5rem 0;pointer-events:none;position:fixed;-webkit-user-drag:none;visibility:hidden;z-index:2}._sortable__sort-item__handle_pdpg0_83{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;background-color:var(--color-white);border:0;cursor:grab;height:2.625rem;width:2.625rem}._sortable__sort-item__button-container_pdpg0_93{align-items:center;background-color:var(--color-pattens-blue);border-left:1px solid var(--color-pattens-blue);border-radius:0 .5rem .5rem 0;display:flex;flex-direction:column;inset:0 0 0 auto;margin-right:1px;overflow:hidden;position:absolute;width:2.625rem;z-index:20}._sortable__sort-item__button-container_pdpg0_93[data-touch=false]{display:none}._sortable__sort-item__handle--icon_pdpg0_112{align-items:center;display:flex;height:1rem;width:1rem}._sortable__sort-item__handle--up_pdpg0_119,._sortable__sort-item__handle--down_pdpg0_120{color:#000;display:none;height:100%;right:.5rem}._sortable__sort-item__handle--up_pdpg0_119{transform:rotate(180deg)}._sortable__sort-item--dragging_pdpg0_131 ._sortable__sort-item__handle_pdpg0_83{cursor:grabbing}._sortable__sort-item__contents_pdpg0_135{align-items:center;color:var(--color-uva-black);display:flex;gap:.5rem;padding:.5rem;width:100%}._sortable__sort-item__contents--handle-right_pdpg0_144{padding-left:1rem;padding-right:2.5rem}._sortable__handle_pdpg0_149{color:var(--color-grey-500);cursor:grab;display:flex}._sortable__handle--right_pdpg0_155{position:absolute;right:.5rem}._sortable__sort-item__button-container_pdpg0_93[data-touch=true]{gap:1px;justify-content:center}._sortable__sort-item__button-container_pdpg0_93[data-touch=true] ._sortable__sort-item__handle--up_pdpg0_119,._sortable__sort-item__button-container_pdpg0_93[data-touch=true] ._sortable__sort-item__handle--down_pdpg0_120{align-items:center;display:flex;justify-content:center}._sortable__visually-hidden_pdpg0_173{border:0;clip:rect(0,0,0,0);clip-path:inset(50%);height:1px;margin:0 -1px -1px 0;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}
|
|
@@ -17,13 +17,13 @@ import "../IconButton/IconButton.js";
|
|
|
17
17
|
import "../Input/Input.js";
|
|
18
18
|
import "../InputField/InputField.js";
|
|
19
19
|
import "react-router-dom";
|
|
20
|
-
import "../../TablePlugin-
|
|
20
|
+
import "../../TablePlugin-Cj6IBz2k.js";
|
|
21
21
|
import "../RteEditor/hooks/components/Flyout.js";
|
|
22
22
|
import "../RteEditor/Providers/LanguageProvider.js";
|
|
23
23
|
import "../SelectListbox/SelectListbox.js";
|
|
24
24
|
import "../SelectListbox/SelectProvider.js";
|
|
25
25
|
import "../Sortable/components/SortableItem.js";
|
|
26
|
-
import "../../SortableProvider-
|
|
26
|
+
import "../../SortableProvider-BUsvniX7.js";
|
|
27
27
|
import { useResponsive as j } from "../hooks/useResponsive.js";
|
|
28
28
|
import '../../assets/CheckboxTree.css';const o = {
|
|
29
29
|
"checkbox-tree__header": "_checkbox-tree__header_xbe4e_1",
|
|
@@ -15,13 +15,13 @@ import "../GridRow/GridRow.js";
|
|
|
15
15
|
import "../IconButton/IconButton.js";
|
|
16
16
|
import "../Input/Input.js";
|
|
17
17
|
import "react-router-dom";
|
|
18
|
-
import "../../TablePlugin-
|
|
18
|
+
import "../../TablePlugin-Cj6IBz2k.js";
|
|
19
19
|
import "../RteEditor/hooks/components/Flyout.js";
|
|
20
20
|
import "../RteEditor/Providers/LanguageProvider.js";
|
|
21
21
|
import "../SelectListbox/SelectListbox.js";
|
|
22
22
|
import "../SelectListbox/SelectProvider.js";
|
|
23
23
|
import "../Sortable/components/SortableItem.js";
|
|
24
|
-
import "../../SortableProvider-
|
|
24
|
+
import "../../SortableProvider-BUsvniX7.js";
|
|
25
25
|
const C = `
|
|
26
26
|
// Has all HTMLInputElement props available except "className" and "style"
|
|
27
27
|
<InputField aria-labelledby={aria-labelledby} id={id} onChange={onChangeFunction}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as S, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { fn as d } from "../../index-MQ0yPLdl.js";
|
|
3
3
|
import { useState as p } from "react";
|
|
4
|
-
import { M as e } from "../../TablePlugin-
|
|
4
|
+
import { M as e } from "../../TablePlugin-Cj6IBz2k.js";
|
|
5
5
|
import { Container as M } from "../../storyComponents/Container/Container.js";
|
|
6
6
|
const C = `
|
|
7
7
|
// MultiSelectHeader can be added optionally
|
|
@@ -14,13 +14,13 @@ import "../../IconButton/IconButton.js";
|
|
|
14
14
|
import "../../Input/Input.js";
|
|
15
15
|
import "../../InputField/InputField.js";
|
|
16
16
|
import "react-router-dom";
|
|
17
|
-
import { a as q } from "../../../TablePlugin-
|
|
17
|
+
import { a as q } from "../../../TablePlugin-Cj6IBz2k.js";
|
|
18
18
|
import "../../RteEditor/hooks/components/Flyout.js";
|
|
19
19
|
import "../../RteEditor/Providers/LanguageProvider.js";
|
|
20
20
|
import "../../SelectListbox/SelectListbox.js";
|
|
21
21
|
import "../../SelectListbox/SelectProvider.js";
|
|
22
22
|
import "../../Sortable/components/SortableItem.js";
|
|
23
|
-
import "../../../SortableProvider-
|
|
23
|
+
import "../../../SortableProvider-BUsvniX7.js";
|
|
24
24
|
export {
|
|
25
25
|
q as MultiSelectHeader
|
|
26
26
|
};
|
|
@@ -16,14 +16,14 @@ import "../IconButton/IconButton.js";
|
|
|
16
16
|
import "../Input/Input.js";
|
|
17
17
|
import "../InputField/InputField.js";
|
|
18
18
|
import "react-router-dom";
|
|
19
|
-
import "../../TablePlugin-
|
|
19
|
+
import "../../TablePlugin-Cj6IBz2k.js";
|
|
20
20
|
import { Repeater as i } from "../Repeater/Repeater.js";
|
|
21
21
|
import "../RteEditor/hooks/components/Flyout.js";
|
|
22
22
|
import "../RteEditor/Providers/LanguageProvider.js";
|
|
23
23
|
import "../SelectListbox/SelectListbox.js";
|
|
24
24
|
import "../SelectListbox/SelectProvider.js";
|
|
25
25
|
import "../Sortable/components/SortableItem.js";
|
|
26
|
-
import "../../SortableProvider-
|
|
26
|
+
import "../../SortableProvider-BUsvniX7.js";
|
|
27
27
|
const l = "<ProgrammeCard key={key} header={header} details={details} onClick={onClickFunction} />", B = {
|
|
28
28
|
title: "Atoms/ProgrammeCard",
|
|
29
29
|
component: o,
|
|
@@ -15,13 +15,13 @@ import "../../IconButton/IconButton.js";
|
|
|
15
15
|
import "../../Input/Input.js";
|
|
16
16
|
import "../../InputField/InputField.js";
|
|
17
17
|
import "react-router-dom";
|
|
18
|
-
import "../../../TablePlugin-
|
|
18
|
+
import "../../../TablePlugin-Cj6IBz2k.js";
|
|
19
19
|
import "../hooks/components/Flyout.js";
|
|
20
20
|
import "../Providers/LanguageProvider.js";
|
|
21
21
|
import "../../SelectListbox/SelectListbox.js";
|
|
22
22
|
import "../../SelectListbox/SelectProvider.js";
|
|
23
23
|
import "../../Sortable/components/SortableItem.js";
|
|
24
|
-
import "../../../SortableProvider-
|
|
24
|
+
import "../../../SortableProvider-BUsvniX7.js";
|
|
25
25
|
import '../../../assets/EditorHeader.css';const o = {
|
|
26
26
|
"editor-header__container": "_editor-header__container_1kv3n_1",
|
|
27
27
|
"editor-header__info-icon": "_editor-header__info-icon_1kv3n_10",
|
|
@@ -16,14 +16,14 @@ import "../../../IconButton/IconButton.js";
|
|
|
16
16
|
import "../../../Input/Input.js";
|
|
17
17
|
import "../../../InputField/InputField.js";
|
|
18
18
|
import "react-router-dom";
|
|
19
|
-
import "../../../../TablePlugin-
|
|
19
|
+
import "../../../../TablePlugin-Cj6IBz2k.js";
|
|
20
20
|
import { s as t } from "../../../../RteEditor.module-Dz9a8vaK.js";
|
|
21
21
|
import "../../hooks/components/Flyout.js";
|
|
22
22
|
import "../../Providers/LanguageProvider.js";
|
|
23
23
|
import "../../../SelectListbox/SelectListbox.js";
|
|
24
24
|
import "../../../SelectListbox/SelectProvider.js";
|
|
25
25
|
import "../../../Sortable/components/SortableItem.js";
|
|
26
|
-
import "../../../../SortableProvider-
|
|
26
|
+
import "../../../../SortableProvider-BUsvniX7.js";
|
|
27
27
|
const O = () => {
|
|
28
28
|
const [o] = f(), [s, d] = m(!1), [p, l] = m(!1), c = () => {
|
|
29
29
|
o.dispatchCommand(C, void 0);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
3
|
import "../../../../helpers-Ec7CfNnA.js";
|
|
4
|
-
import { A as z } from "../../../../TablePlugin-
|
|
4
|
+
import { A as z } from "../../../../TablePlugin-Cj6IBz2k.js";
|
|
5
5
|
import "../../../Buttons/Button.js";
|
|
6
6
|
import "../../../Buttons/LinkButton.js";
|
|
7
7
|
import "@react-aria/button";
|
|
@@ -24,7 +24,7 @@ import "../../Providers/LanguageProvider.js";
|
|
|
24
24
|
import "../../../SelectListbox/SelectListbox.js";
|
|
25
25
|
import "../../../SelectListbox/SelectProvider.js";
|
|
26
26
|
import "../../../Sortable/components/SortableItem.js";
|
|
27
|
-
import "../../../../SortableProvider-
|
|
27
|
+
import "../../../../SortableProvider-BUsvniX7.js";
|
|
28
28
|
export {
|
|
29
29
|
z as AddLinkForm
|
|
30
30
|
};
|
|
@@ -4,7 +4,7 @@ import { c as L } from "../../../../clsx-OuTLNxxd.js";
|
|
|
4
4
|
import { g as N, U as b } from "../../../../helpers-Ec7CfNnA.js";
|
|
5
5
|
import { useRef as _, useEffect as g } from "react";
|
|
6
6
|
import { r as C, I as E, m as P } from "../../../../Lexical.prod-CO0gPAfo.js";
|
|
7
|
-
import { A as x } from "../../../../TablePlugin-
|
|
7
|
+
import { A as x } from "../../../../TablePlugin-Cj6IBz2k.js";
|
|
8
8
|
import { useFlyout as I } from "../../hooks/useFlyout.js";
|
|
9
9
|
import { Icon as T } from "../../../Icon/Icon.js";
|
|
10
10
|
import "../../../Buttons/Button.js";
|
|
@@ -24,7 +24,7 @@ import "../../Providers/LanguageProvider.js";
|
|
|
24
24
|
import "../../../SelectListbox/SelectListbox.js";
|
|
25
25
|
import "../../../SelectListbox/SelectProvider.js";
|
|
26
26
|
import "../../../Sortable/components/SortableItem.js";
|
|
27
|
-
import "../../../../SortableProvider-
|
|
27
|
+
import "../../../../SortableProvider-BUsvniX7.js";
|
|
28
28
|
const A = 200, st = ({
|
|
29
29
|
isLink: l = { active: !1, url: "", target: "_self" },
|
|
30
30
|
isLinkable: k = !1
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { b as v } from "../../../../TablePlugin-
|
|
3
|
+
import { b as v } from "../../../../TablePlugin-Cj6IBz2k.js";
|
|
4
4
|
import "../../../Buttons/Button.js";
|
|
5
5
|
import "../../../Buttons/LinkButton.js";
|
|
6
6
|
import "@react-aria/button";
|
|
@@ -21,7 +21,7 @@ import "../../Providers/LanguageProvider.js";
|
|
|
21
21
|
import "../../../SelectListbox/SelectListbox.js";
|
|
22
22
|
import "../../../SelectListbox/SelectProvider.js";
|
|
23
23
|
import "../../../Sortable/components/SortableItem.js";
|
|
24
|
-
import "../../../../SortableProvider-
|
|
24
|
+
import "../../../../SortableProvider-BUsvniX7.js";
|
|
25
25
|
export {
|
|
26
26
|
v as AddTableForm
|
|
27
27
|
};
|
|
@@ -4,7 +4,7 @@ import "../../../../clsx-OuTLNxxd.js";
|
|
|
4
4
|
import "../../../../helpers-BewZrn6E.js";
|
|
5
5
|
import "../../../../Lexical.prod-CO0gPAfo.js";
|
|
6
6
|
import "react";
|
|
7
|
-
import { T as A } from "../../../../TablePlugin-
|
|
7
|
+
import { T as A } from "../../../../TablePlugin-Cj6IBz2k.js";
|
|
8
8
|
import "../../hooks/useFlyout.js";
|
|
9
9
|
import "../../../Icon/Icon.js";
|
|
10
10
|
import "../../../Buttons/Button.js";
|
|
@@ -24,7 +24,7 @@ import "../../Providers/LanguageProvider.js";
|
|
|
24
24
|
import "../../../SelectListbox/SelectListbox.js";
|
|
25
25
|
import "../../../SelectListbox/SelectProvider.js";
|
|
26
26
|
import "../../../Sortable/components/SortableItem.js";
|
|
27
|
-
import "../../../../SortableProvider-
|
|
27
|
+
import "../../../../SortableProvider-BUsvniX7.js";
|
|
28
28
|
export {
|
|
29
29
|
A as TablePlugin
|
|
30
30
|
};
|
|
@@ -8,7 +8,7 @@ import { BlockFormatPlugin as U } from "../BlockFormatPlugin/BlockFormatPlugin.j
|
|
|
8
8
|
import { ListPlugin as _ } from "../ListPlugin/ListPlugin.js";
|
|
9
9
|
import { LinkPlugin as j } from "../LinkPlugin/LinkPlugin.js";
|
|
10
10
|
import { HistoryPlugin as E } from "../HistoryPlugin/HistoryPlugin.js";
|
|
11
|
-
import { T as K } from "../../../../TablePlugin-
|
|
11
|
+
import { T as K } from "../../../../TablePlugin-Cj6IBz2k.js";
|
|
12
12
|
import { TableCellContextMenu as M } from "../TablePlugin/TableCellContextMenu/TableCellContextMenu.js";
|
|
13
13
|
import { s as O } from "../../../../RteEditor.module-Dz9a8vaK.js";
|
|
14
14
|
const w = (s, l) => {
|
|
@@ -3,7 +3,7 @@ import { BlockFormatPlugin as t } from "./BlockFormatPlugin/BlockFormatPlugin.js
|
|
|
3
3
|
import { ListPlugin as n } from "./ListPlugin/ListPlugin.js";
|
|
4
4
|
import { LinkPlugin as x } from "./LinkPlugin/LinkPlugin.js";
|
|
5
5
|
import { HistoryPlugin as p } from "./HistoryPlugin/HistoryPlugin.js";
|
|
6
|
-
import { T as g } from "../../../TablePlugin-
|
|
6
|
+
import { T as g } from "../../../TablePlugin-Cj6IBz2k.js";
|
|
7
7
|
import { TableCellContextMenu as a } from "./TablePlugin/TableCellContextMenu/TableCellContextMenu.js";
|
|
8
8
|
export {
|
|
9
9
|
t as BlockFormatPlugin,
|
|
@@ -12,7 +12,7 @@ import { c as nn } from "../../clsx-OuTLNxxd.js";
|
|
|
12
12
|
import { s as L } from "../../RteEditor.module-Dz9a8vaK.js";
|
|
13
13
|
import { ToolBarPlugin as rn } from "./Plugins/ToolbarPlugin/ToolbarPlugin.js";
|
|
14
14
|
import { Icon as on } from "../Icon/Icon.js";
|
|
15
|
-
import "../../TablePlugin-
|
|
15
|
+
import "../../TablePlugin-Cj6IBz2k.js";
|
|
16
16
|
import "./hooks/components/Flyout.js";
|
|
17
17
|
import "../Buttons/Button.js";
|
|
18
18
|
import "../Buttons/LinkButton.js";
|
|
@@ -29,7 +29,7 @@ import "react-router-dom";
|
|
|
29
29
|
import "../SelectListbox/SelectListbox.js";
|
|
30
30
|
import "../SelectListbox/SelectProvider.js";
|
|
31
31
|
import "../Sortable/components/SortableItem.js";
|
|
32
|
-
import "../../SortableProvider-
|
|
32
|
+
import "../../SortableProvider-BUsvniX7.js";
|
|
33
33
|
import { useTranslation as sn } from "./hooks/useTranslation.js";
|
|
34
34
|
import { UvaTheme as an } from "./UvaTheme/UvaTheme.js";
|
|
35
35
|
import { EditorHeader as ln } from "./EditorHeader/EditorHeader.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { Children as e } from "react";
|
|
3
3
|
import { SortableItem as b } from "./components/SortableItem.js";
|
|
4
|
-
import { S as n } from "../../SortableProvider-
|
|
4
|
+
import { S as n } from "../../SortableProvider-BUsvniX7.js";
|
|
5
5
|
const S = ({ children: t, ItemHandlePlacement: m = "left", scrollable: a, disabled: l, onSort: i }) => /* @__PURE__ */ o(
|
|
6
6
|
n,
|
|
7
7
|
{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
3
|
import "./sortableReducer.js";
|
|
4
|
-
import { S as p, u as a } from "../../SortableProvider-
|
|
4
|
+
import { S as p, u as a } from "../../SortableProvider-BUsvniX7.js";
|
|
5
5
|
import "./actions.js";
|
|
6
6
|
export {
|
|
7
7
|
p as SortableProvider,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
3
|
import "../../../clsx-OuTLNxxd.js";
|
|
4
|
-
import "../../../Sortable.module-
|
|
5
|
-
import { a } from "../../../SortableProvider-
|
|
4
|
+
import "../../../Sortable.module-DDhRFD1T.js";
|
|
5
|
+
import { a } from "../../../SortableProvider-BUsvniX7.js";
|
|
6
6
|
export {
|
|
7
7
|
a as SortableContainer
|
|
8
8
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { Icon as e } from "../../Icon/Icon.js";
|
|
3
|
-
import { s as t } from "../../../Sortable.module-
|
|
3
|
+
import { s as t } from "../../../Sortable.module-DDhRFD1T.js";
|
|
4
4
|
const r = "ontouchstart" in globalThis.document.documentElement;
|
|
5
5
|
function m({ placement: n }) {
|
|
6
6
|
return r ? null : /* @__PURE__ */ o("div", { className: `${t.sortable__handle} ${t[`sortable__handle--${n}`]}`, children: /* @__PURE__ */ o(e, { name: "Dots" }) });
|
|
@@ -2,8 +2,8 @@ import { jsxs as i, jsx as r, Fragment as v } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState as S, useRef as M, useEffect as Q } from "react";
|
|
3
3
|
import { Icon as w } from "../../Icon/Icon.js";
|
|
4
4
|
import { SortableHandle as E } from "./SortableHandle.js";
|
|
5
|
-
import { s as t } from "../../../Sortable.module-
|
|
6
|
-
import { u as k } from "../../../SortableProvider-
|
|
5
|
+
import { s as t } from "../../../Sortable.module-DDhRFD1T.js";
|
|
6
|
+
import { u as k } from "../../../SortableProvider-BUsvniX7.js";
|
|
7
7
|
const G = ["Space", "ArrowDown", "ArrowUp"], J = "ontouchstart" in globalThis.document.documentElement, C = new Image(0, 0);
|
|
8
8
|
C.src = // 1px transparent png
|
|
9
9
|
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg==";
|
package/dist/components/index.js
CHANGED
|
@@ -29,7 +29,7 @@ import { Label as to } from "./Label/Label.js";
|
|
|
29
29
|
import { MenuLink as po } from "./MenuLink/MenuLink.js";
|
|
30
30
|
import { MetaDataList as mo } from "./MetaDataList/MetaDataList.js";
|
|
31
31
|
import { ModalDialog as io } from "./ModalDialog/ModalDialog.js";
|
|
32
|
-
import { M as no } from "../TablePlugin-
|
|
32
|
+
import { M as no } from "../TablePlugin-Cj6IBz2k.js";
|
|
33
33
|
import { OverlayCloseButton as co } from "./OverlayCloseButton/OverlayCloseButton.js";
|
|
34
34
|
import { PageOverlay as so } from "./PageOverlay/PageOverlay.js";
|
|
35
35
|
import { Periods as So } from "./Periods/Periods.js";
|
package/dist/index.js
CHANGED
|
@@ -29,7 +29,7 @@ import { Label as to } from "./components/Label/Label.js";
|
|
|
29
29
|
import { MenuLink as po } from "./components/MenuLink/MenuLink.js";
|
|
30
30
|
import { MetaDataList as mo } from "./components/MetaDataList/MetaDataList.js";
|
|
31
31
|
import { ModalDialog as io } from "./components/ModalDialog/ModalDialog.js";
|
|
32
|
-
import { M as no } from "./TablePlugin-
|
|
32
|
+
import { M as no } from "./TablePlugin-Cj6IBz2k.js";
|
|
33
33
|
import { OverlayCloseButton as co } from "./components/OverlayCloseButton/OverlayCloseButton.js";
|
|
34
34
|
import { PageOverlay as so } from "./components/PageOverlay/PageOverlay.js";
|
|
35
35
|
import { Periods as So } from "./components/Periods/Periods.js";
|
package/package.json
CHANGED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import './assets/Sortable.css';const _ = "_sortable__wrapper_td575_1", t = "_sortable__container_td575_13", e = "_sortable__handle_td575_154", r = {
|
|
2
|
-
sortable__wrapper: _,
|
|
3
|
-
"sortable__wrapper--scrollable": "_sortable__wrapper--scrollable_td575_5",
|
|
4
|
-
sortable__container: t,
|
|
5
|
-
"sortable__drop-target": "_sortable__drop-target_td575_25",
|
|
6
|
-
"sortable__sort-item": "_sortable__sort-item_td575_56",
|
|
7
|
-
"sortable__sort-item--ghost": "_sortable__sort-item--ghost_td575_72",
|
|
8
|
-
"sortable__container--drag-over": "_sortable__container--drag-over_td575_83",
|
|
9
|
-
"sortable__sort-item__handle": "_sortable__sort-item__handle_td575_88",
|
|
10
|
-
"sortable__sort-item__button-container": "_sortable__sort-item__button-container_td575_98",
|
|
11
|
-
"sortable__sort-item__handle--icon": "_sortable__sort-item__handle--icon_td575_117",
|
|
12
|
-
"sortable__sort-item__handle--up": "_sortable__sort-item__handle--up_td575_124",
|
|
13
|
-
"sortable__sort-item__handle--down": "_sortable__sort-item__handle--down_td575_125",
|
|
14
|
-
"sortable__sort-item--dragging": "_sortable__sort-item--dragging_td575_136",
|
|
15
|
-
"sortable__sort-item__contents": "_sortable__sort-item__contents_td575_140",
|
|
16
|
-
"sortable__sort-item__contents--handle-right": "_sortable__sort-item__contents--handle-right_td575_149",
|
|
17
|
-
sortable__handle: e,
|
|
18
|
-
"sortable__handle--right": "_sortable__handle--right_td575_160",
|
|
19
|
-
"sortable__visually-hidden": "_sortable__visually-hidden_td575_178"
|
|
20
|
-
};
|
|
21
|
-
export {
|
|
22
|
-
r as s
|
|
23
|
-
};
|
|
24
|
-
//# sourceMappingURL=Sortable.module-uk_YuFs1.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Sortable.module-uk_YuFs1.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;"}
|