@draftbit/core 44.0.6-a68a67.1 → 44.1.1
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/ActionSheet/ActionSheetItem.js.map +1 -1
- package/lib/commonjs/components/Swiper/Swiper.js +15 -6
- package/lib/commonjs/components/Swiper/Swiper.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/mappings/Fetch.js.map +1 -1
- package/lib/commonjs/mappings/Surface.js.map +1 -1
- package/lib/commonjs/styles/fonts.js.map +1 -1
- package/lib/module/components/Swiper/Swiper.js +15 -6
- package/lib/module/components/Swiper/Swiper.js.map +1 -1
- package/package.json +3 -3
- package/src/components/Swiper/Swiper.js +10 -3
- package/src/components/Swiper/Swiper.tsx +12 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["ActionSheetItem.
|
|
1
|
+
{"version":3,"sources":["ActionSheetItem.tsx"],"names":["ActionSheetItem","label","style","color","onPress","textStyles","viewStyles","styles","wrapper","StyleSheet","create","borderBottomWidth","hairlineWidth","borderBottomColor","backgroundColor","minHeight","overflow","display","justifyContent","fontSize","textAlign","fontWeight","paddingHorizontal","paddingVertical","alignSelf"],"mappings":";;;;;;;AAAA;;AACA;;AAQA;;;;AASA,MAAMA,eAAgC,GAAG,QAAsC;AAAA,MAArC;AAAEC,IAAAA,KAAF;AAASC,IAAAA,KAAT;AAAgBC,IAAAA,KAAhB;AAAuBC,IAAAA;AAAvB,GAAqC;AAC7E,QAAM;AAAEC,IAAAA,UAAF;AAAcC,IAAAA;AAAd,MAA6B,8BAAcJ,KAAd,CAAnC;AACA,sBACE,6BAAC,6BAAD;AACE,IAAA,aAAa,EAAE,GADjB;AAEE,IAAA,KAAK,EAAE,CAACK,MAAM,CAACC,OAAR,EAAiBF,UAAjB,CAFT;AAGE,IAAA,OAAO,EAAEF;AAHX,kBAKE,6BAAC,iBAAD;AAAM,IAAA,KAAK,EAAE,CAACG,MAAM,CAACN,KAAR,EAAeI,UAAf,EAA2B;AAAEF,MAAAA;AAAF,KAA3B;AAAb,KAAqDF,KAArD,CALF,CADF;AASD,CAXD;;AAaA,MAAMM,MAAM,GAAGE,wBAAWC,MAAX,CAAkB;AAC/BF,EAAAA,OAAO,EAAE;AACPG,IAAAA,iBAAiB,EAAEF,wBAAWG,aADvB;AAEPC,IAAAA,iBAAiB,EAAE,SAFZ;AAGPC,IAAAA,eAAe,EAAE,SAHV;AAIPC,IAAAA,SAAS,EAAE,EAJJ;AAKPC,IAAAA,QAAQ,EAAE,QALH;AAMPC,IAAAA,OAAO,EAAE,MANF;AAOPC,IAAAA,cAAc,EAAE;AAPT,GADsB;AAU/BjB,EAAAA,KAAK,EAAE;AACLkB,IAAAA,QAAQ,EAAE,EADL;AAELC,IAAAA,SAAS,EAAE,QAFN;AAGLjB,IAAAA,KAAK,EAAE,SAHF;AAILkB,IAAAA,UAAU,EAAE,KAJP;AAKLL,IAAAA,QAAQ,EAAE,QALL;AAMLM,IAAAA,iBAAiB,EAAE,EANd;AAOLC,IAAAA,eAAe,EAAE,EAPZ;AAQLC,IAAAA,SAAS,EAAE;AARN;AAVwB,CAAlB,CAAf;;eAsBexB,e","sourcesContent":["import React from \"react\";\nimport {\n Text,\n StyleSheet,\n StyleProp,\n TouchableOpacity,\n ViewStyle,\n TextStyle,\n} from \"react-native\";\nimport { extractStyles } from \"../../utilities\";\n\ntype Props = {\n label: string;\n color: string;\n style?: StyleProp<ViewStyle | TextStyle>;\n onPress?: () => void;\n};\n\nconst ActionSheetItem: React.FC<Props> = ({ label, style, color, onPress }) => {\n const { textStyles, viewStyles } = extractStyles(style);\n return (\n <TouchableOpacity\n activeOpacity={0.7}\n style={[styles.wrapper, viewStyles]}\n onPress={onPress}\n >\n <Text style={[styles.label, textStyles, { color }]}>{label}</Text>\n </TouchableOpacity>\n );\n};\n\nconst styles = StyleSheet.create({\n wrapper: {\n borderBottomWidth: StyleSheet.hairlineWidth,\n borderBottomColor: \"#CCCCCC\",\n backgroundColor: \"#F1F1F1\",\n minHeight: 50,\n overflow: \"hidden\",\n display: \"flex\",\n justifyContent: \"center\",\n },\n label: {\n fontSize: 16,\n textAlign: \"center\",\n color: \"#0A84FF\",\n fontWeight: \"500\",\n overflow: \"hidden\",\n paddingHorizontal: 20,\n paddingVertical: 10,\n alignSelf: \"center\",\n },\n});\n\nexport default ActionSheetItem;\n"]}
|
|
@@ -62,12 +62,21 @@ const Swiper = _ref => {
|
|
|
62
62
|
}
|
|
63
63
|
} : {})
|
|
64
64
|
}
|
|
65
|
-
}, data && renderItem ? data.map((item, index) =>
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
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));
|
|
71
80
|
};
|
|
72
81
|
|
|
73
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","data","keyExtractor","renderItem","children","style","prevTitleStyle","color","nextTitleStyle","dotProps","badgeStyle","backgroundColor","dotActiveStyle","map","item","index","
|
|
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"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.
|
|
1
|
+
{"version":3,"sources":["index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AAEA;;AASA;;AAQA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA","sourcesContent":["export { injectIcon } from \"./interfaces/Icon\";\nexport { withTheme, ThemeProvider } from \"./theming\";\nexport { default as Provider } from \"./Provider\";\nexport { default as DefaultTheme } from \"./styles/DefaultTheme\";\n\nexport { Link } from \"./components/Text\";\nexport { default as Banner } from \"./components/Banner\";\nexport { ButtonSolid, ButtonOutline } from \"./components/Button\";\nexport { default as Avatar } from \"./components/CircleImage\";\nexport { default as AvatarEdit } from \"./components/AvatarEdit\";\nexport { default as Card } from \"./components/Card\";\nexport { default as Carousel } from \"./components/Carousel\";\nexport { Checkbox, CheckboxGroup, CheckboxRow } from \"./components/Checkbox\";\nexport { default as CircleImage } from \"./components/CircleImage\";\nexport { default as Container } from \"./components/Container\";\nexport { default as Divider } from \"./components/Divider\";\nexport { default as FAB } from \"./components/FAB\";\nexport { default as FieldSearchBarFull } from \"./components/FieldSearchBarFull\";\nexport { default as IconButton } from \"./components/IconButton\";\nexport { default as Image } from \"./components/Image\";\nexport { default as NumberInput } from \"./components/NumberInput\";\nexport { default as ScreenContainer } from \"./components/ScreenContainer\";\nexport { default as StarRating } from \"./components/StarRating\";\nexport { default as Surface } from \"./components/Surface\";\nexport { default as Switch, SwitchRow } from \"./components/Switch\";\nexport { default as TextField } from \"./components/TextField\";\nexport { default as ToggleButton } from \"./components/ToggleButton\";\nexport { default as Touchable } from \"./components/Touchable\";\nexport { AccordionGroup, AccordionItem } from \"./components/Accordion\";\nexport {\n ActionSheet,\n ActionSheetItem,\n ActionSheetCancel,\n} from \"./components/ActionSheet\";\nexport { Swiper, SwiperItem } from \"./components/Swiper\";\n\nexport {\n Center,\n Circle,\n Square,\n Row,\n Stack,\n Spacer,\n} from \"./components/Layout\";\n\nexport {\n RadioButton,\n RadioButtonGroup,\n RadioButtonRow,\n RadioButtonFieldGroup,\n} from \"./components/RadioButton/index\";\n\n/* Deprecated: Fix or Delete! */\nexport { default as Button } from \"./components/DeprecatedButton\";\nexport { default as CardBlock } from \"./components/CardBlock\";\nexport { default as CardContainer } from \"./components/CardContainer\";\nexport { default as CardContainerRating } from \"./components/CardContainerRating\";\nexport { default as CardInline } from \"./components/CardInline\";\nexport { default as DatePicker } from \"./components/DatePicker/DatePicker\";\nexport { default as HeaderLarge } from \"./components/HeaderLarge\";\nexport { default as HeaderMedium } from \"./components/HeaderMedium\";\nexport { default as HeaderOverline } from \"./components/HeaderOverline\";\nexport { default as Picker } from \"./components/Picker/Picker\";\nexport { default as ProgressBar } from \"./components/ProgressBar\";\nexport { default as ProgressCircle } from \"./components/ProgressCircle\";\nexport { default as RowBodyIcon } from \"./components/RowBodyIcon\";\nexport { default as RowHeadlineImageCaption } from \"./components/RowHeadlineImageCaption\";\nexport { default as RowHeadlineImageIcon } from \"./components/RowHeadlineImageIcon\";\nexport { default as Slider } from \"./components/Slider\";\nexport { default as Stepper } from \"./components/Stepper\";\nexport { useAuthState } from \"./components/useAuthState\";\n\n// a comment to fix sourcemap comment issue\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Fetch.
|
|
1
|
+
{"version":3,"sources":["Fetch.js"],"names":["SEED_DATA","name","tag","description","category","COMPONENT_TYPES","data","layout","minHeight","props"],"mappings":";;;;;;;AAAA;;AACA;AACO,MAAMA,SAAS,GAAG;AACrBC,EAAAA,IAAI,EAAE,OADe;AAErBC,EAAAA,GAAG,EAAE,OAFgB;AAGrBC,EAAAA,WAAW,EAAE,qEAHQ;AAIrBC,EAAAA,QAAQ,EAAEC,uBAAgBC,IAJL;AAKrBC,EAAAA,MAAM,EAAE;AACJC,IAAAA,SAAS,EAAE;AADP,GALa;AAQrBC,EAAAA,KAAK,EAAE;AARc,CAAlB","sourcesContent":["import { COMPONENT_TYPES } from \"@draftbit/types\";\n/* TODO remove, still used inside the builder in a weird way */\nexport const SEED_DATA = {\n name: \"Fetch\",\n tag: \"Fetch\",\n description: \"Rest API Declarative Fetch component. Uses react-request internally\",\n category: COMPONENT_TYPES.data,\n layout: {\n minHeight: 40,\n },\n props: {},\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Surface.
|
|
1
|
+
{"version":3,"sources":["Surface.ts"],"names":["SEED_DATA","name","tag","description","category","COMPONENT_TYPES","layout","minHeight","props","elevation"],"mappings":";;;;;;;AAAA;;AAEO,MAAMA,SAAS,GAAG;AACvBC,EAAAA,IAAI,EAAE,SADiB;AAEvBC,EAAAA,GAAG,EAAE,SAFkB;AAGvBC,EAAAA,WAAW,EAAE,uBAHU;AAIvBC,EAAAA,QAAQ,EAAEC,uBAAgBC,MAJH;AAKvBA,EAAAA,MAAM,EAAE;AACNC,IAAAA,SAAS,EAAE;AADL,GALe;AAQvBC,EAAAA,KAAK,EAAE;AACLC,IAAAA,SAAS,EAAE,gCAAoB,CAApB;AADN;AARgB,CAAlB","sourcesContent":["import { COMPONENT_TYPES, createElevationType } from \"@draftbit/types\";\n\nexport const SEED_DATA = {\n name: \"Surface\",\n tag: \"Surface\",\n description: \"An elevated container\",\n category: COMPONENT_TYPES.layout,\n layout: {\n minHeight: 40,\n },\n props: {\n elevation: createElevationType(0),\n },\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["fonts.
|
|
1
|
+
{"version":3,"sources":["fonts.tsx"],"names":["fontConfig","web","regular","fontFamily","fontWeight","medium","light","thin","ios","default","configureFonts","config","fonts","Platform","select"],"mappings":";;;;;;;AACA;;AADA;AAIA,MAAMA,UAAU,GAAG;AACjBC,EAAAA,GAAG,EAAE;AACHC,IAAAA,OAAO,EAAE;AACPC,MAAAA,UAAU,EAAE,wDADL;AAEPC,MAAAA,UAAU,EAAE;AAFL,KADN;AAKHC,IAAAA,MAAM,EAAE;AACNF,MAAAA,UAAU,EAAE,wDADN;AAENC,MAAAA,UAAU,EAAE;AAFN,KALL;AASHE,IAAAA,KAAK,EAAE;AACLH,MAAAA,UAAU,EAAE,wDADP;AAELC,MAAAA,UAAU,EAAE;AAFP,KATJ;AAaHG,IAAAA,IAAI,EAAE;AACJJ,MAAAA,UAAU,EAAE,wDADR;AAEJC,MAAAA,UAAU,EAAE;AAFR;AAbH,GADY;AAmBjBI,EAAAA,GAAG,EAAE;AACHN,IAAAA,OAAO,EAAE;AACPC,MAAAA,UAAU,EAAE,QADL;AAEPC,MAAAA,UAAU,EAAE;AAFL,KADN;AAKHC,IAAAA,MAAM,EAAE;AACNF,MAAAA,UAAU,EAAE,QADN;AAENC,MAAAA,UAAU,EAAE;AAFN,KALL;AASHE,IAAAA,KAAK,EAAE;AACLH,MAAAA,UAAU,EAAE,QADP;AAELC,MAAAA,UAAU,EAAE;AAFP,KATJ;AAaHG,IAAAA,IAAI,EAAE;AACJJ,MAAAA,UAAU,EAAE,QADR;AAEJC,MAAAA,UAAU,EAAE;AAFR;AAbH,GAnBY;AAqCjBK,EAAAA,OAAO,EAAE;AACPP,IAAAA,OAAO,EAAE;AACPC,MAAAA,UAAU,EAAE,YADL;AAEPC,MAAAA,UAAU,EAAE;AAFL,KADF;AAKPC,IAAAA,MAAM,EAAE;AACNF,MAAAA,UAAU,EAAE,mBADN;AAENC,MAAAA,UAAU,EAAE;AAFN,KALD;AASPE,IAAAA,KAAK,EAAE;AACLH,MAAAA,UAAU,EAAE,kBADP;AAELC,MAAAA,UAAU,EAAE;AAFP,KATA;AAaPG,IAAAA,IAAI,EAAE;AACJJ,MAAAA,UAAU,EAAE,iBADR;AAEJC,MAAAA,UAAU,EAAE;AAFR;AAbC;AArCQ,CAAnB;;AAyDe,SAASM,cAAT,CAAwBC,MAAxB,EAEL;AACR,QAAMC,KAAK,GAAGC,sBAASC,MAAT,CAAgB,EAAE,GAAGd,UAAL;AAAiB,OAAGW;AAApB,GAAhB,CAAd;;AACA,SAAOC,KAAP;AACD","sourcesContent":["/* https://github.com/callstack/react-native-paper/blob/main/src/styles/fonts.tsx */\nimport { Platform, PlatformOSType } from \"react-native\";\nimport type { Fonts } from \"@draftbit/types\";\n\nconst fontConfig = {\n web: {\n regular: {\n fontFamily: 'Roboto, \"Helvetica Neue\", Helvetica, Arial, sans-serif',\n fontWeight: \"400\" as \"400\",\n },\n medium: {\n fontFamily: 'Roboto, \"Helvetica Neue\", Helvetica, Arial, sans-serif',\n fontWeight: \"500\" as \"500\",\n },\n light: {\n fontFamily: 'Roboto, \"Helvetica Neue\", Helvetica, Arial, sans-serif',\n fontWeight: \"300\" as \"300\",\n },\n thin: {\n fontFamily: 'Roboto, \"Helvetica Neue\", Helvetica, Arial, sans-serif',\n fontWeight: \"100\" as \"100\",\n },\n },\n ios: {\n regular: {\n fontFamily: \"System\",\n fontWeight: \"400\" as \"400\",\n },\n medium: {\n fontFamily: \"System\",\n fontWeight: \"500\" as \"500\",\n },\n light: {\n fontFamily: \"System\",\n fontWeight: \"300\" as \"300\",\n },\n thin: {\n fontFamily: \"System\",\n fontWeight: \"100\" as \"100\",\n },\n },\n default: {\n regular: {\n fontFamily: \"sans-serif\",\n fontWeight: \"normal\" as \"normal\",\n },\n medium: {\n fontFamily: \"sans-serif-medium\",\n fontWeight: \"normal\" as \"normal\",\n },\n light: {\n fontFamily: \"sans-serif-light\",\n fontWeight: \"normal\" as \"normal\",\n },\n thin: {\n fontFamily: \"sans-serif-thin\",\n fontWeight: \"normal\" as \"normal\",\n },\n },\n};\n\nexport default function configureFonts(config?: {\n [platform in PlatformOSType | \"default\"]?: Fonts;\n}): Fonts {\n const fonts = Platform.select({ ...fontConfig, ...config }) as Fonts;\n return fonts;\n}\n"]}
|
|
@@ -51,12 +51,21 @@ const Swiper = _ref => {
|
|
|
51
51
|
}
|
|
52
52
|
} : {})
|
|
53
53
|
}
|
|
54
|
-
}, data && renderItem ? data.map((item, index) =>
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
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));
|
|
60
69
|
};
|
|
61
70
|
|
|
62
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","data","keyExtractor","renderItem","children","style","prevTitleStyle","color","nextTitleStyle","dotProps","badgeStyle","backgroundColor","dotActiveStyle","map","item","index","
|
|
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,OAAOC,eAAP,MAA4B,yBAA5B;;AAqBA,MAAMC,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,oBAAC,IAAD;AAAM,IAAA,KAAK,EAAEA;AAAb,kBACE,oBAAC,eAAD;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,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"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@draftbit/core",
|
|
3
|
-
"version": "44.
|
|
3
|
+
"version": "44.1.1",
|
|
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": "^44.0
|
|
44
|
+
"@draftbit/types": "^44.1.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",
|
|
@@ -80,5 +80,5 @@
|
|
|
80
80
|
]
|
|
81
81
|
]
|
|
82
82
|
},
|
|
83
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "a6430134f10ffccfd52787aa0e95686bb5e8a06a"
|
|
84
84
|
}
|
|
@@ -15,8 +15,15 @@ const Swiper = ({ vertical = false, loop = false, timeout = 0, from = 0, prevTit
|
|
|
15
15
|
? { dotActiveStyle: { backgroundColor: dotActiveColor } }
|
|
16
16
|
: {}),
|
|
17
17
|
} }, data && renderItem
|
|
18
|
-
? data.map((item, index) =>
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
? data.map((item, index) => {
|
|
19
|
+
const component = renderItem({ item, index });
|
|
20
|
+
if (!component) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
const key = keyExtractor ? keyExtractor(item, index) : index;
|
|
24
|
+
return React.cloneElement(component, {
|
|
25
|
+
key,
|
|
26
|
+
});
|
|
27
|
+
})
|
|
21
28
|
: children)));
|
|
22
29
|
export default Swiper;
|
|
@@ -60,11 +60,18 @@ const Swiper = ({
|
|
|
60
60
|
}}
|
|
61
61
|
>
|
|
62
62
|
{data && renderItem
|
|
63
|
-
? data.map((item, index) =>
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
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
|
+
})
|
|
68
75
|
: children}
|
|
69
76
|
</SwiperComponent>
|
|
70
77
|
</View>
|