@ckeditor/ckeditor5-ui 41.2.0 → 41.3.0-alpha.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/content-index.css +4 -0
- package/dist/editor-index.css +445 -0
- package/dist/index.css +844 -0
- package/dist/index.css.map +1 -0
- package/dist/index.js +13857 -0
- package/dist/index.js.map +1 -0
- package/dist/types/arialiveannouncer.d.ts +98 -0
- package/dist/types/augmentation.d.ts +88 -0
- package/dist/types/autocomplete/autocompleteview.d.ts +81 -0
- package/dist/types/bindings/addkeyboardhandlingforgrid.d.ts +27 -0
- package/dist/types/bindings/clickoutsidehandler.d.ts +28 -0
- package/dist/types/bindings/csstransitiondisablermixin.d.ts +40 -0
- package/dist/types/bindings/draggableviewmixin.d.ts +46 -0
- package/dist/types/bindings/injectcsstransitiondisabler.d.ts +59 -0
- package/dist/types/bindings/preventdefault.d.ts +33 -0
- package/dist/types/bindings/submithandler.d.ts +57 -0
- package/dist/types/button/button.d.ts +175 -0
- package/dist/types/button/buttonlabel.d.ts +34 -0
- package/dist/types/button/buttonlabelview.d.ts +31 -0
- package/dist/types/button/buttonview.d.ts +181 -0
- package/dist/types/button/switchbuttonview.d.ts +45 -0
- package/dist/types/collapsible/collapsibleview.d.ts +70 -0
- package/dist/types/colorgrid/colorgridview.d.ts +132 -0
- package/dist/types/colorgrid/colortileview.d.ts +28 -0
- package/dist/types/colorgrid/utils.d.ts +47 -0
- package/dist/types/colorpicker/colorpickerview.d.ts +142 -0
- package/dist/types/colorpicker/utils.d.ts +48 -0
- package/dist/types/colorselector/colorgridsfragmentview.d.ts +195 -0
- package/dist/types/colorselector/colorpickerfragmentview.d.ts +129 -0
- package/dist/types/colorselector/colorselectorview.d.ts +242 -0
- package/dist/types/colorselector/documentcolorcollection.d.ts +70 -0
- package/dist/types/componentfactory.d.ts +81 -0
- package/dist/types/dialog/dialog.d.ts +273 -0
- package/dist/types/dialog/dialogactionsview.d.ts +69 -0
- package/dist/types/dialog/dialogcontentview.d.ts +27 -0
- package/dist/types/dialog/dialogview.d.ts +256 -0
- package/dist/types/dropdown/button/dropdownbutton.d.ts +25 -0
- package/dist/types/dropdown/button/dropdownbuttonview.d.ts +48 -0
- package/dist/types/dropdown/button/splitbuttonview.d.ts +162 -0
- package/dist/types/dropdown/dropdownpanelfocusable.d.ts +21 -0
- package/dist/types/dropdown/dropdownpanelview.d.ts +62 -0
- package/dist/types/dropdown/dropdownview.d.ts +315 -0
- package/dist/types/dropdown/utils.d.ts +235 -0
- package/dist/types/editableui/editableuiview.d.ts +72 -0
- package/dist/types/editableui/inline/inlineeditableuiview.d.ts +40 -0
- package/dist/types/editorui/accessibilityhelp/accessibilityhelp.d.ts +47 -0
- package/dist/types/editorui/accessibilityhelp/accessibilityhelpcontentview.d.ts +35 -0
- package/dist/types/editorui/bodycollection.d.ts +55 -0
- package/dist/types/editorui/boxed/boxededitoruiview.d.ts +40 -0
- package/dist/types/editorui/editorui.d.ts +288 -0
- package/dist/types/editorui/editoruiview.d.ts +39 -0
- package/dist/types/editorui/poweredby.d.ts +71 -0
- package/dist/types/focuscycler.d.ts +245 -0
- package/dist/types/formheader/formheaderview.d.ts +59 -0
- package/dist/types/highlightedtext/highlightedtextview.d.ts +38 -0
- package/dist/types/icon/iconview.d.ts +88 -0
- package/dist/types/iframe/iframeview.d.ts +50 -0
- package/dist/types/index.d.ts +74 -0
- package/dist/types/input/inputbase.d.ts +107 -0
- package/dist/types/input/inputview.d.ts +36 -0
- package/dist/types/inputnumber/inputnumberview.d.ts +49 -0
- package/dist/types/inputtext/inputtextview.d.ts +18 -0
- package/dist/types/label/labelview.d.ts +36 -0
- package/dist/types/labeledfield/labeledfieldview.d.ts +187 -0
- package/dist/types/labeledfield/utils.d.ts +123 -0
- package/dist/types/labeledinput/labeledinputview.d.ts +125 -0
- package/dist/types/list/listitemgroupview.d.ts +59 -0
- package/dist/types/list/listitemview.d.ts +36 -0
- package/dist/types/list/listseparatorview.d.ts +18 -0
- package/dist/types/list/listview.d.ts +124 -0
- package/dist/types/model.d.ts +22 -0
- package/dist/types/notification/notification.d.ts +211 -0
- package/dist/types/panel/balloon/balloonpanelview.d.ts +685 -0
- package/dist/types/panel/balloon/contextualballoon.d.ts +299 -0
- package/dist/types/panel/sticky/stickypanelview.d.ts +156 -0
- package/dist/types/search/filteredview.d.ts +31 -0
- package/dist/types/search/searchinfoview.d.ts +45 -0
- package/dist/types/search/searchresultsview.d.ts +54 -0
- package/dist/types/search/text/searchtextqueryview.d.ts +76 -0
- package/dist/types/search/text/searchtextview.d.ts +219 -0
- package/dist/types/spinner/spinnerview.d.ts +25 -0
- package/dist/types/template.d.ts +942 -0
- package/dist/types/textarea/textareaview.d.ts +104 -0
- package/dist/types/toolbar/balloon/balloontoolbar.d.ts +117 -0
- package/dist/types/toolbar/block/blockbuttonview.d.ts +35 -0
- package/dist/types/toolbar/block/blocktoolbar.d.ts +153 -0
- package/dist/types/toolbar/normalizetoolbarconfig.d.ts +40 -0
- package/dist/types/toolbar/toolbarlinebreakview.d.ts +18 -0
- package/dist/types/toolbar/toolbarseparatorview.d.ts +18 -0
- package/dist/types/toolbar/toolbarview.d.ts +267 -0
- package/dist/types/tooltipmanager.d.ts +184 -0
- package/dist/types/view.d.ts +422 -0
- package/dist/types/viewcollection.d.ts +139 -0
- package/package.json +4 -3
- package/src/colorpicker/colorpickerview.js +0 -1
- package/src/index.d.ts +2 -2
- package/src/index.js +2 -1
- package/src/toolbar/toolbarview.js +2 -3
- package/theme/globals/globals.css +0 -1
- package/theme/globals/_reset.css +0 -13
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module ui/list/listview
|
|
7
|
+
*/
|
|
8
|
+
import View from '../view.js';
|
|
9
|
+
import { type FocusableView } from '../focuscycler.js';
|
|
10
|
+
import ListItemView from './listitemview.js';
|
|
11
|
+
import ListItemGroupView from './listitemgroupview.js';
|
|
12
|
+
import type ListSeparatorView from './listseparatorview.js';
|
|
13
|
+
import type DropdownPanelFocusable from '../dropdown/dropdownpanelfocusable.js';
|
|
14
|
+
import ViewCollection from '../viewcollection.js';
|
|
15
|
+
import { FocusTracker, KeystrokeHandler, type Locale } from '@ckeditor/ckeditor5-utils';
|
|
16
|
+
import '../../theme/components/list/list.css';
|
|
17
|
+
/**
|
|
18
|
+
* The list view class.
|
|
19
|
+
*/
|
|
20
|
+
export default class ListView extends View<HTMLUListElement> implements DropdownPanelFocusable {
|
|
21
|
+
/**
|
|
22
|
+
* The collection of focusable views in the list. It is used to determine accessible navigation
|
|
23
|
+
* between the {@link module:ui/list/listitemview~ListItemView list items} and
|
|
24
|
+
* {@link module:ui/list/listitemgroupview~ListItemGroupView list groups}.
|
|
25
|
+
*/
|
|
26
|
+
readonly focusables: ViewCollection<FocusableView>;
|
|
27
|
+
/**
|
|
28
|
+
* Collection of the child list views.
|
|
29
|
+
*/
|
|
30
|
+
readonly items: ViewCollection<ListItemView | ListItemGroupView | ListSeparatorView>;
|
|
31
|
+
/**
|
|
32
|
+
* Tracks information about DOM focus in the list.
|
|
33
|
+
*/
|
|
34
|
+
readonly focusTracker: FocusTracker;
|
|
35
|
+
/**
|
|
36
|
+
* Instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
|
|
37
|
+
*/
|
|
38
|
+
readonly keystrokes: KeystrokeHandler;
|
|
39
|
+
/**
|
|
40
|
+
* Label used by assistive technologies to describe this list element.
|
|
41
|
+
*
|
|
42
|
+
* @observable
|
|
43
|
+
*/
|
|
44
|
+
ariaLabel: string | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* (Optional) The ARIA property reflected by the `aria-ariaLabelledBy` DOM attribute used by assistive technologies.
|
|
47
|
+
*
|
|
48
|
+
* @observable
|
|
49
|
+
*/
|
|
50
|
+
ariaLabelledBy?: string | undefined;
|
|
51
|
+
/**
|
|
52
|
+
* The property reflected by the `role` DOM attribute to be used by assistive technologies.
|
|
53
|
+
*
|
|
54
|
+
* @observable
|
|
55
|
+
*/
|
|
56
|
+
role: string | undefined;
|
|
57
|
+
/**
|
|
58
|
+
* Helps cycling over focusable {@link #items} in the list.
|
|
59
|
+
*/
|
|
60
|
+
private readonly _focusCycler;
|
|
61
|
+
/**
|
|
62
|
+
* A cached map of {@link module:ui/list/listitemgroupview~ListItemGroupView} to `change` event listeners for their `items`.
|
|
63
|
+
* Used for accessibility and keyboard navigation purposes.
|
|
64
|
+
*/
|
|
65
|
+
private readonly _listItemGroupToChangeListeners;
|
|
66
|
+
/**
|
|
67
|
+
* @inheritDoc
|
|
68
|
+
*/
|
|
69
|
+
constructor(locale?: Locale);
|
|
70
|
+
/**
|
|
71
|
+
* @inheritDoc
|
|
72
|
+
*/
|
|
73
|
+
render(): void;
|
|
74
|
+
/**
|
|
75
|
+
* @inheritDoc
|
|
76
|
+
*/
|
|
77
|
+
destroy(): void;
|
|
78
|
+
/**
|
|
79
|
+
* Focuses the first focusable in {@link #items}.
|
|
80
|
+
*/
|
|
81
|
+
focus(): void;
|
|
82
|
+
/**
|
|
83
|
+
* Focuses the first focusable in {@link #items}.
|
|
84
|
+
*/
|
|
85
|
+
focusFirst(): void;
|
|
86
|
+
/**
|
|
87
|
+
* Focuses the last focusable in {@link #items}.
|
|
88
|
+
*/
|
|
89
|
+
focusLast(): void;
|
|
90
|
+
/**
|
|
91
|
+
* Registers a list item view in the focus tracker.
|
|
92
|
+
*
|
|
93
|
+
* @param item The list item view to be registered.
|
|
94
|
+
* @param index Index of the list item view in the {@link #items} collection. If not specified, the item will be added at the end.
|
|
95
|
+
*/
|
|
96
|
+
private _registerFocusableListItem;
|
|
97
|
+
/**
|
|
98
|
+
* Removes a list item view from the focus tracker.
|
|
99
|
+
*
|
|
100
|
+
* @param item The list item view to be removed.
|
|
101
|
+
*/
|
|
102
|
+
private _deregisterFocusableListItem;
|
|
103
|
+
/**
|
|
104
|
+
* Gets a callback that will be called when the `items` collection of a {@link module:ui/list/listitemgroupview~ListItemGroupView}
|
|
105
|
+
* change.
|
|
106
|
+
*
|
|
107
|
+
* @param groupView The group view for which the callback will be created.
|
|
108
|
+
* @returns The callback function to be used for the items `change` event listener in a group.
|
|
109
|
+
*/
|
|
110
|
+
private _getOnGroupItemsChangeCallback;
|
|
111
|
+
/**
|
|
112
|
+
* Registers a list item group view (and its children) in the focus tracker.
|
|
113
|
+
*
|
|
114
|
+
* @param groupView A group view to be registered.
|
|
115
|
+
* @param groupIndex Index of the group view in the {@link #items} collection. If not specified, the group will be added at the end.
|
|
116
|
+
*/
|
|
117
|
+
private _registerFocusableItemsGroup;
|
|
118
|
+
/**
|
|
119
|
+
* Removes a list item group view (and its children) from the focus tracker.
|
|
120
|
+
*
|
|
121
|
+
* @param groupView The group view to be removed.
|
|
122
|
+
*/
|
|
123
|
+
private _deregisterFocusableItemsGroup;
|
|
124
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
declare const Model_base: {
|
|
6
|
+
new (): import("@ckeditor/ckeditor5-utils").Observable;
|
|
7
|
+
prototype: import("@ckeditor/ckeditor5-utils").Observable;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* The base MVC model class.
|
|
11
|
+
*/
|
|
12
|
+
export default class Model extends Model_base {
|
|
13
|
+
[x: string]: unknown;
|
|
14
|
+
/**
|
|
15
|
+
* Creates a new Model instance.
|
|
16
|
+
*
|
|
17
|
+
* @param attributes The model state attributes to be defined during the instance creation.
|
|
18
|
+
* @param properties The (out of state) properties to be appended to the instance during creation.
|
|
19
|
+
*/
|
|
20
|
+
constructor(attributes?: Record<string, unknown>, properties?: Record<string, unknown>);
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module ui/notification/notification
|
|
7
|
+
*/
|
|
8
|
+
import { ContextPlugin } from '@ckeditor/ckeditor5-core';
|
|
9
|
+
/**
|
|
10
|
+
* The Notification plugin.
|
|
11
|
+
*
|
|
12
|
+
* This plugin sends a few types of notifications: `success`, `info` and `warning`. The notifications need to be
|
|
13
|
+
* handled and displayed by a plugin responsible for showing the UI of the notifications. Using this plugin for dispatching
|
|
14
|
+
* notifications makes it possible to switch the notifications UI.
|
|
15
|
+
*
|
|
16
|
+
* Note that every unhandled and not stopped `warning` notification will be displayed as a system alert.
|
|
17
|
+
* See {@link module:ui/notification/notification~Notification#showWarning}.
|
|
18
|
+
*/
|
|
19
|
+
export default class Notification extends ContextPlugin {
|
|
20
|
+
/**
|
|
21
|
+
* @inheritDoc
|
|
22
|
+
*/
|
|
23
|
+
static get pluginName(): "Notification";
|
|
24
|
+
/**
|
|
25
|
+
* @inheritDoc
|
|
26
|
+
*/
|
|
27
|
+
init(): void;
|
|
28
|
+
/**
|
|
29
|
+
* Shows a success notification.
|
|
30
|
+
*
|
|
31
|
+
* By default, it fires the {@link #event:show:success `show:success` event} with the given `data`. The event namespace can be extended
|
|
32
|
+
* using the `data.namespace` option. For example:
|
|
33
|
+
*
|
|
34
|
+
* ```ts
|
|
35
|
+
* showSuccess( 'Image is uploaded.', {
|
|
36
|
+
* namespace: 'upload:image'
|
|
37
|
+
* } );
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* will fire the `show:success:upload:image` event.
|
|
41
|
+
*
|
|
42
|
+
* You can provide the title of the notification:
|
|
43
|
+
*
|
|
44
|
+
* ```ts
|
|
45
|
+
* showSuccess( 'Image is uploaded.', {
|
|
46
|
+
* title: 'Image upload success'
|
|
47
|
+
* } );
|
|
48
|
+
* ```
|
|
49
|
+
*
|
|
50
|
+
* @param message The content of the notification.
|
|
51
|
+
* @param data Additional data.
|
|
52
|
+
* @param data.namespace Additional event namespace.
|
|
53
|
+
* @param data.title The title of the notification.
|
|
54
|
+
*/
|
|
55
|
+
showSuccess(message: string, data?: {
|
|
56
|
+
namespace?: string;
|
|
57
|
+
title?: string;
|
|
58
|
+
}): void;
|
|
59
|
+
/**
|
|
60
|
+
* Shows an information notification.
|
|
61
|
+
*
|
|
62
|
+
* By default, it fires the {@link #event:show:info `show:info` event} with the given `data`. The event namespace can be extended
|
|
63
|
+
* using the `data.namespace` option. For example:
|
|
64
|
+
*
|
|
65
|
+
* ```ts
|
|
66
|
+
* showInfo( 'Editor is offline.', {
|
|
67
|
+
* namespace: 'editor:status'
|
|
68
|
+
* } );
|
|
69
|
+
* ```
|
|
70
|
+
*
|
|
71
|
+
* will fire the `show:info:editor:status` event.
|
|
72
|
+
*
|
|
73
|
+
* You can provide the title of the notification:
|
|
74
|
+
*
|
|
75
|
+
* ```ts
|
|
76
|
+
* showInfo( 'Editor is offline.', {
|
|
77
|
+
* title: 'Network information'
|
|
78
|
+
* } );
|
|
79
|
+
* ```
|
|
80
|
+
*
|
|
81
|
+
* @param message The content of the notification.
|
|
82
|
+
* @param data Additional data.
|
|
83
|
+
* @param data.namespace Additional event namespace.
|
|
84
|
+
* @param data.title The title of the notification.
|
|
85
|
+
*/
|
|
86
|
+
showInfo(message: string, data?: {
|
|
87
|
+
namespace?: string;
|
|
88
|
+
title?: string;
|
|
89
|
+
}): void;
|
|
90
|
+
/**
|
|
91
|
+
* Shows a warning notification.
|
|
92
|
+
*
|
|
93
|
+
* By default, it fires the {@link #event:show:warning `show:warning` event}
|
|
94
|
+
* with the given `data`. The event namespace can be extended using the `data.namespace` option. For example:
|
|
95
|
+
*
|
|
96
|
+
* ```ts
|
|
97
|
+
* showWarning( 'Image upload error.', {
|
|
98
|
+
* namespace: 'upload:image'
|
|
99
|
+
* } );
|
|
100
|
+
* ```
|
|
101
|
+
*
|
|
102
|
+
* will fire the `show:warning:upload:image` event.
|
|
103
|
+
*
|
|
104
|
+
* You can provide the title of the notification:
|
|
105
|
+
*
|
|
106
|
+
* ```ts
|
|
107
|
+
* showWarning( 'Image upload error.', {
|
|
108
|
+
* title: 'Upload failed'
|
|
109
|
+
* } );
|
|
110
|
+
* ```
|
|
111
|
+
*
|
|
112
|
+
* Note that each unhandled and not stopped `warning` notification will be displayed as a system alert.
|
|
113
|
+
* The plugin responsible for displaying warnings should `stop()` the event to prevent displaying it as an alert:
|
|
114
|
+
*
|
|
115
|
+
* ```ts
|
|
116
|
+
* notifications.on( 'show:warning', ( evt, data ) => {
|
|
117
|
+
* // Do something with the data.
|
|
118
|
+
*
|
|
119
|
+
* // Stop this event to prevent displaying it as an alert.
|
|
120
|
+
* evt.stop();
|
|
121
|
+
* } );
|
|
122
|
+
* ```
|
|
123
|
+
*
|
|
124
|
+
* You can attach many listeners to the same event and `stop()` this event in a listener with a low priority:
|
|
125
|
+
*
|
|
126
|
+
* ```ts
|
|
127
|
+
* notifications.on( 'show:warning', ( evt, data ) => {
|
|
128
|
+
* // Show the warning in the UI, but do not stop it.
|
|
129
|
+
* } );
|
|
130
|
+
*
|
|
131
|
+
* notifications.on( 'show:warning', ( evt, data ) => {
|
|
132
|
+
* // Log the warning to some error tracker.
|
|
133
|
+
*
|
|
134
|
+
* // Stop this event to prevent displaying it as an alert.
|
|
135
|
+
* evt.stop();
|
|
136
|
+
* }, { priority: 'low' } );
|
|
137
|
+
* ```
|
|
138
|
+
*
|
|
139
|
+
* @param message The content of the notification.
|
|
140
|
+
* @param data Additional data.
|
|
141
|
+
* @param data.namespace Additional event namespace.
|
|
142
|
+
* @param data.title The title of the notification.
|
|
143
|
+
*/
|
|
144
|
+
showWarning(message: string, data?: {
|
|
145
|
+
namespace?: string;
|
|
146
|
+
title?: string;
|
|
147
|
+
}): void;
|
|
148
|
+
/**
|
|
149
|
+
* Fires the `show` event with the specified type, namespace and message.
|
|
150
|
+
*
|
|
151
|
+
* @param data The message data.
|
|
152
|
+
* @param data.message The content of the notification.
|
|
153
|
+
* @param data.type The type of the message.
|
|
154
|
+
* @param data.namespace Additional event namespace.
|
|
155
|
+
* @param data.title The title of the notification.
|
|
156
|
+
*/
|
|
157
|
+
private _showNotification;
|
|
158
|
+
}
|
|
159
|
+
export type NotificationEventType = 'success' | 'info' | 'warning';
|
|
160
|
+
/**
|
|
161
|
+
* Fired when one of the `showSuccess()`, `showInfo()`, `showWarning()` methods is called.
|
|
162
|
+
*
|
|
163
|
+
* @eventName ~Notification#show
|
|
164
|
+
* @param data The notification data.
|
|
165
|
+
*/
|
|
166
|
+
export type NotificationShowEvent = {
|
|
167
|
+
name: 'show';
|
|
168
|
+
args: [data: NotificationShowEventData];
|
|
169
|
+
};
|
|
170
|
+
/**
|
|
171
|
+
* Fired when the `showSuccess()` method is called.
|
|
172
|
+
*
|
|
173
|
+
* @eventName ~Notification#show:success
|
|
174
|
+
* @param data The notification data.
|
|
175
|
+
*/
|
|
176
|
+
export type NotificationShowSuccessEvent = NotificationShowTypeEvent<'success'>;
|
|
177
|
+
/**
|
|
178
|
+
* Fired when the `showInfo()` method is called.
|
|
179
|
+
*
|
|
180
|
+
* @eventName ~Notification#show:info
|
|
181
|
+
* @param data The notification data.
|
|
182
|
+
*/
|
|
183
|
+
export type NotificationShowInfoEvent = NotificationShowTypeEvent<'info'>;
|
|
184
|
+
/**
|
|
185
|
+
* Fired when the `showWarning()` method is called.
|
|
186
|
+
*
|
|
187
|
+
* When this event is not handled or stopped by `event.stop()`, the `data.message` of this event will
|
|
188
|
+
* be automatically displayed as a system alert.
|
|
189
|
+
*
|
|
190
|
+
* @eventName ~Notification#show:warning
|
|
191
|
+
* @param data The notification data.
|
|
192
|
+
*/
|
|
193
|
+
export type NotificationShowWarningEvent = NotificationShowTypeEvent<'warning'>;
|
|
194
|
+
export type NotificationShowTypeEvent<NotificationType extends NotificationEventType> = {
|
|
195
|
+
name: `show:${NotificationType}` | `show:${NotificationType}:${string}`;
|
|
196
|
+
args: [data: NotificationShowEventData<NotificationType>];
|
|
197
|
+
};
|
|
198
|
+
export type NotificationShowEventData<NotificationType extends NotificationEventType = NotificationEventType> = {
|
|
199
|
+
/**
|
|
200
|
+
* The content of the notification.
|
|
201
|
+
*/
|
|
202
|
+
message: string;
|
|
203
|
+
/**
|
|
204
|
+
* The title of the notification.
|
|
205
|
+
*/
|
|
206
|
+
title: string;
|
|
207
|
+
/**
|
|
208
|
+
* The type of the notification.
|
|
209
|
+
*/
|
|
210
|
+
type: NotificationType;
|
|
211
|
+
};
|