@draftbit/core 46.2.4-1cc3fe.10 → 46.2.4-23a57c.12

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.
@@ -23,6 +23,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
23
23
 
24
24
  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; }
25
25
 
26
+ 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); }
27
+
26
28
  function Switch(_ref) {
27
29
  let {
28
30
  value,
@@ -55,24 +57,23 @@ function Switch(_ref) {
55
57
  setChecked(Boolean(defaultValue));
56
58
  }
57
59
  }, [defaultValue, previousDefaultValue]);
58
- return /*#__PURE__*/React.createElement(_reactNative.Switch, {
60
+ return /*#__PURE__*/React.createElement(_reactNative.Switch, _extends({
59
61
  value: checked,
60
62
  disabled: disabled,
61
63
  trackColor: {
62
64
  false: inactiveTrackThemeColor,
63
65
  true: activeTrackThemeColor
64
66
  },
65
- thumbColor: value ? activeThumbThemeColor : inactiveThumbThemeColor,
66
- // @ts-ignore react-native-web only
67
+ thumbColor: value ? activeThumbThemeColor : inactiveThumbThemeColor // @ts-ignore react-native-web only
68
+ ,
67
69
  activeThumbColor: activeThumbThemeColor,
68
70
  ios_backgroundColor: inactiveTrackThemeColor,
69
71
  style: style,
70
72
  onValueChange: bool => {
71
73
  setChecked(bool);
72
74
  onValueChange && onValueChange(bool);
73
- },
74
- ...rest
75
- });
75
+ }
76
+ }, rest));
76
77
  }
77
78
 
78
79
  function Row(_ref2) {
@@ -102,7 +103,7 @@ function Row(_ref2) {
102
103
  setChecked(defaultValue);
103
104
  }
104
105
  }, [defaultValue]);
105
- return /*#__PURE__*/React.createElement(_FormRow.default, {
106
+ return /*#__PURE__*/React.createElement(_FormRow.default, _extends({
106
107
  disabled: disabled,
107
108
  onPress: () => {
108
109
  setChecked(!checked);
@@ -110,9 +111,8 @@ function Row(_ref2) {
110
111
  },
111
112
  label: label,
112
113
  direction: direction,
113
- style: style,
114
- ...rest
115
- }, /*#__PURE__*/React.createElement(Switch, {
114
+ style: style
115
+ }, rest), /*#__PURE__*/React.createElement(Switch, {
116
116
  theme: theme,
117
117
  value: checked,
118
118
  disabled: disabled,
@@ -129,17 +129,4 @@ exports.SwitchRow = SwitchRow;
129
129
 
130
130
  var _default = (0, _theming.withTheme)(Switch);
131
131
 
132
- exports.default = _default;onValueChange,
133
- activeTrackColor: activeTrackColor,
134
- inactiveTrackColor: inactiveTrackColor,
135
- activeThumbColor: activeThumbColor,
136
- inactiveThumbColor: inactiveThumbColor
137
- }));
138
- }
139
-
140
- const SwitchRow = (0, _theming.withTheme)(Row);
141
- exports.SwitchRow = SwitchRow;
142
-
143
- var _default = (0, _theming.withTheme)(Switch);
144
-
145
132
  exports.default = _default;
@@ -213,12 +213,6 @@ Object.defineProperty(exports, "Link", {
213
213
  return _Text.Link;
214
214
  }
215
215
  });
216
- Object.defineProperty(exports, "Markdown", {
217
- enumerable: true,
218
- get: function () {
219
- return _Markdown.default;
220
- }
221
- });
222
216
  Object.defineProperty(exports, "NumberInput", {
223
217
  enumerable: true,
224
218
  get: function () {
@@ -518,8 +512,6 @@ var _Stepper = _interopRequireDefault(require("./components/Stepper"));
518
512
 
519
513
  var _useAuthState = require("./components/useAuthState");
520
514
 
521
- var _Markdown = _interopRequireDefault(require("./components/Markdown"));
522
-
523
515
  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); }
524
516
 
525
517
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -19,16 +19,8 @@ const SEED_DATA_PROPS = {
19
19
  description: "Button Label",
20
20
  defaultValue: "Get Started"
21
21
  }),
22
- disabled: (0, _types.createBoolProp)({
23
- group: _types.GROUPS.basic,
24
- label: "Disabled",
25
- description: "Whether the button should be disabled"
26
- }),
27
- loading: (0, _types.createBoolProp)({
28
- group: _types.GROUPS.basic,
29
- label: "Loading",
30
- description: "Whether to show a loading indicator"
31
- })
22
+ disabled: (0, _types.createDisabledProp)(),
23
+ loading: (0, _types.createLoadingProp)()
32
24
  };
33
25
  const LAYOUT = {
34
26
  backgroundColor: "transparent",
@@ -38,7 +30,7 @@ const LAYOUT = {
38
30
  const SEED_DATA = [{
39
31
  name: "Button Outline",
40
32
  tag: "ButtonOutline",
41
- category: _types.COMPONENT_TYPES.button,
33
+ category: _types.COMPONENT_TYPES.deprecated,
42
34
  stylesPanelSections: [_types.StylesPanelSections.Typography, _types.StylesPanelSections.Background, _types.StylesPanelSections.Borders, _types.StylesPanelSections.Size, _types.StylesPanelSections.MarginsAndPaddings, _types.StylesPanelSections.Position, _types.StylesPanelSections.Effects],
43
35
  layout: { ...LAYOUT,
44
36
  backgroundColor: "transparent",
@@ -48,7 +40,7 @@ const SEED_DATA = [{
48
40
  triggers: SEED_DATA_TRIGGERS,
49
41
  props: SEED_DATA_PROPS
50
42
  }, {
51
- name: "Button Solid",
43
+ name: "Button",
52
44
  tag: "ButtonSolid",
53
45
  category: _types.COMPONENT_TYPES.button,
54
46
  stylesPanelSections: [_types.StylesPanelSections.Typography, _types.StylesPanelSections.Background, _types.StylesPanelSections.Borders, _types.StylesPanelSections.Size, _types.StylesPanelSections.MarginsAndPaddings, _types.StylesPanelSections.Position, _types.StylesPanelSections.Effects],
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.SEED_DATA = void 0;
7
+
8
+ var _types = require("@draftbit/types");
9
+
10
+ const SEED_DATA = {
11
+ name: "FlashList",
12
+ tag: "FlashList",
13
+ description: "Flashlist by Shopify",
14
+ packageName: "@shopify/flash-list",
15
+ category: _types.COMPONENT_TYPES.data,
16
+ stylesPanelSections: _types.CONTAINER_COMPONENT_STYLES_SECTIONS,
17
+ layout: {
18
+ flex: 1
19
+ },
20
+ props: {
21
+ estimatedItemSize: (0, _types.createNumberProp)({
22
+ group: _types.GROUPS.basic,
23
+ label: "Est. Item Size",
24
+ description: "Approximate size of the items before rendering.",
25
+ defaultValue: 50,
26
+ step: 1,
27
+ precision: 0
28
+ }),
29
+ horizontal: (0, _types.createStaticBoolProp)({
30
+ label: "Horizontal",
31
+ description: "Render list horizontally"
32
+ }),
33
+ inverted: (0, _types.createStaticBoolProp)({
34
+ label: "Inverted",
35
+ description: "If true, reverses the direction."
36
+ }),
37
+ numColumns: (0, _types.createNumColumnsType)({
38
+ editable: true
39
+ })
40
+ }
41
+ };
42
+ exports.SEED_DATA = SEED_DATA;
@@ -1,5 +1,3 @@
1
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
-
3
1
  import * as React from "react";
4
2
  import { View } from "react-native";
5
3
  import { checkboxGroupContext, Direction } from "./context";
@@ -27,7 +25,23 @@ const CheckboxGroup = _ref => {
27
25
  });
28
26
  }
29
27
 
30
- return /*#__PURE__*/React.createElement(View, _extends({
28
+ return /*#__PURE__*/React.createElement(View, {
29
+ style: [{
30
+ minHeight: 40
31
+ }, style],
32
+ ...rest
33
+ }, /*#__PURE__*/React.createElement(Provider, {
34
+ value: {
35
+ values,
36
+ onValueChange,
37
+ direction
38
+ }
39
+ }, /*#__PURE__*/React.createElement(View, {
40
+ style: _containerStyle
41
+ }, children)));
42
+ };
43
+
44
+ export default CheckboxGroup;PURE__*/React.createElement(View, _extends({
31
45
  style: [{
32
46
  minHeight: 40
33
47
  }, style]
@@ -1,5 +1,5 @@
1
1
  import { createContext, useContext } from "react";
2
- export let Direction;
2
+ export var Direction;
3
3
 
4
4
  (function (Direction) {
5
5
  Direction["Horizontal"] = "horizontal";
@@ -1,5 +1,3 @@
1
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
-
3
1
  import * as React from "react";
4
2
  import Config from "../Config";
5
3
  import IconButton from "../IconButton";
@@ -34,6 +32,21 @@ const RadioButton = _ref => {
34
32
  onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(realValue);
35
33
  };
36
34
 
35
+ return /*#__PURE__*/React.createElement(IconButton, {
36
+ Icon: Icon,
37
+ icon: isSelected ? selectedIcon : unselectedIcon,
38
+ color: isSelected ? color : unselectedColor,
39
+ disabled: disabled,
40
+ onPress: handlePress,
41
+ size: size,
42
+ style: style,
43
+ ...rest
44
+ });
45
+ };
46
+
47
+ export default RadioButton; onValueChange(realValue);
48
+ };
49
+
37
50
  return /*#__PURE__*/React.createElement(IconButton, _extends({
38
51
  Icon: Icon,
39
52
  icon: isSelected ? selectedIcon : unselectedIcon,
@@ -50,5 +50,4 @@ export { default as RowHeadlineImageCaption } from "./components/RowHeadlineImag
50
50
  export { default as RowHeadlineImageIcon } from "./components/RowHeadlineImageIcon";
51
51
  export { default as Slider } from "./components/Slider";
52
52
  export { default as Stepper } from "./components/Stepper";
53
- export { useAuthState } from "./components/useAuthState";
54
- export { default as Markdown } from "./components/Markdown"; // a comment to fix sourcemap comment issue
53
+ export { useAuthState } from "./components/useAuthState"; // a comment to fix sourcemap comment issue
@@ -1,4 +1,4 @@
1
- import { COMPONENT_TYPES, createIconProp, createBoolProp, createTextProp, GROUPS, createActionProp, Triggers, StylesPanelSections } from "@draftbit/types";
1
+ import { COMPONENT_TYPES, createIconProp, createTextProp, createDisabledProp, createLoadingProp, createActionProp, Triggers, StylesPanelSections } from "@draftbit/types";
2
2
  const SEED_DATA_TRIGGERS = [Triggers.OnPress];
3
3
  const SEED_DATA_PROPS = {
4
4
  onPress: createActionProp(),
@@ -11,16 +11,8 @@ const SEED_DATA_PROPS = {
11
11
  description: "Button Label",
12
12
  defaultValue: "Get Started"
13
13
  }),
14
- disabled: createBoolProp({
15
- group: GROUPS.basic,
16
- label: "Disabled",
17
- description: "Whether the button should be disabled"
18
- }),
19
- loading: createBoolProp({
20
- group: GROUPS.basic,
21
- label: "Loading",
22
- description: "Whether to show a loading indicator"
23
- })
14
+ disabled: createDisabledProp(),
15
+ loading: createLoadingProp()
24
16
  };
25
17
  const LAYOUT = {
26
18
  backgroundColor: "transparent",
@@ -30,7 +22,7 @@ const LAYOUT = {
30
22
  export const SEED_DATA = [{
31
23
  name: "Button Outline",
32
24
  tag: "ButtonOutline",
33
- category: COMPONENT_TYPES.button,
25
+ category: COMPONENT_TYPES.deprecated,
34
26
  stylesPanelSections: [StylesPanelSections.Typography, StylesPanelSections.Background, StylesPanelSections.Borders, StylesPanelSections.Size, StylesPanelSections.MarginsAndPaddings, StylesPanelSections.Position, StylesPanelSections.Effects],
35
27
  layout: { ...LAYOUT,
36
28
  backgroundColor: "transparent",
@@ -40,7 +32,7 @@ export const SEED_DATA = [{
40
32
  triggers: SEED_DATA_TRIGGERS,
41
33
  props: SEED_DATA_PROPS
42
34
  }, {
43
- name: "Button Solid",
35
+ name: "Button",
44
36
  tag: "ButtonSolid",
45
37
  category: COMPONENT_TYPES.button,
46
38
  stylesPanelSections: [StylesPanelSections.Typography, StylesPanelSections.Background, StylesPanelSections.Borders, StylesPanelSections.Size, StylesPanelSections.MarginsAndPaddings, StylesPanelSections.Position, StylesPanelSections.Effects],
@@ -8,7 +8,6 @@ export const SEED_DATA = [{
8
8
  preview_image_url: "{CLOUDINARY_URL}/Field_SearchBar_Full.png",
9
9
  supports_list_render: false,
10
10
  triggers: [Triggers.OnChange],
11
- // TODO Triggers.OnSubmit for multiple triggers
12
11
  props: {
13
12
  icon: {
14
13
  group: GROUPS.basic,
@@ -45,4 +44,8 @@ export const SEED_DATA = [{
45
44
  }
46
45
  },
47
46
  layout: {}
47
+ }];alue: "searchBarValue"
48
+ }
49
+ },
50
+ layout: {}
48
51
  }];
@@ -0,0 +1,33 @@
1
+ import { COMPONENT_TYPES, createNumColumnsType, createStaticBoolProp, createNumberProp, CONTAINER_COMPONENT_STYLES_SECTIONS, GROUPS } from "@draftbit/types";
2
+ export const SEED_DATA = {
3
+ name: "FlashList",
4
+ tag: "FlashList",
5
+ description: "Flashlist by Shopify",
6
+ packageName: "@shopify/flash-list",
7
+ category: COMPONENT_TYPES.data,
8
+ stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
9
+ layout: {
10
+ flex: 1
11
+ },
12
+ props: {
13
+ estimatedItemSize: createNumberProp({
14
+ group: GROUPS.basic,
15
+ label: "Est. Item Size",
16
+ description: "Approximate size of the items before rendering.",
17
+ defaultValue: 50,
18
+ step: 1,
19
+ precision: 0
20
+ }),
21
+ horizontal: createStaticBoolProp({
22
+ label: "Horizontal",
23
+ description: "Render list horizontally"
24
+ }),
25
+ inverted: createStaticBoolProp({
26
+ label: "Inverted",
27
+ description: "If true, reverses the direction."
28
+ }),
29
+ numColumns: createNumColumnsType({
30
+ editable: true
31
+ })
32
+ }
33
+ };
@@ -49,4 +49,3 @@ export { default as RowHeadlineImageIcon } from "./components/RowHeadlineImageIc
49
49
  export { default as Slider } from "./components/Slider";
50
50
  export { default as Stepper } from "./components/Stepper";
51
51
  export { useAuthState } from "./components/useAuthState";
52
- export { default as Markdown } from "./components/Markdown";
@@ -36,22 +36,22 @@ export declare const SEED_DATA: ({
36
36
  disabled: {
37
37
  label: string;
38
38
  description: string;
39
- formType: string;
40
- propType: string;
41
- defaultValue: boolean;
39
+ group: string;
42
40
  editable: boolean;
43
41
  required: boolean;
44
- group: string;
42
+ formType: string;
43
+ propType: string;
44
+ defaultValue: null;
45
45
  };
46
46
  loading: {
47
47
  label: string;
48
48
  description: string;
49
- formType: string;
50
- propType: string;
51
- defaultValue: boolean;
49
+ group: string;
52
50
  editable: boolean;
53
51
  required: boolean;
54
- group: string;
52
+ formType: string;
53
+ propType: string;
54
+ defaultValue: null;
55
55
  };
56
56
  };
57
57
  } | {
@@ -91,22 +91,22 @@ export declare const SEED_DATA: ({
91
91
  disabled: {
92
92
  label: string;
93
93
  description: string;
94
- formType: string;
95
- propType: string;
96
- defaultValue: boolean;
94
+ group: string;
97
95
  editable: boolean;
98
96
  required: boolean;
99
- group: string;
97
+ formType: string;
98
+ propType: string;
99
+ defaultValue: null;
100
100
  };
101
101
  loading: {
102
102
  label: string;
103
103
  description: string;
104
- formType: string;
105
- propType: string;
106
- defaultValue: boolean;
104
+ group: string;
107
105
  editable: boolean;
108
106
  required: boolean;
109
- group: string;
107
+ formType: string;
108
+ propType: string;
109
+ defaultValue: null;
110
110
  };
111
111
  };
112
112
  })[];
@@ -0,0 +1,54 @@
1
+ export declare const SEED_DATA: {
2
+ name: string;
3
+ tag: string;
4
+ description: string;
5
+ packageName: string;
6
+ category: string;
7
+ stylesPanelSections: string[];
8
+ layout: {
9
+ flex: number;
10
+ };
11
+ props: {
12
+ estimatedItemSize: {
13
+ label: string;
14
+ description: string;
15
+ formType: string;
16
+ propType: string;
17
+ group: string;
18
+ defaultValue: null;
19
+ editable: boolean;
20
+ required: boolean;
21
+ step: number;
22
+ };
23
+ horizontal: {
24
+ label: string;
25
+ description: string;
26
+ formType: string;
27
+ propType: string;
28
+ defaultValue: boolean;
29
+ editable: boolean;
30
+ required: boolean;
31
+ group: string;
32
+ };
33
+ inverted: {
34
+ label: string;
35
+ description: string;
36
+ formType: string;
37
+ propType: string;
38
+ defaultValue: boolean;
39
+ editable: boolean;
40
+ required: boolean;
41
+ group: string;
42
+ };
43
+ numColumns: {
44
+ label: string;
45
+ description: string;
46
+ group: string;
47
+ formType: string;
48
+ propType: string;
49
+ defaultValue: number;
50
+ editable: boolean;
51
+ required: boolean;
52
+ };
53
+ };
54
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@draftbit/core",
3
- "version": "46.2.4-1cc3fe.10+1cc3fe90",
3
+ "version": "46.2.4-23a57c.12+23a57cbb",
4
4
  "description": "Core (non-native) Components",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",
@@ -41,19 +41,18 @@
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.3.0",
44
+ "@draftbit/types": "^46.2.4-23a57c.12+23a57cbb",
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",
48
48
  "@react-native-picker/picker": "2.4.2",
49
+ "@shopify/flash-list": "1.2.0",
49
50
  "color": "^3.1.2",
50
51
  "date-fns": "^2.16.1",
51
52
  "dateformat": "^3.0.3",
52
53
  "lodash.isnumber": "^3.0.3",
53
54
  "lodash.omit": "^4.5.0",
54
55
  "lodash.tonumber": "^4.0.3",
55
- "react-native-markdown-display": "^7.0.0-alpha.2",
56
- "react-native-markdown-package": "^1.8.2",
57
56
  "react-native-modal-datetime-picker": "^13.0.0",
58
57
  "react-native-svg": "12.3.0",
59
58
  "react-native-typography": "^1.4.1",
@@ -82,5 +81,5 @@
82
81
  ]
83
82
  ]
84
83
  },
85
- "gitHead": "1cc3fe901a296f97d52f51d54c27f4f07fcf09e3"
84
+ "gitHead": "23a57cbb8eb1858d289b9a20bca22dacea510662"
86
85
  }
package/src/index.js CHANGED
@@ -50,5 +50,4 @@ export { default as RowHeadlineImageIcon } from "./components/RowHeadlineImageIc
50
50
  export { default as Slider } from "./components/Slider";
51
51
  export { default as Stepper } from "./components/Stepper";
52
52
  export { useAuthState } from "./components/useAuthState";
53
- export { default as Markdown } from "./components/Markdown";
54
53
  // a comment to fix sourcemap comment issue
package/src/index.tsx CHANGED
@@ -70,6 +70,5 @@ export { default as RowHeadlineImageIcon } from "./components/RowHeadlineImageIc
70
70
  export { default as Slider } from "./components/Slider";
71
71
  export { default as Stepper } from "./components/Stepper";
72
72
  export { useAuthState } from "./components/useAuthState";
73
- export { default as Markdown } from "./components/Markdown";
74
73
 
75
74
  // a comment to fix sourcemap comment issue
@@ -1,4 +1,4 @@
1
- import { COMPONENT_TYPES, createIconProp, createBoolProp, createTextProp, GROUPS, createActionProp, Triggers, StylesPanelSections, } from "@draftbit/types";
1
+ import { COMPONENT_TYPES, createIconProp, createTextProp, createDisabledProp, createLoadingProp, createActionProp, Triggers, StylesPanelSections, } from "@draftbit/types";
2
2
  const SEED_DATA_TRIGGERS = [Triggers.OnPress];
3
3
  const SEED_DATA_PROPS = {
4
4
  onPress: createActionProp(),
@@ -11,16 +11,8 @@ const SEED_DATA_PROPS = {
11
11
  description: "Button Label",
12
12
  defaultValue: "Get Started",
13
13
  }),
14
- disabled: createBoolProp({
15
- group: GROUPS.basic,
16
- label: "Disabled",
17
- description: "Whether the button should be disabled",
18
- }),
19
- loading: createBoolProp({
20
- group: GROUPS.basic,
21
- label: "Loading",
22
- description: "Whether to show a loading indicator",
23
- }),
14
+ disabled: createDisabledProp(),
15
+ loading: createLoadingProp(),
24
16
  };
25
17
  const LAYOUT = {
26
18
  backgroundColor: "transparent",
@@ -31,7 +23,7 @@ export const SEED_DATA = [
31
23
  {
32
24
  name: "Button Outline",
33
25
  tag: "ButtonOutline",
34
- category: COMPONENT_TYPES.button,
26
+ category: COMPONENT_TYPES.deprecated,
35
27
  stylesPanelSections: [
36
28
  StylesPanelSections.Typography,
37
29
  StylesPanelSections.Background,
@@ -51,7 +43,7 @@ export const SEED_DATA = [
51
43
  props: SEED_DATA_PROPS,
52
44
  },
53
45
  {
54
- name: "Button Solid",
46
+ name: "Button",
55
47
  tag: "ButtonSolid",
56
48
  category: COMPONENT_TYPES.button,
57
49
  stylesPanelSections: [
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  COMPONENT_TYPES,
3
3
  createIconProp,
4
- createBoolProp,
5
4
  createTextProp,
6
- GROUPS,
5
+ createDisabledProp,
6
+ createLoadingProp,
7
7
  createActionProp,
8
8
  Triggers,
9
9
  StylesPanelSections,
@@ -21,16 +21,8 @@ const SEED_DATA_PROPS = {
21
21
  description: "Button Label",
22
22
  defaultValue: "Get Started",
23
23
  }),
24
- disabled: createBoolProp({
25
- group: GROUPS.basic,
26
- label: "Disabled",
27
- description: "Whether the button should be disabled",
28
- }),
29
- loading: createBoolProp({
30
- group: GROUPS.basic,
31
- label: "Loading",
32
- description: "Whether to show a loading indicator",
33
- }),
24
+ disabled: createDisabledProp(),
25
+ loading: createLoadingProp(),
34
26
  };
35
27
 
36
28
  const LAYOUT = {
@@ -43,7 +35,7 @@ export const SEED_DATA = [
43
35
  {
44
36
  name: "Button Outline",
45
37
  tag: "ButtonOutline",
46
- category: COMPONENT_TYPES.button,
38
+ category: COMPONENT_TYPES.deprecated,
47
39
  stylesPanelSections: [
48
40
  StylesPanelSections.Typography,
49
41
  StylesPanelSections.Background,
@@ -63,7 +55,7 @@ export const SEED_DATA = [
63
55
  props: SEED_DATA_PROPS,
64
56
  },
65
57
  {
66
- name: "Button Solid",
58
+ name: "Button",
67
59
  tag: "ButtonSolid",
68
60
  category: COMPONENT_TYPES.button,
69
61
  stylesPanelSections: [
@@ -0,0 +1,33 @@
1
+ import { COMPONENT_TYPES, createNumColumnsType, createStaticBoolProp, createNumberProp, CONTAINER_COMPONENT_STYLES_SECTIONS, GROUPS, } from "@draftbit/types";
2
+ export const SEED_DATA = {
3
+ name: "FlashList",
4
+ tag: "FlashList",
5
+ description: "Flashlist by Shopify",
6
+ packageName: "@shopify/flash-list",
7
+ category: COMPONENT_TYPES.data,
8
+ stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
9
+ layout: {
10
+ flex: 1,
11
+ },
12
+ props: {
13
+ estimatedItemSize: createNumberProp({
14
+ group: GROUPS.basic,
15
+ label: "Est. Item Size",
16
+ description: "Approximate size of the items before rendering.",
17
+ defaultValue: 50,
18
+ step: 1,
19
+ precision: 0,
20
+ }),
21
+ horizontal: createStaticBoolProp({
22
+ label: "Horizontal",
23
+ description: "Render list horizontally",
24
+ }),
25
+ inverted: createStaticBoolProp({
26
+ label: "Inverted",
27
+ description: "If true, reverses the direction.",
28
+ }),
29
+ numColumns: createNumColumnsType({
30
+ editable: true,
31
+ }),
32
+ },
33
+ };
@@ -0,0 +1,41 @@
1
+ import {
2
+ COMPONENT_TYPES,
3
+ createNumColumnsType,
4
+ createStaticBoolProp,
5
+ createNumberProp,
6
+ CONTAINER_COMPONENT_STYLES_SECTIONS,
7
+ GROUPS,
8
+ } from "@draftbit/types";
9
+
10
+ export const SEED_DATA = {
11
+ name: "FlashList",
12
+ tag: "FlashList",
13
+ description: "Flashlist by Shopify",
14
+ packageName: "@shopify/flash-list",
15
+ category: COMPONENT_TYPES.data,
16
+ stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
17
+ layout: {
18
+ flex: 1,
19
+ },
20
+ props: {
21
+ estimatedItemSize: createNumberProp({
22
+ group: GROUPS.basic,
23
+ label: "Est. Item Size",
24
+ description: "Approximate size of the items before rendering.",
25
+ defaultValue: 50,
26
+ step: 1,
27
+ precision: 0,
28
+ }),
29
+ horizontal: createStaticBoolProp({
30
+ label: "Horizontal",
31
+ description: "Render list horizontally",
32
+ }),
33
+ inverted: createStaticBoolProp({
34
+ label: "Inverted",
35
+ description: "If true, reverses the direction.",
36
+ }),
37
+ numColumns: createNumColumnsType({
38
+ editable: true,
39
+ }),
40
+ },
41
+ };
@@ -1,33 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var React = _interopRequireWildcard(require("react"));
9
-
10
- var _reactNativeMarkdownPackage = _interopRequireDefault(require("react-native-markdown-package"));
11
-
12
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
-
14
- 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); }
15
-
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
-
18
- // @ts-ignore
19
- const MarkdownComponent = _ref => {
20
- let {
21
- content
22
- } = _ref;
23
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_reactNativeMarkdownPackage.default, {
24
- styles: markdownStyle
25
- }, content));
26
- };
27
-
28
- const markdownStyle = {
29
- singleLineMd: {},
30
- collectiveMd: {}
31
- };
32
- var _default = MarkdownComponent;
33
- exports.default = _default;
@@ -1,23 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.SEED_DATA = void 0;
7
-
8
- var _types = require("@draftbit/types");
9
-
10
- const SEED_DATA = {
11
- name: "Markdown",
12
- tag: "MarkdownComponent",
13
- description: "A markdown component",
14
- category: _types.COMPONENT_TYPES.basic,
15
- props: {
16
- content: (0, _types.createTextProp)({
17
- label: "Markdown Text",
18
- description: "Markdown Text",
19
- defaultValue: null
20
- })
21
- }
22
- };
23
- exports.SEED_DATA = SEED_DATA;
@@ -1,18 +0,0 @@
1
- import * as React from "react"; // @ts-ignore
2
-
3
- import Markdown from "react-native-markdown-package";
4
-
5
- const MarkdownComponent = _ref => {
6
- let {
7
- content
8
- } = _ref;
9
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Markdown, {
10
- styles: markdownStyle
11
- }, content));
12
- };
13
-
14
- const markdownStyle = {
15
- singleLineMd: {},
16
- collectiveMd: {}
17
- };
18
- export default MarkdownComponent;
@@ -1,14 +0,0 @@
1
- import { COMPONENT_TYPES, createTextProp } from "@draftbit/types";
2
- export const SEED_DATA = {
3
- name: "Markdown",
4
- tag: "MarkdownComponent",
5
- description: "A markdown component",
6
- category: COMPONENT_TYPES.basic,
7
- props: {
8
- content: createTextProp({
9
- label: "Markdown Text",
10
- description: "Markdown Text",
11
- defaultValue: null
12
- })
13
- }
14
- };
@@ -1,6 +0,0 @@
1
- import * as React from "react";
2
- declare type Props = {
3
- content?: string;
4
- };
5
- declare const MarkdownComponent: React.FC<Props>;
6
- export default MarkdownComponent;
@@ -1,9 +0,0 @@
1
- export declare const SEED_DATA: {
2
- name: string;
3
- tag: string;
4
- description: string;
5
- category: string;
6
- props: {
7
- content: any;
8
- };
9
- };
@@ -1,12 +0,0 @@
1
- import * as React from "react";
2
- // @ts-ignore
3
- import Markdown from "react-native-markdown-package";
4
- const MarkdownComponent = ({ content }) => {
5
- return (React.createElement(React.Fragment, null,
6
- React.createElement(Markdown, { styles: markdownStyle }, content)));
7
- };
8
- const markdownStyle = {
9
- singleLineMd: {},
10
- collectiveMd: {},
11
- };
12
- export default MarkdownComponent;
@@ -1,25 +0,0 @@
1
- import * as React from "react";
2
- // @ts-ignore
3
- import Markdown from "react-native-markdown-package";
4
-
5
- type Props = {
6
- content?: string;
7
- };
8
-
9
- const MarkdownComponent: React.FC<Props> = ({ content }) => {
10
- return (
11
- <>
12
- {
13
- // @ts-ignore
14
- }
15
- <Markdown styles={markdownStyle}>{content}</Markdown>
16
- </>
17
- );
18
- };
19
-
20
- const markdownStyle = {
21
- singleLineMd: {},
22
- collectiveMd: {},
23
- };
24
-
25
- export default MarkdownComponent;
@@ -1,14 +0,0 @@
1
- import { COMPONENT_TYPES, createTextProp } from "@draftbit/types";
2
- export const SEED_DATA = {
3
- name: "Markdown",
4
- tag: "MarkdownComponent",
5
- description: "A markdown component",
6
- category: COMPONENT_TYPES.basic,
7
- props: {
8
- content: createTextProp({
9
- label: "Markdown Text",
10
- description: "Markdown Text",
11
- defaultValue: null,
12
- }),
13
- },
14
- };
@@ -1,15 +0,0 @@
1
- import { COMPONENT_TYPES, createTextProp } from "@draftbit/types";
2
-
3
- export const SEED_DATA = {
4
- name: "Markdown",
5
- tag: "MarkdownComponent",
6
- description: "A markdown component",
7
- category: COMPONENT_TYPES.basic,
8
- props: {
9
- content: createTextProp({
10
- label: "Markdown Text",
11
- description: "Markdown Text",
12
- defaultValue: null,
13
- }),
14
- },
15
- };