@draftbit/core 46.8.2-fee87c.2 → 46.9.1-0f1b60.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/Container.js +15 -4
- package/lib/commonjs/components/Markdown.js +30 -0
- package/lib/commonjs/components/Shadow.js +46 -0
- package/lib/commonjs/components/TabView/TabView.js +22 -6
- package/lib/commonjs/hooks.js +1 -2
- package/lib/commonjs/index.js +14 -0
- package/lib/commonjs/mappings/FlashList.js +2 -8
- package/lib/commonjs/mappings/HtmlElements.js +160 -0
- package/lib/commonjs/mappings/Markdown.js +27 -0
- package/lib/commonjs/mappings/Shadow.js +102 -0
- package/lib/commonjs/mappings/TabView.js +6 -5
- package/lib/commonjs/mappings/TabViewItem.js +5 -3
- package/lib/module/components/Markdown.js +20 -0
- package/lib/module/components/Shadow.js +38 -0
- package/lib/module/components/TabView/TabView.js +22 -5
- package/lib/module/index.js +2 -0
- package/lib/module/mappings/FlashList.js +3 -9
- package/lib/module/mappings/HtmlElements.js +153 -0
- package/lib/module/mappings/Markdown.js +20 -0
- package/lib/module/mappings/Shadow.js +95 -0
- package/lib/module/mappings/TabView.js +7 -6
- package/lib/module/mappings/TabViewItem.js +6 -4
- package/lib/typescript/src/components/Markdown.d.ts +8 -0
- package/lib/typescript/src/components/Markdown.d.ts.map +1 -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/components/TabView/TabView.d.ts.map +1 -1
- package/lib/typescript/src/components/TabView/TabViewItem.d.ts +1 -1
- package/lib/typescript/src/components/TabView/TabViewItem.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +2 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/mappings/FlashList.d.ts +0 -6
- package/lib/typescript/src/mappings/FlashList.d.ts.map +1 -1
- package/lib/typescript/src/mappings/HtmlElements.d.ts +109 -0
- package/lib/typescript/src/mappings/HtmlElements.d.ts.map +1 -0
- package/lib/typescript/src/mappings/Markdown.d.ts +20 -0
- package/lib/typescript/src/mappings/Markdown.d.ts.map +1 -0
- package/lib/typescript/src/mappings/Shadow.d.ts +173 -0
- package/lib/typescript/src/mappings/Shadow.d.ts.map +1 -0
- package/lib/typescript/src/mappings/TabView.d.ts.map +1 -1
- package/lib/typescript/src/mappings/TabViewItem.d.ts.map +1 -1
- package/package.json +6 -3
- package/src/components/Markdown.js +10 -0
- package/src/components/Markdown.tsx +22 -0
- package/src/components/Shadow.js +16 -0
- package/src/components/Shadow.tsx +62 -0
- package/src/components/TabView/TabView.js +16 -7
- package/src/components/TabView/TabView.tsx +25 -7
- package/src/components/TabView/TabViewItem.tsx +1 -1
- package/src/index.js +2 -0
- package/src/index.tsx +3 -0
- package/src/mappings/FlashList.js +9 -9
- package/src/mappings/FlashList.ts +9 -9
- package/src/mappings/HtmlElements.js +180 -0
- package/src/mappings/HtmlElements.ts +194 -0
- package/src/mappings/Markdown.js +25 -0
- package/src/mappings/Markdown.ts +32 -0
- package/src/mappings/Shadow.js +95 -0
- package/src/mappings/Shadow.ts +104 -0
- package/src/mappings/TabView.js +11 -5
- package/src/mappings/TabView.ts +11 -5
- package/src/mappings/TabViewItem.js +4 -2
- package/src/mappings/TabViewItem.ts +4 -1
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { COMPONENT_TYPES, createTextProp, FORM_TYPES, PROP_TYPES, GROUPS, StylesPanelSections, BLOCK_STYLES_SECTIONS, } from "@draftbit/types";
|
|
2
|
+
const ELEMENT_SEED_DATA = {
|
|
3
|
+
doc_link: "https://www.npmjs.com/package/@expo/html-elements",
|
|
4
|
+
code_link: "https://github.com/expo/expo/tree/master/packages/html-elements",
|
|
5
|
+
packageName: "@expo/html-elements",
|
|
6
|
+
stylesPanelSections: BLOCK_STYLES_SECTIONS,
|
|
7
|
+
category: COMPONENT_TYPES.webelement,
|
|
8
|
+
};
|
|
9
|
+
const TEXT_SEED_DATA = {
|
|
10
|
+
...ELEMENT_SEED_DATA,
|
|
11
|
+
category: COMPONENT_TYPES.text,
|
|
12
|
+
stylesPanelSections: [
|
|
13
|
+
StylesPanelSections.Typography,
|
|
14
|
+
StylesPanelSections.LayoutSelectedItem,
|
|
15
|
+
StylesPanelSections.MarginsAndPaddings,
|
|
16
|
+
StylesPanelSections.Effects,
|
|
17
|
+
],
|
|
18
|
+
layout: {
|
|
19
|
+
color: "strong",
|
|
20
|
+
},
|
|
21
|
+
props: {
|
|
22
|
+
children: {
|
|
23
|
+
group: GROUPS.data,
|
|
24
|
+
label: "Text",
|
|
25
|
+
description: "Text",
|
|
26
|
+
defaultValue: "Double click me to edit 👀",
|
|
27
|
+
editable: true,
|
|
28
|
+
required: true,
|
|
29
|
+
formType: FORM_TYPES.string,
|
|
30
|
+
propType: PROP_TYPES.STRING,
|
|
31
|
+
},
|
|
32
|
+
accessibilityLabel: {
|
|
33
|
+
group: GROUPS.accessibility,
|
|
34
|
+
name: "accessibilityLabel",
|
|
35
|
+
label: "accessibilityLabel",
|
|
36
|
+
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.",
|
|
37
|
+
editable: true,
|
|
38
|
+
required: false,
|
|
39
|
+
formType: FORM_TYPES.string,
|
|
40
|
+
propType: PROP_TYPES.STRING,
|
|
41
|
+
defaultValue: null,
|
|
42
|
+
},
|
|
43
|
+
selectable: {
|
|
44
|
+
group: GROUPS.advanced,
|
|
45
|
+
name: "selectable",
|
|
46
|
+
label: "selectable",
|
|
47
|
+
description: "Lets the user select text, to use the native copy and paste functionality.",
|
|
48
|
+
editable: true,
|
|
49
|
+
required: false,
|
|
50
|
+
formType: FORM_TYPES.boolean,
|
|
51
|
+
propType: PROP_TYPES.BOOLEAN,
|
|
52
|
+
defaultValue: true,
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
export const SEED_DATA = [
|
|
57
|
+
{
|
|
58
|
+
name: "Heading 1",
|
|
59
|
+
tag: "H1",
|
|
60
|
+
...TEXT_SEED_DATA,
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
name: "Heading 2",
|
|
64
|
+
tag: "H2",
|
|
65
|
+
...TEXT_SEED_DATA,
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
name: "Heading 3",
|
|
69
|
+
tag: "H3",
|
|
70
|
+
...TEXT_SEED_DATA,
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
name: "Heading 4",
|
|
74
|
+
tag: "H4",
|
|
75
|
+
...TEXT_SEED_DATA,
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
name: "Heading 5",
|
|
79
|
+
tag: "H5",
|
|
80
|
+
...TEXT_SEED_DATA,
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
name: "Heading 6",
|
|
84
|
+
tag: "H6",
|
|
85
|
+
...TEXT_SEED_DATA,
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
name: "Paragraph",
|
|
89
|
+
tag: "P",
|
|
90
|
+
...TEXT_SEED_DATA,
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
name: "Bold",
|
|
94
|
+
tag: "B",
|
|
95
|
+
...TEXT_SEED_DATA,
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
name: "Strikethrough",
|
|
99
|
+
tag: "S",
|
|
100
|
+
...TEXT_SEED_DATA,
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
name: "Italic",
|
|
104
|
+
tag: "I",
|
|
105
|
+
...TEXT_SEED_DATA,
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
name: "Code",
|
|
109
|
+
tag: "Code",
|
|
110
|
+
...TEXT_SEED_DATA,
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
name: "Preformatted",
|
|
114
|
+
tag: "Pre",
|
|
115
|
+
...TEXT_SEED_DATA,
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
name: "Mark",
|
|
119
|
+
tag: "Mark",
|
|
120
|
+
...TEXT_SEED_DATA,
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
name: "Block Quote",
|
|
124
|
+
tag: "BlockQuote",
|
|
125
|
+
...TEXT_SEED_DATA,
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
name: "Quoted",
|
|
129
|
+
tag: "Q",
|
|
130
|
+
...TEXT_SEED_DATA,
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
name: "Time",
|
|
134
|
+
tag: "Time",
|
|
135
|
+
...TEXT_SEED_DATA,
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
name: "Unordered List",
|
|
139
|
+
tag: "UL",
|
|
140
|
+
...ELEMENT_SEED_DATA,
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
name: "List Item",
|
|
144
|
+
tag: "LI",
|
|
145
|
+
...TEXT_SEED_DATA,
|
|
146
|
+
category: COMPONENT_TYPES.webelement,
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
name: "Line Break",
|
|
150
|
+
tag: "BR",
|
|
151
|
+
...ELEMENT_SEED_DATA,
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
name: "Horizontal Rule",
|
|
155
|
+
tag: "HR",
|
|
156
|
+
...ELEMENT_SEED_DATA,
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
name: "Anchor",
|
|
160
|
+
tag: "A",
|
|
161
|
+
...TEXT_SEED_DATA,
|
|
162
|
+
props: {
|
|
163
|
+
...TEXT_SEED_DATA.props,
|
|
164
|
+
href: createTextProp({
|
|
165
|
+
label: "href",
|
|
166
|
+
description: "Specify the URL",
|
|
167
|
+
defaultValue: "",
|
|
168
|
+
}),
|
|
169
|
+
target: {
|
|
170
|
+
group: GROUPS.basic,
|
|
171
|
+
label: "target",
|
|
172
|
+
description: "decide where link should open",
|
|
173
|
+
formType: FORM_TYPES.flatArray,
|
|
174
|
+
defaultValue: "_blank",
|
|
175
|
+
options: ["_blank", "_self", "_parent", "_top"],
|
|
176
|
+
},
|
|
177
|
+
},
|
|
178
|
+
category: COMPONENT_TYPES.webelement,
|
|
179
|
+
},
|
|
180
|
+
];
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import {
|
|
2
|
+
COMPONENT_TYPES,
|
|
3
|
+
createTextProp,
|
|
4
|
+
FORM_TYPES,
|
|
5
|
+
PROP_TYPES,
|
|
6
|
+
GROUPS,
|
|
7
|
+
StylesPanelSections,
|
|
8
|
+
BLOCK_STYLES_SECTIONS,
|
|
9
|
+
} from "@draftbit/types";
|
|
10
|
+
|
|
11
|
+
const ELEMENT_SEED_DATA = {
|
|
12
|
+
doc_link: "https://www.npmjs.com/package/@expo/html-elements",
|
|
13
|
+
code_link: "https://github.com/expo/expo/tree/master/packages/html-elements",
|
|
14
|
+
packageName: "@expo/html-elements",
|
|
15
|
+
stylesPanelSections: BLOCK_STYLES_SECTIONS,
|
|
16
|
+
category: COMPONENT_TYPES.webelement,
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const TEXT_SEED_DATA = {
|
|
20
|
+
...ELEMENT_SEED_DATA,
|
|
21
|
+
category: COMPONENT_TYPES.text,
|
|
22
|
+
stylesPanelSections: [
|
|
23
|
+
StylesPanelSections.Typography,
|
|
24
|
+
StylesPanelSections.LayoutSelectedItem,
|
|
25
|
+
StylesPanelSections.MarginsAndPaddings,
|
|
26
|
+
StylesPanelSections.Effects,
|
|
27
|
+
],
|
|
28
|
+
layout: {
|
|
29
|
+
color: "strong",
|
|
30
|
+
},
|
|
31
|
+
props: {
|
|
32
|
+
children: {
|
|
33
|
+
group: GROUPS.data,
|
|
34
|
+
label: "Text",
|
|
35
|
+
description: "Text",
|
|
36
|
+
defaultValue: "Double click me to edit 👀",
|
|
37
|
+
editable: true,
|
|
38
|
+
required: true,
|
|
39
|
+
formType: FORM_TYPES.string,
|
|
40
|
+
propType: PROP_TYPES.STRING,
|
|
41
|
+
},
|
|
42
|
+
accessibilityLabel: {
|
|
43
|
+
group: GROUPS.accessibility,
|
|
44
|
+
name: "accessibilityLabel",
|
|
45
|
+
label: "accessibilityLabel",
|
|
46
|
+
description:
|
|
47
|
+
"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.",
|
|
48
|
+
editable: true,
|
|
49
|
+
required: false,
|
|
50
|
+
formType: FORM_TYPES.string,
|
|
51
|
+
propType: PROP_TYPES.STRING,
|
|
52
|
+
defaultValue: null,
|
|
53
|
+
},
|
|
54
|
+
selectable: {
|
|
55
|
+
group: GROUPS.advanced,
|
|
56
|
+
name: "selectable",
|
|
57
|
+
label: "selectable",
|
|
58
|
+
description:
|
|
59
|
+
"Lets the user select text, to use the native copy and paste functionality.",
|
|
60
|
+
editable: true,
|
|
61
|
+
required: false,
|
|
62
|
+
formType: FORM_TYPES.boolean,
|
|
63
|
+
propType: PROP_TYPES.BOOLEAN,
|
|
64
|
+
defaultValue: true,
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export const SEED_DATA = [
|
|
70
|
+
{
|
|
71
|
+
name: "Heading 1",
|
|
72
|
+
tag: "H1",
|
|
73
|
+
...TEXT_SEED_DATA,
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
name: "Heading 2",
|
|
77
|
+
tag: "H2",
|
|
78
|
+
...TEXT_SEED_DATA,
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
name: "Heading 3",
|
|
82
|
+
tag: "H3",
|
|
83
|
+
...TEXT_SEED_DATA,
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
name: "Heading 4",
|
|
87
|
+
tag: "H4",
|
|
88
|
+
...TEXT_SEED_DATA,
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
name: "Heading 5",
|
|
92
|
+
tag: "H5",
|
|
93
|
+
...TEXT_SEED_DATA,
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
name: "Heading 6",
|
|
97
|
+
tag: "H6",
|
|
98
|
+
...TEXT_SEED_DATA,
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
name: "Paragraph",
|
|
102
|
+
tag: "P",
|
|
103
|
+
...TEXT_SEED_DATA,
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
name: "Bold",
|
|
107
|
+
tag: "B",
|
|
108
|
+
...TEXT_SEED_DATA,
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
name: "Strikethrough",
|
|
112
|
+
tag: "S",
|
|
113
|
+
...TEXT_SEED_DATA,
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
name: "Italic",
|
|
117
|
+
tag: "I",
|
|
118
|
+
...TEXT_SEED_DATA,
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
name: "Code",
|
|
122
|
+
tag: "Code",
|
|
123
|
+
...TEXT_SEED_DATA,
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
name: "Preformatted",
|
|
127
|
+
tag: "Pre",
|
|
128
|
+
...TEXT_SEED_DATA,
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
name: "Mark",
|
|
132
|
+
tag: "Mark",
|
|
133
|
+
...TEXT_SEED_DATA,
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
name: "Block Quote",
|
|
137
|
+
tag: "BlockQuote",
|
|
138
|
+
...TEXT_SEED_DATA,
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
name: "Quoted",
|
|
142
|
+
tag: "Q",
|
|
143
|
+
...TEXT_SEED_DATA,
|
|
144
|
+
},
|
|
145
|
+
|
|
146
|
+
{
|
|
147
|
+
name: "Time",
|
|
148
|
+
tag: "Time",
|
|
149
|
+
...TEXT_SEED_DATA,
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
name: "Unordered List",
|
|
153
|
+
tag: "UL",
|
|
154
|
+
...ELEMENT_SEED_DATA,
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
name: "List Item",
|
|
158
|
+
tag: "LI",
|
|
159
|
+
...TEXT_SEED_DATA,
|
|
160
|
+
category: COMPONENT_TYPES.webelement,
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
name: "Line Break",
|
|
164
|
+
tag: "BR",
|
|
165
|
+
...ELEMENT_SEED_DATA,
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
name: "Horizontal Rule",
|
|
169
|
+
tag: "HR",
|
|
170
|
+
...ELEMENT_SEED_DATA,
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
name: "Anchor",
|
|
174
|
+
tag: "A",
|
|
175
|
+
...TEXT_SEED_DATA,
|
|
176
|
+
props: {
|
|
177
|
+
...TEXT_SEED_DATA.props,
|
|
178
|
+
href: createTextProp({
|
|
179
|
+
label: "href",
|
|
180
|
+
description: "Specify the URL",
|
|
181
|
+
defaultValue: "",
|
|
182
|
+
}),
|
|
183
|
+
target: {
|
|
184
|
+
group: GROUPS.basic,
|
|
185
|
+
label: "target",
|
|
186
|
+
description: "decide where link should open",
|
|
187
|
+
formType: FORM_TYPES.flatArray,
|
|
188
|
+
defaultValue: "_blank",
|
|
189
|
+
options: ["_blank", "_self", "_parent", "_top"],
|
|
190
|
+
},
|
|
191
|
+
},
|
|
192
|
+
category: COMPONENT_TYPES.webelement,
|
|
193
|
+
},
|
|
194
|
+
];
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { COMPONENT_TYPES, FORM_TYPES, GROUPS, PROP_TYPES, StylesPanelSections, } from "@draftbit/types";
|
|
2
|
+
export const SEED_DATA = {
|
|
3
|
+
name: "Markdown",
|
|
4
|
+
tag: "Markdown",
|
|
5
|
+
description: "A component that renders markdown",
|
|
6
|
+
category: COMPONENT_TYPES.text,
|
|
7
|
+
stylesPanelSections: [
|
|
8
|
+
StylesPanelSections.Typography,
|
|
9
|
+
StylesPanelSections.LayoutSelectedItem,
|
|
10
|
+
StylesPanelSections.MarginsAndPaddings,
|
|
11
|
+
StylesPanelSections.Effects,
|
|
12
|
+
],
|
|
13
|
+
props: {
|
|
14
|
+
children: {
|
|
15
|
+
group: GROUPS.data,
|
|
16
|
+
label: "Markdown Text",
|
|
17
|
+
description: "Markdown text to be rendered ",
|
|
18
|
+
editable: true,
|
|
19
|
+
required: true,
|
|
20
|
+
formType: FORM_TYPES.string,
|
|
21
|
+
propType: PROP_TYPES.STRING,
|
|
22
|
+
defaultValue: "### Markdown",
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import {
|
|
2
|
+
COMPONENT_TYPES,
|
|
3
|
+
FORM_TYPES,
|
|
4
|
+
GROUPS,
|
|
5
|
+
PROP_TYPES,
|
|
6
|
+
StylesPanelSections,
|
|
7
|
+
} from "@draftbit/types";
|
|
8
|
+
|
|
9
|
+
export const SEED_DATA = {
|
|
10
|
+
name: "Markdown",
|
|
11
|
+
tag: "Markdown",
|
|
12
|
+
description: "A component that renders markdown",
|
|
13
|
+
category: COMPONENT_TYPES.text,
|
|
14
|
+
stylesPanelSections: [
|
|
15
|
+
StylesPanelSections.Typography,
|
|
16
|
+
StylesPanelSections.LayoutSelectedItem,
|
|
17
|
+
StylesPanelSections.MarginsAndPaddings,
|
|
18
|
+
StylesPanelSections.Effects,
|
|
19
|
+
],
|
|
20
|
+
props: {
|
|
21
|
+
children: {
|
|
22
|
+
group: GROUPS.data,
|
|
23
|
+
label: "Markdown Text",
|
|
24
|
+
description: "Markdown text to be rendered ",
|
|
25
|
+
editable: true,
|
|
26
|
+
required: true,
|
|
27
|
+
formType: FORM_TYPES.string,
|
|
28
|
+
propType: PROP_TYPES.STRING,
|
|
29
|
+
defaultValue: "### Markdown",
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
};
|
|
@@ -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
|
+
};
|
package/src/mappings/TabView.js
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
|
-
import { COMPONENT_TYPES, createTextEnumProp, createColorProp,
|
|
1
|
+
import { COMPONENT_TYPES, createTextEnumProp, createColorProp, StylesPanelSections, Triggers, createActionProp, createStaticBoolProp, GROUPS, } from "@draftbit/types";
|
|
2
2
|
export const SEED_DATA = {
|
|
3
3
|
name: "Tab View",
|
|
4
4
|
tag: "TabView",
|
|
5
5
|
description: "Tab view container",
|
|
6
6
|
category: COMPONENT_TYPES.swiper,
|
|
7
7
|
stylesPanelSections: [
|
|
8
|
-
|
|
8
|
+
StylesPanelSections.Size,
|
|
9
|
+
StylesPanelSections.MarginsAndPaddings,
|
|
10
|
+
StylesPanelSections.Position,
|
|
11
|
+
StylesPanelSections.Effects,
|
|
12
|
+
StylesPanelSections.LayoutSelectedItem,
|
|
9
13
|
StylesPanelSections.Background,
|
|
14
|
+
StylesPanelSections.Typography,
|
|
10
15
|
],
|
|
11
16
|
triggers: [Triggers.OnIndexChanged, Triggers.OnEndReached],
|
|
12
17
|
props: {
|
|
@@ -36,9 +41,9 @@ export const SEED_DATA = {
|
|
|
36
41
|
defaultValue: true,
|
|
37
42
|
}),
|
|
38
43
|
scrollEnabled: createStaticBoolProp({
|
|
39
|
-
label: "Scroll Enabled",
|
|
44
|
+
label: "Tab Scroll Enabled",
|
|
40
45
|
description: "Whether scrolling of tabs is enabled or not",
|
|
41
|
-
defaultValue:
|
|
46
|
+
defaultValue: false,
|
|
42
47
|
}),
|
|
43
48
|
activeColor: createColorProp({
|
|
44
49
|
label: "Active Color",
|
|
@@ -52,8 +57,9 @@ export const SEED_DATA = {
|
|
|
52
57
|
}),
|
|
53
58
|
pressColor: createColorProp({
|
|
54
59
|
label: "Press Color",
|
|
55
|
-
description: "Color of ripple when pressed
|
|
60
|
+
description: "Color of ripple when pressed",
|
|
56
61
|
defaultValue: "primary",
|
|
62
|
+
group: GROUPS.android,
|
|
57
63
|
}),
|
|
58
64
|
indicatorColor: createColorProp({
|
|
59
65
|
label: "Indicator Color",
|