@nomideusz/svelte-calendar 1.7.0 → 1.8.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/README.md +62 -0
- package/dist/adapters/ics.d.ts +60 -0
- package/dist/adapters/ics.js +682 -0
- package/dist/adapters/index.d.ts +2 -0
- package/dist/adapters/index.js +1 -0
- package/dist/calendar/Calendar.svelte +4 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -0
- package/dist/text-fit.js +14 -4
- package/package.json +1 -1
- package/widget/widget.js +1 -1
package/dist/adapters/index.js
CHANGED
|
@@ -5,4 +5,5 @@ export { createMappedAdapter } from './mapped.js';
|
|
|
5
5
|
export { createCompositeAdapter } from './composite.js';
|
|
6
6
|
export { withInitialEvents } from './seeded.js';
|
|
7
7
|
export { createJmapAdapter } from './jmap.js';
|
|
8
|
+
export { createIcsAdapter, parseIcs, toIcs, googleCalendarUrl, outlookCalendarUrl } from './ics.js';
|
|
8
9
|
export { CalendarReadOnlyError, EventNotFoundError, isReadOnlyError, isNotFoundError } from './errors.js';
|
|
@@ -792,6 +792,10 @@ const navCtx = $derived({
|
|
|
792
792
|
<style>
|
|
793
793
|
.cal {
|
|
794
794
|
position: relative;
|
|
795
|
+
/* Its own stacking context: the grid's z-indexes (sticky heads, the
|
|
796
|
+
now-line, drag ghosts — up to 30) stay inside the calendar instead
|
|
797
|
+
of rising over a host page's sticky header. */
|
|
798
|
+
isolation: isolate;
|
|
795
799
|
width: 100%;
|
|
796
800
|
min-width: 0;
|
|
797
801
|
height: var(--cal-h, 600px);
|
package/dist/index.d.ts
CHANGED
|
@@ -8,8 +8,9 @@ export type { CalendarContext } from './views/shared/context.svelte.js';
|
|
|
8
8
|
export { createEventStore, createViewState, createSelection, createDragState, } from './engine/index.js';
|
|
9
9
|
export type { EventStore, ViewState, ViewStateOptions, CalendarViewId, BuiltInViewId, ViewMode, Selection as CalendarSelection, DragState, DragMode, DragPayload, } from './engine/index.js';
|
|
10
10
|
export { createMemoryAdapter, createRestAdapter, createRecurringAdapter, createMappedAdapter, createCompositeAdapter, createJmapAdapter, withInitialEvents } from './adapters/index.js';
|
|
11
|
+
export { createIcsAdapter, parseIcs, toIcs, googleCalendarUrl, outlookCalendarUrl } from './adapters/index.js';
|
|
11
12
|
export { CalendarReadOnlyError, EventNotFoundError, isReadOnlyError, isNotFoundError } from './adapters/index.js';
|
|
12
|
-
export type { CalendarAdapter, WritableCalendarAdapter, DateRange, MemoryAdapterOptions, RestAdapterOptions, RecurringEvent, RecurringAdapterOptions, FieldMapping, MappedAdapterOptions, MutationHandler, CompositeAdapterOptions, JmapClient, JmapCalendarAdapterOptions, } from './adapters/index.js';
|
|
13
|
+
export type { CalendarAdapter, WritableCalendarAdapter, DateRange, MemoryAdapterOptions, RestAdapterOptions, RecurringEvent, RecurringAdapterOptions, FieldMapping, MappedAdapterOptions, MutationHandler, CompositeAdapterOptions, JmapClient, JmapCalendarAdapterOptions, IcsCalendar, IcsSource, IcsAdapterOptions, ToIcsOptions, } from './adapters/index.js';
|
|
13
14
|
export { createClock, sod, startOfWeek, addDaysMs, diffDays, fmtH, fmtHParts, fmtTime, fmtDuration, weekdayShort, weekdayLong, monthShort, monthLong, dateShort, dateWithWeekday, fmtDay, fmtWeekRange, setDefaultLocale, getDefaultLocale, is24HourLocale, defaultLabels, setLabels, resetLabels, getLabels, toZonedTime, fromZonedTime, nowInZone, formatInTimeZone, generatePalette, extractAccent, VIVID_PALETTE, isMultiDay, isAllDay, segmentForDay, } from './core/index.js';
|
|
14
15
|
export type { Clock, TimelineEvent, BlockedSlot, DaySegment, CalendarLabels, EventStatus, } from './core/index.js';
|
|
15
16
|
export { auto, neutral, midnight, presets } from './theme/index.js';
|
package/dist/index.js
CHANGED
|
@@ -11,6 +11,7 @@ export { useCalendarContext } from './views/shared/context.svelte.js';
|
|
|
11
11
|
export { createEventStore, createViewState, createSelection, createDragState, } from './engine/index.js';
|
|
12
12
|
// ─── Adapters ───────────────────────────────────────────
|
|
13
13
|
export { createMemoryAdapter, createRestAdapter, createRecurringAdapter, createMappedAdapter, createCompositeAdapter, createJmapAdapter, withInitialEvents } from './adapters/index.js';
|
|
14
|
+
export { createIcsAdapter, parseIcs, toIcs, googleCalendarUrl, outlookCalendarUrl } from './adapters/index.js';
|
|
14
15
|
export { CalendarReadOnlyError, EventNotFoundError, isReadOnlyError, isNotFoundError } from './adapters/index.js';
|
|
15
16
|
// ─── Core: clock, time, locale, types ───────────────────
|
|
16
17
|
export { createClock, sod, startOfWeek, addDaysMs, diffDays, fmtH, fmtHParts, fmtTime, fmtDuration, weekdayShort, weekdayLong, monthShort, monthLong, dateShort, dateWithWeekday, fmtDay, fmtWeekRange, setDefaultLocale, getDefaultLocale, is24HourLocale, defaultLabels, setLabels, resetLabels, getLabels, toZonedTime, fromZonedTime, nowInZone, formatInTimeZone, generatePalette, extractAccent, VIVID_PALETTE, isMultiDay, isAllDay, segmentForDay, } from './core/index.js';
|
package/dist/text-fit.js
CHANGED
|
@@ -194,19 +194,29 @@ export function typeset(text) {
|
|
|
194
194
|
// hole in the paragraph. Set as nowrap, a misfit is plain overflow, which
|
|
195
195
|
// is measurable: re-break a touch narrower, and only then hand the text
|
|
196
196
|
// back to the browser.
|
|
197
|
+
// The lines are for the eye: their break hyphens ("co-" / "dzienne") are
|
|
198
|
+
// hidden from assistive tech, which reads the text whole from a visually
|
|
199
|
+
// hidden copy. Each line keeps the space it broke at (a trailing space
|
|
200
|
+
// is dropped at a nowrap line's end), so find and copy see words.
|
|
201
|
+
const whole = document.createElement('span');
|
|
202
|
+
whole.textContent = text;
|
|
203
|
+
whole.style.cssText =
|
|
204
|
+
'position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap';
|
|
197
205
|
const set = (w) => {
|
|
198
206
|
const lines = breakLines(text, font, w);
|
|
199
|
-
|
|
207
|
+
const spans = lines.map((l, i) => {
|
|
200
208
|
const s = document.createElement('span');
|
|
209
|
+
s.setAttribute('aria-hidden', 'true');
|
|
201
210
|
s.style.display = 'block';
|
|
202
211
|
s.style.whiteSpace = 'nowrap';
|
|
203
212
|
s.style.hyphens = 'manual';
|
|
204
213
|
s.style.textAlign = 'justify';
|
|
205
214
|
s.style.textAlignLast = i === lines.length - 1 ? 'auto' : 'justify';
|
|
206
|
-
s.textContent = l;
|
|
215
|
+
s.textContent = i < lines.length - 1 && !l.endsWith('-') ? l + ' ' : l;
|
|
207
216
|
return s;
|
|
208
|
-
})
|
|
209
|
-
|
|
217
|
+
});
|
|
218
|
+
el.replaceChildren(whole, ...spans);
|
|
219
|
+
for (const s of spans)
|
|
210
220
|
if (s.scrollWidth > s.clientWidth + 1)
|
|
211
221
|
return false;
|
|
212
222
|
return true;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nomideusz/svelte-calendar",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"description": "A themeable Svelte 5 calendar: day, week, scrolling-week and month views, agenda lists, touch-first mobile layouts, drag-and-drop, timezones, a headless API and an embeddable web component.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|