@helping-ai-workflow/md2doc 3.4.2 → 3.5.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/lib/editor/wave-codec.js +618 -1
- package/lib/editor/wave-geometry.js +183 -0
- package/lib/editor/wave-store.js +28 -1
- package/lib/editor/wave-ui.js +1960 -31
- package/lib/md2doc.js +143 -5
- package/package.json +1 -1
package/lib/md2doc.js
CHANGED
|
@@ -1677,8 +1677,24 @@ ${itemsHtml}
|
|
|
1677
1677
|
padding: 3px 8px; font-size: 12px; cursor: pointer;
|
|
1678
1678
|
}
|
|
1679
1679
|
.ed-wave-toolbar button:disabled { opacity: .45; cursor: default; }
|
|
1680
|
+
/* v3.5.0 Task 7: the 關聯線 arm button, armed or mid-drag. Same on/off
|
|
1681
|
+
treatment as .ed-wave-brush.is-on above — a picked tool reads the same
|
|
1682
|
+
way whichever toolbar it lives in. */
|
|
1683
|
+
.ed-wave-edge-arm.is-on { background: #1a73e8; color: #fff; border-color: #1a73e8; }
|
|
1680
1684
|
.ed-wave-metafield { display: flex; align-items: center; gap: 4px; font-size: 12px; }
|
|
1681
1685
|
.ed-wave-metafield input { width: 110px; font-size: 12px; padding: 2px 4px; }
|
|
1686
|
+
/* v3.5.0 Task 6 fix round 2: with no rule at all this is a flex item inside
|
|
1687
|
+
.ed-wave-toolbar (display:flex; flex-wrap:wrap) that sizes to content, so
|
|
1688
|
+
its three controls squeeze against whichever control precedes them
|
|
1689
|
+
instead of forming their own row. The two property groups below are not
|
|
1690
|
+
new values invented for this rule: display/flex-wrap/gap/align-items are
|
|
1691
|
+
copied from .ed-wave-brushes, .ed-wave-cycleops, .ed-wave-meta above (the
|
|
1692
|
+
shared flex-row rule its own children need), and flex:1 1 100% is copied
|
|
1693
|
+
from .ed-wave-unmodelled below (what makes THAT sibling claim its own row
|
|
1694
|
+
instead of sitting beside the control before it) — this row needs both at
|
|
1695
|
+
once: it lays out its own children AND has to stop sharing a line with
|
|
1696
|
+
whatever toolbar control precedes it. */
|
|
1697
|
+
.ed-wave-edgebar { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; flex: 1 1 100%; }
|
|
1682
1698
|
/* The "this drawing is not showing you everything" notice. period / phase /
|
|
1683
1699
|
config.hscale all change what the ENGINE paints and none of them is
|
|
1684
1700
|
modelled by the hand drawing, so a document carrying one says so instead
|
|
@@ -1716,6 +1732,15 @@ ${itemsHtml}
|
|
|
1716
1732
|
gap: 3px; padding-right: 6px; box-sizing: border-box;
|
|
1717
1733
|
}
|
|
1718
1734
|
.ed-wave-lane-row.is-selected { background: #eaf2fe; }
|
|
1735
|
+
/* v3.5.0 Task 12: Shift+click multi-select for group creation — a
|
|
1736
|
+
distinct tint from .is-selected above (that one is the CYCLE selection
|
|
1737
|
+
the brush/cycle-ops toolbar acts on; this one is a SET of whole lanes
|
|
1738
|
+
the group buttons act on, and a user with both standing at once — a
|
|
1739
|
+
cycle range selected on a lane that is also multi-selected for
|
|
1740
|
+
grouping — needs to tell which is which at a glance). A lane can carry
|
|
1741
|
+
both classes together, so this is additive (a left border) rather than
|
|
1742
|
+
a second background that would just overwrite .is-selected's. */
|
|
1743
|
+
.ed-wave-lane-row.is-multi-selected { border-left: 3px solid #7c3aed; }
|
|
1719
1744
|
.ed-wave-lane-name { flex: 1 1 auto; min-width: 0; font-size: 12px; padding: 2px 4px; }
|
|
1720
1745
|
.ed-wave-lane-row button {
|
|
1721
1746
|
border: 1px solid #cfcfcf; border-radius: 3px; background: #fff;
|
|
@@ -1730,18 +1755,70 @@ ${itemsHtml}
|
|
|
1730
1755
|
color: #555; cursor: pointer; box-sizing: border-box;
|
|
1731
1756
|
}
|
|
1732
1757
|
.ed-wave-group-input { width: 16px; height: 90px; cursor: text; }
|
|
1733
|
-
|
|
1758
|
+
/* position: relative so the data-label field below (v3.5.0 Task 11) has
|
|
1759
|
+
an offsetParent to measure from: wave-ui.js reads canvas.offsetLeft /
|
|
1760
|
+
offsetTop against THIS element, not a hard-coded copy of the padding
|
|
1761
|
+
number just below, so the two cannot drift apart if that padding ever
|
|
1762
|
+
changes. */
|
|
1763
|
+
.ed-wave-canvas-wrap { flex: 1 1 auto; overflow: auto; padding: 8px; position: relative; }
|
|
1734
1764
|
.ed-wave-canvas { display: block; }
|
|
1765
|
+
/* v3.5.0 Task 11: the bus data-label field, positioned by wave-ui.js's
|
|
1766
|
+
openDataEdit() from geometry.cellRect() — left/top/width/height are all
|
|
1767
|
+
set inline per cell, so only the visual skin lives here. Sized to sit
|
|
1768
|
+
exactly over the box it labels, text centred to match .ed-wave-buslabel
|
|
1769
|
+
beside it in the drawing underneath, box-sizing so the border does not
|
|
1770
|
+
push the field past the cell it is meant to cover. */
|
|
1771
|
+
.ed-wave-data-input {
|
|
1772
|
+
position: absolute; z-index: 1; box-sizing: border-box; text-align: center;
|
|
1773
|
+
font-size: 11px; padding: 0 2px; border: 1px solid #1a73e8; border-radius: 2px;
|
|
1774
|
+
background: #fff; color: #222;
|
|
1775
|
+
}
|
|
1735
1776
|
.ed-wave-grid { stroke: #ececec; stroke-width: 1; }
|
|
1736
1777
|
.ed-wave-line, .ed-wave-edge { stroke: #111; stroke-width: 2; fill: none; }
|
|
1737
1778
|
.ed-wave-weak { stroke-dasharray: 4 3; }
|
|
1779
|
+
/* v3.5.0 Task 10: the P/N explicit-edge arrowhead — see wave-ui.js's
|
|
1780
|
+
drawLane isClock branch for the measurement behind its shape and
|
|
1781
|
+
placement. Filled, no stroke, matching the line colour above. */
|
|
1782
|
+
.ed-wave-clock-arrow { fill: #111; stroke: none; }
|
|
1738
1783
|
.ed-wave-x { fill: #d9d9d9; stroke: #111; stroke-width: 2; }
|
|
1739
1784
|
.ed-wave-bus { fill: #f5e9c8; stroke: #111; stroke-width: 2; }
|
|
1740
1785
|
.ed-wave-bus-3 { fill: #d8ead3; }
|
|
1741
1786
|
.ed-wave-bus-4 { fill: #d6e4f7; }
|
|
1742
1787
|
.ed-wave-bus-5 { fill: #f7d6e4; }
|
|
1743
|
-
.
|
|
1744
|
-
|
|
1788
|
+
/* v3.5.0 Task 11 fix round 2: this text, not the box under it, is the
|
|
1789
|
+
click target that opens the data-label field (wave-ui.js's onCanvasDown
|
|
1790
|
+
gates on ev.target.classList.contains('ed-wave-buslabel') — pressing
|
|
1791
|
+
anywhere else in the bus box still paints). pointer-events:
|
|
1792
|
+
visiblePainted is the SVG initial value already, so this changes
|
|
1793
|
+
nothing on its own; it is written out explicitly because that default
|
|
1794
|
+
is now load-bearing for a real gesture, not incidental — a future
|
|
1795
|
+
blanket pointer-events: none added upstream of this rule would
|
|
1796
|
+
silently make the label unclickable again, and this line is what a
|
|
1797
|
+
reviewer would have to notice and remove. */
|
|
1798
|
+
.ed-wave-buslabel { font-size: 11px; fill: #222; pointer-events: visiblePainted; cursor: text; }
|
|
1799
|
+
/* v3.5.0 Task 11 fix round 3: the hit target for an UNLABELLED bus run —
|
|
1800
|
+
drawLane draws this circle in place of the text when the run has no
|
|
1801
|
+
label, sharing the ed-wave-buslabel class above (same pointer-events,
|
|
1802
|
+
same cursor: text) so onCanvasDown's hit test needed no change. Kept
|
|
1803
|
+
visually quiet on purpose: dim and small, so a diagram full of
|
|
1804
|
+
unlabelled buses reads as buses first and marks second, not as a field
|
|
1805
|
+
of dots. Geometry (position, radius) is inline per cell, sized against
|
|
1806
|
+
that cell's own box in drawLane so it always stays a small fraction of
|
|
1807
|
+
it — this rule is skin only. */
|
|
1808
|
+
.ed-wave-buslabel-empty { fill: #666; opacity: .35; }
|
|
1809
|
+
/* v3.5.0 Task 11 fix round 4: this rect's job is to SHOW what cycle range
|
|
1810
|
+
is selected, never to be pressed. pointer-events: none, so it can never
|
|
1811
|
+
swallow a press meant for whatever it happens to be sitting over —
|
|
1812
|
+
reviewer-measured, a bus label whose run is one cycle wide can sit
|
|
1813
|
+
right up against this rect's own right edge (stroke included), and
|
|
1814
|
+
without this a second press on that same label landed on the
|
|
1815
|
+
selection's stroke instead of the label text underneath it, and the
|
|
1816
|
+
data-label field never opened. Same principle as .ed-wave-cursor two
|
|
1817
|
+
rules below, applied to the OTHER highlight this drawing draws. */
|
|
1818
|
+
.ed-wave-selection {
|
|
1819
|
+
fill: rgba(26,115,232,.18); stroke: #1a73e8; stroke-width: 1;
|
|
1820
|
+
pointer-events: none;
|
|
1821
|
+
}
|
|
1745
1822
|
/* The KEYBOARD's own cell, and deliberately not the same mark as the
|
|
1746
1823
|
selection: the selection is the RANGE a cycle operation acts on, the
|
|
1747
1824
|
cursor is the ONE cell the next keystroke paints, and after Shift+left /
|
|
@@ -1757,8 +1834,69 @@ ${itemsHtml}
|
|
|
1757
1834
|
.ed-wave-canvas:focus { outline: 2px solid #1a73e8; outline-offset: 2px; }
|
|
1758
1835
|
/* The discontinuity marker. The engine draws one gap <use> per pipe
|
|
1759
1836
|
character; drawing none left the two pictures disagreeing on a lane whose
|
|
1760
|
-
levels agreed exactly.
|
|
1761
|
-
|
|
1837
|
+
levels agreed exactly. v3.5.0 Task 11 fix round 4 audit: drawLane's own
|
|
1838
|
+
comment already calls this "last so it sits over the trace it
|
|
1839
|
+
interrupts" — purely decorative, drawn on top purely to be seen, the
|
|
1840
|
+
exact shape of thing that swallowed a press meant for the bus label
|
|
1841
|
+
underneath it (see .ed-wave-selection above). A gap cycle inside a bus
|
|
1842
|
+
run can land at that run's own label position, so pointer-events: none
|
|
1843
|
+
here too, on the same principle, not because a concrete collision was
|
|
1844
|
+
reproduced. */
|
|
1845
|
+
.ed-wave-gap { stroke: #111; stroke-width: 2; fill: none; pointer-events: none; }
|
|
1846
|
+
/* v3.5.0 Task 6: edge: relationship lines, drawn by wave-ui.js's
|
|
1847
|
+
renderEdges() after every lane. Named .ed-wave-edge-* (with a hyphen)
|
|
1848
|
+
rather than .ed-wave-edge, which is already the brick-to-brick
|
|
1849
|
+
transition tick inside ONE lane (two rules above) — a different mark
|
|
1850
|
+
with a different meaning, and CSS class matching is exact-token so the
|
|
1851
|
+
two never collide, but the names are kept visually distinct too.
|
|
1852
|
+
Colours match the engine's own arc-shape.js style string
|
|
1853
|
+
(stroke:#0041c4) so a line drawn here and the same line in the
|
|
1854
|
+
WaveDrom preview beside it read as the same colour. */
|
|
1855
|
+
.ed-wave-edge-path { stroke: #0041c4; stroke-width: 1; fill: none; }
|
|
1856
|
+
.ed-wave-edge-path.is-on { stroke: #1a73e8; stroke-width: 2; }
|
|
1857
|
+
/* v3.5.0 Task 8: the edge an in-flight endpoint drag is dragging, drawn at
|
|
1858
|
+
its own ACTUAL (still-committed) position — the document does not
|
|
1859
|
+
change until the drop — but faded so it reads as "not where this will
|
|
1860
|
+
end up" once wave-ui.js's own dashed .ed-wave-edge-pending preview line
|
|
1861
|
+
(same mechanism Task 7's not-yet-written edge already uses) is standing
|
|
1862
|
+
next to it. Combines with .is-on: the dragged edge is always the
|
|
1863
|
+
selected one (renderEdges()'s own comment), so both classes are present
|
|
1864
|
+
together and this only lowers opacity on top of that colour. */
|
|
1865
|
+
.ed-wave-edge-path.is-drag-source { opacity: .35; }
|
|
1866
|
+
/* The invisible, wide-stroke click target layered over each visible path
|
|
1867
|
+
(see renderEdges()'s own comment) — pointer-events: stroke is what makes
|
|
1868
|
+
a transparent stroke hit-testable at all, since a stroke that paints
|
|
1869
|
+
nothing is not visiblePainted by the SVG default. */
|
|
1870
|
+
.ed-wave-edge-hit { stroke: transparent; stroke-width: 10; fill: none; pointer-events: stroke; }
|
|
1871
|
+
/* v3.5.0 Task 11 fix round 4 audit, closed in round 5: this text (drawn
|
|
1872
|
+
by renderEdges, AFTER .ed-wave-edge-hit) is the same shape of hazard as
|
|
1873
|
+
.ed-wave-selection and .ed-wave-gap above — purely decorative, sits on
|
|
1874
|
+
top of the fat invisible click target a press aimed at SELECTING the
|
|
1875
|
+
edge is meant to land on. Round 4 found this but could not apply
|
|
1876
|
+
pointer-events: none to the bare class: ed-wave-edge-label is not this
|
|
1877
|
+
text's own class alone — wave-ui.js's sidebar edgeLabelInput (the real,
|
|
1878
|
+
keyboard-and-mouse text field for editing an edge's label) uses the
|
|
1879
|
+
IDENTICAL class name, and a blanket rule would have also landed on
|
|
1880
|
+
that input field and blocked clicking into it with the mouse.
|
|
1881
|
+
Round 5's fix: scope the SELECTOR by element instead of renaming
|
|
1882
|
+
anything. text.ed-wave-edge-label only ever matches the SVG <text>
|
|
1883
|
+
wave-ui.js draws on the canvas — the sidebar control is an <input>, a
|
|
1884
|
+
different element entirely, and keeps its own default pointer-events
|
|
1885
|
+
untouched no matter what class it shares. */
|
|
1886
|
+
text.ed-wave-edge-label { pointer-events: none; }
|
|
1887
|
+
.ed-wave-edge-label { font-size: 11px; fill: #333; }
|
|
1888
|
+
.ed-wave-edge-handle { fill: #1a73e8; stroke: #ffffff; }
|
|
1889
|
+
.ed-wave-edge-arrow { fill: #0041c4; }
|
|
1890
|
+
.ed-wave-edge-tee { stroke: #0041c4; }
|
|
1891
|
+
/* v3.5.0 Task 7: the pending line an armed drag or keyboard two-step is
|
|
1892
|
+
standing on, from wave-ui.js's renderCanvas() — UI state only, never a
|
|
1893
|
+
document read, so it is dashed rather than the solid .ed-wave-edge-path
|
|
1894
|
+
colour to read as "not written yet". pointer-events: none so it can
|
|
1895
|
+
never itself become the thing a press lands on. */
|
|
1896
|
+
.ed-wave-edge-pending {
|
|
1897
|
+
stroke: #1a73e8; stroke-width: 2; stroke-dasharray: 5 4; fill: none;
|
|
1898
|
+
pointer-events: none;
|
|
1899
|
+
}
|
|
1762
1900
|
.ed-wave-preview {
|
|
1763
1901
|
flex: 0 1 340px; min-width: 160px; border-left: 1px solid #e2e2e2;
|
|
1764
1902
|
overflow: auto; padding: 8px;
|