@eccenca/gui-elements 25.0.0-rc.2 → 25.1.0-rc.0
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 +64 -18
- package/dist/cjs/cmem/ActivityControl/SilkActivityControl.js +1 -3
- package/dist/cjs/cmem/ActivityControl/SilkActivityControl.js.map +1 -1
- package/dist/cjs/cmem/ContentBlobToggler/ContentBlobToggler.js +1 -0
- package/dist/cjs/cmem/ContentBlobToggler/ContentBlobToggler.js.map +1 -1
- package/dist/cjs/cmem/ContentBlobToggler/StringPreviewContentBlobToggler.js +34 -11
- package/dist/cjs/cmem/ContentBlobToggler/StringPreviewContentBlobToggler.js.map +1 -1
- package/dist/cjs/cmem/react-flow/ReactFlow/ReactFlowV12.js.map +1 -1
- package/dist/cjs/common/Intent/index.js +1 -1
- package/dist/cjs/common/Intent/index.js.map +1 -1
- package/dist/cjs/common/index.js +3 -1
- package/dist/cjs/common/index.js.map +1 -1
- package/dist/cjs/common/utils/reduceToText.js +26 -1
- package/dist/cjs/common/utils/reduceToText.js.map +1 -1
- package/dist/cjs/components/Application/ApplicationViewability.js +33 -0
- package/dist/cjs/components/Application/ApplicationViewability.js.map +1 -0
- package/dist/cjs/components/Application/index.js +1 -0
- package/dist/cjs/components/Application/index.js.map +1 -1
- package/dist/cjs/components/ContextOverlay/ContextMenu.js +2 -2
- package/dist/cjs/components/ContextOverlay/ContextMenu.js.map +1 -1
- package/dist/cjs/components/ContextOverlay/ContextOverlay.js +62 -24
- package/dist/cjs/components/ContextOverlay/ContextOverlay.js.map +1 -1
- package/dist/cjs/components/Icon/IconButton.js.map +1 -1
- package/dist/cjs/components/TextReducer/TextReducer.js +15 -3
- package/dist/cjs/components/TextReducer/TextReducer.js.map +1 -1
- package/dist/cjs/components/Typography/InlineText.js +29 -0
- package/dist/cjs/components/Typography/InlineText.js.map +1 -0
- package/dist/cjs/components/Typography/index.js +1 -0
- package/dist/cjs/components/Typography/index.js.map +1 -1
- package/dist/cjs/extensions/codemirror/CodeMirror.js +2 -2
- package/dist/cjs/extensions/codemirror/CodeMirror.js.map +1 -1
- package/dist/cjs/extensions/codemirror/hooks/useCodemirrorModeExtension.hooks.js +1 -1
- package/dist/cjs/extensions/codemirror/hooks/useCodemirrorModeExtension.hooks.js.map +1 -1
- package/dist/cjs/extensions/codemirror/tests/codemirrorTestHelper.js +2 -2
- package/dist/cjs/extensions/codemirror/tests/codemirrorTestHelper.js.map +1 -1
- package/dist/cjs/extensions/react-flow/edges/EdgeNew.js +1 -1
- package/dist/cjs/extensions/react-flow/edges/EdgeNew.js.map +1 -1
- package/dist/cjs/extensions/react-flow/handles/HandleDefault.js +1 -1
- package/dist/cjs/extensions/react-flow/handles/HandleDefault.js.map +1 -1
- package/dist/cjs/extensions/react-flow/minimap/MiniMap.js +1 -1
- package/dist/cjs/extensions/react-flow/minimap/MiniMap.js.map +1 -1
- package/dist/cjs/extensions/react-flow/minimap/MiniMapV12.js.map +1 -1
- package/dist/cjs/extensions/react-flow/nodes/nodeUtils.js.map +1 -1
- package/dist/esm/cmem/ActivityControl/SilkActivityControl.js +1 -3
- package/dist/esm/cmem/ActivityControl/SilkActivityControl.js.map +1 -1
- package/dist/esm/cmem/ContentBlobToggler/ContentBlobToggler.js +1 -0
- package/dist/esm/cmem/ContentBlobToggler/ContentBlobToggler.js.map +1 -1
- package/dist/esm/cmem/ContentBlobToggler/StringPreviewContentBlobToggler.js +32 -9
- package/dist/esm/cmem/ContentBlobToggler/StringPreviewContentBlobToggler.js.map +1 -1
- package/dist/esm/cmem/react-flow/ReactFlow/ReactFlowV12.js.map +1 -1
- package/dist/esm/common/Intent/index.js +1 -1
- package/dist/esm/common/Intent/index.js.map +1 -1
- package/dist/esm/common/index.js +3 -1
- package/dist/esm/common/index.js.map +1 -1
- package/dist/esm/common/utils/reduceToText.js +37 -1
- package/dist/esm/common/utils/reduceToText.js.map +1 -1
- package/dist/esm/components/Application/ApplicationViewability.js +28 -0
- package/dist/esm/components/Application/ApplicationViewability.js.map +1 -0
- package/dist/esm/components/Application/index.js +1 -0
- package/dist/esm/components/Application/index.js.map +1 -1
- package/dist/esm/components/ContextOverlay/ContextMenu.js +2 -2
- package/dist/esm/components/ContextOverlay/ContextMenu.js.map +1 -1
- package/dist/esm/components/ContextOverlay/ContextOverlay.js +66 -28
- package/dist/esm/components/ContextOverlay/ContextOverlay.js.map +1 -1
- package/dist/esm/components/Icon/IconButton.js.map +1 -1
- package/dist/esm/components/TextReducer/TextReducer.js +14 -3
- package/dist/esm/components/TextReducer/TextReducer.js.map +1 -1
- package/dist/esm/components/Typography/InlineText.js +33 -0
- package/dist/esm/components/Typography/InlineText.js.map +1 -0
- package/dist/esm/components/Typography/index.js +1 -0
- package/dist/esm/components/Typography/index.js.map +1 -1
- package/dist/esm/extensions/codemirror/CodeMirror.js +3 -3
- package/dist/esm/extensions/codemirror/CodeMirror.js.map +1 -1
- package/dist/esm/extensions/codemirror/hooks/useCodemirrorModeExtension.hooks.js +1 -1
- package/dist/esm/extensions/codemirror/hooks/useCodemirrorModeExtension.hooks.js.map +1 -1
- package/dist/esm/extensions/codemirror/tests/codemirrorTestHelper.js +3 -3
- package/dist/esm/extensions/codemirror/tests/codemirrorTestHelper.js.map +1 -1
- package/dist/esm/extensions/react-flow/edges/EdgeNew.js +1 -1
- package/dist/esm/extensions/react-flow/edges/EdgeNew.js.map +1 -1
- package/dist/esm/extensions/react-flow/handles/HandleDefault.js +1 -1
- package/dist/esm/extensions/react-flow/handles/HandleDefault.js.map +1 -1
- package/dist/esm/extensions/react-flow/minimap/MiniMap.js +1 -1
- package/dist/esm/extensions/react-flow/minimap/MiniMap.js.map +1 -1
- package/dist/esm/extensions/react-flow/minimap/MiniMapV12.js.map +1 -1
- package/dist/esm/extensions/react-flow/nodes/nodeUtils.js.map +1 -1
- package/dist/types/cmem/ContentBlobToggler/StringPreviewContentBlobToggler.d.ts +26 -10
- package/dist/types/common/index.d.ts +2 -0
- package/dist/types/common/utils/reduceToText.d.ts +1 -1
- package/dist/types/components/Application/ApplicationViewability.d.ts +36 -0
- package/dist/types/components/Application/index.d.ts +1 -0
- package/dist/types/components/ContextOverlay/ContextMenu.d.ts +1 -1
- package/dist/types/components/Icon/IconButton.d.ts +1 -1
- package/dist/types/components/Structure/TitleSubsection.d.ts +1 -1
- package/dist/types/components/Tabs/Tab.d.ts +2 -2
- package/dist/types/components/TextReducer/TextReducer.d.ts +13 -1
- package/dist/types/components/Typography/InlineText.d.ts +13 -0
- package/dist/types/components/Typography/index.d.ts +1 -0
- package/dist/types/extensions/codemirror/hooks/useCodemirrorModeExtension.hooks.d.ts +1 -1
- package/dist/types/extensions/codemirror/tests/codemirrorTestHelper.d.ts +1 -1
- package/package.json +54 -53
- package/src/cmem/ActivityControl/SilkActivityControl.tsx +1 -1
- package/src/cmem/ContentBlobToggler/ContentBlobToggler.tsx +1 -1
- package/src/cmem/ContentBlobToggler/StringPreviewContentBlobToggler.tsx +66 -18
- package/src/cmem/ContentBlobToggler/stories/StringPreviewContentBlobToggler.stories.tsx +27 -0
- package/src/cmem/ContentBlobToggler/tests/StringPreviewContentBlobToggler.test.tsx +98 -0
- package/src/cmem/react-flow/ReactFlow/ReactFlowV12.tsx +1 -0
- package/src/common/Intent/index.ts +2 -1
- package/src/common/index.ts +6 -2
- package/src/common/utils/reduceToText.tsx +30 -2
- package/src/components/Application/ApplicationViewability.tsx +61 -0
- package/src/components/Application/_content.scss +7 -0
- package/src/components/Application/_header.scss +12 -3
- package/src/components/Application/_viewability.scss +13 -0
- package/src/components/Application/application.scss +1 -0
- package/src/components/Application/index.ts +1 -0
- package/src/components/Application/stories/ApplicationViewability.stories.tsx +37 -0
- package/src/components/Application/tests/ApplicationViewability.test.tsx +43 -0
- package/src/components/AutoSuggestion/tests/ExtendedCodeEditor.test.tsx +1 -1
- package/src/components/Card/card.scss +6 -0
- package/src/components/Checkbox/checkbox.scss +14 -2
- package/src/components/ContentGroup/_contentgroup.scss +9 -0
- package/src/components/ContextOverlay/ContextMenu.tsx +4 -1
- package/src/components/ContextOverlay/ContextOverlay.tsx +74 -24
- package/src/components/ContextOverlay/tests/ContextMenu.test.tsx +43 -0
- package/src/components/ContextOverlay/tests/ContextOverlay.test.tsx +71 -0
- package/src/components/Depiction/depiction.scss +6 -0
- package/src/components/Dialog/stories/Modal.stories.tsx +12 -150
- package/src/components/Dialog/stories/ModalContext.stories.tsx +153 -0
- package/src/components/FlexibleLayout/flexiblelayout.scss +16 -0
- package/src/components/Grid/grid.scss +17 -0
- package/src/components/Grid/stories/Grid.stories.tsx +10 -7
- package/src/components/Grid/stories/GridRow.stories.tsx +13 -7
- package/src/components/Icon/IconButton.tsx +1 -1
- package/src/components/Notification/notification.scss +6 -0
- package/src/components/OverviewItem/overviewitem.scss +9 -0
- package/src/components/OverviewItem/stories/OverviewItem.stories.tsx +28 -0
- package/src/components/OverviewItem/stories/OverviewItemActions.stories.tsx +2 -2
- package/src/components/OverviewItem/stories/OverviewItemDescription.stories.tsx +1 -1
- package/src/components/OverviewItem/stories/OverviewItemLine.stories.tsx +1 -1
- package/src/components/PropertyValuePair/propertyvalue.scss +23 -1
- package/src/components/Separation/separation.scss +6 -0
- package/src/components/Table/table.scss +22 -0
- package/src/components/Tabs/stories/TabTitle.stories.tsx +7 -2
- package/src/components/Tag/stories/TagList.stories.tsx +2 -2
- package/src/components/Tag/tag.scss +19 -9
- package/src/components/TextReducer/TextReducer.stories.tsx +2 -1
- package/src/components/TextReducer/TextReducer.test.tsx +44 -0
- package/src/components/TextReducer/TextReducer.tsx +14 -4
- package/src/components/Typography/InlineText.tsx +24 -0
- package/src/components/Typography/_reset.scss +1 -0
- package/src/components/Typography/index.ts +1 -0
- package/src/components/Typography/stories/InlineText.stories.tsx +27 -0
- package/src/components/Typography/typography.scss +28 -2
- package/src/extensions/codemirror/CodeMirror.tsx +4 -4
- package/src/extensions/codemirror/hooks/useCodemirrorModeExtension.hooks.ts +1 -2
- package/src/extensions/codemirror/tests/codemirrorTestHelper.ts +3 -3
- package/src/extensions/react-flow/edges/EdgeNew.tsx +2 -1
- package/src/extensions/react-flow/handles/HandleDefault.tsx +2 -2
- package/src/extensions/react-flow/minimap/MiniMap.tsx +2 -1
- package/src/extensions/react-flow/minimap/MiniMapV12.tsx +1 -1
- package/src/extensions/react-flow/nodes/_nodes.scss +4 -3
- package/src/extensions/react-flow/nodes/nodeUtils.tsx +1 -0
- package/src/extensions/react-flow/nodes/stories/NodeContent.stories.tsx +2 -2
|
@@ -22,9 +22,9 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
22
22
|
};
|
|
23
23
|
import React, { memo, useEffect } from "react";
|
|
24
24
|
import { MiniMap as ReactFlowMiniMapV9 } from "react-flow-renderer";
|
|
25
|
-
import { miniMapUtils } from "./utils.js";
|
|
26
25
|
import { ReactFlowVersions, useReactFlowVersion } from "../versionsupport.js";
|
|
27
26
|
import { MiniMapV12 } from "./MiniMapV12.js";
|
|
27
|
+
import { miniMapUtils } from "./utils.js";
|
|
28
28
|
var minimapCalcConf = {
|
|
29
29
|
navigationOn: false,
|
|
30
30
|
minimapElement: null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MiniMap.js","sourceRoot":"","sources":["../../../../../src/extensions/react-flow/minimap/MiniMap.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,EACH,OAAO,IAAI,kBAAkB,EAGhC,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"MiniMap.js","sourceRoot":"","sources":["../../../../../src/extensions/react-flow/minimap/MiniMap.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,EACH,OAAO,IAA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,GAAG,IAAI,CAAC;QACxC,CAAC;IACL,CAAC,CAAC;IAEF,OAAO,CACH,sCACI,GAAG,EAAE,cAAc,EACnB,WAAW,EAAE,sBAAsB,EACnC,SAAS,EAAE,oBAAoB,EAC/B,WAAW,EAAE,sBAAsB,EACnC,YAAY,EAAE,oBAAoB,IAC9B,YAAY,IAChB,KAAK,EACD,YAAY,IAAI,gBAAgB;YAC5B,CAAC,uBAAM,CAAC,MAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,KAAK,mCAAI,EAAE,CAAC,KAAE,MAAM,EAAE,MAAM,IAClD,CAAC,CAAC,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,KAAK;QAG7B,oBAAC,kBAAkB,aACf,SAAS,EAAE,SAAS,EACpB,aAAa,EAAE,aAAa,EAC5B,SAAS,EAAE,SAAS,EACpB,eAAe,EAAE,eAAe,IAC5B,YAAY,EAClB,CACA,CACT,CAAC;AACN,CAAC,CACJ,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MiniMapV12.js","sourceRoot":"","sources":["../../../../../src/extensions/react-flow/minimap/MiniMapV12.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAyC,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"MiniMapV12.js","sourceRoot":"","sources":["../../../../../src/extensions/react-flow/minimap/MiniMapV12.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAyC,MAAM,eAAe,CAAC;AAGnG,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAKvC;;;GAGG;AACH,MAAM,CAAC,IAAM,UAAU,GAAG,IAAI,CAC1B,UAAC,EAOiB;;IANd,IAAA,wBAAwB,EAAxB,gBAAgB,mBAAG,KAAK,KAAA,EACxB,qBAA0C,EAA1C,aAAa,mBAAG,YAAY,CAAC,aAAa,KAAA,EAC1C,iBAAkC,EAAlC,SAAS,mBAAG,YAAY,CAAC,SAAS,KAAA,EAClC,uBAA0C,EAA1C,eAAe,mBAAG,YAAY,CAAC,WAAW,KAAA,EAC1C,YAAY,kBAAA,EACT,YAAY,cANlB,qFAOA,CADkB;IAEf,OAAO,CACH,wCACQ,YAAY,IAChB,KAAK,EAAE,gBAAgB,CAAC,CAAC,uBAAM,CAAC,MAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,KAAK,mCAAI,EAAE,CAAC,KAAE,MAAM,EAAE,MAAM,IAAG,CAAC,CAAC,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,KAAK;QAElG,oBAAC,gBAAgB,aACb,aAAa,EAAE,aAAa,EAC5B,SAAS,EAAE,SAAS,EACpB,eAAe,EAAE,eAAe,IAC5B,YAAY,IAChB,QAAQ,EAAE,gBAAgB,EAC1B,QAAQ,EAAE,gBAAgB,IAC5B,CACA,CACT,CAAC;AACN,CAAC,CACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodeUtils.js","sourceRoot":"","sources":["../../../../../src/extensions/react-flow/nodes/nodeUtils.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"nodeUtils.js","sourceRoot":"","sources":["../../../../../src/extensions/react-flow/nodes/nodeUtils.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAmB1B;;;;;GAKG;AACH,IAAM,yBAAyB,GAAG,UAAC,IAAgC;;IAC/D,OAAO;QACH,EAAE,EAAE,IAAI,CAAC,EAAE;QACX,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,UAAW;QAC3C,QAAQ,EAAE,EAAC,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,KAAK,EAAE,MAAA,IAAI,CAAC,IAAI,CAAC,cAAc,0CAAE,KAAK,EAAE,MAAM,EAAE,MAAA,IAAI,CAAC,IAAI,CAAC,cAAc,0CAAE,MAAM,EAAC;QACpI,KAAK,EAAE,MAAA,IAAI,CAAC,IAAI,CAAC,KAAK,0CAAE,WAAY;KACvC,CAAA;AACL,CAAC,CAAC;AAEF;;;;;GAKG;AACH,IAAM,sBAAsB,GAAG,UAAC,KAAa;IACzC,IAAI,KAAK,GAAkB,EAAE,CAAC;IAC9B,IAAI,CAAC;QACD,IAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,CAAC;QACvD,KAAK,GAAG;YACJ,eAAe,EAAE,QAAQ,CAAC,QAAQ,EAAE;YACpC,WAAW,EAAE,KAAK;YAClB,KAAK,EAAE,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM;SAC9C,CAAC;IACN,CAAC;IAAC,WAAM,CAAC;QACL,sCAAsC;QACtC,OAAO,CAAC,IAAI,CAAC,0CAA0C,GAAG,KAAK,CAAC,CAAC;IACrE,CAAC;IACD,OAAO,KAAK,CAAC;AACjB,CAAC,CAAC;AAEF,MAAM,CAAC,IAAM,gBAAgB,GAAG;IAC5B,sBAAsB,wBAAA;IACtB,yBAAyB,2BAAA;CAC5B,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -1,27 +1,43 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { ContentBlobTogglerProps } from "
|
|
2
|
+
import { ContentBlobTogglerProps } from "./../../index";
|
|
3
3
|
export interface StringPreviewContentBlobTogglerProps extends Omit<ContentBlobTogglerProps, "previewContent" | "enableToggler"> {
|
|
4
4
|
/**
|
|
5
|
-
The preview content will be cut to this length if it is too long.
|
|
5
|
+
* The preview content will be cut to this length if it is too long.
|
|
6
6
|
*/
|
|
7
7
|
previewMaxLength?: number;
|
|
8
8
|
/**
|
|
9
|
-
The content string.
|
|
9
|
+
* The content string.
|
|
10
|
+
* If it is smaller than `previewMaxLength` this will be displayed in full, else `fullviewContent` will be displayed.
|
|
10
11
|
*/
|
|
11
12
|
content: string;
|
|
12
|
-
/**
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Use only parts of `content` in the preview.
|
|
15
|
+
* `firstMarkdownSection` uses the content until the first double line return.
|
|
16
|
+
* Currently overwritten by `firstNonEmptyLineOnly`.
|
|
17
|
+
*/
|
|
18
|
+
useOnly?: "firstNonEmptyLine" | "firstMarkdownSection";
|
|
19
|
+
/**
|
|
20
|
+
* If enabled the preview is rendered as Markdown.
|
|
21
|
+
*/
|
|
15
22
|
renderPreviewAsMarkdown?: boolean;
|
|
16
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* White-listing of HTML elements that will be rendered when renderPreviewAsMarkdown is enabled.
|
|
25
|
+
*/
|
|
17
26
|
allowedHtmlElementsInPreview?: string[];
|
|
18
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* Allows to add non-string elements at the end of the content if the full description is shown, i.e. no toggler is necessary.
|
|
19
29
|
* This allows to add non-string elements to both the full-view content and the pure string content.
|
|
20
30
|
*/
|
|
21
31
|
noTogglerContentSuffix?: JSX.Element;
|
|
32
|
+
/**
|
|
33
|
+
* If only the first non-empty line should be shown in the preview.
|
|
34
|
+
* This will in addition also be shortened according to `previewMaxLength`.
|
|
35
|
+
* @deprecated (v26) use `useOnly="firstNonEmptyLine"` instead
|
|
36
|
+
*/
|
|
37
|
+
firstNonEmptyLineOnly?: boolean;
|
|
22
38
|
}
|
|
23
|
-
/** Version of the content toggler for text
|
|
24
|
-
export declare function StringPreviewContentBlobToggler({ className, previewMaxLength, toggleExtendText, toggleReduceText, content, fullviewContent, startExtended,
|
|
39
|
+
/** Version of the content toggler for text centric content. */
|
|
40
|
+
export declare function StringPreviewContentBlobToggler({ className, previewMaxLength, toggleExtendText, toggleReduceText, content, fullviewContent, startExtended, useOnly, renderPreviewAsMarkdown, allowedHtmlElementsInPreview, noTogglerContentSuffix, firstNonEmptyLineOnly, }: StringPreviewContentBlobTogglerProps): React.JSX.Element;
|
|
25
41
|
/**
|
|
26
42
|
* Takes the first non-empty line from a preview string.
|
|
27
43
|
*/
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { getEnabledColorsFromPalette, textToColorHash } from "./utils/colorHash";
|
|
2
|
+
export type { DecodeOptions as DecodeHtmlEntitiesOptions } from "he";
|
|
2
3
|
export type { IntentTypes as IntentBaseTypes } from "./Intent";
|
|
3
4
|
export declare const utils: {
|
|
4
5
|
openInNewTab: (event: React.MouseEvent<HTMLAnchorElement>, handler?: (e: React.MouseEvent<HTMLAnchorElement>) => void, url?: string) => void;
|
|
@@ -27,4 +28,5 @@ export declare const utils: {
|
|
|
27
28
|
getEnabledColorsFromPalette: typeof getEnabledColorsFromPalette;
|
|
28
29
|
textToColorHash: typeof textToColorHash;
|
|
29
30
|
reduceToText: import("./utils/reduceToText").ReduceToTextFuncType;
|
|
31
|
+
decodeHtmlEntities: import("he").Decode;
|
|
30
32
|
};
|
|
@@ -5,6 +5,6 @@ export interface ReduceToTextFuncType {
|
|
|
5
5
|
/**
|
|
6
6
|
* Component or text to reduce HTML markup content to plain text.
|
|
7
7
|
*/
|
|
8
|
-
input: React.ReactNode | React.ReactNode[] | string, options?: Pick<TextReducerProps, "maxNodes" | "maxLength">): string;
|
|
8
|
+
input: React.ReactNode | React.ReactNode[] | string, options?: Pick<TextReducerProps, "maxNodes" | "maxLength" | "decodeHtmlEntities" | "decodeHtmlEntitiesOptions">): string;
|
|
9
9
|
}
|
|
10
10
|
export declare const reduceToText: ReduceToTextFuncType;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
type media = "print" | "screen";
|
|
3
|
+
interface ApplicationViewabilityShow {
|
|
4
|
+
/**
|
|
5
|
+
* Show on media type.
|
|
6
|
+
* If used, `hide` cannot be set.
|
|
7
|
+
*/
|
|
8
|
+
show: media;
|
|
9
|
+
hide?: never;
|
|
10
|
+
}
|
|
11
|
+
interface ApplicationViewabilityHide {
|
|
12
|
+
/**
|
|
13
|
+
* Hide on media type.
|
|
14
|
+
* If used, `show` cannot be set.
|
|
15
|
+
*/
|
|
16
|
+
hide: media;
|
|
17
|
+
show?: never;
|
|
18
|
+
}
|
|
19
|
+
interface ApplicationViewabilityUndecided {
|
|
20
|
+
/**
|
|
21
|
+
* Only one child allowed.
|
|
22
|
+
* Need to process the `className` property.
|
|
23
|
+
*/
|
|
24
|
+
children: React.ReactElement<{
|
|
25
|
+
className?: string;
|
|
26
|
+
}>;
|
|
27
|
+
}
|
|
28
|
+
export type ApplicationViewabilityProps = ApplicationViewabilityUndecided & (ApplicationViewabilityShow | ApplicationViewabilityHide);
|
|
29
|
+
/**
|
|
30
|
+
* Sets the viewability of the the contained element regarding media.
|
|
31
|
+
* Can be used to hide elements, e.g. when the page is printed.
|
|
32
|
+
*/
|
|
33
|
+
export declare const ApplicationViewability: ({ children, show, hide }: ApplicationViewabilityProps) => React.ReactElement<{
|
|
34
|
+
className?: string;
|
|
35
|
+
}, string | React.JSXElementConstructor<any>>;
|
|
36
|
+
export default ApplicationViewability;
|
|
@@ -47,5 +47,5 @@ export interface ContextMenuProps extends TestableComponent {
|
|
|
47
47
|
/**
|
|
48
48
|
* Element displays menu items after toggler is clicked.
|
|
49
49
|
*/
|
|
50
|
-
export declare const ContextMenu: ({ children, className, togglerElement, togglerText, contextOverlayProps, disabled, togglerLarge, tooltipAsTitle, preventPlaceholder, ...restProps }: ContextMenuProps) => React.JSX.Element;
|
|
50
|
+
export declare const ContextMenu: ({ children, className, togglerElement, togglerText, contextOverlayProps, disabled, togglerLarge, tooltipAsTitle, preventPlaceholder, "data-test-id": dataTestId, "data-testid": dataTestid, ...restProps }: ContextMenuProps) => React.JSX.Element;
|
|
51
51
|
export default ContextMenu;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ButtonProps } from "../Button/Button";
|
|
3
|
+
import { TestableComponent } from "../interfaces";
|
|
3
4
|
import { ValidIconName } from "./canonicalIconNames";
|
|
4
5
|
import { TestIconProps } from "./TestIcon";
|
|
5
|
-
import { TestableComponent } from "../interfaces";
|
|
6
6
|
interface ExtendedButtonProps extends Omit<ButtonProps, "name" | "icon" | "rightIcon" | "text" | "minimal" | "tooltip">, TestableComponent {
|
|
7
7
|
/**
|
|
8
8
|
* Canonical icon name, or an array of strings.
|
|
@@ -132,7 +132,7 @@ export declare const TitleSubsection: ({ children, className, useHtmlElement, ..
|
|
|
132
132
|
onBlurCapture?: React.FocusEventHandler<HTMLElement> | undefined;
|
|
133
133
|
onChange?: React.FormEventHandler<HTMLElement> | undefined;
|
|
134
134
|
onChangeCapture?: React.FormEventHandler<HTMLElement> | undefined;
|
|
135
|
-
onBeforeInput?: React.
|
|
135
|
+
onBeforeInput?: React.InputEventHandler<HTMLElement> | undefined;
|
|
136
136
|
onBeforeInputCapture?: React.FormEventHandler<HTMLElement> | undefined;
|
|
137
137
|
onInput?: React.FormEventHandler<HTMLElement> | undefined;
|
|
138
138
|
onInputCapture?: React.FormEventHandler<HTMLElement> | undefined;
|
|
@@ -154,7 +154,7 @@ export declare const transformTabProperties: ({ title, dontShrink, className, ba
|
|
|
154
154
|
onBlurCapture?: React.FocusEventHandler<HTMLDivElement> | undefined;
|
|
155
155
|
onChange?: React.FormEventHandler<HTMLDivElement> | undefined;
|
|
156
156
|
onChangeCapture?: React.FormEventHandler<HTMLDivElement> | undefined;
|
|
157
|
-
onBeforeInput?: React.
|
|
157
|
+
onBeforeInput?: React.InputEventHandler<HTMLDivElement> | undefined;
|
|
158
158
|
onBeforeInputCapture?: React.FormEventHandler<HTMLDivElement> | undefined;
|
|
159
159
|
onInput?: React.FormEventHandler<HTMLDivElement> | undefined;
|
|
160
160
|
onInputCapture?: React.FormEventHandler<HTMLDivElement> | undefined;
|
|
@@ -432,7 +432,7 @@ export declare const transformTabProperties: ({ title, dontShrink, className, ba
|
|
|
432
432
|
onBlurCapture?: React.FocusEventHandler<HTMLDivElement> | undefined;
|
|
433
433
|
onChange?: React.FormEventHandler<HTMLDivElement> | undefined;
|
|
434
434
|
onChangeCapture?: React.FormEventHandler<HTMLDivElement> | undefined;
|
|
435
|
-
onBeforeInput?: React.
|
|
435
|
+
onBeforeInput?: React.InputEventHandler<HTMLDivElement> | undefined;
|
|
436
436
|
onBeforeInputCapture?: React.FormEventHandler<HTMLDivElement> | undefined;
|
|
437
437
|
onInput?: React.FormEventHandler<HTMLDivElement> | undefined;
|
|
438
438
|
onInputCapture?: React.FormEventHandler<HTMLDivElement> | undefined;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { DecodeHtmlEntitiesOptions } from "../../common";
|
|
2
3
|
import { OverflowTextProps } from "./../Typography";
|
|
3
4
|
export interface TextReducerProps extends Pick<React.HTMLAttributes<HTMLElement>, "children"> {
|
|
4
5
|
/**
|
|
@@ -19,10 +20,21 @@ export interface TextReducerProps extends Pick<React.HTMLAttributes<HTMLElement>
|
|
|
19
20
|
* Specify more `OverflowText` properties used when `useOverflowTextWrapper` is set to `true`.
|
|
20
21
|
*/
|
|
21
22
|
overflowTextProps?: Omit<OverflowTextProps, "passDown">;
|
|
23
|
+
/**
|
|
24
|
+
* If you transform HTML markup to text then the result could contain HTML entity encoded strings.
|
|
25
|
+
* By enabling this option they are decoded back to it's original char.
|
|
26
|
+
*/
|
|
27
|
+
decodeHtmlEntities?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Set the options used to decode the HTML entities, if `decodeHtmlEntities` is enabled.
|
|
30
|
+
* Internally we use `he` library, see their [documentation on decode options](https://www.npmjs.com/package/he#hedecodehtml-options).
|
|
31
|
+
* If not set we use `{ isAttributeValue: true, strict: true }` as default value.
|
|
32
|
+
*/
|
|
33
|
+
decodeHtmlEntitiesOptions?: DecodeHtmlEntitiesOptions;
|
|
22
34
|
}
|
|
23
35
|
/**
|
|
24
36
|
* Component to reduce HTML markup content to simple text.
|
|
25
37
|
* Display can be wrapped easily in `OverflowText`.
|
|
26
38
|
*/
|
|
27
|
-
export declare const TextReducer: ({ children,
|
|
39
|
+
export declare const TextReducer: ({ children, useOverflowTextWrapper, overflowTextProps, ...reduceToTextOptions }: TextReducerProps) => React.JSX.Element;
|
|
28
40
|
export default TextReducer;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { TestableComponent } from "../interfaces";
|
|
3
|
+
export interface InlineTextProps extends React.HTMLAttributes<HTMLElement>, TestableComponent {
|
|
4
|
+
/**
|
|
5
|
+
* Additional CSS class name.
|
|
6
|
+
*/
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Forces all children to be displayed as inline content.
|
|
11
|
+
*/
|
|
12
|
+
export declare const InlineText: ({ className, children, ...otherProps }: InlineTextProps) => React.JSX.Element;
|
|
13
|
+
export default InlineText;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { html } from "@codemirror/lang-html";
|
|
1
2
|
import { javascript } from "@codemirror/lang-javascript";
|
|
2
3
|
import { json } from "@codemirror/lang-json";
|
|
3
4
|
import { markdown } from "@codemirror/lang-markdown";
|
|
4
5
|
import { sql } from "@codemirror/lang-sql";
|
|
5
6
|
import { xml } from "@codemirror/lang-xml";
|
|
6
7
|
import { yaml } from "@codemirror/lang-yaml";
|
|
7
|
-
import { html } from "@codemirror/lang-html";
|
|
8
8
|
import { StreamParser } from "@codemirror/language";
|
|
9
9
|
declare const supportedModes: {
|
|
10
10
|
readonly markdown: typeof markdown;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* 'EditorView is not a constructor'
|
|
6
6
|
* This errors do not exist during compilation only during testing.
|
|
7
7
|
*/
|
|
8
|
-
import {
|
|
8
|
+
import { Compartment, Extension } from "@codemirror/state";
|
|
9
9
|
/** placeholder extension, current error '_view.placeholder is not a function' */
|
|
10
10
|
export declare const adaptedPlaceholder: (text?: string) => Extension;
|
|
11
11
|
/** current error '_view.Editor is not a constructor' */
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eccenca/gui-elements",
|
|
3
3
|
"description": "GUI elements based on other libraries, usable in React application, written in Typescript.",
|
|
4
|
-
"version": "25.
|
|
4
|
+
"version": "25.1.0-rc.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://github.com/eccenca/gui-elements",
|
|
7
7
|
"bugs": "https://github.com/eccenca/gui-elements/issues",
|
|
@@ -68,28 +68,29 @@
|
|
|
68
68
|
"autolint:all": "yarn autolint:scripts && yarn autolint:styles && yarn autolint:prettier"
|
|
69
69
|
},
|
|
70
70
|
"dependencies": {
|
|
71
|
-
"@blueprintjs/colors": "^5.1.
|
|
72
|
-
"@blueprintjs/core": "^5.
|
|
73
|
-
"@blueprintjs/select": "^5.3.
|
|
74
|
-
"@carbon/icons": "^11.
|
|
75
|
-
"@carbon/react": "^1.
|
|
76
|
-
"@codemirror/lang-html": "^6.4.
|
|
77
|
-
"@codemirror/lang-javascript": "^6.2.
|
|
78
|
-
"@codemirror/lang-json": "^6.0.
|
|
79
|
-
"@codemirror/lang-markdown": "^6.
|
|
80
|
-
"@codemirror/lang-sql": "^6.
|
|
71
|
+
"@blueprintjs/colors": "^5.1.11",
|
|
72
|
+
"@blueprintjs/core": "^5.19.1",
|
|
73
|
+
"@blueprintjs/select": "^5.3.21",
|
|
74
|
+
"@carbon/icons": "^11.70.0",
|
|
75
|
+
"@carbon/react": "^1.96.0",
|
|
76
|
+
"@codemirror/lang-html": "^6.4.11",
|
|
77
|
+
"@codemirror/lang-javascript": "^6.2.4",
|
|
78
|
+
"@codemirror/lang-json": "^6.0.2",
|
|
79
|
+
"@codemirror/lang-markdown": "^6.5.0",
|
|
80
|
+
"@codemirror/lang-sql": "^6.10.0",
|
|
81
81
|
"@codemirror/lang-xml": "^6.1.0",
|
|
82
82
|
"@codemirror/lang-yaml": "^6.1.2",
|
|
83
|
-
"@codemirror/legacy-modes": "^6.5.
|
|
83
|
+
"@codemirror/legacy-modes": "^6.5.2",
|
|
84
84
|
"@mavrin/remark-typograf": "^2.2.0",
|
|
85
|
-
"@xyflow/react": "^12.
|
|
85
|
+
"@xyflow/react": "^12.9.3",
|
|
86
86
|
"classnames": "^2.5.1",
|
|
87
|
-
"codemirror": "^6.0.
|
|
87
|
+
"codemirror": "^6.0.2",
|
|
88
88
|
"color": "^4.2.3",
|
|
89
89
|
"compute-scroll-into-view": "^3.1.1",
|
|
90
|
+
"he": "^1.2.0",
|
|
90
91
|
"jshint": "^2.13.6",
|
|
91
92
|
"lodash": "^4.17.21",
|
|
92
|
-
"n3": "^1.
|
|
93
|
+
"n3": "^1.26.0",
|
|
93
94
|
"re-resizable": "^6.10.3",
|
|
94
95
|
"react": "^16.13.1",
|
|
95
96
|
"react-dom": "^16.14.0",
|
|
@@ -97,7 +98,7 @@
|
|
|
97
98
|
"react-inlinesvg": "^3.0.3",
|
|
98
99
|
"react-is": "^16.13.1",
|
|
99
100
|
"react-markdown": "^10.1.0",
|
|
100
|
-
"react-syntax-highlighter": "^15.6.
|
|
101
|
+
"react-syntax-highlighter": "^15.6.6",
|
|
101
102
|
"rehype-external-links": "^3.0.0",
|
|
102
103
|
"rehype-raw": "^7.0.0",
|
|
103
104
|
"remark-definition-list": "^2.0.0",
|
|
@@ -106,54 +107,54 @@
|
|
|
106
107
|
"reset-css": "^5.0.2",
|
|
107
108
|
"unified": "^11.0.5",
|
|
108
109
|
"wicg-inert": "^3.1.3",
|
|
109
|
-
"xml-formatter": "^3.6.
|
|
110
|
+
"xml-formatter": "^3.6.7"
|
|
110
111
|
},
|
|
111
112
|
"devDependencies": {
|
|
112
|
-
"@babel/core": "^7.
|
|
113
|
-
"@babel/plugin-transform-class-properties": "^7.
|
|
114
|
-
"@babel/plugin-transform-private-methods": "^7.
|
|
115
|
-
"@babel/plugin-transform-private-property-in-object": "^7.
|
|
116
|
-
"@babel/preset-env": "^7.
|
|
117
|
-
"@babel/preset-flow": "^7.
|
|
118
|
-
"@babel/preset-react": "^7.
|
|
119
|
-
"@babel/preset-typescript": "^7.
|
|
120
|
-
"@eslint/compat": "^1.
|
|
113
|
+
"@babel/core": "^7.28.5",
|
|
114
|
+
"@babel/plugin-transform-class-properties": "^7.27.1",
|
|
115
|
+
"@babel/plugin-transform-private-methods": "^7.27.1",
|
|
116
|
+
"@babel/plugin-transform-private-property-in-object": "^7.27.1",
|
|
117
|
+
"@babel/preset-env": "^7.28.5",
|
|
118
|
+
"@babel/preset-flow": "^7.27.1",
|
|
119
|
+
"@babel/preset-react": "^7.28.5",
|
|
120
|
+
"@babel/preset-typescript": "^7.28.5",
|
|
121
|
+
"@eslint/compat": "^1.4.1",
|
|
121
122
|
"@eslint/eslintrc": "^3.3.1",
|
|
122
|
-
"@eslint/js": "^9.
|
|
123
|
-
"@storybook/addon-actions": "^8.6.
|
|
124
|
-
"@storybook/addon-essentials": "^8.6.
|
|
125
|
-
"@storybook/addon-jest": "^8.6.
|
|
126
|
-
"@storybook/addon-links": "^8.6.
|
|
123
|
+
"@eslint/js": "^9.39.1",
|
|
124
|
+
"@storybook/addon-actions": "^8.6.14",
|
|
125
|
+
"@storybook/addon-essentials": "^8.6.14",
|
|
126
|
+
"@storybook/addon-jest": "^8.6.14",
|
|
127
|
+
"@storybook/addon-links": "^8.6.14",
|
|
127
128
|
"@storybook/addon-webpack5-compiler-babel": "^3.0.6",
|
|
128
|
-
"@storybook/cli": "^8.6.
|
|
129
|
+
"@storybook/cli": "^8.6.14",
|
|
129
130
|
"@storybook/preset-scss": "^1.0.3",
|
|
130
|
-
"@storybook/react": "^8.6.
|
|
131
|
-
"@storybook/react-webpack5": "^8.6.
|
|
132
|
-
"@storybook/test": "^8.6.
|
|
133
|
-
"@testing-library/jest-dom": "^6.
|
|
131
|
+
"@storybook/react": "^8.6.14",
|
|
132
|
+
"@storybook/react-webpack5": "^8.6.14",
|
|
133
|
+
"@storybook/test": "^8.6.14",
|
|
134
|
+
"@testing-library/jest-dom": "^6.9.1",
|
|
134
135
|
"@testing-library/react": "^12.1.5",
|
|
135
|
-
"@types/codemirror": "^5.60.15",
|
|
136
136
|
"@types/color": "^3.0.6",
|
|
137
|
-
"@types/
|
|
137
|
+
"@types/he": "^1.2.3",
|
|
138
|
+
"@types/jest": "^30.0.0",
|
|
138
139
|
"@types/jshint": "^2.12.4",
|
|
139
|
-
"@types/lodash": "^4.17.
|
|
140
|
-
"@types/n3": "^1.
|
|
141
|
-
"@types/react-is": "^19.
|
|
140
|
+
"@types/lodash": "^4.17.21",
|
|
141
|
+
"@types/n3": "^1.26.1",
|
|
142
|
+
"@types/react-is": "^19.2.0",
|
|
142
143
|
"@types/react-syntax-highlighter": "^15.5.13",
|
|
143
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
144
|
-
"@typescript-eslint/parser": "^8.
|
|
145
|
-
"babel-jest": "^
|
|
146
|
-
"chromatic": "^
|
|
147
|
-
"eslint": "^9.
|
|
144
|
+
"@typescript-eslint/eslint-plugin": "^8.47.0",
|
|
145
|
+
"@typescript-eslint/parser": "^8.47.0",
|
|
146
|
+
"babel-jest": "^30.2.0",
|
|
147
|
+
"chromatic": "^13.3.4",
|
|
148
|
+
"eslint": "^9.39.1",
|
|
148
149
|
"eslint-plugin-react": "^7.37.5",
|
|
149
|
-
"eslint-plugin-react-hooks": "^
|
|
150
|
+
"eslint-plugin-react-hooks": "^7.0.1",
|
|
150
151
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
151
152
|
"husky": "4",
|
|
152
153
|
"identity-obj-proxy": "^3.0.0",
|
|
153
|
-
"jest": "^30.0
|
|
154
|
-
"jest-environment-jsdom": "^30.0
|
|
154
|
+
"jest": "^30.2.0",
|
|
155
|
+
"jest-environment-jsdom": "^30.2.0",
|
|
155
156
|
"jest-pnp-resolver": "^1.2.3",
|
|
156
|
-
"lint-staged": "^15.5.
|
|
157
|
+
"lint-staged": "^15.5.2",
|
|
157
158
|
"node-sass-package-importer": "^5.3.3",
|
|
158
159
|
"path": "^0.12.7",
|
|
159
160
|
"prettier": "^2.8.8",
|
|
@@ -163,7 +164,7 @@
|
|
|
163
164
|
"rimraf": "^5.0.10",
|
|
164
165
|
"sass": "1.62.1",
|
|
165
166
|
"sass-loader": "10.3.1",
|
|
166
|
-
"storybook": "^8.6.
|
|
167
|
+
"storybook": "^8.6.14",
|
|
167
168
|
"stylelint": "^16.18.0",
|
|
168
169
|
"stylelint-config-recess-order": "^6.0.0",
|
|
169
170
|
"stylelint-config-standard-scss": "^14.0.0",
|
|
@@ -178,8 +179,8 @@
|
|
|
178
179
|
"react": ">=16"
|
|
179
180
|
},
|
|
180
181
|
"resolutions": {
|
|
181
|
-
"**/@types/react": "^17.0.
|
|
182
|
-
"node-sass-package-importer/**/postcss": "^8.
|
|
182
|
+
"**/@types/react": "^17.0.90",
|
|
183
|
+
"node-sass-package-importer/**/postcss": "^8.5.6",
|
|
183
184
|
"string-width": "^4.2.3",
|
|
184
185
|
"wrap-ansi": "^7.0.0",
|
|
185
186
|
"hast-util-from-parse5": "8.0.0"
|
|
@@ -1,30 +1,46 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
|
|
3
|
-
import { ContentBlobToggler, ContentBlobTogglerProps, Markdown } from "
|
|
3
|
+
import { ContentBlobToggler, ContentBlobTogglerProps, InlineText, Markdown, utils } from "./../../index";
|
|
4
4
|
|
|
5
5
|
export interface StringPreviewContentBlobTogglerProps
|
|
6
6
|
extends Omit<ContentBlobTogglerProps, "previewContent" | "enableToggler"> {
|
|
7
7
|
/**
|
|
8
|
-
The preview content will be cut to this length if it is too long.
|
|
8
|
+
* The preview content will be cut to this length if it is too long.
|
|
9
9
|
*/
|
|
10
10
|
previewMaxLength?: number;
|
|
11
11
|
/**
|
|
12
|
-
The content string.
|
|
12
|
+
* The content string.
|
|
13
|
+
* If it is smaller than `previewMaxLength` this will be displayed in full, else `fullviewContent` will be displayed.
|
|
13
14
|
*/
|
|
14
15
|
content: string;
|
|
15
|
-
/**
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Use only parts of `content` in the preview.
|
|
18
|
+
* `firstMarkdownSection` uses the content until the first double line return.
|
|
19
|
+
* Currently overwritten by `firstNonEmptyLineOnly`.
|
|
20
|
+
*/
|
|
21
|
+
useOnly?: "firstNonEmptyLine" | "firstMarkdownSection";
|
|
22
|
+
/**
|
|
23
|
+
* If enabled the preview is rendered as Markdown.
|
|
24
|
+
*/
|
|
18
25
|
renderPreviewAsMarkdown?: boolean;
|
|
19
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* White-listing of HTML elements that will be rendered when renderPreviewAsMarkdown is enabled.
|
|
28
|
+
*/
|
|
20
29
|
allowedHtmlElementsInPreview?: string[];
|
|
21
|
-
/**
|
|
30
|
+
/**
|
|
31
|
+
* Allows to add non-string elements at the end of the content if the full description is shown, i.e. no toggler is necessary.
|
|
22
32
|
* This allows to add non-string elements to both the full-view content and the pure string content.
|
|
23
33
|
*/
|
|
24
34
|
noTogglerContentSuffix?: JSX.Element;
|
|
35
|
+
/**
|
|
36
|
+
* If only the first non-empty line should be shown in the preview.
|
|
37
|
+
* This will in addition also be shortened according to `previewMaxLength`.
|
|
38
|
+
* @deprecated (v26) use `useOnly="firstNonEmptyLine"` instead
|
|
39
|
+
*/
|
|
40
|
+
firstNonEmptyLineOnly?: boolean;
|
|
25
41
|
}
|
|
26
42
|
|
|
27
|
-
/** Version of the content toggler for text
|
|
43
|
+
/** Version of the content toggler for text centric content. */
|
|
28
44
|
export function StringPreviewContentBlobToggler({
|
|
29
45
|
className = "",
|
|
30
46
|
previewMaxLength,
|
|
@@ -33,14 +49,28 @@ export function StringPreviewContentBlobToggler({
|
|
|
33
49
|
content,
|
|
34
50
|
fullviewContent,
|
|
35
51
|
startExtended,
|
|
36
|
-
|
|
52
|
+
useOnly,
|
|
37
53
|
renderPreviewAsMarkdown = false,
|
|
38
54
|
allowedHtmlElementsInPreview,
|
|
39
55
|
noTogglerContentSuffix,
|
|
56
|
+
firstNonEmptyLineOnly,
|
|
40
57
|
}: StringPreviewContentBlobTogglerProps) {
|
|
41
|
-
|
|
42
|
-
const
|
|
43
|
-
|
|
58
|
+
// need to test `firstNonEmptyLineOnly` until property is removed
|
|
59
|
+
const useOnlyTest: StringPreviewContentBlobTogglerProps["useOnly"] = firstNonEmptyLineOnly
|
|
60
|
+
? "firstNonEmptyLine"
|
|
61
|
+
: useOnly;
|
|
62
|
+
|
|
63
|
+
let previewString = content;
|
|
64
|
+
switch (useOnlyTest) {
|
|
65
|
+
case "firstNonEmptyLine":
|
|
66
|
+
previewString = useOnlyPart(content, regexFirstNonEmptyLine);
|
|
67
|
+
break;
|
|
68
|
+
case "firstMarkdownSection":
|
|
69
|
+
previewString = useOnlyPart(content, regexFirstMarkdownSection);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
let enableToggler = previewString !== content;
|
|
73
|
+
|
|
44
74
|
let previewContent = renderPreviewAsMarkdown ? (
|
|
45
75
|
<Markdown key="markdown-content" allowedElements={allowedHtmlElementsInPreview}>
|
|
46
76
|
{previewString}
|
|
@@ -48,6 +78,15 @@ export function StringPreviewContentBlobToggler({
|
|
|
48
78
|
) : (
|
|
49
79
|
previewString
|
|
50
80
|
);
|
|
81
|
+
|
|
82
|
+
if (
|
|
83
|
+
previewMaxLength &&
|
|
84
|
+
utils.reduceToText(previewContent, { decodeHtmlEntities: true }).length > previewMaxLength
|
|
85
|
+
) {
|
|
86
|
+
previewContent = utils.reduceToText(previewContent, { decodeHtmlEntities: true }).slice(0, previewMaxLength);
|
|
87
|
+
enableToggler = true;
|
|
88
|
+
}
|
|
89
|
+
|
|
51
90
|
if (!enableToggler && noTogglerContentSuffix) {
|
|
52
91
|
previewContent = (
|
|
53
92
|
<>
|
|
@@ -60,7 +99,7 @@ export function StringPreviewContentBlobToggler({
|
|
|
60
99
|
return (
|
|
61
100
|
<ContentBlobToggler
|
|
62
101
|
className={className}
|
|
63
|
-
previewContent={previewContent}
|
|
102
|
+
previewContent={<InlineText>{previewContent}</InlineText>}
|
|
64
103
|
toggleExtendText={toggleExtendText}
|
|
65
104
|
toggleReduceText={toggleReduceText}
|
|
66
105
|
fullviewContent={fullviewContent}
|
|
@@ -70,17 +109,26 @@ export function StringPreviewContentBlobToggler({
|
|
|
70
109
|
);
|
|
71
110
|
}
|
|
72
111
|
|
|
73
|
-
const
|
|
112
|
+
const regexFirstNonEmptyLine = new RegExp("\r|\n"); // eslint-disable-line
|
|
113
|
+
const regexFirstMarkdownSection = new RegExp("\r\n\r\n|\n\n"); // eslint-disable-line
|
|
74
114
|
|
|
75
115
|
/**
|
|
76
116
|
* Takes the first non-empty line from a preview string.
|
|
77
117
|
*/
|
|
78
118
|
function firstNonEmptyLine(preview: string) {
|
|
119
|
+
return useOnlyPart(preview, regexFirstNonEmptyLine);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Returns only the first part from a preview string.
|
|
124
|
+
* Or the full string as fallback.
|
|
125
|
+
*/
|
|
126
|
+
function useOnlyPart(preview: string, regexTest: RegExp): string {
|
|
79
127
|
const previewString = preview.trim();
|
|
80
|
-
const result =
|
|
81
|
-
return result !== null ?
|
|
128
|
+
const result = regexTest.exec(previewString);
|
|
129
|
+
return result !== null ? result.input.slice(0, result.index) : previewString;
|
|
82
130
|
}
|
|
83
131
|
|
|
84
132
|
export const stringPreviewContentBlobTogglerUtils = {
|
|
85
133
|
firstNonEmptyLine,
|
|
86
|
-
};
|
|
134
|
+
};
|