leksy-editor 2.1.0 → 2.1.2

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 CHANGED
@@ -427,6 +427,9 @@ const CSS = {
427
427
 
428
428
  .tabs-container .tab-items {
429
429
  overflow-y: auto;
430
+ }
431
+
432
+ .tabs-container .tab-items.animate {
430
433
  transition: max-height 0.3s ease, opacity 0.2s ease;
431
434
  }
432
435
 
package/index.js CHANGED
@@ -307,6 +307,7 @@ class LeksyEditor {
307
307
  core.elements.editor.contentEditable = !disabled;
308
308
  if (disabled) changeAllToolbarState(core, 'disabled')
309
309
  else changeAllToolbarState(core, 'enabled')
310
+ renderTabs(core, options)
310
311
  },
311
312
  updateCssVariables: (newVariables) => {
312
313
  const variableMap = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "leksy-editor",
3
- "version": "2.1.0",
3
+ "version": "2.1.2",
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/tab.js CHANGED
@@ -137,6 +137,7 @@ const renderTabs = (core, options) => {
137
137
  };
138
138
 
139
139
  tabItem.ondblclick = () => {
140
+ if (options.disabled) return
140
141
  clearTimeout(clickTimer);
141
142
  renameTab(core, tab.tabId, titleInput, options);
142
143
  };
@@ -186,7 +187,7 @@ const renderTabs = (core, options) => {
186
187
  leftSection.appendChild(span);
187
188
  leftSection.appendChild(titleInput);
188
189
  tabItem.appendChild(leftSection);
189
- tabItem.appendChild(menuBtn);
190
+ if (!options.disabled) tabItem.appendChild(menuBtn);
190
191
 
191
192
  const tabItemContainer = document.createElement('div');
192
193
  tabItemContainer.id = tab.tabId;
@@ -239,12 +240,15 @@ const renderTabs = (core, options) => {
239
240
  expandBtn.classList.toggle('show')
240
241
  tabListContainer.classList.toggle('show')
241
242
  }
243
+ requestAnimationFrame(() => {
244
+ tabListContainer.classList.add('animate');
245
+ });
242
246
  if (core.state.isTabExpandInResponsive) {
243
247
  expandBtn.classList.add('show')
244
248
  tabListContainer.classList.add('show')
245
249
  }
246
250
 
247
- rightDiv.appendChild(addBtn);
251
+ if (!options.disabled) rightDiv.appendChild(addBtn);
248
252
  rightDiv.appendChild(expandBtn);
249
253
 
250
254
  tabHeader.appendChild(headerTitle);
@@ -429,6 +433,7 @@ const showContextMenu = (core, tab, event, level, options) => {
429
433
  };
430
434
 
431
435
  const createTab = (core, options) => {
436
+ if (options.disabled) return
432
437
  const newTab = {
433
438
  tabTitle: `Tab ${core.state.tabs.length + 1}`,
434
439
  tabId: uuidv4(),
package/utilities.js CHANGED
@@ -1462,7 +1462,7 @@ const updateImageResizerPosition = (e, core) => {
1462
1462
  }
1463
1463
 
1464
1464
  const destroyImageResizer = (options, core) => {
1465
- changeAllToolbarState(core, 'enabled')
1465
+ if (!options.disabled) changeAllToolbarState(core, 'enabled')
1466
1466
  if (core.elements.resizerPlugin) core.elements.toolbarContainer.removeChild(core.elements.resizerPlugin)
1467
1467
  if (core.elements.resizer) core.elements.iframeWindow.body.removeChild(core.elements.resizer)
1468
1468
  core.elements.iframeWindow.removeEventListener('scroll', core.resizerHandler, false)