@micromag/element-text 0.3.832 → 0.4.4

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.
@@ -1 +1 @@
1
- .micromag-element-text-container{font-family:Helvetica,Arial,sans-serif;font-size:16px;font-weight:400;line-height:1.1}.micromag-element-text-container em,.micromag-element-text-container i{font-style:italic}.micromag-element-text-container b,.micromag-element-text-container strong{font-weight:700}.micromag-element-text-container p{margin-bottom:.5em;margin-top:.5em}.micromag-element-text-container mark{-webkit-box-decoration-break:clone;box-decoration-break:clone;padding:0}.micromag-element-text-container{line-height:1.3}.micromag-element-text-container h2{font-size:2em}.micromag-element-text-container h3{font-size:1.75em}.micromag-element-text-container h4{font-size:1.5em}.micromag-element-text-container blockquote{padding:0 0 0 1em}.micromag-element-text-container img{display:block;height:auto;max-width:100%;width:auto}.micromag-element-text-container{margin:0;padding:0}.micromag-element-text-container.micromag-element-text-showEmpty{border:2px dashed #343434;color:#343434;display:inline-block;height:80px;width:300px}.micromag-element-text-container.micromag-element-text-withLineClamp{display:-webkit-box;-webkit-box-orient:vertical;overflow:hidden}.micromag-element-text-container p{font-weight:inherit}
1
+ .container{font-family:Helvetica,Arial,sans-serif;font-size:16px;font-weight:400;line-height:1.3;margin:0;padding:0}.container em,.container i{font-style:italic}.container b,.container strong{font-weight:700}.container p{font-weight:inherit;margin-bottom:.5em;margin-top:.5em}.container mark{-webkit-box-decoration-break:clone;box-decoration-break:clone;padding:0}.container h2{font-size:2em}.container h3{font-size:1.75em}.container h4{font-size:1.5em}.container blockquote{padding:0 0 0 1em}.container img{display:block;height:auto;max-width:100%;width:auto}.container.showEmpty{border:2px dashed var(--mm-gray-800);color:var(--mm-gray-800);display:inline-block;height:80px;width:300px}.container.withLineClamp{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical}
package/es/index.d.ts ADDED
@@ -0,0 +1,21 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { TextStyle, BoxStyle, Margin } from '@micromag/core';
3
+
4
+ interface TextProps {
5
+ body?: string | null;
6
+ textStyle?: TextStyle | null;
7
+ boxStyle?: BoxStyle | null;
8
+ linksStyle?: TextStyle | null;
9
+ margin?: Margin | null;
10
+ lineClamp?: number | null;
11
+ showEmpty?: boolean;
12
+ className?: string | null;
13
+ emptyClassName?: string | null;
14
+ inline?: boolean;
15
+ refText?: ((...args: unknown[]) => void | {
16
+ current?: unknown;
17
+ }) | null;
18
+ }
19
+ declare function Text({ body, textStyle, boxStyle, linksStyle, margin, lineClamp, showEmpty, className, emptyClassName, inline, refText, }: TextProps): react_jsx_runtime.JSX.Element;
20
+
21
+ export { Text as default };
package/es/index.js CHANGED
@@ -1,54 +1,35 @@
1
1
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
2
2
  import _objectSpread from '@babel/runtime/helpers/objectSpread2';
3
3
  import classNames from 'classnames';
4
- import PropTypes from 'prop-types';
5
4
  import React, { useId } from 'react';
6
- import { PropTypes as PropTypes$1 } from '@micromag/core';
7
5
  import { LinkStyle, HighlightStyle } from '@micromag/core/components';
8
6
  import { getStyleFromLink, getStyleFromHighlight, getStyleFromText, getStyleFromBox, getStyleFromMargin } from '@micromag/core/utils';
9
7
 
10
- var styles = {"container":"micromag-element-text-container","showEmpty":"micromag-element-text-showEmpty","withLineClamp":"micromag-element-text-withLineClamp"};
8
+ var styles = {"container":"container","showEmpty":"showEmpty","withLineClamp":"withLineClamp"};
11
9
 
12
- var propTypes = {
13
- body: PropTypes.string,
14
- textStyle: PropTypes$1.textStyle,
15
- boxStyle: PropTypes$1.boxStyle,
16
- linksStyle: PropTypes$1.textStyle,
17
- margin: PropTypes$1.margin,
18
- lineClamp: PropTypes.number,
19
- showEmpty: PropTypes.bool,
20
- className: PropTypes.string,
21
- emptyClassName: PropTypes.string,
22
- inline: PropTypes.bool,
23
- refText: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
24
- current: PropTypes.any // eslint-disable-line
25
- })])
26
- };
27
- var defaultProps = {
28
- body: null,
29
- textStyle: null,
30
- boxStyle: null,
31
- linksStyle: null,
32
- margin: null,
33
- lineClamp: null,
34
- showEmpty: false,
35
- className: null,
36
- emptyClassName: null,
37
- inline: false,
38
- refText: null
39
- };
40
- var Text = function Text(_ref) {
41
- var body = _ref.body,
42
- textStyle = _ref.textStyle,
43
- boxStyle = _ref.boxStyle,
44
- linksStyle = _ref.linksStyle,
45
- margin = _ref.margin,
46
- lineClamp = _ref.lineClamp,
47
- showEmpty = _ref.showEmpty,
48
- className = _ref.className,
49
- emptyClassName = _ref.emptyClassName,
50
- inline = _ref.inline,
51
- refText = _ref.refText;
10
+ function Text(_ref) {
11
+ var _ref$body = _ref.body,
12
+ body = _ref$body === void 0 ? null : _ref$body,
13
+ _ref$textStyle = _ref.textStyle,
14
+ textStyle = _ref$textStyle === void 0 ? null : _ref$textStyle,
15
+ _ref$boxStyle = _ref.boxStyle,
16
+ boxStyle = _ref$boxStyle === void 0 ? null : _ref$boxStyle,
17
+ _ref$linksStyle = _ref.linksStyle,
18
+ linksStyle = _ref$linksStyle === void 0 ? null : _ref$linksStyle,
19
+ _ref$margin = _ref.margin,
20
+ margin = _ref$margin === void 0 ? null : _ref$margin,
21
+ _ref$lineClamp = _ref.lineClamp,
22
+ lineClamp = _ref$lineClamp === void 0 ? null : _ref$lineClamp,
23
+ _ref$showEmpty = _ref.showEmpty,
24
+ showEmpty = _ref$showEmpty === void 0 ? false : _ref$showEmpty,
25
+ _ref$className = _ref.className,
26
+ className = _ref$className === void 0 ? null : _ref$className,
27
+ _ref$emptyClassName = _ref.emptyClassName,
28
+ emptyClassName = _ref$emptyClassName === void 0 ? null : _ref$emptyClassName,
29
+ _ref$inline = _ref.inline,
30
+ inline = _ref$inline === void 0 ? false : _ref$inline,
31
+ _ref$refText = _ref.refText,
32
+ refText = _ref$refText === void 0 ? null : _ref$refText;
52
33
  var _ref2 = textStyle || {},
53
34
  _ref2$link = _ref2.link,
54
35
  linkStyle = _ref2$link === void 0 ? null : _ref2$link,
@@ -97,8 +78,6 @@ var Text = function Text(_ref) {
97
78
  selector: "#".concat(CSS.escape(id)),
98
79
  style: finalHighlightStyle
99
80
  }) : null, /*#__PURE__*/React.createElement(Tag, tagProps));
100
- };
101
- Text.propTypes = propTypes;
102
- Text.defaultProps = defaultProps;
81
+ }
103
82
 
104
83
  export { Text as default };
package/es/styles.css ADDED
@@ -0,0 +1 @@
1
+ .container{font-family:Helvetica,Arial,sans-serif;font-size:16px;font-weight:400;line-height:1.3;margin:0;padding:0}.container em,.container i{font-style:italic}.container b,.container strong{font-weight:700}.container p{font-weight:inherit;margin-bottom:.5em;margin-top:.5em}.container mark{-webkit-box-decoration-break:clone;box-decoration-break:clone;padding:0}.container h2{font-size:2em}.container h3{font-size:1.75em}.container h4{font-size:1.5em}.container blockquote{padding:0 0 0 1em}.container img{display:block;height:auto;max-width:100%;width:auto}.container.showEmpty{border:2px dashed var(--mm-gray-800);color:var(--mm-gray-800);display:inline-block;height:80px;width:300px}.container.withLineClamp{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/element-text",
3
- "version": "0.3.832",
3
+ "version": "0.4.4",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "keywords": [
@@ -34,6 +34,7 @@
34
34
  "module": "es/index.js",
35
35
  "exports": {
36
36
  ".": {
37
+ "types": "./es/index.d.ts",
37
38
  "import": "./es/index.js"
38
39
  },
39
40
  "./assets/css/styles": "./assets/css/styles.css",
@@ -47,27 +48,27 @@
47
48
  "scripts": {
48
49
  "clean": "rm -rf es && rm -rf lib && rm -rf assets",
49
50
  "prepublishOnly": "npm run build",
50
- "build": "../../scripts/prepare-package.sh"
51
+ "build": "../../scripts/prepare-package.sh --types"
51
52
  },
52
53
  "devDependencies": {
53
- "react": "^16.8.0 || ^17.0.0 || ^18.0.0",
54
- "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
54
+ "react": "^19.2.0",
55
+ "react-dom": "^18.3.0 || ^19.0.0"
55
56
  },
56
57
  "peerDependencies": {
57
- "react": "^16.8.0 || ^17.0.0 || ^18.0.0",
58
- "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
58
+ "react": "^19.2.0",
59
+ "react-dom": "^18.3.0 || ^19.0.0"
59
60
  },
60
61
  "dependencies": {
61
62
  "@babel/runtime": "^7.13.10",
62
- "@micromag/core": "^0.3.832",
63
+ "@micromag/core": "^0.4.4",
63
64
  "classnames": "^2.2.6",
64
- "prop-types": "^15.7.2",
65
- "react-intl": "^6.6.4",
65
+ "react-intl": "^8.1.3",
66
66
  "uuid": "^9.0.0"
67
67
  },
68
68
  "publishConfig": {
69
69
  "access": "public",
70
70
  "registry": "https://registry.npmjs.org/"
71
71
  },
72
- "gitHead": "4969d64e304334cfd47321e624e5914e0694c55f"
72
+ "gitHead": "04b8519c3a3ddace5a21497e22faa11865d57f6d",
73
+ "types": "es/index.d.ts"
73
74
  }