@synerise/ds-code-area 1.0.5 → 1.0.7
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/CHANGELOG.md +19 -0
- package/dist/CodeArea.js +7 -7
- package/dist/CodeArea.styles.d.ts +5 -1
- package/dist/CodeArea.styles.js +31 -25
- package/dist/CodeArea.types.d.ts +5 -1
- package/dist/components/AriaContainer.js +2 -1
- package/dist/components/CodeAreaEditor.d.ts +1 -1
- package/dist/components/CodeAreaEditor.js +6 -4
- package/dist/components/CodeAreaEditorRaw.js +2 -2
- package/dist/components/ContentAbove.js +2 -2
- package/dist/components/ContentBelow.js +4 -2
- package/dist/utils/getDefaultTexts.js +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.0.7](https://github.com/Synerise/synerise-design/compare/@synerise/ds-code-area@1.0.6...@synerise/ds-code-area@1.0.7) (2025-04-08)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **code-area:** allow component wrapper to have variable height ([7a15e3b](https://github.com/Synerise/synerise-design/commit/7a15e3b8622af0eb625e866fda8a7a3f041a2e40))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [1.0.6](https://github.com/Synerise/synerise-design/compare/@synerise/ds-code-area@1.0.5...@synerise/ds-code-area@1.0.6) (2025-04-04)
|
|
18
|
+
|
|
19
|
+
**Note:** Version bump only for package @synerise/ds-code-area
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
## [1.0.5](https://github.com/Synerise/synerise-design/compare/@synerise/ds-code-area@1.0.4...@synerise/ds-code-area@1.0.5) (2025-04-02)
|
|
7
26
|
|
|
8
27
|
**Note:** Version bump only for package @synerise/ds-code-area
|
package/dist/CodeArea.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var _excluded = ["getPopupContainer", "onFullscreenChange"];
|
|
2
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
3
|
-
function _objectWithoutPropertiesLoose(
|
|
2
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
4
4
|
import React, { useRef, useState } from 'react';
|
|
5
5
|
import { createPortal } from 'react-dom';
|
|
6
6
|
import { getPopupContainer as defaultGetPopupContainer } from '@synerise/ds-utils';
|
|
@@ -20,14 +20,14 @@ var CodeArea = function CodeArea(_ref) {
|
|
|
20
20
|
});
|
|
21
21
|
onFullscreenChange && onFullscreenChange(isFullscreen);
|
|
22
22
|
};
|
|
23
|
-
return /*#__PURE__*/React.createElement(
|
|
24
|
-
ref: wrapperRef
|
|
25
|
-
}, /*#__PURE__*/React.createElement(CodeAreaEditor, _extends({}, codeAreaProps, {
|
|
23
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CodeAreaEditor, _extends({}, codeAreaProps, {
|
|
26
24
|
toggleFullscreen: toggleFullscreen,
|
|
27
25
|
isFullscreen: false
|
|
28
|
-
})),
|
|
26
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
27
|
+
ref: wrapperRef
|
|
28
|
+
}, wrapperRef.current && isFullscreen && /*#__PURE__*/createPortal(/*#__PURE__*/React.createElement(CodeAreaEditor, _extends({}, codeAreaProps, {
|
|
29
29
|
toggleFullscreen: toggleFullscreen,
|
|
30
30
|
isFullscreen: isFullscreen
|
|
31
|
-
})), getPopupContainer(wrapperRef.current)));
|
|
31
|
+
})), getPopupContainer(wrapperRef.current))));
|
|
32
32
|
};
|
|
33
33
|
export default CodeArea;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
export declare const AriaContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
3
|
export declare const EditorInnerWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
4
|
export declare const CodeAreaContent: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
5
|
export declare const EditorWrapper: import("styled-components").StyledComponent<"div", any, {
|
|
@@ -10,10 +11,13 @@ export declare const CodeAreaWrapper: import("styled-components").StyledComponen
|
|
|
10
11
|
readOnly: boolean;
|
|
11
12
|
isFullscreen: boolean;
|
|
12
13
|
requiredSpace: number;
|
|
14
|
+
customHeight?: string | number | undefined;
|
|
13
15
|
zIndex?: string | number | undefined;
|
|
14
16
|
}, never>;
|
|
15
17
|
export declare const AdditionalDescription: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
16
|
-
export declare const ContentBelow: import("styled-components").StyledComponent<"div", any, {
|
|
18
|
+
export declare const ContentBelow: import("styled-components").StyledComponent<"div", any, {
|
|
19
|
+
isEmpty?: boolean | undefined;
|
|
20
|
+
}, never>;
|
|
17
21
|
export declare const ContentAbove: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
18
22
|
export declare const SyntaxTitle: import("styled-components").StyledComponent<({ size, className, children, ellipsis }: {
|
|
19
23
|
size?: import("@synerise/ds-typography").TextSize | undefined;
|
package/dist/CodeArea.styles.js
CHANGED
|
@@ -4,90 +4,96 @@ var FlexRow = styled.div.withConfig({
|
|
|
4
4
|
displayName: "CodeAreastyles__FlexRow",
|
|
5
5
|
componentId: "sc-svoej2-0"
|
|
6
6
|
})(["display:flex;justify-content:space-between;align-items:center;"]);
|
|
7
|
+
export var AriaContainer = styled.div.withConfig({
|
|
8
|
+
displayName: "CodeAreastyles__AriaContainer",
|
|
9
|
+
componentId: "sc-svoej2-1"
|
|
10
|
+
})(["flex:0 0 0;"]);
|
|
7
11
|
export var EditorInnerWrapper = styled.div.withConfig({
|
|
8
12
|
displayName: "CodeAreastyles__EditorInnerWrapper",
|
|
9
|
-
componentId: "sc-svoej2-1"
|
|
10
|
-
})(["height:295px;"]);
|
|
11
|
-
export var CodeAreaContent = styled.div.withConfig({
|
|
12
|
-
displayName: "CodeAreastyles__CodeAreaContent",
|
|
13
13
|
componentId: "sc-svoej2-2"
|
|
14
14
|
})([""]);
|
|
15
|
+
export var CodeAreaContent = styled.div.withConfig({
|
|
16
|
+
displayName: "CodeAreastyles__CodeAreaContent",
|
|
17
|
+
componentId: "sc-svoej2-3"
|
|
18
|
+
})(["flex:1 1 100%;display:flex;min-height:0;flex-direction:column;"]);
|
|
15
19
|
export var EditorWrapper = styled.div.withConfig({
|
|
16
20
|
displayName: "CodeAreastyles__EditorWrapper",
|
|
17
|
-
componentId: "sc-svoej2-
|
|
18
|
-
})(["border:solid 1px ", ";border-radius:3px;padding-top:12px;", ";canvas{opacity:0;}"], function (props) {
|
|
21
|
+
componentId: "sc-svoej2-4"
|
|
22
|
+
})(["border:solid 1px ", ";border-radius:3px;display:flex;flex-direction:column;flex:1 1 100%;min-height:0;padding-top:12px;", ";canvas{opacity:0;}"], function (props) {
|
|
19
23
|
return props.hasError ? props.theme.palette['red-600'] : props.theme.palette['grey-200'];
|
|
20
24
|
}, function (props) {
|
|
21
25
|
return props.hasError && css(["background:", ";box-shadow:inset 0 0 0 1px ", ";"], props.theme.palette['red-050'], props.theme.palette['red-600']);
|
|
22
26
|
});
|
|
23
27
|
export var FullscreenHeaderTitle = styled(Title).withConfig({
|
|
24
28
|
displayName: "CodeAreastyles__FullscreenHeaderTitle",
|
|
25
|
-
componentId: "sc-svoej2-
|
|
29
|
+
componentId: "sc-svoej2-5"
|
|
26
30
|
})(["display:flex;gap:16px;align-items:center;margin-bottom:0;"]);
|
|
27
31
|
export var FullscreenHeader = styled(FlexRow).withConfig({
|
|
28
32
|
displayName: "CodeAreastyles__FullscreenHeader",
|
|
29
|
-
componentId: "sc-svoej2-
|
|
33
|
+
componentId: "sc-svoej2-6"
|
|
30
34
|
})(["padding:16px 24px;"]);
|
|
31
35
|
export var CodeAreaWrapper = styled.div.withConfig({
|
|
32
36
|
displayName: "CodeAreastyles__CodeAreaWrapper",
|
|
33
|
-
componentId: "sc-svoej2-
|
|
37
|
+
componentId: "sc-svoej2-7"
|
|
34
38
|
})(["", " ", "{", ";}"], function (props) {
|
|
35
39
|
if (props.isFullscreen) {
|
|
36
40
|
return css(["position:fixed;width:100vw;height:100vh;z-index:", ";left:0;top:0;background:", ";", "{height:calc(100vh - ", "px);}", "{margin:0 24px;}"], props.zIndex !== undefined ? props.zIndex : props.theme.variables['zindex-modal'], props.theme.palette.white, EditorInnerWrapper, props.requiredSpace, CodeAreaContent);
|
|
37
41
|
}
|
|
38
|
-
return css(["margin-bottom:12px;"]);
|
|
42
|
+
return css(["", " display:flex;flex-direction:column;margin-bottom:12px;"], props.customHeight ? css(["", "{flex:1 1 100%;min-height:0;}height:", ";"], EditorInnerWrapper, typeof props.customHeight === 'number' ? props.customHeight + "px" : props.customHeight) : css(["", "{height:295px;}"], EditorInnerWrapper));
|
|
39
43
|
}, EditorWrapper, function (props) {
|
|
40
44
|
return props.readOnly && css(["background:", ";.monaco-editor .cursors-layer > .cursor{display:none !important;}"], props.theme.palette['grey-050']);
|
|
41
45
|
});
|
|
42
46
|
export var AdditionalDescription = styled.div.withConfig({
|
|
43
47
|
displayName: "CodeAreastyles__AdditionalDescription",
|
|
44
|
-
componentId: "sc-svoej2-
|
|
48
|
+
componentId: "sc-svoej2-8"
|
|
45
49
|
})(["margin-bottom:8px;"]);
|
|
46
50
|
export var ContentBelow = styled(FlexRow).withConfig({
|
|
47
51
|
displayName: "CodeAreastyles__ContentBelow",
|
|
48
|
-
componentId: "sc-svoej2-
|
|
49
|
-
})(["
|
|
52
|
+
componentId: "sc-svoej2-9"
|
|
53
|
+
})(["", " align-items:flex-start;"], function (props) {
|
|
54
|
+
return !props.isEmpty && "margin-top: 8px;";
|
|
55
|
+
});
|
|
50
56
|
export var ContentAbove = styled(FlexRow).withConfig({
|
|
51
57
|
displayName: "CodeAreastyles__ContentAbove",
|
|
52
|
-
componentId: "sc-svoej2-
|
|
53
|
-
})(["margin-bottom:8px;"]);
|
|
58
|
+
componentId: "sc-svoej2-10"
|
|
59
|
+
})(["margin-bottom:8px;flex:0 0 auto;"]);
|
|
54
60
|
export var SyntaxTitle = styled(Text).withConfig({
|
|
55
61
|
displayName: "CodeAreastyles__SyntaxTitle",
|
|
56
|
-
componentId: "sc-svoej2-
|
|
62
|
+
componentId: "sc-svoej2-11"
|
|
57
63
|
})([""]);
|
|
58
64
|
export var BottomBar = styled(FlexRow).withConfig({
|
|
59
65
|
displayName: "CodeAreastyles__BottomBar",
|
|
60
|
-
componentId: "sc-svoej2-
|
|
61
|
-
})(["border-top:solid 1px ", ";padding:8px;"], function (props) {
|
|
66
|
+
componentId: "sc-svoej2-12"
|
|
67
|
+
})(["border-top:solid 1px ", ";padding:8px;flex:0 0 auto;"], function (props) {
|
|
62
68
|
return props.theme.palette['grey-200'];
|
|
63
69
|
});
|
|
64
70
|
export var LeftSide = styled.div.withConfig({
|
|
65
71
|
displayName: "CodeAreastyles__LeftSide",
|
|
66
|
-
componentId: "sc-svoej2-
|
|
72
|
+
componentId: "sc-svoej2-13"
|
|
67
73
|
})([""]);
|
|
68
74
|
export var RightSide = styled.div.withConfig({
|
|
69
75
|
displayName: "CodeAreastyles__RightSide",
|
|
70
|
-
componentId: "sc-svoej2-
|
|
76
|
+
componentId: "sc-svoej2-14"
|
|
71
77
|
})(["margin-left:auto;display:flex;gap:8px;"]);
|
|
72
78
|
export var SyntaxSelect = styled(LeftSide).withConfig({
|
|
73
79
|
displayName: "CodeAreastyles__SyntaxSelect",
|
|
74
|
-
componentId: "sc-svoej2-
|
|
80
|
+
componentId: "sc-svoej2-15"
|
|
75
81
|
})(["padding-left:8px;"]);
|
|
76
82
|
export var BottomBarElement = styled.div.withConfig({
|
|
77
83
|
displayName: "CodeAreastyles__BottomBarElement",
|
|
78
|
-
componentId: "sc-svoej2-
|
|
84
|
+
componentId: "sc-svoej2-16"
|
|
79
85
|
})([""]);
|
|
80
86
|
export var Description = styled.div.withConfig({
|
|
81
87
|
displayName: "CodeAreastyles__Description",
|
|
82
|
-
componentId: "sc-svoej2-
|
|
88
|
+
componentId: "sc-svoej2-17"
|
|
83
89
|
})([""]);
|
|
84
90
|
export var Counter = styled.div.withConfig({
|
|
85
91
|
displayName: "CodeAreastyles__Counter",
|
|
86
|
-
componentId: "sc-svoej2-
|
|
92
|
+
componentId: "sc-svoej2-18"
|
|
87
93
|
})(["font-weight:500;"]);
|
|
88
94
|
export var ErrorText = styled.div.withConfig({
|
|
89
95
|
displayName: "CodeAreastyles__ErrorText",
|
|
90
|
-
componentId: "sc-svoej2-
|
|
96
|
+
componentId: "sc-svoej2-19"
|
|
91
97
|
})(["color:", ";margin-bottom:4px;"], function (props) {
|
|
92
98
|
return props.theme.palette['red-600'];
|
|
93
99
|
});
|
package/dist/CodeArea.types.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export type CodeAreaTexts = {
|
|
|
13
13
|
closeFullscreen: ReactNode;
|
|
14
14
|
fullscreenTitle: ReactNode;
|
|
15
15
|
};
|
|
16
|
-
export type CodeAreaCommonProps<SyntaxName extends CodeAreaSyntax = CodeAreaSyntax> = Omit<EditorProps, 'language'> & {
|
|
16
|
+
export type CodeAreaCommonProps<SyntaxName extends CodeAreaSyntax = CodeAreaSyntax> = Omit<EditorProps, 'language' | 'height'> & {
|
|
17
17
|
label?: ReactNode;
|
|
18
18
|
description?: ReactNode;
|
|
19
19
|
texts?: Partial<CodeAreaTexts>;
|
|
@@ -34,6 +34,10 @@ export type CodeAreaCommonProps<SyntaxName extends CodeAreaSyntax = CodeAreaSynt
|
|
|
34
34
|
tooltipProps?: TooltipExtendedProps & TooltipProps;
|
|
35
35
|
style?: CSSProperties;
|
|
36
36
|
zIndex?: string | number;
|
|
37
|
+
/**
|
|
38
|
+
* Height of the editor wrapper
|
|
39
|
+
*/
|
|
40
|
+
height?: string | number;
|
|
37
41
|
className?: string;
|
|
38
42
|
renderFooterContent?: (props: {
|
|
39
43
|
isFullscreen?: boolean;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { useEffect, useRef } from 'react';
|
|
2
|
+
import * as S from '../CodeArea.styles';
|
|
2
3
|
export var AriaContainer = function AriaContainer(_ref) {
|
|
3
4
|
var element = _ref.element;
|
|
4
5
|
var ariaContainerRef = useRef(null);
|
|
@@ -8,7 +9,7 @@ export var AriaContainer = function AriaContainer(_ref) {
|
|
|
8
9
|
container.appendChild(element);
|
|
9
10
|
}
|
|
10
11
|
}, [element]);
|
|
11
|
-
return /*#__PURE__*/React.createElement(
|
|
12
|
+
return /*#__PURE__*/React.createElement(S.AriaContainer, {
|
|
12
13
|
className: "monaco-aria-custom-container",
|
|
13
14
|
"data-testid": "monaco-aria-container",
|
|
14
15
|
ref: ariaContainerRef
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { CodeAreaEditorProps } from '../CodeArea.types';
|
|
3
|
-
export declare const CodeAreaEditor: ({ renderAdditionalDescription, description, errorText, style, zIndex, className, counter, fullscreenLabel, tooltip, label, tooltipProps, ...props }: CodeAreaEditorProps) => React.JSX.Element;
|
|
3
|
+
export declare const CodeAreaEditor: ({ renderAdditionalDescription, description, errorText, style, zIndex, className, counter, fullscreenLabel, tooltip, label, tooltipProps, height, ...props }: CodeAreaEditorProps) => React.JSX.Element;
|
|
4
4
|
export default CodeAreaEditor;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var _excluded = ["renderAdditionalDescription", "description", "errorText", "style", "zIndex", "className", "counter", "fullscreenLabel", "tooltip", "label", "tooltipProps"];
|
|
2
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
3
|
-
function _objectWithoutPropertiesLoose(
|
|
1
|
+
var _excluded = ["renderAdditionalDescription", "description", "errorText", "style", "zIndex", "className", "counter", "fullscreenLabel", "tooltip", "label", "tooltipProps", "height"];
|
|
2
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
4
4
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
5
5
|
import { Label } from '@synerise/ds-input';
|
|
6
6
|
import { useResizeObserver } from '@synerise/ds-utils';
|
|
@@ -22,6 +22,7 @@ export var CodeAreaEditor = function CodeAreaEditor(_ref) {
|
|
|
22
22
|
tooltip = _ref.tooltip,
|
|
23
23
|
label = _ref.label,
|
|
24
24
|
tooltipProps = _ref.tooltipProps,
|
|
25
|
+
height = _ref.height,
|
|
25
26
|
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
26
27
|
var allowFullscreen = props.allowFullscreen,
|
|
27
28
|
texts = props.texts,
|
|
@@ -76,7 +77,8 @@ export var CodeAreaEditor = function CodeAreaEditor(_ref) {
|
|
|
76
77
|
className: className,
|
|
77
78
|
style: style,
|
|
78
79
|
isFullscreen: isFullscreen,
|
|
79
|
-
zIndex: zIndex
|
|
80
|
+
zIndex: zIndex,
|
|
81
|
+
customHeight: height
|
|
80
82
|
}, isFullscreen && /*#__PURE__*/React.createElement(FullscreenHeader, {
|
|
81
83
|
label: fullscreenLabel || labelWithTooltip,
|
|
82
84
|
texts: allTexts,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var _excluded = ["onMount", "beforeMount", "options", "errorText", "texts", "allowFullscreen", "toggleFullscreen", "renderFooterContent", "isFullscreen", "count", "counterLimit", "onChange", "isValid", "onDidChangeMarkers", "isSyntaxSelectVisible", "syntaxOptions", "currentSyntax", "readOnly", "onSyntaxChange", "loaderConfig"];
|
|
2
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
3
|
-
function _objectWithoutPropertiesLoose(
|
|
2
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
4
4
|
import React, { useCallback, useEffect, useMemo, useRef } from 'react';
|
|
5
5
|
import Editor, { loader } from '@monaco-editor/react';
|
|
6
6
|
import Loader from '@synerise/ds-loader';
|
|
@@ -3,9 +3,9 @@ import * as S from '../CodeArea.styles';
|
|
|
3
3
|
export var ContentAbove = function ContentAbove(_ref) {
|
|
4
4
|
var label = _ref.label,
|
|
5
5
|
counter = _ref.counter;
|
|
6
|
-
return /*#__PURE__*/React.createElement(S.ContentAbove, null, label && /*#__PURE__*/React.createElement(S.LeftSide, {
|
|
6
|
+
return label || counter ? /*#__PURE__*/React.createElement(S.ContentAbove, null, label && /*#__PURE__*/React.createElement(S.LeftSide, {
|
|
7
7
|
"data-testid": "code-area-label"
|
|
8
8
|
}, label), counter && /*#__PURE__*/React.createElement(S.RightSide, {
|
|
9
9
|
"data-testid": "code-area-counter-top"
|
|
10
|
-
}, counter));
|
|
10
|
+
}, counter)) : /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
11
11
|
};
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
2
|
import * as S from '../CodeArea.styles';
|
|
3
|
-
export var ContentBelow = forwardRef(function (_ref, ref) {
|
|
3
|
+
export var ContentBelow = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
4
4
|
var description = _ref.description,
|
|
5
5
|
additionalDescription = _ref.additionalDescription,
|
|
6
6
|
errorText = _ref.errorText,
|
|
7
7
|
counter = _ref.counter;
|
|
8
|
+
var isEmpty = !(description || additionalDescription || errorText || counter);
|
|
8
9
|
return /*#__PURE__*/React.createElement(S.ContentBelow, {
|
|
9
10
|
"data-testid": "code-area-below",
|
|
10
|
-
ref: ref
|
|
11
|
+
ref: ref,
|
|
12
|
+
isEmpty: isEmpty
|
|
11
13
|
}, (description || additionalDescription || errorText) && /*#__PURE__*/React.createElement(S.LeftSide, null, additionalDescription, errorText && /*#__PURE__*/React.createElement(S.ErrorText, {
|
|
12
14
|
"data-testid": "code-area-error"
|
|
13
15
|
}, errorText), description && /*#__PURE__*/React.createElement(S.Description, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { FormattedMessage } from 'react-intl';
|
|
4
4
|
export var getDefaultTexts = function getDefaultTexts(texts) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-code-area",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"description": "CodeArea UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"monaco-editor": "0.34.1"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "7586f8946fc312eae130021f8ae4ad4b9455e8d4"
|
|
58
58
|
}
|