@semcore/typography 17.0.0-prerelease.34 → 17.0.0-prerelease.37
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 +1 -1
- package/lib/esm/Blockquote.mjs +1 -2
- package/lib/esm/List.mjs +1 -2
- package/lib/esm/Text.mjs +6 -8
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
package/lib/esm/Blockquote.mjs
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { sstyled, assignProps, createBaseComponent } from "@semcore/core";
|
|
2
2
|
import { Box } from "@semcore/base-components";
|
|
3
3
|
import isNode from "@semcore/core/lib/utils/isNode";
|
|
4
4
|
import React from "react";
|
|
5
|
-
/*!__reshadow-styles__:"./style/blockquote.shadow.css"*/
|
|
6
5
|
const styles = (
|
|
7
6
|
/*__reshadow_css_start__*/
|
|
8
7
|
(sstyled.insert(
|
package/lib/esm/List.mjs
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
-
import {
|
|
2
|
+
import { sstyled, Component, assignProps, createComponent } from "@semcore/core";
|
|
3
3
|
import { Flex } from "@semcore/base-components";
|
|
4
4
|
import { isAdvanceMode } from "@semcore/core/lib/utils/findComponent";
|
|
5
5
|
import isNode from "@semcore/core/lib/utils/isNode";
|
|
6
6
|
import React from "react";
|
|
7
7
|
import Text from "./Text.mjs";
|
|
8
|
-
/*!__reshadow-styles__:"./style/list.shadow.css"*/
|
|
9
8
|
const style = (
|
|
10
9
|
/*__reshadow_css_start__*/
|
|
11
10
|
(sstyled.insert(
|
package/lib/esm/Text.mjs
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
-
import {
|
|
2
|
+
import { sstyled, Component, assignProps, createComponent } from "@semcore/core";
|
|
3
3
|
import { Box, Hint, Ellipsis } from "@semcore/base-components";
|
|
4
4
|
import resolveColorEnhance from "@semcore/core/lib/utils/enhances/resolveColorEnhance";
|
|
5
5
|
import React from "react";
|
|
6
|
-
/*!__reshadow-styles__:"./style/text.shadow.css"*/
|
|
7
6
|
const styles = (
|
|
8
7
|
/*__reshadow_css_start__*/
|
|
9
8
|
(sstyled.insert(
|
|
@@ -98,9 +97,9 @@ class TextRoot extends Component {
|
|
|
98
97
|
const {
|
|
99
98
|
isEllipsized
|
|
100
99
|
} = this.state;
|
|
101
|
-
const cropPosition =
|
|
100
|
+
const cropPosition = ellipsisProps?.cropPosition ?? "end";
|
|
102
101
|
let withHint = hint !== false;
|
|
103
|
-
const maxLineValue = ellipsisProps
|
|
102
|
+
const maxLineValue = ellipsisProps?.maxLine;
|
|
104
103
|
if (hint !== true && hintProps === void 0 && maxLineValue !== void 0 && maxLineValue > 1) {
|
|
105
104
|
withHint = false;
|
|
106
105
|
}
|
|
@@ -132,16 +131,15 @@ class TextRoot extends Component {
|
|
|
132
131
|
ellipsisProps,
|
|
133
132
|
hint
|
|
134
133
|
} = this.asProps;
|
|
135
|
-
const shouldInit = hint !== false ||
|
|
134
|
+
const shouldInit = hint !== false || ellipsisProps?.cropPosition === "middle";
|
|
136
135
|
if (shouldInit && (ellipsis || ellipsisProps) && this.innerRef.current) {
|
|
137
136
|
this.ellipsis = ellipsis instanceof Ellipsis ? ellipsis : new Ellipsis(this.innerRef.current, ellipsisProps ?? {});
|
|
138
137
|
this.ellipsis.on("isEllipsized", this.handleEllipsized);
|
|
139
138
|
}
|
|
140
139
|
}
|
|
141
140
|
cleanUpEllipsis() {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
(_b = this.ellipsis) == null ? void 0 : _b.cleanUp();
|
|
141
|
+
this.ellipsis?.off("isEllipsized", this.handleEllipsized);
|
|
142
|
+
this.ellipsis?.cleanUp();
|
|
145
143
|
this.setState({
|
|
146
144
|
isEllipsized: false
|
|
147
145
|
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@semcore/typography",
|
|
3
3
|
"description": "Semrush Typography Component",
|
|
4
|
-
"version": "17.0.0-prerelease.
|
|
4
|
+
"version": "17.0.0-prerelease.37",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es6/index.js",
|
|
7
7
|
"typings": "lib/types/index.d.ts",
|
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"csstype": "3.1.3",
|
|
28
|
-
"@semcore/base-components": "17.0.0-prerelease.
|
|
28
|
+
"@semcore/base-components": "17.0.0-prerelease.37",
|
|
29
|
+
"@semcore/core": "17.0.0-prerelease.37",
|
|
29
30
|
"@semcore/testing-utils": "1.0.0",
|
|
30
|
-
"@semcore/
|
|
31
|
-
"@semcore/icon": "16.7.2-prerelease.34"
|
|
31
|
+
"@semcore/icon": "16.7.2-prerelease.37"
|
|
32
32
|
},
|
|
33
33
|
"scripts": {
|
|
34
34
|
"build": "pnpm semcore-builder --source=ts,js && pnpm vite build"
|