@draftbit/core 46.7.8 → 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.
- package/lib/commonjs/components/DeprecatedFAB.js +21 -3
- package/lib/commonjs/components/Divider.js +1 -14
- package/lib/commonjs/components/Elevation.js +2 -14
- package/lib/commonjs/mappings/expo/Image.js +90 -0
- package/lib/module/components/CircleImage.js +16 -1
- package/lib/module/mappings/expo/Image.js +83 -0
- package/lib/typescript/src/mappings/expo/Image.d.ts +155 -0
- package/lib/typescript/src/mappings/expo/Image.d.ts.map +1 -0
- package/package.json +3 -3
- package/src/mappings/expo/Image.js +107 -0
- package/src/mappings/expo/Image.ts +131 -0
|
@@ -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,
|
|
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
|
-
}
|
|
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",
|
|
@@ -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,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,
|
|
@@ -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
|
+
};
|
|
@@ -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.
|
|
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.
|
|
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": "
|
|
94
|
+
"gitHead": "157e2b18fb2aca142c8ba3f448f3e6e36232db26"
|
|
95
95
|
}
|
|
@@ -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
|
+
};
|