@uva-glass/component-library 3.46.0 → 3.47.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/{TablePlugin-FTN9oxnI.js → TablePlugin-CfXPNfT8.js} +6 -5
- package/dist/{TablePlugin-FTN9oxnI.js.map → TablePlugin-CfXPNfT8.js.map} +1 -1
- package/dist/WeekSelector.module-BA7qqZsx.js +17 -0
- package/dist/WeekSelector.module-BA7qqZsx.js.map +1 -0
- package/dist/assets/CopyableText.css +1 -1
- package/dist/assets/ExpandableInfoPanel.css +1 -1
- package/dist/assets/WeekSelector.css +1 -0
- package/dist/components/CheckboxTree/CheckboxTree.js +4 -3
- package/dist/components/CheckboxTree/CheckboxTree.js.map +1 -1
- package/dist/components/CopyableText/CopyableText.js +13 -13
- package/dist/components/ExpandableInfoPanel/ExpandableInfoPanel.js +30 -30
- package/dist/components/FormInput/FormInput.js +4 -3
- package/dist/components/FormInput/FormInput.js.map +1 -1
- package/dist/components/InputField/InputField.stories.js +4 -3
- 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 +3 -2
- package/dist/components/MultiSelect/components/MultiSelectHeader.js.map +1 -1
- package/dist/components/MultiSelect/index.js +1 -1
- package/dist/components/PeriodSelector/PeriodSelector.js +4 -3
- package/dist/components/PeriodSelector/PeriodSelector.js.map +1 -1
- package/dist/components/ProgrammeCard/ProgrammeCard.stories.js +4 -3
- package/dist/components/ProgrammeCard/ProgrammeCard.stories.js.map +1 -1
- package/dist/components/RadioTabSelector/RadioTabSelector.js +8 -7
- package/dist/components/RadioTabSelector/RadioTabSelector.js.map +1 -1
- package/dist/components/RteEditor/EditorHeader/EditorHeader.js +6 -5
- package/dist/components/RteEditor/EditorHeader/EditorHeader.js.map +1 -1
- package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.js +4 -3
- package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.js.map +1 -1
- package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkForm/AddLinkFrom.js +3 -2
- package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkForm/AddLinkFrom.js.map +1 -1
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js +4 -3
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js.map +1 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/AddTableFrom.js +3 -2
- package/dist/components/RteEditor/Plugins/TablePlugin/AddTableFrom.js.map +1 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.js +3 -2
- package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.js.map +1 -1
- 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 +4 -3
- package/dist/components/RteEditor/RteEditor.js.map +1 -1
- package/dist/components/WeekSelector/WeekSelector.d.ts +26 -0
- package/dist/components/WeekSelector/WeekSelector.js +62 -0
- package/dist/components/WeekSelector/WeekSelector.js.map +1 -0
- package/dist/components/WeekSelector/WeekSelector.stories.d.ts +5 -0
- package/dist/components/WeekSelector/WeekSelector.stories.js +68 -0
- package/dist/components/WeekSelector/WeekSelector.stories.js.map +1 -0
- package/dist/components/WeekSelector/components/WeekSelectorButton.d.ts +5 -0
- package/dist/components/WeekSelector/components/WeekSelectorButton.js +22 -0
- package/dist/components/WeekSelector/components/WeekSelectorButton.js.map +1 -0
- package/dist/components/WeekSelector/components/WeekSelectorOption.d.ts +11 -0
- package/dist/components/WeekSelector/components/WeekSelectorOption.js +31 -0
- package/dist/components/WeekSelector/components/WeekSelectorOption.js.map +1 -0
- package/dist/components/WeekSelector/components/WeekSelectorOptionContainer.d.ts +8 -0
- package/dist/components/WeekSelector/components/WeekSelectorOptionContainer.js +28 -0
- package/dist/components/WeekSelector/components/WeekSelectorOptionContainer.js.map +1 -0
- package/dist/components/WeekSelector/index.d.ts +1 -0
- package/dist/components/WeekSelector/index.js +5 -0
- package/dist/components/WeekSelector/index.js.map +1 -0
- package/dist/components/WeekSelector/mockdata.d.ts +2 -0
- package/dist/components/WeekSelector/mockdata.js +470 -0
- package/dist/components/WeekSelector/mockdata.js.map +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +31 -29
- package/dist/components/index.js.map +1 -1
- package/dist/index.js +31 -29
- package/dist/index.js.map +1 -1
- package/package.json +11 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputField.stories.js","sources":["../../../src/components/InputField/InputField.stories.tsx"],"sourcesContent":["import { useRef, useState } from 'react';\nimport { fn } from 'storybook/test';\n\nimport type { ChangeEvent } from 'react';\nimport type { Meta, StoryFn } from '@storybook/react';\nimport type { InputFieldProps } from './InputField';\n\nimport { InputField } from './InputField';\n\nimport { Container } from 'storyComponents/Container';\nimport { Icon } from 'components';\n\nconst codeString = `\n// Has all HTMLInputElement props available except \"className\" and \"style\" \n<InputField aria-labelledby={aria-labelledby} id={id} onChange={onChangeFunction}\n value={value} type={type} clearTrigger={clearTrigger} />\n`;\n\nconst transformArgs = (args: InputFieldProps) => {\n // args.variant is provided as an array because the control type is set to a checkbox. So this transforms the selected value into its proper value: a string\n const variantArray = (args.variant as unknown as string[]) ?? [];\n return { ...args, ...{ variant: variantArray.toString() } } as InputFieldProps;\n};\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Atoms/InputField',\n component: InputField,\n argTypes: {\n variant: {\n options: ['large'],\n control: 'check',\n },\n width: {\n control: 'radio',\n options: [undefined, 'small', 'compact'],\n },\n type: {\n control: 'radio',\n options: ['text', 'password', 'email'],\n },\n background: {\n control: 'check',\n options: ['white'],\n },\n id: {\n control: 'text',\n },\n autoComplete: {\n table: {\n disable: true,\n },\n },\n },\n parameters: {\n inspectComponent: InputField,\n codeString: codeString,\n },\n} as Meta<InputFieldProps>;\n\nconst Template: StoryFn<InputFieldProps> = (args) => {\n const [inputValue, setInputValue] = useState<InputFieldProps['value']>('');\n const inputRef = useRef<HTMLInputElement>(null);\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n setInputValue(event.target.value);\n fn()('handleChange');\n };\n\n const handleClear = () => {\n setInputValue('');\n fn()('handleClear');\n };\n\n return (\n <Container>\n <InputField\n {...transformArgs(args)}\n value={inputValue}\n onChange={handleChange}\n onClear={handleClear}\n ref={inputRef}\n />\n </Container>\n );\n};\n\nconst defaultArgs: Partial<InputFieldProps> = {\n type: 'text',\n variant: undefined,\n id: '4f9ca77d',\n};\n\nexport const InputFieldExample = Template.bind({});\nInputFieldExample.args = {\n ...defaultArgs,\n};\n\nexport const WithStringClearTrigger = Template.bind({});\nWithStringClearTrigger.args = {\n ...defaultArgs,\n clearTrigger: 'Clear',\n};\n\nexport const WithIconClearTrigger = Template.bind({});\nWithIconClearTrigger.args = {\n ...defaultArgs,\n clearTrigger: <Icon name=\"Cross\" />,\n};\n"],"names":["codeString","transformArgs","args","variantArray","InputField_stories","InputField","Template","inputValue","setInputValue","useState","inputRef","useRef","handleChange","event","fn","handleClear","Container","jsx","defaultArgs","InputFieldExample","WithStringClearTrigger","WithIconClearTrigger","Icon"],"mappings":"
|
|
1
|
+
{"version":3,"file":"InputField.stories.js","sources":["../../../src/components/InputField/InputField.stories.tsx"],"sourcesContent":["import { useRef, useState } from 'react';\nimport { fn } from 'storybook/test';\n\nimport type { ChangeEvent } from 'react';\nimport type { Meta, StoryFn } from '@storybook/react';\nimport type { InputFieldProps } from './InputField';\n\nimport { InputField } from './InputField';\n\nimport { Container } from 'storyComponents/Container';\nimport { Icon } from 'components';\n\nconst codeString = `\n// Has all HTMLInputElement props available except \"className\" and \"style\" \n<InputField aria-labelledby={aria-labelledby} id={id} onChange={onChangeFunction}\n value={value} type={type} clearTrigger={clearTrigger} />\n`;\n\nconst transformArgs = (args: InputFieldProps) => {\n // args.variant is provided as an array because the control type is set to a checkbox. So this transforms the selected value into its proper value: a string\n const variantArray = (args.variant as unknown as string[]) ?? [];\n return { ...args, ...{ variant: variantArray.toString() } } as InputFieldProps;\n};\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Atoms/InputField',\n component: InputField,\n argTypes: {\n variant: {\n options: ['large'],\n control: 'check',\n },\n width: {\n control: 'radio',\n options: [undefined, 'small', 'compact'],\n },\n type: {\n control: 'radio',\n options: ['text', 'password', 'email'],\n },\n background: {\n control: 'check',\n options: ['white'],\n },\n id: {\n control: 'text',\n },\n autoComplete: {\n table: {\n disable: true,\n },\n },\n },\n parameters: {\n inspectComponent: InputField,\n codeString: codeString,\n },\n} as Meta<InputFieldProps>;\n\nconst Template: StoryFn<InputFieldProps> = (args) => {\n const [inputValue, setInputValue] = useState<InputFieldProps['value']>('');\n const inputRef = useRef<HTMLInputElement>(null);\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n setInputValue(event.target.value);\n fn()('handleChange');\n };\n\n const handleClear = () => {\n setInputValue('');\n fn()('handleClear');\n };\n\n return (\n <Container>\n <InputField\n {...transformArgs(args)}\n value={inputValue}\n onChange={handleChange}\n onClear={handleClear}\n ref={inputRef}\n />\n </Container>\n );\n};\n\nconst defaultArgs: Partial<InputFieldProps> = {\n type: 'text',\n variant: undefined,\n id: '4f9ca77d',\n};\n\nexport const InputFieldExample = Template.bind({});\nInputFieldExample.args = {\n ...defaultArgs,\n};\n\nexport const WithStringClearTrigger = Template.bind({});\nWithStringClearTrigger.args = {\n ...defaultArgs,\n clearTrigger: 'Clear',\n};\n\nexport const WithIconClearTrigger = Template.bind({});\nWithIconClearTrigger.args = {\n ...defaultArgs,\n clearTrigger: <Icon name=\"Cross\" />,\n};\n"],"names":["codeString","transformArgs","args","variantArray","InputField_stories","InputField","Template","inputValue","setInputValue","useState","inputRef","useRef","handleChange","event","fn","handleClear","Container","jsx","defaultArgs","InputFieldExample","WithStringClearTrigger","WithIconClearTrigger","Icon"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,MAAMA,IAAa;AAAA;AAAA;AAAA;AAAA,GAMbC,IAAgB,CAACC,MAA0B;AAE/C,QAAMC,IAAgBD,EAAK,WAAmC,CAAA;AAC9D,SAAO,EAAE,GAAGA,GAAW,SAASC,EAAa,SAAA,EAAW;AAC1D,GAGAC,IAAe;AAAA,EACb,OAAO;AAAA,EACP,WAAWC;AAAA,EACX,UAAU;AAAA,IACR,SAAS;AAAA,MACP,SAAS,CAAC,OAAO;AAAA,MACjB,SAAS;AAAA,IAAA;AAAA,IAEX,OAAO;AAAA,MACL,SAAS;AAAA,MACT,SAAS,CAAC,QAAW,SAAS,SAAS;AAAA,IAAA;AAAA,IAEzC,MAAM;AAAA,MACJ,SAAS;AAAA,MACT,SAAS,CAAC,QAAQ,YAAY,OAAO;AAAA,IAAA;AAAA,IAEvC,YAAY;AAAA,MACV,SAAS;AAAA,MACT,SAAS,CAAC,OAAO;AAAA,IAAA;AAAA,IAEnB,IAAI;AAAA,MACF,SAAS;AAAA,IAAA;AAAA,IAEX,cAAc;AAAA,MACZ,OAAO;AAAA,QACL,SAAS;AAAA,MAAA;AAAA,IACX;AAAA,EACF;AAAA,EAEF,YAAY;AAAA,IACV,kBAAkBA;AAAA,IAClB,YAAAL;AAAA,EAAA;AAEJ,GAEMM,IAAqC,CAACJ,MAAS;AACnD,QAAM,CAACK,GAAYC,CAAa,IAAIC,EAAmC,EAAE,GACnEC,IAAWC,EAAyB,IAAI,GAExCC,IAAe,CAACC,MAAyC;AAC7D,IAAAL,EAAcK,EAAM,OAAO,KAAK,GAChCC,EAAA,EAAK,cAAc;AAAA,EACrB,GAEMC,IAAc,MAAM;AACxB,IAAAP,EAAc,EAAE,GAChBM,EAAA,EAAK,aAAa;AAAA,EACpB;AAEA,2BACGE,GAAA,EACC,UAAA,gBAAAC;AAAA,IAACZ;AAAA,IAAA;AAAA,MACE,GAAGJ,EAAcC,CAAI;AAAA,MACtB,OAAOK;AAAA,MACP,UAAUK;AAAA,MACV,SAASG;AAAA,MACT,KAAKL;AAAA,IAAA;AAAA,EAAA,GAET;AAEJ,GAEMQ,IAAwC;AAAA,EAC5C,MAAM;AAAA,EACN,SAAS;AAAA,EACT,IAAI;AACN,GAEaC,IAAoBb,EAAS,KAAK,CAAA,CAAE;AACjDa,EAAkB,OAAO;AAAA,EACvB,GAAGD;AACL;AAEO,MAAME,IAAyBd,EAAS,KAAK,CAAA,CAAE;AACtDc,EAAuB,OAAO;AAAA,EAC5B,GAAGF;AAAA,EACH,cAAc;AAChB;AAEO,MAAMG,IAAuBf,EAAS,KAAK,CAAA,CAAE;AACpDe,EAAqB,OAAO;AAAA,EAC1B,GAAGH;AAAA,EACH,cAAc,gBAAAD,EAACK,GAAA,EAAK,MAAK,QAAA,CAAQ;AACnC;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as S, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { l as d } from "../../index-DvUwfXNb.js";
|
|
3
3
|
import { useState as p } from "react";
|
|
4
|
-
import { M as e } from "../../TablePlugin-
|
|
4
|
+
import { M as e } from "../../TablePlugin-CfXPNfT8.js";
|
|
5
5
|
import { Container as M } from "../../storyComponents/Container/Container.js";
|
|
6
6
|
const C = `
|
|
7
7
|
// MultiSelectHeader can be added optionally
|
|
@@ -16,7 +16,7 @@ import "../../IconButton/IconButton.js";
|
|
|
16
16
|
import "../../Input/Input.js";
|
|
17
17
|
import "../../InputField/InputField.js";
|
|
18
18
|
import "react-router";
|
|
19
|
-
import { a as
|
|
19
|
+
import { a as C } from "../../../TablePlugin-CfXPNfT8.js";
|
|
20
20
|
import "../../RteEditor/Providers/LanguageProvider.js";
|
|
21
21
|
import "../../RteEditor/Plugins/LinkPlugin/LinkContextMenu/LinkContextMenu.js";
|
|
22
22
|
import "../../RteEditor/hooks/components/Flyout.js";
|
|
@@ -27,7 +27,8 @@ import "../../SelectListbox/SelectListbox.js";
|
|
|
27
27
|
import "../../SelectListbox/SelectProvider.js";
|
|
28
28
|
import "../../Sortable/components/SortableItem.js";
|
|
29
29
|
import "../../../SortableProvider-l8-7ClBJ.js";
|
|
30
|
+
import "../../WeekSelector/components/WeekSelectorOptionContainer.js";
|
|
30
31
|
export {
|
|
31
|
-
|
|
32
|
+
C as MultiSelectHeader
|
|
32
33
|
};
|
|
33
34
|
//# sourceMappingURL=MultiSelectHeader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultiSelectHeader.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MultiSelectHeader.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -18,7 +18,7 @@ import "../Input/Input.js";
|
|
|
18
18
|
import "../InputField/InputField.js";
|
|
19
19
|
import { Label as I } from "../Label/Label.js";
|
|
20
20
|
import "react-router";
|
|
21
|
-
import "../../TablePlugin-
|
|
21
|
+
import "../../TablePlugin-CfXPNfT8.js";
|
|
22
22
|
import "../RteEditor/Providers/LanguageProvider.js";
|
|
23
23
|
import "../RteEditor/Plugins/LinkPlugin/LinkContextMenu/LinkContextMenu.js";
|
|
24
24
|
import "../RteEditor/hooks/components/Flyout.js";
|
|
@@ -29,6 +29,7 @@ import "../SelectListbox/SelectListbox.js";
|
|
|
29
29
|
import "../SelectListbox/SelectProvider.js";
|
|
30
30
|
import "../Sortable/components/SortableItem.js";
|
|
31
31
|
import "../../SortableProvider-l8-7ClBJ.js";
|
|
32
|
+
import "../WeekSelector/components/WeekSelectorOptionContainer.js";
|
|
32
33
|
import '../../assets/PeriodSelector.css';const l = {
|
|
33
34
|
"period-selector__container": "_period-selector__container_1txwd_1",
|
|
34
35
|
"period-selector__container--label-left": "_period-selector__container--label-left_1txwd_6",
|
|
@@ -40,7 +41,7 @@ import '../../assets/PeriodSelector.css';const l = {
|
|
|
40
41
|
for (let o = 0; o < c.length; o += E)
|
|
41
42
|
n.push(c.slice(o, o + E));
|
|
42
43
|
return n;
|
|
43
|
-
},
|
|
44
|
+
}, ar = ({
|
|
44
45
|
maxPeriods: c = j,
|
|
45
46
|
defaultValues: n,
|
|
46
47
|
label: o,
|
|
@@ -90,6 +91,6 @@ import '../../assets/PeriodSelector.css';const l = {
|
|
|
90
91
|
);
|
|
91
92
|
};
|
|
92
93
|
export {
|
|
93
|
-
|
|
94
|
+
ar as PeriodSelector
|
|
94
95
|
};
|
|
95
96
|
//# sourceMappingURL=PeriodSelector.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PeriodSelector.js","sources":["../../../src/components/PeriodSelector/PeriodSelector.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useEffect, useRef, useState } from 'react';\n\nimport styles from './PeriodSelector.module.css';\n\nimport { Label, CheckboxButtonBar, FeedbackBox } from 'components';\n\nexport interface PeriodSelectorProps {\n /** Indicates how many periods are shown. */\n // eslint-disable-next-line @typescript-eslint/no-magic-numbers\n maxPeriods: 6 | 7;\n /** array of period values [3, 5 ...] */\n defaultValues?: number[];\n label?: string;\n labelPosition?: 'top' | 'left';\n /** Shows red * */\n required?: boolean;\n /** error text to display if set */\n notValidatedText?: string;\n /** Returns array of selected values as number */\n onChange: (values: number[]) => void;\n}\n\nconst SEMESTER_1 = 0;\nconst SEMESTER_2 = 1;\nconst SEMESTER_3 = 2;\n\nconst PERIODS_PER_SEMESTER = 3;\nconst MAX_PERIODS = 7;\n\nconst chunkPeriods = (array: number[]): number[][] => {\n const result: number[][] = [];\n for (let count = 0; count < array.length; count += PERIODS_PER_SEMESTER) {\n result.push(array.slice(count, count + PERIODS_PER_SEMESTER));\n }\n return result;\n};\n\n/** Checkbox group for selecting periods */\nexport const PeriodSelector = ({\n maxPeriods = MAX_PERIODS,\n defaultValues,\n label,\n labelPosition = 'top',\n required = false,\n notValidatedText = '',\n onChange,\n}: PeriodSelectorProps) => {\n const maxPeriodsList = Array.from({ length: maxPeriods }, (_, index) => index + 1);\n const chunkedPeriods = chunkPeriods(maxPeriodsList);\n\n const checkboxItems = chunkedPeriods.map((periods, _) => {\n return periods.map((period) => ({\n label: period.toString(),\n value: period.toString(),\n }));\n });\n\n const returnValues = useRef<number[][]>(\n chunkedPeriods.map((semester) =>\n semester.reduce((periods, period) => {\n if (defaultValues?.includes(period)) periods.push(period);\n return periods;\n }, [] as number[])\n )\n );\n const [disableSemesters, setDisableSemesters] = useState<number[]>([]);\n\n const disableGroups = (selects: number[][]) => {\n if (selects[SEMESTER_1].length !== 0 || selects[SEMESTER_2].length !== 0) return [SEMESTER_3];\n if (selects[SEMESTER_3].length !== 0) return [SEMESTER_1, SEMESTER_2];\n return [];\n };\n\n const handleChange = (values: string[], index: number) => {\n returnValues.current[index] = values.map((num) => Number(num));\n setDisableSemesters(disableGroups(returnValues.current));\n onChange([...returnValues.current.flat()].sort());\n };\n\n useEffect(() => {\n setDisableSemesters(disableGroups(returnValues.current));\n }, []);\n\n return (\n <div\n className={clsx(\n styles['period-selector__container'],\n styles[`period-selector__container--label-${labelPosition}`]\n )}\n >\n {label && (\n <Label htmlFor=\"\" required={required}>\n {label}\n </Label>\n )}\n <div className={styles['period-selector__selector-container']}>\n <div className={styles['period-selector__selector-row']}>\n {checkboxItems.map((checkboxes, semester) => (\n <CheckboxButtonBar\n key={`group_${semester}`}\n checkboxes={checkboxes}\n defaultValues={returnValues.current[semester].map((num) => num.toString())}\n disableGroup={disableSemesters.includes(semester)}\n required={required}\n onSetValues={(event) => handleChange(event, semester)}\n notValidated={notValidatedText !== ''}\n />\n ))}\n </div>\n {notValidatedText !== '' && <FeedbackBox level=\"error\" feedback={notValidatedText} />}\n </div>\n </div>\n );\n};\n"],"names":["SEMESTER_1","SEMESTER_2","SEMESTER_3","PERIODS_PER_SEMESTER","MAX_PERIODS","chunkPeriods","array","result","count","PeriodSelector","maxPeriods","defaultValues","label","labelPosition","required","notValidatedText","onChange","maxPeriodsList","_","index","chunkedPeriods","checkboxItems","periods","period","returnValues","useRef","semester","disableSemesters","setDisableSemesters","useState","disableGroups","selects","handleChange","values","num","useEffect","jsxs","clsx","styles","jsx","Label","checkboxes","CheckboxButtonBar","event","FeedbackBox"],"mappings":"
|
|
1
|
+
{"version":3,"file":"PeriodSelector.js","sources":["../../../src/components/PeriodSelector/PeriodSelector.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useEffect, useRef, useState } from 'react';\n\nimport styles from './PeriodSelector.module.css';\n\nimport { Label, CheckboxButtonBar, FeedbackBox } from 'components';\n\nexport interface PeriodSelectorProps {\n /** Indicates how many periods are shown. */\n // eslint-disable-next-line @typescript-eslint/no-magic-numbers\n maxPeriods: 6 | 7;\n /** array of period values [3, 5 ...] */\n defaultValues?: number[];\n label?: string;\n labelPosition?: 'top' | 'left';\n /** Shows red * */\n required?: boolean;\n /** error text to display if set */\n notValidatedText?: string;\n /** Returns array of selected values as number */\n onChange: (values: number[]) => void;\n}\n\nconst SEMESTER_1 = 0;\nconst SEMESTER_2 = 1;\nconst SEMESTER_3 = 2;\n\nconst PERIODS_PER_SEMESTER = 3;\nconst MAX_PERIODS = 7;\n\nconst chunkPeriods = (array: number[]): number[][] => {\n const result: number[][] = [];\n for (let count = 0; count < array.length; count += PERIODS_PER_SEMESTER) {\n result.push(array.slice(count, count + PERIODS_PER_SEMESTER));\n }\n return result;\n};\n\n/** Checkbox group for selecting periods */\nexport const PeriodSelector = ({\n maxPeriods = MAX_PERIODS,\n defaultValues,\n label,\n labelPosition = 'top',\n required = false,\n notValidatedText = '',\n onChange,\n}: PeriodSelectorProps) => {\n const maxPeriodsList = Array.from({ length: maxPeriods }, (_, index) => index + 1);\n const chunkedPeriods = chunkPeriods(maxPeriodsList);\n\n const checkboxItems = chunkedPeriods.map((periods, _) => {\n return periods.map((period) => ({\n label: period.toString(),\n value: period.toString(),\n }));\n });\n\n const returnValues = useRef<number[][]>(\n chunkedPeriods.map((semester) =>\n semester.reduce((periods, period) => {\n if (defaultValues?.includes(period)) periods.push(period);\n return periods;\n }, [] as number[])\n )\n );\n const [disableSemesters, setDisableSemesters] = useState<number[]>([]);\n\n const disableGroups = (selects: number[][]) => {\n if (selects[SEMESTER_1].length !== 0 || selects[SEMESTER_2].length !== 0) return [SEMESTER_3];\n if (selects[SEMESTER_3].length !== 0) return [SEMESTER_1, SEMESTER_2];\n return [];\n };\n\n const handleChange = (values: string[], index: number) => {\n returnValues.current[index] = values.map((num) => Number(num));\n setDisableSemesters(disableGroups(returnValues.current));\n onChange([...returnValues.current.flat()].sort());\n };\n\n useEffect(() => {\n setDisableSemesters(disableGroups(returnValues.current));\n }, []);\n\n return (\n <div\n className={clsx(\n styles['period-selector__container'],\n styles[`period-selector__container--label-${labelPosition}`]\n )}\n >\n {label && (\n <Label htmlFor=\"\" required={required}>\n {label}\n </Label>\n )}\n <div className={styles['period-selector__selector-container']}>\n <div className={styles['period-selector__selector-row']}>\n {checkboxItems.map((checkboxes, semester) => (\n <CheckboxButtonBar\n key={`group_${semester}`}\n checkboxes={checkboxes}\n defaultValues={returnValues.current[semester].map((num) => num.toString())}\n disableGroup={disableSemesters.includes(semester)}\n required={required}\n onSetValues={(event) => handleChange(event, semester)}\n notValidated={notValidatedText !== ''}\n />\n ))}\n </div>\n {notValidatedText !== '' && <FeedbackBox level=\"error\" feedback={notValidatedText} />}\n </div>\n </div>\n );\n};\n"],"names":["SEMESTER_1","SEMESTER_2","SEMESTER_3","PERIODS_PER_SEMESTER","MAX_PERIODS","chunkPeriods","array","result","count","PeriodSelector","maxPeriods","defaultValues","label","labelPosition","required","notValidatedText","onChange","maxPeriodsList","_","index","chunkedPeriods","checkboxItems","periods","period","returnValues","useRef","semester","disableSemesters","setDisableSemesters","useState","disableGroups","selects","handleChange","values","num","useEffect","jsxs","clsx","styles","jsx","Label","checkboxes","CheckboxButtonBar","event","FeedbackB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@@ -18,7 +18,7 @@ import "../GridRow/GridRow.js";
|
|
|
18
18
|
import "../IconButton/IconButton.js";
|
|
19
19
|
import "../Input/Input.js";
|
|
20
20
|
import "../InputField/InputField.js";
|
|
21
|
-
import "../../TablePlugin-
|
|
21
|
+
import "../../TablePlugin-CfXPNfT8.js";
|
|
22
22
|
import "../RteEditor/Providers/LanguageProvider.js";
|
|
23
23
|
import "../RteEditor/Plugins/LinkPlugin/LinkContextMenu/LinkContextMenu.js";
|
|
24
24
|
import "../RteEditor/hooks/components/Flyout.js";
|
|
@@ -29,7 +29,8 @@ import "../SelectListbox/SelectListbox.js";
|
|
|
29
29
|
import "../SelectListbox/SelectProvider.js";
|
|
30
30
|
import "../Sortable/components/SortableItem.js";
|
|
31
31
|
import "../../SortableProvider-l8-7ClBJ.js";
|
|
32
|
-
|
|
32
|
+
import "../WeekSelector/components/WeekSelectorOptionContainer.js";
|
|
33
|
+
const n = "<ProgrammeCard key={key} header={header} details={details} href={href} />", O = {
|
|
33
34
|
title: "Atoms/ProgrammeCard",
|
|
34
35
|
component: o,
|
|
35
36
|
parameters: {
|
|
@@ -78,6 +79,6 @@ export {
|
|
|
78
79
|
c as MultiProgrammeCards,
|
|
79
80
|
l as ProgrammeCardExample,
|
|
80
81
|
d as WithComplexContent,
|
|
81
|
-
|
|
82
|
+
O as default
|
|
82
83
|
};
|
|
83
84
|
//# sourceMappingURL=ProgrammeCard.stories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgrammeCard.stories.js","sources":["../../../src/components/ProgrammeCard/ProgrammeCard.stories.tsx"],"sourcesContent":["import { BrowserRouter } from 'react-router';\n\nimport type { Meta, StoryFn } from '@storybook/react';\nimport type { ProgrammeCardProps } from './ProgrammeCard';\n\nimport { ProgrammeCard } from './ProgrammeCard';\n\nimport { Container } from 'storyComponents/Container';\nimport { Icon, Repeater } from 'components';\n\nconst codeString = '<ProgrammeCard key={key} header={header} details={details} href={href} />';\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Atoms/ProgrammeCard',\n component: ProgrammeCard,\n parameters: {\n inspectComponent: ProgrammeCard,\n codeString: codeString,\n },\n} as Meta<ProgrammeCardProps>;\n\nconst Template: StoryFn<ProgrammeCardProps> = (args) => (\n <BrowserRouter>\n <Container size=\"large\">\n <ProgrammeCard {...args} />\n </Container>\n </BrowserRouter>\n);\n\nexport const ProgrammeCardExample = Template.bind({});\nProgrammeCardExample.args = {\n header: 'This is my header',\n details: 'This is my details',\n href: '/',\n};\n\nexport const WithComplexContent = Template.bind({});\nWithComplexContent.args = {\n header: (\n <Repeater flexDirection=\"row\" gap=\"150\">\n <Icon name=\"Envelope\" size={32} />\n <h2 style={{ margin: 0 }}>This is my header</h2>\n </Repeater>\n ),\n details: (\n <Repeater flexDirection=\"row\" gap=\"150\">\n <Repeater flexDirection=\"row\">\n <Icon name=\"FaceFrown\" />\n Details 1\n </Repeater>\n <Repeater flexDirection=\"row\">\n <Icon name=\"Heart\" />\n Details 2\n </Repeater>\n <Repeater flexDirection=\"row\">\n <Icon name=\"Sparkles\" />\n Details 3\n </Repeater>\n </Repeater>\n ),\n href: '/',\n};\n\nconst MultiProgrammeCardsTemplate: StoryFn<ProgrammeCardProps> = (args) => (\n <BrowserRouter>\n <Container size=\"large\">\n <Repeater>\n <ProgrammeCard {...args} />\n <ProgrammeCard {...args} />\n <ProgrammeCard {...args} />\n </Repeater>\n </Container>\n </BrowserRouter>\n);\n\nexport const MultiProgrammeCards = MultiProgrammeCardsTemplate.bind({});\nMultiProgrammeCards.args = {\n header: 'This is my header',\n details: 'This is my details',\n href: '/',\n};\n"],"names":["codeString","ProgrammeCard_stories","ProgrammeCard","Template","args","jsx","BrowserRouter","Container","ProgrammeCardExample","WithComplexContent","jsxs","Repeater","Icon","MultiProgrammeCardsTemplate","MultiProgrammeCards"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ProgrammeCard.stories.js","sources":["../../../src/components/ProgrammeCard/ProgrammeCard.stories.tsx"],"sourcesContent":["import { BrowserRouter } from 'react-router';\n\nimport type { Meta, StoryFn } from '@storybook/react';\nimport type { ProgrammeCardProps } from './ProgrammeCard';\n\nimport { ProgrammeCard } from './ProgrammeCard';\n\nimport { Container } from 'storyComponents/Container';\nimport { Icon, Repeater } from 'components';\n\nconst codeString = '<ProgrammeCard key={key} header={header} details={details} href={href} />';\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Atoms/ProgrammeCard',\n component: ProgrammeCard,\n parameters: {\n inspectComponent: ProgrammeCard,\n codeString: codeString,\n },\n} as Meta<ProgrammeCardProps>;\n\nconst Template: StoryFn<ProgrammeCardProps> = (args) => (\n <BrowserRouter>\n <Container size=\"large\">\n <ProgrammeCard {...args} />\n </Container>\n </BrowserRouter>\n);\n\nexport const ProgrammeCardExample = Template.bind({});\nProgrammeCardExample.args = {\n header: 'This is my header',\n details: 'This is my details',\n href: '/',\n};\n\nexport const WithComplexContent = Template.bind({});\nWithComplexContent.args = {\n header: (\n <Repeater flexDirection=\"row\" gap=\"150\">\n <Icon name=\"Envelope\" size={32} />\n <h2 style={{ margin: 0 }}>This is my header</h2>\n </Repeater>\n ),\n details: (\n <Repeater flexDirection=\"row\" gap=\"150\">\n <Repeater flexDirection=\"row\">\n <Icon name=\"FaceFrown\" />\n Details 1\n </Repeater>\n <Repeater flexDirection=\"row\">\n <Icon name=\"Heart\" />\n Details 2\n </Repeater>\n <Repeater flexDirection=\"row\">\n <Icon name=\"Sparkles\" />\n Details 3\n </Repeater>\n </Repeater>\n ),\n href: '/',\n};\n\nconst MultiProgrammeCardsTemplate: StoryFn<ProgrammeCardProps> = (args) => (\n <BrowserRouter>\n <Container size=\"large\">\n <Repeater>\n <ProgrammeCard {...args} />\n <ProgrammeCard {...args} />\n <ProgrammeCard {...args} />\n </Repeater>\n </Container>\n </BrowserRouter>\n);\n\nexport const MultiProgrammeCards = MultiProgrammeCardsTemplate.bind({});\nMultiProgrammeCards.args = {\n header: 'This is my header',\n details: 'This is my details',\n href: '/',\n};\n"],"names":["codeString","ProgrammeCard_stories","ProgrammeCard","Template","args","jsx","BrowserRouter","Container","ProgrammeCardExample","WithComplexContent","jsxs","Repeater","Icon","MultiProgrammeCardsTemplate","MultiProgrammeCards"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,MAAMA,IAAa,6EAGnBC,IAAe;AAAA,EACb,OAAO;AAAA,EACP,WAAWC;AAAA,EACX,YAAY;AAAA,IACV,kBAAkBA;AAAA,IAClB,YAAAF;AAAA,EAAA;AAEJ,GAEMG,IAAwC,CAACC,MAC7C,gBAAAC,EAACC,KACC,UAAA,gBAAAD,EAACE,GAAA,EAAU,MAAK,SACd,UAAA,gBAAAF,EAACH,GAAA,EAAe,GAAGE,EAAA,CAAM,GAC3B,GACF,GAGWI,IAAuBL,EAAS,KAAK,CAAA,CAAE;AACpDK,EAAqB,OAAO;AAAA,EAC1B,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,MAAM;AACR;AAEO,MAAMC,IAAqBN,EAAS,KAAK,CAAA,CAAE;AAClDM,EAAmB,OAAO;AAAA,EACxB,QACE,gBAAAC,EAACC,GAAA,EAAS,eAAc,OAAM,KAAI,OAChC,UAAA;AAAA,IAAA,gBAAAN,EAACO,GAAA,EAAK,MAAK,YAAW,MAAM,IAAI;AAAA,sBAC/B,MAAA,EAAG,OAAO,EAAE,QAAQ,EAAA,GAAK,UAAA,oBAAA,CAAiB;AAAA,EAAA,GAC7C;AAAA,EAEF,SACE,gBAAAF,EAACC,GAAA,EAAS,eAAc,OAAM,KAAI,OAChC,UAAA;AAAA,IAAA,gBAAAD,EAACC,GAAA,EAAS,eAAc,OACtB,UAAA;AAAA,MAAA,gBAAAN,EAACO,GAAA,EAAK,MAAK,YAAA,CAAY;AAAA,MAAE;AAAA,IAAA,GAE3B;AAAA,IACA,gBAAAF,EAACC,GAAA,EAAS,eAAc,OACtB,UAAA;AAAA,MAAA,gBAAAN,EAACO,GAAA,EAAK,MAAK,QAAA,CAAQ;AAAA,MAAE;AAAA,IAAA,GAEvB;AAAA,IACA,gBAAAF,EAACC,GAAA,EAAS,eAAc,OACtB,UAAA;AAAA,MAAA,gBAAAN,EAACO,GAAA,EAAK,MAAK,WAAA,CAAW;AAAA,MAAE;AAAA,IAAA,EAAA,CAE1B;AAAA,EAAA,GACF;AAAA,EAEF,MAAM;AACR;AAEA,MAAMC,IAA2D,CAACT,MAChE,gBAAAC,EAACC,GAAA,EACC,4BAACC,GAAA,EAAU,MAAK,SACd,UAAA,gBAAAG,EAACC,GAAA,EACC,UAAA;AAAA,EAAA,gBAAAN,EAACH,GAAA,EAAe,GAAGE,GAAM;AAAA,EACzB,gBAAAC,EAACH,GAAA,EAAe,GAAGE,GAAM;AAAA,EACzB,gBAAAC,EAACH,GAAA,EAAe,GAAGE,EAAA,CAAM;AAAA,EAAA,CAC3B,GACF,GACF,GAGWU,IAAsBD,EAA4B,KAAK,CAAA,CAAE;AACtEC,EAAoB,OAAO;AAAA,EACzB,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,MAAM;AACR;"}
|
|
@@ -18,7 +18,7 @@ import "../IconButton/IconButton.js";
|
|
|
18
18
|
import "../Input/Input.js";
|
|
19
19
|
import "../InputField/InputField.js";
|
|
20
20
|
import "react-router";
|
|
21
|
-
import "../../TablePlugin-
|
|
21
|
+
import "../../TablePlugin-CfXPNfT8.js";
|
|
22
22
|
import "../RteEditor/Providers/LanguageProvider.js";
|
|
23
23
|
import "../RteEditor/Plugins/LinkPlugin/LinkContextMenu/LinkContextMenu.js";
|
|
24
24
|
import "../RteEditor/hooks/components/Flyout.js";
|
|
@@ -29,6 +29,7 @@ import "../SelectListbox/SelectListbox.js";
|
|
|
29
29
|
import "../SelectListbox/SelectProvider.js";
|
|
30
30
|
import "../Sortable/components/SortableItem.js";
|
|
31
31
|
import "../../SortableProvider-l8-7ClBJ.js";
|
|
32
|
+
import "../WeekSelector/components/WeekSelectorOptionContainer.js";
|
|
32
33
|
import '../../assets/RadioTabSelector.css';const t = {
|
|
33
34
|
"radio-tab-selector-button-bar__container": "_radio-tab-selector-button-bar__container_a4wnc_1",
|
|
34
35
|
"radio-tab-selector-button-bar__container--label-left": "_radio-tab-selector-button-bar__container--label-left_a4wnc_6",
|
|
@@ -36,18 +37,18 @@ import '../../assets/RadioTabSelector.css';const t = {
|
|
|
36
37
|
"radio-tab-selector-button-bar__row-container": "_radio-tab-selector-button-bar__row-container_a4wnc_18",
|
|
37
38
|
"radio-tab-selector-button-bar__row": "_radio-tab-selector-button-bar__row_a4wnc_18",
|
|
38
39
|
"radio-tab-selector-button-bar__row--not-validated": "_radio-tab-selector-button-bar__row--not-validated_a4wnc_35"
|
|
39
|
-
},
|
|
40
|
+
}, rt = ({
|
|
40
41
|
buttons: l,
|
|
41
42
|
radioGroupName: c,
|
|
42
43
|
defaultValue: _,
|
|
43
44
|
label: i,
|
|
44
45
|
labelPosition: m = "top",
|
|
45
|
-
required:
|
|
46
|
+
required: p = !1,
|
|
46
47
|
notValidatedText: a = "",
|
|
47
|
-
onSetValue:
|
|
48
|
+
onSetValue: s
|
|
48
49
|
}) => {
|
|
49
50
|
const [d, u] = v(_ || null), w = (r) => {
|
|
50
|
-
u(r.target.value),
|
|
51
|
+
u(r.target.value), s(r.target.value);
|
|
51
52
|
};
|
|
52
53
|
return /* @__PURE__ */ n(
|
|
53
54
|
"div",
|
|
@@ -57,7 +58,7 @@ import '../../assets/RadioTabSelector.css';const t = {
|
|
|
57
58
|
t[`radio-tab-selector-button-bar__container--label-${m}`]
|
|
58
59
|
),
|
|
59
60
|
children: [
|
|
60
|
-
i && /* @__PURE__ */ o(g, { htmlFor: "", required:
|
|
61
|
+
i && /* @__PURE__ */ o(g, { htmlFor: "", required: p, children: i }),
|
|
61
62
|
/* @__PURE__ */ n("div", { className: t["radio-tab-selector-button-bar__row-container"], children: [
|
|
62
63
|
/* @__PURE__ */ o(
|
|
63
64
|
"div",
|
|
@@ -88,6 +89,6 @@ import '../../assets/RadioTabSelector.css';const t = {
|
|
|
88
89
|
);
|
|
89
90
|
};
|
|
90
91
|
export {
|
|
91
|
-
|
|
92
|
+
rt as RadioTabSelector
|
|
92
93
|
};
|
|
93
94
|
//# sourceMappingURL=RadioTabSelector.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioTabSelector.js","sources":["../../../src/components/RadioTabSelector/RadioTabSelector.tsx"],"sourcesContent":["import { clsx } from 'clsx';\r\nimport { useState } from 'react';\r\n\r\nimport type { ChangeEvent } from 'react';\r\nimport type { IconProps } from 'components';\r\n\r\nimport styles from './RadioTabSelector.module.css';\r\n\r\nimport { ControlsButton, FeedbackBox, Label } from 'components';\r\n\r\ntype ButtonProps = {\r\n label: string;\r\n value: string;\r\n iconName?: IconProps['name'];\r\n disabled?: boolean;\r\n};\r\n\r\nexport interface RadioTabSelectorProps {\r\n /** array with button objects with label, value and optional iconName or disabled-state */\r\n buttons: ButtonProps[];\r\n /** name of the radiogroup */\r\n radioGroupName: string;\r\n /** innitial value */\r\n defaultValue?: string;\r\n /** label takst */\r\n label?: string;\r\n /** 'top' | 'left' */\r\n labelPosition?: 'top' | 'left';\r\n /** show red star */\r\n required?: boolean;\r\n /** error text to display if set */\r\n notValidatedText?: string;\r\n /** The callback function that is invoked when the radio tab selector changes value. */\r\n onSetValue: (value: string | null) => void;\r\n}\r\n\r\nexport const RadioTabSelector = ({\r\n buttons,\r\n radioGroupName,\r\n defaultValue,\r\n label,\r\n labelPosition = 'top',\r\n required = false,\r\n notValidatedText = '',\r\n onSetValue,\r\n}: RadioTabSelectorProps) => {\r\n const [currentValue, setCurrentValue] = useState<string | null>(defaultValue || null);\r\n\r\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\r\n setCurrentValue(event.target.value);\r\n onSetValue(event.target.value);\r\n };\r\n\r\n return (\r\n <div\r\n className={clsx(\r\n styles['radio-tab-selector-button-bar__container'],\r\n styles[`radio-tab-selector-button-bar__container--label-${labelPosition}`]\r\n )}\r\n >\r\n {label && (\r\n <Label htmlFor=\"\" required={required}>\r\n {label}\r\n </Label>\r\n )}\r\n <div className={styles['radio-tab-selector-button-bar__row-container']}>\r\n <div\r\n className={clsx(styles['radio-tab-selector-button-bar__row'], {\r\n [styles['radio-tab-selector-button-bar__row--not-validated']]: notValidatedText,\r\n })}\r\n >\r\n {buttons.map(({ label, value, iconName, disabled }) => (\r\n <ControlsButton\r\n type=\"radio\"\r\n name={radioGroupName}\r\n key={`${value}`}\r\n label={label}\r\n value={value}\r\n iconName={iconName}\r\n checked={currentValue === value}\r\n disabled={disabled}\r\n onSetValue={handleChange}\r\n />\r\n ))}\r\n </div>\r\n {notValidatedText !== '' && <FeedbackBox level=\"error\" feedback={notValidatedText} />}\r\n </div>\r\n </div>\r\n );\r\n};\r\n"],"names":["RadioTabSelector","buttons","radioGroupName","defaultValue","label","labelPosition","required","notValidatedText","onSetValue","currentValue","setCurrentValue","useState","handleChange","event","jsxs","clsx","styles","jsx","Label","value","iconName","disabled","ControlsButton","FeedbackBox"],"mappings":"
|
|
1
|
+
{"version":3,"file":"RadioTabSelector.js","sources":["../../../src/components/RadioTabSelector/RadioTabSelector.tsx"],"sourcesContent":["import { clsx } from 'clsx';\r\nimport { useState } from 'react';\r\n\r\nimport type { ChangeEvent } from 'react';\r\nimport type { IconProps } from 'components';\r\n\r\nimport styles from './RadioTabSelector.module.css';\r\n\r\nimport { ControlsButton, FeedbackBox, Label } from 'components';\r\n\r\ntype ButtonProps = {\r\n label: string;\r\n value: string;\r\n iconName?: IconProps['name'];\r\n disabled?: boolean;\r\n};\r\n\r\nexport interface RadioTabSelectorProps {\r\n /** array with button objects with label, value and optional iconName or disabled-state */\r\n buttons: ButtonProps[];\r\n /** name of the radiogroup */\r\n radioGroupName: string;\r\n /** innitial value */\r\n defaultValue?: string;\r\n /** label takst */\r\n label?: string;\r\n /** 'top' | 'left' */\r\n labelPosition?: 'top' | 'left';\r\n /** show red star */\r\n required?: boolean;\r\n /** error text to display if set */\r\n notValidatedText?: string;\r\n /** The callback function that is invoked when the radio tab selector changes value. */\r\n onSetValue: (value: string | null) => void;\r\n}\r\n\r\nexport const RadioTabSelector = ({\r\n buttons,\r\n radioGroupName,\r\n defaultValue,\r\n label,\r\n labelPosition = 'top',\r\n required = false,\r\n notValidatedText = '',\r\n onSetValue,\r\n}: RadioTabSelectorProps) => {\r\n const [currentValue, setCurrentValue] = useState<string | null>(defaultValue || null);\r\n\r\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\r\n setCurrentValue(event.target.value);\r\n onSetValue(event.target.value);\r\n };\r\n\r\n return (\r\n <div\r\n className={clsx(\r\n styles['radio-tab-selector-button-bar__container'],\r\n styles[`radio-tab-selector-button-bar__container--label-${labelPosition}`]\r\n )}\r\n >\r\n {label && (\r\n <Label htmlFor=\"\" required={required}>\r\n {label}\r\n </Label>\r\n )}\r\n <div className={styles['radio-tab-selector-button-bar__row-container']}>\r\n <div\r\n className={clsx(styles['radio-tab-selector-button-bar__row'], {\r\n [styles['radio-tab-selector-button-bar__row--not-validated']]: notValidatedText,\r\n })}\r\n >\r\n {buttons.map(({ label, value, iconName, disabled }) => (\r\n <ControlsButton\r\n type=\"radio\"\r\n name={radioGroupName}\r\n key={`${value}`}\r\n label={label}\r\n value={value}\r\n iconName={iconName}\r\n checked={currentValue === value}\r\n disabled={disabled}\r\n onSetValue={handleChange}\r\n />\r\n ))}\r\n </div>\r\n {notValidatedText !== '' && <FeedbackBox level=\"error\" feedback={notValidatedText} />}\r\n </div>\r\n </div>\r\n );\r\n};\r\n"],"names":["RadioTabSelector","buttons","radioGroupName","defaultValue","label","labelPosition","required","notValidatedText","onSetValue","currentValue","setCurrentValue","useState","handleChange","event","jsxs","clsx","styles","jsx","Label","value","iconName","disabled","ControlsButton","FeedbackBox"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCaA,KAAmB,CAAC;AAAA,EAC/B,SAAAC;AAAA,EACA,gBAAAC;AAAA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Q,UAAUhB,EAAA,CAAkB;AAAA,QAAA,EAAA,CACrF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -15,7 +15,7 @@ import "../../IconButton/IconButton.js";
|
|
|
15
15
|
import "../../Input/Input.js";
|
|
16
16
|
import "../../InputField/InputField.js";
|
|
17
17
|
import "react-router";
|
|
18
|
-
import "../../../TablePlugin-
|
|
18
|
+
import "../../../TablePlugin-CfXPNfT8.js";
|
|
19
19
|
import "../Providers/LanguageProvider.js";
|
|
20
20
|
import "../Plugins/LinkPlugin/LinkContextMenu/LinkContextMenu.js";
|
|
21
21
|
import "../hooks/components/Flyout.js";
|
|
@@ -26,17 +26,18 @@ import "../../SelectListbox/SelectListbox.js";
|
|
|
26
26
|
import "../../SelectListbox/SelectProvider.js";
|
|
27
27
|
import "../../Sortable/components/SortableItem.js";
|
|
28
28
|
import "../../../SortableProvider-l8-7ClBJ.js";
|
|
29
|
+
import "../../WeekSelector/components/WeekSelectorOptionContainer.js";
|
|
29
30
|
import '../../../assets/EditorHeader.css';const t = {
|
|
30
31
|
"editor-header__container": "_editor-header__container_9khdz_1",
|
|
31
32
|
"editor-header__info": "_editor-header__info_9khdz_10"
|
|
32
|
-
},
|
|
33
|
-
const
|
|
33
|
+
}, G = ({ label: o, info: i = "", required: m = !1 }) => {
|
|
34
|
+
const e = `info_${d()}`;
|
|
34
35
|
return /* @__PURE__ */ p("div", { className: t["editor-header__container"], children: [
|
|
35
|
-
o !== "" && /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(_, { htmlFor:
|
|
36
|
+
o !== "" && /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(_, { htmlFor: e, required: m, children: o }) }),
|
|
36
37
|
i !== "" && /* @__PURE__ */ r("div", { className: t["editor-header__info"], children: i })
|
|
37
38
|
] });
|
|
38
39
|
};
|
|
39
40
|
export {
|
|
40
|
-
|
|
41
|
+
G as EditorHeader
|
|
41
42
|
};
|
|
42
43
|
//# sourceMappingURL=EditorHeader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditorHeader.js","sources":["../../../../src/components/RteEditor/EditorHeader/EditorHeader.tsx"],"sourcesContent":["import { useId } from 'react';\n\nimport styles from './EditorHeader.module.css';\n\nimport { Label } from 'components';\n\ninterface EditorHeaderProps {\n label: string;\n info?: string;\n required?: boolean;\n}\n\nexport const EditorHeader = ({ label, info = '', required = false }: EditorHeaderProps) => {\n const infoId = `info_${useId()}`;\n\n return (\n <div className={styles['editor-header__container']}>\n {label !== '' && (\n <div>\n <Label htmlFor={infoId} required={required}>\n {label}\n </Label>\n </div>\n )}\n {info !== '' && <div className={styles['editor-header__info']}>{info}</div>}\n </div>\n );\n};\n"],"names":["EditorHeader","label","info","required","infoId","useId","jsxs","styles","jsx","Label"],"mappings":"
|
|
1
|
+
{"version":3,"file":"EditorHeader.js","sources":["../../../../src/components/RteEditor/EditorHeader/EditorHeader.tsx"],"sourcesContent":["import { useId } from 'react';\n\nimport styles from './EditorHeader.module.css';\n\nimport { Label } from 'components';\n\ninterface EditorHeaderProps {\n label: string;\n info?: string;\n required?: boolean;\n}\n\nexport const EditorHeader = ({ label, info = '', required = false }: EditorHeaderProps) => {\n const infoId = `info_${useId()}`;\n\n return (\n <div className={styles['editor-header__container']}>\n {label !== '' && (\n <div>\n <Label htmlFor={infoId} required={required}>\n {label}\n </Label>\n </div>\n )}\n {info !== '' && <div className={styles['editor-header__info']}>{info}</div>}\n </div>\n );\n};\n"],"names":["EditorHeader","label","info","required","infoId","useId","jsxs","styles","jsx","Label"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAYaA,IAAe,CAAC,EAAE,OAAAC,GAAO,MAAAC,IAAO,IAAI,UAAAC,IAAW,SAA+B;AACzF,QAAMC,IAAS,QAAQC,EAAA,CAAO;AAE9B,SACE,gBAAAC,EAAC,OAAA,EAAI,WAAWC,EAAO,0BAA0B,GAC9C,UAAA;AAAA,IAAAN,MAAU,wBACR,OAAA,EACC,UAAA,gBAAAO,EAACC,KAAM,SAASL,GAAQ,UAAAD,GACrB,UAAAF,EAAA,CACH,EAAA,CACF;AAAA,IAEDC,MAAS,MAAM,gBAAAM,EAAC,OAAA,EAAI,WAAWD,EAAO,qBAAqB,GAAI,UAAAL,EAAA,CAAK;AAAA,EAAA,GACvE;AAEJ;"}
|
|
@@ -18,7 +18,7 @@ import "../../../IconButton/IconButton.js";
|
|
|
18
18
|
import "../../../Input/Input.js";
|
|
19
19
|
import "../../../InputField/InputField.js";
|
|
20
20
|
import "react-router";
|
|
21
|
-
import "../../../../TablePlugin-
|
|
21
|
+
import "../../../../TablePlugin-CfXPNfT8.js";
|
|
22
22
|
import { s as r } from "../../../../RteEditor.module-CovRFt0S.js";
|
|
23
23
|
import { useTranslation as x } from "../../hooks/useTranslation.js";
|
|
24
24
|
import "../LinkPlugin/LinkContextMenu/LinkContextMenu.js";
|
|
@@ -31,7 +31,8 @@ import "../../../SelectListbox/SelectListbox.js";
|
|
|
31
31
|
import "../../../SelectListbox/SelectProvider.js";
|
|
32
32
|
import "../../../Sortable/components/SortableItem.js";
|
|
33
33
|
import "../../../../SortableProvider-l8-7ClBJ.js";
|
|
34
|
-
|
|
34
|
+
import "../../../WeekSelector/components/WeekSelectorOptionContainer.js";
|
|
35
|
+
const ro = () => {
|
|
35
36
|
const o = x(), [t] = h(), [p, d] = m(!1), [l, c] = m(!1), u = () => {
|
|
36
37
|
t.dispatchCommand(y, void 0);
|
|
37
38
|
}, b = () => {
|
|
@@ -75,6 +76,6 @@ const to = () => {
|
|
|
75
76
|
] });
|
|
76
77
|
};
|
|
77
78
|
export {
|
|
78
|
-
|
|
79
|
+
ro as HistoryPlugin
|
|
79
80
|
};
|
|
80
81
|
//# sourceMappingURL=HistoryPlugin.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HistoryPlugin.js","sources":["../../../../../src/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';\nimport { CAN_UNDO_COMMAND, CAN_REDO_COMMAND, UNDO_COMMAND, REDO_COMMAND } from 'lexical';\nimport { useEffect, useState } from 'react';\n\nimport { Icon } from 'components';\nimport styles from 'components/RteEditor/RteEditor.module.css';\nimport { useTranslation } from 'components/RteEditor/hooks/useTranslation';\n\nexport const HistoryPlugin = () => {\n const t = useTranslation();\n const [editor] = useLexicalComposerContext();\n const [canUndo, setCanUndo] = useState(false);\n const [canRedo, setCanRedo] = useState(false);\n\n const handleUndo = () => {\n editor.dispatchCommand(UNDO_COMMAND, undefined);\n };\n\n const handleRedo = () => {\n editor.dispatchCommand(REDO_COMMAND, undefined);\n };\n\n useEffect(() => {\n return editor.registerCommand<boolean>(\n CAN_UNDO_COMMAND,\n (payload) => {\n setCanUndo(payload);\n return false;\n },\n 1\n );\n }, [editor]);\n\n useEffect(() => {\n return editor.registerCommand<boolean>(\n CAN_REDO_COMMAND,\n (payload) => {\n setCanRedo(payload);\n return false;\n },\n 1\n );\n }, [editor]);\n\n return (\n <div className={styles['editor__toolbar-button-group']}>\n <button\n onClick={handleUndo}\n className={clsx(styles['editor__toolbar-button'], styles[`editor__toolbar-button--undo`])}\n aria-label={t.aria.labels.undo}\n aria-keyshortcuts={t.aria.keyshortcuts.undo}\n disabled={!canUndo}\n title={t.format.undoTooltip}\n type=\"button\"\n >\n <Icon name=\"StepBack\" size={24} />\n </button>\n <button\n onClick={handleRedo}\n className={clsx(styles['editor__toolbar-button'], styles[`editor__toolbar-button--redo`])}\n aria-label={t.aria.labels.redo}\n aria-keyshortcuts={t.aria.keyshortcuts.redo}\n disabled={!canRedo}\n title={t.format.redoTooltip}\n type=\"button\"\n >\n <Icon name=\"StepForwards\" size={24} />\n </button>\n </div>\n );\n};\n"],"names":["HistoryPlugin","t","useTranslation","editor","useLexicalComposerContext","canUndo","setCanUndo","useState","canRedo","setCanRedo","handleUndo","UNDO_COMMAND","handleRedo","REDO_COMMAND","useEffect","CAN_UNDO_COMMAND","payload","CAN_REDO_COMMAND","jsxs","styles","jsx","clsx","Icon"],"mappings":"
|
|
1
|
+
{"version":3,"file":"HistoryPlugin.js","sources":["../../../../../src/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';\nimport { CAN_UNDO_COMMAND, CAN_REDO_COMMAND, UNDO_COMMAND, REDO_COMMAND } from 'lexical';\nimport { useEffect, useState } from 'react';\n\nimport { Icon } from 'components';\nimport styles from 'components/RteEditor/RteEditor.module.css';\nimport { useTranslation } from 'components/RteEditor/hooks/useTranslation';\n\nexport const HistoryPlugin = () => {\n const t = useTranslation();\n const [editor] = useLexicalComposerContext();\n const [canUndo, setCanUndo] = useState(false);\n const [canRedo, setCanRedo] = useState(false);\n\n const handleUndo = () => {\n editor.dispatchCommand(UNDO_COMMAND, undefined);\n };\n\n const handleRedo = () => {\n editor.dispatchCommand(REDO_COMMAND, undefined);\n };\n\n useEffect(() => {\n return editor.registerCommand<boolean>(\n CAN_UNDO_COMMAND,\n (payload) => {\n setCanUndo(payload);\n return false;\n },\n 1\n );\n }, [editor]);\n\n useEffect(() => {\n return editor.registerCommand<boolean>(\n CAN_REDO_COMMAND,\n (payload) => {\n setCanRedo(payload);\n return false;\n },\n 1\n );\n }, [editor]);\n\n return (\n <div className={styles['editor__toolbar-button-group']}>\n <button\n onClick={handleUndo}\n className={clsx(styles['editor__toolbar-button'], styles[`editor__toolbar-button--undo`])}\n aria-label={t.aria.labels.undo}\n aria-keyshortcuts={t.aria.keyshortcuts.undo}\n disabled={!canUndo}\n title={t.format.undoTooltip}\n type=\"button\"\n >\n <Icon name=\"StepBack\" size={24} />\n </button>\n <button\n onClick={handleRedo}\n className={clsx(styles['editor__toolbar-button'], styles[`editor__toolbar-button--redo`])}\n aria-label={t.aria.labels.redo}\n aria-keyshortcuts={t.aria.keyshortcuts.redo}\n disabled={!canRedo}\n title={t.format.redoTooltip}\n type=\"button\"\n >\n <Icon name=\"StepForwards\" size={24} />\n </button>\n </div>\n );\n};\n"],"names":["HistoryPlugin","t","useTranslation","editor","useLexicalComposerContext","canUndo","setCanUndo","useState","canRedo","setCanRedo","handleUndo","UNDO_COMMAND","handleRedo","REDO_COMMAND","useEffect","CAN_UNDO_COMMAND","payload","CAN_REDO_COMMAND","jsxs","styles","jsx","clsx","Icon"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASO,MAAMA,KAAgB,MAAM;AACjC,QAAMC,IAAIC,EAAA,GACJ,CAACC,CAAM,IAAIC,EAAA,GACX,CAACC,GAASC,CAAU,IAAIC,EAAS,EAAK,GACtC,CAACC,GAASC,CAAU,IAAIF,EAAS,EAAK,GAEtCG,IAAa,MAAM;AACvB,IAAAP,EAAO,gBAAgBQ,GAAc,MAAS;AAAA,EAChD,GAEMC,IAAa,MAAM;AACvB,IAAAT,EAAO,gBAAgBU,GAAc,MAAS;AAAA,EAChD;AAEA,SAAAC,EAAU,MACDX,EAAO;AAAA,IACZY;AAAAA,IACA,CAACC,OACCV,EAAWU,CAAO,GACX;AAAA,IAET;AAAA,EAAA,GAED,CAACb,CAAM,CAAC,GAEXW,EAAU,MACDX,EAAO;AAAA,IACZc;AAAAA,IACA,CAACD,OACCP,EAAWO,CAAO,GACX;AAAA,IAET;AAAA,EAAA,GAED,CAACb,CAAM,CAAC,GAGT,gBAAAe,EAAC,OAAA,EAAI,WAAWC,EAAO,8BAA8B,GACnD,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,SAASV;AAAA,QACT,WAAWW,EAAKF,EAAO,wBAAwB,GAAGA,EAAO,8BAA8B,CAAC;AAAA,QACxF,cAAYlB,EAAE,KAAK,OAAO;AAAA,QAC1B,qBAAmBA,EAAE,KAAK,aAAa;AAAA,QACvC,UAAU,CAACI;AAAA,QACX,OAAOJ,EAAE,OAAO;AAAA,QAChB,MAAK;AAAA,QAEL,UAAA,gBAAAmB,EAACE,GAAA,EAAK,MAAK,YAAW,MAAM,GAAA,CAAI;AAAA,MAAA;AAAA,IAAA;AAAA,IAElC,gBAAAF;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,SAASR;AAAA,QACT,WAAWS,EAAKF,EAAO,wBAAwB,GAAGA,EAAO,8BAA8B,CAAC;AAAA,QACxF,cAAYlB,EAAE,KAAK,OAAO;AAAA,QAC1B,qBAAmBA,EAAE,KAAK,aAAa;AAAA,QACvC,UAAU,CAACO;AAAA,QACX,OAAOP,EAAE,OAAO;AAAA,QAChB,MAAK;AAAA,QAEL,UAAA,gBAAAmB,EAACE,GAAA,EAAK,MAAK,gBAAe,MAAM,GAAA,CAAI;AAAA,MAAA;AAAA,IAAA;AAAA,EACtC,GACF;AAEJ;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { A as
|
|
3
|
+
import { A as I } from "../../../../../TablePlugin-CfXPNfT8.js";
|
|
4
4
|
import "../../../../../helpers-mE437H2Y.js";
|
|
5
5
|
import "../../../../Accordion/Accordion.js";
|
|
6
6
|
import "../../../../Icon/Icon.js";
|
|
@@ -31,7 +31,8 @@ import "../../../../SelectListbox/SelectListbox.js";
|
|
|
31
31
|
import "../../../../SelectListbox/SelectProvider.js";
|
|
32
32
|
import "../../../../Sortable/components/SortableItem.js";
|
|
33
33
|
import "../../../../../SortableProvider-l8-7ClBJ.js";
|
|
34
|
+
import "../../../../WeekSelector/components/WeekSelectorOptionContainer.js";
|
|
34
35
|
export {
|
|
35
|
-
|
|
36
|
+
I as AddLinkForm
|
|
36
37
|
};
|
|
37
38
|
//# sourceMappingURL=AddLinkFrom.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddLinkFrom.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AddLinkFrom.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -4,7 +4,7 @@ import { c as Y } from "../../../../clsx-OuTLNxxd.js";
|
|
|
4
4
|
import { p as O, k as q, v as G } from "../../../../LexicalLink.prod-Brzpgs_K.js";
|
|
5
5
|
import { useRef as a, useState as J, useEffect as m } from "react";
|
|
6
6
|
import { a2 as X, w as p, u as Z, as as $, a as w, I as tt, k as et, Q as ot } from "../../../../Lexical.prod-nXWuyOKD.js";
|
|
7
|
-
import { A as rt } from "../../../../TablePlugin-
|
|
7
|
+
import { A as rt } from "../../../../TablePlugin-CfXPNfT8.js";
|
|
8
8
|
import { e as nt } from "../../../../helpers-mE437H2Y.js";
|
|
9
9
|
import { LinkContextMenu as it } from "./LinkContextMenu/LinkContextMenu.js";
|
|
10
10
|
import { useFlyout as st } from "../../hooks/useFlyout.js";
|
|
@@ -34,6 +34,7 @@ import "../../../SelectListbox/SelectListbox.js";
|
|
|
34
34
|
import "../../../SelectListbox/SelectProvider.js";
|
|
35
35
|
import "../../../Sortable/components/SortableItem.js";
|
|
36
36
|
import "../../../../SortableProvider-l8-7ClBJ.js";
|
|
37
|
+
import "../../../WeekSelector/components/WeekSelectorOptionContainer.js";
|
|
37
38
|
const ut = 200, B = (f) => {
|
|
38
39
|
let n = f;
|
|
39
40
|
for (; n; ) {
|
|
@@ -54,7 +55,7 @@ const ut = 200, B = (f) => {
|
|
|
54
55
|
n = n.getParent();
|
|
55
56
|
}
|
|
56
57
|
return !1;
|
|
57
|
-
},
|
|
58
|
+
}, qt = ({ parentScrollPosition: f }) => {
|
|
58
59
|
const n = at(), [c] = W(), { flyout: U, showFlyout: _, hideFlyout: C, isVisible: u } = st(), d = a(void 0), N = a(!1), v = a(""), g = a(""), [y, A] = J({ active: !1, url: "", linktext: "" }), P = a(u), x = a(null), S = a(null), T = a(void 0), L = () => {
|
|
59
60
|
c.update(() => {
|
|
60
61
|
const o = p();
|
|
@@ -227,7 +228,7 @@ const ut = 200, B = (f) => {
|
|
|
227
228
|
] }) });
|
|
228
229
|
};
|
|
229
230
|
export {
|
|
230
|
-
|
|
231
|
+
qt as LinkPlugin,
|
|
231
232
|
z as getLinkNodeTag
|
|
232
233
|
};
|
|
233
234
|
//# sourceMappingURL=LinkPlugin.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LinkPlugin.js","sources":["../../../../../src/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.tsx"],"sourcesContent":["import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';\nimport { clsx } from 'clsx';\nimport { $isLinkNode, $toggleLink, TOGGLE_LINK_COMMAND } from '@lexical/link';\nimport { useEffect, useRef, useState } from 'react';\nimport {\n $createTextNode,\n $getSelection,\n $isRangeSelection,\n $setSelection,\n CLICK_COMMAND,\n COMMAND_PRIORITY_EDITOR,\n KEY_DOWN_COMMAND,\n SELECTION_CHANGE_COMMAND,\n} from 'lexical';\n\nimport type { LinkNode } from '@lexical/link';\nimport type { ElementNode, TextNode, BaseSelection } from 'lexical';\nimport type { addLinkFormMethods } from './AddLinkForm/AddLinkFrom';\nimport type { linkFormMethods } from './LinkContextMenu/LinkContextMenu';\n\nimport { AddLinkForm } from './AddLinkForm/AddLinkFrom';\nimport { ensureHttps } from './helpers';\nimport { LinkContextMenu } from './LinkContextMenu/LinkContextMenu';\n\nimport { useFlyout } from 'components/RteEditor/hooks/useFlyout';\nimport { Icon } from 'components';\nimport styles from 'components/RteEditor/RteEditor.module.css';\nimport { useTranslation } from 'components/RteEditor/hooks/useTranslation';\nimport { removeScrollableContainers, setScrollableContainers } from 'components/RteEditor/helpers';\n\nconst PREVENT_OPEN_DELAY = 200;\n\nexport interface LinkType {\n active: boolean;\n url: string;\n linktext: string;\n}\n\ntype Position = {\n top: number;\n left: number;\n};\n\ninterface LinkPluginProps {\n parentScrollPosition: number;\n}\n\nconst getLinkNode = (node: ElementNode | null): ElementNode | null => {\n let currentNode: TextNode | ElementNode | null = node;\n\n while (currentNode) {\n if ($isLinkNode(currentNode)) {\n return currentNode;\n }\n currentNode = currentNode.getParent();\n }\n\n return null;\n};\n\nexport const getLinkNodeTag = (anchorNode: ElementNode | TextNode): boolean | LinkType => {\n let currentNode: TextNode | ElementNode | null = anchorNode;\n\n while (currentNode) {\n if ($isLinkNode(currentNode)) {\n return {\n active: true,\n url: currentNode.getURL(),\n linktext: currentNode.getTextContent(),\n };\n }\n currentNode = currentNode.getParent();\n }\n\n return false;\n};\n\nexport const LinkPlugin = ({ parentScrollPosition }: LinkPluginProps) => {\n const t = useTranslation();\n const [editor] = useLexicalComposerContext();\n const { flyout, showFlyout, hideFlyout, isVisible } = useFlyout();\n const addLinkForm = useRef<addLinkFormMethods>(undefined);\n const preventOpen = useRef(false);\n const previousLinkText = useRef('');\n const selectedText = useRef('');\n const [isLink, setIsLink] = useState<LinkType>({ active: false, url: '', linktext: '' });\n const isVisibleRef = useRef(isVisible);\n const storedSelection = useRef<BaseSelection | null>(null);\n const linkButtonRef = useRef<HTMLButtonElement>(null);\n const editLinkForm = useRef<linkFormMethods>(undefined);\n\n const storeCursorPosition = () => {\n editor.update(() => {\n const selection = $getSelection();\n storedSelection.current = selection;\n });\n };\n\n const rePositionCursor = () => {\n editor.update(() => {\n if (storedSelection.current) {\n $setSelection(storedSelection.current);\n }\n });\n };\n\n const openContextMenu = (url: string, position: Position) => {\n showFlyout({\n position,\n children: (\n <LinkContextMenu\n url={url}\n onSave={(url) => insertLink(url, '')}\n onDelete={() => removeLink()}\n onClose={closeContextMenu}\n ref={editLinkForm}\n />\n ),\n });\n };\n\n const closeContextMenu = () => {\n editLinkForm.current?.clearForm();\n hideFlyout();\n rePositionCursor();\n };\n\n const openFlyout = () => {\n const rect = linkButtonRef.current?.getBoundingClientRect();\n if (!preventOpen.current && rect) {\n storeCursorPosition();\n showFlyout({ position: { top: rect.bottom, left: rect.left }, ...flyoutOptions });\n setTimeout(() => addLinkForm.current?.setDefaults('', selectedText.current), 0);\n }\n };\n\n const closeFlyout = () => {\n hideFlyout();\n rePositionCursor();\n };\n\n const insertLink = (url: string, linktext: string) => {\n editor.update(() => {\n const selection = $getSelection();\n\n if ($isRangeSelection(selection)) {\n const anchor = selection.anchor;\n const node = anchor.getNode() as ElementNode;\n const linkNode = getLinkNode(node);\n if (linktext && linktext !== '') {\n if (linkNode) {\n const newTextNode = $createTextNode(linktext);\n linkNode.replace(newTextNode);\n newTextNode.select();\n }\n if (linktext !== previousLinkText.current && previousLinkText.current === '') {\n const { anchor, focus } = selection;\n selection.insertText(linktext);\n anchor.offset -= linktext.length;\n focus.offset = anchor.offset + linktext.length;\n }\n }\n $toggleLink(ensureHttps(url), { target: '_blank' });\n }\n\n closeFlyout();\n });\n };\n\n const removeLink = (): void => {\n editor.dispatchCommand(TOGGLE_LINK_COMMAND, null);\n closeContextMenu();\n };\n\n const flyoutOptions = {\n children: (\n <AddLinkForm\n isLink={isLink}\n onCloseHandler={closeFlyout}\n onSaveHandler={(url, linktext) => insertLink(url, linktext)}\n ref={addLinkForm}\n />\n ),\n };\n\n useEffect(() => {\n if (!isVisible) {\n addLinkForm.current?.clearForm();\n previousLinkText.current = selectedText.current = '';\n setTimeout(() => (preventOpen.current = false), PREVENT_OPEN_DELAY);\n } else {\n preventOpen.current = true;\n addLinkForm.current?.focusFirstField();\n }\n }, [addLinkForm, isVisible]);\n\n useEffect(() => {\n const handleSelectionClickOrChange = (selection: BaseSelection | null) => {\n if ($isRangeSelection(selection) && selection.isCollapsed()) {\n const node = getLinkNodeTag(selection.anchor.getNode()) as LinkType;\n\n if (node) {\n const domNode = editor.getElementByKey(selection.anchor.getNode().getKey());\n const position = domNode\n ? { top: domNode.getBoundingClientRect().bottom, left: domNode.getBoundingClientRect().left }\n : { top: 0, left: 0 };\n openContextMenu(node.url, position);\n return true;\n }\n }\n return false;\n };\n\n const unregisterSelect = editor.registerCommand(\n SELECTION_CHANGE_COMMAND,\n () => {\n const selection = $getSelection();\n selectedText.current = selection?.getTextContent() ?? '';\n handleSelectionClickOrChange(selection);\n return false;\n },\n 0\n );\n\n const unregisterClick = editor.registerCommand(\n CLICK_COMMAND,\n (event) => {\n const selection = $getSelection();\n storeCursorPosition();\n event.preventDefault();\n event.stopPropagation();\n event.stopImmediatePropagation();\n handleSelectionClickOrChange(selection);\n return false;\n },\n 0\n );\n\n return () => {\n unregisterClick();\n unregisterSelect();\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [editor]);\n\n useEffect(() => {\n const removeKeyboardShortcut = editor.registerCommand(\n KEY_DOWN_COMMAND,\n (event: KeyboardEvent) => {\n if (event.ctrlKey && event.shiftKey && event.key === 'U') {\n const selection = $getSelection();\n storeCursorPosition();\n\n if (!$isRangeSelection(selection)) {\n return false;\n }\n\n const node = getLinkNodeTag(selection.anchor.getNode()) as LinkType;\n\n const openFlyoutWithDefaults = (url = '', linkText = '') => {\n openFlyout();\n setTimeout(() => addLinkForm.current?.setDefaults(url, linkText), 0);\n };\n\n if (node) {\n event.preventDefault();\n event.stopPropagation();\n event.stopImmediatePropagation();\n\n previousLinkText.current = node.linktext;\n openFlyoutWithDefaults(node.url, node.linktext);\n\n return true;\n }\n\n const selectedTextContent = selection.getTextContent();\n if (selectedTextContent !== '') {\n selectedText.current = selectedTextContent;\n openFlyoutWithDefaults('', selectedText.current);\n\n return true;\n }\n\n openFlyout();\n return true;\n }\n\n return false;\n },\n COMMAND_PRIORITY_EDITOR\n );\n\n const removeStatusListener = editor.registerUpdateListener(({ editorState }) => {\n setIsLink(\n editorState.read(() => {\n const selection = $getSelection();\n storeCursorPosition();\n\n if ($isRangeSelection(selection)) {\n const anchorNode = selection.anchor.getNode() as ElementNode;\n const linkNode = getLinkNode(anchorNode) as LinkNode;\n\n if (linkNode) {\n return {\n active: true,\n url: linkNode.getURL(),\n linktext: linkNode.getTextContent(),\n };\n }\n }\n\n return {\n active: false,\n url: '',\n linktext: '',\n };\n })\n );\n });\n\n return () => {\n removeKeyboardShortcut();\n removeStatusListener();\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [editor]);\n\n useEffect(() => {\n isVisibleRef.current = isVisible;\n if (!isVisible) editLinkForm.current?.clearForm();\n }, [isVisible]);\n\n useEffect(() => {\n if (isVisible) {\n closeFlyout();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [parentScrollPosition]);\n\n useEffect(() => {\n if (!isLink.active) {\n hideFlyout();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isLink]);\n\n useEffect(() => {\n const removeKeydown = (event: KeyboardEvent): boolean => {\n setScrollableContainers(handleResizeScroll);\n\n if (event.key === 'Escape' && isVisibleRef.current) {\n event.preventDefault();\n event.stopPropagation();\n closeFlyout();\n }\n return true;\n };\n\n window.addEventListener('keydown', removeKeydown, { capture: true });\n\n const handleResizeScroll = () => {\n hideFlyout();\n };\n\n setScrollableContainers(handleResizeScroll);\n\n window.addEventListener('scroll', handleResizeScroll);\n window.addEventListener('resize', handleResizeScroll);\n\n return () => {\n window.removeEventListener('keydown', removeKeydown);\n window.removeEventListener('scroll', handleResizeScroll);\n window.removeEventListener('resize', handleResizeScroll);\n removeScrollableContainers(handleResizeScroll);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return (\n <div className={styles['editor__toolbar-button-group']}>\n <div className={styles['editor__toolbar-button-flyoutwrapper']}>\n <button\n onClick={openFlyout}\n title={t.links.linkTooltip}\n className={clsx(\n styles['editor__toolbar-button'],\n styles[`editor__toolbar-button--link`],\n isLink.active && styles['editor__toolbar-button--active']\n )}\n aria-label={t.aria.labels.link}\n aria-keyshortcuts={t.aria.keyshortcuts.link}\n type=\"button\"\n ref={linkButtonRef}\n >\n <Icon name=\"Link\" size={20} />\n </button>\n {flyout}\n </div>\n </div>\n );\n};\n"],"names":["PREVENT_OPEN_DELAY","getLinkNode","node","currentNode","$isLinkNode","getLinkNodeTag","anchorNode","LinkPlugin","parentScrollPosition","t","useTranslation","editor","useLexicalComposerContext","flyout","showFlyout","hideFlyout","isVisible","useFlyout","addLinkForm","useRef","preventOpen","previousLinkText","selectedText","isLink","setIsLink","useState","isVisibleRef","storedSelection","linkButtonRef","editLinkForm","storeCursorPosition","selection","$getSelection","rePositionCursor","$setSelection","openContextMenu","url","position","jsx","LinkContextMenu","insertLink","removeLink","closeContextMenu","openFlyout","rect","flyoutOptions","closeFlyout","linktext","$isRangeSelection","linkNode","newTextNode","$createTextNode","anchor","focus","$toggleLink","ensureHttps","TOGGLE_LINK_COMMAND","AddLinkForm","useEffect","handleSelectionClickOrChange","domNode","unregisterSelect","SELECTION_CHANGE_COMMAND","unregisterClick","CLICK_COMMAND","event","removeKeyboardShortcut","KEY_DOWN_COMMAND","openFlyoutWithDefaults","linkText","selectedTextContent","COMMAND_PRIORITY_EDITOR","removeStatusListener","editorState","removeKeydown","setScrollableContainers","handleResizeScroll","removeScrollableContainers","styles","jsxs","clsx","Icon"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA,MAAMA,KAAqB,KAiBrBC,IAAc,CAACC,MAAiD;AACpE,MAAIC,IAA6CD;AAEjD,SAAOC,KAAa;AAClB,QAAIC,EAAYD,CAAW;AACzB,aAAOA;AAET,IAAAA,IAAcA,EAAY,UAAA;AAAA,EAC5B;AAEA,SAAO;AACT,GAEaE,IAAiB,CAACC,MAA2D;AACxF,MAAIH,IAA6CG;AAEjD,SAAOH,KAAa;AAClB,QAAIC,EAAYD,CAAW;AACzB,aAAO;AAAA,QACL,QAAQ;AAAA,QACR,KAAKA,EAAY,OAAA;AAAA,QACjB,UAAUA,EAAY,eAAA;AAAA,MAAe;AAGzC,IAAAA,IAAcA,EAAY,UAAA;AAAA,EAC5B;AAEA,SAAO;AACT,GAEaI,KAAa,CAAC,EAAE,sBAAAC,QAA4C;AACvE,QAAMC,IAAIC,GAAA,GACJ,CAACC,CAAM,IAAIC,EAAA,GACX,EAAE,QA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,MAAM;AAAA,QACf,WAAWuE;AAAA,UACTF,EAAO,wBAAwB;AAAA,UAC/BA,EAAO,8BAA8B;AAAA,UACrCvD,EAAO,UAAUuD,EAAO,gCAAgC;AAAA,QAAA;AAAA,QAE1D,cAAYrE,EAAE,KAAK,OAAO;AAAA,QAC1B,qBAAmBA,EAAE,KAAK,aAAa;AAAA,QACvC,MAAK;AAAA,QACL,KAAKmB;AAAA,QAEL,UAAA,gBAAAU,EAAC2C,IAAA,EAAK,MAAK,QAAO,MAAM,GAAA,CAAI;AAAA,MAAA;AAAA,IAAA;AAAA,IAE7BpE;AAAA,EAAA,EAAA,CACH,EAAA,CACF;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"LinkPlugin.js","sources":["../../../../../src/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.tsx"],"sourcesContent":["import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';\nimport { clsx } from 'clsx';\nimport { $isLinkNode, $toggleLink, TOGGLE_LINK_COMMAND } from '@lexical/link';\nimport { useEffect, useRef, useState } from 'react';\nimport {\n $createTextNode,\n $getSelection,\n $isRangeSelection,\n $setSelection,\n CLICK_COMMAND,\n COMMAND_PRIORITY_EDITOR,\n KEY_DOWN_COMMAND,\n SELECTION_CHANGE_COMMAND,\n} from 'lexical';\n\nimport type { LinkNode } from '@lexical/link';\nimport type { ElementNode, TextNode, BaseSelection } from 'lexical';\nimport type { addLinkFormMethods } from './AddLinkForm/AddLinkFrom';\nimport type { linkFormMethods } from './LinkContextMenu/LinkContextMenu';\n\nimport { AddLinkForm } from './AddLinkForm/AddLinkFrom';\nimport { ensureHttps } from './helpers';\nimport { LinkContextMenu } from './LinkContextMenu/LinkContextMenu';\n\nimport { useFlyout } from 'components/RteEditor/hooks/useFlyout';\nimport { Icon } from 'components';\nimport styles from 'components/RteEditor/RteEditor.module.css';\nimport { useTranslation } from 'components/RteEditor/hooks/useTranslation';\nimport { removeScrollableContainers, setScrollableContainers } from 'components/RteEditor/helpers';\n\nconst PREVENT_OPEN_DELAY = 200;\n\nexport interface LinkType {\n active: boolean;\n url: string;\n linktext: string;\n}\n\ntype Position = {\n top: number;\n left: number;\n};\n\ninterface LinkPluginProps {\n parentScrollPosition: number;\n}\n\nconst getLinkNode = (node: ElementNode | null): ElementNode | null => {\n let currentNode: TextNode | ElementNode | null = node;\n\n while (currentNode) {\n if ($isLinkNode(currentNode)) {\n return currentNode;\n }\n currentNode = currentNode.getParent();\n }\n\n return null;\n};\n\nexport const getLinkNodeTag = (anchorNode: ElementNode | TextNode): boolean | LinkType => {\n let currentNode: TextNode | ElementNode | null = anchorNode;\n\n while (currentNode) {\n if ($isLinkNode(currentNode)) {\n return {\n active: true,\n url: currentNode.getURL(),\n linktext: currentNode.getTextContent(),\n };\n }\n currentNode = currentNode.getParent();\n }\n\n return false;\n};\n\nexport const LinkPlugin = ({ parentScrollPosition }: LinkPluginProps) => {\n const t = useTranslation();\n const [editor] = useLexicalComposerContext();\n const { flyout, showFlyout, hideFlyout, isVisible } = useFlyout();\n const addLinkForm = useRef<addLinkFormMethods>(undefined);\n const preventOpen = useRef(false);\n const previousLinkText = useRef('');\n const selectedText = useRef('');\n const [isLink, setIsLink] = useState<LinkType>({ active: false, url: '', linktext: '' });\n const isVisibleRef = useRef(isVisible);\n const storedSelection = useRef<BaseSelection | null>(null);\n const linkButtonRef = useRef<HTMLButtonElement>(null);\n const editLinkForm = useRef<linkFormMethods>(undefined);\n\n const storeCursorPosition = () => {\n editor.update(() => {\n const selection = $getSelection();\n storedSelection.current = selection;\n });\n };\n\n const rePositionCursor = () => {\n editor.update(() => {\n if (storedSelection.current) {\n $setSelection(storedSelection.current);\n }\n });\n };\n\n const openContextMenu = (url: string, position: Position) => {\n showFlyout({\n position,\n children: (\n <LinkContextMenu\n url={url}\n onSave={(url) => insertLink(url, '')}\n onDelete={() => removeLink()}\n onClose={closeContextMenu}\n ref={editLinkForm}\n />\n ),\n });\n };\n\n const closeContextMenu = () => {\n editLinkForm.current?.clearForm();\n hideFlyout();\n rePositionCursor();\n };\n\n const openFlyout = () => {\n const rect = linkButtonRef.current?.getBoundingClientRect();\n if (!preventOpen.current && rect) {\n storeCursorPosition();\n showFlyout({ position: { top: rect.bottom, left: rect.left }, ...flyoutOptions });\n setTimeout(() => addLinkForm.current?.setDefaults('', selectedText.current), 0);\n }\n };\n\n const closeFlyout = () => {\n hideFlyout();\n rePositionCursor();\n };\n\n const insertLink = (url: string, linktext: string) => {\n editor.update(() => {\n const selection = $getSelection();\n\n if ($isRangeSelection(selection)) {\n const anchor = selection.anchor;\n const node = anchor.getNode() as ElementNode;\n const linkNode = getLinkNode(node);\n if (linktext && linktext !== '') {\n if (linkNode) {\n const newTextNode = $createTextNode(linktext);\n linkNode.replace(newTextNode);\n newTextNode.select();\n }\n if (linktext !== previousLinkText.current && previousLinkText.current === '') {\n const { anchor, focus } = selection;\n selection.insertText(linktext);\n anchor.offset -= linktext.length;\n focus.offset = anchor.offset + linktext.length;\n }\n }\n $toggleLink(ensureHttps(url), { target: '_blank' });\n }\n\n closeFlyout();\n });\n };\n\n const removeLink = (): void => {\n editor.dispatchCommand(TOGGLE_LINK_COMMAND, null);\n closeContextMenu();\n };\n\n const flyoutOptions = {\n children: (\n <AddLinkForm\n isLink={isLink}\n onCloseHandler={closeFlyout}\n onSaveHandler={(url, linktext) => insertLink(url, linktext)}\n ref={addLinkForm}\n />\n ),\n };\n\n useEffect(() => {\n if (!isVisible) {\n addLinkForm.current?.clearForm();\n previousLinkText.current = selectedText.current = '';\n setTimeout(() => (preventOpen.current = false), PREVENT_OPEN_DELAY);\n } else {\n preventOpen.current = true;\n addLinkForm.current?.focusFirstField();\n }\n }, [addLinkForm, isVisible]);\n\n useEffect(() => {\n const handleSelectionClickOrChange = (selection: BaseSelection | null) => {\n if ($isRangeSelection(selection) && selection.isCollapsed()) {\n const node = getLinkNodeTag(selection.anchor.getNode()) as LinkType;\n\n if (node) {\n const domNode = editor.getElementByKey(selection.anchor.getNode().getKey());\n const position = domNode\n ? { top: domNode.getBoundingClientRect().bottom, left: domNode.getBoundingClientRect().left }\n : { top: 0, left: 0 };\n openContextMenu(node.url, position);\n return true;\n }\n }\n return false;\n };\n\n const unregisterSelect = editor.registerCommand(\n SELECTION_CHANGE_COMMAND,\n () => {\n const selection = $getSelection();\n selectedText.current = selection?.getTextContent() ?? '';\n handleSelectionClickOrChange(selection);\n return false;\n },\n 0\n );\n\n const unregisterClick = editor.registerCommand(\n CLICK_COMMAND,\n (event) => {\n const selection = $getSelection();\n storeCursorPosition();\n event.preventDefault();\n event.stopPropagation();\n event.stopImmediatePropagation();\n handleSelectionClickOrChange(selection);\n return false;\n },\n 0\n );\n\n return () => {\n unregisterClick();\n unregisterSelect();\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [editor]);\n\n useEffect(() => {\n const removeKeyboardShortcut = editor.registerCommand(\n KEY_DOWN_COMMAND,\n (event: KeyboardEvent) => {\n if (event.ctrlKey && event.shiftKey && event.key === 'U') {\n const selection = $getSelection();\n storeCursorPosition();\n\n if (!$isRangeSelection(selection)) {\n return false;\n }\n\n const node = getLinkNodeTag(selection.anchor.getNode()) as LinkType;\n\n const openFlyoutWithDefaults = (url = '', linkText = '') => {\n openFlyout();\n setTimeout(() => addLinkForm.current?.setDefaults(url, linkText), 0);\n };\n\n if (node) {\n event.preventDefault();\n event.stopPropagation();\n event.stopImmediatePropagation();\n\n previousLinkText.current = node.linktext;\n openFlyoutWithDefaults(node.url, node.linktext);\n\n return true;\n }\n\n const selectedTextContent = selection.getTextContent();\n if (selectedTextContent !== '') {\n selectedText.current = selectedTextContent;\n openFlyoutWithDefaults('', selectedText.current);\n\n return true;\n }\n\n openFlyout();\n return true;\n }\n\n return false;\n },\n COMMAND_PRIORITY_EDITOR\n );\n\n const removeStatusListener = editor.registerUpdateListener(({ editorState }) => {\n setIsLink(\n editorState.read(() => {\n const selection = $getSelection();\n storeCursorPosition();\n\n if ($isRangeSelection(selection)) {\n const anchorNode = selection.anchor.getNode() as ElementNode;\n const linkNode = getLinkNode(anchorNode) as LinkNode;\n\n if (linkNode) {\n return {\n active: true,\n url: linkNode.getURL(),\n linktext: linkNode.getTextContent(),\n };\n }\n }\n\n return {\n active: false,\n url: '',\n linktext: '',\n };\n })\n );\n });\n\n return () => {\n removeKeyboardShortcut();\n removeStatusListener();\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [editor]);\n\n useEffect(() => {\n isVisibleRef.current = isVisible;\n if (!isVisible) editLinkForm.current?.clearForm();\n }, [isVisible]);\n\n useEffect(() => {\n if (isVisible) {\n closeFlyout();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [parentScrollPosition]);\n\n useEffect(() => {\n if (!isLink.active) {\n hideFlyout();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isLink]);\n\n useEffect(() => {\n const removeKeydown = (event: KeyboardEvent): boolean => {\n setScrollableContainers(handleResizeScroll);\n\n if (event.key === 'Escape' && isVisibleRef.current) {\n event.preventDefault();\n event.stopPropagation();\n closeFlyout();\n }\n return true;\n };\n\n window.addEventListener('keydown', removeKeydown, { capture: true });\n\n const handleResizeScroll = () => {\n hideFlyout();\n };\n\n setScrollableContainers(handleResizeScroll);\n\n window.addEventListener('scroll', handleResizeScroll);\n window.addEventListener('resize', handleResizeScroll);\n\n return () => {\n window.removeEventListener('keydown', removeKeydown);\n window.removeEventListener('scroll', handleResizeScroll);\n window.removeEventListener('resize', handleResizeScroll);\n removeScrollableContainers(handleResizeScroll);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return (\n <div className={styles['editor__toolbar-button-group']}>\n <div className={styles['editor__toolbar-button-flyoutwrapper']}>\n <button\n onClick={openFlyout}\n title={t.links.linkTooltip}\n className={clsx(\n styles['editor__toolbar-button'],\n styles[`editor__toolbar-button--link`],\n isLink.active && styles['editor__toolbar-button--active']\n )}\n aria-label={t.aria.labels.link}\n aria-keyshortcuts={t.aria.keyshortcuts.link}\n type=\"button\"\n ref={linkButtonRef}\n >\n <Icon name=\"Link\" size={20} />\n </button>\n {flyout}\n </div>\n </div>\n );\n};\n"],"names":["PREVENT_OPEN_DELAY","getLinkNode","node","currentNode","$isLinkNode","getLinkNodeTag","anchorNode","LinkPlugin","parentScrollPosition","t","useTranslation","editor","useLexicalComposerContext","flyout","showFlyout","hideFlyout","isVisible","useFlyout","addLinkForm","useRef","preventOpen","previousLinkText","selectedText","isLink","setIsLink","useState","isVisibleRef","storedSelection","linkButtonRef","editLinkForm","storeCursorPosition","selection","$getSelection","rePositionCursor","$setSelection","openContextMenu","url","position","jsx","LinkContextMenu","insertLink","removeLink","closeContextMenu","openFlyout","rect","flyoutOptions","closeFlyout","linktext","$isRangeSelection","linkNode","newTextNode","$createTextNode","anchor","focus","$toggleLink","ensureHttps","TOGGLE_LINK_COMMAND","AddLinkForm","useEffect","handleSelectionClickOrChange","domNode","unregisterSelect","SELECTION_CHANGE_COMMAND","unregisterClick","CLICK_COMMAND","event","removeKeyboardShortcut","KEY_DOWN_COMMAND","openFlyoutWithDefaults","linkText","selectedTextContent","COMMAND_PRIORITY_EDITOR","removeStatusListener","editorState","removeKeydown","setScrollableContainers","handleResizeScroll","removeScrollableContainers","styles","jsxs","clsx","Icon"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA,MAAMA,KAAqB,KAiBrBC,IAAc,CAACC,MAAiD;AACpE,MAAIC,IAA6CD;AAEjD,SAAOC,KAAa;AAClB,QAAIC,EAAYD,CAAW;AACzB,aAAOA;AAET,IAAAA,IAAcA,EAAY,UAAA;AAAA,EAC5B;AAEA,SAAO;AACT,GAEaE,IAAiB,CAACC,MAA2D;AACxF,MAAIH,IAA6CG;AAEjD,SAAOH,KAAa;AAClB,QAAIC,EAAYD,CAAW;AACzB,aAAO;AAAA,QACL,QAAQ;AAAA,QACR,KAAKA,EAAY,OAAA;AAAA,QACjB,UAAUA,EAAY,eAAA;AAAA,MAAe;AAGzC,IAAA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8B,GACnD,UAAA,gBAAAC,EAAC,OAAA,EAAI,WAAWD,EAAO,sCAAsC,GAC3D,UAAA;AAAA,IAAA,gBAAAxC;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,SAASK;AAAA,QACT,OAAOlC,EAAE,MAAM;AAAA,QACf,WAAWuE;AAAA,UACTF,EAAO,wBAAwB;AAAA,UAC/BA,EAAO,8BAA8B;AAAA,UACrCvD,EAAO,UAAUuD,EAAO,gCAAgC;AAAA,QAAA;AAAA,QAE1D,cAAYrE,EAAE,KAAK,OAAO;AAAA,QAC1B,qBAAmBA,EAAE,KAAK,aAAa;AAAA,QACvC,MAAK;AAAA,QACL,KAAKmB;AAAA,QAEL,UAAA,gBAAAU,EAAC2C,IAAA,EAAK,MAAK,QAAO,MAAM,GAAA,CAAI;AAAA,MAAA;AAAA,IAAA;AAAA,IAE7BpE;AAAA,EAAA,EAAA,CACH,EAAA,CACF;AAEJ;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { b as
|
|
3
|
+
import { b as G } from "../../../../TablePlugin-CfXPNfT8.js";
|
|
4
4
|
import "../../../Accordion/Accordion.js";
|
|
5
5
|
import "../../../Buttons/Button.js";
|
|
6
6
|
import "../../../Buttons/LinkButton.js";
|
|
@@ -29,7 +29,8 @@ import "../../../SelectListbox/SelectListbox.js";
|
|
|
29
29
|
import "../../../SelectListbox/SelectProvider.js";
|
|
30
30
|
import "../../../Sortable/components/SortableItem.js";
|
|
31
31
|
import "../../../../SortableProvider-l8-7ClBJ.js";
|
|
32
|
+
import "../../../WeekSelector/components/WeekSelectorOptionContainer.js";
|
|
32
33
|
export {
|
|
33
|
-
|
|
34
|
+
G as AddTableForm
|
|
34
35
|
};
|
|
35
36
|
//# sourceMappingURL=AddTableFrom.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddTableFrom.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AddTableFrom.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -5,7 +5,7 @@ import "../../../../LexicalTable.prod-Bexd4dGG.js";
|
|
|
5
5
|
import "../../../../Lexical.prod-nXWuyOKD.js";
|
|
6
6
|
import "../../../../LexicalUtils.prod-Ckfw0Hjt.js";
|
|
7
7
|
import "react";
|
|
8
|
-
import { T as
|
|
8
|
+
import { T as L } from "../../../../TablePlugin-CfXPNfT8.js";
|
|
9
9
|
import "./helpers.js";
|
|
10
10
|
import "../../nodes/TableWrapperNode/TableWrapperNode.js";
|
|
11
11
|
import "../../hooks/useFlyout.js";
|
|
@@ -35,7 +35,8 @@ import "../../../SelectListbox/SelectListbox.js";
|
|
|
35
35
|
import "../../../SelectListbox/SelectProvider.js";
|
|
36
36
|
import "../../../Sortable/components/SortableItem.js";
|
|
37
37
|
import "../../../../SortableProvider-l8-7ClBJ.js";
|
|
38
|
+
import "../../../WeekSelector/components/WeekSelectorOptionContainer.js";
|
|
38
39
|
export {
|
|
39
|
-
|
|
40
|
+
L as TablePlugin
|
|
40
41
|
};
|
|
41
42
|
//# sourceMappingURL=TablePlugin.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TablePlugin.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TablePlugin.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|