@pushwoosh/dumb-components 1.0.4 → 1.0.5
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/Drawer/components/Drawer/index.d.ts +1 -0
- package/Drawer/components/Drawer/index.js +1 -0
- package/Drawer/{styles.js → components/Drawer/styles.js} +4 -4
- package/Drawer/components/DrawerContent/index.d.ts +1 -0
- package/Drawer/components/DrawerContent/index.js +1 -0
- package/Drawer/components/DrawerContent/styles.d.ts +3 -0
- package/Drawer/components/DrawerContent/styles.js +14 -0
- package/Drawer/components/DrawerDocs/DrawerDocs.d.ts +3 -0
- package/Drawer/components/DrawerDocs/DrawerDocs.js +45 -0
- package/Drawer/components/DrawerDocs/hooks.d.ts +5 -0
- package/Drawer/components/DrawerDocs/hooks.js +15 -0
- package/Drawer/components/DrawerDocs/index.d.ts +2 -0
- package/Drawer/components/DrawerDocs/index.js +2 -0
- package/Drawer/components/DrawerDocs/styles.d.ts +5 -0
- package/Drawer/components/DrawerDocs/styles.js +16 -0
- package/Drawer/components/DrawerDocs/types.d.ts +5 -0
- package/Drawer/components/DrawerDocs/types.js +1 -0
- package/Drawer/index.d.ts +3 -1
- package/Drawer/index.js +3 -1
- package/EmailTemplatePreview/components/NoEmailTemplatePreview/NoEmailTemplatePreview.js +2 -5
- package/Spinner/Spinner.js +3 -6
- package/Spinner/assets/spinner.medium.svg +1 -1
- package/Spinner/assets/spinner.small.svg +1 -1
- package/index.d.ts +2 -0
- package/index.js +2 -0
- package/package.json +2 -1
- /package/Drawer/{Drawer.d.ts → components/Drawer/Drawer.d.ts} +0 -0
- /package/Drawer/{Drawer.js → components/Drawer/Drawer.js} +0 -0
- /package/Drawer/{maps.d.ts → components/Drawer/maps.d.ts} +0 -0
- /package/Drawer/{maps.js → components/Drawer/maps.js} +0 -0
- /package/Drawer/{styles.d.ts → components/Drawer/styles.d.ts} +0 -0
- /package/Drawer/{types.d.ts → components/Drawer/types.d.ts} +0 -0
- /package/Drawer/{types.js → components/Drawer/types.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Drawer } from './Drawer';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Drawer } from './Drawer';
|
|
@@ -5,13 +5,13 @@ const animationTimeout = 300;
|
|
|
5
5
|
export const LockBody = createGlobalStyle(["body{overflow:hidden;position:relative;height:100%;}"]);
|
|
6
6
|
export const DrawerBox = styled.div.withConfig({
|
|
7
7
|
displayName: "DrawerBox",
|
|
8
|
-
componentId: "sc-
|
|
8
|
+
componentId: "sc-n2uxwd-0"
|
|
9
9
|
})(["position:fixed;top:0;left:0;width:100vw;height:100vh;pointer-events:all;z-index:", ";"], ({
|
|
10
10
|
$zIndex
|
|
11
11
|
}) => $zIndex);
|
|
12
12
|
export const DrawerInner = styled.div.withConfig({
|
|
13
13
|
displayName: "DrawerInner",
|
|
14
|
-
componentId: "sc-
|
|
14
|
+
componentId: "sc-n2uxwd-1"
|
|
15
15
|
})(["display:flex;justify-content:flex-end;width:100vw;height:100vh;padding:0 0 0 280px;"]);
|
|
16
16
|
const DrawerBoxBase = props => {
|
|
17
17
|
const {
|
|
@@ -31,7 +31,7 @@ const DrawerBoxBase = props => {
|
|
|
31
31
|
};
|
|
32
32
|
export const DrawerBoxTrans = styled(DrawerBoxBase).withConfig({
|
|
33
33
|
displayName: "DrawerBoxTrans",
|
|
34
|
-
componentId: "sc-
|
|
34
|
+
componentId: "sc-n2uxwd-2"
|
|
35
35
|
})(["&-appear{background-color:", ";transition:background-color ", "ms;", "{opacity:0;transform:translateX(100%);}}&-appear-active{background-color:", ";", "{opacity:0.99;transform:translateX(.1%);transition:opacity ", "ms,transform ", "ms;}}&-appear-done{background-color:", ";", "{opacity:1;transform:translateX(0);}}&-enter{background-color:", ";transition:background-color ", "ms;", "{opacity:0;transform:translateX(100%);}}&-enter-active{background-color:", ";", "{opacity:0.99;transform:translateX(.1%);transition:opacity ", "ms,transform ", "ms;}}&-enter-done{background-color:", ";", "{opacity:1;transform:translateX(0);}}&-exit{background-color:", ";", "{opacity:1;transform:translateX(0);transition:opacity ", "ms,transform ", "ms;}}&-exit-active{transition:background-color ", "ms;background-color:", ";", "{opacity:0;transform:translateX(100%);}}"], ({
|
|
36
36
|
withoutLockScreen = false
|
|
37
37
|
}) => withoutLockScreen ? 'transparent' : 'rgb(0 0 0 / 0%)', animationTimeout, DrawerInner, ({
|
|
@@ -51,7 +51,7 @@ export const DrawerBoxTrans = styled(DrawerBoxBase).withConfig({
|
|
|
51
51
|
}) => withoutLockScreen ? 'transparent' : 'rgb(0 0 0 / 0%)', DrawerInner);
|
|
52
52
|
export const DrawerContainer = styled.div.withConfig({
|
|
53
53
|
displayName: "DrawerContainer",
|
|
54
|
-
componentId: "sc-
|
|
54
|
+
componentId: "sc-n2uxwd-3"
|
|
55
55
|
})(["position:relative;display:inline-flex;flex-direction:column;align-items:stretch;justify-content:flex-start;width:", ";height:100vh;z-index:10;box-shadow:0 10px 16px 0 rgba(27,31,36,0.1);"], ({
|
|
56
56
|
$width
|
|
57
57
|
}) => $width);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DrawerHeader, DrawerTitle, DrawerBody } from './styles';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DrawerHeader, DrawerTitle, DrawerBody } from './styles';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const DrawerHeader: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
|
+
export declare const DrawerTitle: import("styled-components").StyledComponent<"h2", any, {}, never>;
|
|
3
|
+
export declare const DrawerBody: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import { Color, Spacing, FontSize, FontWeight, LineHeight } from '@pushwoosh/kit-constants';
|
|
3
|
+
export const DrawerHeader = styled.div.withConfig({
|
|
4
|
+
displayName: "DrawerHeader",
|
|
5
|
+
componentId: "sc-1jmui00-0"
|
|
6
|
+
})(["padding:", " ", " ", ";background:", ";"], Spacing.S11, Spacing.S11, Spacing.S3, Color.CLEAR);
|
|
7
|
+
export const DrawerTitle = styled.h2.withConfig({
|
|
8
|
+
displayName: "DrawerTitle",
|
|
9
|
+
componentId: "sc-1jmui00-1"
|
|
10
|
+
})(["display:flex;flex-wrap:nowrap;align-items:center;justify-content:space-between;font-size:", ";font-weight:", ";line-height:", ";letter-spacing:0;margin:0;"], FontSize.HEADING2, FontWeight.BOLD, LineHeight.HEADING2);
|
|
11
|
+
export const DrawerBody = styled.div.withConfig({
|
|
12
|
+
displayName: "DrawerBody",
|
|
13
|
+
componentId: "sc-1jmui00-2"
|
|
14
|
+
})(["flex:1;padding:0 ", " ", ";background:", ";overflow-y:auto;"], Spacing.S11, Spacing.S11, Color.CLEAR);
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
2
|
+
import { Spinner } from '../../../Spinner';
|
|
3
|
+
import { Drawer } from '../Drawer';
|
|
4
|
+
import { DrawerBodyIframe, IframeElement, LoadingBox } from './styles';
|
|
5
|
+
export function DrawerDocs(props) {
|
|
6
|
+
const {
|
|
7
|
+
isOpen,
|
|
8
|
+
url,
|
|
9
|
+
onClose
|
|
10
|
+
} = props;
|
|
11
|
+
const [drawerWidth, setDrawerWidth] = useState(0);
|
|
12
|
+
const [iframeLoaded, setIframeLoaded] = useState(false);
|
|
13
|
+
const drawerDocsRef = useRef(null);
|
|
14
|
+
const iframeRef = useRef(null);
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
const updateDrawerWidth = () => {
|
|
17
|
+
var _drawerDocsRef$curren;
|
|
18
|
+
if ((_drawerDocsRef$curren = drawerDocsRef.current) !== null && _drawerDocsRef$curren !== void 0 && _drawerDocsRef$curren.parentElement) {
|
|
19
|
+
setDrawerWidth(drawerDocsRef.current.parentElement.getBoundingClientRect().width);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
updateDrawerWidth();
|
|
23
|
+
window.addEventListener('resize', updateDrawerWidth);
|
|
24
|
+
return () => {
|
|
25
|
+
window.removeEventListener('resize', updateDrawerWidth);
|
|
26
|
+
};
|
|
27
|
+
}, [isOpen]);
|
|
28
|
+
return React.createElement(Drawer, {
|
|
29
|
+
size: "large",
|
|
30
|
+
isOpen: isOpen,
|
|
31
|
+
onClose: onClose
|
|
32
|
+
}, React.createElement(DrawerBodyIframe, {
|
|
33
|
+
ref: drawerDocsRef
|
|
34
|
+
}, !iframeLoaded && React.createElement(LoadingBox, null, React.createElement(Spinner, {
|
|
35
|
+
size: "medium"
|
|
36
|
+
}), ' ', "Loading..."), React.createElement(IframeElement, {
|
|
37
|
+
src: url,
|
|
38
|
+
ref: iframeRef,
|
|
39
|
+
title: "Pushwoosh docs",
|
|
40
|
+
width: drawerWidth,
|
|
41
|
+
height: "95%",
|
|
42
|
+
"$isLoaded": iframeLoaded,
|
|
43
|
+
onLoad: () => setIframeLoaded(true)
|
|
44
|
+
})));
|
|
45
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { useCallback, useState } from 'react';
|
|
2
|
+
export const useDocs = () => {
|
|
3
|
+
const [docsOpen, setDocsOpen] = useState(false);
|
|
4
|
+
const openDocsDrawer = useCallback(() => {
|
|
5
|
+
setDocsOpen(true);
|
|
6
|
+
}, []);
|
|
7
|
+
const closeDocsDrawer = useCallback(() => {
|
|
8
|
+
setDocsOpen(false);
|
|
9
|
+
}, []);
|
|
10
|
+
return {
|
|
11
|
+
docsOpen,
|
|
12
|
+
openDocsDrawer,
|
|
13
|
+
closeDocsDrawer
|
|
14
|
+
};
|
|
15
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const DrawerBodyIframe: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
|
+
export declare const LoadingBox: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
|
+
export declare const IframeElement: import("styled-components").StyledComponent<"iframe", any, {
|
|
4
|
+
$isLoaded: boolean;
|
|
5
|
+
}, never>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import { DrawerBody } from '../DrawerContent';
|
|
3
|
+
export const DrawerBodyIframe = styled(DrawerBody).withConfig({
|
|
4
|
+
displayName: "DrawerBodyIframe",
|
|
5
|
+
componentId: "sc-m4omzd-0"
|
|
6
|
+
})(["padding:0;iframe > header{display:none;}"]);
|
|
7
|
+
export const LoadingBox = styled.div.withConfig({
|
|
8
|
+
displayName: "LoadingBox",
|
|
9
|
+
componentId: "sc-m4omzd-1"
|
|
10
|
+
})(["display:flex;flex-direction:column;gap:16px;justify-content:center;align-items:center;height:100%;"]);
|
|
11
|
+
export const IframeElement = styled.iframe.withConfig({
|
|
12
|
+
displayName: "IframeElement",
|
|
13
|
+
componentId: "sc-m4omzd-2"
|
|
14
|
+
})(["display:", ";border:none;"], ({
|
|
15
|
+
$isLoaded
|
|
16
|
+
}) => $isLoaded ? 'block' : 'none');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/Drawer/index.d.ts
CHANGED
package/Drawer/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Spacing } from '@pushwoosh/kit-constants';
|
|
3
3
|
import { Vertical } from '@pushwoosh/kit-helpers';
|
|
4
|
-
import
|
|
4
|
+
import PwLogo from './assets/PW_logo.svg';
|
|
5
5
|
import { Container, PreviewMock } from './styles';
|
|
6
6
|
import { LockedText, LockedTitle } from '../../../common';
|
|
7
7
|
export function NoEmailTemplatePreview() {
|
|
@@ -11,10 +11,7 @@ export function NoEmailTemplatePreview() {
|
|
|
11
11
|
}, React.createElement(PreviewMock, {
|
|
12
12
|
"$alignItems": "center",
|
|
13
13
|
"$justifyContent": "center"
|
|
14
|
-
}, React.createElement("
|
|
15
|
-
src: pwLogo,
|
|
16
|
-
alt: "Application logo"
|
|
17
|
-
})), React.createElement(Vertical, null, React.createElement(LockedTitle, null, "Content missed..."), React.createElement(LockedText, {
|
|
14
|
+
}, React.createElement(PwLogo, null)), React.createElement(Vertical, null, React.createElement(LockedTitle, null, "Content missed..."), React.createElement(LockedText, {
|
|
18
15
|
"$small": true
|
|
19
16
|
}, "Might be old data or deleted presets")));
|
|
20
17
|
}
|
package/Spinner/Spinner.js
CHANGED
|
@@ -7,8 +7,8 @@ export function Spinner(props) {
|
|
|
7
7
|
size,
|
|
8
8
|
...rest
|
|
9
9
|
} = props;
|
|
10
|
-
const
|
|
11
|
-
if (!
|
|
10
|
+
const Icon = AssetsMap[size];
|
|
11
|
+
if (!Icon) {
|
|
12
12
|
console.error(`[Spinner]: incorrect size: ${size}!`);
|
|
13
13
|
return null;
|
|
14
14
|
}
|
|
@@ -16,8 +16,5 @@ export function Spinner(props) {
|
|
|
16
16
|
...rest,
|
|
17
17
|
size: size,
|
|
18
18
|
ref: boxRef
|
|
19
|
-
}, React.createElement(SpinnerAnimate, null, React.createElement(
|
|
20
|
-
src: icon,
|
|
21
|
-
alt: `${size} spinner`
|
|
22
|
-
})));
|
|
19
|
+
}, React.createElement(SpinnerAnimate, null, React.createElement(Icon, null)));
|
|
23
20
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none"><circle cx="12" cy="12" r="7" stroke="
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none"><circle cx="12" cy="12" r="7" stroke="currentColor" stroke-width="3" opacity=".2"/><path stroke="currentColor" stroke-linecap="round" stroke-width="3" d="M19 12a7 7 0 0 0-7-7"/></svg>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none"><circle cx="8" cy="8" r="5" stroke="
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none"><circle cx="8" cy="8" r="5" stroke="currentColor" stroke-width="2" opacity=".2"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M13 8a5 5 0 0 0-5-5"/></svg>
|
package/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export { Banner, type BannerType } from './Banner';
|
|
|
4
4
|
export { Button, GhostButton } from './Button';
|
|
5
5
|
export { CardMetric } from './CardMetric';
|
|
6
6
|
export { Checkbox } from './Checkbox';
|
|
7
|
+
export { Drawer, DrawerHeader, DrawerTitle, DrawerBody, DrawerDocs, useDocs, } from './Drawer';
|
|
7
8
|
export { DropdownMenu, DropdownMenuProvider, useDropdownMenuContext, DropdownMenuContainer, DropdownMenuGroup, DropdownMenuItem, DropdownMenuItemBox, DropdownMenuItemCheckbox, DropdownMenuItemPick, DropdownMenuItemRadio, DropdownMenuNested, DropdownMenuWindow, } from './DropdownMenu';
|
|
8
9
|
export { EditableField } from './EditableField';
|
|
9
10
|
export { InputFile } from './InputFile';
|
|
@@ -16,6 +17,7 @@ export { ReCaptcha, useRecaptcha, asyncScriptLoad } from './ReCaptcha';
|
|
|
16
17
|
export { Spinner } from './Spinner';
|
|
17
18
|
export { SortButton } from './SortButton';
|
|
18
19
|
export { Switch } from './Switch';
|
|
20
|
+
export { TextSkeleton, RectangularSkeleton, CircularSkeleton } from './Skeleton';
|
|
19
21
|
export { Tooltip, type TooltipPosition } from './Tooltip';
|
|
20
22
|
export { Tab, TabBar, TabPanel, Tabs, type TabCode } from './Tabs';
|
|
21
23
|
export { Link } from './Link';
|
package/index.js
CHANGED
|
@@ -4,6 +4,7 @@ export { Banner } from './Banner';
|
|
|
4
4
|
export { Button, GhostButton } from './Button';
|
|
5
5
|
export { CardMetric } from './CardMetric';
|
|
6
6
|
export { Checkbox } from './Checkbox';
|
|
7
|
+
export { Drawer, DrawerHeader, DrawerTitle, DrawerBody, DrawerDocs, useDocs } from './Drawer';
|
|
7
8
|
export { DropdownMenu, DropdownMenuProvider, useDropdownMenuContext, DropdownMenuContainer, DropdownMenuGroup, DropdownMenuItem, DropdownMenuItemBox, DropdownMenuItemCheckbox, DropdownMenuItemPick, DropdownMenuItemRadio, DropdownMenuNested, DropdownMenuWindow } from './DropdownMenu';
|
|
8
9
|
export { EditableField } from './EditableField';
|
|
9
10
|
export { InputFile } from './InputFile';
|
|
@@ -16,6 +17,7 @@ export { ReCaptcha, useRecaptcha, asyncScriptLoad } from './ReCaptcha';
|
|
|
16
17
|
export { Spinner } from './Spinner';
|
|
17
18
|
export { SortButton } from './SortButton';
|
|
18
19
|
export { Switch } from './Switch';
|
|
20
|
+
export { TextSkeleton, RectangularSkeleton, CircularSkeleton } from './Skeleton';
|
|
19
21
|
export { Tooltip } from './Tooltip';
|
|
20
22
|
export { Tab, TabBar, TabPanel, Tabs } from './Tabs';
|
|
21
23
|
export { Link } from './Link';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pushwoosh/dumb-components",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "React components to build Pushwoosh products",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.js",
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@pushwoosh/frontend-builder-engine": "^1.0.12",
|
|
20
20
|
"@pushwoosh/kit-constants": "^1.6.7",
|
|
21
|
+
"@svgr/webpack": "^8.1.0",
|
|
21
22
|
"@types/lodash": "^4.17.13",
|
|
22
23
|
"@types/react": "^18.2.69",
|
|
23
24
|
"@types/react-dom": "^18.2.22",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|