@team-monolith/cds 1.129.2-alpha.2 → 1.129.3-alpha
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/CdsProvider.js +180 -180
- package/dist/components/AlertDialog/AlertDialogTitle.js +15 -15
- package/dist/components/Banner.js +28 -28
- package/dist/components/FileTypeAlertDialog.js +16 -16
- package/dist/components/Pagination.js +22 -22
- package/dist/emotion.d.ts +185 -0
- package/dist/i18n/i18n.js +14 -14
- package/dist/index.d.ts +8 -1
- package/dist/node_modules/.pnpm/html-parse-stringify@3.0.1/node_modules/html-parse-stringify/dist/html-parse-stringify.module.js +78 -0
- package/dist/node_modules/.pnpm/react-i18next@15.7.3_i18next@25.5.2_typescript@5.5.4__react-dom@18.2.0_react@18.2.0__react@18.2.0_typescript@5.5.4/node_modules/react-i18next/dist/es/I18nextProvider.js +12 -0
- package/dist/node_modules/.pnpm/react-i18next@15.7.3_i18next@25.5.2_typescript@5.5.4__react-dom@18.2.0_react@18.2.0__react@18.2.0_typescript@5.5.4/node_modules/react-i18next/dist/es/Trans.js +26 -0
- package/dist/node_modules/.pnpm/react-i18next@15.7.3_i18next@25.5.2_typescript@5.5.4__react-dom@18.2.0_react@18.2.0__react@18.2.0_typescript@5.5.4/node_modules/react-i18next/dist/es/TransWithoutContext.js +174 -0
- package/dist/node_modules/.pnpm/react-i18next@15.7.3_i18next@25.5.2_typescript@5.5.4__react-dom@18.2.0_react@18.2.0__react@18.2.0_typescript@5.5.4/node_modules/react-i18next/dist/es/context.js +20 -0
- package/dist/node_modules/.pnpm/react-i18next@15.7.3_i18next@25.5.2_typescript@5.5.4__react-dom@18.2.0_react@18.2.0__react@18.2.0_typescript@5.5.4/node_modules/react-i18next/dist/es/defaults.js +24 -0
- package/dist/node_modules/.pnpm/react-i18next@15.7.3_i18next@25.5.2_typescript@5.5.4__react-dom@18.2.0_react@18.2.0__react@18.2.0_typescript@5.5.4/node_modules/react-i18next/dist/es/i18nInstance.js +6 -0
- package/dist/node_modules/.pnpm/react-i18next@15.7.3_i18next@25.5.2_typescript@5.5.4__react-dom@18.2.0_react@18.2.0__react@18.2.0_typescript@5.5.4/node_modules/react-i18next/dist/es/initReactI18next.js +11 -0
- package/dist/node_modules/.pnpm/react-i18next@15.7.3_i18next@25.5.2_typescript@5.5.4__react-dom@18.2.0_react@18.2.0__react@18.2.0_typescript@5.5.4/node_modules/react-i18next/dist/es/unescape.js +25 -0
- package/dist/node_modules/.pnpm/react-i18next@15.7.3_i18next@25.5.2_typescript@5.5.4__react-dom@18.2.0_react@18.2.0__react@18.2.0_typescript@5.5.4/node_modules/react-i18next/dist/es/useTranslation.js +69 -0
- package/dist/node_modules/.pnpm/react-i18next@15.7.3_i18next@25.5.2_typescript@5.5.4__react-dom@18.2.0_react@18.2.0__react@18.2.0_typescript@5.5.4/node_modules/react-i18next/dist/es/utils.js +35 -0
- package/dist/patterns/LexicalEditor/Plugins.js +64 -64
- package/dist/patterns/LexicalEditor/components/FileSelectInput.js +19 -19
- package/dist/patterns/LexicalEditor/components/InsertImageDialog/ImagePreview.js +6 -6
- package/dist/patterns/LexicalEditor/components/InsertImageDialog/InsertImageDialog.js +34 -34
- package/dist/patterns/LexicalEditor/components/UploadFileDialog/UploadFileDialog.js +14 -14
- package/dist/patterns/LexicalEditor/nodes/FileNode/FileDownloadButton.js +17 -17
- package/dist/patterns/LexicalEditor/nodes/ImageNode/ImageComponent.js +62 -62
- package/dist/patterns/LexicalEditor/nodes/ProblemInputNode/InputComponent.js +25 -25
- package/dist/patterns/LexicalEditor/nodes/ProblemInputNode/SettingForm/FormPlaceholder.js +7 -7
- package/dist/patterns/LexicalEditor/nodes/ProblemInputNode/SettingForm/FormSolution.js +24 -23
- package/dist/patterns/LexicalEditor/nodes/ProblemInputNode/SettingForm/SettingForm.js +48 -47
- package/dist/patterns/LexicalEditor/nodes/ProblemInputNode/SettingForm/TextTypeDropdown.js +11 -11
- package/dist/patterns/LexicalEditor/nodes/ProblemSelectNode/SelectBox/SelectBoxView.js +15 -15
- package/dist/patterns/LexicalEditor/nodes/ProblemSelectNode/SelectComponent.js +28 -28
- package/dist/patterns/LexicalEditor/nodes/ProblemSelectNode/SettingForm/FormSelection.js +30 -30
- package/dist/patterns/LexicalEditor/nodes/ProblemSelectNode/SettingForm/SettingForm.js +35 -35
- package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/EvaluationComponent/Evaluation/SettingForm/FormIconAndLabel/FormIconAndLabel.js +21 -21
- package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/EvaluationComponent/Evaluation/SettingForm/FormIconAndLabel/FormLabel.js +15 -15
- package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/EvaluationComponent/Evaluation/SettingForm/FormQuestion.js +17 -17
- package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/EvaluationComponent/Evaluation/SettingForm/SettingForm.js +30 -30
- package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/EvaluationComponent/EvaluationComponent.js +20 -20
- package/dist/patterns/LexicalEditor/nodes/SheetInputNode/InputComponent.js +24 -24
- package/dist/patterns/LexicalEditor/nodes/SheetInputNode/SettingForm.js +28 -28
- package/dist/patterns/LexicalEditor/nodes/SheetSelectNode/SelectComponent/SelectBox/SelectBoxView.js +11 -11
- package/dist/patterns/LexicalEditor/nodes/SheetSelectNode/SelectComponent/SelectComponent.js +26 -26
- package/dist/patterns/LexicalEditor/nodes/SheetSelectNode/SelectComponent/SettingForm/FormAllowMultipleAnswers.js +8 -8
- package/dist/patterns/LexicalEditor/nodes/SheetSelectNode/SelectComponent/SettingForm/FormSelection.js +27 -27
- package/dist/patterns/LexicalEditor/nodes/SheetSelectNode/SelectComponent/SettingForm/SettingForm.js +33 -33
- package/dist/patterns/LexicalEditor/nodes/VideoNode/VideoComponent.js +21 -21
- package/dist/patterns/LexicalEditor/plugins/ComponentAdderPlugin/ComponentAdderPlugin.js +99 -99
- package/dist/patterns/LexicalEditor/plugins/ComponentAdderPlugin/useContextMenuOptions.js +50 -50
- package/dist/patterns/LexicalEditor/plugins/ComponentPickerMenuPlugin/ComponentPickerMenuPlugin.js +85 -85
- package/dist/patterns/LexicalEditor/plugins/DragDropPastePlugin/index.js +13 -13
- package/dist/patterns/LexicalEditor/plugins/FloatingLinkEditorPlugin/FloatingLinkEditor.js +48 -48
- package/dist/patterns/LexicalEditor/plugins/ImagesPlugin/useImageNodeTransform.js +16 -16
- package/dist/patterns/ToggleButtonGroup/ToggleButton.js +17 -17
- package/package.json +15 -18
- package/@types/emotion.d.ts +0 -197
- package/node_modules/react-i18next/.eslintrc.json +0 -74
- package/node_modules/react-i18next/.husky/pre-commit +0 -1
- package/node_modules/react-i18next/.prettierignore +0 -4
- package/node_modules/react-i18next/CHANGELOG.md +0 -1433
- package/node_modules/react-i18next/LICENSE +0 -22
- package/node_modules/react-i18next/README.md +0 -181
- package/node_modules/react-i18next/TransWithoutContext.d.mts +0 -1
- package/node_modules/react-i18next/TransWithoutContext.d.ts +0 -129
- package/node_modules/react-i18next/dist/amd/react-i18next.js +0 -867
- package/node_modules/react-i18next/dist/amd/react-i18next.min.js +0 -1
- package/node_modules/react-i18next/dist/commonjs/I18nextProvider.js +0 -21
- package/node_modules/react-i18next/dist/commonjs/Trans.js +0 -54
- package/node_modules/react-i18next/dist/commonjs/TransWithoutContext.js +0 -330
- package/node_modules/react-i18next/dist/commonjs/Translation.js +0 -19
- package/node_modules/react-i18next/dist/commonjs/context.js +0 -81
- package/node_modules/react-i18next/dist/commonjs/defaults.js +0 -26
- package/node_modules/react-i18next/dist/commonjs/i18nInstance.js +0 -13
- package/node_modules/react-i18next/dist/commonjs/index.js +0 -128
- package/node_modules/react-i18next/dist/commonjs/initReactI18next.js +0 -15
- package/node_modules/react-i18next/dist/commonjs/unescape.js +0 -32
- package/node_modules/react-i18next/dist/commonjs/useSSR.js +0 -34
- package/node_modules/react-i18next/dist/commonjs/useTranslation.js +0 -114
- package/node_modules/react-i18next/dist/commonjs/utils.js +0 -76
- package/node_modules/react-i18next/dist/commonjs/withSSR.js +0 -27
- package/node_modules/react-i18next/dist/commonjs/withTranslation.js +0 -39
- package/node_modules/react-i18next/dist/es/I18nextProvider.js +0 -15
- package/node_modules/react-i18next/dist/es/Trans.js +0 -43
- package/node_modules/react-i18next/dist/es/TransWithoutContext.js +0 -321
- package/node_modules/react-i18next/dist/es/Translation.js +0 -12
- package/node_modules/react-i18next/dist/es/context.js +0 -42
- package/node_modules/react-i18next/dist/es/defaults.js +0 -18
- package/node_modules/react-i18next/dist/es/i18nInstance.js +0 -5
- package/node_modules/react-i18next/dist/es/index.js +0 -18
- package/node_modules/react-i18next/dist/es/initReactI18next.js +0 -9
- package/node_modules/react-i18next/dist/es/package.json +0 -1
- package/node_modules/react-i18next/dist/es/unescape.js +0 -25
- package/node_modules/react-i18next/dist/es/useSSR.js +0 -27
- package/node_modules/react-i18next/dist/es/useTranslation.js +0 -107
- package/node_modules/react-i18next/dist/es/utils.js +0 -62
- package/node_modules/react-i18next/dist/es/withSSR.js +0 -20
- package/node_modules/react-i18next/dist/es/withTranslation.js +0 -32
- package/node_modules/react-i18next/dist/umd/react-i18next.js +0 -871
- package/node_modules/react-i18next/dist/umd/react-i18next.min.js +0 -1
- package/node_modules/react-i18next/helpers.d.ts +0 -3
- package/node_modules/react-i18next/icu.macro.d.mts +0 -1
- package/node_modules/react-i18next/icu.macro.d.ts +0 -103
- package/node_modules/react-i18next/icu.macro.js +0 -729
- package/node_modules/react-i18next/index.d.mts +0 -1
- package/node_modules/react-i18next/index.d.ts +0 -209
- package/node_modules/react-i18next/initReactI18next.d.mts +0 -1
- package/node_modules/react-i18next/initReactI18next.d.ts +0 -3
- package/node_modules/react-i18next/lint-staged.config.mjs +0 -4
- package/node_modules/react-i18next/package.json +0 -167
- package/node_modules/react-i18next/react-i18next.js +0 -871
- package/node_modules/react-i18next/react-i18next.min.js +0 -1
- package/node_modules/react-i18next/src/I18nextProvider.js +0 -7
- package/node_modules/react-i18next/src/Trans.js +0 -45
- package/node_modules/react-i18next/src/TransWithoutContext.js +0 -479
- package/node_modules/react-i18next/src/Translation.js +0 -14
- package/node_modules/react-i18next/src/context.js +0 -54
- package/node_modules/react-i18next/src/defaults.js +0 -20
- package/node_modules/react-i18next/src/i18nInstance.js +0 -7
- package/node_modules/react-i18next/src/index.js +0 -22
- package/node_modules/react-i18next/src/initReactI18next.js +0 -11
- package/node_modules/react-i18next/src/unescape.js +0 -31
- package/node_modules/react-i18next/src/useSSR.js +0 -33
- package/node_modules/react-i18next/src/useTranslation.js +0 -171
- package/node_modules/react-i18next/src/utils.js +0 -93
- package/node_modules/react-i18next/src/withSSR.js +0 -21
- package/node_modules/react-i18next/src/withTranslation.js +0 -35
- package/node_modules/react-i18next/vitest.workspace.typescript.mts +0 -52
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
import { ZINDEX as e } from "../../../../utils/zIndex.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
2
|
+
import { useTranslation as t } from "../../../../node_modules/.pnpm/react-i18next@15.7.3_i18next@25.5.2_typescript@5.5.4__react-dom@18.2.0_react@18.2.0__react@18.2.0_typescript@5.5.4/node_modules/react-i18next/dist/es/useTranslation.js";
|
|
3
|
+
import { InsertImageDialog as n } from "../../components/InsertImageDialog/InsertImageDialog.js";
|
|
4
|
+
import { useDraggableBlockMenu as r } from "./useDraggableBlockMenu.js";
|
|
5
|
+
import { ComponentPickerMenuList as ee } from "../ComponentPickerMenuPlugin/ComponentPickerMenuList.js";
|
|
6
|
+
import { INSERT_IMAGE_COMMAND as te } from "../ImagesPlugin/index.js";
|
|
7
|
+
import { InsertVideoDialog as ne } from "../../components/InsertVideoDialog/InsertVideoDialog.js";
|
|
8
|
+
import { INSERT_VIDEO_COMMAND as re } from "../VideosPlugin/index.js";
|
|
9
|
+
import { UploadFileDialog as ie } from "../../components/UploadFileDialog/UploadFileDialog.js";
|
|
10
|
+
import { UPLOAD_FILE_COMMAND as ae } from "../FilePlugin/index.js";
|
|
11
|
+
import { ComponentDrawerOption as i, ComponentPickerOption as a, getBaseOptions as o } from "../ComponentPickerMenuPlugin/ComponentPickerMenuPlugin.js";
|
|
12
|
+
import { useFloatingMenu as s } from "./useFloatingMenu.js";
|
|
13
|
+
import { ComponentAdder as c } from "./ComponentAdder.js";
|
|
14
|
+
import { useContextMenuOptions as oe } from "./useContextMenuOptions.js";
|
|
14
15
|
import { useTheme as l } from "@emotion/react";
|
|
15
|
-
import { useCallback as
|
|
16
|
+
import { useCallback as u, useEffect as d, useRef as se, useState as f } from "react";
|
|
16
17
|
import p from "@emotion/styled";
|
|
17
18
|
import { Fragment as m, jsx as h, jsxs as g } from "@emotion/react/jsx-runtime";
|
|
18
|
-
import { useTranslation as se } from "react-i18next";
|
|
19
19
|
import { css as ce } from "@emotion/css";
|
|
20
|
-
import { $createNodeSelection as le, $createParagraphNode as ue, $getNearestNodeFromDOMNode as _, $getSelection as de, $isNodeSelection as
|
|
21
|
-
import { useLexicalComposerContext as
|
|
22
|
-
import
|
|
23
|
-
import { LexicalNodeMenuPlugin as
|
|
20
|
+
import { $createNodeSelection as le, $createParagraphNode as ue, $getNearestNodeFromDOMNode as _, $getSelection as de, $isNodeSelection as v, $isParagraphNode as y, $isRangeSelection as b, $setSelection as x } from "lexical";
|
|
21
|
+
import { useLexicalComposerContext as S } from "@lexical/react/LexicalComposerContext";
|
|
22
|
+
import C, { createPortal as w } from "react-dom";
|
|
23
|
+
import { LexicalNodeMenuPlugin as T } from "@lexical/react/LexicalNodeMenuPlugin";
|
|
24
24
|
//#region src/cds/patterns/LexicalEditor/plugins/ComponentAdderPlugin/ComponentAdderPlugin.tsx
|
|
25
|
-
var
|
|
26
|
-
function E(e) {
|
|
27
|
-
return !!e.closest(`.${T.menu}`);
|
|
28
|
-
}
|
|
25
|
+
var E = { menu: "ComponentAdder-menu" };
|
|
29
26
|
function D(e) {
|
|
30
|
-
return e.
|
|
27
|
+
return !!e.closest(`.${E.menu}`);
|
|
31
28
|
}
|
|
32
29
|
function O(e) {
|
|
30
|
+
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
31
|
+
}
|
|
32
|
+
function k(e) {
|
|
33
33
|
let t = e.anchor;
|
|
34
34
|
if (t.type !== "text") return null;
|
|
35
35
|
let n = t.getNode();
|
|
@@ -37,147 +37,147 @@ function O(e) {
|
|
|
37
37
|
let r = t.offset;
|
|
38
38
|
return n.getTextContent().slice(0, r);
|
|
39
39
|
}
|
|
40
|
-
function
|
|
41
|
-
let { anchorElem:
|
|
42
|
-
anchorElem:
|
|
43
|
-
menuRef:
|
|
44
|
-
isOnMenu:
|
|
45
|
-
}), [
|
|
46
|
-
|
|
47
|
-
let e =
|
|
48
|
-
|
|
49
|
-
if (
|
|
40
|
+
function A(p) {
|
|
41
|
+
let { anchorElem: A, isSheetEnabled: M, isQuizEnabled: N, showFileUpload: P } = p, F = l(), [I] = S(), { t: L } = t(), [R, z] = f(null), B = se(null), { blockElem: V, setBlockElem: H } = s({
|
|
42
|
+
anchorElem: A,
|
|
43
|
+
menuRef: B,
|
|
44
|
+
isOnMenu: D
|
|
45
|
+
}), [U, W] = f("plus"), [fe, G] = f([]), [pe, K] = f(!1), [me, q] = f(!1), [he, J] = f(!1), [Y, X] = f("");
|
|
46
|
+
d(() => {
|
|
47
|
+
let e = I.registerUpdateListener(() => {
|
|
48
|
+
I.getEditorState().read(() => {
|
|
49
|
+
if (R === null) return;
|
|
50
50
|
let e = de();
|
|
51
|
-
if (
|
|
51
|
+
if (b(e)) {
|
|
52
52
|
if (e.getNodes().every((e) => {
|
|
53
53
|
let t = e.getTopLevelElement();
|
|
54
|
-
return t ? t.getKey() !==
|
|
54
|
+
return t ? t.getKey() !== R : !0;
|
|
55
55
|
})) {
|
|
56
|
-
|
|
56
|
+
X(""), z(null);
|
|
57
57
|
return;
|
|
58
58
|
}
|
|
59
|
-
|
|
60
|
-
} else
|
|
59
|
+
U === "plus" && X(k(e) ?? "");
|
|
60
|
+
} else v(e) ? e.getNodes()[0]?.getKey() !== R && (X(""), z(null)) : (X(""), z(null));
|
|
61
61
|
});
|
|
62
62
|
});
|
|
63
63
|
return () => {
|
|
64
64
|
e();
|
|
65
65
|
};
|
|
66
66
|
}, [
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
I,
|
|
68
|
+
R,
|
|
69
|
+
U
|
|
70
70
|
]);
|
|
71
|
-
let
|
|
72
|
-
e instanceof
|
|
73
|
-
e.onSelect(r),
|
|
71
|
+
let ge = u((e, t, n, r) => {
|
|
72
|
+
e instanceof i || I.update(() => {
|
|
73
|
+
e.onSelect(r), z(null), n();
|
|
74
74
|
});
|
|
75
|
-
}, [
|
|
75
|
+
}, [I]), [Z, Q] = f([]), _e = async () => {
|
|
76
76
|
Z.forEach((e) => e()), Q((e) => e.filter((e) => Z.indexOf(e) === -1));
|
|
77
|
-
}, ve =
|
|
78
|
-
if (!
|
|
79
|
-
let t = new RegExp(
|
|
80
|
-
return e instanceof
|
|
81
|
-
}), { onDragStart: ye, onDragEnd: be, targetLineRef: xe } =
|
|
77
|
+
}, ve = oe(), $ = fe.filter((e) => {
|
|
78
|
+
if (!Y) return !0;
|
|
79
|
+
let t = new RegExp(O(Y), "i");
|
|
80
|
+
return e instanceof a && (t.test(e.title) || e.keywords.some((e) => t.test(e)));
|
|
81
|
+
}), { onDragStart: ye, onDragEnd: be, targetLineRef: xe } = r(I, A, V, H);
|
|
82
82
|
return /* @__PURE__ */ g(m, { children: [
|
|
83
|
-
/* @__PURE__ */ h(
|
|
84
|
-
open:
|
|
85
|
-
title:
|
|
86
|
-
onClose: () =>
|
|
83
|
+
/* @__PURE__ */ h(n, {
|
|
84
|
+
open: pe,
|
|
85
|
+
title: L("이미지 삽입하기", { context: "제목, 다이얼로그" }),
|
|
86
|
+
onClose: () => K(!1),
|
|
87
87
|
onChange: (e) => {
|
|
88
|
-
|
|
88
|
+
I.dispatchCommand(te, e);
|
|
89
89
|
},
|
|
90
90
|
shouldReset: !0
|
|
91
91
|
}),
|
|
92
|
-
/* @__PURE__ */ h(
|
|
93
|
-
open:
|
|
94
|
-
title:
|
|
95
|
-
onClose: () =>
|
|
92
|
+
/* @__PURE__ */ h(ne, {
|
|
93
|
+
open: me,
|
|
94
|
+
title: L("동영상 삽입하기", { context: "제목, 다이얼로그" }),
|
|
95
|
+
onClose: () => q(!1),
|
|
96
96
|
onChange: (e) => {
|
|
97
|
-
|
|
97
|
+
I.dispatchCommand(re, e);
|
|
98
98
|
},
|
|
99
99
|
shouldReset: !0
|
|
100
100
|
}),
|
|
101
|
-
/* @__PURE__ */ h(
|
|
102
|
-
open:
|
|
103
|
-
onClose: () =>
|
|
101
|
+
/* @__PURE__ */ h(ie, {
|
|
102
|
+
open: he,
|
|
103
|
+
onClose: () => J(!1),
|
|
104
104
|
onChange: (e) => {
|
|
105
|
-
|
|
105
|
+
I.dispatchCommand(ae, e);
|
|
106
106
|
}
|
|
107
107
|
}),
|
|
108
|
-
/* @__PURE__ */ h(
|
|
109
|
-
nodeKey:
|
|
108
|
+
/* @__PURE__ */ h(T, {
|
|
109
|
+
nodeKey: R,
|
|
110
110
|
anchorClassName: ce`
|
|
111
111
|
z-index: ${e.DIALOG + 1};
|
|
112
112
|
`,
|
|
113
113
|
options: $,
|
|
114
|
-
menuRenderFn: (e, { selectedIndex: t, selectOptionAndCleanUp: n, setHighlightedIndex:
|
|
114
|
+
menuRenderFn: (e, { selectedIndex: t, selectOptionAndCleanUp: n, setHighlightedIndex: r }) => e.current && $.length ? C.createPortal(/* @__PURE__ */ h(ee, {
|
|
115
115
|
options: $,
|
|
116
116
|
selectedIndex: t,
|
|
117
117
|
selectOptionAndCleanUp: n,
|
|
118
|
-
setHighlightedIndex:
|
|
118
|
+
setHighlightedIndex: r
|
|
119
119
|
}), e.current) : null,
|
|
120
|
-
onSelectOption:
|
|
120
|
+
onSelectOption: ge,
|
|
121
121
|
onClose: () => {
|
|
122
|
-
|
|
122
|
+
z(null), _e();
|
|
123
123
|
}
|
|
124
124
|
}),
|
|
125
|
-
|
|
126
|
-
ref:
|
|
127
|
-
className:
|
|
125
|
+
w(/* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(c, {
|
|
126
|
+
ref: B,
|
|
127
|
+
className: E.menu,
|
|
128
128
|
onPlusClick: async () => {
|
|
129
|
-
if (!
|
|
129
|
+
if (!V) return;
|
|
130
130
|
let e = null;
|
|
131
|
-
if (
|
|
132
|
-
let t = _(
|
|
133
|
-
if (t) if (
|
|
131
|
+
if (I.update(() => {
|
|
132
|
+
let t = _(V);
|
|
133
|
+
if (t) if (y(t) && t.isEmpty()) e = t.getKey(), t.selectStart();
|
|
134
134
|
else {
|
|
135
135
|
let n = ue();
|
|
136
136
|
t.insertAfter(n), n.selectStart(), e = n.getKey(), n.selectStart();
|
|
137
137
|
}
|
|
138
138
|
}), e) {
|
|
139
|
-
if (
|
|
139
|
+
if (R === null) z(e);
|
|
140
140
|
else {
|
|
141
141
|
let t = new Promise((e) => {
|
|
142
142
|
Q((t) => [...t, e]);
|
|
143
143
|
});
|
|
144
|
-
|
|
144
|
+
z(null), await t, z(e);
|
|
145
145
|
}
|
|
146
|
-
|
|
147
|
-
editor:
|
|
148
|
-
theme:
|
|
149
|
-
t:
|
|
150
|
-
setImageOpen:
|
|
151
|
-
setVideoOpen:
|
|
152
|
-
isSheetEnabled:
|
|
153
|
-
isQuizEnabled:
|
|
154
|
-
setFileOpen:
|
|
155
|
-
showFileUpload:
|
|
156
|
-
})),
|
|
146
|
+
G(o({
|
|
147
|
+
editor: I,
|
|
148
|
+
theme: F,
|
|
149
|
+
t: L,
|
|
150
|
+
setImageOpen: K,
|
|
151
|
+
setVideoOpen: q,
|
|
152
|
+
isSheetEnabled: M,
|
|
153
|
+
isQuizEnabled: N,
|
|
154
|
+
setFileOpen: J,
|
|
155
|
+
showFileUpload: P
|
|
156
|
+
})), W("plus");
|
|
157
157
|
}
|
|
158
158
|
},
|
|
159
159
|
onMenuClick: async () => {
|
|
160
|
-
if (!
|
|
160
|
+
if (!V) return;
|
|
161
161
|
let e = null;
|
|
162
|
-
|
|
163
|
-
if (e = _(
|
|
162
|
+
I.update(async () => {
|
|
163
|
+
if (e = _(V), !e) return;
|
|
164
164
|
let t = le();
|
|
165
|
-
if (t.add(e.getKey()),
|
|
165
|
+
if (t.add(e.getKey()), x(t), G(ve(I, e)), R === null) z(e.getKey());
|
|
166
166
|
else {
|
|
167
167
|
let t = new Promise((e) => {
|
|
168
168
|
Q((t) => [...t, e]);
|
|
169
169
|
});
|
|
170
|
-
|
|
170
|
+
z(null), await t, z(e.getKey());
|
|
171
171
|
}
|
|
172
|
-
|
|
172
|
+
W("menu");
|
|
173
173
|
});
|
|
174
174
|
},
|
|
175
175
|
onMenuDragStart: ye,
|
|
176
176
|
onMenuDragEnd: be
|
|
177
|
-
}), /* @__PURE__ */ h(
|
|
177
|
+
}), /* @__PURE__ */ h(j, { ref: xe })] }), A)
|
|
178
178
|
] });
|
|
179
179
|
}
|
|
180
|
-
var
|
|
180
|
+
var j = p.div`
|
|
181
181
|
pointer-events: none;
|
|
182
182
|
background: deepskyblue;
|
|
183
183
|
height: 4px;
|
|
@@ -188,4 +188,4 @@ var A = p.div`
|
|
|
188
188
|
will-change: transform;
|
|
189
189
|
`;
|
|
190
190
|
//#endregion
|
|
191
|
-
export {
|
|
191
|
+
export { A as ComponentAdderPlugin };
|
|
@@ -1,111 +1,111 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { useTranslation as e } from "../../../../node_modules/.pnpm/react-i18next@15.7.3_i18next@25.5.2_typescript@5.5.4__react-dom@18.2.0_react@18.2.0__react@18.2.0_typescript@5.5.4/node_modules/react-i18next/dist/es/useTranslation.js";
|
|
2
|
+
import { $isColoredQuoteNode as t } from "../../nodes/ColoredQuoteNode.js";
|
|
3
|
+
import { getComponentPickerOptions as n, getQuoteColorOptions as r, getRemoveBlockMenu as i } from "../ComponentPickerMenuPlugin/componentPickerOptionUtils.js";
|
|
4
|
+
import { useTheme as a } from "@emotion/react";
|
|
5
5
|
import { $createParagraphNode as o, ParagraphNode as s } from "lexical";
|
|
6
6
|
import { $createHeadingNode as c, $createQuoteNode as l, HeadingNode as u } from "@lexical/rich-text";
|
|
7
7
|
import { INSERT_ORDERED_LIST_COMMAND as d, INSERT_UNORDERED_LIST_COMMAND as f, ListItemNode as p, ListNode as m } from "@lexical/list";
|
|
8
8
|
import { $createCodeNode as h } from "@lexical/code";
|
|
9
9
|
import { $setBlocksType as g } from "@lexical/selection";
|
|
10
10
|
//#region src/cds/patterns/LexicalEditor/plugins/ComponentAdderPlugin/useContextMenuOptions.tsx
|
|
11
|
-
function _(e,
|
|
11
|
+
function _(e, t, r) {
|
|
12
12
|
return [
|
|
13
|
-
|
|
13
|
+
n({
|
|
14
14
|
key: "p",
|
|
15
15
|
onSelect: () => e.update(() => {
|
|
16
|
-
g(
|
|
16
|
+
g(t.selectStart(), () => o());
|
|
17
17
|
})
|
|
18
|
-
},
|
|
18
|
+
}, r),
|
|
19
19
|
...[
|
|
20
20
|
1,
|
|
21
21
|
2,
|
|
22
22
|
3
|
|
23
|
-
].map((
|
|
24
|
-
let a = `h${
|
|
25
|
-
return
|
|
23
|
+
].map((i) => {
|
|
24
|
+
let a = `h${i}`;
|
|
25
|
+
return n({
|
|
26
26
|
key: a,
|
|
27
27
|
onSelect: () => e.update(() => {
|
|
28
|
-
g(
|
|
28
|
+
g(t.selectStart(), () => c(a));
|
|
29
29
|
})
|
|
30
|
-
},
|
|
30
|
+
}, r);
|
|
31
31
|
}),
|
|
32
|
-
|
|
32
|
+
n({
|
|
33
33
|
key: "ul",
|
|
34
34
|
onSelect: () => {
|
|
35
|
-
|
|
35
|
+
t.selectStart(), e.dispatchCommand(f, void 0);
|
|
36
36
|
}
|
|
37
|
-
},
|
|
38
|
-
|
|
37
|
+
}, r),
|
|
38
|
+
n({
|
|
39
39
|
key: "ol",
|
|
40
40
|
onSelect: () => {
|
|
41
|
-
|
|
41
|
+
t.selectStart(), e.dispatchCommand(d, void 0);
|
|
42
42
|
}
|
|
43
|
-
},
|
|
44
|
-
|
|
43
|
+
}, r),
|
|
44
|
+
n({
|
|
45
45
|
key: "quote",
|
|
46
46
|
onSelect: () => e.update(() => {
|
|
47
|
-
g(
|
|
47
|
+
g(t.selectStart(), () => l());
|
|
48
48
|
})
|
|
49
|
-
},
|
|
50
|
-
|
|
49
|
+
}, r),
|
|
50
|
+
n({
|
|
51
51
|
key: "code",
|
|
52
52
|
onSelect: () => e.update(() => {
|
|
53
|
-
let e =
|
|
53
|
+
let e = t.selectStart();
|
|
54
54
|
if (e.isCollapsed()) g(e, () => h());
|
|
55
55
|
else {
|
|
56
56
|
let t = e.getTextContent(), n = h();
|
|
57
57
|
e.insertNodes([n]), e.insertRawText(t);
|
|
58
58
|
}
|
|
59
59
|
})
|
|
60
|
-
},
|
|
61
|
-
|
|
60
|
+
}, r),
|
|
61
|
+
i(e, t, r)
|
|
62
62
|
];
|
|
63
63
|
}
|
|
64
|
-
function v(e,
|
|
64
|
+
function v(e, t, r) {
|
|
65
65
|
return [...[
|
|
66
66
|
1,
|
|
67
67
|
2,
|
|
68
68
|
3
|
|
69
|
-
].map((
|
|
70
|
-
let a = `h${
|
|
71
|
-
return
|
|
69
|
+
].map((i) => {
|
|
70
|
+
let a = `h${i}`;
|
|
71
|
+
return n({
|
|
72
72
|
key: a,
|
|
73
73
|
onSelect: () => e.update(() => {
|
|
74
|
-
g(
|
|
74
|
+
g(t.selectStart(), () => c(a));
|
|
75
75
|
})
|
|
76
|
-
},
|
|
77
|
-
}),
|
|
76
|
+
}, r);
|
|
77
|
+
}), i(e, t, r)];
|
|
78
78
|
}
|
|
79
|
-
function y(e,
|
|
79
|
+
function y(e, t, r) {
|
|
80
80
|
return [
|
|
81
|
-
|
|
81
|
+
n({
|
|
82
82
|
key: "ul",
|
|
83
83
|
onSelect: () => {
|
|
84
|
-
|
|
84
|
+
t.selectStart(), e.dispatchCommand(f, void 0);
|
|
85
85
|
}
|
|
86
|
-
},
|
|
87
|
-
|
|
86
|
+
}, r),
|
|
87
|
+
n({
|
|
88
88
|
key: "ol",
|
|
89
89
|
onSelect: () => {
|
|
90
|
-
|
|
90
|
+
t.selectStart(), e.dispatchCommand(d, void 0);
|
|
91
91
|
}
|
|
92
|
-
},
|
|
93
|
-
|
|
92
|
+
}, r),
|
|
93
|
+
i(e, t, r)
|
|
94
94
|
];
|
|
95
95
|
}
|
|
96
|
-
function b(e, t,
|
|
96
|
+
function b(e, t, n, a) {
|
|
97
97
|
return [
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
98
|
+
r(e, n, "grey", a, t),
|
|
99
|
+
r(e, n, "red", a, t),
|
|
100
|
+
r(e, n, "yellow", a, t),
|
|
101
|
+
r(e, n, "blue", a, t),
|
|
102
|
+
r(e, n, "green", a, t),
|
|
103
|
+
i(e, n, a)
|
|
104
104
|
];
|
|
105
105
|
}
|
|
106
106
|
function x() {
|
|
107
|
-
let
|
|
108
|
-
return (
|
|
107
|
+
let n = a(), { t: r } = e();
|
|
108
|
+
return (e, a) => a instanceof s ? _(e, a, r) : a instanceof u ? v(e, a, r) : a instanceof m || a instanceof p ? y(e, a, r) : t(a) ? b(e, n, a, r) : [i(e, a, r)];
|
|
109
109
|
}
|
|
110
110
|
//#endregion
|
|
111
111
|
export { x as useContextMenuOptions };
|