@inpageedit/core 0.8.0 → 0.8.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/LICENSE +20 -20
- package/README.md +55 -55
- package/dist/ActionButton-BgbTKTg7.js.map +1 -1
- package/dist/CheckBox-D3rHnX7I.js.map +1 -1
- package/dist/{IconQuickEdit-YVn1ANbm.js → IconQuickEdit-CAL1HXIb.js} +4 -4
- package/dist/IconQuickEdit-CAL1HXIb.js.map +1 -0
- package/dist/InputBox-BV4m05Xs.js.map +1 -1
- package/dist/Preferences-Bg3J5Ur9.js.map +1 -1
- package/dist/RadioBox-nJqWsxW2.js.map +1 -1
- package/dist/__test__/utils/constants.d.ts +2 -2
- package/dist/components/index.js.map +1 -1
- package/dist/index-9M1QcjCN.js +354 -0
- package/dist/index-9M1QcjCN.js.map +1 -0
- package/dist/{index-C0V2s48o.js → index-Ba7Wkale.js} +38 -33
- package/dist/index-Ba7Wkale.js.map +1 -0
- package/dist/index-Bh70Udzi.js.map +1 -1
- package/dist/{index--xn9BebC.js → index-C8dOYIIz.js} +61 -69
- package/dist/{index--xn9BebC.js.map → index-C8dOYIIz.js.map} +1 -1
- package/dist/{index-DpLwTw4C.js → index-COlXHFRg.js} +2599 -2080
- package/dist/index-COlXHFRg.js.map +1 -0
- package/dist/{index-DTA86mHU.js → index-CeXR4lOu.js} +5 -5
- package/dist/index-CeXR4lOu.js.map +1 -0
- package/dist/index-CvhkVj_L.js.map +1 -1
- package/dist/{index-VzP81S7B.js → index-DBV8FBjA.js} +2 -2
- package/dist/index-DBV8FBjA.js.map +1 -0
- package/dist/{index-DlgTb4XY.js → index-DwyuBkCK.js} +3 -3
- package/dist/index-DwyuBkCK.js.map +1 -0
- package/dist/{index-DDWds9Jg.js → index-OBerV4GU.js} +28 -28
- package/dist/index-OBerV4GU.js.map +1 -0
- package/dist/{index-TzKe6Ebm.js → index-Tn22YSmW.js} +2 -2
- package/dist/index-Tn22YSmW.js.map +1 -0
- package/dist/index-kRdAN8h3.js +193 -0
- package/dist/index-kRdAN8h3.js.map +1 -0
- package/dist/index-lZkYoUca.js.map +1 -1
- package/dist/{index-BT1mN_St.js → index-mntCdHRr.js} +3 -3
- package/dist/{index-BT1mN_St.js.map → index-mntCdHRr.js.map} +1 -1
- package/dist/index.js +1 -1
- package/dist/makeCallable-LDU0xZMJ.js.map +1 -1
- package/dist/models/WikiTitle/index.d.ts +1 -0
- package/dist/noop-ClDc6zv4.js.map +1 -1
- package/dist/plugins/in-article-links/index.d.ts +1 -1
- package/dist/plugins/quick-delete/index.d.ts +1 -1
- package/dist/plugins/quick-diff/PluginQuickDiffCore.d.ts +1 -1
- package/dist/plugins/quick-edit/index.d.ts +1 -1
- package/dist/plugins/quick-preview/index.d.ts +1 -1
- package/dist/services/CurrentPageService.d.ts +27 -0
- package/dist/services/{ModalService/index.d.ts → ModalService.d.ts} +4 -4
- package/dist/services/WikiTitleService.d.ts +19 -7
- package/dist/style.css +1 -1
- package/lib/index.umd.js +34 -35
- package/lib/index.umd.js.map +1 -1
- package/lib/style.css +1 -1
- package/package.json +7 -6
- package/dist/IconQuickEdit-YVn1ANbm.js.map +0 -1
- package/dist/index-C0V2s48o.js.map +0 -1
- package/dist/index-DDWds9Jg.js.map +0 -1
- package/dist/index-DDef1ojx.js +0 -166
- package/dist/index-DDef1ojx.js.map +0 -1
- package/dist/index-DTA86mHU.js.map +0 -1
- package/dist/index-DlgTb4XY.js.map +0 -1
- package/dist/index-DpLwTw4C.js.map +0 -1
- package/dist/index-TzKe6Ebm.js.map +0 -1
- package/dist/index-VzP81S7B.js.map +0 -1
- package/dist/index-loWqosf7.js +0 -331
- package/dist/index-loWqosf7.js.map +0 -1
- package/dist/services/ModalService/IPEModal.d.ts +0 -235
|
@@ -1,235 +0,0 @@
|
|
|
1
|
-
export type SsiModalSizeClass = 'dialog' | 'small' | 'smallToMedium' | 'medium' | 'mediumToLarge' | 'large' | 'full' | 'auto';
|
|
2
|
-
export type IPEModalAnimation = string | {
|
|
3
|
-
/** animation name when showing; set false to disable */
|
|
4
|
-
show?: string | false;
|
|
5
|
-
/** animation name when hiding; set false to disable */
|
|
6
|
-
hide?: string | false;
|
|
7
|
-
} | false;
|
|
8
|
-
export type AnyContent = string | Node | any;
|
|
9
|
-
export interface IPEModalButtonOptions {
|
|
10
|
-
/** Button label content (text node by default; not parsed as HTML). */
|
|
11
|
-
label: AnyContent;
|
|
12
|
-
/** Render as <button> (default) or <a>. */
|
|
13
|
-
type?: 'button' | 'link';
|
|
14
|
-
/** Extra class names. */
|
|
15
|
-
className?: string;
|
|
16
|
-
/** Enable the button after N ms; set false to skip. */
|
|
17
|
-
enableAfter?: number | false;
|
|
18
|
-
/** Element id attribute. */
|
|
19
|
-
id?: string;
|
|
20
|
-
/** Click handler; `this` is the element; receives mouse event and modal instance. */
|
|
21
|
-
method?: (this: HTMLButtonElement | HTMLAnchorElement, event: MouseEvent, modal: IPEModal) => void;
|
|
22
|
-
/** Button group side within footer. */
|
|
23
|
-
side?: 'left' | 'right';
|
|
24
|
-
/** Keyboard shortcut for this button (e.g. 'Enter' | 'Escape' | 'y'). */
|
|
25
|
-
keyPress?: string;
|
|
26
|
-
/** Close modal after N ms once the button is clicked; set false to skip. */
|
|
27
|
-
closeAfter?: number | false;
|
|
28
|
-
/** Only for type:'link'. */
|
|
29
|
-
href?: string;
|
|
30
|
-
}
|
|
31
|
-
export interface IPEModalOptions {
|
|
32
|
-
/** Extra class names applied to the window element. */
|
|
33
|
-
className?: string;
|
|
34
|
-
/** Predefined size class. */
|
|
35
|
-
sizeClass?: SsiModalSizeClass;
|
|
36
|
-
/** Center the modal (adds .is-centered on host). */
|
|
37
|
-
center?: boolean;
|
|
38
|
-
/** Keep a fixed height (px) or enable fixed-height mode; layout via CSS. */
|
|
39
|
-
fixedHeight?: boolean | number;
|
|
40
|
-
/** Fullscreen layout helper. */
|
|
41
|
-
fitScreen?: boolean;
|
|
42
|
-
/** Render icon-style buttons in header (styling only). */
|
|
43
|
-
iconButtons?: boolean;
|
|
44
|
-
/** Show close (×) icon in header. */
|
|
45
|
-
closeIcon?: boolean;
|
|
46
|
-
title?: AnyContent;
|
|
47
|
-
content?: AnyContent;
|
|
48
|
-
buttons?: Partial<IPEModalButtonOptions>[];
|
|
49
|
-
/**
|
|
50
|
-
* Backdrop behavior:
|
|
51
|
-
* - true (default): dedicated backdrop per modal
|
|
52
|
-
* - 'shared' or 'byKindShared': reserved for external coordination
|
|
53
|
-
* - false: no backdrop (floating window)
|
|
54
|
-
*/
|
|
55
|
-
backdrop?: boolean | 'shared' | 'byKindShared';
|
|
56
|
-
/**
|
|
57
|
-
* Close when clicking on the backdrop. Ignored when `backdrop === false`.
|
|
58
|
-
*/
|
|
59
|
-
outSideClose?: boolean;
|
|
60
|
-
/**
|
|
61
|
-
* Allow body scrolling while the modal is open. Default: **false** (lock scroll).
|
|
62
|
-
*/
|
|
63
|
-
bodyScroll?: boolean;
|
|
64
|
-
/** Stack behavior placeholder (kept for parity). */
|
|
65
|
-
stack?: boolean;
|
|
66
|
-
/** Navigation placeholder (kept for parity). */
|
|
67
|
-
navigation?: boolean;
|
|
68
|
-
/** Enable drag only when `backdrop === false`. */
|
|
69
|
-
draggable?: boolean;
|
|
70
|
-
/** Window animation (or legacy `animation`). */
|
|
71
|
-
animation?: IPEModalAnimation;
|
|
72
|
-
/** Preferred: animation for modal window element. */
|
|
73
|
-
modalAnimation?: IPEModalAnimation;
|
|
74
|
-
/** Animation for backdrop element. */
|
|
75
|
-
backdropAnimation?: IPEModalAnimation;
|
|
76
|
-
/**
|
|
77
|
-
* Fallback duration (ms) used when CSS events are not observable.
|
|
78
|
-
*/
|
|
79
|
-
animationSpeed?: number;
|
|
80
|
-
/** Auto-close options. */
|
|
81
|
-
closeAfter?: {
|
|
82
|
-
/**
|
|
83
|
-
* Close the modal/toast after `time` ms. For toast: defaults to 3000ms.
|
|
84
|
-
*/
|
|
85
|
-
time: number;
|
|
86
|
-
/** Not used by library (reserved for UI display). */
|
|
87
|
-
displayTime?: number;
|
|
88
|
-
/** Reset countdown when hovered. */
|
|
89
|
-
resetOnHover?: boolean;
|
|
90
|
-
} | number;
|
|
91
|
-
/** Kept for parity; CSS controls actual layout. */
|
|
92
|
-
position?: 'right top' | 'right bottom' | 'left top' | 'left bottom' | 'center top' | 'center bottom';
|
|
93
|
-
/** Return false to cancel showing. */
|
|
94
|
-
beforeShow?: (modal: IPEModal) => boolean | void;
|
|
95
|
-
onShow?: (modal: IPEModal) => void;
|
|
96
|
-
/** Return false to cancel closing. */
|
|
97
|
-
beforeClose?: (modal: IPEModal) => boolean | void;
|
|
98
|
-
onClose?: (modal: IPEModal) => void;
|
|
99
|
-
/**
|
|
100
|
-
* Called when clicking the close icon. If a function returns false or value is `false`,
|
|
101
|
-
* the modal will NOT close. If value is `true` or omitted, it closes as usual.
|
|
102
|
-
*/
|
|
103
|
-
onClickClose?: boolean | ((modal: IPEModal) => boolean | void);
|
|
104
|
-
}
|
|
105
|
-
export type IPEModalNotifyType = 'default' | 'info' | 'success' | 'warning' | 'error' | 'confirm' | string;
|
|
106
|
-
export type IPEModalNotifyPosition = 'top right' | 'top left' | 'bottom right' | 'bottom left';
|
|
107
|
-
export declare enum IPEModalEvent {
|
|
108
|
-
Init = "modal.init",
|
|
109
|
-
BeforeShow = "modal.beforeShow",
|
|
110
|
-
Show = "modal.show",
|
|
111
|
-
BeforeClose = "modal.beforeClose",
|
|
112
|
-
Close = "modal.close",
|
|
113
|
-
Destroy = "modal.destroy",
|
|
114
|
-
ToastShow = "toast.show",
|
|
115
|
-
ToastClose = "toast.close"
|
|
116
|
-
}
|
|
117
|
-
export type IPEModalHook = (ev: CustomEvent<IPEModal>) => boolean | void;
|
|
118
|
-
declare global {
|
|
119
|
-
interface HTMLElementEventMap {
|
|
120
|
-
'modal.init': CustomEvent<IPEModal>;
|
|
121
|
-
'modal.beforeShow': CustomEvent<IPEModal>;
|
|
122
|
-
'modal.show': CustomEvent<IPEModal>;
|
|
123
|
-
'modal.beforeClose': CustomEvent<IPEModal>;
|
|
124
|
-
'modal.close': CustomEvent<IPEModal>;
|
|
125
|
-
'modal.destroy': CustomEvent<IPEModal>;
|
|
126
|
-
'toast.show': CustomEvent<IPEModal>;
|
|
127
|
-
'toast.close': CustomEvent<IPEModal>;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
export declare class IPEModal {
|
|
131
|
-
readonly backdropId: string;
|
|
132
|
-
readonly modalId: string;
|
|
133
|
-
readonly numberId: string;
|
|
134
|
-
private _isDestroyed;
|
|
135
|
-
get isDestroyed(): boolean;
|
|
136
|
-
options: IPEModalOptions;
|
|
137
|
-
/** Logical grouping for stack ops (e.g., 'toast'). */
|
|
138
|
-
pluginName: string;
|
|
139
|
-
private $backdrop?;
|
|
140
|
-
private $modal?;
|
|
141
|
-
private $window?;
|
|
142
|
-
private $header?;
|
|
143
|
-
private $title?;
|
|
144
|
-
private $icons?;
|
|
145
|
-
private $content?;
|
|
146
|
-
private $footer?;
|
|
147
|
-
private $buttonsLeft?;
|
|
148
|
-
private $buttonsRight?;
|
|
149
|
-
private buttonElsLeft;
|
|
150
|
-
private buttonElsRight;
|
|
151
|
-
private keyMap;
|
|
152
|
-
private isOpen;
|
|
153
|
-
private lastFocused?;
|
|
154
|
-
private closeTimer?;
|
|
155
|
-
private isToast;
|
|
156
|
-
private isDragging;
|
|
157
|
-
private dragStartX;
|
|
158
|
-
private dragStartY;
|
|
159
|
-
private modalStartX;
|
|
160
|
-
private modalStartY;
|
|
161
|
-
Event: typeof IPEModalEvent;
|
|
162
|
-
DEFAULT_OPTIONS: IPEModalOptions;
|
|
163
|
-
constructor(options?: Partial<IPEModalOptions>);
|
|
164
|
-
init(): this;
|
|
165
|
-
show(): this;
|
|
166
|
-
close(): this;
|
|
167
|
-
/** Immediately removes DOM and listeners */
|
|
168
|
-
destroy(): this;
|
|
169
|
-
get$backdrop(): HTMLDivElement | undefined;
|
|
170
|
-
get$modal(): HTMLDivElement;
|
|
171
|
-
get$window(): HTMLDivElement;
|
|
172
|
-
get$header(): HTMLDivElement;
|
|
173
|
-
get$title(): HTMLHeadingElement;
|
|
174
|
-
get$content(): HTMLDivElement;
|
|
175
|
-
get$icons(): HTMLDivElement;
|
|
176
|
-
get$buttons(type?: 'buttons' | 'leftButtons' | 'rightButtons'): HTMLDivElement;
|
|
177
|
-
setTitle(title: AnyContent): this;
|
|
178
|
-
setContent(content: AnyContent, method?: 'replace' | 'append' | 'prepend'): this;
|
|
179
|
-
setIcons(icons: {
|
|
180
|
-
className: string;
|
|
181
|
-
method: () => void;
|
|
182
|
-
}[]): this;
|
|
183
|
-
setButtons(buttons: Partial<IPEModalButtonOptions>[], area?: HTMLElement): this;
|
|
184
|
-
generateButton(opts: Partial<IPEModalButtonOptions>): HTMLButtonElement | HTMLAnchorElement;
|
|
185
|
-
/** Dynamically add button(s) into footer. Supports insertion index per side. */
|
|
186
|
-
addButton(opts: Partial<IPEModalButtonOptions>, index?: number): this;
|
|
187
|
-
/** Remove button by element / id / global index (left first, then right). */
|
|
188
|
-
removeButton(target: number | string | HTMLElement | '*'): this;
|
|
189
|
-
changePreviewState(): this;
|
|
190
|
-
setModalHeight(offset: number, option?: 'height' | 'min-height' | 'max-height'): number;
|
|
191
|
-
setOptions<T extends keyof IPEModalOptions>(option: T, value: IPEModalOptions[T]): this;
|
|
192
|
-
setOptions(options: Partial<IPEModalOptions>): this;
|
|
193
|
-
setPluginName(name: string): this;
|
|
194
|
-
private applyAnimation;
|
|
195
|
-
private _hooks;
|
|
196
|
-
on(type: IPEModalEvent, listener: IPEModalHook): () => this;
|
|
197
|
-
off(type: IPEModalEvent, listener?: IPEModalHook): this;
|
|
198
|
-
once(type: IPEModalEvent, listener: IPEModalHook): () => this;
|
|
199
|
-
private emit;
|
|
200
|
-
private focusFirst;
|
|
201
|
-
private onKeyDown;
|
|
202
|
-
private startCloseTimer;
|
|
203
|
-
private stopCloseTimer;
|
|
204
|
-
setZIndex(z: number): void;
|
|
205
|
-
/** Bring this modal to the top of the stack. */
|
|
206
|
-
bringToFront(): this;
|
|
207
|
-
private isAnimationDisabled;
|
|
208
|
-
private shouldLockBodyOnOpen;
|
|
209
|
-
private shouldUnlockBodyOnClose;
|
|
210
|
-
private onDragStart;
|
|
211
|
-
private onDragMove;
|
|
212
|
-
private onDragEnd;
|
|
213
|
-
/** Show as toast (no backdrop, container stack). */
|
|
214
|
-
showToast(options: Partial<{
|
|
215
|
-
position: IPEModalNotifyPosition;
|
|
216
|
-
}>): this;
|
|
217
|
-
static show(options: Partial<IPEModalOptions>, _element?: AnyContent): IPEModal;
|
|
218
|
-
static createObject(options: Partial<IPEModalOptions>, _element?: AnyContent): IPEModal;
|
|
219
|
-
static close(modalId?: string | HTMLElement): IPEModal | undefined;
|
|
220
|
-
static closeAll(group?: string | string[], except?: string | string[]): IPEModal;
|
|
221
|
-
static removeAll(): void;
|
|
222
|
-
static dialog(options: Partial<IPEModalOptions>, method: (e: MouseEvent, m: IPEModal) => void): IPEModal;
|
|
223
|
-
static confirm(options: Partial<IPEModalOptions> & Partial<{
|
|
224
|
-
okBtn: Pick<IPEModalButtonOptions, 'label' | 'className'>;
|
|
225
|
-
cancelBtn: Pick<IPEModalButtonOptions, 'label' | 'className'>;
|
|
226
|
-
}>, method: (e: MouseEvent, m: IPEModal) => void): IPEModal;
|
|
227
|
-
static getDefaultNotifyIcon(type: IPEModalNotifyType): import('jsx-dom').ReactElement | null;
|
|
228
|
-
static notify(type: IPEModalNotifyType, options: Partial<IPEModalOptions> & Partial<{
|
|
229
|
-
icon: string | Element;
|
|
230
|
-
okBtn: Pick<IPEModalButtonOptions, 'label' | 'className'>;
|
|
231
|
-
cancelBtn: Pick<IPEModalButtonOptions, 'label' | 'className'>;
|
|
232
|
-
overrideOther: boolean;
|
|
233
|
-
position: IPEModalNotifyPosition;
|
|
234
|
-
}>, callback?: (result: boolean) => void): IPEModal;
|
|
235
|
-
}
|