@team-monolith/cds 1.129.2-alpha.2 → 1.130.0-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.
Files changed (105) hide show
  1. package/dist/emotion.d.ts +185 -0
  2. package/dist/index.d.ts +8 -1
  3. package/dist/patterns/LexicalEditor/LexicalCustomConfigContext.d.ts +1 -0
  4. package/dist/patterns/LexicalEditor/LexicalCustomConfigContext.js +2 -1
  5. package/dist/patterns/LexicalEditor/LexicalEditor.d.ts +4 -0
  6. package/dist/patterns/LexicalEditor/LexicalEditor.js +9 -7
  7. package/dist/patterns/LexicalEditor/Plugins.d.ts +1 -0
  8. package/dist/patterns/LexicalEditor/Plugins.js +65 -61
  9. package/dist/patterns/LexicalEditor/components/FileSelectInput.js +24 -23
  10. package/dist/patterns/LexicalEditor/components/UploadFileDialog/UploadFileDialog.js +2 -1
  11. package/dist/patterns/LexicalEditor/nodes/FileNode/CompactFileView.d.ts +7 -0
  12. package/dist/patterns/LexicalEditor/nodes/FileNode/CompactFileView.js +53 -0
  13. package/dist/patterns/LexicalEditor/nodes/FileNode/FileComponent.d.ts +0 -27
  14. package/dist/patterns/LexicalEditor/nodes/FileNode/FileComponent.js +44 -115
  15. package/dist/patterns/LexicalEditor/nodes/FileNode/FileDownloadButton.js +1 -1
  16. package/dist/patterns/LexicalEditor/nodes/FileNode/fileStyles.d.ts +27 -0
  17. package/dist/patterns/LexicalEditor/nodes/FileNode/fileStyles.js +85 -0
  18. package/dist/patterns/LexicalEditor/nodes/ImageNode/CompactImageView.d.ts +6 -0
  19. package/dist/patterns/LexicalEditor/nodes/ImageNode/CompactImageView.js +91 -0
  20. package/dist/patterns/LexicalEditor/nodes/ImageNode/ImageComponent.js +108 -102
  21. package/dist/patterns/LexicalEditor/nodes/ProblemInputNode/InputComponent.js +7 -7
  22. package/dist/patterns/LexicalEditor/nodes/ProblemSelectNode/SelectComponent.js +4 -4
  23. package/dist/patterns/LexicalEditor/nodes/SheetInputNode/InputComponent.js +4 -4
  24. package/dist/patterns/LexicalEditor/nodes/SheetSelectNode/SelectComponent/SelectComponent.js +4 -4
  25. package/dist/patterns/LexicalEditor/plugins/CompactToolbarPlugin/CompactToolbarPlugin.d.ts +1 -0
  26. package/dist/patterns/LexicalEditor/plugins/CompactToolbarPlugin/CompactToolbarPlugin.js +106 -0
  27. package/dist/patterns/LexicalEditor/plugins/CompactToolbarPlugin/compactAttachmentNodes.d.ts +8 -0
  28. package/dist/patterns/LexicalEditor/plugins/CompactToolbarPlugin/compactAttachmentNodes.js +6 -0
  29. package/dist/patterns/LexicalEditor/plugins/CompactToolbarPlugin/index.d.ts +1 -0
  30. package/dist/patterns/LexicalEditor/plugins/DragDropPastePlugin/index.js +15 -14
  31. package/dist/patterns/LexicalEditor/uploadConstants.d.ts +6 -0
  32. package/dist/patterns/LexicalEditor/uploadConstants.js +4 -0
  33. package/package.json +3 -7
  34. package/@types/emotion.d.ts +0 -197
  35. package/node_modules/react-i18next/.eslintrc.json +0 -74
  36. package/node_modules/react-i18next/.husky/pre-commit +0 -1
  37. package/node_modules/react-i18next/.prettierignore +0 -4
  38. package/node_modules/react-i18next/CHANGELOG.md +0 -1433
  39. package/node_modules/react-i18next/LICENSE +0 -22
  40. package/node_modules/react-i18next/README.md +0 -181
  41. package/node_modules/react-i18next/TransWithoutContext.d.mts +0 -1
  42. package/node_modules/react-i18next/TransWithoutContext.d.ts +0 -129
  43. package/node_modules/react-i18next/dist/amd/react-i18next.js +0 -867
  44. package/node_modules/react-i18next/dist/amd/react-i18next.min.js +0 -1
  45. package/node_modules/react-i18next/dist/commonjs/I18nextProvider.js +0 -21
  46. package/node_modules/react-i18next/dist/commonjs/Trans.js +0 -54
  47. package/node_modules/react-i18next/dist/commonjs/TransWithoutContext.js +0 -330
  48. package/node_modules/react-i18next/dist/commonjs/Translation.js +0 -19
  49. package/node_modules/react-i18next/dist/commonjs/context.js +0 -81
  50. package/node_modules/react-i18next/dist/commonjs/defaults.js +0 -26
  51. package/node_modules/react-i18next/dist/commonjs/i18nInstance.js +0 -13
  52. package/node_modules/react-i18next/dist/commonjs/index.js +0 -128
  53. package/node_modules/react-i18next/dist/commonjs/initReactI18next.js +0 -15
  54. package/node_modules/react-i18next/dist/commonjs/unescape.js +0 -32
  55. package/node_modules/react-i18next/dist/commonjs/useSSR.js +0 -34
  56. package/node_modules/react-i18next/dist/commonjs/useTranslation.js +0 -114
  57. package/node_modules/react-i18next/dist/commonjs/utils.js +0 -76
  58. package/node_modules/react-i18next/dist/commonjs/withSSR.js +0 -27
  59. package/node_modules/react-i18next/dist/commonjs/withTranslation.js +0 -39
  60. package/node_modules/react-i18next/dist/es/I18nextProvider.js +0 -15
  61. package/node_modules/react-i18next/dist/es/Trans.js +0 -43
  62. package/node_modules/react-i18next/dist/es/TransWithoutContext.js +0 -321
  63. package/node_modules/react-i18next/dist/es/Translation.js +0 -12
  64. package/node_modules/react-i18next/dist/es/context.js +0 -42
  65. package/node_modules/react-i18next/dist/es/defaults.js +0 -18
  66. package/node_modules/react-i18next/dist/es/i18nInstance.js +0 -5
  67. package/node_modules/react-i18next/dist/es/index.js +0 -18
  68. package/node_modules/react-i18next/dist/es/initReactI18next.js +0 -9
  69. package/node_modules/react-i18next/dist/es/package.json +0 -1
  70. package/node_modules/react-i18next/dist/es/unescape.js +0 -25
  71. package/node_modules/react-i18next/dist/es/useSSR.js +0 -27
  72. package/node_modules/react-i18next/dist/es/useTranslation.js +0 -107
  73. package/node_modules/react-i18next/dist/es/utils.js +0 -62
  74. package/node_modules/react-i18next/dist/es/withSSR.js +0 -20
  75. package/node_modules/react-i18next/dist/es/withTranslation.js +0 -32
  76. package/node_modules/react-i18next/dist/umd/react-i18next.js +0 -871
  77. package/node_modules/react-i18next/dist/umd/react-i18next.min.js +0 -1
  78. package/node_modules/react-i18next/helpers.d.ts +0 -3
  79. package/node_modules/react-i18next/icu.macro.d.mts +0 -1
  80. package/node_modules/react-i18next/icu.macro.d.ts +0 -103
  81. package/node_modules/react-i18next/icu.macro.js +0 -729
  82. package/node_modules/react-i18next/index.d.mts +0 -1
  83. package/node_modules/react-i18next/index.d.ts +0 -209
  84. package/node_modules/react-i18next/initReactI18next.d.mts +0 -1
  85. package/node_modules/react-i18next/initReactI18next.d.ts +0 -3
  86. package/node_modules/react-i18next/lint-staged.config.mjs +0 -4
  87. package/node_modules/react-i18next/package.json +0 -167
  88. package/node_modules/react-i18next/react-i18next.js +0 -871
  89. package/node_modules/react-i18next/react-i18next.min.js +0 -1
  90. package/node_modules/react-i18next/src/I18nextProvider.js +0 -7
  91. package/node_modules/react-i18next/src/Trans.js +0 -45
  92. package/node_modules/react-i18next/src/TransWithoutContext.js +0 -479
  93. package/node_modules/react-i18next/src/Translation.js +0 -14
  94. package/node_modules/react-i18next/src/context.js +0 -54
  95. package/node_modules/react-i18next/src/defaults.js +0 -20
  96. package/node_modules/react-i18next/src/i18nInstance.js +0 -7
  97. package/node_modules/react-i18next/src/index.js +0 -22
  98. package/node_modules/react-i18next/src/initReactI18next.js +0 -11
  99. package/node_modules/react-i18next/src/unescape.js +0 -31
  100. package/node_modules/react-i18next/src/useSSR.js +0 -33
  101. package/node_modules/react-i18next/src/useTranslation.js +0 -171
  102. package/node_modules/react-i18next/src/utils.js +0 -93
  103. package/node_modules/react-i18next/src/withSSR.js +0 -21
  104. package/node_modules/react-i18next/src/withTranslation.js +0 -35
  105. package/node_modules/react-i18next/vitest.workspace.typescript.mts +0 -52
@@ -10,30 +10,3 @@ export declare function FileComponent({ fileName, fileSize, nodeKey, fileUrl, fi
10
10
  fileUploadDate: string;
11
11
  nodeKey: NodeKey;
12
12
  }): JSX.Element;
13
- export declare const FileName: import('@emotion/styled').StyledComponent<{
14
- theme?: import('@emotion/react').Theme;
15
- as?: React.ElementType;
16
- }, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
17
- export declare function getFileIcon(fileName: string): import("@emotion/react/types/jsx-namespace").EmotionJSX.Element;
18
- export declare const FileDetailContainer: import('@emotion/styled').StyledComponent<{
19
- theme?: import('@emotion/react').Theme;
20
- as?: React.ElementType;
21
- } & {
22
- isSelected: boolean;
23
- }, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
24
- export declare const IconContainer: import('@emotion/styled').StyledComponent<{
25
- theme?: import('@emotion/react').Theme;
26
- as?: React.ElementType;
27
- }, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
28
- export declare const FileInfo: import('@emotion/styled').StyledComponent<{
29
- theme?: import('@emotion/react').Theme;
30
- as?: React.ElementType;
31
- }, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
32
- export declare const FileSize: import('@emotion/styled').StyledComponent<{
33
- theme?: import('@emotion/react').Theme;
34
- as?: React.ElementType;
35
- }, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
36
- export declare const FileOptionalInfo: import('@emotion/styled').StyledComponent<{
37
- theme?: import('@emotion/react').Theme;
38
- as?: React.ElementType;
39
- }, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -1,126 +1,55 @@
1
- import { stdin_default as e } from "../../../../icons/custom/colored/filename-all-color.js";
2
- import { stdin_default as t } from "../../../../icons/custom/colored/filename-doc-color.js";
3
- import { stdin_default as n } from "../../../../icons/custom/colored/filename-hwp-color.js";
4
- import { stdin_default as r } from "../../../../icons/custom/colored/filename-img-color.js";
5
- import { stdin_default as i } from "../../../../icons/custom/colored/filename-mp4-color.js";
6
- import { stdin_default as a } from "../../../../icons/custom/colored/filename-pdf-color.js";
7
- import { stdin_default as o } from "../../../../icons/custom/colored/filename-ppt-color.js";
8
- import { stdin_default as s } from "../../../../icons/custom/colored/filename-xls-color.js";
9
- import { stdin_default as c } from "../../../../icons/custom/colored/filename-zip-color.js";
10
- import { OverflowTooltip as l } from "../../../../components/OverflowTooltip.js";
1
+ import { OverflowTooltip as e } from "../../../../components/OverflowTooltip.js";
2
+ import { LexicalCustomConfigContext as t } from "../../LexicalCustomConfigContext.js";
3
+ import { FileDetailContainer as n, FileInfo as r, FileName as i, FileOptionalInfo as a, FileSize as o, IconContainer as s, getFileIcon as c } from "./fileStyles.js";
4
+ import { CompactFileView as l } from "./CompactFileView.js";
11
5
  import { FileDownloadButton as u } from "./FileDownloadButton.js";
12
6
  import { $isFileNode as d } from "./FileNode.js";
13
- import { css as f } from "@emotion/react";
14
- import { useCallback as p, useEffect as m, useRef as h } from "react";
15
- import g from "@emotion/styled";
16
- import { Fragment as _, jsx as v, jsxs as y } from "@emotion/react/jsx-runtime";
17
- import { $getSelection as b, $isNodeSelection as x, CLICK_COMMAND as S, COMMAND_PRIORITY_LOW as C, KEY_BACKSPACE_COMMAND as w, KEY_DELETE_COMMAND as T } from "lexical";
18
- import { mergeRegister as E } from "@lexical/utils";
19
- import { useLexicalComposerContext as D } from "@lexical/react/LexicalComposerContext";
20
- import { useLexicalNodeSelection as O } from "@lexical/react/useLexicalNodeSelection";
21
- import { useLexicalEditable as k } from "@lexical/react/useLexicalEditable";
7
+ import { useCallback as f, useContext as p, useEffect as m, useRef as h } from "react";
8
+ import { Fragment as g, jsx as _, jsxs as v } from "@emotion/react/jsx-runtime";
9
+ import { $getSelection as y, $isNodeSelection as b, CLICK_COMMAND as x, COMMAND_PRIORITY_LOW as S, KEY_BACKSPACE_COMMAND as C, KEY_DELETE_COMMAND as w } from "lexical";
10
+ import { mergeRegister as T } from "@lexical/utils";
11
+ import { useLexicalComposerContext as E } from "@lexical/react/LexicalComposerContext";
12
+ import { useLexicalNodeSelection as D } from "@lexical/react/useLexicalNodeSelection";
13
+ import { useLexicalEditable as O } from "@lexical/react/useLexicalEditable";
22
14
  //#region src/cds/patterns/LexicalEditor/nodes/FileNode/FileComponent.tsx
23
- function A({ fileName: e, fileSize: t, nodeKey: n, fileUrl: r, fileUploadDate: i }) {
24
- let [a] = D(), [o, s, c] = O(n), f = h(null), g = k(), A = p((e) => {
25
- let t = b();
26
- return o && x(t) && (e.preventDefault(), a.update(() => {
15
+ function k({ fileName: k, fileSize: A, nodeKey: j, fileUrl: M, fileUploadDate: N }) {
16
+ let [P] = E(), [F, I, L] = D(j), R = h(null), z = O(), { compactEditorMode: B } = p(t), V = f((e) => {
17
+ let t = y();
18
+ return F && b(t) && (e.preventDefault(), P.update(() => {
27
19
  t.getNodes().forEach((e) => {
28
20
  d(e) && e.remove();
29
21
  });
30
22
  })), !1;
31
- }, [a, o]);
32
- return m(() => E(a.registerCommand(S, (e) => f.current && f.current.contains(e.target) ? (e.shiftKey || c(), s(!0), !0) : !1, C), a.registerCommand(T, A, C), a.registerCommand(w, A, C)), [
33
- c,
34
- a,
35
- o,
36
- n,
37
- A,
38
- s
39
- ]), /* @__PURE__ */ v(_, { children: g ? /* @__PURE__ */ v(N, {
40
- isSelected: o,
41
- ref: f,
42
- children: /* @__PURE__ */ y(F, { children: [
43
- /* @__PURE__ */ v(P, { children: M(e) }),
44
- /* @__PURE__ */ v(j, { children: /* @__PURE__ */ v(l, { text: e }) }),
45
- /* @__PURE__ */ v(L, { children: i }),
46
- /* @__PURE__ */ y(I, { children: [(t / (1024 * 1024)).toFixed(1), " MB"] })
23
+ }, [P, F]);
24
+ return m(() => {
25
+ if (!B) return T(P.registerCommand(x, (e) => R.current && R.current.contains(e.target) ? (e.shiftKey || L(), I(!0), !0) : !1, S), P.registerCommand(w, V, S), P.registerCommand(C, V, S));
26
+ }, [
27
+ L,
28
+ P,
29
+ F,
30
+ j,
31
+ V,
32
+ I,
33
+ B
34
+ ]), B && z ? /* @__PURE__ */ _(l, {
35
+ fileName: k,
36
+ fileSize: A,
37
+ fileUploadDate: N,
38
+ nodeKey: j
39
+ }) : /* @__PURE__ */ _(g, { children: z ? /* @__PURE__ */ _(n, {
40
+ isSelected: F,
41
+ ref: R,
42
+ children: /* @__PURE__ */ v(r, { children: [
43
+ /* @__PURE__ */ _(s, { children: c(k) }),
44
+ /* @__PURE__ */ _(i, { children: /* @__PURE__ */ _(e, { text: k }) }),
45
+ /* @__PURE__ */ _(a, { children: N }),
46
+ /* @__PURE__ */ v(o, { children: [(A / (1024 * 1024)).toFixed(1), " MB"] })
47
47
  ] })
48
- }) : /* @__PURE__ */ v(u, {
49
- fileName: e,
50
- fileUrl: r,
51
- fileSize: t
48
+ }) : /* @__PURE__ */ _(u, {
49
+ fileName: k,
50
+ fileUrl: M,
51
+ fileSize: A
52
52
  }) });
53
53
  }
54
- var j = g.div`
55
- flex: 1;
56
- overflow: hidden;
57
- `;
58
- function M(l) {
59
- switch (l.split(".").pop()?.toLowerCase()) {
60
- case "zip":
61
- case "rar":
62
- case "7z": return /* @__PURE__ */ v(c, {});
63
- case "ppt":
64
- case "pptx": return /* @__PURE__ */ v(o, {});
65
- case "xlsx":
66
- case "xls": return /* @__PURE__ */ v(s, {});
67
- case "hwp": return /* @__PURE__ */ v(n, {});
68
- case "doc":
69
- case "docx": return /* @__PURE__ */ v(t, {});
70
- case "png":
71
- case "jpg":
72
- case "jpeg":
73
- case "gif":
74
- case "bmp": return /* @__PURE__ */ v(r, {});
75
- case "mp4":
76
- case "avi":
77
- case "mov":
78
- case "wmv": return /* @__PURE__ */ v(i, {});
79
- case "pdf": return /* @__PURE__ */ v(a, {});
80
- default: return /* @__PURE__ */ v(e, {});
81
- }
82
- }
83
- var N = g.div(({ isSelected: e, theme: t }) => f`
84
- display: flex;
85
- flex-direction: column;
86
- width: 620px;
87
- min-width: 400px;
88
- background: ${e ? t.color.background.neutralAltActive : t.color.background.neutralAlt};
89
- border-radius: 10px;
90
- `), P = g.div`
91
- flex-shrink: 0;
92
- width: 24px;
93
- height: 24px;
94
- `, F = g.div(({ theme: e }) => f`
95
- display: flex;
96
- padding: 16px;
97
- align-items: center;
98
- height: 48px;
99
- gap: 8px;
100
- color: ${e.color.foreground.neutralBase};
101
- font-family: ${e.fontFamily.ui};
102
- font-size: 16px;
103
- font-weight: 500;
104
- line-height: 20px; /* 125% */
105
- border-radius: 10px;
106
- cursor: pointer;
107
- `), I = g.span(({ theme: e }) => f`
108
- flex-shrink: 0;
109
- margin-left: auto;
110
- color: ${e.color.foreground.neutralBaseDisabled};
111
- font-family: ${e.fontFamily.ui};
112
- font-size: 14px;
113
- font-weight: 400;
114
- line-height: 20px; /* 142.857% */
115
- `), L = g.div(({ theme: e }) => f`
116
- font-family: ${e.fontFamily.ui};
117
- font-size: 14px;
118
- font-style: normal;
119
- font-weight: 400;
120
- line-height: 20px;
121
- color: ${e.color.foreground.neutralBaseDisabled};
122
- text-align: right;
123
- flex-shrink: 0;
124
- `);
125
54
  //#endregion
126
- export { A as FileComponent, I as FileSize, P as IconContainer, M as getFileIcon };
55
+ export { k as FileComponent };
@@ -1,7 +1,7 @@
1
1
  import { HOVER as e } from "../../../../utils/hover.js";
2
2
  import { OverflowTooltip as t } from "../../../../components/OverflowTooltip.js";
3
3
  import { CdsContext as n } from "../../../../CdsProvider.js";
4
- import { FileSize as r, IconContainer as i, getFileIcon as a } from "./FileComponent.js";
4
+ import { FileSize as r, IconContainer as i, getFileIcon as a } from "./fileStyles.js";
5
5
  import { css as o, useTheme as s } from "@emotion/react";
6
6
  import { useContext as c } from "react";
7
7
  import l from "@emotion/styled";
@@ -0,0 +1,27 @@
1
+ export declare function getFileIcon(fileName: string): import("@emotion/react/types/jsx-namespace").EmotionJSX.Element;
2
+ export declare const FileName: import('@emotion/styled').StyledComponent<{
3
+ theme?: import('@emotion/react').Theme;
4
+ as?: React.ElementType;
5
+ }, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
6
+ export declare const FileDetailContainer: import('@emotion/styled').StyledComponent<{
7
+ theme?: import('@emotion/react').Theme;
8
+ as?: React.ElementType;
9
+ } & {
10
+ isSelected: boolean;
11
+ }, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
12
+ export declare const IconContainer: import('@emotion/styled').StyledComponent<{
13
+ theme?: import('@emotion/react').Theme;
14
+ as?: React.ElementType;
15
+ }, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
16
+ export declare const FileInfo: import('@emotion/styled').StyledComponent<{
17
+ theme?: import('@emotion/react').Theme;
18
+ as?: React.ElementType;
19
+ }, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
20
+ export declare const FileSize: import('@emotion/styled').StyledComponent<{
21
+ theme?: import('@emotion/react').Theme;
22
+ as?: React.ElementType;
23
+ }, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
24
+ export declare const FileOptionalInfo: import('@emotion/styled').StyledComponent<{
25
+ theme?: import('@emotion/react').Theme;
26
+ as?: React.ElementType;
27
+ }, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -0,0 +1,85 @@
1
+ import { stdin_default as e } from "../../../../icons/custom/colored/filename-all-color.js";
2
+ import { stdin_default as t } from "../../../../icons/custom/colored/filename-doc-color.js";
3
+ import { stdin_default as n } from "../../../../icons/custom/colored/filename-hwp-color.js";
4
+ import { stdin_default as r } from "../../../../icons/custom/colored/filename-img-color.js";
5
+ import { stdin_default as i } from "../../../../icons/custom/colored/filename-mp4-color.js";
6
+ import { stdin_default as a } from "../../../../icons/custom/colored/filename-pdf-color.js";
7
+ import { stdin_default as o } from "../../../../icons/custom/colored/filename-ppt-color.js";
8
+ import { stdin_default as s } from "../../../../icons/custom/colored/filename-xls-color.js";
9
+ import { stdin_default as c } from "../../../../icons/custom/colored/filename-zip-color.js";
10
+ import { css as l } from "@emotion/react";
11
+ import u from "@emotion/styled";
12
+ import { jsx as d } from "@emotion/react/jsx-runtime";
13
+ //#region src/cds/patterns/LexicalEditor/nodes/FileNode/fileStyles.tsx
14
+ function f(l) {
15
+ switch (l.split(".").pop()?.toLowerCase()) {
16
+ case "zip":
17
+ case "rar":
18
+ case "7z": return /* @__PURE__ */ d(c, {});
19
+ case "ppt":
20
+ case "pptx": return /* @__PURE__ */ d(o, {});
21
+ case "xlsx":
22
+ case "xls": return /* @__PURE__ */ d(s, {});
23
+ case "hwp": return /* @__PURE__ */ d(n, {});
24
+ case "doc":
25
+ case "docx": return /* @__PURE__ */ d(t, {});
26
+ case "png":
27
+ case "jpg":
28
+ case "jpeg":
29
+ case "gif":
30
+ case "bmp": return /* @__PURE__ */ d(r, {});
31
+ case "mp4":
32
+ case "avi":
33
+ case "mov":
34
+ case "wmv": return /* @__PURE__ */ d(i, {});
35
+ case "pdf": return /* @__PURE__ */ d(a, {});
36
+ default: return /* @__PURE__ */ d(e, {});
37
+ }
38
+ }
39
+ var p = u.div`
40
+ flex: 1;
41
+ overflow: hidden;
42
+ `, m = u.div(({ isSelected: e, theme: t }) => l`
43
+ display: flex;
44
+ flex-direction: column;
45
+ width: 620px;
46
+ min-width: 400px;
47
+ background: ${e ? t.color.background.neutralAltActive : t.color.background.neutralAlt};
48
+ border-radius: 10px;
49
+ `), h = u.div`
50
+ flex-shrink: 0;
51
+ width: 24px;
52
+ height: 24px;
53
+ `, g = u.div(({ theme: e }) => l`
54
+ display: flex;
55
+ padding: 16px;
56
+ align-items: center;
57
+ height: 48px;
58
+ gap: 8px;
59
+ color: ${e.color.foreground.neutralBase};
60
+ font-family: ${e.fontFamily.ui};
61
+ font-size: 16px;
62
+ font-weight: 500;
63
+ line-height: 20px; /* 125% */
64
+ border-radius: 10px;
65
+ cursor: pointer;
66
+ `), _ = u.span(({ theme: e }) => l`
67
+ flex-shrink: 0;
68
+ margin-left: auto;
69
+ color: ${e.color.foreground.neutralBaseDisabled};
70
+ font-family: ${e.fontFamily.ui};
71
+ font-size: 14px;
72
+ font-weight: 400;
73
+ line-height: 20px; /* 142.857% */
74
+ `), v = u.div(({ theme: e }) => l`
75
+ font-family: ${e.fontFamily.ui};
76
+ font-size: 14px;
77
+ font-style: normal;
78
+ font-weight: 400;
79
+ line-height: 20px;
80
+ color: ${e.color.foreground.neutralBaseDisabled};
81
+ text-align: right;
82
+ flex-shrink: 0;
83
+ `);
84
+ //#endregion
85
+ export { m as FileDetailContainer, g as FileInfo, p as FileName, v as FileOptionalInfo, _ as FileSize, h as IconContainer, f as getFileIcon };
@@ -0,0 +1,6 @@
1
+ import { NodeKey } from 'lexical';
2
+ export declare function CompactImageView({ src, altText, nodeKey, }: {
3
+ src: string;
4
+ altText: string;
5
+ nodeKey: NodeKey;
6
+ }): JSX.Element;
@@ -0,0 +1,91 @@
1
+ import { stdin_default as e } from "../../../../node_modules/.pnpm/remixicon@4.3.0/node_modules/remixicon/icons/System/delete-bin-line.js";
2
+ import { css as t } from "@emotion/react";
3
+ import { useState as n } from "react";
4
+ import r from "@emotion/styled";
5
+ import { jsx as i, jsxs as a } from "@emotion/react/jsx-runtime";
6
+ import { useTranslation as o } from "react-i18next";
7
+ import { $getNodeByKey as s } from "lexical";
8
+ import { useLexicalComposerContext as c } from "@lexical/react/LexicalComposerContext";
9
+ import { useLexicalEditable as l } from "@lexical/react/useLexicalEditable";
10
+ //#region src/cds/patterns/LexicalEditor/nodes/ImageNode/CompactImageView.tsx
11
+ function u({ src: t, altText: r, nodeKey: u }) {
12
+ let [g] = c(), _ = l(), [v, y] = n(!1), { t: b } = o();
13
+ return v ? /* @__PURE__ */ i(h, { children: r || b("이미지를 불러올 수 없습니다.") }) : _ ? /* @__PURE__ */ a(d, { children: [/* @__PURE__ */ i(p, {
14
+ src: t,
15
+ alt: r,
16
+ onError: () => y(!0)
17
+ }), /* @__PURE__ */ i(m, {
18
+ type: "button",
19
+ onClick: () => {
20
+ g.update(() => {
21
+ s(u)?.remove();
22
+ });
23
+ },
24
+ "aria-label": b("삭제", { context: "버튼, 게시글 본문 이미지" }),
25
+ children: /* @__PURE__ */ i(e, {})
26
+ })] }) : /* @__PURE__ */ i(f, {
27
+ type: "button",
28
+ onClick: () => window.open(t, "_blank", "noopener"),
29
+ title: b("클릭해서 원본 이미지 보기"),
30
+ children: /* @__PURE__ */ i(p, {
31
+ src: t,
32
+ alt: r,
33
+ onError: () => y(!0)
34
+ })
35
+ });
36
+ }
37
+ var d = r.div`
38
+ position: relative;
39
+ display: inline-block;
40
+ max-width: 100%;
41
+ `, f = r.button`
42
+ display: inline-block;
43
+ max-width: 100%;
44
+ padding: 0;
45
+ border: 0;
46
+ background: transparent;
47
+ cursor: pointer;
48
+ `, p = r.img`
49
+ display: block;
50
+ max-width: 100%;
51
+ max-height: 400px;
52
+ height: auto;
53
+ object-fit: contain;
54
+ border-radius: 10px;
55
+ `, m = r.button(({ theme: e }) => t`
56
+ position: absolute;
57
+ top: 8px;
58
+ right: 8px;
59
+ display: flex;
60
+ align-items: center;
61
+ justify-content: center;
62
+ width: 28px;
63
+ height: 28px;
64
+ padding: 0;
65
+ border: 0;
66
+ border-radius: 6px;
67
+ background: ${e.color.background.neutralAlt};
68
+ color: ${e.color.foreground.neutralBase};
69
+ cursor: pointer;
70
+ opacity: 0.9;
71
+
72
+ &:hover {
73
+ opacity: 1;
74
+ }
75
+ `), h = r.div(({ theme: e }) => t`
76
+ display: flex;
77
+ align-items: center;
78
+ justify-content: center;
79
+ width: 100%;
80
+ min-height: 80px;
81
+ padding: 16px;
82
+ border-radius: 10px;
83
+ background: ${e.color.background.neutralAlt};
84
+ color: ${e.color.foreground.neutralBaseDisabled};
85
+ font-family: ${e.fontFamily.ui};
86
+ font-size: 14px;
87
+ font-weight: 400;
88
+ line-height: 20px;
89
+ `);
90
+ //#endregion
91
+ export { u as CompactImageView };