@inpageedit/core 0.12.1 → 0.13.0-alpha.0
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/BasePlugin-Bf2UuIHF.js +64 -0
- package/dist/BasePlugin-Bf2UuIHF.js.map +1 -0
- package/dist/{PluginPrefSync-Ziogy_o-.js → PluginPrefSync-Dn1Xsiqz.js} +6 -4
- package/dist/PluginPrefSync-Dn1Xsiqz.js.map +1 -0
- package/dist/{PluginStoreApp-Bnvyl-Oc.js → PluginStoreApp-CpOLArL7.js} +2 -2
- package/dist/{PluginStoreApp-Bnvyl-Oc.js.map → PluginStoreApp-CpOLArL7.js.map} +1 -1
- package/dist/WatchlistAction-BbNAyryN.js +5 -0
- package/dist/WatchlistAction-BbNAyryN.js.map +1 -0
- package/dist/endpoints-DgyuoRZd.js +1507 -0
- package/dist/endpoints-DgyuoRZd.js.map +1 -0
- package/dist/{index-BvuaLEFc.js → index-2RfILgXm.js} +11 -10
- package/dist/{index-BvuaLEFc.js.map → index-2RfILgXm.js.map} +1 -1
- package/dist/{index-eARjMi7f.js → index-BCdABp0e.js} +23 -22
- package/dist/{index-eARjMi7f.js.map → index-BCdABp0e.js.map} +1 -1
- package/dist/{index-zHTGCjfF.js → index-BJ7_Q1mB.js} +8 -7
- package/dist/{index-zHTGCjfF.js.map → index-BJ7_Q1mB.js.map} +1 -1
- package/dist/{index-Dnmv-xDn.js → index-BNh95-x2.js} +37 -49
- package/dist/index-BNh95-x2.js.map +1 -0
- package/dist/{index-B3FUDhxl.js → index-BQ-cHWkJ.js} +15 -16
- package/dist/{index-B3FUDhxl.js.map → index-BQ-cHWkJ.js.map} +1 -1
- package/dist/{index-B3YJdjxo.js → index-BwdWyHLe.js} +77 -76
- package/dist/{index-B3YJdjxo.js.map → index-BwdWyHLe.js.map} +1 -1
- package/dist/{index-Ccr3YhkP.js → index-CCRMmnwk.js} +10 -9
- package/dist/{index-Ccr3YhkP.js.map → index-CCRMmnwk.js.map} +1 -1
- package/dist/{index-Bd70aDMT.js → index-CnIpUF9x.js} +7 -6
- package/dist/{index-Bd70aDMT.js.map → index-CnIpUF9x.js.map} +1 -1
- package/dist/{index-D5zX93bn.js → index-CyG7_IYz.js} +47 -45
- package/dist/{index-D5zX93bn.js.map → index-CyG7_IYz.js.map} +1 -1
- package/dist/index-DdTiZqwt.js +3744 -0
- package/dist/index-DdTiZqwt.js.map +1 -0
- package/dist/{index-BRjEc8b8.js → index-eSlbrNqF.js} +6 -6
- package/dist/{index-BRjEc8b8.js.map → index-eSlbrNqF.js.map} +1 -1
- package/dist/index.d.ts +1723 -31
- package/dist/index.js +73 -9
- package/dist/index.js.map +1 -1
- package/dist/models/index.js +486 -0
- package/dist/models/index.js.map +1 -0
- package/dist/plugins/index.js +23 -0
- package/dist/plugins/index.js.map +1 -0
- package/dist/services/index.js +16 -0
- package/dist/services/index.js.map +1 -0
- package/dist/style.css +1 -1
- package/lib/index.umd.js +10 -10
- package/lib/index.umd.js.map +1 -1
- package/package.json +22 -25
- package/dist/InPageEdit.d.ts +0 -42
- package/dist/PluginPrefSync-Ziogy_o-.js.map +0 -1
- package/dist/__test__/utils/constants.d.ts +0 -3
- package/dist/components/ActionButton.d.ts +0 -6
- package/dist/components/CheckBox.d.ts +0 -10
- package/dist/components/Icon/IconEdit.d.ts +0 -2
- package/dist/components/Icon/IconQuickEdit.d.ts +0 -2
- package/dist/components/InputBox.d.ts +0 -11
- package/dist/components/MBox/index.d.ts +0 -14
- package/dist/components/MwUserLinks.d.ts +0 -6
- package/dist/components/ProgressBar/index.d.ts +0 -7
- package/dist/components/RadioBox.d.ts +0 -10
- package/dist/components/TabView/index.d.ts +0 -19
- package/dist/components/TwinSwapInput/index.d.ts +0 -19
- package/dist/components/index.d.ts +0 -8
- package/dist/components/utils.d.ts +0 -4
- package/dist/constants/endpoints.d.ts +0 -8
- package/dist/decorators/Preferences.d.ts +0 -35
- package/dist/index-DgQNTfPR.js +0 -5829
- package/dist/index-DgQNTfPR.js.map +0 -1
- package/dist/index-Dnmv-xDn.js.map +0 -1
- package/dist/models/MemoryStorage.d.ts +0 -10
- package/dist/models/WikiPage/index.d.ts +0 -76
- package/dist/models/WikiPage/types/PageInfo.d.ts +0 -58
- package/dist/models/WikiPage/types/PageParseData.d.ts +0 -17
- package/dist/models/WikiPage/types/WatchlistAction.d.ts +0 -6
- package/dist/models/WikiTitle/index.d.ts +0 -89
- package/dist/models/WikiTitle/index.spec.d.ts +0 -1
- package/dist/plugins/BasePlugin.d.ts +0 -25
- package/dist/plugins/_debug/index.d.ts +0 -8
- package/dist/plugins/analytics/index.d.ts +0 -41
- package/dist/plugins/in-article-links/index.d.ts +0 -44
- package/dist/plugins/plugin-store/index.d.ts +0 -56
- package/dist/plugins/plugin-store/schema.d.ts +0 -41
- package/dist/plugins/preferences-ui/PluginPrefSync.d.ts +0 -28
- package/dist/plugins/preferences-ui/index.d.ts +0 -48
- package/dist/plugins/quick-diff/components/DiffTable.d.ts +0 -23
- package/dist/plugins/quick-diff/index.d.ts +0 -85
- package/dist/plugins/quick-edit/index.d.ts +0 -79
- package/dist/plugins/quick-move/index.d.ts +0 -47
- package/dist/plugins/quick-preview/index.d.ts +0 -37
- package/dist/plugins/quick-redirect/index.d.ts +0 -48
- package/dist/plugins/toolbox/index.d.ts +0 -65
- package/dist/polyfills/Promise.withResolvers.d.ts +0 -5
- package/dist/polyfills/index.d.ts +0 -0
- package/dist/services/ApiService.d.ts +0 -14
- package/dist/services/CurrentPageService.d.ts +0 -28
- package/dist/services/ModalService.d.ts +0 -27
- package/dist/services/PreferencesService.d.ts +0 -94
- package/dist/services/ResourceLoaderService.d.ts +0 -17
- package/dist/services/WikiMetadataService.d.ts +0 -108
- package/dist/services/WikiPageService.d.ts +0 -20
- package/dist/services/WikiTitleService.d.ts +0 -70
- package/dist/services/storage/index.d.ts +0 -40
- package/dist/services/storage/managers/IDBStorageManager.d.ts +0 -28
- package/dist/services/storage/managers/LocalStorageManager.d.ts +0 -27
- package/dist/types/WikiMetadata.d.ts +0 -131
- package/dist/utils/computeable.d.ts +0 -2
- package/dist/utils/defineAsyncPlugin.d.ts +0 -2
- package/dist/utils/interpolate.d.ts +0 -20
- package/dist/utils/interpolate.spec.d.ts +0 -1
- package/dist/utils/makeCallable.d.ts +0 -3
- package/dist/utils/noop.d.ts +0 -1
- package/dist/utils/sleep.d.ts +0 -1
- package/dist/utils/string.d.ts +0 -7
- package/dist/utils/url.d.ts +0 -24
- package/dist/utils/vueHooks.d.ts +0 -6
- package/dist/utils/vueReactivity.d.ts +0 -2
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { InPageEdit } from '../../InPageEdit';
|
|
2
|
-
import { IPEModal, IPEModalOptions } from '@inpageedit/modal';
|
|
3
|
-
import { IWikiPage } from '../../models/WikiPage/index.js';
|
|
4
|
-
declare module '../../InPageEdit' {
|
|
5
|
-
interface InPageEdit {
|
|
6
|
-
quickDiff: PluginQuickDiff;
|
|
7
|
-
}
|
|
8
|
-
interface Events {
|
|
9
|
-
'quick-diff/init-options'(payload: {
|
|
10
|
-
ctx: InPageEdit;
|
|
11
|
-
options: Partial<CompareApiRequestOptions>;
|
|
12
|
-
}): void;
|
|
13
|
-
'quick-diff/loaded'(payload: {
|
|
14
|
-
ctx: InPageEdit;
|
|
15
|
-
modal: IPEModal;
|
|
16
|
-
compare: CompareApiResponse['compare'];
|
|
17
|
-
}): void;
|
|
18
|
-
'quick-diff/quick-edit-modal'(payload: {
|
|
19
|
-
ctx: InPageEdit;
|
|
20
|
-
modal: IPEModal;
|
|
21
|
-
wikiPage: IWikiPage;
|
|
22
|
-
}): void;
|
|
23
|
-
}
|
|
24
|
-
interface PreferencesMap {
|
|
25
|
-
'quickDiff.keyshortcut': string;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
export interface CompareApiRequestOptions {
|
|
29
|
-
fromtitle: string;
|
|
30
|
-
fromid: number;
|
|
31
|
-
fromrev: number;
|
|
32
|
-
frompst: boolean;
|
|
33
|
-
totitle: string;
|
|
34
|
-
toid: number;
|
|
35
|
-
torev: number;
|
|
36
|
-
torelative?: 'cur' | 'prev' | 'next';
|
|
37
|
-
topst: boolean;
|
|
38
|
-
prop: string;
|
|
39
|
-
difftype: 'table' | 'unified';
|
|
40
|
-
fromtext: string;
|
|
41
|
-
fromsection: string | number;
|
|
42
|
-
fromcontentmodel: string;
|
|
43
|
-
totext: string;
|
|
44
|
-
tosection: string | number;
|
|
45
|
-
tocontentmodel: string;
|
|
46
|
-
}
|
|
47
|
-
export interface CompareApiResponse {
|
|
48
|
-
compare: Partial<{
|
|
49
|
-
fromid: number;
|
|
50
|
-
fromrevid: number;
|
|
51
|
-
fromns: number;
|
|
52
|
-
fromtitle: string;
|
|
53
|
-
fromsize: number;
|
|
54
|
-
fromtimestamp: string;
|
|
55
|
-
fromuser: string;
|
|
56
|
-
fromuserid: number;
|
|
57
|
-
fromcomment: string;
|
|
58
|
-
fromparsedcomment?: string;
|
|
59
|
-
toid: number;
|
|
60
|
-
torevid: number;
|
|
61
|
-
tons: number;
|
|
62
|
-
totitle: string;
|
|
63
|
-
tosize: number;
|
|
64
|
-
totimestamp: string;
|
|
65
|
-
touser: string;
|
|
66
|
-
touserid: number;
|
|
67
|
-
tocomment: string;
|
|
68
|
-
toparsedcomment: string;
|
|
69
|
-
diffsize: number;
|
|
70
|
-
prev: number;
|
|
71
|
-
next: number;
|
|
72
|
-
}> & {
|
|
73
|
-
body: string;
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
export declare class PluginQuickDiff extends BasePlugin {
|
|
77
|
-
ctx: InPageEdit;
|
|
78
|
-
constructor(ctx: InPageEdit);
|
|
79
|
-
protected start(): Promise<void> | void;
|
|
80
|
-
protected stop(): Promise<void> | void;
|
|
81
|
-
private injectHistoryPage;
|
|
82
|
-
private injectQuickEdit;
|
|
83
|
-
readonly COMPARE_API_DEFAULT_OPTIONS: Partial<CompareApiRequestOptions>;
|
|
84
|
-
comparePages(options: Partial<CompareApiRequestOptions>, modal?: IPEModal, modalOptions?: Partial<IPEModalOptions>): IPEModal;
|
|
85
|
-
}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { InPageEdit } from '../../InPageEdit';
|
|
2
|
-
import { IWikiPage } from '../../models/WikiPage';
|
|
3
|
-
import { WatchlistAction } from '../../models/WikiPage/types/WatchlistAction';
|
|
4
|
-
import { IPEModal } from '@inpageedit/modal';
|
|
5
|
-
import { ReactNode } from 'jsx-dom';
|
|
6
|
-
declare module '../../InPageEdit' {
|
|
7
|
-
interface InPageEdit {
|
|
8
|
-
quickEdit: PluginQuickEdit & {
|
|
9
|
-
(...args: Parameters<PluginQuickEdit['showModal']>): ReturnType<PluginQuickEdit['showModal']>;
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
interface Events {
|
|
13
|
-
'quick-edit/init-options'(payload: Omit<QuickEditEventPayload, 'modal' | 'wikiPage'>): void;
|
|
14
|
-
'quick-edit/show-modal'(payload: Omit<QuickEditEventPayload, 'wikiPage'>): void;
|
|
15
|
-
'quick-edit/wiki-page'(payload: QuickEditEventPayload): void;
|
|
16
|
-
'quick-edit/edit-notice'(payload: QuickEditEventPayload & {
|
|
17
|
-
editNotices: ReactNode[];
|
|
18
|
-
}): void;
|
|
19
|
-
'quick-edit/submit'(payload: QuickEditSubmitPayload & {
|
|
20
|
-
ctx: InPageEdit;
|
|
21
|
-
}): void;
|
|
22
|
-
}
|
|
23
|
-
interface PreferencesMap {
|
|
24
|
-
'quickEdit.editSummary': string;
|
|
25
|
-
'quickEdit.editMinor': boolean;
|
|
26
|
-
'quickEdit.outSideClose': boolean;
|
|
27
|
-
'quickEdit.watchList': WatchlistAction;
|
|
28
|
-
'quickEdit.keyshortcut.save': string;
|
|
29
|
-
'quickEdit.editFont': string;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
export interface QuickEditOptions {
|
|
33
|
-
title: string;
|
|
34
|
-
pageId: number;
|
|
35
|
-
revision: number;
|
|
36
|
-
/**
|
|
37
|
-
* - `undefined` for full article edit
|
|
38
|
-
* - `0` for the first section
|
|
39
|
-
* - `"new"` for a new section
|
|
40
|
-
*/
|
|
41
|
-
section: number | 'new' | undefined;
|
|
42
|
-
editMinor: boolean;
|
|
43
|
-
editSummary: string;
|
|
44
|
-
createOnly: boolean;
|
|
45
|
-
reloadAfterSave: boolean;
|
|
46
|
-
}
|
|
47
|
-
export interface QuickEditEventPayload {
|
|
48
|
-
ctx: InPageEdit;
|
|
49
|
-
options: QuickEditOptions;
|
|
50
|
-
modal: IPEModal;
|
|
51
|
-
wikiPage: IWikiPage;
|
|
52
|
-
}
|
|
53
|
-
export interface QuickEditSubmitPayload {
|
|
54
|
-
wikiPage: IWikiPage;
|
|
55
|
-
text?: string;
|
|
56
|
-
summary?: string;
|
|
57
|
-
section?: number | 'new' | undefined;
|
|
58
|
-
minor?: boolean;
|
|
59
|
-
createonly?: boolean;
|
|
60
|
-
watchlist?: WatchlistAction;
|
|
61
|
-
}
|
|
62
|
-
export declare class PluginQuickEdit extends BasePlugin {
|
|
63
|
-
ctx: InPageEdit;
|
|
64
|
-
private readonly DEFAULT_OPTIONS;
|
|
65
|
-
constructor(ctx: InPageEdit);
|
|
66
|
-
protected start(): Promise<void> | void;
|
|
67
|
-
showModal(payload?: string | Partial<QuickEditOptions>): Promise<void>;
|
|
68
|
-
handleSubmit(payload: QuickEditSubmitPayload): Promise<Required<import('wiki-saikou').FexiosContext<import('wiki-saikou').MwApiResponse<{
|
|
69
|
-
success: boolean;
|
|
70
|
-
}>>>>;
|
|
71
|
-
static readonly BUILT_IN_FONT_OPTIONS: string[];
|
|
72
|
-
getEditFontOptions(): Promise<{
|
|
73
|
-
className: string;
|
|
74
|
-
fontFamily: string;
|
|
75
|
-
}>;
|
|
76
|
-
getWikiPageFromPayload(payload: Partial<QuickEditOptions>): Promise<IWikiPage>;
|
|
77
|
-
private injectToolbox;
|
|
78
|
-
protected removeToolbox(ctx: InPageEdit): void;
|
|
79
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { InPageEdit } from '../../InPageEdit';
|
|
2
|
-
import { IPEModal } from '@inpageedit/modal';
|
|
3
|
-
declare module '../../InPageEdit' {
|
|
4
|
-
interface InPageEdit {
|
|
5
|
-
quickMove: PluginQuickMove;
|
|
6
|
-
}
|
|
7
|
-
interface Events {
|
|
8
|
-
'quick-move/init-options'(payload: {
|
|
9
|
-
ctx: InPageEdit;
|
|
10
|
-
options: Partial<QuickMoveOptions>;
|
|
11
|
-
}): void;
|
|
12
|
-
'quick-move/show-modal'(payload: {
|
|
13
|
-
ctx: InPageEdit;
|
|
14
|
-
modal: IPEModal;
|
|
15
|
-
}): void;
|
|
16
|
-
'quick-move/submit'(payload: {
|
|
17
|
-
ctx: InPageEdit;
|
|
18
|
-
modal: IPEModal;
|
|
19
|
-
payload: MovePageOptions;
|
|
20
|
-
}): void;
|
|
21
|
-
}
|
|
22
|
-
interface PreferencesMap {
|
|
23
|
-
'quickMove.reason': string;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
export interface MovePageOptions {
|
|
27
|
-
from: string;
|
|
28
|
-
to: string;
|
|
29
|
-
reason?: string;
|
|
30
|
-
movetalk?: boolean;
|
|
31
|
-
movesubpages?: boolean;
|
|
32
|
-
noredirect?: boolean;
|
|
33
|
-
}
|
|
34
|
-
export interface QuickMoveOptions extends Partial<MovePageOptions> {
|
|
35
|
-
lockFromField?: boolean;
|
|
36
|
-
lockToField?: boolean;
|
|
37
|
-
}
|
|
38
|
-
export declare class PluginQuickMove extends BasePlugin {
|
|
39
|
-
ctx: InPageEdit;
|
|
40
|
-
constructor(ctx: InPageEdit);
|
|
41
|
-
protected start(): Promise<void> | void;
|
|
42
|
-
private injectToolbox;
|
|
43
|
-
showModal(options?: Partial<QuickMoveOptions>): Promise<import('../../services/ModalService').CustomIPEModal>;
|
|
44
|
-
movePage(options: MovePageOptions): Promise<Required<import('wiki-saikou').FexiosContext<import('wiki-saikou').MwApiResponse<{
|
|
45
|
-
success: boolean;
|
|
46
|
-
}>>>>;
|
|
47
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { InPageEdit } from '../../InPageEdit';
|
|
2
|
-
import { IWikiPage } from '../../models/WikiPage';
|
|
3
|
-
import { MwApiParams } from 'wiki-saikou';
|
|
4
|
-
import { PageParseData } from '../../models/WikiPage/types/PageParseData';
|
|
5
|
-
import { IPEModal, IPEModalOptions } from '@inpageedit/modal';
|
|
6
|
-
interface QuickPreviewEventPayload {
|
|
7
|
-
ctx: InPageEdit;
|
|
8
|
-
modal: IPEModal;
|
|
9
|
-
wikiPage: IWikiPage;
|
|
10
|
-
text: string;
|
|
11
|
-
parseData: PageParseData;
|
|
12
|
-
}
|
|
13
|
-
declare module '../../InPageEdit' {
|
|
14
|
-
interface InPageEdit {
|
|
15
|
-
quickPreview: PluginQuickPreview & {
|
|
16
|
-
(...args: Parameters<PluginQuickPreview['previewWikitext']>): ReturnType<PluginQuickPreview['previewWikitext']>;
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
interface Events {
|
|
20
|
-
'quick-preview/show-modal'(payload: Omit<QuickPreviewEventPayload, 'parseData'>): void;
|
|
21
|
-
'quick-preview/loaded'(payload: QuickPreviewEventPayload): void;
|
|
22
|
-
}
|
|
23
|
-
interface PreferencesMap {
|
|
24
|
-
'quickPreview.keyshortcut.quickEdit': string;
|
|
25
|
-
'quickPreview.keyshortcut.quickDelete': string;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
export declare class PluginQuickPreview extends BasePlugin {
|
|
29
|
-
ctx: InPageEdit;
|
|
30
|
-
constructor(ctx: InPageEdit);
|
|
31
|
-
protected start(): Promise<void> | void;
|
|
32
|
-
protected stop(): Promise<void> | void;
|
|
33
|
-
previewWikitext(text: string, params?: MwApiParams, wikiPage?: IWikiPage, modal?: IPEModal, modalOptions?: Partial<IPEModalOptions>): IPEModal;
|
|
34
|
-
private injectQuickEdit;
|
|
35
|
-
private injectQuickDelete;
|
|
36
|
-
}
|
|
37
|
-
export {};
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { InPageEdit, Schema } from '../../InPageEdit';
|
|
2
|
-
import { IPEModal } from '@inpageedit/modal';
|
|
3
|
-
declare module '../../InPageEdit' {
|
|
4
|
-
interface InPageEdit {
|
|
5
|
-
quickRedirect: PluginQuickRedirect;
|
|
6
|
-
}
|
|
7
|
-
interface Events {
|
|
8
|
-
'quick-redirect/init-options'(payload: {
|
|
9
|
-
ctx: InPageEdit;
|
|
10
|
-
options: Partial<QuickRedirectOptions>;
|
|
11
|
-
}): void;
|
|
12
|
-
'quick-redirect/show-modal'(payload: {
|
|
13
|
-
ctx: InPageEdit;
|
|
14
|
-
modal: IPEModal;
|
|
15
|
-
}): void;
|
|
16
|
-
'quick-redirect/submit'(payload: {
|
|
17
|
-
ctx: InPageEdit;
|
|
18
|
-
payload: RedirectPageOptions;
|
|
19
|
-
}): void;
|
|
20
|
-
}
|
|
21
|
-
interface PreferencesMap {
|
|
22
|
-
'quickRedirect.reason': string;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
export interface RedirectPageOptions {
|
|
26
|
-
from: string;
|
|
27
|
-
to: string;
|
|
28
|
-
reason?: string;
|
|
29
|
-
overwrite?: boolean;
|
|
30
|
-
}
|
|
31
|
-
export interface QuickRedirectOptions extends Partial<RedirectPageOptions> {
|
|
32
|
-
}
|
|
33
|
-
export declare class PluginQuickRedirect extends BasePlugin {
|
|
34
|
-
ctx: InPageEdit;
|
|
35
|
-
static readonly inject: string[];
|
|
36
|
-
static readonly PreferencesSchema: Schema<Schemastery.ObjectS<{
|
|
37
|
-
'quickRedirect.reason': Schema<string, string>;
|
|
38
|
-
}>, Schemastery.ObjectT<{
|
|
39
|
-
'quickRedirect.reason': Schema<string, string>;
|
|
40
|
-
}>>;
|
|
41
|
-
constructor(ctx: InPageEdit);
|
|
42
|
-
protected start(): Promise<void> | void;
|
|
43
|
-
protected stop(): Promise<void> | void;
|
|
44
|
-
showModal(options?: Partial<QuickRedirectOptions>): Promise<import('../../services/ModalService').CustomIPEModal>;
|
|
45
|
-
redirectPage(options: RedirectPageOptions): Promise<Required<import('wiki-saikou').FexiosContext<import('wiki-saikou').MwApiResponse<{
|
|
46
|
-
success: boolean;
|
|
47
|
-
}>>>>;
|
|
48
|
-
}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { InPageEdit, Service } from '../../InPageEdit';
|
|
2
|
-
import { JSX, ReactElement } from 'jsx-dom';
|
|
3
|
-
declare module '../../InPageEdit' {
|
|
4
|
-
interface InPageEdit {
|
|
5
|
-
toolbox: PluginToolbox;
|
|
6
|
-
}
|
|
7
|
-
interface Events {
|
|
8
|
-
'toolbox/button-added'(payload: {
|
|
9
|
-
ctx: InPageEdit;
|
|
10
|
-
button: HTMLElement;
|
|
11
|
-
}): void;
|
|
12
|
-
'toolbox/button-removed'(payload: {
|
|
13
|
-
ctx: InPageEdit;
|
|
14
|
-
id: string;
|
|
15
|
-
}): void;
|
|
16
|
-
'toolbox/button-clicked'(payload: {
|
|
17
|
-
ctx: InPageEdit;
|
|
18
|
-
button: HTMLElement;
|
|
19
|
-
id: string;
|
|
20
|
-
}): void;
|
|
21
|
-
'toolbox/toggle'(payload: {
|
|
22
|
-
ctx: InPageEdit;
|
|
23
|
-
opened: boolean;
|
|
24
|
-
}): void;
|
|
25
|
-
}
|
|
26
|
-
interface PreferencesMap {
|
|
27
|
-
toolboxAlwaysShow: boolean;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
export declare class PluginToolbox extends Service {
|
|
31
|
-
ctx: InPageEdit;
|
|
32
|
-
container: HTMLElement;
|
|
33
|
-
constructor(ctx: InPageEdit);
|
|
34
|
-
protected start(): Promise<void>;
|
|
35
|
-
protected stop(): void | Promise<void>;
|
|
36
|
-
private get isPersistent();
|
|
37
|
-
private setupHoverLogic;
|
|
38
|
-
/**
|
|
39
|
-
* 计算按钮动画延迟
|
|
40
|
-
* @param index 按钮索引(从0开始)
|
|
41
|
-
* @param totalCount 总按钮数量
|
|
42
|
-
* @returns 延迟时间(秒)
|
|
43
|
-
*/
|
|
44
|
-
private calculateButtonDelay;
|
|
45
|
-
/**
|
|
46
|
-
* 更新按钮组的动画延迟
|
|
47
|
-
*/
|
|
48
|
-
private updateButtonDelays;
|
|
49
|
-
private createToolbox;
|
|
50
|
-
private normalizeButtonId;
|
|
51
|
-
addButton(payload: {
|
|
52
|
-
id: string;
|
|
53
|
-
group?: 'auto' | 'group1' | 'group2';
|
|
54
|
-
icon: string | HTMLElement | SVGElement | ReactElement;
|
|
55
|
-
tooltip?: string | HTMLElement;
|
|
56
|
-
itemProps?: JSX.IntrinsicElements['li'];
|
|
57
|
-
buttonProps?: JSX.IntrinsicElements['button'];
|
|
58
|
-
onClick?: (event: MouseEvent) => void;
|
|
59
|
-
index?: number;
|
|
60
|
-
}): HTMLElement;
|
|
61
|
-
removeButton(id: string): void;
|
|
62
|
-
getContainer(): HTMLElement;
|
|
63
|
-
get isOpened(): boolean;
|
|
64
|
-
toggle(force?: boolean): void;
|
|
65
|
-
}
|
|
File without changes
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { InPageEdit } from '../InPageEdit';
|
|
2
|
-
import { FexiosConfigs } from 'wiki-saikou';
|
|
3
|
-
import { MwApi } from 'wiki-saikou/browser';
|
|
4
|
-
declare module '../InPageEdit' {
|
|
5
|
-
interface InPageEdit {
|
|
6
|
-
api: MwApi;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
export interface ApiServiceOptions extends Partial<FexiosConfigs> {
|
|
10
|
-
}
|
|
11
|
-
export declare class ApiService {
|
|
12
|
-
ctx: InPageEdit;
|
|
13
|
-
constructor(ctx: InPageEdit, options?: Partial<ApiServiceOptions>);
|
|
14
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { InPageEdit, Service } from '../InPageEdit.js';
|
|
2
|
-
import { IWikiTitle } from '../models/WikiTitle';
|
|
3
|
-
declare module '../InPageEdit.js' {
|
|
4
|
-
interface InPageEdit {
|
|
5
|
-
/**
|
|
6
|
-
* Basic information of the current web page
|
|
7
|
-
*/
|
|
8
|
-
currentPage: CurrentPageService;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
export declare class CurrentPageService extends Service {
|
|
12
|
-
#private;
|
|
13
|
-
readonly ctx: InPageEdit;
|
|
14
|
-
constructor(ctx: InPageEdit);
|
|
15
|
-
private get logger();
|
|
16
|
-
protected start(): Promise<void>;
|
|
17
|
-
protected stop(): void | Promise<void>;
|
|
18
|
-
url: URL;
|
|
19
|
-
get params(): URLSearchParams;
|
|
20
|
-
get canonicalUrl(): URL | null;
|
|
21
|
-
readonly isMainPage: boolean;
|
|
22
|
-
/**
|
|
23
|
-
* Get the title of the current page by location URL
|
|
24
|
-
* @returns IWikiTitle or null if cannot be determined
|
|
25
|
-
*/
|
|
26
|
-
wikiTitle: IWikiTitle | null;
|
|
27
|
-
get wikiAction(): string;
|
|
28
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { InPageEdit } from '../InPageEdit';
|
|
2
|
-
import { IPEModal, IPEModalEvent, IPEModalOptions } from '@inpageedit/modal';
|
|
3
|
-
export * from '@inpageedit/modal';
|
|
4
|
-
declare module '../InPageEdit' {
|
|
5
|
-
interface InPageEdit {
|
|
6
|
-
modal: ModalService;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
export declare class CustomIPEModal extends IPEModal {
|
|
10
|
-
constructor(options?: Partial<IPEModalOptions>);
|
|
11
|
-
private _tmpDisabledActiveInputs?;
|
|
12
|
-
setLoadingState(state: boolean): void;
|
|
13
|
-
}
|
|
14
|
-
export declare class ModalService {
|
|
15
|
-
ctx: InPageEdit;
|
|
16
|
-
constructor(ctx: InPageEdit);
|
|
17
|
-
IPEModal: typeof CustomIPEModal;
|
|
18
|
-
IPEModalEvent: typeof IPEModalEvent;
|
|
19
|
-
show: (...args: Parameters<typeof CustomIPEModal.show>) => CustomIPEModal;
|
|
20
|
-
createObject: (...args: Parameters<typeof CustomIPEModal.createObject>) => CustomIPEModal;
|
|
21
|
-
close: typeof IPEModal.close;
|
|
22
|
-
closeAll: typeof IPEModal.closeAll;
|
|
23
|
-
removeAll: typeof IPEModal.removeAll;
|
|
24
|
-
dialog: (...args: Parameters<typeof CustomIPEModal.dialog>) => CustomIPEModal;
|
|
25
|
-
confirm: (...args: Parameters<typeof CustomIPEModal.confirm>) => CustomIPEModal;
|
|
26
|
-
notify: (...args: Parameters<typeof CustomIPEModal.notify>) => CustomIPEModal;
|
|
27
|
-
}
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import { InPageEdit, Schema, Service, PreferencesMap } from '../InPageEdit.js';
|
|
2
|
-
import { ComputeAble } from '../utils/computeable.js';
|
|
3
|
-
declare module '../InPageEdit' {
|
|
4
|
-
interface InPageEdit {
|
|
5
|
-
preferences: PreferencesService;
|
|
6
|
-
prefs: PreferencesService;
|
|
7
|
-
}
|
|
8
|
-
interface Events {
|
|
9
|
-
'preferences/changed'(payload: {
|
|
10
|
-
ctx: InPageEdit;
|
|
11
|
-
/** original input */
|
|
12
|
-
input: Record<string, unknown>;
|
|
13
|
-
/** changed settings */
|
|
14
|
-
changes: Record<string, unknown>;
|
|
15
|
-
}): void;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
export interface InPageEditPreferenceUICategory {
|
|
19
|
-
name: string;
|
|
20
|
-
label: string;
|
|
21
|
-
description?: string;
|
|
22
|
-
index?: number;
|
|
23
|
-
/**
|
|
24
|
-
* 自定义渲染函数
|
|
25
|
-
* @param ctx - InPageEdit 上下文
|
|
26
|
-
* @param onUnmount - 卸载回调,当偏好设置 UI 被卸载时会被调用
|
|
27
|
-
*/
|
|
28
|
-
customRenderer?: (payload: {
|
|
29
|
-
ctx: InPageEdit;
|
|
30
|
-
onMounted: (callback: (container: HTMLElement) => void) => void;
|
|
31
|
-
onUnmount: (callback: () => void) => void;
|
|
32
|
-
}) => Promise<Node> | Node;
|
|
33
|
-
/**
|
|
34
|
-
* 是否自动生成该分类下的表单
|
|
35
|
-
* @default true
|
|
36
|
-
*/
|
|
37
|
-
autoGenerateForm?: boolean;
|
|
38
|
-
}
|
|
39
|
-
export interface InPageEditPreferenceUIRegistryItem {
|
|
40
|
-
name: string;
|
|
41
|
-
schema: Schema;
|
|
42
|
-
category: string;
|
|
43
|
-
}
|
|
44
|
-
export declare class PreferencesService extends Service {
|
|
45
|
-
ctx: InPageEdit;
|
|
46
|
-
private db;
|
|
47
|
-
customRegistries: InPageEditPreferenceUIRegistryItem[];
|
|
48
|
-
categoryDefinitions: InPageEditPreferenceUICategory[];
|
|
49
|
-
private _defaultPreferences;
|
|
50
|
-
constructor(ctx: InPageEdit);
|
|
51
|
-
get logger(): import('@inpageedit/logger').Logger;
|
|
52
|
-
start(): Promise<void>;
|
|
53
|
-
/**
|
|
54
|
-
* 获取配置项的值
|
|
55
|
-
* @param key 配置项的键名
|
|
56
|
-
* @param fallback 当配置项不存在时的回退值
|
|
57
|
-
* @returns
|
|
58
|
-
* - 未提供 key 时,返回所有配置项的键值对
|
|
59
|
-
* - 提供 key 时,返回对应配置项的值,若不存在则返回回退值或 null
|
|
60
|
-
* @tips 你可以通过重载 PreferencesMap 来定义你的配置项类型,以自动获得类型推导
|
|
61
|
-
*/
|
|
62
|
-
get(): Promise<PreferencesMap>;
|
|
63
|
-
get<K extends keyof PreferencesMap>(key: K, fallback?: ComputeAble<PreferencesMap[K]>): Promise<PreferencesMap[K] | null>;
|
|
64
|
-
get<U = unknown>(key: string, fallback?: ComputeAble<U>): Promise<U | null>;
|
|
65
|
-
/**
|
|
66
|
-
* 获取全部注册的配置项以及最终生效的值
|
|
67
|
-
* 未保存的配置项将使用默认值
|
|
68
|
-
*/
|
|
69
|
-
getAll(): Promise<PreferencesMap>;
|
|
70
|
-
set<K extends keyof PreferencesMap>(key: K, value: PreferencesMap[K] | undefined | null): Promise<PreferencesMap[K] | void>;
|
|
71
|
-
set<U = unknown>(key: string, value: U | undefined | null): Promise<U | void>;
|
|
72
|
-
setMany(input: {
|
|
73
|
-
[K in keyof PreferencesMap]?: PreferencesMap[K] | undefined | null;
|
|
74
|
-
}): Promise<{
|
|
75
|
-
[K in keyof PreferencesMap]?: PreferencesMap[K] | undefined | null;
|
|
76
|
-
}>;
|
|
77
|
-
setMany<U = unknown>(input: Record<string, U | undefined | null>): Promise<Record<string, U | undefined | null>>;
|
|
78
|
-
defaultOf<T extends keyof PreferencesMap>(key: T): PreferencesMap[T] | undefined;
|
|
79
|
-
defaultOf<U = unknown>(key: string): U | undefined;
|
|
80
|
-
/**
|
|
81
|
-
* Get exportable configurations
|
|
82
|
-
* - exclude values that are the same as the default value
|
|
83
|
-
* - exclude invalid or undefined values
|
|
84
|
-
* - sort by keys
|
|
85
|
-
*/
|
|
86
|
-
getExportableRecord(configs?: Record<string, unknown>): Promise<Record<string, any>>;
|
|
87
|
-
private loadDefaultConfigs;
|
|
88
|
-
registerCustomConfig(id: string, schema: Schema, category?: string): this;
|
|
89
|
-
getConfigRegistries(category?: string): InPageEditPreferenceUIRegistryItem[];
|
|
90
|
-
getAllSchema(): Schema<PreferencesMap, PreferencesMap>;
|
|
91
|
-
defineCategory(category: InPageEditPreferenceUICategory): this;
|
|
92
|
-
getConfigCategories(): InPageEditPreferenceUICategory[];
|
|
93
|
-
private _migrageFromLegacyMasterDB;
|
|
94
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { InPageEdit, Service } from '../InPageEdit';
|
|
2
|
-
declare module '../InPageEdit' {
|
|
3
|
-
interface InPageEdit {
|
|
4
|
-
resourceLoader: ResourceLoaderService;
|
|
5
|
-
}
|
|
6
|
-
}
|
|
7
|
-
export declare class ResourceLoaderService extends Service {
|
|
8
|
-
ctx: InPageEdit;
|
|
9
|
-
constructor(ctx: InPageEdit);
|
|
10
|
-
protected stop(): void | Promise<void>;
|
|
11
|
-
loadScript(src: string, attrs?: Record<string, any>): Promise<HTMLScriptElement | null>;
|
|
12
|
-
loadStyle(href: string, attrs?: Record<string, any>): Promise<HTMLLinkElement | null>;
|
|
13
|
-
removeStyle(href: string): void;
|
|
14
|
-
removeScript(src: string): void;
|
|
15
|
-
removeAll(): void;
|
|
16
|
-
resolveImportPath(path: string): string;
|
|
17
|
-
}
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import { InPageEdit, Service } from '../InPageEdit';
|
|
2
|
-
import { WikiSiteInfo, WikiUserBlockInfo, WikiUserInfo } from '../types/WikiMetadata';
|
|
3
|
-
declare module '../InPageEdit' {
|
|
4
|
-
interface InPageEdit {
|
|
5
|
-
wiki: WikiMetadataService;
|
|
6
|
-
getUrl: WikiMetadataService['getUrl'];
|
|
7
|
-
getSciprtUrl: WikiMetadataService['getSciprtUrl'];
|
|
8
|
-
getMainpageUrl: WikiMetadataService['getMainpageUrl'];
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
interface WikiMetadataKindMap {
|
|
12
|
-
siteinfo: WikiSiteInfo;
|
|
13
|
-
userinfo: WikiUserInfo;
|
|
14
|
-
}
|
|
15
|
-
export declare class WikiMetadataService extends Service {
|
|
16
|
-
ctx: InPageEdit;
|
|
17
|
-
private readonly _data;
|
|
18
|
-
private readonly CACHE_VERSION;
|
|
19
|
-
private readonly CACHE_TTL;
|
|
20
|
-
private readonly QUERY_DATA;
|
|
21
|
-
private readonly CACHE_DB;
|
|
22
|
-
constructor(ctx: InPageEdit);
|
|
23
|
-
private get logger();
|
|
24
|
-
private get api();
|
|
25
|
-
readonly mwConfig: {
|
|
26
|
-
get: typeof mw.config.get;
|
|
27
|
-
has: typeof mw.config.exists;
|
|
28
|
-
readonly values: ReturnType<typeof mw.config.get>;
|
|
29
|
-
};
|
|
30
|
-
protected start(): Promise<void>;
|
|
31
|
-
initData<T extends keyof WikiMetadataKindMap>(kind: T, noCache?: boolean): Promise<WikiMetadataKindMap[T]>;
|
|
32
|
-
private getCacheKey;
|
|
33
|
-
fetchFromApi<T extends keyof WikiMetadataKindMap>(kind: T): Promise<WikiMetadataKindMap[T]>;
|
|
34
|
-
fetchFromCache<T extends keyof WikiMetadataKindMap>(kind: T): Promise<WikiMetadataKindMap[T] | null>;
|
|
35
|
-
saveToCache<T extends keyof WikiMetadataKindMap>(kind: T, data: WikiMetadataKindMap[T]): Promise<import('./storage').TypedStorageEntry<WikiSiteInfo | WikiUserInfo>>;
|
|
36
|
-
invalidateCache<T extends keyof WikiMetadataKindMap>(kind: T): Promise<void>;
|
|
37
|
-
get _raw(): WikiMetadataKindMap;
|
|
38
|
-
get siteInfo(): WikiSiteInfo;
|
|
39
|
-
get general(): import('../types/WikiMetadata').WikiSiteGeneralInfo;
|
|
40
|
-
get specialPageAliases(): import('../types/WikiMetadata').WikiSpecialPageAlias[];
|
|
41
|
-
get namespaceAliases(): import('../types/WikiMetadata').WikiNameSpaceAlias[];
|
|
42
|
-
get namespaces(): Record<string, import('../types/WikiMetadata').WikiNamespace>;
|
|
43
|
-
get namespaceMap(): {
|
|
44
|
-
id: number;
|
|
45
|
-
canonical: string | undefined;
|
|
46
|
-
aliases: string[];
|
|
47
|
-
}[];
|
|
48
|
-
get magicWords(): import('../types/WikiMetadata').WikiMagicWord[];
|
|
49
|
-
get userInfo(): WikiUserInfo;
|
|
50
|
-
get userOptions(): import('../types/WikiMetadata').WikiUserOptions;
|
|
51
|
-
get isUserBlocked(): boolean | "" | undefined;
|
|
52
|
-
get userGroups(): string[];
|
|
53
|
-
get userRights(): string[];
|
|
54
|
-
/**
|
|
55
|
-
* Base URL, without trailing slash
|
|
56
|
-
* @example "https://mediawiki.org"
|
|
57
|
-
*/
|
|
58
|
-
get baseUrl(): string;
|
|
59
|
-
/**
|
|
60
|
-
* Home page URL of this wiki
|
|
61
|
-
* @description Generally same as the Mainpage URL,
|
|
62
|
-
* but after MediaWiki 1.34,
|
|
63
|
-
* it can be set to the website root directory.
|
|
64
|
-
* @example "https://mediawiki.org/wiki/Main_Page" (In most cases)
|
|
65
|
-
* @example "https://mediawiki.org/" ($wgMainPageIsDomainRoot = true)
|
|
66
|
-
*/
|
|
67
|
-
get landingPageUrl(): string;
|
|
68
|
-
get mainPageName(): string;
|
|
69
|
-
/**
|
|
70
|
-
* Exact Mainpage URL of this wiki
|
|
71
|
-
* @example "https://mediawiki.org/wiki/Main_Page"
|
|
72
|
-
*/
|
|
73
|
-
get mainPageUrl(): string;
|
|
74
|
-
/**
|
|
75
|
-
* Article path, with the $1 placeholder
|
|
76
|
-
* @example "/wiki/$1"
|
|
77
|
-
*/
|
|
78
|
-
get articlePath(): string;
|
|
79
|
-
/**
|
|
80
|
-
* Script path, without trailing slash
|
|
81
|
-
* @example "/w"
|
|
82
|
-
*/
|
|
83
|
-
get scriptPath(): string;
|
|
84
|
-
/**
|
|
85
|
-
* Article base URL, with the $1 placeholder
|
|
86
|
-
* @example "https://mediawiki.org/wiki/$1"
|
|
87
|
-
*/
|
|
88
|
-
get articleBaseUrl(): string;
|
|
89
|
-
/**
|
|
90
|
-
* Script base URL, without trailing slash
|
|
91
|
-
* @example "https://mediawiki.org/w"
|
|
92
|
-
*/
|
|
93
|
-
get scriptBaseUrl(): string;
|
|
94
|
-
getSciprtUrl(name?: string): string;
|
|
95
|
-
/** Get mainpage URL */
|
|
96
|
-
getMainpageUrl(params?: Record<string, any>): string;
|
|
97
|
-
/** Get page URL by title */
|
|
98
|
-
getUrl(title: string, params?: Record<string, any>): string;
|
|
99
|
-
/** Get page URL by page ID */
|
|
100
|
-
getUrl(pageId: number, params?: Record<string, any>): string;
|
|
101
|
-
hasRight(right: string): boolean;
|
|
102
|
-
hasAnyRight(...rights: string[]): boolean;
|
|
103
|
-
hasEveryRights(...rights: string[]): boolean;
|
|
104
|
-
inGroup(name: string): boolean;
|
|
105
|
-
inAnyGroup(...names: string[]): boolean;
|
|
106
|
-
getBlockInfo(): WikiUserBlockInfo | null;
|
|
107
|
-
}
|
|
108
|
-
export {};
|