@sveltia/ui 0.21.0 → 0.22.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/{package → dist}/components/button/button.svelte +1 -1
- package/{package → dist}/components/button/select-button-group.svelte +3 -0
- package/{package → dist}/components/calendar/calendar.svelte +1 -1
- package/{package → dist}/components/checkbox/checkbox.svelte +9 -2
- package/{package → dist}/components/grid/grid.svelte +1 -1
- package/{package → dist}/components/listbox/listbox.svelte +3 -0
- package/{package → dist}/components/menu/menu-button.svelte +1 -1
- package/{package → dist}/components/progressbar/progressbar.svelte +4 -1
- package/{package → dist}/components/radio/radio-group.svelte +9 -0
- package/{package → dist}/components/radio/radio.svelte +3 -3
- package/{package → dist}/components/select/combobox.svelte +6 -2
- package/{package → dist}/components/select/select-tags.svelte +1 -1
- package/{package → dist}/components/slider/slider.svelte +14 -7
- package/{package → dist}/components/switch/switch.svelte +4 -1
- package/{package → dist}/components/tabs/tab-list.svelte +1 -1
- package/{package → dist}/components/text-editor/core.js +79 -5
- package/{package → dist}/components/text-editor/index.js +6 -0
- package/dist/components/text-editor/lexical-root.svelte +288 -0
- package/{package → dist}/components/text-editor/text-editor.svelte +7 -5
- package/{package → dist}/components/text-editor/toolbar/toggle-block-menu-item.svelte +7 -0
- package/{package → dist}/components/text-field/number-input.svelte +31 -16
- package/{package → dist}/components/text-field/number-input.svelte.d.ts +8 -0
- package/{package → dist}/components/text-field/password-input.svelte +1 -0
- package/{package → dist}/components/text-field/password-input.svelte.d.ts +8 -0
- package/{package → dist}/components/text-field/search-bar.svelte +1 -0
- package/{package → dist}/components/text-field/search-bar.svelte.d.ts +8 -0
- package/{package → dist}/components/text-field/text-area.svelte +4 -4
- package/{package → dist}/components/text-field/text-input.svelte +7 -2
- package/{package → dist}/components/text-field/text-input.svelte.d.ts +13 -2
- package/{package → dist}/components/toast/toast.svelte +1 -1
- package/{package → dist}/components/toolbar/toolbar.svelte +2 -2
- package/{package → dist}/components/util/app-shell.svelte +6 -6
- package/{package → dist}/components/util/app-shell.svelte.d.ts +2 -2
- package/{package → dist}/components/util/popup.svelte +2 -2
- package/{package → dist}/locales/en.d.ts +1 -0
- package/{package → dist}/locales/en.js +1 -0
- package/{package → dist}/locales/ja.d.ts +1 -0
- package/{package → dist}/locales/ja.js +1 -0
- package/{package → dist}/styles/variables.scss +2 -2
- package/{package → dist}/typedefs.d.ts +1 -5
- package/{package → dist}/typedefs.js +14 -14
- package/package.json +29 -28
- package/package/components/text-editor/lexical-root.svelte +0 -150
- /package/{package → dist}/components/alert/alert.svelte +0 -0
- /package/{package → dist}/components/alert/alert.svelte.d.ts +0 -0
- /package/{package → dist}/components/button/button-group.svelte +0 -0
- /package/{package → dist}/components/button/button-group.svelte.d.ts +0 -0
- /package/{package → dist}/components/button/button.svelte.d.ts +0 -0
- /package/{package → dist}/components/button/select-button-group.svelte.d.ts +0 -0
- /package/{package → dist}/components/button/select-button.svelte +0 -0
- /package/{package → dist}/components/button/select-button.svelte.d.ts +0 -0
- /package/{package → dist}/components/button/split-button.svelte +0 -0
- /package/{package → dist}/components/button/split-button.svelte.d.ts +0 -0
- /package/{package → dist}/components/calendar/calendar.svelte.d.ts +0 -0
- /package/{package → dist}/components/checkbox/checkbox-group.svelte +0 -0
- /package/{package → dist}/components/checkbox/checkbox-group.svelte.d.ts +0 -0
- /package/{package → dist}/components/checkbox/checkbox.svelte.d.ts +0 -0
- /package/{package → dist}/components/dialog/alert-dialog.svelte +0 -0
- /package/{package → dist}/components/dialog/alert-dialog.svelte.d.ts +0 -0
- /package/{package → dist}/components/dialog/confirmation-dialog.svelte +0 -0
- /package/{package → dist}/components/dialog/confirmation-dialog.svelte.d.ts +0 -0
- /package/{package → dist}/components/dialog/dialog.svelte +0 -0
- /package/{package → dist}/components/dialog/dialog.svelte.d.ts +0 -0
- /package/{package → dist}/components/dialog/prompt-dialog.svelte +0 -0
- /package/{package → dist}/components/dialog/prompt-dialog.svelte.d.ts +0 -0
- /package/{package → dist}/components/disclosure/disclosure.svelte +0 -0
- /package/{package → dist}/components/disclosure/disclosure.svelte.d.ts +0 -0
- /package/{package → dist}/components/divider/divider.svelte +0 -0
- /package/{package → dist}/components/divider/divider.svelte.d.ts +0 -0
- /package/{package → dist}/components/divider/spacer.svelte +0 -0
- /package/{package → dist}/components/divider/spacer.svelte.d.ts +0 -0
- /package/{package → dist}/components/drawer/drawer.svelte +0 -0
- /package/{package → dist}/components/drawer/drawer.svelte.d.ts +0 -0
- /package/{package → dist}/components/grid/grid-body.svelte +0 -0
- /package/{package → dist}/components/grid/grid-body.svelte.d.ts +0 -0
- /package/{package → dist}/components/grid/grid-cell.svelte +0 -0
- /package/{package → dist}/components/grid/grid-cell.svelte.d.ts +0 -0
- /package/{package → dist}/components/grid/grid-col-header.svelte +0 -0
- /package/{package → dist}/components/grid/grid-col-header.svelte.d.ts +0 -0
- /package/{package → dist}/components/grid/grid-foot.svelte +0 -0
- /package/{package → dist}/components/grid/grid-foot.svelte.d.ts +0 -0
- /package/{package → dist}/components/grid/grid-head.svelte +0 -0
- /package/{package → dist}/components/grid/grid-head.svelte.d.ts +0 -0
- /package/{package → dist}/components/grid/grid-row-header.svelte +0 -0
- /package/{package → dist}/components/grid/grid-row-header.svelte.d.ts +0 -0
- /package/{package → dist}/components/grid/grid-row.svelte +0 -0
- /package/{package → dist}/components/grid/grid-row.svelte.d.ts +0 -0
- /package/{package → dist}/components/grid/grid.svelte.d.ts +0 -0
- /package/{package → dist}/components/icon/icon.svelte +0 -0
- /package/{package → dist}/components/icon/icon.svelte.d.ts +0 -0
- /package/{package → dist}/components/listbox/listbox.svelte.d.ts +0 -0
- /package/{package → dist}/components/listbox/option-group.svelte +0 -0
- /package/{package → dist}/components/listbox/option-group.svelte.d.ts +0 -0
- /package/{package → dist}/components/listbox/option.svelte +0 -0
- /package/{package → dist}/components/listbox/option.svelte.d.ts +0 -0
- /package/{package → dist}/components/menu/menu-button.svelte.d.ts +0 -0
- /package/{package → dist}/components/menu/menu-item-checkbox.svelte +0 -0
- /package/{package → dist}/components/menu/menu-item-checkbox.svelte.d.ts +0 -0
- /package/{package → dist}/components/menu/menu-item-group.svelte +0 -0
- /package/{package → dist}/components/menu/menu-item-group.svelte.d.ts +0 -0
- /package/{package → dist}/components/menu/menu-item-radio.svelte +0 -0
- /package/{package → dist}/components/menu/menu-item-radio.svelte.d.ts +0 -0
- /package/{package → dist}/components/menu/menu-item.svelte +0 -0
- /package/{package → dist}/components/menu/menu-item.svelte.d.ts +0 -0
- /package/{package → dist}/components/menu/menu.svelte +0 -0
- /package/{package → dist}/components/menu/menu.svelte.d.ts +0 -0
- /package/{package → dist}/components/progressbar/progressbar.svelte.d.ts +0 -0
- /package/{package → dist}/components/radio/radio-group.svelte.d.ts +0 -0
- /package/{package → dist}/components/radio/radio.svelte.d.ts +0 -0
- /package/{package → dist}/components/select/combobox.svelte.d.ts +0 -0
- /package/{package → dist}/components/select/select-tags.svelte.d.ts +0 -0
- /package/{package → dist}/components/select/select.svelte +0 -0
- /package/{package → dist}/components/select/select.svelte.d.ts +0 -0
- /package/{package → dist}/components/slider/slider.svelte.d.ts +0 -0
- /package/{package → dist}/components/switch/switch.svelte.d.ts +0 -0
- /package/{package → dist}/components/table/table-body.svelte +0 -0
- /package/{package → dist}/components/table/table-body.svelte.d.ts +0 -0
- /package/{package → dist}/components/table/table-cell.svelte +0 -0
- /package/{package → dist}/components/table/table-cell.svelte.d.ts +0 -0
- /package/{package → dist}/components/table/table-col-header.svelte +0 -0
- /package/{package → dist}/components/table/table-col-header.svelte.d.ts +0 -0
- /package/{package → dist}/components/table/table-foot.svelte +0 -0
- /package/{package → dist}/components/table/table-foot.svelte.d.ts +0 -0
- /package/{package → dist}/components/table/table-head.svelte +0 -0
- /package/{package → dist}/components/table/table-head.svelte.d.ts +0 -0
- /package/{package → dist}/components/table/table-row-header.svelte +0 -0
- /package/{package → dist}/components/table/table-row-header.svelte.d.ts +0 -0
- /package/{package → dist}/components/table/table-row.svelte +0 -0
- /package/{package → dist}/components/table/table-row.svelte.d.ts +0 -0
- /package/{package → dist}/components/table/table.svelte +0 -0
- /package/{package → dist}/components/table/table.svelte.d.ts +0 -0
- /package/{package → dist}/components/tabs/tab-box.svelte +0 -0
- /package/{package → dist}/components/tabs/tab-box.svelte.d.ts +0 -0
- /package/{package → dist}/components/tabs/tab-list.svelte.d.ts +0 -0
- /package/{package → dist}/components/tabs/tab-panel.svelte +0 -0
- /package/{package → dist}/components/tabs/tab-panel.svelte.d.ts +0 -0
- /package/{package → dist}/components/tabs/tab-panels.svelte +0 -0
- /package/{package → dist}/components/tabs/tab-panels.svelte.d.ts +0 -0
- /package/{package → dist}/components/tabs/tab.svelte +0 -0
- /package/{package → dist}/components/tabs/tab.svelte.d.ts +0 -0
- /package/{package → dist}/components/text-editor/core.d.ts +0 -0
- /package/{package → dist}/components/text-editor/index.d.ts +0 -0
- /package/{package → dist}/components/text-editor/lexical-root.svelte.d.ts +0 -0
- /package/{package → dist}/components/text-editor/text-editor.svelte.d.ts +0 -0
- /package/{package → dist}/components/text-editor/toolbar/editor-toolbar.svelte +0 -0
- /package/{package → dist}/components/text-editor/toolbar/editor-toolbar.svelte.d.ts +0 -0
- /package/{package → dist}/components/text-editor/toolbar/format-text-button.svelte +0 -0
- /package/{package → dist}/components/text-editor/toolbar/format-text-button.svelte.d.ts +0 -0
- /package/{package → dist}/components/text-editor/toolbar/insert-image-button.svelte +0 -0
- /package/{package → dist}/components/text-editor/toolbar/insert-image-button.svelte.d.ts +0 -0
- /package/{package → dist}/components/text-editor/toolbar/insert-link-button.svelte +0 -0
- /package/{package → dist}/components/text-editor/toolbar/insert-link-button.svelte.d.ts +0 -0
- /package/{package → dist}/components/text-editor/toolbar/insert-menu-button.svelte +0 -0
- /package/{package → dist}/components/text-editor/toolbar/insert-menu-button.svelte.d.ts +0 -0
- /package/{package → dist}/components/text-editor/toolbar/toggle-block-menu-item.svelte.d.ts +0 -0
- /package/{package → dist}/components/text-field/text-area.svelte.d.ts +0 -0
- /package/{package → dist}/components/toast/toast.svelte.d.ts +0 -0
- /package/{package → dist}/components/toolbar/toolbar.svelte.d.ts +0 -0
- /package/{package → dist}/components/util/group.svelte +0 -0
- /package/{package → dist}/components/util/group.svelte.d.ts +0 -0
- /package/{package → dist}/components/util/modal.svelte +0 -0
- /package/{package → dist}/components/util/modal.svelte.d.ts +0 -0
- /package/{package → dist}/components/util/placeholder.svelte +0 -0
- /package/{package → dist}/components/util/placeholder.svelte.d.ts +0 -0
- /package/{package → dist}/components/util/popup.svelte.d.ts +0 -0
- /package/{package → dist}/index.d.ts +0 -0
- /package/{package → dist}/index.js +0 -0
- /package/{package → dist}/services/events.svelte.d.ts +0 -0
- /package/{package → dist}/services/events.svelte.js +0 -0
- /package/{package → dist}/services/group.svelte.d.ts +0 -0
- /package/{package → dist}/services/group.svelte.js +0 -0
- /package/{package → dist}/services/popup.svelte.d.ts +0 -0
- /package/{package → dist}/services/popup.svelte.js +0 -0
- /package/{package → dist}/styles/core.scss +0 -0
|
@@ -13,7 +13,7 @@ declare const AppShell: import("svelte").Component<{
|
|
|
13
13
|
* - Orientation of the app
|
|
14
14
|
* shell’s children..
|
|
15
15
|
*/
|
|
16
|
-
orientation?: "
|
|
16
|
+
orientation?: "vertical" | "horizontal" | undefined;
|
|
17
17
|
/**
|
|
18
18
|
* - Primary slot content.
|
|
19
19
|
*/
|
|
@@ -24,7 +24,7 @@ type Props = {
|
|
|
24
24
|
* - Orientation of the app
|
|
25
25
|
* shell’s children..
|
|
26
26
|
*/
|
|
27
|
-
orientation?: "
|
|
27
|
+
orientation?: "vertical" | "horizontal" | undefined;
|
|
28
28
|
/**
|
|
29
29
|
* - Primary slot content.
|
|
30
30
|
*/
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
* @property {boolean} [open] - Whether to open the popup.
|
|
16
16
|
* @property {HTMLElement} [anchor] - A reference to the anchor element that opens the popup.
|
|
17
17
|
* Typically a `<button>`.
|
|
18
|
-
* @property {HTMLElement
|
|
18
|
+
* @property {HTMLElement} [content] - A reference to the content element.
|
|
19
19
|
* @property {import('../../typedefs').PopupPosition} [position] - Where to show the popup.
|
|
20
|
-
* @property {HTMLElement
|
|
20
|
+
* @property {HTMLElement} [positionBaseElement] - The base element of
|
|
21
21
|
* {@link position}. If omitted, this will be {@link anchor}.
|
|
22
22
|
* @property {boolean} [touchOptimized] - Whether to show the popup at the center of the screen on
|
|
23
23
|
* mobile/tablet and ignore the defined dropdown `position`.
|
|
@@ -66,8 +66,8 @@
|
|
|
66
66
|
--sui-alert-foreground-color-lightness: 75%;
|
|
67
67
|
--sui-alert-background-color-saturation: 40%;
|
|
68
68
|
--sui-alert-background-color-lightness: 10%;
|
|
69
|
-
--sui-alert-border-color-saturation:
|
|
70
|
-
--sui-alert-border-color-lightness:
|
|
69
|
+
--sui-alert-border-color-saturation: 48%;
|
|
70
|
+
--sui-alert-border-color-lightness: 38%;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
:global {
|
|
@@ -382,10 +382,6 @@ export type ComboboxProps = {
|
|
|
382
382
|
onChange?: ((event: CustomEvent) => void) | undefined;
|
|
383
383
|
};
|
|
384
384
|
export type TextInputProps = {
|
|
385
|
-
/**
|
|
386
|
-
* - Input value.
|
|
387
|
-
*/
|
|
388
|
-
value?: string | undefined;
|
|
389
385
|
/**
|
|
390
386
|
* - Reference to the `<input>` element.
|
|
391
387
|
*/
|
|
@@ -545,7 +541,7 @@ export type InputEventHandlers = {
|
|
|
545
541
|
};
|
|
546
542
|
export type PopupPosition = ("top-left" | "top-right" | "right-top" | "right-bottom" | "bottom-left" | "bottom-right" | "left-top" | "left-bottom");
|
|
547
543
|
export type ToastPosition = "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right";
|
|
548
|
-
export type TextEditorBlockType = "paragraph" | "heading-1" | "heading-2" | "heading-3" | "heading-4" | "heading-5" | "heading-6" | "bulleted-list" | "numbered-list" | "blockquote";
|
|
544
|
+
export type TextEditorBlockType = "paragraph" | "heading-1" | "heading-2" | "heading-3" | "heading-4" | "heading-5" | "heading-6" | "bulleted-list" | "numbered-list" | "blockquote" | "code-block";
|
|
549
545
|
export type TextEditorFormatType = "bold" | "italic" | "code";
|
|
550
546
|
export type TextEditorInlineType = TextEditorFormatType | "link";
|
|
551
547
|
export type TextEditorMode = "rich-text" | "plain-text";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @typedef {object} ButtonProps
|
|
3
|
-
* @property {HTMLButtonElement
|
|
3
|
+
* @property {HTMLButtonElement} [element] - Reference to the `<button>` element.
|
|
4
4
|
* @property {string} [class] - The `class` attribute on the `<button>` element.
|
|
5
5
|
* @property {'button' | 'submit' | 'reset'} [type] - The `type` attribute on the `<button>`
|
|
6
6
|
* element.
|
|
7
7
|
* @property {string} [role] - The `role` attribute on the `<button>` element.
|
|
8
|
-
* @property {string
|
|
9
|
-
* @property {string
|
|
8
|
+
* @property {string} [name] - The `name` attribute on the `<button>` element.
|
|
9
|
+
* @property {string} [value] - The `value` attribute on the `<button>` element.
|
|
10
10
|
* @property {boolean} [hidden] - Whether to hide the widget. An alias of the `aria-hidden`
|
|
11
11
|
* attribute.
|
|
12
12
|
* @property {boolean} [disabled] - Whether to disable the widget. An alias of the `aria-disabled`
|
|
@@ -14,15 +14,15 @@
|
|
|
14
14
|
* @property {boolean} [readonly] - Whether to make the widget read-only. An alias of the
|
|
15
15
|
* `aria-readonly` attribute used in certain roles, including `checkbox`, `listbox`, `slider` and
|
|
16
16
|
* `textbox`.
|
|
17
|
-
* @property {boolean | 'mixed'
|
|
17
|
+
* @property {boolean | 'mixed'} [pressed] - Whether to mark the widget pressed. An
|
|
18
18
|
* alias of the `aria-pressed` attribute.
|
|
19
|
-
* @property {string
|
|
19
|
+
* @property {string} [keyShortcuts] - Keyboard shortcuts. An alias of the
|
|
20
20
|
* `aria-keyshortcuts` attribute. Accepts the special `Accel` key, which will be replaced with
|
|
21
21
|
* `Control` or `Meta` depending on the user’s operating system.
|
|
22
22
|
* @property {string} [label] - Text label displayed on the button.
|
|
23
|
-
* @property {'primary' | 'secondary' | 'tertiary' | 'ghost' | 'link'
|
|
23
|
+
* @property {'primary' | 'secondary' | 'tertiary' | 'ghost' | 'link'} [variant] - The
|
|
24
24
|
* style variant of the button.
|
|
25
|
-
* @property {'small' | 'medium' | 'large'
|
|
25
|
+
* @property {'small' | 'medium' | 'large'} [size] - The size of the button.
|
|
26
26
|
* @property {boolean} [iconic] - Whether to only show an icon on the button and trim the padding.
|
|
27
27
|
* @property {boolean} [pill] - Whether to make the button rounded.
|
|
28
28
|
* @property {boolean} [flex] - Make the button width flexible.
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
* @property {boolean} [escapeDismiss] - Whether to close the modal when the Escape key is pressed.
|
|
50
50
|
* @property {boolean} [keepContent] - Whether to keep the content in the DOM tree when the modal is
|
|
51
51
|
* not displayed.
|
|
52
|
-
* @property {HTMLDialogElement
|
|
52
|
+
* @property {HTMLDialogElement} [dialog] - A reference to the `<dialog>` element.
|
|
53
53
|
* @property {import('svelte').Snippet} [children] - Primary slot content.
|
|
54
54
|
* @property {import('svelte').Snippet} [extraContent] - Extra slot content.
|
|
55
55
|
* @property {(event: CustomEvent) => void} [onOpening] - Custom `Opening` event handler.
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
* `aria-required` attribute.
|
|
120
120
|
* @property {boolean} [invalid] - Whether to mark the widget invalid. An alias of the
|
|
121
121
|
* `aria-invalid` attribute.
|
|
122
|
-
* @property {string
|
|
122
|
+
* @property {string} [value] - Selected option’s value.
|
|
123
123
|
* @property {boolean} [editable] - Whether to make the `combobox` editable.
|
|
124
124
|
* @property {PopupPosition} [position] - Where to show the dropdown menu.
|
|
125
125
|
* @property {import('svelte').Snippet} [children] - Primary slot content.
|
|
@@ -129,14 +129,13 @@
|
|
|
129
129
|
|
|
130
130
|
/**
|
|
131
131
|
* @typedef {object} TextInputProps
|
|
132
|
-
* @property {
|
|
133
|
-
* @property {HTMLInputElement | undefined} [element] - Reference to the `<input>` element.
|
|
132
|
+
* @property {HTMLInputElement} [element] - Reference to the `<input>` element.
|
|
134
133
|
* @property {'textbox' | 'searchbox' | 'combobox' | 'spinbutton'} [role] - The `role` attribute on
|
|
135
134
|
* the `<input>` element.
|
|
136
|
-
* @property {string
|
|
135
|
+
* @property {string} [keyShortcuts] - Keyboard shortcuts. An alias of the
|
|
137
136
|
* `aria-keyshortcuts` attribute. Accepts the special `Accel` key, which will be replaced with
|
|
138
137
|
* `Control` or `Meta` depending on the user’s operating system.
|
|
139
|
-
* @property {string
|
|
138
|
+
* @property {string} [name] - The `name` attribute on the `<input>` element.
|
|
140
139
|
* @property {boolean} [showInlineLabel] - Whether to display `aria-label` over the `<input>`
|
|
141
140
|
* element if it’s empty, just like how the HTML `placeholder` attribute works.
|
|
142
141
|
* @property {'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url'} [inputmode] - The
|
|
@@ -212,7 +211,8 @@
|
|
|
212
211
|
|
|
213
212
|
/**
|
|
214
213
|
* @typedef {'paragraph' | 'heading-1' | 'heading-2' | 'heading-3' | 'heading-4' | 'heading-5' |
|
|
215
|
-
* 'heading-6' | 'bulleted-list' | 'numbered-list' | 'blockquote'}
|
|
214
|
+
* 'heading-6' | 'bulleted-list' | 'numbered-list' | 'blockquote' | 'code-block'}
|
|
215
|
+
* TextEditorBlockType
|
|
216
216
|
*/
|
|
217
217
|
|
|
218
218
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sveltia/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
},
|
|
13
13
|
"scripts": {
|
|
14
14
|
"dev": "vite dev",
|
|
15
|
-
"build": "svelte-kit sync && svelte-package
|
|
16
|
-
"build:watch": "svelte-kit sync && svelte-package
|
|
15
|
+
"build": "svelte-kit sync && svelte-package",
|
|
16
|
+
"build:watch": "svelte-kit sync && svelte-package --watch",
|
|
17
17
|
"preview": "vite preview",
|
|
18
18
|
"prepublishOnly": "npm run build",
|
|
19
19
|
"format": "prettier --write .",
|
|
@@ -28,18 +28,19 @@
|
|
|
28
28
|
"test:unit": "vitest"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@lexical/code": "^0.
|
|
32
|
-
"@lexical/dragon": "^0.
|
|
33
|
-
"@lexical/history": "^0.
|
|
34
|
-
"@lexical/link": "^0.
|
|
35
|
-
"@lexical/list": "^0.
|
|
36
|
-
"@lexical/markdown": "^0.
|
|
37
|
-
"@lexical/rich-text": "^0.
|
|
38
|
-
"@lexical/selection": "^0.
|
|
39
|
-
"@lexical/table": "^0.
|
|
40
|
-
"@lexical/utils": "^0.
|
|
41
|
-
"@sveltia/utils": "^0.6.
|
|
42
|
-
"
|
|
31
|
+
"@lexical/code": "^0.22.0",
|
|
32
|
+
"@lexical/dragon": "^0.22.0",
|
|
33
|
+
"@lexical/history": "^0.22.0",
|
|
34
|
+
"@lexical/link": "^0.22.0",
|
|
35
|
+
"@lexical/list": "^0.22.0",
|
|
36
|
+
"@lexical/markdown": "^0.22.0",
|
|
37
|
+
"@lexical/rich-text": "^0.22.0",
|
|
38
|
+
"@lexical/selection": "^0.22.0",
|
|
39
|
+
"@lexical/table": "^0.22.0",
|
|
40
|
+
"@lexical/utils": "^0.22.0",
|
|
41
|
+
"@sveltia/utils": "^0.6.3",
|
|
42
|
+
"prismjs": "^1.29.0",
|
|
43
|
+
"lexical": "^0.22.0"
|
|
43
44
|
},
|
|
44
45
|
"peerDependencies": {
|
|
45
46
|
"svelte": "^5.0.0"
|
|
@@ -47,10 +48,10 @@
|
|
|
47
48
|
"devDependencies": {
|
|
48
49
|
"@playwright/test": "^1.49.1",
|
|
49
50
|
"@sveltejs/adapter-auto": "^3.3.1",
|
|
50
|
-
"@sveltejs/kit": "^2.
|
|
51
|
+
"@sveltejs/kit": "^2.15.0",
|
|
51
52
|
"@sveltejs/package": "^2.3.7",
|
|
52
|
-
"@sveltejs/vite-plugin-svelte": "5.0.
|
|
53
|
-
"cspell": "^8.
|
|
53
|
+
"@sveltejs/vite-plugin-svelte": "5.0.3",
|
|
54
|
+
"cspell": "^8.17.1",
|
|
54
55
|
"eslint": "^8.57.1",
|
|
55
56
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
56
57
|
"eslint-config-prettier": "^9.1.0",
|
|
@@ -61,33 +62,33 @@
|
|
|
61
62
|
"postcss-html": "^1.7.0",
|
|
62
63
|
"prettier": "^3.4.2",
|
|
63
64
|
"prettier-plugin-svelte": "^3.3.2",
|
|
64
|
-
"sass": "^1.
|
|
65
|
-
"stylelint": "^16.
|
|
65
|
+
"sass": "^1.83.0",
|
|
66
|
+
"stylelint": "^16.12.0",
|
|
66
67
|
"stylelint-config-recommended-scss": "^14.1.0",
|
|
67
68
|
"stylelint-scss": "^6.10.0",
|
|
68
|
-
"svelte": "5.
|
|
69
|
+
"svelte": "5.15.0",
|
|
69
70
|
"svelte-check": "^4.1.1",
|
|
70
71
|
"svelte-i18n": "^4.0.1",
|
|
71
72
|
"svelte-preprocess": "^6.0.3",
|
|
72
73
|
"tslib": "^2.8.1",
|
|
73
|
-
"vite": "^6.0.
|
|
74
|
+
"vite": "^6.0.5",
|
|
74
75
|
"vitest": "^2.1.8"
|
|
75
76
|
},
|
|
76
77
|
"exports": {
|
|
77
78
|
".": {
|
|
78
|
-
"types": "./
|
|
79
|
-
"svelte": "./
|
|
80
|
-
"default": "./
|
|
79
|
+
"types": "./dist/index.d.ts",
|
|
80
|
+
"svelte": "./dist/index.js",
|
|
81
|
+
"default": "./dist/index.js"
|
|
81
82
|
}
|
|
82
83
|
},
|
|
83
84
|
"files": [
|
|
84
|
-
"
|
|
85
|
+
"dist"
|
|
85
86
|
],
|
|
86
|
-
"svelte": "./
|
|
87
|
+
"svelte": "./dist/index.js",
|
|
87
88
|
"typesVersions": {
|
|
88
89
|
">4.0": {
|
|
89
90
|
"index": [
|
|
90
|
-
"./
|
|
91
|
+
"./dist/index.d.ts"
|
|
91
92
|
]
|
|
92
93
|
}
|
|
93
94
|
},
|
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import { getContext, onMount } from 'svelte';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* @typedef {object} Props
|
|
6
|
-
* @property {string | undefined} [value] - Input value.
|
|
7
|
-
* @property {string} [class] - The `class` attribute on the wrapper element.
|
|
8
|
-
* @property {boolean} [hidden] - Whether to hide the widget.
|
|
9
|
-
* @property {boolean} [disabled] - Whether to disable the widget. An alias of the `aria-disabled`
|
|
10
|
-
* attribute.
|
|
11
|
-
* @property {boolean} [readonly] - Whether to make the widget read-only. An alias of the
|
|
12
|
-
* `aria-readonly` attribute.
|
|
13
|
-
* @property {boolean} [required] - Whether to mark the widget required. An alias of the
|
|
14
|
-
* `aria-required` attribute.
|
|
15
|
-
* @property {boolean} [invalid] - Whether to mark the widget invalid. An alias of the
|
|
16
|
-
* `aria-invalid` attribute.
|
|
17
|
-
* @property {import('svelte').Snippet} [children] - Primary slot content.
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* @type {Props & Record<string, any>}
|
|
22
|
-
*/
|
|
23
|
-
let {
|
|
24
|
-
/* eslint-disable prefer-const */
|
|
25
|
-
value = $bindable(),
|
|
26
|
-
class: className,
|
|
27
|
-
hidden = false,
|
|
28
|
-
disabled = false,
|
|
29
|
-
readonly = false,
|
|
30
|
-
required = false,
|
|
31
|
-
invalid = false,
|
|
32
|
-
children,
|
|
33
|
-
...restProps
|
|
34
|
-
/* eslint-enable prefer-const */
|
|
35
|
-
} = $props();
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Text editor state.
|
|
39
|
-
* @type {import('../../typedefs').TextEditorState}
|
|
40
|
-
*/
|
|
41
|
-
const { editor, editorId, selectionBlockType, selectionInlineTypes, hasConverterError } =
|
|
42
|
-
getContext('state');
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Reference to the Lexical editor root element.
|
|
46
|
-
* @type {HTMLElement | undefined}
|
|
47
|
-
*/
|
|
48
|
-
let lexicalRoot = $state();
|
|
49
|
-
|
|
50
|
-
const editable = $derived(!(disabled || readonly));
|
|
51
|
-
|
|
52
|
-
$effect(() => {
|
|
53
|
-
$editor?.setEditable(editable);
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Update {@link value} and other state variables whenever the editor content is updated.
|
|
58
|
-
* @param {Event} event - `Update` custom event.
|
|
59
|
-
*/
|
|
60
|
-
const onUpdate = (event) => {
|
|
61
|
-
if ($hasConverterError) {
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
const { detail } = /** @type {CustomEvent} */ (event);
|
|
66
|
-
const newValue = detail.value;
|
|
67
|
-
|
|
68
|
-
if (value !== newValue) {
|
|
69
|
-
value = newValue;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
$selectionBlockType = detail.selectionBlockType;
|
|
73
|
-
$selectionInlineTypes = detail.selectionInlineTypes;
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* Listen to `click` events on the editor. Ignore a click on a link.
|
|
78
|
-
* @param {MouseEvent} event - `click` event.
|
|
79
|
-
*/
|
|
80
|
-
const onClick = (event) => {
|
|
81
|
-
if (/** @type {HTMLElement} */ (event.target)?.matches('a')) {
|
|
82
|
-
event.preventDefault();
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
onMount(() => {
|
|
87
|
-
lexicalRoot?.addEventListener('Update', onUpdate);
|
|
88
|
-
lexicalRoot?.addEventListener('click', onClick);
|
|
89
|
-
|
|
90
|
-
return () => {
|
|
91
|
-
lexicalRoot?.removeEventListener('Update', onUpdate);
|
|
92
|
-
lexicalRoot?.removeEventListener('click', onClick);
|
|
93
|
-
};
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
$effect(() => {
|
|
97
|
-
if ($editor && lexicalRoot) {
|
|
98
|
-
$editor.setRootElement(lexicalRoot);
|
|
99
|
-
}
|
|
100
|
-
});
|
|
101
|
-
</script>
|
|
102
|
-
|
|
103
|
-
<div
|
|
104
|
-
bind:this={lexicalRoot}
|
|
105
|
-
{...restProps}
|
|
106
|
-
role="textbox"
|
|
107
|
-
aria-multiline="true"
|
|
108
|
-
aria-hidden={hidden}
|
|
109
|
-
aria-disabled={disabled}
|
|
110
|
-
aria-readonly={readonly}
|
|
111
|
-
aria-required={required}
|
|
112
|
-
aria-invalid={invalid}
|
|
113
|
-
class="lexical-root"
|
|
114
|
-
id="{$editorId}-lexical-root"
|
|
115
|
-
contenteditable={editable}
|
|
116
|
-
{hidden}
|
|
117
|
-
></div>
|
|
118
|
-
|
|
119
|
-
<style>.lexical-root {
|
|
120
|
-
border: 1px solid var(--sui-textbox-border-color);
|
|
121
|
-
border-radius: 0 0 var(--sui-textbox-border-radius) var(--sui-textbox-border-radius) !important;
|
|
122
|
-
padding: var(--sui-textbox-multiline-padding);
|
|
123
|
-
min-height: 8em;
|
|
124
|
-
color: var(--sui-textbox-foreground-color);
|
|
125
|
-
background-color: var(--sui-textbox-background-color);
|
|
126
|
-
font-family: var(--sui-textbox-font-family);
|
|
127
|
-
font-size: var(--sui-textbox-font-size);
|
|
128
|
-
line-height: var(--sui-textbox-multiline-line-height);
|
|
129
|
-
}
|
|
130
|
-
.lexical-root:focus-visible {
|
|
131
|
-
outline: 0;
|
|
132
|
-
}
|
|
133
|
-
.lexical-root[aria-invalid=true] {
|
|
134
|
-
border-color: var(--sui-error-foreground-color);
|
|
135
|
-
}
|
|
136
|
-
.lexical-root > :global(:first-child) {
|
|
137
|
-
margin-top: 0;
|
|
138
|
-
}
|
|
139
|
-
.lexical-root > :global(:last-child) {
|
|
140
|
-
margin-bottom: 0;
|
|
141
|
-
}
|
|
142
|
-
.lexical-root :global(strong.italic) {
|
|
143
|
-
font-style: italic;
|
|
144
|
-
}
|
|
145
|
-
.lexical-root :global(li.nested) {
|
|
146
|
-
list-style-type: none;
|
|
147
|
-
}
|
|
148
|
-
.lexical-root :global([data-lexical-text="true"]) {
|
|
149
|
-
cursor: text;
|
|
150
|
-
}</style>
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|