@draftbit/core 46.11.1-d7a8f7.2 → 46.11.1-e9ee84.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.
- package/lib/commonjs/components/Accordion/AccordionItem.js +4 -22
- package/lib/commonjs/components/DeckSwiper/DeckSwiper.js +1 -1
- package/lib/commonjs/components/DeckSwiper/DeckSwiper.js.map +1 -1
- package/lib/commonjs/components/DeckSwiper/DeckSwiperCard.js +0 -1
- package/lib/commonjs/components/DeckSwiper/DeckSwiperCard.js.map +1 -1
- package/lib/commonjs/components/Picker/Picker.js +13 -4
- package/lib/commonjs/components/Picker/Picker.js.map +1 -1
- package/lib/commonjs/components/Shadow.js +11 -2
- package/lib/commonjs/components/Shadow.js.map +1 -1
- package/lib/commonjs/components/TabView/TabView.js +1 -1
- package/lib/commonjs/components/TabView/TabView.js.map +1 -1
- package/lib/commonjs/mappings/DeckSwiper.js +2 -2
- package/lib/commonjs/mappings/DeckSwiper.js.map +1 -1
- package/lib/commonjs/mappings/DeckSwiperCard.js +1 -2
- package/lib/commonjs/mappings/DeckSwiperCard.js.map +1 -1
- package/lib/commonjs/mappings/Shadow.js +2 -2
- package/lib/commonjs/mappings/Shadow.js.map +1 -1
- package/lib/commonjs/utilities.js +9 -1
- package/lib/commonjs/utilities.js.map +1 -1
- package/lib/module/components/Accordion/AccordionGroup.js.map +1 -1
- package/lib/module/components/DeckSwiper/DeckSwiper.js +1 -1
- package/lib/module/components/DeckSwiper/DeckSwiper.js.map +1 -1
- package/lib/module/components/DeckSwiper/DeckSwiperCard.js +0 -1
- package/lib/module/components/DeckSwiper/DeckSwiperCard.js.map +1 -1
- package/lib/module/components/Picker/Picker.js +13 -4
- package/lib/module/components/Picker/Picker.js.map +1 -1
- package/lib/module/components/Shadow.js +11 -2
- package/lib/module/components/Shadow.js.map +1 -1
- package/lib/module/components/TabView/TabView.js +1 -1
- package/lib/module/components/TabView/TabView.js.map +1 -1
- package/lib/module/mappings/DeckSwiper.js +3 -3
- package/lib/module/mappings/DeckSwiper.js.map +1 -1
- package/lib/module/mappings/DeckSwiperCard.js +2 -3
- package/lib/module/mappings/DeckSwiperCard.js.map +1 -1
- package/lib/module/mappings/Shadow.js +3 -3
- package/lib/module/mappings/Shadow.js.map +1 -1
- package/lib/module/utilities.js +6 -0
- package/lib/module/utilities.js.map +1 -1
- package/lib/typescript/src/components/DeckSwiper/DeckSwiperCard.d.ts.map +1 -1
- package/lib/typescript/src/components/Picker/Picker.d.ts.map +1 -1
- package/lib/typescript/src/components/Shadow.d.ts.map +1 -1
- package/lib/typescript/src/mappings/DeckSwiper.d.ts +1 -1
- package/lib/typescript/src/mappings/DeckSwiper.d.ts.map +1 -1
- package/lib/typescript/src/mappings/DeckSwiperCard.d.ts +0 -1
- package/lib/typescript/src/mappings/DeckSwiperCard.d.ts.map +1 -1
- package/lib/typescript/src/mappings/Shadow.d.ts.map +1 -1
- package/lib/typescript/src/utilities.d.ts +2 -0
- package/lib/typescript/src/utilities.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/components/DeckSwiper/DeckSwiper.js +1 -1
- package/src/components/DeckSwiper/DeckSwiper.tsx +1 -1
- package/src/components/DeckSwiper/DeckSwiperCard.js +0 -1
- package/src/components/DeckSwiper/DeckSwiperCard.tsx +0 -1
- package/src/components/Picker/Picker.js +16 -4
- package/src/components/Picker/Picker.tsx +25 -5
- package/src/components/Shadow.js +11 -2
- package/src/components/Shadow.tsx +15 -3
- package/src/components/TabView/TabView.js +1 -1
- package/src/components/TabView/TabView.tsx +1 -1
- package/src/mappings/DeckSwiper.js +7 -3
- package/src/mappings/DeckSwiper.ts +7 -3
- package/src/mappings/DeckSwiperCard.js +10 -3
- package/src/mappings/DeckSwiperCard.ts +10 -6
- package/src/mappings/Shadow.js +9 -3
- package/src/mappings/Shadow.ts +9 -3
- package/src/utilities.js +9 -0
- package/src/utilities.ts +19 -0
|
@@ -1,16 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
COMPONENT_TYPES,
|
|
3
|
-
CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
4
|
-
} from "@draftbit/types";
|
|
1
|
+
import { COMPONENT_TYPES, StylesPanelSections } from "@draftbit/types";
|
|
5
2
|
|
|
6
3
|
export const SEED_DATA = {
|
|
7
4
|
name: "Deck Swiper Card",
|
|
8
5
|
tag: "DeckSwiperCard",
|
|
9
6
|
description: "Single Deck Swiper Card item to be used in DeckSwiper",
|
|
10
7
|
category: COMPONENT_TYPES.swiper,
|
|
11
|
-
stylesPanelSections:
|
|
8
|
+
stylesPanelSections: [
|
|
9
|
+
StylesPanelSections.LayoutFlexItems,
|
|
10
|
+
StylesPanelSections.LayoutContent,
|
|
11
|
+
StylesPanelSections.Background,
|
|
12
|
+
StylesPanelSections.Size,
|
|
13
|
+
StylesPanelSections.MarginsAndPaddings,
|
|
14
|
+
StylesPanelSections.Borders,
|
|
15
|
+
StylesPanelSections.Effects,
|
|
16
|
+
],
|
|
12
17
|
layout: {
|
|
13
|
-
flex: 1,
|
|
14
18
|
alignItems: "center",
|
|
15
19
|
justifyContent: "center",
|
|
16
20
|
padding: 20,
|
package/src/mappings/Shadow.js
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
import { COMPONENT_TYPES,
|
|
1
|
+
import { COMPONENT_TYPES, createColorProp, createStaticNumberProp, createStaticBoolProp, createDisabledProp, GROUPS, StylesPanelSections, } from "@draftbit/types";
|
|
2
2
|
export const SEED_DATA = {
|
|
3
3
|
name: "Shadow",
|
|
4
4
|
tag: "Shadow",
|
|
5
5
|
description: "A cross-platform, universal shadow.",
|
|
6
6
|
category: COMPONENT_TYPES.view,
|
|
7
|
-
stylesPanelSections:
|
|
7
|
+
stylesPanelSections: [
|
|
8
|
+
StylesPanelSections.Size,
|
|
9
|
+
StylesPanelSections.Margins,
|
|
10
|
+
StylesPanelSections.Position,
|
|
11
|
+
StylesPanelSections.Borders,
|
|
12
|
+
StylesPanelSections.Effects,
|
|
13
|
+
],
|
|
8
14
|
props: {
|
|
9
15
|
disabled: createDisabledProp({
|
|
10
16
|
description: "Disables the shadow.",
|
|
@@ -26,7 +32,7 @@ export const SEED_DATA = {
|
|
|
26
32
|
paintInside: createStaticBoolProp({
|
|
27
33
|
label: "Paint Inside",
|
|
28
34
|
description: "Apply the shadow below/inside the content.",
|
|
29
|
-
defaultValue:
|
|
35
|
+
defaultValue: true,
|
|
30
36
|
}),
|
|
31
37
|
stretch: createStaticBoolProp({
|
|
32
38
|
label: "Stretch",
|
package/src/mappings/Shadow.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
COMPONENT_TYPES,
|
|
3
|
-
CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
4
3
|
createColorProp,
|
|
5
4
|
createStaticNumberProp,
|
|
6
5
|
createStaticBoolProp,
|
|
7
6
|
createDisabledProp,
|
|
8
7
|
GROUPS,
|
|
8
|
+
StylesPanelSections,
|
|
9
9
|
} from "@draftbit/types";
|
|
10
10
|
|
|
11
11
|
export const SEED_DATA = {
|
|
@@ -13,7 +13,13 @@ export const SEED_DATA = {
|
|
|
13
13
|
tag: "Shadow",
|
|
14
14
|
description: "A cross-platform, universal shadow.",
|
|
15
15
|
category: COMPONENT_TYPES.view,
|
|
16
|
-
stylesPanelSections:
|
|
16
|
+
stylesPanelSections: [
|
|
17
|
+
StylesPanelSections.Size,
|
|
18
|
+
StylesPanelSections.Margins,
|
|
19
|
+
StylesPanelSections.Position,
|
|
20
|
+
StylesPanelSections.Borders,
|
|
21
|
+
StylesPanelSections.Effects,
|
|
22
|
+
],
|
|
17
23
|
props: {
|
|
18
24
|
disabled: createDisabledProp({
|
|
19
25
|
description: "Disables the shadow.",
|
|
@@ -35,7 +41,7 @@ export const SEED_DATA = {
|
|
|
35
41
|
paintInside: createStaticBoolProp({
|
|
36
42
|
label: "Paint Inside",
|
|
37
43
|
description: "Apply the shadow below/inside the content.",
|
|
38
|
-
defaultValue:
|
|
44
|
+
defaultValue: true,
|
|
39
45
|
}),
|
|
40
46
|
stretch: createStaticBoolProp({
|
|
41
47
|
label: "Stretch",
|
package/src/utilities.js
CHANGED
|
@@ -65,6 +65,15 @@ export function extractBorderAndMarginStyles(style, additionalBorderStyles, addi
|
|
|
65
65
|
]), identity);
|
|
66
66
|
return { borderStyles, marginStyles };
|
|
67
67
|
}
|
|
68
|
+
export const sizeStyleNames = ["width", "height"];
|
|
69
|
+
export function extractSizeStyles(style, additionalSizeStyles) {
|
|
70
|
+
const flatStyle = StyleSheet.flatten(style || {});
|
|
71
|
+
const sizeStyles = pickBy(pick(flatStyle, [
|
|
72
|
+
...sizeStyleNames,
|
|
73
|
+
...(additionalSizeStyles ? additionalSizeStyles : []),
|
|
74
|
+
]), identity);
|
|
75
|
+
return sizeStyles;
|
|
76
|
+
}
|
|
68
77
|
/**
|
|
69
78
|
* Merges a style object on top of another style object. In React Native,
|
|
70
79
|
* keys with undefined values in a style object will still override styles
|
package/src/utilities.ts
CHANGED
|
@@ -98,6 +98,25 @@ export function extractBorderAndMarginStyles(
|
|
|
98
98
|
return { borderStyles, marginStyles };
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
+
export const sizeStyleNames = ["width", "height"];
|
|
102
|
+
|
|
103
|
+
export function extractSizeStyles(
|
|
104
|
+
style: StyleProp<any>,
|
|
105
|
+
additionalSizeStyles?: string[]
|
|
106
|
+
) {
|
|
107
|
+
const flatStyle = StyleSheet.flatten(style || {});
|
|
108
|
+
|
|
109
|
+
const sizeStyles = pickBy(
|
|
110
|
+
pick(flatStyle, [
|
|
111
|
+
...sizeStyleNames,
|
|
112
|
+
...(additionalSizeStyles ? additionalSizeStyles : []),
|
|
113
|
+
]),
|
|
114
|
+
identity
|
|
115
|
+
);
|
|
116
|
+
|
|
117
|
+
return sizeStyles;
|
|
118
|
+
}
|
|
119
|
+
|
|
101
120
|
/**
|
|
102
121
|
* Merges a style object on top of another style object. In React Native,
|
|
103
122
|
* keys with undefined values in a style object will still override styles
|