@loopstack/loopstack-studio 0.29.5 → 0.31.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/FormBody.js +1 -1
- package/dist/components/layout/StudioSidebar.js +116 -131
- package/dist/components/lists/ListView.js +46 -46
- 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/dashboard/AppLauncher.js +84 -0
- 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 +73 -73
- 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 +74 -109
- 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 +166 -136
- 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 +119 -18
- package/dist/index.js +10 -9
- 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/DashboardPage.js +20 -74
- 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/dist/routing/LocalRouter.js +1 -1
- package/package.json +2 -2
- package/dist/features/dashboard/Dashboard.js +0 -125
- package/dist/features/dashboard/RunItem.js +0 -78
- package/dist/features/dashboard/RunList.js +0 -32
- package/dist/hooks/useDashboard.js +0 -16
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import select_default from "../../d3-selection/src/select.js";
|
|
1
2
|
import { __name, log, setLogLevel } from "./chunks/mermaid.core/chunk-AGHRB4JF.js";
|
|
2
3
|
import { purify } from "../../dompurify/dist/purify.es.js";
|
|
3
4
|
import { UnknownDiagramError, addDirective, assignWithDepth_default, configureSvgSize, cssStyleSheetToString, defaultConfig, detectType, detectors, evaluate, frontMatterRegex, getConfig, getDiagram, getDiagramLoader, getEffectiveHtmlLabels, getSiteConfig, registerDiagram, registerLazyLoadedDiagrams, reset, sanitizeCss, saveConfigFromInitialize, setConfig, setSiteConfig, styles_default, themes_default, updateSiteConfig } from "./chunks/mermaid.core/chunk-CSCIHK7Q.js";
|
|
4
|
-
import select_default from "../../d3-selection/src/select.js";
|
|
5
5
|
import "../../d3/src/index.js";
|
|
6
6
|
import { selectSvgElement } from "./chunks/mermaid.core/chunk-WU5MYG2G.js";
|
|
7
7
|
import { JSON_SCHEMA, load } from "./chunks/mermaid.core/chunk-XPW4576I.js";
|
|
@@ -31,7 +31,7 @@ var id = "c4", c4Detector_default = {
|
|
|
31
31
|
}, "loader")
|
|
32
32
|
}, id2 = "flowchart", flowDetector_default = {
|
|
33
33
|
id: id2,
|
|
34
|
-
detector: /* @__PURE__ */ __name((e,
|
|
34
|
+
detector: /* @__PURE__ */ __name((e, C) => C?.flowchart?.defaultRenderer === "dagre-wrapper" || C?.flowchart?.defaultRenderer === "elk" ? !1 : /^\s*graph/.test(e), "detector"),
|
|
35
35
|
loader: /* @__PURE__ */ __name(async () => {
|
|
36
36
|
let { diagram: e } = await import("./chunks/mermaid.core/flowDiagram-I6XJVG4X.js");
|
|
37
37
|
return {
|
|
@@ -41,7 +41,7 @@ var id = "c4", c4Detector_default = {
|
|
|
41
41
|
}, "loader")
|
|
42
42
|
}, id3 = "flowchart-v2", flowDetector_v2_default = {
|
|
43
43
|
id: id3,
|
|
44
|
-
detector: /* @__PURE__ */ __name((e,
|
|
44
|
+
detector: /* @__PURE__ */ __name((e, C) => C?.flowchart?.defaultRenderer === "dagre-d3" ? !1 : (C?.flowchart?.defaultRenderer === "elk" && (C.layout = "elk"), /^\s*graph/.test(e) && C?.flowchart?.defaultRenderer === "dagre-wrapper" ? !0 : /^\s*flowchart/.test(e)), "detector"),
|
|
45
45
|
loader: /* @__PURE__ */ __name(async () => {
|
|
46
46
|
let { diagram: e } = await import("./chunks/mermaid.core/flowDiagram-I6XJVG4X.js");
|
|
47
47
|
return {
|
|
@@ -141,7 +141,7 @@ var id = "c4", c4Detector_default = {
|
|
|
141
141
|
}, "loader")
|
|
142
142
|
}, id13 = "class", classDetector_default = {
|
|
143
143
|
id: id13,
|
|
144
|
-
detector: /* @__PURE__ */ __name((e,
|
|
144
|
+
detector: /* @__PURE__ */ __name((e, C) => C?.class?.defaultRenderer === "dagre-wrapper" ? !1 : /^\s*classDiagram/.test(e), "detector"),
|
|
145
145
|
loader: /* @__PURE__ */ __name(async () => {
|
|
146
146
|
let { diagram: e } = await import("./chunks/mermaid.core/classDiagram-4FO5ZUOK.js");
|
|
147
147
|
return {
|
|
@@ -151,7 +151,7 @@ var id = "c4", c4Detector_default = {
|
|
|
151
151
|
}, "loader")
|
|
152
152
|
}, id14 = "classDiagram", classDetector_V2_default = {
|
|
153
153
|
id: id14,
|
|
154
|
-
detector: /* @__PURE__ */ __name((e,
|
|
154
|
+
detector: /* @__PURE__ */ __name((e, C) => /^\s*classDiagram/.test(e) && C?.class?.defaultRenderer === "dagre-wrapper" ? !0 : /^\s*classDiagram-v2/.test(e), "detector"),
|
|
155
155
|
loader: /* @__PURE__ */ __name(async () => {
|
|
156
156
|
let { diagram: e } = await import("./chunks/mermaid.core/classDiagram-v2-Q7XG4LA2.js");
|
|
157
157
|
return {
|
|
@@ -161,7 +161,7 @@ var id = "c4", c4Detector_default = {
|
|
|
161
161
|
}, "loader")
|
|
162
162
|
}, id15 = "state", stateDetector_default = {
|
|
163
163
|
id: id15,
|
|
164
|
-
detector: /* @__PURE__ */ __name((e,
|
|
164
|
+
detector: /* @__PURE__ */ __name((e, C) => C?.state?.defaultRenderer === "dagre-wrapper" ? !1 : /^\s*stateDiagram/.test(e), "detector"),
|
|
165
165
|
loader: /* @__PURE__ */ __name(async () => {
|
|
166
166
|
let { diagram: e } = await import("./chunks/mermaid.core/stateDiagram-AJRCARHV.js");
|
|
167
167
|
return {
|
|
@@ -171,7 +171,7 @@ var id = "c4", c4Detector_default = {
|
|
|
171
171
|
}, "loader")
|
|
172
172
|
}, id16 = "stateDiagram", stateDetector_V2_default = {
|
|
173
173
|
id: id16,
|
|
174
|
-
detector: /* @__PURE__ */ __name((e,
|
|
174
|
+
detector: /* @__PURE__ */ __name((e, C) => !!(/^\s*stateDiagram-v2/.test(e) || /^\s*stateDiagram/.test(e) && C?.state?.defaultRenderer === "dagre-wrapper"), "detector"),
|
|
175
175
|
loader: /* @__PURE__ */ __name(async () => {
|
|
176
176
|
let { diagram: e } = await import("./chunks/mermaid.core/stateDiagram-v2-BHNVJYJU.js");
|
|
177
177
|
return {
|
|
@@ -189,17 +189,17 @@ var id = "c4", c4Detector_default = {
|
|
|
189
189
|
diagram: e
|
|
190
190
|
};
|
|
191
191
|
}, "loader")
|
|
192
|
-
}, renderer = { draw: /* @__PURE__ */ __name((e,
|
|
192
|
+
}, renderer = { draw: /* @__PURE__ */ __name((e, C, T) => {
|
|
193
193
|
log.debug("rendering svg for syntax error\n");
|
|
194
|
-
let
|
|
195
|
-
|
|
194
|
+
let E = selectSvgElement(C), D = E.append("g");
|
|
195
|
+
E.attr("viewBox", "0 0 2412 512"), configureSvgSize(E, 100, 512, !0), D.append("path").attr("class", "error-icon").attr("d", "m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"), D.append("path").attr("class", "error-icon").attr("d", "m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"), D.append("path").attr("class", "error-icon").attr("d", "m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"), D.append("path").attr("class", "error-icon").attr("d", "m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"), D.append("path").attr("class", "error-icon").attr("d", "m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"), D.append("path").attr("class", "error-icon").attr("d", "m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"), D.append("text").attr("class", "error-text").attr("x", 1440).attr("y", 250).attr("font-size", "150px").style("text-anchor", "middle").text("Syntax error in text"), D.append("text").attr("class", "error-text").attr("x", 1250).attr("y", 400).attr("font-size", "100px").style("text-anchor", "middle").text(`mermaid version ${T}`);
|
|
196
196
|
}, "draw") }, errorRenderer_default = renderer, errorDiagram_default = {
|
|
197
197
|
db: {},
|
|
198
198
|
renderer,
|
|
199
199
|
parser: { parse: /* @__PURE__ */ __name(() => {}, "parse") }
|
|
200
200
|
}, id18 = "flowchart-elk", detector_default = {
|
|
201
201
|
id: id18,
|
|
202
|
-
detector: /* @__PURE__ */ __name((e,
|
|
202
|
+
detector: /* @__PURE__ */ __name((e, C = {}) => /^\s*flowchart-elk/.test(e) || /^\s*(flowchart|graph)/.test(e) && C?.flowchart?.defaultRenderer === "elk" ? (C.layout = "elk", !0) : !1, "detector"),
|
|
203
203
|
loader: /* @__PURE__ */ __name(async () => {
|
|
204
204
|
let { diagram: e } = await import("./chunks/mermaid.core/flowDiagram-I6XJVG4X.js");
|
|
205
205
|
return {
|
|
@@ -359,62 +359,62 @@ var id = "c4", c4Detector_default = {
|
|
|
359
359
|
}, (e) => e.toLowerCase().trimStart().startsWith("---")), registerLazyLoadedDiagrams(detector_default, detector_default3, architectureDetector_default), registerLazyLoadedDiagrams(c4Detector_default, detector_default4, classDetector_V2_default, classDetector_default, erDetector_default, ganttDetector_default, info, pie, requirementDetector_default, sequenceDetector_default, flowDetector_v2_default, flowDetector_default, detector_default2, gitGraphDetector_default, stateDetector_V2_default, stateDetector_default, journeyDetector_default, quadrantDetector_default, sankeyDetector_default, packet, xychartDetector_default, blockDetector_default, detector_default6, detector_default5, radar, ishikawa, treemap, vennDetector_default, wardleyDetector_default));
|
|
360
360
|
}, "addDiagrams"), loadRegisteredDiagrams = /* @__PURE__ */ __name(async () => {
|
|
361
361
|
log.debug("Loading registered diagrams");
|
|
362
|
-
let e = (await Promise.allSettled(Object.entries(detectors).map(async ([e, { detector:
|
|
363
|
-
if (
|
|
362
|
+
let e = (await Promise.allSettled(Object.entries(detectors).map(async ([e, { detector: C, loader: T }]) => {
|
|
363
|
+
if (T) try {
|
|
364
364
|
getDiagram(e);
|
|
365
365
|
} catch {
|
|
366
366
|
try {
|
|
367
|
-
let { diagram: e, id: w } = await
|
|
368
|
-
registerDiagram(w, e,
|
|
369
|
-
} catch (
|
|
370
|
-
throw log.error(`Failed to load external diagram with key ${e}. Removing from detectors.`), delete detectors[e],
|
|
367
|
+
let { diagram: e, id: w } = await T();
|
|
368
|
+
registerDiagram(w, e, C);
|
|
369
|
+
} catch (C) {
|
|
370
|
+
throw log.error(`Failed to load external diagram with key ${e}. Removing from detectors.`), delete detectors[e], C;
|
|
371
371
|
}
|
|
372
372
|
}
|
|
373
373
|
}))).filter((e) => e.status === "rejected");
|
|
374
374
|
if (e.length > 0) {
|
|
375
375
|
log.error(`Failed to load ${e.length} external diagrams`);
|
|
376
|
-
for (let
|
|
376
|
+
for (let C of e) log.error(C);
|
|
377
377
|
throw Error(`Failed to load ${e.length} external diagrams`);
|
|
378
378
|
}
|
|
379
379
|
}, "loadRegisteredDiagrams"), SVG_ROLE = "graphics-document document";
|
|
380
|
-
function setA11yDiagramInfo(e,
|
|
381
|
-
e.attr("role", SVG_ROLE),
|
|
380
|
+
function setA11yDiagramInfo(e, C) {
|
|
381
|
+
e.attr("role", SVG_ROLE), C !== "" && e.attr("aria-roledescription", C);
|
|
382
382
|
}
|
|
383
383
|
__name(setA11yDiagramInfo, "setA11yDiagramInfo");
|
|
384
|
-
function addSVGa11yTitleDescription(e, w, T
|
|
384
|
+
function addSVGa11yTitleDescription(e, C, w, T) {
|
|
385
385
|
if (e.insert !== void 0) {
|
|
386
|
-
if (T) {
|
|
387
|
-
let w = `chart-desc-${E}`;
|
|
388
|
-
e.attr("aria-describedby", w), e.insert("desc", ":first-child").attr("id", w).text(T);
|
|
389
|
-
}
|
|
390
386
|
if (w) {
|
|
391
|
-
let
|
|
392
|
-
e.attr("aria-
|
|
387
|
+
let C = `chart-desc-${T}`;
|
|
388
|
+
e.attr("aria-describedby", C), e.insert("desc", ":first-child").attr("id", C).text(w);
|
|
389
|
+
}
|
|
390
|
+
if (C) {
|
|
391
|
+
let w = `chart-title-${T}`;
|
|
392
|
+
e.attr("aria-labelledby", w), e.insert("title", ":first-child").attr("id", w).text(C);
|
|
393
393
|
}
|
|
394
394
|
}
|
|
395
395
|
}
|
|
396
396
|
__name(addSVGa11yTitleDescription, "addSVGa11yTitleDescription");
|
|
397
|
-
var Diagram = class
|
|
398
|
-
constructor(e, w, T, E
|
|
399
|
-
this.type = e, this.text =
|
|
397
|
+
var Diagram = class e {
|
|
398
|
+
constructor(e, C, w, T, E) {
|
|
399
|
+
this.type = e, this.text = C, this.db = w, this.parser = T, this.renderer = E;
|
|
400
400
|
}
|
|
401
401
|
static #e = __name(this, "Diagram");
|
|
402
|
-
static async fromText(
|
|
403
|
-
let
|
|
404
|
-
|
|
402
|
+
static async fromText(C, w = {}) {
|
|
403
|
+
let T = getConfig(), E = detectType(C, T);
|
|
404
|
+
C = encodeEntities(C) + "\n";
|
|
405
405
|
try {
|
|
406
|
-
getDiagram(
|
|
406
|
+
getDiagram(E);
|
|
407
407
|
} catch {
|
|
408
|
-
let e = getDiagramLoader(
|
|
409
|
-
if (!e) throw new UnknownDiagramError(`Diagram ${
|
|
410
|
-
let { id:
|
|
411
|
-
registerDiagram(
|
|
408
|
+
let e = getDiagramLoader(E);
|
|
409
|
+
if (!e) throw new UnknownDiagramError(`Diagram ${E} not found.`);
|
|
410
|
+
let { id: C, diagram: w } = await e();
|
|
411
|
+
registerDiagram(C, w);
|
|
412
412
|
}
|
|
413
|
-
let { db:
|
|
414
|
-
return
|
|
413
|
+
let { db: O, parser: k, renderer: A, init: j } = getDiagram(E);
|
|
414
|
+
return k.parser && (k.parser.yy = O), O.clear?.(), j?.(T), w.title && O.setDiagramTitle?.(w.title), await k.parse(C), new e(E, C, O, k, A);
|
|
415
415
|
}
|
|
416
|
-
async render(e,
|
|
417
|
-
await this.renderer.draw(this.text, e,
|
|
416
|
+
async render(e, C) {
|
|
417
|
+
await this.renderer.draw(this.text, e, C, this);
|
|
418
418
|
}
|
|
419
419
|
getParser() {
|
|
420
420
|
return this.parser;
|
|
@@ -428,124 +428,124 @@ var Diagram = class w {
|
|
|
428
428
|
}), interactionFunctions = [];
|
|
429
429
|
}, "attachFunctions"), cleanupComments = /* @__PURE__ */ __name((e) => e.replace(/^\s*%%(?!{)[^\n]+\n?/gm, "").trimStart(), "cleanupComments");
|
|
430
430
|
function extractFrontMatter(e) {
|
|
431
|
-
let
|
|
432
|
-
if (!
|
|
431
|
+
let C = e.match(frontMatterRegex);
|
|
432
|
+
if (!C) return {
|
|
433
433
|
text: e,
|
|
434
434
|
metadata: {}
|
|
435
435
|
};
|
|
436
|
-
let
|
|
437
|
-
|
|
438
|
-
let
|
|
439
|
-
return
|
|
440
|
-
text: e.slice(
|
|
441
|
-
metadata:
|
|
436
|
+
let w = load(C[1], { schema: JSON_SCHEMA }) ?? {};
|
|
437
|
+
w = typeof w == "object" && !Array.isArray(w) ? w : {};
|
|
438
|
+
let T = {};
|
|
439
|
+
return w.displayMode && (T.displayMode = w.displayMode.toString()), w.title && (T.title = w.title.toString()), w.config && (T.config = w.config), {
|
|
440
|
+
text: e.slice(C[0].length),
|
|
441
|
+
metadata: T
|
|
442
442
|
};
|
|
443
443
|
}
|
|
444
444
|
__name(extractFrontMatter, "extractFrontMatter");
|
|
445
|
-
var cleanupText = /* @__PURE__ */ __name((e) => e.replace(/\r\n?/g, "\n").replace(/<(\w+)([^>]*)>/g, (e,
|
|
446
|
-
let { text:
|
|
447
|
-
return
|
|
448
|
-
title:
|
|
449
|
-
config:
|
|
450
|
-
text:
|
|
445
|
+
var cleanupText = /* @__PURE__ */ __name((e) => e.replace(/\r\n?/g, "\n").replace(/<(\w+)([^>]*)>/g, (e, C, w) => "<" + C + w.replace(/="([^"]*)"/g, "='$1'") + ">"), "cleanupText"), processFrontmatter = /* @__PURE__ */ __name((e) => {
|
|
446
|
+
let { text: C, metadata: w } = extractFrontMatter(e), { displayMode: T, title: E, config: D = {} } = w;
|
|
447
|
+
return T && (D.gantt ||= {}, D.gantt.displayMode = T), {
|
|
448
|
+
title: E,
|
|
449
|
+
config: D,
|
|
450
|
+
text: C
|
|
451
451
|
};
|
|
452
452
|
}, "processFrontmatter"), processDirectives = /* @__PURE__ */ __name((e) => {
|
|
453
|
-
let
|
|
454
|
-
return Array.isArray(
|
|
453
|
+
let C = utils_default.detectInit(e) ?? {}, w = utils_default.detectDirective(e, "wrap");
|
|
454
|
+
return Array.isArray(w) ? C.wrap = w.some(({ type: e }) => e === "wrap") : w?.type === "wrap" && (C.wrap = !0), {
|
|
455
455
|
text: removeDirectives(e),
|
|
456
|
-
directive:
|
|
456
|
+
directive: C
|
|
457
457
|
};
|
|
458
458
|
}, "processDirectives");
|
|
459
459
|
function preprocessDiagram(e) {
|
|
460
|
-
let
|
|
461
|
-
return e = cleanupComments(
|
|
460
|
+
let C = processFrontmatter(cleanupText(e)), w = processDirectives(C.text), T = cleanAndMerge(C.config, w.directive);
|
|
461
|
+
return e = cleanupComments(w.text), {
|
|
462
462
|
code: e,
|
|
463
|
-
title:
|
|
464
|
-
config:
|
|
463
|
+
title: C.title,
|
|
464
|
+
config: T
|
|
465
465
|
};
|
|
466
466
|
}
|
|
467
467
|
__name(preprocessDiagram, "preprocessDiagram");
|
|
468
468
|
function toBase64(e) {
|
|
469
|
-
let
|
|
470
|
-
return btoa(
|
|
469
|
+
let C = new TextEncoder().encode(e), w = Array.from(C, (e) => String.fromCodePoint(e)).join("");
|
|
470
|
+
return btoa(w);
|
|
471
471
|
}
|
|
472
472
|
__name(toBase64, "toBase64");
|
|
473
473
|
var MAX_TEXTLENGTH = 5e4, MAX_TEXTLENGTH_EXCEEDED_MSG = "graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa", SECURITY_LVL_SANDBOX = "sandbox", SECURITY_LVL_LOOSE = "loose", XMLNS_SVG_STD = "http://www.w3.org/2000/svg", XMLNS_XLINK_STD = "http://www.w3.org/1999/xlink", XMLNS_XHTML_STD = "http://www.w3.org/1999/xhtml", IFRAME_WIDTH = "100%", IFRAME_HEIGHT = "100%", IFRAME_STYLES = "border:0;margin:0;", IFRAME_BODY_STYLE = "margin:0", IFRAME_SANDBOX_OPTS = "allow-top-navigation-by-user-activation allow-popups", IFRAME_NOT_SUPPORTED_MSG = "The \"iframe\" tag is not supported by your browser.", DOMPURIFY_TAGS = ["foreignobject"], DOMPURIFY_ATTR = ["dominant-baseline"];
|
|
474
474
|
function processAndSetConfigs(e) {
|
|
475
|
-
let
|
|
476
|
-
return reset(), addDirective(
|
|
475
|
+
let C = preprocessDiagram(e);
|
|
476
|
+
return reset(), addDirective(C.config ?? {}), C;
|
|
477
477
|
}
|
|
478
478
|
__name(processAndSetConfigs, "processAndSetConfigs");
|
|
479
|
-
async function parse(e,
|
|
479
|
+
async function parse(e, C) {
|
|
480
480
|
addDiagrams();
|
|
481
481
|
try {
|
|
482
|
-
let { code:
|
|
482
|
+
let { code: C, config: w } = processAndSetConfigs(e);
|
|
483
483
|
return {
|
|
484
|
-
diagramType: (await getDiagramFromText(
|
|
485
|
-
config:
|
|
484
|
+
diagramType: (await getDiagramFromText(C)).type,
|
|
485
|
+
config: w
|
|
486
486
|
};
|
|
487
487
|
} catch (e) {
|
|
488
|
-
if (
|
|
488
|
+
if (C?.suppressErrors) return !1;
|
|
489
489
|
throw e;
|
|
490
490
|
}
|
|
491
491
|
}
|
|
492
492
|
__name(parse, "parse");
|
|
493
|
-
var cssImportantStyles = /* @__PURE__ */ __name((e,
|
|
494
|
-
let
|
|
495
|
-
if (e.fontFamily !== void 0 &&
|
|
496
|
-
let
|
|
493
|
+
var cssImportantStyles = /* @__PURE__ */ __name((e, C, w = []) => `.${e} ${C} ${sanitizeCss(`{ ${w.join(" !important; ")} !important; }`)}`, "cssImportantStyles"), createCssStyles = /* @__PURE__ */ __name((e, C = /* @__PURE__ */ new Map()) => {
|
|
494
|
+
let w = new CSSStyleSheet();
|
|
495
|
+
if (e.fontFamily !== void 0 && w.insertRule(`:root { --mermaid-font-family: ${e.fontFamily}}`, w.cssRules.length), e.altFontFamily !== void 0 && w.insertRule(`:root { --mermaid-alt-font-family: ${e.altFontFamily}}`, w.cssRules.length), C instanceof Map) {
|
|
496
|
+
let T = getEffectiveHtmlLabels(e) ? ["> *", "span"] : [
|
|
497
497
|
"rect",
|
|
498
498
|
"polygon",
|
|
499
499
|
"ellipse",
|
|
500
500
|
"circle",
|
|
501
501
|
"path"
|
|
502
502
|
];
|
|
503
|
-
|
|
504
|
-
isEmpty(e.styles) ||
|
|
505
|
-
|
|
506
|
-
}), isEmpty(e.textStyles) ||
|
|
503
|
+
C.forEach((e) => {
|
|
504
|
+
isEmpty(e.styles) || T.forEach((C) => {
|
|
505
|
+
w.insertRule(cssImportantStyles(e.id, C, e.styles), w.cssRules.length);
|
|
506
|
+
}), isEmpty(e.textStyles) || w.insertRule(cssImportantStyles(e.id, "tspan", (e?.textStyles || []).map((e) => e.replace("color", "fill"))), w.cssRules.length);
|
|
507
507
|
});
|
|
508
508
|
}
|
|
509
|
-
let
|
|
510
|
-
if (e.themeCSS !== void 0) if (typeof
|
|
511
|
-
let
|
|
512
|
-
|
|
513
|
-
} else
|
|
509
|
+
let T = "";
|
|
510
|
+
if (e.themeCSS !== void 0) if (typeof w.replaceSync == "function") {
|
|
511
|
+
let C = new CSSStyleSheet();
|
|
512
|
+
C.replaceSync(e.themeCSS), T = cssStyleSheetToString(C) + "\n";
|
|
513
|
+
} else T += `${e.themeCSS}
|
|
514
514
|
`;
|
|
515
|
-
return
|
|
516
|
-
}, "createCssStyles"), compileCSS = /* @__PURE__ */ __name((
|
|
517
|
-
if (
|
|
518
|
-
if (
|
|
519
|
-
|
|
520
|
-
} else
|
|
515
|
+
return T + cssStyleSheetToString(w);
|
|
516
|
+
}, "createCssStyles"), compileCSS = /* @__PURE__ */ __name((e, T) => serialize(compile(`${e}{${T}}`), middleware([/* @__PURE__ */ __name(function(C, T, E, D) {
|
|
517
|
+
if (C.type === "rule" && Array.isArray(C.props)) {
|
|
518
|
+
if (C.parent && C.parent.type === "@keyframes") return;
|
|
519
|
+
C.props = C.props.map((C) => C.startsWith(e) ? C : `${e} ${C}`);
|
|
520
|
+
} else C.type.startsWith("@") && ([...[
|
|
521
521
|
"@media",
|
|
522
522
|
"@supports",
|
|
523
523
|
"@layer",
|
|
524
524
|
"@scope",
|
|
525
525
|
"@container",
|
|
526
526
|
"@starting-style"
|
|
527
|
-
], "@keyframes"].includes(
|
|
528
|
-
}, "addNamespace"), stringify])), "compileCSS"), createUserStyles = /* @__PURE__ */ __name((e, w, T
|
|
527
|
+
], "@keyframes"].includes(C.type) || (log.warn(`Removing unsupported at-rule ${C.type} from CSS`), C.type = COMMENT));
|
|
528
|
+
}, "addNamespace"), stringify])), "compileCSS"), createUserStyles = /* @__PURE__ */ __name((e, C, w, T) => compileCSS(T, styles_default(C, createCssStyles(e, w), {
|
|
529
529
|
...e.themeVariables,
|
|
530
530
|
theme: e.theme,
|
|
531
531
|
look: e.look
|
|
532
|
-
},
|
|
533
|
-
let
|
|
534
|
-
return !
|
|
535
|
-
}, "cleanUpSvgCode"), putIntoIFrame = /* @__PURE__ */ __name((e = "",
|
|
532
|
+
}, T)), "createUserStyles"), cleanUpSvgCode = /* @__PURE__ */ __name((e = "", C, w) => {
|
|
533
|
+
let T = e;
|
|
534
|
+
return !w && !C && (T = T.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g, "marker-end=\"url(#")), T = decodeEntities(T), T = T.replace(/<br>/g, "<br/>"), T;
|
|
535
|
+
}, "cleanUpSvgCode"), putIntoIFrame = /* @__PURE__ */ __name((e = "", C) => `<iframe style="width:${IFRAME_WIDTH};height:${C?.viewBox?.baseVal?.height ? C.viewBox.baseVal.height + "px" : IFRAME_HEIGHT};${IFRAME_STYLES}" src="data:text/html;charset=UTF-8;base64,${toBase64(`<body style="${IFRAME_BODY_STYLE}">${e}</body>`)}" sandbox="${IFRAME_SANDBOX_OPTS}">
|
|
536
536
|
${IFRAME_NOT_SUPPORTED_MSG}
|
|
537
|
-
</iframe>`, "putIntoIFrame"), appendDivSvgG = /* @__PURE__ */ __name((e, w, T, E
|
|
538
|
-
let
|
|
539
|
-
|
|
540
|
-
let
|
|
541
|
-
return
|
|
537
|
+
</iframe>`, "putIntoIFrame"), appendDivSvgG = /* @__PURE__ */ __name((e, C, w, T, E) => {
|
|
538
|
+
let D = e.append("div");
|
|
539
|
+
D.attr("id", w), T && D.attr("style", T);
|
|
540
|
+
let O = D.append("svg").attr("id", C).attr("width", "100%").attr("xmlns", XMLNS_SVG_STD);
|
|
541
|
+
return E && O.attr("xmlns:xlink", E), O.append("g"), e;
|
|
542
542
|
}, "appendDivSvgG");
|
|
543
|
-
function sandboxedIframe(e,
|
|
544
|
-
return e.append("iframe").attr("id",
|
|
543
|
+
function sandboxedIframe(e, C) {
|
|
544
|
+
return e.append("iframe").attr("id", C).attr("style", "width: 100%; height: 100%;").attr("sandbox", "");
|
|
545
545
|
}
|
|
546
546
|
__name(sandboxedIframe, "sandboxedIframe");
|
|
547
|
-
var removeExistingElements = /* @__PURE__ */ __name((e, w, T
|
|
548
|
-
e.getElementById(
|
|
547
|
+
var removeExistingElements = /* @__PURE__ */ __name((e, C, w, T) => {
|
|
548
|
+
e.getElementById(C)?.remove(), e.getElementById(w)?.remove(), e.getElementById(T)?.remove();
|
|
549
549
|
}, "removeExistingElements"), render = /* @__PURE__ */ __name(async function(T, D, O) {
|
|
550
550
|
addDiagrams();
|
|
551
551
|
let k = processAndSetConfigs(D);
|
|
@@ -553,8 +553,8 @@ var removeExistingElements = /* @__PURE__ */ __name((e, w, T, E) => {
|
|
|
553
553
|
let A = getConfig();
|
|
554
554
|
log.debug(A), D.length > (A?.maxTextSize ?? MAX_TEXTLENGTH) && (D = MAX_TEXTLENGTH_EXCEEDED_MSG);
|
|
555
555
|
let j = `#${T}`, M = "i" + T, N = "#" + M, P = "d" + T, F = "#" + P, I = /* @__PURE__ */ __name(() => {
|
|
556
|
-
let
|
|
557
|
-
|
|
556
|
+
let C = select_default(R ? N : F).node();
|
|
557
|
+
C && "remove" in C && C.remove();
|
|
558
558
|
}, "removeTempElements"), L = select_default(document.body), R = A.securityLevel === SECURITY_LVL_SANDBOX, z = A.securityLevel === SECURITY_LVL_LOOSE, B = A.fontFamily;
|
|
559
559
|
O === void 0 ? (removeExistingElements(document, T, P, M), R ? (L = select_default(sandboxedIframe(select_default(document.body), M).nodes()[0].contentDocument.body), L.node().style.margin = "0") : L = select_default("body"), appendDivSvgG(L, T, P)) : (O && (O.innerHTML = ""), R ? (L = select_default(sandboxedIframe(select_default(O), M).nodes()[0].contentDocument.body), L.node().style.margin = "0") : L = select_default(O), appendDivSvgG(L, T, P, `font-family: ${B}`, XMLNS_XLINK_STD));
|
|
560
560
|
let V, H;
|
|
@@ -590,16 +590,16 @@ var removeExistingElements = /* @__PURE__ */ __name((e, w, T, E) => {
|
|
|
590
590
|
};
|
|
591
591
|
}, "render");
|
|
592
592
|
function initialize(e = {}) {
|
|
593
|
-
let
|
|
594
|
-
|
|
593
|
+
let C = assignWithDepth_default({}, e);
|
|
594
|
+
C?.fontFamily && !C.themeVariables?.fontFamily && (C.themeVariables ||= {}, C.themeVariables.fontFamily = C.fontFamily), saveConfigFromInitialize(C), C?.theme && C.theme in themes_default ? C.themeVariables = themes_default[C.theme].getThemeVariables(C.themeVariables) : C && (C.themeVariables = themes_default.default.getThemeVariables(C.themeVariables)), setLogLevel((typeof C == "object" ? setSiteConfig(C) : getSiteConfig()).logLevel), addDiagrams();
|
|
595
595
|
}
|
|
596
596
|
__name(initialize, "initialize");
|
|
597
|
-
var getDiagramFromText = /* @__PURE__ */ __name((e,
|
|
598
|
-
let { code:
|
|
599
|
-
return Diagram.fromText(
|
|
597
|
+
var getDiagramFromText = /* @__PURE__ */ __name((e, C = {}) => {
|
|
598
|
+
let { code: w } = preprocessDiagram(e);
|
|
599
|
+
return Diagram.fromText(w, C);
|
|
600
600
|
}, "getDiagramFromText");
|
|
601
|
-
function addA11yInfo(e, w, T
|
|
602
|
-
setA11yDiagramInfo(
|
|
601
|
+
function addA11yInfo(e, C, w, T) {
|
|
602
|
+
setA11yDiagramInfo(C, e), addSVGa11yTitleDescription(C, w, T, C.attr("id"));
|
|
603
603
|
}
|
|
604
604
|
__name(addA11yInfo, "addA11yInfo");
|
|
605
605
|
var mermaidAPI = Object.freeze({
|
|
@@ -620,12 +620,12 @@ var mermaidAPI = Object.freeze({
|
|
|
620
620
|
defaultConfig
|
|
621
621
|
});
|
|
622
622
|
setLogLevel(getConfig().logLevel), reset(getConfig());
|
|
623
|
-
var handleError = /* @__PURE__ */ __name((e,
|
|
624
|
-
log.warn(e), isDetailedError(e) ? (
|
|
623
|
+
var handleError = /* @__PURE__ */ __name((e, C, T) => {
|
|
624
|
+
log.warn(e), isDetailedError(e) ? (T && T(e.str, e.hash), C.push({
|
|
625
625
|
...e,
|
|
626
626
|
message: e.str,
|
|
627
627
|
error: e
|
|
628
|
-
})) : (
|
|
628
|
+
})) : (T && T(e), e instanceof Error && C.push({
|
|
629
629
|
str: e.message,
|
|
630
630
|
message: e.message,
|
|
631
631
|
hash: e.name,
|
|
@@ -634,44 +634,44 @@ var handleError = /* @__PURE__ */ __name((e, T, E) => {
|
|
|
634
634
|
}, "handleError"), run = /* @__PURE__ */ __name(async function(e = { querySelector: ".mermaid" }) {
|
|
635
635
|
try {
|
|
636
636
|
await runThrowsErrors(e);
|
|
637
|
-
} catch (
|
|
638
|
-
if (isDetailedError(
|
|
637
|
+
} catch (C) {
|
|
638
|
+
if (isDetailedError(C) && log.error(C.str), mermaid.parseError && mermaid.parseError(C), !e.suppressErrors) throw log.error("Use the suppressErrors option to suppress these errors"), C;
|
|
639
639
|
}
|
|
640
|
-
}, "run"), runThrowsErrors = /* @__PURE__ */ __name(async function({ postRenderCallback: e, querySelector:
|
|
641
|
-
let
|
|
640
|
+
}, "run"), runThrowsErrors = /* @__PURE__ */ __name(async function({ postRenderCallback: e, querySelector: C, nodes: T } = { querySelector: ".mermaid" }) {
|
|
641
|
+
let E = mermaidAPI.getConfig();
|
|
642
642
|
log.debug(`${e ? "" : "No "}Callback function found`);
|
|
643
|
-
let
|
|
644
|
-
if (
|
|
645
|
-
else if (
|
|
643
|
+
let D;
|
|
644
|
+
if (T) D = T;
|
|
645
|
+
else if (C) D = document.querySelectorAll(C);
|
|
646
646
|
else throw Error("Nodes and querySelector are both undefined");
|
|
647
|
-
log.debug(`Found ${
|
|
648
|
-
let
|
|
649
|
-
for (let
|
|
650
|
-
if (log.info("Rendering diagram: " +
|
|
651
|
-
|
|
652
|
-
let
|
|
653
|
-
|
|
654
|
-
let
|
|
655
|
-
|
|
647
|
+
log.debug(`Found ${D.length} diagrams`), E?.startOnLoad !== void 0 && (log.debug("Start On Load: " + E?.startOnLoad), mermaidAPI.updateSiteConfig({ startOnLoad: E?.startOnLoad }));
|
|
648
|
+
let O = new utils_default.InitIDGenerator(E.deterministicIds, E.deterministicIDSeed), k, A = [];
|
|
649
|
+
for (let C of Array.from(D)) {
|
|
650
|
+
if (log.info("Rendering diagram: " + C.id), C.getAttribute("data-processed")) continue;
|
|
651
|
+
C.setAttribute("data-processed", "true");
|
|
652
|
+
let T = `mermaid-${O.next()}`;
|
|
653
|
+
k = C.innerHTML, k = dedent(utils_default.entityDecode(k)).trim().replace(/<br\s*\/?>/gi, "<br/>");
|
|
654
|
+
let E = utils_default.detectInit(k);
|
|
655
|
+
E && log.debug("Detected early reinit: ", E);
|
|
656
656
|
try {
|
|
657
|
-
let { svg: w, bindFunctions:
|
|
658
|
-
|
|
657
|
+
let { svg: w, bindFunctions: E } = await render2(T, k, C);
|
|
658
|
+
C.innerHTML = w, e && await e(T), E && E(C);
|
|
659
659
|
} catch (e) {
|
|
660
|
-
handleError(e,
|
|
660
|
+
handleError(e, A, mermaid.parseError);
|
|
661
661
|
}
|
|
662
662
|
}
|
|
663
|
-
if (
|
|
663
|
+
if (A.length > 0) throw A[0];
|
|
664
664
|
}, "runThrowsErrors"), initialize2 = /* @__PURE__ */ __name(function(e) {
|
|
665
665
|
mermaidAPI.initialize(e);
|
|
666
|
-
}, "initialize"), init = /* @__PURE__ */ __name(async function(e,
|
|
666
|
+
}, "initialize"), init = /* @__PURE__ */ __name(async function(e, C, T) {
|
|
667
667
|
log.warn("mermaid.init is deprecated. Please use run instead."), e && initialize2(e);
|
|
668
|
-
let
|
|
669
|
-
postRenderCallback:
|
|
668
|
+
let E = {
|
|
669
|
+
postRenderCallback: T,
|
|
670
670
|
querySelector: ".mermaid"
|
|
671
671
|
};
|
|
672
|
-
typeof
|
|
673
|
-
}, "init"), registerExternalDiagrams = /* @__PURE__ */ __name(async (e, { lazyLoad:
|
|
674
|
-
addDiagrams(), registerLazyLoadedDiagrams(...e),
|
|
672
|
+
typeof C == "string" ? E.querySelector = C : C && (C instanceof HTMLElement ? E.nodes = [C] : E.nodes = C), await run(E);
|
|
673
|
+
}, "init"), registerExternalDiagrams = /* @__PURE__ */ __name(async (e, { lazyLoad: C = !0 } = {}) => {
|
|
674
|
+
addDiagrams(), registerLazyLoadedDiagrams(...e), C === !1 && await loadRegisteredDiagrams();
|
|
675
675
|
}, "registerExternalDiagrams"), contentLoaded = /* @__PURE__ */ __name(function() {
|
|
676
676
|
if (mermaid.startOnLoad) {
|
|
677
677
|
let { startOnLoad: e } = mermaidAPI.getConfig();
|
|
@@ -693,24 +693,24 @@ var setParseErrorHandler = /* @__PURE__ */ __name(function(e) {
|
|
|
693
693
|
}
|
|
694
694
|
executionQueueRunning = !1;
|
|
695
695
|
}
|
|
696
|
-
}, "executeQueue"), parse2 = /* @__PURE__ */ __name(async (
|
|
697
|
-
let
|
|
698
|
-
mermaidAPI.parse(
|
|
699
|
-
e
|
|
696
|
+
}, "executeQueue"), parse2 = /* @__PURE__ */ __name(async (e, T) => new Promise((E, D) => {
|
|
697
|
+
let O = /* @__PURE__ */ __name(() => new Promise((C, O) => {
|
|
698
|
+
mermaidAPI.parse(e, T).then((e) => {
|
|
699
|
+
C(e), E(e);
|
|
700
700
|
}, (e) => {
|
|
701
|
-
log.error("Error parsing", e), mermaid.parseError?.(e),
|
|
701
|
+
log.error("Error parsing", e), mermaid.parseError?.(e), O(e), D(e);
|
|
702
702
|
});
|
|
703
703
|
}), "performCall");
|
|
704
|
-
executionQueue.push(
|
|
705
|
-
}), "parse"), render2 = /* @__PURE__ */ __name((T, E
|
|
706
|
-
let
|
|
707
|
-
mermaidAPI.render(T, E
|
|
708
|
-
e
|
|
704
|
+
executionQueue.push(O), executeQueue().catch(D);
|
|
705
|
+
}), "parse"), render2 = /* @__PURE__ */ __name((e, T, E) => new Promise((D, O) => {
|
|
706
|
+
let k = /* @__PURE__ */ __name(() => new Promise((C, k) => {
|
|
707
|
+
mermaidAPI.render(e, T, E).then((e) => {
|
|
708
|
+
C(e), D(e);
|
|
709
709
|
}, (e) => {
|
|
710
|
-
log.error("Error parsing", e), mermaid.parseError?.(e),
|
|
710
|
+
log.error("Error parsing", e), mermaid.parseError?.(e), k(e), O(e);
|
|
711
711
|
});
|
|
712
712
|
}), "performCall");
|
|
713
|
-
executionQueue.push(
|
|
713
|
+
executionQueue.push(k), executeQueue().catch(O);
|
|
714
714
|
}), "render"), mermaid = {
|
|
715
715
|
startOnLoad: !0,
|
|
716
716
|
mermaidAPI,
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { __export, __reExport } from "../../../../_virtual/rolldown_runtime.js";
|
|
2
|
+
import { m, motion } from "framer-motion";
|
|
2
3
|
export * from "framer-motion";
|
|
3
|
-
|
|
4
|
+
var react_exports = /* @__PURE__ */ __export({
|
|
5
|
+
m: () => m,
|
|
6
|
+
motion: () => motion
|
|
7
|
+
}, 1);
|
|
8
|
+
import * as import_framer_motion from "framer-motion";
|
|
9
|
+
__reExport(react_exports, import_framer_motion, void 0, 1);
|
|
10
|
+
export { motion, react_exports };
|