@uva-glass/component-library 1.55.1 → 1.57.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Button.module-FL3-CODh.js +15 -0
- package/dist/Button.module-FL3-CODh.js.map +1 -0
- package/dist/{Lexical.prod-BiuZHlIm.js → Lexical.prod-CO0gPAfo.js} +583 -607
- package/dist/Lexical.prod-CO0gPAfo.js.map +1 -0
- package/dist/LexicalComposerContext.prod-Dyvim1tK.js +27 -0
- package/dist/LexicalComposerContext.prod-Dyvim1tK.js.map +1 -0
- package/dist/LexicalList.prod-BceA-cJD.js +562 -0
- package/dist/LexicalList.prod-BceA-cJD.js.map +1 -0
- package/dist/{LexicalUtils.prod-BZOm66mY.js → LexicalUtils.prod-PbdOb6JG.js} +6 -6
- package/dist/{LexicalUtils.prod-BZOm66mY.js.map → LexicalUtils.prod-PbdOb6JG.js.map} +1 -1
- package/dist/RteEditor.module-Dz9a8vaK.js +29 -0
- package/dist/RteEditor.module-Dz9a8vaK.js.map +1 -0
- package/dist/Sortable.module-uk_YuFs1.js +24 -0
- package/dist/{Sortable.module-B-93knlb.js.map → Sortable.module-uk_YuFs1.js.map} +1 -1
- package/dist/{SortableProvider-BMm77PpY.js → SortableProvider-i4PDjRS_.js} +2 -2
- package/dist/{SortableProvider-BMm77PpY.js.map → SortableProvider-i4PDjRS_.js.map} +1 -1
- package/dist/TablePlugin-1L5UZfDH.js +249 -0
- package/dist/TablePlugin-1L5UZfDH.js.map +1 -0
- package/dist/assets/Button.css +1 -1
- package/dist/assets/Container.css +1 -1
- package/dist/assets/EditorHeader.css +1 -0
- package/dist/assets/Flyout.css +1 -0
- package/dist/assets/Periods.css +1 -1
- package/dist/assets/RteEditor.css +1 -1
- package/dist/assets/Sortable.css +1 -1
- package/dist/assets/TableCellContextMenu.css +1 -0
- package/dist/assets/TablePlugin.css +1 -0
- package/dist/components/Buttons/Button.js +1 -1
- package/dist/components/Buttons/LinkButton.js +1 -1
- package/dist/components/Buttons/LinkButton.stories.js +13 -5
- package/dist/components/Buttons/LinkButton.stories.js.map +1 -1
- package/dist/components/Buttons/MenuButton.js +1 -1
- package/dist/components/CheckboxTree/CheckboxTree.js +13 -11
- package/dist/components/CheckboxTree/CheckboxTree.js.map +1 -1
- package/dist/components/Icon/icons/index.d.ts +21 -18
- package/dist/components/Icon/icons/index.js +125 -120
- package/dist/components/Icon/icons/index.js.map +1 -1
- package/dist/components/InputField/InputField.stories.js +16 -14
- package/dist/components/InputField/InputField.stories.js.map +1 -1
- package/dist/components/MultiSelect/MultiSelect.js +1 -1
- package/dist/components/MultiSelect/MultiSelect.stories.js +1 -1
- package/dist/components/MultiSelect/components/MultiSelectHeader.js +5 -3
- package/dist/components/MultiSelect/components/MultiSelectHeader.js.map +1 -1
- package/dist/components/MultiSelect/index.js +1 -1
- package/dist/components/Periods/Periods.js +12 -12
- package/dist/components/ProgrammeCard/ProgrammeCard.stories.js +6 -4
- package/dist/components/ProgrammeCard/ProgrammeCard.stories.js.map +1 -1
- package/dist/components/RteEditor/EditorHeader/EditorHeader.d.ts +7 -0
- package/dist/components/RteEditor/EditorHeader/EditorHeader.js +53 -0
- package/dist/components/RteEditor/EditorHeader/EditorHeader.js.map +1 -0
- package/dist/components/RteEditor/EditorHeader/index.d.ts +1 -0
- package/dist/components/RteEditor/EditorHeader/index.js +5 -0
- package/dist/components/RteEditor/Plugins/BlockFormatPlugin/BlockFormatPlugin.js +11 -10
- package/dist/components/RteEditor/Plugins/BlockFormatPlugin/BlockFormatPlugin.js.map +1 -1
- package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.js +18 -15
- package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.js.map +1 -1
- package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkFrom.d.ts +2 -0
- package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkFrom.js +7 -4
- package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkFrom.js.map +1 -1
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.d.ts +2 -1
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js +63 -49
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js.map +1 -1
- package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.d.ts +3 -0
- package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js +6 -4
- package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js.map +1 -1
- package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.js +31 -8
- package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.js.map +1 -1
- package/dist/components/RteEditor/Plugins/ListPlugin/index.js +1 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/AddTableFrom.js +6 -3
- package/dist/components/RteEditor/Plugins/TablePlugin/AddTableFrom.js.map +1 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/TableCellContextMenu/TableCellContextMenu.d.ts +8 -0
- package/dist/components/RteEditor/Plugins/TablePlugin/TableCellContextMenu/TableCellContextMenu.js +44 -0
- package/dist/components/RteEditor/Plugins/TablePlugin/TableCellContextMenu/TableCellContextMenu.js.map +1 -0
- package/dist/components/RteEditor/Plugins/TablePlugin/TableCellContextMenu/index.d.ts +1 -0
- package/dist/components/RteEditor/Plugins/TablePlugin/TableCellContextMenu/index.js +5 -0
- package/dist/components/RteEditor/Plugins/TablePlugin/TableCellContextMenu/index.js.map +1 -0
- package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.d.ts +9 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.js +8 -6
- package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.js.map +1 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/helpers.d.ts +7 -0
- package/dist/components/RteEditor/Plugins/TablePlugin/helpers.js +10 -0
- package/dist/components/RteEditor/Plugins/TablePlugin/helpers.js.map +1 -0
- package/dist/components/RteEditor/Plugins/TablePlugin/index.d.ts +1 -0
- package/dist/components/RteEditor/Plugins/TablePlugin/index.js +4 -2
- package/dist/components/RteEditor/Plugins/TablePlugin/index.js.map +1 -1
- package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.d.ts +4 -0
- package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js +48 -38
- package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js.map +1 -1
- package/dist/components/RteEditor/Plugins/index.js +10 -8
- package/dist/components/RteEditor/Plugins/index.js.map +1 -1
- package/dist/components/RteEditor/Providers/LanguageProvider.d.ts +10 -0
- package/dist/components/RteEditor/Providers/LanguageProvider.js +18 -0
- package/dist/components/RteEditor/Providers/LanguageProvider.js.map +1 -0
- package/dist/components/RteEditor/RteEditor.d.ts +9 -1
- package/dist/components/RteEditor/RteEditor.js +476 -401
- package/dist/components/RteEditor/RteEditor.js.map +1 -1
- package/dist/components/RteEditor/RteEditor.stories.d.ts +1 -0
- package/dist/components/RteEditor/RteEditor.stories.js +106 -15
- package/dist/components/RteEditor/RteEditor.stories.js.map +1 -1
- package/dist/components/RteEditor/UvaTheme/UvaTheme.js +1 -1
- package/dist/components/RteEditor/hooks/components/Flyout.d.ts +7 -0
- package/dist/components/RteEditor/hooks/components/Flyout.js +14 -0
- package/dist/components/RteEditor/hooks/components/Flyout.js.map +1 -0
- package/dist/components/RteEditor/hooks/useFlyout.js +16 -20
- package/dist/components/RteEditor/hooks/useFlyout.js.map +1 -1
- package/dist/components/RteEditor/hooks/useTranslation.d.ts +61 -0
- package/dist/components/RteEditor/hooks/useTranslation.js +10 -0
- package/dist/components/RteEditor/hooks/useTranslation.js.map +1 -0
- package/dist/components/RteEditor/index.js +3 -2
- package/dist/components/RteEditor/mockRteContent.d.ts +1 -0
- package/dist/components/RteEditor/mockRteContent.js +98 -0
- package/dist/components/RteEditor/mockRteContent.js.map +1 -0
- package/dist/components/RteEditor/translations.d.ts +64 -0
- package/dist/components/RteEditor/translations.js +68 -0
- package/dist/components/RteEditor/translations.js.map +1 -0
- 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 +20 -19
- package/dist/helpers-BewZrn6E.js +1512 -0
- package/dist/helpers-BewZrn6E.js.map +1 -0
- package/dist/{helpers-CJF7fErD.js → helpers-Ec7CfNnA.js} +72 -59
- package/dist/helpers-Ec7CfNnA.js.map +1 -0
- package/dist/index.js +20 -19
- package/dist/storyComponents/Container/Container.d.ts +1 -1
- package/dist/storyComponents/Container/Container.js +18 -16
- package/dist/storyComponents/Container/Container.js.map +1 -1
- package/dist/types/UserInterface.d.ts +1 -1
- package/package.json +12 -12
- package/dist/AddTableFrom-u1gSA461.js +0 -162
- package/dist/AddTableFrom-u1gSA461.js.map +0 -1
- package/dist/Button.module-Gr3KvBvb.js +0 -14
- package/dist/Button.module-Gr3KvBvb.js.map +0 -1
- package/dist/Lexical.prod-BiuZHlIm.js.map +0 -1
- package/dist/ListPlugin-DFFbKLaN.js +0 -588
- package/dist/ListPlugin-DFFbKLaN.js.map +0 -1
- package/dist/RteEditor.module-BBbfV1rk.js +0 -24
- package/dist/RteEditor.module-BBbfV1rk.js.map +0 -1
- package/dist/Sortable.module-B-93knlb.js +0 -24
- package/dist/TablePlugin-acQeRCt0.js +0 -1506
- package/dist/TablePlugin-acQeRCt0.js.map +0 -1
- package/dist/assets/AddTableFrom.css +0 -1
- package/dist/assets/useFlyout.css +0 -1
- package/dist/components/RteEditor/hooks/index.d.ts +0 -1
- package/dist/components/RteEditor/hooks/index.js +0 -5
- package/dist/helpers-CJF7fErD.js.map +0 -1
- /package/dist/components/RteEditor/{hooks → EditorHeader}/index.js.map +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolbarPlugin.js","sources":["../../../../../src/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.tsx"],"sourcesContent":["import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';\nimport { $getSelection, $isRangeSelection } from 'lexical';\nimport { useCallback, useEffect, useState } from 'react';\nimport { $
|
|
1
|
+
{"version":3,"file":"ToolbarPlugin.js","sources":["../../../../../src/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.tsx"],"sourcesContent":["import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';\nimport { $getSelection, $isRangeSelection } from 'lexical';\nimport { useCallback, useEffect, useRef, useState } from 'react';\nimport { $isTableCellNode } from '@lexical/table';\n\nimport type { ElementNode, TextNode } from 'lexical';\nimport type { Actions } from 'components/RteEditor/Plugins/TablePlugin/TableCellContextMenu/TableCellContextMenu';\nimport type { TableMutation } from 'components/RteEditor/Plugins/TablePlugin/TablePlugin';\n\nimport { getNodeTag } from 'components/RteEditor/Plugins/LinkPlugin/helpers';\nimport {\n LinkPlugin,\n BlockFormatPlugin,\n ListPlugin,\n HistoryPlugin,\n TablePlugin,\n TableCellContextMenu,\n} from 'components/RteEditor/Plugins';\nimport styles from 'components/RteEditor/RteEditor.module.css';\n\nexport type TargetType = '_blank' | '_self';\nexport interface LinkType {\n active: boolean;\n url: string;\n target: TargetType | string;\n}\n\nexport type Position = {\n xPos: number;\n yPos: number;\n};\n\nconst getTableCell = (\n anchorNode: ElementNode | TextNode,\n editor: ReturnType<typeof useLexicalComposerContext>[0]\n): Position | null => {\n let currentNode: TextNode | ElementNode | null = anchorNode;\n\n while (currentNode !== null) {\n if ($isTableCellNode(currentNode) && editor) {\n const domNode = editor.getElementByKey(currentNode.getKey());\n if (domNode) {\n const rect = domNode.getBoundingClientRect();\n return { xPos: rect.right, yPos: rect.bottom };\n } else {\n return null;\n }\n }\n currentNode = currentNode.getParent();\n }\n\n return null;\n};\n\nexport const ToolBarPlugin = (): JSX.Element => {\n const [editor] = useLexicalComposerContext();\n const [isBold, setIsBold] = useState(false);\n const [isItalic, setIsItalic] = useState(false);\n const [isUList, setIsUList] = useState<boolean>(false);\n const [isOList, setIsOList] = useState<boolean>(false);\n const [isLink, setIsLink] = useState<LinkType>({ active: false, url: '', target: '_self' });\n const [isSelectedRange, setIsSelectedRange] = useState(false);\n const [position, setPosition] = useState<Position | null>(null);\n const tableref = useRef<TableMutation>(null);\n\n const updateToolbar = useCallback(() => {\n const selection = $getSelection();\n if ($isRangeSelection(selection)) {\n const anchor = selection.anchor;\n const anchorNode = anchor.getNode();\n const focus = selection.focus;\n\n setIsBold(selection.hasFormat('bold'));\n setIsItalic(selection.hasFormat('italic'));\n setIsUList(getNodeTag(anchorNode, 'ul') as boolean);\n setIsOList(getNodeTag(anchorNode, 'ol') as boolean);\n\n setIsSelectedRange(Math.abs(anchor.offset - focus.offset) !== 0);\n setIsLink(getNodeTag(anchorNode, 'a') as LinkType);\n\n setPosition(getTableCell(anchorNode, editor));\n }\n }, [editor]);\n\n const handleTableAction = (action: Actions) => {\n tableref.current?.mutateTable(action);\n };\n\n useEffect(() => {\n editor.registerUpdateListener(({ editorState }) => {\n editorState.read(() => {\n updateToolbar();\n });\n });\n }, [editor, updateToolbar]);\n\n return (\n <div className={styles['editor__toolbar']}>\n <BlockFormatPlugin isBold={isBold} isItalic={isItalic} />\n <ListPlugin isUList={isUList} isOList={isOList} />\n <TablePlugin isActive={Boolean(position)} ref={tableref} />\n {position && <TableCellContextMenu position={position} onAction={handleTableAction} />}\n <LinkPlugin isLink={isLink} isLinkable={isSelectedRange} />\n <HistoryPlugin />\n </div>\n );\n};\n"],"names":["getTableCell","anchorNode","editor","currentNode","$isTableCellNode","domNode","rect","ToolBarPlugin","useLexicalComposerContext","isBold","setIsBold","useState","isItalic","setIsItalic","isUList","setIsUList","isOList","setIsOList","isLink","setIsLink","isSelectedRange","setIsSelectedRange","position","setPosition","tableref","useRef","updateToolbar","useCallback","selection","$getSelection","$isRangeSelection","anchor","focus","getNodeTag","handleTableAction","action","_a","useEffect","editorState","jsxs","styles","jsx","BlockFormatPlugin","ListPlugin","TablePlugin","TableCellContextMenu","LinkPlugin","HistoryPlugin"],"mappings":";;;;;;;;;;;;;AAgCA,MAAMA,IAAe,CACnBC,GACAC,MACoB;AACpB,MAAIC,IAA6CF;AAEjD,SAAOE,MAAgB,QAAM;AACvB,QAAAC,EAAiBD,CAAW,KAAKD,GAAQ;AAC3C,YAAMG,IAAUH,EAAO,gBAAgBC,EAAY,OAAQ,CAAA;AAC3D,UAAIE,GAAS;AACL,cAAAC,IAAOD,EAAQ;AACrB,eAAO,EAAE,MAAMC,EAAK,OAAO,MAAMA,EAAK;MAAO;AAEtC,eAAA;AAAA,IAEX;AACA,IAAAH,IAAcA,EAAY;EAC5B;AAEO,SAAA;AACT,GAEaI,KAAgB,MAAmB;AACxC,QAAA,CAACL,CAAM,IAAIM,KACX,CAACC,GAAQC,CAAS,IAAIC,EAAS,EAAK,GACpC,CAACC,GAAUC,CAAW,IAAIF,EAAS,EAAK,GACxC,CAACG,GAASC,CAAU,IAAIJ,EAAkB,EAAK,GAC/C,CAACK,GAASC,CAAU,IAAIN,EAAkB,EAAK,GAC/C,CAACO,GAAQC,CAAS,IAAIR,EAAmB,EAAE,QAAQ,IAAO,KAAK,IAAI,QAAQ,QAAS,CAAA,GACpF,CAACS,GAAiBC,CAAkB,IAAIV,EAAS,EAAK,GACtD,CAACW,GAAUC,CAAW,IAAIZ,EAA0B,IAAI,GACxDa,IAAWC,EAAsB,IAAI,GAErCC,IAAgBC,EAAY,MAAM;AACtC,UAAMC,IAAYC;AACd,QAAAC,EAAkBF,CAAS,GAAG;AAChC,YAAMG,IAASH,EAAU,QACnB3B,IAAa8B,EAAO,WACpBC,IAAQJ,EAAU;AAEd,MAAAlB,EAAAkB,EAAU,UAAU,MAAM,CAAC,GACzBf,EAAAe,EAAU,UAAU,QAAQ,CAAC,GAC9Bb,EAAAkB,EAAWhC,GAAY,IAAI,CAAY,GACvCgB,EAAAgB,EAAWhC,GAAY,IAAI,CAAY,GAElDoB,EAAmB,KAAK,IAAIU,EAAO,SAASC,EAAM,MAAM,MAAM,CAAC,GACrDb,EAAAc,EAAWhC,GAAY,GAAG,CAAa,GAErCsB,EAAAvB,EAAaC,GAAYC,CAAM,CAAC;AAAA,IAC9C;AAAA,EAAA,GACC,CAACA,CAAM,CAAC,GAELgC,IAAoB,CAACC,MAAoB;;AACpC,KAAAC,IAAAZ,EAAA,YAAA,QAAAY,EAAS,YAAYD;AAAA,EAAM;AAGtC,SAAAE,EAAU,MAAM;AACd,IAAAnC,EAAO,uBAAuB,CAAC,EAAE,aAAAoC,QAAkB;AACjD,MAAAA,EAAY,KAAK,MAAM;AACP,QAAAZ;MAAA,CACf;AAAA,IAAA,CACF;AAAA,EAAA,GACA,CAACxB,GAAQwB,CAAa,CAAC,GAGvB,gBAAAa,EAAA,OAAA,EAAI,WAAWC,EAAO,iBACrB,UAAA;AAAA,IAAC,gBAAAC,EAAAC,GAAA,EAAkB,QAAAjC,GAAgB,UAAAG,EAAoB,CAAA;AAAA,IACvD,gBAAA6B,EAACE,GAAW,EAAA,SAAA7B,GAAkB,SAAAE,EAAkB,CAAA;AAAA,sBAC/C4B,GAAY,EAAA,UAAU,EAAQtB,GAAW,KAAKE,GAAU;AAAA,IACxDF,KAAY,gBAAAmB,EAACI,GAAqB,EAAA,UAAAvB,GAAoB,UAAUY,GAAmB;AAAA,IACnF,gBAAAO,EAAAK,GAAA,EAAW,QAAA5B,GAAgB,YAAYE,EAAiB,CAAA;AAAA,sBACxD2B,GAAc,EAAA;AAAA,EACjB,EAAA,CAAA;AAEJ;"}
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import { ToolBarPlugin as
|
|
1
|
+
import { ToolBarPlugin as e } from "./ToolbarPlugin/ToolbarPlugin.js";
|
|
2
2
|
import { BlockFormatPlugin as t } from "./BlockFormatPlugin/BlockFormatPlugin.js";
|
|
3
|
-
import {
|
|
4
|
-
import { LinkPlugin as
|
|
3
|
+
import { ListPlugin as n } from "./ListPlugin/ListPlugin.js";
|
|
4
|
+
import { LinkPlugin as x } from "./LinkPlugin/LinkPlugin.js";
|
|
5
5
|
import { HistoryPlugin as p } from "./HistoryPlugin/HistoryPlugin.js";
|
|
6
|
-
import { T as
|
|
6
|
+
import { T as g } from "../../../TablePlugin-1L5UZfDH.js";
|
|
7
|
+
import { TableCellContextMenu as a } from "./TablePlugin/TableCellContextMenu/TableCellContextMenu.js";
|
|
7
8
|
export {
|
|
8
9
|
t as BlockFormatPlugin,
|
|
9
10
|
p as HistoryPlugin,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
x as LinkPlugin,
|
|
12
|
+
n as ListPlugin,
|
|
13
|
+
a as TableCellContextMenu,
|
|
14
|
+
g as TablePlugin,
|
|
15
|
+
e as ToolBarPlugin
|
|
14
16
|
};
|
|
15
17
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
interface LanguageContextProps {
|
|
3
|
+
language: string;
|
|
4
|
+
switchLanguage: (language: string) => void;
|
|
5
|
+
}
|
|
6
|
+
export declare const LanguageProvider: ({ children }: {
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare const useLanguage: () => LanguageContextProps;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as g, useState as s, useContext as i } from "react";
|
|
3
|
+
const t = g(void 0), x = ({ children: e }) => {
|
|
4
|
+
const [n, o] = s("en"), a = (r) => {
|
|
5
|
+
o(r);
|
|
6
|
+
};
|
|
7
|
+
return /* @__PURE__ */ u(t.Provider, { value: { language: n, switchLanguage: a }, children: e });
|
|
8
|
+
}, d = () => {
|
|
9
|
+
const e = i(t);
|
|
10
|
+
if (!e)
|
|
11
|
+
throw new Error("useLanguage must be used within a LanguageProvider");
|
|
12
|
+
return e;
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
x as LanguageProvider,
|
|
16
|
+
d as useLanguage
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=LanguageProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LanguageProvider.js","sources":["../../../../src/components/RteEditor/Providers/LanguageProvider.tsx"],"sourcesContent":["import { createContext, useContext, useState } from 'react';\n\nimport type { ReactNode } from 'react';\n\ninterface LanguageContextProps {\n language: string;\n switchLanguage: (language: string) => void;\n}\n\nconst LanguageContext = createContext<LanguageContextProps | undefined>(undefined);\n\nexport const LanguageProvider = ({ children }: { children: ReactNode }) => {\n const [language, setLanguage] = useState<string>('en');\n\n const switchLanguage = (language: string) => {\n setLanguage(language);\n };\n\n return <LanguageContext.Provider value={{ language, switchLanguage }}>{children}</LanguageContext.Provider>;\n};\n\nexport const useLanguage = (): LanguageContextProps => {\n const context = useContext(LanguageContext);\n if (!context) {\n throw new Error('useLanguage must be used within a LanguageProvider');\n }\n return context;\n};\n"],"names":["LanguageContext","createContext","LanguageProvider","children","language","setLanguage","useState","switchLanguage","jsx","useLanguage","context","useContext"],"mappings":";;AASA,MAAMA,IAAkBC,EAAgD,MAAS,GAEpEC,IAAmB,CAAC,EAAE,UAAAC,QAAwC;AACzE,QAAM,CAACC,GAAUC,CAAW,IAAIC,EAAiB,IAAI,GAE/CC,IAAiB,CAACH,MAAqB;AAC3C,IAAAC,EAAYD,CAAQ;AAAA,EAAA;AAGf,SAAA,gBAAAI,EAACR,EAAgB,UAAhB,EAAyB,OAAO,EAAE,UAAAI,GAAU,gBAAAG,EAAe,GAAI,UAAAJ,EAAS,CAAA;AAClF,GAEaM,IAAc,MAA4B;AAC/C,QAAAC,IAAUC,EAAWX,CAAe;AAC1C,MAAI,CAACU;AACG,UAAA,IAAI,MAAM,oDAAoD;AAE/D,SAAAA;AACT;"}
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
export interface RteEditorProps {
|
|
2
2
|
namespace?: string;
|
|
3
|
+
currentLanguage?: 'NL' | 'EN';
|
|
3
4
|
initialValue?: string;
|
|
4
5
|
placeholder?: string;
|
|
6
|
+
label?: string;
|
|
7
|
+
info?: string;
|
|
8
|
+
required?: boolean;
|
|
9
|
+
maxWords?: number;
|
|
10
|
+
/** error text to display if set */
|
|
11
|
+
notValidatedText?: string;
|
|
5
12
|
onChange: (content: string) => void;
|
|
6
13
|
}
|
|
7
|
-
export declare const
|
|
14
|
+
export declare const Rte: ({ namespace, currentLanguage, initialValue, placeholder, label, info, required, notValidatedText, maxWords, onChange, }: RteEditorProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare const RteEditor: ({ namespace, currentLanguage, initialValue, placeholder, label, info, required, notValidatedText, maxWords, onChange, }: RteEditorProps) => import("react/jsx-runtime").JSX.Element;
|