@tasknotes/calendar 0.1.2 → 0.1.3
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 +10 -0
- package/README.md +2 -1
- package/dist/calendar.css +196 -0
- package/dist/cjs/index.cjs +358 -29
- package/dist/cjs/react.cjs +358 -29
- package/dist/esm/{chunk-ZJQMMA6W.js → chunk-XHPZ7K4W.js} +358 -29
- package/dist/esm/index.js +1 -1
- package/dist/esm/react.js +1 -1
- package/dist/types/dom/calendar.d.cts +8 -0
- package/dist/types/dom/calendar.d.ts +8 -0
- package/dist/types/dom/context.d.cts +8 -0
- package/dist/types/dom/context.d.ts +8 -0
- package/dist/types/dom/options.d.cts +19 -0
- package/dist/types/dom/options.d.ts +19 -0
- package/dist/types/dom/views/list.d.cts +23 -2
- package/dist/types/dom/views/list.d.ts +23 -2
- package/dist/types/dom/views/strip.d.cts +43 -0
- package/dist/types/dom/views/strip.d.ts +43 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.3
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- `listAgenda` turns the list view into a phone-style agenda. A date strip sits above a list of every day, and more days load as you scroll. The strip shows a week, or the month after a tap on its title. It marks busy days and follows the day at the top of the list. Picking a strip day scrolls the list to it. Rows can be dragged onto another day or a strip day.
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
- On touch screens, a swipe that starts on a draggable item scrolls whatever actually scrolls. At `height: "auto"` that is the page, which these swipes did not scroll before.
|
|
12
|
+
|
|
3
13
|
## 0.1.2
|
|
4
14
|
|
|
5
15
|
### Changed
|
package/README.md
CHANGED
|
@@ -73,6 +73,7 @@ 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
77
|
|
|
77
78
|
### Timeline
|
|
78
79
|
|
|
@@ -161,4 +162,4 @@ Append `-- --update-snapshots` to the test command to regenerate baselines
|
|
|
161
162
|
the date, timezone, locale, viewport, colour scheme and motion preference.
|
|
162
163
|
Keep the image version and the exact `@playwright/test` pin in sync.
|
|
163
164
|
|
|
164
|
-
The playground reads URL parameters (`view`, `tz`, `locale`, `date`, `theme`, `stress`, `height`, `capacity`, `display=dots`, `listStart=week`) and exposes `window.tnc` for scripted checks.
|
|
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.
|
package/dist/calendar.css
CHANGED
|
@@ -875,6 +875,202 @@
|
|
|
875
875
|
color: var(--tnc-faint);
|
|
876
876
|
}
|
|
877
877
|
|
|
878
|
+
/* ---------------------------------------------------------------- agenda */
|
|
879
|
+
.tnc-list--agenda {
|
|
880
|
+
--tnc-strip-cell: 40px;
|
|
881
|
+
}
|
|
882
|
+
.tnc-strip {
|
|
883
|
+
flex: none;
|
|
884
|
+
z-index: 3;
|
|
885
|
+
padding: 6px 4px 0;
|
|
886
|
+
background: var(--tnc-surface);
|
|
887
|
+
border-bottom: 1px solid var(--tnc-line);
|
|
888
|
+
/* Vertical pans scroll the page; sideways swipes step the strip. */
|
|
889
|
+
touch-action: pan-y;
|
|
890
|
+
user-select: none;
|
|
891
|
+
}
|
|
892
|
+
/* At auto height the page scrolls, so the strip sticks below `--tnc-sticky-top`. */
|
|
893
|
+
.tnc--height-auto .tnc-strip {
|
|
894
|
+
position: sticky;
|
|
895
|
+
top: var(--tnc-sticky-top, 0px);
|
|
896
|
+
}
|
|
897
|
+
.tnc--height-auto .tnc-list--agenda .tnc-list-day {
|
|
898
|
+
top: calc(var(--tnc-sticky-top, 0px) + var(--tnc-strip-h, 0px));
|
|
899
|
+
}
|
|
900
|
+
.tnc--height-auto .tnc-list--agenda .tnc-list-section {
|
|
901
|
+
scroll-margin-top: calc(var(--tnc-sticky-top, 0px) + var(--tnc-strip-h, 0px));
|
|
902
|
+
}
|
|
903
|
+
.tnc-strip-head {
|
|
904
|
+
display: flex;
|
|
905
|
+
align-items: center;
|
|
906
|
+
gap: 2px;
|
|
907
|
+
padding: 0 6px 6px;
|
|
908
|
+
}
|
|
909
|
+
.tnc-strip-title {
|
|
910
|
+
display: inline-flex;
|
|
911
|
+
align-items: center;
|
|
912
|
+
gap: 6px;
|
|
913
|
+
margin-right: auto;
|
|
914
|
+
padding: 4px 6px;
|
|
915
|
+
border: 0;
|
|
916
|
+
border-radius: var(--tnc-radius);
|
|
917
|
+
background: none;
|
|
918
|
+
color: var(--tnc-text);
|
|
919
|
+
font: inherit;
|
|
920
|
+
font-size: 15px;
|
|
921
|
+
font-weight: 650;
|
|
922
|
+
cursor: pointer;
|
|
923
|
+
}
|
|
924
|
+
.tnc-strip-caret {
|
|
925
|
+
width: 0;
|
|
926
|
+
height: 0;
|
|
927
|
+
border-left: 5px solid transparent;
|
|
928
|
+
border-right: 5px solid transparent;
|
|
929
|
+
border-top: 6px solid currentColor;
|
|
930
|
+
transition: transform 0.15s;
|
|
931
|
+
}
|
|
932
|
+
.tnc-strip.is-expanded .tnc-strip-title {
|
|
933
|
+
color: var(--tnc-accent);
|
|
934
|
+
}
|
|
935
|
+
.tnc-strip.is-expanded .tnc-strip-caret {
|
|
936
|
+
transform: rotate(180deg);
|
|
937
|
+
}
|
|
938
|
+
.tnc-strip-slot {
|
|
939
|
+
display: flex;
|
|
940
|
+
align-items: center;
|
|
941
|
+
}
|
|
942
|
+
.tnc-strip-slot:empty {
|
|
943
|
+
display: none;
|
|
944
|
+
}
|
|
945
|
+
.tnc-strip-nav {
|
|
946
|
+
width: 32px;
|
|
947
|
+
height: 32px;
|
|
948
|
+
border: 0;
|
|
949
|
+
border-radius: var(--tnc-radius);
|
|
950
|
+
background: none;
|
|
951
|
+
color: var(--tnc-muted);
|
|
952
|
+
font-size: 20px;
|
|
953
|
+
line-height: 1;
|
|
954
|
+
cursor: pointer;
|
|
955
|
+
}
|
|
956
|
+
.tnc-strip-title:hover,
|
|
957
|
+
.tnc-strip-nav:hover {
|
|
958
|
+
background: var(--tnc-surface-2);
|
|
959
|
+
}
|
|
960
|
+
.tnc-strip-dows,
|
|
961
|
+
.tnc-strip-grid {
|
|
962
|
+
display: grid;
|
|
963
|
+
grid-template-columns: repeat(7, minmax(0, 1fr));
|
|
964
|
+
}
|
|
965
|
+
.tnc-strip-dows span {
|
|
966
|
+
padding-bottom: 4px;
|
|
967
|
+
text-align: center;
|
|
968
|
+
color: var(--tnc-muted);
|
|
969
|
+
font-size: var(--tnc-small);
|
|
970
|
+
font-weight: 600;
|
|
971
|
+
}
|
|
972
|
+
.tnc-strip-day {
|
|
973
|
+
position: relative;
|
|
974
|
+
display: flex;
|
|
975
|
+
flex-direction: column;
|
|
976
|
+
align-items: center;
|
|
977
|
+
justify-content: center;
|
|
978
|
+
min-height: calc(var(--tnc-strip-cell) + 10px);
|
|
979
|
+
padding: 0;
|
|
980
|
+
border: 0;
|
|
981
|
+
border-radius: var(--tnc-radius);
|
|
982
|
+
background: none;
|
|
983
|
+
color: var(--tnc-text);
|
|
984
|
+
font: inherit;
|
|
985
|
+
cursor: pointer;
|
|
986
|
+
}
|
|
987
|
+
.tnc-strip-num {
|
|
988
|
+
display: grid;
|
|
989
|
+
place-items: center;
|
|
990
|
+
width: min(var(--tnc-strip-cell), 100%);
|
|
991
|
+
aspect-ratio: 1;
|
|
992
|
+
border-radius: 50%;
|
|
993
|
+
font-size: 15px;
|
|
994
|
+
font-variant-numeric: tabular-nums;
|
|
995
|
+
}
|
|
996
|
+
.tnc-strip-month {
|
|
997
|
+
position: absolute;
|
|
998
|
+
top: 0;
|
|
999
|
+
color: var(--tnc-muted);
|
|
1000
|
+
font-size: 10px;
|
|
1001
|
+
font-weight: 650;
|
|
1002
|
+
line-height: 1;
|
|
1003
|
+
}
|
|
1004
|
+
.tnc-strip-dot {
|
|
1005
|
+
width: 5px;
|
|
1006
|
+
height: 5px;
|
|
1007
|
+
margin-top: 1px;
|
|
1008
|
+
border-radius: 50%;
|
|
1009
|
+
visibility: hidden;
|
|
1010
|
+
background: var(--tnc-muted);
|
|
1011
|
+
}
|
|
1012
|
+
.tnc-strip-day.has-items .tnc-strip-dot {
|
|
1013
|
+
visibility: visible;
|
|
1014
|
+
}
|
|
1015
|
+
.tnc-strip-day.is-past,
|
|
1016
|
+
.tnc-strip-day.is-other-month {
|
|
1017
|
+
color: var(--tnc-faint);
|
|
1018
|
+
}
|
|
1019
|
+
.tnc-strip-day.is-today .tnc-strip-num {
|
|
1020
|
+
color: var(--tnc-accent);
|
|
1021
|
+
font-weight: 700;
|
|
1022
|
+
}
|
|
1023
|
+
.tnc-strip-day.is-focus .tnc-strip-num {
|
|
1024
|
+
background: var(--tnc-accent);
|
|
1025
|
+
color: var(--tnc-accent-text);
|
|
1026
|
+
font-weight: 700;
|
|
1027
|
+
}
|
|
1028
|
+
.tnc-strip-day:hover .tnc-strip-num {
|
|
1029
|
+
background: var(--tnc-surface-2);
|
|
1030
|
+
}
|
|
1031
|
+
.tnc-strip-day.is-focus:hover .tnc-strip-num {
|
|
1032
|
+
background: var(--tnc-accent);
|
|
1033
|
+
}
|
|
1034
|
+
.tnc-strip-day.is-drop-target .tnc-strip-num {
|
|
1035
|
+
box-shadow: 0 0 0 2px var(--tnc-accent);
|
|
1036
|
+
background: var(--tnc-accent-soft);
|
|
1037
|
+
}
|
|
1038
|
+
.tnc-strip-day:focus-visible,
|
|
1039
|
+
.tnc-strip-title:focus-visible,
|
|
1040
|
+
.tnc-strip-nav:focus-visible {
|
|
1041
|
+
outline: 2px solid var(--tnc-accent);
|
|
1042
|
+
outline-offset: -2px;
|
|
1043
|
+
}
|
|
1044
|
+
.tnc-strip-handle {
|
|
1045
|
+
display: block;
|
|
1046
|
+
width: 36px;
|
|
1047
|
+
height: 14px;
|
|
1048
|
+
margin: 0 auto;
|
|
1049
|
+
padding: 0;
|
|
1050
|
+
border: 0;
|
|
1051
|
+
background: none;
|
|
1052
|
+
cursor: pointer;
|
|
1053
|
+
}
|
|
1054
|
+
.tnc-strip-handle::before {
|
|
1055
|
+
content: "";
|
|
1056
|
+
display: block;
|
|
1057
|
+
width: 36px;
|
|
1058
|
+
height: 4px;
|
|
1059
|
+
margin: 0 auto;
|
|
1060
|
+
border-radius: 2px;
|
|
1061
|
+
background: var(--tnc-line-strong);
|
|
1062
|
+
}
|
|
1063
|
+
.tnc-list--agenda .tnc-list-section.is-empty .tnc-list-day {
|
|
1064
|
+
color: var(--tnc-faint);
|
|
1065
|
+
font-weight: 600;
|
|
1066
|
+
}
|
|
1067
|
+
.tnc-list--agenda .tnc-list-section.is-empty .tnc-list-rows {
|
|
1068
|
+
min-height: 28px;
|
|
1069
|
+
}
|
|
1070
|
+
.tnc-list-more {
|
|
1071
|
+
height: 1px;
|
|
1072
|
+
}
|
|
1073
|
+
|
|
878
1074
|
/* ------------------------------------------------------------------ year */
|
|
879
1075
|
.tnc-year {
|
|
880
1076
|
display: flex;
|