@sveltia/ui 0.90.0 → 0.91.0

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 (75) hide show
  1. package/dist/components/text-editor/constants.d.ts +40 -6
  2. package/dist/components/text-editor/constants.js +81 -7
  3. package/dist/components/text-editor/conversion/html/components.d.ts +16 -0
  4. package/dist/components/text-editor/conversion/html/components.js +87 -0
  5. package/dist/components/text-editor/conversion/html/export.d.ts +10 -0
  6. package/dist/components/text-editor/conversion/html/export.js +360 -0
  7. package/dist/components/text-editor/conversion/html/import-rules.d.ts +12 -0
  8. package/dist/components/text-editor/conversion/html/import-rules.js +234 -0
  9. package/dist/components/text-editor/conversion/html/index.d.ts +10 -0
  10. package/dist/components/text-editor/conversion/html/index.js +33 -0
  11. package/dist/components/text-editor/conversion/html/paragraph.d.ts +1 -0
  12. package/dist/components/text-editor/conversion/html/paragraph.js +123 -0
  13. package/dist/components/text-editor/conversion/html/task-list.d.ts +13 -0
  14. package/dist/components/text-editor/conversion/html/task-list.js +82 -0
  15. package/dist/components/text-editor/conversion/html/unsupported.d.ts +2 -0
  16. package/dist/components/text-editor/conversion/html/unsupported.js +122 -0
  17. package/dist/components/text-editor/conversion/html/utils.d.ts +6 -0
  18. package/dist/components/text-editor/conversion/html/utils.js +34 -0
  19. package/dist/components/text-editor/conversion/import.js +1 -1
  20. package/dist/components/text-editor/conversion/transformers/task-list.d.ts +24 -0
  21. package/dist/components/text-editor/conversion/transformers/task-list.js +53 -0
  22. package/dist/components/text-editor/conversion/update.js +1 -1
  23. package/dist/components/text-editor/core.js +4 -12
  24. package/dist/components/text-editor/editing/commands.js +9 -18
  25. package/dist/components/text-editor/editing/guards.d.ts +7 -0
  26. package/dist/components/text-editor/editing/guards.js +123 -0
  27. package/dist/components/text-editor/editing/raw-markdown.d.ts +4 -2
  28. package/dist/components/text-editor/editing/raw-markdown.js +22 -6
  29. package/dist/components/text-editor/editing/selection.js +6 -2
  30. package/dist/components/text-editor/lexical-root.svelte +40 -0
  31. package/dist/components/text-editor/shiki/version.d.ts +1 -1
  32. package/dist/components/text-editor/shiki/version.js +1 -1
  33. package/dist/components/text-editor/text-editor.svelte +7 -4
  34. package/dist/components/text-editor/text-editor.svelte.d.ts +4 -2
  35. package/dist/components/text-editor/toolbar/format-text-button.svelte +7 -1
  36. package/dist/components/text-editor/toolbar/text-editor-toolbar.svelte +19 -8
  37. package/dist/components/text-editor/toolbar/toggle-block-menu-item.svelte +7 -14
  38. package/dist/locales/ar.yaml +2 -0
  39. package/dist/locales/bg.yaml +2 -0
  40. package/dist/locales/ca.yaml +2 -0
  41. package/dist/locales/cs.yaml +2 -0
  42. package/dist/locales/da.yaml +2 -0
  43. package/dist/locales/de.yaml +2 -0
  44. package/dist/locales/el.yaml +2 -0
  45. package/dist/locales/en-CA.yaml +2 -0
  46. package/dist/locales/en-GB.yaml +2 -0
  47. package/dist/locales/en-US.yaml +2 -0
  48. package/dist/locales/en-ZA.yaml +2 -0
  49. package/dist/locales/es-CO.yaml +2 -0
  50. package/dist/locales/es-ES.yaml +2 -0
  51. package/dist/locales/fa.yaml +2 -0
  52. package/dist/locales/fi.yaml +2 -0
  53. package/dist/locales/fr.yaml +2 -0
  54. package/dist/locales/he.yaml +2 -0
  55. package/dist/locales/hr.yaml +2 -0
  56. package/dist/locales/it.yaml +2 -0
  57. package/dist/locales/ja.yaml +2 -0
  58. package/dist/locales/ko.yaml +2 -0
  59. package/dist/locales/nl.yaml +2 -0
  60. package/dist/locales/pl.yaml +2 -0
  61. package/dist/locales/pt-BR.yaml +2 -0
  62. package/dist/locales/pt-PT.yaml +2 -0
  63. package/dist/locales/ru.yaml +2 -0
  64. package/dist/locales/sk.yaml +2 -0
  65. package/dist/locales/sv.yaml +2 -0
  66. package/dist/locales/tr.yaml +2 -0
  67. package/dist/locales/uk.yaml +2 -0
  68. package/dist/locales/vi.yaml +2 -0
  69. package/dist/locales/zh-CN.yaml +2 -0
  70. package/dist/locales/zh-TW.yaml +2 -0
  71. package/dist/typedefs.d.ts +5 -2
  72. package/dist/typedefs.js +3 -2
  73. package/package.json +5 -5
  74. package/dist/components/text-editor/conversion/html.d.ts +0 -30
  75. package/dist/components/text-editor/conversion/html.js +0 -857
@@ -118,11 +118,13 @@ text_editor:
118
118
  heading_6: Encabezado 6
119
119
  bulleted_list: Lista con viñetas
120
120
  numbered_list: Lista numerada
121
+ task_list: Lista de tareas
121
122
  blockquote: Cita
122
123
  code_block: Bloque de código
123
124
  # Inline style button aria-labels
124
125
  bold: Negrita
125
126
  italic: Cursiva
127
+ underline: Subrayado
126
128
  strikethrough: Tachado
127
129
  code: Código
128
130
  link: Enlace
@@ -118,11 +118,13 @@ text_editor:
118
118
  heading_6: سرتیتر ۶
119
119
  bulleted_list: فهرست نشانه‌دار
120
120
  numbered_list: فهرست شماره‌دار
121
+ task_list: فهرست کارها
121
122
  blockquote: نقل‌قول
122
123
  code_block: بلوک کد
123
124
  # Inline style button aria-labels
124
125
  bold: ضخیم
125
126
  italic: مورب
127
+ underline: زیرخط
126
128
  strikethrough: خط‌خورده
127
129
  code: کد
128
130
  link: پیوند
@@ -118,11 +118,13 @@ text_editor:
118
118
  heading_6: Otsikko 6
119
119
  bulleted_list: Luettelomerkitty luettelo
120
120
  numbered_list: Numeroitu luettelo
121
+ task_list: Tehtäväluettelo
121
122
  blockquote: Lainaus
122
123
  code_block: Koodilohko
123
124
  # Inline style button aria-labels
124
125
  bold: Lihavointi
125
126
  italic: Kursivointi
127
+ underline: Alleviivaus
126
128
  strikethrough: Yliviivaus
127
129
  code: Koodi
128
130
  link: Linkki
@@ -118,11 +118,13 @@ text_editor:
118
118
  heading_6: Titre 6
119
119
  bulleted_list: Liste à puces
120
120
  numbered_list: Liste numérotée
121
+ task_list: Liste de tâches
121
122
  blockquote: Citation
122
123
  code_block: Bloc de code
123
124
  # Inline style button aria-labels
124
125
  bold: Gras
125
126
  italic: Italique
127
+ underline: Souligné
126
128
  strikethrough: Barré
127
129
  code: Code
128
130
  link: Lien
@@ -123,11 +123,13 @@ text_editor:
123
123
  heading_6: כותרת 6
124
124
  bulleted_list: רשימת תבליטים
125
125
  numbered_list: רשימה ממוספרת
126
+ task_list: רשימת משימות
126
127
  blockquote: ציטוט
127
128
  code_block: קטע קוד
128
129
  # Inline style button aria-labels
129
130
  bold: הדגשה
130
131
  italic: הטיה
132
+ underline: קו תחתון
131
133
  strikethrough: קו חוצה
132
134
  code: קוד
133
135
  link: קישור
@@ -118,11 +118,13 @@ text_editor:
118
118
  heading_6: Naslov 6
119
119
  bulleted_list: Popis s grafičkim oznakama
120
120
  numbered_list: Numerirani popis
121
+ task_list: Popis zadataka
121
122
  blockquote: Citat
122
123
  code_block: Blok koda
123
124
  # Inline style button aria-labels
124
125
  bold: Podebljano
125
126
  italic: Kurziv
127
+ underline: Podcrtano
126
128
  strikethrough: Precrtano
127
129
  code: Kod
128
130
  link: Poveznica
@@ -118,11 +118,13 @@ text_editor:
118
118
  heading_6: Titolo 6
119
119
  bulleted_list: Elenco Puntato
120
120
  numbered_list: Elenco Numerato
121
+ task_list: Elenco Attività
121
122
  blockquote: Citazione
122
123
  code_block: Blocco di Codice
123
124
  # Inline style button aria-labels
124
125
  bold: Grassetto
125
126
  italic: Corsivo
127
+ underline: Sottolineato
126
128
  strikethrough: Barrato
127
129
  code: Codice
128
130
  link: Link
@@ -118,11 +118,13 @@ text_editor:
118
118
  heading_6: 見出し 6
119
119
  bulleted_list: 番号なしリスト
120
120
  numbered_list: 番号付きリスト
121
+ task_list: タスクリスト
121
122
  blockquote: ブロック引用
122
123
  code_block: コードブロック
123
124
  # Inline style button aria-labels
124
125
  bold: 太字
125
126
  italic: 斜体
127
+ underline: 下線
126
128
  strikethrough: 取り消し線
127
129
  code: コード
128
130
  link: リンク
@@ -118,11 +118,13 @@ text_editor:
118
118
  heading_6: 제목 6
119
119
  bulleted_list: 글머리 기호 목록
120
120
  numbered_list: 번호 매기기 목록
121
+ task_list: 할 일 목록
121
122
  blockquote: 인용 블록
122
123
  code_block: 코드 블록
123
124
  # Inline style button aria-labels
124
125
  bold: 굵게
125
126
  italic: 기울임꼴
127
+ underline: 밑줄
126
128
  strikethrough: 취소선
127
129
  code: 코드
128
130
  link: 링크
@@ -118,11 +118,13 @@ text_editor:
118
118
  heading_6: Kop 6
119
119
  bulleted_list: Opsommingslijst
120
120
  numbered_list: Genummerde lijst
121
+ task_list: Takenlijst
121
122
  blockquote: Citaatblok
122
123
  code_block: Codeblok
123
124
  # Inline style button aria-labels
124
125
  bold: Vet
125
126
  italic: Cursief
127
+ underline: Onderstrepen
126
128
  strikethrough: Doorhalen
127
129
  code: Code
128
130
  link: Link
@@ -118,11 +118,13 @@ text_editor:
118
118
  heading_6: Nagłówek 6
119
119
  bulleted_list: Lista punktowana
120
120
  numbered_list: Lista numerowana
121
+ task_list: Lista zadań
121
122
  blockquote: Cytat blokowy
122
123
  code_block: Blok kodu
123
124
  # Inline style button aria-labels
124
125
  bold: Pogrubienie
125
126
  italic: Kursywa
127
+ underline: Podkreślenie
126
128
  strikethrough: Przekreślenie
127
129
  code: Kod
128
130
  link: Odnośnik
@@ -118,11 +118,13 @@ text_editor:
118
118
  heading_6: Título 6
119
119
  bulleted_list: Lista com marcadores
120
120
  numbered_list: Lista numerada
121
+ task_list: Lista de tarefas
121
122
  blockquote: Citação
122
123
  code_block: Bloco de código
123
124
  # Inline style button aria-labels
124
125
  bold: Negrito
125
126
  italic: Itálico
127
+ underline: Sublinhado
126
128
  strikethrough: Tachado
127
129
  code: Código
128
130
  link: Link
@@ -118,11 +118,13 @@ text_editor:
118
118
  heading_6: Título 6
119
119
  bulleted_list: Lista com marcas
120
120
  numbered_list: Lista numerada
121
+ task_list: Lista de tarefas
121
122
  blockquote: Citação
122
123
  code_block: Bloco de código
123
124
  # Inline style button aria-labels
124
125
  bold: Negrito
125
126
  italic: Itálico
127
+ underline: Sublinhado
126
128
  strikethrough: Rasurado
127
129
  code: Código
128
130
  link: Ligação
@@ -118,11 +118,13 @@ text_editor:
118
118
  heading_6: Заголовок 6
119
119
  bulleted_list: Маркированный список
120
120
  numbered_list: Нумерованный список
121
+ task_list: Список задач
121
122
  blockquote: Цитата
122
123
  code_block: Блок кода
123
124
  # Inline style button aria-labels
124
125
  bold: Полужирный
125
126
  italic: Курсив
127
+ underline: Подчёркнутый
126
128
  strikethrough: Зачёркнутый
127
129
  code: Код
128
130
  link: Ссылка
@@ -118,11 +118,13 @@ text_editor:
118
118
  heading_6: Nadpis 6
119
119
  bulleted_list: Zoznam s odrážkami
120
120
  numbered_list: Číslovaný zoznam
121
+ task_list: Zoznam úloh
121
122
  blockquote: Citácia
122
123
  code_block: Blok kódu
123
124
  # Inline style button aria-labels
124
125
  bold: Tučné
125
126
  italic: Kurzíva
127
+ underline: Podčiarknuté
126
128
  strikethrough: Prečiarknuté
127
129
  code: Kód
128
130
  link: Odkaz
@@ -118,11 +118,13 @@ text_editor:
118
118
  heading_6: Rubrik 6
119
119
  bulleted_list: Punktlista
120
120
  numbered_list: Numrerad lista
121
+ task_list: Uppgiftslista
121
122
  blockquote: Blockcitat
122
123
  code_block: Kodblock
123
124
  # Inline style button aria-labels
124
125
  bold: Fet
125
126
  italic: Kursiv
127
+ underline: Understruken
126
128
  strikethrough: Genomstruken
127
129
  code: Kod
128
130
  link: Länk
@@ -118,11 +118,13 @@ text_editor:
118
118
  heading_6: Başlık 6
119
119
  bulleted_list: Madde İşaretli Liste
120
120
  numbered_list: Numaralı Liste
121
+ task_list: Görev Listesi
121
122
  blockquote: Alıntı
122
123
  code_block: Kod Bloğu
123
124
  # Inline style button aria-labels
124
125
  bold: Kalın
125
126
  italic: İtalik
127
+ underline: Altı Çizili
126
128
  strikethrough: Üstü Çizili
127
129
  code: Kod
128
130
  link: Bağlantı
@@ -118,11 +118,13 @@ text_editor:
118
118
  heading_6: Заголовок 6
119
119
  bulleted_list: Маркований список
120
120
  numbered_list: Нумерований список
121
+ task_list: Список завдань
121
122
  blockquote: Цитата
122
123
  code_block: Блок коду
123
124
  # Inline style button aria-labels
124
125
  bold: Жирний
125
126
  italic: Курсив
127
+ underline: Підкреслений
126
128
  strikethrough: Закреслений
127
129
  code: Код
128
130
  link: Посилання
@@ -118,11 +118,13 @@ text_editor:
118
118
  heading_6: Tiêu đề 6
119
119
  bulleted_list: Dấu đầu dòng
120
120
  numbered_list: Đánh số
121
+ task_list: Danh sách công việc
121
122
  blockquote: Trích dẫn
122
123
  code_block: Khối mã
123
124
  # Inline style button aria-labels
124
125
  bold: In đậm
125
126
  italic: In nghiêng
127
+ underline: Gạch chân
126
128
  strikethrough: Gạch ngang
127
129
  code: Mã
128
130
  link: Liên kết
@@ -118,11 +118,13 @@ text_editor:
118
118
  heading_6: 六级标题
119
119
  bulleted_list: 无序列表
120
120
  numbered_list: 有序列表
121
+ task_list: 任务列表
121
122
  blockquote: 引用块
122
123
  code_block: 代码块
123
124
  # Inline style button aria-labels
124
125
  bold: 加粗
125
126
  italic: 斜体
127
+ underline: 下划线
126
128
  strikethrough: 删除线
127
129
  code: 代码
128
130
  link: 链接
@@ -118,11 +118,13 @@ text_editor:
118
118
  heading_6: 標題 6
119
119
  bulleted_list: 項目符號清單
120
120
  numbered_list: 編號清單
121
+ task_list: 待辦清單
121
122
  blockquote: 引言區塊
122
123
  code_block: 程式碼區塊
123
124
  # Inline style button aria-labels
124
125
  bold: 粗體
125
126
  italic: 斜體
127
+ underline: 底線
126
128
  strikethrough: 刪除線
127
129
  code: 程式碼
128
130
  link: 連結
@@ -750,8 +750,11 @@ export type InputEventHandlers = {
750
750
  };
751
751
  export type PopupPosition = ("top-left" | "top-right" | "right-top" | "right-bottom" | "bottom-left" | "bottom-right" | "left-top" | "left-bottom");
752
752
  export type ToastPosition = "auto" | "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right";
753
- export type TextEditorBlockType = "paragraph" | "heading-1" | "heading-2" | "heading-3" | "heading-4" | "heading-5" | "heading-6" | "bulleted-list" | "numbered-list" | "blockquote" | "code-block";
754
- export type TextEditorFormatType = "bold" | "italic" | "strikethrough" | "code";
753
+ export type TextEditorBlockType = "paragraph" | "heading-1" | "heading-2" | "heading-3" | "heading-4" | "heading-5" | "heading-6" | "bulleted-list" | "numbered-list" | "task-list" | "blockquote" | "code-block";
754
+ /**
755
+ * Inline text format. `underline` is only available for HTML, as Markdown has no syntax for it.
756
+ */
757
+ export type TextEditorFormatType = "bold" | "italic" | "underline" | "strikethrough" | "code";
755
758
  export type TextEditorInlineType = TextEditorFormatType | "link";
756
759
  export type TextEditorNodeType = TextEditorBlockType | TextEditorInlineType | "table" | "horizontal-rule" | "align";
757
760
  export type TextEditorMode = "rich-text" | "plain-text";
package/dist/typedefs.js CHANGED
@@ -302,12 +302,13 @@
302
302
 
303
303
  /**
304
304
  * @typedef {'paragraph' | 'heading-1' | 'heading-2' | 'heading-3' | 'heading-4' | 'heading-5' |
305
- * 'heading-6' | 'bulleted-list' | 'numbered-list' | 'blockquote' | 'code-block'}
305
+ * 'heading-6' | 'bulleted-list' | 'numbered-list' | 'task-list' | 'blockquote' | 'code-block'}
306
306
  * TextEditorBlockType
307
307
  */
308
308
 
309
309
  /**
310
- * @typedef {'bold' | 'italic' | 'strikethrough' | 'code'} TextEditorFormatType
310
+ * Inline text format. `underline` is only available for HTML, as Markdown has no syntax for it.
311
+ * @typedef {'bold' | 'italic' | 'underline' | 'strikethrough' | 'code'} TextEditorFormatType
311
312
  */
312
313
 
313
314
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sveltia/ui",
3
- "version": "0.90.0",
3
+ "version": "0.91.0",
4
4
  "description": "A collection of Svelte components and utilities for building user interfaces.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -76,20 +76,20 @@
76
76
  "@sveltejs/vite-plugin-svelte": "^7.3.1",
77
77
  "@vitest/browser-playwright": "^5.1.0",
78
78
  "@vitest/coverage-v8": "^5.1.0",
79
- "cspell": "^10.4.1",
79
+ "cspell": "^10.5.1",
80
80
  "eslint": "^9.39.5",
81
81
  "eslint-config-airbnb-extended": "^3.3.0",
82
82
  "eslint-config-prettier": "^10.1.8",
83
83
  "eslint-plugin-import": "^2.32.0",
84
- "eslint-plugin-jsdoc": "^65.4.5",
84
+ "eslint-plugin-jsdoc": "^65.4.7",
85
85
  "eslint-plugin-package-json": "^1.14.0",
86
86
  "eslint-plugin-svelte": "^3.24.1",
87
87
  "globals": "^17.14.0",
88
88
  "happy-dom": "^21.0.4",
89
89
  "jscpd": "^5.4.3",
90
90
  "oxlint": "^1.93.0",
91
- "playwright": "^1.65.0",
92
- "postcss": "^8.5.32",
91
+ "playwright": "^1.65.1",
92
+ "postcss": "^8.5.33",
93
93
  "postcss-html": "^2.0.0",
94
94
  "prettier": "^3.10.1",
95
95
  "prettier-plugin-svelte": "^4.1.1",
@@ -1,30 +0,0 @@
1
- export function getCodeLanguage(code: Element): string | undefined;
2
- /**
3
- * Map of Lexical node classes and functions to export them to clean HTML. A class only takes effect
4
- * if the node is registered with the editor. Other nodes, including the ones of editor components,
5
- * are exported with their own `exportDOM` method.
6
- * @type {DOMExportOutputMap}
7
- */
8
- export const HTML_EXPORT_MAP: DOMExportOutputMap;
9
- /**
10
- * Editor components of each editor, used to tell the elements they import, which come with their
11
- * content, when HTML is imported.
12
- * @type {WeakMap<LexicalEditor, TextEditorComponent[]>}
13
- */
14
- export const editorComponents: WeakMap<LexicalEditor, TextEditorComponent[]>;
15
- /**
16
- * Additional DOM conversions to import HTML. They take priority over Lexical’s own conversions.
17
- * @type {DOMConversionMap}
18
- */
19
- export const HTML_IMPORT_MAP: DOMConversionMap;
20
- /**
21
- * Additional DOM conversions to import HTML with code blocks.
22
- * @type {DOMConversionMap}
23
- */
24
- export const HTML_CODE_IMPORT_MAP: DOMConversionMap;
25
- export function findUnsupportedNode(editor: LexicalEditor, dom: Document): Element | Comment | undefined;
26
- export function exportHtml(editor: LexicalEditor): string;
27
- import type { DOMExportOutputMap } from 'lexical';
28
- import type { LexicalEditor } from 'lexical';
29
- import type { TextEditorComponent } from '../../../typedefs.js';
30
- import type { DOMConversionMap } from 'lexical';