@inpageedit/core 0.12.0 → 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/LICENSE +20 -20
- package/dist/BasePlugin-Bf2UuIHF.js +64 -0
- package/dist/BasePlugin-Bf2UuIHF.js.map +1 -0
- package/dist/IconQuickEdit-CMCQncyj.js.map +1 -1
- package/dist/InputBox-nQKtiWtZ.js +30 -0
- package/dist/InputBox-nQKtiWtZ.js.map +1 -0
- package/dist/PluginPrefSync-Dn1Xsiqz.js +341 -0
- package/dist/PluginPrefSync-Dn1Xsiqz.js.map +1 -0
- package/dist/PluginStoreApp-CpOLArL7.js +452 -0
- package/dist/PluginStoreApp-CpOLArL7.js.map +1 -0
- package/dist/Preferences-DS4-CFWe.js.map +1 -1
- package/dist/WatchlistAction-BbNAyryN.js +5 -0
- package/dist/WatchlistAction-BbNAyryN.js.map +1 -0
- package/dist/components/index.js +6 -7
- package/dist/components/index.js.map +1 -1
- package/dist/endpoints-DgyuoRZd.js +1507 -0
- package/dist/endpoints-DgyuoRZd.js.map +1 -0
- package/dist/{index-B5DtUqkK.js → index-2RfILgXm.js} +11 -11
- package/dist/{index-B5DtUqkK.js.map → index-2RfILgXm.js.map} +1 -1
- package/dist/{index-hSl8LzNb.js → index-BCdABp0e.js} +24 -24
- package/dist/index-BCdABp0e.js.map +1 -0
- package/dist/{index-Ckozkp6W.js → index-BJ7_Q1mB.js} +8 -7
- package/dist/{index-Ckozkp6W.js.map → index-BJ7_Q1mB.js.map} +1 -1
- package/dist/{index-CJFePavo.js → index-BNh95-x2.js} +37 -49
- package/dist/index-BNh95-x2.js.map +1 -0
- package/dist/{index-CYc6LH26.js → index-BQ-cHWkJ.js} +15 -16
- package/dist/{index-CYc6LH26.js.map → index-BQ-cHWkJ.js.map} +1 -1
- package/dist/index-BwdWyHLe.js +362 -0
- package/dist/index-BwdWyHLe.js.map +1 -0
- package/dist/{index-D4uwfUZL.js → index-CCRMmnwk.js} +10 -9
- package/dist/index-CCRMmnwk.js.map +1 -0
- package/dist/index-CG38LlAh.js.map +1 -1
- package/dist/index-CM_6yF2v.js.map +1 -1
- package/dist/{index-CZXxH2-9.js → index-CnIpUF9x.js} +4 -4
- package/dist/{index-CZXxH2-9.js.map → index-CnIpUF9x.js.map} +1 -1
- package/dist/{index-CPoUaSMw.js → index-CyG7_IYz.js} +14 -13
- package/dist/index-CyG7_IYz.js.map +1 -0
- package/dist/index-DD5CVCfD.js.map +1 -1
- package/dist/index-DdTiZqwt.js +3744 -0
- package/dist/index-DdTiZqwt.js.map +1 -0
- package/dist/{index-Bv7Dw5eO.js → index-eSlbrNqF.js} +6 -6
- package/dist/{index-Bv7Dw5eO.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/makeCallable-LDU0xZMJ.js.map +1 -1
- package/dist/models/index.js +486 -0
- package/dist/models/index.js.map +1 -0
- package/dist/noop-ClDc6zv4.js.map +1 -1
- 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/dist/{vueHooks-D0uVqbO-.js → vueHooks-l04s8cIl.js} +1112 -1080
- package/dist/{vueHooks-D0uVqbO-.js.map → vueHooks-l04s8cIl.js.map} +1 -1
- package/lib/index.umd.js +15 -11
- package/lib/index.umd.js.map +1 -1
- package/lib/style.css +1 -1
- package/package.json +22 -25
- package/dist/CheckBox-Bc79KBEB.js +0 -13
- package/dist/CheckBox-Bc79KBEB.js.map +0 -1
- package/dist/InPageEdit.d.ts +0 -42
- package/dist/InputBox-DZAdyZ4B.js +0 -22
- package/dist/InputBox-DZAdyZ4B.js.map +0 -1
- package/dist/PluginPrefSync-BPQkNtX8.js +0 -292
- package/dist/PluginPrefSync-BPQkNtX8.js.map +0 -1
- package/dist/PluginStoreApp-Cxspe6t8.js +0 -158
- package/dist/PluginStoreApp-Cxspe6t8.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-BXaiDKnr.js +0 -5828
- package/dist/index-BXaiDKnr.js.map +0 -1
- package/dist/index-CB7TltEb.js +0 -297
- package/dist/index-CB7TltEb.js.map +0 -1
- package/dist/index-CJFePavo.js.map +0 -1
- package/dist/index-CPoUaSMw.js.map +0 -1
- package/dist/index-D4uwfUZL.js.map +0 -1
- package/dist/index-DEav9Ptt.js +0 -365
- package/dist/index-DEav9Ptt.js.map +0 -1
- package/dist/index-hSl8LzNb.js.map +0 -1
- package/dist/models/MemoryStorage.d.ts +0 -10
- package/dist/models/WikiPage/index.d.ts +0 -72
- 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 -59
- 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-delete/index.d.ts +0 -55
- 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,59 +0,0 @@
|
|
|
1
|
-
import { InPageEdit } from '../../InPageEdit';
|
|
2
|
-
import { ForkScope } from '@cordisjs/core';
|
|
3
|
-
import { PluginStoreRegistry, PluginStoreSchemas } from './schema';
|
|
4
|
-
declare module '../../InPageEdit' {
|
|
5
|
-
interface InPageEdit {
|
|
6
|
-
store: PluginPluginStore;
|
|
7
|
-
}
|
|
8
|
-
interface PreferencesMap {
|
|
9
|
-
'pluginStore.registries': string[];
|
|
10
|
-
'pluginStore.plugins': {
|
|
11
|
-
source?: 'online_manifest' | 'npm';
|
|
12
|
-
registry: string;
|
|
13
|
-
id: string;
|
|
14
|
-
}[];
|
|
15
|
-
'pluginStore.cdnForNpm': string;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
export declare class PluginPluginStore extends BasePlugin {
|
|
19
|
-
ctx: InPageEdit;
|
|
20
|
-
static readonly PluginStoreSchemas: typeof PluginStoreSchemas;
|
|
21
|
-
static REGISTRY_CACHE_TTL: number;
|
|
22
|
-
private registryInfoDB;
|
|
23
|
-
constructor(ctx: InPageEdit);
|
|
24
|
-
protected start(): Promise<void>;
|
|
25
|
-
private _installUserPlugins;
|
|
26
|
-
private _createManagementApp;
|
|
27
|
-
private _injectPreferenceUI;
|
|
28
|
-
showModal(): Promise<import('../../services/ModalService').CustomIPEModal>;
|
|
29
|
-
private _installedPlugins;
|
|
30
|
-
install(registry: string, id: string, source?: 'online_manifest' | 'npm'): Promise<ForkScope<InPageEdit> | null>;
|
|
31
|
-
uninstall(registry: string, id: string): Promise<boolean>;
|
|
32
|
-
addToPreferences(registry: string, id: string): Promise<boolean>;
|
|
33
|
-
removeFromPreferences(registry: string, id: string): Promise<boolean>;
|
|
34
|
-
installAndSetPreference(registry: string, id: string): Promise<ForkScope<InPageEdit> | null>;
|
|
35
|
-
uninstallAndRemovePreference(registry: string, id: string): Promise<boolean>;
|
|
36
|
-
private _installOneByRegistryInfo;
|
|
37
|
-
validateRegistry(data: any): PluginStoreRegistry;
|
|
38
|
-
getRegistryInfo(registry: string): Promise<PluginStoreRegistry>;
|
|
39
|
-
private _fetchOnlineRegistryInfo;
|
|
40
|
-
private _registryUpdateCheckCaches;
|
|
41
|
-
/**
|
|
42
|
-
* 检查自从上次缓存后,registry 是否有更新
|
|
43
|
-
* @param registry
|
|
44
|
-
* @returns
|
|
45
|
-
*/
|
|
46
|
-
private _checkIfOnlineRegistryUpdated;
|
|
47
|
-
private getRegistryCache;
|
|
48
|
-
private setRegistryCache;
|
|
49
|
-
private deleteRegistryCache;
|
|
50
|
-
clearAllRegistryCaches(): Promise<void>;
|
|
51
|
-
/**
|
|
52
|
-
* 刷新指定 registry 的缓存(重新从网络获取)
|
|
53
|
-
*/
|
|
54
|
-
refreshRegistryCache(registry: string): Promise<PluginStoreRegistry>;
|
|
55
|
-
/**
|
|
56
|
-
* 刷新所有已配置的 registry 缓存
|
|
57
|
-
*/
|
|
58
|
-
refreshAllRegistryCaches(): Promise<PluginStoreRegistry[]>;
|
|
59
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { default as Schema } from 'schemastery';
|
|
2
|
-
export declare const PLUGIN_STORE_REGISTRY_MANIFEST_VERSION = 1;
|
|
3
|
-
export interface PluginStoreRegistry {
|
|
4
|
-
manifest_version: number;
|
|
5
|
-
name: string;
|
|
6
|
-
base_url: string;
|
|
7
|
-
homepage?: string;
|
|
8
|
-
maintainers?: PluginStoreRegistryMaintainer[];
|
|
9
|
-
repository?: PluginStoreRegistryRepository;
|
|
10
|
-
packages: PluginStorePackage[];
|
|
11
|
-
}
|
|
12
|
-
export interface PluginStoreRegistryMaintainer {
|
|
13
|
-
name: string;
|
|
14
|
-
email?: string;
|
|
15
|
-
}
|
|
16
|
-
export interface PluginStoreRegistryRepository {
|
|
17
|
-
type: 'git';
|
|
18
|
-
url: string;
|
|
19
|
-
}
|
|
20
|
-
export interface PluginStorePackage {
|
|
21
|
-
id: string;
|
|
22
|
-
name: string;
|
|
23
|
-
version: string;
|
|
24
|
-
description?: string;
|
|
25
|
-
author?: string;
|
|
26
|
-
license?: string;
|
|
27
|
-
loader: PluginStorePackageLoader;
|
|
28
|
-
}
|
|
29
|
-
export interface PluginStorePackageLoader {
|
|
30
|
-
kind: 'autoload' | 'module' | 'umd' | 'styles';
|
|
31
|
-
entry?: string;
|
|
32
|
-
styles?: string[];
|
|
33
|
-
main_export?: string;
|
|
34
|
-
}
|
|
35
|
-
export declare namespace PluginStoreSchemas {
|
|
36
|
-
const PackageLoader: Schema<PluginStorePackageLoader, PluginStorePackageLoader>;
|
|
37
|
-
const Package: Schema<PluginStorePackage, PluginStorePackage>;
|
|
38
|
-
const RegistryMaintainer: Schema<PluginStoreRegistryMaintainer, PluginStoreRegistryMaintainer>;
|
|
39
|
-
const RegistryRepository: Schema<PluginStoreRegistryRepository, PluginStoreRegistryRepository>;
|
|
40
|
-
const Registry: Schema<PluginStoreRegistry, PluginStoreRegistry>;
|
|
41
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { InPageEdit } from '../../InPageEdit.js';
|
|
2
|
-
import { IWikiTitle } from '../../models/WikiTitle/index.js';
|
|
3
|
-
declare module '../../InPageEdit' {
|
|
4
|
-
interface InPageEdit {
|
|
5
|
-
prefSync: PluginPrefSync;
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
export declare class PluginPrefSync extends BasePlugin {
|
|
9
|
-
ctx: InPageEdit;
|
|
10
|
-
constructor(ctx: InPageEdit);
|
|
11
|
-
protected start(): Promise<void> | void;
|
|
12
|
-
protected stop(): Promise<void> | void;
|
|
13
|
-
/**
|
|
14
|
-
* 获取用户页配置文件的标题
|
|
15
|
-
*/
|
|
16
|
-
private getUserPrefsPageTitle;
|
|
17
|
-
/**
|
|
18
|
-
* 从用户页加载配置
|
|
19
|
-
*/
|
|
20
|
-
importFromUserPage(): Promise<Record<string, unknown>>;
|
|
21
|
-
/**
|
|
22
|
-
* 导出配置到用户页
|
|
23
|
-
*/
|
|
24
|
-
exportToUserPage(): Promise<IWikiTitle>;
|
|
25
|
-
importFromUrl(input: string): Promise<Record<string, unknown>>;
|
|
26
|
-
importFromFile(input: Blob): Promise<Record<string, unknown>>;
|
|
27
|
-
private notifyImportSuccess;
|
|
28
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { InPageEdit } from '../../InPageEdit';
|
|
2
|
-
import { default as PreferencesApp } from './components/PreferencesApp.vue';
|
|
3
|
-
import { CustomIPEModal } from '../../services/ModalService.js';
|
|
4
|
-
import { App as VueApp } from 'vue';
|
|
5
|
-
declare module '../../InPageEdit' {
|
|
6
|
-
interface InPageEdit {
|
|
7
|
-
preferencesUI: PluginPreferencesUI;
|
|
8
|
-
}
|
|
9
|
-
interface Events {
|
|
10
|
-
'preferences-ui/modal-shown'(payload: {
|
|
11
|
-
ctx: InPageEdit;
|
|
12
|
-
modal: CustomIPEModal;
|
|
13
|
-
}): void;
|
|
14
|
-
'preferences-ui/vue-app-mounted'(payload: {
|
|
15
|
-
ctx: InPageEdit;
|
|
16
|
-
app: VueApp;
|
|
17
|
-
form: InstanceType<typeof PreferencesApp>;
|
|
18
|
-
}): void;
|
|
19
|
-
'preferences-ui/modal-tab-changed'(payload: {
|
|
20
|
-
ctx: InPageEdit;
|
|
21
|
-
category: string;
|
|
22
|
-
$tabContent: HTMLElement;
|
|
23
|
-
}): void;
|
|
24
|
-
'preferences-ui/form-data-saved'(payload: {
|
|
25
|
-
ctx: InPageEdit;
|
|
26
|
-
data: Record<string, unknown>;
|
|
27
|
-
}): void;
|
|
28
|
-
'preferences-ui/modal-closed'(payload: {
|
|
29
|
-
ctx: InPageEdit;
|
|
30
|
-
modal: CustomIPEModal;
|
|
31
|
-
}): void;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
export declare class PluginPreferencesUI extends BasePlugin {
|
|
35
|
-
ctx: InPageEdit;
|
|
36
|
-
constructor(ctx: InPageEdit);
|
|
37
|
-
protected start(): Promise<void>;
|
|
38
|
-
protected stop(): Promise<void> | void;
|
|
39
|
-
_modal: CustomIPEModal | null;
|
|
40
|
-
_form: InstanceType<typeof PreferencesApp> | null;
|
|
41
|
-
showModal(): CustomIPEModal;
|
|
42
|
-
getCurrentModal(): CustomIPEModal | null;
|
|
43
|
-
closeCurrentModal(): CustomIPEModal | undefined;
|
|
44
|
-
dispatchFormSave(form?: InstanceType<typeof PreferencesApp>): Promise<boolean>;
|
|
45
|
-
getCurrentFormValue(): any;
|
|
46
|
-
mergeFormValue(value: Record<string, unknown>): boolean;
|
|
47
|
-
createPreferencesUIApp(): VueApp<Element>;
|
|
48
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { InPageEdit } from '../../InPageEdit';
|
|
2
|
-
import { IWikiPage } from '../../models/WikiPage';
|
|
3
|
-
import { IPEModal } from '@inpageedit/modal';
|
|
4
|
-
import { ReactNode } from 'jsx-dom';
|
|
5
|
-
declare module '../../InPageEdit' {
|
|
6
|
-
interface InPageEdit {
|
|
7
|
-
quickDelete: PluginQuickDelete & {
|
|
8
|
-
(...args: Parameters<PluginQuickDelete['showModal']>): ReturnType<PluginQuickDelete['showModal']>;
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
interface Events {
|
|
12
|
-
'quick-delete/init-options'(payload: Omit<QuickDeleteInitPayload, 'modal' | 'wikiPage'>): void;
|
|
13
|
-
'quick-delete/show-modal'(payload: Omit<QuickDeleteInitPayload, 'wikiPage'>): void;
|
|
14
|
-
'quick-delete/wiki-page'(payload: QuickDeleteInitPayload): void;
|
|
15
|
-
'quick-delete/delete-notice'(payload: QuickDeleteInitPayload & {
|
|
16
|
-
deleteNotices: ReactNode[];
|
|
17
|
-
}): void;
|
|
18
|
-
'quick-delete/submit'(payload: QuickDeleteSubmitPayload & {
|
|
19
|
-
ctx: InPageEdit;
|
|
20
|
-
}): void;
|
|
21
|
-
}
|
|
22
|
-
interface PreferencesMap {
|
|
23
|
-
'quickDelete.reason': string;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
export interface QuickDeleteOptions {
|
|
27
|
-
title: string;
|
|
28
|
-
pageId: number;
|
|
29
|
-
revision: number;
|
|
30
|
-
deleteReason: string;
|
|
31
|
-
reloadAfterDelete: boolean;
|
|
32
|
-
}
|
|
33
|
-
export interface QuickDeleteInitPayload {
|
|
34
|
-
ctx: InPageEdit;
|
|
35
|
-
options: QuickDeleteOptions;
|
|
36
|
-
modal: IPEModal;
|
|
37
|
-
wikiPage: IWikiPage;
|
|
38
|
-
}
|
|
39
|
-
export interface QuickDeleteSubmitPayload {
|
|
40
|
-
wikiPage: IWikiPage;
|
|
41
|
-
reason?: string;
|
|
42
|
-
}
|
|
43
|
-
export declare class PluginQuickDelete extends BasePlugin {
|
|
44
|
-
ctx: InPageEdit;
|
|
45
|
-
private readonly DEFAULT_OPTIONS;
|
|
46
|
-
constructor(ctx: InPageEdit);
|
|
47
|
-
protected start(): Promise<void> | void;
|
|
48
|
-
showModal(payload?: string | Partial<QuickDeleteOptions>): Promise<void>;
|
|
49
|
-
handleSubmit(payload: QuickDeleteSubmitPayload): Promise<Required<import('wiki-saikou').FexiosContext<import('wiki-saikou').MwApiResponse<{
|
|
50
|
-
success: boolean;
|
|
51
|
-
}>>>>;
|
|
52
|
-
getWikiPageFromPayload(payload: Partial<QuickDeleteOptions>): Promise<IWikiPage>;
|
|
53
|
-
private injectToolbox;
|
|
54
|
-
protected removeToolbox(ctx: InPageEdit): void;
|
|
55
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { JSX } from 'jsx-dom/jsx-runtime';
|
|
2
|
-
import { CompareApiResponse } from '../index.js';
|
|
3
|
-
import { InPageEdit } from '../../../InPageEdit.js';
|
|
4
|
-
export type DiffTableProps = {
|
|
5
|
-
data: Partial<CompareApiResponse['compare']>;
|
|
6
|
-
ctx: InPageEdit;
|
|
7
|
-
} & JSX.IntrinsicElements['table'];
|
|
8
|
-
export declare enum DiffTableEvent {
|
|
9
|
-
update = "ipe:diff-table/update",
|
|
10
|
-
edit = "ipe:diff-table/edit"
|
|
11
|
-
}
|
|
12
|
-
declare global {
|
|
13
|
-
interface HTMLElementEventMap {
|
|
14
|
-
[DiffTableEvent.update]: CustomEvent<{
|
|
15
|
-
fromrev: number;
|
|
16
|
-
torev: number;
|
|
17
|
-
}>;
|
|
18
|
-
[DiffTableEvent.edit]: CustomEvent<{
|
|
19
|
-
revid: number;
|
|
20
|
-
}>;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
export declare const DiffTable: (props: DiffTableProps) => import('jsx-dom').ReactElement;
|
|
@@ -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
|
-
}
|