Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 3.6.0 #600

Merged
merged 6 commits into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@oat-sa/tao-core-ui",
"version": "3.5.0",
"version": "3.6.0",
"displayName": "TAO Core UI",
"description": "UI libraries of TAO",
"scripts": {
Expand Down
Binary file modified scss/font/tao/tao.eot
Binary file not shown.
1 change: 1 addition & 0 deletions scss/font/tao/tao.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified scss/font/tao/tao.ttf
Binary file not shown.
Binary file modified scss/font/tao/tao.woff
Binary file not shown.
5 changes: 5 additions & 0 deletions scss/inc/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,11 @@ body {
margin: 20px 0 20px 20px;
}

.tao-centered {
margin: 20px auto;
display: block;
}

.txt-ctr {
text-align: center;
}
Expand Down
1 change: 1 addition & 0 deletions scss/inc/fonts/_tao-icon-classes.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* Do not edit */[class^="icon-"], [class*=" icon-"] { @include tao-icon-setup; }
%icon-align-center-before, .icon-align-center:before { @include icon-align-center; }
%icon-multiple-magicwand-before, .icon-multiple-magicwand:before { @include icon-multiple-magicwand; }
%icon-sd-import-before, .icon-sd-import:before { @include icon-sd-import; }
%icon-sd-export-before, .icon-sd-export:before { @include icon-sd-export; }
Expand Down
10 changes: 5 additions & 5 deletions scss/inc/fonts/_tao-icon-def.scss
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/* Do not edit */@font-face {
font-family: 'tao';
src: url('#{$fontPath}tao/tao.eot?8uy0x');
src: url('#{$fontPath}tao/tao.eot?8uy0x#iefix') format('embedded-opentype'),
url('#{$fontPath}tao/tao.ttf?8uy0x') format('truetype'),
url('#{$fontPath}tao/tao.woff?8uy0x') format('woff'),
url('#{$fontPath}tao/tao.svg?8uy0x#tao') format('svg');
src: url('#{$fontPath}tao/tao.eot?y6cmhc');
src: url('#{$fontPath}tao/tao.eot?y6cmhc#iefix') format('embedded-opentype'),
url('#{$fontPath}tao/tao.ttf?y6cmhc') format('truetype'),
url('#{$fontPath}tao/tao.woff?y6cmhc') format('woff'),
url('#{$fontPath}tao/tao.svg?y6cmhc#tao') format('svg');
font-weight: normal;
font-style: normal;
font-display: block;
Expand Down
1 change: 1 addition & 0 deletions scss/inc/fonts/_tao-icon-vars.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
-moz-osx-font-smoothing: grayscale;
}

@mixin icon-align-center { content: "\e92a"; }
@mixin icon-multiple-magicwand { content: "\e929"; }
@mixin icon-sd-import { content: "\e91f"; }
@mixin icon-sd-export { content: "\e924"; }
Expand Down
11 changes: 9 additions & 2 deletions src/mediaEditor/plugins/mediaAlignment/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import _ from 'lodash';

export const FLOAT_LEFT_CLASS = 'wrap-left';
export const FLOAT_RIGHT_CLASS = 'wrap-right';
export const CENTER_CLASS = 'tao-centered';

const searchRecurse = (parentElement, serial) => {
if (!parentElement) {
Expand Down Expand Up @@ -49,8 +50,8 @@ export const positionFloat = function positionFloat(widget, position) {
return;
}

widget.$container.removeClass(`${FLOAT_LEFT_CLASS} ${FLOAT_RIGHT_CLASS}`);
widget.$original.removeClass(`${FLOAT_LEFT_CLASS} ${FLOAT_RIGHT_CLASS}`);
widget.$container.removeClass(`${FLOAT_LEFT_CLASS} ${FLOAT_RIGHT_CLASS} ${CENTER_CLASS}`);
widget.$original.removeClass(`${FLOAT_LEFT_CLASS} ${FLOAT_RIGHT_CLASS} ${CENTER_CLASS}`);

let className;

Expand All @@ -61,6 +62,9 @@ export const positionFloat = function positionFloat(widget, position) {
case 'left':
className = FLOAT_LEFT_CLASS;
break;
case 'center':
className = CENTER_CLASS;
break;
case 'default':
className = '';
}
Expand Down Expand Up @@ -108,4 +112,7 @@ export const initAlignment = function initAlignment(widget) {
if (widget.element.hasClass(FLOAT_RIGHT_CLASS)) {
return positionFloat(widget, 'right');
}
if (widget.element.hasClass(CENTER_CLASS)) {
return positionFloat(widget, 'center');
}
};
19 changes: 11 additions & 8 deletions src/mediaEditor/plugins/mediaAlignment/mediaAlignmentComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import _ from 'lodash';
import component from 'ui/component';
import tpl from 'ui/mediaEditor/plugins/mediaAlignment/tpl/mediaAlignment';
import 'ui/mediaEditor/plugins/mediaAlignment/style.css';
import { FLOAT_LEFT_CLASS, FLOAT_RIGHT_CLASS } from './helper';
import { FLOAT_LEFT_CLASS, FLOAT_RIGHT_CLASS, CENTER_CLASS } from './helper';

/**
* Creates mediaAlignment component
Expand All @@ -44,18 +44,19 @@ export default function mediaAlignmentFactory($container, media) {
*/
update(conf) {
$template.find('input:checked').prop('checked', false);
$template.find(`input[name="${conf}"]`).prop('checked', true);
switch (conf) {
case 'wrap-right':
case FLOAT_RIGHT_CLASS:
conf = 'right';
$template.find('input[name="wrap-right"]').prop('checked', true);
break;
case 'wrap-left':
case FLOAT_LEFT_CLASS:
conf = 'left';
$template.find('input[name="wrap-left"]').prop('checked', true);
break;
case CENTER_CLASS:
conf = 'center';
break;
default:
conf = 'default';
$template.find('input[name="wrap-inline"]').prop('checked', true);
break;
}
media.align = conf;
Expand All @@ -78,9 +79,11 @@ export default function mediaAlignmentFactory($container, media) {
const classListTag = container.classList;

if (classListTag.contains(FLOAT_RIGHT_CLASS)) {
this.update('wrap-right');
this.update(FLOAT_RIGHT_CLASS);
} else if (classListTag.contains(FLOAT_LEFT_CLASS)) {
this.update('wrap-left');
this.update(FLOAT_LEFT_CLASS);
} else if (classListTag.contains(CENTER_CLASS)) {
this.update(CENTER_CLASS);
} else {
this.update('wrap-inline');
}
Expand Down
7 changes: 7 additions & 0 deletions src/mediaEditor/plugins/mediaAlignment/tpl/mediaAlignment.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,12 @@
<span class="icon-wrap-right"></span>
{{__ 'Wrap image right'}}
</label>
<br>
<label class="smaller-prompt">
<input type="radio" name="tao-centered"/>
<span class="icon-radio"></span>
<span class="icon-align-center"></span>
{{__ 'Center'}}
</label>
</fieldset>
</div>
Loading