@draftbit/core 46.2.3 → 46.2.4-dedb7a.0

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.
@@ -1,183 +1,4 @@
1
1
  import { GROUPS, COMPONENT_TYPES, FORM_TYPES, PROP_TYPES, FIELD_NAME, Triggers, StylesPanelSections } from "@draftbit/types";
2
- const TEXT_INPUT_PROPS = {
3
- allowFontScaling: {
4
- group: GROUPS.advanced,
5
- label: "Allow Font Scaling",
6
- description: "Whether fonts should scale to respect Text Size in the user's accessibility settings. (Default: true)",
7
- editable: true,
8
- required: false,
9
- defaultValue: null,
10
- formType: FORM_TYPES.boolean,
11
- propType: PROP_TYPES.BOOLEAN
12
- },
13
- autoCapitalize: {
14
- group: GROUPS.advanced,
15
- label: "Auto Capitalize",
16
- description: "Can automatically capitalize sentences, words, and characters (Default: none).",
17
- editable: true,
18
- required: false,
19
- defaultValue: null,
20
- options: ["none", "sentences", "words", "characters"],
21
- formType: FORM_TYPES.flatArray,
22
- propType: PROP_TYPES.STRING
23
- },
24
- autoCorrect: {
25
- group: GROUPS.advanced,
26
- label: "Auto Correct",
27
- description: "Enables auto correction",
28
- editable: true,
29
- required: false,
30
- defaultValue: null,
31
- formType: FORM_TYPES.boolean,
32
- propType: PROP_TYPES.BOOLEAN
33
- },
34
- autoFocus: {
35
- group: GROUPS.basic,
36
- label: "Auto Focus",
37
- description: "Focuses the input on load in and brings up the keyboard",
38
- editable: true,
39
- required: false,
40
- defaultValue: null,
41
- formType: FORM_TYPES.boolean,
42
- propType: PROP_TYPES.BOOLEAN
43
- },
44
- caretHidden: {
45
- group: GROUPS.advanced,
46
- label: "Hide Caret",
47
- description: "Hides the caret(the line small line underneath each showing where you're editing/typing",
48
- editable: true,
49
- required: false,
50
- defaultValue: null,
51
- formType: FORM_TYPES.boolean,
52
- propType: PROP_TYPES.BOOLEAN
53
- },
54
- contextMenuHidden: {
55
- group: GROUPS.advanced,
56
- label: "Hide Context Menu",
57
- description: "Hides the system context menu (Default: false)",
58
- editable: true,
59
- required: false,
60
- defaultValue: null,
61
- formType: FORM_TYPES.boolean,
62
- propType: PROP_TYPES.BOOLEAN
63
- },
64
- editable: {
65
- group: GROUPS.advanced,
66
- label: "Editable",
67
- description: "If false, the text is not editable",
68
- editable: true,
69
- required: false,
70
- defaultValue: true,
71
- formType: FORM_TYPES.boolean,
72
- propType: PROP_TYPES.BOOLEAN
73
- },
74
- keyboardAppearance: {
75
- group: GROUPS.advanced,
76
- label: "Keyboard Appearance",
77
- description: "Determines the color of the keyboard.(iOS Only)",
78
- editable: true,
79
- required: false,
80
- defaultValue: null,
81
- options: ["default", "light", "dark"],
82
- formType: FORM_TYPES.flatArray,
83
- propType: PROP_TYPES.STRING
84
- },
85
- keyboardType: {
86
- group: GROUPS.advanced,
87
- label: "Keyboard Type",
88
- description: "Determines what keyboard is given to the user.",
89
- editable: true,
90
- required: false,
91
- defaultValue: null,
92
- options: ["default", "email-address", "numeric", "phone-pad", "ascii-capable", "numbers-and-punctuation", "url", "number-pad", "name-phone-pad", "decimal-pad", "twitter", "web-search", "visible-password"],
93
- formType: FORM_TYPES.flatArray,
94
- propType: PROP_TYPES.STRING
95
- },
96
- maxLength: {
97
- group: GROUPS.basic,
98
- label: "Max Length",
99
- description: "Limits the input to a set number of characters.",
100
- editable: true,
101
- required: false,
102
- defaultValue: null,
103
- min: 0,
104
- step: 1,
105
- precision: 0,
106
- formType: FORM_TYPES.number,
107
- propType: PROP_TYPES.NUMBER
108
- },
109
- placeholder: {
110
- group: GROUPS.data,
111
- label: "Placeholder Text",
112
- description: "The text that is shown on load when no value is available.",
113
- editable: true,
114
- required: false,
115
- defaultValue: "Enter a value...",
116
- formType: FORM_TYPES.string,
117
- propType: PROP_TYPES.STRING
118
- },
119
- placeholderTextColor: {
120
- group: GROUPS.basic,
121
- label: "Placeholder Text Color",
122
- description: "The color of the placeholder text.",
123
- editable: true,
124
- required: false,
125
- defaultValue: null,
126
- formType: FORM_TYPES.color,
127
- propType: PROP_TYPES.STRING
128
- },
129
- returnKeyLabel: {
130
- group: GROUPS.advanced,
131
- label: "Return Key Label",
132
- description: "(Android Only) Sets the label on the return key (use this instead of rewturnKeyType)",
133
- editable: true,
134
- required: false,
135
- defaultValue: null,
136
- formType: FORM_TYPES.string,
137
- propType: PROP_TYPES.STRING
138
- },
139
- returnKeyType: {
140
- group: GROUPS.advanced,
141
- label: "Return Key Type",
142
- description: "Determines how the return key should look like",
143
- editable: true,
144
- required: false,
145
- defaultValue: null,
146
- options: ["done", "go", "next", "search", "send", "none", "previous", "default", "emergency-call", "google", "join", "route", "yahoo"],
147
- formType: FORM_TYPES.flatArray,
148
- propType: PROP_TYPES.STRING
149
- },
150
- secureTextEntry: {
151
- group: GROUPS.basic,
152
- label: "Password Input?",
153
- description: "Hides the characters with a *, useful for passwords and other sensitive information.",
154
- editable: true,
155
- required: false,
156
- defaultValue: null,
157
- formType: FORM_TYPES.boolean,
158
- propType: PROP_TYPES.BOOLEAN
159
- },
160
- selectionColor: {
161
- group: GROUPS.advanced,
162
- label: "Selection Color",
163
- description: "Color of the highlighted portion when selecting.",
164
- editable: true,
165
- required: false,
166
- defaultValue: null,
167
- formType: FORM_TYPES.color,
168
- propType: PROP_TYPES.STRING
169
- },
170
- selectTextOnFocus: {
171
- group: GROUPS.advanced,
172
- label: "Select Text on Focus",
173
- description: "If true, all the text will automatically be selected on focus",
174
- editable: true,
175
- required: false,
176
- defaultValue: null,
177
- formType: FORM_TYPES.boolean,
178
- propType: PROP_TYPES.BOOLEAN
179
- }
180
- };
181
2
  export const SEED_DATA_PROPS = {
182
3
  style: {
183
4
  group: GROUPS.basic,
@@ -256,7 +77,184 @@ export const SEED_DATA = [{
256
77
  borderRadius: 8
257
78
  },
258
79
  triggers: [Triggers.OnChangeText],
259
- props: { ...TEXT_INPUT_PROPS,
80
+ props: {
81
+ allowFontScaling: {
82
+ group: GROUPS.advanced,
83
+ label: "Allow Font Scaling",
84
+ description: "Whether fonts should scale to respect Text Size in the user's accessibility settings. (Default: true)",
85
+ editable: true,
86
+ required: false,
87
+ defaultValue: null,
88
+ formType: FORM_TYPES.boolean,
89
+ propType: PROP_TYPES.BOOLEAN
90
+ },
91
+ autoCapitalize: {
92
+ group: GROUPS.advanced,
93
+ label: "Auto Capitalize",
94
+ description: "Can automatically capitalize sentences, words, and characters (Default: none).",
95
+ editable: true,
96
+ required: false,
97
+ defaultValue: null,
98
+ options: ["none", "sentences", "words", "characters"],
99
+ formType: FORM_TYPES.flatArray,
100
+ propType: PROP_TYPES.STRING
101
+ },
102
+ autoCorrect: {
103
+ group: GROUPS.advanced,
104
+ label: "Auto Correct",
105
+ description: "Enables auto correction",
106
+ editable: true,
107
+ required: false,
108
+ defaultValue: null,
109
+ formType: FORM_TYPES.boolean,
110
+ propType: PROP_TYPES.BOOLEAN
111
+ },
112
+ autoFocus: {
113
+ group: GROUPS.basic,
114
+ label: "Auto Focus",
115
+ description: "Focuses the input on load in and brings up the keyboard",
116
+ editable: true,
117
+ required: false,
118
+ defaultValue: null,
119
+ formType: FORM_TYPES.boolean,
120
+ propType: PROP_TYPES.BOOLEAN
121
+ },
122
+ caretHidden: {
123
+ group: GROUPS.advanced,
124
+ label: "Hide Caret",
125
+ description: "Hides the caret(the line small line underneath each showing where you're editing/typing",
126
+ editable: true,
127
+ required: false,
128
+ defaultValue: null,
129
+ formType: FORM_TYPES.boolean,
130
+ propType: PROP_TYPES.BOOLEAN
131
+ },
132
+ contextMenuHidden: {
133
+ group: GROUPS.advanced,
134
+ label: "Hide Context Menu",
135
+ description: "Hides the system context menu (Default: false)",
136
+ editable: true,
137
+ required: false,
138
+ defaultValue: null,
139
+ formType: FORM_TYPES.boolean,
140
+ propType: PROP_TYPES.BOOLEAN
141
+ },
142
+ editable: {
143
+ group: GROUPS.advanced,
144
+ label: "Editable",
145
+ description: "If false, the text is not editable",
146
+ editable: true,
147
+ required: false,
148
+ defaultValue: true,
149
+ formType: FORM_TYPES.boolean,
150
+ propType: PROP_TYPES.BOOLEAN
151
+ },
152
+ keyboardAppearance: {
153
+ group: GROUPS.advanced,
154
+ label: "Keyboard Appearance",
155
+ description: "Determines the color of the keyboard.(iOS Only)",
156
+ editable: true,
157
+ required: false,
158
+ defaultValue: null,
159
+ options: ["default", "light", "dark"],
160
+ formType: FORM_TYPES.flatArray,
161
+ propType: PROP_TYPES.STRING
162
+ },
163
+ keyboardType: {
164
+ group: GROUPS.advanced,
165
+ label: "Keyboard Type",
166
+ description: "Determines what keyboard is given to the user.",
167
+ editable: true,
168
+ required: false,
169
+ defaultValue: null,
170
+ options: ["default", "email-address", "numeric", "phone-pad", "ascii-capable", "numbers-and-punctuation", "url", "number-pad", "name-phone-pad", "decimal-pad", "twitter", "web-search", "visible-password"],
171
+ formType: FORM_TYPES.flatArray,
172
+ propType: PROP_TYPES.STRING
173
+ },
174
+ maxLength: {
175
+ group: GROUPS.basic,
176
+ label: "Max Length",
177
+ description: "Limits the input to a set number of characters.",
178
+ editable: true,
179
+ required: false,
180
+ defaultValue: null,
181
+ min: 0,
182
+ step: 1,
183
+ precision: 0,
184
+ formType: FORM_TYPES.number,
185
+ propType: PROP_TYPES.NUMBER
186
+ },
187
+ placeholder: {
188
+ group: GROUPS.data,
189
+ label: "Placeholder Text",
190
+ description: "The text that is shown on load when no value is available.",
191
+ editable: true,
192
+ required: false,
193
+ defaultValue: "Enter a value...",
194
+ formType: FORM_TYPES.string,
195
+ propType: PROP_TYPES.STRING
196
+ },
197
+ placeholderTextColor: {
198
+ group: GROUPS.basic,
199
+ label: "Placeholder Text Color",
200
+ description: "The color of the placeholder text.",
201
+ editable: true,
202
+ required: false,
203
+ defaultValue: null,
204
+ formType: FORM_TYPES.color,
205
+ propType: PROP_TYPES.STRING
206
+ },
207
+ returnKeyLabel: {
208
+ group: GROUPS.advanced,
209
+ label: "Return Key Label",
210
+ description: "(Android Only) Sets the label on the return key (use this instead of rewturnKeyType)",
211
+ editable: true,
212
+ required: false,
213
+ defaultValue: null,
214
+ formType: FORM_TYPES.string,
215
+ propType: PROP_TYPES.STRING
216
+ },
217
+ returnKeyType: {
218
+ group: GROUPS.advanced,
219
+ label: "Return Key Type",
220
+ description: "Determines how the return key should look like",
221
+ editable: true,
222
+ required: false,
223
+ defaultValue: null,
224
+ options: ["done", "go", "next", "search", "send", "none", "previous", "default", "emergency-call", "google", "join", "route", "yahoo"],
225
+ formType: FORM_TYPES.flatArray,
226
+ propType: PROP_TYPES.STRING
227
+ },
228
+ secureTextEntry: {
229
+ group: GROUPS.basic,
230
+ label: "Password Input?",
231
+ description: "Hides the characters with a *, useful for passwords and other sensitive information.",
232
+ editable: true,
233
+ required: false,
234
+ defaultValue: null,
235
+ formType: FORM_TYPES.boolean,
236
+ propType: PROP_TYPES.BOOLEAN
237
+ },
238
+ selectionColor: {
239
+ group: GROUPS.advanced,
240
+ label: "Selection Color",
241
+ description: "Color of the highlighted portion when selecting.",
242
+ editable: true,
243
+ required: false,
244
+ defaultValue: null,
245
+ formType: FORM_TYPES.color,
246
+ propType: PROP_TYPES.STRING
247
+ },
248
+ selectTextOnFocus: {
249
+ group: GROUPS.advanced,
250
+ label: "Select Text on Focus",
251
+ description: "If true, all the text will automatically be selected on focus",
252
+ editable: true,
253
+ required: false,
254
+ defaultValue: null,
255
+ formType: FORM_TYPES.boolean,
256
+ propType: PROP_TYPES.BOOLEAN
257
+ },
260
258
  ...SEED_DATA_PROPS,
261
259
  multiline: {
262
260
  group: GROUPS.basic,
@@ -17,48 +17,6 @@ export declare const SEED_DATA: {
17
17
  };
18
18
  triggers: string[];
19
19
  props: {
20
- placeholder: {
21
- defaultValue: string;
22
- group: string;
23
- label: string;
24
- description: string;
25
- editable: boolean;
26
- required: boolean;
27
- formType: string;
28
- propType: string;
29
- };
30
- multiline: {
31
- label: string;
32
- description: string;
33
- group: string;
34
- formType: string;
35
- propType: string;
36
- defaultValue: boolean;
37
- editable: boolean;
38
- required: boolean;
39
- };
40
- numberOfLines: {
41
- label: string;
42
- description: string;
43
- group: string;
44
- formType: string;
45
- propType: string;
46
- defaultValue: number;
47
- editable: boolean;
48
- required: boolean;
49
- };
50
- fieldName: {
51
- defaultValue: string;
52
- handlerPropName: string;
53
- group: string;
54
- label: string;
55
- description: string;
56
- formType: string;
57
- propType: string;
58
- valuePropName: string;
59
- editable: boolean;
60
- required: boolean;
61
- };
62
20
  allowFontScaling: {
63
21
  group: string;
64
22
  label: string;
@@ -165,6 +123,16 @@ export declare const SEED_DATA: {
165
123
  formType: string;
166
124
  propType: string;
167
125
  };
126
+ placeholder: {
127
+ group: string;
128
+ label: string;
129
+ description: string;
130
+ editable: boolean;
131
+ required: boolean;
132
+ defaultValue: string;
133
+ formType: string;
134
+ propType: string;
135
+ };
168
136
  placeholderTextColor: {
169
137
  group: string;
170
138
  label: string;
@@ -237,5 +205,37 @@ export declare const SEED_DATA: {
237
205
  formType: string;
238
206
  propType: string;
239
207
  };
208
+ multiline: {
209
+ label: string;
210
+ description: string;
211
+ group: string;
212
+ formType: string;
213
+ propType: string;
214
+ defaultValue: boolean;
215
+ editable: boolean;
216
+ required: boolean;
217
+ };
218
+ numberOfLines: {
219
+ label: string;
220
+ description: string;
221
+ group: string;
222
+ formType: string;
223
+ propType: string;
224
+ defaultValue: number;
225
+ editable: boolean;
226
+ required: boolean;
227
+ };
228
+ fieldName: {
229
+ defaultValue: string;
230
+ handlerPropName: string;
231
+ group: string;
232
+ label: string;
233
+ description: string;
234
+ formType: string;
235
+ propType: string;
236
+ valuePropName: string;
237
+ editable: boolean;
238
+ required: boolean;
239
+ };
240
240
  };
241
241
  };