@open-webapp/calendar 0.10.0 → 0.11.1
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/README.md +8 -0
- package/dist/core/events.d.ts +1 -4
- package/dist/core/events.js +10 -11
- package/dist/testing/storageContract.js +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -215,6 +215,10 @@ The host owns theme-picker UI and preference persistence (for example, saving a
|
|
|
215
215
|
|
|
216
216
|
The exported standalone selector keeps its single-list props and behavior; Select all adds only search matches while retaining existing selections.
|
|
217
217
|
|
|
218
|
+
### Day headers
|
|
219
|
+
|
|
220
|
+
Sticky day headers show `Today · Sunday`, `Tomorrow · Monday`, or just the full English weekday for other dates. The weekday follows the date key without timezone shifts, including across year boundaries; Today remains the browser-local date. Vertical ribbon labels continue to show Month Day (for example, `Oct 26`), with the existing layout and styling.
|
|
221
|
+
|
|
218
222
|
### Host CSS
|
|
219
223
|
|
|
220
224
|
Day ribbon styling: each day's ribbon alternates between two tones by day parity (`data-parity="even|odd"`), set with `--calendar-day-ribbon-a` and `--calendar-day-ribbon-b`. Parity is stable across scroll, filtering and month boundaries, and the ribbon does not mark today. Labels center in the actual ribbon/viewport intersection below the measured chips and that day's header, including empty Today before an event day. Short ribbons center within their bounds. Scroll, resize, rendered-content and mounted theme changes update measurements; `--calendar-day-header-height` no longer positions the label.
|
|
@@ -231,6 +235,10 @@ The shared `.calendar-selector-trigger` uses border-box inline-flex, centered al
|
|
|
231
235
|
|
|
232
236
|
Done, Select all and Clear use the approved action-only flat styling via `.calendar-selector-actions > button` in standalone and grouped footer dropdowns: transparent resting background, zero border, no shadow, inherited font, `--calendar-selector-text` color and pointer cursor. Hover uses `--calendar-hover`; pointer focus has no decorative outline, while keyboard `:focus-visible` uses a 2px solid `--calendar-focus` outline with 2px offset. Action padding, row flex layout and 8px gap/top/bottom margins, footer/dropdown geometry, trigger/search/option styling, other native controls and all selection, callback and focus-return contracts are preserved.
|
|
233
237
|
|
|
238
|
+
## 0.11.1 (patch)
|
|
239
|
+
|
|
240
|
+
- Pin the storage contract harness's injected controller clock near its literal legacy fixtures so adapter checks remain deterministic as the wall clock advances. Regression coverage runs the contract with wall clocks in 2000 and 2100.
|
|
241
|
+
|
|
234
242
|
## 0.10.0 (BREAKING pre-1.0 minor)
|
|
235
243
|
|
|
236
244
|
- Approved CalendarPane selector-popup geometry correction: the upward popup is aligned to the trigger's left edge, adapts to the pane's 16px content inset, and uses the pane/viewport space above the trigger as its complete height budget. Options shrink and scroll before search/actions become inaccessible.
|
package/dist/core/events.d.ts
CHANGED
|
@@ -54,10 +54,7 @@ export interface DayGroup {
|
|
|
54
54
|
export declare function groupByDay(events: CalendarEvent[], todayIso?: string): DayGroup[];
|
|
55
55
|
/** Short "Mmm D" label for the day ribbon: no year, no Today/Tomorrow. */
|
|
56
56
|
export declare function formatRibbonLabel(dateKey: string): string;
|
|
57
|
-
/**
|
|
58
|
-
* "Today · Sept 26" / "Tomorrow · Sept 27" / else "Sept 28"-style.
|
|
59
|
-
* Includes year only when the event's year differs from today's year.
|
|
60
|
-
*/
|
|
57
|
+
/** Full English weekday, prefixed with Today/Tomorrow relative to the local today key. */
|
|
61
58
|
export declare function formatDayHeader(dateKey: string, today: string): string;
|
|
62
59
|
interface RawEvent {
|
|
63
60
|
id?: unknown;
|
package/dist/core/events.js
CHANGED
|
@@ -176,20 +176,19 @@ function addDaysToIso(dateKey, days) {
|
|
|
176
176
|
// d is built from pure UTC parts (not "now"), so the UTC date is the right one.
|
|
177
177
|
return d.toISOString().slice(0, 10);
|
|
178
178
|
}
|
|
179
|
-
/**
|
|
180
|
-
* "Today · Sept 26" / "Tomorrow · Sept 27" / else "Sept 28"-style.
|
|
181
|
-
* Includes year only when the event's year differs from today's year.
|
|
182
|
-
*/
|
|
179
|
+
/** Full English weekday, prefixed with Today/Tomorrow relative to the local today key. */
|
|
183
180
|
export function formatDayHeader(dateKey, today) {
|
|
184
|
-
const { year
|
|
185
|
-
|
|
186
|
-
const
|
|
187
|
-
|
|
181
|
+
const { year, month, day } = parseIsoDateParts(dateKey);
|
|
182
|
+
// The key is a calendar date, not an instant to shift into the browser timezone.
|
|
183
|
+
const weekday = new Date(Date.UTC(year, month - 1, day)).toLocaleDateString('en-US', {
|
|
184
|
+
weekday: 'long',
|
|
185
|
+
timeZone: 'UTC',
|
|
186
|
+
});
|
|
188
187
|
if (dateKey === today)
|
|
189
|
-
return `Today · ${
|
|
188
|
+
return `Today · ${weekday}`;
|
|
190
189
|
if (dateKey === addDaysToIso(today, 1))
|
|
191
|
-
return `Tomorrow · ${
|
|
192
|
-
return
|
|
190
|
+
return `Tomorrow · ${weekday}`;
|
|
191
|
+
return weekday;
|
|
193
192
|
}
|
|
194
193
|
const JOIN_URL_REGEX = /https?:\/\/[^\s<>"']*(?:zoom\.us|meet\.google\.com|teams\.microsoft\.com)[^\s<>"']*/i;
|
|
195
194
|
export function deriveSelfResponseStatus(raw) {
|
|
@@ -33,6 +33,8 @@ export function runStorageAdapterContract(factory) {
|
|
|
33
33
|
getToken: async () => 't',
|
|
34
34
|
storage: h.storage,
|
|
35
35
|
crypto,
|
|
36
|
+
// Keep literal legacy fixtures inside the read-time window, regardless of wall clock.
|
|
37
|
+
now: () => new Date('2026-10-09T12:00:00.000Z'),
|
|
36
38
|
});
|
|
37
39
|
await c.refresh();
|
|
38
40
|
return { events: c.getEvents(), selected: c.getSelectedIds('src') };
|