@draftbit/core 46.8.1-a8280d.2 → 46.8.1-c1d8e9.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 (33) hide show
  1. package/lib/commonjs/components/Markdown.js +30 -0
  2. package/lib/commonjs/index.js +7 -7
  3. package/lib/commonjs/mappings/Markdown.js +27 -0
  4. package/lib/module/components/DeprecatedButton.js +21 -3
  5. package/lib/module/components/Markdown.js +20 -0
  6. package/lib/module/components/TextField.js +28 -78
  7. package/lib/module/index.js +1 -1
  8. package/lib/module/mappings/Markdown.js +20 -0
  9. package/lib/typescript/src/components/Markdown.d.ts +8 -0
  10. package/lib/typescript/src/components/Markdown.d.ts.map +1 -0
  11. package/lib/typescript/src/index.d.ts +1 -1
  12. package/lib/typescript/src/index.d.ts.map +1 -1
  13. package/lib/typescript/src/mappings/Markdown.d.ts +20 -0
  14. package/lib/typescript/src/mappings/Markdown.d.ts.map +1 -0
  15. package/package.json +5 -6
  16. package/src/components/Markdown.js +10 -0
  17. package/src/components/Markdown.tsx +22 -0
  18. package/src/index.js +1 -1
  19. package/src/index.tsx +1 -1
  20. package/src/mappings/Markdown.js +20 -0
  21. package/src/mappings/Markdown.ts +27 -0
  22. package/lib/commonjs/components/YotubePlayer.js +0 -37
  23. package/lib/commonjs/mappings/YoutubePlayer.js +0 -44
  24. package/lib/module/components/YotubePlayer.js +0 -29
  25. package/lib/module/mappings/YoutubePlayer.js +0 -37
  26. package/lib/typescript/src/components/YotubePlayer.d.ts +0 -12
  27. package/lib/typescript/src/components/YotubePlayer.d.ts.map +0 -1
  28. package/lib/typescript/src/mappings/YoutubePlayer.d.ts +0 -37
  29. package/lib/typescript/src/mappings/YoutubePlayer.d.ts.map +0 -1
  30. package/src/components/YotubePlayer.js +0 -9
  31. package/src/components/YotubePlayer.tsx +0 -37
  32. package/src/mappings/YoutubePlayer.js +0 -37
  33. package/src/mappings/YoutubePlayer.ts +0 -43
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var React = _interopRequireWildcard(require("react"));
8
+ var _reactNative = require("react-native");
9
+ var _reactNativeMarkdownDisplay = _interopRequireDefault(require("react-native-markdown-display"));
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
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
+ 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
+ const Markdown = _ref => {
14
+ let {
15
+ children,
16
+ style
17
+ } = _ref;
18
+ return (
19
+ /*#__PURE__*/
20
+ //'body' style used for main parent container
21
+ //@ts-ignore TS does not like the type of this named style for some reason
22
+ React.createElement(_reactNativeMarkdownDisplay.default, {
23
+ style: {
24
+ body: _reactNative.StyleSheet.flatten(style)
25
+ }
26
+ }, children)
27
+ );
28
+ };
29
+ var _default = Markdown;
30
+ exports.default = _default;
@@ -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 () {
@@ -363,12 +369,6 @@ Object.defineProperty(exports, "Touchable", {
363
369
  return _Touchable.default;
364
370
  }
365
371
  });
366
- Object.defineProperty(exports, "YoutubePlayer", {
367
- enumerable: true,
368
- get: function () {
369
- return _YotubePlayer.default;
370
- }
371
- });
372
372
  Object.defineProperty(exports, "injectIcon", {
373
373
  enumerable: true,
374
374
  get: function () {
@@ -420,7 +420,7 @@ var _Swiper = require("./components/Swiper");
420
420
  var _Layout = require("./components/Layout");
421
421
  var _index = require("./components/RadioButton/index");
422
422
  var _DeckSwiper = require("./components/DeckSwiper");
423
- var _YotubePlayer = _interopRequireDefault(require("./components/YotubePlayer"));
423
+ var _Markdown = _interopRequireDefault(require("./components/Markdown"));
424
424
  var _DatePicker = _interopRequireDefault(require("./components/DatePicker/DatePicker"));
425
425
  var _Picker = _interopRequireDefault(require("./components/Picker/Picker"));
426
426
  var _ProgressBar = _interopRequireDefault(require("./components/ProgressBar"));
@@ -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.basic,
13
+ stylesPanelSections: _types.BLOCK_STYLES_SECTIONS,
14
+ props: {
15
+ children: {
16
+ group: _types.GROUPS.data,
17
+ label: "Markdown Text",
18
+ description: "Markdownt text to be rendered ",
19
+ editable: true,
20
+ required: true,
21
+ formType: _types.FORM_TYPES.string,
22
+ propType: _types.PROP_TYPES.STRING,
23
+ defaultValue: "## Double click me to edit 👀"
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 * as React from "react";
3
2
  import { ActivityIndicator, View, Text, StyleSheet, Pressable } from "react-native";
4
3
  import color from "color";
@@ -75,7 +74,8 @@ const Button = _ref => {
75
74
  elevation,
76
75
  alignSelf: "stretch"
77
76
  }
78
- }, /*#__PURE__*/React.createElement(Pressable, _extends({}, rest, {
77
+ }, /*#__PURE__*/React.createElement(Pressable, {
78
+ ...rest,
79
79
  onPress: onPress,
80
80
  accessibilityState: {
81
81
  disabled
@@ -83,7 +83,7 @@ const Button = _ref => {
83
83
  accessibilityRole: "button",
84
84
  disabled: disabled || loading,
85
85
  style: [styles.button, buttonStyle]
86
- }), /*#__PURE__*/React.createElement(View, {
86
+ }, /*#__PURE__*/React.createElement(View, {
87
87
  style: styles.content
88
88
  }, icon && loading !== true ? /*#__PURE__*/React.createElement(View, {
89
89
  style: iconStyle
@@ -114,4 +114,22 @@ const styles = StyleSheet.create({
114
114
  width: Config.buttonIconSize
115
115
  }
116
116
  });
117
+ export default withTheme(Button);: 1,
118
+ style: [textStyle, typography.button]
119
+ }, children))));
120
+ };
121
+ const styles = StyleSheet.create({
122
+ button: {
123
+ minWidth: 64,
124
+ borderStyle: "solid"
125
+ },
126
+ content: {
127
+ flexDirection: "row",
128
+ alignItems: "center",
129
+ justifyContent: "center"
130
+ },
131
+ icon: {
132
+ width: Config.buttonIconSize
133
+ }
134
+ });
117
135
  export default withTheme(Button);
@@ -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 used for main parent container
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;
@@ -1,3 +1,7 @@
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
+ 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; }
3
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
4
+ 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); }
1
5
  import * as React from "react";
2
6
  import { View, Animated, TextInput as NativeTextInput, StyleSheet, Text, I18nManager } from "react-native";
3
7
  import { withTheme } from "../theming";
@@ -9,7 +13,7 @@ const ICON_SIZE = 24;
9
13
  class TextField extends React.Component {
10
14
  constructor() {
11
15
  super(...arguments);
12
- this.state = {
16
+ _defineProperty(this, "state", {
13
17
  nativeProps: {},
14
18
  labeled: new Animated.Value(this.props.value || this.props.error ? 0 : 1),
15
19
  focused: false,
@@ -18,46 +22,47 @@ class TextField extends React.Component {
18
22
  measured: false,
19
23
  width: 0
20
24
  }
21
- };
22
- this._timer = setTimeout(() => {}, 0);
23
- this._showPlaceholder = () => {
25
+ });
26
+ _defineProperty(this, "_timer", setTimeout(() => {}, 0));
27
+ _defineProperty(this, "_showPlaceholder", () => {
24
28
  clearTimeout(this._timer);
29
+
25
30
  // Set the placeholder in a delay to offset the label animation
26
31
  // If we show it immediately, they'll overlap and look ugly
27
32
  this._timer = setTimeout(() => this.setState({
28
33
  placeholder: this.props.placeholder
29
34
  }), 50);
30
- };
31
- this._hidePlaceholder = () => this.setState({
32
- placeholder: ""
33
35
  });
34
- this._restoreLabel = () => Animated.timing(this.state.labeled, {
36
+ _defineProperty(this, "_hidePlaceholder", () => this.setState({
37
+ placeholder: ""
38
+ }));
39
+ _defineProperty(this, "_restoreLabel", () => Animated.timing(this.state.labeled, {
35
40
  toValue: 1,
36
41
  duration: FOCUS_ANIMATION_DURATION,
37
42
  useNativeDriver: true
38
- }).start();
39
- this._minmizeLabel = () => Animated.timing(this.state.labeled, {
43
+ }).start());
44
+ _defineProperty(this, "_minmizeLabel", () => Animated.timing(this.state.labeled, {
40
45
  toValue: 0,
41
46
  duration: BLUR_ANIMATION_DURATION,
42
47
  useNativeDriver: true
43
- }).start();
44
- this._handleFocus = () => {
48
+ }).start());
49
+ _defineProperty(this, "_handleFocus", () => {
45
50
  if (this.props.disabled) {
46
51
  return;
47
52
  }
48
53
  this.setState({
49
54
  focused: true
50
55
  });
51
- };
52
- this._handleBlur = () => {
56
+ });
57
+ _defineProperty(this, "_handleBlur", () => {
53
58
  if (this.props.disabled) {
54
59
  return;
55
60
  }
56
61
  this.setState({
57
62
  focused: false
58
63
  });
59
- };
60
- this._handleChangeText = value => {
64
+ });
65
+ _defineProperty(this, "_handleChangeText", value => {
61
66
  if (this.props.disabled) {
62
67
  return;
63
68
  }
@@ -72,8 +77,8 @@ class TextField extends React.Component {
72
77
  });
73
78
  this.props.onChangeText && this.props.onChangeText(value.nativeEvent.text);
74
79
  }
75
- };
76
- this._root = undefined;
80
+ });
81
+ _defineProperty(this, "_root", undefined);
77
82
  }
78
83
  static getDerivedStateFromProps(nextProps, prevState) {
79
84
  return {
@@ -160,9 +165,7 @@ class TextField extends React.Component {
160
165
  roundness,
161
166
  disabledOpacity
162
167
  },
163
- render = props => /*#__PURE__*/React.createElement(NativeTextInput, {
164
- ...props
165
- }),
168
+ render = props => /*#__PURE__*/React.createElement(NativeTextInput, props),
166
169
  ...rest
167
170
  } = this.props;
168
171
  const MINIMIZED_LABEL_Y_OFFSET = -(typography.caption.lineHeight + 4);
@@ -302,10 +305,9 @@ class TextField extends React.Component {
302
305
  } = StyleSheet.flatten(style || {});
303
306
  return /*#__PURE__*/React.createElement(View, {
304
307
  style: [styles.container, styleProp]
305
- }, leftIconName && leftIconMode === "outset" ? /*#__PURE__*/React.createElement(Icon, {
306
- ...leftIconProps,
308
+ }, leftIconName && leftIconMode === "outset" ? /*#__PURE__*/React.createElement(Icon, _extends({}, leftIconProps, {
307
309
  style: leftIconStyle
308
- }) : null, /*#__PURE__*/React.createElement(View, {
310
+ })) : null, /*#__PURE__*/React.createElement(View, {
309
311
  style: applyStyles([containerStyle], {
310
312
  height: style === null || style === void 0 ? void 0 : style.height,
311
313
  backgroundColor: bgColor,
@@ -373,10 +375,9 @@ class TextField extends React.Component {
373
375
  style: {
374
376
  justifyContent: type === "solid" ? "center" : undefined
375
377
  }
376
- }, /*#__PURE__*/React.createElement(Icon, {
377
- ...leftIconProps,
378
+ }, /*#__PURE__*/React.createElement(Icon, _extends({}, leftIconProps, {
378
379
  style: leftIconStyle
379
- })) : null, render({
380
+ }))) : null, render({
380
381
  ref: c => {
381
382
  this._root = c;
382
383
  },
@@ -413,57 +414,6 @@ class TextField extends React.Component {
413
414
  }
414
415
  }
415
416
  export default withTheme(TextField);
416
- const styles = StyleSheet.create({
417
- container: {
418
- alignSelf: "stretch"
419
- },
420
- placeholder: {
421
- position: "absolute",
422
- left: 0
423
- },
424
- underline: {
425
- position: "absolute",
426
- left: 0,
427
- right: 0,
428
- bottom: 0,
429
- height: 2
430
- },
431
- input: {
432
- flexGrow: 1,
433
- justifyContent: "center",
434
- textAlignVertical: "center",
435
- margin: 0,
436
- textAlign: I18nManager.isRTL ? "right" : "left"
437
- }
438
- });ionColor: activeColor,
439
- multiline,
440
- numberOfLines,
441
- onFocus: this._handleFocus,
442
- onBlur: this._handleBlur,
443
- underlineColorAndroid: "transparent",
444
- style: inputStyles,
445
- ...rest,
446
- ...this.state.nativeProps,
447
- value: this.state.value
448
- })), rightIconName ? /*#__PURE__*/React.createElement(Icon, {
449
- name: rightIconName,
450
- size: ICON_SIZE,
451
- color: colors.light,
452
- style: {
453
- position: "absolute",
454
- right: 16,
455
- marginTop: type === "solid" ? MINIMIZED_LABEL_FONT_SIZE + 4 : 16
456
- }
457
- }) : null, assistiveText ? /*#__PURE__*/React.createElement(Text, {
458
- style: [{
459
- color: error ? colors.error : colors.light,
460
- marginTop: 8,
461
- marginLeft: assistiveTextLeftMargin
462
- }]
463
- }, assistiveText) : null);
464
- }
465
- }
466
- export default withTheme(TextField);
467
417
  const styles = StyleSheet.create({
468
418
  container: {
469
419
  alignSelf: "stretch"
@@ -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 { default as YoutubePlayer } from "./components/YotubePlayer";
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";
@@ -0,0 +1,20 @@
1
+ import { BLOCK_STYLES_SECTIONS, COMPONENT_TYPES, FORM_TYPES, GROUPS, PROP_TYPES } 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.basic,
7
+ stylesPanelSections: BLOCK_STYLES_SECTIONS,
8
+ props: {
9
+ children: {
10
+ group: GROUPS.data,
11
+ label: "Markdown Text",
12
+ description: "Markdownt text to be rendered ",
13
+ editable: true,
14
+ required: true,
15
+ formType: FORM_TYPES.string,
16
+ propType: PROP_TYPES.STRING,
17
+ defaultValue: "## Double click me to edit 👀"
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 { default as YoutubePlayer } from "./components/YotubePlayer";
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,OAA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ACN,MAAM,EACN,MAAM,EACN,GAAG,EACH,KAAK,EACL,MAAM,GACP,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,qBAAqB,GACtB,MAAM,gCAAgC,CAAC;AAExC,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAErE,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAG5D,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,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"}
@@ -0,0 +1,20 @@
1
+ export declare const SEED_DATA: {
2
+ name: string;
3
+ tag: string;
4
+ description: string;
5
+ category: string;
6
+ stylesPanelSections: string[];
7
+ props: {
8
+ children: {
9
+ group: string;
10
+ label: string;
11
+ description: string;
12
+ editable: boolean;
13
+ required: boolean;
14
+ formType: string;
15
+ propType: string;
16
+ defaultValue: string;
17
+ };
18
+ };
19
+ };
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;;;;;;;;;;;;;;;;;;CAkBrB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@draftbit/core",
3
- "version": "46.8.1-a8280d.2+a8280d9",
3
+ "version": "46.8.1-c1d8e9.2+c1d8e9f",
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.1-a8280d.2+a8280d9",
44
+ "@draftbit/types": "^46.8.1-c1d8e9.2+c1d8e9f",
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,12 +54,11 @@
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
59
  "react-native-svg": "12.3.0",
59
60
  "react-native-typography": "^1.4.1",
60
- "react-native-web-swiper": "^2.2.3",
61
- "react-native-web-webview": "^1.0.2",
62
- "react-native-youtube-iframe": "^2.2.2"
61
+ "react-native-web-swiper": "^2.2.3"
63
62
  },
64
63
  "devDependencies": {
65
64
  "@types/color": "^3.0.1",
@@ -94,5 +93,5 @@
94
93
  ]
95
94
  ]
96
95
  },
97
- "gitHead": "a8280d9c32a1c5d4dd267483d55bbf206bf0047a"
96
+ "gitHead": "c1d8e9fc142bf557fb1ae20dff52b8de218703db"
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 used for main parent container
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 used for main parent container
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 { default as YoutubePlayer } from "./components/YotubePlayer";
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 { default as YoutubePlayer } from "./components/YotubePlayer";
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";
@@ -0,0 +1,20 @@
1
+ import { BLOCK_STYLES_SECTIONS, COMPONENT_TYPES, FORM_TYPES, GROUPS, PROP_TYPES, } 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.basic,
7
+ stylesPanelSections: BLOCK_STYLES_SECTIONS,
8
+ props: {
9
+ children: {
10
+ group: GROUPS.data,
11
+ label: "Markdown Text",
12
+ description: "Markdownt text to be rendered ",
13
+ editable: true,
14
+ required: true,
15
+ formType: FORM_TYPES.string,
16
+ propType: PROP_TYPES.STRING,
17
+ defaultValue: "## Double click me to edit 👀",
18
+ },
19
+ },
20
+ };
@@ -0,0 +1,27 @@
1
+ import {
2
+ BLOCK_STYLES_SECTIONS,
3
+ COMPONENT_TYPES,
4
+ FORM_TYPES,
5
+ GROUPS,
6
+ PROP_TYPES,
7
+ } from "@draftbit/types";
8
+
9
+ export const SEED_DATA = {
10
+ name: "Markdown",
11
+ tag: "Markdown",
12
+ description: "A component that renders markdown",
13
+ category: COMPONENT_TYPES.basic,
14
+ stylesPanelSections: BLOCK_STYLES_SECTIONS,
15
+ props: {
16
+ children: {
17
+ group: GROUPS.data,
18
+ label: "Markdown Text",
19
+ description: "Markdownt text to be rendered ",
20
+ editable: true,
21
+ required: true,
22
+ formType: FORM_TYPES.string,
23
+ propType: PROP_TYPES.STRING,
24
+ defaultValue: "## Double click me to edit 👀",
25
+ },
26
+ },
27
+ };
@@ -1,37 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _react = _interopRequireDefault(require("react"));
8
- var _reactNativeYoutubeIframe = _interopRequireDefault(require("react-native-youtube-iframe"));
9
- var _utilities = require("../utilities");
10
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
- const YoutubePlayer = _ref => {
12
- let {
13
- videoId,
14
- playlist,
15
- mute = false,
16
- autoplay = false,
17
- style
18
- } = _ref;
19
- const {
20
- viewStyles
21
- } = (0, _utilities.extractStyles)(style);
22
- const {
23
- height,
24
- width
25
- } = viewStyles;
26
- return /*#__PURE__*/_react.default.createElement(_reactNativeYoutubeIframe.default, {
27
- height: height,
28
- width: width,
29
- play: autoplay,
30
- videoId: videoId,
31
- playList: playlist,
32
- mute: mute,
33
- webViewStyle: style
34
- });
35
- };
36
- var _default = YoutubePlayer;
37
- exports.default = _default;
@@ -1,44 +0,0 @@
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: "Youtube Player",
10
- tag: "YoutubePlayer",
11
- description: "Plays a youtube video form a Youtube video or playlist id",
12
- doc_link: "https://lonelycpp.github.io/react-native-youtube-iframe",
13
- code_link: "https://github.com/LonelyCpp/react-native-youtube-iframe",
14
- category: _types.COMPONENT_TYPES.media,
15
- stylesPanelSections: _types.BLOCK_STYLES_SECTIONS,
16
- layout: {
17
- height: 250
18
- },
19
- props: {
20
- videoId: (0, _types.createTextProp)({
21
- label: "Video ID",
22
- description: "VideoId of the Youtube video.",
23
- defaultValue: "nwMUpDESXrI"
24
- }),
25
- playlist: (0, _types.createTextProp)({
26
- label: "Playlist",
27
- description: "Playlist of the Youtube videos.",
28
- defaultValue: "PLUa6TiXzjIrwowt6P-uGCJm8ovm-9S1Ks"
29
- }),
30
- mute: (0, _types.createStaticBoolProp)({
31
- label: "Mute Audio",
32
- description: "Mute the audio of the video.",
33
- defaultValue: false,
34
- required: false
35
- }),
36
- autoplay: (0, _types.createStaticBoolProp)({
37
- label: "Auto Play",
38
- description: "Autoplay the video on load.",
39
- defaultValue: false,
40
- required: false
41
- })
42
- }
43
- };
44
- exports.SEED_DATA = SEED_DATA;
@@ -1,29 +0,0 @@
1
- import React from "react";
2
- import YoutubePlayerComponent from "react-native-youtube-iframe";
3
- import { extractStyles } from "../utilities";
4
- const YoutubePlayer = _ref => {
5
- let {
6
- videoId,
7
- playlist,
8
- mute = false,
9
- autoplay = false,
10
- style
11
- } = _ref;
12
- const {
13
- viewStyles
14
- } = extractStyles(style);
15
- const {
16
- height,
17
- width
18
- } = viewStyles;
19
- return /*#__PURE__*/React.createElement(YoutubePlayerComponent, {
20
- height: height,
21
- width: width,
22
- play: autoplay,
23
- videoId: videoId,
24
- playList: playlist,
25
- mute: mute,
26
- webViewStyle: style
27
- });
28
- };
29
- export default YoutubePlayer;
@@ -1,37 +0,0 @@
1
- import { BLOCK_STYLES_SECTIONS, COMPONENT_TYPES, createStaticBoolProp, createTextProp } from "@draftbit/types";
2
- export const SEED_DATA = {
3
- name: "Youtube Player",
4
- tag: "YoutubePlayer",
5
- description: "Plays a youtube video form a Youtube video or playlist id",
6
- doc_link: "https://lonelycpp.github.io/react-native-youtube-iframe",
7
- code_link: "https://github.com/LonelyCpp/react-native-youtube-iframe",
8
- category: COMPONENT_TYPES.media,
9
- stylesPanelSections: BLOCK_STYLES_SECTIONS,
10
- layout: {
11
- height: 250
12
- },
13
- props: {
14
- videoId: createTextProp({
15
- label: "Video ID",
16
- description: "VideoId of the Youtube video.",
17
- defaultValue: "nwMUpDESXrI"
18
- }),
19
- playlist: createTextProp({
20
- label: "Playlist",
21
- description: "Playlist of the Youtube videos.",
22
- defaultValue: "PLUa6TiXzjIrwowt6P-uGCJm8ovm-9S1Ks"
23
- }),
24
- mute: createStaticBoolProp({
25
- label: "Mute Audio",
26
- description: "Mute the audio of the video.",
27
- defaultValue: false,
28
- required: false
29
- }),
30
- autoplay: createStaticBoolProp({
31
- label: "Auto Play",
32
- description: "Autoplay the video on load.",
33
- defaultValue: false,
34
- required: false
35
- })
36
- }
37
- };
@@ -1,12 +0,0 @@
1
- import React from "react";
2
- import { StyleProp, ViewStyle } from "react-native";
3
- interface YoutubePlayerProps {
4
- videoId?: string;
5
- playlist?: string;
6
- mute?: boolean;
7
- autoplay?: boolean;
8
- style?: StyleProp<ViewStyle>;
9
- }
10
- declare const YoutubePlayer: React.FC<YoutubePlayerProps>;
11
- export default YoutubePlayer;
12
- //# sourceMappingURL=YotubePlayer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"YotubePlayer.d.ts","sourceRoot":"","sources":["../../../../src/components/YotubePlayer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAIpD,UAAU,kBAAkB;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAqB/C,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -1,37 +0,0 @@
1
- export declare const SEED_DATA: {
2
- name: string;
3
- tag: string;
4
- description: string;
5
- doc_link: string;
6
- code_link: string;
7
- category: string;
8
- stylesPanelSections: string[];
9
- layout: {
10
- height: number;
11
- };
12
- props: {
13
- videoId: any;
14
- playlist: any;
15
- mute: {
16
- label: string;
17
- description: string;
18
- formType: string;
19
- propType: string;
20
- defaultValue: boolean;
21
- editable: boolean;
22
- required: boolean;
23
- group: string;
24
- };
25
- autoplay: {
26
- label: string;
27
- description: string;
28
- formType: string;
29
- propType: string;
30
- defaultValue: boolean;
31
- editable: boolean;
32
- required: boolean;
33
- group: string;
34
- };
35
- };
36
- };
37
- //# sourceMappingURL=YoutubePlayer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"YoutubePlayer.d.ts","sourceRoot":"","sources":["../../../../src/mappings/YoutubePlayer.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmCrB,CAAC"}
@@ -1,9 +0,0 @@
1
- import React from "react";
2
- import YoutubePlayerComponent from "react-native-youtube-iframe";
3
- import { extractStyles } from "../utilities";
4
- const YoutubePlayer = ({ videoId, playlist, mute = false, autoplay = false, style, }) => {
5
- const { viewStyles } = extractStyles(style);
6
- const { height, width } = viewStyles;
7
- return (React.createElement(YoutubePlayerComponent, { height: height, width: width, play: autoplay, videoId: videoId, playList: playlist, mute: mute, webViewStyle: style }));
8
- };
9
- export default YoutubePlayer;
@@ -1,37 +0,0 @@
1
- import React from "react";
2
- import { StyleProp, ViewStyle } from "react-native";
3
- import YoutubePlayerComponent from "react-native-youtube-iframe";
4
- import { extractStyles } from "../utilities";
5
-
6
- interface YoutubePlayerProps {
7
- videoId?: string;
8
- playlist?: string;
9
- mute?: boolean;
10
- autoplay?: boolean;
11
- style?: StyleProp<ViewStyle>;
12
- }
13
-
14
- const YoutubePlayer: React.FC<YoutubePlayerProps> = ({
15
- videoId,
16
- playlist,
17
- mute = false,
18
- autoplay = false,
19
- style,
20
- }) => {
21
- const { viewStyles } = extractStyles(style);
22
- const { height, width } = viewStyles;
23
-
24
- return (
25
- <YoutubePlayerComponent
26
- height={height}
27
- width={width}
28
- play={autoplay}
29
- videoId={videoId}
30
- playList={playlist}
31
- mute={mute}
32
- webViewStyle={style}
33
- />
34
- );
35
- };
36
-
37
- export default YoutubePlayer;
@@ -1,37 +0,0 @@
1
- import { BLOCK_STYLES_SECTIONS, COMPONENT_TYPES, createStaticBoolProp, createTextProp, } from "@draftbit/types";
2
- export const SEED_DATA = {
3
- name: "Youtube Player",
4
- tag: "YoutubePlayer",
5
- description: "Plays a youtube video form a Youtube video or playlist id",
6
- doc_link: "https://lonelycpp.github.io/react-native-youtube-iframe",
7
- code_link: "https://github.com/LonelyCpp/react-native-youtube-iframe",
8
- category: COMPONENT_TYPES.media,
9
- stylesPanelSections: BLOCK_STYLES_SECTIONS,
10
- layout: {
11
- height: 250,
12
- },
13
- props: {
14
- videoId: createTextProp({
15
- label: "Video ID",
16
- description: "VideoId of the Youtube video.",
17
- defaultValue: "nwMUpDESXrI",
18
- }),
19
- playlist: createTextProp({
20
- label: "Playlist",
21
- description: "Playlist of the Youtube videos.",
22
- defaultValue: "PLUa6TiXzjIrwowt6P-uGCJm8ovm-9S1Ks",
23
- }),
24
- mute: createStaticBoolProp({
25
- label: "Mute Audio",
26
- description: "Mute the audio of the video.",
27
- defaultValue: false,
28
- required: false,
29
- }),
30
- autoplay: createStaticBoolProp({
31
- label: "Auto Play",
32
- description: "Autoplay the video on load.",
33
- defaultValue: false,
34
- required: false,
35
- }),
36
- },
37
- };
@@ -1,43 +0,0 @@
1
- import {
2
- BLOCK_STYLES_SECTIONS,
3
- COMPONENT_TYPES,
4
- createStaticBoolProp,
5
- createTextProp,
6
- } from "@draftbit/types";
7
-
8
- export const SEED_DATA = {
9
- name: "Youtube Player",
10
- tag: "YoutubePlayer",
11
- description: "Plays a youtube video form a Youtube video or playlist id",
12
- doc_link: "https://lonelycpp.github.io/react-native-youtube-iframe",
13
- code_link: "https://github.com/LonelyCpp/react-native-youtube-iframe",
14
- category: COMPONENT_TYPES.media,
15
- stylesPanelSections: BLOCK_STYLES_SECTIONS,
16
- layout: {
17
- height: 250,
18
- },
19
- props: {
20
- videoId: createTextProp({
21
- label: "Video ID",
22
- description: "VideoId of the Youtube video.",
23
- defaultValue: "nwMUpDESXrI",
24
- }),
25
- playlist: createTextProp({
26
- label: "Playlist",
27
- description: "Playlist of the Youtube videos.",
28
- defaultValue: "PLUa6TiXzjIrwowt6P-uGCJm8ovm-9S1Ks",
29
- }),
30
- mute: createStaticBoolProp({
31
- label: "Mute Audio",
32
- description: "Mute the audio of the video.",
33
- defaultValue: false,
34
- required: false,
35
- }),
36
- autoplay: createStaticBoolProp({
37
- label: "Auto Play",
38
- description: "Autoplay the video on load.",
39
- defaultValue: false,
40
- required: false,
41
- }),
42
- },
43
- };