@semcore/ellipsis 16.0.1 → 16.0.2-prerelease.3

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 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
+ ## [16.0.2] - 2025-06-16
6
+
7
+ ### Changed
8
+
9
+ - Version patch update due to children dependencies update (`@semcore/base-components` [16.0.1 ~> 16.0.2]).
10
+
5
11
  ## [16.0.1] - 2025-05-30
6
12
 
7
13
  ### Changed
package/README.md CHANGED
@@ -13,40 +13,10 @@
13
13
  ## Install
14
14
 
15
15
  ```sh
16
- npm install intergalactic
16
+ npm install @semcore/ellipsis
17
17
  ```
18
18
 
19
- ## Usage
20
19
 
21
- ```jsx
22
- import Ellipsis from 'intergalactic/ellipsis';
23
- ```
24
-
25
- <details>
26
- <summary>Alternative installation and use</summary>
27
-
28
- **We do not recommend this usage path due to possible dependency and update issues.**
29
-
30
- ### Install
31
-
32
- You can only install one package from the design system
33
-
34
- ```sh
35
- npm install @semcore/ellipsis @semcore/core
36
- ```
37
-
38
- `@semcore/core` - _is the basic package by which we create our components, and it contains all of the common logic
39
- of the components that is discussed below. There should only be one version of the package in the project._
40
-
41
- </details>
42
-
43
- ### Usage
44
-
45
- You can use the package the same way but without `/ui/` in the import path.
46
-
47
- ```jsx
48
- import Ellipsis from '@semcore/ellipsis';
49
- ```
50
20
 
51
21
  ## 👤 Author
52
22
 
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
4
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"];
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
@@ -11,37 +11,39 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
11
11
  var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
12
12
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
13
13
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
14
- var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
14
+ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
15
+ var _isNativeReflectConstruct2 = _interopRequireDefault(require("@babel/runtime/helpers/isNativeReflectConstruct"));
16
+ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
15
17
  var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
16
- var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
17
18
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
18
19
  var _core = require("@semcore/core");
19
- var _react = _interopRequireDefault(require("react"));
20
- var _tooltip = _interopRequireDefault(require("@semcore/tooltip"));
21
- var _flexBox = require("@semcore/flex-box");
22
- var _useResizeObserver = require("./useResizeObserver");
23
- var _useEnhancedEffect = _interopRequireDefault(require("@semcore/core/lib/utils/use/useEnhancedEffect"));
20
+ var _assignProps3 = require("@semcore/core/lib/utils/assignProps");
24
21
  var _findComponent = _interopRequireWildcard(require("@semcore/core/lib/utils/findComponent"));
25
- var _reactToText = _interopRequireDefault(require("@semcore/core/lib/utils/reactToText"));
26
22
  var _getOriginChildren = _interopRequireDefault(require("@semcore/core/lib/utils/getOriginChildren"));
27
23
  var _pick = _interopRequireDefault(require("@semcore/core/lib/utils/pick"));
28
- var _ref11 = require("@semcore/core/lib/utils/ref");
29
- var _assignProps3 = require("@semcore/core/lib/utils/assignProps");
24
+ var _reactToText = _interopRequireDefault(require("@semcore/core/lib/utils/reactToText"));
25
+ var _ref1 = require("@semcore/core/lib/utils/ref");
26
+ var _useEnhancedEffect = _interopRequireDefault(require("@semcore/core/lib/utils/use/useEnhancedEffect"));
27
+ var _flexBox = require("@semcore/flex-box");
28
+ var _tooltip = _interopRequireDefault(require("@semcore/tooltip"));
29
+ var _react = _interopRequireDefault(require("react"));
30
+ var _useResizeObserver = require("./useResizeObserver");
30
31
  var _excluded = ["styles", "Children", "maxLine", "tooltip", "trim", "containerRect", "containerRef", "includeTooltipProps", "children"],
31
32
  _excluded2 = ["styles", "text", "tooltip", "containerRect", "containerRef", "textRef", "tooltipProps", "children", "advanceMode"];
33
+ function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, (0, _isNativeReflectConstruct2["default"])() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
32
34
  /*!__reshadow-styles__:"./style/ellipsis.shadow.css"*/
33
- var style = ( /*__reshadow_css_start__*/_core.sstyled.insert( /*__inner_css_start__*/".___SContainerMiddle_v9sub_gg_,.___SContainer_v9sub_gg_,.___SEllipsis_v9sub_gg_.__middle-mod_v9sub_gg_,.___SNoTooltipContainer_v9sub_gg_{display:flex;overflow:hidden}.___SBeginning_v9sub_gg_,.___SEllipsis_v9sub_gg_{overflow:hidden;display:inline-block;text-overflow:ellipsis;white-space:pre}.___SEllipsis_v9sub_gg_.__maxLine_v9sub_gg_{display:-webkit-box;-webkit-line-clamp:var(--maxLine_v9sub);-webkit-box-orient:vertical;overflow:hidden;white-space:normal;word-wrap:break-word}.___SContainerMiddle_v9sub_gg_>:has(.___SBeginning_v9sub_gg_),.___SContainerMiddle_v9sub_gg_>:has(.___STail_v9sub_gg_){display:flex;width:100%}.___STail_v9sub_gg_{white-space:pre}", /*__inner_css_end__*/"v9sub_gg_"),
35
+ var style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".___SContainerMiddle_1656k_gg_,.___SContainer_1656k_gg_,.___SEllipsis_1656k_gg_.__middle-mod_1656k_gg_,.___SNoTooltipContainer_1656k_gg_{display:flex;overflow:hidden}.___SBeginning_1656k_gg_,.___SEllipsis_1656k_gg_{overflow:hidden;display:inline-block;text-overflow:ellipsis;white-space:pre}.___SEllipsis_1656k_gg_.__maxLine_1656k_gg_{display:-webkit-box;-webkit-line-clamp:var(--maxLine_1656k);-webkit-box-orient:vertical;overflow:hidden;white-space:normal;word-wrap:break-word}.___SContainerMiddle_1656k_gg_>:has(.___SBeginning_1656k_gg_),.___SContainerMiddle_1656k_gg_>:has(.___STail_1656k_gg_){display:flex;width:100%}.___STail_1656k_gg_{white-space:pre}", /*__inner_css_end__*/"1656k_gg_"),
34
36
  /*__reshadow_css_end__*/
35
37
  {
36
- "__SContainer": "___SContainer_v9sub_gg_",
37
- "__SNoTooltipContainer": "___SNoTooltipContainer_v9sub_gg_",
38
- "__SContainerMiddle": "___SContainerMiddle_v9sub_gg_",
39
- "__SBeginning": "___SBeginning_v9sub_gg_",
40
- "__SEllipsis": "___SEllipsis_v9sub_gg_",
41
- "_middle-mod": "__middle-mod_v9sub_gg_",
42
- "_maxLine": "__maxLine_v9sub_gg_",
43
- "--maxLine": "--maxLine_v9sub",
44
- "__STail": "___STail_v9sub_gg_"
38
+ "__SContainer": "___SContainer_1656k_gg_",
39
+ "__SNoTooltipContainer": "___SNoTooltipContainer_1656k_gg_",
40
+ "__SContainerMiddle": "___SContainerMiddle_1656k_gg_",
41
+ "__SBeginning": "___SBeginning_1656k_gg_",
42
+ "__SEllipsis": "___SEllipsis_1656k_gg_",
43
+ "_middle-mod": "__middle-mod_1656k_gg_",
44
+ "_maxLine": "__maxLine_1656k_gg_",
45
+ "--maxLine": "--maxLine_1656k",
46
+ "__STail": "___STail_1656k_gg_"
45
47
  });
46
48
  var defaultTooltipProps = ['title', 'theme', 'strategy', 'modifiers', 'placement', 'interaction', 'timeout', 'visible', 'defaultVisible', 'onVisibleChange', 'offset', 'preventOverflow', 'arrow', 'flip', 'computeStyles', 'eventListeners', 'onFirstUpdate', 'cursorAnchoring'];
47
49
  var createMeasurerElement = function createMeasurerElement(element, text) {
@@ -91,27 +93,26 @@ var forcedAdvancedMode = {
91
93
  };
92
94
  var noAdvancedMode = {};
93
95
  var RootEllipsis = /*#__PURE__*/function (_Component) {
94
- (0, _inherits2["default"])(RootEllipsis, _Component);
95
- var _super = (0, _createSuper2["default"])(RootEllipsis);
96
96
  function RootEllipsis() {
97
97
  var _this;
98
98
  (0, _classCallCheck2["default"])(this, RootEllipsis);
99
99
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
100
100
  args[_key] = arguments[_key];
101
101
  }
102
- _this = _super.call.apply(_super, [this].concat(args));
103
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "state", {
102
+ _this = _callSuper(this, RootEllipsis, [].concat(args));
103
+ (0, _defineProperty2["default"])(_this, "state", {
104
104
  visible: false
105
105
  });
106
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "textRef", /*#__PURE__*/_react["default"].createRef());
107
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handlerVisibleChange", function (visible) {
106
+ (0, _defineProperty2["default"])(_this, "textRef", /*#__PURE__*/_react["default"].createRef());
107
+ (0, _defineProperty2["default"])(_this, "handlerVisibleChange", function (visible) {
108
108
  _this.setState({
109
109
  visible: visible && _this.showTooltip()
110
110
  });
111
111
  });
112
112
  return _this;
113
113
  }
114
- (0, _createClass2["default"])(RootEllipsis, [{
114
+ (0, _inherits2["default"])(RootEllipsis, _Component);
115
+ return (0, _createClass2["default"])(RootEllipsis, [{
115
116
  key: "showTooltip",
116
117
  value: function showTooltip() {
117
118
  var _this$asProps = this.asProps,
@@ -157,7 +158,7 @@ var RootEllipsis = /*#__PURE__*/function (_Component) {
157
158
  containerRect = _this$asProps3.containerRect,
158
159
  containerRef = _this$asProps3.containerRef,
159
160
  includeTooltipProps = _this$asProps3.includeTooltipProps,
160
- children = _this$asProps3.children,
161
+ _children = _this$asProps3.children,
161
162
  other = (0, _objectWithoutProperties2["default"])(_this$asProps3, _excluded);
162
163
  var visible = this.state.visible;
163
164
  var advancedContent = (0, _findComponent["default"])(Children, [Ellipsis.Content.displayName]);
@@ -197,7 +198,6 @@ var RootEllipsis = /*#__PURE__*/function (_Component) {
197
198
  }, other)), /*#__PURE__*/_react["default"].createElement(Children, _ref4.cn("Children", {}))));
198
199
  }
199
200
  }]);
200
- return RootEllipsis;
201
201
  }(_core.Component);
202
202
  (0, _defineProperty2["default"])(RootEllipsis, "displayName", 'Ellipsis');
203
203
  (0, _defineProperty2["default"])(RootEllipsis, "style", style);
@@ -272,7 +272,7 @@ var EllipsisMiddle = function EllipsisMiddle(props) {
272
272
  return _ref6 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SContainerMiddle, _ref6.cn("SContainerMiddle", (0, _objectSpread2["default"])({
273
273
  "interaction": interaction,
274
274
  "title": text,
275
- "ref": (0, _ref11.forkRef)(ref, textRef),
275
+ "ref": (0, _ref1.forkRef)(ref, textRef),
276
276
  "tag": _tooltip["default"],
277
277
  "__excludeProps": ['title']
278
278
  }, tooltipProps)), /*#__PURE__*/_react["default"].createElement(SBeginning, _ref6.cn("SBeginning", {}), contextValue.begining), /*#__PURE__*/_react["default"].createElement(STail, _ref6.cn("STail", {}), contextValue.tail));
@@ -281,11 +281,11 @@ var EllipsisMiddle = function EllipsisMiddle(props) {
281
281
  "ref": containerRef !== null && containerRef !== void 0 ? containerRef : resizeElement
282
282
  })), /*#__PURE__*/_react["default"].createElement(SBeginning, _ref7.cn("SBeginning", {}), contextValue.begining), /*#__PURE__*/_react["default"].createElement(STail, _ref7.cn("STail", {}), contextValue.tail));
283
283
  };
284
- var Content = function Content(_ref10) {
284
+ var Content = function Content(_ref0) {
285
285
  var _ref = arguments[0],
286
286
  _ref9;
287
- var styles = _ref10.styles,
288
- Children = _ref10.Children;
287
+ var styles = _ref0.styles,
288
+ Children = _ref0.Children;
289
289
  var SEllipsis = _tooltip["default"].Trigger;
290
290
  var ellipsisMiddleContext = _react["default"].useContext(EllipsisMiddleContext);
291
291
  var STail = 'span';
@@ -306,6 +306,5 @@ var Ellipsis = (0, _core.createComponent)(RootEllipsis, {
306
306
  Content: Content,
307
307
  Popper: _tooltip["default"].Popper
308
308
  });
309
- var _default = Ellipsis;
310
- exports["default"] = _default;
309
+ var _default = exports["default"] = Ellipsis;
311
310
  //# sourceMappingURL=Ellipsis.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Ellipsis.js","names":["_core","require","_react","_interopRequireDefault","_tooltip","_flexBox","_useResizeObserver","_useEnhancedEffect","_findComponent","_interopRequireWildcard","_reactToText","_getOriginChildren","_pick","_ref11","_assignProps3","_excluded","_excluded2","style","sstyled","insert","defaultTooltipProps","createMeasurerElement","element","text","styleElement","window","getComputedStyle","temporaryElement","document","createElement","display","getPropertyValue","padding","position","right","bottom","visibility","fontFamily","fontSize","fontWeight","lineHeight","whiteSpace","wordWrap","fontFeatureSettings","fontVariantNumeric","innerHTML","isTextOverflowing","multiline","_element$getBoundingC","getBoundingClientRect","currentHeight","height","currentWidth","width","measuringElement","isOverflowing","body","appendChild","concat","scrollWidth","Math","ceil","removeChild","forcedAdvancedMode","noAdvancedMode","RootEllipsis","_Component","_inherits2","_super","_createSuper2","_this","_classCallCheck2","_len","arguments","length","args","Array","_key","call","apply","_defineProperty2","_assertThisInitialized2","visible","React","createRef","setState","showTooltip","_createClass2","key","value","_this$asProps","asProps","_this$asProps$maxLine","maxLine","Children","reactToText","getOriginChildren","textRef","current","getContentProps","ref","getPopperProps","_this$asProps2","includeTooltipProps","tooltipProps","pick","_objectSpread2","children","render","_ref4","_tooltipProps$visible","SEllipsis","Root","SContainer","Tooltip","SNoTooltipContainer","Box","_this$asProps3","styles","tooltip","trim","containerRect","containerRef","other","_objectWithoutProperties2","state","advancedContent","findComponent","Ellipsis","Content","displayName","advanceMode","isAdvanceMode","Popper","onVisibleChange","callAllEventHandlers","handlerVisibleChange","_ref2","EllipsisMiddle","cn","_ref3","undefined","Component","__excludeProps","EllipsisMiddleContext","createContext","props","_ref7","otherProps","resizeElement","useRef","_React$useState","useState","symbolWidth","_React$useState2","_slicedToArray2","dimension","setDimension","blockWidth","useResizeObserver","useEnhancedEffect","node","dateSpan","setAttribute","rect","STail","SBeginning","SContainerMiddle","tag","SAdvancedModeContainerMiddle","displayedSymbols","useMemo","round","interaction","contextValue","begining","substring","tail","_ref5","Provider","_ref6","forkRef","_ref10","_ref","arguments[0]","_ref9","Trigger","ellipsisMiddleContext","useContext","_ref8","assignProps","createComponent","_default","exports"],"sources":["../../src/Ellipsis.tsx"],"sourcesContent":["import React, { RefObject } from 'react';\nimport { createComponent, Component, Intergalactic, Root, sstyled } from '@semcore/core';\nimport Tooltip, { TooltipProps } from '@semcore/tooltip';\nimport { Box, BoxProps } from '@semcore/flex-box';\nimport { useResizeObserver } from './useResizeObserver';\nimport useEnhancedEffect from '@semcore/core/lib/utils/use/useEnhancedEffect';\nimport findComponent, { isAdvanceMode } from '@semcore/core/lib/utils/findComponent';\n\nimport style from './style/ellipsis.shadow.css';\nimport reactToText from '@semcore/core/lib/utils/reactToText';\nimport getOriginChildren from '@semcore/core/lib/utils/getOriginChildren';\nimport pick from '@semcore/core/lib/utils/pick';\nimport { forkRef } from '@semcore/core/lib/utils/ref';\nimport { callAllEventHandlers } from '@semcore/core/lib/utils/assignProps';\n\ntype AsProps = {\n maxLine?: number;\n trim?: 'end' | 'middle';\n tooltip?: boolean;\n styles?: React.CSSProperties;\n containerRect?: { width: number };\n\n containerRef?: RefObject<HTMLDivElement>;\n includeTooltipProps?: string[];\n __excludeProps?: string[];\n};\n\ntype AsPropsMiddle = {\n text: string;\n textRef: RefObject<HTMLElement>;\n tooltip?: boolean;\n styles?: React.CSSProperties;\n containerRect?: { width: number };\n\n containerRef?: RefObject<HTMLDivElement>;\n tooltipProps: TooltipProps;\n children?: React.ReactNode;\n advanceMode?: boolean;\n tag?: React.ElementType;\n};\n\ntype EllipsisProps = BoxProps &\n Partial<TooltipProps> & {\n /**\n * Rows count in multiline Ellipsis\n * @default 1\n */\n maxLine?: number;\n /**\n * Trimming type\n * @default end\n */\n trim?: 'end' | 'middle';\n /**\n * Show tooltip\n * @default true\n */\n tooltip?: boolean;\n /**\n * Ref to the item that will be observed by ResizeObserver\n */\n // eslint-disable-next-line ssr-friendly/no-dom-globals-in-module-scope\n containerRef?: RefObject<HTMLDivElement>;\n /**\n * Explicit sizes of container text should be trimmed in\n **/\n containerRect?: { width: number };\n /** List of props that will be passed to tooltip\n * @default ['title', 'theme', 'strategy', 'modifiers', 'placement', 'interaction', 'timeout', 'visible', 'defaultVisible', 'onVisibleChange', 'offset', 'preventOverflow', 'arrow', 'flip', 'computeStyles', 'eventListeners', 'onFirstUpdate']\n */\n includeTooltipProps?: string[];\n };\n\nconst defaultTooltipProps = [\n 'title',\n 'theme',\n 'strategy',\n 'modifiers',\n 'placement',\n 'interaction',\n 'timeout',\n 'visible',\n 'defaultVisible',\n 'onVisibleChange',\n 'offset',\n 'preventOverflow',\n 'arrow',\n 'flip',\n 'computeStyles',\n 'eventListeners',\n 'onFirstUpdate',\n 'cursorAnchoring',\n];\n\nconst createMeasurerElement = (element: HTMLDivElement, text?: string) => {\n const styleElement = window.getComputedStyle(element, null);\n const temporaryElement = document.createElement('temporary-block');\n temporaryElement.style.display = styleElement.getPropertyValue('display');\n temporaryElement.style.padding = styleElement.getPropertyValue('padding');\n temporaryElement.style.position = 'absolute';\n temporaryElement.style.right = '0%';\n temporaryElement.style.bottom = '0%';\n temporaryElement.style.visibility = 'hidden';\n temporaryElement.style.fontFamily = styleElement.getPropertyValue('font-family');\n temporaryElement.style.fontSize = styleElement.getPropertyValue('font-size');\n temporaryElement.style.fontWeight = styleElement.getPropertyValue('font-weight');\n temporaryElement.style.lineHeight = styleElement.getPropertyValue('line-height');\n temporaryElement.style.whiteSpace = styleElement.getPropertyValue('white-space');\n temporaryElement.style.wordWrap = styleElement.getPropertyValue('word-wrap');\n\n temporaryElement.style.fontFeatureSettings =\n styleElement.getPropertyValue('font-feature-settings');\n temporaryElement.style.fontVariantNumeric = styleElement.getPropertyValue('font-variant-numeric');\n\n temporaryElement.innerHTML = text ?? element.innerHTML;\n return temporaryElement;\n};\n\nfunction isTextOverflowing(element: HTMLDivElement, multiline: boolean, text?: string): boolean {\n if (!element) return false;\n\n const { height: currentHeight, width: currentWidth } = element.getBoundingClientRect();\n const measuringElement = createMeasurerElement(element, text);\n let isOverflowing = false;\n\n document.body.appendChild(measuringElement);\n if (multiline) {\n measuringElement.style.width = `${currentWidth}px`;\n\n const width = measuringElement.scrollWidth;\n const height = measuringElement.getBoundingClientRect().height;\n\n if (Math.ceil(currentHeight) < height || Math.ceil(currentWidth) < width) {\n isOverflowing = true;\n }\n } else {\n measuringElement.style.whiteSpace = 'nowrap';\n isOverflowing = Math.ceil(currentWidth) < measuringElement.getBoundingClientRect().width;\n }\n\n document.body.removeChild(measuringElement);\n\n return isOverflowing;\n}\n\nconst forcedAdvancedMode = { forcedAdvancedMode: true } as any;\nconst noAdvancedMode = {} as any;\n\nclass RootEllipsis extends Component<AsProps> {\n static displayName = 'Ellipsis';\n static style = style;\n static defaultProps: AsProps = {\n trim: 'end',\n tooltip: true,\n includeTooltipProps: defaultTooltipProps,\n __excludeProps: ['title'],\n };\n\n state = {\n visible: false,\n };\n\n textRef = React.createRef<HTMLDivElement>();\n\n showTooltip() {\n const { maxLine = 1, Children } = this.asProps;\n const text = reactToText(getOriginChildren(Children));\n return isTextOverflowing(this.textRef.current!, maxLine > 1, text);\n }\n\n handlerVisibleChange = (visible: boolean) => {\n this.setState({ visible: visible && this.showTooltip() });\n };\n\n getContentProps() {\n return {\n ref: this.textRef,\n maxLine: this.asProps.maxLine,\n };\n }\n\n getPopperProps() {\n const { Children, includeTooltipProps } = this.asProps;\n const text = reactToText(getOriginChildren(Children));\n const tooltipProps = pick(this.asProps, includeTooltipProps as any) as TooltipProps;\n return { children: text, ...tooltipProps };\n }\n\n render() {\n const SEllipsis = this.Root;\n const SContainer = Tooltip;\n const SNoTooltipContainer = Box;\n const {\n styles,\n Children,\n maxLine,\n tooltip,\n trim,\n containerRect,\n containerRef,\n includeTooltipProps,\n children,\n ...other\n } = this.asProps;\n const { visible } = this.state;\n const advancedContent = findComponent(Children, [(Ellipsis as any).Content.displayName]);\n const text = reactToText(advancedContent || getOriginChildren(Children));\n const advanceMode = isAdvanceMode(Children, [\n (Ellipsis as any).Content.displayName,\n (Ellipsis as any).Popper.displayName,\n ]);\n const tooltipProps = pick(this.asProps, includeTooltipProps as any) as TooltipProps;\n\n tooltipProps.visible = tooltipProps.visible ?? visible;\n tooltipProps.onVisibleChange = tooltipProps.onVisibleChange\n ? callAllEventHandlers(tooltipProps.onVisibleChange, this.handlerVisibleChange)\n : this.handlerVisibleChange;\n\n if (trim === 'middle') {\n return sstyled(styles)(\n <EllipsisMiddle\n text={text}\n styles={styles}\n tooltip={tooltip}\n containerRect={containerRect}\n containerRef={containerRef}\n textRef={this.textRef}\n tooltipProps={tooltipProps}\n advanceMode={advanceMode}\n {...other}\n >\n <Children />\n </EllipsisMiddle>,\n );\n }\n if (tooltip) {\n return sstyled(styles)(\n <SContainer\n interaction='hover'\n title={!advanceMode ? text : undefined}\n {...tooltipProps}\n {...(advanceMode ? forcedAdvancedMode : noAdvancedMode)}\n >\n {advanceMode ? (\n <Children />\n ) : (\n <SEllipsis render={Box} ref={this.textRef} maxLine={maxLine} {...other}>\n <Children />\n </SEllipsis>\n )}\n </SContainer>,\n );\n }\n return sstyled(styles)(\n <SNoTooltipContainer>\n {advanceMode ? (\n <Children />\n ) : (\n <SEllipsis render={Box} ref={this.textRef} maxLine={maxLine} {...other}>\n <Children />\n </SEllipsis>\n )}\n </SNoTooltipContainer>,\n );\n }\n}\n\nconst EllipsisMiddleContext = React.createContext<null | {\n begining: string;\n tail: string;\n ref: React.RefObject<HTMLElement>;\n}>(null);\n\nconst EllipsisMiddle: React.FC<AsPropsMiddle> = (props) => {\n const {\n styles,\n text,\n tooltip,\n containerRect,\n containerRef,\n textRef,\n tooltipProps,\n children,\n advanceMode,\n ...otherProps\n } = props;\n const resizeElement = React.useRef<HTMLDivElement>(null);\n const [dimension, setDimension] = React.useState<{ fontSize: string; symbolWidth: number }>({\n fontSize: '14',\n symbolWidth: 0,\n });\n const blockWidth = useResizeObserver(resizeElement, containerRect).width;\n\n useEnhancedEffect(() => {\n const node = containerRef?.current || resizeElement?.current;\n if (!node) return;\n\n const dateSpan = document.createElement('temporary-block');\n dateSpan.setAttribute('style', `fontSize: ${dimension.fontSize}px`);\n dateSpan.innerHTML = 'a';\n document.body.appendChild(dateSpan);\n const rect = dateSpan.getBoundingClientRect();\n\n setDimension({\n fontSize: window.getComputedStyle(node, null).getPropertyValue('font-size'),\n symbolWidth: rect.width,\n });\n document.body.removeChild(dateSpan);\n }, []);\n\n const STail = 'span';\n const SBeginning = 'span';\n const SContainerMiddle = props.tag || Box;\n const SAdvancedModeContainerMiddle = Tooltip;\n const displayedSymbols = React.useMemo(\n () => Math.round(blockWidth / dimension.symbolWidth),\n [blockWidth, dimension.symbolWidth],\n );\n\n const interaction = text.length > displayedSymbols ? 'hover' : 'none';\n const ref = containerRef ?? resizeElement;\n const contextValue = React.useMemo(\n () => ({\n begining: text.substring(0, text.length - displayedSymbols / 2 - 1),\n tail: text.substring(text.length - displayedSymbols / 2 - 1),\n ref,\n }),\n [text, displayedSymbols],\n );\n\n if (advanceMode) {\n return sstyled(styles)(\n <SAdvancedModeContainerMiddle\n interaction={interaction}\n {...tooltipProps}\n {...forcedAdvancedMode}\n >\n <EllipsisMiddleContext.Provider value={contextValue}>\n {children}\n </EllipsisMiddleContext.Provider>\n </SAdvancedModeContainerMiddle>,\n ) as any;\n }\n if (tooltip) {\n return sstyled(styles)(\n <SContainerMiddle\n interaction={interaction}\n title={text as any}\n ref={forkRef(ref, textRef)}\n tag={Tooltip}\n __excludeProps={['title']}\n {...tooltipProps}\n >\n <SBeginning>{contextValue.begining}</SBeginning>\n <STail>{contextValue.tail}</STail>\n </SContainerMiddle>,\n ) as any;\n }\n return sstyled(styles)(\n <SContainerMiddle {...otherProps} ref={containerRef ?? resizeElement}>\n <SBeginning>{contextValue.begining}</SBeginning>\n <STail>{contextValue.tail}</STail>\n </SContainerMiddle>,\n ) as any;\n};\n\ntype EllipsisContentAsProps = {\n styles: any;\n Children: React.FC;\n};\n\nconst Content: React.FC<EllipsisContentAsProps> = ({ styles, Children }) => {\n const SEllipsis = Root;\n const ellipsisMiddleContext = React.useContext(EllipsisMiddleContext);\n const STail = 'span';\n const SBeginning = 'span';\n\n if (ellipsisMiddleContext) {\n const { begining, tail, ref } = ellipsisMiddleContext;\n return sstyled(styles)(\n <SEllipsis render={Tooltip.Trigger} middle-mod ref={ref}>\n <SBeginning>{begining}</SBeginning>\n <STail>{tail}</STail>\n </SEllipsis>,\n ) as any;\n }\n\n return sstyled(styles)(\n <SEllipsis render={Tooltip.Trigger}>\n <Children />\n </SEllipsis>,\n ) as any;\n};\n\nconst Ellipsis = createComponent(RootEllipsis, {\n Content,\n Popper: Tooltip.Popper,\n}) as any as Intergalactic.Component<'div', EllipsisProps> & {\n Content: typeof Box;\n Popper: typeof Tooltip.Popper;\n};\n\nexport default Ellipsis;\n"],"mappings":";;;;;;;;;;;;;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AADA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,QAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,kBAAA,GAAAL,OAAA;AACA,IAAAM,kBAAA,GAAAJ,sBAAA,CAAAF,OAAA;AACA,IAAAO,cAAA,GAAAC,uBAAA,CAAAR,OAAA;AAGA,IAAAS,YAAA,GAAAP,sBAAA,CAAAF,OAAA;AACA,IAAAU,kB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AAAmF,IAAA,kBACrDrL,MAAA,YAAA2B,aAAA,CAACyI,UAAU,EAAAuB,KAAA,CAAAlD,EAAA,oBAAEoC,QAAQ,CAAc,eACnC7K,MAAA,YAAA2B,aAAA,CAACwI,KAAK,EAAAwB,KAAA,CAAAlD,EAAA,eAAEsC,IAAI,CAAS,CACX;EAEhB;EAEA,OAAAQ,KAAA,GAAO,IAAAvK,aAAO,EAACoG,MAAM,CAAC,eACpBpH,MAAA,YAAA2B,aAAA,CAACkF,SAAS,EAAA0E,KAAA,CAAA9C,EAAA,kBAAAjC,cAAA,qBAAA1G,KAAA,CAAA8L,WAAA,MAAAP,IAAA,kBACRrL,MAAA,YAAA2B,aAAA,CAACiE,QAAQ,EAAA2F,KAAA,CAAA9C,EAAA,iBAAG,CACF;AAEhB,CAAC;AAED,IAAMX,QAAQ,GAAG,IAAA+D,qBAAe,EAAC9H,YAAY,EAAE;EAC7CgE,OAAO,EAAPA,OAAO;EACPI,MAAM,EAAEnB,mBAAO,CAACmB;AAClB,CAAC,CAGA;AAAC,IAAA2D,QAAA,GAEahE,QAAQ;AAAAiE,OAAA,cAAAD,QAAA"}
1
+ {"version":3,"file":"Ellipsis.js","names":["_core","require","_assignProps3","_findComponent","_interopRequireWildcard","_getOriginChildren","_interopRequireDefault","_pick","_reactToText","_ref1","_useEnhancedEffect","_flexBox","_tooltip","_react","_useResizeObserver","_excluded","_excluded2","_callSuper","t","o","e","_getPrototypeOf2","_possibleConstructorReturn2","_isNativeReflectConstruct2","Reflect","construct","constructor","apply","style","sstyled","insert","defaultTooltipProps","createMeasurerElement","element","text","styleElement","window","getComputedStyle","temporaryElement","document","createElement","display","getPropertyValue","padding","position","right","bottom","visibility","fontFamily","fontSize","fontWeight","lineHeight","whiteSpace","wordWrap","fontFeatureSettings","fontVariantNumeric","innerHTML","isTextOverflowing","multiline","_element$getBoundingC","getBoundingClientRect","currentHeight","height","currentWidth","width","measuringElement","isOverflowing","body","appendChild","concat","scrollWidth","Math","ceil","removeChild","forcedAdvancedMode","noAdvancedMode","RootEllipsis","_Component","_this","_classCallCheck2","_len","arguments","length","args","Array","_key","_defineProperty2","visible","React","createRef","setState","showTooltip","_inherits2","_createClass2","key","value","_this$asProps","asProps","_this$asProps$maxLine","maxLine","Children","reactToText","getOriginChildren","textRef","current","getContentProps","ref","getPopperProps","_this$asProps2","includeTooltipProps","tooltipProps","pick","_objectSpread2","children","render","_ref4","_tooltipProps$visible","SEllipsis","Root","SContainer","Tooltip","SNoTooltipContainer","Box","_this$asProps3","styles","tooltip","trim","containerRect","containerRef","_children","other","_objectWithoutProperties2","state","advancedContent","findComponent","Ellipsis","Content","displayName","advanceMode","isAdvanceMode","Popper","onVisibleChange","callAllEventHandlers","handlerVisibleChange","_ref2","EllipsisMiddle","cn","_ref3","undefined","Component","__excludeProps","EllipsisMiddleContext","createContext","props","_ref7","otherProps","resizeElement","useRef","_React$useState","useState","symbolWidth","_React$useState2","_slicedToArray2","dimension","setDimension","blockWidth","useResizeObserver","useEnhancedEffect","node","dateSpan","setAttribute","rect","STail","SBeginning","SContainerMiddle","tag","SAdvancedModeContainerMiddle","displayedSymbols","useMemo","round","interaction","contextValue","begining","substring","tail","_ref5","Provider","_ref6","forkRef","_ref0","_ref","arguments[0]","_ref9","Trigger","ellipsisMiddleContext","useContext","_ref8","assignProps","createComponent","_default","exports"],"sources":["../../src/Ellipsis.tsx"],"sourcesContent":["import { createComponent, Component, type Intergalactic, Root, sstyled } from '@semcore/core';\nimport { callAllEventHandlers } from '@semcore/core/lib/utils/assignProps';\nimport findComponent, { isAdvanceMode } from '@semcore/core/lib/utils/findComponent';\nimport getOriginChildren from '@semcore/core/lib/utils/getOriginChildren';\nimport pick from '@semcore/core/lib/utils/pick';\nimport reactToText from '@semcore/core/lib/utils/reactToText';\nimport { forkRef } from '@semcore/core/lib/utils/ref';\nimport useEnhancedEffect from '@semcore/core/lib/utils/use/useEnhancedEffect';\nimport { Box, type BoxProps } from '@semcore/flex-box';\nimport Tooltip, { type TooltipProps } from '@semcore/tooltip';\nimport React, { type RefObject } from 'react';\n\nimport style from './style/ellipsis.shadow.css';\nimport { useResizeObserver } from './useResizeObserver';\n\ntype AsProps = {\n maxLine?: number;\n trim?: 'end' | 'middle';\n tooltip?: boolean;\n styles?: React.CSSProperties;\n containerRect?: { width: number };\n\n containerRef?: RefObject<HTMLDivElement>;\n includeTooltipProps?: string[];\n __excludeProps?: string[];\n};\n\ntype AsPropsMiddle = {\n text: string;\n textRef: RefObject<HTMLElement>;\n tooltip?: boolean;\n styles?: React.CSSProperties;\n containerRect?: { width: number };\n\n containerRef?: RefObject<HTMLDivElement>;\n tooltipProps: TooltipProps;\n children?: React.ReactNode;\n advanceMode?: boolean;\n tag?: React.ElementType;\n};\n\ntype EllipsisProps = BoxProps &\n Partial<TooltipProps> & {\n /**\n * Rows count in multiline Ellipsis\n * @default 1\n */\n maxLine?: number;\n /**\n * Trimming type\n * @default end\n */\n trim?: 'end' | 'middle';\n /**\n * Show tooltip\n * @default true\n */\n tooltip?: boolean;\n /**\n * Ref to the item that will be observed by ResizeObserver\n */\n containerRef?: RefObject<HTMLDivElement>;\n /**\n * Explicit sizes of container text should be trimmed in\n **/\n containerRect?: { width: number };\n /** List of props that will be passed to tooltip\n * @default ['title', 'theme', 'strategy', 'modifiers', 'placement', 'interaction', 'timeout', 'visible', 'defaultVisible', 'onVisibleChange', 'offset', 'preventOverflow', 'arrow', 'flip', 'computeStyles', 'eventListeners', 'onFirstUpdate']\n */\n includeTooltipProps?: string[];\n };\n\nconst defaultTooltipProps = [\n 'title',\n 'theme',\n 'strategy',\n 'modifiers',\n 'placement',\n 'interaction',\n 'timeout',\n 'visible',\n 'defaultVisible',\n 'onVisibleChange',\n 'offset',\n 'preventOverflow',\n 'arrow',\n 'flip',\n 'computeStyles',\n 'eventListeners',\n 'onFirstUpdate',\n 'cursorAnchoring',\n];\n\nconst createMeasurerElement = (element: HTMLDivElement, text?: string) => {\n const styleElement = window.getComputedStyle(element, null);\n const temporaryElement = document.createElement('temporary-block');\n temporaryElement.style.display = styleElement.getPropertyValue('display');\n temporaryElement.style.padding = styleElement.getPropertyValue('padding');\n temporaryElement.style.position = 'absolute';\n temporaryElement.style.right = '0%';\n temporaryElement.style.bottom = '0%';\n temporaryElement.style.visibility = 'hidden';\n temporaryElement.style.fontFamily = styleElement.getPropertyValue('font-family');\n temporaryElement.style.fontSize = styleElement.getPropertyValue('font-size');\n temporaryElement.style.fontWeight = styleElement.getPropertyValue('font-weight');\n temporaryElement.style.lineHeight = styleElement.getPropertyValue('line-height');\n temporaryElement.style.whiteSpace = styleElement.getPropertyValue('white-space');\n temporaryElement.style.wordWrap = styleElement.getPropertyValue('word-wrap');\n\n temporaryElement.style.fontFeatureSettings =\n styleElement.getPropertyValue('font-feature-settings');\n temporaryElement.style.fontVariantNumeric = styleElement.getPropertyValue('font-variant-numeric');\n\n temporaryElement.innerHTML = text ?? element.innerHTML;\n return temporaryElement;\n};\n\nfunction isTextOverflowing(element: HTMLDivElement, multiline: boolean, text?: string): boolean {\n if (!element) return false;\n\n const { height: currentHeight, width: currentWidth } = element.getBoundingClientRect();\n const measuringElement = createMeasurerElement(element, text);\n let isOverflowing = false;\n\n document.body.appendChild(measuringElement);\n if (multiline) {\n measuringElement.style.width = `${currentWidth}px`;\n\n const width = measuringElement.scrollWidth;\n const height = measuringElement.getBoundingClientRect().height;\n\n if (Math.ceil(currentHeight) < height || Math.ceil(currentWidth) < width) {\n isOverflowing = true;\n }\n } else {\n measuringElement.style.whiteSpace = 'nowrap';\n isOverflowing = Math.ceil(currentWidth) < measuringElement.getBoundingClientRect().width;\n }\n\n document.body.removeChild(measuringElement);\n\n return isOverflowing;\n}\n\nconst forcedAdvancedMode = { forcedAdvancedMode: true } as any;\nconst noAdvancedMode = {} as any;\n\nclass RootEllipsis extends Component<AsProps> {\n static displayName = 'Ellipsis';\n static style = style;\n static defaultProps: AsProps = {\n trim: 'end',\n tooltip: true,\n includeTooltipProps: defaultTooltipProps,\n __excludeProps: ['title'],\n };\n\n state = {\n visible: false,\n };\n\n textRef = React.createRef<HTMLDivElement>();\n\n showTooltip() {\n const { maxLine = 1, Children } = this.asProps;\n const text = reactToText(getOriginChildren(Children));\n return isTextOverflowing(this.textRef.current!, maxLine > 1, text);\n }\n\n handlerVisibleChange = (visible: boolean) => {\n this.setState({ visible: visible && this.showTooltip() });\n };\n\n getContentProps() {\n return {\n ref: this.textRef,\n maxLine: this.asProps.maxLine,\n };\n }\n\n getPopperProps() {\n const { Children, includeTooltipProps } = this.asProps;\n const text = reactToText(getOriginChildren(Children));\n const tooltipProps = pick(this.asProps, includeTooltipProps as any) as TooltipProps;\n return { children: text, ...tooltipProps };\n }\n\n render() {\n const SEllipsis = this.Root;\n const SContainer = Tooltip;\n const SNoTooltipContainer = Box;\n const {\n styles,\n Children,\n maxLine,\n tooltip,\n trim,\n containerRect,\n containerRef,\n includeTooltipProps,\n children: _children,\n ...other\n } = this.asProps;\n const { visible } = this.state;\n const advancedContent = findComponent(Children, [(Ellipsis as any).Content.displayName]);\n const text = reactToText(advancedContent || getOriginChildren(Children));\n const advanceMode = isAdvanceMode(Children, [\n (Ellipsis as any).Content.displayName,\n (Ellipsis as any).Popper.displayName,\n ]);\n const tooltipProps = pick(this.asProps, includeTooltipProps as any) as TooltipProps;\n\n tooltipProps.visible = tooltipProps.visible ?? visible;\n tooltipProps.onVisibleChange = tooltipProps.onVisibleChange\n ? callAllEventHandlers(tooltipProps.onVisibleChange, this.handlerVisibleChange)\n : this.handlerVisibleChange;\n\n if (trim === 'middle') {\n return sstyled(styles)(\n <EllipsisMiddle\n text={text}\n styles={styles}\n tooltip={tooltip}\n containerRect={containerRect}\n containerRef={containerRef}\n textRef={this.textRef}\n tooltipProps={tooltipProps}\n advanceMode={advanceMode}\n {...other}\n >\n <Children />\n </EllipsisMiddle>,\n );\n }\n if (tooltip) {\n return sstyled(styles)(\n <SContainer\n interaction='hover'\n title={!advanceMode ? text : undefined}\n {...tooltipProps}\n {...(advanceMode ? forcedAdvancedMode : noAdvancedMode)}\n >\n {advanceMode\n ? (\n <Children />\n )\n : (\n <SEllipsis render={Box} ref={this.textRef} maxLine={maxLine} {...other}>\n <Children />\n </SEllipsis>\n )}\n </SContainer>,\n );\n }\n return sstyled(styles)(\n <SNoTooltipContainer>\n {advanceMode\n ? (\n <Children />\n )\n : (\n <SEllipsis render={Box} ref={this.textRef} maxLine={maxLine} {...other}>\n <Children />\n </SEllipsis>\n )}\n </SNoTooltipContainer>,\n );\n }\n}\n\nconst EllipsisMiddleContext = React.createContext<null | {\n begining: string;\n tail: string;\n ref: React.RefObject<HTMLElement>;\n}>(null);\n\nconst EllipsisMiddle: React.FC<AsPropsMiddle> = (props) => {\n const {\n styles,\n text,\n tooltip,\n containerRect,\n containerRef,\n textRef,\n tooltipProps,\n children,\n advanceMode,\n ...otherProps\n } = props;\n const resizeElement = React.useRef<HTMLDivElement>(null);\n const [dimension, setDimension] = React.useState<{ fontSize: string; symbolWidth: number }>({\n fontSize: '14',\n symbolWidth: 0,\n });\n const blockWidth = useResizeObserver(resizeElement, containerRect).width;\n\n useEnhancedEffect(() => {\n const node = containerRef?.current || resizeElement?.current;\n if (!node) return;\n\n const dateSpan = document.createElement('temporary-block');\n dateSpan.setAttribute('style', `fontSize: ${dimension.fontSize}px`);\n dateSpan.innerHTML = 'a';\n document.body.appendChild(dateSpan);\n const rect = dateSpan.getBoundingClientRect();\n\n setDimension({\n fontSize: window.getComputedStyle(node, null).getPropertyValue('font-size'),\n symbolWidth: rect.width,\n });\n document.body.removeChild(dateSpan);\n }, []);\n\n const STail = 'span';\n const SBeginning = 'span';\n const SContainerMiddle = props.tag || Box;\n const SAdvancedModeContainerMiddle = Tooltip;\n const displayedSymbols = React.useMemo(\n () => Math.round(blockWidth / dimension.symbolWidth),\n [blockWidth, dimension.symbolWidth],\n );\n\n const interaction = text.length > displayedSymbols ? 'hover' : 'none';\n const ref = containerRef ?? resizeElement;\n const contextValue = React.useMemo(\n () => ({\n begining: text.substring(0, text.length - displayedSymbols / 2 - 1),\n tail: text.substring(text.length - displayedSymbols / 2 - 1),\n ref,\n }),\n [text, displayedSymbols],\n );\n\n if (advanceMode) {\n return sstyled(styles)(\n <SAdvancedModeContainerMiddle\n interaction={interaction}\n {...tooltipProps}\n {...forcedAdvancedMode}\n >\n <EllipsisMiddleContext.Provider value={contextValue}>\n {children}\n </EllipsisMiddleContext.Provider>\n </SAdvancedModeContainerMiddle>,\n ) as any;\n }\n if (tooltip) {\n return sstyled(styles)(\n <SContainerMiddle\n interaction={interaction}\n title={text as any}\n ref={forkRef(ref, textRef)}\n tag={Tooltip}\n __excludeProps={['title']}\n {...tooltipProps}\n >\n <SBeginning>{contextValue.begining}</SBeginning>\n <STail>{contextValue.tail}</STail>\n </SContainerMiddle>,\n ) as any;\n }\n return sstyled(styles)(\n <SContainerMiddle {...otherProps} ref={containerRef ?? resizeElement}>\n <SBeginning>{contextValue.begining}</SBeginning>\n <STail>{contextValue.tail}</STail>\n </SContainerMiddle>,\n ) as any;\n};\n\ntype EllipsisContentAsProps = {\n styles: any;\n Children: React.FC;\n};\n\nconst Content: React.FC<EllipsisContentAsProps> = ({ styles, Children }) => {\n const SEllipsis = Root;\n const ellipsisMiddleContext = React.useContext(EllipsisMiddleContext);\n const STail = 'span';\n const SBeginning = 'span';\n\n if (ellipsisMiddleContext) {\n const { begining, tail, ref } = ellipsisMiddleContext;\n return sstyled(styles)(\n <SEllipsis render={Tooltip.Trigger} middle-mod ref={ref}>\n <SBeginning>{begining}</SBeginning>\n <STail>{tail}</STail>\n </SEllipsis>,\n ) as any;\n }\n\n return sstyled(styles)(\n <SEllipsis render={Tooltip.Trigger}>\n <Children />\n </SEllipsis>,\n ) as any;\n};\n\nconst Ellipsis = createComponent(RootEllipsis, {\n Content,\n Popper: Tooltip.Popper,\n}) as any as Intergalactic.Component<'div', EllipsisProps> & {\n Content: typeof Box;\n Popper: typeof Tooltip.Popper;\n};\n\nexport default Ellipsis;\n"],"mappings":";;;;;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AAEpB,mBAAO,CAACoB;AAClB,CAAC,CAGA;AAAC,IAAA2D,QAAA,GAAAC,OAAA,cAEajE,QAAQ","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import { UnknownProperties, Intergalactic } from '@semcore/core';\nimport { RefObject } from 'react';\nimport { Box, BoxProps } from '@semcore/flex-box';\nimport Tooltip, { TooltipProps } from '@semcore/tooltip';\n\n/** @deprecated */\nexport interface IEllipsisProps extends EllipsisProps, UnknownProperties {}\nexport type EllipsisProps = BoxProps &\n Partial<TooltipProps> & {\n /**\n * Rows count in multiline Ellipsis\n * @default 1\n */\n maxLine?: number;\n /**\n * Trimming type\n * @default end\n */\n trim?: 'end' | 'middle';\n /**\n * Show tooltip\n * @default true\n */\n tooltip?: boolean;\n /**\n * Ref to the item that will be observed by ResizeObserver\n */\n containerRef?: RefObject<HTMLElement | null>;\n /**\n * Explicit sizes of container text should be trimmed in\n **/\n containerRect?: { width: number };\n /** List of props that will be passed to tooltip\n * @default ['title', 'theme', 'strategy', 'modifiers', 'placement', 'interaction', 'timeout', 'visible', 'defaultVisible', 'onVisibleChange', 'offset', 'preventOverflow', 'arrow', 'flip', 'computeStyles', 'eventListeners', 'onFirstUpdate']\n */\n includeTooltipProps?: string[];\n };\n\ndeclare const useResizeObserver: (\n ref: RefObject<HTMLElement>,\n hookOverride?: { width: number },\n) => { width: number };\n\ndeclare const Ellipsis: Intergalactic.Component<'div', EllipsisProps> & {\n Content: typeof Box;\n Popper: typeof Tooltip.Popper;\n};\n\nexport { useResizeObserver };\nexport default Ellipsis;\n"],"mappings":""}
1
+ {"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import type { UnknownProperties, Intergalactic } from '@semcore/core';\nimport type { Box, BoxProps } from '@semcore/flex-box';\nimport type { TooltipProps } from '@semcore/tooltip';\nimport type Tooltip from '@semcore/tooltip';\nimport type { RefObject } from 'react';\n\n/** @deprecated */\nexport interface IEllipsisProps extends EllipsisProps, UnknownProperties {}\nexport type EllipsisProps = BoxProps &\n Partial<TooltipProps> & {\n /**\n * Rows count in multiline Ellipsis\n * @default 1\n */\n maxLine?: number;\n /**\n * Trimming type\n * @default end\n */\n trim?: 'end' | 'middle';\n /**\n * Show tooltip\n * @default true\n */\n tooltip?: boolean;\n /**\n * Ref to the item that will be observed by ResizeObserver\n */\n containerRef?: RefObject<HTMLElement | null>;\n /**\n * Explicit sizes of container text should be trimmed in\n **/\n containerRect?: { width: number };\n /** List of props that will be passed to tooltip\n * @default ['title', 'theme', 'strategy', 'modifiers', 'placement', 'interaction', 'timeout', 'visible', 'defaultVisible', 'onVisibleChange', 'offset', 'preventOverflow', 'arrow', 'flip', 'computeStyles', 'eventListeners', 'onFirstUpdate']\n */\n includeTooltipProps?: string[];\n };\n\ndeclare const useResizeObserver: (\n ref: RefObject<HTMLElement>,\n hookOverride?: { width: number },\n) => { width: number };\n\ndeclare const Ellipsis: Intergalactic.Component<'div', EllipsisProps> & {\n Content: typeof Box;\n Popper: typeof Tooltip.Popper;\n};\n\nexport { useResizeObserver };\nexport default Ellipsis;\n"],"mappings":"","ignoreList":[]}
package/lib/cjs/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_Ellipsis","_interopRequireDefault","require","_useResizeObserver"],"sources":["../../src/index.js"],"sourcesContent":["export { default } from './Ellipsis';\nexport { useResizeObserver } from './useResizeObserver';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA,IAAAA,SAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAD,OAAA"}
1
+ {"version":3,"file":"index.js","names":["_Ellipsis","_interopRequireDefault","require","_useResizeObserver"],"sources":["../../src/index.js"],"sourcesContent":["export { default } from './Ellipsis';\nexport { useResizeObserver } from './useResizeObserver';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA,IAAAA,SAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAD,OAAA","ignoreList":[]}
@@ -1,15 +1,15 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.useResizeObserver = void 0;
8
8
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
9
- var _react = _interopRequireDefault(require("react"));
10
- var _useEnhancedEffect = _interopRequireDefault(require("@semcore/core/lib/utils/use/useEnhancedEffect"));
11
9
  var _canUseDOM = _interopRequireDefault(require("@semcore/core/lib/utils/canUseDOM"));
12
- var useResizeObserver = function useResizeObserver(ref, hookOverride) {
10
+ var _useEnhancedEffect = _interopRequireDefault(require("@semcore/core/lib/utils/use/useEnhancedEffect"));
11
+ var _react = _interopRequireDefault(require("react"));
12
+ var useResizeObserver = exports.useResizeObserver = function useResizeObserver(ref, hookOverride) {
13
13
  var _React$useState = _react["default"].useState(0),
14
14
  _React$useState2 = (0, _slicedToArray2["default"])(_React$useState, 2),
15
15
  width = _React$useState2[0],
@@ -41,5 +41,4 @@ var useResizeObserver = function useResizeObserver(ref, hookOverride) {
41
41
  width: width
42
42
  };
43
43
  };
44
- exports.useResizeObserver = useResizeObserver;
45
44
  //# sourceMappingURL=useResizeObserver.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useResizeObserver.js","names":["_react","_interopRequireDefault","require","_useEnhancedEffect","_canUseDOM","useResizeObserver","ref","hookOverride","_React$useState","React","useState","_React$useState2","_slicedToArray2","width","setWidth","handleResize","useCallback","entries","contentRect","useEnhancedEffect","current","canUseDOM","ro","ResizeObserver","observe","disconnect","exports"],"sources":["../../src/useResizeObserver.tsx"],"sourcesContent":["import React, { RefObject } from 'react';\nimport useEnhancedEffect from '@semcore/core/lib/utils/use/useEnhancedEffect';\nimport canUseDOM from '@semcore/core/lib/utils/canUseDOM';\n\nexport const useResizeObserver = (\n ref: RefObject<HTMLElement>,\n hookOverride?: { width: number },\n) => {\n const [width, setWidth] = React.useState<number>(0);\n\n const handleResize = React.useCallback((entries: ResizeObserverEntry[]) => {\n setWidth(entries[0].contentRect.width);\n }, []);\n\n useEnhancedEffect(() => {\n if (!ref.current) {\n return;\n }\n\n if (hookOverride) {\n return;\n }\n if (canUseDOM()) {\n const ro = new ResizeObserver((entries: ResizeObserverEntry[]) => {\n handleResize(entries);\n });\n\n ro.observe(ref.current);\n\n return () => {\n ro.disconnect();\n };\n }\n }, [hookOverride]);\n\n if (hookOverride) {\n return hookOverride;\n }\n return { width };\n};\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,UAAA,GAAAH,sBAAA,CAAAC,OAAA;AAEO,IAAMG,iBAAiB,GAAG,SAApBA,iBAAiBA,CAC5BC,GAA2B,EAC3BC,YAAgC,EAC7B;EACH,IAAAC,eAAA,GAA0BC,iBAAK,CAACC,QAAQ,CAAS,CAAC,CAAC;IAAAC,gBAAA,OAAAC,eAAA,aAAAJ,eAAA;IAA5CK,KAAK,GAAAF,gBAAA;IAAEG,QAAQ,GAAAH,gBAAA;EAEtB,IAAMI,YAAY,GAAGN,iBAAK,CAACO,WAAW,CAAC,UAACC,OAA8B,EAAK;IACzEH,QAAQ,CAACG,OAAO,CAAC,CAAC,CAAC,CAACC,WAAW,CAACL,KAAK,CAAC;EACxC,CAAC,EAAE,EAAE,CAAC;EAEN,IAAAM,6BAAiB,EAAC,YAAM;IACtB,IAAI,CAACb,GAAG,CAACc,OAAO,EAAE;MAChB;IACF;IAEA,IAAIb,YAAY,EAAE;MAChB;IACF;IACA,IAAI,IAAAc,qBAAS,GAAE,EAAE;MACf,IAAMC,EAAE,GAAG,IAAIC,cAAc,CAAC,UAACN,OAA8B,EAAK;QAChEF,YAAY,CAACE,OAAO,CAAC;MACvB,CAAC,CAAC;MAEFK,EAAE,CAACE,OAAO,CAAClB,GAAG,CAACc,OAAO,CAAC;MAEvB,OAAO,YAAM;QACXE,EAAE,CAACG,UAAU,EAAE;MACjB,CAAC;IACH;EACF,CAAC,EAAE,CAAClB,YAAY,CAAC,CAAC;EAElB,IAAIA,YAAY,EAAE;IAChB,OAAOA,YAAY;EACrB;EACA,OAAO;IAAEM,KAAK,EAALA;EAAM,CAAC;AAClB,CAAC;AAACa,OAAA,CAAArB,iBAAA,GAAAA,iBAAA"}
1
+ {"version":3,"file":"useResizeObserver.js","names":["_canUseDOM","_interopRequireDefault","require","_useEnhancedEffect","_react","useResizeObserver","exports","ref","hookOverride","_React$useState","React","useState","_React$useState2","_slicedToArray2","width","setWidth","handleResize","useCallback","entries","contentRect","useEnhancedEffect","current","canUseDOM","ro","ResizeObserver","observe","disconnect"],"sources":["../../src/useResizeObserver.tsx"],"sourcesContent":["import canUseDOM from '@semcore/core/lib/utils/canUseDOM';\nimport useEnhancedEffect from '@semcore/core/lib/utils/use/useEnhancedEffect';\nimport React, { type RefObject } from 'react';\n\nexport const useResizeObserver = (\n ref: RefObject<HTMLElement>,\n hookOverride?: { width: number },\n) => {\n const [width, setWidth] = React.useState<number>(0);\n\n const handleResize = React.useCallback((entries: ResizeObserverEntry[]) => {\n setWidth(entries[0].contentRect.width);\n }, []);\n\n useEnhancedEffect(() => {\n if (!ref.current) {\n return;\n }\n\n if (hookOverride) {\n return;\n }\n if (canUseDOM()) {\n const ro = new ResizeObserver((entries: ResizeObserverEntry[]) => {\n handleResize(entries);\n });\n\n ro.observe(ref.current);\n\n return () => {\n ro.disconnect();\n };\n }\n }, [hookOverride]);\n\n if (hookOverride) {\n return hookOverride;\n }\n return { width };\n};\n"],"mappings":";;;;;;;;AAAA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,MAAA,GAAAH,sBAAA,CAAAC,OAAA;AAEO,IAAMG,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAG,SAApBA,iBAAiBA,CAC5BE,GAA2B,EAC3BC,YAAgC,EAC7B;EACH,IAAAC,eAAA,GAA0BC,iBAAK,CAACC,QAAQ,CAAS,CAAC,CAAC;IAAAC,gBAAA,OAAAC,eAAA,aAAAJ,eAAA;IAA5CK,KAAK,GAAAF,gBAAA;IAAEG,QAAQ,GAAAH,gBAAA;EAEtB,IAAMI,YAAY,GAAGN,iBAAK,CAACO,WAAW,CAAC,UAACC,OAA8B,EAAK;IACzEH,QAAQ,CAACG,OAAO,CAAC,CAAC,CAAC,CAACC,WAAW,CAACL,KAAK,CAAC;EACxC,CAAC,EAAE,EAAE,CAAC;EAEN,IAAAM,6BAAiB,EAAC,YAAM;IACtB,IAAI,CAACb,GAAG,CAACc,OAAO,EAAE;MAChB;IACF;IAEA,IAAIb,YAAY,EAAE;MAChB;IACF;IACA,IAAI,IAAAc,qBAAS,EAAC,CAAC,EAAE;MACf,IAAMC,EAAE,GAAG,IAAIC,cAAc,CAAC,UAACN,OAA8B,EAAK;QAChEF,YAAY,CAACE,OAAO,CAAC;MACvB,CAAC,CAAC;MAEFK,EAAE,CAACE,OAAO,CAAClB,GAAG,CAACc,OAAO,CAAC;MAEvB,OAAO,YAAM;QACXE,EAAE,CAACG,UAAU,CAAC,CAAC;MACjB,CAAC;IACH;EACF,CAAC,EAAE,CAAClB,YAAY,CAAC,CAAC;EAElB,IAAIA,YAAY,EAAE;IAChB,OAAOA,YAAY;EACrB;EACA,OAAO;IAAEM,KAAK,EAALA;EAAM,CAAC;AAClB,CAAC","ignoreList":[]}
@@ -3,41 +3,43 @@ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProper
3
3
  import _objectSpread from "@babel/runtime/helpers/objectSpread2";
4
4
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
5
5
  import _createClass from "@babel/runtime/helpers/createClass";
6
- import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
6
+ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
7
+ import _isNativeReflectConstruct from "@babel/runtime/helpers/isNativeReflectConstruct";
8
+ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
7
9
  import _inherits from "@babel/runtime/helpers/inherits";
8
- import _createSuper from "@babel/runtime/helpers/createSuper";
9
10
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
10
11
  import { sstyled as _sstyled } from "@semcore/core";
11
12
  import { assignProps as _assignProps2 } from "@semcore/core";
12
13
  import { assignProps as _assignProps } from "@semcore/core";
13
14
  var _excluded = ["styles", "Children", "maxLine", "tooltip", "trim", "containerRect", "containerRef", "includeTooltipProps", "children"],
14
15
  _excluded2 = ["styles", "text", "tooltip", "containerRect", "containerRef", "textRef", "tooltipProps", "children", "advanceMode"];
15
- import React from 'react';
16
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
16
17
  import { createComponent, Component, Root, sstyled } from '@semcore/core';
17
- import Tooltip from '@semcore/tooltip';
18
- import { Box } from '@semcore/flex-box';
19
- import { useResizeObserver } from './useResizeObserver';
20
- import useEnhancedEffect from '@semcore/core/lib/utils/use/useEnhancedEffect';
18
+ import { callAllEventHandlers } from '@semcore/core/lib/utils/assignProps';
21
19
  import findComponent, { isAdvanceMode } from '@semcore/core/lib/utils/findComponent';
20
+ import getOriginChildren from '@semcore/core/lib/utils/getOriginChildren';
21
+ import pick from '@semcore/core/lib/utils/pick';
22
+ import reactToText from '@semcore/core/lib/utils/reactToText';
23
+ import { forkRef } from '@semcore/core/lib/utils/ref';
24
+ import useEnhancedEffect from '@semcore/core/lib/utils/use/useEnhancedEffect';
25
+ import { Box } from '@semcore/flex-box';
26
+ import Tooltip from '@semcore/tooltip';
27
+ import React from 'react';
22
28
  /*!__reshadow-styles__:"./style/ellipsis.shadow.css"*/
23
- var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SContainerMiddle_v9sub_gg_,.___SContainer_v9sub_gg_,.___SEllipsis_v9sub_gg_.__middle-mod_v9sub_gg_,.___SNoTooltipContainer_v9sub_gg_{display:flex;overflow:hidden}.___SBeginning_v9sub_gg_,.___SEllipsis_v9sub_gg_{overflow:hidden;display:inline-block;text-overflow:ellipsis;white-space:pre}.___SEllipsis_v9sub_gg_.__maxLine_v9sub_gg_{display:-webkit-box;-webkit-line-clamp:var(--maxLine_v9sub);-webkit-box-orient:vertical;overflow:hidden;white-space:normal;word-wrap:break-word}.___SContainerMiddle_v9sub_gg_>:has(.___SBeginning_v9sub_gg_),.___SContainerMiddle_v9sub_gg_>:has(.___STail_v9sub_gg_){display:flex;width:100%}.___STail_v9sub_gg_{white-space:pre}", /*__inner_css_end__*/"v9sub_gg_"),
29
+ var style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/".___SContainerMiddle_1656k_gg_,.___SContainer_1656k_gg_,.___SEllipsis_1656k_gg_.__middle-mod_1656k_gg_,.___SNoTooltipContainer_1656k_gg_{display:flex;overflow:hidden}.___SBeginning_1656k_gg_,.___SEllipsis_1656k_gg_{overflow:hidden;display:inline-block;text-overflow:ellipsis;white-space:pre}.___SEllipsis_1656k_gg_.__maxLine_1656k_gg_{display:-webkit-box;-webkit-line-clamp:var(--maxLine_1656k);-webkit-box-orient:vertical;overflow:hidden;white-space:normal;word-wrap:break-word}.___SContainerMiddle_1656k_gg_>:has(.___SBeginning_1656k_gg_),.___SContainerMiddle_1656k_gg_>:has(.___STail_1656k_gg_){display:flex;width:100%}.___STail_1656k_gg_{white-space:pre}", /*__inner_css_end__*/"1656k_gg_"),
24
30
  /*__reshadow_css_end__*/
25
31
  {
26
- "__SContainer": "___SContainer_v9sub_gg_",
27
- "__SNoTooltipContainer": "___SNoTooltipContainer_v9sub_gg_",
28
- "__SContainerMiddle": "___SContainerMiddle_v9sub_gg_",
29
- "__SBeginning": "___SBeginning_v9sub_gg_",
30
- "__SEllipsis": "___SEllipsis_v9sub_gg_",
31
- "_middle-mod": "__middle-mod_v9sub_gg_",
32
- "_maxLine": "__maxLine_v9sub_gg_",
33
- "--maxLine": "--maxLine_v9sub",
34
- "__STail": "___STail_v9sub_gg_"
32
+ "__SContainer": "___SContainer_1656k_gg_",
33
+ "__SNoTooltipContainer": "___SNoTooltipContainer_1656k_gg_",
34
+ "__SContainerMiddle": "___SContainerMiddle_1656k_gg_",
35
+ "__SBeginning": "___SBeginning_1656k_gg_",
36
+ "__SEllipsis": "___SEllipsis_1656k_gg_",
37
+ "_middle-mod": "__middle-mod_1656k_gg_",
38
+ "_maxLine": "__maxLine_1656k_gg_",
39
+ "--maxLine": "--maxLine_1656k",
40
+ "__STail": "___STail_1656k_gg_"
35
41
  });
36
- import reactToText from '@semcore/core/lib/utils/reactToText';
37
- import getOriginChildren from '@semcore/core/lib/utils/getOriginChildren';
38
- import pick from '@semcore/core/lib/utils/pick';
39
- import { forkRef } from '@semcore/core/lib/utils/ref';
40
- import { callAllEventHandlers } from '@semcore/core/lib/utils/assignProps';
42
+ import { useResizeObserver } from './useResizeObserver';
41
43
  var defaultTooltipProps = ['title', 'theme', 'strategy', 'modifiers', 'placement', 'interaction', 'timeout', 'visible', 'defaultVisible', 'onVisibleChange', 'offset', 'preventOverflow', 'arrow', 'flip', 'computeStyles', 'eventListeners', 'onFirstUpdate', 'cursorAnchoring'];
42
44
  var createMeasurerElement = function createMeasurerElement(element, text) {
43
45
  var styleElement = window.getComputedStyle(element, null);
@@ -86,27 +88,26 @@ var forcedAdvancedMode = {
86
88
  };
87
89
  var noAdvancedMode = {};
88
90
  var RootEllipsis = /*#__PURE__*/function (_Component) {
89
- _inherits(RootEllipsis, _Component);
90
- var _super = _createSuper(RootEllipsis);
91
91
  function RootEllipsis() {
92
92
  var _this;
93
93
  _classCallCheck(this, RootEllipsis);
94
94
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
95
95
  args[_key] = arguments[_key];
96
96
  }
97
- _this = _super.call.apply(_super, [this].concat(args));
98
- _defineProperty(_assertThisInitialized(_this), "state", {
97
+ _this = _callSuper(this, RootEllipsis, [].concat(args));
98
+ _defineProperty(_this, "state", {
99
99
  visible: false
100
100
  });
101
- _defineProperty(_assertThisInitialized(_this), "textRef", /*#__PURE__*/React.createRef());
102
- _defineProperty(_assertThisInitialized(_this), "handlerVisibleChange", function (visible) {
101
+ _defineProperty(_this, "textRef", /*#__PURE__*/React.createRef());
102
+ _defineProperty(_this, "handlerVisibleChange", function (visible) {
103
103
  _this.setState({
104
104
  visible: visible && _this.showTooltip()
105
105
  });
106
106
  });
107
107
  return _this;
108
108
  }
109
- _createClass(RootEllipsis, [{
109
+ _inherits(RootEllipsis, _Component);
110
+ return _createClass(RootEllipsis, [{
110
111
  key: "showTooltip",
111
112
  value: function showTooltip() {
112
113
  var _this$asProps = this.asProps,
@@ -152,7 +153,7 @@ var RootEllipsis = /*#__PURE__*/function (_Component) {
152
153
  containerRect = _this$asProps3.containerRect,
153
154
  containerRef = _this$asProps3.containerRef,
154
155
  includeTooltipProps = _this$asProps3.includeTooltipProps,
155
- children = _this$asProps3.children,
156
+ _children = _this$asProps3.children,
156
157
  other = _objectWithoutProperties(_this$asProps3, _excluded);
157
158
  var visible = this.state.visible;
158
159
  var advancedContent = findComponent(Children, [Ellipsis.Content.displayName]);
@@ -192,7 +193,6 @@ var RootEllipsis = /*#__PURE__*/function (_Component) {
192
193
  }, other)), /*#__PURE__*/React.createElement(Children, _ref4.cn("Children", {}))));
193
194
  }
194
195
  }]);
195
- return RootEllipsis;
196
196
  }(Component);
197
197
  _defineProperty(RootEllipsis, "displayName", 'Ellipsis');
198
198
  _defineProperty(RootEllipsis, "style", style);
@@ -276,11 +276,11 @@ var EllipsisMiddle = function EllipsisMiddle(props) {
276
276
  "ref": containerRef !== null && containerRef !== void 0 ? containerRef : resizeElement
277
277
  })), /*#__PURE__*/React.createElement(SBeginning, _ref7.cn("SBeginning", {}), contextValue.begining), /*#__PURE__*/React.createElement(STail, _ref7.cn("STail", {}), contextValue.tail));
278
278
  };
279
- var Content = function Content(_ref10) {
279
+ var Content = function Content(_ref0) {
280
280
  var _ref = arguments[0],
281
281
  _ref9;
282
- var styles = _ref10.styles,
283
- Children = _ref10.Children;
282
+ var styles = _ref0.styles,
283
+ Children = _ref0.Children;
284
284
  var SEllipsis = Tooltip.Trigger;
285
285
  var ellipsisMiddleContext = React.useContext(EllipsisMiddleContext);
286
286
  var STail = 'span';
@@ -1 +1 @@
1
- {"version":3,"file":"Ellipsis.js","names":["React","createComponent","Component","Root","sstyled","Tooltip","Box","useResizeObserver","useEnhancedEffect","findComponent","isAdvanceMode","style","_sstyled","insert","reactToText","getOriginChildren","pick","forkRef","callAllEventHandlers","defaultTooltipProps","createMeasurerElement","element","text","styleElement","window","getComputedStyle","temporaryElement","document","createElement","display","getPropertyValue","padding","position","right","bottom","visibility","fontFamily","fontSize","fontWeight","lineHeight","whiteSpace","wordWrap","fontFeatureSettings","fontVariantNumeric","innerHTML","isTextOverflowing","multiline","_element$getBoundingC","getBoundingClientRect","currentHeight","height","currentWidth","width","measuringElement","isOverflowing","body","appendChild","concat","scrollWidth","Math","ceil","removeChild","forcedAdvancedMode","noAdvancedMode","RootEllipsis","_Component","_inherits","_super","_createSuper","_this","_classCallCheck","_len","arguments","length","args","Array","_key","call","apply","_defineProperty","_assertThisInitialized","visible","createRef","setState","showTooltip","_createClass","key","value","_this$asProps","asProps","_this$asProps$maxLine","maxLine","Children","textRef","current","getContentProps","ref","getPopperProps","_this$asProps2","includeTooltipProps","tooltipProps","_objectSpread","children","render","_ref4","_tooltipProps$visible","SEllipsis","SContainer","SNoTooltipContainer","_this$asProps3","styles","tooltip","trim","containerRect","containerRef","other","_objectWithoutProperties","_excluded","state","advancedContent","Ellipsis","Content","displayName","advanceMode","Popper","onVisibleChange","handlerVisibleChange","_ref2","EllipsisMiddle","cn","_ref3","undefined","__excludeProps","EllipsisMiddleContext","createContext","props","_ref7","otherProps","_excluded2","resizeElement","useRef","_React$useState","useState","symbolWidth","_React$useState2","_slicedToArray","dimension","setDimension","blockWidth","node","dateSpan","setAttribute","rect","STail","SBeginning","SContainerMiddle","tag","SAdvancedModeContainerMiddle","displayedSymbols","useMemo","round","interaction","contextValue","begining","substring","tail","_ref5","Provider","_ref6","_ref10","_ref","arguments[0]","_ref9","Trigger","ellipsisMiddleContext","useContext","_ref8","_assignProps","_assignProps2"],"sources":["../../src/Ellipsis.tsx"],"sourcesContent":["import React, { RefObject } from 'react';\nimport { createComponent, Component, Intergalactic, Root, sstyled } from '@semcore/core';\nimport Tooltip, { TooltipProps } from '@semcore/tooltip';\nimport { Box, BoxProps } from '@semcore/flex-box';\nimport { useResizeObserver } from './useResizeObserver';\nimport useEnhancedEffect from '@semcore/core/lib/utils/use/useEnhancedEffect';\nimport findComponent, { isAdvanceMode } from '@semcore/core/lib/utils/findComponent';\n\nimport style from './style/ellipsis.shadow.css';\nimport reactToText from '@semcore/core/lib/utils/reactToText';\nimport getOriginChildren from '@semcore/core/lib/utils/getOriginChildren';\nimport pick from '@semcore/core/lib/utils/pick';\nimport { forkRef } from '@semcore/core/lib/utils/ref';\nimport { callAllEventHandlers } from '@semcore/core/lib/utils/assignProps';\n\ntype AsProps = {\n maxLine?: number;\n trim?: 'end' | 'middle';\n tooltip?: boolean;\n styles?: React.CSSProperties;\n containerRect?: { width: number };\n\n containerRef?: RefObject<HTMLDivElement>;\n includeTooltipProps?: string[];\n __excludeProps?: string[];\n};\n\ntype AsPropsMiddle = {\n text: string;\n textRef: RefObject<HTMLElement>;\n tooltip?: boolean;\n styles?: React.CSSProperties;\n containerRect?: { width: number };\n\n containerRef?: RefObject<HTMLDivElement>;\n tooltipProps: TooltipProps;\n children?: React.ReactNode;\n advanceMode?: boolean;\n tag?: React.ElementType;\n};\n\ntype EllipsisProps = BoxProps &\n Partial<TooltipProps> & {\n /**\n * Rows count in multiline Ellipsis\n * @default 1\n */\n maxLine?: number;\n /**\n * Trimming type\n * @default end\n */\n trim?: 'end' | 'middle';\n /**\n * Show tooltip\n * @default true\n */\n tooltip?: boolean;\n /**\n * Ref to the item that will be observed by ResizeObserver\n */\n // eslint-disable-next-line ssr-friendly/no-dom-globals-in-module-scope\n containerRef?: RefObject<HTMLDivElement>;\n /**\n * Explicit sizes of container text should be trimmed in\n **/\n containerRect?: { width: number };\n /** List of props that will be passed to tooltip\n * @default ['title', 'theme', 'strategy', 'modifiers', 'placement', 'interaction', 'timeout', 'visible', 'defaultVisible', 'onVisibleChange', 'offset', 'preventOverflow', 'arrow', 'flip', 'computeStyles', 'eventListeners', 'onFirstUpdate']\n */\n includeTooltipProps?: string[];\n };\n\nconst defaultTooltipProps = [\n 'title',\n 'theme',\n 'strategy',\n 'modifiers',\n 'placement',\n 'interaction',\n 'timeout',\n 'visible',\n 'defaultVisible',\n 'onVisibleChange',\n 'offset',\n 'preventOverflow',\n 'arrow',\n 'flip',\n 'computeStyles',\n 'eventListeners',\n 'onFirstUpdate',\n 'cursorAnchoring',\n];\n\nconst createMeasurerElement = (element: HTMLDivElement, text?: string) => {\n const styleElement = window.getComputedStyle(element, null);\n const temporaryElement = document.createElement('temporary-block');\n temporaryElement.style.display = styleElement.getPropertyValue('display');\n temporaryElement.style.padding = styleElement.getPropertyValue('padding');\n temporaryElement.style.position = 'absolute';\n temporaryElement.style.right = '0%';\n temporaryElement.style.bottom = '0%';\n temporaryElement.style.visibility = 'hidden';\n temporaryElement.style.fontFamily = styleElement.getPropertyValue('font-family');\n temporaryElement.style.fontSize = styleElement.getPropertyValue('font-size');\n temporaryElement.style.fontWeight = styleElement.getPropertyValue('font-weight');\n temporaryElement.style.lineHeight = styleElement.getPropertyValue('line-height');\n temporaryElement.style.whiteSpace = styleElement.getPropertyValue('white-space');\n temporaryElement.style.wordWrap = styleElement.getPropertyValue('word-wrap');\n\n temporaryElement.style.fontFeatureSettings =\n styleElement.getPropertyValue('font-feature-settings');\n temporaryElement.style.fontVariantNumeric = styleElement.getPropertyValue('font-variant-numeric');\n\n temporaryElement.innerHTML = text ?? element.innerHTML;\n return temporaryElement;\n};\n\nfunction isTextOverflowing(element: HTMLDivElement, multiline: boolean, text?: string): boolean {\n if (!element) return false;\n\n const { height: currentHeight, width: currentWidth } = element.getBoundingClientRect();\n const measuringElement = createMeasurerElement(element, text);\n let isOverflowing = false;\n\n document.body.appendChild(measuringElement);\n if (multiline) {\n measuringElement.style.width = `${currentWidth}px`;\n\n const width = measuringElement.scrollWidth;\n const height = measuringElement.getBoundingClientRect().height;\n\n if (Math.ceil(currentHeight) < height || Math.ceil(currentWidth) < width) {\n isOverflowing = true;\n }\n } else {\n measuringElement.style.whiteSpace = 'nowrap';\n isOverflowing = Math.ceil(currentWidth) < measuringElement.getBoundingClientRect().width;\n }\n\n document.body.removeChild(measuringElement);\n\n return isOverflowing;\n}\n\nconst forcedAdvancedMode = { forcedAdvancedMode: true } as any;\nconst noAdvancedMode = {} as any;\n\nclass RootEllipsis extends Component<AsProps> {\n static displayName = 'Ellipsis';\n static style = style;\n static defaultProps: AsProps = {\n trim: 'end',\n tooltip: true,\n includeTooltipProps: defaultTooltipProps,\n __excludeProps: ['title'],\n };\n\n state = {\n visible: false,\n };\n\n textRef = React.createRef<HTMLDivElement>();\n\n showTooltip() {\n const { maxLine = 1, Children } = this.asProps;\n const text = reactToText(getOriginChildren(Children));\n return isTextOverflowing(this.textRef.current!, maxLine > 1, text);\n }\n\n handlerVisibleChange = (visible: boolean) => {\n this.setState({ visible: visible && this.showTooltip() });\n };\n\n getContentProps() {\n return {\n ref: this.textRef,\n maxLine: this.asProps.maxLine,\n };\n }\n\n getPopperProps() {\n const { Children, includeTooltipProps } = this.asProps;\n const text = reactToText(getOriginChildren(Children));\n const tooltipProps = pick(this.asProps, includeTooltipProps as any) as TooltipProps;\n return { children: text, ...tooltipProps };\n }\n\n render() {\n const SEllipsis = this.Root;\n const SContainer = Tooltip;\n const SNoTooltipContainer = Box;\n const {\n styles,\n Children,\n maxLine,\n tooltip,\n trim,\n containerRect,\n containerRef,\n includeTooltipProps,\n children,\n ...other\n } = this.asProps;\n const { visible } = this.state;\n const advancedContent = findComponent(Children, [(Ellipsis as any).Content.displayName]);\n const text = reactToText(advancedContent || getOriginChildren(Children));\n const advanceMode = isAdvanceMode(Children, [\n (Ellipsis as any).Content.displayName,\n (Ellipsis as any).Popper.displayName,\n ]);\n const tooltipProps = pick(this.asProps, includeTooltipProps as any) as TooltipProps;\n\n tooltipProps.visible = tooltipProps.visible ?? visible;\n tooltipProps.onVisibleChange = tooltipProps.onVisibleChange\n ? callAllEventHandlers(tooltipProps.onVisibleChange, this.handlerVisibleChange)\n : this.handlerVisibleChange;\n\n if (trim === 'middle') {\n return sstyled(styles)(\n <EllipsisMiddle\n text={text}\n styles={styles}\n tooltip={tooltip}\n containerRect={containerRect}\n containerRef={containerRef}\n textRef={this.textRef}\n tooltipProps={tooltipProps}\n advanceMode={advanceMode}\n {...other}\n >\n <Children />\n </EllipsisMiddle>,\n );\n }\n if (tooltip) {\n return sstyled(styles)(\n <SContainer\n interaction='hover'\n title={!advanceMode ? text : undefined}\n {...tooltipProps}\n {...(advanceMode ? forcedAdvancedMode : noAdvancedMode)}\n >\n {advanceMode ? (\n <Children />\n ) : (\n <SEllipsis render={Box} ref={this.textRef} maxLine={maxLine} {...other}>\n <Children />\n </SEllipsis>\n )}\n </SContainer>,\n );\n }\n return sstyled(styles)(\n <SNoTooltipContainer>\n {advanceMode ? (\n <Children />\n ) : (\n <SEllipsis render={Box} ref={this.textRef} maxLine={maxLine} {...other}>\n <Children />\n </SEllipsis>\n )}\n </SNoTooltipContainer>,\n );\n }\n}\n\nconst EllipsisMiddleContext = React.createContext<null | {\n begining: string;\n tail: string;\n ref: React.RefObject<HTMLElement>;\n}>(null);\n\nconst EllipsisMiddle: React.FC<AsPropsMiddle> = (props) => {\n const {\n styles,\n text,\n tooltip,\n containerRect,\n containerRef,\n textRef,\n tooltipProps,\n children,\n advanceMode,\n ...otherProps\n } = props;\n const resizeElement = React.useRef<HTMLDivElement>(null);\n const [dimension, setDimension] = React.useState<{ fontSize: string; symbolWidth: number }>({\n fontSize: '14',\n symbolWidth: 0,\n });\n const blockWidth = useResizeObserver(resizeElement, containerRect).width;\n\n useEnhancedEffect(() => {\n const node = containerRef?.current || resizeElement?.current;\n if (!node) return;\n\n const dateSpan = document.createElement('temporary-block');\n dateSpan.setAttribute('style', `fontSize: ${dimension.fontSize}px`);\n dateSpan.innerHTML = 'a';\n document.body.appendChild(dateSpan);\n const rect = dateSpan.getBoundingClientRect();\n\n setDimension({\n fontSize: window.getComputedStyle(node, null).getPropertyValue('font-size'),\n symbolWidth: rect.width,\n });\n document.body.removeChild(dateSpan);\n }, []);\n\n const STail = 'span';\n const SBeginning = 'span';\n const SContainerMiddle = props.tag || Box;\n const SAdvancedModeContainerMiddle = Tooltip;\n const displayedSymbols = React.useMemo(\n () => Math.round(blockWidth / dimension.symbolWidth),\n [blockWidth, dimension.symbolWidth],\n );\n\n const interaction = text.length > displayedSymbols ? 'hover' : 'none';\n const ref = containerRef ?? resizeElement;\n const contextValue = React.useMemo(\n () => ({\n begining: text.substring(0, text.length - displayedSymbols / 2 - 1),\n tail: text.substring(text.length - displayedSymbols / 2 - 1),\n ref,\n }),\n [text, displayedSymbols],\n );\n\n if (advanceMode) {\n return sstyled(styles)(\n <SAdvancedModeContainerMiddle\n interaction={interaction}\n {...tooltipProps}\n {...forcedAdvancedMode}\n >\n <EllipsisMiddleContext.Provider value={contextValue}>\n {children}\n </EllipsisMiddleContext.Provider>\n </SAdvancedModeContainerMiddle>,\n ) as any;\n }\n if (tooltip) {\n return sstyled(styles)(\n <SContainerMiddle\n interaction={interaction}\n title={text as any}\n ref={forkRef(ref, textRef)}\n tag={Tooltip}\n __excludeProps={['title']}\n {...tooltipProps}\n >\n <SBeginning>{contextValue.begining}</SBeginning>\n <STail>{contextValue.tail}</STail>\n </SContainerMiddle>,\n ) as any;\n }\n return sstyled(styles)(\n <SContainerMiddle {...otherProps} ref={containerRef ?? resizeElement}>\n <SBeginning>{contextValue.begining}</SBeginning>\n <STail>{contextValue.tail}</STail>\n </SContainerMiddle>,\n ) as any;\n};\n\ntype EllipsisContentAsProps = {\n styles: any;\n Children: React.FC;\n};\n\nconst Content: React.FC<EllipsisContentAsProps> = ({ styles, Children }) => {\n const SEllipsis = Root;\n const ellipsisMiddleContext = React.useContext(EllipsisMiddleContext);\n const STail = 'span';\n const SBeginning = 'span';\n\n if (ellipsisMiddleContext) {\n const { begining, tail, ref } = ellipsisMiddleContext;\n return sstyled(styles)(\n <SEllipsis render={Tooltip.Trigger} middle-mod ref={ref}>\n <SBeginning>{begining}</SBeginning>\n <STail>{tail}</STail>\n </SEllipsis>,\n ) as any;\n }\n\n return sstyled(styles)(\n <SEllipsis render={Tooltip.Trigger}>\n <Children />\n </SEllipsis>,\n ) as any;\n};\n\nconst Ellipsis = createComponent(RootEllipsis, {\n Content,\n Popper: Tooltip.Popper,\n}) as any as Intergalactic.Component<'div', EllipsisProps> & {\n Content: typeof Box;\n Popper: typeof Tooltip.Popper;\n};\n\nexport default Ellipsis;\n"],"mappings":";;;;;;;;;;;;;;AAAA,OAAOA,KAAK,MAAqB,OAAO;AACxC,SAASC,eAAe,EAAEC,SAAS,EAAiBC,IAAI,EAAEC,OAAO,QAAQ,eAAe;AACxF,OAAOC,OAAO,MAAwB,kBAAkB;AACxD,SAASC,GAAG,QAAkB,mBAAmB;AACjD,SAASC,iBAAiB,QAAQ,qBAAqB;AACvD,OAAOC,iBAAiB,MAAM,+CAA+C;AAC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,EAAA,eAAEoC,IAAI,CAAS,CACX;EAEhB;EAEA,OAAAO,KAAA,GAAOxK,OAAO,CAAC0G,MAAM,CAAC,eACpB9G,KAAA,CAAA4B,aAAA,CAAC8E,SAAS,EAAAkE,KAAA,CAAA3C,EAAA,cAAA5B,aAAA,KAAA6E,aAAA,KAAAR,IAAA,kBACR1K,KAAA,CAAA4B,aAAA,CAACgE,QAAQ,EAAAgF,KAAA,CAAA3C,EAAA,iBAAG,CACF;AAEhB,CAAC;AAED,IAAMT,QAAQ,GAAGvH,eAAe,CAAC+D,YAAY,EAAE;EAC7CyD,OAAO,EAAPA,OAAO;EACPG,MAAM,EAAEvH,OAAO,CAACuH;AAClB,CAAC,CAGA;AAED,eAAeJ,QAAQ"}
1
+ {"version":3,"file":"Ellipsis.js","names":["createComponent","Component","Root","sstyled","callAllEventHandlers","findComponent","isAdvanceMode","getOriginChildren","pick","reactToText","forkRef","useEnhancedEffect","Box","Tooltip","React","style","_sstyled","insert","useResizeObserver","defaultTooltipProps","createMeasurerElement","element","text","styleElement","window","getComputedStyle","temporaryElement","document","createElement","display","getPropertyValue","padding","position","right","bottom","visibility","fontFamily","fontSize","fontWeight","lineHeight","whiteSpace","wordWrap","fontFeatureSettings","fontVariantNumeric","innerHTML","isTextOverflowing","multiline","_element$getBoundingC","getBoundingClientRect","currentHeight","height","currentWidth","width","measuringElement","isOverflowing","body","appendChild","concat","scrollWidth","Math","ceil","removeChild","forcedAdvancedMode","noAdvancedMode","RootEllipsis","_Component","_this","_classCallCheck","_len","arguments","length","args","Array","_key","_callSuper","_defineProperty","visible","createRef","setState","showTooltip","_inherits","_createClass","key","value","_this$asProps","asProps","_this$asProps$maxLine","maxLine","Children","textRef","current","getContentProps","ref","getPopperProps","_this$asProps2","includeTooltipProps","tooltipProps","_objectSpread","children","render","_ref4","_tooltipProps$visible","SEllipsis","SContainer","SNoTooltipContainer","_this$asProps3","styles","tooltip","trim","containerRect","containerRef","_children","other","_objectWithoutProperties","_excluded","state","advancedContent","Ellipsis","Content","displayName","advanceMode","Popper","onVisibleChange","handlerVisibleChange","_ref2","EllipsisMiddle","cn","_ref3","undefined","__excludeProps","EllipsisMiddleContext","createContext","props","_ref7","otherProps","_excluded2","resizeElement","useRef","_React$useState","useState","symbolWidth","_React$useState2","_slicedToArray","dimension","setDimension","blockWidth","node","dateSpan","setAttribute","rect","STail","SBeginning","SContainerMiddle","tag","SAdvancedModeContainerMiddle","displayedSymbols","useMemo","round","interaction","contextValue","begining","substring","tail","_ref5","Provider","_ref6","_ref0","_ref","arguments[0]","_ref9","Trigger","ellipsisMiddleContext","useContext","_ref8","_assignProps","_assignProps2"],"sources":["../../src/Ellipsis.tsx"],"sourcesContent":["import { createComponent, Component, type Intergalactic, Root, sstyled } from '@semcore/core';\nimport { callAllEventHandlers } from '@semcore/core/lib/utils/assignProps';\nimport findComponent, { isAdvanceMode } from '@semcore/core/lib/utils/findComponent';\nimport getOriginChildren from '@semcore/core/lib/utils/getOriginChildren';\nimport pick from '@semcore/core/lib/utils/pick';\nimport reactToText from '@semcore/core/lib/utils/reactToText';\nimport { forkRef } from '@semcore/core/lib/utils/ref';\nimport useEnhancedEffect from '@semcore/core/lib/utils/use/useEnhancedEffect';\nimport { Box, type BoxProps } from '@semcore/flex-box';\nimport Tooltip, { type TooltipProps } from '@semcore/tooltip';\nimport React, { type RefObject } from 'react';\n\nimport style from './style/ellipsis.shadow.css';\nimport { useResizeObserver } from './useResizeObserver';\n\ntype AsProps = {\n maxLine?: number;\n trim?: 'end' | 'middle';\n tooltip?: boolean;\n styles?: React.CSSProperties;\n containerRect?: { width: number };\n\n containerRef?: RefObject<HTMLDivElement>;\n includeTooltipProps?: string[];\n __excludeProps?: string[];\n};\n\ntype AsPropsMiddle = {\n text: string;\n textRef: RefObject<HTMLElement>;\n tooltip?: boolean;\n styles?: React.CSSProperties;\n containerRect?: { width: number };\n\n containerRef?: RefObject<HTMLDivElement>;\n tooltipProps: TooltipProps;\n children?: React.ReactNode;\n advanceMode?: boolean;\n tag?: React.ElementType;\n};\n\ntype EllipsisProps = BoxProps &\n Partial<TooltipProps> & {\n /**\n * Rows count in multiline Ellipsis\n * @default 1\n */\n maxLine?: number;\n /**\n * Trimming type\n * @default end\n */\n trim?: 'end' | 'middle';\n /**\n * Show tooltip\n * @default true\n */\n tooltip?: boolean;\n /**\n * Ref to the item that will be observed by ResizeObserver\n */\n containerRef?: RefObject<HTMLDivElement>;\n /**\n * Explicit sizes of container text should be trimmed in\n **/\n containerRect?: { width: number };\n /** List of props that will be passed to tooltip\n * @default ['title', 'theme', 'strategy', 'modifiers', 'placement', 'interaction', 'timeout', 'visible', 'defaultVisible', 'onVisibleChange', 'offset', 'preventOverflow', 'arrow', 'flip', 'computeStyles', 'eventListeners', 'onFirstUpdate']\n */\n includeTooltipProps?: string[];\n };\n\nconst defaultTooltipProps = [\n 'title',\n 'theme',\n 'strategy',\n 'modifiers',\n 'placement',\n 'interaction',\n 'timeout',\n 'visible',\n 'defaultVisible',\n 'onVisibleChange',\n 'offset',\n 'preventOverflow',\n 'arrow',\n 'flip',\n 'computeStyles',\n 'eventListeners',\n 'onFirstUpdate',\n 'cursorAnchoring',\n];\n\nconst createMeasurerElement = (element: HTMLDivElement, text?: string) => {\n const styleElement = window.getComputedStyle(element, null);\n const temporaryElement = document.createElement('temporary-block');\n temporaryElement.style.display = styleElement.getPropertyValue('display');\n temporaryElement.style.padding = styleElement.getPropertyValue('padding');\n temporaryElement.style.position = 'absolute';\n temporaryElement.style.right = '0%';\n temporaryElement.style.bottom = '0%';\n temporaryElement.style.visibility = 'hidden';\n temporaryElement.style.fontFamily = styleElement.getPropertyValue('font-family');\n temporaryElement.style.fontSize = styleElement.getPropertyValue('font-size');\n temporaryElement.style.fontWeight = styleElement.getPropertyValue('font-weight');\n temporaryElement.style.lineHeight = styleElement.getPropertyValue('line-height');\n temporaryElement.style.whiteSpace = styleElement.getPropertyValue('white-space');\n temporaryElement.style.wordWrap = styleElement.getPropertyValue('word-wrap');\n\n temporaryElement.style.fontFeatureSettings =\n styleElement.getPropertyValue('font-feature-settings');\n temporaryElement.style.fontVariantNumeric = styleElement.getPropertyValue('font-variant-numeric');\n\n temporaryElement.innerHTML = text ?? element.innerHTML;\n return temporaryElement;\n};\n\nfunction isTextOverflowing(element: HTMLDivElement, multiline: boolean, text?: string): boolean {\n if (!element) return false;\n\n const { height: currentHeight, width: currentWidth } = element.getBoundingClientRect();\n const measuringElement = createMeasurerElement(element, text);\n let isOverflowing = false;\n\n document.body.appendChild(measuringElement);\n if (multiline) {\n measuringElement.style.width = `${currentWidth}px`;\n\n const width = measuringElement.scrollWidth;\n const height = measuringElement.getBoundingClientRect().height;\n\n if (Math.ceil(currentHeight) < height || Math.ceil(currentWidth) < width) {\n isOverflowing = true;\n }\n } else {\n measuringElement.style.whiteSpace = 'nowrap';\n isOverflowing = Math.ceil(currentWidth) < measuringElement.getBoundingClientRect().width;\n }\n\n document.body.removeChild(measuringElement);\n\n return isOverflowing;\n}\n\nconst forcedAdvancedMode = { forcedAdvancedMode: true } as any;\nconst noAdvancedMode = {} as any;\n\nclass RootEllipsis extends Component<AsProps> {\n static displayName = 'Ellipsis';\n static style = style;\n static defaultProps: AsProps = {\n trim: 'end',\n tooltip: true,\n includeTooltipProps: defaultTooltipProps,\n __excludeProps: ['title'],\n };\n\n state = {\n visible: false,\n };\n\n textRef = React.createRef<HTMLDivElement>();\n\n showTooltip() {\n const { maxLine = 1, Children } = this.asProps;\n const text = reactToText(getOriginChildren(Children));\n return isTextOverflowing(this.textRef.current!, maxLine > 1, text);\n }\n\n handlerVisibleChange = (visible: boolean) => {\n this.setState({ visible: visible && this.showTooltip() });\n };\n\n getContentProps() {\n return {\n ref: this.textRef,\n maxLine: this.asProps.maxLine,\n };\n }\n\n getPopperProps() {\n const { Children, includeTooltipProps } = this.asProps;\n const text = reactToText(getOriginChildren(Children));\n const tooltipProps = pick(this.asProps, includeTooltipProps as any) as TooltipProps;\n return { children: text, ...tooltipProps };\n }\n\n render() {\n const SEllipsis = this.Root;\n const SContainer = Tooltip;\n const SNoTooltipContainer = Box;\n const {\n styles,\n Children,\n maxLine,\n tooltip,\n trim,\n containerRect,\n containerRef,\n includeTooltipProps,\n children: _children,\n ...other\n } = this.asProps;\n const { visible } = this.state;\n const advancedContent = findComponent(Children, [(Ellipsis as any).Content.displayName]);\n const text = reactToText(advancedContent || getOriginChildren(Children));\n const advanceMode = isAdvanceMode(Children, [\n (Ellipsis as any).Content.displayName,\n (Ellipsis as any).Popper.displayName,\n ]);\n const tooltipProps = pick(this.asProps, includeTooltipProps as any) as TooltipProps;\n\n tooltipProps.visible = tooltipProps.visible ?? visible;\n tooltipProps.onVisibleChange = tooltipProps.onVisibleChange\n ? callAllEventHandlers(tooltipProps.onVisibleChange, this.handlerVisibleChange)\n : this.handlerVisibleChange;\n\n if (trim === 'middle') {\n return sstyled(styles)(\n <EllipsisMiddle\n text={text}\n styles={styles}\n tooltip={tooltip}\n containerRect={containerRect}\n containerRef={containerRef}\n textRef={this.textRef}\n tooltipProps={tooltipProps}\n advanceMode={advanceMode}\n {...other}\n >\n <Children />\n </EllipsisMiddle>,\n );\n }\n if (tooltip) {\n return sstyled(styles)(\n <SContainer\n interaction='hover'\n title={!advanceMode ? text : undefined}\n {...tooltipProps}\n {...(advanceMode ? forcedAdvancedMode : noAdvancedMode)}\n >\n {advanceMode\n ? (\n <Children />\n )\n : (\n <SEllipsis render={Box} ref={this.textRef} maxLine={maxLine} {...other}>\n <Children />\n </SEllipsis>\n )}\n </SContainer>,\n );\n }\n return sstyled(styles)(\n <SNoTooltipContainer>\n {advanceMode\n ? (\n <Children />\n )\n : (\n <SEllipsis render={Box} ref={this.textRef} maxLine={maxLine} {...other}>\n <Children />\n </SEllipsis>\n )}\n </SNoTooltipContainer>,\n );\n }\n}\n\nconst EllipsisMiddleContext = React.createContext<null | {\n begining: string;\n tail: string;\n ref: React.RefObject<HTMLElement>;\n}>(null);\n\nconst EllipsisMiddle: React.FC<AsPropsMiddle> = (props) => {\n const {\n styles,\n text,\n tooltip,\n containerRect,\n containerRef,\n textRef,\n tooltipProps,\n children,\n advanceMode,\n ...otherProps\n } = props;\n const resizeElement = React.useRef<HTMLDivElement>(null);\n const [dimension, setDimension] = React.useState<{ fontSize: string; symbolWidth: number }>({\n fontSize: '14',\n symbolWidth: 0,\n });\n const blockWidth = useResizeObserver(resizeElement, containerRect).width;\n\n useEnhancedEffect(() => {\n const node = containerRef?.current || resizeElement?.current;\n if (!node) return;\n\n const dateSpan = document.createElement('temporary-block');\n dateSpan.setAttribute('style', `fontSize: ${dimension.fontSize}px`);\n dateSpan.innerHTML = 'a';\n document.body.appendChild(dateSpan);\n const rect = dateSpan.getBoundingClientRect();\n\n setDimension({\n fontSize: window.getComputedStyle(node, null).getPropertyValue('font-size'),\n symbolWidth: rect.width,\n });\n document.body.removeChild(dateSpan);\n }, []);\n\n const STail = 'span';\n const SBeginning = 'span';\n const SContainerMiddle = props.tag || Box;\n const SAdvancedModeContainerMiddle = Tooltip;\n const displayedSymbols = React.useMemo(\n () => Math.round(blockWidth / dimension.symbolWidth),\n [blockWidth, dimension.symbolWidth],\n );\n\n const interaction = text.length > displayedSymbols ? 'hover' : 'none';\n const ref = containerRef ?? resizeElement;\n const contextValue = React.useMemo(\n () => ({\n begining: text.substring(0, text.length - displayedSymbols / 2 - 1),\n tail: text.substring(text.length - displayedSymbols / 2 - 1),\n ref,\n }),\n [text, displayedSymbols],\n );\n\n if (advanceMode) {\n return sstyled(styles)(\n <SAdvancedModeContainerMiddle\n interaction={interaction}\n {...tooltipProps}\n {...forcedAdvancedMode}\n >\n <EllipsisMiddleContext.Provider value={contextValue}>\n {children}\n </EllipsisMiddleContext.Provider>\n </SAdvancedModeContainerMiddle>,\n ) as any;\n }\n if (tooltip) {\n return sstyled(styles)(\n <SContainerMiddle\n interaction={interaction}\n title={text as any}\n ref={forkRef(ref, textRef)}\n tag={Tooltip}\n __excludeProps={['title']}\n {...tooltipProps}\n >\n <SBeginning>{contextValue.begining}</SBeginning>\n <STail>{contextValue.tail}</STail>\n </SContainerMiddle>,\n ) as any;\n }\n return sstyled(styles)(\n <SContainerMiddle {...otherProps} ref={containerRef ?? resizeElement}>\n <SBeginning>{contextValue.begining}</SBeginning>\n <STail>{contextValue.tail}</STail>\n </SContainerMiddle>,\n ) as any;\n};\n\ntype EllipsisContentAsProps = {\n styles: any;\n Children: React.FC;\n};\n\nconst Content: React.FC<EllipsisContentAsProps> = ({ styles, Children }) => {\n const SEllipsis = Root;\n const ellipsisMiddleContext = React.useContext(EllipsisMiddleContext);\n const STail = 'span';\n const SBeginning = 'span';\n\n if (ellipsisMiddleContext) {\n const { begining, tail, ref } = ellipsisMiddleContext;\n return sstyled(styles)(\n <SEllipsis render={Tooltip.Trigger} middle-mod ref={ref}>\n <SBeginning>{begining}</SBeginning>\n <STail>{tail}</STail>\n </SEllipsis>,\n ) as any;\n }\n\n return sstyled(styles)(\n <SEllipsis render={Tooltip.Trigger}>\n <Children />\n </SEllipsis>,\n ) as any;\n};\n\nconst Ellipsis = createComponent(RootEllipsis, {\n Content,\n Popper: Tooltip.Popper,\n}) as any as Intergalactic.Component<'div', EllipsisProps> & {\n Content: typeof Box;\n Popper: typeof Tooltip.Popper;\n};\n\nexport default Ellipsis;\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,SAASA,eAAe,EAAEC,SAAS,EAAsBC,IAAI,EAAEC,OAAO,QAAQ,eAAe;AAC7F,SAASC,oBAAoB,QAAQ,qCAAqC;AAC1E,OAAOC,aAAa,IAAIC,aAAa,QAAQ,uCAAuC;AACpF,OAAOC,iBAAiB,MAAM,2CAA2C;AACzE,OAAOC,IAAI,MAAM,8BAA8B;AAC/C,OAAOC,WAAW,MAAM,qCAAqC;AAC7D,SAASC,OAAO,QAAQ,6BAA6B;AACrD,OAAOC,iBAAiB,MAAM,+CAA+C;AAC7E,SAASC,GAAG,QAAuB,mBAAmB;AACtD,OAAOC,OAAO,MAA6B,kBAAkB;AAC7D,OAAOC,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AAA,CAAC4D,QAAQ,EAAAiF,KAAA,CAAA3C,EAAA,gBAAE,CACF,CAAC;AAEhB,CAAC;AAED,IAAMT,QAAQ,GAAGrH,eAAe,CAACgE,YAAY,EAAE;EAC7CsD,OAAO,EAAPA,OAAO;EACPG,MAAM,EAAE5G,OAAO,CAAC4G;AAClB,CAAC,CAGA;AAED,eAAeJ,QAAQ","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import { UnknownProperties, Intergalactic } from '@semcore/core';\nimport { RefObject } from 'react';\nimport { Box, BoxProps } from '@semcore/flex-box';\nimport Tooltip, { TooltipProps } from '@semcore/tooltip';\n\n/** @deprecated */\nexport interface IEllipsisProps extends EllipsisProps, UnknownProperties {}\nexport type EllipsisProps = BoxProps &\n Partial<TooltipProps> & {\n /**\n * Rows count in multiline Ellipsis\n * @default 1\n */\n maxLine?: number;\n /**\n * Trimming type\n * @default end\n */\n trim?: 'end' | 'middle';\n /**\n * Show tooltip\n * @default true\n */\n tooltip?: boolean;\n /**\n * Ref to the item that will be observed by ResizeObserver\n */\n containerRef?: RefObject<HTMLElement | null>;\n /**\n * Explicit sizes of container text should be trimmed in\n **/\n containerRect?: { width: number };\n /** List of props that will be passed to tooltip\n * @default ['title', 'theme', 'strategy', 'modifiers', 'placement', 'interaction', 'timeout', 'visible', 'defaultVisible', 'onVisibleChange', 'offset', 'preventOverflow', 'arrow', 'flip', 'computeStyles', 'eventListeners', 'onFirstUpdate']\n */\n includeTooltipProps?: string[];\n };\n\ndeclare const useResizeObserver: (\n ref: RefObject<HTMLElement>,\n hookOverride?: { width: number },\n) => { width: number };\n\ndeclare const Ellipsis: Intergalactic.Component<'div', EllipsisProps> & {\n Content: typeof Box;\n Popper: typeof Tooltip.Popper;\n};\n\nexport { useResizeObserver };\nexport default Ellipsis;\n"],"mappings":""}
1
+ {"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import type { UnknownProperties, Intergalactic } from '@semcore/core';\nimport type { Box, BoxProps } from '@semcore/flex-box';\nimport type { TooltipProps } from '@semcore/tooltip';\nimport type Tooltip from '@semcore/tooltip';\nimport type { RefObject } from 'react';\n\n/** @deprecated */\nexport interface IEllipsisProps extends EllipsisProps, UnknownProperties {}\nexport type EllipsisProps = BoxProps &\n Partial<TooltipProps> & {\n /**\n * Rows count in multiline Ellipsis\n * @default 1\n */\n maxLine?: number;\n /**\n * Trimming type\n * @default end\n */\n trim?: 'end' | 'middle';\n /**\n * Show tooltip\n * @default true\n */\n tooltip?: boolean;\n /**\n * Ref to the item that will be observed by ResizeObserver\n */\n containerRef?: RefObject<HTMLElement | null>;\n /**\n * Explicit sizes of container text should be trimmed in\n **/\n containerRect?: { width: number };\n /** List of props that will be passed to tooltip\n * @default ['title', 'theme', 'strategy', 'modifiers', 'placement', 'interaction', 'timeout', 'visible', 'defaultVisible', 'onVisibleChange', 'offset', 'preventOverflow', 'arrow', 'flip', 'computeStyles', 'eventListeners', 'onFirstUpdate']\n */\n includeTooltipProps?: string[];\n };\n\ndeclare const useResizeObserver: (\n ref: RefObject<HTMLElement>,\n hookOverride?: { width: number },\n) => { width: number };\n\ndeclare const Ellipsis: Intergalactic.Component<'div', EllipsisProps> & {\n Content: typeof Box;\n Popper: typeof Tooltip.Popper;\n};\n\nexport { useResizeObserver };\nexport default Ellipsis;\n"],"mappings":"","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["default","useResizeObserver"],"sources":["../../src/index.js"],"sourcesContent":["export { default } from './Ellipsis';\nexport { useResizeObserver } from './useResizeObserver';\n"],"mappings":"AAAA,SAASA,OAAO,QAAQ,YAAY;AACpC,SAASC,iBAAiB,QAAQ,qBAAqB"}
1
+ {"version":3,"file":"index.js","names":["default","useResizeObserver"],"sources":["../../src/index.js"],"sourcesContent":["export { default } from './Ellipsis';\nexport { useResizeObserver } from './useResizeObserver';\n"],"mappings":"AAAA,SAASA,OAAO,QAAQ,YAAY;AACpC,SAASC,iBAAiB,QAAQ,qBAAqB","ignoreList":[]}
@@ -1,7 +1,7 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
- import React from 'react';
3
- import useEnhancedEffect from '@semcore/core/lib/utils/use/useEnhancedEffect';
4
2
  import canUseDOM from '@semcore/core/lib/utils/canUseDOM';
3
+ import useEnhancedEffect from '@semcore/core/lib/utils/use/useEnhancedEffect';
4
+ import React from 'react';
5
5
  export var useResizeObserver = function useResizeObserver(ref, hookOverride) {
6
6
  var _React$useState = React.useState(0),
7
7
  _React$useState2 = _slicedToArray(_React$useState, 2),
@@ -1 +1 @@
1
- {"version":3,"file":"useResizeObserver.js","names":["React","useEnhancedEffect","canUseDOM","useResizeObserver","ref","hookOverride","_React$useState","useState","_React$useState2","_slicedToArray","width","setWidth","handleResize","useCallback","entries","contentRect","current","ro","ResizeObserver","observe","disconnect"],"sources":["../../src/useResizeObserver.tsx"],"sourcesContent":["import React, { RefObject } from 'react';\nimport useEnhancedEffect from '@semcore/core/lib/utils/use/useEnhancedEffect';\nimport canUseDOM from '@semcore/core/lib/utils/canUseDOM';\n\nexport const useResizeObserver = (\n ref: RefObject<HTMLElement>,\n hookOverride?: { width: number },\n) => {\n const [width, setWidth] = React.useState<number>(0);\n\n const handleResize = React.useCallback((entries: ResizeObserverEntry[]) => {\n setWidth(entries[0].contentRect.width);\n }, []);\n\n useEnhancedEffect(() => {\n if (!ref.current) {\n return;\n }\n\n if (hookOverride) {\n return;\n }\n if (canUseDOM()) {\n const ro = new ResizeObserver((entries: ResizeObserverEntry[]) => {\n handleResize(entries);\n });\n\n ro.observe(ref.current);\n\n return () => {\n ro.disconnect();\n };\n }\n }, [hookOverride]);\n\n if (hookOverride) {\n return hookOverride;\n }\n return { width };\n};\n"],"mappings":";AAAA,OAAOA,KAAK,MAAqB,OAAO;AACxC,OAAOC,iBAAiB,MAAM,+CAA+C;AAC7E,OAAOC,SAAS,MAAM,mCAAmC;AAEzD,OAAO,IAAMC,iBAAiB,GAAG,SAApBA,iBAAiBA,CAC5BC,GAA2B,EAC3BC,YAAgC,EAC7B;EACH,IAAAC,eAAA,GAA0BN,KAAK,CAACO,QAAQ,CAAS,CAAC,CAAC;IAAAC,gBAAA,GAAAC,cAAA,CAAAH,eAAA;IAA5CI,KAAK,GAAAF,gBAAA;IAAEG,QAAQ,GAAAH,gBAAA;EAEtB,IAAMI,YAAY,GAAGZ,KAAK,CAACa,WAAW,CAAC,UAACC,OAA8B,EAAK;IACzEH,QAAQ,CAACG,OAAO,CAAC,CAAC,CAAC,CAACC,WAAW,CAACL,KAAK,CAAC;EACxC,CAAC,EAAE,EAAE,CAAC;EAENT,iBAAiB,CAAC,YAAM;IACtB,IAAI,CAACG,GAAG,CAACY,OAAO,EAAE;MAChB;IACF;IAEA,IAAIX,YAAY,EAAE;MAChB;IACF;IACA,IAAIH,SAAS,EAAE,EAAE;MACf,IAAMe,EAAE,GAAG,IAAIC,cAAc,CAAC,UAACJ,OAA8B,EAAK;QAChEF,YAAY,CAACE,OAAO,CAAC;MACvB,CAAC,CAAC;MAEFG,EAAE,CAACE,OAAO,CAACf,GAAG,CAACY,OAAO,CAAC;MAEvB,OAAO,YAAM;QACXC,EAAE,CAACG,UAAU,EAAE;MACjB,CAAC;IACH;EACF,CAAC,EAAE,CAACf,YAAY,CAAC,CAAC;EAElB,IAAIA,YAAY,EAAE;IAChB,OAAOA,YAAY;EACrB;EACA,OAAO;IAAEK,KAAK,EAALA;EAAM,CAAC;AAClB,CAAC"}
1
+ {"version":3,"file":"useResizeObserver.js","names":["canUseDOM","useEnhancedEffect","React","useResizeObserver","ref","hookOverride","_React$useState","useState","_React$useState2","_slicedToArray","width","setWidth","handleResize","useCallback","entries","contentRect","current","ro","ResizeObserver","observe","disconnect"],"sources":["../../src/useResizeObserver.tsx"],"sourcesContent":["import canUseDOM from '@semcore/core/lib/utils/canUseDOM';\nimport useEnhancedEffect from '@semcore/core/lib/utils/use/useEnhancedEffect';\nimport React, { type RefObject } from 'react';\n\nexport const useResizeObserver = (\n ref: RefObject<HTMLElement>,\n hookOverride?: { width: number },\n) => {\n const [width, setWidth] = React.useState<number>(0);\n\n const handleResize = React.useCallback((entries: ResizeObserverEntry[]) => {\n setWidth(entries[0].contentRect.width);\n }, []);\n\n useEnhancedEffect(() => {\n if (!ref.current) {\n return;\n }\n\n if (hookOverride) {\n return;\n }\n if (canUseDOM()) {\n const ro = new ResizeObserver((entries: ResizeObserverEntry[]) => {\n handleResize(entries);\n });\n\n ro.observe(ref.current);\n\n return () => {\n ro.disconnect();\n };\n }\n }, [hookOverride]);\n\n if (hookOverride) {\n return hookOverride;\n }\n return { width };\n};\n"],"mappings":";AAAA,OAAOA,SAAS,MAAM,mCAAmC;AACzD,OAAOC,iBAAiB,MAAM,+CAA+C;AAC7E,OAAOC,KAAK,MAA0B,OAAO;AAE7C,OAAO,IAAMC,iBAAiB,GAAG,SAApBA,iBAAiBA,CAC5BC,GAA2B,EAC3BC,YAAgC,EAC7B;EACH,IAAAC,eAAA,GAA0BJ,KAAK,CAACK,QAAQ,CAAS,CAAC,CAAC;IAAAC,gBAAA,GAAAC,cAAA,CAAAH,eAAA;IAA5CI,KAAK,GAAAF,gBAAA;IAAEG,QAAQ,GAAAH,gBAAA;EAEtB,IAAMI,YAAY,GAAGV,KAAK,CAACW,WAAW,CAAC,UAACC,OAA8B,EAAK;IACzEH,QAAQ,CAACG,OAAO,CAAC,CAAC,CAAC,CAACC,WAAW,CAACL,KAAK,CAAC;EACxC,CAAC,EAAE,EAAE,CAAC;EAENT,iBAAiB,CAAC,YAAM;IACtB,IAAI,CAACG,GAAG,CAACY,OAAO,EAAE;MAChB;IACF;IAEA,IAAIX,YAAY,EAAE;MAChB;IACF;IACA,IAAIL,SAAS,CAAC,CAAC,EAAE;MACf,IAAMiB,EAAE,GAAG,IAAIC,cAAc,CAAC,UAACJ,OAA8B,EAAK;QAChEF,YAAY,CAACE,OAAO,CAAC;MACvB,CAAC,CAAC;MAEFG,EAAE,CAACE,OAAO,CAACf,GAAG,CAACY,OAAO,CAAC;MAEvB,OAAO,YAAM;QACXC,EAAE,CAACG,UAAU,CAAC,CAAC;MACjB,CAAC;IACH;EACF,CAAC,EAAE,CAACf,YAAY,CAAC,CAAC;EAElB,IAAIA,YAAY,EAAE;IAChB,OAAOA,YAAY;EACrB;EACA,OAAO;IAAEK,KAAK,EAALA;EAAM,CAAC;AAClB,CAAC","ignoreList":[]}
@@ -3,42 +3,46 @@ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutPr
3
3
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
4
4
  import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
5
5
  import _createClass from "@babel/runtime/helpers/esm/createClass";
6
- import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
6
+ import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
7
+ import _isNativeReflectConstruct from "@babel/runtime/helpers/esm/isNativeReflectConstruct";
8
+ import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
7
9
  import _inherits from "@babel/runtime/helpers/esm/inherits";
8
- import _createSuper from "@babel/runtime/helpers/esm/createSuper";
9
10
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
10
- import { sstyled, createComponent, Component, assignProps } from "@semcore/core";
11
- import React from "react";
12
- import Tooltip from "@semcore/tooltip";
13
- import { Box } from "@semcore/flex-box";
14
- import { useResizeObserver } from "./useResizeObserver.mjs";
15
- import useEnhancedEffect from "@semcore/core/lib/utils/use/useEnhancedEffect";
11
+ import { createComponent, sstyled, Component, assignProps } from "@semcore/core";
12
+ import { callAllEventHandlers } from "@semcore/core/lib/utils/assignProps";
16
13
  import findComponent, { isAdvanceMode } from "@semcore/core/lib/utils/findComponent";
17
- import reactToText from "@semcore/core/lib/utils/reactToText";
18
14
  import getOriginChildren from "@semcore/core/lib/utils/getOriginChildren";
19
15
  import pick from "@semcore/core/lib/utils/pick";
16
+ import reactToText from "@semcore/core/lib/utils/reactToText";
20
17
  import { forkRef } from "@semcore/core/lib/utils/ref";
21
- import { callAllEventHandlers } from "@semcore/core/lib/utils/assignProps";
18
+ import useEnhancedEffect from "@semcore/core/lib/utils/use/useEnhancedEffect";
19
+ import { Box } from "@semcore/flex-box";
20
+ import Tooltip from "@semcore/tooltip";
21
+ import React from "react";
22
+ import { useResizeObserver } from "./useResizeObserver.mjs";
22
23
  var _excluded = ["styles", "Children", "maxLine", "tooltip", "trim", "containerRect", "containerRef", "includeTooltipProps", "children"], _excluded2 = ["styles", "text", "tooltip", "containerRect", "containerRef", "textRef", "tooltipProps", "children", "advanceMode"];
24
+ function _callSuper(t, o, e) {
25
+ return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
26
+ }
23
27
  /*!__reshadow-styles__:"./style/ellipsis.shadow.css"*/
24
28
  var style = (
25
29
  /*__reshadow_css_start__*/
26
30
  (sstyled.insert(
27
31
  /*__inner_css_start__*/
28
- ".___SContainerMiddle_v9sub_gg_,.___SContainer_v9sub_gg_,.___SEllipsis_v9sub_gg_.__middle-mod_v9sub_gg_,.___SNoTooltipContainer_v9sub_gg_{display:flex;overflow:hidden}.___SBeginning_v9sub_gg_,.___SEllipsis_v9sub_gg_{overflow:hidden;display:inline-block;text-overflow:ellipsis;white-space:pre}.___SEllipsis_v9sub_gg_.__maxLine_v9sub_gg_{display:-webkit-box;-webkit-line-clamp:var(--maxLine_v9sub);-webkit-box-orient:vertical;overflow:hidden;white-space:normal;word-wrap:break-word}.___SContainerMiddle_v9sub_gg_>:has(.___SBeginning_v9sub_gg_),.___SContainerMiddle_v9sub_gg_>:has(.___STail_v9sub_gg_){display:flex;width:100%}.___STail_v9sub_gg_{white-space:pre}",
32
+ ".___SContainerMiddle_1656k_gg_,.___SContainer_1656k_gg_,.___SEllipsis_1656k_gg_.__middle-mod_1656k_gg_,.___SNoTooltipContainer_1656k_gg_{display:flex;overflow:hidden}.___SBeginning_1656k_gg_,.___SEllipsis_1656k_gg_{overflow:hidden;display:inline-block;text-overflow:ellipsis;white-space:pre}.___SEllipsis_1656k_gg_.__maxLine_1656k_gg_{display:-webkit-box;-webkit-line-clamp:var(--maxLine_1656k);-webkit-box-orient:vertical;overflow:hidden;white-space:normal;word-wrap:break-word}.___SContainerMiddle_1656k_gg_>:has(.___SBeginning_1656k_gg_),.___SContainerMiddle_1656k_gg_>:has(.___STail_1656k_gg_){display:flex;width:100%}.___STail_1656k_gg_{white-space:pre}",
29
33
  /*__inner_css_end__*/
30
- "v9sub_gg_"
34
+ "1656k_gg_"
31
35
  ), /*__reshadow_css_end__*/
32
36
  {
33
- "__SContainer": "___SContainer_v9sub_gg_",
34
- "__SNoTooltipContainer": "___SNoTooltipContainer_v9sub_gg_",
35
- "__SContainerMiddle": "___SContainerMiddle_v9sub_gg_",
36
- "__SBeginning": "___SBeginning_v9sub_gg_",
37
- "__SEllipsis": "___SEllipsis_v9sub_gg_",
38
- "_middle-mod": "__middle-mod_v9sub_gg_",
39
- "_maxLine": "__maxLine_v9sub_gg_",
40
- "--maxLine": "--maxLine_v9sub",
41
- "__STail": "___STail_v9sub_gg_"
37
+ "__SContainer": "___SContainer_1656k_gg_",
38
+ "__SNoTooltipContainer": "___SNoTooltipContainer_1656k_gg_",
39
+ "__SContainerMiddle": "___SContainerMiddle_1656k_gg_",
40
+ "__SBeginning": "___SBeginning_1656k_gg_",
41
+ "__SEllipsis": "___SEllipsis_1656k_gg_",
42
+ "_middle-mod": "__middle-mod_1656k_gg_",
43
+ "_maxLine": "__maxLine_1656k_gg_",
44
+ "--maxLine": "--maxLine_1656k",
45
+ "__STail": "___STail_1656k_gg_"
42
46
  })
43
47
  );
44
48
  var defaultTooltipProps = ["title", "theme", "strategy", "modifiers", "placement", "interaction", "timeout", "visible", "defaultVisible", "onVisibleChange", "offset", "preventOverflow", "arrow", "flip", "computeStyles", "eventListeners", "onFirstUpdate", "cursorAnchoring"];
@@ -87,27 +91,26 @@ var forcedAdvancedMode = {
87
91
  };
88
92
  var noAdvancedMode = {};
89
93
  var RootEllipsis = /* @__PURE__ */ function(_Component) {
90
- _inherits(RootEllipsis2, _Component);
91
- var _super = _createSuper(RootEllipsis2);
92
94
  function RootEllipsis2() {
93
95
  var _this;
94
96
  _classCallCheck(this, RootEllipsis2);
95
97
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
96
98
  args[_key] = arguments[_key];
97
99
  }
98
- _this = _super.call.apply(_super, [this].concat(args));
99
- _defineProperty(_assertThisInitialized(_this), "state", {
100
+ _this = _callSuper(this, RootEllipsis2, [].concat(args));
101
+ _defineProperty(_this, "state", {
100
102
  visible: false
101
103
  });
102
- _defineProperty(_assertThisInitialized(_this), "textRef", /* @__PURE__ */ React.createRef());
103
- _defineProperty(_assertThisInitialized(_this), "handlerVisibleChange", function(visible) {
104
+ _defineProperty(_this, "textRef", /* @__PURE__ */ React.createRef());
105
+ _defineProperty(_this, "handlerVisibleChange", function(visible) {
104
106
  _this.setState({
105
107
  visible: visible && _this.showTooltip()
106
108
  });
107
109
  });
108
110
  return _this;
109
111
  }
110
- _createClass(RootEllipsis2, [{
112
+ _inherits(RootEllipsis2, _Component);
113
+ return _createClass(RootEllipsis2, [{
111
114
  key: "showTooltip",
112
115
  value: function showTooltip() {
113
116
  var _this$asProps = this.asProps, _this$asProps$maxLine = _this$asProps.maxLine, maxLine = _this$asProps$maxLine === void 0 ? 1 : _this$asProps$maxLine, Children = _this$asProps.Children;
@@ -180,7 +183,6 @@ var RootEllipsis = /* @__PURE__ */ function(_Component) {
180
183
  }, other)), /* @__PURE__ */ React.createElement(Children, _ref4.cn("Children", {}))));
181
184
  }
182
185
  }]);
183
- return RootEllipsis2;
184
186
  }(Component);
185
187
  _defineProperty(RootEllipsis, "displayName", "Ellipsis");
186
188
  _defineProperty(RootEllipsis, "style", style);
@@ -252,9 +254,9 @@ var EllipsisMiddle = function EllipsisMiddle2(props) {
252
254
  "ref": containerRef !== null && containerRef !== void 0 ? containerRef : resizeElement
253
255
  })), /* @__PURE__ */ React.createElement(SBeginning, _ref7.cn("SBeginning", {}), contextValue.begining), /* @__PURE__ */ React.createElement(STail, _ref7.cn("STail", {}), contextValue.tail));
254
256
  };
255
- var Content = function Content2(_ref10) {
257
+ var Content = function Content2(_ref0) {
256
258
  var _ref = arguments[0], _ref9;
257
- var styles = _ref10.styles, Children = _ref10.Children;
259
+ var styles = _ref0.styles, Children = _ref0.Children;
258
260
  var SEllipsis = Tooltip.Trigger;
259
261
  var ellipsisMiddleContext = React.useContext(EllipsisMiddleContext);
260
262
  var STail = "span";
@@ -1,7 +1,7 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
- import React from "react";
3
- import useEnhancedEffect from "@semcore/core/lib/utils/use/useEnhancedEffect";
4
2
  import canUseDOM from "@semcore/core/lib/utils/canUseDOM";
3
+ import useEnhancedEffect from "@semcore/core/lib/utils/use/useEnhancedEffect";
4
+ import React from "react";
5
5
  var useResizeObserver = function useResizeObserver2(ref, hookOverride) {
6
6
  var _React$useState = React.useState(0), _React$useState2 = _slicedToArray(_React$useState, 2), width = _React$useState2[0], setWidth = _React$useState2[1];
7
7
  var handleResize = React.useCallback(function(entries) {
@@ -1,7 +1,8 @@
1
- import { UnknownProperties, Intergalactic } from '@semcore/core';
2
- import { RefObject } from 'react';
3
- import { Box, BoxProps } from '@semcore/flex-box';
4
- import Tooltip, { TooltipProps } from '@semcore/tooltip';
1
+ import type { UnknownProperties, Intergalactic } from '@semcore/core';
2
+ import type { Box, BoxProps } from '@semcore/flex-box';
3
+ import type { TooltipProps } from '@semcore/tooltip';
4
+ import type Tooltip from '@semcore/tooltip';
5
+ import type { RefObject } from 'react';
5
6
 
6
7
  /** @deprecated */
7
8
  export interface IEllipsisProps extends EllipsisProps, UnknownProperties {}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@semcore/ellipsis",
3
3
  "description": "Semrush Ellipsis Component",
4
- "version": "16.0.1",
4
+ "version": "16.0.2-prerelease.3",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es6/index.js",
7
7
  "typings": "lib/types/index.d.ts",
@@ -14,15 +14,15 @@
14
14
  "types": "./lib/types/index.d.ts"
15
15
  },
16
16
  "dependencies": {
17
- "@semcore/tooltip": "16.0.1",
18
- "@semcore/flex-box": "16.0.1"
17
+ "@semcore/tooltip": "16.0.2-prerelease.3",
18
+ "@semcore/flex-box": "16.0.2-prerelease.3"
19
19
  },
20
20
  "peerDependencies": {
21
- "@semcore/base-components": "^16.0.0"
21
+ "@semcore/base-components": "^16.0.2-prerelease.3"
22
22
  },
23
23
  "devDependencies": {
24
- "@types/react": "18.0.21",
25
- "@semcore/testing-utils": "1.0.0"
24
+ "@semcore/testing-utils": "1.0.0",
25
+ "@semcore/core": "16.0.0"
26
26
  },
27
27
  "repository": {
28
28
  "type": "git",