@tasknotes/calendar 0.1.3 → 0.1.4

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/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.4
4
+
5
+ ### Added
6
+
7
+ - `dateStrip` puts the agenda's date strip above day, multi-day and week views. Picking a strip day moves the grid there, and items can be dropped on strip days.
8
+ - Agenda lists can show a lead section above the first day (`listLeadTitle`, `listLeadIncludes`, `listLeadDidMount`) and an add row under every day (`listAddText`, `onListAdd`).
9
+ - The strip shows a Today chip when it is away from today.
10
+ - `ViewInfo.dataRange` covers the days a strip shows past the visible range, so hosts can load items for every strip dot.
11
+
12
+ ### Changed
13
+
14
+ - The date strip belongs to the calendar rather than the list, so it keeps its state (and any host controls in its slot) across navigation and view changes.
15
+
3
16
  ## 0.1.3
4
17
 
5
18
  ### Added
package/README.md CHANGED
@@ -73,7 +73,11 @@ custom DOM. The exported `CalendarOptions<D>` type documents the full API.
73
73
  - `monthDisplay: "dots"` draws every item in a month cell as a small dot (`--tnc-dot-size`, `--tnc-dot-gap`) that wraps across the cell, with "+N" when they do not fit; `dayMaxEvents` caps the dots (`false` lets cells grow). The day cell is the tap target: dots ignore the pointer, are `aria-hidden`, get no content hook, and the cell is labelled "<date>, N items" (`text.itemCount`). Items in dots have `variant: "indicator"`; colour them with `color` or `itemDidMount` setting `--tnc-c`.
74
74
  - **"+N more" height**: day rows (and the time grid's all-day row) make room for the link at its rendered height, so a host may give it a 44px touch target (`--tnc-more-h`, or any min-height) without overflowing the row.
75
75
  - `listStart: "date" | "week"`: the list view starts at the date (default; FullCalendar `duration: { days: n }` lists, as the TaskNotes plugin and app used) or at the start of its week (FullCalendar's stock `listWeek`); week-aligned lists step by whole weeks.
76
- - `listAgenda: boolean`: turns the list view into a phone-style agenda. A date strip shows one week, or the whole month after a tap on its title, with a dot on busy days and the day at the top of the list marked. Below it, every day gets a section, empty days included, and more days load as the list nears its end. Picking a strip day scrolls the list to it and reports it through `onDateClick`. Rows can be dragged onto another day's section or a strip day; timed items keep their time. At `height: "auto"` the strip sticks to the top of the page; set `--tnc-sticky-top` to keep it below a fixed host header.
76
+ - `listAgenda: boolean`: turns the list view into a phone-style agenda. A date strip shows one week, or the whole month after a tap on its title, with a dot on busy days and the day at the top of the list marked. Below it, every day gets a section, empty days included, and more days load as the list nears its end. Picking a strip day scrolls the list to it and reports it through `onDateClick`. Rows can be dragged onto another day's section or a strip day; timed items keep their time. At `height: "auto"` the strip sticks to the top of the page; set `--tnc-sticky-top` to keep it below a fixed host header. A Today chip appears in the strip's header when the list is away from today. Hosts can mount controls after the strip's arrows with `stripSlotDidMount`.
77
+ - `dateStrip: boolean`: puts the same strip above the `day`, `days` and `week` views. Picking a day moves the grid to it, the rest of the grid's range is tinted, and items dragged onto a strip day move there at the same time.
78
+ - `listLeadTitle: string | null` and `listLeadIncludes(item)`: in an agenda, a section above the first day holds the items `listLeadIncludes` picks out (overdue work, say) instead of their days. `listLeadDidMount` gives hosts a slot in its header for actions.
79
+ - `listAddText: string | null` and `onListAdd(arg)`: in an agenda, an add row under every day, reported with that day.
80
+ - `ViewInfo.dataRange`: the visible range, run on to the end of the days a strip shows. Load items for `dataRange` so every strip day gets its dot; `onRangeChange` also fires when only it changes.
77
81
 
78
82
  ### Timeline
79
83
 
@@ -162,4 +166,4 @@ Append `-- --update-snapshots` to the test command to regenerate baselines
162
166
  the date, timezone, locale, viewport, colour scheme and motion preference.
163
167
  Keep the image version and the exact `@playwright/test` pin in sync.
164
168
 
165
- The playground reads URL parameters (`view`, `tz`, `locale`, `date`, `theme`, `stress`, `height`, `capacity`, `display=dots`, `listStart=week`, `agenda=1`) and exposes `window.tnc` for scripted checks.
169
+ The playground reads URL parameters (`view`, `tz`, `locale`, `date`, `theme`, `stress`, `height`, `capacity`, `display=dots`, `listStart=week`, `agenda=1` (agenda list and day strips with add rows), `lead=1` (a Due lead section)) and exposes `window.tnc` for scripted checks.
package/dist/calendar.css CHANGED
@@ -876,12 +876,12 @@
876
876
  }
877
877
 
878
878
  /* ---------------------------------------------------------------- agenda */
879
- .tnc-list--agenda {
880
- --tnc-strip-cell: 40px;
881
- }
882
879
  .tnc-strip {
880
+ --tnc-strip-cell: 40px;
883
881
  flex: none;
884
- z-index: 3;
882
+ /* Above a time grid's sticky header and now line; popovers stay on top. */
883
+ position: relative;
884
+ z-index: 55;
885
885
  padding: 6px 4px 0;
886
886
  background: var(--tnc-surface);
887
887
  border-bottom: 1px solid var(--tnc-line);
@@ -894,6 +894,9 @@
894
894
  position: sticky;
895
895
  top: var(--tnc-sticky-top, 0px);
896
896
  }
897
+ .tnc--height-auto.tnc--has-strip .tnc-tg-top {
898
+ top: calc(var(--tnc-sticky-top, 0px) + var(--tnc-strip-h, 0px));
899
+ }
897
900
  .tnc--height-auto .tnc-list--agenda .tnc-list-day {
898
901
  top: calc(var(--tnc-sticky-top, 0px) + var(--tnc-strip-h, 0px));
899
902
  }
@@ -935,6 +938,24 @@
935
938
  .tnc-strip.is-expanded .tnc-strip-caret {
936
939
  transform: rotate(180deg);
937
940
  }
941
+ .tnc-strip-today {
942
+ margin-right: 4px;
943
+ padding: 4px 10px;
944
+ border: 1px solid var(--tnc-line-strong);
945
+ border-radius: 999px;
946
+ background: none;
947
+ color: var(--tnc-text);
948
+ font: inherit;
949
+ font-size: var(--tnc-small);
950
+ font-weight: 600;
951
+ cursor: pointer;
952
+ }
953
+ .tnc-strip-today[hidden] {
954
+ display: none;
955
+ }
956
+ .tnc-strip-today:hover {
957
+ background: var(--tnc-surface-2);
958
+ }
938
959
  .tnc-strip-slot {
939
960
  display: flex;
940
961
  align-items: center;
@@ -1025,6 +1046,9 @@
1025
1046
  color: var(--tnc-accent-text);
1026
1047
  font-weight: 700;
1027
1048
  }
1049
+ .tnc-strip-day.is-in-range .tnc-strip-num {
1050
+ background: var(--tnc-accent-soft);
1051
+ }
1028
1052
  .tnc-strip-day:hover .tnc-strip-num {
1029
1053
  background: var(--tnc-surface-2);
1030
1054
  }
@@ -1037,6 +1061,7 @@
1037
1061
  }
1038
1062
  .tnc-strip-day:focus-visible,
1039
1063
  .tnc-strip-title:focus-visible,
1064
+ .tnc-strip-today:focus-visible,
1040
1065
  .tnc-strip-nav:focus-visible {
1041
1066
  outline: 2px solid var(--tnc-accent);
1042
1067
  outline-offset: -2px;
@@ -1064,9 +1089,55 @@
1064
1089
  color: var(--tnc-faint);
1065
1090
  font-weight: 600;
1066
1091
  }
1067
- .tnc-list--agenda .tnc-list-section.is-empty .tnc-list-rows {
1092
+ .tnc-list--agenda .tnc-list-section.is-empty:not(:has(.tnc-list-add)) .tnc-list-rows {
1068
1093
  min-height: 28px;
1069
1094
  }
1095
+ .tnc-list-lead-head {
1096
+ display: flex;
1097
+ align-items: center;
1098
+ gap: 8px;
1099
+ color: var(--tnc-text);
1100
+ }
1101
+ .tnc-list-lead-title {
1102
+ margin-right: auto;
1103
+ }
1104
+ .tnc-list-lead-slot {
1105
+ display: flex;
1106
+ align-items: center;
1107
+ font-weight: 400;
1108
+ }
1109
+ .tnc-list-lead-slot:empty {
1110
+ display: none;
1111
+ }
1112
+ .tnc-list-add {
1113
+ display: block;
1114
+ width: 100%;
1115
+ padding: 6px 10px;
1116
+ border: 0;
1117
+ background: none;
1118
+ color: var(--tnc-muted);
1119
+ font: inherit;
1120
+ font-size: var(--tnc-small);
1121
+ text-align: left;
1122
+ cursor: pointer;
1123
+ }
1124
+ .tnc-list-add::before {
1125
+ content: "+";
1126
+ display: inline-block;
1127
+ width: 1em;
1128
+ margin-right: 6px;
1129
+ color: var(--tnc-accent);
1130
+ font-weight: 700;
1131
+ text-align: center;
1132
+ }
1133
+ .tnc-list-add:hover {
1134
+ color: var(--tnc-accent);
1135
+ background: var(--tnc-surface-2);
1136
+ }
1137
+ .tnc-list-add:focus-visible {
1138
+ outline: 2px solid var(--tnc-accent);
1139
+ outline-offset: -2px;
1140
+ }
1070
1141
  .tnc-list-more {
1071
1142
  height: 1px;
1072
1143
  }