@elice/material-exercise 1.230629.0-referencedocs.0 → 1.230629.1
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/cjs/components/material-exercise/MaterialExercise.js +1 -0
- package/cjs/components/material-exercise/exercise-multilang-dropdown/ExerciseMultilangDropdown.js +10 -4
- package/es/components/material-exercise/MaterialExercise.js +1 -0
- package/es/components/material-exercise/exercise-multilang-dropdown/ExerciseMultilangDropdown.js +10 -4
- package/package.json +5 -5
|
@@ -23,6 +23,7 @@ var ExerciseFileTabsLazy = require('./exercise-file-tabs/ExerciseFileTabsLazy.js
|
|
|
23
23
|
require('./exercise-file-tree/ExerciseFileTree.js');
|
|
24
24
|
var ExerciseFileTreeLazy = require('./exercise-file-tree/ExerciseFileTreeLazy.js');
|
|
25
25
|
var ExerciseMenu = require('./exercise-menu/ExerciseMenu.js');
|
|
26
|
+
require('react-use');
|
|
26
27
|
var ExerciseMultilangDropdownLazy = require('./exercise-multilang-dropdown/ExerciseMultilangDropdownLazy.js');
|
|
27
28
|
var ExercisePreview = require('./exercise-preview/ExercisePreview.js');
|
|
28
29
|
var ExerciseRightpane = require('./exercise-rightpane/ExerciseRightpane.js');
|
package/cjs/components/material-exercise/exercise-multilang-dropdown/ExerciseMultilangDropdown.js
CHANGED
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHelpers.js');
|
|
6
6
|
var React = require('react');
|
|
7
|
+
var reactUse = require('react-use');
|
|
7
8
|
var blocks = require('@elice/blocks');
|
|
8
9
|
var recoil = require('recoil');
|
|
9
10
|
var recoil$1 = require('../context/recoil.js');
|
|
@@ -30,6 +31,14 @@ var ExerciseMultilangDropdown = function ExerciseMultilangDropdown() {
|
|
|
30
31
|
multilangEnvironment = _useRecoilState2[0],
|
|
31
32
|
setMultilangEnvironment = _useRecoilState2[1];
|
|
32
33
|
//
|
|
34
|
+
// emit `onMultiLangLanguageChange` when language changed
|
|
35
|
+
//
|
|
36
|
+
reactUse.useDebounce(function () {
|
|
37
|
+
if (multilangEnvironment && typeof onMultiLangLanguageChange === 'function') {
|
|
38
|
+
onMultiLangLanguageChange(multilangEnvironment.language);
|
|
39
|
+
}
|
|
40
|
+
}, 250, [multilangEnvironment]);
|
|
41
|
+
//
|
|
33
42
|
//
|
|
34
43
|
//
|
|
35
44
|
if (!multilangLanguages || !Object.keys(multilangLanguages !== null && multilangLanguages !== void 0 ? multilangLanguages : {}).length || !multilangEnvironment) {
|
|
@@ -42,12 +51,9 @@ var ExerciseMultilangDropdown = function ExerciseMultilangDropdown() {
|
|
|
42
51
|
placement: "bottom-end",
|
|
43
52
|
value: multilangEnvironment.language,
|
|
44
53
|
onChange: function onChange(language) {
|
|
45
|
-
setMultilangEnvironment({
|
|
54
|
+
return setMultilangEnvironment({
|
|
46
55
|
language: language
|
|
47
56
|
});
|
|
48
|
-
if (typeof onMultiLangLanguageChange === 'function') {
|
|
49
|
-
onMultiLangLanguageChange(language);
|
|
50
|
-
}
|
|
51
57
|
}
|
|
52
58
|
}, Object.keys(multilangLanguages).map(function (lang) {
|
|
53
59
|
return React__default["default"].createElement("option", {
|
|
@@ -19,6 +19,7 @@ import ExerciseFileTabsLazy from './exercise-file-tabs/ExerciseFileTabsLazy.js';
|
|
|
19
19
|
import './exercise-file-tree/ExerciseFileTree.js';
|
|
20
20
|
import ExerciseFileTreeLazy from './exercise-file-tree/ExerciseFileTreeLazy.js';
|
|
21
21
|
import ExerciseMenu from './exercise-menu/ExerciseMenu.js';
|
|
22
|
+
import 'react-use';
|
|
22
23
|
import ExerciseMultilangDropdownLazy from './exercise-multilang-dropdown/ExerciseMultilangDropdownLazy.js';
|
|
23
24
|
import ExercisePreview from './exercise-preview/ExercisePreview.js';
|
|
24
25
|
import ExerciseRightpane from './exercise-rightpane/ExerciseRightpane.js';
|
package/es/components/material-exercise/exercise-multilang-dropdown/ExerciseMultilangDropdown.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { slicedToArray as _slicedToArray } from '../../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { useDebounce } from 'react-use';
|
|
3
4
|
import { Dropdown } from '@elice/blocks';
|
|
4
5
|
import { useRecoilValue, useRecoilState } from 'recoil';
|
|
5
6
|
import { exerciseMultilangLanguagesState, exerciseMultilangEnvironmentState } from '../context/recoil.js';
|
|
@@ -22,6 +23,14 @@ var ExerciseMultilangDropdown = function ExerciseMultilangDropdown() {
|
|
|
22
23
|
multilangEnvironment = _useRecoilState2[0],
|
|
23
24
|
setMultilangEnvironment = _useRecoilState2[1];
|
|
24
25
|
//
|
|
26
|
+
// emit `onMultiLangLanguageChange` when language changed
|
|
27
|
+
//
|
|
28
|
+
useDebounce(function () {
|
|
29
|
+
if (multilangEnvironment && typeof onMultiLangLanguageChange === 'function') {
|
|
30
|
+
onMultiLangLanguageChange(multilangEnvironment.language);
|
|
31
|
+
}
|
|
32
|
+
}, 250, [multilangEnvironment]);
|
|
33
|
+
//
|
|
25
34
|
//
|
|
26
35
|
//
|
|
27
36
|
if (!multilangLanguages || !Object.keys(multilangLanguages !== null && multilangLanguages !== void 0 ? multilangLanguages : {}).length || !multilangEnvironment) {
|
|
@@ -34,12 +43,9 @@ var ExerciseMultilangDropdown = function ExerciseMultilangDropdown() {
|
|
|
34
43
|
placement: "bottom-end",
|
|
35
44
|
value: multilangEnvironment.language,
|
|
36
45
|
onChange: function onChange(language) {
|
|
37
|
-
setMultilangEnvironment({
|
|
46
|
+
return setMultilangEnvironment({
|
|
38
47
|
language: language
|
|
39
48
|
});
|
|
40
|
-
if (typeof onMultiLangLanguageChange === 'function') {
|
|
41
|
-
onMultiLangLanguageChange(language);
|
|
42
|
-
}
|
|
43
49
|
}
|
|
44
50
|
}, Object.keys(multilangLanguages).map(function (lang) {
|
|
45
51
|
return React.createElement("option", {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elice/material-exercise",
|
|
3
|
-
"version": "1.230629.
|
|
3
|
+
"version": "1.230629.1",
|
|
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,9 +79,9 @@
|
|
|
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.230629.
|
|
83
|
-
"@elice/material-shared-utils": "1.230629.
|
|
84
|
-
"@elice/types": "1.
|
|
82
|
+
"@elice/material-shared-types": "1.230629.1",
|
|
83
|
+
"@elice/material-shared-utils": "1.230629.1",
|
|
84
|
+
"@elice/types": "^1.230629.0",
|
|
85
85
|
"@elice/websocket": "^1.220803.0",
|
|
86
86
|
"@types/classnames": "^2.3.1",
|
|
87
87
|
"@types/color": "^3.0.3",
|
|
@@ -102,5 +102,5 @@
|
|
|
102
102
|
"recoil": "^0.6.1",
|
|
103
103
|
"styled-components": "^5.2.0"
|
|
104
104
|
},
|
|
105
|
-
"gitHead": "
|
|
105
|
+
"gitHead": "61c8c138a1361e5e8a081157fd2e7837fc39fbf3"
|
|
106
106
|
}
|