@semcore/ellipsis 2.39.1 → 2.39.2-prerelease.2
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 +6 -0
- package/lib/cjs/Ellipsis.js +10 -10
- package/lib/es6/Ellipsis.js +10 -10
- package/lib/esm/Ellipsis.mjs +73 -73
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
|
|
4
4
|
|
|
5
|
+
## [2.39.2] - 2025-04-04
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- Version patch update due to children dependencies update (`@semcore/utils` [4.48.1 ~> 4.48.2], `@semcore/core` [2.39.1 ~> 2.39.2]).
|
|
10
|
+
|
|
5
11
|
## [2.39.1] - 2025-03-20
|
|
6
12
|
|
|
7
13
|
### Changed
|
package/lib/cjs/Ellipsis.js
CHANGED
|
@@ -31,16 +31,16 @@ var _assignProps3 = require("@semcore/utils/lib/assignProps");
|
|
|
31
31
|
var _excluded = ["styles", "Children", "maxLine", "tooltip", "trim", "containerRect", "containerRef", "includeTooltipProps", "children"],
|
|
32
32
|
_excluded2 = ["styles", "text", "tooltip", "containerRect", "containerRef", "textRef", "tooltipProps", "children", "advanceMode"];
|
|
33
33
|
/*__reshadow-styles__:"./style/ellipsis.shadow.css"*/
|
|
34
|
-
var style = ( /*__reshadow_css_start__*/_index.sstyled.insert( /*__inner_css_start__*/".
|
|
35
|
-
"__SContainer": "
|
|
36
|
-
"__SNoTooltipContainer": "
|
|
37
|
-
"__SContainerMiddle": "
|
|
38
|
-
"__SBeginning": "
|
|
39
|
-
"__SEllipsis": "
|
|
40
|
-
"_middle-mod": "__middle-
|
|
41
|
-
"_maxLine": "
|
|
42
|
-
"--maxLine": "--
|
|
43
|
-
"__STail": "
|
|
34
|
+
var style = ( /*__reshadow_css_start__*/_index.sstyled.insert( /*__inner_css_start__*/".___SContainerMiddle_gtb2q_gg_,.___SContainer_gtb2q_gg_,.___SEllipsis_gtb2q_gg_.__middle-mod_gtb2q_gg_,.___SNoTooltipContainer_gtb2q_gg_{display:flex;overflow:hidden}.___SBeginning_gtb2q_gg_,.___SEllipsis_gtb2q_gg_{overflow:hidden;display:inline-block;text-overflow:ellipsis;white-space:pre}.___SEllipsis_gtb2q_gg_.__maxLine_gtb2q_gg_{display:-webkit-box;-webkit-line-clamp:var(--maxLine_gtb2q);-webkit-box-orient:vertical;overflow:hidden;white-space:normal;word-wrap:break-word}.___SContainerMiddle_gtb2q_gg_>:has(.___SBeginning_gtb2q_gg_),.___SContainerMiddle_gtb2q_gg_>:has(.___STail_gtb2q_gg_){display:flex;width:100%}.___STail_gtb2q_gg_{white-space:pre}" /*__inner_css_end__*/, "gtb2q_gg_") /*__reshadow_css_end__*/, {
|
|
35
|
+
"__SContainer": "___SContainer_gtb2q_gg_",
|
|
36
|
+
"__SNoTooltipContainer": "___SNoTooltipContainer_gtb2q_gg_",
|
|
37
|
+
"__SContainerMiddle": "___SContainerMiddle_gtb2q_gg_",
|
|
38
|
+
"__SBeginning": "___SBeginning_gtb2q_gg_",
|
|
39
|
+
"__SEllipsis": "___SEllipsis_gtb2q_gg_",
|
|
40
|
+
"_middle-mod": "__middle-mod_gtb2q_gg_",
|
|
41
|
+
"_maxLine": "__maxLine_gtb2q_gg_",
|
|
42
|
+
"--maxLine": "--maxLine_gtb2q",
|
|
43
|
+
"__STail": "___STail_gtb2q_gg_"
|
|
44
44
|
});
|
|
45
45
|
var defaultTooltipProps = ['title', 'theme', 'strategy', 'modifiers', 'placement', 'interaction', 'timeout', 'visible', 'defaultVisible', 'onVisibleChange', 'offset', 'preventOverflow', 'arrow', 'flip', 'computeStyles', 'eventListeners', 'onFirstUpdate', 'cursorAnchoring'];
|
|
46
46
|
var createMeasurerElement = function createMeasurerElement(element, text) {
|
package/lib/es6/Ellipsis.js
CHANGED
|
@@ -20,16 +20,16 @@ import { useResizeObserver } from './useResizeObserver';
|
|
|
20
20
|
import useEnhancedEffect from '@semcore/utils/lib/use/useEnhancedEffect';
|
|
21
21
|
import findComponent, { isAdvanceMode } from '@semcore/utils/lib/findComponent';
|
|
22
22
|
/*__reshadow-styles__:"./style/ellipsis.shadow.css"*/
|
|
23
|
-
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".
|
|
24
|
-
"__SContainer": "
|
|
25
|
-
"__SNoTooltipContainer": "
|
|
26
|
-
"__SContainerMiddle": "
|
|
27
|
-
"__SBeginning": "
|
|
28
|
-
"__SEllipsis": "
|
|
29
|
-
"_middle-mod": "__middle-
|
|
30
|
-
"_maxLine": "
|
|
31
|
-
"--maxLine": "--
|
|
32
|
-
"__STail": "
|
|
23
|
+
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SContainerMiddle_gtb2q_gg_,.___SContainer_gtb2q_gg_,.___SEllipsis_gtb2q_gg_.__middle-mod_gtb2q_gg_,.___SNoTooltipContainer_gtb2q_gg_{display:flex;overflow:hidden}.___SBeginning_gtb2q_gg_,.___SEllipsis_gtb2q_gg_{overflow:hidden;display:inline-block;text-overflow:ellipsis;white-space:pre}.___SEllipsis_gtb2q_gg_.__maxLine_gtb2q_gg_{display:-webkit-box;-webkit-line-clamp:var(--maxLine_gtb2q);-webkit-box-orient:vertical;overflow:hidden;white-space:normal;word-wrap:break-word}.___SContainerMiddle_gtb2q_gg_>:has(.___SBeginning_gtb2q_gg_),.___SContainerMiddle_gtb2q_gg_>:has(.___STail_gtb2q_gg_){display:flex;width:100%}.___STail_gtb2q_gg_{white-space:pre}" /*__inner_css_end__*/, "gtb2q_gg_") /*__reshadow_css_end__*/, {
|
|
24
|
+
"__SContainer": "___SContainer_gtb2q_gg_",
|
|
25
|
+
"__SNoTooltipContainer": "___SNoTooltipContainer_gtb2q_gg_",
|
|
26
|
+
"__SContainerMiddle": "___SContainerMiddle_gtb2q_gg_",
|
|
27
|
+
"__SBeginning": "___SBeginning_gtb2q_gg_",
|
|
28
|
+
"__SEllipsis": "___SEllipsis_gtb2q_gg_",
|
|
29
|
+
"_middle-mod": "__middle-mod_gtb2q_gg_",
|
|
30
|
+
"_maxLine": "__maxLine_gtb2q_gg_",
|
|
31
|
+
"--maxLine": "--maxLine_gtb2q",
|
|
32
|
+
"__STail": "___STail_gtb2q_gg_"
|
|
33
33
|
});
|
|
34
34
|
import reactToText from '@semcore/utils/lib/reactToText';
|
|
35
35
|
import getOriginChildren from '@semcore/utils/lib/getOriginChildren';
|
package/lib/esm/Ellipsis.mjs
CHANGED
|
@@ -1,60 +1,60 @@
|
|
|
1
1
|
import J from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
-
import
|
|
2
|
+
import D from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
3
|
import d from "@babel/runtime/helpers/esm/objectSpread2";
|
|
4
4
|
import K from "@babel/runtime/helpers/esm/classCallCheck";
|
|
5
5
|
import Q from "@babel/runtime/helpers/esm/createClass";
|
|
6
|
-
import
|
|
6
|
+
import z from "@babel/runtime/helpers/esm/assertThisInitialized";
|
|
7
7
|
import X from "@babel/runtime/helpers/esm/inherits";
|
|
8
8
|
import Y from "@babel/runtime/helpers/esm/createSuper";
|
|
9
9
|
import S from "@babel/runtime/helpers/esm/defineProperty";
|
|
10
10
|
import { sstyled as Z } from "@semcore/utils/lib/core/index";
|
|
11
|
-
import ee, { sstyled as h, Component as te, assignProps as
|
|
11
|
+
import ee, { sstyled as h, Component as te, assignProps as F } from "@semcore/core";
|
|
12
12
|
import i from "react";
|
|
13
13
|
import R from "@semcore/tooltip";
|
|
14
|
-
import { Box as
|
|
14
|
+
import { Box as L } from "@semcore/flex-box";
|
|
15
15
|
import { useResizeObserver as ie } from "./useResizeObserver.mjs";
|
|
16
16
|
import ne from "@semcore/utils/lib/use/useEnhancedEffect";
|
|
17
17
|
import re, { isAdvanceMode as oe } from "@semcore/utils/lib/findComponent";
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
18
|
+
import N from "@semcore/utils/lib/reactToText";
|
|
19
|
+
import W from "@semcore/utils/lib/getOriginChildren";
|
|
20
|
+
import j from "@semcore/utils/lib/pick";
|
|
21
21
|
import { forkRef as le } from "@semcore/utils/lib/ref";
|
|
22
22
|
import { callAllEventHandlers as ae } from "@semcore/utils/lib/assignProps";
|
|
23
23
|
var se = ["styles", "Children", "maxLine", "tooltip", "trim", "containerRect", "containerRef", "includeTooltipProps", "children"], de = ["styles", "text", "tooltip", "containerRect", "containerRef", "textRef", "tooltipProps", "children", "advanceMode"], ce = (
|
|
24
24
|
/*__reshadow_css_start__*/
|
|
25
25
|
(Z.insert(
|
|
26
26
|
/*__inner_css_start__*/
|
|
27
|
-
".
|
|
28
|
-
"
|
|
27
|
+
".___SContainerMiddle_gtb2q_gg_,.___SContainer_gtb2q_gg_,.___SEllipsis_gtb2q_gg_.__middle-mod_gtb2q_gg_,.___SNoTooltipContainer_gtb2q_gg_{display:flex;overflow:hidden}.___SBeginning_gtb2q_gg_,.___SEllipsis_gtb2q_gg_{overflow:hidden;display:inline-block;text-overflow:ellipsis;white-space:pre}.___SEllipsis_gtb2q_gg_.__maxLine_gtb2q_gg_{display:-webkit-box;-webkit-line-clamp:var(--maxLine_gtb2q);-webkit-box-orient:vertical;overflow:hidden;white-space:normal;word-wrap:break-word}.___SContainerMiddle_gtb2q_gg_>:has(.___SBeginning_gtb2q_gg_),.___SContainerMiddle_gtb2q_gg_>:has(.___STail_gtb2q_gg_){display:flex;width:100%}.___STail_gtb2q_gg_{white-space:pre}",
|
|
28
|
+
"gtb2q_gg_"
|
|
29
29
|
), {
|
|
30
|
-
__SContainer: "
|
|
31
|
-
__SNoTooltipContainer: "
|
|
32
|
-
__SContainerMiddle: "
|
|
33
|
-
__SBeginning: "
|
|
34
|
-
__SEllipsis: "
|
|
35
|
-
"_middle-mod": "__middle-
|
|
36
|
-
_maxLine: "
|
|
37
|
-
"--maxLine": "--
|
|
38
|
-
__STail: "
|
|
30
|
+
__SContainer: "___SContainer_gtb2q_gg_",
|
|
31
|
+
__SNoTooltipContainer: "___SNoTooltipContainer_gtb2q_gg_",
|
|
32
|
+
__SContainerMiddle: "___SContainerMiddle_gtb2q_gg_",
|
|
33
|
+
__SBeginning: "___SBeginning_gtb2q_gg_",
|
|
34
|
+
__SEllipsis: "___SEllipsis_gtb2q_gg_",
|
|
35
|
+
"_middle-mod": "__middle-mod_gtb2q_gg_",
|
|
36
|
+
_maxLine: "__maxLine_gtb2q_gg_",
|
|
37
|
+
"--maxLine": "--maxLine_gtb2q",
|
|
38
|
+
__STail: "___STail_gtb2q_gg_"
|
|
39
39
|
})
|
|
40
|
-
), pe = ["title", "theme", "strategy", "modifiers", "placement", "interaction", "timeout", "visible", "defaultVisible", "onVisibleChange", "offset", "preventOverflow", "arrow", "flip", "computeStyles", "eventListeners", "onFirstUpdate", "cursorAnchoring"],
|
|
40
|
+
), pe = ["title", "theme", "strategy", "modifiers", "placement", "interaction", "timeout", "visible", "defaultVisible", "onVisibleChange", "offset", "preventOverflow", "arrow", "flip", "computeStyles", "eventListeners", "onFirstUpdate", "cursorAnchoring"], ge = function(o, l) {
|
|
41
41
|
var t = window.getComputedStyle(o, null), e = document.createElement("temporary-block");
|
|
42
42
|
return e.style.display = t.getPropertyValue("display"), e.style.padding = t.getPropertyValue("padding"), e.style.position = "absolute", e.style.right = "0%", e.style.bottom = "0%", e.style.visibility = "hidden", e.style.fontFamily = t.getPropertyValue("font-family"), e.style.fontSize = t.getPropertyValue("font-size"), e.style.fontWeight = t.getPropertyValue("font-weight"), e.style.lineHeight = t.getPropertyValue("line-height"), e.style.whiteSpace = t.getPropertyValue("white-space"), e.style.wordWrap = t.getPropertyValue("word-wrap"), e.style.fontFeatureSettings = t.getPropertyValue("font-feature-settings"), e.style.fontVariantNumeric = t.getPropertyValue("font-variant-numeric"), e.innerHTML = l ?? o.innerHTML, e;
|
|
43
43
|
};
|
|
44
|
-
function
|
|
44
|
+
function _e(u, o, l) {
|
|
45
45
|
if (!u) return !1;
|
|
46
|
-
var t = u.getBoundingClientRect(), e = t.height, a = t.width, r =
|
|
46
|
+
var t = u.getBoundingClientRect(), e = t.height, a = t.width, r = ge(u, l), n = !1;
|
|
47
47
|
if (document.body.appendChild(r), o) {
|
|
48
48
|
r.style.width = "".concat(a, "px");
|
|
49
|
-
var
|
|
50
|
-
(Math.ceil(e) < s || Math.ceil(a) <
|
|
49
|
+
var g = r.scrollWidth, s = r.getBoundingClientRect().height;
|
|
50
|
+
(Math.ceil(e) < s || Math.ceil(a) < g) && (n = !0);
|
|
51
51
|
} else
|
|
52
52
|
r.style.whiteSpace = "nowrap", n = Math.ceil(a) < r.getBoundingClientRect().width;
|
|
53
53
|
return document.body.removeChild(r), n;
|
|
54
54
|
}
|
|
55
|
-
var
|
|
55
|
+
var I = {
|
|
56
56
|
forcedAdvancedMode: !0
|
|
57
|
-
},
|
|
57
|
+
}, me = {}, B = /* @__PURE__ */ function(u) {
|
|
58
58
|
X(l, u);
|
|
59
59
|
var o = Y(l);
|
|
60
60
|
function l() {
|
|
@@ -62,9 +62,9 @@ var U = {
|
|
|
62
62
|
K(this, l);
|
|
63
63
|
for (var e = arguments.length, a = new Array(e), r = 0; r < e; r++)
|
|
64
64
|
a[r] = arguments[r];
|
|
65
|
-
return t = o.call.apply(o, [this].concat(a)), S(
|
|
65
|
+
return t = o.call.apply(o, [this].concat(a)), S(z(t), "state", {
|
|
66
66
|
visible: !1
|
|
67
|
-
}), S(
|
|
67
|
+
}), S(z(t), "textRef", /* @__PURE__ */ i.createRef()), S(z(t), "handlerVisibleChange", function(n) {
|
|
68
68
|
t.setState({
|
|
69
69
|
visible: n && t.showTooltip()
|
|
70
70
|
});
|
|
@@ -73,8 +73,8 @@ var U = {
|
|
|
73
73
|
return Q(l, [{
|
|
74
74
|
key: "showTooltip",
|
|
75
75
|
value: function() {
|
|
76
|
-
var e = this.asProps, a = e.maxLine, r = a === void 0 ? 1 : a, n = e.Children,
|
|
77
|
-
return
|
|
76
|
+
var e = this.asProps, a = e.maxLine, r = a === void 0 ? 1 : a, n = e.Children, g = N(W(n));
|
|
77
|
+
return _e(this.textRef.current, r > 1, g);
|
|
78
78
|
}
|
|
79
79
|
}, {
|
|
80
80
|
key: "getContentProps",
|
|
@@ -87,23 +87,23 @@ var U = {
|
|
|
87
87
|
}, {
|
|
88
88
|
key: "getPopperProps",
|
|
89
89
|
value: function() {
|
|
90
|
-
var e = this.asProps, a = e.Children, r = e.includeTooltipProps, n = W(
|
|
90
|
+
var e = this.asProps, a = e.Children, r = e.includeTooltipProps, n = N(W(a)), g = j(this.asProps, r);
|
|
91
91
|
return d({
|
|
92
92
|
children: n
|
|
93
|
-
},
|
|
93
|
+
}, g);
|
|
94
94
|
}
|
|
95
95
|
}, {
|
|
96
96
|
key: "render",
|
|
97
97
|
value: function() {
|
|
98
|
-
var e, a, r = this.Root, n = R,
|
|
98
|
+
var e, a, r = this.Root, n = R, g = L, s = this.asProps, _ = s.styles, c = s.Children, y = s.maxLine, m = s.tooltip, k = s.trim, M = s.containerRect, E = s.containerRef, A = s.includeTooltipProps;
|
|
99
99
|
s.children;
|
|
100
|
-
var b =
|
|
101
|
-
if (p.visible = (a = p.visible) !== null && a !== void 0 ? a : T, p.onVisibleChange = p.onVisibleChange ? ae(p.onVisibleChange, this.handlerVisibleChange) : this.handlerVisibleChange,
|
|
100
|
+
var b = D(s, se), T = this.state.visible, q = re(c, [$.Content.displayName]), P = N(q || W(c)), f = oe(c, [$.Content.displayName, $.Popper.displayName]), p = j(this.asProps, A);
|
|
101
|
+
if (p.visible = (a = p.visible) !== null && a !== void 0 ? a : T, p.onVisibleChange = p.onVisibleChange ? ae(p.onVisibleChange, this.handlerVisibleChange) : this.handlerVisibleChange, k === "middle") {
|
|
102
102
|
var C;
|
|
103
|
-
return C = h(
|
|
103
|
+
return C = h(_), /* @__PURE__ */ i.createElement(ue, C.cn("EllipsisMiddle", d({
|
|
104
104
|
text: P,
|
|
105
|
-
styles:
|
|
106
|
-
tooltip:
|
|
105
|
+
styles: _,
|
|
106
|
+
tooltip: m,
|
|
107
107
|
containerRect: M,
|
|
108
108
|
containerRef: E,
|
|
109
109
|
textRef: this.textRef,
|
|
@@ -111,53 +111,53 @@ var U = {
|
|
|
111
111
|
advanceMode: f
|
|
112
112
|
}, b)), /* @__PURE__ */ i.createElement(c, C.cn("Children", {})));
|
|
113
113
|
}
|
|
114
|
-
if (
|
|
114
|
+
if (m) {
|
|
115
115
|
var v;
|
|
116
|
-
return v = h(
|
|
116
|
+
return v = h(_), /* @__PURE__ */ i.createElement(n, v.cn("SContainer", d(d({
|
|
117
117
|
interaction: "hover",
|
|
118
118
|
title: f ? void 0 : P
|
|
119
|
-
}, p), f ?
|
|
120
|
-
render:
|
|
119
|
+
}, p), f ? I : me)), f ? /* @__PURE__ */ i.createElement(c, v.cn("Children", {})) : /* @__PURE__ */ i.createElement(r, v.cn("SEllipsis", d({
|
|
120
|
+
render: L,
|
|
121
121
|
ref: this.textRef,
|
|
122
122
|
maxLine: y
|
|
123
123
|
}, b)), /* @__PURE__ */ i.createElement(c, v.cn("Children", {}))));
|
|
124
124
|
}
|
|
125
|
-
return e = h(
|
|
126
|
-
render:
|
|
125
|
+
return e = h(_), /* @__PURE__ */ i.createElement(g, e.cn("SNoTooltipContainer", {}), f ? /* @__PURE__ */ i.createElement(c, e.cn("Children", {})) : /* @__PURE__ */ i.createElement(r, e.cn("SEllipsis", d({
|
|
126
|
+
render: L,
|
|
127
127
|
ref: this.textRef,
|
|
128
128
|
maxLine: y
|
|
129
129
|
}, b)), /* @__PURE__ */ i.createElement(c, e.cn("Children", {}))));
|
|
130
130
|
}
|
|
131
131
|
}]), l;
|
|
132
132
|
}(te);
|
|
133
|
-
S(
|
|
134
|
-
S(
|
|
135
|
-
S(
|
|
133
|
+
S(B, "displayName", "Ellipsis");
|
|
134
|
+
S(B, "style", ce);
|
|
135
|
+
S(B, "defaultProps", {
|
|
136
136
|
trim: "end",
|
|
137
137
|
tooltip: !0,
|
|
138
138
|
includeTooltipProps: pe,
|
|
139
139
|
__excludeProps: ["title"]
|
|
140
140
|
});
|
|
141
|
-
var
|
|
142
|
-
var l, t = o.styles, e = o.text, a = o.tooltip, r = o.containerRect, n = o.containerRef,
|
|
141
|
+
var U = /* @__PURE__ */ i.createContext(null), ue = function(o) {
|
|
142
|
+
var l, t = o.styles, e = o.text, a = o.tooltip, r = o.containerRect, n = o.containerRef, g = o.textRef, s = o.tooltipProps, _ = o.children, c = o.advanceMode, y = D(o, de), m = i.useRef(null), k = i.useState({
|
|
143
143
|
fontSize: "14",
|
|
144
144
|
symbolWidth: 0
|
|
145
|
-
}), M = J(
|
|
145
|
+
}), M = J(k, 2), E = M[0], A = M[1], b = ie(m, r).width;
|
|
146
146
|
ne(function() {
|
|
147
|
-
var
|
|
148
|
-
if (
|
|
147
|
+
var O = (n == null ? void 0 : n.current) || (m == null ? void 0 : m.current);
|
|
148
|
+
if (O) {
|
|
149
149
|
var w = document.createElement("temporary-block");
|
|
150
150
|
w.setAttribute("style", "fontSize: ".concat(E.fontSize, "px")), w.innerHTML = "a", document.body.appendChild(w);
|
|
151
151
|
var G = w.getBoundingClientRect();
|
|
152
|
-
|
|
153
|
-
fontSize: window.getComputedStyle(
|
|
152
|
+
A({
|
|
153
|
+
fontSize: window.getComputedStyle(O, null).getPropertyValue("font-size"),
|
|
154
154
|
symbolWidth: G.width
|
|
155
155
|
}), document.body.removeChild(w);
|
|
156
156
|
}
|
|
157
157
|
}, []);
|
|
158
|
-
var T = "span",
|
|
158
|
+
var T = "span", q = "span", P = o.tag || L, f = R, p = i.useMemo(function() {
|
|
159
159
|
return Math.round(b / E.symbolWidth);
|
|
160
|
-
}, [b, E.symbolWidth]), C = e.length > p ? "hover" : "none", v = n ??
|
|
160
|
+
}, [b, E.symbolWidth]), C = e.length > p ? "hover" : "none", v = n ?? m, x = i.useMemo(function() {
|
|
161
161
|
return {
|
|
162
162
|
begining: e.substring(0, e.length - p / 2 - 1),
|
|
163
163
|
tail: e.substring(e.length - p / 2 - 1),
|
|
@@ -165,40 +165,40 @@ var q = /* @__PURE__ */ i.createContext(null), ue = function(o) {
|
|
|
165
165
|
};
|
|
166
166
|
}, [e, p]);
|
|
167
167
|
if (c) {
|
|
168
|
-
var
|
|
169
|
-
return
|
|
168
|
+
var H;
|
|
169
|
+
return H = h(t), /* @__PURE__ */ i.createElement(f, H.cn("SAdvancedModeContainerMiddle", d(d({
|
|
170
170
|
interaction: C
|
|
171
|
-
}, s),
|
|
171
|
+
}, s), I)), /* @__PURE__ */ i.createElement(U.Provider, {
|
|
172
172
|
value: x
|
|
173
|
-
},
|
|
173
|
+
}, _));
|
|
174
174
|
}
|
|
175
175
|
if (a) {
|
|
176
|
-
var
|
|
177
|
-
return
|
|
176
|
+
var V;
|
|
177
|
+
return V = h(t), /* @__PURE__ */ i.createElement(P, V.cn("SContainerMiddle", d({
|
|
178
178
|
interaction: C,
|
|
179
179
|
title: e,
|
|
180
|
-
ref: le(v,
|
|
180
|
+
ref: le(v, g),
|
|
181
181
|
tag: R,
|
|
182
182
|
__excludeProps: ["title"]
|
|
183
|
-
}, s)), /* @__PURE__ */ i.createElement(
|
|
183
|
+
}, s)), /* @__PURE__ */ i.createElement(q, V.cn("SBeginning", {}), x.begining), /* @__PURE__ */ i.createElement(T, V.cn("STail", {}), x.tail));
|
|
184
184
|
}
|
|
185
185
|
return l = h(t), /* @__PURE__ */ i.createElement(P, l.cn("SContainerMiddle", d(d({}, y), {}, {
|
|
186
|
-
ref: n ??
|
|
187
|
-
})), /* @__PURE__ */ i.createElement(
|
|
186
|
+
ref: n ?? m
|
|
187
|
+
})), /* @__PURE__ */ i.createElement(q, l.cn("SBeginning", {}), x.begining), /* @__PURE__ */ i.createElement(T, l.cn("STail", {}), x.tail));
|
|
188
188
|
}, ve = function(o) {
|
|
189
|
-
var l = arguments[0], t, e = o.styles, a = o.Children, r = R.Trigger, n = i.useContext(
|
|
189
|
+
var l = arguments[0], t, e = o.styles, a = o.Children, r = R.Trigger, n = i.useContext(U), g = "span", s = "span";
|
|
190
190
|
if (n) {
|
|
191
|
-
var
|
|
192
|
-
return
|
|
191
|
+
var _, c = n.begining, y = n.tail, m = n.ref;
|
|
192
|
+
return _ = h(e), /* @__PURE__ */ i.createElement(r, _.cn("SEllipsis", d({}, F({
|
|
193
193
|
"middle-mod": !0,
|
|
194
|
-
ref:
|
|
195
|
-
}, l))), /* @__PURE__ */ i.createElement(s,
|
|
194
|
+
ref: m
|
|
195
|
+
}, l))), /* @__PURE__ */ i.createElement(s, _.cn("SBeginning", {}), c), /* @__PURE__ */ i.createElement(g, _.cn("STail", {}), y));
|
|
196
196
|
}
|
|
197
|
-
return t = h(e), /* @__PURE__ */ i.createElement(r, t.cn("SEllipsis", d({},
|
|
198
|
-
},
|
|
197
|
+
return t = h(e), /* @__PURE__ */ i.createElement(r, t.cn("SEllipsis", d({}, F({}, l))), /* @__PURE__ */ i.createElement(a, t.cn("Children", {})));
|
|
198
|
+
}, $ = ee(B, {
|
|
199
199
|
Content: ve,
|
|
200
200
|
Popper: R.Popper
|
|
201
201
|
});
|
|
202
202
|
export {
|
|
203
|
-
|
|
203
|
+
$ as default
|
|
204
204
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@semcore/ellipsis",
|
|
3
3
|
"description": "Semrush Ellipsis Component",
|
|
4
|
-
"version": "2.39.
|
|
4
|
+
"version": "2.39.2-prerelease.2",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es6/index.js",
|
|
7
7
|
"typings": "lib/types/index.d.ts",
|
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
"types": "./lib/types/index.d.ts"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@semcore/utils": "4.48.
|
|
18
|
-
"@semcore/flex-box": "5.41.
|
|
19
|
-
"@semcore/tooltip": "6.49.
|
|
17
|
+
"@semcore/utils": "4.48.2-prerelease.2",
|
|
18
|
+
"@semcore/flex-box": "5.41.2-prerelease.2",
|
|
19
|
+
"@semcore/tooltip": "6.49.2-prerelease.2"
|
|
20
20
|
},
|
|
21
21
|
"peerDependencies": {
|
|
22
|
-
"@semcore/core": "^2.
|
|
22
|
+
"@semcore/core": "^2.39.2-prerelease.2",
|
|
23
23
|
"react": "16.8 - 18",
|
|
24
24
|
"react-dom": "16.8 - 18"
|
|
25
25
|
},
|