@draftbit/core 47.2.14-41b571.2 → 47.2.14-5888e0.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.
@@ -3,6 +3,19 @@ import { StyleProp, ViewStyle, TextStyle } from "react-native";
3
3
  import { IconSlot } from "../../interfaces/Icon";
4
4
  import type { Theme } from "../../styles/DefaultTheme";
5
5
  import { RightSwipeProps, LeftSwipeProps } from "./SwipeableItemCommon";
6
+ /**
7
+ * Clarification Regarding left/right directions and what they mean in the context of this component
8
+ * ------------------------------------------------------------------------------------------------------------
9
+ * Swipe Left / Left Swipe = Swiping to the left (i.e. Swiping from the right)
10
+ * Swipe Right / Right Swipe = Swiping to the right (i.e. Swiping from the left)
11
+ *
12
+ * This is only applies in the context of swipes, and not anywhere where a direction is refernced.
13
+ * For example 'rightOpenValue' referes to the open value on the right side.
14
+ * While 'stopRightSwipe' refers to the stop value of the swipe from left to right, which is on the left side.
15
+ * This is because one refers to a swipe and one does not, so the word 'right' has different meanings.
16
+ *
17
+ * This component is built around this concept to avoid confusion
18
+ */
6
19
  export interface SwipeableItemProps extends IconSlot {
7
20
  closeOnPress?: boolean;
8
21
  leftOpenValue?: number;
@@ -8,7 +8,7 @@ import { SwipeableListContext } from "./SwipeableList";
8
8
  import { leftSwipeToSwipeableItemBehindItem, rightSwipeToSwipeableItemBehindItem, extractLeftSwipeProps, extractRightSwipeProps, } from "./SwipeableItemCommon";
9
9
  const SwipeableItem = ({ theme, style, children, Icon, closeOnPress, leftOpenValue, rightOpenValue, leftActivationValue, rightActivationValue, swipeActivationPercentage = 80, stopLeftSwipe, stopRightSwipe, friction = 20, ...rest }) => {
10
10
  const instanceOfSwipeableItemButtonProps = (object) => {
11
- return "title" in object && "side" in object;
11
+ return "title" in object && "revealSwipeDirection" in object;
12
12
  };
13
13
  const isEmptyObject = (object) => {
14
14
  return Object.keys(object).length === 0;
@@ -32,24 +32,24 @@ const SwipeableItem = ({ theme, style, children, Icon, closeOnPress, leftOpenVal
32
32
  sizeStyles /* Size styles needs to be readded to surface container due to inconsistencies on web */,
33
33
  ]);
34
34
  const [componentWidth, setComponentWidth] = React.useState(null);
35
- const leftButtons = React.useMemo(() => React.Children.toArray(children).filter((child) => React.isValidElement(child) &&
35
+ const leftSwipeButtons = React.useMemo(() => React.Children.toArray(children).filter((child) => React.isValidElement(child) &&
36
36
  instanceOfSwipeableItemButtonProps(child.props) &&
37
- child.props.side === "left"), [children]);
38
- const rightButtons = React.useMemo(() => React.Children.toArray(children).filter((child) => React.isValidElement(child) &&
37
+ child.props.revealSwipeDirection === "left"), [children]);
38
+ const rightSwipeButtons = React.useMemo(() => React.Children.toArray(children).filter((child) => React.isValidElement(child) &&
39
39
  instanceOfSwipeableItemButtonProps(child.props) &&
40
- child.props.side === "right"), [children]);
40
+ child.props.revealSwipeDirection === "right"), [children]);
41
41
  const remainingChildren = React.useMemo(() => React.Children.toArray(children).filter((child) => React.isValidElement(child) &&
42
42
  !instanceOfSwipeableItemButtonProps(child.props)), [children]);
43
43
  const leftSwipe = extractLeftSwipeProps(rest);
44
44
  const rightSwipe = extractRightSwipeProps(rest);
45
45
  const isLeftSwipeHandled = !isEmptyObject(leftSwipe);
46
46
  const isRightSwipeHandled = !isEmptyObject(rightSwipe);
47
- if (leftButtons.length > 2 || rightButtons.length > 2) {
47
+ if (leftSwipeButtons.length > 2 || rightSwipeButtons.length > 2) {
48
48
  throw Error("Cannot have more than 2 SwipeableItemButton(s) per side");
49
49
  }
50
- if ((leftButtons.length && isLeftSwipeHandled) ||
51
- (rightButtons.length && isRightSwipeHandled)) {
52
- throw Error("Colliding configuration in SwipeableItem. You cannot have SwipeableItemButton(s) on the side where swipe handling is configured. Either reset swipe configuration or remove the button(s).");
50
+ if ((leftSwipeButtons.length && isLeftSwipeHandled) ||
51
+ (rightSwipeButtons.length && isRightSwipeHandled)) {
52
+ throw Error("Colliding configuration in SwipeableItem. You cannot have SwipeableItemButton(s) on the swipe direction where swipe handling is configured. Either reset swipe configuration or remove the button(s).");
53
53
  }
54
54
  //Renders a single 'behind' item. Used for both buttons and swipe handler
55
55
  const renderBehindItem = (item, index) => (React.createElement(Pressable, { key: index.toString(), onPress: item.onPress, style: [
@@ -57,25 +57,25 @@ const SwipeableItem = ({ theme, style, children, Icon, closeOnPress, leftOpenVal
57
57
  { backgroundColor: item.backgroundColor || theme.colors.primary },
58
58
  ] },
59
59
  item.icon && (React.createElement(Icon, { name: item.icon, size: item.iconSize || 25, color: item.color || theme.colors.surface })),
60
- React.createElement(Text, { style: [textStyles, { color: item.color || theme.colors.surface }] }, item.title)));
60
+ item.title && (React.createElement(Text, { style: [textStyles, { color: item.color || theme.colors.surface }] }, item.title))));
61
61
  const defaultLeftOpenValue = componentWidth ? componentWidth / 2 : 0;
62
62
  const defaultRightOpenValue = componentWidth ? -componentWidth / 2 : 0;
63
63
  return (React.createElement(View, { onLayout: (event) => {
64
64
  setComponentWidth(event.nativeEvent.layout.width);
65
65
  }, style: [styles.parentContainer, parentContainerStyles] },
66
- React.createElement(SwipeRow, { leftOpenValue: isLeftSwipeHandled ? 0 : leftOpenValue || defaultLeftOpenValue //If in swiping mode, don't keep open
67
- , rightOpenValue: isRightSwipeHandled ? 0 : rightOpenValue || defaultRightOpenValue, leftActivationValue: leftActivationValue || isLeftSwipeHandled
66
+ React.createElement(SwipeRow, { leftOpenValue: isRightSwipeHandled ? 0 : leftOpenValue || defaultLeftOpenValue //If in swiping mode, don't keep open
67
+ , rightOpenValue: isLeftSwipeHandled ? 0 : rightOpenValue || defaultRightOpenValue, leftActivationValue: leftActivationValue || isRightSwipeHandled
68
68
  ? defaultLeftOpenValue * (swipeActivationPercentage / 100) //When swipe passes activation percentage then it should be considered activated (call onSwipe)
69
- : defaultLeftOpenValue, rightActivationValue: rightActivationValue || isRightSwipeHandled
69
+ : defaultLeftOpenValue, rightActivationValue: rightActivationValue || isLeftSwipeHandled
70
70
  ? defaultRightOpenValue * (swipeActivationPercentage / 100)
71
- : defaultRightOpenValue, stopLeftSwipe: stopLeftSwipe || defaultLeftOpenValue, stopRightSwipe: stopRightSwipe || defaultRightOpenValue, onLeftAction: isLeftSwipeHandled ? () => { var _a; return (_a = leftSwipe.onLeftSwipe) === null || _a === void 0 ? void 0 : _a.call(leftSwipe); } : undefined, onRightAction: isRightSwipeHandled ? () => { var _a; return (_a = rightSwipe.onRightSwipe) === null || _a === void 0 ? void 0 : _a.call(rightSwipe); } : undefined, swipeGestureBegan: onStartSwiping, swipeGestureEnded: onStopSwiping, closeOnRowPress: closeOnPress, friction: friction, ...rest },
71
+ : defaultRightOpenValue, stopLeftSwipe: stopRightSwipe || defaultLeftOpenValue, stopRightSwipe: stopLeftSwipe || defaultRightOpenValue, onLeftAction: isRightSwipeHandled ? () => { var _a; return (_a = rightSwipe.onSwipedRight) === null || _a === void 0 ? void 0 : _a.call(rightSwipe); } : undefined, onRightAction: isLeftSwipeHandled ? () => { var _a; return (_a = leftSwipe.onSwipedLeft) === null || _a === void 0 ? void 0 : _a.call(leftSwipe); } : undefined, swipeGestureBegan: onStartSwiping, swipeGestureEnded: onStopSwiping, closeOnRowPress: closeOnPress, friction: friction, ...rest },
72
72
  React.createElement(View, { style: styles.behindContainer },
73
- React.createElement(View, { style: styles.behindContainerItem }, isLeftSwipeHandled
74
- ? renderBehindItem(leftSwipeToSwipeableItemBehindItem(leftSwipe), 0)
75
- : leftButtons.map((item, index) => renderBehindItem(item.props, index))),
76
73
  React.createElement(View, { style: styles.behindContainerItem }, isRightSwipeHandled
77
74
  ? renderBehindItem(rightSwipeToSwipeableItemBehindItem(rightSwipe), 0)
78
- : rightButtons.map((item, index) => renderBehindItem(item.props, index)))),
75
+ : rightSwipeButtons.map((item, index) => renderBehindItem(item.props, index))),
76
+ React.createElement(View, { style: styles.behindContainerItem }, isLeftSwipeHandled
77
+ ? renderBehindItem(leftSwipeToSwipeableItemBehindItem(leftSwipe), 0)
78
+ : leftSwipeButtons.map((item, index) => renderBehindItem(item.props, index)))),
79
79
  React.createElement(View, { style: [
80
80
  styles.surfaceContainer,
81
81
  {
@@ -1 +1 @@
1
- {"version":3,"file":"SwipeableItem.js","sourceRoot":"","sources":["../../../../src/components/SwipeableItem/SwipeableItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,IAAI,EAIJ,UAAU,EACV,IAAI,GACL,MAAM,cAAc,CAAC;AACtB,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,EACL,4BAA4B,EAC5B,mBAAmB,EACnB,qBAAqB,EACrB,qBAAqB,EACrB,iBAAiB,EACjB,aAAa,GACd,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAGxD,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAIL,kCAAkC,EAClC,mCAAmC,EACnC,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,uBAAuB,CAAC;AAyB/B,MAAM,aAAa,GAA6C,CAAC,EAC/D,KAAK,EACL,KAAK,EACL,QAAQ,EACR,IAAI,EACJ,YAAY,EACZ,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EACpB,yBAAyB,GAAG,EAAE,EAC9B,aAAa,EACb,cAAc,EACd,QAAQ,GAAG,EAAE,EACb,GAAG,IAAI,EACR,EAAE,EAAE;IACH,MAAM,kCAAkC,GAAG,CACzC,MAAW,EACyB,EAAE;QACtC,OAAO,OAAO,IAAI,MAAM,IAAI,MAAM,IAAI,MAAM,CAAC;IAC/C,CAAC,CAAC;IAEF,MAAM,aAAa,GAAG,CAAC,MAAc,EAAE,EAAE;QACvC,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC;IAC1C,CAAC,CAAC;IAEF,MAAM,EAAE,cAAc,EAAE,aAAa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AAC,CACF;oBACH,CAAC,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAC/B,gBAAgB,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,CACpC,CACA,CACF;YACP,oBAAC,IAAI,IACH,KAAK,EAAE;oBACL,MAAM,CAAC,gBAAgB;oBACvB;wBACE,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,UAAU;qBACzC;oBACD,sBAAsB;iBACvB,IAEA,iBAAiB,CACb,CACE,CACN,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,eAAe,EAAE;QACf,QAAQ,EAAE,QAAQ;QAClB,SAAS,EAAE,EAAE;KACd;IACD,eAAe,EAAE;QACf,IAAI,EAAE,CAAC;QACP,KAAK,EAAE,MAAM;QACb,MAAM,EAAE,MAAM;QACd,aAAa,EAAE,KAAK;KACrB;IACD,mBAAmB,EAAE;QACnB,IAAI,EAAE,CAAC;QACP,aAAa,EAAE,KAAK;KACrB;IACD,eAAe,EAAE;QACf,IAAI,EAAE,CAAC;QACP,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,QAAQ;KACzB;IACD,gBAAgB,EAAE;QAChB,KAAK,EAAE,MAAM;QACb,SAAS,EAAE,EAAE;QACb,QAAQ,EAAE,QAAQ;KACnB;CACF,CAAC,CAAC;AAEH,eAAe,SAAS,CAAC,aAAa,CAAC,CAAC"}
1
+ {"version":3,"file":"SwipeableItem.js","sourceRoot":"","sources":["../../../../src/components/SwipeableItem/SwipeableItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,IAAI,EAIJ,UAAU,EACV,IAAI,GACL,MAAM,cAAc,CAAC;AACtB,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,EACL,4BAA4B,EAC5B,mBAAmB,EACnB,qBAAqB,EACrB,qBAAqB,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BAAiB,CACb,CACE,CACN,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,eAAe,EAAE;QACf,QAAQ,EAAE,QAAQ;QAClB,SAAS,EAAE,EAAE;KACd;IACD,eAAe,EAAE;QACf,IAAI,EAAE,CAAC;QACP,KAAK,EAAE,MAAM;QACb,MAAM,EAAE,MAAM;QACd,aAAa,EAAE,KAAK;KACrB;IACD,mBAAmB,EAAE;QACnB,IAAI,EAAE,CAAC;QACP,aAAa,EAAE,KAAK;KACrB;IACD,eAAe,EAAE;QACf,IAAI,EAAE,CAAC;QACP,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,QAAQ;KACzB;IACD,gBAAgB,EAAE;QAChB,KAAK,EAAE,MAAM;QACb,SAAS,EAAE,EAAE;QACb,QAAQ,EAAE,QAAQ;KACnB;CACF,CAAC,CAAC;AAEH,eAAe,SAAS,CAAC,aAAa,CAAC,CAAC"}
@@ -1,6 +1,6 @@
1
1
  export interface SwipeableItemBehindItem {
2
2
  title: string;
3
- side: "left" | "right";
3
+ revealSwipeDirection: "left" | "right";
4
4
  onPress?: () => void;
5
5
  onSwipe?: () => void;
6
6
  icon?: string;
@@ -9,7 +9,7 @@ export interface SwipeableItemBehindItem {
9
9
  color?: string;
10
10
  }
11
11
  export interface RightSwipeProps {
12
- onRightSwipe?: () => void;
12
+ onSwipedRight?: () => void;
13
13
  rightSwipeTitle?: string;
14
14
  rightSwipeIcon?: string;
15
15
  rightSwipeIconSize?: number;
@@ -17,7 +17,7 @@ export interface RightSwipeProps {
17
17
  rightSwipeColor?: string;
18
18
  }
19
19
  export interface LeftSwipeProps {
20
- onLeftSwipe?: () => void;
20
+ onSwipedLeft?: () => void;
21
21
  leftSwipeTitle?: string;
22
22
  leftSwipeIcon?: string;
23
23
  leftSwipeIconSize?: number;
@@ -1,7 +1,7 @@
1
1
  import { pick } from "lodash";
2
2
  export function extractRightSwipeProps(object) {
3
3
  return pick(object, [
4
- "onRightSwipe",
4
+ "onSwipedRight",
5
5
  "rightSwipeTitle",
6
6
  "rightSwipeIcon",
7
7
  "rightSwipeIconSize",
@@ -11,7 +11,7 @@ export function extractRightSwipeProps(object) {
11
11
  }
12
12
  export function extractLeftSwipeProps(object) {
13
13
  return pick(object, [
14
- "onLeftSwipe",
14
+ "onSwipedLeft",
15
15
  "leftSwipeTitle",
16
16
  "leftSwipeIcon",
17
17
  "leftSwipeIconSize",
@@ -22,8 +22,8 @@ export function extractLeftSwipeProps(object) {
22
22
  export function rightSwipeToSwipeableItemBehindItem(swipe) {
23
23
  return {
24
24
  title: swipe.rightSwipeTitle || "",
25
- side: "right",
26
- onSwipe: swipe.onRightSwipe,
25
+ revealSwipeDirection: "right",
26
+ onSwipe: swipe.onSwipedRight,
27
27
  icon: swipe.rightSwipeIcon,
28
28
  iconSize: swipe.rightSwipeIconSize,
29
29
  backgroundColor: swipe.rightSwipeBackgroundColor,
@@ -33,8 +33,8 @@ export function rightSwipeToSwipeableItemBehindItem(swipe) {
33
33
  export function leftSwipeToSwipeableItemBehindItem(swipe) {
34
34
  return {
35
35
  title: swipe.leftSwipeTitle || "",
36
- side: "left",
37
- onSwipe: swipe.onLeftSwipe,
36
+ revealSwipeDirection: "left",
37
+ onSwipe: swipe.onSwipedLeft,
38
38
  icon: swipe.leftSwipeIcon,
39
39
  iconSize: swipe.leftSwipeIconSize,
40
40
  backgroundColor: swipe.leftSwipeBackgroundColor,
@@ -1 +1 @@
1
- {"version":3,"file":"SwipeableItemCommon.js","sourceRoot":"","sources":["../../../../src/components/SwipeableItem/SwipeableItemCommon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AA+B9B,MAAM,UAAU,sBAAsB,CAAC,MAAc;IACnD,OAAO,IAAI,CAAC,MAAM,EAAE;QAClB,cAAc;QACd,iBAAiB;QACjB,gBAAgB;QAChB,oBAAoB;QACpB,2BAA2B;QAC3B,iBAAiB;KAClB,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,MAAc;IAClD,OAAO,IAAI,CAAC,MAAM,EAAE;QAClB,aAAa;QACb,gBAAgB;QAChB,eAAe;QACf,mBAAmB;QACnB,0BAA0B;QAC1B,gBAAgB;KACjB,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,mCAAmC,CACjD,KAAsB;IAEtB,OAAO;QACL,KAAK,EAAE,KAAK,CAAC,eAAe,IAAI,EAAE;QAClC,IAAI,EAAE,OAAO;QACb,OAAO,EAAE,KAAK,CAAC,YAAY;QAC3B,IAAI,EAAE,KAAK,CAAC,cAAc;QAC1B,QAAQ,EAAE,KAAK,CAAC,kBAAkB;QAClC,eAAe,EAAE,KAAK,CAAC,yBAAyB;QAChD,KAAK,EAAE,KAAK,CAAC,eAAe;KAC7B,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,kCAAkC,CAChD,KAAqB;IAErB,OAAO;QACL,KAAK,EAAE,KAAK,CAAC,cAAc,IAAI,EAAE;QACjC,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,KAAK,CAAC,WAAW;QAC1B,IAAI,EAAE,KAAK,CAAC,aAAa;QACzB,QAAQ,EAAE,KAAK,CAAC,iBAAiB;QACjC,eAAe,EAAE,KAAK,CAAC,wBAAwB;QAC/C,KAAK,EAAE,KAAK,CAAC,cAAc;KAC5B,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"SwipeableItemCommon.js","sourceRoot":"","sources":["../../../../src/components/SwipeableItem/SwipeableItemCommon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AA+B9B,MAAM,UAAU,sBAAsB,CAAC,MAAc;IACnD,OAAO,IAAI,CAAC,MAAM,EAAE;QAClB,eAAe;QACf,iBAAiB;QACjB,gBAAgB;QAChB,oBAAoB;QACpB,2BAA2B;QAC3B,iBAAiB;KAClB,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,MAAc;IAClD,OAAO,IAAI,CAAC,MAAM,EAAE;QAClB,cAAc;QACd,gBAAgB;QAChB,eAAe;QACf,mBAAmB;QACnB,0BAA0B;QAC1B,gBAAgB;KACjB,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,mCAAmC,CACjD,KAAsB;IAEtB,OAAO;QACL,KAAK,EAAE,KAAK,CAAC,eAAe,IAAI,EAAE;QAClC,oBAAoB,EAAE,OAAO;QAC7B,OAAO,EAAE,KAAK,CAAC,aAAa;QAC5B,IAAI,EAAE,KAAK,CAAC,cAAc;QAC1B,QAAQ,EAAE,KAAK,CAAC,kBAAkB;QAClC,eAAe,EAAE,KAAK,CAAC,yBAAyB;QAChD,KAAK,EAAE,KAAK,CAAC,eAAe;KAC7B,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,kCAAkC,CAChD,KAAqB;IAErB,OAAO;QACL,KAAK,EAAE,KAAK,CAAC,cAAc,IAAI,EAAE;QACjC,oBAAoB,EAAE,MAAM;QAC5B,OAAO,EAAE,KAAK,CAAC,YAAY;QAC3B,IAAI,EAAE,KAAK,CAAC,aAAa;QACzB,QAAQ,EAAE,KAAK,CAAC,iBAAiB;QACjC,eAAe,EAAE,KAAK,CAAC,wBAAwB;QAC/C,KAAK,EAAE,KAAK,CAAC,cAAc;KAC5B,CAAC;AACJ,CAAC"}