@draftbit/core 46.4.4-d55501.2 → 46.4.4-d5b88a.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (320) hide show
  1. package/lib/commonjs/Provider.js +9 -0
  2. package/lib/commonjs/components/Accordion/AccordionGroup.js +14 -0
  3. package/lib/commonjs/components/Accordion/AccordionItem.js +13 -0
  4. package/lib/commonjs/components/Accordion/index.js +3 -0
  5. package/lib/commonjs/components/ActionSheet/ActionSheet.js +9 -0
  6. package/lib/commonjs/components/ActionSheet/ActionSheetCancel.js +5 -0
  7. package/lib/commonjs/components/ActionSheet/ActionSheetItem.js +7 -0
  8. package/lib/commonjs/components/ActionSheet/index.js +4 -0
  9. package/lib/commonjs/components/AnimatedCircularProgress.js +15 -0
  10. package/lib/commonjs/components/AspectRatio.js +10 -0
  11. package/lib/commonjs/components/AvatarEdit.js +12 -0
  12. package/lib/commonjs/components/Banner.js +23 -9
  13. package/lib/commonjs/components/Button.js +19 -2
  14. package/lib/commonjs/components/Card.js +14 -0
  15. package/lib/commonjs/components/CardBlock.js +15 -0
  16. package/lib/commonjs/components/CardContainer.js +18 -0
  17. package/lib/commonjs/components/CardContainerRating.js +20 -2
  18. package/lib/commonjs/components/CardContainerShortImage.js +12 -0
  19. package/lib/commonjs/components/CardInline.js +14 -1
  20. package/lib/commonjs/components/Carousel.js +21 -3
  21. package/lib/commonjs/components/Checkbox/Checkbox.js +18 -3
  22. package/lib/commonjs/components/Checkbox/CheckboxGroup.js +11 -0
  23. package/lib/commonjs/components/Checkbox/CheckboxGroupRow.js +20 -0
  24. package/lib/commonjs/components/Checkbox/CheckboxRow.js +24 -3
  25. package/lib/commonjs/components/Checkbox/context.js +5 -0
  26. package/lib/commonjs/components/Checkbox/index.js +4 -0
  27. package/lib/commonjs/components/CircleImage.js +9 -0
  28. package/lib/commonjs/components/CircularProgress.js +13 -3
  29. package/lib/commonjs/components/Config.js +13 -5
  30. package/lib/commonjs/components/Container.js +15 -15
  31. package/lib/commonjs/components/DatePicker/DatePicker.js +48 -16
  32. package/lib/commonjs/components/DatePicker/DatePickerComponent.js +7 -0
  33. package/lib/commonjs/components/DatePicker/DatePickerComponent.web.js +10 -0
  34. package/lib/commonjs/components/DeprecatedButton.js +23 -0
  35. package/lib/commonjs/components/DeprecatedCardWrapper.js +11 -0
  36. package/lib/commonjs/components/DeprecatedFAB.js +26 -0
  37. package/lib/commonjs/components/Divider.js +9 -0
  38. package/lib/commonjs/components/Elevation.js +11 -0
  39. package/lib/commonjs/components/FAB.js +10 -0
  40. package/lib/commonjs/components/FieldSearchBarFull.js +18 -0
  41. package/lib/commonjs/components/FormRow.js +10 -0
  42. package/lib/commonjs/components/Header.js +13 -0
  43. package/lib/commonjs/components/HeaderLarge.js +9 -0
  44. package/lib/commonjs/components/HeaderMedium.js +9 -0
  45. package/lib/commonjs/components/HeaderOverline.js +9 -0
  46. package/lib/commonjs/components/IconButton.js +10 -0
  47. package/lib/commonjs/components/Image.js +17 -0
  48. package/lib/commonjs/components/Layout.js +12 -2
  49. package/lib/commonjs/components/NumberInput.js +21 -8
  50. package/lib/commonjs/components/Picker/Picker.js +42 -9
  51. package/lib/commonjs/components/Picker/PickerComponent.android.js +23 -6
  52. package/lib/commonjs/components/Picker/PickerComponent.ios.js +27 -8
  53. package/lib/commonjs/components/Picker/PickerComponent.web.js +23 -6
  54. package/lib/commonjs/components/Portal/Portal.js +14 -4
  55. package/lib/commonjs/components/Portal/PortalConsumer.js +15 -5
  56. package/lib/commonjs/components/Portal/PortalHost.js +31 -4
  57. package/lib/commonjs/components/Portal/PortalManager.js +19 -7
  58. package/lib/commonjs/components/ProgressBar.js +25 -5
  59. package/lib/commonjs/components/ProgressCircle.js +10 -0
  60. package/lib/commonjs/components/ProgressIndicator.js +9 -0
  61. package/lib/commonjs/components/RadioButton/RadioButton.js +14 -1
  62. package/lib/commonjs/components/RadioButton/RadioButtonFieldGroup.js +10 -0
  63. package/lib/commonjs/components/RadioButton/RadioButtonGroup.js +14 -0
  64. package/lib/commonjs/components/RadioButton/RadioButtonRow.js +21 -1
  65. package/lib/commonjs/components/RadioButton/context.js +5 -0
  66. package/lib/commonjs/components/RadioButton/index.js +5 -0
  67. package/lib/commonjs/components/Row.js +11 -0
  68. package/lib/commonjs/components/RowBodyIcon.js +10 -0
  69. package/lib/commonjs/components/RowHeadlineImageCaption.js +11 -2
  70. package/lib/commonjs/components/RowHeadlineImageIcon.js +10 -0
  71. package/lib/commonjs/components/SVG.js +9 -0
  72. package/lib/commonjs/components/ScreenContainer.js +14 -0
  73. package/lib/commonjs/components/Slider.js +21 -0
  74. package/lib/commonjs/components/StarRating.js +10 -0
  75. package/lib/commonjs/components/StepIndicator.js +39 -5
  76. package/lib/commonjs/components/Stepper.js +26 -7
  77. package/lib/commonjs/components/Surface.js +14 -0
  78. package/lib/commonjs/components/Swiper/Swiper.js +8 -0
  79. package/lib/commonjs/components/Swiper/SwiperItem.js +6 -0
  80. package/lib/commonjs/components/Swiper/index.js +3 -0
  81. package/lib/commonjs/components/Switch.js +18 -5
  82. package/lib/commonjs/components/Text.js +18 -3
  83. package/lib/commonjs/components/TextField.js +62 -12
  84. package/lib/commonjs/components/ToggleButton.js +14 -0
  85. package/lib/commonjs/components/Touchable.js +5 -0
  86. package/lib/commonjs/components/Touchable.web.js +2 -0
  87. package/lib/commonjs/components/Typography.js +5 -0
  88. package/lib/commonjs/components/useAuthState.js +9 -0
  89. package/lib/commonjs/constants.js +4 -0
  90. package/lib/commonjs/hooks.js +7 -4
  91. package/lib/commonjs/index.js +52 -13
  92. package/lib/commonjs/interfaces/Icon.js +5 -3
  93. package/lib/commonjs/mappings/Accordion.js +2 -0
  94. package/lib/commonjs/mappings/AccordionItem.js +2 -0
  95. package/lib/commonjs/mappings/ActionSheet.js +2 -0
  96. package/lib/commonjs/mappings/ActionSheetCancel.js +2 -0
  97. package/lib/commonjs/mappings/ActionSheetItem.js +2 -0
  98. package/lib/commonjs/mappings/ActivityIndicator.js +2 -0
  99. package/lib/commonjs/mappings/AudioPlayer.js +2 -0
  100. package/lib/commonjs/mappings/AvatarEdit.js +2 -0
  101. package/lib/commonjs/mappings/Banner.js +2 -0
  102. package/lib/commonjs/mappings/BlurView.js +2 -0
  103. package/lib/commonjs/mappings/Button.js +5 -6
  104. package/lib/commonjs/mappings/Card.js +4 -3
  105. package/lib/commonjs/mappings/CardBlock.js +5 -6
  106. package/lib/commonjs/mappings/CardContainer.js +7 -5
  107. package/lib/commonjs/mappings/CardContainerRating.js +4 -4
  108. package/lib/commonjs/mappings/CardContainerShortImage.js +2 -0
  109. package/lib/commonjs/mappings/CardInline.js +2 -0
  110. package/lib/commonjs/mappings/Carousel.js +2 -0
  111. package/lib/commonjs/mappings/Checkbox.js +2 -0
  112. package/lib/commonjs/mappings/CheckboxGroup.js +2 -0
  113. package/lib/commonjs/mappings/CheckboxRow.js +2 -0
  114. package/lib/commonjs/mappings/CircleImage.js +2 -0
  115. package/lib/commonjs/mappings/Container.js +2 -0
  116. package/lib/commonjs/mappings/CustomCode.js +2 -0
  117. package/lib/commonjs/mappings/DatePicker.js +4 -4
  118. package/lib/commonjs/mappings/Divider.js +2 -0
  119. package/lib/commonjs/mappings/FAB.js +2 -0
  120. package/lib/commonjs/mappings/Fetch.js +2 -0
  121. package/lib/commonjs/mappings/FieldSearchBarFull.js +3 -2
  122. package/lib/commonjs/mappings/FlashList.js +2 -0
  123. package/lib/commonjs/mappings/FlatList.js +2 -0
  124. package/lib/commonjs/mappings/HeaderLarge.js +2 -0
  125. package/lib/commonjs/mappings/HeaderMedium.js +2 -0
  126. package/lib/commonjs/mappings/HeaderOverline.js +2 -0
  127. package/lib/commonjs/mappings/HtmlElements.js +125 -0
  128. package/lib/commonjs/mappings/Icon.js +3 -2
  129. package/lib/commonjs/mappings/IconButton.js +2 -0
  130. package/lib/commonjs/mappings/Image.js +2 -0
  131. package/lib/commonjs/mappings/ImageBackground.js +2 -0
  132. package/lib/commonjs/mappings/KeyboardAvoidingView.js +2 -0
  133. package/lib/commonjs/mappings/KeyboardAwareScrollView.js +2 -0
  134. package/lib/commonjs/mappings/Layout.js +2 -0
  135. package/lib/commonjs/mappings/LinearGradient.js +2 -0
  136. package/lib/commonjs/mappings/MapCallout.js +2 -0
  137. package/lib/commonjs/mappings/MapMarker.js +2 -0
  138. package/lib/commonjs/mappings/MapView.js +2 -0
  139. package/lib/commonjs/mappings/Modal.js +2 -0
  140. package/lib/commonjs/mappings/NumberInput.js +4 -4
  141. package/lib/commonjs/mappings/Picker.js +4 -4
  142. package/lib/commonjs/mappings/ProgressBar.js +2 -0
  143. package/lib/commonjs/mappings/ProgressCircle.js +2 -0
  144. package/lib/commonjs/mappings/ProgressIndicator.js +2 -0
  145. package/lib/commonjs/mappings/RadioButton.js +2 -0
  146. package/lib/commonjs/mappings/RadioButtonGroup.js +2 -0
  147. package/lib/commonjs/mappings/RadioButtonRow.js +2 -0
  148. package/lib/commonjs/mappings/RowBodyIcon.js +2 -0
  149. package/lib/commonjs/mappings/RowHeadlineImageCaption.js +2 -0
  150. package/lib/commonjs/mappings/RowHeadlineImageIcon.js +8 -12
  151. package/lib/commonjs/mappings/SVG.js +2 -0
  152. package/lib/commonjs/mappings/SafeAreaView.js +2 -0
  153. package/lib/commonjs/mappings/ScrollView.js +2 -0
  154. package/lib/commonjs/mappings/Slider.js +2 -0
  155. package/lib/commonjs/mappings/StarRating.js +3 -1
  156. package/lib/commonjs/mappings/Stepper.js +3 -1
  157. package/lib/commonjs/mappings/Surface.js +2 -0
  158. package/lib/commonjs/mappings/Swiper.js +2 -0
  159. package/lib/commonjs/mappings/SwiperItem.js +2 -0
  160. package/lib/commonjs/mappings/Switch.js +2 -0
  161. package/lib/commonjs/mappings/Text.js +5 -5
  162. package/lib/commonjs/mappings/TextArea.js +3 -2
  163. package/lib/commonjs/mappings/TextField.js +8 -7
  164. package/lib/commonjs/mappings/TextInput.js +3 -2
  165. package/lib/commonjs/mappings/ToggleButton.js +2 -0
  166. package/lib/commonjs/mappings/Touchable.js +2 -0
  167. package/lib/commonjs/mappings/Video.js +2 -0
  168. package/lib/commonjs/mappings/View.js +2 -0
  169. package/lib/commonjs/mappings/WebView.js +2 -0
  170. package/lib/commonjs/styles/DarkTheme.js +6 -5
  171. package/lib/commonjs/styles/DefaultTheme.js +17 -26
  172. package/lib/commonjs/styles/fonts.js +5 -3
  173. package/lib/commonjs/styles/overlay.js +14 -5
  174. package/lib/commonjs/styles/shadow.js +9 -0
  175. package/lib/commonjs/theming.js +4 -0
  176. package/lib/commonjs/utilities.js +14 -2
  177. package/lib/module/Provider.js +1 -0
  178. package/lib/module/components/Accordion/AccordionGroup.js +4 -0
  179. package/lib/module/components/Accordion/AccordionItem.js +3 -0
  180. package/lib/module/components/ActionSheet/ActionSheet.js +2 -0
  181. package/lib/module/components/ActionSheet/ActionSheetCancel.js +2 -0
  182. package/lib/module/components/ActionSheet/ActionSheetItem.js +2 -0
  183. package/lib/module/components/AnimatedCircularProgress.js +6 -0
  184. package/lib/module/components/AspectRatio.js +6 -0
  185. package/lib/module/components/AvatarEdit.js +3 -0
  186. package/lib/module/components/Banner.js +10 -9
  187. package/lib/module/components/Button.js +10 -2
  188. package/lib/module/components/Card.js +2 -0
  189. package/lib/module/components/CardBlock.js +6 -0
  190. package/lib/module/components/CardContainer.js +7 -0
  191. package/lib/module/components/CardContainerRating.js +8 -2
  192. package/lib/module/components/CardContainerShortImage.js +3 -0
  193. package/lib/module/components/CardInline.js +2 -0
  194. package/lib/module/components/Carousel.js +9 -3
  195. package/lib/module/components/Checkbox/Checkbox.js +9 -3
  196. package/lib/module/components/Checkbox/CheckboxGroup.js +5 -0
  197. package/lib/module/components/Checkbox/CheckboxGroupRow.js +8 -0
  198. package/lib/module/components/Checkbox/CheckboxRow.js +11 -3
  199. package/lib/module/components/Checkbox/context.js +2 -0
  200. package/lib/module/components/CircleImage.js +3 -0
  201. package/lib/module/components/CircularProgress.js +9 -3
  202. package/lib/module/components/Config.js +11 -5
  203. package/lib/module/components/Container.js +3 -0
  204. package/lib/module/components/DatePicker/DatePicker.js +33 -16
  205. package/lib/module/components/DatePicker/DatePickerComponent.js +2 -0
  206. package/lib/module/components/DatePicker/DatePickerComponent.web.js +2 -0
  207. package/lib/module/components/DeprecatedButton.js +9 -0
  208. package/lib/module/components/DeprecatedCardWrapper.js +6 -0
  209. package/lib/module/components/DeprecatedFAB.js +13 -0
  210. package/lib/module/components/Divider.js +3 -0
  211. package/lib/module/components/Elevation.js +3 -0
  212. package/lib/module/components/FAB.js +3 -0
  213. package/lib/module/components/FieldSearchBarFull.js +9 -0
  214. package/lib/module/components/FormRow.js +1 -0
  215. package/lib/module/components/Header.js +2 -0
  216. package/lib/module/components/HeaderLarge.js +2 -0
  217. package/lib/module/components/HeaderMedium.js +2 -0
  218. package/lib/module/components/HeaderOverline.js +2 -0
  219. package/lib/module/components/IconButton.js +3 -0
  220. package/lib/module/components/Image.js +10 -0
  221. package/lib/module/components/Layout.js +3 -4
  222. package/lib/module/components/NumberInput.js +16 -8
  223. package/lib/module/components/Picker/Picker.js +25 -8
  224. package/lib/module/components/Picker/PickerComponent.android.js +10 -6
  225. package/lib/module/components/Picker/PickerComponent.ios.js +11 -8
  226. package/lib/module/components/Picker/PickerComponent.web.js +10 -6
  227. package/lib/module/components/Portal/Portal.js +6 -4
  228. package/lib/module/components/Portal/PortalConsumer.js +10 -5
  229. package/lib/module/components/Portal/PortalHost.js +22 -4
  230. package/lib/module/components/Portal/PortalManager.js +14 -7
  231. package/lib/module/components/ProgressBar.js +17 -5
  232. package/lib/module/components/ProgressCircle.js +2 -0
  233. package/lib/module/components/ProgressIndicator.js +2 -0
  234. package/lib/module/components/RadioButton/RadioButton.js +6 -1
  235. package/lib/module/components/RadioButton/RadioButtonFieldGroup.js +3 -0
  236. package/lib/module/components/RadioButton/RadioButtonGroup.js +7 -0
  237. package/lib/module/components/RadioButton/RadioButtonRow.js +9 -1
  238. package/lib/module/components/RadioButton/context.js +2 -0
  239. package/lib/module/components/Row.js +2 -0
  240. package/lib/module/components/RowBodyIcon.js +2 -0
  241. package/lib/module/components/RowHeadlineImageCaption.js +3 -2
  242. package/lib/module/components/RowHeadlineImageIcon.js +2 -0
  243. package/lib/module/components/SVG.js +2 -0
  244. package/lib/module/components/ScreenContainer.js +6 -0
  245. package/lib/module/components/Slider.js +10 -0
  246. package/lib/module/components/StarRating.js +3 -0
  247. package/lib/module/components/StepIndicator.js +29 -5
  248. package/lib/module/components/Stepper.js +16 -9
  249. package/lib/module/components/Surface.js +5 -0
  250. package/lib/module/components/Swiper/Swiper.js +4 -0
  251. package/lib/module/components/Swiper/SwiperItem.js +2 -0
  252. package/lib/module/components/Switch.js +7 -5
  253. package/lib/module/components/Text.js +10 -3
  254. package/lib/module/components/TextField.js +50 -12
  255. package/lib/module/components/ToggleButton.js +5 -0
  256. package/lib/module/components/Touchable.js +1 -0
  257. package/lib/module/components/useAuthState.js +4 -0
  258. package/lib/module/constants.js +1 -2
  259. package/lib/module/hooks.js +2 -4
  260. package/lib/module/index.js +2 -5
  261. package/lib/module/interfaces/Icon.js +1 -2
  262. package/lib/module/mappings/Button.js +3 -6
  263. package/lib/module/mappings/Card.js +2 -3
  264. package/lib/module/mappings/CardBlock.js +3 -6
  265. package/lib/module/mappings/CardContainer.js +5 -5
  266. package/lib/module/mappings/CardContainerRating.js +2 -4
  267. package/lib/module/mappings/DatePicker.js +2 -4
  268. package/lib/module/mappings/Fetch.js +1 -0
  269. package/lib/module/mappings/FieldSearchBarFull.js +1 -2
  270. package/lib/module/mappings/HtmlElements.js +116 -0
  271. package/lib/module/mappings/Icon.js +1 -2
  272. package/lib/module/mappings/NumberInput.js +2 -4
  273. package/lib/module/mappings/Picker.js +2 -4
  274. package/lib/module/mappings/RowHeadlineImageIcon.js +6 -12
  275. package/lib/module/mappings/StarRating.js +1 -1
  276. package/lib/module/mappings/Stepper.js +2 -2
  277. package/lib/module/mappings/Text.js +3 -5
  278. package/lib/module/mappings/TextArea.js +1 -2
  279. package/lib/module/mappings/TextField.js +6 -7
  280. package/lib/module/mappings/TextInput.js +1 -2
  281. package/lib/module/styles/DarkTheme.js +2 -4
  282. package/lib/module/styles/DefaultTheme.js +13 -26
  283. package/lib/module/styles/fonts.js +1 -2
  284. package/lib/module/styles/overlay.js +10 -4
  285. package/lib/module/styles/shadow.js +6 -0
  286. package/lib/module/utilities.js +5 -2
  287. package/lib/typescript/src/components/Stepper.d.ts +1 -2
  288. package/lib/typescript/src/index.d.ts +0 -1
  289. package/lib/typescript/src/mappings/HtmlElements.d.ts +49 -0
  290. package/package.json +5 -6
  291. package/src/components/Picker/Picker.js +1 -1
  292. package/src/components/Picker/Picker.tsx +2 -2
  293. package/src/components/Stepper.js +5 -3
  294. package/src/components/Stepper.tsx +5 -5
  295. package/src/index.js +0 -1
  296. package/src/index.tsx +0 -1
  297. package/src/mappings/HtmlElements.js +141 -0
  298. package/src/mappings/HtmlElements.ts +151 -0
  299. package/src/mappings/Stepper.js +5 -2
  300. package/src/mappings/Stepper.ts +5 -1
  301. package/lib/commonjs/components/TabView/TabView.js +0 -87
  302. package/lib/commonjs/components/TabView/TabViewItem.js +0 -24
  303. package/lib/commonjs/components/TabView/index.js +0 -20
  304. package/lib/commonjs/mappings/TabView.js +0 -77
  305. package/lib/module/components/TabView/TabView.js +0 -79
  306. package/lib/module/components/TabView/TabViewItem.js +0 -17
  307. package/lib/module/components/TabView/index.js +0 -2
  308. package/lib/module/mappings/TabView.js +0 -70
  309. package/lib/typescript/src/components/TabView/TabView.d.ts +0 -19
  310. package/lib/typescript/src/components/TabView/TabViewItem.d.ts +0 -10
  311. package/lib/typescript/src/components/TabView/index.d.ts +0 -2
  312. package/lib/typescript/src/mappings/TabView.d.ts +0 -111
  313. package/src/components/TabView/TabView.js +0 -34
  314. package/src/components/TabView/TabView.tsx +0 -97
  315. package/src/components/TabView/TabViewItem.js +0 -5
  316. package/src/components/TabView/TabViewItem.tsx +0 -21
  317. package/src/components/TabView/index.js +0 -2
  318. package/src/components/TabView/index.tsx +0 -2
  319. package/src/mappings/TabView.js +0 -73
  320. package/src/mappings/TabView.ts +0 -80
package/src/index.tsx CHANGED
@@ -34,7 +34,6 @@ export {
34
34
  ActionSheetCancel,
35
35
  } from "./components/ActionSheet";
36
36
  export { Swiper, SwiperItem } from "./components/Swiper";
37
- export { TabView, TabViewItem } from "./components/TabView";
38
37
 
39
38
  export {
40
39
  Center,
@@ -0,0 +1,141 @@
1
+ import { COMPONENT_TYPES, createTextProp, FORM_TYPES, GROUPS, StylesPanelSections, Triggers, } from "@draftbit/types";
2
+ const SEED_DATA_TRIGGERS = [Triggers.OnValueChange];
3
+ const ELEMENT_PROPS = {
4
+ category: COMPONENT_TYPES.deprecated,
5
+ doc_link: "https://www.npmjs.com/package/@expo/html-elements",
6
+ code_link: "https://github.com/expo/expo/tree/master/packages/html-elements",
7
+ stylesPanelSections: [
8
+ StylesPanelSections.Typography,
9
+ StylesPanelSections.LayoutSelectedItem,
10
+ StylesPanelSections.MarginsAndPaddings,
11
+ StylesPanelSections.Effects,
12
+ ],
13
+ layout: {
14
+ margin: 0,
15
+ },
16
+ triggers: SEED_DATA_TRIGGERS,
17
+ };
18
+ const HEADING_PROPS = {
19
+ ...ELEMENT_PROPS,
20
+ };
21
+ export const SEED_DATA = [
22
+ {
23
+ name: "H1",
24
+ tag: "H1",
25
+ ...HEADING_PROPS,
26
+ },
27
+ {
28
+ name: "H2",
29
+ tag: "H2",
30
+ ...HEADING_PROPS,
31
+ },
32
+ {
33
+ name: "H3",
34
+ tag: "H3",
35
+ ...HEADING_PROPS,
36
+ },
37
+ {
38
+ name: "H4",
39
+ tag: "H4",
40
+ ...HEADING_PROPS,
41
+ },
42
+ {
43
+ name: "H5",
44
+ tag: "H5",
45
+ ...HEADING_PROPS,
46
+ },
47
+ {
48
+ name: "H6",
49
+ tag: "H6",
50
+ ...HEADING_PROPS,
51
+ },
52
+ {
53
+ name: "Anchor",
54
+ tag: "A",
55
+ ...ELEMENT_PROPS,
56
+ props: {
57
+ href: createTextProp({
58
+ label: "href",
59
+ description: "Specify the URL",
60
+ defaultValue: "",
61
+ }),
62
+ target: {
63
+ group: GROUPS.basic,
64
+ label: "target",
65
+ description: "decide where link should open",
66
+ formType: FORM_TYPES.flatArray,
67
+ defaultValue: "_blank",
68
+ options: ["_blank", "_self", "_parent", "_top"],
69
+ },
70
+ },
71
+ },
72
+ {
73
+ name: "Paragraph",
74
+ tag: "P",
75
+ ...ELEMENT_PROPS,
76
+ props: {
77
+ // NOTE - Keeping the props commented until we figure out a way to use this props from draftbit side.
78
+ // strong: createBoolProp({
79
+ // label: "Strong",
80
+ // description: "Strong",
81
+ // }),
82
+ // strike: createBoolProp({
83
+ // label: "Strike",
84
+ // description: "Strike through",
85
+ // }),
86
+ // italic: createBoolProp({
87
+ // label: "Italic",
88
+ // description: "Italic Fonts",
89
+ // }),
90
+ // bold: createBoolProp({
91
+ // label: "Bold",
92
+ // description: "Bold",
93
+ // }),
94
+ },
95
+ },
96
+ {
97
+ name: "Code",
98
+ tag: "Code",
99
+ ...ELEMENT_PROPS,
100
+ },
101
+ {
102
+ name: "Pre",
103
+ tag: "Pre",
104
+ ...ELEMENT_PROPS,
105
+ },
106
+ {
107
+ name: "Mark",
108
+ tag: "Mark",
109
+ ...ELEMENT_PROPS,
110
+ },
111
+ {
112
+ name: "BR",
113
+ tag: "BR",
114
+ ...ELEMENT_PROPS,
115
+ },
116
+ {
117
+ name: "BlockQuote",
118
+ tag: "BlockQuote",
119
+ ...ELEMENT_PROPS,
120
+ },
121
+ {
122
+ name: "Time",
123
+ tag: "Time",
124
+ ...ELEMENT_PROPS,
125
+ },
126
+ {
127
+ name: "UL",
128
+ tag: "UL",
129
+ ...ELEMENT_PROPS,
130
+ },
131
+ {
132
+ name: "LI",
133
+ tag: "LI",
134
+ ...ELEMENT_PROPS,
135
+ },
136
+ {
137
+ name: "HR",
138
+ tag: "HR",
139
+ ...ELEMENT_PROPS,
140
+ },
141
+ ];
@@ -0,0 +1,151 @@
1
+ import {
2
+ COMPONENT_TYPES,
3
+ createTextProp,
4
+ FORM_TYPES,
5
+ GROUPS,
6
+ StylesPanelSections,
7
+ Triggers,
8
+ } from "@draftbit/types";
9
+ const SEED_DATA_TRIGGERS = [Triggers.OnValueChange];
10
+
11
+ const ELEMENT_PROPS = {
12
+ category: COMPONENT_TYPES.deprecated,
13
+ doc_link: "https://www.npmjs.com/package/@expo/html-elements",
14
+ code_link: "https://github.com/expo/expo/tree/master/packages/html-elements",
15
+ stylesPanelSections: [
16
+ StylesPanelSections.Typography,
17
+ StylesPanelSections.LayoutSelectedItem,
18
+ StylesPanelSections.MarginsAndPaddings,
19
+ StylesPanelSections.Effects,
20
+ ],
21
+ layout: {
22
+ margin: 0,
23
+ },
24
+ triggers: SEED_DATA_TRIGGERS,
25
+ };
26
+
27
+ const HEADING_PROPS = {
28
+ ...ELEMENT_PROPS,
29
+ };
30
+
31
+ export const SEED_DATA = [
32
+ {
33
+ name: "H1",
34
+ tag: "H1",
35
+ ...HEADING_PROPS,
36
+ },
37
+ {
38
+ name: "H2",
39
+ tag: "H2",
40
+ ...HEADING_PROPS,
41
+ },
42
+ {
43
+ name: "H3",
44
+ tag: "H3",
45
+ ...HEADING_PROPS,
46
+ },
47
+ {
48
+ name: "H4",
49
+ tag: "H4",
50
+ ...HEADING_PROPS,
51
+ },
52
+ {
53
+ name: "H5",
54
+ tag: "H5",
55
+ ...HEADING_PROPS,
56
+ },
57
+ {
58
+ name: "H6",
59
+ tag: "H6",
60
+ ...HEADING_PROPS,
61
+ },
62
+ {
63
+ name: "Anchor",
64
+ tag: "A",
65
+ ...ELEMENT_PROPS,
66
+ props: {
67
+ href: createTextProp({
68
+ label: "href",
69
+ description: "Specify the URL",
70
+ defaultValue: "",
71
+ }),
72
+ target: {
73
+ group: GROUPS.basic,
74
+ label: "target",
75
+ description: "decide where link should open",
76
+ formType: FORM_TYPES.flatArray,
77
+ defaultValue: "_blank",
78
+ options: ["_blank", "_self", "_parent", "_top"],
79
+ },
80
+ },
81
+ },
82
+ {
83
+ name: "Paragraph",
84
+ tag: "P",
85
+ ...ELEMENT_PROPS,
86
+ props: {
87
+ // NOTE - Keeping the props commented until we figure out a way to use this props from draftbit side.
88
+ // strong: createBoolProp({
89
+ // label: "Strong",
90
+ // description: "Strong",
91
+ // }),
92
+ // strike: createBoolProp({
93
+ // label: "Strike",
94
+ // description: "Strike through",
95
+ // }),
96
+ // italic: createBoolProp({
97
+ // label: "Italic",
98
+ // description: "Italic Fonts",
99
+ // }),
100
+ // bold: createBoolProp({
101
+ // label: "Bold",
102
+ // description: "Bold",
103
+ // }),
104
+ },
105
+ },
106
+ {
107
+ name: "Code",
108
+ tag: "Code",
109
+ ...ELEMENT_PROPS,
110
+ },
111
+ {
112
+ name: "Pre",
113
+ tag: "Pre",
114
+ ...ELEMENT_PROPS,
115
+ },
116
+ {
117
+ name: "Mark",
118
+ tag: "Mark",
119
+ ...ELEMENT_PROPS,
120
+ },
121
+ {
122
+ name: "BR",
123
+ tag: "BR",
124
+ ...ELEMENT_PROPS,
125
+ },
126
+ {
127
+ name: "BlockQuote",
128
+ tag: "BlockQuote",
129
+ ...ELEMENT_PROPS,
130
+ },
131
+ {
132
+ name: "Time",
133
+ tag: "Time",
134
+ ...ELEMENT_PROPS,
135
+ },
136
+ {
137
+ name: "UL",
138
+ tag: "UL",
139
+ ...ELEMENT_PROPS,
140
+ },
141
+ {
142
+ name: "LI",
143
+ tag: "LI",
144
+ ...ELEMENT_PROPS,
145
+ },
146
+ {
147
+ name: "HR",
148
+ tag: "HR",
149
+ ...ELEMENT_PROPS,
150
+ },
151
+ ];
@@ -1,11 +1,14 @@
1
- import { COMPONENT_TYPES, createIconSizeProp, createColorProp, createFieldNameProp, createStaticNumberProp, Triggers, BLOCK_STYLES_SECTIONS, } from "@draftbit/types";
1
+ import { COMPONENT_TYPES, createIconSizeProp, createColorProp, createFieldNameProp, createStaticNumberProp, Triggers, BLOCK_STYLES_SECTIONS, StylesPanelSections, } from "@draftbit/types";
2
2
  export const SEED_DATA = [
3
3
  {
4
4
  name: "Stepper",
5
5
  tag: "Stepper",
6
6
  description: "A component used to control the quantity of something",
7
7
  category: COMPONENT_TYPES.control,
8
- stylesPanelSections: BLOCK_STYLES_SECTIONS,
8
+ stylesPanelSections: [
9
+ StylesPanelSections.Typography,
10
+ ...BLOCK_STYLES_SECTIONS,
11
+ ],
9
12
  layout: {},
10
13
  triggers: [Triggers.OnChange],
11
14
  props: {
@@ -6,6 +6,7 @@ import {
6
6
  createStaticNumberProp,
7
7
  Triggers,
8
8
  BLOCK_STYLES_SECTIONS,
9
+ StylesPanelSections,
9
10
  } from "@draftbit/types";
10
11
 
11
12
  export const SEED_DATA = [
@@ -14,7 +15,10 @@ export const SEED_DATA = [
14
15
  tag: "Stepper",
15
16
  description: "A component used to control the quantity of something",
16
17
  category: COMPONENT_TYPES.control,
17
- stylesPanelSections: BLOCK_STYLES_SECTIONS,
18
+ stylesPanelSections: [
19
+ StylesPanelSections.Typography,
20
+ ...BLOCK_STYLES_SECTIONS,
21
+ ],
18
22
  layout: {},
19
23
  triggers: [Triggers.OnChange],
20
24
  props: {
@@ -1,87 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var React = _interopRequireWildcard(require("react"));
8
- var _reactNativeTabView = require("react-native-tab-view");
9
- var _TabViewItem = _interopRequireDefault(require("./TabViewItem"));
10
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
- 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); }
12
- 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; }
13
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
14
- const TabViewComponent = _ref => {
15
- let {
16
- Icon,
17
- tabBarPosition,
18
- keyboardDismissMode,
19
- swipeEnabled,
20
- scrollEnabled,
21
- activeColor,
22
- inactiveColor,
23
- pressColor,
24
- indicatorColor,
25
- style,
26
- children
27
- } = _ref;
28
- const [index, setIndex] = React.useState(0);
29
- const [routes, setRoutes] = React.useState([]);
30
- const [tabScenes, setTabScenes] = React.useState({});
31
- React.useEffect(() => {
32
- const newRoutes = [];
33
- const scenes = {};
34
- React.Children.toArray(children).filter(child => child.type === _TabViewItem.default).forEach(child => {
35
- var _child$props;
36
- if (child !== null && child !== void 0 && (_child$props = child.props) !== null && _child$props !== void 0 && _child$props.id) {
37
- var _child$props2, _child$props3;
38
- newRoutes.push({
39
- key: child === null || child === void 0 ? void 0 : (_child$props2 = child.props) === null || _child$props2 === void 0 ? void 0 : _child$props2.id,
40
- ...(child === null || child === void 0 ? void 0 : child.props)
41
- });
42
- scenes[child === null || child === void 0 ? void 0 : (_child$props3 = child.props) === null || _child$props3 === void 0 ? void 0 : _child$props3.id] = () => child;
43
- }
44
- });
45
- setRoutes(newRoutes);
46
- setTabScenes(scenes);
47
- }, [children]);
48
- const indexChangeHandler = i => setIndex(i);
49
- const renderTabBar = props => {
50
- console.log(props);
51
- return /*#__PURE__*/React.createElement(_reactNativeTabView.TabBar, _extends({}, props, {
52
- activeColor: activeColor,
53
- inactiveColor: inactiveColor,
54
- pressColor: pressColor,
55
- scrollEnabled: scrollEnabled,
56
- indicatorStyle: {
57
- backgroundColor: indicatorColor
58
- },
59
- renderIcon: _ref2 => {
60
- let {
61
- route,
62
- color
63
- } = _ref2;
64
- return route !== null && route !== void 0 && route.icon ? /*#__PURE__*/React.createElement(Icon, {
65
- name: route.icon,
66
- color: color,
67
- size: 36
68
- }) : null;
69
- },
70
- style: style
71
- }));
72
- };
73
- return /*#__PURE__*/React.createElement(_reactNativeTabView.TabView, {
74
- navigationState: {
75
- index,
76
- routes
77
- },
78
- renderScene: (0, _reactNativeTabView.SceneMap)(tabScenes),
79
- renderTabBar: renderTabBar,
80
- onIndexChange: indexChangeHandler,
81
- tabBarPosition: tabBarPosition,
82
- keyboardDismissMode: keyboardDismissMode,
83
- swipeEnabled: swipeEnabled
84
- });
85
- };
86
- var _default = TabViewComponent;
87
- exports.default = _default;
@@ -1,24 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- const TabViewItem = _ref => {
8
- let {
9
- title,
10
- id,
11
- icon,
12
- children,
13
- accessibilityLabel
14
- } = _ref;
15
- console.log({
16
- title,
17
- id,
18
- icon,
19
- accessibilityLabel
20
- });
21
- return children;
22
- };
23
- var _default = TabViewItem;
24
- exports.default = _default;
@@ -1,20 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "TabView", {
7
- enumerable: true,
8
- get: function () {
9
- return _TabView.default;
10
- }
11
- });
12
- Object.defineProperty(exports, "TabViewItem", {
13
- enumerable: true,
14
- get: function () {
15
- return _TabViewItem.default;
16
- }
17
- });
18
- var _TabView = _interopRequireDefault(require("./TabView"));
19
- var _TabViewItem = _interopRequireDefault(require("./TabViewItem"));
20
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -1,77 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.SEED_DATA = void 0;
7
- var _types = require("@draftbit/types");
8
- const SEED_DATA = [{
9
- name: "Tab View",
10
- tag: "TabView",
11
- category: _types.COMPONENT_TYPES.container,
12
- layout: {},
13
- props: {
14
- tabBarPosition: (0, _types.createTextEnumProp)({
15
- label: "Tab Bar Position",
16
- description: "Tab Bar Position",
17
- options: ["top", "bottom"],
18
- defaultValue: "top"
19
- }),
20
- keyboardDismissMode: (0, _types.createTextEnumProp)({
21
- label: "Keyboard Dismiss Mode",
22
- description: "Keyboard Dismiss Mode",
23
- options: ["auto", "on-drag", "none"],
24
- defaultValue: "auto"
25
- }),
26
- swipeEnabled: (0, _types.createBoolProp)({
27
- label: "Swipe Enabled",
28
- description: "Swipe Enabled",
29
- defaultValue: true
30
- }),
31
- scrollEnabled: (0, _types.createBoolProp)({
32
- label: "Scroll Enabled",
33
- description: "Scroll Enabled",
34
- defaultValue: true
35
- }),
36
- activeColor: (0, _types.createColorProp)({
37
- label: "Active Color",
38
- description: "Active Color",
39
- defaultValue: "primary"
40
- }),
41
- inactiveColor: (0, _types.createColorProp)({
42
- label: "Inactive Color",
43
- description: "Inactive Color",
44
- defaultValue: null
45
- }),
46
- pressColor: (0, _types.createColorProp)({
47
- label: "Press Color",
48
- description: "Press Color",
49
- defaultValue: null
50
- }),
51
- indicatorColor: (0, _types.createColorProp)({
52
- label: "Indicator Color",
53
- description: "Indicator Color",
54
- defaultValue: null
55
- })
56
- }
57
- }, {
58
- name: "Tab View Item",
59
- tag: "TabViewItem",
60
- category: _types.COMPONENT_TYPES.container,
61
- layout: {},
62
- props: {
63
- title: (0, _types.createTextProp)({
64
- label: "Title",
65
- description: "Tab Title"
66
- }),
67
- id: (0, _types.createTextProp)({
68
- label: "Id",
69
- description: "Tab Id"
70
- }),
71
- accessibilityLabel: (0, _types.createTextProp)({
72
- label: "Accessibility Label",
73
- description: "Accessibility Label"
74
- })
75
- }
76
- }];
77
- exports.SEED_DATA = SEED_DATA;
@@ -1,79 +0,0 @@
1
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
- import * as React from "react";
3
- import { TabView, TabBar, SceneMap } from "react-native-tab-view";
4
-
5
- // import { withTheme } from "../../theming";
6
- import TabViewItem from "./TabViewItem";
7
- const TabViewComponent = _ref => {
8
- let {
9
- Icon,
10
- tabBarPosition,
11
- keyboardDismissMode,
12
- swipeEnabled,
13
- scrollEnabled,
14
- activeColor,
15
- inactiveColor,
16
- pressColor,
17
- indicatorColor,
18
- style,
19
- children
20
- } = _ref;
21
- const [index, setIndex] = React.useState(0);
22
- const [routes, setRoutes] = React.useState([]);
23
- const [tabScenes, setTabScenes] = React.useState({});
24
- React.useEffect(() => {
25
- const newRoutes = [];
26
- const scenes = {};
27
- React.Children.toArray(children).filter(child => child.type === TabViewItem).forEach(child => {
28
- var _child$props;
29
- if (child !== null && child !== void 0 && (_child$props = child.props) !== null && _child$props !== void 0 && _child$props.id) {
30
- var _child$props2, _child$props3;
31
- newRoutes.push({
32
- key: child === null || child === void 0 ? void 0 : (_child$props2 = child.props) === null || _child$props2 === void 0 ? void 0 : _child$props2.id,
33
- ...(child === null || child === void 0 ? void 0 : child.props)
34
- });
35
- scenes[child === null || child === void 0 ? void 0 : (_child$props3 = child.props) === null || _child$props3 === void 0 ? void 0 : _child$props3.id] = () => child;
36
- }
37
- });
38
- setRoutes(newRoutes);
39
- setTabScenes(scenes);
40
- }, [children]);
41
- const indexChangeHandler = i => setIndex(i);
42
- const renderTabBar = props => {
43
- console.log(props);
44
- return /*#__PURE__*/React.createElement(TabBar, _extends({}, props, {
45
- activeColor: activeColor,
46
- inactiveColor: inactiveColor,
47
- pressColor: pressColor,
48
- scrollEnabled: scrollEnabled,
49
- indicatorStyle: {
50
- backgroundColor: indicatorColor
51
- },
52
- renderIcon: _ref2 => {
53
- let {
54
- route,
55
- color
56
- } = _ref2;
57
- return route !== null && route !== void 0 && route.icon ? /*#__PURE__*/React.createElement(Icon, {
58
- name: route.icon,
59
- color: color,
60
- size: 36
61
- }) : null;
62
- },
63
- style: style
64
- }));
65
- };
66
- return /*#__PURE__*/React.createElement(TabView, {
67
- navigationState: {
68
- index,
69
- routes
70
- },
71
- renderScene: SceneMap(tabScenes),
72
- renderTabBar: renderTabBar,
73
- onIndexChange: indexChangeHandler,
74
- tabBarPosition: tabBarPosition,
75
- keyboardDismissMode: keyboardDismissMode,
76
- swipeEnabled: swipeEnabled
77
- });
78
- };
79
- export default TabViewComponent;
@@ -1,17 +0,0 @@
1
- const TabViewItem = _ref => {
2
- let {
3
- title,
4
- id,
5
- icon,
6
- children,
7
- accessibilityLabel
8
- } = _ref;
9
- console.log({
10
- title,
11
- id,
12
- icon,
13
- accessibilityLabel
14
- });
15
- return children;
16
- };
17
- export default TabViewItem;
@@ -1,2 +0,0 @@
1
- export { default as TabView } from "./TabView";
2
- export { default as TabViewItem } from "./TabViewItem";