@jetbrains/ring-ui 5.0.4 → 5.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.
@@ -41,13 +41,22 @@ angularModule.directive('rgCheckbox', function rgCheckboxDirective() {
41
41
  </span><span class="${styles.label}" ng-transclude></span>
42
42
  </label>
43
43
  `),
44
- link: function link(scope, iElement) {
44
+ link: function link(scope, iElement, attrs, controller, transcludeFn) {
45
45
  scope.checkmarkIcon = checkmarkIcon;
46
46
  const input = iElement[0].querySelector('input[type="checkbox"]');
47
+ const label = iElement[0].querySelector(`*[class~="${styles.label}"]`);
47
48
 
48
49
  const id = CHECKBOX_ID_PREFIX + idCounter++;
49
50
  iElement[0].setAttribute('for', id);
50
51
  input.setAttribute('id', id);
52
+
53
+ transcludeFn(clone => {
54
+ if (clone.length) {
55
+ label.style.display = 'initial';
56
+ } else {
57
+ label.style.display = 'none';
58
+ }
59
+ });
51
60
  }
52
61
  };
53
62
  });
@@ -1,7 +1,5 @@
1
1
  import angular from 'angular';
2
2
 
3
- import AngularElastic from '@jetbrains/angular-elastic';
4
-
5
3
  import MessageBundle from '../message-bundle-ng/message-bundle-ng';
6
4
  import '../input/input-legacy.css';
7
5
  import '../error-bubble/error-bubble-legacy.css';
@@ -10,7 +8,7 @@ import '../error-bubble/error-bubble-legacy.css';
10
8
  * @name Form Ng
11
9
  */
12
10
 
13
- const angularModule = angular.module('Ring.form', [MessageBundle, AngularElastic]);
11
+ const angularModule = angular.module('Ring.form', [MessageBundle]);
14
12
 
15
13
  angularModule.factory('getFormErrorMessages',
16
14
  function getFormErrorMessagesDirective(RingMessageBundle) {
@@ -5,5 +5,5 @@ declare module 'react-markdown/lib/complex-types' {
5
5
  language?: string;
6
6
  }
7
7
  }
8
- declare const MarkdownCode: ({ children, language, inline }: CodeProps) => JSX.Element;
8
+ declare const MarkdownCode: ({ children, language, inline, className }: CodeProps) => JSX.Element;
9
9
  export default MarkdownCode;
@@ -1,7 +1,14 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import Code from '../code/code';
4
- const MarkdownCode = ({ children, language, inline }) => (<Code language={language} code={children?.join('') || ''} inline={inline}/>);
4
+ const MarkdownCode = ({ children, language, inline, className }) => {
5
+ // Hack for updated react-markdown RG-2193
6
+ const lang = language ?? (className?.
7
+ split(' ').
8
+ find(name => name.startsWith('language-'))?.
9
+ replace('language-', ''));
10
+ return (<Code language={lang} className={className} code={children?.join('') || ''} inline={inline}/>);
11
+ };
5
12
  MarkdownCode.propTypes = {
6
13
  language: PropTypes.string,
7
14
  children: PropTypes.array.isRequired,
@@ -15,12 +15,12 @@ import styles from './markdown.css';
15
15
  */
16
16
  export default class Markdown extends PureComponent {
17
17
  render() {
18
- const { className, components, inline, children, plugins = [], ...restProps } = this.props;
18
+ const { className, components, inline, children, plugins = [], remarkPlugins = [], ...restProps } = this.props;
19
19
  const classes = classNames(className, {
20
20
  [styles.markdown]: !inline,
21
21
  [styles.inline]: inline
22
22
  });
23
- return (<ReactMarkdown className={classes} plugins={[RemarkBreaks, RemarkGFM, ...plugins]} components={{
23
+ return (<ReactMarkdown className={classes} remarkPlugins={[RemarkBreaks, RemarkGFM, ...plugins, ...remarkPlugins]} components={{
24
24
  a: Link,
25
25
  code: Code,
26
26
  h1: Heading,
@@ -24,12 +24,20 @@ angularModule.directive('rgCheckbox', function rgCheckboxDirective() {
24
24
  transclude: true,
25
25
  replace: true,
26
26
  template: proxyAttrs("\n<label class=\"".concat(modules_3199090e.checkbox, "\">\n <input\n data-proxy-ng-disabled\n data-proxy-ng-model\n data-proxy-ng-change\n data-proxy-ng-true-value\n data-proxy-ng-false-value\n data-proxy-name\n data-proxy-title\n data-proxy-aria-label\n data-test=\"ring-checkbox\"\n type=\"checkbox\"\n class=\"").concat(modules_3199090e.input, "\"\n />\n <span class=\"").concat(modules_3199090e.cell, "\">\n <rg-icon class=\"").concat(modules_3199090e.check, "\" glyph=\"{{:: checkmarkIcon}}\" />\n </span><span class=\"").concat(modules_3199090e.label, "\" ng-transclude></span>\n</label>\n ")),
27
- link: function link(scope, iElement) {
27
+ link: function link(scope, iElement, attrs, controller, transcludeFn) {
28
28
  scope.checkmarkIcon = checkmarkIcon;
29
29
  const input = iElement[0].querySelector('input[type="checkbox"]');
30
+ const label = iElement[0].querySelector("*[class~=\"".concat(modules_3199090e.label, "\"]"));
30
31
  const id = CHECKBOX_ID_PREFIX + idCounter++;
31
32
  iElement[0].setAttribute('for', id);
32
33
  input.setAttribute('id', id);
34
+ transcludeFn(clone => {
35
+ if (clone.length) {
36
+ label.style.display = 'initial';
37
+ } else {
38
+ label.style.display = 'none';
39
+ }
40
+ });
33
41
  }
34
42
  };
35
43
  });
@@ -1,12 +1,11 @@
1
1
  import angular from 'angular';
2
- import AngularElastic from '@jetbrains/angular-elastic';
3
2
  import MessageBundle from '../message-bundle-ng/message-bundle-ng.js';
4
3
 
5
4
  /**
6
5
  * @name Form Ng
7
6
  */
8
7
 
9
- const angularModule = angular.module('Ring.form', [MessageBundle, AngularElastic]);
8
+ const angularModule = angular.module('Ring.form', [MessageBundle]);
10
9
  angularModule.factory('getFormErrorMessages', ["RingMessageBundle", function getFormErrorMessagesDirective(RingMessageBundle) {
11
10
  function msg(id, formError) {
12
11
  const messageBundleId = "form_".concat(id);
@@ -5,5 +5,5 @@ declare module 'react-markdown/lib/complex-types' {
5
5
  language?: string;
6
6
  }
7
7
  }
8
- declare const MarkdownCode: ({ children, language, inline }: CodeProps) => JSX.Element;
8
+ declare const MarkdownCode: ({ children, language, inline, className }: CodeProps) => JSX.Element;
9
9
  export default MarkdownCode;
@@ -1,3 +1,4 @@
1
+ import 'core-js/modules/es.string.replace.js';
1
2
  import React from 'react';
2
3
  import PropTypes from 'prop-types';
3
4
  import Code from '../code/code.js';
@@ -10,13 +11,19 @@ import '../global/trivial-template-tag.js';
10
11
  import '../global/memoize.js';
11
12
 
12
13
  const MarkdownCode = _ref => {
14
+ var _className$split$find;
15
+
13
16
  let {
14
17
  children,
15
18
  language,
16
- inline
19
+ inline,
20
+ className
17
21
  } = _ref;
22
+ // Hack for updated react-markdown RG-2193
23
+ const lang = language !== null && language !== void 0 ? language : className === null || className === void 0 ? void 0 : (_className$split$find = className.split(' ').find(name => name.startsWith('language-'))) === null || _className$split$find === void 0 ? void 0 : _className$split$find.replace('language-', '');
18
24
  return /*#__PURE__*/React.createElement(Code, {
19
- language: language,
25
+ language: lang,
26
+ className: className,
20
27
  code: (children === null || children === void 0 ? void 0 : children.join('')) || '',
21
28
  inline: inline
22
29
  });
@@ -11,6 +11,7 @@ import trivialTemplateTag from '../global/trivial-template-tag.js';
11
11
  import MarkdownCode from './code.js';
12
12
  import MarkdownLink from './link.js';
13
13
  import MarkdownHeading from './heading.js';
14
+ import 'core-js/modules/es.string.replace.js';
14
15
  import '../code/code.js';
15
16
  import 'highlight.js/lib/core';
16
17
  import '../global/memoize.js';
@@ -36,6 +37,7 @@ class Markdown extends PureComponent {
36
37
  inline,
37
38
  children,
38
39
  plugins = [],
40
+ remarkPlugins = [],
39
41
  ...restProps
40
42
  } = this.props;
41
43
  const classes = classNames(className, {
@@ -44,7 +46,7 @@ class Markdown extends PureComponent {
44
46
  });
45
47
  return /*#__PURE__*/React.createElement(ReactMarkdown, _extends({
46
48
  className: classes,
47
- plugins: [RemarkBreaks, RemarkGFM, ...plugins],
49
+ remarkPlugins: [RemarkBreaks, RemarkGFM, ...plugins, ...remarkPlugins],
48
50
  components: {
49
51
  a: MarkdownLink,
50
52
  code: MarkdownCode,
@@ -15,7 +15,6 @@ import '../global/data-tests.js';
15
15
  import 'core-js/modules/web.dom-collections.iterator.js';
16
16
  import '../_helpers/loader-inline.js';
17
17
  import '../_helpers/button-set.js';
18
- import '@jetbrains/angular-elastic';
19
18
  import '../global/dom.js';
20
19
  import '../shortcuts/core.js';
21
20
  import 'combokeys';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetbrains/ring-ui",
3
- "version": "5.0.4",
3
+ "version": "5.0.7",
4
4
  "description": "JetBrains UI library",
5
5
  "author": "JetBrains",
6
6
  "license": "Apache-2.0",
@@ -72,11 +72,11 @@
72
72
  "@babel/eslint-parser": "^7.17.0",
73
73
  "@jetbrains/eslint-config": "^5.3.2",
74
74
  "@jetbrains/stylelint-config": "^3.0.2",
75
- "@primer/octicons": "^17.0.0",
75
+ "@primer/octicons": "^17.2.0",
76
76
  "@rollup/plugin-babel": "^5.3.1",
77
77
  "@rollup/plugin-node-resolve": "^13.0.6",
78
78
  "@rollup/plugin-replace": "^4.0.0",
79
- "@storybook/addon-a11y": "6.5.4",
79
+ "@storybook/addon-a11y": "6.5.6",
80
80
  "@storybook/addon-docs": "6.5.4",
81
81
  "@storybook/addon-essentials": "6.5.4",
82
82
  "@storybook/addon-storyshots": "6.5.4",
@@ -87,10 +87,10 @@
87
87
  "@storybook/client-api": "6.5.4",
88
88
  "@storybook/core": "6.5.4",
89
89
  "@storybook/html": "6.5.4",
90
- "@storybook/manager-webpack5": "6.5.4",
90
+ "@storybook/manager-webpack5": "6.5.6",
91
91
  "@storybook/react": "6.5.4",
92
92
  "@storybook/source-loader": "6.5.4",
93
- "@storybook/theming": "6.5.4",
93
+ "@storybook/theming": "6.5.6",
94
94
  "@testing-library/react": "^13.0.0",
95
95
  "@testing-library/user-event": "^14.1.0",
96
96
  "@types/chai": "^4.2.21",
@@ -105,7 +105,7 @@
105
105
  "@typescript-eslint/eslint-plugin": "^5.3.1",
106
106
  "@typescript-eslint/parser": "^5.3.1",
107
107
  "@wojtekmaj/enzyme-adapter-react-17": "^0.6.7",
108
- "angular": "^1.8.2",
108
+ "angular": "^1.8.3",
109
109
  "angular-mocks": "^1.8.2",
110
110
  "angular-route": "^1.8.3",
111
111
  "babel-plugin-react-docgen": "^4.2.1",
@@ -151,7 +151,7 @@
151
151
  "react-test-renderer": "^18.0.0",
152
152
  "regenerator-runtime": "^0.13.9",
153
153
  "rimraf": "^3.0.2",
154
- "rollup": "^2.70.1",
154
+ "rollup": "^2.75.5",
155
155
  "rollup-plugin-clear": "^2.0.7",
156
156
  "rollup-plugin-styles": "^4.0.0",
157
157
  "sinon": "^13.0.1",
@@ -190,7 +190,6 @@
190
190
  "dependencies": {
191
191
  "@babel/core": "^7.17.8",
192
192
  "@babel/preset-typescript": "^7.14.5",
193
- "@jetbrains/angular-elastic": "^2.5.1",
194
193
  "@jetbrains/babel-preset-jetbrains": "^2.3.2",
195
194
  "@jetbrains/icons": "^3.19.1",
196
195
  "@jetbrains/logos": "^1.4.27",
@@ -227,7 +226,7 @@
227
226
  "interpolate-loader": "^2.0.1",
228
227
  "just-debounce-it": "^3.0.1",
229
228
  "memoize-one": "^6.0.0",
230
- "postcss": "^8.4.12",
229
+ "postcss": "^8.4.14",
231
230
  "postcss-calc": "^8.2.4",
232
231
  "postcss-flexbugs-fixes": "^5.0.2",
233
232
  "postcss-font-family-system-ui": "^5.0.0",
@@ -254,5 +253,5 @@
254
253
  "node": ">=7.4",
255
254
  "npm": ">=6.0.0"
256
255
  },
257
- "gitHead": "db0d947c03a2ae7735c5e3f48712fbd22709010b"
256
+ "gitHead": "941dff848df5213d852524f1dd53f311a61d17e4"
258
257
  }