lupine.components 1.1.37 → 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 (
|
|
@@ -274,6 +274,16 @@ export const ToggleSwitch = (props: ToggleSwitchProps) => {
|
|
|
274
274
|
// bindGlobalStyle('toggle-switch-theme', cssTheme, false, true);
|
|
275
275
|
bindGlobalStyle('toggle-switch-component', css);
|
|
276
276
|
|
|
277
|
+
const cssTheme: CssProps = {
|
|
278
|
+
'[data-theme="light" i]': {
|
|
279
|
+
'--toggle-background-color': '#e6e6e6',
|
|
280
|
+
},
|
|
281
|
+
'[data-theme="dark" i]': {
|
|
282
|
+
'--toggle-background-color': '#232323',
|
|
283
|
+
},
|
|
284
|
+
};
|
|
285
|
+
bindGlobalStyle('toggle-switch-theme', cssTheme, false, true);
|
|
286
|
+
|
|
277
287
|
const cssSize: CssProps = {
|
|
278
288
|
'& .ts-on-text, & .ts-off-text': {
|
|
279
289
|
display: 'none',
|
package/src/demo/demo-about.tsx
CHANGED
|
@@ -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
|
|
package/tsconfig.json
CHANGED
|
@@ -31,15 +31,15 @@
|
|
|
31
31
|
|
|
32
32
|
/* Modules */
|
|
33
33
|
// "module": "commonjs", amd, es2015 /* Specify what module code is generated. */,
|
|
34
|
-
"module": "
|
|
34
|
+
"module": "esnext" /* Specify what module code is generated. */,
|
|
35
35
|
// "rootDir": "./" /* Specify the root folder within your source files. */,
|
|
36
|
-
"moduleResolution": "
|
|
36
|
+
"moduleResolution": "bundler" /* Specify how TypeScript looks up a file from a given module specifier. */,
|
|
37
37
|
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
|
|
38
38
|
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
|
|
39
39
|
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
|
|
40
40
|
// "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
|
|
41
41
|
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
|
|
42
|
-
"types": ["node"
|
|
42
|
+
"types": ["node"],
|
|
43
43
|
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
|
44
44
|
// "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
|
|
45
45
|
// "resolveJsonModule": true /* Enable importing .json files. */,
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
|
|
57
57
|
"sourceMap": true /* Create source map files for emitted JavaScript files. */,
|
|
58
58
|
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
|
|
59
|
-
"outFile": "./dist/build.js",
|
|
59
|
+
// "outFile": "./dist/build.js",
|
|
60
60
|
"outDir": "./dist" /* Specify an output folder for all emitted files. */,
|
|
61
61
|
// "removeComments": true, /* Disable emitting comments. */
|
|
62
62
|
// "noEmit": true, /* Disable emitting files from a compilation. */
|