@bhsd/codemirror-mediawiki 2.20.3 → 2.21.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/mwConfig.mjs CHANGED
@@ -1,9 +1,5 @@
1
1
  // ../code-standard/dist/index.mjs
2
2
  var CDN = "https://testingcf.jsdelivr.net";
3
- var textarea;
4
- if (typeof document === "object") {
5
- textarea = document.createElement("textarea");
6
- }
7
3
  var getObject = (key) => JSON.parse(String(localStorage.getItem(key)));
8
4
  var setObject = (key, value) => {
9
5
  localStorage.setItem(key, JSON.stringify(value));
@@ -134,7 +130,17 @@ var getParserConfig = (minConfig, mwConfig) => {
134
130
  if (config) {
135
131
  return config;
136
132
  }
137
- const { tags, nsid, doubleUnderscore, variants, urlProtocols, redirection, functionSynonyms, img } = mwConfig, [insensitive, sensitive] = functionSynonyms;
133
+ const {
134
+ tags,
135
+ nsid,
136
+ doubleUnderscore,
137
+ variants,
138
+ urlProtocols,
139
+ redirection,
140
+ functionSynonyms,
141
+ variableIDs,
142
+ img
143
+ } = mwConfig, [insensitive, sensitive] = functionSynonyms;
138
144
  config = {
139
145
  ...minConfig,
140
146
  ext: Object.keys(tags),
@@ -145,7 +151,8 @@ var getParserConfig = (minConfig, mwConfig) => {
145
151
  ),
146
152
  variants,
147
153
  protocol: urlProtocols.replace(/\|\\?\/\\?\//u, ""),
148
- redirection: redirection != null ? redirection : minConfig.redirection
154
+ redirection: redirection != null ? redirection : minConfig.redirection,
155
+ ...variableIDs && { variable: variableIDs }
149
156
  };
150
157
  if (location.hostname.endsWith(".moegirl.org.cn")) {
151
158
  config.html[2].push("img");
@@ -158,7 +165,7 @@ var getParserConfig = (minConfig, mwConfig) => {
158
165
  }
159
166
  }
160
167
  }
161
- config.parserFunction[1] = "wikiparser" in globalThis && compareVersion(wikiparse.version, "1.15") && !Object.values(sensitive).includes(true) ? { ...sensitive, "=": "=" } : [...Object.keys(sensitive), "="];
168
+ config.parserFunction[1] = typeof wikiparse === "object" && compareVersion(wikiparse.version, "1.15") && !Object.values(sensitive).includes(true) ? { ...sensitive, "=": "=" } : [...Object.keys(sensitive), "="];
162
169
  for (const [key, val] of Object.entries(img)) {
163
170
  config.img[key] = val.slice(4);
164
171
  }
@@ -1,4 +1,5 @@
1
1
  import type { Extension } from '@codemirror/state';
2
2
  import type { CodeMirror6 } from './codemirror';
3
3
  export declare const isMac: boolean;
4
- export declare const openLinks: ({ langConfig }: CodeMirror6) => Extension;
4
+ declare const _default: ({ langConfig }: CodeMirror6) => Extension;
5
+ export default _default;
package/dist/ref.d.ts CHANGED
@@ -1,15 +1,3 @@
1
- import { EditorView } from '@codemirror/view';
2
- import type { editor } from 'monaco-editor';
3
- declare type Ranges = [number, number][];
4
- /**
5
- * 异步查找注释的内容
6
- * @param view
7
- * @param target 目标名称
8
- * @param all 是否查找所有
9
- * @param group 是否group属性
10
- */
11
- export declare const findRef: (view: EditorView | editor.ITextModel, target: string, all?: boolean, group?: boolean) => Promise<Ranges>;
12
- export declare const refHover: ({
13
- extension: import("@codemirror/state").Extension;
14
- } | readonly import("@codemirror/state").Extension[])[];
15
- export {};
1
+ import type { Extension } from '@codemirror/state';
2
+ declare const _default: Extension;
3
+ export default _default;
@@ -0,0 +1,3 @@
1
+ import type { Extension } from '@codemirror/state';
2
+ declare const _default: Extension;
3
+ export default _default;