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

INT-3302: Update tinymce to version 7 #408

Merged
merged 9 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,6 @@
"webpack": "^5.75.0"
},
"dependencies": {
"tinymce": "^6.0.0 || ^5.5.1"
"tinymce": "^7.0.0 || ^6.0.0 || ^5.5.1"
}
}
7 changes: 6 additions & 1 deletion src/main/ts/Utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ const validEvents = [
'onClearUndos',
'onClick',
'onContextMenu',
'onCommentChange',
spocke marked this conversation as resolved.
Show resolved Hide resolved
'onCompositionEnd',
'onCompositionStart',
'onCompositionUpdate',
'onCopy',
'onCut',
'onDblclick',
Expand All @@ -42,6 +46,7 @@ const validEvents = [
'onGetContent',
'onHide',
'onInit',
'onInput',
'onKeyDown',
'onKeyPress',
'onKeyUp',
Expand Down Expand Up @@ -159,4 +164,4 @@ export {
isTextarea,
mergePlugins,
isNullOrUndefined
};
};
2 changes: 1 addition & 1 deletion src/main/ts/components/Editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export const Editor = defineComponent({
if (getTinymce() !== null) {
initWrapper();
} else if (element.value && element.value.ownerDocument) {
const channel = props.cloudChannel ? props.cloudChannel : '6';
const channel = props.cloudChannel ? props.cloudChannel : '7';
const apiKey = props.apiKey ? props.apiKey : 'no-api-key';
const scriptSrc: string = isNullOrUndefined(props.tinymceScriptSrc) ?
`https://cdn.tiny.cloud/1/${apiKey}/tinymce/${channel}/tinymce.min.js` :
Expand Down
2 changes: 2 additions & 0 deletions src/main/ts/components/EditorPropTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export type CopyProps<T> = { [P in keyof T]: any };

export interface IPropTypes {
apiKey: string;
licenseKey: string;
cloudChannel: string;
id: string;
init: EditorOptions & { selector?: undefined; target?: undefined };
Expand All @@ -30,6 +31,7 @@ export interface IPropTypes {

export const editorProps: CopyProps<IPropTypes> = {
apiKey: String,
licenseKey: String,
cloudChannel: String,
id: String,
init: Object,
Expand Down
6 changes: 3 additions & 3 deletions src/stories/Editor.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ export default {
table: {
defaultValue: {summary: '5'}
},
defaultValue: ['5'],
options: ['5', '5-dev', '5-testing', '6-dev', '6-testing', '6-stable'],
defaultValue: ['7'],
options: ['5', '5-dev', '5-testing', '6-testing', '6-stable', '7-dev', '7-testing', '7-stable'],
control: { type: 'select'}
},
conf: {
Expand Down Expand Up @@ -182,4 +182,4 @@ export const Disable: Story = (args) => ({
v-model="content"
/>
</div>`
});
});
7 changes: 4 additions & 3 deletions src/test/ts/browser/InitTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ UnitTest.asynctest('InitTest', (success, failure) => {
Keyboard.keystroke(Keys.space(), {}, SugarElement.fromDom(context.editor.getBody()) as SugarElement<Node>);
});

const sTestVersion = (version: '4' | '5' | '6') => VersionLoader.sWithVersion(
const sTestVersion = (version: '4' | '5' | '6' | '7') => VersionLoader.sWithVersion(
version,
GeneralSteps.sequence([
Logger.t('Should be able to setup editor', Chain.asStep({}, [
Expand Down Expand Up @@ -77,6 +77,7 @@ UnitTest.asynctest('InitTest', (success, failure) => {
Pipeline.async({}, [
sTestVersion('4'),
sTestVersion('5'),
sTestVersion('6')
sTestVersion('6'),
sTestVersion('7'),
], success, failure);
});
});
2 changes: 1 addition & 1 deletion src/test/ts/browser/LoadTinyTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,4 @@ UnitTest.asynctest('LoadTinyTest', (success, failure) => {
cDeleteTinymce
]),
], success, failure);
});
});
13 changes: 4 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -15387,15 +15387,10 @@ tiny-emitter@^2.0.0:
resolved "https://registry.yarnpkg.com/tinymce/-/tinymce-6.0.0.tgz#44945e4c12ea90d08aedf357304c24269a164e54"
integrity sha512-y4b5OhxScZiFovTgEFzI+2zEDSMfbJSQ4hfcYPg9HXvudxvDIHjc3fF73m0Sys5h8YtpWPG1fT9iJsjSnwuo2A==

"tinymce-7@npm:tinymce@^7":
version "7.0.0"
resolved "https://registry.yarnpkg.com/tinymce/-/tinymce-7.0.0.tgz#d35441e15f8011cf549b39e58b64648798816e92"
integrity sha512-ggXLfTRrUALAcjeJSRrZcJDOl6MgC2tPXe/zNOEkQXvTDgcKqFypPRoPpfpK5wejexjyaI/7dwETOntJ5MPBFg==

"tinymce@^6.0.0 || ^5.5.1":
version "6.3.1"
resolved "https://registry.yarnpkg.com/tinymce/-/tinymce-6.3.1.tgz#cc5cf2b9f702d429cf5d1d21ed62245d768bfc4f"
integrity sha512-+oCwXuTxAdJXVJ0130OxQz0JDNsqg3deuzgeUo8X5Vb27EzCJgXwO5eWvCxvkxpQo4oiHMVlM4tUIpTUHufHGQ==
"tinymce-7@npm:tinymce@^7", "tinymce@^7.0.0 || ^6.0.0 || ^5.5.1":
version "7.0.1"
resolved "https://registry.yarnpkg.com/tinymce/-/tinymce-7.0.1.tgz#743f4003027a13497654a5ce5ca74793815386f7"
integrity sha512-0a7DJnhniBx2psRuKcVQ9g4hujN6PAR4fPS0NSF1T1luH1RBDZVVEn2pGND6Ly+AW1lUm/cHOHjsasqBelMhbw==

tmp@^0.2.1:
version "0.2.1"
Expand Down
Loading