@pareto-engineering/design-system 4.0.0-alpha.79 → 4.0.0-alpha.81
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/dist/cjs/a/Label/styles.scss +1 -1
- package/dist/cjs/a/Tooltip/Tooltip.js +21 -5
- package/dist/cjs/a/Tooltip/styles.scss +44 -39
- package/dist/cjs/f/fields/EditorInput/common/ColorPicker/ColorPicker.js +8 -4
- package/dist/cjs/f/fields/EditorInput/common/ToolbarPlugin/ToolbarPlugin.js +0 -6
- package/dist/cjs/g/ExpandableLexicalPreview/ExpandableLexicalPreview.js +44 -17
- package/dist/cjs/g/ExpandableLexicalPreview/common/NewWindowPortal/NewWindowPortal.js +79 -0
- package/dist/cjs/g/ExpandableLexicalPreview/common/NewWindowPortal/index.js +13 -0
- package/dist/cjs/g/ExpandableLexicalPreview/common/NewWindowPortal/styles.scss +9 -0
- package/dist/cjs/g/ExpandableLexicalPreview/common/index.js +3 -3
- package/dist/es/a/Label/styles.scss +1 -1
- package/dist/es/a/Tooltip/Tooltip.js +21 -5
- package/dist/es/a/Tooltip/styles.scss +44 -39
- package/dist/es/f/fields/EditorInput/common/ColorPicker/ColorPicker.js +8 -4
- package/dist/es/f/fields/EditorInput/common/ToolbarPlugin/ToolbarPlugin.js +0 -6
- package/dist/es/g/ExpandableLexicalPreview/ExpandableLexicalPreview.js +45 -18
- package/dist/es/g/ExpandableLexicalPreview/common/NewWindowPortal/NewWindowPortal.js +70 -0
- package/dist/es/g/ExpandableLexicalPreview/common/NewWindowPortal/index.js +2 -0
- package/dist/es/g/ExpandableLexicalPreview/common/NewWindowPortal/styles.scss +9 -0
- package/dist/es/g/ExpandableLexicalPreview/common/index.js +1 -1
- package/package.json +4 -4
- package/src/stories/a/Tooltip.stories.jsx +7 -12
- package/src/stories/g/ExpandableLexicalPreview.stories.jsx +12 -5
- package/src/ui/a/Label/styles.scss +1 -1
- package/src/ui/a/Tooltip/Tooltip.jsx +27 -4
- package/src/ui/a/Tooltip/styles.scss +44 -39
- package/src/ui/f/fields/EditorInput/common/ColorPicker/ColorPicker.jsx +8 -3
- package/src/ui/f/fields/EditorInput/common/ToolbarPlugin/ToolbarPlugin.jsx +0 -14
- package/src/ui/g/ExpandableLexicalPreview/ExpandableLexicalPreview.jsx +61 -25
- package/src/ui/g/ExpandableLexicalPreview/common/NewWindowPortal/NewWindowPortal.jsx +80 -0
- package/src/ui/g/ExpandableLexicalPreview/common/NewWindowPortal/index.js +2 -0
- package/src/ui/g/ExpandableLexicalPreview/common/NewWindowPortal/styles.scss +9 -0
- package/src/ui/g/ExpandableLexicalPreview/common/index.js +1 -1
- package/tests/__snapshots__/Storyshots.test.js.snap +58 -49
- package/dist/cjs/g/ExpandableLexicalPreview/common/ExpandButton/ExpandButton.js +0 -111
- package/dist/cjs/g/ExpandableLexicalPreview/common/ExpandButton/index.js +0 -13
- package/dist/es/g/ExpandableLexicalPreview/common/ExpandButton/ExpandButton.js +0 -99
- package/dist/es/g/ExpandableLexicalPreview/common/ExpandButton/index.js +0 -1
- package/src/ui/g/ExpandableLexicalPreview/common/ExpandButton/ExpandButton.jsx +0 -119
- package/src/ui/g/ExpandableLexicalPreview/common/ExpandButton/index.js +0 -1
|
@@ -14,13 +14,14 @@ import { EditorInput } from 'ui/f'
|
|
|
14
14
|
|
|
15
15
|
import { Button } from 'ui/b'
|
|
16
16
|
|
|
17
|
-
import {
|
|
17
|
+
import { NewWindowPortal } from './common'
|
|
18
18
|
|
|
19
19
|
import './styles.scss'
|
|
20
20
|
|
|
21
21
|
const baseClassName = styleNames.base
|
|
22
22
|
|
|
23
23
|
const componentClassName = 'expandable-lexical-preview'
|
|
24
|
+
|
|
24
25
|
/**
|
|
25
26
|
* This is the component description.
|
|
26
27
|
*/
|
|
@@ -32,14 +33,16 @@ const ExpandableLexicalPreview = ({
|
|
|
32
33
|
name,
|
|
33
34
|
color,
|
|
34
35
|
resize,
|
|
35
|
-
|
|
36
|
+
pageTitle,
|
|
37
|
+
onBlock,
|
|
38
|
+
onOpen,
|
|
39
|
+
header,
|
|
36
40
|
// ...otherProps
|
|
37
41
|
}) => {
|
|
38
|
-
const [
|
|
39
|
-
const [isExpanded, setIsExpanded] = useState(false)
|
|
42
|
+
const [isCollapsed, setIsCollapsed] = useState(false)
|
|
40
43
|
|
|
41
44
|
const handleButtonClick = () => {
|
|
42
|
-
|
|
45
|
+
setIsCollapsed(!isCollapsed)
|
|
43
46
|
}
|
|
44
47
|
|
|
45
48
|
return (
|
|
@@ -57,36 +60,59 @@ const ExpandableLexicalPreview = ({
|
|
|
57
60
|
componentClassName,
|
|
58
61
|
userClassName,
|
|
59
62
|
`y-${color}`,
|
|
60
|
-
|
|
63
|
+
isCollapsed && 'collapsed',
|
|
61
64
|
]
|
|
62
65
|
.filter((e) => e)
|
|
63
66
|
.join(' ')}
|
|
64
67
|
style={style}
|
|
65
68
|
>
|
|
66
|
-
{typeof
|
|
67
|
-
{
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
69
|
+
{typeof header === 'string' ? <p className="title h2">{header}</p> : header}
|
|
70
|
+
{isCollapsed ? (
|
|
71
|
+
<>
|
|
72
|
+
<Button
|
|
73
|
+
onClick={handleButtonClick}
|
|
74
|
+
color="background-far"
|
|
75
|
+
isCompact
|
|
76
|
+
>
|
|
77
|
+
<span className="ai-icon c-x x-paragraph">
|
|
78
|
+
C
|
|
79
|
+
</span>
|
|
80
|
+
</Button>
|
|
81
|
+
<NewWindowPortal
|
|
82
|
+
pageTitle={pageTitle}
|
|
83
|
+
onBlock={() => {
|
|
84
|
+
onBlock?.()
|
|
85
|
+
setIsCollapsed(false)
|
|
86
|
+
}}
|
|
87
|
+
onOpen={() => {
|
|
88
|
+
onOpen?.()
|
|
89
|
+
setIsCollapsed(true)
|
|
90
|
+
}}
|
|
91
|
+
>
|
|
92
|
+
<EditorInput
|
|
93
|
+
name={name}
|
|
94
|
+
resize={resize}
|
|
95
|
+
disabled
|
|
96
|
+
/>
|
|
97
|
+
</NewWindowPortal>
|
|
98
|
+
</>
|
|
77
99
|
) : (
|
|
78
100
|
<>
|
|
79
101
|
<EditorInput
|
|
80
102
|
name={name}
|
|
81
|
-
setEditorState={setEditorState}
|
|
82
103
|
resize={resize}
|
|
83
104
|
disabled
|
|
105
|
+
id="the-bad-ass-input"
|
|
84
106
|
/>
|
|
85
|
-
<
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
107
|
+
<Button
|
|
108
|
+
id={id}
|
|
109
|
+
className="expand-button ai-icon"
|
|
110
|
+
color="background-far"
|
|
111
|
+
isCompact
|
|
112
|
+
onClick={handleButtonClick}
|
|
113
|
+
>
|
|
114
|
+
D
|
|
115
|
+
</Button>
|
|
90
116
|
</>
|
|
91
117
|
)}
|
|
92
118
|
</div>
|
|
@@ -126,14 +152,24 @@ ExpandableLexicalPreview.propTypes = {
|
|
|
126
152
|
resize:PropTypes.string,
|
|
127
153
|
|
|
128
154
|
/**
|
|
129
|
-
* The
|
|
155
|
+
* The header for the preview component.
|
|
156
|
+
*/
|
|
157
|
+
header:PropTypes.node,
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* The page title for the expanded preview.
|
|
130
161
|
*/
|
|
131
|
-
|
|
162
|
+
pageTitle:PropTypes.string,
|
|
132
163
|
|
|
133
164
|
/**
|
|
134
165
|
* The name used to acces the nodes
|
|
135
166
|
*/
|
|
136
167
|
name:PropTypes.string.isRequired,
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* The function to run when a new window portal can be opened
|
|
171
|
+
*/
|
|
172
|
+
onBlock:PropTypes.func.isRequired,
|
|
137
173
|
}
|
|
138
174
|
|
|
139
175
|
ExpandableLexicalPreview.defaultProps = {
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
+
import { createPortal } from 'react-dom'
|
|
3
|
+
|
|
4
|
+
import { useState, useEffect, useMemo } from 'react'
|
|
5
|
+
|
|
6
|
+
import PropTypes from 'prop-types'
|
|
7
|
+
|
|
8
|
+
import styleNames from '@pareto-engineering/bem/exports'
|
|
9
|
+
|
|
10
|
+
// Local Definitions
|
|
11
|
+
import { useTheme } from 'ui/a'
|
|
12
|
+
|
|
13
|
+
import './styles.scss'
|
|
14
|
+
|
|
15
|
+
const baseClassName = styleNames.base
|
|
16
|
+
|
|
17
|
+
const copyStyles = (sourceDocument, targetDocument) => {
|
|
18
|
+
Array.from(sourceDocument.querySelectorAll('link[rel="stylesheet"], style'))
|
|
19
|
+
.forEach((link) => {
|
|
20
|
+
targetDocument.head.appendChild(link.cloneNode(true))
|
|
21
|
+
})
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* This is the component description.
|
|
25
|
+
*/
|
|
26
|
+
const NewWindowPortal = ({
|
|
27
|
+
children, pageTitle, onBlock, onOpen,
|
|
28
|
+
}) => {
|
|
29
|
+
const [newWindow, setNewWindow] = useState(null)
|
|
30
|
+
const container = useMemo(() => document.createElement('div'), [])
|
|
31
|
+
const { userTheme = 'light' } = useTheme()
|
|
32
|
+
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
if (!container) return
|
|
35
|
+
|
|
36
|
+
container.classList.add(baseClassName, 'new-window-portal', `ui-${userTheme}`)
|
|
37
|
+
const newExternalWindow = window.open('', pageTitle, 'width="100%",height="100%"')
|
|
38
|
+
|
|
39
|
+
if (newExternalWindow) {
|
|
40
|
+
newExternalWindow.document.title = pageTitle
|
|
41
|
+
newExternalWindow.document.body.appendChild(container)
|
|
42
|
+
setNewWindow(newExternalWindow)
|
|
43
|
+
onOpen()
|
|
44
|
+
} else {
|
|
45
|
+
console.warn('A new window / tab could not be opened. Check your settings and/or extensions, maybe it was blocked.')
|
|
46
|
+
onBlock()
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// eslint-disable-next-line consistent-return
|
|
50
|
+
return () => {
|
|
51
|
+
container.classList.remove(...container.classList)
|
|
52
|
+
newExternalWindow?.close()
|
|
53
|
+
}
|
|
54
|
+
}, [container, pageTitle, userTheme])
|
|
55
|
+
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
if (newWindow) {
|
|
58
|
+
copyStyles(document, newWindow.document)
|
|
59
|
+
}
|
|
60
|
+
}, [newWindow])
|
|
61
|
+
|
|
62
|
+
return createPortal(children, container)
|
|
63
|
+
}
|
|
64
|
+
NewWindowPortal.propTypes = {
|
|
65
|
+
/**
|
|
66
|
+
* The children JSX
|
|
67
|
+
*/
|
|
68
|
+
children:PropTypes.node,
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* The new window page title
|
|
72
|
+
*/
|
|
73
|
+
pageTitle:PropTypes.string.isRequired,
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
NewWindowPortal.defaultProps = {
|
|
77
|
+
// someProp:false
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export default NewWindowPortal
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { NewWindowPortal } from './NewWindowPortal'
|
|
@@ -11640,16 +11640,21 @@ exports[`Storyshots a/Tooltip Base 1`] = `
|
|
|
11640
11640
|
}
|
|
11641
11641
|
>
|
|
11642
11642
|
<div
|
|
11643
|
-
|
|
11643
|
+
className="base tooltip x-background-cards"
|
|
11644
11644
|
>
|
|
11645
|
-
<
|
|
11646
|
-
|
|
11647
|
-
|
|
11645
|
+
<div
|
|
11646
|
+
aria-describedby="test-tooltip"
|
|
11647
|
+
className="tooltip-trigger-wrapper"
|
|
11648
11648
|
>
|
|
11649
|
-
|
|
11650
|
-
|
|
11649
|
+
<button
|
|
11650
|
+
className="base button x-main"
|
|
11651
|
+
type="button"
|
|
11652
|
+
>
|
|
11653
|
+
Hover on me!
|
|
11654
|
+
</button>
|
|
11655
|
+
</div>
|
|
11651
11656
|
<div
|
|
11652
|
-
className="
|
|
11657
|
+
className="tooltip-content bottom"
|
|
11653
11658
|
id="test-tooltip"
|
|
11654
11659
|
role="tooltip"
|
|
11655
11660
|
>
|
|
@@ -11668,9 +11673,6 @@ exports[`Storyshots a/Tooltip Base 1`] = `
|
|
|
11668
11673
|
</div>
|
|
11669
11674
|
</div>
|
|
11670
11675
|
</div>
|
|
11671
|
-
<p>
|
|
11672
|
-
With some more content around
|
|
11673
|
-
</p>
|
|
11674
11676
|
</div>
|
|
11675
11677
|
`;
|
|
11676
11678
|
|
|
@@ -11688,16 +11690,21 @@ exports[`Storyshots a/Tooltip Left 1`] = `
|
|
|
11688
11690
|
}
|
|
11689
11691
|
>
|
|
11690
11692
|
<div
|
|
11691
|
-
|
|
11693
|
+
className="base tooltip x-background-cards"
|
|
11692
11694
|
>
|
|
11693
|
-
<
|
|
11694
|
-
|
|
11695
|
-
|
|
11695
|
+
<div
|
|
11696
|
+
aria-describedby="test-tooltip"
|
|
11697
|
+
className="tooltip-trigger-wrapper"
|
|
11696
11698
|
>
|
|
11697
|
-
|
|
11698
|
-
|
|
11699
|
+
<button
|
|
11700
|
+
className="base button x-main"
|
|
11701
|
+
type="button"
|
|
11702
|
+
>
|
|
11703
|
+
Hover on me!
|
|
11704
|
+
</button>
|
|
11705
|
+
</div>
|
|
11699
11706
|
<div
|
|
11700
|
-
className="
|
|
11707
|
+
className="tooltip-content left"
|
|
11701
11708
|
id="test-tooltip"
|
|
11702
11709
|
role="tooltip"
|
|
11703
11710
|
>
|
|
@@ -11716,9 +11723,6 @@ exports[`Storyshots a/Tooltip Left 1`] = `
|
|
|
11716
11723
|
</div>
|
|
11717
11724
|
</div>
|
|
11718
11725
|
</div>
|
|
11719
|
-
<p>
|
|
11720
|
-
With some more content around
|
|
11721
|
-
</p>
|
|
11722
11726
|
</div>
|
|
11723
11727
|
`;
|
|
11724
11728
|
|
|
@@ -11736,16 +11740,21 @@ exports[`Storyshots a/Tooltip Right 1`] = `
|
|
|
11736
11740
|
}
|
|
11737
11741
|
>
|
|
11738
11742
|
<div
|
|
11739
|
-
|
|
11743
|
+
className="base tooltip x-background-cards"
|
|
11740
11744
|
>
|
|
11741
|
-
<
|
|
11742
|
-
|
|
11743
|
-
|
|
11745
|
+
<div
|
|
11746
|
+
aria-describedby="test-tooltip"
|
|
11747
|
+
className="tooltip-trigger-wrapper"
|
|
11744
11748
|
>
|
|
11745
|
-
|
|
11746
|
-
|
|
11749
|
+
<button
|
|
11750
|
+
className="base button x-main"
|
|
11751
|
+
type="button"
|
|
11752
|
+
>
|
|
11753
|
+
Hover on me!
|
|
11754
|
+
</button>
|
|
11755
|
+
</div>
|
|
11747
11756
|
<div
|
|
11748
|
-
className="
|
|
11757
|
+
className="tooltip-content right"
|
|
11749
11758
|
id="test-tooltip"
|
|
11750
11759
|
role="tooltip"
|
|
11751
11760
|
>
|
|
@@ -11764,9 +11773,6 @@ exports[`Storyshots a/Tooltip Right 1`] = `
|
|
|
11764
11773
|
</div>
|
|
11765
11774
|
</div>
|
|
11766
11775
|
</div>
|
|
11767
|
-
<p>
|
|
11768
|
-
With some more content around
|
|
11769
|
-
</p>
|
|
11770
11776
|
</div>
|
|
11771
11777
|
`;
|
|
11772
11778
|
|
|
@@ -11784,16 +11790,21 @@ exports[`Storyshots a/Tooltip Top 1`] = `
|
|
|
11784
11790
|
}
|
|
11785
11791
|
>
|
|
11786
11792
|
<div
|
|
11787
|
-
|
|
11793
|
+
className="base tooltip x-background-cards"
|
|
11788
11794
|
>
|
|
11789
|
-
<
|
|
11790
|
-
|
|
11791
|
-
|
|
11795
|
+
<div
|
|
11796
|
+
aria-describedby="test-tooltip"
|
|
11797
|
+
className="tooltip-trigger-wrapper"
|
|
11792
11798
|
>
|
|
11793
|
-
|
|
11794
|
-
|
|
11799
|
+
<button
|
|
11800
|
+
className="base button x-main"
|
|
11801
|
+
type="button"
|
|
11802
|
+
>
|
|
11803
|
+
Hover on me!
|
|
11804
|
+
</button>
|
|
11805
|
+
</div>
|
|
11795
11806
|
<div
|
|
11796
|
-
className="
|
|
11807
|
+
className="tooltip-content top"
|
|
11797
11808
|
id="test-tooltip"
|
|
11798
11809
|
role="tooltip"
|
|
11799
11810
|
>
|
|
@@ -11812,9 +11823,6 @@ exports[`Storyshots a/Tooltip Top 1`] = `
|
|
|
11812
11823
|
</div>
|
|
11813
11824
|
</div>
|
|
11814
11825
|
</div>
|
|
11815
|
-
<p>
|
|
11816
|
-
With some more content around
|
|
11817
|
-
</p>
|
|
11818
11826
|
</div>
|
|
11819
11827
|
`;
|
|
11820
11828
|
|
|
@@ -26695,9 +26703,9 @@ exports[`Storyshots f/fields/EditorInput Base 1`] = `
|
|
|
26695
26703
|
className="rcp-saturation-cursor"
|
|
26696
26704
|
style={
|
|
26697
26705
|
{
|
|
26698
|
-
"backgroundColor": "rgb(
|
|
26706
|
+
"backgroundColor": "rgb(255 255 255)",
|
|
26699
26707
|
"left": 0,
|
|
26700
|
-
"top":
|
|
26708
|
+
"top": 0,
|
|
26701
26709
|
}
|
|
26702
26710
|
}
|
|
26703
26711
|
/>
|
|
@@ -26735,7 +26743,7 @@ exports[`Storyshots f/fields/EditorInput Base 1`] = `
|
|
|
26735
26743
|
className="rcp-alpha"
|
|
26736
26744
|
style={
|
|
26737
26745
|
{
|
|
26738
|
-
"background": "linear-gradient(to right, rgb(
|
|
26746
|
+
"background": "linear-gradient(to right, rgb(255 255 255 / 0), rgb(255 255 255 / 1)) top left / auto auto,
|
|
26739
26747
|
conic-gradient(#666 0.25turn, #999 0.25turn 0.5turn, #666 0.5turn 0.75turn, #999 0.75turn) top left / 12px 12px
|
|
26740
26748
|
repeat",
|
|
26741
26749
|
}
|
|
@@ -26745,7 +26753,7 @@ exports[`Storyshots f/fields/EditorInput Base 1`] = `
|
|
|
26745
26753
|
className="rcp-alpha-cursor"
|
|
26746
26754
|
style={
|
|
26747
26755
|
{
|
|
26748
|
-
"background": "linear-gradient(to right, rgb(
|
|
26756
|
+
"background": "linear-gradient(to right, rgb(255 255 255 / 1), rgb(255 255 255 / 1)) top left / auto auto,
|
|
26749
26757
|
conic-gradient(#666 0.25turn, #999 0.25turn 0.5turn, #666 0.5turn 0.75turn, #999 0.75turn) -5px 2px / 12px 12px
|
|
26750
26758
|
repeat",
|
|
26751
26759
|
"left": 1,
|
|
@@ -27173,9 +27181,9 @@ exports[`Storyshots f/fields/EditorInput Optional 1`] = `
|
|
|
27173
27181
|
className="rcp-saturation-cursor"
|
|
27174
27182
|
style={
|
|
27175
27183
|
{
|
|
27176
|
-
"backgroundColor": "rgb(
|
|
27184
|
+
"backgroundColor": "rgb(255 255 255)",
|
|
27177
27185
|
"left": 0,
|
|
27178
|
-
"top":
|
|
27186
|
+
"top": 0,
|
|
27179
27187
|
}
|
|
27180
27188
|
}
|
|
27181
27189
|
/>
|
|
@@ -27213,7 +27221,7 @@ exports[`Storyshots f/fields/EditorInput Optional 1`] = `
|
|
|
27213
27221
|
className="rcp-alpha"
|
|
27214
27222
|
style={
|
|
27215
27223
|
{
|
|
27216
|
-
"background": "linear-gradient(to right, rgb(
|
|
27224
|
+
"background": "linear-gradient(to right, rgb(255 255 255 / 0), rgb(255 255 255 / 1)) top left / auto auto,
|
|
27217
27225
|
conic-gradient(#666 0.25turn, #999 0.25turn 0.5turn, #666 0.5turn 0.75turn, #999 0.75turn) top left / 12px 12px
|
|
27218
27226
|
repeat",
|
|
27219
27227
|
}
|
|
@@ -27223,7 +27231,7 @@ exports[`Storyshots f/fields/EditorInput Optional 1`] = `
|
|
|
27223
27231
|
className="rcp-alpha-cursor"
|
|
27224
27232
|
style={
|
|
27225
27233
|
{
|
|
27226
|
-
"background": "linear-gradient(to right, rgb(
|
|
27234
|
+
"background": "linear-gradient(to right, rgb(255 255 255 / 1), rgb(255 255 255 / 1)) top left / auto auto,
|
|
27227
27235
|
conic-gradient(#666 0.25turn, #999 0.25turn 0.5turn, #666 0.5turn 0.75turn, #999 0.75turn) -5px 2px / 12px 12px
|
|
27228
27236
|
repeat",
|
|
27229
27237
|
"left": 1,
|
|
@@ -31252,6 +31260,7 @@ exports[`Storyshots g/ExpandableLexicalPreview Base 1`] = `
|
|
|
31252
31260
|
</p>
|
|
31253
31261
|
<div
|
|
31254
31262
|
className="base editor-input y-paragraph disabled"
|
|
31263
|
+
id="the-bad-ass-input"
|
|
31255
31264
|
style={
|
|
31256
31265
|
{
|
|
31257
31266
|
"--resize": "vertical",
|
|
@@ -31274,7 +31283,7 @@ exports[`Storyshots g/ExpandableLexicalPreview Base 1`] = `
|
|
|
31274
31283
|
/>
|
|
31275
31284
|
</div>
|
|
31276
31285
|
<button
|
|
31277
|
-
className="base button
|
|
31286
|
+
className="base button expand-button ai-icon x-background-far modifierCompact"
|
|
31278
31287
|
onClick={[Function]}
|
|
31279
31288
|
type="button"
|
|
31280
31289
|
>
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var React = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _html = require("@lexical/html");
|
|
9
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
|
-
var _exports = _interopRequireDefault(require("@pareto-engineering/bem/exports"));
|
|
11
|
-
var _b = require("../../../../b");
|
|
12
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
14
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
15
|
-
/* @pareto-engineering/generator-front 1.0.12 */
|
|
16
|
-
/* eslint-disable import/no-extraneous-dependencies -- required here */
|
|
17
|
-
|
|
18
|
-
// Local Definitions
|
|
19
|
-
|
|
20
|
-
const baseClassName = _exports.default.base;
|
|
21
|
-
const componentClassName = 'expand-button';
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* This is the component description.
|
|
25
|
-
*/
|
|
26
|
-
const ExpandButton = _ref => {
|
|
27
|
-
let {
|
|
28
|
-
id,
|
|
29
|
-
className: userClassName,
|
|
30
|
-
style,
|
|
31
|
-
onResolve,
|
|
32
|
-
title,
|
|
33
|
-
editorState
|
|
34
|
-
// ...otherProps
|
|
35
|
-
} = _ref;
|
|
36
|
-
return /*#__PURE__*/React.createElement(_b.Button, {
|
|
37
|
-
id: id,
|
|
38
|
-
className: [baseClassName, componentClassName, userClassName, 'ai-icon'].filter(e => e).join(' '),
|
|
39
|
-
style: style,
|
|
40
|
-
color: "background-far",
|
|
41
|
-
isCompact: true,
|
|
42
|
-
onClick: () => {
|
|
43
|
-
editorState.getEditorState().read(() => {
|
|
44
|
-
const rawHtml = (0, _html.$generateHtmlFromNodes)(editorState);
|
|
45
|
-
const preview = window.open('', '_blank', 'width=600,height=600');
|
|
46
|
-
preview.document.write(`<html>
|
|
47
|
-
<title>${title || 'Preview'}</title>
|
|
48
|
-
<style>
|
|
49
|
-
li:has(ol, ul) {
|
|
50
|
-
list-style-type: none;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
p,
|
|
54
|
-
span,
|
|
55
|
-
strong,
|
|
56
|
-
em,
|
|
57
|
-
li {
|
|
58
|
-
&.underlined {
|
|
59
|
-
text-decoration: underline;
|
|
60
|
-
|
|
61
|
-
&.strikethrough {
|
|
62
|
-
text-decoration: underline line-through;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
&.strikethrough {
|
|
67
|
-
text-decoration: line-through;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
&.italic {
|
|
71
|
-
font-style: italic;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
:first-child {
|
|
76
|
-
margin-top: 0;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
&::placeholder {
|
|
80
|
-
color: #abadb3;
|
|
81
|
-
}
|
|
82
|
-
</style>
|
|
83
|
-
<body>
|
|
84
|
-
<style></style>
|
|
85
|
-
${rawHtml}
|
|
86
|
-
<button onclick="window.close()">Close Preview</button>
|
|
87
|
-
</body></html>`);
|
|
88
|
-
});
|
|
89
|
-
onResolve();
|
|
90
|
-
}
|
|
91
|
-
}, "D");
|
|
92
|
-
};
|
|
93
|
-
ExpandButton.propTypes = {
|
|
94
|
-
/**
|
|
95
|
-
* The HTML id for this element
|
|
96
|
-
*/
|
|
97
|
-
id: _propTypes.default.string,
|
|
98
|
-
/**
|
|
99
|
-
* The HTML class names for this element
|
|
100
|
-
*/
|
|
101
|
-
className: _propTypes.default.string,
|
|
102
|
-
/**
|
|
103
|
-
* The React-written, css properties for this element.
|
|
104
|
-
*/
|
|
105
|
-
style: _propTypes.default.objectOf(_propTypes.default.string)
|
|
106
|
-
};
|
|
107
|
-
ExpandButton.defaultProps = {
|
|
108
|
-
// color: 'paragraph',
|
|
109
|
-
// resize: 'vertical',
|
|
110
|
-
};
|
|
111
|
-
var _default = exports.default = ExpandButton;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "ExpandButton", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return _ExpandButton.default;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
var _ExpandButton = _interopRequireDefault(require("./ExpandButton"));
|
|
13
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|