@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
package/dist/index.js
CHANGED
|
@@ -1,13 +1,23 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
1
|
+
export { resolveWorkingCalendar } from './calendar-resolver.js';
|
|
2
|
+
export { cappedPixelsPerDay, MIN_PIXELS_PER_DAY, } from './canvas-width.js';
|
|
3
|
+
export { capacityIconDxTerms, estimateCapacitySuffixWidth, formatCapacityNumber, META_SUFFIX_DX_EM, parseCapacityValue, resolveCapacityIcon, } from './capacity.js';
|
|
4
|
+
export { CONTAINER_BODY_FILL_OPACITY, CONTAINER_BODY_PAD_PX, CONTAINER_BRACKET_LINE_OFFSET_PX, CONTAINER_HEADER_BAND_PX, CONTAINER_HEADER_TITLE_BASELINE_PX, CONTAINER_HEADER_TITLE_FONT_SIZE_PX, CONTAINER_MAX_FILLED_DEPTH, CONTAINER_NESTED_BODY_FILL_OPACITY, containerHeaderTitleX, } from './container-header-geometry.js';
|
|
5
|
+
export { ARROW_HEAD_LENGTH_PX, ARROW_HEAD_MIN_PX, ARROW_HEAD_WIDTH_PX, } from './edge-routing.js';
|
|
6
|
+
export { estimateFrameTabOwnerWidth, estimateFrameTabTitleWidth, FRAME_TAB_INNER_GAP_PX, FRAME_TAB_LEFT_INSET_PX, FRAME_TAB_MIN_WIDTH_PX, FRAME_TAB_OFFSET_FROM_BOX_PX, FRAME_TAB_OWNER_FONT_SIZE_PX, FRAME_TAB_OWNER_GLYPH_GAP_PX, FRAME_TAB_OWNER_GLYPH_PX, FRAME_TAB_RIGHT_INSET_PX, FRAME_TAB_TITLE_FONT_SIZE_PX, frameTabGeometry, } from './frame-tab-geometry.js';
|
|
7
|
+
export { HEADER_AUTHOR_FONT_SIZE_PX, HEADER_AUTHOR_LINE_HEIGHT_PX, HEADER_CARD_PADDING_BOTTOM, HEADER_CARD_PADDING_TOP, HEADER_CARD_PADDING_X, HEADER_LOGO_GAP_PX, HEADER_LOGO_MAX_WIDTH_PX, HEADER_LOGO_PAD_Y_PX, HEADER_TITLE_FONT_SIZE_PX, HEADER_TITLE_LINE_HEIGHT_PX, HEADER_TITLE_TO_AUTHOR_GAP_PX, } from './header-card-geometry.js';
|
|
8
|
+
export { roadmapLogoRef, scaleLogo, } from './header-logo.js';
|
|
4
9
|
export { INCLUDE_CHROME_BADGE_GAP_PX, INCLUDE_CHROME_BADGE_SIZE_PX, INCLUDE_CHROME_OFFSET_FROM_BOX_PX, INCLUDE_CHROME_SOURCE_GAP_PX, INCLUDE_CHROME_SOURCE_HALO_PAD_PX, INCLUDE_CHROME_SOURCE_PER_CHAR_PX, INCLUDE_CHROME_TAB_LABEL_PER_CHAR_PX, INCLUDE_CHROME_TAB_LEFT_INSET_PX, INCLUDE_CHROME_TAB_MIN_WIDTH_PX, INCLUDE_CHROME_TAB_RIGHT_INSET_PX, includeChromeGeometry, } from './include-chrome-geometry.js';
|
|
5
|
-
export { ITEM_CAPTION_INSET_X_PX, ITEM_CAPTION_META_BASELINE_OFFSET_PX, ITEM_CAPTION_META_FONT_SIZE_PX, ITEM_CAPTION_SPILL_GAP_PX, ITEM_CAPTION_TITLE_BASELINE_OFFSET_PX, ITEM_CAPTION_TITLE_FONT_SIZE_PX, ITEM_DECORATION_SPILL_GAP_PX, ITEM_FOOTNOTE_INDICATOR_BASELINE_OFFSET_PX, ITEM_FOOTNOTE_INDICATOR_INSET_RIGHT_PX, ITEM_FOOTNOTE_INDICATOR_STEP_PX, ITEM_LINK_ICON_INSET_PX, ITEM_LINK_ICON_TILE_SIZE_PX, ITEM_STATUS_DOT_INSET_RIGHT_PX, ITEM_STATUS_DOT_INSET_TOP_PX, ITEM_STATUS_DOT_RADIUS_PX, LABEL_CHIP_GAP_ABOVE_PROGRESS_STRIP_PX, LABEL_CHIP_GAP_BETWEEN_PX, LABEL_CHIP_HEIGHT_PX, MIN_BAR_WIDTH_FOR_DOT_PX, MIN_BAR_WIDTH_FOR_FOOTNOTE_PX, MIN_BAR_WIDTH_FOR_LINK_AND_DOT_PX, } from './item-bar-geometry.js';
|
|
10
|
+
export { computeTitleBarExtra, ITEM_CAPTION_INSET_X_PX, ITEM_CAPTION_META_BASELINE_OFFSET_PX, ITEM_CAPTION_META_FONT_SIZE_PX, ITEM_CAPTION_SPILL_GAP_PX, ITEM_CAPTION_TITLE_BASELINE_OFFSET_PX, ITEM_CAPTION_TITLE_FONT_SIZE_PX, ITEM_CAPTION_TITLE_LINE_HEIGHT_PX, ITEM_CAPTION_TITLE_MAX_LINES, ITEM_DECORATION_SPILL_GAP_PX, ITEM_FOOTNOTE_INDICATOR_BASELINE_OFFSET_PX, ITEM_FOOTNOTE_INDICATOR_FONT_SIZE_PX, ITEM_FOOTNOTE_INDICATOR_INSET_RIGHT_PX, ITEM_FOOTNOTE_INDICATOR_STEP_PX, ITEM_LINK_ICON_INSET_PX, ITEM_LINK_ICON_TILE_SIZE_PX, ITEM_LINK_ICON_TO_CAPTION_GAP_PX, ITEM_STATUS_DOT_INSET_RIGHT_PX, ITEM_STATUS_DOT_INSET_TOP_PX, ITEM_STATUS_DOT_RADIUS_PX, itemCaptionInsetX, itemCaptionLastBaselineOffset, itemCaptionMetaBaselineOffset, itemTitleFirstLineRightReservePx, LABEL_CHIP_GAP_ABOVE_PROGRESS_STRIP_PX, LABEL_CHIP_GAP_BETWEEN_PX, LABEL_CHIP_HEIGHT_PX, MIN_BAR_WIDTH_FOR_DOT_PX, MIN_BAR_WIDTH_FOR_FOOTNOTE_PX, MIN_BAR_WIDTH_FOR_LINK_AND_DOT_PX, } from './item-bar-geometry.js';
|
|
6
11
|
export { layoutRoadmap } from './layout.js';
|
|
7
12
|
export { collectLayoutInsights, } from './layout-insights.js';
|
|
8
|
-
export {
|
|
13
|
+
export { MARKER_BOLD_WIDTH_FACTOR } from './nodes/marker-geometry.js';
|
|
14
|
+
export { isNonWorkingDisplay, NON_WORKING_DISPLAYS, parseNonWorkingDisplay, } from './non-working-display.js';
|
|
15
|
+
export { civilDateInZone, hasImpossibleNowDate, normalizeZone, resolveToday, TimezoneError, } from './resolve-today.js';
|
|
9
16
|
export { scheduleRoadmap } from './schedule.js';
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
17
|
+
export { estimateTextWidth } from './text-measure.js';
|
|
18
|
+
export { contrastRatio, relativeLuminance } from './themes/contrast.js';
|
|
19
|
+
export { darkTheme, grayscaleTheme, lightTheme, normalizeThemeName, THEME_NAMES, themes, } from './themes/index.js';
|
|
20
|
+
export { ACCENT_DASH_PATTERN, ATTRIBUTION_BAR_LOGICAL_WIDTH, ATTRIBUTION_BAR_LOGICAL_X, ATTRIBUTION_INE_LOGICAL_X, ATTRIBUTION_LINK, ATTRIBUTION_NOW_LOGICAL_X, ATTRIBUTION_PREFIX_FONT_SIZE, ATTRIBUTION_SCALE, ATTRIBUTION_TEXT, ATTRIBUTION_WORDMARK_FONT_SIZE, CORNER_RADIUS_PX, EDGE_CORNER_RADIUS, FONT_STACK, FOOTNOTE_HEADER_BASELINE_OFFSET_PX, FOOTNOTE_HEADER_HEIGHT_PX, FOOTNOTE_PANEL_PADDING_PX, FOOTNOTE_ROW_HEIGHT, FRAME_TAB_HEIGHT_PX, FRAME_TAB_LABEL_BASELINE_OFFSET_PX, HEADER_HEIGHT_PX, NON_WORKING_FILL_OPACITY, NOW_PILL_CORNER_RADIUS_PX, NOW_PILL_HEIGHT_PX, NOW_PILL_LABEL_BASELINE_OFFSET_PX, NOW_PILL_LABEL_FONT_SIZE_PX, NOW_PILL_LABEL_INSET_X_PX, NOW_PILL_WIDTH_PX, NOWLINE_STROKE_WIDTH_PX, PROGRESS_STRIP_HEIGHT_PX, TEXT_SIZE_PX, TIMELINE_TICK_LABEL_BASELINE_OFFSET_PX, TIMELINE_TICK_LABEL_FONT_SIZE_PX, TIMELINE_TICK_PANEL_HEIGHT_PX, timelineTickLabelBaselineOffsetPx, WAVE_BOUNDARY_WIDTH_PX, WAVE_CELL_INSET_PX, WAVE_CROSS_DASH, WAVE_HATCH_OPACITY, WAVE_HATCH_STROKE_PX, WAVE_HATCH_TILE_PX, WAVE_LABEL_HALO_INSET_Y_PX, WAVE_LABEL_HALO_PAD_PX, WAVE_LEGEND_BASELINE_OFFSET_PX, WAVE_LEGEND_GAP_PX, WAVE_LEGEND_LINE_PX, WAVE_LEGEND_SWATCH_GAP_PX, WAVE_LEGEND_SWATCH_HEIGHT_PX, WAVE_LEGEND_SWATCH_WIDTH_PX, WAVE_STRIP_HEIGHT_PX, WAVE_STRIP_LABEL_FONT_SIZE_PX, WAVE_STRIP_LABEL_PAD_PX, WAVE_STYLED_STRIP_MIX_OPACITY, WAVE_STYLED_TINT_OPACITY, } from './themes/shared.js';
|
|
12
21
|
export * from './types.js';
|
|
22
|
+
export { calendarExceptions } from './working-calendar.js';
|
|
13
23
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAyB,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AACvF,OAAO,EAEH,kBAAkB,EAClB,kBAAkB,GACrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACH,mBAAmB,EACnB,2BAA2B,EAC3B,oB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iC,EACjC,2BAA2B,EAC3B,yBAAyB,EACzB,iBAAiB,EACjB,uBAAuB,EACvB,wBAAwB,EACxB,YAAY,EACZ,sCAAsC,EACtC,gCAAgC,EAChC,6BAA6B,EAC7B,iCAAiC,EACjC,sBAAsB,EACtB,kBAAkB,EAClB,eAAe,EACf,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,EAClB,0BAA0B,EAC1B,sBAAsB,EACtB,8BAA8B,EAC9B,kBAAkB,EAClB,mBAAmB,EACnB,yBAAyB,EACzB,4BAA4B,EAC5B,2BAA2B,EAC3B,oBAAoB,EACpB,6BAA6B,EAC7B,uBAAuB,EACvB,6BAA6B,EAC7B,wBAAwB,GAC3B,MAAM,oBAAoB,CAAC;AAC5B,cAAc,YAAY,CAAC;AAM3B,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -21,26 +21,34 @@ export interface ItemInlineDatePinInputs {
|
|
|
21
21
|
*/
|
|
22
22
|
export declare function computeItemInlineDatePins(opts: ItemInlineDatePinInputs): InlineDatePin[];
|
|
23
23
|
export interface ContainerInlineDatePinInputs {
|
|
24
|
-
/**
|
|
25
|
-
*
|
|
26
|
-
* and bare parallels it is the logical bounding box (leftmost child
|
|
27
|
-
* start, rightmost child end, top of the highest child row). */
|
|
24
|
+
/** The container's box: `box.y` is its header's top, `box.x` and
|
|
25
|
+
* `box.width` its dates. */
|
|
28
26
|
box: BoundingBox;
|
|
29
27
|
afterDate: string | undefined;
|
|
30
28
|
beforeDate: string | undefined;
|
|
29
|
+
/** The title painted in the header, if any. */
|
|
30
|
+
title: string | undefined;
|
|
31
31
|
}
|
|
32
32
|
/**
|
|
33
33
|
* Compute inline-date pin glyph placements for a container (group or
|
|
34
|
-
* parallel).
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
34
|
+
* parallel). Containers never spill. Both glyphs sit in the header's title
|
|
35
|
+
* row, above the bracket line (specs/true-width-layout.md §3.3):
|
|
36
|
+
*
|
|
37
|
+
* - `after` takes the row's leftmost slot, on the container's start; the
|
|
38
|
+
* title follows one gap past it (`containerHeaderTitleX`).
|
|
39
|
+
* - `before` sits the standard inset short of the container's end (a
|
|
40
|
+
* sibling may start on that end, level with the header), but never
|
|
41
|
+
* slides left onto the title (estimated width) or the `after` glyph:
|
|
42
|
+
* when those run past its slot, it sits one gap past whichever ends
|
|
43
|
+
* last, beyond the bracket's end, and the row reserves it.
|
|
38
44
|
*/
|
|
39
45
|
export declare function computeContainerInlineDatePins(opts: ContainerInlineDatePinInputs): InlineDatePin[];
|
|
40
46
|
/**
|
|
41
|
-
* Returns the first ISO date literal in `values
|
|
42
|
-
* is present. The validator enforces
|
|
43
|
-
* direction" so this lookup is unambiguous.
|
|
47
|
+
* Returns the first ISO date literal in `values` that names a real
|
|
48
|
+
* calendar day, or undefined when none is present. The validator enforces
|
|
49
|
+
* "at most one inline date per direction" so this lookup is unambiguous.
|
|
50
|
+
* An impossible day (`2026-02-30`, NL.E0405) is no date: the scheduler
|
|
51
|
+
* ignores it, so it gets no glyph either.
|
|
44
52
|
*/
|
|
45
53
|
export declare function pickInlineDate(values: readonly string[]): string | undefined;
|
|
46
54
|
//# sourceMappingURL=inline-date-pin-geometry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inline-date-pin-geometry.d.ts","sourceRoot":"","sources":["../src/inline-date-pin-geometry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"inline-date-pin-geometry.d.ts","sourceRoot":"","sources":["../src/inline-date-pin-geometry.ts"],"names":[],"mappings":"AAyCA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAS,MAAM,YAAY,CAAC;AAEpE,MAAM,WAAW,uBAAuB;IACpC,GAAG,EAAE,WAAW,CAAC;IACjB,8EAA8E;IAC9E,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,gFAAgF;IAChF,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,WAAW,EAAE,OAAO,CAAC;IACrB,6EAA6E;IAC7E,aAAa,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;;;GASG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,uBAAuB,GAAG,aAAa,EAAE,CAmDxF;AAED,MAAM,WAAW,4BAA4B;IACzC;iCAC6B;IAC7B,GAAG,EAAE,WAAW,CAAC;IACjB,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,+CAA+C;IAC/C,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,8BAA8B,CAC1C,IAAI,EAAE,4BAA4B,GACnC,aAAa,EAAE,CAoCjB;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,CAK5E"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
// slot; `before:DATE` paints it in the top-RIGHT slot. The two helpers
|
|
5
5
|
// below produce `Point` coordinates for the glyph's top-left corner, plus
|
|
6
6
|
// a `spilled` flag indicating whether the bar was too narrow to host the
|
|
7
|
-
// glyph inside (item case only — containers
|
|
7
|
+
// glyph inside (item case only — containers never spill).
|
|
8
8
|
//
|
|
9
9
|
// Slot interleaving rules (per specs/rendering.md "Inline-date glyph"):
|
|
10
10
|
//
|
|
@@ -18,11 +18,13 @@
|
|
|
18
18
|
// footnotes are present (so the inline-date glyph inserts at the LEFT
|
|
19
19
|
// end of the existing badge cluster rather than reordering it).
|
|
20
20
|
//
|
|
21
|
-
// Container (group, parallel):
|
|
22
|
-
//
|
|
23
|
-
//
|
|
24
|
-
//
|
|
25
|
-
import {
|
|
21
|
+
// Container (group, parallel): the glyphs sit in the header band, in the
|
|
22
|
+
// title row above the bracket (see `computeContainerInlineDatePins`).
|
|
23
|
+
// Containers don't carry status dots or footnote indicators, so the
|
|
24
|
+
// only neighbor to clear is the container's own title.
|
|
25
|
+
import { parseIsoDate } from '@nowline/core/internal';
|
|
26
|
+
import { CONTAINER_BRACKET_LINE_OFFSET_PX, containerHeaderTitleWidth, containerHeaderTitleX, } from './container-header-geometry.js';
|
|
27
|
+
import { INLINE_DATE_GLYPH_GAP_PX, INLINE_DATE_GLYPH_INSET_RIGHT_PX, INLINE_DATE_GLYPH_INSET_TOP_PX, INLINE_DATE_GLYPH_TILE_SIZE_PX, ITEM_CAPTION_SPILL_GAP_PX, inlineDateGlyphSpills, itemAfterGlyphInsideLeftX, itemBeforeGlyphInsideLeftX, } from './item-bar-geometry.js';
|
|
26
28
|
/**
|
|
27
29
|
* Compute inline-date pin glyph placements for an item bar. Returns an
|
|
28
30
|
* empty array when neither `afterDate` nor `beforeDate` is set.
|
|
@@ -40,14 +42,12 @@ export function computeItemInlineDatePins(opts) {
|
|
|
40
42
|
const pins = [];
|
|
41
43
|
const tileSize = INLINE_DATE_GLYPH_TILE_SIZE_PX;
|
|
42
44
|
const topY = box.y + INLINE_DATE_GLYPH_INSET_TOP_PX;
|
|
43
|
-
const spilled = box.width
|
|
45
|
+
const spilled = inlineDateGlyphSpills(box.width);
|
|
44
46
|
if (afterDate) {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
INLINE_DATE_GLYPH_GAP_PX
|
|
50
|
-
: box.x + INLINE_DATE_GLYPH_INSET_LEFT_PX;
|
|
47
|
+
// Walk RIGHT past the link tile when there is one; the formula is
|
|
48
|
+
// shared with the caption's left inset, see
|
|
49
|
+
// `itemAfterGlyphInsideLeftX`.
|
|
50
|
+
const insideLeftX = itemAfterGlyphInsideLeftX(box.x, hasLinkIcon);
|
|
51
51
|
const glyphLeft = spilled
|
|
52
52
|
? {
|
|
53
53
|
x: box.x - ITEM_CAPTION_SPILL_GAP_PX - tileSize,
|
|
@@ -63,30 +63,17 @@ export function computeItemInlineDatePins(opts) {
|
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
65
|
if (beforeDate) {
|
|
66
|
-
// Walk LEFT from the rightmost top-decoration slot
|
|
67
|
-
//
|
|
68
|
-
//
|
|
69
|
-
// - status dot left edge sits at (box.right - INSET_RIGHT - DOT_RADIUS)
|
|
70
|
-
// - inline-date glyph sits one INLINE_DATE_GLYPH_GAP_PX further left
|
|
66
|
+
// Walk LEFT from the rightmost top-decoration slot; the formula is
|
|
67
|
+
// shared with the title first-line clearance, see
|
|
68
|
+
// `itemBeforeGlyphInsideLeftX`.
|
|
71
69
|
const rightEdge = box.x + box.width;
|
|
72
|
-
|
|
73
|
-
if (footnoteCount > 0) {
|
|
74
|
-
const leftmostFootnoteCenter = rightEdge -
|
|
75
|
-
ITEM_FOOTNOTE_INDICATOR_INSET_RIGHT_PX -
|
|
76
|
-
(footnoteCount - 1) * ITEM_FOOTNOTE_INDICATOR_STEP_PX;
|
|
77
|
-
anchorRightX = leftmostFootnoteCenter - INLINE_DATE_GLYPH_GAP_PX;
|
|
78
|
-
}
|
|
79
|
-
else {
|
|
80
|
-
const dotLeftEdge = rightEdge - ITEM_STATUS_DOT_INSET_RIGHT_PX - ITEM_STATUS_DOT_RADIUS_PX;
|
|
81
|
-
anchorRightX = dotLeftEdge - INLINE_DATE_GLYPH_GAP_PX;
|
|
82
|
-
}
|
|
83
|
-
const insideRightX = anchorRightX - tileSize;
|
|
70
|
+
const insideLeftX = itemBeforeGlyphInsideLeftX(rightEdge, footnoteCount);
|
|
84
71
|
const glyphLeft = spilled
|
|
85
72
|
? {
|
|
86
73
|
x: rightEdge + ITEM_CAPTION_SPILL_GAP_PX,
|
|
87
74
|
y: topY,
|
|
88
75
|
}
|
|
89
|
-
: { x:
|
|
76
|
+
: { x: insideLeftX, y: topY };
|
|
90
77
|
pins.push({
|
|
91
78
|
side: 'before',
|
|
92
79
|
isoDate: beforeDate,
|
|
@@ -99,35 +86,45 @@ export function computeItemInlineDatePins(opts) {
|
|
|
99
86
|
}
|
|
100
87
|
/**
|
|
101
88
|
* Compute inline-date pin glyph placements for a container (group or
|
|
102
|
-
* parallel).
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
89
|
+
* parallel). Containers never spill. Both glyphs sit in the header's title
|
|
90
|
+
* row, above the bracket line (specs/true-width-layout.md §3.3):
|
|
91
|
+
*
|
|
92
|
+
* - `after` takes the row's leftmost slot, on the container's start; the
|
|
93
|
+
* title follows one gap past it (`containerHeaderTitleX`).
|
|
94
|
+
* - `before` sits the standard inset short of the container's end (a
|
|
95
|
+
* sibling may start on that end, level with the header), but never
|
|
96
|
+
* slides left onto the title (estimated width) or the `after` glyph:
|
|
97
|
+
* when those run past its slot, it sits one gap past whichever ends
|
|
98
|
+
* last, beyond the bracket's end, and the row reserves it.
|
|
106
99
|
*/
|
|
107
100
|
export function computeContainerInlineDatePins(opts) {
|
|
108
|
-
const { box, afterDate, beforeDate } = opts;
|
|
101
|
+
const { box, afterDate, beforeDate, title } = opts;
|
|
109
102
|
if (!afterDate && !beforeDate)
|
|
110
103
|
return [];
|
|
111
104
|
const pins = [];
|
|
112
105
|
const tileSize = INLINE_DATE_GLYPH_TILE_SIZE_PX;
|
|
113
|
-
const topY = box.y +
|
|
106
|
+
const topY = box.y + (CONTAINER_BRACKET_LINE_OFFSET_PX - tileSize) / 2;
|
|
107
|
+
// Right edge of whatever already occupies the row's left end.
|
|
108
|
+
let leftClearX = title
|
|
109
|
+
? containerHeaderTitleX(box.x, Boolean(afterDate)) + containerHeaderTitleWidth(title)
|
|
110
|
+
: box.x;
|
|
114
111
|
if (afterDate) {
|
|
112
|
+
leftClearX = Math.max(leftClearX, box.x + tileSize);
|
|
115
113
|
pins.push({
|
|
116
114
|
side: 'after',
|
|
117
115
|
isoDate: afterDate,
|
|
118
|
-
glyphTopLeft: { x: box.x
|
|
116
|
+
glyphTopLeft: { x: box.x, y: topY },
|
|
119
117
|
glyphSize: tileSize,
|
|
120
118
|
spilled: false,
|
|
121
119
|
});
|
|
122
120
|
}
|
|
123
121
|
if (beforeDate) {
|
|
122
|
+
const flushRightX = box.x + box.width - INLINE_DATE_GLYPH_INSET_RIGHT_PX - tileSize;
|
|
123
|
+
const clearX = leftClearX > box.x ? leftClearX + INLINE_DATE_GLYPH_GAP_PX : box.x;
|
|
124
124
|
pins.push({
|
|
125
125
|
side: 'before',
|
|
126
126
|
isoDate: beforeDate,
|
|
127
|
-
glyphTopLeft: {
|
|
128
|
-
x: box.x + box.width - INLINE_DATE_GLYPH_INSET_RIGHT_PX - tileSize,
|
|
129
|
-
y: topY,
|
|
130
|
-
},
|
|
127
|
+
glyphTopLeft: { x: Math.max(flushRightX, clearX), y: topY },
|
|
131
128
|
glyphSize: tileSize,
|
|
132
129
|
spilled: false,
|
|
133
130
|
});
|
|
@@ -135,13 +132,15 @@ export function computeContainerInlineDatePins(opts) {
|
|
|
135
132
|
return pins;
|
|
136
133
|
}
|
|
137
134
|
/**
|
|
138
|
-
* Returns the first ISO date literal in `values
|
|
139
|
-
* is present. The validator enforces
|
|
140
|
-
* direction" so this lookup is unambiguous.
|
|
135
|
+
* Returns the first ISO date literal in `values` that names a real
|
|
136
|
+
* calendar day, or undefined when none is present. The validator enforces
|
|
137
|
+
* "at most one inline date per direction" so this lookup is unambiguous.
|
|
138
|
+
* An impossible day (`2026-02-30`, NL.E0405) is no date: the scheduler
|
|
139
|
+
* ignores it, so it gets no glyph either.
|
|
141
140
|
*/
|
|
142
141
|
export function pickInlineDate(values) {
|
|
143
142
|
for (const v of values) {
|
|
144
|
-
if (
|
|
143
|
+
if (parseIsoDate(v))
|
|
145
144
|
return v;
|
|
146
145
|
}
|
|
147
146
|
return undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inline-date-pin-geometry.js","sourceRoot":"","sources":["../src/inline-date-pin-geometry.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,EAAE;AACF,2EAA2E;AAC3E,uEAAuE;AACvE,0EAA0E;AAC1E,yEAAyE;AACzE
|
|
1
|
+
{"version":3,"file":"inline-date-pin-geometry.js","sourceRoot":"","sources":["../src/inline-date-pin-geometry.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,EAAE;AACF,2EAA2E;AAC3E,uEAAuE;AACvE,0EAA0E;AAC1E,yEAAyE;AACzE,0DAA0D;AAC1D,EAAE;AACF,wEAAwE;AACxE,EAAE;AACF,2EAA2E;AAC3E,uEAAuE;AACvE,gBAAgB;AAChB,EAAE;AACF,0EAA0E;AAC1E,0EAA0E;AAC1E,yEAAyE;AACzE,wEAAwE;AACxE,kEAAkE;AAClE,EAAE;AACF,2EAA2E;AAC3E,wEAAwE;AACxE,sEAAsE;AACtE,yDAAyD;AAEzD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EACH,gCAAgC,EAChC,yBAAyB,EACzB,qBAAqB,GACxB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACH,wBAAwB,EACxB,gCAAgC,EAChC,8BAA8B,EAC9B,8BAA8B,EAC9B,yBAAyB,EACzB,qBAAqB,EACrB,yBAAyB,EACzB,0BAA0B,GAC7B,MAAM,wBAAwB,CAAC;AAchC;;;;;;;;;GASG;AACH,MAAM,UAAU,yBAAyB,CAAC,IAA6B;IACnE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,aAAa,EAAE,GAAG,IAAI,CAAC;IACxE,IAAI,CAAC,SAAS,IAAI,CAAC,UAAU;QAAE,OAAO,EAAE,CAAC;IAEzC,MAAM,IAAI,GAAoB,EAAE,CAAC;IACjC,MAAM,QAAQ,GAAG,8BAA8B,CAAC;IAChD,MAAM,IAAI,GAAG,GAAG,CAAC,CAAC,GAAG,8BAA8B,CAAC;IACpD,MAAM,OAAO,GAAG,qBAAqB,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAEjD,IAAI,SAAS,EAAE,CAAC;QACZ,kEAAkE;QAClE,4CAA4C;QAC5C,+BAA+B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AC,EAAE,CAAC,EAAE,IAAI,EAAE;YAC3D,SAAS,EAAE,QAAQ;YACnB,OAAO,EAAE,KAAK;SACjB,CAAC,CAAC;IACP,CAAC;IAED,OAAO,IAAI,CAAC;AAChB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAAC,MAAyB;IACpD,KAAK,MAAM,CAAC,IAAI,MAAM,EAAE,CAAC;QACrB,IAAI,YAAY,CAAC,CAAC,CAAC;YAAE,OAAO,CAAC,CAAC;IAClC,CAAC;IACD,OAAO,SAAS,CAAC;AACrB,CAAC"}
|
|
@@ -15,6 +15,45 @@ export declare const ITEM_CAPTION_META_BASELINE_OFFSET_PX = 38;
|
|
|
15
15
|
export declare const ITEM_CAPTION_TITLE_FONT_SIZE_PX = 13;
|
|
16
16
|
/** Font size (px) of the meta text. */
|
|
17
17
|
export declare const ITEM_CAPTION_META_FONT_SIZE_PX = 11;
|
|
18
|
+
/**
|
|
19
|
+
* Baseline-to-baseline pitch (px) between consecutive TITLE lines when
|
|
20
|
+
* a long title word-wraps inside the bar. The meta line sits one more
|
|
21
|
+
* pitch below the last title line for every extra title line, see
|
|
22
|
+
* `itemCaptionMetaBaselineOffset`.
|
|
23
|
+
*/
|
|
24
|
+
export declare const ITEM_CAPTION_TITLE_LINE_HEIGHT_PX = 16;
|
|
25
|
+
/**
|
|
26
|
+
* Most title lines layout will wrap a title onto inside the bar. A
|
|
27
|
+
* title that needs more than this spills to the right of the bar as a
|
|
28
|
+
* single line instead.
|
|
29
|
+
*/
|
|
30
|
+
export declare const ITEM_CAPTION_TITLE_MAX_LINES = 2;
|
|
31
|
+
/**
|
|
32
|
+
* Baseline Y (px from the bar's top) of the meta line when the title
|
|
33
|
+
* occupies `lineCount` lines. One line gives the classic
|
|
34
|
+
* `ITEM_CAPTION_META_BASELINE_OFFSET_PX`; each extra title line pushes
|
|
35
|
+
* the meta baseline down by `ITEM_CAPTION_TITLE_LINE_HEIGHT_PX`.
|
|
36
|
+
*/
|
|
37
|
+
export declare function itemCaptionMetaBaselineOffset(lineCount: number): number;
|
|
38
|
+
/**
|
|
39
|
+
* Baseline Y (px from the bar's top) of the LAST caption line: the
|
|
40
|
+
* meta line when the item has one, otherwise the final title line.
|
|
41
|
+
* Anything stacked below the caption (label chips) must clear this.
|
|
42
|
+
*/
|
|
43
|
+
export declare function itemCaptionLastBaselineOffset(lineCount: number, hasMeta: boolean): number;
|
|
44
|
+
/**
|
|
45
|
+
* Extra bar height (px) a wrapped title needs on top of the default
|
|
46
|
+
* `bandwidth`. The default bar is sized so the caption's last baseline
|
|
47
|
+
* is at most `ITEM_CAPTION_META_BASELINE_OFFSET_PX`; anything below
|
|
48
|
+
* that grows the bar by the overshoot:
|
|
49
|
+
*
|
|
50
|
+
* - 1 title line (with or without meta): 0.
|
|
51
|
+
* - 2 title lines, no meta: line 2 lands at baseline 36, so 0.
|
|
52
|
+
* - 2 title lines + meta: meta baseline 54, so 16.
|
|
53
|
+
*
|
|
54
|
+
* The same number is the row-pitch increase for the bar's row.
|
|
55
|
+
*/
|
|
56
|
+
export declare function computeTitleBarExtra(lineCount: number, hasMeta: boolean): number;
|
|
18
57
|
/** Distance (px) from the bar's right edge to the dot's center. */
|
|
19
58
|
export declare const ITEM_STATUS_DOT_INSET_RIGHT_PX = 12;
|
|
20
59
|
/** Distance (px) from the bar's top edge to the dot's center. */
|
|
@@ -28,6 +67,12 @@ export declare const ITEM_STATUS_DOT_RADIUS_PX = 5;
|
|
|
28
67
|
export declare const ITEM_FOOTNOTE_INDICATOR_INSET_RIGHT_PX = 22;
|
|
29
68
|
/** Baseline Y (px from bar's top) for footnote indicator digits. */
|
|
30
69
|
export declare const ITEM_FOOTNOTE_INDICATOR_BASELINE_OFFSET_PX = 14;
|
|
70
|
+
/**
|
|
71
|
+
* Font size (px) of the footnote indicator digits. The renderer paints
|
|
72
|
+
* them at this size and layout measures them with it (to find the
|
|
73
|
+
* cluster's left edge), so both read the same constant.
|
|
74
|
+
*/
|
|
75
|
+
export declare const ITEM_FOOTNOTE_INDICATOR_FONT_SIZE_PX = 10;
|
|
31
76
|
/**
|
|
32
77
|
* Horizontal step (px) between consecutive footnote indicators when
|
|
33
78
|
* an item carries more than one footnote — they walk LEFT from the
|
|
@@ -38,6 +83,42 @@ export declare const ITEM_FOOTNOTE_INDICATOR_STEP_PX = 8;
|
|
|
38
83
|
export declare const ITEM_LINK_ICON_TILE_SIZE_PX = 14;
|
|
39
84
|
/** Distance (px) from the bar's right/bottom edges to the tile's edge. */
|
|
40
85
|
export declare const ITEM_LINK_ICON_INSET_PX = 6;
|
|
86
|
+
/**
|
|
87
|
+
* Horizontal gap (px) between the link-icon tile's right edge and the
|
|
88
|
+
* start of the caption text when both render inside the bar.
|
|
89
|
+
*/
|
|
90
|
+
export declare const ITEM_LINK_ICON_TO_CAPTION_GAP_PX = 4;
|
|
91
|
+
/**
|
|
92
|
+
* The item carries an inline `after:DATE` glyph, on a bar of the given
|
|
93
|
+
* painted width. Passed to `itemCaptionInsetX` so the glyph, not just
|
|
94
|
+
* the link tile, reserves room at the caption's left edge.
|
|
95
|
+
*/
|
|
96
|
+
export interface ItemCaptionAfterGlyph {
|
|
97
|
+
/** Painted bar width (px): `box.width`. Decides whether the glyph spills. */
|
|
98
|
+
barWidth: number;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Left inset (px) of the in-bar caption from the bar's left edge. It is
|
|
102
|
+
* `ITEM_CAPTION_INSET_X_PX` normally, pushed right past the link-icon
|
|
103
|
+
* tile (and its gap) when the bar carries a link icon, and pushed right
|
|
104
|
+
* past the `after:` inline-date glyph (and a gap) when the bar carries
|
|
105
|
+
* one INSIDE it:
|
|
106
|
+
*
|
|
107
|
+
* - no link icon, no glyph: 12
|
|
108
|
+
* - link icon, no glyph: 24
|
|
109
|
+
* - glyph, no link icon: 22 (the glyph spans 6..18, plus a 4 px gap)
|
|
110
|
+
* - glyph and link icon: 40 (the glyph spans 24..36, plus a 4 px gap)
|
|
111
|
+
*
|
|
112
|
+
* A glyph on a bar narrower than `MIN_BAR_WIDTH_FOR_INLINE_DATE_PX`
|
|
113
|
+
* spills out of the bar to the left and reserves nothing.
|
|
114
|
+
*
|
|
115
|
+
* `hasLinkIcon` is the same flag `computeItemInlineDatePins` places the
|
|
116
|
+
* glyph with, and the glyph's right edge comes from the same helper
|
|
117
|
+
* (`itemAfterGlyphInsideLeftX`), so the inset and the glyph can't
|
|
118
|
+
* disagree. The inset applies to every caption line, not only line 1,
|
|
119
|
+
* so the caption's left edge stays straight.
|
|
120
|
+
*/
|
|
121
|
+
export declare function itemCaptionInsetX(hasLinkIcon: boolean, afterGlyph?: ItemCaptionAfterGlyph): number;
|
|
41
122
|
/**
|
|
42
123
|
* Horizontal gap (px) between consecutive decorations (status dot,
|
|
43
124
|
* link icon, footnote, title) when they spill into the column to
|
|
@@ -45,10 +126,12 @@ export declare const ITEM_LINK_ICON_INSET_PX = 6;
|
|
|
45
126
|
*/
|
|
46
127
|
export declare const ITEM_DECORATION_SPILL_GAP_PX = 4;
|
|
47
128
|
/**
|
|
48
|
-
* Minimum bar width (px)
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
129
|
+
* Minimum bar width (px) at which the status dot sits INSIDE the bar:
|
|
130
|
+
* the dot's centre is `ITEM_STATUS_DOT_INSET_RIGHT_PX` from the right
|
|
131
|
+
* edge, so a bar of twice that width has the same air on both sides
|
|
132
|
+
* of it (the centre sits mid-bar). A narrower bar would crowd the
|
|
133
|
+
* dot against its left edge, so the dot spills into the caption
|
|
134
|
+
* column to the right of the bar instead.
|
|
52
135
|
*/
|
|
53
136
|
export declare const MIN_BAR_WIDTH_FOR_DOT_PX: number;
|
|
54
137
|
/**
|
|
@@ -67,6 +150,36 @@ export declare const MIN_BAR_WIDTH_FOR_LINK_AND_DOT_PX: number;
|
|
|
67
150
|
* for one digit is 8px (font-size 10, bold).
|
|
68
151
|
*/
|
|
69
152
|
export declare const MIN_BAR_WIDTH_FOR_FOOTNOTE_PX: number;
|
|
153
|
+
/** What sits in a bar's spill column, in reading order. */
|
|
154
|
+
export interface SpillClusterInput {
|
|
155
|
+
/** The bar's visual right edge. */
|
|
156
|
+
barRightX: number;
|
|
157
|
+
/** The link icon spilled out of the bar. */
|
|
158
|
+
iconSpills: boolean;
|
|
159
|
+
/** The spilled caption's width (its widest title line or the meta line), or null when it stays in the bar. */
|
|
160
|
+
captionWidth: number | null;
|
|
161
|
+
/** Spilled footnote indicators; 0 when they stay in the bar. */
|
|
162
|
+
footnoteCount: number;
|
|
163
|
+
/** The status dot spilled out of the bar. */
|
|
164
|
+
dotSpills: boolean;
|
|
165
|
+
}
|
|
166
|
+
/** Where each part of a spill column sits; null for a part that is not in it. */
|
|
167
|
+
export interface SpillCluster {
|
|
168
|
+
iconSpillX: number | null;
|
|
169
|
+
captionX: number | null;
|
|
170
|
+
footnoteSpillStartX: number | null;
|
|
171
|
+
dotSpillCx: number | null;
|
|
172
|
+
/** Right edge of the last part, or the column's start when it is empty. */
|
|
173
|
+
rightX: number;
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Lay out a bar's spill column `[icon?] [caption?] [¹²?] [dot?]` from
|
|
177
|
+
* `ITEM_CAPTION_SPILL_GAP_PX` past the bar, one `ITEM_DECORATION_SPILL_GAP_PX`
|
|
178
|
+
* between the parts that are present and none after the last. The item
|
|
179
|
+
* measure reads it to cap a caption at the chart's end, and `sequenceItem`
|
|
180
|
+
* places the parts with it.
|
|
181
|
+
*/
|
|
182
|
+
export declare function layoutSpillCluster(input: SpillClusterInput): SpillCluster;
|
|
70
183
|
/** Side length (px) of the inline-date calendar glyph tile. */
|
|
71
184
|
export declare const INLINE_DATE_GLYPH_TILE_SIZE_PX = 12;
|
|
72
185
|
/** Distance (px) from the bar's left edge to the glyph's left edge
|
|
@@ -97,6 +210,81 @@ export declare const INLINE_DATE_GLYPH_GAP_PX = 4;
|
|
|
97
210
|
* glyphs don't overlap inside narrow bars.
|
|
98
211
|
*/
|
|
99
212
|
export declare const MIN_BAR_WIDTH_FOR_INLINE_DATE_PX: number;
|
|
213
|
+
/**
|
|
214
|
+
* True when a bar of painted width `barWidth` is too narrow to host the
|
|
215
|
+
* inline-date glyph inside, so it spills (`before:` right, `after:` left).
|
|
216
|
+
* The one threshold behind the glyph's `spilled` flag and the caption
|
|
217
|
+
* inset's decision to reserve room for it.
|
|
218
|
+
*/
|
|
219
|
+
export declare function inlineDateGlyphSpills(barWidth: number): boolean;
|
|
220
|
+
/**
|
|
221
|
+
* Left x of the `after:` inline-date glyph when it sits INSIDE the bar,
|
|
222
|
+
* for a bar whose left edge is at `leftEdge`:
|
|
223
|
+
*
|
|
224
|
+
* - no link icon: the glyph sits at the leftmost top-decoration slot,
|
|
225
|
+
* `INLINE_DATE_GLYPH_INSET_LEFT_PX` (6) from the edge
|
|
226
|
+
* - link icon: one `INLINE_DATE_GLYPH_GAP_PX` right of the tile's right
|
|
227
|
+
* edge (6 + 14 + 4 = 24 from the edge)
|
|
228
|
+
*
|
|
229
|
+
* The one formula behind both the glyph placement
|
|
230
|
+
* (`computeItemInlineDatePins`) and the caption's left inset
|
|
231
|
+
* (`itemCaptionInsetX`), so the two can never disagree. Pass
|
|
232
|
+
* `leftEdge = 0` to get the offset from the bar's left edge.
|
|
233
|
+
*/
|
|
234
|
+
export declare function itemAfterGlyphInsideLeftX(leftEdge: number, hasLinkIcon: boolean): number;
|
|
235
|
+
/**
|
|
236
|
+
* Left x of the `before:` inline-date glyph when it sits INSIDE the bar,
|
|
237
|
+
* for a bar whose right edge is at `rightEdge`. The glyph walks LEFT
|
|
238
|
+
* from the rightmost top-decoration slot:
|
|
239
|
+
*
|
|
240
|
+
* - rightmost footnote anchors at (rightEdge - INSET_RIGHT_PX)
|
|
241
|
+
* - the leftmost footnote sits one step further left per extra digit
|
|
242
|
+
* - the status dot's left edge sits at (rightEdge - INSET_RIGHT - DOT_RADIUS)
|
|
243
|
+
* - the glyph sits one `INLINE_DATE_GLYPH_GAP_PX` further left than
|
|
244
|
+
* whichever of those is leftmost (footnotes win when present, since
|
|
245
|
+
* they are always left of the dot)
|
|
246
|
+
*
|
|
247
|
+
* The one formula behind both the glyph placement
|
|
248
|
+
* (`computeItemInlineDatePins`) and the title first-line clearance
|
|
249
|
+
* (`itemTitleFirstLineRightReservePx`), so the two can never disagree.
|
|
250
|
+
* Pass `rightEdge = 0` to get the offset from the bar's right edge
|
|
251
|
+
* (negative, inside the bar) with exact integer arithmetic.
|
|
252
|
+
*/
|
|
253
|
+
export declare function itemBeforeGlyphInsideLeftX(rightEdge: number, footnoteCount: number): number;
|
|
254
|
+
export interface ItemTitleFirstLineReserveInputs {
|
|
255
|
+
/** Painted bar width (px): `box.width`. */
|
|
256
|
+
barWidth: number;
|
|
257
|
+
/**
|
|
258
|
+
* Footnote indicator labels in the order the renderer paints them,
|
|
259
|
+
* left to right (ascending footnote number). Empty when the item
|
|
260
|
+
* carries no footnote.
|
|
261
|
+
*/
|
|
262
|
+
footnoteLabels: readonly string[];
|
|
263
|
+
/** True when the item has an inline `before:DATE` glyph. */
|
|
264
|
+
hasBeforeGlyph: boolean;
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Right-side space (px) the FIRST title line must leave free, measured
|
|
268
|
+
* from the bar's right edge: the larger of the plain right inset
|
|
269
|
+
* (`ITEM_CAPTION_INSET_X_PX`) and the distance to the top-right
|
|
270
|
+
* cluster's left edge plus `ITEM_DECORATION_SPILL_GAP_PX` of air.
|
|
271
|
+
*
|
|
272
|
+
* The cluster is the leftmost of three parts, each counted only when it
|
|
273
|
+
* renders INSIDE the bar (a narrow bar spills it into the column to the
|
|
274
|
+
* right instead, where it can't touch the title):
|
|
275
|
+
*
|
|
276
|
+
* - status dot: left edge at (right - 17); absent below
|
|
277
|
+
* `MIN_BAR_WIDTH_FOR_DOT_PX` (24). Dot only gives 21.
|
|
278
|
+
* - footnote digits: leftmost digit's left edge at
|
|
279
|
+
* (right - 22 - (n-1) * 8 - width); absent when they spill
|
|
280
|
+
* (`MIN_BAR_WIDTH_FOR_FOOTNOTE_PX`).
|
|
281
|
+
* - `before:` glyph: its left x, from `itemBeforeGlyphInsideLeftX`;
|
|
282
|
+
* absent when it spills (`MIN_BAR_WIDTH_FOR_INLINE_DATE_PX`).
|
|
283
|
+
*
|
|
284
|
+
* Offsets are computed from a right edge of 0 (inside the bar is
|
|
285
|
+
* negative) so the common cases are exact integers.
|
|
286
|
+
*/
|
|
287
|
+
export declare function itemTitleFirstLineRightReservePx(opts: ItemTitleFirstLineReserveInputs): number;
|
|
100
288
|
/** Height (px) of a label chip rectangle. */
|
|
101
289
|
export declare const LABEL_CHIP_HEIGHT_PX = 13;
|
|
102
290
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"item-bar-geometry.d.ts","sourceRoot":"","sources":["../src/item-bar-geometry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"item-bar-geometry.d.ts","sourceRoot":"","sources":["../src/item-bar-geometry.ts"],"names":[],"mappings":"AAoBA,wEAAwE;AACxE,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAE1C;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,IAAI,CAAC;AAE3C,8DAA8D;AAC9D,eAAO,MAAM,qCAAqC,KAAK,CAAC;AAExD,2EAA2E;AAC3E,eAAO,MAAM,oCAAoC,KAAK,CAAC;AAEvD,wCAAwC;AACxC,eAAO,MAAM,+BAA+B,KAAK,CAAC;AAElD,uCAAuC;AACvC,eAAO,MAAM,8BAA8B,KAAK,CAAC;AAEjD;;;;;GAKG;AACH,eAAO,MAAM,iCAAiC,KAAK,CAAC;AAEpD;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,IAAI,CAAC;AAE9C;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAKvE;AAED;;;;GAIG;AACH,wBAAgB,6BAA6B,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,E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