lupine.components 1.1.38 → 1.1.39
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/package.json
CHANGED
|
@@ -2,7 +2,7 @@ import { CssProps, RefProps } from 'lupine.web';
|
|
|
2
2
|
import { DemoStory } from '../../demo/demo-types';
|
|
3
3
|
import { IEditor } from './i-editor';
|
|
4
4
|
|
|
5
|
-
export const IEditorDemoPage = () => {
|
|
5
|
+
export const IEditorDemoPage = (props: { css?: CssProps }) => {
|
|
6
6
|
let editor: IEditor | undefined;
|
|
7
7
|
|
|
8
8
|
const ref: RefProps = {
|
|
@@ -42,6 +42,7 @@ export const IEditorDemoPage = () => {
|
|
|
42
42
|
width: '100%',
|
|
43
43
|
height: '100%',
|
|
44
44
|
},
|
|
45
|
+
...props.css,
|
|
45
46
|
};
|
|
46
47
|
|
|
47
48
|
return (
|
|
@@ -22,6 +22,7 @@ export interface ResponsiveFrameProps {
|
|
|
22
22
|
maxWidth?: string;
|
|
23
23
|
autoExtendSidemenu?: boolean;
|
|
24
24
|
onLoad?: () => Promise<void>;
|
|
25
|
+
noSafeAreaTop?: boolean;
|
|
25
26
|
}
|
|
26
27
|
export const ResponsiveFrame = (props: ResponsiveFrameProps) => {
|
|
27
28
|
const cssContainer: CssProps = {
|
|
@@ -35,8 +36,10 @@ export const ResponsiveFrame = (props: ResponsiveFrameProps) => {
|
|
|
35
36
|
borderLeft: props.maxWidth ? '1px solid var(--primary-border-color)' : 'none',
|
|
36
37
|
margin: '0 auto',
|
|
37
38
|
overflowX: 'hidden',
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
...(!props.noSafeAreaTop ? {
|
|
40
|
+
'padding-top ': 'constant(safe-area-inset-top)',
|
|
41
|
+
'padding-top': 'env(safe-area-inset-top)',
|
|
42
|
+
} : {}),
|
|
40
43
|
'.frame-top-menu': {
|
|
41
44
|
display: 'flex',
|
|
42
45
|
flexDirection: 'column',
|
package/src/frames/top-frame.tsx
CHANGED
|
@@ -3,7 +3,16 @@ place to set safe-area-inset-top and other common styles
|
|
|
3
3
|
*/
|
|
4
4
|
import { VNode, CssProps } from 'lupine.components';
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// TopFrame and ResponsiveFrame both contain safe-area-inset-top, so can't use them togother
|
|
7
|
+
export const TopFrame = async ({
|
|
8
|
+
placeholderClassname,
|
|
9
|
+
vnode,
|
|
10
|
+
noSafeAreaTop,
|
|
11
|
+
}: {
|
|
12
|
+
placeholderClassname: string;
|
|
13
|
+
vnode: VNode<any>;
|
|
14
|
+
noSafeAreaTop?: boolean;
|
|
15
|
+
}) => {
|
|
7
16
|
const cssContainer: CssProps = {
|
|
8
17
|
display: 'flex',
|
|
9
18
|
flexDirection: 'column',
|
|
@@ -16,8 +25,12 @@ export const TopFrame = async (placeholderClassname: string, vnode: VNode<any>)
|
|
|
16
25
|
flexDirection: 'column',
|
|
17
26
|
height: '100%',
|
|
18
27
|
// trick: to put two padding-top properties
|
|
19
|
-
|
|
20
|
-
|
|
28
|
+
...(!noSafeAreaTop
|
|
29
|
+
? {
|
|
30
|
+
'padding-top ': 'constant(safe-area-inset-top)',
|
|
31
|
+
'padding-top': 'env(safe-area-inset-top)',
|
|
32
|
+
}
|
|
33
|
+
: {}),
|
|
21
34
|
},
|
|
22
35
|
};
|
|
23
36
|
|