@micromag/element-heading 0.4.48 → 0.4.50

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.
Files changed (2) hide show
  1. package/es/index.js +20 -17
  2. package/package.json +3 -3
package/es/index.js CHANGED
@@ -1,9 +1,10 @@
1
1
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
2
2
  import _objectSpread from '@babel/runtime/helpers/objectSpread2';
3
3
  import classNames from 'classnames';
4
- import React, { useId } from 'react';
4
+ import { useId } from 'react';
5
5
  import { LinkStyle, HighlightStyle } from '@micromag/core/components';
6
6
  import { getStyleFromLink, getStyleFromHighlight, getStyleFromText, getStyleFromMargin, cssEscape, addNonBreakingSpaces } from '@micromag/core/utils';
7
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
7
8
 
8
9
  var styles = {"container":"micromag-element-heading-container"};
9
10
 
@@ -46,26 +47,28 @@ function Heading(_ref) {
46
47
  var needsId = finalLinkStyle !== null || highlightStyle !== null;
47
48
  var uniqueId = useId();
48
49
  var id = needsId ? "heading-component-".concat(uniqueId) : null;
49
- return /*#__PURE__*/React.createElement(React.Fragment, null, finalLinkStyle !== null ? /*#__PURE__*/React.createElement(LinkStyle, {
50
- selector: "#".concat(cssEscape(id)),
51
- style: finalLinkStyle
52
- }) : null, finalHighlightStyle !== null ? /*#__PURE__*/React.createElement(HighlightStyle, {
53
- selector: "#".concat(cssEscape(id)),
54
- style: finalHighlightStyle
55
- }) : null, /*#__PURE__*/React.createElement(HeadingComponent, {
56
- id: id,
57
- className: classNames([styles.container, className]),
58
- style: finalStyle,
59
- dangerouslySetInnerHTML: {
60
- __html: !withoutNonBreakingSpaces ? addNonBreakingSpaces(body) : body
61
- },
62
- ref: headingRef
63
- }));
50
+ return /*#__PURE__*/jsxs(Fragment, {
51
+ children: [finalLinkStyle !== null ? /*#__PURE__*/jsx(LinkStyle, {
52
+ selector: "#".concat(cssEscape(id)),
53
+ style: finalLinkStyle
54
+ }) : null, finalHighlightStyle !== null ? /*#__PURE__*/jsx(HighlightStyle, {
55
+ selector: "#".concat(cssEscape(id)),
56
+ style: finalHighlightStyle
57
+ }) : null, /*#__PURE__*/jsx(HeadingComponent, {
58
+ id: id,
59
+ className: classNames([styles.container, className]),
60
+ style: finalStyle,
61
+ dangerouslySetInnerHTML: {
62
+ __html: !withoutNonBreakingSpaces ? addNonBreakingSpaces(body) : body
63
+ },
64
+ ref: headingRef
65
+ })]
66
+ });
64
67
  }
65
68
  var Heading_default = (function (_ref3) {
66
69
  var ref = _ref3.ref,
67
70
  props = _objectWithoutProperties(_ref3, _excluded);
68
- return /*#__PURE__*/React.createElement(Heading, Object.assign({
71
+ return /*#__PURE__*/jsx(Heading, _objectSpread({
69
72
  headingRef: ref
70
73
  }, props));
71
74
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/element-heading",
3
- "version": "0.4.48",
3
+ "version": "0.4.50",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "keywords": [
@@ -60,7 +60,7 @@
60
60
  },
61
61
  "dependencies": {
62
62
  "@babel/runtime": "^7.28.6",
63
- "@micromag/core": "^0.4.48",
63
+ "@micromag/core": "^0.4.50",
64
64
  "classnames": "^2.2.6",
65
65
  "react-intl": "^8.1.3 || ^10.0.0",
66
66
  "uuid": "^9.0.0"
@@ -69,6 +69,6 @@
69
69
  "access": "public",
70
70
  "registry": "https://registry.npmjs.org/"
71
71
  },
72
- "gitHead": "d6772865be1ee3f2d19288ebfbf4b9b6860f4cd7",
72
+ "gitHead": "940d5ca98f8f448b79eaa3e2fa685c3ee95185b8",
73
73
  "types": "es/index.d.ts"
74
74
  }