@elice/material-exercise 1.230111.0-mobexercise.0 → 1.230116.0-mobexercise.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.
@@ -4,6 +4,7 @@ var React = require('react');
4
4
  var apiClient = require('@elice/api-client');
5
5
  var blocks = require('@elice/blocks');
6
6
  var types = require('@elice/types');
7
+ var utils = require('@elice/utils');
7
8
  var recoil = require('recoil');
8
9
  var ExerciseFileShimmer = require('../../shared/exercise-shimmer/ExerciseFileShimmer.js');
9
10
  require('../../shared/exercise-shimmer/ExerciseFileTabsShimmer.js');
@@ -251,7 +252,7 @@ const ExerciseFileEditor = () => {
251
252
 
252
253
 
253
254
  React__default["default"].useEffect(() => {
254
- var _a;
255
+ var _a, _b;
255
256
 
256
257
  const _editorApis = editorApis.current;
257
258
 
@@ -262,10 +263,21 @@ const ExerciseFileEditor = () => {
262
263
  _editorApis.setValue(wsUsercode.doc);
263
264
 
264
265
  pushEditorDocHistories();
265
- const subscription = (_a = _editorApis.editor) === null || _a === void 0 ? void 0 : _a.onDidChangeModelContent(e => {
266
- pushEditorDocHistories();
267
- handleChange(e);
268
- });
266
+ let subscription = undefined;
267
+
268
+ if (utils.FlutterApp.checkWebview()) {
269
+ subscription = (_a = _editorApis.editor) === null || _a === void 0 ? void 0 : _a.onDidChangeModelContent(e => {
270
+ pushEditorDocHistories();
271
+ handleChange(e);
272
+ utils.FlutterApp.onDidChangeContent();
273
+ });
274
+ } else {
275
+ subscription = (_b = _editorApis.editor) === null || _b === void 0 ? void 0 : _b.onDidChangeModelContent(e => {
276
+ pushEditorDocHistories();
277
+ handleChange(e);
278
+ });
279
+ }
280
+
269
281
  return () => {
270
282
  if (subscription) {
271
283
  subscription.dispose();
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import { getOrgMaterialExerciseExerciseImageExerciseFileGet } from '@elice/api-client';
3
3
  import { Flex } from '@elice/blocks';
4
4
  import { enums } from '@elice/types';
5
+ import { FlutterApp } from '@elice/utils';
5
6
  import { useRecoilValue, useSetRecoilState } from 'recoil';
6
7
  import ExerciseFileShimmer from '../../shared/exercise-shimmer/ExerciseFileShimmer.js';
7
8
  import '../../shared/exercise-shimmer/ExerciseFileTabsShimmer.js';
@@ -245,7 +246,7 @@ const ExerciseFileEditor = () => {
245
246
 
246
247
 
247
248
  React.useEffect(() => {
248
- var _a;
249
+ var _a, _b;
249
250
 
250
251
  const _editorApis = editorApis.current;
251
252
 
@@ -256,10 +257,21 @@ const ExerciseFileEditor = () => {
256
257
  _editorApis.setValue(wsUsercode.doc);
257
258
 
258
259
  pushEditorDocHistories();
259
- const subscription = (_a = _editorApis.editor) === null || _a === void 0 ? void 0 : _a.onDidChangeModelContent(e => {
260
- pushEditorDocHistories();
261
- handleChange(e);
262
- });
260
+ let subscription = undefined;
261
+
262
+ if (FlutterApp.checkWebview()) {
263
+ subscription = (_a = _editorApis.editor) === null || _a === void 0 ? void 0 : _a.onDidChangeModelContent(e => {
264
+ pushEditorDocHistories();
265
+ handleChange(e);
266
+ FlutterApp.onDidChangeContent();
267
+ });
268
+ } else {
269
+ subscription = (_b = _editorApis.editor) === null || _b === void 0 ? void 0 : _b.onDidChangeModelContent(e => {
270
+ pushEditorDocHistories();
271
+ handleChange(e);
272
+ });
273
+ }
274
+
263
275
  return () => {
264
276
  if (subscription) {
265
277
  subscription.dispose();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elice/material-exercise",
3
- "version": "1.230111.0-mobexercise.0",
3
+ "version": "1.230116.0-mobexercise.0",
4
4
  "description": "User view and editing components of Elice material exercise",
5
5
  "repository": "https://git.elicer.io/elice/frontend/library/elice-material",
6
6
  "license": "UNLICENSED",
@@ -79,8 +79,8 @@
79
79
  "@elice/design-tokens": "^1.220803.0",
80
80
  "@elice/icons": "^1.220803.0",
81
81
  "@elice/markdown": "^1.220803.0",
82
- "@elice/material-shared-types": "1.230111.0-mobexercise.0",
83
- "@elice/material-shared-utils": "1.230111.0-mobexercise.0",
82
+ "@elice/material-shared-types": "1.230116.0-mobexercise.0",
83
+ "@elice/material-shared-utils": "1.230116.0-mobexercise.0",
84
84
  "@elice/types": "1.221217.0",
85
85
  "@elice/websocket": "^1.220803.0",
86
86
  "@types/classnames": "^2.3.1",
@@ -102,5 +102,5 @@
102
102
  "recoil": "^0.6.1",
103
103
  "styled-components": "^5.2.0"
104
104
  },
105
- "gitHead": "5a62dfe0601abca6b8a227bc53b8c4ed13a576f0"
105
+ "gitHead": "015f44a743ed5f87dd494056b24212695138158c"
106
106
  }