wikiplus-highlight 3.2.4 → 3.2.6
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/README.md +2 -0
- package/dist/main.min.js +1 -1
- package/dist/main.min.js.map +4 -4
- package/package.json +18 -19
package/README.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/wikiplus-highlight)
|
|
4
4
|
[](https://github.com/bhsd-harry/Wikiplus-highlight/actions/workflows/codeql.yml)
|
|
5
|
+
[](https://www.npmjs.com/package/wikiplus-highlight)
|
|
6
|
+
[](https://app.codacy.com/gh/bhsd-harry/Wikiplus-highlight/dashboard)
|
|
5
7
|
|
|
6
8
|
**Wikiplus-highlight** 是由 Bhsd 编写的一款 [Wikiplus](https://github.com/Wikiplus/Wikiplus) 语法高亮插件,它主要基于 MediaWiki 内置的 [JavaScript 模块](https://www.mediawiki.org/wiki/ResourceLoader/Core_modules)和 [CodeMirror](https://codemirror.net/) 编写。
|
|
7
9
|
|
package/dist/main.min.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(()=>{var
|
|
1
|
+
"use strict";(()=>{var p="https://testingcf.jsdelivr.net";var w=i=>JSON.parse(String(localStorage.getItem(i)));var{wgPageName:y,wgNamespaceNumber:u,wgPageContentModel:l}=mw.config.get(),b={wikitext:"mediawiki"},x={css:"css",js:"javascript",json:"json"},j={828:"lua",274:"html"},M=async i=>{var n;let e;if(typeof _WikiplusPages=="object"?e=_WikiplusPages:typeof Pages=="object"&&(e=Pages),e){let o=Object.values(e).filter(({sectionCache:t})=>Object.values(t).includes(i));o.some(({title:t})=>!t.endsWith("/doc"))&&await mw.loader.using("mediawiki.Title");let r=new Set(o.map(({title:t})=>{var d,g,f;if(t.endsWith("/doc"))return"template";let c=new mw.Title(t),s=c.getNamespaceId();if(s%2)return"mediawiki";let a=(f=x[(g=(d=c.getExtension())==null?void 0:d.toLowerCase())!=null?g:""])!=null?f:j[s];switch(a){case"javascript":return s===8||s===2300?"gadget":a;case"css":return s===2||s===8||s===2300?a:"sanitized-css";case void 0:return s===10||s===2?"template":"mediawiki";default:return a}}));if(r.size===1){let[t]=r,c=o.length===1?o[0].title:void 0;return t==="gadget"?["javascript",8]:t==="template"?["mediawiki",10,c]:[t,void 0,c]}else if(r.size===2){if(r.has("javascript")&&r.has("gadget"))return["javascript"];if(r.has("mediawiki")&&r.has("template"))return["mediawiki"]}}return u!==274&&l!=="Scribunto"||y.endsWith("/doc")?[(n=b[l])!=null?n:l,l==="javascript"?u:void 0]:(await mw.loader.using("oojs-ui-windows"),await OO.ui.confirm(mw.msg("cm-mw-contentmodel"),{actions:[{label:u===274?"Widget":"Lua"},{label:"Wikitext",action:"accept"}]})?["mediawiki"]:[u===274?"html":"lua"])},m=()=>(document.getElementById("Wikiplus-Quickedit-Submit").dispatchEvent(new MouseEvent("click")),!0),k=()=>(document.querySelector("#Wikiplus-Quickedit-MinorEdit").checked=!0,m()),h=()=>{let i=w("Wikiplus_Settings"),e=i&&(i.esc_to_exit_quickedit||i.escToExitQuickEdit);return e===!0||e==="true"?(document.getElementById("Wikiplus-Quickedit-Back").dispatchEvent(new MouseEvent("click")),!0):!1},S=async(i,e)=>{var r,t;let n=await CodeMirror6.fromTextArea(i[0],...e?["json"]:await M(i.val()));((t=(r=n.view)==null?void 0:r.dom)!=null?t:n.editor.getDomNode()).id="Wikiplus-CodeMirror",e||(n.editor?(n.editor.addCommand(monaco.KeyMod.CtrlCmd|monaco.KeyCode.KeyS,m),n.editor.addCommand(monaco.KeyMod.CtrlCmd|monaco.KeyMod.Shift|monaco.KeyCode.KeyS,k),n.editor.addCommand(monaco.KeyCode.Escape,h)):n.extraKeys([{key:"Mod-S",run:m},{key:"Shift-Mod-S",run:k},{key:"Esc",run:h}]));let o=document.querySelector("#Wikiplus-Quickedit-Jump > a");o&&(o.href="#Wikiplus-CodeMirror")};(async()=>{var n;let{libs:i}=mediaWiki,{wphl:e}=i;if(!(e!=null&&e.version)){let o="3.2.6";i.wphl={version:o,...e};let r=`npm/@bhsd/codemirror-mediawiki@${(n=i.wphl.cmVersion)!=null?n:"latest"}/dist/wiki.min.js`,t="npm/wikiplus-highlight";typeof CodeMirror6!="function"&&await $.ajax(`${p}/${r}`,{dataType:"script"}),new MutationObserver(s=>{let a=$(s.flatMap(({addedNodes:d})=>[...d])).find("#Wikiplus-Quickedit, #Wikiplus-Setting-Input");a.length>0&&S(a,a.attr("id")==="Wikiplus-Setting-Input")}).observe(document.body,{childList:!0}),mw.loader.load(`${p}/${t}@${o}/styles.min.css`,"text/css")}})();})();
|
|
2
2
|
/**
|
|
3
3
|
* @name Wikiplus-highlight Wikiplus编辑器的CodeMirror语法高亮扩展
|
|
4
4
|
* @author Bhsd <https://github.com/bhsd-harry>
|
package/dist/main.min.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../code-standard/dist/index.
|
|
4
|
-
"sourcesContent": ["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar src_exports = {};\n__export(src_exports, {\n CDN: () => CDN,\n getObject: () => getObject,\n loadScript: () => loadScript,\n normalizeTitle: () => normalizeTitle,\n numToHex: () => numToHex,\n parseVersion: () => parseVersion,\n rawurldecode: () => rawurldecode,\n setObject: () => setObject,\n splitColors: () => splitColors\n});\nmodule.exports = __toCommonJS(src_exports);\nconst CDN = \"https://testingcf.jsdelivr.net\";\nconst hexColor = String.raw`#(?:[\\da-f]{3,4}|(?:[\\da-f]{2}){3,4})(?![\\p{L}\\d_])`, rgbValue = String.raw`(?:\\d*\\.)?\\d+%?`, hue = String.raw`(?:\\d*\\.)?\\d+(?:deg|grad|rad|turn)?`, rgbColor = String.raw`rgba?\\(\\s*(?:${String.raw`${new Array(3).fill(rgbValue).join(String.raw`\\s+`)}(?:\\s*\\/\\s*${rgbValue})?`}|${String.raw`${new Array(3).fill(rgbValue).join(String.raw`\\s*,\\s*`)}(?:\\s*,\\s*${rgbValue})?`})\\s*\\)`, hslColor = String.raw`hsla?\\(\\s*(?:${String.raw`${hue}\\s+${rgbValue}\\s+${rgbValue}(?:\\s*\\/\\s*${rgbValue})?`}|${String.raw`${hue}${String.raw`\\s*,\\s*(?:\\d*\\.)?\\d+%`.repeat(2)}(?:\\s*,\\s*${rgbValue})?`})\\s*\\)`, reFull = new RegExp(String.raw`(^|[^\\p{L}\\d_])(${hexColor}|${rgbColor}|${hslColor})`, \"giu\"), reRGB = new RegExp(String.raw`(^|[^\\p{L}\\d_])(${hexColor}|${rgbColor})`, \"giu\");\nlet span;\nif (typeof document === \"object\") {\n span = document.createElement(\"span\");\n}\nconst rawurldecode = (str) => decodeURIComponent(str.replace(/%(?![\\da-f]{2})/giu, \"%25\"));\nconst normalizeTitle = (title) => {\n const decoded = rawurldecode(title);\n if (/[<>[\\]|{}]/u.test(decoded)) {\n return decoded;\n }\n span.innerHTML = decoded;\n return span.textContent;\n};\nconst numToHex = (d) => Math.round(d * 255).toString(16).padStart(2, \"0\");\nconst splitColors = (str, hsl = true) => {\n const pieces = [], re = hsl ? reFull : reRGB;\n re.lastIndex = 0;\n let mt = re.exec(str), lastIndex = 0;\n while (mt) {\n const index = mt.index + mt[1].length;\n if (index > lastIndex) {\n pieces.push([str.slice(lastIndex, index), lastIndex, index, false]);\n }\n ({ lastIndex } = re);\n pieces.push([mt[2], index, lastIndex, true]);\n mt = re.exec(str);\n }\n if (str.length > lastIndex) {\n pieces.push([str.slice(lastIndex), lastIndex, str.length, false]);\n }\n return pieces;\n};\nconst loadScript = (src, globalConst, amd) => new Promise((resolve) => {\n const path = `${CDN}/${src}`;\n let obj = globalThis;\n for (const prop of globalConst.split(\".\")) {\n obj = obj?.[prop];\n }\n if (obj) {\n resolve();\n } else if (amd && typeof define === \"function\" && \"amd\" in define) {\n const requirejs = globalThis.require;\n requirejs.config({ paths: { [globalConst]: path } });\n requirejs([globalConst], (exports) => {\n Object.assign(globalThis, { [globalConst]: exports });\n resolve();\n });\n } else {\n const script = document.createElement(\"script\");\n script.src = path;\n script.onload = () => {\n resolve();\n };\n document.head.append(script);\n }\n});\nconst getObject = (key) => JSON.parse(String(localStorage.getItem(key)));\nconst setObject = (key, value) => {\n localStorage.setItem(key, JSON.stringify(value));\n};\nconst parseVersion = (v) => v.split(\".\", 3).map(Number);\n", "/**\n * @name Wikiplus-highlight Wikiplus编辑器的CodeMirror语法高亮扩展\n * @author Bhsd <https://github.com/bhsd-harry>\n * @license GPL-3.0\n */\nimport {CDN} from '@bhsd/common';\nimport {renderEditor} from './core';\n\ndeclare namespace mw.libs {\n\tlet wphl: {version?: string, cmVersion?: string} | undefined;\n}\n\n(async () => {\n\tconst {libs} = mw,\n\t\t{wphl} = libs;\n\tif (!wphl?.version) {\n\t\tconst version = '3.2.4';\n\t\tlibs.wphl = {version, ...wphl}; // 开始加载\n\n\t\t// 路径\n\t\tconst MW_CDN = `npm/@bhsd/codemirror-mediawiki@${libs.wphl.cmVersion || 'latest'}/dist/wiki.min.js`,\n\t\t\tREPO_CDN = 'npm/wikiplus-highlight';\n\n\t\tif (!('CodeMirror6' in globalThis)) {\n\t\t\tawait $.ajax(`${CDN}/${MW_CDN}`, {dataType: 'script'});\n\t\t}\n\n\t\t// 监视 Wikiplus 编辑框\n\t\tconst observer = new MutationObserver(records => {\n\t\t\tconst $editArea = $(records.flatMap(({addedNodes}) => [...addedNodes]))\n\t\t\t\t.find<HTMLTextAreaElement>('#Wikiplus-Quickedit, #Wikiplus-Setting-Input');\n\t\t\tif ($editArea.length > 0) {\n\t\t\t\tvoid renderEditor($editArea, $editArea.attr('id') === 'Wikiplus-Setting-Input');\n\t\t\t}\n\t\t});\n\t\tobserver.observe(document.body, {childList: true});\n\n\t\tmediaWiki.loader.load(`${CDN}/${REPO_CDN}@${version}/styles.min.css`, 'text/css');\n\t}\n})();\n", "import {getObject} from '@bhsd/common';\n\nconst {\n\twgPageName: page,\n\twgNamespaceNumber: ns,\n\twgPageContentModel: contentmodel,\n} = mw.config.get();\n\nconst CONTENTMODELS: Record<string, string> = {\n\t\t'sanitized-css': 'css',\n\t\twikitext: 'mediawiki',\n\t},\n\tEXTS: Record<string, string> = {\n\t\tcss: 'css',\n\t\tjs: 'javascript',\n\t\tjson: 'json',\n\t},\n\tNAMESPACES: Record<number, string> = {\n\t\t828: 'lua',\n\t\t274: 'html',\n\t};\n\n/**\n * 检查页面语言类型\n * @param value 页面内容\n */\nconst getPageMode = async (value: string): Promise<[string, (number | undefined)?, (string | undefined)?]> => {\n\tlet WikiplusPages;\n\tif (typeof _WikiplusPages === 'object') {\n\t\tWikiplusPages = _WikiplusPages;\n\t} else if (typeof Pages === 'object') {\n\t\tWikiplusPages = Pages;\n\t}\n\tif (WikiplusPages) {\n\t\tconst pages = Object.values(WikiplusPages)\n\t\t\t.filter(({sectionCache}) => Object.values(sectionCache).includes(value));\n\t\tif (pages.some(({title}) => !title.endsWith('/doc'))) {\n\t\t\tawait mw.loader.using('mediawiki.Title');\n\t\t}\n\t\tconst modes = new Set(pages.map(({title}) => {\n\t\t\tif (title.endsWith('/doc')) {\n\t\t\t\treturn 'template';\n\t\t\t}\n\t\t\tconst t = new mw.Title(title),\n\t\t\t\tnamespace = t.getNamespaceId();\n\t\t\tif (namespace % 2) {\n\t\t\t\treturn 'mediawiki';\n\t\t\t}\n\t\t\tconst mode = EXTS[t.getExtension()?.toLowerCase() ?? ''] ?? NAMESPACES[namespace];\n\t\t\tif (mode) {\n\t\t\t\treturn mode === 'javascript' && (namespace === 8 || namespace === 2300) ? 'gadget' : mode;\n\t\t\t}\n\t\t\treturn namespace === 10 || namespace === 2 ? 'template' : 'mediawiki';\n\t\t}));\n\t\tif (modes.size === 1) {\n\t\t\tconst [mode] = modes,\n\t\t\t\ttitle = pages.length === 1 ? pages[0]!.title : undefined;\n\t\t\tif (mode === 'gadget') {\n\t\t\t\treturn ['javascript', 8];\n\t\t\t}\n\t\t\treturn mode === 'template' ? ['mediawiki', 10, title] : [mode!, undefined, title];\n\t\t} else if (modes.size === 2) {\n\t\t\tif (modes.has('javascript') && modes.has('gadget')) {\n\t\t\t\treturn ['javascript'];\n\t\t\t} else if (modes.has('mediawiki') && modes.has('template')) {\n\t\t\t\treturn ['mediawiki'];\n\t\t\t}\n\t\t}\n\t}\n\tif (ns !== 274 && contentmodel !== 'Scribunto' || page.endsWith('/doc')) {\n\t\treturn [CONTENTMODELS[contentmodel] ?? contentmodel, contentmodel === 'javascript' ? ns : undefined];\n\t}\n\tawait mw.loader.using('oojs-ui-windows');\n\tif (\n\t\tawait OO.ui.confirm(mw.msg('cm-mw-contentmodel'), {\n\t\t\tactions: [{label: ns === 274 ? 'Widget' : 'Lua'}, {label: 'Wikitext', action: 'accept'}],\n\t\t})\n\t) {\n\t\treturn ['mediawiki'];\n\t}\n\treturn [ns === 274 ? 'html' : 'lua'];\n};\n\nconst submit = /** 提交编辑 */ (): true => {\n\t\tdocument.getElementById('Wikiplus-Quickedit-Submit')!.dispatchEvent(new MouseEvent('click'));\n\t\treturn true;\n\t},\n\tsubmitMinor = /** 提交小编辑 */ (): true => {\n\t\tdocument.querySelector<HTMLInputElement>('#Wikiplus-Quickedit-MinorEdit')!.checked = true;\n\t\treturn submit();\n\t},\n\tescapeEdit = /** 按下Esc键退出编辑 */ (): boolean => {\n\t\tconst settings: Record<string, unknown> | null = getObject('Wikiplus_Settings'),\n\t\t\tescToExitQuickEdit = settings && (settings['esc_to_exit_quickedit'] || settings['escToExitQuickEdit']);\n\t\tif (escToExitQuickEdit === true || escToExitQuickEdit === 'true') {\n\t\t\tdocument.getElementById('Wikiplus-Quickedit-Back')!.dispatchEvent(new MouseEvent('click'));\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t};\n\n/**\n * 渲染编辑器\n * @param $target 目标编辑框\n * @param setting 是否是Wikiplus设置(使用json语法)\n */\nexport const renderEditor = async ($target: JQuery<HTMLTextAreaElement>, setting: boolean): Promise<void> => {\n\tconst cm = await CodeMirror6.fromTextArea(\n\t\t$target[0]!,\n\t\t...setting ? ['json'] as [string] : await getPageMode($target.val()!),\n\t);\n\t(cm.view?.dom ?? cm.editor!.getDomNode()!).id = 'Wikiplus-CodeMirror';\n\n\tif (!setting) { // 普通Wikiplus编辑区\n\t\tif (cm.editor) {\n\t\t\t/* eslint-disable no-bitwise */\n\t\t\tcm.editor.addCommand(monaco.KeyMod.CtrlCmd | monaco.KeyCode.KeyS, submit);\n\t\t\tcm.editor.addCommand(monaco.KeyMod.CtrlCmd | monaco.KeyMod.Shift | monaco.KeyCode.KeyS, submitMinor);\n\t\t\t/* eslint-enable no-bitwise */\n\t\t\tcm.editor.addCommand(monaco.KeyCode.Escape, escapeEdit);\n\t\t} else {\n\t\t\tcm.extraKeys([\n\t\t\t\t{key: 'Mod-S', run: submit},\n\t\t\t\t{key: 'Shift-Mod-S', run: submitMinor},\n\t\t\t\t{key: 'Esc', run: escapeEdit},\n\t\t\t]);\n\t\t}\n\t}\n\n\t/** @todo 以下过渡代码添加于2024-02-07,将于一段时间后弃用 */\n\tconst oldKey = 'Wikiplus-highlight-addons',\n\t\toldPrefs: string[] | null = getObject(oldKey),\n\t\tmapping: Record<string, string> = {\n\t\t\tactiveLine: 'highlightActiveLine',\n\t\t\ttrailingspace: 'highlightTrailingWhitespace',\n\t\t\tmatchBrackets: 'bracketMatching',\n\t\t\tcloseBrackets: 'closeBrackets',\n\t\t\tmatchTags: 'tagMatching',\n\t\t\tfold: 'codeFolding',\n\t\t\twikiEditor: 'wikiEditor',\n\t\t\tescape: 'escape',\n\t\t\tcontextmenu: 'openLinks',\n\t\t\tlint: 'lint',\n\t\t};\n\tlocalStorage.removeItem(oldKey);\n\tif (oldPrefs) {\n\t\tcm.prefer(Object.fromEntries(oldPrefs.filter(k => k in mapping).map(k => [mapping[k]!, true])));\n\t}\n\n\tconst jump = document.querySelector<HTMLAnchorElement>('#Wikiplus-Quickedit-Jump > a');\n\tif (jump) {\n\t\tjump.href = '#Wikiplus-CodeMirror';\n\t}\n};\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["
|
|
3
|
+
"sources": ["../../code-standard/dist/index.mjs", "../src/core.ts", "../src/main.ts"],
|
|
4
|
+
"sourcesContent": ["const CDN = \"https://testingcf.jsdelivr.net\";\nconst textarea = /* @__PURE__ */ (() => typeof document === \"object\" ? document.createElement(\"textarea\") : void 0)();\nconst decodeHTML = (str) => {\n textarea.innerHTML = str;\n return textarea.value;\n};\nconst rawurldecode = (str) => decodeURIComponent(str.replace(/%(?![\\da-f]{2})/giu, \"%25\"));\nconst normalizeTitle = (title) => {\n const decoded = rawurldecode(title);\n return /[<>[\\]|{}]/u.test(decoded) ? decoded : decodeHTML(decoded);\n};\nconst numToHex = (d) => Math.round(d * 255).toString(16).padStart(2, \"0\");\nconst regex = /* @__PURE__ */ (() => {\n const hexColor = String.raw`#(?:[\\da-f]{3,4}|(?:[\\da-f]{2}){3,4})(?![\\p{L}\\p{N}_])`, rgbValue = String.raw`(?:\\d*\\.)?\\d+%?`, hue = String.raw`(?:\\d*\\.)?\\d+(?:deg|grad|rad|turn)?`, rgbColor = String.raw`rgba?\\(\\s*(?:${String.raw`${new Array(3).fill(rgbValue).join(String.raw`\\s+`)}(?:\\s*\\/\\s*${rgbValue})?`}|${String.raw`${new Array(3).fill(rgbValue).join(String.raw`\\s*,\\s*`)}(?:\\s*,\\s*${rgbValue})?`})\\s*\\)`, hslColor = String.raw`hsla?\\(\\s*(?:${String.raw`${hue}\\s+${rgbValue}\\s+${rgbValue}(?:\\s*\\/\\s*${rgbValue})?`}|${String.raw`${hue}${String.raw`\\s*,\\s*(?:\\d*\\.)?\\d+%`.repeat(2)}(?:\\s*,\\s*${rgbValue})?`})\\s*\\)`;\n return {\n full: new RegExp(String.raw`(^|[^\\p{L}\\p{N}_])(${hexColor}|${rgbColor}|${hslColor})`, \"giu\"),\n rgb: new RegExp(String.raw`(^|[^\\p{L}\\p{N}_])(${hexColor}|${rgbColor})`, \"giu\")\n };\n})();\nconst splitColors = (str, hsl = true) => {\n const pieces = [], re = regex[hsl ? \"full\" : \"rgb\"];\n re.lastIndex = 0;\n let mt = re.exec(str), lastIndex = 0;\n while (mt) {\n const index = mt.index + mt[1].length;\n if (index > lastIndex) {\n pieces.push([str.slice(lastIndex, index), lastIndex, index, false]);\n }\n ({ lastIndex } = re);\n pieces.push([mt[2], index, lastIndex, str[index - 1] !== \"&\" || !/^#\\d+$/u.test(mt[2])]);\n mt = re.exec(str);\n }\n if (str.length > lastIndex) {\n pieces.push([str.slice(lastIndex), lastIndex, str.length, false]);\n }\n return pieces;\n};\nconst loading = /* @__PURE__ */ new Map();\nconst loadScript = (src, globalConst, amd) => {\n if (loading.has(src)) {\n return loading.get(src);\n }\n const promise = new Promise((resolve) => {\n const path = /^https?:\\/\\//iu.test(src) ? src : `${CDN}/${src}`;\n let obj = globalThis;\n for (const prop of globalConst.split(\".\")) {\n obj = obj?.[prop];\n }\n if (obj) {\n resolve();\n } else if (amd && typeof define === \"function\" && \"amd\" in define) {\n const requirejs = globalThis.require;\n requirejs.config({ paths: { [globalConst]: path } });\n requirejs([globalConst], (exports) => {\n Object.assign(globalThis, { [globalConst]: exports });\n resolve();\n });\n } else {\n const script = document.createElement(\"script\");\n script.src = path;\n script.onload = () => {\n resolve();\n };\n document.head.append(script);\n }\n });\n loading.set(src, promise);\n return promise;\n};\nconst getObject = (key) => JSON.parse(String(localStorage.getItem(key)));\nconst setObject = (key, value) => {\n localStorage.setItem(key, JSON.stringify(value));\n};\nconst parseVersion = (version) => version.split(\".\", 3).map(Number);\nconst compareVersion = (version, baseVersion) => {\n const [major, minor] = parseVersion(version), [baseMajor, baseMinor] = parseVersion(baseVersion);\n return major > baseMajor || major === baseMajor && minor >= baseMinor;\n};\nconst setI18N = async (url, cur, languages, key, i18n = getObject(key) ?? {}) => {\n const { version, lang } = i18n, langs = Array.isArray(languages) ? languages : [languages];\n if (version === cur && langs.includes(lang)) {\n return i18n;\n }\n for (const language of langs) {\n try {\n const res = await fetch(`${url}/${language.toLowerCase()}.json`);\n Object.assign(i18n, await res.json(), { version: cur, lang: language });\n setObject(key, i18n);\n return i18n;\n } catch {\n }\n }\n throw new Error(`Failed to fetch the localization for ${langs[0]}.`);\n};\nlet configLoaded = false, i18nLoaded = false;\nconst getWikiparse = async (getConfig, langs) => {\n const dir = \"extensions/dist\";\n await loadScript(`npm/wikiparser-node/${dir}/base.min.js`, \"wikiparse\");\n await loadScript(`${wikiparse.CDN}/${dir}/lsp.min.js`, \"wikiparse.LanguageService\");\n if (!configLoaded && typeof getConfig === \"function\") {\n configLoaded = true;\n try {\n wikiparse.setConfig(await getConfig());\n } catch {\n }\n }\n if (!i18nLoaded && langs) {\n i18nLoaded = true;\n const key = \"wikiparse-i18n\", { version } = wikiparse;\n try {\n wikiparse.setI18N(await setI18N(`${wikiparse.CDN}/i18n`, version, langs, key));\n } catch {\n setObject(key, { version, lang: \"en\" });\n }\n }\n};\nconst lsps = /* @__PURE__ */ new WeakMap();\nconst getLSP = (obj, include, getConfig, lang) => {\n void getWikiparse(getConfig, lang);\n if (typeof wikiparse !== \"object\" || !wikiparse.LanguageService || lsps.has(obj)) {\n return lsps.get(obj);\n }\n const lsp = new wikiparse.LanguageService(include);\n lsps.set(obj, lsp);\n return lsp;\n};\nconst sanitizeInlineStyle = (style) => style.replace(/[{}]/gu, (p) => p === \"{\" ? \"{\" : \"}\");\nconst refreshStdout = (str) => {\n process.stdout.write(`\\x1B[K\\x1B[?7l${str}\\x1B[?7h\\r`);\n};\nfunction getRegex(f) {\n return (s) => {\n const regexp = new (typeof s === \"string\" ? Map : WeakMap)();\n if (regexp.has(s)) {\n const re2 = regexp.get(s);\n re2.lastIndex = 0;\n return re2;\n }\n const re = f(s);\n regexp.set(s, re);\n return re;\n };\n}\nconst getObjRegex = getRegex;\nexport {\n CDN,\n compareVersion,\n decodeHTML,\n getLSP,\n getObjRegex,\n getObject,\n getRegex,\n getWikiparse,\n loadScript,\n normalizeTitle,\n numToHex,\n rawurldecode,\n refreshStdout,\n sanitizeInlineStyle,\n setI18N,\n setObject,\n splitColors\n};\n", "import {getObject} from '@bhsd/common';\n\nconst {\n\twgPageName: page,\n\twgNamespaceNumber: ns,\n\twgPageContentModel: contentmodel,\n} = mw.config.get();\n\nconst CONTENTMODELS: Record<string, string> = {\n\t\twikitext: 'mediawiki',\n\t},\n\tEXTS: Record<string, string> = {\n\t\tcss: 'css',\n\t\tjs: 'javascript',\n\t\tjson: 'json',\n\t},\n\tNAMESPACES: Record<number, string> = {\n\t\t828: 'lua',\n\t\t274: 'html',\n\t};\n\n/**\n * 检查页面语言类型\n * @param value 页面内容\n */\nconst getPageMode = async (value: string): Promise<[string, (number | undefined)?, (string | undefined)?]> => {\n\tlet WikiplusPages;\n\tif (typeof _WikiplusPages === 'object') {\n\t\tWikiplusPages = _WikiplusPages;\n\t} else if (typeof Pages === 'object') {\n\t\tWikiplusPages = Pages;\n\t}\n\tif (WikiplusPages) {\n\t\tconst pages = Object.values(WikiplusPages)\n\t\t\t.filter(({sectionCache}) => Object.values(sectionCache).includes(value));\n\t\tif (pages.some(({title}) => !title.endsWith('/doc'))) {\n\t\t\tawait mw.loader.using('mediawiki.Title');\n\t\t}\n\t\tconst modes = new Set(pages.map(({title}) => {\n\t\t\tif (title.endsWith('/doc')) {\n\t\t\t\treturn 'template';\n\t\t\t}\n\t\t\tconst t = new mw.Title(title),\n\t\t\t\tnamespace = t.getNamespaceId();\n\t\t\tif (namespace % 2) {\n\t\t\t\treturn 'mediawiki';\n\t\t\t}\n\t\t\tconst mode = EXTS[t.getExtension()?.toLowerCase() ?? ''] ?? NAMESPACES[namespace];\n\t\t\tswitch (mode) {\n\t\t\t\tcase 'javascript':\n\t\t\t\t\treturn namespace === 8 || namespace === 2300 ? 'gadget' : mode;\n\t\t\t\tcase 'css':\n\t\t\t\t\treturn namespace === 2 || namespace === 8 || namespace === 2300 ? mode : 'sanitized-css';\n\t\t\t\tcase undefined:\n\t\t\t\t\treturn namespace === 10 || namespace === 2 ? 'template' : 'mediawiki';\n\t\t\t\tdefault:\n\t\t\t\t\treturn mode;\n\t\t\t}\n\t\t}));\n\t\tif (modes.size === 1) {\n\t\t\tconst [mode] = modes,\n\t\t\t\ttitle = pages.length === 1 ? pages[0]!.title : undefined;\n\t\t\tif (mode === 'gadget') {\n\t\t\t\treturn ['javascript', 8];\n\t\t\t}\n\t\t\treturn mode === 'template' ? ['mediawiki', 10, title] : [mode!, undefined, title];\n\t\t} else if (modes.size === 2) {\n\t\t\tif (modes.has('javascript') && modes.has('gadget')) {\n\t\t\t\treturn ['javascript'];\n\t\t\t} else if (modes.has('mediawiki') && modes.has('template')) {\n\t\t\t\treturn ['mediawiki'];\n\t\t\t}\n\t\t}\n\t}\n\tif (ns !== 274 && contentmodel !== 'Scribunto' || page.endsWith('/doc')) {\n\t\treturn [CONTENTMODELS[contentmodel] ?? contentmodel, contentmodel === 'javascript' ? ns : undefined];\n\t}\n\tawait mw.loader.using('oojs-ui-windows');\n\tif (\n\t\tawait OO.ui.confirm(mw.msg('cm-mw-contentmodel'), {\n\t\t\tactions: [{label: ns === 274 ? 'Widget' : 'Lua'}, {label: 'Wikitext', action: 'accept'}],\n\t\t})\n\t) {\n\t\treturn ['mediawiki'];\n\t}\n\treturn [ns === 274 ? 'html' : 'lua'];\n};\n\nconst submit = /** 提交编辑 */ (): true => {\n\t\tdocument.getElementById('Wikiplus-Quickedit-Submit')!.dispatchEvent(new MouseEvent('click'));\n\t\treturn true;\n\t},\n\tsubmitMinor = /** 提交小编辑 */ (): true => {\n\t\tdocument.querySelector<HTMLInputElement>('#Wikiplus-Quickedit-MinorEdit')!.checked = true;\n\t\treturn submit();\n\t},\n\tescapeEdit = /** 按下Esc键退出编辑 */ (): boolean => {\n\t\tconst settings: Record<string, unknown> | null = getObject('Wikiplus_Settings'),\n\t\t\tescToExitQuickEdit = settings && (settings['esc_to_exit_quickedit'] || settings['escToExitQuickEdit']);\n\t\tif (escToExitQuickEdit === true || escToExitQuickEdit === 'true') {\n\t\t\tdocument.getElementById('Wikiplus-Quickedit-Back')!.dispatchEvent(new MouseEvent('click'));\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t};\n\n/**\n * 渲染编辑器\n * @param $target 目标编辑框\n * @param setting 是否是Wikiplus设置(使用json语法)\n */\nexport const renderEditor = async ($target: JQuery<HTMLTextAreaElement>, setting: boolean): Promise<void> => {\n\tconst cm = await CodeMirror6.fromTextArea(\n\t\t$target[0]!,\n\t\t...setting ? ['json'] satisfies [string] : await getPageMode($target.val()!),\n\t);\n\t(cm.view?.dom ?? cm.editor!.getDomNode()!).id = 'Wikiplus-CodeMirror';\n\n\tif (!setting) { // 普通Wikiplus编辑区\n\t\tif (cm.editor) {\n\t\t\t/* eslint-disable no-bitwise */\n\t\t\tcm.editor.addCommand(monaco.KeyMod.CtrlCmd | monaco.KeyCode.KeyS, submit);\n\t\t\tcm.editor.addCommand(monaco.KeyMod.CtrlCmd | monaco.KeyMod.Shift | monaco.KeyCode.KeyS, submitMinor);\n\t\t\t/* eslint-enable no-bitwise */\n\t\t\tcm.editor.addCommand(monaco.KeyCode.Escape, escapeEdit);\n\t\t} else {\n\t\t\tcm.extraKeys([\n\t\t\t\t{key: 'Mod-S', run: submit},\n\t\t\t\t{key: 'Shift-Mod-S', run: submitMinor},\n\t\t\t\t{key: 'Esc', run: escapeEdit},\n\t\t\t]);\n\t\t}\n\t}\n\n\tconst jump = document.querySelector<HTMLAnchorElement>('#Wikiplus-Quickedit-Jump > a');\n\tif (jump) {\n\t\tjump.href = '#Wikiplus-CodeMirror';\n\t}\n};\n", "/**\n * @name Wikiplus-highlight Wikiplus编辑器的CodeMirror语法高亮扩展\n * @author Bhsd <https://github.com/bhsd-harry>\n * @license GPL-3.0\n */\nimport {CDN} from '@bhsd/common';\nimport {renderEditor} from './core';\n\ndeclare namespace mediaWiki.libs {\n\tlet wphl: {version?: string, cmVersion?: string} | undefined;\n}\n\n(async () => {\n\tconst {libs} = mediaWiki,\n\t\t{wphl} = libs;\n\tif (!wphl?.version) {\n\t\tconst version = '3.2.6';\n\t\tlibs.wphl = {version, ...wphl}; // 开始加载\n\n\t\t// 路径\n\t\tconst MW_CDN = `npm/@bhsd/codemirror-mediawiki@${libs.wphl.cmVersion ?? 'latest'}/dist/wiki.min.js`,\n\t\t\tREPO_CDN = 'npm/wikiplus-highlight';\n\n\t\tif (typeof CodeMirror6 !== 'function') {\n\t\t\tawait $.ajax(`${CDN}/${MW_CDN}`, {dataType: 'script'});\n\t\t}\n\n\t\t// 监视 Wikiplus 编辑框\n\t\tconst observer = new MutationObserver(records => {\n\t\t\tconst $editArea = $(records.flatMap(({addedNodes}) => [...addedNodes]))\n\t\t\t\t.find<HTMLTextAreaElement>('#Wikiplus-Quickedit, #Wikiplus-Setting-Input');\n\t\t\tif ($editArea.length > 0) {\n\t\t\t\tvoid renderEditor($editArea, $editArea.attr('id') === 'Wikiplus-Setting-Input');\n\t\t\t}\n\t\t});\n\t\tobserver.observe(document.body, {childList: true});\n\n\t\tmw.loader.load(`${CDN}/${REPO_CDN}@${version}/styles.min.css`, 'text/css');\n\t}\n})();\n"],
|
|
5
|
+
"mappings": "mBAAA,IAAMA,EAAM,iCAqEZ,IAAMC,EAAaC,GAAQ,KAAK,MAAM,OAAO,aAAa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AAW,CAChD,IAAMC,EAAY,EAAED,EAAQ,QAAQ,CAAC,CAAC,WAAAE,CAAU,IAAM,CAAC,GAAGA,CAAU,CAAC,CAAC,EACpE,KAA0B,8CAA8C,EACtED,EAAU,OAAS,GACjBE,EAAaF,EAAWA,EAAU,KAAK,IAAI,IAAM,wBAAwB,CAEhF,CAAC,EACQ,QAAQ,SAAS,KAAM,CAAC,UAAW,EAAI,CAAC,EAEjD,GAAG,OAAO,KAAK,GAAGF,CAAG,IAAID,CAAQ,IAAIF,CAAO,kBAAmB,UAAU,CAC1E,CACD,GAAG",
|
|
6
|
+
"names": ["CDN", "getObject", "key", "page", "ns", "contentmodel", "CONTENTMODELS", "EXTS", "NAMESPACES", "getPageMode", "value", "_a", "WikiplusPages", "pages", "sectionCache", "title", "modes", "_b", "_c", "t", "namespace", "mode", "submit", "submitMinor", "escapeEdit", "settings", "getObject", "escToExitQuickEdit", "renderEditor", "$target", "setting", "cm", "jump", "_a", "libs", "wphl", "version", "MW_CDN", "REPO_CDN", "CDN", "records", "$editArea", "addedNodes", "renderEditor"]
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wikiplus-highlight",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.6",
|
|
4
4
|
"description": "A plugin for the MediaWiki front-end add-on \"Wikiplus\"",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mediawiki",
|
|
@@ -23,36 +23,35 @@
|
|
|
23
23
|
"url": "git+https://github.com/bhsd-harry/Wikiplus-highlight.git"
|
|
24
24
|
},
|
|
25
25
|
"scripts": {
|
|
26
|
+
"prepublishOnly": "npm run build",
|
|
26
27
|
"lint:ts": "tsc --noEmit && eslint --cache .",
|
|
27
28
|
"lint:css": "stylelint *.css",
|
|
28
29
|
"lint": "npm run lint:ts && npm run lint:css",
|
|
29
30
|
"build": "esbuild ./src/main.ts --charset=utf8 --bundle --minify --target=es2019 --format=iife --sourcemap --outfile=dist/main.min.js && eslint --no-eslintrc -c .eslintrc.dist.cjs dist/*.js"
|
|
30
31
|
},
|
|
31
32
|
"devDependencies": {
|
|
32
|
-
"@bhsd/codemirror-mediawiki": "^2.
|
|
33
|
-
"@bhsd/common": "^0.
|
|
34
|
-
"@stylistic/eslint-plugin": "^
|
|
35
|
-
"@stylistic/stylelint-plugin": "^3.1.
|
|
33
|
+
"@bhsd/codemirror-mediawiki": "^2.28.0",
|
|
34
|
+
"@bhsd/common": "^0.13.0",
|
|
35
|
+
"@stylistic/eslint-plugin": "^3.1.0",
|
|
36
|
+
"@stylistic/stylelint-plugin": "^3.1.2",
|
|
36
37
|
"@types/jquery": "^3.5.32",
|
|
37
|
-
"@types/
|
|
38
|
-
"@
|
|
39
|
-
"@typescript-eslint/
|
|
40
|
-
"
|
|
38
|
+
"@types/node": "^22.13.1",
|
|
39
|
+
"@types/oojs-ui": "^0.49.4",
|
|
40
|
+
"@typescript-eslint/eslint-plugin": "^8.29.0",
|
|
41
|
+
"@typescript-eslint/parser": "^8.29.0",
|
|
42
|
+
"esbuild": "^0.25.2",
|
|
41
43
|
"eslint": "^8.57.1",
|
|
42
44
|
"eslint-plugin-es-x": "^8.4.1",
|
|
43
45
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
44
|
-
"eslint-plugin-jsdoc": "^50.6.
|
|
46
|
+
"eslint-plugin-jsdoc": "^50.6.3",
|
|
45
47
|
"eslint-plugin-json-es": "^1.6.0",
|
|
46
|
-
"eslint-plugin-markdown": "4.0.1",
|
|
47
|
-
"eslint-plugin-n": "^17.14.0",
|
|
48
48
|
"eslint-plugin-promise": "^7.2.1",
|
|
49
|
-
"eslint-plugin-regexp": "^2.
|
|
49
|
+
"eslint-plugin-regexp": "^2.7.0",
|
|
50
50
|
"eslint-plugin-unicorn": "^56.0.1",
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"stylelint": "^16.
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"typescript": "^5.7.2"
|
|
51
|
+
"monaco-editor": "^0.52.2",
|
|
52
|
+
"stylelint": "^16.20.0",
|
|
53
|
+
"stylelint-config-recommended": "^16.0.0",
|
|
54
|
+
"types-mediawiki": "^1.9.1",
|
|
55
|
+
"typescript": "^5.8.2"
|
|
57
56
|
}
|
|
58
57
|
}
|