@bpmnkit/core 0.1.2 → 0.3.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/README.md +30 -1
- package/dist/bpmn/bpmn-builder.d.ts +209 -3
- package/dist/bpmn/bpmn-builder.js +456 -16
- package/dist/bpmn/bpmn-model.d.ts +110 -0
- package/dist/bpmn/bpmn-parser.js +1413 -528
- package/dist/bpmn/bpmn-serializer.js +171 -19
- package/dist/bpmn/compact.d.ts +17 -2
- package/dist/bpmn/compact.js +3 -3
- package/dist/bpmn/diagram-diff.d.ts +71 -0
- package/dist/bpmn/diagram-diff.js +124 -0
- package/dist/bpmn/full-operations.d.ts +89 -0
- package/dist/bpmn/full-operations.js +478 -0
- package/dist/bpmn/index.d.ts +19 -0
- package/dist/bpmn/index.js +21 -0
- package/dist/bpmn/lint.d.ts +97 -0
- package/dist/bpmn/lint.js +135 -0
- package/dist/bpmn/optimize/feel.js +2 -2
- package/dist/bpmn/optimize/patterns.js +23 -16
- package/dist/bpmn/optimize/tasks.js +30 -7
- package/dist/bpmn/optimize/utils.js +2 -4
- package/dist/bpmn/optimize/variable-flow.js +58 -67
- package/dist/bpmn/preserving-writer.d.ts +64 -0
- package/dist/bpmn/preserving-writer.js +70 -0
- package/dist/bpmn/semantic-hash.d.ts +93 -0
- package/dist/bpmn/semantic-hash.js +155 -0
- package/dist/bpmn/sha256.d.ts +17 -0
- package/dist/bpmn/sha256.js +95 -0
- package/dist/bpmn/zeebe-extensions.d.ts +56 -0
- package/dist/bpmn/zeebe-extensions.js +79 -0
- package/dist/bpmn/zeebe-placement.d.ts +12 -0
- package/dist/bpmn/zeebe-placement.js +140 -0
- package/dist/dmn/dmn-serializer.js +7 -2
- package/dist/dmn/preserving-writer.d.ts +31 -0
- package/dist/dmn/preserving-writer.js +36 -0
- package/dist/errors.d.ts +40 -1
- package/dist/errors.js +41 -0
- package/dist/form/preserving-writer.d.ts +47 -0
- package/dist/form/preserving-writer.js +50 -0
- package/dist/index.d.ts +22 -5
- package/dist/index.js +14 -4
- package/dist/json/index.d.ts +5 -0
- package/dist/json/index.js +3 -0
- package/dist/json/json-patch.d.ts +65 -0
- package/dist/json/json-patch.js +416 -0
- package/dist/json/json-spans.d.ts +48 -0
- package/dist/json/json-spans.js +153 -0
- package/dist/layout/semantic/graph.d.ts +9 -1
- package/dist/layout/semantic/graph.js +42 -17
- package/dist/layout/semantic/route.js +102 -42
- package/dist/node/index.d.ts +10 -0
- package/dist/node/index.js +9 -0
- package/dist/node/write.d.ts +81 -0
- package/dist/node/write.js +167 -0
- package/dist/types/id-generator.js +11 -3
- package/dist/xml/index.d.ts +7 -1
- package/dist/xml/index.js +4 -1
- package/dist/xml/xml-parser.d.ts +71 -0
- package/dist/xml/xml-parser.js +437 -145
- package/dist/xml/xml-patch.d.ts +109 -0
- package/dist/xml/xml-patch.js +459 -0
- package/dist/xml/xml-spans.d.ts +45 -0
- package/dist/xml/xml-spans.js +74 -0
- package/package.json +8 -1
package/dist/xml/xml-parser.d.ts
CHANGED
|
@@ -1,4 +1,71 @@
|
|
|
1
1
|
import type { XmlElement } from "../types/xml-element.js";
|
|
2
|
+
/** What a sink wants the scanner to do with an element after its start tag. */
|
|
3
|
+
export declare const Visit: {
|
|
4
|
+
/** Report child elements and character data. */
|
|
5
|
+
readonly All: 0;
|
|
6
|
+
/**
|
|
7
|
+
* Skip the element's content: the scanner fast-forwards past the matching
|
|
8
|
+
* end tag without building attributes or decoding text for anything inside,
|
|
9
|
+
* and `end` is not called for it.
|
|
10
|
+
*/
|
|
11
|
+
readonly Skip: 1;
|
|
12
|
+
/** Report child elements but drop character data without decoding it. */
|
|
13
|
+
readonly ElementsOnly: 2;
|
|
14
|
+
};
|
|
15
|
+
export type Visit = (typeof Visit)[keyof typeof Visit];
|
|
16
|
+
/**
|
|
17
|
+
* Where the tag currently being reported sits in the source.
|
|
18
|
+
*
|
|
19
|
+
* A sink that wants source positions asks for them once, by implementing
|
|
20
|
+
* {@link XmlSink.cursor}; the scanner then records offsets as it goes. Sinks
|
|
21
|
+
* that do not ask pay nothing — recording attribute spans in particular costs
|
|
22
|
+
* a map write per attribute, and parsing is the hottest path in this toolkit.
|
|
23
|
+
*
|
|
24
|
+
* The values are only meaningful inside the `start` or `end` call they were
|
|
25
|
+
* reported for; the scanner overwrites them on the next tag.
|
|
26
|
+
*/
|
|
27
|
+
export interface XmlCursor {
|
|
28
|
+
/** Offset of the `<` opening the start tag reported by `start`. */
|
|
29
|
+
readonly tagStart: number;
|
|
30
|
+
/** Offset just past the `>` closing that start tag. */
|
|
31
|
+
readonly tagEnd: number;
|
|
32
|
+
/** Offset of the `<` opening the end tag reported by `end`. */
|
|
33
|
+
readonly endTagStart: number;
|
|
34
|
+
/** Offset just past the `>` closing that end tag. */
|
|
35
|
+
readonly endTagEnd: number;
|
|
36
|
+
/**
|
|
37
|
+
* Where an attribute's value sits, between its quotes and excluding them.
|
|
38
|
+
* Only valid during the `start` call that reported the attribute.
|
|
39
|
+
*/
|
|
40
|
+
attributeSpan(name: string): {
|
|
41
|
+
readonly start: number;
|
|
42
|
+
readonly end: number;
|
|
43
|
+
} | undefined;
|
|
44
|
+
}
|
|
45
|
+
/** Receives the events of one XML document from {@link scanXml}. */
|
|
46
|
+
export interface XmlSink {
|
|
47
|
+
/**
|
|
48
|
+
* Called once before scanning, when implemented, to hand the sink a cursor
|
|
49
|
+
* onto the source. Implementing it switches the scanner into recording
|
|
50
|
+
* source offsets; leaving it out is the fast path.
|
|
51
|
+
*/
|
|
52
|
+
cursor?(cursor: XmlCursor): void;
|
|
53
|
+
/**
|
|
54
|
+
* @param name qualified name, e.g. "bpmn:task"
|
|
55
|
+
* @param local name without its prefix, e.g. "task" (same string as `name` when unprefixed)
|
|
56
|
+
* @param selfClosing true for `<a/>`; `end` follows immediately
|
|
57
|
+
*/
|
|
58
|
+
start(name: string, local: string, attributes: Record<string, string>, selfClosing: boolean): Visit;
|
|
59
|
+
/** Character data or CDATA directly inside the current element, entities decoded. */
|
|
60
|
+
text(text: string): void;
|
|
61
|
+
end(name: string): void;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Scan an XML document, reporting the root element and everything inside it to
|
|
65
|
+
* `sink`. Returns false when the document has no root element. Content after
|
|
66
|
+
* the root element is ignored.
|
|
67
|
+
*/
|
|
68
|
+
export declare function scanXml(xml: string, sink: XmlSink): boolean;
|
|
2
69
|
/**
|
|
3
70
|
* Parse an XML string into an XmlElement tree.
|
|
4
71
|
* Returns the root element with all namespace prefixes preserved.
|
|
@@ -10,4 +77,8 @@ export declare function parseXml(xml: string): XmlElement;
|
|
|
10
77
|
* Produces a well-formed XML document with declaration.
|
|
11
78
|
*/
|
|
12
79
|
export declare function serializeXml(element: XmlElement): string;
|
|
80
|
+
/** Escapes a value for use between attribute quotes. */
|
|
81
|
+
export declare function escapeAttr(value: string): string;
|
|
82
|
+
/** Escapes a value for use as character data. */
|
|
83
|
+
export declare function escapeText(value: string): string;
|
|
13
84
|
//# sourceMappingURL=xml-parser.d.ts.map
|