@inpageedit/core 0.1.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 +21 -0
- package/README.md +55 -0
- package/dist/ActionButton-BhcZX7rl.js +33 -0
- package/dist/ActionButton-BhcZX7rl.js.map +1 -0
- package/dist/CheckBox-B7zLOm55.js +30 -0
- package/dist/CheckBox-B7zLOm55.js.map +1 -0
- package/dist/InPageEdit.d.ts +25 -0
- package/dist/PluginPreferencesUI-CqQKXQkn.js +33921 -0
- package/dist/PluginPreferencesUI-CqQKXQkn.js.map +1 -0
- package/dist/Preferences-Bg3J5Ur9.js +9 -0
- package/dist/Preferences-Bg3J5Ur9.js.map +1 -0
- package/dist/RadioBox-Dl-VRoW0.js +54 -0
- package/dist/RadioBox-Dl-VRoW0.js.map +1 -0
- package/dist/components/ActionButton.d.ts +9 -0
- package/dist/components/CheckBox.d.ts +10 -0
- package/dist/components/InputBox.d.ts +11 -0
- package/dist/components/MBox/index.d.ts +14 -0
- package/dist/components/MwUserLinks.d.ts +4 -0
- package/dist/components/ProgressBar/index.d.ts +7 -0
- package/dist/components/RadioBox.d.ts +10 -0
- package/dist/components/TabView/TabView.d.ts +19 -0
- package/dist/components/TwinSwapInput/index.d.ts +18 -0
- package/dist/components/utils.d.ts +4 -0
- package/dist/constants/endpoints.d.ts +10 -0
- package/dist/decorators/Preferences.d.ts +36 -0
- package/dist/i18n/languages.json +1527 -0
- package/dist/index-BEDkPsz1.js +86 -0
- package/dist/index-BEDkPsz1.js.map +1 -0
- package/dist/index-Bi1eJIjL.js +83 -0
- package/dist/index-Bi1eJIjL.js.map +1 -0
- package/dist/index-Bz4cBa1Z.js +1130 -0
- package/dist/index-Bz4cBa1Z.js.map +1 -0
- package/dist/index-CL0NhE5n.js +155 -0
- package/dist/index-CL0NhE5n.js.map +1 -0
- package/dist/index-CuEf9G7f.js +5459 -0
- package/dist/index-CuEf9G7f.js.map +1 -0
- package/dist/index-DA5i7w02.js +141 -0
- package/dist/index-DA5i7w02.js.map +1 -0
- package/dist/index-Hed2P8uH.js +159 -0
- package/dist/index-Hed2P8uH.js.map +1 -0
- package/dist/index-LoZLvK3o.js +409 -0
- package/dist/index-LoZLvK3o.js.map +1 -0
- package/dist/index-sORwn1Vt.js +140 -0
- package/dist/index-sORwn1Vt.js.map +1 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/models/WikiPage/index.d.ts +63 -0
- package/dist/models/WikiPage/types/PageInfo.d.ts +56 -0
- package/dist/models/WikiPage/types/PageParseData.d.ts +17 -0
- package/dist/models/WikiPage/types/WatchlistAction.d.ts +6 -0
- package/dist/models/WikiTitle/index.d.ts +12 -0
- package/dist/plugins/BasePlugin.d.ts +19 -0
- package/dist/plugins/_debug/index.d.ts +8 -0
- package/dist/plugins/preferences/PluginPreferencesUI.d.ts +11 -0
- package/dist/plugins/preferences/components/hooks.d.ts +5 -0
- package/dist/plugins/preferences/index.d.ts +37 -0
- package/dist/plugins/quick-diff/JsDiffService.d.ts +23 -0
- package/dist/plugins/quick-diff/PluginQuickDiffCore.d.ts +69 -0
- package/dist/plugins/quick-diff/components/DiffTable.d.ts +6 -0
- package/dist/plugins/quick-diff/index.d.ts +6 -0
- package/dist/plugins/quick-edit/PluginQuickEditInArticleLinks.d.ts +14 -0
- package/dist/plugins/quick-edit/index.d.ts +52 -0
- package/dist/plugins/quick-move/index.d.ts +27 -0
- package/dist/plugins/quick-preview/index.d.ts +32 -0
- package/dist/plugins/quick-redirect/index.d.ts +24 -0
- package/dist/plugins/toolbox/index.d.ts +38 -0
- package/dist/polyfills/Promise.withResolvers.d.ts +5 -0
- package/dist/polyfills/index.d.ts +0 -0
- package/dist/services/ApiService.d.ts +14 -0
- package/dist/services/ResourceLoaderService.d.ts +13 -0
- package/dist/services/SiteMetadataService.d.ts +53 -0
- package/dist/services/SsiModalService.d.ts +35 -0
- package/dist/services/StorageService.d.ts +56 -0
- package/dist/services/WikiPageService.d.ts +19 -0
- package/dist/sleep-DpyIipK-.js +5 -0
- package/dist/sleep-DpyIipK-.js.map +1 -0
- package/dist/style.css +1 -0
- package/dist/types/SiteMetadata.d.ts +133 -0
- package/dist/utils/defineAsyncPlugin.d.ts +2 -0
- package/dist/utils/noop.d.ts +1 -0
- package/dist/utils/schemaValidator.d.ts +12 -0
- package/dist/utils/sleep.d.ts +1 -0
- package/dist/utils/string.d.ts +7 -0
- package/dist/utils/vueReactivity.d.ts +2 -0
- package/package.json +81 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { InPageEdit, Service } from '../InPageEdit';
|
|
2
|
+
import { SiteMetadata, SiteUserBlockInfo } from '../types/SiteMetadata';
|
|
3
|
+
declare module '../InPageEdit' {
|
|
4
|
+
interface InPageEdit {
|
|
5
|
+
sitemeta: SiteMetadataService;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
export declare class SiteMetadataService extends Service {
|
|
9
|
+
ctx: InPageEdit;
|
|
10
|
+
private _data;
|
|
11
|
+
private siteIdentity?;
|
|
12
|
+
private readonly CACHE_TTL;
|
|
13
|
+
private readonly VERSION;
|
|
14
|
+
private db;
|
|
15
|
+
private queryData;
|
|
16
|
+
constructor(ctx: InPageEdit);
|
|
17
|
+
get api(): import('wiki-saikou').MediaWikiApi;
|
|
18
|
+
get mwConfig(): ReturnType<typeof mw.config.get>;
|
|
19
|
+
protected start(): Promise<void>;
|
|
20
|
+
computeSiteIdentity(): Promise<string>;
|
|
21
|
+
fetchFromApi(): Promise<any>;
|
|
22
|
+
fetchFromCache(): Promise<SiteMetadata | null>;
|
|
23
|
+
saveToCache(data: SiteMetadata): Promise<import('./StorageService').IPEStorageItem<SiteMetadata>>;
|
|
24
|
+
get _raw(): SiteMetadata;
|
|
25
|
+
get siteInfo(): import('../types/SiteMetadata').SiteInfo;
|
|
26
|
+
get specialPageAliases(): import('../types/SiteMetadata').SiteSpecialPageAlias[];
|
|
27
|
+
get namespaceAliases(): import('../types/SiteMetadata').SiteNameSpaceAlias[];
|
|
28
|
+
get namespaces(): Record<string, import('../types/SiteMetadata').SiteNamespace>;
|
|
29
|
+
get namespaceMap(): {
|
|
30
|
+
id: number;
|
|
31
|
+
canonical: string;
|
|
32
|
+
aliases: string[];
|
|
33
|
+
}[];
|
|
34
|
+
get magicWords(): import('../types/SiteMetadata').SiteMagicWord[];
|
|
35
|
+
get userInfo(): {
|
|
36
|
+
id: number;
|
|
37
|
+
name: string;
|
|
38
|
+
groups: string[];
|
|
39
|
+
rights: string[];
|
|
40
|
+
} & Partial<SiteUserBlockInfo> & {
|
|
41
|
+
options: import('../types/SiteMetadata').SiteUserOptions;
|
|
42
|
+
};
|
|
43
|
+
get userOptions(): import('../types/SiteMetadata').SiteUserOptions;
|
|
44
|
+
get isUserBlocked(): boolean | "" | undefined;
|
|
45
|
+
get userGroups(): string[];
|
|
46
|
+
get userRights(): string[];
|
|
47
|
+
hasRight(right: string): boolean;
|
|
48
|
+
hasAnyRight(...rights: string[]): boolean;
|
|
49
|
+
hasEveryRights(...rights: string[]): boolean;
|
|
50
|
+
inGroup(name: string): boolean;
|
|
51
|
+
inAnyGroup(...names: string[]): boolean;
|
|
52
|
+
getBlockInfo(): SiteUserBlockInfo | null;
|
|
53
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { InPageEdit } from '../InPageEdit';
|
|
2
|
+
type LibSsiModal = typeof ssi_modal;
|
|
3
|
+
declare module '../InPageEdit' {
|
|
4
|
+
interface InPageEdit {
|
|
5
|
+
modal: LibSsiModal;
|
|
6
|
+
}
|
|
7
|
+
interface Events {
|
|
8
|
+
'modal/show'(payload: {
|
|
9
|
+
modal: SsiModal;
|
|
10
|
+
}): void;
|
|
11
|
+
'modal/close'(payload: {
|
|
12
|
+
modal: SsiModal;
|
|
13
|
+
}): void;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
declare global {
|
|
17
|
+
namespace SsiModal {
|
|
18
|
+
interface SsiModal {
|
|
19
|
+
/**
|
|
20
|
+
* Toggle a visual loading overlay & disable buttons inside the modal
|
|
21
|
+
*/
|
|
22
|
+
setLoadingState(state: boolean): void;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export declare class SsiModalService {
|
|
27
|
+
ctx: InPageEdit;
|
|
28
|
+
static readonly inject: string[];
|
|
29
|
+
private modal?;
|
|
30
|
+
constructor(ctx: InPageEdit);
|
|
31
|
+
protected start(): void | Promise<void>;
|
|
32
|
+
protected stop(): void | Promise<void>;
|
|
33
|
+
hackSsiModal(ssiModalLib: LibSsiModal): SsiModal.ssi_modal;
|
|
34
|
+
}
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { InPageEdit, Service } from '../InPageEdit';
|
|
2
|
+
import { default as localforage } from 'localforage';
|
|
3
|
+
declare module '../InPageEdit' {
|
|
4
|
+
interface InPageEdit {
|
|
5
|
+
storage: StorageService;
|
|
6
|
+
localforage: typeof localforage;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export declare class StorageService extends Service {
|
|
10
|
+
constructor(ctx: InPageEdit);
|
|
11
|
+
get StorageManager(): typeof IPEStorageManager;
|
|
12
|
+
createDatabse<T = any>(storeName: string, ttl?: number, version?: number): IPEStorageManager<T>;
|
|
13
|
+
}
|
|
14
|
+
export interface IPEStorageItem<T = any> {
|
|
15
|
+
/** last update time */
|
|
16
|
+
time: number;
|
|
17
|
+
/** stored value */
|
|
18
|
+
value: T;
|
|
19
|
+
/** version */
|
|
20
|
+
version?: number;
|
|
21
|
+
}
|
|
22
|
+
export declare class IPEStorageManager<T = any> {
|
|
23
|
+
readonly dbName: string;
|
|
24
|
+
readonly storeName: string;
|
|
25
|
+
ttl: number;
|
|
26
|
+
version?: number | undefined;
|
|
27
|
+
static DEFAULT_TTL: number;
|
|
28
|
+
static readonly _cached_db_instances: Map<string, LocalForage>;
|
|
29
|
+
readonly db: LocalForage;
|
|
30
|
+
keys: (typeof localforage)['keys'];
|
|
31
|
+
/**
|
|
32
|
+
*
|
|
33
|
+
* @param dbName
|
|
34
|
+
* @param storeName
|
|
35
|
+
* @param ttl
|
|
36
|
+
*/
|
|
37
|
+
constructor(dbName: string, storeName: string, ttl?: number, version?: number | undefined);
|
|
38
|
+
static createDatabase(dbName: string, storeName: string): LocalForage;
|
|
39
|
+
get(key: string, ttl?: number, setter?: () => Promise<T> | T): Promise<T | null>;
|
|
40
|
+
set(key: string, value: null | undefined): Promise<void>;
|
|
41
|
+
set(key: string, value: T): Promise<IPEStorageItem<T>>;
|
|
42
|
+
has(key: string, ttl?: number): Promise<boolean>;
|
|
43
|
+
delete(key: string): Promise<void>;
|
|
44
|
+
iterate(callback: (value: T, key: string) => void): Promise<void>;
|
|
45
|
+
loadFromDB(key: string): Promise<{
|
|
46
|
+
time: number;
|
|
47
|
+
value: T;
|
|
48
|
+
version?: number;
|
|
49
|
+
} | null>;
|
|
50
|
+
checkIfExpired(data: IPEStorageItem<T> | null, ttl?: number): boolean;
|
|
51
|
+
/**
|
|
52
|
+
* [DANGER] Use with caution!
|
|
53
|
+
* Delete all data from the database.
|
|
54
|
+
*/
|
|
55
|
+
clear(): Promise<this>;
|
|
56
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { InPageEdit, Service } from '../InPageEdit';
|
|
2
|
+
import { WikiPage } from '../models/WikiPage';
|
|
3
|
+
import { PageInfo } from '../models/WikiPage/types/PageInfo';
|
|
4
|
+
declare module '../InPageEdit' {
|
|
5
|
+
interface InPageEdit {
|
|
6
|
+
wikiPage: WikiPageService;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export declare class WikiPageService extends Service {
|
|
10
|
+
ctx: InPageEdit;
|
|
11
|
+
static inject: string[];
|
|
12
|
+
constructor(ctx: InPageEdit);
|
|
13
|
+
get WikiPage(): typeof WikiPage;
|
|
14
|
+
createInstance(payload: Record<string, any>): Promise<WikiPage>;
|
|
15
|
+
newFromTitle(title: string, converttitles?: boolean, rvsection?: number | string): Promise<WikiPage>;
|
|
16
|
+
newFromPageId(pageid: number, rvsection?: number | string): Promise<WikiPage>;
|
|
17
|
+
newFromRevision(revid: number, rvsection?: number | string): Promise<WikiPage>;
|
|
18
|
+
newBlankPage(init?: Partial<PageInfo>): WikiPage;
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sleep-DpyIipK-.js","sources":["../src/utils/sleep.ts"],"sourcesContent":["export const sleep = (ms: number = 0) =>\n new Promise((resolve) => setTimeout(resolve, ms))\n"],"names":["sleep","ms","resolve"],"mappings":"AAAO,MAAMA,IAAQ,CAACC,IAAa,MACjC,IAAI,QAAQ,CAACC,MAAY,WAAWA,GAASD,CAAE,CAAC;"}
|
package/dist/style.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@charset "UTF-8";._ipe_progress_so6hn_1{position:relative;display:inline-block;width:100%;overflow:hidden;border:1px solid #c5c5c5;border-radius:100vmax;background-color:#fff;height:1em;--progress: 0%}._ipe_progress_so6hn_1[data-indeterminate=true]:before,._ipe_progress_so6hn_1[data-indeterminate=true]:after{content:"";position:absolute;top:0;bottom:0;left:0;background-color:#36c}._ipe_progress_so6hn_1[data-indeterminate=true]:before{animation:_progress-indeterminate-long_so6hn_1 2s linear infinite}._ipe_progress_so6hn_1[data-indeterminate=true]:after{animation:_progress-indeterminate-short_so6hn_1 2s linear infinite}._ipe_progress_so6hn_1[data-indeterminate=false]:before{content:"";position:absolute;top:0;bottom:0;left:0;width:var(--progress);background-color:#36c;transition:width .3s ease-in-out}@keyframes _progress-indeterminate-long_so6hn_1{0%{left:0;width:0}50%{left:30%;width:70%}75%{left:100%;width:0}}@keyframes _progress-indeterminate-short_so6hn_1{0%{left:0;width:0}50%{left:0;width:0}75%{left:0;width:25%}to{left:110%;width:0}}._mbox_v5fz5_1{--border-color: #dfdfdf;--title-color: #efefef;--content-color: #ffffff;border-radius:.5rem;border:1px solid var(--title-color);border-left:6px solid var(--border-color);overflow:hidden;margin:1rem 0;position:relative}._mbox_v5fz5_1 ._title_v5fz5_12{background-color:var(--title-color);padding:.5rem 1rem;font-weight:700;font-size:1rem;line-height:1.2}._mbox_v5fz5_1 ._content_v5fz5_19{background-color:var(--content-color);padding:.5rem 1rem;font-size:1rem;line-height:1.5;max-height:14em;overflow:auto}._mbox_v5fz5_1 ._close_v5fz5_27{position:absolute;top:.5rem;right:.5rem;font-size:1.25rem;line-height:1rem;color:var(--border-color);cursor:pointer;user-select:none}._mbox_v5fz5_1 ._close_v5fz5_27:hover{filter:brightness(1.2)}._mbox_v5fz5_1 ._close_v5fz5_27:active{filter:brightness(.8)}._mbox_v5fz5_1.mbox-type-note,._mbox_v5fz5_1.mbox-type-info{--border-color: #1f6feb;--title-color: #AFD1FE;--content-color: #f3f9ff}._mbox_v5fz5_1.mbox-type-tip,._mbox_v5fz5_1.mbox-type-success{--border-color: #238636;--title-color: #E0F1E3;--content-color: #f9f9f9}._mbox_v5fz5_1.mbox-type-important,._mbox_v5fz5_1.mbox-type-done{--border-color: #8957e5;--title-color: #DDCBFC;--content-color: #f9f9f9}._mbox_v5fz5_1.mbox-type-warning{--border-color: #9e6a03;--title-color: #E4CC9D;--content-color: #fff9db}._mbox_v5fz5_1.mbox-type-caution,._mbox_v5fz5_1.mbox-type-error{--border-color: #da3633;--title-color: #FCB9B6;--content-color: #f9f9f9}._twinSwapInput_1gdgl_9{display:grid;grid-template-columns:1fr auto 1fr;grid-template-areas:"input-left swap-button input-right";gap:1rem;align-items:end}@media (max-width: 768px){._twinSwapInput_1gdgl_9{grid-template-columns:1fr;grid-template-areas:"input-left" "swap-button" "input-right";gap:.75rem}}._twinSwapInput_1gdgl_9 ._inputWrapper_1gdgl_23{display:flex;flex-direction:column}._twinSwapInput_1gdgl_9 ._inputWrapper_1gdgl_23._inputLeft_1gdgl_27{grid-area:input-left}._twinSwapInput_1gdgl_9 ._inputWrapper_1gdgl_23._inputRight_1gdgl_30{grid-area:input-right}._twinSwapInput_1gdgl_9 ._inputWrapper_1gdgl_23 label{display:block;margin-bottom:.5em;font-weight:500;font-size:.875rem}._twinSwapInput_1gdgl_9 ._inputWrapper_1gdgl_23 input{width:100%}._twinSwapInput_1gdgl_9 ._inputWrapper_1gdgl_23 input:disabled{opacity:.75;cursor:not-allowed}._twinSwapInput_1gdgl_9 ._swapButton_1gdgl_46{grid-area:swap-button;display:flex;align-items:center;justify-content:center}._twinSwapInput_1gdgl_9 ._swapButton_1gdgl_46 button{position:relative;display:flex;align-items:center;justify-content:center;padding:0;border-radius:50%;width:2rem;height:2rem;border:none;background:#efefef;cursor:pointer;transition:all .2s ease}._twinSwapInput_1gdgl_9 ._swapButton_1gdgl_46 button:hover{background:#e0e0e0}._twinSwapInput_1gdgl_9 ._swapButton_1gdgl_46 button:active{background:#d0d0d0}._twinSwapInput_1gdgl_9 ._swapButton_1gdgl_46 button:disabled{opacity:.75;cursor:not-allowed}._twinSwapInput_1gdgl_9 ._swapButton_1gdgl_46 button svg{transition:all .2s ease;width:1.25rem;height:1.25rem}@media (max-width: 768px){._twinSwapInput_1gdgl_9 ._swapButton_1gdgl_46 button{transform:rotate(90deg)}}._diff-container_lq0si_2{--primary-text-color: #333;--secondary-text-color: #888;--container-bg-color: #fff;--border-color: #ccc;--del-bg: #fadad7;--del-color: #b30000;--ins-bg: #eaf2c2;--ins-color: #406619;--chunk-header-color: #8a008b;--result-bg: #f5f5f5;background:var(--result-bg);padding:1rem;margin:0;border-radius:3px;font-family:Maple Mono NF CN,Maple Mono NF,Maple Mono,JetBrainsMono Nerd Font,JetBrains Mono NF,JetBrains Mono,Consolas,Courier New,monospace;white-space:pre-wrap;overflow-x:auto;line-height:1.4em;color:var(--secondary-text-color);transition:color .25s ease}._diff-container_lq0si_2:hover{color:var(--primary-text-color)}._diff-container_lq0si_2 del{text-decoration:line-through;color:var(--del-color);background:var(--del-bg)}._diff-container_lq0si_2 ins{background:var(--ins-bg);color:var(--ins-color);text-decoration:underline}._diff-container_lq0si_2 del,._diff-container_lq0si_2 ins{font-weight:700}._diff-container_lq0si_2 ._chunk-header_lq0si_44{color:var(--chunk-header-color);text-decoration:none}.schema-array-inner[data-v-b2e4562d]{display:block;flex:1}.schema-array-inner[data-v-b2e4562d] .n-form-item-feedback-wrapper,.schema-array-inner[data-v-b2e4562d] .n-form-item-label{display:none}.checkbox-group-grid[data-v-b2e4562d]{display:grid;grid-template-columns:repeat(auto-fill,minmax(15rem,1fr));gap:.5rem;white-space:nowrap}.schema-item[data-v-21c3f602]{--border-color: rgba(0, 0, 0, .1)}.schema-item[data-v-21c3f602]:hover{--border-color: rgba(0, 0, 0, .2)}.schema-item[data-v-21c3f602]:not(:last-of-type){margin-bottom:.2rem}[data-theme=darkTheme] .schema-item{--border-color: rgba(255, 255, 255, .1) !important}[data-theme=darkTheme] .schema-item:hover{--border-color: rgba(255, 255, 255, .4) !important}.schema-item-inner .schema-item-inner[data-v-21c3f602]{padding-left:.4rem;transition:border-color .24s ease;border-left:1px solid var(--border-color)}.schema-role-html-info .schema-item-inner[data-v-21c3f602],schema-role-info .schema-item-inner[data-v-21c3f602]{border-left:none;padding-left:0}.schema-item-inner[data-v-21c3f602]{width:100%;height:auto;position:relative}.schema-type-object[data-v-21c3f602]>.n-form-item-feedback-wrapper{display:none}.schema-without-label[data-v-21c3f602]{grid-template-rows:auto}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
export interface SiteMetadata {
|
|
2
|
+
general: SiteInfo;
|
|
3
|
+
specialpagealiases: SiteSpecialPageAlias[];
|
|
4
|
+
namespacealiases: SiteNameSpaceAlias[];
|
|
5
|
+
magicwords: SiteMagicWord[];
|
|
6
|
+
userinfo: SiteUserInfo & {
|
|
7
|
+
options: SiteUserOptions;
|
|
8
|
+
};
|
|
9
|
+
namespaces: Record<string, SiteNamespace>;
|
|
10
|
+
}
|
|
11
|
+
export interface SiteInfo {
|
|
12
|
+
mainpage: string;
|
|
13
|
+
base: string;
|
|
14
|
+
sitename: string;
|
|
15
|
+
mainpageisdomainroot: boolean;
|
|
16
|
+
logo: string;
|
|
17
|
+
generator: string;
|
|
18
|
+
phpversion: string;
|
|
19
|
+
phpsapi: string;
|
|
20
|
+
dbtype: string;
|
|
21
|
+
dbversion: string;
|
|
22
|
+
imagewhitelistenabled: boolean;
|
|
23
|
+
langconversion: boolean;
|
|
24
|
+
titleconversion: boolean;
|
|
25
|
+
linkprefixcharset: string;
|
|
26
|
+
linkprefix: string;
|
|
27
|
+
linktrail: string;
|
|
28
|
+
legaltitlechars: string;
|
|
29
|
+
invalidusernamechars: string;
|
|
30
|
+
allunicodefixes: boolean;
|
|
31
|
+
fixarabicunicode: boolean;
|
|
32
|
+
fixmalayalamunicode: boolean;
|
|
33
|
+
'git-hash'?: string;
|
|
34
|
+
'git-branch'?: string;
|
|
35
|
+
case: 'first-letter' | string;
|
|
36
|
+
lang: string;
|
|
37
|
+
fallback?: {
|
|
38
|
+
code: string;
|
|
39
|
+
}[];
|
|
40
|
+
variants: {
|
|
41
|
+
code: string;
|
|
42
|
+
name: string;
|
|
43
|
+
}[];
|
|
44
|
+
rtl: boolean;
|
|
45
|
+
fallback8bitEncoding: string;
|
|
46
|
+
readonly: boolean;
|
|
47
|
+
writeapi: boolean;
|
|
48
|
+
maxarticlesize: number;
|
|
49
|
+
timezone: string;
|
|
50
|
+
timeoffset: number;
|
|
51
|
+
articlepath: string;
|
|
52
|
+
scriptpath: string;
|
|
53
|
+
script: string;
|
|
54
|
+
variantarticlepath: string | false;
|
|
55
|
+
server: string;
|
|
56
|
+
servername: string;
|
|
57
|
+
wikiid: string;
|
|
58
|
+
time: string;
|
|
59
|
+
misermode: boolean;
|
|
60
|
+
uploadsenabled: boolean;
|
|
61
|
+
maxuploadsize: number;
|
|
62
|
+
minuploadchunksize: number;
|
|
63
|
+
galleryoptions: {
|
|
64
|
+
imagesPerRow: number;
|
|
65
|
+
imageWidth: number;
|
|
66
|
+
imageHeight: number;
|
|
67
|
+
captionLength: boolean;
|
|
68
|
+
showBytes: boolean;
|
|
69
|
+
showDimensions: boolean;
|
|
70
|
+
mode: 'traditional' | string;
|
|
71
|
+
};
|
|
72
|
+
thumblimits: Record<`${number}`, number>;
|
|
73
|
+
imagelimits: Record<`${number}`, {
|
|
74
|
+
width: number;
|
|
75
|
+
height: number;
|
|
76
|
+
}>;
|
|
77
|
+
favicon: string;
|
|
78
|
+
centralidlookupprovider: string;
|
|
79
|
+
allcentralidlookupproviders: string[];
|
|
80
|
+
interwikimagic: boolean;
|
|
81
|
+
magiclinks: Record<string, boolean>;
|
|
82
|
+
categorycollation: 'uppercase' | string;
|
|
83
|
+
citeresponsivereferences: boolean;
|
|
84
|
+
}
|
|
85
|
+
export interface SiteSpecialPageAlias {
|
|
86
|
+
realname: string;
|
|
87
|
+
aliases: string[];
|
|
88
|
+
}
|
|
89
|
+
export interface SiteNameSpaceAlias {
|
|
90
|
+
id: number;
|
|
91
|
+
alias: string;
|
|
92
|
+
}
|
|
93
|
+
export interface SiteNamespace {
|
|
94
|
+
canonical: string;
|
|
95
|
+
case: 'first-letter' | string;
|
|
96
|
+
content: boolean;
|
|
97
|
+
id: number;
|
|
98
|
+
name: string;
|
|
99
|
+
namespaceprotection?: string;
|
|
100
|
+
nonincludable: boolean;
|
|
101
|
+
subpages: boolean;
|
|
102
|
+
}
|
|
103
|
+
export interface SiteMagicWord {
|
|
104
|
+
name: string;
|
|
105
|
+
aliases: string[];
|
|
106
|
+
'case-sensitive': boolean;
|
|
107
|
+
}
|
|
108
|
+
export type SiteUserInfo = {
|
|
109
|
+
id: number;
|
|
110
|
+
name: string;
|
|
111
|
+
groups: string[];
|
|
112
|
+
rights: string[];
|
|
113
|
+
} & Partial<SiteUserBlockInfo>;
|
|
114
|
+
export interface SiteUserBlockInfo {
|
|
115
|
+
blockid: number;
|
|
116
|
+
blockedby: string;
|
|
117
|
+
blockedbyid: string;
|
|
118
|
+
blockreason: string;
|
|
119
|
+
blockedtimestamp: string;
|
|
120
|
+
blockexpiry: string;
|
|
121
|
+
}
|
|
122
|
+
type IntBool = 0 | 1;
|
|
123
|
+
export interface SiteUserOptions {
|
|
124
|
+
minordefault: IntBool;
|
|
125
|
+
watchcreations: IntBool;
|
|
126
|
+
watchdefault: IntBool;
|
|
127
|
+
watchdeletion: IntBool;
|
|
128
|
+
watchuploads: IntBool;
|
|
129
|
+
watchmoves: IntBool;
|
|
130
|
+
language: string;
|
|
131
|
+
[key: string]: unknown;
|
|
132
|
+
}
|
|
133
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const noop: () => void;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { default as Schema } from 'schemastery';
|
|
2
|
+
export declare function schemaValidator(schema: Schema, value: any): {
|
|
3
|
+
status: 'success' | 'error';
|
|
4
|
+
feedback: string;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* @returns `undefined` 空
|
|
8
|
+
* @returns `success` 好
|
|
9
|
+
* @returns `error` 孬
|
|
10
|
+
*/
|
|
11
|
+
export declare function checkURL(str: string, allowAllProtocal?: boolean): "success" | "error" | undefined;
|
|
12
|
+
export declare function openLinkPreview(url: string): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const sleep: (ms?: number) => Promise<unknown>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare function capitalize(source: string): string;
|
|
2
|
+
export declare function uncapitalize(source: string): string;
|
|
3
|
+
export declare function camelCase(source: string): string;
|
|
4
|
+
export declare function paramCase(source: string): string;
|
|
5
|
+
export declare function snakeCase(source: string): string;
|
|
6
|
+
export declare function trimSlash(source: string): string;
|
|
7
|
+
export declare function ensureSlash(source: string): string;
|
package/package.json
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@inpageedit/core",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "🚀 Modular, Extensible Supercharged Plugin for MediaWiki",
|
|
5
|
+
"author": "dragon-fish",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"main": "dist/index.js",
|
|
9
|
+
"types": "dist/index.d.ts",
|
|
10
|
+
"files": [
|
|
11
|
+
"dist"
|
|
12
|
+
],
|
|
13
|
+
"publishConfig": {
|
|
14
|
+
"registry": "https://registry.npmjs.org/",
|
|
15
|
+
"access": "public"
|
|
16
|
+
},
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"@eslint/eslintrc": "^3.3.1",
|
|
19
|
+
"@eslint/js": "^9.36.0",
|
|
20
|
+
"@microsoft/api-extractor": "^7.52.13",
|
|
21
|
+
"@prettier/plugin-pug": "^3.4.2",
|
|
22
|
+
"@tabler/icons-vue": "^3.35.0",
|
|
23
|
+
"@types/jquery": "^3.5.33",
|
|
24
|
+
"@types/node": "^22.18.6",
|
|
25
|
+
"@types/ssi-modal": "^1.0.0",
|
|
26
|
+
"@typescript-eslint/eslint-plugin": "^8.44.1",
|
|
27
|
+
"@typescript-eslint/parser": "^8.44.1",
|
|
28
|
+
"@vitejs/plugin-vue": "^6.0.1",
|
|
29
|
+
"@vue/language-plugin-pug": "^3.0.8",
|
|
30
|
+
"cross-env": "^10.0.0",
|
|
31
|
+
"eslint": "^9.36.0",
|
|
32
|
+
"fexios": "^3.1.0",
|
|
33
|
+
"globals": "^16.4.0",
|
|
34
|
+
"jsx-dom": "^8.1.6",
|
|
35
|
+
"npm-run-all2": "^8.0.4",
|
|
36
|
+
"prettier": "^3.6.2",
|
|
37
|
+
"pug": "^3.0.3",
|
|
38
|
+
"rimraf": "^6.0.1",
|
|
39
|
+
"sass-embedded": "^1.93.2",
|
|
40
|
+
"tsx": "^4.20.5",
|
|
41
|
+
"types-mediawiki": "^2.0.0",
|
|
42
|
+
"typescript": "^5.9.2",
|
|
43
|
+
"unplugin-auto-import": "^20.2.0",
|
|
44
|
+
"unplugin-dts": "1.0.0-beta.6",
|
|
45
|
+
"vite": "^7.1.7"
|
|
46
|
+
},
|
|
47
|
+
"dependencies": {
|
|
48
|
+
"cordis": "^3.18.1",
|
|
49
|
+
"diff": "^8.0.2",
|
|
50
|
+
"localforage": "^1.10.0",
|
|
51
|
+
"naive-ui": "^2.43.1",
|
|
52
|
+
"schemastery": "^3.17.0",
|
|
53
|
+
"vue": "^3.5.21",
|
|
54
|
+
"wiki-saikou": "^5.0.0"
|
|
55
|
+
},
|
|
56
|
+
"peerDependencies": {
|
|
57
|
+
"fexios": "^3.1.0"
|
|
58
|
+
},
|
|
59
|
+
"keywords": [
|
|
60
|
+
"mediawiki",
|
|
61
|
+
"mediawiki-gadget",
|
|
62
|
+
"inpageedit"
|
|
63
|
+
],
|
|
64
|
+
"homepage": "https://www.ipe.wiki/",
|
|
65
|
+
"repository": {
|
|
66
|
+
"type": "git",
|
|
67
|
+
"url": "git+https://github.com/inpageedit/inpageedit-v2.git"
|
|
68
|
+
},
|
|
69
|
+
"bugs": {
|
|
70
|
+
"url": "https://github.com/inpageedit/inpageedit-v2/issues"
|
|
71
|
+
},
|
|
72
|
+
"scripts": {
|
|
73
|
+
"build": "run-p build:*",
|
|
74
|
+
"build:dynamic": "vite build",
|
|
75
|
+
"prepublish": "npm run build",
|
|
76
|
+
"dev": "vite",
|
|
77
|
+
"lint": "eslint ./src",
|
|
78
|
+
"clean": "rimraf dist",
|
|
79
|
+
"format": "prettier --write ./src"
|
|
80
|
+
}
|
|
81
|
+
}
|