@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 @@
|
|
|
1
|
+
{"version":3,"file":"Preferences-Bg3J5Ur9.js","sources":["../src/decorators/Preferences.ts"],"sourcesContent":["import Schema from 'schemastery'\n\ntype AnyConstructor<T = any> = new (...args: any[]) => T\n\nexport type PreferenceAugmented<C extends AnyConstructor, D extends Record<string, any>> = C & {\n PreferencesSchema: Schema<D>\n PreferencesDefaults: D\n}\n\n/**\n * Decorator for registering preferences\n *\n * ```ts\n * @RegisterPreferences(\n * Schema.object({\n * foo: Schema.string().description('Foo description'),\n * }),\n * {\n * foo: 'default foo value',\n * }\n * )\n * class Foo {}\n * ```\n *\n * same as:\n *\n * ```ts\n * class Foo {\n * static ConfigSchema = Schema.object({\n * foo: Schema.string().description('Foo description')\n * })\n * static ConfigDefaults = {\n * foo: 'default foo value'\n * }\n * }\n * ```\n */\nexport function RegisterPreferences<D extends Record<string, any>>(schema: Schema<D>, defaults: D) {\n return function <T extends AnyConstructor>(target: T): PreferenceAugmented<T, D> {\n ;(target as any).PreferencesSchema = schema\n ;(target as any).PreferencesDefaults = defaults\n return target as PreferenceAugmented<T, D>\n }\n}\n"],"names":["RegisterPreferences","schema","defaults","target"],"mappings":"AAqCO,SAASA,EAAmDC,GAAmBC,GAAa;AACjG,SAAO,SAAoCC,GAAsC;AAC7E,WAAAA,EAAe,oBAAoBF,GACnCE,EAAe,sBAAsBD,GAChCC;AAAA,EACT;AACF;"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { j as e } from "./index-CuEf9G7f.js";
|
|
2
|
+
const f = "_mbox_v5fz5_1", u = "_title_v5fz5_12", v = "_content_v5fz5_19", _ = "_close_v5fz5_27", s = {
|
|
3
|
+
mbox: f,
|
|
4
|
+
title: u,
|
|
5
|
+
content: v,
|
|
6
|
+
close: _
|
|
7
|
+
}, P = (i) => {
|
|
8
|
+
const {
|
|
9
|
+
type: t = "default",
|
|
10
|
+
title: n,
|
|
11
|
+
content: c,
|
|
12
|
+
closeable: l = !0,
|
|
13
|
+
titleProps: a,
|
|
14
|
+
contentProps: r,
|
|
15
|
+
children: p,
|
|
16
|
+
...m
|
|
17
|
+
} = i;
|
|
18
|
+
let d = n;
|
|
19
|
+
typeof n > "u" && t !== "default" && (d = t[0].toUpperCase() + t.slice(1).toLowerCase());
|
|
20
|
+
const x = async () => {
|
|
21
|
+
if (!o)
|
|
22
|
+
return Promise.resolve();
|
|
23
|
+
const { promise: h, resolve: b } = Promise.withResolvers();
|
|
24
|
+
return o.animate(
|
|
25
|
+
[
|
|
26
|
+
{ opacity: "1", height: o.clientHeight + "px" },
|
|
27
|
+
{ opacity: "0", height: "0px", margin: "0px" }
|
|
28
|
+
],
|
|
29
|
+
{
|
|
30
|
+
duration: 300,
|
|
31
|
+
easing: "ease"
|
|
32
|
+
}
|
|
33
|
+
).addEventListener("finish", () => {
|
|
34
|
+
o.remove(), b();
|
|
35
|
+
}), h;
|
|
36
|
+
}, o = /* @__PURE__ */ e("div", { className: `theme-ipe ipe-mbox mbox-type-${t || "default"} ${s.mbox}`, ...m, children: [
|
|
37
|
+
d && /* @__PURE__ */ e("div", { className: `ipe-mbox-title ${s.title}`, ...a, children: d }),
|
|
38
|
+
/* @__PURE__ */ e("div", { className: `ipe-mbox-content ${s.content}`, ...r, children: p || c }),
|
|
39
|
+
l && /* @__PURE__ */ e("a", { onClick: x, className: `ipe-mbox-close ${s.close}`, children: "×" })
|
|
40
|
+
] });
|
|
41
|
+
return o.close = x, o;
|
|
42
|
+
}, g = (i) => {
|
|
43
|
+
const { id: t, name: n, value: c, label: l, inputProps: a, labelProps: r, children: p, ...m } = i;
|
|
44
|
+
return /* @__PURE__ */ e("label", { className: "theme-ipe ipe-radio-box", ...m, children: [
|
|
45
|
+
/* @__PURE__ */ e("input", { type: "radio", id: t, name: n, value: c, ...a }),
|
|
46
|
+
/* @__PURE__ */ e("span", { className: "ipe-checkbox-box" }),
|
|
47
|
+
/* @__PURE__ */ e("span", { ...r, children: l || p })
|
|
48
|
+
] });
|
|
49
|
+
};
|
|
50
|
+
export {
|
|
51
|
+
P as M,
|
|
52
|
+
g as R
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=RadioBox-Dl-VRoW0.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioBox-Dl-VRoW0.js","sources":["../src/components/MBox/index.tsx","../src/components/RadioBox.tsx"],"sourcesContent":["import { ReactNode } from 'jsx-dom'\nimport { JSX } from 'jsx-dom/jsx-runtime'\nimport styles from './styles.module.sass'\n\nexport type MBoxProps = {\n type?:\n | ''\n | 'default'\n | 'note'\n | 'info'\n | 'tip'\n | 'success'\n | 'important'\n | 'done'\n | 'warning'\n | 'caution'\n | 'error'\n title?: ReactNode\n content?: ReactNode\n closeable?: boolean\n titleProps?: JSX.IntrinsicElements['div']\n contentProps?: JSX.IntrinsicElements['div']\n} & JSX.IntrinsicElements['div']\n\nexport type MBoxElement = HTMLElement & {\n close: () => Promise<void>\n}\n\nexport const MBox = (props: MBoxProps) => {\n const {\n type = 'default',\n title,\n content,\n closeable = true,\n titleProps,\n contentProps,\n children,\n ...rest\n } = props\n let titleContent = title\n if (typeof title === 'undefined' && type !== 'default') {\n titleContent = type[0].toUpperCase() + type.slice(1).toLowerCase()\n }\n\n const close = async () => {\n if (!box) {\n return Promise.resolve()\n }\n const { promise, resolve } = Promise.withResolvers<void>()\n\n const animation = box.animate(\n [\n { opacity: '1', height: box.clientHeight + 'px' },\n { opacity: '0', height: '0px', margin: '0px' },\n ],\n {\n duration: 300,\n easing: 'ease',\n }\n )\n\n animation.addEventListener('finish', () => {\n box.remove()\n resolve()\n })\n\n return promise\n }\n\n const box = (\n <div className={`theme-ipe ipe-mbox mbox-type-${type || 'default'} ${styles.mbox}`} {...rest}>\n {titleContent && (\n <div className={`ipe-mbox-title ${styles.title}`} {...titleProps}>\n {titleContent}\n </div>\n )}\n <div className={`ipe-mbox-content ${styles.content}`} {...contentProps}>\n {children || content}\n </div>\n {closeable && (\n <a onClick={close} className={`ipe-mbox-close ${styles.close}`}>\n ×\n </a>\n )}\n </div>\n ) as MBoxElement\n box.close = close\n return box\n}\n","import { JSX, ReactNode } from 'jsx-dom'\n\nexport type RadioBoxProps = {\n id?: string\n name: string\n value: string\n label?: string | HTMLElement\n inputProps?: JSX.IntrinsicElements['input']\n labelProps?: JSX.IntrinsicElements['span']\n} & JSX.IntrinsicElements['label']\n\nexport const RadioBox = (props: RadioBoxProps) => {\n const { id, name, value, label, inputProps, labelProps, children, ...rest } = props\n return (\n <label className=\"theme-ipe ipe-radio-box\" {...rest}>\n <input type=\"radio\" id={id} name={name} value={value} {...inputProps} />\n <span className=\"ipe-checkbox-box\"></span>\n <span {...labelProps}>{label || children}</span>\n </label>\n )\n}\n"],"names":["MBox","props","type","title","content","closeable","titleProps","contentProps","children","rest","titleContent","close","box","promise","resolve","jsxs","styles","jsx","RadioBox","id","name","value","label","inputProps","labelProps"],"mappings":";;;;;;GA4BaA,IAAO,CAACC,MAAqB;AACxC,QAAM;AAAA,IACJ,MAAAC,IAAO;AAAA,IACP,OAAAC;AAAA,IACA,SAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,YAAAC;AAAA,IACA,cAAAC;AAAA,IACA,UAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACDR;AACJ,MAAIS,IAAeP;AACnB,EAAI,OAAOA,IAAU,OAAeD,MAAS,cAC3CQ,IAAeR,EAAK,CAAC,EAAE,YAAA,IAAgBA,EAAK,MAAM,CAAC,EAAE,YAAA;AAGvD,QAAMS,IAAQ,YAAY;AACxB,QAAI,CAACC;AACH,aAAO,QAAQ,QAAA;AAEjB,UAAM,EAAE,SAAAC,GAAS,SAAAC,MAAY,QAAQ,cAAA;AAarC,WAXkBF,EAAI;AAAA,MACpB;AAAA,QACE,EAAE,SAAS,KAAK,QAAQA,EAAI,eAAe,KAAA;AAAA,QAC3C,EAAE,SAAS,KAAK,QAAQ,OAAO,QAAQ,MAAA;AAAA,MAAM;AAAA,MAE/C;AAAA,QACE,UAAU;AAAA,QACV,QAAQ;AAAA,MAAA;AAAA,IACV,EAGQ,iBAAiB,UAAU,MAAM;AACzC,MAAAA,EAAI,OAAA,GACJE,EAAA;AAAA,IACF,CAAC,GAEMD;AAAA,EACT,GAEMD,IACJG,gBAAAA,EAAC,OAAA,EAAI,WAAW,gCAAgCb,KAAQ,SAAS,IAAIc,EAAO,IAAI,IAAK,GAAGP,GACrF,UAAA;AAAA,IAAAC,KACC,gBAAAO,EAAC,SAAI,WAAW,kBAAkBD,EAAO,KAAK,IAAK,GAAGV,GACnD,UAAAI,EAAA,CACH;AAAA,IAEF,gBAAAO,EAAC,OAAA,EAAI,WAAW,oBAAoBD,EAAO,OAAO,IAAK,GAAGT,GACvD,UAAAC,KAAYJ,EAAA,CACf;AAAA,IACCC,KACC,gBAAAY,EAAC,KAAA,EAAE,SAASN,GAAO,WAAW,kBAAkBK,EAAO,KAAK,IAAI,UAAA,IAAA,CAEhE;AAAA,EAAA,GAEJ;AAEF,SAAAJ,EAAI,QAAQD,GACLC;AACT,GC7EaM,IAAW,CAACjB,MAAyB;AAChD,QAAM,EAAE,IAAAkB,GAAI,MAAAC,GAAM,OAAAC,GAAO,OAAAC,GAAO,YAAAC,GAAY,YAAAC,GAAY,UAAAhB,GAAU,GAAGC,EAAA,IAASR;AAC9E,SACEc,gBAAAA,EAAC,SAAA,EAAM,WAAU,2BAA2B,GAAGN,GAC7C,UAAA;AAAA,IAAA,gBAAAQ,EAAC,WAAM,MAAK,SAAQ,IAAAE,GAAQ,MAAAC,GAAY,OAAAC,GAAe,GAAGE,GAAY;AAAA,IACtE,gBAAAN,EAAC,QAAA,EAAK,WAAU,mBAAA,CAAmB;AAAA,IACnC,gBAAAA,EAAC,QAAA,EAAM,GAAGO,GAAa,eAAShB,EAAA,CAAS;AAAA,EAAA,GAC3C;AAEJ;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { JSX, ReactNode } from 'jsx-dom';
|
|
2
|
+
export declare const ActionButton: ({ type, link, target, buttonProps, anchorProps, children, }: {
|
|
3
|
+
type?: "primary" | "secondary" | "danger";
|
|
4
|
+
link?: string;
|
|
5
|
+
target?: string;
|
|
6
|
+
anchorProps?: JSX.IntrinsicElements["a"];
|
|
7
|
+
buttonProps?: JSX.IntrinsicElements["button"];
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
}) => import('jsx-dom').ReactElement;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { JSX } from 'jsx-dom';
|
|
2
|
+
export type CheckBoxProps = {
|
|
3
|
+
id?: string;
|
|
4
|
+
name: string;
|
|
5
|
+
label?: string | HTMLElement;
|
|
6
|
+
checked?: boolean;
|
|
7
|
+
inputProps?: JSX.IntrinsicElements['input'];
|
|
8
|
+
labelProps?: JSX.IntrinsicElements['span'];
|
|
9
|
+
} & JSX.IntrinsicElements['label'];
|
|
10
|
+
export declare const CheckBox: (props: CheckBoxProps) => import('jsx-dom').ReactElement;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { JSX } from 'jsx-dom';
|
|
2
|
+
export type InputBoxProps = {
|
|
3
|
+
label: string;
|
|
4
|
+
id?: string;
|
|
5
|
+
name: string;
|
|
6
|
+
value?: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
labelProps?: JSX.IntrinsicElements['label'];
|
|
9
|
+
inputProps?: JSX.IntrinsicElements['input'];
|
|
10
|
+
} & JSX.IntrinsicElements['div'];
|
|
11
|
+
export declare const InputBox: (props: InputBoxProps) => import('jsx-dom').ReactElement;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ReactNode } from 'jsx-dom';
|
|
2
|
+
import { JSX } from 'jsx-dom/jsx-runtime';
|
|
3
|
+
export type MBoxProps = {
|
|
4
|
+
type?: '' | 'default' | 'note' | 'info' | 'tip' | 'success' | 'important' | 'done' | 'warning' | 'caution' | 'error';
|
|
5
|
+
title?: ReactNode;
|
|
6
|
+
content?: ReactNode;
|
|
7
|
+
closeable?: boolean;
|
|
8
|
+
titleProps?: JSX.IntrinsicElements['div'];
|
|
9
|
+
contentProps?: JSX.IntrinsicElements['div'];
|
|
10
|
+
} & JSX.IntrinsicElements['div'];
|
|
11
|
+
export type MBoxElement = HTMLElement & {
|
|
12
|
+
close: () => Promise<void>;
|
|
13
|
+
};
|
|
14
|
+
export declare const MBox: (props: MBoxProps) => MBoxElement;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { JSX } from 'jsx-dom';
|
|
2
|
+
export type RadioBoxProps = {
|
|
3
|
+
id?: string;
|
|
4
|
+
name: string;
|
|
5
|
+
value: string;
|
|
6
|
+
label?: string | HTMLElement;
|
|
7
|
+
inputProps?: JSX.IntrinsicElements['input'];
|
|
8
|
+
labelProps?: JSX.IntrinsicElements['span'];
|
|
9
|
+
} & JSX.IntrinsicElements['label'];
|
|
10
|
+
export declare const RadioBox: (props: RadioBoxProps) => import('jsx-dom').ReactElement;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ReactNode } from 'jsx-dom';
|
|
2
|
+
export interface TabViewLabelOptions {
|
|
3
|
+
name: string;
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
}
|
|
6
|
+
export declare function TabView({ tabs, defaultActiveIndex, }: {
|
|
7
|
+
tabs: (TabViewLabelOptions & {
|
|
8
|
+
content: ReactNode;
|
|
9
|
+
})[];
|
|
10
|
+
defaultActiveIndex?: number;
|
|
11
|
+
}): import('jsx-dom').ReactElement;
|
|
12
|
+
export declare function TabLabel({ name, children }: {
|
|
13
|
+
name: string;
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
}): import('jsx-dom').ReactElement;
|
|
16
|
+
export declare function TabContent({ name, children }: {
|
|
17
|
+
name: string;
|
|
18
|
+
children: ReactNode;
|
|
19
|
+
}): import('jsx-dom').ReactElement;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { JSX } from 'jsx-dom/jsx-runtime';
|
|
2
|
+
export type TwinSwapInputProps = {
|
|
3
|
+
inputs: [TwinSwapInputInput, TwinSwapInputInput];
|
|
4
|
+
enableSwap?: boolean;
|
|
5
|
+
} & JSX.IntrinsicElements['div'];
|
|
6
|
+
export interface TwinSwapInputInput {
|
|
7
|
+
label?: string;
|
|
8
|
+
id?: string;
|
|
9
|
+
name: string;
|
|
10
|
+
value?: string;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
inputProps?: Omit<JSX.IntrinsicElements['input'], 'name' | 'value'>;
|
|
13
|
+
}
|
|
14
|
+
export type TwinSwapElement = HTMLDivElement & {
|
|
15
|
+
swap: () => void;
|
|
16
|
+
toggleEnableSwap: (enable?: boolean) => void;
|
|
17
|
+
};
|
|
18
|
+
export declare const TwinSwapInput: (props: TwinSwapInputProps) => TwinSwapElement;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { CSSProperties, ReactElement } from 'jsx-dom';
|
|
2
|
+
export declare const qs: <T extends Element>(selector: string, parent?: HTMLElement | Document) => T | null;
|
|
3
|
+
export declare const qsa: <T extends Element>(selector: string, parent?: HTMLElement | Document) => NodeListOf<T>;
|
|
4
|
+
export declare const setStyles: (el: HTMLElement | ReactElement, style: CSSProperties) => ReactElement;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare enum Endpoints {
|
|
2
|
+
ANALYTICS_API_BASE = "https://analytics.ipe.wiki/api",
|
|
3
|
+
ANALYTICS_DASH_URL = "https://analytics.ipe.wiki",
|
|
4
|
+
GITHUB_URL = "https://github.com/inpageedit/inpageedit-v2",
|
|
5
|
+
HOME_URL = "https://www.ipe.wiki/",
|
|
6
|
+
PLUGIN_CDN_BASE = "https://ipe-plugins.js.org",
|
|
7
|
+
PLUGIN_HOME_URL = "https://github.com/inpageedit/Plugins",
|
|
8
|
+
SPECIAL_NOTICE_JSON = "https://ipe-plugins.js.org/specialNotice.json",
|
|
9
|
+
UPDATE_LOGS_URL = "https://www.ipe.wiki/update/"
|
|
10
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { default as Schema } from 'schemastery';
|
|
2
|
+
type AnyConstructor<T = any> = new (...args: any[]) => T;
|
|
3
|
+
export type PreferenceAugmented<C extends AnyConstructor, D extends Record<string, any>> = C & {
|
|
4
|
+
PreferencesSchema: Schema<D>;
|
|
5
|
+
PreferencesDefaults: D;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Decorator for registering preferences
|
|
9
|
+
*
|
|
10
|
+
* ```ts
|
|
11
|
+
* @RegisterPreferences(
|
|
12
|
+
* Schema.object({
|
|
13
|
+
* foo: Schema.string().description('Foo description'),
|
|
14
|
+
* }),
|
|
15
|
+
* {
|
|
16
|
+
* foo: 'default foo value',
|
|
17
|
+
* }
|
|
18
|
+
* )
|
|
19
|
+
* class Foo {}
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* same as:
|
|
23
|
+
*
|
|
24
|
+
* ```ts
|
|
25
|
+
* class Foo {
|
|
26
|
+
* static ConfigSchema = Schema.object({
|
|
27
|
+
* foo: Schema.string().description('Foo description')
|
|
28
|
+
* })
|
|
29
|
+
* static ConfigDefaults = {
|
|
30
|
+
* foo: 'default foo value'
|
|
31
|
+
* }
|
|
32
|
+
* }
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export declare function RegisterPreferences<D extends Record<string, any>>(schema: Schema<D>, defaults: D): <T extends AnyConstructor>(target: T) => PreferenceAugmented<T, D>;
|
|
36
|
+
export {};
|