@riebeckite/plugin-plantuml 0.1.0 → 0.2.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/dist/index.js CHANGED
@@ -15,23 +15,16 @@ var __export = (target, all) => {
15
15
 
16
16
  // src/hast.ts
17
17
  import {
18
- element as sharedElement,
19
- getStringProperty as sharedGetStringProperty,
20
- getTextContent as sharedGetTextContent,
21
- hasClass as sharedHasClass,
22
- text as sharedText,
23
- visitElements as sharedVisitElements
18
+ element,
19
+ getStringProperty,
20
+ getTextContent,
21
+ hasClass,
22
+ text,
23
+ visitElements
24
24
  } from "@riebeckite/diagram";
25
- var element, text, getTextContent, getStringProperty, hasClass, visitElements;
26
25
  var init_hast = __esm({
27
26
  "src/hast.ts"() {
28
27
  "use strict";
29
- element = sharedElement;
30
- text = sharedText;
31
- getTextContent = sharedGetTextContent;
32
- getStringProperty = sharedGetStringProperty;
33
- hasClass = sharedHasClass;
34
- visitElements = sharedVisitElements;
35
28
  }
36
29
  });
37
30
 
@@ -72,6 +65,7 @@ var rehype_exports = {};
72
65
  __export(rehype_exports, {
73
66
  rehypePlantuml: () => rehypePlantuml
74
67
  });
68
+ import { reportVFileDiagnostic } from "@riebeckite/core";
75
69
  function rehypePlantuml(options = {}) {
76
70
  const resolved = {
77
71
  server: normalizeServer(options.server ?? DEFAULT_SERVER),
@@ -199,15 +193,11 @@ function normalizeServer(server) {
199
193
  return server.replace(/\/+$/, "");
200
194
  }
201
195
  function reportPlantumlDiagnostic(file, message, kind) {
202
- const reporter = file?.message;
203
- if (typeof reporter !== "function") return;
204
- const diagnostic = reporter.call(file, message);
205
- if (diagnostic && typeof diagnostic === "object") {
206
- Object.assign(diagnostic, {
207
- source: "@riebeckite/plugin-plantuml",
208
- ruleId: kind
209
- });
210
- }
196
+ reportVFileDiagnostic(file, {
197
+ source: "@riebeckite/plugin-plantuml",
198
+ ruleId: kind,
199
+ message
200
+ });
211
201
  }
212
202
  function formatError(error) {
213
203
  if (error instanceof Error) return error.message;
@@ -1,7 +1 @@
1
- import type { ElementNode, HastNode, ParentNode, TextNode } from "./types.js";
2
- export declare const element: (tagName: string, properties?: Record<string, unknown>, children?: HastNode[]) => ElementNode;
3
- export declare const text: (value: string) => TextNode;
4
- export declare const getTextContent: (node: HastNode) => string;
5
- export declare const getStringProperty: (node: ElementNode, key: string) => string | null;
6
- export declare const hasClass: (node: ElementNode, className: string) => boolean;
7
- export declare const visitElements: (node: HastNode, visitor: (node: ElementNode, parent?: ParentNode, index?: number) => void, parent?: ParentNode, index?: number) => void;
1
+ export { element, getStringProperty, getTextContent, hasClass, text, visitElements, } from "@riebeckite/diagram";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riebeckite/plugin-plantuml",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -15,13 +15,13 @@
15
15
  "./style.css": "./style.css"
16
16
  },
17
17
  "dependencies": {
18
- "@riebeckite/diagram": "0.1.0"
18
+ "@riebeckite/diagram": "0.2.0"
19
19
  },
20
20
  "peerDependencies": {
21
- "@riebeckite/core": "^0.1.0"
21
+ "@riebeckite/core": "^0.2.0"
22
22
  },
23
23
  "devDependencies": {
24
- "@riebeckite/core": "0.1.0"
24
+ "@riebeckite/core": "0.2.0"
25
25
  },
26
26
  "publishConfig": {
27
27
  "access": "public"