@team-monolith/cds 0.29.28 → 0.29.30
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.
|
@@ -2,5 +2,7 @@
|
|
|
2
2
|
declare const Layout: import("@emotion/styled").StyledComponent<{
|
|
3
3
|
theme?: import("@emotion/react").Theme | undefined;
|
|
4
4
|
as?: import("react").ElementType<any> | undefined;
|
|
5
|
+
} & {
|
|
6
|
+
readOnly?: boolean | undefined;
|
|
5
7
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
6
8
|
export default Layout;
|
|
@@ -2,12 +2,12 @@ import { css } from "@emotion/react";
|
|
|
2
2
|
import styled from "@emotion/styled";
|
|
3
3
|
import { hexToCSSFilter } from "hex-to-css-filter";
|
|
4
4
|
import { CalloutStyle, DelimiterStyle, HeaderStyle, NestedListStyle, QuoteStyle, RawStyle, } from "./customTools";
|
|
5
|
-
const Layout = styled.div(({ theme }) => css `
|
|
5
|
+
const Layout = styled.div(({ theme, readOnly }) => css `
|
|
6
6
|
.codex-editor__redactor {
|
|
7
7
|
padding-bottom: 0 !important;
|
|
8
8
|
}
|
|
9
9
|
.ce-block {
|
|
10
|
-
margin-left:
|
|
10
|
+
margin-left: ${readOnly ? "0" : "58px"};
|
|
11
11
|
}
|
|
12
12
|
.ce-block__content {
|
|
13
13
|
margin: 0;
|
|
@@ -62,7 +62,7 @@ export function ReactEditorJS(props) {
|
|
|
62
62
|
// readOnly가 변경되면 ReactEditorJS를 다시 마운트하기 위해 key를 변경합니다.
|
|
63
63
|
// readOnly 모드에서는 onChange를 전달할 수 없어서 케이스를 분리합니다.
|
|
64
64
|
if (readOnly) {
|
|
65
|
-
return (_jsx(Layout, Object.assign({ className: className }, { children: _jsx(ReactEditorJS, { onInitialize: handleInitialize, tools: TOOLS, defaultValue: {
|
|
65
|
+
return (_jsx(Layout, Object.assign({ className: className, readOnly: true }, { children: _jsx(ReactEditorJS, { onInitialize: handleInitialize, tools: TOOLS, defaultValue: {
|
|
66
66
|
blocks,
|
|
67
67
|
}, i18n: I18n, readOnly: true }, "readOnly") })));
|
|
68
68
|
}
|
|
@@ -158,13 +158,14 @@ export class Quote {
|
|
|
158
158
|
title: "Quote",
|
|
159
159
|
};
|
|
160
160
|
}
|
|
161
|
+
// TODO: 현재 onPaste 작동하지 않습니다.
|
|
161
162
|
onPaste(event) {
|
|
162
163
|
const content = event.detail.data;
|
|
163
164
|
this._wrapper.innerHTML = content.textContent;
|
|
164
165
|
}
|
|
165
166
|
static get pasteConfig() {
|
|
166
167
|
return {
|
|
167
|
-
tags: ["
|
|
168
|
+
tags: ["blockquote"],
|
|
168
169
|
};
|
|
169
170
|
}
|
|
170
171
|
}
|