@sveltia/ui 0.15.13 → 0.15.15

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 (32) hide show
  1. package/package/components/button/button.svelte +1 -1
  2. package/package/components/button/button.svelte.d.ts +4 -4
  3. package/package/components/button/split-button.svelte +1 -1
  4. package/package/components/button/split-button.svelte.d.ts +2 -2
  5. package/package/components/menu/menu-button.svelte +1 -1
  6. package/package/components/menu/menu-button.svelte.d.ts +2 -2
  7. package/package/components/select/combobox.svelte +1 -1
  8. package/package/components/select/combobox.svelte.d.ts +2 -2
  9. package/package/components/text-editor/core.js +2 -2
  10. package/package/components/text-editor/index.d.ts +6 -6
  11. package/package/components/text-editor/index.js +3 -3
  12. package/package/components/text-editor/lexical-root.svelte +10 -7
  13. package/package/components/text-editor/text-editor.svelte +27 -12
  14. package/package/components/text-editor/text-editor.svelte.d.ts +4 -4
  15. package/package/components/text-editor/toolbar/editor-toolbar.svelte +11 -16
  16. package/package/components/text-editor/toolbar/format-text-button.svelte +2 -2
  17. package/package/components/text-editor/toolbar/format-text-button.svelte.d.ts +2 -2
  18. package/package/components/text-editor/toolbar/insert-link-button.svelte +13 -5
  19. package/package/components/text-editor/toolbar/toggle-block-menu-item.svelte +2 -2
  20. package/package/components/text-editor/toolbar/toggle-block-menu-item.svelte.d.ts +2 -2
  21. package/package/components/toast/toast.svelte +1 -1
  22. package/package/components/toast/toast.svelte.d.ts +2 -2
  23. package/package/components/util/popup.svelte +1 -1
  24. package/package/components/util/popup.svelte.d.ts +4 -4
  25. package/package/index.d.ts +1 -0
  26. package/package/index.js +3 -0
  27. package/package/services/events.js +22 -9
  28. package/package/services/popup.d.ts +3 -3
  29. package/package/services/popup.js +7 -3
  30. package/package/{typedef.d.ts → typedefs.d.ts} +7 -7
  31. package/package/{typedef.js → typedefs.js} +2 -0
  32. package/package.json +28 -607
@@ -7,11 +7,11 @@ declare class Popup {
7
7
  * Initialize a new `Popup` instance.
8
8
  * @param {HTMLButtonElement} anchorElement - `<button>` element that triggers the popup.
9
9
  * @param {HTMLDialogElement} popupElement - `<dialog>` element to be used for the popup.
10
- * @param {PopupPosition} position - Where to show the popup content.
10
+ * @param {import('../typedefs').PopupPosition} position - Where to show the popup content.
11
11
  * @param {HTMLElement} [positionBaseElement] - The base element of the `position`. If omitted,
12
12
  * this will be the `anchorElement`.
13
13
  */
14
- constructor(anchorElement: HTMLButtonElement, popupElement: HTMLDialogElement, position: PopupPosition, positionBaseElement?: HTMLElement | undefined);
14
+ constructor(anchorElement: HTMLButtonElement, popupElement: HTMLDialogElement, position: import("../typedefs").PopupPosition, positionBaseElement?: HTMLElement | undefined);
15
15
  open: import("svelte/store").Writable<boolean>;
16
16
  /**
17
17
  * @type {import('svelte/store').Writable<{
@@ -32,7 +32,7 @@ declare class Popup {
32
32
  observer: IntersectionObserver;
33
33
  anchorElement: HTMLButtonElement;
34
34
  popupElement: HTMLDialogElement;
35
- position: PopupPosition;
35
+ position: import("../typedefs").PopupPosition;
36
36
  positionBaseElement: HTMLElement;
37
37
  id: string;
38
38
  /**
@@ -45,7 +45,9 @@ class Popup {
45
45
  if (position.startsWith('bottom-')) {
46
46
  if (contentHeight > bottomMargin) {
47
47
  if (topMargin > bottomMargin) {
48
- position = /** @type {PopupPosition} */ (position.replace('bottom-', 'top-'));
48
+ position = /** @type {import('../typedefs').PopupPosition} */ (
49
+ position.replace('bottom-', 'top-')
50
+ );
49
51
  height = topMargin;
50
52
  } else {
51
53
  height = bottomMargin;
@@ -56,7 +58,9 @@ class Popup {
56
58
  // If the popup overflows the viewport, change the position
57
59
  if (position.endsWith('-left')) {
58
60
  if (intersectionRect.left + contentWidth > rootBounds.width - 8) {
59
- position = /** @type {PopupPosition} */ (position.replace('-left', '-right'));
61
+ position = /** @type {import('../typedefs').PopupPosition} */ (
62
+ position.replace('-left', '-right')
63
+ );
60
64
  }
61
65
  }
62
66
 
@@ -106,7 +110,7 @@ class Popup {
106
110
  * Initialize a new `Popup` instance.
107
111
  * @param {HTMLButtonElement} anchorElement - `<button>` element that triggers the popup.
108
112
  * @param {HTMLDialogElement} popupElement - `<dialog>` element to be used for the popup.
109
- * @param {PopupPosition} position - Where to show the popup content.
113
+ * @param {import('../typedefs').PopupPosition} position - Where to show the popup content.
110
114
  * @param {HTMLElement} [positionBaseElement] - The base element of the `position`. If omitted,
111
115
  * this will be the `anchorElement`.
112
116
  */
@@ -1,10 +1,10 @@
1
- type PopupPosition = ("top-left" | "top-right" | "right-top" | "right-bottom" | "bottom-left" | "bottom-right" | "left-top" | "left-bottom");
2
- type ToastPosition = "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right";
3
- type TextEditorBlockType = "paragraph" | "heading-1" | "heading-2" | "heading-3" | "heading-4" | "heading-5" | "heading-6" | "bulleted-list" | "numbered-list" | "blockquote";
4
- type TextEditorFormatType = "bold" | "italic" | "code";
5
- type TextEditorInlineType = TextEditorFormatType | "link";
6
- type TextEditorMode = "rich-text" | "plain-text";
7
- type TextEditorState = {
1
+ export type PopupPosition = ("top-left" | "top-right" | "right-top" | "right-bottom" | "bottom-left" | "bottom-right" | "left-top" | "left-bottom");
2
+ export type ToastPosition = "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right";
3
+ export type TextEditorBlockType = "paragraph" | "heading-1" | "heading-2" | "heading-3" | "heading-4" | "heading-5" | "heading-6" | "bulleted-list" | "numbered-list" | "blockquote";
4
+ export type TextEditorFormatType = "bold" | "italic" | "code";
5
+ export type TextEditorInlineType = TextEditorFormatType | "link";
6
+ export type TextEditorMode = "rich-text" | "plain-text";
7
+ export type TextEditorState = {
8
8
  /**
9
9
  * - Lexical
10
10
  * editor instance.
@@ -43,3 +43,5 @@
43
43
  * the editor.
44
44
  * @property {Function} convertMarkdown - Function to trigger the Lexical converter.
45
45
  */
46
+
47
+ export {};