@draftbit/core 46.2.4-e3db78.5 → 46.2.4-e44242.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.
@@ -21,8 +21,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
21
21
 
22
22
  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; }
23
23
 
24
- 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); }
25
-
26
24
  const AccordionItem = _ref => {
27
25
  let {
28
26
  Icon,
@@ -37,9 +35,10 @@ const AccordionItem = _ref => {
37
35
  textStyles,
38
36
  viewStyles
39
37
  } = (0, _utilities.extractStyles)(style);
40
- return /*#__PURE__*/React.createElement(_reactNative.Pressable, _extends({
41
- style: [styles.container, viewStyles]
42
- }, rest), /*#__PURE__*/React.createElement(_reactNative.View, {
38
+ return /*#__PURE__*/React.createElement(_reactNative.Pressable, {
39
+ style: [styles.container, viewStyles],
40
+ ...rest
41
+ }, /*#__PURE__*/React.createElement(_reactNative.View, {
43
42
  style: styles.row
44
43
  }, icon ? /*#__PURE__*/React.createElement(Icon, {
45
44
  name: icon,
@@ -74,4 +73,25 @@ const styles = _reactNative.StyleSheet.create({
74
73
 
75
74
  var _default = (0, _theming.withTheme)(AccordionItem);
76
75
 
76
+ exports.default = _default;StyleSheet.create({
77
+ container: {
78
+ padding: 8
79
+ },
80
+ row: {
81
+ flexDirection: "row",
82
+ alignItems: "center",
83
+ paddingLeft: 8
84
+ },
85
+ item: {
86
+ marginVertical: 6,
87
+ paddingLeft: 8
88
+ },
89
+ content: {
90
+ flex: 1,
91
+ justifyContent: "center"
92
+ }
93
+ });
94
+
95
+ var _default = (0, _theming.withTheme)(AccordionItem);
96
+
77
97
  exports.default = _default;
@@ -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-image.svg",
65
+ placeholderSvgURL: "https://static.draftbit.com/images/placeholder-svg.svg",
66
66
  squareImageUrl: buildImageUrl({
67
67
  width: 100,
68
68
  height: 100
@@ -19,30 +19,31 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
19
19
 
20
20
  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
21
 
22
- const Svg = _ref => {
22
+ const SVG = _ref => {
23
23
  let {
24
- source = _Config.default.placeholderSvgURL,
24
+ source,
25
25
  style
26
26
  } = _ref;
27
+ let svgSource = source === null || source === undefined ? _Config.default.placeholderSvgURL : source;
27
28
  return /*#__PURE__*/React.createElement(React.Fragment, null, _reactNative.Platform.OS === "ios" && /*#__PURE__*/React.createElement(_reactNative.View, {
28
29
  style: style
29
30
  }, /*#__PURE__*/React.createElement(_reactNativeSvg.SvgUri, {
30
31
  width: "100%",
31
32
  height: "100%",
32
- uri: source
33
+ uri: svgSource
33
34
  })), _reactNative.Platform.OS === "android" && /*#__PURE__*/React.createElement(_reactNative.View, {
34
35
  style: style
35
36
  }, /*#__PURE__*/React.createElement(_reactNativeSvg.SvgUri, {
36
37
  width: "100%",
37
38
  height: "100%",
38
- uri: source
39
+ uri: svgSource
39
40
  })), _reactNative.Platform.OS === "web" && /*#__PURE__*/React.createElement(_reactNative.Image, {
40
41
  style: style,
41
42
  source: {
42
- uri: source
43
+ uri: svgSource
43
44
  }
44
45
  }));
45
46
  };
46
47
 
47
- var _default = Svg;
48
+ var _default = SVG;
48
49
  exports.default = _default;
@@ -291,6 +291,12 @@ 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
+ });
294
300
  Object.defineProperty(exports, "ScreenContainer", {
295
301
  enumerable: true,
296
302
  get: function () {
@@ -339,12 +345,6 @@ Object.defineProperty(exports, "Surface", {
339
345
  return _Surface.default;
340
346
  }
341
347
  });
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 () {
@@ -448,7 +448,7 @@ var _IconButton = _interopRequireDefault(require("./components/IconButton"));
448
448
 
449
449
  var _Image = _interopRequireDefault(require("./components/Image"));
450
450
 
451
- var _Svg = _interopRequireDefault(require("./components/Svg"));
451
+ var _SVG = _interopRequireDefault(require("./components/SVG"));
452
452
 
453
453
  var _NumberInput = _interopRequireDefault(require("./components/NumberInput"));
454
454
 
@@ -11,13 +11,11 @@ const SEED_DATA = {
11
11
  name: "SVG",
12
12
  tag: "SVG",
13
13
  description: "An SVG component",
14
- packageName: "@draftbit/core",
15
14
  category: _types.COMPONENT_TYPES.media,
16
15
  layout: {
17
16
  width: 100,
18
17
  height: 100
19
18
  },
20
- stylesPanelSections: [_types.StylesPanelSections.Size, _types.StylesPanelSections.Margins, _types.StylesPanelSections.Position, _types.StylesPanelSections.Effects],
21
19
  props: {
22
20
  source: (0, _types.createSvgProp)()
23
21
  }
@@ -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-image.svg",
57
+ placeholderSvgURL: "https://static.draftbit.com/images/placeholder-svg.svg",
58
58
  squareImageUrl: buildImageUrl({
59
59
  width: 100,
60
60
  height: 100
@@ -3,29 +3,30 @@ import { View, Platform, Image } from "react-native";
3
3
  import { SvgUri } from "react-native-svg";
4
4
  import Config from "./Config";
5
5
 
6
- const Svg = _ref => {
6
+ const SVG = _ref => {
7
7
  let {
8
- source = Config.placeholderSvgURL,
8
+ source,
9
9
  style
10
10
  } = _ref;
11
+ let svgSource = source === null || source === undefined ? Config.placeholderSvgURL : source;
11
12
  return /*#__PURE__*/React.createElement(React.Fragment, null, Platform.OS === "ios" && /*#__PURE__*/React.createElement(View, {
12
13
  style: style
13
14
  }, /*#__PURE__*/React.createElement(SvgUri, {
14
15
  width: "100%",
15
16
  height: "100%",
16
- uri: source
17
+ uri: svgSource
17
18
  })), Platform.OS === "android" && /*#__PURE__*/React.createElement(View, {
18
19
  style: style
19
20
  }, /*#__PURE__*/React.createElement(SvgUri, {
20
21
  width: "100%",
21
22
  height: "100%",
22
- uri: source
23
+ uri: svgSource
23
24
  })), Platform.OS === "web" && /*#__PURE__*/React.createElement(Image, {
24
25
  style: style,
25
26
  source: {
26
- uri: source
27
+ uri: svgSource
27
28
  }
28
29
  }));
29
30
  };
30
31
 
31
- export default Svg;
32
+ 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";
@@ -0,0 +1,14 @@
1
+ import { COMPONENT_TYPES, createSvgProp } 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
+ props: {
12
+ source: createSvgProp()
13
+ }
14
+ };
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import { StyleProp, ImageStyle } from "react-native";
3
+ declare type SVGComponentProps = {
4
+ source: string;
5
+ style?: StyleProp<ImageStyle>;
6
+ };
7
+ declare const SVG: ({ source, style }: SVGComponentProps) => JSX.Element;
8
+ 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";
@@ -2,13 +2,11 @@ export declare const SEED_DATA: {
2
2
  name: string;
3
3
  tag: string;
4
4
  description: string;
5
- packageName: string;
6
5
  category: string;
7
6
  layout: {
8
7
  width: number;
9
8
  height: number;
10
9
  };
11
- stylesPanelSections: string[];
12
10
  props: {
13
11
  source: {
14
12
  label: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@draftbit/core",
3
- "version": "46.2.4-e3db78.5+e3db789a",
3
+ "version": "46.2.4-e44242.5+e4424266",
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-e3db78.5+e3db789a",
44
+ "@draftbit/types": "^46.2.4",
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,7 +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
+ "react-native-svg": "12.3.0",
57
57
  "react-native-typography": "^1.4.1",
58
58
  "react-native-web-swiper": "^2.2.3"
59
59
  },
@@ -80,5 +80,5 @@
80
80
  ]
81
81
  ]
82
82
  },
83
- "gitHead": "e3db789ac42b782e3844b6d6cf60a61735f020a7"
83
+ "gitHead": "e4424266c6f9025ef1c2366de2049124e14ee026"
84
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-image.svg",
45
+ placeholderSvgURL: "https://static.draftbit.com/images/placeholder-svg.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-image.svg",
63
+ placeholderSvgURL: "https://static.draftbit.com/images/placeholder-svg.svg",
64
64
  squareImageUrl: buildImageUrl({ width: 100, height: 100 }, "Avatar"),
65
65
  FABSize: 40,
66
66
  FABBorderRadius: 20,
@@ -2,12 +2,13 @@ import * as React from "react";
2
2
  import { View, Platform, Image } from "react-native";
3
3
  import { SvgUri } from "react-native-svg";
4
4
  import Config from "./Config";
5
- const Svg = ({ source = Config.placeholderSvgURL, style, }) => {
5
+ const SVG = ({ source, style }) => {
6
+ let svgSource = source === null || source === undefined ? Config.placeholderSvgURL : source;
6
7
  return (React.createElement(React.Fragment, null,
7
8
  Platform.OS === "ios" && (React.createElement(View, { style: style },
8
- React.createElement(SvgUri, { width: "100%", height: "100%", uri: source }))),
9
+ React.createElement(SvgUri, { width: "100%", height: "100%", uri: svgSource }))),
9
10
  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 } }))));
11
+ React.createElement(SvgUri, { width: "100%", height: "100%", uri: svgSource }))),
12
+ Platform.OS === "web" && (React.createElement(Image, { style: style, source: { uri: svgSource } }))));
12
13
  };
13
- export default Svg;
14
+ export default SVG;
@@ -4,32 +4,32 @@ import { SvgUri } from "react-native-svg";
4
4
 
5
5
  import Config from "./Config";
6
6
 
7
- type SvgComponentProps = {
7
+ type SVGComponentProps = {
8
8
  source: string;
9
9
  style?: StyleProp<ImageStyle>;
10
10
  };
11
11
 
12
- const Svg: React.FC<React.PropsWithChildren<SvgComponentProps>> = ({
13
- source = Config.placeholderSvgURL,
14
- style,
15
- }) => {
12
+ const SVG = ({ source, style }: SVGComponentProps) => {
13
+ let svgSource =
14
+ source === null || source === undefined ? Config.placeholderSvgURL : source;
15
+
16
16
  return (
17
17
  <>
18
18
  {Platform.OS === "ios" && (
19
19
  <View style={style}>
20
- <SvgUri width="100%" height="100%" uri={source} />
20
+ <SvgUri width="100%" height="100%" uri={svgSource} />
21
21
  </View>
22
22
  )}
23
23
  {Platform.OS === "android" && (
24
24
  <View style={style}>
25
- <SvgUri width="100%" height="100%" uri={source} />
25
+ <SvgUri width="100%" height="100%" uri={svgSource} />
26
26
  </View>
27
27
  )}
28
28
  {Platform.OS === "web" && (
29
- <Image style={style} source={{ uri: source }} />
29
+ <Image style={style} source={{ uri: svgSource }} />
30
30
  )}
31
31
  </>
32
32
  );
33
33
  };
34
34
 
35
- export default Svg;
35
+ 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";
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";
@@ -0,0 +1,14 @@
1
+ import { COMPONENT_TYPES, createSvgProp } 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
+ props: {
12
+ source: createSvgProp(),
13
+ },
14
+ };
@@ -0,0 +1,15 @@
1
+ import { COMPONENT_TYPES, createSvgProp } from "@draftbit/types";
2
+
3
+ export const SEED_DATA = {
4
+ name: "SVG",
5
+ tag: "SVG",
6
+ description: "An SVG component",
7
+ category: COMPONENT_TYPES.media,
8
+ layout: {
9
+ width: 100,
10
+ height: 100,
11
+ },
12
+ props: {
13
+ source: createSvgProp(),
14
+ },
15
+ };
@@ -1,16 +0,0 @@
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
- packageName: "@draftbit/core",
7
- category: COMPONENT_TYPES.media,
8
- layout: {
9
- width: 100,
10
- height: 100
11
- },
12
- stylesPanelSections: [StylesPanelSections.Size, StylesPanelSections.Margins, StylesPanelSections.Position, StylesPanelSections.Effects],
13
- props: {
14
- source: createSvgProp()
15
- }
16
- };
@@ -1,8 +0,0 @@
1
- import * as React from "react";
2
- import { StyleProp, ImageStyle } from "react-native";
3
- declare type SvgComponentProps = {
4
- source: string;
5
- style?: StyleProp<ImageStyle>;
6
- };
7
- declare const Svg: React.FC<React.PropsWithChildren<SvgComponentProps>>;
8
- export default Svg;
@@ -1,21 +0,0 @@
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
- packageName: "@draftbit/core",
7
- category: COMPONENT_TYPES.media,
8
- layout: {
9
- width: 100,
10
- height: 100,
11
- },
12
- stylesPanelSections: [
13
- StylesPanelSections.Size,
14
- StylesPanelSections.Margins,
15
- StylesPanelSections.Position,
16
- StylesPanelSections.Effects,
17
- ],
18
- props: {
19
- source: createSvgProp(),
20
- },
21
- };
@@ -1,26 +0,0 @@
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
- packageName: "@draftbit/core",
12
- category: COMPONENT_TYPES.media,
13
- layout: {
14
- width: 100,
15
- height: 100,
16
- },
17
- stylesPanelSections: [
18
- StylesPanelSections.Size,
19
- StylesPanelSections.Margins,
20
- StylesPanelSections.Position,
21
- StylesPanelSections.Effects,
22
- ],
23
- props: {
24
- source: createSvgProp(),
25
- },
26
- };