@draftbit/core 47.1.1-a3c366.2 → 47.1.1-ace71d.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 (44) hide show
  1. package/lib/commonjs/components/Button.js +2 -2
  2. package/lib/commonjs/components/IconButton.js +4 -2
  3. package/lib/commonjs/components/Pressable.js +2 -2
  4. package/lib/commonjs/components/Touchable.js +2 -2
  5. package/lib/commonjs/mappings/Button.js +2 -2
  6. package/lib/commonjs/mappings/IconButton.js +4 -6
  7. package/lib/commonjs/mappings/MapView.js +3 -1
  8. package/lib/commonjs/mappings/Touchable.js +9 -2
  9. package/lib/module/components/Button.js +2 -2
  10. package/lib/module/components/IconButton.js +4 -2
  11. package/lib/module/components/Portal/PortalConsumer.js +7 -22
  12. package/lib/module/components/Pressable.js +4 -17
  13. package/lib/module/components/Touchable.js +2 -2
  14. package/lib/module/mappings/Button.js +2 -2
  15. package/lib/module/mappings/IconButton.js +5 -7
  16. package/lib/module/mappings/MapView.js +3 -1
  17. package/lib/module/mappings/Touchable.js +10 -3
  18. package/lib/typescript/src/components/IconButton.d.ts +2 -0
  19. package/lib/typescript/src/components/IconButton.d.ts.map +1 -1
  20. package/lib/typescript/src/components/Pressable.d.ts.map +1 -1
  21. package/lib/typescript/src/components/Touchable.d.ts.map +1 -1
  22. package/lib/typescript/src/mappings/IconButton.d.ts +20 -10
  23. package/lib/typescript/src/mappings/IconButton.d.ts.map +1 -1
  24. package/lib/typescript/src/mappings/MapView.d.ts +2 -0
  25. package/lib/typescript/src/mappings/MapView.d.ts.map +1 -1
  26. package/lib/typescript/src/mappings/Touchable.d.ts +20 -0
  27. package/lib/typescript/src/mappings/Touchable.d.ts.map +1 -1
  28. package/package.json +3 -3
  29. package/src/components/Button.js +1 -1
  30. package/src/components/Button.tsx +2 -2
  31. package/src/components/IconButton.js +2 -2
  32. package/src/components/IconButton.tsx +6 -2
  33. package/src/components/Pressable.js +1 -1
  34. package/src/components/Pressable.tsx +2 -2
  35. package/src/components/Touchable.js +1 -1
  36. package/src/components/Touchable.tsx +2 -2
  37. package/src/mappings/Button.js +2 -2
  38. package/src/mappings/Button.ts +2 -2
  39. package/src/mappings/IconButton.js +5 -7
  40. package/src/mappings/IconButton.ts +5 -7
  41. package/src/mappings/MapView.js +2 -0
  42. package/src/mappings/MapView.ts +2 -0
  43. package/src/mappings/Touchable.js +10 -3
  44. package/src/mappings/Touchable.ts +12 -2
@@ -24,8 +24,8 @@ function Base(_ref) {
24
24
  loading,
25
25
  disabled,
26
26
  style,
27
- activeOpacity,
28
- disabledOpacity,
27
+ activeOpacity = 0.8,
28
+ disabledOpacity = 0.8,
29
29
  ...props
30
30
  } = _ref;
31
31
  const {
@@ -16,11 +16,13 @@ const IconButton = _ref => {
16
16
  icon,
17
17
  color: customColor,
18
18
  size = 32,
19
- disabled = false,
19
+ disabled,
20
20
  loading = false,
21
21
  onPress,
22
22
  theme,
23
23
  style,
24
+ activeOpacity = 0.8,
25
+ disabledOpacity = 0.8,
24
26
  ...props
25
27
  } = _ref;
26
28
  const iconColor = customColor || theme.colors.primary;
@@ -32,7 +34,7 @@ const IconButton = _ref => {
32
34
  pressed
33
35
  } = _ref2;
34
36
  return [styles.container, {
35
- opacity: pressed || disabled ? 0.75 : 1,
37
+ opacity: pressed ? activeOpacity : disabled ? disabledOpacity : 1,
36
38
  width: size,
37
39
  height: size,
38
40
  alignItems: "center",
@@ -13,8 +13,8 @@ function Pressable(_ref) {
13
13
  children,
14
14
  disabled,
15
15
  onPress,
16
- activeOpacity,
17
- disabledOpacity,
16
+ activeOpacity = 0.8,
17
+ disabledOpacity = 0.8,
18
18
  delayLongPress,
19
19
  hitSlop,
20
20
  style,
@@ -13,8 +13,8 @@ function Touchable(_ref) {
13
13
  children,
14
14
  disabled,
15
15
  onPress,
16
- activeOpacity,
17
- disabledOpacity,
16
+ activeOpacity = 0.8,
17
+ disabledOpacity = 0.8,
18
18
  delayLongPress,
19
19
  hitSlop,
20
20
  style,
@@ -23,7 +23,7 @@ const SEED_DATA_PROPS = {
23
23
  activeOpacity: (0, _types.createStaticNumberProp)({
24
24
  label: "Active Opacity",
25
25
  description: "Opacity of the button when active.",
26
- defaultValue: 0.8,
26
+ defaultValue: null,
27
27
  min: 0,
28
28
  max: 1,
29
29
  step: 0.01,
@@ -33,7 +33,7 @@ const SEED_DATA_PROPS = {
33
33
  disabledOpacity: (0, _types.createStaticNumberProp)({
34
34
  label: "Disabled Opacity",
35
35
  description: "Opacity of the button when disabled.",
36
- defaultValue: 0.8,
36
+ defaultValue: null,
37
37
  min: 0,
38
38
  max: 1,
39
39
  step: 0.01,
@@ -10,26 +10,24 @@ const SEED_DATA = {
10
10
  tag: "IconButton",
11
11
  category: _types.COMPONENT_TYPES.button,
12
12
  layout: {},
13
- triggers: [_types.Triggers.OnPress],
13
+ triggers: [_types.Triggers.OnPress, _types.Triggers.OnLongPress],
14
14
  stylesPanelSections: [_types.StylesPanelSections.Margins, _types.StylesPanelSections.Effects, _types.StylesPanelSections.Position],
15
15
  props: {
16
16
  onPress: (0, _types.createActionProp)(),
17
+ onLongPress: (0, _types.createActionProp)(),
18
+ disabled: (0, _types.createDisabledProp)(),
17
19
  icon: (0, _types.createIconProp)(),
18
20
  color: (0, _types.createColorProp)({
19
21
  label: "Color",
20
22
  group: _types.GROUPS.basic
21
23
  }),
22
- disabled: (0, _types.createBoolProp)({
23
- label: "Disabled",
24
- group: _types.GROUPS.basic
25
- }),
26
24
  size: (0, _types.createNumberProp)({
27
25
  group: _types.GROUPS.basic,
28
26
  label: "Size",
29
27
  description: "Width and height of your icon",
30
28
  defaultValue: 32,
31
29
  min: 16,
32
- max: 128,
30
+ max: 256,
33
31
  step: 1,
34
32
  precision: 0
35
33
  })
@@ -12,7 +12,9 @@ const SEED_DATA = {
12
12
  description: "A map view",
13
13
  category: _types.COMPONENT_TYPES.map,
14
14
  layout: {
15
- flex: 1
15
+ flex: 1,
16
+ width: "100%",
17
+ height: "100%"
16
18
  },
17
19
  props: {
18
20
  provider: {
@@ -12,10 +12,11 @@ const SEED_DATA_PROPS = {
12
12
  props: {
13
13
  onPress: (0, _types.createActionProp)(),
14
14
  onLongPress: (0, _types.createActionProp)(),
15
+ disabled: (0, _types.createDisabledProp)(),
15
16
  activeOpacity: (0, _types.createStaticNumberProp)({
16
17
  label: "Active Opacity",
17
18
  description: "The opacity when the button is pressed.",
18
- defaultValue: 0.8,
19
+ defaultValue: null,
19
20
  min: 0,
20
21
  max: 1,
21
22
  step: 0.01,
@@ -25,7 +26,7 @@ const SEED_DATA_PROPS = {
25
26
  disabledOpacity: (0, _types.createStaticNumberProp)({
26
27
  label: "Disabled Opacity",
27
28
  description: "The opacity when the button is disabled.",
28
- defaultValue: 0.8,
29
+ defaultValue: null,
29
30
  min: 0,
30
31
  max: 1,
31
32
  step: 0.01,
@@ -41,6 +42,12 @@ const SEED_DATA_PROPS = {
41
42
  label: "Hit Slop",
42
43
  description: "Sets additional distance outside of element in which a press can be detected.",
43
44
  required: false
45
+ }),
46
+ android_disableSound: (0, _types.createStaticBoolProp)({
47
+ label: "Disable Sound",
48
+ description: "Disable the Android sound effect.",
49
+ defaultValue: null,
50
+ group: _types.GROUPS.android
44
51
  })
45
52
  }
46
53
  };
@@ -16,8 +16,8 @@ function Base(_ref) {
16
16
  loading,
17
17
  disabled,
18
18
  style,
19
- activeOpacity,
20
- disabledOpacity,
19
+ activeOpacity = 0.8,
20
+ disabledOpacity = 0.8,
21
21
  ...props
22
22
  } = _ref;
23
23
  const {
@@ -8,11 +8,13 @@ const IconButton = _ref => {
8
8
  icon,
9
9
  color: customColor,
10
10
  size = 32,
11
- disabled = false,
11
+ disabled,
12
12
  loading = false,
13
13
  onPress,
14
14
  theme,
15
15
  style,
16
+ activeOpacity = 0.8,
17
+ disabledOpacity = 0.8,
16
18
  ...props
17
19
  } = _ref;
18
20
  const iconColor = customColor || theme.colors.primary;
@@ -24,7 +26,7 @@ const IconButton = _ref => {
24
26
  pressed
25
27
  } = _ref2;
26
28
  return [styles.container, {
27
- opacity: pressed || disabled ? 0.75 : 1,
29
+ opacity: pressed ? activeOpacity : disabled ? disabledOpacity : 1,
28
30
  width: size,
29
31
  height: size,
30
32
  alignItems: "center",
@@ -1,28 +1,13 @@
1
+ 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; }
2
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
3
+ 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
4
  import * as React from "react";
2
5
  export default class PortalConsumer extends React.Component {
3
- async componentDidMount() {
4
- this.checkManager();
5
- // Delay updating to prevent React from going to infinite loop
6
- await Promise.resolve();
7
- this.key = this.props.manager.mount(this.props.children);
8
- }
9
- componentDidUpdate() {
10
- this.checkManager();
11
- this.props.manager.update(this.key, this.props.children);
12
- }
13
- componentWillUnmount() {
14
- this.checkManager();
15
- this.props.manager.unmount(this.key);
6
+ constructor() {
7
+ super(...arguments);
8
+ _defineProperty(this, "key", void 0);
16
9
  }
17
- checkManager() {
18
- if (!this.props.manager) {
19
- throw new Error("Looks like you forgot to wrap your root component with `Provider` component from `react-native-paper`.\n\n" + "Please read our getting-started guide and make sure you've followed all the required steps.\n\n" + "https://callstack.github.io/react-native-paper/getting-started.html");
20
- }
21
- }
22
- render() {
23
- return null;
24
- }
25
- }sync componentDidMount() {
10
+ async componentDidMount() {
26
11
  this.checkManager();
27
12
 
28
13
  // Delay updating to prevent React from going to infinite loop
@@ -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 React from "react";
2
3
  import { Pressable as NativePressable } from "react-native";
3
4
  export default function Pressable(_ref) {
@@ -5,29 +6,15 @@ export default function Pressable(_ref) {
5
6
  children,
6
7
  disabled,
7
8
  onPress,
8
- activeOpacity,
9
- disabledOpacity,
9
+ activeOpacity = 0.8,
10
+ disabledOpacity = 0.8,
10
11
  delayLongPress,
11
12
  hitSlop,
12
13
  style,
13
14
  ...props
14
15
  } = _ref;
15
- return /*#__PURE__*/React.createElement(NativePressable, {
16
+ return /*#__PURE__*/React.createElement(NativePressable, _extends({
16
17
  onPress: onPress,
17
- disabled: disabled,
18
- delayLongPress: delayLongPress ? delayLongPress : 500,
19
- hitSlop: hitSlop ? hitSlop : 8,
20
- style: _ref2 => {
21
- let {
22
- pressed
23
- } = _ref2;
24
- return [{
25
- opacity: pressed ? activeOpacity : disabled ? disabledOpacity : 1
26
- }, style];
27
- },
28
- ...props
29
- }, children);
30
- } onPress: onPress,
31
18
  disabled: disabled,
32
19
  delayLongPress: delayLongPress ? delayLongPress : 500,
33
20
  hitSlop: hitSlop ? hitSlop : 8,
@@ -6,8 +6,8 @@ export default function Touchable(_ref) {
6
6
  children,
7
7
  disabled,
8
8
  onPress,
9
- activeOpacity,
10
- disabledOpacity,
9
+ activeOpacity = 0.8,
10
+ disabledOpacity = 0.8,
11
11
  delayLongPress,
12
12
  hitSlop,
13
13
  style,
@@ -17,7 +17,7 @@ const SEED_DATA_PROPS = {
17
17
  activeOpacity: createStaticNumberProp({
18
18
  label: "Active Opacity",
19
19
  description: "Opacity of the button when active.",
20
- defaultValue: 0.8,
20
+ defaultValue: null,
21
21
  min: 0,
22
22
  max: 1,
23
23
  step: 0.01,
@@ -27,7 +27,7 @@ const SEED_DATA_PROPS = {
27
27
  disabledOpacity: createStaticNumberProp({
28
28
  label: "Disabled Opacity",
29
29
  description: "Opacity of the button when disabled.",
30
- defaultValue: 0.8,
30
+ defaultValue: null,
31
31
  min: 0,
32
32
  max: 1,
33
33
  step: 0.01,
@@ -1,29 +1,27 @@
1
- import { COMPONENT_TYPES, GROUPS, createIconProp, createColorProp, createNumberProp, createBoolProp, createActionProp, Triggers, StylesPanelSections } from "@draftbit/types";
1
+ import { COMPONENT_TYPES, GROUPS, createIconProp, createColorProp, createNumberProp, createActionProp, Triggers, StylesPanelSections, createDisabledProp } from "@draftbit/types";
2
2
  export const SEED_DATA = {
3
3
  name: "Icon Button",
4
4
  tag: "IconButton",
5
5
  category: COMPONENT_TYPES.button,
6
6
  layout: {},
7
- triggers: [Triggers.OnPress],
7
+ triggers: [Triggers.OnPress, Triggers.OnLongPress],
8
8
  stylesPanelSections: [StylesPanelSections.Margins, StylesPanelSections.Effects, StylesPanelSections.Position],
9
9
  props: {
10
10
  onPress: createActionProp(),
11
+ onLongPress: createActionProp(),
12
+ disabled: createDisabledProp(),
11
13
  icon: createIconProp(),
12
14
  color: createColorProp({
13
15
  label: "Color",
14
16
  group: GROUPS.basic
15
17
  }),
16
- disabled: createBoolProp({
17
- label: "Disabled",
18
- group: GROUPS.basic
19
- }),
20
18
  size: createNumberProp({
21
19
  group: GROUPS.basic,
22
20
  label: "Size",
23
21
  description: "Width and height of your icon",
24
22
  defaultValue: 32,
25
23
  min: 16,
26
- max: 128,
24
+ max: 256,
27
25
  step: 1,
28
26
  precision: 0
29
27
  })
@@ -6,7 +6,9 @@ export const SEED_DATA = {
6
6
  description: "A map view",
7
7
  category: COMPONENT_TYPES.map,
8
8
  layout: {
9
- flex: 1
9
+ flex: 1,
10
+ width: "100%",
11
+ height: "100%"
10
12
  },
11
13
  props: {
12
14
  provider: {
@@ -1,4 +1,4 @@
1
- import { COMPONENT_TYPES, createActionProp, Triggers, createStaticNumberProp, StylesPanelSections } from "@draftbit/types";
1
+ import { COMPONENT_TYPES, createActionProp, Triggers, createStaticNumberProp, StylesPanelSections, createDisabledProp, GROUPS, createStaticBoolProp } from "@draftbit/types";
2
2
  const SEED_DATA_PROPS = {
3
3
  stylesPanelSections: [StylesPanelSections.Size, StylesPanelSections.Margins, StylesPanelSections.Borders],
4
4
  layout: {},
@@ -6,10 +6,11 @@ const SEED_DATA_PROPS = {
6
6
  props: {
7
7
  onPress: createActionProp(),
8
8
  onLongPress: createActionProp(),
9
+ disabled: createDisabledProp(),
9
10
  activeOpacity: createStaticNumberProp({
10
11
  label: "Active Opacity",
11
12
  description: "The opacity when the button is pressed.",
12
- defaultValue: 0.8,
13
+ defaultValue: null,
13
14
  min: 0,
14
15
  max: 1,
15
16
  step: 0.01,
@@ -19,7 +20,7 @@ const SEED_DATA_PROPS = {
19
20
  disabledOpacity: createStaticNumberProp({
20
21
  label: "Disabled Opacity",
21
22
  description: "The opacity when the button is disabled.",
22
- defaultValue: 0.8,
23
+ defaultValue: null,
23
24
  min: 0,
24
25
  max: 1,
25
26
  step: 0.01,
@@ -35,6 +36,12 @@ const SEED_DATA_PROPS = {
35
36
  label: "Hit Slop",
36
37
  description: "Sets additional distance outside of element in which a press can be detected.",
37
38
  required: false
39
+ }),
40
+ android_disableSound: createStaticBoolProp({
41
+ label: "Disable Sound",
42
+ description: "Disable the Android sound effect.",
43
+ defaultValue: null,
44
+ group: GROUPS.android
38
45
  })
39
46
  }
40
47
  };
@@ -11,6 +11,8 @@ declare type Props = {
11
11
  onPress: () => void;
12
12
  theme: Theme;
13
13
  style?: StyleProp<ViewStyle>;
14
+ activeOpacity?: number;
15
+ disabledOpacity?: number;
14
16
  } & PressableProps & IconSlot;
15
17
  declare const _default: React.ComponentType<import("@draftbit/react-theme-provider").$Without<React.PropsWithChildren<Props>, "theme"> & {
16
18
  theme?: import("@draftbit/react-theme-provider").$DeepPartial<any> | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../../../../src/components/IconButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAIL,SAAS,EACT,SAAS,EAET,cAAc,EAEf,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAEnD,aAAK,KAAK,GAAG;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,EAAE,KAAK,CAAC;IACb,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,GAAG,cAAc,GAChB,QAAQ,CAAC;;;;AA0DX,wBAAqC"}
1
+ {"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../../../../src/components/IconButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAIL,SAAS,EACT,SAAS,EAET,cAAc,EAEf,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAEnD,aAAK,KAAK,GAAG;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,EAAE,KAAK,CAAC;IACb,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,GAAG,cAAc,GAChB,QAAQ,CAAC;;;;AA4DX,wBAAqC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Pressable.d.ts","sourceRoot":"","sources":["../../../../src/components/Pressable.tsx"],"names":[],"mappings":";AACA,OAAO,EAEL,cAAc,EACd,SAAS,EACV,MAAM,cAAc,CAAC;AAEtB,aAAK,KAAK,GAAG;IACX,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,GAAG,cAAc,CAAC;AAEnB,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAChC,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,aAAa,EACb,eAAe,EACf,cAAc,EACd,OAAO,EACP,KAAK,EACL,GAAG,KAAK,EACT,EAAE,KAAK,eAoBP"}
1
+ {"version":3,"file":"Pressable.d.ts","sourceRoot":"","sources":["../../../../src/components/Pressable.tsx"],"names":[],"mappings":";AACA,OAAO,EAEL,cAAc,EACd,SAAS,EACV,MAAM,cAAc,CAAC;AAEtB,aAAK,KAAK,GAAG;IACX,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,GAAG,cAAc,CAAC;AAEnB,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAChC,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,aAAmB,EACnB,eAAqB,EACrB,cAAc,EACd,OAAO,EACP,KAAK,EACL,GAAG,KAAK,EACT,EAAE,KAAK,eAoBP"}
@@ -1 +1 @@
1
- {"version":3,"file":"Touchable.d.ts","sourceRoot":"","sources":["../../../../src/components/Touchable.tsx"],"names":[],"mappings":";AACA,OAAO,EAAa,cAAc,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpE,aAAK,KAAK,GAAG;IACX,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,GAAG,cAAc,CAAC;AAEnB,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAChC,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,aAAa,EACb,eAAe,EACf,cAAc,EACd,OAAO,EACP,KAAK,EACL,GAAG,KAAK,EACT,EAAE,KAAK,eAoBP"}
1
+ {"version":3,"file":"Touchable.d.ts","sourceRoot":"","sources":["../../../../src/components/Touchable.tsx"],"names":[],"mappings":";AACA,OAAO,EAAa,cAAc,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpE,aAAK,KAAK,GAAG;IACX,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,GAAG,cAAc,CAAC;AAEnB,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAChC,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,aAAmB,EACnB,eAAqB,EACrB,cAAc,EACd,OAAO,EACP,KAAK,EACL,GAAG,KAAK,EACT,EAAE,KAAK,eAoBP"}
@@ -16,35 +16,45 @@ export declare const SEED_DATA: {
16
16
  defaultValue: null;
17
17
  group: string;
18
18
  };
19
- icon: {
19
+ onLongPress: {
20
20
  label: string;
21
21
  description: string;
22
+ editable: boolean;
23
+ required: boolean;
22
24
  formType: string;
23
25
  propType: string;
24
- defaultValue: string;
25
- required: boolean;
26
- editable: boolean;
26
+ defaultValue: null;
27
27
  group: string;
28
28
  };
29
- color: {
30
- group: string;
29
+ disabled: {
31
30
  label: string;
32
31
  description: string;
32
+ group: string;
33
33
  editable: boolean;
34
34
  required: boolean;
35
- defaultValue: null;
36
35
  formType: string;
37
36
  propType: string;
37
+ defaultValue: null;
38
38
  };
39
- disabled: {
39
+ icon: {
40
40
  label: string;
41
41
  description: string;
42
42
  formType: string;
43
43
  propType: string;
44
- defaultValue: boolean;
45
- editable: boolean;
44
+ defaultValue: string;
46
45
  required: boolean;
46
+ editable: boolean;
47
+ group: string;
48
+ };
49
+ color: {
47
50
  group: string;
51
+ label: string;
52
+ description: string;
53
+ editable: boolean;
54
+ required: boolean;
55
+ defaultValue: null;
56
+ formType: string;
57
+ propType: string;
48
58
  };
49
59
  size: {
50
60
  label: string;
@@ -1 +1 @@
1
- {"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../../../../src/mappings/IconButton.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiCrB,CAAC"}
1
+ {"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../../../../src/mappings/IconButton.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+BrB,CAAC"}
@@ -6,6 +6,8 @@ export declare const SEED_DATA: {
6
6
  category: string;
7
7
  layout: {
8
8
  flex: number;
9
+ width: string;
10
+ height: string;
9
11
  };
10
12
  props: {
11
13
  provider: {
@@ -1 +1 @@
1
- {"version":3,"file":"MapView.d.ts","sourceRoot":"","sources":["../../../../src/mappings/MapView.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2IrB,CAAC"}
1
+ {"version":3,"file":"MapView.d.ts","sourceRoot":"","sources":["../../../../src/mappings/MapView.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6IrB,CAAC"}
@@ -23,6 +23,16 @@ export declare const SEED_DATA: {
23
23
  defaultValue: null;
24
24
  group: string;
25
25
  };
26
+ disabled: {
27
+ label: string;
28
+ description: string;
29
+ group: string;
30
+ editable: boolean;
31
+ required: boolean;
32
+ formType: string;
33
+ propType: string;
34
+ defaultValue: null;
35
+ };
26
36
  activeOpacity: {
27
37
  label: string;
28
38
  description: string;
@@ -67,6 +77,16 @@ export declare const SEED_DATA: {
67
77
  required: boolean;
68
78
  step: number;
69
79
  };
80
+ android_disableSound: {
81
+ label: string;
82
+ description: string;
83
+ formType: string;
84
+ propType: string;
85
+ defaultValue: boolean;
86
+ editable: boolean;
87
+ required: boolean;
88
+ group: string;
89
+ };
70
90
  };
71
91
  name: string;
72
92
  tag: string;
@@ -1 +1 @@
1
- {"version":3,"file":"Touchable.d.ts","sourceRoot":"","sources":["../../../../src/mappings/Touchable.ts"],"names":[],"mappings":"AAsDA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAerB,CAAC"}
1
+ {"version":3,"file":"Touchable.d.ts","sourceRoot":"","sources":["../../../../src/mappings/Touchable.ts"],"names":[],"mappings":"AAgEA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAerB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@draftbit/core",
3
- "version": "47.1.1-a3c366.2+a3c3666",
3
+ "version": "47.1.1-ace71d.2+ace71db",
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": "^47.1.1-a3c366.2+a3c3666",
44
+ "@draftbit/types": "^47.1.1-ace71d.2+ace71db",
45
45
  "@material-ui/core": "^4.11.0",
46
46
  "@material-ui/pickers": "^3.2.10",
47
47
  "@react-native-community/slider": "4.2.4",
@@ -91,5 +91,5 @@
91
91
  ]
92
92
  ]
93
93
  },
94
- "gitHead": "a3c36668e7783c2c82fd367b71e7f157a4d8b1a8"
94
+ "gitHead": "ace71db71556bc67f12cd2667c00ce27f37c2831"
95
95
  }
@@ -7,7 +7,7 @@ const CONSTANTS = {
7
7
  padding: 8,
8
8
  icon: 24,
9
9
  };
10
- function Base({ Icon, icon, title, loading, disabled, style, activeOpacity, disabledOpacity, ...props }) {
10
+ function Base({ Icon, icon, title, loading, disabled, style, activeOpacity = 0.8, disabledOpacity = 0.8, ...props }) {
11
11
  const { color, fontFamily, fontWeight, fontSize, lineHeight, letterSpacing, textTransform, textAlign, textDecorationLine, textDecorationColor, textDecorationStyle, ...buttonStyles } = StyleSheet.flatten(style || {});
12
12
  const titleStyles = {
13
13
  color,
@@ -59,8 +59,8 @@ function Base({
59
59
  loading,
60
60
  disabled,
61
61
  style,
62
- activeOpacity,
63
- disabledOpacity,
62
+ activeOpacity = 0.8,
63
+ disabledOpacity = 0.8,
64
64
  ...props
65
65
  }: BaseProps): JSX.Element {
66
66
  const {
@@ -1,13 +1,13 @@
1
1
  import * as React from "react";
2
2
  import { View, StyleSheet, ActivityIndicator, Pressable, Platform, } from "react-native";
3
3
  import { withTheme } from "../theming";
4
- const IconButton = ({ Icon, icon, color: customColor, size = 32, disabled = false, loading = false, onPress, theme, style, ...props }) => {
4
+ const IconButton = ({ Icon, icon, color: customColor, size = 32, disabled, loading = false, onPress, theme, style, activeOpacity = 0.8, disabledOpacity = 0.8, ...props }) => {
5
5
  const iconColor = customColor || theme.colors.primary;
6
6
  return (React.createElement(Pressable, { onPress: onPress, disabled: disabled || loading, style: ({ pressed }) => {
7
7
  return [
8
8
  styles.container,
9
9
  {
10
- opacity: pressed || disabled ? 0.75 : 1,
10
+ opacity: pressed ? activeOpacity : disabled ? disabledOpacity : 1,
11
11
  width: size,
12
12
  height: size,
13
13
  alignItems: "center",
@@ -22,6 +22,8 @@ type Props = {
22
22
  onPress: () => void;
23
23
  theme: Theme;
24
24
  style?: StyleProp<ViewStyle>;
25
+ activeOpacity?: number;
26
+ disabledOpacity?: number;
25
27
  } & PressableProps &
26
28
  IconSlot;
27
29
 
@@ -30,11 +32,13 @@ const IconButton: React.FC<React.PropsWithChildren<Props>> = ({
30
32
  icon,
31
33
  color: customColor,
32
34
  size = 32,
33
- disabled = false,
35
+ disabled,
34
36
  loading = false,
35
37
  onPress,
36
38
  theme,
37
39
  style,
40
+ activeOpacity = 0.8,
41
+ disabledOpacity = 0.8,
38
42
  ...props
39
43
  }) => {
40
44
  const iconColor = customColor || theme.colors.primary;
@@ -47,7 +51,7 @@ const IconButton: React.FC<React.PropsWithChildren<Props>> = ({
47
51
  return [
48
52
  styles.container,
49
53
  {
50
- opacity: pressed || disabled ? 0.75 : 1,
54
+ opacity: pressed ? activeOpacity : disabled ? disabledOpacity : 1,
51
55
  width: size,
52
56
  height: size,
53
57
  alignItems: "center",
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import { Pressable as NativePressable, } from "react-native";
3
- export default function Pressable({ children, disabled, onPress, activeOpacity, disabledOpacity, delayLongPress, hitSlop, style, ...props }) {
3
+ export default function Pressable({ children, disabled, onPress, activeOpacity = 0.8, disabledOpacity = 0.8, delayLongPress, hitSlop, style, ...props }) {
4
4
  return (React.createElement(NativePressable, { onPress: onPress, disabled: disabled, delayLongPress: delayLongPress ? delayLongPress : 500, hitSlop: hitSlop ? hitSlop : 8, style: ({ pressed }) => {
5
5
  return [
6
6
  {
@@ -15,8 +15,8 @@ export default function Pressable({
15
15
  children,
16
16
  disabled,
17
17
  onPress,
18
- activeOpacity,
19
- disabledOpacity,
18
+ activeOpacity = 0.8,
19
+ disabledOpacity = 0.8,
20
20
  delayLongPress,
21
21
  hitSlop,
22
22
  style,
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import { Pressable } from "react-native";
3
- export default function Touchable({ children, disabled, onPress, activeOpacity, disabledOpacity, delayLongPress, hitSlop, style, ...props }) {
3
+ export default function Touchable({ children, disabled, onPress, activeOpacity = 0.8, disabledOpacity = 0.8, delayLongPress, hitSlop, style, ...props }) {
4
4
  return (React.createElement(Pressable, { disabled: disabled, onPress: onPress, delayLongPress: delayLongPress ? delayLongPress : 500, hitSlop: hitSlop ? hitSlop : 8, style: ({ pressed }) => {
5
5
  return [
6
6
  {
@@ -11,8 +11,8 @@ export default function Touchable({
11
11
  children,
12
12
  disabled,
13
13
  onPress,
14
- activeOpacity,
15
- disabledOpacity,
14
+ activeOpacity = 0.8,
15
+ disabledOpacity = 0.8,
16
16
  delayLongPress,
17
17
  hitSlop,
18
18
  style,
@@ -17,7 +17,7 @@ const SEED_DATA_PROPS = {
17
17
  activeOpacity: createStaticNumberProp({
18
18
  label: "Active Opacity",
19
19
  description: "Opacity of the button when active.",
20
- defaultValue: 0.8,
20
+ defaultValue: null,
21
21
  min: 0,
22
22
  max: 1,
23
23
  step: 0.01,
@@ -27,7 +27,7 @@ const SEED_DATA_PROPS = {
27
27
  disabledOpacity: createStaticNumberProp({
28
28
  label: "Disabled Opacity",
29
29
  description: "Opacity of the button when disabled.",
30
- defaultValue: 0.8,
30
+ defaultValue: null,
31
31
  min: 0,
32
32
  max: 1,
33
33
  step: 0.01,
@@ -28,7 +28,7 @@ const SEED_DATA_PROPS = {
28
28
  activeOpacity: createStaticNumberProp({
29
29
  label: "Active Opacity",
30
30
  description: "Opacity of the button when active.",
31
- defaultValue: 0.8,
31
+ defaultValue: null,
32
32
  min: 0,
33
33
  max: 1,
34
34
  step: 0.01,
@@ -38,7 +38,7 @@ const SEED_DATA_PROPS = {
38
38
  disabledOpacity: createStaticNumberProp({
39
39
  label: "Disabled Opacity",
40
40
  description: "Opacity of the button when disabled.",
41
- defaultValue: 0.8,
41
+ defaultValue: null,
42
42
  min: 0,
43
43
  max: 1,
44
44
  step: 0.01,
@@ -1,10 +1,10 @@
1
- import { COMPONENT_TYPES, GROUPS, createIconProp, createColorProp, createNumberProp, createBoolProp, createActionProp, Triggers, StylesPanelSections, } from "@draftbit/types";
1
+ import { COMPONENT_TYPES, GROUPS, createIconProp, createColorProp, createNumberProp, createActionProp, Triggers, StylesPanelSections, createDisabledProp, } from "@draftbit/types";
2
2
  export const SEED_DATA = {
3
3
  name: "Icon Button",
4
4
  tag: "IconButton",
5
5
  category: COMPONENT_TYPES.button,
6
6
  layout: {},
7
- triggers: [Triggers.OnPress],
7
+ triggers: [Triggers.OnPress, Triggers.OnLongPress],
8
8
  stylesPanelSections: [
9
9
  StylesPanelSections.Margins,
10
10
  StylesPanelSections.Effects,
@@ -12,22 +12,20 @@ export const SEED_DATA = {
12
12
  ],
13
13
  props: {
14
14
  onPress: createActionProp(),
15
+ onLongPress: createActionProp(),
16
+ disabled: createDisabledProp(),
15
17
  icon: createIconProp(),
16
18
  color: createColorProp({
17
19
  label: "Color",
18
20
  group: GROUPS.basic,
19
21
  }),
20
- disabled: createBoolProp({
21
- label: "Disabled",
22
- group: GROUPS.basic,
23
- }),
24
22
  size: createNumberProp({
25
23
  group: GROUPS.basic,
26
24
  label: "Size",
27
25
  description: "Width and height of your icon",
28
26
  defaultValue: 32,
29
27
  min: 16,
30
- max: 128,
28
+ max: 256,
31
29
  step: 1,
32
30
  precision: 0,
33
31
  }),
@@ -4,10 +4,10 @@ import {
4
4
  createIconProp,
5
5
  createColorProp,
6
6
  createNumberProp,
7
- createBoolProp,
8
7
  createActionProp,
9
8
  Triggers,
10
9
  StylesPanelSections,
10
+ createDisabledProp,
11
11
  } from "@draftbit/types";
12
12
 
13
13
  export const SEED_DATA = {
@@ -15,7 +15,7 @@ export const SEED_DATA = {
15
15
  tag: "IconButton",
16
16
  category: COMPONENT_TYPES.button,
17
17
  layout: {},
18
- triggers: [Triggers.OnPress],
18
+ triggers: [Triggers.OnPress, Triggers.OnLongPress],
19
19
  stylesPanelSections: [
20
20
  StylesPanelSections.Margins,
21
21
  StylesPanelSections.Effects,
@@ -23,22 +23,20 @@ export const SEED_DATA = {
23
23
  ],
24
24
  props: {
25
25
  onPress: createActionProp(),
26
+ onLongPress: createActionProp(),
27
+ disabled: createDisabledProp(),
26
28
  icon: createIconProp(),
27
29
  color: createColorProp({
28
30
  label: "Color",
29
31
  group: GROUPS.basic,
30
32
  }),
31
- disabled: createBoolProp({
32
- label: "Disabled",
33
- group: GROUPS.basic,
34
- }),
35
33
  size: createNumberProp({
36
34
  group: GROUPS.basic,
37
35
  label: "Size",
38
36
  description: "Width and height of your icon",
39
37
  defaultValue: 32,
40
38
  min: 16,
41
- max: 128,
39
+ max: 256,
42
40
  step: 1,
43
41
  precision: 0,
44
42
  }),
@@ -7,6 +7,8 @@ export const SEED_DATA = {
7
7
  category: COMPONENT_TYPES.map,
8
8
  layout: {
9
9
  flex: 1,
10
+ width: "100%",
11
+ height: "100%",
10
12
  },
11
13
  props: {
12
14
  provider: {
@@ -17,6 +17,8 @@ export const SEED_DATA = {
17
17
  category: COMPONENT_TYPES.map,
18
18
  layout: {
19
19
  flex: 1,
20
+ width: "100%",
21
+ height: "100%",
20
22
  },
21
23
  props: {
22
24
  provider: {
@@ -1,4 +1,4 @@
1
- import { COMPONENT_TYPES, createActionProp, Triggers, createStaticNumberProp, StylesPanelSections, } from "@draftbit/types";
1
+ import { COMPONENT_TYPES, createActionProp, Triggers, createStaticNumberProp, StylesPanelSections, createDisabledProp, GROUPS, createStaticBoolProp, } from "@draftbit/types";
2
2
  const SEED_DATA_PROPS = {
3
3
  stylesPanelSections: [
4
4
  StylesPanelSections.Size,
@@ -10,10 +10,11 @@ const SEED_DATA_PROPS = {
10
10
  props: {
11
11
  onPress: createActionProp(),
12
12
  onLongPress: createActionProp(),
13
+ disabled: createDisabledProp(),
13
14
  activeOpacity: createStaticNumberProp({
14
15
  label: "Active Opacity",
15
16
  description: "The opacity when the button is pressed.",
16
- defaultValue: 0.8,
17
+ defaultValue: null,
17
18
  min: 0,
18
19
  max: 1,
19
20
  step: 0.01,
@@ -23,7 +24,7 @@ const SEED_DATA_PROPS = {
23
24
  disabledOpacity: createStaticNumberProp({
24
25
  label: "Disabled Opacity",
25
26
  description: "The opacity when the button is disabled.",
26
- defaultValue: 0.8,
27
+ defaultValue: null,
27
28
  min: 0,
28
29
  max: 1,
29
30
  step: 0.01,
@@ -40,6 +41,12 @@ const SEED_DATA_PROPS = {
40
41
  description: "Sets additional distance outside of element in which a press can be detected.",
41
42
  required: false,
42
43
  }),
44
+ android_disableSound: createStaticBoolProp({
45
+ label: "Disable Sound",
46
+ description: "Disable the Android sound effect.",
47
+ defaultValue: null,
48
+ group: GROUPS.android,
49
+ }),
43
50
  },
44
51
  };
45
52
  export const SEED_DATA = [
@@ -4,6 +4,9 @@ import {
4
4
  Triggers,
5
5
  createStaticNumberProp,
6
6
  StylesPanelSections,
7
+ createDisabledProp,
8
+ GROUPS,
9
+ createStaticBoolProp,
7
10
  } from "@draftbit/types";
8
11
 
9
12
  const SEED_DATA_PROPS = {
@@ -17,10 +20,11 @@ const SEED_DATA_PROPS = {
17
20
  props: {
18
21
  onPress: createActionProp(),
19
22
  onLongPress: createActionProp(),
23
+ disabled: createDisabledProp(),
20
24
  activeOpacity: createStaticNumberProp({
21
25
  label: "Active Opacity",
22
26
  description: "The opacity when the button is pressed.",
23
- defaultValue: 0.8,
27
+ defaultValue: null,
24
28
  min: 0,
25
29
  max: 1,
26
30
  step: 0.01,
@@ -30,7 +34,7 @@ const SEED_DATA_PROPS = {
30
34
  disabledOpacity: createStaticNumberProp({
31
35
  label: "Disabled Opacity",
32
36
  description: "The opacity when the button is disabled.",
33
- defaultValue: 0.8,
37
+ defaultValue: null,
34
38
  min: 0,
35
39
  max: 1,
36
40
  step: 0.01,
@@ -49,6 +53,12 @@ const SEED_DATA_PROPS = {
49
53
  "Sets additional distance outside of element in which a press can be detected.",
50
54
  required: false,
51
55
  }),
56
+ android_disableSound: createStaticBoolProp({
57
+ label: "Disable Sound",
58
+ description: "Disable the Android sound effect.",
59
+ defaultValue: null,
60
+ group: GROUPS.android,
61
+ }),
52
62
  },
53
63
  };
54
64