mirror of
https://github.com/lowdefy/lowdefy.git
synced 2025-02-17 14:30:34 +08:00
fix(blockTools): Cleanup block tools.
This commit is contained in:
parent
b065493a59
commit
7ab732c48c
@ -1,35 +0,0 @@
|
||||
/*
|
||||
Copyright 2020-2021 Lowdefy, Inc
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
|
||||
const Examples = ({ title, examples, Component }) => (
|
||||
<div>
|
||||
<h1>{title}</h1>
|
||||
{examples.map((ex) => (
|
||||
<div key={ex.id}>
|
||||
<h4>
|
||||
{ex.type} {ex.description}
|
||||
</h4>
|
||||
<div style={{ ...{ padding: 20 }, ...ex.style }}>
|
||||
<Component {...ex} />
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
|
||||
export default Examples;
|
@ -1,22 +0,0 @@
|
||||
- id: default
|
||||
type: IconSpinner
|
||||
description: Default
|
||||
- id: sizedefault
|
||||
type: IconSpinner
|
||||
description: |
|
||||
Size: default
|
||||
properties:
|
||||
size: default
|
||||
- id: sizesmall
|
||||
type: IconSpinner
|
||||
description: |
|
||||
Size: small
|
||||
properties:
|
||||
size: small
|
||||
- id: sizelarge
|
||||
type: IconSpinner
|
||||
description: |
|
||||
Size: large
|
||||
properties:
|
||||
size: large
|
||||
|
@ -1,18 +0,0 @@
|
||||
- id: default
|
||||
type: Skeleton
|
||||
description: Default
|
||||
- id: sizedefault
|
||||
type: Skeleton
|
||||
style:
|
||||
height: 20
|
||||
description: |
|
||||
container height=20
|
||||
- id: sizesmall
|
||||
type: Skeleton
|
||||
style:
|
||||
height: 40
|
||||
width: 100
|
||||
description: |
|
||||
container height=20 width=100
|
||||
|
||||
|
@ -1,28 +0,0 @@
|
||||
- id: default
|
||||
type: SkeletonAvatar
|
||||
description: Default
|
||||
- id: sizedefault
|
||||
type: SkeletonAvatar
|
||||
description: |
|
||||
size: default
|
||||
properties:
|
||||
size: default
|
||||
- id: sizesmall
|
||||
type: SkeletonAvatar
|
||||
description: |
|
||||
size: small
|
||||
properties:
|
||||
size: small
|
||||
- id: sizelarge
|
||||
type: SkeletonAvatar
|
||||
description: |
|
||||
size: large
|
||||
properties:
|
||||
size: large
|
||||
- id: shapesquare
|
||||
type: SkeletonAvatar
|
||||
description: |
|
||||
shape: square
|
||||
properties:
|
||||
shape: square
|
||||
|
@ -1,28 +0,0 @@
|
||||
- id: default
|
||||
type: SkeletonButton
|
||||
description: Default
|
||||
- id: sizedefault
|
||||
type: SkeletonButton
|
||||
description: |
|
||||
Size: default
|
||||
properties:
|
||||
size: default
|
||||
- id: sizesmall
|
||||
type: SkeletonButton
|
||||
description: |
|
||||
Size: small
|
||||
properties:
|
||||
size: small
|
||||
- id: sizelarge
|
||||
type: SkeletonButton
|
||||
description: |
|
||||
Size: large
|
||||
properties:
|
||||
size: large
|
||||
- id: shaperound
|
||||
type: SkeletonButton
|
||||
description: |
|
||||
shape: round
|
||||
properties:
|
||||
shape: round
|
||||
|
@ -1,46 +0,0 @@
|
||||
- id: default
|
||||
type: SkeletonInput
|
||||
description: Default
|
||||
- id: sizedefault
|
||||
type: SkeletonInput
|
||||
description: |
|
||||
Size: default
|
||||
properties:
|
||||
size: default
|
||||
- id: sizesmall
|
||||
type: SkeletonInput
|
||||
description: |
|
||||
Size: small
|
||||
properties:
|
||||
size: small
|
||||
- id: sizelarge
|
||||
type: SkeletonInput
|
||||
description: |
|
||||
Size: large
|
||||
properties:
|
||||
size: large
|
||||
- id: labelfalse
|
||||
type: SkeletonInput
|
||||
description: |
|
||||
label: false
|
||||
properties:
|
||||
label: false
|
||||
- id: labelHeight40
|
||||
type: SkeletonInput
|
||||
description: |
|
||||
labelHeight: 40
|
||||
properties:
|
||||
labelHeight: 40
|
||||
- id: inputHeight80
|
||||
type: SkeletonInput
|
||||
description: |
|
||||
inputHeight: 80
|
||||
properties:
|
||||
inputHeight: 80
|
||||
- id: labelWidth80
|
||||
type: SkeletonInput
|
||||
description: |
|
||||
labelWidth: 80
|
||||
properties:
|
||||
labelWidth: 80
|
||||
|
@ -1,22 +0,0 @@
|
||||
- id: default
|
||||
type: SkeletonParagraph
|
||||
description: Default
|
||||
- id: lines1
|
||||
type: SkeletonParagraph
|
||||
description: |
|
||||
lines: 1
|
||||
properties:
|
||||
lines: 1
|
||||
- id: lines7
|
||||
type: SkeletonParagraph
|
||||
description: |
|
||||
lines: 7
|
||||
properties:
|
||||
lines: 7
|
||||
- id: width200
|
||||
type: SkeletonParagraph
|
||||
description: |
|
||||
width: 200
|
||||
properties:
|
||||
width: 200
|
||||
|
@ -1,22 +0,0 @@
|
||||
- id: default
|
||||
type: Spinner
|
||||
description: Default
|
||||
- id: height100
|
||||
type: Spinner
|
||||
description: |
|
||||
height: 100
|
||||
properties:
|
||||
height: 100
|
||||
- id: styleheight
|
||||
type: Spinner
|
||||
style:
|
||||
height: 500
|
||||
description: |
|
||||
style height: 500
|
||||
- id: shaded
|
||||
type: Spinner
|
||||
description: |
|
||||
shaded: true
|
||||
properties:
|
||||
shaded: true
|
||||
|
@ -1,76 +0,0 @@
|
||||
/*
|
||||
Copyright 2020-2021 Lowdefy, Inc
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { render } from 'react-dom';
|
||||
import IconSpinner from '../src/Spinner/IconSpinner';
|
||||
import Spinner from '../src/Spinner/Spinner';
|
||||
import Skeleton from '../src/Skeleton/Skeleton';
|
||||
import SkeletonAvatar from '../src/Skeleton/SkeletonAvatar';
|
||||
import SkeletonButton from '../src/Skeleton/SkeletonButton';
|
||||
import SkeletonInput from '../src/Skeleton/SkeletonInput';
|
||||
import SkeletonParagraph from '../src/Skeleton/SkeletonParagraph';
|
||||
import makeCssClass from '../src/makeCssClass';
|
||||
import ErrorBoundary from '../src/ErrorBoundary';
|
||||
import IconSpinnerEx from './examples/IconSpinner.yaml';
|
||||
import SkeletonEx from './examples/Skeleton.yaml';
|
||||
import SkeletonAvatarEx from './examples/SkeletonAvatar.yaml';
|
||||
import SkeletonButtonEx from './examples/SkeletonButton.yaml';
|
||||
import SkeletonInputEx from './examples/SkeletonInput.yaml';
|
||||
import SkeletonParagraphEx from './examples/SkeletonParagraph.yaml';
|
||||
import SpinnerEx from './examples/Spinner.yaml';
|
||||
import Examples from './Examples';
|
||||
|
||||
const ErrorComp = () => <div>{this.unknown}</div>;
|
||||
const FallbackComp = ({ name, error }) => (
|
||||
<div>
|
||||
{name} {error.message}
|
||||
</div>
|
||||
);
|
||||
const Demo = () => (
|
||||
<div id="page">
|
||||
<h4>ErrorBoundary with fullPage=true :</h4>
|
||||
<ErrorBoundary fullPage>
|
||||
<ErrorComp />
|
||||
</ErrorBoundary>
|
||||
<h4>ErrorBoundary with fullPage=false :</h4>
|
||||
<ErrorBoundary>
|
||||
<ErrorComp />
|
||||
</ErrorBoundary>
|
||||
<h4>ErrorBoundary with fallback :</h4>
|
||||
<ErrorBoundary fallback={(error) => <FallbackComp name="Fallback test" error={error} />}>
|
||||
<ErrorComp />
|
||||
</ErrorBoundary>
|
||||
<div id="emotion" />
|
||||
<h4>{"makeCssClass({ color: 'red' })"} :</h4>
|
||||
<div className={makeCssClass({ color: 'red' })}>Red text</div>
|
||||
<Examples Component={IconSpinner} examples={IconSpinnerEx} title={'IconSpinner'} />
|
||||
<Examples Component={Skeleton} examples={SkeletonEx} title={'Skeleton'} />
|
||||
<Examples Component={Spinner} examples={SpinnerEx} title={'Spinner'} />
|
||||
<Examples Component={SkeletonAvatar} examples={SkeletonAvatarEx} title={'SkeletonAvatar'} />
|
||||
<Examples Component={SkeletonButton} examples={SkeletonButtonEx} title={'SkeletonButton'} />
|
||||
<Examples Component={SkeletonInput} examples={SkeletonInputEx} title={'SkeletonInput'} />
|
||||
<Examples
|
||||
Component={SkeletonParagraph}
|
||||
examples={SkeletonParagraphEx}
|
||||
title={'SkeletonParagraph'}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
|
||||
export default Demo;
|
||||
|
||||
render(<Demo />, document.querySelector('#root'));
|
@ -17,23 +17,15 @@
|
||||
import blockDefaultProps from './blockDefaultProps';
|
||||
import ErrorBoundary from './ErrorBoundary';
|
||||
import HtmlComponent from './HtmlComponent';
|
||||
import Loading from './Loading';
|
||||
import loadWebpackFederatedModule from './loadWebpackFederatedModule';
|
||||
import makeCssClass from './makeCssClass.js';
|
||||
import mediaToCssObject from './mediaToCssObject.js';
|
||||
import renderHtml from './renderHtml';
|
||||
import useDynamicScript from './useDynamicScript';
|
||||
import useRunAfterUpdate from './useRunAfterUpdate';
|
||||
|
||||
export {
|
||||
blockDefaultProps,
|
||||
ErrorBoundary,
|
||||
HtmlComponent,
|
||||
Loading,
|
||||
loadWebpackFederatedModule,
|
||||
makeCssClass,
|
||||
mediaToCssObject,
|
||||
renderHtml,
|
||||
useDynamicScript,
|
||||
useRunAfterUpdate,
|
||||
};
|
||||
|
@ -1 +0,0 @@
|
||||
module.exports = {};
|
Loading…
Reference in New Issue
Block a user