@nowline/layout 0.8.6 → 0.9.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/axis-columns.d.ts +70 -0
- package/dist/axis-columns.d.ts.map +1 -0
- package/dist/axis-columns.js +104 -0
- package/dist/axis-columns.js.map +1 -0
- package/dist/calendar-resolver.d.ts +27 -0
- package/dist/calendar-resolver.d.ts.map +1 -0
- package/dist/calendar-resolver.js +132 -0
- package/dist/calendar-resolver.js.map +1 -0
- package/dist/calendar.d.ts +0 -19
- package/dist/calendar.d.ts.map +1 -1
- package/dist/calendar.js +4 -44
- package/dist/calendar.js.map +1 -1
- package/dist/canvas-width.d.ts +23 -0
- package/dist/canvas-width.d.ts.map +1 -0
- package/dist/canvas-width.js +26 -0
- package/dist/canvas-width.js.map +1 -0
- package/dist/capacity.d.ts +28 -0
- package/dist/capacity.d.ts.map +1 -1
- package/dist/capacity.js +64 -29
- package/dist/capacity.js.map +1 -1
- package/dist/chart-translation.d.ts +22 -0
- package/dist/chart-translation.d.ts.map +1 -0
- package/dist/chart-translation.js +83 -0
- package/dist/chart-translation.js.map +1 -0
- package/dist/container-header-geometry.d.ts +64 -0
- package/dist/container-header-geometry.d.ts.map +1 -0
- package/dist/container-header-geometry.js +89 -0
- package/dist/container-header-geometry.js.map +1 -0
- package/dist/dsl-utils.d.ts +3 -4
- package/dist/dsl-utils.d.ts.map +1 -1
- package/dist/dsl-utils.js +8 -25
- package/dist/dsl-utils.js.map +1 -1
- package/dist/edge-routing.d.ts +69 -78
- package/dist/edge-routing.d.ts.map +1 -1
- package/dist/edge-routing.js +271 -401
- package/dist/edge-routing.js.map +1 -1
- package/dist/frame-tab-geometry.d.ts +24 -14
- package/dist/frame-tab-geometry.d.ts.map +1 -1
- package/dist/frame-tab-geometry.js +69 -23
- package/dist/frame-tab-geometry.js.map +1 -1
- package/dist/header-card-geometry.d.ts +12 -0
- package/dist/header-card-geometry.d.ts.map +1 -1
- package/dist/header-card-geometry.js +14 -2
- package/dist/header-card-geometry.js.map +1 -1
- package/dist/header-logo.d.ts +28 -0
- package/dist/header-logo.d.ts.map +1 -0
- package/dist/header-logo.js +51 -0
- package/dist/header-logo.js.map +1 -0
- package/dist/i18n.d.ts +11 -0
- package/dist/i18n.d.ts.map +1 -1
- package/dist/i18n.js +11 -1
- package/dist/i18n.js.map +1 -1
- package/dist/index.d.ts +20 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17 -7
- package/dist/index.js.map +1 -1
- package/dist/inline-date-pin-geometry.d.ts +19 -11
- package/dist/inline-date-pin-geometry.d.ts.map +1 -1
- package/dist/inline-date-pin-geometry.js +45 -46
- package/dist/inline-date-pin-geometry.js.map +1 -1
- package/dist/item-bar-geometry.d.ts +192 -4
- package/dist/item-bar-geometry.d.ts.map +1 -1
- package/dist/item-bar-geometry.js +258 -5
- package/dist/item-bar-geometry.js.map +1 -1
- package/dist/item-port-geometry.d.ts +13 -0
- package/dist/item-port-geometry.d.ts.map +1 -0
- package/dist/item-port-geometry.js +63 -0
- package/dist/item-port-geometry.js.map +1 -0
- package/dist/layout-context.d.ts +115 -51
- package/dist/layout-context.d.ts.map +1 -1
- package/dist/layout-context.js +96 -5
- package/dist/layout-context.js.map +1 -1
- package/dist/layout-insights.d.ts.map +1 -1
- package/dist/layout-insights.js +73 -1
- package/dist/layout-insights.js.map +1 -1
- package/dist/layout.d.ts +35 -0
- package/dist/layout.d.ts.map +1 -1
- package/dist/layout.js +18 -1315
- package/dist/layout.js.map +1 -1
- package/dist/nodes/anchor-node.d.ts.map +1 -1
- package/dist/nodes/anchor-node.js +11 -4
- package/dist/nodes/anchor-node.js.map +1 -1
- package/dist/nodes/content-extent.d.ts +24 -0
- package/dist/nodes/content-extent.d.ts.map +1 -0
- package/dist/nodes/content-extent.js +100 -0
- package/dist/nodes/content-extent.js.map +1 -0
- package/dist/nodes/dependency-edges.d.ts +6 -0
- package/dist/nodes/dependency-edges.d.ts.map +1 -0
- package/dist/nodes/dependency-edges.js +148 -0
- package/dist/nodes/dependency-edges.js.map +1 -0
- package/dist/nodes/footnote-node.d.ts +24 -3
- package/dist/nodes/footnote-node.d.ts.map +1 -1
- package/dist/nodes/footnote-node.js +129 -25
- package/dist/nodes/footnote-node.js.map +1 -1
- package/dist/nodes/group-node.d.ts +10 -21
- package/dist/nodes/group-node.d.ts.map +1 -1
- package/dist/nodes/group-node.js +79 -152
- package/dist/nodes/group-node.js.map +1 -1
- package/dist/nodes/header-node.d.ts +56 -0
- package/dist/nodes/header-node.d.ts.map +1 -0
- package/dist/nodes/header-node.js +163 -0
- package/dist/nodes/header-node.js.map +1 -0
- package/dist/nodes/include-node.d.ts +22 -12
- package/dist/nodes/include-node.d.ts.map +1 -1
- package/dist/nodes/include-node.js +95 -62
- package/dist/nodes/include-node.js.map +1 -1
- package/dist/nodes/item-measure.d.ts +135 -0
- package/dist/nodes/item-measure.d.ts.map +1 -0
- package/dist/nodes/item-measure.js +514 -0
- package/dist/nodes/item-measure.js.map +1 -0
- package/dist/nodes/item-node.d.ts +162 -9
- package/dist/nodes/item-node.d.ts.map +1 -1
- package/dist/nodes/item-node.js +256 -69
- package/dist/nodes/item-node.js.map +1 -1
- package/dist/nodes/marker-band.d.ts +118 -0
- package/dist/nodes/marker-band.d.ts.map +1 -0
- package/dist/nodes/marker-band.js +303 -0
- package/dist/nodes/marker-band.js.map +1 -0
- package/dist/nodes/marker-geometry.js +1 -1
- package/dist/nodes/marker-geometry.js.map +1 -1
- package/dist/nodes/milestone-node.d.ts +112 -15
- package/dist/nodes/milestone-node.d.ts.map +1 -1
- package/dist/nodes/milestone-node.js +246 -95
- package/dist/nodes/milestone-node.js.map +1 -1
- package/dist/nodes/nowline-node.d.ts +8 -0
- package/dist/nodes/nowline-node.d.ts.map +1 -0
- package/dist/nodes/nowline-node.js +74 -0
- package/dist/nodes/nowline-node.js.map +1 -0
- package/dist/nodes/parallel-node.d.ts +7 -12
- package/dist/nodes/parallel-node.d.ts.map +1 -1
- package/dist/nodes/parallel-node.js +66 -30
- package/dist/nodes/parallel-node.js.map +1 -1
- package/dist/nodes/region-markers.d.ts +41 -0
- package/dist/nodes/region-markers.d.ts.map +1 -0
- package/dist/nodes/region-markers.js +130 -0
- package/dist/nodes/region-markers.js.map +1 -0
- package/dist/nodes/roadmap-node.d.ts +9 -72
- package/dist/nodes/roadmap-node.d.ts.map +1 -1
- package/dist/nodes/roadmap-node.js +38 -788
- package/dist/nodes/roadmap-node.js.map +1 -1
- package/dist/nodes/row-track.d.ts +33 -0
- package/dist/nodes/row-track.d.ts.map +1 -0
- package/dist/nodes/row-track.js +170 -0
- package/dist/nodes/row-track.js.map +1 -0
- package/dist/nodes/sequence-item.d.ts +25 -0
- package/dist/nodes/sequence-item.d.ts.map +1 -0
- package/dist/nodes/sequence-item.js +396 -0
- package/dist/nodes/sequence-item.js.map +1 -0
- package/dist/nodes/sequence-one.d.ts +5 -0
- package/dist/nodes/sequence-one.d.ts.map +1 -0
- package/dist/nodes/sequence-one.js +26 -0
- package/dist/nodes/sequence-one.js.map +1 -0
- package/dist/nodes/swimlane-node.d.ts +5 -17
- package/dist/nodes/swimlane-node.d.ts.map +1 -1
- package/dist/nodes/swimlane-node.js +62 -145
- package/dist/nodes/swimlane-node.js.map +1 -1
- package/dist/nodes/wave-node.d.ts +52 -0
- package/dist/nodes/wave-node.d.ts.map +1 -0
- package/dist/nodes/wave-node.js +483 -0
- package/dist/nodes/wave-node.js.map +1 -0
- package/dist/non-working-display.d.ts +14 -0
- package/dist/non-working-display.d.ts.map +1 -0
- package/dist/non-working-display.js +28 -0
- package/dist/non-working-display.js.map +1 -0
- package/dist/phases/date-window.d.ts +48 -0
- package/dist/phases/date-window.d.ts.map +1 -0
- package/dist/phases/date-window.js +130 -0
- package/dist/phases/date-window.js.map +1 -0
- package/dist/phases/finalize.d.ts +198 -0
- package/dist/phases/finalize.d.ts.map +1 -0
- package/dist/phases/finalize.js +1058 -0
- package/dist/phases/finalize.js.map +1 -0
- package/dist/phases/measure.d.ts +77 -0
- package/dist/phases/measure.d.ts.map +1 -0
- package/dist/phases/measure.js +222 -0
- package/dist/phases/measure.js.map +1 -0
- package/dist/phases/place.d.ts +28 -0
- package/dist/phases/place.d.ts.map +1 -0
- package/dist/phases/place.js +225 -0
- package/dist/phases/place.js.map +1 -0
- package/dist/renderable.d.ts.map +1 -1
- package/dist/renderable.js +23 -3
- package/dist/renderable.js.map +1 -1
- package/dist/resolve-today.d.ts +11 -1
- package/dist/resolve-today.d.ts.map +1 -1
- package/dist/resolve-today.js +26 -12
- package/dist/resolve-today.js.map +1 -1
- package/dist/row-packer.d.ts +42 -16
- package/dist/row-packer.d.ts.map +1 -1
- package/dist/row-packer.js +51 -78
- package/dist/row-packer.js.map +1 -1
- package/dist/schedule.d.ts +58 -1
- package/dist/schedule.d.ts.map +1 -1
- package/dist/schedule.js +280 -106
- package/dist/schedule.js.map +1 -1
- package/dist/start-rules.d.ts +27 -0
- package/dist/start-rules.d.ts.map +1 -0
- package/dist/start-rules.js +91 -0
- package/dist/start-rules.js.map +1 -0
- package/dist/start-terms.d.ts +23 -0
- package/dist/start-terms.d.ts.map +1 -0
- package/dist/start-terms.js +27 -0
- package/dist/start-terms.js.map +1 -0
- package/dist/status-dot.d.ts +46 -0
- package/dist/status-dot.d.ts.map +1 -0
- package/dist/status-dot.js +78 -0
- package/dist/status-dot.js.map +1 -0
- package/dist/style-resolution.d.ts.map +1 -1
- package/dist/style-resolution.js +23 -43
- package/dist/style-resolution.js.map +1 -1
- package/dist/text-measure.d.ts +28 -0
- package/dist/text-measure.d.ts.map +1 -0
- package/dist/text-measure.js +70 -0
- package/dist/text-measure.js.map +1 -0
- package/dist/themes/contrast.d.ts +4 -0
- package/dist/themes/contrast.d.ts.map +1 -0
- package/dist/themes/contrast.js +32 -0
- package/dist/themes/contrast.js.map +1 -0
- package/dist/themes/dark.d.ts.map +1 -1
- package/dist/themes/dark.js +28 -1
- package/dist/themes/dark.js.map +1 -1
- package/dist/themes/grayscale.d.ts.map +1 -1
- package/dist/themes/grayscale.js +28 -1
- package/dist/themes/grayscale.js.map +1 -1
- package/dist/themes/index.d.ts +4 -11
- package/dist/themes/index.d.ts.map +1 -1
- package/dist/themes/index.js +6 -4
- package/dist/themes/index.js.map +1 -1
- package/dist/themes/light.d.ts.map +1 -1
- package/dist/themes/light.js +28 -1
- package/dist/themes/light.js.map +1 -1
- package/dist/themes/shape.d.ts +31 -0
- package/dist/themes/shape.d.ts.map +1 -1
- package/dist/themes/shared.d.ts +44 -50
- package/dist/themes/shared.d.ts.map +1 -1
- package/dist/themes/shared.js +79 -83
- package/dist/themes/shared.js.map +1 -1
- package/dist/time-scale.d.ts +42 -6
- package/dist/time-scale.d.ts.map +1 -1
- package/dist/time-scale.js +109 -17
- package/dist/time-scale.js.map +1 -1
- package/dist/types.d.ts +528 -11
- package/dist/types.d.ts.map +1 -1
- package/dist/view-preset.d.ts +61 -6
- package/dist/view-preset.d.ts.map +1 -1
- package/dist/view-preset.js +439 -24
- package/dist/view-preset.js.map +1 -1
- package/dist/wave-barrier.d.ts +107 -0
- package/dist/wave-barrier.d.ts.map +1 -0
- package/dist/wave-barrier.js +174 -0
- package/dist/wave-barrier.js.map +1 -0
- package/dist/wave-hatch.d.ts +4 -0
- package/dist/wave-hatch.d.ts.map +1 -0
- package/dist/wave-hatch.js +21 -0
- package/dist/wave-hatch.js.map +1 -0
- package/dist/wave-layout.d.ts +99 -0
- package/dist/wave-layout.d.ts.map +1 -0
- package/dist/wave-layout.js +130 -0
- package/dist/wave-layout.js.map +1 -0
- package/dist/working-calendar.d.ts +128 -4
- package/dist/working-calendar.d.ts.map +1 -1
- package/dist/working-calendar.js +725 -51
- package/dist/working-calendar.js.map +1 -1
- package/dist/working-span.d.ts +11 -0
- package/dist/working-span.d.ts.map +1 -0
- package/dist/working-span.js +18 -0
- package/dist/working-span.js.map +1 -0
- package/package.json +4 -4
- package/src/axis-columns.ts +140 -0
- package/src/calendar-resolver.ts +161 -0
- package/src/calendar.ts +4 -45
- package/src/canvas-width.ts +36 -0
- package/src/capacity.ts +71 -30
- package/src/chart-translation.ts +88 -0
- package/src/container-header-geometry.ts +116 -0
- package/src/dsl-utils.ts +8 -26
- package/src/edge-routing.ts +347 -491
- package/src/frame-tab-geometry.ts +78 -25
- package/src/header-card-geometry.ts +17 -2
- package/src/header-logo.ts +67 -0
- package/src/i18n.ts +22 -1
- package/src/index.ts +97 -12
- package/src/inline-date-pin-geometry.ts +55 -58
- package/src/item-bar-geometry.ts +341 -5
- package/src/item-port-geometry.ts +69 -0
- package/src/layout-context.ts +210 -72
- package/src/layout-insights.ts +109 -2
- package/src/layout.ts +57 -1530
- package/src/nodes/anchor-node.ts +11 -4
- package/src/nodes/content-extent.ts +107 -0
- package/src/nodes/dependency-edges.ts +171 -0
- package/src/nodes/footnote-node.ts +171 -31
- package/src/nodes/group-node.ts +92 -214
- package/src/nodes/header-node.ts +255 -0
- package/src/nodes/include-node.ts +124 -110
- package/src/nodes/item-measure.ts +723 -0
- package/src/nodes/item-node.ts +358 -80
- package/src/nodes/marker-band.ts +406 -0
- package/src/nodes/marker-geometry.ts +1 -1
- package/src/nodes/milestone-node.ts +321 -136
- package/src/nodes/nowline-node.ts +87 -0
- package/src/nodes/parallel-node.ts +69 -38
- package/src/nodes/region-markers.ts +194 -0
- package/src/nodes/roadmap-node.ts +46 -950
- package/src/nodes/row-track.ts +217 -0
- package/src/nodes/sequence-item.ts +433 -0
- package/src/nodes/sequence-one.ts +40 -0
- package/src/nodes/swimlane-node.ts +66 -205
- package/src/nodes/wave-node.ts +609 -0
- package/src/non-working-display.ts +32 -0
- package/src/phases/date-window.ts +191 -0
- package/src/phases/finalize.ts +1303 -0
- package/src/phases/measure.ts +329 -0
- package/src/phases/place.ts +318 -0
- package/src/renderable.ts +23 -3
- package/src/resolve-today.ts +28 -25
- package/src/row-packer.ts +85 -84
- package/src/schedule.ts +362 -114
- package/src/start-rules.ts +113 -0
- package/src/start-terms.ts +38 -0
- package/src/status-dot.ts +81 -0
- package/src/style-resolution.ts +27 -57
- package/src/text-measure.ts +71 -0
- package/src/themes/contrast.ts +34 -0
- package/src/themes/dark.ts +28 -1
- package/src/themes/grayscale.ts +28 -1
- package/src/themes/index.ts +10 -7
- package/src/themes/light.ts +28 -1
- package/src/themes/shape.ts +38 -0
- package/src/themes/shared.ts +85 -93
- package/src/time-scale.ts +117 -19
- package/src/types.ts +529 -20
- package/src/view-preset.ts +520 -27
- package/src/wave-barrier.ts +242 -0
- package/src/wave-hatch.ts +25 -0
- package/src/wave-layout.ts +203 -0
- package/src/working-calendar.ts +875 -57
- package/src/working-span.ts +19 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// Start terms and wave floors, parsed once for every engine that places an
|
|
2
|
+
// item (specs/scheduler-unification.md §3.4): engine C's day walker, engine
|
|
3
|
+
// A's pixel walker and its non-working-pin helper, and the wave barrier's
|
|
4
|
+
// floor projections. Each caller keeps its own `max` rule and maps the
|
|
5
|
+
// parsed dates to its own unit (working-day index or x); only the parsing
|
|
6
|
+
// is shared. Pure: no calendar, no scale. Work has no fixed start pin:
|
|
7
|
+
// `date:` and `start:` on an item are unknown keys (specs/dsl.md § Item
|
|
8
|
+
// Properties, "Pinning is not supported"), so nothing here reads them.
|
|
9
|
+
import { parseIsoDate, propValues } from './dsl-utils.js';
|
|
10
|
+
/** The start terms of an item, group or parallel from its properties. */
|
|
11
|
+
export function startTermsOf(props) {
|
|
12
|
+
const after = propValues(props, 'after').map((raw) => {
|
|
13
|
+
const date = parseIsoDate(raw);
|
|
14
|
+
return date ? { raw, date } : { raw, ref: raw };
|
|
15
|
+
});
|
|
16
|
+
return { after };
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The declaration date of each wave's floor (`null` for a wave without a
|
|
20
|
+
* floor or whose date does not parse), at index `k - 1` for wave `k`. The
|
|
21
|
+
* dates are the plan's unclamped declarations: the day engine maps them with
|
|
22
|
+
* `workingIndexOf`, the pixel engine with `scale.forward`.
|
|
23
|
+
*/
|
|
24
|
+
export function waveFloorDates(plan) {
|
|
25
|
+
return plan.floors.map((f) => (f ? parseIsoDate(f.date) : null));
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=start-terms.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"start-terms.js","sourceRoot":"","sources":["../src/start-terms.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,4EAA4E;AAC5E,0EAA0E;AAC1E,uEAAuE;AACvE,0EAA0E;AAC1E,uEAAuE;AACvE,wEAAwE;AACxE,uEAAuE;AAGvE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAU1D,yEAAyE;AACzE,MAAM,UAAU,YAAY,CAAC,KAAuB;IAChD,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAa,EAAE;QAC5D,MAAM,IAAI,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC;QAC/B,OAAO,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;IACpD,CAAC,CAAC,CAAC;IACH,OAAO,EAAE,KAAK,EAAE,CAAC;AACrB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,IAAc;IACzC,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AACrE,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { Theme } from './themes/shape.js';
|
|
2
|
+
import type { StatusKind } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* sRGB → relative luminance per WCAG 2.x. Input may be `#rrggbb`,
|
|
5
|
+
* `#rgb`, or a non-hex token like `none` / `transparent`. Non-hex
|
|
6
|
+
* inputs return 1 (treated as light) so a transparent bar reuses
|
|
7
|
+
* the chart's light bg. Mostly used to choose between two
|
|
8
|
+
* status-dot palettes (`onLight` vs `onDark`) so the dot reads on
|
|
9
|
+
* any bar fill — see `pickStatusDotPalette` and
|
|
10
|
+
* `specs/rendering.md`'s status-dot section.
|
|
11
|
+
*
|
|
12
|
+
* This is the renderer's copy, kept with its semantics: unlike
|
|
13
|
+
* `relativeLuminance` in `themes/contrast.ts`, which throws on anything
|
|
14
|
+
* but `#rgb` / `#rrggbb`, it never throws, and a 6-character string that
|
|
15
|
+
* is not hex gives `NaN` (so it compares false against any threshold).
|
|
16
|
+
*/
|
|
17
|
+
export declare function fillLuminance(hex: string): number;
|
|
18
|
+
/**
|
|
19
|
+
* Pick the status-dot palette whose tone contrasts best with the
|
|
20
|
+
* given bar bg.
|
|
21
|
+
*
|
|
22
|
+
* The crossover threshold is the bar luminance at which a deep dot
|
|
23
|
+
* (avg luminance ≈ 0.045 across `onLight` palette entries) and a
|
|
24
|
+
* pale dot (avg ≈ 0.85 across `onDark` entries) give equal WCAG
|
|
25
|
+
* contrast. Solving `(L_bar + 0.05)² ≈ 0.86 × 0.095` gives
|
|
26
|
+
* `L_bar ≈ 0.24`, so:
|
|
27
|
+
* - bars with luminance ≥ 0.24 (most label-driven mid-tones AND
|
|
28
|
+
* all pale status-tint bars) → `onLight` deep dot
|
|
29
|
+
* - bars with luminance < 0.24 (dark status-tint bars in dark
|
|
30
|
+
* theme, e.g. `#172554`) → `onDark` pale dot
|
|
31
|
+
*/
|
|
32
|
+
export declare function pickStatusDotPalette(bg: string, palette: Theme): Theme['statusDot']['onLight'];
|
|
33
|
+
/**
|
|
34
|
+
* The status dot's colour for a bar filled `bg` with status `status`.
|
|
35
|
+
*
|
|
36
|
+
* Status-dot color — the dot communicates status via hue, but
|
|
37
|
+
* the bar bg can range from pale status tints (`#eff6ff`) to
|
|
38
|
+
* saturated mid-tones (`#1e88e5` from `bg:blue` labels) to
|
|
39
|
+
* dark navies (`#172554` in dark theme), so a single palette
|
|
40
|
+
* can't keep contrast across all bars. Two palettes — `onLight`
|
|
41
|
+
* (deep tints, for pale bars) and `onDark` (pale tints, for
|
|
42
|
+
* saturated/dark bars) — are picked from based on the bar
|
|
43
|
+
* bg's relative luminance.
|
|
44
|
+
*/
|
|
45
|
+
export declare function statusDotColor(status: StatusKind, bg: string, palette: Theme): string;
|
|
46
|
+
//# sourceMappingURL=status-dot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status-dot.d.ts","sourceRoot":"","sources":["../src/status-dot.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAejD;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,SAAS,CAAC,CAE9F;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,GAAG,MAAM,CAWrF"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
// Status-dot colour: the bar fill's luminance picks one of the theme's two
|
|
2
|
+
// status-dot palettes, and the item's status picks the colour in it. Moved
|
|
3
|
+
// from the SVG renderer (R5) so each positioned item carries its resolved
|
|
4
|
+
// dot colour and the renderer only draws the dot.
|
|
5
|
+
/**
|
|
6
|
+
* sRGB → relative luminance per WCAG 2.x. Input may be `#rrggbb`,
|
|
7
|
+
* `#rgb`, or a non-hex token like `none` / `transparent`. Non-hex
|
|
8
|
+
* inputs return 1 (treated as light) so a transparent bar reuses
|
|
9
|
+
* the chart's light bg. Mostly used to choose between two
|
|
10
|
+
* status-dot palettes (`onLight` vs `onDark`) so the dot reads on
|
|
11
|
+
* any bar fill — see `pickStatusDotPalette` and
|
|
12
|
+
* `specs/rendering.md`'s status-dot section.
|
|
13
|
+
*
|
|
14
|
+
* This is the renderer's copy, kept with its semantics: unlike
|
|
15
|
+
* `relativeLuminance` in `themes/contrast.ts`, which throws on anything
|
|
16
|
+
* but `#rgb` / `#rrggbb`, it never throws, and a 6-character string that
|
|
17
|
+
* is not hex gives `NaN` (so it compares false against any threshold).
|
|
18
|
+
*/
|
|
19
|
+
export function fillLuminance(hex) {
|
|
20
|
+
if (!hex || hex === 'none' || hex === 'transparent')
|
|
21
|
+
return 1;
|
|
22
|
+
let h = hex.startsWith('#') ? hex.slice(1) : hex;
|
|
23
|
+
if (h.length === 3) {
|
|
24
|
+
h = h
|
|
25
|
+
.split('')
|
|
26
|
+
.map((c) => c + c)
|
|
27
|
+
.join('');
|
|
28
|
+
}
|
|
29
|
+
if (h.length !== 6)
|
|
30
|
+
return 1;
|
|
31
|
+
const r = parseInt(h.slice(0, 2), 16) / 255;
|
|
32
|
+
const g = parseInt(h.slice(2, 4), 16) / 255;
|
|
33
|
+
const b = parseInt(h.slice(4, 6), 16) / 255;
|
|
34
|
+
const lin = (c) => (c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4);
|
|
35
|
+
return 0.2126 * lin(r) + 0.7152 * lin(g) + 0.0722 * lin(b);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Pick the status-dot palette whose tone contrasts best with the
|
|
39
|
+
* given bar bg.
|
|
40
|
+
*
|
|
41
|
+
* The crossover threshold is the bar luminance at which a deep dot
|
|
42
|
+
* (avg luminance ≈ 0.045 across `onLight` palette entries) and a
|
|
43
|
+
* pale dot (avg ≈ 0.85 across `onDark` entries) give equal WCAG
|
|
44
|
+
* contrast. Solving `(L_bar + 0.05)² ≈ 0.86 × 0.095` gives
|
|
45
|
+
* `L_bar ≈ 0.24`, so:
|
|
46
|
+
* - bars with luminance ≥ 0.24 (most label-driven mid-tones AND
|
|
47
|
+
* all pale status-tint bars) → `onLight` deep dot
|
|
48
|
+
* - bars with luminance < 0.24 (dark status-tint bars in dark
|
|
49
|
+
* theme, e.g. `#172554`) → `onDark` pale dot
|
|
50
|
+
*/
|
|
51
|
+
export function pickStatusDotPalette(bg, palette) {
|
|
52
|
+
return fillLuminance(bg) >= 0.24 ? palette.statusDot.onLight : palette.statusDot.onDark;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* The status dot's colour for a bar filled `bg` with status `status`.
|
|
56
|
+
*
|
|
57
|
+
* Status-dot color — the dot communicates status via hue, but
|
|
58
|
+
* the bar bg can range from pale status tints (`#eff6ff`) to
|
|
59
|
+
* saturated mid-tones (`#1e88e5` from `bg:blue` labels) to
|
|
60
|
+
* dark navies (`#172554` in dark theme), so a single palette
|
|
61
|
+
* can't keep contrast across all bars. Two palettes — `onLight`
|
|
62
|
+
* (deep tints, for pale bars) and `onDark` (pale tints, for
|
|
63
|
+
* saturated/dark bars) — are picked from based on the bar
|
|
64
|
+
* bg's relative luminance.
|
|
65
|
+
*/
|
|
66
|
+
export function statusDotColor(status, bg, palette) {
|
|
67
|
+
const dotPalette = pickStatusDotPalette(bg, palette);
|
|
68
|
+
const statusColors = {
|
|
69
|
+
done: dotPalette.done,
|
|
70
|
+
'in-progress': dotPalette.inProgress,
|
|
71
|
+
'at-risk': dotPalette.atRisk,
|
|
72
|
+
blocked: dotPalette.blocked,
|
|
73
|
+
planned: dotPalette.planned,
|
|
74
|
+
neutral: dotPalette.neutral,
|
|
75
|
+
};
|
|
76
|
+
return statusColors[status] ?? statusColors.neutral;
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=status-dot.js.map
|
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KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,GAAG,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC;IAC7F,OAAO,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;AAC/D,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,oBAAoB,CAAC,EAAU,EAAE,OAAc;IAC3D,OAAO,aAAa,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC;AAC5F,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,cAAc,CAAC,MAAkB,EAAE,EAAU,EAAE,OAAc;IACzE,MAAM,UAAU,GAAG,oBAAoB,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;IACrD,MAAM,YAAY,GAA2B;QACzC,IAAI,EAAE,UAAU,CAAC,IAAI;QACrB,aAAa,EAAE,UAAU,CAAC,UAAU;QACpC,SAAS,EAAE,UAAU,CAAC,MAAM;QAC5B,OAAO,EAAE,UAAU,CAAC,OAAO;QAC3B,OAAO,EAAE,UAAU,CAAC,OAAO;QAC3B,OAAO,EAAE,UAAU,CAAC,OAAO;KAC9B,CAAC;IACF,OAAO,YAAY,CAAC,MAAM,CAAC,IAAI,YAAY,CAAC,OAAO,CAAC;AACxD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style-resolution.d.ts","sourceRoot":"","sources":["../src/style-resolution.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAEnB,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"style-resolution.d.ts","sourceRoot":"","sources":["../src/style-resolution.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAEnB,MAAM,eAAe,CAAC;AAIvB,OAAO,KAAK,EAAe,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAc,MAAM,YAAY,CAAC;AAE5D,KAAK,aAAa,GACZ,SAAS,GACT,UAAU,GACV,MAAM,GACN,UAAU,GACV,OAAO,GACP,QAAQ,GACR,WAAW,GACX,UAAU,GACV,OAAO,CAAC;AAEd,MAAM,WAAW,YAAY;IACzB,KAAK,EAAE,KAAK,CAAC;IAGb,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAEtC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;IAE1C,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;CACzC;AAyJD,wBAAgB,YAAY,CACxB,UAAU,EAAE,aAAa,EACzB,KAAK,EAAE,cAAc,EAAE,EACvB,GAAG,EAAE,YAAY,GAClB,aAAa,CAgBf;AAID,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,gBAAgB,EAAE,GAAG,EAAE,YAAY,GAAG,aAAa,CAE/F"}
|
package/dist/style-resolution.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
+
import { propKey, styleLayers } from '@nowline/core/internal';
|
|
2
|
+
import { isNonWorkingDisplay } from './non-working-display.js';
|
|
1
3
|
import { resolveColor } from './themes/index.js';
|
|
2
|
-
function propKey(prop) {
|
|
3
|
-
return prop.key.endsWith(':') ? prop.key.slice(0, -1) : prop.key;
|
|
4
|
-
}
|
|
5
4
|
function entityStyleToResolved(e, theme) {
|
|
6
5
|
return {
|
|
7
6
|
bg: resolveColor(e.bg, theme),
|
|
@@ -28,6 +27,7 @@ function entityStyleToResolved(e, theme) {
|
|
|
28
27
|
// single-top-strip layout and keep the major-ticks-only grid.
|
|
29
28
|
timelinePosition: 'top',
|
|
30
29
|
minorGrid: false,
|
|
30
|
+
nonWorking: 'hide',
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
33
|
// Apply a single style property (from `style` blocks, `default` blocks, or
|
|
@@ -105,6 +105,10 @@ function applyProp(target, key, value, theme) {
|
|
|
105
105
|
case 'minor-grid':
|
|
106
106
|
target.minorGrid = value === 'true';
|
|
107
107
|
break;
|
|
108
|
+
case 'non-working':
|
|
109
|
+
if (isNonWorkingDisplay(value))
|
|
110
|
+
target.nonWorking = value;
|
|
111
|
+
break;
|
|
108
112
|
default:
|
|
109
113
|
break;
|
|
110
114
|
}
|
|
@@ -134,53 +138,29 @@ function applyProperties(target, props, theme) {
|
|
|
134
138
|
}
|
|
135
139
|
}
|
|
136
140
|
}
|
|
137
|
-
function applyLabelStyleRefs(target, props, ctx) {
|
|
138
|
-
const labelsProp = props.find((p) => propKey(p) === 'labels');
|
|
139
|
-
if (!labelsProp)
|
|
140
|
-
return;
|
|
141
|
-
const names = labelsProp.value ? [labelsProp.value] : labelsProp.values;
|
|
142
|
-
for (const name of names) {
|
|
143
|
-
const label = ctx.labels.get(name);
|
|
144
|
-
if (!label)
|
|
145
|
-
continue;
|
|
146
|
-
// Label's `style:` ref gets applied.
|
|
147
|
-
const styleRef = label.properties.find((p) => propKey(p) === 'style');
|
|
148
|
-
if (styleRef?.value) {
|
|
149
|
-
applyStyleDecl(target, ctx.styles.get(styleRef.value), ctx.theme);
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
function applyEntityStyleRef(target, props, ctx) {
|
|
154
|
-
const styleProp = props.find((p) => propKey(p) === 'style');
|
|
155
|
-
if (!styleProp?.value)
|
|
156
|
-
return;
|
|
157
|
-
applyStyleDecl(target, ctx.styles.get(styleProp.value), ctx.theme);
|
|
158
|
-
}
|
|
159
141
|
// Five-level precedence chain from specs/rendering.md § Style Precedence:
|
|
160
142
|
// 1. system default (theme's EntityStyle for this type)
|
|
161
|
-
// 2. config `default <entity>`
|
|
162
|
-
//
|
|
163
|
-
//
|
|
164
|
-
//
|
|
165
|
-
//
|
|
143
|
+
// 2-5. core's `styleLayers`: the config `default <entity>` line (its `style:`
|
|
144
|
+
// ref, then its raw properties), label `style:` refs (the first label wins
|
|
145
|
+
// a shared key), the entity's own `style:` ref, then its inline properties
|
|
146
|
+
// (banned by the validator for roadmap entities; still supported for
|
|
147
|
+
// declared styles / defaults). A style or label this file does not declare
|
|
148
|
+
// changes nothing.
|
|
166
149
|
export function resolveStyle(entityType, props, ctx) {
|
|
167
150
|
const baseEntity = ctx.theme.entities[entityType];
|
|
168
151
|
const out = entityStyleToResolved(baseEntity, ctx.theme);
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
152
|
+
for (const layer of styleLayers(entityType, props, ctx)) {
|
|
153
|
+
switch (layer.level) {
|
|
154
|
+
case 'default':
|
|
155
|
+
case 'inline':
|
|
156
|
+
applyProperties(out, layer.props, ctx.theme);
|
|
157
|
+
break;
|
|
158
|
+
case 'label':
|
|
159
|
+
break;
|
|
160
|
+
default:
|
|
161
|
+
applyStyleDecl(out, layer.decl, ctx.theme);
|
|
176
162
|
}
|
|
177
163
|
}
|
|
178
|
-
// Level 3: label styles (labels on this entity, each label's `style:` ref)
|
|
179
|
-
applyLabelStyleRefs(out, props, ctx);
|
|
180
|
-
// Level 4: entity's own `style:` ref
|
|
181
|
-
applyEntityStyleRef(out, props, ctx);
|
|
182
|
-
// Level 5: inline props on the entity
|
|
183
|
-
applyProperties(out, props, ctx.theme);
|
|
184
164
|
return out;
|
|
185
165
|
}
|
|
186
166
|
// Resolve a label's *display* style (bg/fg/text + bracket etc.) as used on
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style-resolution.js","sourceRoot":"","sources":["../src/style-resolution.ts"],"names":[],"mappings":"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E,wDAAwD;AACxD,8EAA8E;AAC9E,8EAA8E;AAC9E,8EAA8E;AAC9E,wEAAwE;AACxE,8EAA8E;AAC9E,sBAAsB;AACtB,MAAM,UAAU,YAAY,CACxB,UAAyB,EACzB,KAAuB,EACvB,GAAiB;IAEjB,MAAM,UAAU,GAAG,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;IAClD,MAAM,GAAG,GAAG,qBAAqB,CAAC,UAAU,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC;IACzD,KAAK,MAAM,KAAK,IAAI,WAAW,CAAC,UAAU,EAAE,KAAK,EAAE,GAAG,CAAC,EAAE,CAAC;QACtD,QAAQ,KAAK,CAAC,KAAK,EAAE,CAAC;YAClB,KAAK,SAAS,CAAC;YACf,KAAK,QAAQ;gBACT,eAAe,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC;gBAC7C,MAAM;YACV,KAAK,OAAO;gBACR,MAAM;YACV;gBACI,cAAc,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC;QACnD,CAAC;IACL,CAAC;IACD,OAAO,GAAG,CAAC;AACf,CAAC;AAED,2EAA2E;AAC3E,sEAAsE;AACtE,MAAM,UAAU,qBAAqB,CAAC,KAAuB,EAAE,GAAiB;IAC5E,OAAO,YAAY,CAAC,OAAO,EAAE,KAAK,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC;AACxD,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rough px-width estimate for sans-serif text. Intentionally pessimistic
|
|
3
|
+
* (~0.58 em per char) so we err toward "doesn't fit" and trigger a
|
|
4
|
+
* spill or row bump rather than draw a title that clips.
|
|
5
|
+
*/
|
|
6
|
+
export declare function estimateTextWidth(text: string, fontSize: number): number;
|
|
7
|
+
/**
|
|
8
|
+
* `text` when it fits `maxWidth` (in px), else its longest prefix that fits
|
|
9
|
+
* with a trailing `…`, trailing whitespace dropped before the ellipsis. It
|
|
10
|
+
* always keeps the first character, so the result can overrun `maxWidth`
|
|
11
|
+
* when even one character and the ellipsis do not fit. Counts code points,
|
|
12
|
+
* so a surrogate pair is never split.
|
|
13
|
+
*/
|
|
14
|
+
export declare function ellipsizeToWidth(text: string, maxWidth: number, fontSize: number): string;
|
|
15
|
+
/**
|
|
16
|
+
* Word-wrap `text` so that no line is wider than `maxWidth` (in px).
|
|
17
|
+
* Wrap points are whitespace only: a long single word is kept on its
|
|
18
|
+
* own line even if it overflows `maxWidth` — we never split a word in
|
|
19
|
+
* the middle. The wrap is greedy (fill each line before starting the
|
|
20
|
+
* next), which yields the minimum possible line count for a given
|
|
21
|
+
* width.
|
|
22
|
+
*
|
|
23
|
+
* `firstLineMaxWidth` (default `maxWidth`) narrows only the FIRST line,
|
|
24
|
+
* for callers whose first line has to stay clear of something the later
|
|
25
|
+
* lines are below (the item bar's top-right decorations).
|
|
26
|
+
*/
|
|
27
|
+
export declare function wrapText(text: string, maxWidth: number, fontSize: number, firstLineMaxWidth?: number): string[];
|
|
28
|
+
//# sourceMappingURL=text-measure.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-measure.d.ts","sourceRoot":"","sources":["../src/text-measure.ts"],"names":[],"mappings":"AAQA;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAExE;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CASzF;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,QAAQ,CACpB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,iBAAiB,GAAE,MAAiB,GACrC,MAAM,EAAE,CAkBV"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
// Shared text-measurement heuristics for layout.
|
|
2
|
+
//
|
|
3
|
+
// Layout has no font metrics, so every caption / header / marker fit
|
|
4
|
+
// decision runs on one pessimistic per-character estimate. Keeping the
|
|
5
|
+
// estimate and the whitespace word-wrap built on it in a single module
|
|
6
|
+
// means the item-title wrap (`measureItem`) and the header-card wrap in
|
|
7
|
+
// `layout.ts` can never disagree about how wide a string is.
|
|
8
|
+
/**
|
|
9
|
+
* Rough px-width estimate for sans-serif text. Intentionally pessimistic
|
|
10
|
+
* (~0.58 em per char) so we err toward "doesn't fit" and trigger a
|
|
11
|
+
* spill or row bump rather than draw a title that clips.
|
|
12
|
+
*/
|
|
13
|
+
export function estimateTextWidth(text, fontSize) {
|
|
14
|
+
return text.length * fontSize * 0.58;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* `text` when it fits `maxWidth` (in px), else its longest prefix that fits
|
|
18
|
+
* with a trailing `…`, trailing whitespace dropped before the ellipsis. It
|
|
19
|
+
* always keeps the first character, so the result can overrun `maxWidth`
|
|
20
|
+
* when even one character and the ellipsis do not fit. Counts code points,
|
|
21
|
+
* so a surrogate pair is never split.
|
|
22
|
+
*/
|
|
23
|
+
export function ellipsizeToWidth(text, maxWidth, fontSize) {
|
|
24
|
+
if (estimateTextWidth(text, fontSize) <= maxWidth)
|
|
25
|
+
return text;
|
|
26
|
+
const chars = Array.from(text.trimStart());
|
|
27
|
+
for (let n = chars.length - 1; n >= 1; n--) {
|
|
28
|
+
const prefix = chars.slice(0, n).join('').trimEnd();
|
|
29
|
+
const candidate = `${prefix}…`;
|
|
30
|
+
if (estimateTextWidth(candidate, fontSize) <= maxWidth)
|
|
31
|
+
return candidate;
|
|
32
|
+
}
|
|
33
|
+
return `${chars[0] ?? ''}…`;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Word-wrap `text` so that no line is wider than `maxWidth` (in px).
|
|
37
|
+
* Wrap points are whitespace only: a long single word is kept on its
|
|
38
|
+
* own line even if it overflows `maxWidth` — we never split a word in
|
|
39
|
+
* the middle. The wrap is greedy (fill each line before starting the
|
|
40
|
+
* next), which yields the minimum possible line count for a given
|
|
41
|
+
* width.
|
|
42
|
+
*
|
|
43
|
+
* `firstLineMaxWidth` (default `maxWidth`) narrows only the FIRST line,
|
|
44
|
+
* for callers whose first line has to stay clear of something the later
|
|
45
|
+
* lines are below (the item bar's top-right decorations).
|
|
46
|
+
*/
|
|
47
|
+
export function wrapText(text, maxWidth, fontSize, firstLineMaxWidth = maxWidth) {
|
|
48
|
+
if (!text)
|
|
49
|
+
return [];
|
|
50
|
+
const words = text.split(/\s+/).filter((w) => w.length > 0);
|
|
51
|
+
if (words.length === 0)
|
|
52
|
+
return [];
|
|
53
|
+
const lines = [];
|
|
54
|
+
let cur = '';
|
|
55
|
+
for (const word of words) {
|
|
56
|
+
const trial = cur ? `${cur} ${word}` : word;
|
|
57
|
+
const limit = lines.length === 0 ? firstLineMaxWidth : maxWidth;
|
|
58
|
+
if (cur && estimateTextWidth(trial, fontSize) > limit) {
|
|
59
|
+
lines.push(cur);
|
|
60
|
+
cur = word;
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
cur = trial;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
if (cur)
|
|
67
|
+
lines.push(cur);
|
|
68
|
+
return lines;
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=text-measure.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-measure.js","sourceRoot":"","sources":["../src/text-measure.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,EAAE;AACF,qEAAqE;AACrE,uEAAuE;AACvE,uEAAuE;AACvE,wEAAwE;AACxE,6DAA6D;AAE7D;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAAY,EAAE,QAAgB;IAC5D,OAAO,IAAI,CAAC,MAAM,GAA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AAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACvB,MAAM,KAAK,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;QAC5C,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,QAAQ,CAAC;QAChE,IAAI,GAAG,IAAI,iBAAiB,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,KAAK,EAAE,CAAC;YACpD,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YAChB,GAAG,GAAG,IAAI,CAAC;QACf,CAAC;aAAM,CAAC;YACJ,GAAG,GAAG,KAAK,CAAC;QAChB,CAAC;IACL,CAAC;IACD,IAAI,GAAG;QAAE,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACzB,OAAO,KAAK,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contrast.d.ts","sourceRoot":"","sources":["../../src/themes/contrast.ts"],"names":[],"mappings":"AAGA,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAgB9D;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAMrD;AAED,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAI1D"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// WCAG 2.x contrast helpers over `#rgb` / `#rrggbb` hex colours. Used by the
|
|
2
|
+
// theme contrast-floor tests and by wave strip label colour selection.
|
|
3
|
+
export function hexToRgb(hex) {
|
|
4
|
+
let h = hex.trim().replace(/^#/, '');
|
|
5
|
+
if (h.length === 3) {
|
|
6
|
+
h = h
|
|
7
|
+
.split('')
|
|
8
|
+
.map((c) => c + c)
|
|
9
|
+
.join('');
|
|
10
|
+
}
|
|
11
|
+
if (!/^[0-9a-fA-F]{6}$/.test(h)) {
|
|
12
|
+
throw new Error(`Unsupported hex colour: ${hex}`);
|
|
13
|
+
}
|
|
14
|
+
return [
|
|
15
|
+
Number.parseInt(h.slice(0, 2), 16),
|
|
16
|
+
Number.parseInt(h.slice(2, 4), 16),
|
|
17
|
+
Number.parseInt(h.slice(4, 6), 16),
|
|
18
|
+
];
|
|
19
|
+
}
|
|
20
|
+
export function relativeLuminance(hex) {
|
|
21
|
+
const [r, g, b] = hexToRgb(hex).map((v) => {
|
|
22
|
+
const c = v / 255;
|
|
23
|
+
return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;
|
|
24
|
+
});
|
|
25
|
+
return 0.2126 * r + 0.7152 * g + 0.0722 * b;
|
|
26
|
+
}
|
|
27
|
+
export function contrastRatio(a, b) {
|
|
28
|
+
const la = relativeLuminance(a);
|
|
29
|
+
const lb = relativeLuminance(b);
|
|
30
|
+
return (Math.max(la, lb) + 0.05) / (Math.min(la, lb) + 0.05);
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=contrast.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contrast.js","sourceRoot":"","sources":["../../src/themes/contrast.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,uEAAuE;AAEvE,MAAM,UAAU,QAAQ,CAAC,GAAW;IAChC,IAAI,CAAC,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IACrC,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACjB,CAAC,GAAG,CAAC;aACA,KAAK,CAAC,EAAE,CAAC;aACT,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;aACjB,IAAI,CAAC,EAAE,CAAC,CAAC;IAClB,CAAC;I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G,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC;AACjE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dark.d.ts","sourceRoot":"","sources":["../../src/themes/dark.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAe,WAAW,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAGlE,eAAO,MAAM,SAAS,EAAE,WAUvB,CAAC;AAqBF,eAAO,MAAM,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"dark.d.ts","sourceRoot":"","sources":["../../src/themes/dark.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAe,WAAW,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAGlE,eAAO,MAAM,SAAS,EAAE,WAUvB,CAAC;AAqBF,eAAO,MAAM,SAAS,EAAE,KA4OvB,CAAC"}
|
package/dist/themes/dark.js
CHANGED
|
@@ -58,13 +58,19 @@ export const darkTheme = {
|
|
|
58
58
|
shadow: 'subtle',
|
|
59
59
|
cornerRadius: 'sm',
|
|
60
60
|
},
|
|
61
|
+
// Containers shade their body with `bg` as a light tint
|
|
62
|
+
// (CONTAINER_BODY_FILL_OPACITY); groups and parallels get distinct
|
|
63
|
+
// ones, and a parallel's header bracket is dashed, a group's solid
|
|
64
|
+
// (specs/true-width-layout.md §3.3).
|
|
61
65
|
parallel: {
|
|
62
66
|
...baseEntity,
|
|
63
|
-
|
|
67
|
+
bg: '#8c84ff',
|
|
68
|
+
bracket: 'dashed',
|
|
64
69
|
padding: 'xs',
|
|
65
70
|
},
|
|
66
71
|
group: {
|
|
67
72
|
...baseEntity,
|
|
73
|
+
bg: '#f0a832',
|
|
68
74
|
bracket: 'solid',
|
|
69
75
|
padding: 'xs',
|
|
70
76
|
fg: '#94a3b8',
|
|
@@ -121,6 +127,8 @@ export const darkTheme = {
|
|
|
121
127
|
timeline: {
|
|
122
128
|
gridLine: '#475569',
|
|
123
129
|
minorGridLine: '#334155',
|
|
130
|
+
nonWorkingSeam: '#6b7a90',
|
|
131
|
+
nonWorkingFill: '#94a3b8',
|
|
124
132
|
tickMark: '#334155',
|
|
125
133
|
labelText: '#cbd5e1',
|
|
126
134
|
panelFill: '#0f172a',
|
|
@@ -193,6 +201,15 @@ export const darkTheme = {
|
|
|
193
201
|
badgeStroke: '#475569',
|
|
194
202
|
badgeText: '#94a3b8',
|
|
195
203
|
},
|
|
204
|
+
wave: {
|
|
205
|
+
stripFill: '#042f2e',
|
|
206
|
+
stripFillAlt: '#134e4a',
|
|
207
|
+
labelText: '#99f6e4',
|
|
208
|
+
labelMuted: '#5eead4',
|
|
209
|
+
boundary: '#2dd4bf',
|
|
210
|
+
hatch: '#0f172a',
|
|
211
|
+
hatchOnDark: '#ffffff',
|
|
212
|
+
},
|
|
196
213
|
arrowhead: {
|
|
197
214
|
neutral: '#94a3b8',
|
|
198
215
|
light: '#64748b',
|
|
@@ -206,6 +223,16 @@ export const darkTheme = {
|
|
|
206
223
|
planned: '#94a3b8',
|
|
207
224
|
neutral: '#94a3b8',
|
|
208
225
|
},
|
|
226
|
+
// Item bar fill per status, applied by layout when the item's resolved
|
|
227
|
+
// `bg` is still `entities.item.bg` (m2d Resolution 3).
|
|
228
|
+
statusTint: {
|
|
229
|
+
done: '#052e16',
|
|
230
|
+
inProgress: '#172554',
|
|
231
|
+
atRisk: '#422006',
|
|
232
|
+
blocked: '#7f1d1d',
|
|
233
|
+
planned: '#1e293b',
|
|
234
|
+
neutral: '#1e293b',
|
|
235
|
+
},
|
|
209
236
|
// Status-dot palettes — see `light.ts` for the contract. Same
|
|
210
237
|
// two palettes both themes; dark-theme bars come in BOTH dark
|
|
211
238
|
// (status-tint) and bright (label-driven) flavors, so a single
|
package/dist/themes/dark.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dark.js","sourceRoot":"","sources":["../../src/themes/dark.ts"],"names":[],"mappings":"AAEA,4EAA4E;AAC5E,MAAM,CAA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C9D,+DAA+D;IAC/D,6DAA6D;IAC7D,4CAA4C;IAC5C,SAAS,EAAE;QACP,OAAO,EAAE;YACL,IAAI,EAAE,SAAS;YACf,UAAU,EAAE,SAAS;YACrB,MAAM,EAAE,SAAS;YACjB,OAAO,EAAE,SAAS;YAClB,OAAO,EAAE,SAAS;YAClB,OAAO,EAAE,SAAS;SACrB;QACD,MAAM,EAAE;YACJ,IAAI,EAAE,SAAS;YACf,UAAU,EAAE,SAAS;YACrB,MAAM,EAAE,SAAS;YACjB,OAAO,EAAE,SAAS;YAClB,OAAO,EAAE,SAAS;YAClB,OAAO,EAAE,SAAS;SACrB;KACJ;IACD,WAAW,EAAE;QACT,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,SAAS;KAClB;IACD,UAAU,EAAE;QACR,SAAS,EAAE,SAAS;QACpB,SAAS,EAAE,SAAS;KACvB;CACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grayscale.d.ts","sourceRoot":"","sources":["../../src/themes/grayscale.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAe,WAAW,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAKlE,eAAO,MAAM,cAAc,EAAE,WAU5B,CAAC;AAqBF,eAAO,MAAM,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"grayscale.d.ts","sourceRoot":"","sources":["../../src/themes/grayscale.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAe,WAAW,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAKlE,eAAO,MAAM,cAAc,EAAE,WAU5B,CAAC;AAqBF,eAAO,MAAM,cAAc,EAAE,KAsO5B,CAAC"}
|
package/dist/themes/grayscale.js
CHANGED
|
@@ -59,13 +59,19 @@ export const grayscaleTheme = {
|
|
|
59
59
|
shadow: 'subtle',
|
|
60
60
|
cornerRadius: 'sm',
|
|
61
61
|
},
|
|
62
|
+
// Containers shade their body with `bg` as a light tint
|
|
63
|
+
// (CONTAINER_BODY_FILL_OPACITY); groups and parallels get distinct
|
|
64
|
+
// ones, and a parallel's header bracket is dashed, a group's solid
|
|
65
|
+
// (specs/true-width-layout.md §3.3).
|
|
62
66
|
parallel: {
|
|
63
67
|
...baseEntity,
|
|
64
|
-
|
|
68
|
+
bg: '#9e9e9e',
|
|
69
|
+
bracket: 'dashed',
|
|
65
70
|
padding: 'xs',
|
|
66
71
|
},
|
|
67
72
|
group: {
|
|
68
73
|
...baseEntity,
|
|
74
|
+
bg: '#595959',
|
|
69
75
|
bracket: 'solid',
|
|
70
76
|
padding: 'xs',
|
|
71
77
|
fg: '#595959',
|
|
@@ -122,6 +128,8 @@ export const grayscaleTheme = {
|
|
|
122
128
|
timeline: {
|
|
123
129
|
gridLine: '#bdbdbd',
|
|
124
130
|
minorGridLine: '#d4d4d4',
|
|
131
|
+
nonWorkingSeam: '#9a9a9a',
|
|
132
|
+
nonWorkingFill: '#737373',
|
|
125
133
|
tickMark: '#bdbdbd',
|
|
126
134
|
labelText: '#737373',
|
|
127
135
|
panelFill: '#ffffff',
|
|
@@ -194,6 +202,15 @@ export const grayscaleTheme = {
|
|
|
194
202
|
badgeStroke: '#bdbdbd',
|
|
195
203
|
badgeText: '#595959',
|
|
196
204
|
},
|
|
205
|
+
wave: {
|
|
206
|
+
stripFill: '#fafafa',
|
|
207
|
+
stripFillAlt: '#e0e0e0',
|
|
208
|
+
labelText: '#212121',
|
|
209
|
+
labelMuted: '#616161',
|
|
210
|
+
boundary: '#616161',
|
|
211
|
+
hatch: '#000000',
|
|
212
|
+
hatchOnDark: '#ffffff',
|
|
213
|
+
},
|
|
197
214
|
arrowhead: {
|
|
198
215
|
neutral: '#595959',
|
|
199
216
|
light: '#9e9e9e',
|
|
@@ -207,6 +224,16 @@ export const grayscaleTheme = {
|
|
|
207
224
|
planned: '#bdbdbd',
|
|
208
225
|
neutral: '#bdbdbd',
|
|
209
226
|
},
|
|
227
|
+
// Item bar fill per status, applied by layout when the item's resolved
|
|
228
|
+
// `bg` is still `entities.item.bg` (m2d Resolution 3).
|
|
229
|
+
statusTint: {
|
|
230
|
+
done: '#ebebeb',
|
|
231
|
+
inProgress: '#e4e4e4',
|
|
232
|
+
atRisk: '#eeeeee',
|
|
233
|
+
blocked: '#dcdcdc',
|
|
234
|
+
planned: '#f5f5f5',
|
|
235
|
+
neutral: '#f5f5f5',
|
|
236
|
+
},
|
|
210
237
|
statusDot: {
|
|
211
238
|
onLight: {
|
|
212
239
|
done: '#3a3a3a',
|