@ray-js/ipc-player-integration 0.0.24 → 0.0.25-beta-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/ctx/ctx.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
1
2
|
import "core-js/modules/esnext.iterator.constructor.js";
|
|
2
3
|
import "core-js/modules/esnext.iterator.filter.js";
|
|
3
4
|
import "core-js/modules/esnext.iterator.find.js";
|
|
@@ -115,11 +116,32 @@ export const createUseCtx = _ref => {
|
|
|
115
116
|
});
|
|
116
117
|
}
|
|
117
118
|
}, [devId, _playState]);
|
|
118
|
-
|
|
119
119
|
// 获取content数据
|
|
120
|
+
const getContent = () => {
|
|
121
|
+
const store = getDefaultStore();
|
|
122
|
+
return {
|
|
123
|
+
topLeft: store.get(topLeftContent),
|
|
124
|
+
topRight: store.get(topRightContent),
|
|
125
|
+
bottomLeft: store.get(bottomLeftContent),
|
|
126
|
+
bottomRight: store.get(bottomRightContent),
|
|
127
|
+
absolute: store.get(absoluteContent)
|
|
128
|
+
};
|
|
129
|
+
};
|
|
120
130
|
|
|
121
131
|
// 根据类型更新content数据
|
|
122
|
-
|
|
132
|
+
const updateContent = (type, data) => {
|
|
133
|
+
if (type === 'topLeft') {
|
|
134
|
+
updateAtom(topLeftContent, data);
|
|
135
|
+
} else if (type === 'topRight') {
|
|
136
|
+
updateAtom(topRightContent, data);
|
|
137
|
+
} else if (type === 'bottomLeft') {
|
|
138
|
+
updateAtom(bottomLeftContent, data);
|
|
139
|
+
} else if (type === 'bottomRight') {
|
|
140
|
+
updateAtom(bottomRightContent, data);
|
|
141
|
+
} else {
|
|
142
|
+
updateAtom(absoluteContent, data);
|
|
143
|
+
}
|
|
144
|
+
};
|
|
123
145
|
const changeContentHiddenData = (type, id, hidden) => {
|
|
124
146
|
const store = getDefaultStore();
|
|
125
147
|
let targetStore;
|
|
@@ -466,27 +488,15 @@ export const createUseCtx = _ref => {
|
|
|
466
488
|
updateAtom(absoluteContent, prevValue => prevValue.filter(item => item.id !== id));
|
|
467
489
|
}
|
|
468
490
|
},
|
|
469
|
-
getContent
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
},
|
|
479
|
-
updateContent: (type, data) => {
|
|
480
|
-
if (type === 'topLeft') {
|
|
481
|
-
updateAtom(topLeftContent, data);
|
|
482
|
-
} else if (type === 'topRight') {
|
|
483
|
-
updateAtom(topRightContent, data);
|
|
484
|
-
} else if (type === 'bottomLeft') {
|
|
485
|
-
updateAtom(bottomLeftContent, data);
|
|
486
|
-
} else if (type === 'bottomRight') {
|
|
487
|
-
updateAtom(bottomRightContent, data);
|
|
488
|
-
} else {
|
|
489
|
-
updateAtom(absoluteContent, data);
|
|
491
|
+
getContent,
|
|
492
|
+
updateContent,
|
|
493
|
+
updateContentItemById: (type, id, config) => {
|
|
494
|
+
const contents = getContent()[type];
|
|
495
|
+
const target = contents.find(item => item.id === id);
|
|
496
|
+
if (target) {
|
|
497
|
+
const newContent = _objectSpread(_objectSpread({}, target), config);
|
|
498
|
+
const newContents = contents.map(item => item.id === id ? newContent : item);
|
|
499
|
+
updateContent(type, newContents);
|
|
490
500
|
}
|
|
491
501
|
},
|
|
492
502
|
hideContent: (type, id) => {
|
|
@@ -72,23 +72,29 @@ export function FullTravelRouteControl(props) {
|
|
|
72
72
|
className: "ipc-plugin-full-travel-route-control",
|
|
73
73
|
value: 0,
|
|
74
74
|
onTouchStart: value => {
|
|
75
|
+
var _directionControlProp2;
|
|
75
76
|
pauseTimeToHideAllComponentFn();
|
|
76
77
|
sendDpValueFn(String(value));
|
|
77
78
|
// @ts-ignore
|
|
78
79
|
ty.nativeDisabled(true);
|
|
80
|
+
directionControlProps === null || directionControlProps === void 0 || (_directionControlProp2 = directionControlProps.onTouchStart) === null || _directionControlProp2 === void 0 || _directionControlProp2.call(directionControlProps, value);
|
|
79
81
|
},
|
|
80
82
|
onTouchMove: value => {
|
|
83
|
+
var _directionControlProp;
|
|
81
84
|
pauseTimeToHideAllComponentFn();
|
|
82
85
|
sendDpValueFn(String(value));
|
|
83
86
|
// @ts-ignore
|
|
84
87
|
ty.nativeDisabled(true);
|
|
88
|
+
directionControlProps === null || directionControlProps === void 0 || (_directionControlProp = directionControlProps.onTouchMove) === null || _directionControlProp === void 0 || _directionControlProp.call(directionControlProps, value);
|
|
85
89
|
},
|
|
86
90
|
onTouchEnd: () => {
|
|
91
|
+
var _directionControlProp3;
|
|
87
92
|
event.emit(startTimeToHideAllComponent);
|
|
88
93
|
pauseTimeToHideAllComponentRef.current = false;
|
|
89
94
|
sendDpValueFn('-1');
|
|
90
95
|
// @ts-ignore
|
|
91
96
|
ty.nativeDisabled(false);
|
|
97
|
+
directionControlProps === null || directionControlProps === void 0 || (_directionControlProp3 = directionControlProps.onTouchEnd) === null || _directionControlProp3 === void 0 || _directionControlProp3.call(directionControlProps);
|
|
92
98
|
},
|
|
93
99
|
onMoveNonIntersection: () => {
|
|
94
100
|
sendDpValueFn('-1');
|