mirror of
https://github.com/tinymce/tinymce.git
synced 2025-08-16 18:21:47 +00:00
TINY-11217: Revert changes (#9967)
* TINY-11217: Revert changes
This reverts commit bb4e4ab2de
.
* TINY-11478: Lock lts to node-20 (#9962)
---------
Co-authored-by: jscasca <jscasca@gmail.com>
This commit is contained in:
@ -1,6 +0,0 @@
|
||||
project: tinymce
|
||||
kind: Added
|
||||
body: Added new default `li` element styles to the content CSS to prevent child list elements from inheriting certain parent list item styles.
|
||||
time: 2024-09-10T21:52:35.043994+10:00
|
||||
custom:
|
||||
Issue: TINY-11217
|
3
Jenkinsfile
vendored
3
Jenkinsfile
vendored
@ -76,6 +76,7 @@ def runTestPod(String cacheName, String name, String testname, String browser, S
|
||||
resourceLimitMemory: '4Gi',
|
||||
resourceLimitEphemeralStorage: '16Gi'
|
||||
],
|
||||
tag: '20',
|
||||
build: cacheName,
|
||||
useContainers: ['node', 'aws-cli']
|
||||
) {
|
||||
@ -126,6 +127,7 @@ def runHeadlessPod(String cacheName, Boolean runAll) {
|
||||
resourceLimitMemory: '4Gi',
|
||||
resourceLimitEphemeralStorage: '16Gi'
|
||||
],
|
||||
tag: '20',
|
||||
seleniumOpts: [
|
||||
image: "selenium/standalone-chrome:127.0",
|
||||
],
|
||||
@ -168,6 +170,7 @@ timestamps {
|
||||
resourceLimitMemory: '4Gi',
|
||||
resourceLimitEphemeralStorage: '16Gi'
|
||||
],
|
||||
tag: '20',
|
||||
build: cacheName
|
||||
) {
|
||||
props = readProperties(file: 'build.properties')
|
||||
|
@ -85,3 +85,4 @@ code {
|
||||
padding-right: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -79,4 +79,3 @@ code {
|
||||
padding-right: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -26,4 +26,3 @@
|
||||
@import 'content/table/table';
|
||||
@import 'content/visualblocks/visualblocks';
|
||||
@import 'content/visualchars/visualchars';
|
||||
@import 'content/list/list';
|
||||
|
@ -1,17 +0,0 @@
|
||||
//
|
||||
// List
|
||||
//
|
||||
|
||||
li {
|
||||
& when (@content-ui-darkmode = true) {
|
||||
color: @color-white
|
||||
}
|
||||
|
||||
& when (@content-ui-darkmode = false) {
|
||||
color: @color-black
|
||||
}
|
||||
background-color: transparent;
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
font-family: @font-stack;
|
||||
}
|
@ -125,19 +125,7 @@ export default (): void => {
|
||||
toolbar: 'undo redo sidebar1 fontsizeinput | bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | align lineheight fontsize fontfamily blocks styles insertfile | styles | ' +
|
||||
'bullist numlist outdent indent | link image | print preview media | forecolor backcolor emoticons table codesample code language | ltr rtl',
|
||||
contextmenu: 'link linkchecker image table lists configurepermanentpen',
|
||||
color_map_raw: [
|
||||
'var(--black)', 'Black',
|
||||
'var(--gray)', 'Gray',
|
||||
'var(--white)', 'White',
|
||||
'var(--red)', 'Red',
|
||||
'var(--yellow)', 'Yellow',
|
||||
'var(--green)', 'Green',
|
||||
'var(--blue)', 'Blue',
|
||||
'hsb(0, 100%, 100%)', 'White hsb',
|
||||
'hsl(0, 100%, 50%)', 'Red hsl',
|
||||
'#ff00ff', 'Pink', // Example of adding a custom color
|
||||
'#00ffff', 'Cyan'
|
||||
],
|
||||
|
||||
// Multiple toolbar array
|
||||
// toolbar: ['undo redo sidebar1 align fontsize insertfile | fontfamily blocks styles insertfile | styles | bold italic',
|
||||
// 'alignleft aligncenter alignright alignjustify | print preview media | forecolor backcolor emoticons table codesample code | ltr rtl',
|
||||
|
@ -1,158 +0,0 @@
|
||||
import { Keys } from '@ephox/agar';
|
||||
import { context, describe, it } from '@ephox/bedrock-client';
|
||||
import { Arr } from '@ephox/katamari';
|
||||
import { PlatformDetection } from '@ephox/sand';
|
||||
import { Css, SugarElement } from '@ephox/sugar';
|
||||
import { TinyAssertions, TinyContentActions, TinyHooks, TinySelections } from '@ephox/wrap-mcagar';
|
||||
import { assert } from 'chai';
|
||||
|
||||
import Editor from 'tinymce/core/api/Editor';
|
||||
|
||||
describe('browser.tinymce.core.fmt.ListIndentationFormatTest', () => {
|
||||
const browser = PlatformDetection.detect().browser;
|
||||
const platform = PlatformDetection.detect().os;
|
||||
|
||||
Arr.each([ 'normal', 'dark', 'inline' ], (test) => {
|
||||
context(`List formatting and styles (${test})`, () => {
|
||||
|
||||
const hook = TinyHooks.bddSetup<Editor>({
|
||||
base_url: '/project/tinymce/js/tinymce',
|
||||
plugins: 'lists',
|
||||
skin: test === 'dark' ? 'oxide-dark' : 'oxide',
|
||||
content_css: test === 'dark' ? 'dark' : 'default',
|
||||
inline: test === 'inline' ? true : false,
|
||||
}, [], true);
|
||||
|
||||
const color = test === 'dark' ? 'rgb(255, 255, 255)' : 'rgb(34, 47, 62)';
|
||||
|
||||
const assertListItemStyles = (unorderd: boolean) => {
|
||||
const sugarItem2 = SugarElement.fromDom(hook.editor().dom.select('li.testClass')[0]);
|
||||
assert.strictEqual(Css.get(sugarItem2, 'color'), color, 'Color should be ' + color);
|
||||
assert.strictEqual(Css.get(sugarItem2, 'background-color'), 'rgba(0, 0, 0, 0)', 'Background color should be rgba(0, 0, 0, 0)');
|
||||
assert.strictEqual(Css.get(sugarItem2, 'font-style'), 'normal', 'Font style should be normal');
|
||||
assert.strictEqual(Css.get(sugarItem2, 'font-weight'), '400', 'Font weight should be 400');
|
||||
assert.strictEqual(Css.get(sugarItem2, 'font-family'),
|
||||
platform.isMacOS() && browser.isChromium() ?
|
||||
'-apple-system, "system-ui", "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif' :
|
||||
'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif',
|
||||
'Font family should match the expected value');
|
||||
|
||||
TinyAssertions.assertContentPresence(hook.editor(),
|
||||
unorderd ? {
|
||||
ul: 2,
|
||||
} : {
|
||||
ol: 2,
|
||||
});
|
||||
};
|
||||
|
||||
it('TINY-11217: Apply multiple formats sequentially to entire list', async () => {
|
||||
const editor = hook.editor();
|
||||
|
||||
editor.setContent('<ul><li>Item 1</li><li class="testClass">Item 2</li></ul>');
|
||||
TinySelections.setSelection(editor, [ 0 ], 0, [ 0 ], 1);
|
||||
editor.formatter.apply('bold');
|
||||
editor.formatter.apply('italic');
|
||||
editor.formatter.apply('underline');
|
||||
editor.formatter.apply('forecolor', { value: '#ff0000' });
|
||||
editor.formatter.apply('hilitecolor', { value: '#ff0000' });
|
||||
TinySelections.setCursor(editor, [ 0, 1 ], 1);
|
||||
|
||||
TinyContentActions.keydown(editor, Keys.tab());
|
||||
|
||||
assertListItemStyles(true);
|
||||
});
|
||||
|
||||
it('TINY-11217: Apply format to partial selection of list item', () => {
|
||||
const editor = hook.editor();
|
||||
|
||||
editor.setContent('<ul><li>Item 1</li><li class="testClass">Item 2</li></ul>');
|
||||
TinySelections.setSelection(editor, [ 0, 0, 0 ], 2, [ 0, 0, 0 ], 4);
|
||||
editor.formatter.apply('bold');
|
||||
editor.formatter.apply('forecolor', { value: '#ff0000' });
|
||||
editor.formatter.apply('hilitecolor', { value: '#ff0000' });
|
||||
TinySelections.setCursor(editor, [ 0, 1 ], 1);
|
||||
|
||||
TinyContentActions.keydown(editor, Keys.tab());
|
||||
|
||||
assertListItemStyles(true);
|
||||
});
|
||||
|
||||
it('TINY-11217: Apply format to nested lists', () => {
|
||||
const editor = hook.editor();
|
||||
|
||||
editor.setContent('<ul><li>Item 1<ul><li>Subitem 1</li><li>Subitem 2</li></ul></li><li class="testClass">Item 2</li></ul>');
|
||||
TinySelections.setSelection(editor, [ 0 ], 0, [ 0 ], 1);
|
||||
editor.formatter.apply('bold');
|
||||
editor.formatter.remove('italic');
|
||||
editor.formatter.remove('underline');
|
||||
editor.formatter.apply('forecolor', { value: '#ff0000' });
|
||||
editor.formatter.apply('hilitecolor', { value: '#ff0000' });
|
||||
TinySelections.setCursor(editor, [ 0, 1 ], 1);
|
||||
|
||||
TinyContentActions.keydown(editor, Keys.tab());
|
||||
|
||||
assertListItemStyles(true);
|
||||
});
|
||||
|
||||
it('TINY-11217: Apply format to list with mixed content', () => {
|
||||
const editor = hook.editor();
|
||||
|
||||
editor.setContent('<ul><li>Item <em>1</em></li><li class="testClass">Item 2</li></ul>');
|
||||
TinySelections.setSelection(editor, [ 0 ], 0, [ 0 ], 1);
|
||||
editor.formatter.apply('underline');
|
||||
TinySelections.setCursor(editor, [ 0, 1 ], 1);
|
||||
|
||||
TinyContentActions.keydown(editor, Keys.tab());
|
||||
|
||||
assertListItemStyles(true);
|
||||
});
|
||||
|
||||
it('TINY-11217: Remove all formats from list', () => {
|
||||
const editor = hook.editor();
|
||||
|
||||
editor.setContent('<ul><li><strong><em><u>Item 1</u></em></strong></li><li class="testClass"><strong><em><u>Item 2</u></em></strong></li></ul>');
|
||||
TinySelections.setSelection(editor, [ 0 ], 0, [ 0 ], 1);
|
||||
editor.formatter.remove('bold');
|
||||
editor.formatter.remove('italic');
|
||||
editor.formatter.remove('underline');
|
||||
TinySelections.setCursor(editor, [ 0, 1 ], 1);
|
||||
|
||||
TinyContentActions.keydown(editor, Keys.tab());
|
||||
|
||||
assertListItemStyles(true);
|
||||
});
|
||||
|
||||
it('TINY-11217: Apply format to ordered list', () => {
|
||||
const editor = hook.editor();
|
||||
|
||||
editor.setContent('<ol><li>Item 1</li><li class="testClass">Item 2</li></ol>');
|
||||
TinySelections.setSelection(editor, [ 0 ], 0, [ 0 ], 1);
|
||||
editor.formatter.apply('bold');
|
||||
editor.formatter.remove('italic');
|
||||
editor.formatter.remove('underline');
|
||||
editor.formatter.apply('forecolor', { value: '#ff0000' });
|
||||
editor.formatter.apply('hilitecolor', { value: '#ff0000' });
|
||||
TinySelections.setCursor(editor, [ 0, 1 ], 1);
|
||||
|
||||
TinyContentActions.keydown(editor, Keys.tab());
|
||||
|
||||
assertListItemStyles(false);
|
||||
});
|
||||
|
||||
it('TINY-11217: Apply custom format to list', () => {
|
||||
const editor = hook.editor();
|
||||
|
||||
editor.formatter.register('custom_format', { inline: 'span', classes: 'custom-class' });
|
||||
editor.setContent('<ul><li>Item 1</li><li class="testClass">Item 2</li></ul>');
|
||||
TinySelections.setSelection(editor, [ 0 ], 0, [ 0 ], 1);
|
||||
editor.formatter.apply('custom_format');
|
||||
TinySelections.setCursor(editor, [ 0, 1 ], 1);
|
||||
|
||||
TinyContentActions.keydown(editor, Keys.tab());
|
||||
|
||||
assertListItemStyles(true);
|
||||
editor.formatter.unregister('custom_format');
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user