@loopstack/loopstack-studio 0.29.4 → 0.30.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/_virtual/rolldown_runtime.js +3 -1
- package/dist/api/config.js +5 -4
- package/dist/api/environments.js +5 -1
- package/dist/api/processor.js +4 -1
- package/dist/app/EnvironmentEmbedRoot.js +22 -30
- package/dist/components/ai-elements/code-block.js +4 -4
- package/dist/components/dynamic-form/CodeContent.js +1 -1
- package/dist/components/dynamic-form/Form.js +31 -51
- package/dist/components/dynamic-form/FormBody.js +1 -1
- package/dist/components/motion/FadeIn.js +72 -0
- package/dist/components/motion/StreamingText.js +49 -0
- package/dist/components/ui/accordion.js +2 -2
- package/dist/components/ui-widgets/UiWidget.js +11 -10
- package/dist/components/ui-widgets/widgets/AiPromptInput.js +31 -28
- package/dist/events/sse-client-events.js +7 -1
- package/dist/features/code-explorer/components/FileContentViewer.js +2 -2
- package/dist/features/debug/components/WorkflowFlowViewer.js +49 -51
- package/dist/features/documents/DocumentRenderer.js +18 -17
- package/dist/features/documents/components/DocumentItem.js +42 -20
- package/dist/features/documents/components/DocumentList.js +34 -36
- package/dist/features/documents/components/DocumentMetadataPills.js +102 -49
- package/dist/features/documents/document-details/DocumentDetails.js +577 -377
- package/dist/features/documents/document-details/PromptDetails.js +118 -130
- package/dist/features/documents/document-details/document-debug-utils.js +100 -0
- package/dist/features/documents/renderers/ChoicesRenderer.js +41 -38
- package/dist/features/documents/renderers/ConfirmPromptRenderer.js +31 -28
- package/dist/features/documents/renderers/DocumentFormRenderer.js +62 -70
- package/dist/features/documents/renderers/LlmMessage.js +52 -47
- package/dist/features/documents/renderers/TextPromptRenderer.js +32 -29
- package/dist/features/documents/renderers/useDocumentTransition.js +4 -4
- package/dist/features/feature-registry/FeatureRegistryProvider.js +32 -10
- package/dist/features/feature-registry/available-features.js +12 -0
- package/dist/features/feature-registry/index.js +2 -1
- package/dist/features/file-explorer/components/FileExplorerPanel.js +55 -51
- package/dist/features/git/components/GitBranchBadge.js +31 -0
- package/dist/features/git/components/GitCommitList.js +46 -0
- package/dist/features/git/components/GitRemoteStatus.js +84 -0
- package/dist/features/git/components/WorkbenchGitPanel.js +81 -0
- package/dist/features/git/git-feature.js +12 -0
- package/dist/features/git/hooks/useGit.js +78 -0
- package/dist/features/git/index.js +1 -0
- package/dist/features/oauth/OAuthPromptRenderer.js +137 -142
- package/dist/features/runs/Runs.js +4 -4
- package/dist/features/secrets/components/WorkbenchSecretsPanel.js +1 -1
- package/dist/features/secrets/renderers/SecretInputRenderer.js +30 -29
- package/dist/features/workbench/Workbench.js +25 -33
- package/dist/features/workbench/WorkflowItem.js +9 -9
- package/dist/features/workbench/WorkflowList.js +61 -62
- package/dist/features/workbench/components/NewRunDialog.js +237 -209
- package/dist/features/workbench/components/RecentRunItem.js +3 -3
- package/dist/features/workbench/components/WorkbenchEnvironmentPanel.js +8 -8
- package/dist/features/workbench/components/WorkbenchIconSidebar.js +1 -1
- package/dist/features/workbench/components/WorkbenchSidebarShell.js +3 -3
- package/dist/features/workbench/components/WorkflowForms.js +11 -10
- package/dist/features/workbench/components/WorkflowHistoryItem.js +16 -36
- package/dist/features/workbench/components/WorkflowHistoryList.js +19 -17
- package/dist/features/workbench/components/buttons/WorkflowButtons.js +3 -3
- package/dist/features/workbench/hooks/useLlmStreamingDocuments.js +159 -0
- package/dist/features/workbench/hooks/useWorkflowData.js +58 -31
- package/dist/features/workbench/index.js +2 -2
- package/dist/features/workbench/providers/WorkbenchLayoutProvider.js +53 -53
- package/dist/features/workspaces/Workspaces.js +134 -125
- package/dist/features/workspaces/components/CreateWorkspace.js +115 -107
- package/dist/features/workspaces/components/ExecutionTimeline.js +2 -2
- package/dist/features/workspaces/components/WorkflowRunForm.js +127 -104
- package/dist/features/workspaces/components/WorkspaceHomePage.js +6 -89
- package/dist/features/workspaces/components/workflow-form/ArgumentsView.js +1 -1
- package/dist/features/workspaces/components/workflow-form/SelectionView.js +15 -15
- package/dist/hooks/index.js +3 -2
- package/dist/hooks/query-keys.js +43 -30
- package/dist/hooks/useConfig.js +28 -22
- package/dist/hooks/useEnvironments.js +27 -2
- package/dist/hooks/useProcessor.js +14 -1
- package/dist/hooks/useWorkflows.js +4 -4
- package/dist/index.d.ts +116 -15
- package/dist/index.js +9 -8
- package/dist/node_modules/d3/src/index.js +13 -13
- package/dist/node_modules/d3-scale/src/continuous.js +16 -16
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/architectureDiagram-3BPJPVTR.js +43 -43
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/blockDiagram-GPEHLZMM.js +270 -270
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/c4Diagram-AAUBKEIU.js +90 -90
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-3OPIFGDE.js +458 -458
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-55IACEB6.js +3 -3
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-5ZQYHXKU.js +37 -37
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-727SXJPM.js +208 -208
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-KSCS5N6A.js +145 -145
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-ND2GUHAM.js +7 -7
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-O5CBEL6O.js +41 -41
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-WU5MYG2G.js +3 -3
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/cose-bilkent-S5V4N54A.js +6 -6
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/diagram-KO2AKTUF.js +30 -30
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/diagram-OG6HWLK6.js +82 -82
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/erDiagram-TEJ5UH35.js +65 -65
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/flowDiagram-I6XJVG4X.js +227 -227
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/ganttDiagram-6RSMTGT7.js +104 -104
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/gitGraphDiagram-PVQCEYII.js +104 -104
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/journeyDiagram-JHISSGLW.js +49 -49
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/quadrantDiagram-W4KKPZXB.js +101 -101
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/sankeyDiagram-5OEKKPKP.js +20 -20
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/sequenceDiagram-3UESZ5HK.js +354 -354
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/stateDiagram-AJRCARHV.js +53 -53
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/timeline-definition-PNZ67QCA.js +113 -113
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/vennDiagram-CIIHVFJN.js +90 -90
- package/dist/node_modules/mermaid/dist/mermaid.core.js +156 -156
- package/dist/node_modules/motion/dist/es/react.js +9 -2
- package/dist/pages/DebugWorkflowDetailsPage.js +2 -2
- package/dist/pages/DebugWorkflowsPage.js +76 -106
- package/dist/pages/EmbedWorkbenchPage.js +1 -1
- package/dist/pages/PreviewWorkbenchPage.js +6 -6
- package/dist/pages/WorkbenchPage.js +43 -47
- package/dist/pages/WorkflowDebugPage.js +6 -12
- package/dist/pages/WorkspacePage.js +40 -66
- package/dist/pages/WorkspaceRunsPage.js +24 -31
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import select_default from "../../../../d3-selection/src/select.js";
|
|
1
2
|
import { __name, log } from "./chunk-AGHRB4JF.js";
|
|
2
3
|
import { getConfig, getConfig2, getEffectiveHtmlLabels } from "./chunk-CSCIHK7Q.js";
|
|
3
|
-
import select_default from "../../../../d3-selection/src/select.js";
|
|
4
4
|
import linear_default from "../../../../d3-shape/src/curve/linear.js";
|
|
5
5
|
import line_default from "../../../../d3-shape/src/line.js";
|
|
6
6
|
import { bumpX, bumpY } from "../../../../d3-shape/src/curve/bump.js";
|
|
@@ -95,89 +95,89 @@ var addEdgeMarkers = /* @__PURE__ */ __name((e, r, i, a, o, s = !1, c) => {
|
|
|
95
95
|
"composition",
|
|
96
96
|
"dependency",
|
|
97
97
|
"barb"
|
|
98
|
-
], addEdgeMarker = /* @__PURE__ */ __name((e,
|
|
98
|
+
], addEdgeMarker = /* @__PURE__ */ __name((e, r, a, o, s, c, l = !1, u) => {
|
|
99
99
|
let d = arrowTypesMap[a], f = d && arrowTypesWithMarginSupport.includes(d.type);
|
|
100
100
|
if (!d) {
|
|
101
101
|
log.warn(`Unknown arrow type: ${a}`);
|
|
102
102
|
return;
|
|
103
103
|
}
|
|
104
|
-
let p = `${s}_${c}-${d.type}${
|
|
104
|
+
let p = `${s}_${c}-${d.type}${r === "start" ? "Start" : "End"}${l && f ? "-margin" : ""}`;
|
|
105
105
|
if (u && u.trim() !== "") {
|
|
106
|
-
let
|
|
107
|
-
if (!document.getElementById(
|
|
106
|
+
let i = `${p}_${u.replace(/[^\dA-Za-z]/g, "_")}`;
|
|
107
|
+
if (!document.getElementById(i)) {
|
|
108
108
|
let e = document.getElementById(p);
|
|
109
109
|
if (e) {
|
|
110
|
-
let
|
|
111
|
-
|
|
110
|
+
let r = e.cloneNode(!0);
|
|
111
|
+
r.id = i, r.querySelectorAll("path, circle, line").forEach((e) => {
|
|
112
112
|
e.setAttribute("stroke", u), d.fill && e.setAttribute("fill", u);
|
|
113
|
-
}), e.parentNode?.appendChild(
|
|
113
|
+
}), e.parentNode?.appendChild(r);
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
|
-
e.attr(`marker-${
|
|
117
|
-
} else e.attr(`marker-${
|
|
116
|
+
e.attr(`marker-${r}`, `url(${o}#${i})`);
|
|
117
|
+
} else e.attr(`marker-${r}`, `url(${o}#${p})`);
|
|
118
118
|
}, "addEdgeMarker"), resolveEdgeCurveType = /* @__PURE__ */ __name((e) => typeof e == "string" ? e : getConfig2()?.flowchart?.curve, "resolveEdgeCurveType"), edgeLabels = /* @__PURE__ */ new Map(), terminalLabels = /* @__PURE__ */ new Map(), clear = /* @__PURE__ */ __name(() => {
|
|
119
119
|
edgeLabels.clear(), terminalLabels.clear();
|
|
120
|
-
}, "clear"), getLabelStyles = /* @__PURE__ */ __name((e) => e ? typeof e == "string" ? e : e.reduce((e, r) => e + ";" + r, "") : "", "getLabelStyles"), insertEdgeLabel = /* @__PURE__ */ __name(async (
|
|
121
|
-
let c = getConfig2(), l = getEffectiveHtmlLabels(c), { labelStyles: u } = styles2String(
|
|
122
|
-
|
|
123
|
-
let d =
|
|
124
|
-
style: getLabelStyles(
|
|
120
|
+
}, "clear"), getLabelStyles = /* @__PURE__ */ __name((e) => e ? typeof e == "string" ? e : e.reduce((e, r) => e + ";" + r, "") : "", "getLabelStyles"), insertEdgeLabel = /* @__PURE__ */ __name(async (r, a) => {
|
|
121
|
+
let c = getConfig2(), l = getEffectiveHtmlLabels(c), { labelStyles: u } = styles2String(a);
|
|
122
|
+
a.labelStyle = u;
|
|
123
|
+
let d = r.insert("g").attr("class", "edgeLabel"), f = d.insert("g").attr("class", "label").attr("data-id", a.id), p = a.labelType === "markdown", m = await createText(r, a.label, {
|
|
124
|
+
style: getLabelStyles(a.labelStyle),
|
|
125
125
|
useHtmlLabels: l,
|
|
126
126
|
addSvgBackground: !0,
|
|
127
127
|
isNode: !1,
|
|
128
128
|
markdown: p,
|
|
129
129
|
width: void 0
|
|
130
130
|
}, c);
|
|
131
|
-
f.node().appendChild(m), log.info("abc82",
|
|
131
|
+
f.node().appendChild(m), log.info("abc82", a, a.labelType);
|
|
132
132
|
let h = m.getBBox(), g = h;
|
|
133
133
|
if (l) {
|
|
134
|
-
let
|
|
135
|
-
h =
|
|
134
|
+
let r = m.children[0], i = select_default(m);
|
|
135
|
+
h = r.getBoundingClientRect(), g = h, i.attr("width", h.width), i.attr("height", h.height);
|
|
136
136
|
} else {
|
|
137
|
-
let
|
|
138
|
-
|
|
137
|
+
let r = select_default(m).select("text").node();
|
|
138
|
+
r && typeof r.getBBox == "function" && (g = r.getBBox());
|
|
139
139
|
}
|
|
140
|
-
f.attr("transform", computeLabelTransform(g, l)), edgeLabels.set(
|
|
140
|
+
f.attr("transform", computeLabelTransform(g, l)), edgeLabels.set(a.id, d), a.width = h.width, a.height = h.height;
|
|
141
141
|
let _;
|
|
142
|
-
if (
|
|
143
|
-
let
|
|
144
|
-
_ =
|
|
145
|
-
let c =
|
|
142
|
+
if (a.startLabelLeft) {
|
|
143
|
+
let i = r.insert("g").attr("class", "edgeTerminals"), o = i.insert("g").attr("class", "inner"), s = await createLabel_default(o, a.startLabelLeft, getLabelStyles(a.labelStyle) || "", !1, !1);
|
|
144
|
+
_ = s;
|
|
145
|
+
let c = s.getBBox();
|
|
146
146
|
if (l) {
|
|
147
|
-
let
|
|
148
|
-
c =
|
|
147
|
+
let r = s.children[0], i = select_default(s);
|
|
148
|
+
c = r.getBoundingClientRect(), i.attr("width", c.width), i.attr("height", c.height);
|
|
149
149
|
}
|
|
150
|
-
|
|
150
|
+
o.attr("transform", computeLabelTransform(c, l)), terminalLabels.get(a.id) || terminalLabels.set(a.id, {}), terminalLabels.get(a.id).startLeft = i, setTerminalWidth(_, a.startLabelLeft);
|
|
151
151
|
}
|
|
152
|
-
if (
|
|
153
|
-
let
|
|
154
|
-
_ =
|
|
155
|
-
let c =
|
|
152
|
+
if (a.startLabelRight) {
|
|
153
|
+
let i = r.insert("g").attr("class", "edgeTerminals"), o = i.insert("g").attr("class", "inner"), s = await createLabel_default(o, a.startLabelRight, getLabelStyles(a.labelStyle) || "", !1, !1);
|
|
154
|
+
_ = s;
|
|
155
|
+
let c = s.getBBox();
|
|
156
156
|
if (l) {
|
|
157
|
-
let
|
|
158
|
-
c =
|
|
157
|
+
let r = s.children[0], i = select_default(s);
|
|
158
|
+
c = r.getBoundingClientRect(), i.attr("width", c.width), i.attr("height", c.height);
|
|
159
159
|
}
|
|
160
|
-
|
|
160
|
+
o.attr("transform", computeLabelTransform(c, l)), terminalLabels.get(a.id) || terminalLabels.set(a.id, {}), terminalLabels.get(a.id).startRight = i, setTerminalWidth(_, a.startLabelRight);
|
|
161
161
|
}
|
|
162
|
-
if (
|
|
163
|
-
let
|
|
164
|
-
_ =
|
|
165
|
-
let c =
|
|
162
|
+
if (a.endLabelLeft) {
|
|
163
|
+
let i = r.insert("g").attr("class", "edgeTerminals"), o = i.insert("g").attr("class", "inner"), s = await createLabel_default(i, a.endLabelLeft, getLabelStyles(a.labelStyle) || "", !1, !1);
|
|
164
|
+
_ = s;
|
|
165
|
+
let c = s.getBBox();
|
|
166
166
|
if (l) {
|
|
167
|
-
let
|
|
168
|
-
c =
|
|
167
|
+
let r = s.children[0], i = select_default(s);
|
|
168
|
+
c = r.getBoundingClientRect(), i.attr("width", c.width), i.attr("height", c.height);
|
|
169
169
|
}
|
|
170
|
-
|
|
170
|
+
o.attr("transform", computeLabelTransform(c, l)), terminalLabels.get(a.id) || terminalLabels.set(a.id, {}), terminalLabels.get(a.id).endLeft = i, setTerminalWidth(_, a.endLabelLeft);
|
|
171
171
|
}
|
|
172
|
-
if (
|
|
173
|
-
let
|
|
174
|
-
_ =
|
|
175
|
-
let c =
|
|
172
|
+
if (a.endLabelRight) {
|
|
173
|
+
let i = r.insert("g").attr("class", "edgeTerminals"), o = i.insert("g").attr("class", "inner"), s = await createLabel_default(i, a.endLabelRight, getLabelStyles(a.labelStyle) || "", !1, !1);
|
|
174
|
+
_ = s;
|
|
175
|
+
let c = s.getBBox();
|
|
176
176
|
if (l) {
|
|
177
|
-
let
|
|
178
|
-
c =
|
|
177
|
+
let r = s.children[0], i = select_default(s);
|
|
178
|
+
c = r.getBoundingClientRect(), i.attr("width", c.width), i.attr("height", c.height);
|
|
179
179
|
}
|
|
180
|
-
|
|
180
|
+
o.attr("transform", computeLabelTransform(c, l)), terminalLabels.get(a.id) || terminalLabels.set(a.id, {}), terminalLabels.get(a.id).endRight = i, setTerminalWidth(_, a.endLabelRight);
|
|
181
181
|
}
|
|
182
182
|
return m;
|
|
183
183
|
}, "insertEdgeLabel");
|
|
@@ -185,84 +185,84 @@ function setTerminalWidth(e, r) {
|
|
|
185
185
|
getEffectiveHtmlLabels(getConfig2()) && e && (e.style.width = r.length * 9 + "px", e.style.height = "12px");
|
|
186
186
|
}
|
|
187
187
|
__name(setTerminalWidth, "setTerminalWidth");
|
|
188
|
-
var positionEdgeLabel = /* @__PURE__ */ __name((e,
|
|
189
|
-
log.debug("Moving label abc88 ", e.id, e.label, edgeLabels.get(e.id),
|
|
190
|
-
let
|
|
188
|
+
var positionEdgeLabel = /* @__PURE__ */ __name((e, r) => {
|
|
189
|
+
log.debug("Moving label abc88 ", e.id, e.label, edgeLabels.get(e.id), r);
|
|
190
|
+
let a = r.updatedPath ? r.updatedPath : r.originalPath, { subGraphTitleTotalMargin: s } = getSubGraphTitleMargins(getConfig2());
|
|
191
191
|
if (e.label) {
|
|
192
|
-
let
|
|
193
|
-
if (
|
|
194
|
-
let
|
|
195
|
-
log.debug("Moving label " + e.label + " from (", c, ",", l, ") to (",
|
|
192
|
+
let o = edgeLabels.get(e.id), c = e.x, l = e.y;
|
|
193
|
+
if (a) {
|
|
194
|
+
let o = utils_default.calcLabelPosition(a);
|
|
195
|
+
log.debug("Moving label " + e.label + " from (", c, ",", l, ") to (", o.x, ",", o.y, ") abc88"), r.updatedPath && (c = o.x, l = o.y);
|
|
196
196
|
}
|
|
197
|
-
|
|
197
|
+
o.attr("transform", `translate(${c}, ${l + s / 2})`);
|
|
198
198
|
}
|
|
199
199
|
if (e.startLabelLeft) {
|
|
200
|
-
let r = terminalLabels.get(e.id).startLeft, i = e.x,
|
|
201
|
-
if (
|
|
202
|
-
let r = utils_default.calcTerminalLabelPosition(e.arrowTypeStart ? 10 : 0, "start_left",
|
|
203
|
-
i = r.x,
|
|
200
|
+
let r = terminalLabels.get(e.id).startLeft, i = e.x, o = e.y;
|
|
201
|
+
if (a) {
|
|
202
|
+
let r = utils_default.calcTerminalLabelPosition(e.arrowTypeStart ? 10 : 0, "start_left", a);
|
|
203
|
+
i = r.x, o = r.y;
|
|
204
204
|
}
|
|
205
|
-
r.attr("transform", `translate(${i}, ${
|
|
205
|
+
r.attr("transform", `translate(${i}, ${o})`);
|
|
206
206
|
}
|
|
207
207
|
if (e.startLabelRight) {
|
|
208
|
-
let r = terminalLabels.get(e.id).startRight, i = e.x,
|
|
209
|
-
if (
|
|
210
|
-
let r = utils_default.calcTerminalLabelPosition(e.arrowTypeStart ? 10 : 0, "start_right",
|
|
211
|
-
i = r.x,
|
|
208
|
+
let r = terminalLabels.get(e.id).startRight, i = e.x, o = e.y;
|
|
209
|
+
if (a) {
|
|
210
|
+
let r = utils_default.calcTerminalLabelPosition(e.arrowTypeStart ? 10 : 0, "start_right", a);
|
|
211
|
+
i = r.x, o = r.y;
|
|
212
212
|
}
|
|
213
|
-
r.attr("transform", `translate(${i}, ${
|
|
213
|
+
r.attr("transform", `translate(${i}, ${o})`);
|
|
214
214
|
}
|
|
215
215
|
if (e.endLabelLeft) {
|
|
216
|
-
let r = terminalLabels.get(e.id).endLeft, i = e.x,
|
|
217
|
-
if (
|
|
218
|
-
let r = utils_default.calcTerminalLabelPosition(e.arrowTypeEnd ? 10 : 0, "end_left",
|
|
219
|
-
i = r.x,
|
|
216
|
+
let r = terminalLabels.get(e.id).endLeft, i = e.x, o = e.y;
|
|
217
|
+
if (a) {
|
|
218
|
+
let r = utils_default.calcTerminalLabelPosition(e.arrowTypeEnd ? 10 : 0, "end_left", a);
|
|
219
|
+
i = r.x, o = r.y;
|
|
220
220
|
}
|
|
221
|
-
r.attr("transform", `translate(${i}, ${
|
|
221
|
+
r.attr("transform", `translate(${i}, ${o})`);
|
|
222
222
|
}
|
|
223
223
|
if (e.endLabelRight) {
|
|
224
|
-
let r = terminalLabels.get(e.id).endRight, i = e.x,
|
|
225
|
-
if (
|
|
226
|
-
let r = utils_default.calcTerminalLabelPosition(e.arrowTypeEnd ? 10 : 0, "end_right",
|
|
227
|
-
i = r.x,
|
|
224
|
+
let r = terminalLabels.get(e.id).endRight, i = e.x, o = e.y;
|
|
225
|
+
if (a) {
|
|
226
|
+
let r = utils_default.calcTerminalLabelPosition(e.arrowTypeEnd ? 10 : 0, "end_right", a);
|
|
227
|
+
i = r.x, o = r.y;
|
|
228
228
|
}
|
|
229
|
-
r.attr("transform", `translate(${i}, ${
|
|
229
|
+
r.attr("transform", `translate(${i}, ${o})`);
|
|
230
230
|
}
|
|
231
231
|
}, "positionEdgeLabel"), outsideNode = /* @__PURE__ */ __name((e, r) => {
|
|
232
232
|
let i = e.x, a = e.y, o = Math.abs(r.x - i), s = Math.abs(r.y - a), c = e.width / 2, l = e.height / 2;
|
|
233
233
|
return o >= c || s >= l;
|
|
234
|
-
}, "outsideNode"), intersection = /* @__PURE__ */ __name((e,
|
|
234
|
+
}, "outsideNode"), intersection = /* @__PURE__ */ __name((e, r, a) => {
|
|
235
235
|
log.debug(`intersection calc abc89:
|
|
236
|
-
outsidePoint: ${JSON.stringify(
|
|
236
|
+
outsidePoint: ${JSON.stringify(r)}
|
|
237
237
|
insidePoint : ${JSON.stringify(a)}
|
|
238
238
|
node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);
|
|
239
|
-
let o = e.x, s = e.y, c = Math.abs(o - a.x), l = e.width / 2, u = a.x <
|
|
240
|
-
if (Math.abs(s -
|
|
241
|
-
let e = a.y <
|
|
239
|
+
let o = e.x, s = e.y, c = Math.abs(o - a.x), l = e.width / 2, u = a.x < r.x ? l - c : l + c, d = e.height / 2, f = Math.abs(r.y - a.y), p = Math.abs(r.x - a.x);
|
|
240
|
+
if (Math.abs(s - r.y) * l > Math.abs(o - r.x) * d) {
|
|
241
|
+
let e = a.y < r.y ? r.y - d - s : s - d - r.y;
|
|
242
242
|
u = p * e / f;
|
|
243
243
|
let o = {
|
|
244
|
-
x: a.x <
|
|
245
|
-
y: a.y <
|
|
244
|
+
x: a.x < r.x ? a.x + u : a.x - p + u,
|
|
245
|
+
y: a.y < r.y ? a.y + f - e : a.y - f + e
|
|
246
246
|
};
|
|
247
|
-
return u === 0 && (o.x =
|
|
247
|
+
return u === 0 && (o.x = r.x, o.y = r.y), p === 0 && (o.x = r.x), f === 0 && (o.y = r.y), log.debug(`abc89 top/bottom calc, Q ${f}, q ${e}, R ${p}, r ${u}`, o), o;
|
|
248
248
|
} else {
|
|
249
|
-
u = a.x <
|
|
250
|
-
let e = f * u / p, s = a.x <
|
|
249
|
+
u = a.x < r.x ? r.x - l - o : o - l - r.x;
|
|
250
|
+
let e = f * u / p, s = a.x < r.x ? a.x + p - u : a.x - p + u, c = a.y < r.y ? a.y + e : a.y - e;
|
|
251
251
|
return log.debug(`sides calc abc89, Q ${f}, q ${e}, R ${p}, r ${u}`, {
|
|
252
252
|
_x: s,
|
|
253
253
|
_y: c
|
|
254
|
-
}), u === 0 && (s =
|
|
254
|
+
}), u === 0 && (s = r.x, c = r.y), p === 0 && (s = r.x), f === 0 && (c = r.y), {
|
|
255
255
|
x: s,
|
|
256
256
|
y: c
|
|
257
257
|
};
|
|
258
258
|
}
|
|
259
|
-
}, "intersection"), cutPathAtIntersect = /* @__PURE__ */ __name((e,
|
|
260
|
-
log.warn("abc88 cutPathAtIntersect", e,
|
|
259
|
+
}, "intersection"), cutPathAtIntersect = /* @__PURE__ */ __name((e, r) => {
|
|
260
|
+
log.warn("abc88 cutPathAtIntersect", e, r);
|
|
261
261
|
let a = [], o = e[0], s = !1;
|
|
262
262
|
return e.forEach((e) => {
|
|
263
|
-
if (log.info("abc88 checking point", e,
|
|
264
|
-
let c = intersection(
|
|
265
|
-
log.debug("abc88 inside", e, o, c), log.debug("abc88 intersection", c,
|
|
263
|
+
if (log.info("abc88 checking point", e, r), !outsideNode(r, e) && !s) {
|
|
264
|
+
let c = intersection(r, o, e);
|
|
265
|
+
log.debug("abc88 inside", e, o, c), log.debug("abc88 intersection", c, r);
|
|
266
266
|
let l = !1;
|
|
267
267
|
a.forEach((e) => {
|
|
268
268
|
l ||= e.x === c.x && e.y === c.y;
|
|
@@ -289,36 +289,36 @@ var findAdjacentPoint = /* @__PURE__ */ __name(function(e, r, i) {
|
|
|
289
289
|
y: r.y - s * o
|
|
290
290
|
};
|
|
291
291
|
}, "findAdjacentPoint"), fixCorners = /* @__PURE__ */ __name(function(e) {
|
|
292
|
-
let { cornerPointPositions:
|
|
293
|
-
for (let o = 0; o < e.length; o++) if (
|
|
294
|
-
let
|
|
292
|
+
let { cornerPointPositions: r } = extractCornerPoints(e), a = [];
|
|
293
|
+
for (let o = 0; o < e.length; o++) if (r.includes(o)) {
|
|
294
|
+
let r = e[o - 1], s = e[o + 1], c = e[o], l = findAdjacentPoint(r, c, 5), u = findAdjacentPoint(s, c, 5), d = u.x - l.x, f = u.y - l.y;
|
|
295
295
|
a.push(l);
|
|
296
296
|
let p = Math.sqrt(2) * 2, m = {
|
|
297
297
|
x: c.x,
|
|
298
298
|
y: c.y
|
|
299
299
|
};
|
|
300
|
-
Math.abs(s.x -
|
|
300
|
+
Math.abs(s.x - r.x) > 10 && Math.abs(s.y - r.y) >= 10 ? (log.debug("Corner point fixing", Math.abs(s.x - r.x), Math.abs(s.y - r.y)), m = c.x === l.x ? {
|
|
301
301
|
x: d < 0 ? l.x - 5 + p : l.x + 5 - p,
|
|
302
302
|
y: f < 0 ? l.y - p : l.y + p
|
|
303
303
|
} : {
|
|
304
304
|
x: d < 0 ? l.x - p : l.x + p,
|
|
305
305
|
y: f < 0 ? l.y - 5 + p : l.y + 5 - p
|
|
306
|
-
}) : log.debug("Corner point skipping fixing", Math.abs(s.x -
|
|
306
|
+
}) : log.debug("Corner point skipping fixing", Math.abs(s.x - r.x), Math.abs(s.y - r.y)), a.push(m, u);
|
|
307
307
|
} else a.push(e[o]);
|
|
308
308
|
return a;
|
|
309
309
|
}, "fixCorners"), generateDashArray = /* @__PURE__ */ __name((e, r, i) => {
|
|
310
310
|
let a = e - r - i, o = Math.floor(a / 4);
|
|
311
311
|
return `0 ${r} ${Array(o).fill("2 2").join(" ")} ${i}`;
|
|
312
|
-
}, "generateDashArray"), insertEdge = /* @__PURE__ */ __name(function(
|
|
313
|
-
if (!D) throw Error(`insertEdge: missing diagramId for edge "${
|
|
314
|
-
let { handDrawnSeed: k } = getConfig2(), A =
|
|
312
|
+
}, "generateDashArray"), insertEdge = /* @__PURE__ */ __name(function(r, a, s, x, C, E, D, O = !1) {
|
|
313
|
+
if (!D) throw Error(`insertEdge: missing diagramId for edge "${a.id}" \u2014 edge IDs require a diagram prefix for uniqueness`);
|
|
314
|
+
let { handDrawnSeed: k } = getConfig2(), A = a.points, j = !1, M = C;
|
|
315
315
|
var N = E;
|
|
316
316
|
let P = [];
|
|
317
|
-
for (let e in
|
|
318
|
-
log.debug("UIO intersect check",
|
|
317
|
+
for (let e in a.cssCompiledStyles) isLabelStyle(e) || P.push(a.cssCompiledStyles[e]);
|
|
318
|
+
log.debug("UIO intersect check", a.points, N.x, M.x), N.intersect && M.intersect && !O && (A = A.slice(1, a.points.length - 1), A.unshift(M.intersect(A[0])), log.debug("Last point UIO", a.start, "-->", a.end, A[A.length - 1], N, N.intersect(A[A.length - 1])), A.push(N.intersect(A[A.length - 1])));
|
|
319
319
|
let F = btoa(JSON.stringify(A));
|
|
320
|
-
|
|
321
|
-
let I = A.filter((e) => !Number.isNaN(e.y)), L = resolveEdgeCurveType(
|
|
320
|
+
a.toCluster && (log.info("to cluster abc88", s.get(a.toCluster)), A = cutPathAtIntersect(a.points, s.get(a.toCluster).node), j = !0), a.fromCluster && (log.debug("from cluster abc88", s.get(a.fromCluster), JSON.stringify(A, null, 2)), A = cutPathAtIntersect(A.reverse(), s.get(a.fromCluster).node).reverse(), j = !0);
|
|
321
|
+
let I = A.filter((e) => !Number.isNaN(e.y)), L = resolveEdgeCurveType(a.curve);
|
|
322
322
|
L !== "rounded" && (I = fixCorners(I));
|
|
323
323
|
let R = linear_default;
|
|
324
324
|
switch (L) {
|
|
@@ -363,8 +363,8 @@ var findAdjacentPoint = /* @__PURE__ */ __name(function(e, r, i) {
|
|
|
363
363
|
break;
|
|
364
364
|
default: R = basis_default;
|
|
365
365
|
}
|
|
366
|
-
let { x: z, y: B } = getLineFunctionsWithOffset(
|
|
367
|
-
switch (
|
|
366
|
+
let { x: z, y: B } = getLineFunctionsWithOffset(a), V = line_default().x(z).y(B).curve(R), H;
|
|
367
|
+
switch (a.thickness) {
|
|
368
368
|
case "normal":
|
|
369
369
|
H = "edge-thickness-normal";
|
|
370
370
|
break;
|
|
@@ -376,7 +376,7 @@ var findAdjacentPoint = /* @__PURE__ */ __name(function(e, r, i) {
|
|
|
376
376
|
break;
|
|
377
377
|
default: H = "edge-thickness-normal";
|
|
378
378
|
}
|
|
379
|
-
switch (
|
|
379
|
+
switch (a.pattern) {
|
|
380
380
|
case "solid":
|
|
381
381
|
H += " edge-pattern-solid";
|
|
382
382
|
break;
|
|
@@ -388,39 +388,39 @@ var findAdjacentPoint = /* @__PURE__ */ __name(function(e, r, i) {
|
|
|
388
388
|
break;
|
|
389
389
|
default: H += " edge-pattern-solid";
|
|
390
390
|
}
|
|
391
|
-
let U, W = L === "rounded" ? generateRoundedPath(applyMarkerOffsetsToPoints(I,
|
|
392
|
-
|
|
391
|
+
let U, W = L === "rounded" ? generateRoundedPath(applyMarkerOffsetsToPoints(I, a), 5) : V(I), G = Array.isArray(a.style) ? a.style : [a.style], K = G.find((e) => e?.startsWith("stroke:")), q = "";
|
|
392
|
+
a.animate && (q = "edge-animation-fast"), a.animation && (q = "edge-animation-" + a.animation);
|
|
393
393
|
let J = !1;
|
|
394
|
-
if (
|
|
395
|
-
let
|
|
394
|
+
if (a.look === "handDrawn") {
|
|
395
|
+
let i = at.svg(r);
|
|
396
396
|
Object.assign([], I);
|
|
397
|
-
let
|
|
397
|
+
let o = i.path(W, {
|
|
398
398
|
roughness: .3,
|
|
399
399
|
seed: k
|
|
400
400
|
});
|
|
401
|
-
H += " transition", U = select_default(
|
|
402
|
-
let
|
|
403
|
-
U.attr("d",
|
|
401
|
+
H += " transition", U = select_default(o).select("path").attr("id", `${D}-${a.id}`).attr("class", " " + H + (a.classes ? " " + a.classes : "") + (q ? " " + q : "")).attr("style", G ? G.reduce((e, r) => e + ";" + r, "") : "");
|
|
402
|
+
let s = U.attr("d");
|
|
403
|
+
U.attr("d", s), r.node().appendChild(U.node());
|
|
404
404
|
} else {
|
|
405
|
-
let
|
|
406
|
-
U =
|
|
407
|
-
let s = U.node(), c = typeof s.getTotalLength == "function" ? s.getTotalLength() : 0, l = markerOffsets2[
|
|
408
|
-
if (
|
|
409
|
-
let e = `stroke-dasharray: ${
|
|
405
|
+
let e = P.join(";"), i = G ? G.reduce((e, r) => e + r + ";", "") : "", o = (e ? e + ";" + i + ";" : i) + ";" + (G ? G.reduce((e, r) => e + ";" + r, "") : "");
|
|
406
|
+
U = r.append("path").attr("d", W).attr("id", `${D}-${a.id}`).attr("class", " " + H + (a.classes ? " " + a.classes : "") + (q ? " " + q : "")).attr("style", o), K = o.match(/stroke:([^;]+)/)?.[1], J = a.animate === !0 || !!a.animation || e.includes("animation");
|
|
407
|
+
let s = U.node(), c = typeof s.getTotalLength == "function" ? s.getTotalLength() : 0, l = markerOffsets2[a.arrowTypeStart] || 0, u = markerOffsets2[a.arrowTypeEnd] || 0;
|
|
408
|
+
if (a.look === "neo" && !J) {
|
|
409
|
+
let e = `stroke-dasharray: ${a.pattern === "dotted" || a.pattern === "dashed" ? generateDashArray(c, l, u) : `0 ${l} ${c - l - u} ${u}`}; stroke-dashoffset: 0;`;
|
|
410
410
|
U.attr("style", e + U.attr("style"));
|
|
411
411
|
}
|
|
412
412
|
}
|
|
413
|
-
U.attr("data-edge", !0), U.attr("data-et", "edge"), U.attr("data-id",
|
|
414
|
-
|
|
413
|
+
U.attr("data-edge", !0), U.attr("data-et", "edge"), U.attr("data-id", a.id), U.attr("data-points", F), U.attr("data-look", handleUndefinedAttr(a.look)), a.showPoints && I.forEach((e) => {
|
|
414
|
+
r.append("circle").style("stroke", "red").style("fill", "red").attr("r", 1).attr("cx", e.x).attr("cy", e.y);
|
|
415
415
|
});
|
|
416
416
|
let Y = "";
|
|
417
|
-
(getConfig2().flowchart.arrowMarkerAbsolute || getConfig2().state.arrowMarkerAbsolute) && (Y = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search, Y = Y.replace(/\(/g, "\\(").replace(/\)/g, "\\)")), log.info("arrowTypeStart",
|
|
418
|
-
let X = !J &&
|
|
419
|
-
addEdgeMarkers(U,
|
|
417
|
+
(getConfig2().flowchart.arrowMarkerAbsolute || getConfig2().state.arrowMarkerAbsolute) && (Y = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search, Y = Y.replace(/\(/g, "\\(").replace(/\)/g, "\\)")), log.info("arrowTypeStart", a.arrowTypeStart), log.info("arrowTypeEnd", a.arrowTypeEnd);
|
|
418
|
+
let X = !J && a?.look === "neo";
|
|
419
|
+
addEdgeMarkers(U, a, Y, D, x, X, K);
|
|
420
420
|
let Z = Math.floor(A.length / 2), Q = A[Z];
|
|
421
421
|
utils_default.isLabelCoordinateInPath(Q, U.attr("d")) || (j = !0);
|
|
422
422
|
let $ = {};
|
|
423
|
-
return j && ($.updatedPath = A), $.originalPath =
|
|
423
|
+
return j && ($.updatedPath = A), $.originalPath = a.points, $;
|
|
424
424
|
}, "insertEdge");
|
|
425
425
|
function generateRoundedPath(e, r) {
|
|
426
426
|
if (e.length < 2) return "";
|
|
@@ -480,8 +480,8 @@ var insertMarkers = /* @__PURE__ */ __name((e, r, i, a) => {
|
|
|
480
480
|
markers[r](e, i, a);
|
|
481
481
|
});
|
|
482
482
|
}, "insertMarkers"), markers = {
|
|
483
|
-
extension: /* @__PURE__ */ __name((e,
|
|
484
|
-
log.trace("Making markers for ", a), e.append("defs").append("marker").attr("id", a + "_" +
|
|
483
|
+
extension: /* @__PURE__ */ __name((e, r, a) => {
|
|
484
|
+
log.trace("Making markers for ", a), e.append("defs").append("marker").attr("id", a + "_" + r + "-extensionStart").attr("class", "marker extension " + r).attr("refX", 18).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").append("path").attr("d", "M 1,7 L18,13 V 1 Z"), e.append("defs").append("marker").attr("id", a + "_" + r + "-extensionEnd").attr("class", "marker extension " + r).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 1,1 V 13 L18,7 Z"), e.append("marker").attr("id", a + "_" + r + "-extensionStart-margin").attr("class", "marker extension " + r).attr("refX", 18).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").attr("viewBox", "0 0 20 14").append("polygon").attr("points", "10,7 18,13 18,1").style("stroke-width", 2).style("stroke-dasharray", "0"), e.append("defs").append("marker").attr("id", a + "_" + r + "-extensionEnd-margin").attr("class", "marker extension " + r).attr("refX", 9).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").attr("viewBox", "0 0 20 14").append("polygon").attr("points", "10,1 10,13 18,7").style("stroke-width", 2).style("stroke-dasharray", "0");
|
|
485
485
|
}, "extension"),
|
|
486
486
|
composition: /* @__PURE__ */ __name((e, r, i) => {
|
|
487
487
|
e.append("defs").append("marker").attr("id", i + "_" + r + "-compositionStart").attr("class", "marker composition " + r).attr("refX", 18).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"), e.append("defs").append("marker").attr("id", i + "_" + r + "-compositionEnd").attr("class", "marker composition " + r).attr("refX", 1).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"), e.append("defs").append("marker").attr("id", i + "_" + r + "-compositionStart-margin").attr("class", "marker composition " + r).attr("refX", 15).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").append("path").style("stroke-width", 0).attr("viewBox", "0 0 15 15").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), e.append("defs").append("marker").attr("id", i + "_" + r + "-compositionEnd-margin").attr("class", "marker composition " + r).attr("refX", 3.5).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").append("path").style("stroke-width", 0).attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
|
|
@@ -507,9 +507,9 @@ var insertMarkers = /* @__PURE__ */ __name((e, r, i, a) => {
|
|
|
507
507
|
barb: /* @__PURE__ */ __name((e, r, i) => {
|
|
508
508
|
e.append("defs").append("marker").attr("id", i + "_" + r + "-barbEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 14).attr("markerUnits", "userSpaceOnUse").attr("orient", "auto").append("path").attr("d", "M 19,7 L9,13 L14,7 L9,1 Z");
|
|
509
509
|
}, "barb"),
|
|
510
|
-
barbNeo: /* @__PURE__ */ __name((e, r,
|
|
510
|
+
barbNeo: /* @__PURE__ */ __name((e, r, i) => {
|
|
511
511
|
let { themeVariables: o } = getConfig(), { transitionColor: s } = o;
|
|
512
|
-
e.append("defs").append("marker").attr("id",
|
|
512
|
+
e.append("defs").append("marker").attr("id", i + "_" + r + "-barbEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 14).attr("markerUnits", "strokeWidth").attr("orient", "auto").append("path").attr("d", "M 19,7 L11,14 L13,7 L11,0 Z"), e.append("defs").append("marker").attr("id", i + "_" + r + "-barbEnd-margin").attr("refX", 17).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 14).attr("markerUnits", "userSpaceOnUse").attr("orient", "auto").append("path").attr("d", "M 19,7 L11,14 L13,7 L11,0 Z").attr("fill", `${s}`);
|
|
513
513
|
}, "barbNeo"),
|
|
514
514
|
only_one: /* @__PURE__ */ __name((e, r, i) => {
|
|
515
515
|
e.append("defs").append("marker").attr("id", i + "_" + r + "-onlyOneStart").attr("class", "marker onlyOne " + r).attr("refX", 0).attr("refY", 9).attr("markerWidth", 18).attr("markerHeight", 18).attr("orient", "auto").append("path").attr("d", "M9,0 L9,18 M15,0 L15,18"), e.append("defs").append("marker").attr("id", i + "_" + r + "-onlyOneEnd").attr("class", "marker onlyOne " + r).attr("refX", 18).attr("refY", 9).attr("markerWidth", 18).attr("markerHeight", 18).attr("orient", "auto").append("path").attr("d", "M3,0 L3,18 M9,0 L9,18");
|
|
@@ -529,24 +529,24 @@ var insertMarkers = /* @__PURE__ */ __name((e, r, i, a) => {
|
|
|
529
529
|
let o = e.append("defs").append("marker").attr("id", i + "_" + r + "-zeroOrMoreEnd").attr("class", "marker zeroOrMore " + r).attr("refX", 39).attr("refY", 18).attr("markerWidth", 57).attr("markerHeight", 36).attr("orient", "auto");
|
|
530
530
|
o.append("circle").attr("fill", "white").attr("cx", 9).attr("cy", 18).attr("r", 6), o.append("path").attr("d", "M21,18 Q39,0 57,18 Q39,36 21,18");
|
|
531
531
|
}, "zero_or_more"),
|
|
532
|
-
only_one_neo: /* @__PURE__ */ __name((e, r,
|
|
532
|
+
only_one_neo: /* @__PURE__ */ __name((e, r, i) => {
|
|
533
533
|
let { themeVariables: o } = getConfig(), { strokeWidth: s } = o;
|
|
534
|
-
e.append("defs").append("marker").attr("id",
|
|
534
|
+
e.append("defs").append("marker").attr("id", i + "_" + r + "-onlyOneStart").attr("class", "marker onlyOne " + r).attr("refX", 0).attr("refY", 9).attr("markerWidth", 18).attr("markerHeight", 18).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").append("path").attr("d", "M9,0 L9,18 M15,0 L15,18").attr("stroke-width", `${s}`), e.append("defs").append("marker").attr("id", i + "_" + r + "-onlyOneEnd").attr("class", "marker onlyOne " + r).attr("refX", 18).attr("refY", 9).attr("markerWidth", 18).attr("markerHeight", 18).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").append("path").attr("d", "M3,0 L3,18 M9,0 L9,18").attr("stroke-width", `${s}`);
|
|
535
535
|
}, "only_one_neo"),
|
|
536
|
-
zero_or_one_neo: /* @__PURE__ */ __name((e, r,
|
|
537
|
-
let { themeVariables: o } = getConfig(), { strokeWidth: s, mainBkg: c } = o, l = e.append("defs").append("marker").attr("id",
|
|
536
|
+
zero_or_one_neo: /* @__PURE__ */ __name((e, r, i) => {
|
|
537
|
+
let { themeVariables: o } = getConfig(), { strokeWidth: s, mainBkg: c } = o, l = e.append("defs").append("marker").attr("id", i + "_" + r + "-zeroOrOneStart").attr("class", "marker zeroOrOne " + r).attr("refX", 0).attr("refY", 9).attr("markerWidth", 30).attr("markerHeight", 18).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse");
|
|
538
538
|
l.append("circle").attr("fill", c ?? "white").attr("cx", 21).attr("cy", 9).attr("stroke-width", `${s}`).attr("r", 6), l.append("path").attr("d", "M9,0 L9,18").attr("stroke-width", `${s}`);
|
|
539
|
-
let u = e.append("defs").append("marker").attr("id",
|
|
539
|
+
let u = e.append("defs").append("marker").attr("id", i + "_" + r + "-zeroOrOneEnd").attr("class", "marker zeroOrOne " + r).attr("refX", 30).attr("refY", 9).attr("markerWidth", 30).attr("markerHeight", 18).attr("markerUnits", "userSpaceOnUse").attr("orient", "auto");
|
|
540
540
|
u.append("circle").attr("fill", c ?? "white").attr("cx", 9).attr("cy", 9).attr("stroke-width", `${s}`).attr("r", 6), u.append("path").attr("d", "M21,0 L21,18").attr("stroke-width", `${s}`);
|
|
541
541
|
}, "zero_or_one_neo"),
|
|
542
|
-
one_or_more_neo: /* @__PURE__ */ __name((e, r,
|
|
542
|
+
one_or_more_neo: /* @__PURE__ */ __name((e, r, i) => {
|
|
543
543
|
let { themeVariables: o } = getConfig(), { strokeWidth: s } = o;
|
|
544
|
-
e.append("defs").append("marker").attr("id",
|
|
544
|
+
e.append("defs").append("marker").attr("id", i + "_" + r + "-oneOrMoreStart").attr("class", "marker oneOrMore " + r).attr("refX", 18).attr("refY", 18).attr("markerWidth", 45).attr("markerHeight", 36).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").append("path").attr("d", "M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27").attr("stroke-width", `${s}`), e.append("defs").append("marker").attr("id", i + "_" + r + "-oneOrMoreEnd").attr("class", "marker oneOrMore " + r).attr("refX", 27).attr("refY", 18).attr("markerWidth", 45).attr("markerHeight", 36).attr("markerUnits", "userSpaceOnUse").attr("orient", "auto").append("path").attr("d", "M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18").attr("stroke-width", `${s}`);
|
|
545
545
|
}, "one_or_more_neo"),
|
|
546
|
-
zero_or_more_neo: /* @__PURE__ */ __name((e, r,
|
|
547
|
-
let { themeVariables: o } = getConfig(), { strokeWidth: s, mainBkg: c } = o, l = e.append("defs").append("marker").attr("id",
|
|
546
|
+
zero_or_more_neo: /* @__PURE__ */ __name((e, r, i) => {
|
|
547
|
+
let { themeVariables: o } = getConfig(), { strokeWidth: s, mainBkg: c } = o, l = e.append("defs").append("marker").attr("id", i + "_" + r + "-zeroOrMoreStart").attr("class", "marker zeroOrMore " + r).attr("refX", 18).attr("refY", 18).attr("markerWidth", 57).attr("markerHeight", 36).attr("markerUnits", "userSpaceOnUse").attr("orient", "auto");
|
|
548
548
|
l.append("circle").attr("fill", c ?? "white").attr("cx", 45.5).attr("cy", 18).attr("r", 6).attr("stroke-width", `${s}`), l.append("path").attr("d", "M0,18 Q18,0 36,18 Q18,36 0,18").attr("stroke-width", `${s}`);
|
|
549
|
-
let u = e.append("defs").append("marker").attr("id",
|
|
549
|
+
let u = e.append("defs").append("marker").attr("id", i + "_" + r + "-zeroOrMoreEnd").attr("class", "marker zeroOrMore " + r).attr("refX", 39).attr("refY", 18).attr("markerWidth", 57).attr("markerHeight", 36).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse");
|
|
550
550
|
u.append("circle").attr("fill", c ?? "white").attr("cx", 11).attr("cy", 18).attr("r", 6).attr("stroke-width", `${s}`), u.append("path").attr("d", "M21,18 Q39,0 57,18 Q39,36 21,18").attr("stroke-width", `${s}`);
|
|
551
551
|
}, "zero_or_more_neo"),
|
|
552
552
|
requirement_arrow: /* @__PURE__ */ __name((e, r, i) => {
|
|
@@ -556,12 +556,12 @@ var insertMarkers = /* @__PURE__ */ __name((e, r, i, a) => {
|
|
|
556
556
|
let a = e.append("defs").append("marker").attr("id", i + "_" + r + "-requirement_containsStart").attr("refX", 0).attr("refY", 10).attr("markerWidth", 20).attr("markerHeight", 20).attr("orient", "auto").append("g");
|
|
557
557
|
a.append("circle").attr("cx", 10).attr("cy", 10).attr("r", 9).attr("fill", "none"), a.append("line").attr("x1", 1).attr("x2", 19).attr("y1", 10).attr("y2", 10), a.append("line").attr("y1", 1).attr("y2", 19).attr("x1", 10).attr("x2", 10);
|
|
558
558
|
}, "requirement_contains"),
|
|
559
|
-
requirement_arrow_neo: /* @__PURE__ */ __name((e, r,
|
|
559
|
+
requirement_arrow_neo: /* @__PURE__ */ __name((e, r, i) => {
|
|
560
560
|
let { themeVariables: o } = getConfig(), { strokeWidth: s } = o;
|
|
561
|
-
e.append("defs").append("marker").attr("id",
|
|
561
|
+
e.append("defs").append("marker").attr("id", i + "_" + r + "-requirement_arrowEnd").attr("refX", 20).attr("refY", 10).attr("markerWidth", 20).attr("markerHeight", 20).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").attr("stroke-width", `${s}`).attr("viewBox", "0 0 25 20").append("path").attr("d", "M0,0\n L20,10\n M20,10\n L0,20").attr("stroke-linejoin", "miter");
|
|
562
562
|
}, "requirement_arrow_neo"),
|
|
563
|
-
requirement_contains_neo: /* @__PURE__ */ __name((e, r,
|
|
564
|
-
let { themeVariables: o } = getConfig(), { strokeWidth: s } = o, c = e.append("defs").append("marker").attr("id",
|
|
563
|
+
requirement_contains_neo: /* @__PURE__ */ __name((e, r, i) => {
|
|
564
|
+
let { themeVariables: o } = getConfig(), { strokeWidth: s } = o, c = e.append("defs").append("marker").attr("id", i + "_" + r + "-requirement_containsStart").attr("refX", 0).attr("refY", 10).attr("markerWidth", 20).attr("markerHeight", 20).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").append("g");
|
|
565
565
|
c.append("circle").attr("cx", 10).attr("cy", 10).attr("r", 9).attr("fill", "none"), c.append("line").attr("x1", 1).attr("x2", 19).attr("y1", 10).attr("y2", 10), c.append("line").attr("y1", 1).attr("y2", 19).attr("x1", 10).attr("x2", 10), c.selectAll("*").attr("stroke-width", `${s}`);
|
|
566
566
|
}, "requirement_contains_neo")
|
|
567
567
|
}, markers_default = insertMarkers;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import select_default from "../../../../d3-selection/src/select.js";
|
|
1
2
|
import { __name } from "./chunk-AGHRB4JF.js";
|
|
2
3
|
import { lineBreakRegex } from "./chunk-CSCIHK7Q.js";
|
|
3
|
-
import select_default from "../../../../d3-selection/src/select.js";
|
|
4
4
|
import "../../../../d3/src/index.js";
|
|
5
5
|
import { require_dist } from "../../../../@braintree/sanitize-url/dist/index.js";
|
|
6
6
|
var import_dist = require_dist(), drawRect = /* @__PURE__ */ __name((e, s) => {
|
|
@@ -17,11 +17,11 @@ var import_dist = require_dist(), drawRect = /* @__PURE__ */ __name((e, s) => {
|
|
|
17
17
|
stroke: s.stroke,
|
|
18
18
|
class: "rect"
|
|
19
19
|
}).lower();
|
|
20
|
-
}, "drawBackgroundRect"), drawText = /* @__PURE__ */ __name((e,
|
|
21
|
-
let l =
|
|
22
|
-
u.attr("x",
|
|
20
|
+
}, "drawBackgroundRect"), drawText = /* @__PURE__ */ __name((e, s) => {
|
|
21
|
+
let l = s.text.replace(lineBreakRegex, " "), u = e.append("text");
|
|
22
|
+
u.attr("x", s.x), u.attr("y", s.y), u.attr("class", "legend"), u.style("text-anchor", s.anchor), s.class && u.attr("class", s.class);
|
|
23
23
|
let d = u.append("tspan");
|
|
24
|
-
return d.attr("x",
|
|
24
|
+
return d.attr("x", s.x + s.textMargin * 2), d.text(l), u;
|
|
25
25
|
}, "drawText"), drawImage = /* @__PURE__ */ __name((e, s, c, l) => {
|
|
26
26
|
let d = e.append("image");
|
|
27
27
|
d.attr("x", s), d.attr("y", c);
|
|
@@ -54,7 +54,7 @@ var import_dist = require_dist(), drawRect = /* @__PURE__ */ __name((e, s) => {
|
|
|
54
54
|
ry: 0,
|
|
55
55
|
tspan: !0
|
|
56
56
|
}), "getTextObj"), createTooltip = /* @__PURE__ */ __name(() => {
|
|
57
|
-
let
|
|
58
|
-
return
|
|
57
|
+
let s = select_default(".mermaidTooltip");
|
|
58
|
+
return s.empty() && (s = select_default("body").append("div").attr("class", "mermaidTooltip").style("opacity", 0).style("position", "absolute").style("text-align", "center").style("max-width", "200px").style("padding", "2px").style("font-size", "12px").style("background", "#ffffde").style("border", "1px solid #333").style("border-radius", "2px").style("pointer-events", "none").style("z-index", "100")), s;
|
|
59
59
|
}, "createTooltip");
|
|
60
60
|
export { createTooltip, drawBackgroundRect, drawEmbeddedImage, drawImage, drawRect, drawText, getNoteRect, getTextObj };
|