@draftbit/core 46.8.1 → 46.8.2-feb14e.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/constants.js +1 -1
- package/lib/commonjs/mappings/HtmlElements.js +175 -0
- package/lib/module/mappings/HtmlElements.js +168 -0
- package/lib/typescript/src/mappings/HtmlElements.d.ts +73 -0
- package/lib/typescript/src/mappings/HtmlElements.d.ts.map +1 -0
- package/package.json +4 -3
- package/src/mappings/HtmlElements.js +191 -0
- package/src/mappings/HtmlElements.ts +204 -0
|
@@ -12,4 +12,4 @@ const APPROX_STATUSBAR_HEIGHT = _reactNative.Platform.select({
|
|
|
12
12
|
android: DEFAULT_STATUSBAR_HEIGHT_EXPO,
|
|
13
13
|
ios: _reactNative.Platform.Version < 11 ? DEFAULT_STATUSBAR_HEIGHT_EXPO : 0
|
|
14
14
|
});
|
|
15
|
-
exports.APPROX_STATUSBAR_HEIGHT = APPROX_STATUSBAR_HEIGHT;
|
|
15
|
+
exports.APPROX_STATUSBAR_HEIGHT = APPROX_STATUSBAR_HEIGHT;
|
|
@@ -0,0 +1,175 @@
|
|
|
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 ELEMENT_SEED_DATA = {
|
|
9
|
+
doc_link: "https://www.npmjs.com/package/@expo/html-elements",
|
|
10
|
+
code_link: "https://github.com/expo/expo/tree/master/packages/html-elements",
|
|
11
|
+
packageName: "@expo/html-elements",
|
|
12
|
+
stylesPanelSections: [_types.StylesPanelSections.Typography, _types.StylesPanelSections.LayoutSelectedItem, _types.StylesPanelSections.MarginsAndPaddings, _types.StylesPanelSections.Effects],
|
|
13
|
+
layout: {
|
|
14
|
+
margin: 0
|
|
15
|
+
},
|
|
16
|
+
category: _types.COMPONENT_TYPES.webelement
|
|
17
|
+
};
|
|
18
|
+
const HEADING_SEED_DATA = {
|
|
19
|
+
...ELEMENT_SEED_DATA,
|
|
20
|
+
category: _types.COMPONENT_TYPES.text,
|
|
21
|
+
props: {
|
|
22
|
+
accessibilityLabel: {
|
|
23
|
+
group: _types.GROUPS.accessibility,
|
|
24
|
+
name: "accessibilityLabel",
|
|
25
|
+
label: "accessibilityLabel",
|
|
26
|
+
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.",
|
|
27
|
+
editable: true,
|
|
28
|
+
required: false,
|
|
29
|
+
formType: _types.FORM_TYPES.string,
|
|
30
|
+
propType: _types.PROP_TYPES.STRING,
|
|
31
|
+
defaultValue: null
|
|
32
|
+
},
|
|
33
|
+
selectable: {
|
|
34
|
+
group: _types.GROUPS.advanced,
|
|
35
|
+
name: "selectable",
|
|
36
|
+
label: "selectable",
|
|
37
|
+
description: "Lets the user select text, to use the native copy and paste functionality.",
|
|
38
|
+
editable: true,
|
|
39
|
+
required: false,
|
|
40
|
+
formType: _types.FORM_TYPES.boolean,
|
|
41
|
+
propType: _types.PROP_TYPES.BOOLEAN,
|
|
42
|
+
defaultValue: null
|
|
43
|
+
},
|
|
44
|
+
children: {
|
|
45
|
+
group: _types.GROUPS.data,
|
|
46
|
+
label: "Text",
|
|
47
|
+
description: "Text",
|
|
48
|
+
editable: true,
|
|
49
|
+
required: true,
|
|
50
|
+
formType: _types.FORM_TYPES.string,
|
|
51
|
+
propType: _types.PROP_TYPES.STRING,
|
|
52
|
+
defaultValue: "Your Headline Here"
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
const TEXT_SEED_DATA = {
|
|
57
|
+
...ELEMENT_SEED_DATA,
|
|
58
|
+
category: _types.COMPONENT_TYPES.text,
|
|
59
|
+
props: {
|
|
60
|
+
children: {
|
|
61
|
+
group: _types.GROUPS.data,
|
|
62
|
+
label: "Text",
|
|
63
|
+
description: "Text",
|
|
64
|
+
defaultValue: "Your Text Here",
|
|
65
|
+
editable: true,
|
|
66
|
+
required: true,
|
|
67
|
+
formType: _types.FORM_TYPES.string,
|
|
68
|
+
propType: _types.PROP_TYPES.STRING
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
const SEED_DATA = [{
|
|
73
|
+
name: "H1",
|
|
74
|
+
tag: "H1",
|
|
75
|
+
...HEADING_SEED_DATA
|
|
76
|
+
}, {
|
|
77
|
+
name: "H2",
|
|
78
|
+
tag: "H2",
|
|
79
|
+
...HEADING_SEED_DATA
|
|
80
|
+
}, {
|
|
81
|
+
name: "H3",
|
|
82
|
+
tag: "H3",
|
|
83
|
+
...HEADING_SEED_DATA
|
|
84
|
+
}, {
|
|
85
|
+
name: "H4",
|
|
86
|
+
tag: "H4",
|
|
87
|
+
...HEADING_SEED_DATA
|
|
88
|
+
}, {
|
|
89
|
+
name: "H5",
|
|
90
|
+
tag: "H5",
|
|
91
|
+
...HEADING_SEED_DATA
|
|
92
|
+
}, {
|
|
93
|
+
name: "H6",
|
|
94
|
+
tag: "H6",
|
|
95
|
+
...HEADING_SEED_DATA
|
|
96
|
+
}, {
|
|
97
|
+
name: "Anchor",
|
|
98
|
+
tag: "A",
|
|
99
|
+
...TEXT_SEED_DATA,
|
|
100
|
+
props: {
|
|
101
|
+
href: (0, _types.createTextProp)({
|
|
102
|
+
label: "href",
|
|
103
|
+
description: "Specify the URL",
|
|
104
|
+
defaultValue: ""
|
|
105
|
+
}),
|
|
106
|
+
target: {
|
|
107
|
+
group: _types.GROUPS.basic,
|
|
108
|
+
label: "target",
|
|
109
|
+
description: "decide where link should open",
|
|
110
|
+
formType: _types.FORM_TYPES.flatArray,
|
|
111
|
+
defaultValue: "_blank",
|
|
112
|
+
options: ["_blank", "_self", "_parent", "_top"]
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}, {
|
|
116
|
+
name: "Paragraph",
|
|
117
|
+
tag: "P",
|
|
118
|
+
...TEXT_SEED_DATA,
|
|
119
|
+
props: {
|
|
120
|
+
// NOTE - Keeping the props commented until we figure out a way to use this props from draftbit side.
|
|
121
|
+
// strong: createBoolProp({
|
|
122
|
+
// label: "Strong",
|
|
123
|
+
// description: "Strong",
|
|
124
|
+
// }),
|
|
125
|
+
// strike: createBoolProp({
|
|
126
|
+
// label: "Strike",
|
|
127
|
+
// description: "Strike through",
|
|
128
|
+
// }),
|
|
129
|
+
// italic: createBoolProp({
|
|
130
|
+
// label: "Italic",
|
|
131
|
+
// description: "Italic Fonts",
|
|
132
|
+
// }),
|
|
133
|
+
// bold: createBoolProp({
|
|
134
|
+
// label: "Bold",
|
|
135
|
+
// description: "Bold",
|
|
136
|
+
// }),
|
|
137
|
+
}
|
|
138
|
+
}, {
|
|
139
|
+
name: "Code",
|
|
140
|
+
tag: "Code",
|
|
141
|
+
...TEXT_SEED_DATA
|
|
142
|
+
}, {
|
|
143
|
+
name: "Pre",
|
|
144
|
+
tag: "Pre",
|
|
145
|
+
...TEXT_SEED_DATA
|
|
146
|
+
}, {
|
|
147
|
+
name: "Mark",
|
|
148
|
+
tag: "Mark",
|
|
149
|
+
...TEXT_SEED_DATA
|
|
150
|
+
}, {
|
|
151
|
+
name: "BR",
|
|
152
|
+
tag: "BR",
|
|
153
|
+
...TEXT_SEED_DATA
|
|
154
|
+
}, {
|
|
155
|
+
name: "BlockQuote",
|
|
156
|
+
tag: "BlockQuote",
|
|
157
|
+
...TEXT_SEED_DATA
|
|
158
|
+
}, {
|
|
159
|
+
name: "HR",
|
|
160
|
+
tag: "HR",
|
|
161
|
+
...TEXT_SEED_DATA
|
|
162
|
+
}, {
|
|
163
|
+
name: "Time",
|
|
164
|
+
tag: "Time",
|
|
165
|
+
...ELEMENT_SEED_DATA
|
|
166
|
+
}, {
|
|
167
|
+
name: "UL",
|
|
168
|
+
tag: "UL",
|
|
169
|
+
...ELEMENT_SEED_DATA
|
|
170
|
+
}, {
|
|
171
|
+
name: "LI",
|
|
172
|
+
tag: "LI",
|
|
173
|
+
...ELEMENT_SEED_DATA
|
|
174
|
+
}];
|
|
175
|
+
exports.SEED_DATA = SEED_DATA;
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { COMPONENT_TYPES, createTextProp, FORM_TYPES, PROP_TYPES, GROUPS, StylesPanelSections } 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: [StylesPanelSections.Typography, StylesPanelSections.LayoutSelectedItem, StylesPanelSections.MarginsAndPaddings, StylesPanelSections.Effects],
|
|
7
|
+
layout: {
|
|
8
|
+
margin: 0
|
|
9
|
+
},
|
|
10
|
+
category: COMPONENT_TYPES.webelement
|
|
11
|
+
};
|
|
12
|
+
const HEADING_SEED_DATA = {
|
|
13
|
+
...ELEMENT_SEED_DATA,
|
|
14
|
+
category: COMPONENT_TYPES.text,
|
|
15
|
+
props: {
|
|
16
|
+
accessibilityLabel: {
|
|
17
|
+
group: GROUPS.accessibility,
|
|
18
|
+
name: "accessibilityLabel",
|
|
19
|
+
label: "accessibilityLabel",
|
|
20
|
+
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.",
|
|
21
|
+
editable: true,
|
|
22
|
+
required: false,
|
|
23
|
+
formType: FORM_TYPES.string,
|
|
24
|
+
propType: PROP_TYPES.STRING,
|
|
25
|
+
defaultValue: null
|
|
26
|
+
},
|
|
27
|
+
selectable: {
|
|
28
|
+
group: GROUPS.advanced,
|
|
29
|
+
name: "selectable",
|
|
30
|
+
label: "selectable",
|
|
31
|
+
description: "Lets the user select text, to use the native copy and paste functionality.",
|
|
32
|
+
editable: true,
|
|
33
|
+
required: false,
|
|
34
|
+
formType: FORM_TYPES.boolean,
|
|
35
|
+
propType: PROP_TYPES.BOOLEAN,
|
|
36
|
+
defaultValue: null
|
|
37
|
+
},
|
|
38
|
+
children: {
|
|
39
|
+
group: GROUPS.data,
|
|
40
|
+
label: "Text",
|
|
41
|
+
description: "Text",
|
|
42
|
+
editable: true,
|
|
43
|
+
required: true,
|
|
44
|
+
formType: FORM_TYPES.string,
|
|
45
|
+
propType: PROP_TYPES.STRING,
|
|
46
|
+
defaultValue: "Your Headline Here"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
const TEXT_SEED_DATA = {
|
|
51
|
+
...ELEMENT_SEED_DATA,
|
|
52
|
+
category: COMPONENT_TYPES.text,
|
|
53
|
+
props: {
|
|
54
|
+
children: {
|
|
55
|
+
group: GROUPS.data,
|
|
56
|
+
label: "Text",
|
|
57
|
+
description: "Text",
|
|
58
|
+
defaultValue: "Your Text Here",
|
|
59
|
+
editable: true,
|
|
60
|
+
required: true,
|
|
61
|
+
formType: FORM_TYPES.string,
|
|
62
|
+
propType: PROP_TYPES.STRING
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
export const SEED_DATA = [{
|
|
67
|
+
name: "H1",
|
|
68
|
+
tag: "H1",
|
|
69
|
+
...HEADING_SEED_DATA
|
|
70
|
+
}, {
|
|
71
|
+
name: "H2",
|
|
72
|
+
tag: "H2",
|
|
73
|
+
...HEADING_SEED_DATA
|
|
74
|
+
}, {
|
|
75
|
+
name: "H3",
|
|
76
|
+
tag: "H3",
|
|
77
|
+
...HEADING_SEED_DATA
|
|
78
|
+
}, {
|
|
79
|
+
name: "H4",
|
|
80
|
+
tag: "H4",
|
|
81
|
+
...HEADING_SEED_DATA
|
|
82
|
+
}, {
|
|
83
|
+
name: "H5",
|
|
84
|
+
tag: "H5",
|
|
85
|
+
...HEADING_SEED_DATA
|
|
86
|
+
}, {
|
|
87
|
+
name: "H6",
|
|
88
|
+
tag: "H6",
|
|
89
|
+
...HEADING_SEED_DATA
|
|
90
|
+
}, {
|
|
91
|
+
name: "Anchor",
|
|
92
|
+
tag: "A",
|
|
93
|
+
...TEXT_SEED_DATA,
|
|
94
|
+
props: {
|
|
95
|
+
href: createTextProp({
|
|
96
|
+
label: "href",
|
|
97
|
+
description: "Specify the URL",
|
|
98
|
+
defaultValue: ""
|
|
99
|
+
}),
|
|
100
|
+
target: {
|
|
101
|
+
group: GROUPS.basic,
|
|
102
|
+
label: "target",
|
|
103
|
+
description: "decide where link should open",
|
|
104
|
+
formType: FORM_TYPES.flatArray,
|
|
105
|
+
defaultValue: "_blank",
|
|
106
|
+
options: ["_blank", "_self", "_parent", "_top"]
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}, {
|
|
110
|
+
name: "Paragraph",
|
|
111
|
+
tag: "P",
|
|
112
|
+
...TEXT_SEED_DATA,
|
|
113
|
+
props: {
|
|
114
|
+
// NOTE - Keeping the props commented until we figure out a way to use this props from draftbit side.
|
|
115
|
+
// strong: createBoolProp({
|
|
116
|
+
// label: "Strong",
|
|
117
|
+
// description: "Strong",
|
|
118
|
+
// }),
|
|
119
|
+
// strike: createBoolProp({
|
|
120
|
+
// label: "Strike",
|
|
121
|
+
// description: "Strike through",
|
|
122
|
+
// }),
|
|
123
|
+
// italic: createBoolProp({
|
|
124
|
+
// label: "Italic",
|
|
125
|
+
// description: "Italic Fonts",
|
|
126
|
+
// }),
|
|
127
|
+
// bold: createBoolProp({
|
|
128
|
+
// label: "Bold",
|
|
129
|
+
// description: "Bold",
|
|
130
|
+
// }),
|
|
131
|
+
}
|
|
132
|
+
}, {
|
|
133
|
+
name: "Code",
|
|
134
|
+
tag: "Code",
|
|
135
|
+
...TEXT_SEED_DATA
|
|
136
|
+
}, {
|
|
137
|
+
name: "Pre",
|
|
138
|
+
tag: "Pre",
|
|
139
|
+
...TEXT_SEED_DATA
|
|
140
|
+
}, {
|
|
141
|
+
name: "Mark",
|
|
142
|
+
tag: "Mark",
|
|
143
|
+
...TEXT_SEED_DATA
|
|
144
|
+
}, {
|
|
145
|
+
name: "BR",
|
|
146
|
+
tag: "BR",
|
|
147
|
+
...TEXT_SEED_DATA
|
|
148
|
+
}, {
|
|
149
|
+
name: "BlockQuote",
|
|
150
|
+
tag: "BlockQuote",
|
|
151
|
+
...TEXT_SEED_DATA
|
|
152
|
+
}, {
|
|
153
|
+
name: "HR",
|
|
154
|
+
tag: "HR",
|
|
155
|
+
...TEXT_SEED_DATA
|
|
156
|
+
}, {
|
|
157
|
+
name: "Time",
|
|
158
|
+
tag: "Time",
|
|
159
|
+
...ELEMENT_SEED_DATA
|
|
160
|
+
}, {
|
|
161
|
+
name: "UL",
|
|
162
|
+
tag: "UL",
|
|
163
|
+
...ELEMENT_SEED_DATA
|
|
164
|
+
}, {
|
|
165
|
+
name: "LI",
|
|
166
|
+
tag: "LI",
|
|
167
|
+
...ELEMENT_SEED_DATA
|
|
168
|
+
}];
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
export declare const SEED_DATA: ({
|
|
2
|
+
props: {
|
|
3
|
+
href: any;
|
|
4
|
+
target: {
|
|
5
|
+
group: string;
|
|
6
|
+
label: string;
|
|
7
|
+
description: string;
|
|
8
|
+
formType: string;
|
|
9
|
+
defaultValue: string;
|
|
10
|
+
options: string[];
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
category: string;
|
|
14
|
+
doc_link: string;
|
|
15
|
+
code_link: string;
|
|
16
|
+
packageName: string;
|
|
17
|
+
stylesPanelSections: string[];
|
|
18
|
+
layout: {
|
|
19
|
+
margin: number;
|
|
20
|
+
};
|
|
21
|
+
name: string;
|
|
22
|
+
tag: string;
|
|
23
|
+
} | {
|
|
24
|
+
props: {
|
|
25
|
+
href?: undefined;
|
|
26
|
+
target?: undefined;
|
|
27
|
+
};
|
|
28
|
+
category: string;
|
|
29
|
+
doc_link: string;
|
|
30
|
+
code_link: string;
|
|
31
|
+
packageName: string;
|
|
32
|
+
stylesPanelSections: string[];
|
|
33
|
+
layout: {
|
|
34
|
+
margin: number;
|
|
35
|
+
};
|
|
36
|
+
name: string;
|
|
37
|
+
tag: string;
|
|
38
|
+
} | {
|
|
39
|
+
category: string;
|
|
40
|
+
props: {
|
|
41
|
+
children: {
|
|
42
|
+
group: string;
|
|
43
|
+
label: string;
|
|
44
|
+
description: string;
|
|
45
|
+
defaultValue: string;
|
|
46
|
+
editable: boolean;
|
|
47
|
+
required: boolean;
|
|
48
|
+
formType: string;
|
|
49
|
+
propType: string;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
doc_link: string;
|
|
53
|
+
code_link: string;
|
|
54
|
+
packageName: string;
|
|
55
|
+
stylesPanelSections: string[];
|
|
56
|
+
layout: {
|
|
57
|
+
margin: number;
|
|
58
|
+
};
|
|
59
|
+
name: string;
|
|
60
|
+
tag: string;
|
|
61
|
+
} | {
|
|
62
|
+
doc_link: string;
|
|
63
|
+
code_link: string;
|
|
64
|
+
packageName: string;
|
|
65
|
+
stylesPanelSections: string[];
|
|
66
|
+
layout: {
|
|
67
|
+
margin: number;
|
|
68
|
+
};
|
|
69
|
+
category: string;
|
|
70
|
+
name: string;
|
|
71
|
+
tag: string;
|
|
72
|
+
})[];
|
|
73
|
+
//# sourceMappingURL=HtmlElements.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HtmlElements.d.ts","sourceRoot":"","sources":["../../../../src/mappings/HtmlElements.ts"],"names":[],"mappings":"AAmFA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAwHrB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@draftbit/core",
|
|
3
|
-
"version": "46.8.
|
|
3
|
+
"version": "46.8.2-feb14e.2+feb14e8",
|
|
4
4
|
"description": "Core (non-native) Components",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -41,7 +41,8 @@
|
|
|
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.
|
|
44
|
+
"@draftbit/types": "^46.8.2-feb14e.2+feb14e8",
|
|
45
|
+
"@expo/html-elements": "^0.3.1",
|
|
45
46
|
"@material-ui/core": "^4.11.0",
|
|
46
47
|
"@material-ui/pickers": "^3.2.10",
|
|
47
48
|
"@react-native-community/slider": "4.2.3",
|
|
@@ -92,5 +93,5 @@
|
|
|
92
93
|
]
|
|
93
94
|
]
|
|
94
95
|
},
|
|
95
|
-
"gitHead": "
|
|
96
|
+
"gitHead": "feb14e87ddf0b82ca481143102a4c2d37989dbc9"
|
|
96
97
|
}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import { COMPONENT_TYPES, createTextProp, FORM_TYPES, PROP_TYPES, GROUPS, StylesPanelSections, } 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: [
|
|
7
|
+
StylesPanelSections.Typography,
|
|
8
|
+
StylesPanelSections.LayoutSelectedItem,
|
|
9
|
+
StylesPanelSections.MarginsAndPaddings,
|
|
10
|
+
StylesPanelSections.Effects,
|
|
11
|
+
],
|
|
12
|
+
layout: {
|
|
13
|
+
margin: 0,
|
|
14
|
+
},
|
|
15
|
+
category: COMPONENT_TYPES.webelement,
|
|
16
|
+
};
|
|
17
|
+
const HEADING_SEED_DATA = {
|
|
18
|
+
...ELEMENT_SEED_DATA,
|
|
19
|
+
category: COMPONENT_TYPES.text,
|
|
20
|
+
props: {
|
|
21
|
+
accessibilityLabel: {
|
|
22
|
+
group: GROUPS.accessibility,
|
|
23
|
+
name: "accessibilityLabel",
|
|
24
|
+
label: "accessibilityLabel",
|
|
25
|
+
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.",
|
|
26
|
+
editable: true,
|
|
27
|
+
required: false,
|
|
28
|
+
formType: FORM_TYPES.string,
|
|
29
|
+
propType: PROP_TYPES.STRING,
|
|
30
|
+
defaultValue: null,
|
|
31
|
+
},
|
|
32
|
+
selectable: {
|
|
33
|
+
group: GROUPS.advanced,
|
|
34
|
+
name: "selectable",
|
|
35
|
+
label: "selectable",
|
|
36
|
+
description: "Lets the user select text, to use the native copy and paste functionality.",
|
|
37
|
+
editable: true,
|
|
38
|
+
required: false,
|
|
39
|
+
formType: FORM_TYPES.boolean,
|
|
40
|
+
propType: PROP_TYPES.BOOLEAN,
|
|
41
|
+
defaultValue: null,
|
|
42
|
+
},
|
|
43
|
+
children: {
|
|
44
|
+
group: GROUPS.data,
|
|
45
|
+
label: "Text",
|
|
46
|
+
description: "Text",
|
|
47
|
+
editable: true,
|
|
48
|
+
required: true,
|
|
49
|
+
formType: FORM_TYPES.string,
|
|
50
|
+
propType: PROP_TYPES.STRING,
|
|
51
|
+
defaultValue: "Your Headline Here",
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
const TEXT_SEED_DATA = {
|
|
56
|
+
...ELEMENT_SEED_DATA,
|
|
57
|
+
category: COMPONENT_TYPES.text,
|
|
58
|
+
props: {
|
|
59
|
+
children: {
|
|
60
|
+
group: GROUPS.data,
|
|
61
|
+
label: "Text",
|
|
62
|
+
description: "Text",
|
|
63
|
+
defaultValue: "Your Text Here",
|
|
64
|
+
editable: true,
|
|
65
|
+
required: true,
|
|
66
|
+
formType: FORM_TYPES.string,
|
|
67
|
+
propType: PROP_TYPES.STRING,
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
export const SEED_DATA = [
|
|
72
|
+
{
|
|
73
|
+
name: "H1",
|
|
74
|
+
tag: "H1",
|
|
75
|
+
...HEADING_SEED_DATA,
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
name: "H2",
|
|
79
|
+
tag: "H2",
|
|
80
|
+
...HEADING_SEED_DATA,
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
name: "H3",
|
|
84
|
+
tag: "H3",
|
|
85
|
+
...HEADING_SEED_DATA,
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
name: "H4",
|
|
89
|
+
tag: "H4",
|
|
90
|
+
...HEADING_SEED_DATA,
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
name: "H5",
|
|
94
|
+
tag: "H5",
|
|
95
|
+
...HEADING_SEED_DATA,
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
name: "H6",
|
|
99
|
+
tag: "H6",
|
|
100
|
+
...HEADING_SEED_DATA,
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
name: "Anchor",
|
|
104
|
+
tag: "A",
|
|
105
|
+
...TEXT_SEED_DATA,
|
|
106
|
+
props: {
|
|
107
|
+
href: createTextProp({
|
|
108
|
+
label: "href",
|
|
109
|
+
description: "Specify the URL",
|
|
110
|
+
defaultValue: "",
|
|
111
|
+
}),
|
|
112
|
+
target: {
|
|
113
|
+
group: GROUPS.basic,
|
|
114
|
+
label: "target",
|
|
115
|
+
description: "decide where link should open",
|
|
116
|
+
formType: FORM_TYPES.flatArray,
|
|
117
|
+
defaultValue: "_blank",
|
|
118
|
+
options: ["_blank", "_self", "_parent", "_top"],
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
name: "Paragraph",
|
|
124
|
+
tag: "P",
|
|
125
|
+
...TEXT_SEED_DATA,
|
|
126
|
+
props: {
|
|
127
|
+
// NOTE - Keeping the props commented until we figure out a way to use this props from draftbit side.
|
|
128
|
+
// strong: createBoolProp({
|
|
129
|
+
// label: "Strong",
|
|
130
|
+
// description: "Strong",
|
|
131
|
+
// }),
|
|
132
|
+
// strike: createBoolProp({
|
|
133
|
+
// label: "Strike",
|
|
134
|
+
// description: "Strike through",
|
|
135
|
+
// }),
|
|
136
|
+
// italic: createBoolProp({
|
|
137
|
+
// label: "Italic",
|
|
138
|
+
// description: "Italic Fonts",
|
|
139
|
+
// }),
|
|
140
|
+
// bold: createBoolProp({
|
|
141
|
+
// label: "Bold",
|
|
142
|
+
// description: "Bold",
|
|
143
|
+
// }),
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
name: "Code",
|
|
148
|
+
tag: "Code",
|
|
149
|
+
...TEXT_SEED_DATA,
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
name: "Pre",
|
|
153
|
+
tag: "Pre",
|
|
154
|
+
...TEXT_SEED_DATA,
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
name: "Mark",
|
|
158
|
+
tag: "Mark",
|
|
159
|
+
...TEXT_SEED_DATA,
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
name: "BR",
|
|
163
|
+
tag: "BR",
|
|
164
|
+
...TEXT_SEED_DATA,
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
name: "BlockQuote",
|
|
168
|
+
tag: "BlockQuote",
|
|
169
|
+
...TEXT_SEED_DATA,
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
name: "HR",
|
|
173
|
+
tag: "HR",
|
|
174
|
+
...TEXT_SEED_DATA,
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
name: "Time",
|
|
178
|
+
tag: "Time",
|
|
179
|
+
...ELEMENT_SEED_DATA,
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
name: "UL",
|
|
183
|
+
tag: "UL",
|
|
184
|
+
...ELEMENT_SEED_DATA,
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
name: "LI",
|
|
188
|
+
tag: "LI",
|
|
189
|
+
...ELEMENT_SEED_DATA,
|
|
190
|
+
},
|
|
191
|
+
];
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import {
|
|
2
|
+
COMPONENT_TYPES,
|
|
3
|
+
createTextProp,
|
|
4
|
+
FORM_TYPES,
|
|
5
|
+
PROP_TYPES,
|
|
6
|
+
GROUPS,
|
|
7
|
+
StylesPanelSections,
|
|
8
|
+
} from "@draftbit/types";
|
|
9
|
+
|
|
10
|
+
const ELEMENT_SEED_DATA = {
|
|
11
|
+
doc_link: "https://www.npmjs.com/package/@expo/html-elements",
|
|
12
|
+
code_link: "https://github.com/expo/expo/tree/master/packages/html-elements",
|
|
13
|
+
packageName: "@expo/html-elements",
|
|
14
|
+
stylesPanelSections: [
|
|
15
|
+
StylesPanelSections.Typography,
|
|
16
|
+
StylesPanelSections.LayoutSelectedItem,
|
|
17
|
+
StylesPanelSections.MarginsAndPaddings,
|
|
18
|
+
StylesPanelSections.Effects,
|
|
19
|
+
],
|
|
20
|
+
layout: {
|
|
21
|
+
margin: 0,
|
|
22
|
+
},
|
|
23
|
+
category: COMPONENT_TYPES.webelement,
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const HEADING_SEED_DATA = {
|
|
27
|
+
...ELEMENT_SEED_DATA,
|
|
28
|
+
category: COMPONENT_TYPES.text,
|
|
29
|
+
props: {
|
|
30
|
+
accessibilityLabel: {
|
|
31
|
+
group: GROUPS.accessibility,
|
|
32
|
+
name: "accessibilityLabel",
|
|
33
|
+
label: "accessibilityLabel",
|
|
34
|
+
description:
|
|
35
|
+
"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.",
|
|
36
|
+
editable: true,
|
|
37
|
+
required: false,
|
|
38
|
+
formType: FORM_TYPES.string,
|
|
39
|
+
propType: PROP_TYPES.STRING,
|
|
40
|
+
defaultValue: null,
|
|
41
|
+
},
|
|
42
|
+
selectable: {
|
|
43
|
+
group: GROUPS.advanced,
|
|
44
|
+
name: "selectable",
|
|
45
|
+
label: "selectable",
|
|
46
|
+
description:
|
|
47
|
+
"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: null,
|
|
53
|
+
},
|
|
54
|
+
children: {
|
|
55
|
+
group: GROUPS.data,
|
|
56
|
+
label: "Text",
|
|
57
|
+
description: "Text",
|
|
58
|
+
editable: true,
|
|
59
|
+
required: true,
|
|
60
|
+
formType: FORM_TYPES.string,
|
|
61
|
+
propType: PROP_TYPES.STRING,
|
|
62
|
+
defaultValue: "Your Headline Here",
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
const TEXT_SEED_DATA = {
|
|
68
|
+
...ELEMENT_SEED_DATA,
|
|
69
|
+
category: COMPONENT_TYPES.text,
|
|
70
|
+
props: {
|
|
71
|
+
children: {
|
|
72
|
+
group: GROUPS.data,
|
|
73
|
+
label: "Text",
|
|
74
|
+
description: "Text",
|
|
75
|
+
defaultValue: "Your Text Here",
|
|
76
|
+
editable: true,
|
|
77
|
+
required: true,
|
|
78
|
+
formType: FORM_TYPES.string,
|
|
79
|
+
propType: PROP_TYPES.STRING,
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
export const SEED_DATA = [
|
|
85
|
+
{
|
|
86
|
+
name: "H1",
|
|
87
|
+
tag: "H1",
|
|
88
|
+
...HEADING_SEED_DATA,
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
name: "H2",
|
|
92
|
+
tag: "H2",
|
|
93
|
+
...HEADING_SEED_DATA,
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
name: "H3",
|
|
97
|
+
tag: "H3",
|
|
98
|
+
...HEADING_SEED_DATA,
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
name: "H4",
|
|
102
|
+
tag: "H4",
|
|
103
|
+
...HEADING_SEED_DATA,
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
name: "H5",
|
|
107
|
+
tag: "H5",
|
|
108
|
+
...HEADING_SEED_DATA,
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
name: "H6",
|
|
112
|
+
tag: "H6",
|
|
113
|
+
...HEADING_SEED_DATA,
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
name: "Anchor",
|
|
117
|
+
tag: "A",
|
|
118
|
+
...TEXT_SEED_DATA,
|
|
119
|
+
props: {
|
|
120
|
+
href: createTextProp({
|
|
121
|
+
label: "href",
|
|
122
|
+
description: "Specify the URL",
|
|
123
|
+
defaultValue: "",
|
|
124
|
+
}),
|
|
125
|
+
target: {
|
|
126
|
+
group: GROUPS.basic,
|
|
127
|
+
label: "target",
|
|
128
|
+
description: "decide where link should open",
|
|
129
|
+
formType: FORM_TYPES.flatArray,
|
|
130
|
+
defaultValue: "_blank",
|
|
131
|
+
options: ["_blank", "_self", "_parent", "_top"],
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
name: "Paragraph",
|
|
137
|
+
tag: "P",
|
|
138
|
+
...TEXT_SEED_DATA,
|
|
139
|
+
props: {
|
|
140
|
+
// NOTE - Keeping the props commented until we figure out a way to use this props from draftbit side.
|
|
141
|
+
// strong: createBoolProp({
|
|
142
|
+
// label: "Strong",
|
|
143
|
+
// description: "Strong",
|
|
144
|
+
// }),
|
|
145
|
+
// strike: createBoolProp({
|
|
146
|
+
// label: "Strike",
|
|
147
|
+
// description: "Strike through",
|
|
148
|
+
// }),
|
|
149
|
+
// italic: createBoolProp({
|
|
150
|
+
// label: "Italic",
|
|
151
|
+
// description: "Italic Fonts",
|
|
152
|
+
// }),
|
|
153
|
+
// bold: createBoolProp({
|
|
154
|
+
// label: "Bold",
|
|
155
|
+
// description: "Bold",
|
|
156
|
+
// }),
|
|
157
|
+
},
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
name: "Code",
|
|
161
|
+
tag: "Code",
|
|
162
|
+
...TEXT_SEED_DATA,
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
name: "Pre",
|
|
166
|
+
tag: "Pre",
|
|
167
|
+
...TEXT_SEED_DATA,
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
name: "Mark",
|
|
171
|
+
tag: "Mark",
|
|
172
|
+
...TEXT_SEED_DATA,
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
name: "BR",
|
|
176
|
+
tag: "BR",
|
|
177
|
+
...TEXT_SEED_DATA,
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
name: "BlockQuote",
|
|
181
|
+
tag: "BlockQuote",
|
|
182
|
+
...TEXT_SEED_DATA,
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
name: "HR",
|
|
186
|
+
tag: "HR",
|
|
187
|
+
...TEXT_SEED_DATA,
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
name: "Time",
|
|
191
|
+
tag: "Time",
|
|
192
|
+
...ELEMENT_SEED_DATA,
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
name: "UL",
|
|
196
|
+
tag: "UL",
|
|
197
|
+
...ELEMENT_SEED_DATA,
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
name: "LI",
|
|
201
|
+
tag: "LI",
|
|
202
|
+
...ELEMENT_SEED_DATA,
|
|
203
|
+
},
|
|
204
|
+
];
|