@readme/markdown 7.7.1 → 7.7.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/81.js DELETED
@@ -1,382 +0,0 @@
1
- "use strict";
2
- (self["webpackChunk_readme_markdown"] = self["webpackChunk_readme_markdown"] || []).push([[81],{
3
-
4
- /***/ 7081:
5
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
6
-
7
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
8
- /* harmony export */ diagram: () => (/* binding */ diagram)
9
- /* harmony export */ });
10
- /* harmony import */ var _chunk_NGC4727B_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4896);
11
- /* harmony import */ var _chunk_TLUHKHBO_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2843);
12
- /* harmony import */ var _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6322);
13
- /* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(8066);
14
- /* harmony import */ var dagre_d3_es_src_dagre_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(995);
15
- /* harmony import */ var dagre_d3_es_src_graphlib_index_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(4416);
16
-
17
-
18
-
19
-
20
- // src/diagrams/class/classRenderer.js
21
-
22
-
23
-
24
-
25
- // src/diagrams/class/svgDraw.js
26
-
27
- var edgeCount = 0;
28
- var drawEdge = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_2__/* .__name */ .K2)(function(elem, path, relation, conf, diagObj) {
29
- const getRelationType = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_2__/* .__name */ .K2)(function(type) {
30
- switch (type) {
31
- case diagObj.db.relationType.AGGREGATION:
32
- return "aggregation";
33
- case diagObj.db.relationType.EXTENSION:
34
- return "extension";
35
- case diagObj.db.relationType.COMPOSITION:
36
- return "composition";
37
- case diagObj.db.relationType.DEPENDENCY:
38
- return "dependency";
39
- case diagObj.db.relationType.LOLLIPOP:
40
- return "lollipop";
41
- }
42
- }, "getRelationType");
43
- path.points = path.points.filter((p) => !Number.isNaN(p.y));
44
- const lineData = path.points;
45
- const lineFunction = (0,d3__WEBPACK_IMPORTED_MODULE_3__/* .line */ .n8j)().x(function(d) {
46
- return d.x;
47
- }).y(function(d) {
48
- return d.y;
49
- }).curve(d3__WEBPACK_IMPORTED_MODULE_3__/* .curveBasis */ .qrM);
50
- const svgPath = elem.append("path").attr("d", lineFunction(lineData)).attr("id", "edge" + edgeCount).attr("class", "relation");
51
- let url = "";
52
- if (conf.arrowMarkerAbsolute) {
53
- url = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search;
54
- url = url.replace(/\(/g, "\\(");
55
- url = url.replace(/\)/g, "\\)");
56
- }
57
- if (relation.relation.lineType == 1) {
58
- svgPath.attr("class", "relation dashed-line");
59
- }
60
- if (relation.relation.lineType == 10) {
61
- svgPath.attr("class", "relation dotted-line");
62
- }
63
- if (relation.relation.type1 !== "none") {
64
- svgPath.attr(
65
- "marker-start",
66
- "url(" + url + "#" + getRelationType(relation.relation.type1) + "Start)"
67
- );
68
- }
69
- if (relation.relation.type2 !== "none") {
70
- svgPath.attr(
71
- "marker-end",
72
- "url(" + url + "#" + getRelationType(relation.relation.type2) + "End)"
73
- );
74
- }
75
- let x, y;
76
- const l = path.points.length;
77
- let labelPosition = _chunk_TLUHKHBO_mjs__WEBPACK_IMPORTED_MODULE_1__/* .utils_default */ ._K.calcLabelPosition(path.points);
78
- x = labelPosition.x;
79
- y = labelPosition.y;
80
- let p1_card_x, p1_card_y;
81
- let p2_card_x, p2_card_y;
82
- if (l % 2 !== 0 && l > 1) {
83
- let cardinality_1_point = _chunk_TLUHKHBO_mjs__WEBPACK_IMPORTED_MODULE_1__/* .utils_default */ ._K.calcCardinalityPosition(
84
- relation.relation.type1 !== "none",
85
- path.points,
86
- path.points[0]
87
- );
88
- let cardinality_2_point = _chunk_TLUHKHBO_mjs__WEBPACK_IMPORTED_MODULE_1__/* .utils_default */ ._K.calcCardinalityPosition(
89
- relation.relation.type2 !== "none",
90
- path.points,
91
- path.points[l - 1]
92
- );
93
- _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_2__/* .log */ .Rm.debug("cardinality_1_point " + JSON.stringify(cardinality_1_point));
94
- _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_2__/* .log */ .Rm.debug("cardinality_2_point " + JSON.stringify(cardinality_2_point));
95
- p1_card_x = cardinality_1_point.x;
96
- p1_card_y = cardinality_1_point.y;
97
- p2_card_x = cardinality_2_point.x;
98
- p2_card_y = cardinality_2_point.y;
99
- }
100
- if (relation.title !== void 0) {
101
- const g = elem.append("g").attr("class", "classLabel");
102
- const label = g.append("text").attr("class", "label").attr("x", x).attr("y", y).attr("fill", "red").attr("text-anchor", "middle").text(relation.title);
103
- window.label = label;
104
- const bounds = label.node().getBBox();
105
- g.insert("rect", ":first-child").attr("class", "box").attr("x", bounds.x - conf.padding / 2).attr("y", bounds.y - conf.padding / 2).attr("width", bounds.width + conf.padding).attr("height", bounds.height + conf.padding);
106
- }
107
- _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_2__/* .log */ .Rm.info("Rendering relation " + JSON.stringify(relation));
108
- if (relation.relationTitle1 !== void 0 && relation.relationTitle1 !== "none") {
109
- const g = elem.append("g").attr("class", "cardinality");
110
- g.append("text").attr("class", "type1").attr("x", p1_card_x).attr("y", p1_card_y).attr("fill", "black").attr("font-size", "6").text(relation.relationTitle1);
111
- }
112
- if (relation.relationTitle2 !== void 0 && relation.relationTitle2 !== "none") {
113
- const g = elem.append("g").attr("class", "cardinality");
114
- g.append("text").attr("class", "type2").attr("x", p2_card_x).attr("y", p2_card_y).attr("fill", "black").attr("font-size", "6").text(relation.relationTitle2);
115
- }
116
- edgeCount++;
117
- }, "drawEdge");
118
- var drawClass = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_2__/* .__name */ .K2)(function(elem, classDef, conf, diagObj) {
119
- _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_2__/* .log */ .Rm.debug("Rendering class ", classDef, conf);
120
- const id = classDef.id;
121
- const classInfo = {
122
- id,
123
- label: classDef.id,
124
- width: 0,
125
- height: 0
126
- };
127
- const g = elem.append("g").attr("id", diagObj.db.lookUpDomId(id)).attr("class", "classGroup");
128
- let title;
129
- if (classDef.link) {
130
- title = g.append("svg:a").attr("xlink:href", classDef.link).attr("target", classDef.linkTarget).append("text").attr("y", conf.textHeight + conf.padding).attr("x", 0);
131
- } else {
132
- title = g.append("text").attr("y", conf.textHeight + conf.padding).attr("x", 0);
133
- }
134
- let isFirst = true;
135
- classDef.annotations.forEach(function(member) {
136
- const titleText2 = title.append("tspan").text("\xAB" + member + "\xBB");
137
- if (!isFirst) {
138
- titleText2.attr("dy", conf.textHeight);
139
- }
140
- isFirst = false;
141
- });
142
- let classTitleString = getClassTitleString(classDef);
143
- const classTitle = title.append("tspan").text(classTitleString).attr("class", "title");
144
- if (!isFirst) {
145
- classTitle.attr("dy", conf.textHeight);
146
- }
147
- const titleHeight = title.node().getBBox().height;
148
- let membersLine;
149
- let membersBox;
150
- let methodsLine;
151
- if (classDef.members.length > 0) {
152
- membersLine = g.append("line").attr("x1", 0).attr("y1", conf.padding + titleHeight + conf.dividerMargin / 2).attr("y2", conf.padding + titleHeight + conf.dividerMargin / 2);
153
- const members = g.append("text").attr("x", conf.padding).attr("y", titleHeight + conf.dividerMargin + conf.textHeight).attr("fill", "white").attr("class", "classText");
154
- isFirst = true;
155
- classDef.members.forEach(function(member) {
156
- addTspan(members, member, isFirst, conf);
157
- isFirst = false;
158
- });
159
- membersBox = members.node().getBBox();
160
- }
161
- if (classDef.methods.length > 0) {
162
- methodsLine = g.append("line").attr("x1", 0).attr("y1", conf.padding + titleHeight + conf.dividerMargin + membersBox.height).attr("y2", conf.padding + titleHeight + conf.dividerMargin + membersBox.height);
163
- const methods = g.append("text").attr("x", conf.padding).attr("y", titleHeight + 2 * conf.dividerMargin + membersBox.height + conf.textHeight).attr("fill", "white").attr("class", "classText");
164
- isFirst = true;
165
- classDef.methods.forEach(function(method) {
166
- addTspan(methods, method, isFirst, conf);
167
- isFirst = false;
168
- });
169
- }
170
- const classBox = g.node().getBBox();
171
- var cssClassStr = " ";
172
- if (classDef.cssClasses.length > 0) {
173
- cssClassStr = cssClassStr + classDef.cssClasses.join(" ");
174
- }
175
- const rect = g.insert("rect", ":first-child").attr("x", 0).attr("y", 0).attr("width", classBox.width + 2 * conf.padding).attr("height", classBox.height + conf.padding + 0.5 * conf.dividerMargin).attr("class", cssClassStr);
176
- const rectWidth = rect.node().getBBox().width;
177
- title.node().childNodes.forEach(function(x) {
178
- x.setAttribute("x", (rectWidth - x.getBBox().width) / 2);
179
- });
180
- if (classDef.tooltip) {
181
- title.insert("title").text(classDef.tooltip);
182
- }
183
- if (membersLine) {
184
- membersLine.attr("x2", rectWidth);
185
- }
186
- if (methodsLine) {
187
- methodsLine.attr("x2", rectWidth);
188
- }
189
- classInfo.width = rectWidth;
190
- classInfo.height = classBox.height + conf.padding + 0.5 * conf.dividerMargin;
191
- return classInfo;
192
- }, "drawClass");
193
- var getClassTitleString = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_2__/* .__name */ .K2)(function(classDef) {
194
- let classTitleString = classDef.id;
195
- if (classDef.type) {
196
- classTitleString += "<" + (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_2__/* .parseGenericTypes */ .QO)(classDef.type) + ">";
197
- }
198
- return classTitleString;
199
- }, "getClassTitleString");
200
- var drawNote = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_2__/* .__name */ .K2)(function(elem, note, conf, _diagObj) {
201
- _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_2__/* .log */ .Rm.debug("Rendering note ", note, conf);
202
- const id = note.id;
203
- const noteInfo = {
204
- id,
205
- text: note.text,
206
- width: 0,
207
- height: 0
208
- };
209
- const g = elem.append("g").attr("id", id).attr("class", "classGroup");
210
- let text = g.append("text").attr("y", conf.textHeight + conf.padding).attr("x", 0);
211
- const lines = JSON.parse(`"${note.text}"`).split("\n");
212
- lines.forEach(function(line2) {
213
- _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_2__/* .log */ .Rm.debug(`Adding line: ${line2}`);
214
- text.append("tspan").text(line2).attr("class", "title").attr("dy", conf.textHeight);
215
- });
216
- const noteBox = g.node().getBBox();
217
- const rect = g.insert("rect", ":first-child").attr("x", 0).attr("y", 0).attr("width", noteBox.width + 2 * conf.padding).attr(
218
- "height",
219
- noteBox.height + lines.length * conf.textHeight + conf.padding + 0.5 * conf.dividerMargin
220
- );
221
- const rectWidth = rect.node().getBBox().width;
222
- text.node().childNodes.forEach(function(x) {
223
- x.setAttribute("x", (rectWidth - x.getBBox().width) / 2);
224
- });
225
- noteInfo.width = rectWidth;
226
- noteInfo.height = noteBox.height + lines.length * conf.textHeight + conf.padding + 0.5 * conf.dividerMargin;
227
- return noteInfo;
228
- }, "drawNote");
229
- var addTspan = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_2__/* .__name */ .K2)(function(textEl, member, isFirst, conf) {
230
- const { displayText, cssStyle } = member.getDisplayDetails();
231
- const tSpan = textEl.append("tspan").attr("x", conf.padding).text(displayText);
232
- if (cssStyle !== "") {
233
- tSpan.attr("style", member.cssStyle);
234
- }
235
- if (!isFirst) {
236
- tSpan.attr("dy", conf.textHeight);
237
- }
238
- }, "addTspan");
239
- var svgDraw_default = {
240
- getClassTitleString,
241
- drawClass,
242
- drawEdge,
243
- drawNote
244
- };
245
-
246
- // src/diagrams/class/classRenderer.js
247
- var idCache = {};
248
- var padding = 20;
249
- var getGraphId = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_2__/* .__name */ .K2)(function(label) {
250
- const foundEntry = Object.entries(idCache).find((entry) => entry[1].label === label);
251
- if (foundEntry) {
252
- return foundEntry[0];
253
- }
254
- }, "getGraphId");
255
- var insertMarkers = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_2__/* .__name */ .K2)(function(elem) {
256
- elem.append("defs").append("marker").attr("id", "extensionStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 1,7 L18,13 V 1 Z");
257
- elem.append("defs").append("marker").attr("id", "extensionEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 1,1 V 13 L18,7 Z");
258
- elem.append("defs").append("marker").attr("id", "compositionStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
259
- elem.append("defs").append("marker").attr("id", "compositionEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
260
- elem.append("defs").append("marker").attr("id", "aggregationStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
261
- elem.append("defs").append("marker").attr("id", "aggregationEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
262
- elem.append("defs").append("marker").attr("id", "dependencyStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 5,7 L9,13 L1,7 L9,1 Z");
263
- elem.append("defs").append("marker").attr("id", "dependencyEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L14,7 L9,1 Z");
264
- }, "insertMarkers");
265
- var draw = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_2__/* .__name */ .K2)(function(text, id, _version, diagObj) {
266
- const conf = (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_2__/* .getConfig2 */ .D7)().class;
267
- idCache = {};
268
- _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_2__/* .log */ .Rm.info("Rendering diagram " + text);
269
- const securityLevel = (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_2__/* .getConfig2 */ .D7)().securityLevel;
270
- let sandboxElement;
271
- if (securityLevel === "sandbox") {
272
- sandboxElement = (0,d3__WEBPACK_IMPORTED_MODULE_3__/* .select */ .Ltv)("#i" + id);
273
- }
274
- const root = securityLevel === "sandbox" ? (0,d3__WEBPACK_IMPORTED_MODULE_3__/* .select */ .Ltv)(sandboxElement.nodes()[0].contentDocument.body) : (0,d3__WEBPACK_IMPORTED_MODULE_3__/* .select */ .Ltv)("body");
275
- const diagram2 = root.select(`[id='${id}']`);
276
- insertMarkers(diagram2);
277
- const g = new dagre_d3_es_src_graphlib_index_js__WEBPACK_IMPORTED_MODULE_5__/* .Graph */ .T({
278
- multigraph: true
279
- });
280
- g.setGraph({
281
- isMultiGraph: true
282
- });
283
- g.setDefaultEdgeLabel(function() {
284
- return {};
285
- });
286
- const classes = diagObj.db.getClasses();
287
- const keys = [...classes.keys()];
288
- for (const key of keys) {
289
- const classDef = classes.get(key);
290
- const node = svgDraw_default.drawClass(diagram2, classDef, conf, diagObj);
291
- idCache[node.id] = node;
292
- g.setNode(node.id, node);
293
- _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_2__/* .log */ .Rm.info("Org height: " + node.height);
294
- }
295
- const relations = diagObj.db.getRelations();
296
- relations.forEach(function(relation) {
297
- _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_2__/* .log */ .Rm.info(
298
- // cspell:ignore tjoho
299
- "tjoho" + getGraphId(relation.id1) + getGraphId(relation.id2) + JSON.stringify(relation)
300
- );
301
- g.setEdge(
302
- getGraphId(relation.id1),
303
- getGraphId(relation.id2),
304
- {
305
- relation
306
- },
307
- relation.title || "DEFAULT"
308
- );
309
- });
310
- const notes = diagObj.db.getNotes();
311
- notes.forEach(function(note) {
312
- _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_2__/* .log */ .Rm.debug(`Adding note: ${JSON.stringify(note)}`);
313
- const node = svgDraw_default.drawNote(diagram2, note, conf, diagObj);
314
- idCache[node.id] = node;
315
- g.setNode(node.id, node);
316
- if (note.class && classes.has(note.class)) {
317
- g.setEdge(
318
- note.id,
319
- getGraphId(note.class),
320
- {
321
- relation: {
322
- id1: note.id,
323
- id2: note.class,
324
- relation: {
325
- type1: "none",
326
- type2: "none",
327
- lineType: 10
328
- }
329
- }
330
- },
331
- "DEFAULT"
332
- );
333
- }
334
- });
335
- (0,dagre_d3_es_src_dagre_index_js__WEBPACK_IMPORTED_MODULE_4__/* .layout */ .Zp)(g);
336
- g.nodes().forEach(function(v) {
337
- if (v !== void 0 && g.node(v) !== void 0) {
338
- _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_2__/* .log */ .Rm.debug("Node " + v + ": " + JSON.stringify(g.node(v)));
339
- root.select("#" + (diagObj.db.lookUpDomId(v) || v)).attr(
340
- "transform",
341
- "translate(" + (g.node(v).x - g.node(v).width / 2) + "," + (g.node(v).y - g.node(v).height / 2) + " )"
342
- );
343
- }
344
- });
345
- g.edges().forEach(function(e) {
346
- if (e !== void 0 && g.edge(e) !== void 0) {
347
- _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_2__/* .log */ .Rm.debug("Edge " + e.v + " -> " + e.w + ": " + JSON.stringify(g.edge(e)));
348
- svgDraw_default.drawEdge(diagram2, g.edge(e), g.edge(e).relation, conf, diagObj);
349
- }
350
- });
351
- const svgBounds = diagram2.node().getBBox();
352
- const width = svgBounds.width + padding * 2;
353
- const height = svgBounds.height + padding * 2;
354
- (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_2__/* .configureSvgSize */ .a$)(diagram2, height, width, conf.useMaxWidth);
355
- const vBox = `${svgBounds.x - padding} ${svgBounds.y - padding} ${width} ${height}`;
356
- _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_2__/* .log */ .Rm.debug(`viewBox ${vBox}`);
357
- diagram2.attr("viewBox", vBox);
358
- }, "draw");
359
- var classRenderer_default = {
360
- draw
361
- };
362
-
363
- // src/diagrams/class/classDiagram.ts
364
- var diagram = {
365
- parser: _chunk_NGC4727B_mjs__WEBPACK_IMPORTED_MODULE_0__/* .classDiagram_default */ ._$,
366
- db: _chunk_NGC4727B_mjs__WEBPACK_IMPORTED_MODULE_0__/* .classDb_default */ .z2,
367
- renderer: classRenderer_default,
368
- styles: _chunk_NGC4727B_mjs__WEBPACK_IMPORTED_MODULE_0__/* .styles_default */ .tM,
369
- init: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_2__/* .__name */ .K2)((cnf) => {
370
- if (!cnf.class) {
371
- cnf.class = {};
372
- }
373
- cnf.class.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute;
374
- _chunk_NGC4727B_mjs__WEBPACK_IMPORTED_MODULE_0__/* .classDb_default */ .z2.clear();
375
- }, "init")
376
- };
377
-
378
-
379
-
380
- /***/ })
381
-
382
- }]);