@draftbit/core 46.8.2-a9cd67.2 → 46.8.2-bdb2fb.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 (52) hide show
  1. package/lib/commonjs/components/Portal/PortalConsumer.js +7 -22
  2. package/lib/commonjs/components/TabView/TabView.js +113 -0
  3. package/lib/commonjs/components/TabView/TabViewItem.js +25 -0
  4. package/lib/commonjs/components/TabView/index.js +20 -0
  5. package/lib/commonjs/index.js +13 -7
  6. package/lib/commonjs/mappings/TabView.js +77 -0
  7. package/lib/commonjs/mappings/TabViewItem.js +37 -0
  8. package/lib/module/components/CircularProgress.js +8 -28
  9. package/lib/module/components/Portal/PortalManager.js +33 -7
  10. package/lib/module/components/TabView/TabView.js +103 -0
  11. package/lib/module/components/TabView/TabViewItem.js +20 -0
  12. package/lib/module/components/TabView/index.js +2 -0
  13. package/lib/module/index.js +1 -1
  14. package/lib/module/mappings/TabView.js +70 -0
  15. package/lib/module/mappings/TabViewItem.js +30 -0
  16. package/lib/module/styles/overlay.js +3 -1
  17. package/lib/typescript/src/components/TabView/TabView.d.ts +26 -0
  18. package/lib/typescript/src/components/TabView/TabView.d.ts.map +1 -0
  19. package/lib/typescript/src/components/TabView/TabViewItem.d.ts +11 -0
  20. package/lib/typescript/src/components/TabView/TabViewItem.d.ts.map +1 -0
  21. package/lib/typescript/src/components/TabView/index.d.ts +3 -0
  22. package/lib/typescript/src/components/TabView/index.d.ts.map +1 -0
  23. package/lib/typescript/src/index.d.ts +1 -1
  24. package/lib/typescript/src/index.d.ts.map +1 -1
  25. package/lib/typescript/src/mappings/TabView.d.ts +126 -0
  26. package/lib/typescript/src/mappings/TabView.d.ts.map +1 -0
  27. package/lib/typescript/src/mappings/{Markdown.d.ts → TabViewItem.d.ts} +10 -5
  28. package/lib/typescript/src/mappings/TabViewItem.d.ts.map +1 -0
  29. package/package.json +5 -4
  30. package/src/components/TabView/TabView.js +50 -0
  31. package/src/components/TabView/TabView.tsx +137 -0
  32. package/src/components/TabView/TabViewItem.js +11 -0
  33. package/src/components/TabView/TabViewItem.tsx +25 -0
  34. package/src/components/TabView/index.js +2 -0
  35. package/src/components/TabView/index.tsx +2 -0
  36. package/src/index.js +1 -1
  37. package/src/index.tsx +1 -1
  38. package/src/mappings/TabView.js +76 -0
  39. package/src/mappings/TabView.ts +86 -0
  40. package/src/mappings/TabViewItem.js +30 -0
  41. package/src/mappings/TabViewItem.ts +38 -0
  42. package/lib/commonjs/components/Markdown.js +0 -30
  43. package/lib/commonjs/mappings/Markdown.js +0 -27
  44. package/lib/module/components/Markdown.js +0 -20
  45. package/lib/module/mappings/Markdown.js +0 -20
  46. package/lib/typescript/src/components/Markdown.d.ts +0 -8
  47. package/lib/typescript/src/components/Markdown.d.ts.map +0 -1
  48. package/lib/typescript/src/mappings/Markdown.d.ts.map +0 -1
  49. package/src/components/Markdown.js +0 -10
  50. package/src/components/Markdown.tsx +0 -22
  51. package/src/mappings/Markdown.js +0 -25
  52. package/src/mappings/Markdown.ts +0 -32
@@ -0,0 +1,76 @@
1
+ import { COMPONENT_TYPES, createTextEnumProp, createColorProp, StylesPanelSections, Triggers, createActionProp, createStaticBoolProp, GROUPS, } from "@draftbit/types";
2
+ export const SEED_DATA = {
3
+ name: "Tab View",
4
+ tag: "TabView",
5
+ description: "Tab view container",
6
+ category: COMPONENT_TYPES.swiper,
7
+ stylesPanelSections: [
8
+ StylesPanelSections.Size,
9
+ StylesPanelSections.MarginsAndPaddings,
10
+ StylesPanelSections.Position,
11
+ StylesPanelSections.Effects,
12
+ StylesPanelSections.LayoutSelectedItem,
13
+ StylesPanelSections.Background,
14
+ StylesPanelSections.Typography,
15
+ ],
16
+ layout: { flex: 1 },
17
+ triggers: [Triggers.OnIndexChanged, Triggers.OnEndReached],
18
+ props: {
19
+ onIndexChanged: createActionProp({
20
+ label: "On index changed",
21
+ description: "Action to execute when swipe to new index",
22
+ }),
23
+ onEndReached: createActionProp({
24
+ label: "On end reached",
25
+ description: "Action to execute when end of swiping reached",
26
+ }),
27
+ tabBarPosition: createTextEnumProp({
28
+ label: "Tab Bar Position",
29
+ description: "Position of tab bar",
30
+ options: ["top", "bottom"],
31
+ defaultValue: "top",
32
+ }),
33
+ keyboardDismissMode: createTextEnumProp({
34
+ label: "Keyboard Dismiss Mode",
35
+ description: "Keyboard Dismiss Mode",
36
+ options: ["auto", "on-drag", "none"],
37
+ defaultValue: "auto",
38
+ }),
39
+ swipeEnabled: createStaticBoolProp({
40
+ label: "Swipe Enabled",
41
+ description: "Whether swiping is enabled or not",
42
+ defaultValue: true,
43
+ }),
44
+ scrollEnabled: createStaticBoolProp({
45
+ label: "Scroll Enabled",
46
+ description: "Whether scrolling of tabs is enabled or not",
47
+ defaultValue: false,
48
+ }),
49
+ activeColor: createColorProp({
50
+ label: "Active Color",
51
+ description: "Color of icon and text of active tab",
52
+ defaultValue: "primary",
53
+ }),
54
+ inactiveColor: createColorProp({
55
+ label: "Inactive Color",
56
+ description: "Color of icon and text of inactive tab(s)",
57
+ defaultValue: null,
58
+ }),
59
+ pressColor: createColorProp({
60
+ label: "Press Color",
61
+ description: "Color of ripple when pressed",
62
+ defaultValue: "primary",
63
+ group: GROUPS.android,
64
+ }),
65
+ indicatorColor: createColorProp({
66
+ label: "Indicator Color",
67
+ description: "Color of indicator",
68
+ defaultValue: "primary",
69
+ }),
70
+ tabsBackgroundColor: createColorProp({
71
+ label: "Tabs Background Color",
72
+ description: "Background color of tabs container",
73
+ defaultValue: "background",
74
+ }),
75
+ },
76
+ };
@@ -0,0 +1,86 @@
1
+ import {
2
+ COMPONENT_TYPES,
3
+ createTextEnumProp,
4
+ createColorProp,
5
+ StylesPanelSections,
6
+ Triggers,
7
+ createActionProp,
8
+ createStaticBoolProp,
9
+ GROUPS,
10
+ } from "@draftbit/types";
11
+
12
+ export const SEED_DATA = {
13
+ name: "Tab View",
14
+ tag: "TabView",
15
+ description: "Tab view container",
16
+ category: COMPONENT_TYPES.swiper,
17
+ stylesPanelSections: [
18
+ StylesPanelSections.Size,
19
+ StylesPanelSections.MarginsAndPaddings,
20
+ StylesPanelSections.Position,
21
+ StylesPanelSections.Effects,
22
+ StylesPanelSections.LayoutSelectedItem,
23
+ StylesPanelSections.Background,
24
+ StylesPanelSections.Typography,
25
+ ],
26
+ layout: { flex: 1 },
27
+ triggers: [Triggers.OnIndexChanged, Triggers.OnEndReached],
28
+ props: {
29
+ onIndexChanged: createActionProp({
30
+ label: "On index changed",
31
+ description: "Action to execute when swipe to new index",
32
+ }),
33
+ onEndReached: createActionProp({
34
+ label: "On end reached",
35
+ description: "Action to execute when end of swiping reached",
36
+ }),
37
+ tabBarPosition: createTextEnumProp({
38
+ label: "Tab Bar Position",
39
+ description: "Position of tab bar",
40
+ options: ["top", "bottom"],
41
+ defaultValue: "top",
42
+ }),
43
+ keyboardDismissMode: createTextEnumProp({
44
+ label: "Keyboard Dismiss Mode",
45
+ description: "Keyboard Dismiss Mode",
46
+ options: ["auto", "on-drag", "none"],
47
+ defaultValue: "auto",
48
+ }),
49
+ swipeEnabled: createStaticBoolProp({
50
+ label: "Swipe Enabled",
51
+ description: "Whether swiping is enabled or not",
52
+ defaultValue: true,
53
+ }),
54
+ scrollEnabled: createStaticBoolProp({
55
+ label: "Scroll Enabled",
56
+ description: "Whether scrolling of tabs is enabled or not",
57
+ defaultValue: false,
58
+ }),
59
+ activeColor: createColorProp({
60
+ label: "Active Color",
61
+ description: "Color of icon and text of active tab",
62
+ defaultValue: "primary",
63
+ }),
64
+ inactiveColor: createColorProp({
65
+ label: "Inactive Color",
66
+ description: "Color of icon and text of inactive tab(s)",
67
+ defaultValue: null,
68
+ }),
69
+ pressColor: createColorProp({
70
+ label: "Press Color",
71
+ description: "Color of ripple when pressed",
72
+ defaultValue: "primary",
73
+ group: GROUPS.android,
74
+ }),
75
+ indicatorColor: createColorProp({
76
+ label: "Indicator Color",
77
+ description: "Color of indicator",
78
+ defaultValue: "primary",
79
+ }),
80
+ tabsBackgroundColor: createColorProp({
81
+ label: "Tabs Background Color",
82
+ description: "Background color of tabs container",
83
+ defaultValue: "background",
84
+ }),
85
+ },
86
+ };
@@ -0,0 +1,30 @@
1
+ import { COMPONENT_TYPES, createTextProp, createIconProp, CONTAINER_COMPONENT_STYLES_SECTIONS, GROUPS, } from "@draftbit/types";
2
+ export const SEED_DATA = {
3
+ name: "Tab View Item",
4
+ tag: "TabViewItem",
5
+ description: "Single Tab View item to be used in TabView. Each item represents a single tab and its content",
6
+ category: COMPONENT_TYPES.swiper,
7
+ stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
8
+ layout: {
9
+ flex: 1,
10
+ },
11
+ props: {
12
+ title: createTextProp({
13
+ label: "Title",
14
+ description: "Title of tab item",
15
+ defaultValue: "Title",
16
+ required: true,
17
+ group: GROUPS.basic,
18
+ }),
19
+ icon: createIconProp({
20
+ defaultValue: null,
21
+ required: false,
22
+ }),
23
+ accessibilityLabel: createTextProp({
24
+ label: "Accessibility Label",
25
+ description: "Accessibility Label",
26
+ defaultValue: null,
27
+ group: GROUPS.accessibility,
28
+ }),
29
+ },
30
+ };
@@ -0,0 +1,38 @@
1
+ import {
2
+ COMPONENT_TYPES,
3
+ createTextProp,
4
+ createIconProp,
5
+ CONTAINER_COMPONENT_STYLES_SECTIONS,
6
+ GROUPS,
7
+ } from "@draftbit/types";
8
+
9
+ export const SEED_DATA = {
10
+ name: "Tab View Item",
11
+ tag: "TabViewItem",
12
+ description:
13
+ "Single Tab View item to be used in TabView. Each item represents a single tab and its content",
14
+ category: COMPONENT_TYPES.swiper,
15
+ stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
16
+ layout: {
17
+ flex: 1,
18
+ },
19
+ props: {
20
+ title: createTextProp({
21
+ label: "Title",
22
+ description: "Title of tab item",
23
+ defaultValue: "Title",
24
+ required: true,
25
+ group: GROUPS.basic,
26
+ }),
27
+ icon: createIconProp({
28
+ defaultValue: null,
29
+ required: false,
30
+ }),
31
+ accessibilityLabel: createTextProp({
32
+ label: "Accessibility Label",
33
+ description: "Accessibility Label",
34
+ defaultValue: null,
35
+ group: GROUPS.accessibility,
36
+ }),
37
+ },
38
+ };
@@ -1,30 +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 _reactNative = require("react-native");
9
- var _reactNativeMarkdownDisplay = _interopRequireDefault(require("react-native-markdown-display"));
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
- const Markdown = _ref => {
14
- let {
15
- children,
16
- style
17
- } = _ref;
18
- return (
19
- /*#__PURE__*/
20
- //'body' style applies to all markdown components
21
- //@ts-ignore TS does not like the type of this named style for some reason
22
- React.createElement(_reactNativeMarkdownDisplay.default, {
23
- style: {
24
- body: _reactNative.StyleSheet.flatten(style)
25
- }
26
- }, children)
27
- );
28
- };
29
- var _default = Markdown;
30
- exports.default = _default;
@@ -1,27 +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: "Markdown",
10
- tag: "Markdown",
11
- description: "A component that renders markdown",
12
- category: _types.COMPONENT_TYPES.text,
13
- stylesPanelSections: [_types.StylesPanelSections.Typography, _types.StylesPanelSections.LayoutSelectedItem, _types.StylesPanelSections.MarginsAndPaddings, _types.StylesPanelSections.Effects],
14
- props: {
15
- children: {
16
- group: _types.GROUPS.data,
17
- label: "Markdown Text",
18
- description: "Markdown text to be rendered ",
19
- editable: true,
20
- required: true,
21
- formType: _types.FORM_TYPES.string,
22
- propType: _types.PROP_TYPES.STRING,
23
- defaultValue: "### Markdown"
24
- }
25
- }
26
- };
27
- exports.SEED_DATA = SEED_DATA;
@@ -1,20 +0,0 @@
1
- import * as React from "react";
2
- import { StyleSheet } from "react-native";
3
- import MarkdownComponent from "react-native-markdown-display";
4
- const Markdown = _ref => {
5
- let {
6
- children,
7
- style
8
- } = _ref;
9
- return (
10
- /*#__PURE__*/
11
- //'body' style applies to all markdown components
12
- //@ts-ignore TS does not like the type of this named style for some reason
13
- React.createElement(MarkdownComponent, {
14
- style: {
15
- body: StyleSheet.flatten(style)
16
- }
17
- }, children)
18
- );
19
- };
20
- export default Markdown;
@@ -1,20 +0,0 @@
1
- import { COMPONENT_TYPES, FORM_TYPES, GROUPS, PROP_TYPES, StylesPanelSections } from "@draftbit/types";
2
- export const SEED_DATA = {
3
- name: "Markdown",
4
- tag: "Markdown",
5
- description: "A component that renders markdown",
6
- category: COMPONENT_TYPES.text,
7
- stylesPanelSections: [StylesPanelSections.Typography, StylesPanelSections.LayoutSelectedItem, StylesPanelSections.MarginsAndPaddings, StylesPanelSections.Effects],
8
- props: {
9
- children: {
10
- group: GROUPS.data,
11
- label: "Markdown Text",
12
- description: "Markdown text to be rendered ",
13
- editable: true,
14
- required: true,
15
- formType: FORM_TYPES.string,
16
- propType: PROP_TYPES.STRING,
17
- defaultValue: "### Markdown"
18
- }
19
- }
20
- };
@@ -1,8 +0,0 @@
1
- import * as React from "react";
2
- import { StyleProp, ViewStyle } from "react-native";
3
- declare type MarkdownProps = {
4
- style?: StyleProp<ViewStyle>;
5
- };
6
- declare const Markdown: React.FC<React.PropsWithChildren<MarkdownProps>>;
7
- export default Markdown;
8
- //# sourceMappingURL=Markdown.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Markdown.d.ts","sourceRoot":"","sources":["../../../../src/components/Markdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,SAAS,EAAc,MAAM,cAAc,CAAC;AAGhE,aAAK,aAAa,GAAG;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,CAAC;AAEF,QAAA,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,aAAa,CAAC,CAW9D,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Markdown.d.ts","sourceRoot":"","sources":["../../../../src/mappings/Markdown.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;CAuBrB,CAAC"}
@@ -1,10 +0,0 @@
1
- import * as React from "react";
2
- import { StyleSheet } from "react-native";
3
- import MarkdownComponent from "react-native-markdown-display";
4
- const Markdown = ({ children, style, }) => {
5
- return (
6
- //'body' style applies to all markdown components
7
- //@ts-ignore TS does not like the type of this named style for some reason
8
- React.createElement(MarkdownComponent, { style: { body: StyleSheet.flatten(style) } }, children));
9
- };
10
- export default Markdown;
@@ -1,22 +0,0 @@
1
- import * as React from "react";
2
- import { StyleProp, ViewStyle, StyleSheet } from "react-native";
3
- import MarkdownComponent from "react-native-markdown-display";
4
-
5
- type MarkdownProps = {
6
- style?: StyleProp<ViewStyle>;
7
- };
8
-
9
- const Markdown: React.FC<React.PropsWithChildren<MarkdownProps>> = ({
10
- children,
11
- style,
12
- }) => {
13
- return (
14
- //'body' style applies to all markdown components
15
- //@ts-ignore TS does not like the type of this named style for some reason
16
- <MarkdownComponent style={{ body: StyleSheet.flatten(style) }}>
17
- {children}
18
- </MarkdownComponent>
19
- );
20
- };
21
-
22
- export default Markdown;
@@ -1,25 +0,0 @@
1
- import { COMPONENT_TYPES, FORM_TYPES, GROUPS, PROP_TYPES, StylesPanelSections, } from "@draftbit/types";
2
- export const SEED_DATA = {
3
- name: "Markdown",
4
- tag: "Markdown",
5
- description: "A component that renders markdown",
6
- category: COMPONENT_TYPES.text,
7
- stylesPanelSections: [
8
- StylesPanelSections.Typography,
9
- StylesPanelSections.LayoutSelectedItem,
10
- StylesPanelSections.MarginsAndPaddings,
11
- StylesPanelSections.Effects,
12
- ],
13
- props: {
14
- children: {
15
- group: GROUPS.data,
16
- label: "Markdown Text",
17
- description: "Markdown text to be rendered ",
18
- editable: true,
19
- required: true,
20
- formType: FORM_TYPES.string,
21
- propType: PROP_TYPES.STRING,
22
- defaultValue: "### Markdown",
23
- },
24
- },
25
- };
@@ -1,32 +0,0 @@
1
- import {
2
- COMPONENT_TYPES,
3
- FORM_TYPES,
4
- GROUPS,
5
- PROP_TYPES,
6
- StylesPanelSections,
7
- } from "@draftbit/types";
8
-
9
- export const SEED_DATA = {
10
- name: "Markdown",
11
- tag: "Markdown",
12
- description: "A component that renders markdown",
13
- category: COMPONENT_TYPES.text,
14
- stylesPanelSections: [
15
- StylesPanelSections.Typography,
16
- StylesPanelSections.LayoutSelectedItem,
17
- StylesPanelSections.MarginsAndPaddings,
18
- StylesPanelSections.Effects,
19
- ],
20
- props: {
21
- children: {
22
- group: GROUPS.data,
23
- label: "Markdown Text",
24
- description: "Markdown text to be rendered ",
25
- editable: true,
26
- required: true,
27
- formType: FORM_TYPES.string,
28
- propType: PROP_TYPES.STRING,
29
- defaultValue: "### Markdown",
30
- },
31
- },
32
- };