@sveltia/ui 0.89.3 → 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 (77) hide show
  1. package/dist/components/dialog/dialog.svelte +149 -9
  2. package/dist/components/text-editor/constants.d.ts +40 -6
  3. package/dist/components/text-editor/constants.js +81 -7
  4. package/dist/components/text-editor/conversion/html/components.d.ts +16 -0
  5. package/dist/components/text-editor/conversion/html/components.js +87 -0
  6. package/dist/components/text-editor/conversion/html/export.d.ts +10 -0
  7. package/dist/components/text-editor/conversion/html/export.js +360 -0
  8. package/dist/components/text-editor/conversion/html/import-rules.d.ts +12 -0
  9. package/dist/components/text-editor/conversion/html/import-rules.js +234 -0
  10. package/dist/components/text-editor/conversion/html/index.d.ts +10 -0
  11. package/dist/components/text-editor/conversion/html/index.js +33 -0
  12. package/dist/components/text-editor/conversion/html/paragraph.d.ts +1 -0
  13. package/dist/components/text-editor/conversion/html/paragraph.js +123 -0
  14. package/dist/components/text-editor/conversion/html/task-list.d.ts +13 -0
  15. package/dist/components/text-editor/conversion/html/task-list.js +82 -0
  16. package/dist/components/text-editor/conversion/html/unsupported.d.ts +2 -0
  17. package/dist/components/text-editor/conversion/html/unsupported.js +122 -0
  18. package/dist/components/text-editor/conversion/html/utils.d.ts +6 -0
  19. package/dist/components/text-editor/conversion/html/utils.js +34 -0
  20. package/dist/components/text-editor/conversion/import.js +1 -1
  21. package/dist/components/text-editor/conversion/transformers/task-list.d.ts +24 -0
  22. package/dist/components/text-editor/conversion/transformers/task-list.js +53 -0
  23. package/dist/components/text-editor/conversion/update.js +1 -1
  24. package/dist/components/text-editor/core.js +4 -12
  25. package/dist/components/text-editor/editing/commands.js +9 -18
  26. package/dist/components/text-editor/editing/guards.d.ts +7 -0
  27. package/dist/components/text-editor/editing/guards.js +123 -0
  28. package/dist/components/text-editor/editing/raw-markdown.d.ts +4 -2
  29. package/dist/components/text-editor/editing/raw-markdown.js +22 -6
  30. package/dist/components/text-editor/editing/selection.js +6 -2
  31. package/dist/components/text-editor/lexical-root.svelte +40 -0
  32. package/dist/components/text-editor/shiki/version.d.ts +1 -1
  33. package/dist/components/text-editor/shiki/version.js +1 -1
  34. package/dist/components/text-editor/text-editor.svelte +7 -4
  35. package/dist/components/text-editor/text-editor.svelte.d.ts +4 -2
  36. package/dist/components/text-editor/toolbar/format-text-button.svelte +7 -1
  37. package/dist/components/text-editor/toolbar/text-editor-toolbar.svelte +19 -8
  38. package/dist/components/text-editor/toolbar/toggle-block-menu-item.svelte +7 -14
  39. package/dist/components/util/modal.svelte +41 -12
  40. package/dist/locales/ar.yaml +2 -0
  41. package/dist/locales/bg.yaml +2 -0
  42. package/dist/locales/ca.yaml +2 -0
  43. package/dist/locales/cs.yaml +2 -0
  44. package/dist/locales/da.yaml +2 -0
  45. package/dist/locales/de.yaml +2 -0
  46. package/dist/locales/el.yaml +2 -0
  47. package/dist/locales/en-CA.yaml +2 -0
  48. package/dist/locales/en-GB.yaml +2 -0
  49. package/dist/locales/en-US.yaml +2 -0
  50. package/dist/locales/en-ZA.yaml +2 -0
  51. package/dist/locales/es-CO.yaml +2 -0
  52. package/dist/locales/es-ES.yaml +176 -0
  53. package/dist/locales/fa.yaml +2 -0
  54. package/dist/locales/fi.yaml +2 -0
  55. package/dist/locales/fr.yaml +2 -0
  56. package/dist/locales/he.yaml +2 -0
  57. package/dist/locales/hr.yaml +2 -0
  58. package/dist/locales/it.yaml +2 -0
  59. package/dist/locales/ja.yaml +2 -0
  60. package/dist/locales/ko.yaml +2 -0
  61. package/dist/locales/nl.yaml +2 -0
  62. package/dist/locales/pl.yaml +2 -0
  63. package/dist/locales/pt-BR.yaml +2 -0
  64. package/dist/locales/pt-PT.yaml +2 -0
  65. package/dist/locales/ru.yaml +2 -0
  66. package/dist/locales/sk.yaml +2 -0
  67. package/dist/locales/sv.yaml +2 -0
  68. package/dist/locales/tr.yaml +2 -0
  69. package/dist/locales/uk.yaml +2 -0
  70. package/dist/locales/vi.yaml +2 -0
  71. package/dist/locales/zh-CN.yaml +2 -0
  72. package/dist/locales/zh-TW.yaml +2 -0
  73. package/dist/typedefs.d.ts +33 -3
  74. package/dist/typedefs.js +19 -3
  75. package/package.json +13 -13
  76. package/dist/components/text-editor/conversion/html.d.ts +0 -30
  77. package/dist/components/text-editor/conversion/html.js +0 -719
package/dist/typedefs.js CHANGED
@@ -53,7 +53,13 @@
53
53
  * @property {'dialog' | 'alertdialog' | 'none'} [role] The `role` attribute on the `<dialog>`
54
54
  * element.
55
55
  * @property {boolean} [open] Whether to show the modal.
56
- * @property {boolean} [showBackdrop] Whether to show the backdrop.
56
+ * @property {boolean} [modal] Whether to show the `<dialog>` element as a modal, which makes the
57
+ * rest of the page `inert` until it’s closed. Default: `true`. If `false`, the page can still be
58
+ * scrolled and used while the dialog is open, and the Escape key only dismisses the dialog while
59
+ * the focus is within it. `lightDismiss` has no effect then, as clicks outside the content go to
60
+ * the page.
61
+ * @property {boolean} [showBackdrop] Whether to show the backdrop. Default: `false` on a bare
62
+ * modal; components built on it, like `<Dialog>`, may choose another.
57
63
  * @property {boolean} [lightDismiss] Whether to close the modal when the backdrop (outside of the
58
64
  * modal) is clicked.
59
65
  * @property {boolean} [escapeDismiss] Whether to close the modal when the Escape key is pressed.
@@ -85,6 +91,15 @@
85
91
  * @property {'x-small' | 'small' | 'medium' | 'large' | 'x-large'} [size] Width of the dialog.
86
92
  * @property {string} [class] The `class` attribute on the `<dialog>` element.
87
93
  * @property {boolean} [open] Whether to open the dialog.
94
+ * @property {boolean} [modal] Whether to open the dialog as a modal, which makes the rest of the
95
+ * page `inert` and dims it with a backdrop. Default: `true`. If `false`, the page can still be
96
+ * scrolled and used while the dialog is open, so the user can refer to it before answering.
97
+ * @property {boolean} [showBackdrop] Whether to dim the page behind the dialog. Default: the value
98
+ * of `modal`. A non-modal dialog can have one as well to make it stand out, while the page behind
99
+ * it can still be scrolled and used.
100
+ * @property {boolean} [movable] Whether the user can move the dialog around by dragging its header,
101
+ * so as to see what’s behind it. The dialog is kept within the viewport, and goes back to the
102
+ * center whenever it’s opened or the viewport is resized. Default: `false`.
88
103
  * @property {boolean} [showClose] Whether to show the Close button on the header.
89
104
  * @property {boolean} [showOk] Whether to show the OK button on the footer.
90
105
  * @property {boolean} [showCancel] Whether to show the Cancel button on the footer.
@@ -287,12 +302,13 @@
287
302
 
288
303
  /**
289
304
  * @typedef {'paragraph' | 'heading-1' | 'heading-2' | 'heading-3' | 'heading-4' | 'heading-5' |
290
- * 'heading-6' | 'bulleted-list' | 'numbered-list' | 'blockquote' | 'code-block'}
305
+ * 'heading-6' | 'bulleted-list' | 'numbered-list' | 'task-list' | 'blockquote' | 'code-block'}
291
306
  * TextEditorBlockType
292
307
  */
293
308
 
294
309
  /**
295
- * @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
296
312
  */
297
313
 
298
314
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sveltia/ui",
3
- "version": "0.89.3",
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",
@@ -70,40 +70,40 @@
70
70
  "@fontsource-variable/source-sans-3": "5.3.1",
71
71
  "@fontsource/noto-mono": "5.3.0",
72
72
  "@rollup/plugin-yaml": "^5.0.1",
73
- "@sveltejs/adapter-auto": "^8.0.0",
74
- "@sveltejs/kit": "^3.1.1",
73
+ "@sveltejs/adapter-auto": "^8.0.1",
74
+ "@sveltejs/kit": "^3.2.0",
75
75
  "@sveltejs/package": "^3.0.2",
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
- "prettier": "^3.9.10",
94
+ "prettier": "^3.10.1",
95
95
  "prettier-plugin-svelte": "^4.1.1",
96
- "rolldown": "^1.3.1",
97
- "sass": "^1.108.1",
96
+ "rolldown": "^1.3.2",
97
+ "sass": "^1.108.2",
98
98
  "shiki": "^4.6.0",
99
99
  "stylelint": "^18.0.0",
100
- "stylelint-config-recommended-scss": "^17.0.1",
101
- "stylelint-scss": "^7.4.0",
100
+ "stylelint-config-recommended-scss": "^18.0.0",
101
+ "stylelint-scss": "^7.5.0",
102
102
  "svelte": "^5.57.3",
103
103
  "svelte-check": "^4.7.8",
104
104
  "svelte-preprocess": "^6.0.5",
105
105
  "tslib": "^2.9.1",
106
- "vite": "^8.3.7",
106
+ "vite": "^8.3.8",
107
107
  "vitest": "^5.1.0",
108
108
  "vitest-browser-svelte": "^3.1.0"
109
109
  },
@@ -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';