@licium/editor 3.2.7 → 3.2.9

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.
Files changed (91) hide show
  1. package/dist/esm/i18n/ar.js +1 -1
  2. package/dist/esm/i18n/cs-cz.js +1 -1
  3. package/dist/esm/i18n/de-de.js +1 -1
  4. package/dist/esm/i18n/en-us.js +1 -1
  5. package/dist/esm/i18n/es-es.js +1 -1
  6. package/dist/esm/i18n/fi-fi.js +1 -1
  7. package/dist/esm/i18n/fr-fr.js +1 -1
  8. package/dist/esm/i18n/gl-es.js +1 -1
  9. package/dist/esm/i18n/hr-hr.js +1 -1
  10. package/dist/esm/i18n/i18n.js +1 -1
  11. package/dist/esm/i18n/it-it.js +1 -1
  12. package/dist/esm/i18n/ja-jp.js +1 -1
  13. package/dist/esm/i18n/ko-kr.js +1 -1
  14. package/dist/esm/i18n/nb-no.js +1 -1
  15. package/dist/esm/i18n/nl-nl.js +1 -1
  16. package/dist/esm/i18n/pl-pl.js +1 -1
  17. package/dist/esm/i18n/pt-br.js +1 -1
  18. package/dist/esm/i18n/ru-ru.js +1 -1
  19. package/dist/esm/i18n/sv-se.js +1 -1
  20. package/dist/esm/i18n/tr-tr.js +1 -1
  21. package/dist/esm/i18n/uk-ua.js +1 -1
  22. package/dist/esm/i18n/wysiwyg/nodes/details.d.ts +29 -0
  23. package/dist/esm/i18n/wysiwyg/nodes/summary.d.ts +23 -0
  24. package/dist/esm/i18n/zh-cn.js +1 -1
  25. package/dist/esm/i18n/zh-tw.js +1 -1
  26. package/dist/esm/index.js +120 -7
  27. package/dist/esm/indexViewer.js +2 -1
  28. package/dist/i18n/ar.js +1 -1
  29. package/dist/i18n/cs-cz.js +1 -1
  30. package/dist/i18n/de-de.js +1 -1
  31. package/dist/i18n/es-es.js +1 -1
  32. package/dist/i18n/fi-fi.js +1 -1
  33. package/dist/i18n/fr-fr.js +1 -1
  34. package/dist/i18n/gl-es.js +1 -1
  35. package/dist/i18n/hr-hr.js +1 -1
  36. package/dist/i18n/it-it.js +1 -1
  37. package/dist/i18n/ja-jp.js +1 -1
  38. package/dist/i18n/ko-kr.js +1 -1
  39. package/dist/i18n/nb-no.js +1 -1
  40. package/dist/i18n/nl-nl.js +1 -1
  41. package/dist/i18n/pl-pl.js +1 -1
  42. package/dist/i18n/pt-br.js +1 -1
  43. package/dist/i18n/ru-ru.js +1 -1
  44. package/dist/i18n/sv-se.js +1 -1
  45. package/dist/i18n/tr-tr.js +1 -1
  46. package/dist/i18n/uk-ua.js +1 -1
  47. package/dist/i18n/zh-cn.js +1 -1
  48. package/dist/i18n/zh-tw.js +1 -1
  49. package/dist/theme/toastui-editor-dark.css +33 -8
  50. package/dist/toastui-editor-only.css +45 -15
  51. package/dist/toastui-editor-viewer.css +1 -1
  52. package/dist/toastui-editor-viewer.js +15 -3
  53. package/dist/toastui-editor.css +45 -15
  54. package/dist/toastui-editor.js +128 -7
  55. package/package.json +2 -2
  56. package/types/index.d.ts +1 -1
  57. package/types/wysiwyg.d.ts +3 -1
  58. package/LICENSE +0 -21
  59. package/dist/esm/i18n/__test__/integration/ui/layout.spec.d.ts +0 -1
  60. package/dist/esm/i18n/__test__/integration/ui/toolbar.spec.d.ts +0 -1
  61. package/dist/esm/i18n/__test__/integration/vdom/render.spec.d.ts +0 -1
  62. package/dist/esm/i18n/__test__/integration/widget/widgetNode.spec.d.ts +0 -1
  63. package/dist/esm/i18n/__test__/unit/convertor.spec.d.ts +0 -1
  64. package/dist/esm/i18n/__test__/unit/dom.spec.d.ts +0 -1
  65. package/dist/esm/i18n/__test__/unit/editor.spec.d.ts +0 -1
  66. package/dist/esm/i18n/__test__/unit/eventEmitter.spec.d.ts +0 -1
  67. package/dist/esm/i18n/__test__/unit/helper/common.spec.d.ts +0 -1
  68. package/dist/esm/i18n/__test__/unit/helper/image.spec.d.ts +0 -1
  69. package/dist/esm/i18n/__test__/unit/linkXss.spec.d.ts +0 -1
  70. package/dist/esm/i18n/__test__/unit/markdown/keymap.spec.d.ts +0 -1
  71. package/dist/esm/i18n/__test__/unit/markdown/mdCommand.spec.d.ts +0 -1
  72. package/dist/esm/i18n/__test__/unit/markdown/mdEditor.spec.d.ts +0 -1
  73. package/dist/esm/i18n/__test__/unit/markdown/mdPreview.spec.d.ts +0 -1
  74. package/dist/esm/i18n/__test__/unit/markdown/smartTask.spec.d.ts +0 -1
  75. package/dist/esm/i18n/__test__/unit/markdown/syntaxHighlight.spec.d.ts +0 -1
  76. package/dist/esm/i18n/__test__/unit/markdown/util.d.ts +0 -7
  77. package/dist/esm/i18n/__test__/unit/repro_3296.spec.d.ts +0 -1
  78. package/dist/esm/i18n/__test__/unit/sanitizer.spec.d.ts +0 -1
  79. package/dist/esm/i18n/__test__/unit/utils/escape.spec.d.ts +0 -1
  80. package/dist/esm/i18n/__test__/unit/utils/pollution.spec.d.ts +0 -1
  81. package/dist/esm/i18n/__test__/unit/vdom/template.spec.d.ts +0 -1
  82. package/dist/esm/i18n/__test__/unit/viewer.spec.d.ts +0 -1
  83. package/dist/esm/i18n/__test__/unit/wysiwyg/customBlock.spec.d.ts +0 -1
  84. package/dist/esm/i18n/__test__/unit/wysiwyg/helper/pasteMsoList.spec.d.ts +0 -1
  85. package/dist/esm/i18n/__test__/unit/wysiwyg/imageInsertion.spec.d.ts +0 -1
  86. package/dist/esm/i18n/__test__/unit/wysiwyg/keymap.spec.d.ts +0 -1
  87. package/dist/esm/i18n/__test__/unit/wysiwyg/wwCommand.spec.d.ts +0 -1
  88. package/dist/esm/i18n/__test__/unit/wysiwyg/wwEditor.spec.d.ts +0 -1
  89. package/dist/esm/i18n/__test__/unit/wysiwyg/wwTableCommand.spec.d.ts +0 -1
  90. package/dist/esm/i18n/__test__/unit/wysiwyg/wwToDOMAdaptor.spec.d.ts +0 -1
  91. package/dist/esm/i18n/__test__/unit/xssSanitizer.spec.d.ts +0 -1
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * @licium/editor
3
- * @version 3.2.6 | Sat Jan 03 2026
3
+ * @version 3.2.8 | Tue Jan 06 2026
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -15748,6 +15748,7 @@ function getChildrenHTML(node, typeName) {
15748
15748
  function getHTMLAttrsByHTMLString(html) {
15749
15749
  html = html.match(reHTMLTag)[0];
15750
15750
  const attrs = html.match(new RegExp(ATTRIBUTE, 'g'));
15751
+ // prettier-ignore
15751
15752
  return attrs
15752
15753
  ? attrs.reduce((acc, attr) => {
15753
15754
  const [name, ...values] = attr.trim().split('=');
@@ -15775,10 +15776,13 @@ function sanitizeDOM(node, typeName, sanitizer, wwToDOMAdaptor) {
15775
15776
  }
15776
15777
  const schemaFactory = {
15777
15778
  htmlBlock(typeName, sanitizeHTML, wwToDOMAdaptor) {
15779
+ const isContainer = ['details', 'summary'].includes(typeName);
15778
15780
  return {
15779
- atom: true,
15780
- content: 'block+',
15781
+ atom: !isContainer,
15782
+ content: typeName === 'summary' ? 'inline*' : 'block+',
15781
15783
  group: 'block',
15784
+ defining: isContainer,
15785
+ isolating: typeName === 'details',
15782
15786
  attrs: {
15783
15787
  htmlAttrs: { default: {} },
15784
15788
  childrenHTML: { default: '' },
@@ -15788,6 +15792,11 @@ const schemaFactory = {
15788
15792
  {
15789
15793
  tag: typeName,
15790
15794
  getAttrs(dom) {
15795
+ if (isContainer) {
15796
+ return {
15797
+ htmlAttrs: getHTMLAttrs(dom),
15798
+ };
15799
+ }
15791
15800
  return {
15792
15801
  htmlAttrs: getHTMLAttrs(dom),
15793
15802
  childrenHTML: dom.innerHTML,
@@ -15798,6 +15807,9 @@ const schemaFactory = {
15798
15807
  toDOM(node) {
15799
15808
  const { dom, htmlAttrs } = sanitizeDOM(node, typeName, sanitizeHTML, wwToDOMAdaptor);
15800
15809
  htmlAttrs.class = htmlAttrs.class ? `${htmlAttrs.class} html-block` : 'html-block';
15810
+ if (isContainer) {
15811
+ return [typeName, htmlAttrs, 0];
15812
+ }
15801
15813
  return [typeName, htmlAttrs, ...toArray_default()(dom.childNodes)];
15802
15814
  },
15803
15815
  };
@@ -19888,6 +19900,63 @@ class HTMLComment extends node_Node {
19888
19900
  }
19889
19901
  }
19890
19902
 
19903
+ ;// CONCATENATED MODULE: ./src/wysiwyg/nodes/details.ts
19904
+
19905
+
19906
+ class Details extends node_Node {
19907
+ get name() {
19908
+ return 'details';
19909
+ }
19910
+ get schema() {
19911
+ return {
19912
+ content: 'summary block+',
19913
+ group: 'block',
19914
+ defining: true,
19915
+ isolating: true,
19916
+ attrs: Object.assign(Object.assign({}, getDefaultCustomAttrs()), { open: { default: true } }),
19917
+ parseDOM: [
19918
+ {
19919
+ tag: 'details',
19920
+ getAttrs(dom) {
19921
+ return {
19922
+ open: false, // Always collapse on load/switch to prevent unresponsive state
19923
+ };
19924
+ },
19925
+ },
19926
+ ],
19927
+ toDOM({ attrs }) {
19928
+ const domAttrs = getCustomAttrs(attrs);
19929
+ if (attrs.open) {
19930
+ domAttrs.open = '';
19931
+ }
19932
+ return ['details', domAttrs, 0];
19933
+ },
19934
+ };
19935
+ }
19936
+ }
19937
+
19938
+ ;// CONCATENATED MODULE: ./src/wysiwyg/nodes/summary.ts
19939
+
19940
+
19941
+ class Summary extends node_Node {
19942
+ get name() {
19943
+ return 'summary';
19944
+ }
19945
+ get schema() {
19946
+ return {
19947
+ content: 'inline*',
19948
+ group: 'block',
19949
+ defining: true,
19950
+ isolating: true,
19951
+ attrs: Object.assign({}, getDefaultCustomAttrs()),
19952
+ parseDOM: [{ tag: 'summary' }],
19953
+ toDOM({ attrs }) {
19954
+ return ['summary', getCustomAttrs(attrs), 0];
19955
+ },
19956
+ };
19957
+ }
19958
+ }
19959
+
19891
19960
  ;// CONCATENATED MODULE: ./src/wysiwyg/specCreator.ts
19892
19961
 
19893
19962
 
@@ -19914,6 +19983,8 @@ class HTMLComment extends node_Node {
19914
19983
 
19915
19984
 
19916
19985
 
19986
+
19987
+
19917
19988
 
19918
19989
 
19919
19990
 
@@ -19946,6 +20017,8 @@ function createSpecs(linkAttributes) {
19946
20017
  new FrontMatter(),
19947
20018
  new Widget(),
19948
20019
  new HTMLComment(),
20020
+ new Details(),
20021
+ new Summary(),
19949
20022
  ]);
19950
20023
  }
19951
20024
 
@@ -21003,7 +21076,7 @@ const toWwConvertors = {
21003
21076
  const nodeType = state.schema.nodes[typeName];
21004
21077
  const sanitizedHTML = sanitizeHTML(html);
21005
21078
  // for user defined html schema
21006
- if (nodeType === null || nodeType === void 0 ? void 0 : nodeType.spec.attrs.htmlBlock) {
21079
+ if ((nodeType === null || nodeType === void 0 ? void 0 : nodeType.spec.attrs.htmlBlock) && nodeType.spec.atom) {
21007
21080
  const htmlAttrs = getHTMLAttrsByHTMLString(sanitizedHTML);
21008
21081
  const childrenHTML = getChildrenHTML(node, typeName);
21009
21082
  state.addNode(nodeType, { htmlAttrs, childrenHTML });
@@ -21254,6 +21327,12 @@ const nodeTypeWriters = {
21254
21327
  state.write(' \n');
21255
21328
  },
21256
21329
  paragraph(state, { node, parent, index = 0 }) {
21330
+ if (parent && parent.type.name === 'details') {
21331
+ state.write('<p>');
21332
+ state.convertInline(node);
21333
+ state.write('</p>');
21334
+ return;
21335
+ }
21257
21336
  if (state.stopNewline) {
21258
21337
  state.convertInline(node);
21259
21338
  }
@@ -21412,6 +21491,24 @@ const nodeTypeWriters = {
21412
21491
  state.write(text);
21413
21492
  state.closeBlock(node);
21414
21493
  },
21494
+ details(state, { node }) {
21495
+ const attrs = node.attrs.htmlAttrs || {};
21496
+ const openTag = attrs.open !== null && typeof attrs.open !== 'undefined'
21497
+ ? '<details open="">'
21498
+ : '<details>';
21499
+ state.write(`${openTag}\n`);
21500
+ state.stopNewline = true;
21501
+ state.convertNode(node);
21502
+ state.write('</details>');
21503
+ state.stopNewline = false;
21504
+ state.closeBlock(node);
21505
+ },
21506
+ summary(state, { node }) {
21507
+ state.write('<summary>');
21508
+ state.convertInline(node);
21509
+ state.write('</summary>');
21510
+ state.closeBlock(node);
21511
+ },
21415
21512
  };
21416
21513
  function write(type, { state, nodeInfo, params, }) {
21417
21514
  const { rawHTML } = params;
@@ -21759,6 +21856,7 @@ function createMarkTypeConvertors(convertors) {
21759
21856
  function createMdConvertors(customConvertors) {
21760
21857
  const customConvertorTypes = Object.keys(customConvertors);
21761
21858
  customConvertorTypes.forEach((type) => {
21859
+ console.log('[DEBUG] custom convertor for:', type);
21762
21860
  const baseConvertor = toMdConvertors[type];
21763
21861
  const customConvertor = customConvertors[type];
21764
21862
  if (baseConvertor) {
@@ -21895,7 +21993,9 @@ class ToMdConvertorState {
21895
21993
  // I must modify `convertNode` to pass it, or store it.
21896
21994
  // Storing it in the instance is cleanest given the recursion.
21897
21995
  // I need to add `infoForPosSync` to the class.
21898
- if (node.attrs.htmlBlock) {
21996
+ // Skip htmlBlock fallback for details/summary to use their custom writers
21997
+ const skipHtmlBlockTypes = ['details', 'summary'];
21998
+ if (node.attrs.htmlBlock && !skipHtmlBlockTypes.includes(type)) {
21899
21999
  this.nodeTypeConvertors.html(this, nodeInfo);
21900
22000
  }
21901
22001
  else if (convertor) {
@@ -22472,11 +22572,32 @@ const tokenToDOMNode = {
22472
22572
  }
22473
22573
  },
22474
22574
  html(token, stack) {
22475
- last(stack).insertAdjacentHTML('beforeend', token.content);
22575
+ const parent = last(stack);
22576
+ if (parent) {
22577
+ parent.insertAdjacentHTML('beforeend', token.content);
22578
+ }
22579
+ else {
22580
+ const html = token.content;
22581
+ const container = document.createElement('div');
22582
+ container.innerHTML = html;
22583
+ let child = container.firstChild;
22584
+ if (!child) {
22585
+ child = document.createElement('span');
22586
+ }
22587
+ else if (child.nodeType === Node.TEXT_NODE) {
22588
+ const wrapper = document.createElement('span');
22589
+ wrapper.appendChild(child);
22590
+ child = wrapper;
22591
+ }
22592
+ stack.push(child);
22593
+ }
22476
22594
  },
22477
22595
  text(token, stack) {
22478
22596
  const textNode = document.createTextNode(token.content);
22479
- last(stack).appendChild(textNode);
22597
+ const parent = last(stack);
22598
+ if (parent) {
22599
+ parent.appendChild(textNode);
22600
+ }
22480
22601
  },
22481
22602
  };
22482
22603
  class WwToDOMAdaptor {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@licium/editor",
3
- "version": "3.2.7",
3
+ "version": "3.2.9",
4
4
  "description": "GFM Markdown Wysiwyg Editor - Productive and Extensible",
5
5
  "keywords": [
6
6
  "nhn",
@@ -91,5 +91,5 @@
91
91
  "prosemirror-state": "^1.3.4",
92
92
  "prosemirror-view": "^1.18.7"
93
93
  },
94
- "gitHead": "355b7f775d32024933020ad10610f4b646b68350"
94
+ "gitHead": "cbc7cab7b3f081a1aaf1d338b8138512ace132b9"
95
95
  }
package/types/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Type definitions for TOAST UI Editor v3.2.6
1
+ // Type definitions for TOAST UI Editor v3.2.8
2
2
  // TypeScript Version: 4.2.3
3
3
  import {
4
4
  EditorCore,
@@ -24,7 +24,9 @@ export type WwNodeType =
24
24
  | 'frontMatter'
25
25
  | 'widget'
26
26
  | 'html'
27
- | 'htmlComment';
27
+ | 'htmlComment'
28
+ | 'details'
29
+ | 'summary';
28
30
 
29
31
  export type WwMarkType = 'strong' | 'emph' | 'strike' | 'link' | 'code' | 'html';
30
32
 
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2020 NHN Cloud Corp.
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
@@ -1 +0,0 @@
1
- import '@/i18n/en-us';
@@ -1 +0,0 @@
1
- import '@/i18n/en-us';
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- import '@/i18n/en-us';
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,7 +0,0 @@
1
- import MarkdownEditor from '@/markdown/mdEditor';
2
- export declare function getTextContent(editor: MarkdownEditor): string;
3
- export declare function removeDataAttr(html: string): string;
4
- export declare function createHTMLrenderer(): Partial<Record<string, import("@toast-ui/toastmark").HTMLConvertor>>;
5
- export declare class TestEditorWithNoneDelayHistory extends MarkdownEditor {
6
- get defaultPlugins(): import("prosemirror-state").Plugin<any>[];
7
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};