@draftbit/core 43.2.3-0b9a7a.0 → 43.2.3-0f04d4.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/Accordion/index.js.map +1 -1
- package/lib/commonjs/components/DeprecatedFAB.js +4 -20
- package/lib/commonjs/components/DeprecatedFAB.js.map +1 -1
- package/lib/commonjs/components/TabView/TabView.js +101 -0
- package/lib/commonjs/components/TabView/TabView.js.map +1 -0
- package/lib/commonjs/components/TabView/TabViewItem.js +23 -0
- package/lib/commonjs/components/TabView/TabViewItem.js.map +1 -0
- package/lib/commonjs/components/TabView/index.js +24 -0
- package/lib/commonjs/components/TabView/index.js.map +1 -0
- package/lib/commonjs/index.js +14 -8
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/mappings/RadioButton.js.map +1 -1
- package/lib/commonjs/mappings/TabView.js +33 -0
- package/lib/commonjs/mappings/TabView.js.map +1 -0
- package/lib/module/components/Picker/PickerComponent.android.js +7 -10
- package/lib/module/components/Picker/PickerComponent.android.js.map +1 -1
- package/lib/module/components/StarRating.js +5 -23
- package/lib/module/components/StarRating.js.map +1 -1
- package/lib/module/components/TabView/TabView.js +80 -0
- package/lib/module/components/TabView/TabView.js.map +1 -0
- package/lib/module/components/TabView/TabViewItem.js +15 -0
- package/lib/module/components/TabView/TabViewItem.js.map +1 -0
- package/lib/module/components/TabView/index.js +3 -0
- package/lib/module/components/TabView/index.js.map +1 -0
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/mappings/TabView.js +24 -0
- package/lib/module/mappings/TabView.js.map +1 -0
- package/lib/typescript/src/components/TabView/TabView.d.ts +6 -0
- package/lib/typescript/src/components/TabView/TabViewItem.d.ts +8 -0
- package/lib/typescript/src/components/TabView/index.d.ts +2 -0
- package/lib/typescript/src/index.d.ts +1 -1
- package/lib/typescript/src/mappings/TabView.d.ts +19 -0
- package/package.json +4 -3
- package/src/components/TabView/TabView.js +54 -0
- package/src/components/TabView/TabView.tsx +90 -0
- package/src/components/TabView/TabViewItem.js +5 -0
- package/src/components/TabView/TabViewItem.tsx +13 -0
- package/src/components/TabView/index.js +2 -0
- package/src/components/TabView/index.ts +2 -0
- package/src/index.js +1 -1
- package/src/index.tsx +1 -1
- package/src/mappings/TabView.js +26 -0
- package/src/mappings/TabView.ts +27 -0
- package/lib/commonjs/components/Markdown.js +0 -30
- package/lib/commonjs/components/Markdown.js.map +0 -1
- package/lib/commonjs/mappings/Markdown.js +0 -24
- package/lib/commonjs/mappings/Markdown.js.map +0 -1
- package/lib/module/components/Markdown.js +0 -13
- package/lib/module/components/Markdown.js.map +0 -1
- package/lib/module/mappings/Markdown.js +0 -15
- package/lib/module/mappings/Markdown.js.map +0 -1
- package/lib/typescript/src/components/Markdown.d.ts +0 -12
- package/lib/typescript/src/mappings/Markdown.d.ts +0 -9
- package/src/components/Markdown.js +0 -7
- package/src/components/Markdown.tsx +0 -14
- package/src/mappings/Markdown.js +0 -14
- package/src/mappings/Markdown.ts +0 -15
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Animated, View, TouchableOpacity, StyleSheet } from "react-native";
|
|
3
|
+
import { TabView, SceneMap } from "react-native-tab-view";
|
|
4
|
+
import Constants from "expo-constants";
|
|
5
|
+
import TabViewItem from "./TabViewItem";
|
|
6
|
+
export default (_ref => {
|
|
7
|
+
let {
|
|
8
|
+
children
|
|
9
|
+
} = _ref;
|
|
10
|
+
const [index, setIndex] = React.useState(0);
|
|
11
|
+
const [routes, setRoutes] = React.useState([]);
|
|
12
|
+
const [tabScenes, setTabScenes] = React.useState({});
|
|
13
|
+
React.useEffect(() => {
|
|
14
|
+
const newRoutes = [];
|
|
15
|
+
const scenes = {};
|
|
16
|
+
React.Children.toArray(children).filter(child => child.type === TabViewItem).forEach(child => {
|
|
17
|
+
var _child$props;
|
|
18
|
+
|
|
19
|
+
if (child !== null && child !== void 0 && (_child$props = child.props) !== null && _child$props !== void 0 && _child$props.id) {
|
|
20
|
+
var _child$props2, _child$props3, _child$props4;
|
|
21
|
+
|
|
22
|
+
newRoutes.push({
|
|
23
|
+
key: child === null || child === void 0 ? void 0 : (_child$props2 = child.props) === null || _child$props2 === void 0 ? void 0 : _child$props2.id,
|
|
24
|
+
title: child === null || child === void 0 ? void 0 : (_child$props3 = child.props) === null || _child$props3 === void 0 ? void 0 : _child$props3.title
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
scenes[child === null || child === void 0 ? void 0 : (_child$props4 = child.props) === null || _child$props4 === void 0 ? void 0 : _child$props4.id] = () => child;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
setRoutes(newRoutes);
|
|
31
|
+
setTabScenes(scenes);
|
|
32
|
+
}, [children]);
|
|
33
|
+
|
|
34
|
+
const _handleIndexChange = i => setIndex(i);
|
|
35
|
+
|
|
36
|
+
const _renderTabBar = props => {
|
|
37
|
+
const inputRange = props.navigationState.routes.map((__, i) => i);
|
|
38
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
39
|
+
style: styles.tabBar
|
|
40
|
+
}, props.navigationState.routes.map((route, i) => {
|
|
41
|
+
const opacity = props.position.interpolate({
|
|
42
|
+
inputRange,
|
|
43
|
+
outputRange: inputRange.map(inputIndex => inputIndex === i ? 1 : 0.5)
|
|
44
|
+
});
|
|
45
|
+
return /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
46
|
+
style: styles.tabItem,
|
|
47
|
+
onPress: () => setIndex(i)
|
|
48
|
+
}, /*#__PURE__*/React.createElement(Animated.Text, {
|
|
49
|
+
style: {
|
|
50
|
+
opacity
|
|
51
|
+
}
|
|
52
|
+
}, route.title));
|
|
53
|
+
}));
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
return /*#__PURE__*/React.createElement(TabView, {
|
|
57
|
+
navigationState: {
|
|
58
|
+
index,
|
|
59
|
+
routes
|
|
60
|
+
},
|
|
61
|
+
renderScene: SceneMap(tabScenes),
|
|
62
|
+
renderTabBar: _renderTabBar,
|
|
63
|
+
onIndexChange: _handleIndexChange
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
const styles = StyleSheet.create({
|
|
67
|
+
container: {
|
|
68
|
+
flex: 1
|
|
69
|
+
},
|
|
70
|
+
tabBar: {
|
|
71
|
+
flexDirection: "row",
|
|
72
|
+
paddingTop: Constants.statusBarHeight
|
|
73
|
+
},
|
|
74
|
+
tabItem: {
|
|
75
|
+
flex: 1,
|
|
76
|
+
alignItems: "center",
|
|
77
|
+
padding: 16
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
//# sourceMappingURL=TabView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["TabView.tsx"],"names":["React","Animated","View","TouchableOpacity","StyleSheet","TabView","SceneMap","Constants","TabViewItem","children","index","setIndex","useState","routes","setRoutes","tabScenes","setTabScenes","useEffect","newRoutes","scenes","Children","toArray","filter","child","type","forEach","props","id","push","key","title","_handleIndexChange","i","_renderTabBar","inputRange","navigationState","map","__","styles","tabBar","route","opacity","position","interpolate","outputRange","inputIndex","tabItem","create","container","flex","flexDirection","paddingTop","statusBarHeight","alignItems","padding"],"mappings":"AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAASC,QAAT,EAAmBC,IAAnB,EAAyBC,gBAAzB,EAA2CC,UAA3C,QAA6D,cAA7D;AACA,SAASC,OAAT,EAAkBC,QAAlB,QAAkC,uBAAlC;AACA,OAAOC,SAAP,MAAsB,gBAAtB;AAEA,OAAOC,WAAP,MAAwB,eAAxB;AAMA,gBAAe,QAAgC;AAAA,MAA/B;AAAEC,IAAAA;AAAF,GAA+B;AAC7C,QAAM,CAACC,KAAD,EAAQC,QAAR,IAAoBX,KAAK,CAACY,QAAN,CAAe,CAAf,CAA1B;AACA,QAAM,CAACC,MAAD,EAASC,SAAT,IAAsBd,KAAK,CAACY,QAAN,CAAe,EAAf,CAA5B;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HF;AARsB,CAAlB,CAAf","sourcesContent":["import * as React from \"react\";\nimport { Animated, View, TouchableOpacity, StyleSheet } from \"react-native\";\nimport { TabView, SceneMap } from \"react-native-tab-view\";\nimport Constants from \"expo-constants\";\n\nimport TabViewItem from \"./TabViewItem\";\n\ninterface TabViewProps {\n children: React.ReactNode;\n}\n\nexport default ({ children }: TabViewProps) => {\n const [index, setIndex] = React.useState(0);\n const [routes, setRoutes] = React.useState([]);\n const [tabScenes, setTabScenes] = React.useState({});\n\n React.useEffect(() => {\n const newRoutes: any = [];\n const scenes: any = {};\n\n React.Children.toArray(children)\n .filter((child: any) => child.type === TabViewItem)\n .forEach((child: any) => {\n if (child?.props?.id) {\n newRoutes.push({\n key: child?.props?.id,\n title: child?.props?.title,\n });\n scenes[child?.props?.id] = () => child;\n }\n });\n\n setRoutes(newRoutes);\n setTabScenes(scenes);\n }, [children]);\n\n const _handleIndexChange = (i: any) => setIndex(i);\n\n const _renderTabBar = (props: any) => {\n const inputRange = props.navigationState.routes.map(\n (__: any, i: number) => i\n );\n\n return (\n <View style={styles.tabBar}>\n {props.navigationState.routes.map((route: any, i: number) => {\n const opacity = props.position.interpolate({\n inputRange,\n outputRange: inputRange.map((inputIndex: any) =>\n inputIndex === i ? 1 : 0.5\n ),\n });\n\n return (\n <TouchableOpacity\n style={styles.tabItem}\n onPress={() => setIndex(i)}\n >\n <Animated.Text style={{ opacity }}>{route.title}</Animated.Text>\n </TouchableOpacity>\n );\n })}\n </View>\n );\n };\n\n return (\n <TabView\n navigationState={{ index, routes }}\n renderScene={SceneMap(tabScenes)}\n renderTabBar={_renderTabBar}\n onIndexChange={_handleIndexChange}\n />\n );\n};\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n },\n tabBar: {\n flexDirection: \"row\",\n paddingTop: Constants.statusBarHeight,\n },\n tabItem: {\n flex: 1,\n alignItems: \"center\",\n padding: 16,\n },\n});\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["TabViewItem.tsx"],"names":["TabViewItem","title","id","children","console","log"],"mappings":"AAOA,MAAMA,WAAW,GAAG,QAA+C;AAAA,MAA9C;AAAEC,IAAAA,KAAF;AAASC,IAAAA,EAAT;AAAaC,IAAAA;AAAb,GAA8C;AACjEC,EAAAA,OAAO,CAACC,GAAR,CAAY;AAAEJ,IAAAA,KAAF;AAASC,IAAAA;AAAT,GAAZ;AACA,SAAOC,QAAP;AACD,CAHD;;AAKA,eAAeH,WAAf","sourcesContent":["import React from \"react\";\ninterface TabViewItemProps {\n title: string;\n id: string;\n children: React.ReactNode;\n}\n\nconst TabViewItem = ({ title, id, children }: TabViewItemProps) => {\n console.log({ title, id });\n return children;\n};\n\nexport default TabViewItem;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["index.ts"],"names":["default","TabView","TabViewItem"],"mappings":"AAAA,SAASA,OAAO,IAAIC,OAApB,QAAmC,WAAnC;AACA,SAASD,OAAO,IAAIE,WAApB,QAAuC,eAAvC","sourcesContent":["export { default as TabView } from \"./TabView\";\nexport { default as TabViewItem } from \"./TabViewItem\";\n"]}
|
package/lib/module/index.js
CHANGED
|
@@ -27,6 +27,7 @@ export { default as Touchable } from "./components/Touchable";
|
|
|
27
27
|
export { AccordionGroup, AccordionItem } from "./components/Accordion";
|
|
28
28
|
export { ActionSheet, ActionSheetItem, ActionSheetCancel } from "./components/ActionSheet";
|
|
29
29
|
export { Swiper, SwiperItem } from "./components/Swiper";
|
|
30
|
+
export { TabView, TabViewItem } from "./components/TabView";
|
|
30
31
|
export { Center, Circle, Square, Row, Stack, Spacer } from "./components/Layout";
|
|
31
32
|
export { RadioButton, RadioButtonGroup, RadioButtonRow, RadioButtonFieldGroup } from "./components/RadioButton/index";
|
|
32
33
|
/* Deprecated: Fix or Delete! */
|
|
@@ -49,5 +50,4 @@ export { default as RowHeadlineImageIcon } from "./components/RowHeadlineImageIc
|
|
|
49
50
|
export { default as Slider } from "./components/Slider";
|
|
50
51
|
export { default as Stepper } from "./components/Stepper";
|
|
51
52
|
export { useAuthState } from "./components/useAuthState";
|
|
52
|
-
export { default as Markdown } from "./components/Markdown";
|
|
53
53
|
//# sourceMappingURL=index.js.map
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.tsx"],"names":["injectIcon","withTheme","ThemeProvider","default","Provider","DefaultTheme","Link","ButtonSolid","ButtonOutline","Avatar","AvatarEdit","Card","Carousel","Checkbox","CheckboxGroup","CheckboxRow","CircleImage","Container","Divider","FAB","FieldSearchBarFull","IconButton","Image","NumberInput","ScreenContainer","StarRating","Surface","Switch","SwitchRow","TextField","ToggleButton","Touchable","AccordionGroup","AccordionItem","ActionSheet","ActionSheetItem","ActionSheetCancel","Swiper","SwiperItem","Center","Circle","Square","Row","Stack","Spacer","RadioButton","RadioButtonGroup","RadioButtonRow","RadioButtonFieldGroup","Button","CardBlock","CardContainer","CardContainerRating","CardInline","DatePicker","HeaderLarge","HeaderMedium","HeaderOverline","Picker","ProgressBar","ProgressCircle","RowBodyIcon","RowHeadlineImageCaption","RowHeadlineImageIcon","Slider","Stepper","useAuthState"
|
|
1
|
+
{"version":3,"sources":["index.tsx"],"names":["injectIcon","withTheme","ThemeProvider","default","Provider","DefaultTheme","Link","ButtonSolid","ButtonOutline","Avatar","AvatarEdit","Card","Carousel","Checkbox","CheckboxGroup","CheckboxRow","CircleImage","Container","Divider","FAB","FieldSearchBarFull","IconButton","Image","NumberInput","ScreenContainer","StarRating","Surface","Switch","SwitchRow","TextField","ToggleButton","Touchable","AccordionGroup","AccordionItem","ActionSheet","ActionSheetItem","ActionSheetCancel","Swiper","SwiperItem","TabView","TabViewItem","Center","Circle","Square","Row","Stack","Spacer","RadioButton","RadioButtonGroup","RadioButtonRow","RadioButtonFieldGroup","Button","CardBlock","CardContainer","CardContainerRating","CardInline","DatePicker","HeaderLarge","HeaderMedium","HeaderOverline","Picker","ProgressBar","ProgressCircle","RowBodyIcon","RowHeadlineImageCaption","RowHeadlineImageIcon","Slider","Stepper","useAuthState"],"mappings":"AAAA,SAASA,UAAT,QAA2B,mBAA3B;AACA,SAASC,SAAT,EAAoBC,aAApB,QAAyC,WAAzC;AACA,SAASC,OAAO,IAAIC,QAApB,QAAoC,YAApC;AACA,SAASD,OAAO,IAAIE,YAApB,QAAwC,uBAAxC;AAEA,SAASC,IAAT,QAAqB,mBAArB;AACA,SAASC,WAAT,EAAsBC,aAAtB,QAA2C,qBAA3C;AACA,SAASL,OAAO,IAAIM,MAApB,QAAkC,0BAAlC;AACA,SAASN,OAAO,IAAIO,UAApB,QAAsC,yBAAtC;AACA,SAASP,OAAO,IAAIQ,IAApB,QAAgC,mBAAhC;AACA,SAASR,OAAO,IAAIS,QAApB,QAAoC,uBAApC;AACA,SAASC,QAAT,EAAmBC,aAAnB,EAAkCC,WAAlC,QAAqD,uBAArD;AACA,SAASZ,OAAO,IAAIa,WAApB,QAAuC,0BAAvC;AACA,SAASb,OAAO,IAAIc,SAApB,QAAqC,wBAArC;AACA,SAASd,OAAO,IAAIe,OAApB,QAAmC,sBAAnC;AACA,SAASf,OAAO,IAAIgB,GAApB,QAA+B,kBAA/B;AACA,SAAShB,OAAO,IAAIiB,kBAApB,QAA8C,iCAA9C;AACA,SAASjB,OAAO,IAAIkB,UAApB,QAAsC,yBAAtC;AACA,SAASlB,OAAO,IAAImB,KAApB,QAAiC,oBAAjC;AACA,SAASnB,OAAO,IAAIoB,WAApB,QAAuC,0BAAvC;AACA,SAASpB,OAAO,IAAIqB,eAApB,QAA2C,8BAA3C;AACA,SAASrB,OAAO,IAAIsB,UAApB,QAAsC,yBAAtC;AACA,SAAStB,OAAO,IAAIuB,OAApB,QAAmC,sBAAnC;AACA,SAASvB,OAAO,IAAIwB,MAApB,EAA4BC,SAA5B,QAA6C,qBAA7C;AACA,SAASzB,OAAO,IAAI0B,SAApB,QAAqC,wBAArC;AACA,SAAS1B,OAAO,IAAI2B,YAApB,QAAwC,2BA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AApB,QAAmC,sBAAnC;AACA,SAASC,YAAT,QAA6B,2BAA7B","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 { 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\";\nexport { TabView, TabViewItem } from \"./components/TabView\";\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"]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { COMPONENT_TYPES, createTextProp } from "@draftbit/types";
|
|
2
|
+
export const SEED_DATA = [{
|
|
3
|
+
name: "TabView",
|
|
4
|
+
tag: "TabView",
|
|
5
|
+
category: COMPONENT_TYPES.container,
|
|
6
|
+
layout: {},
|
|
7
|
+
props: {}
|
|
8
|
+
}, {
|
|
9
|
+
name: "TabViewItem",
|
|
10
|
+
tag: "TabViewItem",
|
|
11
|
+
category: COMPONENT_TYPES.container,
|
|
12
|
+
layout: {},
|
|
13
|
+
props: {
|
|
14
|
+
title: createTextProp({
|
|
15
|
+
label: "Tab Title",
|
|
16
|
+
description: "Tab Title"
|
|
17
|
+
}),
|
|
18
|
+
id: createTextProp({
|
|
19
|
+
label: "Tab Id",
|
|
20
|
+
description: "Tab Id"
|
|
21
|
+
})
|
|
22
|
+
}
|
|
23
|
+
}];
|
|
24
|
+
//# sourceMappingURL=TabView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["TabView.ts"],"names":["COMPONENT_TYPES","createTextProp","SEED_DATA","name","tag","category","container","layout","props","title","label","description","id"],"mappings":"AAAA,SAASA,eAAT,EAA0BC,cAA1B,QAAgD,iBAAhD;AAEA,OAAO,MAAMC,SAAS,GAAG,CACvB;AACEC,EAAAA,IAAI,EAAE,SADR;AAEEC,EAAAA,GAAG,EAAE,SAFP;AAGEC,EAAAA,QAAQ,EAAEL,eAAe,CAACM,SAH5B;AAIEC,EAAAA,MAAM,EAAE,EAJV;AAKEC,EAAAA,KAAK,EAAE;AALT,CADuB,EAQvB;AACEL,EAAAA,IAAI,EAAE,aADR;AAEEC,EAAAA,GAAG,EAAE,aAFP;AAGEC,EAAAA,QAAQ,EAAEL,eAAe,CAACM,SAH5B;AAIEC,EAAAA,MAAM,EAAE,EAJV;AAKEC,EAAAA,KAAK,EAAE;AACLC,IAAAA,KAAK,EAAER,cAAc,CAAC;AACpBS,MAAAA,KAAK,EAAE,WADa;AAEpBC,MAAAA,WAAW,EAAE;AAFO,KAAD,CADhB;AAKLC,IAAAA,EAAE,EAAEX,cAAc,CAAC;AACjBS,MAAAA,KAAK,EAAE,QADU;AAEjBC,MAAAA,WAAW,EAAE;AAFI,KAAD;AALb;AALT,CARuB,CAAlB","sourcesContent":["import { COMPONENT_TYPES, createTextProp } from \"@draftbit/types\";\n\nexport const SEED_DATA = [\n {\n name: \"TabView\",\n tag: \"TabView\",\n category: COMPONENT_TYPES.container,\n layout: {},\n props: {},\n },\n {\n name: \"TabViewItem\",\n tag: \"TabViewItem\",\n category: COMPONENT_TYPES.container,\n layout: {},\n props: {\n title: createTextProp({\n label: \"Tab Title\",\n description: \"Tab Title\",\n }),\n id: createTextProp({\n label: \"Tab Id\",\n description: \"Tab Id\",\n }),\n },\n },\n];\n"]}
|
|
@@ -27,6 +27,7 @@ export { default as Touchable } from "./components/Touchable";
|
|
|
27
27
|
export { AccordionGroup, AccordionItem } from "./components/Accordion";
|
|
28
28
|
export { ActionSheet, ActionSheetItem, ActionSheetCancel, } from "./components/ActionSheet";
|
|
29
29
|
export { Swiper, SwiperItem } from "./components/Swiper";
|
|
30
|
+
export { TabView, TabViewItem } from "./components/TabView";
|
|
30
31
|
export { Center, Circle, Square, Row, Stack, Spacer, } from "./components/Layout";
|
|
31
32
|
export { RadioButton, RadioButtonGroup, RadioButtonRow, RadioButtonFieldGroup, } from "./components/RadioButton/index";
|
|
32
33
|
export { default as Button } from "./components/DeprecatedButton";
|
|
@@ -47,4 +48,3 @@ export { default as RowHeadlineImageIcon } from "./components/RowHeadlineImageIc
|
|
|
47
48
|
export { default as Slider } from "./components/Slider";
|
|
48
49
|
export { default as Stepper } from "./components/Stepper";
|
|
49
50
|
export { useAuthState } from "./components/useAuthState";
|
|
50
|
-
export { default as Markdown } from "./components/Markdown";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const SEED_DATA: ({
|
|
2
|
+
name: string;
|
|
3
|
+
tag: string;
|
|
4
|
+
category: string;
|
|
5
|
+
layout: {};
|
|
6
|
+
props: {
|
|
7
|
+
title?: undefined;
|
|
8
|
+
id?: undefined;
|
|
9
|
+
};
|
|
10
|
+
} | {
|
|
11
|
+
name: string;
|
|
12
|
+
tag: string;
|
|
13
|
+
category: string;
|
|
14
|
+
layout: {};
|
|
15
|
+
props: {
|
|
16
|
+
title: any;
|
|
17
|
+
id: any;
|
|
18
|
+
};
|
|
19
|
+
})[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@draftbit/core",
|
|
3
|
-
"version": "43.2.3-
|
|
3
|
+
"version": "43.2.3-0f04d4.0+0f04d477",
|
|
4
4
|
"description": "Core (non-native) Components",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -52,8 +52,9 @@
|
|
|
52
52
|
"lodash.isnumber": "^3.0.3",
|
|
53
53
|
"lodash.omit": "^4.5.0",
|
|
54
54
|
"lodash.tonumber": "^4.0.3",
|
|
55
|
-
"react-native-markdown-display": "^7.0.0-alpha.2",
|
|
56
55
|
"react-native-modal-datetime-picker": "^13.0.0",
|
|
56
|
+
"react-native-pager-view": "^5.4.9",
|
|
57
|
+
"react-native-tab-view": "^3.1.1",
|
|
57
58
|
"react-native-typography": "^1.4.1",
|
|
58
59
|
"react-native-web-swiper": "^2.2.1"
|
|
59
60
|
},
|
|
@@ -80,5 +81,5 @@
|
|
|
80
81
|
]
|
|
81
82
|
]
|
|
82
83
|
},
|
|
83
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "0f04d477e53a1af3a829258e7a0e7d9ab0099f3a"
|
|
84
85
|
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Animated, View, TouchableOpacity, StyleSheet } from "react-native";
|
|
3
|
+
import { TabView, SceneMap } from "react-native-tab-view";
|
|
4
|
+
import Constants from "expo-constants";
|
|
5
|
+
import TabViewItem from "./TabViewItem";
|
|
6
|
+
export default ({ children }) => {
|
|
7
|
+
const [index, setIndex] = React.useState(0);
|
|
8
|
+
const [routes, setRoutes] = React.useState([]);
|
|
9
|
+
const [tabScenes, setTabScenes] = React.useState({});
|
|
10
|
+
React.useEffect(() => {
|
|
11
|
+
const newRoutes = [];
|
|
12
|
+
const scenes = {};
|
|
13
|
+
React.Children.toArray(children)
|
|
14
|
+
.filter((child) => child.type === TabViewItem)
|
|
15
|
+
.forEach((child) => {
|
|
16
|
+
if (child?.props?.id) {
|
|
17
|
+
newRoutes.push({
|
|
18
|
+
key: child?.props?.id,
|
|
19
|
+
title: child?.props?.title,
|
|
20
|
+
});
|
|
21
|
+
scenes[child?.props?.id] = () => child;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
setRoutes(newRoutes);
|
|
25
|
+
setTabScenes(scenes);
|
|
26
|
+
}, [children]);
|
|
27
|
+
const _handleIndexChange = (i) => setIndex(i);
|
|
28
|
+
const _renderTabBar = (props) => {
|
|
29
|
+
const inputRange = props.navigationState.routes.map((__, i) => i);
|
|
30
|
+
return (React.createElement(View, { style: styles.tabBar }, props.navigationState.routes.map((route, i) => {
|
|
31
|
+
const opacity = props.position.interpolate({
|
|
32
|
+
inputRange,
|
|
33
|
+
outputRange: inputRange.map((inputIndex) => inputIndex === i ? 1 : 0.5),
|
|
34
|
+
});
|
|
35
|
+
return (React.createElement(TouchableOpacity, { style: styles.tabItem, onPress: () => setIndex(i) },
|
|
36
|
+
React.createElement(Animated.Text, { style: { opacity } }, route.title)));
|
|
37
|
+
})));
|
|
38
|
+
};
|
|
39
|
+
return (React.createElement(TabView, { navigationState: { index, routes }, renderScene: SceneMap(tabScenes), renderTabBar: _renderTabBar, onIndexChange: _handleIndexChange }));
|
|
40
|
+
};
|
|
41
|
+
const styles = StyleSheet.create({
|
|
42
|
+
container: {
|
|
43
|
+
flex: 1,
|
|
44
|
+
},
|
|
45
|
+
tabBar: {
|
|
46
|
+
flexDirection: "row",
|
|
47
|
+
paddingTop: Constants.statusBarHeight,
|
|
48
|
+
},
|
|
49
|
+
tabItem: {
|
|
50
|
+
flex: 1,
|
|
51
|
+
alignItems: "center",
|
|
52
|
+
padding: 16,
|
|
53
|
+
},
|
|
54
|
+
});
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Animated, View, TouchableOpacity, StyleSheet } from "react-native";
|
|
3
|
+
import { TabView, SceneMap } from "react-native-tab-view";
|
|
4
|
+
import Constants from "expo-constants";
|
|
5
|
+
|
|
6
|
+
import TabViewItem from "./TabViewItem";
|
|
7
|
+
|
|
8
|
+
interface TabViewProps {
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export default ({ children }: TabViewProps) => {
|
|
13
|
+
const [index, setIndex] = React.useState(0);
|
|
14
|
+
const [routes, setRoutes] = React.useState([]);
|
|
15
|
+
const [tabScenes, setTabScenes] = React.useState({});
|
|
16
|
+
|
|
17
|
+
React.useEffect(() => {
|
|
18
|
+
const newRoutes: any = [];
|
|
19
|
+
const scenes: any = {};
|
|
20
|
+
|
|
21
|
+
React.Children.toArray(children)
|
|
22
|
+
.filter((child: any) => child.type === TabViewItem)
|
|
23
|
+
.forEach((child: any) => {
|
|
24
|
+
if (child?.props?.id) {
|
|
25
|
+
newRoutes.push({
|
|
26
|
+
key: child?.props?.id,
|
|
27
|
+
title: child?.props?.title,
|
|
28
|
+
});
|
|
29
|
+
scenes[child?.props?.id] = () => child;
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
setRoutes(newRoutes);
|
|
34
|
+
setTabScenes(scenes);
|
|
35
|
+
}, [children]);
|
|
36
|
+
|
|
37
|
+
const _handleIndexChange = (i: any) => setIndex(i);
|
|
38
|
+
|
|
39
|
+
const _renderTabBar = (props: any) => {
|
|
40
|
+
const inputRange = props.navigationState.routes.map(
|
|
41
|
+
(__: any, i: number) => i
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<View style={styles.tabBar}>
|
|
46
|
+
{props.navigationState.routes.map((route: any, i: number) => {
|
|
47
|
+
const opacity = props.position.interpolate({
|
|
48
|
+
inputRange,
|
|
49
|
+
outputRange: inputRange.map((inputIndex: any) =>
|
|
50
|
+
inputIndex === i ? 1 : 0.5
|
|
51
|
+
),
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
<TouchableOpacity
|
|
56
|
+
style={styles.tabItem}
|
|
57
|
+
onPress={() => setIndex(i)}
|
|
58
|
+
>
|
|
59
|
+
<Animated.Text style={{ opacity }}>{route.title}</Animated.Text>
|
|
60
|
+
</TouchableOpacity>
|
|
61
|
+
);
|
|
62
|
+
})}
|
|
63
|
+
</View>
|
|
64
|
+
);
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
return (
|
|
68
|
+
<TabView
|
|
69
|
+
navigationState={{ index, routes }}
|
|
70
|
+
renderScene={SceneMap(tabScenes)}
|
|
71
|
+
renderTabBar={_renderTabBar}
|
|
72
|
+
onIndexChange={_handleIndexChange}
|
|
73
|
+
/>
|
|
74
|
+
);
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
const styles = StyleSheet.create({
|
|
78
|
+
container: {
|
|
79
|
+
flex: 1,
|
|
80
|
+
},
|
|
81
|
+
tabBar: {
|
|
82
|
+
flexDirection: "row",
|
|
83
|
+
paddingTop: Constants.statusBarHeight,
|
|
84
|
+
},
|
|
85
|
+
tabItem: {
|
|
86
|
+
flex: 1,
|
|
87
|
+
alignItems: "center",
|
|
88
|
+
padding: 16,
|
|
89
|
+
},
|
|
90
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface TabViewItemProps {
|
|
3
|
+
title: string;
|
|
4
|
+
id: string;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const TabViewItem = ({ title, id, children }: TabViewItemProps) => {
|
|
9
|
+
console.log({ title, id });
|
|
10
|
+
return children;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export default TabViewItem;
|
package/src/index.js
CHANGED
|
@@ -27,6 +27,7 @@ export { default as Touchable } from "./components/Touchable";
|
|
|
27
27
|
export { AccordionGroup, AccordionItem } from "./components/Accordion";
|
|
28
28
|
export { ActionSheet, ActionSheetItem, ActionSheetCancel, } from "./components/ActionSheet";
|
|
29
29
|
export { Swiper, SwiperItem } from "./components/Swiper";
|
|
30
|
+
export { TabView, TabViewItem } from "./components/TabView";
|
|
30
31
|
export { Center, Circle, Square, Row, Stack, Spacer, } from "./components/Layout";
|
|
31
32
|
export { RadioButton, RadioButtonGroup, RadioButtonRow, RadioButtonFieldGroup, } from "./components/RadioButton/index";
|
|
32
33
|
/* Deprecated: Fix or Delete! */
|
|
@@ -48,4 +49,3 @@ export { default as RowHeadlineImageIcon } from "./components/RowHeadlineImageIc
|
|
|
48
49
|
export { default as Slider } from "./components/Slider";
|
|
49
50
|
export { default as Stepper } from "./components/Stepper";
|
|
50
51
|
export { useAuthState } from "./components/useAuthState";
|
|
51
|
-
export { default as Markdown } from "./components/Markdown";
|
package/src/index.tsx
CHANGED
|
@@ -32,6 +32,7 @@ export {
|
|
|
32
32
|
ActionSheetCancel,
|
|
33
33
|
} from "./components/ActionSheet";
|
|
34
34
|
export { Swiper, SwiperItem } from "./components/Swiper";
|
|
35
|
+
export { TabView, TabViewItem } from "./components/TabView";
|
|
35
36
|
|
|
36
37
|
export {
|
|
37
38
|
Center,
|
|
@@ -68,4 +69,3 @@ export { default as RowHeadlineImageIcon } from "./components/RowHeadlineImageIc
|
|
|
68
69
|
export { default as Slider } from "./components/Slider";
|
|
69
70
|
export { default as Stepper } from "./components/Stepper";
|
|
70
71
|
export { useAuthState } from "./components/useAuthState";
|
|
71
|
-
export { default as Markdown } from "./components/Markdown";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { COMPONENT_TYPES, createTextProp } from "@draftbit/types";
|
|
2
|
+
export const SEED_DATA = [
|
|
3
|
+
{
|
|
4
|
+
name: "TabView",
|
|
5
|
+
tag: "TabView",
|
|
6
|
+
category: COMPONENT_TYPES.container,
|
|
7
|
+
layout: {},
|
|
8
|
+
props: {},
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
name: "TabViewItem",
|
|
12
|
+
tag: "TabViewItem",
|
|
13
|
+
category: COMPONENT_TYPES.container,
|
|
14
|
+
layout: {},
|
|
15
|
+
props: {
|
|
16
|
+
title: createTextProp({
|
|
17
|
+
label: "Tab Title",
|
|
18
|
+
description: "Tab Title",
|
|
19
|
+
}),
|
|
20
|
+
id: createTextProp({
|
|
21
|
+
label: "Tab Id",
|
|
22
|
+
description: "Tab Id",
|
|
23
|
+
}),
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
];
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { COMPONENT_TYPES, createTextProp } from "@draftbit/types";
|
|
2
|
+
|
|
3
|
+
export const SEED_DATA = [
|
|
4
|
+
{
|
|
5
|
+
name: "TabView",
|
|
6
|
+
tag: "TabView",
|
|
7
|
+
category: COMPONENT_TYPES.container,
|
|
8
|
+
layout: {},
|
|
9
|
+
props: {},
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
name: "TabViewItem",
|
|
13
|
+
tag: "TabViewItem",
|
|
14
|
+
category: COMPONENT_TYPES.container,
|
|
15
|
+
layout: {},
|
|
16
|
+
props: {
|
|
17
|
+
title: createTextProp({
|
|
18
|
+
label: "Tab Title",
|
|
19
|
+
description: "Tab Title",
|
|
20
|
+
}),
|
|
21
|
+
id: createTextProp({
|
|
22
|
+
label: "Tab Id",
|
|
23
|
+
description: "Tab Id",
|
|
24
|
+
}),
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
];
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var React = _interopRequireWildcard(require("react"));
|
|
9
|
-
|
|
10
|
-
var _reactNativeMarkdownDisplay = _interopRequireDefault(require("react-native-markdown-display"));
|
|
11
|
-
|
|
12
|
-
var _theming = require("../theming");
|
|
13
|
-
|
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
|
|
16
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
17
|
-
|
|
18
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
19
|
-
|
|
20
|
-
const MarkdownComponent = _ref => {
|
|
21
|
-
let {
|
|
22
|
-
content
|
|
23
|
-
} = _ref;
|
|
24
|
-
return /*#__PURE__*/React.createElement(_reactNativeMarkdownDisplay.default, null, content);
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
var _default = (0, _theming.withTheme)(MarkdownComponent);
|
|
28
|
-
|
|
29
|
-
exports.default = _default;
|
|
30
|
-
//# sourceMappingURL=Markdown.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["Markdown.tsx"],"names":["MarkdownComponent","content"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;;;;;;;AAMA,MAAMA,iBAAkC,GAAG,QAAiB;AAAA,MAAhB;AAAEC,IAAAA;AAAF,GAAgB;AAC1D,sBAAO,oBAAC,mCAAD,QAAWA,OAAX,CAAP;AACD,CAFD;;eAIe,wBAAUD,iBAAV,C","sourcesContent":["import * as React from \"react\";\nimport Markdown from \"react-native-markdown-display\";\n\nimport { withTheme } from \"../theming\";\n\ntype Props = {\n content?: string;\n};\n\nconst MarkdownComponent: React.FC<Props> = ({ content }) => {\n return <Markdown>{content}</Markdown>;\n};\n\nexport default withTheme(MarkdownComponent);\n"]}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.SEED_DATA = void 0;
|
|
7
|
-
|
|
8
|
-
var _types = require("@draftbit/types");
|
|
9
|
-
|
|
10
|
-
const SEED_DATA = {
|
|
11
|
-
name: "Markdown",
|
|
12
|
-
tag: "MarkdownComponent",
|
|
13
|
-
description: "A markdown component",
|
|
14
|
-
category: _types.COMPONENT_TYPES.basic,
|
|
15
|
-
props: {
|
|
16
|
-
content: (0, _types.createTextProp)({
|
|
17
|
-
label: "Markdown Text",
|
|
18
|
-
description: "Markdown Text",
|
|
19
|
-
defaultValue: null
|
|
20
|
-
})
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
exports.SEED_DATA = SEED_DATA;
|
|
24
|
-
//# sourceMappingURL=Markdown.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["Markdown.ts"],"names":["SEED_DATA","name","tag","description","category","COMPONENT_TYPES","basic","props","content","label","defaultValue"],"mappings":";;;;;;;AAAA;;AAEO,MAAMA,SAAS,GAAG;AACvBC,EAAAA,IAAI,EAAE,UADiB;AAEvBC,EAAAA,GAAG,EAAE,mBAFkB;AAGvBC,EAAAA,WAAW,EAAE,sBAHU;AAIvBC,EAAAA,QAAQ,EAAEC,uBAAgBC,KAJH;AAKvBC,EAAAA,KAAK,EAAE;AACLC,IAAAA,OAAO,EAAE,2BAAe;AACtBC,MAAAA,KAAK,EAAE,eADe;AAEtBN,MAAAA,WAAW,EAAE,eAFS;AAGtBO,MAAAA,YAAY,EAAE;AAHQ,KAAf;AADJ;AALgB,CAAlB","sourcesContent":["import { COMPONENT_TYPES, createTextProp } from \"@draftbit/types\";\n\nexport const SEED_DATA = {\n name: \"Markdown\",\n tag: \"MarkdownComponent\",\n description: \"A markdown component\",\n category: COMPONENT_TYPES.basic,\n props: {\n content: createTextProp({\n label: \"Markdown Text\",\n description: \"Markdown Text\",\n defaultValue: null,\n }),\n },\n};\n"]}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import Markdown from "react-native-markdown-display";
|
|
3
|
-
import { withTheme } from "../theming";
|
|
4
|
-
|
|
5
|
-
const MarkdownComponent = _ref => {
|
|
6
|
-
let {
|
|
7
|
-
content
|
|
8
|
-
} = _ref;
|
|
9
|
-
return /*#__PURE__*/React.createElement(Markdown, null, content);
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export default withTheme(MarkdownComponent);
|
|
13
|
-
//# sourceMappingURL=Markdown.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["Markdown.tsx"],"names":["React","Markdown","withTheme","MarkdownComponent","content"],"mappings":"AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,OAAOC,QAAP,MAAqB,+BAArB;AAEA,SAASC,SAAT,QAA0B,YAA1B;;AAMA,MAAMC,iBAAkC,GAAG,QAAiB;AAAA,MAAhB;AAAEC,IAAAA;AAAF,GAAgB;AAC1D,sBAAO,oBAAC,QAAD,QAAWA,OAAX,CAAP;AACD,CAFD;;AAIA,eAAeF,SAAS,CAACC,iBAAD,CAAxB","sourcesContent":["import * as React from \"react\";\nimport Markdown from \"react-native-markdown-display\";\n\nimport { withTheme } from \"../theming\";\n\ntype Props = {\n content?: string;\n};\n\nconst MarkdownComponent: React.FC<Props> = ({ content }) => {\n return <Markdown>{content}</Markdown>;\n};\n\nexport default withTheme(MarkdownComponent);\n"]}
|