@sveltia/ui 0.23.2 → 0.24.1
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/dist/components/listbox/listbox.svelte +1 -1
- package/dist/components/listbox/option.svelte +7 -2
- package/dist/components/text-editor/code-editor.svelte +121 -0
- package/dist/components/text-editor/code-editor.svelte.d.ts +106 -0
- package/dist/components/text-editor/core.d.ts +3 -4
- package/dist/components/text-editor/core.js +78 -33
- package/dist/components/text-editor/lexical-root.svelte +42 -19
- package/dist/components/text-editor/lexical-root.svelte.d.ts +1 -9
- package/dist/components/text-editor/store.svelte.d.ts +1 -0
- package/dist/components/text-editor/store.svelte.js +120 -0
- package/dist/components/text-editor/text-editor.svelte +21 -86
- package/dist/components/text-editor/toolbar/code-editor-toolbar.svelte +28 -0
- package/dist/components/text-editor/toolbar/{editor-toolbar.svelte.d.ts → code-editor-toolbar.svelte.d.ts} +3 -3
- package/dist/components/text-editor/toolbar/code-language-switcher.svelte +96 -0
- package/dist/components/text-editor/toolbar/code-language-switcher.svelte.d.ts +17 -0
- package/dist/components/text-editor/toolbar/format-text-button.svelte +10 -10
- package/dist/components/text-editor/toolbar/insert-image-button.svelte +5 -8
- package/dist/components/text-editor/toolbar/insert-link-button.svelte +27 -25
- package/dist/components/text-editor/toolbar/insert-menu-button.svelte +4 -7
- package/dist/components/text-editor/toolbar/{editor-toolbar.svelte → text-editor-toolbar.svelte} +59 -87
- package/dist/components/text-editor/toolbar/text-editor-toolbar.svelte.d.ts +37 -0
- package/dist/components/text-editor/toolbar/toggle-block-menu-item.svelte +14 -17
- package/dist/components/text-editor/toolbar/toolbar-wrapper.svelte +58 -0
- package/dist/components/text-editor/toolbar/toolbar-wrapper.svelte.d.ts +37 -0
- package/dist/components/util/app-shell.svelte +2 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/locales/en.d.ts +3 -0
- package/dist/locales/en.js +3 -0
- package/dist/locales/ja.d.ts +3 -0
- package/dist/locales/ja.js +3 -0
- package/dist/styles/variables.scss +2 -2
- package/dist/typedefs.d.ts +59 -26
- package/dist/typedefs.js +26 -13
- package/package.json +7 -7
package/dist/typedefs.js
CHANGED
|
@@ -239,23 +239,36 @@
|
|
|
239
239
|
*/
|
|
240
240
|
|
|
241
241
|
/**
|
|
242
|
-
* @typedef {object}
|
|
243
|
-
* @property {import('svelte/store').Writable<import('lexical').LexicalEditor>} editor - Lexical
|
|
244
|
-
* editor instance.
|
|
245
|
-
* @property {import('svelte/store').Writable<string>} editorId - Random ID assigned to the editor.
|
|
246
|
-
* @property {import('svelte/store').Writable<TextEditorBlockType>} selectionBlockType - Block level
|
|
247
|
-
* type of the current selection.
|
|
248
|
-
* @property {import('svelte/store').Writable<TextEditorInlineType[]>} selectionInlineTypes - Inline
|
|
249
|
-
* level types of the current selection.
|
|
242
|
+
* @typedef {object} TextEditorConfig
|
|
250
243
|
* @property {TextEditorMode[]} modes - Enabled modes.
|
|
251
|
-
* @property {import('svelte/store').Writable<boolean>} useRichText - Whether to use rich text mode.
|
|
252
|
-
* If `false`, the editor shows the plain text editor.
|
|
253
|
-
* @property {import('svelte/store').Writable<boolean>} hasConverterError - `true` if there was an
|
|
254
|
-
* error while converting Markdown to Lexical nodes.
|
|
255
244
|
* @property {(TextEditorBlockType | TextEditorInlineType)[]} enabledButtons - Enabled buttons for
|
|
256
245
|
* the editor.
|
|
257
246
|
* @property {TextEditorComponent[]} components - Editor components.
|
|
258
|
-
* @property {
|
|
247
|
+
* @property {boolean} isCodeEditor - Whether the editor is used as a code editor.
|
|
248
|
+
* @property {string} [defaultLanguage] - Default language for the code editor.
|
|
249
|
+
*/
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* @typedef {object} TextEditorSelectionState
|
|
253
|
+
* @property {?string} blockNodeKey - Block level node key.
|
|
254
|
+
* @property {TextEditorBlockType} blockType - Block level type of the current selection.
|
|
255
|
+
* @property {TextEditorInlineType[]} inlineTypes - Inline level types of the current selection.
|
|
256
|
+
*/
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* @typedef {object} TextEditorStore
|
|
260
|
+
* @property {import('lexical').LexicalEditor | undefined} editor - Lexical editor instance.
|
|
261
|
+
* @property {boolean} initialized - Whether the Lexical editor is initialized.
|
|
262
|
+
* @property {string} editorId - Random ID assigned to the editor.
|
|
263
|
+
* @property {TextEditorConfig} config - Editor configuration.
|
|
264
|
+
* @property {string} inputValue - Value entered the Lexical editor.
|
|
265
|
+
* @property {TextEditorSelectionState} selection - Current selection state.
|
|
266
|
+
* @property {boolean} useRichText - Whether to use rich text mode. If `false`, the editor shows the
|
|
267
|
+
* plain text editor.
|
|
268
|
+
* @property {boolean} hasConverterError - Whether there was an error while converting Markdown to
|
|
269
|
+
* Lexical nodes.
|
|
270
|
+
* @property {boolean} showConverterError - Whether to show a converter error in the UI.
|
|
271
|
+
* @property {() => Promise<void>} convertMarkdown - Function to trigger the Lexical converter.
|
|
259
272
|
*/
|
|
260
273
|
|
|
261
274
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sveltia/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.24.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@playwright/test": "^1.50.1",
|
|
50
50
|
"@sveltejs/adapter-auto": "^4.0.0",
|
|
51
|
-
"@sveltejs/kit": "^2.17.
|
|
51
|
+
"@sveltejs/kit": "^2.17.2",
|
|
52
52
|
"@sveltejs/package": "^2.3.10",
|
|
53
53
|
"@sveltejs/vite-plugin-svelte": "5.0.3",
|
|
54
54
|
"cspell": "^8.17.3",
|
|
@@ -58,21 +58,21 @@
|
|
|
58
58
|
"eslint-plugin-import": "^2.31.0",
|
|
59
59
|
"eslint-plugin-jsdoc": "^50.6.3",
|
|
60
60
|
"eslint-plugin-svelte": "^2.46.1",
|
|
61
|
-
"postcss": "^8.5.
|
|
61
|
+
"postcss": "^8.5.2",
|
|
62
62
|
"postcss-html": "^1.8.0",
|
|
63
|
-
"prettier": "^3.5.
|
|
63
|
+
"prettier": "^3.5.1",
|
|
64
64
|
"prettier-plugin-svelte": "^3.3.3",
|
|
65
|
-
"sass": "^1.
|
|
65
|
+
"sass": "^1.85.0",
|
|
66
66
|
"stylelint": "^16.14.1",
|
|
67
67
|
"stylelint-config-recommended-scss": "^14.1.0",
|
|
68
68
|
"stylelint-scss": "^6.11.0",
|
|
69
|
-
"svelte": "5.
|
|
69
|
+
"svelte": "5.20.2",
|
|
70
70
|
"svelte-check": "^4.1.4",
|
|
71
71
|
"svelte-i18n": "^4.0.1",
|
|
72
72
|
"svelte-preprocess": "^6.0.3",
|
|
73
73
|
"tslib": "^2.8.1",
|
|
74
74
|
"vite": "^6.1.0",
|
|
75
|
-
"vitest": "^3.0.
|
|
75
|
+
"vitest": "^3.0.6"
|
|
76
76
|
},
|
|
77
77
|
"exports": {
|
|
78
78
|
".": {
|