@draftbit/core 46.2.4-a3d00e.4 → 46.2.4-b61cba.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 (50) hide show
  1. package/lib/commonjs/components/Config.js +1 -1
  2. package/lib/commonjs/components/{SVG.js → Svg.js} +5 -10
  3. package/lib/commonjs/index.js +7 -21
  4. package/lib/commonjs/mappings/MapView.js +1 -0
  5. package/lib/commonjs/mappings/{SVG.js → Svg.js} +1 -0
  6. package/lib/module/components/Config.js +1 -1
  7. package/lib/module/components/{SVG.js → Svg.js} +5 -7
  8. package/lib/module/index.js +1 -2
  9. package/lib/module/mappings/MapView.js +1 -0
  10. package/lib/module/mappings/Svg.js +15 -0
  11. package/lib/typescript/src/components/Svg.d.ts +6 -0
  12. package/lib/typescript/src/index.d.ts +1 -2
  13. package/lib/typescript/src/mappings/MapView.d.ts +1 -0
  14. package/lib/typescript/src/mappings/{SVG.d.ts → Svg.d.ts} +1 -0
  15. package/package.json +3 -5
  16. package/src/components/Config.js +1 -1
  17. package/src/components/Config.ts +1 -1
  18. package/src/components/{SVG.js → Svg.js} +5 -7
  19. package/src/components/Svg.tsx +25 -0
  20. package/src/index.js +1 -2
  21. package/src/index.tsx +1 -2
  22. package/src/mappings/MapView.js +1 -0
  23. package/src/mappings/MapView.ts +1 -0
  24. package/src/mappings/Svg.js +20 -0
  25. package/src/mappings/Svg.ts +25 -0
  26. package/lib/commonjs/components/TabView/TabView.js +0 -102
  27. package/lib/commonjs/components/TabView/TabViewItem.js +0 -26
  28. package/lib/commonjs/components/TabView/index.js +0 -23
  29. package/lib/commonjs/mappings/TabView.js +0 -79
  30. package/lib/module/components/TabView/TabView.js +0 -87
  31. package/lib/module/components/TabView/TabViewItem.js +0 -18
  32. package/lib/module/components/TabView/index.js +0 -2
  33. package/lib/module/mappings/SVG.js +0 -14
  34. package/lib/module/mappings/TabView.js +0 -70
  35. package/lib/typescript/src/components/SVG.d.ts +0 -8
  36. package/lib/typescript/src/components/TabView/TabView.d.ts +0 -19
  37. package/lib/typescript/src/components/TabView/TabViewItem.d.ts +0 -10
  38. package/lib/typescript/src/components/TabView/index.d.ts +0 -2
  39. package/lib/typescript/src/mappings/TabView.d.ts +0 -111
  40. package/src/components/SVG.tsx +0 -35
  41. package/src/components/TabView/TabView.js +0 -34
  42. package/src/components/TabView/TabView.tsx +0 -97
  43. package/src/components/TabView/TabViewItem.js +0 -5
  44. package/src/components/TabView/TabViewItem.tsx +0 -21
  45. package/src/components/TabView/index.js +0 -2
  46. package/src/components/TabView/index.ts +0 -2
  47. package/src/mappings/SVG.js +0 -14
  48. package/src/mappings/SVG.ts +0 -15
  49. package/src/mappings/TabView.js +0 -73
  50. package/src/mappings/TabView.ts +0 -80
@@ -62,7 +62,7 @@ var _default = {
62
62
  width: size.width,
63
63
  height: size.height
64
64
  }, "image-placeholder_1"),
65
- placeholderSvgURL: "https://static.draftbit.com/images/placeholder-svg.svg",
65
+ placeholderSvgURL: "https://static.draftbit.com/images/placeholder-image.svg",
66
66
  squareImageUrl: buildImageUrl({
67
67
  width: 100,
68
68
  height: 100
@@ -11,39 +11,34 @@ var _reactNative = require("react-native");
11
11
 
12
12
  var _reactNativeSvg = require("react-native-svg");
13
13
 
14
- var _Config = _interopRequireDefault(require("./Config"));
15
-
16
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
-
18
14
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
19
15
 
20
16
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
21
17
 
22
- const SVG = _ref => {
18
+ const Svg = _ref => {
23
19
  let {
24
20
  source,
25
21
  style
26
22
  } = _ref;
27
- let svgSource = source === null || source === undefined ? _Config.default.placeholderSvgURL : source;
28
23
  return /*#__PURE__*/React.createElement(React.Fragment, null, _reactNative.Platform.OS === "ios" && /*#__PURE__*/React.createElement(_reactNative.View, {
29
24
  style: style
30
25
  }, /*#__PURE__*/React.createElement(_reactNativeSvg.SvgUri, {
31
26
  width: "100%",
32
27
  height: "100%",
33
- uri: svgSource
28
+ uri: source
34
29
  })), _reactNative.Platform.OS === "android" && /*#__PURE__*/React.createElement(_reactNative.View, {
35
30
  style: style
36
31
  }, /*#__PURE__*/React.createElement(_reactNativeSvg.SvgUri, {
37
32
  width: "100%",
38
33
  height: "100%",
39
- uri: svgSource
34
+ uri: source
40
35
  })), _reactNative.Platform.OS === "web" && /*#__PURE__*/React.createElement(_reactNative.Image, {
41
36
  style: style,
42
37
  source: {
43
- uri: svgSource
38
+ uri: source
44
39
  }
45
40
  }));
46
41
  };
47
42
 
48
- var _default = SVG;
43
+ var _default = Svg;
49
44
  exports.default = _default;
@@ -291,12 +291,6 @@ Object.defineProperty(exports, "RowHeadlineImageIcon", {
291
291
  return _RowHeadlineImageIcon.default;
292
292
  }
293
293
  });
294
- Object.defineProperty(exports, "SVG", {
295
- enumerable: true,
296
- get: function () {
297
- return _SVG.default;
298
- }
299
- });
300
294
  Object.defineProperty(exports, "ScreenContainer", {
301
295
  enumerable: true,
302
296
  get: function () {
@@ -345,6 +339,12 @@ Object.defineProperty(exports, "Surface", {
345
339
  return _Surface.default;
346
340
  }
347
341
  });
342
+ Object.defineProperty(exports, "Svg", {
343
+ enumerable: true,
344
+ get: function () {
345
+ return _Svg.default;
346
+ }
347
+ });
348
348
  Object.defineProperty(exports, "Swiper", {
349
349
  enumerable: true,
350
350
  get: function () {
@@ -369,18 +369,6 @@ Object.defineProperty(exports, "SwitchRow", {
369
369
  return _Switch.SwitchRow;
370
370
  }
371
371
  });
372
- Object.defineProperty(exports, "TabView", {
373
- enumerable: true,
374
- get: function () {
375
- return _TabView.TabView;
376
- }
377
- });
378
- Object.defineProperty(exports, "TabViewItem", {
379
- enumerable: true,
380
- get: function () {
381
- return _TabView.TabViewItem;
382
- }
383
- });
384
372
  Object.defineProperty(exports, "TextField", {
385
373
  enumerable: true,
386
374
  get: function () {
@@ -460,7 +448,7 @@ var _IconButton = _interopRequireDefault(require("./components/IconButton"));
460
448
 
461
449
  var _Image = _interopRequireDefault(require("./components/Image"));
462
450
 
463
- var _SVG = _interopRequireDefault(require("./components/SVG"));
451
+ var _Svg = _interopRequireDefault(require("./components/Svg"));
464
452
 
465
453
  var _NumberInput = _interopRequireDefault(require("./components/NumberInput"));
466
454
 
@@ -484,8 +472,6 @@ var _ActionSheet = require("./components/ActionSheet");
484
472
 
485
473
  var _Swiper = require("./components/Swiper");
486
474
 
487
- var _TabView = require("./components/TabView");
488
-
489
475
  var _Layout = require("./components/Layout");
490
476
 
491
477
  var _index = require("./components/RadioButton/index");
@@ -61,6 +61,7 @@ const SEED_DATA = {
61
61
  label: "Map Type",
62
62
  description: "The type of map to show",
63
63
  group: _types.GROUPS.basic,
64
+ editable: true,
64
65
  formType: _types.FORM_TYPES.flatArray,
65
66
  propType: _types.PROP_TYPES.STRING,
66
67
  required: false,
@@ -16,6 +16,7 @@ const SEED_DATA = {
16
16
  width: 100,
17
17
  height: 100
18
18
  },
19
+ stylesPanelSections: [_types.StylesPanelSections.Size, _types.StylesPanelSections.Margins, _types.StylesPanelSections.Position, _types.StylesPanelSections.Effects],
19
20
  props: {
20
21
  source: (0, _types.createSvgProp)()
21
22
  }
@@ -54,7 +54,7 @@ export default {
54
54
  width: size.width,
55
55
  height: size.height
56
56
  }, "image-placeholder_1"),
57
- placeholderSvgURL: "https://static.draftbit.com/images/placeholder-svg.svg",
57
+ placeholderSvgURL: "https://static.draftbit.com/images/placeholder-image.svg",
58
58
  squareImageUrl: buildImageUrl({
59
59
  width: 100,
60
60
  height: 100
@@ -1,32 +1,30 @@
1
1
  import * as React from "react";
2
2
  import { View, Platform, Image } from "react-native";
3
3
  import { SvgUri } from "react-native-svg";
4
- import Config from "./Config";
5
4
 
6
- const SVG = _ref => {
5
+ const Svg = _ref => {
7
6
  let {
8
7
  source,
9
8
  style
10
9
  } = _ref;
11
- let svgSource = source === null || source === undefined ? Config.placeholderSvgURL : source;
12
10
  return /*#__PURE__*/React.createElement(React.Fragment, null, Platform.OS === "ios" && /*#__PURE__*/React.createElement(View, {
13
11
  style: style
14
12
  }, /*#__PURE__*/React.createElement(SvgUri, {
15
13
  width: "100%",
16
14
  height: "100%",
17
- uri: svgSource
15
+ uri: source
18
16
  })), Platform.OS === "android" && /*#__PURE__*/React.createElement(View, {
19
17
  style: style
20
18
  }, /*#__PURE__*/React.createElement(SvgUri, {
21
19
  width: "100%",
22
20
  height: "100%",
23
- uri: svgSource
21
+ uri: source
24
22
  })), Platform.OS === "web" && /*#__PURE__*/React.createElement(Image, {
25
23
  style: style,
26
24
  source: {
27
- uri: svgSource
25
+ uri: source
28
26
  }
29
27
  }));
30
28
  };
31
29
 
32
- export default SVG;
30
+ export default Svg;
@@ -17,7 +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
+ export { default as Svg } from "./components/Svg";
21
21
  export { default as NumberInput } from "./components/NumberInput";
22
22
  export { default as ScreenContainer } from "./components/ScreenContainer";
23
23
  export { default as StarRating } from "./components/StarRating";
@@ -29,7 +29,6 @@ export { default as Touchable } from "./components/Touchable";
29
29
  export { AccordionGroup, AccordionItem } from "./components/Accordion";
30
30
  export { ActionSheet, ActionSheetItem, ActionSheetCancel } from "./components/ActionSheet";
31
31
  export { Swiper, SwiperItem } from "./components/Swiper";
32
- export { TabView, TabViewItem } from "./components/TabView";
33
32
  export { Center, Circle, Square, Row, Stack, Spacer } from "./components/Layout";
34
33
  export { RadioButton, RadioButtonGroup, RadioButtonRow, RadioButtonFieldGroup } from "./components/RadioButton/index";
35
34
  /* Deprecated: Fix or Delete! */
@@ -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,
@@ -0,0 +1,15 @@
1
+ import { COMPONENT_TYPES, createSvgProp, StylesPanelSections } from "@draftbit/types";
2
+ export const SEED_DATA = {
3
+ name: "SVG",
4
+ tag: "SVG",
5
+ description: "An SVG component",
6
+ category: COMPONENT_TYPES.media,
7
+ layout: {
8
+ width: 100,
9
+ height: 100
10
+ },
11
+ stylesPanelSections: [StylesPanelSections.Size, StylesPanelSections.Margins, StylesPanelSections.Position, StylesPanelSections.Effects],
12
+ props: {
13
+ source: createSvgProp()
14
+ }
15
+ };
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ declare const Svg: ({ source, style }: {
3
+ source: any;
4
+ style: any;
5
+ }) => JSX.Element;
6
+ export default Svg;
@@ -17,7 +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
+ export { default as Svg } from "./components/Svg";
21
21
  export { default as NumberInput } from "./components/NumberInput";
22
22
  export { default as ScreenContainer } from "./components/ScreenContainer";
23
23
  export { default as StarRating } from "./components/StarRating";
@@ -29,7 +29,6 @@ export { default as Touchable } from "./components/Touchable";
29
29
  export { AccordionGroup, AccordionItem } from "./components/Accordion";
30
30
  export { ActionSheet, ActionSheetItem, ActionSheetCancel, } from "./components/ActionSheet";
31
31
  export { Swiper, SwiperItem } from "./components/Swiper";
32
- export { TabView, TabViewItem } from "./components/TabView";
33
32
  export { Center, Circle, Square, Row, Stack, Spacer, } from "./components/Layout";
34
33
  export { RadioButton, RadioButtonGroup, RadioButtonRow, RadioButtonFieldGroup, } from "./components/RadioButton/index";
35
34
  export { default as Button } from "./components/DeprecatedButton";
@@ -56,6 +56,7 @@ export declare const SEED_DATA: {
56
56
  label: string;
57
57
  description: string;
58
58
  group: string;
59
+ editable: boolean;
59
60
  formType: string;
60
61
  propType: string;
61
62
  required: boolean;
@@ -7,6 +7,7 @@ export declare const SEED_DATA: {
7
7
  width: number;
8
8
  height: number;
9
9
  };
10
+ stylesPanelSections: string[];
10
11
  props: {
11
12
  source: {
12
13
  label: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@draftbit/core",
3
- "version": "46.2.4-a3d00e.4+a3d00ec7",
3
+ "version": "46.2.4-b61cba.5+b61cba47",
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.4",
44
+ "@draftbit/types": "^46.2.4-b61cba.5+b61cba47",
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,9 +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-pager-view": "5.4.24",
57
56
  "react-native-svg": "^12.3.0",
58
- "react-native-tab-view": "^3.0.0",
59
57
  "react-native-typography": "^1.4.1",
60
58
  "react-native-web-swiper": "^2.2.3"
61
59
  },
@@ -82,5 +80,5 @@
82
80
  ]
83
81
  ]
84
82
  },
85
- "gitHead": "a3d00ec7cecffe5e152283bd403477beb2df06c5"
83
+ "gitHead": "b61cba47413d3c7438272debc7ef343a97a29ae3"
86
84
  }
@@ -42,7 +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-svg.svg",
45
+ placeholderSvgURL: "https://static.draftbit.com/images/placeholder-image.svg",
46
46
  squareImageUrl: buildImageUrl({ width: 100, height: 100 }, "Avatar"),
47
47
  FABSize: 40,
48
48
  FABBorderRadius: 20,
@@ -60,7 +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-svg.svg",
63
+ placeholderSvgURL: "https://static.draftbit.com/images/placeholder-image.svg",
64
64
  squareImageUrl: buildImageUrl({ width: 100, height: 100 }, "Avatar"),
65
65
  FABSize: 40,
66
66
  FABBorderRadius: 20,
@@ -1,14 +1,12 @@
1
1
  import * as React from "react";
2
2
  import { View, Platform, Image } from "react-native";
3
3
  import { SvgUri } from "react-native-svg";
4
- import Config from "./Config";
5
- const SVG = ({ source, style }) => {
6
- let svgSource = source === null || source === undefined ? Config.placeholderSvgURL : source;
4
+ const Svg = ({ source, style }) => {
7
5
  return (React.createElement(React.Fragment, null,
8
6
  Platform.OS === "ios" && (React.createElement(View, { style: style },
9
- React.createElement(SvgUri, { width: "100%", height: "100%", uri: svgSource }))),
7
+ React.createElement(SvgUri, { width: "100%", height: "100%", uri: source }))),
10
8
  Platform.OS === "android" && (React.createElement(View, { style: style },
11
- React.createElement(SvgUri, { width: "100%", height: "100%", uri: svgSource }))),
12
- Platform.OS === "web" && (React.createElement(Image, { style: style, source: { uri: svgSource } }))));
9
+ React.createElement(SvgUri, { width: "100%", height: "100%", uri: source }))),
10
+ Platform.OS === "web" && (React.createElement(Image, { style: style, source: { uri: source } }))));
13
11
  };
14
- export default SVG;
12
+ export default Svg;
@@ -0,0 +1,25 @@
1
+ import * as React from "react";
2
+ import { View, Platform, Image } from "react-native";
3
+ import { SvgUri } from "react-native-svg";
4
+
5
+ const Svg = ({ source, style }: { source: any; style: any }) => {
6
+ return (
7
+ <>
8
+ {Platform.OS === "ios" && (
9
+ <View style={style}>
10
+ <SvgUri width="100%" height="100%" uri={source} />
11
+ </View>
12
+ )}
13
+ {Platform.OS === "android" && (
14
+ <View style={style}>
15
+ <SvgUri width="100%" height="100%" uri={source} />
16
+ </View>
17
+ )}
18
+ {Platform.OS === "web" && (
19
+ <Image style={style} source={{ uri: source }} />
20
+ )}
21
+ </>
22
+ );
23
+ };
24
+
25
+ export default Svg;
package/src/index.js CHANGED
@@ -17,7 +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
+ export { default as Svg } from "./components/Svg";
21
21
  export { default as NumberInput } from "./components/NumberInput";
22
22
  export { default as ScreenContainer } from "./components/ScreenContainer";
23
23
  export { default as StarRating } from "./components/StarRating";
@@ -29,7 +29,6 @@ export { default as Touchable } from "./components/Touchable";
29
29
  export { AccordionGroup, AccordionItem } from "./components/Accordion";
30
30
  export { ActionSheet, ActionSheetItem, ActionSheetCancel, } from "./components/ActionSheet";
31
31
  export { Swiper, SwiperItem } from "./components/Swiper";
32
- export { TabView, TabViewItem } from "./components/TabView";
33
32
  export { Center, Circle, Square, Row, Stack, Spacer, } from "./components/Layout";
34
33
  export { RadioButton, RadioButtonGroup, RadioButtonRow, RadioButtonFieldGroup, } from "./components/RadioButton/index";
35
34
  /* Deprecated: Fix or Delete! */
package/src/index.tsx CHANGED
@@ -18,7 +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
+ export { default as Svg } from "./components/Svg";
22
22
  export { default as NumberInput } from "./components/NumberInput";
23
23
  export { default as ScreenContainer } from "./components/ScreenContainer";
24
24
  export { default as StarRating } from "./components/StarRating";
@@ -34,7 +34,6 @@ export {
34
34
  ActionSheetCancel,
35
35
  } from "./components/ActionSheet";
36
36
  export { Swiper, SwiperItem } from "./components/Swiper";
37
- export { TabView, TabViewItem } from "./components/TabView";
38
37
 
39
38
  export {
40
39
  Center,
@@ -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,
@@ -0,0 +1,20 @@
1
+ import { COMPONENT_TYPES, createSvgProp, StylesPanelSections, } from "@draftbit/types";
2
+ export const SEED_DATA = {
3
+ name: "SVG",
4
+ tag: "SVG",
5
+ description: "An SVG component",
6
+ category: COMPONENT_TYPES.media,
7
+ layout: {
8
+ width: 100,
9
+ height: 100,
10
+ },
11
+ stylesPanelSections: [
12
+ StylesPanelSections.Size,
13
+ StylesPanelSections.Margins,
14
+ StylesPanelSections.Position,
15
+ StylesPanelSections.Effects,
16
+ ],
17
+ props: {
18
+ source: createSvgProp(),
19
+ },
20
+ };
@@ -0,0 +1,25 @@
1
+ import {
2
+ COMPONENT_TYPES,
3
+ createSvgProp,
4
+ StylesPanelSections,
5
+ } from "@draftbit/types";
6
+
7
+ export const SEED_DATA = {
8
+ name: "SVG",
9
+ tag: "SVG",
10
+ description: "An SVG component",
11
+ category: COMPONENT_TYPES.media,
12
+ layout: {
13
+ width: 100,
14
+ height: 100,
15
+ },
16
+ stylesPanelSections: [
17
+ StylesPanelSections.Size,
18
+ StylesPanelSections.Margins,
19
+ StylesPanelSections.Position,
20
+ StylesPanelSections.Effects,
21
+ ],
22
+ props: {
23
+ source: createSvgProp(),
24
+ },
25
+ };
@@ -1,102 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var React = _interopRequireWildcard(require("react"));
9
-
10
- var _reactNativeTabView = require("react-native-tab-view");
11
-
12
- var _TabViewItem = _interopRequireDefault(require("./TabViewItem"));
13
-
14
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
-
16
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
17
-
18
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
19
-
20
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
21
-
22
- const TabViewComponent = _ref => {
23
- let {
24
- Icon,
25
- tabBarPosition,
26
- keyboardDismissMode,
27
- swipeEnabled,
28
- scrollEnabled,
29
- activeColor,
30
- inactiveColor,
31
- pressColor,
32
- indicatorColor,
33
- style,
34
- children
35
- } = _ref;
36
- const [index, setIndex] = React.useState(0);
37
- const [routes, setRoutes] = React.useState([]);
38
- const [tabScenes, setTabScenes] = React.useState({});
39
- React.useEffect(() => {
40
- const newRoutes = [];
41
- const scenes = {};
42
- React.Children.toArray(children).filter(child => child.type === _TabViewItem.default).forEach(child => {
43
- var _child$props;
44
-
45
- if (child !== null && child !== void 0 && (_child$props = child.props) !== null && _child$props !== void 0 && _child$props.id) {
46
- var _child$props2, _child$props3;
47
-
48
- newRoutes.push({
49
- key: child === null || child === void 0 ? void 0 : (_child$props2 = child.props) === null || _child$props2 === void 0 ? void 0 : _child$props2.id,
50
- ...(child === null || child === void 0 ? void 0 : child.props)
51
- });
52
-
53
- scenes[child === null || child === void 0 ? void 0 : (_child$props3 = child.props) === null || _child$props3 === void 0 ? void 0 : _child$props3.id] = () => child;
54
- }
55
- });
56
- setRoutes(newRoutes);
57
- setTabScenes(scenes);
58
- }, [children]);
59
-
60
- const indexChangeHandler = i => setIndex(i);
61
-
62
- const renderTabBar = props => {
63
- console.log(props);
64
- return /*#__PURE__*/React.createElement(_reactNativeTabView.TabBar, _extends({}, props, {
65
- activeColor: activeColor,
66
- inactiveColor: inactiveColor,
67
- pressColor: pressColor,
68
- scrollEnabled: scrollEnabled,
69
- indicatorStyle: {
70
- backgroundColor: indicatorColor
71
- },
72
- renderIcon: _ref2 => {
73
- let {
74
- route,
75
- color
76
- } = _ref2;
77
- return route !== null && route !== void 0 && route.icon ? /*#__PURE__*/React.createElement(Icon, {
78
- name: route.icon,
79
- color: color,
80
- size: 36
81
- }) : null;
82
- },
83
- style: style
84
- }));
85
- };
86
-
87
- return /*#__PURE__*/React.createElement(_reactNativeTabView.TabView, {
88
- navigationState: {
89
- index,
90
- routes
91
- },
92
- renderScene: (0, _reactNativeTabView.SceneMap)(tabScenes),
93
- renderTabBar: renderTabBar,
94
- onIndexChange: indexChangeHandler,
95
- tabBarPosition: tabBarPosition,
96
- keyboardDismissMode: keyboardDismissMode,
97
- swipeEnabled: swipeEnabled
98
- });
99
- };
100
-
101
- var _default = TabViewComponent;
102
- exports.default = _default;
@@ -1,26 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- const TabViewItem = _ref => {
9
- let {
10
- title,
11
- id,
12
- icon,
13
- children,
14
- accessibilityLabel
15
- } = _ref;
16
- console.log({
17
- title,
18
- id,
19
- icon,
20
- accessibilityLabel
21
- });
22
- return children;
23
- };
24
-
25
- var _default = TabViewItem;
26
- exports.default = _default;
@@ -1,23 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "TabView", {
7
- enumerable: true,
8
- get: function () {
9
- return _TabView.default;
10
- }
11
- });
12
- Object.defineProperty(exports, "TabViewItem", {
13
- enumerable: true,
14
- get: function () {
15
- return _TabViewItem.default;
16
- }
17
- });
18
-
19
- var _TabView = _interopRequireDefault(require("./TabView"));
20
-
21
- var _TabViewItem = _interopRequireDefault(require("./TabViewItem"));
22
-
23
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }