@diagrammo/dgmo 0.85.0 → 0.87.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/advanced.d.ts +45 -9
- package/dist/advanced.js +83 -64
- package/dist/block.js +11 -23
- package/dist/chart-meta.js +3 -3
- package/dist/{chunk-FAV4RDVT.js → chunk-2A4DQAXG.js} +1 -1
- package/dist/{chunk-LRNIYQ6Y.js → chunk-33FQ6HNV.js} +1 -1
- package/dist/{chunk-JIPUBFAM.js → chunk-5KGM44TG.js} +2 -2
- package/dist/{chunk-23RWHHI5.js → chunk-5NU7NII2.js} +14 -2
- package/dist/{chunk-QJ2JOLFN.js → chunk-6I5UN4FD.js} +2 -2
- package/dist/{chunk-HMWZQ53A.js → chunk-7WGCQE2E.js} +1 -1
- package/dist/{chunk-NSS2EF5B.js → chunk-AAMCXQPP.js} +1 -1
- package/dist/{chunk-XD7XL3SF.js → chunk-AGO3PFGS.js} +1 -1
- package/dist/{chunk-JVRDKR5R.js → chunk-AQIBKTPG.js} +1 -1
- package/dist/{chunk-RYZNNXUV.js → chunk-AUS7V54P.js} +1 -1
- package/dist/{chunk-ITLPDLBH.js → chunk-B7CU2HW5.js} +3 -3
- package/dist/{chunk-X2VEJ5NT.js → chunk-BMUWF77V.js} +2 -2
- package/dist/{chunk-6HOVLE3H.js → chunk-BT2WH2XT.js} +1 -1
- package/dist/{chunk-3MXJMZAN.js → chunk-BV6PKJUS.js} +105 -28
- package/dist/{chunk-7256EOAE.js → chunk-CFBY77QJ.js} +129 -10
- package/dist/{chunk-BP4BT5TH.js → chunk-CLQIXD2C.js} +1 -1
- package/dist/{chunk-OZTDXMRQ.js → chunk-D4M25W6R.js} +1 -1
- package/dist/{chunk-A4PHPKNR.js → chunk-DAX42XVH.js} +1 -1
- package/dist/{chunk-C5FEPGSJ.js → chunk-DSG6GBUQ.js} +3 -3
- package/dist/{chunk-JLGN6S4B.js → chunk-EJS3K44P.js} +148 -80
- package/dist/{chunk-YWHGWLY6.js → chunk-FBKPSU3A.js} +5 -5
- package/dist/{chunk-5JO443MB.js → chunk-HAH5X345.js} +1 -1
- package/dist/{chunk-HBCAY3KR.js → chunk-HTNLLT34.js} +1 -1
- package/dist/{chunk-PEFPTQ3Z.js → chunk-HTPZDZKQ.js} +3 -3
- package/dist/{chunk-XXAZ5C4K.js → chunk-IJ27L3R4.js} +1 -1
- package/dist/{chunk-OGKP2XGJ.js → chunk-J7Q4VPBJ.js} +2 -2
- package/dist/{chunk-VDMG3MM4.js → chunk-JD4RHBNX.js} +1 -1
- package/dist/{chunk-HATTVAWX.js → chunk-LJFXC3IP.js} +1 -1
- package/dist/{chunk-REUEU5PU.js → chunk-LL6D3MES.js} +3 -3
- package/dist/{chunk-ULCB4BLF.js → chunk-LPXC4I4R.js} +19 -2
- package/dist/{chunk-BIQYWWJ2.js → chunk-LSQGJN5H.js} +2 -2
- package/dist/{chunk-T327J6CE.js → chunk-MSXRNVHB.js} +2 -2
- package/dist/{chunk-V3LJIPS4.js → chunk-N7XRBWXA.js} +3 -3
- package/dist/{chunk-UJRMARNX.js → chunk-NJIGYGZS.js} +19 -1
- package/dist/{chunk-WMIKC5XO.js → chunk-NPWVOFB3.js} +1 -1
- package/dist/{chunk-2QIGN7KL.js → chunk-O6MMQQLF.js} +9 -5
- package/dist/{chunk-MIZ46MOF.js → chunk-P5V63L35.js} +2 -2
- package/dist/{chunk-ADAGWVWJ.js → chunk-PJQZWJ5I.js} +70 -48
- package/dist/{chunk-RMAJIB6S.js → chunk-PUVTFUNH.js} +4 -4
- package/dist/{chunk-ETBXIKK6.js → chunk-Q2U5635V.js} +1 -1
- package/dist/chunk-QT3KDDXK.js +436 -0
- package/dist/{chunk-UNSN56OJ.js → chunk-R2K5L4UA.js} +1 -1
- package/dist/{chunk-SLMAAJPE.js → chunk-RGI64U3A.js} +1 -1
- package/dist/{chunk-ZGHV4QLK.js → chunk-RJNZHFNG.js} +1 -1
- package/dist/{chunk-FWNJDD4U.js → chunk-S7W75MIM.js} +3 -20
- package/dist/{chunk-ZUUNTOMG.js → chunk-UIUXIDBX.js} +1 -1
- package/dist/{chunk-XIYVGO24.js → chunk-UMRZPRAN.js} +3 -3
- package/dist/{chunk-67USWFFE.js → chunk-UY6TEJJH.js} +1 -1
- package/dist/{chunk-UGYZ5Q5Y.js → chunk-VJ2KROJ5.js} +1 -1
- package/dist/{chunk-PSH5DT26.js → chunk-WZ23JJ7U.js} +3 -3
- package/dist/{chunk-IIEI7VK5.js → chunk-XCKNFFKM.js} +2 -0
- package/dist/{chunk-Y7FTHOMD.js → chunk-XIFK423U.js} +129 -225
- package/dist/{chunk-LQSNWE3W.js → chunk-XUDGZJTJ.js} +3 -3
- package/dist/{chunk-D7D5YK4J.js → chunk-XVSJYAK7.js} +15 -3
- package/dist/{chunk-J2ICADUM.js → chunk-XWYR5T52.js} +3 -3
- package/dist/{chunk-QNKHJ5CK.js → chunk-YK4N6TBN.js} +4 -2
- package/dist/{chunk-NJS62BAG.js → chunk-YMG7JDEY.js} +17 -7
- package/dist/chunk-Z6DXWULM.js +23 -0
- package/dist/{chunk-PBEH52A2.js → chunk-ZNNVI5SR.js} +1 -1
- package/dist/cloud-reference.d.ts +11 -1
- package/dist/cloud-reference.js +1 -1
- package/dist/{dgmo-router-VILEOWQ2.js → dgmo-router-F2DSURTR.js} +4 -4
- package/dist/{dimensions-F3Y5T54V.js → dimensions-6QAWEGIR.js} +2 -2
- package/dist/{flowchart-renderer-TGQL4S4L.js → flowchart-renderer-THC6Y7EH.js} +8 -7
- package/dist/index.d.ts +68 -1
- package/dist/index.js +81 -13
- package/dist/{layout-WZCXK7DF.js → layout-5NPBHV5F.js} +2 -2
- package/dist/{layout-WXVGMSI3.js → layout-5VSMZPMG.js} +2 -2
- package/dist/{layout-CFTB7GKV.js → layout-BOVTLAOT.js} +7 -6
- package/dist/{layout-K6NI4VCS.js → layout-CUFA7XJD.js} +2 -2
- package/dist/{layout-6JARW64V.js → layout-EHTYSMV4.js} +6 -5
- package/dist/{layout-NB7TKAWN.js → layout-LUQKAGGT.js} +2 -2
- package/dist/{layout-YELNBVPC.js → layout-P6DTD4RT.js} +6 -5
- package/dist/{layout-PT7IKVCV.js → layout-QX5T6ZNE.js} +2 -2
- package/dist/layout-RANVNAKI.js +10 -0
- package/dist/{layout-FMKSENGL.js → layout-XUW444O5.js} +5 -4
- package/dist/{layout-search-GRJEBAUF.js → layout-search-VKSBUCDM.js} +67 -33
- package/dist/live-link-resolve.d.ts +21 -3
- package/dist/live-link-resolve.js +47 -17
- package/dist/{parser-6TXNMXNB.js → parser-XYY5NHP4.js} +2 -2
- package/dist/{renderer-YSH5EX54.js → renderer-222OTVQV.js} +3 -2
- package/dist/{renderer-DRLLZZ6P.js → renderer-2KVQGGTT.js} +5 -4
- package/dist/{renderer-E5EKGIX2.js → renderer-2OOPQ4CH.js} +4 -3
- package/dist/{renderer-OV3GUJRR.js → renderer-36JH4OMC.js} +4 -4
- package/dist/{renderer-G72GMBKA.js → renderer-3CTUWCO7.js} +7 -6
- package/dist/{renderer-XS42HEXW.js → renderer-3FF4QVGW.js} +4 -3
- package/dist/{renderer-R6VJDZFO.js → renderer-4BHOELCE.js} +4 -3
- package/dist/{renderer-EU27D4S6.js → renderer-4BIMRO4X.js} +5 -4
- package/dist/{renderer-HV6ZYJMC.js → renderer-4NZZ5J2F.js} +2 -2
- package/dist/{renderer-UGA5DGKR.js → renderer-A4LMOBZL.js} +9 -8
- package/dist/{renderer-3AOOLHJU.js → renderer-A6ACVK4X.js} +3 -2
- package/dist/{renderer-HWEGM72C.js → renderer-BICLPGAH.js} +2 -2
- package/dist/{renderer-ML2CLU25.js → renderer-DCFQDBGJ.js} +4 -3
- package/dist/{renderer-ADX4DWRJ.js → renderer-ELYPDPNF.js} +3 -2
- package/dist/{renderer-OXSLLQQC.js → renderer-KVAQE7PQ.js} +2 -2
- package/dist/{renderer-X4KFEKUK.js → renderer-LODEVN3V.js} +5 -4
- package/dist/{renderer-WUDVV363.js → renderer-NHPKNNBD.js} +6 -5
- package/dist/{renderer-TF3NTKP3.js → renderer-NX4YKWCJ.js} +2 -2
- package/dist/{renderer-P7LQBDU2.js → renderer-QM23SWAM.js} +2 -2
- package/dist/{renderer-5YOF2AHJ.js → renderer-R34GJL7U.js} +9 -8
- package/dist/{renderer-FBAFYSIQ.js → renderer-RAATRF6W.js} +3 -3
- package/dist/{renderer-FXX3XSNW.js → renderer-RENDISO5.js} +2 -2
- package/dist/{renderer-3F4K2X57.js → renderer-RMGN3Q7D.js} +2 -2
- package/dist/{renderer-FQAZ3KNU.js → renderer-SDUSBCJI.js} +4 -3
- package/dist/{renderer-OVDVFPAI.js → renderer-WH2HWE5Z.js} +5 -4
- package/dist/{renderer-J3O2KVTL.js → renderer-X5A5VIRD.js} +6 -5
- package/dist/{renderer-WRWVFEX7.js → renderer-XRALFCIN.js} +6 -4
- package/dist/{renderer-3XRDFNYF.js → renderer-YDAVCRTP.js} +5 -4
- package/dist/{renderer-5A6VWIVX.js → renderer-YIZ7G4HU.js} +5 -5
- package/dist/{state-renderer-B4ZF6ESS.js → state-renderer-5IQ4OJUI.js} +8 -7
- package/docs/language-reference.md +12 -12
- package/gallery/fixtures/journey-map.dgmo +28 -0
- package/gallery/fixtures/mindmap.dgmo +31 -0
- package/gallery/fixtures/pert.dgmo +27 -0
- package/gallery/fixtures/wireframe.dgmo +30 -0
- package/package.json +3 -3
- package/dist/chunk-WTTIODDV.js +0 -9
- package/dist/layout-JQ3IPJYR.js +0 -9
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
isExtendedChartType,
|
|
7
7
|
knownChartTypeIds,
|
|
8
8
|
parseDgmo
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-MSXRNVHB.js";
|
|
10
10
|
import "./chunk-EOYPX6SF.js";
|
|
11
11
|
import "./chunk-WP2RLGDI.js";
|
|
12
12
|
import "./chunk-A2RUBBVT.js";
|
|
@@ -46,11 +46,11 @@ import {
|
|
|
46
46
|
looksLikeC4,
|
|
47
47
|
looksLikeGantt,
|
|
48
48
|
parseDgmoChartType
|
|
49
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-AQIBKTPG.js";
|
|
50
50
|
import "./chunk-3RYBTEF5.js";
|
|
51
51
|
import "./chunk-UNNJCSSQ.js";
|
|
52
52
|
import "./chunk-3TYUXC7D.js";
|
|
53
|
-
import "./chunk-
|
|
53
|
+
import "./chunk-7WGCQE2E.js";
|
|
54
54
|
import "./chunk-EQW6HOP4.js";
|
|
55
55
|
import "./chunk-DAOFNU6J.js";
|
|
56
56
|
import "./chunk-VPASQOR3.js";
|
|
@@ -72,7 +72,7 @@ import "./chunk-HSRQDWV7.js";
|
|
|
72
72
|
import "./chunk-4WW3SGMH.js";
|
|
73
73
|
import "./chunk-L5AFONQU.js";
|
|
74
74
|
import "./chunk-44GP7PD5.js";
|
|
75
|
-
import "./chunk-
|
|
75
|
+
import "./chunk-5NU7NII2.js";
|
|
76
76
|
import "./chunk-IDJGV6VM.js";
|
|
77
77
|
import "./chunk-7HWY4QAJ.js";
|
|
78
78
|
import "./chunk-2M4IGSCY.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
mapContentAspect,
|
|
3
3
|
mapExportDimensions
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-VJ2KROJ5.js";
|
|
5
|
+
import "./chunk-BV6PKJUS.js";
|
|
6
6
|
import "./chunk-4QV26TEG.js";
|
|
7
7
|
import "./chunk-KMU65FYM.js";
|
|
8
8
|
import "./chunk-VLC6WNRD.js";
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
renderFlowchart,
|
|
3
3
|
renderFlowchartForExport
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-XUDGZJTJ.js";
|
|
5
5
|
import "./chunk-26EVL454.js";
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-ZNNVI5SR.js";
|
|
7
|
+
import "./chunk-HAH5X345.js";
|
|
8
8
|
import "./chunk-XBJJP2HN.js";
|
|
9
9
|
import "./chunk-6EK55ART.js";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-RJNZHFNG.js";
|
|
11
11
|
import "./chunk-5DH3KYFH.js";
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-NPWVOFB3.js";
|
|
13
|
+
import "./chunk-S7W75MIM.js";
|
|
14
|
+
import "./chunk-Z6DXWULM.js";
|
|
14
15
|
import "./chunk-EPDBWATV.js";
|
|
15
16
|
import "./chunk-24YPR5EH.js";
|
|
16
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-XCKNFFKM.js";
|
|
17
18
|
import "./chunk-LD2JSKU3.js";
|
|
18
19
|
import "./chunk-VLC6WNRD.js";
|
|
19
20
|
import "./chunk-ICLB27PZ.js";
|
package/dist/index.d.ts
CHANGED
|
@@ -102,6 +102,73 @@ declare function attachDataChartInteractions(svg: SVGSVGElement, opts?: DataChar
|
|
|
102
102
|
declare const D3_DATA_CHART_TYPES: Set<string>;
|
|
103
103
|
declare function supportsD3DataChart(type: string): boolean;
|
|
104
104
|
|
|
105
|
+
/**
|
|
106
|
+
* The supported sanitizing boundary for renderer output that is about to land
|
|
107
|
+
* in a live document.
|
|
108
|
+
*
|
|
109
|
+
* Renderer output is trusted only as far as the renderer that produced it, and
|
|
110
|
+
* every host — the desktop app, the web editor, Obsidian, the script-tag
|
|
111
|
+
* drop-ins, this library's own `mountD3DataChart` — puts that output into the
|
|
112
|
+
* DOM. This module is what they call first. It lives here, beside `safe-href`,
|
|
113
|
+
* rather than inside `src/auto/shared.ts` where it started: that module is the
|
|
114
|
+
* browser-embed bundle's private toolbox, reachable only from the two IIFE
|
|
115
|
+
* script-tag builds, so a host importing `@diagrammo/dgmo` could not call the
|
|
116
|
+
* sanitizer at all however much it wanted to.
|
|
117
|
+
*
|
|
118
|
+
* 🔴 **Parse into a DETACHED holder, take the `<svg>`, sanitize, insert.** All
|
|
119
|
+
* four steps, in that order:
|
|
120
|
+
*
|
|
121
|
+
* ```ts
|
|
122
|
+
* const holder = document.createElement('div');
|
|
123
|
+
* holder.innerHTML = svg; // inert: nothing here is connected yet
|
|
124
|
+
* const svgEl = holder.querySelector('svg');
|
|
125
|
+
* if (svgEl) {
|
|
126
|
+
* sanitizeSvgInPlace(svgEl);
|
|
127
|
+
* container.replaceChildren(svgEl);
|
|
128
|
+
* }
|
|
129
|
+
* ```
|
|
130
|
+
*
|
|
131
|
+
* Sanitizing *after* assigning into a live container is too late: connecting
|
|
132
|
+
* the subtree is what creates a nested browsing context for an `<iframe>` and
|
|
133
|
+
* runs a custom element's `connectedCallback`, both synchronously inside the
|
|
134
|
+
* assignment. And taking only the `<svg>` is half the safety — moving every
|
|
135
|
+
* child of the holder across would connect whatever a hostile document put
|
|
136
|
+
* *beside* the diagram. `auto/index.ts` and `element/index.ts` have always done
|
|
137
|
+
* both; `mount.ts` learned them on diagrammo/diagrammo#884.
|
|
138
|
+
*
|
|
139
|
+
* 🔴 **What this does NOT do**, so a caller is not misled about the contract:
|
|
140
|
+
*
|
|
141
|
+
* - It does not parse CSS. An `@import` or a `url()` inside a `<style>`
|
|
142
|
+
* element passes through untouched.
|
|
143
|
+
* - It removes the elements listed in `REMOVED_TAGS` and nothing else. That
|
|
144
|
+
* set is the script-execution and remote-content surface as of
|
|
145
|
+
* diagrammo/diagrammo#884; an element neither it nor the attribute scrub
|
|
146
|
+
* below names survives, so a caller sanitizing *arbitrary* HTML rather than
|
|
147
|
+
* dgmo renderer output needs its own allowlist on top.
|
|
148
|
+
* - It does not stop a resource load that an attribute alone starts —
|
|
149
|
+
* `<img src>` fetches whether or not the node is connected. What protects
|
|
150
|
+
* that case is the `on*` strip, not the detached holder.
|
|
151
|
+
* - It is no substitute for escaping where a renderer interpolates author
|
|
152
|
+
* text (see `src/embed/escape.ts`).
|
|
153
|
+
*
|
|
154
|
+
* Browser-only — it needs a live DOM. There is nothing to sanitize on the
|
|
155
|
+
* rasterising path, which never builds a document.
|
|
156
|
+
*/
|
|
157
|
+
/**
|
|
158
|
+
* Strip script-execution surface from a freshly parsed SVG tree before it
|
|
159
|
+
* lands in the live DOM. This is the safety net that lets us build SVG from
|
|
160
|
+
* markup without trusting renderer output to be fully sanitized.
|
|
161
|
+
*
|
|
162
|
+
* Removes every element in `REMOVED_TAGS`, any SMIL element animating an
|
|
163
|
+
* `href`, any `on*` event-handler attribute, and any `href`/`xlink:href`
|
|
164
|
+
* failing the `safeHref` allowlist.
|
|
165
|
+
*
|
|
166
|
+
* Mutates `root` and returns nothing. Call it on a detached holder — see the
|
|
167
|
+
* module comment above for why the order matters, and for what this does not
|
|
168
|
+
* cover.
|
|
169
|
+
*/
|
|
170
|
+
declare function sanitizeSvgInPlace(root: Element): void;
|
|
171
|
+
|
|
105
172
|
/**
|
|
106
173
|
* The full diagnostic catalog, sorted by code. Every coded diagnostic
|
|
107
174
|
* dgmo can emit — its severity, owning chart type, canonical message,
|
|
@@ -206,4 +273,4 @@ interface DecodedDiagramUrl {
|
|
|
206
273
|
*/
|
|
207
274
|
declare function decodeDiagramUrl(url: string): DecodedDiagramUrl | null;
|
|
208
275
|
|
|
209
|
-
export { CompactViewState, D3_DATA_CHART_TYPES, type DataChartInteractionOpts, type DecodedDiagramUrl, DgmoError, DiagnosticSpec, type EncodeDiagramUrlOptions, MapDataSource, type MountD3Opts, type MountedD3Chart, type NormalizeSvgForEmbedOptions, PaletteConfig, type RenderOptions, type RenderResult, Theme, attachDataChartInteractions, decodeDiagramUrl, defaultEmbedBackground, encodeDiagramUrl, getDiagnosticSpec, getEmbedSvgViewBox, listDiagnosticCodes, mountD3DataChart, normalizeSvgForEmbed, render, supportsD3DataChart };
|
|
276
|
+
export { CompactViewState, D3_DATA_CHART_TYPES, type DataChartInteractionOpts, type DecodedDiagramUrl, DgmoError, DiagnosticSpec, type EncodeDiagramUrlOptions, MapDataSource, type MountD3Opts, type MountedD3Chart, type NormalizeSvgForEmbedOptions, PaletteConfig, type RenderOptions, type RenderResult, Theme, attachDataChartInteractions, decodeDiagramUrl, defaultEmbedBackground, encodeDiagramUrl, getDiagnosticSpec, getEmbedSvgViewBox, listDiagnosticCodes, mountD3DataChart, normalizeSvgForEmbed, render, sanitizeSvgInPlace, supportsD3DataChart };
|
package/dist/index.js
CHANGED
|
@@ -9,17 +9,20 @@ import {
|
|
|
9
9
|
searchMapLocations,
|
|
10
10
|
themes
|
|
11
11
|
} from "./chunk-SQAG3UXH.js";
|
|
12
|
+
import {
|
|
13
|
+
safeHref
|
|
14
|
+
} from "./chunk-Z6DXWULM.js";
|
|
12
15
|
import {
|
|
13
16
|
render
|
|
14
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-PJQZWJ5I.js";
|
|
15
18
|
import {
|
|
16
19
|
renderErrorCard
|
|
17
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-D4M25W6R.js";
|
|
18
21
|
import {
|
|
19
22
|
getDiagnosticSpec,
|
|
20
23
|
listDiagnosticCodes,
|
|
21
24
|
parseDgmo
|
|
22
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-MSXRNVHB.js";
|
|
23
26
|
import "./chunk-EOYPX6SF.js";
|
|
24
27
|
import "./chunk-WP2RLGDI.js";
|
|
25
28
|
import "./chunk-A2RUBBVT.js";
|
|
@@ -34,12 +37,12 @@ import "./chunk-KMU65FYM.js";
|
|
|
34
37
|
import "./chunk-EPDBWATV.js";
|
|
35
38
|
import "./chunk-7UDAIP6W.js";
|
|
36
39
|
import "./chunk-2CW5ZTNH.js";
|
|
37
|
-
import "./chunk-
|
|
40
|
+
import "./chunk-LPXC4I4R.js";
|
|
38
41
|
import "./chunk-YRYKTYMQ.js";
|
|
39
42
|
import "./chunk-24YPR5EH.js";
|
|
40
43
|
import {
|
|
41
44
|
GRID_DASH
|
|
42
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-XCKNFFKM.js";
|
|
43
46
|
import "./chunk-RE6TVIAV.js";
|
|
44
47
|
import "./chunk-QFIXL3OK.js";
|
|
45
48
|
import "./chunk-3DOQOXXI.js";
|
|
@@ -82,11 +85,11 @@ import {
|
|
|
82
85
|
decodeDiagramUrl,
|
|
83
86
|
encodeDiagramUrl
|
|
84
87
|
} from "./chunk-RE27AX7O.js";
|
|
85
|
-
import "./chunk-
|
|
88
|
+
import "./chunk-AQIBKTPG.js";
|
|
86
89
|
import "./chunk-3RYBTEF5.js";
|
|
87
90
|
import "./chunk-UNNJCSSQ.js";
|
|
88
91
|
import "./chunk-3TYUXC7D.js";
|
|
89
|
-
import "./chunk-
|
|
92
|
+
import "./chunk-7WGCQE2E.js";
|
|
90
93
|
import "./chunk-EQW6HOP4.js";
|
|
91
94
|
import "./chunk-DAOFNU6J.js";
|
|
92
95
|
import "./chunk-VPASQOR3.js";
|
|
@@ -110,7 +113,7 @@ import "./chunk-L5AFONQU.js";
|
|
|
110
113
|
import {
|
|
111
114
|
chartTypes
|
|
112
115
|
} from "./chunk-44GP7PD5.js";
|
|
113
|
-
import "./chunk-
|
|
116
|
+
import "./chunk-5NU7NII2.js";
|
|
114
117
|
import {
|
|
115
118
|
getPalette,
|
|
116
119
|
palettes,
|
|
@@ -124,6 +127,50 @@ import {
|
|
|
124
127
|
} from "./chunk-BYU54C3S.js";
|
|
125
128
|
import "./chunk-5WRI5ZAA.js";
|
|
126
129
|
|
|
130
|
+
// src/utils/sanitize-svg.ts
|
|
131
|
+
var XLINK_NS = "http://www.w3.org/1999/xlink";
|
|
132
|
+
var REMOVED_TAGS = "script, foreignObject, iframe, object, embed, frame, base, link, meta";
|
|
133
|
+
var ANIMATION_TAGS = new Set(
|
|
134
|
+
["animate", "set", "animateTransform", "animateMotion"].map(
|
|
135
|
+
(t) => t.toLowerCase()
|
|
136
|
+
)
|
|
137
|
+
);
|
|
138
|
+
var ANIMATED_URL_ATTRS = /* @__PURE__ */ new Set(["href", "xlink:href"]);
|
|
139
|
+
function isUrlAnimation(node) {
|
|
140
|
+
if (!ANIMATION_TAGS.has(node.localName.toLowerCase())) return false;
|
|
141
|
+
const target = (node.getAttribute("attributeName") ?? "").trim().toLowerCase();
|
|
142
|
+
return ANIMATED_URL_ATTRS.has(target);
|
|
143
|
+
}
|
|
144
|
+
function scrubElement(node) {
|
|
145
|
+
for (const attr of Array.from(node.attributes)) {
|
|
146
|
+
if (attr.name.toLowerCase().startsWith("on")) {
|
|
147
|
+
node.removeAttribute(attr.name);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
if (node.hasAttribute("href")) {
|
|
151
|
+
const safe = safeHref(node.getAttribute("href"));
|
|
152
|
+
if (safe === null) node.removeAttribute("href");
|
|
153
|
+
}
|
|
154
|
+
if (node.hasAttributeNS(XLINK_NS, "href")) {
|
|
155
|
+
const v = node.getAttributeNS(XLINK_NS, "href");
|
|
156
|
+
if (safeHref(v) === null) {
|
|
157
|
+
node.removeAttributeNS(XLINK_NS, "href");
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
function sanitizeSvgInPlace(root) {
|
|
162
|
+
const dangerous = root.querySelectorAll(REMOVED_TAGS);
|
|
163
|
+
dangerous.forEach((n) => n.remove());
|
|
164
|
+
const all = [root, ...Array.from(root.querySelectorAll("*"))];
|
|
165
|
+
for (const node of all) {
|
|
166
|
+
if (isUrlAnimation(node)) {
|
|
167
|
+
node.remove();
|
|
168
|
+
continue;
|
|
169
|
+
}
|
|
170
|
+
scrubElement(node);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
127
174
|
// src/charts-d3/interactions.ts
|
|
128
175
|
var NS = "http://www.w3.org/2000/svg";
|
|
129
176
|
var STYLE_ID = "dgmo-chart-interactions-style";
|
|
@@ -134,7 +181,8 @@ function ensureStyle(svg, muted) {
|
|
|
134
181
|
style.id = STYLE_ID;
|
|
135
182
|
style.textContent = `
|
|
136
183
|
.dgmo-series,.dgmo-datum,.dgmo-tick,.dgmo-ptlabel{transition:opacity .12s ease}
|
|
137
|
-
|
|
184
|
+
[data-legend-entry]{transition:opacity .12s ease}
|
|
185
|
+
.dgmo-series.dgmo-dim,.dgmo-datum.dgmo-dim,.dgmo-ptlabel.dgmo-dim,[data-legend-entry].dgmo-dim{opacity:.18}
|
|
138
186
|
.dgmo-tick.dgmo-faded{opacity:.22}
|
|
139
187
|
.dgmo-datum{cursor:pointer}
|
|
140
188
|
.dgmo-axis-label{cursor:pointer}
|
|
@@ -177,6 +225,9 @@ function attachDataChartInteractions(svg, opts = {}) {
|
|
|
177
225
|
svg.querySelectorAll(".dgmo-series")
|
|
178
226
|
);
|
|
179
227
|
const datums = Array.from(svg.querySelectorAll(".dgmo-datum"));
|
|
228
|
+
const legendEntries = Array.from(
|
|
229
|
+
svg.querySelectorAll(".chart-legend [data-legend-entry]")
|
|
230
|
+
);
|
|
180
231
|
const circles = Array.from(
|
|
181
232
|
svg.querySelectorAll(".dgmo-pt")
|
|
182
233
|
);
|
|
@@ -247,6 +298,15 @@ function attachDataChartInteractions(svg, opts = {}) {
|
|
|
247
298
|
const ptLabels = Array.from(
|
|
248
299
|
svg.querySelectorAll(".dgmo-ptlabel")
|
|
249
300
|
);
|
|
301
|
+
const dimLegendExcept = (el) => {
|
|
302
|
+
const name = el?.getAttribute("data-series-name") ?? el?.getAttribute("data-emph-key") ?? null;
|
|
303
|
+
const paired = name != null && legendEntries.some((e) => e.getAttribute("data-series-name") === name);
|
|
304
|
+
for (const e of legendEntries)
|
|
305
|
+
e.classList.toggle(
|
|
306
|
+
"dgmo-dim",
|
|
307
|
+
paired && e.getAttribute("data-series-name") !== name
|
|
308
|
+
);
|
|
309
|
+
};
|
|
250
310
|
const dimDatumsExcept = (el) => {
|
|
251
311
|
for (const d of datums) d.classList.toggle("dgmo-dim", d !== el);
|
|
252
312
|
const line = el?.getAttribute("data-line-number");
|
|
@@ -255,6 +315,7 @@ function attachDataChartInteractions(svg, opts = {}) {
|
|
|
255
315
|
"dgmo-dim",
|
|
256
316
|
line == null || l.getAttribute("data-line-number") !== line
|
|
257
317
|
);
|
|
318
|
+
dimLegendExcept(el);
|
|
258
319
|
};
|
|
259
320
|
const dimByKey = (el) => {
|
|
260
321
|
const key = el.getAttribute("data-emph-key");
|
|
@@ -263,11 +324,13 @@ function attachDataChartInteractions(svg, opts = {}) {
|
|
|
263
324
|
if (key) d.classList.toggle("dgmo-dim", dk !== key);
|
|
264
325
|
else d.classList.toggle("dgmo-dim", d !== el);
|
|
265
326
|
}
|
|
327
|
+
dimLegendExcept(el);
|
|
266
328
|
};
|
|
267
329
|
const clearDim = () => {
|
|
268
330
|
for (const d of datums) d.classList.remove("dgmo-dim");
|
|
269
331
|
for (const g of seriesGroups) g.classList.remove("dgmo-dim");
|
|
270
332
|
for (const l of ptLabels) l.classList.remove("dgmo-dim");
|
|
333
|
+
for (const e of legendEntries) e.classList.remove("dgmo-dim");
|
|
271
334
|
reapplyAxisPin();
|
|
272
335
|
};
|
|
273
336
|
let axisPin = null;
|
|
@@ -513,9 +576,6 @@ function attachDataChartInteractions(svg, opts = {}) {
|
|
|
513
576
|
svg.addEventListener("mousemove", onSvgMove);
|
|
514
577
|
svg.addEventListener("mouseleave", onLeave);
|
|
515
578
|
svg.addEventListener("click", onClick);
|
|
516
|
-
const legendEntries = Array.from(
|
|
517
|
-
svg.querySelectorAll(".chart-legend [data-legend-entry]")
|
|
518
|
-
);
|
|
519
579
|
const emphasizeSeries = (name) => {
|
|
520
580
|
for (const g of seriesGroups) {
|
|
521
581
|
const sn = g.getAttribute("data-series-name");
|
|
@@ -637,7 +697,14 @@ function mountD3DataChart(container, content, opts = {}) {
|
|
|
637
697
|
interaction.destroy();
|
|
638
698
|
interaction = null;
|
|
639
699
|
}
|
|
640
|
-
|
|
700
|
+
const holder = document.createElement("div");
|
|
701
|
+
holder.innerHTML = svg;
|
|
702
|
+
const parsed = holder.querySelector("svg");
|
|
703
|
+
container.innerHTML = "";
|
|
704
|
+
if (parsed) {
|
|
705
|
+
sanitizeSvgInPlace(parsed);
|
|
706
|
+
container.append(parsed);
|
|
707
|
+
}
|
|
641
708
|
const el = container.querySelector("svg");
|
|
642
709
|
if (el) {
|
|
643
710
|
const pal = paletteOf(current);
|
|
@@ -750,6 +817,7 @@ export {
|
|
|
750
817
|
palettes,
|
|
751
818
|
render2 as render,
|
|
752
819
|
resolvePaletteOrFallback,
|
|
820
|
+
sanitizeSvgInPlace,
|
|
753
821
|
searchMapLocations,
|
|
754
822
|
supportsD3DataChart,
|
|
755
823
|
themes,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
layoutMindmap
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-UIUXIDBX.js";
|
|
4
4
|
import "./chunk-24YPR5EH.js";
|
|
5
|
-
import "./chunk-
|
|
5
|
+
import "./chunk-XCKNFFKM.js";
|
|
6
6
|
import "./chunk-KAO7JL4I.js";
|
|
7
7
|
import "./chunk-IYULMRBE.js";
|
|
8
8
|
import "./chunk-L5AFONQU.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
focusFamily,
|
|
3
3
|
layoutFamily
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-IJ27L3R4.js";
|
|
5
5
|
import "./chunk-IVKC4GID.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-XCKNFFKM.js";
|
|
7
7
|
import "./chunk-QQJUTGQH.js";
|
|
8
8
|
import "./chunk-KAO7JL4I.js";
|
|
9
9
|
import "./chunk-5WRI5ZAA.js";
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
computeNodeSize,
|
|
3
3
|
layoutBoxesAndLines
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-XIFK423U.js";
|
|
5
|
+
import "./chunk-QT3KDDXK.js";
|
|
6
|
+
import "./chunk-HTNLLT34.js";
|
|
7
7
|
import "./chunk-6EK55ART.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-RJNZHFNG.js";
|
|
9
9
|
import "./chunk-5DH3KYFH.js";
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-NPWVOFB3.js";
|
|
11
|
+
import "./chunk-S7W75MIM.js";
|
|
12
|
+
import "./chunk-Z6DXWULM.js";
|
|
12
13
|
import "./chunk-ICLB27PZ.js";
|
|
13
14
|
import "./chunk-KAO7JL4I.js";
|
|
14
15
|
import "./chunk-O753JUEZ.js";
|
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
layoutC4Context,
|
|
7
7
|
layoutC4Deployment,
|
|
8
8
|
rollUpContextRelationships
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-DAX42XVH.js";
|
|
10
|
+
import "./chunk-XCKNFFKM.js";
|
|
11
11
|
import "./chunk-RH2PROYG.js";
|
|
12
12
|
import "./chunk-KAO7JL4I.js";
|
|
13
13
|
import "./chunk-L5AFONQU.js";
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
layoutERDiagram
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-2A4DQAXG.js";
|
|
4
|
+
import "./chunk-HTNLLT34.js";
|
|
5
5
|
import "./chunk-6EK55ART.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-RJNZHFNG.js";
|
|
7
7
|
import "./chunk-5DH3KYFH.js";
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-NPWVOFB3.js";
|
|
9
|
+
import "./chunk-S7W75MIM.js";
|
|
10
|
+
import "./chunk-Z6DXWULM.js";
|
|
10
11
|
import "./chunk-ICLB27PZ.js";
|
|
11
12
|
import "./chunk-KAO7JL4I.js";
|
|
12
13
|
import "./chunk-O753JUEZ.js";
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
layoutClassDiagram
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-CLQIXD2C.js";
|
|
4
|
+
import "./chunk-HTNLLT34.js";
|
|
5
5
|
import "./chunk-6EK55ART.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-RJNZHFNG.js";
|
|
7
7
|
import "./chunk-5DH3KYFH.js";
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-NPWVOFB3.js";
|
|
9
|
+
import "./chunk-S7W75MIM.js";
|
|
10
|
+
import "./chunk-Z6DXWULM.js";
|
|
10
11
|
import "./chunk-ICLB27PZ.js";
|
|
11
12
|
import "./chunk-KAO7JL4I.js";
|
|
12
13
|
import "./chunk-O753JUEZ.js";
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
layoutGraph
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ZNNVI5SR.js";
|
|
4
4
|
import "./chunk-6EK55ART.js";
|
|
5
|
-
import "./chunk-
|
|
5
|
+
import "./chunk-RJNZHFNG.js";
|
|
6
6
|
import "./chunk-5DH3KYFH.js";
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-NPWVOFB3.js";
|
|
8
|
+
import "./chunk-S7W75MIM.js";
|
|
9
|
+
import "./chunk-Z6DXWULM.js";
|
|
9
10
|
import "./chunk-ICLB27PZ.js";
|
|
10
11
|
import "./chunk-KAO7JL4I.js";
|
|
11
12
|
import "./chunk-NXMESY4J.js";
|