@draftbit/core 46.8.2-088bf8.2 → 46.8.2-5a685f.2
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/lib/commonjs/components/RadioButton/context.js +1 -1
- package/lib/commonjs/components/Shadow.js +46 -0
- package/lib/commonjs/components/ToggleButton.js +2 -15
- package/lib/commonjs/hooks.js +2 -1
- package/lib/commonjs/index.js +7 -0
- package/lib/commonjs/mappings/Shadow.js +102 -0
- package/lib/module/components/Picker/PickerComponent.android.js +11 -8
- package/lib/module/components/Shadow.js +38 -0
- package/lib/module/index.js +1 -0
- package/lib/module/mappings/Shadow.js +95 -0
- package/lib/typescript/src/components/Shadow.d.ts +24 -0
- package/lib/typescript/src/components/Shadow.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/mappings/Shadow.d.ts +173 -0
- package/lib/typescript/src/mappings/Shadow.d.ts.map +1 -0
- package/package.json +4 -4
- package/src/components/Shadow.js +16 -0
- package/src/components/Shadow.tsx +62 -0
- package/src/index.js +1 -0
- package/src/index.tsx +2 -0
- package/src/mappings/Shadow.js +95 -0
- package/src/mappings/Shadow.ts +104 -0
- package/lib/commonjs/mappings/HtmlElements.js +0 -177
- package/lib/module/mappings/HtmlElements.js +0 -170
- package/lib/typescript/src/mappings/HtmlElements.d.ts +0 -77
- package/lib/typescript/src/mappings/HtmlElements.d.ts.map +0 -1
- package/src/mappings/HtmlElements.js +0 -193
- package/src/mappings/HtmlElements.ts +0 -207
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@draftbit/core",
|
|
3
|
-
"version": "46.8.2-
|
|
3
|
+
"version": "46.8.2-5a685f.2+5a685f6",
|
|
4
4
|
"description": "Core (non-native) Components",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -41,8 +41,7 @@
|
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@date-io/date-fns": "^1.3.13",
|
|
43
43
|
"@draftbit/react-theme-provider": "^2.1.1",
|
|
44
|
-
"@draftbit/types": "^46.8.2-
|
|
45
|
-
"@expo/html-elements": "^0.3.1",
|
|
44
|
+
"@draftbit/types": "^46.8.2-5a685f.2+5a685f6",
|
|
46
45
|
"@material-ui/core": "^4.11.0",
|
|
47
46
|
"@material-ui/pickers": "^3.2.10",
|
|
48
47
|
"@react-native-community/slider": "4.2.3",
|
|
@@ -56,6 +55,7 @@
|
|
|
56
55
|
"lodash.tonumber": "^4.0.3",
|
|
57
56
|
"react-native-deck-swiper": "^2.0.12",
|
|
58
57
|
"react-native-modal-datetime-picker": "^13.0.0",
|
|
58
|
+
"react-native-shadow-2": "^7.0.6",
|
|
59
59
|
"react-native-svg": "12.3.0",
|
|
60
60
|
"react-native-typography": "^1.4.1",
|
|
61
61
|
"react-native-web-swiper": "^2.2.3"
|
|
@@ -93,5 +93,5 @@
|
|
|
93
93
|
]
|
|
94
94
|
]
|
|
95
95
|
},
|
|
96
|
-
"gitHead": "
|
|
96
|
+
"gitHead": "5a685f677cf98b9a6e9031e3dd9eba1ba6aecf1a"
|
|
97
97
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Shadow as ShadowComponent } from "react-native-shadow-2";
|
|
3
|
+
const Shadow = ({ offsetX = 0, offsetY = 0, showShadowSideStart = true, showShadowSideEnd = true, showShadowSideTop = true, showShadowSideBottom = true, showShadowCornerTopStart = true, showShadowCornerTopEnd = true, showShadowCornerBottomStart = true, showShadowCornerBottomEnd = true, paintInside = false, style, ...rest }) => {
|
|
4
|
+
return (React.createElement(ShadowComponent, { offset: [offsetX, offsetY], sides: {
|
|
5
|
+
start: showShadowSideStart,
|
|
6
|
+
end: showShadowSideEnd,
|
|
7
|
+
top: showShadowSideTop,
|
|
8
|
+
bottom: showShadowSideBottom,
|
|
9
|
+
}, corners: {
|
|
10
|
+
topStart: showShadowCornerTopStart,
|
|
11
|
+
topEnd: showShadowCornerTopEnd,
|
|
12
|
+
bottomStart: showShadowCornerBottomStart,
|
|
13
|
+
bottomEnd: showShadowCornerBottomEnd,
|
|
14
|
+
}, containerStyle: style, paintInside: paintInside, ...rest }));
|
|
15
|
+
};
|
|
16
|
+
export default Shadow;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { StyleProp, ViewStyle } from "react-native";
|
|
3
|
+
import { Shadow as ShadowComponent } from "react-native-shadow-2";
|
|
4
|
+
|
|
5
|
+
interface ShadowProps {
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
startColor?: string;
|
|
8
|
+
endColor?: string;
|
|
9
|
+
distance?: number;
|
|
10
|
+
paintInside?: boolean;
|
|
11
|
+
stretch?: boolean;
|
|
12
|
+
offsetX?: number;
|
|
13
|
+
offsetY?: number;
|
|
14
|
+
showShadowSideStart?: boolean;
|
|
15
|
+
showShadowSideEnd?: boolean;
|
|
16
|
+
showShadowSideTop?: boolean;
|
|
17
|
+
showShadowSideBottom?: boolean;
|
|
18
|
+
showShadowCornerTopStart?: boolean;
|
|
19
|
+
showShadowCornerTopEnd?: boolean;
|
|
20
|
+
showShadowCornerBottomStart?: boolean;
|
|
21
|
+
showShadowCornerBottomEnd?: boolean;
|
|
22
|
+
style?: StyleProp<ViewStyle>;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const Shadow: React.FC<React.PropsWithChildren<ShadowProps>> = ({
|
|
26
|
+
offsetX = 0,
|
|
27
|
+
offsetY = 0,
|
|
28
|
+
showShadowSideStart = true,
|
|
29
|
+
showShadowSideEnd = true,
|
|
30
|
+
showShadowSideTop = true,
|
|
31
|
+
showShadowSideBottom = true,
|
|
32
|
+
showShadowCornerTopStart = true,
|
|
33
|
+
showShadowCornerTopEnd = true,
|
|
34
|
+
showShadowCornerBottomStart = true,
|
|
35
|
+
showShadowCornerBottomEnd = true,
|
|
36
|
+
paintInside = false,
|
|
37
|
+
style,
|
|
38
|
+
...rest
|
|
39
|
+
}) => {
|
|
40
|
+
return (
|
|
41
|
+
<ShadowComponent
|
|
42
|
+
offset={[offsetX, offsetY]}
|
|
43
|
+
sides={{
|
|
44
|
+
start: showShadowSideStart,
|
|
45
|
+
end: showShadowSideEnd,
|
|
46
|
+
top: showShadowSideTop,
|
|
47
|
+
bottom: showShadowSideBottom,
|
|
48
|
+
}}
|
|
49
|
+
corners={{
|
|
50
|
+
topStart: showShadowCornerTopStart,
|
|
51
|
+
topEnd: showShadowCornerTopEnd,
|
|
52
|
+
bottomStart: showShadowCornerBottomStart,
|
|
53
|
+
bottomEnd: showShadowCornerBottomEnd,
|
|
54
|
+
}}
|
|
55
|
+
containerStyle={style}
|
|
56
|
+
paintInside={paintInside}
|
|
57
|
+
{...rest}
|
|
58
|
+
/>
|
|
59
|
+
);
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export default Shadow;
|
package/src/index.js
CHANGED
|
@@ -31,6 +31,7 @@ export { ActionSheet, ActionSheetItem, ActionSheetCancel, } from "./components/A
|
|
|
31
31
|
export { Swiper, SwiperItem } from "./components/Swiper";
|
|
32
32
|
export { Center, Circle, Square, Row, Stack, Spacer, } from "./components/Layout";
|
|
33
33
|
export { RadioButton, RadioButtonGroup, RadioButtonRow, RadioButtonFieldGroup, } from "./components/RadioButton/index";
|
|
34
|
+
export { default as Shadow } from "./components/Shadow";
|
|
34
35
|
export { DeckSwiper, DeckSwiperCard } from "./components/DeckSwiper";
|
|
35
36
|
/* Deprecated: Fix or Delete! */
|
|
36
37
|
export { default as DatePicker } from "./components/DatePicker/DatePicker";
|
package/src/index.tsx
CHANGED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { COMPONENT_TYPES, CONTAINER_COMPONENT_STYLES_SECTIONS, createColorProp, createStaticNumberProp, createStaticBoolProp, createDisabledProp, GROUPS, } from "@draftbit/types";
|
|
2
|
+
export const SEED_DATA = {
|
|
3
|
+
name: "Shadow",
|
|
4
|
+
tag: "Shadow",
|
|
5
|
+
description: "A cross-platform, universal shadow.",
|
|
6
|
+
category: COMPONENT_TYPES.view,
|
|
7
|
+
stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
8
|
+
props: {
|
|
9
|
+
disabled: createDisabledProp({
|
|
10
|
+
description: "Disables the shadow.",
|
|
11
|
+
}),
|
|
12
|
+
startColor: createColorProp({
|
|
13
|
+
label: "Start Color",
|
|
14
|
+
description: "The initial gradient color of the shadow.",
|
|
15
|
+
defaultValue: null,
|
|
16
|
+
}),
|
|
17
|
+
endColor: createColorProp({
|
|
18
|
+
label: "End Color",
|
|
19
|
+
description: "The final gradient color of the shadow.",
|
|
20
|
+
defaultValue: null,
|
|
21
|
+
}),
|
|
22
|
+
distance: createStaticNumberProp({
|
|
23
|
+
label: "Distance",
|
|
24
|
+
description: "The distance of the shadow.",
|
|
25
|
+
}),
|
|
26
|
+
paintInside: createStaticBoolProp({
|
|
27
|
+
label: "Paint Inside",
|
|
28
|
+
description: "Apply the shadow below/inside the content.",
|
|
29
|
+
defaultValue: false,
|
|
30
|
+
}),
|
|
31
|
+
stretch: createStaticBoolProp({
|
|
32
|
+
label: "Stretch",
|
|
33
|
+
description: "Force children to occupy all available horizontal space.",
|
|
34
|
+
defaultValue: null,
|
|
35
|
+
}),
|
|
36
|
+
offsetX: createStaticNumberProp({
|
|
37
|
+
label: "Offset X",
|
|
38
|
+
description: "Moves the shadow in the x direction",
|
|
39
|
+
defeaultValue: 0,
|
|
40
|
+
}),
|
|
41
|
+
offsetY: createStaticNumberProp({
|
|
42
|
+
label: "Offset Y",
|
|
43
|
+
description: "Moves the shadow in the y direction",
|
|
44
|
+
defeaultValue: 0,
|
|
45
|
+
}),
|
|
46
|
+
showShadowSideStart: createStaticBoolProp({
|
|
47
|
+
label: "Show Shadow Start",
|
|
48
|
+
description: "Whether to show shadow on the start side or not",
|
|
49
|
+
defaultValue: true,
|
|
50
|
+
group: GROUPS.advanced,
|
|
51
|
+
}),
|
|
52
|
+
showShadowSideEnd: createStaticBoolProp({
|
|
53
|
+
label: "Show Shadow End",
|
|
54
|
+
description: "Whether to show shadow on the end side or not",
|
|
55
|
+
defaultValue: true,
|
|
56
|
+
group: GROUPS.advanced,
|
|
57
|
+
}),
|
|
58
|
+
showShadowSideTop: createStaticBoolProp({
|
|
59
|
+
label: "Show Shadow Top",
|
|
60
|
+
description: "Whether to show shadow on the top side or not",
|
|
61
|
+
defaultValue: true,
|
|
62
|
+
group: GROUPS.advanced,
|
|
63
|
+
}),
|
|
64
|
+
showShadowSideBottom: createStaticBoolProp({
|
|
65
|
+
label: "Show Shadow Bottom",
|
|
66
|
+
description: "Whether to show shadow on the bottom side or not",
|
|
67
|
+
defaultValue: true,
|
|
68
|
+
group: GROUPS.advanced,
|
|
69
|
+
}),
|
|
70
|
+
showShadowCornerTopStart: createStaticBoolProp({
|
|
71
|
+
label: "Show Shadow Top Start Corner",
|
|
72
|
+
description: "Whether to show shadow on the top start corner or not",
|
|
73
|
+
defaultValue: true,
|
|
74
|
+
group: GROUPS.advanced,
|
|
75
|
+
}),
|
|
76
|
+
showShadowCornerTopEnd: createStaticBoolProp({
|
|
77
|
+
label: "Show Shadow Top End Corner",
|
|
78
|
+
description: "Whether to show shadow on the top end corner or not",
|
|
79
|
+
defaultValue: true,
|
|
80
|
+
group: GROUPS.advanced,
|
|
81
|
+
}),
|
|
82
|
+
showShadowCornerBottomStart: createStaticBoolProp({
|
|
83
|
+
label: "Show Shadow Bottom Start Corner",
|
|
84
|
+
description: "Whether to show shadow on the bottom start corner or not",
|
|
85
|
+
defaultValue: true,
|
|
86
|
+
group: GROUPS.advanced,
|
|
87
|
+
}),
|
|
88
|
+
showShadowCornerBottomEnd: createStaticBoolProp({
|
|
89
|
+
label: "Show Shadow Bottom End Corner",
|
|
90
|
+
description: "Whether to show shadow on the bottom end corner or not",
|
|
91
|
+
defaultValue: true,
|
|
92
|
+
group: GROUPS.advanced,
|
|
93
|
+
}),
|
|
94
|
+
},
|
|
95
|
+
};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import {
|
|
2
|
+
COMPONENT_TYPES,
|
|
3
|
+
CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
4
|
+
createColorProp,
|
|
5
|
+
createStaticNumberProp,
|
|
6
|
+
createStaticBoolProp,
|
|
7
|
+
createDisabledProp,
|
|
8
|
+
GROUPS,
|
|
9
|
+
} from "@draftbit/types";
|
|
10
|
+
|
|
11
|
+
export const SEED_DATA = {
|
|
12
|
+
name: "Shadow",
|
|
13
|
+
tag: "Shadow",
|
|
14
|
+
description: "A cross-platform, universal shadow.",
|
|
15
|
+
category: COMPONENT_TYPES.view,
|
|
16
|
+
stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
17
|
+
props: {
|
|
18
|
+
disabled: createDisabledProp({
|
|
19
|
+
description: "Disables the shadow.",
|
|
20
|
+
}),
|
|
21
|
+
startColor: createColorProp({
|
|
22
|
+
label: "Start Color",
|
|
23
|
+
description: "The initial gradient color of the shadow.",
|
|
24
|
+
defaultValue: null,
|
|
25
|
+
}),
|
|
26
|
+
endColor: createColorProp({
|
|
27
|
+
label: "End Color",
|
|
28
|
+
description: "The final gradient color of the shadow.",
|
|
29
|
+
defaultValue: null,
|
|
30
|
+
}),
|
|
31
|
+
distance: createStaticNumberProp({
|
|
32
|
+
label: "Distance",
|
|
33
|
+
description: "The distance of the shadow.",
|
|
34
|
+
}),
|
|
35
|
+
paintInside: createStaticBoolProp({
|
|
36
|
+
label: "Paint Inside",
|
|
37
|
+
description: "Apply the shadow below/inside the content.",
|
|
38
|
+
defaultValue: false,
|
|
39
|
+
}),
|
|
40
|
+
stretch: createStaticBoolProp({
|
|
41
|
+
label: "Stretch",
|
|
42
|
+
description: "Force children to occupy all available horizontal space.",
|
|
43
|
+
defaultValue: null,
|
|
44
|
+
}),
|
|
45
|
+
offsetX: createStaticNumberProp({
|
|
46
|
+
label: "Offset X",
|
|
47
|
+
description: "Moves the shadow in the x direction",
|
|
48
|
+
defeaultValue: 0,
|
|
49
|
+
}),
|
|
50
|
+
offsetY: createStaticNumberProp({
|
|
51
|
+
label: "Offset Y",
|
|
52
|
+
description: "Moves the shadow in the y direction",
|
|
53
|
+
defeaultValue: 0,
|
|
54
|
+
}),
|
|
55
|
+
showShadowSideStart: createStaticBoolProp({
|
|
56
|
+
label: "Show Shadow Start",
|
|
57
|
+
description: "Whether to show shadow on the start side or not",
|
|
58
|
+
defaultValue: true,
|
|
59
|
+
group: GROUPS.advanced,
|
|
60
|
+
}),
|
|
61
|
+
showShadowSideEnd: createStaticBoolProp({
|
|
62
|
+
label: "Show Shadow End",
|
|
63
|
+
description: "Whether to show shadow on the end side or not",
|
|
64
|
+
defaultValue: true,
|
|
65
|
+
group: GROUPS.advanced,
|
|
66
|
+
}),
|
|
67
|
+
showShadowSideTop: createStaticBoolProp({
|
|
68
|
+
label: "Show Shadow Top",
|
|
69
|
+
description: "Whether to show shadow on the top side or not",
|
|
70
|
+
defaultValue: true,
|
|
71
|
+
group: GROUPS.advanced,
|
|
72
|
+
}),
|
|
73
|
+
showShadowSideBottom: createStaticBoolProp({
|
|
74
|
+
label: "Show Shadow Bottom",
|
|
75
|
+
description: "Whether to show shadow on the bottom side or not",
|
|
76
|
+
defaultValue: true,
|
|
77
|
+
group: GROUPS.advanced,
|
|
78
|
+
}),
|
|
79
|
+
showShadowCornerTopStart: createStaticBoolProp({
|
|
80
|
+
label: "Show Shadow Top Start Corner",
|
|
81
|
+
description: "Whether to show shadow on the top start corner or not",
|
|
82
|
+
defaultValue: true,
|
|
83
|
+
group: GROUPS.advanced,
|
|
84
|
+
}),
|
|
85
|
+
showShadowCornerTopEnd: createStaticBoolProp({
|
|
86
|
+
label: "Show Shadow Top End Corner",
|
|
87
|
+
description: "Whether to show shadow on the top end corner or not",
|
|
88
|
+
defaultValue: true,
|
|
89
|
+
group: GROUPS.advanced,
|
|
90
|
+
}),
|
|
91
|
+
showShadowCornerBottomStart: createStaticBoolProp({
|
|
92
|
+
label: "Show Shadow Bottom Start Corner",
|
|
93
|
+
description: "Whether to show shadow on the bottom start corner or not",
|
|
94
|
+
defaultValue: true,
|
|
95
|
+
group: GROUPS.advanced,
|
|
96
|
+
}),
|
|
97
|
+
showShadowCornerBottomEnd: createStaticBoolProp({
|
|
98
|
+
label: "Show Shadow Bottom End Corner",
|
|
99
|
+
description: "Whether to show shadow on the bottom end corner or not",
|
|
100
|
+
defaultValue: true,
|
|
101
|
+
group: GROUPS.advanced,
|
|
102
|
+
}),
|
|
103
|
+
},
|
|
104
|
+
};
|
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.SEED_DATA = void 0;
|
|
7
|
-
var _types = require("@draftbit/types");
|
|
8
|
-
const SEED_DATA_TRIGGERS = [_types.Triggers.OnValueChange];
|
|
9
|
-
const ELEMENT_SEED_DATA = {
|
|
10
|
-
doc_link: "https://www.npmjs.com/package/@expo/html-elements",
|
|
11
|
-
code_link: "https://github.com/expo/expo/tree/master/packages/html-elements",
|
|
12
|
-
packageName: "@expo/html-elements",
|
|
13
|
-
stylesPanelSections: [_types.StylesPanelSections.Typography, _types.StylesPanelSections.LayoutSelectedItem, _types.StylesPanelSections.MarginsAndPaddings, _types.StylesPanelSections.Effects],
|
|
14
|
-
layout: {
|
|
15
|
-
margin: 0
|
|
16
|
-
},
|
|
17
|
-
triggers: SEED_DATA_TRIGGERS,
|
|
18
|
-
category: _types.COMPONENT_TYPES.webelement
|
|
19
|
-
};
|
|
20
|
-
const HEADING_SEED_DATA = {
|
|
21
|
-
...ELEMENT_SEED_DATA,
|
|
22
|
-
category: _types.COMPONENT_TYPES.text,
|
|
23
|
-
props: {
|
|
24
|
-
accessibilityLabel: {
|
|
25
|
-
group: _types.GROUPS.accessibility,
|
|
26
|
-
name: "accessibilityLabel",
|
|
27
|
-
label: "accessibilityLabel",
|
|
28
|
-
description: "Overrides the text that's read by the screen reader when the user interacts with the element. By default, the label is constructed by traversing all the children and accumulating all the Text nodes separated by space.",
|
|
29
|
-
editable: true,
|
|
30
|
-
required: false,
|
|
31
|
-
formType: _types.FORM_TYPES.string,
|
|
32
|
-
propType: _types.PROP_TYPES.STRING,
|
|
33
|
-
defaultValue: null
|
|
34
|
-
},
|
|
35
|
-
selectable: {
|
|
36
|
-
group: _types.GROUPS.advanced,
|
|
37
|
-
name: "selectable",
|
|
38
|
-
label: "selectable",
|
|
39
|
-
description: "Lets the user select text, to use the native copy and paste functionality.",
|
|
40
|
-
editable: true,
|
|
41
|
-
required: false,
|
|
42
|
-
formType: _types.FORM_TYPES.boolean,
|
|
43
|
-
propType: _types.PROP_TYPES.BOOLEAN,
|
|
44
|
-
defaultValue: null
|
|
45
|
-
},
|
|
46
|
-
children: {
|
|
47
|
-
group: _types.GROUPS.data,
|
|
48
|
-
label: "Text",
|
|
49
|
-
description: "Text",
|
|
50
|
-
editable: true,
|
|
51
|
-
required: true,
|
|
52
|
-
formType: _types.FORM_TYPES.string,
|
|
53
|
-
propType: _types.PROP_TYPES.STRING,
|
|
54
|
-
defaultValue: "Your Headline Here"
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
const TEXT_SEED_DATA = {
|
|
59
|
-
...ELEMENT_SEED_DATA,
|
|
60
|
-
category: _types.COMPONENT_TYPES.text,
|
|
61
|
-
props: {
|
|
62
|
-
children: {
|
|
63
|
-
group: _types.GROUPS.data,
|
|
64
|
-
label: "Text",
|
|
65
|
-
description: "Text",
|
|
66
|
-
defaultValue: "Your Text Here",
|
|
67
|
-
editable: true,
|
|
68
|
-
required: true,
|
|
69
|
-
formType: _types.FORM_TYPES.string,
|
|
70
|
-
propType: _types.PROP_TYPES.STRING
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
const SEED_DATA = [{
|
|
75
|
-
name: "H1",
|
|
76
|
-
tag: "H1",
|
|
77
|
-
...HEADING_SEED_DATA
|
|
78
|
-
}, {
|
|
79
|
-
name: "H2",
|
|
80
|
-
tag: "H2",
|
|
81
|
-
...HEADING_SEED_DATA
|
|
82
|
-
}, {
|
|
83
|
-
name: "H3",
|
|
84
|
-
tag: "H3",
|
|
85
|
-
...HEADING_SEED_DATA
|
|
86
|
-
}, {
|
|
87
|
-
name: "H4",
|
|
88
|
-
tag: "H4",
|
|
89
|
-
...HEADING_SEED_DATA
|
|
90
|
-
}, {
|
|
91
|
-
name: "H5",
|
|
92
|
-
tag: "H5",
|
|
93
|
-
...HEADING_SEED_DATA
|
|
94
|
-
}, {
|
|
95
|
-
name: "H6",
|
|
96
|
-
tag: "H6",
|
|
97
|
-
...HEADING_SEED_DATA
|
|
98
|
-
}, {
|
|
99
|
-
name: "Anchor",
|
|
100
|
-
tag: "A",
|
|
101
|
-
...TEXT_SEED_DATA,
|
|
102
|
-
props: {
|
|
103
|
-
href: (0, _types.createTextProp)({
|
|
104
|
-
label: "href",
|
|
105
|
-
description: "Specify the URL",
|
|
106
|
-
defaultValue: ""
|
|
107
|
-
}),
|
|
108
|
-
target: {
|
|
109
|
-
group: _types.GROUPS.basic,
|
|
110
|
-
label: "target",
|
|
111
|
-
description: "decide where link should open",
|
|
112
|
-
formType: _types.FORM_TYPES.flatArray,
|
|
113
|
-
defaultValue: "_blank",
|
|
114
|
-
options: ["_blank", "_self", "_parent", "_top"]
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}, {
|
|
118
|
-
name: "Paragraph",
|
|
119
|
-
tag: "P",
|
|
120
|
-
...TEXT_SEED_DATA,
|
|
121
|
-
props: {
|
|
122
|
-
// NOTE - Keeping the props commented until we figure out a way to use this props from draftbit side.
|
|
123
|
-
// strong: createBoolProp({
|
|
124
|
-
// label: "Strong",
|
|
125
|
-
// description: "Strong",
|
|
126
|
-
// }),
|
|
127
|
-
// strike: createBoolProp({
|
|
128
|
-
// label: "Strike",
|
|
129
|
-
// description: "Strike through",
|
|
130
|
-
// }),
|
|
131
|
-
// italic: createBoolProp({
|
|
132
|
-
// label: "Italic",
|
|
133
|
-
// description: "Italic Fonts",
|
|
134
|
-
// }),
|
|
135
|
-
// bold: createBoolProp({
|
|
136
|
-
// label: "Bold",
|
|
137
|
-
// description: "Bold",
|
|
138
|
-
// }),
|
|
139
|
-
}
|
|
140
|
-
}, {
|
|
141
|
-
name: "Code",
|
|
142
|
-
tag: "Code",
|
|
143
|
-
...TEXT_SEED_DATA
|
|
144
|
-
}, {
|
|
145
|
-
name: "Pre",
|
|
146
|
-
tag: "Pre",
|
|
147
|
-
...TEXT_SEED_DATA
|
|
148
|
-
}, {
|
|
149
|
-
name: "Mark",
|
|
150
|
-
tag: "Mark",
|
|
151
|
-
...TEXT_SEED_DATA
|
|
152
|
-
}, {
|
|
153
|
-
name: "BR",
|
|
154
|
-
tag: "BR",
|
|
155
|
-
...TEXT_SEED_DATA
|
|
156
|
-
}, {
|
|
157
|
-
name: "BlockQuote",
|
|
158
|
-
tag: "BlockQuote",
|
|
159
|
-
...TEXT_SEED_DATA
|
|
160
|
-
}, {
|
|
161
|
-
name: "HR",
|
|
162
|
-
tag: "HR",
|
|
163
|
-
...TEXT_SEED_DATA
|
|
164
|
-
}, {
|
|
165
|
-
name: "Time",
|
|
166
|
-
tag: "Time",
|
|
167
|
-
...ELEMENT_SEED_DATA
|
|
168
|
-
}, {
|
|
169
|
-
name: "UL",
|
|
170
|
-
tag: "UL",
|
|
171
|
-
...ELEMENT_SEED_DATA
|
|
172
|
-
}, {
|
|
173
|
-
name: "LI",
|
|
174
|
-
tag: "LI",
|
|
175
|
-
...ELEMENT_SEED_DATA
|
|
176
|
-
}];
|
|
177
|
-
exports.SEED_DATA = SEED_DATA;
|
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
import { COMPONENT_TYPES, createTextProp, FORM_TYPES, PROP_TYPES, GROUPS, StylesPanelSections, Triggers } from "@draftbit/types";
|
|
2
|
-
const SEED_DATA_TRIGGERS = [Triggers.OnValueChange];
|
|
3
|
-
const ELEMENT_SEED_DATA = {
|
|
4
|
-
doc_link: "https://www.npmjs.com/package/@expo/html-elements",
|
|
5
|
-
code_link: "https://github.com/expo/expo/tree/master/packages/html-elements",
|
|
6
|
-
packageName: "@expo/html-elements",
|
|
7
|
-
stylesPanelSections: [StylesPanelSections.Typography, StylesPanelSections.LayoutSelectedItem, StylesPanelSections.MarginsAndPaddings, StylesPanelSections.Effects],
|
|
8
|
-
layout: {
|
|
9
|
-
margin: 0
|
|
10
|
-
},
|
|
11
|
-
triggers: SEED_DATA_TRIGGERS,
|
|
12
|
-
category: COMPONENT_TYPES.webelement
|
|
13
|
-
};
|
|
14
|
-
const HEADING_SEED_DATA = {
|
|
15
|
-
...ELEMENT_SEED_DATA,
|
|
16
|
-
category: COMPONENT_TYPES.text,
|
|
17
|
-
props: {
|
|
18
|
-
accessibilityLabel: {
|
|
19
|
-
group: GROUPS.accessibility,
|
|
20
|
-
name: "accessibilityLabel",
|
|
21
|
-
label: "accessibilityLabel",
|
|
22
|
-
description: "Overrides the text that's read by the screen reader when the user interacts with the element. By default, the label is constructed by traversing all the children and accumulating all the Text nodes separated by space.",
|
|
23
|
-
editable: true,
|
|
24
|
-
required: false,
|
|
25
|
-
formType: FORM_TYPES.string,
|
|
26
|
-
propType: PROP_TYPES.STRING,
|
|
27
|
-
defaultValue: null
|
|
28
|
-
},
|
|
29
|
-
selectable: {
|
|
30
|
-
group: GROUPS.advanced,
|
|
31
|
-
name: "selectable",
|
|
32
|
-
label: "selectable",
|
|
33
|
-
description: "Lets the user select text, to use the native copy and paste functionality.",
|
|
34
|
-
editable: true,
|
|
35
|
-
required: false,
|
|
36
|
-
formType: FORM_TYPES.boolean,
|
|
37
|
-
propType: PROP_TYPES.BOOLEAN,
|
|
38
|
-
defaultValue: null
|
|
39
|
-
},
|
|
40
|
-
children: {
|
|
41
|
-
group: GROUPS.data,
|
|
42
|
-
label: "Text",
|
|
43
|
-
description: "Text",
|
|
44
|
-
editable: true,
|
|
45
|
-
required: true,
|
|
46
|
-
formType: FORM_TYPES.string,
|
|
47
|
-
propType: PROP_TYPES.STRING,
|
|
48
|
-
defaultValue: "Your Headline Here"
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
const TEXT_SEED_DATA = {
|
|
53
|
-
...ELEMENT_SEED_DATA,
|
|
54
|
-
category: COMPONENT_TYPES.text,
|
|
55
|
-
props: {
|
|
56
|
-
children: {
|
|
57
|
-
group: GROUPS.data,
|
|
58
|
-
label: "Text",
|
|
59
|
-
description: "Text",
|
|
60
|
-
defaultValue: "Your Text Here",
|
|
61
|
-
editable: true,
|
|
62
|
-
required: true,
|
|
63
|
-
formType: FORM_TYPES.string,
|
|
64
|
-
propType: PROP_TYPES.STRING
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
export const SEED_DATA = [{
|
|
69
|
-
name: "H1",
|
|
70
|
-
tag: "H1",
|
|
71
|
-
...HEADING_SEED_DATA
|
|
72
|
-
}, {
|
|
73
|
-
name: "H2",
|
|
74
|
-
tag: "H2",
|
|
75
|
-
...HEADING_SEED_DATA
|
|
76
|
-
}, {
|
|
77
|
-
name: "H3",
|
|
78
|
-
tag: "H3",
|
|
79
|
-
...HEADING_SEED_DATA
|
|
80
|
-
}, {
|
|
81
|
-
name: "H4",
|
|
82
|
-
tag: "H4",
|
|
83
|
-
...HEADING_SEED_DATA
|
|
84
|
-
}, {
|
|
85
|
-
name: "H5",
|
|
86
|
-
tag: "H5",
|
|
87
|
-
...HEADING_SEED_DATA
|
|
88
|
-
}, {
|
|
89
|
-
name: "H6",
|
|
90
|
-
tag: "H6",
|
|
91
|
-
...HEADING_SEED_DATA
|
|
92
|
-
}, {
|
|
93
|
-
name: "Anchor",
|
|
94
|
-
tag: "A",
|
|
95
|
-
...TEXT_SEED_DATA,
|
|
96
|
-
props: {
|
|
97
|
-
href: createTextProp({
|
|
98
|
-
label: "href",
|
|
99
|
-
description: "Specify the URL",
|
|
100
|
-
defaultValue: ""
|
|
101
|
-
}),
|
|
102
|
-
target: {
|
|
103
|
-
group: GROUPS.basic,
|
|
104
|
-
label: "target",
|
|
105
|
-
description: "decide where link should open",
|
|
106
|
-
formType: FORM_TYPES.flatArray,
|
|
107
|
-
defaultValue: "_blank",
|
|
108
|
-
options: ["_blank", "_self", "_parent", "_top"]
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}, {
|
|
112
|
-
name: "Paragraph",
|
|
113
|
-
tag: "P",
|
|
114
|
-
...TEXT_SEED_DATA,
|
|
115
|
-
props: {
|
|
116
|
-
// NOTE - Keeping the props commented until we figure out a way to use this props from draftbit side.
|
|
117
|
-
// strong: createBoolProp({
|
|
118
|
-
// label: "Strong",
|
|
119
|
-
// description: "Strong",
|
|
120
|
-
// }),
|
|
121
|
-
// strike: createBoolProp({
|
|
122
|
-
// label: "Strike",
|
|
123
|
-
// description: "Strike through",
|
|
124
|
-
// }),
|
|
125
|
-
// italic: createBoolProp({
|
|
126
|
-
// label: "Italic",
|
|
127
|
-
// description: "Italic Fonts",
|
|
128
|
-
// }),
|
|
129
|
-
// bold: createBoolProp({
|
|
130
|
-
// label: "Bold",
|
|
131
|
-
// description: "Bold",
|
|
132
|
-
// }),
|
|
133
|
-
}
|
|
134
|
-
}, {
|
|
135
|
-
name: "Code",
|
|
136
|
-
tag: "Code",
|
|
137
|
-
...TEXT_SEED_DATA
|
|
138
|
-
}, {
|
|
139
|
-
name: "Pre",
|
|
140
|
-
tag: "Pre",
|
|
141
|
-
...TEXT_SEED_DATA
|
|
142
|
-
}, {
|
|
143
|
-
name: "Mark",
|
|
144
|
-
tag: "Mark",
|
|
145
|
-
...TEXT_SEED_DATA
|
|
146
|
-
}, {
|
|
147
|
-
name: "BR",
|
|
148
|
-
tag: "BR",
|
|
149
|
-
...TEXT_SEED_DATA
|
|
150
|
-
}, {
|
|
151
|
-
name: "BlockQuote",
|
|
152
|
-
tag: "BlockQuote",
|
|
153
|
-
...TEXT_SEED_DATA
|
|
154
|
-
}, {
|
|
155
|
-
name: "HR",
|
|
156
|
-
tag: "HR",
|
|
157
|
-
...TEXT_SEED_DATA
|
|
158
|
-
}, {
|
|
159
|
-
name: "Time",
|
|
160
|
-
tag: "Time",
|
|
161
|
-
...ELEMENT_SEED_DATA
|
|
162
|
-
}, {
|
|
163
|
-
name: "UL",
|
|
164
|
-
tag: "UL",
|
|
165
|
-
...ELEMENT_SEED_DATA
|
|
166
|
-
}, {
|
|
167
|
-
name: "LI",
|
|
168
|
-
tag: "LI",
|
|
169
|
-
...ELEMENT_SEED_DATA
|
|
170
|
-
}];
|