@draftbit/core 46.2.4-d94d1a.0 → 46.2.4-e3db78.5

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.
Files changed (49) hide show
  1. package/lib/commonjs/components/Config.js +1 -0
  2. package/lib/commonjs/components/DeprecatedButton.js +4 -22
  3. package/lib/commonjs/components/Svg.js +48 -0
  4. package/lib/commonjs/index.js +8 -0
  5. package/lib/commonjs/mappings/Image.js +2 -2
  6. package/lib/commonjs/mappings/MapView.js +1 -0
  7. package/lib/commonjs/mappings/NumberInput.js +146 -149
  8. package/lib/commonjs/mappings/Svg.js +25 -0
  9. package/lib/commonjs/mappings/TextArea.js +188 -193
  10. package/lib/commonjs/mappings/TextField.js +3 -8
  11. package/lib/commonjs/mappings/TextInput.js +178 -180
  12. package/lib/module/components/Config.js +1 -0
  13. package/lib/module/components/Svg.js +31 -0
  14. package/lib/module/index.js +1 -0
  15. package/lib/module/mappings/Image.js +2 -2
  16. package/lib/module/mappings/MapView.js +1 -0
  17. package/lib/module/mappings/NumberInput.js +146 -149
  18. package/lib/module/mappings/Svg.js +16 -0
  19. package/lib/module/mappings/TextArea.js +188 -193
  20. package/lib/module/mappings/TextField.js +3 -8
  21. package/lib/module/mappings/TextInput.js +178 -180
  22. package/lib/typescript/src/components/Config.d.ts +1 -0
  23. package/lib/typescript/src/components/Svg.d.ts +8 -0
  24. package/lib/typescript/src/index.d.ts +1 -0
  25. package/lib/typescript/src/mappings/MapView.d.ts +1 -0
  26. package/lib/typescript/src/mappings/Svg.d.ts +24 -0
  27. package/lib/typescript/src/mappings/TextArea.d.ts +42 -42
  28. package/lib/typescript/src/mappings/TextField.d.ts +118 -118
  29. package/package.json +4 -3
  30. package/src/components/Config.js +1 -0
  31. package/src/components/Config.ts +1 -0
  32. package/src/components/Svg.js +13 -0
  33. package/src/components/Svg.tsx +35 -0
  34. package/src/index.js +1 -0
  35. package/src/index.tsx +1 -0
  36. package/src/mappings/Image.js +2 -2
  37. package/src/mappings/Image.ts +2 -2
  38. package/src/mappings/MapView.js +1 -0
  39. package/src/mappings/MapView.ts +1 -0
  40. package/src/mappings/NumberInput.js +160 -163
  41. package/src/mappings/NumberInput.ts +165 -168
  42. package/src/mappings/Svg.js +21 -0
  43. package/src/mappings/Svg.ts +26 -0
  44. package/src/mappings/TextArea.js +213 -220
  45. package/src/mappings/TextArea.ts +219 -227
  46. package/src/mappings/TextField.js +2 -9
  47. package/src/mappings/TextField.ts +3 -11
  48. package/src/mappings/TextInput.js +205 -208
  49. package/src/mappings/TextInput.ts +212 -215
@@ -48,79 +48,6 @@ export declare const SEED_DATA: ({
48
48
  editable: boolean;
49
49
  required: boolean;
50
50
  };
51
- label: {
52
- group: string;
53
- label: string;
54
- description: string;
55
- formType: string;
56
- propType: string;
57
- defaultValue: null;
58
- editable: boolean;
59
- required: boolean;
60
- };
61
- assistiveText: {
62
- group: string;
63
- label: string;
64
- description: string;
65
- formType: string;
66
- propType: string;
67
- defaultValue: null;
68
- editable: boolean;
69
- required: boolean;
70
- };
71
- error: {
72
- group: string;
73
- label: string;
74
- description: string;
75
- formType: string;
76
- propType: string;
77
- defaultValue: null;
78
- editable: boolean;
79
- required: boolean;
80
- };
81
- leftIconName: {
82
- group: string;
83
- label: string;
84
- description: string;
85
- formType: string;
86
- propType: string;
87
- defaultValue: null;
88
- editable: boolean;
89
- required: boolean;
90
- };
91
- leftIconMode: {
92
- group: string;
93
- label: string;
94
- description: string;
95
- formType: string;
96
- propType: string;
97
- defaultValue: null;
98
- options: string[];
99
- editable: boolean;
100
- required: boolean;
101
- };
102
- rightIconName: {
103
- group: string;
104
- label: string;
105
- description: string;
106
- formType: string;
107
- propType: string;
108
- defaultValue: null;
109
- editable: boolean;
110
- required: boolean;
111
- };
112
- fieldName: {
113
- handlerPropName: string;
114
- defaultValue: string;
115
- group: string;
116
- label: string;
117
- description: string;
118
- formType: string;
119
- propType: string;
120
- valuePropName: string;
121
- editable: boolean;
122
- required: boolean;
123
- };
124
51
  allowFontScaling: {
125
52
  group: string;
126
53
  label: string;
@@ -298,74 +225,58 @@ export declare const SEED_DATA: ({
298
225
  formType: string;
299
226
  propType: string;
300
227
  };
301
- };
302
- layout: {};
303
- stylesPanelSections?: undefined;
304
- } | {
305
- name: string;
306
- tag: string;
307
- description: string;
308
- category: string;
309
- stylesPanelSections: string[];
310
- preview_image_url: string;
311
- supports_list_render: boolean;
312
- triggers: string[];
313
- props: {
314
- placeholder: {
315
- defaultValue: string;
228
+ label: {
316
229
  group: string;
317
230
  label: string;
318
231
  description: string;
319
- editable: boolean;
320
- required: boolean;
321
232
  formType: string;
322
233
  propType: string;
234
+ defaultValue: null;
235
+ editable: boolean;
236
+ required: boolean;
323
237
  };
324
- type: {
238
+ assistiveText: {
239
+ group: string;
325
240
  label: string;
326
241
  description: string;
327
242
  formType: string;
328
243
  propType: string;
329
- defaultValue: string;
330
- options: string[];
244
+ defaultValue: null;
331
245
  editable: boolean;
332
246
  required: boolean;
333
- group: string;
334
247
  };
335
- multiline: {
248
+ error: {
249
+ group: string;
336
250
  label: string;
337
251
  description: string;
338
- group: string;
339
252
  formType: string;
340
253
  propType: string;
341
- defaultValue: boolean;
254
+ defaultValue: null;
342
255
  editable: boolean;
343
256
  required: boolean;
344
257
  };
345
- numberOfLines: {
258
+ leftIconName: {
259
+ group: string;
346
260
  label: string;
347
261
  description: string;
348
262
  formType: string;
349
263
  propType: string;
350
- group: string;
351
264
  defaultValue: null;
352
265
  editable: boolean;
353
266
  required: boolean;
354
- step: number;
355
267
  };
356
- fieldName: {
357
- handlerPropName: string;
268
+ leftIconMode: {
358
269
  group: string;
359
270
  label: string;
360
271
  description: string;
361
272
  formType: string;
362
273
  propType: string;
363
- defaultValue: string;
364
- valuePropName: string;
274
+ defaultValue: null;
275
+ options: string[];
365
276
  editable: boolean;
366
277
  required: boolean;
367
278
  };
368
- label: {
279
+ rightIconName: {
369
280
  group: string;
370
281
  label: string;
371
282
  description: string;
@@ -375,54 +286,72 @@ export declare const SEED_DATA: ({
375
286
  editable: boolean;
376
287
  required: boolean;
377
288
  };
378
- assistiveText: {
289
+ fieldName: {
290
+ handlerPropName: string;
291
+ defaultValue: string;
379
292
  group: string;
380
293
  label: string;
381
294
  description: string;
382
295
  formType: string;
383
296
  propType: string;
384
- defaultValue: null;
297
+ valuePropName: string;
385
298
  editable: boolean;
386
299
  required: boolean;
387
300
  };
388
- error: {
389
- group: string;
301
+ };
302
+ layout: {};
303
+ stylesPanelSections?: undefined;
304
+ } | {
305
+ name: string;
306
+ tag: string;
307
+ description: string;
308
+ category: string;
309
+ stylesPanelSections: string[];
310
+ preview_image_url: string;
311
+ supports_list_render: boolean;
312
+ triggers: string[];
313
+ props: {
314
+ type: {
390
315
  label: string;
391
316
  description: string;
392
317
  formType: string;
393
318
  propType: string;
394
- defaultValue: null;
319
+ defaultValue: string;
320
+ options: string[];
395
321
  editable: boolean;
396
322
  required: boolean;
397
- };
398
- leftIconName: {
399
323
  group: string;
324
+ };
325
+ multiline: {
400
326
  label: string;
401
327
  description: string;
328
+ group: string;
402
329
  formType: string;
403
330
  propType: string;
404
- defaultValue: null;
331
+ defaultValue: boolean;
405
332
  editable: boolean;
406
333
  required: boolean;
407
334
  };
408
- leftIconMode: {
409
- group: string;
335
+ numberOfLines: {
410
336
  label: string;
411
337
  description: string;
412
338
  formType: string;
413
339
  propType: string;
340
+ group: string;
414
341
  defaultValue: null;
415
- options: string[];
416
342
  editable: boolean;
417
343
  required: boolean;
344
+ step: number;
418
345
  };
419
- rightIconName: {
346
+ fieldName: {
347
+ handlerPropName: string;
420
348
  group: string;
421
349
  label: string;
422
350
  description: string;
423
351
  formType: string;
424
352
  propType: string;
425
- defaultValue: null;
353
+ defaultValue: string;
354
+ valuePropName: string;
426
355
  editable: boolean;
427
356
  required: boolean;
428
357
  };
@@ -542,6 +471,16 @@ export declare const SEED_DATA: ({
542
471
  formType: string;
543
472
  propType: string;
544
473
  };
474
+ placeholder: {
475
+ group: string;
476
+ label: string;
477
+ description: string;
478
+ editable: boolean;
479
+ required: boolean;
480
+ defaultValue: string;
481
+ formType: string;
482
+ propType: string;
483
+ };
545
484
  placeholderTextColor: {
546
485
  group: string;
547
486
  label: string;
@@ -603,6 +542,67 @@ export declare const SEED_DATA: ({
603
542
  formType: string;
604
543
  propType: string;
605
544
  };
545
+ label: {
546
+ group: string;
547
+ label: string;
548
+ description: string;
549
+ formType: string;
550
+ propType: string;
551
+ defaultValue: null;
552
+ editable: boolean;
553
+ required: boolean;
554
+ };
555
+ assistiveText: {
556
+ group: string;
557
+ label: string;
558
+ description: string;
559
+ formType: string;
560
+ propType: string;
561
+ defaultValue: null;
562
+ editable: boolean;
563
+ required: boolean;
564
+ };
565
+ error: {
566
+ group: string;
567
+ label: string;
568
+ description: string;
569
+ formType: string;
570
+ propType: string;
571
+ defaultValue: null;
572
+ editable: boolean;
573
+ required: boolean;
574
+ };
575
+ leftIconName: {
576
+ group: string;
577
+ label: string;
578
+ description: string;
579
+ formType: string;
580
+ propType: string;
581
+ defaultValue: null;
582
+ editable: boolean;
583
+ required: boolean;
584
+ };
585
+ leftIconMode: {
586
+ group: string;
587
+ label: string;
588
+ description: string;
589
+ formType: string;
590
+ propType: string;
591
+ defaultValue: null;
592
+ options: string[];
593
+ editable: boolean;
594
+ required: boolean;
595
+ };
596
+ rightIconName: {
597
+ group: string;
598
+ label: string;
599
+ description: string;
600
+ formType: string;
601
+ propType: string;
602
+ defaultValue: null;
603
+ editable: boolean;
604
+ required: boolean;
605
+ };
606
606
  };
607
607
  layout: {};
608
608
  })[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@draftbit/core",
3
- "version": "46.2.4-d94d1a.0+d94d1a55",
3
+ "version": "46.2.4-e3db78.5+e3db789a",
4
4
  "description": "Core (non-native) Components",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",
@@ -41,7 +41,7 @@
41
41
  "dependencies": {
42
42
  "@date-io/date-fns": "^1.3.13",
43
43
  "@draftbit/react-theme-provider": "^2.1.1",
44
- "@draftbit/types": "^46.2.3",
44
+ "@draftbit/types": "^46.2.4-e3db78.5+e3db789a",
45
45
  "@material-ui/core": "^4.11.0",
46
46
  "@material-ui/pickers": "^3.2.10",
47
47
  "@react-native-community/slider": "4.2.3",
@@ -53,6 +53,7 @@
53
53
  "lodash.omit": "^4.5.0",
54
54
  "lodash.tonumber": "^4.0.3",
55
55
  "react-native-modal-datetime-picker": "^13.0.0",
56
+ "react-native-svg": "^12.3.0",
56
57
  "react-native-typography": "^1.4.1",
57
58
  "react-native-web-swiper": "^2.2.3"
58
59
  },
@@ -79,5 +80,5 @@
79
80
  ]
80
81
  ]
81
82
  },
82
- "gitHead": "d94d1a55b219bfcdb12682c4d2bcf3358fcc1b61"
83
+ "gitHead": "e3db789ac42b782e3844b6d6cf60a61735f020a7"
83
84
  }
@@ -42,6 +42,7 @@ export default {
42
42
  cardIconElevation: 1,
43
43
  placeholderImageURL: "https://static.draftbit.com/images/placeholder-image" + getExtension(),
44
44
  getPlaceholderImageUrl: (size) => buildImageUrl({ width: size.width, height: size.height }, "image-placeholder_1"),
45
+ placeholderSvgURL: "https://static.draftbit.com/images/placeholder-image.svg",
45
46
  squareImageUrl: buildImageUrl({ width: 100, height: 100 }, "Avatar"),
46
47
  FABSize: 40,
47
48
  FABBorderRadius: 20,
@@ -60,6 +60,7 @@ export default {
60
60
  { width: size.width, height: size.height },
61
61
  "image-placeholder_1"
62
62
  ),
63
+ placeholderSvgURL: "https://static.draftbit.com/images/placeholder-image.svg",
63
64
  squareImageUrl: buildImageUrl({ width: 100, height: 100 }, "Avatar"),
64
65
  FABSize: 40,
65
66
  FABBorderRadius: 20,
@@ -0,0 +1,13 @@
1
+ import * as React from "react";
2
+ import { View, Platform, Image } from "react-native";
3
+ import { SvgUri } from "react-native-svg";
4
+ import Config from "./Config";
5
+ const Svg = ({ source = Config.placeholderSvgURL, style, }) => {
6
+ return (React.createElement(React.Fragment, null,
7
+ Platform.OS === "ios" && (React.createElement(View, { style: style },
8
+ React.createElement(SvgUri, { width: "100%", height: "100%", uri: source }))),
9
+ Platform.OS === "android" && (React.createElement(View, { style: style },
10
+ React.createElement(SvgUri, { width: "100%", height: "100%", uri: source }))),
11
+ Platform.OS === "web" && (React.createElement(Image, { style: style, source: { uri: source } }))));
12
+ };
13
+ export default Svg;
@@ -0,0 +1,35 @@
1
+ import * as React from "react";
2
+ import { View, Platform, Image, StyleProp, ImageStyle } from "react-native";
3
+ import { SvgUri } from "react-native-svg";
4
+
5
+ import Config from "./Config";
6
+
7
+ type SvgComponentProps = {
8
+ source: string;
9
+ style?: StyleProp<ImageStyle>;
10
+ };
11
+
12
+ const Svg: React.FC<React.PropsWithChildren<SvgComponentProps>> = ({
13
+ source = Config.placeholderSvgURL,
14
+ style,
15
+ }) => {
16
+ return (
17
+ <>
18
+ {Platform.OS === "ios" && (
19
+ <View style={style}>
20
+ <SvgUri width="100%" height="100%" uri={source} />
21
+ </View>
22
+ )}
23
+ {Platform.OS === "android" && (
24
+ <View style={style}>
25
+ <SvgUri width="100%" height="100%" uri={source} />
26
+ </View>
27
+ )}
28
+ {Platform.OS === "web" && (
29
+ <Image style={style} source={{ uri: source }} />
30
+ )}
31
+ </>
32
+ );
33
+ };
34
+
35
+ export default Svg;
package/src/index.js CHANGED
@@ -17,6 +17,7 @@ export { default as FAB } from "./components/FAB";
17
17
  export { default as FieldSearchBarFull } from "./components/FieldSearchBarFull";
18
18
  export { default as IconButton } from "./components/IconButton";
19
19
  export { default as Image } from "./components/Image";
20
+ export { default as Svg } from "./components/Svg";
20
21
  export { default as NumberInput } from "./components/NumberInput";
21
22
  export { default as ScreenContainer } from "./components/ScreenContainer";
22
23
  export { default as StarRating } from "./components/StarRating";
package/src/index.tsx CHANGED
@@ -18,6 +18,7 @@ export { default as FAB } from "./components/FAB";
18
18
  export { default as FieldSearchBarFull } from "./components/FieldSearchBarFull";
19
19
  export { default as IconButton } from "./components/IconButton";
20
20
  export { default as Image } from "./components/Image";
21
+ export { default as Svg } from "./components/Svg";
21
22
  export { default as NumberInput } from "./components/NumberInput";
22
23
  export { default as ScreenContainer } from "./components/ScreenContainer";
23
24
  export { default as StarRating } from "./components/StarRating";
@@ -11,8 +11,8 @@ export const SEED_DATA = {
11
11
  StylesPanelSections.Effects,
12
12
  ],
13
13
  layout: {
14
- width: 250,
15
- height: 250,
14
+ width: 100,
15
+ height: 100,
16
16
  },
17
17
  props: {
18
18
  source: createImageProp(),
@@ -17,8 +17,8 @@ export const SEED_DATA = {
17
17
  StylesPanelSections.Effects,
18
18
  ],
19
19
  layout: {
20
- width: 250,
21
- height: 250,
20
+ width: 100,
21
+ height: 100,
22
22
  },
23
23
  props: {
24
24
  source: createImageProp(),
@@ -53,6 +53,7 @@ export const SEED_DATA = {
53
53
  label: "Map Type",
54
54
  description: "The type of map to show",
55
55
  group: GROUPS.basic,
56
+ editable: true,
56
57
  formType: FORM_TYPES.flatArray,
57
58
  propType: PROP_TYPES.STRING,
58
59
  required: false,
@@ -63,6 +63,7 @@ export const SEED_DATA = {
63
63
  label: "Map Type",
64
64
  description: "The type of map to show",
65
65
  group: GROUPS.basic,
66
+ editable: true,
66
67
  formType: FORM_TYPES.flatArray,
67
68
  propType: PROP_TYPES.STRING,
68
69
  required: false,