dreaction-react-native 1.4.6 → 1.5.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/components/ConfigDialog.js +1 -1
- package/lib/components/Profiler.d.ts +5 -0
- package/lib/components/Profiler.d.ts.map +1 -0
- package/lib/components/Profiler.js +52 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -1
- package/package.json +3 -3
- package/src/components/ConfigDialog.tsx +1 -1
- package/src/components/Profiler.tsx +32 -0
- package/src/index.ts +2 -0
|
@@ -60,7 +60,7 @@ exports.ConfigDialog = react_1.default.memo((props) => {
|
|
|
60
60
|
dreaction_1.dreaction.asyncStorageHandler?.setItem(LOCAL_CACHE_HOST_NAME, host);
|
|
61
61
|
onConfirm(host);
|
|
62
62
|
};
|
|
63
|
-
return ((0, jsx_runtime_1.jsx)(react_native_1.Modal, { animationType: "fade", transparent: true, visible: visible, onRequestClose: () => onCancel(), children: (0, jsx_runtime_1.jsx)(react_native_1.View, { style: styles.modalOverlay, children: (0, jsx_runtime_1.jsxs)(react_native_1.View, { style: styles.modalContent, children: [(0, jsx_runtime_1.jsx)(react_native_1.Text, { style: styles.title, children: "DReaction Desktop Application
|
|
63
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.Modal, { animationType: "fade", transparent: true, visible: visible, onRequestClose: () => onCancel(), children: (0, jsx_runtime_1.jsx)(react_native_1.View, { style: styles.modalOverlay, children: (0, jsx_runtime_1.jsxs)(react_native_1.View, { style: styles.modalContent, children: [(0, jsx_runtime_1.jsx)(react_native_1.Text, { style: styles.title, children: "DReaction Desktop Application Host" }), (0, jsx_runtime_1.jsx)(react_native_1.TextInput, { style: styles.input, selectTextOnFocus: selectTextOnFocus, value: inputValue, keyboardType: "url", onChangeText: setInputValue, placeholder: (0, getHost_1.getHost)() }), (0, jsx_runtime_1.jsxs)(react_native_1.View, { style: styles.buttonContainer, children: [(0, jsx_runtime_1.jsx)(react_native_1.TouchableOpacity, { style: styles.buttonView, onPress: onCancel, children: (0, jsx_runtime_1.jsx)(react_native_1.Text, { style: styles.buttonText, children: "Cancel" }) }), (0, jsx_runtime_1.jsx)(react_native_1.TouchableOpacity, { style: styles.buttonView, onPress: handleConfirm, children: (0, jsx_runtime_1.jsx)(react_native_1.Text, { style: styles.buttonText, children: "Confirm" }) })] })] }) }) }));
|
|
64
64
|
});
|
|
65
65
|
exports.ConfigDialog.displayName = 'ConfigDialog';
|
|
66
66
|
const styles = react_native_1.StyleSheet.create({
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Profiler.d.ts","sourceRoot":"","sources":["../../src/components/Profiler.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAA6B,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAG5E,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAAC;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC,CA2BhE,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.Profiler = void 0;
|
|
37
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
+
const react_1 = __importStar(require("react"));
|
|
39
|
+
const dreaction_1 = require("../dreaction");
|
|
40
|
+
exports.Profiler = react_1.default.memo((props) => {
|
|
41
|
+
return ((0, jsx_runtime_1.jsx)(react_1.Profiler, { id: props.id, onRender: (id, phase, actualDuration, baseDuration, startTime, commitTime) => {
|
|
42
|
+
dreaction_1.dreaction.send('profiler.render', {
|
|
43
|
+
id,
|
|
44
|
+
phase,
|
|
45
|
+
actualDuration,
|
|
46
|
+
baseDuration,
|
|
47
|
+
startTime,
|
|
48
|
+
commitTime,
|
|
49
|
+
});
|
|
50
|
+
}, children: props.children }));
|
|
51
|
+
});
|
|
52
|
+
exports.Profiler.displayName = 'Profiler';
|
package/lib/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export type { Command } from 'dreaction-protocol';
|
|
2
2
|
import { DraggableBall } from './components/DraggableBall';
|
|
3
|
+
import { Profiler } from './components/Profiler';
|
|
3
4
|
export { DraggableBall as DReactionDraggableBall };
|
|
5
|
+
export { Profiler as DReactionProfiler };
|
|
4
6
|
export * from './dreaction';
|
|
5
7
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,OAAO,EAAE,aAAa,IAAI,sBAAsB,EAAE,CAAC;AACnD,OAAO,EAAE,QAAQ,IAAI,iBAAiB,EAAE,CAAC;AAEzC,cAAc,aAAa,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -14,7 +14,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.DReactionDraggableBall = void 0;
|
|
17
|
+
exports.DReactionProfiler = exports.DReactionDraggableBall = void 0;
|
|
18
18
|
const DraggableBall_1 = require("./components/DraggableBall");
|
|
19
19
|
Object.defineProperty(exports, "DReactionDraggableBall", { enumerable: true, get: function () { return DraggableBall_1.DraggableBall; } });
|
|
20
|
+
const Profiler_1 = require("./components/Profiler");
|
|
21
|
+
Object.defineProperty(exports, "DReactionProfiler", { enumerable: true, get: function () { return Profiler_1.Profiler; } });
|
|
20
22
|
__exportStar(require("./dreaction"), exports);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dreaction-react-native",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
"author": "moonrailgun <moonrailgun@gmail.com>",
|
|
16
16
|
"license": "MIT",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"dreaction-client-core": "1.1.
|
|
19
|
-
"dreaction-protocol": "1.0.
|
|
18
|
+
"dreaction-client-core": "1.1.11",
|
|
19
|
+
"dreaction-protocol": "1.0.7"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@react-native-async-storage/async-storage": "^2.1.0",
|
|
@@ -50,7 +50,7 @@ export const ConfigDialog: React.FC<ConfigDialogProps> = React.memo((props) => {
|
|
|
50
50
|
>
|
|
51
51
|
<View style={styles.modalOverlay}>
|
|
52
52
|
<View style={styles.modalContent}>
|
|
53
|
-
<Text style={styles.title}>DReaction Desktop Application
|
|
53
|
+
<Text style={styles.title}>DReaction Desktop Application Host</Text>
|
|
54
54
|
<TextInput
|
|
55
55
|
style={styles.input}
|
|
56
56
|
selectTextOnFocus={selectTextOnFocus}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React, { Profiler as ReactProfiler, PropsWithChildren } from 'react';
|
|
2
|
+
import { dreaction } from '../dreaction';
|
|
3
|
+
|
|
4
|
+
export const Profiler: React.FC<PropsWithChildren<{ id: string }>> = React.memo(
|
|
5
|
+
(props) => {
|
|
6
|
+
return (
|
|
7
|
+
<ReactProfiler
|
|
8
|
+
id={props.id}
|
|
9
|
+
onRender={(
|
|
10
|
+
id,
|
|
11
|
+
phase,
|
|
12
|
+
actualDuration,
|
|
13
|
+
baseDuration,
|
|
14
|
+
startTime,
|
|
15
|
+
commitTime
|
|
16
|
+
) => {
|
|
17
|
+
dreaction.send('profiler.render', {
|
|
18
|
+
id,
|
|
19
|
+
phase,
|
|
20
|
+
actualDuration,
|
|
21
|
+
baseDuration,
|
|
22
|
+
startTime,
|
|
23
|
+
commitTime,
|
|
24
|
+
});
|
|
25
|
+
}}
|
|
26
|
+
>
|
|
27
|
+
{props.children}
|
|
28
|
+
</ReactProfiler>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
Profiler.displayName = 'Profiler';
|
package/src/index.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export type { Command } from 'dreaction-protocol';
|
|
2
2
|
import { DraggableBall } from './components/DraggableBall';
|
|
3
|
+
import { Profiler } from './components/Profiler';
|
|
3
4
|
|
|
4
5
|
export { DraggableBall as DReactionDraggableBall };
|
|
6
|
+
export { Profiler as DReactionProfiler };
|
|
5
7
|
|
|
6
8
|
export * from './dreaction';
|