@draftbit/core 43.7.2 → 43.8.0
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/Swiper/Swiper.js +18 -1
- package/lib/commonjs/components/Swiper/Swiper.js.map +1 -1
- package/lib/commonjs/mappings/MapView.js +17 -8
- package/lib/commonjs/mappings/MapView.js.map +1 -1
- package/lib/module/components/Swiper/Swiper.js +18 -1
- package/lib/module/components/Swiper/Swiper.js.map +1 -1
- package/lib/module/mappings/MapView.js +17 -8
- package/lib/module/mappings/MapView.js.map +1 -1
- package/lib/typescript/src/components/Swiper/Swiper.d.ts +8 -2
- package/lib/typescript/src/mappings/MapView.d.ts +12 -2
- package/package.json +3 -4
- package/src/components/Swiper/Swiper.tsx +22 -3
- package/src/mappings/MapView.ts +15 -6
- package/LICENSE +0 -21
|
@@ -26,6 +26,9 @@ const Swiper = _ref => {
|
|
|
26
26
|
dotsTouchable = true,
|
|
27
27
|
dotColor,
|
|
28
28
|
dotActiveColor,
|
|
29
|
+
data,
|
|
30
|
+
keyExtractor,
|
|
31
|
+
renderItem,
|
|
29
32
|
children,
|
|
30
33
|
style
|
|
31
34
|
} = _ref;
|
|
@@ -59,7 +62,21 @@ const Swiper = _ref => {
|
|
|
59
62
|
}
|
|
60
63
|
} : {})
|
|
61
64
|
}
|
|
62
|
-
},
|
|
65
|
+
}, data && renderItem ? data.map((item, index) => {
|
|
66
|
+
const component = renderItem({
|
|
67
|
+
item,
|
|
68
|
+
index
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
if (!component) {
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const key = keyExtractor ? keyExtractor(item, index) : index;
|
|
76
|
+
return /*#__PURE__*/_react.default.cloneElement(component, {
|
|
77
|
+
key
|
|
78
|
+
});
|
|
79
|
+
}) : children));
|
|
63
80
|
};
|
|
64
81
|
|
|
65
82
|
var _default = Swiper;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Swiper.tsx"],"names":["Swiper","vertical","loop","timeout","from","prevTitle","nextTitle","prevTitleColor","nextTitleColor","dotsTouchable","dotColor","dotActiveColor","children","style","prevTitleStyle","color","nextTitleStyle","dotProps","badgeStyle","backgroundColor","dotActiveStyle"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;;;
|
|
1
|
+
{"version":3,"sources":["Swiper.tsx"],"names":["Swiper","vertical","loop","timeout","from","prevTitle","nextTitle","prevTitleColor","nextTitleColor","dotsTouchable","dotColor","dotActiveColor","data","keyExtractor","renderItem","children","style","prevTitleStyle","color","nextTitleStyle","dotProps","badgeStyle","backgroundColor","dotActiveStyle","map","item","index","component","key","React","cloneElement"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;;;AAqBA,MAAMA,MAAM,GAAG;AAAA,MAAC;AACdC,IAAAA,QAAQ,GAAG,KADG;AAEdC,IAAAA,IAAI,GAAG,KAFO;AAGdC,IAAAA,OAAO,GAAG,CAHI;AAIdC,IAAAA,IAAI,GAAG,CAJO;AAKdC,IAAAA,SAAS,GAAG,EALE;AAMdC,IAAAA,SAAS,GAAG,EANE;AAOdC,IAAAA,cAPc;AAQdC,IAAAA,cARc;AASdC,IAAAA,aAAa,GAAG,IATF;AAUdC,IAAAA,QAVc;AAWdC,IAAAA,cAXc;AAYdC,IAAAA,IAZc;AAadC,IAAAA,YAbc;AAcdC,IAAAA,UAdc;AAedC,IAAAA,QAfc;AAgBdC,IAAAA;AAhBc,GAAD;AAAA,sBAkBb,6BAAC,iBAAD;AAAM,IAAA,KAAK,EAAEA;AAAb,kBACE,6BAAC,6BAAD;AACE,IAAA,IAAI,EAAEZ,IADR;AAEE,IAAA,IAAI,EAAEF,IAFR;AAGE,IAAA,OAAO,EAAEC,OAHX;AAIE,IAAA,QAAQ,EAAEF,QAJZ;AAKE,IAAA,aAAa,EAAE;AACbI,MAAAA,SADa;AAEbC,MAAAA,SAFa;AAGbW,MAAAA,cAAc,EAAE;AAAEC,QAAAA,KAAK,EAAEX;AAAT,OAHH;AAIbY,MAAAA,cAAc,EAAE;AAAED,QAAAA,KAAK,EAAEV;AAAT,OAJH;AAKbC,MAAAA,aALa;AAMb,UAAIC,QAAQ,GACR;AAAEU,QAAAA,QAAQ,EAAE;AAAEC,UAAAA,UAAU,EAAE;AAAEC,YAAAA,eAAe,EAAEZ;AAAnB;AAAd;AAAZ,OADQ,GAER,EAFJ,CANa;AASb,UAAIC,cAAc,GACd;AAAEY,QAAAA,cAAc,EAAE;AAAED,UAAAA,eAAe,EAAEX;AAAnB;AAAlB,OADc,GAEd,EAFJ;AATa;AALjB,KAmBGC,IAAI,IAAIE,UAAR,GACGF,IAAI,CAACY,GAAL,CAAS,CAACC,IAAD,EAAOC,KAAP,KAAiB;AACxB,UAAMC,SAAS,GAAGb,UAAU,CAAC;AAAEW,MAAAA,IAAF;AAAQC,MAAAA;AAAR,KAAD,CAA5B;;AAEA,QAAI,CAACC,SAAL,EAAgB;AACd,aAAO,IAAP;AACD;;AAED,UAAMC,GAAG,GAAGf,YAAY,GAAGA,YAAY,CAACY,IAAD,EAAOC,KAAP,CAAf,GAA+BA,KAAvD;AACA,wBAAOG,eAAMC,YAAN,CAAmBH,SAAnB,EAA8B;AACnCC,MAAAA;AADmC,KAA9B,CAAP;AAGD,GAXD,CADH,GAaGb,QAhCN,CADF,CAlBa;AAAA,CAAf;;eAwDef,M","sourcesContent":["import React from \"react\";\nimport { View, StyleProp, ViewStyle } from \"react-native\";\nimport SwiperComponent from \"react-native-web-swiper\";\n\nexport interface SwiperProps<T> {\n vertical?: boolean;\n loop?: boolean;\n from?: number;\n timeout?: number;\n prevTitle?: string;\n nextTitle?: string;\n prevTitleColor?: string;\n nextTitleColor?: string;\n dotsTouchable?: boolean;\n dotColor?: string;\n dotActiveColor?: string;\n children: React.ReactNode;\n data?: Array<T>;\n keyExtractor: (item: T, index: number) => string;\n renderItem?: ({ item, index }: { item: T; index: number }) => JSX.Element;\n style?: StyleProp<ViewStyle>;\n}\n\nconst Swiper = ({\n vertical = false,\n loop = false,\n timeout = 0,\n from = 0,\n prevTitle = \"\",\n nextTitle = \"\",\n prevTitleColor,\n nextTitleColor,\n dotsTouchable = true,\n dotColor,\n dotActiveColor,\n data,\n keyExtractor,\n renderItem,\n children,\n style,\n}: SwiperProps<any>) => (\n <View style={style}>\n <SwiperComponent\n from={from}\n loop={loop}\n timeout={timeout}\n vertical={vertical}\n controlsProps={{\n prevTitle,\n nextTitle,\n prevTitleStyle: { color: prevTitleColor },\n nextTitleStyle: { color: nextTitleColor },\n dotsTouchable,\n ...(dotColor\n ? { dotProps: { badgeStyle: { backgroundColor: dotColor } } }\n : {}),\n ...(dotActiveColor\n ? { dotActiveStyle: { backgroundColor: dotActiveColor } }\n : {}),\n }}\n >\n {data && renderItem\n ? data.map((item, index) => {\n const component = renderItem({ item, index });\n\n if (!component) {\n return null;\n }\n\n const key = keyExtractor ? keyExtractor(item, index) : index;\n return React.cloneElement(component, {\n key,\n });\n })\n : children}\n </SwiperComponent>\n </View>\n);\n\nexport default Swiper;\n"]}
|
|
@@ -110,17 +110,26 @@ const SEED_DATA = {
|
|
|
110
110
|
label: "Loading BG Color",
|
|
111
111
|
description: "Color of the background to show while the map is loading"
|
|
112
112
|
}),
|
|
113
|
-
|
|
114
|
-
label: "
|
|
115
|
-
description: "Whether to
|
|
113
|
+
showsUserLocation: (0, _types.createBoolProp)({
|
|
114
|
+
label: "Shows User Location",
|
|
115
|
+
description: "Whether to show the user's location on the map",
|
|
116
116
|
required: false,
|
|
117
|
-
defaultValue: null
|
|
117
|
+
defaultValue: null,
|
|
118
|
+
group: _types.GROUPS.basic
|
|
118
119
|
}),
|
|
119
|
-
|
|
120
|
-
label: "
|
|
121
|
-
description: "Whether to set the map region to the user's location
|
|
120
|
+
followsUserLocation: (0, _types.createBoolProp)({
|
|
121
|
+
label: "Follows User Location (iOS only)",
|
|
122
|
+
description: "Whether to set the map region to follow the user's location",
|
|
122
123
|
required: false,
|
|
123
|
-
defaultValue: null
|
|
124
|
+
defaultValue: null,
|
|
125
|
+
group: _types.GROUPS.basic
|
|
126
|
+
}),
|
|
127
|
+
showsPointsOfInterest: (0, _types.createBoolProp)({
|
|
128
|
+
label: "Shows Points of Interest",
|
|
129
|
+
description: "Whether to show points of interest on the map.",
|
|
130
|
+
required: false,
|
|
131
|
+
defaultValue: true,
|
|
132
|
+
group: _types.GROUPS.basic
|
|
124
133
|
}),
|
|
125
134
|
apiKey: (0, _types.createTextProp)({
|
|
126
135
|
defaultValue: process.env.GOOGLE_MAPS_API_KEY,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["MapView.ts"],"names":["SEED_DATA","name","tag","packageName","description","category","COMPONENT_TYPES","media","layout","flex","props","provider","formType","FORM_TYPES","flatArray","propType","PROP_TYPES","STRING","editable","group","GROUPS","basic","label","required","defaultValue","options","latitude","precision","min","max","longitude","zoom","step","mapType","zoomEnabled","showsCompass","rotateEnabled","scrollEnabled","loadingEnabled","loadingIndicatorColor","loadingBackgroundColor","
|
|
1
|
+
{"version":3,"sources":["MapView.ts"],"names":["SEED_DATA","name","tag","packageName","description","category","COMPONENT_TYPES","media","layout","flex","props","provider","formType","FORM_TYPES","flatArray","propType","PROP_TYPES","STRING","editable","group","GROUPS","basic","label","required","defaultValue","options","latitude","precision","min","max","longitude","zoom","step","mapType","zoomEnabled","showsCompass","rotateEnabled","scrollEnabled","loadingEnabled","loadingIndicatorColor","loadingBackgroundColor","showsUserLocation","followsUserLocation","showsPointsOfInterest","apiKey","process","env","GOOGLE_MAPS_API_KEY"],"mappings":";;;;;;;AAAA;;AAWO,MAAMA,SAAS,GAAG;AACvBC,EAAAA,IAAI,EAAE,UADiB;AAEvBC,EAAAA,GAAG,EAAE,SAFkB;AAGvBC,EAAAA,WAAW,EAAE,gBAHU;AAIvBC,EAAAA,WAAW,EAAE,YAJU;AAKvBC,EAAAA,QAAQ,EAAEC,uBAAgBC,KALH;AAMvBC,E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AAe;AACpCrB,MAAAA,KAAK,EAAE,0BAD6B;AAEpClB,MAAAA,WAAW,EAAE,gDAFuB;AAGpCmB,MAAAA,QAAQ,EAAE,KAH0B;AAIpCC,MAAAA,YAAY,EAAE,IAJsB;AAKpCL,MAAAA,KAAK,EAAEC,cAAOC;AALsB,KAAf,CArHlB;AA4HLuB,IAAAA,MAAM,EAAE,2BAAe;AACrBpB,MAAAA,YAAY,EAAEqB,OAAO,CAACC,GAAR,CAAYC,mBADL;AAErB7B,MAAAA,QAAQ,EAAE;AAFW,KAAf;AA5HH;AATgB,CAAlB","sourcesContent":["import {\n COMPONENT_TYPES,\n createBoolProp,\n createColorProp,\n createNumberProp,\n createTextProp,\n GROUPS,\n FORM_TYPES,\n PROP_TYPES,\n} from \"@draftbit/types\";\n\nexport const SEED_DATA = {\n name: \"Map View\",\n tag: \"MapView\",\n packageName: \"@draftbit/maps\",\n description: \"A map view\",\n category: COMPONENT_TYPES.media,\n layout: {\n flex: 1,\n },\n props: {\n provider: {\n formType: FORM_TYPES.flatArray,\n propType: PROP_TYPES.STRING,\n editable: true,\n group: GROUPS.basic,\n label: \"Provider\",\n description: \"The maps provider\",\n required: false,\n defaultValue: null,\n options: [\"google\"],\n },\n latitude: createNumberProp({\n label: \"Initial Latitude\",\n description: \"The longitude for the map's initial region\",\n required: false,\n precision: 6,\n min: -90,\n max: 90,\n defaultValue: 37.40241,\n }),\n longitude: createNumberProp({\n label: \"Initial Longitude\",\n description: \"The longitude for the map's initial region\",\n required: false,\n precision: 6,\n min: -180,\n max: 180,\n defaultValue: -122.12125,\n }),\n zoom: createNumberProp({\n label: \"Initial Zoom\",\n description: \"The initial zoom of the map\",\n required: true,\n precision: 0,\n step: 1,\n defaultValue: 8,\n min: 0,\n max: 22,\n group: GROUPS.basic,\n }),\n mapType: {\n label: \"Map Type\",\n description: \"The type of map to show\",\n group: GROUPS.basic,\n formType: FORM_TYPES.flatArray,\n propType: PROP_TYPES.STRING,\n required: false,\n defaultValue: null,\n options: [\n \"standard\",\n \"satellite\",\n \"hybrid\",\n \"terrain\",\n \"none\",\n \"mutedStandard\",\n ],\n },\n zoomEnabled: createBoolProp({\n label: \"Zoom Enabled\",\n description: \"Whether zooming is enabled (native only)\",\n group: GROUPS.basic,\n required: false,\n defaultValue: true,\n }),\n showsCompass: createBoolProp({\n label: \"Shows Compass\",\n description: \"Whether compass is shown\",\n group: GROUPS.basic,\n required: false,\n defaultValue: false,\n }),\n rotateEnabled: createBoolProp({\n label: \"Rotate Enabled\",\n description: \"Whether rotating the map is enabled\",\n group: GROUPS.basic,\n required: false,\n defaultValue: true,\n }),\n scrollEnabled: createBoolProp({\n label: \"Pan Enabled\",\n description: \"Whether panning the map view is enabled\",\n group: GROUPS.basic,\n required: false,\n defaultValue: true,\n }),\n loadingEnabled: createBoolProp({\n label: \"Loading Enabled\",\n description:\n \"If true a loading indicator will show while the map is loading\",\n group: GROUPS.basic,\n required: false,\n defaultValue: true,\n }),\n loadingIndicatorColor: createColorProp({\n label: \"Loading Indicator Color\",\n description: \"Color of the loading indicator\",\n }),\n loadingBackgroundColor: createColorProp({\n label: \"Loading BG Color\",\n description: \"Color of the background to show while the map is loading\",\n }),\n showsUserLocation: createBoolProp({\n label: \"Shows User Location\",\n description: \"Whether to show the user's location on the map\",\n required: false,\n defaultValue: null,\n group: GROUPS.basic,\n }),\n followsUserLocation: createBoolProp({\n label: \"Follows User Location (iOS only)\",\n description:\n \"Whether to set the map region to follow the user's location\",\n required: false,\n defaultValue: null,\n group: GROUPS.basic,\n }),\n showsPointsOfInterest: createBoolProp({\n label: \"Shows Points of Interest\",\n description: \"Whether to show points of interest on the map.\",\n required: false,\n defaultValue: true,\n group: GROUPS.basic,\n }),\n apiKey: createTextProp({\n defaultValue: process.env.GOOGLE_MAPS_API_KEY,\n editable: false,\n }),\n },\n};\n"]}
|
|
@@ -15,6 +15,9 @@ const Swiper = _ref => {
|
|
|
15
15
|
dotsTouchable = true,
|
|
16
16
|
dotColor,
|
|
17
17
|
dotActiveColor,
|
|
18
|
+
data,
|
|
19
|
+
keyExtractor,
|
|
20
|
+
renderItem,
|
|
18
21
|
children,
|
|
19
22
|
style
|
|
20
23
|
} = _ref;
|
|
@@ -48,7 +51,21 @@ const Swiper = _ref => {
|
|
|
48
51
|
}
|
|
49
52
|
} : {})
|
|
50
53
|
}
|
|
51
|
-
},
|
|
54
|
+
}, data && renderItem ? data.map((item, index) => {
|
|
55
|
+
const component = renderItem({
|
|
56
|
+
item,
|
|
57
|
+
index
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
if (!component) {
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const key = keyExtractor ? keyExtractor(item, index) : index;
|
|
65
|
+
return /*#__PURE__*/React.cloneElement(component, {
|
|
66
|
+
key
|
|
67
|
+
});
|
|
68
|
+
}) : children));
|
|
52
69
|
};
|
|
53
70
|
|
|
54
71
|
export default Swiper;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Swiper.tsx"],"names":["React","View","SwiperComponent","Swiper","vertical","loop","timeout","from","prevTitle","nextTitle","prevTitleColor","nextTitleColor","dotsTouchable","dotColor","dotActiveColor","children","style","prevTitleStyle","color","nextTitleStyle","dotProps","badgeStyle","backgroundColor","dotActiveStyle"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,IAAT,QAA2C,cAA3C;AACA,OAAOC,eAAP,MAA4B,yBAA5B;;
|
|
1
|
+
{"version":3,"sources":["Swiper.tsx"],"names":["React","View","SwiperComponent","Swiper","vertical","loop","timeout","from","prevTitle","nextTitle","prevTitleColor","nextTitleColor","dotsTouchable","dotColor","dotActiveColor","data","keyExtractor","renderItem","children","style","prevTitleStyle","color","nextTitleStyle","dotProps","badgeStyle","backgroundColor","dotActiveStyle","map","item","index","component","key","cloneElement"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,IAAT,QAA2C,cAA3C;AACA,OAA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,EAAOC,KAAP,KAAiB;AACxB,UAAMC,SAAS,GAAGb,UAAU,CAAC;AAAEW,MAAAA,IAAF;AAAQC,MAAAA;AAAR,KAAD,CAA5B;;AAEA,QAAI,CAACC,SAAL,EAAgB;AACd,aAAO,IAAP;AACD;;AAED,UAAMC,GAAG,GAAGf,YAAY,GAAGA,YAAY,CAACY,IAAD,EAAOC,KAAP,CAAf,GAA+BA,KAAvD;AACA,wBAAO7B,KAAK,CAACgC,YAAN,CAAmBF,SAAnB,EAA8B;AACnCC,MAAAA;AADmC,KAA9B,CAAP;AAGD,GAXD,CADH,GAaGb,QAhCN,CADF,CAlBa;AAAA,CAAf;;AAwDA,eAAef,MAAf","sourcesContent":["import React from \"react\";\nimport { View, StyleProp, ViewStyle } from \"react-native\";\nimport SwiperComponent from \"react-native-web-swiper\";\n\nexport interface SwiperProps<T> {\n vertical?: boolean;\n loop?: boolean;\n from?: number;\n timeout?: number;\n prevTitle?: string;\n nextTitle?: string;\n prevTitleColor?: string;\n nextTitleColor?: string;\n dotsTouchable?: boolean;\n dotColor?: string;\n dotActiveColor?: string;\n children: React.ReactNode;\n data?: Array<T>;\n keyExtractor: (item: T, index: number) => string;\n renderItem?: ({ item, index }: { item: T; index: number }) => JSX.Element;\n style?: StyleProp<ViewStyle>;\n}\n\nconst Swiper = ({\n vertical = false,\n loop = false,\n timeout = 0,\n from = 0,\n prevTitle = \"\",\n nextTitle = \"\",\n prevTitleColor,\n nextTitleColor,\n dotsTouchable = true,\n dotColor,\n dotActiveColor,\n data,\n keyExtractor,\n renderItem,\n children,\n style,\n}: SwiperProps<any>) => (\n <View style={style}>\n <SwiperComponent\n from={from}\n loop={loop}\n timeout={timeout}\n vertical={vertical}\n controlsProps={{\n prevTitle,\n nextTitle,\n prevTitleStyle: { color: prevTitleColor },\n nextTitleStyle: { color: nextTitleColor },\n dotsTouchable,\n ...(dotColor\n ? { dotProps: { badgeStyle: { backgroundColor: dotColor } } }\n : {}),\n ...(dotActiveColor\n ? { dotActiveStyle: { backgroundColor: dotActiveColor } }\n : {}),\n }}\n >\n {data && renderItem\n ? data.map((item, index) => {\n const component = renderItem({ item, index });\n\n if (!component) {\n return null;\n }\n\n const key = keyExtractor ? keyExtractor(item, index) : index;\n return React.cloneElement(component, {\n key,\n });\n })\n : children}\n </SwiperComponent>\n </View>\n);\n\nexport default Swiper;\n"]}
|
|
@@ -102,17 +102,26 @@ export const SEED_DATA = {
|
|
|
102
102
|
label: "Loading BG Color",
|
|
103
103
|
description: "Color of the background to show while the map is loading"
|
|
104
104
|
}),
|
|
105
|
-
|
|
106
|
-
label: "
|
|
107
|
-
description: "Whether to
|
|
105
|
+
showsUserLocation: createBoolProp({
|
|
106
|
+
label: "Shows User Location",
|
|
107
|
+
description: "Whether to show the user's location on the map",
|
|
108
108
|
required: false,
|
|
109
|
-
defaultValue: null
|
|
109
|
+
defaultValue: null,
|
|
110
|
+
group: GROUPS.basic
|
|
110
111
|
}),
|
|
111
|
-
|
|
112
|
-
label: "
|
|
113
|
-
description: "Whether to set the map region to the user's location
|
|
112
|
+
followsUserLocation: createBoolProp({
|
|
113
|
+
label: "Follows User Location (iOS only)",
|
|
114
|
+
description: "Whether to set the map region to follow the user's location",
|
|
114
115
|
required: false,
|
|
115
|
-
defaultValue: null
|
|
116
|
+
defaultValue: null,
|
|
117
|
+
group: GROUPS.basic
|
|
118
|
+
}),
|
|
119
|
+
showsPointsOfInterest: createBoolProp({
|
|
120
|
+
label: "Shows Points of Interest",
|
|
121
|
+
description: "Whether to show points of interest on the map.",
|
|
122
|
+
required: false,
|
|
123
|
+
defaultValue: true,
|
|
124
|
+
group: GROUPS.basic
|
|
116
125
|
}),
|
|
117
126
|
apiKey: createTextProp({
|
|
118
127
|
defaultValue: process.env.GOOGLE_MAPS_API_KEY,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["MapView.ts"],"names":["COMPONENT_TYPES","createBoolProp","createColorProp","createNumberProp","createTextProp","GROUPS","FORM_TYPES","PROP_TYPES","SEED_DATA","name","tag","packageName","description","category","media","layout","flex","props","provider","formType","flatArray","propType","STRING","editable","group","basic","label","required","defaultValue","options","latitude","precision","min","max","longitude","zoom","step","mapType","zoomEnabled","showsCompass","rotateEnabled","scrollEnabled","loadingEnabled","loadingIndicatorColor","loadingBackgroundColor","
|
|
1
|
+
{"version":3,"sources":["MapView.ts"],"names":["COMPONENT_TYPES","createBoolProp","createColorProp","createNumberProp","createTextProp","GROUPS","FORM_TYPES","PROP_TYPES","SEED_DATA","name","tag","packageName","description","category","media","layout","flex","props","provider","formType","flatArray","propType","STRING","editable","group","basic","label","required","defaultValue","options","latitude","precision","min","max","longitude","zoom","step","mapType","zoomEnabled","showsCompass","rotateEnabled","scrollEnabled","loadingEnabled","loadingIndicatorColor","loadingBackgroundColor","showsUserLocation","followsUserLocation","showsPointsOfInterest","apiKey","process","env","GOOGLE_MAPS_API_KEY"],"mappings":"AAAA,SACEA,eADF,EAEEC,cAFF,EAGEC,eAHF,EAIEC,gBAJF,EAKEC,cALF,EAMEC,MANF,EAOEC,UAPF,EAQEC,UARF,QASO,iBATP;AAWA,OAAO,MAAMC,SAAS,GAAG;AACvBC,EAAAA,IAAI,EAAE,UADiB;AAEvBC,EAAAA,GAAG,EAAE,SAFkB;AAGvBC,EAAAA,WAAW,EAAE,gBAHU;AAIvBC,EAAAA,WAAW,EAAE,YAJU;AAKvBC,EAAAA,QAAQ,EAAEb,eAAe,CAACc,KALH;AAMvBC,EAAAA,MAAM,EAAE;AACNC,IAAAA,IAAI,EAAE;AADA,GANe;AASvBC,EAAAA,KAAK,EAAE;AACLC,IAAAA,QAAQ,EAAE;AACRC,MAAAA,QAAQ,EAAEb,UAAU,CAACc,SADb;AAERC,MAAAA,QAAQ,EAAEd,UAAU,CAACe,MAFb;AAGRC,MAAAA,QAAQ,EAAE,IAHF;AAIRC,MAAAA,KAAK,EAAEnB,MAAM,CAACoB,KAJN;AAKRC,MAAAA,KAAK,EAAE,UALC;AAMRd,MAAAA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sB;AAKpCJ,MAAAA,KAAK,EAAEnB,MAAM,CAACoB;AALsB,KAAD,CArHhC;AA4HLuB,IAAAA,MAAM,EAAE5C,cAAc,CAAC;AACrBwB,MAAAA,YAAY,EAAEqB,OAAO,CAACC,GAAR,CAAYC,mBADL;AAErB5B,MAAAA,QAAQ,EAAE;AAFW,KAAD;AA5HjB;AATgB,CAAlB","sourcesContent":["import {\n COMPONENT_TYPES,\n createBoolProp,\n createColorProp,\n createNumberProp,\n createTextProp,\n GROUPS,\n FORM_TYPES,\n PROP_TYPES,\n} from \"@draftbit/types\";\n\nexport const SEED_DATA = {\n name: \"Map View\",\n tag: \"MapView\",\n packageName: \"@draftbit/maps\",\n description: \"A map view\",\n category: COMPONENT_TYPES.media,\n layout: {\n flex: 1,\n },\n props: {\n provider: {\n formType: FORM_TYPES.flatArray,\n propType: PROP_TYPES.STRING,\n editable: true,\n group: GROUPS.basic,\n label: \"Provider\",\n description: \"The maps provider\",\n required: false,\n defaultValue: null,\n options: [\"google\"],\n },\n latitude: createNumberProp({\n label: \"Initial Latitude\",\n description: \"The longitude for the map's initial region\",\n required: false,\n precision: 6,\n min: -90,\n max: 90,\n defaultValue: 37.40241,\n }),\n longitude: createNumberProp({\n label: \"Initial Longitude\",\n description: \"The longitude for the map's initial region\",\n required: false,\n precision: 6,\n min: -180,\n max: 180,\n defaultValue: -122.12125,\n }),\n zoom: createNumberProp({\n label: \"Initial Zoom\",\n description: \"The initial zoom of the map\",\n required: true,\n precision: 0,\n step: 1,\n defaultValue: 8,\n min: 0,\n max: 22,\n group: GROUPS.basic,\n }),\n mapType: {\n label: \"Map Type\",\n description: \"The type of map to show\",\n group: GROUPS.basic,\n formType: FORM_TYPES.flatArray,\n propType: PROP_TYPES.STRING,\n required: false,\n defaultValue: null,\n options: [\n \"standard\",\n \"satellite\",\n \"hybrid\",\n \"terrain\",\n \"none\",\n \"mutedStandard\",\n ],\n },\n zoomEnabled: createBoolProp({\n label: \"Zoom Enabled\",\n description: \"Whether zooming is enabled (native only)\",\n group: GROUPS.basic,\n required: false,\n defaultValue: true,\n }),\n showsCompass: createBoolProp({\n label: \"Shows Compass\",\n description: \"Whether compass is shown\",\n group: GROUPS.basic,\n required: false,\n defaultValue: false,\n }),\n rotateEnabled: createBoolProp({\n label: \"Rotate Enabled\",\n description: \"Whether rotating the map is enabled\",\n group: GROUPS.basic,\n required: false,\n defaultValue: true,\n }),\n scrollEnabled: createBoolProp({\n label: \"Pan Enabled\",\n description: \"Whether panning the map view is enabled\",\n group: GROUPS.basic,\n required: false,\n defaultValue: true,\n }),\n loadingEnabled: createBoolProp({\n label: \"Loading Enabled\",\n description:\n \"If true a loading indicator will show while the map is loading\",\n group: GROUPS.basic,\n required: false,\n defaultValue: true,\n }),\n loadingIndicatorColor: createColorProp({\n label: \"Loading Indicator Color\",\n description: \"Color of the loading indicator\",\n }),\n loadingBackgroundColor: createColorProp({\n label: \"Loading BG Color\",\n description: \"Color of the background to show while the map is loading\",\n }),\n showsUserLocation: createBoolProp({\n label: \"Shows User Location\",\n description: \"Whether to show the user's location on the map\",\n required: false,\n defaultValue: null,\n group: GROUPS.basic,\n }),\n followsUserLocation: createBoolProp({\n label: \"Follows User Location (iOS only)\",\n description:\n \"Whether to set the map region to follow the user's location\",\n required: false,\n defaultValue: null,\n group: GROUPS.basic,\n }),\n showsPointsOfInterest: createBoolProp({\n label: \"Shows Points of Interest\",\n description: \"Whether to show points of interest on the map.\",\n required: false,\n defaultValue: true,\n group: GROUPS.basic,\n }),\n apiKey: createTextProp({\n defaultValue: process.env.GOOGLE_MAPS_API_KEY,\n editable: false,\n }),\n },\n};\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { StyleProp, ViewStyle } from "react-native";
|
|
3
|
-
export interface SwiperProps {
|
|
3
|
+
export interface SwiperProps<T> {
|
|
4
4
|
vertical?: boolean;
|
|
5
5
|
loop?: boolean;
|
|
6
6
|
from?: number;
|
|
@@ -13,7 +13,13 @@ export interface SwiperProps {
|
|
|
13
13
|
dotColor?: string;
|
|
14
14
|
dotActiveColor?: string;
|
|
15
15
|
children: React.ReactNode;
|
|
16
|
+
data?: Array<T>;
|
|
17
|
+
keyExtractor: (item: T, index: number) => string;
|
|
18
|
+
renderItem?: ({ item, index }: {
|
|
19
|
+
item: T;
|
|
20
|
+
index: number;
|
|
21
|
+
}) => JSX.Element;
|
|
16
22
|
style?: StyleProp<ViewStyle>;
|
|
17
23
|
}
|
|
18
|
-
declare const Swiper: ({ vertical, loop, timeout, from, prevTitle, nextTitle, prevTitleColor, nextTitleColor, dotsTouchable, dotColor, dotActiveColor, children, style, }: SwiperProps) => JSX.Element;
|
|
24
|
+
declare const Swiper: ({ vertical, loop, timeout, from, prevTitle, nextTitle, prevTitleColor, nextTitleColor, dotsTouchable, dotColor, dotActiveColor, data, keyExtractor, renderItem, children, style, }: SwiperProps<any>) => JSX.Element;
|
|
19
25
|
export default Swiper;
|
|
@@ -132,7 +132,7 @@ export declare const SEED_DATA: {
|
|
|
132
132
|
formType: string;
|
|
133
133
|
propType: string;
|
|
134
134
|
};
|
|
135
|
-
|
|
135
|
+
showsUserLocation: {
|
|
136
136
|
label: string;
|
|
137
137
|
description: string;
|
|
138
138
|
formType: string;
|
|
@@ -142,7 +142,17 @@ export declare const SEED_DATA: {
|
|
|
142
142
|
required: boolean;
|
|
143
143
|
group: string;
|
|
144
144
|
};
|
|
145
|
-
|
|
145
|
+
followsUserLocation: {
|
|
146
|
+
label: string;
|
|
147
|
+
description: string;
|
|
148
|
+
formType: string;
|
|
149
|
+
propType: string;
|
|
150
|
+
defaultValue: boolean;
|
|
151
|
+
editable: boolean;
|
|
152
|
+
required: boolean;
|
|
153
|
+
group: string;
|
|
154
|
+
};
|
|
155
|
+
showsPointsOfInterest: {
|
|
146
156
|
label: string;
|
|
147
157
|
description: string;
|
|
148
158
|
formType: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@draftbit/core",
|
|
3
|
-
"version": "43.
|
|
3
|
+
"version": "43.8.0",
|
|
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": "^43.
|
|
44
|
+
"@draftbit/types": "^43.8.0",
|
|
45
45
|
"@material-ui/core": "^4.11.0",
|
|
46
46
|
"@material-ui/pickers": "^3.2.10",
|
|
47
47
|
"@react-native-community/slider": "4.1.7",
|
|
@@ -79,6 +79,5 @@
|
|
|
79
79
|
}
|
|
80
80
|
]
|
|
81
81
|
]
|
|
82
|
-
}
|
|
83
|
-
"gitHead": "ce71c4f1b10d8bcd5ca401e53b4b25606181c2ca"
|
|
82
|
+
}
|
|
84
83
|
}
|
|
@@ -2,7 +2,7 @@ import React from "react";
|
|
|
2
2
|
import { View, StyleProp, ViewStyle } from "react-native";
|
|
3
3
|
import SwiperComponent from "react-native-web-swiper";
|
|
4
4
|
|
|
5
|
-
export interface SwiperProps {
|
|
5
|
+
export interface SwiperProps<T> {
|
|
6
6
|
vertical?: boolean;
|
|
7
7
|
loop?: boolean;
|
|
8
8
|
from?: number;
|
|
@@ -15,6 +15,9 @@ export interface SwiperProps {
|
|
|
15
15
|
dotColor?: string;
|
|
16
16
|
dotActiveColor?: string;
|
|
17
17
|
children: React.ReactNode;
|
|
18
|
+
data?: Array<T>;
|
|
19
|
+
keyExtractor: (item: T, index: number) => string;
|
|
20
|
+
renderItem?: ({ item, index }: { item: T; index: number }) => JSX.Element;
|
|
18
21
|
style?: StyleProp<ViewStyle>;
|
|
19
22
|
}
|
|
20
23
|
|
|
@@ -30,9 +33,12 @@ const Swiper = ({
|
|
|
30
33
|
dotsTouchable = true,
|
|
31
34
|
dotColor,
|
|
32
35
|
dotActiveColor,
|
|
36
|
+
data,
|
|
37
|
+
keyExtractor,
|
|
38
|
+
renderItem,
|
|
33
39
|
children,
|
|
34
40
|
style,
|
|
35
|
-
}: SwiperProps) => (
|
|
41
|
+
}: SwiperProps<any>) => (
|
|
36
42
|
<View style={style}>
|
|
37
43
|
<SwiperComponent
|
|
38
44
|
from={from}
|
|
@@ -53,7 +59,20 @@ const Swiper = ({
|
|
|
53
59
|
: {}),
|
|
54
60
|
}}
|
|
55
61
|
>
|
|
56
|
-
{
|
|
62
|
+
{data && renderItem
|
|
63
|
+
? data.map((item, index) => {
|
|
64
|
+
const component = renderItem({ item, index });
|
|
65
|
+
|
|
66
|
+
if (!component) {
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const key = keyExtractor ? keyExtractor(item, index) : index;
|
|
71
|
+
return React.cloneElement(component, {
|
|
72
|
+
key,
|
|
73
|
+
});
|
|
74
|
+
})
|
|
75
|
+
: children}
|
|
57
76
|
</SwiperComponent>
|
|
58
77
|
</View>
|
|
59
78
|
);
|
package/src/mappings/MapView.ts
CHANGED
|
@@ -120,18 +120,27 @@ export const SEED_DATA = {
|
|
|
120
120
|
label: "Loading BG Color",
|
|
121
121
|
description: "Color of the background to show while the map is loading",
|
|
122
122
|
}),
|
|
123
|
-
|
|
124
|
-
label: "
|
|
125
|
-
description: "Whether to
|
|
123
|
+
showsUserLocation: createBoolProp({
|
|
124
|
+
label: "Shows User Location",
|
|
125
|
+
description: "Whether to show the user's location on the map",
|
|
126
126
|
required: false,
|
|
127
127
|
defaultValue: null,
|
|
128
|
+
group: GROUPS.basic,
|
|
128
129
|
}),
|
|
129
|
-
|
|
130
|
-
label: "
|
|
130
|
+
followsUserLocation: createBoolProp({
|
|
131
|
+
label: "Follows User Location (iOS only)",
|
|
131
132
|
description:
|
|
132
|
-
"Whether to set the map region to the user's location
|
|
133
|
+
"Whether to set the map region to follow the user's location",
|
|
133
134
|
required: false,
|
|
134
135
|
defaultValue: null,
|
|
136
|
+
group: GROUPS.basic,
|
|
137
|
+
}),
|
|
138
|
+
showsPointsOfInterest: createBoolProp({
|
|
139
|
+
label: "Shows Points of Interest",
|
|
140
|
+
description: "Whether to show points of interest on the map.",
|
|
141
|
+
required: false,
|
|
142
|
+
defaultValue: true,
|
|
143
|
+
group: GROUPS.basic,
|
|
135
144
|
}),
|
|
136
145
|
apiKey: createTextProp({
|
|
137
146
|
defaultValue: process.env.GOOGLE_MAPS_API_KEY,
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2020 Draftbit
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|