@draftbit/core 46.2.4-be9b73.5 → 46.2.4-cb2c54.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.
@@ -17,8 +17,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
17
17
 
18
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
19
 
20
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
21
-
22
20
  const PortalContext = /*#__PURE__*/React.createContext(null);
23
21
  /**
24
22
  * Portal host renders all of its children `Portal` elements.
@@ -51,11 +49,11 @@ class PortalHost extends React.Component {
51
49
  constructor() {
52
50
  super(...arguments);
53
51
 
54
- _defineProperty(this, "setManager", manager => {
52
+ this.setManager = manager => {
55
53
  this.manager = manager;
56
- });
54
+ };
57
55
 
58
- _defineProperty(this, "mount", children => {
56
+ this.mount = children => {
59
57
  const key = this.nextKey++;
60
58
 
61
59
  if (this.manager) {
@@ -69,9 +67,9 @@ class PortalHost extends React.Component {
69
67
  }
70
68
 
71
69
  return key;
72
- });
70
+ };
73
71
 
74
- _defineProperty(this, "update", (key, children) => {
72
+ this.update = (key, children) => {
75
73
  if (this.manager) {
76
74
  this.manager.update(key, children);
77
75
  } else {
@@ -89,9 +87,9 @@ class PortalHost extends React.Component {
89
87
  this.queue.push(op);
90
88
  }
91
89
  }
92
- });
90
+ };
93
91
 
94
- _defineProperty(this, "unmount", key => {
92
+ this.unmount = key => {
95
93
  if (this.manager) {
96
94
  this.manager.unmount(key);
97
95
  } else {
@@ -100,13 +98,10 @@ class PortalHost extends React.Component {
100
98
  key
101
99
  });
102
100
  }
103
- });
104
-
105
- _defineProperty(this, "nextKey", 0);
106
-
107
- _defineProperty(this, "queue", []);
101
+ };
108
102
 
109
- _defineProperty(this, "manager", void 0);
103
+ this.nextKey = 0;
104
+ this.queue = [];
110
105
  }
111
106
 
112
107
  componentDidMount() {
@@ -152,6 +147,23 @@ class PortalHost extends React.Component {
152
147
 
153
148
  }
154
149
 
150
+ exports.default = PortalHost;
151
+ PortalHost.displayName = "Portal.Host";
152
+
153
+ const styles = _reactNative.StyleSheet.create({
154
+ container: {
155
+ flex: 1
156
+ }
157
+ }); style: styles.container,
158
+ collapsable: false,
159
+ pointerEvents: "box-none"
160
+ }, this.props.children), /*#__PURE__*/React.createElement(_PortalManager.default, {
161
+ ref: this.setManager
162
+ }));
163
+ }
164
+
165
+ }
166
+
155
167
  exports.default = PortalHost;
156
168
 
157
169
  _defineProperty(PortalHost, "displayName", "Portal.Host");
@@ -19,7 +19,7 @@ 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
24
  source = _Config.default.placeholderSvgURL,
25
25
  style
@@ -44,5 +44,5 @@ const Svg = _ref => {
44
44
  }));
45
45
  };
46
46
 
47
- var _default = Svg;
47
+ var _default = SVG;
48
48
  exports.default = _default;
@@ -16,4 +16,4 @@ const APPROX_STATUSBAR_HEIGHT = _reactNative.Platform.select({
16
16
  ios: _reactNative.Platform.Version < 11 ? DEFAULT_STATUSBAR_HEIGHT_EXPO : 0
17
17
  });
18
18
 
19
- exports.APPROX_STATUSBAR_HEIGHT = APPROX_STATUSBAR_HEIGHT;
19
+ exports.APPROX_STATUSBAR_HEIGHT = APPROX_STATUSBAR_HEIGHT;AR_HEIGHT;
@@ -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,6 +11,7 @@ const SEED_DATA = {
11
11
  name: "SVG",
12
12
  tag: "SVG",
13
13
  description: "An SVG component",
14
+ packageName: "@draftbit/core",
14
15
  category: _types.COMPONENT_TYPES.media,
15
16
  layout: {
16
17
  width: 100,
@@ -18,7 +19,7 @@ const SEED_DATA = {
18
19
  },
19
20
  stylesPanelSections: [_types.StylesPanelSections.Size, _types.StylesPanelSections.Margins, _types.StylesPanelSections.Position, _types.StylesPanelSections.Effects],
20
21
  props: {
21
- source: (0, _types.createSvgProp)()
22
+ source: (0, _types.createSVGProp)()
22
23
  }
23
24
  };
24
25
  exports.SEED_DATA = SEED_DATA;
@@ -3,7 +3,7 @@ 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
8
  source = Config.placeholderSvgURL,
9
9
  style
@@ -28,4 +28,4 @@ const Svg = _ref => {
28
28
  }));
29
29
  };
30
30
 
31
- export default Svg;
31
+ export default SVG;
@@ -1,5 +1,3 @@
1
- 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); }
2
-
3
1
  import * as React from "react";
4
2
  import { View, StyleSheet, Pressable } from "react-native";
5
3
  import { withTheme } from "../theming";
@@ -34,9 +32,10 @@ const StarRating = _ref => {
34
32
  !!onPress && onPress(r);
35
33
  }, [onPress]);
36
34
  const ratingRounded = Math.round(localRating * 2) / 2;
37
- return /*#__PURE__*/React.createElement(View, _extends({
38
- style: [styles.container, style]
39
- }, rest), [...Array(maxStars)].map((_, i) => /*#__PURE__*/React.createElement(View, {
35
+ return /*#__PURE__*/React.createElement(View, {
36
+ style: [styles.container, style],
37
+ ...rest
38
+ }, [...Array(maxStars)].map((_, i) => /*#__PURE__*/React.createElement(View, {
40
39
  key: i,
41
40
  style: {
42
41
  display: "flex"
@@ -77,4 +76,24 @@ const styles = StyleSheet.create({
77
76
  width: "50%"
78
77
  }
79
78
  });
79
+ export default withTheme(StarRating);ontainer: {
80
+ flexDirection: "row",
81
+ alignItems: "center"
82
+ },
83
+ touchContainer: {
84
+ display: "flex",
85
+ flexDirection: "row",
86
+ position: "absolute",
87
+ top: 0,
88
+ right: 0,
89
+ left: 0,
90
+ bottom: 0,
91
+ zIndex: 1
92
+ },
93
+ pressable: {
94
+ flex: 1,
95
+ height: "100%",
96
+ width: "50%"
97
+ }
98
+ });
80
99
  export default withTheme(StarRating);
@@ -5,4 +5,5 @@ const DEFAULT_STATUSBAR_HEIGHT_EXPO = expo !== null && expo !== void 0 && expo.C
5
5
  export const APPROX_STATUSBAR_HEIGHT = Platform.select({
6
6
  android: DEFAULT_STATUSBAR_HEIGHT_EXPO,
7
7
  ios: Platform.Version < 11 ? DEFAULT_STATUSBAR_HEIGHT_EXPO : 0
8
+ });PO : 0
8
9
  });
@@ -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";
@@ -1,8 +1,9 @@
1
- import { COMPONENT_TYPES, createSvgProp, StylesPanelSections } from "@draftbit/types";
1
+ import { COMPONENT_TYPES, createSVGProp, StylesPanelSections } from "@draftbit/types";
2
2
  export const SEED_DATA = {
3
3
  name: "SVG",
4
4
  tag: "SVG",
5
5
  description: "An SVG component",
6
+ packageName: "@draftbit/core",
6
7
  category: COMPONENT_TYPES.media,
7
8
  layout: {
8
9
  width: 100,
@@ -10,6 +11,6 @@ export const SEED_DATA = {
10
11
  },
11
12
  stylesPanelSections: [StylesPanelSections.Size, StylesPanelSections.Margins, StylesPanelSections.Position, StylesPanelSections.Effects],
12
13
  props: {
13
- source: createSvgProp()
14
+ source: createSVGProp()
14
15
  }
15
16
  };
@@ -0,0 +1,8 @@
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;
@@ -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,6 +2,7 @@ export declare const SEED_DATA: {
2
2
  name: string;
3
3
  tag: string;
4
4
  description: string;
5
+ packageName: string;
5
6
  category: string;
6
7
  layout: {
7
8
  width: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@draftbit/core",
3
- "version": "46.2.4-be9b73.5+be9b7356",
3
+ "version": "46.2.4-cb2c54.5+cb2c5435",
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-be9b73.5+be9b7356",
44
+ "@draftbit/types": "^46.2.4-cb2c54.5+cb2c5435",
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",
@@ -80,5 +80,5 @@
80
80
  ]
81
81
  ]
82
82
  },
83
- "gitHead": "be9b7356c85df9ed4a1bef6edd77cafdb407bf61"
83
+ "gitHead": "cb2c543552734b1e7d7056d04da2430dd5a6e4b5"
84
84
  }
@@ -2,7 +2,7 @@ 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 = Config.placeholderSvgURL, style, }) => {
6
6
  return (React.createElement(React.Fragment, null,
7
7
  Platform.OS === "ios" && (React.createElement(View, { style: style },
8
8
  React.createElement(SvgUri, { width: "100%", height: "100%", uri: source }))),
@@ -10,4 +10,4 @@ const Svg = ({ source = Config.placeholderSvgURL, style, }) => {
10
10
  React.createElement(SvgUri, { width: "100%", height: "100%", uri: source }))),
11
11
  Platform.OS === "web" && (React.createElement(Image, { style: style, source: { uri: source } }))));
12
12
  };
13
- export default Svg;
13
+ export default SVG;
@@ -1,15 +1,15 @@
1
1
  import * as React from "react";
2
- import { View, Platform, Image } from "react-native";
2
+ import { View, Platform, Image, StyleProp, ImageStyle } from "react-native";
3
3
  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
- style?: any;
9
+ style?: StyleProp<ImageStyle>;
10
10
  };
11
11
 
12
- const Svg: React.FC<React.PropsWithChildren<SvgComponentProps>> = ({
12
+ const SVG: React.FC<React.PropsWithChildren<SVGComponentProps>> = ({
13
13
  source = Config.placeholderSvgURL,
14
14
  style,
15
15
  }) => {
@@ -32,4 +32,4 @@ const Svg: React.FC<React.PropsWithChildren<SvgComponentProps>> = ({
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";
@@ -1,8 +1,9 @@
1
- import { COMPONENT_TYPES, createSvgProp, StylesPanelSections, } from "@draftbit/types";
1
+ import { COMPONENT_TYPES, createSVGProp, StylesPanelSections, } from "@draftbit/types";
2
2
  export const SEED_DATA = {
3
3
  name: "SVG",
4
4
  tag: "SVG",
5
5
  description: "An SVG component",
6
+ packageName: "@draftbit/core",
6
7
  category: COMPONENT_TYPES.media,
7
8
  layout: {
8
9
  width: 100,
@@ -15,6 +16,6 @@ export const SEED_DATA = {
15
16
  StylesPanelSections.Effects,
16
17
  ],
17
18
  props: {
18
- source: createSvgProp(),
19
+ source: createSVGProp(),
19
20
  },
20
21
  };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  COMPONENT_TYPES,
3
- createSvgProp,
3
+ createSVGProp,
4
4
  StylesPanelSections,
5
5
  } from "@draftbit/types";
6
6
 
@@ -8,6 +8,7 @@ export const SEED_DATA = {
8
8
  name: "SVG",
9
9
  tag: "SVG",
10
10
  description: "An SVG component",
11
+ packageName: "@draftbit/core",
11
12
  category: COMPONENT_TYPES.media,
12
13
  layout: {
13
14
  width: 100,
@@ -20,6 +21,6 @@ export const SEED_DATA = {
20
21
  StylesPanelSections.Effects,
21
22
  ],
22
23
  props: {
23
- source: createSvgProp(),
24
+ source: createSVGProp(),
24
25
  },
25
26
  };
@@ -1,7 +0,0 @@
1
- import * as React from "react";
2
- declare type SvgComponentProps = {
3
- source: string;
4
- style?: any;
5
- };
6
- declare const Svg: React.FC<React.PropsWithChildren<SvgComponentProps>>;
7
- export default Svg;