@codemirror/lint 6.6.0 → 6.7.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/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 6.7.0 (2024-04-30)
2
+
3
+ ### New features
4
+
5
+ The `renderMessage` function is now called with the editor view as first argument.
6
+
1
7
  ## 6.6.0 (2024-04-29)
2
8
 
3
9
  ### New features
package/dist/index.cjs CHANGED
@@ -314,7 +314,7 @@ function assignKeys(actions) {
314
314
  function renderDiagnostic(view, diagnostic, inPanel) {
315
315
  var _a;
316
316
  let keys = inPanel ? assignKeys(diagnostic.actions) : [];
317
- return elt("li", { class: "cm-diagnostic cm-diagnostic-" + diagnostic.severity }, elt("span", { class: "cm-diagnosticText" }, diagnostic.renderMessage ? diagnostic.renderMessage() : diagnostic.message), (_a = diagnostic.actions) === null || _a === void 0 ? void 0 : _a.map((action, i) => {
317
+ return elt("li", { class: "cm-diagnostic cm-diagnostic-" + diagnostic.severity }, elt("span", { class: "cm-diagnosticText" }, diagnostic.renderMessage ? diagnostic.renderMessage(view) : diagnostic.message), (_a = diagnostic.actions) === null || _a === void 0 ? void 0 : _a.map((action, i) => {
318
318
  let fired = false, click = (e) => {
319
319
  e.preventDefault();
320
320
  if (fired)
package/dist/index.d.cts CHANGED
@@ -40,7 +40,7 @@ interface Diagnostic {
40
40
  An optional custom rendering function that displays the message
41
41
  as a DOM node.
42
42
  */
43
- renderMessage?: () => Node;
43
+ renderMessage?: (view: EditorView) => Node;
44
44
  /**
45
45
  An optional array of actions that can be taken on this
46
46
  diagnostic.
package/dist/index.d.ts CHANGED
@@ -40,7 +40,7 @@ interface Diagnostic {
40
40
  An optional custom rendering function that displays the message
41
41
  as a DOM node.
42
42
  */
43
- renderMessage?: () => Node;
43
+ renderMessage?: (view: EditorView) => Node;
44
44
  /**
45
45
  An optional array of actions that can be taken on this
46
46
  diagnostic.
package/dist/index.js CHANGED
@@ -312,7 +312,7 @@ function assignKeys(actions) {
312
312
  function renderDiagnostic(view, diagnostic, inPanel) {
313
313
  var _a;
314
314
  let keys = inPanel ? assignKeys(diagnostic.actions) : [];
315
- return elt("li", { class: "cm-diagnostic cm-diagnostic-" + diagnostic.severity }, elt("span", { class: "cm-diagnosticText" }, diagnostic.renderMessage ? diagnostic.renderMessage() : diagnostic.message), (_a = diagnostic.actions) === null || _a === void 0 ? void 0 : _a.map((action, i) => {
315
+ return elt("li", { class: "cm-diagnostic cm-diagnostic-" + diagnostic.severity }, elt("span", { class: "cm-diagnosticText" }, diagnostic.renderMessage ? diagnostic.renderMessage(view) : diagnostic.message), (_a = diagnostic.actions) === null || _a === void 0 ? void 0 : _a.map((action, i) => {
316
316
  let fired = false, click = (e) => {
317
317
  e.preventDefault();
318
318
  if (fired)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codemirror/lint",
3
- "version": "6.6.0",
3
+ "version": "6.7.0",
4
4
  "description": "Linting support for the CodeMirror code editor",
5
5
  "scripts": {
6
6
  "test": "cm-runtests",