mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
N°7552 - Move CKEditor from to npm dependencies
This commit is contained in:
2
css/backoffice/vendors/ckeditor/_all.scss
vendored
2
css/backoffice/vendors/ckeditor/_all.scss
vendored
@@ -3,5 +3,5 @@
|
||||
* @license http://opensource.org/licenses/AGPL-3.0
|
||||
*/
|
||||
|
||||
@import "../../../../js/ckeditor/build/compiled-theme"; /* CKEditor content styles (tables, lists, ...) */
|
||||
@import "../../../../node_modules/ckeditor5-itop-build/build/styles/compiled-theme"; /* CKEditor content styles (tables, lists, ...) */
|
||||
@import "overloads"; /* Overloads of CKEditor styles for the backoffice */
|
||||
@@ -12,7 +12,7 @@
|
||||
}
|
||||
|
||||
/* N°7611 - Ensure to embed HTML fields styles */
|
||||
@import "../js/ckeditor/build/compiled-theme";
|
||||
@import "../node_modules/ckeditor5-itop-build/build/styles/compiled-theme";
|
||||
.email-is-html-content {
|
||||
@extend .ck-content;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
*/
|
||||
|
||||
@import 'variables.scss';
|
||||
@import '../../../../../js/ckeditor/build/compiled-theme';
|
||||
@import '../../../../../node_modules/ckeditor5-itop-build/build/styles/compiled-theme';
|
||||
@import '../../../../../css/common/vendors/_highlightjs.scss';
|
||||
|
||||
|
||||
|
||||
5708
js/ckeditor/package-lock.json
generated
5708
js/ckeditor/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,183 +0,0 @@
|
||||
/**
|
||||
* @license Copyright (c) 2014-2024, CKSource Holding sp. z o.o. All rights reserved.
|
||||
* This file is licensed under the terms of the MIT License (see LICENSE.md).
|
||||
*/
|
||||
|
||||
:root {
|
||||
/* We are defining variables in case of missing comments plugin.
|
||||
* See case 2: https://github.com/cksource/ckeditor5-online-builder/issues/80. */
|
||||
--ck-user-avatar-background: hsl(210, 52%, 44%);
|
||||
--ck-user-avatar-color: hsl(0, 0%, 100%);
|
||||
}
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body, html {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#overlay {
|
||||
font-family: Helvetica;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
background: #333;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 4vh 4vw;
|
||||
overflow: auto;
|
||||
z-index: 9999;
|
||||
}
|
||||
|
||||
#overlay.hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#overlay .body {
|
||||
font-size: 14px;
|
||||
width: 100%;
|
||||
max-width: 800px;
|
||||
background: white;
|
||||
padding: 40px;
|
||||
border-radius: 3px;
|
||||
box-shadow: 0 0 15px 5px #000;
|
||||
}
|
||||
|
||||
#overlay h2 {
|
||||
margin-top: 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#overlay p {
|
||||
text-align: center;
|
||||
margin-bottom: 1.5em;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#overlay a {
|
||||
color: hsl(219, 100%, 50%);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
#overlay a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
#overlay .body>div {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin: 15px 0;
|
||||
}
|
||||
|
||||
#overlay .body>div label {
|
||||
width: 180px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
#overlay .body>div input {
|
||||
width: 100%;
|
||||
padding: 8px;
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
button#start {
|
||||
display: block;
|
||||
width: 100%;
|
||||
max-width: 300px;
|
||||
margin: 20px auto 0;
|
||||
padding: 15px;
|
||||
background: hsl(104, 44%, 48%);
|
||||
color: white;
|
||||
font-weight: bold;
|
||||
border: 0;
|
||||
border-radius: 3px;
|
||||
font-size: 1em;
|
||||
cursor: pointer;
|
||||
transition: 250ms ease background;
|
||||
}
|
||||
|
||||
button#start:hover {
|
||||
background: hsl(104, 44%, 41%);
|
||||
}
|
||||
|
||||
#overlay #additional {
|
||||
display: none;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
#overlay #additional.visible {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
#overlay.warning #additional>p {
|
||||
color: red;
|
||||
}
|
||||
|
||||
#overlay.warning #user-container {
|
||||
border-color: red;
|
||||
}
|
||||
|
||||
#overlay #user-container {
|
||||
width: 100%;
|
||||
border: 1px solid hsl(0, 0%, 85%);
|
||||
}
|
||||
|
||||
#overlay #user-container div {
|
||||
display: flex;
|
||||
cursor: pointer;
|
||||
align-items: center;
|
||||
height: 48px;
|
||||
padding: 10px;
|
||||
background: hsl(0, 0%, 97%);
|
||||
transition: 250ms ease background;
|
||||
}
|
||||
|
||||
#overlay #user-container div:nth-child( odd) {
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
#overlay #user-container div:hover {
|
||||
background: hsl(0, 0%, 92%);
|
||||
}
|
||||
|
||||
#overlay #user-container div.active {
|
||||
background: hsl(133, 50%, 84%);
|
||||
}
|
||||
|
||||
#overlay #user-container img, #overlay #user-container .pseudo-avatar {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
border-radius: 50%;
|
||||
border: 2px solid var(--ck-user-avatar-background);
|
||||
margin-right: 10px;
|
||||
background: var(--ck-user-avatar-color);
|
||||
}
|
||||
|
||||
#overlay #user-container .pseudo-avatar {
|
||||
font-size: 0.9em;
|
||||
text-align: center;
|
||||
line-height: 30px;
|
||||
background: var(--ck-user-avatar-background);
|
||||
color: var(--ck-user-avatar-color);
|
||||
}
|
||||
|
||||
#overlay #user-container .pseudo-avatar.anonymous {
|
||||
background-image: url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2020%2020%22%3E%0A%20%20%3Cpath%20fill%3D%22%23FFF%22%20fill-rule%3D%22nonzero%22%20d%3D%22M9.8%2020H2c0-5.7%205-5.7%206-7l.2-.8c-1.6-.8-2.7-2.7-2.7-5%200-2.8%202-5.2%204.3-5.2S14%204.4%2014%207.3c0%202.2-1%204-2.6%205l.2.6c1.2%201.3%206%201.4%206%207H9.8z%22%2F%3E%0A%3C%2Fsvg%3E)
|
||||
}
|
||||
|
||||
.role {
|
||||
font-size: 11px;
|
||||
border: 1px solid #3570aa;
|
||||
border-radius: 4px;
|
||||
color: #3570aa;
|
||||
padding: 2px 5px;
|
||||
margin-left: 10px;
|
||||
font-weight: bold;
|
||||
margin-top: 2px;
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
/**
|
||||
* @license Copyright (c) 2014-2024, CKSource Holding sp. z o.o. All rights reserved.
|
||||
* This file is licensed under the terms of the MIT License (see LICENSE.md).
|
||||
*/
|
||||
|
||||
/* eslint-env browser */
|
||||
|
||||
( function() {
|
||||
const LOCAL_STORAGE_KEY = 'CKEDITOR_CS_CONFIG';
|
||||
|
||||
function createDialog() {
|
||||
const overlay = document.createElement( 'div' );
|
||||
|
||||
overlay.id = 'overlay';
|
||||
overlay.innerHTML = `
|
||||
<form class="body">
|
||||
<h2>Connect CKEditor5 Premium Features</h2>
|
||||
<p>If you do not have CKEditor5 license key yet, <a href="https://ckeditor.com/docs/trial/latest/guides/overview.html" target="_blank">see the documentation</a>.</p>
|
||||
<div>
|
||||
<label for="license-key">CKEditor5 License Key</label>
|
||||
<input id="license-key">
|
||||
</div>
|
||||
<h2>Connect CKBox</h2>
|
||||
<div>
|
||||
<label for="ckbox-token-url">CKBox token URL</label>
|
||||
<input id="ckbox-token-url">
|
||||
</div>
|
||||
<button id="start" type="submit">Start</button>
|
||||
</form>`;
|
||||
|
||||
document.body.appendChild( overlay );
|
||||
|
||||
const config = getStoredConfig();
|
||||
|
||||
const licenseKeyInput = document.getElementById( 'license-key' );
|
||||
licenseKeyInput.value = config.licenseKey || '';
|
||||
|
||||
const ckboxTokenUrlInput = document.getElementById( 'ckbox-token-url' );
|
||||
ckboxTokenUrlInput.value = config.ckboxTokenUrl || '';
|
||||
|
||||
return new Promise( resolve => {
|
||||
overlay.querySelector( 'form' ).addEventListener( 'submit', event => {
|
||||
event.preventDefault();
|
||||
|
||||
config.licenseKey = licenseKeyInput.value;
|
||||
|
||||
config.ckboxTokenUrl = ckboxTokenUrlInput.value;
|
||||
|
||||
overlay.remove();
|
||||
storeConfig( config );
|
||||
resolve( config );
|
||||
} );
|
||||
} );
|
||||
}
|
||||
|
||||
function getStoredConfig() {
|
||||
return JSON.parse( localStorage.getItem( LOCAL_STORAGE_KEY ) || '{}' );
|
||||
}
|
||||
|
||||
function storeConfig( config ) {
|
||||
localStorage.setItem( LOCAL_STORAGE_KEY, JSON.stringify( config ) );
|
||||
}
|
||||
|
||||
window.createDialog = createDialog;
|
||||
}() );
|
||||
@@ -1,110 +0,0 @@
|
||||
<!DOCTYPE html><!--
|
||||
Copyright (c) 2014-2024, CKSource Holding sp. z o.o. All rights reserved.
|
||||
This file is licensed under the terms of the MIT License (see LICENSE.md).
|
||||
-->
|
||||
|
||||
<html lang="en" dir="ltr">
|
||||
<head>
|
||||
<title>CKEditor 5 ClassicEditor build</title>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="icon" type="image/png" href="https://c.cksource.com/a/1/logos/ckeditor5.png">
|
||||
<link rel="stylesheet" type="text/css" href="styles.css">
|
||||
<link href="configuration-dialog/configuration-dialog.css" rel="stylesheet" type="text/css">
|
||||
</head>
|
||||
<body data-editor="ClassicEditor" data-collaboration="false" data-revision-history="false">
|
||||
<header>
|
||||
<div class="centered">
|
||||
<h1><a href="https://ckeditor.com/ckeditor-5/" target="_blank" rel="noopener noreferrer"><img src="https://c.cksource.com/a/1/logos/ckeditor5.svg" alt="CKEditor 5 logo">CKEditor 5</a></h1>
|
||||
<nav>
|
||||
<ul>
|
||||
<li><a href="https://ckeditor.com/docs/ckeditor5/" target="_blank" rel="noopener noreferrer">Documentation</a></li>
|
||||
<li><a href="https://ckeditor.com/" target="_blank" rel="noopener noreferrer">Website</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
<div class="message">
|
||||
<div class="centered">
|
||||
<h2>CKEditor 5 online builder demo - ClassicEditor build</h2>
|
||||
</div>
|
||||
</div>
|
||||
<div class="centered">
|
||||
<div class="row row-editor">
|
||||
<div class="editor-container">
|
||||
<div class="editor">
|
||||
<h2>Bilingual Personality Disorder</h2>
|
||||
<figure class="image image-style-side"><img src="https://c.cksource.com/a/1/img/docs/sample-image-bilingual-personality-disorder.jpg">
|
||||
<figcaption>One language, one person.</figcaption>
|
||||
</figure>
|
||||
<p>
|
||||
This may be the first time you hear about this made-up disorder but
|
||||
it actually isn’t so far from the truth. Even the studies that were conducted almost half a century show that
|
||||
<strong>the language you speak has more effects on you than you realize</strong>.
|
||||
</p>
|
||||
<p>
|
||||
One of the very first experiments conducted on this topic dates back to 1964.
|
||||
<a href="https://www.researchgate.net/publication/9440038_Language_and_TAT_content_in_bilinguals">In the experiment</a>
|
||||
designed by linguist Ervin-Tripp who is an authority expert in psycholinguistic and sociolinguistic studies,
|
||||
adults who are bilingual in English in French were showed series of pictures and were asked to create 3-minute stories.
|
||||
In the end participants emphasized drastically different dynamics for stories in English and French.
|
||||
</p>
|
||||
<p>
|
||||
Another ground-breaking experiment which included bilingual Japanese women married to American men in San Francisco were
|
||||
asked to complete sentences. The goal of the experiment was to investigate whether or not human feelings and thoughts
|
||||
are expressed differently in <strong>different language mindsets</strong>.
|
||||
Here is a sample from the the experiment:
|
||||
</p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>English</th>
|
||||
<th>Japanese</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Real friends should</td>
|
||||
<td>Be very frank</td>
|
||||
<td>Help each other</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>I will probably become</td>
|
||||
<td>A teacher</td>
|
||||
<td>A housewife</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>When there is a conflict with family</td>
|
||||
<td>I do what I want</td>
|
||||
<td>It's a time of great unhappiness</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>
|
||||
More recent <a href="https://books.google.pl/books?id=1LMhWGHGkRUC">studies</a> show, the language a person speaks affects
|
||||
their cognition, behaviour, emotions and hence <strong>their personality</strong>.
|
||||
This shouldn’t come as a surprise
|
||||
<a href="https://en.wikipedia.org/wiki/Lateralization_of_brain_function">since we already know</a> that different regions
|
||||
of the brain become more active depending on the person’s activity at hand. Since structure, information and especially
|
||||
<strong>the culture</strong> of languages varies substantially and the language a person speaks is an essential element of daily life.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<footer>
|
||||
<p><a href="https://ckeditor.com/ckeditor-5/" target="_blank" rel="noopener">CKEditor 5</a>
|
||||
– Rich text editor of tomorrow, available today
|
||||
</p>
|
||||
<p>Copyright © 2003-2024,
|
||||
<a href="https://cksource.com/" target="_blank" rel="noopener">CKSource</a>
|
||||
Holding sp. z o.o. All rights reserved.
|
||||
</p>
|
||||
</footer>
|
||||
<script src="https://cdn.ckbox.io/CKBox/2.4.0/ckbox.js"></script>
|
||||
<script src="../build/ckeditor.js"></script>
|
||||
<script src="configuration-dialog/configuration-dialog.js"></script>
|
||||
<script src="script.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,25 +0,0 @@
|
||||
createDialog().then( config => {
|
||||
return ClassicEditor
|
||||
.create( document.querySelector( '.editor' ), {
|
||||
licenseKey: config.licenseKey,
|
||||
ckbox: {
|
||||
tokenUrl: config.ckboxTokenUrl
|
||||
}
|
||||
} )
|
||||
.then( editor => {
|
||||
window.editor = editor;
|
||||
} )
|
||||
.catch( handleSampleError );
|
||||
} );
|
||||
|
||||
function handleSampleError( error ) {
|
||||
const issueUrl = 'https://github.com/ckeditor/ckeditor5/issues';
|
||||
|
||||
const message = [
|
||||
'Oops, something went wrong!',
|
||||
`Please, report the following error on ${ issueUrl } with the build id "432vyqcgng9n-qwbrzeekei95" and the error stack trace:`
|
||||
].join( '\n' );
|
||||
|
||||
console.error( message );
|
||||
console.error( error );
|
||||
}
|
||||
@@ -1,514 +0,0 @@
|
||||
/**
|
||||
* @license Copyright (c) 2014-2024, CKSource Holding sp. z o.o. All rights reserved.
|
||||
* This file is licensed under the terms of the MIT License (see LICENSE.md).
|
||||
*/
|
||||
|
||||
:root {
|
||||
--ck-sample-base-spacing: 2em;
|
||||
--ck-sample-color-white: #fff;
|
||||
--ck-sample-color-green: #279863;
|
||||
--ck-sample-color-blue: #1a9aef;
|
||||
--ck-sample-container-width: 1285px;
|
||||
--ck-sample-sidebar-width: 350px;
|
||||
--ck-sample-editor-min-height: 400px;
|
||||
--ck-sample-editor-z-index: 10;
|
||||
}
|
||||
|
||||
/* --------- EDITOR STYLES ---------------------------------------------------------------------------------------- */
|
||||
|
||||
.editor__editable,
|
||||
/* Classic build. */
|
||||
main .ck-editor[role='application'] .ck.ck-content,
|
||||
/* Decoupled document build. */
|
||||
.ck.editor__editable[role='textbox'],
|
||||
.ck.ck-editor__editable[role='textbox'],
|
||||
/* Inline & Balloon build. */
|
||||
.ck.editor[role='textbox'] {
|
||||
width: 100%;
|
||||
background: #fff;
|
||||
font-size: 1em;
|
||||
line-height: 1.6em;
|
||||
min-height: var(--ck-sample-editor-min-height);
|
||||
padding: 1.5em 2em;
|
||||
}
|
||||
|
||||
.ck.ck-editor__editable {
|
||||
background: #fff;
|
||||
border: 1px solid hsl(0, 0%, 70%);
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* Because of sidebar `position: relative`, Edge is overriding the outline of a focused editor. */
|
||||
.ck.ck-editor__editable {
|
||||
position: relative;
|
||||
z-index: var(--ck-sample-editor-z-index);
|
||||
}
|
||||
|
||||
.editor-container {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.editor-container--with-sidebar > .ck.ck-editor {
|
||||
width: calc( 100% - var(--ck-sample-sidebar-width) );
|
||||
}
|
||||
|
||||
/* --------- DECOUPLED (DOCUMENT) BUILD. ---------------------------------------------*/
|
||||
body[data-editor='DecoupledEditor'] .document-editor__toolbar {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
body[data-editor='DecoupledEditor'] .collaboration-demo__editable,
|
||||
body[data-editor='DecoupledEditor'] .row-editor .editor {
|
||||
/* A pixel is added for each of the border. */
|
||||
width: calc(21cm + 2px);
|
||||
min-height: calc(29.7cm + 2px);
|
||||
/* To avoid having extra scrolls inside the editor container. */
|
||||
height: fit-content;
|
||||
padding: 2cm 1.2cm;
|
||||
margin: 2.5rem;
|
||||
border: 1px hsl( 0, 0%, 82.7% ) solid;
|
||||
background-color: var(--ck-sample-color-white);
|
||||
box-shadow: 0 0 5px hsla( 0, 0%, 0%, .1 );
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body[data-editor='DecoupledEditor'] .row-editor {
|
||||
display: flex;
|
||||
position: relative;
|
||||
justify-content: center;
|
||||
overflow-y: auto;
|
||||
background-color: #f2f2f2;
|
||||
border: 1px solid hsl(0, 0%, 77%);
|
||||
/* Limit the max-height of the editor to avoid scrolling from bottom to top to see the toolbar. */
|
||||
max-height: 700px;
|
||||
}
|
||||
|
||||
body[data-editor='DecoupledEditor'] .sidebar {
|
||||
background: transparent;
|
||||
border: 0;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
/* --------- COMMENTS & TRACK CHANGES FEATURE ---------------------------------------------------------------------- */
|
||||
.sidebar {
|
||||
padding: 0 15px;
|
||||
position: relative;
|
||||
min-width: var(--ck-sample-sidebar-width);
|
||||
max-width: var(--ck-sample-sidebar-width);
|
||||
font-size: 20px;
|
||||
border: 1px solid hsl(0, 0%, 77%);
|
||||
background: hsl(0, 0%, 98%);
|
||||
border-left: 0;
|
||||
overflow: hidden;
|
||||
min-height: 100%;
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
/* Do not inherit styles related to the editable editor content. See line 25.*/
|
||||
.sidebar .ck-content[role='textbox'],
|
||||
.ck.ck-annotation-wrapper .ck-content[role='textbox'] {
|
||||
min-height: unset;
|
||||
width: unset;
|
||||
padding: 0;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.sidebar.narrow {
|
||||
min-width: 60px;
|
||||
flex-grow: 0;
|
||||
}
|
||||
|
||||
.sidebar.hidden {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
#sidebar-display-toggle {
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
text-align: center;
|
||||
left: 15px;
|
||||
top: 30px;
|
||||
border: 0;
|
||||
padding: 0;
|
||||
color: hsl( 0, 0%, 50% );
|
||||
transition: 250ms ease color;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
#sidebar-display-toggle:hover {
|
||||
color: hsl( 0, 0%, 30% );
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#sidebar-display-toggle:focus,
|
||||
#sidebar-display-toggle:active {
|
||||
outline: none;
|
||||
border: 1px solid #a9d29d;
|
||||
}
|
||||
|
||||
#sidebar-display-toggle svg {
|
||||
fill: currentColor;
|
||||
}
|
||||
|
||||
/* --------- COLLABORATION FEATURES (USERS) ------------------------------------------------------------------------ */
|
||||
.row-presence {
|
||||
width: 100%;
|
||||
border: 1px solid hsl(0, 0%, 77%);
|
||||
border-bottom: 0;
|
||||
background: hsl(0, 0%, 98%);
|
||||
padding: var(--ck-spacing-small);
|
||||
|
||||
/* Make `border-bottom` as `box-shadow` to not overlap with the editor border. */
|
||||
box-shadow: 0 1px 0 0 hsl(0, 0%, 77%);
|
||||
|
||||
/* Make `z-index` bigger than `.editor` to properly display tooltips. */
|
||||
z-index: 20;
|
||||
}
|
||||
|
||||
.ck.ck-presence-list {
|
||||
flex: 1;
|
||||
padding: 1.25rem .75rem;
|
||||
}
|
||||
|
||||
.presence .ck.ck-presence-list__counter {
|
||||
order: 2;
|
||||
margin-left: var(--ck-spacing-large)
|
||||
}
|
||||
|
||||
/* --------- REAL TIME COLLABORATION FEATURES (SHARE TOPBAR CONTAINER) --------------------------------------------- */
|
||||
.collaboration-demo__row {
|
||||
display: flex;
|
||||
position: relative;
|
||||
justify-content: center;
|
||||
overflow-y: auto;
|
||||
background-color: #f2f2f2;
|
||||
border: 1px solid hsl(0, 0%, 77%);
|
||||
}
|
||||
|
||||
body[data-editor='InlineEditor'] .collaboration-demo__row {
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.collaboration-demo__container {
|
||||
max-width: var(--ck-sample-container-width);
|
||||
margin: 0 auto;
|
||||
padding: 1.25rem;
|
||||
}
|
||||
|
||||
.presence, .collaboration-demo__row {
|
||||
transition: .2s opacity;
|
||||
}
|
||||
|
||||
.collaboration-demo__topbar {
|
||||
background: #fff;
|
||||
border: 1px solid var(--ck-color-toolbar-border);
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
border-bottom: 0;
|
||||
border-radius: 4px 4px 0 0;
|
||||
}
|
||||
|
||||
.collaboration-demo__topbar .btn {
|
||||
margin-right: 1em;
|
||||
outline-offset: 2px;
|
||||
outline-width: 2px;
|
||||
background-color: var( --ck-sample-color-blue );
|
||||
}
|
||||
|
||||
.collaboration-demo__topbar .btn:focus,
|
||||
.collaboration-demo__topbar .btn:hover {
|
||||
border-color: var( --ck-sample-color-blue );
|
||||
}
|
||||
|
||||
.collaboration-demo__share {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 1.25rem .75rem
|
||||
}
|
||||
|
||||
.collaboration-demo__share-description p {
|
||||
margin: 0;
|
||||
font-weight: bold;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
|
||||
.collaboration-demo__share input {
|
||||
height: auto;
|
||||
font-size: 0.9em;
|
||||
min-width: 220px;
|
||||
margin: 0 10px;
|
||||
border-radius: 4px;
|
||||
border: 1px solid var(--ck-color-toolbar-border)
|
||||
}
|
||||
|
||||
.collaboration-demo__share button,
|
||||
.collaboration-demo__share input {
|
||||
height: 40px;
|
||||
padding: 5px 10px;
|
||||
}
|
||||
|
||||
.collaboration-demo__share button {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.collaboration-demo__share button:focus {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.collaboration-demo__share button[data-tooltip]::before,
|
||||
.collaboration-demo__share button[data-tooltip]::after {
|
||||
position: absolute;
|
||||
visibility: hidden;
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
transition: all .15s cubic-bezier(.5,1,.25,1);
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.collaboration-demo__share button[data-tooltip]::before {
|
||||
content: attr(data-tooltip);
|
||||
padding: 5px 15px;
|
||||
border-radius: 3px;
|
||||
background: #111;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
font-size: 11px;
|
||||
top: 100%;
|
||||
left: 50%;
|
||||
margin-top: 5px;
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
|
||||
.collaboration-demo__share button[data-tooltip]::after {
|
||||
content: '';
|
||||
border: 5px solid transparent;
|
||||
width: 0;
|
||||
font-size: 0;
|
||||
line-height: 0;
|
||||
top: 100%;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
border-bottom: 5px solid #111;
|
||||
border-top: none;
|
||||
}
|
||||
|
||||
.collaboration-demo__share button[data-tooltip]:hover:before,
|
||||
.collaboration-demo__share button[data-tooltip]:hover:after {
|
||||
visibility: visible;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.collaboration-demo--ready {
|
||||
overflow: visible;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.collaboration-demo--ready .presence,
|
||||
.collaboration-demo--ready .collaboration-demo__row {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
/* --------- PAGINATION FEATURE ------------------------------------------------------------------------------------ */
|
||||
|
||||
/* Pagination view line must be stacked at least at the same level as the editor,
|
||||
otherwise it will be hidden underneath. */
|
||||
.ck.ck-pagination-view-line {
|
||||
z-index: var(--ck-sample-editor-z-index);
|
||||
}
|
||||
|
||||
/* --------- REVISION HISTORY FEATURE ------------------------------------------------------------------------------ */
|
||||
|
||||
.revision-viewer-container {
|
||||
display: none;
|
||||
max-width: 100%;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
.revision-viewer-sidebar {
|
||||
position: relative;
|
||||
min-width: 310px;
|
||||
overflow: hidden;
|
||||
background: var(--ck-color-toolbar-background);
|
||||
border: 1px solid var(--ck-color-toolbar-border);
|
||||
margin-left: -1px;
|
||||
}
|
||||
|
||||
/* A case when Pagination and Revision History features are enabled in the editor. */
|
||||
/* Move the square with page number from the Pagination plugin to the left side, so that it does not cover the RH sidebar. */
|
||||
body[data-revision-history='true'] .ck.ck-pagination-view-line::after {
|
||||
transform: translateX(-100%) !important;
|
||||
left: -1px !important;
|
||||
right: unset !important;
|
||||
}
|
||||
|
||||
/* --------- DOCUMENT OUTLINE FEATURE ------------------------------------------------------------------------------ */
|
||||
|
||||
.document-outline-container {
|
||||
max-height: 80vh;
|
||||
overflow-y: auto;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
|
||||
.document-outline-container .ck.ck-document-outline {
|
||||
min-height: 100%;
|
||||
border: 1px solid var(--ck-color-base-border);
|
||||
background-color: hsl(0, 0%, 96%);
|
||||
}
|
||||
|
||||
/* --------- SAMPLE GENERIC STYLES (not related to CKEditor) ------------------------------------------------------- */
|
||||
body, html {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
|
||||
font-family: sans-serif, Arial, Verdana, "Trebuchet MS", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
|
||||
font-size: 16px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
body {
|
||||
height: 100%;
|
||||
color: #2D3A4A;
|
||||
}
|
||||
|
||||
body * {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #38A5EE;
|
||||
}
|
||||
|
||||
header .centered {
|
||||
display: flex;
|
||||
flex-flow: row nowrap;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
min-height: 8em;
|
||||
}
|
||||
|
||||
header h1 a {
|
||||
font-size: 20px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
color: #2D3A4A;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
header h1 img {
|
||||
display: block;
|
||||
height: 64px;
|
||||
}
|
||||
|
||||
header nav ul {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style-type: none;
|
||||
}
|
||||
|
||||
header nav ul li {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
header nav ul li + li {
|
||||
margin-left: 1em;
|
||||
}
|
||||
|
||||
header nav ul li a {
|
||||
font-weight: bold;
|
||||
text-decoration: none;
|
||||
color: #2D3A4A;
|
||||
}
|
||||
|
||||
header nav ul li a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
main .message {
|
||||
padding: 0 0 var(--ck-sample-base-spacing);
|
||||
background: var(--ck-sample-color-green);
|
||||
color: var(--ck-sample-color-white);
|
||||
}
|
||||
|
||||
main .message::after {
|
||||
content: "";
|
||||
z-index: -1;
|
||||
display: block;
|
||||
height: 10em;
|
||||
width: 100%;
|
||||
background: var(--ck-sample-color-green);
|
||||
position: absolute;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
main .message h2 {
|
||||
position: relative;
|
||||
padding-top: 1em;
|
||||
font-size: 2em;
|
||||
}
|
||||
|
||||
.centered {
|
||||
max-width: var(--ck-sample-container-width);
|
||||
margin: 0 auto;
|
||||
padding: 0 var(--ck-sample-base-spacing);
|
||||
}
|
||||
|
||||
.row {
|
||||
display: flex;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.btn {
|
||||
cursor: pointer;
|
||||
padding: 8px 16px;
|
||||
font-size: 1rem;
|
||||
user-select: none;
|
||||
border-radius: 4px;
|
||||
transition: color .2s ease-in-out,background-color .2s ease-in-out,border-color .2s ease-in-out,opacity .2s ease-in-out;
|
||||
background-color: var(--ck-sample-color-button-blue);
|
||||
border-color: var(--ck-sample-color-button-blue);
|
||||
color: var(--ck-sample-color-white);
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.btn--tiny {
|
||||
padding: 6px 12px;
|
||||
font-size: .8rem;
|
||||
}
|
||||
|
||||
footer {
|
||||
margin: calc(2*var(--ck-sample-base-spacing)) var(--ck-sample-base-spacing);
|
||||
font-size: .8em;
|
||||
text-align: center;
|
||||
color: rgba(0,0,0,.4);
|
||||
}
|
||||
|
||||
/* --------- RWD --------------------------------------------------------------------------------------------------- */
|
||||
@media screen and ( max-width: 800px ) {
|
||||
:root {
|
||||
--ck-sample-base-spacing: 1em;
|
||||
}
|
||||
|
||||
header h1 {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
header h1 img {
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
header nav ul {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
main .message h2 {
|
||||
font-size: 1.5em;
|
||||
}
|
||||
}
|
||||
114
js/ckeditor/src/ckeditor.js
vendored
114
js/ckeditor/src/ckeditor.js
vendored
@@ -1,114 +0,0 @@
|
||||
/**
|
||||
* @license Copyright (c) 2014-2022, CKSource Holding sp. z o.o. All rights reserved.
|
||||
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
||||
*/
|
||||
import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor.js';
|
||||
import Autoformat from '@ckeditor/ckeditor5-autoformat/src/autoformat.js';
|
||||
import BlockQuote from '@ckeditor/ckeditor5-block-quote/src/blockquote.js';
|
||||
import Bold from '@ckeditor/ckeditor5-basic-styles/src/bold.js';
|
||||
import CKFinder from '@ckeditor/ckeditor5-ckfinder/src/ckfinder.js';
|
||||
import CKFinderUploadAdapter from '@ckeditor/ckeditor5-adapter-ckfinder/src/uploadadapter.js';
|
||||
import CloudServices from '@ckeditor/ckeditor5-cloud-services/src/cloudservices.js';
|
||||
import CodeBlock from '@ckeditor/ckeditor5-code-block/src/codeblock.js';
|
||||
import Essentials from '@ckeditor/ckeditor5-essentials/src/essentials.js';
|
||||
import Heading from '@ckeditor/ckeditor5-heading/src/heading.js';
|
||||
import HorizontalLine from '@ckeditor/ckeditor5-horizontal-line/src/horizontalline.js';
|
||||
import Image from '@ckeditor/ckeditor5-image/src/image.js';
|
||||
import ImageCaption from '@ckeditor/ckeditor5-image/src/imagecaption.js';
|
||||
import ImageStyle from '@ckeditor/ckeditor5-image/src/imagestyle.js';
|
||||
import ImageToolbar from '@ckeditor/ckeditor5-image/src/imagetoolbar.js';
|
||||
import ImageUpload from '@ckeditor/ckeditor5-image/src/imageupload.js';
|
||||
import Indent from '@ckeditor/ckeditor5-indent/src/indent.js';
|
||||
import Italic from '@ckeditor/ckeditor5-basic-styles/src/italic.js';
|
||||
import Link from '@ckeditor/ckeditor5-link/src/link.js';
|
||||
import List from '@ckeditor/ckeditor5-list/src/list.js';
|
||||
import MediaEmbed from '@ckeditor/ckeditor5-media-embed/src/mediaembed.js';
|
||||
import Mention from '@ckeditor/ckeditor5-mention/src/mention.js';
|
||||
import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph.js';
|
||||
import PasteFromOffice from '@ckeditor/ckeditor5-paste-from-office/src/pastefromoffice.js';
|
||||
import Table from '@ckeditor/ckeditor5-table/src/table.js';
|
||||
import TableToolbar from '@ckeditor/ckeditor5-table/src/tabletoolbar.js';
|
||||
import TextTransformation from '@ckeditor/ckeditor5-typing/src/texttransformation.js';
|
||||
import FullScreen from '@pikulinpw/ckeditor5-fullscreen';
|
||||
|
||||
// change scss variables
|
||||
import './console.css';
|
||||
|
||||
class Editor extends ClassicEditor {}
|
||||
|
||||
// Plugins to include in the build.
|
||||
Editor.builtinPlugins = [
|
||||
Autoformat,
|
||||
BlockQuote,
|
||||
Bold,
|
||||
CKFinder,
|
||||
CKFinderUploadAdapter,
|
||||
CloudServices,
|
||||
CodeBlock,
|
||||
Essentials,
|
||||
Heading,
|
||||
HorizontalLine,
|
||||
Image,
|
||||
ImageCaption,
|
||||
ImageStyle,
|
||||
ImageToolbar,
|
||||
ImageUpload,
|
||||
Indent,
|
||||
Italic,
|
||||
Link,
|
||||
List,
|
||||
MediaEmbed,
|
||||
Mention,
|
||||
Paragraph,
|
||||
PasteFromOffice,
|
||||
Table,
|
||||
TableToolbar,
|
||||
TextTransformation
|
||||
];
|
||||
|
||||
// Editor configuration.
|
||||
Editor.defaultConfig = {
|
||||
toolbar: {
|
||||
items: [
|
||||
'redo',
|
||||
'|',
|
||||
'undo',
|
||||
'link',
|
||||
'imageUpload',
|
||||
'|',
|
||||
'bulletedList',
|
||||
'numberedList',
|
||||
'blockQuote',
|
||||
'codeBlock',
|
||||
'insertTable',
|
||||
'mediaEmbed',
|
||||
'-',
|
||||
'heading',
|
||||
'bold',
|
||||
'italic',
|
||||
'|',
|
||||
'outdent',
|
||||
'indent',
|
||||
'horizontalLine'
|
||||
],
|
||||
shouldNotGroupWhenFull: true
|
||||
},
|
||||
language: 'en',
|
||||
image: {
|
||||
toolbar: [
|
||||
'imageTextAlternative',
|
||||
'imageStyle:inline',
|
||||
'imageStyle:block',
|
||||
'imageStyle:side'
|
||||
]
|
||||
},
|
||||
table: {
|
||||
contentToolbar: [
|
||||
'tableColumn',
|
||||
'tableRow',
|
||||
'mergeTableCells'
|
||||
]
|
||||
}
|
||||
};
|
||||
|
||||
export default Editor;
|
||||
@@ -1,350 +0,0 @@
|
||||
/**
|
||||
* @license Copyright (c) 2014-2024, CKSource Holding sp. z o.o. All rights reserved.
|
||||
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
||||
*/
|
||||
|
||||
import { ClassicEditor } from '@ckeditor/ckeditor5-editor-classic';
|
||||
|
||||
import { Alignment } from '@ckeditor/ckeditor5-alignment';
|
||||
import {
|
||||
Bold,
|
||||
Italic,
|
||||
Strikethrough,
|
||||
Subscript,
|
||||
Superscript,
|
||||
Underline
|
||||
} from '@ckeditor/ckeditor5-basic-styles';
|
||||
import { BlockQuote } from '@ckeditor/ckeditor5-block-quote';
|
||||
import { CodeBlock } from '@ckeditor/ckeditor5-code-block';
|
||||
import type { EditorConfig } from '@ckeditor/ckeditor5-core';
|
||||
import { Essentials } from '@ckeditor/ckeditor5-essentials';
|
||||
import { FontBackgroundColor, FontColor, FontFamily, FontSize } from '@ckeditor/ckeditor5-font';
|
||||
import { Heading, Title } from '@ckeditor/ckeditor5-heading';
|
||||
import { Highlight } from '@ckeditor/ckeditor5-highlight';
|
||||
import { HorizontalLine } from '@ckeditor/ckeditor5-horizontal-line';
|
||||
import { GeneralHtmlSupport } from '@ckeditor/ckeditor5-html-support';
|
||||
import {
|
||||
Image,
|
||||
ImageCaption,
|
||||
ImageResize,
|
||||
ImageStyle,
|
||||
ImageToolbar,
|
||||
ImageUpload,
|
||||
PictureEditing
|
||||
} from '@ckeditor/ckeditor5-image';
|
||||
import { Indent, IndentBlock } from '@ckeditor/ckeditor5-indent';
|
||||
import { AutoLink, Link, LinkImage } from '@ckeditor/ckeditor5-link';
|
||||
import { List, ListProperties } from '@ckeditor/ckeditor5-list';
|
||||
import { Mention } from '@ckeditor/ckeditor5-mention';
|
||||
import { Paragraph } from '@ckeditor/ckeditor5-paragraph';
|
||||
import {PasteFromOffice} from "@ckeditor/ckeditor5-paste-from-office";
|
||||
import {
|
||||
Table,
|
||||
TableCaption,
|
||||
TableCellProperties,
|
||||
TableColumnResize,
|
||||
TableProperties,
|
||||
TableToolbar
|
||||
} from '@ckeditor/ckeditor5-table';
|
||||
import { Undo } from '@ckeditor/ckeditor5-undo';
|
||||
import { RemoveFormat } from '@ckeditor/ckeditor5-remove-format';
|
||||
import { SourceEditing } from '@ckeditor/ckeditor5-source-editing';
|
||||
|
||||
// Combodo plugins
|
||||
import AppendITopClasses from "./plugins/append-itop-classes/append-itop-classes.plugin";
|
||||
import KeyboardShortcut from "./plugins/keyboard-shortcut/keyboard-shortcut.plugin";
|
||||
import MentionsMarkup from "./plugins/mentions-markup/mentions-markup.plugin";
|
||||
import TriggerUpdateOnReady from "./plugins/trigger-update-on-ready/trigger-update-on-ready.plugin";
|
||||
import Maximize from './plugins/maximize/maximize.plugin';
|
||||
import ObjectShortcut from './plugins/object-shortcut/object-shortcut.plugin';
|
||||
import DetectChanges from "./plugins/detect-change/detect-change.plugin";
|
||||
import UpdateInputOnChange from "./plugins/update-input-on-change/update-input-on-change.plugin";
|
||||
import Disabler from "./plugins/disabler/disabler.plugin";
|
||||
import InsertHtml from './plugins/insert-html/insert-html.plugin';
|
||||
import InsertCarriageReturnAfterBlock from "./plugins/insert-carriage-return-after-block/insert-carriage-return-after-block.plugin";
|
||||
|
||||
// You can read more about extending the build with additional plugins in the "Installing plugins" guide.
|
||||
// See https://ckeditor.com/docs/ckeditor5/latest/installation/plugins/installing-plugins.html for details.
|
||||
|
||||
// iTop default theme
|
||||
import './resources/styles/default-theme.css';
|
||||
|
||||
const transformationsConfig = {
|
||||
// Remove the 'ellipsis' transformation loaded by the 'typography' group.
|
||||
remove: [ 'ellipsis' ]
|
||||
}
|
||||
|
||||
// Colors to be used in the different palettes (font color, table cell background color, table cell border color, ...)
|
||||
const colorsPalette = [
|
||||
{
|
||||
color: '#000000',
|
||||
label: 'Black'
|
||||
},
|
||||
{
|
||||
color: '#4D4D4D',
|
||||
label: 'Dim grey'
|
||||
},
|
||||
{
|
||||
color: '#999999',
|
||||
label: 'Grey'
|
||||
},
|
||||
{
|
||||
color: '#E6E6E6',
|
||||
label: 'Light grey'
|
||||
},
|
||||
{
|
||||
color: '#FFFFFF',
|
||||
label: 'White'
|
||||
},
|
||||
{
|
||||
color: '#E64D4D',
|
||||
label: 'Red'
|
||||
},
|
||||
{
|
||||
color: '#E6994D',
|
||||
label: 'Orange'
|
||||
},
|
||||
{
|
||||
color: '#E6E64D',
|
||||
label: 'Yellow'
|
||||
},
|
||||
{
|
||||
color: '#99E64D',
|
||||
label: 'Light green'
|
||||
},
|
||||
{
|
||||
color: '#4DE64D',
|
||||
label: 'Green'
|
||||
},
|
||||
{
|
||||
color: '#4DE699',
|
||||
label: 'Aquamarine'
|
||||
},
|
||||
{
|
||||
color: '#4DE6E6',
|
||||
label: 'Turquoise'
|
||||
},
|
||||
{
|
||||
color: '#4D99E6',
|
||||
label: 'Light blue'
|
||||
},
|
||||
{
|
||||
color: '#4D4DE6',
|
||||
label: 'Blue'
|
||||
},
|
||||
{
|
||||
color: '#994DE6',
|
||||
label: 'Purple'
|
||||
},
|
||||
];
|
||||
|
||||
class Editor extends ClassicEditor {
|
||||
public static override builtinPlugins = [
|
||||
Alignment,
|
||||
AutoLink,
|
||||
BlockQuote,
|
||||
Bold,
|
||||
CodeBlock,
|
||||
Essentials,
|
||||
FontBackgroundColor,
|
||||
FontColor,
|
||||
FontFamily,
|
||||
FontSize,
|
||||
GeneralHtmlSupport,
|
||||
Heading,
|
||||
Highlight,
|
||||
HorizontalLine,
|
||||
Image,
|
||||
ImageCaption,
|
||||
ImageResize,
|
||||
ImageStyle,
|
||||
ImageToolbar,
|
||||
ImageUpload,
|
||||
Indent,
|
||||
IndentBlock,
|
||||
Italic,
|
||||
Link,
|
||||
List,
|
||||
Mention,
|
||||
Paragraph,
|
||||
PasteFromOffice,
|
||||
Strikethrough,
|
||||
Table,
|
||||
TableCaption,
|
||||
TableCellProperties,
|
||||
TableColumnResize,
|
||||
TableProperties,
|
||||
TableToolbar,
|
||||
Underline,
|
||||
Undo,
|
||||
RemoveFormat,
|
||||
SourceEditing,
|
||||
|
||||
// combodo plugins
|
||||
AppendITopClasses,
|
||||
KeyboardShortcut,
|
||||
MentionsMarkup,
|
||||
TriggerUpdateOnReady,
|
||||
Maximize,
|
||||
// ObjectShortcut, // wait a clean implementation before adding it (mentions plugin allow this feature)
|
||||
InsertHtml,
|
||||
DetectChanges,
|
||||
UpdateInputOnChange,
|
||||
Disabler,
|
||||
InsertCarriageReturnAfterBlock
|
||||
];
|
||||
|
||||
// default configuration editor
|
||||
public static override defaultConfig: EditorConfig = {
|
||||
toolbar: {
|
||||
items: [
|
||||
'maximize',
|
||||
'|',
|
||||
'undo',
|
||||
'redo',
|
||||
'|',
|
||||
'heading',
|
||||
'|',
|
||||
'alignment',
|
||||
'|',
|
||||
{
|
||||
label: 'Fonts',
|
||||
icon: 'text',
|
||||
items: ['fontfamily', 'fontSize', 'fontColor']
|
||||
},
|
||||
'|',
|
||||
'bold',
|
||||
'italic',
|
||||
'underline',
|
||||
'highlight' ,
|
||||
{
|
||||
label: 'More styles',
|
||||
items: ['strikethrough', 'RemoveFormat']
|
||||
},
|
||||
'|',
|
||||
'horizontalLine',
|
||||
'link',
|
||||
'imageUpload',
|
||||
'codeBlock',
|
||||
'bulletedList',
|
||||
'numberedList',
|
||||
'insertTable',
|
||||
'|',
|
||||
'SourceEditing',
|
||||
],
|
||||
shouldNotGroupWhenFull: true
|
||||
},
|
||||
language: 'en',
|
||||
fontColor: {
|
||||
// Colors are redefined to be in HEX instead of RGB in order to be supported by mail clients
|
||||
colors: colorsPalette,
|
||||
},
|
||||
image: {
|
||||
toolbar: [
|
||||
'resizeImage:25',
|
||||
'resizeImage:50',
|
||||
'resizeImage:original',
|
||||
'|',
|
||||
'toggleImageCaption',
|
||||
],
|
||||
resizeOptions: [
|
||||
{
|
||||
name: 'resizeImage:original',
|
||||
value: null,
|
||||
icon: 'original'
|
||||
},
|
||||
{
|
||||
name: 'resizeImage:25',
|
||||
value: '25',
|
||||
icon: 'small'
|
||||
},
|
||||
{
|
||||
name: 'resizeImage:50',
|
||||
value: '50',
|
||||
icon: 'medium'
|
||||
},
|
||||
],
|
||||
},
|
||||
table: {
|
||||
contentToolbar: [
|
||||
'tableColumn',
|
||||
'tableRow',
|
||||
'mergeTableCells',
|
||||
'|',
|
||||
'tableCellProperties',
|
||||
'tableProperties',
|
||||
'|',
|
||||
'toggleTableCaption'
|
||||
],
|
||||
tableCellProperties: {
|
||||
borderColors: colorsPalette,
|
||||
backgroundColors: colorsPalette,
|
||||
},
|
||||
},
|
||||
htmlSupport: {
|
||||
allow: [
|
||||
{
|
||||
name: /.*/,
|
||||
attributes: true,
|
||||
classes: true,
|
||||
styles: true
|
||||
}
|
||||
]
|
||||
},
|
||||
link: {
|
||||
defaultProtocol: 'http://'
|
||||
},
|
||||
highlight: {
|
||||
options: [
|
||||
{ model: 'yellowMarker', class: 'marker-yellow', title: 'Yellow marker', color: '#FDFD77', type: 'marker' },
|
||||
{ model: 'greenMarker', class: 'marker-green', title: 'Green marker', color: '#62f962', type: 'marker' },
|
||||
{ model: 'pinkMarker', class: 'marker-pink', title: 'Pink marker', color: '#FC7899', type: 'marker' },
|
||||
{ model: 'blueMarker', class: 'marker-blue', title: 'Blue marker', color: '#72CCFD', type: 'marker' },
|
||||
]
|
||||
},
|
||||
codeBlock: {
|
||||
// Languages defined here are only the values of the dropdown list
|
||||
// It needs to be aligned with languages imports for highlight.js in the code-blocks-highlight-js.plugin.ts
|
||||
languages: [
|
||||
{language: 'plaintext', label: 'Plain text'}, // Default
|
||||
{language: 'abap', label: 'ABAP'},
|
||||
{language: 'apache', label: 'Apache'},
|
||||
{language: 'bash', label: 'Bash'},
|
||||
{language: 'cs', label: 'C#'},
|
||||
{language: 'cpp', label: 'C++'},
|
||||
{language: 'css', label: 'CSS'},
|
||||
{language: 'ciscocli', label: 'Cisco CLI'},
|
||||
{language: 'coffeescript', label: 'CoffeeScript'},
|
||||
{language: 'curl', label: 'cURL'},
|
||||
{language: 'diff', label: 'Diff'},
|
||||
{language: 'dnszonefile', label: 'DNS Zone File'},
|
||||
{language: 'html', label: 'HTML'},
|
||||
{language: 'http', label: 'HTTP'},
|
||||
{language: 'ini', label: 'Ini'},
|
||||
{language: 'json', label: 'JSON'},
|
||||
{language: 'java', label: 'Java'},
|
||||
{language: 'javascript', label: 'JavaScript'},
|
||||
{language: 'makefile', label: 'Makefile'},
|
||||
{language: 'markdown', label: 'Markdown'},
|
||||
{language: 'nginx', label: 'Nginx'},
|
||||
{language: 'objectivec', label: 'Objective C'},
|
||||
{language: 'php', label: 'PHP'},
|
||||
{language: 'perl', label: 'Perl'},
|
||||
{language: 'python', label: 'Python'},
|
||||
{language: 'ruby', label: 'Ruby'},
|
||||
{language: 'rust', label: 'Rust'},
|
||||
{language: 'scss', label: 'SCSS'},
|
||||
{language: 'sql', label: 'SQL'},
|
||||
{language: 'toml', label: 'TOML'},
|
||||
{language: 'twig', label: 'TWIG'},
|
||||
{language: 'typescript', label: 'TypeScript'},
|
||||
{language: 'vba', label: 'VBA'},
|
||||
{language: 'vbscript', label: 'VBScript'},
|
||||
{language: 'xml', label: 'XML'},
|
||||
{language: 'yaml', label: 'YAML'}
|
||||
]
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export default Editor;
|
||||
@@ -1,34 +0,0 @@
|
||||
import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
|
||||
|
||||
/**
|
||||
* AppendITopClasses Plugin.
|
||||
*
|
||||
* Appends ibo-is-html-content (backoffice) & ipb-is-html-content (portal) classes
|
||||
*/
|
||||
export default class AppendITopClasses extends Plugin {
|
||||
|
||||
static get pluginName() {
|
||||
return 'AppendITopClasses';
|
||||
}
|
||||
|
||||
init() {
|
||||
|
||||
// retrieve editor instance
|
||||
const oEditor = this.editor;
|
||||
|
||||
// appends ibo-is-html-content (backoffice) & ipb-is-html-content (portal) classes
|
||||
oEditor.editing.view.change( oWriter => {
|
||||
const oRootElement = oEditor.editing.view.document.getRoot();
|
||||
if(oRootElement !== null){
|
||||
// Add the proper class depending on the GUI we are in
|
||||
const sGUIType = document.body.getAttribute('data-gui-type');
|
||||
if (sGUIType === 'backoffice') {
|
||||
oWriter.addClass( 'ibo-is-html-content', oRootElement);
|
||||
} else if (sGUIType === 'portal') {
|
||||
oWriter.addClass('ipb-is-html-content', oRootElement);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
import { Plugin, type Editor } from 'ckeditor5/src/core.js';
|
||||
import iTopDataProcessor from "./itop-data-processor";
|
||||
import InsertCarriageReturnAfterBlock from "../insert-carriage-return-after-block/insert-carriage-return-after-block.plugin";
|
||||
|
||||
/**
|
||||
* DetectChanges Plugin.
|
||||
*
|
||||
*/
|
||||
export default class DetectChanges extends Plugin {
|
||||
private readonly _processor: iTopDataProcessor | undefined;
|
||||
|
||||
constructor( editor: Editor ) {
|
||||
super( editor );
|
||||
const sInitialValue:string = editor.config.get('detectChanges.initialValue') as string;
|
||||
// If the initial value is not set or empty, we don't need to do anything
|
||||
if( !sInitialValue || sInitialValue === '') {
|
||||
return;
|
||||
}
|
||||
// Initialize our own data processor
|
||||
const oProcessor = new iTopDataProcessor( editor.data.viewDocument, sInitialValue, editor.getData() ) as iTopDataProcessor;
|
||||
editor.data.processor = oProcessor;
|
||||
this._processor = oProcessor;
|
||||
}
|
||||
|
||||
init() {
|
||||
const editor = this.editor;// Listen for the dataReady event only once
|
||||
editor.model.document.once('change:data', () => {
|
||||
if(this._processor ) {
|
||||
this._processor.setTransformedInitialValue(editor.getData());
|
||||
}
|
||||
});
|
||||
}
|
||||
static get pluginName() {
|
||||
return 'DetectChanges';
|
||||
}
|
||||
|
||||
// Needed as InsertCarriageReturnAfterBlock will possibly change data on initialization if there's a block in the content, so we need to make sure it's loaded first
|
||||
static get requires() {
|
||||
return [ InsertCarriageReturnAfterBlock ];
|
||||
}
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
import {HtmlDataProcessor,
|
||||
type ViewDocument,
|
||||
type ViewDocumentFragment
|
||||
} from 'ckeditor5/src/engine.js';
|
||||
|
||||
export default class iTopDataProcessor extends HtmlDataProcessor {
|
||||
/**
|
||||
* HTML data processor used to process HTML if we detect changes
|
||||
* @private
|
||||
*/
|
||||
private _htmlDP: HtmlDataProcessor;
|
||||
/**
|
||||
* Initial value of the editor, we'll return it if we don't detect any changes
|
||||
* @private
|
||||
*/
|
||||
private readonly _initialValue: string;
|
||||
/**
|
||||
* Transformed initial value of the editor, we'll use it to detect changes
|
||||
* @private
|
||||
*/
|
||||
private _transformedInitialValue: string;
|
||||
/**
|
||||
* Creates a new instance of the Markdown data processor class.
|
||||
*/
|
||||
constructor( document: ViewDocument, initialValue: string, transformedInitialValue: string) {
|
||||
super( document );
|
||||
this._htmlDP = new HtmlDataProcessor( document );
|
||||
this._initialValue = initialValue;
|
||||
// It'll probably be empty on the first call, we'll set it later
|
||||
this._transformedInitialValue = transformedInitialValue;
|
||||
}
|
||||
|
||||
setTransformedInitialValue( transformedInitialValue: string ) {
|
||||
this._transformedInitialValue = transformedInitialValue;
|
||||
}
|
||||
|
||||
override toData( viewFragment: ViewDocumentFragment ): string {
|
||||
const html = this._htmlDP.toData( viewFragment );
|
||||
if( html === this._transformedInitialValue ) {
|
||||
return this._initialValue;
|
||||
}
|
||||
return html;
|
||||
}
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
import { Plugin } from '@ckeditor/ckeditor5-core';
|
||||
import {ClassicEditor} from "@ckeditor/ckeditor5-editor-classic";
|
||||
|
||||
export default class Disabler extends Plugin {
|
||||
|
||||
static get pluginName() {
|
||||
return 'Disabler';
|
||||
}
|
||||
|
||||
init() {
|
||||
|
||||
// retrieve editor instance
|
||||
const oEditor:ClassicEditor = this.editor as ClassicEditor;
|
||||
|
||||
// perform disabling when editor ui is ready
|
||||
oEditor.ui.on('ready', () => {
|
||||
Disabler.processDisabling(oEditor, oInputElement);
|
||||
});
|
||||
|
||||
// perform disabling when input is updated
|
||||
const oInputElement = oEditor.sourceElement as HTMLInputElement;
|
||||
// @ts-ignore
|
||||
$('#' + oInputElement.id).on('update', function(){
|
||||
Disabler.processDisabling(oEditor, oInputElement);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Process ckeditor disabling.
|
||||
*
|
||||
* @param oEditor
|
||||
* @param oInputElement
|
||||
*/
|
||||
static processDisabling(oEditor:ClassicEditor, oInputElement:HTMLInputElement){
|
||||
|
||||
// @ts-ignore
|
||||
const oElement = $(oEditor.ui.element);
|
||||
if(typeof oElement.block === 'function') {
|
||||
if (oInputElement.disabled) {
|
||||
oElement.block({message: '', blockMsgClass: '', enableValidation : true, baseZ: 9999, overlayCSS: { backgroundColor: '#ccd6e066'}});
|
||||
} else {
|
||||
oElement.unblock();
|
||||
}
|
||||
}
|
||||
|
||||
// handle ckeditor read only mode
|
||||
if(oInputElement.disabled){
|
||||
oEditor.enableReadOnlyMode('ibo');
|
||||
}
|
||||
else{
|
||||
oEditor.disableReadOnlyMode('ibo');
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
|
||||
import Node from '@ckeditor/ckeditor5-engine/src/model/node';
|
||||
|
||||
export default class InsertCarriageReturnAfterBlock extends Plugin {
|
||||
init() {
|
||||
const editor = this.editor;
|
||||
|
||||
// Array of block elements type to check for
|
||||
const blockElements = ['codeBlock', 'div', 'pre'];
|
||||
|
||||
// This function checks if the inserted element is one of the block elements we want a newline after
|
||||
const isBlockElement = (node: Node | null) => {
|
||||
return node ? blockElements.some(element => node.is('element', element)) : false;
|
||||
};
|
||||
|
||||
// Listen to changes in the model
|
||||
editor.model.document.on('change:data', (evt, batch) => {
|
||||
if (batch.isLocal) {
|
||||
const changes = Array.from(editor.model.document.differ.getChanges());
|
||||
const currentCursorPosition = editor.model.document.selection.getFirstPosition();
|
||||
|
||||
// Iterate over the changes and insert a newline after the block element when needed
|
||||
changes.forEach(change => {
|
||||
if (change.type === 'insert' && isBlockElement(change.position.nodeAfter)) {
|
||||
editor.model.change(writer => {
|
||||
const position = change.position.getShiftedBy(change.length);
|
||||
// Insert a newline after the block element
|
||||
editor.execute( 'insertParagraph', {
|
||||
position: position,
|
||||
} );
|
||||
});
|
||||
}
|
||||
});
|
||||
// Restore the cursor position (most likely in the created block)
|
||||
editor.model.change(writer => {
|
||||
writer.setSelection(currentCursorPosition);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
|
||||
import InsertHtmlCommand from "./insert-html.command";
|
||||
|
||||
/**
|
||||
* InsertHtml Plugin.
|
||||
*
|
||||
*/
|
||||
export default class InsertHtml extends Plugin {
|
||||
|
||||
static get pluginName() {
|
||||
return 'InsertHtmlContent';
|
||||
}
|
||||
|
||||
init() {
|
||||
|
||||
// retrieve editor instance
|
||||
const oEditor = this.editor;
|
||||
|
||||
// appends ibo-is-html-content class
|
||||
oEditor.commands.add( 'insert-html', new InsertHtmlCommand(oEditor) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
|
||||
|
||||
/**
|
||||
* KeyboardShortcut Plugin.
|
||||
*
|
||||
* - Dispatch submit event on the closest editor form when Ctrl+Enter pressed
|
||||
*/
|
||||
export default class KeyboardShortcut extends Plugin {
|
||||
|
||||
static get pluginName() {
|
||||
return 'KeyboardShortcut';
|
||||
}
|
||||
|
||||
init() {
|
||||
|
||||
// retrieve editor instance
|
||||
const oEditor = this.editor;
|
||||
|
||||
// Dispatch submit event on the closest editor form when Ctrl+Enter pressed
|
||||
oEditor.keystrokes.set('Ctrl+Enter', (data, stop) => {
|
||||
if (oEditor.ui.element !== null) {
|
||||
const oForm = oEditor.ui.element.closest('form');
|
||||
if (oForm !== null) {
|
||||
const oEvent = new Event("submit");
|
||||
oForm.dispatchEvent(oEvent);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -1,110 +0,0 @@
|
||||
import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
|
||||
import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview';
|
||||
|
||||
// plugin icons
|
||||
const sMaximizeIconSVG = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M448 344v112a23.9 23.9 0 0 1 -24 24H312c-21.4' +
|
||||
' 0-32.1-25.9-17-41l36.2-36.2L224 295.6 116.8 402.9 153 439c15.1 15.1 4.4 41-17 41H24a23.9 23.9 0 0 1 -24-24V344c0-21.4 25.9-32.1 41-17l36.2 36.2L184.5 256 77.2 148.7 41 185c-15.1 15.1-41 4.4-41-17V56a23.9 23.9 0 0 1 24-24h112c21.4 0 32.1 25.9 17 41l-36.2 36.2L224 216.4l107.2-107.3L295 73c-15.1-15.1-4.4-41 17-41h112a23.9 23.9 0 0 1 24 24v112c0 21.4-25.9 32.1-41 17l-36.2-36.2L263.5 256l107.3 107.3L407 327.1c15.1-15.2 41-4.5 41 16.9z"/></svg>';
|
||||
const sMinimizeIconSVG = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M200 288H88c-21.4 0-32.1 25.8-17 41l32.9 31-99.2' +
|
||||
' 99.3c-6.2 6.2-6.2 16.4 0 22.6l25.4 25.4c6.2 6.2 16.4 6.2 22.6 0L152 408l31.1 33c15.1 15.1 40.9 4.4 40.9-17V312c0-13.3-10.7-24-24-24zm112-64h112c21.4 0 32.1-25.9 17-41l-33-31 99.3-99.3c6.2-6.2 6.2-16.4 0-22.6L481.9 4.7c-6.2-6.2-16.4-6.2-22.6 0L360 104l-31.1-33C313.8 55.9 288 66.6 288 88v112c0 13.3 10.7 24 24 24zm96 136l33-31.1c15.1-15.1 4.4-40.9-17-40.9H312c-13.3 0-24 10.7-24 24v112c0 21.4 25.9 32.1 41 17l31-32.9 99.3 99.3c6.2 6.2 16.4 6.2 22.6 0l25.4-25.4c6.2-6.2 6.2-16.4 0-22.6L408 360zM183 71.1L152 104 52.7 4.7c-6.2-6.2-16.4-6.2-22.6 0L4.7 30.1c-6.2 6.2-6.2 16.4 0 22.6L104 152l-33 31.1C55.9 198.2 66.6 224 88 224h112c13.3 0 24-10.7 24-24V88c0-21.3-25.9-32-41-16.9z"/></svg>';
|
||||
|
||||
export default class Maximize extends Plugin {
|
||||
|
||||
static get pluginName() {
|
||||
return 'Maximize';
|
||||
}
|
||||
|
||||
init() {
|
||||
|
||||
// retrieve editor instance
|
||||
const oEditor = this.editor;
|
||||
|
||||
// add maximize button
|
||||
oEditor.ui.componentFactory.add('maximize', () => {
|
||||
|
||||
// button
|
||||
const oButton = new ButtonView();
|
||||
oButton.set({
|
||||
icon: sMaximizeIconSVG,
|
||||
isToggleable: true
|
||||
});
|
||||
|
||||
this.listenTo(oButton, 'execute', () => {
|
||||
if (oEditor.ui.element !== null) {
|
||||
if (oButton.isOn) {
|
||||
// remove classes
|
||||
document.documentElement.classList.remove('ck-maximize_html_editor')
|
||||
document.body.classList.remove('ck-maximize_body_editor')
|
||||
let oParentElement: HTMLElement = oEditor.ui.element;
|
||||
while (oParentElement.parentElement !== null) {
|
||||
oParentElement = oParentElement.parentElement;
|
||||
oParentElement.classList.remove('ck-maximize_parent_editor');
|
||||
}
|
||||
oEditor.ui.element.classList.remove('ck-maximize_editor');
|
||||
oEditor.ui.element.children[2].classList.remove('ck-maximize_editor_main');
|
||||
oButton.icon = sMaximizeIconSVG;
|
||||
} else {
|
||||
// add classes to make editor full screen
|
||||
document.documentElement.classList.add('ck-maximize_html_editor')
|
||||
document.body.classList.add('ck-maximize_body_editor')
|
||||
let oParentElement: HTMLElement = oEditor.ui.element;
|
||||
while (oParentElement.parentElement !== null) {
|
||||
oParentElement = oParentElement.parentElement;
|
||||
oParentElement.classList.add('ck-maximize_parent_editor');
|
||||
}
|
||||
oEditor.ui.element.classList.add('ck-maximize_editor');
|
||||
oEditor.ui.element.children[2].classList.add('ck-maximize_editor_main');
|
||||
let oStyle = document.createElement('style');
|
||||
// CSS rules definitions for each classes
|
||||
oStyle.innerHTML = `
|
||||
.ck-maximize_editor_main > * {
|
||||
height: 100% !important;
|
||||
width: 100% !important;
|
||||
}
|
||||
.ck-maximize_editor_main {
|
||||
flex-grow: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.ck-maximize_parent_editor {
|
||||
position: fixed !important;
|
||||
overflow: visible !important;
|
||||
z-index: 1050 !important;
|
||||
margin: 0 !important;
|
||||
}
|
||||
.ck-maximize_body_editor {
|
||||
width: 0 !important;
|
||||
height: 0 !important;
|
||||
overflow: hidden !important;
|
||||
}
|
||||
.ck-maximize_html_editor {
|
||||
position: fixed !important;
|
||||
width: 0 !important;
|
||||
height: 0 !important;
|
||||
}
|
||||
.ck-maximize_editor {
|
||||
position: fixed !important;
|
||||
top: 0 !important;
|
||||
left: 0 !important;
|
||||
margin: 0 !important;
|
||||
padding: 0 !important;
|
||||
width: 100vw !important;
|
||||
height: 100vh !important;
|
||||
overflow: auto !important;
|
||||
z-index: 1050 !important;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}`;
|
||||
|
||||
document.head.appendChild(oStyle);
|
||||
oButton.icon = sMinimizeIconSVG;
|
||||
}
|
||||
// setfocus on editor (else focus remains on the button)
|
||||
oEditor.editing.view.focus()
|
||||
|
||||
oButton.isOn = !oButton.isOn;
|
||||
}
|
||||
});
|
||||
return oButton;
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
|
||||
import {Element} from "@ckeditor/ckeditor5-engine";
|
||||
|
||||
/**
|
||||
* MentionsMarkup Plugin.
|
||||
*
|
||||
* - Converter for mentions
|
||||
*/
|
||||
export default class MentionsMarkup extends Plugin {
|
||||
|
||||
static get pluginName() {
|
||||
return 'MentionsMarkup';
|
||||
}
|
||||
|
||||
init() {
|
||||
|
||||
// retrieve editor instance
|
||||
const oEditor = this.editor;
|
||||
|
||||
// convert view > model
|
||||
oEditor.conversion.for('upcast').elementToAttribute({
|
||||
view: {
|
||||
name: 'a',
|
||||
attributes: {
|
||||
href: true,
|
||||
'data-role': true,
|
||||
'data-object-class': true,
|
||||
'data-object-id': true
|
||||
}
|
||||
},
|
||||
model: {
|
||||
key: 'mention',
|
||||
value: (oViewItem: Element) => {
|
||||
return oEditor.plugins.get( 'Mention' ).toMentionAttribute( oViewItem, {
|
||||
link: oViewItem.getAttribute( 'href' ),
|
||||
id: oViewItem.getAttribute( 'data-object-id' ),
|
||||
class_name: oViewItem.getAttribute( 'data-object-class' ),
|
||||
mention: 'object-mention',
|
||||
} );
|
||||
}
|
||||
},
|
||||
converterPriority: 'high'
|
||||
} );
|
||||
|
||||
// convert model > view
|
||||
oEditor.conversion.for( 'downcast' ).attributeToElement( {
|
||||
model: 'mention',
|
||||
view: ( oModelAttributeValue, { writer } ) => {
|
||||
|
||||
// Do not convert empty attributes (lack of value means no mention).
|
||||
if ( !oModelAttributeValue ) {
|
||||
return;
|
||||
}
|
||||
|
||||
return writer.createAttributeElement( 'a', {
|
||||
'data-role' : 'object-mention',
|
||||
'data-object-class' : oModelAttributeValue.class_name,
|
||||
'data-object-id' : oModelAttributeValue.id,
|
||||
'href': oModelAttributeValue.link
|
||||
}, {
|
||||
priority: 20,
|
||||
id: oModelAttributeValue.uid
|
||||
} );
|
||||
},
|
||||
converterPriority: 'high'
|
||||
} );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,92 +0,0 @@
|
||||
/**
|
||||
* @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
|
||||
* For licensing, see LICENSE.md.
|
||||
*/
|
||||
|
||||
import {
|
||||
View,
|
||||
LabeledFieldView,
|
||||
createLabeledInputText,
|
||||
ButtonView,
|
||||
submitHandler,
|
||||
} from '@ckeditor/ckeditor5-ui';
|
||||
import { icons } from '@ckeditor/ckeditor5-core';
|
||||
import{ Locale } from '@ckeditor/ckeditor5-utils';
|
||||
|
||||
export default class FormView extends View {
|
||||
|
||||
// input fields
|
||||
oLabelInputView: LabeledFieldView;
|
||||
oClassInputView: LabeledFieldView;
|
||||
oReferenceInputView: LabeledFieldView;
|
||||
|
||||
// buttons
|
||||
oSaveButtonView: ButtonView;
|
||||
oCancelButtonView: ButtonView;
|
||||
|
||||
// child views
|
||||
oChildViews: any;
|
||||
|
||||
constructor( oLocale: Locale ) {
|
||||
super( oLocale );
|
||||
|
||||
// save button
|
||||
this.oSaveButtonView = this._createButton( 'Save', icons.check, 'ck-button-save' );
|
||||
this.oSaveButtonView.type = 'submit';
|
||||
|
||||
// cancel button
|
||||
this.oCancelButtonView = this._createButton( 'Cancel', icons.cancel, 'ck-button-cancel' );
|
||||
this.oCancelButtonView.delegate( 'execute' ).to( this, 'cancel' );
|
||||
|
||||
// create input fields
|
||||
this.oLabelInputView = this._createInput( 'Label' );
|
||||
this.oClassInputView = this._createInput( 'Object Class' );
|
||||
this.oReferenceInputView = this._createInput( 'Object Reference' );
|
||||
this.oChildViews = this.createCollection( [
|
||||
this.oLabelInputView,
|
||||
this.oClassInputView,
|
||||
this.oReferenceInputView,
|
||||
this.oSaveButtonView,
|
||||
this.oCancelButtonView
|
||||
] );
|
||||
|
||||
this.setTemplate( {
|
||||
tag: 'form',
|
||||
attributes: {
|
||||
class: [ 'ck', 'ck-object-shortcut-form' ],
|
||||
tabindex: '-1'
|
||||
},
|
||||
children: this.oChildViews
|
||||
} );
|
||||
}
|
||||
|
||||
override render() {
|
||||
super.render();
|
||||
|
||||
// Submit the form when the user clicked the save button or pressed enter in the input.
|
||||
submitHandler( {
|
||||
view: this
|
||||
} );
|
||||
}
|
||||
|
||||
focus() {
|
||||
this.oChildViews.first.focus();
|
||||
}
|
||||
|
||||
_createInput( sLabel: string ) {
|
||||
const oLabeledInput = new LabeledFieldView( this.locale, createLabeledInputText );
|
||||
oLabeledInput.label = sLabel;
|
||||
return oLabeledInput;
|
||||
}
|
||||
|
||||
_createButton( sLabel: string, sIcon: string, sClassName: string ) {
|
||||
const oButton = new ButtonView();
|
||||
oButton.set( {
|
||||
label: sLabel,
|
||||
icon: sIcon,
|
||||
tooltip: true,
|
||||
class: sClassName
|
||||
} );
|
||||
return oButton;
|
||||
}
|
||||
}
|
||||
@@ -1,144 +0,0 @@
|
||||
import { Plugin } from '@ckeditor/ckeditor5-core';
|
||||
import {ButtonView, ContextualBalloon, clickOutsideHandler} from '@ckeditor/ckeditor5-ui';
|
||||
import FormView from './object-shortcut.form-view';
|
||||
import './styles.css';
|
||||
|
||||
// plugin icon
|
||||
const sPluginIconSVG = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48' +
|
||||
' 48' +
|
||||
' 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48zm-32 252c0 6.6-5.4 12-12 12h-92v92c0 6.6-5.4 12-12 12h-56c-6.6 0-12-5.4-12-12v-92H92c-6.6 0-12-5.4-12-12v-56c0-6.6 5.4-12 12-12h92v-92c0-6.6 5.4-12 12-12h56c6.6 0 12 5.4 12 12v92h92c6.6 0 12 5.4 12 12v56z"/></svg>';
|
||||
|
||||
export default class ObjectShortcutUI extends Plugin {
|
||||
static get requires() {
|
||||
return [ ContextualBalloon ];
|
||||
}
|
||||
|
||||
oBalloon: ContextualBalloon | undefined;
|
||||
oFormView: FormView | undefined;
|
||||
|
||||
init() {
|
||||
const editor = this.editor;
|
||||
|
||||
// Create the balloon and the form view.
|
||||
this.oBalloon = this.editor.plugins.get( ContextualBalloon );
|
||||
this.oFormView = this._createFormView();
|
||||
|
||||
editor.ui.componentFactory.add( 'object-shortcut', () => {
|
||||
const oButton = new ButtonView();
|
||||
oButton.label = editor.config.get('objectShortcut.buttonLabel') as string ?? 'Insert Object Shortcut';
|
||||
oButton.tooltip = true;
|
||||
oButton.icon = sPluginIconSVG;
|
||||
|
||||
// Show the UI on button click.
|
||||
this.listenTo( oButton, 'execute', () => {
|
||||
this._showUI();
|
||||
} );
|
||||
|
||||
return oButton;
|
||||
} );
|
||||
}
|
||||
|
||||
_createFormView() {
|
||||
const oEditor = this.editor;
|
||||
const oFormView = new FormView( oEditor.locale );
|
||||
|
||||
// Execute the command after clicking the "Save" button.
|
||||
this.listenTo( oFormView, 'submit', () => {
|
||||
// Grab values from the abbreviation and title input fields.
|
||||
|
||||
let sLabel = '';
|
||||
const oLabelElement = <HTMLInputElement>oFormView.oLabelInputView.fieldView.element;
|
||||
if(oLabelElement !== null) {
|
||||
sLabel = oLabelElement.value;
|
||||
}
|
||||
|
||||
let sObjectClass = 'object class';
|
||||
const oClassElement = <HTMLInputElement>oFormView.oClassInputView.fieldView.element;
|
||||
if(oClassElement !== null) {
|
||||
sObjectClass = oClassElement.value;
|
||||
}
|
||||
|
||||
let sObjectReference = 'object reference';
|
||||
const oReferenceElement = <HTMLInputElement>oFormView.oReferenceInputView.fieldView.element;
|
||||
if(oReferenceElement !== null) {
|
||||
sObjectReference = oReferenceElement.value;
|
||||
}
|
||||
|
||||
oEditor.model.change( writer => {
|
||||
const sText = `[[${sObjectClass}:${sObjectReference}${sLabel !== '' ? '|' + sLabel : ''}]]`;
|
||||
oEditor.model.insertContent(writer.createText(sText));
|
||||
} );
|
||||
|
||||
// Hide the form view after submit.
|
||||
this._hideUI();
|
||||
} );
|
||||
|
||||
// Hide the form view after clicking the "Cancel" button.
|
||||
this.listenTo(oFormView, 'cancel', () => {
|
||||
this._hideUI();
|
||||
} );
|
||||
|
||||
|
||||
const oBalloon = this.oBalloon;
|
||||
if(oBalloon !== undefined && oBalloon.view.element !== null){
|
||||
// Hide the form view when clicking outside the balloon.
|
||||
clickOutsideHandler( {
|
||||
emitter: oFormView,
|
||||
activator: () => oBalloon.visibleView === oFormView,
|
||||
contextElements: [ oBalloon.view.element ],
|
||||
callback: () => this._hideUI()
|
||||
} );
|
||||
}
|
||||
|
||||
|
||||
return oFormView;
|
||||
}
|
||||
|
||||
_showUI() {
|
||||
|
||||
// show balloon
|
||||
const pos = this._getBalloonPositionData();
|
||||
if(this.oBalloon !== undefined && this.oFormView !== undefined && pos !== null && pos.oTarget !== null){
|
||||
this.oBalloon.add( {
|
||||
view: this.oFormView,
|
||||
position: {
|
||||
target: pos.oTarget
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
// focus form view
|
||||
if(this.oFormView !== undefined){
|
||||
this.oFormView.focus();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
_hideUI() {
|
||||
if( this.oFormView !== undefined && this.oBalloon !== undefined){
|
||||
|
||||
if( this.oFormView.element !== null){
|
||||
(<HTMLFormElement>this.oFormView.element).reset();
|
||||
}
|
||||
|
||||
// remove balloon
|
||||
this.oBalloon.remove( this.oFormView );
|
||||
|
||||
// Focus the editing view
|
||||
this.editor.editing.view.focus();
|
||||
}
|
||||
}
|
||||
|
||||
_getBalloonPositionData(){
|
||||
const oView = this.editor.editing.view;
|
||||
const oViewDocument = oView.document;
|
||||
let oTarget = null;
|
||||
const oFirstRange = oViewDocument.selection.getFirstRange();
|
||||
if(oFirstRange !== null) {
|
||||
oTarget = () => oView.domConverter.viewRangeToDom(oFirstRange);
|
||||
}
|
||||
return {
|
||||
oTarget
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
.ck.ck-object-shortcut-form {
|
||||
padding: var(--ck-spacing-large);
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
grid-template-rows: repeat(4, 1fr);
|
||||
grid-column-gap: 0px;
|
||||
grid-row-gap: var(--ck-spacing-standard);
|
||||
}
|
||||
|
||||
.ck.ck-object-shortcut-form .ck.ck-labeled-field-view:nth-of-type(1) {
|
||||
grid-area: 1 / 1 / 2 / 3;
|
||||
}
|
||||
|
||||
.ck.ck-object-shortcut-form .ck.ck-labeled-field-view:nth-of-type(2) {
|
||||
grid-area: 2 / 1 / 3 / 3;
|
||||
}
|
||||
|
||||
.ck.ck-object-shortcut-form .ck.ck-labeled-field-view:nth-of-type(3) {
|
||||
grid-area: 3 / 1 / 4 / 3;
|
||||
}
|
||||
|
||||
.ck.ck-object-shortcut-form .ck-button:nth-of-type(1) {
|
||||
grid-area: 4 / 1 / 5 / 2;
|
||||
}
|
||||
|
||||
.ck.ck-object-shortcut-form .ck-button:nth-of-type(2) {
|
||||
grid-area: 4 / 2 / 5 / 3;
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
|
||||
|
||||
/**
|
||||
* TriggerUpdateOnReady Plugin.
|
||||
*
|
||||
* - Trigger update event when editor is ready
|
||||
*/
|
||||
export default class TriggerUpdateOnReady extends Plugin {
|
||||
|
||||
static get pluginName() {
|
||||
return 'TriggerUpdateOnReady';
|
||||
}
|
||||
|
||||
init() {
|
||||
|
||||
// retrieve editor instance
|
||||
const oEditor = this.editor;
|
||||
|
||||
// trigger update event when editor is ready
|
||||
oEditor.ui.on('ready', () => {
|
||||
|
||||
if (oEditor.ui.element !== null) {
|
||||
const oEvent = new Event("update");
|
||||
oEditor.ui.element.dispatchEvent(oEvent);
|
||||
}
|
||||
|
||||
for (const oElement of document.getElementsByClassName('ck-body-wrapper')) {
|
||||
oElement.classList.add('ck-reset_all-excluded');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
import { Plugin } from '@ckeditor/ckeditor5-core';
|
||||
import {ClassicEditor} from "@ckeditor/ckeditor5-editor-classic";
|
||||
|
||||
export default class UpdateInputOnChange extends Plugin {
|
||||
|
||||
static get pluginName() {
|
||||
return 'UpdateInputOnChange';
|
||||
}
|
||||
|
||||
init() {
|
||||
|
||||
// retrieve editor instance
|
||||
const oEditor:ClassicEditor = this.editor as ClassicEditor;
|
||||
|
||||
if(oEditor.sourceElement !== undefined) {
|
||||
const oInputElement = oEditor.sourceElement as HTMLInputElement;
|
||||
|
||||
// update input when data change
|
||||
oEditor.model.document.on('change:data', (event) => {
|
||||
|
||||
// only when input and textarea are different
|
||||
if(oInputElement.value !== oEditor.getData()) {
|
||||
oInputElement.value = oEditor.getData();
|
||||
// const oEvent = new Event('change');
|
||||
// oInputElement.dispatchEvent(oEvent);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,110 +0,0 @@
|
||||
/**
|
||||
* This file contains CKEditor 5 default theme styles.
|
||||
* "Default theme" means common styles for all GUIs (backoffice, portal, ...)
|
||||
*
|
||||
* Any style specific for the backoffice should be in the backoffice theme (e.g. "css/backoffice/vendors/_ckeditor.scss)
|
||||
* Any style specific for the portal should be in the portal theme (e.g. "datamodels/2.x/itop-portal-base/portal/public/css/portal.scss")
|
||||
*/
|
||||
|
||||
:root {
|
||||
--ck-color-list-button-on-background: #EFF0EF;
|
||||
--ck-color-list-button-on-background-focus: #EFF0EF;
|
||||
--ck-color-list-button-hover-background: #EFF0EF;
|
||||
--ck-color-list-button-on-text: black;
|
||||
--ck-color-image-caption-background: transparent;
|
||||
|
||||
/* Toolbar buttons / components downsize for better integration with UIs */
|
||||
--ck-spacing-small: 0.35rem;
|
||||
--ck-ui-component-min-height: 1rem;
|
||||
--ck-icon-size: 1.3rem;
|
||||
|
||||
--ck-z-default: 9999;
|
||||
--ck-z-panel: calc( var(--ck-z-default) + 999 );
|
||||
--ck-z-dialog: calc( var(--ck-z-panel) + 9999 );
|
||||
|
||||
/* Custom variables overloaded by backoffice or portals */
|
||||
--ck-text-tiny-font-size: 0.7rem;
|
||||
--ck-text-small-font-size: 0.85rem;
|
||||
--ck-text-big-font-size: 1.4rem;
|
||||
--ck-text-huge-font-size: 1.8rem;
|
||||
}
|
||||
|
||||
/* Text size classes */
|
||||
.text-tiny {
|
||||
font-size: var(--ck-text-tiny-font-size);
|
||||
}
|
||||
|
||||
.text-small {
|
||||
font-size: var(--ck-text-small-font-size);
|
||||
}
|
||||
|
||||
.text-big {
|
||||
font-size: var(--ck-text-big-font-size);
|
||||
}
|
||||
|
||||
.text-huge {
|
||||
font-size: var(--ck-text-huge-font-size);
|
||||
}
|
||||
|
||||
/* Editor base style */
|
||||
/* - Fix editor base z-index to avoid its children (images, drop down buttons, ...) passing on top of other elements */
|
||||
.ck-editor {
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
/* Figures / images */
|
||||
.ck-content .image img {
|
||||
min-width: inherit; /* Avoid text being typed next to the image, only below */
|
||||
margin-left: 0; /* Avoid image to be centered */
|
||||
margin-right: 0; /* Avoid image to be centered */
|
||||
}
|
||||
.ck-content .image-style-align-left,
|
||||
.ck-content .image-style-align-right {
|
||||
display: block;
|
||||
float: unset;
|
||||
}
|
||||
.ck-content .image-style-align-left {
|
||||
text-align: left;
|
||||
margin-right: 0;
|
||||
}
|
||||
.ck-content .image-style-align-right {
|
||||
text-align: right;
|
||||
margin-left: 0;
|
||||
}
|
||||
/* - Avoid figures to be centered */
|
||||
.ck-content figure {
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
}
|
||||
/* - Avoid tables in figure being align centered */
|
||||
.ck-content figure table {
|
||||
text-align: initial;
|
||||
}
|
||||
|
||||
/* Tables */
|
||||
/* - Avoid tables to be centered */
|
||||
.ck-content .table {
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
}
|
||||
/* - Force header background to an HEX color so it works with emails */
|
||||
.ck-content .table table th {
|
||||
background-color: #F4F4F4;
|
||||
}
|
||||
|
||||
/* Marker classes */
|
||||
.ck-content .marker-yellow {
|
||||
background-color: #FDFD77;
|
||||
}
|
||||
|
||||
.ck-content .marker-green {
|
||||
background-color: #62F962;
|
||||
}
|
||||
|
||||
.ck-content .marker-pink {
|
||||
background-color: #FC7899;
|
||||
}
|
||||
|
||||
.ck-content .marker-blue {
|
||||
background-color: #72CCFD;
|
||||
}
|
||||
4
node_modules/.package-lock.json
generated
vendored
4
node_modules/.package-lock.json
generated
vendored
@@ -69,6 +69,10 @@
|
||||
"d3": "~3.5.0"
|
||||
}
|
||||
},
|
||||
"node_modules/ckeditor5-itop-build": {
|
||||
"version": "3.2.0",
|
||||
"resolved": "git+ssh://git@github.com/Combodo/ckeditor5-itop-build.git#afb3e73d4636520a46e2c05d6630bbed9c4f6cc5"
|
||||
},
|
||||
"node_modules/clipboard": {
|
||||
"version": "2.0.11",
|
||||
"resolved": "https://registry.npmjs.org/clipboard/-/clipboard-2.0.11.tgz",
|
||||
|
||||
0
js/ckeditor/LICENSE.md → node_modules/ckeditor5-itop-build/LICENSE.md
generated
vendored
0
js/ckeditor/LICENSE.md → node_modules/ckeditor5-itop-build/LICENSE.md
generated
vendored
0
js/ckeditor/README.md → node_modules/ckeditor5-itop-build/README.md
generated
vendored
0
js/ckeditor/README.md → node_modules/ckeditor5-itop-build/README.md
generated
vendored
30
node_modules/ckeditor5-itop-build/build/ckeditor.d.ts
generated
vendored
Normal file
30
node_modules/ckeditor5-itop-build/build/ckeditor.d.ts
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
/**
|
||||
* @license Copyright (c) 2014-2024, CKSource Holding sp. z o.o. All rights reserved.
|
||||
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
||||
*/
|
||||
import { ClassicEditor } from '@ckeditor/ckeditor5-editor-classic';
|
||||
import { Alignment } from '@ckeditor/ckeditor5-alignment';
|
||||
import { Bold, Italic, Strikethrough, Underline } from '@ckeditor/ckeditor5-basic-styles';
|
||||
import { BlockQuote } from '@ckeditor/ckeditor5-block-quote';
|
||||
import { CodeBlock } from '@ckeditor/ckeditor5-code-block';
|
||||
import type { EditorConfig } from '@ckeditor/ckeditor5-core';
|
||||
import { Essentials } from '@ckeditor/ckeditor5-essentials';
|
||||
import { FontBackgroundColor, FontColor, FontFamily, FontSize } from '@ckeditor/ckeditor5-font';
|
||||
import { Heading } from '@ckeditor/ckeditor5-heading';
|
||||
import { Highlight } from '@ckeditor/ckeditor5-highlight';
|
||||
import { HorizontalLine } from '@ckeditor/ckeditor5-horizontal-line';
|
||||
import { Image, ImageCaption, ImageResize, ImageStyle, ImageToolbar, ImageUpload } from '@ckeditor/ckeditor5-image';
|
||||
import { Indent } from '@ckeditor/ckeditor5-indent';
|
||||
import { Link } from '@ckeditor/ckeditor5-link';
|
||||
import { List } from '@ckeditor/ckeditor5-list';
|
||||
import { Mention } from '@ckeditor/ckeditor5-mention';
|
||||
import { Table, TableCaption, TableCellProperties, TableColumnResize, TableProperties, TableToolbar } from '@ckeditor/ckeditor5-table';
|
||||
import { Undo } from '@ckeditor/ckeditor5-undo';
|
||||
import { RemoveFormat } from '@ckeditor/ckeditor5-remove-format';
|
||||
import InsertCarriageReturnAfterBlock from "./plugins/insert-carriage-return-after-block/insert-carriage-return-after-block.plugin";
|
||||
import './resources/styles/default-theme.css';
|
||||
declare class Editor extends ClassicEditor {
|
||||
static builtinPlugins: (typeof Alignment | typeof Bold | typeof Italic | typeof Strikethrough | typeof Underline | typeof BlockQuote | typeof CodeBlock | typeof Undo | typeof Essentials | typeof FontBackgroundColor | typeof FontColor | typeof FontFamily | typeof FontSize | typeof Heading | typeof Highlight | typeof HorizontalLine | typeof Image | typeof ImageCaption | typeof ImageResize | typeof ImageStyle | typeof ImageToolbar | typeof ImageUpload | typeof Indent | typeof Link | typeof List | typeof Mention | typeof Table | typeof TableCaption | typeof TableCellProperties | typeof TableColumnResize | typeof TableProperties | typeof TableToolbar | typeof RemoveFormat | typeof InsertCarriageReturnAfterBlock)[];
|
||||
static defaultConfig: EditorConfig;
|
||||
}
|
||||
export default Editor;
|
||||
0
js/ckeditor/build/ckeditor.js → node_modules/ckeditor5-itop-build/build/ckeditor.js
generated
vendored
0
js/ckeditor/build/ckeditor.js → node_modules/ckeditor5-itop-build/build/ckeditor.js
generated
vendored
10
node_modules/ckeditor5-itop-build/build/plugins/append-itop-classes/append-itop-classes.plugin.d.ts
generated
vendored
Normal file
10
node_modules/ckeditor5-itop-build/build/plugins/append-itop-classes/append-itop-classes.plugin.d.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
|
||||
/**
|
||||
* AppendITopClasses Plugin.
|
||||
*
|
||||
* Appends ibo-is-html-content (backoffice) & ipb-is-html-content (portal) classes
|
||||
*/
|
||||
export default class AppendITopClasses extends Plugin {
|
||||
static get pluginName(): string;
|
||||
init(): void;
|
||||
}
|
||||
13
node_modules/ckeditor5-itop-build/build/plugins/detect-change/detect-change.plugin.d.ts
generated
vendored
Normal file
13
node_modules/ckeditor5-itop-build/build/plugins/detect-change/detect-change.plugin.d.ts
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
import { Plugin, type Editor } from 'ckeditor5/src/core.js';
|
||||
import InsertCarriageReturnAfterBlock from "../insert-carriage-return-after-block/insert-carriage-return-after-block.plugin";
|
||||
/**
|
||||
* DetectChanges Plugin.
|
||||
*
|
||||
*/
|
||||
export default class DetectChanges extends Plugin {
|
||||
private readonly _processor;
|
||||
constructor(editor: Editor);
|
||||
init(): void;
|
||||
static get pluginName(): string;
|
||||
static get requires(): (typeof InsertCarriageReturnAfterBlock)[];
|
||||
}
|
||||
24
node_modules/ckeditor5-itop-build/build/plugins/detect-change/itop-data-processor.d.ts
generated
vendored
Normal file
24
node_modules/ckeditor5-itop-build/build/plugins/detect-change/itop-data-processor.d.ts
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
import { HtmlDataProcessor, type ViewDocument, type ViewDocumentFragment } from 'ckeditor5/src/engine.js';
|
||||
export default class iTopDataProcessor extends HtmlDataProcessor {
|
||||
/**
|
||||
* HTML data processor used to process HTML if we detect changes
|
||||
* @private
|
||||
*/
|
||||
private _htmlDP;
|
||||
/**
|
||||
* Initial value of the editor, we'll return it if we don't detect any changes
|
||||
* @private
|
||||
*/
|
||||
private readonly _initialValue;
|
||||
/**
|
||||
* Transformed initial value of the editor, we'll use it to detect changes
|
||||
* @private
|
||||
*/
|
||||
private _transformedInitialValue;
|
||||
/**
|
||||
* Creates a new instance of the Markdown data processor class.
|
||||
*/
|
||||
constructor(document: ViewDocument, initialValue: string, transformedInitialValue: string);
|
||||
setTransformedInitialValue(transformedInitialValue: string): void;
|
||||
toData(viewFragment: ViewDocumentFragment): string;
|
||||
}
|
||||
13
node_modules/ckeditor5-itop-build/build/plugins/disabler/disabler.plugin.d.ts
generated
vendored
Normal file
13
node_modules/ckeditor5-itop-build/build/plugins/disabler/disabler.plugin.d.ts
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
import { Plugin } from '@ckeditor/ckeditor5-core';
|
||||
import { ClassicEditor } from "@ckeditor/ckeditor5-editor-classic";
|
||||
export default class Disabler extends Plugin {
|
||||
static get pluginName(): string;
|
||||
init(): void;
|
||||
/**
|
||||
* Process ckeditor disabling.
|
||||
*
|
||||
* @param oEditor
|
||||
* @param oInputElement
|
||||
*/
|
||||
static processDisabling(oEditor: ClassicEditor, oInputElement: HTMLInputElement): void;
|
||||
}
|
||||
4
node_modules/ckeditor5-itop-build/build/plugins/insert-carriage-return-after-block/insert-carriage-return-after-block.plugin.d.ts
generated
vendored
Normal file
4
node_modules/ckeditor5-itop-build/build/plugins/insert-carriage-return-after-block/insert-carriage-return-after-block.plugin.d.ts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
|
||||
export default class InsertCarriageReturnAfterBlock extends Plugin {
|
||||
init(): void;
|
||||
}
|
||||
@@ -1,13 +1,8 @@
|
||||
import { Command } from 'ckeditor5/src/core';
|
||||
|
||||
/**
|
||||
* InsertHtmlCommand Command.
|
||||
*
|
||||
*/
|
||||
export default class InsertHtmlCommand extends Command {
|
||||
|
||||
override execute( sContent:string ) {
|
||||
this.editor.setData(this.editor.getData() + sContent);
|
||||
}
|
||||
execute(sContent: string): void;
|
||||
}
|
||||
|
||||
9
node_modules/ckeditor5-itop-build/build/plugins/insert-html/insert-html.plugin.d.ts
generated
vendored
Normal file
9
node_modules/ckeditor5-itop-build/build/plugins/insert-html/insert-html.plugin.d.ts
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
|
||||
/**
|
||||
* InsertHtml Plugin.
|
||||
*
|
||||
*/
|
||||
export default class InsertHtml extends Plugin {
|
||||
static get pluginName(): string;
|
||||
init(): void;
|
||||
}
|
||||
10
node_modules/ckeditor5-itop-build/build/plugins/keyboard-shortcut/keyboard-shortcut.plugin.d.ts
generated
vendored
Normal file
10
node_modules/ckeditor5-itop-build/build/plugins/keyboard-shortcut/keyboard-shortcut.plugin.d.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
|
||||
/**
|
||||
* KeyboardShortcut Plugin.
|
||||
*
|
||||
* - Dispatch submit event on the closest editor form when Ctrl+Enter pressed
|
||||
*/
|
||||
export default class KeyboardShortcut extends Plugin {
|
||||
static get pluginName(): string;
|
||||
init(): void;
|
||||
}
|
||||
5
node_modules/ckeditor5-itop-build/build/plugins/maximize/maximize.plugin.d.ts
generated
vendored
Normal file
5
node_modules/ckeditor5-itop-build/build/plugins/maximize/maximize.plugin.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
|
||||
export default class Maximize extends Plugin {
|
||||
static get pluginName(): string;
|
||||
init(): void;
|
||||
}
|
||||
10
node_modules/ckeditor5-itop-build/build/plugins/mentions-markup/mentions-markup.plugin.d.ts
generated
vendored
Normal file
10
node_modules/ckeditor5-itop-build/build/plugins/mentions-markup/mentions-markup.plugin.d.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
|
||||
/**
|
||||
* MentionsMarkup Plugin.
|
||||
*
|
||||
* - Converter for mentions
|
||||
*/
|
||||
export default class MentionsMarkup extends Plugin {
|
||||
static get pluginName(): string;
|
||||
init(): void;
|
||||
}
|
||||
19
node_modules/ckeditor5-itop-build/build/plugins/object-shortcut/object-shortcut.form-view.d.ts
generated
vendored
Normal file
19
node_modules/ckeditor5-itop-build/build/plugins/object-shortcut/object-shortcut.form-view.d.ts
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
|
||||
* For licensing, see LICENSE.md.
|
||||
*/
|
||||
import { View, LabeledFieldView, ButtonView } from '@ckeditor/ckeditor5-ui';
|
||||
import { Locale } from '@ckeditor/ckeditor5-utils';
|
||||
export default class FormView extends View {
|
||||
oLabelInputView: LabeledFieldView;
|
||||
oClassInputView: LabeledFieldView;
|
||||
oReferenceInputView: LabeledFieldView;
|
||||
oSaveButtonView: ButtonView;
|
||||
oCancelButtonView: ButtonView;
|
||||
oChildViews: any;
|
||||
constructor(oLocale: Locale);
|
||||
render(): void;
|
||||
focus(): void;
|
||||
_createInput(sLabel: string): LabeledFieldView<import("@ckeditor/ckeditor5-ui").InputTextView>;
|
||||
_createButton(sLabel: string, sIcon: string, sClassName: string): ButtonView;
|
||||
}
|
||||
@@ -1,8 +1,5 @@
|
||||
import { Plugin } from '@ckeditor/ckeditor5-core';
|
||||
import ObjectShortcutUI from './object-shortcut.ui';
|
||||
|
||||
export default class ObjectShortcut extends Plugin {
|
||||
static get requires() {
|
||||
return [ObjectShortcutUI];
|
||||
}
|
||||
static get requires(): (typeof ObjectShortcutUI)[];
|
||||
}
|
||||
16
node_modules/ckeditor5-itop-build/build/plugins/object-shortcut/object-shortcut.ui.d.ts
generated
vendored
Normal file
16
node_modules/ckeditor5-itop-build/build/plugins/object-shortcut/object-shortcut.ui.d.ts
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
import { Plugin } from '@ckeditor/ckeditor5-core';
|
||||
import { ContextualBalloon } from '@ckeditor/ckeditor5-ui';
|
||||
import FormView from './object-shortcut.form-view';
|
||||
import './styles.css';
|
||||
export default class ObjectShortcutUI extends Plugin {
|
||||
static get requires(): (typeof ContextualBalloon)[];
|
||||
oBalloon: ContextualBalloon | undefined;
|
||||
oFormView: FormView | undefined;
|
||||
init(): void;
|
||||
_createFormView(): FormView;
|
||||
_showUI(): void;
|
||||
_hideUI(): void;
|
||||
_getBalloonPositionData(): {
|
||||
oTarget: (() => Range) | null;
|
||||
};
|
||||
}
|
||||
10
node_modules/ckeditor5-itop-build/build/plugins/trigger-update-on-ready/trigger-update-on-ready.plugin.d.ts
generated
vendored
Normal file
10
node_modules/ckeditor5-itop-build/build/plugins/trigger-update-on-ready/trigger-update-on-ready.plugin.d.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
|
||||
/**
|
||||
* TriggerUpdateOnReady Plugin.
|
||||
*
|
||||
* - Trigger update event when editor is ready
|
||||
*/
|
||||
export default class TriggerUpdateOnReady extends Plugin {
|
||||
static get pluginName(): string;
|
||||
init(): void;
|
||||
}
|
||||
5
node_modules/ckeditor5-itop-build/build/plugins/update-input-on-change/update-input-on-change.plugin.d.ts
generated
vendored
Normal file
5
node_modules/ckeditor5-itop-build/build/plugins/update-input-on-change/update-input-on-change.plugin.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import { Plugin } from '@ckeditor/ckeditor5-core';
|
||||
export default class UpdateInputOnChange extends Plugin {
|
||||
static get pluginName(): string;
|
||||
init(): void;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user