@draftbit/core 46.8.2-0a0db3.2 → 46.8.2-387722.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/Accordion/AccordionItem.js +4 -23
- package/lib/commonjs/components/AnimatedCircularProgress.js +1 -12
- package/lib/commonjs/components/AspectRatio.js +1 -17
- package/lib/commonjs/components/Banner.js +4 -23
- package/lib/commonjs/components/Checkbox/CheckboxGroupRow.js +5 -23
- package/lib/commonjs/components/Checkbox/context.js +1 -1
- package/lib/commonjs/components/CircleImage.js +1 -15
- package/lib/commonjs/components/CircularProgress.js +8 -26
- package/lib/commonjs/components/Container.js +4 -15
- package/lib/commonjs/components/DeprecatedCardWrapper.js +1 -15
- package/lib/commonjs/components/DeprecatedFAB.js +3 -21
- package/lib/commonjs/components/Divider.js +1 -14
- package/lib/commonjs/components/Elevation.js +2 -14
- package/lib/commonjs/components/FormRow.js +2 -16
- package/lib/commonjs/components/IconButton.js +4 -19
- package/lib/commonjs/components/Image.js +2 -17
- package/lib/commonjs/components/Layout.js +19 -40
- package/lib/commonjs/components/Markdown.js +30 -0
- package/lib/commonjs/components/Picker/PickerComponent.web.js +3 -20
- package/lib/commonjs/components/Portal/PortalConsumer.js +7 -22
- package/lib/commonjs/components/Portal/PortalHost.js +15 -44
- package/lib/commonjs/components/Portal/PortalManager.js +8 -34
- package/lib/commonjs/components/Pressable.js +2 -15
- package/lib/commonjs/components/ProgressBar.js +7 -37
- package/lib/commonjs/components/RadioButton/RadioButton.js +2 -13
- package/lib/commonjs/components/RadioButton/RadioButtonFieldGroup.js +1 -9
- package/lib/commonjs/components/RadioButton/RadioButtonGroup.js +2 -15
- package/lib/commonjs/components/RadioButton/RadioButtonRow.js +5 -23
- package/lib/commonjs/components/ScreenContainer.js +6 -24
- package/lib/commonjs/components/StarRating.js +4 -23
- package/lib/commonjs/components/StepIndicator.js +18 -57
- package/lib/commonjs/components/Surface.js +2 -14
- package/lib/commonjs/components/Switch.js +10 -19
- package/lib/commonjs/components/Text.js +4 -50
- package/lib/commonjs/components/TextField.js +28 -76
- package/lib/commonjs/components/Touchable.js +2 -15
- package/lib/commonjs/index.js +7 -13
- package/lib/commonjs/mappings/FlashList.js +2 -8
- package/lib/commonjs/mappings/Markdown.js +27 -0
- package/lib/module/components/AspectRatio.js +18 -1
- package/lib/module/components/Markdown.js +20 -0
- package/lib/module/index.js +1 -1
- package/lib/module/mappings/FlashList.js +3 -9
- package/lib/module/mappings/Markdown.js +20 -0
- package/lib/typescript/src/components/Markdown.d.ts +8 -0
- package/lib/typescript/src/components/Markdown.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +1 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/mappings/FlashList.d.ts +0 -6
- package/lib/typescript/src/mappings/FlashList.d.ts.map +1 -1
- package/lib/typescript/src/mappings/{TabViewItem.d.ts → Markdown.d.ts} +5 -10
- package/lib/typescript/src/mappings/Markdown.d.ts.map +1 -0
- package/package.json +4 -5
- package/src/components/Markdown.js +10 -0
- package/src/components/Markdown.tsx +22 -0
- package/src/index.js +1 -1
- package/src/index.tsx +1 -1
- package/src/mappings/FlashList.js +9 -9
- package/src/mappings/FlashList.ts +9 -9
- package/src/mappings/Markdown.js +25 -0
- package/src/mappings/Markdown.ts +32 -0
- package/lib/commonjs/components/TabView/TabView.js +0 -132
- package/lib/commonjs/components/TabView/TabViewItem.js +0 -25
- package/lib/commonjs/components/TabView/index.js +0 -20
- package/lib/commonjs/mappings/TabView.js +0 -77
- package/lib/commonjs/mappings/TabViewItem.js +0 -37
- package/lib/module/components/TabView/TabView.js +0 -113
- package/lib/module/components/TabView/TabViewItem.js +0 -20
- package/lib/module/components/TabView/index.js +0 -2
- package/lib/module/mappings/TabView.js +0 -70
- package/lib/module/mappings/TabViewItem.js +0 -30
- package/lib/typescript/src/components/TabView/TabView.d.ts +0 -26
- package/lib/typescript/src/components/TabView/TabView.d.ts.map +0 -1
- package/lib/typescript/src/components/TabView/TabViewItem.d.ts +0 -11
- package/lib/typescript/src/components/TabView/TabViewItem.d.ts.map +0 -1
- package/lib/typescript/src/components/TabView/index.d.ts +0 -3
- package/lib/typescript/src/components/TabView/index.d.ts.map +0 -1
- package/lib/typescript/src/mappings/TabView.d.ts +0 -126
- package/lib/typescript/src/mappings/TabView.d.ts.map +0 -1
- package/lib/typescript/src/mappings/TabViewItem.d.ts.map +0 -1
- package/src/components/TabView/TabView.js +0 -58
- package/src/components/TabView/TabView.tsx +0 -151
- package/src/components/TabView/TabViewItem.js +0 -11
- package/src/components/TabView/TabViewItem.tsx +0 -25
- package/src/components/TabView/index.js +0 -2
- package/src/components/TabView/index.tsx +0 -2
- package/src/mappings/TabView.js +0 -76
- package/src/mappings/TabView.ts +0 -86
- package/src/mappings/TabViewItem.js +0 -30
- package/src/mappings/TabViewItem.ts +0 -38
|
@@ -10,6 +10,10 @@ var _theming = require("../theming");
|
|
|
10
10
|
var _utilities = require("../utilities");
|
|
11
11
|
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); }
|
|
12
12
|
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; }
|
|
13
|
+
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
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
15
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
16
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
13
17
|
const AnimatedText = _reactNative.Animated.createAnimatedComponent(_reactNative.Text);
|
|
14
18
|
const FOCUS_ANIMATION_DURATION = 150;
|
|
15
19
|
const BLUR_ANIMATION_DURATION = 180;
|
|
@@ -17,7 +21,7 @@ const ICON_SIZE = 24;
|
|
|
17
21
|
class TextField extends React.Component {
|
|
18
22
|
constructor() {
|
|
19
23
|
super(...arguments);
|
|
20
|
-
this
|
|
24
|
+
_defineProperty(this, "state", {
|
|
21
25
|
nativeProps: {},
|
|
22
26
|
labeled: new _reactNative.Animated.Value(this.props.value || this.props.error ? 0 : 1),
|
|
23
27
|
focused: false,
|
|
@@ -26,46 +30,47 @@ class TextField extends React.Component {
|
|
|
26
30
|
measured: false,
|
|
27
31
|
width: 0
|
|
28
32
|
}
|
|
29
|
-
};
|
|
30
|
-
this
|
|
31
|
-
this
|
|
33
|
+
});
|
|
34
|
+
_defineProperty(this, "_timer", setTimeout(() => {}, 0));
|
|
35
|
+
_defineProperty(this, "_showPlaceholder", () => {
|
|
32
36
|
clearTimeout(this._timer);
|
|
37
|
+
|
|
33
38
|
// Set the placeholder in a delay to offset the label animation
|
|
34
39
|
// If we show it immediately, they'll overlap and look ugly
|
|
35
40
|
this._timer = setTimeout(() => this.setState({
|
|
36
41
|
placeholder: this.props.placeholder
|
|
37
42
|
}), 50);
|
|
38
|
-
};
|
|
39
|
-
this._hidePlaceholder = () => this.setState({
|
|
40
|
-
placeholder: ""
|
|
41
43
|
});
|
|
42
|
-
this
|
|
44
|
+
_defineProperty(this, "_hidePlaceholder", () => this.setState({
|
|
45
|
+
placeholder: ""
|
|
46
|
+
}));
|
|
47
|
+
_defineProperty(this, "_restoreLabel", () => _reactNative.Animated.timing(this.state.labeled, {
|
|
43
48
|
toValue: 1,
|
|
44
49
|
duration: FOCUS_ANIMATION_DURATION,
|
|
45
50
|
useNativeDriver: true
|
|
46
|
-
}).start();
|
|
47
|
-
this
|
|
51
|
+
}).start());
|
|
52
|
+
_defineProperty(this, "_minmizeLabel", () => _reactNative.Animated.timing(this.state.labeled, {
|
|
48
53
|
toValue: 0,
|
|
49
54
|
duration: BLUR_ANIMATION_DURATION,
|
|
50
55
|
useNativeDriver: true
|
|
51
|
-
}).start();
|
|
52
|
-
this
|
|
56
|
+
}).start());
|
|
57
|
+
_defineProperty(this, "_handleFocus", () => {
|
|
53
58
|
if (this.props.disabled) {
|
|
54
59
|
return;
|
|
55
60
|
}
|
|
56
61
|
this.setState({
|
|
57
62
|
focused: true
|
|
58
63
|
});
|
|
59
|
-
};
|
|
60
|
-
this
|
|
64
|
+
});
|
|
65
|
+
_defineProperty(this, "_handleBlur", () => {
|
|
61
66
|
if (this.props.disabled) {
|
|
62
67
|
return;
|
|
63
68
|
}
|
|
64
69
|
this.setState({
|
|
65
70
|
focused: false
|
|
66
71
|
});
|
|
67
|
-
};
|
|
68
|
-
this
|
|
72
|
+
});
|
|
73
|
+
_defineProperty(this, "_handleChangeText", value => {
|
|
69
74
|
if (this.props.disabled) {
|
|
70
75
|
return;
|
|
71
76
|
}
|
|
@@ -80,8 +85,8 @@ class TextField extends React.Component {
|
|
|
80
85
|
});
|
|
81
86
|
this.props.onChangeText && this.props.onChangeText(value.nativeEvent.text);
|
|
82
87
|
}
|
|
83
|
-
};
|
|
84
|
-
this
|
|
88
|
+
});
|
|
89
|
+
_defineProperty(this, "_root", undefined);
|
|
85
90
|
}
|
|
86
91
|
static getDerivedStateFromProps(nextProps, prevState) {
|
|
87
92
|
return {
|
|
@@ -168,9 +173,7 @@ class TextField extends React.Component {
|
|
|
168
173
|
roundness,
|
|
169
174
|
disabledOpacity
|
|
170
175
|
},
|
|
171
|
-
render = props => /*#__PURE__*/React.createElement(_reactNative.TextInput,
|
|
172
|
-
...props
|
|
173
|
-
}),
|
|
176
|
+
render = props => /*#__PURE__*/React.createElement(_reactNative.TextInput, props),
|
|
174
177
|
...rest
|
|
175
178
|
} = this.props;
|
|
176
179
|
const MINIMIZED_LABEL_Y_OFFSET = -(typography.caption.lineHeight + 4);
|
|
@@ -310,10 +313,9 @@ class TextField extends React.Component {
|
|
|
310
313
|
} = _reactNative.StyleSheet.flatten(style || {});
|
|
311
314
|
return /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
312
315
|
style: [styles.container, styleProp]
|
|
313
|
-
}, leftIconName && leftIconMode === "outset" ? /*#__PURE__*/React.createElement(Icon, {
|
|
314
|
-
...leftIconProps,
|
|
316
|
+
}, leftIconName && leftIconMode === "outset" ? /*#__PURE__*/React.createElement(Icon, _extends({}, leftIconProps, {
|
|
315
317
|
style: leftIconStyle
|
|
316
|
-
}) : null, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
318
|
+
})) : null, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
317
319
|
style: (0, _utilities.applyStyles)([containerStyle], {
|
|
318
320
|
height: style === null || style === void 0 ? void 0 : style.height,
|
|
319
321
|
backgroundColor: bgColor,
|
|
@@ -381,10 +383,9 @@ class TextField extends React.Component {
|
|
|
381
383
|
style: {
|
|
382
384
|
justifyContent: type === "solid" ? "center" : undefined
|
|
383
385
|
}
|
|
384
|
-
}, /*#__PURE__*/React.createElement(Icon, {
|
|
385
|
-
...leftIconProps,
|
|
386
|
+
}, /*#__PURE__*/React.createElement(Icon, _extends({}, leftIconProps, {
|
|
386
387
|
style: leftIconStyle
|
|
387
|
-
})) : null, render({
|
|
388
|
+
}))) : null, render({
|
|
388
389
|
ref: c => {
|
|
389
390
|
this._root = c;
|
|
390
391
|
},
|
|
@@ -422,55 +423,6 @@ class TextField extends React.Component {
|
|
|
422
423
|
}
|
|
423
424
|
var _default = (0, _theming.withTheme)(TextField);
|
|
424
425
|
exports.default = _default;
|
|
425
|
-
const styles = _reactNative.StyleSheet.create({
|
|
426
|
-
container: {
|
|
427
|
-
alignSelf: "stretch"
|
|
428
|
-
},
|
|
429
|
-
placeholder: {
|
|
430
|
-
position: "absolute",
|
|
431
|
-
left: 0
|
|
432
|
-
},
|
|
433
|
-
underline: {
|
|
434
|
-
position: "absolute",
|
|
435
|
-
left: 0,
|
|
436
|
-
right: 0,
|
|
437
|
-
bottom: 0,
|
|
438
|
-
height: 2
|
|
439
|
-
},
|
|
440
|
-
input: {
|
|
441
|
-
flexGrow: 1,
|
|
442
|
-
justifyContent: "center",
|
|
443
|
-
textAlignVertical: "center",
|
|
444
|
-
margin: 0,
|
|
445
|
-
textAlign: _reactNative.I18nManager.isRTL ? "right" : "left"
|
|
446
|
-
}
|
|
447
|
-
});_handleFocus,
|
|
448
|
-
onBlur: this._handleBlur,
|
|
449
|
-
underlineColorAndroid: "transparent",
|
|
450
|
-
style: inputStyles,
|
|
451
|
-
...rest,
|
|
452
|
-
...this.state.nativeProps,
|
|
453
|
-
value: this.state.value
|
|
454
|
-
})), rightIconName ? /*#__PURE__*/React.createElement(Icon, {
|
|
455
|
-
name: rightIconName,
|
|
456
|
-
size: ICON_SIZE,
|
|
457
|
-
color: colors.light,
|
|
458
|
-
style: {
|
|
459
|
-
position: "absolute",
|
|
460
|
-
right: 16,
|
|
461
|
-
marginTop: type === "solid" ? MINIMIZED_LABEL_FONT_SIZE + 4 : 16
|
|
462
|
-
}
|
|
463
|
-
}) : null, assistiveText ? /*#__PURE__*/React.createElement(_reactNative.Text, {
|
|
464
|
-
style: [{
|
|
465
|
-
color: error ? colors.error : colors.light,
|
|
466
|
-
marginTop: 8,
|
|
467
|
-
marginLeft: assistiveTextLeftMargin
|
|
468
|
-
}]
|
|
469
|
-
}, assistiveText) : null);
|
|
470
|
-
}
|
|
471
|
-
}
|
|
472
|
-
var _default = (0, _theming.withTheme)(TextField);
|
|
473
|
-
exports.default = _default;
|
|
474
426
|
const styles = _reactNative.StyleSheet.create({
|
|
475
427
|
container: {
|
|
476
428
|
alignSelf: "stretch"
|
|
@@ -7,6 +7,7 @@ exports.default = Touchable;
|
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
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); }
|
|
10
11
|
function Touchable(_ref) {
|
|
11
12
|
let {
|
|
12
13
|
children,
|
|
@@ -19,22 +20,8 @@ function Touchable(_ref) {
|
|
|
19
20
|
style,
|
|
20
21
|
...props
|
|
21
22
|
} = _ref;
|
|
22
|
-
return /*#__PURE__*/_react.default.createElement(_reactNative.Pressable, {
|
|
23
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.Pressable, _extends({
|
|
23
24
|
disabled: disabled,
|
|
24
|
-
onPress: onPress,
|
|
25
|
-
delayLongPress: delayLongPress ? delayLongPress : 500,
|
|
26
|
-
hitSlop: hitSlop ? hitSlop : 8,
|
|
27
|
-
style: _ref2 => {
|
|
28
|
-
let {
|
|
29
|
-
pressed
|
|
30
|
-
} = _ref2;
|
|
31
|
-
return [{
|
|
32
|
-
opacity: pressed ? activeOpacity : disabled ? disabledOpacity : 1
|
|
33
|
-
}, style];
|
|
34
|
-
},
|
|
35
|
-
...props
|
|
36
|
-
}, children);
|
|
37
|
-
} disabled: disabled,
|
|
38
25
|
onPress: onPress,
|
|
39
26
|
delayLongPress: delayLongPress ? delayLongPress : 500,
|
|
40
27
|
hitSlop: hitSlop ? hitSlop : 8,
|
package/lib/commonjs/index.js
CHANGED
|
@@ -177,6 +177,12 @@ Object.defineProperty(exports, "Link", {
|
|
|
177
177
|
return _Text.Link;
|
|
178
178
|
}
|
|
179
179
|
});
|
|
180
|
+
Object.defineProperty(exports, "Markdown", {
|
|
181
|
+
enumerable: true,
|
|
182
|
+
get: function () {
|
|
183
|
+
return _Markdown.default;
|
|
184
|
+
}
|
|
185
|
+
});
|
|
180
186
|
Object.defineProperty(exports, "NumberInput", {
|
|
181
187
|
enumerable: true,
|
|
182
188
|
get: function () {
|
|
@@ -339,18 +345,6 @@ Object.defineProperty(exports, "SwitchRow", {
|
|
|
339
345
|
return _Switch.SwitchRow;
|
|
340
346
|
}
|
|
341
347
|
});
|
|
342
|
-
Object.defineProperty(exports, "TabView", {
|
|
343
|
-
enumerable: true,
|
|
344
|
-
get: function () {
|
|
345
|
-
return _TabView.TabView;
|
|
346
|
-
}
|
|
347
|
-
});
|
|
348
|
-
Object.defineProperty(exports, "TabViewItem", {
|
|
349
|
-
enumerable: true,
|
|
350
|
-
get: function () {
|
|
351
|
-
return _TabView.TabViewItem;
|
|
352
|
-
}
|
|
353
|
-
});
|
|
354
348
|
Object.defineProperty(exports, "TextField", {
|
|
355
349
|
enumerable: true,
|
|
356
350
|
get: function () {
|
|
@@ -426,7 +420,7 @@ var _Swiper = require("./components/Swiper");
|
|
|
426
420
|
var _Layout = require("./components/Layout");
|
|
427
421
|
var _index = require("./components/RadioButton/index");
|
|
428
422
|
var _DeckSwiper = require("./components/DeckSwiper");
|
|
429
|
-
var
|
|
423
|
+
var _Markdown = _interopRequireDefault(require("./components/Markdown"));
|
|
430
424
|
var _DatePicker = _interopRequireDefault(require("./components/DatePicker/DatePicker"));
|
|
431
425
|
var _Picker = _interopRequireDefault(require("./components/Picker/Picker"));
|
|
432
426
|
var _ProgressBar = _interopRequireDefault(require("./components/ProgressBar"));
|
|
@@ -11,10 +11,7 @@ const SEED_DATA = [{
|
|
|
11
11
|
description: "Masonry Flashlist by Shopify",
|
|
12
12
|
packageName: "@shopify/flash-list",
|
|
13
13
|
category: _types.COMPONENT_TYPES.data,
|
|
14
|
-
stylesPanelSections: _types.
|
|
15
|
-
layout: {
|
|
16
|
-
flex: 1
|
|
17
|
-
},
|
|
14
|
+
stylesPanelSections: [_types.StylesPanelSections.Background, _types.StylesPanelSections.MarginsAndPaddings],
|
|
18
15
|
triggers: [_types.Triggers.OnRefresh, _types.Triggers.OnEndReached],
|
|
19
16
|
props: {
|
|
20
17
|
onRefresh: (0, _types.createActionProp)(),
|
|
@@ -61,10 +58,7 @@ const SEED_DATA = [{
|
|
|
61
58
|
description: "Flashlist by Shopify",
|
|
62
59
|
packageName: "@shopify/flash-list",
|
|
63
60
|
category: _types.COMPONENT_TYPES.data,
|
|
64
|
-
stylesPanelSections: _types.
|
|
65
|
-
layout: {
|
|
66
|
-
flex: 1
|
|
67
|
-
},
|
|
61
|
+
stylesPanelSections: [_types.StylesPanelSections.Background, _types.StylesPanelSections.MarginsAndPaddings],
|
|
68
62
|
triggers: [_types.Triggers.OnRefresh, _types.Triggers.OnEndReached],
|
|
69
63
|
props: {
|
|
70
64
|
onRefresh: (0, _types.createActionProp)(),
|
|
@@ -0,0 +1,27 @@
|
|
|
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: "Markdown",
|
|
10
|
+
tag: "Markdown",
|
|
11
|
+
description: "A component that renders markdown",
|
|
12
|
+
category: _types.COMPONENT_TYPES.text,
|
|
13
|
+
stylesPanelSections: [_types.StylesPanelSections.Typography, _types.StylesPanelSections.LayoutSelectedItem, _types.StylesPanelSections.MarginsAndPaddings, _types.StylesPanelSections.Effects],
|
|
14
|
+
props: {
|
|
15
|
+
children: {
|
|
16
|
+
group: _types.GROUPS.data,
|
|
17
|
+
label: "Markdown Text",
|
|
18
|
+
description: "Markdown text to be rendered ",
|
|
19
|
+
editable: true,
|
|
20
|
+
required: true,
|
|
21
|
+
formType: _types.FORM_TYPES.string,
|
|
22
|
+
propType: _types.PROP_TYPES.STRING,
|
|
23
|
+
defaultValue: "### Markdown"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
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 React from "react";
|
|
3
2
|
import { View, StyleSheet } from "react-native";
|
|
4
3
|
const AspectRatio = props => {
|
|
@@ -27,6 +26,24 @@ const AspectRatio = props => {
|
|
|
27
26
|
});
|
|
28
27
|
}
|
|
29
28
|
}
|
|
29
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
30
|
+
...props,
|
|
31
|
+
style: style,
|
|
32
|
+
onLayout: _ref => {
|
|
33
|
+
let {
|
|
34
|
+
nativeEvent: {
|
|
35
|
+
layout: l
|
|
36
|
+
}
|
|
37
|
+
} = _ref;
|
|
38
|
+
return setLayout(l);
|
|
39
|
+
}
|
|
40
|
+
}, props.children);
|
|
41
|
+
};
|
|
42
|
+
export default AspectRatio;idth,
|
|
43
|
+
height: width * (1 / aspectRatio)
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}
|
|
30
47
|
return /*#__PURE__*/React.createElement(View, _extends({}, props, {
|
|
31
48
|
style: style,
|
|
32
49
|
onLayout: _ref => {
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { StyleSheet } from "react-native";
|
|
3
|
+
import MarkdownComponent from "react-native-markdown-display";
|
|
4
|
+
const Markdown = _ref => {
|
|
5
|
+
let {
|
|
6
|
+
children,
|
|
7
|
+
style
|
|
8
|
+
} = _ref;
|
|
9
|
+
return (
|
|
10
|
+
/*#__PURE__*/
|
|
11
|
+
//'body' style applies to all markdown components
|
|
12
|
+
//@ts-ignore TS does not like the type of this named style for some reason
|
|
13
|
+
React.createElement(MarkdownComponent, {
|
|
14
|
+
style: {
|
|
15
|
+
body: StyleSheet.flatten(style)
|
|
16
|
+
}
|
|
17
|
+
}, children)
|
|
18
|
+
);
|
|
19
|
+
};
|
|
20
|
+
export default Markdown;
|
package/lib/module/index.js
CHANGED
|
@@ -32,7 +32,7 @@ export { Swiper, SwiperItem } from "./components/Swiper";
|
|
|
32
32
|
export { Center, Circle, Square, Row, Stack, Spacer } from "./components/Layout";
|
|
33
33
|
export { RadioButton, RadioButtonGroup, RadioButtonRow, RadioButtonFieldGroup } from "./components/RadioButton/index";
|
|
34
34
|
export { DeckSwiper, DeckSwiperCard } from "./components/DeckSwiper";
|
|
35
|
-
export {
|
|
35
|
+
export { default as Markdown } from "./components/Markdown";
|
|
36
36
|
|
|
37
37
|
/* Deprecated: Fix or Delete! */
|
|
38
38
|
export { default as DatePicker } from "./components/DatePicker/DatePicker";
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
import { COMPONENT_TYPES, createNumColumnsType, createStaticBoolProp, createNumberProp,
|
|
1
|
+
import { COMPONENT_TYPES, createNumColumnsType, createStaticBoolProp, createNumberProp, GROUPS, Triggers, createActionProp, createStaticNumberProp, createColorProp, StylesPanelSections } from "@draftbit/types";
|
|
2
2
|
export const SEED_DATA = [{
|
|
3
3
|
name: "Masonry List",
|
|
4
4
|
tag: "MasonryFlashList",
|
|
5
5
|
description: "Masonry Flashlist by Shopify",
|
|
6
6
|
packageName: "@shopify/flash-list",
|
|
7
7
|
category: COMPONENT_TYPES.data,
|
|
8
|
-
stylesPanelSections:
|
|
9
|
-
layout: {
|
|
10
|
-
flex: 1
|
|
11
|
-
},
|
|
8
|
+
stylesPanelSections: [StylesPanelSections.Background, StylesPanelSections.MarginsAndPaddings],
|
|
12
9
|
triggers: [Triggers.OnRefresh, Triggers.OnEndReached],
|
|
13
10
|
props: {
|
|
14
11
|
onRefresh: createActionProp(),
|
|
@@ -55,10 +52,7 @@ export const SEED_DATA = [{
|
|
|
55
52
|
description: "Flashlist by Shopify",
|
|
56
53
|
packageName: "@shopify/flash-list",
|
|
57
54
|
category: COMPONENT_TYPES.data,
|
|
58
|
-
stylesPanelSections:
|
|
59
|
-
layout: {
|
|
60
|
-
flex: 1
|
|
61
|
-
},
|
|
55
|
+
stylesPanelSections: [StylesPanelSections.Background, StylesPanelSections.MarginsAndPaddings],
|
|
62
56
|
triggers: [Triggers.OnRefresh, Triggers.OnEndReached],
|
|
63
57
|
props: {
|
|
64
58
|
onRefresh: createActionProp(),
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { COMPONENT_TYPES, FORM_TYPES, GROUPS, PROP_TYPES, StylesPanelSections } from "@draftbit/types";
|
|
2
|
+
export const SEED_DATA = {
|
|
3
|
+
name: "Markdown",
|
|
4
|
+
tag: "Markdown",
|
|
5
|
+
description: "A component that renders markdown",
|
|
6
|
+
category: COMPONENT_TYPES.text,
|
|
7
|
+
stylesPanelSections: [StylesPanelSections.Typography, StylesPanelSections.LayoutSelectedItem, StylesPanelSections.MarginsAndPaddings, StylesPanelSections.Effects],
|
|
8
|
+
props: {
|
|
9
|
+
children: {
|
|
10
|
+
group: GROUPS.data,
|
|
11
|
+
label: "Markdown Text",
|
|
12
|
+
description: "Markdown text to be rendered ",
|
|
13
|
+
editable: true,
|
|
14
|
+
required: true,
|
|
15
|
+
formType: FORM_TYPES.string,
|
|
16
|
+
propType: PROP_TYPES.STRING,
|
|
17
|
+
defaultValue: "### Markdown"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { StyleProp, ViewStyle } from "react-native";
|
|
3
|
+
declare type MarkdownProps = {
|
|
4
|
+
style?: StyleProp<ViewStyle>;
|
|
5
|
+
};
|
|
6
|
+
declare const Markdown: React.FC<React.PropsWithChildren<MarkdownProps>>;
|
|
7
|
+
export default Markdown;
|
|
8
|
+
//# sourceMappingURL=Markdown.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Markdown.d.ts","sourceRoot":"","sources":["../../../../src/components/Markdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,SAAS,EAAc,MAAM,cAAc,CAAC;AAGhE,aAAK,aAAa,GAAG;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,CAAC;AAEF,QAAA,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,aAAa,CAAC,CAW9D,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -32,7 +32,7 @@ export { Swiper, SwiperItem } from "./components/Swiper";
|
|
|
32
32
|
export { Center, Circle, Square, Row, Stack, Spacer, } from "./components/Layout";
|
|
33
33
|
export { RadioButton, RadioButtonGroup, RadioButtonRow, RadioButtonFieldGroup, } from "./components/RadioButton/index";
|
|
34
34
|
export { DeckSwiper, DeckSwiperCard } from "./components/DeckSwiper";
|
|
35
|
-
export {
|
|
35
|
+
export { default as Markdown } from "./components/Markdown";
|
|
36
36
|
export { default as DatePicker } from "./components/DatePicker/DatePicker";
|
|
37
37
|
export { default as Picker } from "./components/Picker/Picker";
|
|
38
38
|
export { default as ProgressBar } from "./components/ProgressBar";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAEhE,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAC7E,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,OAAO,IAAI,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAChE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,OAAO,IAAI,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC1F,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACpF,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC"}
|
|
@@ -5,9 +5,6 @@ export declare const SEED_DATA: ({
|
|
|
5
5
|
packageName: string;
|
|
6
6
|
category: string;
|
|
7
7
|
stylesPanelSections: string[];
|
|
8
|
-
layout: {
|
|
9
|
-
flex: number;
|
|
10
|
-
};
|
|
11
8
|
triggers: string[];
|
|
12
9
|
props: {
|
|
13
10
|
onRefresh: {
|
|
@@ -113,9 +110,6 @@ export declare const SEED_DATA: ({
|
|
|
113
110
|
packageName: string;
|
|
114
111
|
category: string;
|
|
115
112
|
stylesPanelSections: string[];
|
|
116
|
-
layout: {
|
|
117
|
-
flex: number;
|
|
118
|
-
};
|
|
119
113
|
triggers: string[];
|
|
120
114
|
props: {
|
|
121
115
|
onRefresh: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlashList.d.ts","sourceRoot":"","sources":["../../../../src/mappings/FlashList.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"FlashList.d.ts","sourceRoot":"","sources":["../../../../src/mappings/FlashList.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAqHrB,CAAC"}
|
|
@@ -4,22 +4,17 @@ export declare const SEED_DATA: {
|
|
|
4
4
|
description: string;
|
|
5
5
|
category: string;
|
|
6
6
|
stylesPanelSections: string[];
|
|
7
|
-
layout: {
|
|
8
|
-
flex: number;
|
|
9
|
-
};
|
|
10
7
|
props: {
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
children: {
|
|
9
|
+
group: string;
|
|
13
10
|
label: string;
|
|
14
11
|
description: string;
|
|
12
|
+
editable: boolean;
|
|
13
|
+
required: boolean;
|
|
15
14
|
formType: string;
|
|
16
15
|
propType: string;
|
|
17
16
|
defaultValue: string;
|
|
18
|
-
required: boolean;
|
|
19
|
-
editable: boolean;
|
|
20
|
-
group: string;
|
|
21
17
|
};
|
|
22
|
-
accessibilityLabel: any;
|
|
23
18
|
};
|
|
24
19
|
};
|
|
25
|
-
//# sourceMappingURL=
|
|
20
|
+
//# sourceMappingURL=Markdown.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Markdown.d.ts","sourceRoot":"","sources":["../../../../src/mappings/Markdown.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;CAuBrB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@draftbit/core",
|
|
3
|
-
"version": "46.8.2-
|
|
3
|
+
"version": "46.8.2-387722.2+3877227",
|
|
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.8.2-
|
|
44
|
+
"@draftbit/types": "^46.8.2-387722.2+3877227",
|
|
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",
|
|
@@ -54,10 +54,9 @@
|
|
|
54
54
|
"lodash.omit": "^4.5.0",
|
|
55
55
|
"lodash.tonumber": "^4.0.3",
|
|
56
56
|
"react-native-deck-swiper": "^2.0.12",
|
|
57
|
+
"react-native-markdown-display": "^7.0.0-alpha.2",
|
|
57
58
|
"react-native-modal-datetime-picker": "^13.0.0",
|
|
58
|
-
"react-native-pager-view": "5.4.24",
|
|
59
59
|
"react-native-svg": "12.3.0",
|
|
60
|
-
"react-native-tab-view": "^3.4.0",
|
|
61
60
|
"react-native-typography": "^1.4.1",
|
|
62
61
|
"react-native-web-swiper": "^2.2.3"
|
|
63
62
|
},
|
|
@@ -94,5 +93,5 @@
|
|
|
94
93
|
]
|
|
95
94
|
]
|
|
96
95
|
},
|
|
97
|
-
"gitHead": "
|
|
96
|
+
"gitHead": "3877227d472caa50d2c7ab2dc6674090b2fa3393"
|
|
98
97
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { StyleSheet } from "react-native";
|
|
3
|
+
import MarkdownComponent from "react-native-markdown-display";
|
|
4
|
+
const Markdown = ({ children, style, }) => {
|
|
5
|
+
return (
|
|
6
|
+
//'body' style applies to all markdown components
|
|
7
|
+
//@ts-ignore TS does not like the type of this named style for some reason
|
|
8
|
+
React.createElement(MarkdownComponent, { style: { body: StyleSheet.flatten(style) } }, children));
|
|
9
|
+
};
|
|
10
|
+
export default Markdown;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { StyleProp, ViewStyle, StyleSheet } from "react-native";
|
|
3
|
+
import MarkdownComponent from "react-native-markdown-display";
|
|
4
|
+
|
|
5
|
+
type MarkdownProps = {
|
|
6
|
+
style?: StyleProp<ViewStyle>;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
const Markdown: React.FC<React.PropsWithChildren<MarkdownProps>> = ({
|
|
10
|
+
children,
|
|
11
|
+
style,
|
|
12
|
+
}) => {
|
|
13
|
+
return (
|
|
14
|
+
//'body' style applies to all markdown components
|
|
15
|
+
//@ts-ignore TS does not like the type of this named style for some reason
|
|
16
|
+
<MarkdownComponent style={{ body: StyleSheet.flatten(style) }}>
|
|
17
|
+
{children}
|
|
18
|
+
</MarkdownComponent>
|
|
19
|
+
);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export default Markdown;
|
package/src/index.js
CHANGED
|
@@ -32,7 +32,7 @@ export { Swiper, SwiperItem } from "./components/Swiper";
|
|
|
32
32
|
export { Center, Circle, Square, Row, Stack, Spacer, } from "./components/Layout";
|
|
33
33
|
export { RadioButton, RadioButtonGroup, RadioButtonRow, RadioButtonFieldGroup, } from "./components/RadioButton/index";
|
|
34
34
|
export { DeckSwiper, DeckSwiperCard } from "./components/DeckSwiper";
|
|
35
|
-
export {
|
|
35
|
+
export { default as Markdown } from "./components/Markdown";
|
|
36
36
|
/* Deprecated: Fix or Delete! */
|
|
37
37
|
export { default as DatePicker } from "./components/DatePicker/DatePicker";
|
|
38
38
|
export { default as Picker } from "./components/Picker/Picker";
|
package/src/index.tsx
CHANGED
|
@@ -53,7 +53,7 @@ export {
|
|
|
53
53
|
|
|
54
54
|
export { DeckSwiper, DeckSwiperCard } from "./components/DeckSwiper";
|
|
55
55
|
|
|
56
|
-
export {
|
|
56
|
+
export { default as Markdown } from "./components/Markdown";
|
|
57
57
|
|
|
58
58
|
/* Deprecated: Fix or Delete! */
|
|
59
59
|
export { default as DatePicker } from "./components/DatePicker/DatePicker";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { COMPONENT_TYPES, createNumColumnsType, createStaticBoolProp, createNumberProp,
|
|
1
|
+
import { COMPONENT_TYPES, createNumColumnsType, createStaticBoolProp, createNumberProp, GROUPS, Triggers, createActionProp, createStaticNumberProp, createColorProp, StylesPanelSections, } from "@draftbit/types";
|
|
2
2
|
export const SEED_DATA = [
|
|
3
3
|
{
|
|
4
4
|
name: "Masonry List",
|
|
@@ -6,10 +6,10 @@ export const SEED_DATA = [
|
|
|
6
6
|
description: "Masonry Flashlist by Shopify",
|
|
7
7
|
packageName: "@shopify/flash-list",
|
|
8
8
|
category: COMPONENT_TYPES.data,
|
|
9
|
-
stylesPanelSections:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
stylesPanelSections: [
|
|
10
|
+
StylesPanelSections.Background,
|
|
11
|
+
StylesPanelSections.MarginsAndPaddings,
|
|
12
|
+
],
|
|
13
13
|
triggers: [Triggers.OnRefresh, Triggers.OnEndReached],
|
|
14
14
|
props: {
|
|
15
15
|
onRefresh: createActionProp(),
|
|
@@ -57,10 +57,10 @@ export const SEED_DATA = [
|
|
|
57
57
|
description: "Flashlist by Shopify",
|
|
58
58
|
packageName: "@shopify/flash-list",
|
|
59
59
|
category: COMPONENT_TYPES.data,
|
|
60
|
-
stylesPanelSections:
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
60
|
+
stylesPanelSections: [
|
|
61
|
+
StylesPanelSections.Background,
|
|
62
|
+
StylesPanelSections.MarginsAndPaddings,
|
|
63
|
+
],
|
|
64
64
|
triggers: [Triggers.OnRefresh, Triggers.OnEndReached],
|
|
65
65
|
props: {
|
|
66
66
|
onRefresh: createActionProp(),
|