@md2nativedocx/core 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -0
- package/dist/diagrams/architecture-diagram/parser.d.ts +29 -0
- package/dist/diagrams/architecture-diagram/parser.js +142 -0
- package/dist/diagrams/architecture-diagram/parser.js.map +1 -0
- package/dist/diagrams/architecture-diagram/translator.d.ts +41 -0
- package/dist/diagrams/architecture-diagram/translator.js +172 -0
- package/dist/diagrams/architecture-diagram/translator.js.map +1 -0
- package/dist/diagrams/architecture-diagram/types.d.ts +39 -0
- package/dist/diagrams/architecture-diagram/types.js +18 -0
- package/dist/diagrams/architecture-diagram/types.js.map +1 -0
- package/dist/diagrams/block/parser.d.ts +17 -0
- package/dist/diagrams/block/parser.js +312 -0
- package/dist/diagrams/block/parser.js.map +1 -0
- package/dist/diagrams/block/translator.d.ts +16 -0
- package/dist/diagrams/block/translator.js +137 -0
- package/dist/diagrams/block/translator.js.map +1 -0
- package/dist/diagrams/block/types.d.ts +38 -0
- package/dist/diagrams/block/types.js +6 -0
- package/dist/diagrams/block/types.js.map +1 -0
- package/dist/diagrams/c4/parser.d.ts +29 -0
- package/dist/diagrams/c4/parser.js +264 -0
- package/dist/diagrams/c4/parser.js.map +1 -0
- package/dist/diagrams/c4/translator.d.ts +50 -0
- package/dist/diagrams/c4/translator.js +240 -0
- package/dist/diagrams/c4/translator.js.map +1 -0
- package/dist/diagrams/c4/types.d.ts +74 -0
- package/dist/diagrams/c4/types.js +46 -0
- package/dist/diagrams/c4/types.js.map +1 -0
- package/dist/diagrams/class-diagram/parser.d.ts +40 -0
- package/dist/diagrams/class-diagram/parser.js +213 -0
- package/dist/diagrams/class-diagram/parser.js.map +1 -0
- package/dist/diagrams/class-diagram/translator.d.ts +48 -0
- package/dist/diagrams/class-diagram/translator.js +197 -0
- package/dist/diagrams/class-diagram/translator.js.map +1 -0
- package/dist/diagrams/class-diagram/types.d.ts +54 -0
- package/dist/diagrams/class-diagram/types.js +16 -0
- package/dist/diagrams/class-diagram/types.js.map +1 -0
- package/dist/diagrams/cynefin/parser.d.ts +24 -0
- package/dist/diagrams/cynefin/parser.js +102 -0
- package/dist/diagrams/cynefin/parser.js.map +1 -0
- package/dist/diagrams/cynefin/translator.d.ts +37 -0
- package/dist/diagrams/cynefin/translator.js +190 -0
- package/dist/diagrams/cynefin/translator.js.map +1 -0
- package/dist/diagrams/cynefin/types.d.ts +45 -0
- package/dist/diagrams/cynefin/types.js +36 -0
- package/dist/diagrams/cynefin/types.js.map +1 -0
- package/dist/diagrams/er-diagram/parser.d.ts +29 -0
- package/dist/diagrams/er-diagram/parser.js +156 -0
- package/dist/diagrams/er-diagram/parser.js.map +1 -0
- package/dist/diagrams/er-diagram/translator.d.ts +26 -0
- package/dist/diagrams/er-diagram/translator.js +151 -0
- package/dist/diagrams/er-diagram/translator.js.map +1 -0
- package/dist/diagrams/er-diagram/types.d.ts +44 -0
- package/dist/diagrams/er-diagram/types.js +17 -0
- package/dist/diagrams/er-diagram/types.js.map +1 -0
- package/dist/diagrams/event-modeling/parser.d.ts +16 -0
- package/dist/diagrams/event-modeling/parser.js +193 -0
- package/dist/diagrams/event-modeling/parser.js.map +1 -0
- package/dist/diagrams/event-modeling/translator.d.ts +17 -0
- package/dist/diagrams/event-modeling/translator.js +154 -0
- package/dist/diagrams/event-modeling/translator.js.map +1 -0
- package/dist/diagrams/event-modeling/types.d.ts +46 -0
- package/dist/diagrams/event-modeling/types.js +6 -0
- package/dist/diagrams/event-modeling/types.js.map +1 -0
- package/dist/diagrams/gantt/date-utils.d.ts +51 -0
- package/dist/diagrams/gantt/date-utils.js +131 -0
- package/dist/diagrams/gantt/date-utils.js.map +1 -0
- package/dist/diagrams/gantt/parser.d.ts +37 -0
- package/dist/diagrams/gantt/parser.js +221 -0
- package/dist/diagrams/gantt/parser.js.map +1 -0
- package/dist/diagrams/gantt/translator.d.ts +23 -0
- package/dist/diagrams/gantt/translator.js +259 -0
- package/dist/diagrams/gantt/translator.js.map +1 -0
- package/dist/diagrams/gantt/types.d.ts +31 -0
- package/dist/diagrams/gantt/types.js +14 -0
- package/dist/diagrams/gantt/types.js.map +1 -0
- package/dist/diagrams/git-graph/parser.d.ts +29 -0
- package/dist/diagrams/git-graph/parser.js +237 -0
- package/dist/diagrams/git-graph/parser.js.map +1 -0
- package/dist/diagrams/git-graph/translator.d.ts +49 -0
- package/dist/diagrams/git-graph/translator.js +224 -0
- package/dist/diagrams/git-graph/translator.js.map +1 -0
- package/dist/diagrams/git-graph/types.d.ts +72 -0
- package/dist/diagrams/git-graph/types.js +35 -0
- package/dist/diagrams/git-graph/types.js.map +1 -0
- package/dist/diagrams/ishikawa/parser.d.ts +15 -0
- package/dist/diagrams/ishikawa/parser.js +85 -0
- package/dist/diagrams/ishikawa/parser.js.map +1 -0
- package/dist/diagrams/ishikawa/translator.d.ts +12 -0
- package/dist/diagrams/ishikawa/translator.js +95 -0
- package/dist/diagrams/ishikawa/translator.js.map +1 -0
- package/dist/diagrams/ishikawa/types.d.ts +19 -0
- package/dist/diagrams/ishikawa/types.js +6 -0
- package/dist/diagrams/ishikawa/types.js.map +1 -0
- package/dist/diagrams/journey/parser.d.ts +14 -0
- package/dist/diagrams/journey/parser.js +78 -0
- package/dist/diagrams/journey/parser.js.map +1 -0
- package/dist/diagrams/journey/translator.d.ts +11 -0
- package/dist/diagrams/journey/translator.js +90 -0
- package/dist/diagrams/journey/translator.js.map +1 -0
- package/dist/diagrams/journey/types.d.ts +20 -0
- package/dist/diagrams/journey/types.js +6 -0
- package/dist/diagrams/journey/types.js.map +1 -0
- package/dist/diagrams/kanban/parser.d.ts +17 -0
- package/dist/diagrams/kanban/parser.js +129 -0
- package/dist/diagrams/kanban/parser.js.map +1 -0
- package/dist/diagrams/kanban/translator.d.ts +13 -0
- package/dist/diagrams/kanban/translator.js +72 -0
- package/dist/diagrams/kanban/translator.js.map +1 -0
- package/dist/diagrams/kanban/types.d.ts +21 -0
- package/dist/diagrams/kanban/types.js +6 -0
- package/dist/diagrams/kanban/types.js.map +1 -0
- package/dist/diagrams/mindmap/parser.d.ts +23 -0
- package/dist/diagrams/mindmap/parser.js +108 -0
- package/dist/diagrams/mindmap/parser.js.map +1 -0
- package/dist/diagrams/mindmap/translator.d.ts +31 -0
- package/dist/diagrams/mindmap/translator.js +249 -0
- package/dist/diagrams/mindmap/translator.js.map +1 -0
- package/dist/diagrams/mindmap/types.d.ts +19 -0
- package/dist/diagrams/mindmap/types.js +10 -0
- package/dist/diagrams/mindmap/types.js.map +1 -0
- package/dist/diagrams/packet/parser.d.ts +15 -0
- package/dist/diagrams/packet/parser.js +99 -0
- package/dist/diagrams/packet/parser.js.map +1 -0
- package/dist/diagrams/packet/translator.d.ts +14 -0
- package/dist/diagrams/packet/translator.js +66 -0
- package/dist/diagrams/packet/translator.js.map +1 -0
- package/dist/diagrams/packet/types.d.ts +14 -0
- package/dist/diagrams/packet/types.js +6 -0
- package/dist/diagrams/packet/types.js.map +1 -0
- package/dist/diagrams/pie/chart.d.ts +26 -0
- package/dist/diagrams/pie/chart.js +64 -0
- package/dist/diagrams/pie/chart.js.map +1 -0
- package/dist/diagrams/pie/parser.d.ts +18 -0
- package/dist/diagrams/pie/parser.js +93 -0
- package/dist/diagrams/pie/parser.js.map +1 -0
- package/dist/diagrams/pie/translator.d.ts +15 -0
- package/dist/diagrams/pie/translator.js +150 -0
- package/dist/diagrams/pie/translator.js.map +1 -0
- package/dist/diagrams/pie/types.d.ts +16 -0
- package/dist/diagrams/pie/types.js +6 -0
- package/dist/diagrams/pie/types.js.map +1 -0
- package/dist/diagrams/quadrant/parser.d.ts +24 -0
- package/dist/diagrams/quadrant/parser.js +96 -0
- package/dist/diagrams/quadrant/parser.js.map +1 -0
- package/dist/diagrams/quadrant/translator.d.ts +21 -0
- package/dist/diagrams/quadrant/translator.js +204 -0
- package/dist/diagrams/quadrant/translator.js.map +1 -0
- package/dist/diagrams/quadrant/types.d.ts +41 -0
- package/dist/diagrams/quadrant/types.js +10 -0
- package/dist/diagrams/quadrant/types.js.map +1 -0
- package/dist/diagrams/radar/chart.d.ts +21 -0
- package/dist/diagrams/radar/chart.js +65 -0
- package/dist/diagrams/radar/chart.js.map +1 -0
- package/dist/diagrams/radar/parser.d.ts +15 -0
- package/dist/diagrams/radar/parser.js +186 -0
- package/dist/diagrams/radar/parser.js.map +1 -0
- package/dist/diagrams/radar/translator.d.ts +12 -0
- package/dist/diagrams/radar/translator.js +98 -0
- package/dist/diagrams/radar/translator.js.map +1 -0
- package/dist/diagrams/radar/types.d.ts +29 -0
- package/dist/diagrams/radar/types.js +6 -0
- package/dist/diagrams/radar/types.js.map +1 -0
- package/dist/diagrams/requirement-diagram/parser.d.ts +29 -0
- package/dist/diagrams/requirement-diagram/parser.js +156 -0
- package/dist/diagrams/requirement-diagram/parser.js.map +1 -0
- package/dist/diagrams/requirement-diagram/translator.d.ts +24 -0
- package/dist/diagrams/requirement-diagram/translator.js +214 -0
- package/dist/diagrams/requirement-diagram/translator.js.map +1 -0
- package/dist/diagrams/requirement-diagram/types.d.ts +37 -0
- package/dist/diagrams/requirement-diagram/types.js +18 -0
- package/dist/diagrams/requirement-diagram/types.js.map +1 -0
- package/dist/diagrams/sankey/parser.d.ts +14 -0
- package/dist/diagrams/sankey/parser.js +123 -0
- package/dist/diagrams/sankey/parser.js.map +1 -0
- package/dist/diagrams/sankey/translator.d.ts +15 -0
- package/dist/diagrams/sankey/translator.js +132 -0
- package/dist/diagrams/sankey/translator.js.map +1 -0
- package/dist/diagrams/sankey/types.d.ts +16 -0
- package/dist/diagrams/sankey/types.js +6 -0
- package/dist/diagrams/sankey/types.js.map +1 -0
- package/dist/diagrams/sequence/parser.d.ts +22 -0
- package/dist/diagrams/sequence/parser.js +256 -0
- package/dist/diagrams/sequence/parser.js.map +1 -0
- package/dist/diagrams/sequence/translator.d.ts +21 -0
- package/dist/diagrams/sequence/translator.js +309 -0
- package/dist/diagrams/sequence/translator.js.map +1 -0
- package/dist/diagrams/sequence/types.d.ts +62 -0
- package/dist/diagrams/sequence/types.js +8 -0
- package/dist/diagrams/sequence/types.js.map +1 -0
- package/dist/diagrams/state-diagram/parser.d.ts +37 -0
- package/dist/diagrams/state-diagram/parser.js +215 -0
- package/dist/diagrams/state-diagram/parser.js.map +1 -0
- package/dist/diagrams/state-diagram/translator.d.ts +25 -0
- package/dist/diagrams/state-diagram/translator.js +165 -0
- package/dist/diagrams/state-diagram/translator.js.map +1 -0
- package/dist/diagrams/state-diagram/types.d.ts +38 -0
- package/dist/diagrams/state-diagram/types.js +13 -0
- package/dist/diagrams/state-diagram/types.js.map +1 -0
- package/dist/diagrams/timeline/parser.d.ts +17 -0
- package/dist/diagrams/timeline/parser.js +82 -0
- package/dist/diagrams/timeline/parser.js.map +1 -0
- package/dist/diagrams/timeline/translator.d.ts +13 -0
- package/dist/diagrams/timeline/translator.js +90 -0
- package/dist/diagrams/timeline/translator.js.map +1 -0
- package/dist/diagrams/timeline/types.d.ts +18 -0
- package/dist/diagrams/timeline/types.js +6 -0
- package/dist/diagrams/timeline/types.js.map +1 -0
- package/dist/diagrams/tree-view/parser.d.ts +16 -0
- package/dist/diagrams/tree-view/parser.js +129 -0
- package/dist/diagrams/tree-view/parser.js.map +1 -0
- package/dist/diagrams/tree-view/translator.d.ts +11 -0
- package/dist/diagrams/tree-view/translator.js +73 -0
- package/dist/diagrams/tree-view/translator.js.map +1 -0
- package/dist/diagrams/tree-view/types.d.ts +22 -0
- package/dist/diagrams/tree-view/types.js +6 -0
- package/dist/diagrams/tree-view/types.js.map +1 -0
- package/dist/diagrams/treemap/parser.d.ts +15 -0
- package/dist/diagrams/treemap/parser.js +131 -0
- package/dist/diagrams/treemap/parser.js.map +1 -0
- package/dist/diagrams/treemap/translator.d.ts +15 -0
- package/dist/diagrams/treemap/translator.js +136 -0
- package/dist/diagrams/treemap/translator.js.map +1 -0
- package/dist/diagrams/treemap/types.d.ts +22 -0
- package/dist/diagrams/treemap/types.js +6 -0
- package/dist/diagrams/treemap/types.js.map +1 -0
- package/dist/diagrams/venn/parser.d.ts +27 -0
- package/dist/diagrams/venn/parser.js +129 -0
- package/dist/diagrams/venn/parser.js.map +1 -0
- package/dist/diagrams/venn/translator.d.ts +25 -0
- package/dist/diagrams/venn/translator.js +214 -0
- package/dist/diagrams/venn/translator.js.map +1 -0
- package/dist/diagrams/venn/types.d.ts +33 -0
- package/dist/diagrams/venn/types.js +11 -0
- package/dist/diagrams/venn/types.js.map +1 -0
- package/dist/diagrams/wardley/parser.d.ts +14 -0
- package/dist/diagrams/wardley/parser.js +254 -0
- package/dist/diagrams/wardley/parser.js.map +1 -0
- package/dist/diagrams/wardley/translator.d.ts +15 -0
- package/dist/diagrams/wardley/translator.js +196 -0
- package/dist/diagrams/wardley/translator.js.map +1 -0
- package/dist/diagrams/wardley/types.d.ts +74 -0
- package/dist/diagrams/wardley/types.js +8 -0
- package/dist/diagrams/wardley/types.js.map +1 -0
- package/dist/diagrams/xychart/chart.d.ts +24 -0
- package/dist/diagrams/xychart/chart.js +113 -0
- package/dist/diagrams/xychart/chart.js.map +1 -0
- package/dist/diagrams/xychart/parser.d.ts +16 -0
- package/dist/diagrams/xychart/parser.js +190 -0
- package/dist/diagrams/xychart/parser.js.map +1 -0
- package/dist/diagrams/xychart/translator.d.ts +14 -0
- package/dist/diagrams/xychart/translator.js +187 -0
- package/dist/diagrams/xychart/translator.js.map +1 -0
- package/dist/diagrams/xychart/types.d.ts +32 -0
- package/dist/diagrams/xychart/types.js +6 -0
- package/dist/diagrams/xychart/types.js.map +1 -0
- package/dist/diagrams/zenuml/parser.d.ts +21 -0
- package/dist/diagrams/zenuml/parser.js +228 -0
- package/dist/diagrams/zenuml/parser.js.map +1 -0
- package/dist/index.d.ts +109 -0
- package/dist/index.js +189 -0
- package/dist/index.js.map +1 -0
- package/dist/label-runs.d.ts +16 -0
- package/dist/label-runs.js +30 -0
- package/dist/label-runs.js.map +1 -0
- package/dist/layout/layout.d.ts +53 -0
- package/dist/layout/layout.js +536 -0
- package/dist/layout/layout.js.map +1 -0
- package/dist/parser/diagram-type.d.ts +41 -0
- package/dist/parser/diagram-type.js +97 -0
- package/dist/parser/diagram-type.js.map +1 -0
- package/dist/parser/index.d.ts +2 -0
- package/dist/parser/index.js +2 -0
- package/dist/parser/index.js.map +1 -0
- package/dist/parser/parser.d.ts +25 -0
- package/dist/parser/parser.js +1134 -0
- package/dist/parser/parser.js.map +1 -0
- package/dist/render-diagram.d.ts +156 -0
- package/dist/render-diagram.js +326 -0
- package/dist/render-diagram.js.map +1 -0
- package/dist/rendering-plan.d.ts +47 -0
- package/dist/rendering-plan.js +43 -0
- package/dist/rendering-plan.js.map +1 -0
- package/dist/smartart/chain.d.ts +216 -0
- package/dist/smartart/chain.js +558 -0
- package/dist/smartart/chain.js.map +1 -0
- package/dist/smartart/classify.d.ts +96 -0
- package/dist/smartart/classify.js +162 -0
- package/dist/smartart/classify.js.map +1 -0
- package/dist/smartart/cycle.d.ts +91 -0
- package/dist/smartart/cycle.js +323 -0
- package/dist/smartart/cycle.js.map +1 -0
- package/dist/smartart/dispatch.d.ts +48 -0
- package/dist/smartart/dispatch.js +49 -0
- package/dist/smartart/dispatch.js.map +1 -0
- package/dist/smartart/drawing.d.ts +155 -0
- package/dist/smartart/drawing.js +574 -0
- package/dist/smartart/drawing.js.map +1 -0
- package/dist/smartart/embed.d.ts +78 -0
- package/dist/smartart/embed.js +136 -0
- package/dist/smartart/embed.js.map +1 -0
- package/dist/smartart/from-graph.d.ts +42 -0
- package/dist/smartart/from-graph.js +106 -0
- package/dist/smartart/from-graph.js.map +1 -0
- package/dist/smartart/from-timeline.d.ts +30 -0
- package/dist/smartart/from-timeline.js +59 -0
- package/dist/smartart/from-timeline.js.map +1 -0
- package/dist/smartart/from-tree.d.ts +36 -0
- package/dist/smartart/from-tree.js +74 -0
- package/dist/smartart/from-tree.js.map +1 -0
- package/dist/smartart/generate-options.d.ts +12 -0
- package/dist/smartart/generate-options.js +2 -0
- package/dist/smartart/generate-options.js.map +1 -0
- package/dist/smartart/kanban.d.ts +24 -0
- package/dist/smartart/kanban.js +250 -0
- package/dist/smartart/kanban.js.map +1 -0
- package/dist/smartart/node-shape.d.ts +16 -0
- package/dist/smartart/node-shape.js +22 -0
- package/dist/smartart/node-shape.js.map +1 -0
- package/dist/smartart/styles.d.ts +114 -0
- package/dist/smartart/styles.js +141 -0
- package/dist/smartart/styles.js.map +1 -0
- package/dist/smartart/text.d.ts +16 -0
- package/dist/smartart/text.js +48 -0
- package/dist/smartart/text.js.map +1 -0
- package/dist/smartart/timeline-grouped.d.ts +40 -0
- package/dist/smartart/timeline-grouped.js +279 -0
- package/dist/smartart/timeline-grouped.js.map +1 -0
- package/dist/smartart/timeline.d.ts +51 -0
- package/dist/smartart/timeline.js +276 -0
- package/dist/smartart/timeline.js.map +1 -0
- package/dist/smartart/tree-deep.d.ts +61 -0
- package/dist/smartart/tree-deep.js +293 -0
- package/dist/smartart/tree-deep.js.map +1 -0
- package/dist/smartart/tree.d.ts +159 -0
- package/dist/smartart/tree.js +497 -0
- package/dist/smartart/tree.js.map +1 -0
- package/dist/translator/boxes.d.ts +36 -0
- package/dist/translator/boxes.js +95 -0
- package/dist/translator/boxes.js.map +1 -0
- package/dist/translator/canvas.d.ts +82 -0
- package/dist/translator/canvas.js +135 -0
- package/dist/translator/canvas.js.map +1 -0
- package/dist/translator/graph-shapes.d.ts +98 -0
- package/dist/translator/graph-shapes.js +223 -0
- package/dist/translator/graph-shapes.js.map +1 -0
- package/dist/translator/native-chart.d.ts +64 -0
- package/dist/translator/native-chart.js +109 -0
- package/dist/translator/native-chart.js.map +1 -0
- package/dist/translator/ooxml-translator.d.ts +79 -0
- package/dist/translator/ooxml-translator.js +1213 -0
- package/dist/translator/ooxml-translator.js.map +1 -0
- package/dist/translator/path-shape.d.ts +11 -0
- package/dist/translator/path-shape.js +37 -0
- package/dist/translator/path-shape.js.map +1 -0
- package/dist/translator/unsupported-diagram-note.d.ts +16 -0
- package/dist/translator/unsupported-diagram-note.js +34 -0
- package/dist/translator/unsupported-diagram-note.js.map +1 -0
- package/dist/translator/xml-escape.d.ts +28 -0
- package/dist/translator/xml-escape.js +40 -0
- package/dist/translator/xml-escape.js.map +1 -0
- package/dist/types.d.ts +158 -0
- package/dist/types.js +9 -0
- package/dist/types.js.map +1 -0
- package/package.json +42 -0
|
@@ -0,0 +1,558 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SmartArt generator for the `chain` topology (`docs/specs/FUTURE_mmd2smartart_SPEC.md`
|
|
3
|
+
* §7 step 4; classification comes from {@link classifyTopology} in
|
|
4
|
+
* `./classify.ts`, not repeated here).
|
|
5
|
+
*
|
|
6
|
+
* Produces all four OOXML diagram parts a `chain` SmartArt needs:
|
|
7
|
+
* `data`, `layout`, `colors`, `style` (quickStyle). All four are original —
|
|
8
|
+
* none of them are copied from, or byte-derived from, any real Word-emitted
|
|
9
|
+
* file. This is a deliberate, verified constraint, not an implementation
|
|
10
|
+
* shortcut: `docs/adr/0004-smartart-feasibility-spike.md` ("Round 5") shows
|
|
11
|
+
* that reusing Word's own built-in `hierarchy1` algorithm would mean
|
|
12
|
+
* redistributing Microsoft's proprietary algorithm XML in this CC0 public
|
|
13
|
+
* repo — a licensing risk the maintainer explicitly declined — and that a
|
|
14
|
+
* fully self-authored algorithm renders identically in both Word and
|
|
15
|
+
* LibreOffice, provided all four parts below are present together. Omitting
|
|
16
|
+
* any one of them (particularly `colors`/`style`) reproduces the "text
|
|
17
|
+
* renders, no shapes" degradation documented in that same spike.
|
|
18
|
+
*
|
|
19
|
+
* The `layout`/`colors`/`style` XML are constants: they encode the
|
|
20
|
+
* *algorithm*, which does not depend on any particular Mermaid diagram.
|
|
21
|
+
* Only `data` is generated per-diagram, from the chain's ordered node list.
|
|
22
|
+
*/
|
|
23
|
+
import { validateHexColor } from '../translator/xml-escape.js';
|
|
24
|
+
import { buildColorsXml, buildStyleXml } from './styles.js';
|
|
25
|
+
import { DRAWING_EXT_LST_XML, buildDiagramDrawingXml, chainShapes } from './drawing.js';
|
|
26
|
+
import { nodeGeom, presSpPrXml } from './node-shape.js';
|
|
27
|
+
import { boxText, pointTextXml, textLines } from './text.js';
|
|
28
|
+
const DGM_NS = 'http://schemas.openxmlformats.org/drawingml/2006/diagram';
|
|
29
|
+
const A_NS = 'http://schemas.openxmlformats.org/drawingml/2006/main';
|
|
30
|
+
/** `layoutDef` URN for the horizontal (Mermaid `LR`) chain variant. */
|
|
31
|
+
export const CHAIN_LAYOUT_URN = 'urn:md2nativedocx/smartart-layout/chain1';
|
|
32
|
+
/** `layoutDef` URN for the vertical (Mermaid `TD`) chain variant (§ below). */
|
|
33
|
+
export const CHAIN_LAYOUT_TD_URN = 'urn:md2nativedocx/smartart-layout/chain1-td';
|
|
34
|
+
/** `layoutDef` URN for the bottom-to-top (Mermaid `BT`) chain variant (§ below). */
|
|
35
|
+
export const CHAIN_LAYOUT_BT_URN = 'urn:md2nativedocx/smartart-layout/chain1-bt';
|
|
36
|
+
/** `layoutDef` URN for the right-to-left (Mermaid `RL`) chain variant (§ below). */
|
|
37
|
+
export const CHAIN_LAYOUT_RL_URN = 'urn:md2nativedocx/smartart-layout/chain1-rl';
|
|
38
|
+
/**
|
|
39
|
+
* Original `dgm:layoutDef` for a horizontal chain of boxes (`lin` algorithm,
|
|
40
|
+
* one `Main` box per node via `forEach axis="ch"`, one `sibTrans` connector
|
|
41
|
+
* between consecutive items via a nested `forEach axis="followSib"` — round
|
|
42
|
+
* 4 dropped an earlier `composite` wrapper around `Main`, see below).
|
|
43
|
+
* Transcribed from Microsoft's own publicly documented "Basic Block List"
|
|
44
|
+
* tutorial example ("Creating Custom SmartArt Layouts with Office Open XML",
|
|
45
|
+
* learn.microsoft.com/en-us/previous-versions/office/developer/office-2010/gg583880),
|
|
46
|
+
* not from any real Word-emitted diagram — see ADR 0004 "Round 5" for the
|
|
47
|
+
* verification history (`custom-chain1.docx`, confirmed rendering correctly
|
|
48
|
+
* in real Word).
|
|
49
|
+
*
|
|
50
|
+
* The `sibTrans` node uses the public `dgm:alg type="conn"` connector
|
|
51
|
+
* algorithm, `begPts`/`endPts` left as `"auto"` (Word picks the routing) and
|
|
52
|
+
* a `<dgm:shape type="conn"/>` — the special shape-type identifier that
|
|
53
|
+
* tells Word to draw the algorithm's own connector geometry, not a named
|
|
54
|
+
* `prstGeom`. This tutorial's own Basic Block List example has no
|
|
55
|
+
* connectors at all (the gap the maintainer reported after testing the real
|
|
56
|
+
* Word render, 2026-09-05).
|
|
57
|
+
*
|
|
58
|
+
* A first attempt (round 1, `docs/adr/spikes/spike-smartart-connectors/
|
|
59
|
+
* round1-chain-conn/`) reconstructed the `conn` algorithm from Microsoft's
|
|
60
|
+
* public parameter reference alone (`dim="1D"`, explicit `midR`/`midL`
|
|
61
|
+
* points, `begSty`/`endSty`) — schema-valid, but confirmed by the
|
|
62
|
+
* maintainer to render **no visible connector in real Word either**,
|
|
63
|
+
* ruling out "LibreOffice-only limitation" and pointing at an actual
|
|
64
|
+
* wiring defect, the same failure mode ADR 0004 hit reconstructing
|
|
65
|
+
* `hierarchy1` from a tutorial rather than a real sample. Round 2 studied
|
|
66
|
+
* the *structure* (never the content) of a real Word-authored "Processus"
|
|
67
|
+
* SmartArt the maintainer built by hand (`handmade_samples/
|
|
68
|
+
* processus_simple.docx`, real `process1` layout) and found two concrete
|
|
69
|
+
* gaps: the shape needs `type="conn"` (round 1 left it empty,
|
|
70
|
+
* `<dgm:shape/>`), and `begPts`/`endPts` should just be `"auto"` — Word's
|
|
71
|
+
* own layout doesn't hardcode edge points, `dim`, or arrow style at all,
|
|
72
|
+
* relying on `conn`'s own documented defaults (`dim="2D"`, `begSty="noArr"`,
|
|
73
|
+
* `endSty="arr"`). This also means the connector no longer needs a
|
|
74
|
+
* direction-specific point substitution in the TD/BT/RL variants below —
|
|
75
|
+
* `"auto"` routes correctly regardless of the `lin` direction. Confirmed by
|
|
76
|
+
* the maintainer to still render no connector in real Word (round 2,
|
|
77
|
+
* `docs/adr/spikes/spike-smartart-connectors/round2-chain-conn-real-structure/`).
|
|
78
|
+
*
|
|
79
|
+
* Round 3 found the remaining gap: the real layout's `sibTransForEach` is
|
|
80
|
+
* nested **inside** `nodesForEach`, as a sibling of the `node` layoutNode
|
|
81
|
+
* within each iteration — not a separate top-level `forEach` after it, as
|
|
82
|
+
* rounds 1-2 had it. `conn`'s `begPts`/`endPts="auto"` most likely needs
|
|
83
|
+
* that per-iteration scope to resolve "the node this transition follows"
|
|
84
|
+
* against, unlike the plain `sp` spacer this same separate-loop shape
|
|
85
|
+
* previously held (which needs no such relational context, and did render
|
|
86
|
+
* correctly — the pre-connector spacing was never broken). Also added the
|
|
87
|
+
* `sibTrans` layoutNode's own `connDist`/`begPad`/`endPad` constraints
|
|
88
|
+
* (present in the real layout, absent from rounds 1-2) and an empty
|
|
89
|
+
* `r:blip` on its shape, matching the real layout's shape element exactly
|
|
90
|
+
* bar its actual relationship content. First round to render *something*
|
|
91
|
+
* (LibreOffice, round 3), but a squeezed sliver rather than a clean
|
|
92
|
+
* chevron.
|
|
93
|
+
*
|
|
94
|
+
* Round 4: the maintainer opened round 3's own output in real Word and
|
|
95
|
+
* used Word's "Change Layout" gallery to switch it to the real "Processus"
|
|
96
|
+
* (`process1`) layout in place — which regenerates the *data* file's
|
|
97
|
+
* transition points for that real layout while keeping our text and our
|
|
98
|
+
* `colorsDef`/`styleDef` (`docs/adr/spikes/spike-smartart-connectors/
|
|
99
|
+
* round3-chain-conn-nested-foreach/chain-conn_to_processus_simple.docx`).
|
|
100
|
+
* That real-Word-regenerated data file matches our own data shape almost
|
|
101
|
+
* exactly (same `doc`/node/`parTrans`/`sibTrans` pattern) and renders a
|
|
102
|
+
* clean chevron in both Word and LibreOffice — strong indirect evidence our
|
|
103
|
+
* *data* wiring was never the problem. Comparing the real layout's root
|
|
104
|
+
* constraints against ours found the likely remaining cause: the real
|
|
105
|
+
* layout gives `sibTrans` `fact="0.4"` of the node's width (and has no
|
|
106
|
+
* separate `sp` spacing constraint at all, since the connector *is* the
|
|
107
|
+
* spacing); this layout had both a redundant `sp` constraint and a
|
|
108
|
+
* `sibTrans` width of only `fact="0.1"` — four times narrower, plausibly
|
|
109
|
+
* why round 3's shape came out as a squeezed sliver rather than a chevron.
|
|
110
|
+
* Removed the redundant `sp` constraint, raised `sibTrans` to `fact="0.4"`,
|
|
111
|
+
* and matched the real layout's local `h`/`connDist`/`begPad`/`endPad`
|
|
112
|
+
* values on the `sibTrans` layoutNode itself.
|
|
113
|
+
*
|
|
114
|
+
* That width fix rendered a *correct* chevron for the second connector
|
|
115
|
+
* (B→C) under LibreOffice but left the first (A→B) a torn/jagged sliver —
|
|
116
|
+
* same data shape, same layout XML, different result, which pointed at a
|
|
117
|
+
* geometry-solver inconsistency tied to something structural rather than a
|
|
118
|
+
* missing constraint. The one structural difference left between this
|
|
119
|
+
* layout and the real "Processus" one: this layout wraps each box in a
|
|
120
|
+
* `composite` layoutNode (`alg type="composite"`, an aspect-ratio param)
|
|
121
|
+
* with `Main` nested inside it, so `sibTrans`'s "auto"-resolved neighbor was
|
|
122
|
+
* an empty composite *container*, not the actual shape — the real layout
|
|
123
|
+
* has no such wrapper, `sibTrans` sits directly next to `node` (this
|
|
124
|
+
* module's `Main`). Removed the `composite` wrapper entirely: `Main` is now
|
|
125
|
+
* a direct child of `nodesForEach`, its own `h` set via `refType="w"
|
|
126
|
+
* fact="0.6"` in its own `constrLst` (replacing the wrapper's `ar="1.6667"`
|
|
127
|
+
* param with the same ~1.67:1 ratio, applied the way the real layout
|
|
128
|
+
* applies it — directly on the shape, not a wrapping container) — matching
|
|
129
|
+
* the real "Processus" sample's flat `node`/`sibTrans` structure exactly,
|
|
130
|
+
* not just its parameters. Not yet confirmed in real Word.
|
|
131
|
+
*/
|
|
132
|
+
export const CHAIN_LAYOUT_XML = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>' +
|
|
133
|
+
`<dgm:layoutDef xmlns:dgm="${DGM_NS}" xmlns:a="${A_NS}" uniqueId="${CHAIN_LAYOUT_URN}">` +
|
|
134
|
+
'<dgm:title val=""/><dgm:desc val=""/>' +
|
|
135
|
+
'<dgm:catLst><dgm:cat type="list" pri="1"/></dgm:catLst>' +
|
|
136
|
+
'<dgm:sampData useDef="1"><dgm:dataModel><dgm:ptLst/><dgm:bg/><dgm:whole/></dgm:dataModel></dgm:sampData>' +
|
|
137
|
+
'<dgm:styleData useDef="1"><dgm:dataModel><dgm:ptLst/><dgm:bg/><dgm:whole/></dgm:dataModel></dgm:styleData>' +
|
|
138
|
+
'<dgm:clrData useDef="1"><dgm:dataModel><dgm:ptLst/><dgm:bg/><dgm:whole/></dgm:dataModel></dgm:clrData>' +
|
|
139
|
+
'<dgm:layoutNode name="root">' +
|
|
140
|
+
'<dgm:alg type="lin"/><dgm:shape/>' +
|
|
141
|
+
'<dgm:constrLst>' +
|
|
142
|
+
'<dgm:constr op="equ" type="primFontSz" for="des" ptType="node" val="20"/>' +
|
|
143
|
+
'<dgm:constr type="w" for="ch" forName="Main" refType="w"/>' +
|
|
144
|
+
'<dgm:constr op="equ" type="h" for="ch" forName="Main"/>' +
|
|
145
|
+
'<dgm:constr op="equ" type="w" for="ch" forName="sibTrans" refType="w" refFor="ch" refForName="Main" fact="0.4"/>' +
|
|
146
|
+
'<dgm:constr op="equ" type="h" for="ch" forName="sibTrans"/>' +
|
|
147
|
+
'</dgm:constrLst>' +
|
|
148
|
+
'<dgm:forEach name="nodesForEach" axis="ch" ptType="node">' +
|
|
149
|
+
'<dgm:layoutNode name="Main" styleLbl="node1">' +
|
|
150
|
+
'<dgm:alg type="tx"/>' +
|
|
151
|
+
'<dgm:shape type="roundRect"/>' +
|
|
152
|
+
'<dgm:presOf axis="self" ptType="node" st="1" cnt="0"/>' +
|
|
153
|
+
'<dgm:constrLst>' +
|
|
154
|
+
'<dgm:constr type="h" refType="w" fact="0.6"/>' +
|
|
155
|
+
'<dgm:constr type="lMarg" refType="primFontSz" fact="0.15"/>' +
|
|
156
|
+
'<dgm:constr type="rMarg" refType="primFontSz" fact="0.15"/>' +
|
|
157
|
+
'<dgm:constr type="tMarg" refType="primFontSz" fact="0.15"/>' +
|
|
158
|
+
'<dgm:constr type="bMarg" refType="primFontSz" fact="0.15"/>' +
|
|
159
|
+
'</dgm:constrLst>' +
|
|
160
|
+
'<dgm:ruleLst><dgm:rule type="primFontSz" val="5"/></dgm:ruleLst>' +
|
|
161
|
+
'</dgm:layoutNode>' +
|
|
162
|
+
'<dgm:forEach name="sibTransForEach" axis="followSib" ptType="sibTrans" cnt="1">' +
|
|
163
|
+
'<dgm:layoutNode name="sibTrans" styleLbl="sibTrans">' +
|
|
164
|
+
'<dgm:alg type="conn">' +
|
|
165
|
+
'<dgm:param type="begPts" val="auto"/>' +
|
|
166
|
+
'<dgm:param type="endPts" val="auto"/>' +
|
|
167
|
+
'</dgm:alg>' +
|
|
168
|
+
'<dgm:shape xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" type="conn" r:blip=""/>' +
|
|
169
|
+
'<dgm:presOf axis="self"/>' +
|
|
170
|
+
'<dgm:constrLst>' +
|
|
171
|
+
'<dgm:constr type="h" refType="w" fact="0.62"/>' +
|
|
172
|
+
'<dgm:constr type="connDist"/>' +
|
|
173
|
+
'<dgm:constr type="begPad" refType="connDist" fact="0.25"/>' +
|
|
174
|
+
'<dgm:constr type="endPad" refType="connDist" fact="0.22"/>' +
|
|
175
|
+
'</dgm:constrLst>' +
|
|
176
|
+
'</dgm:layoutNode>' +
|
|
177
|
+
'</dgm:forEach>' +
|
|
178
|
+
'</dgm:forEach>' +
|
|
179
|
+
'</dgm:layoutNode>' +
|
|
180
|
+
'</dgm:layoutDef>';
|
|
181
|
+
/**
|
|
182
|
+
* The vertical (Mermaid `TD`) variant of {@link CHAIN_LAYOUT_XML}: identical
|
|
183
|
+
* except for its `uniqueId` and a `<dgm:param type="linDir" val="fromT"/>` on
|
|
184
|
+
* the root `lin` algorithm, which switches its stacking axis from
|
|
185
|
+
* left-to-right (the format's own default) to top-to-bottom. Derived by
|
|
186
|
+
* string substitution rather than duplicated by hand, so the two variants
|
|
187
|
+
* can never drift apart on anything but direction. Verified this session by
|
|
188
|
+
* rendering the substituted XML under headless LibreOffice — three boxes
|
|
189
|
+
* stacked vertically, spacing/styling otherwise identical to the horizontal
|
|
190
|
+
* variant.
|
|
191
|
+
*
|
|
192
|
+
* Before this, neither `chain.ts` nor `tree.ts` (below) read
|
|
193
|
+
* `flowchart.direction` at all — every chain rendered horizontally
|
|
194
|
+
* regardless of the Mermaid source's `TD`/`LR`, a gap first written up in
|
|
195
|
+
* `docs/markdown-mermaid-compliance-table.md`.
|
|
196
|
+
*/
|
|
197
|
+
export const CHAIN_LAYOUT_XML_TD = CHAIN_LAYOUT_XML.replace(`uniqueId="${CHAIN_LAYOUT_URN}"`, `uniqueId="${CHAIN_LAYOUT_TD_URN}"`).replace('<dgm:alg type="lin"/>', '<dgm:alg type="lin"><dgm:param type="linDir" val="fromT"/></dgm:alg>');
|
|
198
|
+
/**
|
|
199
|
+
* The bottom-to-top (Mermaid `BT`) variant: same vertical stacking as
|
|
200
|
+
* {@link CHAIN_LAYOUT_XML_TD}, `linDir="fromB"` instead of `"fromT"` — the
|
|
201
|
+
* `lin` algorithm's four documented directions are `fromL` (the format's own
|
|
202
|
+
* default, used by {@link CHAIN_LAYOUT_XML}), `fromR`, `fromT`, `fromB`
|
|
203
|
+
* (ECMA-376 §5.9). Derived by substitution from the `TD` variant rather than
|
|
204
|
+
* `CHAIN_LAYOUT_XML` directly, so it only ever differs from `TD` by this one
|
|
205
|
+
* parameter.
|
|
206
|
+
*/
|
|
207
|
+
export const CHAIN_LAYOUT_XML_BT = CHAIN_LAYOUT_XML_TD.replace(`uniqueId="${CHAIN_LAYOUT_TD_URN}"`, `uniqueId="${CHAIN_LAYOUT_BT_URN}"`).replace('val="fromT"', 'val="fromB"');
|
|
208
|
+
/**
|
|
209
|
+
* The right-to-left (Mermaid `RL`) variant: same horizontal stacking as
|
|
210
|
+
* {@link CHAIN_LAYOUT_XML}, `linDir="fromR"` instead of the format's implicit
|
|
211
|
+
* `fromL` default.
|
|
212
|
+
*/
|
|
213
|
+
export const CHAIN_LAYOUT_XML_RL = CHAIN_LAYOUT_XML.replace(`uniqueId="${CHAIN_LAYOUT_URN}"`, `uniqueId="${CHAIN_LAYOUT_RL_URN}"`).replace('<dgm:alg type="lin"/>', '<dgm:alg type="lin"><dgm:param type="linDir" val="fromR"/></dgm:alg>');
|
|
214
|
+
/**
|
|
215
|
+
* Original `dgm:colorsDef` — `node0`/`node1` (used by {@link CHAIN_LAYOUT_XML}'s
|
|
216
|
+
* `Main` layoutNode) with plain solid fills, plus `sibTrans` (used by its
|
|
217
|
+
* connector layoutNode) with the same solid `fillClrLst` — the `conn`
|
|
218
|
+
* algorithm defaults to `dim="2D"` (a filled chevron-style shape, not a
|
|
219
|
+
* thin line), confirmed by studying a real Word-authored "Processus"
|
|
220
|
+
* SmartArt's `layout1.xml` (`handmade_samples/processus_simple.docx`,
|
|
221
|
+
* structure only, see {@link CHAIN_LAYOUT_XML}'s doc comment).
|
|
222
|
+
* Written directly from the public ECMA-376/Open-XML-SDK schema
|
|
223
|
+
* (`ColorsDefinition`/`ColorTransformStyleLabel` classes), not extracted
|
|
224
|
+
* from any real Word document — verified in `custom-chain1-ownercolors.docx`
|
|
225
|
+
* (ADR 0004 "Round 5").
|
|
226
|
+
*/
|
|
227
|
+
export const CHAIN_COLORS_XML = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>' +
|
|
228
|
+
`<dgm:colorsDef xmlns:dgm="${DGM_NS}" xmlns:a="${A_NS}" uniqueId="urn:md2nativedocx/smartart-colors/chain1" minVer="12.0">` +
|
|
229
|
+
'<dgm:title val=""/><dgm:desc val=""/>' +
|
|
230
|
+
'<dgm:catLst><dgm:cat type="mainScheme" pri="1"/></dgm:catLst>' +
|
|
231
|
+
'<dgm:styleLbl name="node0">' +
|
|
232
|
+
'<dgm:fillClrLst><a:schemeClr val="accent1"/></dgm:fillClrLst>' +
|
|
233
|
+
'<dgm:linClrLst><a:schemeClr val="accent1"><a:shade val="75000"/></a:schemeClr></dgm:linClrLst>' +
|
|
234
|
+
'<dgm:effectClrLst/><dgm:txLinClrLst/>' +
|
|
235
|
+
'<dgm:txFillClrLst><a:schemeClr val="bg1"/></dgm:txFillClrLst>' +
|
|
236
|
+
'<dgm:txEffectClrLst/>' +
|
|
237
|
+
'</dgm:styleLbl>' +
|
|
238
|
+
'<dgm:styleLbl name="node1">' +
|
|
239
|
+
'<dgm:fillClrLst><a:schemeClr val="accent1"/></dgm:fillClrLst>' +
|
|
240
|
+
'<dgm:linClrLst><a:schemeClr val="accent1"><a:shade val="75000"/></a:schemeClr></dgm:linClrLst>' +
|
|
241
|
+
'<dgm:effectClrLst/><dgm:txLinClrLst/>' +
|
|
242
|
+
'<dgm:txFillClrLst><a:schemeClr val="bg1"/></dgm:txFillClrLst>' +
|
|
243
|
+
'<dgm:txEffectClrLst/>' +
|
|
244
|
+
'</dgm:styleLbl>' +
|
|
245
|
+
'<dgm:styleLbl name="sibTrans">' +
|
|
246
|
+
'<dgm:fillClrLst><a:schemeClr val="accent1"><a:shade val="75000"/></a:schemeClr></dgm:fillClrLst>' +
|
|
247
|
+
'<dgm:linClrLst/>' +
|
|
248
|
+
'<dgm:effectClrLst/><dgm:txLinClrLst/><dgm:txFillClrLst/><dgm:txEffectClrLst/>' +
|
|
249
|
+
'</dgm:styleLbl>' +
|
|
250
|
+
'</dgm:colorsDef>';
|
|
251
|
+
/**
|
|
252
|
+
* Original `dgm:styleDef` — `node0`/`node1`, each a plain
|
|
253
|
+
* `lnRef`/`fillRef`/`effectRef`/`fontRef` reference into the host document's
|
|
254
|
+
* theme (the same reference-based style vocabulary `ooxml-translator.ts`
|
|
255
|
+
* already uses for `wps:style` in the `.docx` shape translator), plus
|
|
256
|
+
* `sibTrans` for the connector arrow: `fillRef idx="1"` (visible solid
|
|
257
|
+
* fill — the connector is a filled 2D shape, see {@link CHAIN_COLORS_XML}'s
|
|
258
|
+
* doc comment) and `lnRef idx="0"` (no border, same as `node0`/`node1`).
|
|
259
|
+
* Verified in `custom-chain1-ownerstyle.docx` (ADR 0004 "Round 5") — renders
|
|
260
|
+
* identically to Word's own `quickStyle1.xml`.
|
|
261
|
+
*/
|
|
262
|
+
export const CHAIN_STYLE_XML = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>' +
|
|
263
|
+
`<dgm:styleDef xmlns:dgm="${DGM_NS}" xmlns:a="${A_NS}" uniqueId="urn:md2nativedocx/smartart-quickstyle/chain1" minVer="12.0">` +
|
|
264
|
+
'<dgm:title val=""/><dgm:desc val=""/>' +
|
|
265
|
+
'<dgm:catLst><dgm:cat type="simple" pri="1"/></dgm:catLst>' +
|
|
266
|
+
'<dgm:styleLbl name="node0">' +
|
|
267
|
+
'<dgm:style>' +
|
|
268
|
+
'<a:lnRef idx="0"><a:schemeClr val="accent1"/></a:lnRef>' +
|
|
269
|
+
'<a:fillRef idx="1"><a:schemeClr val="accent1"/></a:fillRef>' +
|
|
270
|
+
'<a:effectRef idx="0"><a:schemeClr val="accent1"/></a:effectRef>' +
|
|
271
|
+
'<a:fontRef idx="minor"><a:schemeClr val="lt1"/></a:fontRef>' +
|
|
272
|
+
'</dgm:style>' +
|
|
273
|
+
'</dgm:styleLbl>' +
|
|
274
|
+
'<dgm:styleLbl name="node1">' +
|
|
275
|
+
'<dgm:style>' +
|
|
276
|
+
'<a:lnRef idx="0"><a:schemeClr val="accent1"/></a:lnRef>' +
|
|
277
|
+
'<a:fillRef idx="1"><a:schemeClr val="accent1"/></a:fillRef>' +
|
|
278
|
+
'<a:effectRef idx="0"><a:schemeClr val="accent1"/></a:effectRef>' +
|
|
279
|
+
'<a:fontRef idx="minor"><a:schemeClr val="lt1"/></a:fontRef>' +
|
|
280
|
+
'</dgm:style>' +
|
|
281
|
+
'</dgm:styleLbl>' +
|
|
282
|
+
'<dgm:styleLbl name="sibTrans">' +
|
|
283
|
+
'<dgm:style>' +
|
|
284
|
+
'<a:lnRef idx="0"><a:schemeClr val="accent1"/></a:lnRef>' +
|
|
285
|
+
'<a:fillRef idx="1"><a:schemeClr val="accent1"/></a:fillRef>' +
|
|
286
|
+
'<a:effectRef idx="0"><a:schemeClr val="accent1"/></a:effectRef>' +
|
|
287
|
+
'<a:fontRef idx="minor"><a:schemeClr val="tx1"/></a:fontRef>' +
|
|
288
|
+
'</dgm:style>' +
|
|
289
|
+
'</dgm:styleLbl>' +
|
|
290
|
+
'</dgm:styleDef>';
|
|
291
|
+
/**
|
|
292
|
+
* Order a `chain`-classified flowchart's nodes from start to end, by
|
|
293
|
+
* following `from -> to` edges starting at the node with no incoming edge.
|
|
294
|
+
* Assumes the flowchart has already been confirmed `chain`-eligible by
|
|
295
|
+
* {@link classifyTopology} in `./classify.ts` (every node in-degree/out-degree
|
|
296
|
+
* <= 1, connected, exactly one node with in-degree 0) — this function does
|
|
297
|
+
* not re-validate that, it would misorder or drop nodes silently on a
|
|
298
|
+
* flowchart that doesn't actually satisfy it.
|
|
299
|
+
*/
|
|
300
|
+
function orderedChainNodes(flowchart) {
|
|
301
|
+
const byId = new Map(flowchart.nodes.map((n) => [n.id, n]));
|
|
302
|
+
const nextId = new Map(flowchart.edges.map((e) => [e.from, e.to]));
|
|
303
|
+
const hasIncoming = new Set(flowchart.edges.map((e) => e.to));
|
|
304
|
+
const startNode = flowchart.nodes.find((n) => !hasIncoming.has(n.id));
|
|
305
|
+
if (!startNode) {
|
|
306
|
+
throw new Error('orderedChainNodes: no node with in-degree 0 -- flowchart is not a valid chain');
|
|
307
|
+
}
|
|
308
|
+
const ordered = [];
|
|
309
|
+
let currentId = startNode.id;
|
|
310
|
+
while (currentId !== undefined) {
|
|
311
|
+
const node = byId.get(currentId);
|
|
312
|
+
if (!node)
|
|
313
|
+
break;
|
|
314
|
+
ordered.push(node);
|
|
315
|
+
currentId = nextId.get(currentId);
|
|
316
|
+
}
|
|
317
|
+
return ordered;
|
|
318
|
+
}
|
|
319
|
+
/**
|
|
320
|
+
* Map each node id to the label of the (single, since `chain` guarantees
|
|
321
|
+
* in-degree <= 1) edge that leads into it, if that edge has one. Used to
|
|
322
|
+
* apply the spec §5.2 convention below — an edge label has no native
|
|
323
|
+
* SmartArt connector to sit on, so it's folded into the destination node's
|
|
324
|
+
* own text instead.
|
|
325
|
+
*/
|
|
326
|
+
function incomingLabelByNodeId(flowchart) {
|
|
327
|
+
const labels = new Map();
|
|
328
|
+
for (const edge of flowchart.edges) {
|
|
329
|
+
if (edge.label)
|
|
330
|
+
labels.set(edge.to, edge.label);
|
|
331
|
+
}
|
|
332
|
+
return labels;
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* Build the `dgm:dataModel` for a chain of `nodes`, including the hand-built
|
|
336
|
+
* `presOf`/`presParOf` presentation mirror {@link CHAIN_LAYOUT_XML}'s own
|
|
337
|
+
* `root`/`Main` layoutNodes need to render under LibreOffice
|
|
338
|
+
* (ADR 0004 "Round 5" — Word alone can resolve this dynamically via
|
|
339
|
+
* `forEach`, but LibreOffice does not execute `forEach`/`presOf` and only
|
|
340
|
+
* displays whatever presentation mirror is already present in the data).
|
|
341
|
+
*
|
|
342
|
+
* modelIds are synthetic sequential integers (content nodes `"0"`, `"1"`,
|
|
343
|
+
* `"2"`... continued by presentation points and connections) rather than
|
|
344
|
+
* derived from the Mermaid node ids — simpler to keep XML-attribute-safe.
|
|
345
|
+
* Must be numeric (or a GUID): `ST_ModelId` (ECMA-376 §21.4) rejects an
|
|
346
|
+
* arbitrary string like the `"p-root"`/`"c1"`/`"po0"` scheme this module
|
|
347
|
+
* used before — a real schema violation (found with the Open XML SDK's
|
|
348
|
+
* `OpenXmlValidator`, the validator real Word enforces strictly) that this
|
|
349
|
+
* project's own tooling never caught: not well-formedness (still valid
|
|
350
|
+
* XML), not LibreOffice (renders it anyway, no schema validation at all).
|
|
351
|
+
* This — not any missing `dsp:drawing` fallback — was the actual cause of
|
|
352
|
+
* TODO.md's "Incident SmartArt 'cycle' cassé en Word réel" (ADR 0006).
|
|
353
|
+
* ADR 0004 "Round 3"'s finding that "modelId format has no effect on
|
|
354
|
+
* rendering" was only ever verified under LibreOffice. Node text is the
|
|
355
|
+
* only user-controlled content and is XML-escaped (rule #2).
|
|
356
|
+
*
|
|
357
|
+
* Includes a `presOf` connector from the `doc` point itself to `p-root` (in
|
|
358
|
+
* addition to the per-node `presOf`s onto each `p-main*`) even though the
|
|
359
|
+
* doc point carries no text: LibreOffice renders a fully blank diagram
|
|
360
|
+
* (correct XML shape, zero visible output) without it, discovered by
|
|
361
|
+
* rendering this function's own output under headless LibreOffice rather
|
|
362
|
+
* than only asserting on the XML string, which had been this module's only
|
|
363
|
+
* verification up to that point.
|
|
364
|
+
*
|
|
365
|
+
* Two more things folded in here, both verified by rendering the actual
|
|
366
|
+
* output under headless LibreOffice rather than by XML-structure tests
|
|
367
|
+
* alone (session that built `docs/markdown-mermaid-compliance-table.md`):
|
|
368
|
+
* - `edge.label` (spec §5.2 convention): prefixed as `"label : "` onto the
|
|
369
|
+
* destination node's own text, since SmartArt has no connector text box
|
|
370
|
+
* and we don't control connector geometry to place a floating one.
|
|
371
|
+
* - `node.fill` (from `classDef`): written as an `a:solidFill` on the
|
|
372
|
+
* **content** point's own `dgm:spPr` — confirmed this session to render
|
|
373
|
+
* correctly under LibreOffice, unlike the identical override attempted on
|
|
374
|
+
* a *presentation* point in ADR 0004 "Round 5" ("no visual effect"). A
|
|
375
|
+
* matching `a:prstGeom` shape override on this same content-point `spPr`
|
|
376
|
+
* was tested the same way and confirmed **not** to render (stays
|
|
377
|
+
* `roundRect` regardless) — not attempted here for that reason.
|
|
378
|
+
*
|
|
379
|
+
* One `sibTrans`-typed content point per gap between consecutive nodes (N-1
|
|
380
|
+
* for N nodes, none after the last one — matches {@link CHAIN_LAYOUT_XML}'s
|
|
381
|
+
* `axis="followSib"` forEach literally: only a node with a *following*
|
|
382
|
+
* sibling has a transition), each mirrored into its own presentation point
|
|
383
|
+
* exactly like a node's `Main` mirror above.
|
|
384
|
+
*
|
|
385
|
+
* Each `sibTrans` point is paired with its own `parTrans` point (unused by
|
|
386
|
+
* this layout, which has no hierarchy to speak of, but still required —
|
|
387
|
+
* round 1 of this connector's implementation
|
|
388
|
+
* (`docs/adr/spikes/spike-smartart-connectors/round1-chain-conn/`) wired
|
|
389
|
+
* `sibTransId` alone and rendered no connector in real Word either;
|
|
390
|
+
* studying a real Word-authored "Processus" SmartArt's data file
|
|
391
|
+
* (`handmade_samples/processus_simple.docx`, structure only, never its
|
|
392
|
+
* content) showed every `sibTransId`-bearing `parOf` cxn also carries a
|
|
393
|
+
* `parTransId`, always in that pair) — both set as attributes on the
|
|
394
|
+
* preceding node's own `parOf` cxn, the association mechanism a real
|
|
395
|
+
* Word-authored data file uses to tell the layout which transition point
|
|
396
|
+
* belongs to which edge.
|
|
397
|
+
*/
|
|
398
|
+
function buildChainDataXml(flowchart, nodes, layoutUrn, withDrawing, style, aspect) {
|
|
399
|
+
const docId = '0';
|
|
400
|
+
const nodeIds = nodes.map((_, i) => String(i + 1));
|
|
401
|
+
const incomingLabel = incomingLabelByNodeId(flowchart);
|
|
402
|
+
let nextModelId = nodes.length + 1;
|
|
403
|
+
const newModelId = () => String(nextModelId++);
|
|
404
|
+
const pRootId = newModelId();
|
|
405
|
+
const pMainIds = new Map(nodeIds.map((id) => [id, newModelId()]));
|
|
406
|
+
// One transition per gap between consecutive nodes -- none after the last.
|
|
407
|
+
const sibTransIds = nodeIds.slice(0, -1).map(() => newModelId());
|
|
408
|
+
const parTransIds = sibTransIds.map(() => newModelId());
|
|
409
|
+
const pSibTransIds = sibTransIds.map(() => newModelId());
|
|
410
|
+
// Interleaved per node (text, then its own parTrans/sibTrans pair if it
|
|
411
|
+
// has a following sibling) rather than grouped by kind -- matches the
|
|
412
|
+
// physical ptLst order of a real Word-authored data file
|
|
413
|
+
// (`handmade_samples/processus_simple.docx`) exactly, in case Word's
|
|
414
|
+
// engine relies on document order for anything beyond the cxnLst graph.
|
|
415
|
+
const contentPts = nodes
|
|
416
|
+
.map((node, i) => {
|
|
417
|
+
const label = incomingLabel.get(node.id);
|
|
418
|
+
const text = boxText(node, label);
|
|
419
|
+
const fill = validateHexColor(node.fill, '');
|
|
420
|
+
const spPr = fill
|
|
421
|
+
? `<dgm:spPr><a:solidFill><a:srgbClr val="${fill}"/></a:solidFill></dgm:spPr>`
|
|
422
|
+
: '<dgm:spPr/>';
|
|
423
|
+
const nodePt = `<dgm:pt modelId="${nodeIds[i]}"><dgm:prSet phldrT="[Texte]"/>${spPr}${pointTextXml(text)}</dgm:pt>`;
|
|
424
|
+
const parTransId = parTransIds[i];
|
|
425
|
+
const sibTransId = sibTransIds[i];
|
|
426
|
+
const transPts = parTransId && sibTransId
|
|
427
|
+
? `<dgm:pt modelId="${parTransId}" type="parTrans"><dgm:prSet/></dgm:pt>` +
|
|
428
|
+
`<dgm:pt modelId="${sibTransId}" type="sibTrans"><dgm:prSet/></dgm:pt>`
|
|
429
|
+
: '';
|
|
430
|
+
return nodePt + transPts;
|
|
431
|
+
})
|
|
432
|
+
.join('');
|
|
433
|
+
const presPts = `<dgm:pt modelId="${pRootId}" type="pres"><dgm:prSet presAssocID="${docId}" presName="root" presStyleCnt="0"/><dgm:spPr/></dgm:pt>` +
|
|
434
|
+
nodeIds
|
|
435
|
+
.map((id, i) => `<dgm:pt modelId="${pMainIds.get(id)}" type="pres"><dgm:prSet presAssocID="${id}" presName="Main" presStyleLbl="node1" presStyleIdx="${i}" presStyleCnt="${nodeIds.length}"/>${presSpPrXml(nodeGeom(nodes[i]))}</dgm:pt>`)
|
|
436
|
+
.join('') +
|
|
437
|
+
sibTransIds
|
|
438
|
+
.map((id, i) => `<dgm:pt modelId="${pSibTransIds[i]}" type="pres"><dgm:prSet presAssocID="${id}" presName="sibTrans" presStyleLbl="sibTrans" presStyleIdx="${i}" presStyleCnt="${sibTransIds.length}"/><dgm:spPr/></dgm:pt>`)
|
|
439
|
+
.join('');
|
|
440
|
+
const parOfCxns = nodeIds
|
|
441
|
+
.map((id, i) => {
|
|
442
|
+
const sibTransId = sibTransIds[i];
|
|
443
|
+
const transAttrs = sibTransId ? ` parTransId="${parTransIds[i]}" sibTransId="${sibTransId}"` : '';
|
|
444
|
+
return `<dgm:cxn modelId="${newModelId()}" type="parOf" srcId="${docId}" destId="${id}" srcOrd="${i}" destOrd="0"${transAttrs}/>`;
|
|
445
|
+
})
|
|
446
|
+
.join('');
|
|
447
|
+
const presOfCxns = `<dgm:cxn modelId="${newModelId()}" type="presOf" srcId="${docId}" destId="${pRootId}" srcOrd="0" destOrd="0" presId="${layoutUrn}"/>` +
|
|
448
|
+
nodeIds
|
|
449
|
+
.map((id) => `<dgm:cxn modelId="${newModelId()}" type="presOf" srcId="${id}" destId="${pMainIds.get(id)}" srcOrd="0" destOrd="0" presId="${layoutUrn}"/>`)
|
|
450
|
+
.join('') +
|
|
451
|
+
sibTransIds
|
|
452
|
+
.map((id, i) => `<dgm:cxn modelId="${newModelId()}" type="presOf" srcId="${id}" destId="${pSibTransIds[i]}" srcOrd="0" destOrd="0" presId="${layoutUrn}"/>`)
|
|
453
|
+
.join('');
|
|
454
|
+
// Interleaved so the presentation tree's child order matches the visual
|
|
455
|
+
// order (Main, transition, Main, transition, ...) -- root's own presParOf
|
|
456
|
+
// srcOrd is a single sequence across every kind of child, not per-kind.
|
|
457
|
+
// All direct children of root's own presentation point (no intermediate
|
|
458
|
+
// "composite" layer), matching the real Word "Processus" sample's flat
|
|
459
|
+
// node/sibTrans structure exactly (round 4).
|
|
460
|
+
let presParOfOrd = 0;
|
|
461
|
+
const presParOfCxns = nodeIds
|
|
462
|
+
.map((id, i) => {
|
|
463
|
+
const main = `<dgm:cxn modelId="${newModelId()}" type="presParOf" srcId="${pRootId}" destId="${pMainIds.get(id)}" srcOrd="${presParOfOrd++}" destOrd="0" presId="${layoutUrn}"/>`;
|
|
464
|
+
const transition = i < sibTransIds.length
|
|
465
|
+
? `<dgm:cxn modelId="${newModelId()}" type="presParOf" srcId="${pRootId}" destId="${pSibTransIds[i]}" srcOrd="${presParOfOrd++}" destOrd="0" presId="${layoutUrn}"/>`
|
|
466
|
+
: '';
|
|
467
|
+
return main + transition;
|
|
468
|
+
})
|
|
469
|
+
.join('');
|
|
470
|
+
const xml = ('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>' +
|
|
471
|
+
`<dgm:dataModel xmlns:dgm="${DGM_NS}" xmlns:a="${A_NS}">` +
|
|
472
|
+
`<dgm:ptLst><dgm:pt modelId="${docId}" type="doc"><dgm:prSet ` +
|
|
473
|
+
`loTypeId="${layoutUrn}" loCatId="list" ` +
|
|
474
|
+
'qsTypeId="urn:md2nativedocx/smartart-quickstyle/chain1" qsCatId="simple" ' +
|
|
475
|
+
'csTypeId="urn:md2nativedocx/smartart-colors/chain1" csCatId="accent1"/></dgm:pt>' +
|
|
476
|
+
contentPts +
|
|
477
|
+
presPts +
|
|
478
|
+
`</dgm:ptLst><dgm:cxnLst>${parOfCxns}${presOfCxns}${presParOfCxns}</dgm:cxnLst>` +
|
|
479
|
+
`<dgm:bg/><dgm:whole/>${withDrawing ? DRAWING_EXT_LST_XML : ''}</dgm:dataModel>`);
|
|
480
|
+
if (!withDrawing)
|
|
481
|
+
return { xml };
|
|
482
|
+
const drawingXml = buildDiagramDrawingXml(chainShapes(flowchart.direction, nodes.map((node, i) => {
|
|
483
|
+
const label = incomingLabel.get(node.id);
|
|
484
|
+
const fill = validateHexColor(node.fill, '');
|
|
485
|
+
return {
|
|
486
|
+
id: pMainIds.get(nodeIds[i]),
|
|
487
|
+
text: boxText(node, label),
|
|
488
|
+
...(nodeGeom(node) ? { geom: nodeGeom(node) } : {}),
|
|
489
|
+
...(fill ? { fill } : {}),
|
|
490
|
+
};
|
|
491
|
+
}), pSibTransIds, style, aspect), style);
|
|
492
|
+
return { xml, drawingXml };
|
|
493
|
+
}
|
|
494
|
+
/** Box height / width of every chain layout above. */
|
|
495
|
+
const CHAIN_BOX_ASPECT = 0.6;
|
|
496
|
+
/**
|
|
497
|
+
* Box height / width for `nodes`: the layouts' 0.6, or taller when a box holds three or more lines (a
|
|
498
|
+
* `<br/>` label, a timeline period and its events) — 0.3 per line, at most 1.6.
|
|
499
|
+
*/
|
|
500
|
+
function chainBoxAspect(flowchart, nodes) {
|
|
501
|
+
const incoming = incomingLabelByNodeId(flowchart);
|
|
502
|
+
const lines = Math.max(1, ...nodes.map((n) => textLines(boxText(n, incoming.get(n.id))).length));
|
|
503
|
+
return lines < 3 ? CHAIN_BOX_ASPECT : Math.min(1.6, Math.round(lines * 3) / 10);
|
|
504
|
+
}
|
|
505
|
+
/**
|
|
506
|
+
* A chain layout with taller boxes: only the box `h`/`w` constraint changes, under its own `uniqueId`
|
|
507
|
+
* (`…-h120` for 1.2) since a document keeps one definition per layout id.
|
|
508
|
+
*/
|
|
509
|
+
function tallChainLayout(base, aspect) {
|
|
510
|
+
const layoutUrn = `${base.layoutUrn}-h${Math.round(aspect * 100)}`;
|
|
511
|
+
const layoutXml = base.layoutXml
|
|
512
|
+
.replace(`uniqueId="${base.layoutUrn}"`, `uniqueId="${layoutUrn}"`)
|
|
513
|
+
.replace(`<dgm:constr type="h" refType="w" fact="${CHAIN_BOX_ASPECT}"/>`, `<dgm:constr type="h" refType="w" fact="${aspect}"/>`);
|
|
514
|
+
return { layoutXml, layoutUrn };
|
|
515
|
+
}
|
|
516
|
+
/** Maps `flowchart.direction` to the matching layout XML/URN pair. */
|
|
517
|
+
const CHAIN_LAYOUT_BY_DIRECTION = {
|
|
518
|
+
LR: { layoutXml: CHAIN_LAYOUT_XML, layoutUrn: CHAIN_LAYOUT_URN },
|
|
519
|
+
TD: { layoutXml: CHAIN_LAYOUT_XML_TD, layoutUrn: CHAIN_LAYOUT_TD_URN },
|
|
520
|
+
BT: { layoutXml: CHAIN_LAYOUT_XML_BT, layoutUrn: CHAIN_LAYOUT_BT_URN },
|
|
521
|
+
RL: { layoutXml: CHAIN_LAYOUT_XML_RL, layoutUrn: CHAIN_LAYOUT_RL_URN },
|
|
522
|
+
};
|
|
523
|
+
/**
|
|
524
|
+
* Generate a `chain` SmartArt's four diagram parts for `flowchart`.
|
|
525
|
+
*
|
|
526
|
+
* `flowchart` must already have been classified `chain` by
|
|
527
|
+
* {@link classifyTopology} (`./classify.ts`) — this function does not
|
|
528
|
+
* re-run that check, and produces undefined results (or throws, via
|
|
529
|
+
* {@link orderedChainNodes}) on a flowchart that isn't actually a simple
|
|
530
|
+
* path.
|
|
531
|
+
*
|
|
532
|
+
* Picks one of the four layout variants ({@link CHAIN_LAYOUT_XML} for `LR`,
|
|
533
|
+
* {@link CHAIN_LAYOUT_XML_TD} for `TD`, {@link CHAIN_LAYOUT_XML_BT} for `BT`,
|
|
534
|
+
* {@link CHAIN_LAYOUT_XML_RL} for `RL`) from `flowchart.direction` — before
|
|
535
|
+
* this, the generator always emitted the horizontal layout, regardless of
|
|
536
|
+
* the Mermaid source's own direction (see
|
|
537
|
+
* `docs/markdown-mermaid-compliance-table.md`).
|
|
538
|
+
*/
|
|
539
|
+
export function generateChain(flowchart, options = {}) {
|
|
540
|
+
const style = options.style ?? 'simple';
|
|
541
|
+
const nodes = orderedChainNodes(flowchart);
|
|
542
|
+
const aspect = chainBoxAspect(flowchart, nodes);
|
|
543
|
+
const base = CHAIN_LAYOUT_BY_DIRECTION[flowchart.direction];
|
|
544
|
+
const { layoutXml, layoutUrn } = aspect === CHAIN_BOX_ASPECT ? base : tallChainLayout(base, aspect);
|
|
545
|
+
const data = buildChainDataXml(flowchart, nodes, layoutUrn, options.drawing === true, style, aspect);
|
|
546
|
+
return {
|
|
547
|
+
dataXml: data.xml,
|
|
548
|
+
layoutXml,
|
|
549
|
+
colorsXml: style === 'simple'
|
|
550
|
+
? CHAIN_COLORS_XML
|
|
551
|
+
: buildColorsXml(style, 'urn:md2nativedocx/smartart-colors/chain1', ['node0', 'node1', 'sibTrans']),
|
|
552
|
+
styleXml: style === 'simple'
|
|
553
|
+
? CHAIN_STYLE_XML
|
|
554
|
+
: buildStyleXml(style, 'urn:md2nativedocx/smartart-quickstyle/chain1', ['node0', 'node1', 'sibTrans']),
|
|
555
|
+
...(data.drawingXml !== undefined ? { drawingXml: data.drawingXml } : {}),
|
|
556
|
+
};
|
|
557
|
+
}
|
|
558
|
+
//# sourceMappingURL=chain.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chain.js","sourceRoot":"","sources":["../../src/smartart/chain.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,aAAa,EAAsB,MAAM,aAAa,CAAC;AAChF,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAExF,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAgB7D,MAAM,MAAM,GAAG,0DAA0D,CAAC;AAC1E,MAAM,IAAI,GAAG,uDAAuD,CAAC;AAErE,uEAAuE;AACvE,MAAM,CAAC,MAAM,gBAAgB,GAAG,0CAA0C,CAAC;AAC3E,+EAA+E;AAC/E,MAAM,CAAC,MAAM,mBAAmB,GAAG,6CAA6C,CAAC;AACjF,oFAAoF;AACpF,MAAM,CAAC,MAAM,mBAAmB,GAAG,6CAA6C,CAAC;AACjF,oFAAoF;AACpF,MAAM,CAAC,MAAM,mBAAmB,GAAG,6CAA6C,CAAC;AAEjF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6FG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAC3B,yDAAyD;IACzD,6BAA6B,MAAM,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