@draftbit/core 46.7.9-13d0dd.2 → 46.7.9-157e2b.2

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 (36) hide show
  1. package/lib/commonjs/components/DatePicker/DatePicker.js +0 -6
  2. package/lib/commonjs/components/DeprecatedFAB.js +21 -3
  3. package/lib/commonjs/components/Divider.js +1 -14
  4. package/lib/commonjs/components/Elevation.js +2 -14
  5. package/lib/commonjs/components/Picker/Picker.js +1 -7
  6. package/lib/commonjs/mappings/DatePicker.js +1 -6
  7. package/lib/commonjs/mappings/Picker.js +0 -5
  8. package/lib/commonjs/mappings/expo/Image.js +90 -0
  9. package/lib/module/components/Accordion/AccordionItem.js +4 -25
  10. package/lib/module/components/CircleImage.js +16 -1
  11. package/lib/module/components/DatePicker/DatePicker.js +1 -7
  12. package/lib/module/components/Picker/Picker.js +2 -8
  13. package/lib/module/mappings/DatePicker.js +2 -7
  14. package/lib/module/mappings/Picker.js +1 -6
  15. package/lib/module/mappings/expo/Image.js +83 -0
  16. package/lib/typescript/src/components/DatePicker/DatePicker.d.ts +0 -1
  17. package/lib/typescript/src/components/DatePicker/DatePicker.d.ts.map +1 -1
  18. package/lib/typescript/src/components/Picker/Picker.d.ts +0 -1
  19. package/lib/typescript/src/components/Picker/Picker.d.ts.map +1 -1
  20. package/lib/typescript/src/mappings/DatePicker.d.ts +0 -10
  21. package/lib/typescript/src/mappings/DatePicker.d.ts.map +1 -1
  22. package/lib/typescript/src/mappings/Picker.d.ts +0 -10
  23. package/lib/typescript/src/mappings/Picker.d.ts.map +1 -1
  24. package/lib/typescript/src/mappings/expo/Image.d.ts +155 -0
  25. package/lib/typescript/src/mappings/expo/Image.d.ts.map +1 -0
  26. package/package.json +3 -3
  27. package/src/components/DatePicker/DatePicker.js +2 -7
  28. package/src/components/DatePicker/DatePicker.tsx +0 -9
  29. package/src/components/Picker/Picker.js +2 -7
  30. package/src/components/Picker/Picker.tsx +0 -9
  31. package/src/mappings/DatePicker.js +1 -6
  32. package/src/mappings/DatePicker.ts +0 -6
  33. package/src/mappings/Picker.js +1 -6
  34. package/src/mappings/Picker.ts +0 -6
  35. package/src/mappings/expo/Image.js +107 -0
  36. package/src/mappings/expo/Image.ts +131 -0
@@ -48,7 +48,6 @@ const DatePicker = _ref => {
48
48
  placeholder,
49
49
  borderColor: inputBorderColor,
50
50
  borderColorActive: inputBorderColorActive,
51
- autoDismissKeyboard = true,
52
51
  ...props
53
52
  } = _ref;
54
53
  const [value, setValue] = React.useState(date || defaultValue);
@@ -144,11 +143,6 @@ const DatePicker = _ref => {
144
143
  clearTimeout(_showPlaceholder());
145
144
  };
146
145
  }, [focused, label, placeholder]);
147
- React.useEffect(() => {
148
- if (pickerVisible && autoDismissKeyboard) {
149
- _reactNative.Keyboard.dismiss();
150
- }
151
- }, [pickerVisible, autoDismissKeyboard]);
152
146
  const _handleFocus = () => {
153
147
  if (disabled) {
154
148
  return;
@@ -14,7 +14,6 @@ var _theming = require("../theming");
14
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
15
  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); }
16
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; }
17
- 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); }
18
17
  const FAB = _ref => {
19
18
  let {
20
19
  Icon,
@@ -106,7 +105,8 @@ const FAB = _ref => {
106
105
  style: [{
107
106
  elevation
108
107
  }, style]
109
- }, /*#__PURE__*/React.createElement(_reactNative.Pressable, _extends({}, rest, {
108
+ }, /*#__PURE__*/React.createElement(_reactNative.Pressable, {
109
+ ...rest,
110
110
  onPress: onPress,
111
111
  accessibilityState: {
112
112
  disabled
@@ -114,7 +114,7 @@ const FAB = _ref => {
114
114
  accessibilityRole: "button",
115
115
  disabled: disabled || loading,
116
116
  style: buttonStyles
117
- }), /*#__PURE__*/React.createElement(_reactNative.View, {
117
+ }, /*#__PURE__*/React.createElement(_reactNative.View, {
118
118
  style: styles.content
119
119
  }, icon && loading !== true ? /*#__PURE__*/React.createElement(_reactNative.View, {
120
120
  style: iconStyle
@@ -154,4 +154,22 @@ const styles = _reactNative.StyleSheet.create({
154
154
  }
155
155
  });
156
156
  var _default = (0, _theming.withTheme)(FAB);
157
+ exports.default = _default;ow",
158
+ alignItems: "center",
159
+ justifyContent: "center"
160
+ },
161
+ icon: {
162
+ alignItems: "center",
163
+ justifyContent: "center",
164
+ width: _Config.default.buttonIconSize
165
+ },
166
+ fixed: {
167
+ left: 0,
168
+ right: 0,
169
+ bottom: 0,
170
+ height: 64,
171
+ borderRadius: 0
172
+ }
173
+ });
174
+ var _default = (0, _theming.withTheme)(FAB);
157
175
  exports.default = _default;
@@ -9,6 +9,7 @@ var _reactNative = require("react-native");
9
9
  var _theming = require("../theming");
10
10
  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); }
11
11
  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; }
12
+ 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); }
12
13
  const Divider = _ref => {
13
14
  let {
14
15
  style,
@@ -18,20 +19,6 @@ const Divider = _ref => {
18
19
  },
19
20
  ...rest
20
21
  } = _ref;
21
- return /*#__PURE__*/React.createElement(_reactNative.View, {
22
- style: [{
23
- backgroundColor: color || colors.divider,
24
- height: _reactNative.StyleSheet.hairlineWidth
25
- }, style],
26
- ...rest
27
- });
28
- };
29
- var _default = (0, _theming.withTheme)(Divider);
30
- exports.default = _default;eme: {
31
- colors
32
- },
33
- ...rest
34
- } = _ref;
35
22
  return /*#__PURE__*/React.createElement(_reactNative.View, _extends({
36
23
  style: [{
37
24
  backgroundColor: color || colors.divider,
@@ -11,6 +11,7 @@ var _theming = require("../theming");
11
11
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
12
  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); }
13
13
  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; }
14
+ 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); }
14
15
  /* directly copied from https://github.com/callstack/react-native-paper/blob/main/src/components/Surface.tsx#L62 */
15
16
  const Elevation = _ref => {
16
17
  let {
@@ -27,24 +28,11 @@ const Elevation = _ref => {
27
28
  colors
28
29
  } = theme;
29
30
  const borderRadius = radius;
30
- return /*#__PURE__*/React.createElement(_reactNative.Animated.View, {
31
- ...rest,
31
+ return /*#__PURE__*/React.createElement(_reactNative.Animated.View, _extends({}, rest, {
32
32
  style: [{
33
33
  borderRadius,
34
34
  backgroundColor: colors.surface
35
35
  }, elevation ? (0, _shadow.default)(elevation) : null, style]
36
- }, /*#__PURE__*/React.createElement(_reactNative.View, {
37
- style: {
38
- overflow: "hidden",
39
- borderRadius
40
- }
41
- }, children));
42
- };
43
- var _default = (0, _theming.withTheme)(Elevation);
44
- exports.default = _default;
45
- borderRadius,
46
- backgroundColor: colors.surface
47
- }, elevation ? (0, _shadow.default)(elevation) : null, style]
48
36
  }), /*#__PURE__*/React.createElement(_reactNative.View, {
49
37
  style: {
50
38
  overflow: "hidden",
@@ -65,8 +65,7 @@ const Picker = _ref => {
65
65
  leftIconName,
66
66
  placeholderTextColor = unstyledColor,
67
67
  rightIconName,
68
- type = "solid",
69
- autoDismissKeyboard = true
68
+ type = "solid"
70
69
  } = _ref;
71
70
  const androidPickerRef = React.useRef(undefined);
72
71
  const [internalValue, setInternalValue] = React.useState(value || defaultValue);
@@ -90,11 +89,6 @@ const Picker = _ref => {
90
89
  androidPickerRef === null || androidPickerRef === void 0 ? void 0 : (_androidPickerRef$cur = androidPickerRef.current) === null || _androidPickerRef$cur === void 0 ? void 0 : _androidPickerRef$cur.focus();
91
90
  }
92
91
  }, [pickerVisible, androidPickerRef]);
93
- React.useEffect(() => {
94
- if (pickerVisible && autoDismissKeyboard) {
95
- _reactNative.Keyboard.dismiss();
96
- }
97
- }, [pickerVisible, autoDismissKeyboard]);
98
92
  const normalizedOptions = normalizeOptions(options);
99
93
  const pickerOptions = placeholder ? [{
100
94
  value: placeholder,
@@ -169,12 +169,7 @@ const SEED_DATA = [{
169
169
  editable: true,
170
170
  required: true,
171
171
  group: _types.GROUPS.basic
172
- },
173
- autoDismissKeyboard: (0, _types.createStaticBoolProp)({
174
- label: "Auto dismiss keyboard",
175
- description: "Automatically dismiss keyboard when DatePicker is opened",
176
- defaultValue: true
177
- })
172
+ }
178
173
  }
179
174
  }];
180
175
  exports.SEED_DATA = SEED_DATA;
@@ -142,11 +142,6 @@ const SEED_DATA = [{
142
142
  }),
143
143
  iconColor: (0, _types.createColorProp)({
144
144
  label: "Icon Color"
145
- }),
146
- autoDismissKeyboard: (0, _types.createStaticBoolProp)({
147
- label: "Auto dismiss keyboard",
148
- description: "Automatically dismiss keyboard when Picker is opened",
149
- defaultValue: true
150
145
  })
151
146
  },
152
147
  layout: {}
@@ -0,0 +1,90 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.SEED_DATA = void 0;
7
+ var _types = require("@draftbit/types");
8
+ const SEED_DATA = {
9
+ name: "Expo Image",
10
+ tag: "Image",
11
+ packageName: "expo-image",
12
+ collection: "Expo",
13
+ prefixCollectionOnImport: true,
14
+ description: "A responsive Image component",
15
+ category: _types.COMPONENT_TYPES.media,
16
+ stylesPanelSections: [_types.StylesPanelSections.Size, _types.StylesPanelSections.Margins, _types.StylesPanelSections.Position, _types.StylesPanelSections.Effects, _types.StylesPanelSections.Borders],
17
+ layout: {
18
+ width: 100,
19
+ height: 100
20
+ },
21
+ triggers: [_types.Triggers.OnLoad, _types.Triggers.OnError],
22
+ props: {
23
+ onLoad: (0, _types.createActionProp)(),
24
+ onError: (0, _types.createActionProp)(),
25
+ source: (0, _types.createImageProp)(),
26
+ placeholder: (0, _types.createImageProp)({
27
+ label: "Placeholder",
28
+ description: "An image to display while loading the proper image and no image has been displayed yet or the source is unset.",
29
+ required: false,
30
+ defaultValue: null
31
+ }),
32
+ contentFit: (0, _types.createTextEnumProp)({
33
+ label: "Content Fit",
34
+ description: 'Determines how the image should be resized to fit its container. This property tells the image to fill the container in a variety of ways; such as "preserve that aspect ratio" or "stretch up and take up as much space as possible". It mirrors the CSS object-fit property.',
35
+ options: ["cover", "contain", "fill", "none", "scale-down"],
36
+ defaultValue: null
37
+ }),
38
+ contentPosition: (0, _types.createTextEnumProp)({
39
+ label: "Content Position",
40
+ description: "It is used together with contentFit to specify how the image should be positioned with x/y coordinates inside its own container. An equivalent of the CSS object-position property.",
41
+ options: ["center", "top", "left", "right", "bottom", "top left", "top center", "top right", "left center", "left top", "left bottom", "right center", "right top", "right bottom", "bottom center", "bottom left", "bottom right"],
42
+ default: null
43
+ }),
44
+ cachePolicy: (0, _types.createTextEnumProp)({
45
+ label: "Cache Policy",
46
+ description: "Determines whether to cache the image and where: on the disk, in the memory or both.",
47
+ options: ["none", "disk", "memory", "memory-disk"],
48
+ defaultValue: null
49
+ }),
50
+ focusable: (0, _types.createStaticBoolProp)({
51
+ label: "Focusable",
52
+ description: "Whether this View should be focusable with a non-touch input device and receive focus with a hardware keyboard.",
53
+ group: _types.GROUPS.android,
54
+ defaultValue: null
55
+ }),
56
+ priority: (0, _types.createTextEnumProp)({
57
+ label: "Priority",
58
+ description: "Priorities for completing loads. If more than one load is queued at a time, the load with the higher priority will be started first. Priorities are considered best effort, there are no guarantees about the order in which loads will start or finish.",
59
+ options: ["normal", "high", "low"],
60
+ defaultValue: null
61
+ }),
62
+ responsivePolicy: (0, _types.createTextEnumProp)({
63
+ label: "Responsive Policy",
64
+ description: "Determines whether to choose image source based on container size only on mount or on every resize. Use initial to improve performance.",
65
+ options: ["initial", "live"],
66
+ defaultValue: null,
67
+ group: _types.GROUPS.web
68
+ }),
69
+ tintColor: (0, _types.createColorProp)({
70
+ label: "Tint Color",
71
+ description: "A color used to tint template images (a bitmap image where only the opacity matters). The color is applied to every non-transparent pixel, causing the image’s shape to adopt that color. This effect is not applied to placeholders."
72
+ }),
73
+ accessibilityLabel: (0, _types.createTextProp)({
74
+ label: "Accessibility Label",
75
+ description: "The text that's read by the screen reader when the user interacts with the image.",
76
+ defaultValue: null
77
+ }),
78
+ accessible: (0, _types.createStaticBoolProp)({
79
+ label: "Accessible",
80
+ description: "When true, indicates that the view is an accessibility element. When a view is an accessibility element, it groups its children into a single selectable component.",
81
+ defaultValue: null
82
+ }),
83
+ blurRadius: (0, _types.createStaticNumberProp)({
84
+ label: "Blur Radius",
85
+ description: "The radius of the blur in points, 0 means no blur effect. This effect is not applied to placeholders.",
86
+ defaultValue: null
87
+ })
88
+ }
89
+ };
90
+ exports.SEED_DATA = SEED_DATA;
@@ -1,3 +1,4 @@
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); }
1
2
  import * as React from "react";
2
3
  import { Pressable, StyleSheet, View } from "react-native";
3
4
  import Text from "../Text";
@@ -17,10 +18,9 @@ const AccordionItem = _ref => {
17
18
  textStyles,
18
19
  viewStyles
19
20
  } = extractStyles(style);
20
- return /*#__PURE__*/React.createElement(Pressable, {
21
- style: [styles.container, viewStyles],
22
- ...rest
23
- }, /*#__PURE__*/React.createElement(View, {
21
+ return /*#__PURE__*/React.createElement(Pressable, _extends({
22
+ style: [styles.container, viewStyles]
23
+ }, rest), /*#__PURE__*/React.createElement(View, {
24
24
  style: styles.row
25
25
  }, icon ? /*#__PURE__*/React.createElement(Icon, {
26
26
  name: icon,
@@ -51,25 +51,4 @@ const styles = StyleSheet.create({
51
51
  justifyContent: "center"
52
52
  }
53
53
  });
54
- export default withTheme(AccordionItem);xtStyles
55
- }, label))));
56
- };
57
- const styles = StyleSheet.create({
58
- container: {
59
- padding: 8
60
- },
61
- row: {
62
- flexDirection: "row",
63
- alignItems: "center",
64
- paddingLeft: 8
65
- },
66
- item: {
67
- marginVertical: 6,
68
- paddingLeft: 8
69
- },
70
- content: {
71
- flex: 1,
72
- justifyContent: "center"
73
- }
74
- });
75
54
  export default withTheme(AccordionItem);
@@ -1,4 +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
1
  import * as React from "react";
3
2
  import { Image } from "react-native";
4
3
  import Config from "./Config";
@@ -10,6 +9,22 @@ const CircleImage = _ref => {
10
9
  ...props
11
10
  } = _ref;
12
11
  const borderRadius = size / 2;
12
+ return /*#__PURE__*/React.createElement(Image, {
13
+ style: [{
14
+ width: size,
15
+ height: size,
16
+ borderRadius
17
+ }, style],
18
+ source: typeof source === "string" ? {
19
+ uri: source
20
+ } : source,
21
+ resizeMode: "cover",
22
+ ...props
23
+ });
24
+ };
25
+ export default CircleImage;props
26
+ } = _ref;
27
+ const borderRadius = size / 2;
13
28
  return /*#__PURE__*/React.createElement(Image, _extends({
14
29
  style: [{
15
30
  width: size,
@@ -1,6 +1,6 @@
1
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
2
  import * as React from "react";
3
- import { View, Animated, Text, StyleSheet, I18nManager, TextInput as NativeTextInput, Keyboard } from "react-native";
3
+ import { View, Animated, Text, StyleSheet, I18nManager, TextInput as NativeTextInput } from "react-native";
4
4
  import { useSafeAreaInsets } from "react-native-safe-area-context";
5
5
  import dateFormat from "dateformat";
6
6
  import { withTheme } from "../../theming";
@@ -39,7 +39,6 @@ const DatePicker = _ref => {
39
39
  placeholder,
40
40
  borderColor: inputBorderColor,
41
41
  borderColorActive: inputBorderColorActive,
42
- autoDismissKeyboard = true,
43
42
  ...props
44
43
  } = _ref;
45
44
  const [value, setValue] = React.useState(date || defaultValue);
@@ -135,11 +134,6 @@ const DatePicker = _ref => {
135
134
  clearTimeout(_showPlaceholder());
136
135
  };
137
136
  }, [focused, label, placeholder]);
138
- React.useEffect(() => {
139
- if (pickerVisible && autoDismissKeyboard) {
140
- Keyboard.dismiss();
141
- }
142
- }, [pickerVisible, autoDismissKeyboard]);
143
137
  const _handleFocus = () => {
144
138
  if (disabled) {
145
139
  return;
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import { View, StyleSheet, Text, Platform, Dimensions, Keyboard } from "react-native";
2
+ import { View, StyleSheet, Text, Platform, Dimensions } from "react-native";
3
3
  import { omit, pickBy, identity, isObject } from "lodash";
4
4
  import { SafeAreaView } from "react-native-safe-area-context";
5
5
  import { Picker as NativePicker } from "@react-native-picker/picker";
@@ -56,8 +56,7 @@ const Picker = _ref => {
56
56
  leftIconName,
57
57
  placeholderTextColor = unstyledColor,
58
58
  rightIconName,
59
- type = "solid",
60
- autoDismissKeyboard = true
59
+ type = "solid"
61
60
  } = _ref;
62
61
  const androidPickerRef = React.useRef(undefined);
63
62
  const [internalValue, setInternalValue] = React.useState(value || defaultValue);
@@ -81,11 +80,6 @@ const Picker = _ref => {
81
80
  androidPickerRef === null || androidPickerRef === void 0 ? void 0 : (_androidPickerRef$cur = androidPickerRef.current) === null || _androidPickerRef$cur === void 0 ? void 0 : _androidPickerRef$cur.focus();
82
81
  }
83
82
  }, [pickerVisible, androidPickerRef]);
84
- React.useEffect(() => {
85
- if (pickerVisible && autoDismissKeyboard) {
86
- Keyboard.dismiss();
87
- }
88
- }, [pickerVisible, autoDismissKeyboard]);
89
83
  const normalizedOptions = normalizeOptions(options);
90
84
  const pickerOptions = placeholder ? [{
91
85
  value: placeholder,
@@ -1,4 +1,4 @@
1
- import { COMPONENT_TYPES, FORM_TYPES, PROP_TYPES, FIELD_NAME, GROUPS, Triggers, StylesPanelSections, createNumberProp, createColorProp, createStaticBoolProp } from "@draftbit/types";
1
+ import { COMPONENT_TYPES, FORM_TYPES, PROP_TYPES, FIELD_NAME, GROUPS, Triggers, StylesPanelSections, createNumberProp, createColorProp } from "@draftbit/types";
2
2
  const SEED_DATA_PROPS = {
3
3
  mode: {
4
4
  label: "Mode",
@@ -163,11 +163,6 @@ export const SEED_DATA = [{
163
163
  editable: true,
164
164
  required: true,
165
165
  group: GROUPS.basic
166
- },
167
- autoDismissKeyboard: createStaticBoolProp({
168
- label: "Auto dismiss keyboard",
169
- description: "Automatically dismiss keyboard when DatePicker is opened",
170
- defaultValue: true
171
- })
166
+ }
172
167
  }
173
168
  }];
@@ -1,4 +1,4 @@
1
- import { COMPONENT_TYPES, Triggers, GROUPS, FORM_TYPES, PROP_TYPES, FIELD_NAME, createIconSizeProp, createColorProp, StylesPanelSections, createStaticBoolProp } from "@draftbit/types";
1
+ import { COMPONENT_TYPES, Triggers, GROUPS, FORM_TYPES, PROP_TYPES, FIELD_NAME, createIconSizeProp, createColorProp, StylesPanelSections } from "@draftbit/types";
2
2
  const SEED_DATA_PROPS = {
3
3
  label: {
4
4
  group: GROUPS.data,
@@ -136,11 +136,6 @@ export const SEED_DATA = [{
136
136
  }),
137
137
  iconColor: createColorProp({
138
138
  label: "Icon Color"
139
- }),
140
- autoDismissKeyboard: createStaticBoolProp({
141
- label: "Auto dismiss keyboard",
142
- description: "Automatically dismiss keyboard when Picker is opened",
143
- defaultValue: true
144
139
  })
145
140
  },
146
141
  layout: {}
@@ -0,0 +1,83 @@
1
+ import { COMPONENT_TYPES, createImageProp, StylesPanelSections, createTextProp, createStaticBoolProp, createTextEnumProp, createStaticNumberProp, Triggers, createActionProp, GROUPS, createColorProp } from "@draftbit/types";
2
+ export const SEED_DATA = {
3
+ name: "Expo Image",
4
+ tag: "Image",
5
+ packageName: "expo-image",
6
+ collection: "Expo",
7
+ prefixCollectionOnImport: true,
8
+ description: "A responsive Image component",
9
+ category: COMPONENT_TYPES.media,
10
+ stylesPanelSections: [StylesPanelSections.Size, StylesPanelSections.Margins, StylesPanelSections.Position, StylesPanelSections.Effects, StylesPanelSections.Borders],
11
+ layout: {
12
+ width: 100,
13
+ height: 100
14
+ },
15
+ triggers: [Triggers.OnLoad, Triggers.OnError],
16
+ props: {
17
+ onLoad: createActionProp(),
18
+ onError: createActionProp(),
19
+ source: createImageProp(),
20
+ placeholder: createImageProp({
21
+ label: "Placeholder",
22
+ description: "An image to display while loading the proper image and no image has been displayed yet or the source is unset.",
23
+ required: false,
24
+ defaultValue: null
25
+ }),
26
+ contentFit: createTextEnumProp({
27
+ label: "Content Fit",
28
+ description: 'Determines how the image should be resized to fit its container. This property tells the image to fill the container in a variety of ways; such as "preserve that aspect ratio" or "stretch up and take up as much space as possible". It mirrors the CSS object-fit property.',
29
+ options: ["cover", "contain", "fill", "none", "scale-down"],
30
+ defaultValue: null
31
+ }),
32
+ contentPosition: createTextEnumProp({
33
+ label: "Content Position",
34
+ description: "It is used together with contentFit to specify how the image should be positioned with x/y coordinates inside its own container. An equivalent of the CSS object-position property.",
35
+ options: ["center", "top", "left", "right", "bottom", "top left", "top center", "top right", "left center", "left top", "left bottom", "right center", "right top", "right bottom", "bottom center", "bottom left", "bottom right"],
36
+ default: null
37
+ }),
38
+ cachePolicy: createTextEnumProp({
39
+ label: "Cache Policy",
40
+ description: "Determines whether to cache the image and where: on the disk, in the memory or both.",
41
+ options: ["none", "disk", "memory", "memory-disk"],
42
+ defaultValue: null
43
+ }),
44
+ focusable: createStaticBoolProp({
45
+ label: "Focusable",
46
+ description: "Whether this View should be focusable with a non-touch input device and receive focus with a hardware keyboard.",
47
+ group: GROUPS.android,
48
+ defaultValue: null
49
+ }),
50
+ priority: createTextEnumProp({
51
+ label: "Priority",
52
+ description: "Priorities for completing loads. If more than one load is queued at a time, the load with the higher priority will be started first. Priorities are considered best effort, there are no guarantees about the order in which loads will start or finish.",
53
+ options: ["normal", "high", "low"],
54
+ defaultValue: null
55
+ }),
56
+ responsivePolicy: createTextEnumProp({
57
+ label: "Responsive Policy",
58
+ description: "Determines whether to choose image source based on container size only on mount or on every resize. Use initial to improve performance.",
59
+ options: ["initial", "live"],
60
+ defaultValue: null,
61
+ group: GROUPS.web
62
+ }),
63
+ tintColor: createColorProp({
64
+ label: "Tint Color",
65
+ description: "A color used to tint template images (a bitmap image where only the opacity matters). The color is applied to every non-transparent pixel, causing the image’s shape to adopt that color. This effect is not applied to placeholders."
66
+ }),
67
+ accessibilityLabel: createTextProp({
68
+ label: "Accessibility Label",
69
+ description: "The text that's read by the screen reader when the user interacts with the image.",
70
+ defaultValue: null
71
+ }),
72
+ accessible: createStaticBoolProp({
73
+ label: "Accessible",
74
+ description: "When true, indicates that the view is an accessibility element. When a view is an accessibility element, it groups its children into a single selectable component.",
75
+ defaultValue: null
76
+ }),
77
+ blurRadius: createStaticNumberProp({
78
+ label: "Blur Radius",
79
+ description: "The radius of the blur in points, 0 means no blur effect. This effect is not applied to placeholders.",
80
+ defaultValue: null
81
+ })
82
+ }
83
+ };
@@ -23,7 +23,6 @@ declare type Props = {
23
23
  rightIconName?: string;
24
24
  borderColor?: string;
25
25
  borderColorActive?: string;
26
- autoDismissKeyboard?: boolean;
27
26
  } & IconSlot & TextInputProps;
28
27
  declare const _default: React.ComponentType<import("@draftbit/react-theme-provider").$Without<React.PropsWithChildren<Props>, "theme"> & {
29
28
  theme?: import("@draftbit/react-theme-provider").$DeepPartial<any> | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"DatePicker.d.ts","sourceRoot":"","sources":["../../../../../src/components/DatePicker/DatePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAKL,SAAS,EACT,SAAS,EACT,SAAS,EACT,cAAc,EAMf,MAAM,cAAc,CAAC;AAStB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAStD,aAAK,KAAK,GAAG;IACX,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,GAAG,SAAS,CAAC,GAAG;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC/D,KAAK,EAAE,KAAK,CAAC;IAMb,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,IAAI,KAAK,IAAI,CAAC;IACrC,YAAY,CAAC,EAAE,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,UAAU,CAAC;IACpC,IAAI,CAAC,EAAE,OAAO,GAAG,WAAW,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IAClC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B,GAAG,QAAQ,GACV,cAAc,CAAC;;;;AAsgBjB,wBAAqC"}
1
+ {"version":3,"file":"DatePicker.d.ts","sourceRoot":"","sources":["../../../../../src/components/DatePicker/DatePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAKL,SAAS,EACT,SAAS,EACT,SAAS,EACT,cAAc,EAKf,MAAM,cAAc,CAAC;AAStB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAStD,aAAK,KAAK,GAAG;IACX,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,GAAG,SAAS,CAAC,GAAG;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC/D,KAAK,EAAE,KAAK,CAAC;IAMb,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,IAAI,KAAK,IAAI,CAAC;IACrC,YAAY,CAAC,EAAE,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,UAAU,CAAC;IACpC,IAAI,CAAC,EAAE,OAAO,GAAG,WAAW,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IAClC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,GAAG,QAAQ,GACV,cAAc,CAAC;;;;AA+fjB,wBAAqC"}
@@ -26,7 +26,6 @@ export declare type PickerProps = {
26
26
  placeholderTextColor?: string;
27
27
  rightIconName?: string;
28
28
  type?: "solid" | "underline";
29
- autoDismissKeyboard?: boolean;
30
29
  theme: Theme;
31
30
  Icon: IconSlot["Icon"];
32
31
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Picker.d.ts","sourceRoot":"","sources":["../../../../../src/components/Picker/Picker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAKL,SAAS,EACT,SAAS,EAGV,MAAM,cAAc,CAAC;AAStB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAQtD,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,oBAAY,WAAW,GAAG;IACxB,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,GAAG;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACnD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,YAAY,EAAE,GAAG,MAAM,EAAE,CAAC;IACnC,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACtD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;IAClC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE,OAAO,GAAG,WAAW,CAAC;IAC7B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,KAAK,EAAE,KAAK,CAAC;IACb,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;CACxB,CAAC;;;;AAwaF,wBAAiC"}
1
+ {"version":3,"file":"Picker.d.ts","sourceRoot":"","sources":["../../../../../src/components/Picker/Picker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAKL,SAAS,EACT,SAAS,EAEV,MAAM,cAAc,CAAC;AAStB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAQtD,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,oBAAY,WAAW,GAAG;IACxB,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,GAAG;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACnD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,YAAY,EAAE,GAAG,MAAM,EAAE,CAAC;IACnC,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACtD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;IAClC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE,OAAO,GAAG,WAAW,CAAC;IAC7B,KAAK,EAAE,KAAK,CAAC;IACb,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;CACxB,CAAC;;;;AAiaF,wBAAiC"}
@@ -18,16 +18,6 @@ export declare const SEED_DATA: {
18
18
  required: boolean;
19
19
  group: string;
20
20
  };
21
- autoDismissKeyboard: {
22
- label: string;
23
- description: string;
24
- formType: string;
25
- propType: string;
26
- defaultValue: boolean;
27
- editable: boolean;
28
- required: boolean;
29
- group: string;
30
- };
31
21
  mode: {
32
22
  label: string;
33
23
  description: string;
@@ -1 +1 @@
1
- {"version":3,"file":"DatePicker.d.ts","sourceRoot":"","sources":["../../../../src/mappings/DatePicker.ts"],"names":[],"mappings":"AAgKA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCrB,CAAC"}
1
+ {"version":3,"file":"DatePicker.d.ts","sourceRoot":"","sources":["../../../../src/mappings/DatePicker.ts"],"names":[],"mappings":"AA+JA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BrB,CAAC"}
@@ -40,16 +40,6 @@ export declare const SEED_DATA: {
40
40
  formType: string;
41
41
  propType: string;
42
42
  };
43
- autoDismissKeyboard: {
44
- label: string;
45
- description: string;
46
- formType: string;
47
- propType: string;
48
- defaultValue: boolean;
49
- editable: boolean;
50
- required: boolean;
51
- group: string;
52
- };
53
43
  label: {
54
44
  group: string;
55
45
  label: string;
@@ -1 +1 @@
1
- {"version":3,"file":"Picker.d.ts","sourceRoot":"","sources":["../../../../src/mappings/Picker.ts"],"names":[],"mappings":"AA+HA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCrB,CAAC"}
1
+ {"version":3,"file":"Picker.d.ts","sourceRoot":"","sources":["../../../../src/mappings/Picker.ts"],"names":[],"mappings":"AA8HA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCrB,CAAC"}
@@ -0,0 +1,155 @@
1
+ export declare const SEED_DATA: {
2
+ name: string;
3
+ tag: string;
4
+ packageName: string;
5
+ collection: string;
6
+ prefixCollectionOnImport: boolean;
7
+ description: string;
8
+ category: string;
9
+ stylesPanelSections: string[];
10
+ layout: {
11
+ width: number;
12
+ height: number;
13
+ };
14
+ triggers: string[];
15
+ props: {
16
+ onLoad: {
17
+ label: string;
18
+ description: string;
19
+ editable: boolean;
20
+ required: boolean;
21
+ formType: string;
22
+ propType: string;
23
+ defaultValue: null;
24
+ group: string;
25
+ };
26
+ onError: {
27
+ label: string;
28
+ description: string;
29
+ editable: boolean;
30
+ required: boolean;
31
+ formType: string;
32
+ propType: string;
33
+ defaultValue: null;
34
+ group: string;
35
+ };
36
+ source: {
37
+ label: string;
38
+ description: string;
39
+ group: string;
40
+ formType: string;
41
+ propType: string;
42
+ defaultValue: string;
43
+ editable: boolean;
44
+ required: boolean;
45
+ };
46
+ placeholder: {
47
+ label: string;
48
+ description: string;
49
+ group: string;
50
+ formType: string;
51
+ propType: string;
52
+ defaultValue: string;
53
+ editable: boolean;
54
+ required: boolean;
55
+ };
56
+ contentFit: {
57
+ group: string;
58
+ label: string;
59
+ description: string;
60
+ editable: boolean;
61
+ required: boolean;
62
+ formType: string;
63
+ propType: string;
64
+ defaultValue: null;
65
+ options: never[];
66
+ };
67
+ contentPosition: {
68
+ group: string;
69
+ label: string;
70
+ description: string;
71
+ editable: boolean;
72
+ required: boolean;
73
+ formType: string;
74
+ propType: string;
75
+ defaultValue: null;
76
+ options: never[];
77
+ };
78
+ cachePolicy: {
79
+ group: string;
80
+ label: string;
81
+ description: string;
82
+ editable: boolean;
83
+ required: boolean;
84
+ formType: string;
85
+ propType: string;
86
+ defaultValue: null;
87
+ options: never[];
88
+ };
89
+ focusable: {
90
+ label: string;
91
+ description: string;
92
+ formType: string;
93
+ propType: string;
94
+ defaultValue: boolean;
95
+ editable: boolean;
96
+ required: boolean;
97
+ group: string;
98
+ };
99
+ priority: {
100
+ group: string;
101
+ label: string;
102
+ description: string;
103
+ editable: boolean;
104
+ required: boolean;
105
+ formType: string;
106
+ propType: string;
107
+ defaultValue: null;
108
+ options: never[];
109
+ };
110
+ responsivePolicy: {
111
+ group: string;
112
+ label: string;
113
+ description: string;
114
+ editable: boolean;
115
+ required: boolean;
116
+ formType: string;
117
+ propType: string;
118
+ defaultValue: null;
119
+ options: never[];
120
+ };
121
+ tintColor: {
122
+ group: string;
123
+ label: string;
124
+ description: string;
125
+ editable: boolean;
126
+ required: boolean;
127
+ defaultValue: null;
128
+ formType: string;
129
+ propType: string;
130
+ };
131
+ accessibilityLabel: any;
132
+ accessible: {
133
+ label: string;
134
+ description: string;
135
+ formType: string;
136
+ propType: string;
137
+ defaultValue: boolean;
138
+ editable: boolean;
139
+ required: boolean;
140
+ group: string;
141
+ };
142
+ blurRadius: {
143
+ label: string;
144
+ description: string;
145
+ formType: string;
146
+ propType: string;
147
+ group: string;
148
+ defaultValue: null;
149
+ editable: boolean;
150
+ required: boolean;
151
+ step: number;
152
+ };
153
+ };
154
+ };
155
+ //# sourceMappingURL=Image.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Image.d.ts","sourceRoot":"","sources":["../../../../../src/mappings/expo/Image.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoHrB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@draftbit/core",
3
- "version": "46.7.9-13d0dd.2+13d0dde",
3
+ "version": "46.7.9-157e2b.2+157e2b1",
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.7.9-13d0dd.2+13d0dde",
44
+ "@draftbit/types": "^46.7.9-157e2b.2+157e2b1",
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",
@@ -91,5 +91,5 @@
91
91
  ]
92
92
  ]
93
93
  },
94
- "gitHead": "13d0dde6f213290a9a26f91f0ac79c5a2d124560"
94
+ "gitHead": "157e2b18fb2aca142c8ba3f448f3e6e36232db26"
95
95
  }
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import { View, Animated, Text, StyleSheet, I18nManager, TextInput as NativeTextInput, Keyboard, } from "react-native";
2
+ import { View, Animated, Text, StyleSheet, I18nManager, TextInput as NativeTextInput, } from "react-native";
3
3
  import { useSafeAreaInsets } from "react-native-safe-area-context";
4
4
  import dateFormat from "dateformat";
5
5
  import { withTheme } from "../../theming";
@@ -25,7 +25,7 @@ const MONTHS = [
25
25
  "November",
26
26
  "December",
27
27
  ];
28
- const DatePicker = ({ Icon, style, theme: { colors, typography, roundness, disabledOpacity }, date, onDateChange = () => { }, defaultValue, disabled = false, mode = "date", format, type = "underline", leftIconName, rightIconName, leftIconMode = "inset", label, labelSize, labelColor, placeholder, borderColor: inputBorderColor, borderColorActive: inputBorderColorActive, autoDismissKeyboard = true, ...props }) => {
28
+ const DatePicker = ({ Icon, style, theme: { colors, typography, roundness, disabledOpacity }, date, onDateChange = () => { }, defaultValue, disabled = false, mode = "date", format, type = "underline", leftIconName, rightIconName, leftIconMode = "inset", label, labelSize, labelColor, placeholder, borderColor: inputBorderColor, borderColorActive: inputBorderColorActive, ...props }) => {
29
29
  const [value, setValue] = React.useState(date || defaultValue);
30
30
  React.useEffect(() => {
31
31
  if (defaultValue != null) {
@@ -113,11 +113,6 @@ const DatePicker = ({ Icon, style, theme: { colors, typography, roundness, disab
113
113
  clearTimeout(_showPlaceholder());
114
114
  };
115
115
  }, [focused, label, placeholder]);
116
- React.useEffect(() => {
117
- if (pickerVisible && autoDismissKeyboard) {
118
- Keyboard.dismiss();
119
- }
120
- }, [pickerVisible, autoDismissKeyboard]);
121
116
  const _handleFocus = () => {
122
117
  if (disabled) {
123
118
  return;
@@ -12,7 +12,6 @@ import {
12
12
  I18nManager,
13
13
  LayoutChangeEvent,
14
14
  TextInput as NativeTextInput,
15
- Keyboard,
16
15
  } from "react-native";
17
16
  import { useSafeAreaInsets } from "react-native-safe-area-context";
18
17
 
@@ -56,7 +55,6 @@ type Props = {
56
55
  rightIconName?: string;
57
56
  borderColor?: string;
58
57
  borderColorActive?: string;
59
- autoDismissKeyboard?: boolean;
60
58
  } & IconSlot &
61
59
  TextInputProps;
62
60
 
@@ -95,7 +93,6 @@ const DatePicker: React.FC<React.PropsWithChildren<Props>> = ({
95
93
  placeholder,
96
94
  borderColor: inputBorderColor,
97
95
  borderColorActive: inputBorderColorActive,
98
- autoDismissKeyboard = true,
99
96
  ...props
100
97
  }) => {
101
98
  const [value, setValue] = React.useState<any>(date || defaultValue);
@@ -207,12 +204,6 @@ const DatePicker: React.FC<React.PropsWithChildren<Props>> = ({
207
204
  };
208
205
  }, [focused, label, placeholder]);
209
206
 
210
- React.useEffect(() => {
211
- if (pickerVisible && autoDismissKeyboard) {
212
- Keyboard.dismiss();
213
- }
214
- }, [pickerVisible, autoDismissKeyboard]);
215
-
216
207
  const _handleFocus = () => {
217
208
  if (disabled) {
218
209
  return;
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import { View, StyleSheet, Text, Platform, Dimensions, Keyboard, } from "react-native";
2
+ import { View, StyleSheet, Text, Platform, Dimensions, } from "react-native";
3
3
  import { omit, pickBy, identity, isObject } from "lodash";
4
4
  import { SafeAreaView } from "react-native-safe-area-context";
5
5
  import { Picker as NativePicker } from "@react-native-picker/picker";
@@ -35,7 +35,7 @@ const isIos = Platform.OS === "ios";
35
35
  const unstyledColor = "rgba(165, 173, 183, 1)";
36
36
  const disabledColor = "rgb(240, 240, 240)";
37
37
  const errorColor = "rgba(255, 69, 100, 1)";
38
- const Picker = ({ error, options = [], onValueChange, defaultValue, Icon, style, placeholder, value, disabled = false, assistiveText, label, iconColor = unstyledColor, iconSize = 24, leftIconMode = "inset", leftIconName, placeholderTextColor = unstyledColor, rightIconName, type = "solid", autoDismissKeyboard = true, }) => {
38
+ const Picker = ({ error, options = [], onValueChange, defaultValue, Icon, style, placeholder, value, disabled = false, assistiveText, label, iconColor = unstyledColor, iconSize = 24, leftIconMode = "inset", leftIconName, placeholderTextColor = unstyledColor, rightIconName, type = "solid", }) => {
39
39
  var _a, _b;
40
40
  const androidPickerRef = React.useRef(undefined);
41
41
  const [internalValue, setInternalValue] = React.useState(value || defaultValue);
@@ -59,11 +59,6 @@ const Picker = ({ error, options = [], onValueChange, defaultValue, Icon, style,
59
59
  (_a = androidPickerRef === null || androidPickerRef === void 0 ? void 0 : androidPickerRef.current) === null || _a === void 0 ? void 0 : _a.focus();
60
60
  }
61
61
  }, [pickerVisible, androidPickerRef]);
62
- React.useEffect(() => {
63
- if (pickerVisible && autoDismissKeyboard) {
64
- Keyboard.dismiss();
65
- }
66
- }, [pickerVisible, autoDismissKeyboard]);
67
62
  const normalizedOptions = normalizeOptions(options);
68
63
  const pickerOptions = placeholder
69
64
  ? [{ value: placeholder, label: placeholder }, ...normalizedOptions]
@@ -7,7 +7,6 @@ import {
7
7
  ViewStyle,
8
8
  StyleProp,
9
9
  Dimensions,
10
- Keyboard,
11
10
  } from "react-native";
12
11
  import { omit, pickBy, identity, isObject } from "lodash";
13
12
  import { SafeAreaView } from "react-native-safe-area-context";
@@ -49,7 +48,6 @@ export type PickerProps = {
49
48
  placeholderTextColor?: string;
50
49
  rightIconName?: string;
51
50
  type?: "solid" | "underline";
52
- autoDismissKeyboard?: boolean;
53
51
  theme: Theme;
54
52
  Icon: IconSlot["Icon"];
55
53
  };
@@ -109,7 +107,6 @@ const Picker: React.FC<PickerProps> = ({
109
107
  placeholderTextColor = unstyledColor,
110
108
  rightIconName,
111
109
  type = "solid",
112
- autoDismissKeyboard = true,
113
110
  }) => {
114
111
  const androidPickerRef = React.useRef<any | undefined>(undefined);
115
112
 
@@ -141,12 +138,6 @@ const Picker: React.FC<PickerProps> = ({
141
138
  }
142
139
  }, [pickerVisible, androidPickerRef]);
143
140
 
144
- React.useEffect(() => {
145
- if (pickerVisible && autoDismissKeyboard) {
146
- Keyboard.dismiss();
147
- }
148
- }, [pickerVisible, autoDismissKeyboard]);
149
-
150
141
  const normalizedOptions = normalizeOptions(options);
151
142
 
152
143
  const pickerOptions = placeholder
@@ -1,4 +1,4 @@
1
- import { COMPONENT_TYPES, FORM_TYPES, PROP_TYPES, FIELD_NAME, GROUPS, Triggers, StylesPanelSections, createNumberProp, createColorProp, createStaticBoolProp, } from "@draftbit/types";
1
+ import { COMPONENT_TYPES, FORM_TYPES, PROP_TYPES, FIELD_NAME, GROUPS, Triggers, StylesPanelSections, createNumberProp, createColorProp, } from "@draftbit/types";
2
2
  const SEED_DATA_PROPS = {
3
3
  mode: {
4
4
  label: "Mode",
@@ -171,11 +171,6 @@ export const SEED_DATA = [
171
171
  required: true,
172
172
  group: GROUPS.basic,
173
173
  },
174
- autoDismissKeyboard: createStaticBoolProp({
175
- label: "Auto dismiss keyboard",
176
- description: "Automatically dismiss keyboard when DatePicker is opened",
177
- defaultValue: true,
178
- }),
179
174
  },
180
175
  },
181
176
  ];
@@ -8,7 +8,6 @@ import {
8
8
  StylesPanelSections,
9
9
  createNumberProp,
10
10
  createColorProp,
11
- createStaticBoolProp,
12
11
  } from "@draftbit/types";
13
12
 
14
13
  const SEED_DATA_PROPS = {
@@ -186,11 +185,6 @@ export const SEED_DATA = [
186
185
  required: true,
187
186
  group: GROUPS.basic,
188
187
  },
189
- autoDismissKeyboard: createStaticBoolProp({
190
- label: "Auto dismiss keyboard",
191
- description: "Automatically dismiss keyboard when DatePicker is opened",
192
- defaultValue: true,
193
- }),
194
188
  },
195
189
  },
196
190
  ];
@@ -1,4 +1,4 @@
1
- import { COMPONENT_TYPES, Triggers, GROUPS, FORM_TYPES, PROP_TYPES, FIELD_NAME, createIconSizeProp, createColorProp, StylesPanelSections, createStaticBoolProp, } from "@draftbit/types";
1
+ import { COMPONENT_TYPES, Triggers, GROUPS, FORM_TYPES, PROP_TYPES, FIELD_NAME, createIconSizeProp, createColorProp, StylesPanelSections, } from "@draftbit/types";
2
2
  const SEED_DATA_PROPS = {
3
3
  label: {
4
4
  group: GROUPS.data,
@@ -142,11 +142,6 @@ export const SEED_DATA = [
142
142
  },
143
143
  iconSize: createIconSizeProp({ defaultValue: 24 }),
144
144
  iconColor: createColorProp({ label: "Icon Color" }),
145
- autoDismissKeyboard: createStaticBoolProp({
146
- label: "Auto dismiss keyboard",
147
- description: "Automatically dismiss keyboard when Picker is opened",
148
- defaultValue: true,
149
- }),
150
145
  },
151
146
  layout: {},
152
147
  },
@@ -8,7 +8,6 @@ import {
8
8
  createIconSizeProp,
9
9
  createColorProp,
10
10
  StylesPanelSections,
11
- createStaticBoolProp,
12
11
  } from "@draftbit/types";
13
12
 
14
13
  const SEED_DATA_PROPS = {
@@ -158,11 +157,6 @@ export const SEED_DATA = [
158
157
  },
159
158
  iconSize: createIconSizeProp({ defaultValue: 24 }),
160
159
  iconColor: createColorProp({ label: "Icon Color" }),
161
- autoDismissKeyboard: createStaticBoolProp({
162
- label: "Auto dismiss keyboard",
163
- description: "Automatically dismiss keyboard when Picker is opened",
164
- defaultValue: true,
165
- }),
166
160
  },
167
161
  layout: {},
168
162
  },
@@ -0,0 +1,107 @@
1
+ import { COMPONENT_TYPES, createImageProp, StylesPanelSections, createTextProp, createStaticBoolProp, createTextEnumProp, createStaticNumberProp, Triggers, createActionProp, GROUPS, createColorProp, } from "@draftbit/types";
2
+ export const SEED_DATA = {
3
+ name: "Expo Image",
4
+ tag: "Image",
5
+ packageName: "expo-image",
6
+ collection: "Expo",
7
+ prefixCollectionOnImport: true,
8
+ description: "A responsive Image component",
9
+ category: COMPONENT_TYPES.media,
10
+ stylesPanelSections: [
11
+ StylesPanelSections.Size,
12
+ StylesPanelSections.Margins,
13
+ StylesPanelSections.Position,
14
+ StylesPanelSections.Effects,
15
+ StylesPanelSections.Borders,
16
+ ],
17
+ layout: {
18
+ width: 100,
19
+ height: 100,
20
+ },
21
+ triggers: [Triggers.OnLoad, Triggers.OnError],
22
+ props: {
23
+ onLoad: createActionProp(),
24
+ onError: createActionProp(),
25
+ source: createImageProp(),
26
+ placeholder: createImageProp({
27
+ label: "Placeholder",
28
+ description: "An image to display while loading the proper image and no image has been displayed yet or the source is unset.",
29
+ required: false,
30
+ defaultValue: null,
31
+ }),
32
+ contentFit: createTextEnumProp({
33
+ label: "Content Fit",
34
+ description: 'Determines how the image should be resized to fit its container. This property tells the image to fill the container in a variety of ways; such as "preserve that aspect ratio" or "stretch up and take up as much space as possible". It mirrors the CSS object-fit property.',
35
+ options: ["cover", "contain", "fill", "none", "scale-down"],
36
+ defaultValue: null,
37
+ }),
38
+ contentPosition: createTextEnumProp({
39
+ label: "Content Position",
40
+ description: "It is used together with contentFit to specify how the image should be positioned with x/y coordinates inside its own container. An equivalent of the CSS object-position property.",
41
+ options: [
42
+ "center",
43
+ "top",
44
+ "left",
45
+ "right",
46
+ "bottom",
47
+ "top left",
48
+ "top center",
49
+ "top right",
50
+ "left center",
51
+ "left top",
52
+ "left bottom",
53
+ "right center",
54
+ "right top",
55
+ "right bottom",
56
+ "bottom center",
57
+ "bottom left",
58
+ "bottom right",
59
+ ],
60
+ default: null,
61
+ }),
62
+ cachePolicy: createTextEnumProp({
63
+ label: "Cache Policy",
64
+ description: "Determines whether to cache the image and where: on the disk, in the memory or both.",
65
+ options: ["none", "disk", "memory", "memory-disk"],
66
+ defaultValue: null,
67
+ }),
68
+ focusable: createStaticBoolProp({
69
+ label: "Focusable",
70
+ description: "Whether this View should be focusable with a non-touch input device and receive focus with a hardware keyboard.",
71
+ group: GROUPS.android,
72
+ defaultValue: null,
73
+ }),
74
+ priority: createTextEnumProp({
75
+ label: "Priority",
76
+ description: "Priorities for completing loads. If more than one load is queued at a time, the load with the higher priority will be started first. Priorities are considered best effort, there are no guarantees about the order in which loads will start or finish.",
77
+ options: ["normal", "high", "low"],
78
+ defaultValue: null,
79
+ }),
80
+ responsivePolicy: createTextEnumProp({
81
+ label: "Responsive Policy",
82
+ description: "Determines whether to choose image source based on container size only on mount or on every resize. Use initial to improve performance.",
83
+ options: ["initial", "live"],
84
+ defaultValue: null,
85
+ group: GROUPS.web,
86
+ }),
87
+ tintColor: createColorProp({
88
+ label: "Tint Color",
89
+ description: "A color used to tint template images (a bitmap image where only the opacity matters). The color is applied to every non-transparent pixel, causing the image’s shape to adopt that color. This effect is not applied to placeholders.",
90
+ }),
91
+ accessibilityLabel: createTextProp({
92
+ label: "Accessibility Label",
93
+ description: "The text that's read by the screen reader when the user interacts with the image.",
94
+ defaultValue: null,
95
+ }),
96
+ accessible: createStaticBoolProp({
97
+ label: "Accessible",
98
+ description: "When true, indicates that the view is an accessibility element. When a view is an accessibility element, it groups its children into a single selectable component.",
99
+ defaultValue: null,
100
+ }),
101
+ blurRadius: createStaticNumberProp({
102
+ label: "Blur Radius",
103
+ description: "The radius of the blur in points, 0 means no blur effect. This effect is not applied to placeholders.",
104
+ defaultValue: null,
105
+ }),
106
+ },
107
+ };
@@ -0,0 +1,131 @@
1
+ import {
2
+ COMPONENT_TYPES,
3
+ createImageProp,
4
+ StylesPanelSections,
5
+ createTextProp,
6
+ createStaticBoolProp,
7
+ createTextEnumProp,
8
+ createStaticNumberProp,
9
+ Triggers,
10
+ createActionProp,
11
+ GROUPS,
12
+ createColorProp,
13
+ } from "@draftbit/types";
14
+
15
+ export const SEED_DATA = {
16
+ name: "Expo Image",
17
+ tag: "Image",
18
+ packageName: "expo-image",
19
+ collection: "Expo",
20
+ prefixCollectionOnImport: true,
21
+ description: "A responsive Image component",
22
+ category: COMPONENT_TYPES.media,
23
+ stylesPanelSections: [
24
+ StylesPanelSections.Size,
25
+ StylesPanelSections.Margins,
26
+ StylesPanelSections.Position,
27
+ StylesPanelSections.Effects,
28
+ StylesPanelSections.Borders,
29
+ ],
30
+ layout: {
31
+ width: 100,
32
+ height: 100,
33
+ },
34
+ triggers: [Triggers.OnLoad, Triggers.OnError],
35
+ props: {
36
+ onLoad: createActionProp(),
37
+ onError: createActionProp(),
38
+ source: createImageProp(),
39
+ placeholder: createImageProp({
40
+ label: "Placeholder",
41
+ description:
42
+ "An image to display while loading the proper image and no image has been displayed yet or the source is unset.",
43
+ required: false,
44
+ defaultValue: null,
45
+ }),
46
+ contentFit: createTextEnumProp({
47
+ label: "Content Fit",
48
+ description:
49
+ 'Determines how the image should be resized to fit its container. This property tells the image to fill the container in a variety of ways; such as "preserve that aspect ratio" or "stretch up and take up as much space as possible". It mirrors the CSS object-fit property.',
50
+ options: ["cover", "contain", "fill", "none", "scale-down"],
51
+ defaultValue: null,
52
+ }),
53
+ contentPosition: createTextEnumProp({
54
+ label: "Content Position",
55
+ description:
56
+ "It is used together with contentFit to specify how the image should be positioned with x/y coordinates inside its own container. An equivalent of the CSS object-position property.",
57
+ options: [
58
+ "center",
59
+ "top",
60
+ "left",
61
+ "right",
62
+ "bottom",
63
+ "top left",
64
+ "top center",
65
+ "top right",
66
+ "left center",
67
+ "left top",
68
+ "left bottom",
69
+ "right center",
70
+ "right top",
71
+ "right bottom",
72
+ "bottom center",
73
+ "bottom left",
74
+ "bottom right",
75
+ ],
76
+ default: null,
77
+ }),
78
+ cachePolicy: createTextEnumProp({
79
+ label: "Cache Policy",
80
+ description:
81
+ "Determines whether to cache the image and where: on the disk, in the memory or both.",
82
+ options: ["none", "disk", "memory", "memory-disk"],
83
+ defaultValue: null,
84
+ }),
85
+ focusable: createStaticBoolProp({
86
+ label: "Focusable",
87
+ description:
88
+ "Whether this View should be focusable with a non-touch input device and receive focus with a hardware keyboard.",
89
+ group: GROUPS.android,
90
+ defaultValue: null,
91
+ }),
92
+ priority: createTextEnumProp({
93
+ label: "Priority",
94
+ description:
95
+ "Priorities for completing loads. If more than one load is queued at a time, the load with the higher priority will be started first. Priorities are considered best effort, there are no guarantees about the order in which loads will start or finish.",
96
+ options: ["normal", "high", "low"],
97
+ defaultValue: null,
98
+ }),
99
+ responsivePolicy: createTextEnumProp({
100
+ label: "Responsive Policy",
101
+ description:
102
+ "Determines whether to choose image source based on container size only on mount or on every resize. Use initial to improve performance.",
103
+ options: ["initial", "live"],
104
+ defaultValue: null,
105
+ group: GROUPS.web,
106
+ }),
107
+ tintColor: createColorProp({
108
+ label: "Tint Color",
109
+ description:
110
+ "A color used to tint template images (a bitmap image where only the opacity matters). The color is applied to every non-transparent pixel, causing the image’s shape to adopt that color. This effect is not applied to placeholders.",
111
+ }),
112
+ accessibilityLabel: createTextProp({
113
+ label: "Accessibility Label",
114
+ description:
115
+ "The text that's read by the screen reader when the user interacts with the image.",
116
+ defaultValue: null,
117
+ }),
118
+ accessible: createStaticBoolProp({
119
+ label: "Accessible",
120
+ description:
121
+ "When true, indicates that the view is an accessibility element. When a view is an accessibility element, it groups its children into a single selectable component.",
122
+ defaultValue: null,
123
+ }),
124
+ blurRadius: createStaticNumberProp({
125
+ label: "Blur Radius",
126
+ description:
127
+ "The radius of the blur in points, 0 means no blur effect. This effect is not applied to placeholders.",
128
+ defaultValue: null,
129
+ }),
130
+ },
131
+ };