@riebeckite/plugin-plantuml 0.0.30 → 0.0.32
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 +15 -44
- package/dist/src/hast.d.ts +6 -6
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -14,52 +14,23 @@ var __export = (target, all) => {
|
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
// src/hast.ts
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
function element(tagName, properties = {}, children = []) {
|
|
29
|
-
return { type: "element", tagName, properties, children };
|
|
30
|
-
}
|
|
31
|
-
function text(value) {
|
|
32
|
-
return { type: "text", value };
|
|
33
|
-
}
|
|
34
|
-
function getTextContent(node) {
|
|
35
|
-
if (node.type === "text" && "value" in node && typeof node.value === "string") {
|
|
36
|
-
return node.value;
|
|
37
|
-
}
|
|
38
|
-
return getChildren(node).map(getTextContent).join("");
|
|
39
|
-
}
|
|
40
|
-
function getStringProperty(node, key) {
|
|
41
|
-
const value = node.properties?.[key];
|
|
42
|
-
if (typeof value === "string") return value;
|
|
43
|
-
if (Array.isArray(value)) return value.join(" ");
|
|
44
|
-
return null;
|
|
45
|
-
}
|
|
46
|
-
function hasClass(node, className) {
|
|
47
|
-
const value = node.properties?.className;
|
|
48
|
-
const classes = Array.isArray(value) ? value.map(String) : typeof value === "string" ? value.split(/\s+/) : [];
|
|
49
|
-
return classes.includes(className);
|
|
50
|
-
}
|
|
51
|
-
function isElementNode(node) {
|
|
52
|
-
return node.type === "element";
|
|
53
|
-
}
|
|
54
|
-
function hasChildren(node) {
|
|
55
|
-
return Array.isArray(node.children);
|
|
56
|
-
}
|
|
57
|
-
function getChildren(node) {
|
|
58
|
-
const children = node.children;
|
|
59
|
-
return Array.isArray(children) ? children : [];
|
|
60
|
-
}
|
|
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
|
|
24
|
+
} from "@riebeckite/diagram";
|
|
25
|
+
var element, text, getTextContent, getStringProperty, hasClass, visitElements;
|
|
61
26
|
var init_hast = __esm({
|
|
62
27
|
"src/hast.ts"() {
|
|
28
|
+
element = sharedElement;
|
|
29
|
+
text = sharedText;
|
|
30
|
+
getTextContent = sharedGetTextContent;
|
|
31
|
+
getStringProperty = sharedGetStringProperty;
|
|
32
|
+
hasClass = sharedHasClass;
|
|
33
|
+
visitElements = sharedVisitElements;
|
|
63
34
|
}
|
|
64
35
|
});
|
|
65
36
|
|
package/dist/src/hast.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ElementNode, HastNode, ParentNode, TextNode } from "./types.js";
|
|
2
|
-
export declare
|
|
3
|
-
export declare
|
|
4
|
-
export declare
|
|
5
|
-
export declare
|
|
6
|
-
export declare
|
|
7
|
-
export declare
|
|
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;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riebeckite/plugin-plantuml",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.32",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
"./style.css": "./style.css"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@riebeckite/core": "0.0.
|
|
18
|
+
"@riebeckite/core": "0.0.32",
|
|
19
|
+
"@riebeckite/diagram": "0.0.32"
|
|
19
20
|
},
|
|
20
21
|
"publishConfig": {
|
|
21
22
|
"access": "public"
|