leksy-editor 1.0.13 → 1.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/constant.js +3 -0
- package/package.json +1 -1
- package/plugin.js +7 -4
- package/style.css +35 -0
package/constant.js
CHANGED
|
@@ -122,6 +122,8 @@ const SVG = {
|
|
|
122
122
|
LOADER: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200"><radialGradient id="a12" cx=".66" fx=".66" cy=".3125" fy=".3125" gradientTransform="scale(1.5)"><stop offset="0" stop-color="#000000"></stop><stop offset=".3" stop-color="#000000" stop-opacity=".9"></stop><stop offset=".6" stop-color="#000000" stop-opacity=".6"></stop><stop offset=".8" stop-color="#000000" stop-opacity=".3"></stop><stop offset="1" stop-color="#000000" stop-opacity="0"></stop></radialGradient><circle transform-origin="center" fill="none" stroke="url(#a12)" stroke-width="15" stroke-linecap="round" stroke-dasharray="200 1000" stroke-dashoffset="0" cx="100" cy="100" r="70"><animateTransform type="rotate" attributeName="transform" calcMode="spline" dur="2" values="360;0" keyTimes="0;1" keySplines="0 0 1 1" repeatCount="indefinite"></animateTransform></circle><circle transform-origin="center" fill="none" opacity=".2" stroke="#000000" stroke-width="15" stroke-linecap="round" cx="100" cy="100" r="70"></circle></svg>',
|
|
123
123
|
FULLSCREEN_IMAGE: '<svg xmlns="http://www.w3.org/2000/svg" width="20px" viewBox="0 0 24 24" fill="currentColor"><path d="M8 3V5H4V9H2V3H8ZM2 21V15H4V19H8V21H2ZM22 21H16V19H20V15H22V21ZM22 9H20V5H16V3H22V9Z"></path></svg>',
|
|
124
124
|
CLOSE: '<svg xmlns="http://www.w3.org/2000/svg" width="16px" viewBox="0 0 24 24" fill="currentColor"><path d="M10.5859 12L2.79297 4.20706L4.20718 2.79285L12.0001 10.5857L19.793 2.79285L21.2072 4.20706L13.4143 12L21.2072 19.7928L19.793 21.2071L12.0001 13.4142L4.20718 21.2071L2.79297 19.7928L10.5859 12Z"></path></svg>',
|
|
125
|
+
SPINNER: '<svg class="leksy-editor-spinner" width="16" height="16" viewBox="0 0 50 50"><circle class="leksy-editor-path" cx="25" cy="25" r="20" fill="none" stroke-width="4"></circle></svg>',
|
|
126
|
+
|
|
125
127
|
}
|
|
126
128
|
|
|
127
129
|
|
|
@@ -545,6 +547,7 @@ const FONTS = {
|
|
|
545
547
|
"tahoma, sans-serif": "<p style='user-select: none; font-family: tahoma, sans-serif;'>Tahoma</p>",
|
|
546
548
|
"trebuchet ms, sans-serif": "<p style='user-select: none; font-family: "trebuchet ms", sans-serif;'>Trebuchet MS</p>",
|
|
547
549
|
"verdana, sans-serif": "<p style='user-select: none; font-family: verdana, sans-serif;'>Verdana</p>",
|
|
550
|
+
"calibri, sans-serif": "<p style='user-select: none; font-family: calibri, sans-serif;'>Calibri</p>",
|
|
548
551
|
}
|
|
549
552
|
|
|
550
553
|
const FONT_SIZE_OPTIONS = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "leksy-editor",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.14",
|
|
4
4
|
"description": "Leksy Editor is an alternative to traditional WYSIWYG editors, designed primarily for creating mail templates, blogs, and documents without any content manipulation.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"directories": {
|
package/plugin.js
CHANGED
|
@@ -87,7 +87,7 @@ const PLUGINS = {
|
|
|
87
87
|
click: (event, core) => {
|
|
88
88
|
core.elements.editor.focus();
|
|
89
89
|
core.elements.iframeWindow.execCommand('justifyFull');
|
|
90
|
-
core.resizerHandler()
|
|
90
|
+
core.resizerHandler?.()
|
|
91
91
|
core.updateCaretPosition()
|
|
92
92
|
|
|
93
93
|
changeToolbarStateByName(core, 'active', ['align_justify'])
|
|
@@ -101,7 +101,7 @@ const PLUGINS = {
|
|
|
101
101
|
click: (event, core) => {
|
|
102
102
|
core.elements.editor.focus();
|
|
103
103
|
core.elements.iframeWindow.execCommand('justifyLeft');
|
|
104
|
-
core.resizerHandler()
|
|
104
|
+
core.resizerHandler?.()
|
|
105
105
|
core.updateCaretPosition()
|
|
106
106
|
|
|
107
107
|
changeToolbarStateByName(core, 'active', ['align_left'])
|
|
@@ -115,7 +115,7 @@ const PLUGINS = {
|
|
|
115
115
|
click: (event, core) => {
|
|
116
116
|
core.elements.editor.focus();
|
|
117
117
|
core.elements.iframeWindow.execCommand('justifyRight');
|
|
118
|
-
core.resizerHandler()
|
|
118
|
+
core.resizerHandler?.()
|
|
119
119
|
core.updateCaretPosition()
|
|
120
120
|
|
|
121
121
|
changeToolbarStateByName(core, 'active', ['align_right'])
|
|
@@ -129,7 +129,7 @@ const PLUGINS = {
|
|
|
129
129
|
click: (event, core) => {
|
|
130
130
|
core.elements.editor.focus();
|
|
131
131
|
core.elements.iframeWindow.execCommand('justifyCenter');
|
|
132
|
-
core.resizerHandler()
|
|
132
|
+
core.resizerHandler?.()
|
|
133
133
|
core.updateCaretPosition()
|
|
134
134
|
|
|
135
135
|
changeToolbarStateByName(core, 'active', ['align_center'])
|
|
@@ -809,9 +809,12 @@ const PLUGINS = {
|
|
|
809
809
|
return;
|
|
810
810
|
}
|
|
811
811
|
button.disabled = true;
|
|
812
|
+
const originalText = button.innerText;
|
|
813
|
+
button.innerHTML = ` <span style="margin-left: 8px;">${originalText}</span> ${SVG.SPINNER}`
|
|
812
814
|
const img = document.createElement('img');
|
|
813
815
|
img.src = await core.manuplateImage('base64', base64String);
|
|
814
816
|
img.alt = altInput.value || "";
|
|
817
|
+
button.innerText = originalText
|
|
815
818
|
|
|
816
819
|
core.insertNode(img);
|
|
817
820
|
modal.close();
|
package/style.css
CHANGED
|
@@ -555,4 +555,39 @@
|
|
|
555
555
|
object-fit: contain;
|
|
556
556
|
max-width: 90%;
|
|
557
557
|
max-height: 90%;
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
.leksy-editor-spinner {
|
|
561
|
+
animation: leksy-editor-rotate 1s linear infinite;
|
|
562
|
+
margin-right: 8px;
|
|
563
|
+
vertical-align: middle;
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
.leksy-editor-spinner .leksy-editor-path {
|
|
567
|
+
stroke: white;
|
|
568
|
+
stroke-linecap: round;
|
|
569
|
+
animation: leksy-editor-dash 1.5s ease-in-out infinite;
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
@keyframes leksy-editor-rotate {
|
|
573
|
+
100% {
|
|
574
|
+
transform: rotate(360deg);
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
@keyframes leksy-editor-dash {
|
|
579
|
+
0% {
|
|
580
|
+
stroke-dasharray: 1, 150;
|
|
581
|
+
stroke-dashoffset: 0;
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
50% {
|
|
585
|
+
stroke-dasharray: 90, 150;
|
|
586
|
+
stroke-dashoffset: -35;
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
100% {
|
|
590
|
+
stroke-dasharray: 90, 150;
|
|
591
|
+
stroke-dashoffset: -124;
|
|
592
|
+
}
|
|
558
593
|
}
|