@bhsd/codemirror-mediawiki 3.4.0 → 3.4.2

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/statusBar.js CHANGED
@@ -42,8 +42,6 @@ function getLintMarker(view, severity, menu) {
42
42
  const updateDiagnosticsCount = (diagnostics, s, marker) => {
43
43
  marker.lastChild.textContent = String(diagnostics.filter(({ severity }) => severity === s).length);
44
44
  };
45
- const hasFix = (diagnostic) => diagnostic.actions?.some(({ name }) => name === 'fix' || name.startsWith('Fix:'));
46
- const isItemActionable = (cm, { name, isActionable }) => cm.hasPreference(name) && isActionable(cm);
47
45
  const toggleClass = (classList, enabled) => {
48
46
  classList.toggle('cm-status-fix-enabled', enabled);
49
47
  classList.toggle('cm-status-fix-disabled', !enabled);
@@ -74,8 +72,8 @@ const updateDiagnosticMessage = (cm, allDiagnostics, main, msg) => {
74
72
  };
75
73
  const updateMenu = (cm, allDiagnostics, main, classList, menu, fixer) => {
76
74
  if (menu) {
77
- const actionable = menuRegistry.filter(item => isItemActionable(cm, item)), fixable = new Set(fixer && getDiagnostics(allDiagnostics, main).filter(hasFix)
78
- .map(({ message }) => / \(([^()]+)\)$/u.exec(message)?.[1])
75
+ const actionable = menuRegistry.filter(({ name, isActionable }) => cm.hasPreference(name) && isActionable(cm)), fixable = new Set(fixer && getDiagnostics(allDiagnostics, main).filter(({ actions }) => actions?.some(({ name }) => name === 'fix'
76
+ || name !== 'Fix: Stylelint' && name.startsWith('Fix:'))).map(({ message }) => / \(([^()]+)\)$/u.exec(message)?.[1])
79
77
  .filter(Boolean));
80
78
  if (actionable.length === 0 && fixable.size === 0) {
81
79
  toggleClass(classList, false);
@@ -168,8 +166,14 @@ export default (cm, fixer) => [
168
166
  display: 'table-cell',
169
167
  },
170
168
  [workerSelector]: {
171
- '-webkitUserSelect': 'none',
169
+ WebkitUserSelect: 'none',
172
170
  userSelect: 'none',
171
+ '--fix-icon': "url('data:image/svg+xml,"
172
+ + '<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">'
173
+ // eslint-disable-next-line @stylistic/max-len
174
+ + '<path d="M8 19a1 1 0 001 1h2a1 1 0 001-1v-1H8zm9-12a7 7 0 10-12 4.9S7 14 7 15v1a1 1 0 001 1h4a1 1 0 001-1v-1c0-1 2-3.1 2-3.1A7 7 0 0017 7"/>'
175
+ + '</svg>'
176
+ + "')",
173
177
  },
174
178
  [`${workerSelector}>*`]: {
175
179
  display: 'table-cell',
@@ -191,14 +195,13 @@ export default (cm, fixer) => [
191
195
  height: '1em',
192
196
  },
193
197
  [`${disabledSelector},${enabledSelector}`]: {
194
- maskImage: "url('data:image/svg+xml,"
195
- + '<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">'
196
- // eslint-disable-next-line @stylistic/max-len
197
- + '<path d="M8 19a1 1 0 001 1h2a1 1 0 001-1v-1H8zm9-12a7 7 0 10-12 4.9S7 14 7 15v1a1 1 0 001 1h4a1 1 0 001-1v-1c0-1 2-3.1 2-3.1A7 7 0 0017 7"/>'
198
- + '</svg>'
199
- + "')",
198
+ WebkitMaskImage: 'var(--fix-icon)',
199
+ maskImage: 'var(--fix-icon)',
200
+ WebkitMaskSize: '100%',
200
201
  maskSize: '100%',
202
+ WebkitMaskRepeat: 'no-repeat',
201
203
  maskRepeat: 'no-repeat',
204
+ WebkitMaskPosition: 'center',
202
205
  maskPosition: 'center',
203
206
  },
204
207
  [disabledSelector]: {