@antscorp/antsomi-ui 1.3.12 → 1.3.14

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.
@@ -264,7 +264,7 @@ export const SlideBar = props => {
264
264
  fontSize: `${BTN_ADD_SIZE}px`,
265
265
  cursor: disabledAdd ? 'not-allowed' : 'pointer',
266
266
  color: disabledAdd ? (_c = THEME.token) === null || _c === void 0 ? void 0 : _c.colorTextDisabled : (_d = THEME.token) === null || _d === void 0 ? void 0 : _d.colorPrimary,
267
- }, disabled: disabledAdd, onClick: (e) => {
267
+ }, onClick: (e) => {
268
268
  e.stopPropagation();
269
269
  if (!disabledAdd) {
270
270
  handleAddSlide();
@@ -100,6 +100,7 @@ const Help = props => {
100
100
  const [isLoadingListHelp, setIsLoadingHelp] = useState(true);
101
101
  const recorderRef = useRef();
102
102
  const streamTracks = useRef();
103
+ const allAppOptionsRef = useRef([]);
103
104
  // const showModal = (captureKey: CaptureTypeProps) => {
104
105
  // setOpen(true);
105
106
  // setCaptureType(captureKey);
@@ -218,6 +219,7 @@ const Help = props => {
218
219
  }));
219
220
  setAppTargeting(temp[0]);
220
221
  setAllAppOptions(temp);
222
+ allAppOptionsRef.current = temp;
221
223
  }
222
224
  }
223
225
  }
@@ -281,7 +283,6 @@ const Help = props => {
281
283
  setAutoExpandParent(false);
282
284
  setExpandedKeys([]);
283
285
  };
284
- useEffect(() => () => handleResetData(), []);
285
286
  useEffect(() => {
286
287
  if (dataRecorded) {
287
288
  const dataRecordedBlob = new Blob(dataRecorded, { type: 'video/mp4' });
@@ -531,6 +532,34 @@ const Help = props => {
531
532
  }
532
533
  }
533
534
  };
535
+ useEffect(() => {
536
+ const handleEvent = e => {
537
+ const { type, helpType, helpInfo } = e.data;
538
+ if (!type || !helpType || !helpInfo) {
539
+ return;
540
+ }
541
+ switch (type) {
542
+ case 'open_antsomi_help':
543
+ if (REPORT_TYPES[helpType]) {
544
+ setIsShowPopup(true);
545
+ callback(REPORT_TYPES[helpType]);
546
+ setValueInput(prev => (Object.assign(Object.assign({}, prev), helpInfo)));
547
+ if (helpInfo.feature && Array.isArray(allAppOptions)) {
548
+ const targetApp = allAppOptionsRef.current.find(item => item.value === helpInfo.feature);
549
+ if (targetApp)
550
+ setAppTargeting(targetApp);
551
+ }
552
+ }
553
+ break;
554
+ default:
555
+ }
556
+ };
557
+ window.addEventListener('message', handleEvent);
558
+ return () => {
559
+ handleResetData();
560
+ window.removeEventListener('message', handleEvent);
561
+ };
562
+ }, []);
534
563
  const handleCreateTicket = (params) => __awaiter(void 0, void 0, void 0, function* () {
535
564
  try {
536
565
  setIsMainLoading(true);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antscorp/antsomi-ui",
3
- "version": "1.3.12",
3
+ "version": "1.3.14",
4
4
  "description": "An enterprise-class UI design language and React UI library.",
5
5
  "sideEffects": [
6
6
  "dist/*",