@oat-sa/tao-core-ui 2.2.0 → 2.3.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.
@@ -1,5 +1,6 @@
1
- define(['exports', 'lodash'], function (exports, _) { 'use strict';
1
+ define(['exports', 'context', 'lodash'], function (exports, context, _) { 'use strict';
2
2
 
3
+ context = context && Object.prototype.hasOwnProperty.call(context, 'default') ? context['default'] : context;
3
4
  _ = _ && Object.prototype.hasOwnProperty.call(_, 'default') ? _['default'] : _;
4
5
 
5
6
  /**
@@ -17,7 +18,7 @@ define(['exports', 'lodash'], function (exports, _) { 'use strict';
17
18
  * along with this program; if not, write to the Free Software
18
19
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19
20
  *
20
- * Copyright (c) 2021-2022 (original work) Open Assessment Technologies SA;
21
+ * Copyright (c) 2021-2023 (original work) Open Assessment Technologies SA;
21
22
  */
22
23
  const FLOAT_LEFT_CLASS = 'wrap-left';
23
24
  const FLOAT_RIGHT_CLASS = 'wrap-right';
@@ -70,7 +71,7 @@ define(['exports', 'lodash'], function (exports, _) { 'use strict';
70
71
  } else {
71
72
  widget.element.removeAttr('class');
72
73
  }
73
- if (prevClassName !== className) {
74
+ if (!context.featureFlags['FEATURE_FLAG_DISABLE_FIGURE_WIDGET'] && prevClassName !== className) {
74
75
  // Re-build Figure widget to toggle between inline/block
75
76
  const parent = searchRecurse(widget.element.bdy.rootElement.bdy, widget.serial);
76
77
  // avoid changes on Figure in a prompt
@@ -1,10 +1,11 @@
1
- define(['jquery', 'lodash', 'ui/component', 'handlebars', 'lib/handlebars/helpers', 'css!ui/mediaEditor/plugins/mediaAlignment/style.css'], function ($$1, _, component, Handlebars, Helpers0, style_css) { 'use strict';
1
+ define(['jquery', 'lodash', 'ui/component', 'handlebars', 'lib/handlebars/helpers', 'css!ui/mediaEditor/plugins/mediaAlignment/style.css', 'context'], function ($$1, _, component, Handlebars, Helpers0, style_css, context) { 'use strict';
2
2
 
3
3
  $$1 = $$1 && Object.prototype.hasOwnProperty.call($$1, 'default') ? $$1['default'] : $$1;
4
4
  _ = _ && Object.prototype.hasOwnProperty.call(_, 'default') ? _['default'] : _;
5
5
  component = component && Object.prototype.hasOwnProperty.call(component, 'default') ? component['default'] : component;
6
6
  Handlebars = Handlebars && Object.prototype.hasOwnProperty.call(Handlebars, 'default') ? Handlebars['default'] : Handlebars;
7
7
  Helpers0 = Helpers0 && Object.prototype.hasOwnProperty.call(Helpers0, 'default') ? Helpers0['default'] : Helpers0;
8
+ context = context && Object.prototype.hasOwnProperty.call(context, 'default') ? context['default'] : context;
8
9
 
9
10
  if (!Helpers0.__initialized) {
10
11
  Helpers0(Handlebars);
@@ -47,7 +48,7 @@ define(['jquery', 'lodash', 'ui/component', 'handlebars', 'lib/handlebars/helper
47
48
  * along with this program; if not, write to the Free Software
48
49
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
49
50
  *
50
- * Copyright (c) 2021-2022 (original work) Open Assessment Technologies SA;
51
+ * Copyright (c) 2021-2023 (original work) Open Assessment Technologies SA;
51
52
  */
52
53
  const FLOAT_LEFT_CLASS = 'wrap-left';
53
54
  const FLOAT_RIGHT_CLASS = 'wrap-right';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oat-sa/tao-core-ui",
3
- "version": "2.2.0",
3
+ "version": "2.3.0",
4
4
  "displayName": "TAO Core UI",
5
5
  "description": "UI libraries of TAO",
6
6
  "scripts": {
@@ -13,8 +13,9 @@
13
13
  * along with this program; if not, write to the Free Software
14
14
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15
15
  *
16
- * Copyright (c) 2021-2022 (original work) Open Assessment Technologies SA;
16
+ * Copyright (c) 2021-2023 (original work) Open Assessment Technologies SA;
17
17
  */
18
+ import context from 'context';
18
19
  import _ from 'lodash';
19
20
 
20
21
  export const FLOAT_LEFT_CLASS = 'wrap-left';
@@ -74,7 +75,7 @@ export const positionFloat = function positionFloat(widget, position) {
74
75
  widget.element.removeAttr('class');
75
76
  }
76
77
 
77
- if (prevClassName !== className) {
78
+ if (!context.featureFlags['FEATURE_FLAG_DISABLE_FIGURE_WIDGET'] && prevClassName !== className) {
78
79
  // Re-build Figure widget to toggle between inline/block
79
80
  const parent = searchRecurse(widget.element.bdy.rootElement.bdy, widget.serial);
80
81
  // avoid changes on Figure in a prompt