@synerise/ds-code-area 2.0.10 → 2.1.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/CHANGELOG.md +19 -0
- package/CLAUDE.md +5 -5
- package/README.md +2 -2
- package/dist/CodeArea.js +5 -3
- package/dist/CodeArea.styles.d.ts +6 -3
- package/dist/CodeArea.styles.js +23 -18
- package/dist/components/CodeAreaEditor.d.ts +1 -1
- package/dist/components/CodeAreaEditor.js +1 -1
- package/dist/components/FullscreenHeader.js +11 -6
- package/dist/index.js +2 -1
- package/package.json +10 -10
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
|
+
## [2.1.1](https://github.com/Synerise/synerise-design/compare/@synerise/ds-code-area@2.1.0...@synerise/ds-code-area@2.1.1) (2026-10-28)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @synerise/ds-code-area
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [2.1.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-code-area@2.0.10...@synerise/ds-code-area@2.1.0) (2026-10-26)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* 24px gutter around fullscreen modal, code-area and wizard ([3931816](https://github.com/Synerise/synerise-design/commit/3931816398831f9a647b6ea2dbd26cb415af926c))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
## [2.0.10](https://github.com/Synerise/synerise-design/compare/@synerise/ds-code-area@2.0.9...@synerise/ds-code-area@2.0.10) (2026-10-22)
|
|
7
26
|
|
|
8
27
|
**Note:** Version bump only for package @synerise/ds-code-area
|
package/CLAUDE.md
CHANGED
|
@@ -18,7 +18,7 @@ src/
|
|
|
18
18
|
BottomBar.tsx — syntax select + fullscreen button + custom footer slot
|
|
19
19
|
ContentAbove.tsx — label + top counter row
|
|
20
20
|
ContentBelow.tsx — description + additional description + bottom counter + error text
|
|
21
|
-
FullscreenHeader.tsx — header bar shown only in fullscreen mode
|
|
21
|
+
FullscreenHeader.tsx — header bar shown only in fullscreen mode; ghost single-icon close button, same as Modal's
|
|
22
22
|
AriaContainer.tsx — attaches monaco's ARIA container element to the DOM
|
|
23
23
|
index.ts — re-exports all components
|
|
24
24
|
utils/
|
|
@@ -48,9 +48,9 @@ Generic component: `CodeArea<SyntaxName extends CodeAreaSyntax = CodeAreaSyntax>
|
|
|
48
48
|
| `syntaxOptions` | `CodeAreaSyntaxOption<SyntaxName>[]` | `undefined` | Available languages. Syntax select renders in BottomBar when `length > 1` and not `readOnly`. |
|
|
49
49
|
| `allowFullscreen` | `boolean` | `undefined` | Shows the fullscreen button in BottomBar. |
|
|
50
50
|
| `readOnly` | `boolean` | `undefined` | Monaco `readOnly` + `domReadOnly`; grey background; cursor hidden. |
|
|
51
|
-
| `noBorder` | `boolean` | `undefined` | Removes the 1px border from the editor wrapper. |
|
|
51
|
+
| `noBorder` | `boolean` | `undefined` | Removes the 1px border from the editor wrapper. Always on in fullscreen. |
|
|
52
52
|
| `height` | `string \| number` | `undefined` | Height of the wrapper. When unset, `EditorInnerWrapper` defaults to `295px`. |
|
|
53
|
-
| `zIndex` | `string \| number` | `undefined` | `z-index` of the fullscreen overlay. Defaults to `theme.variables['zindex-modal']`. |
|
|
53
|
+
| `zIndex` | `string \| number` | `undefined` | `z-index` of the fullscreen overlay and its `FullscreenMask` backdrop. Defaults to `theme.variables['zindex-modal']`. |
|
|
54
54
|
| `tooltip` | `ReactNode` | `undefined` | Tooltip content shown next to the label. |
|
|
55
55
|
| `tooltipProps` | `TooltipProps` | `undefined` | Full tooltip configuration (merged with `tooltip`). |
|
|
56
56
|
| `style` | `CSSProperties` | `undefined` | Inline styles on the outermost wrapper. |
|
|
@@ -74,7 +74,7 @@ Generic component: `CodeArea<SyntaxName extends CodeAreaSyntax = CodeAreaSyntax>
|
|
|
74
74
|
| Key | Default (react-intl) |
|
|
75
75
|
|-----|----------------------|
|
|
76
76
|
| `fullscreen` | `'Fullscreen'` (`DS.CODE-AREA.FULLSCREEN`) |
|
|
77
|
-
| `closeFullscreen` | `'Close fullscreen'` (`DS.CODE-AREA.CLOSE-FULLSCREEN`) |
|
|
77
|
+
| `closeFullscreen` | `'Close fullscreen'` (`DS.CODE-AREA.CLOSE-FULLSCREEN`) — `aria-label` of the icon-only close button; a non-string value falls back to this default |
|
|
78
78
|
| `fullscreenTitle` | `'Fullscreen editor'` (`DS.CODE-AREA.FULLSCREEN-TITLE`) |
|
|
79
79
|
|
|
80
80
|
### `CodeAreaSyntaxOption<SyntaxName>` (type)
|
|
@@ -127,7 +127,7 @@ type Syntax = 'json' | 'javascript';
|
|
|
127
127
|
|
|
128
128
|
## Implementation notes
|
|
129
129
|
|
|
130
|
-
- **Fullscreen uses `createPortal`**: when `isFullscreen=true`, a second `<CodeAreaEditor>` is mounted via portal into `getPopupContainer(wrapperRef.current)`. The in-place editor remains mounted with `isFullscreen={false}` always. This means two Monaco instances exist simultaneously during fullscreen.
|
|
130
|
+
- **Fullscreen uses `createPortal`**: when `isFullscreen=true`, a second `<CodeAreaEditor>` is mounted via portal into `getPopupContainer(wrapperRef.current)`. The in-place editor remains mounted with `isFullscreen={false}` always. This means two Monaco instances exist simultaneously during fullscreen. The portal also renders a `FullscreenMask` backdrop; the fullscreen editor is inset 24px from every viewport edge, matching `Modal size="fullScreen"`. In fullscreen the editor is always borderless and spans the full width of that frame (no body padding); only the header and the text row below the editor (`ContentBelow`) keep a 24px side inset. The header title has no icon.
|
|
131
131
|
- **`onFullscreenChange` receives the old state**: `onFullscreenChange && onFullscreenChange(isFullscreen)` is called before `setIsFullscreen` — the callback gets the value *before* the toggle (likely a bug).
|
|
132
132
|
- **Counter hard-limit**: when `value.length > counter.limit`, `CodeAreaEditorRaw` triggers `'undo'` on the Monaco instance directly. The `onChange` callback is not called for over-limit input.
|
|
133
133
|
- **`isValid` logic**: `isValid` starts as `true`, is set to `false` when `errorText` is truthy (via `useEffect`), and is also set to `false` when Monaco reports markers (lint/parse errors). Both paths independently drive the error state.
|
package/README.md
CHANGED
|
@@ -65,7 +65,7 @@ const syntaxOptions = [
|
|
|
65
65
|
| texts | customise displayed texts | `CodeAreaTexts` | - |
|
|
66
66
|
| getPopupContainer | customise where fullscreen layer is rendered into | getPopupContainer (@synerise/ds-utils) | - |
|
|
67
67
|
| placeholder | placeholder content | `ReactNode` | - |
|
|
68
|
-
| noBorder | remove border from wrapper
|
|
68
|
+
| noBorder | remove border from wrapper (always on in fullscreen) | `boolean` | - |
|
|
69
69
|
| height | height of the editor wrapper | `string \| number` | `295px` |
|
|
70
70
|
| zIndex | z-index of the fullscreen overlay | `string \| number` | `zindex-modal` token |
|
|
71
71
|
|
|
@@ -76,7 +76,7 @@ Customisable user-facing labels
|
|
|
76
76
|
| Property | Description | Type | Default |
|
|
77
77
|
| --------------- | --------------------------------------------------- | ----------- | ------- |
|
|
78
78
|
| fullscreen | fullscreen button label | `ReactNode` | - |
|
|
79
|
-
| closeFullscreen | close fullscreen button
|
|
79
|
+
| closeFullscreen | `aria-label` of the icon-only close fullscreen button (strings only; other nodes fall back to the default) | `ReactNode` | - |
|
|
80
80
|
| fullscreenTitle | used in fullscreen mode if no `label` prop provided | `ReactNode` | - |
|
|
81
81
|
|
|
82
82
|
### CodeAreaSyntaxOption
|
package/dist/CodeArea.js
CHANGED
|
@@ -2,10 +2,9 @@ import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState, useRef } from "react";
|
|
3
3
|
import { createPortal } from "react-dom";
|
|
4
4
|
import { getPopupContainer } from "@synerise/ds-utils";
|
|
5
|
+
import { FullscreenMask } from "./CodeArea.styles.js";
|
|
5
6
|
import "@synerise/ds-button";
|
|
6
7
|
import "@synerise/ds-icon";
|
|
7
|
-
import "styled-components";
|
|
8
|
-
import "@synerise/ds-typography";
|
|
9
8
|
import { CodeAreaEditor } from "./components/CodeAreaEditor.js";
|
|
10
9
|
import "@monaco-editor/react";
|
|
11
10
|
import "@synerise/ds-inline-edit";
|
|
@@ -26,7 +25,10 @@ const CodeArea = ({
|
|
|
26
25
|
};
|
|
27
26
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
28
27
|
/* @__PURE__ */ jsx(CodeAreaEditor, { ...codeAreaProps, toggleFullscreen, isFullscreen: false, ref: wrapperRef }),
|
|
29
|
-
wrapperRef.current && isFullscreen && createPortal(/* @__PURE__ */
|
|
28
|
+
wrapperRef.current && isFullscreen && createPortal(/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
29
|
+
/* @__PURE__ */ jsx(FullscreenMask, { zIndex: codeAreaProps.zIndex }),
|
|
30
|
+
/* @__PURE__ */ jsx(CodeAreaEditor, { ...codeAreaProps, toggleFullscreen, isFullscreen })
|
|
31
|
+
] }), getPopupContainer$1(wrapperRef.current))
|
|
30
32
|
] });
|
|
31
33
|
};
|
|
32
34
|
export {
|
|
@@ -10,6 +10,12 @@ export declare const EditorWrapper: import('styled-components').StyledComponent<
|
|
|
10
10
|
}, never>;
|
|
11
11
|
export declare const FullscreenHeaderTitle: import('styled-components').StyledComponent<({ level, withoutMargin, children, className, ellipsis, ...rest }: import('@synerise/ds-typography/dist/Title.types').Props) => React.JSX.Element, any, {}, never>;
|
|
12
12
|
export declare const FullscreenHeader: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
13
|
+
export declare const ContentBelow: import('styled-components').StyledComponent<"div", any, {
|
|
14
|
+
isEmpty?: boolean;
|
|
15
|
+
}, never>;
|
|
16
|
+
export declare const FullscreenMask: import('styled-components').StyledComponent<"div", any, {
|
|
17
|
+
zIndex?: number | string;
|
|
18
|
+
}, never>;
|
|
13
19
|
export declare const CodeAreaWrapper: import('styled-components').StyledComponent<"div", any, {
|
|
14
20
|
readOnly: boolean;
|
|
15
21
|
isFullscreen: boolean;
|
|
@@ -18,9 +24,6 @@ export declare const CodeAreaWrapper: import('styled-components').StyledComponen
|
|
|
18
24
|
zIndex?: number | string;
|
|
19
25
|
}, never>;
|
|
20
26
|
export declare const AdditionalDescription: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
21
|
-
export declare const ContentBelow: import('styled-components').StyledComponent<"div", any, {
|
|
22
|
-
isEmpty?: boolean;
|
|
23
|
-
}, never>;
|
|
24
27
|
export declare const ContentAbove: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
25
28
|
export declare const SyntaxTitle: import('styled-components').StyledComponent<({ size, className, children, ellipsis, style, strong, ...dataAttributes }: import('@synerise/ds-utils').DataAttributes & {
|
|
26
29
|
size?: import('@synerise/ds-typography').TextSize;
|
package/dist/CodeArea.styles.js
CHANGED
|
@@ -27,39 +27,43 @@ const EditorWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
|
27
27
|
const FullscreenHeaderTitle = /* @__PURE__ */ styled(Title).withConfig({
|
|
28
28
|
displayName: "CodeAreastyles__FullscreenHeaderTitle",
|
|
29
29
|
componentId: "sc-svoej2-6"
|
|
30
|
-
})(["
|
|
30
|
+
})(["margin-bottom:0;"]);
|
|
31
31
|
const FullscreenHeader = /* @__PURE__ */ styled(FlexRow).withConfig({
|
|
32
32
|
displayName: "CodeAreastyles__FullscreenHeader",
|
|
33
33
|
componentId: "sc-svoej2-7"
|
|
34
34
|
})(["padding:16px 24px;"]);
|
|
35
|
+
const ContentBelow = /* @__PURE__ */ styled(FlexRow).withConfig({
|
|
36
|
+
displayName: "CodeAreastyles__ContentBelow",
|
|
37
|
+
componentId: "sc-svoej2-8"
|
|
38
|
+
})(["", " align-items:flex-start;"], (props) => !props.isEmpty && `margin-top: 8px;`);
|
|
39
|
+
const FullscreenMask = /* @__PURE__ */ styled.div.withConfig({
|
|
40
|
+
displayName: "CodeAreastyles__FullscreenMask",
|
|
41
|
+
componentId: "sc-svoej2-9"
|
|
42
|
+
})(["position:fixed;top:0;left:0;right:0;bottom:0;z-index:", ";background:", ";opacity:0.2;"], (props) => props.zIndex !== void 0 ? props.zIndex : props.theme.variables["zindex-modal"], (props) => props.theme.palette["grey-800"]);
|
|
35
43
|
const CodeAreaWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
36
44
|
displayName: "CodeAreastyles__CodeAreaWrapper",
|
|
37
|
-
componentId: "sc-svoej2-
|
|
45
|
+
componentId: "sc-svoej2-10"
|
|
38
46
|
})(["", " ", "{", ";}"], (props) => {
|
|
39
47
|
if (props.isFullscreen) {
|
|
40
|
-
return css(["position:fixed;
|
|
48
|
+
return css(["position:fixed;top:24px;left:24px;right:24px;bottom:24px;z-index:", ";background:", ";border-radius:3px;box-shadow:", ";", "{height:calc(100vh - 48px - ", "px);}", "{padding:0 24px;}", ":not(:empty){padding-bottom:16px;}"], props.zIndex !== void 0 ? props.zIndex : props.theme.variables["zindex-modal"], props.theme.palette.white, props.theme.variables["box-shadow-2"], EditorInnerWrapper, props.requiredSpace, ContentBelow, ContentBelow);
|
|
41
49
|
}
|
|
42
50
|
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));
|
|
43
51
|
}, EditorWrapper, (props) => props.readOnly && css(["background:", ";.monaco-editor .cursors-layer > .cursor{display:none !important;}"], props.theme.palette["grey-050"]));
|
|
44
52
|
const AdditionalDescription = /* @__PURE__ */ styled.div.withConfig({
|
|
45
53
|
displayName: "CodeAreastyles__AdditionalDescription",
|
|
46
|
-
componentId: "sc-svoej2-
|
|
54
|
+
componentId: "sc-svoej2-11"
|
|
47
55
|
})(["margin-bottom:8px;"]);
|
|
48
|
-
const ContentBelow = /* @__PURE__ */ styled(FlexRow).withConfig({
|
|
49
|
-
displayName: "CodeAreastyles__ContentBelow",
|
|
50
|
-
componentId: "sc-svoej2-10"
|
|
51
|
-
})(["", " align-items:flex-start;"], (props) => !props.isEmpty && `margin-top: 8px;`);
|
|
52
56
|
const ContentAbove = /* @__PURE__ */ styled(FlexRow).withConfig({
|
|
53
57
|
displayName: "CodeAreastyles__ContentAbove",
|
|
54
|
-
componentId: "sc-svoej2-
|
|
58
|
+
componentId: "sc-svoej2-12"
|
|
55
59
|
})(["margin-bottom:8px;flex:0 0 auto;"]);
|
|
56
60
|
const SyntaxTitle = /* @__PURE__ */ styled(Text).withConfig({
|
|
57
61
|
displayName: "CodeAreastyles__SyntaxTitle",
|
|
58
|
-
componentId: "sc-svoej2-
|
|
62
|
+
componentId: "sc-svoej2-13"
|
|
59
63
|
})([""]);
|
|
60
64
|
const BottomBar = /* @__PURE__ */ styled(FlexRow).withConfig({
|
|
61
65
|
displayName: "CodeAreastyles__BottomBar",
|
|
62
|
-
componentId: "sc-svoej2-
|
|
66
|
+
componentId: "sc-svoej2-14"
|
|
63
67
|
})(["padding:8px;flex:0 0 auto;background:", ";border-top:solid 1px ", ";", ""], ({
|
|
64
68
|
theme
|
|
65
69
|
}) => theme.palette["white"], ({
|
|
@@ -71,31 +75,31 @@ const BottomBar = /* @__PURE__ */ styled(FlexRow).withConfig({
|
|
|
71
75
|
}) => hasError && css(["background:", ";", ""], theme.palette["red-050"], noBorder ? css(["border:none;border-top:solid 1px ", ";"], theme.palette["grey-200"]) : css(["border:solid 1px ", ";border-top-color:", ";"], theme.palette["red-600"], theme.palette["grey-200"])));
|
|
72
76
|
const LeftSide = /* @__PURE__ */ styled.div.withConfig({
|
|
73
77
|
displayName: "CodeAreastyles__LeftSide",
|
|
74
|
-
componentId: "sc-svoej2-
|
|
78
|
+
componentId: "sc-svoej2-15"
|
|
75
79
|
})([""]);
|
|
76
80
|
const RightSide = /* @__PURE__ */ styled.div.withConfig({
|
|
77
81
|
displayName: "CodeAreastyles__RightSide",
|
|
78
|
-
componentId: "sc-svoej2-
|
|
82
|
+
componentId: "sc-svoej2-16"
|
|
79
83
|
})(["margin-left:auto;display:flex;gap:8px;"]);
|
|
80
84
|
const SyntaxSelect = /* @__PURE__ */ styled(LeftSide).withConfig({
|
|
81
85
|
displayName: "CodeAreastyles__SyntaxSelect",
|
|
82
|
-
componentId: "sc-svoej2-
|
|
86
|
+
componentId: "sc-svoej2-17"
|
|
83
87
|
})(["padding-left:8px;"]);
|
|
84
88
|
const BottomBarElement = /* @__PURE__ */ styled.div.withConfig({
|
|
85
89
|
displayName: "CodeAreastyles__BottomBarElement",
|
|
86
|
-
componentId: "sc-svoej2-
|
|
90
|
+
componentId: "sc-svoej2-18"
|
|
87
91
|
})([""]);
|
|
88
92
|
const Description = /* @__PURE__ */ styled.div.withConfig({
|
|
89
93
|
displayName: "CodeAreastyles__Description",
|
|
90
|
-
componentId: "sc-svoej2-
|
|
94
|
+
componentId: "sc-svoej2-19"
|
|
91
95
|
})([""]);
|
|
92
96
|
const Counter = /* @__PURE__ */ styled.div.withConfig({
|
|
93
97
|
displayName: "CodeAreastyles__Counter",
|
|
94
|
-
componentId: "sc-svoej2-
|
|
98
|
+
componentId: "sc-svoej2-20"
|
|
95
99
|
})(["font-weight:500;"]);
|
|
96
100
|
const ErrorText = /* @__PURE__ */ styled.div.withConfig({
|
|
97
101
|
displayName: "CodeAreastyles__ErrorText",
|
|
98
|
-
componentId: "sc-svoej2-
|
|
102
|
+
componentId: "sc-svoej2-21"
|
|
99
103
|
})(["color:", ";margin-bottom:4px;"], (props) => props.theme.palette["red-600"]);
|
|
100
104
|
export {
|
|
101
105
|
AdditionalDescription,
|
|
@@ -114,6 +118,7 @@ export {
|
|
|
114
118
|
ErrorText,
|
|
115
119
|
FullscreenHeader,
|
|
116
120
|
FullscreenHeaderTitle,
|
|
121
|
+
FullscreenMask,
|
|
117
122
|
LeftSide,
|
|
118
123
|
RightSide,
|
|
119
124
|
SyntaxSelect,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
export declare const CodeAreaEditor: React.ForwardRefExoticComponent<Omit<import('@monaco-editor/react').EditorProps, "
|
|
2
|
+
export declare const CodeAreaEditor: React.ForwardRefExoticComponent<Omit<import('@monaco-editor/react').EditorProps, "height" | "language"> & {
|
|
3
3
|
label?: React.ReactNode;
|
|
4
4
|
description?: React.ReactNode;
|
|
5
5
|
texts?: Partial<import('../CodeArea.types').CodeAreaTexts>;
|
|
@@ -77,7 +77,7 @@ const CodeAreaEditor = forwardRef(({
|
|
|
77
77
|
isFullscreen && /* @__PURE__ */ jsx(FullscreenHeader, { label: fullscreenLabel || labelWithTooltip, texts: allTexts, onClick: toggleFullscreen }),
|
|
78
78
|
!isFullscreen && /* @__PURE__ */ jsx(ContentAbove, { label: labelWithTooltip, counter: renderCounter("top") }),
|
|
79
79
|
/* @__PURE__ */ jsxs(CodeAreaContent, { children: [
|
|
80
|
-
/* @__PURE__ */ jsx(CodeAreaEditorRaw, { ...props, onDidChangeMarkers: handleOnDidChangeMarkers, counter, errorText, count, counterLimit, isBottomBarShowing, isSyntaxSelectVisible, isValid, noBorder }),
|
|
80
|
+
/* @__PURE__ */ jsx(CodeAreaEditorRaw, { ...props, onDidChangeMarkers: handleOnDidChangeMarkers, counter, errorText, count, counterLimit, isBottomBarShowing, isSyntaxSelectVisible, isValid, noBorder: isFullscreen || noBorder }),
|
|
81
81
|
/* @__PURE__ */ jsx(ContentBelow, { ref: contentBelowRef, errorText, description, additionalDescription, counter: renderCounter(!isFullscreen ? "bottom" : void 0) })
|
|
82
82
|
] })
|
|
83
83
|
] });
|
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useIntl } from "react-intl";
|
|
2
3
|
import Button from "@synerise/ds-button";
|
|
3
|
-
import Icon, {
|
|
4
|
+
import Icon, { CloseM } from "@synerise/ds-icon";
|
|
4
5
|
import { FullscreenHeader as FullscreenHeader$1, LeftSide, FullscreenHeaderTitle, RightSide } from "../CodeArea.styles.js";
|
|
5
6
|
const FullscreenHeader = ({
|
|
6
7
|
label,
|
|
7
8
|
texts,
|
|
8
9
|
onClick
|
|
9
10
|
}) => {
|
|
11
|
+
const {
|
|
12
|
+
formatMessage
|
|
13
|
+
} = useIntl();
|
|
14
|
+
const closeLabel = typeof texts.closeFullscreen === "string" ? texts.closeFullscreen : formatMessage({
|
|
15
|
+
id: "DS.CODE-AREA.CLOSE-FULLSCREEN",
|
|
16
|
+
defaultMessage: "Close fullscreen"
|
|
17
|
+
});
|
|
10
18
|
return /* @__PURE__ */ jsxs(FullscreenHeader$1, { children: [
|
|
11
|
-
/* @__PURE__ */ jsx(LeftSide, { children: /* @__PURE__ */
|
|
12
|
-
|
|
13
|
-
label || texts.fullscreenTitle
|
|
14
|
-
] }) }),
|
|
15
|
-
/* @__PURE__ */ jsx(RightSide, { children: /* @__PURE__ */ jsx(Button, { type: "primary", mode: "icon-label", onClick, icon: /* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(CloseM, {}) }), children: texts.closeFullscreen }) })
|
|
19
|
+
/* @__PURE__ */ jsx(LeftSide, { children: /* @__PURE__ */ jsx(FullscreenHeaderTitle, { level: 3, children: label || texts.fullscreenTitle }) }),
|
|
20
|
+
/* @__PURE__ */ jsx(RightSide, { children: /* @__PURE__ */ jsx(Button, { type: "ghost", mode: "single-icon", "aria-label": closeLabel, onClick, children: /* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(CloseM, {}) }) }) })
|
|
16
21
|
] });
|
|
17
22
|
};
|
|
18
23
|
export {
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as default2 } from "./CodeArea.js";
|
|
2
|
-
import { AdditionalDescription, AriaContainer, BottomBar, BottomBarElement, CodeAreaContent, CodeAreaWrapper, ContentAbove, ContentBelow, Counter, Description, EditorInnerWrapper, EditorPlaceholder, EditorWrapper, ErrorText, FullscreenHeader, FullscreenHeaderTitle, LeftSide, RightSide, SyntaxSelect, SyntaxTitle } from "./CodeArea.styles.js";
|
|
2
|
+
import { AdditionalDescription, AriaContainer, BottomBar, BottomBarElement, CodeAreaContent, CodeAreaWrapper, ContentAbove, ContentBelow, Counter, Description, EditorInnerWrapper, EditorPlaceholder, EditorWrapper, ErrorText, FullscreenHeader, FullscreenHeaderTitle, FullscreenMask, LeftSide, RightSide, SyntaxSelect, SyntaxTitle } from "./CodeArea.styles.js";
|
|
3
3
|
import { DS_MONACO_THEME, DS_MONACO_THEME_NAME, MONACO_DEFAULT_OPTIONS, TRIGGER_SOURCE } from "./constants.js";
|
|
4
4
|
export {
|
|
5
5
|
AdditionalDescription,
|
|
@@ -20,6 +20,7 @@ export {
|
|
|
20
20
|
ErrorText,
|
|
21
21
|
FullscreenHeader,
|
|
22
22
|
FullscreenHeaderTitle,
|
|
23
|
+
FullscreenMask,
|
|
23
24
|
LeftSide,
|
|
24
25
|
MONACO_DEFAULT_OPTIONS,
|
|
25
26
|
RightSide,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-code-area",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"description": "CodeArea UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -43,14 +43,14 @@
|
|
|
43
43
|
"types": "dist/index.d.ts",
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@monaco-editor/react": "4.4.6",
|
|
46
|
-
"@synerise/ds-button": "^2.1.
|
|
47
|
-
"@synerise/ds-form-field": "^2.0.
|
|
48
|
-
"@synerise/ds-icon": "^2.2.
|
|
49
|
-
"@synerise/ds-inline-edit": "^2.0.
|
|
50
|
-
"@synerise/ds-loader": "^2.0.
|
|
51
|
-
"@synerise/ds-tooltip": "^2.0.
|
|
52
|
-
"@synerise/ds-typography": "^2.0.
|
|
53
|
-
"@synerise/ds-utils": "^2.2.
|
|
46
|
+
"@synerise/ds-button": "^2.1.6",
|
|
47
|
+
"@synerise/ds-form-field": "^2.0.11",
|
|
48
|
+
"@synerise/ds-icon": "^2.2.3",
|
|
49
|
+
"@synerise/ds-inline-edit": "^2.0.12",
|
|
50
|
+
"@synerise/ds-loader": "^2.0.3",
|
|
51
|
+
"@synerise/ds-tooltip": "^2.0.11",
|
|
52
|
+
"@synerise/ds-typography": "^2.0.11",
|
|
53
|
+
"@synerise/ds-utils": "^2.2.2"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
56
|
"@synerise/ds-core": "*",
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"monaco-editor": "0.34.1",
|
|
65
65
|
"vitest": "4"
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "c356039703d8826bbbdb6dadcb18bb008fea8bc5"
|
|
68
68
|
}
|