@synerise/ds-code-area 0.5.9 → 0.6.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 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
+ ## [0.6.1](https://github.com/Synerise/synerise-design/compare/@synerise/ds-code-area@0.6.0...@synerise/ds-code-area@0.6.1) (2025-03-04)
7
+
8
+ **Note:** Version bump only for package @synerise/ds-code-area
9
+
10
+
11
+
12
+
13
+
14
+ # [0.6.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-code-area@0.5.9...@synerise/ds-code-area@0.6.0) (2025-03-03)
15
+
16
+
17
+ ### Features
18
+
19
+ * **code-area:** pass loader config via prop ([20d5bd2](https://github.com/Synerise/synerise-design/commit/20d5bd2e624a67c1a00111730b56819317970b0e))
20
+
21
+
22
+
23
+
24
+
6
25
  ## [0.5.9](https://github.com/Synerise/synerise-design/compare/@synerise/ds-code-area@0.5.8...@synerise/ds-code-area@0.5.9) (2025-02-27)
7
26
 
8
27
  **Note:** Version bump only for package @synerise/ds-code-area
@@ -1,5 +1,5 @@
1
1
  import type monaco from 'monaco-editor/esm/vs/editor/editor.api';
2
- import type { EditorProps } from '@monaco-editor/react';
2
+ import type { EditorProps, loader } from '@monaco-editor/react';
3
3
  import type { ReactNode, CSSProperties } from 'react';
4
4
  import type { TooltipProps } from 'antd/lib/tooltip';
5
5
  import TooltipExtendedProps from '@synerise/ds-tooltip/dist/Tooltip.types';
@@ -41,6 +41,7 @@ export type CodeAreaCommonProps<SyntaxName extends CodeAreaSyntax = CodeAreaSynt
41
41
  isValid?: boolean;
42
42
  }) => ReactNode;
43
43
  onSyntaxChange?: (newSyntax: SyntaxName) => void;
44
+ loaderConfig?: Parameters<typeof loader.config>[0];
44
45
  };
45
46
  export type CodeAreaEditorProps<SyntaxName extends CodeAreaSyntax = CodeAreaSyntax> = CodeAreaCommonProps<SyntaxName> & {
46
47
  fullscreenLabel?: ReactNode;
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
2
  import { CodeAreaEditorRawProps } from 'CodeArea.types';
3
- export declare const CodeAreaEditorRaw: ({ onMount, beforeMount, options, errorText, texts, allowFullscreen, toggleFullscreen, renderFooterContent, isFullscreen, count, counterLimit, onChange, isValid, onDidChangeMarkers, isSyntaxSelectVisible, syntaxOptions, currentSyntax, readOnly, onSyntaxChange, ...props }: CodeAreaEditorRawProps) => React.JSX.Element;
3
+ export declare const CodeAreaEditorRaw: ({ onMount, beforeMount, options, errorText, texts, allowFullscreen, toggleFullscreen, renderFooterContent, isFullscreen, count, counterLimit, onChange, isValid, onDidChangeMarkers, isSyntaxSelectVisible, syntaxOptions, currentSyntax, readOnly, onSyntaxChange, loaderConfig, ...props }: CodeAreaEditorRawProps) => React.JSX.Element;
4
4
  export default CodeAreaEditorRaw;
@@ -1,8 +1,8 @@
1
- var _excluded = ["onMount", "beforeMount", "options", "errorText", "texts", "allowFullscreen", "toggleFullscreen", "renderFooterContent", "isFullscreen", "count", "counterLimit", "onChange", "isValid", "onDidChangeMarkers", "isSyntaxSelectVisible", "syntaxOptions", "currentSyntax", "readOnly", "onSyntaxChange"];
1
+ var _excluded = ["onMount", "beforeMount", "options", "errorText", "texts", "allowFullscreen", "toggleFullscreen", "renderFooterContent", "isFullscreen", "count", "counterLimit", "onChange", "isValid", "onDidChangeMarkers", "isSyntaxSelectVisible", "syntaxOptions", "currentSyntax", "readOnly", "onSyntaxChange", "loaderConfig"];
2
2
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
3
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
4
4
  import React, { useCallback, useEffect, useMemo, useRef } from 'react';
5
- import Editor from '@monaco-editor/react';
5
+ import Editor, { loader } from '@monaco-editor/react';
6
6
  import Loader from '@synerise/ds-loader';
7
7
  import { InlineSelect } from '@synerise/ds-inline-edit';
8
8
  import { NOOP, useResizeObserver } from '@synerise/ds-utils';
@@ -31,8 +31,10 @@ export var CodeAreaEditorRaw = function CodeAreaEditorRaw(_ref) {
31
31
  currentSyntax = _ref.currentSyntax,
32
32
  readOnly = _ref.readOnly,
33
33
  onSyntaxChange = _ref.onSyntaxChange,
34
+ loaderConfig = _ref.loaderConfig,
34
35
  props = _objectWithoutPropertiesLoose(_ref, _excluded);
35
36
  var monacoRef = useRef(null);
37
+ var loaderConfigSet = useRef(false);
36
38
  var editorRef = useRef(null);
37
39
  var wrapperRef = useRef(null);
38
40
  var _useResizeObserver = useResizeObserver(wrapperRef),
@@ -41,6 +43,10 @@ export var CodeAreaEditorRaw = function CodeAreaEditorRaw(_ref) {
41
43
  var monacoAriaContainerElement = useMemo(function () {
42
44
  return document.createElement('div');
43
45
  }, []);
46
+ if (loaderConfig && !loaderConfigSet.current) {
47
+ loader.config(loaderConfig);
48
+ loaderConfigSet.current = true;
49
+ }
44
50
  var editorOptions = useMemo(function () {
45
51
  return _extends({}, MONACO_DEFAULT_OPTIONS, options, {
46
52
  readOnly: readOnly,
package/dist/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export { default } from './CodeArea';
2
2
  export type { CodeAreaProps, CodeAreaTexts, CodeAreaSyntaxOption, CodeAreaSyntax } from './CodeArea.types';
3
+ export * from './CodeArea.styles';
package/dist/index.js CHANGED
@@ -1 +1,2 @@
1
- export { default } from './CodeArea';
1
+ export { default } from './CodeArea';
2
+ export * from './CodeArea.styles';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-code-area",
3
- "version": "0.5.9",
3
+ "version": "0.6.1",
4
4
  "description": "CodeArea UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "Synerise/synerise-design",
@@ -35,15 +35,14 @@
35
35
  "types": "dist/index.d.ts",
36
36
  "dependencies": {
37
37
  "@monaco-editor/react": "4.4.6",
38
- "@synerise/ds-button": "^0.23.2",
38
+ "@synerise/ds-button": "^0.23.3",
39
39
  "@synerise/ds-core": "^0.43.1",
40
- "@synerise/ds-icon": "^0.71.2",
41
- "@synerise/ds-inline-edit": "^0.10.9",
42
- "@synerise/ds-input": "^0.25.7",
43
- "@synerise/ds-tooltip": "^0.16.1",
44
- "@synerise/ds-typography": "^0.17.5",
45
- "@synerise/ds-utils": "^0.32.2",
46
- "monaco-editor": "0.34.1"
40
+ "@synerise/ds-icon": "^0.72.0",
41
+ "@synerise/ds-inline-edit": "^0.10.10",
42
+ "@synerise/ds-input": "^0.25.8",
43
+ "@synerise/ds-tooltip": "^0.16.2",
44
+ "@synerise/ds-typography": "^0.17.6",
45
+ "@synerise/ds-utils": "^0.32.2"
47
46
  },
48
47
  "peerDependencies": {
49
48
  "@synerise/ds-core": "*",
@@ -52,5 +51,8 @@
52
51
  "react-intl": ">=3.12.0 <= 6.8",
53
52
  "styled-components": "^5.3.3"
54
53
  },
55
- "gitHead": "7b1edcd256eb34848761e3649a8c21a411966a98"
54
+ "devDependencies": {
55
+ "monaco-editor": "0.34.1"
56
+ },
57
+ "gitHead": "c5a647bd7a24a2c9294e781b2b69223e8543859f"
56
58
  }