From 029d02b89fe709daafe119a7c53389d3d85fabbd Mon Sep 17 00:00:00 2001 From: Sergei Mikhailov Date: Wed, 31 Jul 2024 12:23:33 +0200 Subject: [PATCH] feat: add support for centered image --- package-lock.json | 10 +++++----- package.json | 2 +- src/qtiCommonRenderer/renderers/Figure.js | 3 ++- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1f71e7f7..529a2533 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,7 @@ "@oat-sa/tao-core-libs": "^1.0.0", "@oat-sa/tao-core-sdk": "^3.0.0", "@oat-sa/tao-core-shared-libs": "^1.4.1", - "@oat-sa/tao-core-ui": "^3.1.0", + "@oat-sa/tao-core-ui": "github:oat-sa/tao-core-ui-fe#feature/AUT-3769/support-centered-image", "@oat-sa/tao-item-runner": "^1.0.0", "@oat-sa/tao-qunit-testrunner": "^2.0.0", "async": "^0.2.10", @@ -921,10 +921,10 @@ "dev": true }, "node_modules/@oat-sa/tao-core-ui": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@oat-sa/tao-core-ui/-/tao-core-ui-3.1.0.tgz", - "integrity": "sha512-7fJ+lArIyO/9Q2nZ82UiFCr1FPdIp3nXPIQw0YYfS/DX3uaSwYyriQWJk3Rf7BoD+/pdZ/EykUXDsg1IAx8RtA==", - "dev": true + "version": "3.5.0", + "resolved": "git+ssh://git@github.com/oat-sa/tao-core-ui-fe.git#9f677ffe9c397ac09ef8fbf14bd6ca568ededf40", + "dev": true, + "license": "GPL-2.0" }, "node_modules/@oat-sa/tao-item-runner": { "version": "1.0.0", diff --git a/package.json b/package.json index 4ecd1f13..493f3a9c 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "@oat-sa/tao-core-libs": "^1.0.0", "@oat-sa/tao-core-sdk": "^3.0.0", "@oat-sa/tao-core-shared-libs": "^1.4.1", - "@oat-sa/tao-core-ui": "^3.1.0", + "@oat-sa/tao-core-ui": "github:oat-sa/tao-core-ui-fe#feature/AUT-3769/support-centered-image", "@oat-sa/tao-item-runner": "^1.0.0", "@oat-sa/tao-qunit-testrunner": "^2.0.0", "async": "^0.2.10", diff --git a/src/qtiCommonRenderer/renderers/Figure.js b/src/qtiCommonRenderer/renderers/Figure.js index 1b573065..10966cdb 100644 --- a/src/qtiCommonRenderer/renderers/Figure.js +++ b/src/qtiCommonRenderer/renderers/Figure.js @@ -20,6 +20,7 @@ import _ from 'lodash'; import containerHelper from 'taoQtiItem/qtiCommonRenderer/helpers/container'; import imageTpl from 'taoQtiItem/qtiCommonRenderer/tpl/figure-image'; import widgetTpl from 'taoQtiItem/qtiCommonRenderer/tpl/figure-widget'; +import { FLOAT_LEFT_CLASS, FLOAT_RIGHT_CLASS, CENTER_CLASS } from 'ui/mediaEditor/plugins/mediaAlignment/helper'; const DISABLE_FIGURE_WIDGET = context.featureFlags['FEATURE_FLAG_DISABLE_FIGURE_WIDGET']; @@ -33,7 +34,7 @@ export default { } let showFigure = false; - if (data.attributes.class && ['wrap-left', 'wrap-right'].includes(data.attributes.class)) { + if (data.attributes.class && [FLOAT_LEFT_CLASS, FLOAT_RIGHT_CLASS, CENTER_CLASS].includes(data.attributes.class)) { showFigure = true; } else { _.some(elem.bdy['elements'], childElement => {