@draftbit/core 46.8.2-088bf8.2 → 46.8.2-feb14e.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.
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.radioButtonGroupContext = exports.Direction = void 0;
7
7
  exports.useRadioButtonGroupContext = useRadioButtonGroupContext;
8
8
  var _react = require("react");
9
- var Direction;
9
+ let Direction;
10
10
  exports.Direction = Direction;
11
11
  (function (Direction) {
12
12
  Direction["Horizontal"] = "horizontal";
@@ -11,6 +11,7 @@ var _IconButton = _interopRequireDefault(require("./IconButton"));
11
11
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
12
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
13
13
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
14
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
14
15
  const ToggleButton = _ref => {
15
16
  let {
16
17
  Icon,
@@ -46,7 +47,7 @@ const ToggleButton = _ref => {
46
47
  setInternalValue(!internalValue);
47
48
  onPress(!internalValue);
48
49
  };
49
- return /*#__PURE__*/React.createElement(_IconButton.default, {
50
+ return /*#__PURE__*/React.createElement(_IconButton.default, _extends({
50
51
  Icon: Icon,
51
52
  icon: icon,
52
53
  size: iconSize,
@@ -58,20 +59,6 @@ const ToggleButton = _ref => {
58
59
  height,
59
60
  backgroundColor: internalValue ? colors[colorSecondary] : colors[color],
60
61
  borderColor: colors[borderColor]
61
- }, style],
62
- ...rest
63
- });
64
- };
65
- const styles = _reactNative.StyleSheet.create({
66
- mainContainer: {
67
- borderWidth: 1
68
- }
69
- });
70
- var _default = (0, _theming.withTheme)(ToggleButton);
71
- exports.default = _default;idth,
72
- height,
73
- backgroundColor: internalValue ? colors[colorSecondary] : colors[color],
74
- borderColor: colors[borderColor]
75
62
  }, style]
76
63
  }, rest));
77
64
  };
@@ -10,11 +10,12 @@ function usePrevious(value) {
10
10
  // The ref object is a generic container whose current property is mutable
11
11
  // and can hold any value, similar to an instance property on a class
12
12
  const ref = _react.default.useRef();
13
+
13
14
  // Store current value in ref
14
15
  _react.default.useEffect(() => {
15
16
  ref.current = value;
16
17
  }, [value]);
18
+
17
19
  // Return previous value (happens before update in useEffect above)
18
20
  return ref.current;
19
- }
20
21
  }
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.SEED_DATA = void 0;
7
7
  var _types = require("@draftbit/types");
8
- const SEED_DATA_TRIGGERS = [_types.Triggers.OnValueChange];
9
8
  const ELEMENT_SEED_DATA = {
10
9
  doc_link: "https://www.npmjs.com/package/@expo/html-elements",
11
10
  code_link: "https://github.com/expo/expo/tree/master/packages/html-elements",
@@ -14,7 +13,6 @@ const ELEMENT_SEED_DATA = {
14
13
  layout: {
15
14
  margin: 0
16
15
  },
17
- triggers: SEED_DATA_TRIGGERS,
18
16
  category: _types.COMPONENT_TYPES.webelement
19
17
  };
20
18
  const HEADING_SEED_DATA = {
@@ -1,3 +1,4 @@
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
1
2
  import * as React from "react";
2
3
  import { View, StyleSheet } from "react-native";
3
4
  import omit from "lodash.omit";
@@ -7,6 +8,7 @@ import { extractStyles } from "../../utilities";
7
8
  import TextField from "../TextField";
8
9
  import Touchable from "../Touchable";
9
10
  const Picker = _ref => {
11
+ var _options$find$label, _options$find;
10
12
  let {
11
13
  style,
12
14
  options,
@@ -16,7 +18,6 @@ const Picker = _ref => {
16
18
  onValueChange: onValueChangeOverride = () => {},
17
19
  ...props
18
20
  } = _ref;
19
- var _a, _b;
20
21
  const {
21
22
  viewStyles: {
22
23
  borderRadius,
@@ -61,7 +62,7 @@ const Picker = _ref => {
61
62
  };
62
63
 
63
64
  const stylesWithoutMargin = style && omit(StyleSheet.flatten(style), ["margin", "marginTop", "marginRight", "marginBottom", "marginLeft"]);
64
- const selectedLabel = selectedValue && ((_b = (_a = options.find(o => o.value === selectedValue)) === null || _a === void 0 ? void 0 : _a.label) !== null && _b !== void 0 ? _b : selectedValue);
65
+ const selectedLabel = selectedValue && ((_options$find$label = (_options$find = options.find(o => o.value === selectedValue)) === null || _options$find === void 0 ? void 0 : _options$find.label) !== null && _options$find$label !== void 0 ? _options$find$label : selectedValue);
65
66
  return /*#__PURE__*/React.createElement(Touchable, {
66
67
  disabled: disabled,
67
68
  onPress: toggleFocus,
@@ -85,16 +86,18 @@ const Picker = _ref => {
85
86
  key: o.value
86
87
  }))), /*#__PURE__*/React.createElement(View, {
87
88
  pointerEvents: "none"
88
- }, /*#__PURE__*/React.createElement(TextField, {
89
- ...props,
89
+ }, /*#__PURE__*/React.createElement(TextField, _extends({}, props, {
90
90
  value: selectedLabel,
91
- placeholder: placeholder,
91
+ placeholder: placeholder
92
92
  // @ts-ignore
93
- ref: textField,
94
- disabled: disabled,
93
+ ,
94
+ ref: textField // cannot determine if ref is of correct type due to component being wrapped in a withTheme()
95
+ ,
96
+ disabled: disabled
95
97
  // @ts-expect-error
98
+ ,
96
99
  style: stylesWithoutMargin
97
- }))));
100
+ })))));
98
101
  };
99
102
  const styles = StyleSheet.create({
100
103
  container: {
@@ -1,5 +1,4 @@
1
- import { COMPONENT_TYPES, createTextProp, FORM_TYPES, PROP_TYPES, GROUPS, StylesPanelSections, Triggers } from "@draftbit/types";
2
- const SEED_DATA_TRIGGERS = [Triggers.OnValueChange];
1
+ import { COMPONENT_TYPES, createTextProp, FORM_TYPES, PROP_TYPES, GROUPS, StylesPanelSections } from "@draftbit/types";
3
2
  const ELEMENT_SEED_DATA = {
4
3
  doc_link: "https://www.npmjs.com/package/@expo/html-elements",
5
4
  code_link: "https://github.com/expo/expo/tree/master/packages/html-elements",
@@ -8,7 +7,6 @@ const ELEMENT_SEED_DATA = {
8
7
  layout: {
9
8
  margin: 0
10
9
  },
11
- triggers: SEED_DATA_TRIGGERS,
12
10
  category: COMPONENT_TYPES.webelement
13
11
  };
14
12
  const HEADING_SEED_DATA = {
@@ -18,7 +18,6 @@ export declare const SEED_DATA: ({
18
18
  layout: {
19
19
  margin: number;
20
20
  };
21
- triggers: string[];
22
21
  name: string;
23
22
  tag: string;
24
23
  } | {
@@ -34,7 +33,6 @@ export declare const SEED_DATA: ({
34
33
  layout: {
35
34
  margin: number;
36
35
  };
37
- triggers: string[];
38
36
  name: string;
39
37
  tag: string;
40
38
  } | {
@@ -58,7 +56,6 @@ export declare const SEED_DATA: ({
58
56
  layout: {
59
57
  margin: number;
60
58
  };
61
- triggers: string[];
62
59
  name: string;
63
60
  tag: string;
64
61
  } | {
@@ -69,7 +66,6 @@ export declare const SEED_DATA: ({
69
66
  layout: {
70
67
  margin: number;
71
68
  };
72
- triggers: string[];
73
69
  category: string;
74
70
  name: string;
75
71
  tag: string;
@@ -1 +1 @@
1
- {"version":3,"file":"HtmlElements.d.ts","sourceRoot":"","sources":["../../../../src/mappings/HtmlElements.ts"],"names":[],"mappings":"AAsFA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAwHrB,CAAC"}
1
+ {"version":3,"file":"HtmlElements.d.ts","sourceRoot":"","sources":["../../../../src/mappings/HtmlElements.ts"],"names":[],"mappings":"AAmFA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAwHrB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@draftbit/core",
3
- "version": "46.8.2-088bf8.2+088bf87",
3
+ "version": "46.8.2-feb14e.2+feb14e8",
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-088bf8.2+088bf87",
44
+ "@draftbit/types": "^46.8.2-feb14e.2+feb14e8",
45
45
  "@expo/html-elements": "^0.3.1",
46
46
  "@material-ui/core": "^4.11.0",
47
47
  "@material-ui/pickers": "^3.2.10",
@@ -93,5 +93,5 @@
93
93
  ]
94
94
  ]
95
95
  },
96
- "gitHead": "088bf87109989ec13afa5a6b64d29314afdc8caa"
96
+ "gitHead": "feb14e87ddf0b82ca481143102a4c2d37989dbc9"
97
97
  }
@@ -1,5 +1,4 @@
1
- import { COMPONENT_TYPES, createTextProp, FORM_TYPES, PROP_TYPES, GROUPS, StylesPanelSections, Triggers, } from "@draftbit/types";
2
- const SEED_DATA_TRIGGERS = [Triggers.OnValueChange];
1
+ import { COMPONENT_TYPES, createTextProp, FORM_TYPES, PROP_TYPES, GROUPS, StylesPanelSections, } from "@draftbit/types";
3
2
  const ELEMENT_SEED_DATA = {
4
3
  doc_link: "https://www.npmjs.com/package/@expo/html-elements",
5
4
  code_link: "https://github.com/expo/expo/tree/master/packages/html-elements",
@@ -13,7 +12,6 @@ const ELEMENT_SEED_DATA = {
13
12
  layout: {
14
13
  margin: 0,
15
14
  },
16
- triggers: SEED_DATA_TRIGGERS,
17
15
  category: COMPONENT_TYPES.webelement,
18
16
  };
19
17
  const HEADING_SEED_DATA = {
@@ -5,9 +5,7 @@ import {
5
5
  PROP_TYPES,
6
6
  GROUPS,
7
7
  StylesPanelSections,
8
- Triggers,
9
8
  } from "@draftbit/types";
10
- const SEED_DATA_TRIGGERS = [Triggers.OnValueChange];
11
9
 
12
10
  const ELEMENT_SEED_DATA = {
13
11
  doc_link: "https://www.npmjs.com/package/@expo/html-elements",
@@ -22,7 +20,6 @@ const ELEMENT_SEED_DATA = {
22
20
  layout: {
23
21
  margin: 0,
24
22
  },
25
- triggers: SEED_DATA_TRIGGERS,
26
23
  category: COMPONENT_TYPES.webelement,
27
24
  };
28
25