@draftbit/core 46.8.2-5f263c.2 → 46.8.2-a9cd67.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.
- package/lib/commonjs/components/Portal/PortalConsumer.js +22 -7
- package/lib/commonjs/mappings/Markdown.js +1 -1
- package/lib/module/components/CircularProgress.js +28 -8
- package/lib/module/mappings/Markdown.js +1 -1
- package/lib/module/styles/overlay.js +1 -3
- package/package.json +3 -3
- package/src/mappings/Markdown.js +1 -1
- package/src/mappings/Markdown.ts +1 -1
|
@@ -7,16 +7,31 @@ exports.default = void 0;
|
|
|
7
7
|
var React = _interopRequireWildcard(require("react"));
|
|
8
8
|
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); }
|
|
9
9
|
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; }
|
|
10
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
11
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
12
|
-
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
13
10
|
class PortalConsumer extends React.Component {
|
|
14
|
-
constructor() {
|
|
15
|
-
super(...arguments);
|
|
16
|
-
_defineProperty(this, "key", void 0);
|
|
17
|
-
}
|
|
18
11
|
async componentDidMount() {
|
|
19
12
|
this.checkManager();
|
|
13
|
+
// Delay updating to prevent React from going to infinite loop
|
|
14
|
+
await Promise.resolve();
|
|
15
|
+
this.key = this.props.manager.mount(this.props.children);
|
|
16
|
+
}
|
|
17
|
+
componentDidUpdate() {
|
|
18
|
+
this.checkManager();
|
|
19
|
+
this.props.manager.update(this.key, this.props.children);
|
|
20
|
+
}
|
|
21
|
+
componentWillUnmount() {
|
|
22
|
+
this.checkManager();
|
|
23
|
+
this.props.manager.unmount(this.key);
|
|
24
|
+
}
|
|
25
|
+
checkManager() {
|
|
26
|
+
if (!this.props.manager) {
|
|
27
|
+
throw new Error("Looks like you forgot to wrap your root component with `Provider` component from `react-native-paper`.\n\n" + "Please read our getting-started guide and make sure you've followed all the required steps.\n\n" + "https://callstack.github.io/react-native-paper/getting-started.html");
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
render() {
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.default = PortalConsumer;s.checkManager();
|
|
20
35
|
|
|
21
36
|
// Delay updating to prevent React from going to infinite loop
|
|
22
37
|
await Promise.resolve();
|
|
@@ -1,27 +1,24 @@
|
|
|
1
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3
|
-
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
4
1
|
import React from "react";
|
|
5
2
|
import { View } from "react-native";
|
|
6
3
|
import { Svg, Path, G } from "react-native-svg";
|
|
7
4
|
class CircularProgress extends React.Component {
|
|
8
5
|
constructor() {
|
|
9
6
|
super(...arguments);
|
|
10
|
-
|
|
7
|
+
this.polarToCartesian = (centerX, centerY, radius, angleInDegrees) => {
|
|
11
8
|
var angleInRadians = (angleInDegrees - 90) * Math.PI / 180.0;
|
|
12
9
|
return {
|
|
13
10
|
x: centerX + radius * Math.cos(angleInRadians),
|
|
14
11
|
y: centerY + radius * Math.sin(angleInRadians)
|
|
15
12
|
};
|
|
16
|
-
}
|
|
17
|
-
|
|
13
|
+
};
|
|
14
|
+
this.circlePath = (x, y, radius, startAngle, endAngle) => {
|
|
18
15
|
var start = this.polarToCartesian(x, y, radius, endAngle * 0.9999);
|
|
19
16
|
var end = this.polarToCartesian(x, y, radius, startAngle);
|
|
20
17
|
var largeArcFlag = endAngle - startAngle <= 180 ? "0" : "1";
|
|
21
18
|
var d = ["M", start.x, start.y, "A", radius, radius, 0, largeArcFlag, 0, end.x, end.y];
|
|
22
19
|
return d.join(" ");
|
|
23
|
-
}
|
|
24
|
-
|
|
20
|
+
};
|
|
21
|
+
this.clampFill = fill => Math.min(100, Math.max(0, fill));
|
|
25
22
|
}
|
|
26
23
|
render() {
|
|
27
24
|
const {
|
|
@@ -101,4 +98,27 @@ class CircularProgress extends React.Component {
|
|
|
101
98
|
}, children(fill)));
|
|
102
99
|
}
|
|
103
100
|
}
|
|
101
|
+
export default CircularProgress;eElement(G, {
|
|
102
|
+
rotation: rotation,
|
|
103
|
+
originX: (size + padding) / 2,
|
|
104
|
+
originY: (size + padding) / 2
|
|
105
|
+
}, backgroundColor && /*#__PURE__*/React.createElement(Path, {
|
|
106
|
+
d: backgroundPath,
|
|
107
|
+
stroke: backgroundColor,
|
|
108
|
+
strokeWidth: backgroundWidth || width,
|
|
109
|
+
strokeLinecap: lineCap,
|
|
110
|
+
strokeDasharray: strokeDasharrayBackground,
|
|
111
|
+
fill: "transparent"
|
|
112
|
+
}), fill > 0 && /*#__PURE__*/React.createElement(Path, {
|
|
113
|
+
d: circlePathItem,
|
|
114
|
+
stroke: tintColor,
|
|
115
|
+
strokeWidth: width,
|
|
116
|
+
strokeLinecap: lineCap,
|
|
117
|
+
strokeDasharray: strokeDasharrayTint,
|
|
118
|
+
fill: "transparent"
|
|
119
|
+
}), cap)), children && /*#__PURE__*/React.createElement(View, {
|
|
120
|
+
style: localChildrenContainerStyle
|
|
121
|
+
}, children(fill)));
|
|
122
|
+
}
|
|
123
|
+
}
|
|
104
124
|
export default CircularProgress;
|
|
@@ -7,7 +7,6 @@ export default function overlay(elevation) {
|
|
|
7
7
|
let surfaceColor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DarkTheme.colors.surface;
|
|
8
8
|
if (isAnimatedValue(elevation)) {
|
|
9
9
|
const inputRange = [0, 1, 2, 3, 8, 24];
|
|
10
|
-
|
|
11
10
|
// @ts-expect-error: TS doesn't seem to refine the type correctly
|
|
12
11
|
return elevation.interpolate({
|
|
13
12
|
inputRange,
|
|
@@ -16,7 +15,6 @@ export default function overlay(elevation) {
|
|
|
16
15
|
})
|
|
17
16
|
});
|
|
18
17
|
}
|
|
19
|
-
|
|
20
18
|
// @ts-expect-error: TS doesn't seem to refine the type correctly
|
|
21
19
|
return calculateColor(surfaceColor, elevation);
|
|
22
20
|
}
|
|
@@ -57,4 +55,4 @@ const elevationOverlayTransparency = {
|
|
|
57
55
|
22: 15.72,
|
|
58
56
|
23: 15.84,
|
|
59
57
|
24: 16
|
|
60
|
-
};
|
|
58
|
+
};};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@draftbit/core",
|
|
3
|
-
"version": "46.8.2-
|
|
3
|
+
"version": "46.8.2-a9cd67.2+a9cd67d",
|
|
4
4
|
"description": "Core (non-native) Components",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@date-io/date-fns": "^1.3.13",
|
|
43
43
|
"@draftbit/react-theme-provider": "^2.1.1",
|
|
44
|
-
"@draftbit/types": "^46.8.2-
|
|
44
|
+
"@draftbit/types": "^46.8.2-a9cd67.2+a9cd67d",
|
|
45
45
|
"@material-ui/core": "^4.11.0",
|
|
46
46
|
"@material-ui/pickers": "^3.2.10",
|
|
47
47
|
"@react-native-community/slider": "4.2.3",
|
|
@@ -93,5 +93,5 @@
|
|
|
93
93
|
]
|
|
94
94
|
]
|
|
95
95
|
},
|
|
96
|
-
"gitHead": "
|
|
96
|
+
"gitHead": "a9cd67da0780ab09858ea7b196badc1c4990f90c"
|
|
97
97
|
}
|
package/src/mappings/Markdown.js
CHANGED