@draftbit/core 46.9.1-0f1b60.2 → 46.9.1-1f5cbe.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/BottomSheet/BottomSheet.js +88 -0
- package/lib/commonjs/components/BottomSheet/BottomSheetComponent.js +480 -0
- package/lib/commonjs/components/BottomSheet/index.js +13 -0
- package/lib/commonjs/components/CircleImage.js +15 -1
- package/lib/commonjs/components/Container.js +4 -15
- package/lib/commonjs/constants.js +1 -1
- package/lib/commonjs/hooks.js +2 -1
- package/lib/commonjs/index.js +7 -0
- package/lib/commonjs/mappings/BottomSheet.js +74 -0
- package/lib/module/components/BottomSheet/BottomSheet.js +80 -0
- package/lib/module/components/BottomSheet/BottomSheetComponent.js +470 -0
- package/lib/module/components/BottomSheet/index.js +1 -0
- package/lib/module/index.js +1 -0
- package/lib/module/mappings/BottomSheet.js +67 -0
- package/lib/typescript/src/components/BottomSheet/BottomSheet.d.ts +20 -0
- package/lib/typescript/src/components/BottomSheet/BottomSheet.d.ts.map +1 -0
- package/lib/typescript/src/components/BottomSheet/BottomSheetComponent.d.ts +170 -0
- package/lib/typescript/src/components/BottomSheet/BottomSheetComponent.d.ts.map +1 -0
- package/lib/typescript/src/components/BottomSheet/index.d.ts +2 -0
- package/lib/typescript/src/components/BottomSheet/index.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/{HtmlElements.d.ts → BottomSheet.d.ts} +61 -51
- package/lib/typescript/src/mappings/BottomSheet.d.ts.map +1 -0
- package/package.json +5 -4
- package/src/components/BottomSheet/BottomSheet.js +56 -0
- package/src/components/BottomSheet/BottomSheet.tsx +120 -0
- package/src/components/BottomSheet/BottomSheetComponent.js +437 -0
- package/src/components/BottomSheet/BottomSheetComponent.tsx +895 -0
- package/src/components/BottomSheet/index.js +1 -0
- package/src/components/BottomSheet/index.ts +1 -0
- package/src/index.js +1 -0
- package/src/index.tsx +2 -0
- package/src/mappings/BottomSheet.js +64 -0
- package/src/mappings/BottomSheet.ts +78 -0
- package/lib/commonjs/mappings/HtmlElements.js +0 -160
- package/lib/module/mappings/HtmlElements.js +0 -153
- package/lib/typescript/src/mappings/HtmlElements.d.ts.map +0 -1
- package/src/mappings/HtmlElements.js +0 -180
- package/src/mappings/HtmlElements.ts +0 -194
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as BottomSheet } from "./BottomSheet";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as BottomSheet } from "./BottomSheet";
|
package/src/index.js
CHANGED
|
@@ -35,6 +35,7 @@ export { default as Shadow } from "./components/Shadow";
|
|
|
35
35
|
export { DeckSwiper, DeckSwiperCard } from "./components/DeckSwiper";
|
|
36
36
|
export { TabView, TabViewItem } from "./components/TabView";
|
|
37
37
|
export { default as Markdown } from "./components/Markdown";
|
|
38
|
+
export { BottomSheet } from "./components/BottomSheet";
|
|
38
39
|
/* Deprecated: Fix or Delete! */
|
|
39
40
|
export { default as DatePicker } from "./components/DatePicker/DatePicker";
|
|
40
41
|
export { default as Picker } from "./components/Picker/Picker";
|
package/src/index.tsx
CHANGED
|
@@ -58,6 +58,8 @@ export { DeckSwiper, DeckSwiperCard } from "./components/DeckSwiper";
|
|
|
58
58
|
export { TabView, TabViewItem } from "./components/TabView";
|
|
59
59
|
export { default as Markdown } from "./components/Markdown";
|
|
60
60
|
|
|
61
|
+
export { BottomSheet } from "./components/BottomSheet";
|
|
62
|
+
|
|
61
63
|
/* Deprecated: Fix or Delete! */
|
|
62
64
|
export { default as DatePicker } from "./components/DatePicker/DatePicker";
|
|
63
65
|
export { default as Picker } from "./components/Picker/Picker";
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { COMPONENT_TYPES, createStaticBoolProp, CONTAINER_COMPONENT_STYLES_SECTIONS, Triggers, createActionProp, createColorProp, createStaticNumberProp, createArrayProp, } from "@draftbit/types";
|
|
2
|
+
export const SEED_DATA = {
|
|
3
|
+
name: "Bottom Sheet",
|
|
4
|
+
tag: "BottomSheet",
|
|
5
|
+
description: "A draggable Bottom sheet that snaps to specific points. Renders children in ScrollView",
|
|
6
|
+
category: COMPONENT_TYPES.bottomsheet,
|
|
7
|
+
stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
8
|
+
layout: { paddingHorizontal: 16, paddingVertical: 10 },
|
|
9
|
+
triggers: [Triggers.OnSettle],
|
|
10
|
+
props: {
|
|
11
|
+
onSettle: createActionProp({
|
|
12
|
+
label: "On settle",
|
|
13
|
+
description: "Action to execute when sheet settles on a snap point",
|
|
14
|
+
}),
|
|
15
|
+
snapPoints: createArrayProp({
|
|
16
|
+
label: "Snap points",
|
|
17
|
+
description: "An array of numerical values (that represent distance from the top) where bottom sheet can snap to place. Accepts numbers and percentages (minimum 2 snap points)",
|
|
18
|
+
defaultValue: ["10%", "50%", "80%"],
|
|
19
|
+
}),
|
|
20
|
+
initialSnapIndex: createStaticNumberProp({
|
|
21
|
+
label: "Initial snap index",
|
|
22
|
+
description: "Index of the snap point to be used as the initial point",
|
|
23
|
+
defaultValue: 0,
|
|
24
|
+
required: false,
|
|
25
|
+
}),
|
|
26
|
+
showHandle: createStaticBoolProp({
|
|
27
|
+
label: "Show handle",
|
|
28
|
+
description: "Whether to show the top sheet handle or not",
|
|
29
|
+
defaultValue: true,
|
|
30
|
+
}),
|
|
31
|
+
handleColor: createColorProp({
|
|
32
|
+
label: "Handle color",
|
|
33
|
+
description: "Color of the top handle",
|
|
34
|
+
defaultValue: "divider",
|
|
35
|
+
}),
|
|
36
|
+
topBorderRadius: createStaticNumberProp({
|
|
37
|
+
label: "Top border radius",
|
|
38
|
+
description: "Border radius of top corners",
|
|
39
|
+
defaultValue: 20,
|
|
40
|
+
required: false,
|
|
41
|
+
}),
|
|
42
|
+
borderWidth: createStaticNumberProp({
|
|
43
|
+
label: "Border width",
|
|
44
|
+
description: "Width of bottom sheet borders",
|
|
45
|
+
defaultValue: 1,
|
|
46
|
+
required: false,
|
|
47
|
+
}),
|
|
48
|
+
borderColor: createColorProp({
|
|
49
|
+
label: "Border color",
|
|
50
|
+
description: "Color of bottom sheet borders",
|
|
51
|
+
defaultValue: "divider",
|
|
52
|
+
}),
|
|
53
|
+
showsVerticalScrollIndicator: createStaticBoolProp({
|
|
54
|
+
label: "Show Vertical Scroll Indicator",
|
|
55
|
+
description: "When true, shows a vertical scroll indicator. The default value is true.",
|
|
56
|
+
defaultValue: true,
|
|
57
|
+
}),
|
|
58
|
+
bounces: createStaticBoolProp({
|
|
59
|
+
label: "Bounce",
|
|
60
|
+
description: "When true, the scroll view bounces when it reaches the end of the content if the content is larger then the scroll view along the axis of the scroll direction.",
|
|
61
|
+
defaultValue: true,
|
|
62
|
+
}),
|
|
63
|
+
},
|
|
64
|
+
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import {
|
|
2
|
+
COMPONENT_TYPES,
|
|
3
|
+
createStaticBoolProp,
|
|
4
|
+
CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
5
|
+
Triggers,
|
|
6
|
+
createActionProp,
|
|
7
|
+
createColorProp,
|
|
8
|
+
createStaticNumberProp,
|
|
9
|
+
createArrayProp,
|
|
10
|
+
} from "@draftbit/types";
|
|
11
|
+
|
|
12
|
+
export const SEED_DATA = {
|
|
13
|
+
name: "Bottom Sheet",
|
|
14
|
+
tag: "BottomSheet",
|
|
15
|
+
description:
|
|
16
|
+
"A draggable Bottom sheet that snaps to specific points. Renders children in ScrollView",
|
|
17
|
+
category: COMPONENT_TYPES.bottomsheet,
|
|
18
|
+
stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
19
|
+
layout: { paddingHorizontal: 16, paddingVertical: 10 },
|
|
20
|
+
triggers: [Triggers.OnSettle],
|
|
21
|
+
props: {
|
|
22
|
+
onSettle: createActionProp({
|
|
23
|
+
label: "On settle",
|
|
24
|
+
description: "Action to execute when sheet settles on a snap point",
|
|
25
|
+
}),
|
|
26
|
+
snapPoints: createArrayProp({
|
|
27
|
+
label: "Snap points",
|
|
28
|
+
description:
|
|
29
|
+
"An array of numerical values (that represent distance from the top) where bottom sheet can snap to place. Accepts numbers and percentages (minimum 2 snap points)",
|
|
30
|
+
defaultValue: ["10%", "50%", "80%"],
|
|
31
|
+
}),
|
|
32
|
+
initialSnapIndex: createStaticNumberProp({
|
|
33
|
+
label: "Initial snap index",
|
|
34
|
+
description: "Index of the snap point to be used as the initial point",
|
|
35
|
+
defaultValue: 0,
|
|
36
|
+
required: false,
|
|
37
|
+
}),
|
|
38
|
+
showHandle: createStaticBoolProp({
|
|
39
|
+
label: "Show handle",
|
|
40
|
+
description: "Whether to show the top sheet handle or not",
|
|
41
|
+
defaultValue: true,
|
|
42
|
+
}),
|
|
43
|
+
handleColor: createColorProp({
|
|
44
|
+
label: "Handle color",
|
|
45
|
+
description: "Color of the top handle",
|
|
46
|
+
defaultValue: "divider",
|
|
47
|
+
}),
|
|
48
|
+
topBorderRadius: createStaticNumberProp({
|
|
49
|
+
label: "Top border radius",
|
|
50
|
+
description: "Border radius of top corners",
|
|
51
|
+
defaultValue: 20,
|
|
52
|
+
required: false,
|
|
53
|
+
}),
|
|
54
|
+
borderWidth: createStaticNumberProp({
|
|
55
|
+
label: "Border width",
|
|
56
|
+
description: "Width of bottom sheet borders",
|
|
57
|
+
defaultValue: 1,
|
|
58
|
+
required: false,
|
|
59
|
+
}),
|
|
60
|
+
borderColor: createColorProp({
|
|
61
|
+
label: "Border color",
|
|
62
|
+
description: "Color of bottom sheet borders",
|
|
63
|
+
defaultValue: "divider",
|
|
64
|
+
}),
|
|
65
|
+
showsVerticalScrollIndicator: createStaticBoolProp({
|
|
66
|
+
label: "Show Vertical Scroll Indicator",
|
|
67
|
+
description:
|
|
68
|
+
"When true, shows a vertical scroll indicator. The default value is true.",
|
|
69
|
+
defaultValue: true,
|
|
70
|
+
}),
|
|
71
|
+
bounces: createStaticBoolProp({
|
|
72
|
+
label: "Bounce",
|
|
73
|
+
description:
|
|
74
|
+
"When true, the scroll view bounces when it reaches the end of the content if the content is larger then the scroll view along the axis of the scroll direction.",
|
|
75
|
+
defaultValue: true,
|
|
76
|
+
}),
|
|
77
|
+
},
|
|
78
|
+
};
|
|
@@ -1,160 +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 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.BLOCK_STYLES_SECTIONS,
|
|
13
|
-
category: _types.COMPONENT_TYPES.webelement
|
|
14
|
-
};
|
|
15
|
-
const TEXT_SEED_DATA = {
|
|
16
|
-
...ELEMENT_SEED_DATA,
|
|
17
|
-
category: _types.COMPONENT_TYPES.text,
|
|
18
|
-
stylesPanelSections: [_types.StylesPanelSections.Typography, _types.StylesPanelSections.LayoutSelectedItem, _types.StylesPanelSections.MarginsAndPaddings, _types.StylesPanelSections.Effects],
|
|
19
|
-
layout: {
|
|
20
|
-
color: "strong"
|
|
21
|
-
},
|
|
22
|
-
props: {
|
|
23
|
-
children: {
|
|
24
|
-
group: _types.GROUPS.data,
|
|
25
|
-
label: "Text",
|
|
26
|
-
description: "Text",
|
|
27
|
-
defaultValue: "Double click me to edit 👀",
|
|
28
|
-
editable: true,
|
|
29
|
-
required: true,
|
|
30
|
-
formType: _types.FORM_TYPES.string,
|
|
31
|
-
propType: _types.PROP_TYPES.STRING
|
|
32
|
-
},
|
|
33
|
-
accessibilityLabel: {
|
|
34
|
-
group: _types.GROUPS.accessibility,
|
|
35
|
-
name: "accessibilityLabel",
|
|
36
|
-
label: "accessibilityLabel",
|
|
37
|
-
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.",
|
|
38
|
-
editable: true,
|
|
39
|
-
required: false,
|
|
40
|
-
formType: _types.FORM_TYPES.string,
|
|
41
|
-
propType: _types.PROP_TYPES.STRING,
|
|
42
|
-
defaultValue: null
|
|
43
|
-
},
|
|
44
|
-
selectable: {
|
|
45
|
-
group: _types.GROUPS.advanced,
|
|
46
|
-
name: "selectable",
|
|
47
|
-
label: "selectable",
|
|
48
|
-
description: "Lets the user select text, to use the native copy and paste functionality.",
|
|
49
|
-
editable: true,
|
|
50
|
-
required: false,
|
|
51
|
-
formType: _types.FORM_TYPES.boolean,
|
|
52
|
-
propType: _types.PROP_TYPES.BOOLEAN,
|
|
53
|
-
defaultValue: true
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
const SEED_DATA = [{
|
|
58
|
-
name: "Heading 1",
|
|
59
|
-
tag: "H1",
|
|
60
|
-
...TEXT_SEED_DATA
|
|
61
|
-
}, {
|
|
62
|
-
name: "Heading 2",
|
|
63
|
-
tag: "H2",
|
|
64
|
-
...TEXT_SEED_DATA
|
|
65
|
-
}, {
|
|
66
|
-
name: "Heading 3",
|
|
67
|
-
tag: "H3",
|
|
68
|
-
...TEXT_SEED_DATA
|
|
69
|
-
}, {
|
|
70
|
-
name: "Heading 4",
|
|
71
|
-
tag: "H4",
|
|
72
|
-
...TEXT_SEED_DATA
|
|
73
|
-
}, {
|
|
74
|
-
name: "Heading 5",
|
|
75
|
-
tag: "H5",
|
|
76
|
-
...TEXT_SEED_DATA
|
|
77
|
-
}, {
|
|
78
|
-
name: "Heading 6",
|
|
79
|
-
tag: "H6",
|
|
80
|
-
...TEXT_SEED_DATA
|
|
81
|
-
}, {
|
|
82
|
-
name: "Paragraph",
|
|
83
|
-
tag: "P",
|
|
84
|
-
...TEXT_SEED_DATA
|
|
85
|
-
}, {
|
|
86
|
-
name: "Bold",
|
|
87
|
-
tag: "B",
|
|
88
|
-
...TEXT_SEED_DATA
|
|
89
|
-
}, {
|
|
90
|
-
name: "Strikethrough",
|
|
91
|
-
tag: "S",
|
|
92
|
-
...TEXT_SEED_DATA
|
|
93
|
-
}, {
|
|
94
|
-
name: "Italic",
|
|
95
|
-
tag: "I",
|
|
96
|
-
...TEXT_SEED_DATA
|
|
97
|
-
}, {
|
|
98
|
-
name: "Code",
|
|
99
|
-
tag: "Code",
|
|
100
|
-
...TEXT_SEED_DATA
|
|
101
|
-
}, {
|
|
102
|
-
name: "Preformatted",
|
|
103
|
-
tag: "Pre",
|
|
104
|
-
...TEXT_SEED_DATA
|
|
105
|
-
}, {
|
|
106
|
-
name: "Mark",
|
|
107
|
-
tag: "Mark",
|
|
108
|
-
...TEXT_SEED_DATA
|
|
109
|
-
}, {
|
|
110
|
-
name: "Block Quote",
|
|
111
|
-
tag: "BlockQuote",
|
|
112
|
-
...TEXT_SEED_DATA
|
|
113
|
-
}, {
|
|
114
|
-
name: "Quoted",
|
|
115
|
-
tag: "Q",
|
|
116
|
-
...TEXT_SEED_DATA
|
|
117
|
-
}, {
|
|
118
|
-
name: "Time",
|
|
119
|
-
tag: "Time",
|
|
120
|
-
...TEXT_SEED_DATA
|
|
121
|
-
}, {
|
|
122
|
-
name: "Unordered List",
|
|
123
|
-
tag: "UL",
|
|
124
|
-
...ELEMENT_SEED_DATA
|
|
125
|
-
}, {
|
|
126
|
-
name: "List Item",
|
|
127
|
-
tag: "LI",
|
|
128
|
-
...TEXT_SEED_DATA,
|
|
129
|
-
category: _types.COMPONENT_TYPES.webelement
|
|
130
|
-
}, {
|
|
131
|
-
name: "Line Break",
|
|
132
|
-
tag: "BR",
|
|
133
|
-
...ELEMENT_SEED_DATA
|
|
134
|
-
}, {
|
|
135
|
-
name: "Horizontal Rule",
|
|
136
|
-
tag: "HR",
|
|
137
|
-
...ELEMENT_SEED_DATA
|
|
138
|
-
}, {
|
|
139
|
-
name: "Anchor",
|
|
140
|
-
tag: "A",
|
|
141
|
-
...TEXT_SEED_DATA,
|
|
142
|
-
props: {
|
|
143
|
-
...TEXT_SEED_DATA.props,
|
|
144
|
-
href: (0, _types.createTextProp)({
|
|
145
|
-
label: "href",
|
|
146
|
-
description: "Specify the URL",
|
|
147
|
-
defaultValue: ""
|
|
148
|
-
}),
|
|
149
|
-
target: {
|
|
150
|
-
group: _types.GROUPS.basic,
|
|
151
|
-
label: "target",
|
|
152
|
-
description: "decide where link should open",
|
|
153
|
-
formType: _types.FORM_TYPES.flatArray,
|
|
154
|
-
defaultValue: "_blank",
|
|
155
|
-
options: ["_blank", "_self", "_parent", "_top"]
|
|
156
|
-
}
|
|
157
|
-
},
|
|
158
|
-
category: _types.COMPONENT_TYPES.webelement
|
|
159
|
-
}];
|
|
160
|
-
exports.SEED_DATA = SEED_DATA;
|
|
@@ -1,153 +0,0 @@
|
|
|
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: [StylesPanelSections.Typography, StylesPanelSections.LayoutSelectedItem, StylesPanelSections.MarginsAndPaddings, StylesPanelSections.Effects],
|
|
13
|
-
layout: {
|
|
14
|
-
color: "strong"
|
|
15
|
-
},
|
|
16
|
-
props: {
|
|
17
|
-
children: {
|
|
18
|
-
group: GROUPS.data,
|
|
19
|
-
label: "Text",
|
|
20
|
-
description: "Text",
|
|
21
|
-
defaultValue: "Double click me to edit 👀",
|
|
22
|
-
editable: true,
|
|
23
|
-
required: true,
|
|
24
|
-
formType: FORM_TYPES.string,
|
|
25
|
-
propType: PROP_TYPES.STRING
|
|
26
|
-
},
|
|
27
|
-
accessibilityLabel: {
|
|
28
|
-
group: GROUPS.accessibility,
|
|
29
|
-
name: "accessibilityLabel",
|
|
30
|
-
label: "accessibilityLabel",
|
|
31
|
-
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.",
|
|
32
|
-
editable: true,
|
|
33
|
-
required: false,
|
|
34
|
-
formType: FORM_TYPES.string,
|
|
35
|
-
propType: PROP_TYPES.STRING,
|
|
36
|
-
defaultValue: null
|
|
37
|
-
},
|
|
38
|
-
selectable: {
|
|
39
|
-
group: GROUPS.advanced,
|
|
40
|
-
name: "selectable",
|
|
41
|
-
label: "selectable",
|
|
42
|
-
description: "Lets the user select text, to use the native copy and paste functionality.",
|
|
43
|
-
editable: true,
|
|
44
|
-
required: false,
|
|
45
|
-
formType: FORM_TYPES.boolean,
|
|
46
|
-
propType: PROP_TYPES.BOOLEAN,
|
|
47
|
-
defaultValue: true
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
export const SEED_DATA = [{
|
|
52
|
-
name: "Heading 1",
|
|
53
|
-
tag: "H1",
|
|
54
|
-
...TEXT_SEED_DATA
|
|
55
|
-
}, {
|
|
56
|
-
name: "Heading 2",
|
|
57
|
-
tag: "H2",
|
|
58
|
-
...TEXT_SEED_DATA
|
|
59
|
-
}, {
|
|
60
|
-
name: "Heading 3",
|
|
61
|
-
tag: "H3",
|
|
62
|
-
...TEXT_SEED_DATA
|
|
63
|
-
}, {
|
|
64
|
-
name: "Heading 4",
|
|
65
|
-
tag: "H4",
|
|
66
|
-
...TEXT_SEED_DATA
|
|
67
|
-
}, {
|
|
68
|
-
name: "Heading 5",
|
|
69
|
-
tag: "H5",
|
|
70
|
-
...TEXT_SEED_DATA
|
|
71
|
-
}, {
|
|
72
|
-
name: "Heading 6",
|
|
73
|
-
tag: "H6",
|
|
74
|
-
...TEXT_SEED_DATA
|
|
75
|
-
}, {
|
|
76
|
-
name: "Paragraph",
|
|
77
|
-
tag: "P",
|
|
78
|
-
...TEXT_SEED_DATA
|
|
79
|
-
}, {
|
|
80
|
-
name: "Bold",
|
|
81
|
-
tag: "B",
|
|
82
|
-
...TEXT_SEED_DATA
|
|
83
|
-
}, {
|
|
84
|
-
name: "Strikethrough",
|
|
85
|
-
tag: "S",
|
|
86
|
-
...TEXT_SEED_DATA
|
|
87
|
-
}, {
|
|
88
|
-
name: "Italic",
|
|
89
|
-
tag: "I",
|
|
90
|
-
...TEXT_SEED_DATA
|
|
91
|
-
}, {
|
|
92
|
-
name: "Code",
|
|
93
|
-
tag: "Code",
|
|
94
|
-
...TEXT_SEED_DATA
|
|
95
|
-
}, {
|
|
96
|
-
name: "Preformatted",
|
|
97
|
-
tag: "Pre",
|
|
98
|
-
...TEXT_SEED_DATA
|
|
99
|
-
}, {
|
|
100
|
-
name: "Mark",
|
|
101
|
-
tag: "Mark",
|
|
102
|
-
...TEXT_SEED_DATA
|
|
103
|
-
}, {
|
|
104
|
-
name: "Block Quote",
|
|
105
|
-
tag: "BlockQuote",
|
|
106
|
-
...TEXT_SEED_DATA
|
|
107
|
-
}, {
|
|
108
|
-
name: "Quoted",
|
|
109
|
-
tag: "Q",
|
|
110
|
-
...TEXT_SEED_DATA
|
|
111
|
-
}, {
|
|
112
|
-
name: "Time",
|
|
113
|
-
tag: "Time",
|
|
114
|
-
...TEXT_SEED_DATA
|
|
115
|
-
}, {
|
|
116
|
-
name: "Unordered List",
|
|
117
|
-
tag: "UL",
|
|
118
|
-
...ELEMENT_SEED_DATA
|
|
119
|
-
}, {
|
|
120
|
-
name: "List Item",
|
|
121
|
-
tag: "LI",
|
|
122
|
-
...TEXT_SEED_DATA,
|
|
123
|
-
category: COMPONENT_TYPES.webelement
|
|
124
|
-
}, {
|
|
125
|
-
name: "Line Break",
|
|
126
|
-
tag: "BR",
|
|
127
|
-
...ELEMENT_SEED_DATA
|
|
128
|
-
}, {
|
|
129
|
-
name: "Horizontal Rule",
|
|
130
|
-
tag: "HR",
|
|
131
|
-
...ELEMENT_SEED_DATA
|
|
132
|
-
}, {
|
|
133
|
-
name: "Anchor",
|
|
134
|
-
tag: "A",
|
|
135
|
-
...TEXT_SEED_DATA,
|
|
136
|
-
props: {
|
|
137
|
-
...TEXT_SEED_DATA.props,
|
|
138
|
-
href: createTextProp({
|
|
139
|
-
label: "href",
|
|
140
|
-
description: "Specify the URL",
|
|
141
|
-
defaultValue: ""
|
|
142
|
-
}),
|
|
143
|
-
target: {
|
|
144
|
-
group: GROUPS.basic,
|
|
145
|
-
label: "target",
|
|
146
|
-
description: "decide where link should open",
|
|
147
|
-
formType: FORM_TYPES.flatArray,
|
|
148
|
-
defaultValue: "_blank",
|
|
149
|
-
options: ["_blank", "_self", "_parent", "_top"]
|
|
150
|
-
}
|
|
151
|
-
},
|
|
152
|
-
category: COMPONENT_TYPES.webelement
|
|
153
|
-
}];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"HtmlElements.d.ts","sourceRoot":"","sources":["../../../../src/mappings/HtmlElements.ts"],"names":[],"mappings":"AAoEA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA6HrB,CAAC"}
|
|
@@ -1,180 +0,0 @@
|
|
|
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
|
-
];
|