@ray-js/t-agent-ui-ray 0.1.0-beta-7 → 0.1.0-beta-9
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.
|
@@ -88,6 +88,8 @@ export function useLongPress() {
|
|
|
88
88
|
ty.showModal({
|
|
89
89
|
title: t('t-agent.message.delete.title'),
|
|
90
90
|
content: t('t-agent.message.delete.content'),
|
|
91
|
+
confirmText: t('t-agent.message.delete.confirm'),
|
|
92
|
+
cancelText: t('t-agent.message.delete.cancel'),
|
|
91
93
|
success: res => {
|
|
92
94
|
if (res.confirm) {
|
|
93
95
|
agent.removeMessage(message.id);
|
package/dist/i18n/strings.d.ts
CHANGED
|
@@ -28,6 +28,8 @@ declare const _default: {
|
|
|
28
28
|
't-agent.message.action.unlike': string;
|
|
29
29
|
't-agent.message.delete.title': string;
|
|
30
30
|
't-agent.message.delete.content': string;
|
|
31
|
+
't-agent.message.delete.confirm': string;
|
|
32
|
+
't-agent.message.delete.cancel': string;
|
|
31
33
|
't-agent.message.delete.success': string;
|
|
32
34
|
't-agent.message.copy.success': string;
|
|
33
35
|
't-agent.execute-card-tile.execution.success': string;
|
|
@@ -90,6 +92,8 @@ declare const _default: {
|
|
|
90
92
|
't-agent.message.action.unlike': string;
|
|
91
93
|
't-agent.message.delete.title': string;
|
|
92
94
|
't-agent.message.delete.content': string;
|
|
95
|
+
't-agent.message.delete.confirm': string;
|
|
96
|
+
't-agent.message.delete.cancel': string;
|
|
93
97
|
't-agent.message.delete.success': string;
|
|
94
98
|
't-agent.message.copy.success': string;
|
|
95
99
|
't-agent.execute-card-tile.execution.success': string;
|
|
@@ -152,6 +156,8 @@ declare const _default: {
|
|
|
152
156
|
't-agent.message.action.unlike': string;
|
|
153
157
|
't-agent.message.delete.title': string;
|
|
154
158
|
't-agent.message.delete.content': string;
|
|
159
|
+
't-agent.message.delete.confirm': string;
|
|
160
|
+
't-agent.message.delete.cancel': string;
|
|
155
161
|
't-agent.message.delete.success': string;
|
|
156
162
|
't-agent.message.copy.success': string;
|
|
157
163
|
't-agent.execute-card-tile.execution.success': string;
|
|
@@ -214,6 +220,8 @@ declare const _default: {
|
|
|
214
220
|
't-agent.message.action.unlike': string;
|
|
215
221
|
't-agent.message.delete.title': string;
|
|
216
222
|
't-agent.message.delete.content': string;
|
|
223
|
+
't-agent.message.delete.confirm': string;
|
|
224
|
+
't-agent.message.delete.cancel': string;
|
|
217
225
|
't-agent.message.delete.success': string;
|
|
218
226
|
't-agent.message.copy.success': string;
|
|
219
227
|
't-agent.execute-card-tile.execution.success': string;
|
|
@@ -277,6 +285,8 @@ declare const _default: {
|
|
|
277
285
|
't-agent.message.delete.title': string;
|
|
278
286
|
't-agent.message.delete.content': string;
|
|
279
287
|
't-agent.message.delete.success': string;
|
|
288
|
+
't-agent.message.delete.confirm': string;
|
|
289
|
+
't-agent.message.delete.cancel': string;
|
|
280
290
|
't-agent.message.copy.success': string;
|
|
281
291
|
't-agent.execute-card-tile.execution.success': string;
|
|
282
292
|
't-agent.execute-card-tile.execution.failed': string;
|
|
@@ -338,6 +348,8 @@ declare const _default: {
|
|
|
338
348
|
't-agent.message.action.unlike': string;
|
|
339
349
|
't-agent.message.delete.title': string;
|
|
340
350
|
't-agent.message.delete.content': string;
|
|
351
|
+
't-agent.message.delete.confirm': string;
|
|
352
|
+
't-agent.message.delete.cancel': string;
|
|
341
353
|
't-agent.message.delete.success': string;
|
|
342
354
|
't-agent.message.copy.success': string;
|
|
343
355
|
't-agent.execute-card-tile.execution.success': string;
|
|
@@ -400,6 +412,8 @@ declare const _default: {
|
|
|
400
412
|
't-agent.message.action.unlike': string;
|
|
401
413
|
't-agent.message.delete.title': string;
|
|
402
414
|
't-agent.message.delete.content': string;
|
|
415
|
+
't-agent.message.delete.confirm': string;
|
|
416
|
+
't-agent.message.delete.cancel': string;
|
|
403
417
|
't-agent.message.delete.success': string;
|
|
404
418
|
't-agent.message.copy.success': string;
|
|
405
419
|
't-agent.execute-card-tile.execution.success': string;
|
|
@@ -462,6 +476,8 @@ declare const _default: {
|
|
|
462
476
|
't-agent.message.action.unlike': string;
|
|
463
477
|
't-agent.message.delete.title': string;
|
|
464
478
|
't-agent.message.delete.content': string;
|
|
479
|
+
't-agent.message.delete.confirm': string;
|
|
480
|
+
't-agent.message.delete.cancel': string;
|
|
465
481
|
't-agent.message.delete.success': string;
|
|
466
482
|
't-agent.message.copy.success': string;
|
|
467
483
|
't-agent.execute-card-tile.execution.success': string;
|
package/dist/i18n/strings.js
CHANGED
|
@@ -28,6 +28,8 @@ export default {
|
|
|
28
28
|
't-agent.message.action.unlike': '不喜欢消息',
|
|
29
29
|
't-agent.message.delete.title': '删除消息',
|
|
30
30
|
't-agent.message.delete.content': '确定要删除这条消息吗?',
|
|
31
|
+
't-agent.message.delete.confirm': '确认',
|
|
32
|
+
't-agent.message.delete.cancel': '取消',
|
|
31
33
|
't-agent.message.delete.success': '删除成功',
|
|
32
34
|
't-agent.message.copy.success': '复制成功',
|
|
33
35
|
't-agent.execute-card-tile.execution.success': '执行成功',
|
|
@@ -90,6 +92,8 @@ export default {
|
|
|
90
92
|
't-agent.message.action.unlike': '不喜歡消息',
|
|
91
93
|
't-agent.message.delete.title': '刪除消息',
|
|
92
94
|
't-agent.message.delete.content': '確定要刪除這條消息嗎?',
|
|
95
|
+
't-agent.message.delete.confirm': '確認',
|
|
96
|
+
't-agent.message.delete.cancel': '取消',
|
|
93
97
|
't-agent.message.delete.success': '刪除成功',
|
|
94
98
|
't-agent.message.copy.success': '複製成功',
|
|
95
99
|
't-agent.execute-card-tile.execution.success': '執行成功',
|
|
@@ -152,6 +156,8 @@ export default {
|
|
|
152
156
|
't-agent.message.action.unlike': 'Unlike Message',
|
|
153
157
|
't-agent.message.delete.title': 'Delete Message',
|
|
154
158
|
't-agent.message.delete.content': 'Are you sure you want to delete this message?',
|
|
159
|
+
't-agent.message.delete.confirm': 'Confirm',
|
|
160
|
+
't-agent.message.delete.cancel': 'Cancel',
|
|
155
161
|
't-agent.message.delete.success': 'Delete Successful',
|
|
156
162
|
't-agent.message.copy.success': 'Copy Successful',
|
|
157
163
|
't-agent.execute-card-tile.execution.success': 'Execution Successful',
|
|
@@ -214,6 +220,8 @@ export default {
|
|
|
214
220
|
't-agent.message.action.unlike': 'いいねを取り消す',
|
|
215
221
|
't-agent.message.delete.title': 'メッセージを削除',
|
|
216
222
|
't-agent.message.delete.content': 'このメッセージを削除しますか?',
|
|
223
|
+
't-agent.message.delete.confirm': '確認',
|
|
224
|
+
't-agent.message.delete.cancel': 'キャンセル',
|
|
217
225
|
't-agent.message.delete.success': 'メッセージが削除されました',
|
|
218
226
|
't-agent.message.copy.success': 'メッセージがコピーされました',
|
|
219
227
|
't-agent.execute-card-tile.execution.success': '実行が成功しました',
|
|
@@ -277,6 +285,8 @@ export default {
|
|
|
277
285
|
't-agent.message.delete.title': 'Nachricht löschen',
|
|
278
286
|
't-agent.message.delete.content': 'Soll diese Nachricht wirklich gelöscht werden?',
|
|
279
287
|
't-agent.message.delete.success': 'Nachricht wurde gelöscht',
|
|
288
|
+
't-agent.message.delete.confirm': 'Bestätigen',
|
|
289
|
+
't-agent.message.delete.cancel': 'Abbrechen',
|
|
280
290
|
't-agent.message.copy.success': 'Nachricht wurde kopiert',
|
|
281
291
|
't-agent.execute-card-tile.execution.success': 'Ausführung erfolgreich',
|
|
282
292
|
't-agent.execute-card-tile.execution.failed': 'Ausführung fehlgeschlagen',
|
|
@@ -338,6 +348,8 @@ export default {
|
|
|
338
348
|
't-agent.message.action.unlike': "Je n'aime plus",
|
|
339
349
|
't-agent.message.delete.title': 'Supprimer le message',
|
|
340
350
|
't-agent.message.delete.content': 'Voulez-vous vraiment supprimer ce message?',
|
|
351
|
+
't-agent.message.delete.confirm': 'Confirmer',
|
|
352
|
+
't-agent.message.delete.cancel': 'Annuler',
|
|
341
353
|
't-agent.message.delete.success': 'Message supprimé avec succès',
|
|
342
354
|
't-agent.message.copy.success': 'Message copié avec succès',
|
|
343
355
|
't-agent.execute-card-tile.execution.success': 'Exécution réussie',
|
|
@@ -400,6 +412,8 @@ export default {
|
|
|
400
412
|
't-agent.message.action.unlike': 'No me gusta',
|
|
401
413
|
't-agent.message.delete.title': 'Eliminar mensaje',
|
|
402
414
|
't-agent.message.delete.content': '¿Está seguro de querer eliminar este mensaje?',
|
|
415
|
+
't-agent.message.delete.confirm': 'Confirmar',
|
|
416
|
+
't-agent.message.delete.cancel': 'Cancelar',
|
|
403
417
|
't-agent.message.delete.success': 'Mensaje eliminado con éxito',
|
|
404
418
|
't-agent.message.copy.success': 'Mensaje copiado con éxito',
|
|
405
419
|
't-agent.execute-card-tile.execution.success': 'Ejecución exitosa',
|
|
@@ -462,6 +476,8 @@ export default {
|
|
|
462
476
|
't-agent.message.action.unlike': 'Non mi piace',
|
|
463
477
|
't-agent.message.delete.title': 'Elimina messaggio',
|
|
464
478
|
't-agent.message.delete.content': 'Vuoi davvero eliminare questo messaggio?',
|
|
479
|
+
't-agent.message.delete.confirm': 'Confermare',
|
|
480
|
+
't-agent.message.delete.cancel': 'Annullare',
|
|
465
481
|
't-agent.message.delete.success': 'Messaggio eliminato con successo',
|
|
466
482
|
't-agent.message.copy.success': 'Messaggio copiato con successo',
|
|
467
483
|
't-agent.execute-card-tile.execution.success': 'Esecuzione riuscita',
|
|
@@ -18,4 +18,4 @@ export interface OperateCardTileProps extends TileProps {
|
|
|
18
18
|
show: boolean;
|
|
19
19
|
}) => React.ReactNode;
|
|
20
20
|
}
|
|
21
|
-
export default function OperateCardTile(
|
|
21
|
+
export default function OperateCardTile(props: OperateCardTileProps): React.JSX.Element | null;
|
|
@@ -71,18 +71,17 @@ const handleDesc = (detail, t) => {
|
|
|
71
71
|
items: desc.join(t('t-agent.operate-card-tile.description.separator'))
|
|
72
72
|
});
|
|
73
73
|
};
|
|
74
|
-
export default function OperateCardTile(
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
export default function OperateCardTile(props) {
|
|
75
|
+
const {
|
|
76
|
+
tile,
|
|
77
77
|
renderDetail
|
|
78
|
-
} =
|
|
78
|
+
} = props;
|
|
79
79
|
const {
|
|
80
80
|
deviceInfo = [],
|
|
81
81
|
sceneInfo = [],
|
|
82
82
|
changeInfo = []
|
|
83
|
-
} = data || {};
|
|
83
|
+
} = tile.data || {};
|
|
84
84
|
const t = useTranslate();
|
|
85
|
-
const [show, setShow] = useState(false);
|
|
86
85
|
const [showDetail, setShowDetail] = useState(false);
|
|
87
86
|
const tapDevice = e => {
|
|
88
87
|
const deviceId = e.currentTarget.dataset.id;
|
|
@@ -111,7 +110,6 @@ export default function OperateCardTile(_ref) {
|
|
|
111
110
|
const {
|
|
112
111
|
operations
|
|
113
112
|
} = useMemo(() => {
|
|
114
|
-
let isShow = show;
|
|
115
113
|
const operations = {
|
|
116
114
|
device: [],
|
|
117
115
|
scene: [],
|
|
@@ -126,7 +124,6 @@ export default function OperateCardTile(_ref) {
|
|
|
126
124
|
} = i;
|
|
127
125
|
switch (intent) {
|
|
128
126
|
case 'controlDevice':
|
|
129
|
-
isShow = true;
|
|
130
127
|
operations.device.push(i);
|
|
131
128
|
break;
|
|
132
129
|
default:
|
|
@@ -148,12 +145,10 @@ export default function OperateCardTile(_ref) {
|
|
|
148
145
|
break;
|
|
149
146
|
case 'deleteScene':
|
|
150
147
|
if (i.success) {
|
|
151
|
-
isShow = true;
|
|
152
148
|
operations.scene.push(i);
|
|
153
149
|
}
|
|
154
150
|
break;
|
|
155
151
|
default:
|
|
156
|
-
isShow = true;
|
|
157
152
|
operations.scene.push(_objectSpread(_objectSpread({}, i), {}, {
|
|
158
153
|
displayType: 'execute'
|
|
159
154
|
}));
|
|
@@ -162,7 +157,6 @@ export default function OperateCardTile(_ref) {
|
|
|
162
157
|
});
|
|
163
158
|
}
|
|
164
159
|
if (changeInfo !== null && changeInfo !== void 0 && changeInfo.length) {
|
|
165
|
-
isShow = true;
|
|
166
160
|
changeInfo.forEach(i => {
|
|
167
161
|
switch (i.type) {
|
|
168
162
|
case 'scene':
|
|
@@ -192,35 +186,31 @@ export default function OperateCardTile(_ref) {
|
|
|
192
186
|
}
|
|
193
187
|
});
|
|
194
188
|
}
|
|
195
|
-
if (isShow && !show) {
|
|
196
|
-
setShow(true);
|
|
197
|
-
}
|
|
198
189
|
return {
|
|
199
190
|
operations
|
|
200
191
|
};
|
|
201
|
-
}, [deviceInfo, sceneInfo, changeInfo,
|
|
192
|
+
}, [deviceInfo, sceneInfo, changeInfo, t]);
|
|
202
193
|
const desc = useMemo(() => handleDesc(operations, t), [operations, t]);
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
};
|
|
206
|
-
if (show) {
|
|
207
|
-
return /*#__PURE__*/React.createElement(View, {
|
|
208
|
-
className: "t-agent-scene-control-tile"
|
|
209
|
-
}, /*#__PURE__*/React.createElement(View, {
|
|
210
|
-
className: "t-agent-scene-control-tile-summary"
|
|
211
|
-
}, t('t-agent.operate-card-tile.operation.impact'), desc, /*#__PURE__*/React.createElement(Text, {
|
|
212
|
-
className: "t-agent-scene-control-tile-summary-detail",
|
|
213
|
-
onClick: toggleDetail
|
|
214
|
-
}, showDetail ? t('t-agent.operate-card-tile.hide.details') : t('t-agent.operate-card-tile.view.details'))), renderDetail && renderDetail({
|
|
215
|
-
operations,
|
|
216
|
-
tapDevice,
|
|
217
|
-
tapScene,
|
|
218
|
-
show: showDetail
|
|
219
|
-
}), showDetail && !renderDetail && /*#__PURE__*/React.createElement(Expand, {
|
|
220
|
-
operations: operations,
|
|
221
|
-
tapDevice: tapDevice,
|
|
222
|
-
tapScene: tapScene
|
|
223
|
-
}));
|
|
194
|
+
if (!operations.device.length && !operations.scene.length && !operations.moreDevice.length && !operations.moreScene.length) {
|
|
195
|
+
return null;
|
|
224
196
|
}
|
|
225
|
-
return
|
|
197
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
198
|
+
className: "t-agent-scene-control-tile"
|
|
199
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
200
|
+
className: "t-agent-scene-control-tile-summary"
|
|
201
|
+
}, t('t-agent.operate-card-tile.operation.impact'), desc, /*#__PURE__*/React.createElement(Text, {
|
|
202
|
+
className: "t-agent-scene-control-tile-summary-detail",
|
|
203
|
+
onClick: () => {
|
|
204
|
+
setShowDetail(!showDetail);
|
|
205
|
+
}
|
|
206
|
+
}, showDetail ? t('t-agent.operate-card-tile.hide.details') : t('t-agent.operate-card-tile.view.details'))), renderDetail && renderDetail({
|
|
207
|
+
operations,
|
|
208
|
+
tapDevice,
|
|
209
|
+
tapScene,
|
|
210
|
+
show: showDetail
|
|
211
|
+
}), showDetail && !renderDetail && /*#__PURE__*/React.createElement(Expand, {
|
|
212
|
+
operations: operations,
|
|
213
|
+
tapDevice: tapDevice,
|
|
214
|
+
tapScene: tapScene
|
|
215
|
+
}));
|
|
226
216
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ray-js/t-agent-ui-ray",
|
|
3
|
-
"version": "0.1.0-beta-
|
|
3
|
+
"version": "0.1.0-beta-9",
|
|
4
4
|
"author": "Tuya.inc",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"private": false,
|
|
@@ -41,5 +41,5 @@
|
|
|
41
41
|
"@types/echarts": "^4.9.22",
|
|
42
42
|
"@types/markdown-it": "^14.1.1"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "1cebc0a6223565deb09fc16d17c5ff6c59e3e008"
|
|
45
45
|
}
|